com.github.mperry.fg.SetStaticExtension2.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
package com.github.mperry.fg
import com.github.mperry.fg.typeclass.Monad
import com.github.mperry.fg.typeclass.concrete.SetMonad
import fj.F
import fj.F2
import fj.Unit
import fj.data.Stream
import groovy.transform.TypeChecked
import groovy.transform.TypeCheckingMode
/**
* Created by MarkPerry on 12/04/2014.
*/
@TypeChecked
class SetStaticExtension2 {
static SetMonad monad() {
new SetMonad()
}
static Set pure(Set z, A a) {
monad().pure(a)
}
static Set unit(Set z, B b) {
monad().unit(b)
}
static F> unit(Set z) {
monad().unit()
}
static Set join(Set z, Set> mma) {
monad().join(mma)
}
static Set foldM(Set z, List list, B b, F2> f) {
monad().foldM(list, b, f)
}
static Set foldM_(Set z, Stream s, B b, F2> f) {
monad().foldM_(s, b, f)
}
static Set foldM_(Set z, List s, B b, F2> f) {
monad().foldM_(s, b, f)
}
static Set
© 2015 - 2024 Weber Informatics LLC | Privacy Policy