on master help sign in
No need to store original patterns
commit2541a16e5104b2e336350ae9274ace69f8122baa authorEdwin Brady <ecb10@st-andrews.ac.uk> dateMon 29 Oct 2012, 10:12 (14 years ago) parent9d53533
2 files changed+8−4
idris.cabal+3−1 src/Core/Evaluate.hs+5−3
idris.cabal+3−1
@@ -1,5 +1,5 @@
11Name: idris
2−Version: 0.9.4.2
2+Version: 0.9.5
33License: BSD3
44License-file: LICENSE
55Author: Edwin Brady
@@ -27,6 +27,8 @@ Description: Idris is a general purpose language with full dependent types.
2727 * do notation, idiom brackets, syntactic conveniences for lists,
2828 tuples, dependent pairs
2929 .
30+ * Totality checking
31+ .
3032 * Coinductive types
3133 .
3234 * Indentation significant syntax, extensible syntax
src/Core/Evaluate.hs+5−3
@@ -715,13 +715,15 @@ simplifyCasedef :: Name -> Context -> Context
715715simplifyCasedef n uctxt
716716 = let ctxt = definitions uctxt
717717 ctxt' = case lookupCtxt Nothing n ctxt of
718+ [(CaseOp inl ty [] ps args sc args' sc', acc, tot)] ->
719+ ctxt -- nothing to simplify (or already done...)
718720 [(CaseOp inl ty ps_in ps args sc args' sc', acc, tot)] ->
719721 let pdef = map debind $ map simpl ps_in in
720722 case simpleCase False True CompileTime (FC "" 0) pdef of
721723 OK (CaseDef args sc _) ->
722−-- trace ("Simplify " ++ show n ++ "\n" ++
723−-- show sc) $
724− addDef n (CaseOp inl ty ps_in ps args sc args' sc',
724+-- Erase the original patterns, since we won't use them again and it
725+-- only clutters the .ibc
726+ addDef n (CaseOp inl ty [] ps args sc args' sc',
725727 acc, tot) ctxt
726728 _ -> ctxt in
727729 uctxt { definitions = ctxt' }