Skip to content

Commit f0368cb

Browse files
authored
Merge pull request #149 from njlr/quickfix-fable-hide-system-linq
* Hide System.Linq from Fable
2 parents ebfba06 + 4cd377b commit f0368cb

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ xunit*.html
200200
artifacts/
201201
bin/
202202

203+
# fable
204+
*.fs.js
205+
fable_modules
206+
.fable
207+
203208
# jest/fable directories
204209
tests/fable/dist/
205210
tests/fable/node_modules/

src/FSharp.Control.AsyncSeq/AsyncSeq.fs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ open System.Collections.Generic
1010
open System.Threading
1111
open System.Threading.Tasks
1212
open System.Runtime.ExceptionServices
13+
#if !FABLE_COMPILER
1314
open System.Linq
15+
#endif
1416

1517
#nowarn "40" "3218"
1618

@@ -1412,6 +1414,7 @@ module AsyncSeq =
14121414
if (buffer.Count > 0) then
14131415
yield buffer.ToArray() }
14141416

1417+
#if !FABLE_COMPILER
14151418
let toSortedSeq fn source =
14161419
toArrayAsync source |> Async.map fn |> Async.RunSynchronously
14171420

@@ -1426,6 +1429,7 @@ module AsyncSeq =
14261429

14271430
let sortByDescending (projection:'T -> 'Key) (source:AsyncSeq<'T>) : array<'T> when 'Key : comparison =
14281431
toSortedSeq (Array.sortByDescending projection) source
1432+
#endif
14291433

14301434
#if !FABLE_COMPILER
14311435
let bufferByCountAndTime (bufferSize:int) (timeoutMs:int) (source:AsyncSeq<'T>) : AsyncSeq<'T[]> =

src/FSharp.Control.AsyncSeq/AsyncSeq.fsi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ module AsyncSeq =
437437
/// Flattens an AsyncSeq of asynchronous sequences.
438438
val concat : AsyncSeq<AsyncSeq<'T>> -> AsyncSeq<'T>
439439

440+
#if !FABLE_COMPILER
440441
/// Yields a sequence ordered by keys.
441442
/// This function returns a sequence that digests the whole initial sequence as soon as
442443
/// that sequence is iterated. As a result this function should not be used with
@@ -460,7 +461,8 @@ module AsyncSeq =
460461
/// that sequence is iterated. As a result this function should not be used with
461462
/// large or infinite sequences.
462463
val sortByDescending : projection:('T -> 'Key) -> source:AsyncSeq<'T> -> array<'T> when 'Key : comparison
463-
464+
#endif
465+
464466
/// Interleaves two async sequences of the same type into a resulting sequence. The provided
465467
/// sequences are consumed in lock-step.
466468
val interleave : source1:AsyncSeq<'T> -> source2:AsyncSeq<'T> -> AsyncSeq<'T>

tests/fable/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"dependencies": {},
2020
"devDependencies": {
21-
"@babel/preset-env": "^7.12.1",
21+
"@babel/preset-env": "^7.12.1",
2222
"@sinonjs/fake-timers": "^6",
2323
"@testing-library/jest-dom": "^5",
2424
"fast-check": "^1",

0 commit comments

Comments
 (0)