Skip to main content
Share Your Experience: Take the 2024 Developer Survey
2 votes
Accepted

Haskell Parsec parser of Verilog-style number literals

Let's start with your imports. You should get rid of those you don't need, e.g. System.IO, import Data.Either.Extra (fromRight). ...
Zeta's user avatar
  • 19.3k
2 votes

Multiple base numbers parser

do digits <- someParser return $ someFunction digits is just someFunction <$> someParser We can make ...
Zeta's user avatar
  • 19.3k
2 votes

Parsec for primes and fibs

Parsers are for parsing This is probably the strangest primality test I've ever seen. So for those that want to write their own primality test, please don't use this approach. Almost all your ...
Zeta's user avatar
  • 19.3k
1 vote
Accepted

CodeWars - Three-pass compiler for arithmetic expressions

Huh. I never got to solve that kata, so congratulations first. Working with a given AST As you said yourself, the AST type isn't optimal. We could use ...
Zeta's user avatar
  • 19.3k
1 vote
Accepted

Mail merge (Parsec string formatting) example

Instead of notFollowedBy, you can use noneOf in chunk: ...
Zeta's user avatar
  • 19.3k
1 vote

Haskell Parsec library implementation in Scala

The use of stack tracers is somewhat unconventional in a standard parsec implementation, however this appears to be functional. I would recommend having a look at "implementing parsec compilers in ...
Jinuh Zeyuns's user avatar
1 vote

Inefficient Parsec parser to skip unreachable block

First of all, you can batch the skipping of braces (and return ()): ...
bartavelle's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible