> > data Oracle = Oracle
> > data OracleConnection = OracleConnection
>
> > class DBMS dbms where
> > nameDBMS::dbms->String
>
> > class DBConnection c where
> > openConnection::(DBMS dbms) => dbms -> String -> c
> > nameConnection:: c -> String
>
> > instance DBMS Oracle where
> > nameDBMS d = "Oracle"
>
> > instance DBConnection OracleConnection where
> > openConnection dbms string = OracleConnection
> > nameConnection c = "OracleConnection"
>
> > test = openConnection Oracle "odbc:odbcURL"
>
> Test must be an OracleConnection.
> Why do I get an "unresolved top level overloading" error?
openConnection is a function declared for all types which are instances of the
class DBConnection!
Obviously the type of test must be an instance of DBConnection. But why should
the compiler deduce that test has type OracleConnection, though there's only
this instance of DBConnection.
Usually one declares several instances, so I'm sure there is no need for an
extra rule!
test must be typed explicitly.
Martin Stein