[Haskell-cafe] Help to write type-level function

Dmitry Kulagin dmitry.kulagin at gmail.com
Wed Feb 27 20:27:28 CET 2013


Oh, that is my fault - I was sure that I specified the extension and it
didn't help.
It really works with Overlapping&Undecidable.
Thank you!


On Wed, Feb 27, 2013 at 10:36 PM, Aleksey Khudyakov <
alexey.skladnoy at gmail.com> wrote:

> On 27.02.2013 17:35, Dmitry Kulagin wrote:
>
>> Hi Aleksey,
>>
>> Unfortunately, your solution does not work for me (ghc 7.6.2). I reduced
>> the problem to:
>>
>> -- | Type class for type equality.
>> class  TypeEq (a :: α) (b :: α) (eq :: Bool) | a b -> eq
>> instance               TypeEq a a True
>> -- instance TypeEq a b False
>> instance eq ~ False => TypeEq a b eq
>>
>>  You need to add pragma {-# LANGUAGE OverlappingInstances #-}
> to the file where instances defined. Without it GHC will complain
> about overlap and unlike other extensions won't recommend pragma
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130227/8f3aef82/attachment.htm>


More information about the Haskell-Cafe mailing list