Skip to content

Commit 9838c69

Browse files
committed
copilot-instructions: stop suggesting non-idiomatic F#
We prefer idiomatic F# so showing a code snippet that contains inheritance and mutable stuff is kind of ridiculous.
1 parent 8b1f48b commit 9838c69

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

.github/copilot-instructions.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,5 @@ Prefer `voption` over `option`
44

55
Prefer `async` CE over `task` CE
66

7-
This is how you define a non-default F# class constructor:
8-
```fsharp
9-
type DerivedClass =
10-
inherit BaseClass
11-
12-
new (``arguments here``) as ``created object``
13-
=
14-
// create any objects used in the base class constructor
15-
let fieldValue = ""
16-
{
17-
inherit
18-
BaseClass (``arguments here``)
19-
}
20-
then
21-
``created object``.otherField <- fieldValue
22-
23-
[<DefaultValue>]
24-
val mutable otherField : FieldType
25-
```
7+
Prefer idiomatic F#, that is, code that favors composition over inheritance,
8+
and leans to immutability (pure functions, usage of thread-safe collections, etc.)

0 commit comments

Comments
 (0)