Commit Graph

18 Commits (master)

Author SHA1 Message Date
James T. Martin 69f0312c8d
Rewrite.
I ended up re-implementing most of the functionality of this library
while trying to implement a categorical model of a programming
language I was working on, so I went ahead and copied most of it
over here.

The new version is still missing some features, such as
linear functions, monadic bind, the Unc typeclass, and haddock.
It also makes a few different design decisions, which come
with their own trade-offs.
2024-01-04 15:11:41 -08:00
James T. Martin 8a1fad57df
Redefine bifunctors in terms of product categories. 2021-03-01 22:20:17 -08:00
James T. Martin 05ddc84fff
Massively improve usability by removing requirement for `Obj` constraints.
Instead, expect `morph a b` to evidence that `a` and `b` are objects,
and use `morph a a` equivalently to how `Obj morph a` was used before.
This results in some redundant parameters in categories in which every
type of a kind is an object ('nice categories', `NiceCat`),
but those can often be avoided with synonyms, and it's far better
than the constraint hell and `Dict`-passing I had to deal with before.
2021-03-01 16:21:38 -08:00
James T. Martin d90d3ad679
Rewrite and generalize most of the library; partial LinearTypes support.
I had to move back to explicit arguments rather than associated types
as my representation of categories because a functor may be a functor
in multiple categories (e.g. ((,) a) is a functor in both the category
of linear and intuitionistic implication). This also allowed me to
get rid of some bad boilerplate involving `(:~:)` and some related issues.

I also finally managed to get Monads as monoids in the category of endofunctors again.
I don't recall what prevented me from doing it in the last iteration,
but I think it's probably working now. It could just be that I
understand the theory better and it's easier for me to get right now.

There's still some unimplemented stuff that I'd like,
pretty bad usability issues that I'd like to work around,
and a dire lack of documentation. I intend to work on all that soon.

The stack stuff has been removed because stackage doesn't have GHC 9 yet,
and the template-haskell stuff has been removed until I can rewrite it,
seeing as it was essentially useless as it was.

The LinearTypes support is very incomplete, but it's supported in some places
and I don't think I'd have much trouble expanding to support it in general;
I just haven't had much time to experiment with it yet.
2021-03-01 02:21:28 -08:00
James T. Martin ae0795f0a3
Working on improving documentation. 2020-10-29 18:48:11 -07:00
James T. Martin 164a3d827d
Mostly irrelevant additions: monoidal, unit, void. 2020-10-23 10:46:58 -07:00
James T. Martin e5d265e124
Go back to the old rep. for categories, which is cleaner. 2020-10-22 23:49:46 -07:00
James T. Martin 0dd45dfd9a
Begin work using Template Haskell to automate Base functor generation.
It doesn't quite work yet, but it's a start. It'll need a rewrite to work, hence the commit.
Current known bugs:
* References to `r` do not take into account the skip pos.
* Generation of `forall r` even when r is not used.
* The `forall r` isn't placed where I want it to be.
* The code is horrifically bad.
* There are certainly other bugs I don't know about yet.
2020-10-22 14:00:39 -07:00
James T. Martin eb461266b9
Haskell is a bad programming language which requires too much boilerplate.
* Added Vec, indexer for Vec
* Added Pi quantifiers
2020-10-22 11:10:09 -07:00
James T. Martin 3e3a9ccbd3
Use a different representation of categories, add a couple data types. 2020-10-22 01:16:20 -07:00
James T. Martin 2e06699c97
Partial work on restructuring which I do not intend to finish. 2020-10-21 20:34:45 -07:00
James T. Martin 19658f4e0a
Use existing definitions instead of re-defining stuff in Good. 2020-10-21 16:09:27 -07:00
James T. Martin 1e13753a7b
Temporarily remove evil. Basic recursion schemes work. 2020-10-21 13:05:44 -07:00
James T. Martin eef9839b89
Splitting off levels of generality by morality. 2020-10-20 20:07:38 -07:00
James T. Martin 49ab5cf339
My previous definitions were insufficient. Hopefully these work. 2020-08-27 10:16:24 -07:00
James T. Martin 4566b6526f
Ambiguous types are no longer necessary. Proxies are used instead. 2020-08-15 13:20:33 -07:00
James T. Martin 7dde895ef2
Add GitHub CI build workflow. 2020-08-14 20:14:08 -07:00
James T. Martin e03455ab9c
Monads are monoids in the category of endofunctors! 2020-08-14 20:03:53 -07:00