Created
April 14, 2019 12:39
-
-
Save rexcfnghk/5543e2f5888da44bfde44de124b384fc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
-– 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