Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: Stack implementation (Imants Cekusins)
----------------------------------------------------------------------
Message: 1
Date: Sat, 10 Sep 2016 23:47:43 +0200
From: Imants Cekusins <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Stack implementation
Message-ID:
<CAP1qinZBgXYgMGeo974kqTSk4hVz76+=0-qckufxzfbzwqk...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hello Uneeb,
instances of class Stack are defined for *s*. empty's *return* type is *s a*
*empty* does not take any arguments. GHCi is confused about *empty*'s
*return* type.
option 1:
try adding *return* type at prompt e.g.:
empty::ListStack Int
instead of just empty
option 2:
add *a* as Stack class parameter i.e.:
class Stack s *a* where
...
then if you define only 1 instance, interactive will probably assume that
you expect *empty* to return that (the only one defined) type
see if this works
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20160910/239e24d4/attachment-0001.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 99, Issue 5
****************************************