Skip to content
Snippets Groups Projects
Commit add34dfd authored by Alexander Gehrke's avatar Alexander Gehrke
Browse files

[lec07] make code compile before solving

parent 0e1f4cdf
No related branches found
No related tags found
No related merge requests found
package monads
import scala.language.higherKinds
trait Monad[F[_]] {
def unit[A](a: A): F[A]
def flatMap[A, B](fa: F[A])(f: A => F[B]): F[B]
......@@ -8,7 +11,7 @@ trait Functor[F[_]] {
}
object Functor {
def functorFromMonad[F[_]](m: Monad[F]): Functor[F] = new Functor[F] {
// your code for map here
def functorFromMonad[F[_]](M: Monad[F]): Functor[F] = new Functor[F] {
def map[A, B](a: F[A])(f: A => B): F[B] = ???
}
}
package monads
final case class Id[A](value: A)
object Id {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment