haskellfoundation / HaskellSchool

Apache License 2.0
51 stars 11 forks source link

Guidelines for writing about a typeclass #45

Closed chris-martin closed 2 years ago

chris-martin commented 2 years ago

As I'm getting the first typeclass lesson wrapped up, from it I've put together a list of the things I think are important to cover in each lesson, specifically when teaching a typeclass. Perhaps it is of general utility to include here in the style guide?

TrueBoxGuy commented 2 years ago

Also, this definitely requires further discussion, but with the nature of writing of the Haskell School somewhat tending towards quick-start documentation, it might make sense to present exercises differently.

It's probably still useful to label the exercises and give the reader time to think them through but maybe they could be framed and explained more like examples (i.e. with the article walking through the thought process).

chris-martin commented 2 years ago

There might be no need to explicitly mention it here, but it would be nice if articles referred to the value of the typeclass when not immediately obvious (e.g. it might abstract over a certain form of computation / make some form of computation easier).

For example, the associative nature of a semigroup allows for the method of repeating squares to be used in stimes, which makes it easy to efficiently compute powers of matrices, numbers (modulus some value), permutations, etc.

Exactly, that's what I was getting at. If you didn't already think it was explicitly mentioned here, I'll take that as a queue to say a bit more -- updated to elaborate by way of borrowing a few of your words.

Kleidukos commented 2 years ago

@chris-martin hi! Any update on this PR? :)

chris-martin commented 2 years ago

@chris-martin hi! Any update on this PR? :)

I believe that force-push did make the changes I mentioned. This is good to go, I think?

Kleidukos commented 2 years ago

Perfet :)