This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //# the service | |
| package main | |
| import ( | |
| "database/sql" | |
| "fmt" | |
| "net/http" | |
| "github.com/gin-gonic/gin" | |
| _ "github.com/go-sql-driver/mysql" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sealed trait MonadOps[M[_]] { | |
| // functor | |
| def pure[A](a: A): M[A] | |
| def map[A,B](ma: M[A])(f: A => B): M[B] | |
| // monad | |
| def flatMap[A,B](ma: M[A])(f: A => M[B]): M[B] | |
| } | |
| case class Id[A](a: A) |