RossJH has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<j0sh>
it seems to be picking up some other ocaml indentation file by default. i dont have anything else installed, maybe its bundled with the vim installation... does this have to be explicitly disabled?
<def`>
j0sh: ocp-indent-vim is an alternative plugin to bind ocp-indent to vim, with interactive indentation
<j0sh>
def`: yeah, i have some other indentation thing going, looks like its bundled with my vim installation. not sure how to disable that in favor of ocp-indent-vim
nojb has quit [Quit: nojb]
AlexRussia has quit [Ping timeout: 246 seconds]
BitPuffin has quit [Ping timeout: 245 seconds]
Hannibal_Smith has quit [Quit: Leaving]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
<j0sh>
def`: ah, figured it out. can manually set indentexpr=ocpindent#OcpIndentLine() in the vimrc and it works
enitiz has quit [Ping timeout: 264 seconds]
endiruna has quit [Ping timeout: 265 seconds]
AlexRussia has joined #ocaml
jao has quit [Ping timeout: 265 seconds]
boogie has quit [Remote host closed the connection]
enitiz has quit [Read error: Connection reset by peer]
enitiz has joined #ocaml
tnguyen has joined #ocaml
<pippijn>
is ubuntu precise no longer supported by opam?
<pippijn>
oh it is
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
jao has quit [Remote host closed the connection]
rock_neurotiko has quit [Ping timeout: 276 seconds]
rock_neurotiko has joined #ocaml
jao has joined #ocaml
mahem1 has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
MotorMe has joined #ocaml
struktured has joined #ocaml
manizzle has quit [Ping timeout: 246 seconds]
struktured has quit [Ping timeout: 265 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
tnguyen has quit [Quit: tnguyen]
kapil__ has joined #ocaml
darkf has joined #ocaml
chinglish has joined #ocaml
struktured has joined #ocaml
keen__________35 has joined #ocaml
keen__________34 has quit [Ping timeout: 245 seconds]
vanila has joined #ocaml
psy_ has quit [Quit: Leaving]
struktured has quit [Ping timeout: 244 seconds]
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
psy_ has joined #ocaml
struktured has joined #ocaml
chinglish has joined #ocaml
lostman_ has joined #ocaml
<lostman_>
hi all. I'm playing with Lwt and trying to use Lwt_io.make; one of the parameters is (Lwt_bytes.t -> int -> int -> int Lwt.t) and I can't find any documentation what those ints are... I have a rough idea but only that
<lostman_>
where does one look for docs?
<lostman_>
or do I have to look at the sources?
<whitequark>
it's called perform_io
<whitequark>
and the ints...
<whitequark>
look at Lwt_unix.write for example
<whitequark>
an out channel could be made with Lwt_io.make (Lwt_unix.write fd), I think.
q66 has quit [Quit: Leaving]
<lostman_>
so this is useful for creating an output_channel from something. can I create an 'empty' oc and write to it later?
araujo has quit [Ping timeout: 256 seconds]
<lostman_>
there's a write function
<lostman_>
oh wait hmm, I'm misunderstanding how it works.
ygrek has joined #ocaml
moei has quit [Read error: Connection reset by peer]
moei has quit [Read error: Connection reset by peer]
moei has joined #ocaml
yaewa has joined #ocaml
moei has quit [Ping timeout: 245 seconds]
yaewa has quit [Read error: Connection reset by peer]
moei has joined #ocaml
jao has quit [Ping timeout: 252 seconds]
moei has quit [Read error: Connection reset by peer]
moei has joined #ocaml
Pepe_ has joined #ocaml
badkins has quit [Remote host closed the connection]
kapil__ has quit [Quit: Connection closed for inactivity]
<vanila>
good luck!
Rebelion has quit [Quit: Saliendo]
badkins has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
badkins has quit [Ping timeout: 255 seconds]
<jneen>
dang it i always forget what's the magic things i have to do to get ocamlfind to find camlp4
rgrinberg has joined #ocaml
<jneen>
opam knows about it until it tries to build something and then can't find it
<whitequark>
system install?
<whitequark>
try `opam switch 4.02.1`
<jneen>
yeah
<jneen>
hm ok
enitiz has quit [Ping timeout: 252 seconds]
<jneen>
ok that still doesn't bring in camlp4 though
<whitequark>
opam install camlp4
<jneen>
right ok and that'll actually work this time
<jneen>
sweet
<jneen>
thanks whitequark
nullcat has joined #ocaml
slash^ has joined #ocaml
<jneen>
and now i've got a utop, but it spits out a lot of Unbound value Time_ns.*
<jneen>
even though those values are there
mearnsh has quit [Ping timeout: 272 seconds]
moei has quit [Read error: Connection reset by peer]
mearnsh has joined #ocaml
moei has joined #ocaml
badon has quit [Ping timeout: 250 seconds]
shinnya_ has quit [Ping timeout: 255 seconds]
dsheets has quit [Ping timeout: 264 seconds]
_um has joined #ocaml
ggole has joined #ocaml
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
_um has quit [Quit: Leaving...]
dsheets has joined #ocaml
kapil__ has joined #ocaml
MercurialAlchemi has joined #ocaml
rwmjones_on_hols is now known as rwmjones
testcocoon has joined #ocaml
eikke has quit [Ping timeout: 255 seconds]
<jneen>
is there an obvious way to print an arbitrary variant that i'm missing
<jneen>
printf doesn't seem to have any general "show" functionality
<MercurialAlchemi>
well, no
<MercurialAlchemi>
you would need typeclasses for that
<jneen>
right
<MercurialAlchemi>
What you often do is to have your type in a module with an associated to_string function
<MercurialAlchemi>
then you feed (YourModule.to_string your_structure) to printf
<jneen>
got it
<MercurialAlchemi>
(sort-of typeclasses are in the works, which would let you do what you want as long as the correct function is available, but it's not finished yet)
<ggole>
Or you could generate one with ppx
testcocoon has quit [Quit: Coyote finally caught me]
<MercurialAlchemi>
well, one thing is sure, there is no equivalent to Data::Dumper in OCaml, so there isn't a generic way of dumping a data structure for printing
testcocoon has joined #ocaml
<ggole>
There's generic marshalling, but that doesn't work for printing
<ggole>
(It's unsafe, too.)
<vanila>
what about the s-expression thing?
<ggole>
Er, what about it?
larhat has quit [Quit: Leaving.]
<jneen>
ok and finally, is there a decent parser combinator lib out there
<jneen>
one that supports unicode and recursive rules would be extra nice
<jneen>
i've had it up to here with ocamllex
<jneen>
and really i only need LL(1)
<ggole>
sedlex and menhir, probably
<ggole>
(Although menhir is more of an improvement to ocamlyacc.)
<jneen>
yeah i guess i'm just really not used to working with separated lexer/parser stacks
<jneen>
where you can't just write functions that transform parsers
<jneen>
hell i might just do rec descent manually
govg has quit [Ping timeout: 245 seconds]
<jneen>
also there are like 4 unicode libraries apparently?
tane has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
<ggole>
Yeah. Bit of a mess, really.
testcocoon has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcat has joined #ocaml
nullcat has quit [Client Quit]
AltGr has left #ocaml [#ocaml]
Simn has joined #ocaml
<rks`>
pippijn: I must have been dreaming
jonludlam has quit [Quit: Coyote finally caught me]
<companion_cube>
so, the [% ...] stuff is ppx-rewriting
<companion_cube>
it's not ocaml code per se, it's annotations to the code that will be used by sedlex to generate the actual lexer code
<jneen>
right
<jneen>
precompile macros essentially
<jneen>
but the part where it says
<jneen>
Sedlexing.Latin1.stuff
<jneen>
first of all, i'm probably not interested in latin-1
<companion_cube>
there's unicode too :)
<jneen>
Sedlexing.UTF8 or something?
<jneen>
i mean
<jneen>
i don't have Sedlexing.Anything
<companion_cube>
in your toplevel, you mean? You need #require "sedlex";;
<jneen>
oh nice
<jneen>
so ok i think i get it
<companion_cube>
if it's in your project, you need to add the package sedlex to dependencies ("BuildDepends: sedlex" in oasis, there are ways with ocamlbuild too)
<jneen>
Sedlexing doesn't exist as a module
<jneen>
but
<jneen>
Sedlexing.Latin1 and Sedlexing.Utf8 do
<companion_cube>
it exists if you link against the library sedlex, actually
<companion_cube>
and Sedlexing.Latin1 is a submodule
<jneen>
huh
<jneen>
ok
<companion_cube>
are you trying in a toplevel right now?
<jneen>
yeah in a utop
<jneen>
weird, i have BuildDepends: sedlex
<jneen>
but it still errors on `open Sedlexing`
<jneen>
do i have to tell oasis to link stuff?
<companion_cube>
try "oasis setup" again?
<companion_cube>
it doesn't update automatically by itself
<companion_cube>
in utop, you can load a library using #use "topfind";; (load ocamlfind) then #require "sedlex";;
<companion_cube>
the # is not the prompt, it's part of the command
<jneen>
now it's telling me unbound module Core
<companion_cube>
#require "core";; ?
<jneen>
ok i added core to BuildDepends and now it's complaining about -thread and -vmthread switches
RossJH has joined #ocaml
<jneen>
progress!
<companion_cube>
^^
<companion_cube>
add "threads" to the BuildDepends list
<pippijn>
so it will cache the entire file in the db
<MercurialAlchemi>
looks it caches the content of stdout
<pippijn>
right
<pippijn>
I'll need it for ocamldep
marynate has quit [Client Quit]
samrat has quit [Quit: Computer has gone to sleep.]
zyla has joined #ocaml
ygrek has joined #ocaml
cthuluh has joined #ocaml
booly-yam-4706 has joined #ocaml
<pippijn>
and again, I find that ocaml compilation is a pain
<pippijn>
1) input files may be ModuleName.ml or moduleName.ml
slash^ has quit [Read error: Connection reset by peer]
<pippijn>
2) if ModuleName/moduleName.mli exists, then .cmi is generated from .mli, and the rest (cmo, cmx, o) from .ml, and the rules that produce the rest depend on the cmi; if .mli does not exist, then .cmi and the rest are all generated from .ml
<seliopou>
hey anybody know the best way to get patches to zarith accepted?
<seliopou>
I submitted one via ocamlforge but that doesn't exactly look like a... well-trafficked site
slash^ has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
_twx_ has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
leowzukw has quit [Ping timeout: 246 seconds]
leowzukw has joined #ocaml
contempt has quit [Ping timeout: 244 seconds]
contempt has joined #ocaml
hhugo has joined #ocaml
boogie has joined #ocaml
boogie has quit [Client Quit]
Thooms has joined #ocaml
tani has joined #ocaml
<Drup>
seliopou: I don't think there are other choices
<seliopou>
Drup: figured, but thought I'd check. Thanks.
tane has quit [Ping timeout: 245 seconds]
nullcat has joined #ocaml
martintrojer has quit [Ping timeout: 264 seconds]
martintrojer has joined #ocaml
leowzukw has quit [Ping timeout: 244 seconds]
leowzukw_ has joined #ocaml
cthuluh has quit [Ping timeout: 245 seconds]
cthuluh has joined #ocaml
leowzukw_ has quit [Quit: Lost terminal]
Thooms has quit [Ping timeout: 245 seconds]
Thooms has joined #ocaml
struktured has joined #ocaml
ggole has quit []
slash^ has quit [Read error: Connection reset by peer]
swgillespie has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcat has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<pippijn>
jenga doesn't seem to like that ocamlopt overwrites .cmi, since it depends on that .cmi
tani has quit [Quit: Verlassend]
rgrinberg has joined #ocaml
Haudegen has quit [Ping timeout: 272 seconds]
Haudegen has joined #ocaml
bugabinga has joined #ocaml
lu324_ has joined #ocaml
lu324 has quit [Read error: Connection reset by peer]
<badkins>
Just listened to Anil talk about OCaml and Mirage on a podcast. Is anyone here deploying something via Mirage OS ?
<jneen>
hm so batteries has ParserCo but it looks like it's geared towards latin-1 :\
<jneen>
is there something that makes that magically work with utf8 streams instead
<Drup>
jneen: doesn't seem to care about encoding
<Drup>
it's polymorphic on the type of token and *you* define the token you want to use
<Drup>
only the lexer care about encoding and sedlex handle utf8
<Drup>
I like "This library is vastly more powerful than Lexing, Str, Parsing or Scanf. It is also considerably slower. "
<Drup>
at least, for once, it doesn't pretend to be of reasonable speed.
<jneen>
heh
nullcat has joined #ocaml
<jneen>
ok but
<jneen>
anything that lets me actually specify strings to lex
<jneen>
is in CharParser
<jneen>
which is all latin-1
<jneen>
i mean i suppose i could write a mountain of glue code to use it with sedlex or something? but then i may as well just use menhir
pgomes has quit [Ping timeout: 252 seconds]
<jneen>
i just want something that works without having to like, baby it ;_;
pgomes has joined #ocaml
<Drup>
I don't understand why you need CharParser.
<Drup>
sedlex is already doing that
<Drup>
(and CharParser, despite the name, is a lexer)
<jneen>
hrm
<jneen>
i was trying to do it without sedlex
<Drup>
I even linked you a gist of how to use sedlex+ParserCo.
<jneen>
yeah i saw that
<jneen>
it seemed like it was reimplementing sedlex
<jneen>
but anyways the stuff i want to do is gonna be hard with sedlex so...
<Drup>
jneen: also, you don't seem to understand that "the idiomatic way" to do a parser in OCaml is clearly menhir
<jneen>
ah, is it
<jneen>
i wasn't able to get that set up
<jneen>
i followed the instructions from rwo and the compiler built my mly file with ocamlyacc
<Drup>
yes, that's the default
<Drup>
but "true: use_menhir" in your _tags file
<Drup>
and that should be it.
<jneen>
true: use_menhir
<jneen>
ok
<jneen>
i also wasn't able to find docs of that particular setup step :\
<jneen>
oh do i need to do something different if the _tags file was generated with _oasis
<Drup>
you just need to add it out of the oasis section
<jneen>
yeah it looks interesting, although i'm not sure what the win over Bat.CharParser is
<Drup>
I'm just linking you stuff
<jneen>
ah yeah
<jneen>
i want to parse utf8 strings is the thing... unless i'm missing something that's all char lists
<Drup>
I consider parser combinators a stupid idea that is doomed to be ridiculously slow and that, except for natural language processing, every language should be LL(k) or LR(1).
<jneen>
if they're done right they should be LL(k) without explicit backtracking iirc
<Drup>
jneen: you do realize the parser doesn't care about encoding, only about tokens ?
<jneen>
so
<jneen>
the abstract definition of the parser doesn't care about encoding, yes
<jneen>
it's an abstract stream of stuff (tokens, chars, w/e)
<Drup>
and that lexing an utf8 string is as easy as "\"" [^"]* "\"" -> ...
<jneen>
sedlex?
<Drup>
with pretty much anything, in fact
<jneen>
?
<Drup>
you don't even need to handle utf8 explicitely to "accept anything utf8"
<Drup>
(that's why you can have utf8 in strings and comments in ocaml while ocamllex doesn't handle utf8 explicitely)
<jneen>
hm ok so i don't have to worry about e.g. getting stuck in the middle of multibyte glyphs?
<Drup>
I don't really see how that could happen
rgrinberg has joined #ocaml
<jneen>
i mean
<jneen>
if it's string's assumption that every character takes 8 bytes
<jneen>
uh i mean a byte
<Drup>
you're overcomplicating this so much :D
<jneen>
then it's gonna split some characters in half, right?
<Leonidas>
splitting charachters in half might happen anyway
<jneen>
?
* Leonidas
goes to check if UTF-8 has surrogate pairs
<pippijn>
Leonidas: surrogate pairs?
<jneen>
i'm just not used to hearing "eh don't worry about encoding you're probably fine"
<pippijn>
Leonidas: surrogate pairs are the utf-16 word for "multi-byte" (or in its case, multi-short)
<Leonidas>
oh, apparently not.
<Leonidas>
what I meant was the decomposition of charachters
<Leonidas>
e.g. of é into e and ´
<Leonidas>
not sure how this is named
<jneen>
ah yeah idk if it has that
<jneen>
but yeah there are multibyte glyphs for sure