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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:08:12+00:00 2026-05-31T14:08:12+00:00

I keep practicing my F# skills on Project Euler. While doing problem 19 (a

  • 0

I keep practicing my F# skills on Project Euler. While doing problem 19 (a drastic anticlimax after the cool problem 18) I found myself in need of performing a modulo 7 operation on a list of numbers. I tried this:

List.map ((%) 7)

And ended up with the wrong list of numbers. That’s because List.map binds the second argument, so instead of calculation n%7 it ended up calculating 7%n . Is there a way to make List.map bind the first argument, or a standard way of flipping the two arguments?

I know I can use a fun n->n%7 instead of (%) 7, but I was hoping for a shorter solution.

  • 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-31T14:08:14+00:00Added an answer on May 31, 2026 at 2:08 pm

    You can define flip for this purpose:

    namespace Microsoft.FSharp.Core
    module Operators =
        let flip f x y = f y x
    

    This is a rather common way of doing this in functional programming languages. For example, Haskell also has a flip function in its Prelude.

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

Sidebar

Related Questions

Keep getting this error after inserting a subdatasheet into a query and trying to
I keep running into this problem over and over. I have a view with
Keep getting these errors while trying to compile an c++ class program. testStock.cpp: In
I keep getting this error after my application is running for 2 days. I've
I keep getting bad pointers. Can anyone tell me what am I doing wrong?
I keep getting an error while trying to compile my C++ app on Mac
I keep messing up my android project. I started save ing whole work space.
So I was practicing some linked list problems and I keep getting mixed up
I need some container to keep elements so, if I'll try to get the
I keep getting this error below, and each time I need to delete 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.