1{-# language ConstraintKinds #-}
2{-# language DataKinds #-}
3{-# language FlexibleInstances #-}
4{-# language MultiParamTypeClasses #-}
5{-# language QuantifiedConstraints #-}
6{-# language StandaloneKindSignatures #-}
7{-# language TypeFamilies #-}
8{-# language UndecidableInstances #-}
10module Rel8.Schema.Spec.ConstrainDBType
19import Data.Kind ( Constraint, Type )
23import Rel8.Schema.Dict ( Dict( Dict ) )
24import Rel8.Schema.Nullability
27 , Sql, nullabilization, toSql
29import Rel8.Schema.Spec ( Spec( Spec ) )
32type ConstrainDBType :: (Type -> Constraint) -> Spec -> Constraint
34 ( forall c labels necessity a. ()
35 => (spec ~ 'Spec labels necessity a)
36 => (forall x. (constraint x => c x)) => Sql c a
38 => ConstrainDBType constraint spec
40 ( spec ~ 'Spec labels necessity a
43 => ConstrainDBType constraint spec
46dbTypeNullability :: Dict (ConstrainDBType c) ('Spec l n a) -> Nullability a
47dbTypeNullability = step2 . step1
49 step1 :: Dict (ConstrainDBType c) ('Spec l n a) -> Dict (Sql c) a
52 step2 :: Dict (Sql c) a -> Nullability a
53 step2 Dict = nullabilization
56dbTypeDict :: Dict (ConstrainDBType c) ('Spec l n a) -> Dict c (Unnullify a)
57dbTypeDict = step2 . step1
59 step1 :: Dict (ConstrainDBType c) ('Spec l n a) -> Dict (Sql c) a
62 step2 :: Dict (Sql c) a -> Dict c (Unnullify a)
66fromNullabilityDict :: Nullability a -> Dict c (Unnullify a) -> Dict (ConstrainDBType c) ('Spec l n a)
67fromNullabilityDict nullability = step2 . toSql nullability
69 step2 :: Dict (Sql c) a -> Dict (ConstrainDBType c) ('Spec l n 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