Nightclazz Zenika Bordeaux
Civodul
9,385 views
Les tuples
Déclaration d'un tuple
1
2
createTuple :: Int -> String -> (Int, String)
createTuple intValue stringValue = (0, "")
Retourner le premier élément
1
2
3
firstElement :: (Int, String) -> Int
firstElement tuple = 0
Retourner le second élément
1
2
3
secondElement :: (Int, String) -> String
secondElement tuple = ""
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.