Permalink
Browse files

fix documentation (thanks Daniel Diaz!) and prepare for release

  • Loading branch information...
1 parent b5649b5 commit 7f4183bc01232d5f4eeb2dc5f6efc2b1c1391c7e @kallisti-dev committed May 9, 2012
Showing with 9 additions and 9 deletions.
  1. +2 −2 cond.cabal
  2. +7 −7 src/Control/{Cond.hs → Conditional.hs}
View
@@ -1,5 +1,5 @@
Name: cond
-Version: 0.1
+Version: 0.2
Synopsis: Basic conditional and boolean operators with monadic variants.
Category: Control, Logic, Monad
License: BSD3
@@ -25,5 +25,5 @@ source-repository head
library
hs-source-dirs: src
ghc-options: -Wall
- exposed-modules: Control.Cond
+ exposed-modules: Control.Conditional
build-depends: base >= 3 && < 5
@@ -1,5 +1,5 @@
-- |A convenient set of useful conditional operators.
-module Control.Cond
+module Control.Conditional
( -- * Simple conditional operators
if', (??), bool
-- * Lisp-style conditional operators
@@ -153,17 +153,17 @@ condPlusM ((p, v):ls) = ifM p v (condPlusM ls)
otherwiseM :: Monad m => m Bool
otherwiseM = return True
--- |a variant of 'Control.Monad.when' with a monadic predicate.
+-- |A variant of 'Control.Monad.when' with a monadic predicate.
whenM :: Monad m => m Bool -> m () -> m ()
whenM p m = ifM p m (return ())
{-# INLINE whenM #-}
--- |a variant of 'Control.Monad.unless' with a monadic predicate.
+-- |A variant of 'Control.Monad.unless' with a monadic predicate.
unlessM :: Monad m => m Bool -> m () -> m ()
unlessM p m = ifM (notM p) m (return ())
{-# INLINE unlessM #-}
--- |a variant of 'Control.Monad.guard' with a monadic predicate.
+-- |A variant of 'Control.Monad.guard' with a monadic predicate.
guardM :: MonadPlus m => m Bool -> m ()
guardM = (guard =<<)
{-# INLINE guardM #-}
@@ -174,7 +174,7 @@ selectM p t f x = ifM (p x) (t x) (f x)
-- |Conditional monoid operator. If the predicate is 'False', the second
-- argument is replaced with 'mempty'. The fixity of this operator is one
--- level higher than 'Control.Monoid.<>'.
+-- level higher than 'Data.Monoid.<>'.
--
-- It can also be used to chain multiple predicates together, like this:
--
@@ -194,14 +194,14 @@ p ?<> m = if' p m mempty
(?) :: Bool -> (Bool -> a) -> a
p ? f = f p
--- |right bracket of the conditional choice operator. If the predicate
+-- |Right bracket of the conditional choice operator. If the predicate
-- is 'False', returns 'Nothing', otherwise it returns 'Just' the right-hand
-- argument.
(|>) :: Bool -> a -> Maybe a
True |> _ = Nothing
False |> f = Just f
--- |left bracket of the conditional choice operator. This is equivalent to
+-- |Left bracket of the conditional choice operator. This is equivalent to
-- 'Data.Maybe.fromMaybe'
(<|) :: a -> Maybe a -> a
t <| Nothing = t

0 comments on commit 7f4183b

Please sign in to comment.