[Haskell-beginners] Value from Monad

Shishir Srivastava shishir.srivastava at gmail.com
Wed Apr 22 15:24:23 UTC 2015


Hi,

Going through the '<-' description in 'learnouahaskell' it says -

*" If we have a Maybe String and we bind it with <- to a variable, that
variable will be a String"*

so if you write

do
str <- Just "3"

str should be of type 'String'. My question is how do I return "34"
by concatenating it to "4" because the following line of code fails -

---
do
str <- Just "3"
return str++"4"::Maybe String
---

or for that matter how can I return/print just the value of str from this
do block ?

Thanks,
Shishir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150422/079b28e7/attachment.html>


More information about the Beginners mailing list