leo037 has quit ["il y a un biais statistique sur le matching d'Ulteem"]
malc_ has quit ["leaving"]
thesoko has joined #ocaml
rhz has left #ocaml []
TFK has quit ["Leaving"]
Smerdyakov has quit ["Leaving"]
seafoodX has joined #ocaml
joshcryer has quit [Read error: 104 (Connection reset by peer)]
joshcryer has joined #ocaml
pantsd has joined #ocaml
seafoodX has quit []
seafoodX has joined #ocaml
seafoodX is now known as Talking
Talking is now known as seafood
seafood is now known as seafoodX
seafood has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
shawn has quit [Read error: 110 (Connection timed out)]
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
ygrek has joined #ocaml
kelaouchi has quit [Connection reset by peer]
kelaouchi has joined #ocaml
Mr_Awesome has quit ["time to impregnate a moth"]
_JusSx_ has joined #ocaml
descender has joined #ocaml
_blackdog has joined #ocaml
_blackdog has left #ocaml []
buluca has joined #ocaml
buluca has quit ["Leaving."]
buluca has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
buluca has joined #ocaml
xavierbot has joined #ocaml
piggybox has joined #ocaml
slipstream-- has joined #ocaml
<rwmjones>
type void = { v: 'a. 'a };;
<xavierbot>
type void = { v : 'a. 'a; }
seafoodX has quit []
<rwmjones>
([] : void list);;
<xavierbot>
- : void list = []
* rwmjones
wonders how to write a function of type void -> 'a
<rwmjones>
let f (x : void) = match x with [] -> ();;
<xavierbot>
Characters 33-35:
<xavierbot>
let f (x : void) = match x with [] -> ();;
<xavierbot>
^^
<xavierbot>
This pattern matches values of type 'a list
<xavierbot>
but is here used to match values of type void
<rwmjones>
let f (x : void) = 1;;
<xavierbot>
val f : void -> int = <fun>
<rwmjones>
let f (_ : void) = 1;;
<xavierbot>
val f : void -> int = <fun>
<rwmjones>
hmmm how about 'a -> void
<rwmjones>
let f () : void = failwith "error"
<rwmjones>
let f () : void = failwith "error";;
<xavierbot>
val f : unit -> void = <fun>
<rwmjones>
type void2;;
<xavierbot>
type void2
<rwmjones>
let f (_ : void2) = 1;;
<xavierbot>
val f : void2 -> int = <fun>
piggybox_ has quit [Read error: 110 (Connection timed out)]
<rwmjones>
let f () : void2 = failwith "error";;
<xavierbot>
val f : unit -> void2 = <fun>
slipstream has quit [Connection timed out]
_JusSx_ has quit [Client Quit]
pantsd has quit [Read error: 110 (Connection timed out)]
buluca has quit [Read error: 113 (No route to host)]
buluca has joined #ocaml
seafoodX has joined #ocaml
Smerdyakov has joined #ocaml
alfredr_ has quit ["Leaving"]
leo037 has joined #ocaml
ookk has joined #ocaml
<ookk>
is there an operator in OCaml like the $-operator in Haskell? so that instead of f (g x) you can write f $ g x ?
<jlouis_>
ookk: not by default.
<ookk>
how could i define one myself then?
pango has quit [Remote closed the connection]
pango has joined #ocaml
<jlouis_>
ookk: I don't really know. The $-operator of Haskell fame has seen much use in idiomatic Ocaml
<Smerdyakov>
ookk, I imagine it would be the same way as defining any other operator, which is explained in the manual.
piggybox_ has joined #ocaml
ookk has quit ["Leaving"]
<jlouis_>
another satisfied customer who will go and write a blog on how you can't define your own operators in OCaml
piggybox has quit [Connection timed out]
leo037 has quit [Remote closed the connection]
<abez>
11:29 < Smerdyakov> ookk, I imagine it would be the same way as defining any other operator, which is explained in the manual.
<abez>
I just searched the manual..
<abez>
are you being loose with the term operator?
<abez>
Or are you suggesting using ocamlp4 ?
<Smerdyakov>
No, I'm using what I think is the official definition, and I found the location in the manual without trouble.
<abez>
Then what section is it in?
<Smerdyakov>
The section that describes definition syntax
<abez>
Yeah so what you're saying is you've made up a terminology for operator which includes any function you've defined by a let. The OCaml manual doesn't define operator but the way it uses the term operator implies a built in definition with, let, in, ::, etc.
<Smerdyakov>
I'm fairly confident in what I'm saying, as the manual defines a grammar non-terminal "operator-name" that captures exactly what I'm talking about.
<Smerdyakov>
Or maybe it's a silly legalistic argument where you can have operator names, but the things they name ought not to be called operators. I stand by my terminology as the right choice, in any case.
<abez>
Yet $ is not a infix-symbol or a prefix-symbol
<abez>
thus you can't define it as an operator
<abez>
the infix-symbol and prefix-symbol list is pretty short
<Smerdyakov>
No, it's an infix-symbol.
<Smerdyakov>
You might want to make sure you're right before adopting this confrontational tone. :P
<abez>
well it isn't in the 3.10 list of infix symbols
<abez>
I admit it works
<abez>
But I started this way because you come off confrontational and rather unhelpful in general
<Smerdyakov>
Sorry, it _is_ in that list.
<abez>
It must be since I can use it...
<abez>
I see it on page 94
<abez>
I was looking at a table elsewhere
<abez>
regardless
<Smerdyakov>
Which section is that table in?
<abez>
You cannot define new operators just override them
<abez>
6.7.4
<abez>
I was trying to find a list of prefix-symbols
<abez>
12:52 < Smerdyakov> No, I'm using what I think is the official definition, and I found the location in the manual without trouble.
<abez>
12:52 < abez> Then what section is it in?
<abez>
12:52 < Smerdyakov> The section that describes definition syntax
<abez>
If you're going to complain about tone
<abez>
I suggest you re-read what you wrote and how you responded
<flux>
however it is not adivsable to use that symbol because it conflicts with using the preprocessor
<Smerdyakov>
Yeah, it's not in the table in 6.7.4, but I see no text there that suggests that a complete list of infix operators is contained therein.
<abez>
11:47 < jlouis_> another satisfied customer who will go and write a blog on how you can't define your own operators in OCaml
<abez>
^^^ thus ook is still correct to say he can't define his own operators
<abez>
without changing the definition of others
<Smerdyakov>
I think you're using a weird definition of "his own operators."
<Smerdyakov>
I think most people, especially folks new enough to OCaml to be asking such questions here, would be asking about "functions referred to by operator names."
<flux>
well, you can still define arbitratry operators by using the ocaml preprocessor, and still be able to call it "ocaml"
leo037 has joined #ocaml
<Smerdyakov>
And I don't see any point where I was confrontational or unhelpful. I firmly believe that getting people into the habit of consulting the manual is helpful and giving the answer directly is unhelpful.
leo037 has quit [Client Quit]
leo037 has joined #ocaml
<Smerdyakov>
...and abez slinks away after a personal attack is revealed as unjustified. ;)
<abez>
Ok I'm going to be blunt, you're a typical computer person incapable of understanding how people who are different than you actually think. Lines like "and I found the location in the manual without trouble." ooze and drip with pretention yet also imply you've assumed we have the same goal. You're unaware of the ambiguity involved with "o, I'm using what I think is the official definition" which actually meant according to you the infix-sy
<abez>
And of course your last snark proves furthermore your inability to get outside your head.
<Smerdyakov>
I only mentioned "finding it without trouble" in response to your challenge, seemingly posed in a role as an "advanced user" since you were questioning someone else's advice.
<Smerdyakov>
You can't connect it to a claim of being rude or inconsiderate answering an original question.
<Smerdyakov>
It was only a statement that I had used the standard objective method to verify that what I was saying was true.
<abez>
You should really think about this as you'll probably go on to teach people who don't think like you at all.
<Smerdyakov>
You're saying that my interaction with _you_ was bad, or that my interaction with the original question asker was bad?
<Ycros>
I'm not wearing any pants
<abez>
Mostly with me as I only really quoted lines which were between us.
<Smerdyakov>
OK, and it was bad because I assumed we could both interpret the grammar in the manual in the same way and come to the point that defined what an operator is?
<Smerdyakov>
If we were talking about prose, I could agree, but this is a formal BNF grammar.
<abez>
I don't think ook was only talking about $
<abez>
Ook was talking about operators
<Smerdyakov>
A program could decide this question.
<abez>
Thus what I was looking for was for defining new operators, not overloading old ones
<Smerdyakov>
Yes, the grammar tells you how to do that, in the production for definitions, like I said.
<Smerdyakov>
Er, the non-terminal for definitions
<Smerdyakov>
Do you disagree with that statement factually?
<abez>
well according to the grammar it is pretty limited.
<abez>
but sure %~ is not defined and you could define it
<Smerdyakov>
OK, so now you agree that what I said was factually correct and really did point to the part of the grammar showing how to define a new operator?
<abez>
In a round about sense
<abez>
sure
<Smerdyakov>
OK, so what on earth was rude or inconsiderate about my statement?
<abez>
Go reread what I wrote previously, I'm not copying and pasting that.
<Smerdyakov>
You're saying that I shouldn't assume that people are able to read BNF grammars to find out what syntax is allowed?
<Smerdyakov>
I certainly read the _general_ complaint you made before, but I don't see how it applies to this _specific_ situation.
<Smerdyakov>
Since the issue in question can be decided algorithmically, leaving no room for confusion based on "how different people think."
<abez>
I asked where and you gave a general idea of stuff all over the place.
G_ has joined #ocaml
<Smerdyakov>
Well, I said "the section that describes definition syntax" when perhaps I should have been more formal and said "the 'definition' non-terminal." Is that what you're getting at?
piggybox has joined #ocaml
<abez>
You were making direct reference to certain parts of the manual but refusing to say the location, I had asked specifically where.
<abez>
Regardless, I've found, with your help, the grammar for all the operators and have seen that many are not defined by default in ocaml.
<abez>
I'll thank you for the pointer, but all my points about how you're dealing with someone still stand.
<Smerdyakov>
You asked for location information in one place, immediately preceding my pointer to "the section that describes definition syntax," which uniquely identifies a section of the manual.l
<Smerdyakov>
If you found that wasn't what you wanted, you should have asked. You never indicated that you thought that was not the pointer you were looking for.
<Smerdyakov>
(And I truly had no idea that you felt I was not being specific enough.)
G has quit [Connection timed out]
<abez>
Yeah I made a mistake of assuming the list I had was it when it wasn't. I didn't notice $ in BNF til you asserted it was indeed there.
<Smerdyakov>
OK, so can we at least agree that you should have said you were seeking additional information if you were, and that I wasn't just be aloof and refusing to point you somewhere that would get to the right place by following links on the names of non-terminals?
<abez>
No that wasn't the point, but we can just amicably disagree.
<Smerdyakov>
Well, frankly, when someone accuses me of disrupting the channel, I don't feel that it's sufficient to leave it at that, because spectators tend to assume that the accuser is right by default.
<Smerdyakov>
I'm going to go ahead and leave it that you are attacking me unjustifiably.
jlouis has joined #ocaml
<Smerdyakov>
(At least regarding this particular conversation)
<abez>
Ha, nice way to burn an out.
<abez>
You truly have shown you don't understand others, which I can understand if you care about esoteric things like program proofs.
<Smerdyakov>
You haven't defended that statement one whit, which is certainly characteristic of people who don't understand formal proofs.
<abez>
What's even more delicious is you have shown the mathie tendency to discredit anything lacking formalism and slightly human in your own goal of maximizing e-penis.
piggybox_ has quit [Read error: 110 (Connection timed out)]
<Smerdyakov>
There's a difference between not understanding how people think and not making an effort to come to a mutual understanding. I've always done the latter. The key is that you must ask if an explanation isn't helpful, not just pout.
jlouis__ has joined #ocaml
<Smerdyakov>
Nothing else could be reasonable in a setting where people have so many different backgrounds.
jlouis_ has quit [Read error: 110 (Connection timed out)]
<leo037>
help
seafoodX has quit []
jlouis has quit [Read error: 110 (Connection timed out)]
buluca has quit [Read error: 113 (No route to host)]
Mr_Awesome has joined #ocaml
buluca has joined #ocaml
jlouis has joined #ocaml
malc_ has joined #ocaml
thesoko has quit [Remote closed the connection]
jlouis__ has quit [Read error: 110 (Connection timed out)]
thesoko has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
piggybox has quit [Read error: 110 (Connection timed out)]
david_koontz has joined #ocaml
david_koontz has quit ["Leaving"]
slipstream-- has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
ygrek has quit ["Leaving"]
cmeme has quit [Excess Flood]
cmeme has joined #ocaml
pantsd has joined #ocaml
the_dormant has joined #ocaml
mphill22 has quit []
jlouis_ has joined #ocaml
the_dormant_ has joined #ocaml
the_dormant has quit [Read error: 104 (Connection reset by peer)]
buluca has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
noteventime has joined #ocaml
_blackdog has joined #ocaml
_blackdog has left #ocaml []
piggybox has joined #ocaml
the_dormant_ has quit []
malc_ has quit ["leaving"]
noteventime has quit [Remote closed the connection]
noteventime has joined #ocaml
leo037 has quit ["Leaving"]
piggybox has quit [Read error: 104 (Connection reset by peer)]