Question: Haskell Programming -- 1. Fill in the gaps. Complete the following definitions. It does not -- matter what the definitions do as long as they
Haskell Programming
-- 1. Fill in the gaps. Complete the following definitions. It does not
-- matter what the definitions do as long as they are type correct. For e1, e2,
-- e5, and e7, this means uncommenting the type declaration and replacing the ? with
-- type(s) correspond to the definitions directly below them. For e3, e4,
-- e6, and e8, this means replacing the undefined with an expression of appropriate type.
--
-- Note: you should complete each definition one at a time.
--e1 :: ?
e1 = [True,False,True]
--e2 :: ?
e2 = [[1,2],[3,4]]
e3 :: (Char,Bool)
e3 = undefined
e4 :: [(String,Int)]
e4 = undefined
--e5 :: ? -> ?
e5 n = n*2
e6 :: Int -> Int -> Int
e6 = undefined
--e7 :: ? -> ?
e7 (x,y) = (y,x)
e8 :: a -> (a,a)
e8 = undefined
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
