Bing/Copilot Answer: "->", has highest precedence for type construction but in general has nuanced precedence order

17 Mar
2024
17 Mar
'24
7:59 p.m.
Next time ask GHCi first. (Perhaps you did, but wanted to learn Copilot's opinion anyways): ghci> :info (->) data (->) (a :: TYPE q) (b :: TYPE r) -- Defined in ‘GHC.Prim’ infixr -1 -> ghci> :type (->) <interactive>:1:2: error: parse error on input ‘->’ So while (->) as a type-level function is an infix operator with a precedence, there is no such operator on the term level, otherwise the :type query would have shown it. That the term-level -> is not an operator arguably makes it a lot harder to obtain proper information about. The relevant part of the language documentation I think is this: https://www.haskell.org/onlinereport/exps.html Olaf
477
Age (days ago)
477
Last active (days ago)
0 comments
1 participants
participants (1)
-
Olaf Klinke