Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
a00a4e8
JSON grammars, disjunctive monoids & cocartesian choice
echatav Nov 5, 2026
206c287
Update Json.hs
echatav Nov 5, 2026
5181ec4
Data.Profunctor.Monoidal.Cocartesian, split from Distributor
echatav Nov 5, 2026
c4a2670
pun "err or"
echatav Nov 5, 2026
04bca43
Update Distributor.hs
echatav Nov 5, 2026
258f495
Update Json.hs
echatav Nov 5, 2026
6f55733
Update Json.hs
echatav Nov 5, 2026
3c3f763
!=
echatav Nov 6, 2026
2d5588a
jsonTypes examples
echatav Nov 6, 2026
ecb4151
fix typescript name collision
echatav Nov 6, 2026
ab2a9aa
Update Json.hs
echatav Nov 6, 2026
fc4be76
Update Json.hs
echatav Nov 6, 2026
cc9b084
Split into distributors-core & distributors-json packages
echatav Nov 6, 2026
57f53c7
Build with stack, cabal or nix, & revisit CI
echatav Nov 6, 2026
0f8ad1a
Type JSON as JsonType, declared in TypeScript by a grammar
echatav Nov 6, 2026
9146b23
Rename SyntaxKind to TsTokenCategory; pin CI's hpack to Stack's
echatav Nov 6, 2026
86accd7
Add jsonTsPut, putting TypeScript declarations to a handle
echatav Nov 6, 2026
a7a40ec
Remove tsPrint & tsParse, interpreting the grammars where they're used
echatav Nov 6, 2026
58a0104
withOperators: Operator patterns are prisms
echatav Nov 6, 2026
90cc95f
Parse TypeScript by Parsector, scanning without trivia
echatav Nov 6, 2026
fe59753
Parsector: direct sequencing, choice & profunctor methods
echatav Nov 5, 2026
9e4539c
Parsector: terminal & manyP in loops
echatav Nov 5, 2026
56ba987
Parsector: specialise stream instances to String
echatav Nov 5, 2026
8a868d1
Printor: direct tokens, literals, repetition & maps; specialise
echatav Nov 5, 2026
4ca474e
HLint: Printor's strict pair matches are deliberate
echatav Nov 6, 2026
48253ae
Print enumerations by index
echatav Nov 6, 2026
d141e66
Rename the TypeScript syntax: TsType, TsProperty, TsPropertyName, TsL…
echatav Nov 6, 2026
e98b1a6
Enumerable sums & Comonocles
echatav Nov 7, 2026
3845566
Update Monoidal.hs
echatav Nov 7, 2026
94dea9a
Update Json.hs
echatav Nov 7, 2026
2dfd888
Update TypeScript.hs
echatav Nov 7, 2026
d2a02b7
TypeScript declaration files, after the compiler
echatav Nov 7, 2026
0fbbbab
comonocles
echatav Nov 7, 2026
adf5389
Fix CI: haddock-project flags & an hlint suggestion
echatav Nov 7, 2026
3274607
elements
echatav Nov 7, 2026
d0c1cca
number keys
echatav Nov 7, 2026
50645ba
Update Json.hs
echatav Nov 7, 2026
6a0b60f
Update Monocle.hs
echatav Nov 7, 2026
cfc6031
enumerable stuff
echatav Nov 7, 2026
24ef65f
enum stuff
echatav Nov 7, 2026
d2f4b83
homogeneous
echatav Nov 7, 2026
0d31de3
Drop jsonNumberKey: type number keys as strings
echatav Nov 7, 2026
7428997
Run doctests with doctest-parallel, under cabal & stack
echatav Nov 7, 2026
6d66ce9
Test Zipporah's laws for profunctors & functors besides (->) & Maybe
echatav Nov 7, 2026
9ccd6c3
bird is the word
echatav Nov 7, 2026
48138d4
Fix the docs job: ignore GHC environment files when building haddocks
echatav Nov 7, 2026
7295391
Drop CI's docs jobs, which main's Docs workflow replaces
echatav Nov 7, 2026
b77e74e
Merge branch 'main' into json-algebra
echatav Nov 7, 2026
a7e976c
Update Monocle.hs
echatav Nov 7, 2026
037d312
optics
echatav Nov 7, 2026
7b33a04
Merge branch 'main' into json-algebra
echatav Nov 7, 2026
9a71e16
Add jsonNullable: null or a value, without an Either for each
echatav Nov 8, 2026
339b4cc
Order eotMaybe & eotList's summands as their constructors
echatav Nov 8, 2026
ba53826
Add jsonInteger & jsonNatural, printed as aeson prints them
echatav Nov 8, 2026
c89344f
Encode object keys once, when building a printer, not per value
echatav Nov 8, 2026
b37c24f
Compile grammars at their types: break the JsonTup/JsonObj superclass…
echatav Nov 8, 2026
bb65054
Encode an array's elements as they're rendered, without a list
echatav Nov 8, 2026
6d74a60
Write a Value array's elements evaluated, not as thunks
echatav Nov 8, 2026
d247c95
Compile derived Json instances: default json to jsonGeneric directly
echatav Nov 8, 2026
6f81f75
Update Json.hs
echatav Nov 8, 2026
323f094
Add jsonEnum, an enumeration by a Comonocle's copies & their names
echatav Nov 8, 2026
31912b6
Unify jsonOmitField & jsonOmittedField as a prism, jsonOmitted
echatav Nov 8, 2026
1ac0dfa
Rename enumerated & enumed to _Enumerable & _BoundedEnum
echatav Nov 8, 2026
3e33c26
Untangle core from grammars: MonadicTry & terminal separators move up
echatav Nov 8, 2026
8587e28
Split the grammars into their own package, distributors-grammar
echatav Nov 8, 2026
7b2fe69
Merge remote-tracking branch 'origin/main' into json-algebra
echatav Nov 8, 2026
c00deef
Bump distributors to 0.7.0.0, for the grammars' split
echatav Nov 8, 2026
514a5d0
Move the internal modules to Control.Lens.Internal.Distributors
echatav Nov 8, 2026
a68f588
Update Json.hs
echatav Nov 8, 2026
baa5b1a
Rename Control.Lens.Internal.Distributors to the singular Distributor
echatav Nov 8, 2026
c30bc4c
Read RegString & RegBnf as String reads, so that read . show = id
echatav Nov 8, 2026
5dce657
Document why each TypeScript grammar is regular or contextual
echatav Nov 8, 2026
d7e650c
Complete ViaJson's aeson instances: omitted fields & keys
echatav Nov 8, 2026
45a413c
Update Json.hs
echatav Nov 8, 2026
af02816
Fix haddock links: out-of-scope & ambiguous identifiers, fixP's doc
echatav Nov 8, 2026
e50c603
Update Monoidal.hs
echatav Nov 8, 2026
a1ca4f4
Print pairs directly, by a jsonPair method
echatav Nov 8, 2026
27a45b3
Use uncurry in the generic pair, as HLint suggests
echatav Nov 8, 2026
36bed17
Print single-property objects & small arrays directly
echatav Nov 8, 2026
439e015
Parse an array of a primitive at once
echatav Nov 8, 2026
ad5aeb4
Keep parsing arrays at once through parsors' combinators
echatav Nov 8, 2026
cad6b9b
Parse maps of text keys by mapping their keys
echatav Nov 8, 2026
ce67c00
Inline Monoidal's product combinators & the printors' Applicative met…
echatav Nov 8, 2026
356f41c
Rename RegExam to TokenExam, & move token classes to Token
echatav Nov 8, 2026
0cfcc7e
Update Token.hs
echatav Nov 8, 2026
8a11ccd
Make RegEx's & TokenClass's monoids associative, by lists
echatav Nov 8, 2026
685c1f8
Encode two or more items in Sequence's & Alternate's types
echatav Nov 8, 2026
1e89f18
Split Comonocle into its own module & merge Separator into Distributor
echatav Nov 9, 2026
319009e
Benchmark real-world documents, from aeson's benchmarks
echatav Nov 9, 2026
24f1651
Split Enumerable into its own module, & rename Indexing to Enumerator
echatav Nov 9, 2026
bec6b5b
Add Data.Traversable.Homogeneous.Vectorial
echatav Nov 9, 2026
e67f749
Base Vectorial on Representable, with a basis Comonocle, _Basis
echatav Nov 9, 2026
d911d48
Remove Data.Traversable.Homogeneous.Vectorial
echatav Nov 9, 2026
364a02b
Add enumerateFromThen, enumerateFromTo & enumerateFromThenTo
echatav Nov 9, 2026
9a5d752
Fix Haddock links & typos, and cite parsec for infixP
echatav Nov 9, 2026
b12eef3
List distributors-grammar in the README; drop removed Bool1 & Orderin…
echatav Nov 9, 2026
5217e81
monocle combinators
echatav Nov 9, 2026
04e520d
Merge pull request #34 from morphismtech/doc-nits-pr30
echatav Nov 9, 2026
7390735
prismComonocle
echatav Nov 10, 2026
c7326d0
enumerable
echatav Nov 10, 2026
d4078ef
failBnf
echatav Nov 10, 2026
5e9765a
Update Comonocle.hs
echatav Nov 10, 2026
8139bc1
Fix the build: tests & docs of Enumerable & Comonocle optics
echatav Nov 12, 2026
540cf48
Ditraversal: Monocles by homogeneous products
echatav Nov 12, 2026
91cfb07
PartialIso fails by Filterable, without Cochoice
echatav Nov 12, 2026
487c14e
core alg fixes
echatav Nov 12, 2026
536570a
optics big update
echatav Nov 12, 2026
1512375
PartialMarket, separated, Spectacle-based ABifocal & optic docs
echatav Nov 13, 2026
ad1b48c
Prismoid applicators: >?*, sepBy & counted Prismoids
echatav Nov 13, 2026
0723d02
inRange generalization
echatav Nov 13, 2026
9bf9269
sepWith: sepBy of a terminal separator, in Control.Lens.Grammar.Symbol
echatav Nov 13, 2026
bb0659a
listed :: (IsList s, IsList t) => Iso [Item s] [Item t] s t
echatav Nov 13, 2026
b732759
Rename JsonLiteral to JsonIlliteral & JsonStringLiteral to JsonLiteral
echatav Nov 13, 2026
536810e
Merge pull request #35 from morphismtech/prismoid-forward
echatav Nov 13, 2026
d35adf2
Varifocal: context-sensitive optics over MonadicTrans profunctors
echatav Nov 13, 2026
4e3d69d
varifocus at any MonadPlus; runVarifocus at the same monad
echatav Nov 13, 2026
1914d24
Rename >?=< to contextually
echatav Nov 13, 2026
3b455b2
Link heredoc's first mention in Varifocal's & Grammar's docs
echatav Nov 13, 2026
9d8d162
contextually in any CtxGrammar, by Varifocus; contextuallyT for Monad…
echatav Nov 13, 2026
1aa9187
stepping: a machine over foci; balanced & countPrefixed
echatav Nov 13, 2026
6b6e801
bool in terminatedBy & delimited
echatav Nov 13, 2026
2ac5d15
crossVarifocal, altVarifocal & bindVarifocal
echatav Nov 13, 2026
d7ab955
Optic units & cross/alt/or combinators; drop imprism
echatav Nov 13, 2026
e6511bb
Merge branch 'varifocal' into json-algebra
echatav Nov 13, 2026
62407cd
Collapse lambdas in a Varifocal property, for HLint
echatav Nov 13, 2026
e9bf19e
Faster counted Prismoids & withOperators printing; tie manyP's knot
echatav Nov 13, 2026
856df3e
alongside & without PartialIsos; core benchmarks; changelog
echatav Nov 13, 2026
d259dd1
Test token classes by Set; document snoc's cost in printing
echatav Nov 13, 2026
d86d154
Parsor: direct repetition
echatav Nov 13, 2026
0ce26e1
Control.Lens.Prism.Nested: genericNestedPrism & genericNestedIso
echatav Nov 14, 2026
b72ae52
Bifocal's applicator, >?<*, replacing mapBifocal
echatav Nov 14, 2026
66f4f63
distributors-core changes from json-algebra-grammar
echatav Nov 20, 2026
f05cc17
Kleene quantifiers quantK & quantP; ctxList & ctxTree
echatav Nov 20, 2026
26b7735
Remove quantP 0 (Just 1) prop, false for lists of two or more
echatav Nov 20, 2026
abfc568
quantP 0 (Just 1) is optionalP, by a partial iso to Maybe
echatav Nov 20, 2026
33122d6
Remove the quantP 0 (Just 1) partialIso prop
echatav Nov 20, 2026
77dd94b
Merge pull request #37 from morphismtech/json-algebra-core
echatav Nov 20, 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
122 changes: 107 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,129 @@
name: CI

