raulraja
09/25/2019, 8:02 PMBob Glamm
09/25/2019, 8:02 PMfun foo(a: F<X>, b: F<X>): F<X> {
val va by a
val vb by b
return (a op b)
}
or in fx { .. }
without the return
Bob Glamm
09/25/2019, 8:02 PMraulraja
09/25/2019, 8:03 PMraulraja
09/25/2019, 8:03 PMBob Glamm
09/25/2019, 8:04 PMjust (a op b)
or similar. Makes senseraulraja
09/25/2019, 8:04 PMBob Glamm
09/25/2019, 8:04 PMreturn
is preferable 😄raulraja
09/25/2019, 8:05 PMraulraja
09/25/2019, 8:05 PMBob Glamm
09/25/2019, 8:06 PMraulraja
09/25/2019, 8:07 PMraulraja
09/25/2019, 8:08 PMraulraja
09/25/2019, 8:08 PMRobert Menke
09/25/2019, 9:40 PMRyan Benasutti
09/26/2019, 4:48 PMsimon.vergauwen
09/26/2019, 5:01 PMfollowedBy
or flatMap
with bimap
, or followedBy
or flatMap
and `map`/`handleErrorWith`. But I’d say that depends more on style preferenceraulraja
09/26/2019, 8:04 PMraulraja
09/26/2019, 8:05 PMPhBastiani
09/27/2019, 8:55 AMRyan Benasutti
09/27/2019, 8:30 PMStackOverflowError
sometimes because my `bind()`'s inside fx.monad
go pretty deep (too deep, apparently). Are there any simple ways to restructure my code to work around this, or do I just need to rewrite it differently? This usually works fine as a quick way to do validation, but it seems to break down at large scales.
fun <F> MonadError<F, String>.layerGraphIsValid(
layerGraph: Graph<SealedLayer.MetaLayer>
): Kind<F, Unit> =
fx.monad {
layerNamesAreUnique(layerGraph).bind()
layerGraph.nodes().forEach {
hasInputs(it).bind()
inputsAreDeclared(layerGraph, it).bind()
}
}
Ryan Benasutti
09/27/2019, 8:38 PM512m
works. Not sure if that's the best way though 😛 )Bob Glamm
09/27/2019, 9:15 PMlayerGraph.nodes().traverse(...)
instead? (maybe layerGraph.nodes().k().traverse(...)
)?pakoito
09/27/2019, 9:26 PMtailrecM
or a Monad that doesn’t SO like IO.Ryan Benasutti
09/27/2019, 9:36 PMIOMonadError
, how do I adapt that for uses that expect a Kind<EitherPartialOf<String>, Unit
instead of Kind<ForIO, Unit>
?pakoito
09/27/2019, 9:38 PMRyan Benasutti
09/27/2019, 9:38 PMEither.fx
continuations, so I can't just change the monad it uses without having to change how it's usedpakoito
09/27/2019, 9:39 PMRyan Benasutti
09/27/2019, 9:39 PMRyan Benasutti
09/27/2019, 9:40 PM