Summary

This chapter explored some key language extensions and the design patterns associated with them. In particular, we looked at language extensions related to functions, datatypes, and type­classes and encountered two major costs of language extensions:

  • impaired type inference (requiring more type annotations)
  • affinity to compiler implementations (decreasing portability of code across compilers)

Language extensions make Haskell more powerful but also more complex, hence the sentiment:

 

"Whenever you add a new feature to a language, you should throw out an existing one (especially if the language at hand is named after a logician)"

 
 --Fun with Phantom Types, Hinze
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset