ousia has quit [Remote host closed the connection]
ousia has joined #ocaml
<adrien>
morning
frogfoodeater has joined #ocaml
<Kakadu>
hey!
<orbitz>
hi
tane has joined #ocaml
q66 has joined #ocaml
frogfoodeater has quit [Ping timeout: 260 seconds]
ulfdoz has joined #ocaml
Neros has joined #ocaml
ollehar has quit [Ping timeout: 260 seconds]
ousia has quit [Read error: Connection reset by peer]
yacks has quit [Ping timeout: 255 seconds]
cdidd has joined #ocaml
yacks has joined #ocaml
watermind has quit [Quit: Konversation terminated!]
weie_ has quit [Read error: Connection reset by peer]
weie has joined #ocaml
ontologiae has quit [Ping timeout: 246 seconds]
cthuluh has quit [Ping timeout: 256 seconds]
emmanuelux has joined #ocaml
cthuluh has joined #ocaml
leoncamel has quit [Ping timeout: 245 seconds]
ttamttam has quit [Remote host closed the connection]
asmanur has quit [Ping timeout: 245 seconds]
leoncamel has joined #ocaml
vbmithr_ has quit [Ping timeout: 245 seconds]
lopex has joined #ocaml
bobry has joined #ocaml
mikurubeam has joined #ocaml
tane has quit [Quit: Verlassend]
vbmithr has joined #ocaml
IbnFirnas has joined #ocaml
gnuvince has quit [Ping timeout: 245 seconds]
awm22 has joined #ocaml
rwmjones has quit [Read error: Operation timed out]
Uvs has quit [Ping timeout: 256 seconds]
rwmjones has joined #ocaml
darkf has quit [Quit: Leaving]
ollehar has joined #ocaml
Uvs has joined #ocaml
tane has joined #ocaml
tongcx has joined #ocaml
<tongcx>
hi guys
<tongcx>
anyone?
<tongcx>
if I have a type Hello of int*int
<tongcx>
and a val a = (3,5)
<tongcx>
then "Hello a" will complain that "Hello takes 2 args but only 1 is provided"
<tongcx>
seems really unpleasant to me
<Cypi_>
'Hello of int*int' isn't the same as 'Hello of (int*int)', indeed
Cypi_ is now known as Cypi
groovy2shoes has joined #ocaml
<wmeyer>
Cypi is right. For convenience if you enclose the constructor arguments with parentheeses you will get a single tuple argument, so you can pass a single value of product type to the constructor
<wmeyer>
it does not change the syntax for constructing values though, the only difference is that you can package them into single value
<Leonidas>
this is quite strange
<Leonidas>
# type foo = Foo of int * int;;
<Leonidas>
type foo = Foo of int * int
<Leonidas>
Foo(1,2) works, but how can I pass only a single value?
<Armael>
let a = (1,2) in Foo a ?
<Leonidas>
Armael: ah, this doesn't work. But with type bar = Bar of (int*int) it works.
<wmeyer>
Leonidas: type foo = Foo of (int * int);;
<Leonidas>
soo, in general I always want to use parenthesis, right?
<wmeyer>
that's exactly what was mentioned in few paragraphs up
<wmeyer>
it does not change the constructor syntax, it changes the type
<Leonidas>
wmeyer: yes, I know, that's why I wanted to try it and understand it :)
<Armael>
yeas Leonidas
<Armael>
that's what i meant
<wmeyer>
Leonidas: use it when you feel so!
Uvs has quit [Ping timeout: 256 seconds]
<Leonidas>
wmeyer: I can't think of a case where it would be better to leave them out, that's why I am asking here.
<wmeyer>
Leonidas: yes, I can see, I used them not that often
<Leonidas>
I should possibly also review my own code, come to think of it and add parens in case I left them out somewhere.
<wmeyer>
or use GADTs :-)
<Leonidas>
yeah, maybe that too :)
<ggole>
You don't want to use tuples in constructors unless you need to
<ggole>
They introduce an indirection
Uvs has joined #ocaml
<Leonidas>
ggole: I don't know, isn't this premature optimization?
<Leonidas>
hmm, I wanted to create a piping syntax like create |> decompress |> save
<Leonidas>
turns out, my |> seems to work exactly like >>=
<Leonidas>
question: is it a good idea to name my |> operator >>= in OCaml or will the precedence rules come and bite me?
<ousado>
ggole: how so? do the internal representations differ?
walter has quit [Ping timeout: 245 seconds]
<ousado>
or do you mean on the syntax level?
ollehar has quit [Ping timeout: 252 seconds]
walter has joined #ocaml
watermind has joined #ocaml
<ggole>
ousado: yes, the represenations differ
<ggole>
A tuple is a pointer to a heap allocated block
<ggole>
So if you have a constructer with a tuple argument
<ggole>
It's a pointer
<ggole>
Constructor arguments, on the other hand, are allocated along with the tag
<ousado>
ah, right, I see
Neros has quit [Ping timeout: 245 seconds]
TDJACR has quit [Quit: Quit]
walter has quit [Quit: This computer has gone to sleep]
mikurubeam has quit [Read error: Connection reset by peer]
ollehar has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
eikke has joined #ocaml
ollehar1 has joined #ocaml
walter has joined #ocaml
ttamttam has joined #ocaml
Yoric has joined #ocaml
walter has quit [Quit: This computer has gone to sleep]
ollehar has quit [Ping timeout: 240 seconds]
walter has joined #ocaml
ttamttam has left #ocaml []
<wmeyer>
ggole: good catch, I rarely think about performance in OCaml.
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
<ggole>
I probably think about it too much.
* companion_cube
too
BiDOrD has quit [Ping timeout: 272 seconds]
BiDOrD has joined #ocaml
ggole has quit []
groovy2shoes has quit [Ping timeout: 256 seconds]
ttamttam has joined #ocaml
lopex has quit [Remote host closed the connection]
bobry has quit [Write error: Broken pipe]
derek_c has joined #ocaml
flx_ has joined #ocaml
bobry has joined #ocaml
lopex has joined #ocaml
ttamttam has quit [Quit: ttamttam]
flux has quit [Ping timeout: 245 seconds]
flx_ is now known as flux
lopexx has joined #ocaml
answer_42 has quit [Quit: WeeChat 0.4.0]
ollehar has joined #ocaml
Uvs has quit [Ping timeout: 260 seconds]
bobry has quit [Remote host closed the connection]
lopex has quit [Remote host closed the connection]
IbnFirnas has quit [Remote host closed the connection]
Kakadu has quit []
eikke has quit [Ping timeout: 240 seconds]
eikke has joined #ocaml
gnuvince has joined #ocaml
wmeyer has quit [Remote host closed the connection]
cdidd has quit [Ping timeout: 245 seconds]
Yoric has quit [Ping timeout: 245 seconds]
cdidd has joined #ocaml
wmeyer` has joined #ocaml
pkrnj has joined #ocaml
pango has quit [Ping timeout: 240 seconds]
pango has joined #ocaml
<wmeyer`>
hi
<companion_cube>
hello
tootooroo has joined #ocaml
<wmeyer`>
companion_cube: weekend past and didn't write even single OCaml code.
<companion_cube>
me neither
<companion_cube>
well, a few lines
watermind has quit [Read error: Connection reset by peer]
watermind has joined #ocaml
frogfoodeater has joined #ocaml
paddymahoney has joined #ocaml
frogfoodeater has quit [Ping timeout: 256 seconds]