Skip to content

Instantly share code, notes, and snippets.

@jmikkola
Created November 16, 2015 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmikkola/6205e473a76967437620 to your computer and use it in GitHub Desktop.
Save jmikkola/6205e473a76967437620 to your computer and use it in GitHub Desktop.
data CrazyList a = CL a (CrazyList [a]) | End
-- Try compiling this without either type annotation:
f :: CrazyList a -> Int
f End = 0
f (CL x rest) = g x rest
g :: a -> CrazyList [a] -> Int
g x rest = 1 + (f rest)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment