Skip to content

Commit

Permalink
Use unit
Browse files Browse the repository at this point in the history
  • Loading branch information
garyb committed Jun 13, 2014
1 parent a0abf71 commit 1c28012
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@

replicateM :: forall m a. (Monad m) => Number -> m a -> m [a]

unless :: forall m. (Monad m) => Boolean -> m { } -> m { }
unless :: forall m. (Monad m) => Boolean -> m Unit -> m Unit

when :: forall m. (Monad m) => Boolean -> m { } -> m { }
when :: forall m. (Monad m) => Boolean -> m Unit -> m Unit
8 changes: 4 additions & 4 deletions src/Control/Monad.purs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ foldM :: forall m a b. (Monad m) => (a -> b -> m a) -> a -> [b] -> m a
foldM _ a [] = return a
foldM f a (b:bs) = f a b >>= \a' -> foldM f a' bs

when :: forall m. (Monad m) => Boolean -> m {} -> m {}
when :: forall m. (Monad m) => Boolean -> m Unit -> m Unit
when true m = m
when false _ = return {}
when false _ = return unit

unless :: forall m. (Monad m) => Boolean -> m {} -> m {}
unless :: forall m. (Monad m) => Boolean -> m Unit -> m Unit
unless false m = m
unless true _ = return {}
unless true _ = return unit

0 comments on commit 1c28012

Please sign in to comment.