3 ms·
not quite the same as what I wrote -- it would be more akin to: print_maybe = putStr . maybe "nothing" ((++ "\n") . show) or maybe something like: pr
by Aearnus 8y ago
not quite the same as what I wrote -- it would be more akin to:
print_maybe = putStr . maybe "nothing" ((++ "\n") . show)
or maybe something like:
print_maybe c = c >>= (\d -> print d >> putStr "\n")
but that's already too long to finish
- JadeNB 8y agoAccording to https://hackage.haskell.org/package/base-4.12.0.0/docs/Prelude.html#v:print https://hackage.haskell.org/package/base-4.12.0.0/docs/Prelu... , `print` already appends a newline, so I think that `print m` is not the same as `putStr $ show m` and hence that the refinements you suggest are unnecessary.