是否有共同的Haskell运营商发音名称?

我正在读“ 学习你是一个很好的Haskell” ,我永远不知道如何发音Haskell运营商。 他们有“真实”的名字吗? ?

比如说,你怎么大声念出这样的表情呢?

Just (+3) <*> Just 9 

我知道>>=是“绑定”,但是其他的呢? 由于Google不考虑非字母数字字符,因此执行高效search很难。

我意识到你可以创build自己的操作符,所以当然不是所有的操作符都可以有名字,但我希望常用的名称(例如在ApplicativeMonad定义的名称)必须有名称。

这是我如何发音他们:

 >> =绑定
 >>那么
那么
 - >到a  - > b:a到b
 < - 绑定(因为它解除了>> =)
 ($)(f)地图
 <$ map-replace by 0 <$ f:“f map-replace by 0”
 ap(ply) (与Control.Monad.ap相同)
 $ (none,就像“”[whitespace])
 。 pipe道到一个。  b:“bpipe到一个”
 ! 指数
 ! 索引/严格一个!  b:“a index b”,foo!x:foo strict x
 </>或/ alternative expr <|>术语:“expr或term”
 ++ concat / plus / append
 []空列表
 :缺点
 ::types为fx :: Int:types为Int的fx
 \ lambda
 @ as go ll @(l:ls):go ll as l ls ls
 〜懒的去〜(a,b):去懒了一对,b
 | 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" | 

我个人的最爱是“左鱼” (<= <)和“右鱼” (> =>) 。 其中只有克莱斯利左派和右派组成的monad经营者。 撰写腥,撰写!

 + plus - minus (OR negative OR negate for unary use) * multiply OR times / divide . dot OR compose $ apply OR of 

我冒昧地把答案组装成一个非常简单的haskell程序,只通过模式匹配试图把haskell代码翻译成英文。

 -- literator main = translateLn <$> getLine >>= putStrLn translateLn :: String -> String translateLn = unwords . map t . words t :: String -> String -- t(ranslate) -- historical accurate naming t "=" = "is equal too" -- The Whetstone of Witte - Robert Recorde (1557) -- proposed namings -- src http://stackoverflow.com/a/7747115/1091457 t ">>=" = "bind" t "*>" = "then" t "->" = "to" -- a -> b: a to b t "<$" = "map-replace by" -- 0 <$ f: "f map-replace by 0" t "<*>" = "ap(ply)" -- (as it is the same as Control.Monad.ap) t "!!" = "index" t "!" = "index/strict" -- a ! b: "a index b", foo !x: foo strict x t "<|>" = "or/alternative" -- expr <|> term: "expr or term" t "[]" = "empty list" t ":" = "cons" t "\\" = "lambda" t "@" = "as" -- go ll@(l:ls): go ll as l cons ls t "~" = "lazy" -- go ~(a,b): go lazy pair a, b -- t ">>" = "then" -- t "<-" = "bind" -- (as it desugars to >>=) -- t "<$>" = "(f)map" -- t "$" = "" -- (none, just as " " [whitespace]) -- t "." = "pipe to" -- a . b: "b pipe-to a" -- t "++" = "concat/plus/append" -- t "::" = "ofType/as" -- fx :: Int: fx of type Int -- additional names -- src http://stackoverflow.com/a/16801782/1091457 t "|" = "such that" t "<-" = "is drawn from" t "::" = "is of type" t "_" = "whatever" t "++" = "append" t "=>" = "implies" t "." = "compose" t "<=<" = "left fish" -- t "=" = "is defined as" -- t "<$>" = "(f)map" -- src http://stackoverflow.com/a/7747149/1091457 t "$" = "of" -- src http://stackoverflow.com/questions/28471898/colloquial-terms-for-haskell-operators-eg?noredirect=1&lq=1#comment45268311_28471898 t ">>" = "sequence" -- t "<$>" = "infix fmap" -- t ">>=" = "bind" -------------- -- Examples -- -------------- -- "(:) <$> Just 3 <*> Just [4]" -- meaning "Cons applied to just three applied to just list with one element four" t "(:)" = "Cons" t "Just" = "just" t "<$>" = "applied to" t "3" = "three" -- this is might go a bit too far t "[4]" = "list with one element four" -- this one too, let's just see where this gets us -- additional expressions to translate from -- src http://stackoverflow.com/a/21322952/1091457 -- delete (0, 0) $ (,) <$> [-1..1] <*> [-1..1] -- (,) <$> [-1..1] <*> [-1..1] & delete (0, 0) -- liftA2 (,) [-1..1] [-1..1] & delete (0, 0) t "(,)" = "tuple constructor" t "&" = "then" -- flipped `$` -- everything not matched until this point stays at it is tx = x