Linear types were merged into GHC in June. I posted this article instead because it has the more exhaustive explanation and examples of the two.
As a newcomer to Haskell and, to a certain extent, typed functional programming in general, I’m curious to know what applications this might have. Could it, for example, make working with graphics data (e.g. vertex buffers) in a functional context more practical by circumventing the usual GC hiccups?
What are the ‘usual’ GC hiccups? Do you have a code example?
Going a step further, a lot of the really interesting graphics programming happens at the shader level, but shading languages such as GLSL manage memory very differently from garbage collected ones, i.e., pretty much statically. Thinking about deterministic memory allocation in a functional language, I wonder if linear types might enable a subset of functional programming languages to be compiled to shader code. Futhark seems close, but though intended to run on the GPU, is not intended for graphics.
Thanks for your answer.
I don’t know what you mean when you say “a subset of functional programming languages”, but there is sheaf/fir which is an EDSL that compiles to Vulkan.