ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | http://www.ocaml.org | OCaml 4.01.0 announce at http://bit.ly/1851A3R | Logs at http://irclog.whitequark.org/ocaml
avsm has quit [Quit: Leaving.]
lordkryss has quit [Quit: Connection closed for inactivity]
q66 has quit [Quit: Leaving]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
shinnya has quit [Ping timeout: 265 seconds]
venk has joined #ocaml
tlockney is now known as tlockney_away
ygrek has joined #ocaml
studybot has quit [Remote host closed the connection]
jwatzman|work has quit [Quit: jwatzman|work]
boogie has quit [Remote host closed the connection]
racycle has quit [Quit: ZZZzzz…]
madroach has quit [Ping timeout: 252 seconds]
madroach has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
penglingbo has joined #ocaml
seanmcl has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
SethTisue has quit [Quit: SethTisue]
tristero has joined #ocaml
mfp has joined #ocaml
ygrek has joined #ocaml
pyon has quit [Remote host closed the connection]
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
seanmcl has joined #ocaml
pyon has joined #ocaml
seanmcl has quit [Max SendQ exceeded]
studybot has joined #ocaml
pyon has quit [Remote host closed the connection]
michael_lee has joined #ocaml
tlockney_away is now known as tlockney
pyon has joined #ocaml
claudiuc has quit [Remote host closed the connection]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
bcuccioli has joined #ocaml
<BitPuffin> is there any conditional compilation in ocaml?
<BitPuffin> so that I can compile out certain areas for different platforms etc
racycle has joined #ocaml
ivan\_ has joined #ocaml
ivan\_ has quit [Changing host]
ivan\_ has joined #ocaml
ivan\ has quit [Ping timeout: 276 seconds]
ivan\_ is now known as ivan\
__JokerDoom has quit [Quit: Leaving]
BitPuffin has quit [Ping timeout: 252 seconds]
jao has quit [Ping timeout: 245 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
struktured has quit [Ping timeout: 240 seconds]
jao has quit [Ping timeout: 276 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
maattdd_ has joined #ocaml
jao has quit [Ping timeout: 252 seconds]
siddharthv_away is now known as siddharthv
axiles has joined #ocaml
boogie has joined #ocaml
maattdd_ has quit [Ping timeout: 245 seconds]
arj has joined #ocaml
struktured has joined #ocaml
racycle has quit [Quit: ZZZzzz…]
philtor has joined #ocaml
BitPuffin has joined #ocaml
ggole has joined #ocaml
madroach has quit [Ping timeout: 252 seconds]
madroach has joined #ocaml
tlockney is now known as tlockney_away
mcclurmc has quit [Remote host closed the connection]
camel_ has joined #ocaml
<camel_> can you create new objects in runtime with ocaml?
<BitPuffin> camel_: yes?
<camel_> Uh, How you can, with macros?
<BitPuffin> well what do you mean
<BitPuffin> create new types or instances?
<camel_> new classes
<BitPuffin> ah, thought you meant class instances
<camel_> I dont know if its sound true but it called meta object protocol
<camel_> in cl
mcclurmc has joined #ocaml
<BitPuffin> well I'm no ocaml wizard so I can't really give a good answer. But cl is dynamically typed etc and can compile itself while running and stuff. Don't know if ocaml can do that. It might be able to, I'm not sure. I guess what you could do is call the interpreter or something from your application
<BitPuffin> or something like that
ygrek has quit [Ping timeout: 252 seconds]
Lutin` has quit [Ping timeout: 240 seconds]
<ggole> No, OCaml is very static and doesn't provide that.
mcclurmc has quit [Ping timeout: 265 seconds]
<BitPuffin> yeah it doesn't sound like a particularly great idea
<ggole> No redefinition, etc
<BitPuffin> you could probably hack something together though
<BitPuffin> with lots of sweat
<BitPuffin> and tears
<BitPuffin> like implementing your own typesystem in ocaml or something lol
<camel_> why new type system?
<BitPuffin> because if you are not happy with the one that exists you'd probably have to create your own little mini language in ocaml
<camel_> no i mean, cant i do with new extension points feature?
<flux> extension points are 'evaluated' before the program is
<BitPuffin> camel_: why do you want to do this anyway
<flux> so your program is unable to affect the compilation process. because it is executed after it :)
<flux> what you could do is generate .ml code, compile it with ocamlc and then use Dynlink to load it in
<flux> of course you would not be able to use the new types declared in the compiled code, because your code using those types would need to be compiled before the other code even exists
<BitPuffin> yeah flux that's also a thing I was thinking other than executing the interpreter from the program
boogie has quit [Remote host closed the connection]
Guest52496 has quit [Remote host closed the connection]
WraithM has quit [Quit: leaving]
WraithM has joined #ocaml
<camel_> thank you both, flux you idea is so practical but i wish this could be in language itself
<camel_> one last question, is call/cc posible in ocaml?
<BitPuffin> again ocaml is a very static language
<BitPuffin> we want as much guarantee as possible that if our code compiles it works, kinda
<BitPuffin> creating new classes etc at runtime is scary
<camel_> yeah, i think first class macros would be real problem for that
<mrvn> camel_: no
philtor has quit [Ping timeout: 252 seconds]
<BitPuffin> no, they would still be processed at compile time right?
<mrvn> camel_: There are some truely horrible hacks with fork to make call/cc work but that isn't realy support for call/cc. Better use continuations.
<whitequark> there's delimited continuations and they work
philtor has joined #ocaml
<whitequark> work well, even
sgnb has joined #ocaml
claudiuc has joined #ocaml
<camel_> work well? i think it would be performance problem
<BitPuffin> is there any conditional compilation in ocaml?
<adrien> not in ocaml directly; you need something additional
<BitPuffin> hmm, like what?
<adrien> but you can also do it at the build syste level and link or not a given module depending on your build system
<mrvn> camel_: yes, ugly hacks.
<adrien> don't remember :D
<BitPuffin> hmm I guess that is true
<BitPuffin> however
<BitPuffin> the mli file has to have the corresponding ml file
ygrek has joined #ocaml
strobegen has quit [Remote host closed the connection]
<BitPuffin> and if one of them is foo.mli and you have foo-ios.ml etc
<mrvn> camel_: The problem is that the ocaml compiler builds stack based code. You can't (sanely) do call/cc with stack based code.
<BitPuffin> how would you tell ocaml that they correspond :P
michael_lee has quit [Remote host closed the connection]
<mrvn> BitPuffin: I would probably have ios/foo.ml
<BitPuffin> ah
<BitPuffin> of course
<BitPuffin> the mli file doesn't have to be in the same directory?
ygrek_ has joined #ocaml
strobegen has joined #ocaml
<camel_> mrvn: yep, i think i should keep lookin lisp stuff
ygrek has quit [Ping timeout: 240 seconds]
<mrvn> BitPuffin: check extunix or similar for conditional compilations.
<ygrek_> is forge.ocamlcore.org down for everyone or just me?
<orbitz> Is planet.ocaml.org known to be down?
<orbitz> ygrek_: sounds like same problem
<ygrek_> BitPuffin, see optcomp
<ygrek_> or cppo
<adrien> ygrek_: yeah, ocamlcore.org is dead it seems
<adrien> no git, no forge, no http ='(
<adrien> no ssh
<ygrek_> nice
<ygrek_> now need to tell opam to use mirrors
<ygrek_> what is that magic command-line option?
<adrien> jsut had to put up mirror for 4 sources
<BitPuffin> mrvn, ygrek_ thanks!
alpounet has joined #ocaml
philtor has quit [Ping timeout: 240 seconds]
<ygrek_> btw how does opam decide when to download from upstream url and when from opam.ocaml.org ?
venk has quit [Remote host closed the connection]
<orbitz> ygrek_: for actually isntalling packages? It's the URL in the pacakge isn't it?
<ygrek_> yes
<ygrek_> that's a rhetorical sarcasm
<ygrek_> err
<ygrek_> last question is serious
<ygrek_> :)
<ygrek_> I think opam get's that information when it does update - whether the package has local +opam.tar.gz on the server
<ygrek_> the url in the package point to upstream
pyon has quit [Remote host closed the connection]
pyon has joined #ocaml
Puffin has joined #ocaml
BitPuffin has quit [Ping timeout: 240 seconds]
AltGr has joined #ocaml
typedlambda has quit [Ping timeout: 252 seconds]
typedlambda has joined #ocaml
<orbitz> oh ok, i'm not sure
bbarker has quit [Quit: Connection closed for inactivity]
yacks has quit [Ping timeout: 260 seconds]
Hannibal_Smith has joined #ocaml
yacks has joined #ocaml
Puffin is now known as BitPuffin
mcclurmc has joined #ocaml
Kakadu has joined #ocaml
mcclurmc has quit [Ping timeout: 265 seconds]
ollehar has joined #ocaml
cago has joined #ocaml
Thooms has joined #ocaml
Simn has joined #ocaml
camel_ has quit [Ping timeout: 246 seconds]
eikke__ has joined #ocaml
<BitPuffin> wat
<BitPuffin> that doesn't look right
<BitPuffin> in real world ocaml in the variants chapter it starts talking about adding an explicit type annotation and prefixing with # etc and it only shows the same code as previously
<BitPuffin> or actually not even that
<BitPuffin> less code
<BitPuffin> bug in the book?
poindontcare has joined #ocaml
Lutin` has joined #ocaml
<Kakadu> you probably need to reformulate question
<BitPuffin> well the last code samples in that chapter don't seem to match the text
<BitPuffin> they don't show what the text is talking about
madroach has quit [Ping timeout: 265 seconds]
Kakadu has quit [Quit: Page closed]
madroach has joined #ocaml
Kakadu has joined #ocaml
pminten has joined #ocaml
<Kakadu> BitPuffin: are you talking about that link? https://realworldocaml.org/v1/en/html/variants.html#polymorphic-variants
<BitPuffin> Kakadu: yeah, after "If we add an explicit type annotation to the code itself (rather than just in the mli), then the compiler has enough information to warn us:"
<BitPuffin> and "Once we have type definitions at our disposal, we can revisit the question of how we write the pattern match that narrows the type. In particular, we can explicitly use the type name as part of the pattern match, by prefixing it with a #:"
<Kakadu> BitPuffin: bugreport it!
<BitPuffin> ah, it's got a github or what? :)
<BitPuffin> lol yeah
<BitPuffin> kinda says so on the side xD
<BitPuffin> should I just put it as a comment in the book or try and find a github page
<BitPuffin> oh it does create an issue
<BitPuffin> done
alpounet has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
Guest48214 is now known as nitbix
alpounet has joined #ocaml
nitbix is now known as Guest22043
Guest22043 has quit [Quit: leaving]
mcclurmc has quit [Ping timeout: 276 seconds]
manizzle has quit [Ping timeout: 240 seconds]
Thooms has quit [Ping timeout: 240 seconds]
divyanshu has joined #ocaml
eikke__ has quit [Ping timeout: 265 seconds]
mk270 has quit [Ping timeout: 276 seconds]
mk270 has joined #ocaml
eikke__ has joined #ocaml
Kakadu has quit [Ping timeout: 246 seconds]
rand000 has joined #ocaml
Kakadu has joined #ocaml
ollehar1 has joined #ocaml
<def`> willb1: 15
<def`> oops, sorry
axiles has quit [Remote host closed the connection]
axiles has joined #ocaml
ontologiae has joined #ocaml
avsm has joined #ocaml
avsm has quit [Ping timeout: 245 seconds]
avsm has joined #ocaml
dsheets has joined #ocaml
amirmc has joined #ocaml
pminten has quit [Remote host closed the connection]
ygrek_ has quit [Ping timeout: 240 seconds]
amirmc has quit [Quit: Leaving.]
avsm has quit [Quit: Leaving.]
_andre has joined #ocaml
Sim_n has joined #ocaml
Simn has quit [Ping timeout: 265 seconds]
madroach_ has joined #ocaml
axiles_ has joined #ocaml
madroach has quit [Ping timeout: 265 seconds]
freling has quit [Ping timeout: 265 seconds]
freling has joined #ocaml
axiles has quit [Ping timeout: 265 seconds]
simn__ has joined #ocaml
Sim_n has quit [Ping timeout: 265 seconds]
osnr has quit [Ping timeout: 265 seconds]
osnr has joined #ocaml
osnr has joined #ocaml
maattdd_ has joined #ocaml
WraithM has quit [Ping timeout: 265 seconds]
Sim_n has joined #ocaml
WraithM_ has joined #ocaml
kerneis has quit [Ping timeout: 265 seconds]
simn__ has quit [Ping timeout: 265 seconds]
kerneis has joined #ocaml
Sim_n has quit [Ping timeout: 265 seconds]
ohama has quit [Disconnected by services]
johnelse_ has joined #ocaml
ohama has joined #ocaml
gargawel_ has joined #ocaml
nk0 has joined #ocaml
Simn has joined #ocaml
johnelse has quit [Ping timeout: 265 seconds]
gargawel has quit [Ping timeout: 265 seconds]
nk0_ has quit [Ping timeout: 265 seconds]
Tamae has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
avsm has joined #ocaml
eikke__ has quit [Ping timeout: 276 seconds]
ontologiae has quit [Ping timeout: 240 seconds]
shinnya has joined #ocaml
thomasga has joined #ocaml
Sim_n has joined #ocaml
Simn has quit [Ping timeout: 265 seconds]
chris2_ has joined #ocaml
chris2 has quit [Ping timeout: 265 seconds]
siddharthv is now known as siddharthv_away
chris2_ is now known as chris2
toolslive has joined #ocaml
eikke__ has joined #ocaml
thomasga has quit [Quit: Leaving.]
johnelse_ is now known as johnelse
_2can has quit [Ping timeout: 265 seconds]
_2can has joined #ocaml
Sim_n is now known as Simn
BitPuffin has quit [Ping timeout: 245 seconds]
ontologiae has joined #ocaml
pyon` has joined #ocaml
strobegen has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
strobegen1 has joined #ocaml
pyon has quit [Ping timeout: 265 seconds]
BitPuffin has joined #ocaml
axiles_ has quit [Ping timeout: 240 seconds]
axiles_ has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
penglingbo has quit [Ping timeout: 245 seconds]
ontologiae has joined #ocaml
<BitPuffin> uh
<BitPuffin> so which platforms are officially supported by the ocaml compiler
<adrien_oww> check the sources :)
<BitPuffin> It looks like arm is some kind of third party thing
<BitPuffin> ocamlxarm
<adrien_oww> ?
<BitPuffin> yeah I'm trying to figure out if I'll be able to compile for android, ios and windows 8 for surface
<jpdeplaix> BitPuffin: the bytecode executables supports all platforms supported by the C compiler
<BitPuffin> but what about native?
<adrien_oww> step 0
<adrien_oww> get a C toolchain that lets you target that
<BitPuffin> also is the bytecode interpreter even any fast :P
<jpdeplaix> for the native ones, you can there as much backends as there are directories here: https://github.com/ocaml/ocaml/tree/trunk/asmcomp
<adrien> BitPuffin: it's faster than Apple's Swift :>
<jpdeplaix> :D
<BitPuffin> adrien: thought swift compiled to native
<BitPuffin> hmm well I do see arm in there
<BitPuffin> so it *should* be possible..
<jpdeplaix> adrien: « ref counting » … :)
<adrien_oww> bounds checking and no way to avoid them it seems
<adrien_oww> (well, except program-wide)
<adrien_oww> both of these at least ;-)
<mrvn> 99% bounds checking is free
<ggole> Bounds and overflow checking isn't that expensive, though
<BitPuffin> anyways, how do I specify architecture with ocamlc for cross compiling?
<mrvn> +of the time
<ggole> SML has both and it performs OK
<ggole> (When compiled well enough.)
<adrien_oww> mrvn: yup for inside for i = 0 to 1_000_000 do ..., it's often not :-)
<adrien_oww> BitPuffin: cross-compilation isn't supported upstream yet; there are half a dozen projects each targetting a specific setup
<mrvn> adrien_oww: sure they are. you do the bounds checking in parallel with the other instructions in the loop.
<BitPuffin> adrien_oww: hrm
<mrvn> adrien_oww: so why waiting for the mul to finish you are already checking the next bounds.
<adrien_oww> mrvn: not guaranteed :)
<BitPuffin> damn it
<BitPuffin> really wanna use ocaml for this
<mrvn> adrien_oww: also the compiler can figure out you are in a loop and only check the start and end.
<mrvn> (sometimes)
<adrien_oww> BitPuffin: will be in 4.03 (or trunk in a couple months)
<BitPuffin> adrien_oww: I plan to be done with this in july :/
<adrien_oww> mrvn: it doesn't always do it; and if you do that check, there's a conditional jump
<adrien_oww> I'm not betting everything will always be fast
<adrien_oww> BitPuffin: for all these archs?
<BitPuffin> adrien_oww: yah
<adrien_oww> it's
<ggole> Conditional jumps aren't that expensive if you arrange them intelligently
<mrvn> adrien_oww: one that is never (or always) taken and gets predicted real well
<adrien_oww> honestly, even in the best cases, it's a tight schedule
<ggole> Making sure that the overflow path is a forward jump is most of it.
<BitPuffin> adrien_oww: The bytecode version can still interface with C and call back to C right?
<adrien_oww> yes
<adrien_oww> ggole: that's a lot of 'if'
<BitPuffin> and be called as a library kind of
<adrien_oww> BitPuffin: and you have 3 weeks to do everything?
<ggole> adrien_oww: not really: see the allocation code emitted by ocamlopt, which contains exactly that kind of forward jump
<mrvn> adrien_oww: they did tests with and without bounds check and found ways that make them not so expensive
<BitPuffin> adrien_oww: end of july
<BitPuffin> adrien_oww: so ~6
<ggole> It's just work, not some brain-melting thing.
<adrien_oww> ggole: it optimizes out bound checks inside for loops?
pyon`` has joined #ocaml
<BitPuffin> adrien_oww: it's either this or something like C..
<adrien_oww> BitPuffin: yeah, still, that's a lot to do
<ggole> I was talking about making sure that rarely-taken conditional jumps are cheap
<mrvn> And anyway, missing a single bounds check that was needed to catch an error is critical. Doing a few bounds checks that are irelevant is, well, who cares.
<ggole> (For the overflow checking.)
<adrien_oww> main issue is probably getting everything running on each platform
<adrien_oww> no matter the language
<mrvn> If you allow not checking people will use that even when it isn't safe.
<adrien_oww> -fomg-optimize
<ggole> -Obroken
ollehar1 has quit [Ping timeout: 272 seconds]
pyon` has quit [Ping timeout: 265 seconds]
leifw has quit [Ping timeout: 245 seconds]
mcclurmc has joined #ocaml
<BitPuffin> adrien_oww: yeah
<BitPuffin> adrien_oww: I think the most painful part will be wrapping all the reachability stuff
leifw has joined #ocaml
toolslive has quit [Ping timeout: 265 seconds]
<BitPuffin> adrien_oww: ie I need to be able to get a callback when a device goes from wifi to roaming etc
<BitPuffin> so I'm gonna have to write an abstraction lib for that
<BitPuffin> either in C or ocaml
<BitPuffin> in ocaml I could call it roaml
<BitPuffin> lol
<mrvn> BitPuffin: have you looked at mirage?
<BitPuffin> is the bytecode interpreter well tested on all these platforms? I don't wanna end up picking ocaml and getting fucked
<BitPuffin> mrvn: what's that
toolslive has joined #ocaml
<BitPuffin> ah
<BitPuffin> think I've seen this yeah
<mrvn> BitPuffin: Mirage is a unikernel for constructing secure, high-performance network applications across a variety of cloud computing and mobile platforms. Code can be developed on a normal OS such as Linux or MacOS X, and then compiled into a fully-standalone, specialised kernel that runs under the Xen hypervisor.
<BitPuffin> mrvn: yeah, I don't think that's what I need though
<mrvn> basically a nice ocaml runtime that runs directly on the hardware
<BitPuffin> kind of overkill
<BitPuffin> this is for writing a library that communicates with our backend stuff
<BitPuffin> ie downloads a json file and parses that and stores metadata in sqlite and downloads files etc
<mrvn> is the on-wire protocol fixed?
mcclurmc has quit [Ping timeout: 240 seconds]
<BitPuffin> mrvn: hmm?
<BitPuffin> it's just http stuff if that's what you mean
<adrien_oww> mrvn: this is about ios/android/winrt applications...
<adrien_oww> BitPuffin: yeah, that's what you need to start with, no matter how you do the other bits so...
<mrvn> We are using ZeroMQ at work for the network stuff. Not sure if that works on ios/winrt but android would work.
<BitPuffin> adrien_oww: which part?
<mrvn> But if you are decided on http then zmq isn't an option.
<adrien_oww> BitPuffin: abstraction lib, re-expose everything needed from the OS in C
<mrvn> (and I hope you mean https)
<BitPuffin> well I mean we already have the backend
<BitPuffin> and yes I mean https
<BitPuffin> adrien_oww: yeah, at least for the reachability download cancelling etc. However to just load things into sqlite etc shouldn't need that immediately
<BitPuffin> but everything is quite tight
<BitPuffin> so it's stressful
<BitPuffin> do you think that stuff like Core.Async would work on ios/android etc?
* adrien_oww doesn't know
<BitPuffin> I mean that's just leveraging things in the runtime isn't it?
toolslive has quit [Ping timeout: 265 seconds]
toolslive has joined #ocaml
squiggnet has quit [Ping timeout: 265 seconds]
<BitPuffin> ocaml feels like a perfect language for how I want to design the lib internally but I don't know if the implementation well run everywhere
<BitPuffin> frustrating :(
squiggnet has joined #ocaml
<mrvn> BitPuffin: you can compile to java script. Surely that runs everywhere.
<adrien_oww> it runs well everywhere; and then you have crap platforms which do their best to break everything on a regular basis
<BitPuffin> blazing fast like a snail :P
<BitPuffin> adrien_oww: yeah, well no language will save me from that
<BitPuffin> but the important thing is that ocaml will run and not be a lot of overhead
<BitPuffin> which it probably won't be with native or bytecode
<BitPuffin> js though.. :p
<BitPuffin> I don't know if Async relies on that much platform specific stuff though. I have a feeling I'll need async
racycle has joined #ocaml
andreypopp has quit [Ping timeout: 260 seconds]
<adrien_oww> Async/Lwt might cause issues if you want to get on the MS app store
<BitPuffin> we don't
<adrien_oww> ah, fine
<Drup> BitPuffin: you can do conditionnal compilation with cppo
<BitPuffin> we will be distributing as a windows 8 thingy
<adrien_oww> I was going to say that even the ocaml runtime itself could be an issue on the MS app store
<BitPuffin> luckily the tablets use windows 8 and winrt
<BitPuffin> cuz apparently you can't release anything on winrt outside the windows store
andreypopp has joined #ocaml
<adrien_oww> you can put your own "store"
<adrien_oww> but you need to buy keys and they're fairly expensive
<BitPuffin> ah
<BitPuffin> well anyways
<BitPuffin> it's thankfully not winrt :P
<BitPuffin> I guess what I'll have to do is to blaze through RWO and then write a test and try running it on all the platforms or something
<def`> I have heard of actual ocaml code running on iOS and android, but not of a windows 8 port (targeting arm)
racycle has quit [Quit: ZZZzzz…]
<BitPuffin> I don't know if surface and lenovo tablet uses arm even
<adrien_oww> there's no gcc for windows rt, especially on ram
<adrien_oww> arm*
<adrien_oww> (yet)
<BitPuffin> apparently surface pro uses x86
<BitPuffin> intel ivy bridge
<adrien_oww> .*Pro, yeah
<BitPuffin> yeah it is pro we're targeting
<BitPuffin> and lenovo tablet 2
<BitPuffin> intel atom
<BitPuffin> that's also x86 isn't it?
lordkryss has joined #ocaml
<adrien_oww> atom, yes
<BitPuffin> hmm
<BitPuffin> then it might be possible to pull this off..
darkf has quit [Quit: Leaving]
ontologiae has quit [Ping timeout: 272 seconds]
huza has joined #ocaml
alpounet has quit [Ping timeout: 265 seconds]
JokerDoom has joined #ocaml
ontologiae has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
alpounet has joined #ocaml
Iluvatar593 has joined #ocaml
<Iluvatar593> anyone has an idea of why the interpreter says
<Iluvatar593> Syntax error: 'end' expected, the highlighted 'sig' might be unmatched
<Drup> this parsing error is terribly unprecise
<Drup> Iluvatar593: the error is on "type ('a*int) multiset"
<Iluvatar593> the problem is the presence of int?
toolslive has quit [Ping timeout: 265 seconds]
toolslive has joined #ocaml
<Drup> you don't have the write to put 'a * int there
<Drup> you can only put a set of type variables
<Drup> no * and no int
<Iluvatar593> ok
sagotch has joined #ocaml
ygrek_ has joined #ocaml
avsm has joined #ocaml
thomasga has joined #ocaml
BitPuffin has quit [Ping timeout: 240 seconds]
<Iluvatar593> another doubt
<Iluvatar593> where is the problem on the let rec mod function?
<Iluvatar593> seems another syntax error
<Kakadu> mod is a keyword
<Drup> "mod" is hardcoded to be a operator
<Iluvatar593> oh thanks
<Iluvatar593> uhm
<Iluvatar593> and about the isIn function
<Iluvatar593> am i using fold_right wrong?
<Drup> you're not using the function wrong, but you are using parenthesis wrong :)
maattdd_ has quit [Ping timeout: 260 seconds]
penglingbo has joined #ocaml
maattdd_ has joined #ocaml
<Iluvatar593> uhm
<Iluvatar593> don't get it
<Drup> "f g(x) y" is not parsed as you think
<Drup> it's parser f (g) (x) y
<Drup> what you want is "f (g x) y"
sagotch has quit [Remote host closed the connection]
<Iluvatar593> where f is foldr or || ? XD
<Drup> foldr
<Drup> and the issue is on map :)
<Iluvatar593> ok
<Iluvatar593> let isIn(x,l) = List.fold_right (||) (List.map (fun y -> fst(y)=x) l) false
ollehar has joined #ocaml
<Iluvatar593> i think this works
<Iluvatar593> now the problem is a signature mismatch
<Iluvatar593> because union becames (a * 'b) list
<Iluvatar593> but i need 'a multiset
arj has quit [Quit: Leaving.]
yacks has quit [Ping timeout: 276 seconds]
<Iluvatar593> i need to force the types?
<Iluvatar593> or there's an elegant way to infer the type correctly?
mcclurmc has joined #ocaml
Iluvatar594 has joined #ocaml
Iluvatar593 has quit [Disconnected by services]
struktured has quit [Ping timeout: 240 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
rand000 has quit [Ping timeout: 276 seconds]
mcclurmc has quit [Remote host closed the connection]
madroach_ has quit [Ping timeout: 252 seconds]
madroach has joined #ocaml
ontologiae has quit [Ping timeout: 264 seconds]
pyon`` has quit [Remote host closed the connection]
pyon has joined #ocaml
madroach has quit [Ping timeout: 252 seconds]
madroach has joined #ocaml
<flux> is it a problem?
<flux> the types seem compatible to that direction
sagotch has joined #ocaml
<flux> oh right, you want it to give a nice type in the interface
<flux> well you could have a signature
<flux> or you can do let isIn (x, l) : _ multiset = ..
<flux> but if you are going to actually provide an interface, you probably want to hide the fact that it's implemented as a list
<Drup> Iluvatar594: don't put any type information and export them as multiset in the .mli
<mrvn> Iluvatar594: why are you passing a tuple as function argument?
<flux> so: module MultiSet : sig type 'a multiset val isIn : ('a * 'a multiset) -> bool .. end = struct .. end
<Iluvatar594> isIn is private
<flux> actually I probably messed up the types in that, wrong guess
<def`> List.fold_right (||) _ false ~ List.exists
<flux> if isIn is private then you need signature
<mrvn> Iluvatar594: you can annotate the type but that won't fix any type errors. Only uses the annotated types in error messages.
<def`> (and you will get evaluation shortcut for free)
seanmcl has joined #ocaml
<flux> def`, but he compares fst y to x, not y to x..
<def`> so?
<Iluvatar594> maybe someone lost the initial sig
<Iluvatar594> 1 sec
<flux> oh, you mean only shorten the first part of the function, right
<Iluvatar594> that's the complete version
<def`> List.fold_right (||) (List.map (fun y -> fst(y)=x) l) false = List.exists (fun y -> fst y = x) l
<flux> module MultiSet : MULTISET = .. to hide isIn
mcclurmc has joined #ocaml
<def`> = List.mem_assoc x l ;)
<Iluvatar594> it's not the same putting it at the end? end:MULTISET);; ?
<mrvn> Iluvatar594: it is
<flux> oh it is, I just missed it
<Iluvatar594> np :)
<flux> but I believe it's idiomatic to put it at the beginning
<flux> you don't need parens either in that case
mcclurmc has quit [Remote host closed the connection]
huza has quit [Quit: WeeChat 0.3.8]
<mrvn> Iluvatar594: your union can't return both s1 ('a) and s2 (int).
<mrvn> Iluvatar594: and a tuple is not a list
<mrvn> Iluvatar594: your problem is that you are using tuples as function argument while the signature demands that you do not
<Iluvatar594> ok
<Iluvatar594> mrvn solved this
<Iluvatar594> maybe the others too XD
<Iluvatar594> i didn't understood very well what def` 's suggestion was
<mrvn> Warning 25: bad style, all clauses in this pattern-matching are guarded.
<Iluvatar594> thank you all
<Iluvatar594> yeah noticed it
<Iluvatar594> need to put and if after the -> without the when right?
tnguyen1 has joined #ocaml
thomasga has quit [Quit: Leaving.]
axiles_ has quit [Ping timeout: 252 seconds]
olauzon has joined #ocaml
axiles_ has joined #ocaml
<mrvn> Iluvatar594: just removed the extra tuppels and then the bug in modi showed up
ontologiae has joined #ocaml
<Iluvatar594> i did something like
<Iluvatar594> let rec modi x n l = match l with
<Iluvatar594> [] -> []
<Iluvatar594> |(a,b)::ls -> if (a=x) then (x,n)::ls else (a,b)::(modi x n ls)
<mrvn> that works too
<mrvn> or | ((a,_) as h)::ls -> if (a=x) then (x,n)::ls else h::(modi x n ls)
BitPuffin has joined #ocaml
<Iluvatar594> ok
<mrvn> if you match (a,b) and on the other side use (a,b) then ocaml will allocate a new tuple and assign a and b to it. With 'as h' it will reuse the existing tuple.
studybot has quit [Remote host closed the connection]
thomasga has joined #ocaml
metasyntax has joined #ocaml
<Iluvatar594> uhm
<Iluvatar594> now
<Iluvatar594> how can i print the content
xitology_ has quit [Quit: Ex-Chat]
<Iluvatar594> since the type is abstract?
<mrvn> you can't. add a print function to the module
olauzon has quit [Quit: olauzon]
<mrvn> (which itself needs to take a print function as argument for the 'a)
<Iluvatar594> yeah that's the issue
<Iluvatar594> adding the prinf function
<Iluvatar594> i don't know how to print a generic 'a
olauzon has joined #ocaml
SethTisue has joined #ocaml
<mrvn> let print t printer = List.iter (fun (a,b) -> printer a; print_int b) t
divyanshu has joined #ocaml
<mrvn> The user has to tell you how to print it
<mrvn> google for ocaml pretty printer for some better examples
avsm has quit [Quit: Leaving.]
BitPuffin has quit [Ping timeout: 264 seconds]
lordkryss has quit [Ping timeout: 240 seconds]
tnguyen1 has quit [Quit: tnguyen1]
maattdd_ has quit [Ping timeout: 240 seconds]
maattdd_ has joined #ocaml
<def`> Iluvatar594: my suggestion was just that a lot of function you wrote were already in the standard library
<def`> and in particular, your List.fold_right (||) is much less efficient than List.exists or List.mem_assoc
tirom13 has joined #ocaml
avsm has joined #ocaml
<tirom13> I have two ref on 2 place of a main list
<tirom13> How to get a subset of this main list between the two ref ?
<Drup> linear scan
<Drup> if you want better, don't use a list.
<tirom13> Should I use Array instead ?
sagotch has quit [Ping timeout: 240 seconds]
<Drup> depends what you want to do
<Drup> Map may be a good solution too
maattdd_ has quit [Ping timeout: 240 seconds]
<def`> linear scan is fine :)
<mrvn> recurse till you hit the first ref, recours and build a list of elements till you hit the seconed ref, reverse accumulated list
<mrvn> s/recours/recurse/
<Drup> (aka "linear scan")
eikke__ has quit [Ping timeout: 252 seconds]
yacks has joined #ocaml
tirom13 has quit [Ping timeout: 245 seconds]
Lutin` has quit [Ping timeout: 260 seconds]
tirom13 has joined #ocaml
ee has joined #ocaml
ee has quit [Client Quit]
<tirom13> ok
<tirom13> I think i will keep the linear scan
shinnya has quit [Ping timeout: 260 seconds]
studybot has joined #ocaml
maattdd_ has joined #ocaml
<tirom13> ok, I just found an article about internal representation of ocaml
<Drup> I'm not sure it's going to help you :)
<tirom13> it's help me, I understand now why linear scan is the only solution
<tirom13> List are juste linear structure, we cannot change them to create subset without changing the main list
<ggole> You can't change lists at all, really
cago has quit [Quit: Leaving.]
racycle has joined #ocaml
dinosaure has quit [Remote host closed the connection]
tane has joined #ocaml
dinosaure has joined #ocaml
<tirom13> ok, thanks for all !
<tirom13> Good day !
tirom13 has quit [Quit: leaving]
Arsenik has joined #ocaml
manizzle has joined #ocaml
sagotch has joined #ocaml
philtor_ has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
sagotch has quit [Ping timeout: 240 seconds]
jwatzman|work has joined #ocaml
slash^ has joined #ocaml
eikke__ has joined #ocaml
boogie has joined #ocaml
ontologiae has joined #ocaml
tlockney_away is now known as tlockney
philtor_ has quit [Ping timeout: 240 seconds]
mcclurmc has joined #ocaml
toolslive has quit [Ping timeout: 265 seconds]
rgrinberg1 has joined #ocaml
bbarker has joined #ocaml
avsm has quit [Quit: Leaving.]
rgrinberg has quit [Ping timeout: 276 seconds]
AltGr has left #ocaml [#ocaml]
toolslive has joined #ocaml
manizzle has quit [Ping timeout: 245 seconds]
q66 has joined #ocaml
rgrinberg1 has quit [Quit: Leaving.]
_5kg has quit [Ping timeout: 240 seconds]
maattdd_ has quit [Ping timeout: 252 seconds]
ollehar has quit [Ping timeout: 240 seconds]
philtor_ has joined #ocaml
olauzon has quit [Quit: olauzon]
toolslive has quit [Quit: Leaving]
tnguyen1 has joined #ocaml
slash^ has quit [Ping timeout: 245 seconds]
olauzon has joined #ocaml
Kakadu has quit [Quit: Page closed]
olauzon has quit [Client Quit]
lordkryss has joined #ocaml
ygrek_ has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
<Drup> whitequark: how good is llvm on loop fusion, polyhedral model and this sort of stuff ?
slash^ has joined #ocaml
maattdd_ has joined #ocaml
ontologiae has quit [Ping timeout: 252 seconds]
maattdd_ has quit [Ping timeout: 240 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
olauzon has joined #ocaml
tane has quit [Ping timeout: 264 seconds]
maattdd_ has joined #ocaml
_5kg has joined #ocaml
eikke__ has quit [Ping timeout: 245 seconds]
maattdd_ has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Quit: Leaving.]
eikke__ has joined #ocaml
tane has joined #ocaml
yastero has quit [Ping timeout: 240 seconds]
dsheets has quit [Ping timeout: 276 seconds]
rs0 has quit [Ping timeout: 264 seconds]
rs0 has joined #ocaml
olauzon has quit [Quit: olauzon]
manizzle has joined #ocaml
yastero has joined #ocaml
manizzle has quit [Client Quit]
manizzle has joined #ocaml
tane has quit [Quit: Verlassend]
thomasga has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
lordkryss has quit [Ping timeout: 272 seconds]
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
rand000 has joined #ocaml
Kakadu has joined #ocaml
<bjorkintosh> ".. Didier Rémy, later joined by Jérôme Vouillon, designed an elegant and highly expressive type system for objects and classes. This design was integrated and implemented within Caml Special Light, leading to the Objective Caml language and implementation"
<bjorkintosh> is there a paper somewhere on that?
<Drup> jérome's thesis, I suppose
<bjorkintosh> n/m i found something.
<bjorkintosh> thanks.
philtor_ has quit [Ping timeout: 252 seconds]
amirmc has joined #ocaml
<bjorkintosh> it's on this page: http://cristal.inria.fr/~remy/publications.html
ontologiae has joined #ocaml
tobiasBora has joined #ocaml
amirmc has quit [Client Quit]
Iluvatar594 has quit [Quit: Leaving]
olauzon has joined #ocaml
dsheets has joined #ocaml
ollehar has joined #ocaml
thomasga has joined #ocaml
yacks has quit [Ping timeout: 240 seconds]
maattdd_ has joined #ocaml
lordkryss has joined #ocaml
shinnya has joined #ocaml
maattdd_ has quit [Ping timeout: 240 seconds]
philtor_ has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
ontologiae has quit [Ping timeout: 245 seconds]
philtor_ has quit [Ping timeout: 272 seconds]
jwatzman|work has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
fraggle_laptop has joined #ocaml
olauzon has quit [Quit: olauzon]
ontologiae has joined #ocaml
rz has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
<orbitz> D'oh, i hate it when i hit a typing error that I have solved before and can't remember how
shinnya has joined #ocaml
<rgrinberg> orbitz: playing around with gadt's?
ontologiae has quit [Ping timeout: 245 seconds]
claudiuc has quit [Remote host closed the connection]
<orbitz> no
<orbitz> herei s testcase
<orbitz> type 'a foo = int -> int -> 'a
<orbitz> Error: A type variable is unbound in this type declaration.
<orbitz> In type (int -> ([> `Bar ] as 'a)) foo the variable 'a is unbound
<orbitz> # type zoom = (int -> [> `Bar ]) foo;;
<orbitz> sorry for lines
maattdd_ has joined #ocaml
<orbitz> It's the > that is the problem
<mrvn> because that allows [`Bar] and [`Bar | `Baz] and both can't be zoom
<Drup> orbitz: just turn it into 'a zoom
<mrvn> you need an 'a zoom with constraint type `a = [> `Bar ]
<Drup> with ([> `Bar ] as 'a)
bbarker has quit [Quit: Connection closed for inactivity]
<Drup> (and if you want to make it abstract, don't forget to make it covariant)
<mrvn> although I don't get why you can't have such an open type. Would be nice sometimes.
<Drup> because if you make it abstract, you can have quite unsafe stuff.
<mrvn> how so?
maattdd_ has quit [Ping timeout: 252 seconds]
<mrvn> only thing you could with a zoom would be: match zoom 1 2 3 with `Bar -> true | _ -> false
<mrvn> +do
<orbitz> thanks
axiles_ has quit [Remote host closed the connection]
thomasga has quit [Quit: Leaving.]
_andre has quit [Quit: leaving]
strobegen1 has quit [Quit: Leaving.]
fraggle_laptop has quit [Ping timeout: 240 seconds]
olauzon has joined #ocaml
thomasga has joined #ocaml
iZsh has quit [*.net *.split]
hto_ has quit [*.net *.split]
Valdo has quit [*.net *.split]
maufred has quit [*.net *.split]
samebchase has quit [*.net *.split]
passiveobserver has quit [*.net *.split]
contempt has quit [*.net *.split]
bcuccioli has quit [*.net *.split]
xenocons has quit [*.net *.split]
engil has quit [*.net *.split]
tianon has quit [*.net *.split]
clog has quit [*.net *.split]
yroeht has quit [*.net *.split]
tianon has joined #ocaml
bcuccioli has joined #ocaml
clog has joined #ocaml
maufred has joined #ocaml
samebchase has joined #ocaml
yroeht has joined #ocaml
hto has joined #ocaml
engil has joined #ocaml
engil has quit [Changing host]
engil has joined #ocaml
xenocons has joined #ocaml
iZsh has joined #ocaml
contempt has joined #ocaml
Valdo has joined #ocaml
passiveobserver has joined #ocaml
maattdd_ has joined #ocaml
claudiuc has joined #ocaml
claudiuc_ has joined #ocaml
rand000 has quit [Quit: leaving]
ontologiae has joined #ocaml
thomasga has quit [Quit: Leaving.]
claudiuc has quit [Ping timeout: 264 seconds]
maattdd_ has quit [Ping timeout: 264 seconds]
zebr has quit [Remote host closed the connection]
rgrinberg has quit [Quit: Leaving.]
struktured has joined #ocaml
yomimono has joined #ocaml
ggole has quit []
Lutin` has joined #ocaml
kclancy has joined #ocaml
<kclancy> In the ocaml standard library, there are no functions for checking whether a certain key is contained in a map. I'm guessing that the recommended way of doing this is to use the find function?
IbnFirnas has quit [*.net *.split]
__marius____ has quit [*.net *.split]
n0v has quit [*.net *.split]
<kclancy> No exception is thrown iff the key is contained.
Arsenik has quit [Remote host closed the connection]
__marius____ has joined #ocaml
olauzon has quit [Quit: olauzon]
<companion_cube> kclancy: Map.S.mem ?
olauzon has joined #ocaml
<kclancy> that has the signature I want. I'll look it up in the docs. Thanks.
<kclancy> companion_cube: yep. that's what I want. thanks. mem seems like a weird name for it. Why not contains?
<def`> mem for 'member'
<kclancy> okay. that makes sense.
kclancy has quit [Quit: Leaving]
zebr has joined #ocaml
n0v has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
IbnFirnas has joined #ocaml
Thooms has joined #ocaml
tomsthumb has joined #ocaml
zebr has quit [Remote host closed the connection]
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
maattdd_ has joined #ocaml
zebr has joined #ocaml
rgrinberg has joined #ocaml
maattdd_ has quit [Ping timeout: 245 seconds]
jao has quit [Ping timeout: 240 seconds]
philtor_ has joined #ocaml
Simn has quit [Quit: Leaving]
lordkryss_ has joined #ocaml
philtor_ has quit [Ping timeout: 264 seconds]
lordkryss has quit [Ping timeout: 252 seconds]
lordkryss__ has joined #ocaml
lordkryss has joined #ocaml
lordkryss_ has quit [Ping timeout: 272 seconds]
lordkryss__ has quit [Ping timeout: 252 seconds]
lordkryss_ has joined #ocaml
Nahra has joined #ocaml
lordkryss has quit [Ping timeout: 272 seconds]
Thooms has quit [Quit: WeeChat 0.3.8]
olauzon has quit [Quit: olauzon]
struktured has quit [Ping timeout: 240 seconds]
tnguyen1 has quit [Quit: tnguyen1]
maattdd_ has joined #ocaml
lordkryss has joined #ocaml
maattdd_ has quit [Ping timeout: 272 seconds]
lordkryss_ has quit [Ping timeout: 272 seconds]
yomimono has quit [Ping timeout: 245 seconds]
ollehar has quit [Ping timeout: 240 seconds]
Kakadu has quit [Quit: Konversation terminated!]
Hannibal_Smith has quit [Quit: Sto andando via]
tnguyen has joined #ocaml
SethTisue has quit [Quit: SethTisue]
alpounet has quit [Remote host closed the connection]
tobiasBora has quit [Quit: Konversation terminated!]
ontologiae has quit [Ping timeout: 240 seconds]
madroach has quit [Ping timeout: 252 seconds]
darkf has joined #ocaml
madroach has joined #ocaml
<whitequark> Drup: afaik, pretty good
lordkryss has quit [Ping timeout: 272 seconds]
thomasga has joined #ocaml
penglingbo has quit [Ping timeout: 272 seconds]
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
maattdd_ has joined #ocaml
Nahra has quit [Ping timeout: 245 seconds]
SethTisue has joined #ocaml
maattdd_ has quit [Ping timeout: 264 seconds]
Nahra has joined #ocaml
Nahra has quit [Remote host closed the connection]