mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
Add a helper to raise an effect handler into an Effectful computation.
This commit is contained in:
parent
16393af491
commit
fb75b282be
@ -1,6 +1,7 @@
|
||||
{-# LANGUAGE FunctionalDependencies, RankNTypes #-}
|
||||
{-# LANGUAGE FunctionalDependencies, RankNTypes, TypeOperators #-}
|
||||
module Control.Effect
|
||||
( Effectful(..)
|
||||
, raiseHandler
|
||||
, Interpreter(..)
|
||||
, resume
|
||||
) where
|
||||
@ -25,6 +26,9 @@ instance Effectful Eff where
|
||||
raise = id
|
||||
lower = id
|
||||
|
||||
raiseHandler :: Effectful m => (Eff (effect ': effects) a -> Eff effects b) -> m (effect ': effects) a -> m effects b
|
||||
raiseHandler handler = raise . handler . lower
|
||||
|
||||
|
||||
-- | Interpreters determine and interpret a list of effects, optionally taking extra arguments.
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user