rgrinberg has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
fraggle_ has joined #ocaml
silver_ has quit [Read error: Connection reset by peer]
fraggle_ has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
APNG is now known as Soni
Soni has quit [Quit: Leaving]
wu_ng has joined #ocaml
etc has joined #ocaml
brunoro has joined #ocaml
govg has quit [Ping timeout: 250 seconds]
conrad2 has joined #ocaml
brunoro has quit [Ping timeout: 252 seconds]
conrad2 has quit [Ping timeout: 256 seconds]
minn has joined #ocaml
FreeBirdLjj has joined #ocaml
etc has quit [Ping timeout: 260 seconds]
petroav has joined #ocaml
jimdopango has joined #ocaml
rgrinberg has quit [Remote host closed the connection]
shakalaka has quit [Quit: bye.]
shakalaka has joined #ocaml
brunoro has joined #ocaml
govg has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
shakalaka has quit [Quit: bye.]
shakalaka has joined #ocaml
sh0t has quit [Remote host closed the connection]
pierpa has quit [Ping timeout: 244 seconds]
g4143 has joined #ocaml
lopex has quit [Quit: Connection closed for inactivity]
govg has quit [Ping timeout: 256 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
petroav has quit [Ping timeout: 250 seconds]
jimdopango has quit [Ping timeout: 260 seconds]
conrad2 has joined #ocaml
brunoro has joined #ocaml
conrad2 has quit [Ping timeout: 252 seconds]
brunoro has quit [Ping timeout: 244 seconds]
nomicflux has quit [Quit: nomicflux]
FreeBirdLjj has joined #ocaml
g4143 has quit [Quit: Leaving]
okuu has quit [Quit: Fix config.]
okuu has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
okuu has quit [Client Quit]
AlexDenisov has joined #ocaml
govg has joined #ocaml
okuu has joined #ocaml
larhat has quit [Quit: Leaving.]
brunoro has joined #ocaml
ascx has joined #ocaml
brunoro has quit [Ping timeout: 252 seconds]
brunoro has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
brunoro has quit [Ping timeout: 260 seconds]
etc has joined #ocaml
<etc>
Hi - Is it possible to change the name of a file's module so it doesn't match the file?
<flux>
no
<flux>
well, I suppose it might be to produce a file with different name with ocamlc -o
<flux>
but the module name is going to be sourcefile.ml -> Sourcefile
<flux>
at least as far as I understand it ;)
<etc>
flux: cool that's just what I was asking - thanks!
<flux>
you can of course have any a module of any name inside that module
Mercuria1Alchemi has joined #ocaml
Mercuria1Alchemi has quit [Remote host closed the connection]
brunoro has joined #ocaml
<etc>
(thumbsup) cool
Mercuria1Alchemi has joined #ocaml
brunoro has quit [Ping timeout: 245 seconds]
kakadu has joined #ocaml
SpaceSheep has joined #ocaml
noddy has quit [Ping timeout: 260 seconds]
conrad2 has joined #ocaml
Algebr has joined #ocaml
conrad2 has quit [Ping timeout: 260 seconds]
fantasticsid has joined #ocaml
zpe has joined #ocaml
alfredo has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<rightfold>
symlink
<companion_cube>
orbitz: no complexity doc on CCFQueue, because it's all in the paper (mostly O(1) amortized except for append-like operations)
<orbitz>
Ok, I am snoc'ing and take_front'ing, which I assume is pretty good time complexity given that's a queue :)
<companion_cube>
yeah, the asymptotic complexity should be good
<orbitz>
companion_cube: btw, API aesthetics comment. I notice you use `get_or` for containers. Any reason you didn't go with `get_default`, the or_ is awkawrd looking. It doesn't make a different in the end, just awkward. WAlso, to I would expect get_or to take a function to execute on the or case, rather than a value. But that is just me and depends on one's expectations
<companion_cube>
the constant factor, though, might not be that good
kakadu has quit []
<companion_cube>
ah, well, consistency :/
<orbitz>
:)
<companion_cube>
~default is a bit long, but it's indeed more readable
g4143 has joined #ocaml
FreeBirdLjj has joined #ocaml
brunoro has joined #ocaml
govg has quit [Ping timeout: 250 seconds]
fantasticsid has quit [Quit: ERC (IRC client for Emacs 25.1.50.1)]
brunoro has quit [Ping timeout: 260 seconds]
dreadedfrog_ has joined #ocaml
aluuu has quit [Ping timeout: 245 seconds]
Simn has joined #ocaml
jnavila has joined #ocaml
dreadedfrog_ has quit [Ping timeout: 245 seconds]
SpaceSheep has quit [Quit: WeeChat 1.5]
etc has quit [Ping timeout: 260 seconds]
g4143 has quit [Quit: Leaving]
AlexDenisov has joined #ocaml
dakk has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
govg has joined #ocaml
brunoro has joined #ocaml
orbifx1 has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
brunoro has joined #ocaml
larhat has joined #ocaml
<minn>
I don't really understand why this constitutes a type error? The use seems fine to me, and I'm not really sure where the problem is. <http://lpaste.net/269692>
lopex has joined #ocaml
conrad2 has joined #ocaml
<lyxia>
minn: the type being inferred is not b -> a -> int in the second one.
<minn>
Ah, it's inferring [< `A of int] instead of a, right?
<lyxia>
right
conrad2 has quit [Ping timeout: 260 seconds]
<minn>
I see. Adding the type annotation gives the same type error. Hmm.
freusque has joined #ocaml
<minn>
Thanks. I'll have to do a little more reading on polymorphic variants to fix this, I suppose.
govg has quit [Ping timeout: 244 seconds]
mfp has joined #ocaml
Soni has joined #ocaml
govg has joined #ocaml
jwatzman|work has joined #ocaml
johnelse_ is now known as johnelse
ygrek has joined #ocaml
okuu has quit [Quit: unyu~, fix config]
inr_ is now known as inr
okuu has joined #ocaml
govg has quit [Ping timeout: 252 seconds]
govg has joined #ocaml
Algebr has quit [Ping timeout: 260 seconds]
malina has quit [Ping timeout: 260 seconds]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fraggle_ has joined #ocaml
cdidd has quit [Ping timeout: 260 seconds]
rightfold has left #ocaml [#ocaml]
conrad2 has joined #ocaml
silver has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 258 seconds]
conrad2 has quit [Ping timeout: 245 seconds]
govg has quit [Ping timeout: 256 seconds]
_andre has joined #ocaml
brunoro has quit [Ping timeout: 265 seconds]
govg has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
Algebr has joined #ocaml
FreeBirdLjj has joined #ocaml
dhil has quit [Remote host closed the connection]
dhil has joined #ocaml
beginner_ has joined #ocaml
<beginner_>
if a program exits with failwith, is there no backtrace for the debugger?
okuu has quit [Remote host closed the connection]
dreadedfrog_ has joined #ocaml
okuu has joined #ocaml
<flux>
failwith is an exception, and ocaml does have backtraces assuming you compile with -g (debug symbols enabled) and you have environment variable OCAMLRUNPARAM=b (alternatively you can turn on backtraces from the program itself)
<flux>
s/is/throws/
okuu has quit [Client Quit]
dreadedfrog_ has quit [Ping timeout: 245 seconds]
okuu has joined #ocaml
<beginner_>
flux: i have compiled the sources with -g, but when I run the program with the ocamldebugger backtrace is empty
<flux>
I haven't atually used the ocamldebug mostly at all, so I don't recall if it does exception dumps..
<flux>
(personally I haven't found the tool very helpful)
<beginner_>
flux: what do you use then to fix bugs in your code?
<Algebr>
probably print_endline
<flux>
I test functions in isolation (ie. in top level), with unit tests (uUnit) and log messages
<flux>
I don't say debuggers are useless, I say ocamldebug is :P
govg has quit [Ping timeout: 256 seconds]
cdidd has joined #ocaml
conrad2 has joined #ocaml
rgrinberg has joined #ocaml
conrad2 has quit [Ping timeout: 256 seconds]
johnelse has quit [Ping timeout: 256 seconds]
dhil has quit [Ping timeout: 244 seconds]
govg has joined #ocaml
<orbifx1>
what's the syntax for aliasing a parameter?
<orbifx1>
If one wants to create a short-name for a parameter
<orbifx1>
is it simply: fun_name (parameter as p) ... ?
<lyxia>
it is
<orbifx1>
thanks
johnelse has joined #ocaml
freusque has quit [Ping timeout: 245 seconds]
wu_ng has quit [Ping timeout: 260 seconds]
dhil has joined #ocaml
Algebr has quit [Ping timeout: 260 seconds]
copy` has joined #ocaml
pierpa has joined #ocaml
freehck has joined #ocaml
<freehck>
hello everyone
<companion_cube>
hello freehck
<freehck>
Could anyone help me? I constantly get a unix_error in this code: http://pastebin.com/9XKiHg9P and I don't understand why and how to fix it.
FreeBirdLjj has quit [Remote host closed the connection]
<freehck>
When I do the same thing with dig command-line tool, everything's okay.
<freehck>
Maybe ocaml-dns doesn't know that in case of EAGAIN the sane behaviour is to try one more reading after a while?
zpe has quit [Remote host closed the connection]
sh0t has joined #ocaml
<copy`>
freehck: You're probably right, you should report this on the bug tracker of the ocaml-dns project
agarwal1975 has joined #ocaml
govg has quit [Ping timeout: 260 seconds]
srenatus[m] has quit [Ping timeout: 258 seconds]
Guest23668[m] has quit [Ping timeout: 258 seconds]
M-pesterhazy has quit [Ping timeout: 258 seconds]
M-jimt has quit [Ping timeout: 258 seconds]
lpw25[m] has quit [Ping timeout: 250 seconds]
regnat[m] has quit [Ping timeout: 250 seconds]
M-pesterhazy has joined #ocaml
srenatus[m] has joined #ocaml
lpw25[m] has joined #ocaml
Guest23668[m] has joined #ocaml
regnat[m] has joined #ocaml
M-jimt has joined #ocaml
ascx has quit [Quit: Page closed]
minn has quit [Quit: Leaving]
<freehck>
copy`: done
al-damiri has joined #ocaml
<copy`>
If you have the free time you could dig (pun intended) into the code and fix the issue yourself :-)
Mercuria1Alchemi has quit [Ping timeout: 244 seconds]
<freehck>
copy`: Will see. For now I think I'll just wrap host command and parse its output.
<freehck>
slaty but fast
noddy has joined #ocaml
sh0t has quit [Ping timeout: 250 seconds]
jita has joined #ocaml
jita has left #ocaml [#ocaml]
Algebr has joined #ocaml
conrad2 has joined #ocaml
eh_eff_ has joined #ocaml
govg has joined #ocaml
conrad2 has quit [Ping timeout: 260 seconds]
eh_eff_ has quit [Ping timeout: 265 seconds]
sh0t has joined #ocaml
Algebr has quit [Ping timeout: 260 seconds]
t4nk652 has joined #ocaml
nomicflux has joined #ocaml
larhat has quit [Read error: No route to host]
larhat has joined #ocaml
ggole has joined #ocaml
MercurialAlchemi has joined #ocaml
<orbifx1>
what's the best way to source an accurate value of Pi in OCaml?
<Drup>
4. *. atan 1.
<Drup>
(like in every language, I would say)
<companion_cube>
except those that already define pi
MercurialAlchemi has quit [Ping timeout: 252 seconds]
<Drup>
companion_cube: they probably do it that way, though
<orbifx1>
whats the error in that?
<def`>
Drup: no, just a #define
<def`>
with a litteral constant
<Drup>
def`: that doesn't care about floating point number size :(
<companion_cube>
they probably have #if .. #else ...
<Drup>
That's really sad
<companion_cube>
well you don't pay any price at initialization
MercurialAlchemi has joined #ocaml
<def`>
Drup: ???
<def`>
64 bits
<flux>
the internal precision can be higher?
<def`>
yes, on x87
<flux>
that was really my argument against a literal :)
<flux>
I suppose GPUs have dropepd that nonsense.
<companion_cube>
otoh if you compute pi every time you use it, it's going to be costly
<Drup>
companion_cube: my point was more "why use a define when you can just declare a global variable"
<flux>
maybe not, sounds likely there is a hot path for that..
<def`>
if you care about 64 vs 80 bits internal precision, you have to worry about much more than the precision of the literal
<def`>
(and the C standard being vague, I'm sure you can put maximal precision in the litteral representation, and there exists a compiler and a platform where it will work with more than 64 bits)
<def`>
plus having more computation involved more or less mean less precision
<flux>
in practice, it's annoying to get pi that way of from a library, given how ocaml otherwise has a nice set of floating point functions :)
<def`>
(and less reproducible results since spilling might round in a different way if internal precision is higher, whereas the litteral doesn't change)
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
conrad2 has quit [Ping timeout: 260 seconds]
orbifx1 has quit [Ping timeout: 244 seconds]
sh0t has quit [Remote host closed the connection]
sh0t has joined #ocaml
noddy has joined #ocaml
larhat has quit [Quit: Leaving.]
dhil has joined #ocaml
malina has joined #ocaml
govg has quit [Ping timeout: 250 seconds]
xt_ has joined #ocaml
eh_eff_ has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
Stalkr has joined #ocaml
Stalkr has quit [Changing host]
Stalkr has joined #ocaml
dhil has quit [Ping timeout: 252 seconds]
rossberg has joined #ocaml
malina has quit [Remote host closed the connection]
malina has joined #ocaml
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
dhil has joined #ocaml
Algebr has joined #ocaml
ggole has quit [Ping timeout: 250 seconds]
bugabinga[m] has quit [Ping timeout: 258 seconds]
timclassic has quit [Ping timeout: 258 seconds]
barkmadley[m] has quit [Ping timeout: 258 seconds]
M-Illandan has quit [Ping timeout: 258 seconds]
M-martinklepsch has quit [Ping timeout: 258 seconds]
tane has joined #ocaml
Bluddy[m] has quit [Ping timeout: 251 seconds]
M-ErkkiSeppl has quit [Ping timeout: 258 seconds]
lpw25[m] has quit [Ping timeout: 256 seconds]
M-jimt has quit [Ping timeout: 256 seconds]
Guest23668[m] has quit [Ping timeout: 256 seconds]
regnat[m] has quit [Ping timeout: 256 seconds]
M-pesterhazy has quit [Ping timeout: 256 seconds]
srenatus[m] has quit [Ping timeout: 256 seconds]
Orion3k has joined #ocaml
dhil has quit [Ping timeout: 250 seconds]
brunoro has joined #ocaml
lpw25[m] has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
dreadedfrog_ has joined #ocaml
M-martinklepsch has joined #ocaml
bugabinga[m] has joined #ocaml
timclassic has joined #ocaml
regnat[m] has joined #ocaml
M-jimt has joined #ocaml
srenatus[m] has joined #ocaml
M-pesterhazy has joined #ocaml
Bluddy[m] has joined #ocaml
M-Illandan has joined #ocaml
barkmadley[m] has joined #ocaml
Guest23668[m] has joined #ocaml
M-ErkkiSeppl has joined #ocaml
noddy has quit [Ping timeout: 256 seconds]
Algebr has quit [Ping timeout: 252 seconds]
sh0t has quit [Ping timeout: 252 seconds]
djellemah_ has joined #ocaml
conrad2 has joined #ocaml
djellemah_ has quit [Client Quit]
Algebr has joined #ocaml
jeffmo has quit [Quit: jeffmo]
conrad2 has quit [Ping timeout: 252 seconds]
TheLemonMan has joined #ocaml
sh0t has joined #ocaml
hellofunk has joined #ocaml
govg has joined #ocaml
dreadedfrog_ has quit [Ping timeout: 245 seconds]
xt_ has quit [Ping timeout: 260 seconds]
dreadedfrog_ has joined #ocaml
brunoro has joined #ocaml
noddy has joined #ocaml
veggie_ has quit [Ping timeout: 256 seconds]
brunoro has quit [Ping timeout: 245 seconds]
noddy has quit [Ping timeout: 260 seconds]
mattrepl has joined #ocaml
octachron has joined #ocaml
veggie_ has joined #ocaml
dreadedfrog_ has quit [Ping timeout: 245 seconds]
dreadedfrog_ has joined #ocaml
noddy has joined #ocaml
t4nk652 has quit []
kakadu has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
rgrinberg has quit [Remote host closed the connection]
brunoro has joined #ocaml
sz0 has joined #ocaml
jeffmo has joined #ocaml
struk|desk has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
struk|desk2 has quit [Ping timeout: 258 seconds]
orbifx1 has joined #ocaml
minn has joined #ocaml
brunoro has joined #ocaml
<minn>
Would someone mind explaining why OCaml infers too large (specific) a type in the second function? There must be a semantic difference I'm not picking up on. The first types as I would expect. <http://lpaste.net/273059>
veggie_ has quit [Ping timeout: 260 seconds]
conrad2 has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
veggie_ has joined #ocaml
<adrien>
it seems quite logical to me
eh_eff_ has quit [Ping timeout: 260 seconds]
mk270 has joined #ocaml
<adrien>
when you write "let `A = a", either your match could fail at runtime or a must be of type [ `A ]
<adrien>
second option seems nicer to me
<mk270>
i used to be able to do, e.g., "module X = Pervasives" at the REPL and see what was in Pervasives; this doesn't seem to work any more. is there a workaround?
conrad2 has quit [Ping timeout: 265 seconds]
<Algebr>
#show_module
<mk270>
algebr: thanks - i'll check that out
<mk270>
i appreciate i was relying on a bit of a hack
<mk270>
ok that works.
<minn>
Isn't the same true of the partial match, though? Either the match fails at runtime or must be of type [ `A ]?
<adrien>
hmmm, true, didn't pay attention enough
<ousado>
minn: well, you get an error for that, too :)
<ousado>
err
<ousado>
warning
<adrien>
I don't know exactly why it choses one "solution" over the other
mk270 has left #ocaml [#ocaml]
<minn>
Yeah. It must have something to do with the implementation of polymorphic variants. It seems like the let expression forces too large a type (it should be able to give it type p instead of [< `A]).
<aantron>
minn: what do you mean by OCaml inferring a type in the second function? no type was inferred for the function itself as far as we can see - there is a type error instead
<aantron>
if it were not for the type error, i think it would infer f : p -> p
<aantron>
as well, if you rewrote g to evaluate to a in the match cases (similar to f), you would get g : p -> p
<aantron>
match case*
brunoro has joined #ocaml
sh0t has quit [Ping timeout: 256 seconds]
<minn>
That is my bad, I intended a different return type: <http://lpaste.net/273162> I don't think it matters here, though.
<minn>
aantron: You're right. I meant that one fails to type check, but I don't see the difference between the expression.
<aantron>
minn: ok, now they are more symmetric :) just wanted to be clear. i think this goes back to the ancient decision to make inexhaustive match a warning rather than a type error
<aantron>
currently i think it is recommended to treat that warning as an error, and add explicit "assert false" cases
<aantron>
let doesn't have this baggage, but match does
brunoro has quit [Ping timeout: 250 seconds]
<minn>
aantron: Interesting, that makes sense. I suppose in the larger scheme of things, I prefer the approach taken by let.
<aantron>
yeah, agreed. for that, you compile with -warn-error +8 (IIRC)