... Hash: SHA1 Ahh, right. So in func2 the function is explictly defined in two parts and so there is actual partial application. I thought about why ocaml...
Peng Zang
peng.zang@...
Oct 1, 2007 11:27 am
8736
... Hash: SHA1 Actually in the previous email the module type definition for BAR is completely superfulous and may confuse the issue. Here's the cleaned up ...
Peng Zang
peng.zang@...
Oct 1, 2007 11:29 am
8737
The difference between examples is not at all strange, see below. I'm not an expert myself; I don't know why concrete types as specified by signatures are not...
... Hash: SHA1 These links were great! I really appreciate them. From what I've been able to gather from a brief reading, Applicative Functors should allow...
Peng Zang
peng.zang@...
Oct 1, 2007 1:59 pm
8740
Hi, ... This is not about funtor. <code> # #tell "X.t";; type X.t = Bar(Foo1).t = { randstring : string; thefooval : Foo1.t; } # #tell "Y.t";; type Y.t =...
Zheng Li
li@...
Oct 1, 2007 2:01 pm
8741
... Hash: SHA1 Hi, Ahhhh.. I had never realized this before. So let me restate this and see if I understand what you're saying. Because the functor uses ...
Peng Zang
peng.zang@...
Oct 1, 2007 3:18 pm
8742
Hi, ... Questions about OCaml's module system and types are sometimes confusing, and I'm actually not the right person for your question. But anyway, I can try...
Zheng Li
li@...
Oct 2, 2007 12:02 am
8743
Thanks for these useful explanations and sorry for the delay ! ... instead of : let size = flip (M.fold (fun _ _ n -> n + 1)) 0 Here the extra call to 'flip',...
... this was a pleasant "aha" as i didn't realize you could nest these matches... So now I have: let rec get_clauses_without lit clauses = match clauses with ...
Phil Tomson
rubyfan@...
Oct 2, 2007 7:44 pm
8745
On Tue, 2 Oct 2007 12:44:14 -0700, Phil Tomson wrote ... matches... ... There's an extra function call/return with List.length, which is negligible. The...
... Exactly. The built in data structures are light weight so they consume minimal memory and you can augment them with such functionality as you wish. The ...
let assert_ints_equal expected actual = if expected = actual then () else raise (TestFailure (sprintf "expected: %d but was: %d" expected actual)) let...
... Right. ... What you can do is pass a to_string function as a parameter: let assert_equal to_string expected actual = if expected = actual then () else ...
... Hash: SHA1 Wow. So first let me apologize for taking so long to get back to this. Fall semester abruptly got busy. Second, your reply has been extremely...
Peng Zang
peng.zang@...
Oct 3, 2007 1:00 pm
8751
I understand that it's poor practice to open modules, and that we're better off using explicit qualification, but I was wondering whether there are any...
... You might get confused if you open List and String and try to use a function that is in both, like "length". ... Yes. ... Indeed, I wonder why Printf isn't...
... Because printf was a bad idea in C. Basically, you have a language within a language- and worse yet, it's a language within a string within a language....
... I used to open List, but no longer do this. I appreciate the brevity, but I don't like the asymetry between "iter" and "Array.iter", for example. Many...
Hi ! Its about a remark from John Skaller in Caml-List. http://caml.inria.fr/pub/ml-archives/caml-list/2007/04/f4d4e24dedb89ac181221d58be63f091.en.html I asked...
I would use an explicit directed graph which the function would follow. The graph could then optionally contain cycles. Here is a simple example where the...
I'm diving into OCaml by doing a couple of ports. One of the things that I'm porting has a class with multiple constructors. Is there a nice way to map that...
Oops, I had an extra argument in that last function. It should have been let traverse graph finish_test startnode = let go node = List.assoc node graph in let...
... Overloading grates against type inference, so the idiomatic OCaml solution is to simply write different functions: let make x y = {Complex.re=x; im=y} let...
... Thanks. I thought of that.. but the sticking point is that I'm creating objects so I'd have to create some functions which delegate their arguments to the...
... I don't follow. The code shouldn't be any longer in OCaml. Can you post code examples? For example: # type complex = < im : float; re : float >;; type...
... Sure. I'm porting Ward Cunningham's FIT testing framework. It's very OO and I'm trying to keep the port close to that until I get more experience and see...
There is more documentation and editor support for regular syntax. But really, write in whichever you like. You can use the Camlp4 system to translate from one...