#elixir-lang

/

      • WhiskyRyan joined the channel
      • bitmod has quit
      • bitmod joined the channel
      • jimt has quit
      • codestorm joined the channel
      • jimt joined the channel
      • dimitarvp has quit
      • hakunin joined the channel
      • bitmod has quit
      • icecreamcohen has quit
      • hakunin has quit
      • icecreamcohen joined the channel
      • jimt_ joined the channel
      • jimt has quit
      • icecreamcohen has quit
      • bitmod joined the channel
      • codestorm has quit
      • andre1 has quit
      • greengriminal joined the channel
      • hakunin joined the channel
      • hakunin has quit
      • hakunin joined the channel
      • hakunin has quit
      • hakunin joined the channel
      • kylethebaker joined the channel
      • codestorm joined the channel
      • bitmod has quit
      • hakunin has quit
      • yourname_ has quit
      • asonge
        junsuijin: i'm about to start doing something like that, and my plan is to keep track of some state in ets, and other state in a database (i'm sync'ing up some csv's from ftp, crawling the web and merging that data in, and then posting that to an API)
      • cemilowski has quit
      • hakunin joined the channel
      • junsuijin joined the channel
      • hakunin has quit
      • jimt_ is now known as jimt
      • amclain has quit
      • bitmod joined the channel
      • greengriminal has quit
      • hakunin joined the channel
      • lexmag has quit
      • justelex joined the channel
      • alexband joined the channel
      • cemilowski joined the channel
      • justelex_ has quit
      • tomterl has quit
      • alexband has quit
      • nhooyr
        if I call :gen_tcp.recv on a socket and then close the connection from the peer, I get {:ok, nil} out of :gen_tcp.recv . Shouldn't I get {:ok, :closed}?
      • tomterl joined the channel
      • greengriminal joined the channel
      • if I close the socket first and the run :gen_tcp.recv, I still get {:ok, nil}?
      • AckZ joined the channel
      • ejpcmac has left the channel
      • nevermind, something to do with a library I am using
      • nomicflux joined the channel
      • jmill joined the channel
      • elgenie has quit
      • pHcF has quit
      • greengriminal has quit
      • codestorm has quit
      • Cohedrin_ has quit
      • Cohedrin_ joined the channel
      • juddey joined the channel
      • codestorm joined the channel
      • Rekj joined the channel
      • Rekj has quit
      • kommen joined the channel
      • chrismccord joined the channel
      • mzf has quit
      • mzf joined the channel
      • kommen has quit
      • mzf has quit
      • mzf joined the channel
      • mzf has quit
      • mzf joined the channel
      • mzf has quit
      • chrismccord has quit
      • mzf joined the channel
      • nomicflux joined the channel
      • mzf has quit
      • jmill has quit
      • ssswitch has quit
      • mzf joined the channel
      • cemilowski has quit
      • mzf has quit
      • mzf joined the channel
      • Cohedrin_ has quit
      • mzf has quit
      • mzf joined the channel
      • Cohedrin_ joined the channel
      • larshesel has quit
      • WhiskyRyan joined the channel
      • mzf has quit
      • WhiskyRyan has quit
      • larshesel joined the channel
      • WhiskyRyan joined the channel
      • RexM__ joined the channel
      • aphillipo joined the channel
      • mzf joined the channel
      • aphillipo
        hello everyone! with ExDoc I can’t seem to generate any docs: bin/ex_doc “ExDoc” “0.16.1" ./_build/dev/lib/ex_doc/ebin/ -m ExDoc -u “https://github.com/elixir/ex_doc”
      • I get ** (RuntimeError) could not find matching /Users/aphillipo/dev/ex_doc/doc/dist/app*.css
      • any ideas appreciated?
      • mzf has quit
      • mzf joined the channel
      • gonz_ has quit
      • elgenie joined the channel
      • ivan joined the channel
      • elgenie has quit
      • hakunin
        aphillipo: i wonder if you have `mix docs` task
      • can't tell if it's a phoenix thing or general thing
      • aphillipo
        yes I worked it out
      • running mix docs actually works!
      • hakunin
        great!
      • aphillipo
        the instructions should say why dev doesn’t work but test does though
      • guess docs are only generated in test?
      • hakunin
        aphillipo: not sure what you mean, i just run mix docs and it works
      • in dev
      • aphillipo
        on ex_doc?
      • or on your project
      • hakunin
        yeah i have phoenix app with ex_doc dep
      • aphillipo
        I’m trying to fix a bug in ex_doc...
      • hakunin
        got it, sorry for confusion
      • aphillipo
        the instructions for testing a bit confusing...
      • hakunin
        Now i'm wondering what's the simplest way in Elixir to harness existing Enum/Stream functions to take elements from a list while they are the same element… (and stop at that point)
      • ssswitch joined the channel
      • elgenie joined the channel
      • [1,1,1,2,2,3,3,3] |> Some.fun() # => [1,1,1]
      • sometimes i know what i want, and it seems so simple, but i keep running into stumbling blocks
      • i.e. i know what i want "the computer to do"
      • the algorithm, but with lightweight implementation
      • asonge
        hakunin: you want or are you reproducing take_while?
      • hakunin
        asonge: hi again :) how would you do that with take_while?
      • asonge
        hakunin: can't do it directly easily, but you can pop the head off, and do Enum.take_while(rest, &(&1==head))
      • hakunin
        asonge: yeah, because you need 3 things here: iteration, accumulator, and halt
      • asonge
        hakunin: yeah, you tend to remember which Enum and Stream functions can halt, if you want the optimum behavior here
      • hakunin
        asonge: as soon as halt enters the equation you know you'll end up with multiline pattern matchers, and they always "feel" like overkill for these simple things (and yeah, i keep wanting optimum behavior)
      • asonge: i think i can use the head pop though, that's actually fine
      • thanks for that
      • asonge
        you mean a pattern that uses more than 1 line or multiple lines of patterns to match?
      • hakunin
        just one of those cases of multi-pattern functions that span a few lines and look a bit complex at a glance
      • case1 -> {acc, :cont}; case2 -> :halt, <- these things
      • asonge
        yeah
      • RexM__ has quit
      • hakunin
        for somebody who loves fun elixir puzzles this project would've been a freaking goldmine
      • elgenie has quit
      • asonge
        lol
      • hakunin
        if you've ever implemented Collectable protocol, i'm curious about this detail: normally :done signal is useful to close open resources (e.g. files), but if i have a struct that where on each added item i recompute a bunch of stuff, should I create a special "add" method that holds off the recompute part, and only recompute at the :done signal?
      • i.e - if i do that, will there ever be a case where Enum.into halted before it had a chance to :done?
      • f5fd5 joined the channel
      • asonge
        hakunin: i think you do the bad thing on the Collectable. you can see a *kind* of instance of this in the Map.new vs Enum.into(%{}) differences.
      • bad theing being the costly but correct thing