I'm reading Learn You a Haskell for Great Good, and I never know how to pronounce the Haskell operators. Do they have "real" names? ?

For instance, how do you read aloud an expression like this one?

Just (+3) <*> Just 9

I know that >>= is "bind", but what about the others? Since Google doesn't take non-alphanumeric characters into account, it's kind of hard to do an efficient search...

I realize you can create your own operators, so of course not all operators can have names, but I expect that the common ones (e.g. those defined in Applicative or Monad) must have names...

share|improve this question
    
Its a good question, and I'm not aware of any answers. Perhaps we need a naming scheme, or perhaps library authors should provide pronounceable names as part of Haddock docs. – Paul Johnson Oct 12 '11 at 21:42
2  
Very good question. Usually I read <*> as "apply" and <$> as "fmap". As for the others I have no idea. – DuoSRX Oct 12 '11 at 21:46
3  
Is this a duplicate of "Haskell: How is <*> pronounced?"? Even if it isn't, its answers are probably worth checking out. – Antal Spector-Zabusky Oct 12 '11 at 21:46
8  
Also, check out the Haskell wiki's page on pronunciation. It's incomplete, but relevant. – Antal Spector-Zabusky Oct 12 '11 at 22:33
2  
() is pronounced unit. One time I found myself stuck in front of an audience of a couple of hundred functional programmers not knowing how to pronounce that on my slide. – sigfpe May 31 '14 at 15:35
up vote 143 down vote accepted

Here is how I pronounce them:

>>=     bind
>>      then
*>      then
->      to                a -> b: a to b
<-      bind              (as it desugars to >>=)
<$>     (f)map
<$      map-replace by    0 <$ f: "f map-replace by 0"
<*>     ap(ply)           (as it is the same as Control.Monad.ap)
$                         (none, just as " " [whitespace])
.       pipe to           a . b: "b pipe-to a"
!!      index
!       index / strict    a ! b: "a index b", foo !x: foo strict x
<|>     or / alternative  expr <|> term: "expr or term"
++      concat / plus / append
[]      empty list
:       cons
::      of type / as      f x :: Int: f x of type Int
\       lambda
@       as                go ll@(l:ls): go ll as l cons ls
~       lazy              go ~(a,b): go lazy pair a, b
share|improve this answer
83  
to me, (.) is "compose". – luqui Oct 12 '11 at 22:13
38  
I usually rather pronounce (.) as of and ($) as applied to : f . g . h $ x is hence read f of g of h applied to x. But I understand divergence in this point of view! – Ptival Oct 12 '11 at 22:21
27  
I think pronouncing (.) as "after" is more sensible. Composition can be denoted in two directions, and calling it "after" immediately explains how it works, too. – user824425 Oct 12 '11 at 23:05
1  
@Tinctorius, whether composition is after or before depends on a point of view that is not universal. For example, in const 42 . fix id, can we really say const 42 comes "after" an infinite loop? – luqui Oct 12 '11 at 23:59
3  
I would call ++ "append" instead of concat, since concat is already a thing in Haskell and it's utility is very different. – Benjamin Kovach Aug 24 '12 at 20:52
| 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"                                      |
share|improve this answer
1  
Thanks for your answer. "dollar cyclop" made me laugh :) – Thomas Levesque May 28 '13 at 22:13
5  
Cyclops is singular, you don't need to drop the s. :) – Rahul Jan 5 '14 at 11:43

My personal favorites are "left fish" (<=<) and "right fish" (>=>). Which are just the left and right Kleisli composition of monads operators. Compose fishy, compose!

share|improve this answer
    
+      plus
-      minus (OR negative OR negate for unary use)
*      multiply OR times
/      divide
.      dot OR compose
$      apply OR of
share|improve this answer
9  
These ones are quite obvious... My question was about the more unusual operators like <*>, >>... – Thomas Levesque Oct 12 '11 at 22:04
14  
For completeness. – Thomas Eding Oct 12 '11 at 22:06

I took the liberty to assemble the answers into a very simple haskell program only through pattern matching tries to translate haskell code into english.

-- 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"         -- f x :: Int: f x 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-e-g?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
t x = x
share|improve this answer

protected by fuz May 31 '14 at 17:23

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.