- 
                Notifications
    
You must be signed in to change notification settings  - Fork 833
 
          Optimize simple range mappings: [for n in start..finish -> f n], &c.
          #16832
        
          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
          
     Merged
      
      
            T-Gro
  merged 13 commits into
  dotnet:main
from
brianrourkeboll:computed-collections-for-n-in-range
  
      
      
   
  Mar 19, 2024 
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            13 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      bd19dd3
              
                Optimize `[for n in start..finish -> n]`, etc.
              
              
                brianrourkeboll 93d7855
              
                Only two
              
              
                brianrourkeboll abc714c
              
                Update release notes
              
              
                brianrourkeboll 77069f7
              
                Update release notes
              
              
                brianrourkeboll 23a44bb
              
                Merge branch 'main' of https://github.com/dotnet/fsharp into computed…
              
              
                brianrourkeboll 6cfb44c
              
                Add tests for a few more cases
              
              
                brianrourkeboll f53dbbc
              
                Merge branch 'main' of https://github.com/dotnet/fsharp into computed…
              
              
                brianrourkeboll 5d52462
              
                Handle simple sequential mappings
              
              
                brianrourkeboll 88988ec
              
                Consistent indent
              
              
                brianrourkeboll 8b590a4
              
                Update baselines
              
              
                brianrourkeboll 5da1a7c
              
                Shorter lines, more comments
              
              
                brianrourkeboll 44eaf31
              
                Merge branch 'main' into computed-collections-for-n-in-range
              
              
                T-Gro 28fd773
              
                Merge branch 'main' into computed-collections-for-n-in-range
              
              
                brianrourkeboll File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
  
    
      
          
            32 changes: 32 additions & 0 deletions
          
          32 
        
  tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForNInRangeArrays.fs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| let f0 f = [|for n in 1..10 do f (); yield n|] | ||
| let f00 f g = [|for n in 1..10 do f (); g (); yield n|] | ||
| let f000 f = [|for n in 1..10 do f (); yield n; yield n + 1|] | ||
| let f0000 () = [|for n in 1..10 do yield n|] | ||
| let f1 () = [|for n in 1..10 -> n|] | ||
| let f2 () = [|for n in 10..1 -> n|] | ||
| let f3 () = [|for n in 1..1..10 -> n|] | ||
| let f4 () = [|for n in 1..2..10 -> n|] | ||
| let f5 () = [|for n in 10..1..1 -> n|] | ||
| let f6 () = [|for n in 1..-1..10 -> n|] | ||
| let f7 () = [|for n in 10..-1..1 -> n|] | ||
| let f8 () = [|for n in 10..-2..1 -> n|] | ||
| let f9 start = [|for n in start..10 -> n|] | ||
| let f10 finish = [|for n in 1..finish -> n|] | ||
| let f11 start finish = [|for n in start..finish -> n|] | ||
| let f12 start = [|for n in start..1..10 -> n|] | ||
| let f13 step = [|for n in 1..step..10 -> n|] | ||
| let f14 finish = [|for n in 1..1..finish -> n|] | ||
| let f15 start step = [|for n in start..step..10 -> n|] | ||
| let f16 start finish = [|for n in start..1..finish -> n|] | ||
| let f17 step finish = [|for n in 1..step..finish -> n|] | ||
| let f18 start step finish = [|for n in start..step..finish -> n|] | ||
| let f19 f = [|for n in f ()..10 -> n|] | ||
| let f20 f = [|for n in 1..f () -> n|] | ||
| let f21 f g = [|for n in f ()..g() -> n|] | ||
| let f22 f = [|for n in f ()..1..10 -> n|] | ||
| let f23 f = [|for n in 1..f ()..10 -> n|] | ||
| let f24 f = [|for n in 1..1..f () -> n|] | ||
| let f25 f g h = [|for n in f ()..g ()..h () -> n|] | ||
| let f26 start step finish = [|for n in start..step..finish -> n, float n|] | ||
| let f27 start step finish = [|for n in start..step..finish -> struct (n, float n)|] | ||
| let f28 start step finish = [|for n in start..step..finish -> let x = n + 1 in n * n|] | 
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.