rwmjones has quit ["This computer has gone to sleep"]
ikaros_ has quit [Read error: 110 (Connection timed out)]
dark has joined #ocaml
thrasibule has joined #ocaml
pad has quit [Remote closed the connection]
Pimm has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has joined #ocaml
tmaeda is now known as tmaedaZ
yakischloba has joined #ocaml
pad has joined #ocaml
onigiri_ has joined #ocaml
ski_ has quit ["Lost terminal"]
<spicey>
ta-damm, there it goes - http://github.com/einars/glcaml - my fork of glcaml with sdl_mixer support, and, possibly, other things in the future, as i'm using ocaml/gl/sdl for my pet project
<spicey>
i doubt that anyone except for me is excited about that, but it does feel good
<thelema>
It's good to have more people hacking on ocaml.
<thelema>
I'm not a graphics person much, I've done a total of (1) project in ocaml that has any sort of graphical component
<spicey>
ocaml brought back my pleasure to code. i'm totally in love with it
* thelema
loves ocaml too.
ccasin has joined #ocaml
valross has joined #ocaml
maskd has quit ["leaving"]
caligula_ has joined #ocaml
caligula__ has quit [Read error: 110 (Connection timed out)]
Tianon has quit [Read error: 54 (Connection reset by peer)]
tmaedaZ is now known as tmaeda
pad has quit [Remote closed the connection]
Tianon has joined #ocaml
Tianon has quit [Client Quit]
Tianon has joined #ocaml
Tianon has quit [Client Quit]
Tianon has joined #ocaml
Tianon has quit [Client Quit]
ulfdoz has joined #ocaml
Tianon has joined #ocaml
<palomer>
spicey, you plan on including sdl_ttf?
<thelema>
This is a new error for me: Error: In the definition of t, type ('a, 'b) t should be ('b, 'a) t
<mrvn>
WTF?
<thelema>
I know. It's almost worth framing.
<palomer>
haha
<palomer>
what's the definition?
<thelema>
type ('a,'b) t = [ `Flat of ('a base * ('b, 'a) RS.t) | `Clust of ('a base * ('b,'a) t Vect.t) ]
<thelema>
but if I do what it tells me, it works.
<mrvn>
('b,'a) t Vect.t)?
<thelema>
yes, I changed RS.t from one type paramater to two, and didn't want to change the 'a base, so I did ('b, 'a) RS.t
<mrvn>
That wasn't my question. The Clust one is
<thelema>
and then I just used the same for Vect.
<thelema>
Apparently you can't permute the type parameters in a recursive type
<mrvn>
thelema: I don't really see why not
<palomer>
type ('a,'b) t = Foo of ('b,'a) t works for me
<mrvn>
# type ('a,'b) t = T of ('b, 'a) t;;
<mrvn>
type ('a, 'b) t = T of ('b, 'a) t
<palomer>
post it on the caml list
<palomer>
there's no reason why it shouldn't work
<thelema>
hmmm... ok, I don't see the problem. Although it doesn't give me the error if I fix it in either place.
<mrvn>
The error is right there but I don't see why it is an error
<palomer>
remove the polymorphic variants and it works
<palomer>
if you post it on the mailing list garrigue will have it fixed in no time
<mrvn>
# type ('a, 'b) t = [ `T of ('b, 'a) t ];;
<mrvn>
Error: In the definition of t, type ('a, 'b) t should be ('b, 'a) t
<thelema>
yes, he's good at that. Anything involving polymorphic variants or labels are his children.
<mrvn>
interesting
<thelema>
mrvn: Mind if I post your example to the list?
<mrvn>
go ahead
<mrvn>
or # type ('a, 'b) t = [ `A | `T of ('b, 'a) t ];;
<mrvn>
to make an actually constructable type.
ccasin has quit ["Leaving"]
<thelema>
I wonder...
<thelema>
# type ('a, 'b, 'c) t = [ `A | `T of ('a, 'c, 'b) t | `V of ('b, 'c, 'a) t];;
<thelema>
Error: In the definition of t, type ('a, 'b, 'c) t should be ('c, 'a, 'b) t
tmaeda has quit [Read error: 60 (Operation timed out)]
tmaeda has joined #ocaml
joewilliams has quit [Remote closed the connection]
avsm has joined #ocaml
tmaeda is now known as tmaedaZ
ttamttam has joined #ocaml
avsm has quit ["Leaving."]
tmaedaZ is now known as tmaeda
ygrek has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
yakischloba has quit ["Leaving."]
kaustuv has joined #ocaml
onigiri_ has quit []
Submarine has joined #ocaml
<kaustuv>
# type 'a t = ([`A of 'c] as 'c) constraint 'c = 'a t
<flux>
well, something is hiding the fact that t = int
<Leonidas>
I tried calling IntM.print (IntM.s_mult 1 u)
<flux>
oh, right, well the Arith module signature is hiding it
<Leonidas>
yep, obviously.
<flux>
so it's your code I take it?
<Leonidas>
flux: partly. Most of it is from the assignment, I don't think I am supposed to rewrite it.
<flux>
module IntArith : Arith with type t = int = struct .. end
<Leonidas>
so I have to write a int -> t function?
<flux>
iow: no
<Leonidas>
uhm, interesting
<flux>
happy coding, I'm off to sleep
<Leonidas>
sometimes I wonder whether I'll ever understand how ocaml works
<Leonidas>
flux: thanks.
<Leonidas>
could someone explain the WHY?
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: 60 (Operation timed out)]
ulfdoz_ is now known as ulfdoz
<mrvn>
Leonidas: type t is made abstract so that you can not simply use int for one but have to use some function of the module to create one. Usualy that function does some extra validity checks.
<mrvn>
Leonidas: Like you could have a module for positive numbers only. Creating one for -1 would throw an exception.
<Leonidas>
mrvn: and that with type t = int creates such a function?
<Leonidas>
implicitly?
<mrvn>
Abstract types also allow the module to change the internal representation (int) without the using code having to change.
<mrvn>
Leonidas: no. There must be an *.mli file with just "type t" for the module.
<mrvn>
or type t = private int;;
<Leonidas>
mrvn: I don't have such a mli-file and yet it works.
<mrvn>
Leonidas: no arithm.mli?
<Leonidas>
mrvn: no, no mli at all.
<mrvn>
Leonidas: you have module type Arith = sig ... end. That is the same as would be in an mli file
<mrvn>
Leonidas: line 6 creates the abstract type
Pimm has joined #ocaml
<Leonidas>
ah, I see.
onigiri_ has joined #ocaml
<mrvn>
Leonidas: Try IntM.var "1"
<mrvn>
wait, IntM.const "1" I mean.
<Leonidas>
Error: Unbound value IntM.const
<Leonidas>
but it works so far
<mrvn>
Calc.IntArith.const?
_zack has quit ["Leaving."]
<Leonidas>
that worked
<Leonidas>
but I think I prefer the other way...
<Leonidas>
but wait, when I add the "with type t = int" I de-abstractize the module, right?
<mrvn>
Leonidas: no. you just tell that it is int internally
<Leonidas>
ok, then I prefer that way, so I don't need to convert from strings.
ygrek has quit [Remote closed the connection]
munga has joined #ocaml
ttamttam has quit ["Leaving."]
maskd- has joined #ocaml
maskd has quit [Nick collision from services.]
maskd- is now known as maskd
yakischloba has quit ["Leaving."]
demitar has quit ["Ex-Chat"]
rwmjones has quit ["This computer has gone to sleep"]
rwmjones has joined #ocaml
maskd has quit [Read error: 110 (Connection timed out)]
ulfdoz has quit [Read error: 110 (Connection timed out)]
Pimm has quit [Read error: 110 (Connection timed out)]
munga_ has joined #ocaml
munga has quit [Read error: 110 (Connection timed out)]
jeddhaberstro has joined #ocaml
_Jedai_ has quit [Read error: 60 (Operation timed out)]
slash_ has quit [Client Quit]
Smerdyakov has joined #ocaml
Pimm has joined #ocaml
_unK has quit [Remote closed the connection]
avsm has joined #ocaml
onigiri_ has quit [Remote closed the connection]
onigiri_ has joined #ocaml
Smerdyakov has quit ["Leaving"]
munga_ has quit [Read error: 60 (Operation timed out)]