From 0dadf66e7fd4bddf8e3f7b139f94045bd0b1b462 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Fri, 22 Sep 2017 16:04:17 +0200 Subject: Clears up Battlemap/Navigator.elm --- client/elm/battlemap/src/Util/List.elm | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 client/elm/battlemap/src/Util/List.elm (limited to 'client/elm/battlemap/src/Util/List.elm') diff --git a/client/elm/battlemap/src/Util/List.elm b/client/elm/battlemap/src/Util/List.elm new file mode 100644 index 0000000..c4db397 --- /dev/null +++ b/client/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