Question: Using notepad++ and win GHCi page please 3. Write a polymorphic function: rotate :: [a] -> [a] which swaps the first two elements of a

 Using notepad++ and winGHCi page please 3. Write a polymorphic function:

Using notepad++ and winGHCi page please

3. Write a polymorphic function: rotate :: [a] -> [a] which swaps the first two elements of a list (or leaves the list unchanged if it contains fewer than two elements). (For example, rotate (5,7,2,4] = [7,5,2,4].)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!