Created
March 16, 2015 03:05
-
-
Save syntacticsugar/3037055076f9ae22105e to your computer and use it in GitHub Desktop.
wherein we try defining `list`
This file contains 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
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