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.159 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.158 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.157 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.156 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.155 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.154 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.153 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.152 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.151 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.150 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.149 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.148 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.147 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.146 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.145 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.144 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.143 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.142 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.141 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs
trackler-2.2.1.140 tracks/haskell/exercises/strain/examples/fail-reverse/src/Strain.hs