systems changed the topic of #ocaml to: Archive of Caml Weekly News http://pauillac.inria.fr/~aschmitt/cwn/ | ICFP Programming Contest 2003 http://www.dtek.chalmers.se/groups/icfpcontest/ | A tutorial http://merjis.com/richj/computers/ocaml/tutorial/ | Good free book http://cristal.inria.fr/~remy/cours/appsem/ | Mailing list (best mailing list ever for any computer language) http://caml.inria.fr/bin/wilma/caml-list
<jdrake> yet anoter compiler compiler?
vect-ircml has joined #ocaml
<vect-ircml> uh
<Riastradh> Uh?
<Smerdyakov> jdrake, yes
vect-ircml has quit ["patching ircml ..."]
roxor has joined #ocaml
roxor has quit [Client Quit]
<Smerdyakov> Does anyone have any tips on figuring out why an ocamlyacc parser isn't parsing something you think it should?
<Riastradh> RTFSC.
<Smerdyakov> What?
<Riastradh> Read The Fine Source Code.
<Smerdyakov> The source code of what?
<Riastradh> ocamlyacc
<Smerdyakov> F U!!!!!!!!
brwill_gym is now known as brwill
mrvn_ has joined #ocaml
mrvn has quit [Read error: 110 (Connection timed out)]
jdmarshall has joined #ocaml
buggs is now known as buggs|afk
lus|wazze has quit [Read error: 110 (Connection timed out)]
polin8 has quit [Read error: 104 (Connection reset by peer)]
jdmarshall has quit ["ChatZilla 0.8.31 [Mozilla rv:1.4/20030624]"]
jdrake is now known as RIAA_POLICE
RIAA_POLICE has quit ["Oops. This machine just fell asleep"]
brwill is now known as brwill_zzz
two-face has joined #ocaml
<two-face> glop
buggs|afk is now known as buggs
<mellum> Hmm, suppose I have a 'a list, and I want to call f with all pairs of a b from the list. What would be a clever way to do that?
<mellum> Looks like two List.iters will do
wax has quit []
det has joined #ocaml
Kinners has joined #ocaml
<smkl> mellum: let (>>=) f g = List.flatten (List.map g f);; let lift2 f x y = x >>= fun x -> y >>= fun y -> [f x y];; let pairs x = lift2 (fun x y -> (x,y)) x x;;
two-face has quit ["Client exiting"]
polin8 has joined #ocaml
polin8 has quit [Client Quit]
systems has joined #ocaml
systems has left #ocaml []
<mellum> smkl: Wow, that looks a lot cooler. But not exactly more readable.
<smkl> it's pretty simple if you understand monads
<mellum> But I don't. And currently, I'm more interested in getting someting else done first :)
Kinners has left #ocaml []
two-face has joined #ocaml
<two-face> bck
two-face has quit [Read error: 110 (Connection timed out)]
two-face has joined #ocaml
croesus has joined #ocaml
det has quit ["*poof*"]
systems has joined #ocaml
systems has quit [Read error: 110 (Connection timed out)]
brwill_zzz is now known as brwill
brwill is now known as brwill_zzz
<Maddas> Array.iter is only useful for sideeffects, isn't it?
polin8_ has joined #ocaml
polin8_ has quit [Client Quit]
<mellum> Maddas: arrays themselves even are nearly only useful for sideeffects :)
<two-face> not only
<mellum> That's why I said nearly
<two-face> you can get direct access to items
<mellum> But having only constant arrays is
<mellum> kinda boring
<mellum> and sun keyboards with enter right next to backspace suck
two-face has quit ["Client exiting"]
<Maddas> Hm, ok, I should formulate it differently. You can't modify the array you're iterating on with Array.iter, can you?
<Maddas> (I forgot that even if you could, modifying it is a side-effect)
<Maddas> Heh, why is this so: let a b = match 'a' with b -> true | _ -> false;;
<Maddas> the function a has the signature 'a -> bool = <fun>
<Maddas> while I would expect char -> bool = <fun>
<Maddas> It always returns true. Why does it return true if you match a character against anything?
<Maddas> or rather, why does that match always succeed
<Maddas> I would have thought that it does the same as let a b = match b with 'a' -> true | _ -> false;; although that only seems to do what I thought
<Maddas> this is the function where I encountered this: http://tnx.nl/scribble/1350HTOA
<Maddas> isin ar a should take an array a and a scalar a and check whether the array contains a, but the "match h with a" always succeeds.
<Maddas> I know that I should probably write it as "if h = a then" instead, but I wonder why this doesn't do what I thought
lam has quit ["Lost terminal"]
CSharpener has joined #ocaml
lam has joined #ocaml
<mellum> Maddas: You can't pattern match array. Your function only takes lists.
<Maddas> Duh
<Maddas> Sorry :)
<Maddas> actually, I am pattern matching a list
<Maddas> (I tend to forget to differentiate between those two)
<mellum> The a match doesn't compare to the known a, but just binds any match to a new a. You should just use an if instead of a matching.
<Maddas> oh, duh. Thanks
mellum has quit [Remote closed the connection]
systems has joined #ocaml
CSharpener has left #ocaml []
systems has quit [Read error: 110 (Connection timed out)]
buggs is now known as buggs|afk
jdrake has joined #ocaml
Xcalibor has joined #ocaml
<Xcalibor> hello
<Riastradh> Hi.
<Xcalibor> what's up?
Xcalibor has quit [Remote closed the connection]
Xcalibor has joined #ocaml
clam has joined #ocaml
teratorn has quit [Connection timed out]
croesus has left #ocaml []
polin8 has joined #ocaml
clam has quit ["no reason"]
__buggs has joined #ocaml
<Xcalibor> laters"
Xcalibor has quit ["Terminando cliente"]
buggs|afk has quit [Read error: 110 (Connection timed out)]
polin8_ has joined #ocaml