From aa1e36bc93c6852929827d78406aad95343f3f7c Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 18 Jul 2019 14:37:19 -0400 Subject: [PATCH] Define stripAnnotations directly. --- semantic-core/src/Data/Core.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/semantic-core/src/Data/Core.hs b/semantic-core/src/Data/Core.hs index 1bb9934af..60697634e 100644 --- a/semantic-core/src/Data/Core.hs +++ b/semantic-core/src/Data/Core.hs @@ -195,9 +195,10 @@ annWith callStack = maybe id (fmap send . Ann) (stackLoc callStack) stripAnnotations :: (Member Core sig, Syntax sig) => Term sig a -> Term sig a -stripAnnotations = iter id alg Var Var - where alg t | Just c <- prj t, Ann _ b <- c = b - | otherwise = Term t +stripAnnotations (Var v) = Var v +stripAnnotations (Term t) + | Just c <- prj t, Ann _ b <- c = b + | otherwise = Term (hmap stripAnnotations t) instance Syntax Core where