Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 01 10:11
    @SystemFw banned @Hudsone_gitlab
  • Jan 31 2019 04:19
    404- forked
    404-/fs2
  • Jan 31 2019 03:01
    SethTisue commented #1232
  • Jan 30 2019 17:22
  • Jan 30 2019 13:45
  • Jan 30 2019 10:48
    pchlupacek commented #1406
  • Jan 30 2019 10:47
    pchlupacek commented #1406
  • Jan 30 2019 10:39
    pchlupacek commented #1407
  • Jan 30 2019 09:58
    lJoublanc commented #870
  • Jan 30 2019 09:42
    vladimir-popov commented #1407
  • Jan 30 2019 08:10
    vladimir-popov closed #1407
  • Jan 30 2019 08:10
    vladimir-popov commented #1407
  • Jan 29 2019 19:20
    SystemFw commented #1407
  • Jan 29 2019 19:20
    SystemFw commented #1407
  • Jan 29 2019 18:57
    SystemFw commented #1406
  • Jan 29 2019 17:47
    pchlupacek commented #1406
  • Jan 29 2019 17:42
    pchlupacek commented #1406
  • Jan 29 2019 17:39
    pchlupacek commented #1407
  • Jan 29 2019 17:39
    vladimir-popov edited #1407
  • Jan 29 2019 17:38
    vladimir-popov commented #1406
Andrey
@404-
right. "not worrying about side effects" is obtained by "suspending" them
Fabio Labella
@SystemFw
that's not false, but it's not what I suggest as the way of looking at things
Andrey
@404-
which i always thought of as "encapsulation"
Fabio Labella
@SystemFw
although unfortunately scala really wants you to think that way
Andrey
@404-
how do you recommend to look at fs2?
Fabio Labella
@SystemFw
this comes before fs2
it goes down to pure fp in general, and cats-effect specifically
btw nothing of what you are saying is strictly incorrect, I want to make this clear
and furthermore, as I said, scala really wants you to mix these concepts together, which is why understanding can be clouded
but I can try and explain as best as I can
Andrey
@404-
:thumbsup:
Fabio Labella
@SystemFw
let's do a small thought experiment: imagine cats-effect was in stdlib, and interop with java didn't exist
furthermore, everything that would otherwise be side-effectful already comes wrapped in IO by the language
you don't have access to F.delay (or async or the rest of the FFI)
does that make sense so far?
Andrey
@404-
hmm so basically "main" is IOApp's "run"?
and access to external world - file system and network - already serves up IOs
Fabio Labella
@SystemFw
yes
Andrey
@404-
sure. makes sense
Fabio Labella
@SystemFw
so, where's the "suspension"
?
you don't see it
Andrey
@404-
right, outside at the higher level
Fabio Labella
@SystemFw
but you can still talk about (the lack of) side-effects
well, don't worry about outside for now
my point is that referential transparency is all you need to reason and talk about side-effects, and we haven't mentioned evaluation at all yet
(since we are assuming that IO is magically given to us and everything is already wrapped)
does that make sense?
Andrey
@404-
one comment: i was never sold on the concept of hiding mutation and side-effects inside of IOs
Fabio Labella
@SystemFw
you aren't hiding things inside of IO
you are exploiting referential transparency
if you aren't convinced, I'd recommend reading the two links I posted above first for motivation
Andrey
@404-
i'm convinced it's needed to be productive in cats/fs2
Fabio Labella
@SystemFw
(not that you have to be convinced by them, but I've already explained the rationale in great detail there, so I'd rather not retype everything)
Andrey
@404-
but it feels hand-wavy
Fabio Labella
@SystemFw
well, again, I already made an in depth argument for that
Christopher Davenport
@ChristopherDavenport
Hand-wavy is assuming its ok because of expected execution paths. I’d rather not rely on trust.
Fabio Labella
@SystemFw
if you think its' "cheating" , it's because you are using the "wrong" mindset to think about them
Andrey
@404-
alright. fair enough, continue with the world where IOs are part of the stdlib
Fabio Labella
@SystemFw
"wrong" from the perspective of pure fp programmers ofc, I'm not making a personal value judgement :)
Christopher Davenport
@ChristopherDavenport
cats/cats-effect/fs2 is my stdlib. :smile:
Fabio Labella
@SystemFw
well, in that picture, we haven't mentioned evaluation at all
Andrey
@404-
true
Fabio Labella
@SystemFw
the underlying language could be based on lazy evaluation, like Haskell (pure and lazy)
or on strict evaluation, like Purescript (pure and strict)
so, entirely conflating these two things is incorrect
is this point clear?
Andrey
@404-
definitely
Fabio Labella
@SystemFw
cool, that was the original point of the discussion
so, where does laziness come into play in scala?