minor changes

This commit is contained in:
Yann Esposito (Yogsototh) 2019-09-08 15:01:49 +02:00
parent d3e03799d2
commit 8954403bcb
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646
3 changed files with 11 additions and 11 deletions

3
.gitignore vendored
View file

@ -1,5 +1,4 @@
/tutorial.md .stack-work/
/.stack-work/
.lish-history .lish-history
*.tix *.tix
stack.yaml.lock stack.yaml.lock

View file

@ -85,8 +85,8 @@ _reduceLambda (Atom x) = do
Just s -> return s Just s -> return s
_ -> case InternalCommands.lookup x of _ -> case InternalCommands.lookup x of
Just cmd -> return (Internal cmd) Just cmd -> return (Internal cmd)
_ -> return (Str x) _ -> return (Str x)
_reduceLambda x = return x _reduceLambda x = return x
reduceLambda :: SExp -> StateT Env IO SExp reduceLambda :: SExp -> StateT Env IO SExp
reduceLambda x = do reduceLambda x = do

View file

@ -27,13 +27,14 @@ import GHC.IO.Handle (Handle)
import GHC.Show (Show (..)) import GHC.Show (Show (..))
import Protolude hiding (show,repr) import Protolude hiding (show,repr)
data ExprF a = Atom Text -- | Type representing an expression
| Num Integer data ExprF a = Atom Text -- ^ an atom is just a variable name
| Bool Bool | Num Integer -- ^ a number
| Str Text | Bool Bool -- ^ a boolean
| List [a] | Str Text -- ^ a string
| Lambda [a] | List [a] -- ^ a list
| Void | Lambda [a] -- ^ a function (lambda expression)
| Void -- ^ an empty value
-- only exists during evaluation -- only exists during evaluation
| Internal InternalCommand | Internal InternalCommand
| Fn { params :: [Text] | Fn { params :: [Text]