Suppose I've got some named objects which reference other objects by
name:
> data NodeS = NodeS {nameS :: String, refsS :: [String]}
Through name resolution, the strings are translated to the actual
nodes they denote:
> data Node = Node {name :: String, refs :: [Node]}
> resolve :: [NodeS] -> Map String Node
NodeS and Node are quite similar, so they should probably be the same
parametrized type. However, if I turn the type of the references into
a type parameter, I need the type-level Y combinator to avoid an
infinite type, and manipulating nodes turns a bit more tedious because
of increased syntactic overhead.
Is there a third choice, beyond manually expanding the type definition
or using Y?
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe