--- Log opened Fri Sep 25 00:00:51 2009
07:39 < McManiaC> hey, is there a way to use IO actions in FromData instance definitions?
07:40 < mightybyte> Hmmmm, not that I know of.
07:40 < McManiaC>  do
07:40 < McManiaC> http://ix.io/k3/hs
07:40 < McManiaC> something like this :S
07:41 < McManiaC> its obviously not working
07:41 < McManiaC> ^^
07:41 < mightybyte> Don't think so.
07:42 < McManiaC> k...
07:42 < mightybyte> type RqData a = ReaderT ([(String,Input)], [(String,Cookie)]) Maybe a
07:42 < mightybyte> That type pretty much precludes IO.
07:42 < McManiaC> yeh
07:42 < McManiaC> you would have to lift IO into the maybe monad...
07:42 < McManiaC> ^^
07:42 < burp> now     <- liftIO getClockTime <- you need it therefore?
07:42 < burp> sometimes a wise unsafePerformIO is ok ;)
07:43 < McManiaC> hm
07:44 < mightybyte> And I don't know of a MonadIO instance for Maybe
07:44 < McManiaC> there isnt
07:44 < mightybyte> ...or ReaderT
07:45 < McManiaC> ive been trying to write my own last night, but it obviously isnt possible either
07:45 < McManiaC> ;)
07:45 < mightybyte> Yeah
07:46 < mightybyte> Oh never mind, there is one for ReaderT
07:46 < mightybyte> But only if the underlying m is also a MonadIO
07:47 < mightybyte> Yeah, I'm pretty sure it can't be done given the current type signature of FromData
07:50 < thaldyron> I'm trying to understand the serialization of events in happstack-state: When you update your state with an 'put mystate' in an Update MyState () action, what is actually being written to the event log?
07:51 < mightybyte> It looks like all the people I know of who would know the answer to that question are not in the channel at the moment.
07:53 < thaldyron> mightybyte: no problem, I'll ask later then!
07:53 < mightybyte> You also might try the mailing list.
07:53 < McManiaC> http://ix.io/k4/hs my first happstack app, almost done
07:53 < McManiaC> love it :)
07:54 < mightybyte> It might be nice to have the answer to that question archived and easily retrievable for general reference.
07:55 < mightybyte> McManiaC: I'd get rid of the unsafePerformIO
07:56 < mightybyte> McManiaC: I use a function withTime :: (StorableDate -> ServerPart a) -> ServerPart a
07:57 < McManiaC> huh? how?
07:58 < mightybyte> And I don't use FromData instances for data types that need time.
07:59 < thaldyron> mightybyte: ok I probably will do that later on, is it a FAQ?
08:00 < mightybyte> No
08:00 < mightybyte> It just doesn't seem like a good enough reason to use unsafePerformIO to me.
09:26 < McManiaC> hmmm
09:26 < McManiaC> i have this "newtype ID = ID String" definition in my State.hs
09:27 < mightybyte> Yeah
09:27 < McManiaC> now i want to define a "postHandler :: ServerPartT IO ID"
09:28 < McManiaC> and want to use it like this "return . toResponse . ( "http://n-sch.de/" ++).(++ "\n" ) =<< postHandler"
09:28 < McManiaC> error here is "Couldn't match expected type `[Char]' against inferred type `ID'"
09:28 < McManiaC> so i did sth like (\(ID id) -> return . ...) =<< postHandler
09:29 < McManiaC> with a show id
09:29 < mightybyte> You might want to make these changes
09:30 < mightybyte> newtype ID = ID {unId :: String}
09:30 < McManiaC> ok
09:31 < mightybyte> And then use ID . ("http://n-sch.de/"++) . (++ "\n") . unId
09:31 < McManiaC> ah now i get that message again i was looking for:
09:32 < McManiaC> http://ix.io/k5
09:32 < McManiaC> oh wait hmmm
09:33 < McManiaC> forget it :) thx for helping tho
09:33 < mightybyte> Sure
09:53 < McManiaC> mkUsageInfo: internal name? ID{tc a28A}
09:53 < McManiaC> whats that message about (on starting up happstack) ?
09:54 < mightybyte> I've never seen that before.  But I would guess you shouldn't use "ID" as your newtype because it conflicts with something else.
10:23 < McManiaC> hm its with all my other data definitions the same tho
10:28 < mightybyte> Oh, actually...I get that error all the time.
10:28 < mightybyte> Well, it's not an error.
10:28 < mightybyte> My experience has been that it's harmless.
10:29 < McManiaC> ok
10:29 < mightybyte> So I just stopped paying attention to it.
13:29 < McManiaC> anyone using lighttpd with happstack here?
13:30 < McManiaC> how can i tell lighttpd to use port xy instead of 80 for a given "HOST" variable?
13:30 < McManiaC> so i can use "foo.bar.com" instead of "foo.bar.com:8000" ?
17:01 < aavogt> McManiaC: did you figure it out? I use an entry like: $HTTP["host"] == "some.hostname.tld" { proxy.server = ( "" => ( ("host" => "127.0.0.1", "port" => 5001) ) ) }
17:01 < McManiaC> jup thx :)
17:02 < McManiaC> already running on http://paste.n-sch.de
17:02 < McManiaC> http://paste.n-sch.de/4 :D
17:02 < McManiaC> just with "curl -F "content=<-" paste.n-sch.de:8000" i need the extra port...
20:06 < TomMD> mightybyte: ping!
20:07 < TomMD> @seen mightybyte
20:07 < lambdabot> Unknown command, try @list
20:31 < McManiaC> hmmm how do you use "look" inside a "ServerPartT IO Response" ?
20:36 < burp> you use look inside RqData monad
20:36 < burp> which is (ReaderT)
20:36 < burp> http://hackage.haskell.org/packages/archive/happstack-server/0.3.3/doc/html/Happstack-Server-SimpleHTTP.html#7
20:36 < burp> see getData(Fn)
20:37 < McManiaC> hmmm
20:38 < McManiaC> ah okay
21:55 < McManiaC> hmm
21:56 < McManiaC> if i use "seeOther "myurl" (toResponse "")" my browser will prompt something like "You have been redirected to. Click the link to follow it."
21:56 < McManiaC> why is there no information on the url?
--- Log closed Sat Sep 26 00:00:52 2009