From 40317587d007023ec09db8ecab3e1a11f8670649 Mon Sep 17 00:00:00 2001 From: sof Date: Thu, 21 Jan 1999 15:08:51 +0000 Subject: [PATCH] [project @ 1999-01-21 15:08:51 by sof] With Haskell98, Enum.enumFromThen can generate sequences that are either increasing, decreasing or infinite. --- ghc/compiler/typecheck/TcGenDeriv.lhs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/typecheck/TcGenDeriv.lhs b/ghc/compiler/typecheck/TcGenDeriv.lhs index cc3e205..cab4e7c 100644 --- a/ghc/compiler/typecheck/TcGenDeriv.lhs +++ b/ghc/compiler/typecheck/TcGenDeriv.lhs @@ -505,7 +505,12 @@ gen_Enum_binds tycon HsPar (enum_from_then_to_Expr (mk_easy_App mkInt_RDR [ah_RDR]) (mk_easy_App mkInt_RDR [bh_RDR]) - (HsVar (maxtag_RDR tycon))) + (HsIf (HsApp (HsApp (HsVar gt_RDR) + (HsVar a_RDR)) + (HsVar b_RDR)) + (HsLit (HsInt 0)) + (HsVar (maxtag_RDR tycon)) + tycon_loc)) from_enum = mk_easy_FunMonoBind tycon_loc fromEnum_RDR [a_Pat] [] $ -- 1.7.10.4