not-in-base-0.1.1: Useful utility functions that only depend on base.

NIB.List

Synopsis

Documentation

splitBy :: Eq a => a -> [a] -> [[a]]Source

Splits a list x of a into a list of lists of a at every c.

  "splitBy "foo,bar" "',' == ["foo","bar"] ' 

trim :: (a -> Bool) -> [a] -> [a]Source

Trims every element satisfying c from the beginning or end of the list.

 trim (==' ') "  foo   " == "foo"

convertFirst :: (a -> a) -> [a] -> [a]Source

Convert first element in list

 convertFirst (toUpper) "fO0" == "FO0"