Skip to Content
Get Programming with Haskell
book

Get Programming with Haskell

by Will Kurt
March 2018
Beginner
616 pages
16h 53m
English
Manning Publications
Content preview from Get Programming with Haskell

Lesson 18. Parameterized types

After reading lesson 18, you’ll be able to

  • Use parameterized types to make generic data types
  • Understand kinds of types
  • Write code using the Data.Map type to look up values

In this unit so far, we’ve discussed how types can be added and multiplied, like data. Like functions, types can also take arguments. Types take arguments by using type variables in their definitions (so their arguments are always other types). Types defined using parameters are called parameterized types. Parameterized types perform an important role in Haskell, as they allow you to define generic data structures that work with a wide range of existing data.

Consider this

Suppose you want to create a type representing a pair ...

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

Get Programming with Go

Get Programming with Go

Nathan Youngman, Roger Peppe
Effective Haskell

Effective Haskell

Rebecca Skinner

Publisher Resources

ISBN: 9781617293764Publisher SupportOtherPublisher WebsiteSupplemental ContentErrata PagePurchase Link