On Mon, Dec 21, 2015 at 8:51 PM, Imants Cekusins <imantc@gmail.com> wrote:

data Item a = Truck a [Item] | Box a [Item] | Parcel a [Item] | Can a [Item]

A cardinal rule of FP data modelling is to avoid the hazards of junk, a.k.a. make the meaningless unspeakable.

Here an Item could be a Can that contains a Parcel that contains a Box that in turn has a Truck inside.

What will Item-processing functions do with this Item?

Garbage In Garbage Out.

-- Kim-Ee