NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
nojb has quit [Quit: nojb]
Simn has quit [Quit: Leaving]
mcc has quit [Ping timeout: 244 seconds]
dtak has joined #ocaml
<dtak>
Hello there. I'm tying to write a parser using ocamllex and menhir. I want to implement an "open" function to include other source code before actual compilation. Will you please tell me what to start from? any useful functions in Lexing or other?
shinnya has quit [Ping timeout: 250 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
dtak_ has joined #ocaml
dtak has quit [Quit: Page closed]
nojb has joined #ocaml
AlexRussia has quit [Ping timeout: 272 seconds]
MrScout_ has joined #ocaml
MrScout has quit [Ping timeout: 272 seconds]
boadie has joined #ocaml
MrScout_ has quit [Ping timeout: 258 seconds]
nojb has quit [Quit: nojb]
AlexRussia has joined #ocaml
willy_ has joined #ocaml
wwilly has quit [Ping timeout: 245 seconds]
NoNNaN has quit [Remote host closed the connection]
badon has quit [Ping timeout: 244 seconds]
rand000 has quit [Quit: leaving]
enitiz has quit [Remote host closed the connection]
marynate has joined #ocaml
enitiz has joined #ocaml
kapil__ has joined #ocaml
darkf has joined #ocaml
hugomg has quit [Quit: Leaving]
milosn has quit [Read error: Connection reset by peer]
_5kg has quit [Ping timeout: 265 seconds]
_5kg has joined #ocaml
milosn has joined #ocaml
ontologiae has quit [Ping timeout: 264 seconds]
samrat has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
jao has quit [Ping timeout: 258 seconds]
dtak_ has quit [Remote host closed the connection]
dtak has joined #ocaml
AltGr has left #ocaml [#ocaml]
AltGr has joined #ocaml
dtak has quit [Ping timeout: 255 seconds]
AltGr has left #ocaml [#ocaml]
dtak has joined #ocaml
AltGr has joined #ocaml
hilquias` has joined #ocaml
hilquias has quit [Ping timeout: 240 seconds]
myyst has quit [Ping timeout: 272 seconds]
myyst has joined #ocaml
BitPuffin has quit [Ping timeout: 265 seconds]
dtak has quit [Remote host closed the connection]
govg has joined #ocaml
govg is now known as Guest71641
dtak has joined #ocaml
kalzz has quit [Ping timeout: 265 seconds]
dtak has quit [Remote host closed the connection]
samrat has joined #ocaml
kalzz has joined #ocaml
AltGr has left #ocaml [#ocaml]
AltGr has joined #ocaml
samrat has quit [Ping timeout: 265 seconds]
samrat has joined #ocaml
Guest71641 has quit [Quit: leaving]
enitiz has quit [Ping timeout: 255 seconds]
shinnya has joined #ocaml
struktured has quit [Ping timeout: 258 seconds]
struktured has joined #ocaml
_5kg has quit [Ping timeout: 252 seconds]
AlexRussia has quit [Ping timeout: 245 seconds]
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
AlexRussia has joined #ocaml
AltGr has left #ocaml [#ocaml]
AltGr has joined #ocaml
govg has joined #ocaml
axiles has joined #ocaml
_5kg has joined #ocaml
ggole has joined #ocaml
kakadu has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
MercurialAlchemi has joined #ocaml
marynate has quit [Ping timeout: 240 seconds]
marynate has joined #ocaml
chinglish has joined #ocaml
marynate has quit [Ping timeout: 255 seconds]
marynate has joined #ocaml
alkoma has quit [Remote host closed the connection]
<Tekk_>
on line 45 it complains "expression has type int -> int -> sdl_renderer but expression was expected of type int"
<ggole>
-1 is probably parsed in a way you don't expect
<ggole>
Replace it with (-1)
<Tekk_>
huh
<Tekk_>
yeah
<ggole>
I still run into that one every now and then.
<Tekk_>
just a bug in the parser theN?
<Tekk_>
then*
<ggole>
No, it's intended
<Tekk_>
what's the value in that?
<ggole>
Well, -x and -1 should probably parse the same way
<ggole>
And y -x is the same as y - x, eg, a call to binary -
jita has quit []
<Tekk_>
oh, so it's to do with the -
<Tekk_>
so it was taking it as (win - 1)
<Tekk_>
and since win is a window type it didn't like that
<ggole>
Actually - binds more loosely than application, so it was (sdl_create_renderer_f win) - (1 flags)
<Tekk_>
despite the fact that the only way to make the type match on sdl_create_renderer_f was to take it as a negative
jao has quit [Read error: Connection reset by peer]
<Tekk_>
alright
<ggole>
The parser is entirely ignorant of types
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
<Tekk_>
mhm
<Tekk_>
thanks ggole
<ggole>
nw
<malc_>
Tekk_: ~-1 will allow you to get rid of the braces
<Tekk_>
okay
gdsfh has joined #ocaml
shinnya has joined #ocaml
malc_ has quit [Ping timeout: 264 seconds]
<smondet>
Hi, is anyone else having trouble with Travis-CI builds with the `osx` backend? I can't get opam to work: I hit this: https://github.com/ocaml/opam/issues/1853 and if I build from source it always wants to build Boost (Why the f*#!?) which timeouts the travis build
AlexRussia has joined #ocaml
malc_ has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
marynate has quit [Quit: Leaving]
mcclurmc has joined #ocaml
jonludlam has quit [Ping timeout: 252 seconds]
<Tekk_>
Oh, another thing. I can't get utop to build
<Tekk_>
which is a bit annoying
<Tekk_>
Undefined identifier: OCAML_VERSION in uTop.cmmo.ml
<Tekk_>
has anyone run into that?
<ggole>
Are you installing it from opam?
<Tekk_>
mhm
struktured has quit [Ping timeout: 258 seconds]
<ggole>
Hmm.
<ggole>
If you're using an oldish system compiler, I'd consider trying a switch to a newish release
enitiz has joined #ocaml
<Tekk_>
probably it..
<Tekk_>
huh
<Tekk_>
not that old
<Tekk_>
4.01.0
<Tekk_>
I'll update though
<ggole>
That should be recent enough. :|
leowzukw has quit [Quit: leaving]
<ggole>
A bug report might be in order.
AlexRussia has joined #ocaml
AlexRussia has quit [Changing host]
<Tekk_>
bug report is already up for it :)
matason has quit [Quit: Leaving...]
leowzukw has joined #ocaml
oskarth has joined #ocaml
<avsm>
smondet: boost is because of the aspcud dependency, and the illegal instruction due to some missing cflags to support older x86 cpus
<avsm>
smondet: aspcud should be bottled, but there's a no-apscud variant in the homebrew package you could try
<avsm>
smondet: travis osx support lags behind a bit though, so unsure what version of homebrew they ship with.
leowzukw has quit [Quit: leaving]
jao has quit [Read error: Connection reset by peer]
davine has joined #ocaml
davine has left #ocaml [#ocaml]
mcclurmc_ has joined #ocaml
mcclurmc has quit [Ping timeout: 244 seconds]
Thooms has joined #ocaml
<smondet>
avsm: thanks! I think I got working with `brew install opam --HEAD` (I mean, now it fails later :) )
<jbzaaa>
There is a package which binds OCaml to libcurl -- OCurl -- that I would like to use. I installed it via opam, but I am unsure on how to utilize this module in OCaml source.
<jbzaaa>
Can anybody assist? I am a newbie to this kind of stuff.
<def`>
usually with ocamlfind packages
<def`>
the "ocamlfind list" command will list all the packages you have
<def`>
ocurl should be there
<def`>
then it depends on your build system, but basically you have to add the relevant package
<jbzaaa>
@Teikk_ Hmm, what does that do exactly... it produced an executable for me
mcclurmc has joined #ocaml
matason has joined #ocaml
mcclurmc_ has quit [Ping timeout: 264 seconds]
psy has quit [Quit: Leaving]
samrat has quit [Quit: Computer has gone to sleep.]
oriba has joined #ocaml
hilquias has joined #ocaml
Averell- has joined #ocaml
Averell- has left #ocaml [#ocaml]
<hugomg>
jbzaa: ocamlopt is the native code Ocaml compiler, which generates executables. (ocamlc is the bytecode compiler). If you want to use ocamlopt by itself, you would need to use the "-I" flag to specify what folders to search in for dependencies and libraries you are using. What ocamlfind does is that it knows where packages are installed to it calls ocamlopt for you with the appropriate "-I" parameters
<nickmeharry>
This is a reduce example of a problem I hit in a personal project of mine.
<nickmeharry>
Basically, I explicitly marked "foo" as polymorphic, but the type checker is enforcing it to be the smallest type I've defined.
WraithM has joined #ocaml
<nickmeharry>
The intent is that the type parameter to t is one of b or c, which both share a in common.
alkoma has joined #ocaml
<ggole>
Arguments are monomorphic
<nickmeharry>
It's not that it's being inferred with '_a, though. It's being inferred with the concrete "a" type.
<ggole>
So if you use a function passed as argument at one type, that's the type it is all throughout the function.
<nickmeharry>
(I now realize I should've picked different names for my types)
<nickmeharry>
Right. My current guess as to what's happening is that I reuse my handle_var function in handle_a by casting it to 'a
<nickmeharry>
And somehow that type variable is being assinged a fresh value, namely "a"
<nickmeharry>
I guess I'm not sure of the scope of type variables?
<ggole>
Looks like foo is not polymorphic at all
<nickmeharry>
Right, that's the problem. I explicitly marked it as such, but the compiler is not beliving me.
vanila has quit [Quit: Leaving]
<ggole>
Somewhat confusingly, let f : 'a -> 'a = ... is not a polymorphic annotation
<ggole>
It's just a type variable. It will happily unify with a concrete type.
<ggole>
If you want a polymorphic annotation, you need to explicitly quantify: let f : 'a . 'a -> 'a = ...
<nickmeharry>
Hmm, ok. I'll try that.
<ggole>
(And this is different again from having a polymorphic argument.)
<nickmeharry>
Ok, different error now. I've updated the gist.
<nickmeharry>
Appearently a can't be cast to [< c ] ?
<ggole>
It can, try that on its own
<nickmeharry>
Still confused then. This seems to work, but I thought that's what I'm doing below?
<nickmeharry>
let _ = ((`A : a) :> [< c ])
jao has quit [Ping timeout: 252 seconds]
struktured has joined #ocaml
<ggole>
It's not really clear to me what's going on there.
<ggole>
You could try just removing all the annotations, that seems to work
<nickmeharry>
If I take those off, I'm back to the restrictive type.
<nickmeharry>
Not polymorphic.
<nickmeharry>
bar and baz are given the same types, a t list -> int list
<nickmeharry>
When they need to have b and c, respectively.
lajto has joined #ocaml
<nickmeharry>
Thanks for your help, by the way. Though it looks like I'm back to reading the manual, searching for the lifetimes of type variables.
<ggole>
Hmm, maybe you need impredicative polymorphism.
<ggole>
Which involves passing a record with a polymorphic field.
<ggole>
I'm not sure if this works with constraints though.
<nickmeharry>
I'm not entirely sure if the constraint is necessary, but I put it in so I didn't have to handle cases that don't make sense.
<nickmeharry>
I'll look into that next.
segmond has quit [Ping timeout: 256 seconds]
<ggole>
OK, I can make this type with bar given [< z ] t list -> int list
<ggole>
But I don't think it actually solves your problem.
<nickmeharry>
Where does z come from?
<ggole>
Er, it's my renaming of your c
<ggole>
(Because that was too confusing. Sorry.)
<nickmeharry>
Ok, I figured as much. No problem.
alkoma has quit [Remote host closed the connection]
<nickmeharry>
I guess I can solve this by just defining my stuff in t twice, once with b and once with c as necessary.
<nickmeharry>
It duplicates code, but it should get it working at least.
<nickmeharry>
(i.e. don't make t take a parameter, but hardcode in the params)
<ggole>
I commented on the gist
<nickmeharry>
I think I found the sentence in the manual about variable lifetimes:
<nickmeharry>
"In general the scope of a named type variable is the whole top-level phrase where it appears, and it can only be generalized when leaving this scope."
<ggole>
Unfortunately I have to go now. Perhaps somebody else can help you along.
<nickmeharry>
I didn't know you could do that with records.
<nickmeharry>
Thanks so much for your help. This might do it.
avsm has joined #ocaml
<ggole>
It is likely to fail when you start trying to actually handle the variants. Since that will remove the polymorphism, the record construction will no longer type check - I think.
<ggole>
But I really have to go. Good luck!
ggole has quit []
segmond has joined #ocaml
lnich has joined #ocaml
Hannibal_Smith has joined #ocaml
avsm has quit [Quit: Leaving.]
chambart has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
chambart has quit [Client Quit]
nojb has joined #ocaml
malc_ has quit [Quit: leaving]
dtak has quit []
dtak has joined #ocaml
gabemc has joined #ocaml
ontologiae has quit [Ping timeout: 258 seconds]
WraithM has quit [Quit: leaving]
jonludlam has joined #ocaml
badkins has quit [Remote host closed the connection]
badkins has joined #ocaml
mcc has joined #ocaml
keen__________15 has joined #ocaml
axiles has quit [Remote host closed the connection]
oriba has quit [Quit: Verlassend]
keen__________14 has quit [Ping timeout: 245 seconds]
mcc has quit [Client Quit]
struktured has quit [Ping timeout: 264 seconds]
nojb has quit [Ping timeout: 252 seconds]
mcclurmc has quit [Remote host closed the connection]
nojb has joined #ocaml
nojb has quit [Ping timeout: 250 seconds]
AlexRussia has quit [Ping timeout: 240 seconds]
AlexRussia has joined #ocaml
hilquias has quit [Remote host closed the connection]
gabemc has quit [Ping timeout: 265 seconds]
hilquias has joined #ocaml
kakadu has quit [Remote host closed the connection]