X-Git-Url: https://git.rmz.io/my-scheme.git/blobdiff_plain/081ba0cc6439a82a508100a59d6fa5dba80609d9..7495ece1a44cd1a8cccae2bdbc61fa6873f106d2:/app/Main.hs?ds=inline diff --git a/app/Main.hs b/app/Main.hs index 6fcf667..6daf522 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,4 +1,5 @@ module Main where +import Control.Monad import Text.ParserCombinators.Parsec hiding (spaces) import System.Environment @@ -32,6 +33,9 @@ parseAtom = do "#f" -> Bool False _ -> Atom atom +parseNumber :: Parser LispVal +parseNumber = liftM (Number . read) $ many1 digit + readExpr :: String -> String readExpr input = case parse (spaces >> symbol) "lisp" input of Left err -> "No match: " ++ show err