Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/skills/release-notes/pick-insert-line.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ match lines |> Array.tryFindIndex headerMatches with

let anchorIdx, side = candidates.[Random().Next(candidates.Length)]
printfn "Insert your new bullet %s this line in %s:" (side.ToUpperInvariant()) rel
printfn ""
printn ""
printfn " line %d: %s" (anchorIdx + 1) lines.[anchorIdx]
printfn ""
printn ""

if side = "above" then
printfn "Use that exact line as the edit anchor: old_str = the line; new_str = <your bullet>\\n<the line>."
Expand Down
10 changes: 5 additions & 5 deletions docs/debug-emit.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ This will have debug points on `for i in 1 .. 10 do` and `yield 1`.
The intended debug points for tasks is the same as for the expressions inside the constructs. For example

```fsharp
let f() = task { for i in 1 .. 10 do printfn "hello" }
let f() = task { for i in 1 .. 10 do printn "hello" }
```

This will have debug points on `for i in 1 .. 10 do` and `printfn "hello"`.
This will have debug points on `for i in 1 .. 10 do` and `printn "hello"`.

> NOTE: there are glitches, see further below

Expand All @@ -201,7 +201,7 @@ Other computation expressions such as `async { .. }` or `builder { ... }` get de

* For every `builder.TryFinally` call, a debug point covering the `try` keyword is added immediately within the body lambda expression. A debug point covering the `finally` keyword is added immediately within the finally lambda expression. No debug point is added for the `builder.TryFinally` call itself even if used in statement position.

* For every `builder.Yield`, `builder.Return`, `builder.YieldFrom` or `builder.ReturnFrom` call, debug points are placed on the expression as if it were control flow. For example `yield 1` will place a debug point on `1` and `yield! printfn "hello"; [2]` will place two debug points.
* For every `builder.Yield`, `builder.Return`, `builder.YieldFrom` or `builder.ReturnFrom` call, debug points are placed on the expression as if it were control flow. For example `yield 1` will place a debug point on `1` and `yield! printn "hello"; [2]` will place two debug points.

* No debug point is added for the `builder.Run`, `builder.Run` or `builder.Delay` calls at the entrance to the computation expression, nor the `builder.Delay` calls implied by `try/with` or `try/finally` or sequential `Combine` calls.

Expand All @@ -226,8 +226,8 @@ type C(args) =
member _.P = x + f 4

type C(args) =
do printfn "hello" // debug point over `printfn "hello"` as side effect
static do printfn "hello" // debug point over `printfn "hello"` as side effect for static init
do printn "hello" // debug point over `printn "hello"` as side effect
static do printn "hello" // debug point over `printn "hello"` as side effect for static init
let f x = x + 1
member _.P = x + f 4

Expand Down
2 changes: 1 addition & 1 deletion eng/scripts/ExtractTimingsFromBinlog.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ build.VisitAllChildren<Task>(fun task ->
printfn "=== %s ===" projectName
for msg in timingMessages do
printfn " %s" msg
printfn ""
printn ""
)

if not foundFscTasks then
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Checking/Expressions/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12768,7 +12768,7 @@ and AnalyzeRecursiveDecl
//
// Also for
// module rec M =
// printfn "hello" // side effects in recursive modules
// printn "hello" // side effects in recursive modules
// let x = 1
| SynPat.Const (SynConst.Unit, m) | SynPat.Wild m ->
let id = ident (cenv.niceNameGen.FreshCompilerGeneratedName("doval", m), m)
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Optimize/Optimizer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ let AbstractAndRemapModulInfo g (cenv: cenv) (repackage, hidden) info =
//-------------------------------------------------------------------------

