This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
Scrap Your Boilerplate in f#
I'm missing the sort generic traversal and transformation libraries that I have in Haskell when I'm working in F#.
Has anyone looked at doing something like Uniplate/Biplate for F#?
There's a brief mention in the comments of one of Neil Mitchell's blog posts, but I never found any further development:
http://neilmitchell.blogspot.com/2008/09/general-updates.html
I imagine you could build something on .NET reflection instead of type-classes, but I don't want to dig too deep without looking at prior art.
See
Scrap Your Boilerplate in f#
Related
This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Haskell linear algebra?
I am wondering whether is there any standard library to present a matrix and all its operators in Haskell? I am quite new to Haskell, so if you have experience handling with matrix, please give me some example if you can.
I don't have firsthand experience with it, but hmatrix is a go-to package for matrices in Haskell.
As for examples, there are dozens of good ones in the package file, in the "examples" directory. You can get the package file by running cabal unpack hmatrix, or just download it here.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Suggestions for writing a programming language?
I have used many programming languages and after several years of experience I have finally decided to make a language with my friends. I know that this is a task not for the faint of heart. We are devoted to the task and are going to make sure that this gets completed.
Now I wanted to start off by asking: what are the steps to writing a programming language? What should we start off with (ex. The parser)?
Any answer is helpful!
If this is your first language, then work on all parts of it at the same time, start with a mini language spec and extend it feature by feature. Unless a its a domain specific language you should use a language that comes close to what you try to implement so that later you might be able to write a conversion tool to get a bootstrapping version of your compiler.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Is Haskell a Lisp?
Many people who have worked on Lisp told me that Haskell is one of the dialects of Lisp. I searched on internet but could not find the proper answer. Can somebody explain regarding this?
No, it isn't. See: http://www.haskell.org/haskellwiki/History_of_Haskell
They're playfully referring to rich metaprogramming and multi-paradigm capabilities of Lisp which allow using various programming styles, which may also lead to thinking of all other languages as merely particular cases of Lisp. Some implementations of Lisp family languages, like Racket implementation of Scheme, contain features also seen in Haskell, like static types, pattern matching or lazy evaluation.
And remember that
Whoever does not understand LISP, is doomed to reinvent it
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm currently working on the topic of programming-languages and interpreter-design. I have already created several programming languages but couldn't reach my goal so far:
Create a programming-language which focuses on giving the programmer a good feeling when writing code in it. It should just be fun and/or interesting and in no case annoying to write something in it.
I get this feeling when writing code in Python. I sometimes get the opposite with PHP and in rare cases when having to reinvent some wheel in C++.
So I've tried to figure out some syntactical features to make programming in my new language fun, but I just can't find any.
Which concrete features, maybe mainly in terms of syntax, do/could make programming in a language fun?
Examples:
I find it enjoyable to program in Ruby because of it's use of code blocks.
It would be nice if you could include exactly one example in your answer
Those features do not have to already exist in any language!
I'm doing this because I have experienced extreme rises in (my own) productivity when programming in languages I love (because of particular features).
You mentioned Ruby in your question. AFAIK, Ruby is the only programming language, for which Joy is an actual, stated, explicit design goal. (In fact, it is the only design goal.)
The reason that Yukihiro Matsumoto was able to design Ruby this way, is that he already knew and used tons of programming languages before he started designing Ruby and learned tons more in order to design Ruby. (Interestingly, he didn't know Python, and has said that he probably wouldn't have created Ruby if he did.)
Here's just a tiny fraction of the languages that matz has either used himself, or looked at for inspiration (or in some cases for inspiration what not to do):
CLU
Sather
Lisp
Scheme
Smalltalk
Perl
Python
Haskell
Scala
PHP
C
C++
Java
C#
Objective-C
Erlang
And I believe that this is one way that good programming languages can be designed (what Larry Wall calls postmodernist language design): Throw away everything that didn't work in the past, take everything that worked and combine that tastefully.
Of course, this requires that you actually know all those languages from which you want to "steal" and in particular, it requires that you know lots of very different languages with different paradigms, different concepts and different "feels", otherwise the idea pool from which you steal is rather small and inbred.
Consistency.
Its the feeling that you already know something when you use an API or feature you've never used before. It also makes you more productive as you don't have to learn something new for the sake of it.
I think this is also one of the Ruby 'likes', in that if you follow the naming convention, things start to 'just work' without bindings and glue and suchlike.
For example, using the STL in C++, many of the algorithms are the same for all containers - even strings. That makes it nice to use... except for those parts that do not follow the same API (eg vector of bools) then the difference is more noticable.
Two things to keep in mind are orthogonality and the principle of least surprise.
A programming language should make it easy to write correct programs and difficult (if not impossible) to write incorrect programs. For instance, in Java
long x = 2000000000 + 2000000000;
overflows, while
long x = 2000000000L + 2000000000;
doesn't. Is this obvious? I don't think so. Does anyone ever want something to overflow? I don't think so.
Hilarity.
http://lolcode.com/
Follow common practices (like using + for addition, & for bitwise/logical and)
Group logicaly-similar code in namespaces
Have an extensive string processing library
Incorporate debugging facilities
For a cross-platform language, try to minimize platform differences as much as possible
A language feature that appears simple and easy to learn surprises and delights the programmer with its unexpected power. I nominate Haskell type classes :-)
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