LGA-03: Haskell Intro

Note

You should divide this assignment up between your group sst. every question is covered at least once (but potentially more) and every person preforms an equal number of questions.

All of these questions are asking about Haskell. You may find the LYH textbook useful.

  1. What do each of these list notations mean?
    1. [1, 2, 3, 4, 5]
    2. [1..10]
    3. [1..]
  2. What is the : operator called? How is it used? Can you write an example function which uses it? Write an example for at least a string and a list of integers.
  3. What is the ++ operator called? How is it used? Can you write an example function which uses it? Write an example for at least a string and a list of integers.
  4. What is the !! operator called? How is it used? Can you write an example function which uses it? Write an example for at least a string and a list of integers.
  5. What are the head and init functions? How are they used? What is the difference between the two?
  6. What are the tail and last functions? How are they used? What is the difference between the two?
  7. What are the take and drop functions? How are they used? What is the difference between the two?
  8. What is the zip function? How is it used? Can you write an example function which uses it?
  9. What is the elem function? How is it used? Can you write an example function which uses it? Show how to use it for both infix and prefix notations.