Prod -> Product in Scala snippets too

This commit is contained in:
Igal Tabachnik 2019-06-13 09:40:33 +03:00
parent 8e5c7b46e5
commit 3230b5f9b1
2 changed files with 4 additions and 4 deletions

View File

@ -1,3 +1,3 @@
def counit[S, A](a: Prod[S, Reader[S, A]]): A = a match {
case Prod((Reader(f), s)) => f(s)
def counit[S, A](a: Product[S, Reader[S, A]]): A = a match {
case Product((Reader(f), s)) => f(s)
}

View File

@ -1,2 +1,2 @@
def unit[S, A](a: A): Reader[S, Prod[S, A]] =
Reader(s => Prod((a, s)))
def unit[S, A](a: A): Reader[S, Product[S, A]] =
Reader(s => Product((a, s)))