Skip to content

Instantly share code, notes, and snippets.

@bigmeech
Created February 4, 2017 12:21
Show Gist options
  • Select an option

  • Save bigmeech/eaa23d8f1a96fa6dbc5284466aca6919 to your computer and use it in GitHub Desktop.

Select an option

Save bigmeech/eaa23d8f1a96fa6dbc5284466aca6919 to your computer and use it in GitHub Desktop.
Sample elm snippets
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