Tuples Mapping
Tuples are defined as primitive data types in Hamler and compiled to Erlang tuples.
The differences from Erlang are as below:
Tuples in Hamler are enclosed within parentheses, while Tuples in Erlang are enclosed in braces.
The maximum length of Tuples in Hamler is 7, while there is no limit in Erlang.
Tuples in Hamler:
(1, "a", true)
(1, "a")
(:error, "Reason")
-- fst, snd
fst (1, 'a') :: Integer -- 1
snd (1, 'a') :: Char -- 'a'
Tuples in Erlang:
{1, "a", true}
{1, "a"}
{error, "Reason"}
当前内容版权归 hamler-lang 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 hamler-lang .