From 2c9b2af9ac011a871c5c02d3e2258fca73a98880 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Wed, 27 Sep 2017 10:31:16 +0200 Subject: Splits client and server into two repositories. --- elm/battlemap/src/Util/List.elm | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 elm/battlemap/src/Util/List.elm (limited to 'elm/battlemap/src/Util/List.elm') diff --git a/elm/battlemap/src/Util/List.elm b/elm/battlemap/src/Util/List.elm new file mode 100644 index 0000000..c4db397 --- /dev/null +++ b/elm/battlemap/src/Util/List.elm @@ -0,0 +1,12 @@ +module Util.List exposing (pop) + +import List + +pop : List a -> (Maybe (a, List a)) +pop l = + case + ((List.head l), (List.tail l)) + of + (Nothing, _) -> Nothing + (_ , Nothing) -> Nothing + ((Just head), (Just tail)) -> (Just (head, tail)) -- cgit v1.2.3-70-g09d2