[web-devel] Question about happstack
orclev at gmail.com
Tue Apr 20 13:30:00 EDT 2010
I'm not sure I understand your question. I've got the happstack-server
package installed, as well as various other happstack packages. In fact I
used cabal to download the source for happstack-server which contains the
newtype declaration for ServerPartT in order to verify that it does in fact
declare a MonadIO instance for ServerPartT (which it does by deriving it as
opposed to explicitly declaring it). It rather thoroughly puzzles me that
GHC seems to think there's no MonadIO instance for ServerPartT, but I can go
take a look at the source code and see it declared. I can really only think
of two possible explanations aside from a defect in GHC itself, which is
that either there's something wrong with the way ServerPartT is being
exported/imported, or there's some kind of mismatch between the MonadIO
declaration in the version of mtl I'm using, and whatever is being used to
build happstack-server. Of course by the same token I'm a pretty big newbie
with Haskell, so there's probably quite a few other possible explanations
that I can't even begin to think of.
-R. Kyle Murphy
Curiosity was framed, Ignorance killed the cat.
On Tue, Apr 20, 2010 at 13:07, davean <davean at xkcd.com> wrote:
> I'm away from my computer right now also, but I seem to recall having this
> issue myself at one point; do you also have happstack?
> On Tue, Apr 20, 2010 at 10:02 AM, Kyle Murphy <orclev at gmail.com> wrote:
>> I had downloaded and was experimenting with a simple Happstack based
>> pastebin a while ago, and was making reasonable progress in figuring out
>> Happstack and how to go about handling various situations. I hadn't touched
>> the code in a while and decided I wanted to eperiment with it last night, so
>> I made a few tweaks and attempted to re-compile it. Now, I'm finding that
>> neither my modified version, nor the original version I downloaded will
>> compile, as they complain about not being able to find an instance of
>> MonadIO for (ServerPartT IO). I also tried writing up a trivial server based
>> on the documentation provided by Happstack itself, and that also fails to
>> compile complaining about no instance found for MonadIO (ServerPartT IO).
>> Specifically the error seems to be triggered by the use of liftIO anywhere
>> inside a ServerPartT monad.
>> Looking at the source code for happstack-server, I can see in
>> Happstack.Server.SimpleHTTP that the GeneralizedNewtypeDeriving pragma is
>> set, and that in the newtype for ServerPartT it has deriving MonadIO. Why
>> can't ghc seem to find the MonadIO instance for ServerPartT, when
>> ServerPartT is declared as deriving it?
>> It also seems strange that this just started happening recently. I've
>> upgraded a number of packages recently, but I can't say for sure what I
>> changed since the last time I was able to compile something based on
>> happstack successfully. Is it possible that some change with mtl or some
>> other package is causing this error?
>> Near as I can tell, this is occurring in happstack-server-0.4.1, although
>> since I'm away from my personal computer right now I can't provide the
>> versions for any of the other packages. If anyone would like further details
>> I can provide them late tonight when I get home, but till then the best I
>> can do is provide the source of one of the programs I attempted to compile
>> (hosted interestingly enough by a later build of the same code):
>> -R. Kyle Murphy
>> Curiosity was framed, Ignorance killed the cat.
>> web-devel mailing list
>> web-devel at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the web-devel