Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
309ed1b
doc fixes
echatav Feb 7, 2026
55b8d81
Update Grammar.hs
echatav Feb 8, 2026
cdc8f7d
Update Distributor.hs
echatav Feb 8, 2026
6cbf094
Update Grammar.hs
echatav Feb 8, 2026
394c2c8
Update Grammar.hs
echatav Feb 8, 2026
8b74db8
Update Grammar.hs
echatav Feb 8, 2026
c5fe85b
Update Boole.hs
echatav Feb 8, 2026
26cd2b0
Caveat notes
echatav Feb 12, 2026
585702e
Update Grammar.hs
echatav Feb 12, 2026
a640e69
Update Grammar.hs
echatav Feb 12, 2026
bf98817
Update Grammar.hs
echatav Feb 12, 2026
5affb7e
imprism
echatav Feb 16, 2026
ad5bddd
filtration & partiality clarity
echatav Feb 16, 2026
5042384
testing for Brzozowski Matching
echatav Feb 16, 2026
bd04c68
Update Monocle.hs
echatav Feb 16, 2026
1bcabc9
Update Filtrator.hs
echatav Feb 16, 2026
886859b
Update Monocle.hs
echatav Feb 16, 2026
114b1f8
monomorphically
echatav Feb 17, 2026
0a30158
Update Wither.hs
echatav Feb 17, 2026
5f82d43
Update Grammar.hs
echatav Feb 17, 2026
fd1e9a2
Update NestedPrismTH.hs
echatav Feb 17, 2026
4979845
simplify replicateP
echatav Feb 17, 2026
9e19e1e
Update Distributor.hs
echatav Feb 17, 2026
d0d8a56
Update Distributor.hs
echatav Feb 17, 2026
06aa886
Update Main.hs
echatav Feb 17, 2026
03068f4
Initial plan
Copilot Feb 23, 2026
f0ed836
Increment minor version to 0.4.0.0
Copilot Feb 23, 2026
b96bfbe
Correct version to 0.3.0.1
Copilot Feb 23, 2026
7728fa0
Merge pull request #21 from morphismtech/copilot/sub-pr-20
echatav Feb 23, 2026
3f4680a
Initial plan
Copilot Feb 24, 2026
e5805a5
Fix spelling error: Doube -> Double in NestedPrismTH.hs comment
Copilot Feb 24, 2026
e7cf300
Merge pull request #22 from morphismtech/copilot/sub-pr-20
echatav Feb 24, 2026
9b53de6
Update distributors.cabal
echatav Feb 26, 2026
01507df
Update Distributor.hs
echatav Feb 26, 2026
5e83b4f
malternate
echatav Mar 21, 2026
5e17d78
cleaning
echatav Mar 21, 2026
fd7056a
Parsector
echatav Mar 24, 2026
fdf60c0
regex refactor
echatav Mar 24, 2026
3fa808d
Merge branch 'regex-refactor' into parsector-branch
echatav Mar 24, 2026
dc2b61d
Update Parsector.hs
echatav Mar 24, 2026
96c9d09
fix mplus bug
echatav Mar 25, 2026
477c9de
Update Parsector.hs
echatav Mar 26, 2026
5b6b54a
broken tests
echatav Mar 26, 2026
aae4607
changes and stuff
echatav Mar 27, 2026
d4947bf
pureP
echatav Mar 29, 2026
19b4de6
ambulate
echatav Mar 29, 2026
3b44283
docs
echatav Mar 29, 2026
c49fd6e
Update Monoidal.hs
echatav Mar 30, 2026
323d26f
Update Distributor.hs
echatav Mar 30, 2026
fe7eb48
stuuuuf
echatav Mar 30, 2026
315604b
parsector 2
echatav Mar 30, 2026
fd5b2b3
tests
echatav Mar 31, 2026
3ff16f4
Update Symbol.hs
echatav Mar 31, 2026
56af49b
Update Parsector.hs
echatav Mar 31, 2026
93b491f
Update Monadic.hs
echatav Mar 31, 2026
e6760ef
Update Monadic.hs
echatav Mar 31, 2026
8a49fd9
Update Monadic.hs
echatav Mar 31, 2026
e3f7624
Update Monadic.hs
echatav Mar 31, 2026
4ad2e03
Update Grammar.hs
echatav Mar 31, 2026
6932afb
Update Grammar.hs
echatav Apr 1, 2026
468db8b
Update BackusNaur.hs
echatav Apr 1, 2026
8dc103f
Update Parsector.hs
echatav Apr 1, 2026
1841a19
trueB & falseB
echatav Apr 1, 2026
d396876
tests working
echatav Apr 7, 2026
c53d859
Epsilon ~> SeqEmpty
echatav Apr 7, 2026
2f361cd
Merge branch 'regex-refactor' into parsector
echatav Apr 7, 2026
27089fe
Control.Monad.Fail.Try
echatav Apr 7, 2026
8bea5db
separate out modules for
echatav Apr 7, 2026
399ece5
reexports
echatav Apr 7, 2026
d897b9e
sepWith
echatav Apr 8, 2026
f33b1dc
- malternate
echatav Apr 8, 2026
2c950dd
cleaning
echatav Apr 8, 2026
ee9d56b
ParsecState & ParsecError
echatav Apr 8, 2026
386888b
cleaning
echatav Apr 8, 2026
0467543
Update Parsector.hs
echatav Apr 8, 2026
c4f32c8
Update Grammar.hs
echatav Apr 8, 2026
f5f9302
Update Parsector.hs
echatav Apr 8, 2026
d0a5898
Update Parsector.hs
echatav Apr 8, 2026
f2018bc
Update Parsector.hs
echatav Apr 8, 2026
9c3fd81
Update Parsector.hs
echatav Apr 8, 2026
8d61267
Update Parsector.hs
echatav Apr 8, 2026
b0e5c84
Update Parsector.hs
echatav Apr 8, 2026
159bfc0
AndAsIn, AndNotAsIn
echatav Apr 8, 2026
53e4464
Merge branch 'regex-refactor' into parsector
echatav Apr 8, 2026
6f9e1da
fixes
echatav Apr 9, 2026
0dfa0bf
Update Parsector.hs
echatav Apr 9, 2026
ced1b2d
Update Kleene.hs
echatav Apr 9, 2026
c97168c
Update Kleene.hs
echatav Apr 9, 2026
dcf1c4d
property tests
echatav Apr 9, 2026
fd42d2e
changes
echatav Apr 10, 2026
d0a66ad
Update Grammar.hs
echatav Apr 10, 2026
65bbe96
Update Grammar.hs
echatav Apr 10, 2026
7eb3103
LL(1)
echatav Apr 10, 2026
8786858
Update Distributor.hs
echatav Apr 10, 2026
e51d86e
Update Grammar.hs
echatav Apr 10, 2026
21aaae3
Update Parsector.hs
echatav Apr 10, 2026
75bfa33
Update Main.hs
echatav Apr 10, 2026
b433938
version
echatav Apr 10, 2026
386f294
Update BackusNaur.hs
echatav Apr 10, 2026
aaa8c3a
Update BackusNaur.hs
echatav Apr 10, 2026
cc4f341
improve errors with hints
echatav Apr 10, 2026
1095d98
Update BackusNaur.hs
echatav Apr 10, 2026
0c605cc
Update Parsector.hs
echatav Apr 10, 2026
01c8e2b
Update CHANGELOG.md
echatav Apr 10, 2026
4b468c5
Update Grammar.hs
echatav Apr 10, 2026
05da5f7
Update Kleene.hs
echatav Apr 10, 2026
5752072
Update Parsector.hs
echatav Apr 10, 2026
1bc4040
Update Grammar.hs
echatav Apr 10, 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
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# Changelog for `distributors`

## 0.4.0.0 - 2026-04-10

### New Modules

- `Control.Monad.Fail.Try` - `MonadTry` class with `try` & `fail` for backtracking parsers
- `Data.Profunctor.Grammar.Parsector` - Invertible LL(1) parser with Parsec-style error reporting:
`ParsecState`, `ParsecError`, `parsecP`, `unparsecP`; implements hints, LL(1) commitment
via `parsecLooked`, and `try` for explicit backtracking
- `Data.Profunctor.Separator` - Separator/delimiter combinators: `sepWith`, `noSep`,
`beginWith`, `endWith`, `several`, `several1`, `intercalateP`, `chain`, `chain1`
- `Data.Traversable.Homogeneous` - `Homogeneous` class for static containers with uniform elements;
`ditraverse` for distributive traversals

### New Combinators

- `Control.Lens.Grammar.Kleene`: `tokenClass` embedding into `RegEx`; `KleeneAlgebra` laws
as QuickCheck properties; `RegExam` helpers `failExam`, `passExam`, `isFailExam`
- `Control.Lens.Grammar.Boole`: `trueB`, `falseB` added to `BooleanAlgebra`;
`andB`, `orB`, `allB`, `anyB` fold combinators
- `Data.Profunctor.Monadic`: `MonadicTry` constraint alias; `P.return` combinator;
improved documentation for qualified do-notation pattern bonding
- `Data.Profunctor.Distributor`: `manyP` / `optionalP` now place the empty case on
the right of `>+<` for correct LL(1) behaviour (`p >*< manyP p >+< oneP`)

