[GHC] #3446: Library enhancement request: Data.Maybe.justIf

GHC cvs-ghc at haskell.org
Tue May 4 12:40:42 EDT 2010


#3446: Library enhancement request: Data.Maybe.justIf
-----------------------------+----------------------------------------------
  Reporter:  nomeata         |          Owner:                  
      Type:  proposal        |         Status:  new             
  Priority:  normal          |      Milestone:  Not GHC         
 Component:  libraries/base  |        Version:  6.10.4          
Resolution:                  |       Keywords:                  
Difficulty:  Unknown         |             Os:  Unknown/Multiple
  Testcase:                  |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown    |  
-----------------------------+----------------------------------------------

Comment(by uzytkownik):

 Wouldn't it be better to have in Control.Applicative:

 {{{
 guardBy :: Alternative f => a -> Bool -> f a
 guardBy _ False = empty
 guardBy v True  = pure v

 guardBy' :: Alternative f => a -> (a -> Bool) -> f a
 guardBy' v f = guardBy v (f v)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3446#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list