flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
<jeff_s_> so now what wasn't type checking for me is type checking, but to do so I'm passing the function one too many arguments. So frustrating.
<jli> jeff_s_, what are you doing? not that I think I'll be able to help :)
seafood has quit []
<jeff_s_> I'm trying really, really hard to find out why my function call isn't type checking.
<jeff_s_> the function call is deep inside a fold or two and also inside a functor and also inside a function that is mutually recursive with others.
<jeff_s_> I can get you the source if you want, 1 sec
<xerxes> can i glue haskell and ocaml code?
<jeff_s_> line 161 is where ocamlc reports the error. the function should only require 4 arguments
<jeff_s_> xerxes - through c maybe? :\
<xerxes> ok
sOpen has joined #ocaml
rjack has left #ocaml []
<xerxes> for what are labeled parameter are good for?
<xerxes> ah ive got it
Amorphous has quit [Read error: 104 (Connection reset by peer)]
sanguine1 has joined #ocaml
jeff_s_ has quit []
sanguinev has quit [Read error: 110 (Connection timed out)]
m3ga has joined #ocaml
ulfdoz has quit ["deprecated"]
Amorphous has joined #ocaml
jeff__ has joined #ocaml
jeff__ is now known as jeff_s_
xerxes_ has joined #ocaml
jeff_s_ has quit [Client Quit]
jeff_s_ has joined #ocaml
Ched has quit [Read error: 60 (Operation timed out)]
ulfdoz has joined #ocaml
xerxes has quit [Read error: 110 (Connection timed out)]
seafood has joined #ocaml
ulfdoz has quit [Read error: 60 (Operation timed out)]
sOpen has quit [Read error: 60 (Operation timed out)]
Ched has joined #ocaml
sOpen has joined #ocaml
seafood has quit [Operation timed out]
bzzbzz has joined #ocaml
bzzbzz has quit [Client Quit]
bzzbzz has joined #ocaml
bzzbzz has quit [Client Quit]
xerxes__ has joined #ocaml
jeff_s_ has quit []
xerxes_ has quit [Read error: 110 (Connection timed out)]
jeddhaberstro has quit []
mjonsson has joined #ocaml
jeff_s_ has joined #ocaml
jeff_s_ has quit []
seafood has joined #ocaml
xerxes__ has quit ["Ex-Chat"]
Camarade_Tux has joined #ocaml
mjonsson has quit [Client Quit]
komar_ has joined #ocaml
erikl has quit [Read error: 60 (Operation timed out)]
erikl has joined #ocaml
pants1 has joined #ocaml
Yoric[DT] has joined #ocaml
angerman has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
angerman has quit []
rwmjones has joined #ocaml
s4tan has joined #ocaml
svenl_ has joined #ocaml
smimou has quit [Read error: 104 (Connection reset by peer)]
erikl has quit [Remote closed the connection]
smimou has joined #ocaml
erikl has joined #ocaml
svenl has quit [Read error: 110 (Connection timed out)]
<flux> too bad jeff_s's gone, can't tell him about annotator.ml or the excellent emacs' type annotation support
Yoric[DT] has quit ["Ex-Chat"]
hkBst has joined #ocaml
seafood has quit []
smimou has quit [Read error: 104 (Connection reset by peer)]
smimou has joined #ocaml
_zack has joined #ocaml
ulfdoz has joined #ocaml
rjack has joined #ocaml
Associat0r has quit []
gildor has quit ["Lost terminal"]
gildor has joined #ocaml
munga_ has joined #ocaml
jeanbon has joined #ocaml
Alpounet has joined #ocaml
rjack has quit ["leaving"]
C_Tux has joined #ocaml
rjack has joined #ocaml
sOpen has quit [Read error: 110 (Connection timed out)]
C_Tux has quit ["http://www.mibbit.com ajax IRC Client"]
angerman has joined #ocaml
jeanbon has quit ["EOF"]
angerman has quit []
love-pingoo has joined #ocaml
_andre has joined #ocaml
seafood has joined #ocaml
Yoric[DT] has joined #ocaml
<Alpounet> done
Yoric[DT] has quit ["Ex-Chat"]
sporkmonger has joined #ocaml
Yoric[DT] has joined #ocaml
deadc0de has joined #ocaml
bombshelter13_ has joined #ocaml
s4tan has quit [Read error: 110 (Connection timed out)]
deadc0de has quit [Client Quit]
s4tan has joined #ocaml
seafood has quit []
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: 101 (Network is unreachable)]
ulfdoz_ is now known as ulfdoz
ulfdoz has quit [Read error: 60 (Operation timed out)]
lanaer has quit [Remote closed the connection]
lanaer has joined #ocaml
ulfdoz has joined #ocaml
komar_ has quit [Remote closed the connection]
komar_ has joined #ocaml
komar_ has quit [Read error: 54 (Connection reset by peer)]
komar_ has joined #ocaml
komar_ has quit [Read error: 54 (Connection reset by peer)]
robocop has joined #ocaml
angerman has joined #ocaml
komar_ has joined #ocaml
komar_ has quit [Read error: 54 (Connection reset by peer)]
komar_ has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
_zack has quit ["Leaving."]
s4tan has quit []
Yoric[DT] has quit ["Ex-Chat"]
munga has quit [Read error: 110 (Connection timed out)]
jonafan_ is now known as jonafan
komar_ has quit [Read error: 54 (Connection reset by peer)]
komar_ has joined #ocaml
komar_ has quit [Read error: 54 (Connection reset by peer)]
komar_ has joined #ocaml
willb has joined #ocaml
Associat0r has joined #ocaml
jeanbon has joined #ocaml
rjack_ has joined #ocaml
rjack has quit ["leaving"]
rjack_ is now known as rjack
willb1 has quit [Read error: 113 (No route to host)]
pants2 has joined #ocaml
pants1 has quit [Read error: 60 (Operation timed out)]
palomer has joined #ocaml
<palomer> it's not possible to put labels in constructors, right?
<mfp> # class a ~b ~c = object method x = b + c end;;
<mfp> class a : b:int -> c:int -> object method x : int end
<palomer> I mean type foo = Foo of ~bar:int
<mfp> oh, nope
smimou has quit [Read error: 104 (Connection reset by peer)]
<palomer> oh my
<palomer> let recs which are not functions have to be values
<palomer> bummer!
<palomer> that's a huge bummer!
smimou has joined #ocaml
angerman has quit []
vpalle has joined #ocaml
vithos has quit [Connection timed out]
<palomer> how would I do something like this: let times x = Times x ;; let rec foo = times foo
<palomer> it's illegal for some reason
love-pingoo has joined #ocaml
<palomer> (though "let rec foo = Times foo" is fine)
<flux> how if Times defined?
<flux> is, even
<flux> ah, you're running -rectypes?
<palomer> hmm?
<palomer> type ops = Times ops
<flux> oh, I just tried it first with type 'a t = Times of 'a, that didn't work
<robocop> haha : Error: This expression has type (type_lex * tree) list
<robocop> but is here used with type (type_lex * tree) list
<hcarty> robocop: Is this from the toplevel?
<robocop> hcarty: yes.
<hcarty> type_lex or tree was probably redefined somewhere
<robocop> hum
<hcarty> robocop: So while both types may have the same name, if they were redefined at some point then it can lead to that error
<robocop> yes, you probably right.
<flux> robocop, type a = I let b = I;; and then type a = I let _ = I = b;;
<hcarty> robocop: It's a common question and is in a FAQ somewhere - it seems that most folks run in to it at some point :-)
vithos has joined #ocaml
itewsh has joined #ocaml
rwmjones has quit ["Closed connection"]
rjack has quit [Read error: 110 (Connection timed out)]
alexyk has joined #ocaml
<jli> if I'm doing a look-up in a data structure and don't find anything, is it idiomatic ML to exception?
<jli> throw an execption
monadic_kid has joined #ocaml
<flux> I suppose it depends :)
<brendan> there's a nice rant about Not_found somewhere out there
<flux> well, Not_found can't really be improved, because exceptions cannot be polymorphic
<flux> so it can't have the original data structure, it can't have the value you were looking for, it can't even have a string, because you'd need to be able to convert an arbitrary datastructure into one
<flux> so we're stuck with it :)
<flux> but I don't think that writing touches the more general problem with exceptions: they can leak..
<flux> oh, it has a separate part on exceptions
<flux> right, it has some of the ideas that would be interesting to see in real life.
<flux> I just wish someone(TM) took ocamlexc and updated it to work with current camls )
<flux> :) even
sOpen has joined #ocaml
<palomer> hrmph
* palomer is tempted to go into the wonderful world of ocamlp4
<jli> if I have some type like type sometype = Something of char * bool, is the only way to access the char and bool to use pattern matching?
<hcarty> jli: I think all of the methods involve pattern matching of some sort
<jli> hcarty: hm, okay. seems like using records would make the code more concise while still allowing pattern matching. is that true, or am I missing something?
<hcarty> jli: Depends on the data you are using. If there is only one "Something" then it is likely to be cleaner to use a record
<jli> hm, why does the number of instances make a difference?
<hcarty> jli: If you have more than one then you would likely need a variant of some sort
robocop has left #ocaml []
<hcarty> You could use both if you want (variant with each constructor having its own associated record type)
<jli> oh, you mean if there is only one constructor called "Something"?
Ariens_Hyperion has joined #ocaml
<hcarty> jli: Yes
love-pingoo has quit ["Connection reset by pear"]
alexyk has quit []
ofaurax has joined #ocaml
_andre has quit ["Lost terminal"]
vithos_ has joined #ocaml
* palomer is looking at pa_sexp_conv and is quite confused
ofaurax has quit ["Leaving"]
vpalle has quit [Read error: 104 (Connection reset by peer)]
ofaurax has joined #ocaml
xerxes has joined #ocaml
vithos has quit [Connection timed out]
<palomer> looks like I'm going to have to read and understand chapter 7
<jli> of what?
<palomer> tha camlp4 tutorial
vithos has joined #ocaml
<hcarty> palomer: I don't think that the manual is up to date with the changes in camlp4 in 3.10 and later
<hcarty> palomer: There are tutorials on ocaml-tutorial.org as well as links to other information to get you started
<jli> what is the point of, say, "type age = int"?
bombshelter13_ has quit []
<palomer> hrmph
<palomer> jli, so we can do type age = bigint later without having to change all our type annotations
<hcarty> jli: You can use that with module signatures to make the age type opaque to outside users
<palomer> that too
<palomer> hcarty, won't the private keyword do the same?
<jli> ah, right. okay, thanks!
<palomer> anyone tried compiling sexplib 4.2.7?
<palomer> im getting the error:
<palomer> File "pa_sexp_conv.ml", line 118, characters 11-28:
<palomer> This function is applied to too many arguments,
<palomer> add_sig_generator ~is_exn:true "sexp" mk_sig_exn
<palomer> that's the line
<palomer> it's official, the latest sexplib is uncompilable
<hcarty> palomer: You need a signature for the private keyword to be useful, unfortunately
<hcarty> palomer: Otherwise not even local functions are allowed to create values of the private type
<palomer> oh
vithos_ has quit [Connection timed out]
<hcarty> palomer: I've compiled sexplib before - one attempt at compilation may be a little premature to call it "uncompilable" :-)
<Camarade_Tux> mlgmp -> newhope
<hcarty> It's a complex module though, so it certainly may have bugs in some cases
<hcarty> Camarade_Tux: Is that an offer to adopt it? :-)
<Camarade_Tux> the build system would be a first step : GMP_INCLUDES= -I/opt/gmp/include -I/users/absint2/local/include -I$(HOME)/packages/gmp/include
<Camarade_Tux> hcarty, maybe, I'll see by the end of the week ;)
<palomer> hcarty, there are type errors
<palomer> though I think it's because of an old type_conv version or somesuch
<hcarty> palomer: Then that sounds like less of a bug
<Camarade_Tux> I wouldn't have noticed that if it weren't for http://shootout.alioth.debian.org/u32q/benchmark.php?test=pidigits&lang=ocaml&id=1 (the shootout maintainer has troubles building gmp)
<hcarty> And more of a lack of installed dependencies
<Camarade_Tux> well, mlgmp
<palomer> so...who wants to help me polish a package before I release it to the wild?
* palomer looks at flux and hcarty and Camarade_Tux
<hcarty> Camarade_Tux: Interesting. I didn't know non-stdlib libraries were fair game for use in the shootout
<Camarade_Tux> hcarty, gmp is one of the two exceptions
alexyk has joined #ocaml
<Camarade_Tux> palomer, haha, almost no time
<Camarade_Tux> hcarty, looks like mlgmp is not abandonned (even though its makefile looks like it has been made for gcc3 [which is what made me overreact]) :)
<Alpounet> Camarade_Tux, it is awesome, you should take the time !
komar_ has quit [Read error: 54 (Connection reset by peer)]
komar_ has joined #ocaml
Yoric[DT] has joined #ocaml
vithos has quit [Connection timed out]
<jli> palomer: what package?
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
<Yoric[DT]> hi
<palomer> jli, it's a gui toolkit, sort of
<palomer> Yoric[DT], wanna help me polish my library?
<Yoric[DT]> In general, I'd like to.
<Yoric[DT]> But not before this week-end :)
* Yoric[DT] still needs to recover a bit from his wife's PhD.
<Camarade_Tux> Yoric[DT], hi :)
<Yoric[DT]> (that and I have lots of work late)
<Yoric[DT]> Camarade_Tux: hi
<Camarade_Tux> btw, it seems that xz is the winner for the lzma libs : used in the kernel (option) and slackware's packages are being migrated to a .tar.xz format
<Camarade_Tux> will have to bind it now :)
<Yoric[DT]> :)
<Camarade_Tux> palomer, could you give the link ? I won't have time for it tonight but tomorrow should be ok :)
kaustuv has joined #ocaml
<palomer> Camarade_Tux, you'll probably have trouble compiling it
<Camarade_Tux> palomer, why ?
<jli> is the only way to go from a character to a string to use Char.escaped?
<palomer> Camarade_Tux, you need a boat load of libraries and you'll need to install my custom version of ocamlsdl
<kaustuv> jli: Printf.sprintf "%c"
<Camarade_Tux> or make a 1-character string initialized with it
<Camarade_Tux> palomer, ok, that would be too long for today but I hope tomorrow will be ok
<Camarade_Tux> and I fear no compilation ;)
<palomer> :P
sporkmonger has quit [Connection timed out]
<Alpounet> moreover, it needs either ocaml 3.10 or 3.11 CVS
jeanbon has quit [Read error: 110 (Connection timed out)]
<Camarade_Tux> hmm, vanilla 3.11 won't work ?
* Camarade_Tux has rm'ed his /ocaml310 last week
<palomer> gah!
<palomer> 3.11 pre feb 13 has a bug in it
<Camarade_Tux> no prob, as I said, I fear no compilation (besides gnome and X), I compile new kernels for breakfast and am used to compile everything by myself :)
sOpen has quit [Read error: 110 (Connection timed out)]
smimou has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]> jli: with Batteries included, [Char.to_string] or [String.of_char] .
<kaustuv> Yoric[DT]: any chance of getting libre to replace Str in Batteries?
<Yoric[DT]> I personally can't stand Str, so I'd be tempted to say yes :)
<Yoric[DT]> However, nothing such will happen before 1.0
<kaustuv> Yeah, post-1.0 obviously.
<Alpounet> like monadic stuffs :)
slash_ has joined #ocaml
* Camarade_Tux has still not understood the use for String.matched_string, why not return the matched string immediately ?
* Alpounet has seen (everywhere) many weird ways of working with strings... More than with ropes.
<Alpounet> (everywhere in OCaml, here)
ofaurax has quit ["Leaving"]
<Alpounet> gn
Alpounet has quit ["Ex-Chat"]
komar_ has quit [Read error: 54 (Connection reset by peer)]
komar_ has joined #ocaml
alexyk has quit [Read error: 60 (Operation timed out)]
<hcarty> Yoric[DT]: Is the Batteries build-plan to move away from ocamlbuild?
<Yoric[DT]> Well, Jérémy had ideas.
<Yoric[DT]> But from what I can remember, he still intended to use ocamlbuild.
<hcarty> Yoric[DT]: Ah, ok. Just curious.
monadic_kid is now known as elsuive_snk_kid
elsuive_snk_kid is now known as monadic_kid
sOpen has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
alexyk has joined #ocaml
<Ariens_Hyperion> Does the usage of batteries impact perforca in anyway?
<Ariens_Hyperion> performance*
<Yoric[DT]> Launching the interpreter is much slower (about 1-2 seconds slower).
<Yoric[DT]> I/O is marginally slower.
<Yoric[DT]> (but much more powerful)
<Yoric[DT]> Everything else should be as fast, if not faster.
<Ariens_Hyperion> thanks!
<Yoric[DT]> General caveat: that's from the top of my mind -- no actual testing.
<Yoric[DT]> 'night everyone
Yoric[DT] has quit ["Ex-Chat"]
smimou has joined #ocaml
m3ga has joined #ocaml
Ariens_Hyperion has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
<jli> if I want to use lists to build bigger data structures in a functional way, when I want to "modify" a list element, do I just List.filter that element out, then List.find and manipulate it, and cons the result back onto the filter result?
<jli> apologies for the nonconcision :)
<kaustuv> jli: Take a look at List.map.
<kaustuv> For example, to replace "hello" with "hi" in a list of strings,
<kaustuv> List.map (function "hello" -> "hi" | s -> s) ["hello"; "world"] ;;
<jli> ah, interesting.
<jli> thanks
<jli> though for more complicated structures, it seems like it could become ungainly
<kaustuv> Unless your problem is really trivial, you generally shouldn't use lists to encode data structures.
<jli> yeah, it's a book exercise :)
<thelema> jli: if you want lists with mofifiable issues, use a list of refs
xevz_ has joined #ocaml
<jli> how do I give type hints for the result of a function?
<kaustuv> let f : t1 -> t2 -> t3 = fun x y -> z ;;
xevz has quit [Read error: 54 (Connection reset by peer)]
xevz_ is now known as xevz
<thelema> let increment (i:int) : int = i + 1
<kaustuv> But the right answer almost always is: don't give type hints
<thelema> kaustuv is right. why do you want to give type hint?
<jli> because the interpreter figures out that it's a ('a * 'a list) list, but I want it to know that more specfically it's an 'a graph
<jli> should I just not bother?
<kaustuv> For such things you should compile the .ml file with the -i option, such as:
<kaustuv> % ocamlc -i foo.ml > foo.mli
<kaustuv> then edit the .mli and replace the types with ones to your liking (and deleting the entries you don't want exposed)
<jli> why is that better?
<kaustuv> With the .mli you can hide the implementation of 'a graph, for one. Thus, any code that uses your graph functions will still work if you change the implementation later.
<kaustuv> But if this is too much bother for your assignment, just do as thelema says
<thelema> yes, do as I say. muhuhahaha!
<jli> kaustuv: would an alternative way to hide the implementation be to use the module system?
<thelema> jli: that's exactly what he suggested.
<jli> oh.
<jli> I thought the module system involved sigs and structs and stuff
<jli> does ocamlc -i generate that?
slash_ has quit [Client Quit]
<thelema> it does. ocamlc -i generares the sig
<thelema> and the module framework is assumed by the compiler as part of separate compilation
Kerris7 has quit ["Don't even think about saying Candlejack or else you wi"]