Unlike most people I was drawn to Haskell not because it is a lazy
functional programming language but because it has an advanced type
system and very clean syntax. Unfortunately as I am quickly discovering
Haskell type system, while being rather _advanced_, is not nearly as
flexible as C++ system which is probably one of the most _flexible_ type
systems out there. I have made several inquiries about the type system
however I have gotten little reply.
The biggest one is that I would like to be able to make [(ix,el)], [Pair
ix el], and Array ix el all members of a Find class while should look
something like this:
class Find c ix el where
find :: ix -> c -> Maybe el
without having to define a new type or introducing the possibility of
unresolved overloading when the return type isn't explicitly known.
I would _really_ like to know if
1) Am I correct in assuming this is not possible with current Haskell as
implemented in Hugs and GHC (ie not just Haskell 98)?
2) Does anyone care that this type of thing is not possible?
3) Does any one have a solution to this problem?
4) What did you think of my idea for getting around this problem (and a
lot more) in the post titled "Idea: Nameable type parameters"
I really look forward to an authorized answer to these questions.
--
Kevin Atkinson
[EMAIL PROTECTED]
http://metalab.unc.edu/kevina/