on master help sign in
No need to store original patterns
2541a16Edwin Brady
idris.cabal+3−1
@@ -1,5 +1,5 @@
1Name: idris
1Name: idris
2−Version: 0.9.4.2
2+Version: 0.9.5
3License: BSD3
3License: BSD3
4License-file: LICENSE
4License-file: LICENSE
5Author: Edwin Brady
5Author: Edwin Brady
@@ -27,6 +27,8 @@ Description: Idris is a general purpose language with full dependent types.
27 * do notation, idiom brackets, syntactic conveniences for lists,
27 * do notation, idiom brackets, syntactic conveniences for lists,
28 tuples, dependent pairs
28 tuples, dependent pairs
29 .
29 .
30+ * Totality checking
31+ .
30 * Coinductive types
32 * Coinductive types
31 .
33 .
32 * Indentation significant syntax, extensible syntax
34 * Indentation significant syntax, extensible syntax
src/Core/Evaluate.hs+5−3
@@ -715,13 +715,15 @@ simplifyCasedef :: Name -> Context -> Context
715simplifyCasedef n uctxt
715simplifyCasedef n uctxt
716 = let ctxt = definitions uctxt
716 = let ctxt = definitions uctxt
717 ctxt' = case lookupCtxt Nothing n ctxt of
717 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...)
718 [(CaseOp inl ty ps_in ps args sc args' sc', acc, tot)] ->
720 [(CaseOp inl ty ps_in ps args sc args' sc', acc, tot)] ->
719 let pdef = map debind $ map simpl ps_in in
721 let pdef = map debind $ map simpl ps_in in
720 case simpleCase False True CompileTime (FC "" 0) pdef of
722 case simpleCase False True CompileTime (FC "" 0) pdef of
721 OK (CaseDef args sc _) ->
723 OK (CaseDef args sc _) ->
722−-- trace ("Simplify " ++ show n ++ "\n" ++
724+-- Erase the original patterns, since we won't use them again and it
723−-- show sc) $
725+-- only clutters the .ibc
724− addDef n (CaseOp inl ty ps_in ps args sc args' sc',
726+ addDef n (CaseOp inl ty [] ps args sc args' sc',
725 acc, tot) ctxt
727 acc, tot) ctxt
726 _ -> ctxt in
728 _ -> ctxt in
727 uctxt { definitions = ctxt' }
729 uctxt { definitions = ctxt' }