Question: Haskell Programming Assignment 1 . Write a Haskell function factorial that calculates the factorial of a given integer n . Ensure the function handles edge

Haskell Programming Assignment1. Write a Haskell function factorial that calculates the factorial of a given integer n.Ensure the function handles edge cases like 0 and negative numbers.2. Implement a Haskell function isPrime that determines whether a given positiveinteger n is a prime number or not.3. Create a Haskell function fibonacci that generates the nth Fibonacci number usinga recursive approach. Make sure to handle edge cases, such as when n is 0 or 1.4. Write a Haskell function reverseList that reverses a list (or a string) using recursion.For example, reverseList [1,2,3] should return [3,2,1].5. Implement a Haskell function isPalindrome that checks if a given string is apalindrome (reads the same forwards and backward), ignoring spaces and casesensitivity. For example, "A man a plan a canal Panama" should be considered apalindrome.

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 Accounting Questions!