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

  • SEARCH
  • Home
  • 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 6738963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:25:52+00:00 2026-05-26T11:25:52+00:00

Funcional Programming is very new to me and can’t seem to understand how to

  • 0

Funcional Programming is very new to me and can’t seem to understand how to use a function as an argument for another function. finalvalue is supposed to calculate the final value after a period, and finalvalue2 after 2 periods.

interest :: Float -> Float -> Float
interest capital rate = capital * rate * 0.01

finalvalue :: Float -> Float -> Float
finalvalue capital rate = capital + interest capital rate

finalvalue2 :: Float -> Float -> Float
finalvalue2 capital rate = finalvalue capital rate + interest finalvalue capital rate rate

I get this:

Couldn't match expected type `Float'
       against inferred type `Float -> Float -> Float'
In the first argument of `interest', namely `finalvalue'
In the second argument of `(+)', namely
    `interest finalvalue capital rate rate'
In the expression:
      finalvalue capital rate + interest finalvalue capital rate rate

I’m sure I’m missing a basic point here but I just can’t find out what it is.

  • 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-26T11:25:52+00:00Added an answer on May 26, 2026 at 11:25 am
    interest finalvalue capital rate rate
    

    Here you’re calling interest with four arguments, the first of which is a function. Since interest‘s first argument needs to be a Float, not a function, you get the error message you do.

    What you probably intended to write was interest (finalvalue capital rate) rate, which calls interest with two floats, the first of which is the result of calling finalvalue with capital and rate as arguments.

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

Sidebar

Related Questions

I understand very clearly the difference between functional and imperative programming techniques . But
I am very new to Haskell and to functional programming in general. My question
Please bear with me as I am very new to functional programming and Haskell.
What does a very general function look like in functional programming? Somebody said we
Functional programming .. is like classic ( Mark Twain's type ). While reading another
Being relatively new to functional programming, I expend lots of energy wondering is this
I am new to functional programming, and now learn Haskell. As an exercise I
In the context of functional programming which is the correct term to use: persistent
I have always thought that functional programming can be done in Python. Thus, I
I have a university course about functional programming, where I use SML. As a

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.