FAQ Database Discussion Community


Why is the unary minus operator problematic in this expression: (- 2) 1? [duplicate]

haskell,infix-operator
This question already has an answer here: Prefix form of unary operator in Haskell 4 answers All of the following expressions get evaluated without mishap: (+2) 1 -- 3 (*2) 1 -- 2 ((-)2) 1 -- 1 (2-) 1 -- 1 (/2) 1 -- 0.5 (2/) 1 -- 2.0...

Why is f <$> g <$> x equivalent to (f . g) <$> x although <$> is not right-associative?

haskell,syntax,infix-notation,applicative,infix-operator
Why is f <$> g <$> x equivalent to (f . g) <$> x although <$> is not right-associative? (This kind of equivalence is valid in a popular idiom with plain $, but currently $ is right-associative!) <*> has the same associativity and precedence as <$>, but behaves differently! Example:...

What is python's not? A special function type?

python,r,infix-operator
In R, ! is really an infix operator `!`, so statements like Map(`!`,c(T,F,F)) are totally valid. Is there a way to access the first order object underlying not in Python? I have been googling with no success....

Haskell: Why aren't infix type constructors allowed?

haskell,types,constructor,infix-operator
In the Haskell 98 report, I found this: The syntax for Haskell type expressions is given above. Just as data values are built using data constructors, type values are built from type constructors. As with data constructors, the names of type constructors start with uppercase letters. Unlike data constructors, infix...