cleaning show/repr

This commit is contained in:
Yann Esposito (Yogsototh) 2017-02-27 23:23:48 +01:00
parent e6207fd301
commit 403c45e666
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646
2 changed files with 3 additions and 6 deletions

View file

@ -63,7 +63,7 @@ evalReduced (WaitingStream (Just h)) = do
let splittedLines = lines cmdoutput
producer = mapM_ yield splittedLines
runEffect (for producer (lift . putStrLn))
evalReduced x = putStrLn (show x)
evalReduced x = putStrLn (repr x)
-- | Evaluate the parsed expr
eval :: Env -> Either ParseError SExp -> InputT IO Env

View file

@ -26,17 +26,14 @@ data SExp = Atom Text
| Lambda [SExp]
| Void
-- only exists during evaluation
| Fn { params :: [Text]
, body :: [SExp]
| Fn { params :: [Text]
, body :: [SExp]
, closure :: Env
}
| Stream CmdStream
| WaitingStream CmdStream
deriving (Eq,Show)
-- instance Show SExp where
-- show = toS . repr
repr :: SExp -> Text
repr (Atom s) = s
repr (Num n) = toS $ show n