gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
avsm has quit [Quit: Leaving.]
munga has joined #ocaml
hexmode has left #ocaml []
munga has quit [Ping timeout: 240 seconds]
<adrien> bluh, it seems pretty much everything ported to windows from the unix world is buggy with an all-time favorite being opening in text mode when binary mode is required and vice-versa
myu2 has joined #ocaml
rks has quit [Read error: Connection reset by peer]
rks has joined #ocaml
oriba has joined #ocaml
drunK has quit [Remote host closed the connection]
myu2 has quit [Remote host closed the connection]
oriba has quit [Quit: Verlassend]
ymasory has joined #ocaml
Amorphous has quit [Ping timeout: 272 seconds]
alexyk has quit [Quit: alexyk]
alexyk has joined #ocaml
alexyk has quit [Quit: alexyk]
Amorphous has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Client Quit]
noisymouse has quit [Remote host closed the connection]
ymasory has quit [Ping timeout: 240 seconds]
wormphlegm has joined #ocaml
ymasory has joined #ocaml
wormphlegm has quit [Remote host closed the connection]
<eye-scuzzy> moin
smerz has quit [Quit: Ex-Chat]
groovy2shoes has quit [Quit: groovy2shoes]
almaisan-away is now known as al-maisan
ulfdoz has quit [Ping timeout: 255 seconds]
ikaros has joined #ocaml
LeNsTR has joined #ocaml
Yoric has joined #ocaml
ymasory has quit [Ping timeout: 240 seconds]
hto has quit [Quit: Lost terminal]
pheredhel has quit [Quit: ZNC by prozac - http://znc.sourceforge.net]
pheredhel has joined #ocaml
al-maisan is now known as almaisan-away
ymasory has joined #ocaml
almaisan-away is now known as al-maisan
edwin has joined #ocaml
Yoric has quit [Quit: Yoric]
ttamttam has joined #ocaml
edwin has quit [Disconnected by services]
edwin1 has joined #ocaml
decaf has quit [Ping timeout: 240 seconds]
ymasory has quit [Ping timeout: 240 seconds]
decaf has joined #ocaml
munga has joined #ocaml
Yoric has joined #ocaml
CoryDambach has quit [Quit: Leaving]
LeNsTR has quit [Quit: LeNsTR]
LeNsTR has joined #ocaml
_andre has joined #ocaml
avsm has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
edwin1 has quit [Remote host closed the connection]
al-maisan is now known as almaisan-away
ftrvxmtrx has joined #ocaml
almaisan-away is now known as al-maisan
munga has quit [Remote host closed the connection]
myu2 has joined #ocaml
edwin has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
al-maisan is now known as almaisan-away
BiDOrD has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
fabjan has joined #ocaml
alexyk has joined #ocaml
WonTu has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
WonTu has left #ocaml []
alexyk has joined #ocaml
oriba has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
drunK has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
almaisan-away is now known as al-maisan
jamii_ has joined #ocaml
<jamii_> im confused by the types for first class modules
<jamii_> I'm porting quickcheck and I want to use first class modules for creating generators
<jamii_> This works fine with simple types
<jamii_> eg val of_numeric : (module Number.Numeric with type t = 'a) -> 'a t
alexyk has joined #ocaml
<jamii_> but I cant figure out how to type this correctly:
<jamii_> val of_enumerable : (module Enum.Enumerable with type enumerable = e) -> 'a t -> 'a e t
al-maisan is now known as almaisan-away
middayc has joined #ocaml
fabjan has quit [Quit: Changing server]
fabjan has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
ccasin has joined #ocaml
<thelema> jamii_: can't be expressed in ocaml's type system
rixed has quit [Quit: reboot]
<jamii_> thelema: was starting to suspect so
<jamii_> seems like a fairly fundamental limitation for first class modules
<jamii_> since i would be able to do it with a record
<jamii_> or would I? hang on...
<mrvn> jamii_: you need to use ('a, e) t or similar.
middayc is now known as refaktor
<mrvn> Problem with allowing 'a 'b t types is what is 'a in: int list array t? Is it int or int list? You quickly run into cases where multiple cases are valid and then which type do you pick?
alexyk has joined #ocaml
<thelema> just like you can't parameterize this sumint : int 'a -> ('c -> 'b -> 'c -> 'b 'a -> 'c) -> int
alexyk has quit [Read error: Connection reset by peer]
<thelema> (i.e. sumint List.fold_left, sumint Array.fold_left, Sumint Map.fold)
<jamii_> yeah, thats pretty much what i want. damn
<mrvn> The same problem arises when you try to add phantom types to containers of phantom types: e.g. for an [`Read] int [`Read] container.
<jamii_> i can write it as a plain function though
<jamii_> let (of_enumerable : ('a -> 'b Enum.t) -> 'a -> 'b Enum.t) enum a = enum a;;
<jamii_> # of_enumerable List.enum;;
<jamii_> - : list '_a -> Batteries.Enum.t '_a = <fun>
<jamii_> but not polymorphically
<thelema> jamii_: correct
<jamii_> this is going to be pain in the ass to work around ...
<mrvn> and first class modules can't add polymorphism to it
<jamii_> so what i was trying to do is this:
<thelema> jamii_: why do you need it, and how is what you want not equivalent to type classes?
<jamii_> thelema: porting quickcheck, to answer both questions
<jamii_> :-P
<jamii_> type 'a gen = size -> seed -> 'a
<thelema> jamii_: already been done
Snark has joined #ocaml
<jamii_> a little. i want to support shrinking and smallcheck style testing as well
refaktor has quit [Quit: Lost terminal]
alexyk has joined #ocaml
<thelema> well, this might make a start. apparently jane street has a quickcheck.ml too, maybe in core...
<jamii_> i can do it without any fancy type features. where i was getting stuck was in trying to make abstract generators
<jamii_> something like Gen.of_enumerable : (module Enum.Enumerable with type enumerable = 'e) -> 'a Gen.t -> 'a 'e Gen.t
<thelema> jamii_: looks like a type class to me
<jamii_> yep
<jamii_> will have to stick it in a functor, I guess
<jamii_> not a terrible burden
alexyk has quit [Read error: Connection reset by peer]
<jamii_> no, i'll can keep most generators as functions eg list : 'a gen -> 'a list gen
<jamii_> but higher order ones like of_enumerable with have to be functors
<jamii_> so the list gen above will be defined like:
<jamii_> module List_gen = Of_enumerable List
<jamii_> list = List_gen.gen
<jamii_> *i can keep
<thelema> ok.
<jamii_> anyway, thanks for helping
<thelema> If you're interested in having your code exercised by a larger project, I'm about to try quickcheck tests in batteries
<jamii_> that would be cool
<jamii_> i'm building it for the facebook hacker cup
<jamii_> the rules really encourage heavy testing
<thelema> I'm planning on using the first quickcheck module, so if you stay mostly compatible with it, I'll be able t oput yours through some paces
<thelema> Apparently ocaml reins also has a quickcheck module (http://ocaml-reins.sourceforge.net/)
<thelema> and "Kaptt = oUnit + {QuickCheck part of Reins}" http://kaputt.x9c.fr/
<thelema> so there's a bunch of people who've had the same idea, to varying degrees of success
elehack|out is now known as elehack
alexyk has joined #ocaml
<jamii_> Kaptt is pretty extensive but I think I'm still going to have to be all NIH
<jamii_> reading through the papers for quickcheck and smallcheck there are a lot of subtle details that go into making good generators
<thelema> jamii_: if you don't mind me making a design requirement, a test harness will be easier to include with batteries if it's a single file.
alexyk has quit [Read error: Connection reset by peer]
<jamii_> i was going to have a single file exporting all the modules. so i guess just dumping them all into one file has the same effect
<jamii_> developing it that way would be a pain in the ass but I can export a version like that
<thelema> good enough
<jamii_> would be nice to make it compatible with ounit but ill worry about that later
alexyk has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
<jamii_> thelema: Big_int doesnt match Numeric
alexyk has quit [Read error: Connection reset by peer]
<jamii_> although it has an operations value which matches Numeric.operations
<jamii_> the float functions are misnamed
<jamii_> # Big_int.operations.of_float 1.0 works
<jamii_> Big_int.of_float 1.0 doesnt
<thelema> jamii_: curious... neither works for me...
<thelema> well, the of_float is just a mistake in the .mli
alexyk has joined #ocaml
<jamii_> thelema: you have to open Number for the first one to work
<jamii_> to get the record definition
<jamii_> i forget i had that open already
<jamii_> similarly, Hashtbl doesnt have a type 'a enumerable
<jamii_> although, yeah, that wouldnt work for the top level
<jamii_> sometimes i get urges for dynamic typing
<thelema> am I crazy, or is there a camomile 0.8.2?
<adrien> I think there should be one
<thelema> camomile.sf.net only shows 0.8.1
alexyk has quit [Read error: Connection reset by peer]
jamii_ has quit [Read error: Connection reset by peer]
jamii_ has joined #ocaml
<jamii_> the handle fell off my cup of tea :(
<thelema> hopefully not catastrophically
<jamii_> or rather, the cup of tea fell of the handle. on to my laptop
<jamii_> i think it will be ok
<jamii_> but ill leave it to dry and work on my netbook for now
<jamii_> but i was about to say that batteries doesnt build with camomil 0.8.2
<jamii_> *camomile
<thelema> "make camomile82" first
<jamii_> i did that - no make target. using batteries 1.2.2, not head, so i guess thats why
<thelema> ah, yes...
<thelema> sorry, need to release again
<jamii_> aaarrghh, even with functors this doesnt work
<jamii_> module Enumerable (E : Enum.Enumerable) =
<jamii_> struct
<jamii_> let rand rand_elem size =
<jamii_> E.of_enum (enum rand_elem size)
<jamii_> end
<jamii_> let list = let module R = Enumerable (List) in R.rand
<jamii_> val list : (int -> '_a) -> int -> '_a Batteries.List.enumerable
<jamii_> sulk
<jamii_> but this works:
<jamii_> module List_rand = Enumerable (List)
<jamii_> let list = List_rand.rand
<jamii_> I think I'm going to stay away from the first class modules until I understand how they work
eye-scuzzy has quit [Quit: leaving]
avsm has quit [Quit: Leaving.]
bzzbzz has quit [Read error: Connection reset by peer]
<thelema> jamii_: that one is easy - just eta expand your first list: let list gen_elem size = let module R = Enumerable (List) in R.rand gen_elem size
<thelema> jamii_: the way I remember this is that if you don't have the parameters, [list] isn't a function, so it can't be polymorphic as you want
<jamii_> thelema: thanks. that does make things easier to understand
<jamii_> so local modules can only contain concrete types?
<jamii_> adding the rand means that the module isn't instantiated until 'a become concrete
<jamii_> s/rand/gen_elem
<thelema> yes
<thelema> that's how polymorphism is guaranteed
<thelema> otherwise you'd be able to do non-polymorphic things in R
<jamii_> ok. makes sense
<thelema> back in a bit
oriba has quit [Quit: Verlassend]
ymasory has joined #ocaml
ttamttam has quit [Remote host closed the connection]
drunK has quit [Remote host closed the connection]
alexyk has joined #ocaml
alexyk has quit [Quit: alexyk]
bzzbzz has joined #ocaml
<jamii_> thelema: does the batteries development mostly happen on github?
ski has quit [Quit: bbl]
infoe has quit [Ping timeout: 255 seconds]
almaisan-away is now known as al-maisan
ftrvxmtrx has joined #ocaml
rudi_s has joined #ocaml
al-maisan is now known as almaisan-away
<jamii_> thelema: code lives at http://scattered-thoughts.net/code/ocamlcheck/
<jamii_> thelema: only generators so far
jamii_ has quit [Quit: Leaving]
Yoric has quit [Quit: Yoric]
myu2 has quit [Ping timeout: 240 seconds]
mikemc has quit [Ping timeout: 272 seconds]
jonathandav has quit [Ping timeout: 272 seconds]
myu2 has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 276 seconds]
<thelema> rwmjones: I was able to provoke a segfault from ocaml_bitstring_extract_fastpath_int16_be_unsigned, I'll post to the google group about it once you accept my request to join
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
<mrvn> range overflow?
alexyk has joined #ocaml
smerz has joined #ocaml
ygrek has joined #ocaml
<rwmjones> ok
_andre has quit [Quit: leaving]
Snark has quit [Quit: Ex-Chat]
ftrvxmtrx has joined #ocaml
lpereira has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
LeNsTR_ has joined #ocaml
LeNsTR_ has quit [Changing host]
LeNsTR_ has joined #ocaml
LeNsTR has quit [Disconnected by services]
LeNsTR_ is now known as LeNsTR
LeNsTR has quit [Quit: LeNsTR]
ygrek has quit [Ping timeout: 240 seconds]
krktz has left #ocaml []
ymasory_ has joined #ocaml
ccasin has quit [Quit: Leaving]
ikaros has quit [Quit: Leave the magic to Houdini]
alexyk has quit [Quit: alexyk]
Yoric has joined #ocaml
ftrvxmtrx has joined #ocaml
oriba has joined #ocaml
edwin has quit [Remote host closed the connection]
Yoric has quit [Quit: Yoric]
ymasory_ has quit [Ping timeout: 265 seconds]
lpereira has quit [Quit: Leaving.]
mnabil has joined #ocaml