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.0.8.15 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.14 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.13 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.12 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.11 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.10 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.9 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.8 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.7 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.6 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.5 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.4 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.3 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.2 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.8.1 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.7.0 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.6.44 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.6.43 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.6.42 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.0.6.41 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs