M. Walker
M. Walker

Reputation: 613

Reading Type Signature: Type Constructor & Function Precedence

Context

makeAff ∷ ∀ eff a. ((Either Error a → Eff eff Unit) → Eff eff (Canceler eff)) → Aff eff a

https://github.com/slamdata/purescript-aff/blob/master/src/Control/Monad/Aff.purs#L365

Question

Either Error a → Eff eff Unit

Should this be read at as...

  1. An Either of Error or a → Eff eff Unit
  2. A function that takes an Either Error a and returns Eff eff Unit

?

Does have a certain type infix precedence?

Upvotes: 1

Views: 75

Answers (1)

mschmidt
mschmidt

Reputation: 2790

Application (the whitespace) is the highest precedence "operator" in Haskell while -> is the lowest.

Upvotes: 2

Related Questions