ser_ has quit [Read error: 113 (No route to host)]
seafood_ has joined #ocaml
mrsolo has quit [zelazny.freenode.net irc.freenode.net]
c has quit [zelazny.freenode.net irc.freenode.net]
seafood has quit [zelazny.freenode.net irc.freenode.net]
mrsolo has joined #ocaml
c has joined #ocaml
seafood has joined #ocaml
seafood__ has joined #ocaml
seafood has quit [Connection reset by peer]
cybercobra has joined #ocaml
<cybercobra>
best OCaml book?
bluestorm_ has quit ["Konversation terminated!"]
mrsolo has quit ["This computer has gone to sleep"]
mrsolo has joined #ocaml
<cybercobra>
best book on OCaml?
piggybox__ has joined #ocaml
pants1 has joined #ocaml
pants1 has quit [Read error: 104 (Connection reset by peer)]
TaXules has quit [Read error: 110 (Connection timed out)]
ser__ has quit [Read error: 113 (No route to host)]
ser_ has joined #ocaml
TaXules has joined #ocaml
ser_ has quit [Read error: 104 (Connection reset by peer)]
ser_ has joined #ocaml
ser_ has quit [Read error: 104 (Connection reset by peer)]
ser_ has joined #ocaml
RobertFischer has joined #ocaml
smimou has quit ["bli"]
yminsky has joined #ocaml
yminsky has quit [Client Quit]
ser_ has quit [Read error: 110 (Connection timed out)]
<cybercobra>
best book on OCaml?
<c>
ocaml for unscientific experts
<c>
coming from blagmatic and sons, next year
<c>
no, donno. theres one from didier remy ~ 2000. one efrom justin hinckle @ berkeley/caltech/something. and english/french versions of some sort of abandoned oreily book. then therse ocaml for scientists which proably kicks ass but im not about to blow 200 USD on
<c>
jason hickey rather
<c>
it hink i'll get don syme's expert F# and just figure out the diff between that and ocaml later
ulfdoz has quit [Read error: 60 (Operation timed out)]
<cybercobra>
c: there's also Practical Ocaml
<c>
i didnt mention that one for a reason
<c>
check the amazon reviews
<c>
or blog posts
<RobertFischer>
Yeah, Practical OCaml is teh sux.
<c>
this FrGui doc mentions like.. canvas classes. anything mature enough to use?
* c
digs around in avarious svn checkouts to figure out what its talking about
<cybercobra>
odd that they published Foundations of F# so close to Expert F#
<c>
Functional Programming Using Standard Ml from 1988 (Wikstrom) looks nice
<c>
out of print tho
<c>
wel
<c>
theres a milion C# books
<c>
anything microsoft pushes gets that
<Smerdyakov>
You don't want a Standard ML book from 1988.
<c>
wy not?
<Smerdyakov>
Because the language definition has been revised since then.
<c>
ok
<c>
id like a book that gets deep into type systems, and explains polymorphic variants vs all that 'lifting' crap in hasekll which is way over my head, ec
<c>
eg all the stuff thats _different_ between ml-flavor implementations/variations
<jonathanv>
let TypeConstructor(values, you, want) = instanceoftype in (*will give you warnings*)
ygrek has joined #ocaml
<The_Maru>
I think I will use functions
<jonathanv>
probably a better idea
vpalle has joined #ocaml
<The_Maru>
so how would i write the 'header' of a function that would get the first int out of a type transition = int * char option * int
<The_Maru>
the stuff to the left of the equals I mean
<bluestorm_>
let header (init, _, _) = init ?
<bluestorm_>
but hm
<bluestorm_>
do you really think
<bluestorm_>
let (init, _, _) = my_trans in ...
<bluestorm_>
is *that* tedious ?
<The_Maru>
i think match is tedious
<bluestorm_>
if it's only a tuple-alias
<bluestorm_>
(not a multi-constructors type)
<bluestorm_>
you can use pattern matching inside "let" declarations
<bluestorm_>
(let actually use pattern matching, but it has to be exhaustive, otherwise you're in trouble)
<The_Maru>
but that code lets you refer to init?
<The_Maru>
it looks like it's creating the reference to my_trnas
<bluestorm_>
hm
<bluestorm_>
that would be let my_trans = ...
<bluestorm_>
let binds on the left side
<The_Maru>
oh
<The_Maru>
rihgt.
<bluestorm_>
have you ever seen "let () = ..." code ?
<bluestorm_>
that's a pattern matching too
<The_Maru>
ahhhh
<bluestorm_>
(the match is safe because unit has one value, () )
<The_Maru>
I see what you're saying
<The_Maru>
what's the point of that unit code?
<The_Maru>
changing what () refers to?
<bluestorm_>
you can't
<bluestorm_>
the value on the right side has to be ()
<bluestorm_>
(after evaluation)
<The_Maru>
ah
<bluestorm_>
let () = foo in bar is the same as foo; bar
<The_Maru>
i thought people just did side_effect; whatever
<bluestorm_>
but at the toplevel it is sometimes used to say "here is my 'main' "
<bluestorm_>
(as OCaml does not use 'main' and evaluate the whole file, it may be useful to say "the interaction start in the let () = ... part")
<bluestorm_>
anyway
<bluestorm_>
to exatract values from an 'a * 'b tuple "tup"
<bluestorm_>
you can use let (a, b) = tup in ...
<The_Maru>
yeah
<The_Maru>
this is good
<bluestorm_>
(let a, b = ... is allowed too)
<bluestorm_>
let foo = bar in foobaz is mostly equivalent to match bar with foo -> foobaz
<bluestorm_>
(mostly)
<The_Maru>
other than what happens if it doesn't match, you mean
<The_Maru>
?
<bluestorm_>
hm
<bluestorm_>
if the match is partial
<bluestorm_>
both codes will raise a warning
<bluestorm_>
(of course you can still add an | _ -> ... clause after the match, wich you cannot with the let)
<The_Maru>
oh
<flux>
I wish let didn't cause that warning.. but apparently wishing on #ocaml isn't enough to make that happen :)
<bluestorm_>
but there are some semantical subtleties around "let"
<bluestorm_>
flux:
<bluestorm_>
for 2 days now i'm trying to motivate myself into creating a "refutable" syntax-extension for let
<bluestorm_>
let refutable (hd::tl) = ...
romanoffi has joined #ocaml
ygrek has quit [Remote closed the connection]
<bluestorm_>
flux: but the general wisdom seems to wish that warning
<bluestorm_>
revised syntax is even more warningish, as they enforce the irrefutability of the pattern
<flux>
I don't see why warning is worse than sprinkling code with the more cumbersome match-syntax, with value-added bonus of | _ -> failwith "don't do that"
asmanur_ has joined #ocaml
<bluestorm_>
i usually use let and keep the warning going ^^
<flux>
which is bad too, because you might miss real warnings.. getting numb.
filp has joined #ocaml
<pango_>
I'm using match
<zbrown>
So why exactly does something like "1 *. 2.0;;" upset the ocaml interpreter, but if I do something like: http://www.nonlogic.org/dump/text/1194380061.html it doesn't get upset even though there's an int as an argument and an int being used for arithmetic?
<flux>
only operation to int you do there is subtract it by one
<flux>
(well, and compare it to zero)
<flux>
otherwise your operations are between floats
<zbrown>
ah hmmm
<zbrown>
I guess thats true
<zbrown>
# let test = 1.0 *. 2.0;;
<zbrown>
val test : float = 2.
<zbrown>
^^ what about that?
<zbrown>
why doesn't that upset it?
<zbrown>
err hmm
<flux>
why should it?
<zbrown>
ah nm
<flux>
:)
<zbrown>
I thought i typed only "1" instead of "1.0"
<zbrown>
flux: thank you :)
<flux>
happy to help
<zbrown>
bah getting antsy, google interview in 40 minutes :-|
<flux>
great way to relax, by learning a new language?
<flux>
or did you list ocaml in the list of languages you're deeply familiar with :)
<flux>
(just kidding)
<zbrown>
flux: lol, nah I'm just trying to get the problem solving part of my brain working a bit so I'm ready for the barrage of questions over the phone
* \\
thinks googles strategy is jsut hire people to keep them from potentialy working at cmopetitors
<\\>
they proably need like 10 ppl to keep the search/ad servers running otherwise
<zbrown>
\\: you'd be right
<vorago>
They are more than search/ad I guess.
<zbrown>
they have security like 1984... everything is recorded on the network and on the computers, there's video cameras
<zbrown>
but they do give you free meals, free clothes, free oil change, free tire rotation, free dry cleaning...
<zbrown>
so go figure ;)
<zbrown>
Perfect lifestyle for a college kid fresh out of college
<zbrown>
(though I'm applying for an internship)
<\\>
yeah its tempting. starving is just more fun i guess. keeps me on my toes
<flux>
bluestorm_, have you tried it out with actual code, does it make it more pretty?-)
<bluestorm_>
you can use "let refutable .. = .. in" everywhere you would have a warning
<bluestorm_>
i have encountered such situations before
<bluestorm_>
but there are some problems with that extension
loufoque has joined #ocaml
<bluestorm_>
does not handle top-level let (of could i meaningfully extend them to a match with ?), does not handle recursion, and does not handle partial parameters matching in a function declaration
<loufoque>
what is the complexity of Set.Make(T).split?
<bluestorm_>
let refutable hd (head::tail) = head won't work
<loufoque>
it would be nice if complexity was documented
screwt8 has quit [Remote closed the connection]
<flux>
loufoque, I definitely agree
<flux>
I think it's O(log n)
<bluestorm_>
dinner time anyway :p
<flux>
I actually benchmarked it once
<flux>
to make sure it wasn't O(n log n) or something
<flux>
(I think I also looked at the source after that, but I'm not sure :))
<loufoque>
flux: so it's smart enough to not copy the data somehow?
<flux>
loufoque, yeah, trees can be funny that way :)
<flux>
I'm not sure what kind of balancing needs to be done, if any, when such a split is performed
<flux>
I miss that feature from Map; I've ended up using both a Set and a Map in those cases
ygrek has joined #ocaml
<flux>
(perhaps ocaml-reinds will do better, although it doesn't seem like it has the split-function at all)
<flux>
((perhaps, once again, #ocaml/freenode isn't the most efficient forum for wishlists..))
<loufoque>
what's ocaml-reinds?
<flux>
ocaml-reins, it's a data structure library for ocaml
<RobertFischer>
I didn't realize that reins existed.
<RobertFischer>
Although it's got a slightly different approach, both in terms of target functionality and development style.
<flux>
interesting, I hadn't heard about that
<flux>
is the subversion repository up-to-date? with 16 revisions there I'm thinking ocaml-reins is much more feature-complete..
<RobertFischer>
The SVN isn't up-to-date, and there isn't a whole lot of work ready to go yet.
<RobertFischer>
Reins is a data structure library, whereas Adlib is a functionality library: monads, streams, etc.
<RobertFischer>
It'd be nice for the two libraries to work well together.
<flux>
I guess you've taken a look at ocamlnet?
<RobertFischer>
Yeah, but that's got a different focus, too.
<flux>
how about their io-layer? they actually have a documentation describing how to interoperate with their (object-oriented) interfaces.. although I'm not quite sure their interface fits all situations.
<RobertFischer>
No, I haven't really taken a close look at their I/O layer.
<RobertFischer>
I'll do that.
<RobertFischer>
The last thing Ocaml needs is people re-inventing the wheel.
<RobertFischer>
There's lots of new ground to cover.
<flux>
unfortunately writing code that can be interface with each other is not that easy, especially when the development is distributed
<loufoque>
I've been struggling with gtk+ for some moment, maybe someone knows
<loufoque>
how do I put a GDraw.drawable inside a window?
<flux>
sorry, I don't really remember anymore how that stuff is done with gtk (not that I ever knew very much)
<flux>
can't you get a widget out of that and just .add it or something, it to the container of the window?
<RobertFischer>
(I know nothing about GTK+) Yeah, but I'm hoping that Ocaml's type system will make that a bit easier. The biggest problem with sharing libraries in Java, for instance, is the lack of common interfaces.
<flux>
(which is a one-slot container)
<loufoque>
the problem is that I need a window to create a GDraw.drawable
<loufoque>
and I can't add a window into another window it seems
<flux>
loufoque, pass it the window you're trying to put it on?
<loufoque>
flux: well, if I do that it means I'm going to draw on the window, so I can't have any other widget in it
<flux>
loufoque, ok. have you taken a look at drawingarea?
<flux>
(perhaps it was called so..)
<loufoque>
flux: it's undocumented unfortunately
<loufoque>
(well, like most stuff)
<bluestorm_>
hm RobertFischer
<bluestorm_>
adlib seems really interesting to me, thanks
ygrek has quit [Remote closed the connection]
<flux>
loufoque, you could refer to gtk+ documentation instead of just lablgtk's
<flux>
I've got a piece of code I've written a couple years back that uses drawing area
<flux>
I could put it online if you want. it is not made of "example material", though :)
<RobertFischer>
Adlib will be pretty cool, but Brian and I need to actually finish banging out code.
<RobertFischer>
He's doing a better job of that than I am, because I've got a full-time gig and a part-time gig at the same time right now.
<RobertFischer>
But I'll be dedicating some serious time to it in two weeks.
asmanur_ has quit [Read error: 104 (Connection reset by peer)]
ygrek has joined #ocaml
Tetsuo has quit [Remote closed the connection]
drewism has joined #ocaml
ygrek has quit ["Leaving"]
Jedai has quit [Connection reset by peer]
Jedai has joined #ocaml
drewism has quit []
guyzmo_ has joined #ocaml
<mbishop>
http://pastebin.com/m4c3cb191 How could I add pipes to that? I'd have to check for "|", but then I'd have to iterate over every character, or is there an easier way?
<loufoque>
doesn't ocaml provide extandable arrays?
<loufoque>
something like Buffer but that can contain anything
<rwmjones>
loufoque, extlib provides something called a VarArray
<rwmjones>
apart from that, most people use lists
<loufoque>
I need random access
<loufoque>
List.nth should be O(n)
<loufoque>
unless it does some kind of indexing?
Abo-Marwan has joined #ocaml
Abo-Marwan has quit [Remote closed the connection]
<b4taylor>
I don't suppose someone would be as kind as to point me to a page which tells me how to make system/posix calls, or can give me a one liner for say "ls" that would do the same?