Commit f7859b4a by Christoph Ruegge

### Typo

parent d8ca6b17
 %% Cell type:markdown id: tags: # Exercises: io ## problem 1 Remember the phone book ```haskell phonebook :: [(String, String)] phonebook = [("Alice", "01234"),("Bob", "54321"), ("Jochen", "13243")] ``` Write a program that interactively asks for a user and returns their number. %% Cell type:code id: tags: ``` haskell ``` %% Cell type:markdown id: tags: ## problem 2 implement a type for a person, which contains name, age, gender, job (use nice types inside the person also, e.g. create a type for the gender) and make an instance of `Show` for it. Then get information from the user and return a `Person` %% Cell type:code id: tags: ``` haskell ``` %% Cell type:markdown id: tags: ## problem 3 read a file, which contains attributes for a `Person` in every line and returns the resulting list of persons. Create a fitting file yourself. %% Cell type:code id: tags: ``` haskell ``` %% Cell type:markdown id: tags: ## problem 4 extend problem 1 such that wrong inputs are caught and are asked again. Use the `Maybe`-Monad to accomplish this task %% Cell type:code id: tags: ``` haskell ``` %% Cell type:markdown id: tags: ## problem 5 use the csv-module `cassava` https://github.com/tibbe/cassava to read `Person`s from a csv-file, e.g. '../data/persons.txt'. make the reading of the file safe (no runtime exceptions) %% Cell type:code id: tags: ``` haskell ``` %% Cell type:markdown id: tags: ## problem 6 implement a game for guessing numbers, which works with the following scheme: think of a number between 1 and 100! is it 50? _lesser_ is it 50? _less_ is it 25? _greater_ ... is it 42? _yes_ finished. %% Cell type:code id: tags: ``` haskell ``` ... ...