Last active
August 16, 2018 14:22
-
-
Save ChrisPenner/e99c36ed7b4e6f1f2c9086a27e8d9fa3 to your computer and use it in GitHub Desktop.
Lisp Parser in a tweet :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module LispParser where | |
import Text.Megaparsec | |
import Text.Megaparsec.String | |
import Text.Megaparsec.Lexer hiding (space) | |
data E=L[E]|S String|N Integer deriving Show | |
e=(char '('*>(L<$>some e)<*char ')'<|>N<$>integer<|>S<$>some letterChar)<*space::Parser E |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment