Good Haskell source to read and learn from [closed] - haskell

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What are some open source programs that use Haskell and can be considered to be good quality modern Haskell? The larger the code base, the better.
I want to learn from their source code. I feel I'm past the point of learning from small code examples, which are often to esoteric and small-world. I want to see how code is structured, how monads interact when you have a lot of things going on (logging, I/O, configuration, etc.).

What I recommend.
Read code by people from different grad schools in the 1990s
Oxford style
Glasgow style or (this)
Chalmers style (or this)
York style
Portland style or OGI style (or this)
Utrecht style
Yale style
Special case: CMU/Elliott
Read code by the old masters certain people (incomplete list)
Marlow; Paterson; Peyton Jones; Gill; Launchbury; Hughes; Wadler; Bird; Claessen; Jones; Tolmach; Sheard; Swiestra; Augustsson; Runciman; Wallace; Thompson; Hinze; Gibbons; Leijen; Hudak; Elliott; Finne; Chakravarty; and
Anyone who has written a functional pearl.
Note that people like me, Coutts, Mitchell, O'Sullivan, Lynagh, etc. learned our Haskell style from these guys.
Read some applications
Read the GHC base library source
Read the xmonad source

XMonad is an open source tiling window manager, originally loosely modeled on dwm. There are a lot of extensions, of varying quality, but the core is compact and well organized.

Haskell: Functional Programming with Types
Joeri van Eekelen, et al. | Wikibooks
Published in 2007, 290 pages
Learn You a Haskell for Great Good!
Miran Lipovaca | LearnYouaHaskell.com
Published in 2010, 176 pages
Real World Haskell
B. O'Sullivan, J. Goerzen, D. Stewart | O'Reilly Media, Inc.
Published in 2008, 710 pages
The Haskell Road to Logic, Maths and Programming
Kees Doets, Jan van Eijck | College Publications
Published in 2004, 449 pages

Darcs is an open source, source code management system. It should give you a nice idea for Haskell.

The source code to the Yesod Web Platform is fairly complex, well thought out, and well written. You will learn a lot from the persistence library that comes with it as well.

If you care about Web-programming I would recommend Chris Done's lpaste project.

GHC is probably the biggest or one of the biggest projects written in Haskell that is open source. When I say biggest, I do not just mean in terms of source size, but also impact, use, innovation, robustness. GHC can teach you a lot about writing Haskell.

Related

How to implement a language using a functional language? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I prefer Haskell.
I already know How to create my own language with Procedural Language (for example: C, Java, Python, etc).
But, I know How to create my own language with Functional Language (for example Haskell, Clojure and Scala).
I've already read:
Internet Resources
Write Yourself a Scheme in 48 Hours
Real World Haskell - Chapter 16.Using Persec
Writing A Lisp Interpreter In Haskell
Parsec, a fast combinator parser
Implementing functional languages: a tutorial
Books
Introduction Functional Programming Using Haskell 2nd Edition -- Haskell
StackOverflow (but with procedural language)
Learning to write a compiler
create my own programming language
Source
Libraries and tools/HJS -- Haskell
Are there any other good links/sources? I would like to get some more.
Programming Languages: Application and Interpretation is frequently used in programming language classes, and is available online for free. It uses Scheme.
Types and Programming Languages is another incredible book dealing with type systems (including implementation), though only available in dead tree format. It uses ML (which represents a significant family of functional languages that I noticed was missing from your list).
Racket (formerly called PLT Scheme) is a functional language that emphasizes making your own sub-language.
read also:
Christian Queinnec's Lisp In Small Pieces book,
Andrew Appel's Compile with Continuations (and also his book Modern compiler implementation in ML isbn:0521582741)
I also think that Jacques Pitrat's latest book Artificial Beings - the conscience of a conscious machine will give you very interesting insights.
Take also a look at Compiler.HOOPL and Control.Unification libraries, and uuagc attribute grammar preprocessor. You also can read https://wiki.ittc.ku.edu/lambda/images/e/e3/Modular-interpreters.pdf on writing modular interpreters in Haskell. Also note that Parsec is not very fast and for non-toy projects Happy/Alex may be suited better.

