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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started