newbie has quit ["KVIrc Insomnia 4.0.0, revision: , sources date: 20090520, built on: 2009/06/08 23:52:48 UTC http://www.kvirc.net/"]
seafood has joined #ocaml
CapitalisTux has quit [Remote closed the connection]
Asmadeus has quit [Remote closed the connection]
seafood has quit []
slash_ has quit [Client Quit]
yziquel has quit [Ping timeout: 180 seconds]
tmaedaZ is now known as tmaeda0
julm_ has joined #ocaml
caligula__ has quit [Read error: 131 (Connection reset by peer)]
caligula__ has joined #ocaml
julm has quit [Read error: 110 (Connection timed out)]
julm_ is now known as julm
tmaeda0 is now known as tmaeda
bscofield|away has left #ocaml []
willb has joined #ocaml
thrasibule has joined #ocaml
thrasibule has quit [Read error: 60 (Operation timed out)]
m3ga has joined #ocaml
<m3ga>
is there something like haskell's hoogle for ocaml? hoogle lets me specify a function signature and it will list all the functions that satisfy the signature.
<orbitz>
not as far as I know
<m3ga>
well i just wrote one and added it to my own personal standard library
caligula__ has quit [Read error: 54 (Connection reset by peer)]
caligula__ has joined #ocaml
julm_ has joined #ocaml
julm has quit [Read error: 113 (No route to host)]
caligula_ has joined #ocaml
<thelema>
m3ga: would it fit into the batteries project?
<m3ga>
let from_option default opt = function None -> default | Some x -> x
<m3ga>
its pretty trivial :-)
<thelema>
oh, I think we already have that in batteries. I thought you had written some sort of hoogle for ocaml
<m3ga>
oh shit no. hoogle is large and complicated :-)
<thelema>
Option.default: 'a -> 'a option -> 'a
<m3ga>
the one above is wrong. should be
<m3ga>
let from_option default opt = match opt with None -> default | Some x -> x
<m3ga>
hmm, i should check out batteries
<thelema>
or [let from_option default = function None -> default | Some x -> x
<m3ga>
yeah, point free. thats what i meant.
<thelema>
batteries should have AAA batteries soon, a lighter version with much fewer dependencies, easier to manually install and use
<thelema>
that's not point free - both arguments are there, the second is matched through the function keyword
<m3ga>
are there debian or ubuntu package for batteries yet? seems to be missing from jaunty (9.04)
<thelema>
(fun x -> match x with) == (function)
<m3ga>
libbatteries-ocaml-dev is in Debian unstable
<m3ga>
might try back porting the package to hardy and dapper
<thelema>
if you're able, it wouldn't hurt.
caligula__ has quit [Read error: 110 (Connection timed out)]
<orbitz>
m3ga: or keep yoru first but get rid of the 'opt' param
<orbitz>
I'm trying to write a CLI parser that is aware of types (so you can say option x will hav ea parameter of type int). I can do this via a an ADT since I want to support only basic types, but is there any way i can store the result of parsing and validate in a way that is queriable and get the typ eback rather than a wrapper ADT?
<orbitz>
basicaly i'd like the API to look like OptParser.get "option" options, and not have to match on every type since it should know "option" is of type int
<orbitz>
unless someone has a superior usggestion
<thelema>
you want to use the string "option" to denote a datatype in your CLI parser?
<orbitz>
no
<orbitz>
option would be the name o that is given on the command line
<orbitz>
so i would like to do something like: myprogram -option=2
<orbitz>
then <insert part magic> let x = OptParser.get "option" options + 10 and x owuld be 12
<orbitz>
obviously this wouldn't really work since OptParser.get has a defined type, but i'mcurious if there is anyway i can get to that goal
<thelema>
I've always defined some "global" variables or some sort of config struct that's modified by the args
<thelema>
there's some magic type things that can allow you to construct something like "option" except it has value <something> -> int
<thelema>
I forget what they're called, though.
<orbitz>
like how printf does it?
<orbitz>
I could do OptParser.get(Int/Bool/String/Whatever) and have it throw an exception if the optino is no tof that type. that seems workable since, as the developer i should know the type. some sort of compile time check would be awesome though
<orbitz>
may require too much magic though
<orbitz>
(for me)
<thelema>
There's some way to have a generator that will produce a get_option function for each "option" with the right type
<orbitz>
hrm
<thelema>
just do getInt/Bool or do things the arg/arg2 way
<orbitz>
any suggestions on where to look for that?
<thelema>
archives of the mailing list, last 2 months
<orbitz>
ok
<orbitz>
probably too much magic of rme, but looking at it might be cool
<orbitz>
thelema: i could do soem camlp4 or whatever it is caleld magi ci suppose right?
<thelema>
camlp4 is hackish
<orbitz>
any key word suggestsion for mailing list serach?
* thelema
checks somewhere...
<orbitz>
what woul dbe cool, but mos tlikely of little benefit, is to be able to specify ones own types for an option, have all the validation hapen, then get a get_foo function that gives them their type back
<orbitz>
"The consequence is a type safe property list working for any type. When you get the hang of these, many of the usual tricks from dynamically typed languages become possible. But in a type-safe way"
<orbitz>
neat!
flx__ has joined #ocaml
flux has quit [Read error: 104 (Connection reset by peer)]
jeddhaberstro has joined #ocaml
bluestorm has joined #ocaml
julm_ has quit ["ododo"]
dyaso has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
f[x] has joined #ocaml
adrien has joined #ocaml
adrien is now known as Camarade_Tux
jeddhaberstro has quit [Client Quit]
onigiri has quit [Client Quit]
Yoric[DT] has joined #ocaml
<bluestorm>
ORDER BY support pushed.
<Yoric[DT]>
cool :)
f[x] has quit [Read error: 110 (Connection timed out)]
hkBst has joined #ocaml
f[x] has joined #ocaml
<flx__>
bluestorm, ooh
<flx__>
I just installed the beta, but haven't tried it out
<flx__>
bluestorm, have you thought about going the full circle, and providing an embedded language that would also look like SQL?
<flx__>
but still (somehow ;-)) allow composability etc
<bluestorm>
yes I have
<bluestorm>
there are several layers inside macaque
<bluestorm>
when I designed the internal representation, I tried to make sure that other concrete syntaxes would be possible
<bluestorm>
It is perfectly possible to design a SQL-like syntax instead of comprehensions
<bluestorm>
(my internship was about comprehension so I didn't, and I'm not sure I'm gonna do that : with the school-year starting soon, my development time will be much reduced and I'd prefer to stay in maintenance mode; Of course, external contributions would be more than appreciated)
<flx__>
bluestorm, great! I hope you'll find the time for the maintenance atleast ;)
sramsay has joined #ocaml
<flx__>
bluestorm, so returning to my earlier question, is there a darcs repository around? /lastlog seems to suggest there is, but no url?
_zack has joined #ocaml
Amorphous has quit [wolfe.freenode.net irc.freenode.net]
mellum has quit [wolfe.freenode.net irc.freenode.net]
cmeme has quit [wolfe.freenode.net irc.freenode.net]
mellum has joined #ocaml
Amorphous has joined #ocaml
cmeme has joined #ocaml
rwmjones has joined #ocaml
wzp|afk is now known as wzp
rwmjones_ has joined #ocaml
<bluestorm>
rwmjones: ping
sramsay has quit [Remote closed the connection]
<bluestorm>
(not very important, an in-transition state of translation thing, and checking that you don't mind if I need to hierarchize the titles structure a bit)
<rwmjones>
bluestorm, pong
<rwmjones>
yeah i don't mind
<bluestorm>
ok, fine
<bluestorm>
I've got a "pre-publication" version in a markdown-like format, if you're interested
dyaso has quit [Remote closed the connection]
f[x] has quit [Read error: 110 (Connection timed out)]
Asmadeus has joined #ocaml
Asmadeus has quit [Remote closed the connection]
_zack has quit [Read error: 104 (Connection reset by peer)]
Asmadeus has joined #ocaml
tmaeda is now known as tmaedaZ
hkBst has quit [Remote closed the connection]
<bluestorm>
flx__: I use cvs.forge.ocamlcore.org:/darcsroot/macaque/macaque
<flx__>
bluestorm, hm, can it be accessed with http?
BiDOrD has quit [Read error: 110 (Connection timed out)]
<bluestorm>
i'm not sure
<bluestorm>
if you have registered on the forge you can certainly access it by SSH
<Camarade_Tux>
gildor: wasn't there some news recently? maybe that the transition was over?
<gildor>
bluestorm: i think the problem was that my /etc/cron.hourly/darcsweb-update.sh should not end with .sh
<gildor>
bluestorm: will check in the next hour if it is correct
<bluestorm>
:p
<bluestorm>
thanks a lot
<gildor>
Camarade_Tux: 3.11.1 is finished
<gildor>
debian is always up-to-date ;-)
<Camarade_Tux>
probably that :)
<Camarade_Tux>
he ;p
<Camarade_Tux>
but it's maybe more up-to-date that godi ;)
<gildor>
i think we have more manpower in debian and binary distribution is easier to manage
<gildor>
(then godi)
<Camarade_Tux>
and godi is slow so that makes you avoid running it as much as possible
<bluestorm>
and the godi_console interface would probably benefit from a bit of polish
Yoric[DT] has quit ["Ex-Chat"]
<Camarade_Tux>
I think I'm still not completely used to it but maybe I should read the doc
* Camarade_Tux
whistles
Hydrant has quit [Remote closed the connection]
wzp has joined #ocaml
det has quit [Remote closed the connection]
tmaeda is now known as tmaedaZ
tmaedaZ is now known as tmaeda
slash_ has joined #ocaml
det has joined #ocaml
petchema has quit [Remote closed the connection]
_zack has quit ["Leaving."]
julm has joined #ocaml
sramsay has joined #ocaml
Yoric[DT] has joined #ocaml
ulfdoz has joined #ocaml
* thelema
wonders if it's common to use a hashtbl + Vect.t to implement bidirectional 'a <-> int mappings
<thelema>
I guess I'm really using the ints as a type of pointer, so I can have my collection of main structures in an array, and have parallel arrays with various attributes
<thelema>
And if I have a pointer to a main structure, I can look up its attributes
<bluestorm>
thelema: I sometimes think of such a bijection, but have never used one in practice
<thelema>
In a weakly typed language, I'd make some sort of dictionary and put the object and all its properties in that dictionary
<thelema>
I don't see an easy way to do this in ocaml.
<bluestorm>
can't you put the attributes in a hashtable indexed by the main structure ?
<thelema>
the attributes are of varying type
<thelema>
I guess I could use polymorphic variants... hmmm
<bluestorm>
(or objects with subtyping)
<thelema>
an array [0..n] of hashtables ["property name"] of polymorphic variants `Property foo
<bluestorm>
hum
<thelema>
a bit ugly to get the properties...
<thelema>
wasn't there some code out there for doing strongly typed property lists...
<bluestorm>
with an auxiliary function
<bluestorm>
yes there is, see mfp blog
* thelema
is exactly doing this - decorating a tree in multiple passes
<thelema>
I'm just trying to figure out why the implementation uses a hashtbl indexed by ints
<thelema>
indexed by ints 0..n
<bluestorm>
hum
<bluestorm>
can't you put the decorations inside the tree data structure, by using an open data type ?
<bluestorm>
(ie. a type with an unused type parameter wich you can use to inject arbitrary data)
<thelema>
that'll require a lot of nesting of data structures - in order to get to the last set decoration, I have to go through all the previous decorations
<bluestorm>
not if you use an object type to extand the previous data with a new annotation
<thelema>
ick.
<bluestorm>
(expand or extend)
<bluestorm>
well I don't think an object type is any more icky than a polymorphic variant
<bluestorm>
they're both extensible types, product and sum
Ched has quit [Read error: 113 (No route to host)]
Ched has joined #ocaml
julm_ has joined #ocaml
Submarine has joined #ocaml
Submarine_ has joined #ocaml
Snark has quit ["Ex-Chat"]
Submarine_ has quit [Client Quit]
julm_ has quit [Read error: 54 (Connection reset by peer)]
julm has quit [Read error: 60 (Operation timed out)]
smimou has quit ["bli"]
julm has joined #ocaml
hkBst has joined #ocaml
julm has quit [Read error: 131 (Connection reset by peer)]
julm has joined #ocaml
karasuman has joined #ocaml
<karasuman>
I barely know what I'm doing, so please correct me if I say something that doesn't make sense. I'm running HOL Light in ocaml in a terminal shell. Is there a way to use the arrow keys to move through the document, or is there any way to move through the document other than backspacing? it's tiresome, having to retype so much to fix an error
<bluestorm>
karasuman: rlwrap is what you want
<thelema>
seconded.
<bluestorm>
it's an external program that wrap an interactive toplevel and add editing capabilities
<bluestorm>
there is also an OCaml-specific version wich I don't remember right now
<bluestorm>
install it and then use "rlwrap ocaml ..."
<Camarade_Tux>
(ledit)
<karasuman>
Okay. I was hoping to be able to stick to the terminal; I like it. -_-() Thank you.
<bluestorm>
karasuman: that's the terminal
<karasuman>
I've had some success with emacs, but I hate it.
<bluestorm>
only less painful to use
<bluestorm>
just try it and you'll see
<karasuman>
Oh!
<karasuman>
It just finished installing! Thank you!
<karasuman>
That's exactly what I wanted. :)
<karasuman>
So I start it up with rlwrap ocaml every time?
<karasuman>
I don't suppose you have any suggestions for a checkpointing program so I don't have to load the hol.ml file every time? that would be too miraculous. ;)
<bluestorm>
you can compile hol.ml
<bluestorm>
then load the compiled binaries
<bluestorm>
this is well known among HOL users (wich I'm not) and I recall seeing a tutorial about this
<bluestorm>
basically, it's something like
<bluestorm>
ocamlc -c hol.ml
<bluestorm>
ocaml hol.cmo ...
<karasuman>
Hm, I'll look into that more. The document I had recommends a checkpoint program that's apparently not supported any longer. I really appreciate the advice. The hardest part is always getting off the ground.
julm_ has joined #ocaml
<bluestorm>
there is also the ocamlnat approach, but I suppose it's still experimental
<karasuman>
I stumbled upon that. I'm using an earlier version of ocaml because of compatibility with hol light
julm has quit [Read error: 60 (Operation timed out)]
<karasuman>
just to be clear, I've already installed ocaml and hol light and have them more or less working; what I'm trying to do with loading hol.ml faster comes after that, right? it's not a replacement installation?
<bluestorm>
yes
<bluestorm>
actually there are two different approaches
<bluestorm>
my proposition was to precompile the hol file, then load the compiled bytecode instead of the source file
<bluestorm>
wich is faster, but still gives some work at startup
<karasuman>
ok.
<bluestorm>
the checkpointing approach is apparently to take a live image of the toplevel state after hol loading; it probably gives even faster startup, but I don't know the tools involved
<bluestorm>
(finally, there is the ocamlnat approach, wich is to use a native toplevel instead of the usual bytecode toplevel, wich probably do not speed startup, but could make further computation significantly faster; that needs a recent OCaml version, an experimental HOL version, and is probably bleeding-edge and possibly unstable)
<karasuman>
That seems to be the issue. The only checkpointing programs I can find require me to do...things...that I don't know how to do. I only got ocaml and hol light working with explicit instructions.
<karasuman>
ha, I saw that. I think I'll stick to the version of hol that my professor is using. :)
<bluestorm>
i suggest you go for the precompilation for now, if you can affort the delay at startup
<karasuman>
Thanks. I'm looking into that. Right now, it takes like five minutes to load hol.ml; improving that would be really handy.
<bluestorm>
hah :p
<karasuman>
I appreciate all of the help :)
f[x] has quit [Read error: 110 (Connection timed out)]
<bluestorm>
hum
<bluestorm>
karasuman: i had a quick look at HOL sources, and I'm under the impression precompilation isn't easy, as Hol use toplevel-specific features
<karasuman>
Maybe that's why there isn't mention of it on the project's homepage. :(
bzzbzz has quit ["leaving"]
maskd has quit [wolfe.freenode.net irc.freenode.net]
sramsay has quit [wolfe.freenode.net irc.freenode.net]
jimmyb2187 has quit [wolfe.freenode.net irc.freenode.net]
cmeme has quit [wolfe.freenode.net irc.freenode.net]
gildor has quit [wolfe.freenode.net irc.freenode.net]
sramsay has joined #ocaml
jimmyb2187 has joined #ocaml
cmeme has joined #ocaml
gildor has joined #ocaml
maskd has joined #ocaml
julm has joined #ocaml
Narrenschiff has joined #ocaml
Submarine has quit [Remote closed the connection]
ulfdoz has quit [Read error: 110 (Connection timed out)]
julm_ has quit [Read error: 110 (Connection timed out)]
onigiri has joined #ocaml
bombshelter13_ has quit []
Yoric[DT] has quit ["Ex-Chat"]
det has quit [Read error: 104 (Connection reset by peer)]
det has joined #ocaml
karasuman is now known as kara-40-out
<bluestorm>
kara-40-out: in case you're interested, I've done little precompilation hacks and it seems it could speed up startup time significantly indeed
<bluestorm>
(i've done it manually for the first 15 files or so, wich loading time goes from 7.5s to 1.5s on my computer)
Alpounet has joined #ocaml
<Alpounet>
hi
<bluestorm>
apparently it doesn't compress long computation times much
<bluestorm>
arith.ml wich needed 5.5s now takes 4.4s
julm has quit [Read error: 60 (Operation timed out)]
julm has joined #ocaml
davidL has joined #ocaml
<davidL>
is there a good introduction to OCaml for those already proficient with Haskell?
<Alpounet>
there isn't any "gentle intro to OCaml"
<Alpounet>
but I think any OCaml tutorial will do it, if you're familiar with Haskell.
<Alpounet>
you'll just have to get used to impurity, the lack of monads (though we have some of them in Batteries), ...
<bluestorm>
davidL: reading the official manual might even work