From 685ac4cd483941e1013d9fc1911129987f653eea Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Tue, 31 Jul 2018 12:49:40 -0700 Subject: This function is just `liftA2 (,)` so that's cool --- rain/main.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rain') 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) -- cgit v1.2.3