1{-# language ConstrainedClassMethods #-}
2{-# language ConstraintKinds #-}
3{-# language DataKinds #-}
4{-# language FlexibleContexts #-}
5{-# language FlexibleInstances #-}
6{-# language MultiParamTypeClasses #-}
7{-# language QuantifiedConstraints #-}
8{-# language StandaloneKindSignatures #-}
9{-# language TypeFamilies #-}
10{-# language UndecidableInstances #-}
12module Rel8.Table.Lifted
13 ( Table1( Columns1, ConstrainHContext1, toColumns1, fromColumns1 )
14 , Table2( Columns2, ConstrainHContext2, toColumns2, fromColumns2 )
20import Data.Kind ( Constraint, Type )
24import Rel8.Schema.Context ( Col )
25import Rel8.Schema.HTable ( HTable )
26import Rel8.Schema.HTable.Pair
27import qualified Rel8.Schema.Kind as K
30type Table1 :: (Type -> Type) -> Constraint
32 type Columns1 f :: K.HTable -> K.HTable
33 type ConstrainHContext1 f :: K.HContext -> Constraint
34 type ConstrainHContext1 _ = DefaultConstrainContext
36 toColumns1 :: (ConstrainHContext1 f context, HTable t)
39 -> Columns1 f t context
41 fromColumns1 :: (ConstrainHContext1 f context, HTable t)
43 -> Columns1 f t context
47type Table2 :: (Type -> Type -> Type) -> Constraint
49 type Columns2 p :: K.HTable -> K.HTable -> K.HTable
50 type ConstrainHContext2 p :: K.HContext -> Constraint
51 type ConstrainHContext2 _ = DefaultConstrainContext
53 toColumns2 :: (ConstrainHContext2 p context, HTable t, HTable u)
57 -> Columns2 p t u context
59 fromColumns2 :: (ConstrainHContext2 p context, HTable t, HTable u)
62 -> Columns2 p t u context
66instance Table2 (,) where
67 type Columns2 (,) = HPair
69 toColumns2 f g (a, b) = HPair (f a) (g b)
70 fromColumns2 f g (HPair a b) = (f a, g b)
73type DefaultConstrainContext :: K.HContext -> Constraint
74class DefaultConstrainContext context
75instance DefaultConstrainContext context
78type ConstrainContext :: (K.Context -> Constraint) -> K.HContext -> Constraint
79class (forall context. hcontext ~ Col context => constraint context)
80 => ConstrainContext constraint hcontext
81instance (hcontext ~ Col context, constraint context) =>
82 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