Simon Peyton-Jones wrote:

3. Dictionaries are packaged in data constructors

This feature has been often requested, becuase it allows you to
package a dictionary into an ordinary (non-existential) data type, and
be able to use it.

Indeed, one can now simply reify class instances:

  data NumInst a where
    MkNumInst :: Num a => NumInst a

  intInst :: NumInst Int
  intInst = MkNumInst

  plus :: NumInst a -> a -> a -> a
  plus MkNumInst p q = p + q

Expect a whole new batch of type shenanigans from Oleg.

--
Ashley Yakeley
Seattle, WA

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to