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)