@@ -579,15 +579,17 @@ topic, but it is easy to derive a typeclass for an ADT:
579
579
~~~~~~~~
580
580
581
581
582
- ## Algebras
582
+ ## Records of Functions
583
583
584
584
In Scala, typeclasses and algebras are both defined as a ` trait ` interface.
585
585
Typeclasses are injected by the ` implicit ` feature and algebras are passed as
586
586
explicit parameters. There is no language-level support in Haskell for algebras:
587
587
they are just data!
588
588
589
- Consider the simple ` Console ` algebra from the introduction. We can rewrite it
590
- into Haskell as a * record of functions* :
589
+ A> * Algebra* is the somewhat confused Scala name for this concept: in Haskell it's
590
+ A> called a * record of functions* . Because it's just a record. Of functions.
591
+
592
+ Consider ` Console ` from the introduction. We can rewrite it into Haskell:
591
593
592
594
{lang="text"}
593
595
~~~~~~~~
@@ -632,9 +634,9 @@ more boilerplate but makes the code easier to read:
632
634
~~~~~~~~
633
635
634
636
Whereas in Scala this encoding may be called * Finally Tagless* , in Haskell it is
635
- known as MTL style. Without going into details, some Scala developers didn't
636
- understand a research paper about the performance benefits of [ Generalised ADTs
637
- in Haskell] ( http://okmij.org/ftp/tagless-final/index.html#tagless-final ) .
637
+ known as * MTL style with records of functions * . Without going into details, some
638
+ Scala developers didn't understand a research paper about the performance
639
+ benefits of [ Generalised ADTs in Haskell] ( http://okmij.org/ftp/tagless-final/index.html#tagless-final ) .
638
640
639
641
An alternative to MTL style are * Extensible Effects* , also known as [ Free Monad
640
642
style] ( http://okmij.org/ftp/Haskell/extensible/more.pdf ) .
0 commit comments