Personal tools

La ce serveste apostroful invers (`) ?

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
Transforma o fucntie cu doua argumente intr-un operator infixat.
+
Transforma o functie cu doua argumente intr-un operator infixat.
 
Exemplu:
 
Exemplu:
 
g :: Int -> Int -> Int
 
g :: Int -> Int -> Int

Revision as of 18:13, 28 November 2006

Transforma o functie cu doua argumente intr-un operator infixat.

 Exemplu: 
  g :: Int -> Int -> Int
  g a b = a+b 
 Functia se poate folosi acum si ca un operator: 1 `g` 2 
 ... ceea ce e echivalent cu: g 1 2