Hello everyone,
I've been banging my head against my desk a bit so I figured it's time
to ask for help :-)
I'm writing an application that persists data to disk. The hard stuff
is pretty much done (binary serialisation, etc...) The big stumbling
block is that I want users to be able to
On 4/12/06, Scott Weeks [EMAIL PROTECTED] wrote:
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
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.
The
On Apr 12, 2006, at 3:18 PM, Scott Weeks wrote:
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)
Robert Dockins wrote:
On Apr 12, 2006, at 3:18 PM, Scott Weeks wrote:
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,
Or carry an instance in along with a type parameter, using
existentials or GADT.
Brandon Moore
Do you know of an example that would apply to my situation?
I think I neglected to state part of my problem. I am storing the root
nodes of btree indexes in a heterogeneous list using Typeable.
On Apr 12, 2006, at 4:09 PM, Scott Weeks wrote:
Or carry an instance in along with a type parameter, using
existentials or GADT.
Brandon Moore
Do you know of an example that would apply to my situation?
I think I neglected to state part of my problem. I am storing the
root nodes of
You are trying to assign two distinct types to dynFoo; that's a no-no.
You need to move the usage of the polymorphic function out of the let
so that the use at each distinct type doesn't get unified.
{-# OPTIONS -fglasgow-exts #-}
import Data.Dynamic
data Foo a = FVal a