1{-# language DataKinds #-}
2{-# language FlexibleInstances #-}
3{-# language FunctionalDependencies #-}
4{-# language StandaloneKindSignatures #-}
5{-# language TypeFamilies #-}
6{-# language UndecidableInstances #-}
7{-# language UndecidableSuperClasses #-}
9module Rel8.Table.Recontextualize
15import Data.Functor.Identity ( Identity )
16import Data.Kind ( Constraint, Type )
20import Rel8.Schema.Context ( Col )
21import Rel8.Schema.HTable ( HTable )
22import qualified Rel8.Schema.Kind as K
23import Rel8.Schema.Null ( Sql )
24import Rel8.Schema.Result ( Result )
25import Rel8.Table ( Table, Congruent )
26import Rel8.Type ( DBType )
29-- | @Recontextualize from to a b@ is evidence that the types @a@ and @b@ are
30-- related, and that @b@ is the same type as @a@, but after changing the
31-- context from the initial context @from@, to the new context @to@.
32type Recontextualize :: K.Context -> K.Context -> Type -> Type -> Constraint
37 , Recontextualize from from a a
38 , Recontextualize to to b b
39 , Recontextualize to from b a
40 ) => Recontextualize from to a b
47instance Sql DBType a => Recontextualize Result Result (Identity a) (Identity a)
50instance HTable t => Recontextualize from to (t (Col from)) (t (Col to))
54 ( Recontextualize from to a1 b1
55 , Recontextualize from to a2 b2
57 => Recontextualize from to (a1, a2) (b1, b2)
61 ( Recontextualize from to a1 b1
62 , Recontextualize from to a2 b2
63 , Recontextualize from to a3 b3
65 => Recontextualize from to (a1, a2, a3) (b1, b2, b3)
69 ( Recontextualize from to a1 b1
70 , Recontextualize from to a2 b2
71 , Recontextualize from to a3 b3
72 , Recontextualize from to a4 b4
74 => Recontextualize from to (a1, a2, a3, a4) (b1, b2, b3, b4)
78 ( Recontextualize from to a1 b1
79 , Recontextualize from to a2 b2
80 , Recontextualize from to a3 b3
81 , Recontextualize from to a4 b4
82 , Recontextualize from to a5 b5
84 => Recontextualize from to (a1, a2, a3, a4, a5) (b1, b2, b3, b4, b5)
88 ( Recontextualize from to a1 b1
89 , Recontextualize from to a2 b2
90 , Recontextualize from to a3 b3
91 , Recontextualize from to a4 b4
92 , Recontextualize from to a5 b5
93 , Recontextualize from to a6 b6
95 => Recontextualize from to (a1, a2, a3, a4, a5, a6) (b1, b2, b3, b4, b5, b6)
99 ( Recontextualize from to a1 b1
100 , Recontextualize from to a2 b2
101 , Recontextualize from to a3 b3
102 , Recontextualize from to a4 b4
103 , Recontextualize from to a5 b5
104 , Recontextualize from to a6 b6
105 , Recontextualize from to a7 b7
107 => Recontextualize from to (a1, a2, a3, a4, a5, a6, a7) (b1, b2, b3, b4, b5, b6, b7)
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