<adrien>
and there's one column of text on the right which I've been a bit surprised with
rby has quit [Read error: Connection reset by peer]
rby has joined #ocaml
Xizor has joined #ocaml
NihilistDandy has joined #ocaml
eikke has joined #ocaml
Cyanure has joined #ocaml
antegallya has joined #ocaml
avsm has joined #ocaml
NihilistDandy has quit [Read error: Connection reset by peer]
zuymanto has joined #ocaml
<csmrfx>
Why does OCaml function definition use '='? Why not ':' instead? = implies equality, : implies whatever being referred to follows
zerbob has joined #ocaml
<csmrfx>
Even the repl responds with ':', not '='
<csmrfx>
no, wait
<csmrfx>
well, it's kinda weirdly idiosynchronous
<csmrfx>
example:
<csmrfx>
#type ratio = {num: int; denum: int};;
<csmrfx>
you get type ratio = { num : int; denum : int; } as a response
eikke has quit [Ping timeout: 260 seconds]
<csmrfx>
oh, nevermind
<csmrfx>
just learning here
<adrien>
you could say it derives from "let a = 42": same syntax
<adrien>
also, ":" is already used for type annotations
<adrien>
and I read "let f = function | 0 -> 1 | n -> ..." as "let f be the function which, to 0, associates 1 and, to n, ..." (I don't know if "associate" is the right word; I use it because of french)
<csmrfx>
Another thing that irks me is ';;'
<csmrfx>
why not just ';'
<csmrfx>
Personally, I'd prefer '.' for statements, '!' for expressions.. and perhaps '?' for calls or something
<csmrfx>
8P
eikke has joined #ocaml
<zorun>
csmrfx: you can omit ';;' completely
<zorun>
excepted in the toplevel
<csmrfx>
oh
<adrien>
csmrfx: ";;" means "end of sentence, start parsing"
<adrien>
in a file, reaching the end of the file has the same meaning
<adrien>
hmmm, afk a few minutes and then I'll have to leave
<csmrfx>
GADTs, enhanced First class modules, mingw-w64,...
<csmrfx>
hm, first
<zorun>
oh, mingw-w64 support?
<csmrfx>
and sorry: it is with a hyphen:
<csmrfx>
first-class
<csmrfx>
(or perhaps it was syntax that was improved: "enhanced first-class module -syntax,")
<csmrfx>
Now, if I only understood what first-class modules are. And could they be renamed eigenmodules?
zerbob has quit [Quit: Page closed]
Cyanure has quit [Remote host closed the connection]
ontologiae has joined #ocaml
oriba has joined #ocaml
tomodo has joined #ocaml
<tomodo>
hi
<tomodo>
does anyone know how to rsolve; Error: Could not find the .cmi file for interface ide/undo.mli.
<tomodo>
in compiling coq?
letrec has joined #ocaml
ikaros has joined #ocaml
ontologiae has quit [Ping timeout: 252 seconds]
ivan\ has quit [Read error: Operation timed out]
<iZsh>
when I have an error such as "Error: This expression has type a but an expression was expected of type b" is there a way to ask the compiler to tell me where it inferred the type should be "b" ?
<Drakken>
iZsh b is the expected type, so that would be based on the function it's being passed to.
<iZsh>
I know that
<iZsh>
but my code is rather large, so I want the compiler to tell me where exactly
<iZsh>
because obviously, it isn't the type I think it should be, so I must have a typo/error somewhere
ivan\ has joined #ocaml
eikke has joined #ocaml
<iZsh>
so the error is not at the line given by the error message, the error is where the type is inferred
<Drakken>
I don't see any relevant options for ocamlc. The only way I know is to explicitly specify the expression's type in the signature of the function it's passed to.
<Drakken>
Then you'll get a better error message.
<Drakken>
I mean in the param list of the function's definition.
zuymanto_ has joined #ocaml
zuymanto has quit [Read error: Connection reset by peer]
<iZsh>
I found the bug, but explicit typing of the function didn't help. so a general solution is still up to be found :)
<Drakken>
why didn't it help? If you code your incorrect assumption into the function def, the error message has to move closer to the bug.
<Drakken>
Of course it's slow, but I don't see how it can not be general.
zerbob has joined #ocaml
MaskRay has quit [Quit: leaving]
fantasticsid has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
otk_ has joined #ocaml
otk has quit [Ping timeout: 245 seconds]
micro___ has joined #ocaml
longh__ has joined #ocaml
ocp has joined #ocaml
antegallya has quit [Quit: Leaving.]
antegallya has joined #ocaml
ocp has quit [Ping timeout: 244 seconds]
Drup has quit [Ping timeout: 276 seconds]
antegallya has quit [Remote host closed the connection]
antegallya has joined #ocaml
zerbob has quit [Quit: Page closed]
Drup has joined #ocaml
antegallya has quit [Quit: Leaving.]
antegallya has joined #ocaml
letrec has quit [Ping timeout: 252 seconds]
<flux>
izsh, sometimes I annotate not only functions but s single values. emacs C-c C-t tells me where the type is different from what I expect and thrn I go and annotate this
<flux>
this typically reduces the scope where the error occurs
Drup has quit [Ping timeout: 240 seconds]
Drup has joined #ocaml
Drup has quit [Ping timeout: 240 seconds]
Drup has joined #ocaml
smondet has quit [Ping timeout: 272 seconds]
pilki has joined #ocaml
Drup has quit [Ping timeout: 244 seconds]
eikke has quit [Ping timeout: 240 seconds]
Drup has joined #ocaml
zuymanto_ has quit [Quit: zuymanto_]
zarus has quit [Read error: Operation timed out]
Drup has quit [Ping timeout: 248 seconds]
zuymanto has joined #ocaml
Xizor has quit []
zuymanto has quit [Ping timeout: 260 seconds]
eikke has joined #ocaml
<thelema>
iZsh: if one part of your code assumes type a and another part of your code assumes type b, the type error can occur anywhere between those two codepoints, and the fix could be at either endpoint (wrong function used) or at any spot in between (missing conversion)
<iZsh>
thelema: yes, but when you have a lot of recursive functions, it's often a little bit difficult to know where the type inference comes from
<flux>
btw, if you have a polymorphic function, it can be useful to annotate it non-polymorphic for the purpose of finding the typing error
<flux>
but that's perhaps not relevant here
eikke has quit [Ping timeout: 240 seconds]
Drup has joined #ocaml
eikke has joined #ocaml
eikke has quit [Ping timeout: 246 seconds]
Drup has quit [Ping timeout: 252 seconds]
zerbob has joined #ocaml
zerbob has left #ocaml []
Drup has joined #ocaml
Drup has quit [Ping timeout: 240 seconds]
Drup has joined #ocaml
Drup has quit [Ping timeout: 240 seconds]
Drup has joined #ocaml
Drup has quit [Ping timeout: 252 seconds]
Drup has joined #ocaml
Drup has quit [Ping timeout: 240 seconds]
Drup has joined #ocaml
eikke has joined #ocaml
[Moviuro] has joined #ocaml
<[Moviuro]>
Hi all! I'm trying to use OCaml on a x86_64 Linux architecture and want to open the "num" library: how can I achieve this?
Drup has quit [Ping timeout: 244 seconds]
Drup has joined #ocaml
eikke has quit [Ping timeout: 240 seconds]
ontologiae has joined #ocaml
zuymanto has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
ocp has joined #ocaml
<flux>
[moviuro], #use "topfind";; and then #require "num";;
<flux>
[moviuro], then you have module Num at your disposal in the toplevel
<flux>
if you wish to use it during compilation, do it like: ocamlfind ocamlc -package num -linkpkg -o foo foo.ml
<[Moviuro]>
flux: Well, I want to have the prompt, like in Camllight one ;)
<flux>
[moviuro], it appears to depend on camlp4 which isn't installed (does 'camlp4' work?). that should definitely be a package in your distribution, if ocaml is. (ocaml comes with camlp4, but at times it's packaged separately)
<lorilan>
it search on all the neighbors if there is one where you can go
<zorun>
you could use a lot more of high-order functions
<lorilan>
what do you mean by high-order ?
<zorun>
like Array.fold
<adrien>
functions taking other functions as argument
<adrien>
that's a higher-order function (HOF)
<adrien>
(took me a while to learn that one :P )
<zorun>
:)
<lorilan>
ha ok
<zorun>
it's genreally a good idea to use them
<zorun>
it's something quite natural in a functional language, and very powerful ;)
<lorilan>
i must admit i'm quite new in the functionnal programming
<zorun>
also, lists are generally (but not always) a better bet :)
<lorilan>
and what's seems the most natural for a math guy, requires me to think really hard
<zorun>
*than arrays
<lorilan>
i will surely rewrite the code with lists
<lorilan>
but since i was at this much of the goal, i wanted to finish with arrays first
<adrien>
most of the stuff in ocaml is very simple but unfortunately, it's not always shown in a simple way
<Drakken>
the for loops are Array.iteri
<adrien>
or at least, the usefulness might not be shown very well
<lorilan>
anyway thanks for everything !
<lorilan>
my dog is crying for his walk
jamii has quit [Remote host closed the connection]
<lorilan>
so i'm gonna leave you
<lorilan>
perhaps see you later
lorilan is now known as lorilan[away]
Drup has quit [Ping timeout: 245 seconds]
ontologiae has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
ontologiae has quit [Ping timeout: 272 seconds]
Drup has joined #ocaml
<adrien>
if someone has some ideas that would be quick to do for http://notk.org/~adrien/misc/ocaml-lang-www/ (ocaml-lang.org with some changes), I can do them during the week-end and ask for a merge after that
<adrien>
(and I still need to add distribution stuff on the download page)
lorilan[away] is now known as lorilan
avsm has quit [Quit: Leaving.]
<adrien>
good night :-)
<lorilan>
'night
antegallya has quit [Read error: Connection reset by peer]
zuymanto has quit [Quit: zuymanto]
emmanuelux has quit [Read error: No route to host]