@@ -36,8 +36,6 @@ import Language.Haskell.Exts.SrcLoc
3636import Language.Haskell.Exts.Syntax
3737import Language.Haskell.Generate.Expression
3838
39−import Prelude
40−
4139--------------------------------------------------------------------------------
4240-- Generate expressions
4341
@@ -64,11 +62,9 @@ generateExp = prettyPrint . runExpression . fst . runGenerate
6462caseE :: ExpG x -> [(Pat, ExpG t)] -> ExpG t
6563caseE v alt = do
6664 v' <- v
67−#if MIN_VERSION_haskell_src_exts(1,17,0)
68− alt' <- mapM (\(p,a) -> fmap (\a' -> Alt noLoc p (UnGuardedRhs $ runExpression a') Nothing) a) alt
69−#elif MIN_VERSION_haskell_src_exts(1,16,0)
65+#if MIN_VERSION_haskell_src_exts(1,16,0)
7066 alt' <- mapM (\(p,a) -> fmap (\a' -> Alt noLoc p (UnGuardedRhs $ runExpression a') (BDecls [])) a) alt
71−#else
67+#else
7268 alt' <- mapM (\(p,a) -> fmap (\a' -> Alt noLoc p (UnGuardedAlt $ runExpression a') (BDecls [])) a) alt
7369#endif
7470 return $ Expression $ Case (runExpression v') alt'
@@ -214,7 +210,7 @@ instance GenExp (FunRef t) where
214210
215211-- | Generate a ExportSpec for a given function item.
216212exportFun :: FunRef t -> ExportSpec
217−#if MIN_VERSION_haskell_src_exts(1,16,0) && !MIN_VERSION_haskell_src_exts(1,17,0)
213+#if MIN_VERSION_haskell_src_exts(1,16,0)
218214exportFun (FunRef name) = EVar NoNamespace (UnQual name)
219215#else
220216exportFun (FunRef name) = EVar (UnQual name)
@@ -224,11 +220,7 @@ exportFun (FunRef name) = EVar (UnQual name)
224220addDecl :: Name -> ExpG t -> ModuleM (FunRef t)
225221addDecl name e = ModuleM $ do
226222 let (body, mods) = runGenerate e
227−#if MIN_VERSION_haskell_src_exts(1,17,0)
228− tell (mods, [FunBind [Match noLoc name [] Nothing (UnGuardedRhs $ runExpression body) Nothing]])
229−#else
230223 tell (mods, [FunBind [Match noLoc name [] Nothing (UnGuardedRhs $ runExpression body) $ BDecls []]])
231−#endif
232224 return $ FunRef name
233225
234226-- | Extract the Module from a module generator.