Question
What are the types of the following functions?second xs = head (tail xs)swap (x,y) = (y,x)pair x y = (x,y)double x = x*2palindrome xs = reverse xs == xstwice f x = f (f x)
Step 1
second xs = head (tail xs) This function takes a list as input and returns the second element of the list. The type of this function is: second :: [a] -> a Show more…
Show all steps
Your feedback will help us improve your experience
James Kiss and 77 other educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Each of the following functions is one-to-one. Find the inverse of each function and express it using $f^{-1}(x)$ notation. $f(x)=\frac{1}{x}$
Exponential and Logarithmic Functions
Inverse Functions
Each of the following functions is one-to-one. Find the inverse of each function and express it using $f^{-1}(x)$ notation. $f(x)=\frac{2}{x-3}$
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD