diff options
author | Ben Sima <ben@bsima.me> | 2018-07-31 12:49:40 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2018-07-31 12:49:40 -0700 |
commit | 685ac4cd483941e1013d9fc1911129987f653eea (patch) | |
tree | bf40f0635e63569fb5b29e534cbd663565e9e223 /rain/main.hs | |
parent | 67212026f06925cd2d16ff425192890011ebd7eb (diff) |
This function is just `liftA2 (,)` so that's cool
Diffstat (limited to 'rain/main.hs')
-rwxr-xr-x | rain/main.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rain/main.hs b/rain/main.hs index 3c431a7..41ab03b 100755 --- a/rain/main.hs +++ b/rain/main.hs @@ -22,6 +22,7 @@ Suits: Clubs, Diamonds, Aces, Spades import System.Random import Control.Monad +import Control.Applicative data Name = Two @@ -53,7 +54,7 @@ suits :: [Suit] suits = [ Club .. ] allCards :: [(Name, Suit)] -allCards = concat $ map (\n -> map (\s -> (n, s)) suits) names +allCards = liftA2 (,) names suits data CardsGen = CardsGen deriving (Show) |