GHC 9.0, supporting linear types
I first became fascinated by linear [1] and uniqueness [2] types with Clean [3], a purely functional language that handles state and IO without monads.<p>This Haskell extension uses linear types for resource safety and scoped effects [4]. For example, linear types can prevent use-after-free errors. Also, linear-typed arrays can perform in-place updates if there are no external pointers to the data.<p>Similar to linear types is the <i>affine</i> type, where a value is used at-most once. Rust&#x27;s borrow checker is based on this notion, so that values are &quot;moved&quot; rather than &quot;copied&quot;.<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Uniqueness_type" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Uniqueness_type</a><p>[2] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Substructural_type_system" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Substructural_type_system</a><p>[3] <a href="https:&#x2F;&#x2F;clean.cs.ru.nl&#x2F;Clean" rel="nofollow">https:&#x2F;&#x2F;clean.cs.ru.nl&#x2F;Clean</a><p>[4] <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1710.09756" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1710.09756</a>