michbad has quit [Remote host closed the connection]
cpdean has joined #ocaml
Heasummn has quit [Remote host closed the connection]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 248 seconds]
govg has quit [Ping timeout: 246 seconds]
rgrinberg has joined #ocaml
brunoro has joined #ocaml
sh0t has quit [Remote host closed the connection]
brunoro has quit [Ping timeout: 246 seconds]
fluter has quit [Ping timeout: 258 seconds]
rgrinberg has quit [Remote host closed the connection]
cpdean has quit [Quit: Leaving.]
gjaldon has joined #ocaml
mfp has quit [Ping timeout: 245 seconds]
gjaldon has quit [Ping timeout: 250 seconds]
sh0t has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 258 seconds]
petroav has joined #ocaml
groovy2shoes has quit [Quit: Leaving]
TarVanimelde has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
<sgronblo>
could someone explain to me why ocaml cant figure out that a type is correct if i have an explicit type in my .mli file but it can when i write the type right into my .ml file
alpen has joined #ocaml
michbad has joined #ocaml
michbad has quit [Remote host closed the connection]
wu_ng has joined #ocaml
richarddavison has joined #ocaml
richarddavison is now known as rdavison
AlexRussia has quit [Ping timeout: 245 seconds]
petroav has quit [Ping timeout: 260 seconds]
TarVanimelde has quit [Quit: Leaving]
rdavison_ has joined #ocaml
rdavison_ has left #ocaml [#ocaml]
rdavison has left #ocaml [#ocaml]
brunoro has joined #ocaml
MercurialAlchemi has joined #ocaml
nomicflux has joined #ocaml
brunoro has quit [Ping timeout: 240 seconds]
jao has quit [Ping timeout: 245 seconds]
pierpa has joined #ocaml
nomicflux has quit [Quit: nomicflux]
rdavison has joined #ocaml
adi___ has quit [Ping timeout: 260 seconds]
sh0t has quit [Remote host closed the connection]
adi___ has joined #ocaml
fluter has joined #ocaml
dh` has joined #ocaml
<dh`>
so it seems that ocamlyacc accepts string literals in rules, e.g.
<dh`>
term:
<dh`>
| term "div" factor { Op (Div, [$1; $3]) }
<dh`>
;
<dh`>
| term STAR factor { Op (Mul, [$1; $3]) }
<dh`>
factor { $1 }
<dh`>
what does this do? it can't really be for treating them as keywords as the lexer would have to do that... the documentation is silent
<dh`>
anyone know?
AlexDeni_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bernardo1pc has quit [Ping timeout: 248 seconds]
brunoro has joined #ocaml
AlexRussia has joined #ocaml
gjaldon has joined #ocaml
myst|fon has quit [Quit: Connection closed for inactivity]
brunoro has quit [Ping timeout: 244 seconds]
rgvf has joined #ocaml
gjaldon has quit []
fUD has joined #ocaml
<flux>
dh`, does the resulting .ml compile?
MercurialAlchemi has quit [Ping timeout: 268 seconds]
djellemah has quit [Ping timeout: 260 seconds]
MercurialAlchemi has joined #ocaml
sfri has quit [Remote host closed the connection]
slash^ has joined #ocaml
<sgronblo>
I'd really like to know if there's any difference to declaring types explicitly in your .ml file compared to declaring them in an .mli file
<sgronblo>
To me it seems like if you don't declare them in your .ml file the OCaml compiler gets confused if you have overlapping record fields.
<sgronblo>
But would like to understand it better
brunoro has joined #ocaml
lolisa has joined #ocaml
djellemah has joined #ocaml
brunoro has quit [Ping timeout: 258 seconds]
dakk has joined #ocaml
<lyxia>
mli is interface, ml is implementation.
<lyxia>
sgronblo: if you put it only in the interface, ocaml complains that it has not been implemented
<lyxia>
The redundancy can be avoided.
<lyxia>
If you put only types in an mli, then you don't need an ml
sfri has joined #ocaml
malc_ has joined #ocaml
jnavila has joined #ocaml
Algebr` has joined #ocaml
AlexRussia has quit [Ping timeout: 265 seconds]
sfri has quit [Remote host closed the connection]
zpe has joined #ocaml
<sgronblo>
lyxia: thats not the point. the point is that the ocaml compiler doesnt seem to use the .mli definitions for determining record types when there are overlapping fields
sfri has joined #ocaml
<lyxia>
ah. the overloading story in OCaml is kinda poor anyway...
<sgronblo>
yeah id just like to know exactly what the limitations are
<lyxia>
sgronblo: do you have an example
TarVanimelde has joined #ocaml
<dh`>
flux: yeah, it compiles and runs, but there doesn't seem to be any way to match the "div"
<lyxia>
sgronblo: a.mli: "type a = {a : int}" b.mli: "type b = {a : char ; b : char}" c.ml: "open A;; open B;; let _ = {a = 0};; let _ = {a='c';b='d'}" compiles so it seems there is some smart resolution going on.
brunoro has joined #ocaml
<dh`>
lyxia: I have been translating some old ratty sml code that is full of manky record types, and based on that I'd say that it's not very smart :-/
<lyxia>
It's one more thing OCaml does better than Haskell!
<dh`>
I'm not sure. haskell records are terrible because the field names aren't scoped at all, bt ocaml's don't seem to get scoped much either
sfri has quit [Remote host closed the connection]
brunoro has quit [Ping timeout: 256 seconds]
<sgronblo>
i havent boiled it down to a minimal example yet.
<sgronblo>
I think OCaml seems to have similar problems yeah
<dh`>
in the course of dealing with this code I've had to paste in: getname ({name; _} : Module.type) = name
<dh`>
all over the place because you can't do x.name
<sgronblo>
It allows you to define records with overlapping fields, but it gets confused when doing type inference if you use the feature.
<dh`>
this is partly because the author relied heavily on sml ad-hoc record types
<lyxia>
x.Module.name?
Simn has joined #ocaml
<sgronblo>
I don't see a need for contradicting with Haskell. Both are great languages.
Algebr` has quit [Ping timeout: 260 seconds]
<dh`>
lyxia: parser rejects all forms of that I've tried
<dh`>
maybe I missed the right one
<dh`>
but still, there shouldn't be a problem with having five or 50 record types with the same field names
<dh`>
or at least you should be able to deal with the problem with type annotations in strategic places
<dh`>
frequently the compiler issues error messages where it knows the type but still can't resolve the field names
sfri has joined #ocaml
Algebr` has joined #ocaml
<flux>
dh`, seems like a bug then?-o
<dh`>
well, I dunno.
<dh`>
accepting string literals in the grammar syntax doesn't seem like the sort of thing that would happen by accident, so it seems like something must be intended
<dh`>
the documentation for ocamlyacc is very minimal.
nathanielc_ has quit [Ping timeout: 256 seconds]
sfri has quit [Remote host closed the connection]
AltGr has joined #ocaml
sfri has joined #ocaml
AlexDenisov has joined #ocaml
fUD has quit [Quit: Connection closed for inactivity]
nathanielc has joined #ocaml
<flux>
when in doubt, look at the source code ;)
sfri has quit [Remote host closed the connection]
alfredo has joined #ocaml
Johann has quit [Ping timeout: 248 seconds]
brunoro has joined #ocaml
dmi3y has joined #ocaml
dmi3y has quit [Client Quit]
brunoro has quit [Ping timeout: 258 seconds]
sfri has joined #ocaml
dmi3y has joined #ocaml
alfredo has quit [Ping timeout: 258 seconds]
malc_ has quit [Remote host closed the connection]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
srenatus[m] has quit [Ping timeout: 260 seconds]
M-Illandan has quit [Ping timeout: 250 seconds]
XC[m]1 has quit [Ping timeout: 245 seconds]
barkmadley[m] has quit [Ping timeout: 245 seconds]
M-pesterhazy has quit [Ping timeout: 245 seconds]
bugabinga[m] has quit [Ping timeout: 245 seconds]
lpw25[m] has quit [Ping timeout: 260 seconds]
Guest23668[m] has quit [Ping timeout: 260 seconds]
regnat[m] has quit [Ping timeout: 260 seconds]
aspiwack[m] has quit [Ping timeout: 250 seconds]
M-jimt has quit [Ping timeout: 245 seconds]
M-ErkkiSeppl has quit [Ping timeout: 260 seconds]
regnt[m] has quit [Ping timeout: 260 seconds]
Bluddy[m] has quit [Ping timeout: 260 seconds]
timclassic has quit [Ping timeout: 260 seconds]
diamaths[m] has quit [Ping timeout: 260 seconds]
M-martinklepsch has quit [Ping timeout: 250 seconds]
sfri has quit [Remote host closed the connection]
AlexDenisov has joined #ocaml
Mercuria1Alchemi has joined #ocaml
sfri has joined #ocaml
troydm has joined #ocaml
milodavis has quit [Ping timeout: 265 seconds]
brunoro has joined #ocaml
AlexRussia has joined #ocaml
Kakadu has joined #ocaml
Johann has joined #ocaml
TarVanimelde has quit [Read error: Connection reset by peer]
dmi3y has quit [Quit: dmi3y]
dmi3y has joined #ocaml
silver has joined #ocaml
milodavis has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 268 seconds]
_andre has joined #ocaml
diamaths[m] has joined #ocaml
mfp has joined #ocaml
M-martinklepsch has joined #ocaml
regnat[m] has joined #ocaml
aspiwack[m] has joined #ocaml
M-pesterhazy has joined #ocaml
timclassic has joined #ocaml
bugabinga[m] has joined #ocaml
M-jimt has joined #ocaml
regnt[m] has joined #ocaml
Bluddy[m] has joined #ocaml
M-Illandan has joined #ocaml
srenatus[m] has joined #ocaml
lpw25[m] has joined #ocaml
Guest23668[m] has joined #ocaml
M-ErkkiSeppl has joined #ocaml
barkmadley[m] has joined #ocaml
XC[m]1 has joined #ocaml
milodavis has quit [Ping timeout: 260 seconds]
jwatzman|work has joined #ocaml
rdavison has quit [Quit: rdavison]
AlexRussia has quit [Ping timeout: 244 seconds]
milodavis has joined #ocaml
octachron has joined #ocaml
wu_ng has quit [Ping timeout: 240 seconds]
<octachron>
sgronblo, Ocaml never uses the .mli file to determine types
<octachron>
sgronblo, the typechecking algoritm is more like: typecheck the .ml file, typecheck the .mli file, check that the inferred signatures are compatible
<companion_cube>
and unify some variables, too
<companion_cube>
(well, maybe not anymore with 4.04)
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<octachron>
sgronblo, consequently, the type of a record is determined at the time of first use of a record field.
pierpa has quit [Ping timeout: 244 seconds]
<octachron>
e.g. in "type r1 = {a:int} type r2 = {a:int;b:int} let f r = r.a", f has type "r2 -> int" and the type is fixed.
AlexDenisov has joined #ocaml
dmi3y has quit [Quit: dmi3y]
MercurialAlchemi has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
malc_ has joined #ocaml
dmi3y has joined #ocaml
AlexDenisov has joined #ocaml
brunoro has quit [Ping timeout: 246 seconds]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<edwin>
it looks like it doesn't handle empty streams
jwatzman|work has quit [Quit: jwatzman|work]
jnavila has quit [Quit: It was time]
brunoro_ has joined #ocaml
<edwin>
kakadu: looks like it expects input to be terminated by a ' ' (the Failure "tl" is thus equivalent to an End_of_file), if I add a ' ' at the end of my list it works: http://paste.debian.net/894317/
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<edwin>
and the improved version is faster than the original (they print the same output otherwise in the toplevel for me)
brunoro has quit [Ping timeout: 256 seconds]
rgvf has quit [Quit: Page closed]
troydm has quit [Ping timeout: 246 seconds]
wu_ng has joined #ocaml
AlexDenisov has joined #ocaml
cpdean has joined #ocaml
malc_ has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
sepp2k has joined #ocaml
wu_ng has quit [Ping timeout: 252 seconds]
ryanartecona has joined #ocaml
malc_ has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 256 seconds]
shinnya has joined #ocaml
TarVanimelde has quit [Read error: Connection reset by peer]
gjaldon has joined #ocaml
dhil has joined #ocaml
noddy has quit [Ping timeout: 268 seconds]
dmi3y has quit [Quit: dmi3y]
jwatzman|work has joined #ocaml
dmi3y has joined #ocaml
brunoro_ has quit [Ping timeout: 244 seconds]
Kakadu has quit [Quit: Konversation terminated!]
Kakadu has joined #ocaml
brunoro_ has joined #ocaml
rgrinberg has joined #ocaml
rdavison has joined #ocaml
sh0t has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
orbifx-m has joined #ocaml
ryanartecona has joined #ocaml
<orbifx-m>
I'm adding [@len sizeof..] on a cstruct field, but it doesn't generate the blot_.. function. Any ideas?
<orbifx-m>
Does the ppx parser not handle named values?
shinnya has quit [Ping timeout: 256 seconds]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
Algebr` has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
gjaldon has quit []
dmi3y has quit [Quit: dmi3y]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zpe has quit [Remote host closed the connection]
jwatzman|work has quit [Quit: jwatzman|work]
seangrove has quit [Ping timeout: 250 seconds]
ryanartecona has joined #ocaml
govg has joined #ocaml
seangrove has joined #ocaml
soupault has joined #ocaml
_whitelogger has joined #ocaml
jnavila has joined #ocaml
soupault has quit [Remote host closed the connection]
mankyKitty has quit [Ping timeout: 260 seconds]
mankyKitty has joined #ocaml
seangrove has quit [Ping timeout: 246 seconds]
dhil has quit [Ping timeout: 268 seconds]
dhil has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
freusque has joined #ocaml
silver has quit [Read error: Connection reset by peer]
orbifx-m has quit [Ping timeout: 265 seconds]
brunoro_ has quit [Ping timeout: 256 seconds]
rand__ has joined #ocaml
orbifx-m has joined #ocaml
brunoro_ has joined #ocaml
AlexDenisov has joined #ocaml
veggie_ has joined #ocaml
silver has joined #ocaml
brunoro_ has quit [Ping timeout: 240 seconds]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 248 seconds]
cyraxjoe has joined #ocaml
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Ping timeout: 246 seconds]
cyraxjoe has quit [Remote host closed the connection]
brunoro_ has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
kakadu has joined #ocaml
cyraxjoe has joined #ocaml
cyraxjoe has quit [Remote host closed the connection]
octachron has joined #ocaml
zpe has joined #ocaml
brunoro_ has quit [Ping timeout: 265 seconds]
ia0 has quit [Quit: reboot]
ia0 has joined #ocaml
cyraxjoe has joined #ocaml
_andre has quit [Quit: leaving]
seangrove has joined #ocaml
cyraxjoe has quit [Remote host closed the connection]
seangrove has quit [Remote host closed the connection]
cyraxjoe has joined #ocaml
seangrove has joined #ocaml
troydm has joined #ocaml
nomicflux has quit [Quit: nomicflux]
veggie_ has quit [Ping timeout: 268 seconds]
brunoro_ has joined #ocaml
nomicflux has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
dmi3y has joined #ocaml
brunoro_ has quit [Ping timeout: 245 seconds]
dhil has quit [Ping timeout: 245 seconds]
dmi3y has quit [Quit: dmi3y]
brunoro_ has joined #ocaml
veggie_ has joined #ocaml
brunoro_ has quit [Ping timeout: 252 seconds]
chindy has joined #ocaml
sh0t has joined #ocaml
dmi3y has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
jao has quit [Ping timeout: 256 seconds]
orbifx-m2 has joined #ocaml
brunoro_ has joined #ocaml
orbifx-m has quit [Ping timeout: 245 seconds]
dmi3y has quit [Quit: dmi3y]
brunoro_ has quit [Ping timeout: 246 seconds]
julian_ has joined #ocaml
chindy has quit [Ping timeout: 240 seconds]
sh0t has quit [Ping timeout: 245 seconds]
brunoro_ has joined #ocaml
julian_ has quit [Client Quit]
chindy has joined #ocaml
veggie_ has quit [Quit: WeeChat 1.5]
brunoro_ has quit [Ping timeout: 268 seconds]
orbifx-m has joined #ocaml
brunoro_ has joined #ocaml
sh0t has joined #ocaml
orbifx-m2 has quit [Ping timeout: 256 seconds]
Algebr` has quit [Ping timeout: 256 seconds]
AltGr has left #ocaml [#ocaml]
orbifx-m2 has joined #ocaml
brunoro_ has quit [Ping timeout: 256 seconds]
AlexDenisov has joined #ocaml
brunoro_ has joined #ocaml
orbifx-m has quit [Ping timeout: 260 seconds]
AlexDeni_ has quit [Ping timeout: 260 seconds]
Denommus has quit [Quit: going home]
boadie has quit [Remote host closed the connection]
boadie has joined #ocaml
orbifx has joined #ocaml
brunoro_ has quit [Ping timeout: 265 seconds]
rand__ has quit [Quit: leaving]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 240 seconds]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
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]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
brunoro_ has joined #ocaml
dakk has quit [Ping timeout: 240 seconds]
ryanartecona has joined #ocaml
brunoro_ has quit [Ping timeout: 246 seconds]
brunoro_ has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 240 seconds]
<orbifx>
any ideas how to hint that the random numbers need to be seeded, but with code?
<zozozo>
provide an 'init' function ?
brunoro_ has quit [Ping timeout: 245 seconds]
orbifx-m has joined #ocaml
<orbifx>
zozozo: is that very functional?
<orbifx>
Pure. I guess getting a value from a function that requires a unit maybe
<zozozo>
well, if you want a mor funcitonal approach, you could have a type state, a function init: seed -> state, and a funciton rand : state -> int * state
orbifx-m2 has quit [Ping timeout: 246 seconds]
brunoro_ has joined #ocaml
<orbifx>
ok thanks zozozo
brunoro_ has quit [Ping timeout: 256 seconds]
jnavila has quit [Remote host closed the connection]
brunoro_ has joined #ocaml
zpe has quit [Remote host closed the connection]
brunoro_ has quit [Ping timeout: 244 seconds]
argent_smith has quit [Quit: Leaving.]
sepp2k has quit [Quit: Leaving.]
chindy has quit [Remote host closed the connection]
jao has joined #ocaml
brunoro_ has joined #ocaml
<seliopou>
rgrinberg: expect something soon
<seliopou>
it runs
<seliopou>
it crashes immediately, but it runs
sh0t has quit [Ping timeout: 256 seconds]
brunoro_ has quit [Ping timeout: 260 seconds]
sh0t has joined #ocaml
nomicflux has quit [Quit: nomicflux]
kakadu has quit [Remote host closed the connection]