content: -- Exemple addition de terme dans une liste
  {-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
  {-# HLINT ignore "Use foldr" #-}
  {-# HLINT ignore "Redundant ==" #-}
  {-# HLINT ignore "Use null" #-}
  
  f :: [Int]-> Int
  f [] = 0
  f (x:xs) = x + f xs
  
  -- Exercice 1 / 2 / 3 / 4/ 6
  
  -- Exercice 1 
  sumVector :: [(Double, Double)] -> Double
  sumVector [] = 0
  sumVector (x:xs) = normeVecteur x + sumVector xs
      where normeVecteur x = sqrt (fst x ^ 2 + snd x^2)
  
  sumVector2 :: [(Double, Double)] -> Double
  sumVector2 x = sum (map normeVecteur x)
      where normeVecteur x = sqrt (fst x ^ 2 + snd x ^2)
  
  -- Version Terminale
  sumVectorTerm :: [(Float, Float)] -> Float
  sumVectorTerm vecteurs = sumVectorTermAux vecteurs 0
      where sumVectorTermAux [] acc = acc
            sumVectorTermAux((v1,v2):vs) acc = sumVectorTermAux vs (acc + norme (v1,v2))
            norme (x1, x2) = sqrt $ x1^2 + x2^2
  
  -- Exercice 2
  orall :: [Bool] -> Bool
  orall [] = False
  orall (x:xs) = x || orall xs
  
  -- Version Terminale
  orallTerm :: [Bool] -> Bool
  orallTerm xs = orallTermAux xs False
      where orallTermAux [] acc = acc
            orallTermAux (x:xs) acc = orallTermAux xs (acc || x)
  
  orallTerm2 :: [Bool] -> Bool
  orallTerm2 bs = (length $ filter (==True) bs) > 0
  
  orallTerm3 :: [Bool] -> Bool
  orallTerm3 = any (==True)
  
  -- Exercice 3
  compte :: (a -> Bool) -> [a] -> Int
  compte f ls = length $ filter f ls
  
  -- Exercice 4
  pourTout :: (a -> Bool) -> [a] -> Bool
  pourTout f ls = length (filter (== False) (map f ls)) == 0
  
  -- Exercice 6
  myconcat :: [[a]] -> [a]
  myconcat [] = []
  myconcat (x:xs) = x ++ myconcat xs
  
  -- Version Terminale
  myconcatTerm :: [[a]] -> [a]
  myconcatTerm ls = myconcatTermAux ls []
      where myconcatTermAux [] acc = acc
            myconcatTermAux (x:xs) acc = myconcatTermAux xs (acc ++ x)
  
  -- Exercice 7
  combine :: [String] -> String
  combine [] = ""
  combine [x] = x
  combine (x:xs) = x ++ ", " ++ combine xs
  
  -- Exercice 8
  positivise :: (Ord a,Num a) => [a] -> [a]
  positivise ls = map (\x -> if x < 0 then -x else x) ls
  
  -- Exercice 9
  substitute :: Eq a => a->a->[a]->[a]
  substitute a b = map (\x -> if x == a then b else x)
  
  -- Exercice 9
  tronq :: [a]->[a]
  tronq (x:[]) = []
  tronq (x:xs) = x : tronq xs
  
  -- Exercice 10
  codeVille :: [(Int, String)] -> Int -> [String]
  codeVille [] a = []
  codeVille (x:xs) a = if fst x == a then snd x : codeVille xs a else codeVille xs a