flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
hsuh has quit [Remote closed the connection]
tar_ has quit []
tar_ has joined #ocaml
Morphous has joined #ocaml
Axioplase has joined #ocaml
redocdam has quit []
Morphous_ has quit [Read error: 110 (Connection timed out)]
Ched- has quit [Read error: 110 (Connection timed out)]
Ched- has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
tar_ has quit []
tar_ has joined #ocaml
tar_ has quit []
marmotine has quit ["mv marmotine Laurie"]
tar_ has joined #ocaml
tar_ has left #ocaml []
orbitz has quit [Read error: 104 (Connection reset by peer)]
netx303 has left #ocaml []
Axioplase has quit ["/quat"]
bluestorm has joined #ocaml
mishok13 has quit [Read error: 110 (Connection timed out)]
seafood has quit []
<vixey> What are the important issues to think abotu when designing a module system?
seafood has joined #ocaml
Associat0r has quit []
m3ga has quit ["disappearing into the sunset"]
arquebus has joined #ocaml
arquebus has left #ocaml []
arquebus has joined #ocaml
Deffie_ has joined #ocaml
arquebus has left #ocaml []
mishok13 has joined #ocaml
redocdam has joined #ocaml
Deffie_ has quit []
filp has joined #ocaml
det has quit [Remote closed the connection]
gaja has joined #ocaml
b4taylor has joined #ocaml
<b4taylor> It's been a while since I touched ocaml and I'm forgetting something thats gotta be extremely easy.
<b4taylor> Unix.gmtime (Unix.time);;
<b4taylor> This expression has type unit -> float but is here used with type float
<b4taylor> How do I resolve Unix.time to the float value?
<b4taylor> Oh wait.
<b4taylor> gmtime (time ()) ??
<b4taylor> Ahhh, yeah.
<b4taylor> I remember now.
<b4taylor> foo () :: unit -> bar
b4taylor has left #ocaml []
Ched- has quit [Read error: 104 (Connection reset by peer)]
munga__ has quit [Read error: 113 (No route to host)]
Ched- has joined #ocaml
hkBst has joined #ocaml
rwmjones has joined #ocaml
<bluestorm> gildor: are you here ?
<bluestorm> i've been looking at http://wiki.debian.org/Teams/OCamlTaskForce/CamlP4Misc , and i think i may have something useful in that direction
Jedai has joined #ocaml
guillem has joined #ocaml
Associat0r has joined #ocaml
ofaurax has joined #ocaml
asmanur has joined #ocaml
det has joined #ocaml
<gildor> bluestorm: ok, what it is ?
<bluestorm> hm
<bluestorm> about a month ago, i worked on a preliminary version of a "camlp4 extension pack"
<bluestorm> it already provides most of the extension this page was considering for camlp4-misc
<gildor> where it is ?
<bluestorm> but it's not packaged in any sensible way (in particular it's certainly not debian-compatible as-is)
<bluestorm> let me upload it
<gildor> upload where ?
<bluestorm> it's still work-in-progress
<gildor> ok
seafood has quit []
<bluestorm> gildor: there are some design considerations, though, that i'm unsure about
<gildor> which one ?
<bluestorm> hm
<bluestorm> the debian page suggest, as i originally intended, to add "bigger" packages such as patterns or deriving
<bluestorm> i think it could be a better choice to provide a package with library-independent extensions at first
<bluestorm> i don't know about patterns and type-conv, wich could be considered "support libraries" small enough
<gildor> bluestorm: you know it is a do-ocracy, if what you provide is good enough, you can dictate the law
<bluestorm> but deriving and sexplib are quite big, and i suspect including them would increase the synchronization work quite a lot
<gildor> FYi, sexplib is already a debian package
<gildor> i am not sure to understand however, all the syntax extension work with OCaml camlp4 >= 3.10
<bluestorm> hm
<bluestorm> most of martin jambon p4ck extensions are not camlp4 >= 3.10 compatible
<vixey> is there a channel which people talk about module systems and design ?
<bluestorm> vixey: i'm not sure there is
<bluestorm> but there are some papers about that on the caml website
<vixey> oh excellent, thank you
<gildor> because in description.txt "Those extension are camlp4>=3.10 extensions"
<gildor> and in status.txt "pa_compr : <3.10"
<bluestorm> gildor: yeah, sorry
<bluestorm> <3.10 mean "not included"
<bluestorm> gildor: do you have any suggestion for some kind of quality control ?
<bluestorm> i've created/included a test.ml file when available , but it's very heterogeneous
<gildor> what is the difference between osr_camlp4 and p4ck ?
<bluestorm> gildor: p4ck is a distribution of pre-3.10 syntax extensions, wich a light packaging mechanism
<gildor> QA -> you should do tests for 1 extension and give it back to upstream author
<bluestorm> osr_camlp4 is this work (the name was hype-suggested and i'm not so serious about it)
<bluestorm> basically provides >=3.10 extensions, with a common osr-compilant META file , and a p4ck-derived description
<bluestorm> i thought i could maybe get it into GODI someday, so as-is it's not debian-aimed
<gildor> you should contribute back the META file to upstream author
<bluestorm> hm
<bluestorm> that's a good idea
<vixey> Is there anywhere that the source code from the book ATTAPL is available?
<bluestorm> the only upstream contact i've had for now is to ask for legal information in one case
tsuyoshi has quit [Remote closed the connection]
<gildor> it is better to send your change to upstream because it will lighten the work of synchronization in the future
<gildor> and let other people benefit from your work even when not using your package
<gildor> i don't see why this package should not go in debian... there is no notion of "targetted to debian"
<gildor> expect if you publish a term in your license against this
<bluestorm> of course
<gildor> but since your are packaging data from other people, i recommend you to have a list of licenses/upstream author
<gildor> something like "copyright file"
lauanana has joined #ocaml
<gildor> but as a general advice, i really recommend you to contribute everything you can to upstream
<bluestorm> i'm going to do that
<gildor> do you use any SCM/bug tracking
<bluestorm> not yet
lauanana has quit [Client Quit]
<gildor> maybe you should consider hosting you SCM on ocamlcore.org
<gildor> it will be easier to let other people help you
<gildor> (well you can use any other forge site, but i am making advertisement for this one ;-)
<bluestorm> :p
<asmanur> gildor: what SCM does ocamlcore provide ?
<gildor> for now: svn, cvs (native) bzr, darcs, git (tested) hg (possible)
<asmanur> hum ok
<gildor> svn and cvs are automatically created from gforge and well integrated
<gildor> the other are here but not integrated to gforge
<gildor> (except for group/user management)
<asmanur> it sounds pretty interesting
ofaurax has quit ["Leaving"]
jlouis has quit ["Leaving"]
redocdam has quit []
damg has joined #ocaml
jlouis has joined #ocaml
<damg> ld cannot find -lGL , does is only search for plain .so files and never for e.g. so.1.2?
mishok13 has quit [Read error: 104 (Connection reset by peer)]
oc13 has joined #ocaml
mishok13 has joined #ocaml
oc13 has quit [Read error: 110 (Connection timed out)]
tsuyoshi has joined #ocaml
vbmithr has joined #ocaml
<vbmithr> Hello
<gildor> vbmithr: hi
damg has quit [Read error: 113 (No route to host)]
redocdam has joined #ocaml
oc13 has joined #ocaml
redocdam has quit []
oc13 has quit [Read error: 110 (Connection timed out)]
Associat0r has quit []
asmanur has quit [Read error: 110 (Connection timed out)]
marmotine has joined #ocaml
det has quit [Remote closed the connection]
sponge45 has joined #ocaml
oc13 has joined #ocaml
<rwmjones> gildor: ping
<gildor> rwmjones: pong
<Jeff_123> lazy ping
det has joined #ocaml
oc13 has quit [Remote closed the connection]
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
seafood has joined #ocaml
tar_ has joined #ocaml
_andre has joined #ocaml
<_andre> hello
<_andre> say i have two types defined like this:
<_andre> type a = { x: int; foo: b } and b = { y: int; bar: a }
munga_ has joined #ocaml
<_andre> is it possible to move the definition of type a to a.ml and the one of type b to b.ml and still make it work?
seafood has quit []
RobertFischer has joined #ocaml
<Jedai> _andre: Yeah, if you import b.ml in a.ml
<Jedai> And b.ml export the type b
<Jedai> Ah no forget it, it's mutually recursive, I don't know how OCaml handle it (only Haskell)
<vixey> I think you have to have them in modules
<_andre> how do you mean?
asmanur has joined #ocaml
romanoffi has joined #ocaml
pants1 has quit [Read error: 110 (Connection timed out)]
<kig> http://glimr.rubyforge.org/cake/prelude.ml been going through the "rewrite stdlib"-phase of ocaml development
<vixey> kig, why :(
filp has quit ["Bye"]
<RobertFischer> kig: Phase 1 is using too many semicolons. Phase 2 is exposing underlying modules (recursive modules). Phase 3 is rewriting stdlib. :)
ecc_ has joined #ocaml
ecc_ has quit [Client Quit]
Naked is now known as Hadaka
Snrrrub has joined #ocaml
munga_ has quit ["Ex-Chat"]
authentic has quit [Read error: 104 (Connection reset by peer)]
<bluestorm> kig:
<bluestorm> | [] -> failwith "foldr1"
<bluestorm> you should use invalid_arg
<bluestorm> (imho, fold_right : ('a -> 'b -> 'b) -> ('a t -> 'b -> 'b) is the good parameter order)
Kopophex has joined #ocaml
hcarty has quit ["leaving"]
LordMetroid has joined #ocaml
redocdam has joined #ocaml
Axioplase_ is now known as Axioplase
arquebus has joined #ocaml
CrawfordComeaux has joined #ocaml
jeremiah has quit []
<CrawfordComeaux> I want to have a list that contains ever-changing preconditions required for a function. Would the best way to implement this be to simply store the conditions as a string that build a parser for?
<bluestorm> hm
RobertFischer has left #ocaml []
<bluestorm> CrawfordComeaux: can you not represent them a closures ?
<bluestorm> if your function is 'a -> 'b , then a ('a -> bool) list could be enough
<bluestorm> (that suppose uncurrified functions)
<CrawfordComeaux> ok
<CrawfordComeaux> apparently I need rest...I should've known how to do that
* rwmjones wants jacques garrigue to answer the question about extending immediate objects ...
<kig> bluestorm: good point on invalid_arg, thanks. imho, the list-last arg order of foldr is more in line with the rest of the list funcs (plus i started it as a port of haskell's prelude, which uses the list-last arg order)
<bluestorm> rwmjones: weren't you impressed by the ugly Obj.magic solution ?
<rwmjones> heh ... no because basically it's not type safe :-(
<rwmjones> the point is to have a typesafe solution, and casting the return value is not that
hcarty has joined #ocaml
<rwmjones> bluestorm, your answer to the 'what is the current function' question is the one I thought about too, but surely the same information is available, at least in bytecode, using whatever the stacktrace mechanism uses
<bluestorm> rwmjones: you're right, but i don't think this code is easy to access from the outside
<bluestorm> whereas camlp4 is quite comfortable in that aspect
mishok13 has quit [Read error: 104 (Connection reset by peer)]
<tar_> I have a Map from int * int that I want to initialize with the coordinates of a 9x9 grid ((0, 0), (0, 1), ...).
<tar_> I'd like to do it concisely, but the best I've gotten so far is http://pastie.org/233102 (making functions init_square, init_col, and init_grid)
arquebus has left #ocaml []
<rwmjones> uh oh, university exercise?
<bluestorm> sudoku ?
<bluestorm> tar_: i suggest a reference and two for loops
<tar_> bluestorm got it <--
<tar_> Oh, that would work
<Jeff_123> ewww loops
<bluestorm> :]
<bluestorm> the other solution would be to declare a seq : int -> int -> int list primitive and use it for good
authentic has joined #ocaml
<tar_> bluestorm: Could you explain that a little more?
<bluestorm> tar_:
<bluestorm> let seq = Array.to_list (Array.init 9 (fun x -> x)) in List.fold_right (fun x -> List.fold_right (fun y -> M.add (x, y) seq) seq) seq M.empty
<bluestorm> my idea was to have a seq 1 9 = [1; 2; ..; 8; 9]
<bluestorm> but actually you only use [0...8] so a value is fine
<bluestorm> tar_: actually, if you want your sudoku to be efficient, i would suggest you use an int list array array instead
<bluestorm> tar_: your init_grid () function (why "()" btw ?) is quite exactly a fold_left
<bluestorm> as your init_col actually
<tar_> Hrm.
<bluestorm> if you're not already familiar with fold_[left/right], you should play with them a little, it's quite cool and good exercise
<tar_> It's still so new I hadn't thought of them. Actually, I was about to rewrite those to take a function and then it really would have been fold_left.
<tar_> The () was because my editor's syntax coloring seemed to fail without any arguments listed. :)
<kig> unfoldl (lt 9) (fun x -> (map (tuple x) (0--8), x+1)) 0
<bluestorm> kig: cheater.
<kig> tee-hee
<kig> it's still far from the haskell [(x, y) | x <- [0..8], y <- [0..8]], though :/
TypedLambda has joined #ocaml
* tar_ switches to Haskell
<bluestorm> tar_: no need
<tar_> I thought I'd seen a sole () argument in the standard library somewhere. Is that for when refs are involved?
<bluestorm> you add a sole () argument when you don't want your declaration to be an immediate value
<tar_> I may also be remembering wrong..
<bluestorm> for example
<bluestorm> let foo = print_endline "Hello World !"
<bluestorm> will be executed once
<tar_> Ah
<bluestorm> le foo () = print_endline "Hello World"
<bluestorm> will be executed on callsite
<tar_> Oh yeah, I think it was print_newline
^authentic has joined #ocaml
<bluestorm> kig:
<bluestorm> $ camlp4o Camlp4Parsers/Camlp4ListComprehension.cmo -str '[(x, y) | x <- 0--8; y <- 0--8]'
<bluestorm> List.concat
<bluestorm> (List.map (fun x -> List.map (fun y -> (x, y)) (0 -- 8)) (0 -- 8))
<kig> nice
<tar_> hey..
<bluestorm> tar_: regarding "your editor coloring", iirc tuareg won't highlight the immediate values (or thought so) and the functions wich explicit parameters the same way
<bluestorm> but that should not influence the way you code
<kig> and my head went weird from writing too many unfolding examples. two maps better
<tar_> Where did you get --?
<bluestorm> tar_: he declared it himself
mfp_ is now known as mfp
<bluestorm> let (--) a b = Array.to_list (Array.init (b - a + 1) ((+) a))
<bluestorm> or let rec (--) a b = if a < b then a :: (a + 1) -- b else if a > b then a :: (a - 1) -- b else [b] if you want both directions
CrawfordComeaux has quit ["http://www.mibbit.com ajax IRC Client"]
<bluestorm> tar_: if you used a matrix instead of a map, Array.init 9 (fun _ -> Array.init 9 (fun _ -> 1 -- 9)) would be enough
<bluestorm> hm
<bluestorm> or even Array.init 9 (fun _ -> Array.make 9 (1--9))
authentic has quit [Connection timed out]
^authentic is now known as authentic
<vbmithr> Someone knows a program that generate interfaces
<vbmithr> mli files corresponding to ml files ?
<bluestorm> ocamlc -i
^authentic has joined #ocaml
tar_ has left #ocaml []
<vbmithr> thank you
Linktim has joined #ocaml
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
mattc58 has joined #ocaml
ChristopheT has joined #ocaml
ChristopheT has left #ocaml []
bluestorm has quit [Remote closed the connection]
^authentic has joined #ocaml
mattc58 has left #ocaml []
hcarty has left #ocaml []
hcarty has joined #ocaml
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
tar_ has joined #ocaml
marmotine has quit ["mv marmotine Laurie"]
tomh has joined #ocaml
r0bby has joined #ocaml
msandin has joined #ocaml
asmanur has quit [Remote closed the connection]
tar_ has left #ocaml []
_andre has quit ["leaving"]
Linktim has quit ["Quitte"]
rwmjones has quit ["Closed connection"]
tar_ has joined #ocaml
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
|jedai| has joined #ocaml
msandin has quit ["Leaving."]
Jedai has quit [Read error: 104 (Connection reset by peer)]
hkBst has quit ["Konversation terminated!"]
m3ga has joined #ocaml
rwmjones has joined #ocaml
seafood has joined #ocaml
Axioplase is now known as Axioplase_
m3ga has quit ["disappearing into the sunset"]