Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
root = true

[*.{fs, fsx}]
[*.{fs,fsx}]
fsharp_multiline_bracket_style = stroustrup
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ npm start
```

## Inspirations
- [Fable REPL](https://github.com/fable-compiler/repl)
- [Gleam Language Tour](https://tour.gleam.run)
- [Gleam Language Tour](https://tour.gleam.run)
- [Learn You a Haskell](https://learnyouahaskell.github.io)
4 changes: 0 additions & 4 deletions public/css/pico.min.css

This file was deleted.

9 changes: 0 additions & 9 deletions public/documentation/basics/conditional-expressions.fsx

This file was deleted.

21 changes: 0 additions & 21 deletions public/documentation/basics/conditional-expressions.md

This file was deleted.

5 changes: 0 additions & 5 deletions public/documentation/basics/expressions.fsx

This file was deleted.

57 changes: 0 additions & 57 deletions public/documentation/basics/expressions.md

This file was deleted.

1 change: 0 additions & 1 deletion public/documentation/basics/hello-world.fsx

This file was deleted.

7 changes: 0 additions & 7 deletions public/documentation/basics/hello-world.md

This file was deleted.

17 changes: 0 additions & 17 deletions public/documentation/basics/operators.fsx

This file was deleted.

33 changes: 0 additions & 33 deletions public/documentation/basics/operators.md

This file was deleted.

10 changes: 0 additions & 10 deletions public/documentation/basics/patterns-and-match-expressions.fsx

This file was deleted.

62 changes: 0 additions & 62 deletions public/documentation/basics/patterns-and-match-expressions.md

This file was deleted.

6 changes: 0 additions & 6 deletions public/documentation/basics/primitive-types.fsx

This file was deleted.

22 changes: 0 additions & 22 deletions public/documentation/basics/primitive-types.md

This file was deleted.

3 changes: 0 additions & 3 deletions public/documentation/basics/string-formatting.fsx

This file was deleted.

37 changes: 0 additions & 37 deletions public/documentation/basics/string-formatting.md

This file was deleted.

16 changes: 16 additions & 0 deletions public/documentation/bookshop-domain/41-domain-ids.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
type BookId = BookId of int
type CustomerId = CustomerId of int
type OrderId = OrderId of int

type IdError = NonPositiveId

let createBookId value =
if value > 0 then Ok(BookId value) else Error NonPositiveId

let displayBookId (BookId value) = $"B-%d{value}"

match createBookId 42 with
| Ok id -> printfn "Created %s" (displayBookId id)
| Error NonPositiveId -> printfn "An ID must be positive"

// Try passing CustomerId 42 to displayBookId and read the type error.
Loading
Loading