adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Current MOOC: https://huit.re/ocamlmooc | OCaml 4.04.0 release notes: http://ocaml.org/releases/4.04.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
FreeBirdLjj has quit [Remote host closed the connection]
AlexRussia has joined #ocaml
zv has quit [Ping timeout: 250 seconds]
agarwal1975 has joined #ocaml
atsampson has quit [Ping timeout: 258 seconds]
AlexRussia has quit [Ping timeout: 260 seconds]
atsampson has joined #ocaml
zv has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
sh0t has quit [Quit: Leaving]
FreeBirdLjj has joined #ocaml
AlexRussia has joined #ocaml
cpdean has joined #ocaml
AlexRussia has quit [Ping timeout: 256 seconds]
yomimono has joined #ocaml
veggie_ has quit [Ping timeout: 248 seconds]
Simn has quit [Quit: Leaving]
nahra has quit [Read error: Connection reset by peer]
nahra has joined #ocaml
AlexRussia has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
fraggle_ has quit [Ping timeout: 246 seconds]
AlexRussia has quit [Ping timeout: 265 seconds]
fraggle_ has joined #ocaml
Guest26 has joined #ocaml
AlexRussia has joined #ocaml
AlexRussia has quit [Ping timeout: 240 seconds]
wu_ng has joined #ocaml
Guest26 has quit [Quit: Textual IRC Client: www.textualapp.com]
AlexRussia has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
AlexRussia has quit [Ping timeout: 246 seconds]
mfp has quit [Ping timeout: 248 seconds]
Guest26 has joined #ocaml
silver has quit [Read error: Connection reset by peer]
FreeBirdLjj has quit [Remote host closed the connection]
AlexRussia has joined #ocaml
AlexRussia has quit [Ping timeout: 268 seconds]
TarVanimelde has joined #ocaml
libertas has quit [Ping timeout: 260 seconds]
Guest26 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Guest26 has joined #ocaml
libertas has joined #ocaml
wolfcore has quit [Ping timeout: 265 seconds]
TarVanimelde has quit [Ping timeout: 256 seconds]
nomicflux has joined #ocaml
AlexRussia has joined #ocaml
AlexRussia has quit [Ping timeout: 260 seconds]
wolfcore has joined #ocaml
yomimono has quit [Quit: Leaving]
FreeBirdLjj has joined #ocaml
nomicflux has quit [Quit: nomicflux]
FreeBirdLjj has quit [Ping timeout: 258 seconds]
TarVanimelde has joined #ocaml
jlongster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexRussia has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
cpdean has quit [Quit: Leaving.]
AlexRussia has quit [Ping timeout: 244 seconds]
cpdean has joined #ocaml
phase_ has joined #ocaml
fraggle_ has quit [Ping timeout: 246 seconds]
AlexRussia has joined #ocaml
zaquest has joined #ocaml
fraggle_ has joined #ocaml
AlexRussia has quit [Ping timeout: 258 seconds]
dgui has joined #ocaml
dgui has quit [Remote host closed the connection]
dgui has joined #ocaml
ski has joined #ocaml
dgui has quit [Client Quit]
larhat has quit [Quit: Leaving.]
FreeBirdLjj has joined #ocaml
cpdean has quit [Quit: Leaving.]
FreeBirdLjj has quit [Ping timeout: 258 seconds]
noddy has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
AlexDenisov has joined #ocaml
AlexDeni_ has joined #ocaml
MercurialAlchemi has joined #ocaml
AlexDenisov has quit [Read error: Connection reset by peer]
TarVanimelde has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
AlexDeni_ has quit [Read error: Connection reset by peer]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest26 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
pierpa has joined #ocaml
AlexRussia has joined #ocaml
FreeBirdLjj has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 252 seconds]
AlexRussia has quit [Ping timeout: 245 seconds]
FreeBirdLjj has quit [Ping timeout: 258 seconds]
freusque has joined #ocaml
AlexRussia has joined #ocaml
aggelos_ has quit [Ping timeout: 252 seconds]
AlexRussia has quit [Ping timeout: 250 seconds]
mengu has joined #ocaml
mengu has quit [Remote host closed the connection]
aggelos_ has joined #ocaml
rgrinberg has quit [Ping timeout: 260 seconds]
malc_ has joined #ocaml
MercurialAlchemi has joined #ocaml
AlexRussia has joined #ocaml
TarVanimelde has joined #ocaml
AlexRussia has quit [Ping timeout: 260 seconds]
freusque has quit [Ping timeout: 260 seconds]
vfys has joined #ocaml
mengu has joined #ocaml
mengu has joined #ocaml
mengu has quit [Changing host]
mengu has quit [Remote host closed the connection]
freusque has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
AlexRussia has joined #ocaml
nore has quit [Quit: WeeChat 1.4]
AlexRussia has quit [Ping timeout: 265 seconds]
alfredo has joined #ocaml
AlexRussia has joined #ocaml
nore has joined #ocaml
AlexRussia has quit [Ping timeout: 268 seconds]
AlexRussia has joined #ocaml
AlexRussia has quit [Ping timeout: 245 seconds]
phase_ has quit [Quit: cya l8r alig8r]
TarVanimelde has quit [Ping timeout: 256 seconds]
Simn has joined #ocaml
jnavila has joined #ocaml
Algebr` has joined #ocaml
AlexDenisov has joined #ocaml
xieyuheng has joined #ocaml
larhat has joined #ocaml
AlexRussia has joined #ocaml
AlexRussia has quit [Ping timeout: 265 seconds]
jnavila has quit [Read error: Connection reset by peer]
jnavila has joined #ocaml
brunoro_ has quit [Ping timeout: 240 seconds]
okuu has quit [Quit: Unyu~?]
AlexRussia has joined #ocaml
AltGr has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brunoro_ has joined #ocaml
AlexRussia has quit [Ping timeout: 260 seconds]
brunoro_ has quit [Ping timeout: 260 seconds]
AlexRussia has joined #ocaml
AlexDenisov has joined #ocaml
AlexRussia has quit [Ping timeout: 245 seconds]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 268 seconds]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 260 seconds]
mpenet has joined #ocaml
brunoro_ has joined #ocaml
nopf has quit [Ping timeout: 260 seconds]
mfp has joined #ocaml
wu_ng has quit [Remote host closed the connection]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ygrek has quit [Ping timeout: 268 seconds]
rand__ has joined #ocaml
TarVanimelde has joined #ocaml
<xieyuheng> File "stack.ml", line 19, characters 0-3: [18:35]
<xieyuheng> Error: Syntax error
<xieyuheng> what's wrong with the syntax ?
<companion_cube> `let push_list` and `let push` are not terminated
<companion_cube> don't finish a definition by `;`
<companion_cube> (it means the definition is not finished and waits for the next expression)
<malc_> funny situation where both adding and removing ';' would help
<xieyuheng> I have
<xieyuheng> type 'a stack = 'a list ref
<xieyuheng> val pop : 'a stack -> 'a
<companion_cube> malc_: heh
<companion_cube> xieyuheng: just remove the trailing `;` in the definitions that end with it
AlexRussia has joined #ocaml
<xieyuheng> oh
<xieyuheng> line 6, characters 4-7:
<xieyuheng>
<xieyuheng> Error: Syntax error
<companion_cube> `let rec f = … and g = …`
<xieyuheng> oh!
<companion_cube> rec applies to the whole block, if present
<xieyuheng> thanks
AlexRussia has quit [Ping timeout: 258 seconds]
AlexRussia has joined #ocaml
xieyuheng has quit [Remote host closed the connection]
jwatzman|work has joined #ocaml
jwatzman|work has quit [Changing host]
jwatzman|work has joined #ocaml
kakadu has joined #ocaml
AlexRussia has quit [Ping timeout: 265 seconds]
AlexRussia has joined #ocaml
AlexRussia has quit [Ping timeout: 250 seconds]
silver has joined #ocaml
cow-orker has joined #ocaml
AlexRussia has joined #ocaml
FreeBirdLjj has joined #ocaml
AlexRussia has quit [Ping timeout: 258 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
FreeBirdLjj has quit [Ping timeout: 260 seconds]
AlexRussia has joined #ocaml
freusque has quit [Quit: WeeChat 1.5]
freusque has joined #ocaml
jwatzman|work has joined #ocaml
AlexRussia has quit [Ping timeout: 258 seconds]
johnelse is now known as johnel_away
johnel_away is now known as johnelse
AlexRussia has joined #ocaml
noddy has joined #ocaml
TarVanimelde has quit [Read error: Connection reset by peer]
TarVanim_ has joined #ocaml
tg has quit [Excess Flood]
chelfi1 is now known as chelfi
dhil has quit [Ping timeout: 258 seconds]
AlexRussia has quit [Ping timeout: 250 seconds]
tg has joined #ocaml
cpdean has joined #ocaml
AlexRussia has joined #ocaml
petroav has joined #ocaml
rand__ has quit [Ping timeout: 268 seconds]
cpdean has quit [Quit: Leaving.]
conrad1 has joined #ocaml
cpdean has joined #ocaml
cpdean has left #ocaml [#ocaml]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 258 seconds]
conrad1 has quit [Quit: WeeChat 1.4]
copy` has joined #ocaml
shinnya has joined #ocaml
malc_ has quit [Ping timeout: 258 seconds]
<rwmjones> I can't work out how to print an ocaml-calendar Period.t ...
AlexDenisov has joined #ocaml
<flux> ah I see you have lost yourself in the mzes of the Calendar library and came here to seek wisdom
<flux> wish we could provide it.. :)
agarwal1975 has quit [Quit: agarwal1975]
<rwmjones> I'm not actually sure it's possible
<Drup> Hum, it seems to be missing, yeah
<rwmjones> ok I wrote it by hand using Calendar.Period.ymds
mpenet has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
d0nn1e has quit [Ping timeout: 265 seconds]
d0nn1e has joined #ocaml
<companion_cube> now I use ISO8601, it only does printing and parsing, but does it well
cpdean has joined #ocaml
FreeBirdLjj has joined #ocaml
zpe has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
okuu has joined #ocaml
petroav has quit [Quit: Ex-Chat]
petroav has joined #ocaml
zpe has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 258 seconds]
shinnya has quit [Ping timeout: 260 seconds]
sepp2k has joined #ocaml
<balod> Have look at something like CalendarLib.Printer.Date.sprint?
<balod> Same goes for Calendar.sprint
petroav has quit [Ping timeout: 256 seconds]
<balod> let c = Calendar.now () in Printer.Calendar.sprint "%Y-%m-%d" c;;
mpenet has joined #ocaml
mpenet has left #ocaml [#ocaml]
AlexRussia has quit [Ping timeout: 260 seconds]
AlexRussia has joined #ocaml
sillyotter has joined #ocaml
<sgronblo> How am I supposed to search core?
Guest26 has joined #ocaml
<balod> What do you mean by search?
sillyotter has quit [Client Quit]
dhil has joined #ocaml
zaquest has quit [Quit: Leaving]
<balod> Have you tried ocp-browser?
<sgronblo> like find functions that do something for me
<sgronblo> umm yeah i hvae it installed but i am used to having a pretty doc site available in my browser
<sgronblo> also i think my merlin is weird
<balod> hmm, there was something like opam-doc but I haven't really used it in a while
<sgronblo> its giving me some really crazy autocompletion for module names when i type in Sys.
<sgronblo> so do you guys use core at all or?
<companion_cube> not me
<balod> Lol, we would have guessed ;)
<Drup> crazy autocompletion ?
<balod> I follow companion_cube lead and try to ocaml-containers whenever possible
<sgronblo> wait what was ocaml-containers now again?
<sgronblo> yet another ocaml standard library?
<companion_cube> yes indeed
<companion_cube> (more of an extension of the stdlib, in fact)
<sgronblo> oh look it has flat_map
<sgronblo> gimme your sales pitch. why should I use containers instead of core or batteries?
dmi3y has joined #ocaml
nomicflux has joined #ocaml
freusque has quit [Ping timeout: 258 seconds]
<companion_cube> sgronblo: it's more lightweight than both, doesn't depend on unix, and is quite modular ;-)
<companion_cube> (also, well, it complements the stdlib instead of replacing it, which is a bit different)
<Drup> and has pervasive good iterators
<thizanne> bonus: you can ask for some module and companion_cube writes it for you (but it must already exist in another library.)
<companion_cube> :D
<companion_cube> (I don't support this message)
dmi3y has quit [Client Quit]
dmi3y has joined #ocaml
jlongster has joined #ocaml
zpe has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 246 seconds]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexRussia has quit [Ping timeout: 260 seconds]
dhil has joined #ocaml
vfys has quit [Quit: Page closed]
Algebr` has quit [Ping timeout: 246 seconds]
FreeBirdLjj has joined #ocaml
Guest26 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
<sgronblo> all right, i'll give it a try
<sgronblo> but is it mostly a containers library like the name implies, or does it have other stuff like say file system operationrs as well?
al-damiri has joined #ocaml
AlexDenisov has quit [Client Quit]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<sgronblo> or is there maybe some other good file system manipulation library?
<companion_cube> it's mostly data structures, but also helprs for most common modules (e.g. option or format), and a few IO helpers
<sgronblo> companion_cube: would you happen to be a be vim user?
MercurialAlchemi has quit [Ping timeout: 256 seconds]
<sgronblo> I did opam install containers, put PKG containers in my .merlin file and saved, now when i try to type CCL in my source file I don't get auto completion for CCList.
yomimono has joined #ocaml
<copy`> Do you get completion when you type "CCList."?
<sgronblo> well, i get some completion, but not the right completion
<sgronblo> seems to be just completing module names
<sgronblo> :se omnifunc shows ocpindex#complete
<copy`> That's a different tool that can also do completion
<sgronblo> ooh, needed to manually enable using ctrlx ctrlo
dmi3y has quit [Quit: dmi3y]
<sgronblo> so i must have some weird you complete me settings?
<copy`> Yes
<sgronblo> got any ideas?
AlexRussia has joined #ocaml
<sgronblo> seems to be using the wrong completion type when entering a .
<copy`> I don't really know, to be honest. I just got it working with trial and error
dmi3y has joined #ocaml
seangrove has joined #ocaml
AlexDenisov has joined #ocaml
ryanartecona has joined #ocaml
AlexRussia has quit [Ping timeout: 260 seconds]
TarVanim_ has quit [Ping timeout: 265 seconds]
<companion_cube> sgronblo: yes, I'm a vim user indeed
Guest26 has joined #ocaml
<companion_cube> but not of YCM
<companion_cube> (every time I try YCM, I end up disabling it…)
TarVanimelde has joined #ocaml
AlexRussia has joined #ocaml
<sgronblo> so you manually enable the omnicompletion?
MercurialAlchemi has joined #ocaml
<balod> I use neocomplete.vim
alfredo has quit [Quit: Textual IRC Client: www.textualapp.com]
sh0t has joined #ocaml
dmi3y has quit [Quit: dmi3y]
<sgronblo> companion_cube: no partition_map for CCArray?
<companion_cube> sgronblo: hmm I go through omnicomplete
<sgronblo> companion_cube: you mean, by pressing ctrlx ctrlo?
<companion_cube> ah, I have supertab, but otherwise yes
<companion_cube> (maybe I should replace supertab actually, it doesn't work that great...)
<sgronblo> i think i might have used that ages ago
<companion_cube> (for the partition_map, I have to say no)
<companion_cube> (feature request welcome though)
dmi3y has joined #ocaml
<companion_cube> (it might fit better in Sequence though)
<sgronblo> companion_cube: also with containers do you have to remember which functions are in the normal Array and which ones are in CCArray?
<companion_cube> indeed, unless you `open Containers`, but I mostly remember
<copy`> All function from Array are also in CCArray, aren't they?
<sgronblo> nope
<copy`> Oh, not under the same name. But everything you need should be there
<sgronblo> there was no CCArray.to_list that I could find
<sgronblo> did OCaml have some special syntax for indexing arrays? Or is Array.get it?
<copy`> array.(index)
<companion_cube> a.(i)
FreeBirdLjj has joined #ocaml
<thizanne> sgronblo | there was no CCArray.to_list that I could find
brunoro_ has quit [Ping timeout: 256 seconds]
<thizanne> you do have Array.to_list, but the idea of containers is to not have this kind of function but to go through to_seq and of_seq (or whatever the exact name is)
freusque has joined #ocaml
<sgronblo> so is there supposed to be some CCSeq?
<companion_cube> there is `sequence`, a separate library
<companion_cube> (small library, that is)
<companion_cube> but you can also implement your own combinators, it's a structural type
rand__ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 248 seconds]
<sgronblo> was string supposed to have a default implementation of OrderedType?
yomimono has quit [Ping timeout: 248 seconds]
brunoro_ has joined #ocaml
veggie_ has joined #ocaml
<companion_cube> I think so
Guest26 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
brunoro_ has quit [Ping timeout: 260 seconds]
<sgronblo> how do i find it?
<Armael> well, String implements OrderedType I think?
<Armael> wherever you need a OrderedType you can pass the String module
<companion_cube> ^
<companion_cube> Map.Make(String) will work
jnavila has quit [Quit: It was time]
jwatzman|work has quit [Quit: jwatzman|work]
yomimono has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
slash^ has joined #ocaml
ygrek has joined #ocaml
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
Guest26 has joined #ocaml
dmi3y has quit [Quit: dmi3y]
brunoro_ has joined #ocaml
<sgronblo> Armael: aah yeah, didnt think of that. so module interface implementation is structurally typed it seems.
<sgronblo> btw, are there any cross platform gui libraries for ocaml that arent terrible?
manizzle has quit [Ping timeout: 256 seconds]
<copy`> js_of_ocaml *hides*
<sgronblo> companion_cube: http://cedeela.fr/~simon/software/containers/CCMap.Make.html no mention of what happens if you have duplicate keys in of_list
<Armael> I suspect the produced map contains the last occurence of the (key, value) pair
<companion_cube> yes
<sgronblo> I suspected as much too, but would be nice if the docs mentioned it
<johnelse> did anyone get around to making ocaml bindings to libui?
<johnelse> disclaimer: I don't know that libui isn't terrible
<companion_cube> sgronblo: I opened an issue, will see to it later
FreeBirdLjj has joined #ocaml
larhat has quit [Quit: Leaving.]
ontologiae has quit [Ping timeout: 246 seconds]
<sgronblo> great
brunoro_ has quit [Ping timeout: 258 seconds]
dmi3y has joined #ocaml
tane has joined #ocaml
wagle has quit [Remote host closed the connection]
wagle has joined #ocaml
nore has quit [Ping timeout: 252 seconds]
brunoro_ has joined #ocaml
Algebr` has joined #ocaml
<def`> johnelse: what do you mean by your disclaimer?
<def`> you don't know if it is good or not?
brunoro_ has quit [Ping timeout: 265 seconds]
<dmi3y> hey guys, how do I get rid of that compiler warning http://pastebin.com/TbbfEceX ?
<copy`> dmi3y: I would write: `begin match max l with Node (_, km, vm, _) -> … | _ -> raise … end`
<dmi3y> thanks @copy`, I hoped that the compiler would figure out that Empty cannot be returned by `max l` on line 39
brunoro_ has joined #ocaml
zaquest has joined #ocaml
brunoro_ has quit [Ping timeout: 248 seconds]
dmi3y has quit [Quit: dmi3y]
<copy`> dmi3y: You would need to provide a max function that never returns Empty
chris2 has quit [Ping timeout: 256 seconds]
ryanartecona_ has joined #ocaml
nore has joined #ocaml
<def`> copy`: not enough, the function return a t and that's all
ryanartecona has quit [Ping timeout: 256 seconds]
<def`> there is no finer grained information
ryanartecona has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
<copy`> True. In this case, you can just return the argument to the Node constructor
ryanartecona_ has quit [Ping timeout: 245 seconds]
dmi3y has joined #ocaml
ryanartecona has quit [Ping timeout: 256 seconds]
dmi3y has quit [Ping timeout: 250 seconds]
ryanartecona has joined #ocaml
chris2 has joined #ocaml
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 240 seconds]
seangrove has quit [Remote host closed the connection]
seangrove has joined #ocaml
AltGr has left #ocaml [#ocaml]
malc_ has joined #ocaml
nomicflux has quit [Quit: nomicflux]
jnavila has joined #ocaml
djellemah has joined #ocaml
AlexDenisov has joined #ocaml
cpdean has quit [Ping timeout: 252 seconds]
kakadu has joined #ocaml
AlexDenisov has quit [Ping timeout: 246 seconds]
sh0t has quit [Quit: Leaving]
jnavila has quit [Ping timeout: 260 seconds]
brunoro_ has joined #ocaml
NingaLeaf has joined #ocaml
NingaLeaf has quit [Client Quit]
NingaLeaf has joined #ocaml
agarwal1975 has joined #ocaml
brunoro_ has quit [Ping timeout: 265 seconds]
brunoro_ has joined #ocaml
jnavila has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
dhil has quit [Ping timeout: 252 seconds]
cpdean has joined #ocaml
octachron has joined #ocaml
AlexDenisov has joined #ocaml
seangrove has quit [Ping timeout: 246 seconds]
AlexDenisov has quit [Ping timeout: 246 seconds]
AlexDenisov has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
malc_ has quit [Remote host closed the connection]
brunoro_ has quit [Ping timeout: 260 seconds]
yomimono has quit [Quit: Leaving]
madroach has quit [Ping timeout: 264 seconds]
FreeBirdLjj has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
brunoro_ has joined #ocaml
madroach has joined #ocaml
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Read error: Connection reset by peer]
veggie_ has quit [Ping timeout: 250 seconds]
brunoro_ has quit [Ping timeout: 244 seconds]
brunoro_ has joined #ocaml
nomicflux has joined #ocaml
veggie_ has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
brunoro_ has quit [Ping timeout: 256 seconds]
brunoro_ has joined #ocaml
Guest26 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Guest26 has joined #ocaml
brunoro_ has quit [Ping timeout: 256 seconds]
chris2 has quit [Ping timeout: 246 seconds]
octachron has quit [Quit: Leaving]
Guest26 has quit [Quit: Textual IRC Client: www.textualapp.com]
brunoro_ has joined #ocaml
ryanartecona has joined #ocaml
zaquest has quit [Quit: Leaving]
chris2 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
brunoro_ has quit [Ping timeout: 258 seconds]
pierpa has quit [Ping timeout: 240 seconds]
<Leonidas> companion_cube: the link in the containers README 404's: http://cedeela.fr/~simon/software/containers/Containers_string
<Leonidas> companion_cube: is there any data structure in containers which allows fast range searches?
<companion_cube> how do you mean?
<companion_cube> (also, thanks for the 404(
<companion_cube> (know any tool to crawl and find this kind of errors?)
<Leonidas> companion_cube: If I want to store records having a integral count field for example and I want to find all entries which have a count of 4 to 10 for example
<Leonidas> (no, unfortunately I am not aware of any such tool to detect that in a conventient way)
<companion_cube> (sad)
<companion_cube> what you ask should be possible with any balanced tree, if the records are stored by the lookup key
<companion_cube> it seems like CCWBT does not provide this though -_-
<companion_cube> lazy me
<Leonidas> companion_cube: but that requires that the lookup key is unique, correct?
<companion_cube> ahh, this
<companion_cube> hmm, so you want a kind of set (say) indexed by some subkey(s)?
<companion_cube> doesn't sound too easy to make efficient
FreeBirdLjj has quit [Remote host closed the connection]
<companion_cube> (I mean, except as a custom structure based on several maps)
<kakadu> I have a kind of issue with currying.... https://gist.github.com/Kakadu/7f892aff4f878b1d943c9382027916b3 Do you know how to deal with 'b in types like ('a, ('b, t) app) app ? (beware. Higher kinds)
<Leonidas> yeah, I am basically looking for something like an index :)
<cpdean> anyone up to help me with this ocaml MOOC homework? simplifying expressions by applying various identity rules https://www.fun-mooc.fr/courses/parisdiderot/56002S02/session02/courseware/W3/W3S2/
<cpdean> i have this problem where when a sub expression simplifies to a 0, its parent should then be re-simplified
<cpdean> i'm not sure how to get that to work
<Leonidas> cpdean: this web site is not available for people not logged in
<cpdean> bummer... i'll see if i can explain it
<cpdean> you have some types that represent math expressions
<cpdean> and there are some functions you can write to either simplify the expression or evaluate it
<cpdean> and you can write them recursively to walk down the syntax tree and manipulate it
orbifx has joined #ocaml
<cpdean> when you have an expression like "x + 0", you can simplify that subtree as just "x"
<Leonidas> yes
<cpdean> but say you have "x + 0 + y"
<cpdean> that could simplify to "x + y", but you have to recursively simplify x and y
<cpdean> if either of them simplify to 0, then you have to remove them as well
<Leonidas> you have to parse it as ((x + 0) + y)
<Leonidas> ah, I see what you mean
<Leonidas> isn't the solution to depth-first simplify?
<cpdean> failing implementation and test cases at bottom
<Leonidas> cpdean: wow, not wanting to complain, the way you indent and place the | makes it tricky to read ;)
<cpdean> find me a vim plugin i'll intent your world
<cpdean> indent**
<cpdean> so for example EMul (a, b) -> (EMul (simplify a, simplify b))
<cpdean> mm cool i'll check that out
<Leonidas> cpdean: aren't you just missing a call to simplify in line 77 and 78?
<cpdean> i tried adding another call to simplify and it resulted in infinite recursion
agarwal1975 has joined #ocaml
<cpdean> EMul (a, b) -> simplify (EMul (simplify a, simplify b)) |
veggie_ has quit [Ping timeout: 265 seconds]
<Leonidas> oh, heh
<cpdean> now that subtree gets evaluted every time it gets evaluated etc etc
<Leonidas> yes
<Leonidas> how about matching in line 77 on (simplify a, simplify b) and seeing if either of those simplified to EInt 0?
fre has joined #ocaml
<cpdean> oh interesting
noddy has quit [Ping timeout: 244 seconds]
<cpdean> so basically evaluting the children ahead of time
<cpdean> i can try that
<Leonidas> exactly
<cpdean> Leonidas: would that be a match..with inside the line 77/78 branches then?
<Leonidas> yes, exactly
sepp2k has quit [Quit: Leaving.]
<cpdean> so i'd have to copy that "(0, a) | (a, 0)" noise from above... is there any way to write that cleaner?
<Leonidas> match simplify a, simplify b with | … | … | a, b -> …
rand__ has quit [Quit: leaving]
<jnavila> Hi, I just switched to ocaml 4.04.0 using opam. When trying to use merlin in emacs, I get the following error:
<jnavila> "Error: /home/jnavila/.opam/4.04.0/lib/ocaml/pervasives.cmi
<jnavila> is not a compiled interface for this version of OCaml.
<jnavila> It seems to be for a newer version of OCaml."
<Leonidas> cpdean: hmm, it's 3 cases, I don't think these go much easier
<cpdean> jnavila: when i had a similar problem using opam switch, i had to re install merlin and the packages of my project with opam
<Leonidas> jnavila: have you cleaned your _build (or whereever your build artifacts are)?
<jnavila> cpdean: ok, will try
<jnavila> Leonidas: The problem is with pervasives.cmi!
<Leonidas> yes, opam switch requires reinstallation of all packages
<Leonidas> but there is opam switch export/import
veggie_ has joined #ocaml
<jnavila> Leonidas: I did import/export. The merlin process is launched from the 4.04.0 opam env
<Algebr`> merlin doesn't work with 4.04 yet
<jnavila> Algebr`: Ah... OK. I'm not alone. Time to switch back to 4.03 then.
<jnavila> Algebr`: for the sake of it, what's wrong with 4.04?
<Algebr`> don't know, def told me when I posted the same issue. I think he said that HEAD on merlin repo works
<cpdean> Leonidas: this seems to work out now, thanks! https://gist.github.com/cpdean/d96400d3271bfe13f63d79a740e92d57
<cpdean> Leonidas: any thoughts on how to make stuff cleaner?
<Leonidas> cpdean: write matches like OCaml people do :)
<cpdean> yes how
<cpdean> you mean indentation?
<Leonidas> match … with \n | pattern -> result \n | pattern -> result
<Algebr`> cpdean: and use ocp-indent
<Leonidas> that is, write the | in front of the pattern, not at the end
<Leonidas> cpdean: let rec eval expression = match expression with
<cpdean> ah, yeah i've seen both pipe in front an at the back -- wasn't sure why there were two ways to do it
<Leonidas> cpdean: let rec eval = function
<Leonidas> cpdean: that's equivalent and does not require naming an argument which will be pattern matched later
<Leonidas> cpdean: for things like type foo = A | B | C (one line) it's common
<Leonidas> but I never saw it in the back
<Leonidas> cpdean: you can remove all the ';;' as well
<cpdean> k
<Leonidas> ';;' is only used in the toplevel
<cpdean> i have ;; everywhere so that its easier for me to test functions, i have a keybinding to send text to utop
<cpdean> but yeah i can see how it shouldn't be in a .ml file
<Leonidas> cpdean: yeah, but then I wouldn't clutter the .ml file but rather add ;; programmatically before sending it to utop
<Leonidas> yeah, that's about it. 'function', ocp-indent and the '|'
<cpdean> Leonidas: oh that's a good idea, i'll see if i can change this binding
<cpdean> Leonidas: can you use the `when` guard in `function` pattern matching?
<Leonidas> cpdean: sure, it's a regular pattern match
<Leonidas> it's just syntactic sugar which I happen to like because I love not naming things :D
<cpdean> so the only difference between `function` and `match..with` is `function` only lets you evaluate a single arg and `match..with` you can add extra function calls over "foo" in `match foo with` ?
brunoro_ has joined #ocaml
<cpdean> well i guess match..with is still over a single arg anyway
<cpdean> you can just pack it in a tuple to be unpacked on the patterns
<Leonidas> yes, if you want to think about it this way
ocaml508 has joined #ocaml
<Leonidas> cpdean: but a 'function' can take multiple arguments
<cpdean> could you show me an example?
<Leonidas> let rec a b = function | _ -> a;;
<Leonidas> this is a function with 3 arguments
<Leonidas> let rec a b c = match c with | _ -> a;;
<Leonidas> (never mind the rec is useless)
<cpdean> so... in both those cases you return the function def itself?
<Leonidas> oh, let me fix that
brunoro_ has quit [Ping timeout: 260 seconds]
<Leonidas> let oh_my a = function | _ -> a;; is equivalent to let oh_my a b = match b with | _ -> a;;
<cpdean> k that makes sense
jnavila has quit [Remote host closed the connection]
noddy has joined #ocaml
zpe has joined #ocaml
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 260 seconds]
fre has quit [Ping timeout: 256 seconds]
NingaLeaf has quit [Quit: Leaving]
brunoro_ has joined #ocaml
minn has joined #ocaml
brunoro_ has quit [Ping timeout: 265 seconds]
yomimono has joined #ocaml
nomicflux has quit [Quit: nomicflux]
brunoro_ has joined #ocaml
zpe has quit [Remote host closed the connection]
silver_ has joined #ocaml
brunoro_ has quit [Ping timeout: 260 seconds]
silver has quit [Ping timeout: 256 seconds]
brunoro_ has joined #ocaml
silver_ has quit [Read error: Connection reset by peer]
brunoro_ has quit [Ping timeout: 246 seconds]
demonimin has quit [Remote host closed the connection]
brunoro_ has joined #ocaml
jao has joined #ocaml
demonimin has joined #ocaml
brunoro_ has quit [Ping timeout: 252 seconds]
<orbifx> how can I control what files get installed with Opam's install: ?
<orbifx> say I wan to use "make install"
Algebr` has quit [Ping timeout: 260 seconds]
demonimin has quit [Remote host closed the connection]
veggie_ has quit [Ping timeout: 260 seconds]
AlexDeni_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nomicflux has joined #ocaml
demonimin has joined #ocaml
kakadu has quit [Remote host closed the connection]
brunoro_ has joined #ocaml
veggie_ has joined #ocaml
demonimin has quit [Remote host closed the connection]
nomicflux has quit [Quit: nomicflux]
tane has quit [Quit: Leaving]
brunoro_ has quit [Ping timeout: 256 seconds]
orbifx-m has joined #ocaml
demonimin has joined #ocaml
vbmithr_ has quit [Quit: leaving]
vbmithr has joined #ocaml
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 246 seconds]
brunoro_ has joined #ocaml
Simn has quit [Quit: Leaving]
rgrinberg has joined #ocaml
orbifx has quit [Ping timeout: 244 seconds]
orbifx-m2 has joined #ocaml
orbifx-m has quit [Ping timeout: 246 seconds]
rgrinberg has left #ocaml [#ocaml]
rgrinberg has joined #ocaml
ocaml571 has joined #ocaml
brunoro_ has quit [Ping timeout: 265 seconds]
<ocaml571> I use atdgen to generate yojson parser, but if i try to read the json in python i get an error. The angle brackets are the problem
<ocaml571> {"cmd":<"Connection_Open":{"protocol":"bla","version":2,"address":"bla"}>}
<ocaml571> what do i have to change_
<ocaml571> ?
orbifx has joined #ocaml
demonimin has quit [Remote host closed the connection]
brunoro_ has joined #ocaml
agarwal1975 has quit [Ping timeout: 244 seconds]
demonimin has joined #ocaml
brunoro_ has quit [Ping timeout: 265 seconds]
Onemorenickname_ has joined #ocaml
orbifx-m has joined #ocaml