TeaEntityLab / Fpgo
Licence: mit
Monad, Functional Programming features for Golang
Stars: ✭ 165
Labels
Projects that are alternatives of or similar to Fpgo
fpEs
Functional Programming for EcmaScript(Javascript)
Stars: ✭ 40 (-75.76%)
Mutual labels: monads, reactive, pubsub, reactive-programming, monad, functional-reactive-programming
Purefun
Functional Programming library for Java
Stars: ✭ 37 (-77.58%)
Mutual labels: monad, monads, stream, functional-programming
Redux Most
Most.js based middleware for Redux. Handle async actions with monadic streams & reactive programming.
Stars: ✭ 137 (-16.97%)
Mutual labels: reactive, reactive-programming, functional-programming
Kefir
A Reactive Programming library for JavaScript
Stars: ✭ 1,769 (+972.12%)
Mutual labels: reactive, stream, functional-programming
Marble
Marble.js - functional reactive Node.js framework for building server-side applications, based on TypeScript and RxJS.
Stars: ✭ 1,947 (+1080%)
Mutual labels: reactive, stream, functional-programming
Bow
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift
Stars: ✭ 538 (+226.06%)
Mutual labels: monad, reactive-programming, functional-programming
Learn Fp
learn-by-doing course/tutorial for functional programming on scala
Stars: ✭ 548 (+232.12%)
Mutual labels: monad, monads, functional-programming
Inferno Most Fp Demo
A demo for the ReactJS Tampa Bay meetup showing how to build a React+Redux-like architecture from scratch using Inferno, Most.js, reactive programmning, and various functional programming tools & techniques
Stars: ✭ 45 (-72.73%)
Mutual labels: reactive, reactive-programming, functional-programming
Cyclops
An advanced, but easy to use, platform for writing functional applications in Java 8.
Stars: ✭ 1,180 (+615.15%)
Mutual labels: monad, reactive, functional-programming
Bulb
A reactive programming library for JavaScript.
Stars: ✭ 84 (-49.09%)
Mutual labels: reactive, reactive-programming, functional-programming
Spring 5 Examples
This repository is contains spring-boot 2 / spring framework 5 project examples. Using reactive programming model / paradigm and Kotlin
Stars: ✭ 87 (-47.27%)
Mutual labels: reactive-programming, functional-reactive-programming, functional-programming
Whyhaskellmatters
In this article I try to explain why Haskell keeps being such an important language by presenting some of its most important and distinguishing features and detailing them with working code examples. The presentation aims to be self-contained and does not require any previous knowledge of the language.
Stars: ✭ 418 (+153.33%)
Mutual labels: pattern-matching, monads, functional-programming
Language Ext
C# functional language extensions - a base class library for functional programming
Stars: ✭ 3,964 (+2302.42%)
Mutual labels: monad, monads, functional-programming
Cycle State Machine Demo
Non-trivial, real use case demo of a hierarchical state machine library with cyclejs
Stars: ✭ 25 (-84.85%)
Mutual labels: reactive-programming, functional-reactive-programming, functional-programming
Monio
Async-capable IO monad for JS
Stars: ✭ 311 (+88.48%)
Mutual labels: monad, monads, functional-programming
Awesome Rxjs
A collection of awesome RxJS resources
Stars: ✭ 314 (+90.3%)
Mutual labels: reactive, reactive-programming, functional-reactive-programming
purescript-pop
😃 A functional reactive programming (FRP) demo created with PureScript events and behaviors.
Stars: ✭ 33 (-80%)
Mutual labels: reactive, reactive-programming, functional-reactive-programming
Sodium Typescript
Typescript/Javascript implementation of Sodium FRP (Functional Reactive Programming) library
Stars: ✭ 102 (-38.18%)
Mutual labels: reactive, functional-reactive-programming, functional-programming
Rocket.jl
Functional reactive programming extensions library for Julia
Stars: ✭ 69 (-58.18%)
Mutual labels: reactive, reactive-programming, functional-reactive-programming
Lda Topic Modeling
A PureScript, browser-based implementation of LDA topic modeling.
Stars: ✭ 91 (-44.85%)
Mutual labels: reactive, reactive-programming, functional-programming
fpGo
Monad, Functional Programming features for Golang
Why
I love functional programing, Rx-style coding, and Optional usages.
However it's hard to implement them in Golang, and there're few libraries to achieve parts of them.
Thus I implemented fpGo. I hope you would like it :)
Features
-
Optional/Maybe
-
Monad, Rx-like
-
Publisher
-
Pattern matching
-
Fp functions
-
Java8Stream-like Collection
-
PythonicGenerator-like Coroutine(yield/yieldFrom)
Usage
Optional (IsPresent/IsNil, Or, Let)
var m MaybeDef
var orVal int
var boolVal bool
// IsPresent(), IsNil()
m = Maybe.Just(1)
boolVal = m.IsPresent() // true
boolVal = m.IsNil() // false
m = Maybe.Just(nil)
boolVal = m.IsPresent() // false
boolVal = m.IsNil() // true
// Or()
m = Maybe.Just(1)
fmt.Println((m.Or(3))) // 1
m = Maybe.Just(nil)
fmt.Println((m.Or(3))) // 3
// Let()
var letVal int
letVal = 1
m = Maybe.Just(1)
m.Let(func() {
letVal = 2
})
fmt.Println(letVal) // letVal would be 2
letVal = 1
m = Maybe.Just(nil)
m.Let(func() {
letVal = 3
})
fmt.Println(letVal) // letVal would be still 1
MonadIO (RxObserver-like)
Example:
var m *MonadIODef
var actualInt int
m = MonadIO.Just(1)
actualInt = 0
m.Subscribe(Subscription{
OnNext: func(in interface{}) {
actualInt, _ = Maybe.Just(in).ToInt()
},
})
fmt.Println(actualInt) // actualInt would be 1
m = MonadIO.Just(1).FlatMap(func(in interface{}) *MonadIODef {
v, _ := Maybe.Just(in).ToInt()
return MonadIO.Just(v + 1)
})
actualInt = 0
m.Subscribe(Subscription{
OnNext: func(in interface{}) {
actualInt, _ = Maybe.Just(in).ToInt()
},
})
fmt.Println(actualInt) // actualInt would be 2
Stream (inspired by Collection libs)
Example:
var s *StreamDef
var tempString = ""
s = Stream.FromArrayInt([]int{}).Append(1).Extend(Stream.FromArrayInt([]int{2, 3, 4})).Extend(Stream.FromArray([]interface{}{nil}))
tempString = ""
for _, v := range s.ToArray() {
tempString += Maybe.Just(v).ToMaybe().ToString()
}
fmt.Println(tempString) // tempString would be "1234<nil>"
s = s.Distinct()
tempString = ""
for _, v := range s.ToArray() {
tempString += Maybe.Just(v).ToMaybe().ToString()
}
fmt.Println(tempString) // tempString would be "1234"
Compose
Example:
var fn01 = func(args ...interface{}) []interface{} {
val, _ := Maybe.Just(args[0]).ToInt()
return SliceOf(val + 1)
}
var fn02 = func(args ...interface{}) []interface{} {
val, _ := Maybe.Just(args[0]).ToInt()
return SliceOf(val + 2)
}
var fn03 = func(args ...interface{}) []interface{} {
val, _ := Maybe.Just(args[0]).ToInt()
return SliceOf(val + 3)
}
// Result would be 6
result := Compose(fn01, fn02, fn03)((0))[0]
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].