Skip to content

Instantly share code, notes, and snippets.

@rexcfnghk
Created April 14, 2019 12:39
Show Gist options
  • Save rexcfnghk/5543e2f5888da44bfde44de124b384fc to your computer and use it in GitHub Desktop.
Save rexcfnghk/5543e2f5888da44bfde44de124b384fc to your computer and use it in GitHub Desktop.
-– Empty list
[]
–- We use the cons operator (:) to combine the element 3 (an integer)
-- and an empty list (which can take on the type of integer list)
3 : []
-- The cons operator is right-associative. (3 : []) is also of type integer
-- list, we use the cons operator again to add the element 2 in front of it
2 : (3 : [])
-- The cons operator is right-associative. (2 : 3 : []) is also of type integer
-- list, we use the cons operator again to add the element 1 in front of it
1 : (2 : (3 : []))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment