Skip to content

Instantly share code, notes, and snippets.

@BrooklinJazz
Last active July 3, 2022 22:31
Show Gist options
  • Select an option

  • Save BrooklinJazz/86b7ca1cd58db2012ca0f1c3a4aabd39 to your computer and use it in GitHub Desktop.

Select an option

Save BrooklinJazz/86b7ca1cd58db2012ca0f1c3a4aabd39 to your computer and use it in GitHub Desktop.
Example Data Types for Elixir
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