piotrm has quit [Remote host closed the connection]
walter has joined #ocaml
walter has quit [Client Quit]
darkf has quit [Quit: Leaving]
darkf has joined #ocaml
Snark has joined #ocaml
bobry has joined #ocaml
ggole has joined #ocaml
yacks has joined #ocaml
<gasche>
I implemented something to detect probably-typos in ocamlbuild tags
<gasche>
more precisely, I warn on all tags that are present in the configuration files, but not used by any tag declaration
manud has quit [Quit: manud]
<gasche>
the funny thing, of course, is that I got half a dozen warnings for the part of the compiler distribution that use ocamlbuild
<gasche>
*uses
<gasche>
(ocamlbuild itself and camlp4)
<gasche>
I'll need to go through them and fix them, but once it's ironed out I think that can be a fairly useful feature
ygrek has quit [Ping timeout: 245 seconds]
asmanur has quit [Ping timeout: 264 seconds]
ben_zen has quit [Quit: sleeeeep]
asmanur has joined #ocaml
zpe has joined #ocaml
davekong has joined #ocaml
lopex has joined #ocaml
IbnFirnas has joined #ocaml
Yoric has joined #ocaml
zpe has quit [Ping timeout: 268 seconds]
ggherdov has joined #ocaml
Drup has quit [Quit: Leaving.]
thomasga has joined #ocaml
zpe has joined #ocaml
zRecursive has left #ocaml []
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
<whitequark>
gasche: oh, that is very nice. I was always surprised when ocamlbuild didn't barf on undefined tags
ygrek has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
Simn has joined #ocaml
librarian has joined #ocaml
<librarian>
Hi all! Recently I asked one of my friends to help me with code to my program and he write this: let (@@) f x = f x. It was used in List.map () @@ some_func. I google a little and found this article http://stackoverflow.com/questions/4242263/change-application-order-in-ocaml and suggest that this is the same thing. But when I try to explain it to my friend, he said that let (@@) is composition, and let (@@@) is application.
<librarian>
Could you say where I could read about such structures?
vpit3833` has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
vpit3833 has quit [Ping timeout: 240 seconds]
eikke has joined #ocaml
asmanur has quit [Ping timeout: 246 seconds]
<gasche>
librarian: I'm not quite sure what your question is
<gasche>
is it about what the words "composition" and "application" mean, or about the choice of infix symbols used to represent them?
<gasche>
the definition of (@@) that you have given is application
<gasche>
you're free to define any of these useful operations to any infix symbol you like, and in practice people have used all sorts of (@@), ($), (@$), (|>), (|!), (|-) etc.
<gasche>
that said, the next release of OCaml will use (@@) for aplication, so it's probably a good idea to respect this choice
zpe has joined #ocaml
<gasche>
(and (|>) for reverse application: fun x f -> f x)
asmanur has joined #ocaml
<gasche>
(one important difference between application and composition is that composition is associative, so the associativity of the infix symbol chosen doesn't matter; while for application left-associative and right-associative operators are very different)
<gasche>
(in OCaml, associativity and precedence of infix symbols is determined by their first few characters, according to a fixed table that can be found in the manual)
<gasche>
(everything beginning with "@" is right-associative, most other things are left-associative)
<whitequark>
gasche: when will that next release be? :]
<gasche>
the beta version was released a few days ago
<gasche>
usually there is only a few weeks between the beta and the release
<gasche>
(there are only?)
thomasga has quit [Quit: Leaving.]
<whitequark>
I see
csakatoku has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
ocp has joined #ocaml
<librarian>
gasche: Thanks for explanation, I will read and translate it a bit later to be sure, that I all understand correctly
<gasche>
you're welcome
weie has joined #ocaml
weie_ has quit [Ping timeout: 245 seconds]
djcoin has joined #ocaml
zpe has joined #ocaml
osa1 has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
zpe has joined #ocaml
Kakadu has joined #ocaml
ocp has quit [Ping timeout: 256 seconds]
ontologiae has joined #ocaml
ontologiae has quit [Client Quit]
mcclurmc has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
<Anarchos>
it gives me a syntax error on the "type" keyword (here version 4.02+dev0-201306-13)
<whitequark>
hm.
<whitequark>
I was doing that with utop
<whitequark>
indeed, regular toplevel emits a syntax error
<Anarchos>
whitequark the manual mentions parentheses around the "type"...
<whitequark>
see the last section
<whitequark>
regardless; why cannot I do this?
<whitequark>
# let f () : 'a. unit -> 'a * ('a -> unit) = "foo", print_endline;;
<whitequark>
Error: This expression has type 'b * 'c but an expression was expected of type 'a. unit -> 'a * ('a -> unit)
<whitequark>
is it unsound somehow? or are there other difficulties?
<Anarchos>
maybe you should put type annotation on print_endline ?
<flux>
well, print_endline doesn't match 'a. ('a -> unit) for one
<whitequark>
oh.
<whitequark>
right.
<whitequark>
still, I think what I'm doing is logically valid
<Anarchos>
try this one :
<Anarchos>
let f : 'a. unit -> 'a * ('a -> unit) = fun () -> "foo", (print_endline : ('a -> unit));;
<Anarchos>
the error message should explain you what's happening
<Anarchos>
(by the way you forgot the "fun () ->" part)
<whitequark>
right
thomasga has quit [Quit: Leaving.]
<whitequark>
yes, 'a. is the universal quantifier, and I want existential here
<whitequark>
and ocaml simply doesn't have that.
thomasga has joined #ocaml
<whitequark>
thanks
<whitequark>
(I know I can do that with first-class modules; I was wondering why I couldn't do it with just functions.)
<Anarchos>
i think that the type system of ocaml becomes more and more difficult to understand
<Anarchos>
with local types, universal types, +/- variant and so on...
<whitequark>
perhaps
_andre has joined #ocaml
n06rin has joined #ocaml
jgw25 has joined #ocaml
<jgw25>
Why does ocamlfind think that Bigarray depends on Unix? #require "bigarray" loads unix.cma first...
<Anarchos>
jgw25 did you read the source code of bigarray ?
<Anarchos>
map_internal takes a Unix.file_descr as parameter
ocp has joined #ocaml
<jgw25>
I see. I had compared with #load "bigarray.cma" which doesn't seem to do anything special. But I suppose to construct the Unix.file_descr to make the call one would have to load Unix.
contempt has quit [Ping timeout: 268 seconds]
jgw25 has quit []
contempt has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-130604]: i've been blurred!]
mcclurmc has joined #ocaml
introom has joined #ocaml
csakatoku has quit [Remote host closed the connection]
beginnner42 has joined #ocaml
Yoric has quit [Ping timeout: 264 seconds]
walter has joined #ocaml
AltGr has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
n06rin has quit [Read error: Connection reset by peer]
n06rin has joined #ocaml
<kerneis>
jbrown: #load does not load dependencies
<kerneis>
hmm, sorry, jgw25 has left
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
walter has quit [Quit: This computer has gone to sleep]
metasyntax has quit [Quit: Leaving]
ocp has quit [Ping timeout: 264 seconds]
Drup has joined #ocaml
ygrek has joined #ocaml
beginnner42 has quit [Ping timeout: 240 seconds]
walter has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
darkf_ has joined #ocaml
darkf has quit [Disconnected by services]
darkf_ is now known as darkf
flx has joined #ocaml
flx is now known as Guest8546
ocp has joined #ocaml
Leonidas_ has joined #ocaml
hcarty_ has joined #ocaml
adrien_ has joined #ocaml
Ptival_ has joined #ocaml
flux has quit [Disconnected by services]
bitbckt_ has joined #ocaml
Guest8546 is now known as flux
iZsh` has joined #ocaml
habnabit has joined #ocaml
walter has quit [Quit: This computer has gone to sleep]
iZsh has quit [*.net *.split]
hcarty has quit [*.net *.split]
_habnabit has quit [*.net *.split]
bitbckt has quit [*.net *.split]
adrien has quit [*.net *.split]
Ptival has quit [*.net *.split]
Leonidas has quit [*.net *.split]
Armael has quit [*.net *.split]
aggelos__ has quit [*.net *.split]
aggelos_ has joined #ocaml
ocp has quit [Ping timeout: 256 seconds]
bitbckt_ is now known as bitbckt
bitbckt has quit [Changing host]
bitbckt has joined #ocaml
ocp has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
k4nar has joined #ocaml
Armael has joined #ocaml
troydm has quit [Ping timeout: 264 seconds]
x-s4nd3r has quit [Quit: i'll be back in a moment, just gotta do some stuff...]
introom has quit [Remote host closed the connection]
librarian has left #ocaml []
cdidd has quit [Remote host closed the connection]
metasyntax has joined #ocaml
malo_ has joined #ocaml
carleastlund has joined #ocaml
malo has quit [Ping timeout: 256 seconds]
<Kakadu>
gasche: hi!
<Kakadu>
We were taking in Friday that parser-combintors allocate a lot of memeory during parsing and that's why the next pretty printing works slow
<Kakadu>
Any ideas how to find places where memory is allocated? Examining the .s files?
ollehar has quit [Ping timeout: 246 seconds]
<Kakadu>
Also, I have written recursive-descent parser which does the same work and which works the similar time
<Kakadu>
It seems that it has the allocation issue too. Any ideas how to study that?
<Kakadu>
General question: are OCaml runtime internals documented somehow?
introom has joined #ocaml
ocp has quit [Ping timeout: 256 seconds]
<ggole>
All sorts of things allocate in OCaml
oriba has joined #ocaml
cdidd has joined #ocaml
structuralist has joined #ocaml
introom has quit [Ping timeout: 245 seconds]
mcclurmc has joined #ocaml
<whitequark>
what could be the cause of very imprecise backtraces?
<whitequark>
such as Called from file "src/core/ssa.ml", line 459, characters 2-727
<whitequark>
>2-727
<whitequark>
I assume it would be some sort of inlining, how do I disable it?
malo_ has quit [Quit: Leaving]
Matthieu4 has joined #ocaml
<AltGr>
whitequark: thanks for the ocp-index binding :)
<whitequark>
AltGr: you're welcome!
<gasche>
whitequark: it's strange
<gasche>
did you use syntax extensions that could mess with locations?
<whitequark>
I have camlp4 enabled but this file only uses ocaml syntax
<whitequark>
so, that would be -tag syntax(camlp4o)
<whitequark>
I tried to compile that to bytecode, with exactly same result
ccasin has joined #ocaml
<whitequark>
AltGr: maybe you could tweet about it or reddit or something, I don't really know how to reach ocaml users
hkBst has quit [Quit: Konversation terminated!]
Matthieu4 has left #ocaml []
oriba has quit [Quit: oriba]
smondet has joined #ocaml
Anarchos has joined #ocaml
<Anarchos>
Why do i get an error with the following include :
<Anarchos>
module type S = sig end;;
<Anarchos>
module type T = functor (Sig:S) -> sig end;;
<Anarchos>
module type F = functor (Sig:S) -> sig include (T(Sig)) end;;
Yoric has joined #ocaml
<gasche>
Anarchos: you want to use "module T = functor", not "module type T = functor"
<gasche>
hm
<gasche>
I'm actually not sure what you mean
<ggole>
Don't functors map to structs, not sigs?
<gasche>
but if T is the signature of a functor, T(Foo) makes no sense
<gasche>
ggole: yeah, but the struct could contain a sig, with a different syntax
<AltGr>
whitequark: I'll at least link to the binding from ocp-index README
<ggole>
It would be nice if various bits and pieces defined such things
contempt has quit [Ping timeout: 268 seconds]
<ggole>
I've often written array_for_all or array_find.
eikke has quit [Read error: Operation timed out]
<companion_cube>
well, my code compiles :p
<gasche>
assert Sequence.(of_hashtbl h |> for_all (fun (k,_v) -> Hashtbl.mem h k))
<companion_cube>
right, I still don't have the reflex of using such local open
contempt has joined #ocaml
rfk has quit [Ping timeout: 256 seconds]
Kakadu has quit [Quit: Konversation terminated!]
rfk has joined #ocaml
contempt has quit [Ping timeout: 264 seconds]
thomasga has joined #ocaml
contempt has joined #ocaml
structuralist has quit []
_andre has quit [Quit: leaving]
<whitequark>
I wonder why is there no Hashtbl.rehash
contempt has quit [Ping timeout: 264 seconds]
contempt has joined #ocaml
n06rin has quit [Quit: Leaving.]
_andre has joined #ocaml
contempt has quit [Remote host closed the connection]
<gasche>
whitequark: what would an API for that be? you need to know the old hash, and it's probably too late to get it
<gasche>
looks fairly tedious for something really ugly that people are not supposed to do with hashtables, and that they could implement on the user side if they really wanted to
tane has joined #ocaml
<whitequark>
gasche: Hashtbl.rehash tbl
<gasche>
ah
<gasche>
you mean rehash the whole table
<gasche>
there is something like that internally, done at resize time
<gasche>
(I worked on a patch to make it tail-recursive a few weeks ago)
<gasche>
but I'm not sure I see good use-cases for it
<whitequark>
well
<whitequark>
ruby has Hash#rehash, but I'm not quite sure whether its usage ever makes sense
<whitequark>
it looks like the sort of a feature which masks a different bug
<ggole>
That's the best kind of feature!
<ggole>
Who doesn't want their bugs hidden?
contempt has joined #ocaml
<gasche>
fact of the day: ocamlbuild's "sanitize" file used to be called "sterilize"
<gasche>
that was in line with the whole "hygiene" concept, but I understand people weren't happy with it
<adrien_>
:D
Yoric has joined #ocaml
<gasche>
I don't know how people were tracking bugs before git
<adrien_>
poorly?
<ousado>
phew.. finally found a way to model a state machine with GADTs
<gasche>
ousado: why do you need GADTs for that?
darkf has quit [Quit: Leaving]
<gasche>
adrien_: something that is missing in my workflow
osa1 has joined #ocaml
<gasche>
is a kind of augmented blame tool that can show me the history of some small portion of the program
<ousado>
gasche: I'm not sure I really need them
<gasche>
I'm often interested in where, say, 5 lines come from
<gasche>
but "git blame" will give me the commit that made a whitespace change to them, which is not what I want
<gasche>
so then I checkout before that commit, and run blame again
<gasche>
I think this could be automated
<gasche>
but it's non-obvious for a tool to know where the code I'm interested in is before a change
<ousado>
but I wanted to model both states and transition events with ADTs
<gasche>
(I think we could have heuristics that work well, and otherwise show the diff to the user and ask him to select the piece he still wants to track)
<gasche>
ousado: I'm not saying you're wrong, I don't know
Yoric has quit [Ping timeout: 264 seconds]
ocp has joined #ocaml
troydm has joined #ocaml
Myk267 has joined #ocaml
<adrien_>
gasche: git blame -w
<adrien_>
git blame -w path 1efb456~~
<gasche>
I was using whitespace as an example
<gasche>
it's not always the case
<gasche>
there is also "git blame -L" that allows something related
<gasche>
(you can blame on the first line that matches some regexp)
<gasche>
I just did a quick web search
<gasche>
it looks like "tig" has a nice interface for what I want
<gasche>
basically you go to any line in the blame, press ",", and it will blame the version from before the commit that changed that line
<ousado>
gasche: https://gist.github.com/ousado/356bb8e097129f45ea21 here st is a state and se is some event (e.g. caused by some action in a GUI) and by this use of GADTs one can make sure that the only way to proceed from some state is via a valid event, encoded by tagging the respective states and events with the same type
<gasche>
if they have some logic in place to put the cursor in "the right place" (the one where the line comes from), that's enough for my needs
<gasche>
tig looks really nice
<gasche>
ousado: so in essence you have a multi-sorted transition system
Anarchos has quit [Quit: Vision[0.9.7-H-130604]: i've been blurred!]
contempt has quit [Ping timeout: 248 seconds]
<ousado>
yes
<ousado>
it essentially buys exhaustiness checks
<adrien_>
gasche: gitk is very nice too :-) ; but no such blame (although git gui has something)
<ddonna>
So, has sexplib disappeared from Godi? Is that just me?
contempt has joined #ocaml
<adrien_>
it has
<ddonna>
So, one would install libsexplib-camlp4-dev or somesimilar, then work out the linking manually?
<ddonna>
...or is there something fundamentally broken about the library?
<adrien_>
you can't mix packages
Yoric has quit [Ping timeout: 246 seconds]
<adrien_>
from different sources
<ddonna>
Not even by hand-crafting the linking paths? Strange.
<ddonna>
So the solution is pretty much to switch to other repos, reimplement, or despair.
<ddonna>
I'm curious about the history behind that, if anyone happens to know, but no big deal otherwise.
Neros has quit [Ping timeout: 246 seconds]
<whitequark>
adrien_: can't you? I've successfully used system LLVM and base compiler together with opam stuff
<adrien_>
you can to some extent
<adrien_>
but while you'll be trying to fix all the issues that appear, I'll be outside
<adrien_>
ddonna: you can download, build and install sexplib
<adrien_>
by hand
<adrien_>
should be quick and easy
<ddonna>
drop it in the godi!ocamlfind path, waltz away with a song in my heart?
<adrien_>
"make install" should use ocamlfind to do everything
<ddonna>
Uh-oh... the only distribution of sexplib that I could find is the janestreet core... which depends on bin_prot, which is not available in GODI. My honed senses detect a pattern.
<ddonna>
Did Yaron Minsky insult somebody's mom?
<Drup>
ddonna: you don't read the caml list, do you ? :]
<gnuvince>
OCaml drama?
<ddonna>
Drup: alas, I do not. But I just took a look, and I'm starting to get a taste of the flavour.
<whitequark>
adrien_: it's not like I have a choice :/
<ddonna>
It would appear that now is the time to learn raw ocamlfind.
<whitequark>
it does not make any sense to compile LLVM on the CI server, I cannot change the default environment of CI, and most of my dependencies are not in Debian (even if they were, I'd have to recompile them for 4.00 anyway.)
cthuluh has quit [Ping timeout: 256 seconds]
x-s4nd3r has joined #ocaml
<bitbckt>
ddonna: it isn't usually so dramatic. this particular topic is fraught with peril for the new reader, though.
<ddonna>
Hmmm. Looks like Jane Street's build scripts don't play nice with godi's installation paths. Might be time to throw some babies out with the bathwater.
<chris2>
why not simply use opam?
<ddonna>
Until about 10 seconds ago, the answer was "because I have never heard of that." The situation has since evolved.
<chris2>
:)
<ddonna>
On which note: thank you.
<chris2>
yw ;)
<chris2>
(unless you are on win32...)
iZsh` has quit [Quit: jumpin' jumpin']
iZsh has joined #ocaml
<ddonna>
Ubuntu. The birkenstocks-with-socks to win32's pair of crocs
structuralist has quit [Ping timeout: 268 seconds]
ocp has quit [Ping timeout: 246 seconds]
eikke has joined #ocaml
thomasga has quit [Quit: Leaving.]
Yoric has quit [Ping timeout: 246 seconds]
malo has joined #ocaml
Yoric has joined #ocaml
vpit3833` is now known as vpit3833
gasche has quit [Ping timeout: 260 seconds]
gasche has joined #ocaml
Yoric has quit [Ping timeout: 264 seconds]
ollehar has joined #ocaml
osa1 has quit [Ping timeout: 264 seconds]
_malicious has joined #ocaml
introom has joined #ocaml
smondet has quit [Quit: Breathe!]
void64 has quit [Quit: Leaving]
mfp has quit [Ping timeout: 256 seconds]
djcoin has quit [Quit: WeeChat 0.4.0]
zRecursive has joined #ocaml
mfp has joined #ocaml
malo has quit [Quit: Leaving]
clj_newb_2345 has joined #ocaml
<clj_newb_2345>
ping
<clj_newb_2345>
I'm familiar with Clojure (very little typing and Coq (lots of typing). I need to learn Ocaml very rapidy in order to write plugins for Coq.
<clj_newb_2345>
What is the most efficient way to pick up OCaml?
Drup has quit [Ping timeout: 248 seconds]
<clj_newb_2345>
I'm also using vim. Is there a better setup than "omlet" (which apears to be dead since 2005)
introom has quit [Remote host closed the connection]
eikke has quit [Ping timeout: 248 seconds]
_malicious has left #ocaml []
introom has joined #ocaml
<whitequark>
clj_newb_2345: real world ocaml
<clj_newb_2345>
whitequark: amazonsays not released yet