GüŸnther Schmidt wrote:
data Container a = Single a | Many a [a] but the problem above is that the data structure would allow to construct a Many 5 [] :: Container Int.

I think you meant to do either

    data Container a = Single a | Many a (Container a)

or

    data Container a = Container a [a]

- Jake

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to