© Stefania Loredana Nita and Marius Mihailescu 2019
Stefania Loredana Nita and Marius MihailescuHaskell Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-4507-1_10

10. Classes

Stefania Loredana Nita1  and Marius Mihailescu1
(1)
Bucharest, Romania
 

In the previous chapters, you created your own types. Now, it’s time to learn what classes are in Haskell and how to work with them. In this chapter, you’ll learn about the standard classes and then how to create your own classes.

Standard Classes

In Haskell, the most common standard classes are the following ones:
  • Eq is used when you work with == (is equal) and /= (is not equal).

  • Ord is used when you work with the operators <, <=, >, and >= and the functions min, max, and compare.

  • Enum is used in enumerations ...

Get Haskell Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.