object IntStateMonad extends
Monad[({type IntState[A] = State[Int, A]})#IntState] {
...
}
This syntax can be a little jarring when you first see it. But all we are doing is
declaring an anonymous type within parentheses. This anonymous type has, as one
of its members, the type alias IntState , which looks just like before. Outside
the parentheses we are then accessing its IntState member with the # syntax.
Just like we can use a "dot" ( . ) to access a member of an object at the value level,
we can use the # symbol to access a type member ( See the "Type Member" section
of the Scala Language Specification ).
相关文章
- python 进阶语法lambda 函数与列表推导式练习
- Dockerfile命令详解之 RUN(三):RUN --mount=type=cache
- Type mismatch: cannot convert from Enumeration<String> to Enumeration<Object>
- Dockerfile命令详解之 RUN(二):RUN --mount=type=bind
- Java 8 的Lambda表达式
- JAVA 8 Lambda 表达式
- 微信小程序使用content-type等于x-www-form-urlencoded方式使用request请求数据
- dedecms中关于{dede:channel type='son'}无子栏目时取同级栏目问题是解决方法分享
- 使用Lambda表达式提高Java代码的可读性和可维护性
- 使命召唤手游type25配件增益怎么选 type25配件增益选择推荐