Created
April 13, 2024 17:42
-
-
Save AgrYpn1a/09afb0969018beb05eaa15a56fb8b038 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
densityTell :: String -> String | |
densityTell input | |
| Just density <- readMaybe input, density < 1.2 = "Wow! You're going for a ride in the sky!" | |
| Just density <- readMaybe input, density <= 1000.0 = "Have fun swimming, but watch out for sharks!" | |
| Nothing <- readMaybe input :: (RealFloat a => Maybe a) = "You know I need a density, right?" | |
| otherwise = "If it's sink or swim, you're going to sink. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment