<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