| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-09-22 16:04:17 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-09-22 16:04:17 +0200 | 
| commit | 0dadf66e7fd4bddf8e3f7b139f94045bd0b1b462 (patch) | |
| tree | f399909fa56c7faab10181b384ce210adc22116f /client/elm/battlemap/src/Util/List.elm | |
| parent | babe47cb2541113e245f7db4b5e981f23f985fa3 (diff) | |
Clears up Battlemap/Navigator.elm
Diffstat (limited to 'client/elm/battlemap/src/Util/List.elm')
| -rw-r--r-- | client/elm/battlemap/src/Util/List.elm | 12 | 
1 files changed, 12 insertions, 0 deletions
| 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)) | 


