mirror of
https://github.com/circuithub/rel8.git
synced 2024-09-11 16:05:41 +03:00
Revert all the stuff that doesn't need to change
This commit is contained in:
parent
dcc9d4985e
commit
1459c775f7
@ -15,7 +15,7 @@ module Rel8.Aggregate
|
||||
( Aggregate(..), foldInputs, mapInputs
|
||||
, Aggregator(..), unsafeMakeAggregate
|
||||
, Aggregates
|
||||
, Col( Aggregation, unAggregation )
|
||||
, Col( Aggregation )
|
||||
)
|
||||
where
|
||||
|
||||
@ -60,7 +60,7 @@ newtype Aggregate a = Aggregate (Opaleye.Aggregator () a)
|
||||
instance Interpretation Aggregate where
|
||||
data Col Aggregate _spec where
|
||||
Aggregation :: ()
|
||||
=> { unAggregation :: Aggregate (Expr a) }
|
||||
=> Aggregate (Expr a)
|
||||
-> Col Aggregate ('Spec labels necessity a)
|
||||
|
||||
|
||||
|
@ -4,12 +4,11 @@
|
||||
{-# language TypeFamilies #-}
|
||||
|
||||
module Rel8.Schema.Context
|
||||
( Interpretation(..), Col( Result, K, unK, unResult )
|
||||
( Interpretation(..), Col( Result )
|
||||
)
|
||||
where
|
||||
|
||||
-- base
|
||||
import Control.Applicative ( Const )
|
||||
import Data.Functor.Identity ( Identity )
|
||||
import Data.Kind ( Constraint )
|
||||
import Prelude ()
|
||||
@ -26,9 +25,4 @@ class Interpretation context where
|
||||
|
||||
instance Interpretation Identity where
|
||||
data Col Identity _spec where
|
||||
Result :: { unResult :: a } -> Col Identity ('Spec labels necessity a)
|
||||
|
||||
|
||||
instance Interpretation (Const x) where
|
||||
data Col (Const x) _spec where
|
||||
K :: { unK :: x } -> Col (Const x) _spec
|
||||
Result :: a -> Col Identity ('Spec labels necessity a)
|
||||
|
@ -11,7 +11,6 @@ module Rel8.Schema.Context.Label
|
||||
where
|
||||
|
||||
-- base
|
||||
import Control.Applicative ( Const(..) )
|
||||
import Data.Functor.Identity ( Identity )
|
||||
import Data.Kind ( Constraint )
|
||||
import Prelude hiding ( null )
|
||||
@ -40,11 +39,6 @@ instance Labelable Identity where
|
||||
unlabeler (Result a) = Result a
|
||||
|
||||
|
||||
instance Labelable (Const x) where
|
||||
labeler (K a) = K a
|
||||
unlabeler (K a) = K a
|
||||
|
||||
|
||||
type HLabelable :: HContext -> Constraint
|
||||
class HLabelable context where
|
||||
hlabeler :: ()
|
||||
|
@ -1,15 +1,10 @@
|
||||
{-# language DataKinds #-}
|
||||
{-# language FlexibleContexts #-}
|
||||
{-# language FlexibleInstances #-}
|
||||
{-# language GADTs #-}
|
||||
{-# language LambdaCase #-}
|
||||
{-# language MultiParamTypeClasses #-}
|
||||
{-# language RankNTypes #-}
|
||||
{-# language ScopedTypeVariables #-}
|
||||
{-# language StandaloneKindSignatures #-}
|
||||
{-# language TypeApplications #-}
|
||||
{-# language TypeFamilies #-}
|
||||
{-# language TypeOperators #-}
|
||||
{-# language UndecidableInstances #-}
|
||||
|
||||
module Rel8.Schema.Field
|
||||
@ -20,7 +15,6 @@ module Rel8.Schema.Field
|
||||
, AField(..)
|
||||
, AHEither(..), AHList(..), AHMaybe(..), AHNonEmpty(..), AHThese(..)
|
||||
, SContext(..)
|
||||
, Col( Reify )
|
||||
)
|
||||
where
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
{-# options_ghc -fno-warn-orphans #-}
|
||||
|
||||
module Rel8.Schema.Generic
|
||||
( Rel8able(..)
|
||||
( Rel8able
|
||||
)
|
||||
where
|
||||
|
||||
@ -106,9 +106,6 @@ instance
|
||||
-- @
|
||||
type Rel8able :: KTable -> Constraint
|
||||
class HTable (GRep t) => Rel8able t where
|
||||
type GRep t :: K.HTable
|
||||
type GRep t = GColumns (Rep (t (Reify Name)))
|
||||
|
||||
gfromColumns :: (Labelable context, Reifiable context)
|
||||
=> GRep t (Col (Reify context)) -> t (Reify context)
|
||||
|
||||
@ -130,6 +127,10 @@ class HTable (GRep t) => Rel8able t where
|
||||
gtoColumns = toGColumns @_ @(Rep (t (Reify context))) . from
|
||||
|
||||
|
||||
type GRep :: K.Table -> K.HTable
|
||||
type GRep t = GColumns (Rep (t (Reify Name)))
|
||||
|
||||
|
||||
type GColumns :: (Type -> Type) -> K.HTable
|
||||
type family GColumns rep where
|
||||
GColumns (M1 D _ rep) = GColumns rep
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
module Rel8.Schema.Name
|
||||
( Name(..)
|
||||
, Col( NameCol, unNameCol )
|
||||
, Col( NameCol )
|
||||
, Selects
|
||||
)
|
||||
where
|
||||
@ -69,7 +69,7 @@ instance Sql DBType a => Recontextualize Name Name (Name a) (Name a)
|
||||
|
||||
|
||||
instance Interpretation Name where
|
||||
newtype Col Name _spec = NameCol { unNameCol :: String }
|
||||
newtype Col Name _spec = NameCol String
|
||||
|
||||
|
||||
instance Labelable Name where
|
||||
|
@ -9,7 +9,6 @@
|
||||
{-# language StandaloneKindSignatures #-}
|
||||
{-# language TypeApplications #-}
|
||||
{-# language TypeFamilies #-}
|
||||
{-# language TypeOperators #-}
|
||||
{-# language UndecidableInstances #-}
|
||||
|
||||
module Rel8.Table.Serialize
|
||||
@ -234,8 +233,6 @@ instance (KnownSpec spec, x ~ Col Expr spec) =>
|
||||
toIdentity = toColumns
|
||||
|
||||
|
||||
|
||||
|
||||
type FromExprs :: Type -> Type
|
||||
type family FromExprs a
|
||||
type instance FromExprs (Expr a) = a
|
||||
|
Loading…
Reference in New Issue
Block a user