Copyright | Copyright (C) 2015 Kyle Carter |
---|---|
License | BSD3 |
Maintainer | Kyle Carter <kylcarte@indiana.edu> |
Stability | experimental |
Portability | RankNTypes |
Safe Haskell | None |
Language | Haskell2010 |
Convenient type families for working with type-level Either
s.
- type family EitherC ec :: Constraint
- type family IsLeft a :: Bool
- type family IsRight a :: Bool
- leftCong :: (a ~ b) :- (IsLeft a ~ IsLeft b)
- rightCong :: (a ~ b) :- (IsRight a ~ IsRight b)
- leftNotRight :: (Left a ~ Right b) :- Fail
- type family f <$> a :: Either m l
- eitherFmapCong :: (f ~ g, a ~ b) :- ((f <$> a) ~ (g <$> b))
- type family f <&> a :: Either m l
- eitherPamfCong :: (f ~ g, a ~ b) :- ((f <&> a) ~ (g <&> b))
- type family f <*> a :: Either m l
- eitherApCong :: (f ~ g, a ~ b) :- ((f <*> a) ~ (g <*> b))
- type family a <|> b :: Either m k
- eitherAltCong :: (a ~ c, b ~ d) :- ((a <|> b) ~ (c <|> d))
- type family FromLeft e :: k
- type family FromRight e :: l
- fromLeftCong :: (a ~ b) :- (FromLeft a ~ FromLeft b)
- fromRightCong :: (a ~ b) :- (FromRight a ~ FromRight b)
Documentation
type family EitherC ec :: Constraint Source
Take a Maybe Constraint
to a Constraint
.
eitherFmapCong :: (f ~ g, a ~ b) :- ((f <$> a) ~ (g <$> b)) Source
eitherPamfCong :: (f ~ g, a ~ b) :- ((f <&> a) ~ (g <&> b)) Source
eitherApCong :: (f ~ g, a ~ b) :- ((f <*> a) ~ (g <*> b)) Source
eitherAltCong :: (a ~ c, b ~ d) :- ((a <|> b) ~ (c <|> d)) Source
fromLeftCong :: (a ~ b) :- (FromLeft a ~ FromLeft b) Source
fromRightCong :: (a ~ b) :- (FromRight a ~ FromRight b) Source