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

Olaf Klinke <[email protected]>
Newsgroups gmane.comp.lang.haskell.cafe
Message-ID <[email protected]>
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

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.