Bjorn Lisper <[EMAIL PROTECTED]> writes:
> data LispList t = Atom t | LispList [LispList t] | Str [Char]
>
> instance Show t => Show (LispList t) where
> show (Atom t) = show t
> show (LispList t) = show t
> show (Str t) = show t
>
> hugsprompt> (LispList [Atom 1, Str "HEJ"]) ==> [
Simon Peyton-Jones wrote:
>...
> msg :: forall a. Show a => String
>
>Urk! What "Show" dictionary should Hugs use when evaluating "msg"?
>
>You may say "it doesn't matter", but in general that's not the case.
>In the case of class Num, for example, we might have
>
> expr = 3+4
>
Hi all,
I though you might apreciate this:
I've been reading the BOFH (Bastard Operator From Hell) serialisation
in The Register (www.theregister.co.uk) far to much recently.
He (the bastard) often uses his excuse board to confuse his helpless
users.
http://bofh.ntk.net/ExcuseBoard.html
I hav
"Simon Peyton-Jones" <[EMAIL PROTECTED]> tries his hand at
inventing free theorems for qualified types, then concludes:
> In which case we could report ambiguity a bit less often. How
> useful this would be I don't know.
A lot. Any time one is testing the empty case of a bulk type. If
you're c
Interesting. The difficulty (which GHCi has too) is this. Consider
expr = Str "foo"
msg = show expr
Hugs wants to print msg. What are the types?
expr :: forall a. LispList a
msg :: forall a. Show a => String
Urk! What "Show" dictionary should Hugs use when e
This problem is probably caused by the unbound type variable in
values like (Str "HEJ").
Try giving a specific type as the parameter to LispList:
(Str "HEJ" :: LispList Int)
The error message here could me more informative!
John
___
Haskell mailin
Hi,
For a change, a teacher asking for help on behalf of a student
I have a student who wants to emulate S-expressions of Lisp in Haskell. He
came up with the following data type:
data LispList t = Atom t | LispList [LispList t] | Str [Char]
This works just fine. He then wanted to make it