 
            
            
            
            
                4 Jun
                
                    2009
                
            
            
                4 Jun
                
                '09
                
            
            
            
        
    
                3:54 a.m.
            
        Dear Haskellers, I happened to defined a function whenJust whose definition is like this:
whenJust :: (Monad m) => (a -> m ()) -> Maybe a -> m () whenJust = maybe (return ())
while I was writing a fun utility to upload to hackage. I had a strong feeling that someone must have defined this already, so I used Hayoo, and I did find it: XMonad.Core.whenJust :: Monad m => Maybe a -> (a -> m ()) -> m () The argument order is different I believe it is dong the same thing. Shouldn't we add add whenJust to more general library regarding Monad and Maybe, so that we can used it as a standard idiom? I think its much more readable writing "maybe (return ())" or "flip (maybe (return ()))". -- Ahn, Ki Yung
        5993
        
      
          Age (days ago)
        
      
        5993
        
    
          Last active (days ago)
        
        
        
        0 comments
    
    
        
        1 participants
    
    
    
    
    
    
    
    
    participants (1)
- 
                 Ahn, Ki Yung Ahn, Ki Yung