on:
pull_request:
push:
branches:
- main
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build-and-test:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up HLint
uses: haskell-actions/hlint-setup@v2

- name: Run HLint
uses: haskell-actions/hlint-run@v2
with:
path: '["distributors-core/", "distributors-grammar/", "distributors-json/"]'
fail-on: suggestion

- name: Check generated .cabal files match package.yaml
run: |
curl -sSL https://github.com/sol/hpack/releases/download/0.39.1/hpack_linux.gz \
| gunzip > hpack
chmod +x hpack
for package in distributors-core distributors-grammar distributors-json; do
(cd "$package" && ../hpack --force)
done
git diff --exit-code -I 'by hpack version' -- '*.cabal'

stack:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4

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

- name: Cache Stack dependencies
- name: Cache Stack
uses: actions/cache@v4
with:
path: ~/.stack
key: stack-${{ runner.os }}-${{ hashFiles('stack.yaml', 'package.yaml') }}
path: |
~/.stack
.stack-work
distributors-core/.stack-work
distributors-grammar/.stack-work
distributors-json/.stack-work
key: stack-${{ runner.os }}-${{ hashFiles('stack.yaml', '**/package.yaml') }}-${{ hashFiles('**/*.hs') }}
restore-keys: |
stack-${{ runner.os }}-${{ hashFiles('stack.yaml', '**/package.yaml') }}-
stack-${{ runner.os }}-

