maybeEmpty can be replaced by Data.List.listToMaybe
This commit is contained in:
parent
ebc0d54ddc
commit
e2ecf0739d
|
@ -4,11 +4,6 @@ module Hash2Pub.Utils where
|
||||||
import qualified Data.ByteString as BS
|
import qualified Data.ByteString as BS
|
||||||
import qualified Data.Set as Set
|
import qualified Data.Set as Set
|
||||||
|
|
||||||
-- |wraps a list into a Maybe, by replacing empty lists with Nothing
|
|
||||||
maybeEmpty :: [a] -> Maybe [a]
|
|
||||||
maybeEmpty [] = Nothing
|
|
||||||
maybeEmpty nonemptyList = Just nonemptyList
|
|
||||||
|
|
||||||
-- | Chop a list into sublists of i elements. The last sublist might contain
|
-- | Chop a list into sublists of i elements. The last sublist might contain
|
||||||
-- less than i elements.
|
-- less than i elements.
|
||||||
chunksOf :: Int -> [a] -> [[a]]
|
chunksOf :: Int -> [a] -> [[a]]
|
||||||
|
|
Loading…
Reference in a new issue