1
1
mirror of https://github.com/coot/free-category.git synced 2024-11-26 21:33:47 +03:00
Commit Graph

128 Commits

Author SHA1 Message Date
Marcin Szamotulski
6e82ad08ca Updated nix/free-algebras.nix 2019-12-05 02:20:14 +01:00
Marcin Szamotulski
f5d21153a0 Updated ChangeLog 2019-12-05 02:20:14 +01:00
Marcin Szamotulski
ce0510c372 Added foldrL, foldrL and zipWithL
This matches the api of Queue.
2019-12-05 02:20:14 +01:00
Marcin Szamotulski
ddd4701811 Export ListTr 2019-12-05 02:20:14 +01:00
Marcin Szamotulski
daa4113228 Use free-algebras 0.0.8.0 2019-12-05 02:20:14 +01:00
Marcin Szamotulski
15f8c5b0dd Build with ghc881 2019-10-06 19:25:09 +01:00
Marcin Szamotulski
3c599fef5f Switched to nixorg/nix:circleci docker image 2019-10-06 19:25:09 +01:00
Marcin Szamotulski
e448412f75 CI use nixpkgs-unstable channel 2019-10-06 13:11:45 +01:00
Marcin Szamotulski
4fdb07f48e nix: use -Wno-inline-rule-shadowing in ghc802 2019-10-06 13:11:45 +01:00
Marcin Szamotulski
b929077597 Include more benchmarks
When length of morphisms increases the 'Queue' type shows its strengths.
2019-10-06 13:11:45 +01:00
Marcin Szamotulski
d7f4b32e54 Export more functions 2019-10-06 13:11:45 +01:00
Marcin Szamotulski
5ef73f172e Added foldNatL/NilTr rewrite rule 2019-10-06 13:11:45 +01:00
Marcin Szamotulski
13bc4de0dc Added README 2019-09-29 20:46:19 +01:00
Marcin Szamotulski
6702b0974d Modify example
Simplify types, but use 'KleisliS' newtype wrapper.
2019-09-29 20:46:19 +01:00
Marcin Szamotulski
8678e87081 Generalise liftEffect and foldNatEffCat
Allow to plug any free category.
2019-09-29 20:46:19 +01:00
Marcin Szamotulski
1e64f283ba
Update README.md 2019-09-08 19:56:04 +00:00
Marcin Szamotulski
5045600e02
Removed commented out rewrite rule 2019-09-08 21:36:13 +02:00
Marcin Szamotulski
2bfe243cdf Consistently add inline pragmas to AlgebraFree2 instances
It's not required in some of them, but in others (e.g. C) the rewrite
rules fire only when they are present.  Also since we intend to inline
the definitions, it's better to be explicit.
2019-09-08 21:08:52 +02:00
Marcin Szamotulski
131fd47651 Renamed arr family of function to lift
e.g. arrC -> liftC, arrCat -> liftCat

'arr' is used in 'Arrow' class and we use 'lift' prefix in
'AlgebraFree2' class, thus lift prefix seems more appropriate.
2019-09-08 21:08:52 +02:00
Marcin Szamotulski
e5d030ebf7 Rearange function, rewrite rules and type class instances 2019-09-08 21:08:52 +02:00
Marcin Szamotulski
c71fc6678b GHC rewrite rules for ListTr 2019-09-08 21:08:52 +02:00
Marcin Szamotulski
53616ddd34 Remove some redundant INLINE pragmas 2019-09-08 21:08:52 +02:00
Marcin Szamotulski
a7dfb4473a Rewrite rules in Free.Internal module 2019-09-08 21:08:52 +02:00
Marcin Szamotulski
c05a33394b Added consC and the corresponding rewrite rule 2019-09-08 21:08:52 +02:00
Marcin Szamotulski
6ae5e433a9 Added missing Semigroup / Monoid instances for Cat 2019-09-08 21:08:52 +02:00
Marcin Szamotulski
2c7071977e Added rewrite rules for C 2019-09-08 21:08:52 +02:00
Marcin Szamotulski
2545d97eb0 Renamed foldCat as foldNatCat 2019-09-08 21:08:52 +02:00
Marcin Szamotulski
d8c6f7f245 GHC RULES
Added various GHC rewrite rules for `Queue` and `Cat` types:
* `foldCat`
* `foldQ` / `foldrQ`
* `foldNatQ`
* `hoistQ`
2019-09-08 21:08:52 +02:00
Marcin Szamotulski
029f68a8b5 Added consCat 2019-09-08 21:08:52 +02:00
Marcin Szamotulski
d831cf752a Rename emptyQ as nilQ 2019-09-08 21:08:52 +02:00
Marcin Szamotulski
a874982209 Stylistic changes 2019-09-08 21:08:52 +02:00
Marcin Szamotulski
cf86a6b64c Build benchmarks on CI 2019-09-07 15:20:58 +02:00
Marcin Szamotulski
0e96a23ae2 Improved haddoc documentation
Let 'Queue' be exported as top implementation.  Add a note on 'Cat'
performance.
2019-09-07 09:58:45 +02:00
Marcin Szamotulski
259b8eecb6 Updated benchmark reports 2019-09-07 09:58:45 +02:00
Marcin Szamotulski
450b78f918 Swapped ListTr for Queue
Queue performes ~66% better thaan ListTr, and is more prone for foldl
/ foldr than 'Cat'.
2019-09-07 09:58:45 +02:00
Marcin Szamotulski
2e29c220a0 Added Queue category instance benchmarks 2019-09-07 09:58:45 +02:00
Marcin Szamotulski
059d54ecdd Reorder ListTr instances 2019-09-07 09:58:45 +02:00
Marcin Szamotulski
1dc4cad07f Added Category instance for Queue
Including tests.
2019-09-07 09:58:45 +02:00
Marcin Szamotulski
d3b19e4d59 Renamed Queue interface
* `snoc`   -> `snocQ`
* `cons`   -> `consQ`
* `uncons` -> `unconsQ`
2019-09-07 09:58:45 +02:00
Marcin Szamotulski
99121aff4f Added hoistFreeH2 to Control.Category.Free export list 2019-09-07 09:00:20 +02:00
Marcin Szamotulski
1dc741964b Added Show instances for Cat and C 2019-09-07 09:00:20 +02:00
Marcin Szamotulski
074b57df8f Code style 2019-09-07 09:00:20 +02:00
Marcin Szamotulski
229793d7fd Improved haddocks 2019-09-07 09:00:20 +02:00
Marcin Szamotulski
8152515847 Added more tests
Test:
* category laws
* compatibility for 'foldNatFree2' for categories and 'foldMap' for
  monoids.
2019-09-05 20:56:37 +00:00
Marcin Szamotulski
57924b4a72 Improved haddocs 2019-09-05 07:42:30 +00:00
Marcin Szamotulski
6906ee238a Added proof that op = unsafeCoerce is safe 2019-09-05 07:42:30 +00:00
Marcin Szamotulski
a8c7f5df27 Moved Cat Category instance close to definition 2019-09-05 07:42:30 +00:00
Marcin Szamotulski
3405380fbf Updated ListTr haddock 2019-09-05 07:42:30 +00:00
Marcin Szamotulski
510c758b59 Removed some INLINE pragmas
Some are just unnecessary.
2019-09-05 07:42:30 +00:00
Marcin Szamotulski
ecfff505c4 Remove unnecessary indirection in definition of Cat
This is internal change, since `Cat' constructor is not exposed.
2019-09-05 07:42:30 +00:00