Commit 81224b67 authored by Sandra Dylus's avatar Sandra Dylus
Browse files

Fix typos

parent 283f90e4
......@@ -4,13 +4,13 @@
>
> import Functional.Lecture.InputOutput (getNumber)
1. In Haskell `String`s are list of `Char`s. The following definitions should transform the given string "HelloWorld" such that it yields the string specified by the comment above. You are only allow to use generic list functions like `map`, `foldr`, `filter`, but no manual pattern matching, for the implementation.
1. In Haskell `String`s are list of `Char`s. The following definitions should transform the given string "HelloWorld" such that it yields the string specified by the comment above. You are only allowed to use generic list functions like `map`, `foldr`, `filter`, but no manual pattern matching, for the implementation.
> -- str1 "HelloWorld" = "HelloWorld!"
> str1 :: String -> String
> str1 = error "str1: Implement me!"
>
> -- str2 "HelloWorld" = IfmmpXpsme"
> -- str2 "HelloWorld" = "IfmmpXpsme"
> str2 :: String -> String
> str2 = error "str2: Implement me!"
>
......@@ -33,11 +33,11 @@ Hint: You should reuse `getNumber` defined in the lectures as well as the helper
> getInBounds :: Int -> Int -> IO Int
> getInBounds = error "getInBounds: Implement me!"
>
> inBounds :: Int -> (Int,Int) -> Bool
> inBounds :: Int -> ((,) Int Int) -> Bool
> inBounds x (xMax, xMin) = (x <= xMax) && (x >= xMin)
3. Implement a more general function `geStringtWithCondition :: (String -> Bool) IO String` that reads a string from the user and only yield this value if the string obeys to the corresponding prediate. If the predicate does not hold, the user should be informed to try it again.
3. Implement a more general function `getStringWithCondition :: (String -> Bool) -> IO String` that reads a string from the user and only yield this value if the string obeys to the corresponding prediate. If the predicate does not hold, the user should be informed to try it again.
> getStringWithCondition :: (String -> Bool) -> IO String
> getStringWithCondition pStr = error "getWithCondition: Implement me!"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment