Skip to content

Instantly share code, notes, and snippets.

@neenjaw
Created January 26, 2020 03:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save neenjaw/49ca2088b93adfc217fdd8883c89f6d5 to your computer and use it in GitHub Desktop.

Elixir Concepts

A working document.

  • basic types
    • integer
    • hex, octal, and boolean integer forms
    • float
    • scientific notation float form
    • boolean
    • atom / symbols
    • binary
      • <>/2
      • binary_size
      • binary special forms
    • strings
      • utf-8, unicode, byte_size vs string length
      • ?/1
    • list
      • [head | tail] notation
      • ++/2
      • --/2
      • hd/1
      • tl/1
      • length/1
    • charlist
    • tuple
      • elem/2
      • put_elem/3
      • tuple_size/1
    • functions
      • anonymous functions
        • multiple clauses
      • is_function/1
      • pipe operator
  • advanced types
    • port
    • reference
    • pid
  • checking value type
    • is_.+/1
  • basic operators
    • +/2
    • -/2
    • */2
    • //2
    • div/2
    • rem/2
    • round/1
    • trunc/1
  • logical operators
    • or/2
    • and/2
    • not/1
    • ||/2
    • &&/2
    • !/1
  • comparison operators
    • type comparison
      • type order: number < atom < reference < function < port < pid < tuple < map < list < bitstring
    • ==/2
    • !=/2
    • ===/2
    • !==/2
    • </2, <=/2
    • /2, >=/2

  • pattern matching
    • =/2
    • deconstruction pattern matching
    • on function signatures
      • named and anonymous
    • pin operator ^/1
    • _ assignment
  • control structures
    • case
    • cond
    • if, unless, else
    • do end blocks
  • complex data types
    • keyword lists
      • keyed parameters collected for options
    • maps
    • nested data structures
      • put_in/2, /3
      • update_in/2, /3
      • get_and_update_in/2, /3
  • Modules
    • Compiling
      • elixirc
      • ebin, lib, test
    • Scripts
    • Named functions
      • function captures
        • &
        • syntax &(&1 + 1)
        • invoking captures
      • default arguments
        • function headers
  • Recursion
  • Processes
    • spawn
    • send..receive
    • links
    • tasks
    • state
    • agents
  • IO and Filesystem
    • IO
    • File
    • Path
    • Processes
    • iodata
    • chardata
  • Multimodules
    • alias
    • require
    • import
      • only
      • except
    • use
      • allows used module to inject any code
      • __using__/1 callback
  • Module attributes
    • annotations
      • @vsn
      • @moduledoc
      • @doc
      • @behaviour
      • @before_compile
    • as constants
    • redefine vs accumulate
  • structs
    • defining
    • accessing and updating
    • structs as maps
    • default and required keys
  • protocols (polymorphism)
    • protocols on data types
    • protocols on structs
    • Any
  • comprehensions
    • generators
    • filters
    • into
  • sigils
  • try, catch, rescue
    • errors
    • throws
    • exits
    • after
    • else
  • typespecs
  • behaviors
    • @callback
    • @behavior
    • @impl
    • dynamic dispatch
  • metaprogramming
  • style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment