[Haskell-cafe] [Ann] group-theory

Emily Pillmore emilypi at cohomolo.gy
Sat Dec 5 21:10:28 UTC 2020


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/Free.hs#L70

> 
> 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 at 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-Free.html
> ) 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 at 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
>> 
>> 
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20201205/933add7e/attachment.html>


More information about the Haskell-Cafe mailing list