Skip to content

aloise/dep-monad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dep-monad

Scala - Dependency injection monad - experiments.

It would satisfy dependencies in the for comprehension during the compilation.

  val dep = for {
    len <- reader{(str: String, str2: B1) => Dep2B1(str.length) }
    len2 = len.i*2
    _ <- reader{b1: B1 => B2(b1.i)}
    _ <- reader{(sameStr4: String, b2: B2, b3: B3) => B5(5*2 + sameStr4.length + b3.i) }
    fn <- reader{ f: Final => f.i * 2L}
  } yield AnotherFinal(len2+fn.toInt)

All types in the for comprehension would satisfy requirements in all underlying for comprehension lines. There should be one unique type produced on each line.

About

Scala - Dependency injection monad - experiments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages