- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已阅读 this question 中的答案,但我还是很困惑。在 Windows 10 中运行的 GHCi(版本 8.2.1)和 WinGHCi(版本 1.0.6)中,我似乎能够在提示符下键入时将值绑定(bind)到表达式,无论是否使用 let (请参阅以下)。同样,我似乎能够通过 let f x = xx* 和 f x = xx*
定义相同执行的函数Prelude> x = 3
Prelude> let y = 3
Prelude> x
3
Prelude> y
3
Prelude> x == y
True
Prelude>
那么在 GHCi 中,什么时候 let 是必要的?
如果相关的话,为 GHCi 设置的语言标志(我认为是默认值,因为我没有弄乱它们)是
base language is: Haskell2010
with the following modifiers:
-XNoDatatypeContexts
-XExtendedDefaultRules
-XNoMonomorphismRestriction
-XNondecreasingIndentation
最佳答案
回答我自己的问题。我刚刚读了脚注
This has changed as of the release of GHC 8.0.1; using let in declarations in GHCi is no longer necessary. As we assume most readers of this edition will be using an earlier version of GHC, we have kept the let notation throughout the book, and this shouldn’t cause any errors or breakage.
在 Haskell 编程从第一原则中,这证实了 let 不再是必要的。
关于haskell - 仍然对 GHCi 中的 'let' 感到困惑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51344580/
我正在尝试学习Rust。我正在阅读一本书online,该书实现了unix程序cat。现在,我试图读取作为像cargo run file1.txt file2.txt这样的参数传递的文件的内容,但是程序
我在 GHC 8.0.1 中遇到了一个带有种类索引 (?) GADT 的奇怪情况,其中在类型与种类签名中引入 foralls 会产生不同的类型检查行为。 考虑以下数据类型: {-# LANGUAGE
我正在使用 Perl 5.10 开发应用程序,HTML::Mason和 Apache 2.2。这是我第一次在大型项目中使用 Perl 5.10。我每隔一段时间就会出现奇怪的行为。应用程序因一个非常奇怪
我正在尝试将文件上传到aws中的rust中,因为我使用的是 rusoto_s3 的s3 rust客户端,当这些部分从单个线程发送时,我设法使分段上传代码正常工作不是我想要的,我想上传大文件,并且希望能
我是一名优秀的程序员,十分优秀!