-
Notifications
You must be signed in to change notification settings - Fork 28
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
P82-83 Double# vs Double vs undefined #28
Comments
不是很理解你的问题哈,任何thunk求值都有可能返回bottom(比如遇到 |
P82页
|
请仔细阅读关于 |
newtype的引入既然是为了避免运行时额外的boxing/unboxing,但newtype规定只能是单构造单参数的类型。感觉好像是说 单构造函数单参数的newtype才可以避免一次boxing/unboxing了?多构造函数或多参数,haskell就无法实现boxing/unboxing? |
目前来说是这样,但是之后随着unlifted data的发展,可能这个限制会得到消除。 |
undefined 表示 "底",无法计算的值
P82第一、第二行,Cm,Inch 两类型,
x = Cm 3 x直接指向Double, 此时可以表示 "底",表示无法计算的值
y=Inch 4 y直接指向Double#,此时,不可以表示 "底",不可以表示无法计算的值,y虽然节约了时间,面对y这个thunk,此时就不担心计算“危险”吗?
The text was updated successfully, but these errors were encountered: