
Hi Marcin,
Nice work; I also implemented free groups in the free-algebra package
Wonderful - I'll take a look. Those were a bit rough, and it'd be good to see how you encoded them in `free-algebra`. Maybe we can collaborate on expanding the knowledgebase and utility of free group calculations in our respective packages :)
However 'FG' is the free group in the class of all groups.
I'm glad you noted this as well! The `DList` encoding is interesting - I'll need to study that a bit :) Someone has also linked me to Sjoerd's `free-functors` library, which seems is also very interesting: https://github.com/sjoerdvisscher/free-functors/blob/master/src/Data/Functor...
There's an interesting difference between 'FreeGroup' (using notation of your package) and 'FG'. First one is not a free group in the class of all groups, but only free in the class of groups for which multiplication is strict in the left argument
Correct. Regarding motivation, I provided both because I know some people do like to operate in the fast-and-loose strict subset of Haskell. It's no skin off my back. But I was very unsatisfied with strict (vis. "moral") Free constructions with respect to bottoms, and, inspired by Dan Doel's article ( http://comonad.com/reader/2015/free-monoids-in-haskell/ ), attempted to find a free construction for groups that was more in line with Haskell's domain-like types. I note this article in the documentation for FG. Maybe this deserves a broader blog post?
I identified that `Foldable` can only be defined for algebraic structures for which `Endo b` has the same algebra type; this fails for groups: only automorphisms form a group. Having a seprate `GroupFoldable` class makes sense.
That class ended up being good for two things: * Great puns. * Very convenient word evaluation If you'd like to add to it, I'd be stoked. Cheers, Emily On Sat, Dec 05, 2020 at 2:53 PM, < coot@coot.me > wrote:
Hi Emily,
Nice work; I also implemented free groups in the free-algebra package.
There's an interesting difference between 'FreeGroup' (using notation of your package) and 'FG'. First one is not a free group in the class of all groups, but only free in the class of groups for which multiplication is strict in the left argument, i.e. ones that satisfy the equation `⊥ <> a == ⊥`. That's because `++` is strict in the left argument. For the same reason `[]` is free monoid in the class of left strict monoids.
However 'FG' is the free group in the class of all groups. Another isomorphic construction of a free group (in the class of all groups) can be based on `DList` - the free monoid. You might want to check out https:/ / hackage. haskell. org/ package/ free-algebras-0. 1. 0. 0/ docs/ Data-Algebra-Free. html ( https://hackage.haskell.org/package/free-algebras-0.1.0.0/docs/Data-Algebra-... ) which gives a uniform interface for all free algebras (not just groups). You'll recover there `Monad` instance of `FG` (and `FreeGroup`), and a bit more.
I identified that `Foldable` can only be defined for algebraic structures for which `Endo b` has the same algebra type; this fails for groups: only automorphisms form a group. Having a seprate `GroupFoldable` class makes sense.
Cheers,
Marcin Szamotulski
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, December 5th, 2020 at 19:52, Emily Pillmore < emilypi@ cohomolo. gy ( emilypi@cohomolo.gy ) > wrote:
Hello all,
I am pleased to announce the release of the group-theory ( https://hackage.haskell.org/package/group-theory ) package: a package aimed at implementing the theory of finite groups in a reasonably ergonomic, well-documented, and featureful way. It's hardly finished, but my co-maintainer, Reed Mullanix (@totbwf) and I thought this was a good mvp with which we could announce.
Contributions are very welcome, and I hope everyone enjoys.
Cheers,
Emily Pillmore
participants (1)
-
Emily Pillmore