Data.* collections maintenance
bulatz at HotPOP.com
Thu Nov 10 04:53:27 EST 2005
Thursday, November 10, 2005, 11:59:49 AM, you wrote:
YG> How about a Strict and Strict Updatable version for
YG> each collection type?
btw, strict and non-strict version of the same routines can be
generated with help of classes:
data Tree a = Tree (Tree a) a (Tree a) | Empty
data StrictTree a = StrictTree !(StrictTree a) !a !(StrictTree a) | StrictEmpty
class Trees t a where
left, right, isEmpty....
instance Trees Tree where
left (Tree l e r) = l
instance Trees StrictTree where
left (StrictTree l e r) = l
and all other operations can be implemented in terms of left/right/...
Bulat mailto:bulatz at HotPOP.com
More information about the Libraries