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 Polymorphic Functions

So far we’ve looked at types that represent a specific sort of value like an Int or a String. A value with a single type like this is called monomorphic. Monomorphic functions are great when you know exactly what kind of values you’ll be working with, but in many cases they’re unnecessarily restrictive. You can get around these restrictions and write more general functions by using polymorphism. In this section, you’ll learn about parametric polymorphism, which is the most common sort of polymorphism that you’ll encounter while writing Haskell. Later on in this book, you’ll be introduced to another kind of polymorphism called ad hoc polymorphism.

To understand how polymorphism works and how it can help us ...

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