Skip to content

Instantly share code, notes, and snippets.

@jneen
Last active August 29, 2015 13:59
Show Gist options
  • Save jneen/10952688 to your computer and use it in GitHub Desktop.
Save jneen/10952688 to your computer and use it in GitHub Desktop.
what i'm trying to do
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