Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Les tuples
Déclaration d'un tuple
1
2
createTuple :: Int -> String -> (Int, String)
createTuple intValue stringValue = (0, "")
Press desired key combination and then press ENTER.
Retourner le premier élément
1
2
3
firstElement :: (Int, String) -> Int
firstElement tuple = 0
Press desired key combination and then press ENTER.
Retourner le second élément
1
2
3
secondElement :: (Int, String) -> String
secondElement tuple = ""
Press desired key combination and then press ENTER.
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content