Type safe method chaining that doesn't allow repeats of operations

前端 未结 2 1594
忘了有多久
忘了有多久 2020-12-10 17:38

I want to implement method chaining like in those questions:

Best practice to implement Scala trait which supports method chaining ;

Scala DSL: method chaini

2条回答
  •  一个人的身影
    2020-12-10 17:57

    here you can ifnd an improved solution :

    http://jim-mcbeath.blogspot.fr/2009/09/type-safe-builder-in-scala-part-3.html

    (which actually relies on the phantom types)

提交回复
热议问题