• solrize@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    14 hours ago

    Haskell doesn’t have impure functions. What you’re calling impure functions (functions that produce values in the notorious I/O monad) are actually pure functions, that produce what you could think of as programs that run in an impure interpreter that’s outside of Haskell itself. Don’t worry about understanding that in detail until you’re deeper into learning Haskell, but at that point it will help demystify what the I/O monad (a traditional stumbling block) actually is.

    The first few pages of learnyouahaskell.com will give you some sample code to show how clean the language can be.