[Haskell-cafe] Restrict values in type

Simon Yarde simonyarde at me.com
Fri Jan 17 10:39:55 UTC 2014

If it's not been mentioned, this tutorial regarding Type Families and the kinds of restrictions you mention might provide a few pointers:


In general, I've found key concepts to hold in mind are 'exclusion of bad programs' mentioned in the paper Fun With Types:


I'm sorry if any of this has been mentioned previous.

I asked a related question yesterday about the relative merits of creating type restrictions using using newtypes (unions), which I agree seem unwieldy, and using multi-parameter-type-classes (and/or type families) to enable exclusion-of-bad-programms via instances.  I'd be interested to follow along and see what you discover.

Simon Yarde

More information about the Haskell-Cafe mailing list