 
            
            
            
            
                29 Dec
                
                    2014
                
            
            
                29 Dec
                
                '14
                
            
            
            
        
    
                5:52 a.m.
            
        +1 On 28.12.2014 06:22, David Feuer wrote:
This can be given exactly the same implementation as the one for lists:
filterM :: (Applicative f) => (a -> f Bool) -> Seq a -> f (Seq a) filterM p = foldr go (pure empty) where go x r = f <$> p x <*> r where f flg ys = if flg then x <| ys else ys
Bikeshed all you like over the name.
-- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel@gu.se http://www2.tcs.ifi.lmu.de/~abel/