Created
February 4, 2017 12:21
-
-
Save bigmeech/eaa23d8f1a96fa6dbc5284466aca6919 to your computer and use it in GitHub Desktop.
Sample elm snippets
This file contains hidden or 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
| import Html exposing (..) | |
| -- union type for clipboard state | |
| type ClipboardState = Active | Inactive | Other String | |
| main = | |
| text (toString report) | |
| -- type anotation for reportState function | |
| reportState : ClipboardState -> String | |
| -- implimentation of reportState function | |
| reportState x = | |
| case x of | |
| Active -> "Active" | |
| Inactive -> "Inactive" | |
| _ -> "Unreconginsed State" | |
| -- holds report | |
| report : String | |
| report = | |
| reportState (Other "Unrecognised") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment