1
1
mirror of https://github.com/coot/free-category.git synced 2024-11-29 23:07:40 +03:00
Commit Graph

121 Commits

Author SHA1 Message Date
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
Marcin Szamotulski
78a65122e0
Fixed a typo in README.md file 2019-09-03 21:46:21 +02:00
Marcin Szamotulski
ea038180e6 Remove duplicated field in free-category.cabal 2019-09-03 18:18:44 +00:00
Marcin Szamotulski
863bf9582e Renamed API in Control.Category.FreeEff
Renamed `Control.Category.FreeEff` module as
`Control.Category.FreeEffect`
  and renamed top level terms:
  - `EffCategory` type class to `EffectCategory`
  - `FreeEffCat` to `EffCat`
  - `FreeEffCat` constructor as `Effect` and `lift` as `effect`
  - `liftCat` to `liftEffect`
  - `foldNatLift` to `foldNatEffCat`
2019-09-03 07:31:33 +00:00
Marcin Szamotulski
6786025a6f Removed CatL
Other presentations have better performance, not need to explode the
API.
2019-09-03 06:45:16 +00:00
Marcin Szamotulski
d58d6b30f1 Basic tests of Cat and friends 2019-09-02 20:29:14 +00:00
Marcin Szamotulski
066ce9682f Added ListTr Show instance for GHC<806 2019-09-02 20:29:14 +00:00
Marcin Szamotulski
fa7963e053 Style changes 2019-09-02 20:29:14 +00:00