on master help sign in
Make Prelude.Applicative.when implementation cleaner.
e70027fbmsherman
libs/prelude/Prelude/Applicative.idr+2−1
@@ -44,4 +44,5 @@ guard a = if a then pure () else empty
44
44
45||| Conditionally execute an applicative expression
45||| Conditionally execute an applicative expression
46when : Applicative f => Bool -> Lazy (f ()) -> f ()
46when : Applicative f => Bool -> Lazy (f ()) -> f ()
47−when a f = if a then Force f else pure ()
47+when True f = f
48+when False f = pure ()