gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml Meeting 2011 http://bit.ly/eaZi1C | OCaml 3.12.0 http://bit.ly/aNZBUp
StepanKuzmin has quit [Ping timeout: 246 seconds]
lopex has quit [Ping timeout: 260 seconds]
lopex has joined #ocaml
lopex has quit []
smerz has quit [Quit: Ex-Chat]
lopex has joined #ocaml
<rrenaud> can you do comparisions with pattern matching?
<rrenaud> like, i have to vars x and y, and i want to do something when x > y, and something else when y > x
<thelema> rrenaud: yes
<thelema> match 3 with x when x > 4 -> ... | 2 -> ... | y when y mod 3 = 0
<thelema> match pair with (x,y) when x > y -> ...
lopex has quit []
<rrenaud> is there a more idiomatic way to write this?
<rrenaud> i could use when for the h1::t1, h2::t2 pattern, but then i'd have to duplicate the h1::t1, h2::t2 part for each pattern
<thelema> nope, that's the good way to do that
<rrenaud> okay, fair enough
Associat0r has quit [Quit: Associat0r]
<rien> hey folks
<rien> I'm reading some of Norman Ramsey's replies on stackoverflow
<rien> trying to decide on which to choose for writing an interpreter, sml or ocaml. he recommends the former over the latter but I wouldn't be able to get any help from you guys :)
<thelema> rien: in the long run, it probably doesn't matter which you pick - both are good languages.
<thelema> You probably won't use the Objective part of OCaml for writing a simple interpreter
<rien> I was thinking the same, they're really very similar. Oh yes, definitely won't need any OO
<rien> I really want to rewrite that Write a Scheme in 48 Hours from haskell to OCaml.
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
<thelema> rien: well, do it.
<rien> I will. when I get to the tough parts of translating monadic code to ocaml, I'll come here for help :)
<thelema> If you really want to do it within the timeframe in a totally new language, try learning the language first, learning the theory of interpreting second, and then start the timer
<thelema> rien: you can use monads in ocaml too
<thelema> they're just much less necessary
<rien> I'd rather not use monads
<rien> I don't think I fully understand them, despite all the time I spent trying to
<rien> I can certainly parrot everything I've read about it but I can't write a monad, for instance
<thelema> The option monad makes sense to me, but I've not been able to generalize that concept
<rien> what's the option monad? maybe or lists?
<thelema> maybe
<thelema> called "option" in ocaml
<rien> oh, right. I understand that only as a functor, something that I can map over. I don't understand option as a monad
<thelema> monads are things that you have return and bind for, right?
<rien> yes
<thelema> return for option is just (fun x -> Some x)
<thelema> and bind for option is just (fun m f -> match f with None -> None | Some x -> Some (f x))
<rien> right, and bind is something that pattern matches on the option, takes the thing from inside the container, maps a function over it and wraps a return on it again
<rien> but I don't understand how that's important/useful/etc
<rien> I'm not asking you to explain, mind you
<rien> I don't think it's that important
<rien> well, it is in purely functional languages
<thelema> Can't help you with the theory. I'm sure there's a ton of things that fit the basic pattern, but the most important of those in haskell, the IO monad, is implicit in ML
<rien> and that's why I'd rather code in ML :)
<thelema> me too
tautologico has joined #ocaml
tautologico has quit [Quit: tautologico]
joewilliz is now known as joewilliams_away
philtor has quit [Ping timeout: 258 seconds]
boscop has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
boscop has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 246 seconds]
eye-scuzzy has joined #ocaml
eye-scuzzy has quit [Client Quit]
eye-scuzzy has joined #ocaml
boscop_ has quit [Ping timeout: 240 seconds]
boscop has joined #ocaml
boscop has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
boscop_ has joined #ocaml
boscop has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
boscop_ has quit [Ping timeout: 246 seconds]
rspeyer__ has joined #ocaml
rspeyer__ has quit [Quit: rspeyer__]
rapha_ has joined #ocaml
boscop has quit [Ping timeout: 246 seconds]
vivanov has quit [Ping timeout: 252 seconds]
vivanov has joined #ocaml
philtor has joined #ocaml
rapha_ has quit [Quit: rapha_]
StepanKuzmin has joined #ocaml
StepanKuzmin has quit [Remote host closed the connection]
ymasory has quit [Quit: Leaving]
StepanKuzmin has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
StepanKuzmin has quit [Read error: Connection reset by peer]
StepanKuzmin has joined #ocaml
emmanuelux has quit [Quit: =>[]]
StepanKuzmin has quit [Read error: Connection reset by peer]
emmanuelux has joined #ocaml
philtor has quit [Ping timeout: 240 seconds]
Yoric has joined #ocaml
dnolen has quit [Quit: dnolen]
rapha_ has joined #ocaml
ikaros has joined #ocaml
jderque has joined #ocaml
avsm has quit [Quit: Leaving.]
boscop has joined #ocaml
boscop has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
fx_ has quit [Remote host closed the connection]
boscop_ has joined #ocaml
boscop has quit [Read error: Connection reset by peer]
jderque has quit [Quit: leaving]
ftrvxmtrx has quit [Ping timeout: 252 seconds]
boscop_ has quit [Ping timeout: 246 seconds]
larhat has joined #ocaml
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
<rproust> rien: thelema: the bind for the option monad is more like (fun m f -> match f with None -> None | Some x -> (*no Some here*) f x)
<rproust> so that the type is ('a option -> ('a -> 'b option) -> 'b option)
Yoric has quit [Quit: Yoric]
ttamttam has joined #ocaml
arubin has quit [Ping timeout: 260 seconds]
f[x] has joined #ocaml
ftrvxmtrx has joined #ocaml
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Read error: Operation timed out]
ikaros has quit [Quit: Leave the magic to Houdini]
jamii has joined #ocaml
ftrvxmtrx has joined #ocaml
ftrvxmtrx_ has quit [Ping timeout: 260 seconds]
emmanuelux has quit [Remote host closed the connection]
<kaustuv> rproust: match *m* with ... you mean?
boscop has joined #ocaml
<kaustuv> actually, I think the definition of bind should be:
<kaustuv> function None -> (fun _ -> None) | Some x -> (fun f -> f x)
yezariaely has joined #ocaml
<kaustuv> This way when the first None is encountered, the continuation can be immediately dropped and gc'd
Cyanure has joined #ocaml
<rproust> kaustuv: yeah, I copy-pasted the typo along with the code
<rproust> kaustuv: idk for the gc optimization you propose, I don't have enough knowledge of ocaml's internals
boscop has quit [Ping timeout: 248 seconds]
boscop has joined #ocaml
yezariaely has quit [Ping timeout: 276 seconds]
Derander has quit [Ping timeout: 276 seconds]
boscop has quit [Read error: Connection reset by peer]
<kaustuv> I guess it doesn't matter if bind is fully applied, which is the common case.
thomasga has joined #ocaml
yezariaely has joined #ocaml
Yoric has joined #ocaml
yezariaely has left #ocaml []
rapha_ has quit [Quit: rapha_]
Modius has quit [Read error: Connection reset by peer]
Modius has joined #ocaml
rapha_ has joined #ocaml
rapha_ has quit [Client Quit]
sgnb has quit [Remote host closed the connection]
myu2 has joined #ocaml
myu2 has quit [Client Quit]
thomasga has quit [Quit: Leaving.]
lopex has joined #ocaml
sepp2k has joined #ocaml
wagle has quit [Ping timeout: 276 seconds]
_andre has joined #ocaml
thomasga has joined #ocaml
fraggle_ has quit [Ping timeout: 240 seconds]
boscop has joined #ocaml
boscop_ has joined #ocaml
boscop_ has quit [Read error: Connection reset by peer]
boscop has quit [Ping timeout: 246 seconds]
sgnb has joined #ocaml
boscop has joined #ocaml
boscop has quit [Ping timeout: 258 seconds]
boscop has joined #ocaml
boscop has quit [Read error: Connection reset by peer]
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
boscop has joined #ocaml
fraggle_ has joined #ocaml
brooksbp has joined #ocaml
brooksbp has quit [Remote host closed the connection]
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
lopex has quit [Ping timeout: 252 seconds]
lopex has joined #ocaml
edwin has joined #ocaml
thelema_ has joined #ocaml
thelema has quit [Read error: Connection reset by peer]
SoftTimur has quit [Ping timeout: 252 seconds]
robinnn has joined #ocaml
robinn has joined #ocaml
SoftTimur has joined #ocaml
dnolen has joined #ocaml
bohanlon has joined #ocaml
avsm has joined #ocaml
thomasga has quit [Quit: Leaving.]
avsm has quit [Quit: Leaving.]
dnolen has quit [Quit: dnolen]
dnolen has joined #ocaml
dnolen has quit [Client Quit]
dnolen has joined #ocaml
avsm has joined #ocaml
avsm has quit [Client Quit]
dnolen has quit [Quit: dnolen]
dnolen has joined #ocaml
dnolen has quit [Ping timeout: 240 seconds]
jderque has joined #ocaml
thomasga has joined #ocaml
thomasga has quit [Quit: Leaving.]
tnguyen has joined #ocaml
robinn has quit [Quit: Leaving]
<SoftTimur> Hello all, I am using gedit to edit ml files, does anyone know how to format the code automatically (like touareg in emacs)?
<SoftTimur> of color the texts automatically
ikaros has joined #ocaml
edwin has quit [Disconnected by services]
edwin1 has joined #ocaml
edwin1 is now known as edwin
robinnn has quit [Quit: Leaving]
tnguyen has quit [Remote host closed the connection]
<rproust> Don't know for gedit, but GUI editors generally have a syntax/language/coloration/indetation menu entry
<rproust> kate/kwrite has one
thomasga has joined #ocaml
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
lopex has quit []
Oejet has joined #ocaml
oriba has joined #ocaml
jderque has left #ocaml []
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
<thelema_> SoftTimur: I wrote the ocaml highliting for gtksourceview, it should be automatically enabled by .ml files, if not, choose it in the View -> Highlight Mode -> sources menu
<thelema_> SoftTimur: there is no auto-indenting in gedit, the only thing I know of that does that is emacs (although vim might too)
thelema_ is now known as thelema
<SoftTimur> thelema_: indeed, I see "View -> Highlight Mode -> sources menu"
Associat0r has joined #ocaml
oriba has quit [Quit: Verlassend]
<SoftTimur> thank you
<adrien> vim sure does autoindent ;-)
SoftTimur has quit [Quit: Leaving.]
fraggle_laptop has joined #ocaml
<thelema> adrien: thanks, I'll remember that
iris1 has joined #ocaml
joewilliams_away is now known as joewilliams
<iris1> Dear experts, I would like to use tags with ocaml and emacs, but I ran into a couple of problems. I found otags and downloaded a version (unfortunately it's for 3.09, and my ocaml is 3.11, but I don't think this is causing my problem). When I try to make it, it tries to use Pcaml and dies. I think the problem is that Pcaml is part of camlp4 which I don't have. What's the simplest way to install camlp4 if I don't want to replace my existing
<iris1> installation (which is via homebrew on OS X)? Thank you!
<iris1> Incidentally, I found an announcement on the ocaml mailing list from last August, announcing otags version 3.11. Unfortunately it points at http://askra.de/otags, which is now dead. Is there a canonical way to retrieve it from somewhere? Thank you!
lopex has joined #ocaml
<thelema> iris1: I'm surprised the homebrew ocaml didn't include camlp4 - I assume there's no homebrew for camlp4?
thomasga has quit [Quit: Leaving.]
<iris1> That's right. But now that I looked carefully, I noticed there is one for camlp5. I am going to try to hack that to make it camlp4... Thank you very much!
<thelema> camlp5 is what used to be camlp4
<thelema> camlp4 git switched out around 3.10 or so
<thelema> s/git/got/
<thelema> in any case, otags shouldn't need camlp4 - I'm looking up how to turn that off
SoftTimur has joined #ocaml
<thelema> I take that back, it does. Well, install camlp5 and use otags -camlp4 camlp5
<iris1> I will try. Thanks!
ftrvxmtrx has quit [Read error: Operation timed out]
ftrvxmtrx has joined #ocaml
Associat0r has quit [Quit: Associat0r]
fraggle_ has quit [Read error: Connection reset by peer]
wagle has joined #ocaml
Yoric has quit [Quit: Yoric]
fraggle_ has joined #ocaml
jamii has quit [Ping timeout: 240 seconds]
Modius has quit [Ping timeout: 246 seconds]
ftrvxmtrx has quit [Quit: Leaving]
larhat has quit [Quit: Leaving.]
fraggle_laptop has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
andreas has joined #ocaml
<andreas> Hi!
<andreas> I'm looking into potentially doing a project in ocaml, and I have a question regarding the limitations of the implementation. Is it still true that arrays are limited to about 16MB on 32 bit machines? And is there a way to automatically use overflow-checking integer arithmetics without touching all the code?
<thelema> yes, yes, there are multiple safe_int modules that when opened replace the usual operators with safe arithmetic
<andreas> Could you recommend one?
<thelema> except the array limit isn't 16MB, it's 16M entries
<mrvn> and you can use Bigarray instead
<andreas> "Important note Untested." Mhh. I might be able to work with this anyways. :)
<andreas> Thanks for your answers!
<thelema> it's not as untested as it looks
<thelema> There's also overflow, but it looks like it's lost to webrot
ttamttam has quit [Remote host closed the connection]
<thelema> andreas: that'
<thelema> s my old fork of batteries included - it's been merged into the current batteries included code
<andreas> I see.
<mrvn> thelema: you should leave a readme
<thelema> iirc, I renamed the repository
avsm has joined #ocaml
Modius has joined #ocaml
* andreas clones the repo, installs dependencies and hacks away.
ulfdoz has joined #ocaml
Yoric has joined #ocaml
Associat0r has joined #ocaml
Modius has quit [Ping timeout: 252 seconds]
<andreas> Hello dependency hell. ounit depends on oasis, oasis depends on ounit.
<adrien> afaiu, nothing can depend on oasis
<thelema> ounit doesn't depend on oasis
<andreas> i see, it's only for the oasis tests.
<adrien> if they use oasis.ml, it's oasis' _output_ and not oasis itself
<andreas> well, I checked out a couple of things from their repos, where they come without oasis.ml.
<andreas> ounit, in fact.
Modius has joined #ocaml
<thelema> andreas: ounit should have a ./configure && make && make install
lamawithonel_ has quit [Ping timeout: 240 seconds]
<andreas> which calls ocaml setup.ml -configure, which complains about the missing oasis. :)
lamawithonel_ has joined #ocaml
<thelema> really? wow.
<thelema> someone screwed up ounit
* andreas punts on the svn version and tries the tarball.
<hcarty> andreas: They may not have the svn version ready to go without oasis to avoid constantly updating the oasis-generated files.
<hcarty> It's probably safer to use a shipped version anyway, unless you are going to get in to development
<andreas> Sure, you wouldn't check in autoconf-generated files either.
<thelema> of course.
ftrvxmtrx has joined #ocaml
Snark has joined #ocaml
Mahmoud_Ahmadine has joined #ocaml
Mahmoud_Ahmadine is now known as doknokem
avsm has quit [Quit: Leaving.]
srcerer has joined #ocaml
yezariaely has joined #ocaml
boscop has quit [Ping timeout: 246 seconds]
boscop has joined #ocaml
philtor has joined #ocaml
<andreas> # open BatInt.Safe_int;;
<andreas> # 1234567890*1234567890*1234567890;;
<andreas> Exception: BatNumber.Overflow.
<andreas> It works, thanks!
<thelema> you're welcome.
<thelema> be careful with the batmap from git - I haven't been able to evidence a bug properly, but I suspect something.
<doknokem> hello
<andreas> Oh, for formally verified code! :)
<thelema> andreas: yup, it'd be nice to have that. It's quite rare, though.
<thelema> doknokem: hi
<doknokem> i have a hard time with using a function of comparison inside another function
<andreas> thelema: I'm getting my feet wet in this. Reason I
<andreas> I'm looking into OCaml is for the glue around the Coq-exported code.
<doknokem> i have a list and based on the comparator i use, it will return the element
<thelema> Well, you're more than welcome to formally verify any parts of batteries you like.
<doknokem> but i dont know how to use the (function x y) thing inside the function
<thelema> doknokem: let find_pred p l = <return first element of [l] such that [p x] returns true> ?
<doknokem> something like that
<doknokem> not the first element
<thelema> let rec find_pred p l = match l with [] -> failwith "not_found" | h::t -> if p h then h else find_pred p t
<thelema> all elements matching a condition? That's in the stdlib: List.filter
<doknokem> i have a list [8;5;6;2] and if i put the comparator (>) then it will return 8
<doknokem> but in my function i was using h::g::t
<thelema> i.e. max of the list?
<doknokem> two elements then the rest of the list
<doknokem> well i should be able to find the mind and the max of the list
<thelema> ok.
<doknokem> based on the comparator function
<doknokem> like function (comparator) l
<doknokem> and it returns the result according to the comparison element i use
<thelema> | h::g::t -> if comp h g then find comp (h::t) else find comp (g::t)
<doknokem> what is find here
<thelema> the recursive call to your finding function
<thelema> let find comp = function ...
<doknokem> ok
<mrvn> let find cmp = function [] -> raise Error | [x] -> x | x::xs -> List.fold_left (fun acc x -> if cmp acc x then acc else x) x list
<doknokem> i made the function but the type of the result should be 'a, but it shows me 'a list
<doknokem> and when i insert a list of int
<mrvn> or define you cmp as 'a -> 'a -> 'a, selecting the element to keep. Then it ends in List.fold_left cmp x list
<doknokem> Error: This expression has type int but an expression was expected of type
<doknokem> 'a list
<doknokem> it says this
boscop has quit [Read error: Connection reset by peer]
<thelema> doknokem: can you pastebin your code that made that error?
<mrvn> # let find cmp = function [] -> raise Not_found | [x] -> x | x::xs -> List.fold_left cmp x xs;;
<mrvn> val find : ('a -> 'a -> 'a) -> 'a list -> 'a = <fun>
boscop has joined #ocaml
<mrvn> # find (fun x y -> if x > y then x else y) [1; 5; 3; 7];;
<mrvn> - : int = 7
<mrvn> doknokem: because line 3 says it returns a list
boscop has quit [Excess Flood]
<doknokem> is it []->[] ?
<thelema> what should it return if you give it an empty list?
<mrvn> you can't find the maximum of an empty list
<mrvn> raise Not_found for example
<doknokem> so this is unnecesary
<doknokem> should i do a failwith"list is empty"
<thelema> it's proper to do something on an empty list
<mrvn> not unneccesary, just wrong
<thelema> yes
<doknokem> ok
<doknokem> oh my
<doknokem> it returned the proper type
boscop has joined #ocaml
<mrvn> thelema: does ocaml optimitze the (x::r) and (y::r) away?
<thelema> mrvn: probably not
<thelema> if you wanted to do this right, you'd use an accumulator and an outer function that handled the exceptional cases
Modius has quit [Ping timeout: 258 seconds]
<doknokem> oh wow
<mrvn> thelema: nah, just fold_left.
<doknokem> it worked
<doknokem> thank you
boscop has quit [Excess Flood]
<doknokem> i never stumbled on the problem with []->[]
<thelema> doknokem: because before you always returned an empty list when given an empty list
Modius has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
<doknokem> so with the function
boscop has joined #ocaml
<doknokem> if i enter (>) it will return the max of the list
<doknokem> so it goes through all the int
<doknokem> and will look for the highest
<doknokem> then it will concatenate it to the rest of the list
<doknokem> so it will just return the max
<mrvn> doknokem: Better us the solution with fold_left. The :: will cause overhead.
<doknokem> i will try with fold now
<thelema> mrvn: class project
<mrvn> thelema: best to teach efficiency early. :)
<doknokem> so how does it return one int when there is (x::r)
<mrvn> doknokem: which one?
<thelema> Well, manually writing the loop out gets that properly - fold_left can't inline the folding function
boscop_ has joined #ocaml
<mrvn> thelema: true
<doknokem> iwait i paste bin
<mrvn> thelema: any idea why the compiler can't inline there?
<doknokem> this one works
<doknokem> when i ask for the min
<thelema> mrvn: design decision
<doknokem> it gives the min
<doknokem> but i dont understand how it returns one element
<doknokem> and not the element with the rest
<mrvn> doknokem: at some point r is []
<doknokem> oh so its the x::[]
<mrvn> doknokem: The recusion only ends in 3 and 4.
<mrvn> 3 can only happen if the initial list is empty. In all other cases it ends up in 4.
<doknokem> ok
boscop has quit [Ping timeout: 246 seconds]
ftrvxmtrx has joined #ocaml
boscop_ has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
boscop has quit [Excess Flood]
<gildor> andreas: the dev version of oasis needs oasis indeed, not the tarball (which is shipped with an self-contained setup.ml)
<gildor> andreas: the dev version of OUNIT needs oasis indeed, not the tarball (which is shipped with an self-contained setup.ml)
boscop has joined #ocaml
lamawithonel_ has quit [Ping timeout: 240 seconds]
lamawithonel_ has joined #ocaml
Snark has quit [Quit: Ex-Chat]
boscop has quit [Ping timeout: 246 seconds]
yezariaely has quit [Quit: Leaving.]
doknokem has quit [Ping timeout: 246 seconds]
Mahmoud_Ahmadine has joined #ocaml
Oejet has quit [Quit: Leaving.]
ulfdoz has quit [Read error: Operation timed out]
Cyanure has quit [Ping timeout: 260 seconds]
oriba has joined #ocaml
Mahmoud_Ahmadine is now known as doknokem
andreas has quit [Ping timeout: 246 seconds]
<doknokem> hey thelema
<thelema> yes?
<doknokem> im now trying to do the same function as before
<doknokem> but now i have to sort the list
<doknokem> so i tried something
<doknokem> but i fail to see my mistake
<doknokem> the function is supposed to build a sorted list
_andre has quit [Quit: leaving]
<doknokem> Error: This expression has type 'a list
<doknokem> but an expression was expected of type 'a
<doknokem> it gives me this error
<thelema> yes, lives 3 and 4 return a single value, whild 6 and 7 return a list
<doknokem> is the fourth line even necessary
<doknokem> i want to avoid the error where all possibilities are not considered
<doknokem> Warning P: this pattern-matching is not exhaustive.
<doknokem>
<doknokem> that one
<thelema> the fourth line is very important.
smerz has joined #ocaml
<doknokem> oh wait
<doknokem> i need to return the built list
<doknokem> on the fourth line
<doknokem> by deleting fourth line i have the proper types
<doknokem> but i have patern matching error
<doknokem> exhastive error
<thelema> yes, you must keep the 4th line but change it so it returns a list
lopex has quit [Ping timeout: 252 seconds]
lopexx has joined #ocaml
edwin has quit [Remote host closed the connection]
philtor has quit [Ping timeout: 276 seconds]
Yoric has quit [Quit: Yoric]
lopexx has quit []
lopex has joined #ocaml
<doknokem> hey i tried something but it has a weird behavior
Associ8or has joined #ocaml
Rickasaurus has quit [Read error: Connection reset by peer]
Rickasaurus has joined #ocaml
Associat0r has quit [Ping timeout: 246 seconds]
eye-scuzzy has quit [Read error: Operation timed out]
eye-scuzzy has joined #ocaml
gio has joined #ocaml
<gio> hi
Derander has joined #ocaml
oriba has quit [Quit: Verlassend]
gio has left #ocaml []
<doknokem> is it possible to make a sorting function that takes a comparator as a parameter for the list
Asmadeus has quit [Read error: Operation timed out]
Asmadeus has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
Amorphous has quit [Ping timeout: 276 seconds]
boscop has joined #ocaml
Amorphous has joined #ocaml
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 246 seconds]
dnolen has joined #ocaml
doknokem has quit [Read error: Connection reset by peer]
alexgordon has joined #ocaml
kusco has joined #ocaml
<kusco> When working with modules, how does one handle module dependencies? For example, say I have Foo and Bar as modules, with Bar requiring types defined in Foo.
<kusco> What call does one put at the top of the Bar definition to pull in Foo?
andreas has joined #ocaml
<hcarty> kusco: You don't have to put anything in the Bar module to access types or values from Foo. You can prepend them with Foo.
<hcarty> kusco: ex. Foo.t to refer to type t from module Foo
avsm has joined #ocaml
<hcarty> kusco: Or you can put "open Foo" at the top of Bar to have direct access to all values and types from Foo without needing the Foo. prefix.
<kusco> I see...so there must be an path option to the ocaml interactive shell to tell it where to look?
<hcarty> kusco: If it's compiled, you can use #load "foo.cmo";;
<hcarty> kusco: I need to run, but here's a reference for more - http://caml.inria.fr/pub/docs/manual-ocaml/manual023.html
<kusco> Thanks hcarty
<hcarty> kusco: You're welcome, and have fun :-)
fraggle_ has quit [Remote host closed the connection]
fraggle_ has joined #ocaml
avsm has quit [Quit: Leaving.]