I'm probably being dumb, but Hoogle nor the wiki are helping me.

I want an instance and type improvement constraint of the form

    instance (f ~ (-> Bool)) => C Foo (f b) where ...

The first arg to C is driving type improvement, for example:

    instance (f ~ []) => C Bar (f b) where ...

(The real instances are more complex, and involve overlap, of course.)

I'm trying to write a section to get the improved type (b -> Bool), 
but (-> Bool) or ((-> Bool) b) is invalid syntax.

This is valid, but wrong: ((->) Bool) b  -- gives (Bool -> b).

I could do:

    data FlipFun b          -- abstract
    instance (f ~ FlipFun) => C Foo (f b) where ...

And a type function inside the class to generate the type.
But then I'd have to apply the type function for all instances,
and in most places it'd be id.

??


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to