{-# language AllowAmbiguousTypes #-}
{-# language ConstraintKinds #-}
{-# language DataKinds #-}
{-# language DeriveAnyClass #-}
{-# language DeriveGeneric #-}
{-# language DerivingStrategies #-}
{-# language FlexibleContexts #-}
{-# language FlexibleInstances #-}
{-# language GADTs #-}
{-# language LambdaCase #-}
{-# language MultiParamTypeClasses #-}
{-# language NamedFieldPuns #-}
{-# language QuantifiedConstraints #-}
{-# language RankNTypes #-}
{-# language RecordWildCards #-}
{-# language ScopedTypeVariables #-}
{-# language StandaloneKindSignatures #-}
{-# language TypeApplications #-}
{-# language TypeFamilies #-}
{-# language UndecidableInstances #-}

module Rel8.Schema.HTable.Vectorize
  ( HVectorize
  , hvectorize, hunvectorize
  , happend, hempty
  )
where

-- base
import Data.Kind ( Type )
import Data.List.NonEmpty ( NonEmpty )
import Prelude

-- rel8
import Rel8.Schema.Context.Label ( HLabelable, hlabeler, hunlabeler )
import Rel8.Schema.Dict ( Dict( Dict ) )
import qualified Rel8.Schema.Kind as K
import Rel8.Schema.HTable
  ( HTable
  , hfield, htabulate, htabulateA, hspecs
  )
import Rel8.Schema.Null ( Unnullify, NotNull, Nullity( NotNull ) )
import Rel8.Schema.Spec ( Spec( Spec ), SSpec(..) )
import Rel8.Type.Array ( listTypeInformation, nonEmptyTypeInformation )
import Rel8.Type.Information ( TypeInformation )

-- semialign
import Data.Zip ( Unzip, Zip, Zippy(..) )
import Rel8.FCF
import Rel8.Schema.HTable.MapTable
import GHC.Generics (Generic)


class Vector list where
  listNotNull :: proxy a -> Dict NotNull (list a)
  vectorTypeInformation :: ()
    => Nullity a
    -> TypeInformation (Unnullify a)
    -> TypeInformation (list a)


instance Vector [] where
  listNotNull :: proxy a -> Dict NotNull [a]
listNotNull proxy a
_ = Dict NotNull [a]
forall a (c :: a -> Constraint) (a :: a). c a => Dict c a
Dict
  vectorTypeInformation :: Nullity a -> TypeInformation (Unnullify a) -> TypeInformation [a]
vectorTypeInformation = Nullity a -> TypeInformation (Unnullify a) -> TypeInformation [a]
forall a.
Nullity a -> TypeInformation (Unnullify a) -> TypeInformation [a]
listTypeInformation


instance Vector NonEmpty where
  listNotNull :: proxy a -> Dict NotNull (NonEmpty a)
listNotNull proxy a
_ = Dict NotNull (NonEmpty a)
forall a (c :: a -> Constraint) (a :: a). c a => Dict c a
Dict
  vectorTypeInformation :: Nullity a
-> TypeInformation (Unnullify a) -> TypeInformation (NonEmpty a)
vectorTypeInformation = Nullity a
-> TypeInformation (Unnullify a) -> TypeInformation (NonEmpty a)
forall a.
Nullity a
-> TypeInformation (Unnullify a) -> TypeInformation (NonEmpty a)
nonEmptyTypeInformation


type HVectorize :: (Type -> Type) -> K.HTable -> K.HTable
newtype HVectorize list table context = HVectorize (HMapTable (Vectorize list) table context)
  deriving stock (forall x.
 HVectorize list table context
 -> Rep (HVectorize list table context) x)
-> (forall x.
    Rep (HVectorize list table context) x
    -> HVectorize list table context)
-> Generic (HVectorize list table context)
forall x.
Rep (HVectorize list table context) x
-> HVectorize list table context
forall x.
HVectorize list table context
-> Rep (HVectorize list table context) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (list :: * -> *) (table :: HTable) (context :: HContext) x.
Rep (HVectorize list table context) x
-> HVectorize list table context
forall (list :: * -> *) (table :: HTable) (context :: HContext) x.
HVectorize list table context
-> Rep (HVectorize list table context) x
$cto :: forall (list :: * -> *) (table :: HTable) (context :: HContext) x.
Rep (HVectorize list table context) x
-> HVectorize list table context
$cfrom :: forall (list :: * -> *) (table :: HTable) (context :: HContext) x.
HVectorize list table context
-> Rep (HVectorize list table context) x
Generic
  deriving anyclass HVectorize list table SSpec
(forall (context :: HContext) (spec :: Spec).
 HVectorize list table context
 -> HField (HVectorize list table) spec -> context spec)
-> (forall (context :: HContext).
    (forall (spec :: Spec).
     HField (HVectorize list table) spec -> context spec)
    -> HVectorize list table context)
-> (forall (m :: * -> *) (f :: HContext) (g :: HContext).
    Apply m =>
    (forall (spec :: Spec). f spec -> m (g spec))
    -> HVectorize list table f -> m (HVectorize list table g))
-> (forall (c :: Spec -> Constraint).
    HConstrainTable (HVectorize list table) c =>
    HVectorize list table (Dict c))
-> HVectorize list table SSpec
-> HTable (HVectorize list table)
forall (m :: * -> *) (f :: HContext) (g :: HContext).
Apply m =>
(forall (spec :: Spec). f spec -> m (g spec))
-> HVectorize list table f -> m (HVectorize list table g)
forall (list :: * -> *) (table :: HTable).
(HTable table, Vector list) =>
HVectorize list table SSpec
forall (list :: * -> *) (table :: HTable) (m :: * -> *)
       (f :: HContext) (g :: HContext).
(HTable table, Vector list, Apply m) =>
(forall (spec :: Spec). f spec -> m (g spec))
-> HVectorize list table f -> m (HVectorize list table g)
forall (list :: * -> *) (table :: HTable)
       (c :: Spec -> Constraint).
(HTable table, Vector list,
 HConstrainTable (HVectorize list table) c) =>
HVectorize list table (Dict c)
forall (list :: * -> *) (table :: HTable) (context :: HContext).
(HTable table, Vector list) =>
(forall (spec :: Spec).
 HField (HVectorize list table) spec -> context spec)
-> HVectorize list table context
forall (list :: * -> *) (table :: HTable) (context :: HContext)
       (spec :: Spec).
(HTable table, Vector list) =>
HVectorize list table context
-> HField (HVectorize list table) spec -> context spec
forall (c :: Spec -> Constraint).
HConstrainTable (HVectorize list table) c =>
HVectorize list table (Dict c)
forall (context :: HContext).
(forall (spec :: Spec).
 HField (HVectorize list table) spec -> context spec)
-> HVectorize list table context
forall (context :: HContext) (spec :: Spec).
HVectorize list table context
-> HField (HVectorize list table) spec -> context spec
forall (t :: HTable).
(forall (context :: HContext) (spec :: Spec).
 t context -> HField t spec -> context spec)
-> (forall (context :: HContext).
    (forall (spec :: Spec). HField t spec -> context spec)
    -> t context)
-> (forall (m :: * -> *) (f :: HContext) (g :: HContext).
    Apply m =>
    (forall (spec :: Spec). f spec -> m (g spec)) -> t f -> m (t g))
-> (forall (c :: Spec -> Constraint).
    HConstrainTable t c =>
    t (Dict c))
-> t SSpec
-> HTable t
hspecs :: HVectorize list table SSpec
$chspecs :: forall (list :: * -> *) (table :: HTable).
(HTable table, Vector list) =>
HVectorize list table SSpec
hdicts :: HVectorize list table (Dict c)
$chdicts :: forall (list :: * -> *) (table :: HTable)
       (c :: Spec -> Constraint).
(HTable table, Vector list,
 HConstrainTable (HVectorize list table) c) =>
HVectorize list table (Dict c)
htraverse :: (forall (spec :: Spec). f spec -> m (g spec))
-> HVectorize list table f -> m (HVectorize list table g)
$chtraverse :: forall (list :: * -> *) (table :: HTable) (m :: * -> *)
       (f :: HContext) (g :: HContext).
(HTable table, Vector list, Apply m) =>
(forall (spec :: Spec). f spec -> m (g spec))
-> HVectorize list table f -> m (HVectorize list table g)
htabulate :: (forall (spec :: Spec).
 HField (HVectorize list table) spec -> context spec)
-> HVectorize list table context
$chtabulate :: forall (list :: * -> *) (table :: HTable) (context :: HContext).
(HTable table, Vector list) =>
(forall (spec :: Spec).
 HField (HVectorize list table) spec -> context spec)
-> HVectorize list table context
hfield :: HVectorize list table context
-> HField (HVectorize list table) spec -> context spec
$chfield :: forall (list :: * -> *) (table :: HTable) (context :: HContext)
       (spec :: Spec).
(HTable table, Vector list) =>
HVectorize list table context
-> HField (HVectorize list table) spec -> context spec
HTable


data Vectorize :: (Type -> Type) -> Spec -> Exp Spec


type instance Eval (Vectorize list ('Spec labels a)) = 'Spec labels (list a)


instance Vector list => MapSpec (Vectorize list) where
  mapInfo :: SSpec x -> SSpec (Eval (Vectorize list x))
mapInfo = \case
    SSpec {SLabels labels
Nullity a
TypeInformation (Unnullify a)
nullity :: forall (labels :: Labels) a. SSpec ('Spec labels a) -> Nullity a
info :: forall (labels :: Labels) a.
SSpec ('Spec labels a) -> TypeInformation (Unnullify a)
labels :: forall (labels :: Labels) a.
SSpec ('Spec labels a) -> SLabels labels
nullity :: Nullity a
info :: TypeInformation (Unnullify a)
labels :: SLabels labels
..} -> case Nullity a -> Dict NotNull (list a)
forall (list :: * -> *) (proxy :: * -> *) a.
Vector list =>
proxy a -> Dict NotNull (list a)
listNotNull @list Nullity a
nullity of
      Dict NotNull (list a)
Dict -> SSpec :: forall (labels :: Labels) a.
SLabels labels
-> TypeInformation (Unnullify a)
-> Nullity a
-> SSpec ('Spec labels a)
SSpec
        { nullity :: Nullity (list a)
nullity = Nullity (list a)
forall a. NotNull a => Nullity a
NotNull
        , info :: TypeInformation (Unnullify (list a))
info = Nullity a
-> TypeInformation (Unnullify a) -> TypeInformation (list a)
forall (list :: * -> *) a.
Vector list =>
Nullity a
-> TypeInformation (Unnullify a) -> TypeInformation (list a)
vectorTypeInformation Nullity a
nullity TypeInformation (Unnullify a)
info
        , SLabels labels
labels :: SLabels labels
labels :: SLabels labels
..
        }


hvectorize :: (HTable t, Unzip f, Vector list)
  => (forall labels a. ()
    => SSpec ('Spec labels a)
    -> f (context ('Spec labels a))
    -> context' ('Spec labels (list a)))
  -> f (t context)
  -> HVectorize list t context'
hvectorize :: (forall (labels :: Labels) a.
 SSpec ('Spec labels a)
 -> f (context ('Spec labels a))
 -> context' ('Spec labels (list a)))
-> f (t context) -> HVectorize list t context'
hvectorize forall (labels :: Labels) a.
SSpec ('Spec labels a)
-> f (context ('Spec labels a)) -> context' ('Spec labels (list a))
vectorizer f (t context)
as = HMapTable (Vectorize list) t context' -> HVectorize list t context'
forall (list :: * -> *) (table :: HTable) (context :: HContext).
HMapTable (Vectorize list) table context
-> HVectorize list table context
HVectorize (HMapTable (Vectorize list) t context'
 -> HVectorize list t context')
-> HMapTable (Vectorize list) t context'
-> HVectorize list t context'
forall a b. (a -> b) -> a -> b
$ (forall (spec :: Spec).
 HField (HMapTable (Vectorize list) t) spec -> context' spec)
-> HMapTable (Vectorize list) t context'
forall (t :: HTable) (context :: HContext).
HTable t =>
(forall (spec :: Spec). HField t spec -> context spec) -> t context
htabulate ((forall (spec :: Spec).
  HField (HMapTable (Vectorize list) t) spec -> context' spec)
 -> HMapTable (Vectorize list) t context')
-> (forall (spec :: Spec).
    HField (HMapTable (Vectorize list) t) spec -> context' spec)
-> HMapTable (Vectorize list) t context'
forall a b. (a -> b) -> a -> b
$ \(HMapTableField field) ->
  case t SSpec -> HField t a -> SSpec a
forall (t :: HTable) (context :: HContext) (spec :: Spec).
HTable t =>
t context -> HField t spec -> context spec
hfield t SSpec
forall (t :: HTable). HTable t => t SSpec
hspecs HField t a
field of
    spec :: SSpec a
spec@SSpec {} -> SSpec ('Spec labels a)
-> f (context ('Spec labels a)) -> context' ('Spec labels (list a))
forall (labels :: Labels) a.
SSpec ('Spec labels a)
-> f (context ('Spec labels a)) -> context' ('Spec labels (list a))
vectorizer SSpec a
SSpec ('Spec labels a)
spec ((t context -> context ('Spec labels a))
-> f (t context) -> f (context ('Spec labels a))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (t context -> HField t ('Spec labels a) -> context ('Spec labels a)
forall (t :: HTable) (context :: HContext) (spec :: Spec).
HTable t =>
t context -> HField t spec -> context spec
`hfield` HField t a
HField t ('Spec labels a)
field) f (t context)
as)
{-# INLINABLE hvectorize #-}


hunvectorize :: (HTable t, Zip f, Vector list)
  => (forall labels a. ()
    => SSpec ('Spec labels a)
    -> context ('Spec labels (list a))
    -> f (context' ('Spec labels a)))
  -> HVectorize list t context
  -> f (t context')
hunvectorize :: (forall (labels :: Labels) a.
 SSpec ('Spec labels a)
 -> context ('Spec labels (list a))
 -> f (context' ('Spec labels a)))
-> HVectorize list t context -> f (t context')
hunvectorize forall (labels :: Labels) a.
SSpec ('Spec labels a)
-> context ('Spec labels (list a)) -> f (context' ('Spec labels a))
unvectorizer (HVectorize HMapTable (Vectorize list) t context
table) =
  Zippy f (t context') -> f (t context')
forall (f :: * -> *) a. Zippy f a -> f a
getZippy (Zippy f (t context') -> f (t context'))
-> Zippy f (t context') -> f (t context')
forall a b. (a -> b) -> a -> b
$ (forall (spec :: Spec). HField t spec -> Zippy f (context' spec))
-> Zippy f (t context')
forall (t :: HTable) (m :: * -> *) (context :: HContext).
(HTable t, Apply m) =>
(forall (spec :: Spec). HField t spec -> m (context spec))
-> m (t context)
htabulateA ((forall (spec :: Spec). HField t spec -> Zippy f (context' spec))
 -> Zippy f (t context'))
-> (forall (spec :: Spec).
    HField t spec -> Zippy f (context' spec))
-> Zippy f (t context')
forall a b. (a -> b) -> a -> b
$ \HField t spec
field -> case t SSpec -> HField t spec -> SSpec spec
forall (t :: HTable) (context :: HContext) (spec :: Spec).
HTable t =>
t context -> HField t spec -> context spec
hfield t SSpec
forall (t :: HTable). HTable t => t SSpec
hspecs HField t spec
field of
    spec :: SSpec spec
spec@SSpec{} -> case HMapTable (Vectorize list) t context
-> HField (HMapTable (Vectorize list) t) ('Spec labels (list a))
-> context ('Spec labels (list a))
forall (t :: HTable) (context :: HContext) (spec :: Spec).
HTable t =>
t context -> HField t spec -> context spec
hfield HMapTable (Vectorize list) t context
table (HField t ('Spec labels a)
-> HMapTableField
     (Vectorize list) t (Eval (Vectorize list ('Spec labels a)))
forall e (t :: HTable) (a :: Spec) (f :: Spec -> Exp e).
HField t a -> HMapTableField f t (Eval (f a))
HMapTableField HField t spec
HField t ('Spec labels a)
field) of
      context ('Spec labels (list a))
a -> f (context' ('Spec labels a))
-> Zippy f (context' ('Spec labels a))
forall (f :: * -> *) a. f a -> Zippy f a
Zippy (SSpec ('Spec labels a)
-> context ('Spec labels (list a)) -> f (context' ('Spec labels a))
forall (labels :: Labels) a.
SSpec ('Spec labels a)
-> context ('Spec labels (list a)) -> f (context' ('Spec labels a))
unvectorizer SSpec spec
SSpec ('Spec labels a)
spec context ('Spec labels (list a))
a)
{-# INLINABLE hunvectorize #-}


happend :: (HTable t, Vector list) =>
  ( forall labels a. ()
    => Nullity a
    -> TypeInformation (Unnullify a)
    -> context ('Spec labels (list a))
    -> context ('Spec labels (list a))
    -> context ('Spec labels (list a))
  )
  -> HVectorize list t context
  -> HVectorize list t context
  -> HVectorize list t context
happend :: (forall (labels :: Labels) a.
 Nullity a
 -> TypeInformation (Unnullify a)
 -> context ('Spec labels (list a))
 -> context ('Spec labels (list a))
 -> context ('Spec labels (list a)))
-> HVectorize list t context
-> HVectorize list t context
-> HVectorize list t context
happend forall (labels :: Labels) a.
Nullity a
-> TypeInformation (Unnullify a)
-> context ('Spec labels (list a))
-> context ('Spec labels (list a))
-> context ('Spec labels (list a))
append (HVectorize HMapTable (Vectorize list) t context
as) (HVectorize HMapTable (Vectorize list) t context
bs) = HMapTable (Vectorize list) t context -> HVectorize list t context
forall (list :: * -> *) (table :: HTable) (context :: HContext).
HMapTable (Vectorize list) table context
-> HVectorize list table context
HVectorize (HMapTable (Vectorize list) t context -> HVectorize list t context)
-> HMapTable (Vectorize list) t context
-> HVectorize list t context
forall a b. (a -> b) -> a -> b
$
  (forall (spec :: Spec).
 HField (HMapTable (Vectorize list) t) spec -> context spec)
-> HMapTable (Vectorize list) t context
forall (t :: HTable) (context :: HContext).
HTable t =>
(forall (spec :: Spec). HField t spec -> context spec) -> t context
htabulate ((forall (spec :: Spec).
  HField (HMapTable (Vectorize list) t) spec -> context spec)
 -> HMapTable (Vectorize list) t context)
-> (forall (spec :: Spec).
    HField (HMapTable (Vectorize list) t) spec -> context spec)
-> HMapTable (Vectorize list) t context
forall a b. (a -> b) -> a -> b
$ \field :: HField (HMapTable (Vectorize list) t) spec
field@(HMapTableField j) -> case (HMapTable (Vectorize list) t context
-> HField (HMapTable (Vectorize list) t) spec -> context spec
forall (t :: HTable) (context :: HContext) (spec :: Spec).
HTable t =>
t context -> HField t spec -> context spec
hfield HMapTable (Vectorize list) t context
as HField (HMapTable (Vectorize list) t) spec
field, HMapTable (Vectorize list) t context
-> HField (HMapTable (Vectorize list) t) spec -> context spec
forall (t :: HTable) (context :: HContext) (spec :: Spec).
HTable t =>
t context -> HField t spec -> context spec
hfield HMapTable (Vectorize list) t context
bs HField (HMapTable (Vectorize list) t) spec
field) of
    (context spec
a, context spec
b) -> case t SSpec -> HField t a -> SSpec a
forall (t :: HTable) (context :: HContext) (spec :: Spec).
HTable t =>
t context -> HField t spec -> context spec
hfield t SSpec
forall (t :: HTable). HTable t => t SSpec
hspecs HField t a
j of
      SSpec {Nullity a
nullity :: Nullity a
nullity :: forall (labels :: Labels) a. SSpec ('Spec labels a) -> Nullity a
nullity, TypeInformation (Unnullify a)
info :: TypeInformation (Unnullify a)
info :: forall (labels :: Labels) a.
SSpec ('Spec labels a) -> TypeInformation (Unnullify a)
info} -> Nullity a
-> TypeInformation (Unnullify a)
-> context ('Spec labels (list a))
-> context ('Spec labels (list a))
-> context ('Spec labels (list a))
forall (labels :: Labels) a.
Nullity a
-> TypeInformation (Unnullify a)
-> context ('Spec labels (list a))
-> context ('Spec labels (list a))
-> context ('Spec labels (list a))
append Nullity a
nullity TypeInformation (Unnullify a)
info context spec
context ('Spec labels (list a))
a context spec
context ('Spec labels (list a))
b


hempty :: HTable t =>
  ( forall labels a. ()
    => Nullity a
    -> TypeInformation (Unnullify a)
    -> context ('Spec labels [a])
  )
  -> HVectorize [] t context
hempty :: (forall (labels :: Labels) a.
 Nullity a
 -> TypeInformation (Unnullify a) -> context ('Spec labels [a]))
-> HVectorize [] t context
hempty forall (labels :: Labels) a.
Nullity a
-> TypeInformation (Unnullify a) -> context ('Spec labels [a])
empty = HMapTable (Vectorize []) t context -> HVectorize [] t context
forall (list :: * -> *) (table :: HTable) (context :: HContext).
HMapTable (Vectorize list) table context
-> HVectorize list table context
HVectorize (HMapTable (Vectorize []) t context -> HVectorize [] t context)
-> HMapTable (Vectorize []) t context -> HVectorize [] t context
forall a b. (a -> b) -> a -> b
$ (forall (spec :: Spec).
 HField (HMapTable (Vectorize []) t) spec -> context spec)
-> HMapTable (Vectorize []) t context
forall (t :: HTable) (context :: HContext).
HTable t =>
(forall (spec :: Spec). HField t spec -> context spec) -> t context
htabulate ((forall (spec :: Spec).
  HField (HMapTable (Vectorize []) t) spec -> context spec)
 -> HMapTable (Vectorize []) t context)
-> (forall (spec :: Spec).
    HField (HMapTable (Vectorize []) t) spec -> context spec)
-> HMapTable (Vectorize []) t context
forall a b. (a -> b) -> a -> b
$ \(HMapTableField field) -> case t SSpec -> HField t a -> SSpec a
forall (t :: HTable) (context :: HContext) (spec :: Spec).
HTable t =>
t context -> HField t spec -> context spec
hfield t SSpec
forall (t :: HTable). HTable t => t SSpec
hspecs HField t a
field of
  SSpec {Nullity a
nullity :: Nullity a
nullity :: forall (labels :: Labels) a. SSpec ('Spec labels a) -> Nullity a
nullity, TypeInformation (Unnullify a)
info :: TypeInformation (Unnullify a)
info :: forall (labels :: Labels) a.
SSpec ('Spec labels a) -> TypeInformation (Unnullify a)
info} -> Nullity a
-> TypeInformation (Unnullify a) -> context ('Spec labels [a])
forall (labels :: Labels) a.
Nullity a
-> TypeInformation (Unnullify a) -> context ('Spec labels [a])
empty Nullity a
nullity TypeInformation (Unnullify a)
info


instance HLabelable g => HLabelable (Precompose (Vectorize list) g) where
  hlabeler :: Precompose (Vectorize list) g ('Spec labels a)
-> Precompose (Vectorize list) g ('Spec (label : labels) a)
hlabeler = g ('Spec (label : labels) (list a))
-> Precompose (Vectorize list) g ('Spec (label : labels) a)
forall a b (f :: a -> Exp b) (g :: Exp b) (x :: a).
g (Eval (f x)) -> Precompose f g x
Precompose (g ('Spec (label : labels) (list a))
 -> Precompose (Vectorize list) g ('Spec (label : labels) a))
-> (Precompose (Vectorize list) g ('Spec labels a)
    -> g ('Spec (label : labels) (list a)))
-> Precompose (Vectorize list) g ('Spec labels a)
-> Precompose (Vectorize list) g ('Spec (label : labels) a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. g ('Spec labels (list a)) -> g ('Spec (label : labels) (list a))
forall (context :: HContext) (labels :: Labels) a
       (label :: Symbol).
HLabelable context =>
context ('Spec labels a) -> context ('Spec (label : labels) a)
hlabeler (g ('Spec labels (list a)) -> g ('Spec (label : labels) (list a)))
-> (Precompose (Vectorize list) g ('Spec labels a)
    -> g ('Spec labels (list a)))
-> Precompose (Vectorize list) g ('Spec labels a)
-> g ('Spec (label : labels) (list a))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Precompose (Vectorize list) g ('Spec labels a)
-> g ('Spec labels (list a))
forall b a (f :: a -> Exp b) (g :: Exp b) (x :: a).
Precompose f g x -> g (Eval (f x))
precomposed
  hunlabeler :: Precompose (Vectorize list) g ('Spec (label : labels) a)
-> Precompose (Vectorize list) g ('Spec labels a)
hunlabeler = g ('Spec labels (list a))
-> Precompose (Vectorize list) g ('Spec labels a)
forall a b (f :: a -> Exp b) (g :: Exp b) (x :: a).
g (Eval (f x)) -> Precompose f g x
Precompose (g ('Spec labels (list a))
 -> Precompose (Vectorize list) g ('Spec labels a))
-> (Precompose (Vectorize list) g ('Spec (label : labels) a)
    -> g ('Spec labels (list a)))
-> Precompose (Vectorize list) g ('Spec (label : labels) a)
-> Precompose (Vectorize list) g ('Spec labels a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. g ('Spec (label : labels) (list a)) -> g ('Spec labels (list a))
forall (context :: HContext) (label :: Symbol) (labels :: Labels)
       a.
HLabelable context =>
context ('Spec (label : labels) a) -> context ('Spec labels a)
hunlabeler (g ('Spec (label : labels) (list a)) -> g ('Spec labels (list a)))
-> (Precompose (Vectorize list) g ('Spec (label : labels) a)
    -> g ('Spec (label : labels) (list a)))
-> Precompose (Vectorize list) g ('Spec (label : labels) a)
-> g ('Spec labels (list a))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Precompose (Vectorize list) g ('Spec (label : labels) a)
-> g ('Spec (label : labels) (list a))
forall b a (f :: a -> Exp b) (g :: Exp b) (x :: a).
Precompose f g x -> g (Eval (f x))
precomposed