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

Aleksey Khudyakov alexey.skladnoy at gmail.com
Wed Feb 27 19:36:54 CET 2013


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



More information about the Haskell-Cafe mailing list