Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
606 changes: 303 additions & 303 deletions src/absil/ilprint.fs

Large diffs are not rendered by default.

958 changes: 486 additions & 472 deletions src/fsharp/FSharp.Core/Linq.fs

Large diffs are not rendered by default.

1,990 changes: 1,099 additions & 891 deletions src/fsharp/FSharp.Core/Query.fs

Large diffs are not rendered by default.

298 changes: 150 additions & 148 deletions src/fsharp/FSharp.Core/array.fs

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/fsharp/FSharp.Core/async.fs
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ namespace Microsoft.FSharp.Control
member x.GetWaitHandle() =
lock syncRoot (fun () ->
if disposed then
raise (System.ObjectDisposedException("ResultCell"));
raise (System.ObjectDisposedException("ResultCell"))
match resEvent with
| null ->
// Start in signalled state if a result is already present.
Expand All @@ -727,15 +727,15 @@ namespace Microsoft.FSharp.Control
member x.Close() =
lock syncRoot (fun () ->
if not disposed then
disposed <- true;
disposed <- true
match resEvent with
| null -> ()
| ev ->
#if FX_NO_EVENTWAITHANDLE_IDISPOSABLE
ev.Dispose()
System.GC.SuppressFinalize(ev)
#else
ev.Close();
ev.Close()
#endif
resEvent <- null)

Expand All @@ -760,7 +760,7 @@ namespace Microsoft.FSharp.Control
if disposed then
[]
else
result <- Some res;
result <- Some res
// If the resEvent exists then set it. If not we can skip setting it altogether and it won't be
// created
match resEvent with
Expand Down Expand Up @@ -1426,7 +1426,7 @@ namespace Microsoft.FSharp.Control
ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> savedCont (not timeOut)) |> unfake),
state=null,
millisecondsTimeOutInterval=millisecondsTimeout,
executeOnlyOnce=true));
executeOnlyOnce=true))
fake())
with _ ->
if latch.Enter() then
Expand Down
12 changes: 6 additions & 6 deletions src/fsharp/FSharp.Core/eventmodule.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ namespace Microsoft.FSharp.Control
[<CompiledName("Map")>]
let map mapping (sourceEvent: IEvent<'Delegate,'T>) =
let ev = new Event<_>()
sourceEvent.Add(fun x -> ev.Trigger(mapping x));
sourceEvent.Add(fun x -> ev.Trigger(mapping x))
ev.Publish

[<CompiledName("Filter")>]
let filter predicate (sourceEvent: IEvent<'Delegate,'T>) =
let ev = new Event<_>()
sourceEvent.Add(fun x -> if predicate x then ev.Trigger x);
sourceEvent.Add(fun x -> if predicate x then ev.Trigger x)
ev.Publish

[<CompiledName("Partition")>]
let partition predicate (sourceEvent: IEvent<'Delegate,'T>) =
let ev1 = new Event<_>()
let ev2 = new Event<_>()
sourceEvent.Add(fun x -> if predicate x then ev1.Trigger x else ev2.Trigger x);
sourceEvent.Add(fun x -> if predicate x then ev1.Trigger x else ev2.Trigger x)
ev1.Publish,ev2.Publish

[<CompiledName("Choose")>]
let choose chooser (sourceEvent: IEvent<'Delegate,'T>) =
let ev = new Event<_>()
sourceEvent.Add(fun x -> match chooser x with None -> () | Some r -> ev.Trigger r);
sourceEvent.Add(fun x -> match chooser x with None -> () | Some r -> ev.Trigger r)
ev.Publish

[<CompiledName("Scan")>]
Expand All @@ -46,7 +46,7 @@ namespace Microsoft.FSharp.Control
let z = !state
let z = collector z msg
state := z;
ev.Trigger(z));
ev.Trigger(z))
ev.Publish

[<CompiledName("Add")>]
Expand Down Expand Up @@ -75,7 +75,7 @@ namespace Microsoft.FSharp.Control
let split (splitter : 'T -> Choice<'U1,'U2>) (sourceEvent: IEvent<'Delegate,'T>) =
let ev1 = new Event<_>()
let ev2 = new Event<_>()
sourceEvent.Add(fun x -> match splitter x with Choice1Of2 y -> ev1.Trigger(y) | Choice2Of2 z -> ev2.Trigger(z));
sourceEvent.Add(fun x -> match splitter x with Choice1Of2 y -> ev1.Trigger(y) | Choice2Of2 z -> ev2.Trigger(z))
ev1.Publish,ev2.Publish


24 changes: 11 additions & 13 deletions src/fsharp/FSharp.Core/fslib-extra-pervasives.fs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ module ExtraTopLevelOperators =
member s.Keys =
let keys = t.Keys
{ new ICollection<'Key> with
member s.Add(x) = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated)));
member s.Clear() = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated)));
member s.Remove(x) = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated)));
member s.Add(x) = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated)))
member s.Clear() = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated)))
member s.Remove(x) = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated)))
member s.Contains(x) = t.ContainsKey (makeSafeKey x)
member s.CopyTo(arr,i) =
let mutable n = 0
Expand Down Expand Up @@ -93,9 +93,9 @@ module ExtraTopLevelOperators =
member __.ContainsKey k = t.ContainsKey (makeSafeKey k)

interface ICollection<KeyValuePair<'Key, 'T>> with
member s.Add(_) = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated)));
member s.Clear() = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated)));
member s.Remove(_) = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated)));
member s.Add(_) = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated)))
member s.Clear() = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated)))
member s.Remove(_) = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated)))
member s.Contains(KeyValue(k,v)) = ICollection_Contains t (KeyValuePair<_,_>(makeSafeKey k,v))
member s.CopyTo(arr,i) =
let mutable n = 0
Expand Down Expand Up @@ -204,11 +204,11 @@ module ExtraTopLevelOperators =
for j in 0..(n-1) do
res.[0,j] <- firstRowArr.[j]
for i in 1..(m-1) do
checkNonNullInvalidArg "rows" (SR.GetString(SR.nullsNotAllowedInArray)) rowsArr.[i]
let rowiArr = getArray rowsArr.[i]
if rowiArr.Length <> n then invalidArg "vals" (SR.GetString(SR.arraysHadDifferentLengths))
for j in 0..(n-1) do
res.[i,j] <- rowiArr.[j]
checkNonNullInvalidArg "rows" (SR.GetString(SR.nullsNotAllowedInArray)) rowsArr.[i]
let rowiArr = getArray rowsArr.[i]
if rowiArr.Length <> n then invalidArg "vals" (SR.GetString(SR.arraysHadDifferentLengths))
for j in 0..(n-1) do
res.[i,j] <- rowiArr.[j]
res

// --------------------------------------------------------------------
Expand Down Expand Up @@ -285,7 +285,6 @@ module ExtraTopLevelOperators =
[<CompiledName("LazyPattern")>]
let (|Lazy|) (input:Lazy<_>) = input.Force()


let query = Microsoft.FSharp.Linq.QueryBuilder()


Expand All @@ -297,7 +296,6 @@ namespace Microsoft.FSharp.Core.CompilerServices
open System.Collections.Generic
open Microsoft.FSharp.Core


/// <summary>Represents the product of two measure expressions when returned as a generic argument of a provided type.</summary>
[<Sealed>]
type MeasureProduct<'Measure1, 'Measure2>() = class end
Expand Down
Loading