diff options
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/base/Control/Monad.hs | 5 | ||||
-rw-r--r-- | libraries/base/Data/Functor.hs | 7 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libraries/base/Control/Monad.hs b/libraries/base/Control/Monad.hs index 534e6527d0..0597055da9 100644 --- a/libraries/base/Control/Monad.hs +++ b/libraries/base/Control/Monad.hs @@ -76,6 +76,7 @@ module Control.Monad , (<$!>) ) where +import Data.Functor ( void ) import Data.Maybe import GHC.List @@ -159,10 +160,6 @@ forever a = let a' = a >> a' in a' -- Use explicit sharing here, as it is prevents a space leak regardless of -- optimizations. --- | @'void' value@ discards or ignores the result of evaluation, such as the return value of an 'IO' action. -void :: Functor f => f a -> f () -void = fmap (const ()) - -- ----------------------------------------------------------------------------- -- Other monad functions diff --git a/libraries/base/Data/Functor.hs b/libraries/base/Data/Functor.hs index 00cc254a8b..43ca8218f4 100644 --- a/libraries/base/Data/Functor.hs +++ b/libraries/base/Data/Functor.hs @@ -23,8 +23,7 @@ module Data.Functor void, ) where -import Control.Monad ( void ) -import GHC.Base ( Functor(..), flip ) +import GHC.Base ( Functor(..), const, flip ) infixl 4 <$> @@ -40,3 +39,7 @@ infixl 4 $> ($>) :: Functor f => f a -> b -> f b ($>) = flip (<$) +-- | @'void' value@ discards or ignores the result of evaluation, such as the +-- return value of an 'IO' action. +void :: Functor f => f a -> f () +void = fmap (const ()) |