Sittampalam, Ganesh wrote:
I think they have a useful place in propagating semi-global
configuration information without imposing huge syntactic overhead.

Right, for instance,

  type MyMonad a = (?env :: Env) => IO a

No lift needed!

I was hoping to use IPs to do OO-style implicit type conversion from a "derived" type to "base" type. For instance:

  type Base = forall a. ((?f1 :: Int) => a) -> a

  field1 :: Base -> Int
  field1 b = b ?f1

  type Derived = forall a. ((?f1 :: Int, ?f2 :: String) => a) -> a

  d :: Derived
  d x = let {?f1 = 3;?f2 = "Hello"} in x

  f1d :: Int
  f1d = field1 d

Annoyingly, GHC objects to the "field1 d" application.

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

Reply via email to