Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 19 13:41
    @jdegoes banned @Patrick160893
  • Jan 31 18:49
    ShermMeister starred scalaz/scalaz
  • Jan 31 05:21
    jonyroy starred scalaz/scalaz
  • Jan 30 20:34
    jmg-duarte starred scalaz/scalaz
  • Jan 30 18:43
    rajkirankv starred scalaz/scalaz
  • Jan 30 09:07
    llater starred scalaz/scalaz
  • Jan 30 07:41
    AgustaRC starred scalaz/scalaz
  • Jan 30 04:16
    LiFangzhe starred scalaz/scalaz
  • Jan 30 03:09
    xuwei-k labeled #2036
  • Jan 29 19:11
    tigrus commented #2036
  • Jan 29 19:11
    tigrus closed #2036
  • Jan 29 13:32
    NeQuissimus commented #2036
  • Jan 29 12:10

    xuwei-k on 7.2.x

    fix compile error with latest S… (compare)

  • Jan 29 06:30
    tigrus commented #2036
  • Jan 29 02:07
    NeQuissimus commented #2036
  • Jan 28 20:41
    tigrus commented #2036
  • Jan 28 19:12
    plokhotnyuk commented #2037
  • Jan 28 17:09
    hrhino review_requested #2037
  • Jan 28 15:32
    puffnfresh commented #2037
Salar Rahmanian
@softinio
Any of the scalaz admins can help me delete the scalaz/scalaz-actors gitter channel? As it moved to ZIO. Thanks!
Emily Pillmore
@emilypi
i think John can
Dejan Mijić
@mijicd
@softinio should be done now
Salar Rahmanian
@softinio
@mijicd thx
Matt Dziuban
@mrdziuban
can anyone shed light on how the Foldable instance for scala's standard Stream is able to short circuit in a case like this?
import scalaz.{\/, Foldable}
import scalaz.std.stream._

Foldable[Stream].foldRight(Stream(1,2,3,4,5,6), \/.right[Unit, List[Int]](Nil)) { (i, acc) =>
  println(i)
  if (i > 3) \/.left[Unit, List[Int]](()) else acc.map(_ :+ i)
}
/*
1
2
3
4
res0: Unit \/ List[Int] = -\/(())
*/
OlegYch
@OlegYch
acc is call-by-name
httpRooLz
@httpRooLz
Sup
Tony Morris
@tonymorris_gitlab
the argument to foldRight is lazy (how it should be)
Wiem Zine El Abidine
@wi101
Hello :) @tonymorris_gitlab @emilypi
We would like to move a project in scalaz to zio org: https://github.com/scalaz/scalaz-config
Who could help us to do that?
Afsal Thaj
@afsalthaj
@wi101, :+1: Yeah, we would like this to be moved out to zio repository.
Emily Pillmore
@emilypi
I'm not a maintainer, do I can't so anything. I'll see if I can get ahold of Tony
Wiem Zine El Abidine
@wi101
Alright, otherwise we can make a new repository in zio
Afsal Thaj
@afsalthaj
@wi101 :+1: That will be good.
Emily Pillmore
@emilypi
*so
@wi101 that'd probably be the most expedient way. Sorry for the inconvenience
Wiem Zine El Abidine
@wi101
@emilypi alright, no problem
Thanks
Steven Fines
@sfines
anyone around?
Emily Pillmore
@emilypi
Sup
realfiretiger
@realfiretiger

