On 2004-04-28T15:12:03-0400, S. Alexander Jacobson wrote:
Ok, but it sounds like you need to know the list
of possible types in advance. Is it possible
to have a lib take a filepath and type name as an
arbitrary string, and read the instance in?
I don't think you need to know the list of
On 2004-04-28T23:33:31-0400, S. Alexander Jacobson wrote:
I don't think this works. I just tried it with:
main = print $ lookupRead 1 [(1,(Integer,100))]
This fails for the same reason
print $ read 100
fails. You need to give a type signature to avoid type-class instance
ambiguity:
I don't think this works. I just tried it with:
main = print $ lookupRead 1 [(1,(Integer,100))]
How would Haskell know that typ actually does
equal typeOf?
-Alex-
_
S. Alexander Jacobson mailto:[EMAIL
But isn't the point of this code that you don't
need that type signature? If I knew in advance
that it was an Integer then I wouldn't need to
passs Integer in the list.
-Alex-
On Thu, 29 Apr 2004, Chung-chieh Shan wrote:
On 2004-04-28T23:33:31-0400, S. Alexander Jacobson wrote:
I don't
On 2004-04-29T11:50:48-0400, S. Alexander Jacobson wrote:
But isn't the point of this code that you don't
need that type signature? If I knew in advance
that it was an Integer then I wouldn't need to
passs Integer in the list.
In the context in which the code was originally written, the
Ok, but it sounds like you need to know the list
of possible types in advance. Is it possible
to have a lib take a filepath and type name as an
arbitrary string, and read the instance in?
The context here is that I'm writing an App Server
(tentative name: HAppS) that given an instance of:
S. Alexander Jacobson [EMAIL PROTECTED] wrote in article [EMAIL PROTECTED] in
gmane.comp.lang.haskell.cafe:
Is is possible to read/show an existentially typed
list?
Would it be possible if, instead of using
read/show, I defined some variant that relies on
the typeof/typeable