<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
<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?
<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)
<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