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

  Response to an incident involving a computer

Response to an Incident Involving a Computer

  Explaining data-tlb hit and data-cache hit

Upon a load instruction, event "data-TLB hit" followed by "data-cache hit" is the most probable to occur among four possibilities of Cartesian product.

  Firms that make game systems like playstation

Firms that make game systems like Playstation and Nintendo typically charge a price close to average cost on the game system itself, and do not change that price even when the systems are scarce or demand increases. Why might this be a profit-maximiz..

  The development of cad and bim in architectural use

A brief history report about the development of CAD and BIM in architectural use supported with pictures and diagrams and perhaps a simple timeline. all in one A2 page. prefered page format is indesign.

  Define function that takes an argument in name of a csv file

Define a function that takes an argument in the name of a CSV file. This file has a single row containing letter grades (A-F) separated by comma (hence CSV file). Your function should print the distribution of grades.

  Company wants to develop an automated system

An online chocolate company wants to develop an automated system to enable them to become more eco friendly as well as save time and money. They have invested in a range of packing of specific sizes and want to develop a software system to make max..

  Two instance variables

Two instance variables

  Program to clear register a

Write a program to clear Register A, add five to Register A 10 times, and place the result in RAM Location $2000. Use a RAM location for holding the counter.

  Write a program that checks a text file for several

Write a program that checks a text file for several formatting and punctuation matters. The program asks for the names of both an input file and an output file.

  Describe the three principles of direct manipulation

Describe the three (3) principles of direct manipulation and give examples as to how they are used in video game controls. Analyze video game-type interfaces and discuss three (3) reasons why video game-type interfaces would not be effective for re..

  How does disaster recovery planning ensure business continui

How does disaster recovery planning ensure business continuity?

  Despite being a fairly old technology

Despite being a fairly old technology, menu-driven interfaces are very common in user interface design. Menu-driven interfaces consist of a series of screens which are navigated by choosing options from lists.

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