nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
antkong has quit [Quit: antkong]
BitPuffin|osx has quit [Ping timeout: 256 seconds]
Simn has joined #ocaml
nojb has joined #ocaml
zpe has joined #ocaml
ely-se has joined #ocaml
rand has joined #ocaml
ontologiae_ has joined #ocaml
Guest3094 has quit [Ping timeout: 250 seconds]
emias has joined #ocaml
cody` has joined #ocaml
trix has joined #ocaml
trix is now known as Guest72510
fedjo has quit [Ping timeout: 246 seconds]
sh0t has joined #ocaml
madroach has quit [Ping timeout: 246 seconds]
fedjo has joined #ocaml
madroach has joined #ocaml
supercircle4 has joined #ocaml
Kakadu has quit [Ping timeout: 252 seconds]
ggole has quit [Ping timeout: 256 seconds]
ely-se has quit [Quit: leaving]
ggole has joined #ocaml
ontologiae_ has quit [Quit: WeeChat 1.2]
lolisa has quit [Ping timeout: 250 seconds]
ely-se has joined #ocaml
sh0t has quit [Ping timeout: 272 seconds]
madroach has quit [Ping timeout: 246 seconds]
madroach has joined #ocaml
ely-se has quit [Quit: leaving]
AlexRussia has joined #ocaml
_andre has joined #ocaml
ely-se has joined #ocaml
dsheets has joined #ocaml
bitbckt has joined #ocaml
zpe has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 246 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 256 seconds]
madroach has joined #ocaml
Anarchos has joined #ocaml
<Anarchos>
I am looking for a tool to parse the output of objdump, to read assembly code into an ocaml structure.
larhat1 has quit [Quit: Leaving.]
Haudegen has quit [Ping timeout: 272 seconds]
Haudegen has joined #ocaml
<Anarchos>
hi Haudegen
Anarchos has quit [Ping timeout: 252 seconds]
zpe has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
agumonkey has quit [Ping timeout: 256 seconds]
ggVGc has quit [Ping timeout: 245 seconds]
agumonkey has joined #ocaml
lewis1711 has joined #ocaml
freehck has joined #ocaml
<lewis1711>
do I have to explicitly include other modules? I am trying to compile with ocamlbuild
<lewis1711>
I have a file called ir.ml with a module IR. but when running ocamlbuild, it claims it doesn't know about the IR module when I use it in another file
rand has quit [Ping timeout: 240 seconds]
<freehck>
Because the module is Ir, not IR?
<freehck>
lewis1711: simply speaking, you could import all the functions from another module using "open Module" or u can just call a function from that module using "Module.function".
<freehck>
And it supposes that you have a file module.ml or Module.ml in the directory described in tags file (or just in the same directory).
<lewis1711>
freehck, the file is ir.ml. but inside is a module called explicitly "module IR = struct ..."
<lewis1711>
but that maybe makes me think that I just nested a module
<freehck>
lewis1711: So u need to "open Ir" and then "open IR"
<freehck>
lewis1711: why do u use a module declaration in ir.ml?
<freehck>
The good example is cmdliner for example. There're three modules defined in cmdliner.ml. You can just use "open Cmdliner" and then use the modules Arg, Term and Manpage via Arg.<func>, Term.<func> and Manpage.<func>.
<freehck>
But you also could open them explicitly importing their interfaces into the current module namespace.
lewis1711 has quit [Ping timeout: 250 seconds]
lewis1711 has joined #ocaml
<freehck>
lewis1711: sup?
ely-se has quit [Quit: leaving]
Kakadu has joined #ocaml
ggole has quit [Ping timeout: 256 seconds]
whirm has joined #ocaml
<whirm>
Hi everybody
<whirm>
is it possible to debug an ocaml program directly from emacs? The best option I found was to first compile manually and then do `M-x ocamldebug` and load it from there. But that seems a bit cumbersome.
<edwin>
there is camldebug.el, but I never used it (I was mostly a Vim user and started using Emacs only a bit ago)
caml has joined #ocaml
<whirm>
edwin: yeah, that's what I'm using right now, I was hoping a shortcut to debug small programs already existed. I guess I'll program my own stuff then. Thanks!
<whirm>
edwin: I was reading this post right now :)
ggole has joined #ocaml
nojb has quit [Ping timeout: 240 seconds]
nojb has joined #ocaml
ely-se has joined #ocaml
<freehck>
whirm: and how good is it in comparision with merlin-mode?
<whirm>
freehck: I had a quick glance at the code, and it's mostly icons and contextual menus + the IDE-like gui with the side panel and such.
<freehck>
whirm: but I suppose it has good debugger facilities? Have you tried to use them with merlin simultaneously?
troydm has joined #ocaml
troydm has quit [Ping timeout: 246 seconds]
troydm has joined #ocaml
d0nn1e has quit [Ping timeout: 260 seconds]
<c-c>
If one thinks of "types" like "units" in physics, is that a good or bad approach with OCaml?
d0nn1e has joined #ocaml
ely-se has quit [Quit: leaving]
<zozozo>
c-c: I'd say types are more of a grandeur than a unit: for instance, a distance rather than meters, miles or inches
<edwin>
with units it doesn't matter if you multiply a meter with a second, or a second with a meter, but in OCaml it does matter if your tuple is (meter * second) or (second * meter)
<c-c>
ah
<whirm>
freehck: It uses camldebug + gud so it's mostly the same I'm using now. I was more interested in a shortcut to build and debug single file programs (ocaml newbie here, so writing really small stuff ATM :))
<whirm>
freehck: I guess I'll set something up once I'm up to speed with the MOOC
<edwin>
do you know ELISP? you could bind a key to a function that invokes both (I'm somewhat of a beginner in elisp)
<freehck>
edwin: +1
<freehck>
and iirc there was such stuff in merlin-mode
pierpa has joined #ocaml
<freehck>
Yes, there's a command!
<freehck>
whirm: Why don't you try C-c C-c? )
<whirm>
edwin: yes, I know a bit of elisp, I'll code a little function for that
<whirm>
freehck: I don't have a Makefile, it's just a dir with a bunch of .ml
<freehck>
whirm: you could specify any build command you want.
<freehck>
whirm: all you need is to `setq compile-command' to what you want.
<whirm>
yes, but I would need to do that for every small file I have, so it saves no time, I'll automate it.
<theblatte>
how can I know if a package is installed using opam? "opam show $name" has a bunch of fields but none of them seems to say whether the package is installed for the current switch
<freehck>
opam list
<theblatte>
except "pinned" but it's a bit of a stretch
<theblatte>
freehck: thanks!
tennix has quit [Ping timeout: 240 seconds]
<theblatte>
freehck: however I still have to do a bit of manipulations to get the installed version, hopefully that's not too brittle...
<zozozo>
theblatte: opam info package
<zozozo>
in the installed-versions field
groovy2shoes has joined #ocaml
<theblatte>
ah, I can ask "opam list $name.$version"
<freehck>
theblatte: opam list | awk '/somepkg/ {print $1, $2}'
<theblatte>
zozozo: yes but that lists also versions installed for other switches...
<zozozo>
yes indeed
<zozozo>
but it's easy to deduce what version is currently used if you know what switch you're using
<theblatte>
that's a lot of processing for a simple question ^^
<zozozo>
well, there are many answers
<theblatte>
looking at the exit code of `opam list $name.$version` does what I want, thanks
<theblatte>
`opam list --installed $name.$version`*
ely-se has quit [Quit: leaving]
psy_ has quit [Ping timeout: 250 seconds]
Mercuria1Alchemi has joined #ocaml
orbifx has quit [Ping timeout: 272 seconds]
<reynir>
opam info -f version mypackage
<reynir>
or if you prefer long options: opam info --field version mypackage
<reynir>
err
<reynir>
s/version/installed-version/
<theblatte>
reynir: then you need to look at the stuff in [] to see if you find the current switch in there
<reynir>
Oh
BitPuffin|osx has joined #ocaml
zpe has quit [Remote host closed the connection]
lolisa has joined #ocaml
ncthom91 has joined #ocaml
psy_ has joined #ocaml
supercircle4 has quit [Quit: Sleep]
contempt has quit [Read error: Connection reset by peer]
contempt has joined #ocaml
rand has quit [Quit: Lost terminal]
teiresias has quit [Ping timeout: 245 seconds]
teiresias has joined #ocaml
jwatzman|work has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbifx has joined #ocaml
ncthom91 has joined #ocaml
tane has quit [Quit: Verlassend]
lolisa has quit [Quit: meow]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
^elyse^ has joined #ocaml
^elyse^ has quit [Client Quit]
teiresias has quit [Ping timeout: 256 seconds]
teiresias has joined #ocaml
nojb has quit [Ping timeout: 256 seconds]
linse has quit [Quit: linse]
teiresias has quit [Ping timeout: 240 seconds]
struk|desk has quit [Ping timeout: 246 seconds]
linse has joined #ocaml
NingaLeaf has joined #ocaml
teiresias has joined #ocaml
struk|desk has joined #ocaml
teiresias has quit [Ping timeout: 240 seconds]
antkong has joined #ocaml
Elhaelion has joined #ocaml
ggole has quit []
ygrek_ has joined #ocaml
hcarty has joined #ocaml
Elhaelion has left #ocaml ["@pluche"]
govg has joined #ocaml
Kakadu has quit [Quit: Page closed]
orbifx has quit [Ping timeout: 250 seconds]
rand has joined #ocaml
hcarty has quit [Quit: WeeChat 1.3]
ncthom91 has joined #ocaml
sh0t has joined #ocaml
larhat1 has joined #ocaml
_andre has quit [Quit: leaving]
<lostman>
hey folks. what do I put in _tags to use lwt ppx extensions?
<Drup>
lostman: are you using _oasis ?
<Drup>
well, either way: exactly like other packages
<lostman>
I'm not exactly sure if I'm doing everything correctly but I'm doing ocamlbuild -use-ocamlfind and that seems to look at _tags
<lostman>
so there should be let%lwt with ppx instead of lwt, right?
<Drup>
yes
<lostman>
so I've added package(lwt.ppx), but let%lwt fails as syntax error
<Algebr>
if you're using oasis then wouldn't it just be easier to do in builddepends:lwt.ppx
Sim_n has joined #ocaml
<lostman>
Algebr: where would I pass that option?
<Drup>
Algebr: he doesn't seem to be using oasis
<def`>
lostman: it shouldn't fail as a syntax error
<lostman>
maybe I didn't build lwt properly? I just installed it through opam. other ppx extensions work (ppx_deriving for instance)
<lostman>
File "test.ml", line 57, characters 8-11:
<lostman>
Error: Syntax error
<def`>
so the problem is something else
<def`>
maybe paste your line of code
<reynir>
lostman: are you using camlp4?
<lostman>
let%lwt () = Lwt_unix.sleep 300.
<lostman>
57, 8 is where let begins
<lostman>
no camlp4
Kakadu has joined #ocaml
<def`>
lostman: ocaml version ?
<lostman>
4.02.3
<octachron>
lostman, do you have a syntax error without the "%lwt" part?
<def`>
something else is wrong in your code, maybe a semicolon above
<lostman>
you're right. the syntax wasn't correct. I was using let%lwt wrong
<lostman>
what is the proper way to sequence things? Lwt_io.printf "foo"; Lwt_unix.sleep 300. compiles too, but is it ok to do that?
<def`>
it should compile with a warning
<def`>
let%lwt will do sequencing fine
<Drup>
let%lwt () = Lwt_io.printf "foo" in Lwt_unix.sleep 300.
<lostman>
yeah. it's a bit heavy on the syntax though when let%lwt start piling up line after line. I also looked at ppx_monadic which has a haskell-like do notation
troydm has quit [Ping timeout: 246 seconds]
<Algebr>
Whats wrong with >>=
<companion_cube>
the extension is more useful for the try%lwt, while%lwt...
<Algebr>
+1 that's what I end up using it mostly for
troydm has joined #ocaml
rand has quit [Ping timeout: 256 seconds]
linse has quit [Quit: linse]
Haudegen has quit [Ping timeout: 244 seconds]
lobo has joined #ocaml
troydm has quit [Ping timeout: 246 seconds]
<Drup>
ppx_monadic is also ugly and abuses the ocaml syntax for no good reasons
troydm has joined #ocaml
<Drup>
(and it looks completely alien in the middle of an OCaml file)
slash^ has quit [Read error: Connection reset by peer]
troydm has quit [Ping timeout: 246 seconds]
antkong has quit [Quit: antkong]
Haudegen has joined #ocaml
<lostman>
nothing wrong with >>=. I wish >> was standard too. let (>>) ma mb = ma >>= fun () -> mb. having () on RHS is quite common after all and fun () -> ... is just clutter
<flux>
lostman, I think a lot of time people might prefer to use a lazy version of >> instead of that, though. which is what the syntax extensions bring to the table.
darkf has quit [Quit: Leaving]
sh0t has quit [Ping timeout: 272 seconds]
<lostman>
re ppx_monadic, abusing the syntax or not, I think it is still more readable than alternatives. I've been toying with a small script that uses Lwt and trying to make it as readable as possible
troydm has joined #ocaml
teiresias has joined #ocaml
<Algebr>
lostman: well, you don't exactly have to have >>= fun (), could just have the function that you have that expects () just be on the right side
<Algebr>
readability is an odd argument, everyone has different opinions on it depending on the day of the week
ianhedoesit has joined #ocaml
freehck has quit [Remote host closed the connection]
lewis1711 has quit [Ping timeout: 272 seconds]
Mercuria1Alchemi has quit [Ping timeout: 256 seconds]
linse has joined #ocaml
Anarchos has joined #ocaml
octachron has quit [Quit: Leaving]
yegods has quit [Remote host closed the connection]
badon_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
nullcatxxx_ has joined #ocaml
rand has joined #ocaml
teiresias has quit [Quit: leaving]
dexterph has quit [Quit: WeeChat 1.3]
dexterph has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
malc_ has joined #ocaml
troydm has quit [Ping timeout: 266 seconds]
badon has quit [Ping timeout: 272 seconds]
ygrek_ has quit [Ping timeout: 250 seconds]
badon has joined #ocaml
raxello has joined #ocaml
tkr has joined #ocaml
<raxello>
Hello friends, in the ocaml-cohttp README there is an example of the simple client code to download reddit page. We use "open" to load environment of modules. Is it possible now, in the REPL, to find out original Module of the identifier ?