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

Stub in a unit effect.

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

View File

@ -186,6 +186,18 @@ runWhile = raiseHandler $ runWhileC . interpret
newtype WhileC value m a = WhileC { runWhileC :: m a }
data Unit value (m :: * -> *) k
= Unit (value -> k)
deriving (Functor)
instance HFunctor (Unit value) where
hmap _ = coerce
{-# INLINE hmap #-}
instance Effect (Unit value) where
handle state handler (Unit k) = Unit (handler . (<$ state) . k)
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