All Questions
Tagged with functional-programming parsing
22 questions
4
votes
7
answers
279
views
Breaking a string expression in operator and operands
Requesting for a code review for a scala implementation.
Problem
Given an expression string made of numbers and operators +,-,/,* , break it in a list of Integer or ...
2
votes
1
answer
201
views
Commented Parser Combinators in Lisp-style C
I've attempted to remedy the issues outlined in the answer to my previous question. I've added several hundred blank lines to better illustrate the grouping of functions and generally make things look ...
2
votes
1
answer
156
views
Parser Combinators in C redux
A few more rewrites down the line from my previous question, this is the C version 11 based on the PostScript prototype version 12. The PostScript version is shorter, but it's some crazy ass ...
4
votes
1
answer
872
views
Haskell: implementing Read for a custom dynamic value type
I'm using Haskell to interpret a dynamically-typed language. I have a sum type called Value which can represent some basic objects:
...
5
votes
1
answer
180
views
Small combinator parsing library in Haskell
I recently wrote code to parse lambda expressions written in a lisp like format, using a small hand-rolled parsing library.
The goal
This code was written as a part of this code-golf challenge not as ...
2
votes
1
answer
2k
views
Simple Haskell Parser
I'm very new to haskell (I never used Monads, Functors and other things) and FP in general. I decided to write the simplest parser I possibly can with some expansion possibilities. (I have a general ...
2
votes
1
answer
104
views
Extract values from English numerals, e.g. "nine million and one"
Though many have done it the other way around, I have not seen such code in many places. And, to be honest, I don't know why this cluster of if-statements, ...
2
votes
1
answer
239
views
JSON Parser, pulls data from a JSON file for analysis
This is the first time I have programmed something that I will actually personally use, so I am happy about that. I tried to write good code whilst applying functional programming concepts. So no ...
10
votes
1
answer
528
views
Lazy, Functional Parser Combinators
Parser Combinators are the amazingly elegant way to write parsers that has evolved over on the functional programming side of the world, but have been less available or accessible for imperative ...
2
votes
0
answers
299
views
A simple tokenizer in Erlang
I'm trying to learn Functional Programming and I picked Erlang because I will have to use it eventually. In the meantime, I'm trying to build a simple lexer to stumble upon problems and solve them ...
5
votes
1
answer
351
views
Collecting YouTube links from a page
I wrote code for my needs (i.e. collecting YouTube links from a page) and it is simple, but now I just want to know what can I do just to make it a better and properly written one. For example, I ...
5
votes
1
answer
592
views
Quadratic Equation Solver v2.0 in Javascript using Functional Programming
I have posted this in continuation to my earlier post Quadratic equation solver in JavaScript.
Tried to improve on the shortcomings last time and also changed the logic. It is still not covering all ...
2
votes
0
answers
533
views
nom Parser in Rust
I'm attempting to make a parser using nom in Rust. Nom implements parser combinators, so more complex parsers are built from simpler parsers. Because of this, I've started with a simple ID token ...
2
votes
1
answer
314
views
Parser Combinators in OO C
In trying to understand and use the Parser Combinator concept, I've coded up as close an analogue as I could manage within the constraints of the C language.
C doesn't have first-class functions or ...
1
vote
2
answers
77
views
Functional method for storing a query string as a simple key-value object
I'm working on an isomorphic javascript module (query-hash) to handle query strings and base64 tokens. It's essentially a simple key-value object with methods for taking in data and giving it back in ...