Functionally Solving Problems With Haskell
learnyouahaskell.com
learnyouahaskell.com
All of the "Functional Pearls" papers are worth a read, but Bird's book is such a compressed, convenient, powerful collection of advanced functional problem solving style that I think anyone interested in "thinking" functionally should strive to read it.
It's not exactly for the faint of heart, to be clear. Bird's idea is that we can establish certain mathematical rules which allow us to transform "the simplest thing which could possibly be correct" to an efficient program through a series of steps, each one maintaining correctness as an invariant.
[0] http://www.amazon.com/Pearls-Functional-Algorithm-Design-Ric...
Understanding join is pretty valuable for understanding Monads too.
And then go study Monads because why not. They're kind of cool, too.
I also toot F#'s horn because it has an amazing resource for learning how to use functional style in your programs: http://fsharpforfunandprofit.com/site-contents/
A few pages on that site did more for me regarding functional programming than the entirety of LYAH did, and it also has a very nice monad tutorial: http://fsharpforfunandprofit.com/posts/computation-expressio...
F# is a .NET language.
The language can compile into CIL, javascript, and a handful of other build targets.
I don't believe this is true, at least not easily.
I really like Standard ML in that sense. Unfortunately, seems to be fading away in sense of popularity.
http://channel9.msdn.com/Series/C9-Lectures-Dr-Don-Syme-Intr...
http://channel9.msdn.com/Series/C9-Lectures-Erik-Meijer-Func...
Anyway, I needed to do a small .NET work two years ago. I choose to try F#. It was the first and only time I got highly please by another language features. Actually, I've to admit that I was pissed of : F# may well be a better language than Haskell.
It seems like the primary purpose of using a typed provider is so that the types (classes) can dynamically change during runtime (for example, you get different table objects for the different connection strings you pass in). But how do you program a client against an API that can change at will? Is your client code just basically doing runtime reflection on the data the type provider returns?
It seems like a useful feature but far from the power of having full macros.
http://bitemyapp.com/posts/2014-03-25-when-nested-io-actions...
It seems that 'this' here must not refer to the parent post (https://news.ycombinator.com/item?id=7538461):
> Also, if you don't want to make the full leap into "PURE EVERYTHING MUST STAY CLEAN DONT BREAK THE RULES" style code, try Haskell. Imperative programming in Haskell is great! The language evaluation rules may be purely function, but your code doesn't need to be.
with which you seem to be agreeing. Perhaps it refers to the grandparent post (https://news.ycombinator.com/item?id=7537877), specifically to its implicit claim that Haskell programming involves "PURE EVERYTHING MUST STAY CLEAN DONT BREAK THE RULES"?
Let's just all go through our favorite 3 year old books and post HN articles about every chapter that strikes our fancy why don't we?
main = print "Hello, world!"
Is that really interesting enough to rush to?In case of LYAH (or Haskell in general) you have GHCi at hand, an interactive interpreter. That's what LYAH sets up in the very first chapter, and uses throughout the rest of the book.
How can anyone seriously code in a language which introduces new kind of bugs which cannot be detected by any test until running in production on real data when it is already too late?
Most of you here should stop writing BS about Haskell and how it is going to save the world.
> I never said that. Your argument was that this is specific to Haskell which is not.
It is specific to lazily evaluated languages, especially Haskell. To test Haskell program you will need a real environment under heavy load - maybe Google or Amazon could afford it. Tiny unit tests which are perfect for strictly evaluated languages won't detect these kid of bugs.
I never said that. Your argument was that this is specific to Haskell which is not.
> You need real data under heavy load for Haskell.
How is this different from other languages?
> This is a _fact_.
Using "_" does not replace an actual argument ;)
> Most of you here should stop writing BS about Haskell and how it is going to save the world.
I fact, I wrote the opposite in the parent of your post.
- Haskell does not have "a new kind of bugs". It's an ordinary programming language with ordinary bugs.
- The bugs you put in your program are not any more or less undetectable before production compared to unstable than they are in other languages.
I agree that Haskell has some good (old) ideas and it is pleasant to Sunday programmers.
Judging from the other comments, it's clear you have an axe to grind. I'm leaving this thread as well.