com.github.mperry.fg.SetMonadStaticExtension.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.concrete.ListMonad
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
/**
* Created by MarkPerry on 13/04/2014.
*/
@TypeChecked
class SetMonadStaticExtension {
static SetMonad monad() {
new SetMonad()
}
static Set join(Set list, Set> list2) {
monad().join(list2)
}
static Set> filterM(Set z, List list, F> f) {
monad().filterM(list, f)
}
static Set foldM(Set l, Stream s, B b, F2> f) {
monad().foldM(s, b, f)
}
static Set foldM_(Set l, Stream s, B b, F2> f) {
monad().foldM_(s, b, f)
}
static Set> sequence(Set l, List> list) {
monad().sequence(list)
}
static F> compose(Set l, F> f, F> g) {
monad().compose(f, g)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy