Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit aa1e36b

Browse files
committed
Define stripAnnotations directly.
1 parent 9732017 commit aa1e36b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

semantic-core/src/Data/Core.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,10 @@ annWith callStack = maybe id (fmap send . Ann) (stackLoc callStack)
195195

196196

197197
stripAnnotations :: (Member Core sig, Syntax sig) => Term sig a -> Term sig a
198-
stripAnnotations = iter id alg Var Var
199-
where alg t | Just c <- prj t, Ann _ b <- c = b
200-
| otherwise = Term t
198+
stripAnnotations (Var v) = Var v
199+
stripAnnotations (Term t)
200+
| Just c <- prj t, Ann _ b <- c = b
201+
| otherwise = Term (hmap stripAnnotations t)
201202

202203

203204
instance Syntax Core where

0 commit comments

Comments
 (0)