in ,

Write Yourself a Scheme in 48 Hours (2007), Hacker News


Overview

Haskell-logo.png

Most Haskell tutorials on the web use a style of teaching akin to language reference manuals. They show you the syntax of the language, a few language constructs, then tell you to create a few simple functions at the interactive prompt. The “hard stuff” of how to write a functioning, useful program is left to the end, or omitted entirely.

This tutorial takes a different approach. You’ll start off using and parsing the command-line, then progress to writing a fully-functional Scheme interpreter that implements a decent subset ofR (5) RS Scheme. Along the way, you’ll learn Haskell’s I / O, mutable state, dynamic typing, error handling, and parsing features. By the time you finish, you should become fairly fluent in Haskell and Scheme.

This tutorial targets two main audiences:

  • People who already know (Lisp) orScheme, and want to learn (Haskell)
  • People who don’t know any programming language, but have a strong quantitative background, and are familiar with computers

The second group will likely find this challenging, as this tutorial glosses over several concepts in Scheme and general programming in order to stay focused on Haskell. A good textbook such asStructure and Interpretation of Computer ProgramsorThe Little Schemershould be very helpful .

Users of a procedural or object-oriented languages ​​likeC,Java, orPythonshould beware: You’ll have to forget most of what you already know about programming. Haskell iscompletelydifferent from those languages, and requires a different way of thinking about programming. It’s best to go into this tutorial with a blank slate; try not to compare Haskell to imperative languages, because many concepts (including classes, functions, andreturn) have significantly different meanings in Haskell.

Since each lesson builds upon code written in previous ones, it’s generally best to go through them in order.

This tutorial assumes that you’ll useGHCas your Haskell compiler. The code may work withHugsor other compilers, but hasn’t been officially tested with them, and may require downloading additional libraries.

A prior, non-wiki-edited version of the source code files used in this tutorial is available on theoriginal site.

Contents******

  1. First Steps: Compiling and running
  2. Parsing
  3. Evaluation, Part 1
  4. Error Checking and Exceptions
  5. Evaluation, Part 2
  6. Building a REPL: Basic I / O
  7. Adding Variables and Assignment: Mutable State in Haskell
  8. Defining Scheme Functions: Closures and Environments
  9. Creating IO Primitives: File I / O
  10. Towards a Standard Library: Fold and Unfold
  11. Conclusion & Further Resources
  12. Answers to Exercises

50% developed

Brave Browser
Read More
Payeer

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

President Mike Bloomberg Could Propel A Bigger Dow Bump Than Trump, Crypto Coins News

President Mike Bloomberg Could Propel A Bigger Dow Bump Than Trump, Crypto Coins News

Sourav Ganguly Shares Photo With “New Team At BCCI”, Thanks Anurag Thakur – NDTVSports.com, Ndtv.com

Sourav Ganguly Shares Photo With “New Team At BCCI”, Thanks Anurag Thakur – NDTVSports.com, Ndtv.com