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
hilquias` has joined #ocaml
hilquias has quit [Ping timeout: 245 seconds]
badon has joined #ocaml
travisbrady has joined #ocaml
Thooms has quit [Ping timeout: 245 seconds]
swgillespie has quit [Ping timeout: 246 seconds]
thomasga has quit [Quit: Leaving.]
ygrek has joined #ocaml
AltGr has joined #ocaml
kaiyin has joined #ocaml
<kaiyin> some people say that idomatic ocaml is faster than idiomatic haskell, to what extent is this claim true?
<vanila> haskell is really slow
jabesed has joined #ocaml
mariusae has joined #ocaml
iorivur has joined #ocaml
<tokenrove> kaiyin: reasoning about performance is easier in ocaml. i wouldn't trust the shootout results too much; they don't seem to have convinced everyone to switch to ATS.
<tokenrove> a huge amount of work has gone into ghc, and for many problems, acceptable performance is available from the usual implementations of either language.
mcclurmc has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 264 seconds]
<kaiyin> ok
madroach has joined #ocaml
<kaiyin> what ide do you use for ocaml?
badkins has joined #ocaml
travisbrady has quit [Quit: travisbrady]
<vanila> kaiyin, well i think that is not representative
<kaiyin> yeah, performance is not easy to measure.
<tokenrove> kaiyin: i like emacs with tuareg and merlin. i understand there are some alternatives but i'm not familiar with them.
<vanila> i find tuareg extremely irritating with ridiculous indentation :S
<vanila> i think there must be an option, beacuse no one can seriously program ocaml with the default?
<kaiyin> vanila: what's your favorite for ocaml then?
<kaiyin> vanila: what's your favorite ide for ocaml then?
<vanila> well i use tuareg :S
<vanila> but it's always a struggle against the identation
<vanila> i was wondering if people configure it to make it nicer
<Leonidas> no, they directly switch to vim :p
<vanila> does vim have a nice mode for ocaml?
<Leonidas> that said, merlin IS indeed quite awesome
<tokenrove> vanila: i find it idiosyncratic but not bad once one gets used to it. there is also the caml mode which is much simpler.
<vanila> ok, ill try it out!
<Leonidas> vanila: well, depends on what you consider nice. I am quite satisfied with how vim handles ocaml more or less out of the box.
<tokenrove> tuareg-mode used to be much worse, though; i remember it doing a lot of things in really idiosyncratic, un-emacs-y ways, but when i came back to using it last year, it seemed much improved.
rgrinberg has quit [Quit: Leaving.]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ has quit [Remote host closed the connection]
S11001001 has joined #ocaml
travisbrady has joined #ocaml
reem has quit [Remote host closed the connection]
reem has joined #ocaml
badon has joined #ocaml
reem has quit [Ping timeout: 245 seconds]
<smondet> vanila: just use `ocp-indent` for indentation instead of tuareg's (I actually switched to caml-mode also)
iorivur has quit [Ping timeout: 252 seconds]
reem has joined #ocaml
Guest54521 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kbp has joined #ocaml
yminsky has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
ontologiae has quit [Ping timeout: 252 seconds]
Pepe_ has quit [Remote host closed the connection]
iorivur has joined #ocaml
oriba has joined #ocaml
travisbrady has quit [Quit: travisbrady]
Pepe_ has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
travisbrady has joined #ocaml
Pepe_ has quit [Remote host closed the connection]
ygrek has joined #ocaml
MrScout__ has joined #ocaml
oriba has quit [Quit: oriba]
MrScout_ has quit [Ping timeout: 245 seconds]
Pepe_ has joined #ocaml
skinkitten has quit [Quit: Leaving]
yminsky has quit [Quit: yminsky]
ollehar1 has joined #ocaml
mcclurmc has joined #ocaml
badkins_ has joined #ocaml
badkins has quit [Ping timeout: 245 seconds]
RossJH has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yminsky has joined #ocaml
darkf has joined #ocaml
mjw56 has joined #ocaml
yminsky has quit [Quit: yminsky]
swgillespie has joined #ocaml
yminsky has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
q66 has quit [Quit: Leaving]
Denommus` has joined #ocaml
<Algebr> <- is not actually a function but part of the grammar?
<ollehar1> Algebr: ?
kapil__ has joined #ocaml
<Algebr> nvm
bobpoekert has joined #ocaml
enitiz has joined #ocaml
rgrinberg has joined #ocaml
MrScout__ has quit [Remote host closed the connection]
Nijikokun has joined #ocaml
Denommus` has quit [Quit: rebooting]
claudiuc has quit [Remote host closed the connection]
enitiz has quit [Quit: Leaving]
enitiz has joined #ocaml
Denommus` has joined #ocaml
ollehar1 has quit [Quit: ollehar1]
travisbrady has quit [Quit: travisbrady]
rgrinberg has quit [Quit: Leaving.]
Axle has joined #ocaml
kbp has left #ocaml ["ERC (IRC client for Emacs 25.0.50.1)"]
yminsky has quit [Quit: yminsky]
chinglish has joined #ocaml
<struktured> companion_cube: in containers, is there a max capacity queue with LIFO semantics, and the oldest element is removed when the queue is saturated? A ring buffer would work, for instance.
enitiz has quit [Ping timeout: 246 seconds]
_a has joined #ocaml
<_a> hello
<_a> anybody can explain what dark sorcery in performed in CamlInternalFormat?
<_a> (Or have the time to ?)
<whitequark> Algebr: a field is not a first-class value
<whitequark> _a: are you the same person who posted to caml-list?
<whitequark> you don't have to use CamlinternalFormat
<_a> I know
<whitequark> you just need to give it the same signature as printf
<whitequark> oh
<_a> i can use ifprintf or whatever
<whitequark> no, no
<_a> how?
travisbrady has joined #ocaml
<_a> whitequark: how do you mean?
swgillespie has joined #ocaml
<whitequark> oh, nevermind, that won't work
<whitequark> except with assert false
<_a> yeah
<_a> we have to have an expression of the same type
<_a> the only way i can do that is using ifprintf or ikprintf
<_a> which use make_printf
<_a> so i should understand the dark magic behin make_printf
<whitequark> right
rgrinberg has joined #ocaml
<_a> i didn't know making type safe formatting is so complicated
<whitequark> formatting is complicated!
<_a> yeah even so making the types :(
<_a> in c i can just ignore that damn string
travisbrady has quit [Client Quit]
<whitequark> well you have ifprintf, is it not enough?
<_a> yes, but i don't understand the stuff
<_a> can anybody point to somewhere?
jabesed has quit [Ping timeout: 245 seconds]
SomeDamnBody has joined #ocaml
struktured has quit [Remote host closed the connection]
struktured has joined #ocaml
shinnya has quit [Ping timeout: 245 seconds]
enitiz has joined #ocaml
enitiz has quit [Read error: Connection reset by peer]
enitiz has joined #ocaml
AlexRussia has quit [Ping timeout: 264 seconds]
AlexRussia has joined #ocaml
reem has quit [Remote host closed the connection]
enitiz has quit [Quit: Leaving]
reem has joined #ocaml
ptc has joined #ocaml
ptc is now known as Guest28969
Algebr has quit [Ping timeout: 244 seconds]
Guest28969 has quit [Ping timeout: 250 seconds]
Pepe_ has quit [Quit: Lost terminal]
ptc_ has joined #ocaml
psy__ has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
AlexRussia has quit [Ping timeout: 250 seconds]
rgrinberg has joined #ocaml
ptc_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
reem has quit [Remote host closed the connection]
reem has joined #ocaml
<_a> ygrek, it just says that there is some wrapper missing.
<_a> Honestly i have no idea what should go into stdlib
<ygrek> afaiu you want conditional printf
<ygrek> you could use Format.ifprintf with std_formatter
shinnya has joined #ocaml
<_a> yes
<_a> thanks for that link
badkins_ has quit [Remote host closed the connection]
reem has quit [Remote host closed the connection]
jao has quit [Ping timeout: 245 seconds]
Pepe_ has joined #ocaml
reem has joined #ocaml
mcc has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
Pepe_ has quit [Remote host closed the connection]
MooseAndCaml has joined #ocaml
shinnya has quit [Ping timeout: 246 seconds]
moei has quit [Quit: Leaving...]
reem has quit [Remote host closed the connection]
manizzle has joined #ocaml
<MooseAndCaml> How can I install code so that emacs toplevel will see it?
<MooseAndCaml> I'm working with some code that uses the ocaml lens library
<mcc> so how did it come to be that opam doesn't seem to work very well on Windows?
<mcc> everyone's like "use WODI"
reem has joined #ocaml
<whitequark> opam works on cygwin and it will work natively at, i think, next release (at least this is planned)
MercurialAlchemi has joined #ocaml
Denommus` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<mcc> oh, cool
kapil__ has quit [Quit: Connection closed for inactivity]
psy_ has quit [Remote host closed the connection]
psy__ has quit [Remote host closed the connection]
reem has quit [Remote host closed the connection]
reem has joined #ocaml
kapil__ has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ygrek has joined #ocaml
Axle has quit [Quit: Leaving.]
Submarine has joined #ocaml
Simn has joined #ocaml
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
badkins has joined #ocaml
swgillespie has joined #ocaml
MercurialAlchemi has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
badkins has quit [Ping timeout: 240 seconds]
vanila has quit [Quit: Leaving]
monoprotic has quit [Ping timeout: 272 seconds]
psy_ has joined #ocaml
mcc has quit [Quit: This computer has gone to sleep]
tane has joined #ocaml
Nijikokun has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Haudegen has quit [Ping timeout: 245 seconds]
moei has joined #ocaml
psy_ has quit [Quit: Leaving]
Haudegen has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rgrinberg has quit [Quit: Leaving.]
MrScout_ has joined #ocaml
oscar_toro1 has joined #ocaml
MrScout_ has quit [Read error: Connection reset by peer]
MrScout_ has joined #ocaml
rgrinberg has joined #ocaml
<kaiyin> The ocaml console does not support autocompletion?
<whitequark> try utop
jneen is now known as jneen|zzz
shinnya has joined #ocaml
iorivur_ has joined #ocaml
iorivur has quit [Ping timeout: 246 seconds]
<kaiyin> cool. what is <localleader> by default for vim with merlin installed?
<def`> :help maplocalleader
<def`> and :let maplocalleader
<def`> to see current value
<_a> no help for you
ggole has joined #ocaml
<kaiyin> def`: it seems undefined.
<_a> makes me sad that ocaml irclogger is written in "RUBY" of all languages :(
<rks`> kaiyin: that's because def` advice was wrong
<rks`> it's ":h localleader"
<rks`> or not
<rks`> well, that works
<rks`> but what def` said should work too, my bad
jonludlam has quit [Quit: Coyote finally caught me]
<kaiyin> ok, now I see I need to set it up in .vim/after/ftplugin/ocaml.vim
baz_ has joined #ocaml
baz_ has quit [Client Quit]
<rks`> no?
<rks`> things like that should end up in your .vimrc
SomeDamnBody has quit [Ping timeout: 255 seconds]
Haudegen has quit [Ping timeout: 250 seconds]
Submarine has quit [Remote host closed the connection]
AlexRussia has joined #ocaml
psy_ has joined #ocaml
MooseAndCaml has quit [Ping timeout: 246 seconds]
Haudegen has joined #ocaml
iorivur_ has quit [Quit: No Ping reply in 180 seconds.]
iorivur has joined #ocaml
larhat has joined #ocaml
matason has joined #ocaml
MrScout_ has quit [Ping timeout: 252 seconds]
ocp has joined #ocaml
avsm has joined #ocaml
Nijikokun has joined #ocaml
Nijikokun has quit [Max SendQ exceeded]
Haudegen has quit [Ping timeout: 265 seconds]
<companion_cube> struktured: what's your requirement exactly?
<companion_cube> (that is, why is it a queue, even though take_front can happen implicitly afaiu)
Kakadu has joined #ocaml
Haudegen has joined #ocaml
araujo has joined #ocaml
vpm has quit [Ping timeout: 264 seconds]
oscar_toro1 has quit [Ping timeout: 265 seconds]
oscar_toro2 has joined #ocaml
<kaiyin> how often do you find yourselves needing the object-oriented part of Ocaml?
<companion_cube> rarely
<MercurialAlchemi> especially since you can use first-class modules
<ggole> Very rarely
<companion_cube> well I don't know, I still wish people would use common IO stream types
<companion_cube> but that ship has probably sailed
<companion_cube> struktured: wait, a LIFO queue?!
<companion_cube> (just realizing)
<companion_cube> so, a stack where the bottom can be removed when it's full?
jonludlam has joined #ocaml
jonludla` has joined #ocaml
ontologiae has joined #ocaml
jonludlam has quit [Ping timeout: 246 seconds]
jonludla` is now known as jonludlam
_andre has joined #ocaml
stux has quit [Ping timeout: 246 seconds]
stux has joined #ocaml
ghostpl has joined #ocaml
<Kakadu> Hi
<companion_cube> anyone who knows Ctypes: is it possible to call free manually?
<Kakadu> My good fellas are teaching in the University and struggling in create new topics for courseworks
<Kakadu> So they asked my help and I don't think that forcing people to study F# or something weird like that is a good idea
<Kakadu> So
<Kakadu> What interesting can do a guy in 3 months if he is not very familiar with ocaml?
Haudegen has quit [Ping timeout: 245 seconds]
<ousado> Kakadu: depends on the person
<Kakadu> It is absolutely true but it doesn't help in creating topics
<Kakadu> maybe /me can reanimate notes about recent gsocs
<Kakadu> ah, it doesn't work like that
<ousado> the only thing that immediately comes to my mind is "write a mini-language"
<Kakadu> The only thing for me is to hack Eliom-base-app but ocsigen is a little bit tough to dive in
<Kakadu> s/is/can be/
<Drup> js_of_ocaml is probably easier
<ousado> there are very many concepts mixed in a web a[p
<ousado> *app
<companion_cube> Drup: no idea about ctypes?
<Kakadu> yeah, many concepts
<Kakadu> that's why if guy is familiar with web-programming it will be easier to him to deal with EBA
<ousado> if people actually want to become developers I see little educational value in assigning such projects
<ousado> why not just supervise/consult them on projects they're working on anyway?
<Kakadu> to make more people misarable because they know what Ocaml is but still write code in some shitty langugaes as permanent job?
<ousado> hm, true
<ousado> make them rewrite (one of) their current project(s) in ocaml :D
<ousado> problem solved
Haudegen has joined #ocaml
<_a> how do i tell oasis to -open A compiler option and the dependency of A while building?
ygrek has quit [Ping timeout: 264 seconds]
AltGr has left #ocaml [#ocaml]
lordkryss has joined #ocaml
PM has quit [Ping timeout: 240 seconds]
srcerer has quit [Ping timeout: 255 seconds]
srcerer has joined #ocaml
<whitequark> edit _tags
ocp has quit [Quit: Leaving.]
Kakadu has quit [Ping timeout: 246 seconds]
thomasga has joined #ocaml
kaiyin has quit [Ping timeout: 246 seconds]
AlexRussia has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
paolooo has joined #ocaml
yomimono has joined #ocaml
<_a> But isn't _tags auto generated?
RossJH has joined #ocaml
RossJH has quit [Max SendQ exceeded]
mort___ has quit [Ping timeout: 250 seconds]
<dmbaturin> _a: Oasis leaves an editable section there and promises not to touch it.
dsheets has joined #ocaml
oscar_toro2 has quit [Ping timeout: 264 seconds]
Thooms has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
matason has quit [Quit: leaving]
enitiz has joined #ocaml
thomasga has quit [Quit: Leaving.]
enitiz has quit [Remote host closed the connection]
enitiz has joined #ocaml
enitiz has quit [Read error: Connection reset by peer]
matason has joined #ocaml
matason has quit [Client Quit]
<_a> how would i make use of flags in _oasis to conditionally open a module ?
matason has joined #ocaml
<_a> I have two module which define a function. I want to open one of them during the build process
paradoja has joined #ocaml
ollehar has quit [Quit: ollehar]
Denommus` has joined #ocaml
Denommus has quit [Ping timeout: 255 seconds]
enitiz has joined #ocaml
mort___ has joined #ocaml
jabesed has joined #ocaml
reem has quit [Remote host closed the connection]
psy_ has quit [Read error: No route to host]
ollehar has joined #ocaml
Thooms has quit [Read error: No route to host]
Thooms has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
gargaml has quit [Ping timeout: 250 seconds]
yminsky has joined #ocaml
mort___ has quit [Quit: Leaving.]
matason has quit [Quit: leaving]
mort___ has joined #ocaml
Pepe_ has joined #ocaml
gargaml has joined #ocaml
octachron has joined #ocaml
Thooms has quit [Quit: WeeChat 1.0.1]
matason has joined #ocaml
yminsky has quit [Quit: yminsky]
Denommus` has quit [Ping timeout: 240 seconds]
Algebr has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
Thooms has joined #ocaml
mort___ has quit [Quit: Leaving.]
enitiz has quit [Remote host closed the connection]
mort___ has joined #ocaml
Haudegen has joined #ocaml
Axle has joined #ocaml
Axle has quit [Client Quit]
mengu has joined #ocaml
enitiz has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
AlexRussia has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
mort___1 has joined #ocaml
Algebr has quit [Ping timeout: 245 seconds]
mort___ has quit [Ping timeout: 244 seconds]
yomimono has quit [Ping timeout: 246 seconds]
Thooms has quit [Read error: Connection reset by peer]
Thooms has joined #ocaml
Thooms has quit [Client Quit]
badkins has joined #ocaml
yomimono has joined #ocaml
enitiz has quit [Ping timeout: 245 seconds]
Kakadu has joined #ocaml
ygrek has joined #ocaml
yomimono has quit [Ping timeout: 264 seconds]
Algebr has joined #ocaml
_a has quit [Ping timeout: 246 seconds]
ebzzry has quit [Remote host closed the connection]
badkins_ has joined #ocaml
badkins has quit [Ping timeout: 246 seconds]
destrius has joined #ocaml
travisbrady has joined #ocaml
ollehar has quit [Remote host closed the connection]
paolooo has quit [Quit: Page closed]
yomimono has joined #ocaml
inr has quit [Ping timeout: 276 seconds]
<struktured> companion_cube: yeah a stack where the bottom is removed when full.
<companion_cube> interesting
<companion_cube> what's your use case? ^^
mort___1 has quit [Ping timeout: 250 seconds]
<struktured> companion_cube: I want to remember (up to) the last N things emitted by a generator, for the entire lifetime of the generator, thought a data structure like that could work
<companion_cube> so I guess you need constant-time access
<struktured> companion_cube: yes
<adrien_znc> LRU :P
<companion_cube> I don't have anything like this yet
<Drup> dsheets: woo \o/
<companion_cube> it could go into gen.something though
<dsheets> ehhh
iorivur has quit [Ping timeout: 250 seconds]
* Drup will do a codoc torture session soon again
<struktured> adrien_znc: not exactly though..in my case a "get" operation wouldn't make an element marked as recent
<companion_cube> it's gen + last n elements, quite specific a need
<bbc> aren't you looking for a circular/ring buffer?
<struktured> bbc: it could implemented that way I think, yes, but a polymorphic one
<bbc> struktured: could it not be polymorphic?
tani has joined #ocaml
<Algebr> Any tips on how to find the appropriate #require for the top level for a particular module? On a wild goose chase trying to do the correct directive so that I can use the Url module in utop.
<Drup> wild giise chase using "ocamlfind list" and grep
<Drup> goose*
<struktured> bbc: theoretically? I guess. I threw the word out there because C style ring buffers are often byte buffer oriented, not oriented around datastructures
<dsheets> Algebr, https://github.com/dsheets/ocamlfind-units contributions welcome
<Algebr> Drup: doesn't come up..
<Drup> Algebr: iirc, it's "uri"
<bbc> struktured: I see
<Drup> ah, no it's not
tane has quit [Ping timeout: 240 seconds]
<Leonidas> http://www.podval.org/~sds/ocaml-sucks.html states that camlp4 and the toplevel disagree on the validity of List.map [1;2;3] ~f:fun x -> x
<Leonidas> (syntactic validity, that is)
<ggole> That's camlp4 for you
shinnya has quit [Ping timeout: 264 seconds]
<companion_cube> right, a ring buffer would work
<Leonidas> are there any other examples?
<companion_cube> struktured: fill an issue on containers, and contribute code if you want
<companion_cube> I'll probably write a simple ring buffer
<companion_cube> struktured: I have this (work-in-progress), can make it polymorphic if you want https://github.com/c-cube/ocaml-containers/blob/master/src/data/CCBufferIO.mli
ollehar has joined #ocaml
<companion_cube> I'm not very confident in its correctness though
<Algebr> Why are unit tests also written in ocaml code? Is it because of exceptions?
<companion_cube> what do you mean? you need to write the test in some language
<Algebr> sorry, I mean, I would have thought that unit tests wouldn't be needed
<companion_cube> well the type system doesn't catch all errors (in particular logic errors)
<companion_cube> but sure, you need fewer tests in OCaml compared to, say, python
<Drup> Algebr: since when the type system will catch that "incr x" indeeds increments x ? :p
<Drup> clearly not the ocaml one
<ggole> Type systems don't really prove much
<companion_cube> they do prove things compared to no type system
<ggole> IME they're helpful because they have a low cost to use and the things they do cover happen in practice, not because they prove all the things.
baz_ has joined #ocaml
yomimono has quit [Ping timeout: 264 seconds]
kaiyin has joined #ocaml
<kaiyin> https://gist.github.com/kindlychung/aa556930b68abf2538cf why doesn't this raise an exception?
<companion_cube> the nested match is very fishy
baz_ has quit [Quit: baz_]
bytbox has quit [Remote host closed the connection]
<struktured> companion_cube: ok I might flesh out your CCBufferIO impl. thanks
<struktured> companion_cube:
<companion_cube> nice!
<companion_cube> well, it might be too complicated right now
<kaiyin> companion_cube: what do you mean fishy?
<companion_cube> kaiyin: the inner match doesn't end where you think
<companion_cube> it ends at your ;; I think
<kaiyin> I see.
<companion_cube> you can put ( ) or begin end around
thomasga has joined #ocaml
darkf has quit [Quit: Leaving]
<kaiyin> companion_cube: wrapping with () doesn't seem to solve the problem.
<companion_cube> doesn't it change the behavior?
<companion_cube> wait
<companion_cube> this doesn't even compile, you need to give an argument to Invalid_argument
<companion_cube> (!)
<kaiyin> companion_cube: got it. thanks.
<companion_cube> https://gist.github.com/c-cube/41941b7a7bced87de65a I suggest something like this
<companion_cube> (may not work, but it's the idea)
ghostpl has quit [Remote host closed the connection]
<kaiyin> companion_cube: very helpful. thanks. btw, your typing smells like lisp, ;-)
ptc has joined #ocaml
ptc is now known as Guest22160
<companion_cube> well, good programs are well-parenthesed even in OCaml :P
jneen|zzz is now known as jneen
enitiz has joined #ocaml
<MercurialAlchemi> companion_cube: LISP APOLOGIST DETECTED
skinkitten has joined #ocaml
<companion_cube> nah
Guest22160 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Leonidas> what??? I thought it did.
<Leonidas> ohh, out of context reply, sorry.
<companion_cube> what "what???" ???
<Leonidas> < companion_cube> well the type system doesn't catch all errors (in particular logic errors)
monoprotic has joined #ocaml
<Algebr> Why can't something like this work? let foo = function let a = "bar" in A | -> "A" ^ a
psy_ has joined #ocaml
slash^ has joined #ocaml
<Leonidas> because function expects a pattern match
<Drup> Algebr: what does that mean ? :x
<Drup> there are too many things I can't parse in this alleged syntax
<Leonidas> yes, I have no idea what this would supposedly do
<Algebr> Are Printf format string not really strings? I was having trouble with using ^ and the format string
<Drup> Algebr: not really strings, yes
<Drup> use "^^"
<MercurialAlchemi> it would be nice if they could work with named arguments
Kakadu has quit [Quit: Page closed]
<Algebr> MercurialAlchemi: That would be awesome, then would be like python string flexibility.
<MercurialAlchemi> NonExistingPrintf.printf "%(name)s" ~name:value
<Drup> huum
<Drup> that would be interesting
<Drup> you could do that with ppx
<MercurialAlchemi> it would be less unwieldly when you have many arguments
<Algebr> I really like python's "This {car}".format(car="chevy")
<Drup> Algebr: you need the types information at some point in OCaml
<MercurialAlchemi> (especially many arguments of the same type, because it's very easy to substitute one for the other and introduce a subtle bug)
<MercurialAlchemi> Drup: unless you had implicits
<Algebr> Drup: Does ocaml defer anything to run time?
travisbrady has quit [Quit: travisbrady]
josie has joined #ocaml
josie is now known as Guest96012
<Drup> I don't understand the question
<Drup> MercurialAlchemi: yes
olauzon has joined #ocaml
ghostpl has joined #ocaml
<MercurialAlchemi> Algebr: if you mean "does ocaml retain type information at runtime", the answer is no
<ia0> only integer vs pointer
octachron has quit [Quit: Leaving]
<MercurialAlchemi> maybe I should have qualified my answer by adding the word "useful"
<ia0> it's useful to the GC :-) (but I was mainly joking)
* MercurialAlchemi is not a GC
<MercurialAlchemi> well, except every weekend, where I gather the things that my daughter and girlfriend leave around the house
<MercurialAlchemi> http://ownme.ipredator.se/
travisbrady has joined #ocaml
<MercurialAlchemi> I'm curious to see if they confidence is well-placed
<MercurialAlchemi> "their"
RossJH has joined #ocaml
badon has quit [Ping timeout: 240 seconds]
kaiyin has quit [Ping timeout: 246 seconds]
rwmjones is now known as rwmjones_mtg
<companion_cube> me too
<MercurialAlchemi> must admit that an ocaml implementation of tls looks a lot more safe than any of the various C-based offerings
<MercurialAlchemi> even if OCaml doesn't magically protect from side-channel attacks
kapil__ has quit [Quit: Connection closed for inactivity]
rand000 has joined #ocaml
ggole has quit [Ping timeout: 256 seconds]
oscar_toro1 has joined #ocaml
<MercurialAlchemi> companion_cube: I was thinking of making a CCIO2
<companion_cube> what would be inside ?
<MercurialAlchemi> strongly-typed paths
<MercurialAlchemi> with absolute and relative variants
<MercurialAlchemi> and filename manipulation utilities
<companion_cube> well
<companion_cube> you can modify CCIO and add a phantom type to File.t
mort___ has joined #ocaml
<MercurialAlchemi> and then bulk file manipulation: rm, rm -r, cp, cp -r
<companion_cube> that would be most welcome
<companion_cube> don't reinvent fileutils too much, or adrien_znc will be angryu
<companion_cube> angry
<MercurialAlchemi> :)
<companion_cube> (although I like to think iterators are nice for this stuff)
<companion_cube> but please modify CCIO rather than making CCIO2 :p
<MercurialAlchemi> I'm a bit wary of breaking compatibility
araujo has quit [Quit: Leaving]
<companion_cube> well if it's a phantom type that would be in a good way
struk|work has joined #ocaml
<MercurialAlchemi> noted
<MercurialAlchemi> well, I can't promise it's going to be any time soon, unfortunately
<companion_cube> MercurialAlchemi: you can define type 'a file = private string
<companion_cube> and then type t = [`absolute] file
<companion_cube> (with [`relative] file as an alternative for many operations)
<companion_cube> e.g. walk : 'a file -> 'a file gen, basically
<MercurialAlchemi> I expect most operations to accept both
<companion_cube> val abspath : _ file -> [`absolute] file
<companion_cube> yes
<companion_cube> this way you might even not break compat at all
<MercurialAlchemi> but not something like relpath
<companion_cube> anyway, I like this idea
<MercurialAlchemi> btw, what's bad about reinventing fileutils?
<companion_cube> some might call it "reinventing the wheel"
<companion_cube> ;)
<MercurialAlchemi> wheels are useful
<MercurialAlchemi> that's why you have an "stdlib", because you don't want to install lots of little wheels, you want the most-useful wheels in the same place
<companion_cube> anyway, PRs (even just for discussing design) very welcome
<MercurialAlchemi> ok
ygrek has quit [Ping timeout: 245 seconds]
<MercurialAlchemi> I'll have to think about design
<MercurialAlchemi> probably take inspiration from python's os.path for the filename ops
<MercurialAlchemi> of course, an additional complexity would be supporting "this other platform"
<MercurialAlchemi> the one with c:\ paths
<companion_cube> heh.
Kakadu has joined #ocaml
MrScout_ has joined #ocaml
<dmbaturin> Port ocaml to VMS and you'll need an even more insane path format. :)
ptc has joined #ocaml
vanila has joined #ocaml
ptc is now known as Guest86422
<MercurialAlchemi> I'll path
<companion_cube> ^^
<MercurialAlchemi> (sorry)
badon has joined #ocaml
<badkins_> I'm having difficulty finding a function that will indicate whether the intersection of two lists (or sets) is non-empty w/o actually creating the entire intersection. Anything like that in Core ?
badkins_ is now known as badkins
<badkins> and as a meta question, what is the best way of going about this type of search, is there a "search by type" functionality I can use?
<vanila> as soon as you find a intersection you can return true. If they are sorted you can traverse along both at the same time
<def`> yep, it's O(n) anyway
<badkins> vanila: thanks, but I'm inquiring about a library function vs. writing my own - I realize it's not difficult, but I'd like to get better at knowing what existing lib functions I can reuse are
mengu has quit []
<rks`> badkins: there is http://ocamloscope.herokuapp.com/
ontologiae has quit [Ping timeout: 264 seconds]
<rks`> it doesn't reference every thing, but it's a start
<companion_cube> nice, I didn't think it would index so many things
<badkins> thanks - I typed 'a list -> 'a list -> bool and got 50 entries. Thought do_intersect was promising, but nope :(
Thooms has joined #ocaml
<badkins> this seems like a pretty basic function
<badkins> and incorrect types also - do_intersect is int->int->bool not 'a list -> 'a list -> bool
<companion_cube> badkins: I think you really should compose intersection and is_empty, basically
<badkins> companion_cube: wouldn't that do a lot of extra work?
<companion_cube> if the intersection is large, maybe?
<vanila> that's a nice nice thing about haskell, composing those would not do extra work
<badkins> it should return as soon as it finds a common element
<badkins> vanila: yes
<companion_cube> I think you're prematurely optimizing in this case
<badkins> companion_cube: how large are the lists ?
uris77 has joined #ocaml
<vanila> I think that you should ensure your lists are sorted and write a function to do this
<vanila> it's a bit of a tricky function, quite neat exercise
The_Mad_Pirate has quit [Ping timeout: 245 seconds]
<vanila> actually i want to try it in Coq... probably too hard but it's a good idea for practice
* companion_cube happy, ocamloscope indexes containers
The_Mad_Pirate has joined #ocaml
rgrinberg has joined #ocaml
rwmjones_mtg is now known as rwmjones
<badkins> ok, it appears it doesn't exist. I emailed opensource@janestreet.com about including it. Not sure if they accept pull requests.
<rks`> hm badkins, when I looked I saw "do_intersect" in core
<rks`> doesn't that do what you want?
<badkins> rks`: for lists or ints ?
<rks`> lists
<badkins> I only saw int -> int -> bool - what module is the one for lists in ?
<rks`> 'a list -> 'a list -> bool ?
<rks`> probably in Core_kernel.Std.List
<badkins> that's what I'd like, yes
<rks`> or not
<badkins> rks`: I'm in the github source now and don't see it
<rks`> yes, it's not there
<rks`> let me check heroku again
<badkins> rks`: the heroku app showed the int->int->bool function when I searched on 'a list->'a list->bool for some reason - maybe that's what you saw?
<rks`> nevermind I dreamed
<rks`> yes
paradoja has quit [Ping timeout: 245 seconds]
<badkins> I'll just write my own for now, and when I get a little further in my OCaml knowledge, figure out how to extend Core_kernel.Core_list
<badkins> hmm... looks like combining List.mem and List.exists will do the trick, that may be why they didn't provide an explicit function
chinglish has joined #ocaml
Tamae has quit [Ping timeout: 245 seconds]
travisbrady has quit [Quit: travisbrady]
Hannibal_Smith has joined #ocaml
mort___ has quit [Ping timeout: 250 seconds]
<badkins> let rec do_intersect l1 l2 = List.exists l1 (List.mem l2)
<badkins> oops, no need for rec anymore...
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
shinnya has joined #ocaml
enitiz has quit [Ping timeout: 245 seconds]
<vanila> badkins, that's a nice implementation and works for unsorted lists (will be easier to do a correctness proof for it), but if you know the lists are sorted you can get a speedup
<badkins> in my case they are not sorted
<vanila> oh :(
Guest96012 has quit [Ping timeout: 265 seconds]
<thizanne> badkins: sorting them before would lead to a better complexity
yomimono has joined #ocaml
<badkins> possibly - the lists are often very similar, so it will be rare to have to search very far, but the interface will remain the same regardless
swgillespie has joined #ocaml
jwatzman|work has joined #ocaml
Thooms has quit [Quit: WeeChat 1.0.1]
swgillespie has quit [Client Quit]
bytbox has joined #ocaml
<Algebr> Is there no ocaml equivalent of haskell's deriving Show ? I saw some extension for deriving (Json)...
yomimono has quit [Ping timeout: 252 seconds]
<whitequark> there is
<whitequark> ppx_derivin
<whitequark> *ppx_deriving
ghostpl has quit [Remote host closed the connection]
travisbrady has joined #ocaml
Kakadu has quit [Quit: Page closed]
q66 has joined #ocaml
tani has quit [Quit: Verlassend]
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
matason has quit [Ping timeout: 244 seconds]
Haudegen has quit [Ping timeout: 245 seconds]
jabesed has quit [Ping timeout: 264 seconds]
Guest86422 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Haudegen has joined #ocaml
ptc has joined #ocaml
ptc is now known as Guest32077
inr has joined #ocaml
jabesed has joined #ocaml
dsheets_ has joined #ocaml
avsm1 has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
avsm has quit [Ping timeout: 245 seconds]
enitiz has joined #ocaml
thomasga has quit [Quit: Leaving.]
Submarine has joined #ocaml
Submarine has joined #ocaml
domsj has joined #ocaml
jabesed has quit [Ping timeout: 264 seconds]
jabesed has joined #ocaml
jabesed has quit [Client Quit]
travisbrady has quit [Quit: travisbrady]
thomasga has joined #ocaml
lpw25 has joined #ocaml
leowzukw has joined #ocaml
travisbrady has joined #ocaml
enitiz has quit [Read error: Connection reset by peer]
Algebr has quit [Ping timeout: 250 seconds]
WraithM has joined #ocaml
Michael__ has joined #ocaml
bytbox has quit [Remote host closed the connection]
Michael__ is now known as Guest94634
<Guest94634> Hi, how can I run opam command in a non-interactive manner? For example, I would like to run shell command "opam init" and "opam pin add" so it inits or install dependencies without propmting
Algebr has joined #ocaml
<domsj> Guest94634, you can add -y ; it's documented under --help
larhat has quit [Quit: Leaving.]
Denommus has joined #ocaml
thomasga has quit [Quit: Leaving.]
Denommus has quit [Client Quit]
manizzle has quit [Ping timeout: 265 seconds]
bytbox has joined #ocaml
<vanila> managed to prove do_intersect correct in Coq :D
rand000 has quit [Ping timeout: 256 seconds]
mort___ has joined #ocaml
<dmbaturin> vanila: Show us the proof!
_andre has quit [Quit: leaving]
tane has joined #ocaml
Denommus has joined #ocaml
WraithM has quit [Quit: leaving]
<vanila> http://lpaste.net/120300 sure :)
<vanila> the proof itself is awful.. it should be automated bu ti just wanted to complete it to make sure nothing goes wrong at the end
<rks`> oh god
<rks`> you used Function
<vanila> what do you think about it? :)
mort___ has quit [Quit: Leaving.]
Guest32077 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arj has joined #ocaml
ptc has joined #ocaml
arj has quit [Client Quit]
ptc is now known as Guest99090
Guest99090 has quit [Client Quit]
manizzle has joined #ocaml
Guest94634 has quit [Ping timeout: 246 seconds]
thomasga has joined #ocaml
avsm1 has quit [Quit: Leaving.]
leowzukw has quit [Remote host closed the connection]
rand000 has joined #ocaml
ptc_ has joined #ocaml
Anarchos has joined #ocaml
oriba has joined #ocaml
avsm has joined #ocaml
<Anarchos> hi everybody
matason has joined #ocaml
claudiuc has joined #ocaml
claudiuc has quit [Remote host closed the connection]
claudiuc has joined #ocaml
claudiuc has quit [Remote host closed the connection]
claudiuc has joined #ocaml
mort___ has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
chaptastic has joined #ocaml
avsm1 has joined #ocaml
chaptastic has quit [Remote host closed the connection]
avsm has quit [Ping timeout: 264 seconds]
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
Kakadu has joined #ocaml
rand000 has quit [Ping timeout: 255 seconds]
travisbrady has quit [Quit: travisbrady]
travisbrady has joined #ocaml
<Anarchos> I am looking for a data structure analogous to a map on ordered keys, but wiith multiple bindings.
manud has joined #ocaml
<Anarchos> maybe a hash table ?
reem has joined #ocaml
claudiuc has quit [Remote host closed the connection]
<pippijn> Anarchos: why not ('key, 'value list) map?
kaiyin has joined #ocaml
paradoja has joined #ocaml
Thooms has joined #ocaml
domsj has quit [Ping timeout: 256 seconds]
<Anarchos> pippijn in fact i decided to use a set of ('key, 'values), with lexicographic ordering. And to use Set.min_elt to get a 'value associated to the lowest 'key. Should do the job too (and i get rid of an unnecessary 'value list)
<kaiyin> is there a good library for building web apps?
<pippijn> kaiyin: eliom
ontologiae has joined #ocaml
manizzle has quit [Read error: Connection reset by peer]
manizzle has joined #ocaml
rand000 has joined #ocaml
ptc_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ptc has joined #ocaml
ptc is now known as Guest4940
avsm1 has quit [Quit: Leaving.]
manizzle has quit [Remote host closed the connection]
manizzle has joined #ocaml
rand000 has quit [Quit: leaving]
matason has quit [Ping timeout: 255 seconds]
travisbrady has quit [Quit: travisbrady]
jonludlam has quit [Quit: Coyote finally caught me]
dsheets_ has quit [Ping timeout: 250 seconds]
travisbrady has joined #ocaml
<MercurialAlchemi> what is nice about ocaml is that it's strongly typed
<MercurialAlchemi> you totally would not find something like 'Sys.os_type' which would be a string, it would unthinkable
<MercurialAlchemi> "would be"
<MercurialAlchemi> :(
<Anarchos> MercurialAlchemi why is that a problem ?
<MercurialAlchemi> next you test if the os type is "Unx", the compiler will let you
uris77 has quit [Quit: leaving]
swgillespie has joined #ocaml
avsm has joined #ocaml
<dmbaturin> Actually, I find it a bit strange that Sys.os_type is not of "type os = Unix | Windows | ...".
travisbrady has quit [Quit: travisbrady]
Kakadu has quit [Remote host closed the connection]
<companion_cube> yeah...
<smondet> dmbaturin: the "problem" is that if a new os-type comes up, old code may endup with non-exhaustive pattern matching
<mrvn> smondet: type os = `Unix | `Windows
<smondet> (BTW what's the value of Sys.os_type within a Mirage application?)
* mrvn assumes "Mirage"
<smondet> Sys.os_type may be older than polymorphic variants, and up to 3.x versions non-exhaustive pattern matching on polymorphic variants could be an error (not a warning like now)
<mrvn> smondet: | _ -> Printf.printf "Unknown OS"
<companion_cube> smondet: could be an open variant
<mrvn> or os could be an open type now
<pippijn> mrvn: "pattern never used"
manud has quit [Quit: manud]
<mrvn> pippijn: can one declare val os = [> `Unix | `Windows ]?
<pippijn> val?
<pippijn> =?
<mrvn> :
<pippijn> I don't know what you're saying
<pippijn> I'm not sure, because it would have '_a
* pippijn tries
<mrvn> I want to say: It's `Unix | `Windows now but likely to grow in the future.
<mrvn> i.e. you have to match with _ too
<pippijn> seems to work
<pippijn> # let a : [> `A | `B] = `A;;
<pippijn> val a : [> `A | `B ] = `A
<pippijn> # match a with `A | `B -> () | _ -> assert false;;
<pippijn> - : unit = ()
<smondet> @mrvn: type 'a os = 'a constrain 'a = [> `Windows | `Unix ]
<mrvn> Error: Syntax error
<mrvn> type 'a os = 'a constraint 'a = [> `Unix | `Windows ]
<mrvn> smondet: how would you declare a value of that?
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
mistym has left #ocaml ["Leaving..."]
Submarine has quit [Remote host closed the connection]
<dmbaturin> MPP = mpp ${MPP_OPTIONS} Where does that "mpp" ocaml.org uses come from?
<smondet> @mrvn: let x = `Unix
MercurialAlchemi has quit [Ping timeout: 244 seconds]
lpw25 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<mrvn> smondet: that isn't type 'a os
<pippijn> I don't think that type is very useful
<pippijn> let a : 'a os = `Unix
<pippijn> ->
<smondet> @mrvn: in the mli you can put val x : _ os
<pippijn> val a : [> `Unix | `Windows ] os = `Unix
<mrvn> smondet: but you can't leave is unbound in an mli file
domsj has joined #ocaml
<smondet> but I wouldn't recommend those types unless absolutely needed
tane has quit [Quit: Verlassend]
<pippijn> you can just use [> `Unix | `Windows ]
<pippijn> why would you want 'a os?
olauzon has quit [Quit: olauzon]
<pippijn> ok, for naming it
<smondet> @mvrn: module A : sig val os : _ os end = struct let os = `Unix end
<pippijn> type 'a os = [> `Unix | `Windows ] as 'a
<pippijn> same thing
<mrvn> I wouldn't
<mrvn> I'm fine with os being a string
bytbox has quit [Ping timeout: 246 seconds]
<smondet> (me too :) )
<dmbaturin> smondet: Thanks!
<dmbaturin> Oh, it's in opam even.
PM has joined #ocaml
claudiuc has joined #ocaml
travisbrady has joined #ocaml
<Algebr> objects are weird in ocaml.
<pippijn> yes
<adrien> nah :D
<pippijn> duck typing, yay
thomasga has quit [Quit: Leaving.]
<adrien> wow
<adrien> jdh
<adrien> and not trolling
<Algebr> read the FAQ but still a bit confused as to what the _ means in something like '_a
paradoja has quit [Remote host closed the connection]
<adrien> still 'a
<Drup> it's a type that should be non-polymorphic (also said "monomorphic") but the compile couldn't figure out the type
<adrien> it has one type but the compiler doesn't know which one yet
<Algebr> How is that difference than plain of 'a?
<adrien> ah, right
<adrien> # let l = ref [];;
<adrien> val l : '_a list ref = {contents = []}
<adrien> # l := [1];;
<adrien> - : unit = ()
<adrien> # l := ['a'];;
<adrien> Error: This expression has type char but an expression was expected of type int
<adrien> at first the compiler knew it was "a list of any type" but not yet which "any"
<adrien> the moment you give enough information for it to figure out that "any" is "int"
<adrien> it starts to enforce that
mort___ has quit [Quit: Leaving.]
<Algebr> adrien: reread your words many times over, now I get, much much appreciated.
<Algebr> get it*
<adrien> :)
<adrien> it's fairly simple once you've understood it but at first it's surprising
<adrien> night
<Algebr> Did Ocaml used to have strings and now they are called bytes?
<Algebr> and are they aliases of one another?
<Drup> :D
<Drup> so, currently, without options, string = bytes
<Drup> but, with the option -safe-string
<Drup> string are non mutable
<Drup> (but bytes is)
<Drup> (that's new in 4.02)
<Algebr> So which one is the future? bytes?
reem has quit [Remote host closed the connection]
<companion_cube> both
reem has joined #ocaml
<Drup> depends if you want to mutate things or not
<adrien> Algebr: consider
<adrien> # let s = string_of_bool false;;
<adrien> val s : string = "false"
<adrien> # s.[0] <- 'X';;
<adrien> - : unit = ()
<adrien> # string_of_bool false;;
<adrien> - : string = "Xalse"
<adrien> that should show why read-only strings were wanted
<adrien> but you still need a byte storage/array and that's what bytes is for
<Algebr> no language seems to get strings right
reem has quit [Remote host closed the connection]
domsj has quit [Ping timeout: 245 seconds]
WraithM has joined #ocaml
Guest4940 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<tcpc> adrien: by what miracle string_of_bool can return "Xalse"?
jwatzman|work has quit [Quit: jwatzman|work]
<smondet> tcpc: (maybe for performance reasons) it returns always the *same* string (i.e. does not allocate a new array of bytes)
<Algebr> like interning the string?
<smondet> "interning" ?
<dmbaturin> adrien: Holy f*ck. I'll go read how it's implemented when I get some sleep (if I can sleep after seeing that).
monoprotic has quit [Read error: Connection reset by peer]
<Algebr> smondet: Like using the same string
<Drup> dmbaturin: the implementation is as trivial as you can imagine
<Drup> simply : shared constants
<smondet> it's just that string "constants" are not recreated by default
monoprotic has joined #ocaml
<struktured> don't forget people. we just got immutable strings relatively recently... let's rejoice !
avsm has quit [Quit: Leaving.]
<Drup> still optional though
<struktured> sure, but at least in your own project it can be strictly enforced now
<dmbaturin> I guess I'm going to use 4.0.2 and enforce it. ;)
<Drup> but a library you are using can still mess up everything
reem has joined #ocaml
<struktured> yep, just like obj.magic or C bindings or god knows what else
swgillespie has quit [Quit: Textual IRC Client: www.textualapp.com]