tschuchort
01/23/2018, 10:24 AMfoo :: a -> State s a
it doesn't really return the state itself, because the state we're dealing with is of type s
. It really returns a deferred computation that returns a state when it's run later on. That's why I think State
is a wrong/confusing name.aeruhxi
01/23/2018, 2:19 PMdh44t
01/23/2018, 2:43 PMdh44t
01/23/2018, 2:44 PMyaakov
01/23/2018, 9:34 PMraulraja
01/23/2018, 9:34 PMraulraja
01/23/2018, 9:56 PMcedric
01/23/2018, 10:03 PMcedric
01/23/2018, 10:04 PMcedric
01/23/2018, 10:08 PM(a -> b) -> f a -> f b
. What exactly don’t you understand, the endofunctor or the monoid part?”
“Er... What do the arrows mean?”raulraja
01/23/2018, 10:48 PMList<Deferred<A>>
to a Deferred<List<A>>
meaning gathering parallel results from independent computations as they complete in a reactive way.
And that is :
results.traverse(::identity, Deferred.applicative())
My point is that I know that because I took time to understand what they are talking about and the relationships you learn when going deeper in Typed FP.
I'm not sure there is a solution in FP at that level to be friendly to beginners in the same way is hard in other sciences to explain certain concepts to people that are not acquainted with the topic.
So I'd like to advice those just getting started with FP to be patient and don't wait for others to make it easy, it's worth it to learn the terms and concepts that are already in use, and yes still room for a lot of improvement but new concepts and ways of doing things don't come without friction.raulraja
01/23/2018, 10:49 PMcedric
01/23/2018, 11:42 PMkenkyee
01/23/2018, 11:43 PMcedric
01/23/2018, 11:44 PMraulraja
01/23/2018, 11:44 PMraulraja
01/23/2018, 11:46 PMraulraja
01/23/2018, 11:47 PMcedric
01/23/2018, 11:54 PMraulraja
01/23/2018, 11:56 PMcedric
01/23/2018, 11:58 PMbind
🙂raulraja
01/24/2018, 12:01 AMbind
a better name than flatMap
because flatMap
does not convey that is binding two computations and flatMap
seems more collection oriented than generalized for all data types capable of providing a monad instance.cedric
01/24/2018, 12:08 AMF[F[_]]
, what happened?”
“Oh yeah, now you need to flatMap
to clean up that mess”
“And this is better than chaining naked values… how?”raulraja
01/24/2018, 12:12 AMbind/yields
is present just for async computation in coroutines with async/await
. The equivalent thing here is that how would you implement async/await with naked values? Each monad has a different complexity in relation to the effect they model in this case Async. Other monads model absence, N effects. When all those effects are implemented with naked values they all are implemented in a different way and requires concrete implementations which may be desirable or not based on optimizations. There is room for mutability in pragmatic FP. But I think the idea here is that FP offers a unified programming model for everything where you can express those high level concerns of computing over Effects in the same way for all monads.raulraja
01/24/2018, 12:13 AMraulraja
01/24/2018, 12:16 AMF<A> -> F<B>
you know that is Functor#map
and it works for all data types not just List.raulraja
01/24/2018, 12:20 AMcedric
01/24/2018, 12:21 AMcedric
01/24/2018, 12:22 AMcedric
01/24/2018, 12:22 AM