All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mperry.fg.SetStaticExtension2.groovy Maven / Gradle / Ivy

There is a newer version: 0.8
Show newest version
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> sequence(Set z, List> list) {
        monad().sequence(list)
    }

    static  Set> traverse(Set z, List list, F> f) {
        monad().traverse(list, f)
    }

    static  F> compose(Set z, F> f, F> g) {
        monad().compose(f, g)
    }

    static  Set> filterM(Set z, List list, F> f) {
        monad().filterM(list, f)
    }

}