diff --git a/.gitignore b/.gitignore index cff341c..735a38e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -/tutorial.md -/.stack-work/ +.stack-work/ .lish-history *.tix stack.yaml.lock diff --git a/src/Lish/Eval.hs b/src/Lish/Eval.hs index 89d8f0c..fdaa6e2 100644 --- a/src/Lish/Eval.hs +++ b/src/Lish/Eval.hs @@ -85,8 +85,8 @@ _reduceLambda (Atom x) = do Just s -> return s _ -> case InternalCommands.lookup x of Just cmd -> return (Internal cmd) - _ -> return (Str x) -_reduceLambda x = return x + _ -> return (Str x) +_reduceLambda x = return x reduceLambda :: SExp -> StateT Env IO SExp reduceLambda x = do diff --git a/src/Lish/Types.hs b/src/Lish/Types.hs index f5663b0..d82ce91 100644 --- a/src/Lish/Types.hs +++ b/src/Lish/Types.hs @@ -27,13 +27,14 @@ import GHC.IO.Handle (Handle) import GHC.Show (Show (..)) import Protolude hiding (show,repr) -data ExprF a = Atom Text - | Num Integer - | Bool Bool - | Str Text - | List [a] - | Lambda [a] - | Void +-- | Type representing an expression +data ExprF a = Atom Text -- ^ an atom is just a variable name + | Num Integer -- ^ a number + | Bool Bool -- ^ a boolean + | Str Text -- ^ a string + | List [a] -- ^ a list + | Lambda [a] -- ^ a function (lambda expression) + | Void -- ^ an empty value -- only exists during evaluation | Internal InternalCommand | Fn { params :: [Text]