
4 Jun
2009
4 Jun
'09
8:16 p.m.
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