flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.01.0 http://bit.ly/1851A3R | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
mfp has quit [Ping timeout: 272 seconds]
Drup has quit [Ping timeout: 245 seconds]
Drup has joined #ocaml
hto has quit [Ping timeout: 264 seconds]
hto has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
erikc has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
Simn has quit [Read error: Connection reset by peer]
talzeus has joined #ocaml
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
weie has joined #ocaml
weie has quit [Quit: Leaving...]
MitoticSpindle has joined #ocaml
<caseyjames> Does anyone here have experience with ctypes - specifically, how do I integrate into a C app? I'm making an iOS app, and compiling the OCaml with OCamlXARM... How do I tie it together?
ygrek has joined #ocaml
Drup has quit [Quit: Leaving.]
breakds has joined #ocaml
manud has quit [Quit: manud]
moro_home has quit [Ping timeout: 246 seconds]
<caseyjames> If I declare a struc in a ctype, and then use that struc as an element in another stuc ctype, don't their name definitions interfere? what parts need to match the c structure names exactly?
wagle has quit [Remote host closed the connection]
moro_home has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest32911
breakds has quit [Remote host closed the connection]
Guest32911 has quit [Remote host closed the connection]
erikc has quit [Quit: erikc]
wagle has joined #ocaml
yacks has quit [Quit: Leaving]
malc_ has joined #ocaml
UncleVasya has joined #ocaml
UncleVasya has quit [Remote host closed the connection]
Neros has quit [Ping timeout: 260 seconds]
ttamttam has joined #ocaml
yezariaely has joined #ocaml
ygrek has quit [Ping timeout: 265 seconds]
wolfnn has joined #ocaml
wolfnn has quit [Ping timeout: 260 seconds]
ttamttam has quit [Ping timeout: 246 seconds]
ttamttam has joined #ocaml
zpe has joined #ocaml
hardliner_ has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
steshaw has quit [Ping timeout: 264 seconds]
djcoin_ has joined #ocaml
<caseyjames> does anyone know what the ty is at line 32 in https://github.com/ocamllabs/ocaml-ctypes/blob/master/tests/test_structs.ml
MitoticSpindle has quit [Ping timeout: 272 seconds]
<companion_cube> caseyjames: this must be the representation of some C type
ontologiae_ has joined #ocaml
<caseyjames> ahh that make sense
nikki93 has joined #ocaml
ontologiae_ has quit [Ping timeout: 245 seconds]
ontologiae_ has joined #ocaml
ygrek has joined #ocaml
dsheets has joined #ocaml
mika1 has joined #ocaml
ggole has joined #ocaml
Yoric has joined #ocaml
nikki93 has quit [Remote host closed the connection]
thomasga has joined #ocaml
dsheets has quit [Ping timeout: 245 seconds]
Yoric has quit [Ping timeout: 246 seconds]
q66 has joined #ocaml
dsheets has joined #ocaml
Yoric has joined #ocaml
ggole has quit [Ping timeout: 268 seconds]
gour has joined #ocaml
avsm has joined #ocaml
mort___ has joined #ocaml
ggole has joined #ocaml
Simn has joined #ocaml
Yoric has quit [Ping timeout: 260 seconds]
AltGr has joined #ocaml
steshaw has joined #ocaml
weie has joined #ocaml
<companion_cube> thomasga: on opam.ocamlpro.com, there is a deadlink ("official ocaml repository")
Kakadu has joined #ocaml
<companion_cube> also, searching packages is broken (http://opam.ocaml.org/ext/js/search.js 404)
<thomasga> companion_cube: thx, we'll fix these
mfp has joined #ocaml
lenstr_ has joined #ocaml
lenstr has quit [Ping timeout: 272 seconds]
Kakadu has quit [Remote host closed the connection]
Kakadu has joined #ocaml
darkf has quit [Quit: Leaving]
wolfnn has joined #ocaml
Kakadu has quit [Remote host closed the connection]
Kakadu has joined #ocaml
MitoticSpindle has joined #ocaml
Yoric has joined #ocaml
avsm has quit [Quit: Leaving.]
zzz_` has quit [Remote host closed the connection]
zzz_ has joined #ocaml
zzz_ has quit [Ping timeout: 264 seconds]
maufred has quit [Ping timeout: 260 seconds]
avsm has joined #ocaml
maufred has joined #ocaml
ontologiae_ has quit [Read error: Operation timed out]
zzz_ has joined #ocaml
lenstr_ is now known as lenstr
lenstr has quit [Changing host]
lenstr has joined #ocaml
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
_andre has joined #ocaml
ttamttam has quit [Ping timeout: 240 seconds]
talzeus has quit [Ping timeout: 272 seconds]
thomasga1 has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
Drup has joined #ocaml
q66 has quit [Quit: Leaving]
gnuvince has quit [Ping timeout: 246 seconds]
dsheets has quit [Read error: Operation timed out]
ocp has joined #ocaml
Neros has joined #ocaml
avsm has quit [Quit: Leaving.]
breakds has joined #ocaml
talzeus has joined #ocaml
xavierm02____ has joined #ocaml
ontologiae_ has joined #ocaml
<xavierm02____> Hey. How do you make polymorphic functions using expressions since you can't use type variables in the definition of an exception (http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora018.html)? For example http://pastebin.com/eKxeL4ur
<xavierm02____> exceptions*
Neros has quit [Ping timeout: 245 seconds]
<companion_cube> the simplest you can do is let f (type t) (x:t) = let module Foo = struct exception Bar of t end in raise (Foo.Bar x);;
<companion_cube> something like this
Drup has quit [Quit: Leaving.]
Drup has joined #ocaml
<xavierm02____> nice! thank you :)
Simn has quit [Ping timeout: 246 seconds]
weie has quit [Quit: Leaving...]
<xavierm02____> How do you call the "(type t)" thing?
ontologiae_ has quit [Ping timeout: 246 seconds]
<hnrgrgr> xavierm02____: a local abstract type.
shinnya has joined #ocaml
<xavierm02____> thank you :)
breakds has quit [Remote host closed the connection]
dsheets has joined #ocaml
<hcarty> gasche: Are non-developer comments/questions welcome on Mantis for things other than bugs, such as the inline record discussion?
<hcarty> gasche: non-compiler-developers that is.
avsm has joined #ocaml
ollehar has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
MitoticSpindle has quit [Ping timeout: 240 seconds]
xavierm02____ has quit [Quit: Page closed]
steshaw has quit [Ping timeout: 240 seconds]
weie has joined #ocaml
ttamttam has joined #ocaml
ontologiae_ has joined #ocaml
ollehar has quit [Ping timeout: 272 seconds]
ollehar has joined #ocaml
thomasga1 has quit [Quit: Leaving.]
saml has joined #ocaml
rand000 has joined #ocaml
rand000 has quit [Ping timeout: 272 seconds]
watermind has joined #ocaml
<watermind> if a module is parameterised by two types, with none of them being more important, what's the convention? s and t? t1 and t2? t and t'?
<companion_cube> watermind: depends
<companion_cube> I think Module.t is supposed to be defined by Module (like, the data structure Module is about)
<companion_cube> otherwise you give short names
<companion_cube> like elt, data, key...
<watermind> right
<watermind> sounds good
<watermind> thanks!
<companion_cube> np :)
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest52188
Guest52188 has quit [Remote host closed the connection]
malc_ has quit [Quit: leaving]
<nicoo> watermind: Also, when appliable, it can be nice to respect “standard” signatures, so your modules can be fed in functors directly.
shinnya has quit [Ping timeout: 272 seconds]
q66 has joined #ocaml
Simn has joined #ocaml
<companion_cube> I second that
skchrko has joined #ocaml
rand000 has joined #ocaml
<watermind> nicoo: companion_cube: I see, good point
q66 has quit [Quit: Leaving]
<watermind> the only way to refine a signature is by parameterizing the module type (i.e. make it a functor) right?
<watermind> in other words, if I have, module type S = sig type a type b end, is there some way of defining an S' where a is instantiated to int?
rand000 has quit [Ping timeout: 240 seconds]
metasyntax has joined #ocaml
rand000 has joined #ocaml
<companion_cube> if you have a module type, you can add constraints
<companion_cube> module type S' = S with type a = int
<companion_cube> or just use S with type a = int directly
mchqwerty has joined #ocaml
<watermind> oh...
ocp has quit [Ping timeout: 245 seconds]
mchqwerty has quit [Ping timeout: 272 seconds]
Kakadu_ has joined #ocaml
Kakadu has quit [Ping timeout: 250 seconds]
<companion_cube> watermind: for instance, standard modules Set and Map do this
paddymahoney has quit [Remote host closed the connection]
<companion_cube> module type S = sig type t type key ...... end
<companion_cube> module Make(O : OrderedType) : S with type key = O.t
<companion_cube> (name might be "key" for Map or "elt" for Set)
<watermind> interesting
<companion_cube> it allows to make some types concrete rather than abstract
<watermind> yeap, this kind of refinement is really handy
gour has quit [Quit: WeeChat 0.4.1]
gour has joined #ocaml
djcoin_ has quit [Quit: WeeChat 0.4.1]
Kron has joined #ocaml
<Kron> hey folks
<Kron> does anyone know where I can talk to the tuareg folks?
* ggole looks at his code and wishes there was abstraction over patterns
<companion_cube> I'm not even sure tuareg is still actively maintained :s
<Kron> ouch
<companion_cube> wait, I'm no emacs user, I may (probably) be totally wrong
<Drup> it's maintained
<Drup> but not more
<companion_cube> my bad then
<Kron> hmmm
<yezariaely> ggole: couldn't you abstract the match itself and provide functions on different patterns?
<ggole> The author is one "Albert Cohen", you might try looking him up
<Drup> bug fix only, mostly
<Drup> Kron: what is your question ?
<Kron> jane street capital?
<Kron> basically
<Kron> my current tuareg (from marmalade) doesn't extend prog-mode
<companion_cube> ggole: you'd like pattern views, I guess? Me too ^^
<Kron> and i figured that would be a simple suggestion to make to anyone who can add code to tuareg itself
<ggole> Yeah, I guess so
<Kron> but maybe I'm running an old version or something
<ggole> I'm looking at this match-heavy code and I have the same identical fragment (occasionally with one bit slightly different, always the same bit) about twenty times
<ggole> Oh well, sugar rots the teeth.
<Drup> Kron: what's the purpose of the prog mode ?
<nicoo> ggole: « Abstraction over patterns » ?
<Kron> nothing much, just lets me abstract away features across all my programming buffers
<Kron> for example, this is some code in my .emacs:
<Kron> ;; Add line numbers to programming buffers
<Kron> (add-hook 'prog-mode-hook 'linum-mode)
<Kron> (add-hook 'tuareg-mode-hook (lambda () (run-hooks 'prog-mode-hook)))
<ggole> prog-mode is a way to say "do this for every programming mode"
<Kron> prog-mode will inherit into haskell-mode, lisp-mode, c-mode, elisp-mode, etc. etc.
<Kron> but I keep having to say "... also tuareg"
<Kron> and it's getting annoying
<Drup> ok
<Kron> it seems like a relatively simple fix
<Drup> I'm afraid you will have to do it yourself :/
<Kron> that sounds like a real shame
<ggole> nicoo: basically I'd like a way to name pattern fragments (with arguments) so I don't have to keep typing them again and again.
<nicoo> ggole: I see.
<Drup> ggole: I know the feeling, I'm doing manipulation over AST right now
<ggole> Yes, this is a value numbering pass
<ggole> With lots of identities :/
<Drup> ggole: and in haskell, they don't even have the short "Bla b | Bli b -> f b
Kakadu has joined #ocaml
<watermind> so I have "module type S = sig type a val x:a end" and "module type S'= S with type a = int"... why does this require me to still have the definition of type a "module M : S' = struct type a = int let x = 0 end"
<ggole> Really? No or patterns in Haskell?
<Kron> haskell has patterns
<ggole> That's pretty awful :o
<Kron> not sure what you're talking about o.o
<Drup> ggole: no, I'm talking about the "common pattern"
<ggole> I thought "or patterns" is the term for that.
<Drup> "Bla b | Bli b -> f b" as opposed to "Bla b -> f b | Bli b -> f b"
<watermind> shouldn't I be able to just write module M : S' = struct let x = 0 end
<watermind> easier to read here http://pastebin.com/pcsRqREw
<watermind> why do I need to specify that type a = int?
avsm has quit [Quit: Leaving.]
cesar_ has joined #ocaml
cesar_ is now known as Guest60539
<flux> well, it doesn't infer module signatures
<flux> that's why :-)
<flux> oh, wait, I missed the one line
<flux> hmm, I cannot say, I haven't used 'with' that way. maybe it doesn't do that kind of replacements :-o
<companion_cube> watermind: you need to, because it's a type *definition*
<flux> when you do 'with' to the type it makes a signature that says type a = int
<flux> that's what you need to have in the module
<flux> basically everything you have in module type must be found from the module
<watermind> companion_cube: flux: right... the "with type a = int" looks like a definition too though, not a declaration, so I was expecting for further definitions in the module not to be needed
<flux> you can do this: module type S = sig type t = int end
<watermind> but I can see the rationale behind it
<flux> and then you must have type t = int in the module
<watermind> oh
rand000 has quit [Ping timeout: 245 seconds]
<watermind> ok then I see, it is consistent
gnuvince has quit [Ping timeout: 246 seconds]
<companion_cube> watermind: you could also declare a new type
caseyjames has quit [Quit: Page closed]
Kakadu_ has quit [Ping timeout: 250 seconds]
Guest60539 has quit [Remote host closed the connection]
Kron has quit [Ping timeout: 268 seconds]
<watermind> companion_cube: not sure if I follow, you mean "with" can be used to introduce new types? is that it?
<companion_cube> no, I mean that modules that contain a type must declare it in any case
<companion_cube> because yes, it might just be an alias to some type (int, e.g.), but it might also be the declaration of a new type
<watermind> right!
<watermind> didn't think of that
<ggole> And it could be uninhabited
<ggole> Signatures deliberately hide all of that information.
mika1 has quit [Quit: Leaving.]
Simn has quit [Read error: Connection reset by peer]
Yoric has quit [Ping timeout: 268 seconds]
nikki93 has joined #ocaml
rand000 has joined #ocaml
skchrko has quit [Quit: Leaving]
ttamttam has quit [Quit: ttamttam]
mort___ has quit [Ping timeout: 272 seconds]
avsm has joined #ocaml
yezariaely has quit [Quit: Leaving.]
Kakadu has quit [Remote host closed the connection]
Kakadu has joined #ocaml
rand000 has quit [Ping timeout: 272 seconds]
demonimin has quit [Ping timeout: 252 seconds]
avsm has quit [Quit: Leaving.]
nikki93 has quit [Remote host closed the connection]
talzeus has quit [Remote host closed the connection]
demonimin has joined #ocaml
rand000 has joined #ocaml
ygrek has joined #ocaml
malo has joined #ocaml
demonimin has quit [Ping timeout: 246 seconds]
demonimin has joined #ocaml
dsheets has quit [Ping timeout: 245 seconds]
demonimin has quit [Ping timeout: 246 seconds]
ontologiae_ has quit [Ping timeout: 264 seconds]
hardliner_ has quit [Ping timeout: 268 seconds]
demonimin has joined #ocaml
AltGr has left #ocaml []
rand000 has quit [Ping timeout: 240 seconds]
Neros has joined #ocaml
malo has quit [Quit: Leaving]
Yoric has joined #ocaml
talzeus has joined #ocaml
Kakadu has quit []
Drup has quit [Ping timeout: 240 seconds]
nikki93 has joined #ocaml
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
yezariaely has joined #ocaml
<watermind> is integer exponentiation not part of the language? nor provided by some (possibly de facto) standard operator?
<watermind> toplevel explodes with: 1000000000000000000000000000000000000000;;
<watermind> Fatal error: exception Loc.Exc_located(_, _)
<watermind> version 4.00.1,,, can someone using 4.01 reproduce it?
<yezariaely> watermind: if you don't care about speed this might be what you are looking for:http://caml.inria.fr/pub/docs/manual-ocaml-4.01/libref/Big_int.html#VALpower_int_positive_int
<mrvn> watermind: + - * / ^ @ :: are not and . , and ; are in used. What do you want for exp()?
<watermind> yezariaely: nice
ontologiae_ has joined #ocaml
<yezariaely> though I am not sure about the speed drawbacks here...
q66 has joined #ocaml
<watermind> mrvn: I'm ok with a function, but that is for floats not ints
<watermind> mrvn: was just wondering if there was something int -> int to avoid reinventing the wheel
<ggole> Bookmark the docs, they have a listing of the standard library
<adrien> there's Zarith too
<watermind> yezariaely: ggole: I'm using Core though, I don't think I can use those libs when using JS Core, or can I?
<yezariaely> watermind: I have no experience with core, sorry.
<ggole> js_of_ocaml? Dunno.
<watermind> yezariaely: ok thanks
<watermind> adrien: interesting
<mrvn> http://paste.debian.net/57965/ for a little optimized version
q66 has quit [Quit: Leaving]
<mrvn> reduces the sensible recursion from 64 to 6
<mrvn> +depth
<mrvn> or: let int_expt x y = int_of_float ((float_of_int x) ** (float_of_int y))
<mrvn> It's a bit odd that "**" is float exponential. Should be "**.".
<watermind> mrvn: yeap I didn't expect that either
<mrvn> didn't expect ** to exist.
<watermind> in haskell they use **, ^^ and ^
<mrvn> ^ is string concat
<watermind> yeap
<watermind> ^^ is also used, at least in Core
<watermind> (^^) : ('a, 'b, 'c, 'd, 'e, 'f) format6 -> ('f, 'b, 'c, 'e, 'g, 'h) format6 -> ('a, 'b, 'c, 'd, 'g, 'h) format6 = <fun>
<watermind> whatever that may be
<pippijn> magic
<ggole> That's not Core, that's in the stdlib
<mrvn> printf format string concat
<watermind> I see
<ggole> (And ** is straight for Fortran, hardly a strange choice)
<mrvn> # "%d" ^^ "%s";;
<mrvn> - : (int -> string -> '_a, '_b, '_c, '_d, '_d, '_a) format6 = <abstr>
<ggole> *from
<pippijn> ^^ is magic
<watermind> os there some way I can query the operator to know where it is comming from? i.e. where is it defined?
<watermind> s/os/is
<mrvn> ggole: * is int mult, *. is float mult. So it should be ** for int exp and **. for float exp.
<pippijn> 3 times magic
<ggole> That would make sense
<ggole> Thought I think few languages have int exponents at all.
<watermind> even if you don't have int exponents it's useful to have floats to the power of ints
<mrvn> verry few values make sense for int exp. 2^x is shifts and anything bigger is rarely used and quickly overflows.
<watermind> as I'm pretty sure that can be made more efficient than the general case of float to the power of float
<ggole> square and cube are useful
<def-lkb> also, beware of ** precedence
<mrvn> watermind: exp(x, y) is e^log(x)*y. Doesn't get easier if y is int.
<mrvn> def-lkb: what precedence does it have?
<watermind> mrvn: I was almost sure haskell had (^) :: (Integral b, Num a) => a -> b -> a for efficiency reasons
<watermind> maybe I'm wrong
<def-lkb> utop # -2. ** 2.;;
<def-lkb> - : float = 4.
<watermind> oh
<mrvn> def-lkb: - is magic
<pippijn> yeah, - is parser magic
<def-lkb> mrvn: yes, you're right, the problem is on - side, yet the user will have bad surprise mixing both - and **
<mrvn> def-lkb: -2.0 shouldn't even work. - is integer unary minus.
<watermind> are there any lint like tools that check for these kind of mistakes?
<pippijn> - is ~-, I think
<mrvn> actually unary - and infix - is already magic.
<def-lkb> yep
<ggole> ~-.2.0 ** 2.0 doesn't do the right thing anyway
<ggole> (It's the same as -, which is at least consistent)
<mrvn> # let (~-) x = Printf.printf "'int -'\n%!"; ~- x;;
<mrvn> val ( ~- ) : int -> int = <fun>
<mrvn> # -1;;
<mrvn> - : int = -1
<mrvn> - doesn't call `-
<mrvn> ~-
<mrvn> How do you overload -?
<ggole> It's bound directly to the operator in question, I think
<mrvn> but let ( - ) .... defines the binary - operator.
<def-lkb> let x = 1 in -x;;
<def-lkb> otherwise, it's directly reduced to the literal -1
<def-lkb> (in this case it will call ~-)
<def-lkb> (and use ~-. for floats… yeah)
<mrvn> def-lkb: right. compiler optimization
<ggole> let x = ... creates a new binding for x, without affecting any existing references
<ggole> So let (-) = ... will only ever affect definitions that come after that let
<mrvn> ggole: That isn't the problem with -1
<ggole> But what I actually meant is that ~- and - are bound to the actual operator, in this case external ( ~- ) : int -> int = "%negint"
<def-lkb> ggole: - in a unary position is bound to (~-), except with literals
<def-lkb> (literals are directly negated)
<mrvn> ggole: -<literal> returns the negative while -<ident> calls ~-
<ggole> Right, but creating new a binding for ~- doesn't affect that
q66 has joined #ocaml
<mrvn> -<literal> should only give the negative if ~- wasn't bound manually.
<ggole> Wait, you're saying that rebinding ~- and then doing -x (but not -1) will invoke the new binding
<mrvn> ggole: yes.
<ggole> Ohhhhh
<ggole> Wow, that's ugly :/
<mrvn> - is not bound but calls whatever ~- is in that context.
<ggole> Sorry, bit slow here
<ggole> Right, what you were saying makes complete sense now.
<mrvn> # let x = 1 in -x;;
<mrvn> 'int -'
<mrvn> - : int = -1
<ggole> Yeah, just tested it :/
<ggole> Quite a hack.
<mrvn> too much magic in -
nikki93 has quit [Remote host closed the connection]
<watermind> mrvn: just out of curiosity, here's how ghc implements float ^ int http://www.haskell.org/ghc/docs/latest/html/libraries/base/src/GHC-Real.html#^
<watermind> mrvn: to be fair, that's not just float ^ int, instead the base can be anything from the class number
<watermind> but I never heard of any warnings about 3.0^3 being worse than 3.0** 3.0
ygrek has quit [Ping timeout: 272 seconds]
<watermind> got to investigate that
Drup has joined #ocaml
iZsh has joined #ocaml
iZsh has quit [Excess Flood]
<mrvn> depends on the cost of *, *., float_of_int, int_of_float, log and exp
nikki93 has joined #ocaml
iZsh has joined #ocaml
tane has joined #ocaml
q66 has quit [Quit: Leaving]
weie has quit [Quit: Leaving...]
<watermind> what is usually used as a temporary placeholder? failwith "" ? assert false? or is there something shorter with no arguments?
zpe has quit [Read error: No route to host]
<mrvn> let fixme _ = assert false fixme "should do blafasel"
zpe has joined #ocaml
<ousado> heh
<ousado> 'blafasel' is nice
<mrvn> fixme "visit foobar"
<ousado> mrvn: you're german?
<mrvn> yes
<ousado> I'm under the impression that's somewhat rare in ocaml
<ousado> me too, btw
nikki93 has quit [Remote host closed the connection]
<ousado> #ocaml
<adrien> yes?
Kakadu has joined #ocaml
<ousado> that should have been *#ocaml (typo in sentence above)
demonimin has quit [Ping timeout: 246 seconds]
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
yacks has joined #ocaml
ggole has quit []
ollehar has quit [Quit: ollehar]
ollehar has joined #ocaml
demonimin has joined #ocaml
watermind has quit [Remote host closed the connection]
watermind has joined #ocaml
<watermind> what's the problem with this?
<watermind> let test2 = begin printf "a"; 1 end
<adrien> I fail to see the use
<watermind> no use but I get a warning (in emacs)
<watermind> that it doesn't return or type is inconsistent
<watermind> using tuareg + merlin
<adrien> I don't get a warning with the default set
<rks`> hm
<rks`> how is your printf defined?
<rks`> if I use « Printf.printf » I get no warning
<watermind> I don't know...
<watermind> let me try that
steshaw has joined #ocaml
<rks`> that warning (21) however tends to appear when you use functions with a type looking like « 'a -> 'b »
<watermind> rks`: you;re right changing to Printf.printf gets rid of the warning
<watermind> but I thought it'd be the same
<watermind> is the exported version a different one?
<rks`> where does your printf come from, Core ?
<watermind> I'm using Core yes
<watermind> is there a way to see where functions come from with the toplevel?
<rks`> hmmm, I don't have the warning when using core...
<rks`> watermind: don't think so no.
<watermind> rks`: I don't get a warning in the toplevel, even using utop -w A
<watermind> but in emacs it does complain about it
<mrvn> watermind: what does "printf;;" return?
<rks`> watermind: ask the type of printf?
<watermind> - : ('a, out_channel, unit) format -> 'a = <fun>
<watermind> and Printf.printf
<watermind> - : ('r, out_channel, unit) format -> 'r = <fun>
<rks`> yes right
<watermind> looks the same up to alpha conversion
<rks`> watermind: try err
<watermind> although if it infers different types it's probably different
<rks`> merlin-reload or refresh
<watermind> err?
<rks`> try « M-x merlin-refresh »
<watermind> same
<rks`> (I don't think that will change anything, but you never know)
<rks`> right, you could try restarting merlin, but I don't think that'll be of use either
<watermind> I tried
<rks`> well, you can always open an issue
<rks`> with a small snippet reproducing for you, and the version of merlin you're using
<rks`> and I'll have a look
<watermind> sure, thanks rks`
manud has joined #ocaml
<rks`> you're welcome
steshaw has quit [Ping timeout: 240 seconds]
tobiasBora has joined #ocaml
darkf has joined #ocaml
dsheets has joined #ocaml
_andre has quit [Quit: leaving]
<def-lkb> watermind: on my computer, merlin tells that printf is not bound
<def-lkb> so effectively, printf "a" as an unsound type :). Yet with Printf.printf merlin gives the expected result
ocp has joined #ocaml
<watermind> that confuses me even more... :/
<rks`> def-lkb: he loaded core.
<rks`> when it is unbound, he says it's unbound.
<def-lkb> rks`: when it's unbound, it says it's unbound & the context where the ident is used has an unsound type
<rks`> right
<watermind> but in my case it is printf appears to be defined
Xuerian has left #ocaml []
<def-lkb> strange
<rks`> (I indeed get the "unsound type" warning when it's unbound, my bad)
<def-lkb> watermind: you opened Core before ? Did you add core package in merlin after typing the file ?
steshaw has joined #ocaml
<rks`> once again def-lkb, it should be reported if core isn't loaded
<rks`> so I guess he would have taken care of that before asking for the warning :'
<def-lkb> yes, but loading core after did not reset the cache of merlin until very recently
<def-lkb> so the error would stay if it first happened before loading the package
<watermind> rks`: ops sorry was away
<watermind> def-lkb: I didn't add anything to merlin, if I'm supposed to then I guess that may be the problem
ontologiae_ has quit [Ping timeout: 268 seconds]
<watermind> ops
<watermind> rks`: I didn't add anything to merlin, if I'm supposed to then I guess that may be the problem
<def-lkb> watermind: emacs or vim? :)
<watermind> emacs
<def-lkb> C-c l core
* adrien throws holy water at def-lkb
<def-lkb> :Use core
<adrien> too late, you've admitted you know emacs
<watermind> hmm doesn't seem to make a difference
<def-lkb> you have open Core.Std at the beginning of the file ?
<watermind> ah!
<watermind> that worked
<watermind> I forgot I had to, because top level includes it by default
<def-lkb> you may be interested in having a ".merlin" file in your directory (to automatically load packages)
<watermind> right
<watermind> couldn't merlin get that from .ocamlinit ?
<rks`> ... no.
<watermind> ok
Anarchos has joined #ocaml
nikki93 has joined #ocaml
steshaw has quit [Ping timeout: 240 seconds]
<jyeo> hmmmm i'm getting a Option -a cannot be used with .cmxa input files when i try to use ocamlbuild myfile.cmxa. what's going on?
<jyeo> this is the line that is causing the problems: ocamlfind ocamlopt -a -I +camlp4 camlp4lib.cmxa pp.cmx pa_debug.cmx -o myfile.cmxa
steshaw has joined #ocaml
<watermind> weird, not sure what I did, now it complains about unbound module core
<watermind> restaring emacs worked though
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
steshaw has quit [Ping timeout: 248 seconds]
zpe has quit [Read error: Operation timed out]
gargaml has joined #ocaml
<watermind> still a bit confused on how to work with multiple files
<watermind> assuming I'm just working with toplevel, and I have files a.ml and b.ml
<watermind> b.ml depends on a.ml
q66 has joined #ocaml
<watermind> how do you manage it? in Haskell one simply imports A from with B, and the interpreter deals with it
<watermind> compiling seems straightforward as ocamlbuild should find the dependencies from what I understand
<watermind> but in the interpreter I'm a bit lost
q66 has quit [Excess Flood]
<pippijn> adrien: ping
q66 has joined #ocaml
<def-lkb> watermind: #load_rec to load compiled bytecode object and its dependencies
<def-lkb> watermind: if your files are not compiled, #mod_use can typecheck and load a module
<watermind> def-lkb: hmm let me see
<gargaml> hi
<watermind> def-lkb: very confused...
<gargaml> I'm playing with modules and objects, and I'm unable to put a module as an object field…
<watermind> def-lkb: first utop doesn't seem to know #mod_use
<gargaml> but I can create a method which returns a first class module
<gargaml> is there a way to put a first class module in an object field ?
<def-lkb> watermind: 4.01
enstrophy has joined #ocaml
<def-lkb> (utop 1.7 with 4.01)
<watermind> def-lkb: but more than that, what is the process like...? There's files a.ml and b.ml. I want to use module A defined by a.ml in b.ml. I'm editing and interpreting b.ml... so I run utop... now what :/
<watermind> def-lkb: oh I'm on 4.00.1
<def-lkb> compile A.ml
<def-lkb> then #load "a.cmo"
<watermind> def-lkb: right
<def-lkb> watermind: generally, you always have to compile modules outside the toplevel, except for the one you are working on
<watermind> def-lkb: will merlin automatically pick that up?
<watermind> def-lkb: I see now, I didn't know that
<def-lkb> watermind: merlin work completely independently of utop
<def-lkb> you should specify path in .merlin (just read the doc)
<watermind> def-lkb: ok, thanks!
<rks`> (and the README, ok)
<watermind> rks`: that name is scary
ollehar has quit [Ping timeout: 265 seconds]
ocp has quit [Ping timeout: 272 seconds]
ollehar has joined #ocaml
q66 has quit [Read error: No route to host]
q66_ has joined #ocaml
Simn has joined #ocaml
tane has quit [Quit: Verlassend]
pango has quit [Remote host closed the connection]
enstrophy has quit [Quit: Page closed]
Kakadu has quit []
paddymahoney has joined #ocaml
pango has joined #ocaml
q66_ is now known as q66
zpe has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
gargaml has quit [Quit: WeeChat 0.4.1]
wmeyer has joined #ocaml
MitoticSpindle has joined #ocaml
<wmeyer> hello
<pippijn> hi
<wmeyer> hello pippijn
zpe has quit [Ping timeout: 272 seconds]
gour has quit [Disconnected by services]
gour_ has joined #ocaml
<wmeyer> hello gour_
Simn has quit [Quit: Leaving]
nikki93 has quit [Remote host closed the connection]
<gour_> wmeyer: hiya
<gour_> jsut preparing to go to sleep...
Yoric has joined #ocaml
<wmeyer> gour_: so wishing good night then
<gour_> wmeyer: ok, see you tomorrow ;)
gour_ has quit [Quit: WeeChat 0.4.1]
<pippijn> wmeyer: I'm going to london, soon
shinnya has joined #ocaml
<wmeyer> pippijn: when?
<wmeyer> that's great
<pippijn> I don't know exactly when
<pippijn> but very soon
<pippijn> within the next few weeks
wolfnn has quit [Ping timeout: 264 seconds]
yezariaely has quit [Quit: Leaving.]
steshaw has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-280704]: i've been blurred!]
tobiasBora has quit [Quit: Konversation terminated!]
Yoric has quit [Ping timeout: 246 seconds]
lamawithonel_ has quit []
nikki93 has joined #ocaml
lamawithonel_ has joined #ocaml
lamawithonel_ has quit [Client Quit]
q66 has quit [Ping timeout: 272 seconds]
ollehar has quit [Quit: ollehar]
nikki93 has quit [Remote host closed the connection]
mfp has quit [Ping timeout: 272 seconds]
nikki93 has joined #ocaml
pango_ has joined #ocaml