@realfiretiger
is there anything wrong about using val (where I don't need generics of course) instead of def?
so instead of

def doStuff(par1: String, par2: Int): Int

I always do

val doStuff: (String, Int) => Int
or is there a standard about this?
OlegYch
@OlegYch
you are giving up parameter names but otherwise it might be preferable, even if not commonly accepted
realfiretiger
@realfiretiger
@OlegYch thanks
OlegYch
@OlegYch
personally i wouldn't recommend it
enzief
@enzief
@realfiretiger you'll allocate one more object for the lambda at runtime for val doStuff: (String, Int) => Int
and two lambdas for val doStuff: String => Int => Int
toxicafunk
@toxicafunk
I don't think val doStuff: String => Int => Int works though
enzief
@enzief
what do you mean?
scala> val x: Int => Int => Int = a => a + _
x: Int => (Int => Int) = $$Lambda$18428/0x0000000803207040@f39ce67
Alexander Konovalov
@alexknvl
! type Id[a >: Id[] <: Id[]] = a
! 1 + 1
multibot1
@multibot1
^
error: illegal cyclic reference involving type a
Int = 2
toxicafunk
@toxicafunk
@enzief indeed it works... now I have to figure out what I was thinking about when I said the contrary
Jim Collins
@jim-collins
Hi what is the benefit of having an invariant immutable IList?
Georgi Krastev
@joroKr21
IList is simpler than std lib List and truly immutable (List is mutable under the hood). And it doesn't suffer from the a huge traits hierarchy. Unpopular opinion in this room but I think invarience has no benefit and even worse type inference. Anothe disadvantage is the lack of interop.
Jim Collins
@jim-collins
Thanks @joroKr21 it is why it is invariant I was wondering about.
cosmin33
@cosmin33
! scala.util.Properties.versionMsg
multibot1
@multibot1
String = Scala library version 2.13.0 -- Copyright 2002-2019, LAMP/EPFL and Lightbend, Inc.
Cameron Joannidis
@camjo
Hey is most chat on discord now? Link in the description doesn’t seem to work
Justin Heyes-Jones
@justinhj
Scalaz chat is here but there's not much of it
Salar Rahmanian
@softinio
@camjo ZIO has moved to discord fully ... no idea about scalaz
Justin Heyes-Jones
@justinhj
Is there a Monoid instance for Tags.Max? Having trouble...
import scalaz._, Scalaz._
@ (Tags.Max(10) |+| Tags.Max(20)) 
cmd11.sc:1: value |+| is not a member of Int @@ scalaz.Tags.Max
Justin Heyes-Jones
@justinhj
I was wondering if it would be unlawful but this implementation seems fair enough
implicit val intMaxInstance = Monoid.instance[Int @@ Tags.Max]({
    case (a : (Int @@ Tags.Max),b : (Int @@ Tags.Max)) =>
    val m : Int = Math.max(a.asInstanceOf[Int], b.asInstanceOf[Int])
    Tags.Max(m)
}, Tags.Max(Int.MinValue))
beezee
@beezee
what law are you worried that violates? looks 100 % iso to max monoid on plain int to me
Dimitar Georgiev
@dimitarg

My colleague was trying to write a function def something(f: A => F[B]): F[A => B]

We established that function cannot exist, because it proposes that any applicative is a monad:

trait Nope[F[_]] {
  def applicative: Applicative[F]
  def nope[A, B](f: A => F[B]): F[A => B]
  def flatMap[A, B](f: A => F[B])(x: F[A]): F[B] =
    applicative.ap(nope(f))(x)
}

But before we established it cannot exist, I searched for it, and found

assemble :: forall b f . (Finite a, Applicative f) => (a -> f b) -> f (a -> b)

Could somebody please walk me through what that type is, and what it says?

(Assuming as usual little is off topic in this channel and that WTF questions are okay)
Harrison Houghton
@hrhino
So, Finite is the class of all types having a finite number of elements, it appears.
That function just evaluates a -> f b for all possible as, getting an f [(a,b)], and then turns the [(a, b)] into a function a -> b by viewing the list of pairs as a relation.
So it's very limited: you can't do it unless you know all possible as, and the resulting applicative effect is just the combination of all possible effects resulting from a -> f b.
Justin Heyes-Jones
@justinhj
@beezee I was curious why there is an implementation of monoid for numbers tagged with multiplication but not for max, so I started to suspect it wasn't lawful, but I guess not