Type-level
fmap for type-level functors.
Note: this name clashes with
Map from
containers.
FMap is provided as a synonym to avoid this.
Example
>>> data Example where Ex :: a -> Example -- Hide the type of examples to avoid brittleness in different GHC versions
>>> data AddMul :: Nat -> Nat -> Exp Nat
>>> type instance Eval (AddMul x y) = (x TL.+ y) TL.* (x TL.+ y)
>>> :kind! Ex (Eval (Map (AddMul 2) '[0, 1, 2, 3, 4]) :: [Nat])
Ex (Eval (Map (AddMul 2) '[0, 1, 2, 3, 4]) :: [Nat]) :: Example
= Ex [4, 9, 16, 25, 36]