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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:10:57+00:00 2026-05-27T02:10:57+00:00

There are two lists of dates (no assumptions can be made regarding list order)

  • 0

There are two lists of dates (no assumptions can be made regarding list order)

//first list
[date_a; date_b; date_c]
//second list
[date_A; date_B; date_C]

I am looking for a function that returns the following as a list of entries:
the date is unique key (a single date will appear only once in the list)

-> (date, true, true) in case both lists contained the date
-> (date, true, false) in case the first list contained the date
-> (date, false, true) in case the second list contained the date
(there will be no (date, false, false) entries)
  • 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-27T02:10:57+00:00Added an answer on May 27, 2026 at 2:10 am

    Using some simple set operations:

    open System
    
    //'a list -> 'a list -> ('a * bool * bool) list when 'a : comparison
    let merge dtl1 dtl2 =
        let dts1 = Set.ofList dtl1
        let dts2 = Set.ofList dtl2
    
        let dts1Only = dts1 - dts2
        let dts2Only = dts2 - dts1 
        let dtsBoth = Set.intersect dts1 dts2
    
        [
            for dt in dts1Only do
                yield (dt,true,false)
    
            for dt in dts2Only do
                yield (dt,false,true)
    
            for dt in dtsBoth do
                yield (dt,true,true)
        ]
    

    Here’s an example:

    let dtl1 = 
       [DateTime.Today.AddDays(1.)
        DateTime.Today.AddDays(2.)
        DateTime.Today.AddDays(3.)
        DateTime.Today.AddDays(4.)
        DateTime.Today.AddDays(5.)
        DateTime.Today.AddDays(6.)]
    
    let dtl2 = 
       [DateTime.Today.AddDays(4.)
        DateTime.Today.AddDays(5.)
        DateTime.Today.AddDays(6.)
        DateTime.Today.AddDays(7.)
        DateTime.Today.AddDays(8.)
        DateTime.Today.AddDays(9.)]
    
    merge dtl1 dtl2
    

    enter image description here

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

Sidebar

Related Questions

There are two lists: List<string> excluded = new List<string>() { .pdf, .jpg }; List<string>
In Python lists, there are two alternative ways of performing a list sort: Using
Say you have a std::list of some class. There are two ways you can
Suppose there are two lists a = {a1, a2, a3} and b = {b1,
There are two unsorted lists containing Integers, need to find the common largest integer
Given two lists of equal length, is there a simpler or preferred way to
What is the difference between these two declarations of a list of lists? >>>
Is there a difference between the following two : ArrayList list = getData(); public
I have a SSRS 2005 report that lists data between two particular dates. I
Suppose I have a simple to-do list application. The application contains two models: lists

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.