on master help sign in
Fix warnings
commit2ff1c5f0d4641dd65ebf3d248bbc5702a223945c authorShane O'Brien <shane.obrien@circuithub.com> dateTue 30 Mar 2021, 11:52 (6 years ago) parentb135026
6 files changed+13−2
src/Rel8/Schema/Context/Nullify.hs−1 src/Rel8/Schema/HTable/Type.hs+6 src/Rel8/Schema/Nullability/Internal.hs+2 src/Rel8/Table/Bool.hs+1 src/Rel8/Table/Maybe.hs+1 src/Rel8/Table/Tag.hs+3−1
src/Rel8/Schema/Context/Nullify.hs−1
@@ -18,7 +18,6 @@ module Rel8.Schema.Context.Nullify
1818where
1919
2020-- base
21−import Control.Monad ( guard )
2221import Data.Kind ( Constraint, Type )
2322import GHC.TypeLits ( KnownSymbol )
2423import Prelude hiding ( null )
src/Rel8/Schema/HTable/Type.hs+6
@@ -53,3 +53,9 @@ instance Sql DBType a => HTable (HType a) where
5353 , info = typeInformation
5454 , nullability = nullabilization
5555 }
56+
57+ {-# INLINABLE hfield #-}
58+ {-# INLINABLE htabulate #-}
59+ {-# INLINABLE htraverse #-}
60+ {-# INLINABLE hdicts #-}
61+ {-# INLINABLE hspecs #-}
src/Rel8/Schema/Nullability/Internal.hs+2
@@ -121,6 +121,7 @@ instance (constraint (Unnullify a), HasNullability a) => Sql constraint a
121121
122122fromSql :: Dict (Sql constraint) a -> (Nullability a, Dict constraint (Unnullify a))
123123fromSql Dict = (nullabilization, Dict)
124+{-# INLINABLE fromSql #-}
124125
125126
126127mapSql :: ()
@@ -133,3 +134,4 @@ mapSql f dict = case fromSql dict of
133134toSql :: Nullability a -> Dict constraint (Unnullify a) -> Dict (Sql constraint) a
134135toSql NonNullable Dict = Dict
135136toSql Nullable Dict = Dict
137+{-# INLINABLE toSql #-}
src/Rel8/Table/Bool.hs+1
@@ -24,6 +24,7 @@ bool (toColumns -> false) (toColumns -> true) condition =
2424 case (hfield false field, hfield true field) of
2525 (DB falseExpr, DB trueExpr) ->
2626 DB (boolExpr falseExpr trueExpr condition)
27+{-# INLINABLE bool #-}
2728
2829
2930case_ :: Table Expr a => [(Expr Bool, a)] -> a -> a
src/Rel8/Table/Maybe.hs+1
@@ -195,6 +195,7 @@ isJustTable (MaybeTable tag _) = isNonNull (expr tag)
195195-- | Perform case analysis on a 'MaybeTable'. Like 'maybe'.
196196maybeTable :: Table Expr b => b -> (a -> b) -> MaybeTable a -> b
197197maybeTable b f ma@(MaybeTable _ a) = bool (f a) b (isNothingTable ma)
198+{-# INLINABLE maybeTable #-}
198199
199200
200201-- | The null table. Like 'Nothing'.
src/Rel8/Table/Tag.hs+3−1
@@ -62,6 +62,7 @@ instance Sql DBMonoid a => Taggable a where
6262 | x == y -> name b
6363 | otherwise -> name a
6464 }
65+ {-# INLINABLE tappend #-}
6566
6667 tempty :: forall label. KnownSymbol label => Tag label a
6768 tempty = Tag
@@ -69,6 +70,7 @@ instance Sql DBMonoid a => Taggable a where
6970 , aggregator = empty
7071 , name = Name (symbolVal (Proxy @label))
7172 }
73+ {-# INLINABLE tempty #-}
7274
7375
7476instance (KnownSymbol label, Taggable a) => Semigroup (Tag label a) where
@@ -95,7 +97,7 @@ fromExpr expr = (tempty @a @label) {expr}
9597
9698
9799fromName :: forall a label. Taggable a => Name a -> Tag label a
98−fromName name = (mempty @(Tag "" a)) {name}
100+fromName name = (tempty @a @"") {name}
99101
100102
101103dbSemigroupFromDBMonoid :: Dict DBMonoid a -> Dict DBSemigroup a