Skip to content

Commit 3b7d075

Browse files
committed
fix: Misc fixes
1 parent ab2b29d commit 3b7d075

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎chapters/AsyncProgramming.fs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Asynchronous programming is essential for modern applications - from web APIs to
77
processing pipelines. F# offers two models for async code: `async` workflows and `task`
88
expressions. Understanding when to use each is key to effective Fable.Python development.
99
10-
## Comparing Python and F`#` Async Models
10+
## Comparing Python and F# Async Models
1111
1212
Python's async model is built on `asyncio`. Python coroutines are **cold** - calling an
1313
`async def` function returns a coroutine object that doesn't execute until awaited:
@@ -110,7 +110,7 @@ let catchExample () =
110110
}
111111

112112
(**
113-
## F`#` Tasks
113+
## F# Tasks
114114
115115
The `task` computation expression in .NET creates *hot* tasks that start immediately.
116116
However, when compiled to Python via Fable, tasks become Python coroutines - which are

‎chapters/Compatibility.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Most FSharp.Core operators are supported, including formatting with `sprintf`,
4747
| F# Type | Python |
4848
| ----------------- | -------------------------- |
4949
| `Tuple` | `tuple` |
50-
| `Option<T>` | erased to `T \| None` |
50+
| `Option<T>` | `T \| None` (erased) |
5151
| `string` | `str` |
5252
| `List<T>` | `List.fs` (immutable list) |
5353
| `Map<K,V>` | `Map.fs` (immutable map) |

‎chapters/FableV5.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ dotnet tool install fable --version 5.0.0-alpha.21
102102
dotnet add package Fable.Core --version 5.0.0-beta.4
103103
104104
# Install the Python runtime
105-
uv add fable-library==5.0.0a17
105+
uv add fable-library==5.0.0a21
106106
```
107107
108108
Then compile your F# to Python:

‎chapters/FastAPI.fs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ let app = FastAPI(title = "My API", version = "1.0.0")
5656

5757
(**
5858
This generates:
59+
*)
5960

60-
```python
61-
app = FastAPI(title="My API", version="1.0.0")
62-
```
61+
(*** include-python: app ***)
6362

63+
(**
6464
The `app` variable name is important - the route decorators reference it.
6565
6666
## Defining Models

‎chapters/Python.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ unwrap the option first.
203203
| Dictionary | `{"a": 1}` | `Map.ofList [("a", 1)]` |
204204
| None check | `if x is None:` | `match x with None ->` |
205205
| String format | `f"Hello {name}"` | `$"Hello {name}"` |
206-
| Type annotation | `x: int` | `x: int32`. |
206+
| Type annotation | `x: int` | `x: int32` |
207207
| Comments | `# comment` | `// comment` |
208208
| Multiline string | `"""text"""` | `"""text"""` (same!) |
209209

‎chapters/Testing.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ same API to Fable, supporting JavaScript, Python, and .NET.
119119
120120
- **Composable**: Tests are values you can combine and transform
121121
- **No magic**: No reflection, no attributes - just functions
122-
- **Familiar F# idioms**: Uses computation expressions and pipelines
122+
- **Familiar F# idioms**: Uses lists and pipelines
123123
124124
### Setting Up Pyxpecto
125125

0 commit comments

Comments
 (0)