flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
sw2wolf has quit [Remote host closed the connection]
ollehar has joined #ocaml
sw2wolf has joined #ocaml
eikke has quit [Ping timeout: 245 seconds]
darkf has joined #ocaml
clintnewsom has joined #ocaml
eikke has joined #ocaml
travisbrady has joined #ocaml
q66 has quit [Remote host closed the connection]
tani has quit [Quit: Verlassend]
toto has joined #ocaml
toto is now known as Guest13277
Guest13277 has quit [Client Quit]
gnuvince has quit [Ping timeout: 258 seconds]
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 264 seconds]
madroach has quit [Ping timeout: 248 seconds]
gnuvince has joined #ocaml
madroach has joined #ocaml
darkf_ is now known as darkf
myx has joined #ocaml
travisbrady has quit [Quit: travisbrady]
fraggle_ has quit [Ping timeout: 245 seconds]
ollehar has quit [Ping timeout: 260 seconds]
fraggle_ has joined #ocaml
eikke has quit [Ping timeout: 260 seconds]
gnuvince has quit [Ping timeout: 258 seconds]
yacks has joined #ocaml
gnuvince has joined #ocaml
sw2wolf has quit [Ping timeout: 256 seconds]
gnuvince has quit [Ping timeout: 258 seconds]
sw2wolf has joined #ocaml
Kakadu has joined #ocaml
sw2wolf has quit [Remote host closed the connection]
ttamttam has joined #ocaml
ttamttam has quit [Remote host closed the connection]
sw2wolf has joined #ocaml
gnuvince has joined #ocaml
sw2wolf has left #ocaml []
Yoric has joined #ocaml
Yoric has quit [Client Quit]
Yoric has joined #ocaml
ggole has joined #ocaml
cdidd has joined #ocaml
paddymahoney has quit [Remote host closed the connection]
Snark has joined #ocaml
chambart has joined #ocaml
chambart has quit [Read error: Connection reset by peer]
Cyanure has joined #ocaml
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
paddymahoney has joined #ocaml
ulfdoz has joined #ocaml
myx has quit [Ping timeout: 276 seconds]
ollehar has joined #ocaml
rwmjones_holiday has quit [Ping timeout: 256 seconds]
rwmjones_holiday has joined #ocaml
tane has joined #ocaml
gnuvince has quit [Ping timeout: 258 seconds]
Kakadu has quit [Remote host closed the connection]
Kakadu has joined #ocaml
<adrien> was having an issue with yypkg; had to rebuild the binary after an OS update (not that big but included a glibc update from 2.15 to 2.17)
<adrien> rebuilding was enough but I thought I should mention it
troydm has quit [Ping timeout: 256 seconds]
zpe has joined #ocaml
myx has joined #ocaml
q66 has joined #ocaml
tane has quit [Quit: Verlassend]
astrobunny has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
astrobun_ has quit [Read error: No route to host]
zpe has quit [Ping timeout: 256 seconds]
ulfdoz has quit [Quit: brb]
ulfdoz has joined #ocaml
npouillard has joined #ocaml
<npouillard> Did anyone recently received an email about giving him solutions to an OCaml assignment?
yacks has quit [Ping timeout: 264 seconds]
ollehar has quit [Ping timeout: 245 seconds]
yacks has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 258 seconds]
iratsu has joined #ocaml
iratsu is now known as alang_
eikke has joined #ocaml
beckerb has joined #ocaml
zpe has joined #ocaml
troydm has joined #ocaml
Yoric has joined #ocaml
anderse has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
gnuvince has joined #ocaml
eikke has quit [Ping timeout: 245 seconds]
Yoric has quit [Ping timeout: 246 seconds]
ollehar has joined #ocaml
zpe has joined #ocaml
ollehar1 has joined #ocaml
myx has quit [Quit: ушёл]
zpe has quit [Ping timeout: 258 seconds]
ollehar1 has quit [Ping timeout: 256 seconds]
ontologiae has joined #ocaml
mye has joined #ocaml
eikke has joined #ocaml
jon-shape has joined #ocaml
mye_ has joined #ocaml
mye has quit [Ping timeout: 252 seconds]
mye_ is now known as mye
ulfdoz has quit [Ping timeout: 245 seconds]
zpe has joined #ocaml
ulfdoz has joined #ocaml
notk0 has joined #ocaml
<notk0> does anyone know the type of code of a match that is compiled into a LStaticCatch?
zpe has quit [Ping timeout: 260 seconds]
<notk0> hello, this program works in the interpreter ( in emacs with tuareg) http://pastebin.com/0BfWRvMF but doesn't if I execute it with ocaml
<notk0> what is the mistake?
<Kakadu> Can u give me some tips about linking, please? http://paste.in.ua/8124/#57
<Kakadu> notk0: You should explain what means `doesn't`
<notk0> Kakadu: I get a syntax error
<notk0> ok I put a ;; and it seems to work
<Kakadu> notk0: It will be great adding error message to your paste next time
<notk0> I think it was a parantheses error, as it thought the neext expression was part of let rec
emmanuelux has joined #ocaml
emmanuelux has quit [Read error: Connection reset by peer]
ontologiae has quit [Ping timeout: 245 seconds]
maufred_ has joined #ocaml
zpe has joined #ocaml
maufred_ has quit [Read error: Operation timed out]
Yoric has joined #ocaml
emmanuelux has joined #ocaml
ontologiae has joined #ocaml
eikke has quit [Ping timeout: 252 seconds]
eikke has joined #ocaml
zpe has quit [Ping timeout: 256 seconds]
myx has joined #ocaml
Yoric has quit [Ping timeout: 264 seconds]
BiDOrD has quit [Ping timeout: 264 seconds]
BiDOrD_ has joined #ocaml
eikke has quit [Ping timeout: 245 seconds]
ollehar1 has joined #ocaml
<ollehar1> is it not possible to declare function local types in ocaml?
<Kakadu> function local types?
<Kakadu> i.e. types inside fucntion body?
eikke has joined #ocaml
zpe has joined #ocaml
eikke has quit [Ping timeout: 256 seconds]
zpe has quit [Ping timeout: 264 seconds]
<orbitz> ollehar1: I don't think so
npouillard has left #ocaml []
<ollehar1> Kakadu: yes, like
<ollehar1> let f x =
<ollehar1> type tmp = {bla : int }
<ollehar1> ...
<ggole> No. Use a module for that.
<ggole> Or just don't expose the type in your .mli. Less typing.
<mfp> if you really wanted to, you could use a local module carrying your type, and the compiler would verify that the type doesn't escape the scope
<mfp> let f x = let module M = struct type tmp = { bla : int } in let open M in .... { bla = 1 }....
<mfp> +end
<ollehar1> the same goes for classes, I suppose_
<ollehar1> ?
<ggole> Dunno, never use em :)
<ollehar1> mfp: neat
zpe has joined #ocaml
Neros_ has joined #ocaml
emmanuelux has quit [Ping timeout: 258 seconds]
emmanuelux has joined #ocaml
darkf has quit [Quit: Leaving]
leoncamel has quit [Ping timeout: 256 seconds]
zpe has quit [Ping timeout: 260 seconds]
ontologiae has quit [Ping timeout: 264 seconds]
emmanuelux has quit [Ping timeout: 264 seconds]
emmanuelux has joined #ocaml
emmanuelux has quit [Max SendQ exceeded]
emmanuelux has joined #ocaml
eikke has joined #ocaml
emmanuelux has quit [Max SendQ exceeded]
emmanuelux has joined #ocaml
emmanuelux has quit [Max SendQ exceeded]
tane has joined #ocaml
emmanuelux has joined #ocaml
eikke has quit [Ping timeout: 245 seconds]
zpe has joined #ocaml
emmanuelux has quit [Max SendQ exceeded]
Pantoufle has joined #ocaml
zpe has quit [Ping timeout: 258 seconds]
jlouis_ is now known as jlouis
amaloz has joined #ocaml
myx has quit [Read error: Operation timed out]
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
myx has joined #ocaml
Yoric has joined #ocaml
zpe has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
zpe has quit [Ping timeout: 258 seconds]
ttamttam has joined #ocaml
myx has quit [Ping timeout: 264 seconds]
Cyanure has quit [Remote host closed the connection]
zpe has joined #ocaml
iZsh has quit [Quit: Coyote finally caught me]
<Kakadu> Can u give me some tips about linking, please? http://paste.in.ua/8124/#57
zpe has quit [Ping timeout: 260 seconds]
mye_ has joined #ocaml
mye has quit [Ping timeout: 245 seconds]
mye_ is now known as mye
Yoric has joined #ocaml
ggole has quit []
zpe has joined #ocaml
eikke has joined #ocaml
Anarchos has joined #ocaml
Neros_ has quit [Remote host closed the connection]
zpe has quit [Ping timeout: 256 seconds]
Neros_ has joined #ocaml
clintnewsom has quit [Quit: clintnewsom]
ollehar1 has quit [Ping timeout: 245 seconds]
BiDOrD_ has quit [Ping timeout: 255 seconds]
BiDOrD has joined #ocaml
paddymahoney has quit [Remote host closed the connection]
ollehar1 has joined #ocaml
stevej has joined #ocaml
clintnewsom has joined #ocaml
zpe has joined #ocaml
ttamttam has left #ocaml []
ttamttam has joined #ocaml
ttamttam has left #ocaml []
clintnewsom has left #ocaml []
clintnewsom has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
ollehar1 has quit [Ping timeout: 256 seconds]
anderse has quit [Quit: anderse]
stevej has quit [Quit: Computer has gone to sleep.]
tane has quit [Quit: Verlassend]
eikke has quit [Ping timeout: 252 seconds]
troydm has quit [Read error: Operation timed out]
troydm has joined #ocaml
mye has quit [Ping timeout: 252 seconds]
Kakadu has quit []
ollehar1 has joined #ocaml
stevej has joined #ocaml
yacks has quit [Quit: Leaving]
eikke has joined #ocaml
heidi-ann has joined #ocaml
ollehar has quit [Ping timeout: 255 seconds]
ollehar1 has quit [Ping timeout: 276 seconds]
eikke has quit [Ping timeout: 252 seconds]
ousado has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
ousado is now known as ousado_
ousado_ is now known as ousado
stevej has quit [Quit: Computer has gone to sleep.]
ttamttam has joined #ocaml
ttamttam has quit [Remote host closed the connection]
eikke has joined #ocaml
Snark has quit [Quit: Quitte]
<Leonidas> is there a way to define something to be a "stricter" type than something is?
<zorun> a subtype, you mean?
<Leonidas> like, if I have a handle to a file, I want to open that handle and make it a stricter type by saying "opened_handle" as type
<zorun> maybe through variant types
<Leonidas> I don't know how this is called in OCaml, that's why I am asking
<zorun> it looks more like object or class inheritance
<zorun> I don't think the type system easily allows this kind of things (but I might be wrong)
<Leonidas> I am reading Appendix B.1 Variant types but I am not really sure I want this
<Leonidas> "Thus, they allow values of different types to be mixed together in a collection by tagging them with variant labels; the values may be retrieved from the collection by inspecting their tags using pattern matching."
<Leonidas> that doesn't really sound like what I want
<zorun> hmm, true
<def-lkb> Leonidas: if what you mean is changing the type of an existing value, it's not possible
<Leonidas> from the example, maybe I could emulate `Opened_file or something
<Leonidas> def-lkb: it doesn't need to destructively change it. it can also wrap it.
<Armael> you may want subtyping with objects
<def-lkb> Using subtyping relation of polymorphic variants in a phantom parameter is a common way to do that
<Leonidas> Something like this: File -> open_file -> Opened_file -> close_file -> File
<Armael> def-lkb: do you have some link about that ?
<def-lkb> Armael: none I can remember right now :/
<Leonidas> hmm, maybe phantom types are waht I am looking for: https://ocaml.janestreet.com/?q=node/11
<Leonidas> from the text, it sounds quite like what I am up to
<def-lkb> Leonidas: yes, some variants of these tricks are definitely a solution to your problem
<Leonidas> it is not exactly a problem, I'd just like to introduce more type safety by encoding the state of my variables into the type :)
clintnewsom has quit [Quit: clintnewsom]
maufred_ has joined #ocaml
<zorun> oh, nice, I'd never heard of phantom types :)
notk0 has quit [Quit: Leaving]
tensai_cirno has joined #ocaml
<tensai_cirno> Hello, what's the difference between "type c = C of int * bool" and "type c = C of (int * bool)"?
eikke has quit [Read error: Operation timed out]
eikke has joined #ocaml
tensai_cirno has left #ocaml []
tensai_cirno has joined #ocaml
<def-lkb> tensai_cirno: an indirection
<tensai_cirno> indirection? Can you elaborate?
<def-lkb> "C of int * bool" means a block with tag 0 (C being the first and only constructor) and 2 fields, of type int and bool
<def-lkb> "C of (int * bool)" means a block with tag 0 and 1 field, of type "a pair of an int and a bool"
<tensai_cirno> So "C of int * bool" doesn't mean passing tuple (pair) to constructor?
<def-lkb> Yes
<def-lkb> This is also why you have to match both values during pattern matching and not directly extracting a tuple
<def-lkb> Using C pseudocode : struct C { int field1; bool field2; };
<def-lkb> vs struct int_bool_pair { int field1; bool field2; }; struct C { int_bool_pair* field1; }
<tensai_cirno> hmm
<tensai_cirno> thanks :-)
<tensai_cirno> I'll try some expressions in REPL
<def-lkb> np :)
<tensai_cirno> def-lkb: Yeah, I think I got it. But what means "block with tag 0"? What is tag?
stevej has joined #ocaml
<def-lkb> tensai_cirno: as you probably know, ocaml sum types are disjoint union, that is you can test which constructor was used to build the value when matching it.
<def-lkb> to do so, a tag is added to each value, and constructors are numbered starting from 0.
<def-lkb> type a = A of int | B of int
<def-lkb> values constructed from A are tagged 0, those constructed from B are tagged 1
<tensai_cirno> Oh, I understand. thx. :)
<Leonidas> I am trying to convert a .ml file with plain definitions into a module but when I wrap it around "module Archive = struct (previous content) end", the other files complain they cannot find the functions. What did I do wrong?
<Leonidas> Error: Unbound value Archive.version_string
<bernardofpc> def-lkb: the numbering of constructors is unique until which level ?
<def-lkb> bernardofpc: what do you mean by unique? this is done type by type
<def-lkb> separate type definitions share the same tags, but thanks to the typer there can be no confusion at that level
<bernardofpc> ok
<bernardofpc> so I can have two constructors named A for two different types, this is a different thing each time ?
<bernardofpc> type foo = A of int | B of string ;;
<bernardofpc> type bar = A of int | C of float ;;
<def-lkb> internally, both A will have tag 0, B and C will have tag 1.
<def-lkb> but at the source level, the A from bar will shadow A from foo, so you can no longer use the first A.
<Leonidas> is there a way to avoid having the file name in the name for the module? I have a module Archive in a file called Archive, so I have to call Archive.Archive.version_string which I'd like to avoid.
<Leonidas> Apart from just using "open", that is.
<def-lkb> I don't think so.
beckerb has quit [Quit: Konversation terminated!]
Yoric has quit [Ping timeout: 246 seconds]
maufred_ has quit [Quit: leaving]
BiDOrD has quit [Ping timeout: 245 seconds]
BiDOrD has joined #ocaml
clintnewsom has joined #ocaml
heidi-ann has quit [Quit: Page closed]
troydm has quit [Ping timeout: 256 seconds]
R has joined #ocaml
R is now known as Guest1384
Guest1384 has quit [Client Quit]
stevej has quit [Read error: Connection reset by peer]
tane has joined #ocaml
stevej has joined #ocaml