- name: Install dependencies
run: stack build --only-dependencies
- name: Build dependencies
run: stack build --test --bench --only-dependencies

- name: Build project
run: stack build
- name: Build
run: stack build --test --bench --no-run-tests --no-run-benchmarks

- name: Run tests
env:
DISTRIBUTORS_RUN_DOCTESTS: "1"
- name: Test
run: stack test

cabal:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ghc: ["9.10.3", "9.12.4"]
steps:
- uses: actions/checkout@v4

- name: Set up GHC & Cabal
id: setup
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-update: true

- name: Plan the build
run: |
cabal configure --enable-tests --enable-benchmarks
cabal build all --dry-run

- name: Cache the Cabal store
uses: actions/cache@v4
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: cabal-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dist-newstyle/cache/plan.json') }}
restore-keys: cabal-${{ runner.os }}-${{ matrix.ghc }}-

- name: Build dependencies
run: cabal build all --only-dependencies

- name: Build
run: cabal build all

- name: Test
run: cabal test all --test-show-details=direct

- name: Check packages
run: |
for package in distributors-core distributors-grammar distributors-json; do
(cd "$package" && cabal check)
done

nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@v16

- uses: DeterminateSystems/magic-nix-cache-action@v8

- name: Build & check the flake
run: nix flake check -L
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cabal.sandbox.config
*.hp
*.eventlog
.stack-work/
.stack-*/
cabal.project.local
.DS_Store
stack.yaml.lock
Expand All @@ -24,3 +25,4 @@ tags
.*.swp
.qodo
SCRATCH*
.ghc.environment.*
99 changes: 99 additions & 0 deletions .hlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# HLint configuration file
# https://github.com/ndmitchell/hlint
##########################

