title: How to work with data structures in Haskell?
body: <p>I'm assigned to make a simple program that contains a students array (which should contain students data), I know that Haskell is not an OO programming language, I was looking for a way for structuring my student data, I thought of nesting tuples into arrays and then into the students array, but the problem is that I have different data types (String, int ...etc.) so tuples doesn't work, I also found this <a href="https://stackoverflow.com/a/5414545/12682028">answer</a> on Stack Overflow that creates a new data type from what I understood but I failed to implement it, here is what I have tried:</p>
  
  <pre class="lang-js prettyprint-override"><code>data Student =
    Student { name :: Char
     , surename :: Char 
     , moy1 :: Int
     , coef1 :: Int
     , moy2 :: Int
     , coef2 :: Int
     , moy3 :: Int
     , coef3 :: Int
     , mg :: Int 
     }
  
  main :: IO ()
  main = do 
   putStrLn "Enter students data:"
   students &lt;- initializeStudents 10
   putStrLn "calculate student average ?"
   if(reponse == "yes") then putStrLn "Enter the student firstname"
                             first &lt;- getLine
                             // search on the array student for the student with firstname == first 
                             // then 
                             // putStrLn $ "student average is " ++  calculateData student
   else putStrLn "Okey"
  
   initializeStudents :: Int -&gt; [Student]
   initializeStudents count = map (\_ -&gt; Student "" "" 0 0 0 0 0 0 0 ) [1..count]
  
  
  calculateData :: student -&gt; Int
  calculateData student = (a +  b +  c) / d
                          where a = student.moy1 * student.coef1
                                b = student.moy2 * student.coef2
                                c = student.moy3 * student.coef3
                                d = student.coef1 + student.coef2 + student.coef3
  
  
  saisirDonnees:: Int -&gt; [student] -&gt; IO [student]
  saisirDonnees 0 studentsSoFar = return studentsSoFar
  saisirDonnees n studentsSoFar = do
    student &lt;- getLine
    saisirDonnees(n-1) (studentsSoFar ++ [student])
  </code></pre>
  
  <p>Nothing seems to work.</p>