gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
Psyclonic has joined #ocaml
Tobu has joined #ocaml
<wmeyer> pippijn: are you there?
<wmeyer> ok, so I almost got it working
<wmeyer> i hit this now: File "merr/automerr/automerr.ml", line 93, characters 7-41:
<wmeyer> Error: Unbound constructor A_parser.StateError
<wmeyer>
<_habnabit> is there a better way of determining if I'm on a 32-bit or 62-bit platform than examining max_int?
<_habnabit> actually, that's not exactly what I want; I'm trying to find the *size* of the native int type
<_habnabit> here's what I have for that: let int_bits = round (log (float_of_int max_int) /. log 2.) + 2
<_habnabit> and it looks fine to me
<wmeyer> _habnabit: Nativeint.size
<_habnabit> wmeyer, okay, but that's a native int. an ocaml int will be the same size?
<wmeyer> _habnabit: int is 31 bits on a 32 bit platform
<_habnabit> yeah, but it's still represented with a 32-bit type
<wmeyer> _habnabit: nativeint is 32 bits on 32 bit platform, and is boxed
<_habnabit> I'm trying to find out how big a bigarray would be without actually creating it, specifically
<wmeyer> _habnabit: the C data type for nativeint is natint
<pippijn> wmeyer: oh yeah
<pippijn> wmeyer: you need my menhir
<wmeyer> :-)
<wmeyer> pippijn: I installed core for bootstrapping your frontend :-)
<wmeyer> there were some other problems too
<pippijn> core as in jane street?
<wmeyer> i needed to patch _oasis and regenerate
<wmeyer> strangely my godi on laptop didn't want me to install anything - more strangely odb.ml refused to install sexplib and type-conv
<wmeyer> i got fed up and installe core suite instead
<pippijn> ok, I don't know what that is
<wmeyer> but that's probably my broken environment
<wmeyer> ok
<wmeyer> so the problem was
<wmeyer> the package i have here is: lablgtk2.sourceview2
<wmeyer> and not
BiDOrD has joined #ocaml
<wmeyer> lablgtksourceview2.gtksourceview2
<pippijn> ah that.. that's just for the gtk frontend
<wmeyer> that's ok but still invalid
<wmeyer> i fixed that
<pippijn> okay
<wmeyer> i am happy to see the gtk gui - so i wanted this to be included
BiDOrD_ has quit [Ping timeout: 248 seconds]
<wmeyer> fortunately i had js_of_ocaml
<pippijn> the gtk frontend is exactly the same as the js one
<wmeyer> Oh, ok
<pippijn> it even shares almost all its code
<wmeyer> i see also hm style unification, do you plan to use it with templates?
<pippijn> I wasn't planning on using this parser for C++
<wmeyer> i think with c, you could use it, but perhaps this power would be better to use with c++
<pippijn> I was planning on adding HM to C
<wmeyer> yes with c you need just propagation
<pippijn> proper HM
<wmeyer> that sounds neat
<pippijn> it might require strengthening the type system
<wmeyer> i mean prolog style systems are useful always anyway
<pippijn> I'm not sure yet, didn't think about it a lot, yet
<pippijn> the HM thing was just an exercise
<pippijn> purely functional HM implementation
<wmeyer> yes, but it's useful
<pippijn> it was a useful exercise
<pippijn> now I know how HM works
<wmeyer> so you can implement basic ML :)
<pippijn> I have
<wmeyer> to be honest i wrote Prolog.ml 2 days ago also for exercising type system
phao has joined #ocaml
<wmeyer> pippijn: if you wish more generic solution (but yet less typesafe) you could have small core for HM
<wmeyer> just sort of: type t = Term of string * t list | Var of string;;
<wmeyer> and then on top of that your module that creates right constructs
<wmeyer> like atoms, arrows etc
<pippijn> hm
<pippijn> it is like that
<wmeyer> you could have even type 'a t = Term of 'a t list | Var of string;;
<wmeyer> really, maybe i was looking in the wrong place
<pippijn> hm_type.mli
<wmeyer> ok sorry! i had the same approach
<wmeyer> exactly the same
<wmeyer> on a github i saw lambda like language but maybe you lower that to the prolog
<phao> does ocaml has that sort of interface thing as haskell?
<phao> like*
<wmeyer> phao: it has a singature language which you can embed in expressions or define your interfaces in .mli files
<wmeyer> or in the module type
<pippijn> I'd like to have haskell's "import Foo (a, b, c)"
<wmeyer> you can always do let a = Foo.a;; let b = Foo.b;; let c = Foo.c;;
<wmeyer> i know it's not that nice
<wmeyer> i never thought i would like this to have in fact
<wmeyer> maybe becasue haskell tends to pollute namespace more due to overloading
<wmeyer> and in OCaml we just tend to use qualifiers instead
<wmeyer> pippijn: shall i just download your menhir from github?
<pippijn> yes, I think that one will work out of the box
<wmeyer> pippijn: what is mlwidgets?
<wmeyer> pippijn: File "libucs/udb.ml", line 3, characters 25-38:
<wmeyer> Error: Unbound module Udb_data
<wmeyer> i can't find the Udb package
<wmeyer> this is that unicode package i suspect
ulfdoz_ has joined #ocaml
<wmeyer> I think the menhir you supplied works - but now the udb stuff is not working
<pippijn> hm
<pippijn> wmeyer: udb is not needed
Sablier has quit [Quit: Quitte]
<pippijn> wmeyer: try getting rid of it
<wmeyer> ok
ulfdoz has quit [Ping timeout: 252 seconds]
ulfdoz_ is now known as ulfdoz
<wmeyer> Unbound module Unicode
<wmeyer> i got rid of ucs
<wmeyer> in cstring
<thelema_> wmeyer: let (a,b,c) = Foo.(a,b,c)
<wmeyer> thelema_: oh :-)
<wmeyer> that looks much better
<wmeyer> pippijn: any ideas about this?
<phao> it seems that ocaml statically links libraries, modules (idk the teminology very well) -- is it true?
<_habnabit> AFAIK yes
<thelema_> phao: dynamic linking + static typing is hard. Ocaml has dynlink, but almost noone uses it
<wmeyer> phao: OCaml has very strict policies how it links. It calculates the MD5 checksum over the interfaces to see if they match
<phao> it seems like Go.
<pippijn> unicode.ml is there, isn't it?
<phao> Well, that (is?) look good anyway.
<phao> looks*
<pippijn> wmeyer: it's in libucs
<pippijn> wmeyer: udb is not needed, unicode is
<wmeyer> right me=stupid, i removed whole lib
<wmeyer> now it's compiling
<wmeyer> i got executables
<wmeyer> fcc1.native, ide.native etc.
<wmeyer> how to run it?
<wmeyer> i tried the ide
<wmeyer> but it exits silently
<pippijn> ./fcc1.native -string "struct foo { int a; }; struct foo i = { 1, 2, 3 };"
<pippijn> or -help
<pippijn> oh, the ide
<wmeyer> ok thanks - i could look into the code
<wmeyer> sorry
<wmeyer> becaise the build failed - but the executables were there
<pippijn> -c or -hm I think
<wmeyer> so i had no hope :-)
<pippijn> anyway, try -help if you want to know how to use a program ;)
<wmeyer> pippijn: thanks ;) is that late there too?
<pippijn> 3:16
<pippijn> yes
<wmeyer> here 2:16 :P
<wmeyer> BST!
<pippijn> UK?
<wmeyer> yep
<pippijn> right
<wmeyer> not better because tomorrow i will have one hour less
<wmeyer> morning of course
<wmeyer> fortunately it's queen juvenile
<wmeyer> so it calculates in one day free of work
<wmeyer> OK, success it;s pretty impresive
<wmeyer> would you like me to send the new _oasis file ?
<wmeyer> i tweaked it a bit
<pippijn> yes, thanks
<pippijn> 404
<pippijn> there it is
<pippijn> ok
phao has quit [Quit: Not Here]
<pippijn> odd
<pippijn> wmeyer: your changes don't work here
<pippijn> the source view package is called what I had, here
<wmeyer> hm how did you install it?
<pippijn> it's in debian
<wmeyer> ah
<wmeyer> yes, it could be patched to conform the distro
<wmeyer> or might be outdated version
<pippijn> maybe
<wmeyer> i use odb
<wmeyer> i have no idea how to fix it
<wmeyer> you could just not list in the dependencies
<wmeyer> hmm well then find lib will break
<wmeyer> ocamlfind
<pippijn> *shrug*
<wmeyer> or symlink
<pippijn> I'm missing a batteries reference, too, I think
<pippijn> ok, I'm not
<wmeyer> hmm so i had batteries?
<pippijn> apparently, or merr wouldn't have built
<pippijn> do you have a merr.native?
<wmeyer> yes i needed batteries before but today i re-packaged my box
<wmeyer> yep
<wmeyer> maybe there was some left overs but i did ocaml setup.ml -clean and usually it works
<pippijn> ocamlfind: Package `lablgtk2.sourceview2' not found
<wmeyer> ocamlfind list
<pippijn> I think it's because debian packages sourceview separately
<wmeyer> yes it will not work
<wmeyer> yes
<wmeyer> they have combinatons of C library and the ML one, and we don't care about C libraries usually
<wmeyer> packages*
<wmeyer> symlinking will not work - because the META file would need patches
<pippijn> yep
<pippijn> yesterday there was a huge spider on my curtain
<wmeyer> i haven't used Debian packages for so long
<pippijn> now there is a sleeping fly on my curtain
<pippijn> where is the spider?
<wmeyer> fly eaten him
<wmeyer> or he transformed to fly
<pippijn> I was hoping the spider would come and give a fly eating show
<wmeyer> maybe he is hiding
<pippijn> I like spiders
<wmeyer> waiting for the moment you will have time to see him and not doing any ML
<wmeyer> they are better than cockroaches
<pippijn> I can't stand cockroaches
<pippijn> but the only animals I kill without thinking are mosquitoes
<wmeyer> btw: your frontend needs common/sense.pm
<pippijn> makes sense
<wmeyer> i needed to use install this perl package which is fine but surprising
<wmeyer> i didn't know what is it - until i apt-file search it
<wmeyer> so it would be good to include this information in the readme
<wmeyer> people might be looking in the common directory for file with pm extension (not knowing even it's perl module)
<pippijn> right
<wmeyer> is ocamlbuild annoyingly removes symlinks after second attempt to build already built repo
<wmeyer> is see fcc shell wrapper
<wmeyer> actually i cant reproduce it there
<wmeyer> but what happens is that, I build once with ocamlbuild some %.otarget file - it cretes the symlinks - when i rebuild again it removes them and then forget to symlink again
phao has joined #ocaml
<pippijn> wmeyer: you can ocamlbuild everything at once
<pippijn> wmeyer: if you just type "make", it builds everything
<wmeyer> pippijn: it works fine with ocaml setup.ml too, i was rather saying about general bug in ocamlbuild that spans over all my projects
wmeyer has quit [Read error: Connection reset by peer]
wmeyer has joined #ocaml
<wmeyer> re
ski has quit [Read error: Operation timed out]
ftrvxmtrx has quit [Ping timeout: 252 seconds]
ftrvxmtrx has joined #ocaml
ski has joined #ocaml
ski has quit [Read error: Operation timed out]
Tobu has quit [Ping timeout: 248 seconds]
Tobu has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
cdidd has joined #ocaml
melanargia_ has joined #ocaml
melanargia_ has quit [Quit: Ex-Chat]
melanargia has joined #ocaml
emmanuelux has quit [Read error: Connection reset by peer]
Tobu has joined #ocaml
osa1 has joined #ocaml
melanargia has quit [Quit: WeeChat 0.3.8]
Yoric has joined #ocaml
sgnb has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
cyphase has quit [Ping timeout: 245 seconds]
cyphase has joined #ocaml
hto has joined #ocaml
sgnb has quit [Ping timeout: 264 seconds]
pango is now known as pangoafk
osa1 has quit [Quit: Konversation terminated!]
sgnb has joined #ocaml
silver has joined #ocaml
wmeyer has quit [Ping timeout: 245 seconds]
thomasga has joined #ocaml
Snark has joined #ocaml
djcoin has joined #ocaml
eikke has joined #ocaml
Snark has quit [Quit: Quitte]
Sablier has joined #ocaml
ssbr_ has quit [Ping timeout: 245 seconds]
silver has quit [Ping timeout: 245 seconds]
silver has joined #ocaml
Snark has joined #ocaml
Tobu has joined #ocaml
<phao> Duuudeee =) Ocaml code looks pretty!
ocp has joined #ocaml
ocp has quit [Client Quit]
ocp has joined #ocaml
cago has joined #ocaml
mika1 has joined #ocaml
avsm has quit [Quit: Leaving.]
thomasga has quit [Quit: Leaving.]
ocp has quit [Ping timeout: 244 seconds]
emmanuelux has joined #ocaml
ocp has joined #ocaml
ankit9 has joined #ocaml
Hussaind has joined #ocaml
Hussaind has left #ocaml []
Hussaind has joined #ocaml
Hussaind has left #ocaml []
Tobu has quit [Ping timeout: 248 seconds]
Tobu has joined #ocaml
ivan\ has quit [Ping timeout: 245 seconds]
<kaustuv> This was just marked as fixed in 4.00+beta2, but seems highly suspicious to me: http://caml.inria.fr/mantis/view.php?id=4511 (cf: doligez's comment)
ivan\ has joined #ocaml
Tobu has quit [Ping timeout: 248 seconds]
<taruti> hmm, the ffi feels much lower level than the haskell one :(
<pippijn> I want to make a better one
Tobu has joined #ocaml
<taruti> pippijn: have you got something hacked together?
<pippijn> not yet
<pippijn> I know nothing about the FFI, yet
<pippijn> and I don't have time in the next 2 months
<pippijn> but I will do it
<taruti> ok :)
_andre has joined #ocaml
hto has quit [Ping timeout: 252 seconds]
hto has joined #ocaml
Yoric has quit [Ping timeout: 265 seconds]
iago has joined #ocaml
tufisi has joined #ocaml
<phao> Hi... ocaml is telling me tha tthis is a syntax error -- but I can't find why... Can someone give me a clue? http://pastie.org/4031074
<phao> ohh...
<phao> =( no luck
<Drakken> "rest person" looks wrong.
<phao> that's where it complains
<phao> but idk why
<Drakken> it should be one word for the tail of the list
Tobu has quit [Ping timeout: 248 seconds]
<Drakken> nothing else
<phao> but person is the name of the second argument
<Drakken> you can't do that with "function"
<phao> that function receivs a list and a name
<phao> ahh, that explains it
<phao> thx
<phao> man... Ocaml code looks very good on the text file
<Drakken> yes, it's nice and clean :)
<phao> it makes me remember haskell, but it's not ugly as haskell...
<Drakken> haskell is very nice and very popular these days. harder to learn though
<phao> yeah
<phao> (I said "yeah", but I have no clue about how hard haskell is, haha)
<Drakken> it's very hard
<Drakken> much harder than ocaml
<phao> hmm
<phao> why is that?
<Drakken> monads are hard to understand, imperative operations are hard to implement
<Drakken> lazy code is hard to optimize
<taruti> Haskell is not that hard
<phao> and then, the fight begun
<Drakken> exactly :)
<kaustuv> I find that after using MLs for 15 years I basically cannot risk using Haskell, because I constantly want to use the "let x = f x" pattern
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<kaustuv> But I sometimes really wish there was a way in OCaml to mark a piece of code as purely functional and have this enforced by the type system
<pippijn> I'd like that, too
<pippijn> and I want that in C and C++, too
<pippijn> in GCC, you can mark a function as pure, but it's not enforced
ankit9 has quit [Ping timeout: 250 seconds]
<phao> pippijn, cool
<phao> is that only for the convenience of the programmer or GCC can do something with a function having that mark?
<phao> that when thing for pattern matching is really helpful
<pippijn> phao: GCC can optimise better
<pippijn> phao: there are two levels of purity
<phao> two?
<phao> what's the difference?
<pippijn> pure: does not modify or use global mutable data and does not modify what its argument points at
<pippijn> const: does not dereference its argument
<pippijn> (in addition to the stuff in pure)
<phao> cool =)
<pippijn> so
<pippijn> purefun(arg); somefun(arg); purefun(arg); // purefun is called twice
<pippijn> purefun(arg); purefun(arg); // purefun is called once
<pippijn> if it's const, purefun will be called once in both cases
Tobu has joined #ocaml
<phao> hmm
<phao> that's really interesting...
<phao> do you happen do USE this (or have used) ?
wmeyer has joined #ocaml
<pippijn> yes
<pippijn> it makes sense for getters
<phao> ahh!
<pippijn> or other kinds of pure query functions
<pippijn> GCC may lift a call out of a loop for you
<pippijn> if it's pure
<phao> gcc must be a HUGE chunck of code...
<pippijn> hehe
<pippijn> it is
tassarot has joined #ocaml
tassarot has left #ocaml []
<phao> to make a union like... type <name> = ... | ... | ... ...
<phao> does this <name> have to start with a lower case letter?
<pippijn> yes
<NaCl> yes
<phao> funny the book doesn't mention that
<NaCl> and modules must start with a capital letter
<phao> ok
<kaustuv> not necessarily: type _foo = A | B ;;
<phao> ok
Tobu has quit [Ping timeout: 272 seconds]
SanderM has joined #ocaml
cago has quit [Ping timeout: 250 seconds]
mika1 has quit [Ping timeout: 252 seconds]
ocp has quit [Ping timeout: 244 seconds]
mika1 has joined #ocaml
mika1 has quit [Ping timeout: 245 seconds]
Submarine has quit [Ping timeout: 260 seconds]
ocp has joined #ocaml
iago has quit [Ping timeout: 240 seconds]
cago has joined #ocaml
Yoric has joined #ocaml
mika1 has joined #ocaml
<wmeyer> pippijn: you can consider using the fold generators in the frontend
<pippijn> yes, definitely
<wmeyer> it looks more less ok in my case, just the code is bit ugly
<wmeyer> but it saves a lot of handling default cases
sivoais has quit [Ping timeout: 260 seconds]
sivoais has joined #ocaml
<mehdid> thelema_: around?
<thelema_> yes
<thelema_> probably not, reading now
<mehdid> I was wondering if you would issue a minor release fixing the doc?
<thelema_> sure, I can do that. The first problem with ocamlinit is a packaging problem - there's an ocamlinit in the source tree
<thelema_> it doesn't automatically get installed for what I hope are obvious reasons
<thelema_> I've needed to remove the old docs for forever, I guess this is as good a time to do so as any
<mehdid> yeah, the first one is a packaging problem
<thelema_> mehdid: thanks for bringing it to my attention
<mehdid> you're welcome
smondet has joined #ocaml
<mehdid> thelema_: just a note, toplevel.html looks useful, but only the first paragraph
<mehdid> (not sure what you planned to remove)
<thelema_> My original intent was to remove a bunch of old docs wholesale, but looking at things now, it seems that just some editing is necessary
<mehdid> yeah, I though you would do the latter :) It seemed easy enough. The rest still looks useful. (at least imho).
phao has quit [Quit: Not Here]
<thelema_> it was written at a time where batteries was much more expansive in scope. Now it's more of a regular library
<mehdid> sure
Tobu has joined #ocaml
<wmeyer> thelema_: When I was installing sexplib yesterday I had problem
<wmeyer> thelema_: i am not sure if that was due to type-conv - type_conv issue or something different
<thelema_> wmeyer: try the core package: odb --package https://raw.github.com/thelema/odb/master/core.package
<thelema_> the versions of sexplib, typeconv, etc in oasis-db will all be updated once oasis-db supports _oasis files from 0.3
<wmeyer> thelema_: I workarounded alread by installing manually the core suite
<wmeyer> thelema_: I am working at the moment on the dependencies
<thelema_> that command I just gave should install all the core suite in correct order
ocp has left #ocaml []
<wmeyer> ok, let me try that
Sablier has quit [Read error: Connection reset by peer]
<wmeyer> thelema_: i am on 32 bits if tht matters (old laptop)
<wmeyer> lib/backtrace_stubs.c:19:4: error: #error "backtrace_stubs.c is for x86-64 only"
<wmeyer>
<thelema_> ah, that does matter. I only made the package file for 108.00
<wmeyer> perhaps configuration tweak to disable building that
<thelema_> they released a 108.01 or something with fixes for 32-bit platforms
<wmeyer> ah ok
<thelema_> it should be easy enough to update the tarball urls in teh package file
<thelema_> if you could do that, that would be great: https://github.com/thelema/odb/blob/master/core.package
<wmeyer> OK cool, doing it now
cago has quit [Quit: Leaving.]
mika1 has quit [Quit: Leaving.]
wmeyer has quit [Remote host closed the connection]
silver has quit [Remote host closed the connection]
wmeyer has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.2]
osa1 has joined #ocaml
<wmeyer> ah no space left on device - need to get rid of the dead parition
<wmeyer> thelema_: Will push the update shortly
<jonafan> post variables have no length restriction, but ocsigen imposes one
<jonafan> this is annoying
<wmeyer> lol that was GNU hurd image dangling on my partition which took so much space
Sablier has joined #ocaml
flux has quit [Ping timeout: 265 seconds]
<wmeyer> thelema_: It was pushed to my branch, please pull
<wmeyer> I was thinking that if _oasis does not exist we could check for the presensce of META and extract the dependency info from there. I am not sure however if it's right strategy to encourage people to supply incomplete packages. The other problem is that META could be anywhere in the package, and possibly few of them
flux has joined #ocaml
eni has joined #ocaml
djcoin has joined #ocaml
<mehdid> thelema_: any ETA for the new micro release of Batteries?
<thelema_> mehdid: I'm doing more than I thought. After consideration, I realized that the `ocamlfind batteries/ocaml` isn't so bad of a hack. The other commands are very hackish, and batteries has no business providing an ocamlopt wrapper
<thelema_> mehdid: I'm testing the new code to make sure it works at least for me before releasing
<mehdid> Cool, thanks. Please let me know when ready. I'll also test on my side and report back.
<thelema_> mehdid: thanks. should be within the hour
<thelema_> wmeyer: package file pushed
eikke has quit [Ping timeout: 252 seconds]
Yoric has quit [Ping timeout: 264 seconds]
Yoric has joined #ocaml
eni has quit [Ping timeout: 252 seconds]
Yoric has quit [Ping timeout: 260 seconds]
pangoafk is now known as pango
flux has quit [Ping timeout: 265 seconds]
<wmeyer> thelema_: thanks
<thelema_> wmeyer: thank you; did it work?
<thelema_> as far as using META, that seems a reasonable idea, although possibly pushing further into diminishing returns.
<wmeyer> thelema_: yes
<wmeyer> thelema_: yes, agreed. it's better to cut down the ways how the packaging should look like
<wmeyer> thelema_: on other hand why not support META extraction
<wmeyer> thelema_: with some warning perhaps
flux has joined #ocaml
osa1 has quit [Quit: Konversation terminated!]
<thelema_> if you want to do it, first find some package that can't install properly without it.
Yoric has joined #ocaml
<wmeyer> thelema_: yes, that was mi initial thought. I found already one - ocsigen-deriving
<wmeyer> which depends on type-conv
<wmeyer> has meta file but no _oasis
<thelema_> ok, go ahead.
<wmeyer> OK will do. I gtg, be back later.
wmeyer has quit [Remote host closed the connection]
eni has joined #ocaml
<thelema_> mehdid: 1.4.3 released, let me know if I goofed
jathd has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
oriba has joined #ocaml
osa1 has joined #ocaml
<osa1> why this memoization function doesn't work? http://hpaste.org/69561
<thelema_> line 6 is wrong
<thelema_> in general, it's not recommended to use "let _", as it'll cover up mistakes like this
<osa1> thelema_: why?
iago has joined #ocaml
<thelema_> # Hashtbl.add;;
<thelema_> - : ('a, 'b) Batteries.Hashtbl.t -> 'a -> 'b -> unit = <fun>
<osa1> oh
<thelema_> you need 3 parameters, hashtbl, key, value
<thelema_> right now, you're giving it two parameters and throwing away the resulting function that would take the third parameter
<osa1> thelema_: thanks
<thelema_> no problem.
<osa1> I also want to add currying support to memoize function, but how can I test if return value of a function is just another function?
<thelema_> can't
<thelema_> need different memoize functions for 1 arg, 2 arg, etc
<osa1> thelema_: could some kind of code generator(macros etc.) solve that problem?
<thelema_> yes, you could do this with camlp4, camlp5, although they're both unnecessarily complex for this kind of task
<thelema_> probably cppo would be the best fit: http://mjambon.com/cppo.html
<osa1> thelema_: I was thinking of using MetaOCaml, do you know it?
<thelema_> that would work too
<thelema_> I haven't used it myself, but I know of it reasonably well
<osa1> what is type "exn"?
<mrvn> exception
hto has quit [Read error: Connection reset by peer]
jathd has quit [Remote host closed the connection]
<osa1> so is it impossible to write a memoization function that takes functions with arbitrary number of parameters? I've tried this but it doesn't work for some reason: http://hpaste.org/69563
as has joined #ocaml
<osa1> yay! I made it work
iago has quit [Read error: Connection reset by peer]
<thelema_> osa1: what's the type of the result?
<mehdid> thelema_: looks good
<mehdid> but http://www.ocaml-tutorial.org/ is dead (#man "for programmers";;)
<thelema_> I think there's an ocamlcore mirror
<osa1> thelema_: which result? http://hpaste.org/69564
<thelema_> osa1: val memoize_gen : ('a -> 'b) -> int -> 'a -> 'b = <fun>
<thelema_> it looks like it only handles one-argument functions
<thelema_> maybe not...
<osa1> it's not, since I'm using with 3 parameter functions now
<mrvn> but it only memoizes the first argument, or not?
<osa1> hmm
<thelema_> yes, only the first argument
<mrvn> osa1: are you trying to use "x" as the number of arguments?
<osa1> mrvn: yes
<thelema_> mehdid: want a patch, or another release?
<mehdid> no, it should be okay.
<mehdid> Thanks for the 1.4.3 release!
<thelema_> mehdid: you're welcome
<mrvn> thelema_: the memoize_gen needs to use a ref. The second g 3 4 should not be printing y.
<thelema_> mrvn: I'm just demonstrating it's not memoizing past the first
<mrvn> Can that be fixed without GADTs?
<osa1> I still don't understand why this doesn't work
<thelema_> mrvn: even with gadts, I don't think it can work.
<osa1> what is gadt?
<mrvn> thelema_: with GADTs you can encode the depth of the function as GADT and have different code paths and types depending on the depth
<thelema_> mrvn: ok, but then you're working over an algebraic datatype for functions, not actually normal ocaml functions
<thelema_> even without gadts, you can do that.
<mrvn> thelema_: sure
<Hodapp> GADTs?
Snark has quit [Quit: Quitte]
<mrvn> Heneric Algebraic data Types
<mrvn> s/H/G/
<thelema_> generalized algebraic data type
<thelema_> Variant types are the normal algebraic data type
<thelema_> there's some restrictions on the relationship between the types in different branches and the parent type
<Hodapp> hmmm
<thelema_> i.e. you can have 'a tree = Empty | Node 'a * 'a tree * 'a tree
<Hodapp> Is this an OCaml thing or a more general concept?
<mrvn> With GADTs you can have different types in different cases of a switch statement.
<thelema_> more general concept
<osa1> how's that related with my problem?
<thelema_> osa1: it adds a bunch of theoretical power without making typechecking undecidable
<mehdid> thelema_: and http://paste.debian.net/173033/
_andre has quit [Quit: leaving]
<thelema_> mehdid: /sigh on the h2 problem
<mehdid> yeah :)
<Hodapp> This is sounding somewhat familiar. I read a paper, I think it was "On Understanding Data Abstraction," which explained to me for the first time that ADTs and objects as in OOP are not just a case of one being a special case of the other
<thelema_> quite true
<Hodapp> and it did note that one rather large difference was that ADTs were often amenable to automated proving (as in static typing) in a whole variety of ways objects rarely are
<thelema_> Hodapp: objects mix code and state in tricky ways
<Hodapp> here we go, "On Understanding Data Abstraction, Revisited" by William R. Cook
<Hodapp> thelema_: and that was one reason they mentioned pretty specifically
<bitbckt> my alma mater. :)
<Hodapp> bitbckt: bah?
<bitbckt> Texas at Austin.
<Hodapp> Ahh, okay
<osa1> hmm, metaocaml doesn't work for me, can anyone help? http://hpaste.org/69568
tchell has quit [Read error: Operation timed out]
mehitabel has quit [Ping timeout: 252 seconds]
wmeyer has joined #ocaml
Yoric has quit [Remote host closed the connection]
mehitabel has joined #ocaml
tchell has joined #ocaml
as has quit [Quit: Leaving]
Xizor has joined #ocaml
<djcoin> Is knowing lambda calculus important for an average OCaml developer ?
<djcoin> Or say, more generaly, "in depth" type theory ?
<djcoin> I'm wondering if I should dive in, eg, by reading the "Types and programming language (Benjamin Pierce's book)
<zorun> Being fluent with basic math concepts like sets and functions should be enough
<djcoin> I think it's enought to program indeed, but most of the time I barely understand whats going on the ocaml mailing list or discussion about types (even if i have some background in it as a classic oo CS student)
<bitbckt> Basic Category Theory for Computer Scientists might be a better place to start.
Tobu has quit [Ping timeout: 248 seconds]
<bitbckt> TAPL is... work.
<smondet> djcoin: Even better than Types & PL : http://www.cis.upenn.edu/~bcpierce/sf/
<djcoin> bitbckt: Yeah, this book is pretty big and seems a bit daunting
hto has joined #ocaml
<djcoin> smondet: thanks ! what is it about ? a gentle introduction to type systems and such as it seems ?
<smondet> it is a course
<smondet> it uses Coq
<smondet> so you learn Coq in the same time
<smondet> it starts very slowly
<smondet> the exercises with Coq make it a bit video-game-ish
<smondet> it introduces a lot about typing but it makes hack with them in the same time
<djcoin> All right, I will see if I can learn Coq. I was not thinking about using it in the near future (looking for basic/pragmatic coding and understanding) but if it helps, why not :)
<djcoin> Thanks
eni has quit [Ping timeout: 245 seconds]
<djcoin> bitbckt: and, may I ask, how does Category Theory relates to types ? I heard monads and such come from this field. But maybe the answer will be quite long :s
<bitbckt> in a mathematical sense, categories and types are one and the same.
<djcoin> Yeah, I was about to make such a proposition, it may be algebra applied to CS
<bitbckt> elaborating on that is long, but a quick wikipedia search might sufficiently answer your question :)
<companion_cube> djcoin: you really want to learn Coq? :)
<djcoin> Not sure, but I want to get a better understanding of types :)
<companion_cube> try haskell :p
<djcoin> Opens a few doors to get a better understanding
<djcoin> companion_cube: well not sure, no. I find that it's really great such language exists but I find it a bit unrealistic
<companion_cube> i mean, it's more realistic than coq, but still can learn you a lot about types
phao has joined #ocaml
<djcoin> Sure
<wmeyer> djcoin: try also CPDT: http://adam.chlipala.net/cpdt/
<wmeyer> it's a good book - hard to understand to begin with - but later helps to understand Coq from engineering point of view - it also have quite few good examples of dependetly type implementaion of practical algorithms
<djcoin> wmeyer: thanks a lot for your input :)
<wmeyer> djcoin: if you wish to look at haskell i wouldn't look at haskell too (I quite like few things there though) but on Agda or Epigram
<wmeyer> Agda has some nice introductory book - but beware that is more like Coq in Haskell community - and is not theorem proover in general but really a very modern functional language (it's capable of expressing proofs)
<wmeyer> good exercise is always to try to understand both by rewriting some examples, I belive Ptival has some git repo with some SF examples ported to Agda
<wmeyer> surely understanding dependent types change how your work with other languages
<djcoin> All right, as I don't have much spare time on my hand I guess I will not be able to explore/read many paths :s But thanks !
<wmeyer> breadth first here works well :-)
eni has joined #ocaml
Xizor has quit [Ping timeout: 260 seconds]
<wmeyer> thelema_: ?
eni has quit [Ping timeout: 245 seconds]
<Qrntz> are there any maintained ocaml bindings to bdb?
SanderM has quit [Quit: I need to take it elsewhere.]
BiDOrD has quit [Read error: Operation timed out]
BiDOrD_ has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.2]
<wmeyer> There are several problems with OCaml 4.00.0+beta2 and ocamlbrew+odb
<wmeyer> most serious one is with findlib
<wmeyer> it will not compile with OCaml 4.00.0+beta2, unless you put -I compiler-libs to the compiler options
<wmeyer> which is fine
<wmeyer> the other problem is with topfind the directives does not seem to work
<thelema_> wmeyer: pong
<thelema_> wmeyer: findlib 3.00 is promised to work with ocaml 4.00
<wmeyer> thelema_: you mean 1.3.1 or 3.00?
<wmeyer> thelema_: I am confused - current findlin is 1.3.1 that's a serious gap in numbering
<wmeyer> i tried with 1.3.1 though not 1.2.8, and it didn't work either
<thelema_> I agree that it's a weird jump in versioning
<thelema_> maybe it's just a typo
<thelema_> Qrntz: the ones builtin to the ocaml distribution have just been split off
<thelema_> Qrntz: for version 4.00
Sablier has quit [Read error: Connection reset by peer]
smondet has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]