madroach has quit [Read error: Connection reset by peer]
jbrown has quit [Ping timeout: 245 seconds]
jbrown has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
NingaLeaf123 has joined #ocaml
govg has joined #ocaml
NingaLeaf has quit [Ping timeout: 272 seconds]
madroach_ has quit [Ping timeout: 246 seconds]
madroach has joined #ocaml
ncthom91 has joined #ocaml
govg has quit [Ping timeout: 272 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
NingaLeaf123 has quit [Read error: Connection reset by peer]
NingaLeaf123 has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ncthom91 has joined #ocaml
lewis1711 has joined #ocaml
jbrown has quit [Ping timeout: 240 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Sorella has joined #ocaml
jbrown has joined #ocaml
ceryo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ceryo has joined #ocaml
FreeBirdLjj has joined #ocaml
segmond has joined #ocaml
segmond has quit [Ping timeout: 264 seconds]
segmond has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
ncthom91 has joined #ocaml
govg has joined #ocaml
SuperNoeMan has quit [Ping timeout: 240 seconds]
segmond has quit [Read error: Connection reset by peer]
govg has quit [Ping timeout: 272 seconds]
SuperNoeMan has joined #ocaml
nojb has joined #ocaml
FreeBirdLjj has joined #ocaml
<apache2_>
let b = `Unhandled in begin match 1 , b with | _ , `Handled -> "ok" | _ , x -> begin match x with `Unhandled -> "unhandled 1" end end ;;
<apache2_>
Characters 79-129: Warning 8: this pattern-matching is not exhaustive. Here is an example of a value that is not matched:
<apache2_>
`Handled
<apache2_>
shouldn't the pattern matching engine be able to recognize that it is in fact handled?
<apache2_>
let b = `Handled in begin match 1 , b with | _ , `Handled -> "ok" | _ , x -> begin match x with `Unhandled -> "unhandled 1" end end ;;
<apache2_>
Characters 77-127: Warning 8: this pattern-matching is not exhaustive. Here is an example of a value that is not matched:
<apache2_>
`Handled
nojb has quit [Ping timeout: 250 seconds]
<apache2_>
- : bytes = "ok"
<apache2_>
the matching on x will only happen if x is not `Handled
Algebr has joined #ocaml
Algebr is now known as Guest41671
toomuchtvrotsurb has quit [Remote host closed the connection]
<cody`>
Exhaustiveness is only checked per match
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ceryo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lewis1711 has quit [Ping timeout: 250 seconds]
igoroliveira has quit [Quit: Connection closed for inactivity]
damason has quit [Quit: No Ping reply in 180 seconds.]
damason has joined #ocaml
Guest41671 has quit [Ping timeout: 250 seconds]
jonh has left #ocaml ["WeeChat 0.4.2"]
nullcatxxx_ has joined #ocaml
jeffmo has quit [Quit: jeffmo]
bitbckt has quit [Remote host closed the connection]
Guest41671 has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 272 seconds]
bitbckt has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
nullcatxxx_ has quit [Read error: Connection reset by peer]
nullcatxxx_ has joined #ocaml
nchambers has quit [Quit: compilerdev.net - Compilers made easy]
yegods has quit [Remote host closed the connection]
nullcatxxx_ has quit [Read error: Connection reset by peer]
pierpa has quit [Ping timeout: 240 seconds]
nullcatxxx_ has joined #ocaml
chambart has quit [Ping timeout: 256 seconds]
contempt has quit [Disconnected by services]
contempt has joined #ocaml
nullcatxxx_ has quit [Read error: Connection reset by peer]
nullcatxxx_ has joined #ocaml
Guest41671 has quit [Ping timeout: 240 seconds]
mac10688 has quit [Ping timeout: 272 seconds]
ncthom91 has joined #ocaml
ygrek_ has quit [Ping timeout: 250 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
antkong has quit [Quit: antkong]
cody` has quit [Quit: Connection closed for inactivity]
keep_learning has joined #ocaml
hbar has joined #ocaml
darkf has joined #ocaml
MercurialAlchemi has joined #ocaml
nullcatxxx_ has quit [Read error: Connection reset by peer]
Guest72510 has quit [Changing host]
Guest72510 has joined #ocaml
Guest72510 is now known as trix
nullcatxxx_ has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
Sorella has quit [Quit: Connection closed for inactivity]
lewis1711 has joined #ocaml
FreeBirdLjj has joined #ocaml
<flux>
I think apache2_ is onto something there, why does the type of 'x' still have `Handled in it?
sbrouf has quit [Ping timeout: 240 seconds]
<flux>
hmm, but it doesn't work in the base case either. I was thinking it pretty sure should've.. but maybe I'm mixing it up with using explicit matches like match .. #f as x -> match x with ..
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
MercurialAlchemi has joined #ocaml
zpe has quit [Remote host closed the connection]
ggole has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
Simn has joined #ocaml
ggole_ has joined #ocaml
ggole has quit [Ping timeout: 256 seconds]
malc_ has joined #ocaml
<zozozo>
actually, I think this is where GADTs can be useful
ldopa has quit [Ping timeout: 272 seconds]
nojb has joined #ocaml
Nahra``` has quit [Ping timeout: 246 seconds]
jonludlam has quit [Remote host closed the connection]
ely-se has joined #ocaml
hay207 has joined #ocaml
<hay207>
hi guys, how to install utop?
<hay207>
im a beginner in ocaml
<struk|desk>
hay207: did you install opam yet?
<hay207>
yes
<struk|desk>
opam install utop then
<hay207>
opam init first?
<hay207>
i get this : 'opam init' failed. , Fatal error:, Sys_error("/home/hay207/.opam/repo/default/packages/dockerfile/dockerfile.1.1.1/opam: Too many open files")
<hay207>
using kubuntu 14.04
freehck has joined #ocaml
<freehck>
Hello. I'd like to turn off warning about not axhaustive pattern-matching for a specific part of code. Is it possible?
<freehck>
The function the compuler is blaming on is supposed to get a list and return the list of the same length. I've given 2 values list to this function so the list returned should have 2 values too. And there's no other case.
<ggole_>
There's a ppx for that... lemme dig it up
<freehck>
let echo lst = lst
<freehck>
let [x;y] = echo [1;2]
<freehck>
an example of the problem
Haudegen has quit [Ping timeout: 256 seconds]
<ggole_>
Ah, there
<ggole_>
[@ocaml.warning "-8"]
<freehck>
thank you ggole_
<freehck>
ggole_: and to turn it on I should next do [@ocaml.warning "+8"] ?
<ggole_>
Just stick it on the end, ie: let [x;y] = echo [1;2] [@ocaml.warning "-8"]
<ggole_>
No, it only applies to the annotated expression
<freehck>
hm.. the scope of this expression is the line it's written?
t4nk260 has joined #ocaml
<freehck>
it seems merlin knows nothing about it
sbrouf has joined #ocaml
<ggole_>
Hmm, how recent is your ocaml?
ggole_ is now known as ggole
<freehck>
ggole: 4.01.0
<ggole>
Hmm. I think extension points are 4.02 or later.
<freehck>
ggole: So I need to find the appropriate machanism with camlp4?
<ggole>
I don't think camlp4 supports this.
t4nk260 has quit [Ping timeout: 252 seconds]
<ggole>
You might have to resort to muffling warnings on the entire file :/
<ggole>
(You can muffle only the exhaustiveness warning, but that's still pretty bad.)
<freehck>
Bad news.
<ggole>
Having looked around, extension points are indeed 4.02+.
<freehck>
ggole: I suppose I can just use let x = echo [1;2];; let a = nth x 0;; let b = nth x 1;;
ygrek_ has joined #ocaml
<freehck>
Seems ugly but a workaround.
<ggole>
You can also use a match with assert false, although that's ugly as well
<freehck>
yep
<ggole>
It may be less error prone though, since you can name the variables rather than using indices
Haudegen has joined #ocaml
<malc_>
freehck: let a::b::_ = [1;2];;
<freehck>
malc_: no, it doesn't work of course.
<freehck>
because the expression is not considered for the type int list is an empty list.
<freehck>
you'd see it if you tried specifically let a::b::_ = echo [1;2];;
nojb has quit [Quit: nojb]
<ggole>
Be aware that the toplevel muffles some warnings
<malc_>
freehck: eh?
<malc_>
and why aren't you using tupples anyway
<ggole>
Because echo doesn't take a tuple, I imagine
freehck` has joined #ocaml
freehck has quit [Ping timeout: 245 seconds]
<ggole>
There's a fairly common pattern where you have a list of repetitive calculations you want to bind the result of to variables, without duplicating the common parts
<ggole>
Something like let [a;b;c;...] = List.map (fun x -> f arg x) [a0; b0; c0; ...]
<ggole>
Being able to muffle warnings is nice for that.
<hay207>
when i init opam, aspcud gives permission denied , should i run opam init as root?
Anarchos has joined #ocaml
<mrvn>
ggole: let f0 = f arg in let a = f0 a0 in let b = f0 b0 in let c = f0 c0 in ...
Intensity has quit [Remote host closed the connection]
<apache2_>
ah hm, in this case I'd like to go the other way though
<apache2_>
ggole: from an "abc" value to a "needs_coercion" type, hoping that pattern matching the `C away (guaranteeing that my "abc" cannot possibly be `C)
Intensity has joined #ocaml
keep_learning has quit [Quit: This computer has gone to sleep]
<ggole>
The problem is that pattern matching does that, you get type errors that you would not otherwise get. Matching on an abc will not give you an abc, but a different type (that is coercible to an abc).
<ggole>
*is that if
<ggole>
So the suggestion to refine matched values in this way is not without problems (which is not to say a reasonable design is impossible...)
Nahra``` has joined #ocaml
<apache2_>
alright :)
Intensity has quit [Ping timeout: 260 seconds]
<def`>
OCaml type system is not expressive enough to represent "I eliminated one case"
<def`>
(yet)
<gasche>
although (#foo as x) is rather close to it
<gasche>
(I don't see enough of the context of the present discussion to know whether this can help)
ncthom91 has joined #ocaml
<ggole>
Yeah, it would be nice to be able to say something like let remove_foos x : t - Foo = ...
<ggole>
Complexity would go up a bit, which is never wonderful.
<gasche>
there might be something interesting to be done revisiting row variable design choices
<gasche>
but that is a few-months-of-work affair, not a one-pull-request-at-a-time thing
<def`>
more or less mandatory for typing effect system
<ggole>
Elm has a similar mechanism for records
<gasche>
if you are interested, send an internship application to Didier Rémy or Jacques Garrigue
keep_learning has joined #ocaml
<gasche>
(or Leo/Jeremy maybe?)
<def`>
one thing at a time :)
<gasche>
some things can be done in the small, during week-end hacking sessions; I don't believe this one is
<gasche>
def`: you have bigger fish to fry
<def`>
ggole: problem is for records, the value representation is non trivial
<gasche>
(also, hi)
<apache2_>
btw, is there a way to make the compiler complain if a recursive function is not tail-recursive?
<def`>
(hi)
<ggole>
def`: right. Elm compiles into JS, so it can (more or less) rely on a strong speculative compiler eliding the cost much of the time
<ggole>
I'm not sure how a more traditional AoT compiler would handle it.
<def`>
ggole: yes. In OCaml you would endup with the hash based dispatch of objects (which is reasonably efficient)
<gasche>
apache2_: not-yet-released OCaml version supports annotating tail calls with the @tailcall attribute
<def`>
(also what objective-c runtime is doing too)
<def`>
ggole: problem is that object extension is not (easily) safe in this model (I don't know how elm handles that)
<apache2_>
gasche: alright, I'll wait :)
<ggole>
Mmm. It might be OK for sums rather than records since there is already dispatch of a kind to piggyback on
<companion_cube>
def`: for this to happen, we would have to introduce a kind system and explicit row variables, right?
<def`>
companion_cube: I don't know, that's a matter of syntax
<ggole>
def`: it's based on a particular paper which I cannot recall the name or author of at the moment
<def`>
koka from Daan Leijen I guess
<def`>
(or whatever first-class labels from same author)
cantstanya has joined #ocaml
<ggole>
Not sure, but I have it sitting around
* ggole
wanders off to check
* def`
gasche au fait tu avais des remarques a me faire pour améliorer l'exposé ?
<def`>
oups
<def`>
wrong cmd
<rks`>
nah, it's just fine
freehck has joined #ocaml
<ggole>
Yeah, Leijen: "Extensible records with scoped labels"
<def`>
rks`: :D
jeffmo has joined #ocaml
emias has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<edwin>
had exactly same symptoms as you: server works fine when run in foreground, hangs on first http call when daemonized if some Lwt code run in the parent (e.g. print some warning)
<smondet>
edwin: thanks, I bypased my issues with daemons with some other work-around
manizzle has quit [Ping timeout: 250 seconds]
<edwin>
you might want to test out of curiosity if replacing Unix.fork with Lwt_unix.fork on that older version of ketrew fixes tls issue 302, but yeah now I see the code's completley changed on master