Question: Using Haskell 1. Define function toUppr :: Char -> Char that receives a character and returns the upper-case if the input is lowercase. Otherwise, it

Using Haskell

1. Define function toUppr :: Char -> Char that receives a character and returns the upper-case if the input is lowercase. Otherwise, it returns the input character. For example, if the input isg then the output must beG. If the input isH or @then the output must beH' or @,respectively.Hint: Check if the input is lowercase ([a..z]). If so, compute the index using the already-defined function findInd, and extract the associated character from[A..Z],using that index. Do not perform pattern matching on all possible alphabetic characters! Moreover,do not user built-in toUpper function.

2. Use list comprehensions to define function trimThird :: (Eq a) => [a] -> [a] that receives a list of items that at most appear once in that list, and eliminates every third item from that list. For example, if the input is[a..z]then the output must be"abdeghjkmnpqstvwyz".

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!