Skip to content

Instantly share code, notes, and snippets.

@Taneb

Taneb/PolyRec.hs Secret

Created June 9, 2021 11:28
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 Taneb/e17d338384a62297002983e123d8d59d to your computer and use it in GitHub Desktop.
Save Taneb/e17d338384a62297002983e123d8d59d to your computer and use it in GitHub Desktop.
module PolyRec where
data Foo a = Nil | Foo a (Foo (a, a))
size :: Foo a -> Int
size Nil = 0
size (Foo _ xs) = 1 + 2 * size xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment