timCF / typable

Protocol which describes type identifier of Elixir term

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typable

Protocol which describes type identifier of Elixir term

Hex Documentation

Installation

The package can be installed by adding typable to your list of dependencies in mix.exs:

def deps do
  [
    {:typable, "~> 0.3.0"}
  ]
end

Examples

iex> require Type
Type

iex> Type.type_of(1)
Integer
iex> Type.type_of(self())
PID
iex> Type.type_of(%URI{})
URI

iex> Type.instance_of(Integer)
0
iex> Type.instance_of(PID)
#PID<0.0.0>
iex> Type.instance_of(URI)
%URI{
  authority: nil,
  fragment: nil,
  host: nil,
  path: nil,
  port: nil,
  query: nil,
  scheme: nil,
  userinfo: nil
}

About

Protocol which describes type identifier of Elixir term


Languages

Language:Elixir 93.0%Language:Shell 7.0%