moduleMain(main)wheremaybeTip::Float->String->MaybeIntmaybeTipprice"poor"=Just$ceiling$price*0.05maybeTipprice"good"=Just$ceiling$price*0.1maybeTipprice"great"=Just$ceiling$price*0.15maybeTipprice"excellent"=Just$ceiling$price*0.2maybeTip__=Nothingmain::IO()main=doprint$maybeTip30"poor"-- Just 2print$maybeTip20"hi"-- Nothingprint$maybeTip107.65"great"-- Just 17print$maybeTip78"good"-- Just 8print$maybeTip50"poor"-- Just 3print$maybeTip125"excellent"-- Just 25
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Haskell