git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #455 from pelotom/patch-1

Add `void` function

commit4c7733cbb00d09ef3564429f58adade25ca393ce authorPhil Freeman <paf31@cantab.net> dateSat 28 Jun 2014, 13:56 (12 years ago) parenta43b772ea73930
1 file changed+4−1
prelude/prelude.purs+4−1
prelude/prelude.purs+4−1
@@ -7,7 +7,7 @@ module Prelude
77 , ($), (#)
88 , (:), cons
99 , Show, show
10− , Functor, (<$>)
10+ , Functor, (<$>), void
1111 , Apply, (<*>)
1212 , Applicative, pure, liftA1
1313 , Alternative, empty, (<|>)
@@ -116,6 +116,9 @@ module Prelude
116116 class Functor f where
117117 (<$>) :: forall a b. (a -> b) -> f a -> f b
118118
119+ void :: forall f a. (Functor f) => f a -> f Unit
120+ void fa = const unit <$> fa
121+
119122 infixl 4 <*>
120123
121124 class (Functor f) <= Apply f where