You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Give a warning if `AutoOpenAttribute` is being aliased.
3032
+
// If the user were to alias the `Microsoft.FSharp.Core.AutoOpenAttribute` type, it would not be detected by the project graph dependency resolution algorithm.
3033
+
match stripTyEqns g ty with
3034
+
| AppTy g (tcref,_)whennot tcref.IsErased ->
3035
+
match tcref.CompiledRepresentation with
3036
+
| CompiledTypeRepr.ILAsmOpen _->()
3037
+
| CompiledTypeRepr.ILAsmNamed _->
3038
+
if tcref.CompiledRepresentationForNamedType.FullName = g.attrib_AutoOpenAttribute.TypeRef.FullName then
/// This function sequences computations that have been expressed in continuation-passing style.
5
+
/// Concretely, when 'T is `int` as an example, can be expressed in continuation-passing style as a function,
6
+
/// taking as its input another function that is "how to proceed with a computation given the value of the integer",
7
+
/// and returning "the result of that computation".
8
+
/// That is, an integer is equivalently represented as a generic function (howToProceed : int -> 'TReturn) -> 'TReturn,
9
+
/// and the effect of the function corresponding to the integer 3 is simply to apply the input `howToProceed` to the value 3.
10
+
///
11
+
/// The motivation for Continuation.sequence is most easily understood when it is viewed without its second argument:
12
+
/// it is a higher-order function that takes "a list of 'T expressed in continuation-passing style", and returns "a 'T list expressed in continuation-passing style".
13
+
/// The resulting "continuation-passing 'T list" operates by chaining the input 'Ts together, and finally returning the result of continuing the computation after first sequencing the inputs.
14
+
///
15
+
/// Crucially, this technique can be used to enable unbounded recursion:
16
+
/// it constructs and invokes closures representing intermediate stages of the sequenced computation on the heap, rather than consuming space on the (more constrained) stack.
17
+
valsequence<'T,'TReturn>:
18
+
recursions:(('T -> 'TReturn)-> 'TReturn) list -> finalContinuation:('T list -> 'TReturn)-> 'TReturn
19
+
20
+
/// Auxiliary function for `Continuation.sequence` that assumes the recursions return a 'T list.
21
+
/// In the final continuation the `'T list list` will first be concatenated into one list, before being passed to the (final) `continuation`.
22
+
valconcatenate<'T,'TReturn>:
23
+
recursions:(('T list -> 'TReturn)-> 'TReturn) list -> finalContinuation:('T list -> 'TReturn)-> 'TReturn
0 commit comments