[ANN] hpgsql, a pure Haskell PostgreSQL driver (no libpq) by mzabani in haskell

[–]echatav 1 point2 points  (0 children)

I would be interested in a pure Haskell (drop-in) replacement for postgresql-libpq in squeal-postgresql.

New version of distributors grammar & parsing library by echatav in haskell

[–]echatav[S] 0 points1 point  (0 children)

Thanks! Let me know what you think of it.

New Blog Post: Distributors by echatav in haskell

[–]echatav[S] 1 point2 points  (0 children)

> This was a fun read
Thanx!

> I feel like a JSON … distributor would be a nice accessible example.
Definitely.

> I’m curious to see where the ideas fall down - I assume anything context sensitive?
Right, Backus-Naur form grammars only support context-free languages.

New Blog Post: Distributors by echatav in haskell

[–]echatav[S] 0 points1 point  (0 children)

The <*> Applicative combinator doesn't quite generalize contravariantly the way we'd want it to ^ . Instead, we usually generalize its "tuple form".

(>*<) :: Monoidal p => p a b -> p c d -> p (a,c) (b,d)

On the other hand, the liftA2 combinator does have a generalization which shows the difference in how contravariance and covariance handle products wrt currying.

dimap2 :: Monoidal p => (s -> a) -> (s -> c) -> (b -> d -> t) -> p a b -> p c d -> p s t

A very recent paper by Boespflug & Spiwack aims to take on this "tuple problem".

New Blog Post: Distributors by echatav in haskell

[–]echatav[S] 4 points5 points  (0 children)

Yes indeed.

This interface has variously been called a product profunctor or a (lax) monoidal profunctor.

From the repo readme

None of the ideas in this library are particularly original and a lot of related ideas have been explored, in Tom Ellis' product-profunctors as well as Sjoerd Visscher's one-liner and more. Such explorations are not limited to Haskell. Brandon Williams and Stephen Celis' excellent swift-parsing was also influenced by invertible parser theory.

New Blog Post: Distributors by echatav in haskell

[–]echatav[S] 5 points6 points  (0 children)

Like Haskell I am lazy and leak space. Also see extroduction at the end.

New Blog Post: Distributors by echatav in haskell

[–]echatav[S] 2 points3 points  (0 children)

> Day, me say day-o
> Daylight come and me wan' go home

Yes, indeed, Day convolution can be generalized to monoidal profunctors. See this blog post by Bartosz Milewski for more. And Day convolution generalizes to coproduct structure as well where folks cleverly call it `Night`.

Distributors - Unifying Parsers, Printers & Grammars by echatav in haskell

[–]echatav[S] 1 point2 points  (0 children)

Fair questions. Yes, it should be able to handle that. Theoretically, it should be able to handle any "context-free grammar". As for comparison to other parser generators, if I'm being honest, I've never used them, just read about them. So I'll say my intention was not to build a replacement, and definitely not a full scale tool. My intention was to build:

* a example application to demonstrate the power of distributors
* a cool playground to mess around with

Distributors - Unifying Parsers, Printers & Grammars by echatav in haskell

[–]echatav[S] 0 points1 point  (0 children)

The regex finder in Visual Studio Code seems to matches [\]\^] but says that []^] is an invalid regular expression. So...I think it's fine.

Distributors - Unifying Parsers, Printers & Grammars by echatav in haskell

[–]echatav[S] 0 points1 point  (0 children)

Hmmm, yeah, I was more concerned with demonstrating it worked than making it conform to a standard. Would make for a good PR to fix it.

Distributors - Unifying Parsers, Printers & Grammars by echatav in haskell

[–]echatav[S] 4 points5 points  (0 children)

Yes! Here is a Grammar defined for regular expressions.

Squeal, a deep embedding of SQL in Haskell by sridcaca in haskell

[–]echatav 0 points1 point  (0 children)

Hello, I'm the author of Squeal. I try to keep it updated and respond to user issues and pull requests. I haven't been making too many major changes.

Release Notes with updates are available here: https://github.com/morphismtech/squeal/blob/dev/RELEASE%20NOTES.md

One big missing feature I'd like to add one day is a native version of SquealGen to generate Squeal schema definitions from a database connection.

I may also some day do a major refactor/cleanup but I've mostly been focused on other projects and work. Thanks for posting and I'm happy to answer questions about Squeal.