Created
April 27, 2017 11:35
-
-
Save zwilias/27cdee22a945cd684c26bb1ab8bd0ea9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- This is what the runtime passes in -} | |
type alias UnsafeFlags = | |
{ browser : Maybe String | |
, version : Maybe String | |
, randomSeed : Int | |
} | |
{- And this is what we want to work with -} | |
type alias Flags = | |
{ browser : String | |
, version : String | |
, randomSeed : Int | |
} | |
sanitizeFlags : UnsafeFlags -> Flags | |
sanitizeFlags unsafeFlags = | |
{ unsafeFlags | |
| browser = Maybe.withDefault "unknown" unsafeFlags.browser | |
, version = Maybe.withDefault "unknown" unsafeFlags.version | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment