Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6901895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:43:50+00:00 2026-05-27T07:43:50+00:00

I begin a new Fibonacci algorithm, but it’s not working. It’s very simple: –fiblista

  • 0

I begin a “new” Fibonacci algorithm, but it’s not working. It’s very simple:

    --fiblista 0 n = [0]
    --fiblista 1 n = [1]
    fiblista a n 
        | a <= n = (0:1:tail, ((fiblista!!d)+(fiblista!!c))) fiblista a+1 n 
        where d = a - 1 
              c = a - 2

Example:

http://dl.dropbox.com/u/27560194/example.png

First error code: parse error on input `=’

Any idea how to fix this algorithm?
I read thousand of example Fibonacci algorithm in haskell, but I need to write a new one.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:43:51+00:00Added an answer on May 27, 2026 at 7:43 am

    Your indentation is wrong. Try:

    fiblista 0 n = [0]
    fiblista 1 n = [1]
    fiblista a n 
        | a < n = (tail, ((fiblista!!d)+(fiblista!!c))) fiblista a+1 n 
      where d = a - 1 
            c = a - 2
    

    But this code still won’t compile. fiblista is a function with two parameters, but you also try to use it as a list. You also try to use a tuple as a function.

    If you are still stuck writing your function, it would help if you could describe what the parameters to fiblista are, and what it should return. Include a type signature.

    Is this homework?


    So.

    fiblista a n is a list of Fibonacci numbers, starting with the ath Fibonacci number, and ending with the (n-1)th Fibonacci number.

    This is a list question.

    Imagine you had a list of all the Fibonacci numbers. (This would be the same as fiblista 0 ∞, if ∞ was a valid Haskell value.) You would then be able to use the standard list functions take and drop to calculate fiblista a n.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm relatively new to J2ME and about to begin my first serious project. My
I will begin this question by admitting I am very new to MVC. The
First, we currently have the behavior that's desired, but it's not trivial to maintain
I'm new to the Win32 API and the many new types begin to confuse
I am relatively new to C# and each time I begin to work on
I'm completely new to ANTLR and EBNF grammars to begin with, so this is
To begin with, I'm not even sure, if it is the right way to
I am very new to Triggers and so this is a very beginner question.
all i want to do is end the current, and begin a new UL
In xhtml I usually nest lists, close the tag then begin a new before

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.