2 Ancient secret keeping on modern machines

 

This chapter covers

  • How to set up a basic Haskell project and run some code
  • An overview of common Haskell data types and how functions work
  • Performing basic operations with strings and lists
  • Using guards and pattern matching for handling case distinctions
  • Working with immutable data and how to represent transformations

In the last chapter we learned about what Haskell is and discussed its peculiar language design decisions. We also learned some specifics on pure functions and how pure functional programs, such as the ones we write with Haskell, are structured. Although it is essential to understand these concepts, it’s not much use talking about them, without getting our hands a bit dirty. You can’t learn the application of theory without applying anything. So let’s get down to implementing our first tiny project!

2.1 A primer on Haskell for primitive encryption

 
 
 
 

2.1.1 The Caesars cipher

 
 

2.1.2 A new project

 
 
 

2.2 Typical types and fantastic functions

 
 
 
 

2.2.1 Atomic types

 
 
 

2.2.2 Lists and tuples

 
 
 

2.2.3 Function types

 
 

2.3 Little help with the alphabet

 
 
 

2.4 Rotating the wheel

 
 
 

2.4.1 Finding an elements index

 
 

2.4.2 Finding the element at an index

 
 
 

2.5 Transforming a string

 
 
 

2.6 Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest