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

br.gov.lexml.renderer.docx.docxmodel.builders.package.scala Maven / Gradle / Ivy

There is a newer version: 1.1.4
Show newest version
package br.gov.lexml.renderer.docx.docxmodel

import cats.data._

package object builders {

type RunBuilderMonad[T,A] = State[RunBuilderState[T],A]

type RunBuilderMonadStmt[T] = RunBuilderMonad[T,Unit]  
  
type ParBuilderMonad[T,A] = State[ParBuilderState[T],A]

type ParBuilderMonadStmt[T] = ParBuilderMonad[T,Unit]  

type DocxCompSeqBuilderMonad[T,A] = State[DocxCompSeqBuilderState[T],A]

type DocxCompSeqBuilderMonadStmt[T] = DocxCompSeqBuilderMonad[T,Unit]  

 def mapM_[T,S](x : Seq[T])(f : T => State[S,_]) : State[S,Unit] = {
      if(x.isEmpty) { State.pure(()) } else {
        val (h,t) = (x.head,x.tail)
        for {
          _ <- f(h)
          _ <- mapM_(t)(f)
        } yield (())            
      }
    }

type Mergeable[T] = Mergeable2[T,T]
}






© 2015 - 2024 Weber Informatics LLC | Privacy Policy