<debona|r>
I replaced the filename at the end with Sys.argv.(1);;
<debona|r>
are there better ways of doing this?
<monotonom>
I think it is just fine.
<debona|r>
I think ocaml is going to be like vi... it sucks to learn it, but once you've done it, it rocks
<mrsolo>
actualy ocaml is a joy to learn
<debona|r>
what's this underscore I see so often?
<debona|r>
let _ = ...
<Riastradh>
It means 'ignore the value produced.'
<monotonom>
I means "whatever"
<monotonom>
s/I/It/
<debona|r>
well, it's fun to learn because it's new
<lambdawar>
are there benchmarks with equivalent C code when ocaml lazy evaluation is used ?
<debona|r>
but it's hard to get my head around it ... atleast right now
<mrsolo>
but after you learn ocaml, you feel kinda sad
<debona|r>
because I wasted many years not knowing it?
<mrsolo>
no
<debona|r>
then?
<mrsolo>
because you can't doing anything with it,
<Riastradh>
Because you're going to have to deal with other crap like C.
<mrsolo>
unless you are going to write everything from scratch
<mrsolo>
there aren't enough libraries
<lambdawar>
because you still need to learn haskell once you know it
<debona|r>
why do I need to learn haskell?
<Riastradh>
mrsolo, how do you think Zope came into existence? It wasn't magic; people wrote it from scratch.
<debona|r>
well, let's write libraries then
<mrsolo>
Riastradh: of course, it is always chicken and egg
<mrsolo>
and my case, chicken, egg and deadline
<Riastradh>
The problem is that the sort of programmers who don't understand functional programming are the sort of people who don't mind the menial & tedious work of drudgerous library writing.
<Riastradh>
Whereas the people who tend to understand functional programming tend to be uninterested in writing libraries.
<mrsolo>
i can't pull application server out of my ass in two weeks :-)
<Riastradh>
Writing basic libraries, that is.
<debona|r>
interesting point Riastradh
<debona|r>
you say it's that efficient, eh?
<mrsolo>
but ocaml is a joy to work with
<debona|r>
I ended up having to read the ocaml book to find the file opening stuff
<debona|r>
I was looking in the manual too
<lambdawar>
debona|r: because it provides a deeper theorical playground ?
<lambdawar>
(haskell, sorry for the delay)
<debona|r>
oh, haha
<debona|r>
I was wondering
<debona|r>
are you saying it's worth learning, or I have to learn it?
<lambdawar>
it's worth learning, more precisely the concepts are worth beeing studied
<mrsolo>
yes
<mrsolo>
afterward you will gain understanding on why pure functoinal can't solve everything
<mrsolo>
go move back to ocaml instead :-)
<lambdawar>
what kind of stuff are you referring to mrsolo
<lambdawar>
omega ?
<mrsolo>
actually on problem domain
<mrsolo>
on problem that deals with lots of states
<lambdawar>
NP hard problems you mean ?
<mrsolo>
monads solve that elegantly but on those, implicit or ood are really simple
<mrsolo>
naw, typical i/o issues
<lambdawar>
what about continuation based I/O
<monotonom>
I prefer moand to continuation
<lambdawar>
Ive seen both working but I dont know enough of the theory to judge which is better
<Riastradh>
CPS computations are a subset of monads.
<debona|r>
uh
<debona|r>
are you all CS majors again?
<mrsolo>
yea
<Riastradh>
debona|r, monads really aren't as scary as they sound.
<monotonom>
I was a math major!
<mrsolo>
but don't count that against me!
<mrsolo>
:-)
<mrsolo>
debonar: monads are nice.. they arent really that difficult
<mrsolo>
no more difficult than say study of object patterns
<debona|r>
Riastradh: it wasn't monads per say ... it was all the terms I didn't know in the last 10 lines you guys had typed... "NP hard problems, monads, omega, continuation based, and CPS computations"
<mrsolo>
different vocabuary in different programing domain thats all
<Riastradh>
They're just generalizations of computation. You can construct a simple computation that produces a single value, and you can extend a monadic computation with a function that, when the monadic computation is run, will pass the current value in the computation to the function. -- In simple terms, those are the two most common operators.
<mrsolo>
in other world, monads maps very closely to command object
<debona|r>
command object... is that one of the patterns then?
<mrsolo>
debnar: lot of those are associated with functional programming
<monotonom>
I'll throw in homeomorphism :)
<mrsolo>
command + composite
<debona|r>
erk :P
<mrsolo>
debonar: yea
<debona|r>
earlier today mentioned the troublesome diamond
<debona|r>
that one I could cope with :)
<monotonom>
Yeah but could you eat pushouts for breakfast :D
<Riastradh>
I prefer endofunctorial catamorphisms for breakfast.
* debona|r
has read about 1/4th of the design patterns book
* debona|r
faints
* Riastradh
reanamorphises debona|r.
<lambdawar>
google cant find endofunctorial catamorphisms
<lambdawar>
;)
<monotonom>
Ah. You need to know all of the design pattern book before you prefer functional programming (pure or impure).
<Riastradh>
That's because I just glued two arcane-sounding category theoretical terms together in a way that doesn't make much sense.
<lambdawar>
we pardon you for this time, but dont fill lambdabot database with bullshit, else we are in troubles ;)
<monotonom>
I'll give three examples.
<Riastradh>
Exofunctorial catamorphisms and endofunctorial hylomorphisms would make more sense.
<debona|r>
lambdawar: add it in wikipedia then
<debona|r>
are there even such terms?
<monotonom>
Composite: "Umm, so you mean instead of 'type tree = leaf of int | node of tree*tree' I have to write three bloody classes complete with get/set methods?"
<lambdawar>
we could say its the algebraic complement of the intersection btween Exofunctorial catamorphisms and endofunctorial hylomorphisms, that would sound really cool
<lambdawar>
and sign Riastradh
<lambdawar>
of the #ocaml irc.debian.org channel
<lambdawar>
;)
<Riastradh>
debona|r, oh, yes, there are exofunctors, endofunctors, anamorphisms, hylomorphisms, and catamorphisms.
<monotonom>
Command: "Why the bloody hell can I not write an anonymous closure? Even Perl let me do that."
<mrsolo>
yep
<Riastradh>
List.fold_{left,right} are catamorphisms; List.map is a hylomorphism; List.unfold, if there is one, is an anamorphism.
<debona|r>
Riastradh: tell me you're doing CS too then?
<monotonom>
Interpreter: "Hello? Ever heard of catamorphisms? I mean fold?"
<mrsolo>
yep
<Riastradh>
debona|r, well, if you command me to tell you that I am, then I suppose it would be best for me to answer that I am...
<debona|r>
:P
<debona|r>
I've had enough. going to watch tv.
<monotonom>
OOP = Object Obfuscation Pomposity.
* Riastradh
wanders off to bed in a TVless house.
* monotonom
watches IRC
<debona|r>
well, to be precise, I shouldn't say tv, but dvd
<debona|r>
er
<debona|r>
<- tired
<monotonom>
Yeah I watch DVDs all the time. CDs too.
<Riastradh>
tired -> bed, duh.
<debona|r>
shush
<debona|r>
I said I was tired :P
* monotonom
takes out a CD, spins in under light, and sings what he sees.
<debona|r>
bastards
<debona|r>
well, I was going to try to write an email client
<debona|r>
but maybe I'll just start off with something a bit more lowscale
<Riastradh>
Unless you find that your keyboard makes a good pillow, but in my past experience it tends to be particularly uncomfortable, especially for your Emacs buffer or for the other people in the IRC channel.