-- https://stackoverflow.com/questions/44965/what-is-a-monad
parseExpr = parseString <|> parseNumber
parseString = do
char '"'
x <- many (noneOf "\"")
char '"'
return (StringValue x)
parseNumber = do
num <- many1 digit
return (NumberValue (read num))
Languages with Monad include Haskell
View all concepts with or missing a hasMonads measurement
Read more about Monad on the web: 1.