首页 > 解决方案 > 为什么 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 不应该更喜欢使用尽可能多的可用信息的解决方案吗?这里有两个线性解决方案,但都没有出现。

标签: haskelltheorem-proving

解决方案


推荐阅读