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
Fabio Labella
@SystemFw
iirc fix in TaPL is used in a different context but I don't have it at hand to check
but generally when you hear about fix in the context of language design is for languages with no general recursion, and fix enriches them with it
it's the same idea ofc
basically the minimum thing that gives "recursivity" to something
Adam Rosien
@arosien
@glammr1 my brain forgets why it's called Fix, but i usually don't care because i can view it as a trick to make the type signatures work out
Fabio Labella
@SystemFw
fix point combinator
Bob Glamm
@glammr1
that's right, lambda calculus doesn't have built-in recursion hence the need for fix
Fabio Labella
@SystemFw
untyped lambda calculus actually can express recursion
it's Turing complete
you need the Y combinator (which is also related to finding a fix point), but you can
Bob Glamm
@glammr1
was it just typed lambda calculus that needed fix? Or am I way off base here?
Fabio Labella
@SystemFw
when you add types and you get to the simply typed lambda calculus, and then to System F, and then to SystemFw, they are all incapable of expressing recursion
and they need enrichment with fix
Adam Rosien
@arosien
do you mean fix, the function, or the type?
Fabio Labella
@SystemFw
so you're right there
the function in the latter half of this conversation
Adam Rosien
@arosien
ok thanks, that's what i thought, and i thought @glammr1 was talking about the type
Fabio Labella
@SystemFw
the type expresses the same idea in the metalanguage you are encoding your free construction in
Adam Rosien
@arosien
righto
Fabio Labella
@SystemFw
and btw it's easier to understand imho in the Free monad setting
Bob Glamm
@glammr1
Usually the examples for Fix I see in recursion schemes with Free right now are (a) usually in Haskell and (b) look like "Step 1: Write Free. Step 2. ???Fix??? Step 3. Profit!"
but that's due to my knowledge gap around Fix
Fabio Labella
@SystemFw
try encoding a simple language with Put and Read constructors, without using Free
also feel free to PM me if you want to work through it
Bob Glamm
@glammr1
++, added it to my "todo" list for learning Fix. I'll PM you if I run out of resources/references to look through, thanks
Fabio Labella
@SystemFw
as with many complex concepts there are several ways to arrive at it, and understanding is gained by exploring several of them until somehow intuition forms
:+1:
also whilst you can do it in Scala, haskell is a bit clearer to quickly experiment with this kind of stuff
Bob Glamm
@glammr1
Unfortunately my Haskell knowledge is like my Spanish knowledge: read-only and incomplete :D
Fabio Labella
@SystemFw
read-only Haskell is still very useful btw
Bob Glamm
@glammr1
just enough to get by when I really have to :D
Agree, it just takes me time to sort out type name bindings vs. data name bindings
Adam Rosien
@arosien
i always go back to https://tpolecat.github.io/presentations/sw2016/slides.html#1 for free/cofree/fix
Bob Glamm
@glammr1
Also, blurring the lines between "type constructors" and "data constructors" as computation still leaves me as a little unsettled
^^ @arosien I had read through that talk once. Unfortunately I got busy and didn't follow up with writing my own example, which means I get to re-read through it again
That is always a good experience reading through or watching Rob's talks, though
Adam Rosien
@arosien
my memories reset every month or two, so i'm in the same boat
Yosef Fertel
@frosforever
is there a good reference bit of code on walking a driectory tree and say getting the size of the contents of each directory in a parallel controlled fashion? My problem is similar enough to that idea and I currently have 3 implementations: Non parallel but slow, parallel but blows up the paralleism exponentially based on the tree depth, parallel but blows up memory as it’s holding on to too much and not streaming. Wondering if there’s a prior work I could get a better sense of how to do this “right"
Christopher Davenport
@ChristopherDavenport
Great question, walk subtree for depth seems problematic, maybe limit total max number of ops at once via a semaphore and walk the exponential route.
Yosef Fertel
@frosforever
good old semaphore. that sounds reasonable
Fabio Labella
@SystemFw
you can use scatter-gather as well, with a queue of workers
Ivan Putera Masli
@imasli
Hi, do fs2 supports detecting whenever a Stream is empty?
An example use-case, if the stream is empty do some logging/warning.
7 replies
Fabio Labella
@SystemFw
@imasli that is not really compatible with what a Stream is, but it kinda depends on what you mean exactly. Would you mind expanding a bit more on your actual use case?
2 replies
Barry O'Neill
@barryoneill
Hi - quick question. I have a Stream[F, Either[A,B]], and I'd like to take from the list until I have seen N Rights. Eg. Stream(Right, Left, Right, Right, Left, Right), with N of 2 would emit (Right, Left, Right). What's the easiest way of doing this?
I'm fighting with scan but not quite getting it
Gavin Bisesi
@Daenyth
Pull
Fabio Labella
@SystemFw
I think mapAccumulate is easier for this case
Gavin Bisesi
@Daenyth
oh hm yeah that makes sense
Barry O'Neill
@barryoneill
I did not see that function
will give it a try!