From: sof Date: Thu, 21 Jan 1999 15:08:51 +0000 (+0000) Subject: [project @ 1999-01-21 15:08:51 by sof] X-Git-Tag: Approx_2487_patches~31 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=40317587d007023ec09db8ecab3e1a11f8670649;p=ghc-hetmet.git [project @ 1999-01-21 15:08:51 by sof] With Haskell98, Enum.enumFromThen can generate sequences that are either increasing, decreasing or infinite. --- 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] [] $