haskell - 为什么 Djinn 没有为 State 找到 <*>?
问题描述
我定义
-- Djinn doesn't seem to understand newtype
data State s a = State (s -> (s, a))
然后要求
f :: State s (a -> b) -> State s a -> State s b
它给了我三个答案,但他们都抛弃了一个或两个状态变化。为什么是这样?Djinn 不应该更喜欢使用尽可能多的可用信息的解决方案吗?这里有两个线性解决方案,但都没有出现。
解决方案
推荐阅读
- blockchain - 调用智能合约上的函数以将 trx 发送到地址时出现错误 502
- docker - shell 脚本(busybox)在 docker 容器上不能按预期工作
- asp.net - 隐藏/排除控制器
- python - 如何在 Python 中从数组中的字符串中分隔字母和数字?
- grafana - 针对 AWS Cloudwatch 的 Grafana 注释查询
- r - R中的区域虚拟变量
- xslt - 带有子字符串的应用模板
- azure-data-factory - 我们如何定义一个可重用的错误处理程序活动 Web 活动以在 ADF 管道中的任何位置发生故障时发送电子邮件?
- spring - spring 基于构造函数的依赖注入,如何理解“它可以让你将应用程序组件实现为不可变对象”
- sql - 在 SQL 中查询另一列中的 JSON 对象时如何使用 where 子句引用一列