Skip to content

Instantly share code, notes, and snippets.

@choonkeat
Last active Oct 28, 2021
Embed
What would you like to do?
type TrafficLight
= Red
| Yellow
| Green
allTrafficLight : List TrafficLight
allTrafficLight =
let
helper list =
case List.head list of
Nothing ->
Red :: list |> helper
Just Red ->
Yellow :: list |> helper
Just Yellow ->
Green :: list |> helper
Just Green ->
list
in
helper []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment