Elixir
▼
Project version
v1.18.1
v1.18.0
v1.18.0-rc.0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc.1
v1.17.0-rc.0
v1.16.3
v1.16.2
v1.16.1
v1.16.0
v1.16.0-rc.1
v1.16.0-rc.0
v1.15.8
v1.15.7
v1.15.6
v1.15.5
v1.15.4
v1.15.3
v1.15.2
v1.15.1
v1.15.0
v1.15.0-rc.2
v1.15.0-rc.1
v1.15.0-rc.0
v1.14.5
v1.14.4
v1.14.3
v1.14.2
v1.14.1
v1.14.0
v1.14.0-rc.1
v1.14.0-rc.0
v1.13.4
v1.13.3
v1.13.2
v1.13.1
v1.13.0
v1.13.0-rc.1
v1.13.0-rc.0
v1.12.3
v1.12.2
v1.12.1
v1.12.0
v1.12.0-rc.1
v1.12.0-rc.0
v1.11.4
v1.11.3
v1.11.2
v1.11.1
v1.11.0
v1.11.0-rc.0
v1.10.4
v1.10.3
v1.10.2
v1.10.1
v1.10.0
v1.10.0-rc.0
v1.9.4
v1.9.3
v1.9.2
v1.9.1
v1.9.0
v1.9.0-rc.0
v1.8.2
v1.8.1
v1.8.0
v1.8.0-rc.1
v1.8.0-rc.0
v1.7.4
v1.7.3
v1.7.2
v1.7.1
v1.7.0
v1.7.0-rc.1
v1.7.0-rc.0
v1.6.6
v1.6.5
v1.6.4
v1.6.3
v1.6.2
v1.6.1
v1.6.0
v1.6.0-rc.1
v1.6.0-rc.0
v1.5.3
v1.5.2
v1.5.1
v1.5.0
v1.5.0-rc.2
v1.5.0-rc.1
v1.5.0-rc.0
v1.4.5
v1.4.4
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.4.0-rc.1
v1.4.0-rc.0
v1.3.4
v1.3.3
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc.1
v1.3.0-rc.0
v1.2.6
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc.1
v1.2.0-rc.0
v1.1.1
v1.1.0
v1.1.0-rc.0
v1.0.5
v1.0.4
Pages
Modules
API Reference
Modules
Changelog for Elixir v1.17
Warnings from gradual set-theoretic types
Erlang/OTP support
Adding Duration and shift/2 functions
v1.17.0-rc.0 (2024-05-24)
v1.16
Getting started
Introduction
Installation
Interactive mode
Running scripts
Basic types
Basic arithmetic
Identifying functions and documentation
Booleans and nil
Atoms
Strings
Structural comparison
Lists and tuples
(Linked) Lists
Tuples
Lists or tuples?
Size or length?
Pattern matching
The match operator
Pattern matching
The pin operator
case, cond, and if
case
if/unless
cond
Summing up
Anonymous functions
Defining anonymous functions
Closures
Clauses and guards
The capture operator
Binaries, strings, and charlists
Unicode and Code Points
UTF-8 and Encodings
Bitstrings
Binaries
Charlists
Keyword lists and maps
Keyword lists
Maps as key-value pairs
Maps of predefined keys
Nested data structures
Summary
Modules and functions
Compilation
Scripting mode
Function definition
Default arguments
Recursion
Loops through recursion
Reduce and map algorithms
Enumerables and Streams
Enumerables
Eager vs Lazy
The pipe operator
Streams
Processes
Spawning processes
Sending and receiving messages
Links
Tasks
State
IO and the file system
The IO module
The File module
The Path module
Processes
iodata and chardata
alias, require, import, and use
alias
require
import
use
Understanding Aliases
Module nesting
Multi alias/import/require/use
Module attributes
As annotations
As temporary storage
As compile-time constants
Going further
Structs
Defining structs
Accessing and updating structs
Structs are bare maps underneath
Default values and required keys
Protocols
Example
Protocols and structs
Implementing Any
Built-in protocols
Comprehensions
Generators and filters
Bitstring generators
The :into option
Other options
Sigils
Regular expressions
Strings, charlists, and word lists sigils
Interpolation and escaping in string sigils
Calendar sigils
Custom sigils
try, catch, and rescue
Errors
Throws
Exits
After
Else
Variables scope
Writing documentation
Markdown
Module Attributes
Function Arguments
Documentation metadata
Recommendations
Doctests
Documentation != Code comments
Hiding internal Modules and Functions
Code.fetch_docs/1
Optional syntax sheet
Walk-through
Erlang libraries
The binary module
Formatted text output
The crypto module
The digraph module
Erlang Term Storage
The math module
The queue module
The rand module
The zip and zlib modules
Learning Erlang
Debugging
IO.inspect/2
dbg/2
Pry
Breakpoints
Observer
Other tools and community
Cheatsheets
Enum cheatsheet
Predicates
Filtering
Mapping
Side-effects
Accumulating
Aggregations
Sorting
Concatenating & flattening
Conversion
Duplicates & uniques
Indexing
Finding
Grouping
Joining & interspersing
Slicing
Reversing
Splitting
Splitting (drop and take)
Random
Chunking
Zipping
Anti-patterns
What are anti-patterns?
Code-related anti-patterns
Comments overuse
Complex else clauses in with
Complex extractions in clauses
Dynamic atom creation
Long parameter list
Namespace trespassing
Non-assertive map access
Non-assertive pattern matching
Non-assertive truthiness
Design-related anti-patterns
Alternative return types
Boolean obsession
Exceptions for control-flow
Primitive obsession
Unrelated multi-clause function
Using application configuration for libraries
Process-related anti-patterns
Code organization by process
Scattered process interfaces
Sending unnecessary data
Unsupervised processes
Meta-programming anti-patterns
Large code generation
Unnecessary macros
use instead of import
Meta-programming
Quote and unquote
Quoting
Unquoting
Escaping
Macros
Our first macro
Macro hygiene
The environment
Private macros
Write macros responsibly
Domain-Specific Languages (DSLs)
Building our own test case
The test macro
Storing information with attributes
Mix & OTP
Introduction to Mix
Our first project
Project compilation
Running tests
Automatic code formatting
Environments
Exploring
Simple state management with agents
The trouble with (mutable) state
Agents 101
Test setup with ExUnit callbacks
Other agent actions
Client/server in agents
Client-server communication with GenServer
GenServer callbacks
The Client API
Testing a GenServer
The need for monitoring
call, cast or info?
Monitors or links?
Supervision trees and applications
Our first supervisor
Naming processes
Understanding applications
The application callback
Projects or applications?
Next steps
Supervising dynamic children
The bucket supervisor
Supervision trees
Shared state in tests
Observer
Speeding up with ETS
ETS as a cache
Race conditions?
Dependencies and umbrella projects
External dependencies
Internal dependencies
Umbrella projects
Dependencies within an umbrella project
Don't drink the kool aid
Summing up
Task and gen_tcp
Echo server
Tasks
Task supervisor
Doctests, patterns, and with
Doctests
with
Running commands
Distributed tasks and tags
Our first distributed code
async/await
Distributed tasks
Routing layer
Test filters and tags
Wiring it all up
Summing up
Configuration and releases
Application environment
Configuration
Releases
Why releases?
Assembling multiple releases
Configuring releases
Summing up
References
Compatibility and deprecations
Between non-major Elixir versions
Between Elixir and Erlang/OTP
Deprecations
Gradual set-theoretic types
Supported types
Set operations
The dynamic() type
Roadmap
Acknowledgements
Library guidelines
Getting started
Publishing
Dependency handling
Naming conventions
Casing
Underscore (_foo)
Trailing bang (foo!)
Trailing question mark (foo?)
is_ prefix (is_foo)
Special names
Operators reference
Operator precedence and associativity
General operators
Comparison operators
Custom and overridden operators
Patterns and guards
Patterns
Guards
Where patterns and guards can be used
Custom patterns and guards expressions
Syntax reference
Reserved words
Data types
Expressions
The Elixir AST
Optional syntax
Typespecs reference
A simple example
Types and their syntax
Defining a specification
Behaviours
Pitfalls
The string() type
Functions which raise an error
Unicode syntax
Introduction
Unicode Annex #31
Unicode Technical Standard #39
Kernel
Sections
The standard library
Guards
Truthy and falsy values
Structural comparison
Inlining
Summary
Guards
*/2
+/1
+/2
-/1
-/2
//2
!=/2
!==/2
</2
<=/2
==/2
===/2
>/2
>=/2
abs/1
and/2
binary_part/3
bit_size/1
byte_size/1
ceil/1
div/2
elem/2
floor/1
hd/1
in/2
is_atom/1
is_binary/1
is_bitstring/1
is_boolean/1
is_exception/1
is_exception/2
is_float/1
is_function/1
is_function/2
is_integer/1
is_list/1
is_map/1
is_map_key/2
is_nil/1
is_non_struct_map/1
is_number/1
is_pid/1
is_port/1
is_reference/1
is_struct/1
is_struct/2
is_tuple/1
length/1
map_size/1
node/0
node/1
not/1
or/2
rem/2
round/1
self/0
tl/1
trunc/1
tuple_size/1
Functions
&&/2
**/2
++/2
--/2
../0
../2
..///3
!/1
<>/2
=~/2
@/1
alias!/1
apply/2
apply/3
binary_slice/2
binary_slice/3
binding/1
dbg/2
def/2
defdelegate/2
defexception/1
defguard/1
defguardp/1
defimpl/3
defmacro/2
defmacrop/2
defmodule/2
defoverridable/1
defp/2
defprotocol/2
defstruct/1
destructure/2
exit/1
function_exported?/3
get_and_update_in/2
get_and_update_in/3
get_in/1
get_in/2
if/2
inspect/2
macro_exported?/3
make_ref/0
match?/2
max/2
min/2
pop_in/1
pop_in/2
put_elem/3
put_in/2
put_in/3
raise/1
raise/2
reraise/2
reraise/3
send/2
sigil_C/2
sigil_c/2
sigil_D/2
sigil_N/2
sigil_r/2
sigil_S/2
sigil_s/2
sigil_T/2
sigil_U/2
sigil_W/2
sigil_w/2
spawn/1
spawn/3
spawn_link/1
spawn_link/3
spawn_monitor/1
spawn_monitor/3
struct/2
struct!/2
tap/2
then/2
throw/1
to_charlist/1
to_string/1
to_timeout/1
unless/2
update_in/2
update_in/3
use/2
var!/2
|>/2
||/2
Kernel.SpecialForms
Summary
Functions
%/2
%{}/1
&/1
./2
__aliases__/1
__block__/1
__CALLER__/0
__cursor__/1
__DIR__/0
__ENV__/0
__MODULE__/0
__STACKTRACE__/0
::/2
<<>>/1
=/2
alias/2
case/2
cond/1
fn/1
for/1
import/2
quote/2
receive/1
require/2
super/1
try/1
unquote/1
unquote_splicing/1
with/1
^/1
{}/1
Data Types
Atom
Summary
Functions
to_charlist/1
to_string/1
Base
Sections
Base 16 alphabet
Base 32 alphabet
Base 32 (extended hex) alphabet
Base 64 alphabet
Base 64 (URL and filename safe) alphabet
Summary
Types
decode_case/0
encode_case/0
Functions
decode16/2
decode16!/2
decode32/2
decode32!/2
decode64/2
decode64!/2
encode16/2
encode32/2
encode64/2
hex_decode32/2
hex_decode32!/2
hex_encode32/2
url_decode64/2
url_decode64!/2
url_encode64/2
Bitwise
Sections
Guards
Summary
Guards
&&&/2
<<</2
>>>/2
band/2
bnot/1
bor/2
bsl/2
bsr/2
bxor/2
|||/2
Date
Sections
Comparing dates
Using epochs
Summary
Types
t/0
Functions
add/2
after?/2
before?/2
beginning_of_month/1
beginning_of_week/2
compare/2
convert/2
convert!/2
day_of_era/1
day_of_week/2
day_of_year/1
days_in_month/1
diff/2
end_of_month/1
end_of_week/2
from_erl/2
from_erl!/2
from_gregorian_days/2
from_iso8601/2
from_iso8601!/2
leap_year?/1
months_in_year/1
new/4
new!/4
quarter_of_year/1
range/2
range/3
shift/2
to_erl/1
to_gregorian_days/1
to_iso8601/2
to_string/1
utc_today/1
year_of_era/1
DateTime
Sections
Time zone database
Datetimes as snapshots
Converting between timezones
Summary
Types
t/0
Functions
add/4
after?/2
before?/2
compare/2
convert/2
convert!/2
diff/3
from_gregorian_seconds/3
from_iso8601/2
from_iso8601/3
from_naive/3
from_naive!/3
from_unix/3
from_unix!/3
new/4
new!/4
now/2
now!/2
shift/3
shift_zone/3
shift_zone!/3
to_date/1
to_gregorian_seconds/1
to_iso8601/3
to_naive/1
to_string/1
to_time/1
to_unix/2
truncate/2
utc_now/1
utc_now/2
Duration
Sections
Shifting
Intervals
Summary
Types
duration/0
t/0
unit_pair/0
Functions
add/2
multiply/2
negate/1
new!/1
subtract/2
Exception
Sections
Formatting functions
Summary
Types
arity_or_args/0
kind/0
location/0
non_error_kind/0
stacktrace/0
stacktrace_entry/0
t/0
Callbacks
blame/2
exception/1
message/1
Functions
blame/3
blame_mfa/3
format/3
format_banner/3
format_exit/1
format_fa/2
format_file_line/3
format_file_line_column/4
format_mfa/3
format_stacktrace/1
format_stacktrace_entry/1
message/1
normalize/3
Float
Sections
Kernel functions
Known issues
Summary
Types
precision_range/0
Functions
ceil/2
floor/2
max_finite/0
min_finite/0
parse/1
pow/2
ratio/1
round/2
to_charlist/1
to_string/1
Function
Sections
The capture operator
Internal and external functions
Summary
Types
information/0
Functions
capture/3
identity/1
info/1
info/2
Integer
Summary
Guards
is_even/1
is_odd/1
Functions
digits/2
extended_gcd/2
floor_div/2
gcd/2
mod/2
parse/2
pow/2
to_charlist/2
to_string/2
undigits/2
Module
Sections
Module attributes
Compile callbacks
Compile options
Summary
Types
def_kind/0
definition/0
Callbacks
__info__/1
Functions
attributes_in/1
concat/1
concat/2
create/3
defines?/2
defines?/3
defines_type?/2
definitions_in/1
definitions_in/2
delete_attribute/2
delete_definition/2
eval_quoted/4
get_attribute/3
get_definition/3
get_last_attribute/3
has_attribute?/2
make_overridable/2
open?/1
overridable?/2
overridables_in/1
put_attribute/3
register_attribute/3
reserved_attributes/0
safe_concat/1
safe_concat/2
spec_to_callback/2
split/1
NaiveDateTime
Sections
Comparing naive date times
Using epochs
Summary
Types
t/0
Functions
add/3
after?/2
before?/2
beginning_of_day/1
compare/2
convert/2
convert!/2
diff/3
end_of_day/1
from_erl/3
from_erl!/3
from_gregorian_seconds/3
from_iso8601/2
from_iso8601!/2
local_now/1
new/2
new/8
new!/2
new!/8
shift/2
to_date/1
to_erl/1
to_gregorian_seconds/1
to_iso8601/2
to_string/1
to_time/1
truncate/2
utc_now/1
utc_now/2
Record
Sections
Types
Reflection
Summary
Guards
is_record/1
is_record/2
Functions
defrecord/3
defrecordp/3
extract/2
extract_all/1
Regex
Sections
Escapes
Modifiers
Captures
Character classes
Precompilation
Summary
Types
capture_option/0
re_option/0
run_option/0
t/0
Functions
compile/2
compile!/2
escape/1
match?/2
named_captures/3
names/1
opts/1
re_pattern/1
recompile/1
recompile!/1
replace/4
run/3
scan/3
source/1
split/3
version/0
String
Sections
Interpolation
Escape characters
Unicode and code points
UTF-8 encoded and encodings
Grapheme clusters
String and binary operations
Self-synchronization
Compile binary patterns
Summary
Types
codepoint/0
grapheme/0
pattern/0
t/0
Functions
at/2
bag_distance/2
byte_slice/3
capitalize/2
chunk/2
codepoints/1
contains?/2
downcase/2
duplicate/2
ends_with?/2
equivalent?/2
first/1
graphemes/1
jaro_distance/2
last/1
length/1
match?/2
myers_difference/2
next_codepoint/1
next_grapheme/1
next_grapheme_size/1
normalize/2
pad_leading/3
pad_trailing/3
printable?/2
replace/4
replace_invalid/2
replace_leading/3
replace_prefix/3
replace_suffix/3
replace_trailing/3
reverse/1
slice/2
slice/3
split/1
split/3
split_at/2
splitter/3
starts_with?/2
to_atom/1
to_charlist/1
to_existing_atom/1
to_float/1
to_integer/1
to_integer/2
trim/1
trim/2
trim_leading/1
trim_leading/2
trim_trailing/1
trim_trailing/2
upcase/2
valid?/2
Time
Sections
Comparing times
Summary
Types
t/0
Functions
add/3
after?/2
before?/2
compare/2
convert/2
convert!/2
diff/3
from_erl/3
from_erl!/3
from_iso8601/2
from_iso8601!/2
from_seconds_after_midnight/3
new/5
new!/5
shift/2
to_erl/1
to_iso8601/2
to_seconds_after_midnight/1
to_string/1
truncate/2
utc_now/1
Tuple
Summary
Functions
append/2
delete_at/2
duplicate/2
insert_at/3
product/1
sum/1
to_list/1
URI
Summary
Types
authority/0
t/0
Functions
%URI{}
append_path/2
append_query/2
char_reserved?/1
char_unescaped?/1
char_unreserved?/1
decode/1
decode_query/3
decode_www_form/1
default_port/1
default_port/2
encode/2
encode_query/2
encode_www_form/1
merge/2
new/1
new!/1
parse/1
query_decoder/2
to_string/1
Version
Sections
Versions
Requirements
Summary
Types
build/0
major/0
minor/0
patch/0
pre/0
requirement/0
t/0
version/0
Functions
%Version{}
compare/2
compile_requirement/1
match?/3
parse/1
parse!/1
parse_requirement/1
parse_requirement!/1
to_string/1
Version.Requirement
Summary
Types
t/0
Collections & Enumerables
Access
Sections
Maps and structs
Updating nested data structures
Summary
Types
access_fun/2
container/0
get_and_update_fun/2
get_fun/1
key/0
nil_container/0
t/0
value/0
Callbacks
fetch/2
get_and_update/3
pop/2
Functions
all/0
at/1
at!/1
elem/1
fetch/2
fetch!/2
filter/1
find/1
get/3
get_and_update/3
key/2
key!/1
pop/2
slice/1
Date.Range
Summary
Types
t/0
Enum
Summary
Types
acc/0
default/0
element/0
index/0
t/0
Functions
all?/1
all?/2
any?/1
any?/2
at/3
chunk_by/2
chunk_every/2
chunk_every/4
chunk_while/4
concat/1
concat/2
count/1
count/2
count_until/2
count_until/3
dedup/1
dedup_by/2
drop/2
drop_every/2
drop_while/2
each/2
empty?/1
fetch/2
fetch!/2
filter/2
find/3
find_index/2
find_value/3
flat_map/2
flat_map_reduce/3
frequencies/1
frequencies_by/2
group_by/3
intersperse/2
into/2
into/3
join/2
map/2
map_every/3
map_intersperse/3
map_join/3
map_reduce/3
max/3
max_by/4
member?/2
min/3
min_by/4
min_max/2
min_max_by/4
product/1
random/1
reduce/2
reduce/3
reduce_while/3
reject/2
reverse/1
reverse/2
reverse_slice/3
scan/2
scan/3
shuffle/1
slice/2
slice/3
slide/3
sort/1
sort/2
sort_by/3
split/2
split_while/2
split_with/2
sum/1
take/2
take_every/2
take_random/2
take_while/2
to_list/1
uniq/1
uniq_by/2
unzip/1
with_index/2
zip/1
zip/2
zip_reduce/3
zip_reduce/4
zip_with/2
zip_with/3
Keyword
Sections
Examples
Duplicate keys and ordering
Call syntax
Summary
Types
default/0
key/0
t/0
t/1
value/0
Functions
delete/2
delete_first/2
drop/2
equal?/2
fetch/2
fetch!/2
filter/2
from_keys/2
get/3
get_and_update/3
get_and_update!/3
get_lazy/3
get_values/2
has_key?/2
keys/1
keyword?/1
merge/2
merge/3
new/0
new/1
new/2
pop/3
pop!/2
pop_first/3
pop_lazy/3
pop_values/2
put/3
put_new/3
put_new_lazy/3
reject/2
replace/3
replace!/3
replace_lazy/3
split/2
split_with/2
take/2
to_list/1
update/4
update!/3
validate/2
validate!/2
values/1
List
Sections
Charlists
Summary
Functions
ascii_printable?/2
delete/2
delete_at/2
duplicate/2
first/2
flatten/1
flatten/2
foldl/3
foldr/3
improper?/1
insert_at/3
keydelete/3
keyfind/4
keyfind!/3
keymember?/3
keyreplace/4
keysort/3
keystore/4
keytake/3
last/2
myers_difference/2
myers_difference/3
pop_at/3
replace_at/3
starts_with?/2
to_atom/1
to_charlist/1
to_existing_atom/1
to_float/1
to_integer/1
to_integer/2
to_string/1
to_tuple/1
update_at/3
wrap/1
zip/1
Map
Summary
Types
key/0
value/0
Functions
delete/2
drop/2
equal?/2
fetch/2
fetch!/2
filter/2
from_keys/2
from_struct/1
get/3
get_and_update/3
get_and_update!/3
get_lazy/3
has_key?/2
intersect/2
intersect/3
keys/1
merge/2
merge/3
new/0
new/1
new/2
pop/3
pop!/2
pop_lazy/3
put/3
put_new/3
put_new_lazy/3
reject/2
replace/3
replace!/3
replace_lazy/3
split/2
split_with/2
take/2
to_list/1
update/4
update!/3
values/1
MapSet
Summary
Types
internal/1
t/0
t/1
value/0
Functions
delete/2
difference/2
disjoint?/2
equal?/2
filter/2
intersection/2
member?/2
new/0
new/1
new/2
put/2
reject/2
size/1
split_with/2
subset?/2
symmetric_difference/2
to_list/1
union/2
Range
Sections
Use cases
Definition
Representation
Summary
Types
limit/0
step/0
t/0
t/2
Functions
disjoint?/2
new/2
new/3
shift/2
size/1
split/2
to_list/1
Stream
Sections
Creating Streams
Summary
Types
acc/0
default/0
element/0
index/0
timer/0
Functions
chunk_by/2
chunk_every/2
chunk_every/4
chunk_while/4
concat/1
concat/2
cycle/1
dedup/1
dedup_by/2
drop/2
drop_every/2
drop_while/2
duplicate/2
each/2
filter/2
flat_map/2
from_index/1
intersperse/2
interval/1
into/3
iterate/2
map/2
map_every/3
reject/2
repeatedly/1
resource/3
run/1
scan/2
scan/3
take/2
take_every/2
take_while/2
timer/1
transform/3
transform/4
transform/5
unfold/2
uniq/1
uniq_by/2
with_index/2
zip/1
zip/2
zip_with/2
zip_with/3
IO & System
File
Sections
Encoding
API
Processes and raw files
Seeking within a file
Summary
Types
encoding_mode/0
erlang_time/0
file_descriptor/0
io_device/0
mode/0
on_conflict_callback/0
posix/0
posix_time/0
read_offset_mode/0
stat_options/0
stream_mode/0
Functions
cd/1
cd!/1
cd!/2
chgrp/2
chgrp!/2
chmod/2
chmod!/2
chown/2
chown!/2
close/1
copy/3
copy!/3
cp/3
cp!/3
cp_r/3
cp_r!/3
cwd/0
cwd!/0
dir?/2
exists?/2
ln/2
ln!/2
ln_s/2
ln_s!/2
ls/1
ls!/1
lstat/2
lstat!/2
mkdir/1
mkdir!/1
mkdir_p/1
mkdir_p!/1
open/2
open/3
open!/2
open!/3
read/1
read!/1
read_link/1
read_link!/1
regular?/2
rename/2
rename!/2
rm/1
rm!/1
rm_rf/1
rm_rf!/1
rmdir/1
rmdir!/1
stat/2
stat!/2
stream!/2
stream!/3
touch/2
touch!/2
write/3
write!/3
write_stat/3
write_stat!/3
File.Stat
Summary
Types
t/0
Functions
from_record/1
to_record/1
File.Stream
Summary
Types
t/0
IO
Sections
IO devices
IO data
Summary
Types
chardata/0
device/0
nodata/0
Functions
binread/2
binstream/0
binstream/2
binwrite/2
chardata_to_string/1
getn/2
getn/3
gets/2
inspect/2
inspect/3
iodata_length/1
iodata_to_binary/1
puts/2
read/2
stream/0
stream/2
warn/1
warn/2
write/2
IO.ANSI
Sections
Examples
Summary
Types
ansicode/0
ansidata/0
ansilist/0
Functions
black/0
black_background/0
blink_off/0
blink_rapid/0
blink_slow/0
blue/0
blue_background/0
bright/0
clear/0
clear_line/0
color/1
color/3
color_background/1
color_background/3
conceal/0
crossed_out/0
cursor/2
cursor_down/1
cursor_left/1
cursor_right/1
cursor_up/1
cyan/0
cyan_background/0
default_background/0
default_color/0
enabled?/0
encircled/0
faint/0
font_1/0
font_2/0
font_3/0
font_4/0
font_5/0
font_6/0
font_7/0
font_8/0
font_9/0
format/2
format_fragment/2
framed/0
green/0
green_background/0
home/0
inverse/0
inverse_off/0
italic/0
light_black/0
light_black_background/0
light_blue/0
light_blue_background/0
light_cyan/0
light_cyan_background/0
light_green/0
light_green_background/0
light_magenta/0
light_magenta_background/0
light_red/0
light_red_background/0
light_white/0
light_white_background/0
light_yellow/0
light_yellow_background/0
magenta/0
magenta_background/0
no_underline/0
normal/0
not_framed_encircled/0
not_italic/0
not_overlined/0
overlined/0
primary_font/0
red/0
red_background/0
reset/0
reverse/0
reverse_off/0
syntax_colors/0
underline/0
white/0
white_background/0
yellow/0
yellow_background/0
IO.Stream
Summary
Types
t/0
OptionParser
Summary
Types
argv/0
errors/0
options/0
parsed/0
Functions
next/2
parse/2
parse!/2
parse_head/2
parse_head!/2
split/1
to_argv/2
Path
Summary
Types
t/0
Functions
absname/1
absname/2
basename/1
basename/2
dirname/1
expand/1
expand/2
extname/1
join/1
join/2
relative/1
relative_to/3
relative_to_cwd/2
rootname/1
rootname/2
safe_relative/2
safe_relative_to/2
split/1
type/1
wildcard/2
Port
Sections
Example
Message and function APIs
Open mechanisms
Zombie operating system processes
Summary
Types
name/0
Functions
close/1
command/3
connect/2
demonitor/2
info/1
info/2
list/0
monitor/1
open/2
StringIO
Sections
Examples
Summary
Functions
close/1
contents/1
flush/1
open/2
open/3
System
Sections
Time
Summary
Types
signal/0
time_unit/0
Functions
argv/0
argv/1
at_exit/1
build_info/0
cmd/3
compiled_endianness/0
convert_time_unit/3
cwd/0
cwd!/0
delete_env/1
endianness/0
fetch_env/1
fetch_env!/1
find_executable/1
get_env/0
get_env/2
get_pid/0
halt/1
monotonic_time/0
monotonic_time/1
no_halt/0
no_halt/1
os_time/0
os_time/1
otp_release/0
pid/0
put_env/1
put_env/2
restart/0
schedulers/0
schedulers_online/0
shell/2
stacktrace/0
stop/1
system_time/0
system_time/1
time_offset/0
time_offset/1
tmp_dir/0
tmp_dir!/0
trap_signal/3
unique_integer/1
untrap_signal/2
user_home/0
user_home!/0
version/0
Calendar
Calendar
Summary
Types
calendar/0
date/0
datetime/0
day/0
day_fraction/0
day_of_era/0
day_of_week/0
era/0
hour/0
iso_days/0
microsecond/0
minute/0
month/0
naive_datetime/0
second/0
std_offset/0
time/0
time_zone/0
time_zone_database/0
utc_offset/0
week/0
year/0
zone_abbr/0
Callbacks
date_to_string/3
datetime_to_string/11
day_of_era/3
day_of_week/4
day_of_year/3
day_rollover_relative_to_midnight_utc/0
days_in_month/2
iso_days_to_beginning_of_day/1
iso_days_to_end_of_day/1
leap_year?/1
months_in_year/1
naive_datetime_from_iso_days/1
naive_datetime_to_iso_days/7
naive_datetime_to_string/7
parse_date/1
parse_naive_datetime/1
parse_time/1
parse_utc_datetime/1
quarter_of_year/3
shift_date/4
shift_naive_datetime/8
shift_time/5
time_from_day_fraction/1
time_to_day_fraction/4
time_to_string/4
valid_date?/3
valid_time?/4
year_of_era/3
Functions
compatible_calendars?/2
get_time_zone_database/0
put_time_zone_database/1
strftime/3
truncate/2
Calendar.ISO
Sections
ISO 8601 compliance
Summary
Types
bce/0
ce/0
day/0
day_of_week/0
day_of_year/0
era/0
format/0
hour/0
microsecond/0
minute/0
month/0
quarter_of_year/0
second/0
utc_offset/0
weekday/0
year/0
year_of_era/0
Functions
date_to_string/4
datetime_to_string/12
day_of_era/3
day_of_week/4
day_of_year/3
day_rollover_relative_to_midnight_utc/0
days_in_month/2
iso_days_to_beginning_of_day/1
iso_days_to_end_of_day/1
leap_year?/1
months_in_year/1
naive_datetime_from_iso_days/1
naive_datetime_to_iso_days/7
naive_datetime_to_string/8
parse_date/1
parse_date/2
parse_naive_datetime/1
parse_naive_datetime/2
parse_time/1
parse_time/2
parse_utc_datetime/1
parse_utc_datetime/2
quarter_of_year/3
shift_date/4
shift_naive_datetime/8
shift_time/5
time_from_day_fraction/1
time_to_day_fraction/4
time_to_string/5
time_unit_to_precision/1
valid_date?/3
valid_time?/4
year_of_era/1
year_of_era/3
Calendar.TimeZoneDatabase
Summary
Types
time_zone_period/0
time_zone_period_limit/0
Callbacks
time_zone_period_from_utc_iso_days/2
time_zone_periods_from_wall_datetime/2
Calendar.UTCOnlyTimeZoneDatabase
Processes & Applications
Agent
Sections
Examples
How to supervise
Name registration
A word on distributed agents
Hot code swapping
Summary
Types
agent/0
name/0
on_start/0
state/0
Functions
cast/2
cast/4
child_spec/1
get/3
get/5
get_and_update/3
get_and_update/5
start/2
start/4
start_link/2
start_link/4
stop/3
update/3
update/5
Application
Sections
The application environment
Compile-time environment
The application callback module
The application resource file
The application life cycle
Tooling
Further information
Summary
Types
app/0
application_key/0
key/0
restart_type/0
start_type/0
state/0
value/0
Callbacks
config_change/3
prep_stop/1
start/2
start_phase/3
stop/1
Functions
app_dir/1
app_dir/2
compile_env/3
compile_env/4
compile_env!/2
compile_env!/3
delete_env/3
ensure_all_started/2
ensure_loaded/1
ensure_started/2
fetch_env/2
fetch_env!/2
format_error/1
get_all_env/1
get_application/1
get_env/3
load/1
loaded_applications/0
put_all_env/2
put_env/4
spec/1
spec/2
start/2
started_applications/1
stop/1
unload/1
Config
Sections
Example
Migrating from use Mix.Config
config/runtime.exs
Summary
Functions
config/2
config/3
config_env/0
config_target/0
import_config/1
Config.Provider
Sections
Multiple config files
Custom config provider
Summary
Types
config/0
config_path/0
state/0
Callbacks
init/1
load/2
Functions
resolve_config_path!/1
validate_config_path!/1
Config.Reader
Sections
As a provider
Summary
Functions
eval!/3
merge/2
read!/2
read_imports!/2
DynamicSupervisor
Sections
Examples
Scalability and partitioning
Module-based supervisors
Name registration
Migrating from Supervisor's :simple_one_for_one
Summary
Types
init_option/0
on_start_child/0
option/0
strategy/0
sup_flags/0
Callbacks
init/1
Functions
child_spec/1
count_children/1
init/1
start_child/2
start_link/1
start_link/3
stop/3
terminate_child/2
which_children/1
GenServer
Sections
Example
Client / Server APIs
How to supervise
Name registration
Receiving "regular" messages
Timeouts
When (not) to use a GenServer
Debugging with the :sys module
Learn more
Summary
Types
debug/0
from/0
name/0
on_start/0
option/0
options/0
server/0
Callbacks
code_change/3
format_status/1
format_status/2
handle_call/3
handle_cast/2
handle_continue/2
handle_info/2
init/1
terminate/2
Functions
abcast/3
call/3
cast/2
multi_call/4
reply/2
start/3
start_link/3
stop/3
whereis/1
Node
Summary
Types
state/0
t/0
Functions
alive?/0
connect/1
disconnect/1
get_cookie/0
list/0
list/1
monitor/2
monitor/3
ping/1
self/0
set_cookie/2
spawn/2
spawn/3
spawn/4
spawn/5
spawn_link/2
spawn_link/4
spawn_monitor/2
spawn_monitor/4
start/3
stop/0
PartitionSupervisor
Sections
Simple Example
DynamicSupervisor Example
Implementation notes
Summary
Types
name/0
Functions
count_children/1
partitions/1
start_link/1
stop/3
which_children/1
Process
Sections
Aliases
Summary
Types
alias/0
alias_opt/0
dest/0
process_info_item/0
process_info_result_item/0
spawn_opt/0
spawn_opts/0
Functions
alias/0
alias/1
alive?/1
cancel_timer/2
delete/1
demonitor/2
exit/2
flag/2
flag/3
get/0
get/2
get_keys/0
get_keys/1
group_leader/0
group_leader/2
hibernate/3
info/1
info/2
link/1
list/0
monitor/1
monitor/2
put/2
read_timer/1
register/2
registered/0
send/3
send_after/4
set_label/1
sleep/1
spawn/2
spawn/4
unalias/1
unlink/1
unregister/1
whereis/1
Registry
Sections
Using in :via
Using as a dispatcher
Using as a PubSub
Registrations
ETS
Summary
Types
body/0
guard/0
guards/0
key/0
keys/0
listener_message/0
match_pattern/0
meta_key/0
meta_value/0
registry/0
spec/0
start_option/0
value/0
Functions
child_spec/1
count/1
count_match/4
count_select/2
delete_meta/2
dispatch/4
keys/2
lookup/2
match/4
meta/2
put_meta/3
register/3
select/2
start_link/1
unregister/2
unregister_match/4
update_value/3
values/3
Supervisor
Sections
Examples
Child specification
child_spec/1 function
Supervisor strategies and options
Module-based supervisors
Start and shutdown
Exit reasons and restarts
Summary
Types
auto_shutdown/0
child/0
child_spec/0
init_option/0
module_spec/0
name/0
on_start/0
on_start_child/0
option/0
restart/0
shutdown/0
strategy/0
sup_flags/0
supervisor/0
type/0
Callbacks
init/1
Functions
child_spec/2
count_children/1
delete_child/2
init/2
restart_child/2
start_child/2
start_link/2
start_link/3
stop/3
terminate_child/2
which_children/1
Task
Sections
async and await
Tasks are processes
Dynamically supervised tasks
Statically supervised tasks
Ancestor and Caller Tracking
Summary
Types
async_stream_option/0
ref/0
t/0
Functions
%Task{}
async/1
async/3
async_stream/3
async_stream/5
await/2
await_many/2
child_spec/1
completed/1
ignore/1
shutdown/2
start/1
start/3
start_link/1
start_link/3
yield/2
yield_many/2
Task.Supervisor
Sections
Scalability and partitioning
Name registration
Summary
Types
async_stream_option/0
option/0
Functions
async/3
async/5
async_nolink/3
async_nolink/5
async_stream/4
async_stream/6
async_stream_nolink/4
async_stream_nolink/6
children/1
start_child/3
start_child/5
start_link/1
terminate_child/2
Protocols
Collectable
Sections
Why Collectable?
Examples
Summary
Types
command/0
t/0
Functions
into/1
Enumerable
Summary
Types
acc/0
continuation/0
reducer/0
result/0
slicing_fun/0
t/0
t/1
to_list_fun/0
Functions
count/1
member?/2
reduce/3
slice/1
Inspect
Sections
Inspect representation
Deriving
Custom implementation
Summary
Types
t/0
Functions
inspect/2
Inspect.Algebra
Sections
Implementation details
Summary
Guards
is_doc/1
Types
t/0
Functions
break/1
collapse_lines/1
color/3
concat/1
concat/2
container_doc/6
empty/0
flex_break/1
flex_glue/3
fold_doc/2
force_unfit/1
format/2
glue/3
group/2
line/0
line/2
nest/3
next_break_fits/2
no_limit/1
space/2
string/1
to_doc/2
Inspect.Opts
Summary
Types
color_key/0
t/0
Functions
default_inspect_fun/0
default_inspect_fun/1
new/1
List.Chars
Summary
Types
t/0
Functions
to_charlist/1
Protocol
Sections
A real case
Protocols and Structs
Fallback to Any
Multiple implementations
Types
Reflection
Consolidation
Summary
Functions
assert_impl!/2
assert_protocol!/1
consolidate/2
consolidated?/1
derive/3
extract_impls/2
extract_protocols/1
String.Chars
Summary
Types
t/0
Functions
to_string/1
Code & Macros
Code
Sections
Working with files
Code loading on the Erlang VM
ensure_compiled/1 and ensure_compiled!/1
Compilation tracers
Summary
Types
binding/0
diagnostic/1
line/0
position/0
Functions
append_path/2
append_paths/2
available_compiler_options/0
can_await_module_compilation?/0
compile_file/2
compile_quoted/2
compile_string/2
compiler_options/0
compiler_options/1
delete_path/1
delete_paths/1
ensure_all_loaded/1
ensure_all_loaded!/1
ensure_compiled/1
ensure_compiled!/1
ensure_loaded/1
ensure_loaded!/1
ensure_loaded?/1
env_for_eval/1
eval_file/2
eval_quoted/3
eval_quoted_with_env/4
eval_string/3
fetch_docs/1
format_file!/2
format_string!/2
get_compiler_option/1
loaded?/1
prepend_path/2
prepend_paths/2
print_diagnostic/2
purge_compiler_modules/0
put_compiler_option/2
quoted_to_algebra/2
require_file/2
required_files/0
string_to_quoted/2
string_to_quoted!/2
string_to_quoted_with_comments/2
string_to_quoted_with_comments!/2
unrequire_files/1
with_diagnostics/2
Code.Fragment
Summary
Types
position/0
Functions
container_cursor_to_quoted/2
cursor_context/2
surround_context/3
Kernel.ParallelCompiler
Summary
Types
error/0
info/0
warning/0
Functions
async/1
compile/2
compile_to_path/3
pmap/2
require/2
Macro
Summary
Types
captured_remote_function/0
input/0
metadata/0
output/0
t/0
Functions
camelize/1
classify_atom/1
compile_apply/4
dbg/3
decompose_call/1
escape/2
expand/2
expand_literals/2
expand_literals/3
expand_once/2
generate_arguments/2
generate_unique_arguments/2
inspect_atom/2
operator?/2
path/2
pipe/3
postwalk/2
postwalk/3
postwalker/1
prewalk/2
prewalk/3
prewalker/1
quoted_literal?/1
special_form?/2
struct!/2
to_string/1
to_string/2
traverse/4
underscore/1
unescape_string/1
unescape_string/2
unique_var/2
unpipe/1
update_meta/2
validate/1
var/2
Macro.Env
Sections
Struct fields
Summary
Types
context/0
context_modules/0
file/0
line/0
name_arity/0
t/0
variable/0
Functions
define_alias/4
define_import/4
define_require/4
expand_alias/4
expand_import/5
expand_require/6
has_var?/2
in_guard?/1
in_match?/1
location/1
lookup_alias_as/2
lookup_import/2
prepend_tracer/2
prune_compile_info/1
required?/2
stacktrace/1
to_guard/1
to_match/1
vars/1
Deprecated
Behaviour
Summary
Functions
defcallback/1
defmacrocallback/1
Dict
Summary
Types
key/0
t/0
value/0
Functions
delete/2
drop/2
empty/1
equal?/2
fetch/2
fetch!/2
get/3
get_and_update/3
get_lazy/3
has_key?/2
keys/1
merge/2
merge/3
pop/3
pop_lazy/3
put/3
put_new/3
put_new_lazy/3
size/1
split/2
take/2
to_list/1
update/4
update!/3
values/1
GenEvent
Sections
Alternatives
Summary
Types
handler/0
manager/0
name/0
on_start/0
options/0
Callbacks
code_change/3
handle_call/2
handle_event/2
handle_info/2
init/1
terminate/2
HashDict
Summary
Types
t/0
Functions
delete/2
drop/2
equal?/2
fetch/2
fetch!/2
get/3
get_and_update/3
get_lazy/3
has_key?/2
keys/1
merge/3
new/0
pop/3
pop_lazy/3
put/3
put_new/3
put_new_lazy/3
size/1
split/2
take/2
to_list/1
update/4
update!/3
values/1
HashSet
Summary
Types
t/0
Functions
delete/2
difference/2
disjoint?/2
equal?/2
intersection/2
member?/2
new/0
put/2
size/1
subset?/2
to_list/1
union/2
Set
Summary
Types
t/0
value/0
values/0
Functions
delete/2
difference/2
disjoint?/2
empty/1
equal?/2
intersection/2
member?/2
put/2
size/1
subset?/2
to_list/1
union/2
Supervisor.Spec
Sections
Example
Supervisor and worker options
Summary
Types
child_id/0
modules/0
restart/0
shutdown/0
spec/0
strategy/0
worker/0
Functions
supervise/2
supervisor/3
worker/3
Exceptions
ArgumentError
ArithmeticError
BadArityError
BadBooleanError
BadFunctionError
BadMapError
BadStructError
CaseClauseError
Code.LoadError
CompileError
CondClauseError
Enum.EmptyError
Enum.OutOfBoundsError
ErlangError
File.CopyError
File.Error
File.LinkError
File.RenameError
FunctionClauseError
IO.StreamError
Inspect.Error
Kernel.TypespecError
KeyError
MatchError
MismatchedDelimiterError
OptionParser.ParseError
Protocol.UndefinedError
Regex.CompileError
RuntimeError
Sections
Fields
SyntaxError
System.EnvError
SystemLimitError
TokenMissingError
TryClauseError
URI.Error
UndefinedFunctionError
UnicodeConversionError
Version.InvalidRequirementError
Version.InvalidVersionError
WithClauseError
Search documentation of Elixir
Settings
View Source
Version.InvalidVersionError
exception
(Elixir v1.17.0-rc.0)
An exception raised when a version is invalid.
For example, see
Version.parse!/1
.
×