
12 Apr
2006
12 Apr
'06
11:08 a.m.
On 4/12/06, Scott Weeks
Hello everyone,
I've been banging my head against my desk a bit so I figured it's time to ask for help :-)
When a user queries I have to read the input from IO and then somehow cast the key/index type without angering the type checker. If I omit the following function I get the ominous "Ambiguous type variable a..." error. If I use it I get a complaint that the checker was expecting an Integer rather than a PackedString.
Well, if you get an "ambiguous type variable" error, you probably (I think) need to add some type annotations. For example: class Foo a where foo :: a bar :: a -> String Evaluating bar foo will result in an error, but bar (foo :: Integer) will work just fine.