Skip to content

Instantly share code, notes, and snippets.

@syntacticsugar
Created March 16, 2015 03:05
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 syntacticsugar/3037055076f9ae22105e to your computer and use it in GitHub Desktop.
Save syntacticsugar/3037055076f9ae22105e to your computer and use it in GitHub Desktop.
wherein we try defining `list`
import Text (asText)
type Collection a = Nada | Glue a (Collection a)
summm xs =
case xs of
Nada -> 0
Glue face body -> face + (summm body)
listToCollection collection =
case collection of
[] -> Nada
face::body -> Glue face (listToCollection body)
main = asText (listToCollection [1,2,3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment