ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.1 announcement at http://ocaml.org/releases/4.02.html | Public channel logs at http://irclog.whitequark.org/ocaml
artw has joined #ocaml
AltGr has joined #ocaml
mgzk has joined #ocaml
Yoric has quit [Remote host closed the connection]
oriba has joined #ocaml
ontologiae_ has quit [Ping timeout: 258 seconds]
Thooms has quit [Quit: WeeChat 1.0.1]
rgrinberg has joined #ocaml
<struktured> Leonidas: heres one quick and dirty function for it.."let take_up_to n l = LazyList.take_while (let cnt = ref 0 in fun _ -> if (!cnt) >= n then false else (cnt := !cnt + 1;true)) l"
yomimono has quit [Ping timeout: 250 seconds]
<Leonidas> struktured: thanks, I'm wondering if this is a bug or I am misunderstanding something.
oriba has quit [Quit: Verlassend]
<struktured> Leonidas: has to be misunderstanding...I'm assuming they want you you to use peek, or implicit approaches like fold, map, etc.
<Leonidas> struktured: no, I have a (possibly) infinite sequence and want to take n elements from it, if available.
<Leonidas> which is pretty much what Batteries' docs for take say.
<struktured> Leonidas: disclaimer- never used batteries, but is this at all helpful? http://batteries.forge.ocamlcore.org/doc.preview:batteries-alpha3/html/api/LazyList.Exceptionless.html
Arsenik has quit [Remote host closed the connection]
<struktured> Leonidas: eh it says "alpha3" not a great sign. but yeah, there are some exceptionless ways to play with the list, I suggest using those over take, or as a guard before taking.
<Leonidas> struktured: thanks for the effort but no. I'll probably either take your approach with the ref or open a bug.
thomasga has quit [Quit: Leaving.]
<struktured> Leonidas: and theres always containers, if you want to dump batteries (/shamelessplug)
Puffin has joined #ocaml
<Leonidas> I know containers, but I use a number of other things from batteries and don't really want to mix
<struktured> Leonidas: got it, good luck sir!
<Leonidas> (though the BatEnum.t and list duality is kinda annoying already)
<Leonidas> struktured: thanks! :-)
rgrinberg has quit [Quit: Leaving.]
joncfoo has quit [Ping timeout: 250 seconds]
madroach has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
kakadu has quit [Remote host closed the connection]
mgzk has quit [Ping timeout: 250 seconds]
nojb has quit [Quit: nojb]
badon has quit [Quit: Leaving]
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
seangrove has joined #ocaml
yomimono has joined #ocaml
hugomg has quit [Ping timeout: 255 seconds]
HrafnA has quit [Quit: HrafnA]
shinnya has quit [Ping timeout: 250 seconds]
struktured has quit [Quit: Konversation terminated!]
struktured has joined #ocaml
srcerer has quit [Ping timeout: 265 seconds]
srcerer has joined #ocaml
srcerer has quit [Client Quit]
srcerer has joined #ocaml
waneck has quit [Ping timeout: 240 seconds]
waneck has joined #ocaml
rgrinberg has joined #ocaml
seangrove has quit [Ping timeout: 244 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
manud has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
yomimono has quit [Ping timeout: 244 seconds]
Puffin has quit [Ping timeout: 244 seconds]
MrScout_ has joined #ocaml
MrScout has quit [Ping timeout: 240 seconds]
MrScout_ has quit [Ping timeout: 258 seconds]
ontologiae_ has joined #ocaml
manud has quit [Quit: Be back later ...]
badkins has joined #ocaml
ygrek has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
rgrinberg has quit [Quit: Leaving.]
manud has joined #ocaml
emery has joined #ocaml
q66 has quit [Quit: Leaving]
badkins has quit []
bytbox has quit [Remote host closed the connection]
bytbox has joined #ocaml
ontologiae_ has quit [Ping timeout: 250 seconds]
waneck_ has joined #ocaml
waneck has quit [Ping timeout: 256 seconds]
nojb has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
rgrinberg has joined #ocaml
darkf has joined #ocaml
nullcat has joined #ocaml
travisbrady has joined #ocaml
<nullcat> hi, anyone has idea on how to compile this program? https://github.com/janestreet/rpc_parallel/blob/master/examples/stress_test.ml
<nullcat> i am trying to use corebuild and have already done 'opam install rpc_parallel'
<nullcat> i compiled it using $corebuild stress_test.native -pkg async,rpc_parallel
<rgrinberg> nullcat: what error do you get?
<nullcat> Error: No implementations provided for the following modules:
<nullcat> Rpc_parallel referenced from stress_test.cmx
<rgrinberg> hmm you shouldn't need to specify async anyway I don't think.
<rgrinberg> regardless, does it work when you try it from oasis: https://github.com/janestreet/rpc_parallel/blob/master/_oasis#L96
<nullcat> let me check
waneck_ has quit [Read error: Connection reset by peer]
dmiles has joined #ocaml
dmiles_afk has quit [Ping timeout: 244 seconds]
<nullcat> ocaml setup.ml -test; ocaml setup.ml -build all work
<nullcat> and not specifying async does not change anything
<nullcat> and... how can test that specific part 'Executable street_test' directly using oasis?
<rgrinberg> ocaml setup.ml -all should build it
<nullcat> ocaml setup.ml -all shows the following
<nullcat> W: Cannot find source file matching module 'rpc_parallel' in library rpc_parallel
<nullcat> W: Cannot find source file matching module 'rpc_parallel_core' in library rpc_parallel_core
<rgrinberg> those are just warnings
<nullcat> ok..
<nullcat> ah, actually i did 'corebuild stress_test.native -pkg async,rpc_parallel.core' at first
<nullcat> when i do: 'corebuild stress_test.native -pkg async,rpc_parallel'
waneck_ has joined #ocaml
<nullcat> error msg is this: "ocamlfind: Package `rpc_parallel_core' not found - required by `rpc_parallel'"
<rgrinberg> ocamlfind list | grep -i rpc_parallel
<rgrinberg> to see what you actually have
<rgrinberg> rpc_parallel_core is likely not to be a findlib name
manud has quit [Quit: Lingo: www.lingoirc.com]
<nullcat> rpc_parallel (version: 112.01.00)
<nullcat> rpc_parallel.core (version: 112.01.00)
<nullcat> i typed -pkg async,rpc_parallel.core
nojb has quit [Quit: nojb]
<rgrinberg> that's a typo
<rgrinberg> *sigh*
<rgrinberg> please open a bug
<rgrinberg> fix that typo and reinstall
<rgrinberg> and it should work
<rgrinberg> surprised ocamlfind doesn't check existence before installing
<nullcat> opened the issue
<nullcat> ok now it compiled...
<nullcat> rgrinberg: thanks a lot. still having two finals left...
* nullcat going to prepare finals
<rgrinberg> good luck!
<struktured> I feel old
nullcat has quit [Quit: Textual IRC Client: www.textualapp.com]
joncfoo has joined #ocaml
rgrinberg1 has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
ivan\ has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
stux has quit [Ping timeout: 258 seconds]
kandu has quit [Ping timeout: 258 seconds]
kandu has joined #ocaml
kandu is now known as Guest53665
kerneis_ has quit [Ping timeout: 258 seconds]
kerneis_ has joined #ocaml
stux has joined #ocaml
seliopou has quit [Ping timeout: 258 seconds]
ivan\ has joined #ocaml
kapil__ has joined #ocaml
hbar has quit [Ping timeout: 258 seconds]
seliopou has joined #ocaml
travisbrady has quit [Quit: travisbrady]
demonimin has quit [Ping timeout: 264 seconds]
ivan\ has quit [Client Quit]
samrat has joined #ocaml
<joncfoo> when I pattern match with | a::b::c -> ... ocaml treats 'c' as the remainder of the list - how does it infer that?
<joncfoo> or is that just the syntax for matching the 'rest of the list'
<whitequark> it is
ivan\ has joined #ocaml
<whitequark> think of it this way: a::(b::(c::(d::(e))))
ggole has joined #ocaml
<joncfoo> ah that helps!
Guest53665 is now known as kandu
<joncfoo> left::right meaans left=head, right=tail
<joncfoo> thanks that helps!
Yoric has joined #ocaml
lostman_ has quit [Quit: Connection closed for inactivity]
samrat has quit [Quit: Computer has gone to sleep.]
ygrek has quit [Ping timeout: 255 seconds]
Yoric has quit [Remote host closed the connection]
<struktured> whitequark: any hints here, as to why this is barfing now? https://travis-ci.org/ocaml/opam-repository/jobs/44293665#L757
pyon-gadt is now known as pyon
joncfoo has quit [Ping timeout: 256 seconds]
MercurialAlchemi has joined #ocaml
chambart has joined #ocaml
samrat has joined #ocaml
rgrinberg1 has quit [Quit: Leaving.]
AlexRussia has quit [Ping timeout: 255 seconds]
<whitequark> opam 1.1
seangrove has joined #ocaml
<whitequark> (also, ugh, omake)
ygrek has joined #ocaml
rgrinberg has joined #ocaml
pgas` has quit [Changing host]
pgas` has joined #ocaml
pgas` is now known as pgas
<struktured> whitequark: yeah sorry I copied an older version of a file. oops
AlexRussia has joined #ocaml
xiaolin has joined #ocaml
jao has quit [Ping timeout: 244 seconds]
bezirg has joined #ocaml
hbar has joined #ocaml
bezirg has quit [Quit: Leaving.]
arj has joined #ocaml
bezirg has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
bezirg has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
matason has joined #ocaml
keen___________3 has joined #ocaml
keen___________2 has quit [Ping timeout: 250 seconds]
<whitequark> companion_cube: request: CCHashtbl.map_list
matason has quit [Read error: Connection reset by peer]
matason has joined #ocaml
_5kg has quit [Ping timeout: 258 seconds]
seliopou has quit [Ping timeout: 258 seconds]
Yoric has joined #ocaml
pgas has quit [Ping timeout: 258 seconds]
seliopou has joined #ocaml
_5kg has joined #ocaml
Yoric has quit [Ping timeout: 264 seconds]
Remyzorg has quit [Ping timeout: 258 seconds]
Remyzorg has joined #ocaml
jonludlam has quit [Quit: Coyote finally caught me]
<companion_cube> whitequark: signature?
<whitequark> ('a -> 'b -> 'c) -> ('a, 'b) Hashtbl.t -> 'c list
<companion_cube> fun f h -> CCHashtbl.to_seq h |> Sequence.map CCFun.(uncurry f) |> Sequence.to_list;;
igstan has joined #ocaml
<whitequark> well yes exactly
<whitequark> I don't want to write that
<companion_cube> :D
<companion_cube> it looks quite specific. Can't you write the function at the top of your file?
<whitequark> well, of course. but it's something I needed many times
<companion_cube> hmm, interesting
<companion_cube> why not then
mads_hartmann has joined #ocaml
igstan has quit [Client Quit]
AlexRussia has quit [Quit: WeeChat 1.1-dev]
<companion_cube> do you also need filter_list?
dts|pokeball has joined #ocaml
<dts|pokeball> do you guys have an eval bot?
<companion_cube> there used to be one, I think, but no more
<flux> Xavierbot exists, but for reasons unclear it is not anymore with us
<companion_cube> there are webpages with evaluators though
<dts|pokeball> someone in #learnprogramming wanted one
<flux> the bot would probably need to be updated before it works with modern ocaml and is relatively safe again
<dts|pokeball> oh. never mind then
<flux> and in fact, I recall someone wrote another bot that used a web evaluator
dts|pokeball has left #ocaml ["Leaving"]
<companion_cube> rha, rgrinberg not here
<whitequark> companion_cube: filter_list?..
<whitequark> how would that work?
<whitequark> is it like returning Some x or None ?
<companion_cube> ('a -> 'b -> 'c option) -> ('a,'b) Hashtbl.t -> 'c list
<companion_cube> I guess
<companion_cube> well that can wait.
<companion_cube> I plan to release a major version before the end of the week, with the new split into sub-libraries
<whitequark> that can wait indeed, it's trivial to write with CCList
<whitequark> ... I hope
<whitequark> also I don't recall needing it much
<companion_cube> it's in CCList, sure
Yoric has joined #ocaml
_5kg has quit [Ping timeout: 244 seconds]
nicoo has quit [Remote host closed the connection]
NoNNaN has quit [Remote host closed the connection]
nicoo has joined #ocaml
NoNNaN has joined #ocaml
kakadu has joined #ocaml
ocp has joined #ocaml
_5kg has joined #ocaml
dav_ has joined #ocaml
dav has quit [Ping timeout: 255 seconds]
thomasga has joined #ocaml
arj has quit [Ping timeout: 256 seconds]
ingsoc has joined #ocaml
bezirg has joined #ocaml
arj has joined #ocaml
axiles has quit [Quit: Quitte]
arj has quit [Ping timeout: 245 seconds]
lordkryss has joined #ocaml
ollehar has joined #ocaml
arj has joined #ocaml
nojb has joined #ocaml
Simn has joined #ocaml
Yoric has quit [Remote host closed the connection]
_andre has joined #ocaml
nojb has quit [Quit: nojb]
<companion_cube> what is the simplest way to link with ctypes? The tutorial is cool for writing functions, but it doesn't say much about linking
<whitequark> After_rules -> flag ["ocaml"; "link"] A("-l"^
<whitequark> After_rules -> flag ["ocaml"; "link"; "use_yourlib"] S[A"-cclib"; A"-lyourlib"];
<whitequark> this, essentially
<whitequark> for cstubs, sodium has an example: https://github.com/dsheets/ocaml-sodium/blob/master/myocamlbuild.ml
<companion_cube> awwwwwww
<companion_cube> wait, I'm using oasis
<companion_cube> I tried using the CCLib field
<whitequark> CCLib should work
jonludlam has joined #ocaml
<companion_cube> is this for linking dynamically?
<whitequark> yes
<companion_cube> everything works fine until I use the stub
<whitequark> oh, so do you want cstubs or ctypes?
<companion_cube> I mean the ocaml function that uses Ctypes to interface with C, sorry
<whitequark> and what happens then?
<companion_cube> Fatal error: exception Dl.DL_error("./truc: undefined symbol: qdpll_delete")
<whitequark> byte or native executable?
<companion_cube> native
<whitequark> ldd ./truc
<companion_cube> strace tells me it doesn't even link the .so
* whitequark shrugs
<whitequark> throw oasis out the window
<companion_cube> the library doesn indicate: Extra C object files: -lqdpll
<companion_cube> does*
<whitequark> gasche: wow, that was quick
nojb has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
bezirg has quit [Remote host closed the connection]
<companion_cube> hmm, I need a .clib file?
thomasga has quit [Quit: Leaving.]
nojb has quit [Quit: nojb]
kakadu has quit [Remote host closed the connection]
bezirg has joined #ocaml
thomasga has joined #ocaml
ontologiae_ has joined #ocaml
chambart has quit [Ping timeout: 272 seconds]
samrat has quit [Quit: Computer has gone to sleep.]
samrat has joined #ocaml
samrat has quit [Client Quit]
avsm has joined #ocaml
dav has joined #ocaml
Dzyan has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 245 seconds]
dav_ has quit [Ping timeout: 265 seconds]
mort___ has joined #ocaml
thomasga has quit [Quit: Leaving.]
nojb has joined #ocaml
arj has quit [Ping timeout: 256 seconds]
nojb has quit [Quit: nojb]
nojb has joined #ocaml
thomasga has joined #ocaml
kakadu has joined #ocaml
_andre has quit [Read error: Connection reset by peer]
samrat has joined #ocaml
_andre has joined #ocaml
<mads_hartmann> 11:32 <whitequark> yes
<mads_hartmann> misclick - sorry
matason has quit [Quit: leaving]
nojb has quit [Quit: nojb]
matason has joined #ocaml
thomasga has quit [Quit: Leaving.]
samrat has quit [Quit: Computer has gone to sleep.]
arj has joined #ocaml
thomasga has joined #ocaml
chambart has joined #ocaml
arj has quit [Ping timeout: 250 seconds]
rand000 has joined #ocaml
arj has joined #ocaml
thomasga has quit [Quit: Leaving.]
arj has quit [Ping timeout: 255 seconds]
nojb has joined #ocaml
nojb has quit [Client Quit]
hugomg has joined #ocaml
Hannibal_Smith has joined #ocaml
dav has quit [Ping timeout: 250 seconds]
dav has joined #ocaml
dav has quit [Changing host]
dav has joined #ocaml
arj has joined #ocaml
matason has quit [Quit: leaving]
matason has joined #ocaml
mads_hartmann has quit [Ping timeout: 250 seconds]
_5kg has quit [Ping timeout: 245 seconds]
BitPuffin has joined #ocaml
engil1 is now known as engil
_5kg has joined #ocaml
_5kg has quit [Ping timeout: 245 seconds]
thomasga has joined #ocaml
bezirg has quit [Ping timeout: 245 seconds]
lu324__ has quit [Ping timeout: 272 seconds]
lostman_ has joined #ocaml
ingsoc has quit [Ping timeout: 258 seconds]
lu324___ has joined #ocaml
Yoric has joined #ocaml
thomasga has quit [Quit: Leaving.]
AltGr has left #ocaml [#ocaml]
badkins has joined #ocaml
joncfoo has joined #ocaml
_andre has quit [Ping timeout: 245 seconds]
eyyub has joined #ocaml
ingsoc has joined #ocaml
Yoric has quit [Remote host closed the connection]
contempt has quit [Remote host closed the connection]
_5kg has joined #ocaml
contempt has joined #ocaml
bezirg has joined #ocaml
Yoric has joined #ocaml
_andre has joined #ocaml
nojb has joined #ocaml
thomasga has joined #ocaml
Yoric has quit [Remote host closed the connection]
axiles has joined #ocaml
myyst has quit [Read error: No route to host]
myyst has joined #ocaml
<Drup> nojb: is the incremental parser already in menhir, or will be next version ?
<nojb> already
_andre has quit [Ping timeout: 245 seconds]
Ptishell has quit [Ping timeout: 264 seconds]
Yoric has joined #ocaml
chambart has quit [Ping timeout: 250 seconds]
_andre has joined #ocaml
_andre has quit [Client Quit]
_andre has joined #ocaml
travisbrady has joined #ocaml
_andre has quit [Client Quit]
_andre has joined #ocaml
thomasga has quit [Quit: Leaving.]
Yoric has quit [Remote host closed the connection]
thomasga has joined #ocaml
davine has joined #ocaml
davine has left #ocaml [#ocaml]
Anarchos has joined #ocaml
Yoric has joined #ocaml
nojb has quit [Quit: nojb]
Thooms has joined #ocaml
maurer has quit [Ping timeout: 245 seconds]
maurer has joined #ocaml
<hugomg> Is there a way in Ocaml to write an "early return" statement without using if-then-else and indenting the whole rest of the function?
<adrien> definitely!
<adrien> exceptions :D
<Drup> exit too
<Drup> it returns.
<mrvn> quite deeply
<whitequark> you can also segfault
<whitequark> or system("halt -p")
<mrvn> whitequark: only with extern or Qobj
<mrvn> Obj
<Drup> I would even say that it returns definitely :D
<whitequark> mrvn: or you can allocate all memory!
<mrvn> Drup: the ultimate return
<whitequark> mrvn: or you can mmap a Bigarray and truncate it!
<mrvn> whitequark: does the GC then segfault or throw an exception?
<ggole> Plenty of ways to segfault without extern or Obj
<whitequark> (although that would be SIGBUS)
<mrvn> whitequark: see, not segfault
maurer has quit [Ping timeout: 258 seconds]
<whitequark> mrvn: that would still exit
<whitequark> or you can send SIGSEGV to yourself.
<whitequark> it's still technically a segfault.
<mrvn> whitequark: now that is cheating. :)
<whitequark> it's a defined API!
<Drup> give a 1 tuple to the compiler
<hugomg> The thing that worries me about exceptions is that I don't want to swallow other exceptions by accident or propagate any exceptions out of my function. Do I create a custom exception type for every function I want to use an "early reutrn" pattern on?
maurer has joined #ocaml
<Drup> it will returns very early.
<Drup> (okay, it was fixed)
<mrvn> Drup: like ref 1?
<hugomg> also, how efficient are exceptions in Ocaml? We are talking about replacing an if statement here :)
<Drup> mrvn: no no, a 1 tuple, really
<Drup> (you need a ppx)
<ggole> hugomg: they're fastish
<mrvn> hugomg: don't do it to avoid an if. You do it to e.g. escape an List.fold_left early.
<ggole> I'd just live with the if.
<hugomg> but my function gets ugly if I indent it too much :/
<mrvn> hugomg: if the indentation becomes too much consider splitting the function
<ggole> If you find yourself indenting a lot, you probably need to break some parts out
chambart has joined #ocaml
<mrvn> hugomg: if foo then 42 else rest_of_function ()
<mrvn> Although that has the drawback of making the code flow kind of backwards. rest_of_function has to be declared first.
<whitequark> hugomg: exceptions are equivalent to a longjmp, essentially
<whitequark> it's like a dozen instructions.
<MercurialAlchemi> It's quite easy to create custom exceptions
shinnya has joined #ocaml
<mrvn> whitequark: aren't they a constructor + simple function call?
<MercurialAlchemi> Unfortunately, it's just as easy to forget to catch them
AlexRussia has joined #ocaml
AlexRussia has quit [Changing host]
AlexRussia has joined #ocaml
<mrvn> hugomg: batteries and core afaik both have constructs for early returns that internally use exceptions for you.
<whitequark> mrvn: I was talking about the insides of raise
<hugomg> mrvn: yeah, I'm not a big fan of splitting functions for presentation/length purposes and I also don'tlike the backwards flow much... but I think I can live with it
<hugomg> what constructins in batteries/core are you talking about? never heard of them
<MercurialAlchemi> Core has also Option/Result monadic approaches to this issue
<hugomg> the monadic version still fights against ocp-indent though, unless you use one of those do-notation syntax extensions
<hugomg> I had some code that I kep needing to go back and reindent by hand whenever I accidentally told vim to indent the whole file :)
<MercurialAlchemi> :)
fraggle_laptop has joined #ocaml
<Drup> MercurialAlchemi: I don't understand the remark about "/projects/$id_of_type_A_project/foo/$foo_i" and I feel like a indirect reddit discussion will not be sufficient so, explain please.
thomasga has quit [Quit: Leaving.]
<MercurialAlchemi> Drup: :)
bezirg has quit [Ping timeout: 255 seconds]
bezirg has joined #ocaml
<MercurialAlchemi> Drup: I was wondering how you'd do something like Jersey with this system
thomasga has joined #ocaml
<Drup> what's jersey ? it's not exactly googlable :p
<MercurialAlchemi> Drup: https://jersey.java.net/
<MercurialAlchemi> mostly, it's about nested resources
<MercurialAlchemi> a resource class (eg, ProjectResource) knows how to find a project in a database, and return nested resources
samrat has joined #ocaml
<MercurialAlchemi> it makes it easy to plug the same resource at multiple endpoints, which sometimes makes sense
avsm has quit [Quit: Leaving.]
<Drup> Can you gives me a croncrete example ?
avsm has joined #ocaml
<MercurialAlchemi> Drup: in a moment, I need to wrap up a CR
<Drup> because to me, this whole thing is still static. Annoying to define and could be helped by a deriver, but static
joncfoo has quit [Ping timeout: 240 seconds]
<MercurialAlchemi> hm
<MercurialAlchemi> I think you're right, framing it in terms of dynamic vs static was a mistake
<MercurialAlchemi> the thing is, a resource acts both as a parser (in the sense that it consumes part of the path) and as a non-final handler (since it performs a side effect by retrieving data in the DB and creating a child resource with this data)
<Drup> that's one way to look at it
<MercurialAlchemi> with some more code, it could also let you do something like Django's mountable apps
<Drup> the other way is just that the path is the same and the handler is (fun v k = let v' get_from_database v in get_value v' k)
darkf has quit [Quit: Leaving]
samrat has quit [Quit: Computer has gone to sleep.]
axiles has quit [Quit: Quitte]
<MercurialAlchemi> well, the advantage with the path-consuming thing is that the resource knows what it can answer to, but it is blissfully unaware of wherever it is plugged to
<MercurialAlchemi> as opposed to a global routing table for the whole app
<Drup> why is that an advantage ?
<Drup> you could also say that you have global routing and only ask the resource about what it could know, it would still not know about the rest
<MercurialAlchemi> yes, but if you want to, say, offer the same sub-hierarchy from two endpoints, you end up duplicating your routes
lordkryss has quit [Quit: Connection closed for inactivity]
<MercurialAlchemi> and no pluggable apps for you
mcclurmc has joined #ocaml
<MercurialAlchemi> (I found them a really good idea, back when I was doing a bit of Django)
<Drup> I think I would need to try for real
<Drup> the way you talk about it is a bit too "hands in the air" for me to really get the point of it
Thooms has quit [Quit: WeeChat 1.0.1]
samrat has joined #ocaml
<MercurialAlchemi> I'll try to make an example in a pastebin and link it on reddit
ocp has quit [Ping timeout: 250 seconds]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
bezirg has quit [Quit: Leaving.]
travisbrady has quit [Quit: travisbrady]
arj has quit [Quit: Leaving.]
struktured has quit [Ping timeout: 258 seconds]
mcclurmc has joined #ocaml
nojb has joined #ocaml
kapil__ has quit [Quit: Connection closed for inactivity]
HrafnA has joined #ocaml
<MercurialAlchemi> Drup: actually, I think this should be accessible: http://docs.pylonsproject.org/docs/pyramid/en/latest/narr/muchadoabouttraversal.html - look in particular at 'URL dispatch', 'Traversal' and 'Use Cases'
<MercurialAlchemi> It has a bit of Pyramid-specific jargon, but nothing terrible
axiles has joined #ocaml
thomasga has quit [Ping timeout: 265 seconds]
badkins has quit [Read error: Connection reset by peer]
<Drup> MercurialAlchemi: ok, read
<Drup> 1) The way it's done in this framework sounds extremely duck-type-y (as expected from python). Especially the "view lookup" part
<Drup> 2) you can encode that in url matching by providing a "suffix list" combinator, and it will be quite trivial.
<Drup> 3) It seems quite useless most of the time :p
tane has joined #ocaml
travisbrady has joined #ocaml
travisbrady has quit [Client Quit]
WraithM has joined #ocaml
rgrinberg has joined #ocaml
mort___ has quit [Ping timeout: 265 seconds]
avsm has quit [Quit: Leaving.]
arj has joined #ocaml
badkins has joined #ocaml
badkins has quit [Client Quit]
thomasga has joined #ocaml
ontologiae_ has quit [Quit: WeeChat 1.0]
ontologiae has joined #ocaml
arj has quit [Quit: Leaving.]
ollehar has quit [Ping timeout: 265 seconds]
fraggle_laptop has quit [Ping timeout: 265 seconds]
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
<Drup> rgrinberg: you are not ready for multi-lingual conversation :D
Yoric has quit [Ping timeout: 258 seconds]
ygrek has joined #ocaml
travisbrady has joined #ocaml
thomasga has quit [Quit: Leaving.]
tharugrim has quit [Ping timeout: 240 seconds]
thomasga has joined #ocaml
tharugrim has joined #ocaml
<rgrinberg> :D
<rgrinberg> so what about this regex compat thing?
<Drup> I think we can drop backward references and other silly things like that, as long as, on the set of feature that we keep, the syntax is the same
<mrvn> Anyone using menhir with oasis?
<Drup> mrvn: yeah
<mrvn> what do I put into the _oasis file?
<Drup> nothing
<Drup> you put "true: use_menhir, explain" in the _tags
q66 has joined #ocaml
<Drup> rgrinberg: also, on the feature we drop, we have an error message if the feature is used
<Drup> not silent spaghetti
<mrvn> Drup: thx
<mrvn> Drup: any idea how to make _tags git friendly? I don't want the generated stuff in git.
<rgrinberg> Drup: what is the regex used for again? i.e. does it even make sense for it to have capturing groups
artw has quit [Quit: Leaving]
<Drup> mrvn: use the dynamic mode and push only something like that: https://github.com/Drup/LILiS/blob/master/_tags
matason has quit [Ping timeout: 255 seconds]
<Drup> (you can drop the digest)
<Drup> for example
<Drup> so yes, you need capture group, but back reference .. probably not
jonludlam has quit [Ping timeout: 255 seconds]
rgrinberg has quit [Quit: Leaving.]
_5kg has quit [Ping timeout: 245 seconds]
kakadu has quit [Ping timeout: 246 seconds]
chambart has quit [Ping timeout: 245 seconds]
<mrvn> Drup: do you report lexing/parsing errors with line/column?
rgrinberg has joined #ocaml
MrScout has joined #ocaml
<MercurialAlchemi> Drup: forget about view lookup, that's irrelevant
<mrvn> Drup: thx
<struk|work> companion_cube: when do you plan on releasing the latest containers?
rgrinberg has quit [Quit: Leaving.]
<MercurialAlchemi> pressure, pressure
<Drup> MercurialAlchemi: do you agree on the rest ?
<Drup> ^^'
<MercurialAlchemi> I don't agree the uselessness part
<MercurialAlchemi> I think it's quite useful, especially when you have deeply nested resources
<Drup> does it happen often ?
travisbrady has quit [Quit: travisbrady]
<MercurialAlchemi> Well, I'm working on codebases where the answer is 'yes'
<Drup> ok
<MercurialAlchemi> but even if your tree isn't that deep, it's a good way to structure your code
ingsoc has quit [Quit: Leaving.]
<MercurialAlchemi> I'm not sure how your combinator idea would solve the issue, though
<Drup> basically, you would get a list of string as path
mcclurmc has quit [Remote host closed the connection]
<Drup> you would consume the head and path the rest to the deeper level
nojb has quit [Quit: nojb]
<Drup> I think I've seen that trick used in the same kind of situation as the one you are describing
nojb has joined #ocaml
<Drup> s/path/pass/ =')
<Drup> (pun not intended)
<MercurialAlchemi> mm
badkins has joined #ocaml
<Drup> basically, instead of passing along dictionaries and using the get method, you pass along the get function itself
MrScout has quit [Remote host closed the connection]
Yoric has joined #ocaml
_5kg has joined #ocaml
rand000 has quit [Ping timeout: 244 seconds]
MrScout has joined #ocaml
<MercurialAlchemi> Drup: so you'd get an interface like 'type matcher = Done | Resource of (string list -> matcher)'?
<Drup> MercurialAlchemi: http://ocsigen.org/eliom/4.1/api/server/Eliom_parameter#VALsuffix this is the combinator as how it's implemented in eliom
<Drup> and that's pretty much all of it
<Drup> now, you could do a wrapper to get you closer to this concept of traversal, but I don't think you really need
travisbrady has joined #ocaml
rgrinberg has joined #ocaml
lostman_ has quit [Quit: Connection closed for inactivity]
ygrek has quit [Ping timeout: 255 seconds]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
kakadu has joined #ocaml
yomimono has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
matason has joined #ocaml
chambart has joined #ocaml
matason has quit [Ping timeout: 245 seconds]
Arsenik has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
samrat has quit [Ping timeout: 264 seconds]
samrat has joined #ocaml
olauzon has joined #ocaml
samrat has quit [Ping timeout: 258 seconds]
samrat has joined #ocaml
slash^ has joined #ocaml
samrat has quit [Ping timeout: 245 seconds]
samrat has joined #ocaml
rgrinberg has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
<MercurialAlchemi> yeah
<MercurialAlchemi> though with the interface I have, you could do typesafe resource traversal and inject whatever you need in the child resource
<MercurialAlchemi> you'd probably want a full-blown HTTP request data structure instead of a list of strings, and return an HTTP response instead of Done, but it would work
tani has joined #ocaml
tane has quit [Killed (cameron.freenode.net (Nickname regained by services))]
tani is now known as tane
mearnsh has quit [Quit: git tae fuck]
mearnsh has joined #ocaml
samrat has quit [Ping timeout: 244 seconds]
samrat has joined #ocaml
matason has joined #ocaml
Thooms has joined #ocaml
ggole has quit []
samrat has quit [Ping timeout: 256 seconds]
<pippijn> the menhir post looks promising
<Drup> yep
slash^ has quit [Read error: Connection reset by peer]
samrat has joined #ocaml
samrat has quit [Client Quit]
<mrvn> + menhir --ocamlc '/usr/bin/ocamlfind ocamlc -g -I src' --explain --infer src/parser.mly
<mrvn> Warning: one state has shift/reduce conflicts.
<mrvn> Warning: 5 shift/reduce conflicts were arbitrarily resolved.
<mrvn> Is there a way to see which?
<pippijn> yes
<pippijn> there are a bunch of flags that help, I forgot which
<pippijn> menhir --help
<Drup> mrvn: you will find a find parser.conflicts that explains everything
<Drup> a file*
<pippijn> oh right, you already did --explain
rgrinberg1 has joined #ocaml
rgrinberg has quit [Read error: Connection reset by peer]
<Drup> always use merlin with --explain :)
<mrvn> ahh, overlooked that
tov has quit [Remote host closed the connection]
<thomasga> "Warning: the tag "tests" is not used in any flag declaration, so it will have no effect; it may be a typo. Otherwise use `mark_tag_used` in your myocamlbuild.ml to disable this warning."
<mrvn> How come ! and ~ and ?++ are prefix operators but ? alone is not?
thomasga1 has joined #ocaml
<Drup> mrvn: ~ is not either
<mrvn> right. but ! is for some reason
<Drup> probably because it was used for ref first, then the operator system was figured out after, but it was kept
<Drup> or something like that
matason has quit [Ping timeout: 250 seconds]
<mrvn> ? and ~ are listed as keywords but ! is not.
kgzm_ has quit [Quit: leaving]
thomasga1 has quit [Client Quit]
thomasga has quit [Ping timeout: 264 seconds]
thomasga has joined #ocaml
eyyub has quit [Ping timeout: 272 seconds]
Lmry2 has joined #ocaml
Lmry2 has left #ocaml [#ocaml]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
WraithM has quit [Remote host closed the connection]
badkins has quit []
davine has joined #ocaml
davine has left #ocaml [#ocaml]
rgrinberg1 has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
ontologiae has quit [Ping timeout: 256 seconds]
Arsenik has quit [Remote host closed the connection]
rand000 has joined #ocaml
jpdeplaix has joined #ocaml
matason has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
MercurialAlchemi has quit [Ping timeout: 245 seconds]
<travisbrady> Anyone have a tip on how to express the C type “void* mats[]” in a call to ocaml-ctypes’ Foreign.foreign? ptr (ptr void) ?
matason has quit [Ping timeout: 256 seconds]
oscar_toro has joined #ocaml
tane has quit [Quit: Verlassend]
dav has quit [Read error: No route to host]
<companion_cube> struk|work: probably friday
<Drup> travisbrady: yes
<travisbrady> Drup: thank you.
ingsoc has joined #ocaml
chambart has quit [Ping timeout: 264 seconds]
jao has quit [Ping timeout: 240 seconds]
chambart has joined #ocaml
<Drup> travisbrady: you will probably want to make use of the module Ctypes.CArray
yomimono has quit [Ping timeout: 245 seconds]
dav has joined #ocaml
ingsoc has quit [Quit: Leaving.]
ohama has quit [Remote host closed the connection]
WraithM has joined #ocaml
struk|work has quit [Ping timeout: 246 seconds]
nicoo has quit [Ping timeout: 250 seconds]
lordkryss has joined #ocaml
nojb has quit [Quit: nojb]
nicoo has joined #ocaml
nojb has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
chambart has quit [Ping timeout: 256 seconds]
lu324___ is now known as lu324
ohama has joined #ocaml
kakadu has quit [Remote host closed the connection]
nojb has quit [Quit: nojb]
Hannibal_Smith has quit [Read error: Connection reset by peer]
_JokerDoom has joined #ocaml