[Haskell-cafe] avoid to print empty string

Brandon Allbery allbery.b at gmail.com
Mon Jan 21 19:50:28 UTC 2019


You want:
  return ()

(Look at the type of putStrLn.)

On Mon, Jan 21, 2019 at 2:49 PM Damien Mattei <damien.mattei at gmail.com>
wrote:

> i have this in a Monad IO:
>
>  forM_ fltrdNamesBDs $ \(name,bdSidonie,bdWDS) ->
>           if (bdWDS /= bdSidonie)
>           then
>              putStrLn $  name ++ " " ++ (show (bdSidonie :: Maybe Float))
> ++ " " ++ show (bdWDS :: Maybe Float) ++ " " ++ show (bdWDS == bdSidonie)
>           else
>              putStr ""
>
> is there a way to remove the silly putStr "" that output an empty string,
> i tried with when.... but as when return Nothing in case of False it fails
> to compile
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



-- 
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20190121/6ac24ddb/attachment.html>


More information about the Haskell-Cafe mailing list