Skip to content

Comment on OCaml for Haskellersparent

Comments

IORef is exactly equivalent to any other mutable variable.

If you want to write C in Haskell:

    import Foreign
    foo = mallocBytes 42 $ \p -> do
        whatever <- peek p
        poke p $ f whatever
        ...
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.