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
Copy file name to clipboardExpand all lines: docs/external-functions.md
+4-42Lines changed: 4 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Interpreter integration:
19
19
- Extern values are injected into runtime environment as curried `VExternal`.
20
20
21
21
## Higher-order extern execution
22
-
Higher-order externs (for example `List.map`, `Map.fold`, `Option.map`) are implemented in runtime extern modules and receive an `ExternalCallContext`.
22
+
Higher-order externs are implemented in runtime extern modules and receive an `ExternalCallContext`.
23
23
24
24
`ExternalCallContext.Apply` is a function pointer provided by the evaluator so extern code can apply script closures and curried functions without re-implementing evaluation.
25
25
@@ -49,47 +49,9 @@ Higher-order externs (for example `List.map`, `Map.fold`, `Option.map`) are impl
49
49
-`Hash.md5 : string -> string option`
50
50
-`Guid.new : 'a -> string option` (dummy argument to preserve call shape)
51
51
52
-
### Map (`'a map`)
53
-
-`Map.empty`
54
-
-`Map.add`
55
-
-`Map.ofList`
56
-
-`Map.tryGet`
57
-
-`Map.count`
58
-
-`Map.filter`
59
-
-`Map.fold`
60
-
-`Map.choose`
61
-
-`Map.map`
62
-
-`Map.iter`
63
-
-`Map.containsKey`
64
-
-`Map.remove`
65
-
66
-
`Map.empty` is an arity-0 value (`'a map`), not an invokable function.
67
-
68
-
### List
69
-
-`List.empty`
70
-
-`List.map`
71
-
-`List.choose`
72
-
-`List.collect`
73
-
-`List.contains`
74
-
-`List.distinct`
75
-
-`List.exists`
76
-
-`List.fold`
77
-
-`List.filter`
78
-
-`List.iter`
79
-
-`List.rev`
80
-
-`List.length`
81
-
-`List.tryFind`
82
-
-`List.tryGet`
83
-
-`List.tryHead`
84
-
-`List.tail`
85
-
-`List.append`
86
-
87
-
### Option
88
-
-`Option.defaultValue`
89
-
-`Option.defaultWith`
90
-
-`Option.isNone`
91
-
-`Option.isSome`
92
-
-`Option.map`
52
+
### Collections and prelude
53
+
-`List.*`, `Option.*`, and `Map.*` helpers are provided by the embedded prelude in `FScript.Language`.
54
+
- Runtime externs focus on host/system capabilities.
- Many F#/OCaml features are intentionally absent today (modules, classes, interfaces, computation expressions, etc.).
9
+
- Many F#/OCaml features are intentionally absent today (classes, interfaces, computation expressions, etc.). `module` declarations are supported only in included files.
10
10
11
11
## Syntax differences
12
12
@@ -81,7 +81,7 @@ let x =
81
81
82
82
### Standard library model
83
83
- F#/OCaml ship large standard libraries.
84
-
- FScript has a smaller built-in surface and relies on host-provided externs (for example `List.*`, `Map.*`, `Option.*`,`Fs.*`, `Json.*`, `Xml.*`, `Regex.*`).
84
+
- FScript has a smaller built-in surface and relies on host-provided externs for host/system capabilities (for example`Fs.*`, `Json.*`, `Xml.*`, `Regex.*`), while collection helpers are provided by the embedded prelude.
85
85
86
86
### Reflection-style type tokens
87
87
- FScript provides `typeof Name` tokens for host extern workflows (for example JSON/XML decode helpers).
0 commit comments