Hi Jake,

apologies,

Jake McArthur schrieb:
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)


you're right, the above solution is indeed exactly what I need. It took me until Tillmans later elaborate reply to realize.

Sometimes I'm unable to see things even when they bite me in the face, ouch!

Günther


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