Skip to Content
Learn Haskell by Example
book

Learn Haskell by Example

by Philipp Hagenlocher
December 2024
Beginner content levelBeginner
456 pages
13h 37m
English
Manning Publications
Content preview from Learn Haskell by Example

4 Line numbering tool

This chapter covers

  • Reading files from the filesystem
  • Parameterizing the behavior of higher-order functions by using function arguments
  • Using algebraic data structures to encode possible options
  • Bundling code as an executable

In the last chapter, we laid the groundwork for a tool that is able to number lines from a given file. We have learned how we can read arguments from the user. So now, we can start thinking about how to read from a file and how to get the individual lines of the file’s content.

This chapter starts by providing a discussion on reading files and transforming the read contents. Following this, we will write a general function whose control and data flow are influenced by functions given as arguments. ...

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 Haskell

Get Programming with Haskell

Will Kurt
Haskell in Depth

Haskell in Depth

Vitaly Bragilevsky

Publisher Resources

ISBN: 9781633438934Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentErrata PagePurchase Link