Smerdyakov has quit [Remote closed the connection]
Smerdyakov has joined #ocaml
schme`` has quit [Remote closed the connection]
schme has joined #ocaml
seafoodX has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
magnus__ has quit [Read error: 110 (Connection timed out)]
magnus_ has joined #ocaml
Smerdyakov has quit ["Leaving"]
joshcryer has joined #ocaml
G has quit [Remote closed the connection]
bluestorm_ has joined #ocaml
vuks has quit [Read error: 110 (Connection timed out)]
pango has quit [Remote closed the connection]
pango has joined #ocaml
<flux>
bluestorm_, that automatic constructor wouldn't work anyway with constructors defined in other modules, so it's better to convert the type into a set of functions which can be exported in the interface
<bluestorm_>
hm
<bluestorm_>
right
<flux>
I wonder how realistic the name collision problem is.. still real, I suppose
<flux>
perhaps something like type .. with cons(~prefix:"_") if the user so desires
<flux>
is that manually or automatically translated? but yes, something like that would be fun
<bluestorm_>
it's automatically done
G has joined #ocaml
<flux>
nice. where's the source? perhaps I should resume my attempts to learn campl4 also ;)
<flux>
I've made one macro, which is like DEBUG "%s %d" "foo" 42, which translates into something like (match debug with None -> () | Some x -> x "%s %d" "foo" 42) but it had its problems also
<flux>
also I haven't yet moved to ocaml 3.10, so the old camlp4 for me..
<bluestorm_>
you learned ocaml from scratch with ocaml-tutorial ?
<danderson>
bluestorm_: never said I learned anything :)
<danderson>
am learning.
<bluestorm_>
:p
<bluestorm_>
ok
* rwmjones
watches & wonders
<bluestorm_>
i ask that because i learned ocaml before i knew ocaml-tutorial, so i don't know what it's worth for beginners
<danderson>
so far, it's pretty good.
<bluestorm_>
instead of read_line () you could use ignore (Graphics.read_key ())
<bluestorm_>
ok
<danderson>
I'm still in the general program structure section, the very first
<danderson>
but it's doing a good job of telling me what to "ignore for now, we'll get to that later", and highlighting common gotchas for newbies.
<bluestorm_>
hm
<bluestorm_>
i guess i should read it entirely one day
<bluestorm_>
quick glances aren't enough
thruspa has joined #ocaml
lde` has joined #ocaml
<flux>
you know what would be fun
lde has quit [No route to host]
<flux>
an adaptation of Graphics-module and ocaml compiler so that paste-sites could display the resulting graphics next to the paste
<flux>
(safely, I'm thinking the work done on evaluating stuff on the bot)
<flux>
I doubt it would find much use, though :)
<danderson>
heh
damg has joined #ocaml
seafoodX has joined #ocaml
joshcryer has quit [Nick collision from services.]
joshcryer has joined #ocaml
fridim has joined #ocaml
ygrek has joined #ocaml
seafoodX has quit []
[1]damg has joined #ocaml
_JusSx_ has joined #ocaml
malc_ has quit ["leaving"]
[1]damg has quit [Read error: 104 (Connection reset by peer)]
damg has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
fridim has quit [Read error: 110 (Connection timed out)]
buluca has joined #ocaml
cpst has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
buluca has joined #ocaml
ygrek has quit [Remote closed the connection]
buluca has quit [Read error: 113 (No route to host)]
scruffie has joined #ocaml
Mr_Awesome has joined #ocaml
jlouis_ is now known as jlouis
Demitar has joined #ocaml
thruspa has left #ocaml []
screwt8 has quit [Remote closed the connection]
kelaouchi has joined #ocaml
buluca has joined #ocaml
_JusSx_ has quit ["leaving"]
<danderson>
I'm following ocaml-tutorial.org, and I'm a little confused by an example of partial application.
<danderson>
let multiply n = List.map (( * ) n);;
<xavierbot>
val multiply : int -> int list -> int list = <fun>
<danderson>
(nice, an evalbot)
<danderson>
so, I understand that multiply in this case is a partial application of both the multiplication operator and List.map
<danderson>
but what are the exact semantics when you have nested partial applications like that?
<danderson>
which argument comes first in the resulting function?
<Smerdyakov>
You don't need a rule for this special case.
<danderson>
(in this case, it's obviously the argument to ( * ), but I don't see the why)
<Smerdyakov>
Do you understand what currying is?
<danderson>
yes
<Smerdyakov>
So you understand that, for instance, ( * ) takes the first operand and returns a new function that adds that value to its operand?
<danderson>
yes. And that List.map does the same with this new function.
<danderson>
hmm, okay, let me scribble how the types compose as a result of that, see if I can make sense of it.
<danderson>
okay, I think I understand the reasoning behind the ordering of arguments in the resulting function.
<danderson>
ah, and with the type signature of List.map, it becomes entirely clear. I was missing that its first argument is ('a -> 'b).
<danderson>
Thanks.
<Smerdyakov>
No problem. You're probably just shocked by how simple OCaml's typing rules are compared to mainstream languages'. :)
<danderson>
not shocked about the simplicity that strict typing brings along, but currying is still very new, so I expect I'll need some time to get used to it :)
<danderson>
until then, yay for interactive evaluation to see what the signature is
Tetsuo has quit ["Leaving"]
piggybox has quit [Read error: 110 (Connection timed out)]
* danderson
's brain explodes as he tries to parse functors
bluestorm_ has quit [No route to host]
kelaouch1 has joined #ocaml
m3ga has joined #ocaml
m3ga has quit [Read error: 104 (Connection reset by peer)]
crathman has quit [Read error: 110 (Connection timed out)]
Cygaal has quit []
kelaouchi has quit [Read error: 110 (Connection timed out)]