1{-# language ConstraintKinds #-}
2{-# language DataKinds #-}
3{-# language FlexibleContexts #-}
4{-# language FlexibleInstances #-}
5{-# language MultiParamTypeClasses #-}
6{-# language QuantifiedConstraints #-}
7{-# language StandaloneKindSignatures #-}
8{-# language TypeFamilies #-}
9{-# language UndecidableInstances #-}
11module Rel8.Table.Lifted
12 ( Table1( Columns1, ConstrainHContext1, toColumns1, fromColumns1 )
13 , Table2( Columns2, ConstrainHContext2, toColumns2, fromColumns2 )
19import Data.Kind ( Constraint, Type )
23import Rel8.Schema.Context ( Col )
24import Rel8.Schema.HTable ( HTable )
25import Rel8.Schema.HTable.Pair
26import qualified Rel8.Schema.Kind as K
29type Table1 :: (Type -> Type) -> Constraint
31 type Columns1 f :: K.HTable -> K.HTable
32 type ConstrainHContext1 f :: K.HContext -> Constraint
33 type ConstrainHContext1 _ = DefaultConstrainContext
35 toColumns1 :: (ConstrainHContext1 f context, HTable t)
38 -> Columns1 f t context
40 fromColumns1 :: (ConstrainHContext1 f context, HTable t)
42 -> Columns1 f t context
46type Table2 :: (Type -> Type -> Type) -> Constraint
48 type Columns2 p :: K.HTable -> K.HTable -> K.HTable
49 type ConstrainHContext2 p :: K.HContext -> Constraint
50 type ConstrainHContext2 _ = DefaultConstrainContext
52 toColumns2 :: (ConstrainHContext2 p context, HTable t, HTable u)
56 -> Columns2 p t u context
58 fromColumns2 :: (ConstrainHContext2 p context, HTable t, HTable u)
61 -> Columns2 p t u context
65instance Table2 (,) where
66 type Columns2 (,) = HPair
68 toColumns2 f g (a, b) = HPair (f a) (g b)
69 fromColumns2 f g (HPair a b) = (f a, g b)
72type DefaultConstrainContext :: K.HContext -> Constraint
73class DefaultConstrainContext context
74instance DefaultConstrainContext context
77type ConstrainContext :: (K.Context -> Constraint) -> K.HContext -> Constraint
78class (forall context. hcontext ~ Col context => constraint context)
79 => ConstrainContext constraint hcontext
80instance (hcontext ~ Col context, constraint context) =>
81 ConstrainContext constraint hcontext
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