Skip to content

Commit a6c0fa6

Browse files
committed
Feedback incorporated
1 parent d1b2f7c commit a6c0fa6

File tree

5 files changed

+27
-29
lines changed

5 files changed

+27
-29
lines changed

_snippets/fable.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
order: 12
3-
title: FableJS.fs
3+
title: WebApps.fs
44
excerpt_separator: <!--more-->
55
code: |
66
open Browser.Dom
@@ -32,11 +32,11 @@ code: |
3232
---
3333
## F# for JavaScript Development
3434

35-
F# isn't just for .NET development - with [Fable](https://fable.io/), it becomes a powerful language for JavaScript environments.
35+
F# isn't just for .NET development - with [F# web technologies]({{ '/use/web-apps/' | relative_url }}), you can target JavaScript environments directly.
3636
<!--more-->
3737
- **Type-safe DOM manipulation** catches errors at compile time, not runtime
3838
- **Seamless React integration** with hooks and modern patterns
3939
- **Full npm ecosystem access** with clean TypeScript-like interop
4040
- **Simplified async programming** with F#'s computation expressions for promises
4141

42-
Fable brings F#'s powerful type system and immutability to frontend development, eliminating common JavaScript bugs while maintaining full access to the JavaScript ecosystem.
42+
F# brings its powerful type system and immutability to frontend development, eliminating common JavaScript bugs while maintaining full access to the JavaScript ecosystem.

_snippets/helloworld.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ code: |
1818
1919
greets |> List.iter hello
2020
---
21-
## Concise and Expressive Code
21+
## Concise and Expressive like Python
2222

2323
This simple "Hello World" example demonstrates F#'s elegant syntax and functional approach to programming.
2424
<!--more-->

_snippets/oop.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,23 @@ code: |
88
abstract Add: x: int -> y: int -> int
99
abstract Multiply: x: int -> y: int -> int
1010
11-
// Class implementation
12-
type BasicCalculator() =
11+
// Class implementation with interface
12+
type Calculator(precision: int) =
13+
// Private field using let binding
14+
let mutable _precision = precision
15+
16+
// Interface implementation
1317
interface ICalculator with
1418
member this.Add x y = x + y
1519
member this.Multiply x y = x * y
1620
17-
// Class method
21+
// Public methods
1822
member this.Subtract(x, y) = x - y
1923
20-
// Class with constructor and property
21-
type ScientificCalculator(precision: int) =
22-
inherit BasicCalculator()
23-
24-
// Auto-property with getter and setter
25-
member val Precision = precision with get, set
24+
// Property with explicit getter/setter
25+
member this.Precision
26+
with get() = _precision
27+
and set(value) = _precision <- value
2628
2729
// Method using property
2830
member this.RoundToPrecision(value: float) =
@@ -46,20 +48,19 @@ code: |
4648
member _.Multiply x y = x * y }
4749
4850
// Class instantiation
49-
let basic = BasicCalculator()
50-
let scientific = ScientificCalculator(2)
51+
let calc = Calculator(2)
5152
52-
printfn "5 + 3 = %d" (basic.Subtract(5, 3))
53+
printfn "5 - 3 = %d" (calc.Subtract(5, 3))
5354
printfn "Is 10 even? %b" (10.IsEven)
54-
printfn "2.345 rounded = %f" (scientific.RoundToPrecision(2.345))
55-
printfn "2^3 = %f" (scientific.Power(2.0, 3.0))
55+
printfn "2.345 rounded = %f" (calc.RoundToPrecision(2.345))
56+
printfn "2^3 = %f" (calc.Power(2.0, 3.0))
5657
---
57-
## Object Oriented Programming Support
58+
## Object Programming Made Simple
5859

59-
F# is **functional first** and **immutable by default**, but it also provides full support for object-oriented programming.
60+
F# is **functional first** and **immutable by default**, but it also provides pragmatic support for object programming.
6061
<!--more-->
6162
- **Seamless .NET integration** lets you work with existing .NET libraries and frameworks
62-
- **Rich class system** allows you to build robust object hierarchies with interfaces and inheritance
63+
- **Rich interface system** allows you to define clear contracts for your components
6364
- **Object expressions** provide lightweight implementation of interfaces without defining full classes
6465
- **Concise member syntax** keeps methods and properties clean and readable
6566
- **Automatic property generation** reduces boilerplate code for data-carrying types

css/main.css

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,11 @@ a[href^="https://fsharp.org"]::after {
121121
}
122122

123123
.snippet {
124-
scrollbar-color: #222222aa #666666aa
124+
scrollbar-color: #222222aa #666666aa;
125+
pre, code {
126+
font-variant-ligatures: none;
127+
}
125128
}
126-
/*
127-
.content-container p,
128-
.content-container li {
129-
max-width: 44em;
130-
} */
131-
132129

133130

134131

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898

9999
</div>
100100

101-
<div class="row-[2] leading-relaxed h-96 w-full overflow-y-auto col-[1] p-4 pt-1 text-[0.5rem] sm:text-[0.8rem] lg:text-xs snippet">
101+
<div class="row-[2] leading-relaxed h-96 w-full overflow-y-auto col-[1] p-4 pt-1 text-[0.8rem] sm:text-xs lg:text-md snippet">
102102
{% highlight fsharp %}{{ snippet.code }}{% endhighlight %}
103103
</div>
104104

0 commit comments

Comments
 (0)