Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
284 commits
Select commit Hold shift + click to select a range
88fc57a
comonad
echatav Oct 26, 2025
e3c2001
trichotomy restored
echatav Oct 26, 2025
2d1a046
genRegEx
echatav Oct 26, 2025
c74e8fc
Update Grammar.hs
echatav Oct 26, 2025
24530a3
noToken, notToken
echatav Oct 26, 2025
8e69c33
Update Grammar.hs
echatav Oct 26, 2025
e444b05
Update Grammar.hs
echatav Oct 26, 2025
6cae1d0
genGram
echatav Oct 26, 2025
38ae9f4
Update Grammar.hs
echatav Oct 26, 2025
0580f6e
move RegEx
echatav Oct 26, 2025
806affb
Update Grammar.hs
echatav Oct 26, 2025
0940131
Update Token.hs
echatav Oct 27, 2025
0a6872d
Update Kleene.hs
echatav Oct 27, 2025
8cd2724
Update BackusNaur.hs
echatav Oct 27, 2025
9538fc5
Update BackusNaur.hs
echatav Oct 27, 2025
0086720
Update Grammar.hs
echatav Oct 27, 2025
c5c4f36
escaped
echatav Oct 27, 2025
753ec45
Update BackusNaur.hs
echatav Oct 27, 2025
dac613b
EBNF
echatav Oct 27, 2025
7b64860
move equator
echatav Oct 27, 2025
11f5bf2
equator
echatav Oct 27, 2025
bdddcb9
Equator'
echatav Oct 27, 2025
a31a45b
Update Symbol.hs
echatav Oct 27, 2025
bd6ca57
Update Kleene.hs
echatav Oct 27, 2025
b5c9d87
Update Kleene.hs
echatav Oct 27, 2025
3a6bb1d
Update Kleene.hs
echatav Oct 27, 2025
f9c40d9
Update Grammar.hs
echatav Oct 27, 2025
4018cb4
Update Grammar.hs
echatav Oct 27, 2025
49a955c
Update Grammar.hs
echatav Oct 27, 2025
35233bb
escape
echatav Oct 27, 2025
70bcf93
Update Kleene.hs
echatav Oct 27, 2025
4d2227e
escapes
echatav Oct 27, 2025
bc681ac
Update Kleene.hs
echatav Oct 27, 2025
47a060c
Update BackusNaur.hs
echatav Oct 27, 2025
cc03e8a
Update Grammar.hs
echatav Oct 27, 2025
44f7dd6
streamLine
echatav Oct 27, 2025
f34898a
Update Kleene.hs
echatav Oct 27, 2025
a7d3db6
Update Kleene.hs
echatav Oct 27, 2025
4165ada
Update Equator.hs
echatav Oct 27, 2025
83e441f
Update Token.hs
echatav Oct 28, 2025
5423b81
Update Grammar.hs
echatav Oct 28, 2025
e48c2f6
Update Stream.hs
echatav Oct 28, 2025
a90fa19
Update Symbol.hs
echatav Oct 28, 2025
5f0b543
Update Grammar.hs
echatav Oct 28, 2025
c275baa
Update PartialIso.hs
echatav Oct 28, 2025
6bb961a
Gram ~> BNF
echatav Oct 28, 2025
7508824
Update Grammar.hs
echatav Oct 28, 2025
34ce8f8
MonadicError
echatav Oct 28, 2025
187ddba
Update PartialIso.hs
echatav Oct 28, 2025
32f1d41
chain work
echatav Oct 29, 2025
9994e1c
Update BackusNaur.hs
echatav Oct 29, 2025
f49e110
Update Grammar.hs
echatav Oct 29, 2025
ec459b4
Update Stream.hs
echatav Oct 29, 2025
f30f437
Update BackusNaur.hs
echatav Oct 29, 2025
cab1967
notAny
echatav Oct 29, 2025
0bd86f9
Update BackusNaur.hs
echatav Oct 29, 2025
a0ec582
Context
echatav Oct 31, 2025
fea9936
Update Grammar.hs
echatav Oct 31, 2025
8abd66f
Update Context.hs
echatav Oct 31, 2025
d2422a0
Reador
echatav Nov 1, 2025
d3fd1c4
StreamM
echatav Nov 2, 2025
cdb0190
simplify Stx
echatav Nov 2, 2025
32da242
Update Grammar.hs
echatav Nov 2, 2025
75dc18d
Update Grammar.hs
echatav Nov 2, 2025
07db4ca
Update Grammar.hs
echatav Nov 2, 2025
8d8e7b1
Update Grammar.hs
echatav Nov 2, 2025
ff5cf40
Update Grammar.hs
echatav Nov 2, 2025
f4d648e
Update Context.hs
echatav Nov 2, 2025
12741f0
- MonadPlus
echatav Nov 2, 2025
3c1b16f
Test
echatav Nov 6, 2025
fd61d0b
golfing
echatav Nov 6, 2025
04a2a4d
Update Grammar.hs
echatav Nov 6, 2025
f86fd1c
Update Monadic.hs
echatav Nov 11, 2025
14f3da8
Update Monadic.hs
echatav Nov 11, 2025
7f57c36
Update Monadic.hs
echatav Nov 11, 2025
ec40af1
Update Monadic.hs
echatav Nov 11, 2025
d454646
Update Grammar.hs
echatav Nov 15, 2025
5170c45
lots
echatav Dec 4, 2025
36fe23f
stuff
echatav Dec 4, 2025
0fad093
fix grammar & tests
echatav Dec 4, 2025
f6d4ae3
Update Token.hs
echatav Dec 4, 2025
fe5f98f
names
echatav Dec 4, 2025
31ca6eb
evalGrammor_
echatav Dec 4, 2025
ec8c7dc
fix atomG
echatav Dec 4, 2025
c1bd68c
Update Grammar.hs
echatav Dec 4, 2025
a4440ed
Update Grammar.hs
echatav Dec 4, 2025
14cdf29
Update Grammar.hs
echatav Dec 5, 2025
eb45edc
fromTokens
echatav Dec 5, 2025
31ccc80
Update Token.hs
echatav Dec 5, 2025
733e21a
Update Token.hs
echatav Dec 5, 2025
aa55af2
anyG & failG
echatav Dec 5, 2025
aa1d7ca
Reador
echatav Dec 5, 2025
655cd66
Update Grammar.hs
echatav Dec 5, 2025
118b13e
Update Grammar.hs
echatav Dec 5, 2025
980a596
Update Grammar.hs
echatav Dec 5, 2025
669a76a
Update Grammar.hs
echatav Dec 6, 2025
cda2bf2
TokenAlgebra
echatav Dec 6, 2025
ba380b1
Update Kleene.hs
echatav Dec 6, 2025
2f57472
Boole
echatav Dec 6, 2025
0171c23
optimize local
echatav Dec 6, 2025
df773c6
mfiltrate
echatav Dec 6, 2025
3d4d737
Update Grammar.hs
echatav Dec 6, 2025
445e018
Update Monadic.hs
echatav Dec 6, 2025
48a939e
monochrome
echatav Dec 6, 2025
acd04ed
dodo
echatav Dec 6, 2025
6fe4f1c
Update Do.hs
echatav Dec 6, 2025
7f1269b
stuuf
echatav Dec 7, 2025
be83247
Update Spec.hs
echatav Dec 7, 2025
b45449c
Update Monadic.hs
echatav Dec 7, 2025
f3c1282
Update Grammar.hs
echatav Dec 7, 2025
35fe6eb
move mfilter
echatav Dec 7, 2025
46cd6ee
Update Filtrator.hs
echatav Dec 7, 2025
315b81a
Update Grammar.hs
echatav Dec 7, 2025
8e3189a
Update Grammar.hs
echatav Dec 7, 2025
a3e006f
monochrome optics
echatav Dec 8, 2025
6ab4a26
Monadic Do
echatav Dec 8, 2025
8de46c3
Update Monadic.hs
echatav Dec 8, 2025
22f539b
MonadFix stuff
echatav Dec 8, 2025
9b32f5a
dododo
echatav Dec 8, 2025
d2334fa
Update Polyadic.hs
echatav Dec 8, 2025
f687b52
Update Polyadic.hs
echatav Dec 8, 2025
2d74a61
moduuuules
echatav Dec 8, 2025
a98ced6
Update Monadic.hs
echatav Dec 8, 2025
6845ba7
pair bonding notation
echatav Dec 9, 2025
0ac78ca
Create TODO
echatav Dec 9, 2025
8f2ead5
replicateN
echatav Dec 10, 2025
1ac26e2
PP
echatav Dec 20, 2025
472ed44
Grammar.Do
echatav Dec 20, 2025
8b0b36a
do stuff
echatav Dec 20, 2025
192d7c1
Update Monadic.hs
echatav Dec 20, 2025
2b72208
Update Polyadic.hs
echatav Dec 20, 2025
d8f53ee
remove Equator
echatav Dec 20, 2025
e372bf5
Merge pull request #18 from morphismtech/polyadic-branch2
echatav Dec 20, 2025
57783f9
remove failB & passB
echatav Dec 20, 2025
911b1c3
Update Grammar.hs
echatav Dec 20, 2025
3a972ce
Update Boole.hs
echatav Dec 21, 2025
f8e2103
removal
echatav Dec 22, 2025
cc65ec3
removal
echatav Dec 22, 2025
ced024d
Update Grammar.hs
echatav Dec 22, 2025
18e055b
Update Monadic.hs
echatav Dec 22, 2025
a75c479
simplify
echatav Feb 1, 2026
b033aaa
names
echatav Feb 1, 2026
a501817
Snoc unparseP
echatav Feb 1, 2026
2ef0287
Update Filtrator.hs
echatav Feb 1, 2026
f7bd99f
Update Grammar.hs
echatav Feb 1, 2026
643cf4f
Delete TODO
echatav Feb 1, 2026
9473281
simplify regular expression language
echatav Feb 1, 2026
35b67ac
add empty doctest
echatav Feb 1, 2026
26b1dd7
some module headers
echatav Feb 1, 2026
8fac021
Update stack.yaml
echatav Feb 1, 2026
7efc2f6
Update stack.yaml
echatav Feb 1, 2026
7f99a76
Update Monadic.hs
echatav Feb 1, 2026
7982e66
more regex simplification
echatav Feb 1, 2026
6b7e6a1
char-any
echatav Feb 1, 2026
23ff179
Update Main.hs
echatav Feb 1, 2026
9be609f
Update Grammar.hs
echatav Feb 1, 2026
1efbbce
Revert "Update Grammar.hs"
echatav Feb 1, 2026
972c7bd
Reapply "Update Grammar.hs"
echatav Feb 1, 2026
1e8ffb3
Update Main.hs
echatav Feb 1, 2026
838dc12
Update Grammar.hs
echatav Feb 1, 2026
9fa52fc
Update Token.hs
echatav Feb 1, 2026
d26b148
Update PartialIso.hs
echatav Feb 1, 2026
44bbdbb
docs
echatav Feb 2, 2026
2c2d306
tokens & terminal
echatav Feb 2, 2026
c762fd0
Update Grammar.hs
echatav Feb 2, 2026
1e8696b
docs
echatav Feb 2, 2026
48ccdcc
Update Grammar.hs
echatav Feb 2, 2026
b6ec2dd
Update Kleene.hs
echatav Feb 2, 2026
ad8a156
Update Monadic.hs
echatav Feb 2, 2026
db16ee5
docs & one-of grammar
echatav Feb 2, 2026
b8cea04
optionP
echatav Feb 2, 2026
9775d6b
Update Grammar.hs
echatav Feb 2, 2026
0f7a5ac
Update Main.hs
echatav Feb 2, 2026
8e020dc
Update Grammar.hs
echatav Feb 2, 2026
4541bd7
Update Grammar.hs
echatav Feb 2, 2026
5e228b0
Update Distributor.hs
echatav Feb 2, 2026
3e35270
Update Filtrator.hs
echatav Feb 2, 2026
89dc38e
Generators
echatav Feb 2, 2026
031393c
Update Main.hs
echatav Feb 2, 2026
bbf113c
Update Main.hs
echatav Feb 2, 2026
cdc4121
Update Grammar.hs
echatav Feb 2, 2026
12e3cad
Update Grammar.hs
echatav Feb 2, 2026
db9503d
Update Grammar.hs
echatav Feb 2, 2026
986c167
Update Kleene.hs
echatav Feb 2, 2026
721333c
docs
echatav Feb 2, 2026
5413f6b
Update BackusNaur.hs
echatav Feb 2, 2026
5a4630b
Update Main.hs
echatav Feb 2, 2026
2fc2f76
Boole Docs
echatav Feb 2, 2026
48fcf1f
partialInvoluted
echatav Feb 2, 2026
7f9ef40
docs
echatav Feb 2, 2026
811dd10
Update Monoidal.hs
echatav Feb 2, 2026
2ea5c44
Update Monoidal.hs
echatav Feb 2, 2026
9ea57c6
Update Distributor.hs
echatav Feb 2, 2026
781ed22
Enum (Categorize token)
echatav Feb 2, 2026
b04036d
doctests
echatav Feb 2, 2026
ed16995
Update Main.hs
echatav Feb 2, 2026
78c2be6
Update Token.hs
echatav Feb 2, 2026
88a7e2a
Update Token.hs
echatav Feb 2, 2026
d15a44f
Update Token.hs
echatav Feb 2, 2026
dcfd6c7
Update Distributor.hs
echatav Feb 2, 2026
2eaad80
Update Token.hs
echatav Feb 2, 2026
a47e7c1
Update BackusNaur.hs
echatav Feb 2, 2026
2ee9a2e
Update ci.yml
echatav Feb 2, 2026
9a27071
docs
echatav Feb 2, 2026
a1e955c
Update BackusNaur.hs
echatav Feb 3, 2026
ecb49cf
Matching instances
echatav Feb 3, 2026
9583a06
Lexical
echatav Feb 3, 2026
1c371c7
Lexical
echatav Feb 3, 2026
77dba00
Update Token.hs
echatav Feb 3, 2026
5f19528
examples and tests
echatav Feb 4, 2026
b2063cd
Update Main.hs
echatav Feb 4, 2026
12d8b80
Update Main.hs
echatav Feb 4, 2026
932b51c
doctest Arith Grammar
echatav Feb 4, 2026
d4c1eb0
SemVer
echatav Feb 4, 2026
48cb276
Update Json.hs
echatav Feb 4, 2026
de60563
Update Grammar.hs
echatav Feb 4, 2026
84dd630
mawr
echatav Feb 4, 2026
3967f98
Update Token.hs
echatav Feb 4, 2026
ff95102
tests and fixes
echatav Feb 5, 2026
7e96281
Update RegString.hs
echatav Feb 5, 2026
0af76f8
Update Grammar.hs
echatav Feb 5, 2026
73a3fe6
Update RegString.hs
echatav Feb 5, 2026
ff1b2a8
Update Grammar.hs
echatav Feb 5, 2026
c35512f
anyLike
echatav Feb 5, 2026
8be4f43
Update Grammar.hs
echatav Feb 5, 2026
2f21a7f
docs
echatav Feb 5, 2026
acc0b5e
LenVec
echatav Feb 5, 2026
a538ddd
Claud fixed Printor Monad!
echatav Feb 5, 2026
b2a82e7
Update Grammar.hs
echatav Feb 5, 2026
06127c4
Update Grammar.hs
echatav Feb 5, 2026
179f4bf
context grammars and testing
echatav Feb 5, 2026
55d57d2
Update Grammar.hs
echatav Feb 5, 2026
baf157f
Update Grammar.hs
echatav Feb 5, 2026
2370c71
Update SemVer.hs
echatav Feb 5, 2026
5c59eb6
Update Grammar.hs
echatav Feb 5, 2026
9fe9f5a
Merge branch 'main' into monadic-grammatic
echatav Feb 5, 2026
b985683
remove Like
echatav Feb 5, 2026
be91640
fix not
echatav Feb 5, 2026
bf3a2e0
Update Grammar.hs
echatav Feb 5, 2026
8fb2346
stuff
echatav Feb 5, 2026
2935fa9
conjoin tests
echatav Feb 5, 2026
0ea37e3
2026
echatav Feb 5, 2026
09e0b39
Update package.yaml
echatav Feb 5, 2026
67c10ee
Update distributors.cabal
echatav Feb 6, 2026
db45c2a
bounds
echatav Feb 6, 2026
3780df4
Update CHANGELOG.md
echatav Feb 6, 2026
ad0975e
bounds
echatav Feb 6, 2026
3582db1
Update README.md
echatav Feb 6, 2026
dd7fb77
Update LICENSE
echatav Feb 6, 2026
6ec59e9
Update README.md
echatav Feb 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Haskell Stack
uses: haskell/actions/setup@v2
uses: haskell-actions/setup@v2
with:
enable-stack: true

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ stack.yaml.lock
tags
.*.swp
.qodo
SCRATCH
SCRATCH*
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog for `distributors`