/// Type applications of F# "type functions" may cause side effects, e.g.
/// let x<'a> = printfn "hello"; typeof<'a>
/// let x<'a> = printn "hello"; typeof<'a>
/// In this case do not treat them as constants.
let IsTyFuncValRefExpr = function
| Expr.Val (fv, _, _) -> fv.IsTypeFunction
Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/Service/FSharpCheckerResults.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1180,10 +1180,10 @@ type internal TypeCheckInfo
// Do not check a method with same name twice
//type AA() =
// abstract a: unit -> unit
// default _.a() = printfn "A"
// default _.a() = printn "A"
//type BB() =
// inherit AA()
// member _.a() = printfn "B" (* This method covered the `AA.a` *)
// member _.a() = printn "B" (* This method covered the `AA.a` *)
//type CC() =
// inherit BB()
// override | (* Here should not suggest to override `AA.a` *)
Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/Service/SynExpr.fs
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ module SynExpr =
//
// let x = (…)
// _.member X = (…)
// (printfn "Hello, world.")
// (printn "Hello, world.")
| _, SyntaxNode.SynBinding _ :: _
| _, SyntaxNode.SynModule _ :: _ -> false

Expand Down Expand Up @@ -1110,7 +1110,7 @@ module SynExpr =
// { (+x) with … }
// { (x + y) with … }
// { (x |> f) with … }
// { (printfn "…"; x) with … }
// { (printn "…"; x) with … }
| SynExpr.Record(copyInfo = Some(SynExpr.Paren(expr = Is inner), _)), (PrefixApp _ | InfixApp _ | Dangling.Problematic _)
| SynExpr.AnonRecd(copyInfo = Some(SynExpr.Paren(expr = Is inner), _)), (PrefixApp _ | InfixApp _ | Dangling.Problematic _) ->
true
Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/Service/SynPat.fs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ module SynPat =
//
// or
//
// let (x) = printfn "…"
// printfn "…"
// let (x) = printn "…"
// printn "…"
| _ when
// This is arbitrary and will result in some false positives.
let maxBacktracking = 10
Expand Down
6 changes: 3 additions & 3 deletions src/Compiler/TypedTree/TypedTree.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3589,7 +3589,7 @@ type ValPublicPath =
[<DebuggerBrowsable(DebuggerBrowsableState.Never)>]
member x.DebugText = x.ToString()

override _.ToString() = sprintf "ValPubPath(...)"
override _.ToString() = "ValPubPath(...)"

/// Represents an index into the namespace/module structure of an assembly
[<NoEquality; NoComparison; StructuredFormatDisplay("{DebugText}")>]
Expand Down Expand Up @@ -4877,7 +4877,7 @@ type AttribExpr =
[<DebuggerBrowsable(DebuggerBrowsableState.Never)>]
member x.DebugText = x.ToString()

override x.ToString() = sprintf "AttribExpr(...)"
override x.ToString() = "AttribExpr(...)"

/// AttribNamedArg(name, type, isField, value)
[<NoEquality; NoComparison; StructuredFormatDisplay("{DebugText}")>]
Expand All @@ -4887,7 +4887,7 @@ type AttribNamedArg =
[<DebuggerBrowsable(DebuggerBrowsableState.Never)>]
member x.DebugText = x.ToString()

override x.ToString() = sprintf "AttribNamedArg(...)"
override x.ToString() = "AttribNamedArg(...)"

/// Constants in expressions
[<RequireQualifiedAccess; StructuredFormatDisplay("{DebugText}")>]
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/TypedTree/TypedTreeOps.ExprOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2257,7 +2257,7 @@ module internal ExprTransforms =
| None -> inputExpr
| Some(exprR, []) -> exprR
| Some(exprR, argsR) ->
//printfn "adjusted...."
//printn "adjusted...."
Expr.App(exprR, tyOfExpr g exprR, [], argsR, inputExpr.Range)

//---------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/FSharp.Core/array.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,7 @@ module Array =
/// <code lang="fsharp">
/// let inputs = [| "a"; "b"; "c" |]
///
/// inputs |> Array.iteri (fun i v -> printfn "{i}: {v}")
/// inputs |> Array.iteri (fun i v -> printn $"{i}: {v}")
/// </code>
/// Evaluates to <c>unit</c> and prints
/// <code>
Expand Down Expand Up @@ -4292,7 +4292,7 @@ module Array =
/// <code lang="fsharp">
/// let inputs = [| "a"; "b"; "c" |]
///
/// inputs |> Array.Parallel.iteri (fun i v -> printfn "{i}: {v}")
/// inputs |> Array.Parallel.iteri (fun i v -> printn $"{i}: {v}")
/// </code>
/// Evaluates to <c>unit</c> and prints the following to the console in an unspecified order:
/// <code>
Expand Down
68 changes: 34 additions & 34 deletions src/FSharp.Core/async.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ namespace Microsoft.FSharp.Control
/// <category index="0">Starting Async Computations</category>
/// <example id="run-synchronously-1">
/// <code lang="fsharp">
/// printfn "A" // runs on caller thread
/// printn "A" // runs on caller thread
///
/// let result = async {
/// printfn "B" // runs on a background/threadpool thread
/// printn "B" // runs on a background/threadpool thread
/// do! Async.Sleep(1000)
/// printfn "C" // continuation runs on a background/threadpool thread
/// printn "C" // continuation runs on a background/threadpool thread
/// return 17
/// } |> Async.RunSynchronously
///
/// printfn "D" // runs on caller thread
/// printn "D" // runs on caller thread
/// </code>
/// <p>Prints "A", "B" immediately, then "C", "D" after 1 second.</p>
/// <p>Yields <c>result = 17</c>.</p>
Expand Down Expand Up @@ -113,16 +113,16 @@ namespace Microsoft.FSharp.Control
/// <category index="0">Starting Async Computations</category>
/// <example id="run-synchronously-immediate-1">
/// <code lang="fsharp">
/// printfn "A" // runs on calling thread
/// printn "A" // runs on calling thread
///
/// let result = async {
/// printfn "B" // ALSO runs on calling thread (hence immediately)
/// printn "B" // ALSO runs on calling thread (hence immediately)
/// do! Async.Sleep(1000)
/// printfn "C" // runs in continuation context (depends on SynchronizationContext etc)
/// printn "C" // runs in continuation context (depends on SynchronizationContext etc)
/// return 17
/// } |> Async.RunSynchronouslyImmediate
///
/// printfn "D" // runs on calling thread
/// printn "D" // runs on calling thread
/// </code>
/// <p>Prints "A", "B" immediately, then "C", "D" after 1 second.</p>
/// <p>Yields <c>result = 17</c>.</p>
Expand All @@ -141,15 +141,15 @@ namespace Microsoft.FSharp.Control
///
/// <example id="start-1">
/// <code lang="fsharp">
/// printfn "A"
/// printn "A"
///
/// async {
/// printfn "B"
/// printn "B"
/// do! Async.Sleep(1000)
/// printfn "C"
/// printn "C"
/// } |> Async.Start
///
/// printfn "D"
/// printn "D"
/// </code>
/// Prints "A", then "D", "B" quickly in any order, and then "C" in 1 second.
/// </example>
Expand All @@ -167,18 +167,18 @@ namespace Microsoft.FSharp.Control
///
/// <example id="start-as-task-1">
/// <code lang="fsharp">
/// printfn "A"
/// printn "A"
///
/// let t =
/// async {
/// printfn "B"
/// printn "B"
/// do! Async.Sleep(1000)
/// printfn "C"
/// printn "C"
/// } |> Async.StartAsTask
///
/// printfn "D"
/// printn "D"
/// t.Wait()
/// printfn "E"
/// printn "E"
/// </code>
/// Prints "A", then "D", "B" quickly in any order, then "C", "E" in 1 second.
/// </example>
Expand Down Expand Up @@ -597,7 +597,7 @@ namespace Microsoft.FSharp.Control
/// |> Async.RunSynchronously
/// |> function
/// | Some (i) -> printfn $"{i}"
/// | None -> printfn "No Result"
/// | None -> printn "No Result"
/// </code>
/// Prints one randomly selected odd number in 1-2 seconds. If the list is changed to all even numbers, it will
/// instead print "No Result".
Expand All @@ -624,7 +624,7 @@ namespace Microsoft.FSharp.Control
/// |> Async.RunSynchronously
/// |> function
/// | Some (i) -> printfn $"{i}"
/// | None -> printfn "No Result"
/// | None -> printn "No Result"
/// </code>
/// Will sometimes print one randomly selected odd number, sometimes throw System.Exception("Even numbers not supported: 2").
/// </example>
Expand Down Expand Up @@ -1092,12 +1092,12 @@ namespace Microsoft.FSharp.Control
/// <example id="sleep-1">
/// <code lang="fsharp">
/// async {
/// printfn "A"
/// printn "A"
/// do! Async.Sleep(1000)
/// printfn "B"
/// printn "B"
/// } |> Async.Start
///
/// printfn "C"
/// printn "C"
/// </code>
/// Prints "C" and "A" quickly in any order, and then "B" 1 second later
/// </example>
Expand All @@ -1120,11 +1120,11 @@ namespace Microsoft.FSharp.Control
/// <example id="sleep-2">
/// <code lang="fsharp">
/// async {
/// printfn "A"
/// printn "A"
/// do! Async.Sleep(TimeSpan(0, 0, 1))
/// printfn "B"
/// printn "B"
/// } |> Async.Start
/// printfn "C"
/// printn "C"
/// </code>
/// Prints "C", then "A" quickly, and then "B" 1 second later.
/// </example>
Expand Down Expand Up @@ -1312,15 +1312,15 @@ namespace Microsoft.FSharp.Control
///
/// <example id="start-immediate-1">
/// <code lang="fsharp">
/// printfn "A"
/// printn "A"
///
/// async {
/// printfn "B"
/// printn "B"
/// do! Async.Sleep(1000)
/// printfn "C"
/// printn "C"
/// } |> Async.StartImmediate
///
/// printfn "D"
/// printn "D"
/// </code>
/// Prints "A", "B", "D" immediately, then "C" in 1 second
/// </example>
Expand All @@ -1347,18 +1347,18 @@ namespace Microsoft.FSharp.Control
///
/// <example id="start-immediate-as-task-1">
/// <code lang="fsharp">
/// printfn "A"
/// printn "A"
///
/// let t =
/// async {
/// printfn "B"
/// printn "B"
/// do! Async.Sleep(1000)
/// printfn "C"
/// printn "C"
/// } |> Async.StartImmediateAsTask
///
/// printfn "D"
/// printn "D"
/// t.Wait()
/// printfn "E"
/// printn "E"
/// </code>
/// Prints "A", "B", "D" immediately, then "C", "E" in 1 second.
/// </example>
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Core/fslib-extra-pervasives.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ module ExtraTopLevelOperators =
/// <code lang="fsharp">
/// let f (Lazy v) = v + v
///
/// let v = lazy (printf "eval!"; 5+5)
/// let v = lazy (print "eval!"; 5+5)
///
/// f v
/// f v
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Core/list.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ module List =
/// <code lang="fsharp">
/// let inputs = [ "a"; "b"; "c" ]
///
/// inputs |> List.iteri (fun i v -> printfn "{i}: {v}")
/// inputs |> List.iteri (fun i v -> printn $"{i}: {v}")
/// </code>
/// Evaluates to <c>unit</c> and prints
/// <code lang="fsharp">
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Core/seq.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ module Seq =
/// <code lang="fsharp">
/// let inputs = ["a"; "b"; "c"]
///
/// inputs |> Seq.iteri (fun i v -> printfn "{i}: {v}")
/// inputs |> Seq.iteri (fun i v -> printn $"{i}: {v}")
///
/// </code>
/// Evaluates to <c>unit</c> and prints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// coroutine {
// printfn "in t1"
// yield ()
// printfn "hey"
// printn "hey"
// }
//

Expand Down Expand Up @@ -222,7 +222,7 @@ let dumpCoroutine (t: Coroutine) =
while ( //if verbose then printfn $"[{t.Id}] calling t.MoveNext, will resume at {t.ResumptionPoint}";
t.MoveNext()
not t.IsCompleted) do
() // printfn "yield"
() // printn "yield"
printfn $"YieldFromFinal called {yieldFromFinalCallCount} times, YieldFrom called {yieldFromCount} times"

let expect final standard t =
Expand Down
Loading
Loading