HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
tomjaguarpaw
haskell-opaleye
Haskell2014–2021
tomjaguarpaw / haskell-opaleye

haskell-opaleye

Discover this repository through its Hacker News conversations.

3Distinct people
10Mentions
1Explicit recommenders
619GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A public description has not been verified.

Where it is used

No documented product use has been verified yet.

What people are saying

> the majority of my modeling needs to be done in the database and merely wrapped with Haskell I highly recommend Opaleye for this (with the caveat that I'm the primary…

tome used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year10 dated mentions

Observed mentions: 2014-12-05 17:04:35 UTC to 2021-07-10 08:36:26 UTC.

01232014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20142015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC101
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC303
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC303
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101

What Hacker News says

10 sources
The only way out that I can see is to design embedded domain specific languages (EDSLs) that inherit the expressiveness, composability and type safety from the host language. That's what Opaleye and Rel8 (Postgres EDSLs for Haskell do. Haskell is particularly good for this. The query language can be just a monad and therefore users can carry all of their knowledge of monadic programming to writing database queries. This approach doesn't resolve all of the author's complaints but it does solve many. Disclaimer: I'm the author of Opaleye. Rel8 is built on Opaleye. Other relational query EDSLs are available. [1] https://github.com/tomjaguarpaw/haskell-opaleye/ [2] https://github.com/circuithub/rel8/
In Against SQL
Two potential counter-examples to your productive software claim: Opaleye [0], an Arrow-based [1] DSL for Postgres SQL that allows the user to create type-safe, composable, and (generally) optimally fast SQL queries. Halogen [2], a type-safe frontend framework for PureScript [3] that models view component interaction as an algebraic datatype containing query actions (among other fairly advanced concepts). If someone is used to a certain level of abstraction, then the higher levels might seem unnecessary until they invest the time into learning them. The only thing unique to functional programming is that it has inherited a lot of terms from theory (profunctor, monad, algebra) rather than inventing friendlier ones. [0] https://github.com/tomjaguarpaw/haskell-opaleye [1] https://www.haskell.org/arrows/ [2] https://github.com/slamdata/puresc
Read the rest
In Standardized Ladder of Functional Programming [pdf]
tome·Nov 18, 2015Recommendation phrase
> the majority of my modeling needs to be done in the database and merely wrapped with Haskell I highly recommend Opaleye for this (with the caveat that I'm the primary author!). From the Opaleye front page: > Opaleye is a Haskell library that provides an SQL-generating embedded domain specific language for targeting Postgres. You need Opaleye if you want to use Haskell to write typesafe and composable code to query a Postgres database. > "Opaleye really is great. You've managed to bring what is so wonderful about relational databases and give it type safety and composition (i.e. what is wonderful about Haskell)" – Daniel Patterson, Position Development https://github.com/tomjaguarpaw/haskell-opaleye/
In Anatomy of a Haskell-based Application
Some corrections/comments/questions: > Opaleye ... no join support (simulated via sub selects) This is true for exactly one reason: despite being raised frequently, nobody has ever been able to demonstrate any performance difference between subselects and joins (in Postgres)! As soon as someone does, they should file an issue (https://github.com/tomjaguarpaw/haskell-opaleye/issues/) and I'll add joins forthwith. > Opaleye ... tough syntax to parse What do you mean by this? The Haskell syntax of Opaleye, or the generated SQL? > Esqueleto ... Postgres only You're incorrect about this. From your Esqueleto link: "It has many kinds of backends, such as SQL backends (persistent-mysql, persistent-postgresql, persistent-sqlite) and NoSQL backends (persistent-mongoDB)." > Esqueleto ... can't/doesn't prevent invalid sql But you're right about th
Read the rest
is.
In Opaleye’s sugar on top: SQL in the type system
Honestly none of the statically typed sql generators (Opaleye included) really tick all the boxes; all are lacking in one way or another. Here's a breakdown of the leaders of the pack on this front[0] Haskell 1) Opaleye[1]: composable and prevents invalid sql, but no join support (simulated via sub selects), Postgres only, and tough syntax to parse. 2) Esqueleto[2]: composable, readable, supports joins, but Postgres only, and the DSL can't/doesn't prevent invalid sql (which is, IIRC, one of the reasons why Opaleye came into being). Scala 1) Slick[3] myriad databases supported (Oracle and SQL Server require non-free license), join support, fully composable (really, king of monad hill), and elegant syntax (until you `groupBy`/`sortBy` and then enter unreadble tuple_.1, tuple._N soup). Also, grouping requires flattening result set via min, m
Read the rest
ax, sum, etc. aggregate function so not possible to return tuple representing say, a User, when grouping. Suggested workaround is to group on the client (and send a million rows over the wire to app server, ok o_O). 2) Squeryl[4] myriad databases supported (all free), join support, sql-like syntax, but lacks compositionality of aforementioned and relies on runtime reflection to make the DSL go. Microsoft LINQ to SQL/Objects myriad databases supported (not sure of driver licensing), excellent sql-like syntax, and type providers straight other worldly, but lacks compositionality and is tied to Windows (until *nix support lands). [0] There are likely (many) others but these are the statically typed ones I'm aware of. Feel free to add others, curious to see what's out there (e.g. OCaml must have something) [1] https://github.com/tomjaguarpaw/haskell-opaleye [2] https://github.com/prowdsponsor/esqueleto [3] https://github.com/slick/slick [4] https://github.com/squeryl/squeryl
In Opaleye’s sugar on top: SQL in the type system

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.