Skip to content

User Guide mentions outdated `($)` type

Summary

in the User Guide, it says

 ($) :: forall r (a :: Type) (b :: TYPE r).
        (a -> b) -> a -> b
 f $ x = f x

[...] this is the true type of GHC's $ operator

But since this commit, the true type is

($) :: forall repa repb (a :: TYPE repa) (b :: TYPE repb). (a -> b) -> a -> b

(Note the added representation polymorphism in a)

Proposed improvements or changes

I suppose ideally we should add the correct type as well and explain why the ($) f = f implementation makes it possible to use, and mention that it's more strict

Environment

  • GHC version used (if appropriate): 9.10
Edited by Jakob Brünker
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information