https://kotlinlang.org logo
Title
r

raulraja

08/26/2017, 7:42 PM
@Rob In case you have not already run into it, we have Either, EitherT, monadic comprehensions for all monads and other similar FP datatypes and abstraction in Kategory. https://github.com/kategory/kategory/blob/master/kategory/src/main/kotlin/kategory/data/Either.kt There is other instances of Either in other libs too, Funktionale also has an Either https://github.com/MarioAriasC/funKTionale/blob/master/funktionale-either/src/main/kotlin/org/funktionale/either/Disjunction.kt
k

karelpeeters

08/26/2017, 7:44 PM
Good article explaining the absolute basics, but I don't really get why you're talking about "product" and "sum" types: why is that information useful in practice?
r

Rob

08/26/2017, 7:45 PM
Thanks! I'm aware of these libraries. I'm writing my own library of functional abstractions to better grok them.
I wanted to quickly cover how algebraic data types construct new types before showing a generic instance of a sum type.