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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:12:51+00:00 2026-05-26T09:12:51+00:00

#light let a1 = [| (1, 1); (2, 1); (3, 1) |] let a2

  • 0
#light

let a1 = [| (1, 1); (2, 1); (3, 1) |]

let a2 = [| (1, 1); (2, 3); (3, 1) |]

let aa = Array.zip a1 a2
       |> Array.filter(fun (x, y) -> x <> y)

I want to write a function to do this: it will return the different tuple from two arrays, but I also want to return the index of the different tuple in the second array and the corresponding tuple in the second array. (My code did not work totally yet!)
For my above example, I want to return: 1 and (2, 3)
Another example:

let a1 = [| (1, 1); (2, 1); (3, 1); (4, 1) |]

let a2 = [| (1, 1); (2, 3); (3, 1); (4, 2) |]

I want to return: 1 and (2, 3); 3 and (4, 2)
If you have any idea, please show me your code.
Besides, I am not used to the new place for F#, the format makes me feel difficult to find a good place to post my questions, therefore, I still post my question here.

  • 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-26T09:12:52+00:00Added an answer on May 26, 2026 at 9:12 am
    let a1 = [| (1, 1); (2, 1); (3, 1) |]
    
    let a2 = [| (1, 1); (2, 3); (3, 1) |]
    
    let diff = 
        (a1, a2) 
        ||> Array.mapi2(fun i t1 t2 -> (i, t1, t2))
        |> Array.choose(fun (i, a, b) -> if a <> b then Some (i, b) else None)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following: #light //any function returning bool * 'a let foo = let
I have downloaded the silver light from this http://www.microsoft.com/silverlight// I need to use this
Can someone provide some light on how to do this? I can do this
I want to create light object data-package to pass between client and server applications.
Hope anyone can shed light on this so I can use pens with dash
I have the following code: #light let rec fib n = if n=0 ||
Let's say I want to store a vector of LPD3DXSPRITE objects. The line to
This is baffling me, maybe somebody can shine the light of education on my
this may be a easy question, but I really need a light to go
Is there documentation or a reference for the MVVM Light framework that let me

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.