# This file contains a template configuration file, which is typically
# placed as .hlint.yaml in the root of your project


# Warnings currently triggered by your code
- ignore: {name: "Avoid lambda"} # 17 hints
- ignore: {name: "Avoid lambda using `infix`"} # 1 hint
- ignore: {name: "Eta reduce"} # 21 hints
- ignore: {name: "Functor law"} # 1 hint
- ignore: {name: "Monoid law, left identity"} # 1 hint
- ignore: {name: "Monoid law, right identity"} # 1 hint
- ignore: {name: "Redundant bracket"} # 3 hints
- ignore: {name: "Redundant toList"} # 1 hint
- ignore: {name: "Use $>"} # 2 hints
- ignore: {name: "Use :"} # 1 hint
- ignore: {name: "Use =<<"} # 1 hint
- ignore: {name: "Use catMaybes"} # 1 hint
- ignore: {name: "Use const"} # 11 hints
- ignore: {name: "Use fewer imports"} # 14 hints
- ignore: {name: "Use fmap"} # 1 hint
- ignore: {name: "Use mapMaybe"} # 2 hints
- ignore: {name: "Use newtype instead of data"} # 1 hint
- ignore: {name: "Use traverse"} # 1 hint
- ignore: {name: "Use tuple-section"} # 3 hints
- ignore: {name: "Use void"} # 1 hint


# Specify additional command line arguments
#
# - arguments: [--color, --cpp-simple, -XQuasiQuotes]


# Control which extensions/flags/modules/functions can be used
#
# - extensions:
# - default: false # all extension are banned by default
# - name: [PatternGuards, ViewPatterns] # only these listed extensions can be used
# - {name: CPP, within: CrossPlatform} # CPP can only be used in a given module
#
# - flags:
# - {name: -w, within: []} # -w is allowed nowhere
#
# - modules:
# - {name: [Data.Set, Data.HashSet], as: Set} # if you import Data.Set qualified, it must be as 'Set'
# - {name: Control.Arrow, within: []} # Certain modules are banned entirely
#
# - functions:
# - {name: unsafePerformIO, within: []} # unsafePerformIO can only appear in no modules


# Add custom hints for this project
#
# Will suggest replacing "wibbleMany [myvar]" with "wibbleOne myvar"
# - error: {lhs: "wibbleMany [x]", rhs: wibbleOne x}

# The hints are named by the string they display in warning messages.
# For example, if you see a warning starting like
#
# Main.hs:116:51: Warning: Redundant ==
#
# You can refer to that hint with `{name: Redundant ==}` (see below).

# Turn on hints that are off by default
#
# Ban "module X(module X) where", to require a real export list
# - warn: {name: Use explicit module export list}
#
# Replace a $ b $ c with a . b $ c
# - group: {name: dollar, enabled: true}
#
# Generalise map to fmap, ++ to <>
# - group: {name: generalise, enabled: true}
#
# Warn on use of partial functions
# - group: {name: partial, enabled: true}


# Ignore some builtin hints
# - ignore: {name: Use let}
# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules


# Define some custom infix operators
# - fixity: infixr 3 ~^#^~


# To generate a suitable file for HLint do:
# $ hlint --default > .hlint.yaml

# Some modules name variables `pattern`.
- arguments: [-XNoPatternSynonyms]

# Printor matches its pairs strictly, for speed.
- ignore: {name: "Use first", within: Data.Profunctor.Grammar}
- ignore: {name: "Use snd", within: Data.Profunctor.Grammar}
130 changes: 0 additions & 130 deletions CHANGELOG.md

This file was deleted.

Loading
Loading