You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usually literal values will be interpreted "as is" on the head or body with the exception of tuples and records on the MatchBody, as the engine requires those to be wrapped in a single element tuple.
Examples
To represent the tuple #(1, 2, 3) we will require:
letbody=#(#(1,2,3))
To represent the record User(name: "Raúl") we will require:
letbody=#(#(tag("user"),"Raúl"))
Instead of having the user specifying double tuples everywhere in the body we could automate it, can be done for primitives but the hard part is how to solve for custom datastructures.
Erlang matchspecs are composed of tuple functions of 3 parts:
Usually literal values will be interpreted "as is" on the head or body with the exception of tuples and records on the
MatchBody
, as the engine requires those to be wrapped in a single element tuple.Examples
To represent the tuple
#(1, 2, 3)
we will require:To represent the record
User(name: "Raúl")
we will require:Instead of having the user specifying double tuples everywhere in the body we could automate it, can be done for primitives but the hard part is how to solve for custom datastructures.
This is partially implemented in v0.4.1.
The text was updated successfully, but these errors were encountered: