diff --git a/src/HSL/Stdlib.hs b/src/HSL/Stdlib.hs index 50f077d..77f3708 100644 --- a/src/HSL/Stdlib.hs +++ b/src/HSL/Stdlib.hs @@ -1,5 +1,5 @@ -module HSL.Stdlib (groupOn, sortOn, sortOnR, hist, tabs, tally, logScale) where +module HSL.Stdlib (groupOn, sortOn, sortOnR, hist, tabs, commas, tally, logScale) where import Data.Ord (comparing) @@ -35,6 +35,8 @@ hist = tally . flip zip (repeat 1) tabs :: Datum a => a -> [T.Text] -> [a] tabs _ = map (parseMany . T.split (=='\t')) +commas :: Datum a => a -> [T.Text] -> [a] +commas _ = map (parseMany . T.split (==',')) logScale :: (Integral a) => a -> a logScale = (2^) . truncate . logBase 2 . fromIntegral