Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

truth table 4 this A A NOTDO B AND1 Y OR1 AND2 D

Answered: 1 week ago