Skip to content

Commit

Permalink
Fix dot documentation
Browse files Browse the repository at this point in the history
I goofed up and made the ``strat1 `dot` strat1 = strat1`` law too
strong. Fix that. Also, add laws for ``rpar `dot` rseq`` and
``rseq `dot` rpar``.
  • Loading branch information
treeowl committed Jun 4, 2018
1 parent 358b2d6 commit 5eba78e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Control/Parallel/Strategies.hs
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,18 @@ withStrategy = flip using
-- | Compose two strategies sequentially.
-- This is the analogue to function composition on strategies.
--
-- For any strategies @strat1@, @strat2@, and @strat3@,
--
-- > (strat1 `dot` strat2) `dot` strat3 == strat1 `dot` (strat2 `dot` strat3)
-- > strat1 `dot` strat1 = strat1
-- > strat1 `dot` r0 == strat1
-- > strat `dot` r0 == strat
-- > rpar `dot` rseq == rpar
-- > rseq `dot` rpar == rseq
--
-- > strat2 `dot` strat1 == strat2 . withStrategy strat1
--
-- Furthermore, if @strat@ only forces and sparks computations (that is, it
-- doesn't actually change any values), then
--
-- > strat `dot` strat == strat
--
dot :: Strategy a -> Strategy a -> Strategy a
strat2 `dot` strat1 = strat2 . runEval . strat1

Expand Down

0 comments on commit 5eba78e

Please sign in to comment.