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

com.github.mperry.fg.ListMonadStaticExtension.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.concrete.ListMonad
import fj.F
import fj.F2
import fj.Unit
import fj.data.Stream
import groovy.transform.TypeChecked

//import groovy.transform.TypeChecked
//import groovy.transform.TypeCheckingMode

/**
 * Created by MarkPerry on 16/01/14.
 */
@TypeChecked
class ListMonadStaticExtension {

    static ListMonad monad() {
        new ListMonad()
    }

    static  List join(List list, List> list2) {
        monad().join(list2)
    }


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

    static  List foldM(List l, Stream s, B b, F2> f) {
        monad().foldM(s, b, f)
    }

    static  List foldM_(List l, Stream s, B b, F2> f) {
        monad().foldM_(s, b, f)
    }

    static  List foldM(List z, List s, B b, F2> f) {
        monad().foldM(s, b, f)
    }

    static  List foldM_(List l, List s, B b, F2> f) {
        monad().foldM_(s, b, f)
    }

    static  List> sequence(List l, List> list) {
        monad().sequence(list)
    }

    static  F> compose(List l, F> f,  F> g) {
        monad().compose(f, g)
    }

}