<    April 2017    >
Su Mo Tu We Th Fr Sa  
                   1  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
30
00:00 Guest_ joined
00:02 aeliton joined
00:02 hipertracker joined
00:06 WhiskyRyan joined
00:12 codestorm joined
00:14 isubasti joined
00:15 icapurro joined
00:23 sfbw joined
00:25 Guest_ joined
00:26 icapurro joined
00:31 sfbw joined
00:31 MotherFlojo joined
00:36 foobarboboba left
00:36 marcdel joined
00:39 sfbw joined
00:41 nomicflux joined
00:52 codestorm joined
00:54 icapurro joined
00:55 msantos joined
00:56 sevenseacat joined
00:57 jkreeftmeijer joined
01:00 johnstorey joined
01:04 jkreeftmeijer joined
01:04 io_bora joined
01:09 duane joined
01:15 jkreeftmeijer joined
01:16 thistle joined
01:16 thistle joined
01:18 chrismccord joined
01:19 raycoll joined
01:22 fschuindt joined
01:26 jkreeftmeijer joined
01:31 icapurro joined
01:32 jkreeftmeijer joined
01:33 io_bora joined
01:34 hahuang61 joined
01:34 nighty joined
01:38 tomterl joined
01:42 jkreeftmeijer joined
01:53 jkreeftmeijer joined
01:54 smt joined
01:56 markh joined
01:58 josevalim joined
01:59 jkreeftmeijer joined
02:02 amosbird joined
02:04 io_bora joined
02:07 icapurro joined
02:07 markh left
02:09 jkreeftmeijer joined
02:19 josevalim joined
02:20 jkreeftmeijer joined
02:21 fschuindt1 joined
02:22 InternetFriend joined
02:23 smt_ joined
02:26 jkreeftmeijer joined
02:29 thistle joined
02:31 MotherFlojo joined
02:32 sotojuan joined
02:32 <sotojuan> I have a very basic Plug server with an EEx file. When I change the EEx template file, I have to restart the server for the changes to be available. With as little complexity as possible, how do I make it so I can hit F5 to see my latest template? Thanks in advance.
02:33 chavito joined
02:36 jkreeftmeijer joined
02:40 io_bora joined
02:46 MotherFlojo joined
02:47 jkreeftmeijer joined
02:49 luke_nukem joined
02:52 jkreeftmeijer joined
02:53 icapurro joined
02:56 thistle joined
03:03 jkreeftmeijer joined
03:04 <sotojuan> nvm I got it ^
03:04 io joined
03:06 crelix joined
03:08 <Radar> sotojuan: Sharing your answer so that others may learn would be good :)
03:11 lessless joined
03:12 duane joined
03:13 jkreeftmeijer joined
03:14 nomicflux joined
03:19 jkreeftmeijer joined
03:23 io_bora joined
03:24 milad joined
03:25 icapurro_ joined
03:26 thistle joined
03:29 jkreeftmeijer joined
03:35 icapurro joined
03:35 hahuang61 joined
03:40 jkreeftmeijer joined
03:46 jkreeftmeijer joined
03:49 racycle joined
03:54 io_bora joined
03:56 jkreeftmeijer joined
04:05 griffinb_ joined
04:06 jkreeftmeijer joined
04:06 griffinb_ joined
04:07 griffinb_ joined
04:08 griffinb_ joined
04:08 sevenseacat joined
04:09 griffinb_ joined
04:09 griffinb_ joined
04:10 griffinb_ joined
04:12 jkreeftmeijer joined
04:19 lessless joined
04:22 jkreeftmeijer joined
04:33 jkreeftmeijer joined
04:39 jkreeftmeijer joined
04:42 coatezy joined
04:49 jkreeftmeijer joined
04:52 gvaughn joined
04:59 jkreeftmeijer joined
05:00 milad joined
05:01 griffinb_ joined
05:02 MotherFlojo joined
05:02 griffinb_ joined
05:03 griffinb_ joined
05:04 griffinb_ joined
05:05 jkreeftmeijer joined
05:06 dec0n joined
05:09 io_bora joined
05:15 jkreeftmeijer joined
05:24 MotherFlojo joined
05:26 jkreeftmeijer joined
05:31 jkreeftmeijer joined
05:35 hahuang61 joined
05:36 IRCFrEAK joined
05:36 icapurro joined
05:37 InternetFriend joined
05:37 IRCFrEAK left
05:38 Nicd- joined
05:42 jkreeftmeijer joined
05:43 IRCFrEAK joined
05:44 lessless joined
05:44 IRCFrEAK left
05:46 voltone joined
05:52 jkreeftmeijer joined
05:55 cemilowski joined
05:56 vmoravec joined
05:58 jkreeftmeijer joined
06:05 griffinb_ joined
06:07 jkreeftmeijer joined
06:10 wsieroci joined
06:18 jkreeftmeijer joined
06:19 icanhazbroccoli joined
06:24 jkreeftmeijer joined
06:28 proteusguy joined
06:30 praveen__ joined
06:35 jkreeftmeijer joined
06:37 jkreeftmeijer joined
06:38 ostera-mobile joined
06:40 gvaughn joined
06:49 codestorm joined
06:56 isubasti_ joined
06:58 duane joined
06:59 imack joined
06:59 mattyw joined
07:03 milad joined
07:04 nd__ joined
07:06 josevalim joined
07:06 griffinb_ joined
07:09 tuacker joined
07:13 ZippoWeb joined
07:22 lessless joined
07:23 mark_66 joined
07:25 ostera-mobile joined
07:26 dani0_ joined
07:31 dastagg joined
07:35 akeating joined
07:35 frefity joined
07:37 hahuang61 joined
07:37 stephen_m joined
07:37 icapurro joined
07:38 akeating joined
07:43 codestorm joined
07:47 cemilowski joined
07:49 cemilowski left
07:50 bigkevmcd joined
07:50 tuacker1 joined
07:55 <nyaray> Radar: bonus points would've been given for a gist with a minimal working example
08:03 Guest67_ joined
08:05 hipertracker joined
08:07 colrack joined
08:07 griffinb_ joined
08:07 lessless joined
08:09 vmoravec joined
08:10 Uniaika joined
08:11 matt___ joined
08:11 gmcabrita joined
08:13 Guest67__ joined
08:14 <pandamatt> Hi, I have a quick question about type specs, is it possible to define a @type that can be one of several atoms? For instance: @type day :: january | february | march | etc...
08:20 akeating joined
08:21 akeating joined
08:26 <Uniaika> pandamatt: I think it's possible yes
08:26 <Uniaika> but then you would use :january instead of plain "january"
08:29 gvaughn joined
08:31 isubasti_ joined
08:34 Uniaika joined
08:35 MotherFlojo joined
08:35 DeadTrickster_ joined
08:36 akeating joined
08:38 codestorm joined
08:40 icapurro joined
08:42 akeating joined
08:45 akeating joined
08:52 junsuiji1 joined
08:52 the_voice- joined
08:56 nope3000 joined
08:59 Guest_ joined
09:03 isubasti_ joined
09:08 griffinb_ joined
09:12 <pandamatt> thanks, it worked
09:18 codestorm joined
09:18 bitmod_ joined
09:23 isubasti_ joined
09:25 Blkt joined
09:26 lexmag joined
09:30 lessless joined
09:36 codestorm joined
09:36 akeating joined
09:37 hahuang61 joined
09:38 InternetFriend joined
09:44 isubasti_ joined
09:47 Uniaika joined
10:00 duane joined
10:02 josevalim joined
10:05 isubasti_ joined
10:09 griffinb_ joined
10:14 DeadTrickster joined
10:17 gvaughn joined
10:18 hbraun joined
10:26 isubasti_ joined
10:30 codestorm joined
10:41 icapurro joined
10:46 isubasti_ joined
10:54 griffinb_ joined
11:00 josevalim joined
11:02 voltone joined
11:03 hipertracker joined
11:07 isubasti_ joined
11:23 dignifiedquire joined
11:24 marr joined
11:24 codestorm joined
11:24 mark_66 joined
11:26 agit0 joined
11:29 teepark joined
11:29 io_bora joined
11:29 mark_66 joined
11:32 mark_66 joined
11:33 aeliton joined
11:38 hahuang61 joined
11:42 sfbw joined
11:45 nomicflux joined
11:45 io joined
11:49 dec0n joined
11:55 hipertracker joined
11:58 hipertracker joined
12:00 dimitarvp joined
12:00 MaSven joined
12:03 cristianR_ joined
12:06 gvaughn joined
12:08 griffinb_ joined
12:18 codestorm joined
12:19 dani0_ joined
12:19 inoas joined
12:20 bambanx joined
12:26 duane joined
12:27 cevado joined
12:29 griffinb_ joined
12:34 frefity joined
12:38 fardormu joined
12:39 fardormu left
12:42 cevado joined
12:42 icapurro joined
12:44 acscherp joined
12:46 arjanscher left
12:46 meh` joined
12:51 isHavvy joined
12:53 proteusguy joined
13:00 akeating joined
13:00 Ayey_ joined
13:01 proteus-guy joined
13:03 hipertracker joined
13:09 thistle joined
13:10 frefity joined
13:12 smferris joined
13:12 codestorm joined
13:15 sfbw joined
13:19 Guest_ joined
13:26 isubasti_ joined
13:29 bitmod joined
13:32 Guest_ joined
13:32 Guest_ joined
13:36 duane joined
13:39 hahuang61 joined
13:39 socketguru joined
13:40 InternetFriend joined
13:45 maxbeizer joined
13:47 kronicdeth joined
13:48 cristianR_ joined
13:48 icapurro joined
13:50 smt joined
13:54 gvaughn joined
13:54 icapurro joined
13:56 InternetFriend joined
14:00 fschuindt1 joined
14:05 racycle joined
14:06 codestorm joined
14:08 hashpuppy joined
14:08 chriswarren joined
14:14 arkgil joined
14:15 arkgil left
14:17 gvaughn joined
14:21 rschmukler joined
14:24 chavito joined
14:25 jerel joined
14:29 cdg joined
14:30 codestorm joined
14:33 imack joined
14:40 potatosalad joined
14:43 mattyw joined
14:43 phansch joined
14:45 ikopico joined
14:46 <schaary> I have a legacy database from where I get a field which could be be a string (like "hello"), or an empty string (like " ") or a null value - which is nil in Elixir.
14:47 <schaary> Now I'm looking for a method to find out in a case statement, which kind of my variable is
14:48 <schaary> mhm - I could put it in a function and use pattern matching with the arguments ;)
14:50 dpehrson joined
14:51 <dpehrson> When using conform with distillery, should the conform config be applied when running custom distillery commands?
14:51 <dpehrson> I've built one for running my phoenix migrations, but when it runs, it seems as though it doesn't have the values from the conform .conf in the release.
14:51 <dpehrson> (There is no database hostname, so it errors immediately)
14:51 <dpehrson> Opening a remote console and executing the MFA works properly.
14:53 NeverDie joined
14:55 thistle_ joined
14:55 cevado joined
14:55 Ayey_ joined
14:57 imack joined
14:59 Havvy joined
15:01 thistle joined
15:02 raycoll joined
15:04 hbraun joined
15:04 iFire joined
15:05 hbraun_ joined
15:12 josevalim joined
15:12 <InternetFriend> ohai jose
15:13 hipertracker joined
15:15 fschuindt1 joined
15:20 Ayey_ joined
15:21 fschuindt1 joined
15:21 lessless joined
15:25 Uniaika joined
15:25 Uniaika joined
15:28 srxa joined
15:30 tuacker joined
15:32 cevado joined
15:32 wilo joined
15:34 <dpehrson> On the off chance anyone can help, I have a more detailed description of my issue on conform's github: https://github.com/bitwalker/conform/issues/120
15:35 <dpehrson> I really don't know whether the behavior I'm seeing is a bug, something I configured wrong, or a non-supported feature.
15:35 <dpehrson> Looking for any hints as to what I need to do.
15:37 hipertracker joined
15:38 apotry joined
15:40 hahuang61 joined
15:42 isubasti_ joined
15:42 racycle joined
15:43 uamana joined
15:44 Guest67__ joined
15:48 tugorez joined
15:49 <vans163_> is there any tutorials for elixir and/or erlang online where its in the browser and has you type code to proceed?
15:49 <sevenseacat> codeschool has several introductory elixir courses
15:50 <drewolson> this is the one linked from elixir-lang.org https://www.codeschool.com/courses/try-elixir?utm_source=elixir_home&utm_medium=referral
15:52 <Guest67__> Hello is there any way to know from a phoenix application that phoenix server is ready?
15:53 hbraun joined
15:53 <vans163_> sevenseascat, drewolson: any idea if theres any not behind a signup?
15:53 <drewolson> vans163_ nope sorry
15:54 <vans163_> anyone bought https://www.learnelixir.tv/ ?
15:54 <sevenseacat> not sure. I know the first codeschool one is free, doesn't require a subscription
15:55 <vans163_> sevenseacat: i might end up signing up if i cant find alternative, its just there seems to only be 3 tutorials, kind of limited
15:55 amclain joined
15:55 <sevenseacat> well yeah, it's very introductory
15:59 davidw joined
16:02 rschmukler joined
16:05 snappy_ joined
16:06 thistle joined
16:09 <snappy_> Hey, people! Still an elixir noob, but something I've been wondering is why `use` and `require` are two separate macros. At first glance, it seems like it would be more straightforward to have a single macro, with an option for `__using__`, but I'm likely missing something...
16:11 fernandomm joined
16:12 rschmukler joined
16:22 bitmod joined
16:24 <ciawal> snappy_: why not?
16:25 MaSven joined
16:25 <ciawal> I think it's good that use is separate, it has a much bigger potential impact than require
16:26 <havenwood> snappy_: `use` it itself a macro and it automatically already does a `require` of the module being used.
16:27 <havenwood> snappy_: `require` is a directive, so it's lexically scoped, and you just use it to get at macros that otherwise wouldn't compile.
16:28 <snappy_> havenwood: what's the difference between a macro and a directive?
16:30 agit0 joined
16:32 <snappy_> havenwood: I get that `use` does a `require` followed by calling `__using__` but I was wonderig why use and require are separate directives/macros in the language, rather than having one keyword i.e. require that can take a "using" option?
16:34 <benwilson512> snappy_: if I had to guess it's a matter of `use` expressing intent more clearly
16:34 <benwilson512> they're separate intents
16:35 <havenwood> snappy_: Consider `use` the only thing. Then `require` does less, much less.
16:35 <benwilson512> `use` amounts to "inject stuff into this module"
16:35 <benwilson512> require then can stick with just one meaning
16:35 <benwilson512> given how much macros can do, clear meaning is important
16:38 <alisdair> i think `use`, `import` and `require` should all be merged into `give_me`
16:38 <asonge> lol
16:38 <alisdair> `give_me Ecto`
16:39 <alisdair> `give_me GenServer`
16:39 <alisdair> see how nice that is?
16:39 <asonge> `use` is like, "do anything you want to my module"
16:39 <havenwood> alisdair: gimme Candy
16:39 <alisdair> i'm actually a horrible person who thinks macros should have to be explicitly imported, not required, and defaulting to importing all functions is terrible
16:40 <alisdair> so no one should listen to me
16:40 rschmukler joined
16:40 Guest_ joined
16:41 <asonge> yeah, i think most libraries should resist the use of `use`
16:41 <asonge> (and many seem to?)
16:41 <benwilson512> yeah its popularity has waned
16:46 jeregrine joined
16:48 josevalim joined
16:51 Na joined
16:53 hahuang61 joined
16:55 codestorm joined
16:57 rschmukler joined
17:00 hahuang65 joined
17:00 cevado joined
17:05 refriedchicken joined
17:05 <Nicd-> anyone up for a game of "name my library"?
17:07 <gazler> Ticklefairy
17:07 <Ankhers> Without even knowing what it does, I would include that in every project.
17:08 <Nicd-> :D
17:08 <gazler> That was a short game.
17:08 <Nicd-> it's a bunch of build utilities for Mix as described here: https://blog.nytsoi.net/2017/03/24/fbu-frontend-build-utilities
17:09 <Nicd-> it was planned to be a frontend build tool but people pointed out it could be used for other things as well, so only thing I can think of is "MBU: Mix Build Utilities"
17:09 <gazler> Call it Bob (the builder)
17:09 <Nicd-> haha
17:11 <Nicd-> "Can we build it?" "Uh, I guess? Maybe?"
17:11 <gazler> That's a solid tagline right there.
17:12 lexmag joined
17:12 wsieroci joined
17:12 <Nicd-> there's already like a million bob the builders on github though
17:13 jeregrine joined
17:13 <gazler> Ugh, and there I was, thinking it was such an original idea.
17:13 <Nicd-> one in Elixir by ericmj :D
17:14 <Nicd-> so that's taken
17:17 refriedchicken joined
17:17 kansi joined
17:18 JuanMiguel joined
17:19 marr joined
17:20 <Nicd-> MBU it is
17:21 Tallys__ joined
17:21 <kansi> hi, i am trying to compile the deps of my phoenix app but i keep getting the following error
17:21 <kansi> https://paste.fedoraproject.org/paste/pt7ioeRCgQefeRf5p9A7bF5M1UNdIGYhyRLivL9gydE=
17:22 <kansi> any pointers on what might cause this error
17:25 dani0_ joined
17:26 <kansi> the above occurs when i try to di `mix deps.compile cache_tab`
17:26 <kansi> *do
17:29 refriedchicken66 joined
17:29 uamana joined
17:31 nd___ joined
17:31 <Nicd-> how do you usually mark deprecations in Elixir?
17:31 <Nicd-> in your own library
17:41 nahtnam joined
17:45 craigger joined
17:46 <kansi> i figured that mix is using the wrong manager to compile the deps
17:46 <kansi> but these deps and the dependencies of my deps
17:47 <kansi> any pointers to how to change that
17:48 laut joined
17:49 nd__ joined
17:49 codestorm joined
17:50 vmoravec joined
17:53 Ayey_ joined
17:53 cevado joined
17:56 <Nicd-> how do I typespec a list of lists?
17:57 <Nicd-> ah, I tried to typespec a list of 2-element lists and it doesn't like that. but it makes more sense to change to tuples anyway
17:58 isubasti_ joined
18:04 ctp joined
18:08 Ayey_ joined
18:10 zetashift joined
18:11 rschmukler joined
18:13 hahuang65 joined
18:14 racycle joined
18:15 wsieroci joined
18:16 ejpcmac joined
18:20 <ejpcmac> Hi! Is it just me or when you set a default value in an Ecto Migration, if you create a new item via Repo.insert without the field, the returned value for the field is nil and not the default value?
18:21 <benwilson512> so if you want the value to be set from the database
18:21 <benwilson512> you need to set that field as read after write
18:22 <ejpcmac> Yeah, maybe not so efficient, isn’t it? Is there a cleaner way to do that?
18:27 <benwilson512> well, if you want to have the default set by the database that's the only way to do it, in general it should be ok
18:27 <benwilson512> however if it's just a constant
18:27 <benwilson512> you can just use `default: some_value` in your schema
18:28 <hmans> ejpcmac: If you're using Postgres, it will be efficient enough thanks to RETURNING
18:28 <hmans> ie, it will still just be one INSERT/UPDATE query.
18:28 <hmans> If you're not using Postgres, you're funked, though
18:29 icanhazbroccoli joined
18:29 squallstter joined
18:29 steffkes joined
18:31 <ejpcmac> benwilson512: They are contstants (false, and []). I’ve put them in my schema and it’s all right, thank you! I’d known for the default in the migration, but not there.
18:32 <ejpcmac> hmans: Yes, now I remember having read about this great feature a year ago or so.
18:36 hipertracker joined
18:37 <ejpcmac> Since I am here, I have another question: do you encounter sporadic failures with your tests using the database? Sometimes the return value from the insert and the one from the get differs by 1 value in their timestamps’ microseconds. And the results are inconsistent with a same seed.
18:41 wsieroci joined
18:41 SvenMa joined
18:41 mozzarel1 joined
18:41 Havvy joined
18:42 JuanMiguel joined
18:43 codestorm joined
18:46 cemilowski joined
18:46 tolerablyjake joined
18:52 rschmukler joined
18:55 Ayey_ joined
18:56 jeregrine joined
18:59 kyrix joined
19:01 icanhazbroccoli joined
19:02 rschmukler joined
19:08 dsimon joined
19:09 codestorm joined
19:09 jeregrine joined
19:13 bionj joined
19:16 dani0_ joined
19:21 srxa_ joined
19:24 gvaughn_ joined
19:24 gvaughn joined
19:26 refriedchicken joined
19:30 wsieroci joined
19:37 luke_nukem joined
19:39 dimitarvp joined
19:40 codestorm joined
19:47 rschmukler joined
19:48 dj_goku joined
19:48 refriedchicken joined
19:52 cemilowski1 joined
19:57 duane joined
19:58 aeliton joined
20:00 inoas joined
20:00 rschmukler joined
20:00 hahuang61 joined
20:01 jeregrine joined
20:01 Ayey_ joined
20:01 nbg joined
20:05 milad joined
20:11 <nbg> Hi. I (sometimes, not always) get the following error when running "mix local.rebar --force": http://sprunge.us/CUFd I'm not quite sure how to decipher that message, so any help is appreciated.
20:12 cevado joined
20:13 ejpcmac left
20:13 milad joined
20:13 <Nicd-> it looks like the TLS connection failed
20:14 isubasti_ joined
20:14 <Nicd-> there were some patches to Erlang's TLS problems lately
20:14 <Nicd-> but can't say in which versions
20:15 <asonge> Nicd-: there are always patches to erlang's TLS, and most of its problems are that a lot of stuff is semi-incomplete
20:16 <asonge> nbg: try to force hex to download again? (mix local.hex --force)
20:16 mattyw joined
20:16 <nbg> okay, thanks for your info.
20:17 <ericmj> nbg: it's an error message but not an error
20:17 <ericmj> rebar did install correctly
20:18 <nbg> the problem is that I would like to distribute a package that's installed on a user's machine, someone who doesn't necessarily now erlang. so I don't want the installation process to throw random errors, regardless of whether or not they are important.
20:19 <asonge> nbg: they wouldn't be using mix or rebar, though. if you use distillery or exrm, you can create a "release" that you'd add to the installer.
20:19 <ericmj> nbg: if you think it's an important problem there is an open issue for it on erlangs issue tracker. I think they would love contributions in this area
20:20 Ayey_ joined
20:21 <ericmj> https://bugs.erlang.org/browse/ERL-382
20:21 cdg joined
20:22 <nbg> but still, some people prefer to install stuff from the sources rather than fetching some binary blob, especially if the project comes from an untrusted resource (e.g., the github repository from some unknown guy).
20:23 ruby joined
20:23 <nbg> thanks for referencing the issue, I guess I'll have to wait until it's resolved, or reconsider how my package is distributed and installed.
20:28 Ayey_ joined
20:30 steffkes joined
20:30 steffkes joined
20:33 cemilowski left
20:34 codestorm joined
20:36 vmoravec joined
20:36 jeregrine joined
20:37 inoas joined
20:39 ZippoWeb joined
20:40 srxa joined
20:40 ikcerog joined
20:49 pHcF joined
20:49 <pHcF> is there any way to globally set a Ecto prefix for a specific postgres schema? like as an option in `config :ledger`
20:49 cevado joined
20:49 <pHcF> ?
20:53 ikcerog joined
20:54 wsieroci joined
20:54 <rvirding> Is there anyway to simply generate a float from any number? I know about Float.ceil/trunc but they do more.
20:55 <benwilson512> rvirding: as in, given a number that is a float or an integer, make sure it's a float?
20:56 <rvirding> Yes. In erlang there is :erlang.float which does this but couldn't find it in elixir
20:57 Ayey_ joined
20:57 <alisdair> rvirding: it's :erlang.float in elixir ;)
20:57 <cmk_zzz> rvirding: and you can't just use :erlang.float?
20:59 <rvirding> Yes of course :-) but why not this? I can do round and trunc
21:00 <rvirding> Just read a forum entry where a guy suggested 5+0.0 or 5/1.0 which of course works but seems a bit obtuse and not really that clear what is intended
21:00 <rvirding> And no, nothing critical :-)
21:02 strykerkkd joined
21:06 <drewolson> rvirding i've also experienced this in the past. also going from float -> int, i used `round` which felt a little unintuitive as well
21:06 <drewolson> e.g. https://github.com/drewolson/scrivener_ecto/blob/master/lib/scrivener/paginater/ecto/query.ex#L46
21:10 <rvirding> drewolson: round is not too bad as you need to specify how to convert
21:10 <drewolson> yep, true
21:11 <rvirding> But :erlang.ceil is missing and it should probably be there as we have trunc
21:17 shadowjack joined
21:17 Ayey_ joined
21:24 ZippoWeb joined
21:26 pHcF joined
21:26 hunterboerner joined
21:28 hipertracker joined
21:28 codestorm joined
21:29 aeliton joined
21:29 <ericmj> is there an :erlang.ceil?
21:30 <ericmj> elixir has Float.ceil
21:30 <ericmj> and Kernel.trunc
21:31 <ericmj> rvirding: i think elixir doesn't have float/1 because of the very weird guard behaviour
21:31 <ericmj> we could of course check for this and disallow it but maybe it's just better to use :erlang.float then
21:32 <rvirding> no, there isn't but I guess Float.ceil is just round(n + 0.5)
21:33 <rvirding> the differentiation is quite clear but perhaps not easy to understand. It might be better to always make float convert to a float and never be a float test
21:33 <rvirding> can't do that in erlang because of backwards compatibility
21:34 <benwilson512> oh interesting it's a test in guards?
21:34 <benwilson512> equivalent to is_float ?
21:34 <ericmj> rvirding: it is Float.round(n + 0.5) but with less floating point issues
21:35 <ericmj> benwilson512: only on the top-level of a guard
21:35 <rvirding> yes, but ONLY at the top level, not in any expressions. So float(X) is a type test while float(X) =:= 0.5 is a conversion
21:35 <benwilson512> ah yeh that's a bit odd
21:35 <benwilson512> if we were to add a float/1 to kernel my personal preference would be just a conversion
21:36 <rvirding> way back when it used to be clear :-), it was only the test and only allowed in guards
21:36 <ericmj> elixir cannot change or add guard functions though
21:36 <rvirding> then someone came up with this weird idea of having expressions in guards
21:37 <benwilson512> ericmj: it's already a guard though right? and we could prevent using it in a non conversion way via walking the ast in matches right?
21:37 <ericmj> yes, but meh
21:37 <ericmj> just use :erlang.float then
21:37 <benwilson512> fair, I suppose I was emphasizing its use as a converter in general, not in guards
21:38 brohith joined
21:38 <ericmj> yeah, then we should have Integer.to_float
21:38 <benwilson512> well the issue is I'd expect that to only take integers
21:38 <cmk_zzz> Number.to_float
21:38 <ericmj> it should also take floats?
21:39 <benwilson512> not named thusly no
21:39 <rvirding> If you always convert float to :erlang.float then it should only convert
21:39 <ericmj> cmk_zzz: there is no Number module
21:39 <benwilson512> but I see value in a "make a number a float"
21:39 <cmk_zzz> ericmj: I know
21:39 <benwilson512> I'm trying to avoid String.to_integer / String.to_float
21:39 <benwilson512> those are fine until what you want is String.to_number
21:39 <rvirding> there is the Float module with the weirdo ceil and trunc
21:40 <ericmj> why are they weirdo?
21:40 <ericmj> benwilson512: I think it would be strange to have an stdlib function dynamic in the return value
21:41 <rvirding> try Float.ceil(5.6.7.8, 2)
21:41 <benwilson512> ericmj: well there's really 2 issues
21:41 <benwilson512> ericmj: "1" |> String.to_float fails
21:41 <drewolson> when i initially used `round`, i was super confused that `Float.round` returned a float.
21:41 <rvirding> LFE got the float always converts by translating float to erlang:float
21:41 <benwilson512> so even if you have a consistent out put type you want
21:41 <benwilson512> you can't reliably use it
21:42 <ericmj> rvirding: syntax error?
21:42 <brohith> hey guys, quick question. I have my own poison encoder for DateTime and NaiveDateTime. When I try to run `mix release` I get errors saying "duplicate_modules"
21:42 <benwilson512> ericmj: the stdlib forces you to write a function with a dynamic output in order to handle strings with numbers
21:42 <ericmj> benwilson512: i think it's better to be strict than non-strict in input
21:42 <brohith> Any way I can use exrm and still override the poison encoders for DateTime and NaiveDateTime?
21:43 <ericmj> drewolson: how would it work otherwise?
21:43 io_bora joined
21:43 <drewolson> ericmj: it makes sense in retrospect, i just wasn't easily able to find something to convert my float into an integer. i didn't know to look in Kernel initially.
21:44 <micmus> I guess it would be fine to have a Kernel.float macro that translated to x + 0.0 as a conversion
21:45 <micmus> it would work in guards
21:45 <benwilson512> ericmj: floats and integers are repeatedly treated by built in functions as interchangeable
21:45 <ericmj> benwilson512: in most cases i would rather have integer (exclusive) or float
21:45 <benwilson512> sure but if you're handling input from users
21:45 <benwilson512> requiring that they put ".0" after every number
21:46 <benwilson512> isn't tenable
21:46 <brohith> Anyone know how I can override a poison encode and still build package without the duplicate module error?
21:47 <benwilson512> brohith: I don't know of a way to do so, there is not yet a protocol conflict resolution method as far as I know
21:47 <ericmj> benwilson512: if you expect users to give you floating point values why are you converting it to integers?
21:47 <micmus> ericmj: he wants floats, but there's no built-in function to parse "5" as a float
21:47 keathley joined
21:48 <benwilson512> right, if you give someone a calulator UI or something
21:48 dastagg joined
21:48 <ericmj> Float.parse
21:48 <benwilson512> and I just want to get the strings and add them
21:48 <ericmj> micmus: macro guards is a bad idea
21:49 <ericmj> not being able to do &float/1 would be confusing
21:49 <micmus> you can totally do that with macros
21:49 <micmus> &is_nil/1 works
21:49 <ericmj> brohith: you shouldn't implement Poison.Encoder for DateTime and NaiveDateTime
21:49 <micmus> is_nil is a macro that translates to x === nil
21:50 <ericmj> ah, right
21:51 <ericmj> how does function capturing of macros work?
21:52 <micmus> I have no idea :P But it does
21:52 <micmus> probably translates to &is_nil(&1)
21:52 <micmus> and this expands to &(&1 == nil)
21:53 <ericmj> x+0.0 is a hack anyway :P
21:53 <ericmj> so it's better to just use :erlang.float then
21:56 Ayey_ joined
21:56 <micmus> I guess the discoverability isn't the best - I had no idea :erlang.float existed before and was using +0.0, as the only solution, I knew of
21:58 <micmus> it looks like we're getting a new atomic operation on ETS in OTP20
22:01 <ericmj> I think Float.from_number calling :erlang.float without inlining would work
22:01 hahuang61 joined
22:02 fernandomm joined
22:05 meandi joined
22:11 kronicdeth joined
22:12 <rvirding> As far as I can see calling :erlang.float always does the conversion and never the test
22:13 <rvirding> even in guards
22:17 cevado joined
22:21 <rvirding> Further check agrees with this. So you could always convert float(x) to :erlang.float(x) and you will always get conversion
22:22 codestorm joined
22:24 kronicdeth joined
22:24 io_bora joined
22:25 refriedchicken joined
22:29 srxa joined
22:31 icapurro_ joined
22:31 steffkes joined
22:31 steffkes joined
22:33 nomicflux joined
22:39 steffkes joined
22:39 steffkes joined
22:52 kronicdeth joined
22:55 Ayey_ joined
23:00 io_bora joined
23:07 shadowjack joined
23:09 rschmukler joined
23:12 cevado joined
23:14 duane joined
23:16 icapurro joined
23:16 codestorm joined
23:19 duane joined
23:19 s` joined
23:21 rschmukler joined
23:27 fhoffmann joined
23:31 wilo- joined
23:31 asd_ joined
23:31 thistle joined
23:33 icapurro joined
23:38 thistle joined
23:38 nomicflux joined
23:46 Ayey_ joined
23:50 rschmukler joined
23:52 thistle joined
23:53 DTZUZU joined
23:54 nighty joined
23:54 isubasti_ joined
23:59 duane joined