Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HASKELL - Complete the code module Ex05_TypesIntroSpec ( spec ) where import Test.Hspec main :: IO () main = hspec spec {- Create the `removeNonUppercase`

HASKELL - Complete the code

module Ex05_TypesIntroSpec ( spec ) where import Test.Hspec main :: IO () main = hspec spec {- Create the `removeNonUppercase` function with proper type -} {- Create the addThree function with proper type info -} spec :: Spec spec = do describe "Functions have types" $ do it "can use a function with type" $ do pending -- removeNonUppercase "HelloWORLD" `shouldBe` "HWORLD" -- addThree 1 2 3 `shouldBe` 6 describe "Type classes" $ do it "can order strings" $ do pending "Abrakadabra" == "Zebra" `shouldBe` True -- use the words "Abrakadabra" "Zebra" -- GT `shouldBe` LT -- x >= y `shouldBe` True -- 3 functionName 5 `shouldBe` GT it "can show anything" $ do pending -- 3 `shouldBe` "3" -- True `shouldBe` "True" it "can read strings into values" $ do pending -- "True" || False `shouldBe` True -- "8.2" + 3.8 `shouldBe` 12 -- ("[1,2,3,4]" :: [Int]) `shouldBe` [1,2,3,4] -- ("(3, 'a')" :: (Int, Char)) `shouldBe` (3, 'a') it "can provide ranges, next items for Enum types" $ do pending -- `shouldBe` "abcde" -- `shouldBe` [LT,EQ,GT] -- `shouldBe` [3,4,5] -- succ to get the next -- `shouldBe` 'C' describe "Num is a numeric typeclass" $ do it "can act like numbers" $ do pending -- use the type -- (20 :: ) `shouldBe` 20 describe "fromIntegral is there historical reasons" $ do it "can add Int and Floating point numbers" $ do pending -- from... function -- (length [1,2,3,4]) + 3.2 `shouldBe` 7.2

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

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago