Created
March 7, 2015 18:35
-
-
Save joshcough/53e3b48e2e07f17f4786 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instance (Eq a, FromSExpr a) => FromSExpr (E a) where | |
fromSExpr (List [AtomSym "lambda", List args, b]) = do | |
e <- fromSExpr b | |
as <- sequence $ fmap fromSExpr args | |
return $ Lambda (length args) $ abstract (flip elemIndex as) e | |
--if wellFormedArgList args | |
-- then return $ Lambda (length args) $ abstract (flip elemIndex as) e | |
-- else fail $ "bad arguments" ++ show args -- fail if args is ill formed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment