Skip to Content
Mastering Functional Programming
book

Mastering Functional Programming

by Anatolii Kmetiuk
August 2018
Intermediate to advanced
380 pages
10h 2m
English
Packt Publishing
Content preview from Mastering Functional Programming

Writer effect type

The Writer effect type provides us with a bit more of a generic type class than the SimpleWriter implementation. However, if we use it, we do not need to define the SimplerWriter type, as well as an implementation of the type classes for it. Since cats provides the implementation of its type classes for its data types, we don't need to worry about doing this ourselves.

As you may recall, our SimpleWriter object is essentially a pair. The first element of the pair is a list of strings which represents all of the logging messages that were logged by a computation. The other object of a pair is a value that was computed by the computation.

The cats implementation of the Writer object is essentially very similar to our simpler ...

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

Learning Functional Programming

Learning Functional Programming

Jack Widman

Publisher Resources

ISBN: 9781788620796Supplemental Content