adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
foolishmonkey has quit [Quit: Leaving]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
yunxing has quit [Ping timeout: 250 seconds]
maverous has joined #ocaml
darkf has joined #ocaml
idegen has joined #ocaml
truncate has quit [Quit: WeeChat 1.3]
vishesh has joined #ocaml
Reshi has quit [Ping timeout: 246 seconds]
lobo has quit [Quit: leaving]
tropico has quit [Remote host closed the connection]
Kakadu has quit [Remote host closed the connection]
aantron has joined #ocaml
deko-pyon has quit [Ping timeout: 248 seconds]
deko-pyon has joined #ocaml
Reshi has joined #ocaml
silver has quit [Read error: Connection reset by peer]
tennix has joined #ocaml
meiji11 has joined #ocaml
tennix has quit [Ping timeout: 276 seconds]
kaustuv has joined #ocaml
yunxing has joined #ocaml
FreeBirdLjj has joined #ocaml
Algebr` has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
Reshi has quit [Ping timeout: 260 seconds]
narendasan has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wiredsister has joined #ocaml
antkong has joined #ocaml
yunxing has quit [Quit: Leaving...]
deko-pyon has quit [Ping timeout: 268 seconds]
gustav___ has quit [Ping timeout: 268 seconds]
seangrove has joined #ocaml
gustav___ has joined #ocaml
w1gz has quit [Ping timeout: 268 seconds]
tennix has joined #ocaml
w1gz has joined #ocaml
antkong has quit [Read error: Connection reset by peer]
keep_learning has joined #ocaml
antkong has joined #ocaml
pyon-kan has joined #ocaml
nicholasf has joined #ocaml
wiredsister has quit [Ping timeout: 268 seconds]
Algebr` has quit [Ping timeout: 268 seconds]
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
nicholasf has quit [Read error: Connection reset by peer]
Reshi has joined #ocaml
badon has left #ocaml ["Leaving"]
asdf12z__ has quit [Ping timeout: 250 seconds]
teknozulu has joined #ocaml
badon has joined #ocaml
cdidd has quit [Remote host closed the connection]
teknozulu_ has joined #ocaml
struk|desk|away is now known as struk|desk
teknozulu has quit [Ping timeout: 268 seconds]
pierpa` has joined #ocaml
pierpa has quit [Ping timeout: 260 seconds]
axiles has quit [Ping timeout: 260 seconds]
cdidd has joined #ocaml
asdf12z_ has joined #ocaml
<seangrove> Say I have type: string Lwt.t list, how can I concat them together? Trying to figure out a functional way of doing it.
<seangrove> Bah, nevermind, that wasn't a big deal
<seangrove> How would I write (^) for string Lwt.t?
<seangrove> string Lwt.t -> string Lwt.t -> string Lwt.t
cdidd has joined #ocaml
<copy`> t1 >>= fun s1 -> t2 >>| fun s2 -> s1 ^ s2
<copy`> There might be a function for that
MercurialAlchemi has joined #ocaml
struk|desk is now known as struk|desk|away
teknozulu has joined #ocaml
teknozulu_ has quit [Ping timeout: 268 seconds]
kaustuv has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
nicholasf has joined #ocaml
MightyJoe is now known as cyraxjoe
MercurialAlchemi has quit [Ping timeout: 248 seconds]
pierpa` is now known as pierpa
kushal has joined #ocaml
Reshi has quit [Ping timeout: 246 seconds]
antkong_ has joined #ocaml
antkong has quit [Ping timeout: 260 seconds]
antkong_ is now known as antkong
MercurialAlchemi has joined #ocaml
arquebus has joined #ocaml
arquebus has quit [Client Quit]
antkong has quit [Quit: antkong]
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
<seangrove> copy`: Ah, thanks, didn't kow about >>|
Maxow234 has joined #ocaml
<seangrove> Front page is working! http://www.riseos.com
<seangrove> Need to get a letsencrypt SSL cert going this week for it
<seangrove> And the ocaml code is so, so bad. Going to have to clean it up soon.
maverous has quit [Quit: sleep]
<flux> seangrove, "rather than liquid. I&#???;d like to change that, and bit by bit I&#???;m getting closer to".. encoding issues?-o
ygrek has joined #ocaml
hunteriam has quit [Quit: Connection closed for inactivity]
meiji11 has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 246 seconds]
aantron has quit [Remote host closed the connection]
butts_butts has joined #ocaml
Maxow234 has quit [Quit: Maxow234]
teknozulu_ has joined #ocaml
n3ss3s__ has joined #ocaml
teknozulu has quit [Ping timeout: 268 seconds]
teknozulu_ has quit [Ping timeout: 268 seconds]
kushal has quit [Quit: Leaving]
Haudegen has joined #ocaml
n3ss3s__ has quit [Ping timeout: 268 seconds]
struk|desk|away is now known as struk|desk
aantron has joined #ocaml
Simn has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
butts_butts has quit [Ping timeout: 268 seconds]
aantron has quit [Remote host closed the connection]
sgnb has joined #ocaml
Maxow234 has joined #ocaml
Shozan is now known as SHODAN
rand__ has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicholasf has quit [Remote host closed the connection]
maufred has joined #ocaml
nicoo has joined #ocaml
pierpa has quit [Ping timeout: 276 seconds]
nicholasf has joined #ocaml
_2can has quit [Remote host closed the connection]
Reshi has joined #ocaml
nicholasf has quit [Ping timeout: 250 seconds]
malc_ has joined #ocaml
nicholasf has joined #ocaml
mettekou has joined #ocaml
slicefd has joined #ocaml
Reshi has quit [Ping timeout: 276 seconds]
Kakadu has joined #ocaml
struk|desk is now known as struk|desk|away
mettekou has quit [Ping timeout: 260 seconds]
Maxow234 has quit [Read error: Connection reset by peer]
jwatzman|work has joined #ocaml
_2can has joined #ocaml
Maxow234 has joined #ocaml
kushal has joined #ocaml
Reventlov has quit [Quit: leaving]
Reshi has joined #ocaml
sz0 has quit []
sz0 has joined #ocaml
foolishmonkey has joined #ocaml
mettekou has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
Maxow234 has quit [Quit: Maxow234]
Maxow234 has joined #ocaml
kandu_ is now known as kandu
<MasseR> I remember ocaml having a tty-building library, similar to haskells vty-ui, can anyone remember its name?
<companion_cube> notty
<companion_cube> it's brand new, it's shiny, try it while it's hot!
<MasseR> thanks
malc_ has quit [Remote host closed the connection]
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
antkong has joined #ocaml
<flux> hmm, does notty make use of termcap information?
<hannes> in ancient OCaml (3.06), it seems that the parser was not thread-safe... is this still the case?
clog has quit [Ping timeout: 260 seconds]
<flux> what parser? how isn't it thread-safe?
<flux> I would certainly not expect to execute a single parser from multiple threads without exclusive locking..
<hannes> the run-time support (stdlib/parsing.ml[i])
<hannes> (just fiddling with some arcane code and trying to find out whether it is safe to get rid of or not)
<flux> so you're saying it has some globally shared state.. ?
<flux> but certainly a single parser has mutable internal state, so that's not thread safe
<hannes> yes. namely the env.. and seems to be still the case..
orbifx has joined #ocaml
<flux> it's a bit strange design decision, though there are other parser generators available as well (ie. menhir)
<flux> doesn't seem like it would be a big job to refactor Parsing to be safe to use from multiple threads, of course it would need to have a new interface
Kakadu has quit [Ping timeout: 252 seconds]
<Drup> doesn't menhir already do that ?
nicholasf has quit [Remote host closed the connection]
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
larhat has joined #ocaml
_andre has joined #ocaml
Kakadu has joined #ocaml
bobry has joined #ocaml
antkong has quit [Quit: antkong]
axiles has joined #ocaml
mettekou has joined #ocaml
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
M-Illandan has joined #ocaml
octachron has joined #ocaml
mettekou has quit [Read error: Connection reset by peer]
slicefd has quit [Quit: WeeChat 1.4]
mettekou has joined #ocaml
lordf has joined #ocaml
nicholasf has joined #ocaml
nicholasf has quit [Ping timeout: 248 seconds]
<zozozo> in ocaml 4.00.1, is it possible to have two types define a field with the same name ? or will the compiler remeber only the last one ?
<octachron> zozozo, label(fields) disambiguation was only introduced in 4.01.0
<zozozo> :p
nuuit has quit [Ping timeout: 276 seconds]
<zozozo> and that is why I don't like making my code available on older versions of ocaml, :(
cdidd has quit [Remote host closed the connection]
nuuit has joined #ocaml
<foolishmonkey> the problem is and will ever be debian
<octachron> I think having two colliding label names was an error before, but I am not sure
mettekou has quit [Read error: Connection reset by peer]
<zozozo> from what I see, the compiler only remembre the last one defined
freehck has joined #ocaml
ggole has joined #ocaml
shinnya has joined #ocaml
alexst has joined #ocaml
mettekou has joined #ocaml
alexst has quit [Ping timeout: 248 seconds]
clog has joined #ocaml
tennix has quit [Ping timeout: 248 seconds]
Kakadu has quit [Ping timeout: 252 seconds]
lpaste has quit [Ping timeout: 268 seconds]
badon has quit [Ping timeout: 260 seconds]
dhil has joined #ocaml
alexst has joined #ocaml
lpaste has joined #ocaml
thizanne has joined #ocaml
mettekou has quit [Read error: Connection reset by peer]
Haudegen has quit [Ping timeout: 250 seconds]
mettekou has joined #ocaml
lpaste has quit [Ping timeout: 268 seconds]
TheLemonMan has joined #ocaml
lpaste has joined #ocaml
alexst has quit [Ping timeout: 248 seconds]
orbifx has quit [Quit: AtomicIRC: The nuclear option.]
kushal has quit [Ping timeout: 276 seconds]
Reshi has quit [Ping timeout: 276 seconds]
mettekou has quit [Read error: Connection reset by peer]
Haudegen has joined #ocaml
foolishmonkey has quit [Quit: Leaving]
bobry has quit [Quit: Connection closed for inactivity]
pyon-kan has quit [Quit: restart]
pyon-kan has joined #ocaml
shinnya has quit [Ping timeout: 276 seconds]
mettekou has joined #ocaml
AlexRussia has quit [Ping timeout: 276 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
Reventlov has joined #ocaml
copy` has joined #ocaml
kaustuv has joined #ocaml
Reshi has joined #ocaml
mettekou has quit [Ping timeout: 268 seconds]
tennix has joined #ocaml
Reshi has quit [Ping timeout: 246 seconds]
FreeBird_ has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
FreeBird_ has joined #ocaml
freehck has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Ping timeout: 246 seconds]
FreeBird_ has quit [Ping timeout: 268 seconds]
<Leonidas> seangrove: instead of edn you could also consider sexp.
<Leonidas> Turns out throwing Lwt.t away using ignore leads to the code that is bound to it to not get executed.
<Drup> Yes, that's expected
<Drup> if you want to have it executed, but "some day", use Lwt.async
<Leonidas> Yes, now that I think about it it makes sense, because the scheduler never gets to see it. Now I am thinking on how to structure the code in a way that it does.
eeks_ has joined #ocaml
SIGILL has quit [Quit: .]
SIGILL has joined #ocaml
sh0t has joined #ocaml
musha68k has joined #ocaml
AlexRussia has joined #ocaml
freehck has joined #ocaml
sh0t has quit [Ping timeout: 248 seconds]
teknozulu has joined #ocaml
sh0t has joined #ocaml
malc_ has joined #ocaml
kushal has joined #ocaml
Reshi has joined #ocaml
ski_ is now known as ski
Reshi has quit [Ping timeout: 260 seconds]
struk|desk|away is now known as struk|desk
tane has joined #ocaml
Maxow234 has quit [Read error: No route to host]
kushal has quit [Ping timeout: 268 seconds]
kdas_ has joined #ocaml
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 276 seconds]
alexst has joined #ocaml
darkf_ has quit [Ping timeout: 276 seconds]
kdas_ has quit [Ping timeout: 276 seconds]
alexst has quit [Ping timeout: 276 seconds]
aantron has joined #ocaml
struk|desk is now known as struk|desk|away
struk|desk|away is now known as struk|desk
hxegon has joined #ocaml
<Drup> aantron: This is amusing
<Drup> There is a similar too by ocamlpro
<aantron> are you referring to namespaces?
<Drup> yes
<aantron> is the ocamlpro tool publicly visible?
<Drup> Apparently, it isn't anymore
<Drup> (it was some years ago)
Reshi has joined #ocaml
<Drup> There is https://www.typerex.org/ocp-ocamlres.html but it's a bit different
kushal has joined #ocaml
<companion_cube> was it based on packs?
<companion_cube> I kind of recall it was hackish
Mercuria1Alchemi has joined #ocaml
slash^ has joined #ocaml
<Drup> (And there was the big-functor thing, which would actually be nice to have ...)
Reshi has quit [Ping timeout: 248 seconds]
<seangrove> Drup: What is -dsource? Is it just for visualizing the parse tree, or does it output source as well?
<Drup> seangrove: try it :)
<aantron> it output the parse tree as source on stderr during compilation
darkf has joined #ocaml
<seangrove> Ah, interesting!
<octachron> aantron, you probably have a typo in your namespaces'readme: in the oasis section, you refer to package(bisect_ppx.plugin).
<aantron> oh yeah. i was looking at bisect for reference, thanks.
teknozulu has quit [Ping timeout: 268 seconds]
_andre has quit [Ping timeout: 246 seconds]
_andre has joined #ocaml
<aantron> fixed
<edwin> hmm 4.03.0+beta1 breaks building of most opam packages which have C stubs (lwt included), or maybe I'm just doing something wrong
<edwin> e.g. Lwt fails with gcc: error: src/unix/lwt_unix_stubs.o: No such file or directory. There is a _build/lwt_unix_stubs.o though
<edwin> has anybody else experienced this problem?
<Drup> I'm surprised, the ppx is supposed to break, but not the C bindings
<edwin> ist as if the path is wrong
<edwin> and yeah camlp4 broke, but opam pin fixed that
<edwin> (was trying to build camlp4 from trunk instead of 4.03 branch)
octachron has quit [Quit: Leaving]
ozero17 has joined #ocaml
<ozero17> Hello, anybody know ostap? /HELP
darkf has quit [Quit: night]
kushal has quit [Read error: No route to host]
<companion_cube> doesn't ring a bell
kushal has joined #ocaml
ozero17 has quit [Client Quit]
<edwin> looks like an ocamlbuild bug, 4.02.1 used to do a mv lwt_unix_stubs.o src/unix/lwt_unix_stubs.o, but 4.03.0+beta1 doesn't
kushal has quit [Read error: Connection reset by peer]
kushal has joined #ocaml
tane has quit [Quit: Verlassend]
rand__ has quit [Quit: leaving]
cthuluh_ has joined #ocaml
Nazral_ has joined #ocaml
kushal has quit [Read error: Connection reset by peer]
alexst has joined #ocaml
cthuluh has quit [*.net *.split]
Nazral has quit [*.net *.split]
foolishmonkey has joined #ocaml
struk|desk is now known as struk|desk|away
Nazral_ has quit [Ping timeout: 260 seconds]
seangrov` has joined #ocaml
Nazral has joined #ocaml
manizzle has joined #ocaml
seangrove has quit [Ping timeout: 246 seconds]
alexst_ has joined #ocaml
alexst_ has quit [Client Quit]
Reshi has joined #ocaml
antkong has joined #ocaml
kushal has joined #ocaml
Reshi has quit [Ping timeout: 246 seconds]
struk|desk|away is now known as struk|desk
systmkor has joined #ocaml
alexst has quit [Ping timeout: 250 seconds]
alexst has joined #ocaml
<seangrov`> Drup: Heads up, graph output svg seems to be missing https://www.dropbox.com/s/nkkfgm42cyx85ia/Screenshot%202016-02-29%2009.19.23.png?dl=0
slicefd has joined #ocaml
<seangrov`> D'oh!
<Drup> (also, click on it)
<seangrov`> Sorry, didn't see that
<seangrov`> Yeah, after reading the issue, clicked on it, worked
<Drup> (Also, use a better browser :D)
lordf has quit [Read error: Connection reset by peer]
alexst has quit [Ping timeout: 246 seconds]
<seangrov`> T.T
* seangrov` gently strokes chrome
siriusbtx has joined #ocaml
tane has joined #ocaml
<siriusbtx> (noob here) I have 2 references which I want to assign to inside an if expression. But I keep getting syntax errors.
<siriusbtx> if a = b then c := 1; d := 2 else ()
kushal has quit [Ping timeout: 246 seconds]
<siriusbtx> something like this
<aantron> (c := 1; d := 2)
<siriusbtx> aantron: ty
<aantron> one of those ocaml syntax annoyances. you have to use parentheses or begin..end in if/else cases, if you use ; in them
kushal has joined #ocaml
<ggole> That's a bit of a simplification
<ggole> eg, consider if foo then let x = 0 in x; x; x; else y
<ggole> Which is really dumb code, but the point is that the ;s belong in the let, rather than breaking up the if.
<aantron> sure, perhaps it should be clarified if you use ; at the top level of an if or else case
<ggole> Mmm. The rules aren't really very intuitive.
<aantron> clarified: *
struk|desk is now known as struk|desk|away
dhil has quit [Ping timeout: 260 seconds]
dhil has joined #ocaml
Cypi_ is now known as Cypi
dexterph has joined #ocaml
alexst has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
yunxing has joined #ocaml
freehck has quit [Ping timeout: 260 seconds]
Haudegen has quit [Ping timeout: 260 seconds]
Reshi has joined #ocaml
kushal has quit [Remote host closed the connection]
Reshi has quit [Ping timeout: 276 seconds]
malc_ has left #ocaml ["ERC (IRC client for Emacs 25.0.50.2)"]
butts_butts has joined #ocaml
TheLemonMan has joined #ocaml
<ggole> asdfasdfasd
<ggole> Argument order of List.fold_right, why? -_-
<Drup> Does someone happen to know how to make findlib shut up about multiple .cmi ?
alexst has quit [Ping timeout: 248 seconds]
hunteriam has joined #ocaml
<foolishmonkey> ggole, what? it's the correct order
<aantron> Drup: running into the compiler-libs thing?
<Drup> Yes, but worse
<aantron> wish i knew. maybe we should PR findlib..
Haudegen has joined #ocaml
<ggole> foolishmonkey: it would be more sensible to keep the initial accumulator and list in the same order as fold_left
yunxing has quit [Remote host closed the connection]
<foolishmonkey> ggole, no, they put after to show that the seed (or accu) is at the right
srcerer_ is now known as srcerer
<foolishmonkey> [a; b; c] x -> a # (b # (c # x))
<foolishmonkey> that's not stupuid
<ggole> It's irritating because it's easy to forget that put it in the same place as virtually every other fold
alexst has joined #ocaml
<edwin> Drup: "OCAMLFIND_IGNORE_DUPS_IN This variable instructs findlib not to emit warnings that packages or module occur several times. The variable must be set to the directory where the packages reside that are to be ignored for this warning. "
hcarty has joined #ocaml
<Drup> edwin: you are my savior
<edwin> it only seems to support one dir though
<Drup> (I was looking in the source and couldn't find it ...)
<edwin> so hopefully you don't have duplicates in 3 dirs
<foolishmonkey> ggole, but you shouldn't use fold_right
<foolishmonkey> so why is there a problem?
<aantron> nice, this will help with the ppx PR as well. that causes so many of this warning.
<Drup> edwin: where is it ?
<edwin> file:///tmp/ocamlfind.1.6.1/doc/ref-html/r825.html
<Drup> No :D
<edwin> its an env var
<aantron> edwin: you gave a filesystem URL :)
<edwin> ah sorry
<ggole> foolishmonkey: wat
<edwin> I found it by going back from the error message, occurs in several directories -> fl_package_base.ml -> there is a comment about ignore_dups_in, and then grep -i for ignore_dups_in
<Drup> it works \o/
<edwin> yeah just don't add a 3rd duplicate, cause it'll be noisy again
<Drup> I shouldn't need to
<Drup> two compilers are enough
octachron has joined #ocaml
<edwin> :)
<foolishmonkey> ggole, fold_right is not tail rec. It will crash your application on big list. Try to avoid it.
<ggole> Lots of things in the stdlib are not tail recursive.
<foolishmonkey> So they should be avoid if we can't control size of input
yunxing has joined #ocaml
Maxdaman1us has joined #ocaml
<ggole> Do you avoid @, map, concat?
<foolishmonkey> Of course.
ygrek has joined #ocaml
<ggole> I don't. Crashing is an acceptable risk.
Maxdamantus has quit [Ping timeout: 244 seconds]
<ggole> (It's much safer than memory unsafety like Array.get_unsafe.)
<foolishmonkey> I'm not scared by accessing an array without checkng the bounds.
<hcarty> aantron: Your ocamlbuild namespaces plugin looks quite nice!
<aantron> hcarty: thank you :)
<companion_cube> ggole: or you can use an alternative, tailrec implem of those
yunxing has quit [Remote host closed the connection]
<ggole> For what I'm doing there's not much point.
siriusbtx has quit [Quit: Leaving.]
yunxing has joined #ocaml
inr_ is now known as inr
Reshi has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
Reshi has quit [Ping timeout: 246 seconds]
antkong has quit [Quit: antkong]
alexst_ has joined #ocaml
Haudegen has quit [Ping timeout: 268 seconds]
yunxing has quit [Remote host closed the connection]
alexst has quit [Ping timeout: 268 seconds]
<Algebr> the new changelog is pretty big, nice to see so many nice improvements and the stdlib is getting bigger.
<Algebr> I want the Unix module to be organized, now its just a grab bag of stuff
dhil has joined #ocaml
<seangrov`> aantron: https://github.com/aantron/namespaces looks *fantastic*, pretty much exactly what I want for one of the biggest annoyances I have about using wild OCaml code
<seangrov`> http://www.riseos.com/posts/2016_02_29_lets_encrypt_ssl commit-to-running currently takes two scripts, one manual keystroke, and a bit of manual monitoring, and clocks in at 7 minutes
<seangrov`> commit-to-running-in-prod, rather
<Algebr> yes, aantron looks greast
<Drup> I still want real namespaces :(
<seangrov`> I think I should be able to get it down to s single script, no monitoring, and ~3 minutes. And then hook that up to CI, and deploying mirage apps to EC2 should finally be trivially smooth for anyone
<aantron> seangrov`: Algebr: thanks. im guessing it will take a few more days to truly polish it (or verify that it is polished). but if you try it, please open issues for any problems you find
<Algebr> I guess we are coalescing around ocamlbuild
<mrvn> "You can access children and nephews, but cannot access parents." and that's why I want namespaces.
<Drup> aantron: No, this is still a build system thing, it's not "namespaces"
<aantron> fair enough
<Algebr> Drup: what would real namespaces need to exist for them to exist
<Drup> Algebr: open modules
<Algebr> what does that mean
<Drup> It's a module where you can add things in it from anywhere
<Drup> like, a module Datastructure, and everyone can add a submodule
<Algebr> oh like type foo = .. but for modules
<Algebr> Why would that solve namespaces issue? Not seeing it
<mrvn> The problem there is that you have circular dependencies and ocaml doesn't allow that.
<Drup> aantron thing is convenient, but it doesn't really solve anything, you could already do that by creating an ML file with module declarations, like this: https://github.com/Cumulus/Syndic/blob/master/lib/syndic.ml
<aantron> hmm you can access cousins and uncles too.. that sentence is getting ridiculous, i should just say you cant access ancestors, but can access everything else as long as you still get a cycle-free dependency graph
<aantron> Drup: i know, ive done that
<aantron> it does solve something though
<aantron> it stops you from having to think globally about your filename
<Drup> The issue at the moment is that, for example, we can't create a topmodule Lwt (with submodules Stream, Preemptive, Unix, ...)
<mrvn> you you have server.mli and server/foo.ml + server/bla.ml?
<Drup> Because those three are in three separated independent library
<aantron> because the plugin hides the unqualified module names
<aantron> mvrn: not fully parsing this question
<Drup> aantron: sure, it's much more convenient
<aantron> mrvn*
<aantron> yeah exactly, its just a convenience
<seangrov`> chenglou: ^
alexst_ has quit [Ping timeout: 260 seconds]
<mrvn> aantron: the server.mli gives the outside interface while the directory has the submodules. Does that work with the namespaces plugin?
<aantron> it basically automatically prefixes your module Foo with whatever directories it's in that are tagged with namespace
<aantron> mrvn: i had something like that at one point, but i am not sure if it works in the released version (it has been a year). if it doesnt, it should be straightforward to implement
<Drup> seangrov`: you have encoding issues
<aantron> iirc you simply make server/server.mli "if it works"
<aantron> as currently you make server/server.ml to get that module included at the level Server
alexst has joined #ocaml
<aantron> Drup: to be more precise, server/foo.ml becomes Server_foo.ml, then server.ml has an alias for Server_foo as you linked
<aantron> just to be cleear. but im sure you already understood.
<aantron> Drup: it would be nice if you could scope multiple packages inside module Lwt
<Drup> Sure, it's basically the build system support for module aliases that should have been there for 2 versions :D
<Drup> (of ocaml)
<aantron> basically
<aantron> mrvn: in any case i added a line to my todo file to get this checked, add a test, and make sure it works and stays working :)
<Drup> (which is great, not diminishing what you did, I'm just a bit disappointed every time the subject pops up)
<aantron> feel free to diminish it :)
<Drup> I should make a post explaining it
<Algebr> yea where are your blogs posts
<Drup> :D
<aantron> i think you should. 50%+ of the point of releasing this thing is just to get people to discuss this matter seriously
<aantron> i certainly dont think that an ocamlbuild plugin is the ultimate solution to the naming problems of ocaml, for multiple separate reasons
<Algebr> functoria looks very nice
<Drup> It's the dot output, it makes everything looks cool :p
Haudegen has joined #ocaml
butts_butts has quit [Remote host closed the connection]
musha68k has quit [Remote host closed the connection]
butts_butts has joined #ocaml
cthuluh_ is now known as cthuluh
<Drup> I wanted to name it functhulhu first, but thomas found it was too complicated to spell
<aantron> lol
<Drup> So the name is free now, everyone has my blessing to create a functhulhu library
<Algebr> I don't think anyone is rushing to claim that
<Algebr> yet
slash^ has quit [Read error: Connection reset by peer]
yunxing has joined #ocaml
Algebr has quit [Remote host closed the connection]
<octachron> aantron, you are mapping Server/foo.ml to Server_foo with only one underscore?
shinnya has joined #ocaml
<aantron> i think 1, but i know it should be more. already have an item to check that :)
<aantron> back when i wrote this thing i used camelcase for modules, nowadays i use underscores. so the problem is clear i think
<edwin> Drup: warning 32 triggers on functoria with 4.03
<edwin> ands its warn_error
<aantron> octachron: did i understand correctly?
<octachron> aantron, yes indeed: I was refering to https://github.com/ocaml/ocaml/blob/trunk/Changes#L54
<aantron> ooh interesting, thank you
<Drup> edwin: interesting
<aantron> octachron: do you know what led to this change?
<Drup> edwin: please bug report
<edwin> k
Kakadu has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]
<mrvn> .oO(I don't bug reports, reports bug me)
octachron has quit [Ping timeout: 248 seconds]
<edwin> filed functoria bug report, will probably wait a bit more with testing 4.03 though, quite a lot of things fail to install due to unavailable ppx_tools, there are also some race conditions with installing ocamlbuild and dependant packages
<aantron> Drup: any comments on when https://github.com/ocsigen/lwt/pull/206 might be integrated/whether it needs to be done in a different way/etc.? i need it to avoid a stupid workaround in markup.ml: http://aantron.github.io/markup.ml/Markup_lwt.html#VALensure_tail_calls
<Drup> ppx_tools is fixed, just pin the dev version
<aantron> it doesnt have to be exactly as in the PR, any way to get a tail-call from an Lwt thread will do
Reshi has joined #ocaml
alexst has quit [Ping timeout: 246 seconds]
alexst has joined #ocaml
nicholasf has joined #ocaml
<Drup> I don't know, and nobody seems to care
Reshi has quit [Ping timeout: 248 seconds]
<Drup> grmbl :/
octachron has joined #ocaml
<companion_cube> lwt is a bit inactive those days, isn't it?
<aantron> how is lwt maintained? like, who is allowed to merge what?
<octachron> aantron, it was introduced to help hide the long version of module name when using module alias to organize libraries (with at least Janestreet core in mind)
<octachron> here is the corresponding compiler PR https://github.com/ocaml/ocaml/pull/282
<aantron> octachron: great, thank you
<companion_cube> I don't know, look at the contributor list on github ;)
Algebr has joined #ocaml
<aantron> i did of course, and at recent PRs. but various statements by Drup and others in irc in the past have left me confused
Algebr is now known as Guest16358
alexst has quit [Ping timeout: 246 seconds]
Guest16358 is now known as Algebr`
<orbitz> Debuggign question, what do you do when you run your program and the output is: "Uncaught exception: (Invalid_argument "index out of bounds")
<orbitz> "
<orbitz> What's your first move?
<aantron> cry... :)
alexst has joined #ocaml
<aantron> compile with -g, and prvide OCAMLRUNPARAM=b when startng the program
<orbitz> I think I'm being inefficient in trying to debug these
<companion_cube> OCAMLRUNPARAM=b ./myprogram
<orbitz> that's about it? Nothing like "run itin ocamldebug" ros somethign?
<Algebr`> that's it
<aantron> or, instead of the OCAMLRUNPARAM, call Prntexc.record_backtrace true at initialization
<orbitz> companion_cube: I'm slowly working on an alternative to lwt and async btw. We'll see how it goes though :)
<Drup> aantron: you are right to be confused, the situation is confusing, I'm confused too
<companion_cube> well I don't know how to use ocamldebug...
<companion_cube> orbitz: huuu
<companion_cube> a monadic one? :s
<orbitz> I'm doing it in layers, so the bottom layer is all callbacks
<orbitz> And then you can wrap a monadic layer over it
<orbitz> and with flambda that shouldn't cost anythign
<companion_cube> with effects, the monad should be useless, which is better
<orbitz> I've been asking a lot of ctypes questions on the mailing list because I'm binding libuv right now.
<Algebr`> there isn't one already??
<companion_cube> can't you take the core of Lwt as a starting point? there are callbacks too
<aantron> orbitz: you mean it's continuation-passing style?
<Drup> orbitz: why ?
<orbitz> Yeah, but I talked to several people about the effects system and that just seems way too far of
<Drup> Why doing one more concurency lib ?
<orbitz> Drup: Moslty because I"m not super happy with the available options and partially because I'm playing around to see what I canc ome up with.
<Drup> What are you unhappy with ?
<companion_cube> Lwt? :D
<orbitz> Lwt's error model isn't so great IMO, and Async is basically useless outside of Linux.
<ggole> "shouldn't cost anythign" uh-huh
<orbitz> And the Core stuff is very...big
<ggole> I've heard that before
<companion_cube> my issues with lwt is more around streams
<orbitz> ggole: well, that's the dream at least.
<Drup> orbitz: and modifying lwt to be actually useful to people isn't worth your effort ?
<Drup> (alert: I'm going to be quite bitter)
Haudegen has joined #ocaml
<orbitz> Drup: Maybe I'll end with that, but at the moment I've found Lwt and Async to be too coupeld together across theri stack, and I'm trying to decouple evrything.
<Algebr`> orbitz: so add a result type layer?
<Drup> Lwt ? To coupled ? In what way ?
<orbitz> Algebr`: I want a good error model from the bottom up.
<companion_cube> lwt forces the ecosystem to reimplement everything from scratch? ;)
<Algebr`> what is a good error model then from the bottom up?
<companion_cube> (async, t oo, obviously)
<orbitz> Algebr`: I want results, but form the bottom up. As in, you shouldn't be able to write a library with the funny error model.
mxv has joined #ocaml
<orbitz> companion_cube: and my solution too, if it becomes anything.
<Drup> companion_cube: great, let's do one more, that is also incompatible with the two others
<orbitz> We'll see though, this has mostly been an exploration in ctypes, which has been quite fun.
<companion_cube> Drup: honestly I hope this will happen after effects land
<orbitz> Drup: actually mien would be compatible, as you could use async or lwt as the bottom layer as long as you wrote aimplemented my scheduler inerface
<companion_cube> but I'm clearly not going to write another monadic concurrency lib :)
<Drup> Oh, and also https://github.com/fdopen/uwt
antkong has joined #ocaml
<orbitz> Drup: the bottom of mine is a interface that describes a scheduler and you can put anything underneath that you want. You can then implemenet a monadic or effect based layer on top. Or at leas that's the dream.
<companion_cube> sounds like the bottom of ocamlnet :)
<Drup> I see, and then you can implement an Lwt_engine, if you want, fair enough
<Drup> orbitz: just don't say "a new concurrency library", it will trigger people off
<Drup> phrase it differently :D
<companion_cube> orbitz: would you like to write a new standard library? ;)
<orbitz> companion_cube: you're already on top of that
<orbitz> :)
<edwin> so lets I want to write a package that uses your concurrency lib, but I also want to use some other package that uses Lwt. Would I be able to do that?
<orbitz> edwin: yes, you could use lwt underneath both
<orbitz> In theory, I don' tkno wif it'll end up like that, or if anyone will ever want to use mine
<edwin> ah so its a wrapper like https://github.com/solvuu/future? (not that I used it)
<orbitz> No, it's not a wrapper. It's an interface that schedulers should interface, and you can have any scheduler underneath that youw ant
antkong has quit [Quit: antkong]
_andre has quit [Quit: leaving]
<orbitz> Like, if you consider why you cannot mix Async and Lwt programs in one, it's because the API that you use depends on an API underneath it that is specific to each. So the start of my project is defining an async interface that can eb the meeting point of any user API and scheduler API
Maxdamantus has joined #ocaml
<companion_cube> yeah but a 'a Lwt.t and 'a Deferred.t will still be distinct types
<orbitz> I don' tknow how ugly the translation is from something like Async to my scheduler interface though
<orbitz> Sure, you can sitll do that, because they are above the scheduler level
<edwin> ok, but provided that someone configures to use lwt underneath your stuff, there should be some function to lift an Lwt.t to your Foo.t, and viceversa
Maxdaman1us has quit [Ping timeout: 260 seconds]
<edwin> my problem with mixing async and lwt is that some projects use this, some projects use that, and I cannot mix both in the same application without functorizing/rewriting each lib
<companion_cube> the solution is simple: make everyone migrate to Lwt :)
<orbitz> edwin: yes, I'm not sure how successful what I'm working on will be, but I'm moslty using it as a mechanism to binding a large library (libuv) with ctypes to see how that goes.
<orbitz> Heh
<orbitz> I also thing less people should be using an async framework in their libs than they do
<orbitz> Like Cohttp is an utter clusterfuck and it has no need to be using any async framework at all, much less the functorization it is now
<Drup> "Cohttp [...] has no need to be using any async framework" -> yeah, just no, sorry.
<edwin> with ocaml effects it probably wouldn't need to, but is there a solution for that without using effects?
<orbitz> Drup: you disagree with me?
<Drup> Yes
ggole has quit []
<orbitz> Why? I would be much happier with an interface where I fed Cohttp bytes and I got HTTP frames out of it
<Drup> I'm not in node.js, I don't want to use callbacks
<orbitz> Nobody said you needed to use callbacks
<seliopou> i picked a great time poke my head back into irc
<orbitz> val add_data : Cohttp.t -> bytes -> fame list
<Drup> Hi seliopou
<orbitz> frame*
<Drup> orbitz: If you think that works in HTTP, you underestimate some of HTTP features in term of pipeline
<seliopou> Drup: sup
* seliopou eats popcorn
<orbitz> Drup: no, frame can eb a whole lot of things
<orbitz> We might hav eot just gentlemenly disagree on this, but I find Cohttp really harshes my mellow.
<Drup> I don't disagree with the second part of the statement
<orbitz> :)
<Drup> but luckily, we can use webmachine !
* Drup drags seliopou in the discussion and steal the pocorn.
<edwin> also once you start using cohttp you find out its still too low-level and something higher level would be needed, especially around handling of persistent connections, timeouts, etc.
<seliopou> lol :)
<seliopou> i would encourage people to use webmachine instead of cohttp directly
<Drup> Or opium
<edwin> but opium is async, or do I remember wrong?
<seliopou> as i've told anil and others, cohttp is nowhere close to the http turnkey solutions that you find in other languages
<Drup> edwin: nope
<Drup> it's core_kernel, though
<orbitz> To put it another way, I much more prefer base APIs that let me feed them things then they mayeb give me something back. I can alwasy wrap that up in some async framework. But th ecurrent Cohttp implementation is insanity, IMO.
<companion_cube> well, opium might soon not depend on core_kernel anymore
<seliopou> orbitz: you can't always do that ex post facto
<edwin> eh the blogpost announcing it was using async, looks like its switch to lwt, which is nice
<orbitz> Core is such a funny thing. Like in terms of teaching peopel Ocaml it's my goto, but I find it becomes more and more difficult to get behidn for serious things. It's just such a huge thing.
<seliopou> orbitz: the implementation of cohttp defintiely leaves something to be desired (and is buggy), but the interface is not the worst thing one could come up with
<Algebr`> cohttp def needs to be higher level
<Algebr`> does webmachine handle sessions
<edwin> there is a separate lib (called session) that does I think
<Algebr`> I want something like node's express but in ocaml
<seliopou> has two subpackages for cohttp and webmachine
<orbitz> Is ocaml's webmachine a port of erlang's?
<seliopou> orbitz: yes
<seliopou> I'm the author
<orbitz> Of both?
<seliopou> session and webmachine? yes
<orbitz> I mean erlang's and ocamls' :)
<seliopou> oh no
<seliopou> erlang's implementation was written by the folks at basho
<orbitz> Right
<Algebr`> seliopou: this is nice
<seliopou> now it's an independent project
<seliopou> Algebr`: thanks
<seliopou> needs more backends, but it's a start
maverous has joined #ocaml
<edwin> I should probably take a closer look at opium, at this point I have a half-baked wrapper on top of cohttp that takes care of some things that I hit when I run a cohttp server for a larger period of time (like running out of file descriptors, sane timeouts for streams, support for additional headers). It is interesting of how much ocsigen has taken care of for me that I didn't even know about and I suddenly start missing if I try to use cohttp (or a cohttp
siriusbtx has joined #ocaml
<edwin> would webmachine and opium work together?
<seliopou> edwin: i don't see how but I may also be lacking imagination.
<edwin> IIUC webmachine is about having a state machine on queries/responses, and opium is about composing middlewares, or filtering/transforming requests/responses by composing multiple layers
<seliopou> Ah I see
<edwin> so I'd have an opium middleware that does caching, that calls to webmachine for the real request, that does some transformation on the output (like writing an access.log entry)
<seliopou> kindof sortof
<seliopou> i was talking to pqwy a couple week ago and he brought up the idea of having a standard middleware interface for ocaml web apps
Reshi has joined #ocaml
julien_t has joined #ocaml
<seliopou> i should talk to rudi about it too
<seliopou> but right now, gotta run some errands!
hunteriam has quit [Quit: Connection closed for inactivity]
yunxing has quit [Remote host closed the connection]
Reshi has quit [Ping timeout: 248 seconds]
<Algebr`> yes please, the web front for ocaml is not great, it is not easy to deploy a production scale web project
<Algebr`> I can do a production scale web project in node in literally 200 lines of code and that's generous
nicholasf has quit [Remote host closed the connection]
yunxing has joined #ocaml
yunxing has quit [Remote host closed the connection]
yunxing has joined #ocaml
mxv has quit [Ping timeout: 252 seconds]
alexst has quit [Ping timeout: 276 seconds]
<Drup> Algebr`: to be fair, I can do it in 10 lines. It starts by "open Eliom_service"
<companion_cube> I can write a theorem prover in 2 lines, it starts with `open Zipperposition`
<companion_cube> amazing, isn't it? :D
jeffmo has joined #ocaml
<Drup> companion_cube: totally
alexst has joined #ocaml
<j0sh__> i have a http library similiar to opium (but even slimmer), it doesn't use core_kernel, would there be any interest in me releasing it?
Algebr` has quit [Ping timeout: 276 seconds]
<companion_cube> no idea:p
<edwin> how dependent is eliom on ocsigen, or rather my question is: can an eliom-based application be configured programatically, like with cohttp/conduit (as opposed to writing an xml config file like for ocsigen)?
<Drup> there is a PR for that, but apart from that, well, :working on it:
j0sh__ is now known as j0sh
Algebr` has joined #ocaml
<j0sh> Drup: the svg images in the blogpost are not showing up here in chrome (firefox works fine)
<companion_cube> then you know which browser is the best
<companion_cube> ;)
<Drup> j0sh: know, fixed, waiting for deployment
<Drup> known*
<edwin> j0sh: now that I learned that opium actually uses Lwt and core_kernel dependency being dropped, I'll try to contribute my opium-like lib to opium, or rather I think I can make my lib work on top of opium. It would be interesting to see your lib though, and perhaps see what changes opium would need to make it work for both of us
<edwin> unfortunately I don't know when I'll have time to do that, might be next week, might be several months later, depending when I find enough free time for this :(
julien_t has quit [Ping timeout: 250 seconds]
<j0sh> edwin: yeah, i wrote my library over a year ago, back when there was no core_kernel, and core didn't even work on 32bit...
<j0sh> been meaning to release it but havent had time to do proper packaging with ocamlbuild and write docs, etc
<j0sh> but its worked pretty well here for 4 or 5 different projects
seangrov` has quit [Ping timeout: 248 seconds]
pierpa has joined #ocaml
DanielRi1hman is now known as DanielRichman
Mercuria1Alchemi has quit [Ping timeout: 250 seconds]
dhil has quit [Ping timeout: 276 seconds]
yunxing has quit [Remote host closed the connection]
<mrvn> aantron: Error: Unbound module Prntexc
<mrvn> aantron: "Prntexc.record_backtrace true" doesn't work instead of OCAMLRUNPARAM=b
<aantron> oops, Printexc :)
<mrvn> makes more sense
Reshi has joined #ocaml
<companion_cube> it's useful indeed to provide a --backtrace option to your program
<mrvn> I pretty much always want one.
<companion_cube> I've started to use Printexc.register_printer a lot, also
octachron has quit [Read error: Connection reset by peer]
cdidd has joined #ocaml
lobo has joined #ocaml
<mrvn> What's the best way to deal with a custom block with finalizer that also has some ocaml values. Register them as root?
octachron has joined #ocaml
mxv has joined #ocaml
<aantron> i usually just unconditionally call Printexc.record_backtrace true as part of the initialization of any non-trivial program, unless there is any evidence that backtraces are actually harming performance in a relevant way.. which has never been the case for my usage
yunxing has joined #ocaml
Reshi has quit [Ping timeout: 276 seconds]
<Drup> aantron: it does
<Drup> I mean, it's not a problem if you are not doing anything performance sensitive, but it does have a negative impact on perfs
<aantron> yes. i wasnt doing things that were performance sensitive, to the degree that i was ready to give up backtraces
<mrvn> Drup: even if the exception is caught?
<mrvn> couldn't the stack unrolling know wether the exception will be caught or not an only recrod a backtrace if not?
<edwin> wouldn't you want the backtrace when the exception is caught so you can write it to a logfile and keep the application running?
<mrvn> edwin: usualy not
<mrvn> try List.find foo bar with Not_found -> make bar doesn't need a backtrace
<edwin> yes
Algebr` has quit [Ping timeout: 246 seconds]
<edwin> this one might need the backtrace though: try foo () with e -> log e; raise e
<edwin> so it would need to figure whether the exception (or stacktrace) is used in the with block at all
<mrvn> well, the "raise e" makes it not caught
yunxing_ has joined #ocaml
yunxing has quit [Ping timeout: 250 seconds]
<mrvn> when the "with" branch throws an exception does the backtrace show both exceptions like it does for python?
<edwin> it shows re-raised at ...
<edwin> provided you were careful eenough not to destroy the backtrace
<edwin> by throwing and catching another exception
<mrvn> No, I ment when it throws another different exception
hcarty has quit [Quit: WeeChat 1.4]
<edwin> no, I think if you throw a different exception the original one is lost, unless you embed it (exception Foo of exn * yourtype)
<edwin> actually not sure what happens to the stacktrace if you embed it
<mrvn> In python when you do: try find list1 with Not_found -> try find list2 with Not_found -> find list 3 you get all 3 exceptions listed with "During handling this exception another exception was thrown ...."
alexst has quit [Ping timeout: 252 seconds]
nicholasf has joined #ocaml
SIGILL has quit [Quit: WeeChat 1.3]
yunxing_ has quit [Remote host closed the connection]
yunxing has joined #ocaml
<mrvn> anyone have ctype stubs working with oasis?
<mrvn> Somehow __PRETTY_FUNCTION__ is far less usefull with ocaml bindings: value caml_mrvn_QT5_Signal_connect(value, value, value)
<mrvn> should I add typedefs for all the different things I have in value?
seangrov` has joined #ocaml
antkong has joined #ocaml
sz0 has quit [Quit: Bye.]
antkong has quit [Client Quit]
antkong has joined #ocaml
Reshi has joined #ocaml
slicefd has quit [Quit: WeeChat 1.4]
sh0t has quit [Ping timeout: 250 seconds]
butts_butts has quit [Ping timeout: 252 seconds]
yunxing has quit [Remote host closed the connection]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
alexst has joined #ocaml
yunxing has joined #ocaml
octachron has quit [Quit: Leaving]
alexst has quit [Quit: Lost terminal]
<j0sh> how does one do multiple AST mapping passes over the parsetree with Ast_mapper? Calling Ast_mapper.register multiple times does not seem to preserve previous ast transformations
<Drup> just compose your mappers
<Drup> As far as the Ast_mapper.register goes, only the structure and signature functions are called, so you only have to compose that
<j0sh> Drup: there seems to be a problem with order of operations; eg I have a struct_item mapping that depends on an expr mapping, so I need to (re-)run the struct_item mapper after the expr. Otherwise, struct_item mapper complains about unintinterpreted extensions
keep_learning has quit [Quit: This computer has gone to sleep]
<Drup> mappers don't complain about uninterpreted extension
<Drup> the typer does, and it's quite later in the chain
<j0sh> hmm, i wonder what's happening here then
<j0sh> because the expr mapper (which interprets the extension) is working just fine
Sorella has joined #ocaml
Sorella has quit [Changing host]
<j0sh> unless its not being called for some reason when i'm trying to compose with the struct_item mapper (or calling Ast_mapper.register sequentially)
<Drup> You shouldn't call register multiple time
<j0sh> still get the error when composing the mappers (by that I'm guessing you mean something like 'default_mapper with expr = (fun ... ); structure_item = (fun ...);
<Drup> you don't need to compose the expr, only the structure and signature
<j0sh> not sure what you mean by that?
<aantron> i think you can call register multiple times, as long as you change register_function: https://github.com/ocaml/ocaml/blob/trunk/parsing/ast_mapper.ml#L892-L915
<aantron> i have 0 experience with this, however, so i am not sure
<Drup> aantron: that's a bad idea
Algebr has joined #ocaml
<Drup> I mean, it's *really* not necessary, mappers are 100% composable
Algebr is now known as Guest37272
Guest37272 is now known as Algebr`
tane has quit [Quit: Verlassend]
siriusbtx has quit [Remote host closed the connection]
Algebr`` has joined #ocaml
<Drup> You then register the result, and it's enough.
Guest38 has joined #ocaml
<j0sh> Drup: hmm, okay. m1 and m2 are mappers correspodnding to eg, the expr and structure_item overrides?
<Drup> Well, no, m1 and m2 are to mapper that you want to compose
<Drup> If you want to have one mapper that do both expr and structure_item, you just replace both field in one mapper, no need to play around with multiple mappers
sh0t has joined #ocaml
<j0sh> yeah, that was my first attempt, the compiler gives me an 'uninterpreted extension' error whenever the structure_item override is present (but works fine with just the expr, which is really what interprets the extension anyway)
lukky513 has quit [Ping timeout: 276 seconds]
<j0sh> but i'll play around with your approach, thanks (as usual) Drup
<Drup> Show me your code
<Drup> I feel like you are doing something in a really weird way
Algebr`` has quit [Ping timeout: 260 seconds]
lobo has quit [Quit: leaving]
<j0sh> i can try cleaning it up to a reduced case (or something that compiles) if needed
<j0sh> (this compiles, but its not the whole code since thats irrelevant, i think)
<Drup> https://gist.github.com/j0sh/e6adffafcf35e0facd1b#file-mapper-ml-L12 that doesn't work, but it's not the problem
<Drup> show me the rest
<Drup> in particular, shared_expr
<j0sh> Drup: gist updated
foolishmonkey has quit [Quit: Leaving]
Reventlov has quit [Ping timeout: 248 seconds]
Johann has quit [Ping timeout: 248 seconds]
<j0sh> it extracts the value_binding matching something in a hashtable (only works in the single case now, List.find should be changed to List.filter at some point)
<Drup> The issue is that you never call the recursive case over value_bindings
Reventlov has joined #ocaml
eeks_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<j0sh> Drup: as in default_mapper.structure_item mapper ... ?
<Drup> Which means you never run the expr mapper over the expression in the bindings
<Drup> yes
<j0sh> ah that makes sense now. with an extension in there, the mapper doesn't have a chance to evaluate it
<Drup> Apparently, you expect the expr mapper to run before the code inside the mapper, so you need to add that before this line : https://gist.github.com/j0sh/e6adffafcf35e0facd1b#file-mapper-ml-L60
<Drup> Also, why are you doing this only on bindings ?
Johann has joined #ocaml
<j0sh> Drup: still incomplete now (still have a couple other parsetree items to apply this to), but i'm basically following the code in pa_estring, and it only operates on bindings. i really don't know enough about the ocaml AST to say whether the hositing could/should be done at other points in the parsetree
<Drup> (Also, you should use Ppx_core.Ast_traversal.fold_map)
<Drup> (It would simplify your code a lot)
<j0sh> map_def in particular
lukky513 has joined #ocaml
<j0sh> cool, i'll check it out
<Drup> (no need for annoying hashtables)
Simn has quit [Quit: Leaving]
seangrov` has quit [Ping timeout: 250 seconds]
cojy has left #ocaml [#ocaml]
mxv has quit [Ping timeout: 260 seconds]
seangrov` has joined #ocaml
Reshi has quit [Ping timeout: 252 seconds]