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
type System.Net.WebClient with | |
member inline internal this.DownloadWithWebClient(addHandler, removeHandler, extract, start) = | |
let downloadAsync = | |
Async.FromContinuations (fun (cont, econt, ccont) -> | |
let userToken = new obj() | |
let rec handler (_: obj) (args: 'T :> ComponentModel.AsyncCompletedEventArgs) = | |
if userToken = args.UserState then | |
removeHandler handle | |
if args.Cancelled then | |
ccont (new OperationCanceledException()) |
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
function foo(v) { | |
var x; | |
var y; | |
function bar() { | |
return x + y; | |
} | |
if (v) { | |
x = 5; | |
return bar(); |
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
let rec takeFreshConsTail cons n l = | |
match l with | |
| [] -> | |
if n <> 0 then failwith "insufficient length" | |
setFreshConsTail cons [] | |
| x::xs -> | |
if n > 0 then | |
let cons2 = freshConsNoTail x | |
setFreshConsTail cons cons2 | |
takeFreshConsTail cons2 (n - 1) xs |
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
let rec takeWhileFreshConsTail cons p l = | |
match l with | |
| [] -> | |
setFreshConsTail cons [] | |
| x::xs -> | |
if p x then | |
let cons2 = freshConsNoTail x | |
setFreshConsTail cons cons2 | |
takeWhileFreshConsTail cons2 p xs | |
else |
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
[<CompiledName("SplitAt")>] | |
let splitAt (n: int) (list: 'T list) = Microsoft.FSharp.Primitives.Basics.List.splitAt n list |
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
using System; | |
interface IContainer | |
{ | |
object Obj { set; } | |
} | |
struct P : IContainer | |
{ | |
public object Obj { set { this.o = value; } } | |
object o; |
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
var x = /°+/ |
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
type A private() = | |
[<DefaultValue>] | |
val mutable x: string | |
new(x : string) = | |
if x = null then nullArg "x" | |
A() | |
then | |
printfn "x=%s" x | |
type B(x : string) = |
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
type A() = | |
[<DefaultValue>] | |
val mutable x: string | |
new(x : string) = | |
if x = null then nullArg "x" | |
A() | |
then | |
printfn "x=%s" x | |
type B(x : string) = |
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
type A = | |
val x: string | |
new(x : string) = | |
if x = null then nullArg "x" | |
{x = x} | |
then | |
printfn "x=%s" x |
NewerOlder