mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
cpst_ has joined #ocaml
cpst has quit [Read error: 110 (Connection timed out)]
leo037 has quit ["Leaving"]
G_ has joined #ocaml
G has quit [Connection timed out]
G has joined #ocaml
G_ has quit [Connection timed out]
seafoodX has joined #ocaml
G_ has joined #ocaml
seafoodX has quit [Remote closed the connection]
seafoodX has joined #ocaml
G has quit [Connection timed out]
cpst_ is now known as cpst
G has joined #ocaml
G__ has joined #ocaml
G has quit [Nick collision from services.]
G_ has quit [Nick collision from services.]
G__ is now known as G
joshcryer has joined #ocaml
Smerdyakov has quit ["Leaving"]
piggybox_ has joined #ocaml
piggybox has quit [Read error: 110 (Connection timed out)]
bluestorm has joined #ocaml
schme has quit [Remote closed the connection]
G_ has joined #ocaml
G has quit [Read error: 110 (Connection timed out)]
screwt8 has joined #ocaml
Mr_Awesome has joined #ocaml
shans has joined #ocaml
<shans> can anyone help me with functors and modules?
<shans> I have a stream sorting implementation in a functor, which accepts a module that represents elements in the input stream
<shans> but I want to refer to the elements in the stream by their raw types, not by the module's abstract type
<shans> is that possible?
<flux> I'm not exactly sure what you mean. the stream sorter cannot use interfaces that haven't been declared before it?
<shans> hmm
<shans> more concretely then, I have something like:
<shans> module type INPUT =
<shans> sig type a end;;
<shans> and then
<flux> hey, someone on the channel talked about how ocamlc -i compiled also, well guess what I found from 3.07 change logs: 'The "-i" option no longer generates compiled files, it only prints the inferred types.'
<shans> module StreamSort : functor (I : Input) -> sig I.a Stream.t -> (I.a Stream.t) list end;;
<shans> so the StreamSort module is a functor that needs an INPUT typed module for instantiation
<shans> then, I want to create a specific instance of my StreamSort module, so I go
<flux> well, you probably want to declare some operations for it too, in INPUT
<shans> sure
<shans> I've got some, I'm just leaving them out for brevity :)
<shans> so I go:
<shans> module PacketInput : INPUT = struct type a = packet end;;
<shans> then
<shans> module PacketSort = StreamSort (PacketInput);;
<flux> how about dropping that : INPUT -part there?
<shans> so I just go module PacketInput = struct type a = packet end;;?
<shans> let me try
<flux> I think it makes the 'real type' disappear from module PacketInput
<shans> oooh
<flux> works?-)
<shans> hey, that works, thanks heaps!
<shans> awesome :)
<flux> happy to help
<flux> (referring to my earlier comment: it was |lupin|, but he's not here)
piggybox__ has joined #ocaml
piggybox_ has quit [Read error: 110 (Connection timed out)]
l_a_m has joined #ocaml
G_ is now known as G
ednarofi has quit [Read error: 104 (Connection reset by peer)]
ednarofi has joined #ocaml
Mr_Awesome has quit ["time to impregnate a moth"]
Mr_Awesome has joined #ocaml
Mr_Awesome has quit ["time to impregnate a moth"]
ednarofi_ has joined #ocaml
ednarofi has quit [Read error: 104 (Connection reset by peer)]
ednarofi_ has quit [Read error: 110 (Connection timed out)]
ednarofi has joined #ocaml
ednarofi has quit [Read error: 104 (Connection reset by peer)]
tty56_ has joined #ocaml
tty56__ has joined #ocaml
authentic has joined #ocaml
ednarofi has joined #ocaml
tty56 has quit [Read error: 110 (Connection timed out)]
tty56_ has quit [Read error: 110 (Connection timed out)]
mr_Hugo has joined #ocaml
ednarofi has quit [Read error: 110 (Connection timed out)]
piggybox__ has quit [Read error: 104 (Connection reset by peer)]
ednarofi has joined #ocaml
ednarofi has quit [Read error: 104 (Connection reset by peer)]
ednarofi has joined #ocaml
authentic has quit ["Lost terminal"]
authentic has joined #ocaml
^authentic has joined #ocaml
authentic has quit ["Lost terminal"]
^authentic is now known as authentic
romanoffi has quit [Read error: 110 (Connection timed out)]
cpst has quit [Read error: 110 (Connection timed out)]
joshcryer has quit [No route to host]
<arcatan> I'm having a problem with OCamlSDL
<arcatan> Sdlmouse.get_state seems not to work, it always returns the same coordinates
<flux> arcatan, perhaps you need to pump events also
<flux> arcatan, or perhaps start the event pumping thread (there was an option for that, right?)
<arcatan> oh, you're right, event pumping helps. I don't know about the thread stuff, I'll investigate. thank you.
piggybox has joined #ocaml
Demitar has quit [Connection reset by peer]
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
seafoodX has quit []
Demitar has joined #ocaml
authentic has quit ["Lost terminal"]
authentic has joined #ocaml
screwt8 has quit [Remote closed the connection]
TFK has quit [Read error: 110 (Connection timed out)]
seafoodX has joined #ocaml
TFK has joined #ocaml
screwt8 has joined #ocaml
authentic has quit [Read error: 113 (No route to host)]
pango has quit [Remote closed the connection]
twobitsprite has joined #ocaml
<twobitsprite> is there a collection type which can hold objects of different types besides tuple?
<tsuyoshi> a record
<twobitsprite> I need something dynamic
<tsuyoshi> types determined during runtime?
<twobitsprite> yep
<tsuyoshi> ocaml doesn't really do that
<twobitsprite> yeah...
<tsuyoshi> it's sort of missing the point of the language entirely
<twobitsprite> right
<tsuyoshi> but variants kind of do that
<twobitsprite> maybe I'm approaching this wrong, so I'll just explain what I'm trying to do
<twobitsprite> I'm working on a simple in-memory table library, i.e. with basic database features like select and group-by, etc...
<twobitsprite> the table itself is easy, it's an 'a list, where 'a is some tuple type, each record being a tuple
<twobitsprite> indexing is the hard part... I need to keep a list of hashtables, but each one might be a different type
<tsuyoshi> oh ok
<tsuyoshi> then you want a.. what is it called, a union type
<tsuyoshi> type field = String of string | Int of int | Char of char
<tsuyoshi> and then the database record would be
<tsuyoshi> type record = field array
<bluestorm> sum type ?
<tsuyoshi> type table = record list
<tsuyoshi> yeah sum
<twobitsprite> jand then an index would be: type index = (field, record) Hashtbl.t
<twobitsprite> cool, thanks
pango has joined #ocaml
<twobitsprite> I was hoping to be able to have a polymorphic table type, though... using the sum type restricts myself to those few things
seafoodX has quit []
<bluestorm> hm
_blackdog has joined #ocaml
_blackdog has left #ocaml []
<bluestorm> twobitsprite:
<bluestorm> how would you use the tables in that list ?
ednarofi has quit ["leaving"]
ednarofi has joined #ocaml
slipstream-- has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
Smerdyakov has joined #ocaml
tty56 has joined #ocaml
slipstream-- has quit ["leaving"]
slipstream has joined #ocaml
hugo_ has joined #ocaml
hugo_ is now known as mr_H
tty56__ has quit [Read error: 110 (Connection timed out)]
mr_Hugo has quit [Read error: 110 (Connection timed out)]
ednarofi has quit [Read error: 110 (Connection timed out)]
ednarofi has joined #ocaml
_blackdog has joined #ocaml
cpst has joined #ocaml
_JusSx_ has joined #ocaml
_blackdog has left #ocaml []
TFKv2 has joined #ocaml
TFK has quit [Nick collision from services.]
TFKv2 is now known as TFK
malc_ has joined #ocaml
Mr_Awesome has joined #ocaml
Mr_Awesome has quit [Killed by ballard.freenode.net (Nick collision)]
Mr_Awesome_ has joined #ocaml
Mr_Awesome_ is now known as Mr_
Mr_ is now known as Mr_Awesome
TFKv2 has joined #ocaml
TFK has quit [Nick collision from services.]
TFKv2 is now known as TFK
malc_ has quit ["leaving"]
Mr_Awesome has quit ["aunt jemima is the devil!"]
Mr_Awesome has joined #ocaml
<_JusSx_> /quit
_JusSx_ has quit ["leaving"]
piggybox has quit [Read error: 110 (Connection timed out)]
ednarofi has quit [Read error: 110 (Connection timed out)]
ednarofi has joined #ocaml
Mr_Awesome has quit ["aunt jemima is the devil!"]
joshcryer has joined #ocaml
<bluestorm> let raise exn = let rec f x = f x in f (print_endline (Printexc.to_string exn))
<bluestorm> :]
<bluestorm> (someone just said me "you couldn't code raise using non-magic pure OCaml")
<Smerdyakov> And I don't think you just did.
<Smerdyakov> You don't allow for catching of exn.
<bluestorm> hm
<bluestorm> good point
<bluestorm> so, that was "exit", without the at_exit management :-°
G_ has joined #ocaml
G has quit [Connection timed out]
drewism has joined #ocaml
slipstream-- has joined #ocaml
slipstream has quit [Read error: 113 (No route to host)]
schme has joined #ocaml
Submarine has joined #ocaml
Mr_Awesome has joined #ocaml
ednarofi_ has joined #ocaml
ednarofi has quit [Read error: 110 (Connection timed out)]
drewism has quit []
bluestorm has quit [Read error: 113 (No route to host)]