Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Overloaded functions.
Documentation
data Map :: (a -> Exp b) -> f a -> Exp (f b) Source #
Type-level fmap
for type-level functors.
Example
>>>
import Fcf.Data.Nat
>>>
import qualified GHC.TypeLits as TL
>>>
data AddMul :: Nat -> Nat -> Exp Nat
>>>
type instance Eval (AddMul x y) = (x TL.+ y) TL.* (x TL.+ y)
>>>
:kind! Eval (Map (AddMul 2) '[0, 1, 2, 3, 4])
Eval (Map (AddMul 2) '[0, 1, 2, 3, 4]) :: [Nat] = '[4, 9, 16, 25, 36]
Instances
type Eval (Map f (a2 ': as) :: [b] -> Type) Source # | |
type Eval (Map f ([] :: [a]) :: [b] -> Type) Source # | |
Defined in Fcf.Classes | |
type Eval (Map f (Just a3) :: Maybe a2 -> Type) Source # | |
type Eval (Map f (Nothing :: Maybe a) :: Maybe b -> Type) Source # | |
type Eval (Map f (Right a3 :: Either a2 a1) :: Either a2 b -> Type) Source # | |
type Eval (Map f (Left x :: Either a2 a1) :: Either a2 b -> Type) Source # | |
type Eval (Map f ((,) x a2) :: (k2, k1) -> Type) Source # | |
type Eval (Map f ((,,) x y a2) :: (k2, k3, k1) -> Type) Source # | |
type Eval (Map f ((,,,) x y z a2) :: (k2, k3, k4, k1) -> Type) Source # | |
type Eval (Map f ((,,,,) x y z w a2) :: (k2, k3, k4, k5, k1) -> Type) Source # | |
data Bimap :: (a -> Exp a') -> (b -> Exp b') -> f a b -> Exp (f a' b') Source #
Type-level bimap
.