16:28:54 <rlpowell> OK, this shit is *WACKY*. 16:29:20 <rlpowell> I'm trying to get happstack-authenticate working with stepcut's ControlV example. 16:29:31 <rlpowell> And ... just this error is *bizarre*. Pasting, sec. 16:30:13 <rlpowell> OK, here's my code, all in one place for ease of toying around: http://fpaste.org/RAt3/raw/ 16:31:07 <rlpowell> Here's all of the diffs between it and stepcut's original; ignoring testTemplate and the imports, it's like 3 lines: http://fpaste.org/8w1V/raw/ 16:32:29 <rlpowell> And here's the completely bizarre error: 16:32:30 <rlpowell> http://fpaste.org/3m12/ 16:32:52 <rlpowell> It's all about this line: (U_AuthProfile authProfileURL) -> handleAuthProfile authState profileState testTemplate Nothing Nothing ("test" :: Text) authProfileURL 16:33:01 <rlpowell> With that commented out, everything is fine, the app runs correctly, etc. 16:33:31 <rlpowell> With that line in the route function, I end up with: 16:33:33 <rlpowell> Main.hs:285:29: Couldn't match type `AuthProfileURL' with `Route' 16:34:03 <rlpowell> ^^ that's in newPastePage, which I didn't touch. 16:34:37 <rlpowell> donri: BTW, do you happen to know where stepcut is this weekend? 16:34:44 <rlpowell> Because it just occured to me that he might be at WorldCon too. 16:35:24 <donri> i only know that on aug 23 he mailed the list that "I will be off the grid until Sept 4" 16:35:32 <rlpowell> *nod* 16:35:38 <rlpowell> Well, I guess no way to find him, then. 16:45:05 <tswett> Ahoy. 16:49:09 <tswett> rlpowell: I'm looking at the problem you pasted. 16:50:25 <tswett> So, (ViewPaste pid) has type Route, which means that you need seeOtherURL to take a value of type Route. In fact, seeOtherURL takes a value of type URL m, so that only works if there exists m such that URL m = Route. 16:51:24 <tswett> seeOtherURL returns m Response, and you're stating that it returns CtrlV Response. So you're specifying that m = CtrlV. 16:52:18 <donri> rlpowell: where is the new arguments to "route" coming from? 16:52:27 <tswett> I don't know whether or not URL CtrlV = Route. If it isn't, then your code can't work. 16:53:02 <donri> oh wait i see it, wasn't in the diff 16:53:18 <donri> uhm it is in diff, i'm being stupid -.- 16:55:54 <donri> ok i see one problem 16:56:33 <donri> URL m ~ AuthProfileURL, that's an equality constraint that says your "URL" type must be AuthProfileURL, but it is in fact Route 16:56:55 <donri> in handleAuthProfile 16:58:05 <donri> i think you need to do something with nestURL U_AuthProfile, but it might not be that easy because i think FoundationT newtypes RouteT and nestURL isn't generic to MonadRoute (something planned to be fixed) 16:59:29 <donri> oh, looks like it's not a newtype just a synonym 17:03:03 <hpaste> donri pasted ârlpowell: try thisâ at http://hpaste.org/73993 17:06:54 <donri> nestURL puts the AuthProfileURL handler into your CtrlV' (aka Route) handler and XMLGenT puts the CtrlV' handler into CtrlV. i hope. didn't test. 17:09:59 <donri> the weird error message has to do with type inference. the use of handleAuthProfile made GHC infer that your handler type is FoundationT AuthProfileURL ..., which in turn meant the seeOtherURL call was a type error 17:11:49 <donri> ByronJohnson: aha rlpowell went away and you set up a cabal environment. can you try my fix? 17:26:19 <ByronJohnson> donri: Sure 17:29:06 <ByronJohnson> < donri> URL m ~ AuthProfileURL, that's an equality constraint that says your "URL" type must be AuthProfileURL, but it is in fact Route â Yes, this is the problem 17:29:37 <ByronJohnson> donri's fix almost works; the type of testTemplate just needs to be generalized 17:29:51 <ByronJohnson> testTemplate :: (FilterMonad Response m) => String -> H.Html -> H.Html -> m Response 17:30:51 <donri> is that sufficient? i'd think it needs Happstack m => 17:31:13 <donri> and MonadRoute AuthProfileURL m 17:31:21 <donri> uuh no 17:36:36 <ByronJohnson> Happstack would probably be better, actually, in case anything else is added or changed that would otherwise require adding more contraints 17:43:57 <ByronJohnson> Uhh.. 17:44:44 <ByronJohnson> 'm' is actually only used in the type of the template parameter 17:45:28 <ByronJohnson> Oh, nevermind; it's not. It's part of the response too -_- 17:46:26 <donri> I would think that the "m" in testTemplate needs all the same constraints as in handleAuthProfile since its template argument has a return type of "m Response"? 17:46:35 <donri> are you saying it works with fewer constraints 17:47:24 <donri> oh wait, hm 17:47:39 <donri> i'm being stupid again :) 17:47:40 <ByronJohnson> donri: It'd be more general with fewer constraints? 17:47:50 <donri> ye 17:48:47 <donri> it gets specialized to whatever "m" handleAuthProfile gets specialized too 17:50:23 <donri> it's having a more specific but incompatible type for testTemplate that'd be a type error 18:02:20 <ByronJohnson> Right. So the monad that handleAuthProfile uses for the template argument is also the same monad in which it returns a response. The contraints in handleAuthProfile require the "route" type in the monad (technically, the asstype "URL" of the MonadRoute Class) to be AuthProfileURL, but CtrlV is XMLGenT (RouteT Route â¦), not XMLGenT (RouteT AuthProfileURL â¦). nestURL allows us to convert the 18:02:26 <ByronJohnson> response (what handleAuthProfile returns) from the latter type to the former type, and then we just need to deal with the cumbersome wrapping of XMLGenT. That also changes the type of the template, because the monad needs to be the same. So we generalize the type of testTemplate. 18:03:40 <donri> tldr do we have a working fix for rlpowell? 18:04:51 <ByronJohnson> The appropriate changes, then, are "testTemplate :: (Happstack m) => String -> H.Html -> H.Html -> m Response" and "(U_AuthProfile authProfileURL) -> XMLGenT . nestURL U_AuthProfile $ handleAuthProfile authState profileState testTemplate Nothing Nothing ("test" :: Text) authProfileURL" 18:04:58 <ByronJohnson> So, yes 18:10:23 <ByronJohnson> (testTemplate is specialized to testTemplate :: String -> H.Html -> H.Html -> FoundationT' AuthProfileURL CtrlVState () IO Response . the difference from testTemplate :: â¦ -> CtrlV' Response is just the route type (Route to AuthProfileURL)) 18:12:08 <ByronJohnson> ACTION afk 18:55:36 <zzing> stepcut, how does acidstate handle changes in model? 18:57:27 <mightybyte> stepcut is away until next week 18:58:41 <zzing> :-( 18:58:53 <zzing> That conference he talked about? 18:58:58 <mightybyte> Burning man 18:59:18 <mightybyte> Now would be the perfect time to switch to Snap. :) 18:59:48 <zzing> haha 19:00:51 <zzing> mightybyte, I have a website running in clckwrks right at this very moment. The problem with clckwrks is that it seems really complicated for me to understand precisely what it is doing. Right now I am thinking about a simple data model which my website needs. 20:02:48 <donri> we need to get chanserv ownership of this channel so we can ban mightybyte ;) 20:03:25 <donri> zzing: if by changes in a model you mean migration of data types, that's what safecopy is for which acid-state uses 20:15:04 <zzing> donri, mightybyte can be very helpful :-) 20:15:12 <donri> i was joking :) 20:15:29 <zzing> happs and snap should merge together for great karma! 22:16:18 <rlpowell> 31-10:00 < donri> i think you need to do something with nestURL U_AuthProfile, -- The code I was copying does that; it just errors out differently. I can show you if you like. 22:16:53 <donri> rlpowell: me and byron solved it for you, see recent backlog 22:17:46 <rlpowell> ACTION nods. 22:17:50 <rlpowell> Catching up. Thank you.