Sha256: 53becf58cd9a8ebb04df792b9b5bcf649a678bde777d0437aa21a916b406dcef

Contents?: true

Size: 225 Bytes

Versions: 312

Compression:

Stored size: 225 Bytes

Contents

module Strain (keep, discard) where

keep, discard :: (a -> Bool) -> [a] -> [a]

keep p = keep' []
  where keep' acc [] = reverse acc
        keep' acc (x:xs) = keep' (if p x then x:acc else acc) xs

discard = keep . (not .)

Version data entries

312 entries across 312 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.138 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.137 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.136 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.135 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.134 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.133 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.132 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.131 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.130 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.129 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.128 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.127 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.126 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.125 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.124 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.123 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.122 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.121 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.120 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs