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

Open up Microsoft.FSharp.Collections.IEnumerator #633

Closed
Rickasaurus opened this Issue Dec 21, 2017 · 9 comments

Comments

Projects
None yet
5 participants
@Rickasaurus

Rickasaurus commented Dec 21, 2017

Open up Microsoft.FSharp.Collections.IEnumerator

I propose we allow access to the Microsoft.FSharp.Collections.IEnumerator functions in FSharp.Core

The existing way of approaching this problem in F# is make your own, or nest Seqs which is slower.

Pros and Cons

The advantages of making this adjustment to F# are having combinators to cleanly handle IEnumerator

The disadvantages of making this adjustment to F# are that you'd probably have to wrap them in more checks, and maybe want to pull out the shared functionality with Seq so the checks wouldn't be done twice. It also encourages using mutable stuff, but I feel we're way past this being an issue in F#.

Extra information

Estimated cost (M):

Related suggestions: (put links to related suggestions here)

Affidavit (please submit!)

Please tick this by placing a cross in the box:

  • This is not a question (e.g. like one you might ask on stackoverflow) and I have searched stackoverflow for discussions of this issue
  • I have searched both open and closed suggestions on this site and believe this is not a duplicate
  • This is not something which has obviously "already been decided" in previous versions of F#. If you're questioning a fundamental design decision that has obviously already been taken (e.g. "Make F# untyped") then please don't submit it.

Please tick all that apply:

  • This is not a breaking change to the F# language design
  • I or my company would be willing to help implement and/or test this
@davidglassborow

This comment has been minimized.

Show comment
Hide comment
@davidglassborow

davidglassborow Jan 2, 2018

@Rickasaurus do you have a link to what the Microsoft.FSharp.Collections.IEnumerator functions are ?

davidglassborow commented Jan 2, 2018

@Rickasaurus do you have a link to what the Microsoft.FSharp.Collections.IEnumerator functions are ?

@rmunn

This comment has been minimized.

Show comment
Hide comment
@rmunn

rmunn Jan 7, 2018

@davidglassborow It's found in two files in the F# source: the first one is seqcore.fs, and the second one is seq.fs.

rmunn commented Jan 7, 2018

@davidglassborow It's found in two files in the F# source: the first one is seqcore.fs, and the second one is seq.fs.

@Rickasaurus

This comment has been minimized.

Show comment
Hide comment
@Rickasaurus

Rickasaurus Jan 7, 2018

If we wanted to keep away the beginners we could put it in a submodule like Microsoft.FSharp.Collections.Mutable.

Rickasaurus commented Jan 7, 2018

If we wanted to keep away the beginners we could put it in a submodule like Microsoft.FSharp.Collections.Mutable.

@dsyme

This comment has been minimized.

Show comment
Hide comment
@dsyme

dsyme Jan 8, 2018

Collaborator

@Rickasaurus Why wouldn't we ask users to simply create a separate library for this? Using IEnumerator directly is not a particularly common use-case, and tends to be quite error prone

Collaborator

dsyme commented Jan 8, 2018

@Rickasaurus Why wouldn't we ask users to simply create a separate library for this? Using IEnumerator directly is not a particularly common use-case, and tends to be quite error prone

@Rickasaurus

This comment has been minimized.

Show comment
Hide comment
@Rickasaurus

Rickasaurus Jan 9, 2018

For the record I'm just talking about the combinators in seq.fs.

@dsyme I agree it's not frequently used and for good reason but it's in there though, because it's fast and makes for good primitives. These are tried and true features and could be used to make some existing nasty fast code much nicer.

Sorry for the silly question, but do we have access to OptimizedClosures.FSharpFunc<_,_,_,_>.Adapt and such in libraries?

Rickasaurus commented Jan 9, 2018

For the record I'm just talking about the combinators in seq.fs.

@dsyme I agree it's not frequently used and for good reason but it's in there though, because it's fast and makes for good primitives. These are tried and true features and could be used to make some existing nasty fast code much nicer.

Sorry for the silly question, but do we have access to OptimizedClosures.FSharpFunc<_,_,_,_>.Adapt and such in libraries?

@dsyme

This comment has been minimized.

Show comment
Hide comment
@dsyme

dsyme Jan 9, 2018

Collaborator

Sorry for the silly question, but do we have access to OptimizedClosures.FSharpFunc<,,,>.Adapt and such in libraries?

Yes

@dsyme I agree it's not frequently used and for good reason but it's in there though, because it's fast and makes for good primitives. These are tried and true features and could be used to make some existing nasty fast code much nicer.

I'd definitely recommend a separate library for these rather than cracking open more internals and expanding the surface area of FSharp.Core.

Collaborator

dsyme commented Jan 9, 2018

Sorry for the silly question, but do we have access to OptimizedClosures.FSharpFunc<,,,>.Adapt and such in libraries?

Yes

@dsyme I agree it's not frequently used and for good reason but it's in there though, because it's fast and makes for good primitives. These are tried and true features and could be used to make some existing nasty fast code much nicer.

I'd definitely recommend a separate library for these rather than cracking open more internals and expanding the surface area of FSharp.Core.

@dsyme dsyme added the probably not label Jan 9, 2018

@davidglassborow

This comment has been minimized.

Show comment
Hide comment
@davidglassborow

davidglassborow Jan 9, 2018

Also having it as a separate library would make people more aware of the features (I'd never looked at seq.fs before)

davidglassborow commented Jan 9, 2018

Also having it as a separate library would make people more aware of the features (I'd never looked at seq.fs before)

@gusty

This comment has been minimized.

Show comment
Hide comment
@gusty

gusty Jan 9, 2018

@Rickasaurus I think it will be a great addition for F#+

gusty commented Jan 9, 2018

@Rickasaurus I think it will be a great addition for F#+

@dsyme

This comment has been minimized.

Show comment
Hide comment
@dsyme

dsyme Oct 11, 2018

Collaborator

Closing as we won't open this up in FSharp.Core

Collaborator

dsyme commented Oct 11, 2018

Closing as we won't open this up in FSharp.Core

@dsyme dsyme closed this Oct 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment