简体   繁体   English

多个表达式的中缀形式的应用程序优先级

[英]the application precedence for the infix form for multiple expressions

Say I have this expression: 说我有这个表达:

instance FromRow MyData where
  fromRow =  MyData <$> field <*> field <*> field 

I can't undertand the application precedence because everything is written in the infix form. 我不能理解应用程序的优先级,因为所有内容都以中缀形式编写。 Can you help me? 你能帮助我吗? Is this correct? 这个对吗?

fromRow =  MyData (1) <$> (2) field  (3) <*>  (4) field  (5) <*>  (6) field 

Both <$> and <*> are left-associative, so your numbering is correct. <$><*>都是左关联的,因此您的编号是正确的。 You could also write it using parentheses like this: 您也可以使用如下括号来编写:

(((MyData <$> field) <*> field) <*> field)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM