Yurik changed the topic of #ocaml to: http://icfpcontest.cse.ogi.edu/ -- OCaml wins | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml| Early releases of OCamlBDB and OCamlGettext are available
asquii has joined #ocaml
asqui has quit [Read error: 104 (Connection reset by peer)]
asquii is now known as asqui
rox is now known as rox|downunder
coolice has quit ["Client Exiting"]
Kinners has joined #ocaml
docelic is now known as docelic|sleepo
mellum has joined #ocaml
mattam_ has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
mrvn_ has joined #ocaml
TachYon has quit [Read error: 113 (No route to host)]
skylan has quit ["O_O"]
skylan has joined #ocaml
mrvn has quit [Read error: 110 (Connection timed out)]
emu has quit [Remote closed the connection]
emu has joined #ocaml
asqui has quit [Read error: 110 (Connection timed out)]
lament has joined #ocaml
Kinners has left #ocaml []
<seth_> anyone home?
<seth_> I have a type error on a statement using a Map, and I'm not quite sure what it is telling me.
<pattern_> what is the statement, and what is the error?
<pattern_> http://www.rafb.net/paste/ if it's more than a line or two
<seth_> ok, it is only three lines altogether, so I'll paste it.
<seth_> module Stringmap = Map.Make (String)
<seth_> (Stringmap.add (List.nth fs 0) (List.nth fs 1) hmap)
<seth_> This expression has type 'a list Stringmap.t = 'a list Map.Make(String).t
<seth_> but is here used with type
<seth_> Stringmap.key Stringmap.t = Stringmap.key Map.Make(String).t
<seth_> Type 'a list is not compatible with type Stringmap.key = string
<seth_> fs is a list of strings, so both of the expressions in the add call are string
<seth_> the line is actually an assignment to a mutable class member, so it starts with hmap <-, I left that out for clarity
<seth_> hmap <- (Stringmap.add (List.nth fs 0) (List.nth fs 1) hmap)
<pattern_> oh, it's from the map module... i thought you were having problems with List.map.... never used the map module myself :(
<pattern_> but maybe someone else here is awake
<seth_> The columns specify the error at "hmap" (the second one, at the end of the line).
<seth_> I don't know why it infers a type of 'a list, rather than 'a
<mrvn_> Where do you get fs from?
<mrvn_> module Stringmap = Map.Make (String)
<mrvn_> let fs = ["a"; "b"];;
<mrvn_> let hmap = Stringmap.empty;;
<mrvn_> # (Stringmap.add (List.nth fs 0) (List.nth fs 1) hmap);;
<mrvn_> - : string Stringmap.t = <abstr>
mrvn_ is now known as mrvn
<seth_> mrvn: still here? I was on the phone.
<mrvn> yes
<seth_> mrvn: I have another place where I use a Stringmap and I get no errors.
<seth_> mrvn: fs is a list of string
<mrvn> seth_: Then it would work
<seth_> mrvn: I know, except it doesn't. In both cases, the fs list is produced by a call to Str.split
<seth_> I can show you the code that works and the code that gets the compile error.
<mrvn> Think about it. You did something wrong.
<mrvn> add some types at strategic places.
<seth_> mrvn: I've checked every type. But I'll check again. Clearly there is a reason the compiler accepts one and not the other.
<seth_> mrvn: your example works, but your example isn't really close to my code.
<seth_> mrvn: Something interesting. The compile error only occurs if the code is part of an initializer
<seth_> I found the problem. It is a type inference from a different method in the same class.
lament has quit ["Support Darwin Awards! Join the military!"]
lam has quit ["leaving"]
lam has joined #ocaml
lam has left #ocaml []
lam has joined #ocaml
TachYon26 has joined #ocaml
rox|downunder is now known as rox
asqui has joined #ocaml
TachYon26 has quit ["bez ki³y nie ma zaliczenia (z prawd studentek AM)"]
karryall has quit ["uit"]
Kinners has joined #ocaml
smkl has quit [Read error: 104 (Connection reset by peer)]
smklsmkl has joined #ocaml
emu has quit [Remote closed the connection]
emu has joined #ocaml
lam has quit [Remote closed the connection]
mattam_ has quit [Remote closed the connection]
vegai has quit [Remote closed the connection]
mattam has joined #ocaml
vegai has joined #ocaml
lam has joined #ocaml
docelic|sleepo is now known as docelic
Kinners has left #ocaml []
docelic is now known as docelic|away
docelic|away is now known as docelic
karryall has joined #ocaml
smklsmkl is now known as smkl
docelic is now known as docelic|away
docelic|away is now known as docelic
docelic is now known as docelic|away
docelic|away is now known as docelic
blueflame has joined #ocaml
blueflame has left #ocaml []
coolduck has quit ["Client Exiting"]
karryall has quit ["bye"]
systems has joined #ocaml
liyang has quit [sterling.freenode.net irc.freenode.net]
liyang has joined #ocaml
clam has joined #ocaml
karryall has joined #ocaml
<systems> so what is planned for the next release of ocaml ?
systems has quit ["Client Exiting"]
Smerdyakov has quit ["Fascinating"]
<seth_> don't know
<seth_> quick question, if you happen to know? Is there a constant in ocaml to indicate "unset" (like e.g. nil in Ruby). Obviously you can create a type that does it by I'm wondering if one already exists.
<pattern_> i don't think it is possible to create an uninitialized value in ocaml
<pattern_> but i'm a newbie... perhaps i'm wrong
<seth_> No, I think you are probably correct, I just want to make sure I'm not missing something.
clam has quit [Read error: 110 (Connection timed out)]
mattam has quit [Read error: 110 (Connection timed out)]
docelic has quit [Excess Flood]
docelic has joined #ocaml
<mrvn> seth_: the option type is predefined as None | Some of 'a
<seth_> So I can use None with any type?
<mrvn> as with all polymorphic types
docelic has quit [Excess Flood]
docelic has joined #ocaml
mattam has joined #ocaml
Smerdyakov has joined #ocaml
TachYon has joined #ocaml
sproctor has joined #ocaml
<sproctor> what's the syntax for specifying a type for a function?
<sproctor> oh, unit was my issue... ignore me.
TachYon has quit ["Client Exiting"]
sproctor has quit ["[BX] Time wasted: 26m 21s"]
emu has quit [sterling.freenode.net irc.freenode.net]
skylan has quit [sterling.freenode.net irc.freenode.net]
mrvn has quit [sterling.freenode.net irc.freenode.net]
mellum has quit [sterling.freenode.net irc.freenode.net]
cm has quit [sterling.freenode.net irc.freenode.net]
rox has quit [sterling.freenode.net irc.freenode.net]
Riastradh has quit [sterling.freenode.net irc.freenode.net]
gl has quit [sterling.freenode.net irc.freenode.net]
emu has joined #ocaml
skylan has joined #ocaml
mrvn has joined #ocaml
mellum has joined #ocaml
gl has joined #ocaml
Riastradh has joined #ocaml
cm has joined #ocaml
rox has joined #ocaml
emu_ has joined #ocaml
emu has quit [Connection reset by peer]
asqui has quit [Excess Flood]
asqui has joined #ocaml