Last active
August 14, 2019 13:19
-
-
Save ababup1192/f7a2a426bd14ad734f8e71909f8108df to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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