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.0 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.55 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.54 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.53 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.52 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.51 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.50 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.49 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.48 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.47 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.46 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.45 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.44 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.43 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.42 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.41 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.40 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.39 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.38 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.37 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs