Elixir's Info function
The elixir Kernel module has an interesting function i/1
that returns information about whatever you pass to it.
It will provide the argument's data type, byte size, raw representation, a description, and reference modules
i("hello world")
#=>
# Term
# "hello world"
# Data type
# BitString
# Byte size
# 11
# Description
# This is a string: a UTF-8 encoded binary. It's printed surrounded by
# "double quotes" because all UTF-8 encoded code points in it are printable.
# Raw representation
# <<104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100>>
# Reference modules
# String, :binary
# Implemented protocols
# Collectable, IEx.Info, Inspect, List.Chars, String.Chars
Tweet