background preloader

Haskell

Facebook Twitter

Haskell web programming. Update: updated for Yesod 1.2 tl;dr: A simple Yesod tutorial. Yesod is a Haskell web framework. You shouldn’t need to know Haskell. Why Haskell? Its efficiency (see Snap Benchmark & Warp Benchmark). Haskell is an order of magnitude faster than interpreted languages like Ruby and Python. Haskell is a high level language that makes it harder to shoot yourself in the foot than C, C++ or Java, for example. “If your program compiles it will be very close to what the programmer intended”. Haskell web frameworks handle parallel tasks perfectly—even better than node.js, for example. From a purely technical point of view, Haskell seems to be the perfect web development tool. Hard to grasp HaskellHard to find a Haskell programmerThe Haskell community is smaller than the community for /. I won’t say these are not important drawbacks.

Actually there are three main Haskell web frameworks: I don’t think there is a real winner between these three framework. Why did I write this article? Before the real start. Johan Tibell: Remotely monitor any Haskell application. I am delighted to announce the first release of ekg, a new library for remote monitoring of processes over HTTP. The library gives you insight into what your application is doing right now. It lets you see how much memory your application is using,how much time is spent on GC, andwhat the current memory allocation rate is. Live monitoring is sometimes the only way to get insight into issues that only show up when an application is deployed in production.

By exporting the stats over HTTP, the library lets you monitor applications running on remote machines by simply pointing your web browser at the machine you're interested in. (N.B. Adding monitoring to your application is simple. Import System.Remote.Monitoring main = do forkServer "localhost" 8000 ... and then visit in your web browser. The web interface currently includes The summary table looks like this: The monitoring server also lets you to retrieve the stats as JSON. Git clone. Tutorials. 1 Introductions to Haskell These are the recommended places to start learning, short of buying a textbook. 1.1 Best places to start Learn You a Haskell for Great Good!

(LYAH) Nicely illustrated tutorial showing Haskell concepts while interacting in GHCi. Written and drawn by Miran Lipovača. Real World Haskell (RWH) A free online version of the complete book, with numerous reader-submitted comments. Yet Another Haskell Tutorial (YAHT) By Hal Daume III et al. Haskell Wikibook A communal effort by several authors to produce the definitive Haskell textbook. Write Yourself a Scheme in 48 Hours in Haskell A Haskell Tutorial, by Jonathan Tang. How to Learn Haskell Some students at Washington University in St. О Haskell по-человечески About Haskell from a beginner for beginners. 1.2 Other tutorials Haskell for the Evil Genius By Andrew Pennebaker.

Parallel Processing with Haskell By Andrew Pennebaker. GetOptFu By Andrew Pennebaker. A Gentle Introduction to Haskell By Paul Hudak, John Peterson, and Joseph H. All About Monads. All About Monads is a tutorial on monads and monad transformers and a walk-through of common monad instances. You can download a PDF version here or here. And here is a version of the article which includes source code. Attempts are being made at porting the tutorial to this wiki; what you're seeing below is a preview of the result of that effort. If you wish to help out you should fork this GitHub repo rather than edit this page, for now. 1.1 What is a monad?

A monad is a way to structure computations in terms of values and sequences of computations using those values. It is useful to think of a monad as a strategy for combining computations into more complex computations. Data Maybe a = Nothing | Just a which represents the type of computations which may fail to return a result. Other monads exist for building computations that perform I/O, have state, may return multiple results, etc. 1.2 Why should I make the effort to understand monads?

Meet the Monads 2.1 Type constructors 2.5 Summary. Learn You a Haskell for Great Good! - Chapters. H-99: Ninety-Nine Haskell Problems. These are Haskell translations of Ninety-Nine Lisp Problems, which are themselves translations of Ninety-Nine Prolog Problems. If you want to work on one of these, put your name in the block so we know someone's working on it.

Then, change n in your block to the appropriate problem number, and fill in the <Problem description>,<example in Haskell>,<solution in haskell> and <description of implementation> fields. Then be sure to update the status on this page to indicate that we have a solution! 1 The problems These problems have been split into 11 parts, for ease of access. (Though the problems number from 1 to 99, there are some gaps and some additions marked with letters. 2 Solutions Known solutions are listed at 99 questions/Solutions. 3 References P-99: Ninety-Nine Prolog Problems contains Prolog solutions to all the problems.

Real World Haskell.