Generate a recursive sequence

Assignment Help Basic Computer Science
Reference no: EM13871432

Given below is a small haskell function used to generate a recursive sequence. I'm getting a type error while using floor function. floor function is expecting RealFrac, I suppose. The code and error are given below.

main = do
print( funSeq 9)

funSeq n = do 
if (n<4)

then 1

else floor ((funSeq (n-1) + funSeq (n-2)) * (funSeq (n-3)/ funSeq(n-4)))

Error:

No instance for (RealFrac a0) arising from a use of 'funSeq'

Reference no: EM13871432

Questions Cloud

Describe the effects of power and commitment : Describe the effects of power, commitment, and trust on long-term partnerships.
Create columns of data for 250 musical recordings : Columns should include Artist or Recording Group,  name of recording (song), genre, length, (instrumental, vocal with instrumental backup, or only vocal). Year song was written (this might take a Google search for some) and year of recording. See if ..
Composite magic number is a positive integer : Question 1A composite Magic number is a positive integer which is composite as well as a magic number. Composite number: A composite number is a number which has more than two factors. For example: 10 Factors are: 1,2,5,10 Magic number: A Magic numbe..
Define the term reporting entity : Define the term reporting entity.
Generate a recursive sequence : Given below is a small haskell function used to generate a recursive sequence. I'm getting a type error while using floor function. floor function is expecting RealFrac, I suppose. The code and error are given below.main = do
Which groups are the major external users of governmental : Which groups are the major external users of governmental financial reports?
Justify the importance of validation : 1. Analyze the purpose of validating forensic data and determine why this is a necessary component of the investigation and analysis process. 2. As a system forensics manager, justify the importance of validation and determine the best method to use.
Compare and contrast the social contract theories of hobbes : Discuss the strengths and weaknesses of presidential or parliamentary systems of government. Use examples from Western liberal democracies to illustrate your answer.
Process stream leaving a storage vessel on a chemical plant : It has been found that to improve product quality, a process stream leaving a storage vessel on a chemical plant now needs to be cooled from a temperature of 100ºC to a temperature of 50ºC before entering the reactor. The ambient air temperature a..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Write the algorithm to compute compound interest

write the algorithm to compute compound interest

  Write about oracle 10g find vulnerabilities

Write about Oracle 10g find vulnerabilities, you should also include recommendations to address those vulnerabilities. Write as simple as possible.

  You have been asked to develop uml diagrams to graphically

you have been asked to develop uml diagrams to graphically depict and describe the architecture of two 2 unrelated

  How does the failure region ofthe equality constraint differ

How does the failure region of the equality constraint differ from that of the inequality constraint studied in the earlier examples?

  Write a method that has the radius of the circle passed

Write a method that has the radius of the circle passed into it. It computes the area, and returns the area to the main method.

  Ladybug extends class critter

Ladybug extends class Critter. It changes to the color of another critter (and only critters) that it approaches. When encountering a flower, it will change all of the flower colors to the ladybug's current colo

  How is hardware different from software

what is a Web application? What are some features of a Web 2.0 site and how is hardware different from software?

  Case study - casey anthony trial

Determine whether the software issue, which caused inaccurate evidence in the trial, would've affected your perception of the prosecution's case if you were a juror in this trial.

  Innovative uses of wireless networks

In your own words, explain how wireless networking technologies, combined with sensors, are used to create the virtual fence product. Your response should be 150+ words and include APA format in-text citations and references for any information t..

  Draw the uml class diagram for the schoolbus

The declaration for the SchoolBus class. Instances of the SchoolBus class represent school buses of varying sizes. The class provides functions to add and remove students.

  It systems do not operate alone in the modern enterprise

It is important to know the different interconnections each system has. IT systems do not operate alone in the modern enterprise, so securing them involves securing their interfaces with other systems as well.

  Calculate and display running total of yesterday receipts

calculate and display the running total of yesterday's receipts. The program should use the method calculate-Charges to determine the charge for each customer.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd