问题描述
我是一个Haskell noob,他正在通过奇妙的学习你对Haskell的好处。这个问题与。这段话的内容如下: Frank 我们发现豆腐采用 ja (所以这种形式的示例类型应该是 Maybe Int )并返回一个 taj ,所以如果我们用 j 替换 Frank ,结果类型应该是 Frank Int Maybe 。这让我有些迷惑。在我看来,最后一句应该是:
因此,如果我们用 Frank 替换 t ,结果类型应该是 Frank Int也许。
任何关于我哪里出错的解释都会非常感谢。
你根本不会犯错。这是书中的一个错误。你建议的句子是正确的。
I'm a Haskell noob who's working his way through the wonderful "Learn You A Haskell For Great Good". This question is related to a passage in the section called "Kinds and some type-foo" in chapter 8. The passage that reads:
"Making Frank an instance of Tofu is pretty simple. We see that tofu takes a j a (so an example type of that form would be Maybe Int) and returns a t a j. So if we replace Frank with j, the result type would be Frank Int Maybe."
This has me somewhat befuddled. In my mind the last sentence should read:
"So if we replace t with Frank, the result type would be Frank Int Maybe."
Any explanation as to where I'm going wrong would be much appreciated.
You're not going wrong at all. It's an error in the book. Your proposed sentence is correct.
这篇关于关于“种类和一些类型 - 富”中的段落的混淆部分learnyouahaskell.com的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!