on master help sign in
Merge pull request #4335 from aiya000/feature/move-ignore-func-to-prelude-functor

Move `ignore` to Prelude.Functor

commit6d7fd7be563246c63b469f2b93a945ddc2900300 authorAhmad Salim Al-Sibahi <asal@itu.dk> dateSat 17 Feb 2018, 17:39 (9 years ago) parent14f10fda7a5c29
2 files changed+4−4
libs/prelude/Prelude/Functor.idr+4 libs/pruviloj/Pruviloj/Core.idr−4
libs/prelude/Prelude/Functor.idr+4
@@ -23,5 +23,9 @@ infixr 4 <$>
2323(<$>) : Functor f => (func : a -> b) -> f a -> f b
2424func <$> x = map func x
2525
26+||| Run something for effects, throwing away the return value
27+ignore : Functor f => f a -> f ()
28+ignore x = map (const ()) x
29+
2630Functor (Pair a) where
2731 map f (x, y) = (x, f y)
libs/pruviloj/Pruviloj/Core.idr−4
@@ -7,10 +7,6 @@ import Language.Reflection.Utils
77
88%access public export
99
10−||| Run something for effects, throwing away the return value
11−ignore : Functor f => f a -> f ()
12−ignore x = map (const ()) x
13−
1410||| Do nothing
1511skip : Applicative f => f ()
1612skip = pure ()