为了账号安全,请及时绑定邮箱和手机立即绑定

常见的Haskell运算符有明显的名称吗?

常见的Haskell运算符有明显的名称吗?

我正在阅读Learn Has a Haskell for Great Good,但我不知道如何发音Haskell运算符。他们有“真实的”名字吗??例如,如何朗读这样的表达式?Just (+3) <*> Just 9我知道那>>=是“绑定”,但是其他人呢?由于Google不考虑非字母数字字符,因此很难进行有效的搜索...我意识到您可以创建自己的运算符,因此当然并非所有运算符都可以具有名称,但是我希望常见的运算符(例如,在Applicative或中定义的运算符Monad)必须具有名称...
查看完整描述

3 回答

?
慕仙森

TA贡献1827条经验 获得超7个赞

这是我的发音:


>> =绑定

>>然后

*>然后

->到                 a- > b:a到b 

<-绑定               (因为它对>> =无效)

<$>(f)地图

<$ map-replace by     0 <$ f:“ f map-replace by 0” 

<*> ap(ply)            (与Control.Monad.ap相同) 

$                          (无,与“” [空白] ) 

。管道连接到            。b:“ b管道到a”

!! 指数

!索引/严格     一个!b:“ a索引b”,foo!x:foo严格x 

<|>或/可选   expr <|> term:“ expr或term”

++ concat /加号/附加

[]空清单

:缺点

::类型/作为       fx :: Int:类型Int的fx

\ lambda

@ as                 go ll @(l:ls):ll as l cons ls〜 

懒惰               go〜(a,b):懒散一对a,b


查看完整回答
反对 回复 2019-11-05
?
MYYA

TA贡献1868条经验 获得超4个赞

| sym  | pronunciation                                    |

|------|--------------------------------------------------|

| |    | "such that"                                      |

| <-   | "is drawn from"                                  |

| =    | "is defined to be" / "is defined as"             |

| ::   | "has type" / "of type" / "is of type"            |

| ->   | "a function that takes ... and returns a ..." /  |

|      |                          "function that maps" /  |

|      |                          "is a function from" /  |

|      |                                          "to"    |

| $    | "apply"                                          |

| _    | "whatever"                                       |

| !!   | "index"                                          |

| ++   | "concat"                                         |

| []   | "empty list"                                     |

| :    | "cons"                                           |

| \    | "lambda"                                         |

| =>   | "implies" / "then"                               |

| *>   | "then"                                           |

| <$>  | "fmap" / "dollar cyclops"                        |

| <$   | "map-replace by"                                 |

| <*>  | "ap" / "star cyclops"                            |

| .    | "pipe to" / "compose" / "dot"                    |

| <|>  | "or"                                             |

| @    | "as"                                             |

| ~    | "lazy"                                           |

| <=<  | "left fish"                                      |


查看完整回答
反对 回复 2019-11-05
  • 3 回答
  • 0 关注
  • 518 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信