### Changes

- `<|>` in `Parsector` now commits when the left branch consumes input (LL(1));
use `try` to opt into backtracking
- `TokenTest` renamed to `TokenClass` throughout
- `chain`, `chain1`, `intercalateP` moved from `Data.Profunctor.Distributor`
to the new `Data.Profunctor.Separator`
- `BackusNaurForm`: `rule` documentation clarified; added reference to Breitner's
*Showcasing Applicative*

### Testing

- `test/Properties/Kleene` - QuickCheck properties for `KleeneStarAlgebra`,
`TokenAlgebra`, `BooleanAlgebra TokenClass`
- `test/Examples/Chain` - Chain grammar example
- `test/Main`: `testCtxGrammarExample` extended with `parsecG` / `unparsecG` round-trip checks

## 0.3.0.0 - 2026-02-05

### New Modules
Expand Down
9 changes: 8 additions & 1 deletion distributors.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 2.2
-- see: https://github.com/sol/hpack

name: distributors
version: 0.3.0.0
version: 0.4.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
Expand Down Expand Up @@ -41,11 +41,15 @@ library
Control.Lens.Monocle
Control.Lens.PartialIso
Control.Lens.Wither
Control.Monad.Fail.Try
Data.Profunctor.Distributor
Data.Profunctor.Filtrator
Data.Profunctor.Grammar
Data.Profunctor.Grammar.Parsector
Data.Profunctor.Monadic
Data.Profunctor.Monoidal
Data.Profunctor.Separator
Data.Traversable.Homogeneous
other-modules:
Paths_distributors
autogen-modules:
Expand Down Expand Up @@ -116,12 +120,14 @@ test-suite test
main-is: Main.hs
other-modules:
Examples.Arithmetic
Examples.Chain
Examples.Json
Examples.Lambda
Examples.LenVec
Examples.RegString
Examples.SemVer
Examples.SExpr
Properties.Kleene
Paths_distributors
autogen-modules:
Paths_distributors
Expand Down Expand Up @@ -168,6 +174,7 @@ test-suite test
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
build-depends:
MemoTrie >=0.6 && <1
, QuickCheck >=2.14 && <3
, adjunctions >=4.4 && <5
, base >=4.15 && <5
, bifunctors >=5.5 && <6
Expand Down
3 changes: 2 additions & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: distributors
version: 0.3.0.0
version: 0.4.0.0
github: "morphismtech/distributors"
license: BSD-3-Clause
author: "Eitan Chatav"
Expand Down Expand Up @@ -97,3 +97,4 @@ tests:
- distributors
- doctest >= 0.18 && < 1
- hspec >= 2.7 && < 3
- QuickCheck >= 2.14 && < 3
1 change: 1 addition & 0 deletions src/Control/Lens/Bifocal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import Control.Lens.PartialIso
import Data.Profunctor
import Data.Profunctor.Distributor
import Data.Profunctor.Filtrator
import Data.Profunctor.Separator
import Witherable

{- | `Bifocal`s are bidirectional parser optics.
Expand Down
4 changes: 2 additions & 2 deletions src/Control/Lens/Diopter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module Control.Lens.Diopter
import Control.Lens
import Control.Lens.Internal.Profunctor
import Data.Profunctor.Distributor
import Data.Traversable.Homogeneous
import Data.Void
import GHC.Generics

Expand All @@ -41,8 +42,7 @@ type Diopter s t a b = forall p f.
(Distributor p, Applicative f)
=> p a (f b) -> p s (f t)

{- | If you see `ADiopter` in a signature for a function,
the function is expecting a `Diopter`. -}
{- | `ADiopter` is monomorphically a `Diopter`. -}
type ADiopter s t a b =
Dioptrice a b a (Identity b) -> Dioptrice a b s (Identity t)

Expand Down
Loading
Loading