1
1
mirror of https://github.com/github/semantic.git synced 2024-12-14 17:31:48 +03:00

Define a generic handler for the Unit effect.

Co-Authored-By: Ayman Nadeem <aymannadeem@gmail.com>
This commit is contained in:
Rob Rix 2018-12-11 15:40:11 -05:00
parent d7550e5b65
commit dd50b1f533

View File

@ -25,6 +25,7 @@ module Control.Abstract.Value
, runWhile
, WhileC(..)
, Unit(..)
, runUnit
, UnitC(..)
) where
@ -201,6 +202,11 @@ instance Effect (Unit value) where
newtype UnitC value m a = UnitC { runUnitC :: m a }
runUnit :: Carrier (Unit value :+: sig) (UnitC value (Eff m))
=> Evaluator term address value (UnitC value (Eff m)) a
-> Evaluator term address value m a
runUnit = raiseHandler $ runUnitC . interpret
class Show value => AbstractIntro value where
-- | Construct an abstract unit value.
-- TODO: This might be the same as the empty tuple for some value types