[Haskell-cafe] Extending constraints

Bas van Dijk v.dijk.bas at gmail.com
Tue Jun 5 18:14:48 CEST 2012

On 5 June 2012 17:57, Bas van Dijk <v.dijk.bas at gmail.com> wrote:
> It works.

It turns out it doesn't work exactly as I want. Say I have this
ProxyWrapper of Nums:

p :: ProxyWrapper Num
p = ProxyWrapper (Proxy :: Proxy Int)

then the following would give a type error:

oops :: TypeRep
oops = typeOfInnerProxy p

    Couldn't match expected type `Ext Typeable constraint0'
                with actual type `Num'
    Expected type: ProxyWrapper (Ext Typeable constraint0)
      Actual type: ProxyWrapper Num
    In the first argument of `typeOfInnerProxy', namely `p'
    In the expression: typeOfInnerProxy p


More information about the Haskell-Cafe mailing list