Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Shmew/Fable.Extras
A more functional construct on-top of Fable.Core.
https://github.com/Shmew/Fable.Extras
fable
Last synced: 2 months ago
JSON representation
A more functional construct on-top of Fable.Core.
- Host: GitHub
- URL: https://github.com/Shmew/Fable.Extras
- Owner: Shmew
- License: mit
- Created: 2020-09-28T21:37:38.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-16T20:43:42.000Z (over 2 years ago)
- Last Synced: 2024-03-28T15:22:43.111Z (3 months ago)
- Topics: fable
- Language: F#
- Homepage: https://shmew.github.io/Fable.Extras/
- Size: 784 KB
- Stars: 43
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: Contributing.md
- License: LICENSE
Lists
- awesome-fable - Fable.Extras - A more functional construct on-top of Fable.Core. (Libraries)
README
# Fable.Extras [![Nuget](https://img.shields.io/nuget/v/Fable.Extras.svg?maxAge=0&colorB=brightgreen&label=Fable.Extras)](https://www.nuget.org/packages/Fable.Extras)
A more functional construct on-top of Fable.Core.
Near-zero bundle size, as almost the entire library is erased at compile time.
Documentation can be found [here](https://shmew.github.io/Fable.Extras/).
### A quick look:
#### JS Maps
```fsharp
open Fable.ExtrasJSe.Map.empty
|> JSe.Map.set 1 1
|> JSe.Map.set 2 4
|> JSe.Map.values
|> List.sum // 5
```#### JS Regular Expressions and String extensions
```fsharp
open Fable.Extraslet pattern = JSe.RegExp("^[0-9]")
"20 foxes jumped over the bridge".Replace(pattern, "numbers")
// "numbers foxes jumped over the bridge"
```#### Or assignment chaining
```fsharp
open Fable.Extras
open Fable.Extras.Operatorslet maybeInt = None ?| Some 1 ?| None ?| Some 2 // Some 1
```#### Web Assembly
```fsharp
open Fable.Extras
open Fable.Extras.WebAssembly// Wasm binding
type WasmFableExports =
abstract add: int * int -> intasync {
let! wasmBinary = ... // HttpResponsereturn! WA.compileStreaming(wasmBinary)
}...
wasmInstance.add(1,2) // 3
```