ThatTreeOverTher has quit [Remote host closed the connection]
Derander has joined #ocaml
boogie has joined #ocaml
csakatoku has joined #ocaml
tlockney_away is now known as tlockney
zpe has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
manizzle has joined #ocaml
nrlucaroni has joined #ocaml
manizzle has quit [Ping timeout: 252 seconds]
philtor has joined #ocaml
tab1293 has joined #ocaml
<tab1293>
Drup, can you please explain what the Some constructor does?
zpe has joined #ocaml
<tautologico>
Some builds a value of an option type
<tab1293>
What is an option type?
<tautologico>
an option type is used in situation where an expression may not have a valid value
<tautologico>
like, say you write an integer division function
<tautologico>
div 6 3 will return Some 2
<tautologico>
but div 6 0 returns None
<tautologico>
None is the constructor that indicates "no valid value"
<tautologico>
in this case the return type of div is int option
<tab1293>
So is it always either the type you have after Some or None?
<tautologico>
yes
boogie has quit [Remote host closed the connection]
<tautologico>
let div x y = match y with 0 -> None | _ -> Some (x/y);;
<tab1293>
So will this line: "let accept_all derivation string = Some (derivation, string)" return either a tuple containing derivation and string or None?
<tautologico>
in this case it will always return Some and a tuple
<tautologico>
Some is a constructor, the type is option
<tab1293>
What do you mean return Some and a tuple?
<tab1293>
I thought it would return a tuple or None
rgrinberg1 has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
boogie has joined #ocaml
<tab1293>
tautologico, ^
<tautologico>
the function always returns Some tuple
<tautologico>
look at my example of integer division: it may return None or Some number:
<tautologico>
let div x y = match y with 0 -> None | _ -> Some (x/y);;
<tautologico>
the function
<tautologico>
let accept_all derivation string = Some (derivation, string)
<tautologico>
always return Some tuple, there's no other possibility
rgrinberg1 has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
philtor has quit [Read error: Operation timed out]
cesar_ has joined #ocaml
venk has quit [Remote host closed the connection]
cesar_ is now known as Guest48404
michel_mno_afk is now known as michel_mno
rgrinberg1 has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
yacks has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
divyanshu has joined #ocaml
csakatoku has quit [Remote host closed the connection]
mcclurmc has quit [Remote host closed the connection]
divyanshu has quit [Quit: Computer has gone to sleep.]
mcclurmc has joined #ocaml
tab1293 has quit [Ping timeout: 240 seconds]
mcclurmc has quit [Ping timeout: 240 seconds]
racycl___ has quit [Quit: ZZZzzz…]
zpe has joined #ocaml
<tautologico>
how do I refer to a module type inside a signature?
<tautologico>
module type X = sig module type Y = sig val x : int end end
<tautologico>
how can I refer to Y? X.Y does not work because X is not a module
csakatoku has joined #ocaml
mcclurmc has joined #ocaml
csakatoku has quit [Ping timeout: 264 seconds]
divyanshu has joined #ocaml
<ygrek>
where do you want to refer to it from?
<ygrek>
actually it is strange..
<ygrek>
module type in module type
mcclurmc has quit [Ping timeout: 252 seconds]
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<tautologico>
to implement X for example
csakatoku has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
michel_mno has left #ocaml []
rgrinberg has quit [Quit: Leaving.]
kig has joined #ocaml
kig has quit [Client Quit]
kig has joined #ocaml
nojb has joined #ocaml
zpe has joined #ocaml
axiles has joined #ocaml
Kakadu has joined #ocaml
justinfront has quit [Quit: ChatZilla 0.9.90.1 [Firefox 29.0/20140417185217]]
nojb has quit [Ping timeout: 252 seconds]
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 265 seconds]
tab1293 has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
tab1293 has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
ygrek has quit [Ping timeout: 252 seconds]
tab1293 has joined #ocaml
alex_nx has quit [Ping timeout: 250 seconds]
amiller has quit [Remote host closed the connection]
amiller has joined #ocaml
alex_nx has joined #ocaml
clan has quit [Quit: clan]
Simn has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 240 seconds]
kig has quit [Quit: kig]
dsheets has joined #ocaml
boogie has quit [Remote host closed the connection]
iorivur has joined #ocaml
Guest48404 has quit [Remote host closed the connection]
ygrek has joined #ocaml
Kakadu has joined #ocaml
iorivur_ has joined #ocaml
iorivur has quit [Ping timeout: 265 seconds]
Nuki has joined #ocaml
tab1293 has quit [Ping timeout: 255 seconds]
iorivur_ has quit [Ping timeout: 276 seconds]
kig has joined #ocaml
tab1293 has joined #ocaml
clan has joined #ocaml
mcclurmc has joined #ocaml
<Kakadu>
.ощшт утпдшыр
<Kakadu>
sorry
sgnb` has quit [Read error: Connection reset by peer]
csakatoku has quit [Remote host closed the connection]
sgnb has joined #ocaml
mcclurmc has quit [Ping timeout: 276 seconds]
csakatoku has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
tautologico has quit [Quit: Connection closed for inactivity]
<brederlo>
whitequark: That wasn't my question. I'm wondering if some has submittetd it to the experimental github codereview process.
<whitequark>
ah.
<brederlo>
Also why isn't the snytax something like: type bar = foo | NewConstructor of type?
<whitequark>
that would be a different feature
<brederlo>
Then I don't get what the feature is.
<brederlo>
is "open type foo" the same as [> ... ]?
<whitequark>
no, [> ... ] doesn't allow you to pattern-match on variants not listed
<whitequark>
whereas with open types, you can match on any variant in scope
f[x] has joined #ocaml
<brederlo>
you would pattern match on [< ... ]
<brederlo>
or [<> ]
maattdd has joined #ocaml
michael_lee has joined #ocaml
<whitequark>
how?
<Drup>
brederlo: the idea is really the same as exceptions
<Drup>
or, more exactly, as the "exn" type
<whitequark>
# let f (x:[< `B]) = match x with `A -> true;;
<whitequark>
Error: This pattern matches values of type [< `A ] but a pattern was expected which matches values of type [< `B ] These two variant types have no intersection
claudiuc has quit [Remote host closed the connection]
<brederlo>
whitequark: let f (x:[< `A | `B ]) = match x with `A -> true | `B -> false;;
<brederlo>
type bar = [ `A ];;
<brederlo>
f (`A : bar);;
<brederlo>
You can't match something that isn't in the type.
yacks has quit [Ping timeout: 252 seconds]
<whitequark>
hm.
<brederlo>
open types seems to be a reduced form of polymorphic variants in that a constructor can only have one type.
<brederlo>
And they can be GADTs.
<whitequark>
it still differs from the open types proposal. with polymorphic variants, you have an implicit type variable
<whitequark>
as in, you can't cast [< `A] to [< `A | `B]
<brederlo>
you don't have to. a value of [< `A] can be used where [< `A | `B] is expected
michael_lee has quit [Quit: Ex-Chat]
<brederlo>
type foo = .. type foo += A module M = struct type foo += B end Do I then have to use: let list = [ A; M.B; ]?
<brederlo>
Is that then a foo list or M.foo list?
<whitequark>
foo list
<brederlo>
But I need M.B and not just B, right?
<ggole>
Yep.
<brederlo>
Ok, that differs from `
<ggole>
Just like with exception constructors.
<brederlo>
And any match of an open type must have a _ -> clause.
f[x] has quit [Ping timeout: 255 seconds]
<ggole>
How could it be otherwise?
<brederlo>
polymorphic variant types can be closed
<brederlo>
Say I have 2 files. One has type foo += Foo of int and the other type foo += Foo of float. What then happens? An error at link time?
<ggole>
And open types can't be closed. It's right there in the name. :)
<companion_cube>
brederlo: guess the two Foo are different
<elfring>
How do you think about to clarify implementation details around the Cgywin interface?
lostcuaz has joined #ocaml
lostcuaz_ has joined #ocaml
<adrien>
like?
Rota has joined #ocaml
<Rota>
A question about int64 in Ocaml: why I get 0L==0L is false? Any specific equal comparator for int64?
<Kakadu>
Rota: is 0L=0L true?
<Rota>
yes.
<adrien>
Rota: (==) is not the "typical" comparison function
AltGr has left #ocaml []
<Rota>
ok
<adrien>
you should have a look at the documentation for the exact meanng of (==)
lostcuaz has quit [Ping timeout: 276 seconds]
<Rota>
yes
<Rota>
I am reading it .
<elfring>
adrien: How does the configuration variant "Cygwin-based native Win32 port" achieve executable files which do not require Cygwin to run them?
<adrien>
it's cross-compilation
<Rota>
Thanks. I got it.
reynir is now known as mocxy
mocxy is now known as reynir
<elfring>
adrien: How do you select which configuration variant will be applied for Cygwin?
<adrien>
if you run ./configure, it will target cygwin; if you copy the files under config/ as mentioned in README.win32, it will target native windows
tane has joined #ocaml
brederlo has quit [Quit: Lost terminal]
<elfring>
adrien: How do you think about to make the Cygwin variant selection a bit more explicit by an option in the configuration script?
tnguyen_ has quit [Quit: Leaving]
divyanshu has quit [Ping timeout: 265 seconds]
<adrien>
I'm not sure of its usefulness since it is currently the only possibility
kig has quit [Quit: kig]
divyanshu has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
mort___ has joined #ocaml
kig has joined #ocaml
nojb` has joined #ocaml
tlockney_away is now known as tlockney
Eyyub has joined #ocaml
nojb has quit [Ping timeout: 240 seconds]
<elfring>
Is the software component "FlexDLL" only used for the configuration variants "MinGW" and "Cygwin-based native Win32 port" so far?
<mrvn>
19:45 < paultag> is this 503ing for anyone else
<mrvn>
not just codeload
<berke_durak>
yeah 503 for me too
<berke_durak>
sucks my opam build is stuck. and no oasis package for fedora!
marr has quit [Read error: Operation timed out]
<adrien>
considering how much downtime costs to github, I'd expect it to get back soon
<berke_durak>
maybe opam should be modified so that it can have more than one url to try
<mrvn>
don't you have a local clone?
<adrien>
and clearly this is because of all the gentoo users rebuilding their world following the recent release of GCC 4.9
<berke_durak>
mrvn: a local clone of what?
<mrvn>
whatever git repository you are trying to install
f[x] has joined #ocaml
<berke_durak>
mrvn: yes I do; opam got stuck on lwt so I cloned a copy and made a tar and changed the url to a file:/// under opam and fixed the md5 but that didn't work,
tautologico has quit [Quit: Connection closed for inactivity]
<berke_durak>
it would be to long to do that for every dependency of oasis... I'd rather go grab a coffee and wait for codeload to get back up
maattdd has quit [Ping timeout: 240 seconds]
thomasga has joined #ocaml
<berke_durak>
does anyone have an up-to-date tuareg patched for lwt?
nojb`` has quit [Ping timeout: 240 seconds]
claudiuc has joined #ocaml
thomasga has quit [Quit: Leaving.]
maattdd has joined #ocaml
Eyyub has quit [Ping timeout: 252 seconds]
maattdd has quit [Ping timeout: 252 seconds]
Eyyub has joined #ocaml
_alephlambda has joined #ocaml
<_alephlambda>
Hi, I'm a student working with OCaml. I'm using Map.Make and am getting a Not_found exception. I use the Map.find function a lot in my code. Is there a way to figure out which line raised the error?
<_alephlambda>
Short of going back and manually surrounding each .find, that is.
<_alephlambda>
is #trace what i'm looking for?
<Drup>
sed is what you are looking for ;)
<Drup>
(no, not really, it's a bit annoying, I agree with you)
<_alephlambda>
sed...as in the GNU tool?
<Drup>
just rewrite a new find function that catch the exception and report a more sensible error message
<_alephlambda>
Drup: Well, will that give the line number?
<ggole>
You can compile with -g, that'll give you line numbers
<whitequark>
um, how about OCAMLRUNPARAM=b ?
<ggole>
(It won't for the internals of Map, but your wrapper should work.)
<whitequark>
and -g, yes
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<ggole>
Unfortunately it doesn't work in the toplevel.
<_alephlambda>
Drup: Ah, I guess that would work..
<_alephlambda>
ggole, whitequark: I'm already compiling with -g. I've been trying to use ocamldebug, but I'm not very good at using that tool.
<Drup>
you need -g *and* OCAMLRUNPARAM=b to have backtraces, iirc
<ggole>
In that case, run your program something like OCAMLRUNPARAM="b1" ./prog args
<ggole>
And you should get a (somewhat crude) backtrace with line numbers
maattdd has joined #ocaml
<_alephlambda>
ggole: Hm...I must be doing something wrong
rand000 has quit [Ping timeout: 255 seconds]
<_alephlambda>
let me try the wrapper
dsheets has joined #ocaml
maattdd has quit [Client Quit]
<adrien>
wrapper?
<adrien>
if you refer to
<adrien>
VAR=val prog args
<adrien>
then it's a syntax which sets the environment variable "VAR" to the value "val" inside the program "prog" (and only inside that program instance)
rand000 has joined #ocaml
<_alephlambda>
Drup: the wrapper worked.
<_alephlambda>
thanks guys!
<_alephlambda>
i ended up doing :%s/XX/\=line(".
<_alephlambda>
")
<Drup>
generally speaking, you should create a function "find_opt" that will return an option type
<Drup>
(instead of throwing an exception)
<Drup>
it would force you to handle the case where what you are looking for is not present, which is a good thing :p
<_alephlambda>
Drup: Map.Make(String).find doesn't return an option
<_alephlambda>
it just fails
<adrien>
that or remember to use try...with
<Drup>
_alephlambda: exactly what I'm saying, write a new function that returns an option, and use it instead of the regular version :)
<_alephlambda>
Drup: Ah, okay. That seems like good practice though; can't go building good habits...then where will I be :P
<_alephlambda>
Drup: I can do that though
_alephlambda has left #ocaml []
Eyyub has quit [Ping timeout: 276 seconds]
<mrvn>
Drup: or have an exn and opt submodule
angerman has quit [Quit: Gone]
<Drup>
if you are going to define you own modules on top of Map.make, just use Batteries/Core/Extlib
<mrvn>
.oO(Not today)
<Drup>
tss, NIH. :)
<adrien>
it's spelled "companion_cube_ism"
<Drup>
:D
dsheets has quit [Ping timeout: 245 seconds]
marr has joined #ocaml
ollehar has joined #ocaml
zpe has quit [Remote host closed the connection]
clan has joined #ocaml
<companion_cube>
hey
reynir is now known as Membeer
* companion_cube
feels like being the victim of calomny
tane has quit [Quit: Verlassend]
<adrien>
:P
tane has joined #ocaml
mcclurmc has quit [Ping timeout: 252 seconds]
zpe has joined #ocaml
mcclurmc has joined #ocaml
Eyyub has joined #ocaml
angerman has joined #ocaml
ThatTreeOverTher has joined #ocaml
angerman has quit [Client Quit]
Anarchos has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
tautologico has joined #ocaml
f[x] has quit [Ping timeout: 264 seconds]
elfring has quit [Quit: Konversation terminated!]
ocp has quit [Ping timeout: 245 seconds]
divyanshu has joined #ocaml
divyanshu has quit [Client Quit]
ollehar has quit [Ping timeout: 252 seconds]
ollehar has joined #ocaml
Simn has quit [Quit: Leaving]
freling has quit [Ping timeout: 246 seconds]
freling has joined #ocaml
Thooms has quit [Quit: WeeChat 0.3.8]
oriba has joined #ocaml
thomasga has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
clan has quit [Quit: clan]
axiles has quit [Remote host closed the connection]
rgrinberg has quit [Quit: Leaving.]
thomasga has quit [Quit: Leaving.]
tane has quit [Quit: Verlassend]
nojb`` has joined #ocaml
zpe has quit [Remote host closed the connection]
ikaros has joined #ocaml
clan has joined #ocaml
racycle_ has quit [Read error: Connection reset by peer]
racycle__ has joined #ocaml
oriba has quit [Quit: Verlassend]
oriba has joined #ocaml
lostcuaz_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lostcuaz has joined #ocaml
waneck has joined #ocaml
ggole has quit []
lostcuaz has quit [Client Quit]
Thooms has joined #ocaml
Eyyub has quit [Ping timeout: 240 seconds]
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
zpe has joined #ocaml
<ThatTreeOverTher>
#llvm
Rota has quit [Ping timeout: 265 seconds]
<Drup>
what's happening there ? :)
thomasga has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
Eyyub has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
<philtor>
I'm using 4.02.0dev+trunk and I notice that I get an error when I start the REPL:
<philtor>
File "/home/phil/.ocamlinit", line 8, characters 0-1: Syntax Error
<philtor>
Line 8 is:
<philtor>
#camlp4o
<philtor>
So now that camlp4 is in a separate lib does this have to be specified differently?
rand000 has quit [Quit: leaving]
<Drup>
camlp4 has not yet been adapted to trunk
<Drup>
so, for now, it's just broken, don't use it on trunk
clan has quit [Quit: clan]
lpw25 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
clan has joined #ocaml
freling has quit [Ping timeout: 246 seconds]
freling has joined #ocaml
nojb`` has quit [Ping timeout: 240 seconds]
Thooms has quit [Quit: WeeChat 0.3.8]
<ThatTreeOverTher>
hey guys, can anyone tell me why running `ocamlbuild toy.byte` on this repo (https://github.com/danluu/ocaml-llvm-tutorial) causes the error "File "codegen.ml", line 5, characters 0-9: Error: Unbound module Llvm"?
<Drup>
you have llvm's ocaml binding installed, I presume ?
<ThatTreeOverTher>
Drup, installed with `opam install llvm`, correct?
<Drup>
yes
<ThatTreeOverTher>
ok, yeah
<ThatTreeOverTher>
I did that
<Drup>
huum, try something like "ocamlbuild -use-ocamlfind -package llvm toy.native"