Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added ForallT, for monad-transformer-like types.

  • Loading branch information...
commit 8ee6d59612967e760b49dc52a87d49de13d2df83 1 parent 7f10153
@sjoerdvisscher sjoerdvisscher authored
Showing with 7 additions and 1 deletion.
  1. +6 −0 Data/Constraint/Forall.hs
  2. +1 −1  constraints.cabal
View
6 Data/Constraint/Forall.hs
@@ -22,6 +22,7 @@ module Data.Constraint.Forall
( Forall, inst
, ForallF, instF
, Forall1, inst1
+ , ForallT, instT
) where
import Data.Constraint
@@ -39,6 +40,8 @@ data F a
data M a
type Forall1 (p :: (* -> *) -> Constraint) = (p F, p M)
+type ForallT (p :: * -> Constraint) (t :: (* -> *) -> * -> *) = (p (t F A), p (t M B))
+
-- | instantiate a quantified constraint on kind @*@
inst :: forall p a. Forall p :- p a
@@ -51,3 +54,6 @@ instF = trans (unsafeCoerceConstraint :: p (f A) :- p (f a)) weaken1
inst1 :: forall (p :: (* -> *) -> Constraint) (f :: * -> *). Forall1 p :- p f
inst1 = trans (unsafeCoerceConstraint :: p F :- p f) weaken1
+instT :: forall (p :: * -> Constraint) (t :: (* -> *) -> * -> *) (f :: * -> *) a. ForallT p t :- p (t f a)
+instT = trans (unsafeCoerceConstraint :: p (t F A) :- p (t f a)) weaken1
+
View
2  constraints.cabal
@@ -1,6 +1,6 @@
name: constraints
category: Constraints
-version: 0.3.1
+version: 0.3.2
license: BSD3
cabal-version: >= 1.10
license-file: LICENSE
Please sign in to comment.
Something went wrong with that request. Please try again.