Skip to Content
Effective Haskell
book

Effective Haskell

by Rebecca Skinner
July 2023
Intermediate to advanced
670 pages
17h 13m
English
Pragmatic Bookshelf
Content preview from Effective Haskell

Working with IORefs

In Haskell, rather than storing a value that is directly mutable, we store an immutable reference to some data that we can change using the reference. There are several different types of mutable references that you can use, depending on the specific needs of your application. You’ll learn about several different types of references throughout this chapter, but for the moment we’ll focus on particular type of reference, the IORef.

A value with the type IORef a is a normal Haskell value that holds an immutable pointer to some internal data that is managed by the GHC runtime.

You can use an IORef like any other normal Haskell value. You can pass it into a function, return it, store it in a record, or capture the value in a ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Grokking Functional Programming

Grokking Functional Programming

Michal Plachta
Grokking Algorithms

Grokking Algorithms

Aditya Bhargava
The Rust Programming Language, 2nd Edition

The Rust Programming Language, 2nd Edition

Steve Klabnik, Carol Nichols

Publisher Resources

ISBN: 9798888650400Errata Page