## 0.3.0.0 - 2026-02-05

### New Modules

- `Control.Lens.Grammar` - Grammar hierarchy based on Chomsky's formal grammar classification
- `Control.Lens.Grammar.BackusNaur` - Context-free grammar combinators (BNF)
- `Control.Lens.Grammar.Boole` - Boolean algebra for grammars
- `Control.Lens.Grammar.Kleene` - Regular expression combinators
- `Control.Lens.Grammar.Symbol` - Symbol-level grammar primitives
- `Control.Lens.Grammar.Token` - Token-level grammar primitives
- `Data.Profunctor.Filtrator` - Filterable profunctors
- `Data.Profunctor.Grammar` - Grammar profunctor abstraction
- `Data.Profunctor.Monadic` - Monadic profunctor combinators with QualifiedDo support
- `Data.Profunctor.Monoidal` - Monoidal profunctor combinators

### Removed Modules

- `Text.Grammar.Distributor` - Functionality split into the new modules above

### Testing

- Added `doctest` for documentation testing
- New test examples: Arithmetic, Json, Lambda, LenVec, RegString, SemVer, SExpr

## 0.2.0.0 - 2025-07-08

Added some combinators for `RegEx`es. Updated documentation.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright Eitan Chatav (c) 2024
Copyright Eitan Chatav (c) 2026

