<aqz>
more than 2 GB of memory are free during this
<aqz>
any ideas on how to solve this?
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<Drup>
tobiasBora: you can look at the merge attributes in the documentation
madroach has quit [Ping timeout: 264 seconds]
zpe has quit [Ping timeout: 260 seconds]
<tobiasBora>
Drup: Ok thank you I'll have a look ! And what is the classic way to update a mli file ? Because ocamc -i file.ml > file.mli forget all modifications I made (for example if I decided to remove secret_function I need to remove it each time I update this file)
<Drup>
by hand
<zenspider>
aqz: you prolly need to do: ulimit -d $(ulimit -Hd)
`greg has joined #ocaml
<zenspider>
to unlimit the process limits in your shell
madroach has joined #ocaml
<`greg>
i need to upgrade ocaml can i do this with opam
<`greg>
i tried running the switch command
<Drup>
tobiasBora: or by "oh, the compiler is yelling at me, let's just copy his type to replace the current one"
<`greg>
and it worked but wen i do opam install <package> i think its using the old compiler
<`greg>
can anyone help
<Drup>
`greg: when you switched, opam should have told you something.
<Drup>
read it back carefully.
<tobiasBora>
Drup: Really ? It should be quite hard to maintain big libraries ! And I heard that mli files are used in the compilation process, but I never see this file. I've cmo, cmx... but never mli, is there an other use of this file than documentation ?
<`greg>
aha ok thanks
<Drup>
tobiasBora: cmo, cmx and all that are binnary file, mli are still source files, just a different source
<tobiasBora>
Drup: But it's not possible to compile anything from it because there are only signatures in this file no ?
<Drup>
actually, it is
<Drup>
you can have a mli without ml
<Drup>
if there is only types in it
<Drup>
(or class type, or module signature)
<zenspider>
aqz: btw, I have that in my shell setup globally. I don't see the value in process limits on a user machine
<aqz>
zenspider: that makes sense. thanks, it worked and core_kernel was installed successfully :)
<aqz>
errors while installing core though
<zenspider>
awesome
<Drup>
tobiasBora: also, if you change a .ml without changing a .mli, you don't need to retypecheck some part, I don't have the details in mind
<zenspider>
I'm prolly not much further than you are. I just started working through real world ocaml and am hung up on some of the install instructions
<Drup>
tobiasBora: at least, the compiler take advantage of the fact that the interface doesn't change
<aqz>
zenspider: I just started working on the book as well
<tobiasBora>
Drup: And what is the use ? If I write "fact : int -> int" the compiler can't know what my function does ! I don't understand in which case it's usefull...
<zenspider>
aqz: well... I got core to install fine. but the instructions on adding stuff to your ~/.ocamlinit seem broken
<Drup>
tobiasBora: the point of .mli is to described the *external interface*
<zenspider>
utop complains about them. I haven't verified that my changes are correct because Id on't speak a lick of ocaml yet, but I think each line needs ";;" appended
<Drup>
tobiasBora: there is no other point, that's only that
<zenspider>
aqz: the instructions said there might be problems with some modules...
<zenspider>
but not that one
<zenspider>
aqz: I installed 109.53.01, which is newer than yours
<zenspider>
maybe do `opam update` ?
<aqz>
let's see
<zenspider>
again... I'm a total virgin here
<tobiasBora>
Drup: Oh ok I think I understand now... Thank you !
WraithM has quit [Quit: Lost terminal]
<Drup>
tobiasBora: so, you only use .mli to 1) restrict the interface of the module, by hiding stuff or by restrecting the type 2) adding documentation
Simn has quit [Quit: Leaving]
<tobiasBora>
Drup: Oookk... Great thank you !
<Drup>
in the very specific case where you have only types and no implementation in your module, you can have just a .mli
<Drup>
but that's very specific
michael_lee has joined #ocaml
amirmc has joined #ocaml
tobiasBora has quit [Quit: Konversation terminated!]
WraithM has joined #ocaml
amirmc has quit [Ping timeout: 272 seconds]
manizzle has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
ontologiae_ has quit [Ping timeout: 246 seconds]
csakatoku has quit [Ping timeout: 245 seconds]
csakatoku has joined #ocaml
strobegen has joined #ocaml
milosn_ has joined #ocaml
milosn has quit [Ping timeout: 246 seconds]
zamn has joined #ocaml
zamn has left #ocaml []
isd has joined #ocaml
<isd>
Hey, does anyone know if there's a good reference for all of the options supported by the _tags file used by ocamlbuild?
manizzle has quit [Ping timeout: 264 seconds]
Xenasis has quit [Remote host closed the connection]
BitPuffin has quit [Ping timeout: 246 seconds]
<Drup>
isd: "ocamlbuild -documentation", the ocamlbuild manual, divination, prayer.
`greg has quit [Ping timeout: 240 seconds]
<isd>
Drup: didn't know about the first one - it just dumps what looks like a set of default build rules - interesting, but I don't think it's what I'm after. The manual only gives a couple examples for the _tags file, but no list of things. I'm not really religious. Is there really nowhere where there's just a "here are all the things you can put after the colon in a _tags file"?
<Drup>
the thing is, technically, you can put anything
<Drup>
if ocamlbuild doesn't understand a tag, it will just ignore it
<Drup>
yes, I know ....
<isd>
maybe I'll go look through the source code.
<Drup>
isd: not a very good idea
<Drup>
isd: ocamlbuild accept strictly anything, and what it will use is what is accepted in the rules printed by -oducmentation
<isd>
any tips on parsing that?
<Drup>
the -documentation output ? not really
<Drup>
but you can access the rules with the ocamlbuild interface
<Drup>
do note that it's possible to extend the rules with plugins
Neros has joined #ocaml
<isd>
Duly noted. I just feel like there's some pretty basic stuff that I'm just not finding. I'll scan through the output though. thanks.
<Drup>
isd: what are you looking for ?
<isd>
I feel like there should be _tags file equivalents to e.g. the -cflag, -lflag, etc. cli options.
<Drup>
afaik, no, there is not
<isd>
for now I'm just wrapping the command with a shell script that adds the ones I need. Is there a better approach?
<Drup>
not really
<isd>
fair enouhg.
<Drup>
what did you need to pass with -cflag and -lflag ?
<Drup>
usually, even if there is no tag equivalent for lflag and cflag, there is one for the flag
<isd>
I'm trying to use labltk. need to pass -I +labltk labltk.cma when I run it with just ocamlc.
<Drup>
just add "use_lablgtk"
<Drup>
and add -use-ocamlfind to the ocamlbuild call
vpm_ has joined #ocaml
<Drup>
oh no, sorry
<Drup>
"package(lablgtk)
<Drup>
and it's probably going to be lablgtk2
<Drup>
(you can check the name of the package by greping the output of "ocamlfind list")
talzeus has joined #ocaml
Arzaga has joined #ocaml
vpm has quit [Quit: co'o]
Arzaga has quit [Client Quit]
<isd>
adding -use-ocamlfind -pkg labltk to the command line did the trick (using tk not gtk), but the package(...) in the _tags file didn't do anything. This will work though.
vpm_ has quit [Quit: leaving]
vpm has joined #ocaml
milosn_ has quit [Read error: Operation timed out]
milosn has joined #ocaml
isd has quit [Quit: leaving]
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
kizzx2 has joined #ocaml
csakatoku has quit [Remote host closed the connection]
kizzx2 has quit [Client Quit]
kizzx2 has joined #ocaml
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 245 seconds]
mcclurmc has quit [Remote host closed the connection]
jao has quit [Ping timeout: 272 seconds]
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
csakatoku has joined #ocaml
csakatok_ has joined #ocaml
csakatoku has quit [Ping timeout: 240 seconds]
skchrko has joined #ocaml
ggole has joined #ocaml
breakds has quit [Remote host closed the connection]
w0rm_x has joined #ocaml
w0rm_x has left #ocaml []
Arzaga has joined #ocaml
snyp has joined #ocaml
snyp has quit [Max SendQ exceeded]
ambul_ has quit [Remote host closed the connection]
ulfdoz has joined #ocaml
ggole has quit [Read error: Connection reset by peer]
csakatok_ has quit [Remote host closed the connection]
csakatoku has joined #ocaml
skchrko has quit [Quit: Leaving]
csakatoku has quit [Ping timeout: 260 seconds]
ulfdoz has quit [Ping timeout: 246 seconds]
ggole has joined #ocaml
Arzaga has quit [Quit: Computer has gone to sleep.]
csakatoku has joined #ocaml
Arzaga has joined #ocaml
wolfnn has joined #ocaml
Arzaga has quit [Quit: Computer has gone to sleep.]
rand000 has joined #ocaml
`greg has joined #ocaml
yacks has quit [Quit: Leaving]
cesar_ has joined #ocaml
cesar_ is now known as Guest15114
Guest15114 has quit [Remote host closed the connection]
mika1 has joined #ocaml
NoNNaN has joined #ocaml
jonludlam has quit [Remote host closed the connection]
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
eikke has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
kyrylo has joined #ocaml
`greg has quit [Ping timeout: 240 seconds]
kyrylo has quit [Quit: WeeChat 0.4.2]
zenspider has quit [Ping timeout: 248 seconds]
zenspider has joined #ocaml
tianon has quit [Ping timeout: 246 seconds]
ocp has joined #ocaml
zpe has joined #ocaml
tianon has joined #ocaml
AltGr has joined #ocaml
Kakadu has joined #ocaml
Simn has joined #ocaml
jonludlam has joined #ocaml
peregrin has joined #ocaml
<companion_cube>
\o
<pippijn>
hi
<companion_cube>
hi pippijn
<pippijn>
did you get the news about wmeyer?
jonludlam has quit [Ping timeout: 245 seconds]
<pippijn>
adrien: did you?
<companion_cube>
yes, we did :(
<companion_cube>
but without any detail
<pippijn>
:/
djcoin has joined #ocaml
thomasga has joined #ocaml
kizzx2 has quit [Quit: Leaving.]
jonludlam has joined #ocaml
thomasga has quit [Quit: Leaving.]
<adrien_oww>
yes, trying not to think too much about it like every time in this kind of situation
nikki93 has joined #ocaml
<whitequark>
what's up with wmeyer?
ontologiae_ has joined #ocaml
_andre has joined #ocaml
ggole has quit [Read error: Connection reset by peer]
rossberg has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 240 seconds]
ttamttam has joined #ocaml
ggole has joined #ocaml
troydm has quit [Ping timeout: 264 seconds]
thomasga has joined #ocaml
tovarish has joined #ocaml
Neros has quit [Ping timeout: 240 seconds]
jonludlam has quit [Ping timeout: 240 seconds]
ontologiae_ has quit [Ping timeout: 260 seconds]
troydm has joined #ocaml
mchqwerty has joined #ocaml
jonludlam has joined #ocaml
eikke has quit [Ping timeout: 260 seconds]
ttamttam has quit [Quit: ttamttam]
avsm has joined #ocaml
ttamttam has joined #ocaml
ontologiae_ has joined #ocaml
tovarish has quit [Quit: Leaving]
snyp has joined #ocaml
wolfnn has quit [Ping timeout: 264 seconds]
nikki93 has quit [Remote host closed the connection]
dsheets has joined #ocaml
ontologiae_ has quit [Ping timeout: 272 seconds]
BitPuffin has joined #ocaml
BitPuffin has quit [Client Quit]
BitPuffin has joined #ocaml
eikke has joined #ocaml
avsm has quit [Quit: Leaving.]
snyp has quit [Quit: "bbl"]
darkf has quit [Quit: Leaving]
peregrin has quit [Ping timeout: 250 seconds]
nikki93 has joined #ocaml
nikki93 has quit [Ping timeout: 246 seconds]
csakatoku has joined #ocaml
ddosia has quit [Quit: Leaving.]
csakatoku has quit [Ping timeout: 272 seconds]
ddosia has joined #ocaml
Kakadu has quit [Ping timeout: 250 seconds]
ontologiae_ has joined #ocaml
talzeus has quit [Remote host closed the connection]
rand000 has quit [Ping timeout: 260 seconds]
ontologiae_ has quit [Ping timeout: 260 seconds]
paolooo has joined #ocaml
amirmc has joined #ocaml
amirmc1 has joined #ocaml
amirmc has quit [Read error: Connection reset by peer]
ollehar has joined #ocaml
Arzaga has joined #ocaml
Arzaga has quit [Quit: Computer has gone to sleep.]
yacks has joined #ocaml
talzeus has joined #ocaml
Neros has joined #ocaml
amirmc1 has quit [Read error: Connection reset by peer]
amirmc has joined #ocaml
Sim_n has joined #ocaml
simn__ has joined #ocaml
Simn has quit [Ping timeout: 252 seconds]
Simn has joined #ocaml
Sim_n has quit [Ping timeout: 252 seconds]
simn__ has quit [Ping timeout: 252 seconds]
amirmc has quit [Quit: Leaving.]
mcclurmc has joined #ocaml
adrien_oww has quit [Ping timeout: 272 seconds]
adrien_oww has joined #ocaml
Kakadu has joined #ocaml
wolfnn has joined #ocaml
nikki93 has joined #ocaml
ontologiae_ has joined #ocaml
nikki93 has quit [Ping timeout: 240 seconds]
* jbrown
would like to know what's up with wmeyer too?
csakatoku has joined #ocaml
rand000 has joined #ocaml
amirmc has joined #ocaml
amirmc1 has joined #ocaml
amirmc has quit [Read error: Connection reset by peer]
osa1 has quit [Quit: Konversation terminated!]
WraithM_ has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
skchrko has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
osa1 has joined #ocaml
csakatoku has quit [Ping timeout: 260 seconds]
osa1 has quit [Client Quit]
osa1 has joined #ocaml
michael_lee has quit [Quit: Ex-Chat]
mika1 has quit [Quit: Leaving.]
travisbrady has joined #ocaml
ollehar has quit [Ping timeout: 245 seconds]
nikki93 has joined #ocaml
nikki93 has quit [Ping timeout: 245 seconds]
avsm has joined #ocaml
watermind has joined #ocaml
thomasga has quit [Quit: Leaving.]
<watermind>
is there a way to approximate haskell classes? e.g. if you need to define a function that works over a family of types?
<watermind>
sexplib seems to allow a sort of template programming... can that be used? or am I way off?
ollehar has joined #ocaml
<def-lkb>
manual dictionary passing: you define a parametrized record type with classes methods as fields and pass it manually
thomasga has joined #ocaml
Rc43 has joined #ocaml
<Rc43>
Hi, guys.
<Rc43>
What are `.ml4' files for?
<Rc43>
Is it something for meta-programming?
<adrien_oww>
typically they're files which are transformed through camlp4
<watermind>
def-lkb: hmm... thinking...
<watermind>
def-lkb: explicitely passing a dictionary is fine... but I'm having some trouble understanding how this would work... consider e.g., this simple example
thomasga has quit [Ping timeout: 245 seconds]
<watermind>
def-lkb: suppose you want to sum tuples int * (int * ... * (int * int))
<watermind>
def-lkb: with haskell you could define the instances recursively, int can be reduced to int, and so can anything of the form int * 'a , as long as 'a can be reduced
<watermind>
def-lkb: in ocaml what would the appropriate parameterized record type be like?
<def-lkb>
type 'a sum = { sum: 'a -> int} let sum_int = { sum = fun x -> x} let sum_pair px py = { sum = fun (x,y) -> px.sum x + py.sum y }
<def-lkb>
manually passing and building* dictionaries =)
<watermind>
def-lkb: right... but it's the building part I was trying to avoid :(
<watermind>
def-lkb: is there anyway to combine this technique with something else that does the building?
<watermind>
or is there no meta/generic programming avilable?
<watermind>
def-lkb: this method alone already helps me though
<def-lkb>
Not yet I think.
paolooo has quit [Quit: Page closed]
<watermind>
ok thanks, somehow I got the impression sexplib could be it, because it seemed be used to implement something similar to Haskell's Show class, and therefore is kind of generic
<def-lkb>
watermind: sexplib leverage camlp4 with a custom extension to generate the boilerplate
jave has joined #ocaml
kyrylo has joined #ocaml
smondet has joined #ocaml
<watermind>
def-lkb: right I see
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
<def-lkb>
behind the scene, the code generated by that kind of extension (and haskell implementations) look somewhat like that. But there is no logic in ocaml at the moment to infer the dictionary.
<companion_cube>
sadly :(
<watermind>
I understand... for a while before reading about it I also thought first order modules might do the trick
avsm has quit [Quit: Leaving.]
<def-lkb>
First order modules would just allow you to replace record syntax with module syntax, but won't help building witnesses.
amirmc has joined #ocaml
<watermind>
def-lkb: exactly
avsm has joined #ocaml
<watermind>
not as good, but I guess I can always make a program that produces the required source code
amirmc1 has quit [Ping timeout: 260 seconds]
<watermind>
are there any libraries for playing around with AST's of ocaml types/terms?
<ggole>
camlp4?
avsm has quit [Client Quit]
<watermind>
ggole: right, of course
<ggole>
Unfortunately it is not really documented
<watermind>
I wouldn't need anything too good, I don't need to play around with modules or anything
<ggole>
But you can it to spit out an AST if you poke it just right
<watermind>
just a small core of OCaml
avsm has joined #ocaml
<watermind>
ggole: also note I don't need parsing, I'd be building the AST's myself, what I'd need is the other direction AST -> code
<Drup>
there is lot's of stuff in camlp4 to do that precisely
<watermind>
Drup: cool got to look at it
<Drup>
(including camlp4 extensions :P)
amirmc1 has joined #ocaml
travisbrady has quit [Quit: travisbrady]
thomasga has joined #ocaml
eikke has quit [Ping timeout: 240 seconds]
<watermind>
hmm but there's also a camlp4... why are we talking camlp4 then?
<watermind>
is 5 not stable?
<ousado>
it's older
amirmc has quit [Ping timeout: 240 seconds]
<watermind>
makes sense :/
<Rc43>
I am trying to build Coq with "-debug" flag, but I get strange error: "/tmp/camlasmf72e49.s:2066: Error: file number less than one".
<Rc43>
Why can this happen?
<ousado>
"De Rauglaudre maintains a separate backwards-compatible version, which has been renamed Camlp5"
<Rc43>
I looked at this bad file and line 2066 is ".loc 1 -1".
<watermind>
Rc43: I don't know why that happens but what I do is use opam to download/build coq and its dependencies
<watermind>
Rc43: saves me a lot of headaches
<Rc43>
watermind, I needn't install coq, I need to debug it
<Rc43>
watermind, seems that debugging symbols are generated badly =/
<watermind>
Rc43: right... I don't envy you... I have no advice then
<Rc43>
watermind, perhaps, that is because of patch applied by myself; should try clean version
mcclurmc has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
ocp has quit [Quit: Leaving.]
mcclurmc has joined #ocaml
shinnya has joined #ocaml
nikki93 has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
nikki93 has quit [Ping timeout: 250 seconds]
thomasga has quit [Quit: Leaving.]
eikke has joined #ocaml
avsm has quit [Quit: Leaving.]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
ttamttam has quit [Quit: ttamttam]
mort___ has joined #ocaml
travisbrady has joined #ocaml
thomasga has joined #ocaml
avsm has joined #ocaml
ocp has joined #ocaml
dant3 has joined #ocaml
dant3 has quit [Client Quit]
Xenasis has joined #ocaml
dant3 has joined #ocaml
mchqwerty has quit [Quit: Odcházím]
Kakadu has quit [Quit: Page closed]
avsm has quit [Read error: Connection reset by peer]
thomasga has quit [Ping timeout: 240 seconds]
amirmc1 has quit [Ping timeout: 272 seconds]
eikke has quit [Ping timeout: 272 seconds]
mcclurmc has joined #ocaml
avsm has joined #ocaml
thomasga has joined #ocaml
nikki93 has joined #ocaml
milosn has quit [Ping timeout: 264 seconds]
milosn has joined #ocaml
<Rc43>
What name of ocaml toplevel? I see only "ocamlmktop" in bin directory.
<Rc43>
Oh, just "ocaml".
nikki93 has quit [Ping timeout: 240 seconds]
<companion_cube>
Rc43: I suggest "rlwrap ocaml"
<companion_cube>
or install utop
jonludlam has quit [Remote host closed the connection]
cesar_ has joined #ocaml
cesar_ is now known as Guest97243
<travisbrady>
utop is excellent.
<Rc43>
What differences?
<Rc43>
completion, history, etc?
<Rc43>
Anyway I have other problem now =/ Some .cmi files in project somehow are inconsistent. I tried to recompile correspondent .mli files manually, but seems that there are nontrivial dependencies or something.
<Rc43>
That appears only when I try ocaml toplevel, binaries work ok.
<Rc43>
And even ocamldebug too.
travisbrady has quit [Quit: travisbrady]
dsheets_ has joined #ocaml
dsheets has quit [Ping timeout: 260 seconds]
skchrko has quit [Quit: Leaving]
shinnya has quit [Ping timeout: 245 seconds]
Guest97243 has quit [Remote host closed the connection]
travisbrady has joined #ocaml
<ollehar>
Rc43: Recompile everything, maybe?
<ollehar>
some people say ocamlbuild is good, too, but I've never used it
nikki93 has joined #ocaml
ulfdoz has joined #ocaml
<Rc43>
ollehar, will look at it
<Rc43>
ollehar, recompile everything -- not sure if that can help; I tried freshly build version of the project
nikki93 has quit [Ping timeout: 250 seconds]
dsheets_ has quit [Read error: Operation timed out]
thomasga has quit [Ping timeout: 264 seconds]
thomasga has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
avsm has quit [Quit: Leaving.]
mcclurmc_ has joined #ocaml
mcclurmc has quit [Ping timeout: 245 seconds]
thomasga has quit [Ping timeout: 272 seconds]
tane has joined #ocaml
Xenasis has quit [Remote host closed the connection]
mcclurmc_ has quit [Remote host closed the connection]
nikki93 has joined #ocaml
snyp has joined #ocaml
snyp has quit [Quit: leaving]
_andre has quit [Quit: leaving]
snyp has joined #ocaml
Neros has quit [Read error: Connection reset by peer]
Neros has joined #ocaml
ontologiae_ has quit [Ping timeout: 260 seconds]
snyp has quit [Quit: leaving]
ggole has quit []
jonludlam has joined #ocaml
dant3_ has joined #ocaml
mfp_ has joined #ocaml
mcclurmc has joined #ocaml
dant3 has quit [Ping timeout: 240 seconds]
mfp has quit [Ping timeout: 264 seconds]
ontologiae_ has joined #ocaml
<Rc43>
Am I right that dynamic libs are visible ok from ocamldebug?
<Rc43>
I can't set breakpoint to function from Coq plugin file.
<Rc43>
Says that there is just no such function. Module is visible but not listed in `info modules'.
<Rc43>
"Module is visible" means, that source file is visible
baz_ has joined #ocaml
ontologiae_ has quit [Ping timeout: 245 seconds]
<dant3_>
can someone suggest a good Qt binding for ocaml?
<Rc43>
But seems that problem is not in plugins. As I understand, dynamic libs should work in debugger the same way as static; and I can't set breakpoint to other functions, too.
<whitequark>
dant3_: there's only lablqt, I think.
<whitequark>
I'm not sure how good it is, it seems a bit experimental to me
ivan\ has joined #ocaml
<dant3_>
whitequark: thanks, I'll try it and see if you are right about it :)
ocp has quit [Ping timeout: 245 seconds]
dant3_ has quit [Remote host closed the connection]
mort___ has quit [Quit: Leaving.]
zpe has quit [Remote host closed the connection]
mort___ has joined #ocaml
<watermind>
def-lkb: am I right in that this wraping of a single method in a record, as in type 'a ground = { sum: 'a -> int } amounts to pretty much the same thing as the newtype construct in Haskell?
<watermind>
def-lkb: or maybe I should just be asking, why exactly use a wrapped method, rather than just functions?
<companion_cube>
it still allocates a record
thomasga has joined #ocaml
<watermind>
companion_cube: right... so what would be the advantage of doing so?
<watermind>
companion_cube: it seems to me that the point is to have more than just a type alias, and actually define a new type (with allocating the array being the price to pay)
<watermind>
then again I also wonder why not type 'a ground = Sum of 'a -> int which would be more in line with what one does in Haskell
<watermind>
is it just a matter of style or are there advantages of using type 'a ground = { sum: 'a -> int } over type 'a ground = Sum of 'a -> int
<watermind>
i.e. singular product vs singular sum
<companion_cube>
watermind: it's useful if you have several functions
<companion_cube>
or if you may have several functions later
<watermind>
right
<companion_cube>
but you can specifiy type 'a ground = 'a -> int
<companion_cube>
and be careful to use 'a ground everywhere
<companion_cube>
so that if you change its exact definition, you don't have to do it in your other code
rand000 has quit [Quit: leaving]
<watermind>
missing these parens took me a while to figure out :/ let ground_int = { p = (fun x -> x) ; q = (fun x -> x) }
<companion_cube>
right
<companion_cube>
it's also a good habit, imho, to put a ';' after every record field
<watermind>
right, not to forget it when adding new fields right?
thomasga has quit [Read error: Connection reset by peer]
thomasga has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
<companion_cube>
Rc43: you need to enable backtraces
<companion_cube>
OCAMLRUNPARAM=b ./my_program foo bar
<Rc43>
Aaah, that exception backtrace, not call stack trace =/
<companion_cube>
(can also be enabled from Printexc.record_backtrace true;
<Rc43>
companion_cube, should it print functions call stack or only info of exception?
<companion_cube>
it should print call stack
dsheets_ has quit [Quit: Leaving]
dsheets_ has joined #ocaml
<Rc43>
ah ok then, will try options
<ollehar>
can be done programmatically in the code, too (enabling backtrace, I mean)
<companion_cube>
yes; using Printexc
<Rc43>
No effect. Maybe my previous question was unclear: need I have an exception to print exception? Or I can just print backtrace in any point of program?
tane has quit [Quit: Verlassend]
thomasga has quit [Read error: Connection reset by peer]
<Rc43>
Seems that first. (Didn't thought that Printexc means PRINT EXCeption.)
thomasga has joined #ocaml
dsheets_ has quit [Ping timeout: 240 seconds]
dsheets_ has joined #ocaml
<companion_cube>
you need an exception
<companion_cube>
because the stacktrace is bound to the exception, in some sense
<Rc43>
Now I tried this "try raise (Failure "hack") with Failure _ -> print_string (get_backtrace ())"
<Simn>
Oh nice, I've been looking for that function for a while.
<Rc43>
Anyway, anybody sees error in pasted code?
<Rc43>
whitequark, ye, it works for me (4.0.1); prints file names + line numbers of callers.
gargawel has quit [Quit: leaving]
ollehar1 has joined #ocaml
Rc43_ has joined #ocaml
Rc43 has quit [Ping timeout: 250 seconds]
ocp has joined #ocaml
Rc43_ is now known as Rc43
<companion_cube>
Rc43: much simpler to use Printexc.print_backtrace stderr (or stdout)
dsheets_ has quit [Ping timeout: 264 seconds]
dsheets_ has joined #ocaml
<Rc43>
companion, agree; just didn't look how streams are coded in ocaml
<companion_cube>
you have two types: in_channel and out_channel
strobegen has quit [Quit: Leaving.]
dsheets_ has quit [Ping timeout: 246 seconds]
ocp1 has joined #ocaml
dsheets_ has joined #ocaml
ocp has quit [Ping timeout: 260 seconds]
mcclurmc has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
thomasga has quit [Quit: Leaving.]
dsheets_ has quit [Ping timeout: 264 seconds]
<Rc43>
Aah, inserted this callstack printer into a function inside the project, but no output.
<Rc43>
This functions is definetely called =/
<Rc43>
*definitely
ocp1 has quit [Ping timeout: 272 seconds]
Xenasis has joined #ocaml
<companion_cube>
Rc43: but if the function doesn't raise an exception, it's normal
<companion_cube>
you need to call this at the try with ... site
thomasga has joined #ocaml
djcoin has quit [Quit: WeeChat 0.4.1]
avsm has joined #ocaml
WraithM_ has quit [Ping timeout: 250 seconds]
dsheets_ has joined #ocaml
baz_ has quit [Remote host closed the connection]
mcclurmc has quit [Remote host closed the connection]
travisbrady has quit [Ping timeout: 240 seconds]
AltGr has left #ocaml []
<Rc43>
companion_cube, I have talked about this new function get_callstack; anyway I figured out the problem -- just occasionally used system isntall coq instead of locally built.
malvarez has joined #ocaml
<malvarez>
I'm looking for good MSc programmes in theoretical computer science
<Rc43>
What I do wrong? Program is "let f _ = print_string "hello\n";; f ()", compiled with "ocamlc -g", then I do "ocamldebug hi" and "break f", but got "unbound identifier f".
kyrylo has quit [Ping timeout: 264 seconds]
Rc43 has quit [Ping timeout: 250 seconds]
BitPuffin has quit [Ping timeout: 240 seconds]
mort___ has quit [Quit: Leaving.]
mcclurmc has joined #ocaml
w0rm_x has joined #ocaml
Simn has quit [Quit: Leaving]
shinnya has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
NoNNaN has joined #ocaml
avsm has quit [Quit: Leaving.]
w0rm_x has left #ocaml []
wolfnn has quit [Ping timeout: 272 seconds]
nikki93 has quit [Remote host closed the connection]