14 Nov 02:20
Re: A small (?) problem with type families
Edward Kmett <ekmett <at> gmail.com>
2009-11-14 01:20:14 GMT
2009-11-14 01:20:14 GMT
On Fri, Nov 13, 2009 at 3:36 PM, David Menendez <dave <at> zednenem.com> wrote:
On Fri, Nov 13, 2009 at 3:26 PM, Andy Gimblett <haskell <at> gimbo.org.uk> wrote:This is ambiguous. Type families are not injective (that is, Y a ~ Y b
> First a type family where the type Y is functionally dependent on
> the type X, and we have a function from Y to ().
>
>> class X a where
>> type Y a
>> enact :: Y a -> ()
does not imply a ~ b), so there's no way for the compiler to figure
out which instance of X is being used when it encounters enact.
Note: that if you need this injectivity you can use a data family instead.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe <at> haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RSS Feed