[Haskell-beginners] Equivalent of IO Monad in other functional languages?

amindfv at gmail.com amindfv at gmail.com
Sun Mar 15 17:49:04 UTC 2015


From that perspective isn't every language pure? Haskell's still got "randomIO" and "print <=< readMVar"

Tom


El Mar 15, 2015, a las 13:15, "Sumit Sahrawat, Maths & Computing, IIT (BHU)" <sumit.sahrawat.apm13 at iitbhu.ac.in> escribió:

> Hello Simon,
> 
> If you changed your perspective, you would realize that all functions in haskell are pure.
> A function is pure if it returns the same output if given the same input. Every monadic function (including functions returning IO) is also pure.
> For example,
> 
>     putStrLn :: String -> IO ()
>     -- A function that takes a string, and returns an impure computation
>     -- which, when executed will print the given String.
> 
> For any string, putStrLn applied to that same string always describes the same impure computation, thus the function is actually pure.
> I am not familiar with any other functional language, but there are not many purely functional ones out there [1].
> I guess the impure ones get around this issue by giving in to impurity, but I'm not sure.
> 
> I'll be interested in hearing more about the other languages too.
> 
> [1] : http://en.wikipedia.org/wiki/List_of_programming_languages_by_type#Pure
> 
> On 15 March 2015 at 22:25, Marcin Mrotek <marcin.jan.mrotek at gmail.com> wrote:
>> Hello,
>> 
>> F* uses a somewhat similar approach: https://fstar-lang.org/tutorial/
>> (section 2, Types and Effects)
>> 
>> Best regards,
>> Marcin Mrotek
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> 
> 
> 
> -- 
> Regards
> 
> Sumit Sahrawat
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150315/2c3a178c/attachment.html>


More information about the Beginners mailing list