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

Commit 559a7aa

Browse files
committed
📝 the Semigroup use.
1 parent dbf8941 commit 559a7aa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

semantic-core/src/Analysis/Eval.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ eval Analysis{..} eval = \case
4242
addr <- alloc n
4343
v <- bind n addr (eval (instantiate1 (pure n) b))
4444
v <$ assign addr v
45+
-- NB: Combining the results of the evaluations allows us to model effects in abstract domains. This in turn means that we can define an abstract domain modelling the types-and-effects of computations by means of a 'Semigroup' instance which takes the type of its second operand and the union of both operands’ effects.
46+
--
47+
-- It’s also worth noting that we use a semigroup instead of a semilattice because the lattice structure of our abstract domains is instead modelled by nondeterminism effects used by some of them.
4548
a :>> b -> (<>) <$> eval a <*> eval b
4649
Named (Ignored n) a :>>= b -> do
4750
a' <- eval a

0 commit comments

Comments
 (0)