[Haskell-beginners] Type depending on value

Marcin Mrotek marcin.jan.mrotek at gmail.com
Fri May 13 10:19:24 UTC 2016


Hello,

Well, yes, singleton defined that way doesn't enforce the value to be equal
to the type. Maybe you could use a type class for natVec? It's not a
particularly elegant solution, but it's the only one I came up with. Or
maybe use two different singleton types, one hidden and only used in
SNatClass, and the other exposed and defined the way you did originally?

Best regards,
Marcin Mrotek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160513/27565ee8/attachment.html>


More information about the Beginners mailing list