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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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