Hacker News new | past | comments | ask | show | jobs | submit login

Oh my, another tutorial. I've looked at many of them, trying to learn something from the Haskell way. And I think I get the fundamental advantages of the type systems, the lazy evaluation enabled by the languages purity, I think I can somehow make sense of the Monads even. I have the "learn you a haskell for good" on a pile of books where I have a glimpse from time to time.

Most tutorials and books are very enthusiastic in how they can detect that I try to zip two lists of different cardinality during compile time, or how they can lazily calculate the Fibbonacci sequence. And that's really nice and fine...

But nevertheless, I use C all of the time, and I learnt how to make use of a myriad of libraries, combine connections to a SQL database, embedd a webserver, talk to USB,... Must have been 20 years ago that I wrote code to calculate the Fibbonacci sequence.

So, where are tutorials that showcase all the wonderful "high-level" functionality that has already been written for Haskell, so that I, after reading through the text, will be thrilled how much work I can avoid, or how much security I can gain when switching over from my "almost bare-matel not-much-more-like-an-assembler C" to Haskell? Not in calculating the Fibunacci sequency, but in writing a backend for my web-app, or talk to a USB peripheral? Do 3D graphics?...




If all you've done is looked at tutorials and glimpsed at a book, I think it's very unlikely that you actually get the advantages or really understand any of the patterns like Monads. Write some code. The only way that you'll actually grok the language and get any of the benefits from learning it is if you actually write code in it.


I know your comment is more targeted at tutorials, but in case you don't know the book Real World Haskell explores, as the name implies, some real world problems: http://book.realworldhaskell.org/read/


Agreed compared to RWH, LYAH was next to useless for me. RWH could use a refresh though (published in 2008), hopefully a 2nd edition will be in the works at some point.


I feel like the defunct PLEAC site page on Haskell sums up most autodidactic folks experience with Haskell: http://pleac.sourceforge.net/pleac_haskell/index.html

Oh cool, you can do everything, right up to something useful. At which point you should use this library for side effects, no wait, this new library, oh wait, have you tried this new feature that's only in the latest GHCi and w/ the right Data import? ... eh, maybe I'll pass.

Still doesn't stop me from playing around now and thien. Right now the resources here: http://www.seas.upenn.edu/~cis194/

and the new book Beginning Haskell, seem to be alright.


There are helpful tutorials for all of the things you've mentioned. I think that part of the problem is that people don't go looking for these things. If you want to write a backend for a web-app, there are three frameworks that are all mature: Snap, Yesod, and Happstack. There are tutorials, books, and documentation for all of these frameworks. If you want to do 3D graphics, there are some pretty straightforward bindings to OpenGL, again with tutorials and documentation. If you want to talk to a USB peripheral, there's the usb-safe. For databases, there are a myriad of options and tutorials for those.

The tutorials are all out there, but one is going to have to have a pretty solid grasp on Haskell before one can understand them, just like with any other language.


> For databases, there are a myriad of options and tutorials for those

Where? The only half appealing type safe query DSL that I've found for Haskell is Esqueleto, and that features a blank github readme[1] o_O

[1] https://github.com/meteficha/esqueleto


Groundhog is pretty awesome[1]. Persistent also works, but it does some wonky stuff on SQL databases. Acid-state is really neat! Of course, there's stuff like postgresql-simple, but that's not very type safe.

[1]https://www.fpcomplete.com/school/to-infinity-and-beyond/pic...

Edit: Also, esqueleto has a pretty okay looking hackage page[2], but I've never used esqueleto, so I don't really know.

[2]http://hackage.haskell.org/package/esqueleto


Did not know about Groundhog, thanks. Looking into the docs Groundhog does not support joins (same deal with Persistent), which I'd say is a deal breaker for most (non-trivial) applications.

Acid-state is a different beast entirely, seems to be similar to Clojure's Datomic.

That leaves us with Esqueleto for real world type safe database access (with no SQL Server or Oracle support).

I want to jump ship from Scala to Haskell but there are some gaps to be filled yet before leaving the batteries included Java ecosystem.


Does esqueleto not do it for you? Can you be explitit about whats missing for you? Is it just oracle or sql server support?


Do you have any experience with Database Supported Haskell (DSH) [1]? I've just recently found it and it seems very nice. I didn't have the time to test it though.

[1] https://hackage.haskell.org/package/DSH


No, I don't. That seems really cool though! Thanks for pointing that out.


This tutorial itself has a zip file of non-trivial examples, if you scroll down to the last section.


These kinds of questions feels like they're treading the fine line between being honest inquiries, and dares.


Of course you don't have to believe me, but I'm genuinely puzzled why apparently most tutorials spend such an disproportionate amount on these more theoretical explanations.

One explanation of course might be that a lot of the crowd looking into this are coming from a computer-science background where they are more enthusiastic about the basics. And to them, the fact that (after a lot of coding chores, writing up libraries) it eventually will make sql-injection harder, or parallel handling of web-service faster will be seen just as a logical consequence not worth making a lot of fuzz about.

But for attracting a larger community one has to make the gains for the average programmer more visible.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: