manizzle has quit [Remote host closed the connection]
WraithM has joined #ocaml
Nuki has quit [Remote host closed the connection]
squiggnet has joined #ocaml
philtor has joined #ocaml
manizzle has joined #ocaml
ontologiae has quit [Ping timeout: 258 seconds]
philtor has quit [Ping timeout: 255 seconds]
WraithM has quit [Ping timeout: 258 seconds]
WraithM has joined #ocaml
sgnb` has joined #ocaml
racycle has quit [Quit: ZZZzzz…]
WraithM has quit [Ping timeout: 255 seconds]
sgnb has quit [Ping timeout: 265 seconds]
WraithM has joined #ocaml
divyanshu has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
boogie has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 265 seconds]
WraithM has quit [Ping timeout: 252 seconds]
studybot_ has quit [Read error: Connection reset by peer]
manizzle has quit [Ping timeout: 264 seconds]
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tlockney_away is now known as tlockney
claudiuc has quit [Remote host closed the connection]
WraithM has joined #ocaml
studybot has joined #ocaml
johnnydiabetic has joined #ocaml
johnnydiabetic has quit [Client Quit]
smondet has quit [Ping timeout: 240 seconds]
malo has quit [Quit: Leaving]
nikki93 has quit [Read error: Connection reset by peer]
nikki93 has joined #ocaml
tnguyen has quit [Ping timeout: 240 seconds]
smondet has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest10921
sheijk_ has quit [Ping timeout: 255 seconds]
tlockney is now known as tlockney_away
dotfelix has joined #ocaml
tnguyen has joined #ocaml
dotfelix has quit [Ping timeout: 252 seconds]
tnguyen has quit [Ping timeout: 240 seconds]
dotfelix has joined #ocaml
pyon has quit [Quit: restart]
sheijk has joined #ocaml
tlockney_away is now known as tlockney
sheijk has quit [Ping timeout: 240 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
dotfelix has quit [Quit: Leaving...]
Eyyub has quit [Ping timeout: 240 seconds]
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
sheijk has joined #ocaml
sheijk has quit [Ping timeout: 264 seconds]
divyanshu has joined #ocaml
lostcuaz has joined #ocaml
yacks has joined #ocaml
yacks has quit [Ping timeout: 245 seconds]
michael_lee has joined #ocaml
claudiuc has joined #ocaml
sheijk has joined #ocaml
sheijk has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
axiles has joined #ocaml
studybot has quit [Remote host closed the connection]
csakatoku has joined #ocaml
Guest10921 has quit [Remote host closed the connection]
studybot has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
WraithM has quit [Ping timeout: 252 seconds]
WraithM has joined #ocaml
sheijk has joined #ocaml
tlockney is now known as tlockney_away
ygrek has quit [Ping timeout: 252 seconds]
sheijk has quit [Ping timeout: 240 seconds]
avsm has joined #ocaml
manizzle has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
yacks has joined #ocaml
claudiuc has quit [Remote host closed the connection]
edwin has joined #ocaml
edwin is now known as edwin3
zpe has joined #ocaml
jao has joined #ocaml
jao is now known as Guest54116
Guest54116 has quit [Ping timeout: 258 seconds]
avsm has quit [Quit: Leaving.]
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
ggole has joined #ocaml
j0sh has quit [Ping timeout: 276 seconds]
j0sh has joined #ocaml
Kakadu has joined #ocaml
csakatoku has quit [Remote host closed the connection]
yetanotherion has quit [Remote host closed the connection]
dotfelix has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
yacks has joined #ocaml
ygrek has joined #ocaml
csakatoku has joined #ocaml
yetanotherion has joined #ocaml
dotfelix is now known as dotfelixb
dotfelixb has quit [Read error: Connection reset by peer]
edwin3 is now known as edwin
rand000 has joined #ocaml
madroach_ has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach_ has quit [Read error: Connection reset by peer]
Nuki has joined #ocaml
madroach has joined #ocaml
Simn has joined #ocaml
rb__ has joined #ocaml
<rb__>
Can someone help me understand the type assigned to c in this code? fun (c:Html5_types.div Eliom_content.Html5.D.elt) -> ()
<rb__>
I don't understand what Eliom_content.Html5.D.elt does in there
madroach_ has joined #ocaml
madroach_ has quit [Read error: Connection reset by peer]
madroach has quit [Read error: Connection reset by peer]
<adrien>
c : (Html5_types.div Eliom_content.Html5.D.elt)
<adrien>
like (int array)
AltGr has joined #ocaml
edwin has left #ocaml [#ocaml]
<rb__>
thanks adrien. Do I read it correctly as "an HTML element which is a div"?
<adrien>
I don't know eliom so I can't be completely sure but it looks like this
<rb__>
ok, thx!
madroach has joined #ocaml
<ggole>
That some nesty code
<ggole>
's
<rb__>
ggole, I don't get what you mean
<ggole>
There's three levels of modules
<rb__>
ggole, ha yes, indeed.
martintrojer has quit [Max SendQ exceeded]
martintrojer has joined #ocaml
root_empire has joined #ocaml
eikke__ has joined #ocaml
<rb__>
I'm calling a logging function returning nil as first statement in the if and else branch. To make it work I had to use the construction "let _ = .... in ...". Is that the way to go? I pasted the code here if it can make my question clearer: http://pastie.org/9171267
<ggole>
If the return type is unit, you can foo (); ... instead of let _ = foo () in ...
<ggole>
(The compiler will issue a warning if the type is not unit.)
<mfp>
rb__: you're doing if foo then a; b else c; d change that to if foo then begin a; b end else begin c; d end
ikaros has joined #ocaml
nikki93_ has joined #ocaml
<rb__>
mfp, I think you spotted the problem!
nikki93 has quit [Read error: Connection reset by peer]
<rb__>
thx to both of you, it helps me learn faster!
racycle has joined #ocaml
maattdd has joined #ocaml
nikki93_ has quit [Remote host closed the connection]
rand000 has quit [Ping timeout: 250 seconds]
waneck has joined #ocaml
<whitequark>
hmmm, I need a data structure advice
<whitequark>
hm, I basically want a hash table, but persisted to disk
<whitequark>
adrien_oww: dunno. ask that in the reddit thread?
<adrien_oww>
not my credentials with me ='(
<adrien_oww>
(I need to either re-figure out my password or backup that cookie :D )
<mfp>
whitequark: you might want to take a look at ocaml-leveldb if you don't want to write your own (mdb) bindings
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<whitequark>
mfp: oh, thanks
<whitequark>
mfp: hm, do you mean I should reuse leveldb or that it could be adapted to mdb?
<whitequark>
mfp: LMDB's zero-copy capability and crash recovery is quite important to me
<mfp>
whitequark: that you can use LevelDB via ocaml-leveldb if you don't feel mldb's advantages (according to the page you gave) are worth writing your own bindings
root_empire has quit [Remote host closed the connection]
michael_lee has quit [Remote host closed the connection]
<whitequark>
they are. and besides, I don't think that writing bindings is hard
<mfp>
LevelDB doesn't give you zero-copy, so if you absolutely need that the choice's made for you
<whitequark>
it's like two hours of work
<mfp>
enjoy then :)
nikki93 has joined #ocaml
nikki93 has quit [Ping timeout: 245 seconds]
<whitequark>
especially with ctypes
<whitequark>
(but I really want cstubs first, to get static linking with -cclib -static eventually)
rand000 has joined #ocaml
AltGr has left #ocaml [#ocaml]
rand000 has quit [Ping timeout: 252 seconds]
jao has quit [Ping timeout: 276 seconds]
ontologiae has joined #ocaml
bobry has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
<bobry>
Is there a way of deleting a project from OCaml Forge?
csakatoku has quit []
<whitequark>
write the administrator
_andre has joined #ocaml
sheijk has joined #ocaml
Thooms has joined #ocaml
sheijk has quit [Client Quit]
hannes has joined #ocaml
<hannes>
is there a straightforward way to limit oUnit2 to a single thread/process (I wasn't able to find any documentation about it, and it seems to use 3 on my computer)
AltGr has joined #ocaml
studybot has quit [Remote host closed the connection]
AltGr has left #ocaml [#ocaml]
<bobry>
whitequark: it seems like this is the only option
<Drup>
whitequark: for your db thingy, if you want to be slightly ambitious, you can look at ACIDState
<Drup>
it's not gonna answer your question, but it may be interesting
<companion_cube>
:)
eikke__ has quit [Ping timeout: 264 seconds]
eikke__ has joined #ocaml
maattdd has joined #ocaml
<companion_cube>
whitequark: do you know qtest?
ygrek has joined #ocaml
maattdd has quit [Ping timeout: 258 seconds]
<whitequark>
companion_cube: nope
<whitequark>
companion_cube: or do you mean the qt thing?
<companion_cube>
no, it's a testing framework in which tests are written in the source code itself
<companion_cube>
in comments
<companion_cube>
I think ppx could be a nice improvement on that
maattdd has joined #ocaml
<Drup>
that would be trivial to implement in ppx
<Drup>
you can do it by yourself
<companion_cube>
yes, maybe
<companion_cube>
but I'm apparently unable to do anything those days --
<Drup>
just use @@@, since it's going to be ignored by the compiler without the ppx
<companion_cube>
@@ you mean?
studybot has joined #ocaml
<Drup>
depends
<Drup>
depends where you want to attach the node
<whitequark>
companion_cube: ohh, pa_test
<companion_cube>
it should be a toplevel unit value, I think
<whitequark>
companion_cube: it's [@@@]
<companion_cube>
whitequark: it's in comments but well
<companion_cube>
ah
<Drup>
then @@@, yeah
<flux>
they should allow numbers as part of operators. @3 !
<whitequark>
[@@@] is a floating attribute
<companion_cube>
[@@@test foo=bar] ?
<Drup>
yes
<whitequark>
basically like [%%], but ignored if not understood
<companion_cube>
excellent.
<companion_cube>
I've been wanting to use my own testing library inline :>
<Drup>
(nih detected)
<whitequark>
no, NIH'd testing libraries are ok
<whitequark>
so far I don't know of a satisfying OCaml one
<Drup>
whitequark: what don't you like in oUnit ?
<whitequark>
Drup: ./test_foo -help
<whitequark>
<20 lines of output>
<Drup>
and ?
<whitequark>
most of which I won't ever need
<whitequark>
and more importantly, it doesn't have one obvious feature I *do* need
<Drup>
oh, that's more important
<whitequark>
running a set of tests by regexp
<whitequark>
or glob
<whitequark>
*anything* except specifying it in ounit's internal extra long and painful format
<companion_cube>
Drup: sorry but I think my qcheck library is more complete than qtest's one
<companion_cube>
reallyu
<whitequark>
Drup: talking about acidstate
Ptival has quit [Ping timeout: 276 seconds]
darkf has quit [Quit: Leaving]
<whitequark>
I would call it a Typical Haskell Library, which means it successfully works to demonstrate a cool and somewhat esoteric concept rooted deep in Haskell's features, but utterly ignores anything related to real-world problems
Ptival has joined #ocaml
<companion_cube>
:D
<Drup>
xD
<Drup>
whitequark: something equivalent would still be useful from my point of view
<whitequark>
I almost stopped reading after "After all, you can buy machines with 1TB of RAM these days."
<companion_cube>
:DDD
<companion_cube>
good argument
<whitequark>
like, it deliberately takes control over memory placement from my hands in exchange for purity
<Drup>
whitequark: oh yeah, that is bullshit
<whitequark>
it's a good idea if you want to publish a paper
<whitequark>
brb
<Drup>
whitequark: the part that interest me is the persistent + statically typed aspect, which is not that easy to achieve
<companion_cube>
you need ocaml-ty
<companion_cube>
:D
<Drup>
companion_cube: while still being not completely inefficient.
<companion_cube>
weeeeell
<adrien_oww>
Drup: it's not completely inefficient
studybot_ has joined #ocaml
<Drup>
adrien_oww: using ocaml-ty in a database ? huuum.
<adrien_oww>
ah
<adrien_oww>
right :D
dotfelix has joined #ocaml
<companion_cube>
Drup: well then what do you propose to make it typesafe? how does acid-state do it?
studybot has quit [Ping timeout: 240 seconds]
<Drup>
badly
<Drup>
(they use the haskell equivalent of ocaml-ty)
<Drup>
(iirc)
AltGr has left #ocaml [#ocaml]
shinnya has joined #ocaml
<companion_cube>
heh
AltGr has joined #ocaml
dotfelix has quit [Quit: Leaving...]
dotfelix has joined #ocaml
sjbx has joined #ocaml
<sjbx>
hey, can someone help me out. i'm not seeing the documented behaviour for ounit. I'm running a suite that fails and i was expecting a non-zero exit status. i made a simple gist of a repro: https://gist.github.com/simonjbeaumont/9dbb0771baf616c3493d
<sjbx>
opam tells me i'm using oUnit 2.0.0
dotfelix has quit [Quit: Leaving...]
rand000 has quit [Ping timeout: 240 seconds]
racycle has quit [Read error: Connection reset by peer]
racycle_ has joined #ocaml
ocp has joined #ocaml
<sjbx>
i found that opening OUnit2 instead of OUnit and replacing the unit parameter with an _ (so it matches against a test_ctxt) caused it to work...
<sjbx>
shame that opening OUnit module with OUnit 2 installed does not have the same behaviour as before upgrading, not backwards compatible with any test suites in behaviour
divyanshu has quit [Quit: Computer has gone to sleep.]
t4nk262 has quit [Quit: Page closed]
<companion_cube>
sjbx: I guess that's why it's a major upgrade
<sjbx>
yeah, but they've kept the OUnit namespace distinct from OUnit2
eikke__ has quit [Ping timeout: 240 seconds]
eikke__ has joined #ocaml
rz has joined #ocaml
ebzzry has quit [Remote host closed the connection]
ebzzry has joined #ocaml
AltGr has left #ocaml [#ocaml]
ebzzry has quit [Remote host closed the connection]
ebzzry has joined #ocaml
bobry has quit [Quit: Connection closed for inactivity]
zozozo has joined #ocaml
divyanshu has joined #ocaml
<whitequark>
sjbx: the author of OUnit broke the exit result for OUnit.run_test_tt_main in OUnit2
rand000 has joined #ocaml
<sjbx>
whitequark: ok, by 'broke' you mean it was a deliberate, active decision. Or that it looks like a mistake?
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
<ggole>
Oh, if only software breaking could be assumed to be a deliberate decision -_-
racycle_ has quit [Ping timeout: 265 seconds]
<whitequark>
sjbx: it's a mistake obviously
ontologiae has quit [Ping timeout: 255 seconds]
<whitequark>
since ounit is not even on github, I didn't bother reporting that. you may want to.
<Drup>
it makes more sense, to understand what I can apply on what
<whitequark>
yep, that's the way
<Drup>
whitequark: I still think the types in the ocaml api should reflect this hierarchy
<Drup>
well, I will stop ranting about it and just propose a patch at some point
<whitequark>
yep
<Drup>
(not immediately, though)
tane has quit [Read error: Connection reset by peer]
tane has joined #ocaml
zpe has joined #ocaml
jwatzman|work has joined #ocaml
<whitequark>
hm, I want an Lwt_lazy.t
<whitequark>
that seems pretty tough to implement
<companion_cube>
what do you mean?
zpe has quit [Ping timeout: 252 seconds]
<companion_cube>
'a Lwt.t lazy_t ?
<whitequark>
well, why is lazy special syntax in OCaml? to make pattern matching on it possible
<whitequark>
obviously, no
<companion_cube>
it's special for 1/ pattern matching 2/ thunk creation
<whitequark>
yes. I can create thunks manually, no big deal
<whitequark>
val make : (unit -> 'a Lwt.t) -> 'a Lwt_lazy.t
<whitequark>
but pattern matching is tough
<whitequark>
I couldn't think of an extension that would work, so far
<Drup>
there is also the gc trick.
<whitequark>
like, what would you rewrite match foo with [%lwt_lazy x] -> x to?
<whitequark>
or not even that
racycle_ has joined #ocaml
<whitequark>
like, what would you rewrite match foo with [%lwt_lazy (`A x)] -> x to?
ocp has joined #ocaml
<Drup>
match foo with __thingy -> let `A x = Lwt_lazy.force __thingy in x
tane has quit [Quit: Verlassend]
<companion_cube>
Lazy.force y >>= function `A x -> x
<whitequark>
now what if foo is an unforced `B ?
<Drup>
whitequark: it wouldn't typecheck ?
<companion_cube>
you'd have other cases
<whitequark>
companion_cube: you must go to the next branch of the "match foo"
<whitequark>
but you've already committed to this branch
<companion_cube>
whitequark: you need to process all the pattern branches at once I guess
<whitequark>
well
<smondet>
whitequark: `lazy` is also a special case of thing you can put on the right side of a `let rec x = ...`
<companion_cube>
same as for (lazy _) patterns
<whitequark>
I don't know how
<whitequark>
I clearly need a guard, so something like
<Drup>
I don't understand the issue
<Drup>
I mean
jwatzman|work has quit [Quit: jwatzman|work]
<Drup>
just force then pattern match
<whitequark>
Drup: but I don't want to force in this case: match bar with BarInline x -> x | BarLazy [%lwt_lazy x] -> x
<whitequark>
it would just make matching on lazy useless
<whitequark>
(imagine trying to dissect an infinite stream at some point x, for example, to see what's wrong)
maattdd has joined #ocaml
<Drup>
ok, I see, that's not the real issue here
<whitequark>
I wonder about this: match foo with { cell = Value (`A x) } -> x | { cell = Thunk _ } as th when (match Lwt_lazy.force th with `A x -> true | _ -> false) -> match Lazy.force th with `A x -> (code) | _ -> assert false
<whitequark>
that looks like it could work
<Drup>
whitequark: you are just trying to reimplement the prefix tree construction done in the compiler
<whitequark>
yep
<Drup>
then, you can look at the paper describing it.
jwatzman|work has joined #ocaml
<companion_cube>
it's not really necessary to do the full prefix tree
<whitequark>
what companion_cube says
<Drup>
yeah, but it's the same
<companion_cube>
the problem is how to gather all [%lwt_lazy] patterns
<whitequark>
hm
<Drup>
(btw, my opinion is that this syntax extension wouldn't really be useful)
<companion_cube>
and then, transform into | (lazy x) -> x >>= function (all lwt patterns here)
<Drup>
(just use unit functions, you can't reproduce the gc trick anyway)
<companion_cube>
I agree that lazy Lwt values sound weird
<whitequark>
Drup: what gc trick?
rand000 has joined #ocaml
<Drup>
whitequark: when a lazy value is forced, the gc silently replace the value to avoid the indirection for next access
<whitequark>
Drup: I don't care about that
<Drup>
well, that's the only point of lazy values
<whitequark>
wat?
<Drup>
except that, they are strictly less good than unit functions
<whitequark>
what I don't like about unit functions is that you can't pattern-match on them
<Drup>
do you really pattern match on lazy value all that often ?
<whitequark>
in fact I want general facilities for extending the pattern matching, it's not just for Lwt_lazy.t
<Drup>
oh
<whitequark>
stuff like pattern-matching an Unicode string
<Drup>
that's another question
<whitequark>
well, I do want Lwt_lazy.t as well
<Drup>
that's easier, you don't have to deal with the prefix thingy
<companion_cube>
whitequark: match x with {|stringpattern|} -> ... ?
maattdd has quit [Ping timeout: 265 seconds]
<whitequark>
companion_cube: syntax doesn't matter, the issue is matching on values of abstract type
<Drup>
whitequark: did you take a look at sedlex ?
<whitequark>
Drup: I even sent a PR to it, what about it?
<Drup>
my understanding is that it did stuff like that
<Drup>
whitequark: why are the name of Opcode.t not the same than the name of the classes ? :(
<whitequark>
not really, it takes the regular match statement and replaces it with something else whatever
<chris2>
anyone use tuareg with |>?
<whitequark>
Drup: like where?
<Drup>
whitequark: like everywher ?
<whitequark>
chris2: you're here too?!
<chris2>
i'm everywhere :P
<companion_cube>
oh, ppx_bitstring will exist too I guess
<whitequark>
ppx_bitstring is similarly simple
<whitequark>
it doesn't *extend* the match construct, it replaces it
<whitequark>
I want to extend
<Drup>
whitequark: I think you just want to replace some subpart of the tree, in practice
<Drup>
we could implement a little something the "prefixises" the tree according to an extension
<whitequark>
that was the idea
<companion_cube>
Drup: there's an issue though
<companion_cube>
match x with | [%lwt_lazy 1] -> 1 | _ when yolo -> 2 | [%lwt_lazy 3] -> 3 | ....
<whitequark>
Drup: also re GC trick: I could probably do it with a little magic
rb__ has quit [Quit: Leaving]
<companion_cube>
here you can't merge the two lwt_lazy cases because there's a guard in between them
<Drup>
companion_cube: that's the issue, you quickly get into corner cases that are handled by the prefix tree construction of ocaml
<companion_cube>
yes yes
<Drup>
which is something I wouldn't like to do
<companion_cube>
because to know whether the first case matches, you need to wait on an Lwt value
<companion_cube>
unless... you do match x with (lazy l1) -> l1 >>= (function 1 -> 1 | _ when yolo -> 2 | 3 -> 3 | ....)
<Drup>
whitequark: anyway, with the syntax extension, it doesn't matter how it's implemented
<whitequark>
although I don't really need it all that badly
<whitequark>
the solution seems worse than my immediate problem
<Drup>
it probably is
<companion_cube>
what I don't get is the lazy part
<companion_cube>
why do you need it?
<whitequark>
why do I need lazy lwt values?
<whitequark>
or pattern matching on them?
<companion_cube>
lazy lwt values
<Drup>
in the long run, such helper library for ppx might be interesting
<companion_cube>
I mean, it implies starting side effects depending on evaluation of a thunk
<companion_cube>
so impredictible
<whitequark>
oh, well, in my case it's backed by a persistent data structure
<whitequark>
so no side effects possible
<whitequark>
except when the network interaction fails, so maybe you're right too, after all
<Drup>
whitequark: it's to make the DB access on demand with the binding ?
<whitequark>
not really
<Drup>
ok, no relation to lmdb ? :p
<whitequark>
no relation. I have a DAG stored at the server, where each node can be retrieved by its hash
<whitequark>
so basically I want to traverse this DAG, which is obviously immutable from its definition, but without downloading all parts of it prior to traversing
<whitequark>
download them on-demand
<whitequark>
say I have a path /foo/bar/baz.txt. first I force the root directory. find the entry for "foo". force it. find the entry for "bar". etc
<Drup>
whitequark: instead of having a lazy like interface
<whitequark>
Drup: lmdb would cache parts of that DAG (and precomputed info like file chunk hashes) locally
<eikke__>
you can construct a DSL to achieve that :)
<Drup>
wouldn't be possible to have some tweak in lwt's scheduler that will make not execute some stuff unless absolutly needed ?
<whitequark>
eikke__: that's what we've been discussing...
<whitequark>
Drup: wat?
<eikke__>
whitequark: Simon Marlow had a talk at ZuriHac last year about his (Haskell) work at Facebook which is somewhat related, IIRC
<whitequark>
no, Lwt starts executing threads until something inside blocks. that's a core part of lwt and basically everything depends on it
<Drup>
whitequark: you could implement special values that behave slightly differently, but yeah, I suppose it's not a good idea