LISP or Haskell [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
LISP or Haskell, I need to learn functional programming, but I heard that lisp is very old, any advice between those two languages ?
Just to echo the others, I'd learn both Scheme (a more functional Lisp dialect) and Haskell. Scheme / Lisp have some useful tricks to teach you about 'code is data / data is code' and macros. Scheme encourages a good functional style and I would recommend the 'The Little Schemer' series of books to get you started on this. SICP is also a fantastic text http://mitpress.mit.edu/sicp/full-text/book/book.html and possibly one of the best books ever written on programming. Scheme is more accessible as a first functional language.
Once you've got the hang of Scheme you'll probably find yourself becoming frustrated with the lack of libraries, lack of parallelism and the small, although excellent, community. This is where I was when I decided to learn Haskell. Haskell is very mature, very useful and very functional and it is quite a challenge to learn once you move off the basics and so having a grounding in another functional language will help enormously. You won't regret learning either (or both).
Why not both? LISP is very easy to learn (I'd go for the Scheme dialect - see http://racket-lang.org) so I'd start with that. If you like it, stick with it, but I'd also give Haskell a go, although it is (in my experience) considerably harder to wrap your head around.
The great thing about computing these days is that you can try all these languages for free, apart from your time. When I started programming LISP was only available on mainframes, which put a bit of a crimp on trying to learn it.
Haskell, because once you've learned Haskell, you will love it. And then, you will be able to learn Common LISP. However, if your editor is Emacs, then go start with Lisp.
If you want to learn functional programming through implementing a compiler or interpreter of a language, then Lisp or ML should be a better first choice as they're much simpler to implement than a lazy language. Otherwise you'd better learn both.
Choosing based on age is silly, Haskell has been around much longer than say C# and its history extends back a lot further. Anyway I'd recommend learning both eventually, for learning functional programming, Haskell is specifically about purely functional programming (in a number of senses of the meaning). Scheme is a functional orientated descendant of lisp.

why PL/I didn't make it in scientific computing? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
PL/I is a very old language but seemingly haven't got much publicity and appreciation as Fortran for scientific computing. Why is that? A search on the web does show that there are many PL/I codes for scientific computing. There is among others a scientific computing library which was developed by IBM in PL/I.
But I haven't found any free compilers for Windows for PL/I. Is it due to this lack of free compilers that PL/I didn't attract the scientific community?
Thanks a lot...
I worked with people at IBM who built the PL/I optimizing compilers and PL/I checkout compilers. I enjoyed using PL/I, but it was a classic example of a "second-system effect": very complicated and clunky, although powerful. Imagine a closed-source version of Perl and you won't be too far off. And the key there is closed source. Languages take years to take hold, and by the time PL/I was stable in the mid-1970s, computation was already shifting away from mainframes toward minicomputers. Then in the late 1980s the microcomputers took over. The PL/I compilers were not designed to be portable—they were started right after the IBM 360, which was going to be the last computer anyone ever needed—and there was no way IBM was going to catch up with much simpler, more easily ported languages on the new platforms. (Not that I can imagine IBM trying to come up with a port of PL/I to the PDP-11.)
In short,
Nobody other than IBM had a stake in making PL/I succeed.
IBM cared only about their own mainframe hardware.
PL/I was viciously hard to port to other hardware.
By the time it was clear that the mainframe era was over, it was too late for PL/I to catch on.
I liked PL/I, but I don't miss it.
Why is that?
I think there is a couple of reasons.
Maybe because habit is second nature. When PL/I appeared FORTRAN had already existed for almost 10 years. When some new technology/language appears you can start to disparage existing code base by calling it legacy code. But there is no reason to start conversion immediately. Especially it was big problem in 70s due to the lack of automated converters and other tools.
The next reason might be that there is no silver bullet. PL/I was attempt to create such silver bullet - general purpose language. They tried their best, you know the rest. =) PL/I was monstrous language. Frow Wikipedia article:
Programmers were sharply divided into
scientific programmers (who used
Fortran) and business programmers (who
used COBOL), with significant tension
and even dislike between the groups.
PL/I syntax borrowed from both COBOL
and Fortran syntax. So instead of
noticing features that would make
their job easier, Fortran programmers
of the time noticed COBOL syntax and
had the opinion that it was a business
language, while COBOL programmers
noticed FORTRAN syntax and looked on
it as a scientific language.
Also the "old folks" like FORTRAN evolve under danger of death and added features such as structured programming, object orientation, etc. That reduced PL/I's relative advantages.
P.S. Also take a look at that part of Wikipedia article already mentioned.
Agree with the above, it was something like a Swiss army pocket knife with far too many blades.
As far as compiler availability, there was a project to build a PL/1 front end for the gnu compiler. See http://pl1gcc.sourceforge.net/ (though it looks moribund from the date of the last announcement). Also, http://www.thefreecountry.com/compilers/miscellaneous.shtml mentions a Digital Research PL/1 compiler for MSDOS which was supposedly free for personal use.

How and why are languages formed / Are there any developing languages showing promise? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Question 1: How exactly do modern computer language come into being and why? How do they get their start and who is behind them?
Question 2: If any, what languages currently in their infancy are showing promise?
How exactly do modern computer language come into being and why? How do they get their start and who is behind them?
It's a multistage process:
Pointy-headed type theorists and other professionals are continually proposing new language features. You can read about them in places like the Proceedings of the ACM Symposium on Principles of Programming Languages (POPL), which has been held annually since 1973.
Many of these proposals are actually implemented in some research language; some research languages I personally find promising include Coq and Agda. Haskell is a former research language that made it big. A research language that gets 10 users is often considered a success by its designers. Many research languages never get that far.
From research to deployment I know of two models:
Model A: A talented amateur comes along and synthesizes a whole bunch of existing features, maybe including some new ideas, into a new language. The amateur has talent, charisma, and maybe a killer app. Thus C, Perl, Python, Ruby, and Tcl are born.
Model P: A talented professional make career sacrifices in order to build and promulgate a new language. The professional has talent, a deep knowledge of the field, and maybe a killer app. Thus Haskell, Lua, ML, Pascal, Scala, and Scheme are born.
My definition of a professional is someone who is paid to know about programming languages, to pass on that knowledge, and to develop new knowledge in programming languages. Unfortunately this is not the same as designing and implementing new languages, and it is not the same as making implementations that many people can use. This is why most successful programming languages are designed and built by amateurs, not professionals.
There have been quite a few interesting research languages that have had hundreds or even thousands of users but yet never quite made it big. Of these one of my favorites is probably Icon. I have argued elsewhere that nobody really knows why languages become popular.
Summary: Languages come into being because people want to make programming better, and they have new ideas. Languages get their start when somebody takes a whole bunch of ideas, some new and some proven, and synthesizes them into a coherent whole. It's a big job. The person behind a new language might be a programming-language professional, but historically, most languages that become widely used seem to have been created by talented amateurs.
Answer 2: Fortran 2008 looks very promising.
Come on, bring on the downvotes you humourless Java-teenies, Pythonettes, Rubes and Haskellites !
1) Most development environments these days are built to abstract a lot of low-level/inner workings of an platform to speed up development and cater for new user-interfaces and plaform technologies. There are a both open-source projects and corporates behind these changes... For instance an example would be jQuery is a newish Library that just wraps a lot of javascript making things easier and cross-platform...
Bjarne Stroustrup wrote a book on the history of C++, called "The Design and Evolution of C++".
The genesis of a programming language is always a different story. I'm currently reading "Masterming of programming", which is a series of interview with authors of popular languages. They explain what problems they tackled and how the language was born -- a really cool book.
The TIOBE index can give somehow a trend amongst the programming languages, including the emerging ones. I bet that the future lies in language that will run on top of the JVM or CLR (Notably due to the effort invested in the VMs which are now really great). Concurrency seems to be one of the hot problem of today; so I guess we will see some interesting moves in this area (e.g. Clojure).

