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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:48:51+00:00 2026-06-08T12:48:51+00:00

I was bored one day and wanted to exercise my brain, so I decided

  • 0

I was bored one day and wanted to exercise my brain, so I decided to do the 99 Haskell Problems but restricted myself to doing them in point-free style. A problem that seems to crop up a lot when I’m doing things in point-free style is this: How do you apply multiple functions to the same value while keeping each result as an independent entity? Using pointed notation:

foobar x = [id x, reverse x]

And what I’ve come up with so far in point-free notation:

foobar' = `map` [id, reverse] ($ x)

I can’t seem to get that x off the end of there.

  • 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-08T12:48:53+00:00Added an answer on June 8, 2026 at 12:48 pm

    Others have already posted how you can do this using the Reader monad, but that’s not the only way. It turns out that your second function is pretty close. I think you meant to post

    foobar' x = (`map` [id, reverse]) ($ x)
    

    Since the x is already near a rightmost position, you’re almost there. First, transform the section ($ x) into a function, because it’s a bit easier to work with:

    -- by the definition of a right operator section
    foobar'2 x = (`map` [id, reverse]) (\y -> ($) y x)
    

    Next remove the x from the lambda body by bringing a new variable into scope, and applying the function to x

    -- lambda abstraction I think...
    foobar'2 x = (`map` [id, reverse]) $ (\z y -> ($) y z) x
    

    Rewrite this application as a function composition, and then you can eta reduce:

    -- by definition of '.'
    foobar'3 x = (`map` [id, reverse]) . (\z y -> ($) y z) $ x
    
    -- eta reduction
    foobar'4 = (`map` [id, reverse]) . (\z y -> ($) y z)
    

    Finally, notice that we can replace the lambda with a function

    -- by definition of `flip`
    foobar'5 = (`map` [id,reverse]) . flip ($)
    

    and you have a point-free form.

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

Sidebar

Related Questions

I was getting bored with my XP box one day, so I decided to
If not, does anyone care to write one? I would do it myself...but I
Maybe it's something I'm doing wrong. I'm just learning Linq because I'm bored. And
From Day One I was told that each third-party iOS app was perfectly sand-boxed
I'm bored, and decided to write a script for a text-based adventure of mine
I'm playing around with display properties trying to get the hang of them. One
I've been sick for the past week and terribly bored, so I decided to
I fear that I miss a very basic point, but I'm stuck at the
I was bored one rainy afternoon and came up with this: int ia_array[5][5][5]; //interger
I got bored earlier and wondered if you could execute terminal commands on the

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.