Skip to content

Commit

Permalink
Add MonoidK
Browse files Browse the repository at this point in the history
  • Loading branch information
csgn committed Jan 2, 2025
1 parent 22fb756 commit ccb2824
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions core/src/main/scala/lamda/MonoidK.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package lamda

trait MonoidK[F[_]] extends SemigroupK[F] {

/** Example:
* {{{
* scala> import lamda.MonoidK
* scala> import lamda.syntax.semigroupk._
* scala> import lamda.instances.option._
*
* scala> MonoidK[Option].empty
* res0: Option[Nothing] = None
* }}}
*/
def empty[A]: F[A]
}

object MonoidK {
def apply[F[_]](implicit instance: MonoidK[F]): MonoidK[F] = instance
}

0 comments on commit ccb2824

Please sign in to comment.