Re:Try Idris
by fzltrp on Sunday April 13, 2014 @06:53PM
(#7583483)
If you know what enums are, think of algebraic data types as enums on steroid. You define an enum type as a set of unique values. ADT let you do the same, but let you also parameterize the enum values, and even use the enum type itself as a parameter type (a recursive definition). You can also make several ADTs mutually recursive. As other said, that's very handy to represent usual data structures like lists, trees.
[ Parent
| on HN ]
There are no comments on this comment yet.