From 2b2296e43411070f8bfd844ef6780e8469dccd35 Mon Sep 17 00:00:00 2001 From: Rudy Matela Date: Wed, 14 Feb 2024 19:36:07 +0100 Subject: [PATCH] fix redundancy criteria description --- src/Conjure/Defn/Redundancy.hs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Conjure/Defn/Redundancy.hs b/src/Conjure/Defn/Redundancy.hs index f3f0371..94fb5c0 100644 --- a/src/Conjure/Defn/Redundancy.hs +++ b/src/Conjure/Defn/Redundancy.hs @@ -141,7 +141,7 @@ hasRedundantRecursion d = not (null rs) && any matchesRHS bs -- | Returns whether a given 'Defn' is redundant -- with regards to root recursions. -- --- When there is a single base case and all recursive calls +-- When there is a single constant base case and all recursive calls -- are at the root: we have a redundant function. -- (Modulo error functions, which are undesired anyway.) -- @@ -150,11 +150,6 @@ hasRedundantRecursion d = not (null rs) && any matchesRHS bs -- -- Above it does not really pays off to follow the recursive calls, -- at the end we always reach an empty list. --- --- The same goes for the following: --- --- > xs ? [] = xs --- > xs ? (x:ys) = xs ? ys isRedundantByRootRecursions :: Defn -> Bool isRedundantByRootRecursions d = case partition isGround $ map snd d of ([b], rs@(_:_)) -> all isHole rs