Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Anybody know of solid super-entry level tutorials for starting Web Development with Haskell with less opinionated libraries like Scotty? Something that shows you how to slap together a solid cabal sandboxed ready-to-deploy application that's a mix of Scotty/Persistant/Esqueleto and all the other basics?

Clojure has "Web Development with Clojure" which is basically what I listed above, except for Clojure rather than Haskell.



I gave a talk at a Haskell meetup in London this week that covered some of this - the slides won't really be useful standalone, but I could probably re purpose them to a blog post fairly easily if you're interested?


Not sure about the OP, but I'd definitely love to read that.


Ditto


I know I would be very interested in this.


Please do, that sounds fantastic. Also, which meetup were you speaking at?



Would be pretty interested.


Sorry I missed the talk! Did it get videoed? They usually are.


Not this time I'm afraid. The format was 3 short talks so we didn't bother videoing.


Yes Please. Do you have a link to your blog?


I just figured out how to do this yesterday, here's the source of my barebones Scott/Persistent/Esqueleto app. All it does is insert some records into the db (sqlite), then runs a server that displays the first entry. (The entry is mixed into the scotty tutorial because I stopped as soon as I got something working). https://github.com/cgag/comments

I may write up a blogpost on getting this far. It's mostly based on this: https://www.fpcomplete.com/school/starting-with-haskell/libr... . I didn't do much beyond figure out explictly using L.fromStrict to deal with conflicting interpretations of overloaded-strings and figuring out how where to put my fillDB and getComments functions in main. I initially tried to call these within the scotty monad, but I think doing it that way would have required learning about monad transformers.

I'm hoping to eventually turn this into a simple disqus alternative that should be lightweight and easy to distribute as a binary.


There is this tutorial: http://adit.io/posts/2013-04-15-making-a-website-with-haskel...

Although it uses virthualenv instead of a cabal sandbox.


I read that article a few weeks ago in order to get a basic personal site server running on Heroku. I used a standard cabal setup and updated a few things.

end result here, which I think should serve as a good starter point for developing with Scotty:

https://github.com/chrissrogers/chrissrogers.com

For Heroku builds I used the following excellent buildpack

https://github.com/begriffs/heroku-buildpack-ghc


+1 thanks! Nice example. Scotty is appealing to me because it has a Sinatra like feel to it.


for a true beginner, it starts with an outdated cabal definition for virthualenv/hsenv that has specific old versions. nobody will be able to just copy and paste trhu the tutorial.

but it seems well written if you can get past that point. Most beginners won't though.


Post author here. I just updated the post to use cabal sandboxes.


At the lowest level, the Snap Framework is not at all opinionated. The base level of the framework is comprised of snap-core and snap-server. snap-core is a web server API roughly on the level of Yesod's wai with maybe a little more slightly higher-level functionality. snap-server is Snap's web server that implements the snap-core API--roughly equivalent to Yesod's warp.

I personally don't understand the draw of scotty because as soon as you want to start doing more substantial web development, you're going to want higher level abstractions. The Snap Framework adds to this in a pretty flexible and not-too-opinionated way with snaplets which are implemented in the snap package. The snap package also contains a few core snaplets that almost every application will want out of the box like sessions, auth, and a snaplet for Heist templating. The Heist part is the only place where the snap package gets opinionated. But you are definitely not locked into using Heist. You could very easily use Yesod's Hamlet, HStringTemplate, hastache, or anything else. Heist just happens to be the direction that the core Snap developers seem to prefer.


I am rading that book right now, is amazing. It makes Clojure so much easy, and the tutorials are well paced as explained.


I can't help you with the tutorials, but snap and happstack are no more opinionated than scotty. They just have documentation and a collection of useful libraries you can use with them.




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

Search: