addamsson
07/14/2019, 4:01 PMFunctor
which are very well documented
but there are things like Profunctor
which have literally no docs. The functions are also a bit problematic because their kdocs are mostly hard to understand or non-existent.
Do you plan on improving this? It would be useful for contributors who didn't come from a Scala background.Applicative
can be used for and what unit
means in it without looking at the code.simon.vergauwen
07/14/2019, 4:06 PMaddamsson
07/14/2019, 4:07 PMsimon.vergauwen
07/14/2019, 4:07 PMaddamsson
07/14/2019, 4:08 PMsimon.vergauwen
07/14/2019, 4:09 PMaddamsson
07/14/2019, 4:11 PMEq
eqv
and neqv
which is also not too hard to interpretfoo.isEquivalentTo(bar)
equals(other: Any?): Boolean
==
and !=
Applicative
Applicative
is and I didn't understand why it was useful until I saw the Validation
class in VAVRsimon.vergauwen
07/14/2019, 4:16 PMEq
is that you can compose it in nested shapes and it type checks.Validated
vs short circuit Either
addamsson
07/14/2019, 4:21 PMsimon.vergauwen
07/14/2019, 4:21 PMequals
and Eq
is essentially inheritance vs composition. So if you ask why not equals
vs Eq
you could also ask inheritance vs compositionaddamsson
07/14/2019, 4:21 PMsimon.vergauwen
07/14/2019, 4:21 PMaddamsson
07/14/2019, 4:22 PMsimon.vergauwen
07/14/2019, 4:22 PMaddamsson
07/14/2019, 4:23 PMEq
but the whole APIsimon.vergauwen
07/14/2019, 4:24 PMaddamsson
07/14/2019, 4:29 PMsimon.vergauwen
07/14/2019, 4:32 PMsetOf(1, 2, 3).map
to return List.run
addamsson
07/14/2019, 4:38 PMsimon.vergauwen
07/14/2019, 4:42 PMaddamsson
07/14/2019, 4:52 PMsimon.vergauwen
07/14/2019, 4:53 PMaddamsson
07/14/2019, 4:53 PMList
is returned but I want my code to be readable so when the next guy comes around to maintain my code and they don't know Arrow they at least have a chance to understand what i've written by just looking at itsimon.vergauwen
07/14/2019, 4:55 PMaddamsson
07/14/2019, 5:05 PMComposable
instead of Monoid
Monoid
is and is is unambiguousFunctor
I've seen things like pure
, of
, just
of
because it is part of Effective Java and most folks understand it by looking at itsimon.vergauwen
07/14/2019, 5:07 PMpure
because originally we thought that since Arrow is build for FPers it should be immediately clear to anyone with FP experience.just
because it's well know from RxJava and Reactor.addamsson
07/14/2019, 5:14 PMsimon.vergauwen
07/14/2019, 6:04 PMaddamsson
07/14/2019, 6:15 PMListK
(which I figured out I'll need if I want to tamper with the list) with some elements the familiar syntax from the stdlib would be listKOf(1, 2, 3)
listOf(1, 2, 3).k()
fun <A> List<A>.k(): ListK<A> = ListK(this)
ListK
but I have no idea what the k
meansListK
it says it is a wrapper but I see no explanation of the K
. Is it because it is a kind? It has a @higherkind
annotation. But then why the docs says it is just a wrapper? Why not ListW
then? or ListWrapper
. And I still can't remove an element form ListK
because there is no such operationList.of(1, 2, 3).remove(1)
and I get all the operations I need. It is approachable and intuitiveremove
operation and a persistentListOf(1, 2, 3)
functionsimon.vergauwen
07/14/2019, 7:11 PMlistKOf
vs listOf().k()
!addamsson
07/14/2019, 7:12 PMTry.invoke { require(1 == 2) }.map {
println("Sorry, I won't be printed :(")
}
Try