-
-
Save mmynsted/b0e512c4f5cf93992e790bc997b2cc52 to your computer and use it in GitHub Desktop.
This file contains 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
getReviewStars :: [String] -> String | |
+ getReviewStars args = fromMaybe "" $ f args | |
+ where | |
+ f = fmap (T.unpack . reviewStars) . (readMaybe <=< listToMaybe) :: [String] -> Maybe String |
Even better
getReviewStars :: [String] -> String
getReviewStars args = maybe "" (T.unpack . reviewStars) ((readMaybe <=< listToMaybe) args)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following is better