Merge branch 'master' of github.com:isovector/polysemy

This commit is contained in:
Sandy Maguire 2019-09-15 21:40:50 +02:00
commit d759dd7be8
2 changed files with 18 additions and 2 deletions

View File

@ -9,11 +9,15 @@ module Polysemy
, runM
, runFinal
-- * Type synonyms for user convenience
, InterpreterFor
-- * Interoperating With Other Monads
-- ** Embed
, Embed (..)
, embed
, embedToFinal
-- ** Final
-- | For advanced uses of 'Final', including creating your own interpreters
-- that make use of it, see "Polysemy.Final"
@ -132,11 +136,11 @@ module Polysemy
, Inspector (..)
) where
import Polysemy.Final
import Polysemy.Internal
import Polysemy.Internal.Combinators
import Polysemy.Internal.Forklift
import Polysemy.Internal.Kind
import Polysemy.Internal.TH.Effect
import Polysemy.Internal.Tactics
import Polysemy.Final
import Polysemy.Internal.TH.Effect

View File

@ -23,6 +23,7 @@ module Polysemy.Internal
, usingSem
, liftSem
, hoistSem
, InterpreterFor
, (.@)
, (.@@)
) where
@ -434,6 +435,17 @@ runM (Sem m) = m $ \z ->
pure $ f $ a <$ s
{-# INLINE runM #-}
------------------------------------------------------------------------------
-- | Type synonym for interpreters that consume an effect without changing the
-- return value. Offered for user convenience.
--
-- @r@ Is kept polymorphic so it's possible to place constraints upon it:
--
-- @
-- teletypeToIO :: 'Member' (Embed IO) r
-- => 'InterpreterFor' Teletype r
-- @
type InterpreterFor e r = forall a. Sem (e ': r) a -> Sem r a
------------------------------------------------------------------------------
-- | Some interpreters need to be able to lower down to the base monad (often