<pundai>
ok, type foo = Nothing | Int of int;; type bar = Nothing | String of string;; let a = Nothing <-- what are the rules for the type inferencehere?
<pundai>
i get val a : bar, but what decides bar over foo?
<pundai>
yello
MisterC has joined #ocaml
<malc_>
pundai: shadow
<pundai>
doh
<pundai>
malc_, i wonder if that was the best idea..
<malc_>
pundai: ofcourse, you can not create values of foo initialized with Nothing, so there is no conflict
Skal has quit [Read error: 110 (Connection timed out)]
<pundai>
malc_, because of type bar?
<malc_>
pundai: because anything Nothing will be of type bar, yes
<malc_>
that was a funny sentence
<pundai>
malc_, then if you have two modules that define these types, the type you end up using would depend on the import order correct?
<malc_>
pundai: yes, but you will have the ability to disamiguate via Module_name.type_name scheme
<pundai>
malc_, ok
* pundai
continues ocaml investigations
<malc_>
pundai: actually.. i don't know what you mean by import
<pundai>
"open"
Smerdyakov has joined #ocaml
<malc_>
pundai: then everything above stands.. i would suggest using applicable terminology
<pundai>
whats applicable terminology here then...
<pundai>
open?
<malc_>
yep
<pundai>
weird
<pundai>
you "open" a module in ocaml
<pundai>
?
<malc_>
yep
<malc_>
you can also include it
<malc_>
different matter altogether, though on the surface feels the same
MisterC has quit [Remote closed the connection]
<pundai>
so whats the difference malc_
<pundai>
also, is the compilation model pretty much the same as C++?
<malc_>
open just puts the visible stuff from the module into the current scope, include, well, includes stuff
<malc_>
what do you mean by that?
<pundai>
malc_, the notion of a translation unit
<pundai>
which are compiled separately and then linked
<Smerdyakov>
pundai, don't you think it might be helpful to read the manual?
<pundai>
Smerdyakov, thanks for your concern, but i am doing it. the conversation just led here
<pundai>
of course, you weren't here for it so its not your fault :)
<malc_>
more or less (if we imagine that all C++ compilers/linkers support export)
<pundai>
interesting
<malc_>
someone should probably change the topic w.r.t. to latest developments
<malc_>
-to
Ringo48 has left #ocaml []
<pundai>
i'm sean connery
<pundai>
does that qualify
<Smerdyakov>
malc_, why don't you change it?
<malc_>
Smerdyakov: yeah why?
<Smerdyakov>
malc_, you're the one who complained!
<malc_>
wtf i did that i wonder.. sorry if that caused you any inconvenience
<pundai>
i still think its important when sean connery enters the channel
<malc_>
sorry but your rubbish accent makes almost everything you say unintelligible
<pundai>
whatch that you shay?
<malc_>
what you just called me?
<malc_>
oh heck.. bed time
malc_ has quit ["leaving"]
fab_ has joined #ocaml
fab__ has quit [Read error: 110 (Connection timed out)]
<pundai>
where is the pi symbol defined?
<Smerdyakov>
I don't know if it is.
<pundai>
oh ok
<pundai>
the manual uses pi, but its nonexistent
<pundai>
\o/
pango_ has joined #ocaml
pango has quit [Read error: 110 (Connection timed out)]
Smerdyakov has quit ["Leaving"]
Revision17 has quit [Remote closed the connection]
<lispy>
how is the Lazy module (or is a functor) implemented?
<lispy>
coming from a Haskell background i don't really understand how a Lazy module was created in a strict language
<flux__>
it wasn't, it is partially a compiler feature
<flux__>
it involves a non-module mechanism 'lazy'
<flux__>
but I don't view it as much different from fun () ->
<flux__>
and writing a Lazy-module in terms of that shouldn't be difficult, after all, we have mutability
<lispy>
what is fun () -> ?
<lispy>
() is unit right?
<flux__>
it's analoguous to \() -> ..
<flux__>
s/uo/o/
<flux__>
so it would create a function that is not yet evaluated, but is evaluated when it is applied with with argument ()
<flux__>
(so yes)
booyaa has joined #ocaml
booyaa has left #ocaml []
Skal has joined #ocaml
MisterC has joined #ocaml
Skal has quit [Read error: 110 (Connection timed out)]
ski has quit ["Leaving"]
<pundai>
ok so whats the deal with type expr = Plus of expr * expr;; <-- what does this "of" mean
<pango_>
it's part of sum types syntax
<pango_>
bbl
pango_ has quit [Remote closed the connection]
<pundai>
sum types syntax? is that bad spelling or what
descender has quit [Read error: 104 (Connection reset by peer)]
<flux__>
no.
<pundai>
flux__, can you explain please, whats "sum types"