@@ -32,6 +32,7 @@ import Data.List.NonEmpty ( NonEmpty )
32import Prelude
32import Prelude
35+import Rel8.Kind.Necessity ( Necessity( Required ), SNecessity( SRequired ) )
35import Rel8.Schema.Context.Label ( HLabelable, hlabeler, hunlabeler )
36import Rel8.Schema.Context.Label ( HLabelable, hlabeler, hunlabeler )
36import Rel8.Schema.Dict ( Dict( Dict ) )
37import Rel8.Schema.Dict ( Dict( Dict ) )
37import qualified Rel8.Schema.Kind as K
38import qualified Rel8.Schema.Kind as K
@@ -78,14 +79,15 @@ newtype HVectorize list table context = HVectorize (HMapTable (Vectorize list) t
78data Vectorize :: (Type -> Type) -> Spec -> Exp Spec
79data Vectorize :: (Type -> Type) -> Spec -> Exp Spec
81−type instance Eval (Vectorize list ('Spec labels necessity a)) = 'Spec labels necessity (list a)
82+type instance Eval (Vectorize list ('Spec labels _necessity a)) = 'Spec labels 'Required (list a)
84instance Vector list => MapSpec (Vectorize list) where
85instance Vector list => MapSpec (Vectorize list) where
85 mapInfo = \case
86 mapInfo = \case
86 SSpec {..} -> case listNotNull @list nullity of
87 SSpec {..} -> case listNotNull @list nullity of
87 Dict -> SSpec
88 Dict -> SSpec
89+ { necessity = SRequired
88− { nullity = NotNull
90+ , nullity = NotNull
89 , info = vectorTypeInformation nullity info
91 , info = vectorTypeInformation nullity info
@@ -95,7 +97,7 @@ hvectorize :: (HTable t, Unzip f, Vector list)
95 => (forall labels necessity a. ()
97 => (forall labels necessity a. ()
96 => SSpec ('Spec labels necessity a)
98 => SSpec ('Spec labels necessity a)
97 -> f (context ('Spec labels necessity a))
99 -> f (context ('Spec labels necessity a))
98− -> context' ('Spec labels necessity (list a)))
100+ -> context' ('Spec labels 'Required (list a)))
99 -> f (t context)
101 -> f (t context)
100 -> HVectorize list t context'
102 -> HVectorize list t context'
101hvectorize vectorizer as = HVectorize $ htabulate $ \(HMapTableField field) ->
103hvectorize vectorizer as = HVectorize $ htabulate $ \(HMapTableField field) ->
@@ -107,7 +109,7 @@ hvectorize vectorizer as = HVectorize $ htabulate $ \(HMapTableField field) ->
107hunvectorize :: (HTable t, Repeat f, Vector list)
109hunvectorize :: (HTable t, Repeat f, Vector list)
108 => (forall labels necessity a. ()
110 => (forall labels necessity a. ()
109 => SSpec ('Spec labels necessity a)
111 => SSpec ('Spec labels necessity a)
110− -> context ('Spec labels necessity (list a))
112+ -> context ('Spec labels 'Required (list a))
111 -> f (context' ('Spec labels necessity a)))
113 -> f (context' ('Spec labels necessity a)))
112 -> HVectorize list t context
114 -> HVectorize list t context
113 -> f (t context')
115 -> f (t context')