- Join over
**1.5M+ people** - Join over
**100K+ communities** - Free
**without limits** - Create
**your own community**

- May 31 02:50Travis typelevel/cats-mtl (djspiewak-feature/rewrite) fixed (703)
- May 31 02:43Travis typelevel/cats-mtl (djspiewak-feature/rewrite) still failing (701)
- May 31 02:41Travis typelevel/cats-mtl#215 broken (702)
- May 31 02:34Travis typelevel/cats-mtl#215 broken (700)
- May 31 02:34Travis typelevel/cats-mtl (djspiewak-feature/rewrite) still failing (699)
- May 31 01:26Travis typelevel/cats-mtl#215 broken (698)
- May 31 01:26Travis typelevel/cats-mtl (djspiewak-feature/rewrite) still failing (697)
- May 31 01:17Travis typelevel/cats-mtl#215 broken (696)
- May 31 01:17Travis typelevel/cats-mtl (djspiewak-feature/rewrite) still failing (695)
- May 15 23:48Travis typelevel/cats-mtl#216 broken (692)
- May 14 23:03Travis typelevel/cats-mtl#215 broken (691)
- May 14 23:02Travis typelevel/cats-mtl (djspiewak-feature/rewrite) still failing (690)
- May 12 19:09Travis typelevel/cats-mtl#209 broken (688)
- May 11 22:59Travis typelevel/cats-mtl (djspiewak-feature/rewrite) still failing (686)
- May 11 22:34Travis typelevel/cats-mtl (djspiewak-feature/rewrite) still failing (685)
- May 11 22:31Travis typelevel/cats-mtl (djspiewak-feature/rewrite) still failing (684)
- Apr 09 00:16Travis typelevel/cats-mtl (djspiewak-feature/rewrite) failed (674)
- Apr 08 19:28Travis typelevel/cats-mtl#209 broken (673)
- Apr 05 23:25Travis typelevel/cats-mtl#208 broken (672)
- Apr 05 23:25Travis typelevel/cats-mtl (covariant-transformers) broken (671)

one under appreciated design decision of fs2 is to separate the two into

`Stream`

and `Pull`

(which are related to each other ofc)
where

`Pull`

is a monad in the returned type, and can be used for stateful streaming, and `Stream`

is a monad in the emitted type, and can be used for control flow
and conceptually

`Stream f a = Pull f a ()`

when I started with fs2 the existence of both

`Stream`

and `Pull`

seemed like a wart (although at the time it was obscured by a bunch of other stuff like `Handle`

), but in truth it's one of the best design decisions of the whole library
my writings have a bunch of long-ish explanations (for lack of a more structured resource, sorry) http://systemfw.org/writings

the tl;dr is that it's a fancy iterator, just built as an algebra rather than side-effecty interface

oh, that's interesting, i didn't realize that a lot of the links point back to gitter. great idea!

I also wrote up a thing about Pull

that I think helps drive home the "iterator" aspect

I worry more about gitter getting shutdown at brief notice

At least gitter is indexed on google

Some option to grab archives from there

https://typelevel.org/cats/datatypes/either.html#solution-2-adts-all-the-way-down talks about error ADTs, what's SOP for common errors that you want to share across modules?

Is there some well known name for this method

`foo`

?```
def foo[A, B, C](f: A => B)(g: (A, B) => C): A => C =
a => g(a, f(a))
```

but it's not worth writing it differently than what you have I don't think

you can notice by changing

`(A, B) => C`

into `A => B => C`

then factorising the whole signature into

`(A => B) => (A => (B => C)) => (A => C)`

then abstracting

`A =>`

into `F[_]`

`F[B] => F[B => C] => F[C]`

and then alfa-rename and switch order into

`F[A => B] => F[A] => F[B]`

, which is the key signature of the `Apply`

typeclass
(renamed some type variables for clarity)

in particular the starting point could have have swiping

`f`

and `g`

and noticing basically `(A => B) => (A => C)`

that should trigger your functorial warning, since functor, applicative and monad can all be seen to transform things into

`F[B] => F[C]`

although it's easier to rename things to

`F[A] => F[B]`

for consistency with the way things are usually written down
```
map: (A => B) => (F[A] => F[B])
ap: F[A => B] => (F[A] => F[B])
flatMap: (A => F[B]) => (F[A] => F[B])
```

which also helps with understanding that the real difference between power in the three typeclasses reflects the difference in power between

`A => B`

(uneffectful), `F[A =>B]`

(effectful but no context sensitivity) and `A => F[B]`

(the effect can depend on the output of the previous computation, since `A => F`

I'll tell that to my manager when he starts about communication and presenting

ahahhaha :+1:

(kind of like flatMap wooo)

i think usually you have a separate ADT that is shared across modules. if you can have direct dependencies, then the upper ADT can refer directly to the module error types. otherwise you can cast or translate the module errors into something like `Throwable`

which the upper ADT wraps

you probably don't need it, and it's more complicated, but you could have a typeclass that translates "lower" level errors into a "higher" level error, but that means the higher level error loses information (which may be ok)