Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P195 末行(19.3 简易计算器)的 ((-) x) 应为 (subtract x)。否则被减数和减数是反的。 #57

Open
SnowOnion opened this issue May 5, 2020 · 0 comments

Comments

@SnowOnion
Copy link

SnowOnion commented May 5, 2020

代码恰好可见于 6050572#diff-8c949560d14df22da6a43f382a0f8ec8R28
原文为:

(~-) :: Double -> State Double (Double -> Double)
(~-) x = State $ \s -> (((-)x), s - x)

根据本 demo 的功能,((-)x) 想要的效果是 \y -> y - x 或者说 subtract x。但 ((-)x) 的效果是 \y -> x - y

@SnowOnion SnowOnion changed the title P195 末行的 ((-) x) 应为 (subtract x)。否则被减数和减数是反的。 P195 末行(19.3 简易计算器)的 ((-) x) 应为 (subtract x)。否则被减数和减数是反的。 May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant