Skip to content

Instantly share code, notes, and snippets.

@OliverJAsh
Last active July 7, 2019 20:37
Show Gist options
  • Save OliverJAsh/8f939c26b347a4b856f3c5dbbbe87ad3 to your computer and use it in GitHub Desktop.
Save OliverJAsh/8f939c26b347a4b856f3c5dbbbe87ad3 to your computer and use it in GitHub Desktop.
type alias File = { name : String }
type Action = AgreeToTerms | AddFiles { files : List File }
type State = Onboarding | Form { files : List File }
action = AgreeToTerms
state = Form { files = [] }
result = case ( action, state ) of
( AgreeToTerms, Onboarding ) ->
Form { files = [] }
( AddFiles { files }, Form form ) ->
Form { files = form.files }
( _ , _ ) ->
state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment