
com.github.mperry.fg.IdentityMonad.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functionalgroovy-main Show documentation
Show all versions of functionalgroovy-main Show documentation
FunctionalGroovy enhances FunctionalJava for Groovy
The newest version!
package com.github.mperry.fg
import com.github.mperry.fg.typeclass.Monad
import fj.F
import groovy.transform.TypeChecked
/**
* Created by mperry on 1/07/2014.
*/
@TypeChecked
class IdentityMonad extends Monad {
@Override
def Identity flatMap(Identity id, F> f) {
f.f(id.item)
}
@Override
def Identity unit(B b) {
new Identity(b)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy