| summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/Struct/Flags.elm')
| -rw-r--r-- | src/Struct/Flags.elm | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/Struct/Flags.elm b/src/Struct/Flags.elm new file mode 100644 index 0000000..0e2ca14 --- /dev/null +++ b/src/Struct/Flags.elm @@ -0,0 +1,40 @@ +module Struct.Flags exposing + ( + Type, + maybe_get_param + ) + +-- Elm ------------------------------------------------------------------------- +import List + +-- Shared ---------------------------------------------------------------------- +import Util.List + +-------------------------------------------------------------------------------- +-- TYPES ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- +type alias Type = + { + url_params : (List (List String)) + } + +-------------------------------------------------------------------------------- +-- LOCAL ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +-- EXPORTED -------------------------------------------------------------------- +-------------------------------------------------------------------------------- +maybe_get_param : String -> Type -> (Maybe String) +maybe_get_param param flags = + case + (Util.List.get_first + (\e -> ((List.head e) == (Just param))) + flags.url_params + ) + of + Nothing -> Nothing + (Just a) -> + case (List.tail a) of + Nothing -> Nothing + (Just b) -> (List.head b) |