All rights reserved.

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ The term "distributor" is a synonym for "[profunctor](https://ncatlab.org/nlab/s

Since "profunctor" became the standard nomenclature, we reappropriate "distributor" to describe a profunctor on a [distributive category](https://ncatlab.org/nlab/show/distributive+category).

This library provides a study of `Monoidal` profunctors, `Distributor`s, `Alternator`s and `Filtrator`s. These profunctor constraints are analogous to `Applicative`, `Alternative` and `Filterable` functors. Examples of `Distributor`s will include printers and parsers, and it is demonstrated how to write a single term for both. Profunctors naturally give rise to optics and this library also studies some previously discovered optics, `PartialIso`s, `Monocle`s, `Grate`s and `Wither`s and also defines new optics, `Diopter`s and `Bifocal`s. Finally, an application of distributors is demonstrated by unifying Backus-Naur form grammars with invertible parsers, giving users a powerful playground for language syntax design.
This library provides a study of distributor theory and optics,
and their application to invertible grammar theory.

## previous work

Expand All @@ -28,6 +29,11 @@ While `Distributor`s in the library are lax distributive endoprofunctors, a math

The idea for unifying Backus-Naur grammars with parsers comes from Joachim Breitner in a post [Showcasing Applicative](https://www.joachim-breitner.de/blog/710-Showcasing_Applicative).

The idea for using monadic profunctors for reversible context-free grammars
comes from Li-Yao Xia, in some posts and a paper but particularly
this post on [Monadic profunctors for bidirectional programming]
(https://blog.poisson.chat/posts/2017-01-01-monadic-profunctors.html).

The person deserving the most credit for bringing the power of optics to programming, with his [lens library](https://github.com/ekmett/lens/), is Ed Kmett, to whom I am very grateful for teaching me a lot.

None of the ideas in this library are particularly original and a lot of related ideas have been explored, in Tom Ellis' [product-profunctors](https://github.com/tomjaguarpaw/product-profunctors) as well as Sjoerd Visscher's [one-liner](https://github.com/sjoerdvisscher/one-liner) and more. Such explorations are _not_ limited to Haskell. Brandon Williams and Stephen Celis' excellent [swift-parsing](https://github.com/pointfreeco/swift-parsing) was also influenced by invertible parser theory.
Expand Down
4 changes: 2 additions & 2 deletions blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,12 @@ Just as `Alternative` has 0-or-more `many` and 0-or-1 `optional` combinators, we

```Haskell
optionalP :: Distributor p => p a b -> p (Maybe a) (Maybe b)
optionalP p = mapIso maybeEot (oneP >+< p)
optionalP p = mapIso eotMaybe (oneP >+< p)

manyP :: p a b -> p [a] [b]
manyP p = mapIso listEot (oneP >+< p >*< manyP p)

maybeEot :: Iso (Maybe a) (Maybe b) (Either () a) (Either () b)
eotMaybe :: Iso (Maybe a) (Maybe b) (Either () a) (Either () b)

listEot
:: (Cons s s a a, AsEmpty t, Cons t t b b)
Expand Down
75 changes: 50 additions & 25 deletions distributors.cabal
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
cabal-version: 2.2

-- This file has been generated from package.yaml by hpack version 0.37.0.
-- This file has been generated from package.yaml by hpack version 0.39.1.
--
-- see: https://github.com/sol/hpack

name: distributors
version: 0.2.0.1
version: 0.3.0.0
synopsis: Unifying Parsers, Printers & Grammars
description: Distributors provides mathematically inspired abstractions for coders to write parsers that can also be inverted to printers.
category: Profunctors, Optics, Parsing
homepage: https://github.com/morphismtech/distributors#readme
bug-reports: https://github.com/morphismtech/distributors/issues
author: Eitan Chatav
maintainer: eitan.chatav@gmail.com
copyright: 2025 Eitan Chatav
copyright: 2026 Eitan Chatav
license: BSD-3-Clause
license-file: LICENSE
build-type: Simple
Expand All @@ -30,13 +30,22 @@ library
exposed-modules:
Control.Lens.Bifocal
Control.Lens.Diopter
Control.Lens.Grammar
Control.Lens.Grammar.BackusNaur
Control.Lens.Grammar.Boole
Control.Lens.Grammar.Kleene
Control.Lens.Grammar.Symbol
Control.Lens.Grammar.Token
Control.Lens.Grate
Control.Lens.Internal.NestedPrismTH
Control.Lens.Monocle
Control.Lens.PartialIso
Control.Lens.Wither
Data.Profunctor.Distributor
Text.Grammar.Distributor
Data.Profunctor.Filtrator
Data.Profunctor.Grammar
Data.Profunctor.Monadic
Data.Profunctor.Monoidal
other-modules:
Paths_distributors
autogen-modules:
Expand All @@ -49,7 +58,9 @@ library
ConstraintKinds
DataKinds
DefaultSignatures
DeriveFoldable
DeriveFunctor
DeriveTraversable
DeriveGeneric
DerivingStrategies
DerivingVia
Expand All @@ -65,12 +76,13 @@ library
LambdaCase
MagicHash
MonoLocalBinds
OverloadedStrings
QualifiedDo
QuantifiedConstraints
RankNTypes
RecursiveDo
ScopedTypeVariables
StandaloneDeriving
StandaloneKindSignatures
TemplateHaskell
TupleSections
TypeApplications
Expand All @@ -80,28 +92,36 @@ library
UndecidableSuperClasses
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
build-depends:
adjunctions >=4.4 && <5
, base >=4.7 && <5
, bifunctors >=5.6 && <6
MemoTrie >=0.6 && <1
, adjunctions >=4.4 && <5
, base >=4.15 && <5
, bifunctors >=5.5 && <6
, bytestring >=0.11 && <1
, containers >=0.6 && <1
, contravariant >=1.5 && <2
, distributive >=0.6 && <1
, lens >=5.2 && <6
, mtl >=2.3 && <3
, lens >=5.0 && <6
, mtl >=2.2 && <3
, profunctors >=5.6 && <6
, tagged >=0.8 && <1
, template-haskell
, template-haskell >=2.17 && <3
, text ==2.*
, th-abstraction
, vector >=0.13 && <1
, th-abstraction >=0.4 && <1
, vector >=0.12 && <1
, witherable >=0.4 && <1
default-language: Haskell2010

test-suite spec
test-suite test
type: exitcode-stdio-1.0
main-is: Spec.hs
main-is: Main.hs
other-modules:
Examples.Arithmetic
Examples.Json
Examples.Lambda
Examples.LenVec
Examples.RegString
Examples.SemVer
Examples.SExpr
Paths_distributors
autogen-modules:
Paths_distributors
Expand All @@ -113,7 +133,9 @@ test-suite spec
ConstraintKinds
DataKinds
DefaultSignatures
DeriveFoldable
DeriveFunctor
DeriveTraversable
DeriveGeneric
DerivingStrategies
DerivingVia
Expand All @@ -129,12 +151,13 @@ test-suite spec
LambdaCase
MagicHash
MonoLocalBinds
OverloadedStrings
QualifiedDo
QuantifiedConstraints
RankNTypes
RecursiveDo
ScopedTypeVariables
StandaloneDeriving
StandaloneKindSignatures
TemplateHaskell
TupleSections
TypeApplications
Expand All @@ -144,22 +167,24 @@ test-suite spec
UndecidableSuperClasses
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
build-depends:
adjunctions >=4.4 && <5
, base >=4.7 && <5
, bifunctors >=5.6 && <6
MemoTrie >=0.6 && <1
, adjunctions >=4.4 && <5
, base >=4.15 && <5
, bifunctors >=5.5 && <6
, bytestring >=0.11 && <1
, containers >=0.6 && <1
, contravariant >=1.5 && <2
, distributive >=0.6 && <1
, distributors
, hspec
, lens >=5.2 && <6
, mtl >=2.3 && <3
, doctest >=0.18 && <1
, hspec >=2.7 && <3
, lens >=5.0 && <6
, mtl >=2.2 && <3
, profunctors >=5.6 && <6
, tagged >=0.8 && <1
, template-haskell
, template-haskell >=2.17 && <3
, text ==2.*
, th-abstraction
, vector >=0.13 && <1
, th-abstraction >=0.4 && <1
, vector >=0.12 && <1
, witherable >=0.4 && <1
default-language: Haskell2010
32 changes: 18 additions & 14 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: distributors
version: 0.2.0.1
version: 0.3.0.0
github: "morphismtech/distributors"
license: BSD-3-Clause
author: "Eitan Chatav"
maintainer: "eitan.chatav@gmail.com"
copyright: "2025 Eitan Chatav"
copyright: "2026 Eitan Chatav"

extra-source-files:
- README.md
extra-doc-files:
- CHANGELOG.md


category: Profunctors, Optics, Parsing
synopsis: Unifying Parsers, Printers & Grammars
description:
Distributors provides mathematically inspired abstractions
for coders to write parsers that can also be inverted to printers.

dependencies:
- base >= 4.7 && < 5
- base >= 4.15 && < 5
- adjunctions >= 4.4 && < 5
- bifunctors >= 5.6 && < 6
- bifunctors >= 5.5 && < 6
- bytestring >= 0.11 && < 1
- containers >= 0.6 && < 1
- contravariant >= 1.5 && < 2
- distributive >= 0.6 && < 1
- lens >= 5.2 && < 6
- mtl >= 2.3 && < 3
- lens >= 5.0 && < 6
- MemoTrie >= 0.6 && < 1
- mtl >= 2.2 && < 3
- profunctors >= 5.6 && < 6
- tagged >= 0.8 && < 1
- template-haskell
- template-haskell >= 2.17 && < 3
- text >= 2 && < 3
- th-abstraction
- vector >= 0.13 && < 1
- th-abstraction >= 0.4 && < 1
- vector >= 0.12 && < 1
- witherable >= 0.4 && < 1

ghc-options:
Expand All @@ -56,7 +56,9 @@ default-extensions:
- ConstraintKinds
- DataKinds
- DefaultSignatures
- DeriveFoldable
- DeriveFunctor
- DeriveTraversable
- DeriveGeneric
- DerivingStrategies
- DerivingVia
Expand All @@ -72,12 +74,13 @@ default-extensions:
- LambdaCase
- MagicHash
- MonoLocalBinds
- OverloadedStrings
- QualifiedDo
- QuantifiedConstraints
- RankNTypes
- RecursiveDo
- ScopedTypeVariables
- StandaloneDeriving
- StandaloneKindSignatures
- TemplateHaskell
- TupleSections
- TypeApplications
Expand All @@ -87,9 +90,10 @@ default-extensions:
- UndecidableSuperClasses

tests:
spec:
main: Spec.hs
test:
main: Main.hs
source-dirs: test
dependencies:
- distributors
- hspec
- doctest >= 0.18 && < 1
- hspec >= 2.7 && < 3
Loading