|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
fschwidom has quit [Remote closed the connection]
ched has quit [Remote closed the connection]
^authentic has joined #ocaml
authentic has quit [Connection timed out]
^authentic is now known as authentic
Axioplase_ is now known as Axioplase
comglz has quit ["bonne nuit"]
|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
<middayc>
hm.. there should be some ocaml channel for not computer scientists :) .. I (sadly) understand only half that you are talking here
Nutssh has quit ["Client exiting"]
Nutssh has joined #ocaml
<middayc>
..but ocaml seems perfectly usable to me, in fact very usable
Associat0r has quit []
<thelema>
middayc: there's some practical people here too. They're just busy doing stuff.
<middayc>
:) ok.. the CS talk doesn't bother me at all but I don't feel asking newbie practical questions if guys are talking such highlevel stuff
<mfp>
middayc: there's not too much CS talk (or any talk whatsoever) on #ocaml, so don't hesitate to ask :)
|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
<mfp>
you might not get many responses at this time of the day though, since it's 3am in Central European Time
<mfp>
-in
<mfp>
<- can't type, zzZ
<middayc>
mfp: ok, I will not hesitate to ask :) .. I am on central European time too :)
<mrvn>
And you might get an answere hours later when someone wakes up too.
<middayc>
ok , so I have two questions ... I am making a simple word stemmer with OCaml, I pasted source here http://ocaml.pastebin.com/m1a37508f
Nutssh has quit ["Client exiting"]
<middayc>
one question is... at line 115 " let x = sock_send client_sock str in " x here is unused so I get a warning at compile time and it looks ugly ... and I don't know how to make that code without " x = "
<mrvn>
let _ = ... or ignore (...)
<mrvn>
or assert(x = String.len str);
<middayc>
aha .. thanks! I will try and see how each looks
<mrvn>
The assert would be better as it shows when an error occurs. The ignore I believe is just a let ignore = function _ -> ()
<mrvn>
or let ignore _ = ()
<middayc>
in case of ignore do I have to make ";" at the end of the line instead of in"?"
<mrvn>
You can use _ anywhere where you have a binding that you don't need. e.g. match foo with (x,_,_)::xs -> ...
<mrvn>
middayc: yes, you need a ; between the ignore and shutdown
<middayc>
thanks a lot
<middayc>
well the other question is probably not important.. I didn't like the mixture of in and ; lines at creating a socket and then setting options to it, but I guess that is simply the only way..
<middayc>
and I could wrap it into nicer function
<mrvn>
a;b;c is equivalent to let () = a in let () = b in c
<middayc>
I mean like it's in lines 107 to 110
<middayc>
hm, interesting
alexyk has joined #ocaml
MichaelGG has joined #ocaml
xah_lee has joined #ocaml
<xah_lee>
is there a emacs mode for ocaml?
|jedai| has quit [Read error: 110 (Connection timed out)]
<brendan>
google for tuareg
middayc has quit [Read error: 60 (Operation timed out)]
<xah_lee>
brendan: i found CamlMode too. Is one better in general?
<brendan>
I prefer tuareg. I think most people do.
<xah_lee>
kk. thx.
|jedai| has joined #ocaml
jknick has joined #ocaml
alexyk has quit []
<xah_lee>
umm... sorry what's the cmd name to de bz2
<brendan>
bunzip2
alexyk has joined #ocaml
middayc has joined #ocaml
alexyk_ has joined #ocaml
|jedai| has quit [Connection timed out]
|jedai| has joined #ocaml
alexyk has quit [Connection timed out]
schme_ is now known as schmx
xah_lee has quit ["banned in #emacs by johnsu01 (john sullivan)"]
middayc has quit ["Ex-Chat"]
jeddhaberstro has quit []
mjonsson has joined #ocaml
xah_lee has joined #ocaml
<xah_lee>
is there a page that describe basic difference between f# and Ocaml?
<xah_lee>
am experienced in fp but first time ocaml today
MichaelGG_ has joined #ocaml
MichaelGG has quit [Read error: 110 (Connection timed out)]
thelema has quit [Read error: 60 (Operation timed out)]
jeremiah has quit [Read error: 104 (Connection reset by peer)]
jeremiah has joined #ocaml
Mr_Awesome has joined #ocaml
alexyk_ has quit []
realtime has joined #ocaml
|jedai| has quit [Read error: 145 (Connection timed out)]
|jedai| has joined #ocaml
xah_lee has quit ["banned in #emacs by johnsu01 (john sullivan)"]
sefuderem has joined #ocaml
sefuderem is now known as realtime_
alexyk_ has joined #ocaml
Camarade_Tux has joined #ocaml
realtime has quit [Read error: 110 (Connection timed out)]
|jedai| has quit [Read error: 60 (Operation timed out)]
|jedai| has joined #ocaml
seafood has quit []
purple_ has quit [Remote closed the connection]
realtime_ has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has quit ["school"]
pierre- has joined #ocaml
pstickne has quit ["(off to earn my "accreditation" -- I really wish it meant something more about knowledge)"]
thelema has joined #ocaml
|jedai| has quit [Connection timed out]
|jedai| has joined #ocaml
sporkmonger has quit []
realtime has joined #ocaml
_jedai_ has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
|jedai| has quit [Read error: 110 (Connection timed out)]
alexyk_ has quit []
vixey has joined #ocaml
jeremiah has joined #ocaml
Yoric[DT] has joined #ocaml
<Yoric[DT]>
hi
<vixey>
hey
realtime has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]>
vixey: you disappeared on us while we were explaining dependent pairs, yesterday :)
<vixey>
I read about using them to define something like a module system in Luos book
<mrvn>
dependent pairs?
_jedai_ has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
Axioplase is now known as Axioplase_
<vixey>
how does dependent pairs relate to this 'exists' thing?
s4tan has joined #ocaml
<vixey>
mrvn, I suppose it means to have a pair like (p,q) except that the type of q can depend on the value p
<vixey>
I wish I said <p, q> now
<Yoric[DT]>
Well, from my understanding, you typically use them when [p] has an existential type.
<Yoric[DT]>
So it's more <p : exists t.t, q : u> + a proof that the type of [p] is actually [u].
<vixey>
I have still not got a clue what exists means :(
<Yoric[DT]>
It's a manner of hiding a type.
<Yoric[DT]>
Obj.t can be seen as the OCaml version of [exists t.t] .
<Yoric[DT]>
(well, although there should be several distinguishable kinds of [Obj.t] in that case)
<Yoric[DT]>
[exists t] is the opposite of [forall t] insofar as it means there does exist a type with some property, you just can't know which concrete type.
<Yoric[DT]>
By opposition, with [forall], any type does the job.
<mrvn>
I still want ocaml to learn that one can have a ('_a, '_a -> unit) list
<Yoric[DT]>
arf.
<mrvn>
Would be nice if ocaml could have structures with subtypes
<Yoric[DT]>
What do you mean?
<mrvn>
Like a ('_a, '_a -> unit) list, '_a being a subtype of anything.
<vixey>
why not use (unit -> unit) list ?
<Yoric[DT]>
By anything, U assume you mean a specific type, don't you?
<Yoric[DT]>
By anything, I assume you mean a specific type, don't you?
<mrvn>
vixey: yeah, in this case.
<mrvn>
Yoric[DT]: like [(1, fun x -> x+1); (2.0, fun x -> x+.1.)]
<Yoric[DT]>
ok
<Yoric[DT]>
Doesn't quite fit as subtyping, of course.
<Yoric[DT]>
Well, I guess you could use polymorphic variants for this purpose.
<mrvn>
Yoric[DT]: nope.
<Yoric[DT]>
(if you already know your list of types)
<vixey>
I use something like: [Ex(Int, 1), Ex(Float, 2)]
<vixey>
Int : Code int
<vixey>
Ex : Code a -> a -> Exists
<vixey>
Ex : Code 'a -> 'a -> Exists *ahem*
<mrvn>
Yoric[DT]: The idea is that you can put in any type that conforms to a basic interface. In this case no requirement at all.
<Yoric[DT]>
Fair enough.
<Yoric[DT]>
Mmmmhhh....
<Yoric[DT]>
I believe you can do that with records.
<mrvn>
Yoric[DT]: Only if you bind every function in the record already to the value.
<mrvn>
type 'a virttbl = { v : 'a; f : 'a -> 'a }
<Yoric[DT]>
I'm thinking more along the lines of
<Yoric[DT]>
encoding existentials with universals.
<mrvn>
[{v=1; f = (+) 1;}; {v=1.; f = (+.) 1.;}] doesn't work.
* Yoric[DT]
needs to check exactly how that's done.
<Yoric[DT]>
Sure, that's different types of records.
<Yoric[DT]>
But with a little encoding, you can write something equivalent to
<vixey>
just like: type virttbl = forall 'a. { v : 'a; f : 'a -> 'a }
<Yoric[DT]>
type virttbl = exists 'a. { v : 'a; f : 'a -> 'a }
<mrvn>
Hmm, never seen that syntax in ocaml.
|jedai| has quit [Connection timed out]
* vixey
makes up syntax
<mattam>
vixey: precisely, this syntax in Haskell builds existential types.
<mattam>
The forall inside the decl.
<Yoric[DT]>
No, the syntax is made up.
<vixey>
is the idea basically, say
<Yoric[DT]>
The encoding is more complicated.
<mattam>
(I know it's weird)
<vixey>
a -> (exists x. x -> x) -> b
|jedai| has joined #ocaml
<vixey>
would be the same as say,
* Yoric[DT]
considers writing a Camlp4 syntax extension for this purpose.
<vixey>
type Foo = forall x. x -> x
<vixey>
a -> Foo -> b
<vixey>
?
<mrvn>
And how do you implement it? Obj.t?
<mattam>
vixey: try it in haskell with a data decl.
pierre- has quit [Read error: 60 (Operation timed out)]
<mrvn>
One way to implement it is as let wrap x f = x := f !x let record x = let w = wrap (ref x) in { f1 = w f1; f2 = w f2; f3 = w f3 }
<Yoric[DT]>
« An existential type can be encoded in System F using universal types. Namely,
<Yoric[DT]>
9.t() = 8.(8. t() ! ) ! »
<Yoric[DT]>
Erf, doesn't quite fit.
<mrvn>
doesn't print either
<Yoric[DT]>
Actually, that's what I meant.
<Yoric[DT]>
Let me rewrite it in ascii.
<Yoric[DT]>
exists 'a. T = forall 'b. (forall 'a . T -> 'b) -> 'b
<vixey>
'a free in T?
<Yoric[DT]>
Since you need records to have this kind of [forall] in OCaml, encoding exists requires record.
<Yoric[DT]>
vixey: indeed
<vixey>
ok
* Yoric[DT]
should have written something like T['a]
<mrvn>
or hide the type in a ref and bind it before use.
<Yoric[DT]>
That's the alternative.
<vixey>
The biggest issue with haskell you just can't get around is that you can't internalize the type system into codes, because something like a -> a -> a is not expressible without lambda
<mrvn>
or use classes and virtual functions.
<mattam>
You need impredicative polymorphism indeed.
pierre- has joined #ocaml
<Yoric[DT]>
mattam: back into the fray? :)
<mattam>
I'm in Neijmegen, I just had my breakfast :)
<mrvn>
long words, can't grasp, need coffee.
<mrvn>
impredicative?
<Yoric[DT]>
mrvn: the above encoding.
<mrvn>
dict.leo.org doesn't have that word
<vixey>
I'm never sure what impredicative means
<vixey>
it just makes me think of System F though
<mattam>
Can you really nest the quantifier that way using records?
<Yoric[DT]>
mattam: yeah, I've done it a few times.
<mrvn>
"Also called first-class polymorphism. Impredicative polymorphism allows the instantiation of a variable in a type # with any type, including polymorphic types, such as # itself."
<mrvn>
Yes, that sounds exactly like what I want.
<mattam>
Interesting. Does it interact with inference in a bad way?
<vixey>
forall a. a -> a, might get self instantiate to: (forall a. a -> a) -> (forall a. a -> a)?
<vixey>
(rather than going into a infinite type)
<mrvn>
Although I want it with subtyping too preferably.
<Yoric[DT]>
mattam: well, you have to manually define two record types for each [exists] so I wouldn't call that "interacting in a good way".
<mattam>
Oh.
<Yoric[DT]>
Although it's somewhat lighter with objects.
<mrvn>
e.g. let sum (list : M.t list) = Lift.fold_left (fun acc x -> M.add acc x) M.zero list
<mrvn>
Where M must have subtype "arithmetic"
<vixey>
mrvn, something like double < float < int, and M.add takes the lub?
<mattam>
Yoric[DT]: gtg. I'll bug you about that later :)
jeremiah has quit [Read error: 104 (Connection reset by peer)]
ikaros has quit [Read error: 110 (Connection timed out)]
ikaros has joined #ocaml
|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
jeremiah has joined #ocaml
MichaelGG__ has joined #ocaml
MichaelGG_ has quit [Read error: 110 (Connection timed out)]
<middayc_>
I have been coding and learning in OCaml from over the weekend and I already made what I needed (a word stemmer) + server + usage with pipes
jeremiah has quit [Connection reset by peer]
<middayc_>
I really like how productive ocaml is and thanks for your help
_jedai_ has joined #ocaml
|jedai| has quit [Read error: 110 (Connection timed out)]
jeremiah has joined #ocaml
jeremiah has quit [Connection reset by peer]
jeremiah has joined #ocaml
sporkmonger has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
_jedai_ has quit [Read error: 60 (Operation timed out)]
|jedai| has joined #ocaml
s4tan has joined #ocaml
jeremiah has joined #ocaml
<middayc_>
hm.. one end of my ocaml program needs to be called from php which I have shared hosting, I got the permissions to run but now it says:
<middayc_>
/lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.4' not found (required by ..
<mrvn>
compile it on that system
|jedai| has quit [Read error: 110 (Connection timed out)]
<middayc_>
It's a shared hosting so I can't do anything, I wrote email to hosting owner ... can he install this version of libc without changing the version that other apps need? (I know this is a linux question)
|jedai| has joined #ocaml
<middayc_>
mrvn: I mean can multiple versions of libc coexist, if you happen to know?
<mrvn>
middayc_: In debian it is halfway harmless. On rh/suse I wouldn't dream of changing the libc from the released one.
<mrvn>
middayc_: you can set LD_LIBRARY_PATH or LD_PRELOAD to your own. But any nameserver or locale modules will use the wrong ones and might totaly crash.
<mrvn>
Can't you compile your code on the server? Can't they install ocaml there?
<mrvn>
Alternatively use whatever distribution they are using.
<middayc_>
hm.. then I think they won't want to do it ( at least I wouldn't ) possibly screving up other users of shared hosting..
<mrvn>
middayc_: using LD_LIBRARY_PATH or LD_PRELOAD will only screw up you.
<middayc_>
aha.. you mean if I compile it on server or on a compiter with same libc version then it will work there too ..
<mrvn>
and only where you use it
<mrvn>
middayc_: yes.
<middayc_>
they won't want to install ocaml probably but I have a vps also and I can install ocaml there and compile and hope that the version is the same .. or install something locally with the same version
<middayc_>
mrvn: thanks a lot!
<middayc_>
I will also look for more info on LD_LIBRARY_PATH..
<mrvn>
libc can be tricky though. you might have to also use a newer ld.so
<middayc_>
does compiled ocaml (with -opt) have many other such dependencies or just libc? I use modules Unix, Str, Sys in it
<mrvn>
ldd binary
<mrvn>
can ocamlopt do static code?
<mrvn>
maybe -ccopt -static?
<middayc_>
I am not that versed on low level stuff (especially linux) but I saw something mentioned about this... maybe I need to just add right flags
<middayc_>
hm
<mfp>
middayc_: -cclib -static works for me
<mfp>
you'll get a warning about some glibc functions requiring the same glibc version dynamically (gethostbyname and some others), but everything will work fine if you don't use them
<mfp>
so no need to copy your libc.so + set LD_LIBRARY_PATH
<mfp>
-cclib -static is especially useful if you are using other (non-OCaml) libs
<middayc_>
I am reading the docs for ocaml-opt.. but I don't see -static option
<mrvn>
middayc_: the -static is the argument to -cclib
<mfp>
it's not -static, but -cclib -static = pass -static to gcc in the link phase
<middayc_>
thanks, I will try
<mfp>
I used that to run an ocaml webapp that depended on libsqlite, libpcre, libcrypto, libssl, etc., on a sys without them (or with wrong versions)
<middayc_>
it produces the warnings you mentioned :) now off to ftp
<mfp>
if you do need those funcs, you'll have to cp libc.so and use LD_LIBRARY_PATH, I guess
<mrvn>
mfp: nope.
|jedai| has quit [Connection timed out]
<mrvn>
If you need those and the native ones don't work then you are plain screwed.
|jedai| has joined #ocaml
<mfp>
mrvn: native ones? cannot one use LD_LIBRARY_PATH to use your own libc, with the right version?
<mrvn>
No. the libc opens the nss modules with the path that is compiled into the libc.
<mfp>
that sucks
<mrvn>
luckily the module interface doesn't change much.
<middayc_>
yess!!!! it works.. thanks a lot, really.. if this wouldn't work I would have to move the frontend to VPS installing apache/php there which would take me days and webapp is already running so changing dns stuff also wouldn't be that harmless
jeremiah has quit [Read error: 104 (Connection reset by peer)]
ikaros has quit [".quit"]
_zack has joined #ocaml
Dave_ has joined #ocaml
pierre- has joined #ocaml
<Dave_>
hi all
<Dave_>
i have a question...is there someone?
<middayc_>
15min ago there were some very helpfull folks here :) ..
<middayc_>
so if I were you I would just ask
jeremiah has joined #ocaml
<Dave_>
ok...im not sure that i have understand the use of list.fold_right
<Dave_>
so im asking if someone can easly explain to me how it works...
<middayc_>
I think fold_left works like reduce at some other langs and I assume fold_right does the same in reverse order?
<Dave_>
so fold_left how work?
<mrvn>
it applies the function to each element in turn while draging an accumulator arround.
<middayc_>
you give it a function that takes element of list + some accumolative value and produces a new accumolative value. besides this function fold_left accepts intial value
<middayc_>
and a list (I am speaking out of my head so I am not 100%)
<mrvn>
let rec fold_left f acc = function [] -> acc | x::xs -> fold_left f (f acc x) xs
|jedai| has quit [Read error: 60 (Operation timed out)]
<Dave_>
so apply the function to all element in list...and drag the accumulator until the end?
|jedai| has joined #ocaml
<mrvn>
yes
<middayc_>
you reduce list to some value that can be anything, like a string of joined elements of list is a simplest example, or a sum of numbers..
<mrvn>
or a list :)
<middayc_>
yes, or a list :)
<mrvn>
let sum = List.fold_left (+) 0
<Dave_>
fold_right start to apply function from last member so?
<mrvn>
fold_right is not tail recursive
<mrvn>
Might be better to reverse the list and fold_left instead.
<Dave_>
im forced to use fold_right...
<Dave_>
is this for an exam...
pierre- has quit [Read error: 110 (Connection timed out)]
<Dave_>
and if i pass a bool to accumulator?
<mrvn>
then you get a bool out of it
ppsmimou has quit [Remote closed the connection]
<mrvn>
let contains list x = List.fold_left (fun acc y -> if x = y then true else acc) false list
<mrvn>
as a stupid example.
<Dave_>
i think you have helped me a lot
<Dave_>
thanks
ppsmimou has joined #ocaml
_jedai_ has joined #ocaml
|jedai| has quit [Read error: 110 (Connection timed out)]
Dave_ has quit ["Ex-Chat"]
alexyk has joined #ocaml
_jedai_ has quit [Connection timed out]
|jedai| has joined #ocaml
<middayc_>
does a HOF exist that does something similar to fold but would in example above break out of "loop" and return true imediatelly as it get's it without foldint to the end of the list?
<mrvn>
middayc_: just write your own
<mrvn>
or raise an exception
<middayc_>
I wrote something I called "seek" when I was making JavaScript lib for this
<middayc_>
but js can return false or string for example, OCaml (thankfully) doesn't allow this probably, it must be of the same type .. that's why I didn't know ..
<middayc_>
well maybe as you said exception could be use somehow
<middayc_>
ok, thanks , I just asked because I saw this case upthere
<mrvn>
middayc_: type result = False | String of string
<mrvn>
if false is an exceptional return value then use an exception
<middayc_>
aha :) .. I forgot that OCaml has these composite types (and a lot of other things that I haven't come yet)
<mrvn>
middayc_: they are what makes ocaml so great
<mrvn>
Better than your own type would be a string option though I guess.
<mrvn>
None | Some "text"
<middayc_>
:) yes I believe you, and I did used it a little a while ago when I first time started playing with ocaml
<middayc_>
what kinds of apps are you making with ocaml mrvn?
<mrvn>
middayc_: currently a filesystem with fuse.
pierre- has joined #ocaml
alexyk has quit []
vixey has joined #ocaml
<middayc_>
wow, very interesting
rwmjones_ has joined #ocaml
middayc_ has quit ["Ex-Chat"]
pango has quit [Remote closed the connection]
pango has joined #ocaml
<steg>
does anybody know how i'd go about profiling native code when ocaml seems to inline the function calls i'm interested in ? :P
|jedai| has quit [Read error: 110 (Connection timed out)]
<steg>
basically, i have a bunch of very small functions, and I want to find out the percentage of execution time spend in them
|jedai| has joined #ocaml
<steg>
they're in a different module from the stuff that's calling them, but i didn't count on ocaml's cross-module inlining
<mrvn>
can ocamlopt do inlining across cmxo files?
<steg>
i don't know, but it certainly seems to do so with cmx files
<steg>
at least i can't find the functions i'm interested in in my profile output
<mfp>
mrvn: it won't inline across .cmxa, but will if the corresponding .cmx are installed
<steg>
-inline 0 doesn't have any effect
<steg>
i think that's because the functions are small enough that they fall under the inlining threshold even then
<mfp>
steg: placing those funcs into a .cmxa and *not* giving access to the .cmx while compiling should do it
<steg>
mfp: thanks, I'll give it a go
|jedai| has quit [Success]
|jedai| has joined #ocaml
Yoric[DT] has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
s4tan has quit []
jeremiah has joined #ocaml
zerny has quit [Read error: 110 (Connection timed out)]
jeremiah has quit [Read error: 104 (Connection reset by peer)]
_zack has quit ["Leaving."]
|jedai| has quit [Read error: 60 (Operation timed out)]
|jedai| has joined #ocaml
jeremiah has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
psnively has joined #ocaml
<psnively>
Hello everyone.
<Yoric[DT]>
hi
<psnively>
Hi, Yoric!
<Yoric[DT]>
How do you do?
alexyk has joined #ocaml
<psnively>
Doing well, thanks! Yourself?
<Yoric[DT]>
Fine.
<Yoric[DT]>
Working and Batteries and getting ready for the administrative ordeal of moving job.
<Yoric[DT]>
s/and/on/
<Yoric[DT]>
s/and Batteries/on Batteries/
<psnively>
Oh, wheeee. How's Batteries looking?
<Yoric[DT]>
Quite well.
<psnively>
Excellent!
<Yoric[DT]>
We're cutting a few features from Alpha 3 as noone seems interested in implementing them, but most of the meat is here.
<Yoric[DT]>
Hopefully, an Alpha 3 release should land early next week.
<psnively>
Sweet. GODI support?
<Yoric[DT]>
Right now, I'm working on improving launch-time of the toplevel.
<Yoric[DT]>
Well, of course :)
<psnively>
Good. I don't yet know how to add an external package to GODI, but I'll learn.
<psnively>
Meaning, I have GODI version X, I have package version X+N...
purple_ has joined #ocaml
<Yoric[DT]>
Do you mean adding it to your local installation?
<psnively>
Yes.
|jedai| has quit [Read error: 60 (Operation timed out)]
<Yoric[DT]>
No idea, I'm afraid.
<psnively>
Yeah, I'll figure it out.
<Yoric[DT]>
What about you, what are you doing these days?
|jedai| has joined #ocaml
<psnively>
$DAYJOB, reviewing "Beginning Scala" for Dave Pollak, adding PowerPC support to http://bitc-lang.org, porting Chicken Scheme to iPhone...
Nutssh has joined #ocaml
jeremiah has joined #ocaml
<Yoric[DT]>
Which one of these is $DAYJOB (if any)?
<psnively>
None... I just mean "Well, I have my day job, and..."
<Yoric[DT]>
ok
<psnively>
I'm trying, in 2009, to put a lot of effort into helping out projects I believe in, even if the association isn't ongoing.
<psnively>
Do you happen to know how to get GODI to rebuild everything after changing the section, e.g. going from 3.11 back to 3.10?
<Yoric[DT]>
No, sorry.
OChameau has quit [Read error: 113 (No route to host)]
<psnively>
No worries, thanks!
<kig>
Yoric[DT]: prelude.ml hostile takeover, what did you have in mind :) ?
<Yoric[DT]>
:)
<vixey>
prelude.ml could do with a lot of changes.............
<kig>
what would you change?
<vixey>
actually it all just makes me think of someone used haskell but they lost the compiler
<Yoric[DT]>
Actually, I have the feeling that a number of functions of Prelude.ml could fit in nicely within Batteries.
<psnively>
Did you see notfancy's stuff about playing with K and the definitions he'd like to see in OCaml?
<psnively>
"This goes to show that the Haskeller's smug remark that OCaml's standard prelude is rather poor is not really smug at all but painfully true."
<vixey>
blugh haskells prelude is _awful_
Camarade_Tux has joined #ocaml
<vixey>
and now ocaml is getting a ever worse one...
<kig>
vixey: that was pretty much the idea, then it snowballed into everything plus the kitchen sink
pixel__ has joined #ocaml
<Yoric[DT]>
psnively: thanks
* Yoric[DT]
is attempting to ignore vixey.
<kig>
vixey: again, what would you change?
<vixey>
every program I wrote in haskell starts with import qualified Prelude (which means don't import the prelude)
<psnively>
And this is different from Pervasives how?
<vixey>
kig, *** and &&& are really silly
<kig>
Yoric[DT]: you're free to grab the thing you like, it's BSD/MIT
<kig>
there's no *** or &&& in prelude.ml
<Yoric[DT]>
kig: I'd rather grab manpower :)
MichaelGG__ has quit [Read error: 110 (Connection timed out)]
|jedai| has quit [Read error: 60 (Operation timed out)]
|jedai| has joined #ocaml
MichaelGG__ has joined #ocaml
<kig>
Yoric[DT]: oh, well, what would you like me to do then?
<Yoric[DT]>
I don't have anything specific in mind for the moment.
<Yoric[DT]>
But if you have any idea of something you want to add to Batteries, please feel free to mention (and do :)) it.
<kig>
just "go forth and add random stuff to batteries! for victory!"
<kig>
oki
<Yoric[DT]>
Yep :)
love-pingoo has quit ["Connection reset by pear"]
itewsh has joined #ocaml
<kig>
i like the Batteries enum
* kig
git clones batteries
<Yoric[DT]>
Thanks.
<Yoric[DT]>
Actually initially part of Extlib.
jonafan has joined #ocaml
MichaelGG__ is now known as MichaelGG
<rwmjones>
_zack, ping
comglz has joined #ocaml
ygrek has joined #ocaml
MichaelGG has left #ocaml []
middayc has joined #ocaml
pierre- has quit [Read error: 110 (Connection timed out)]
<_zack>
rwmjones: EBUSY, I'm leaving in a few hours and busy packing, if it's urgent please drop me an email, otherwise ping me tomorrow
<rwmjones>
no problem
|jedai| has quit [Read error: 60 (Operation timed out)]
|jedai| has joined #ocaml
zerny has joined #ocaml
psnively has quit []
mattam has quit [kornbluth.freenode.net irc.freenode.net]
mattam has joined #ocaml
dkremer has joined #ocaml
<dkremer>
Hello. Since Ocaml is a french language, I would ask some question about it.
<dkremer>
But maybe it's better to speak in french ? Say me if you want.
<dkremer>
So, I'm interesting with Ocaml programming.
<dkremer>
I got a paper from Jocelyne Sérot.
<dkremer>
It's about graphe and algo in Ocaml. So, theoritical applications seems very interesting to program with Ocaml.
<Yoric[DT]>
dkremer: If you wish to speak in French, #ocaml-fr is waiting for you.
<dkremer>
Yoric[DT]: Maybe my english is not so wrong.
<Yoric[DT]>
As you wish :)
<Yoric[DT]>
Other than that, I can't find any Jocelyne Sérot on Google.
pierre- has joined #ocaml
<dkremer>
it's the first response on my google request.
<Yoric[DT]>
Well, there's one less letter in that first name than in the one you wrote a few lines ago :)
<dkremer>
:| I apologize for my stupidity.
<jonafan>
haha
<dkremer>
It's a french woman, I thought the first name will be written with french typo.
<Yoric[DT]>
Anyway, what was your question?
<Yoric[DT]>
(we're usually not nasty around here, sorry for the bad start)
_zack has left #ocaml []
<dkremer>
No. It's just that we should agree about what we talk.
<dkremer>
thank you to take some time to discuss with me.
<dkremer>
:)
<dkremer>
I asked about th epossibility to write « real » programs in Ocaml/
fschwidom has quit [Connection timed out]
<Yoric[DT]>
Well, that's definitely possible.
<jonafan>
at least two people have done it
<Yoric[DT]>
OCaml is not suited to every task but it's suited to many.
<jonafan>
unison and mldonkey
<Yoric[DT]>
Well, plenty of people use OCaml for real programs.
<Yoric[DT]>
Few people use OCaml for desktop applications, but there's a big difference there.
<Yoric[DT]>
I know of plenty of very real non-desktop programs.
<jonafan>
yeah
<dkremer>
In fact, I started to program in Basic. After that, I used C, then Python. So the functionnal way is not very natural.
<jonafan>
it's excellent for noninteractive software and frankly it seems to be quite suited to desktop programs as well
<dkremer>
Do you think that write a program with a functionnal style could give a better design ?
<Yoric[DT]>
For many (not all) programs, yes.
<jonafan>
well, for interactive gui, classes seem to be very useful
|jedai| has quit [Connection timed out]
|jedai| has joined #ocaml
<dkremer>
Yes, classes could respond to any waiting to write complex applications, as interactive GUI.
* Camarade_Tux
is currently making a browser :)
<jonafan>
but a functional style works very well for non interactive components
<jonafan>
ocaml is great because it does both paradigms quite well
<Yoric[DT]>
Actually, functions and closures are typically better than classes for callbacks.
<dkremer>
Is it not possible to use classes with functions ?
<Yoric[DT]>
I'd say the visual aspect of the GUI is better rendered with classes but the interactive part is nicer with functions.
<Yoric[DT]>
dkremer: it is.
<Yoric[DT]>
It is possible, that is.
<Yoric[DT]>
It's not OCaml 101, though.
<Yoric[DT]>
Classes are quite strongly typed in OCaml, so you may not find all the shortcuts you're used to in Python.
<jonafan>
in other news, i just wrote my first functor last night
<Yoric[DT]>
jonafan: congratulations :)
<jonafan>
until this point, i didn't see how they were useful
<jonafan>
my functor is a WriterMonad
<jonafan>
the module argument to the functor is a Monoid module (a module with an empty value and an append function)
<Yoric[DT]>
So the next step is a monad tutorial :)
<jonafan>
haha
<jonafan>
i haven't really found any monad tutorials very helpful
<Yoric[DT]>
I got monads from one of the founding papers of the subject.
* Yoric[DT]
can't remember the name of the paper, though.
<Yoric[DT]>
dkremer: well, in any case, if you have other questions, we're here to help.
pik has joined #ocaml
pik has left #ocaml []
_zack has joined #ocaml
|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
_zack has quit [Client Quit]
seafood has joined #ocaml
* Yoric[DT]
is getting to like Batteries' Enum quite much.
<Yoric[DT]>
Which is good considering I'm the one who put it there :)
<Yoric[DT]>
This year, I'm going to try and teach a number of things with Batteries, using Enum instead of lists.
|jedai| has quit [Connection timed out]
|jedai| has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
<Camarade_Tux>
the thing objects have over simple records (beside not needing to prefix the method id with the module name) is you can have the same method name for several objects
<Camarade_Tux>
(following a yesterday's comment)
<Yoric[DT]>
True.
<dkremer>
I have another question.
<dkremer>
In Ocaml , you are speaking about very lot of complex things, like monads, functors, comonads, and so...
<dkremer>
Do this things need a high level in mathematics to be used, or just pratice could be make it useful ?
<Yoric[DT]>
Well, monads are optional in OCaml.
<Yoric[DT]>
I haven't seen any CoMonad in OCaml yet.
<Yoric[DT]>
And what little you need of functors is quite easy to learn and requires no mathematics.
<Yoric[DT]>
(even monads don't require much in the way of math)
<Yoric[DT]>
(if anything)
<Yoric[DT]>
They do require something in the way of "thinking in functional programming", though.
<dkremer>
Yes, I think.
* Camarade_Tux
is quite ashamed but he never _really_ used any of these =/
<dkremer>
Just reading some net examples and try to have it in mind.
<dkremer>
Camarade_Tux: I guess it's like mathematics, a bit :)
<dkremer>
You don't need it before you learn it, but after you use it every time.
<dkremer>
Just like count, or reading :) After learn to read, you are always reading :)
|jedai| has quit [Connection timed out]
<dkremer>
Camarade_Tux: You maybe use it and you don't know it.
<Camarade_Tux>
yes, but partly : I currently use gtk (and sdl) and I'd mary whoever could give me a functionnal interface to it ;)
* Yoric[DT]
will pass :)
|jedai| has joined #ocaml
<Yoric[DT]>
Although it would be nice to have a functional interface to either.
fschwidom has joined #ocaml
<Camarade_Tux>
has anybody taken a look at React ?
* Camarade_Tux
has to ask for some screenshots
fschwidom has quit [Remote closed the connection]
jeremiah has joined #ocaml
<Yoric[DT]>
Camarade_Tux: I'm planning to.
jeremiah has quit [Read error: 104 (Connection reset by peer)]
dkremer has left #ocaml []
sporkmonger has quit [Read error: 110 (Connection timed out)]
jeremiah has joined #ocaml
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
Camarade_Tux has quit ["sl33p"]
sporkmonger has joined #ocaml
comglz has quit [Read error: 110 (Connection timed out)]
ched has quit [Remote closed the connection]
ygrek has quit [Remote closed the connection]
|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
<kig>
is there a way to do this? type 'a poly = Int of int 'a | Float of float 'a | Char of char 'a
<kig>
or do i need separate types for lists and arrays
<vixey>
m I wish I understood what that meant
<vixey>
why do you have this 'a ?
<jonafan>
yeah take out the 'as
<vixey>
well I was guessing 'a was crucial somehow... that I didn't know how
<jonafan>
that is for something where the type will be given later
<steg>
i think he might be trying to get a type that means "the type of all polymorphic 'a types"
<Yoric[DT]>
Well, time to call this a night.
<Yoric[DT]>
Cheers.
Yoric[DT] has quit ["Ex-Chat"]
<steg>
that's what i gather from the "need seperate types for lists and arrays"
<steg>
so Int of int 'a would mean Int of int array or Int of int list
<kig>
yes
<steg>
kig: it's not possible to do this
<kig>
ok
<steg>
kig: the way that sort of polymorphism works is based on the structure of the datatype... for instance i can have an 'a list, and i can always treat it as a list without necessarily caring about what it's a list of... the structure will always be a list
<steg>
that doesn't hold in the case you're going for
<steg>
i think :P
<vixey>
oh so the 'a is a type constructor
<vixey>
like * -> * (I guess ocaml doesn't have this notation?)
jonasb has joined #ocaml
slash_ has joined #ocaml
_jedai_ has joined #ocaml
|jedai| has quit [Read error: 110 (Connection timed out)]
comglz has joined #ocaml
zerny has quit [Remote closed the connection]
_jedai_ has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
jonasb_ has joined #ocaml
vixey has quit [Remote closed the connection]
jonasb__ has joined #ocaml
Nutssh has quit [Read error: 104 (Connection reset by peer)]
love-pingoo has joined #ocaml
marmotine has quit ["mv marmotine Laurie"]
Amorphous has quit [Read error: 145 (Connection timed out)]
jonasb has quit [Read error: 110 (Connection timed out)]
jonasb__ is now known as jonasb
jonasb_ has quit [Read error: 110 (Connection timed out)]
slash_ has quit [Client Quit]
Amorphous has joined #ocaml
thelema has quit [Read error: 54 (Connection reset by peer)]
|jedai| has quit [Read error: 110 (Connection timed out)]