Last active
August 29, 2015 13:59
-
-
Save jneen/10952688 to your computer and use it in GitHub Desktop.
what i'm trying to do
This file contains hidden or 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
data Expr = Var Char | |
| Lam Char Expr | |
| App Expr Expr | |
hasFree :: Char -> Expr -> Bool | |
hasFree c (Var v) = c == v | |
hasFree c (Lam arg body) = c /= arg && hasFree c body | |
hasFree c (App func arg) = hasFree c func && hasFree c arg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment