From d57ea4eda1339ae55f1f1f6341d1af6b1a690330 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sat, 21 Mar 2015 15:57:37 +0100 Subject: Can remove numbers in timer edition --- src/Utils/List.elm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Utils/List.elm') diff --git a/src/Utils/List.elm b/src/Utils/List.elm index 6895d83..64ebaa5 100644 --- a/src/Utils/List.elm +++ b/src/Utils/List.elm @@ -1,6 +1,7 @@ module Utils.List ( repeat , splitAt + , maybeTail ) where import List @@ -15,3 +16,9 @@ repeat count elem = 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 -- cgit v1.2.3