Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good state-of-the-art examples of Arrows in action?

Tags:

haskell

arrows

I've been reading about arrows lately, a concept invented more than 10 years ago. It allows to get more static information about computations compared to monads, while still having the power of computations depending on the previous ones.

However I couldn't find them used in recent state-of-the-art libraries. For example attoparsec doesn't even have an Arrow instance, even though arrows were designed to speed up parsing.

Are there some nice examples of Arrows used in currently developed libraries or executables, which bring performance or other benefits?

(I understand that this is kind of a soft question - my aim is to get better understanding of the concept and its advantages.)

like image 931
Petr Avatar asked Jun 25 '16 19:06

Petr


1 Answers

Checkout this tutorial for opaleye. Arrows are used extensively throughout (in addition to profunctors). The library offers a way to write composable, typesafe Postgres queries. I don't have much experience using it, but it seems like it is a well designed library, and is supposedly a good choice if you're using Postgres in the backend. Ben Kolera has a good video introduction to the library here.

like image 184
liminalisht Avatar answered Nov 15 '22 07:11

liminalisht