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.1.0.41 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.40 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.39 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.38 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.37 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.36 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.34 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.33 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.32 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.31 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.30 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.29 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.28 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.27 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.26 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.25 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.24 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.23 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.22 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.1.0.21 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs