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

Is there something like a "standard" HTTP client library and also a SQL abstraction library in Haskell nowadays, that everyone is using? Similar to what 'requests' and 'SQLAlchemy' are in Python?

I feel those would be the two libraries that I would probably miss the most when switching to Haskell for a project.

Groundhog (http://hackage.haskell.org/package/groundhog) is a nice "ORM" for Haskell. If you need something more flexible you can drop down and write raw SQL with postgresql-simple (http://hackage.haskell.org/package/postgresql-simple). There's also a corresponding mysql-simple package.

There are several HTTP clients:

http-streams (http://hackage.haskell.org/package/http-streams)

http-conduit (http://hackage.haskell.org/package/http-conduit)

wreq (http://hackage.haskell.org/package/wreq)

I'll second the groundhog suggestion.

It is much more flexible than persistent. If you are not doing an yesod project (for what persistent is the standard), you should think about using it.

Have a look at Haskell Toolbox: http://haskell-toolbox.com/

Woops, I lost steam a little on that project. How did you find it?

Thanks to positive experiences with The Ruby Toolbox and The Clojure Toolbox, I usually search for "X toolbox" whenever I start experimenting with a new language.

I like the idea behind it, but it does indeed seem a little unfinished. Esp. the metric for top packages (most dependencies from other packages in this category) seems flawed, since some other apparently popular libraries mentioned in this thread, don't appear there at all (e.g. wreq, persistent or esqueleto).

I think "#stars on Github" could be an interesting metric to add. Thanks for your effort in creating this site.

wreq and persistent are probably the closest libs to what you've listed for python

Persistent is an ORM that doesnt support SQL stuff entirely. So replacement for SQLAlchemy ORM but not Core

If you want to be at the same level of abstraction as SQLAlchemy Core, you'll want to try esquelito (a SQL DSL).

Thanks for pointing this out. I would indeed be looking for a replacement for SQLAlchemy Core, since I usually avoid ORMs.

Esqueleto looks like it would fit the bill, since it does offer composability of queries, automated migrations, and protection against SQL-injections.

Ah thanks, I wasn't familiar with that part of SQLAlchemy

wai and warp are the haskell packages that pretty much every haskell webserver framework are built on. they are very battle-tested and mature

I also want to say wreq for http and persistent/esqueleto for SQL alchemy equivalent.

I've heard good things about Servant as an HTTP client library.

Servant is built on wai and warp and is more of a DSL for writing APIs.

It's a fantastic framework, but it's not an 'http client library' as such.

servant-client is nice but quite different from 'requests'. And i'd also argue it supports a more limited set of use-cases due to having to specify the endpoint as a Rest type api.

Servant can do HTTP but it's more of a library for REST APIs.

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