Last active
July 3, 2022 22:31
-
-
Save BrooklinJazz/86b7ca1cd58db2012ca0f1c3a4aabd39 to your computer and use it in GitHub Desktop.
Example Data Types for Elixir
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
| 1 # integer | |
| 0b1010 # 10 integer in binary | |
| 0o777 # 511 integer in octal | |
| 0x1F # 31 integer in hexadecimal | |
| 1.2 # float | |
| :example # atom | |
| "hello" # string | |
| true # boolean | |
| false # boolean | |
| [1, 2, 3] # list | |
| 1..3 # list written as a range | |
| [key: "val", key: "val"] # key-value list (non-unique keys allowed) | |
| {1, 2, 3} # tuple | |
| %{"key" => "val"} # map (unique keys only) | |
| %{key: "val"} # map with alternative syntax |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment