Revert all the stuff that doesn't need to change

This commit is contained in:
Ollie Charles 2021-04-15 17:23:34 +01:00
parent dcc9d4985e
commit 1459c775f7
7 changed files with 11 additions and 31 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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 :: ()

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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