All Questions
8 questions
1
vote
1
answer
110
views
Mail merge (Parsec string formatting) example
My intent is to perform "mail merge" where I can write strings like "hi <<name>>" and format them according to a ...
4
votes
1
answer
396
views
Haskell Parsec parser of Verilog-style number literals
I've set myself the task to write a function that parses Verilog-style number literals. In Verilog, numbers are written like this:
8'b10101100, ...
4
votes
1
answer
150
views
Multiple base numbers parser
This code is a Parser that parses numbers according to R5RS.
#b1001 - binary
#o2127 - octal
#h02d - hexadecimal
#d1231 - decimal
3923 - decimal
It is working at ...
3
votes
0
answers
428
views
Haskell s-expression parser and quasiquoter
There are a number of questions on this site about s-expression parsing: e.g., Calculator parsing S-expressions and Code from "Write Yourself a Scheme in 48 Hours" tutorial.
However, these ...
5
votes
1
answer
684
views
Python tokenizer in Haskell + Parsec
I wrote a tokenizer/lexer (difference?) for Python in Haskell: this is my code on GitHub.
I already tested it out with some of CPython's standard library scripts, and it doesn't fail. However, it ...
2
votes
1
answer
106
views
Parsing a component of a regex followed by an optional quantifier character
I have a piece of parsec code that parses a unit optionally followed by ?, + or ...
3
votes
0
answers
119
views
Generation and parsing of English numerals (cardinal and ordinal)
I need to use the English numerals (American) in Haskell, so I looked for a library that did it. I have not found one, therefore I developed the program that I am presenting here. There are actually ...
6
votes
1
answer
1k
views
Using Parsec for lexing&parsing
I'm creating list of Tokens from input [Char] stream using Parsec v3. The definition of Token...