TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Haskell GHC 9.0.1-alpha

124 pointsby harporoederover 4 years ago

7 comments

platzover 4 years ago
FYI, because I know it will be brought up; GHC models linearity differently than Rust, so you can&#x27;t compare the two against each other, even though you think you would be able to do that.<p>Rust puts linearity on the types, GHC puts linearity on the arrows.<p><a href="https:&#x2F;&#x2F;imgur.com&#x2F;s0Mxhcr" rel="nofollow">https:&#x2F;&#x2F;imgur.com&#x2F;s0Mxhcr</a><p><a href="https:&#x2F;&#x2F;skillsmatter.com&#x2F;skillscasts&#x2F;11067-keynote-linear-haskell-practical-linearity-in-a-higher-order-polymorphic-language" rel="nofollow">https:&#x2F;&#x2F;skillsmatter.com&#x2F;skillscasts&#x2F;11067-keynote-linear-ha...</a>
评论 #24636121 未加载
评论 #24637442 未加载
评论 #24637972 未加载
flumpcakesover 4 years ago
Are there are books&#x2F;video lectures that explain linear types how they are useful in a programming language?<p>How do people that don&#x27;t have PhDs bridge the gap in their knowledge from what&#x27;s commonly taught&#x2F;used (OOP and it&#x27;s design patterns) to thinking in terms of monads&#x2F;monoids&#x2F;functors&#x2F;etc. ?
评论 #24636771 未加载
评论 #24637317 未加载
评论 #24637236 未加载
评论 #24638119 未加载
评论 #24640047 未加载
评论 #24636806 未加载
评论 #24640509 未加载
danidiazover 4 years ago
Besides potentially enabling new types of APIs, I simply like that this extension lets you write more precise type signatures. A function with type [a] %1 -&gt; [a] can do less things that a function with type [a] -&gt; [a].
gautamcgoelover 4 years ago
Can someone explain what this means, practically speaking? I know Haskell fairly well, but am not familiar with linear types. These are types that can be used only once, right?
评论 #24635419 未加载
评论 #24635958 未加载
评论 #24635449 未加载
flubertover 4 years ago
Any pointers to a comparison between Clean&#x27;s uniqueness typing and GHC&#x27;s linear types? And is Rust the motivating factor behind linear types cropping up lately? I see Idris is now getting them as well.
评论 #24635910 未加载
评论 #24635479 未加载
评论 #24635700 未加载
评论 #24635678 未加载
smabieover 4 years ago
I&#x27;m not super well versed on this stuff, but aren&#x27;t affine types strictly superior? Though I suppose linear types might be better for tracking system resources?
评论 #24636346 未加载
评论 #24635669 未加载
评论 #24635756 未加载
评论 #24635691 未加载
chowellsover 4 years ago
Well. There goes the library ecosystem until everyone finally realizes this extension doesn&#x27;t do what they want. <i>sigh</i><p>To expand a bit further:<p>This extension allows annotating function types with linearity information. The problem is that those modified function types control what is allowed to happen <i>inside</i> them. They have no impact on how values are used outside them.<p>This is the big difference between linear typing and uniqueness typing. Uniqueness typing lets you say &quot;this function is the only thing using this value.&quot;<p>It&#x27;s possible to use this extension to assemble something sort of like uniqueness, but the ergonomics are pretty awful and no one bothered working through all the ugly details like exception handling in the context of a real application.<p>I really don&#x27;t believe this is ever going to be better than existing techniques. But it&#x27;s absolutely going to make the library ecosystem permanently worse, as lots of packages will get linearity annotations added. Lots of forks will arise without them, for the people who don&#x27;t want the hassle. Finding the library you actually want is just going to get even more complicated.<p>I still don&#x27;t understand how this happened. Every strong objection was just ignored. What&#x27;s the point of even having a public comment process when it makes no difference to the outcome?
评论 #24636425 未加载
评论 #24635884 未加载
评论 #24636330 未加载
评论 #24636342 未加载
评论 #24636227 未加载
评论 #24635991 未加载