11{-# OPTIONS_GHC -fno-warn-orphans #-}
22{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3- {-# LANGUAGE CPP #-}
43
54-- | Instances that allow us to use Haskell as a backend syntax. This allows us
65-- to use migrations defined a la 'Database.Beam.Migrate.SQL' to generate a beam
@@ -209,33 +208,21 @@ entityDbFieldName entity = "_" ++ getHsEntityName (hsEntityName entity)
209208
210209derivingDecl :: [Hs. InstRule () ] -> Hs. Deriving ()
211210derivingDecl =
212- #if MIN_VERSION_haskell_src_exts(1,20,0)
213211 Hs. Deriving () Nothing
214- #else
215- Hs. Deriving ()
216- #endif
217212
218213dataDecl :: Hs. DeclHead ()
219214 -> [Hs. QualConDecl () ]
220215 -> Maybe (Hs. Deriving () )
221216 -> Hs. Decl ()
222217dataDecl declHead cons deriving_ =
223- #if MIN_VERSION_haskell_src_exts(1,20,0)
224218 Hs. DataDecl () (Hs. DataType () ) Nothing declHead cons (maybeToList deriving_)
225- #else
226- Hs. DataDecl () (Hs. DataType () ) Nothing declHead cons deriving_
227- #endif
228219
229220insDataDecl :: Hs. Type ()
230221 -> [Hs. QualConDecl () ]
231222 -> Maybe (Hs. Deriving () )
232223 -> Hs. InstDecl ()
233224insDataDecl declHead cons deriving_ =
234- #if MIN_VERSION_haskell_src_exts(1,20,0)
235225 Hs. InsData () (Hs. DataType () ) declHead cons (maybeToList deriving_)
236- #else
237- Hs. InsData () (Hs. DataType () ) declHead cons deriving_
238- #endif
239226
240227databaseTypeDecl :: [ HsEntity ] -> Hs. Decl ()
241228databaseTypeDecl entities =
@@ -950,11 +937,7 @@ hsInstance classNm params decls =
950937
951938hsDerivingInstance :: T. Text -> [ Hs. Type () ] -> Hs. Decl ()
952939hsDerivingInstance classNm params =
953- #if MIN_VERSION_haskell_src_exts(1,20,0)
954940 Hs. DerivDecl () Nothing Nothing (Hs. IRule () Nothing Nothing instHead)
955- #else
956- Hs. DerivDecl () Nothing (Hs. IRule () Nothing Nothing instHead)
957- #endif
958941 where
959942 instHead = foldl (Hs. IHApp () ) (Hs. IHCon () (Hs. UnQual () (Hs. Ident () (T. unpack classNm)))) params
960943
@@ -974,11 +957,7 @@ inst = Hs.IRule () Nothing Nothing . Hs.IHCon () . Hs.UnQual () . Hs.Ident ()
974957beamMigrateSqlBackend :: HsBackendConstraint
975958beamMigrateSqlBackend =
976959 HsBackendConstraint $ \ beTy ->
977- #if MIN_VERSION_haskell_src_exts(1, 22, 0)
978960 Hs. TypeA () (Hs. TyApp () (Hs. TyCon () (Hs. UnQual () (Hs. Ident () " BeamMigrateSqlBackend" ))) beTy)
979- #else
980- Hs. ClassA () (Hs. UnQual () (Hs. Ident () " BeamMigrateSqlBackend" )) [ beTy ]
981- #endif
982961
983962
984963
@@ -991,12 +970,9 @@ instance Hashable (Hs.IPName ())
991970instance Hashable (Hs. Asst () )
992971instance Hashable (Hs. Literal () )
993972instance Hashable (Hs. Name () )
994- instance Hashable (Hs. Type () )
995973instance Hashable (Hs. QOp () )
996974instance Hashable (Hs. TyVarBind () )
997- #if !MIN_VERSION_haskell_src_exts(1, 21, 0)
998975instance Hashable (Hs. Kind () )
999- #endif
1000976instance Hashable (Hs. Context () )
1001977instance Hashable (Hs. SpecialCon () )
1002978instance Hashable (Hs. Pat () )
@@ -1053,11 +1029,5 @@ instance Hashable (Hs.BangType ())
10531029instance Hashable (Hs. ImportSpec () )
10541030instance Hashable (Hs. Namespace () )
10551031instance Hashable (Hs. CName () )
1056- #if MIN_VERSION_haskell_src_exts(1,20,0)
10571032instance Hashable (Hs. DerivStrategy () )
10581033instance Hashable (Hs. MaybePromotedName () )
1059- #endif
1060- #if !MIN_VERSION_hashable(1, 3, 4)
1061- instance Hashable a => Hashable (S. Set a ) where
1062- hashWithSalt s a = hashWithSalt s (S. toList a)
1063- #endif
0 commit comments