ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.1 announcement at http://ocaml.org/releases/4.02.html | Public channel logs at http://irclog.whitequark.org/ocaml
<Drup> 'L' 'W' 'T'
malc_ has quit [Quit: leaving]
<Drup> never heard anyone pronounce it "lute" ...
badkins has quit [Remote host closed the connection]
badkins has joined #ocaml
Simn has quit [Quit: Leaving]
madroach has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
burgobianco has quit [Remote host closed the connection]
pippijn_ is now known as pippijn
badkins has quit [Remote host closed the connection]
burgobianco has joined #ocaml
marynate has joined #ocaml
BitPuffin has quit [Ping timeout: 250 seconds]
RossJH has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hugomg has quit [Ping timeout: 244 seconds]
sivoais_ is now known as sivoais
sivoais has quit [Changing host]
sivoais has joined #ocaml
hugomg has joined #ocaml
oscar_toro has quit [Ping timeout: 240 seconds]
sars_ has quit [Quit: Lost terminal]
shinnya- has quit [Ping timeout: 272 seconds]
dav has joined #ocaml
shinnya_ has joined #ocaml
dav has quit [Client Quit]
mcclurmc has joined #ocaml
hugomg has quit [Ping timeout: 265 seconds]
willy_ has quit [Ping timeout: 272 seconds]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wwilly has joined #ocaml
hugomg has joined #ocaml
gdsfh has quit [Ping timeout: 250 seconds]
hilquias has quit [Remote host closed the connection]
mcclurmc_ has joined #ocaml
mcclurmc has quit [Ping timeout: 244 seconds]
jao has joined #ocaml
brendan_ is now known as brendan
jao has quit [Changing host]
jao has joined #ocaml
mcclurmc_ has quit [Remote host closed the connection]
darkf_ has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
darkf_ is now known as darkf
<bbc> I'm not familiar with GADTs but I think I may have encountered them. is the following line a GADT definition or is it just a usual parametric type? https://github.com/mirage/ocaml-ipaddr/blob/master/lib/ipaddr.ml#L721
keen__________21 has joined #ocaml
keen__________20 has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 265 seconds]
mcclurmc has joined #ocaml
<Drup> that's usual parametric type
Haudegen has joined #ocaml
sol__ has quit [Ping timeout: 272 seconds]
nojb has joined #ocaml
chinglish has joined #ocaml
enitiz has quit [Remote host closed the connection]
mcclurmc has quit [Remote host closed the connection]
BitPuffin has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
<struktured> Drup: really? I was "corrected" in NYC when I called it l w t
_5kg has quit [Ping timeout: 240 seconds]
marynate has quit [Read error: Connection reset by peer]
marynate has joined #ocaml
marynate has quit [Max SendQ exceeded]
marynate has joined #ocaml
<Drup> well, the original author call it lwt, so, hum :D
<struktured> Drup: no one pronounces linux as lie - nux either :)
<alkoma> does it stand for light-weighted-thread? so perhaps just lwt?
marynate has quit [Ping timeout: 255 seconds]
<struktured> alkoma: yeah. light weight threads, or light weight cooperative threads
NoNNaN has quit [Ping timeout: 250 seconds]
kapil__ has joined #ocaml
nojb has quit [Quit: nojb]
myyst has quit [Ping timeout: 265 seconds]
myyst has joined #ocaml
pdewacht has joined #ocaml
pdewacht_ has quit [Ping timeout: 264 seconds]
ivan\ has quit [Ping timeout: 264 seconds]
myst|work has quit [Ping timeout: 264 seconds]
myst|work has joined #ocaml
ivan\ has joined #ocaml
NoNNaN has joined #ocaml
BitPuffin has quit [Ping timeout: 244 seconds]
<struktured> nice, got a github commit in 6 minutes after EST new years :)
<struktured> I should have timed it to 12:00:00
jao has quit [Ping timeout: 244 seconds]
_5kg has joined #ocaml
samrat has joined #ocaml
hugomg has quit [Ping timeout: 245 seconds]
alkoma has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
mcclurmc_ has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc_ has quit [Ping timeout: 255 seconds]
mcclurmc_ has joined #ocaml
mcclurmc has quit [Ping timeout: 265 seconds]
badkins has joined #ocaml
badkins has quit [Ping timeout: 240 seconds]
psy has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
samrat has joined #ocaml
nullcat has joined #ocaml
q66[lap] has quit [Quit: Textual IRC Client: www.textualapp.com]
marynate has joined #ocaml
psy has quit [Ping timeout: 244 seconds]
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
psy has joined #ocaml
Bluddy has quit [Quit: Connection closed for inactivity]
samrat has quit [Quit: Computer has gone to sleep.]
samrat has joined #ocaml
ggole has joined #ocaml
marynate has quit [Quit: Leaving]
marynate has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
RossJH has joined #ocaml
darkf_ has joined #ocaml
darkf_ has quit [Changing host]
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 244 seconds]
matason has joined #ocaml
_2can has quit [Disconnected by services]
darkf_ is now known as darkf
samrat has joined #ocaml
kakadu has joined #ocaml
samrat has quit [Ping timeout: 264 seconds]
matason has quit [Ping timeout: 256 seconds]
Arsenik has joined #ocaml
nojb has joined #ocaml
koderok has joined #ocaml
koderok has quit [Remote host closed the connection]
skchrko has joined #ocaml
funtik_ has left #ocaml [#ocaml]
tharugrim has quit [Ping timeout: 265 seconds]
tharugrim has joined #ocaml
samrat has joined #ocaml
samrat has quit [Ping timeout: 265 seconds]
funtik_ has joined #ocaml
samrat has joined #ocaml
mort___ has joined #ocaml
Gertm has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nojb has quit [Quit: nojb]
elfring has joined #ocaml
mort___ has quit [Quit: Leaving.]
leowzukw has joined #ocaml
leowzukw has quit [Client Quit]
lordkryss has joined #ocaml
marynate has quit [Ping timeout: 255 seconds]
marynate has joined #ocaml
jonludlam has joined #ocaml
tane has joined #ocaml
jonludlam has quit [Ping timeout: 240 seconds]
davine has joined #ocaml
davine has left #ocaml [#ocaml]
demonimin_ has joined #ocaml
demonimin has quit [Ping timeout: 256 seconds]
psy has quit [Ping timeout: 255 seconds]
Simn has joined #ocaml
antegallya has joined #ocaml
matason has joined #ocaml
mort___ has joined #ocaml
psy has joined #ocaml
matason has quit [Quit: leaving]
contempt has quit [Read error: Connection reset by peer]
larhat has joined #ocaml
larhat has quit [Client Quit]
samrat has quit [Quit: Computer has gone to sleep.]
samrat has joined #ocaml
BitPuffin has joined #ocaml
mort___ has quit [Quit: Leaving.]
contempt has joined #ocaml
badkins has joined #ocaml
badkins has quit [Ping timeout: 240 seconds]
dmbaturin_ is now known as dmbaturin
AlexRussia has quit [Ping timeout: 264 seconds]
AlexRussia has joined #ocaml
hugomg has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
AlexRussia has quit [Ping timeout: 255 seconds]
marynate has quit [Ping timeout: 255 seconds]
AlexRussia has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
larhat has joined #ocaml
antegallya has quit [Quit: Leaving.]
wwilly has quit [Ping timeout: 255 seconds]
willy_ has joined #ocaml
larhat has quit [Quit: Leaving.]
hekmek has joined #ocaml
samrat has joined #ocaml
eyyub has joined #ocaml
fraggle-boate_ has quit [Ping timeout: 256 seconds]
fraggle-boate_ has joined #ocaml
nojb has joined #ocaml
<nojb> can anyone explain informally what levels are used for in ocaml typechecker ?
<companion_cube> there's a paper about this
<companion_cube> informally I think it's linked to scoping, pervasively (scoping of functions, modules, visibility...)
<nojb> do you know how to find this paper ?
<companion_cube> see the reference
<nojb> great, thanks very much!
fraggle-boate_ has quit [Ping timeout: 250 seconds]
mort___ has joined #ocaml
fraggle-boate_ has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
<ggole> I was quite amused to read that a while back.
enitiz has joined #ocaml
<ggole> When I wrote my own toy type checker, I handled this by bumping an int ref.
<ggole> Which corresponds to the good old malloc-never-free trick.
Arsenik has quit [Remote host closed the connection]
Arsenik has joined #ocaml
ontologiae_ has joined #ocaml
ebzzry has joined #ocaml
ebzzry has quit [Remote host closed the connection]
ebzzry has joined #ocaml
dav has joined #ocaml
lordkryss has joined #ocaml
malc_ has joined #ocaml
samrat has joined #ocaml
contempt has quit [Remote host closed the connection]
govg has joined #ocaml
darkf has quit [Quit: Leaving]
<mrvn> Is there a simple syntax to hide a submodule from a modules type? Something to be used like this: module M = struct module Priv = private struct let x = 1 end include Priv end
mcclurmc_ has quit [Remote host closed the connection]
<nojb> module Priv : sig end = struct … end
<mrvn> nojb: Priv should not be in the signature of M
<mrvn> nojb: and I don't want to write the whole signature for M
<nojb> I see - then I don’t think so
contempt has joined #ocaml
mort___ has quit [Quit: Leaving.]
<mrvn> I'm stuck with a GADT again: https://gist.github.com/mrvn/0a9fd7e81a1ba9bfe008 The type system doesn't like me.
kapil__ has quit [Quit: Connection closed for inactivity]
dav has quit [Ping timeout: 272 seconds]
<nojb> the definition of as_strings is not very reasonable because conv_key and conv_value would need to have type ‘a. ‘a -> string
<mrvn> nojb: I want them to be of type : type a . a key -> string
<nojb> ah! sorry then you can fix it by using objects
<mrvn> nojb: the 'a is just a phantom so the string_of_key function is easy to write.
<mrvn> nojb: with an obj#to_string method?
<nojb> let as_strings : < conv_key : ‘a. ‘a key -> string > -> < conv_value : ‘a. ‘a value -> string > -> t -> string * string = fun o1 o2 (Univ (k, v)) -> (o1#conv_key k, o2#conv_value v)
MercurialAlchemi has joined #ocaml
<nojb> you could use records instead of objects if you prefer
mcclurmc has joined #ocaml
nojb has quit [Quit: nojb]
gabemc has joined #ocaml
<mrvn> Building those objects gives me: "The universal variable 'a would escape its scope". So still the same problem.
gabemc has quit [Ping timeout: 272 seconds]
<ggole> I think this roughly what nojb had in mind
<ggole> Note that the record fields are required to be polymorphic
<mrvn> yeah. but in my case M is actualy a functor and creating that record in the functor then fails.
<mrvn> (only tested with object but I assume the same happens)
<ggole> Mmm.
<mrvn> I hate that you can't mark functions as 'a . 'a -> ...
Thooms has joined #ocaml
<mrvn> ggole: It works if I pass that record into the functor from the input module.
<ggole> Er, you can?
<ggole> No wait, you must mean function arguments.
<mrvn> ggole: yes
<ggole> Yes. That becomes irritating pretty much as soon as you start programming with GADTs.
<mrvn> I still don't realy get why you can't pass an "a#5 t" to a function 'a t -> string.
<mrvn> The function doesn't care what 'a is.
<ggole> Because "a t" is only one type, but 'a . 'a t -> string must work for any 'a
<mrvn> ggole: I have one a#5 t. That's is one type. And a function 'a t -> string, which takes any type. In my mind a#5 is one of any.
<ggole> Er, right. Hmm.
<mrvn> Without gadt that usualy works. Like you can pass any type of list to List.length.
<ggole> You should be able to do that.
<mrvn> You can pass List.length as function argument and the called function can call it. But with GADTs suddenly it complains.
<ggole> About an escaping type variable?
<mrvn> yep.
<ggole> Yeah, I get pretty sick of that one.
<mrvn> Without GADTs you have something like: ('a list -> int) -> 'a list -> int. So the 'a gets bound by the second argument and all is fine. With GADTs you often don't bind the 'a and then the type escapes.
<mrvn> hmm, I just tried building the record inside the functor. That works. Maybe I did something else wrong when I tried it with object.
<mrvn> The UNIV functor is based on yesterdays AList. So thanks for that.
Bluddy has joined #ocaml
<mrvn> I'm still not happy about the use of Obj in equal but anything else is just tiresome to type.
<ggole> It does get old pretty fast.
<ggole> Fiddly, too - the comparisons have to be the right way around or you get fairly unhelpful error messages.
<mrvn> ggole: you mean the witness has to be the second argument?
skchrko has quit [Ping timeout: 265 seconds]
<mrvn> ggole: I explain that this way: ocaml doesn't actualy infer that the types in equal are equal (which they are not when you get None back). So you do get a ('a, 'b) Eq.t option back and cast converts from 'a to 'b. So the type you want to get has to be the second argument to equal.
<mrvn> That the case only gets invoked when 'a == 'b doesn't matter to the type system.
<mrvn> s/case/cast/
badkins has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
iZsh has quit [Excess Flood]
iZsh has joined #ocaml
gdsfh has joined #ocaml
hugomg has quit [Ping timeout: 256 seconds]
<ggole> mrvn: right
nojb has joined #ocaml
hugomg has joined #ocaml
mcclurmc has joined #ocaml
skchrko has joined #ocaml
hugomg has quit [Ping timeout: 256 seconds]
mcclurmc has quit [Ping timeout: 250 seconds]
psy has quit [Read error: Connection reset by peer]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
mcclurmc has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
chinglish has joined #ocaml
Haudegen has joined #ocaml
rustle_ has joined #ocaml
jonludlam has joined #ocaml
<rustle_> newbie here, what is the idiomatic way to structure a Container module? e.g BST. Right now I have in my .mli a NODE signature, a module Node that implements it, and a functor Make to signature COMPARABLE to another signature BST
<nojb> sounds ok to me - you can check out the standard library for examples
<rustle_> It's kind of weird that the toplevel is empty since every implementation is on Make
<mrvn> are you sure that you need a functor?
Arsenik has quit [Remote host closed the connection]
<rustle_> mrvn : Hmm, I need a functor to ensure that the user specify a compare function
pgomes has joined #ocaml
<mrvn> rustle_: The way I write ocaml code I first write my ml file. Then I use "ocamlc -i foo.ml" to show me the infered signature. That I cut&paste into the mli file and clean it up when I'm done writing the ml file.
<Drup> rustle_: can you show it ? :)
<rustle_> nojb : thanks! aside from few naming conventions my code is close to that
<mrvn> similar for module types for functors. I write the module, get ocamlc -i to print the type and then use that as basis for the module type signature.
<Drup> I was more interested by the mli :)
<Drup> (note that 4 space indentation in OCaml is not very idiomatic)
<mrvn> rustle_: is root ment to be parent?
<Drup> rustle_: "if Option.is_none foo then ... else ... Option.value_exn foo ..." is a non sense, use a pattern match !
mcclurmc has quit [Remote host closed the connection]
tharugri- has joined #ocaml
tharugrim has quit [Ping timeout: 250 seconds]
<rustle_> mrvn : Uh yeah, bad naming
<Drup> it's both more readable and more efficient and doesn't feel like Java code :>
<Drup> (you can also avoid code duplication in the loop)
malc_ has quit [Read error: Connection reset by peer]
malc_ has joined #ocaml
<mrvn> rustle_: the mli should contain (at least) 3 things: The module type of COMPARABLE, the module type that Make produces and the siganture for Make.
<rustle_> Drup : Yup, I think it can be refactored by pattern matching on left and right + guard
<mrvn> rustle_: I think Node should be declared inside Make.
<Drup> if the implementation doesn't depend on Comparable then no, it should not.
<mrvn> rustle_: and probably not included in the mli file. That is the internal structure of the container. Nothing the outside should see. right?
malc_ has quit [Read error: Connection reset by peer]
nojb has quit [Quit: nojb]
<Drup> rustle_: can you show the .mli ?
struktured has quit [Ping timeout: 272 seconds]
<rustle_> mrvn : Right, it should be hidden.
<rustle_> Drup : Uh, hang on I'm editing it now lol
<mrvn> Drup: Comparable is the input for the functor. You need that.,
<Drup> mrvn: Node doesn't depend on it.
<mrvn> Drup: you would leave node outside the functor? doesn't that potentially risk mixing nodes of different trees with the same 'a but different Comparable?
<Drup> that depends of the .mli
<mrvn> Is any of the infix operators right associative?
malc_ has joined #ocaml
mcc has joined #ocaml
<mrvn> Drup: thanks. I was looking in the lexical conventions.
<Drup> I have a bookmark directly to it :D
ontologiae_ has quit [Ping timeout: 272 seconds]
koderok has joined #ocaml
nojb has joined #ocaml
koderok has quit [Client Quit]
q66 has joined #ocaml
<rustle_> Somehow now I need one more type variable for the element stored
mcclurmc has joined #ocaml
<nojb> is there an easy way to read an *unsigned* 64-bit int into an int64?
<mrvn> "Arg (T TInt, Ret)" has type "('a, int -> 'a)" symbols but "(T TInt) @ Ret" has type "('_a, int -> '_a) symbols". Do I need to add some covariant to the type or something to the @ operator?
<mrvn> nojb: convert a string or from binary?
<nojb> convert from string
<mrvn> val of_string : string -> int64
mcclurmc has quit [Remote host closed the connection]
<nojb> i.e. “18446744073709551615” -> -1L
<nojb> of_string reads signed 64-bit decimals
<mrvn> # Int64.of_string "18446744073709551615";;
<mrvn> Exception: Failure "int_of_string".
<mrvn> I guess it does overflow checks.
mcclurmc has joined #ocaml
<mcc> What's the @ sign do?
<mrvn> mcc: let ( @ ) x y = Arg (x, y)
<mrvn> mcc: It's an infix operator. default is to concat lists.
tharugri- has quit [Quit: ZNC - http://znc.in]
struktured has joined #ocaml
<mcc> ok, i see
<mrvn> # [1;2] @ [3;4];;
<mrvn> - : int list = [1; 2; 3; 4]
<mrvn> nojb: I think there is an ocaml-uint package that has unsigned intXX modules
tharugrim has joined #ocaml
tharugrim has quit [Changing host]
tharugrim has joined #ocaml
<nojb> thanks
<mrvn> nojb: might be part of ctypes. can't remember
Hannibal_Smith has joined #ocaml
mcclurmc has quit [Ping timeout: 244 seconds]
<struktured> companion_cube: should CCList.fold_while be a fold right operation?
<companion_cube> I don't think it's necessary, fold_left is more natural (at least to me)
<companion_cube> and no, I don't care about catamorphisms :p
rustle_ has quit [Quit: Page closed]
mcclurmc has joined #ocaml
<struktured> companion_cube: ha ok. also small comment - you flipped 'a and 'b in your definition, but I think you meant the opposite, since your existing apis are that
<companion_cube> you mean, 'a is the accumulator?
<struktured> companion_cube: in the existing code 'a is the elem type and 'b is the accum, from what I've seen
<Drup> mrvn: hard to answer without the whole thing, but yes, and you will probably hit a wall :D
<companion_cube> hmmm, it surprises me
<mrvn> Drup: yes the type needs to change or yes the @ needs to change?
<Drup> first
<companion_cube> in general I tend to put as 'a the first type
<mrvn> Drup: adding a + to the type gives me: Error: In this GADT definition, the variance of some parameter cannot be checked
<mrvn> Drup: I gues I hit the wall you mentioned :(
<Drup> yep
<companion_cube> bleh
<companion_cube> struktured: I'd rather fix CCArray.fold :D
<mrvn> Drup: I will ignore that then. The use case for symbols fixes the type variable.
<mrvn> s/fixes/fixates/
<struktured> companion_cube: ok fine. just tell me what it should be :)
<struktured> companion_cube: post it in the issue, to be clear
hekmek has quit [Quit: Verlassend]
<companion_cube> well, I think it's simpler if the variables are named in the same order they occur in the signature
<companion_cube> see: List.fold_left
<struktured> companion_cube: stdlib list u mean?
<companion_cube> yes
<struktured> companion_cube: ok, I will adhere to that sig. not touching existing CCArray.fold unless you sign off on the api breakage
<companion_cube> there is no API breakage in changing the variable names!
<struktured> companion_cube: oh duh.yeah I thought it might switch where the accum and elem are but it doesn't
<companion_cube> no pb :)
eyyub has quit [Ping timeout: 245 seconds]
willy__ has joined #ocaml
koderok has joined #ocaml
willy_ has quit [Ping timeout: 256 seconds]
koderok has quit [Client Quit]
mcc has quit [Quit: This computer has gone to sleep]
willy__ has quit [Ping timeout: 244 seconds]
wwilly has joined #ocaml
jonludlam has quit [Ping timeout: 255 seconds]
pgomes has quit [Quit: Leaving]
mcclurmc_ has joined #ocaml
mcclurmc has quit [Ping timeout: 250 seconds]
mort___ has joined #ocaml
mcclurmc_ has quit [Ping timeout: 264 seconds]
samrat has quit [Quit: Computer has gone to sleep.]
samrat has joined #ocaml
AlexRussia has quit [Ping timeout: 245 seconds]
samrat has quit [Ping timeout: 244 seconds]
AlexRussia has joined #ocaml
ontologiae_ has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
samrat has joined #ocaml
<struktured> curse you opam and your desire to recompile everything
ontologiae_ has quit [Ping timeout: 240 seconds]
<Drup> You updated ocamlfind ?
<companion_cube> heh
<struktured> Drup: does opam really have to be that anal, in theory? I know in practice it probably avoids some catastrophes
<whitequark> it is not anymore
<whitequark> but packages don't cite ocamlfind as build dependency
<whitequark> well, some do, not all
<nojb> whitequark: does opam 1.2 support build deps ?
<Drup> yeah, that's precisely what he was saying
<Drup> but it has to be explicit in the opam file
<Drup> so most package don't do it (yet).
<nojb> thanks for the info
tani has joined #ocaml
demonimin_ has quit [Remote host closed the connection]
struktured has quit [Ping timeout: 245 seconds]
demonimin has joined #ocaml
tane has quit [Ping timeout: 250 seconds]
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
<mrvn> Ah the fun of Obj.magic: segmentation fault ./parser2
nullcat has joined #ocaml
<mrvn> Is magicing a value into a function supposed to work? I get a "Warning 20: this argument will not be used by the function." when I try and then segfault.
<mrvn> I'm pretty sure the value actually is a function.
travisbrady has joined #ocaml
<Drup> I'm going to reformulate the question, and answer it
<Drup> "Is using Obj.magic supposed to work" "No."
<nojb> mrvn: Obj.magic doesn’t *do* anything - it is just the identity
<Drup> :D
<mrvn> nojb: :)
<mrvn> The problem is that I have a GADT and ocaml says: Error: This expression has type b G.attribution. This is not a function; it cannot be applied.
tani is now known as tane
<mrvn> But above I matched it so that b should be 'a -> 'b
<mrvn> https://gist.github.com/mrvn/a6272bf4789cf7871221 if you want to have a look while I make dinner.
rgrinberg has joined #ocaml
<Drup> urk, this module EQASSOC is both ugly and non-sensical
samrat has quit [Ping timeout: 244 seconds]
<Drup> I don't understand why do you even want to do this thing.
<ggole> It's a bit like that GADT hash table I did a while back, I think
<Drup> ggole: except you didn't use Obj in it ...
<ggole> Yeah, I just did a lot of typing (rather, copy+paste)
<Drup> (arguably, a good deriver would be a better solution)
<ggole> Yeah
<ggole> Although you'd need some way to indicate which type+constructor to use because Eq isn't a standard thing
<whitequark> can do it with ppx_deriving
<Drup> whitequark: did you made it work with gadts ?
<mrvn> Drup: because I don't want to write: match (t1, t2) with (V1, V1) -> true | (V2, V2) -> true | (V3, V3) -> true | ...... (V100, V100) -> true, .... | _ -> false
<mrvn> Drup: The Obj is just a shortcut for listing all the cases of the GADT.
<whitequark> Drup: no changes are necessary
<whitequark> only standard derivers don't support GADTs, ppx_deriving itself doesn't care
<mrvn> Drup: any idea on the actual error? Line 404
<Drup> mrvn: I refuse to do black magic, sorry.
nojb has quit [Quit: nojb]
lordkryss has quit [Quit: Connection closed for inactivity]
<mrvn> Drup: just ignore the EqAssoc.
ggole has quit []
nojb has joined #ocaml
struktured has joined #ocaml
travisbrady has quit [Quit: travisbrady]
sinelaw has joined #ocaml
<sinelaw> Does ocaml have anonymous recursive types?
<sinelaw> I assume it does in objects
travisbrady has joined #ocaml
<sinelaw> with methods
<mrvn> sinelaw: with -rectypes
<sinelaw> mrvn, without -rectypes
<whitequark> anonymous?
<sinelaw> whitequark, undeclared, inferred only
<whitequark> no, I meant as a reply to mrvn
<sinelaw> ski gave me an example a few days ago
<sinelaw> I'm not sure it's what I thought it was
<Drup> let rec iter f = function `Nil -> () | `Cons (x,xl) -> f x ; iter f xl ;;
<Drup> val iter : ('a -> 'b) -> ([< `Cons of 'a * 'c | `Nil ] as 'c) -> unit = <fun>
<Drup> :p
axiles has joined #ocaml
<Drup> sinelaw: is that what you wanted ?
Hannibal_Smith has quit [Quit: Leaving]
<sinelaw> Drup, looks like it, thanks
<sinelaw> I'm new to the variant tag syntax
<sinelaw> Drup, this is the recursive type:
<sinelaw> [< `Cons of 'a * 'c | `Nil ] as 'c
<sinelaw> ?
<Drup> yes
<sinelaw> cool!
<sinelaw> nice syntax
<Drup> the important part is that there is the "as 'c" here, of course.
<mrvn> but is it annonymous? It has a constructor Cons
<Drup> mrvn: sure it's anonymous, the type doesn't have a name.
<Drup> (well, except " 'c " ...)
<Drup> (it's not really a name)
<mrvn> I thought he ment something like ('a -> 'b) as 'a -> 'b
<sinelaw> mrvn, what's that?
<mrvn> sinelaw: something that only works with -rectypes
<sinelaw> Drup, so your example works without -rectypes because of the variant labels, right?
nojb has quit [Quit: nojb]
<sinelaw> mrvn, I'm having trouble with that syntax. what exactly does it say?
<sinelaw> oh
<mrvn> sinelaw: It's a function that takes a continuation and returns the return type of the continuation.
<sinelaw> mrvn, is it this? a -> a -> a -> ....
<Drup> mrvn: is " ('a -> 'b) as 'a " inhabited ?
<mrvn> Drup: yes.
<Drup> useful example of such function ?
<Drup> that actually use it's argument(s)
<Drup> its*
<sinelaw> -rectypes allows for some very useless types
<Drup> rectype is very dangerous
<mrvn> Drup: # let rec f cont x = cont f x;;
<mrvn> val f : ('a -> 'b -> 'c) -> 'b -> 'c as 'a = <fun>
<mrvn> slightly different example
axiles has quit [Remote host closed the connection]
<Drup> 1) most of the time, the type infer is not the one you want, and is quite weird or impossible 2) it's "contagious". If something is compiled with rectype (and that it's visible in the interface), everyone that depends on it must use rectypes too.
<flux> for some value of useful :)
mcc has joined #ocaml
<flux> re 2: I supppose rectypes is ok for 'end user programs'
<Drup> mrvn: not the same type.
<flux> but avoid it at least in libraries..
mcc has quit [Client Quit]
<flux> btw, how does haskell show those types?
<flux> you could ask djinn for an implementation ;)
<Drup> personally, I will avoid it because most of the time, I don't understand the type produced >_>
<sinelaw> flux, haskell doesn't have equi-recursive types
<sinelaw> no -rectypes
<flux> slightly surprising. not even as extension? everything is an extension in ghc.
<Drup> sinelaw: and to answer your question, yes, there is an intermediate constructor, so it's allowed (even if it's an anonymous constructor)
<Drup> flux: "There is an extension for that!"
<sinelaw> I don't think there's one. You can get it by using explicit data constructors
<mrvn> Drup: use case for simple cooperative multitasking: let rec plus_one x cont = Printf.printf "x = %d\n" x; cont (plus_one (x+1))
<sinelaw> which is not really "it"
<mrvn> let rec plus_two y cont = Printf.printf "y = %d\n" y; cont (plus_two (y+2))
<mrvn> (plus_one 0) (plus_two 0);;
<mrvn> Drup: without -rectypes you have to add a type with constructor in there.
mcclurmc has joined #ocaml
<Drup> sinelaw: for example
<Drup> with rectypes, this is valid:
<Drup> let rec f g = f f ;;
<Drup> most of the time, when you write something like that, it's a typo.
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
<flux> reminds me of a meme.. "on -rectypes, it is"
<mrvn> to undserstand recusrion you have to understand recursion
<sinelaw> Drup, yeah, which is why -rectypes is not really something you want to turn on
<sinelaw> mrvn, not sure if that's recursion or just an empty tautology
<sinelaw> x = x
travisbrady has quit [Quit: travisbrady]
rgrinberg has quit [Quit: Leaving.]
<mrvn> to undserstand recusrion you have to understand recursion first
<mrvn> better?
<sinelaw> yes!
<sinelaw> x = (x,x)
<mrvn> # let rec x = (x, x);;
<mrvn> val x : 'a * 'a as 'a = (<cycle>, <cycle>)
<mrvn> .oO(Since when doesn't that print a ton of x's anymore?)
<sinelaw> the bicycle expression
<Drup> mrvn: 4.02 ?
<Drup> I think
<Drup> or 4.01
<sinelaw> > let x = (x,x) in x
<sinelaw> <lambdabot> Occurs check: cannot construct the infinite type: t2 ~ (t2, t3)
<sinelaw> hmm
<sinelaw> actually ocaml too:
<sinelaw> # let rec x = (x,x) in x
<sinelaw> Error: ...The type variable 'a occurs inside 'a * 'b
<mrvn> sinelaw: rectypes to the rescue
<sinelaw> mrvn, you used them for the bicycle?
<mrvn> yes
<sinelaw> ah ok
<sinelaw> from now on I'll call it the bicycle type
<Drup> bicycle <3
<companion_cube> (o,o)
tane has quit [Quit: Verlassend]
<whitequark> lol
<Drup> (Now I have Queen's song in my head ~~)
<struktured> me too
<mrvn> I want to type a bicycle.
<sinelaw> haha
<struktured> lol
<Drup> :D
rgrinberg has joined #ocaml
dav has joined #ocaml
rks` has joined #ocaml
mort___ has quit [Quit: Leaving.]
malc_ has quit [Quit: leaving]
ontologiae_ has joined #ocaml
ontologiae_ has quit [Ping timeout: 244 seconds]
mcc has joined #ocaml
Muzer has quit [Excess Flood]
dav has quit [Ping timeout: 264 seconds]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
travisbrady has joined #ocaml
Muzer has joined #ocaml
nullcat has joined #ocaml
wwilly has left #ocaml ["Leaving"]
OnkV has joined #ocaml
wormphlegm has joined #ocaml
mrvn_ has joined #ocaml
n_v has joined #ocaml
seggy has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
bytbox has quit [Ping timeout: 256 seconds]
wormphle1m has quit [Ping timeout: 256 seconds]
gasche has quit [Ping timeout: 256 seconds]
RossJH has quit [Ping timeout: 256 seconds]
segmond has quit [Ping timeout: 256 seconds]
mrvn has quit [Ping timeout: 256 seconds]
n0v has quit [Ping timeout: 256 seconds]
n_v is now known as n0v
Haudegen has quit [Ping timeout: 264 seconds]
nullcat has left #ocaml ["Textual IRC Client: www.textualapp.com"]
nullcat has joined #ocaml
vanila has joined #ocaml
<vanila> hi
<sinelaw> hi
<vanila> any recommendation for a quick way to get mirage running in virtualbox?
elfring has quit [Quit: Konversation terminated!]
gasche has joined #ocaml
travisbrady has quit [Quit: travisbrady]
keen__________22 has joined #ocaml
keen__________21 has quit [Ping timeout: 244 seconds]
badon has quit [Quit: Leaving]
bytbox has joined #ocaml
travisbrady has joined #ocaml
rgrinberg has joined #ocaml
RossJH has joined #ocaml
sinelaw has quit [Ping timeout: 245 seconds]
kakadu has quit [Remote host closed the connection]
<mrvn_> Input = '(TInt 3) TMul (TInt 2) TAdd (TInt 1) TEof'
<mrvn_> Parsed = '((3 * 2) + 1)'
<mrvn_> Jippey. The parser works again.
mrvn_ is now known as mrvn
enitiz has quit [Remote host closed the connection]
Simn has quit [Quit: Leaving]
lordkryss has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
RossJH has quit [Quit: Textual IRC Client: www.textualapp.com]
enitiz has joined #ocaml
mcclurmc has quit [Ping timeout: 245 seconds]
dav has joined #ocaml
Muzer has quit [Excess Flood]
mcclurmc has joined #ocaml
Muzer has joined #ocaml