minor changes
This commit is contained in:
parent
d3e03799d2
commit
8954403bcb
3 changed files with 11 additions and 11 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,5 +1,4 @@
|
||||||
/tutorial.md
|
.stack-work/
|
||||||
/.stack-work/
|
|
||||||
.lish-history
|
.lish-history
|
||||||
*.tix
|
*.tix
|
||||||
stack.yaml.lock
|
stack.yaml.lock
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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]
|
||||||
|
|
Loading…
Reference in a new issue