Skip to content

Instantly share code, notes, and snippets.

@micahrj
Created February 16, 2010 00:07
Show Gist options
  • Save micahrj/305126 to your computer and use it in GitHub Desktop.
Save micahrj/305126 to your computer and use it in GitHub Desktop.
term = try prefix <|> try paren <|> try name <|> try number <|> try str <?> "term"
prefix = do o <- prefixOper
t <- term
return $ Unary o t
prefixOper = token $ many1 $ oneOf $ nub $ concat prefixes
prefixes :: [String]
prefixes = [ "!"
, "-"
, "~"
, "not" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment