[Haskell-beginners] Variable re-use

Shishir Srivastava shishir.srivastava at gmail.com
Tue Apr 28 09:53:06 UTC 2015


Hi,

Please can anyone explain how does 'a' get re-used in the code below. My
understanding so far of haskell is that variables are not allowed to mutate
or re-assigned.

---
do
a <- [1,2,3]
a <- [a+1]
return a

[2,3,4]
---

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


More information about the Beginners mailing list