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
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