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
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
Marcin Szamotulski
8887ee6788 Added Queue and ListTr Show instance for GHC<806 2019-09-02 20:29:14 +00:00
Marcin Szamotulski
5a2c359aee Queue tests
Model Queue with a list and check basic properties of
* cons
* snoc
* foldrQ
* foldlQ
2019-09-02 20:29:14 +00:00
Marcin Szamotulski
46b5016d2e Rename foldQ as foldNatQ
To resamble `foldMap` from the `Foldable` type class.
2019-09-02 20:29:14 +00:00
Marcin Szamotulski
c5d2d09539 foldrQ and folrQ for 'Queue' 2019-09-02 20:29:14 +00:00
Marcin Szamotulski
93d0f96b5d Added INLINE pragma for various Arrow instances 2019-09-01 14:44:32 +00:00
Marcin Szamotulski
b8e9a949eb Added Arrow instance for Cat 2019-09-01 14:44:32 +00:00
Marcin Szamotulski
9785528931 Relaxed signature of zipWithQ
It is enough to require that `f` is a category.
2019-09-01 14:44:32 +00:00
Marcin Szamotulski
c024158c58
Bump version: v0.0.4.0 2019-09-01 14:41:15 +02:00
Marcin Szamotulski
ad561f3bd1
Just commit texts raports 2019-09-01 14:20:33 +02:00
Marcin Szamotulski
c28e07f47f
Added links to benchmarks to the readme file 2019-09-01 14:20:33 +02:00
Marcin Szamotulski
238f95cb4d
Renamed Cat -> CatL, CatR -> Cat
This way it is more obvious which of the categories is the fastest.
I might remove `CatR` later.
2019-09-01 14:20:29 +02:00
Marcin Szamotulski
716a6ab428
Export lengthListTr 2019-09-01 14:20:08 +02:00
Marcin Szamotulski
61a5e8e79c
Export ListTr from Control.Category.Free
Also improve documentation.
2019-09-01 14:20:08 +02:00
Marcin Szamotulski
5eb3fbd101
criterion benchmarks 2019-09-01 14:19:59 +02:00
Marcin Szamotulski
6657824470 CatR - optimised version of Cat
This data structure is optimised for morphisms build with a right fold,
e.g. `(.)` and `foldr`.  The optimisations were visible with `-O1` and
`-O2`; with no optimisations (`-O0`), this data structure performs wors
than `Cat` or `ListTr`.
2019-09-01 12:09:39 +00:00
Marcin Szamotulski
5864b3ad7f Optimisations of 'Cat'
Adding INLINE pragmas, optimising order of pattern matches.
2019-09-01 12:09:39 +00:00
Marcin Szamotulski
3b9c127ff8 Adding ViewL to Free.Internal export list 2019-09-01 12:09:39 +00:00
Marcin Szamotulski
be5cfdc552 Optimise internal Queue
Queue contains three 'ListTr', only the middle one, which holds reverse
values, should be forced to weak normal form.  Otherwise the queue will
not be as performant as designed.  A performance gain was measured.

Adding INLINE pragmas had a significant improvemnt in performance of the
queue.
2019-09-01 12:09:39 +00:00
Marcin Szamotulski
166dfc8947 Added hoistQ: Queue is an endo-functor on the category of categories 2019-09-01 12:09:39 +00:00
Marcin Szamotulski
c77fa194f5 Show instances for ListTr and Queue (with QuantifiedConstraints) 2019-09-01 12:09:39 +00:00
Marcin Szamotulski
d4966a6108 Fixed a bug in 'uncons'
Make `Queue.uncons` perserve `Queue` invariant.
2019-09-01 12:09:39 +00:00
Marcin Szamotulski
cd58b91419 Stylish edits 2019-09-01 12:09:39 +00:00
Marcin Szamotulski
df0d3e4528 hoistOp - Op is an endo-functor of category of categories 2019-09-01 12:09:39 +00:00
Marcin Szamotulski
559f9fb404
README.md - some edits 2019-08-31 12:40:00 +02:00
Marcin Szamotulski
97cfd5c551 Updated README and CHANGELOG files 2019-08-31 10:35:21 +00:00
Marcin Szamotulski
1f20714c0a Added semigroup and monoid instances
Arr anc A are categories, and thus every endo-morphism object is
a monoid.
2019-08-31 10:35:21 +00:00
Marcin Szamotulski
08ee2a979b Free Arrows - various changes
Added:
* arrArr
* mapArr
* foldArr

Renamed:
* (:.:) as Cons (not exported)

Exported:
* Added Arr, Prod
2019-08-31 10:35:21 +00:00
Marcin Szamotulski
3746ef5d29 Efficient free arrow data type 2019-08-31 10:35:21 +00:00
Marcin Szamotulski
d88b444cfe Free.Internal - remove (:.:) constructor 2019-08-31 10:35:21 +00:00
Marcin Szamotulski
fd9dba5509 arrCat and mapCat
Renamed arrow to arrCat, since 'arrCat' is very like 'arr' for 'Arrows'.
'mapCat' is a smart constructor.
2019-08-31 10:35:21 +00:00
Marcin Szamotulski
ed310d4af7 Export Cat Id constructor
At times it is useful to be more explicit than
`id :: Category c => c a a`
2019-08-31 10:35:21 +00:00
Marcin Szamotulski
81df8c4abc Remove default-extensions from the cabal file
Add show-extensions haddock option.
2019-08-31 10:35:21 +00:00
Marcin Szamotulski
b1f3bda123 Move type aligned real time queues to an internal module 2019-08-31 10:35:21 +00:00
Marcin Szamotulski
4d0011df04
Updated README.md file 2019-08-31 10:19:44 +02:00
Marcin Szamotulski
20d61b2355
Efficient representation of a free category (#5)
* Efficient representation of free category

Using type aligned real time queues (Okasaki, 'Purely Functional Data
Structures') to represent catanable type allign lists (free categories).

Composition is O(1) and right fold is O(n), where n is number of
transitions.

* Bump version to 0.0.3

Make it compile on ghc802.

* Updated CI configuration
2019-08-31 08:12:21 +00:00
Marcin Szamotulski
ecc808dc7d
Stylistic changes 2019-08-24 10:28:08 +02:00
Marcin Szamotulski
875dcd99e9
Updated cabal file 2019-03-12 20:05:03 +00:00
Gabor Greif
2cdbb82c09 Proofreading (#3)
@ggreif thanks for proofreading!
2019-01-26 11:20:29 +01:00
Marcin Szamotulski
4ce35b64d8
Updated README.md and ChangeLog.md 2019-01-26 11:00:56 +01:00
Marcin Szamotulski
bb0e91b631
Rename: EffCategory, FreeEffCat 2019-01-26 10:53:06 +01:00
Marcin Szamotulski
7efa4c4430
Use callCabal2nix 2019-01-08 22:07:22 +01:00
Marcin Szamotulski
2cc5f7ac38
Install cachix from cachix.org 2019-01-06 15:38:40 +01:00
Marcin Szamotulski
02f90c2f63
Use nixox-18.09 in cricleci 2019-01-06 13:06:21 +01:00