Haskell Serious Accent

I am new to Haskell programming. I am trying to understand the syntax and semantics of this language. I'm a little curious about the semantics of a serious accent. Why does this code work when we use a serious accent?

elem' :: (Eq a) => a -> [a] -> Bool  
elem' a [] = False  
elem' a (x:xs)  
    | a == x    = True  
    | otherwise = a `elem'` xs {-grave accent used in this line -}
+4
source share
1 answer

Inverted commas are used to process any binary function as an infix operator.

a `elem'` xs

coincides with

elem' a xs

This is a complement to using (+)to use the binary operator as a function:

(+) 3 5

coincides with

3 + 5
+12
source

Source: https://habr.com/ru/post/1530849/


All Articles