News for hackers. Stuff that matters.
Re:GHC 9.0, supporting linear types by tremon on Wednesday December 30, 2020 @05:34PM (#25587044)
"the arrow" is an expression of a function operation, or rather, how a function transforms its arguments. In Haskell, the following signature:

  func :: A -> B
declares a function func that takes one argument of type A and returns a value of type B.

I'm guessing a bit, I feel this goes over my head, but here's my layman's interpretation:

In Rust, in order to declare a linear type, you must do so when initializing the variable:

  let x = vec![1, 2, 3];
Now x is declared as move-only, so that the vector cannot be duplicated by assigning it to a second variable; after assignment, accessing x will result in a compiler error.

In Haskell, you declare a function

  func :: A %1 -> B
to indicate that after this function call, accessing A should result in a compiler error.
Re:GHC 9.0, supporting linear types by paavohtl on Wednesday December 30, 2020 @05:54PM (#25587256)
I don't find this answer satisfactory, because you also need to specify in Rust whether or not a function moves its argument(s).

  // This moves the argument
  fn func(a: A) -> B { .. }
  func(x); // x is not accessible after this line
  
  // This borrows the argument, and therefore won't move it
  fn func(a: &A) -> B { .. }
  func(&x); // x remains accessible after this line
Re:GHC 9.0, supporting linear types by Ericson2314 on Wednesday December 30, 2020 @11:39PM (#25589649)
From the perspective of Rust, Linear Haskell is going to seem quite weird, and I say that as Haskeller wishing that language extension was more like Rust.

I'm not really sure how to explain it, but basically only functions that are themselves linear can have linear parameters, It's vaguely like "`Fn(A) -> B` only if `A: Copy`", and `FnOnce(A) -> B` only if `A: !Copy`, except there is no `Copy` or `!Copy` and the only say to determine it is `Fn` vs `FnOnce`.