where jCards = replace Jack Joker cards
replace :: Eq a => a -> a -> [a] -> [a]
-replace _ _ [] = []
-replace f t (x:xs)
- | x == f = t : replace f t xs
- | otherwise = x : replace f t xs
+replace f t = fmap (\x -> if x == f then t else x)
classify :: Hand -> ClassifiedHand
classify (Hand cards bid)
where jCards = replace Jack Joker cards
replace :: Eq a => a -> a -> [a] -> [a]
-replace _ _ [] = []
-replace f t (x:xs)
- | x == f = t : replace f t xs
- | otherwise = x : replace f t xs
+replace f t = fmap (\x -> if x == f then t else x)
classify :: Hand -> ClassifiedHand
classify (Hand cards bid) =