1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Define stripAnnotations directly.

This commit is contained in:
Rob Rix 2019-07-18 14:37:19 -04:00
parent 97320176dc
commit aa1e36bc93
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -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