Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map4 #27

Open
omaus opened this issue Mar 26, 2023 · 2 comments · May be fixed by #28
Open

map4 #27

omaus opened this issue Mar 26, 2023 · 2 comments · May be fixed by #28

Comments

@omaus
Copy link
Member

omaus commented Mar 26, 2023

Description

It is tedious to work with 4 enumerable collections (i.e., seqs, arrays, lists) at once without proper functions. FSharp.Core.Collections already provides mapping functions for one, two, or three collections, yet a mapping function for four is missing.

@omaus omaus linked a pull request Mar 26, 2023 that will close this issue
@kMutagene
Copy link
Member

ChatGPT has these insights for you:

It is tedious to work with 4 enumerable collections (i.e., seqs, arrays, lists) at once without proper functions. FSharp.Core.Collections already provides mapping functions for one, two, or three collections, yet a mapping function for four is missing.

It is even more tedious to work with 5 enumerable collections at once without proper functions. FSharp.Core.Collections provides mapping functions for one, two, three, and four collections, yet a mapping function for five is still missing.

Working with 6 enumerable collections simultaneously without proper functions is a nightmare. Even FSharp.Core.Collections' mapping functions for one through five collections aren't enough to make this task any easier.

Attempting to work with 7 enumerable collections without a proper function is like trying to juggle seven flaming swords. It's just not feasible. We need a mapping function for seven collections, stat!

Working with 8 enumerable collections at once is like trying to solve a Rubik's Cube blindfolded. It's not impossible, but it's certainly not easy. We need a mapping function for eight collections to make this task less daunting.

If you thought working with 8 collections was tough, just wait until you try working with 9! FSharp.Core.Collections' mapping functions for one through eight collections just aren't cutting it. We need a mapping function for nine collections, and we need it now!

@kMutagene
Copy link
Member

It even created the code for you, but seems like it ran out of patience for the last one:

// Working with 4 enumerable collections at once without proper functions is tedious.
// FSharp.Core.Collections provides mapping functions for one, two, and three collections, yet a mapping function for four is missing.
let map4 f (a1: _[]) (a2: _[]) (a3: _[]) (a4: _[]) =
    Array.init (Array.length a1) (fun i -> f a1.[i] a2.[i] a3.[i] a4.[i])

// Working with 5 enumerable collections simultaneously without proper functions is a nightmare.
// FSharp.Core.Collections' mapping functions for one through four collections aren't enough to make this task any easier.
let map5 f (a1: _[]) (a2: _[]) (a3: _[]) (a4: _[]) (a5: _[]) =
    Array.init (Array.length a1) (fun i -> f a1.[i] a2.[i] a3.[i] a4.[i] a5.[i])

// Attempting to work with 6 enumerable collections without a proper function is like trying to juggle six flaming swords.
// We need a mapping function for six collections, and we need it yesterday!
let map6 f (a1: _[]) (a2: _[]) (a3: _[]) (a4: _[]) (a5: _[]) (a6: _[]) =
    Array.init (Array.length a1) (fun i -> f a1.[i] a2.[i] a3.[i] a4.[i] a5.[i] a6.[i])

// Working with 7 enumerable collections at once is like trying to solve a Rubik's Cube blindfolded.
// We need a mapping function for seven collections, and we need it now!
let map7 f (a1: _[]) (a2: _[]) (a3: _[]) (a4: _[]) (a5: _[]) (a6: _[]) (a7: _[]) =
    Array.init (Array.length a1) (fun i -> f a1.[i] a2.[i] a3.[i] a4.[i] a5.[i] a6.[i] a7.[i])

// Working with 8 enumerable collections at once is like trying to herd eight cats.
// FSharp.Core.Collections' mapping functions for one through seven collections are no match for this task.
// We need a mapping function for eight collections, and we need it fast!
let map8 f (a1: _[]) (a2: _[]) (a3: _[]) (a4: _[]) (a5: _[]) (a6: _[]) (a7: _[]) (a8: _[]) =
    Array.init (Array.length a1) (fun i -> f a1.[i] a2.[i] a3.[i] a4.[i] a5.[i] a6.[i] a7.[i] a8.[i])

// Working with 9 enumerable collections at once is like trying to perform brain surgery while skydiving.
// FSharp.Core.Collections' mapping functions for one through eight collections are simply not enough to make this task manageable.
// We need a mapping function for nine collections, and we need it yesterday!
let map9 f (a1: _[]) (a2: _[]) (a3: _[]) (a4: _[]) (a5: _[])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants