A relaxed chat room about all things Scala. Beginner questions welcome. http://scala-lang.org/conduct/ applies
lrytz on 2.13.x
Regression test per eed3si9n Merge pull request #9454 from s… (compare)
lrytz on 2.12.x
Fix race condition in PipelineM… Merge pull request #9455 from r… (compare)
retronym on 2.12.x
Fix and extend Array.apply vara… Merge pull request #9356 from r… (compare)
mapT :: (Monad m, Monad n) => (forall a. m a -> n a) -> t m b -> t n b
this is from the MFunctor
lib (naming on this wildly varies)
FFunctor
(or FunctorK
in cats) is (* -> *) -> *
@mdedetrich agree to disagree :)
The benefit to complexity ratio of final tagless is excellent imho. But to each their own, no big deal
encoding languages as their interpreters
. e.g. Scalatags uses parametrization over F[_]
to render to either Strings, js.Element
s, or React VDom snippets. You compose a bunch of methods that return F[T]
, it returns a bigger F[T]
, and it looks just like any example of finally tagless that i've ever seen. Is Scalatags then finally tagless?
F[_]
because it has different sets of tags, e.g. the tags from scalatags.Text.TypedTag[T]
or scalatags.JsDom.TypedTag[T]
, and each tag is typed with the value returned when you render it)
sealed trait Op
case class Lit(i : Int) extends Op
case class Add(a: Op, b: Op) extends Op
Op
Add(Lit(1), Add(Lit(2), Lit(3))
A
for now
def lit(i: Int): A
def add(a: A, b: A): A
trait Op {
def lit(i: Int): A
def add(a: A, b: A): A
}
A
?
trait Op[A] {
def lit(i : Int): A
def add(a: A, b: A): A
}