kamog has quit [Remote host closed the connection]
sz0 has quit [Quit: Connection closed for inactivity]
minn has joined #ocaml
brunoro has quit [Ping timeout: 265 seconds]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
brunoro has joined #ocaml
AlexDenisov has quit [Ping timeout: 260 seconds]
sh0t has quit [Remote host closed the connection]
mfp has quit [Ping timeout: 252 seconds]
wxfdglm has joined #ocaml
luzie has quit [Quit: WeeChat 1.7-dev]
luzie has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
minn has quit [Ping timeout: 250 seconds]
silver has quit [Read error: Connection reset by peer]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Ping timeout: 260 seconds]
TarVanimelde has joined #ocaml
wxfdglm_ has joined #ocaml
wxfdglm has quit [Ping timeout: 268 seconds]
rand__ has joined #ocaml
rand__ has quit [Client Quit]
gjaldon has joined #ocaml
TarVanimelde has quit [Quit: Leaving]
al-damiri has quit [Quit: Connection closed for inactivity]
minn has joined #ocaml
Heasummn has joined #ocaml
nomicflux has quit [Quit: nomicflux]
nomicflux has joined #ocaml
TarVanimelde has joined #ocaml
gjaldon has quit []
nomicflux has quit [Quit: nomicflux]
nomicflux has joined #ocaml
gjaldon has joined #ocaml
nomicflux has quit [Quit: nomicflux]
gjaldon has quit [Remote host closed the connection]
TarVanimelde has quit [Quit: Leaving]
pierpa has quit [Ping timeout: 252 seconds]
Heasummn has quit [Remote host closed the connection]
brunoro has quit [Ping timeout: 256 seconds]
brunoro has joined #ocaml
groovy2shoes has joined #ocaml
wolfcore has quit [Ping timeout: 260 seconds]
wolfcore has joined #ocaml
zv has quit [Quit: WeeChat 1.5]
whisperedcigar has joined #ocaml
noddy has quit [Ping timeout: 265 seconds]
nahra has quit [Remote host closed the connection]
nahra has joined #ocaml
malc_ has joined #ocaml
noddy has joined #ocaml
zv has joined #ocaml
AlexDenisov has joined #ocaml
AlexDenisov has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Ping timeout: 250 seconds]
MercurialAlchemi has joined #ocaml
kevinch has joined #ocaml
whisperedcigar has quit [Remote host closed the connection]
Simn has joined #ocaml
TarVanimelde has joined #ocaml
malc_ has quit [Remote host closed the connection]
jimt_ has joined #ocaml
jimt has quit [Ping timeout: 245 seconds]
Algebr has joined #ocaml
kevinch has quit [Quit: Computer has gone to sleep.]
iyy has quit [Quit: leaving]
iyy has joined #ocaml
slash^ has joined #ocaml
soupault has joined #ocaml
<soupault>
hello!
<soupault>
I have a range on ints and I'd like to run my recursive function on each combination of (i, i), where `i` is an element of that range. How do I do this?
<Algebr>
make a cartesian product with a list.map in a list.map
gjaldon has joined #ocaml
TarVanimelde has quit [Read error: Connection reset by peer]
mfp has joined #ocaml
<gjaldon>
how to load whole project's modules and dependencies into utop?
<gjaldon>
do I have to #require every package and #use every module in the project?
<Algebr>
no, #require should be enough
_whitelogger has joined #ocaml
larhat has quit [Quit: Leaving.]
argent_smith has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
AlexDeni_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adrien>
is there an announce page for 4.04.0 that I've missed?
<adrien>
hannes: I was looking for a page which had both the announcement and links to binaries rather than only the file list
<adrien>
(I want to update the channel topic)
<Algebr>
so many GADT related changes
<adrien>
(and I won't have time to do that page myself before a couple more days)
<Algebr>
4.04 not on opam yet it seems
sillyotter has quit [Quit: WeeChat 1.4]
octachron has joined #ocaml
zpe has joined #ocaml
TarVanimelde has joined #ocaml
AlexDenisov has joined #ocaml
frefity has quit [Ping timeout: 250 seconds]
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Read error: Connection reset by peer]
frefity has joined #ocaml
malc_ has joined #ocaml
malc_ has quit [Read error: Connection reset by peer]
malc_ has joined #ocaml
freusque has joined #ocaml
larhat has joined #ocaml
AlexDeni_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
freusque has quit [Quit: WeeChat 1.4]
nomicflux has joined #ocaml
TarVanimelde has quit [Ping timeout: 244 seconds]
minn has quit [Ping timeout: 260 seconds]
TarVanimelde has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
larhat has quit [Quit: Leaving.]
ousado has joined #ocaml
<ousado>
is there a way to have an alias for a ref in another module?
<ousado>
so that B.myref := foo actually updates A.myref ?
<ousado>
I'm trying to alias a whole module here, and it has some global state
brunoro has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
<octachron>
ousado, the straightforward implementation should work? (e.g. "module M = struct let x = ref … end;; module N=M")
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 252 seconds]
slash^ has joined #ocaml
freusque has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TarVanimelde has quit [Quit: Leaving]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 252 seconds]
brunoro has joined #ocaml
<ousado>
octachron: yeah, I need to replace a few parts, so I need to forward stuff selectively
brunoro has quit [Ping timeout: 268 seconds]
bronsen has quit [Ping timeout: 260 seconds]
Rome has quit [Changing host]
Rome has joined #ocaml
bronsen has joined #ocaml
brunoro has joined #ocaml
soupault has quit [Read error: Connection reset by peer]
Algebr has quit [Ping timeout: 244 seconds]
kevinch has joined #ocaml
zpe has quit [Remote host closed the connection]
rand__ has joined #ocaml
mcspud has quit [Ping timeout: 260 seconds]
kevinch has quit [Quit: Computer has gone to sleep.]
mcspud has joined #ocaml
dmi3y has joined #ocaml
shinnya has joined #ocaml
xieyuheng has joined #ocaml
<xieyuheng>
different types sharing some constructors would be warned !
<xieyuheng>
should I avoid such ?
Algebr has joined #ocaml
xieyuheng has quit [Remote host closed the connection]
xieyuheng has joined #ocaml
xieyuheng has quit [Remote host closed the connection]
<octachron>
xieyuheng, opinions differ on this warning
xieyuheng has joined #ocaml
<octachron>
I generally deactivate warnings 40-42 because I consider that having useful shared names is worth the occasional headaches
richi235 has quit [Ping timeout: 244 seconds]
richi235 has joined #ocaml
freusque has quit [Ping timeout: 268 seconds]
sfri has quit [Remote host closed the connection]
dmi3y has quit [Quit: dmi3y]
yunxing has quit [Read error: Connection reset by peer]
yunxing has joined #ocaml
mrallen1 has quit [Read error: Connection reset by peer]
mrallen1 has joined #ocaml
pierpa has joined #ocaml
Onemorenickname has joined #ocaml
<xieyuheng>
I am sure I want to share constructors >_<
<xieyuheng>
how should I disable this warning ?
<octachron>
note that you share constructor names, not the constructor themselves
Sim_n has joined #ocaml
<Onemorenickname>
hello people, i was wondering about lexing and parsing. if i use a lexer before a parser, what will happen to comments and string literals ? i will have to rebuild them from the tokens ?
<xieyuheng>
octachron: one constructor can not have two types ?
<octachron>
xieyuheng, at the project level, you should edit your warning list to remove 42 (and maybe 41)
<octachron>
xieyuheng, no, a constructor always have one type
<Onemorenickname>
xieyuheng, i just came, but maybe you are looking for polymorphic variant ?
<octachron>
but different types can share the same constructor name
<Onemorenickname>
basically, you add a ` before the constructor name, and you can use it in several types
<xieyuheng>
ok >_<
Simn has quit [Ping timeout: 250 seconds]
<ia0>
Onemorenickname: usually lexing removes comments or see them as a single token (I don't understand your question, do you want to parse the content of comments?)
<Onemorenickname>
ia0 : i see how it can works for string literals, given they are regular, but how about layered comments ?
<Onemorenickname>
in ocaml, i can write (* (* dd *) *)
<Onemorenickname>
(and a^n b^n is indeed not a regular language)
<ia0>
they are still one token, the lexer is not doing regexps
<Onemorenickname>
ia0, i see
<Onemorenickname>
i thought ocaml used lexyac
<octachron>
Onemorenickname, ocaml uses ocamlyacc
<Onemorenickname>
octachron, there is no lexing before yacc ?
Sakarah has joined #ocaml
<ia0>
see ocaml/lex/lexer.mll there is a comment_depth reference to track the comment depth
<ia0>
the lexer of ocaml is much more than regexps
<ia0>
it's recursive functions
<octachron>
ia0, this is ocamlyacc lexer, the compiler lexer is in parsing/lexer.mll
<octachron>
Onemorenickname, sorry, I meant ocamllex
<octachron>
and comment lexing is quite complicated, in particular due to documentation comments
<Drup>
Onemorenickname: you can have muturally recursive lex rules. This provides you with basically a stack, which explain the expressivity you noticed
<Onemorenickname>
i see
<Onemorenickname>
i thought lex rules could not be mutually recursive
<Drup>
not sure if that's an improvement of ocamllex or already there in the original lex
<Onemorenickname>
given original lex makes a dfa, i think it's an improvment
<ia0>
yes sorry, it's parsing/lexer.mll and comment_depth is now a stack of starting position (reference comment_start_loc)
<ia0>
in the end you get a COMMENT token
zpe has joined #ocaml
Sakarah has quit [Ping timeout: 256 seconds]
sfri has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
malc_ has quit [Ping timeout: 256 seconds]
pierpa has quit [Ping timeout: 244 seconds]
sh0t has joined #ocaml
sz0 has joined #ocaml
slash^ has quit [Ping timeout: 260 seconds]
xieyuheng has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 256 seconds]
kakadu has joined #ocaml
malc_ has joined #ocaml
gjaldon has quit []
wxfdglm_ has quit [Ping timeout: 260 seconds]
wxfdglm has joined #ocaml
AlexRussia has quit [Ping timeout: 265 seconds]
frefity has quit [Ping timeout: 250 seconds]
AlexRussia has joined #ocaml
minn has joined #ocaml
sh0t has quit [Ping timeout: 268 seconds]
sternenseemann has joined #ocaml
frefity has joined #ocaml
sh0t has joined #ocaml
minn has quit [Ping timeout: 260 seconds]
kevinch has joined #ocaml
minn has joined #ocaml
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
minn has left #ocaml ["Leaving"]
minn has joined #ocaml
tane has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 250 seconds]
wxfdglm has quit [Ping timeout: 260 seconds]
sh0t has quit [Ping timeout: 265 seconds]
brunoro has quit [Ping timeout: 250 seconds]
sh0t has joined #ocaml
AlexDenisov has joined #ocaml
groovy2shoes has quit [Quit: Leaving]
Algebr has quit [Ping timeout: 260 seconds]
etc has joined #ocaml
<etc>
Are all/most ocaml projects flat? i.e. without using subdirectories to organize code?
kevinch has quit [Quit: Computer has gone to sleep.]
orbifx has joined #ocaml
hunteriam has joined #ocaml
<orbifx>
is it possible to deconstruct a type in the function parameter?
<orbifx>
let fun foo a (Constructor b) = b
<orbifx>
?
<orbifx>
let foo a (Constructor b) = b
<Drup>
orbifx: did you tried ? :)
<orbifx>
I just did Drup , seems to work
aerioux has joined #ocaml
<aerioux>
is there anyway in ocaml to match multiple conditions with one statement? e.g. in scala you can do match (whatever) { case start | go | potato => something ; case otherstart => somethingelse() }
<kakadu>
syntax is almost the same
<kakadu>
aerioux: Just type something that looks sane and you will succeed :)
brunoro has joined #ocaml
<aerioux>
kakadu: could you point me to docs?
<aerioux>
apologies i dont know what to search
obj_magic has quit [Ping timeout: 258 seconds]
<aerioux>
so specifically i'm not looking for how to make a case statement but rather how to group multiple conditions in one statement?
etc has quit [Ping timeout: 260 seconds]
<aerioux>
e.g. i understand match a => f() | b => f() is valid, but how would i do a | b => f()
<Drup>
aerioux: are you using reason ?
<kakadu>
match x with 0|1|2|3|4 -> ....
<aerioux>
Drup: apologies did i say something wrongly?
<Armael>
:D
<Armael>
aerioux: Drup was talking about the "reason" syntax