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 8431913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:59:00+00:00 2026-06-10T05:59:00+00:00

I have a problem with implementing FP (Backus) interpreter in Haskell. FP functions look

  • 0

I have a problem with implementing FP (Backus) interpreter in Haskell.

FP functions look like this:

[+,*]:<2,3>

should result with

<+:<2,3>, *:<2,3>> ->
<5,6>

meaning that every function from list on left side should be performed on every every element of a list on a right side.

What I understand is that I need something similar to “map” function, but map applies one function on a list, and I need list of functions on a list of values.

Thank you in advance! 🙂

EDIT:

Since I wasn’t precise, here is my code that doesn’t work:

apply :: [String] -> [Integer] -> [Integer]
apply fs v = [((apply_f f x) | f <- fs | x <- v)]

apply_f :: String -> [Integer] -> [Integer]
apply_f "+" v = [(sum v)]
apply_f "*" v = [(product v)]

I can’t figure out why… 🙁

EDIT 2:

Sorry, I was too tired from working all day on this.
Problem is that I don’t need second pipe, just first one:

apply fs v = [ apply_f f v | f <- fs ]

Now, everything works just fine, thank you very much! 🙂

  • 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-06-10T05:59:01+00:00Added an answer on June 10, 2026 at 5:59 am

    Do you want something like this?

    [f x | f <- [(+3),(*2)], x <- [1..2]]
    

    Output:

    [4,5,2,4]
    

    EDIT:

    So something like this?

    [[f x | f <- [(+3),(*2)]] | x <- [1..2]]
    [[4,2],[5,4]]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem implementing this example in java, tableFilterDemo is a class that
I am running problems in implementing LIKE in PDO I have this query: $query
i have a little problem implementing some serialization/deserialization logic. I have several classes that
I'm new to C++ and I have this problem that the compiler is throwing
I have problem with implementing Rich Text Editor (all that i tried, e.g. TinyMCE).
I have a problem implementing a for loop. I get this error when I
Hi I'm having a problem implementing this method. I have added using System.Management but
I have a problem implementing this logic in my project. Im using ServiceLoader and
I have a problem implementing an API that works with Java, but fails to
I have this problem. I have a graph of n nodes that I want

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.