by

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 2019 13:41
    @jdegoes banned @Patrick160893
  • Jan 31 2019 18:49
    ShermMeister starred scalaz/scalaz
  • Jan 31 2019 05:21
    jonyroy starred scalaz/scalaz
  • Jan 30 2019 21:14
  • Jan 30 2019 20:34
    jmg-duarte starred scalaz/scalaz
  • Jan 30 2019 18:43
    rajkirankv starred scalaz/scalaz
  • Jan 30 2019 09:07
    llater starred scalaz/scalaz
  • Jan 30 2019 07:41
    AgustaRC starred scalaz/scalaz
  • Jan 30 2019 04:16
    LiFangzhe starred scalaz/scalaz
  • Jan 30 2019 03:09
    xuwei-k labeled #2036
  • Jan 29 2019 19:11
    tigrus commented #2036
  • Jan 29 2019 19:11
    tigrus closed #2036
  • Jan 29 2019 13:32
    NeQuissimus commented #2036
  • Jan 29 2019 12:10

    xuwei-k on 7.2.x

    fix compile error with latest S… (compare)

  • Jan 29 2019 06:30
    tigrus commented #2036
  • Jan 29 2019 02:07
    NeQuissimus commented #2036
  • Jan 28 2019 20:41
    tigrus commented #2036
  • Jan 28 2019 19:12
    plokhotnyuk commented #2037
  • Jan 28 2019 17:09
    hrhino review_requested #2037
  • Jan 28 2019 15:32
    puffnfresh commented #2037
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
Barry Zhong
@zhongdj
what happened to scalaz.github.io? It's so incomplete.
Dimitar Georgiev
@dimitarg
@hrhino thank you!
I can't understand how we go from a relation to a function. Forget elements?
Harrison Houghton
@hrhino
A function is just a binary relation a R b such that each element of a is related to exactly one b
So this depends on that list always being such a relation, which isn't a trivial fact but is also not hard to show.
Practically speaking, you do so with a: A => pairs.find(_._1 == a)
Barry Zhong
@zhongdj
is scalaz still active?
Dimitar Georgiev
@dimitarg
@hrhino right, I got thrown off somehow. thanks for the patient explanation.
Finite a implies an equality notion, and surely allValues :: [a] is going to give me back all distinct values.
(I guess I was thinking about injectivity and confused it with function-ness. Flipped the arrows somehow)
@zhongdj this channel, not so much. What do you mean by "active"?
Philip Schwarz
@philip_schwarz_twitter
Jozef Koval
@jozi-k

Hi guys, i am struggling with:

val foo = List(Validation.failure("bar"), Validation.success(8), Validation.success(10))
foo.sequence

The error says

<console>:19: error: could not find implicit value for parameter ev: scalaz.Validation[String,Int] === G[B]

I am trying to get List[Int] or List[String] (depends on existence of Failure). My questions are:

  • What does the error says? (After some digging I think it should say there is no Traversable instance for Validation instead)
  • Is there any reasonable way to get the expected result?
Georgi Krastev
@joroKr21
It sounds like you need the -Ypartial-unification compiler option
Jozef Koval
@jozi-k
That did the trick @joroKr21 . Thanks a lot!
mmuhluri
@mmuhluri

Whenever I try to import package on sbt console I keep getting an error, What can be a problem?
scala> package com.packait.scala.book

<console>:1: error: illegal start of definition
package com.packait.scala.book
^

Rui Gonçalves
@ruippeixotog

Hi! I'm trying to migrate pureconfig to scalaz 7.3 (pureconfig/pureconfig#752) but I'm getting an error about a missing instance of Unapply:

<console>:42: error: Implicit not found: scalaz.Unapply[scalaz.Applicative, Unit]. Unable to unapply type `Unit` into a type constructor of kind `M[_]` that is classified by the type class `scalaz.Applicative`. Check that the type class is defined by compiling `implicitly[scalaz.Applicative[type constructor]]` and review the implicits in object Unapply, which only cover common type 'shapes.'
       List(validConf, invalidConf, anotherInvalidConf).traverseU { c =>
                                                                  ^

I couldn't find any migration guide or release notes for scalaz 7.3. Do I have to import something now?

Georgi Krastev
@joroKr21
Have you tried enabling -Ypartial-unification and just using traverse? Those Unapply tricks shouldn't be necessary.
OlegYch
@OlegYch
only if typeclass has a particular shape though
jrciii
@jrciii
This message was deleted
jrciii
@jrciii
def f[F[_]](implicit E: MonadError[F, String], implicit T: MonadTell[F, Vector[String]]) = ...
import scalaz._
import Scalaz._

type W[A] = Writer[Vector[String], A]
type T[A] = EitherT[W, String, A]

f[T].run.run
I get errors about not finding the implicits. Do I need to import something else? Is that type T making things tricky for the implicit resolution?
jrciii
@jrciii
just needed partial unification on
also switched to cats monadchronicle drops mic
Emily Pillmore
@emilypi
Hey folks, if anyone is interested: https://twitter.com/pitopos/status/1265428158913839104
Buk Lau
@mk9023_gitlab
can I just check - I should use this:
resolvers += Resolver.sonatypeRepo("snapshots")
libraryDependencies += "org.scalaz" %% "scalaz-base" % "1804fbf6-SNAPSHOT"
not
libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.3.1"
OlegYch
@OlegYch
if you want to use scalaz8 preview, yes
Buk Lau
@mk9023_gitlab
what do you recommend for a new project?
I'm coming back to scalaz after a few years away so haven't been following anything closely
Buk Lau
@mk9023_gitlab
also the discord invite is expired - can I get an new invite?
OlegYch
@OlegYch
i would recommend the stable version
Buk Lau
@mk9023_gitlab
cool, thanks @OlegYch
OlegYch
@OlegYch
note that most folks use cats these days
Buk Lau
@mk9023_gitlab
yeah, I've been using cats past 12 months
what's the roadmap for scalaz? is there one?
OlegYch
@OlegYch
don't think so
Emily Pillmore
@emilypi
@mk9023_gitlab not that we've been tracking. The project doesn't really need much improvement, which is cool.
Stephen Compall
@S11001001
you all might be interested in the Scalaz Files series on my blog, which is up to four parts now https://failex.blogspot.com/
Justin Heyes-Jones
@justinhj
Nice!
Buk Lau
@mk9023_gitlab
why is IsoSet called IsoSet and not just Iso?
Tony Morris
@tonymorris_gitlab
The roadmap is to switch to using Haskell, and where Scala is a requirement, to implement a compiler using Haskell. Handwriting Scala is not recommended.
Antriksh Parmar
@__Antriksh_twitter
Hello All, where do I find an updated Scalaz documentation? Most of the documentations I have seen by far are out of date.
or just open your sbt project in intellij