ollysmith_ has quit [Quit: ZNC 1.8.2+deb4+b1 - https://znc.in]
ollysmith has joined #ruby
gemmaro has joined #ruby
ollysmith has quit [Client Quit]
ollysmith has joined #ruby
grenierm has quit [Ping timeout: 250 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
osc4rpt has quit [Ping timeout: 264 seconds]
osc4rpt has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
johnjaye has quit [Ping timeout: 256 seconds]
johnjaye has joined #ruby
johnjaye has quit [Ping timeout: 260 seconds]
johnjaye has joined #ruby
jenrzzz has joined #ruby
hightower2 has quit [Ping timeout: 276 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
gemmaro has quit [Remote host closed the connection]
jenrzzz has joined #ruby
johnjaye has quit [Ping timeout: 264 seconds]
johnjaye has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
user71 has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
Goodbye_Vincent has quit [Quit: ]
Goodbye_Vincent has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
infinityfye has joined #ruby
jenrzzz has joined #ruby
reset has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
hightower2 has joined #ruby
jenrzzz has joined #ruby
victori has quit [Ping timeout: 272 seconds]
victori has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jas-maelstrom has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
jas-maelstrom has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
the9ine has quit [Quit: Connection closed for inactivity]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
desnudopenguino has quit [Read error: Connection reset by peer]
desnudopenguino has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
rvalue has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
pkal has joined #ruby
rvalue has joined #ruby
<pkal>
Hi, is it true that Ruby has some map-like functionality that applies a function as many times as the depth of an element in a list?
<pkal>
So [a, b, c, ...] maps to [a, f(b), f(f(c)), ...]
osc4rpt has quit [Ping timeout: 240 seconds]
<adam12>
pkal: That doesn't look super familiar.
jenrzzz has joined #ruby
osc4rpt has joined #ruby
<adam12>
pkal: You could probably make something your self by chanining some enumerable methods.
<pkal>
I can imagine, but the reason I am asking is that some lecture notes I am reading are referencing this feature in Ruby (a language I barley ever used) and calling it a "generalised Horner's scheme", and I am wondering what this is supposed to be.
<leftylink>
yeah that's like... a mix of Enumerator.produce and Enumerable#map
<pkal>
The name "tri" is used, but I couldn't find anything with that hint.
osc4rpt has quit [Ping timeout: 268 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
osc4rpt has joined #ruby
<leftylink>
another thing that is lacking that would make that ergonomic is a composition operator or something. the composition would have to be manually done
<leftylink>
by making a function that calls the previous + the original once more
<leftylink>
so I guess you take that, put it in Enumerator.produce, and zip the result with the list of elements
jenrzzz has joined #ruby
<leftylink>
the operation seems pretty rare. even Haskell iterate only takes a single starting element. iterate f x == [x, f x, f (f x), ...]
<leftylink>
so to do this in Haskell you'd have to do some weird shit like zipWith ($) (iterate (f .) id) [a, b, c]
<leftylink>
well now you see why I say in Ruby this would involve Enumerator.produce and zip, since iterate is just Enumerator.produce
jenrzzz has quit [Ping timeout: 255 seconds]
barak has joined #ruby
barak has quit [Remote host closed the connection]
jenrzzz has joined #ruby
joako has quit [Quit: quit]
joako has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
crankharder has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
johnjaye has quit [Remote host closed the connection]
johnjaye has joined #ruby
jenrzzz has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
johnjaye has quit [Ping timeout: 264 seconds]
johnjaye has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
crankharder has joined #ruby
___nick___ has quit [Ping timeout: 268 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
crankharder has quit [Ping timeout: 256 seconds]
crankharder has joined #ruby
jenrzzz has joined #ruby
user71 has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 268 seconds]
szkl has quit [Quit: Connection closed for inactivity]
_ht has quit [Remote host closed the connection]
jenrzzz has joined #ruby
crankharder has quit [Ping timeout: 268 seconds]
johnjaye has quit [Ping timeout: 255 seconds]
johnjaye has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 252 seconds]
crankharder has joined #ruby
crankharder has quit [Quit: Lost terminal]
FetidToot has quit [Ping timeout: 272 seconds]
FetidToot has joined #ruby
reset has quit [Quit: reset]
ruby[bot] has quit [Remote host closed the connection]