adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
ncthom91 has quit [Quit: Textual IRC Client: www.textualapp.com]
^elyse^ has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
ryanartecona has joined #ocaml
<Drup> can't really help :/
madroach has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
lobo has quit [Quit: leaving]
jonludlam has quit [Ping timeout: 276 seconds]
^elyse^ has quit [Quit: Leaving...]
nullcatxxx_ has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
kevinch has joined #ocaml
NingaLeaf has quit [Quit: Leaving]
damason has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
NingaLeaf has joined #ocaml
NingaLeaf has quit [Client Quit]
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
NingaLeaf has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
yegods has quit [Read error: Connection reset by peer]
yegods_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
shinnya has joined #ocaml
yegods has joined #ocaml
yegods_ has quit [Read error: Connection reset by peer]
kevinch has quit [Quit: Computer has gone to sleep.]
<coody> What's the preferred way to create a mapping between a variant and ints? A map? Pattern matching (which would mean I'd have to type it out twice?)? Something else?
FreeBirdLjj has joined #ocaml
pierpa` has joined #ocaml
yegods_ has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
kushal has joined #ocaml
fluter has quit [Ping timeout: 240 seconds]
fluter has joined #ocaml
ceryo has joined #ocaml
ceryo has quit [Ping timeout: 276 seconds]
igoroliveira has quit [Quit: Connection closed for inactivity]
ceryo has joined #ocaml
Algebr has joined #ocaml
Algebr has quit [Remote host closed the connection]
<mahem1_> coody: Just straight forward partern matching?
<mahem1_> But honestly it really doesn't matter what you do just as long it is only done once in a function, right?
yegods_ has quit [Remote host closed the connection]
ceryo_ has joined #ocaml
ceryo_ has quit [Client Quit]
zv has joined #ocaml
ceryo has quit [Ping timeout: 255 seconds]
ryanartecona has joined #ocaml
Algebr has joined #ocaml
kevinch has joined #ocaml
<coody> mahem1_: I need to do the conversion in both directions, but I don't want to write it out twice
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
<mahem1_> coody: Well, in that case I guess you could just have a original (variant * int) list and dynamically (runtime) create the complementing (int * variant) list.
<mahem1_> Though if lists are too hard to work with a Hashtbl would suffice.
fluter has quit [Quit: WeeChat 1.2]
fluter has joined #ocaml
<mahem1_> Or a map.
nuuit has quit [Ping timeout: 265 seconds]
<coody> I see
shinnya has quit [Ping timeout: 264 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
infinity0 has quit [Remote host closed the connection]
pyon has joined #ocaml
infinity0 has joined #ocaml
moei has quit [Quit: Leaving...]
moei has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
systmkor has quit [Ping timeout: 272 seconds]
Algebr has quit [Ping timeout: 240 seconds]
kevinch has quit [Quit: Computer has gone to sleep.]
kevinch has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
vishesh has quit [Quit: WeeChat 1.1.1]
vishesh has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
damason has quit [Ping timeout: 264 seconds]
mac10688 has quit [Ping timeout: 264 seconds]
teknozulu has joined #ocaml
darkf has joined #ocaml
Mercuria1Alchemi has joined #ocaml
psy_ has quit [Remote host closed the connection]
contempt has quit [Remote host closed the connection]
Mercuria1Alchemi has quit [Ping timeout: 276 seconds]
kevinch has quit [Quit: Computer has gone to sleep.]
contempt has joined #ocaml
rand has joined #ocaml
NingaLeaf has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kushal has quit [Ping timeout: 260 seconds]
kushal has joined #ocaml
teknozulu has quit [Ping timeout: 276 seconds]
pierpa` has quit [Ping timeout: 246 seconds]
python476 has joined #ocaml
coody has quit [Quit: Connection closed for inactivity]
ygrek has joined #ocaml
Simn has joined #ocaml
bbc has left #ocaml ["Quit"]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tmtwd has joined #ocaml
AlexRussia has quit [Ping timeout: 244 seconds]
AltGr has joined #ocaml
ljs has joined #ocaml
marynate has joined #ocaml
freehck has joined #ocaml
tmtwd has quit [Ping timeout: 252 seconds]
ljs has quit [Quit: None]
jeffmo has joined #ocaml
freehck has quit [Remote host closed the connection]
freehck has joined #ocaml
rand has quit [Quit: leaving]
jccnd has quit [Quit: jccnd]
sh0t has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
orbifx has joined #ocaml
Haudegen has joined #ocaml
sh0t has quit [Ping timeout: 260 seconds]
jeffmo has quit [Quit: jeffmo]
yegods has joined #ocaml
larhat has quit [Quit: Leaving.]
yegods has quit [Remote host closed the connection]
<orbifx> hello #ocaml
jonludlam has joined #ocaml
jonludlam has quit [Ping timeout: 265 seconds]
marynate has quit [Ping timeout: 272 seconds]
<orbifx> s
marynate has joined #ocaml
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
zpe has joined #ocaml
agumonkey has quit [Ping timeout: 260 seconds]
mort___ has joined #ocaml
python476 has quit [Ping timeout: 246 seconds]
python476 has joined #ocaml
Kakadu has joined #ocaml
samuel02 has joined #ocaml
marynate has quit [Ping timeout: 276 seconds]
marynate has joined #ocaml
samuel02 has quit []
mort___ has quit [Quit: Leaving.]
Bahman has joined #ocaml
raphaelss has joined #ocaml
yegods has joined #ocaml
FreeBird_ has joined #ocaml
yegods has quit [Remote host closed the connection]
AltGr has left #ocaml [#ocaml]
FreeBirdLjj has quit [Ping timeout: 272 seconds]
FreeBird_ has quit [Ping timeout: 272 seconds]
ocp has joined #ocaml
<Bahman> `List` is a persistent list, right?
<dmbaturin> Bahman: Yes, it's immutable.
<Bahman> dmbaturin: Indulge me, but immutable and persistent, right? :-)
<dmbaturin> Bahman: What is your definition of persistent? :)
<Bahman> dmbaturin: Imagine `let foolist = [1;2] in let barlist = (3 :: foolist) in ... `
<Bahman> A persistent list impl, wouldn't make `barlist` a list of size 3 in memory. Instead it uses the data alread in `foolist` and creates a new list with a head=3 and tail pointing to `foolist`.
<Bahman> I hope that makes sense :-)
<dmbaturin> Yes, making a new list keeps previous versions intact and uses structural sharing.
<Bahman> Ah...excellent. Thanks dmbaturin.
<dmbaturin> Bahman: Most commonly I see 'fully persistent' defined as 'all previous versions remains accessible', but it doesn't really say anything about structural sharing. :)
ygrek has quit [Ping timeout: 240 seconds]
ddosia has joined #ocaml
<Bahman> dmbaturin: Reading the Wikipedia page on the topic...I'm surprised I didn't do that earlier...you're right.
<Bahman> The structural sharing thing is a bonus but not a necessity.
<Bahman> You see, I did this immutable List impl in Java...it worked as expected...except that the performance and memory consumption was awful :-)
<Bahman> Java's lists do not share structure and I didn't do that either.
<Bahman> Hence my sensitivity to the topic.
<dmbaturin> Bahman: Python tuples are also immutable (as in you can't modify it), but apparently use full copying.
<Bahman> Yes...that's exactly what I did with my lists.
<Bahman> Clojure's lists are persistent with structural sharing.
<Bahman> Other Schemes, I guess, don't do this.
<Bahman> Thanks for the assist.
infinity0 has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
infinity0 has joined #ocaml
osheeta has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Client Quit]
dsheets has joined #ocaml
kushal has quit [Ping timeout: 240 seconds]
igoroliveira has joined #ocaml
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
marynate has quit [Ping timeout: 260 seconds]
mort___ has joined #ocaml
metadave has quit [Quit: Connection closed for inactivity]
NingaLeaf has joined #ocaml
charpi has quit [Remote host closed the connection]
fluter has quit [Ping timeout: 272 seconds]
freehck has quit [Ping timeout: 240 seconds]
fluter has joined #ocaml
python476 has quit [Ping timeout: 246 seconds]
python476 has joined #ocaml
fluter has quit [Ping timeout: 252 seconds]
yegods has joined #ocaml
fluter has joined #ocaml
kushal has joined #ocaml
NingaLeaf has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
BitPuffin has joined #ocaml
infinity0 has quit [Remote host closed the connection]
agumonkey has joined #ocaml
infinity0 has joined #ocaml
Haudegen has quit [Ping timeout: 264 seconds]
yegods has quit [Remote host closed the connection]
ceryo has joined #ocaml
zpe has quit [Remote host closed the connection]
freehck has joined #ocaml
coody has joined #ocaml
Haudegen has joined #ocaml
ryanartecona has joined #ocaml
fluter has quit [Ping timeout: 272 seconds]
AlexRussia has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
BitPuffin has quit [Read error: Connection reset by peer]
BitPuffin has joined #ocaml
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
dsheets has quit [Ping timeout: 272 seconds]
yegods has joined #ocaml
fluter has joined #ocaml
yegods has quit [Remote host closed the connection]
dsheets has joined #ocaml
yegods has joined #ocaml
pierpa` has joined #ocaml
mthom``` has joined #ocaml
yegods has quit [Remote host closed the connection]
mthom`` has quit [Read error: Connection reset by peer]
raphaelss has quit [Remote host closed the connection]
sepp2k has joined #ocaml
yegods has joined #ocaml
<Leonidas> dmbaturin: Python tuples are usually rather tiny with just a couple of elements and usually not modified (as in, appending or deleting items), so I don't think implementing structural sharing would be an advantage.
Haudegen has quit [Remote host closed the connection]
ceryo_ has joined #ocaml
zpe has joined #ocaml
ceryo has quit [Ping timeout: 240 seconds]
<Drup> also, memory sharing would add indirections and kill locality.
cow-orke1 has quit [Ping timeout: 240 seconds]
<dmbaturin> Leonidas: Well, true, I think it's still a good example of complicated relationships between immutability, persistence, and sharing.
cow-orker has joined #ocaml
<Leonidas> absolutely!
ceryo has joined #ocaml
cow-orker has quit [Ping timeout: 240 seconds]
ceryo_ has quit [Ping timeout: 255 seconds]
OnkV has joined #ocaml
cow-orker has joined #ocaml
cow-orker has quit [Ping timeout: 240 seconds]
cow-orker has joined #ocaml
shinnya has joined #ocaml
ohama has quit [Ping timeout: 244 seconds]
ohama has joined #ocaml
Kakadu has quit [Ping timeout: 246 seconds]
MercurialAlchemi has quit [Ping timeout: 264 seconds]
BitPuffin is now known as KHAAAAAAN
octachron has joined #ocaml
kevinch has joined #ocaml
ryanartecona has joined #ocaml
<orbifx> I just realised that despite the name, Ocaml doesn't use CamelCase!
<theblatte> but it does... it's OCaml!
<theblatte> can opam tell me which "switch" it's currently using?
<Drup> opam sw sh
<theblatte> I would like to save it somewhere, then `opam switch <other version>`, do stuff, then `opam switch <previous version>`, but I don't know how to get <previous version>
<theblatte> Drup: yay, thanks! :)
<Drup> (you can see that I use it often, because I minimized the chars :D)
<edwin> opam config exec --switch=foo -- cmd ...
<Drup> but yeah, for your use case; you don't even need to switch
<Drup> just do what edwin said
<edwin> depends what you want to run, if its other opam commands not sure if opam config exec works, but for building stuff/running apps its fine
<theblatte> well I need to do a bunch of things, but maybe I can put them in yet another script...
<theblatte> I need to opam install some stuff, then run a bunch of compilation commands
<Drup> theblatte: in this case, just eval `opam config env --switch FOO`
<Drup> it will switch locally in the given shell without switching globally
<theblatte> ooh, neat!
slash^ has joined #ocaml
<dmbaturin> orbifx: CamelCase DataConstructors AreCommon.
<dmbaturin> Not_universal But_still. :)
<Drup> Not_To_Forget The_Last_Convention
<theblatte> irk
<Drup> indeed
<theblatte> please_don't
<orbifx> dmbaturin: yeah I know. Just messing. OCaml seems to have the right amount of camel case and at the right places. Doing some QML now and camel casing everywhere is dizzying
<Drup> The only lovable CamelCase is the BatConvention
<dmbaturin> orbifx: How's your config management project going?
<orbifx> not too far yet I'm doing some passwd management now
<orbifx> just to get a version finished
<orbifx> after that I will look into a more generalised approach at which point we can work together on something.
<orbifx> something complex, convoluted and generally 1337 :P
<orbifx> j/k
ryanartecona has quit [Quit: ryanartecona]
psy_ has joined #ocaml
MercurialAlchemi has joined #ocaml
lobo has joined #ocaml
^elyse^ has joined #ocaml
shinnya has quit [Ping timeout: 272 seconds]
ryanartecona has joined #ocaml
LnL has quit [Quit: ZNC - http://znc.in]
<orbifx> dmbaturin: hope you saw the message
<orbifx> takes time cause I'm doing this on my spare-spare time :P
<reynir> What config management project are you working on?
ncthom91 has joined #ocaml
yegods_ has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
<orbifx> reynir: I am making an automated server
<orbifx> dmbaturin: is doing some remotely controlled routers
<reynir> cool! :)
<orbifx> so we are thinking of joining forces and making a unified linux configuration control panel with mad features
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
orbifx has quit [Quit: WeeChat 1.3]
zpe has quit [Ping timeout: 240 seconds]
tmtwd has joined #ocaml
<Bahman> Is there any general "groupBy" function for lists?
<Bahman> groupBy : ('b -> 'a) -> 'b list -> 'a list Map.t
yegods_ has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
pierpa` has quit [Ping timeout: 255 seconds]
<Bahman> Sorry...correction... `groupBy : ('b -> 'a) -> 'b list -> 'b list Map.t` where `Map.key = 'a`
sepp2k has quit [Quit: Leaving.]
orbifx has joined #ocaml
python476 has quit [Ping timeout: 246 seconds]
<reynir> Bahman: you can use List.fold_left
<Bahman> reynir: But I should know in advance the type of the Map keys, right?
<infinity0> in .merlin, is there a better option than CMT /home/*/.opam/4.02.3/build/**/_build
<infinity0> the /home/* part is what i don't like, and ~/ doesn't seem to work
<Bahman> reynir: For example I have this naive version (http://pastebin.com/1gjaVj8C) assuming the keys are string.
<Bahman> But am not sure how should I generalise this to keys of 'c type.
<def`> let grpBinding = try MM.find grp acc with Not_found -> []
<def`> that will simplify your code
<def`> Bahman: and no, there is no parametric way to achieve what you want
<def`> either use a Hashtable or pass the appropriate map in some way
<Bahman> def`: Thanks for the help.
<reynir> you could use a functor I guess
octachron has quit [Quit: Leaving]
ocp has quit [Quit: Leaving.]
orbifx has quit [Ping timeout: 272 seconds]
kolko has joined #ocaml
<Bahman> This is what I came up with: https://gist.github.com/bahmanm/4121bf991736fd4380bb
python476 has joined #ocaml
nullcatxxx_ has joined #ocaml
kolko has quit [Quit: ZNC - http://znc.in]
ygrek has joined #ocaml
Guest38 has joined #ocaml
kolko has joined #ocaml
Bahman has quit [Quit: Ave atque vale]
ygrek has quit [Ping timeout: 250 seconds]
OnkV has quit [Ping timeout: 246 seconds]
larhat has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yegods has quit [Read error: Connection reset by peer]
yegods_ has joined #ocaml
nullcatxxx_ has joined #ocaml
Haudegen has joined #ocaml
larhat has quit [Quit: Leaving.]
Haudegen has quit [Ping timeout: 276 seconds]
ygrek has joined #ocaml
contempt has quit [Disconnected by services]
contempt has joined #ocaml
Haudegen has joined #ocaml
KHAAAAAAN has quit [Ping timeout: 276 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ryanartecona has quit [Quit: ryanartecona]
TheAuGingembre has quit [Ping timeout: 264 seconds]
shinnya has joined #ocaml
mort___ has quit [Ping timeout: 240 seconds]
pierpa` has joined #ocaml
darkf has quit [Quit: Leaving]
JacobEdelman has joined #ocaml
<JacobEdelman> I hereby grant Printf.printf the award for least helpful error message
Haudegen has quit [Ping timeout: 260 seconds]
dsheets has quit [Ping timeout: 272 seconds]
ceryo has quit [Quit: Textual IRC Client: www.textualapp.com]
cyraxjoe_ has joined #ocaml
kushal has quit [Ping timeout: 252 seconds]
cyraxjoe has quit [Ping timeout: 260 seconds]
ismaelga has joined #ocaml
cyraxjoe_ is now known as cyraxjoe
yegods_ has quit [Remote host closed the connection]
Kakadu has joined #ocaml
yegods has joined #ocaml
mort___ has joined #ocaml
yegods has quit []
Haudegen has joined #ocaml
yegods has joined #ocaml
ismaelga has quit [Remote host closed the connection]
nullcatxxx_ has joined #ocaml
ryanartecona has joined #ocaml
NingaLeaf has joined #ocaml
BitPuffin|osx has joined #ocaml
freehck has quit [Remote host closed the connection]
kevinch has quit [Quit: Computer has gone to sleep.]
sepp2k has joined #ocaml
sepp2k has quit [Client Quit]
sh0t has joined #ocaml
mort___ has quit [Quit: Leaving.]
voldial has quit [Quit: WeeChat 1.2-dev]
yegods has quit [Remote host closed the connection]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
systmkor has joined #ocaml
yegods has joined #ocaml
Haudegen has quit [Ping timeout: 255 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ollehar has joined #ocaml
ddosia has quit [Quit: Connection closed for inactivity]
raphaelss has joined #ocaml
NingaLeaf has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ncthom91 has quit [Ping timeout: 240 seconds]
raphaelss has quit [Ping timeout: 240 seconds]
raphaelss has joined #ocaml
Haudegen has joined #ocaml
yegods_ has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
ncthom91 has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
kevinch has joined #ocaml
ollehar has quit [Ping timeout: 252 seconds]
python476 has quit [Ping timeout: 246 seconds]
larhat has joined #ocaml
sh0t has quit [Ping timeout: 260 seconds]
raphaelss has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
ryanartecona has quit [Quit: ryanartecona]
ollehar has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kakadu has quit [Ping timeout: 240 seconds]
zv has quit [Ping timeout: 260 seconds]
mac10688 has joined #ocaml
ygrek has joined #ocaml
zv has joined #ocaml
pierpa` has quit [Ping timeout: 240 seconds]
aphprentice has quit [Ping timeout: 272 seconds]
pootler has quit [Ping timeout: 264 seconds]
sz0 has quit [Ping timeout: 250 seconds]
coody has quit [Ping timeout: 272 seconds]
ollehar has quit [Ping timeout: 252 seconds]
raphaelss has joined #ocaml
Simn has quit [Quit: Leaving]
ryanartecona has joined #ocaml
pootler has joined #ocaml
sz0 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
raphaelsss has joined #ocaml
raphaelss has quit [Ping timeout: 240 seconds]
raphaelsss has quit [Ping timeout: 240 seconds]
sepp2k has joined #ocaml
ollehar has joined #ocaml
teknozulu has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
nullcatxxx_ has joined #ocaml
pyx has joined #ocaml
grantwu has joined #ocaml
<grantwu> I just installed ocaml with apt and ran opam install core utop
<grantwu> Apparently this failed: - install camlp4.4.01+system