Lists are pointers to the head of list. It can be defined by a discriminated union type. Using continuation can do a tail-recursion version of appending two lists.
3 people like thisPosted: 11 years ago by Joel Huang
This little snippet shows you how you can create a simple recursive data type and define a pair of functions that maps the set of positive integers to unique instances in the AST and back again.
2 people like thisPosted: 5 years ago by Steve Goguen
Immutable stack can be implemented via Discriminated Union Type with methods like Push and Pop. The following snippet is a simple version of it.
2 people like thisPosted: 11 years ago by Joel Huang