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: 22 days 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 (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-16T20:43:42.000Z (about 3 years ago)
- Last Synced: 2024-11-08T00:52:11.326Z (about 1 month 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
Awesome Lists containing this project
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
```