[Haskell-cafe] Parameterize constraints of existentially quantified types

Bas van Dijk v.dijk.bas at gmail.com
Sat Apr 21 18:05:29 CEST 2012


Hi,

I just found out that with the new ConstraintKinds extension we can
parameterize the constraint of an existentially quantified type:

{-# LANGUAGE KindSignatures, ConstraintKinds, ExistentialQuantification #-}
import GHC.Exts
data Some (c :: * -> Constraint) = forall a. c a => Some a

This could be used to define SomeException for example:

import Control.Exception (Exception)
type SomeException = Some Exception

Are there any other use cases?

Bas



More information about the Haskell-Cafe mailing list