Skip to content

Commit

Permalink
Update docs for guard (#36)
Browse files Browse the repository at this point in the history
* Update docs for guard

* add imports to guard docs

* remove additional description
  • Loading branch information
JamieWohletz authored and paf31 committed Feb 21, 2017
1 parent 7447320 commit 6d17c01
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Control/MonadZero.purs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ instance monadZeroArray :: MonadZero Array
-- | For example:
-- |
-- | ```purescript
-- | import Data.Array
-- | import Prelude
-- | import Control.Monad (bind)
-- | import Control.MonadZero (guard)
-- | import Data.Array ((..))
-- |
-- | factors :: Number -> Array Number
-- | factors :: Int -> Array Int
-- | factors n = do
-- | a <- 1 .. n
-- | b <- 1 .. a
-- | a <- 1..n
-- | b <- a..n
-- | guard $ a * b == n
-- | pure a
-- | pure [a, b]
-- | ```
guard :: forall m. MonadZero m => Boolean -> m Unit
guard true = pure unit
Expand Down

0 comments on commit 6d17c01

Please sign in to comment.