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
avarsh has joined #ocaml
yminsky has joined #ocaml
dch has quit [Ping timeout: 240 seconds]
seako has joined #ocaml
NhanH has joined #ocaml
rfv has joined #ocaml
dch has joined #ocaml
sh0t has joined #ocaml
<fds> seangrove: FWIW, Core has Fn.id (for the identity function).
sh0t has quit [Remote host closed the connection]
badon has joined #ocaml
ygrek has quit [Ping timeout: 272 seconds]
seangrove has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
groovy2shoes has joined #ocaml
kakadu has quit [Remote host closed the connection]
seangrove has joined #ocaml
pierpa has quit [Read error: Connection reset by peer]
pierpa has joined #ocaml
pierpa has quit [Read error: Connection reset by peer]
pierpa has joined #ocaml
aantron has quit [Remote host closed the connection]
jeffmo has joined #ocaml
sh0t has joined #ocaml
pierpa has quit [Read error: Connection reset by peer]
pierpa has joined #ocaml
hnagamin has quit [Ping timeout: 264 seconds]
jeffmo has quit [Ping timeout: 240 seconds]
pierpa has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
pierpa has joined #ocaml
FreeBirdLjj has joined #ocaml
ollehar has joined #ocaml
SomeDamnBody has joined #ocaml
teknozulu has joined #ocaml
<nullcatxxx_> Preparing and eating food three times a day is annoying. Drinking water periodically is also tiring. I want to become a camel.
<def`> +1
<foolishmonkey> nullcatxxx_, you can eat only once by day
hnagamin has joined #ocaml
<nullcatxxx_> foolishmonkey : that's not healthy...
<struk|desk> eating too many times is bad for stomach muscle, eating just once is bad for digestion and absorption
<struk|desk> nullcatxxx_: and besides, you want to become an OCaml, right? not just a run of the mill camel.
<nullcatxxx_> i can never understand the compiler source code :(
<struk|desk> too recursive? too many branches in the AST?
<nullcatxxx_> too complicated...
lostman_ has joined #ocaml
pierpa has quit [Ping timeout: 245 seconds]
<fds> We should start a study group. ;-)
aantron has joined #ocaml
ollehar has quit [Quit: ollehar]
<fds> By the way, maybe I'll take this quiet and off-topic time to mention that I've started a little channel over at #ocamlcafe for off-topic chatter with OCaml fans. It was formed by some refugees from the MOOC channel when the course ended. Obviously, everyone is welcome. :-)
<struk|desk> ok fds, I'll ad it to my irc startup list
<struk|desk> I hope they have cold brew iced coffee, or a pour over maybe.
psy_ has joined #ocaml
<fds> Heh
huza has joined #ocaml
virtualeyes has quit [Quit: Leaving.]
virtualeyes has joined #ocaml
Algebr` has joined #ocaml
virtualeyes has quit [Ping timeout: 272 seconds]
madroach has quit [Ping timeout: 248 seconds]
ely-se has quit [Quit: Leaving...]
hnagamin has quit [Ping timeout: 250 seconds]
<seangrove> How can I match any string and assign it to a value in pattern matching?
<def`> hu
<seangrove> e.g. `let m = match msg with "" -> "Empty string" | _ -> _;
<def`> assign to a variable*
<def`> match msg with s -> (*s bound here*)
<seangrove> def`: Heh, yes, thank you, sorry for that
<seangrove> def`: Ah, ok, great. I had tried some variations, didn't quite get it
<def`> seangrove: np, its pedantic but it's always better to use appropriate terms :)
copy` has quit [Quit: Connection closed for inactivity]
huza has quit [Quit: WeeChat 0.3.8]
madroach has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
ryanartecona has joined #ocaml
spags has joined #ocaml
spags has left #ocaml [#ocaml]
psy_ has quit [Read error: No route to host]
madroach has joined #ocaml
mac10688_ has quit [Ping timeout: 250 seconds]
mac10688 has quit [Ping timeout: 276 seconds]
JacobEdelman has quit [Quit: Connection closed for inactivity]
SomeDamnBody has quit [Ping timeout: 272 seconds]
struktured has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
aantron_ has joined #ocaml
struktured has quit [Ping timeout: 256 seconds]
aantron has quit [Ping timeout: 256 seconds]
mac10688 has joined #ocaml
mac10688_ has joined #ocaml
struktured has joined #ocaml
FreeBird_ has joined #ocaml
struk|desk is now known as struk|desk|away
FreeBirdLjj has quit [Ping timeout: 276 seconds]
lostman_ has quit [Quit: Connection closed for inactivity]
struktured has quit [Ping timeout: 245 seconds]
madroach has joined #ocaml
mac10688_ has quit [Ping timeout: 240 seconds]
mac10688 has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
Algebr` has quit [Ping timeout: 250 seconds]
struktured has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
zaquest has quit [Ping timeout: 250 seconds]
MercurialAlchemi has quit [Ping timeout: 260 seconds]
Algebr` has joined #ocaml
inr_ has joined #ocaml
lambdahands_ has joined #ocaml
mehdi_ has joined #ocaml
adrien_ has joined #ocaml
Asmadeus_ has joined #ocaml
adarqui_ has joined #ocaml
maufred_ has joined #ocaml
_2can_ has joined #ocaml
jtmcf_ has joined #ocaml
Mandus_ has joined #ocaml
rom1504_ has joined #ocaml
_berke__ has joined #ocaml
<seangrove> Does Core work with js_of_ocaml?
noplamodo_ has joined #ocaml
ygrek has quit [*.net *.split]
Jamazia has quit [*.net *.split]
please_help has quit [*.net *.split]
AlexRussia has quit [*.net *.split]
_berke_ has quit [*.net *.split]
Algebr has quit [*.net *.split]
inr has quit [*.net *.split]
thegameg has quit [*.net *.split]
jbrown has quit [*.net *.split]
tobiasBora has quit [*.net *.split]
hbar has quit [*.net *.split]
thizanne has quit [*.net *.split]
maufred has quit [*.net *.split]
cartwright has quit [*.net *.split]
mawuli has quit [*.net *.split]
jyc has quit [*.net *.split]
jun has quit [*.net *.split]
averell has quit [*.net *.split]
cnu- has quit [*.net *.split]
Asmadeus has quit [*.net *.split]
thegameg has joined #ocaml
<seangrove> Drup: I think you mentioned one year ago that it compiled to ~2MB of JS - is the story any better now?
lambdahands_ is now known as lambdahands
struktured has quit [Ping timeout: 276 seconds]
jave has joined #ocaml
cnu- has joined #ocaml
sh0t has quit [Remote host closed the connection]
struktured has joined #ocaml
_habnabit has joined #ocaml
cat5e has joined #ocaml
jbrown has joined #ocaml
govg has quit [Ping timeout: 264 seconds]
tobiasBora has joined #ocaml
dinosaure has joined #ocaml
thizanne has joined #ocaml
rbocquet has joined #ocaml
ygrek has joined #ocaml
AlexRussia has joined #ocaml
please_help has joined #ocaml
jyc has joined #ocaml
govg has joined #ocaml
jun has joined #ocaml
cartwright has joined #ocaml
zaquest has joined #ocaml
hbar has joined #ocaml
struk|desk|away is now known as struk|desk
Algebr`` has joined #ocaml
Algebr`` has quit [Ping timeout: 240 seconds]
rpip_ has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
Asmadeus_ is now known as Asmadeus
govg has joined #ocaml
struk|desk is now known as struk|desk|away
MercurialAlchemi has joined #ocaml
groovy2shoes has quit [Quit: Leaving]
larhat1 has quit [Quit: Leaving.]
axiles has quit [Ping timeout: 264 seconds]
inr_ is now known as inr
govg has quit [Ping timeout: 240 seconds]
kushal has joined #ocaml
struk|desk|away is now known as struk|desk
darkf has joined #ocaml
shinnya has quit [Ping timeout: 256 seconds]
<flux> DAFT (from the mailing list) seems interesting, but the inability (by design? by non-implemented-feature?) to remove files seems a bit inconvenient
Simn has joined #ocaml
Algebr`` has joined #ocaml
adrien_ is now known as adrien
<seangrove> Can I have a type declaration with a single field that has multiple types?
govg has joined #ocaml
<seangrove> e.g. type db_value = string | int | reference; type db = {v: db_value}
govg is now known as Guest83112
<flux> seangrove, type db_value = String of string | Int of int | Reference of reference type db = { v : db_value }
hnagamin has joined #ocaml
<nullcatxxx_> core_kernel is separated out, so it could be much better
axiles has joined #ocaml
<seangrove> flux: Great, thanks!
<seangrove> nullcatxxx_: Yeah, curious about the state of things, definitely
struk|desk is now known as struk|desk|away
Guest83112 has quit [Ping timeout: 264 seconds]
hnagamin has quit [Quit: さようなら]
Algebr`` has quit [Ping timeout: 260 seconds]
govg_ has joined #ocaml
teknozulu has quit [Ping timeout: 265 seconds]
aantron_ has quit [Remote host closed the connection]
govg_ has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
govg_ has joined #ocaml
antkong has quit [Quit: antkong]
avarsh has quit [Read error: Connection reset by peer]
tane has joined #ocaml
skeuomorf has joined #ocaml
rom1504_ is now known as rom1504
seangrove has quit [Ping timeout: 245 seconds]
lokien has joined #ocaml
<lokien> does ocaml have something like Num type?
<flux> maybe.. it's called Num
<reynir> There's also zarith which is faster
<lokien> thanks! I was worried I have to create separate functions for int, int32, int64 etc
<flux> well, you still may :).
<lokien> oh. :(
struk|desk|away is now known as struk|desk
govg_ has quit [Quit: leaving]
govg has joined #ocaml
<lokien> no parallelism, stupid types. why, ocaml, why
<flux> functors may be applicaple to your actual problem, maybe :)
<flux> lokien, there actually may be advancements to be expected in both fronts.. but remains to be seen :)
<lokien> I mean.. everything was so generic when I was writing haskell, in ocaml everything is so.. specialised
<flux> I can certainly agree with that. but, most of the time it doesn't bother me :)
<flux> if you have a need to write a generalized algorithm that works with most any integer types, you can use the Int*-modules from ie. Batteries and parametrize your module by those modules
<flux> and with 4.03 that might actually be performing nicely
<lokien> what about parallelism? I'd actually asked here some time ago, but people remained silent
<flux> well, there is the ocaml multicore branch, and actually just recently there was a short presentation on its state: https://speakerdeck.com/kayceesrk/concurrent-and-multicore-ocaml-a-deep-dive
<flux> I think the interesting thing about that is that it's not going to be 'just' multicore ocaml with bad GC contention, but an approach a bit similar to Erlang with fibers on each core - but still allowing sharing of mutable data
<flux> though I don't think that particular presentation goes into that level of detail, rather covers only the algebraic effects that makes the thing tick
<flux> this is a more low-level treatment: http://www.cl.cam.ac.uk/~sd601/papers/multicore_slides.pdf
<flux> apparently an alpha release of that should be release shortly after ocaml 4.03 is released maybe this month
<lokien> looks promising. I think I can let myself go into it
<lokien> thanks a lot, flux :)
<flux> no problem, happy to advocate 8-)
<flux> lokien, so what brings you into developing ocaml? curiosity?
Algebr`` has joined #ocaml
<lokien> flux: I'm looking for a functional language that I can write my stuff in
<flux> :)
<lokien> ocaml looks so cool, too bad community is so small
<flux> what kind of stuff do you write?
<lokien> but it's a quality community, so I can go with that :)
<lokien> I'm aspiring to write 2d/2.5d games
<flux> oh! many moons ago I wrote a game in OCaml. I should probably refresh it to compile nowadays.. https://modeemi.fi/~flux/goba/
ggole has joined #ocaml
<flux> but I'm not much of a graphics guy or ux designer.. ;)
<lokien> me neither :D
<flux> I really should upgrade that to either a game engine or opengl
<flux> ..maybe even give js_of_ocaml a thought
Algebr`` has quit [Ping timeout: 264 seconds]
<lokien> I'd use opengl, it's a lot to learn though
<lokien> how much time I have to spend on ocaml to be able to do any practical application?
<lokien> let's measure it in microhaskells
<flux> :). I think that's going to be widly difficult to estimate..
<lokien> and python is one microhaskell
<flux> what is a practical application?
<lokien> anything useful. let's say.. I want to count words in a text file, and then print percentages of n-letter words present in this text
<flux> maybe an hour? there are enough resources to google information for that I think, given you have experience on other functional languages :)
<flux> I would recommend reading through the shortish but to-the-point ocaml manual, but that might take that hour ;)
<flux> there are also other introductory materials. but I think the most important thing about learning a new language is not knowing all the specifics, but have a big picture of what you know and what you don't know (yet). this will make it easier to look for solutions to problems you face :)
<lokien> an hour? really? :D
<lokien> I'm going through real world ocaml
<flux> difficult to say, I've been with ocaml for a while :)
ontologiae has joined #ocaml
<lokien> I was looking for a crash course, but hadn't found any
<flux> I think the ocaml manual is good, but doesn't go into practical examples, because basically for (more) practical applications you need some modules that don't come with ocaml
<flux> there is the RWO, then there is Jason Hickey's http://courses.cms.caltech.edu/cs134/cs134b/book.pdf which was never released I think
<lokien> I've heard real world ocaml's ocaml is "janestreet ocaml", which is better than standard one
<lokien> (I suppose)
<flux> there are basically two big alternatives for extending the standard library: Jane Street Core, Batteries, and if you want something lean'n mean, companion_cube's containers
<flux> I haven't actually used Core, but I understand Batteries is better documented and more similar to the ocaml standard library than Core
<flux> but on the other hand Core makes a clean? break from some of the maybe non-optimal choices of the ocaml stdlib
<lokien> what do you use then?
<flux> most of the time Batteries and/or Containers.
<flux> one can cherrypick modules :)
<lokien> batteries is two years old, isn't that a problem?
<flux> as long as they can communicate with the standard building blocks, so functions, modules and lists
<flux> batteries doesn't really bring in that many things that have an expiration date
<flux> I forgot to mention one important one: ocamlnet
<flux> it has a lot of real-world protocols and interaction implemented
<flux> and, of course, for nodejs-kind concurrency there is Lwt (and Jane Street's Async)
<flux> well it's better than nodejs due to monadic binding and syntax candy ;-)
<flux> (and the static type system)
<lokien> well, now I don't know if I want to read that book anymore :D
ygrek has quit [Ping timeout: 260 seconds]
<flux> sorry :)
<lokien> no problem, I'll take a look at the ocaml cheatsheet
<flux> lokien, btw, what editor do you use?
<lokien> flux: vim with merlin
<lokien> nvim, to be specific
Jamazia has joined #ocaml
Jamazia has joined #ocaml
Jamazia has quit [Max SendQ exceeded]
Jamazia has joined #ocaml
Jamazia has quit [Excess Flood]
lopex has joined #ocaml
Jamazia has joined #ocaml
Jamazia has quit [Max SendQ exceeded]
seangrove has joined #ocaml
<flux> lokien, well, good thing you're using merlin then :)
<lokien> flux: why? I was struggling with it yesterday :D
<flux> well, I find the ability to find an expression's type is essential
<flux> plus the ability to find where a value is defined is nice
Jamazia has joined #ocaml
Jamazia has quit [Max SendQ exceeded]
Jamazia has joined #ocaml
Jamazia has quit [Excess Flood]
Jamazia has joined #ocaml
Jamazia has quit [Excess Flood]
<lokien> oh, yeah, it's great. starting out is a bit painful, but not too much
reynir has joined #ocaml
Jamazia has joined #ocaml
Jamazia has quit [Excess Flood]
Jamazia has joined #ocaml
Jamazia has quit [Excess Flood]
Jamazia has joined #ocaml
Jamazia has quit [Excess Flood]
Jamazia has joined #ocaml
Jamazia has quit [Excess Flood]
seangrove has quit [Ping timeout: 265 seconds]
jwatzman|work has joined #ocaml
sillyotter has joined #ocaml
ygrek has joined #ocaml
yawnt has joined #ocaml
yawnt has quit [Changing host]
yawnt has joined #ocaml
_andre has joined #ocaml
Algebr`` has joined #ocaml
rwmjones_ is now known as rwmjones
sillyotter has quit [Quit: leaving]
k1000 has quit [Ping timeout: 240 seconds]
struk|desk is now known as struk|desk|away
ontologiae has quit [Ping timeout: 272 seconds]
k1000 has joined #ocaml
92AACA2DB has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
kakadu has joined #ocaml
Algebr`` has quit [Ping timeout: 250 seconds]
silver has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
ontologiae has joined #ocaml
92AACA2DB has quit [*.net *.split]
mj12` has joined #ocaml
Haudegen has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
yawnt has quit [Ping timeout: 240 seconds]
Algebr`` has joined #ocaml
seangrove has joined #ocaml
<lokien> how to sum elements in a list? List.sum [1;2;3] doesn't work :(
lokien_ has joined #ocaml
lokien has quit [Remote host closed the connection]
Jane-PC has joined #ocaml
<kakadu> fold_left (+) 0
seangrove has quit [Ping timeout: 245 seconds]
virtualeyes has joined #ocaml
<lokien_> oh, right! stupid clojure, making me forget every functional abstraction. thank you Kakadu
lokien has joined #ocaml
<lokien> it doesn't work though. "Unbound value fold_left"
<lokien> is that because I'm using core?
<rks`> List.fo.
<lokien> right.
ggole_ has joined #ocaml
ggole has quit [Ping timeout: 250 seconds]
JacobEdelman has joined #ocaml
shinnya has joined #ocaml
<Jane-PC> Hi
<lokien> hello
<Jane-PC> I'm writing a "More or less" game
<Jane-PC> without using ref
<Jane-PC> and I'm stuck with one functionnality
<Jane-PC> which is an attempts counter
<Jane-PC> I tried many things, but can't figure out how to write it only with functions and no ref.
<Jane-PC> Here is my code: http://pastebin.com/70XsVBDU
<kakadu> rewrite while with custom recursive function
<lokien> local binding within your recuri- oh, you don't use recursion. welp, I don't know
<kakadu> it will take as parameter then things which you want to store in mutable fields
<kakadu> s/then/the/
<Jane-PC> yep' I tried with rec function
Algebr`` has quit [Ping timeout: 250 seconds]
<Jane-PC> but didn't know how to implements it
<lokien> Kakadu: tabs or spaces?
<Jane-PC> Kakadu: yep but with a rec function, I'll have to do something like if match count None attempts etc.
<kakadu> I don't see a problem
<Jane-PC> It didn't work when I tried to test if attempts was None
sepp2k has joined #ocaml
<Jane-PC> It says: line 38 Error: This expression has type 'a option
<Jane-PC> but an expression was expected of type int
<kakadu> | Some n -> n + 1
<Jane-PC> Ah thx
<Jane-PC> I tried: | Some -> n + 1
<Jane-PC> I get it
zpe_ has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
kansi has joined #ocaml
yawnt has joined #ocaml
<kakadu> Oh, this js_of_ocaml
<kakadu> TypeError: fun_Ys_ is undefined.
Jane-PC has quit [Quit: Leaving]
yawnt has quit [Changing host]
yawnt has joined #ocaml
zpe has joined #ocaml
zpe_ has quit [Ping timeout: 240 seconds]
lokien has quit [Quit: Leaving]
BitPuffin has joined #ocaml
Algebr`` has joined #ocaml
cnu- has quit [Ping timeout: 240 seconds]
cnu- has joined #ocaml
Algebr`` has quit [Ping timeout: 240 seconds]
seangrove has joined #ocaml
zpe_ has joined #ocaml
zpe has quit [Ping timeout: 248 seconds]
seangrove has quit [Ping timeout: 248 seconds]
igstan has joined #ocaml
pierpa has joined #ocaml
aantron has joined #ocaml
julien has joined #ocaml
julien is now known as Guest20892
Algebr`` has joined #ocaml
struk|desk|away is now known as struk|desk
hcarty has joined #ocaml
<aantron> Drup: http://ocsigen.org/js_of_ocaml/2.7/api/Worker: what's with the "???": class type ???worker = object..end
<Drup> I am not sure ..
<Drup> bug report ? ^^'
Algebr`` has quit [Ping timeout: 240 seconds]
<pierpa> how's possible that if I substitute a function with another one with the same type the file does not typecheck anymore! any hint? (I know you don't have enough information :)
struk|desk is now known as struk|desk|away
<ggole_> pierpa: maybe the types only look the same
ananas_ has joined #ocaml
<pierpa> I think this is impossible. Still puzzled.
<ggole_> Variance is implicit, for example
<ggole_> Or if you are going by annotations, a variable might be being constrained more than you expect
<pierpa> hmmm
<ggole_> Or (in the toplevel) there are references to different types of the same name
<pierpa> actually, I'm not using types in any sophisticated way.
<ggole_> Mmm. Well, as you point out it's hard to answer more specifically.
<Drup> [information needed]
<pierpa> yes, I know :)
<ananas_> Hello, dear ocaml users. I have been playing with recursive modules and classes, and now I have an error I don't understand :( I've stripped down the buggy code to something useless, but the error is still there, and I don't understand it. Would someone help me ? http://pastebin.com/Unirq9Jp
<pierpa> here's my code. It's self-contained. As it is it doesn't typecheck. If I remove the function read_delimited_list and insert in its place the commented version following it does typecheck. As far as I can tell the two version os the function have the same type. Hint? https://bpaste.net/show/616b24781229
FreeBird_ has quit [Ping timeout: 240 seconds]
<ggole_> Hmm.
<pierpa> :)
<ggole_> This clearly has none of the problems I described, for a start.
<pierpa> yes, it's too simple for shadowing
govg has quit [Ping timeout: 240 seconds]
<pierpa> I suspect a silly syntax mistake that makes the compiler parse it as something completely different than intended :)
<ggole_> Adding annotations doesn't help...
* ggole_ scratches head
* pierpa tried annotating...
<ananas_> (sorry, the link I gave is wrong, you can use http://pastebin.com/daK5xgm4)
<aantron> to debug such cases you can create a module with one entry, constrained by a module type with the type you expect, and define the entry by setting it equal to the function
<pierpa> ananas_: the first link worked. this second one doesn't
<ggole_> Hmm, I suspect that the problem is the monomorphic typing of let rec
<ggole_> (Since both the problematic definitions are within the same let rec, and I can't see anything else it could be.)
<ggole_> Damn if I can see why though.. lemme poke at it a bit more.
<pierpa> hmmm
<ggole_> Ah, I think I see it
<ggole_> Annotate read with the return type squexpr
<pierpa> the correct type of read_delimited_list hsould be in_stream -> char -> squexpr list. And indeed in both case the type reported by tuareg is correct
<pierpa> let me try...
<aantron> does read produce a list or a single token?
struk|desk|away is now known as struk|desk
<pierpa> a single squexpr
<aantron> perhaps you are forgetting to prepend it to the accumulator in read_delimited_list?
<aantron> on 198
<pierpa> yes, maybe that is it!
<pierpa> YES!
<aantron> i saw this from step10 and make_token
seangrove has joined #ocaml
<pierpa> ty ggole_ and aantron
<aantron> btw, out of curiosity, what was the actual type error? the compiler propagates type errors to weird places when using mutually-recursive functions sometimes
<Drup> ananas_: I'm honestly surprised this is a well defined recursive module (as in, it doesn't fail at runtime ...)
<pierpa> it complained that read had type squexrp but it expected squexpr list
<aantron> ok, thanks
<pierpa> now it's kind of understandable, but it stumped me for a lot of time
<ggole_> A single let rec with many bindings can make it a bit hard
<aantron> yeah, im guessing without mutual recursion it would have told you the error was on line 198
<aantron> or at least somewhere in read_delimited_list
<Drup> ananas_: I think the cullprint is that the argument of Make_b and Make_a are related (Modb.A = Moda). You only mark the output.
<pierpa> also, tuareg (C-c C-t) reports the correct type even with the mistake...
<aantron> the correct type for what?
<pierpa> for read_delimited_list
seangrove has quit [Ping timeout: 250 seconds]
<flux> tuareg mode bases its information on data collected by the compiler
<flux> maybe if you can't compile it, it doesn't get the new failed information? though I think it should then just not get any info..
<flux> merlin is able to extract code from just saved code
<flux> extract types that is
<pierpa> in the version with the mistake, I compile with -annot, then with cursor over read_delimited_list C-c C-t gives the correct type
<ggole_> Merlin reports the same type
<aantron> well presumably the annotation file wasnt emitted from a failed compilation, so you are using an out-of-date one?
<ggole_> But this isn't unexpected, since its type is constrained by its uses within the bodies of the let rec bound definitions
<pierpa> aantron: maybe. I should do further testing
<aantron> i actually dont use these so i dont know. but would be curious to know
<pierpa> I'll ivestigate and report :)
<pierpa> +n
<ananas_> I don't understand why it works with "type c = int" and not "type c" nor with "type d = {value: int}"
<pierpa> aantron: no, even with the compilation failing because of type errors, the .annot file is generated
<aantron> ok, thanks
<aantron> but to agree with flux, the compiler does at least implicitly know the type of read_delimited_list, certainly its subexpressions, and also of read - thats why it is able to show you this type error
<Drup> ananas_: because A.c = A'.c for any module A answering MODA if the type is not abstract
<pierpa> hmmm
Haudegen has quit [Ping timeout: 245 seconds]
<Drup> this is not true anymore if c is abstract
<Drup> similar deal for type d
<ananas_> Ok, I understand. Thanks :-)
<pierpa> so, now it's working: ==> '(a b c)
<pierpa> (quote (a b c))
<Drup> ananas_: if you do this, it types, but you will get other issues:
<Drup> module type MAKE_A = functor (Modb:MODB) -> MODA
<Drup> with type b = Modb.b and type c = Modb.Moda.c
<aantron> grats :)
govg has joined #ocaml
<ggole_> pierpa: are you going to write a full Common Lisp?
struktured has quit [Ping timeout: 265 seconds]
lokien has joined #ocaml
<pierpa> ggole_: no. An as simple as possible microlanguage for writing configuration files, dumping data and the like
<pierpa> I'm using the CL reader as a model because that's what I'm familiar with, and to exchange data easily with lisp
<ggole_> Ah, I see
Simn has quit [Ping timeout: 240 seconds]
Algebr`` has joined #ocaml
Guest20892 has quit [Ping timeout: 245 seconds]
Algebr`` has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
Guest38 has joined #ocaml
struk|desk is now known as struk|desk|away
copy` has joined #ocaml
Simn has joined #ocaml
aantron_ has joined #ocaml
zpe_ has quit [Remote host closed the connection]
nicoo has joined #ocaml
aantron has quit [Ping timeout: 256 seconds]
Mercuria1Alchemi has joined #ocaml
slash^ has joined #ocaml
igstan has quit [Quit: igstan]
Stalkr has joined #ocaml
dsheets has joined #ocaml
jtmcf_ is now known as jtmcf
exm has left #ocaml [#ocaml]
Haudegen has joined #ocaml
sz0 has joined #ocaml
aantron_ has quit [Remote host closed the connection]
Algebr`` has joined #ocaml
kakadu has quit [Quit: Page closed]
ananas_ has quit [Quit: Page closed]
govg has quit [Ping timeout: 264 seconds]
seangrove has joined #ocaml
itaris has joined #ocaml
govg has joined #ocaml
itaris has quit [Client Quit]
groovy2shoes has joined #ocaml
cyraxjoe has quit [Ping timeout: 276 seconds]
hcarty has quit [Quit: WeeChat 1.4]
cyraxjoe has joined #ocaml
yawnt has quit [Ping timeout: 260 seconds]
Stalkr has quit [Read error: Connection reset by peer]
lokien has quit [Quit: Leaving]
lokien_ has quit [Quit: Connection closed for inactivity]
exm has joined #ocaml
govg has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
dsheets has quit [Ping timeout: 245 seconds]
psy_ has joined #ocaml
Algebr`` has quit [Ping timeout: 250 seconds]
dsheets has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
<sigjuice> Can someone please help me understand https://realworldocaml.org/v1/en/html/records.html#first-class-fields ?
<sigjuice> The book says "Field.get Logon.Fields.user" returns Logon.t -> string = <fun>, but when I try it myself, I get "Logon.t -> bytes = <fun>"
<sigjuice> why do I see bytes instead of string and what does it mean?
aantron has joined #ocaml
<foolishmonkey> things have evolved
<foolishmonkey> string are split in two types now, bytes and string
<foolishmonkey> bytes are an "array" of bytes and can be modified, string are an "array" of chars and are immutable
kakadu has joined #ocaml
segmond has quit [Ping timeout: 240 seconds]
<sigjuice> foolishmonkey: thanks! Is this specific to the Core library?
<foolishmonkey> I dunno what is core library. If you mean the equivalent of stdlib (default lib coming with OCaml), yes the stdlib has changed
<foolishmonkey> But don't worry it happens only once every ten years.
psy_ has quit [Quit: Leaving]
Mirry has joined #ocaml
nicoo has quit [Quit: WeeChat 1.3]
Mirry has left #ocaml [#ocaml]
<seangrove> So I'm interested in building a toy db - I have three columns that are predefined data types, and there's one that I want the user of my toy db to parameterize so they can configure what kinds of values live in the db
<seangrove> So first question is, how do I make my data type openly extensible by users, and the second is, how do I then ensure that my db is always de/serializable into exactly the same data structure?
larhat1 has joined #ocaml
exm has left #ocaml [#ocaml]
<sigjuice> foolishmonkey : IMHO changing something from immutable to mutable is quite a significant change
<aantron> seangrove: is this db going to be used by the user as a library?
<foolishmonkey> sigjuice, sometimes you have to break things
nicoo has joined #ocaml
segmond has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
Anarchos has joined #ocaml
<Anarchos> I have an issue with the tests of oUnit : it uses Filename.temp_file to create a file, and then it strips the filename to get the temporrary dir , which leads to "/tmp"
<Anarchos> But "/tmp" is a link to /boot/cache/tmp on my architecture, which is returned by Sys.getcwd(). So the comparison fails.
phonzbm has joined #ocaml
<Anarchos> It is a test in test/testOUnitBracket.ml
seangrove has quit [Ping timeout: 246 seconds]
phonzbm has quit [Client Quit]
dsheets has quit [Remote host closed the connection]
yawnt has joined #ocaml
jeffmo has joined #ocaml
yawnt has quit [Ping timeout: 256 seconds]
seangrove has joined #ocaml
kushal has quit [Quit: Leaving]
<seangrove> So I'm trying to use `String.Table.create ...`, but I get the error, "Error: Unbound module String.Table". What package am I missing? I come across this problem a lot - trying to use some example code, and I have to spend a lot of time trying to guess the right thing to put in my _oasis and .merlin files
kushal has joined #ocaml
kushal has quit [Changing host]
kushal has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
<ggole_> M.Table is a pattern from Core iirc
<seangrove> ggole_: Yeah, I suspected that since the code is from Janestreet
<seangrove> However, I'm definitely including -package core, and still getting the error
<ggole_> How about Core.String.Table?
<seangrove> ggole_: Good guess, but gets: Error: Unbound module Core.String
<ggole_> Hmm.
<ggole_> Dunno then.
<seangrove> ggole_: Thanks for trying anyway ;)
<copy`> Core.Std.String.Table?
dsheets has joined #ocaml
<aantron> Anarchos: is it possible to not test OUnit? btw, how did it go with getting opam to find packages?
<seangrove> copy`: Yup, that was it! Thanks!
<seangrove> How in the world does one figure this out from just looking at the code?
<aantron> seangrove: what are you looking at?
<aantron> looks like they need to improve the docs :)
<seangrove> aantron: Heh, I think they have much smarter people than me working at JS, so they probably have the context already loaded up, I suppose
<copy`> Usually you `open Core.Std` and then `String.Table` is in scope
<seangrove> copy`: Makes sense, but as a beginner, I'm trying to figure out where everything comes from by being explicit
<aantron> the example should include open Core.Std
<aantron> however
<aantron> trying to verify this, where do i find the String module with submodule Table? https://ocaml.janestreet.com/ocaml-core/108.00.02/doc/core/String.html
<aantron> there is an include, so its not obvious
nicoo has quit [Ping timeout: 248 seconds]
<seangrove> aantron: Yeah, I haven't made it to the Include keyword yet
<aantron> part of this i think is the fault of ocamldoc, ive had to write text when using an include so people could find things
<copy`> seangrove, something that can help you find things is Merlin with its completion
BitPuffin has quit [Read error: Connection reset by peer]
<seangrove> copy`: Yup, merlin + company mode has been fantastic
dsheets has quit [Remote host closed the connection]
nicoo has joined #ocaml
psy_ has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
<seangrove> What should I do to make this more idiomatic/efficient/generally-better? https://gist.github.com/sgrove/6f17988a048f0beed203
<aantron> use structural equality here https://gist.github.com/sgrove/6f17988a048f0beed203#file-odaba-ml-L22 (= not ==)
<aantron> here is physical equality for comparison http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html#VAL(==)
<seangrove> aantron: Thanks - makes sense
<aantron> get rid of the ;; after the type declaration. ;; is only for the interactive top-level. its a curse :)
<ggole_> Rather than build the intermediate list there, you could just populate the table directly conditional on the id being what you want
<aantron> lol @ "fun fact"
<ggole_> It might be a touch nicer to unnest the match in favour of nested patterns, too
<ggole_> But that's nitpicking.
<seangrove> ggole_: Good point about the intermediate structure - that grew organically from refactoring. What's an example of nested patterns?
<aantron> while nitpicking match, i would also recommend prefixing every case with |, even the first one. this allows you to rearrange them easily later, and is easier on the eye in the long term. i eventually switched
<ggole_> Instead of Some x -> match x with A z -> ... | B z -> ..., use Some (A z) -> ... | Some (B z) -> ...
<aantron> Some {v = S x}
<aantron> Some {v = I x}
<aantron> and
<aantron> None
<ggole_> Er, yeah
<aantron> but to be more pedantic, especially if you have all warnings enabled, you would write "Some {v = S x; _}"
<Algebr`> aka directly matching on the record
<ggole_> (I mentally skipped the record.)
<ggole_> Other minor improvements there: you bind a variable only to immediately match on it and never use it again, you could just match on the bound expression
<ggole_> eg, match Core.Std.Hashtbl.find ent key with ...
sternenseemann has joined #ocaml
<ggole_> I also think there is a find_exn variant that would raise an exception for you and avoid the need to match on the option (if you really want that)
dsheets has joined #ocaml
<aantron> let language ent = sf "language" ent <-- these *could* be defined using partial application, but that's a nit, and has a "funny" interaction with polymorphism in other situations
<aantron> but it feels "functional" :p
<seangrove> Heh, awesome, let me touch it all up then
<aantron> more nits, i would avoid formatting like you have for db, because the indentation depends on the length of the name db. if you change it later, you will have to fix all the leading whitespace. if you are collaborating, that will obscure the true author of each line
<aantron> the style for datom is better
<seangrove> aantron: I'm hoping there's some magical ocaml-fmt that's going to fix all that stuff so I never think about it :)
<aantron> there is ocp-indent :)
<ggole_> There's a good indentation tool, but I don't think there's anything for formatting
nicoo has quit [Ping timeout: 248 seconds]
nicoo has joined #ocaml
<seangrove> Ok, think that should cover it all https://gist.github.com/sgrove/6f17988a048f0beed203
<seangrove> It does seem nicer with those changes, lots less intermediate noise - thanks all!
kansi has quit [Ping timeout: 272 seconds]
<aantron> if you compile with -w+9 or -w+A, you will get a warning on your record patterns for not matching all labels. i recommend using Some {v = S x; _} to be explicit, unless you have a good reason not to (e.g. it harms readability due to a huge number of record patterns)
<seangrove> aantron: Is there a way to get e.g. Merlin to warn at that level? I assume I have a lower warning level set
<aantron> in general compile with -w+A and then disable warnings that are counterproductive for your specific project, e.g. -w+A-4
<aantron> unfortunately i dont use Merlin, so im going to have to hope someone else can answer this
<Algebr`> aantron: yes, merlin can take compiler flags
<Algebr`> seangrove: one sec for example
<seangrove> Algebr`: And for oasis if you happen to know off the top of your head :)
<Algebr`> seangrove: put this in merlin file: FLG -w +a-4-40..42-44-45-48
<Algebr`> FLG -w +a-4-40..42-44-45-48
<Algebr`> ah, I should update a blog post for that warning with default.
<seangrove> Algebr`: That's great, got a few warnings that popped up in the buffer with that
yawnt has joined #ocaml
dsheets has quit [Remote host closed the connection]
octachron has joined #ocaml
hunteriam has joined #ocaml
<seangrove> Say I have two types, type tx_dtm = {e: int}, type dtm = {e: int; t = int}; and I want to efficiently convert a tx_dtm to a dtm by adding a t field - what's the best way to do this?
<seangrove> Just construct an entirely new dtm, {e = my_tx_dtm.e; t = 1} ?
srcerer has joined #ocaml
<aantron> i believe thats how you need to do it
<aantron> if you were going the other way you could use the object system (which is polymorphic product types with inheritance and other things), and the wider one would simply be a subtype of the narrower one
<seangrove> aantron: But in that case, wouldn't ocaml complain that some record fields were missing when I instantiated a tx_dtm? That's what seems to be happening right now
lobo has joined #ocaml
_andre has quit [Quit: leaving]
wirrbel has joined #ocaml
<wirrbel> having trouble with the definition sequence of functions in ocaml
<wirrbel> first I defined let rec f = ...
<wirrbel> then let rec g = ....
<wirrbel> now g can call f, but f cannot call g as it seems
<Algebr`> use and
<Algebr`> let rec f _ = .... and g _ =
<seangrove> Somehow OCaml *really* wants the type of txn_dtm to be a datom, not a tx_datom
<Algebr`> i think you might want to write it as let transact (a : datom list) (b : tx_datom list) : datom list =
<Algebr`> and then just List.map ... etc, your logic
teknozulu has joined #ocaml
lokien_ has joined #ocaml
<Drup> seangrove: the internal type annotation is just a tx_datom, not a list
<Drup> (and it's the only type annotation needed)
<seangrove> Drup: Oh yes, thank you
<seangrove> Wow, yup, all the other 6 errors just go away...
<Drup> Yeah, record disambiguation kicks in
<Drup> It's a bit brittle to rely on it for such an extreme case, though
<Drup> you really can't spare the indirection ?
<seangrove> Drup: What indirection?
<seangrove> I'm totally open, it's a toy right now to get a sense of building a proper EAV-oriented datastore in OCaml
<Drup> you could declare "type datom = { tx : tx_datom ; t : int }
<Drup> there is one indirection, but it avoids complication.
<seangrove> Drup: Ah, I see. I'll think about that a bit
<seangrove> It'd probably be fine, yes. I'll hold off on it for now, but plan it for later
<Drup> alternatively, you can do "type datom = { e : int; a : string; v : db_value; t: int option }"
<Drup> also one indirection, but somewhere else :p
<Drup> (and then you remove tx_datom)
ggole_ has quit []
<seangrove> That may be better, I'm not sure - I'll play with both. I like the first suggestion since the type system can help out more and access-sites will be less cumbersome
<Drup> In all cases, you want smart constructors and all that
<seangrove> Heh, OCaml is pretty cool, definitely new angles to think through problems
<Drup> (you should use long fields names too)
<seangrove> I don't have a strong gut feeling about how types end up affecting API usability later
<seangrove> Drup: Becaues of possible name conflicts?
<Drup> because I have no fucking idea what are the fields by looking at the type :D
<Drup> self descripting names, all that² x)
<Anarchos> aantron i resigned to use opam.... i prefer to compile by hand i feel more in control . And yes i could not test oUnit, but i would prefer ounit to pass its own unit tests ;)
<seangrove> Drup: Heh, sure, makes sense
<Drup> seangrove: A type system has two main usages
slash^ has quit [Read error: Connection reset by peer]
<Drup> 1) checking/verifiying things
<Drup> 2) self documentation
<Drup> having mangled field names kinda defeat point 2 :D
<Algebr`> poly variants as result types for 2 is nice.
jeffmo has quit [Quit: jeffmo]
<seangrove> Drup: In this case, the domain is pretty well understood by the people working on it - and there are only four of these fields - entity id, attribute name, attribute value, transaction count
jeffmo has joined #ocaml
<Drup> Algebr`: unfortunately, it tends to weaken 1 a bit (and error messages are terrible)
<seangrove> EAV(T) is a pretty common nomenclature in this domain
yawnt has quit [Ping timeout: 240 seconds]
<Drup> hum, fair enough
<Drup> ("entity", "name", "value", "transaction" though )
<seangrove> Drup: Well, there is autocomplete I suppose, wouldn't hurt too badly to have full names :)
<Drup> and it doesn't use space in the binary file, I promise.
<Drup> :D
<Drup> (well, escape with debug info)
<Drup> except*
<Drup> So, what is eavt ?
<seangrove> Drup: It's a way of structuring data in an (likely immutable) DB
<Drup> ah, it's the entity model as used in video game engines ?
<seangrove> I came across it for the first time in Datomic a few years ago - I really prefer the model for a number of domains. It's what's behind e.g. http://precursorapp.com - makes that sort of thing so much easier
<seangrove> Drup: I'm not sure actually, I've heard of that a lot, and it sounds interesting, but I haven't looked into it too much
<Drup> ok
<Drup> Well, I guess I'll see when you are done :)
<seangrove> It's the biggest missing piece in the OCaml story for me - everything else is pretty awesome (well, documentation, standardized libraries, explicit modules and aliasing, and community size notwithstanding)
<seangrove> But in So, I'm happy if I can contribute a little bit to the community
<Drup> explicit modules ?
<Drup> aliasing ?
<lokien_> hello Drup
<lokien_> are you having a good day?
<seangrove> Drup: I'm used to Clojure's require system, where everything is explicitely listed/fully-qualified or (or aliased at the top of the file), and e.g. OCaml's Open is heavily discouraged.
<Drup> Surprisingly (to me!), there are several people doing databases in ocaml
<seangrove> If you look above I struggled to find where String.Table was coming from because the code example omitted `open Core.Std`
<Drup> Ah, that depends on your coding style though
<Drup> you can not use open and alias things
<Drup> I tend to do that
eni has quit [Ping timeout: 272 seconds]
<Drup> lokien_: hackily.
<seangrove> Drup: I've been doinm e.g. module Opi = Opium.Std
<Drup> yeah
<Drup> this is a common pattern in OCaml
<seangrove> Self-documenting :)
hcarty has joined #ocaml
<lokien_> Drup: well, that's good :D I have a question though.
<lokien_> Drup: how do you write a function with matches? with a function keyword or "match x with"?
<lokien_> or depends?
Jane-PC has joined #ocaml
Jane-PC has quit [Changing host]
Jane-PC has joined #ocaml
<Drup> the shortest ? :D
<lokien_> ew. ocaml is lovely :D
<seangrove> Heh, just lost 10 minutes because of -1 literal
<hannes> hmm, does merlin has a command to list all users of a function?
<Drup> hannes: merlin-iedit
<Drup> + tab
<Drup> well, ok, it doesn't list, but you can circles though them
<hannes> no match..
<nullcatxxx_> oh i need that too
<Drup> it's a separated module, I think
<hannes> M-x merlin-ie<tab> doesn't bring me any results..
<hannes> ah, good to know.. thx
<Drup> put that in your .emacs
<nullcatxxx_> i want to switch to emacs......
<Drup> nullcatxxx_: there is probably a vim equivalent
<nullcatxxx_> i'm searching
<copy`> :MerlinOccurences
<Drup> hannes: side note, if you want to look inside a project, ocp-grep is your friend.
<Drup> it takes a module path and it's open-aware
<nullcatxxx_> oh yeah
<seangrove> Drup: You use evil?
<Drup> No
<Drup> plain emacs
<Drup> well, not plain anymore
<Drup> :p
<seangrove> Ah, saw the 'evil-custom-merlin-iedit ref
<Drup> I'm pretty sure I copied that from def`'s configuration without modifying
<seangrove> Nice function though
eni has joined #ocaml
<Drup> I'm incompetent in elisp
<Drup> x)
octachron has quit [Quit: Leaving]
groovy2shoes has quit [Quit: Leaving]
Jane-PC has quit [Quit: Leaving]
ely-se has joined #ocaml
teknozulu has quit [Ping timeout: 276 seconds]
Mercuria1Alchemi has quit [Ping timeout: 240 seconds]
t4nk964 has joined #ocaml
orbifx has joined #ocaml
<orbifx> hello all
<aantron> Anarchos: yes, of course. but without delving into the source (am a bit occupied at the moment), im guessing ounit wont be able to do temporary directory brackets until it is patched, on your system
<aantron> heya :)
<aantron> ...or you mess with your system
<nullcatxxx_> hello
<Anarchos> aantron i didn't mess : /tmp is a link to /boot/cache/tmp on my OS
<aantron> yeah i understand, i meant if you change that
<aantron> not saying thats a good idea
<aantron> (to change it)
<t4nk964> Dear all, I have a quick question about some OCaml operators. What do @@ and @+ mean? I know @ means list concat in general. Thank you!
<Anarchos> aantron anyway as they are the only two errors i get while unit testing ounit, i think i can get rid of the tests .
<aantron> you can use OUnit's skip_if to skip them
<nullcatxxx_> i don't know @+ ...
<t4nk964> Application operator: g @@ f @@ x is exactly equivalent to g (f (x)). Is this correct, aantron?
<aantron> yes
t4nk964 is now known as caml_hump
seangrove has quit [Ping timeout: 250 seconds]
ldg has joined #ocaml
<caml_hump> nullcatxxx_: for the context, @* is said to perform "complex product". I assume OCaml supports some form of Operator overloading?
<aantron> seangrove: re the types... i am not sure what exactly is happening with your code, what i meant was that you wouldnt be able to widen the record like that in ocaml, but if you were trying to "narrow" a record instead (by viewing it as narrower, not modifying it), you would be able to do it by using a polymorphic record aka object in ocaml. objects are a little more than that though. it was just a note
<caml_hump> aantron: Application operator: g @@ f @@ x is exactly equivalent to g (f (x)). Is this correct?
<aantron> caml_hump: yes it is
<caml_hump> aantron: can it be overloaded or does it always mean application?
<aantron> caml_hump: and no. OCaml does not support operator overloading. however, you can define operators with the same names in a module, then open that module to shadow existing operators
<aantron> this is considered questionable by many people, however. but it can be appropriate
<aantron> it can be redefined (shadowed)
<aantron> in fact its a relatively recent addition to OCaml so perhaps some people had it defined to do something else in their projects
<caml_hump> aantron: Got it. That's very helpful. I'm trying to understand a famous example of OCaml in practice: genfft in FFTW3. From what I saw, the authors have shadowed some operators for (complex) arithmetic over lists.
<aantron> its very likely. cant look at the moment, but given what it is, i wouldnt be surprised
<Anarchos> aantron @@ existed for years in the compiler source as (++) but it became so popular amongst the developers that they put it in standard lib, if my history is correct.
<aantron> ah. i mostly use it when i want to negate a condition when editing code. much easier to prepend "not @@" than to go to the end to put a parenthesis :)
<Anarchos> aantron clever trick :)
<Drup> Anarchos: Not really, no. It become so popular in external libraries that it was finally added because it annoyed other people
<Anarchos> Drup oh ok.
<Drup> Anarchos: if that was the reason, we would have an option module too
<caml_hump> aantron: a quick grep confirmed that "let (@*) = times", where "times" is a complex mult. Thanks.
* Anarchos just modified bisect_ppx to compile with 4.0.3
<aantron> caml_hump: cool, you're welcome :)
<aantron> Anarchos: what did you have to do?
seangrove has joined #ocaml
<Anarchos> aantron modified some syntax related to Parsetree.constant, and change an uppercase for uppercase_ascii
<Anarchos> i am running the bisect_ppx tests now.
<aantron> Anarchos: would you be kind of enough to do a PR? bisect_ppx has changed a LOT, including, especially, the tests, so i recommend the development version, if you are up for that
<aantron> we are hoping to release soon, tomorrow or within the week
<Anarchos> aantron i got the git version
<aantron> ok, cool
<aantron> have to step out, bbl
<aantron> good luck :)
<Anarchos> how to do a PR ?
darkf has quit [Quit: Leaving]
<caml_hump> Sorry about this newb question, but is there a "smart load" in the OCaml top-level that can load many source files automatically following the order of dependency?
damason has quit [Ping timeout: 245 seconds]
ygrek_ has joined #ocaml
Madars has quit [Quit: Leaving.]
<hcarty> caml_hump: I don't think that there is for source files. #load_rec will try once they're compiled.
ygrek has quit [Ping timeout: 265 seconds]
j_king has quit [Ping timeout: 276 seconds]
j_king has joined #ocaml
seangrove has quit [Ping timeout: 240 seconds]
<caml_hump> hcarty: Thank you.
teknozulu has joined #ocaml
<Anarchos> aantron the only differences i got with bisect_ppx tests reference and my own testes, are blanks.
Madars has joined #ocaml
<wirrbel> is there a way to skip ocaml code of superfluous brackets?
Simn has quit [Quit: Leaving]
<wirrbel> I am not very versed in operator hierarchy and thus would like a tool to rip of the brackets I typed, that are not needed
<ely-se> type system design is fun
<Drup> wirrbel: which brackets ?
<Drup> ah, you mean parens ?
<Anarchos> wirrbel #show myfun ?
<Drup> wirrbel: we don't have such tools, it would be nice
<wirrbel> hmm, it seems like I have to learn the hierarchy then
<wirrbel> :(
<wirrbel> #show myfun only shows the signature I think
mac10688 has joined #ocaml
mac10688_ has joined #ocaml
Anarchos has quit [Remote host closed the connection]
exm has joined #ocaml
Mirry has joined #ocaml
Mirry has quit [Client Quit]
<caml_hump> Hi, is there a way to use ocamlbuild to to produce .native files but also generate cmo files at the same time?
<caml_hump> Nevermind :D
damason has joined #ocaml
seangrove has joined #ocaml
<aantron> Anarchos: not sure what you mean by differences and blanks
hcarty has quit [Quit: WeeChat 1.4]
<nullcatxxx_> is there any solution to his problem?
damason_afk has joined #ocaml
<aantron> havent verified it but this may do it, http://batteries.forge.ocamlcore.org/doc.preview:batteries-beta1/html/api/Date.html. does presumably throw exceptions
<aantron> im guessing this person already saw that, though..
<seangrove> Couldn't they just wrap that fun though? let my_parse_date = with handlers ... Exception -> None ?
<Drup> aantron: this version of batteries is so old it's not even in opam :3
<aantron> seangrove: yes, dont know why they dont
<aantron> Drup: oops, just did a google search and found that :)
<Drup> calendar is the default "date and time" library in ocaml
<Drup> It's not pretty, but it implements a lot of the handling that you don't want to implement
<Drup> oh, I just noticed the "no exception" clause in the tweet ..
<Drup> I don't disagree it's better, but still, that's a trivial fix ..
pierpa has quit [Read error: Connection reset by peer]
pierpa has joined #ocaml
sepp2k has quit [Quit: Leaving.]
<caml_hump> Sorry to interrupt. I'm able to compile and run the native executable with the OCaml source code, but when I try to #load_rec the corresponding obj file, I got "The files genutil.cmo and /usr/bin/ocaml disagree over interface Complex"
<caml_hump> I followed the suggestion here: http://stackoverflow.com/questions/9166489/inconsistent-assumptions-over-interface-ocaml. I cleaned and recompiled everything, but the problem is still there.
<caml_hump> I know for sure that "genutil.cmo" has its own Complex. How can I resolve this conflict when I load it in the top-level?
lokien_ has quit [Quit: Connection closed for inactivity]
<aantron> caml_hump: i really dont know, but if i was stuck at this, i would be looking at ocamlmktop. perhaps that can be handled correctly by going that route
<caml_hump> aantron: Thank you! will do.
<aantron> never had to do this though, so i would be curious how it goes
<aantron> im guessing it wont work based on the man page, but worth trying
<caml_hump> aantron: with my very limited knowledge on OCaml, if I ever redefine an existing type or operator in my code, wouldn't I always run into a conflict like the one I just described?
lobo has quit [Quit: leaving]
<aantron> no, this concerns top-level modules, i.e. compilation units, with the same name, but different interfaces (actually interface checksums)
<aantron> so if you have two modules named Foo (could be one that changed over time, but old one is still linked in)
<aantron> then if both are still references by the objects being linked, you will get this
<aantron> its only related to redefinition inside the syntax of OCaml because OCaml top-level modules are related to filenames. otherwise its a purely tool problem
<Drup> If there is a "complex.ml" inside whatever genutils is, that would explain the issue
<Drup> but I doubt *anyone* would redefine a module from the standard library ...
<caml_hump> Drup: you are exactly on the point
<aantron> maybe someone should yell at the fftw3 people
<caml_hump> Drup: the "genfft" shipped with FFTWs contains a "complex.ml"...
tane has quit [Quit: Verlassend]
<caml_hump> aantron: I'll ping the FFTW3 people. Right now, their codes compile and run as expected. But I just cannot load them and trace any of their functions.
Guest70_ has joined #ocaml
<Drup> I'm ... surprise it even works
<aantron> right, since they are not thinking of this as a library, i think they etiher havent run into this problem or dont see the need to address it
<aantron> Drup: this works, i did it before i learned, its just a bad idea :)
<Drup> caml_hump: my advise would be to fix fftw
<aantron> agreed
<Drup> It's basically just renaming
<Drup> sed s/Complex/FFTWComplex/
<caml_hump> Drup: I skimmed through the output of ocamlbuild. There's no error produced from the said conflict.
<caml_hump> Drup, aantron: I agree too.
<Drup> mv complex.ml FFTWComplex.ml
<Drup> and you are done
<aantron> caml_hump: the only way their own project would have an error is if they had some of their .ml files linking against standard library Complex, and some against their own complex.ml
<aantron> presumably since they include their own complex.ml in the search path, this never happens.. for them
<caml_hump> aantron: I see. yeah, pretty sure they don't have to do that.
<Drup> seeing all the other name in the directory, you might want to use pack
<aantron> yeah, they just use their own Complex for all needs
<aantron> Drup: i think this source is for a binary, so it might not be worth the build complications for them. but for a library, yeah
<Drup> well, caml_hump seems to want to use it as a library
<aantron> i think its just for examining interactively in the top level
<Drup> there is no difference.
<aantron> well except for maintainer work
<aantron> i mean
<aantron> the payoff from it
<Drup> using pack with ocamlbuild is not very complicated
<Drup> (I understand what you are saying, I'm just telling caml_hump that it should be relatively easy to make it all work out ;)
<aantron> Drup: i agree either way :) pack is easy, but there might be extra pushback on the pull request if attempted :)
<Drup> It would affect only the library, so it's fine
<aantron> caml_hump: to go back to your previous concern, this link error can only happen with "file-level shadowing" (made that up), which is what genfft is doing
<aantron> so shadow away as long as you dont shadow a filename
<caml_hump> aantron: Drup : I tried the search/replace approach just now. there's more conflicts during compile. But I think I'll be able to get it to work.
<caml_hump> aantron: Drup : as long as I can trace their functions, I'll be able to work on what I really wanted to do: extending their functionalities.
<caml_hump> aantron: Drup: your suggestions have been very helpful. Thank you so much for your time!
<aantron> caml_hump: good luck :)
mac10688 has quit [Remote host closed the connection]
mac10688_ has quit [Remote host closed the connection]
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
caml_hump has quit [Ping timeout: 252 seconds]
mrm has joined #ocaml
infinity0 has quit [Remote host closed the connection]
orbifx has quit [Ping timeout: 250 seconds]