1{-# language DataKinds #-}
2{-# language StandaloneKindSignatures #-}
3{-# language TypeFamilies #-}
4{-# language TypeOperators #-}
5{-# language UndecidableInstances #-}
14import Data.Kind ( Type )
16 ( (:+:), (:*:), K1, M1, U1, V1
21import Rel8.FCF ( Eval, Exp )
24type GMap :: (Type -> Exp Type) -> (Type -> Type) -> Type -> Type
25type family GMap f rep where
26 GMap f (M1 i c rep) = M1 i c (GMap f rep)
28 GMap f (rep1 :+: rep2) = GMap f rep1 :+: GMap f rep2
30 GMap f (rep1 :*: rep2) = GMap f rep1 :*: GMap f rep2
31 GMap f (K1 i a) = K1 i (Eval (f a))
34-- | Map a @Type -> Type@ function over the @Type@-kinded type variables in
35-- of a type constructor.
36type Map :: (Type -> Exp Type) -> Type -> Type
37type family Map f a where
38 Map p (t a b c d e f g) =
39 t (Eval (p a)) (Eval (p b)) (Eval (p c)) (Eval (p d)) (Eval (p e))
40 (Eval (p f)) (Eval (p g))
41 Map p (t a b c d e f) =
42 t (Eval (p a)) (Eval (p b)) (Eval (p c)) (Eval (p d)) (Eval (p e))
45 t (Eval (p a)) (Eval (p b)) (Eval (p c)) (Eval (p d)) (Eval (p e))
46 Map p (t a b c d) = t (Eval (p a)) (Eval (p b)) (Eval (p c)) (Eval (p d))
47 Map p (t a b c) = t (Eval (p a)) (Eval (p b)) (Eval (p c))
48 Map p (t a b) = t (Eval (p a)) (Eval (p b))
49 Map p (t a) = t (Eval (p a))
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list