Skip to content

Commit

Permalink
Clarify the role of :>> in haddock
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Goertzen <daniel.goertzen@gmail.com>
  • Loading branch information
re-xyr and goertzenator committed May 21, 2022
1 parent 5316f4e commit 3f7c36e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Cleff/Internal/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,21 @@ newtype InternalHandler e = InternalHandler { runHandler :: ∀ es. e (Eff es) ~
-- which is a type-level list that holds all effects available.
--
-- The best practice is to always use a polymorphic type variable for the effect stack @es@, and then use the type
-- operators '(:>)' and '(:>>)' in constraints to indicate what effects are available in the stack. For example,
-- operator '(:>)' in constraints to indicate what effects are available in the stack. For example,
--
-- @
-- ('Cleff.Reader.Reader' 'String' ':>' es, 'Cleff.State.State' 'Bool' ':>' es) => 'Eff' es 'Integer'
-- @
--
-- means you can perform operations of the @'Cleff.Reader.Reader' 'String'@ effect and the @'Cleff.State.State' 'Bool'@
-- effect in a computation returning an 'Integer'. The reason why you should always use a polymorphic effect stack as
-- opposed to a concrete list of effects are that
-- effect in a computation returning an 'Integer'. A convenient shorthand, '(:>>)', can also be used to indicate
-- multiple effects being in a stack:
--
-- @
-- '['Cleff.Reader.Reader' 'String', 'Cleff.State.State' 'Bool'] ':>>' es => 'Eff' es 'Integer'
-- @
--
-- The reason why you should always use a polymorphic effect stack as opposed to a concrete list of effects are that:
--
-- * it can contain other effects that are used by computations other than the current one, and
-- * it does not require you to run the effects in any particular order.
Expand Down

0 comments on commit 3f7c36e

Please sign in to comment.