2

This document, about the differences between Haskell and Purescript, says the following about the $ operator

GHC provides a special typing rule for the $ operator, so that the following natural application to the rank-2 runST function is well-typed:

runST $ do
  ...

PureScript does not provide this rule, so it is necessary to either

omit the operator: runST do ... or use parentheses instead: runST (do ...)

Which typing rule is meant by this? And how does this impact the example of runST?

Brian61354270
  • 8,690
  • 4
  • 21
  • 43
Joe
  • 1,479
  • 13
  • 22
  • [I'd initially assumed that it might be "Levity Polymorphism" as discussed in this question, but I'm struggling to understand how that would apply](https://stackoverflow.com/a/35320729/1486968) – Joe Aug 24 '21 at 21:00
  • 1
    I seem to remember that Haskell's special typing rule for `($)` is anyway being removed, but can't find the reference now. – leftaroundabout Aug 25 '21 at 09:30
  • 2
    @leftaroundabout, that's gotta be part of the `ImpredicativeTypes` overhaul, right? – dfeuer Aug 25 '21 at 16:41
  • 1
    @dfeuer right! https://github.com/ghc-proposals/ghc-proposals/blob/b94aec096d680e40ff1302a42783dcc01892afbd/proposals/0274-quick-look-impredicativity.rst#the-typing-rule-for- – leftaroundabout Aug 25 '21 at 16:47

0 Answers0