Questions tagged [haxl]

Haxl is a Haskell library that simplifies access to remote data, such as databases or web-based services.

Haxl is a Haskell library that simplifies access to remote data, such as databases or web-based services.

Useful links

6 questions
13
votes
1 answer

Applicative instance for MaybeT m assumes Monad m

I've been using the Haxl monad (described here: http://www.reddit.com/r/haskell/comments/1le4y5/the_haxl_project_at_facebook_slides_from_my_talk), which has the interesting feature that <*> for its Applicative instance isn't the same as ap from…
davidsd
  • 771
  • 4
  • 18
6
votes
1 answer

How to use Applicative for concurrency?

This is a follow-up to my previous question. I copied the example below from Haxl Suppose I am fetching data from a blog server to render a blog page, which contains the recent posts, popular posts and posts topics. I have the following Data…
Michael
  • 41,026
  • 70
  • 193
  • 341
5
votes
1 answer

Concurrent data access as in Haxl and Stitch

This is a follow-up to my previous question. As I understand from Haxl and Stitch they use a monad for data access. The monad is actually a tree of data access commands. The children are the commands the node depends on. The siblings are executed…
Michael
  • 41,026
  • 70
  • 193
  • 341
2
votes
1 answer

Code reuse in Haxl - avoiding GADT constructor-per-request-type

Haxl is an amazing library, but one of the major pain points I find is caused by the fact that each sort of request to the data source requires its own constructor in the Request GADT. For example, taking the example from the tutorial: data…
RichardW
  • 899
  • 10
  • 15
1
vote
1 answer

Using monomorphic functions with polymorphic Haxl library?

I'm using the Haxl library and I'm trying to implement fetchHTML concurrently: import Data.Aeson import Control.Concurrent.Async import Control.Concurrent.QSem import Haxl.Core import Haxl.Prelude instance DataSource' u HTTPRequest where fetch =…
Babra Cunningham
  • 2,949
  • 1
  • 23
  • 50
0
votes
1 answer

Packing a value in an existential type knowing only a type class

Further to my goal of reducing the boilerplate required to use Haxl with a relational database, I am trying to package up the result of a raw SQL request via Persistent in an existentially quantified type. However the type checker won't allow…
RichardW
  • 899
  • 10
  • 15