on master help sign in
Reverse dependency between Rel8.Schema.Context and Rel8.Schema.Result
c8341c1Shane O'Brien
src/Rel8/Generic/Table/ADT.hs+1−2
@@ -36,7 +36,6 @@ import Rel8.Generic.Table.Record
36 ( GTable, GColumns, gtable
36 ( GTable, GColumns, gtable
37 , GToExprs, gfromResult, gtoResult
37 , GToExprs, gfromResult, gtoResult
38 )
38 )
39−import Rel8.Schema.Context ( Col( Result ) )
40import Rel8.Schema.Context.Label ( HLabelable, hlabeler, labeler, unlabeler )
39import Rel8.Schema.Context.Label ( HLabelable, hlabeler, labeler, unlabeler )
41import Rel8.Schema.Context.Result ( null, nullifier, unnullifier )
40import Rel8.Schema.Context.Result ( null, nullifier, unnullifier )
42import Rel8.Schema.HTable ( HTable, hmap )
41import Rel8.Schema.HTable ( HTable, hmap )
@@ -47,7 +46,7 @@ import Rel8.Schema.HTable.Type ( HType( HType ) )
47import qualified Rel8.Schema.Kind as K
46import qualified Rel8.Schema.Kind as K
48import Rel8.Schema.Null ( Nullify )
47import Rel8.Schema.Null ( Nullify )
49import Rel8.Schema.Spec ( Spec( Spec ), SSpec )
48import Rel8.Schema.Spec ( Spec( Spec ), SSpec )
50−import Rel8.Schema.Result ( Result )
49+import Rel8.Schema.Result ( Col( Result ), Result )
51import Rel8.Type.Tag ( Tag( Tag ) )
50import Rel8.Type.Tag ( Tag( Tag ) )
52
51
53-- text
52-- text
src/Rel8/Schema/Context.hs+1−9
@@ -1,10 +1,9 @@
1{-# language DataKinds #-}
1{-# language DataKinds #-}
2−{-# language GADTs #-}
3{-# language StandaloneKindSignatures #-}
2{-# language StandaloneKindSignatures #-}
4{-# language TypeFamilies #-}
3{-# language TypeFamilies #-}
5
4
6module Rel8.Schema.Context
5module Rel8.Schema.Context
7− ( Interpretation(..), Col( Result )
6+ ( Interpretation( Col )
8 )
7 )
9where
8where
10
9
@@ -14,15 +13,8 @@ import Prelude ()
14
13
15-- rel8
14-- rel8
16import Rel8.Schema.Kind ( Context, HContext )
15import Rel8.Schema.Kind ( Context, HContext )
17−import Rel8.Schema.Result ( Result )
18−import Rel8.Schema.Spec ( Spec( Spec ) )
19
16
20
17
21type Interpretation :: Context -> Constraint
18type Interpretation :: Context -> Constraint
22class Interpretation context where
19class Interpretation context where
23 data Col context :: HContext
20 data Col context :: HContext
24−
25−
26−instance Interpretation Result where
27− data Col Result _spec where
28− Result :: a -> Col Result ('Spec labels necessity a)
src/Rel8/Schema/Context/Label.hs+2−2
@@ -15,11 +15,11 @@ import Data.Kind ( Constraint )
15import Prelude hiding ( null )
15import Prelude hiding ( null )
16
16
17-- rel8
17-- rel8
18−import Rel8.Schema.Context ( Interpretation, Col(..) )
18+import Rel8.Schema.Context ( Interpretation )
19import Rel8.Schema.Dict ( Dict( Dict ) )
19import Rel8.Schema.Dict ( Dict( Dict ) )
20import Rel8.Schema.Kind ( Context, HContext )
20import Rel8.Schema.Kind ( Context, HContext )
21import Rel8.Schema.Spec ( Spec( Spec ) )
21import Rel8.Schema.Spec ( Spec( Spec ) )
22−import Rel8.Schema.Result ( Result )
22+import Rel8.Schema.Result ( Col( Result ), Result )
23import Rel8.Schema.Spec.ConstrainDBType ( ConstrainDBType )
23import Rel8.Schema.Spec.ConstrainDBType ( ConstrainDBType )
24
24
25
25
src/Rel8/Schema/Context/Result.hs+1−3
@@ -1,7 +1,6 @@
1{-# language DataKinds #-}
1{-# language DataKinds #-}
2{-# language NamedFieldPuns #-}
2{-# language NamedFieldPuns #-}
3{-# language TypeFamilies #-}
3{-# language TypeFamilies #-}
4−{-# language UndecidableInstances #-}
5
4
6module Rel8.Schema.Context.Result
5module Rel8.Schema.Context.Result
7 ( relabel
6 ( relabel
@@ -14,10 +13,9 @@ where
14import Prelude hiding ( null )
13import Prelude hiding ( null )
15
14
16-- rel8
15-- rel8
17−import Rel8.Schema.Context ( Col(..) )
18import Rel8.Schema.HTable.Identity ( HIdentity(..) )
16import Rel8.Schema.HTable.Identity ( HIdentity(..) )
19import Rel8.Schema.Null ( Nullify, Nullity( Null, NotNull ) )
17import Rel8.Schema.Null ( Nullify, Nullity( Null, NotNull ) )
20−import Rel8.Schema.Result ( Result )
18+import Rel8.Schema.Result ( Col( Result ), Result )
21import Rel8.Schema.Spec ( Spec( Spec ), SSpec(..) )
19import Rel8.Schema.Spec ( Spec( Spec ), SSpec(..) )
22
20
23
21
src/Rel8/Schema/Field.hs+1−2
@@ -32,7 +32,6 @@ import Rel8.Kind.Necessity
32 , SNecessity( SRequired, SOptional )
32 , SNecessity( SRequired, SOptional )
33 , KnownNecessity, necessitySing
33 , KnownNecessity, necessitySing
34 )
34 )
35−import Rel8.Schema.Context ( Col(..) )
36import Rel8.Schema.HTable.Either ( HEitherTable )
35import Rel8.Schema.HTable.Either ( HEitherTable )
37import Rel8.Schema.HTable.List ( HListTable )
36import Rel8.Schema.HTable.List ( HListTable )
38import Rel8.Schema.HTable.Maybe ( HMaybeTable )
37import Rel8.Schema.HTable.Maybe ( HMaybeTable )
@@ -44,7 +43,7 @@ import qualified Rel8.Schema.Kind as K
44import Rel8.Schema.Name ( Name(..), Col(..) )
43import Rel8.Schema.Name ( Name(..), Col(..) )
45import Rel8.Schema.Null ( Sql )
44import Rel8.Schema.Null ( Sql )
46import Rel8.Schema.Reify ( Reify, Col(..), hreify, hunreify )
45import Rel8.Schema.Reify ( Reify, Col(..), hreify, hunreify )
47−import Rel8.Schema.Result ( Result )
46+import Rel8.Schema.Result ( Col( Result ), Result )
48import Rel8.Schema.Spec ( Spec( Spec ) )
47import Rel8.Schema.Spec ( Spec( Spec ) )
49import Rel8.Table
48import Rel8.Table
50 ( Table, Columns, Congruent, Context, fromColumns, toColumns
49 ( Table, Columns, Congruent, Context, fromColumns, toColumns
src/Rel8/Schema/Result.hs+12−2
@@ -1,16 +1,26 @@
1{-# language DataKinds #-}
1{-# language DataKinds #-}
2+{-# language GADTs #-}
2{-# language StandaloneKindSignatures #-}
3{-# language StandaloneKindSignatures #-}
4+{-# language TypeFamilies #-}
3
5
4module Rel8.Schema.Result
6module Rel8.Schema.Result
5− ( Result
7+ ( Col( Result ), Result
8+ )
6− ) where
9+where
7
10
8-- base
11-- base
9import Prelude ()
12import Prelude ()
10
13
11-- rel8
14-- rel8
15+import Rel8.Schema.Context ( Interpretation( Col ) )
12import Rel8.Schema.Kind ( Context )
16import Rel8.Schema.Kind ( Context )
17+import Rel8.Schema.Spec ( Spec( Spec ) )
13
18
14
19
15type Result :: Context
20type Result :: Context
16data Result a
21data Result a
22+
23+
24+instance Interpretation Result where
25+ data Col Result _spec where
26+ Result :: a -> Col Result ('Spec labels necessity a)
src/Rel8/Table.hs+1−2
@@ -41,7 +41,6 @@ import Rel8.Generic.Table
41 )
41 )
42import Rel8.Generic.Record ( Record(..) )
42import Rel8.Generic.Record ( Record(..) )
43import Rel8.Generic.Reify ( ARep )
43import Rel8.Generic.Reify ( ARep )
44−import Rel8.Schema.Context ( Col(..) )
45import Rel8.Schema.Context.Label ( Labelable, labeler, unlabeler )
44import Rel8.Schema.Context.Label ( Labelable, labeler, unlabeler )
46import Rel8.Schema.Context.Result
45import Rel8.Schema.Context.Result
47 ( relabel
46 ( relabel
@@ -66,7 +65,7 @@ import Rel8.Schema.Reify
66 , UnwrapReify
65 , UnwrapReify
67 , notReify
66 , notReify
68 )
67 )
69−import Rel8.Schema.Result ( Result )
68+import Rel8.Schema.Result ( Col( Result ), Result )
70import Rel8.Schema.Spec ( KnownSpec )
69import Rel8.Schema.Spec ( KnownSpec )
71import Rel8.Type ( DBType )
70import Rel8.Type ( DBType )
72import Rel8.Type.Tag ( EitherTag( IsLeft, IsRight ), MaybeTag( IsJust ) )
71import Rel8.Type.Tag ( EitherTag( IsLeft, IsRight ), MaybeTag( IsJust ) )
src/Rel8/Table/Serialize.hs+1−2
@@ -41,11 +41,10 @@ import Rel8.Generic.Table
41 , GAlgebra
41 , GAlgebra
42 )
42 )
43import Rel8.Kind.Algebra ( KnownAlgebra )
43import Rel8.Kind.Algebra ( KnownAlgebra )
44−import Rel8.Schema.Context ( Col(..) )
45import Rel8.Schema.HTable ( HTable, htabulate, htabulateA, hfield, hspecs )
44import Rel8.Schema.HTable ( HTable, htabulate, htabulateA, hfield, hspecs )
46import Rel8.Schema.HTable.Type ( HType(..) )
45import Rel8.Schema.HTable.Type ( HType(..) )
47import Rel8.Schema.Null ( NotNull, Sql )
46import Rel8.Schema.Null ( NotNull, Sql )
48−import Rel8.Schema.Result ( Result )
47+import Rel8.Schema.Result ( Col( Result ), Result )
49import Rel8.Schema.Spec ( SSpec(..), KnownSpec )
48import Rel8.Schema.Spec ( SSpec(..), KnownSpec )
50import Rel8.Table ( Table, Columns, fromColumns, toColumns, TColumns )
49import Rel8.Table ( Table, Columns, fromColumns, toColumns, TColumns )
51import Rel8.Table.Either ( EitherTable )
50import Rel8.Table.Either ( EitherTable )