module Utils.List ( repeat , splitAt , maybeTail ) where import List repeat : Int -> a -> List a repeat count elem = if count > 0 then elem :: (repeat (count - 1) elem) else [] splitAt : Int -> List a -> (List a, List a) splitAt n xs = (List.take n xs, List.drop n xs) maybeTail : List a -> Maybe (List a) maybeTail xs = case xs of _ :: tl -> Just tl _ -> Nothing