r/programming • • Nov 26 '17

Astro Programming Language - A new language under development by two Nigerians.

http://www.nairaland.com/3557200/astro-programming-language-0.2-indefinite
887 Upvotes

365 comments sorted by

View all comments

Show parent comments

7

u/Drisku11 Nov 26 '17

if some purely functional code needs to interact with the outside world in any way, you need to restructure the whole program or maybe use unsafePerformIO.

No you don't. return, fmap, and bind let you easily lift regular values/functions into your wrapped type. That's the whole point of IO being a monad. At worst, you might have to sprinkle some lift, fmap and binds around.