Algebraic data types: Difference between revisions

(Added Erlang)
Line 7:
=={{header|Bracmat}}==
 
<lang bracmat> ( ( balance
= a x b y c zd
. !arg
Line 29:
)
& ( ins
= C X tree a m z
. !arg:(?X.?tree)
& !tree:(?C.?a,?m,?z)
Line 53:
| insert$!arg
)
);</lang>
 
Test:
<lang bracmat> ( ( it allows for terse code which is easy to read
, and can represent the algorithm directly
.
)
: ?values
& insertMany$(!values.):?tree
& outlst$!tree
& done;</lang>
);</lang>
 
Output:
<lang bracmat> B(tree=
B
. ( B
. (R.(B.,,),algorithm,(B.,allows,))
Line 85 ⟶ 87:
, (R.(B.,the,),to,(B.,which,))
)
)</lang>
);</lang>
 
=={{header|Clojure}}==
483

edits