AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
freusque has joined #ocaml
AltGr has joined #ocaml
MercurialAlchemi has joined #ocaml
wu_ng has quit [Quit: Leaving]
freusque has quit [Ping timeout: 245 seconds]
johnelse_ has joined #ocaml
johnelse has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
richi235 has joined #ocaml
kakadu has joined #ocaml
zpe has joined #ocaml
<orbitz>
Is there a best-practices for building, installing, and making documenttaion merlin-friendly? Is ocamldoc still the correct tool/
<companion_cube>
for merlin, you should compile and install .cmt{,i} files
<orbitz>
Ok
argent_smith has joined #ocaml
<companion_cube>
and perhaps .mli, too
richi235 has quit [Ping timeout: 240 seconds]
slash^ has joined #ocaml
freusque has joined #ocaml
dhil has joined #ocaml
freusque has quit [Client Quit]
freusque has joined #ocaml
freusque has quit [Quit: WeeChat 1.7]
freusque has joined #ocaml
frefity has quit [Ping timeout: 240 seconds]
govg has quit [Quit: leaving]
govg has joined #ocaml
ygrek has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
Mercuria1Alchemi has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
frefity has joined #ocaml
MercurialAlchemi has quit [Remote host closed the connection]
cranmax has joined #ocaml
AlexDenisov has joined #ocaml
fre has joined #ocaml
freusque has quit [Ping timeout: 268 seconds]
mpenet has joined #ocaml
lopex has joined #ocaml
frefity has quit [Ping timeout: 240 seconds]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
frefity has joined #ocaml
mfp has joined #ocaml
snhmib has joined #ocaml
silver has joined #ocaml
dhil has quit [Ping timeout: 268 seconds]
AlexDenisov has joined #ocaml
shinnya has joined #ocaml
mengu has joined #ocaml
srenatus[m] has quit [Quit: Client limit exceeded: 10000]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dhil has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
dhil has quit [Ping timeout: 268 seconds]
AlexRussia has quit [Ping timeout: 240 seconds]
cranmax has quit [Quit: Connection closed for inactivity]
nomicflux has joined #ocaml
<apache2>
can I "rewind" an lwt socket if I read too many bytes from it?
<apache2>
(or inject more stuff at the beginning before returning the lwt_io channel)
nomicflux has quit [Client Quit]
<companion_cube>
I don't think so, it's not a file…
<apache2>
hmm looks like Lwt_io.block could be used, but it's a bit hacky
jabroney has joined #ocaml
mpenet has left #ocaml ["ERC (IRC client for Emacs 26.0.50.2)"]
gtrak has joined #ocaml
AlexDenisov has joined #ocaml
richi235 has joined #ocaml
mrgrieves has joined #ocaml
<mrgrieves>
i'm trying to understand how to access nested tuples. if I have something like 'let x = (1,(key, true)' what's the best way to access key 's value?
<mrgrieves>
I was trying to workout what the compound expresion will look like i.e let ... in ... but not sure how to
<Drup>
let (i, (k, b)) = x ...
<theblatte>
- infer-deps-ntCE is not available because the package is pinned to /home/vagrant/infer/dependencies/infer-deps-ntCE, version 0.11.0.
<theblatte>
that's not a very good reason for not being available
<mrgrieves>
Drup: I see, thanks
gtrak has quit [Quit: Leaving]
mengu has quit [Remote host closed the connection]
<theblatte>
somehow that error meant "please run `opam update`"
<theblatte>
:/
sh0t has joined #ocaml
govg has quit [Ping timeout: 252 seconds]
bacam has quit [Quit: Changing server]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
bacam has joined #ocaml
richi235 has quit [Ping timeout: 252 seconds]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
argent_smith1 has joined #ocaml
argent_smith has quit [Ping timeout: 240 seconds]
argent_smith has joined #ocaml
richi235 has joined #ocaml
argent_smith1 has quit [Ping timeout: 255 seconds]
argent_smith1 has joined #ocaml
argent_smith2 has joined #ocaml
AlexRussia has joined #ocaml
argent_smith has quit [Ping timeout: 255 seconds]
argent_smith1 has quit [Ping timeout: 260 seconds]
<orbitz>
how does one generate a cmti file? I see the manpage for ocamlc says -bin-annot to make cmt files. Compiling .mli to .cmi with -bin-annot doesnt' seem to make a .cmti implicitly
<orbitz>
Oh wait, there it is. I think I just got confused.
snhmib has quit [Ping timeout: 252 seconds]
ryanartecona has joined #ocaml
spew has joined #ocaml
copy` has joined #ocaml
cranmax has joined #ocaml
groovy3shoes has quit [Ping timeout: 246 seconds]
fre has quit [Quit: WeeChat 1.7]
zpe has quit [Remote host closed the connection]
<orbitz>
Do functors mess up cmti and merlin looking up documentation?
govg has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
groovy3shoes has joined #ocaml
jao has joined #ocaml
_whitelogger has joined #ocaml
taosx1 has joined #ocaml
taosx has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
jabroney has quit [Ping timeout: 240 seconds]
mrgrieves has quit [Quit: Lost terminal]
jabroney has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ryanartecona has joined #ocaml
richi235 has quit [Ping timeout: 260 seconds]
richi235 has joined #ocaml
dhil has joined #ocaml
Anarchos has joined #ocaml
Algebr has joined #ocaml
al-damiri has joined #ocaml
Algebr has quit [Remote host closed the connection]
malc_ has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
dhil has quit [Ping timeout: 252 seconds]
Algebr has joined #ocaml
groovy3shoes has quit [Quit: Leaving]
srcerer has joined #ocaml
govg has quit [Quit: leaving]
malc_ is now known as malc
malc has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
govg has joined #ocaml
frefity has quit [Ping timeout: 245 seconds]
jabroney has quit [Quit: Leaving.]
cranmax has quit [Quit: Connection closed for inactivity]
Algebr has quit [Ping timeout: 240 seconds]
frefity has joined #ocaml
dhil has joined #ocaml
orbifx has joined #ocaml
jabroney has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
<hpd_m>
So I'm in the toplevel directory of an Oasis project that defines a library. What do I need to do to be able to load the modules form that library into the toplevel (utop)? I always get `reference to undefined global Module`
<companion_cube>
you can write a .ocamlinit that contains the directives such as
<companion_cube>
#directory "_build/src/foo/";;
<companion_cube>
#load "foo.cma";;
AlexDenisov has joined #ocaml
<hpd_m>
companion_cube: That works, thank you!
<companion_cube>
:)
_andre has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
richi235 has quit [Ping timeout: 240 seconds]
richi235 has joined #ocaml
ygrek has joined #ocaml
ryanartecona has joined #ocaml
AlexDenisov has quit [Ping timeout: 252 seconds]
AlexDenisov has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
<n4323>
hi, a question about Ctypes.Dl.
<n4323>
i would like to load a library on either os x or linux. it works if i give a filename to dlopen.
<n4323>
how can i test for the os type to generate either .so or .dylib in the filename string?
jabroney has left #ocaml [#ocaml]
<n4323>
or am i doing it wrong(TM) and there is a better way to handle this in general?
<companion_cube>
no idea, sorry ^^
AltGr has left #ocaml [#ocaml]
<technomancy>
n4323: I don't know a lot about ctypes, but I was able to use it without specifying .so vs whatever
<technomancy>
^ no guarantees that is The Right Way, but it has worked for me
<n4323>
hm. this means that your system can find the readline shared library on its own.
<n4323>
maybe if i set LD_LIBRARY_PATH to point to my custom shared library location i don't need the filename?
<technomancy>
don't ask me what that code does because I wrote it 4 years ago and have forgotten everything I know about FFI =)
<technomancy>
oh yeah, it assumes readline is accessible system-wide
<n4323>
not sure if that's the right variable though...
tane has joined #ocaml
ktosiek[m] has quit [Quit: Client limit exceeded: 10000]
orbifx has quit [Ping timeout: 252 seconds]
Algebr has joined #ocaml
<vmonteco>
Hello! :)
<vmonteco>
I'd need some advices, is there a way to make the generic case at the end of a match ... with statement unnecessary? Can I consider that the list I pass to my function is necessary not empty (and avoid the | [] -> ... case at the end). Or perhaps it would be considered as a bad practice?
<vmonteco>
(In my case, I'd like to get the lowest value in a list, but empty list case wouldn't be relevant)
<companion_cube>
it's bad practice imho
<companion_cube>
I put an explicit `[] -> assert false` in this case
<companion_cube>
(the assertion failure will point me to the file+line in case of error)
<theblatte>
s/assert false/invalid_arg "cannot run on an empty list"/
<hannes>
vmonteco: you can write partial matches. you can also raise in the empty list case. but imho it is bad practise to have partial matches
<companion_cube>
theblatte: depends
<theblatte>
companion_cube: yes :)
ygrek has quit [Remote host closed the connection]
<companion_cube>
in a public facing function, I agree
<theblatte>
here it seemed that the list is passed as argument and the function doesn't want it
dhil has quit [Ping timeout: 260 seconds]
<companion_cube>
internally, I use assertions because I (should) control the invariants
ygrek has joined #ocaml
<theblatte>
ah, I use invalid_arg internally too, assert false is for "the typechecker is not smart enough"
<companion_cube>
oh :D
<companion_cube>
well, matter of taste
<theblatte>
and failwith is for "doh, my invariant broke"
<theblatte>
agreed ;)
<vmonteco>
I'll use an exception in such case then. Thank you for the suggestion. :)
zpe has quit [Remote host closed the connection]
kakadu has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
larhat has joined #ocaml
argent_smith2 has quit [Quit: Leaving.]
ryanartecona has quit [Quit: ryanartecona]
AlexRussia has quit [Ping timeout: 240 seconds]
SpiceGuid has joined #ocaml
<vmonteco>
Hello again! I'd need some explanations about how List.fold_left works :) How is it different of List.sort? :)
<_y>
?
<vmonteco>
_y: What's the purpose of List.fold_left *?
<_y>
vmonteco, if you have ever heard of list reducing, this is essentially the same thing
<vmonteco>
_y: is it to recursivelly select an element in a list to get the biggest/lowest one? (for exemple) Recursivelly applying min/max on every element in the list?
<vmonteco>
While sort just gives a new list with the same elements but with a different order?
<Drup>
you can also compute the sum/product, and all kind of things
<Drup>
lot's of operations can be defined with folds
<technomancy>
vmonteco: it doesn't really have anything to do with recursion
<_y>
« List.fold_left f 0 [1;2;3] » is « f (f (f 0 1) 2) 3 »
<vmonteco>
technomancy: Yes, but could we consider it is an alternative to function people probably usually implement in a recursive way?
<technomancy>
it's more like `map` but instead of taking one value and returning a transformation of the value, you take an accumulator and a value, and return a new version of the accumulator that takes that value into account
<technomancy>
vmonteco: depending on your language background, maybe
<vmonteco>
for instance, to search the min in a list [1;2;3], it's the same as making min 1 (min 2 3)?
<_y>
so indeed « List.fold_left max 0 my_list » would give you the maximum of a list of non-negative integers (or 0 if empty)
<technomancy>
fold is more general than map, but recursion is more general than fold
<technomancy>
because fold still has the restriction that f is called exactly once per element
orbifx has joined #ocaml
AlexRussia has joined #ocaml
<vmonteco>
But if I have to get --- for instance --- the n smallest element in a list, I'd better sort the list and get the n first elements, right?
<technomancy>
that is probably the most readable way, but doing it with folding will take less memory
sphinxo has joined #ocaml
<Drup>
it's not really the most readable way either :p