|
|
|
|
|
by thedataangel
2815 days ago
|
|
> The same goes for mutability, it is there and you should certainly use it when it makes sense but it is not the default. This is also true for Haskell. It's not especially hard to get and use mutable variables, they're just not something that most tutorials cover. |
|
(Yes, Haskell does have unsafePerformIO and the like for special cases, but the expectation is still that the external interface remains pure. If you deliberately circumvent the language's protections and fail to adhere to this rule then you get to keep both pieces when it inevitably breaks. The compiler is still going to operate under the assumptions that the result depends only on the explicit inputs and that evaluating the function has no side effects.)