Skip to content

Add doc examples for Data.Bifoldable

Julien Debon requested to merge Sir4ur0n/ghc:doc/bifoldable into master

Hi!

As discussed on IRC, channel #Haskell-docs, here's a first draft of Data.Bifoldable documentation examples.

As much as possible I try to stick to basic example to lower the cognitive load for newcomers.

I had to create a new type to showcase the safety risks of bifoldr1, let me know if you have a better idea! AFAIU (,) and Either are always safe.

Also, I noticed '(,)' is not correctly displayed/linked by Haddock, do you know how to fix it please?

Thank you!


Please take a few moments to verify that your commits fulfill the following:

  • are either individually buildable or squashed
  • have commit messages which describe what they do (referring to [Notes][notes] and tickets using #NNNN syntax when appropriate)
  • have added source comments describing your change. For larger changes you likely should add a [Note][notes] and cross-reference it from the relevant places.
  • add a testcase to the testsuite.
  • Add examples to Bifoldable module

@core-libraries Tracking: #17929

Edited by Julien Debon

Merge request reports