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, "")
Enter to Rename, Shift+Enter to Preview
Retourner le premier élément
1
2
3
firstElement :: (Int, String) -> Int
firstElement tuple = 0
Enter to Rename, Shift+Enter to Preview
Retourner le second élément
1
2
3
secondElement :: (Int, String) -> String
secondElement tuple = ""
Enter to Rename, Shift+Enter to Preview
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content