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

Commit 0f34dce

Browse files
committed
Sequence values in the abstract domain.
1 parent cd950fd commit 0f34dce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

semantic-core/src/Analysis/Eval.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import Prelude hiding (fail)
3030
eval :: ( Carrier sig m
3131
, Member (Reader Loc) sig
3232
, MonadFail m
33+
, Semigroup value
3334
)
3435
=> Analysis address value m
3536
-> (Term Core User -> m value)
@@ -41,12 +42,12 @@ eval Analysis{..} eval = \case
4142
addr <- alloc n
4243
v <- bind n addr (eval (instantiate1 (pure n) b))
4344
v <$ assign addr v
44-
a :>> b -> eval a >> eval b
45+
a :>> b -> (<>) <$> eval a <*> eval b
4546
Named (Ignored n) a :>>= b -> do
4647
a' <- eval a
4748
addr <- alloc n
4849
assign addr a'
49-
bind n addr (eval (instantiate1 (pure n) b))
50+
bind n addr ((a' <>) <$> eval (instantiate1 (pure n) b))
5051
Lam (Named (Ignored n) b) -> abstract eval n (instantiate1 (pure n) b)
5152
f :$ a -> do
5253
f' <- eval f

0 commit comments

Comments
 (0)