Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Mike (stew) O'Connor
@stew
foldmap is apply a function A => B and use the B monoid
right, foldMap(identity)
Guillaume Massé
@MasseGuillaume
foldMap(identity) <=> fold
Colt Frederickson
@coltfred
I don't have scala open ATM... It's all JavaScript in my editor right now... cry
Guillaume Massé
@MasseGuillaume
scalakata.com :-)
Dale Wijnand
@dwijnand
thank you all
Mike (stew) O'Connor
@stew
scalakata seems to be broken
Guillaume Massé
@MasseGuillaume
the problem with fold is that it's already defined on std list
oh noes !
calling firemans
Mike (stew) O'Connor
@stew
seems that it always just tells you "... need to enable macro paradise plugin"
unless I don't know what this is supposed to be doing
Guillaume Massé
@MasseGuillaume
nope thats a bug I will fix soon
and I think I should win the award for the longest living scala compiler
back on tracks sirs
Colt Frederickson
@coltfred
I might have one in a screen session that's still on 2.9.3. :P
Guillaume Massé
@MasseGuillaume
haha awesome
actually one good thing about scala is the jir
jit
Colt Frederickson
@coltfred
The good and bad about screen... sometimes I forget where the sessions are running.
Guillaume Massé
@MasseGuillaume
it gets -beep- fast at compiling code
ops sorry for bad words editing
eugene yokota
@eed3si9n
@MasseGuillaume yea. we want to make sure children can learn about Monoids! :)
Michael Pilquist
@mpilquist
i wonder if we could avoid these types of issues with extension methods by providing something like:
case class AppliedTypeConstructor[F[_], A](val fa: F[A])
object AppliedTypeConstructor {
  // forwarding instances that depend on TC[F]
}
implicit def abstracted[F[_], A](fa: F[A]): AppliedTypeConstructor[F, A](fa) = AppliedTypeConstructor(fa)
// + an unapply variant
Guillaume Massé
@MasseGuillaume
@eed3si9n then you should consider shiping cats on a rasberry pi
and air dropping it somewhere :P
eugene yokota
@eed3si9n
@mpilquist I was almost gonna say we need simulacrum that works on the call-site
it would be cool if some annotation can transform for { x <- List(1, 2, 3) } yield x to use Cats' FlatMap's flatMap
Mike (stew) O'Connor
@stew
@mpilquist i'm not sure I follow what that is going to do, how would you envision the call site changing?
Michael Pilquist
@mpilquist
call site would look like: List(1, 2, 3).abstracted.flatMap { … } <— this is now using Monad[List] instead of List.flatMap
Mike (stew) O'Connor
@stew
@eed3si9n I think that kind of thing has been attempted many times, but the desugar happens too early
@mpilquist got it, since abstracted was implicit I figured you were figuring it to be, uh, implicit
Guillaume Massé
@MasseGuillaume
@mpilquist have you talk with @xeno-by about metaprogramming ?
eugene yokota
@eed3si9n
so it's effectively a newtype?
Guillaume Massé
@MasseGuillaume
and scala-meta
Michael Pilquist
@mpilquist
@MasseGuillaume a little bit — he’s helped us through a few issues in simulacrum with paradise
Guillaume Massé
@MasseGuillaume
do you have scalameta in your radar ?
Michael Pilquist
@mpilquist
yep, though last i recall, it is still too early to ship stuff on meta
Guillaume Massé
@MasseGuillaume
are you sure ?
it's still true now ?
Michael Pilquist
@mpilquist
don’t know — haven’t looked in to meta since scaladays SF
eugene yokota
@eed3si9n
so if the code transformation put tagged type (or .abstracted Unapply thing) around, then we can get to flatMap before collection library does.
Michael Pilquist
@mpilquist
right — general idea is to “forget” everything we know about the applied type, resulting in a value with no methods
then reintroduce methods via syntax ops classes (ala simulacrum)
Guillaume Massé
@MasseGuillaume
cool, I'm following it really closely. My perception is that he's stuck because he does not have enough early adopters
if you join the effort, it would motivate him a lot
Dale Wijnand
@dwijnand
Is there a name for something that calls sequence then fold?
for instance takes a Seq[Future[T]] and returns a Future[T]?
Guillaume Massé
@MasseGuillaume
.sequence ?