on master help sign in
Fix warnings
2ff1c5fShane O'Brien
src/Rel8/Schema/Context/Nullify.hs−1
@@ -18,7 +18,6 @@ module Rel8.Schema.Context.Nullify
18where
18where
19
19
20-- base
20-- base
21−import Control.Monad ( guard )
22import Data.Kind ( Constraint, Type )
21import Data.Kind ( Constraint, Type )
23import GHC.TypeLits ( KnownSymbol )
22import GHC.TypeLits ( KnownSymbol )
24import Prelude hiding ( null )
23import Prelude hiding ( null )
src/Rel8/Schema/HTable/Type.hs+6
@@ -53,3 +53,9 @@ instance Sql DBType a => HTable (HType a) where
53 , info = typeInformation
53 , info = typeInformation
54 , nullability = nullabilization
54 , nullability = nullabilization
55 }
55 }
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
121
121
122fromSql :: Dict (Sql constraint) a -> (Nullability a, Dict constraint (Unnullify a))
122fromSql :: Dict (Sql constraint) a -> (Nullability a, Dict constraint (Unnullify a))
123fromSql Dict = (nullabilization, Dict)
123fromSql Dict = (nullabilization, Dict)
124+{-# INLINABLE fromSql #-}
124
125
125
126
126mapSql :: ()
127mapSql :: ()
@@ -133,3 +134,4 @@ mapSql f dict = case fromSql dict of
133toSql :: Nullability a -> Dict constraint (Unnullify a) -> Dict (Sql constraint) a
134toSql :: Nullability a -> Dict constraint (Unnullify a) -> Dict (Sql constraint) a
134toSql NonNullable Dict = Dict
135toSql NonNullable Dict = Dict
135toSql Nullable Dict = Dict
136toSql Nullable Dict = Dict
137+{-# INLINABLE toSql #-}
src/Rel8/Table/Bool.hs+1
@@ -24,6 +24,7 @@ bool (toColumns -> false) (toColumns -> true) condition =
24 case (hfield false field, hfield true field) of
24 case (hfield false field, hfield true field) of
25 (DB falseExpr, DB trueExpr) ->
25 (DB falseExpr, DB trueExpr) ->
26 DB (boolExpr falseExpr trueExpr condition)
26 DB (boolExpr falseExpr trueExpr condition)
27+{-# INLINABLE bool #-}
27
28
28
29
29case_ :: Table Expr a => [(Expr Bool, a)] -> a -> a
30case_ :: Table Expr a => [(Expr Bool, a)] -> a -> a
src/Rel8/Table/Maybe.hs+1
@@ -195,6 +195,7 @@ isJustTable (MaybeTable tag _) = isNonNull (expr tag)
195-- | Perform case analysis on a 'MaybeTable'. Like 'maybe'.
195-- | Perform case analysis on a 'MaybeTable'. Like 'maybe'.
196maybeTable :: Table Expr b => b -> (a -> b) -> MaybeTable a -> b
196maybeTable :: Table Expr b => b -> (a -> b) -> MaybeTable a -> b
197maybeTable b f ma@(MaybeTable _ a) = bool (f a) b (isNothingTable ma)
197maybeTable b f ma@(MaybeTable _ a) = bool (f a) b (isNothingTable ma)
198+{-# INLINABLE maybeTable #-}
198
199
199
200
200-- | The null table. Like 'Nothing'.
201-- | The null table. Like 'Nothing'.
src/Rel8/Table/Tag.hs+3−1
@@ -62,6 +62,7 @@ instance Sql DBMonoid a => Taggable a where
62 | x == y -> name b
62 | x == y -> name b
63 | otherwise -> name a
63 | otherwise -> name a
64 }
64 }
65+ {-# INLINABLE tappend #-}
65
66
66 tempty :: forall label. KnownSymbol label => Tag label a
67 tempty :: forall label. KnownSymbol label => Tag label a
67 tempty = Tag
68 tempty = Tag
@@ -69,6 +70,7 @@ instance Sql DBMonoid a => Taggable a where
69 , aggregator = empty
70 , aggregator = empty
70 , name = Name (symbolVal (Proxy @label))
71 , name = Name (symbolVal (Proxy @label))
71 }
72 }
73+ {-# INLINABLE tempty #-}
72
74
73
75
74instance (KnownSymbol label, Taggable a) => Semigroup (Tag label a) where
76instance (KnownSymbol label, Taggable a) => Semigroup (Tag label a) where
@@ -95,7 +97,7 @@ fromExpr expr = (tempty @a @label) {expr}
95
97
96
98
97fromName :: forall a label. Taggable a => Name a -> Tag label a
99fromName :: forall a label. Taggable a => Name a -> Tag label a
98−fromName name = (mempty @(Tag "" a)) {name}
100+fromName name = (tempty @a @"") {name}
99
101
100
102
101dbSemigroupFromDBMonoid :: Dict DBMonoid a -> Dict DBSemigroup a
103dbSemigroupFromDBMonoid :: Dict DBMonoid a -> Dict DBSemigroup a