Copyright | Copyright (C) 2015 Kyle Carter |
---|---|
License | BSD3 |
Maintainer | Kyle Carter <kylcarte@indiana.edu> |
Stability | experimental |
Portability | RankNTypes |
Safe Haskell | None |
Language | Haskell2010 |
- data Some f :: * where
- some :: Some f -> (forall a. f a -> r) -> r
- (>>-) :: Some f -> (forall a. f a -> r) -> r
- withSome :: (forall a. f a -> r) -> Some f -> r
- onSome :: (forall a. f a -> g x) -> Some f -> Some g
- data Some2 f :: * where
- some2 :: Some2 f -> (forall a b. f a b -> r) -> r
- (>>--) :: Some2 f -> (forall a b. f a b -> r) -> r
- withSome2 :: (forall a b. f a b -> r) -> Some2 f -> r
- onSome2 :: (forall a b. f a b -> g x y) -> Some2 f -> Some2 g
- data Some3 f :: * where
- some3 :: Some3 f -> (forall a b c. f a b c -> r) -> r
- (>>---) :: Some3 f -> (forall a b c. f a b c -> r) -> r
- withSome3 :: (forall a b c. f a b c -> r) -> Some3 f -> r
- onSome3 :: (forall a b c. f a b c -> g x y z) -> Some3 f -> Some3 g
- data SomeC c f where
- someC :: SomeC c f -> (forall a. c a => f a -> r) -> r
- (>>~) :: SomeC c f -> (forall a. c a => f a -> r) -> r
- data Every f :: * where
- data Every2 f :: * where
- Every2 :: {
- instEvery2 :: forall a b. f a b
- Every2 :: {
- data Every3 f :: * where
- Every3 :: {
- instEvery3 :: forall a b c. f a b c
- Every3 :: {
Documentation
some :: Some f -> (forall a. f a -> r) -> r Source
An eliminator for a Some
type.
Consider this function akin to a Monadic bind, except instead of binding into a Monad with a sequent function, we're binding into the existential quantification with a universal eliminator function.
It serves as an explicit delimiter in a program of where the type index may be used and depended on, and where it may not.
NB: the result type of the eliminating function may
not refer to the universally quantified type index a
.
data Every2 f :: * where Source
Every2 :: (forall a b. f a b) -> Every2 f | |
|
data Every3 f :: * where Source
Every3 :: (forall a b c. f a b c) -> Every3 f | |
|