mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
Yoric[DT] has quit ["Ex-Chat"]
jlouis has joined #ocaml
jonafan has quit [Read error: 104 (Connection reset by peer)]
ita has quit ["Hasta luego!"]
smimou has quit ["bli"]
rickardg has quit [Read error: 110 (Connection timed out)]
rogo has joined #ocaml
yminsky has joined #ocaml
ikaros has quit [Remote closed the connection]
seafood_ has joined #ocaml
hsuh has joined #ocaml
hsuh has quit [Client Quit]
mordaunt has joined #ocaml
cloupsy has joined #ocaml
seafood_ has quit []
seafood_ has joined #ocaml
yminsky has quit []
|Catch22| has joined #ocaml
catch22 has joined #ocaml
catch22 has quit [Client Quit]
buluca has joined #ocaml
mordaunt has quit [Read error: 104 (Connection reset by peer)]
buluca has quit [Read error: 113 (No route to host)]
Jeff_123 has joined #ocaml
Jeff_123 has quit ["Quit"]
seafood_ has quit []
<flux> hmph, cothreads doesn't have findlib support
ttamttam has joined #ocaml
seafood_ has joined #ocaml
marmottine has joined #ocaml
marmottine has quit [Remote closed the connection]
Tetsuo has joined #ocaml
tetsuo_ has joined #ocaml
tetsuo_ has quit [Remote closed the connection]
<flux> also it doesn't yet have the networker feature, which sounds really interesting..
filp has joined #ocaml
ikaros has joined #ocaml
ikaros has quit ["segfault"]
ikaros has joined #ocaml
ikaros has quit [Remote closed the connection]
ikaros has joined #ocaml
smimou has joined #ocaml
bringert has joined #ocaml
Yoric[DT] has joined #ocaml
kelaouchi has quit ["leaving"]
<tsuyoshi> did anyone see this
<tsuyoshi> we somehow got beat by perl
<Yoric[DT]> interesting
seafood_ has quit []
marmottine has joined #ocaml
Snark has joined #ocaml
hsuh has joined #ocaml
<hsuh> hey! anyone uses the smoke vector library ?
Tetsuo has quit [Remote closed the connection]
Tetsuo has joined #ocaml
* rwmjones is waiting for harrop to free the source ...
yminsky has joined #ocaml
Snark has quit [Read error: 104 (Connection reset by peer)]
Snark has joined #ocaml
<hsuh> right
Snark has quit [Read error: 104 (Connection reset by peer)]
<Yoric[DT]> Well, I haven't.
<Yoric[DT]> I haven't even managed to get the samples to run.
Snark has joined #ocaml
Snark has quit [Read error: 104 (Connection reset by peer)]
Snark has joined #ocaml
Snark has quit [Read error: 104 (Connection reset by peer)]
bringert has quit []
<tsuyoshi> this looks a lot like the sql replacement I've been working on
<tsuyoshi> he's turning relations into functions.. I was creating a whole new type in the compiler
Snark has joined #ocaml
bringert has joined #ocaml
yminsky has quit []
<tsuyoshi> huh.. fundamentally it's the same idea but I am being a little more ambitious
hkBst has joined #ocaml
<hsuh> mfc is great
<Yoric[DT]> Is it ?
<hsuh> i think so.
<hsuh> oh, its mfp, not mfc
<hsuh> :P
hsuh has quit ["off to work"]
ita has joined #ocaml
seafood_ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
bringert has quit [Read error: 104 (Connection reset by peer)]
bringert has joined #ocaml
khigia has joined #ocaml
bongy has joined #ocaml
Snark has quit ["Quitte"]
<khigia> hello
<khigia> newby question about type dependency problem:
<khigia> I want a module Tuple, containing a "type t = term array"
<khigia> and the type term is defined by "type term = | MyInt of int | MyTuple of Tuple"
<khigia> problem is that module Tuple require module Term, and module Term require module Tuple
<khigia> so I can't compile!
<khigia> anyone?
<smimou> you could use recursive modules
<smimou> but it's certainly the sign of a bad design
<khigia> bad design ... I agree, but the concept seems simple: I want a tuple containing terms, and tuple can itself be a term
<khigia> any recommendation of other design?
<smimou> why don't you put them in the same module for example ?
<smimou> type term = | Int of int | Tuple of tuple
<smimou> and
<smimou> tuple = term array;;
<khigia> yes that's what I want
<smimou> (this is valid caml code)
<khigia> but I would like tuple to be a module (can do more than array)
<khigia> recursive module seems ok; thanks
seafood_ has quit []
<khigia> arg! cannot mix recursive module and type definition: module rec Tuple .... and type term ...
<khigia> bad design ... but how to do?
buluca has joined #ocaml
<bongy> sorry how can I define a record with one list field?
CRathman has joined #ocaml
<bongy> anyone can help me? if i type type nl = { pl:list };; the interactive env. says Characters 15-19:
<bongy> type nl = { pl:list; };;
<bongy> ^^^^
<bongy> The type constructor list expects 1 argument(s),
<bongy> but is here applied to 0 argument(s)
<bongy> but wich argument have I to supply ?
<smimou> it should be "int list" if the list contains int, etc.
<smimou> you must specify the type of the elements of the list
<Yoric[DT]> Or, if you want any type of list,
<Yoric[DT]> type 'a nl = {pl : 'a list; };;
Jeff_123 has joined #ocaml
<Yoric[DT]> khigia: you could also parametrize one upon the other
<Yoric[DT]> e.g.
<Jeff_123> hi yoric!
<Yoric[DT]> Hi Jeff_123
<Yoric[DT]> Well, I gotta check if there's a demonstration starting now.
* Yoric[DT] might return later, depending on politics :)
<bongy> mmm Yoric[DT] can explain me better what means type 'a nl = {pl : 'a list; };; ??
<Jeff_123> hmpg
<bongy> no i understand
<bongy> ;)
<Yoric[DT]> bongy: for every type 'a, 'a nl is the type of ...
<Yoric[DT]> well, ok :)
<Yoric[DT]> still, gottago
<bongy> thanks you Yoric[DT]
<khigia> Yoric: thanks, that what I did, but then if I want to implement "to_string" function in Tuple module, I need to pass it a function to apply on each of its parameterized term.
<bongy> guys there is a way to put a function as record field?
<Jeff_123> like "type 'a something = { somefunction : ('a -> 'a) }" ?
<bongy> yep
<bongy> Jeff_123, and when i want to "let" a record how i specify the function?
<Yoric[DT]> Well, no demonstration around here.
<Yoric[DT]> bongy: let a = {somefunction: function x -> y}
<Yoric[DT]> or, if you already have your function f x = ....
<Yoric[DT]> let a = {somefunction = f }
<bongy> ok merçi
<Yoric[DT]> (sorry, the ":" should have been a "=" )
<Yoric[DT]> Je vous en prię.
* Yoric[DT] has no clue why bongy added a cedilla, so that deserves a return cedilla in my answer :)
<bongy> no sorry i wrong
<bongy> how works a comparison of two list? why:
<bongy> # [1;1;1;1;1;1;1] > [6];;
<bongy> - : bool = false
<bongy> #
<bongy> compare the first of list1 with the first of list2 and so on?
<Yoric[DT]> Just know that it's complicated :)
<Yoric[DT]> Actually, yes, I believe it's lexicographical order.
<Yoric[DT]> But comparaison, in general, is something complicated in OCaml.
khigia has left #ocaml []
bringert has quit []
<bongy> Yoric[DT], i'll forever keep in my mind ;)
<Yoric[DT]> :)
<bongy> Yoric[DT], i'm writing a function that takes a list in input and checks whenever the list is in increasing order but it doesn't work ;)
<bongy> let rec orderfun l1 = match l1 with
<bongy> [] -> true
<bongy> |(head::tail) -> ([head] < tail) & orderfun tail;;
<bongy> # orderfun [1;2;3;4];;
<bongy> - : bool = false
buluca has quit [Read error: 113 (No route to host)]
<bongy> i found the bug
<Yoric[DT]> Well, you could have done something simpler :)
<Yoric[DT]> (and the bug, I assume, is that [4]<[] is false )
<bongy> yep
<Yoric[DT]> Why don't you compare the first element to the second ?
<Yoric[DT]> That's easier.
<bongy> easier than mine?
buluca has joined #ocaml
<Yoric[DT]> Well, you're relying on the fact that comparing a list of size one with a list of larger size only compares the first element.
<Yoric[DT]> I'm not sure that's canonical.
<bongy> oh right
ttamttam has left #ocaml []
<bongy> oh i didn't know that can i type a::b::tail, it seams great ;)
<Yoric[DT]> :)
<Yoric[DT]> You can even do something slightly more complex than what I wrote and slightly faster.
<bongy> wow ;)
jonafan has joined #ocaml
delamarche has joined #ocaml
bringert has joined #ocaml
JohnnyL has joined #ocaml
ttamttam has joined #ocaml
mrsolo has left #ocaml []
mrsolo has joined #ocaml
Jedai has quit [Read error: 104 (Connection reset by peer)]
Jedai has joined #ocaml
delamarche has quit [Connection timed out]
filp has quit ["Bye"]
<bongy> Yoric[DT], why ocaml list can't contain non-homogeneous values?
<rwmjones> that's just how it is
<rwmjones> what would the type of such a list be?
<rwmjones> how could functions like List.map work?
<flux> sure they can. they can for example contain objects, which can all be instances of different classes.
<flux> of course, list's view must be only a common subset
<bongy> rwmjones, like scheme list that can cointains int,char,string at same time
<rwmjones> scheme is dynamically typed though
<rwmjones> in OCaml values don't carry their type around with them at runtime
<flux> bongy, and what do you do when you handle such a list? do you check they type before manipulating the value?
<rwmjones> (well except for some very narrow exceptions)
<rwmjones> if you want to carry that baggage around then define
<rwmjones> type var = Int of int | Char of char | String of string (* etc *)
<rwmjones> then you can have lists of type "var list"
<Yoric[DT]> bongy: That's actually the main difference between Scheme and OCaml.
<Yoric[DT]> Scheme detects type errors when you run the program.
<Yoric[DT]> OCaml detects type errors when you compile the program.
Oatschool has quit ["Leaving"]
Oatschool has joined #ocaml
<Yoric[DT]> Therefore, OCaml's testing is more thorough but also rejects things that are uncheckable although they could be useful.
<Yoric[DT]> Are you sure that what you need is a list ?
<Yoric[DT]> Quite often, when you wish to mix types, tuples are a better choice.
<bongy> Yoric[DT], no i'm just asking
<Yoric[DT]> ok
<Yoric[DT]> Then you have your answer :)
<bongy> yes i have and very helpfull so thanks you *
<Yoric[DT]> a pleasure
<bongy> maybe is better static type check, i think, and you?
<Yoric[DT]> Actually, I'd say that it depends on what you're writing.
<Yoric[DT]> For small programs, it can be tiresome and annoying.
<Yoric[DT]> For libraries, I believe it's essential.
Snark has joined #ocaml
<flux> it's nice to read old code and query expressions for their types
delamarche has joined #ocaml
bluestorm_ has joined #ocaml
kelaouchi has joined #ocaml
<bongy> see you later bye
bongy has quit ["Leaving"]
buluca has quit [Read error: 113 (No route to host)]
Jeff_123 has quit ["Quit"]
delamarche has quit []
kelaouchi has quit ["leaving"]
ttamttam has left #ocaml []
mbishop has quit [Remote closed the connection]
mbishop has joined #ocaml
Snark has quit ["Quitte"]
ita has quit ["Hasta luego!"]
pattern has quit [Remote closed the connection]
pattern has joined #ocaml
marmottine has quit ["Quitte"]
ita has joined #ocaml
CRathman has quit ["ChatZilla 0.9.79 [Firefox 2.0.0.11/2007112718]"]
dbueno has joined #ocaml
dbueno has quit [Client Quit]
dbueno has joined #ocaml
kelaouchi has joined #ocaml
dbueno has quit [Client Quit]
hkBst has quit ["Konversation terminated!"]
bluestorm_ has quit [Remote closed the connection]
Tetsuo has quit [Read error: 110 (Connection timed out)]
Tetsuo has joined #ocaml
Tetsuo has quit ["Leaving"]
buluca has joined #ocaml
jlouis_ has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]