ygrek has quit [Remote host closed the connection]
Frostillicus has joined #ocaml
Frostillicus has quit [Ping timeout: 252 seconds]
mange has joined #ocaml
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
Frostillicus has joined #ocaml
Serpent7776 has joined #ocaml
toastal has joined #ocaml
Frostillicus has quit [Ping timeout: 276 seconds]
Frostillicus has joined #ocaml
Haudegen has joined #ocaml
Frostillicus has quit [Ping timeout: 276 seconds]
myrkraverk has joined #ocaml
myrkraverk_ has quit [Ping timeout: 252 seconds]
toastal has left #ocaml [#ocaml]
toastal has joined #ocaml
theblatte has joined #ocaml
wbooze has quit [Quit: Leaving]
Haudegen has quit [Quit: Bin weg.]
bartholin has joined #ocaml
myrkraverk has quit [Quit: Leaving]
Haudegen has joined #ocaml
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #ocaml
myrkraverk has joined #ocaml
wbooze has joined #ocaml
ygrek has joined #ocaml
mange has quit [Remote host closed the connection]
toastal has left #ocaml [#ocaml]
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 265 seconds]
toastal has joined #ocaml
Tuplanolla has joined #ocaml
wbooze has quit [Read error: Connection reset by peer]
Frostillicus has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
Frostillicus has quit [Ping timeout: 252 seconds]
toastal has quit [Quit: Gateway shutdown]
toastal has joined #ocaml
DerTeufel has quit [Ping timeout: 276 seconds]
DerTeufel has joined #ocaml
wbooze has joined #ocaml
gahr has quit [Read error: Connection reset by peer]
gahr has joined #ocaml
wbooze_ has joined #ocaml
Tuplanolla has quit [Ping timeout: 252 seconds]
Tuplanolla has joined #ocaml
leah2 has quit [Ping timeout: 252 seconds]
leah2 has joined #ocaml
wbooze has quit [Ping timeout: 248 seconds]
remexre has quit [Remote host closed the connection]
chandrila has quit [Ping timeout: 260 seconds]
gwizon has joined #ocaml
gwizon is now known as kafrene
kafrene has quit [Quit: leaving]
gwizon has joined #ocaml
toastal has left #ocaml [#ocaml]
habnabit_ has quit [Ping timeout: 252 seconds]
habnabit_ has joined #ocaml
end has quit [Ping timeout: 252 seconds]
bcksl has quit [Ping timeout: 252 seconds]
Absalom has joined #ocaml
_whitelogger has joined #ocaml
myrkraverk_ has quit [Ping timeout: 260 seconds]
<discocaml>
<gbikal> Is there a way to make the following pass the type checker:
<discocaml>
<gbikal> ```
<discocaml>
<gbikal> class type node_t = object
<discocaml>
<gbikal> method node_name : string
<discocaml>
<gbikal> method node_type : int
<discocaml>
<gbikal> method append_child : 'a. (#node_t as 'a) -> unit
<discocaml>
<gbikal> end
<discocaml>
<gbikal> ```
<discocaml>
<gbikal> I am getting the following error,
<discocaml>
<gbikal> ```
<discocaml>
<gbikal> 68 | method append_child : 'a. (#node_t as 'a) -> unit
<discocaml>
<gbikal> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
<discocaml>
<gbikal> Error: The universal type variable 'a cannot be generalized:
bartholin has quit [Remote host closed the connection]
myrkraverk_ has joined #ocaml
Serpent7776 has quit [Ping timeout: 260 seconds]
bcksl has joined #ocaml
myrkraverk has quit [Ping timeout: 260 seconds]
end has joined #ocaml
Frostillicus has joined #ocaml
Frostillicus has quit [Ping timeout: 252 seconds]
myrkraverk has joined #ocaml
myrkraverk_ has quit [Ping timeout: 272 seconds]
wbooze_ has quit [Quit: Leaving]
<discocaml>
<froyo> while waiting for octachron's answer I have a question: why not just `node_t -> unit`? if it's going to write to some internal store of nodes, the objects with extra methods will need to be cast to `node_t` anyway. as you can't have e.g. `<a; b; c>` and `<c; d; e>` in the same list without casting them both to `<c>`.
wbooze has joined #ocaml
<discocaml>
<gbikal> mostly because when I use append_child, I have to upcast the children of node_t, like `a#append_child (b :> node_t)` where b is a child of `node_t`. I prefer not having to cast it.
myrkraverk_ has joined #ocaml
<discocaml>
<gbikal> ```'a. (#other as 'a) -> unit``` seems to work if I use other class/class type but not itself
myrkraverk has quit [Ping timeout: 276 seconds]
<discocaml>
<froyo> > I prefer not having to cast it.
<discocaml>
<froyo> fair, then splitting the definition and inheriting the nonrec part may be the way to go
myrkraverk has joined #ocaml
myrkraverk_ has quit [Ping timeout: 252 seconds]
<discocaml>
<froyo> maybe you could tie the knot with a type parameter
myrkraverk_ has joined #ocaml
<discocaml>
<froyo> no but then it's unusable as a class type...