ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.1 announcement at http://ocaml.org/releases/4.02.html | Public channel logs at http://irclog.whitequark.org/ocaml
<companion_cube> anyway, I was never really convinced by XMPP
<Drup> considering the amount of people on freenode, you are not the only one :D
<companion_cube> the worst problem of IRC, netsplits, might be solved by matrix.org :p
Hannibal_Smith has quit [Quit: Leaving]
<Drup> well, that's solved by xmpp too x)
<companion_cube> if it's no longer than 5 minutes, is that it?
<Drup> no, that's for client to server connection
<companion_cube> oh.
<Drup> netsplits happens because IRC servers are connected as a tree, and when something break in the tree, it partitions the graph.
<companion_cube> what if the server gets separated from other servers?
<Drup> xmpp servers do not work like that
<Drup> well, the one separated is out, and the other keep communicating like they did before *shrug*
<Drup> netsplit entirely happen because horizontal scaling for IRC is a huge crappy hack
AltGr has joined #ocaml
<companion_cube> what do you mean, XMPP prevents servers from being separated by network failures?
<Drup> well, only the one that fails is out
<companion_cube> that's still a problem
<companion_cube> after the split, it should be able to recover what was said on the other side
<Drup> yeah, it does not, but at least not the entire network is broken because of one server
<companion_cube> that's still not enough
<sdegutis> thanks yall
<sdegutis> i may try ocaml again
<emias> Er. XMPP's group chat feature solves the netsplit issue in the most elegant way you could imagine. It's a single-server model.
<emias> But for 1:1 chat, so far I don't see anything better in practice, and I don't think occasional server outages are an actual problem (just as they are not for email).
<emias> But yes, Matrix might be it
<companion_cube> I just like the idea, it looks a bit like git
<emias> Yup.
<Drup> I wish people would emulate darcs instead of git :<
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
contempt has quit [Ping timeout: 252 seconds]
travisbrady has quit [Quit: travisbrady]
contempt has joined #ocaml
shinnya has quit [Ping timeout: 255 seconds]
<sdegutis> Quick question:
<sdegutis> What's the best book (doesn't have to be free) for learning OCaml, for someone who is not a newb?
<sdegutis> /cc Drup companion_cube
<sdegutis> et al.
raphaelss has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
<Drup> I don't know, sorry, I don't usually read book about programming because I find it's a terrible way to learn :)
<sdegutis> hmm
antkong has joined #ocaml
travisbrady has joined #ocaml
<sdegutis> Drup: how would you recommend learning OCaml for someone who is competent at both programming and FP, to learn it in an efficient way?
yminsky has joined #ocaml
<darnuria> sdegutis: There is Real-world Ocaml. But becarefull since it's a good book some experrience of this book is very related of the concept of Core an alternative STD.
<darnuria> Drup: I'am not agree reading book is great.
<darnuria> Drup: but only the good one ;p
<sdegutis> darnuria: what?
<darnuria> (not a prof)
<darnuria> (proof*)
<Drup> sdegutis: programming?
<Drup> do things, show them to other people, adapt when they say it's crap.
<Drup> darnuria: he knows, he doesn't like it =')
<darnuria> Oh.
<sdegutis> Drup: what?
<sdegutis> oh
<sdegutis> i see
<sdegutis> Drup: reasonable approach.
<darnuria> I found it good quiet "Core" related but well written for a student.
<sdegutis> but more time-consuming than im hoping for
<darnuria> (as am I) :)
contempt has quit [Ping timeout: 245 seconds]
jao has quit [Ping timeout: 264 seconds]
yminsky has quit [Quit: yminsky]
yminsky has joined #ocaml
<Drup> sdegutis: also, climb hills before mountains
yminsky has quit [Client Quit]
rgrinberg has joined #ocaml
* mcc has been getting into ocaml since november and the real world ocaml book is by far the clearest source of learning materials i've found.
<mcc> I am not using Core and I have not found the focus on Core to be a problem.
<mcc> This said, I had prior experience with SML
contempt has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
<sdegutis> Drup: wat
<sdegutis> mcclurmc_: ok
<sdegutis> mcc: ok i mean
sdegutis has quit [Quit: Leaving...]
Sorella has quit [Quit: Connection closed for inactivity]
reem has quit [Remote host closed the connection]
psy__ has quit [Quit: Leaving]
rgrinberg has joined #ocaml
yminsky has joined #ocaml
yminsky has quit [Client Quit]
reem has joined #ocaml
<darnuria> mcc: The focus on core is not a problem it's clean. But this focus is also interresting :)
antkong has quit [Quit: antkong]
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
bobry has quit [Quit: Connection closed for inactivity]
reem has quit [Remote host closed the connection]
reem has joined #ocaml
badkins has quit []
nullcat_ has quit [Ping timeout: 252 seconds]
antkong has joined #ocaml
darkf has joined #ocaml
c74d has quit [Ping timeout: 265 seconds]
ygrek has joined #ocaml
yminsky has joined #ocaml
yminsky has quit [Client Quit]
rgrinberg has quit [Quit: Leaving.]
c74d has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
q66 has quit [Quit: Leaving]
c74d has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
manizzle has quit [Ping timeout: 265 seconds]
travisbrady has quit [Quit: travisbrady]
MooseAndCaml_ has joined #ocaml
<MooseAndCaml_> When using pipes |> do you all have your own (fun f x y -> f y x) operators in use as regular practice?
c74d has joined #ocaml
<Drup> don't use flip
<Drup> (please)
<Drup> it makes code really hard to read
<MooseAndCaml_> I need to curry an int into an list -> int What is a better way to approach it? break it on to a new line?
<Drup> curry an int into an list -> int ? :D
<tcpc> 123 -> [1;2;3] i suppose
<tcpc> (ah yeah, list -> int is weird :D)
<Drup> and that has nothing to do with currying :p
<tcpc> ye :d
<MooseAndCaml_> what does that look like?
<Drup> MooseAndCaml_: I don't understand what you want, so I don't know.
travisbrady has joined #ocaml
<MooseAndCaml_> I have a list passing through a pipe |> at the last transformation the functions input interface has f [] int? Would it be like: let flp = (fun x y -> y x) x
<MooseAndCaml_> and then let b = foo flp
welterde has joined #ocaml
|jbrown| has quit [Ping timeout: 250 seconds]
ghostpl_ has quit [Remote host closed the connection]
<Drup> my_list |> fun x -> f x 3
<Drup> don't use flip
|jbrown| has joined #ocaml
<MooseAndCaml_> I get it, that makes sense... I solemnly swear to not flip :)
<tcpc> :p
<Drup> (if for educational purposes, "let flip f x y = f y x"
<Drup> )
<Drup> (and then it would be "my_list |> flip f")
badon has quit [Quit: Leaving]
<Drup> MooseAndCaml_: https://wiki.haskell.org/Pointfree ;)
<MooseAndCaml_> I remember that from days tinkering with haskell. It's make the code very approachable at the expense of being a little less comprehensible from my limited experience.
<Drup> "a little less comprehensible" :D
AltGr has left #ocaml [#ocaml]
c74d is now known as Guest69891
Guest69891 has quit [Ping timeout: 265 seconds]
c74d3 has joined #ocaml
MooseAndCaml has quit [Quit: Page closed]
AltGr has joined #ocaml
travisbrady has quit [Quit: travisbrady]
badon has joined #ocaml
c74d3 has quit [Read error: Connection reset by peer]
c74d has joined #ocaml
c74d is now known as Guest21943
Guest21943 has quit [Ping timeout: 265 seconds]
Sorella has joined #ocaml
yminsky has joined #ocaml
c74d has joined #ocaml
yminsky has quit [Quit: yminsky]
c74d is now known as Guest24227
Guest24227 has quit [Ping timeout: 250 seconds]
badon has quit [Quit: Leaving]
c74d has joined #ocaml
JuggleTux has quit [Remote host closed the connection]
nullcat has joined #ocaml
c74d has quit [Read error: Connection reset by peer]
c74d has joined #ocaml
kapil___ has joined #ocaml
c74d is now known as Guest22062
Guest22062 has quit [Ping timeout: 252 seconds]
c74d has joined #ocaml
badon has joined #ocaml
reem has quit [Remote host closed the connection]
ghostpl_ has joined #ocaml
ghostpl_ has quit [Ping timeout: 246 seconds]
reem has joined #ocaml
swgillespie has joined #ocaml
c74d has quit [Ping timeout: 252 seconds]
<struktured> companion_cube: how do I build the qtest native binary in containers? "make run-test" gets a command not found of "./run_qtest.native" ?
c74d has joined #ocaml
matason has joined #ocaml
psy_ has quit [Ping timeout: 265 seconds]
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
reem has quit [Remote host closed the connection]
psy_ has joined #ocaml
reem has joined #ocaml
nullcat has quit [Quit: Textual IRC Client: www.textualapp.com]
c74d has quit [Remote host closed the connection]
c74d has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
pyon has quit [Ping timeout: 255 seconds]
The_Mad_Pirate has quit [Excess Flood]
The_Mad_Pirate has joined #ocaml
psy_ has quit [Ping timeout: 264 seconds]
pyon has joined #ocaml
c74d has quit [Ping timeout: 250 seconds]
rgrinberg has quit [Quit: Leaving.]
avsm has joined #ocaml
ghostpl_ has joined #ocaml
ghostpl_ has quit [Ping timeout: 246 seconds]
rgrinberg has joined #ocaml
antkong has quit [Quit: antkong]
c74d has joined #ocaml
matason has quit [Ping timeout: 250 seconds]
antkong has joined #ocaml
c74d has quit [Read error: Connection reset by peer]
mort___ has joined #ocaml
c74d has joined #ocaml
c74d is now known as Guest71396
Guest71396 has quit [Read error: Connection reset by peer]
Submarine has joined #ocaml
c74d has joined #ocaml
mcc has quit [Quit: This computer has gone to sleep]
oscar_toro has quit [Quit: oscar_toro]
chriskohlhepp has joined #ocaml
<chriskohlhepp>
<chriskohlhepp> OCaml port to IOS for IPhone and IPad released on Cydia alternate app store
<chriskohlhepp> It's free - as in beer!
larhat has joined #ocaml
antkong has quit [Read error: Connection reset by peer]
<dmbaturin> chriskohlhepp: Does it imply it uses something else than the original license?
ygrek has joined #ocaml
chriskohlhepp has quit [Read error: Connection reset by peer]
natrium1970 has joined #ocaml
<struktured> dmbaturin: original is Q Public..right?
<natrium1970> When I compile using ocamlopt and options like “-nodynlink”, it works. But how do I pass those options if I’m using ocamlbuild?
jneen is now known as jneen|zzz
vanila has joined #ocaml
larhat has quit [Quit: Leaving.]
avsm has quit [Quit: Leaving.]
c74d has quit [Remote host closed the connection]
c74d has joined #ocaml
Unhammer has joined #ocaml
natrium1970 has quit [Quit: natrium1970]
<struktured> natrium1970: from the ocamlbuild command line at least you can use the "-cflags" or for compiler compiler options "-lflags" for linking options
Simn has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rgrinberg has quit [Quit: Leaving.]
ghostpl_ has joined #ocaml
Haudegen has quit [Ping timeout: 255 seconds]
ghostpl_ has quit [Ping timeout: 252 seconds]
psy_ has joined #ocaml
Haudegen has joined #ocaml
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
mort___ has quit [Quit: Leaving.]
oscar_toro has joined #ocaml
avsm has joined #ocaml
MercurialAlchemi has quit [Quit: Lost terminal]
MercurialAlchemi has joined #ocaml
badon has quit [Ping timeout: 252 seconds]
psy_ has quit [Read error: Connection reset by peer]
struktured has quit [Read error: Connection reset by peer]
toolslive has joined #ocaml
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
<def`>
<rks`>
sgnb` has joined #ocaml
sgnb has quit [Ping timeout: 265 seconds]
ghostpl_ has joined #ocaml
badon has joined #ocaml
Submarine has quit [Quit: Leaving]
c74d has quit [Ping timeout: 252 seconds]
domsj has joined #ocaml
ocp has joined #ocaml
mort___ has joined #ocaml
c74d has joined #ocaml
tane has joined #ocaml
sgnb` has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
larhat has joined #ocaml
sgnb has quit [Remote host closed the connection]
sgnb has joined #ocaml
c74d has quit [Read error: Connection reset by peer]
sgnb has quit [Remote host closed the connection]
c74d has joined #ocaml
Hannibal_Smith has joined #ocaml
ddosia has quit [Quit: Leaving.]
ddosia has joined #ocaml
sgnb has joined #ocaml
bernardofpc has quit [Ping timeout: 244 seconds]
Kakadu has joined #ocaml
bernardofpc has joined #ocaml
AlexRussia has quit [Ping timeout: 265 seconds]
ontologiae_ has joined #ocaml
AlexRussia has joined #ocaml
ebzzry has quit [Remote host closed the connection]
ebzzry has joined #ocaml
bobry has joined #ocaml
paolooo has joined #ocaml
zpe has joined #ocaml
yomimono has joined #ocaml
tane has quit [Quit: Verlassend]
ebzzry has quit [Remote host closed the connection]
hilquias` has quit [Ping timeout: 252 seconds]
c74d is now known as Guest98318
Guest98318 has quit [Ping timeout: 252 seconds]
reem has quit [Remote host closed the connection]
reem has joined #ocaml
c74d has joined #ocaml
thomasga has joined #ocaml
dario_ has joined #ocaml
toolslive has quit [Ping timeout: 252 seconds]
apache2 has joined #ocaml
toolslive has joined #ocaml
reem has quit [Remote host closed the connection]
gargaml has joined #ocaml
oscar_toro has quit [Quit: oscar_toro]
paolooo has quit [Ping timeout: 246 seconds]
c74d is now known as Guest22949
mort___ has quit [Quit: Leaving.]
Guest22949 has quit [Ping timeout: 265 seconds]
c74d3 has joined #ocaml
<companion_cube> struk|work: you need to install qtest, if it's not already done
c74d3 has quit [Read error: Connection reset by peer]
<companion_cube> make test should work if you have all the dependencies
ebzzry has joined #ocaml
c74d has joined #ocaml
Haudegen has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
affinehat has joined #ocaml
thomasga has quit [Quit: Leaving.]
<affinehat> If I have a list of tuples, does anyone know how I could map a function to each element of each tuple in the list?
ygrek has quit [Ping timeout: 250 seconds]
<dmbaturin> affinehat: let pairmap f xs = List.map (fun (x, y) -> (f x, f y)) xs
psy_ has quit [Remote host closed the connection]
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
reem has joined #ocaml
thomasga has joined #ocaml
reem has quit [Ping timeout: 246 seconds]
c74d is now known as Guest11852
Guest11852 has quit [Read error: Connection reset by peer]
reem has joined #ocaml
c74d has joined #ocaml
reem has quit [Remote host closed the connection]
<affinehat> Is there a way to run a .ml file in toplevel without exiting at the end of the file? I want to test my functions in interpreter.
c74d is now known as Guest37999
Guest37999 has quit [Ping timeout: 265 seconds]
<dmbaturin> affinehat: #use "file.ml"
vanila has quit [Quit: Leaving]
<dmbaturin> That is, in the ocaml toplevel, type #use "file.ml" literally. # is the directive prefix in this case, not REPL prompt.
mort___ has joined #ocaml
c74d has joined #ocaml
<affinehat> ok, thanks
<affinehat> does that search the directory that ocaml is started from?
<dmbaturin> Yes, or you can specify absolute path.
<dmbaturin> As in #use "/home/dmbaturin/file.ml"
<dmbaturin> * with ;; at the end of course.
ygrek has joined #ocaml
lordkryss has joined #ocaml
avsm has quit [Quit: Leaving.]
Haudegen has quit [Ping timeout: 246 seconds]
shinnya has joined #ocaml
Nahra has quit [Remote host closed the connection]
kapil___ has quit [Quit: Connection closed for inactivity]
Nahra has joined #ocaml
Haudegen has joined #ocaml
AltGr has left #ocaml [#ocaml]
Nahra has quit [Remote host closed the connection]
yminsky has joined #ocaml
paolooo has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
c74d has quit [Ping timeout: 265 seconds]
<affinehat> In a match statement is it legal to put a bar before the first case? In examples I only see the bar used after the 2nd case and on.
<Drup> yes it's legal, and quite common
thomasga has quit [Quit: Leaving.]
<dmbaturin> By the bar you mean the underscore?
<adrien_znc> |
<adrien_znc> affinehat: it's often skipped by some because it's valid because of:
c74d has joined #ocaml
<adrien_znc> (function Foo -> ... | Bar -> ...)
<adrien_znc> and a leading | would be fairly ugly
<dmbaturin> Ah, vertical bar. Yes, that's syntactically valid and whether to use it or not is aesthetic preference (that is, flamewar fuel :)
<companion_cube> adrien_znc: do you often write one-line "function:?
<companion_cube> "function"
kapil___ has joined #ocaml
<MercurialAlchemi> I could imagine using the single | to match an option as a one-liner
<flux> I've used it! let is_space = function ' ' | '\n' | '\r' | '\t' -> true | _ -> false in..
<flux> also: ("on_sale", "onsale", (function "t" -> "1" | "f" -> "0" | _ -> failwith "cannot convert on_sale")) .. as part of an array
<flux> also finally some commented out code: let data = Enum.filter_map (function '0' -> Some false | '1' -> Some true | _ -> None) data in..
<adrien_znc> companion_cube: to pattern-match, sometimes, yes :P
<companion_cube> I use several lines in this case :)
<adrien_znc> shorter code is more hip
<adrien_znc> you should switch :P
<companion_cube> I'm not hip, I'm square wheel
<apache2> use if
<apache2> :P
ghostpl_ has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 246 seconds]
<dmbaturin> Implement if in SKI calculus!
<companion_cube> totally, SKI calculus is best calculus
<companion_cube> maybe I should rewrite my entreprise-ready SKI calculus in OCaml
yminsky has quit [Quit: yminsky]
ggole has joined #ocaml
<flux> EnterpriSKI
<flux> btw, .com is free, grab it while you can!
<companion_cube> flux: please use https://github.com/c-cube/IKSML if you want a robust, scalable implementation for the cloud
reem has joined #ocaml
reem has quit [Remote host closed the connection]
<flux> companion_cube, hmm.. I'm a bit uncertain about that.. it -does- mention xml, but not cloud.
<companion_cube> once you have XML that's for free
<companion_cube> (maybe I should update the readme...)
<flux> for free? well that certainly won't do.
<companion_cube> :D
<flux> it needs to be expensive!
<companion_cube> well, PR accepted
<companion_cube> (for a nominal fee)
vanila has joined #ocaml
paolooo_ has joined #ocaml
<_obad_> I've been using react and lwt a bit, but I can't quite figure out how to add a timeout on an event.
<_obad_> basically I have a `Data of int event I'm waiting for, and I would like to convert it into a `Data of int | `Timeout event
paolooo has quit [Ping timeout: 246 seconds]
<_obad_> any ideas?
<companion_cube> can't speak for react, but Lwt.pick might help
<companion_cube> check Lwt_unix.with_timeout for instance
<_obad_> companion_cube: I've been kind of forced to use react because of Obus so I'd like to stick to that framework
<Drup> there is lwt.react to make them work together
<_obad_> drup: that's what I'm using. actually I think I'll use E.select but then I need to create an event after a certaina mount of time. so I have a task with Lwt_unix.sleep that sends the event,
<_obad_> however I don't know how to prevent that task from being garbage-collected.
<Drup> you can use Lwt_event.keep for that
<Drup> Lwt_react.S.keep*
<Drup> (or E)
AlexRussia has quit [Ping timeout: 255 seconds]
<_obad_> but I do want it to be garbage collected, once I'm done (i.e. timeout or data received)
<Drup> I'm not sure to understand what you want exactly
<Drup> you want to recieve an event, wait a bit, then do something ?
<_obad_> http://pastebin.com/7Xf98xpm something like that
<_obad_> data_event is a `data of int event
<_obad_> I guess I also need to cancel timeout_task when I'm done
<_obad_> this is done repeatedly in a loop so I can't use E.keep
<Drup> create the timeout event outside of the loop and send events in the loop ?
psy_ has quit [Remote host closed the connection]
<Drup> also, nothing is going to be garbage collected in the code you presented here, everything is used.
<_obad_> what about timeout_task
<Drup> yeah, it will block for some time and then go
fedjo has joined #ocaml
<_obad_> right, it will be kept by lwt's event loop for a second or so
<Drup> you could use Lwt.async
ghostpl_ has joined #ocaml
Tamae has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
ontologiae_ has quit [Ping timeout: 256 seconds]
mort___ has quit [Quit: Leaving.]
bobry has quit [Quit: Connection closed for inactivity]
<_obad_> pour info le bricolage a base de timeout et cancel a fonctionné.
Nahra has joined #ocaml
<toolslive> syteme D ;)
<_obad_> argh need to stop using french in #ocaml
chinglish has joined #ocaml
<_obad_> translation : MlGyver'ed my way out of it
ebzzry has quit [Ping timeout: 256 seconds]
ebzzry has joined #ocaml
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
MooseAndCaml_ has quit [Quit: Page closed]
mort___ has joined #ocaml
reem has joined #ocaml
reem has quit [Ping timeout: 250 seconds]
travisbrady has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
ygrek has joined #ocaml
<dmbaturin> _obad_: It's arguably better than using ocaml in #french. :)
<toolslive> fwiw, ocaml has French leaking into the syntax.
<Drup> toolslive: ?
<toolslive> some constructs in ocaml could only come from someone who speaks French.
<companion_cube> you must mistake ocaml and chamelle numéro 5
<Drup> like ? x)
<MercurialAlchemi> some constructs in some of the ocaml docs I've seen are certainly French in nature :)
<toolslive> for example: match (x,y) with | (0,y) when y < 5 -> .......
<toolslive> the "when" is French
<toolslive> "quand"
<Drup> huum
<toolslive> it should have been "where"
<Drup> right
<Drup> MercurialAlchemi: don't forget french comments in the compiler :]
<toolslive> there are other cases, but it's too late to change the language now is it ? ;)
<Drup> sure, but it's interesting and funny :)
sdegutis has joined #ocaml
ptc has joined #ocaml
<flux> why is 'when' wrong? or is it just that it's not preferable to use it when.. not talking about time?
ptc is now known as Guest35250
<pippijn> sdegutis: I think read_lines is not tail recursive
<pippijn> sdegutis: you might have intended for it to be
<flux> "proceed when the light is lit", "match (light) when light = Lit -> ..", seem pretty similar constructs to me ;-)
<companion_cube> in perl, is it "when" or "where"?
<toolslive> well, what's the guard construct in Haskell ? ;)
<MercurialAlchemi> you use "where" in math papers, and haskell
<fds> As a native English speaker, I wouldn't say 'when' is wrong there. In fact, I'd prefer it to 'where'. But Google returns about ten times as many results for "where x is" than "when x is", if that helps.
<pippijn> sdegutis: line 10: "with" is indented, but the "with" on line 3 is not (inconsistent)
<companion_cube> ok, let's use "assuming" instead
<pippijn> sdegutis: why do you escape patterns?
<toolslive> I didn't say it was wrong. I said "French leaking into..."
<flux> well, it's not a proof really if it's not wrong ;-)
<pippijn> sdegutis: (), |, etc. are regex operators that you don't escape, but you do escape \d and such
<Drup> sdegutis: also, you need to List.rev the result of read_lines
<flux> it's may be a proof that maths did not leak into ocaml
<dmbaturin> fds: "When" is quite common if piecewise function definitions, although "if" is even more common.
<Drup> (and butlast's implementation is terrible)
<Drup> (well, not really terrible, but still, bleh)
<MercurialAlchemi> what does Rust use? it has a similar construct to OCaml's when?
<dmbaturin> abs x = x if x >= 0 | -x otherwise
<toolslive> you can also claim historically, English and French are similar....
<flux> hmm, is it really so SML doesn't have pattern guards, or do they call it with some other name?
<fds> dmbaturin: Hmm, yeah. But it probably would've caused chaos if they'd used 'if' for pattern matching. :-)
<pippijn> Drup: better ways?
<toolslive> python uses "if" in guards
<Drup> MercurialAlchemi: "if" too
<companion_cube> which guards? :D
<fds> Interesting.
<dmbaturin> fds: Yeah, I was about to say that. In any case, I don't think I've ever seen "where" in a piecewise function RHS.
<pippijn> okay, never mind
<toolslive> they have guards in comprehensions
<pippijn> yeah, that can be better
<dmbaturin> flux: SML doesn't have it.
<companion_cube> oh, comprehensions
<companion_cube> right
<sdegutis> pippijn: oh, hmm
Guest35250 has quit [Read error: Connection reset by peer]
<sdegutis> Drup: why?
<sdegutis> besides those, is this code great?
<pippijn> you want "great"?
<sdegutis> yes please
<pippijn> answer the questions, fix the problems I mentioned, then show the code again
<sdegutis> okay thanks
<Drup> sdegutis: you shouldn't open and close the window all the time
<pippijn> are you going to answer my question?
<Drup> open it, redraw, close
<sdegutis> What's a good GUI toolkit for OCaml that's available on OS X without X11 installed?
<sdegutis> pippijn: no
<pippijn> okay
<sdegutis> pippijn: because i dont have an answer, sorry.
<pippijn> then your code will never be great
<pippijn> if you don't know why you're doing something
<Drup> sdegutis: lambda-term :D
<sdegutis> pippijn: this isnt my code, its the code a friend wrote to replicate dmenu
<pippijn> I see
<sdegutis> pippijn: i only found one thing wrong with it, an unnecessary let rec in the middle
<sdegutis> pippijn: i was trying to figure out what i missed
<sdegutis> pippijn: (if anything)
<Drup> the code is slightly on the ravioli side
<Drup> (lot's of very small function that do nothing)
<sdegutis> Drup: spaghetti-ish?
<sdegutis> oh
<sdegutis> Drup: yeah thats common in the clojure community
<sdegutis> Drup: i.e. where the author of this code primarily likes to work
<Drup> it's not terrible
<pippijn> it's particularly useful in clojure
<Drup> oh ? why ?
<sdegutis> im not sure i agree with that
<pippijn> because of this IDE it's got
<pippijn> the one with bubbles
<Drup> I don't see how the IDE got anything to do with that
<pippijn> IDE features often influence coding style
<sdegutis> ive seen /tons/ of clojure code thats mostly unreadable and difficult to modify because it breaks concepts into functions that are too small to be meaningful/useful on their own
<MercurialAlchemi> Drup: never seen a Java file with three screens of IDE-generated imports?
<Drup> MercurialAlchemi: ah, yeah, sure
<Drup> well, no, because I didn't do enough java, but I see the concept
<adrien> these "bubbles", do they show excerpts of the function implementation?
<sdegutis> many "influential" big-name clojure programmers tend to write functions no longer than 1 or 2 lines long, even if it doesnt make sense
<sdegutis> thats the downside of "best practice" cargo culturing
<pippijn> they show the function and data flow, and you can enter some value to see what happens to it
<adrien> they're actually trying to see how far people are going to follow them
<pippijn> I don't remember exactly
<adrien> sounds quite nice actually
<toolslive> with eclipse, you code like this: x.<tab>^<enter>();<enter>y.<tab>.....
<Drup> Like most code practice, I prefer raviolis in a plate rather than in a text file
<sdegutis> anyway, im probably going to learn ocaml, deal with the difficulties/downsides, and use js_of_ocaml for most of my gui needs
<companion_cube> I thought that was lasagna
<sdegutis> deal?
<Drup> companion_cube: lasagna is lots and lots of middleware that is only doing routing
<companion_cube> yep, java
<companion_cube> design patterns are like (tasteless) layers
<Drup> (we conclude from this study that programmers like italian food)
<companion_cube> well, they like pizza
<companion_cube> didn't you know?
<Drup> but there is no pizza code pattern
ghostpl_ has quit [Remote host closed the connection]
<MercurialAlchemi> actually, the goal of the middleware is to increase the call stack
<MercurialAlchemi> it's a competition
<companion_cube> there's a pizza language
<companion_cube> and a cake pattern (in scala)
<MercurialAlchemi> scala has the cake pattern
<companion_cube> the cake is a lie anyway
<MercurialAlchemi> I hear it's a bit like Danish pastry, not very good
<MercurialAlchemi> (in general)
<companion_cube> if it's got cinnamon, I'm in
<dmbaturin> MercurialAlchemi: What exactly is that cake pattern?
<sdegutis> is real world ocaml decent book?
<sdegutis> (im okay with Core at this point)
<companion_cube> sdegutis: it is
<toolslive> anybody know a persistent (as in on-disk) queue lib for ocaml?
<companion_cube> you can even read it online if you want
<MercurialAlchemi> companion_cube: they may have cinammon, but there is 50% chance of marzipan
<sdegutis> ok.
<dmbaturin> sdegutis: Other than using core without warning, it is a very good book.
<companion_cube> yeah, exactly
<MercurialAlchemi> dmbaturin: dependency injection thingie with traits
<sdegutis> i dont mind learning Core for now
<sdegutis> i can always unlearn it later
<companion_cube> a bit between functors and dependency injection, yeah
<companion_cube> sdegutis: good attitude
<sdegutis> ha
<MercurialAlchemi> (Norwegians make killer cookies though)
<MercurialAlchemi> (like the rest of the food in Norway, it also kills your wallet)
<toolslive> regarding "Real World OCaml", a lot of people pitched in when it was a draft with 1000s of comments and improvements.
<toolslive> power of open source publishing....
yomimono has quit [Ping timeout: 264 seconds]
<sdegutis> nice
avsm has joined #ocaml
<Drup> MercurialAlchemi: scandinavia in general makes killer cakes
<Drup> killer as in "it's so fat that you die"
<sdegutis> i maybe shall buy it
<Drup> (a bit alike Brittany)
<MercurialAlchemi> well, brittany is more like 50% butter and 50% sugar
<companion_cube> well it's cold outside
<MercurialAlchemi> you can't put any marzipan in that
<Drup> MercurialAlchemi: the perfect diet
<Drup> 90% sugar 90% (salt) butter 90% marzipan
<Drup> and maybe a bit of chocolate on top
<MercurialAlchemi> :)
<MercurialAlchemi> the local bakery also has US-style chocolate cakes
<MercurialAlchemi> very good, but you get your sugar intake for the month with a single bite
ghostpl_ has joined #ocaml
avsm has quit [Ping timeout: 256 seconds]
<companion_cube> toolslive: no idea for the queue, sorry
sdegutis has quit [Quit: Leaving...]
c74d has quit [Ping timeout: 250 seconds]
<toolslive> maybe a simpler question. We use Lwt_log and want to reconfigure at runtime, but there's only an API to add a logging rule and no call to remove the existing rules....
<toolslive> so how am I supposed to reconfigure at runtime?
<Drup> that's ... an interesting question
<Drup> you can redefine the level at runtime
<Drup> it's not enough I guess ?
dsheets__ has joined #ocaml
c74d has joined #ocaml
dsheets_ has quit [Ping timeout: 256 seconds]
thomasga has joined #ocaml
dsheets__ is now known as dsheets
avsm has joined #ocaml
larhat has quit [Quit: Leaving.]
<toolslive> the use case is a server and a signal forcing it to reload it's log config.
<Drup> I see
<Drup> toolslive: my proposition would be to add a reset function to lwt_log
<toolslive> the rules are a reference, but it's not exposed.
<Drup> yeah
<Drup> just add the function you need
<Drup> we should do a release soon
<Drup> (ping vbmithr)
<Drup> (jerome said we should do one)
<toolslive> ah, so I can just add it, and do a #pr ?
<Drup> yep
<toolslive> k. will do
<toolslive> thx
<Drup> (and documentation, all the jazz, of course)
<toolslive> sure...
c74d has quit [Read error: Connection reset by peer]
<toolslive> "release soon" means what exactly?
<Drup> depends if our new official releaser wake up or not :D
ygrek has quit [Ping timeout: 250 seconds]
ontologiae_ has joined #ocaml
jlouis_ is now known as jlouis
ptc_ has joined #ocaml
yomimono has joined #ocaml
ptc_ has quit [Client Quit]
badkins has joined #ocaml
matason has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Ping timeout: 246 seconds]
avsm has joined #ocaml
ptc has joined #ocaml
ptc is now known as Guest61185
avsm1 has quit [Ping timeout: 252 seconds]
c74d3 has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Ping timeout: 245 seconds]
c74d3 has quit [Ping timeout: 265 seconds]
mort___ has quit [Quit: Leaving.]
slash^ has joined #ocaml
mort___ has joined #ocaml
avsm has joined #ocaml
avsm1 has quit [Ping timeout: 250 seconds]
mort___ has quit [Client Quit]
shinnya has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
zpe has quit [Remote host closed the connection]
travisbrady has quit [Quit: travisbrady]
avsm1 has joined #ocaml
avsm has quit [Ping timeout: 250 seconds]
avsm1 has quit [Client Quit]
sdegutis has joined #ocaml
<sdegutis> Is ## syntax specific to js_of_ocaml or is it part of Oh-Camel itself?
c74d has joined #ocaml
<Drup> "Oh-Camel" <3
<sdegutis> I almost wrote "O' Camel" instead.
<sdegutis> (more poetic)
<Drup> it's jsoo-specific
<sdegutis> Plus I'm pretty sure O'Camel is a valid module name in OCaml.
<companion_cube> sometimes I feel like saying "aww-caml"
<Drup> for now
<sdegutis> companion_cube: a la "aww yeeeeah"?
<Drup> sdegutis: it is /D
<companion_cube> no, à la "ewwwwwww"
<Drup> :D*
* sdegutis wondered what /D meant for a second
travisbrady has joined #ocaml
<sdegutis> O Camel, great art thy functors.
c74d has quit [Read error: Connection reset by peer]
hilquias has joined #ocaml
* companion_cube should use ' in module names more often
<companion_cube> module Make'Drup'Angry = ...
<toolslive> O'Caml, I know your mother.
<Drup> (next april, we do a release of Ó Camall)
<Drup> (with all the keywords in irish)
<Drup> I need an Irish person in the assistance, for science ! :D
avsm has joined #ocaml
<adrien_znc> take that as an excuse to attend saint patrick
<whitequark> Drup: using m17n? :]
<Drup> whitequark: absolutely.
<companion_cube> I really hope UChar makes it into the compiler this time
<companion_cube> and latin1 strings be deprecated
gargaml has quit [Quit: WeeChat 1.1.1]
<sdegutis> I remember one thing that slightly bothered me about OCaml: type names are usually lower-case. I prefer when types are Upper and variables are lower.
<whitequark> companion_cube: variable names, yes
<whitequark> strings, probably not
<Drup> variable names are already deprecated
<sdegutis> I remember both pippijn and whitequark from other channels on freenode.
<sdegutis> whitequark from Ruby, forgot where pippijn was from.
<sdegutis> Programming language osmosis is cool.
<Drup> We totally have complete osmosis with ruby :3
<sdegutis> Drup: you came from Ruby too?
<Drup> no, that was joke/sarcasm x)
c74d has joined #ocaml
TheCommieDuck has joined #ocaml
<TheCommieDuck> Hey; from the command line, is there a way to output a variant type?
<TheCommieDuck> (or some kind of printf)
<Drup> thecommieduck: I would advise you to look at the ppx_deriving library
yomimono has quit [Ping timeout: 256 seconds]
<TheCommieDuck> Drup: Oh, is there no easy builtin way?
<whitequark> no
<sdegutis> thecommieduck: are you looking for a generic way to turn any variant into a string?
<TheCommieDuck> sdegutis: well, we're mostly just trying to display a variant for debugging.
<sdegutis> thecommieduck: I imagine that's not possible without a compiler plugin or hack or something, but I'm also new to O' Camel
<sdegutis> thecommieduck: oh
<TheCommieDuck> i.e. from a stream of tokens via ocamllex, we want to print out the stream of tokens to handcheck it's parsing right.
<Drup> ppx_deriving is the way
<Drup> it's very easy to use
rgrinberg has joined #ocaml
<TheCommieDuck> mostly as we couldn't get any output other than 'Parsing error!' from the parser's Parse_Error.
<Drup> you can get slightly better by extracting the state of the parser
<Drup> let me give you a code sample
<TheCommieDuck> Drup: <3
<sdegutis> thecommieduck: I would trust Drup on this, she seems to know what she's talking about in all things
<Drup> he*
<sdegutis> *in all OCaml things
<sdegutis> Drup: just didnt wanna sound sexist is all
<Drup> sdegutis: sure, no problem, just precising.
<sdegutis> can someone give me a fun little toy command line utility to write to practice ocaml?
<sdegutis> oh nevermind i got one
<whitequark> sdegutis: you might want to use singular they in the future.
<Drup> I find singular they slightly ridiculous
<sdegutis> cat words.txt | fuzzy-filter th
<whitequark> Drup: it was fine for shakespeare
<whitequark> it'll be fine for you
<MercurialAlchemi> it's always better than "it" :)
<TheCommieDuck> Drup: looks great, thanks a bunch!
<sdegutis> if words.txt contains "This\nthat\nlol\nwith" the output should contain "This\nthat\nwith"
<Drup> lot's of things in shakespeare's language would be slightly ridiculous in normal speach
<sdegutis> is this a good little exercise/
<sdegutis> my plan is to implement it like this: 1) separate lines into a list of strings; 2) turn that into a list of tuples of (string, lowercased string), 3) create a regex that turns "search" into "s.*e.*a.*r.*c.*h", 4) filter the list of tuples by the second element, 5) print the filtered list's first element on screen
yomimono has joined #ocaml
<sdegutis> this is admittedly cheating by using regex, but i can replace that function with non-regex after the base case works
<struk|work> companion_cube: can you take a look at my latest revision of the ring buffer? I am going to get the tests working today but the code is complete (albeit needs review and a little clean up) https://github.com/struktured/ocaml-containers/blob/poly-bufferio/src/data/CCRingBuffer.mli andhttps://github.com/struktured/ocaml-containers/blob/poly-bufferio/src/data/CCRingBuffer.ml
<Drup> sdegutis: if you are going to use regexps, use ocaml-re
<Drup> avoid Str
<Drup> also, takes the ocasion to get familiar with cmdliner
<Drup> -s
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
TheCommieDuck has quit [Quit: WeeChat 1.1.1]
psy_ has joined #ocaml
paolooo_ has quit [Quit: Page closed]
<sdegutis> Drup: why avoid Str?
darkf has quit [Quit: Leaving]
<Drup> there are numerous reasons, but the main one is that the API is terrible
Hannibal_Smith has quit [Quit: Leaving]
mort___ has joined #ocaml
yomimono has quit [Ping timeout: 265 seconds]
<sdegutis> Drup: what is a good alternative?
<def`> ocaml-re
<sdegutis> oh, I thought the recommendation was regarding after I changed the implementation to no longer use regex
<sdegutis> i.e. for once it was purely using string functions
domsj has quit [Ping timeout: 264 seconds]
mort___ has quit [Quit: Leaving.]
MrScout_ has joined #ocaml
olauzon has joined #ocaml
<struk|work> why oh why utop must you segfault on startup
jneen|zzz is now known as jneen
ygrek has quit [Ping timeout: 264 seconds]
<struk|work> ah ha, I had to delete some stray stuff in /usr/local/lib/ocaml and /usr/local/bin/ocaml* that was overriding some opam versions
<affinehat> What does () mean in this? let rec output_expr () = function ...
<sdegutis> affinehat: unit
Kakadu has quit [Ping timeout: 246 seconds]
<sdegutis> affinehat: it means it's a function that takes a single useless argument
<affinehat> In the function though it does pattern matching on an argument so how does it know what to do?
jwatzman|work has joined #ocaml
<affinehat> relevant code is | Var x -> Printf.sprintf "%s" x
<affinehat> | Lam(x, e) -> Printf.sprintf "%s.%a" x output_expr e
<affinehat> | App(e1, e2) -> Printf.sprintf "(%a) (%a)" output_expr e1 output_expr e2
<Drup> I doubt it's pattern matching on () and doing that
ghostpl_ has quit [Remote host closed the connection]
ocp has quit [Quit: Leaving.]
<S11001001> affinehat: it's like, you expect to be able to write a lambda on some argument. So, naturally, you expect to be able to write a pattern in place of the name of that lambda. So, naturally, you expect to be able to write *multiple* patterns in place of the name of that lambda.
Submarine has joined #ocaml
captain_furious1 has joined #ocaml
<captain_furious1> hey
<captain_furious1> are there any web servers written in ocaml
<Drup> ah, yeah, *this* bench
<captain_furious1> doesn't seem to be much of showing from ocaml
<captain_furious1> I am not saying i agree with it
<captain_furious1> i am just curious as it covers lots of servers languages and frameworks
<Drup> considering it's benchmarking mostly how to render an empty page the fastest way possible :D
<S11001001> captain_furious1: if benching hello world performance is important, sure
psy_ has quit [Read error: No route to host]
<affinehat> S11001001: I don't really understand why would you write unit instead of some other user-defined type then
<S11001001> affinehat: value restriction? not sure
ontologiae_ has quit [Ping timeout: 252 seconds]
<captain_furious1> ok forget the criteria of the benchmark itself. I just wondered why no ocaml
<Drup> captain_furious1: nobody in the ocaml ecosystem care enough and the people doing the benchmark don't really care either, so, hum it didn't happen
<S11001001> affinehat: I mean, the type is inferred unit -> adt_with_lam_et_al -> blah, right?
<Drup> but if you want to do one, I'll be happy to help :)
<captain_furious1> ha
<captain_furious1> ok fair enough
<captain_furious1> so what is the go to feramework for creating, say, rest api's in ocaml ?
<affinehat> S11001001: With expr a defined type, I get output_expr();;
<affinehat> - : expr -> string = <fun>
<affinehat> That's why I don't understand why the argument seems to be type unit
<S11001001> affinehat: what is the inferred type of output_expr;;
<S11001001> no ()
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
<affinehat> S11001001: unit() -> expr -> string
<Drup> for just a rest api, I would guess opium or raw cohttp, I guess
<whitequark> no opium, clearly
<Drup> ocsigen works, but it's clearly not the intended target :p
<whitequark> it's a really bad clone of sinatra
<Drup> ahah
<Drup> rgrinberg, defend yourself !
<whitequark> wait, no
<whitequark> that was Ohm
<whitequark> I have nothing to say about Opium
<Drup> Ohm is nothing, it doesn't exist, it never existed
<Drup> (especially it's documentation)
<whitequark> exactly
<whitequark> except that opium's use of core is indefensible
<Drup> ahah x)
<avsm> uh, opium only core_kernel
<Drup> rgrinberg: is opium mirage-compatible ?
<Drup> if core_kernel, then yes, then it's fine
<Drup> (hi avsm)
<whitequark> at least it uses lwt
avsm has quit [Quit: Leaving.]
Haudegen has quit [Ping timeout: 252 seconds]
psy_ has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
bobry has joined #ocaml
Haudegen has joined #ocaml
q66 has joined #ocaml
zpe has joined #ocaml
captain_furious1 has quit [Quit: Leaving.]
vanila has quit [Remote host closed the connection]
travisbrady has quit [Quit: travisbrady]
MercurialAlchemi has quit [Remote host closed the connection]
ghostpl_ has joined #ocaml
MercurialAlchemi has joined #ocaml
Kakadu has joined #ocaml
vanila has joined #ocaml
<rgrinberg> I'd get rid of core if I had Univ_map alternative
<whitequark> companion_cube to the rescue
<rgrinberg> i wouldn't switch to containers/batteries. I don't want to choose an stdlib over another
<rgrinberg> might as well get rid of it entirely
<rgrinberg> Drup: it is mirage compatible
<whitequark> rgrinberg: containers is not an stdlib replacement
<Drup> "might as well get rid of it entirely" <- I don't really agree with that, if only for the Option module and the complementary Map/Set/Hashmap functions.
travisbrady has joined #ocaml
matason has quit [Ping timeout: 240 seconds]
<affinehat> Any idea why this gives a syntax error? let find_dict x =
<affinehat> if List.mem_assoc x dict then List.assoc x dict
<affinehat> else let value = gensym() in dict = (x, value)::dict ; value;;
<vanila> dict =
<Drup> affinehat: no *syntax* error here.
<Drup> however "dict = (x, value)::dict" is probably not doing what you think, it's testing if they are equals :)
<rgrinberg> Drup: i honestly don't use much of core aside from Univ_map so i think I can do without containers/batteries/core rather easily
<Drup> you don't use Option ? :O
<affinehat> Ah ok so how can I fix the code so that I update the let-binding of dict and then return value from the function?
<affinehat> Would just let dict = (x, value)::dict;; be enough?
<Drup> No.
<Drup> because everything is immutable by default
<Drup> you want mutability, so you should use "ref"
<rgrinberg> I use Option.{map,try_with,value_exn,is_some,value} in opium
<rgrinberg> pretty modest
<Drup> rgrinberg: enough from my point of view
<Drup> why rewrite it when it's already rewritten
<affinehat> Drup: I want it to be immutable though so that it makes a new dictionary each time it is updated
<Drup> affinehat: but you want the variable that holds the dictionnary to mutate
<Drup> rgrinberg: it's just losing time, and there is enough things to do that losing time is such pointless things is harmful.
<Drup> in*
<Drup> (at least that's my stance on not-using-stdlib-replacements)
<rgrinberg> Drup: if not wasting time is the objective i should probably just stick with core_kernel :D
<sdegutis> I started taking more notes on OCaml so that next time I don't forget: http://sdegutis.github.io/2014-02-16/ocaml/
<Drup> rgrinberg: sure, and that's fine.
<Drup> sdegutis: " Does it share Haskell’s record field name collision problem?" No it doesn't
<sdegutis> Drup: sweet
<Drup> "Where do you search for libraries?" opam
<Drup> "How do you install libraries?" opam
<Drup> what is "keyword based arguments" ?
<sdegutis> Drup: like, named parameters
<sdegutis> or something
<sdegutis> Drup: ~f:bla
<sdegutis> I liked that Haskell didn't have them.
<sdegutis> But I'm undecided on whether I mind them.
<Drup> you liked the absence of a non-mandatory feature ?
<Drup> (and they are insanely useful, you probably never saw one of those 10-ary haskell function with only the types to prevents you of swaping two arguments)
<sdegutis> Drup: maybe
<sdegutis> Drup: you're probably right
<Drup> (the syntax is another question, to each its own)
<sdegutis> :)
<rks`> "need to put abstract interfaace into its own mli file"
claudiuc has joined #ocaml
<rks`> that's not a "need"
<rks`> just a possibility
<sdegutis> rks`: how so
<sdegutis> rks`: I meant if you wanted to make it public yet abstract
<sdegutis> rks`: true then, right?
<Drup> you could do it all in the .ml file, but bleeeh
jwatzman|work has quit [Quit: jwatzman|work]
<rks`> as Drup said.
domsj has joined #ocaml
claudiuc has quit [Remote host closed the connection]
jabesed has joined #ocaml
claudiuc has joined #ocaml
<sdegutis> ok
<affinehat> So I am trying to implement a lambda calculus and I need to do an alpha conversion (rename bound variables). Is it possible to do this with just pattern matching? And do I have to use a dictionary to do this?
<affinehat> I was going to do something like this with a list let rec rename expr = match expr with
<affinehat> | Var x -> Var find_dict x
<affinehat> | Lam(x, e) -> Lam(find_dict x, rename e)
<affinehat> | App(e1, e2) -> App(rename e1, rename e2)
<affinehat> But it seems that I can't add values to the list outside of the function
<vanila> why don't you pass in the list too
<affinehat> thanks that makes sense :)
<Drup> sdegutis: also, if you want the really "fast and straight to the point" ocaml manual ... well, the manual is pretty close to that =')
<Drup> oh
<Drup> maybe you would like that : http://blog.ezyang.com/2010/10/ocaml-for-haskellers/
<sdegutis> Drup: thanks
<sdegutis> also, bear with me that the styles are changing constantly on this website -- im experimenting with ui design
ggole has quit [Ping timeout: 264 seconds]
jlewis_ has joined #ocaml
ghostpl_ has quit [Remote host closed the connection]
rgrinberg has quit [Quit: Leaving.]
larhat has joined #ocaml
jwatzman|work has joined #ocaml
dario_ has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 246 seconds]
tane has joined #ocaml
Haudegen has joined #ocaml
arj has joined #ocaml
rand000 has joined #ocaml
snikkers has joined #ocaml
<sdegutis> When you do a pattern patch for something like Some(x), if the "x" symbol isn't bound in scope, I think it will act as a wildcard and bind it to the matched value. But what if you already had "let x = 3 in ..." right before the pattern match? Will the pattern only match for Some(3)?
<mrvn> it will always bind, you can't match against bound values.
zpe has quit [Remote host closed the connection]
<sdegutis> Oh.
<sdegutis> Thanks Marvin.
vanila has quit [Quit: Leaving]
slash^ has quit [Read error: Connection reset by peer]
oriba has joined #ocaml
ghostpl_ has joined #ocaml
travisbrady has quit [Quit: travisbrady]
Simn has quit [Ping timeout: 252 seconds]
bobry has quit [Quit: Connection closed for inactivity]
arj has quit [Quit: Leaving.]
ghostpl_ has quit [Ping timeout: 246 seconds]
travisbrady has joined #ocaml
rand000 has quit [Ping timeout: 250 seconds]
domsj has quit [Remote host closed the connection]
toolslive has quit [Ping timeout: 252 seconds]
eyyub has joined #ocaml
<sdegutis> Do any of y'all'z use O'Caml for work?
<sdegutis> (or to make money)
govg has joined #ocaml
rgrinberg has joined #ocaml
<adrien> not at te moment but I've done it
<adrien> I know several people her edo
Simn has joined #ocaml
<smondet_> sdegutis: I do.
smondet_ is now known as smondet
<sdegutis> smondet_: for what?
<smondet> I work in biomedical research
toolslive has joined #ocaml
larhat has quit [Quit: Leaving.]
<travisbrady> smondet: I was just looking at the “over the hump” repo and noticed something about your “fmt trick”. I’m curious, what is the trick?
rand000 has joined #ocaml
<sdegutis> smondet: sounds boring
<smondet> travisbrady: I'm not sure, but it's maybe the way of using `ksprintf`: let my_log fmt = ksprintf (fun s -> printf "Log: %s\n%!" s) fmt
<companion_cube> rgrinberg: Univ_map ? similar to Martin Jambon's mixtbl?
<smondet> sdegutis: it is not :) programming cool software; while learning some biology; and having a good motivations to wake up in the morning (all opensource; non-profit organisation; main goal being to improve medical outcomes)
<sdegutis> smondet: good for you
<rgrinberg> companion_cube: Yeah, except i need it immutable
<companion_cube> ohh
<companion_cube> well that can be easy to add.
<smondet> rgrinberg: get the code out of core_kernel, make your own library :)
<smondet> (it's Apache 2.0)
<companion_cube> struk|work: I'll take a look -- eventually I'll prefer a PR
<rgrinberg> smondet: i gain very little from doing that unfortunately in practice. I'd be more inclined if an actual user complained
<rgrinberg> I do have SOME incentive though
<struk|work> companion_cube: I can PR if you want but the qtests don't work yet
<companion_cube> no problem
<rgrinberg> I would like to see if it's possible to construct a Univ_map on top of a HAMT
<companion_cube> the signature is neat
<companion_cube> only, junk/next should be more explicit in whether they operate on front or back
<smondet> rgrinberg: but a user, has already accepted core_kernel (e.g. I won't use anymore anything that depends on it; but it doesn't I would use opium anyway, it's just the first "no-go")
<smondet> s/doesn't/doesn't mean/
<struk|work> companion_cube: ok maybe I should make a PR so you can annotate this changes?
<struk|work> companion_cube: *this/these
<companion_cube> don't worry, it can wait
travisbrady has quit [Quit: travisbrady]
<struk|work> companion_cube: ok
<companion_cube> hm, also, I prefer @raise in comments
kakadu_ has joined #ocaml
kakadu_ has quit [Read error: Connection reset by peer]
<struk|work> companion_cube: will do
sdegutis has quit [Quit: Leaving...]
<rgrinberg> smondet: that's right, although I don't think such a stance is fully logical. Why? size doesn't really matter much for servers. Opium doesn't really use core types anyway so you can easily use it with batteries. Anyway, I will get rid of core_kernel
<rgrinberg> it's just not my first priority
Kakadu has quit [Remote host closed the connection]
<rgrinberg> I'd first like to see cohttp support ppx_deriving
travisbrady has joined #ocaml
Kakadu has joined #ocaml
<companion_cube> I don't think you need to provide defautl instances, struk|work
<smondet> indeed cohttp without camlp4 would be great
<struk|work> companion_cube: you mean the primitive ring buffers? or something else?
<companion_cube> yes, the applications of the functor
<companion_cube> just give the functor, imho
<companion_cube> (and maybe the Bytes instance)
<struk|work> companion_cube: I was trying to follow the advice of http://www.lexifi.com/blog/about-unboxed-float-arrays verbatim
<struk|work> companion_cube: I'm indifferent though, can remove those defaults. I am more interested in the polymorphic case anhyow
<companion_cube> me too, but we're not yet there
<companion_cube> we'll think about a polymorphic version later (1-class modules)
<struk|work> companion_cube: I just meant the Make(...) functor as it's defined now is all I really need. Frist class module would be nice too but that's a little fancy for me
<companion_cube> sure
<companion_cube> keep it simple for now, thanks a lot for the good work!
<struk|work> companion_cube: no problem, will get around to the qtests soon, will make your other suggested changes too then do a PR
<companion_cube> excellent
<smondet> rgrinberg: as server-side goes, it's maybe the least important problem with core_kernel, but 'my' server cannot even compile core_kernel :D (not enough RAM)
<companion_cube> smondet: did you try containers? 0:-)
<rgrinberg> smondet: you deploying to a raspberry bi? :D
<rgrinberg> s/bi/pi/
<companion_cube> with mirage, that would be interesting
Sorella has quit [Quit: Connection closed for inactivity]
sdegutis has joined #ocaml
<sdegutis> Hi. I have a 944 line Objective-C file that I'd like to translate entirely to OCaml if possible. What are some consummate techniques for interfacing with Objective-C APIs (e.g. AppKit) from OCaml?
<def`> - : 'a option = None
<tcpc> a chinese intern sdegutis
<def`> :DDD
<sdegutis> Does anyone have a serious answer?
<def`> but seriously, there is nothing
<sdegutis> That's distressing.
<companion_cube> does obj-C interface with anything else anyway?
<sdegutis> companion_cube: yes, it just translates down to some C code.
<def`> companion_cube: not really, although the runtime is dynamic and highly introspectable
<def`> so some dynamic languages implementation are available on top
ontologiae_ has joined #ocaml
<def`> but this won't give you type information
<sdegutis> As long as you can link to the ObjC runtime library, you can use C functions like objc_msgSend to do the same things in pure C.
<sdegutis> It's awful and painful though, unless someone has written a wrapper for you.
<def`> yep
<smondet> companion_cube: I'm happy with http://seb.mondet.org/software/nonstd/index.html (and other one-module libs)
<smondet> rgrinberg: 500 MB of RAM is not enough to compile core_kernel (cf. the core mailing-list a few times)
<sdegutis> im taking all your notes btw, see 'Resources' on http://sdegutis.github.io/2014-02-16/ocaml/
<sdegutis> (figuring out how to make anchor tags automatic in markdown/jekyll)
reem has joined #ocaml
Hannibal_Smith has joined #ocaml
<companion_cube> smondet: right, I remember
<companion_cube> sdegutis: so you could use the C API, I guess, but ewwww
<companion_cube> smondet: it's not really one module, it has submodules, right?
<smondet> companion_cube: yeah, but you see what I mean :)
<sdegutis> :'(
<sdegutis> i think ill just write some C functions in an ObjC file that the OCaml module just uses, like in def`'s link
<sdegutis> Slightly disturbing, but c'est le vie.
raphaelss has quit [Quit: leaving]
reem has quit [Remote host closed the connection]
travisbrady has quit [Quit: travisbrady]
reem has joined #ocaml
Guest61185 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Simn has quit [Quit: Leaving]
Kakadu has quit [Remote host closed the connection]
rand000 has quit [Quit: leaving]
ghostpl_ has joined #ocaml
travisbrady has joined #ocaml
Sorella has joined #ocaml
thomasga has quit [Quit: Leaving.]
ghostpl_ has quit [Ping timeout: 256 seconds]
Submarine has quit [Remote host closed the connection]
nopf has quit [Ping timeout: 255 seconds]
Intensity has quit [Ping timeout: 246 seconds]
nopf has joined #ocaml
sdegutis has quit [Quit: Leaving...]
MercurialAlchemi has quit [Ping timeout: 244 seconds]
shinnya has joined #ocaml
sdegutis has joined #ocaml
<sdegutis> Is @@ like Haskell's $ ?
<mrvn> why don't you copare the descripion in the api docs?
<sdegutis> I rather liked PureScript's <| and |> instead of |> and @@
<sdegutis> it showed application direction and was more consistent
<companion_cube> yes, @@ is similar to $
<sdegutis> companion_cube: thanks
scythe-_ has joined #ocaml
<sdegutis> companion_cube: you're just like in the movies: helpful, kind, reliable, always a good friend
<companion_cube> don't worry, many people are like that on IRC :p
<companion_cube> (thanks)
<sdegutis> er, not movies, i mean portal games
travisbrady has quit [Quit: travisbrady]
<sdegutis> you're just like you are in the portal games: &c.
<companion_cube> I talk a bit more, I think ^^
<sdegutis> only slightly
<scythe-_> is it possible to declare a module type with functions that take optional arguments?
* nicoo puts companion_cube in the incinerator.
<companion_cube> scythe-_: sure, val foo : ?x:int -> ?y:int -> string -> unit for instance
<nicoo> companion_cube: I'm sorry, but GLaDOS told me to
<scythe-_> ^,^ thanks
<scythe-_> perfect
<sdegutis> nicoo: nooooooooooooooo.com
sdegutis has quit [Quit: Leaving...]
tane has quit [Quit: Verlassend]
ptc has joined #ocaml
ptc is now known as Guest19371
Guest19371 has quit [Client Quit]
ghostpl_ has joined #ocaml
olauzon has quit [Quit: olauzon]
eyyub1 has joined #ocaml
olauzon has joined #ocaml
eyyub has quit [Ping timeout: 250 seconds]
olauzon has quit [Client Quit]
claudiuc has quit [Remote host closed the connection]
travisbrady has joined #ocaml
jcloud has joined #ocaml
<Drup> smondet: can't you compile on another machine ? I mean, if it's ARM, you can easily find a big enough ARM to compile once
<Drup> you're not doing your dev on your small thingy anyway ...
<whitequark> smondet: you can cross-compile!
<whitequark> it should be easily customizable for your small arm thingy, the only thing you need is a cross-compiler on the host and a cross-libc
<whitequark> which are fairly trivial to make
Hannibal_Smith has quit [Quit: Leaving]
claudiuc has joined #ocaml
<Drup> (the only major opposition to core for a server is camlp4 because :<)
rgrinberg has quit [Quit: Leaving.]
struktured has joined #ocaml
<affinehat> I have this code: let rec beta e = match e with
<affinehat> | Var x -> None
<affinehat> | Lam(x, e) -> None
<affinehat> | App(e1, e2) -> if (beta e1 <> None) then App(beta e1, e2) else None
<affinehat> Does anyone know why the last line would evaluate to expr instead of expr option?
<thizanne> because you need to write `then Some (App (beta e1, e2))` to get an expr option
<affinehat> Thanks I thought it would be something simple I missed
<Drup> (also, it's not going to typecheck)
<Drup> investigate :p
thomasga has joined #ocaml
<affinehat> So since it is expecting App to take (expr * expr) can I do something to indicate that beta e1 will never be None due to the check?
<Drup> pattern matching !
<affinehat> I was hoping to avoid that but looks like I have to use match :)
<affinehat> Thanks for the help
<ousado> affinehat: why avoid it?
<affinehat> ousado: no real reason just that I already wrote the entire function in an imperative style and have to rewrite a lot
ghostpl_ has quit [Remote host closed the connection]
travisbrady has quit [Quit: travisbrady]