banisterfiend has quit [Ping timeout: 260 seconds]
banisterfiend has joined #ocaml
zeenix has joined #ocaml
Pip has left #ocaml []
banisterfiend has quit [Ping timeout: 240 seconds]
CoryDambach has joined #ocaml
opla2 has joined #ocaml
banisterfiend has joined #ocaml
banisterfiend is now known as horsewhisper
Amorphous has quit [Ping timeout: 272 seconds]
opla2 is now known as Squarism
Amorphous has joined #ocaml
horsewhisper is now known as banisterfiend
banisterfiend is now known as horsewhisper
drunK has quit [Remote host closed the connection]
horsewhisper is now known as banisterfiend
joewilliams_away is now known as joewilliams
joewilliams is now known as joewilliams_away
banisterfiend is now known as horsewhisper
dskippy has joined #ocaml
Pip has joined #ocaml
<Pip>
fun P1 ... Pn -> expression
<Pip>
This is a legacy definition format of function ?
<julm>
syntactic sugar for: fun P1 -> .. fun Pn -> expression
<mrvn>
It's the reason why ocaml is so much "fun"
<Pip>
lol
Squarism has quit [Ping timeout: 250 seconds]
<dskippy>
What do you guys usually do when you've written a module and you want to play with it in the REPL?
<dskippy>
I'm used to typing "interpreter ModuleFile" and then calling some of my functions in the REPL. Does Ocaml have a feature like this?
<dskippy>
One command way to load a module into the REPL
<flux>
#use
<flux>
I often just use emacs and it's "send current buffer to ocaml toplevel"
<dskippy>
flux: Thanks.
<dskippy>
flux: Is there a way to start the interpretering using a module?
<dskippy>
Man ocaml has no reference to the use feature. I guess not.
<flux>
I guess the actual manual has
<flux>
which is a pretty much good read in any case, covering OCAMLRUNPARAM for instance
ikaros has joined #ocaml
Pip has quit [Quit: It's not my problem.]
unkanon has quit [Quit: leaving]
dskippy1 has joined #ocaml
dskippy has quit [Ping timeout: 255 seconds]
Yoric has joined #ocaml
dskippy1 has left #ocaml []
ikaros has quit [Quit: Leave the magic to Houdini]
horsewhisper is now known as banisterfiend
ftrvxmtrx has quit [Quit: Leaving]
Yoric has quit [Quit: Yoric]
ygrek has joined #ocaml
Edward__ has joined #ocaml
edwin has joined #ocaml
Edward__ has quit []
ftrvxmtrx has joined #ocaml
seafood has joined #ocaml
seafood has quit [Ping timeout: 250 seconds]
Yoric has joined #ocaml
ttamttam has joined #ocaml
yezariaely has joined #ocaml
_andre has joined #ocaml
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
Snark_ has joined #ocaml
Snark_ is now known as Snark
ski has quit [Ping timeout: 264 seconds]
yezariaely has left #ocaml []
ski has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
mfp has joined #ocaml
lewis1711 has joined #ocaml
<lewis1711>
the other day someone here told me the ocaml developers don't want to have a uniform interface for lists and strings, etc. why is that?
<banisterfiend>
lewis1711: hey little one
<lewis1711>
hi
<kaustuv>
lewis1711: one big difference between lists and strings in OCaml is that strings are mutable while lists aren't
ski has quit [Ping timeout: 264 seconds]
<lewis1711>
oh yes. and that didn't make sense to me
<kaustuv>
Also, since strings are not lists of characters in OCaml, if you want to implement a function such as nth uniformly across lists and strings, you would need ad hoc polymorphism (i.e., type classes)
<lewis1711>
or two functions with the same name
<kaustuv>
Sure, but it's not the same interface then. The types are different.
<lewis1711>
ah
<lewis1711>
I just meant the same names that do the same thing, even if they're not *really* the same thing
<kaustuv>
I believe Batteries Included does something like that.
<Axioplase_>
Do Batteries extend the language or redefine bits of it? Or is it 100% user-level code?
ski has joined #ocaml
<kaustuv>
It doesn't extend the language by default, through there are some Camlp4 extensions. I think it's almost 100% OCaml, but there might be one or two foreign functions
lamawithonel has quit [Read error: Connection reset by peer]
emias has quit [Quit: Changing server]
emias has joined #ocaml
almaisan-away is now known as al-maisan
Amorphous has quit [*.net *.split]
shachaf has quit [*.net *.split]
rwmjones has quit [*.net *.split]
fremo__ has quit [*.net *.split]
noj has quit [*.net *.split]
rudi_s has quit [*.net *.split]
avsm2 has quit [*.net *.split]
npouillard has quit [*.net *.split]
ttamttam has quit [Ping timeout: 250 seconds]
Amorphous has joined #ocaml
shachaf has joined #ocaml
rwmjones has joined #ocaml
fremo__ has joined #ocaml
noj has joined #ocaml
rudi_s has joined #ocaml
avsm2 has joined #ocaml
npouillard has joined #ocaml
al-maisan is now known as almaisan-away
cods has quit [Changing host]
cods has joined #ocaml
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ocaml
almaisan-away is now known as al-maisan
fraggle_laptop has joined #ocaml
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ocaml
jm_ocaml has joined #ocaml
ikaros has joined #ocaml
avsm has quit [Quit: Leaving.]
CoryDambach has quit [Quit: Leaving]
metasyntax` has joined #ocaml
tmaeda has quit [Ping timeout: 255 seconds]
tmaeda has joined #ocaml
avsm has joined #ocaml
ttamttam has joined #ocaml
oriba has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
joewilliams_away is now known as joewilliams
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
Yoric_ has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric_ is now known as Yoric
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
jonafan has joined #ocaml
smerz has joined #ocaml
avsm has quit [Quit: Leaving.]
<hcarty>
Axioplase_: Batteries is a library + a few optional camlp4 extensions. It sits on top of OCaml, it doesn't modify the language/compiler itself.
al-maisan is now known as almaisan-away
avsm has joined #ocaml
sgnb has quit [Remote host closed the connection]
sgnb has joined #ocaml
mfp has quit [Ping timeout: 276 seconds]
<hcarty>
adrien: Is there a reference for creating packages for yypkg?
myu2 has quit [Remote host closed the connection]
joewilliams is now known as joewilliams_away
mfp has joined #ocaml
joewilliams_away is now known as joewilliams
<adrien>
hcarty: are you used to making packages in general? (setting DESTDIR and others)
fraggle_laptop has quit [Quit: Quitte]
ftrvxmtrx has quit [Quit: Leaving]
init1 has joined #ocaml
ulfdoz has joined #ocaml
Yoric has quit [Quit: Yoric]
drunK has joined #ocaml
<hcarty>
adrien: A bit - some local packages for GODI primarily
shm has quit [Read error: Connection reset by peer]
ttamttam has quit [Remote host closed the connection]
<adrien>
as for my previous question: it's mostly: can you make the build system to put all the files needed for the package in a folder, without anything else (usually achieved through DESTDIR=foo make install)
<adrien>
hcarty: also, I'll change the format a bit, especially the version field since "binutils-2.20.51.0.1" definitely doesn't have a "x.y.z" version scheme
shm has joined #ocaml
<hcarty>
adrien: OCaml itself would be interesting :-) Possibly PLplot (and cmake, since PLplot needs it)
<adrien>
for windows or another platform?
<adrien>
I need two things for ocaml packages on windows: 1- an ocaml cross-compiler (mostly exists), 2- no hardcoded paths (that might take some work to check)
<adrien>
I know findlib.conf has paths stored in it (can't remember the exact format however) so that'll take some work but not too much since I'm already changing the paths in .pc and .la files, but there are probably others
albacker has joined #ocaml
yezariaely has joined #ocaml
yezariaely has left #ocaml []
init1 has quit [Quit: Quitte]
init1 has joined #ocaml
<bitbckt>
findlib.conf is key=value paris.
<bitbckt>
pairs*
<hcarty>
adrien: Probably Linux, thought Windows is an eventual possibility
<hcarty>
adrien: I'll read through the packaging tutorial
rixed_ has joined #ocaml
WonTu has joined #ocaml
WonTu has left #ocaml []
ccasin has joined #ocaml
Yoric has joined #ocaml
<adrien>
hcarty: ok, good luck ;-)
<hcarty>
adrien: Thanks :-) I'll let you know if I am able to try it out
ftrvxmtrx has joined #ocaml
rwmjones is now known as rwmjones_afk
avsm has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
opla2 has joined #ocaml
_andre has quit [Quit: leaving]
unkanon_ is now known as unkanon_work
Edward__ has joined #ocaml
Snark has quit [Quit: Ex-Chat]
groves has joined #ocaml
alexyk has joined #ocaml
<alexyk>
why can't I declare: let f: ~?x:bool -> 'a -> int = fun ?(x=true) y -> if x then 1 else 2;;
<alexyk>
while this works: let f: bool -> 'a -> int = fun x y -> if x then 1 else 2;;
<alexyk>
and this works: let f ?(x=true) y = if x then 1 else 2;;
<adrien>
val f : ?x:'a -> 'a option
<adrien>
it's ? , not ~?
<alexyk>
adrien: repl types f as: value f : ~?x:bool -> 'a -> int = <fun>
<alexyk>
the first one
<alexyk>
so I take the type and stick it into f: ... = fun ... ->
<adrien>
not here: - : ?x:bool -> 'a -> int = <fun>
<alexyk>
hmm
<alexyk>
adrien: you're right:
<alexyk>
# let f: ?x:bool -> 'a -> int = fun ?(x=true) y -> if x then 1 else 2;;
<alexyk>
value f : ~?x:bool -> 'a -> int = <fun>
<adrien>
which version of ocaml are you using?
<jm_ocaml>
alexyk: do you use batteries?
<alexyk>
so I enter the type with ?x:bool, and it's confirmed as ~?x:bool -- how so? batteries with 3.12
<jm_ocaml>
I get the same behaviour only when batteries is loaded
<thelema>
batteries causes types to be reported using revised syntax - bug in camlp4
<thelema>
(or findlib)
ikaros has quit [Quit: Leave the magic to Houdini]
ulfdoz has quit [Ping timeout: 240 seconds]
unkanon_work has quit [Ping timeout: 264 seconds]
<groves>
I'm using a module that defines this type: type java_basic_type = [
<groves>
| `Int
<groves>
| `Short
<groves>
| `Char
<groves>
| `Byte
<groves>
| `Bool
<groves>
| other_num
<groves>
]
<groves>
I'd like to use it without using "open" in my code. However, JBasics.`Bool is reported as a syntax error. I can access other fields from the JBasics module.
<groves>
Should I be accessing it some other way?
unkanon_work has joined #ocaml
<mrvn>
just `Bool
<groves>
I can't do that because I can't do open JBasics
<thelema>
groves: Polymorphic variants aren't attached to a module
<thelema>
groves: you don't need to open JBasics
<groves>
Oh, rad. Thanks!
<thelema>
no matter where you use `Bool, it's the same type
<mrvn>
except for JBasics.other_num
<groves>
A polymorphic variant is just one starting with `?
<thelema>
groves: yes
<groves>
That certainly makes this much less ugly
<thelema>
groves: be careful with polymorhpic variants, they can make for monstrous type errors.
opla2 has quit [Ping timeout: 276 seconds]
<groves>
I'm afraid I can't avoid them while using this library, but at least I can keep them in a corner
<adrien>
just stay cool, they're not that hard but require to pay attention when reading the error message ;-)
unkanon2 has joined #ocaml
unkanon_work has quit [Ping timeout: 240 seconds]
edwin has quit [Remote host closed the connection]
rixed_ has quit [Read error: Operation timed out]
fabjan has joined #ocaml
opla2 has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
init1 has quit [Quit: Quitte]
lewis1711 has joined #ocaml
fabjan is now known as uefqej
oriba has quit [Quit: oriba]
Asmadeus has quit [Read error: Operation timed out]
Asmadeus has joined #ocaml
Axioplas1_ has joined #ocaml
Axioplase_ has quit [Read error: Operation timed out]
tmaeda has quit [Ping timeout: 240 seconds]
Tianon has quit [Read error: Operation timed out]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
opla2 has quit [Ping timeout: 272 seconds]
Derander_ has joined #ocaml
patronus has joined #ocaml
_unK has joined #ocaml
kerneis_ has joined #ocaml
drunK has quit [*.net *.split]
hto has quit [*.net *.split]
kerneis has quit [*.net *.split]
Derander has quit [*.net *.split]
patronus_ has quit [*.net *.split]
hto has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
lewis1711 has left #ocaml []
Yoric has quit [Quit: Yoric]
<alexyk>
I have a polymopphic function, justGE, which used to be wrapped wither in pickInt or pickReal to work either with int or float. Now I refactored it and it fails to do both: http://paste.pocoo.org/show/314069/ -- why?
<alexyk>
When defining that, I can either define pickInt or pickReal, the other then fails as justGE now types by the whichever was defined first.
<thelema>
justGE and JustGreater aren't functions
<thelema>
at least they're not obviously enough functions to the compiler
<thelema>
which means it doesn't leave them fully polymorphic
<thelema>
solution: "beta expand" = put at least one parameter in their definitions
<thelema>
(and on the right side of the definition)
<alexyk>
thelema: yes, it works
<zeenix>
hi
<thelema>
hi
<zeenix>
the ocaml interactive doesn't seem very friendly by default. is there any modules i can load to get e.g history and completion?
<banisterfiend>
off for the w/e bye
banisterfiend has quit [Quit: shadowy in red silk]
<thelema>
rlwrap and ledit provide history for the ocaml toplevel (google)
<thelema>
These are standalone applications
<thelema>
for completion, I think the latest LWT (ocaml module) provides line editing and some sort of completion, but I've never used it
<mrvn>
zeenix: xemacs
<zeenix>
mrvn: i believe in vim :)
jm_ocaml has quit [Remote host closed the connection]
mnabil_ has joined #ocaml
<zeenix>
do you guys know of a good online ocaml tutorial/book?