Beginners Guide to Haskell? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been looking for a decent guide to Haskell for some time, but haven't been able to find one that seems interesting enough to read through and/or makes sense.
I've had prior exposure to Haskell a few years back, but I can't remember much about it. I remember the "Aha!"-feeling was incredible when I finally got it, and it was actually fun to play with, so I'm looking to rediscover the lost art of Haskell.
I'm familiar with Ruby and its functional programming tricks, so I think I'm not completely in the dark. Any links?
This looks like it fits the bill in the style of Why's Poignant Guide to Ruby.
Learn You a Haskell for Great Good!
Some good places to start are:
The Gentle Introduction To Haskell
Problem Solving in Haskell
Happy Learn Haskell Tutorial
Other resources:
Interesting blog entry on a Study plan for Haskell via the Wayback Machine
HaskellWiki
Generic Haskell User Guide (PDF)
If you're like me, and like videos of presentations, than this is a good tutorial:
A Taste of Haskell
Part 1
Part 2
Slides
It's a three-hour tutorial, that uses xmonad as a running example to explain Haskell to experienced (imperative) programmers.
The presentation is given by Simon Peyton-Jones who, besides being one of the top Haskell designers, is also a great speaker.
Once you get past the beginning stages, I would highly recommend reading Real World Haskell.
The Haskell wikibook which includes the text from the great tutorial Yet Another Haskell Tutorial.
(The "Generic Haskell User Guide" paper is a fine paper, but I think it is a particularly bad recommendation for a beginning Haskell programmer, as it is more of an academic paper presenting extensions to Haskell and basically a different language "Generic Haskell" (i.e. Haskell with an old version of Generics) instead of standard Haskell 98. <irony>If you were looking for dense reading about Haskell, start with the Haskell 98 report.</irony>)
Real World Haskell is a really good book.
Yet Another Haskell Tutorial (PDF) worked for me.
Edit: Updike points out that the text of YAHT has been folded into the Haksell Wikibooks. The PDF is still useful if you (like me) prefer to print out and read on paper.
BTW I have also read A Gentle Introduction To Haskell (also available as PDF). I will definitely not recommend this for beginners. It is only gentle compared to the Haskell Report. However it is a good reference when you have a solid understanding of the language.
A rather late response but I thoroughly enjoyed reading from Learn You A Haskell available online as well as a book.
I've been told to look at
Programming in Haskell, from Graham Hutton
In addition to "Real World Haskell", find a copy of "Haskell: The Craft of Functional Programming". Great textbook.
I like Haskell Tutorial for C Programmers. Especially if you are coming from an imperative language background as I do.
I have downloaded 10 slides from this page http://www.cs.nott.ac.uk/~gmh/book.html and going through it for many times. It workz ;)
Strange that nobody suggested Real World Haskell. That's IMHO the best Haskell book you currently can get you can get it for on or offline reading.
One thing that is really unique about Haskell is that there is a mailing list exactly for beginners. Go to Haskell-Beginners.
Reading books is good, but having some humans to ask is always a great resource, too. Together, I think there is absolutely no reason to say "Haskell is hard to learn because there's no material on it."
You might also want to visit #haskell at irc.freenode.net.
There is also a nice lecture series from the RWTH Achen.
here you will find exams and exercises (possibly in German)
and here are the recordings of the solutions
I got all of this info from the Haskell Wiki's Video presentations page.
This is where I started.
haskell.org

Resources