Skip to content

Instantly share code, notes, and snippets.

@ababup1192
Last active August 14, 2019 13:19
Show Gist options
  • Save ababup1192/f7a2a426bd14ad734f8e71909f8108df to your computer and use it in GitHub Desktop.
Save ababup1192/f7a2a426bd14ad734f8e71909f8108df to your computer and use it in GitHub Desktop.
> type Suit = Spade | Diamond | Club | Heart
> type Rank = Ace | Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten | Jack | Queen | King
> suits = [ Spade, Diamond, Club, Heart ]
[Spade,Diamond,Club,Heart] : List Suit
> ranks = [ Ace, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King ]
[Ace,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten,Jack,Knight,Queen,King]
: List Rank
> type Card = Card Suit Rank | Joker
> suits |> List.concatMap (\suit -> ranks |> List.map (Card suit) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment