# LANGUAGE KindSignatures , ConstraintKinds , MultiParamTypeClasses , FlexibleInstances , UndecidableInstances #
module Ctx where

import Data.Kind ( Constraint )

data Proxy (ctxt :: * -> Constraint) = Proxy

  At one time , this one worked :
nonmeth :: ctxt Int => Proxy ctxt -> a
nonmeth prox = nonmeth prox


class Foo (ctxt :: * -> Constraint) a where
    meth :: ctxt a => Proxy ctxt -> a

instance ctxt Int => Foo ctxt Int where
    -- But this one didn't:
    meth prox = meth prox

-- The error was:
  Could not deduce ( ctxt Int ) arising from a use of ` meth '
  from the context (   )

-- The problem was that irreducible evidence did not interact with
-- evidence of equal type.

 But this one didn't:
 The error was:
 The problem was that irreducible evidence did not interact with
 evidence of equal type.
# LANGUAGE KindSignatures , ConstraintKinds , MultiParamTypeClasses , FlexibleInstances , UndecidableInstances #
module Ctx where

import Data.Kind ( Constraint )

data Proxy (ctxt :: * -> Constraint) = Proxy

  At one time , this one worked :
nonmeth :: ctxt Int => Proxy ctxt -> a
nonmeth prox = nonmeth prox


class Foo (ctxt :: * -> Constraint) a where
    meth :: ctxt a => Proxy ctxt -> a

instance ctxt Int => Foo ctxt Int where
    meth prox = meth prox

  Could not deduce ( ctxt Int ) arising from a use of ` meth '
  from the context (   )

