01:42:05 <rlpowell> ByronJohnson / donri : Sorry, stuff comes up with babies.  )
01:42:10 <rlpowell> I think I followed that, basically.
01:42:14 <donri> \o/
01:43:43 <rlpowell> I think the only part that confuses me is the role/use of nestURL.
01:44:09 <rlpowell> But then the ControlV video is *everything* I know about web-routes so far.  Ishould read the crash course section on it and retry, huh?
01:44:16 <rlpowell> 31-11:12 < ByronJohnso> (testTemplate is specialized to testTemplate :: String -> H.Html ->
01:44:19 <rlpowell>                         H.Html -> FoundationT' AuthProfileURL CtrlVState () IO Response .  the
01:45:10 <rlpowell> -___- Sorry, ignore that.
01:45:22 <rlpowell> Other things I'd like to know:
01:45:35 <donri> reading crash course is always good, but i don't think it brings up nestURL at all
01:45:47 <rlpowell>  31-11:04 < ByronJohnso> Right.ISo the monad that handleAuthProfile uses for the template argument is also the same monad in which it returns a response. -- that was the key for me; how did you figure... Aaaah, I see it.
01:45:55 <rlpowell> I didn't bother to look at the "m" in the type signature.
01:46:03 <donri> but basically, it does exactly what you need in this case :) if you're wrapping another Route type like you are with U_AuthProfile
01:46:38 <rlpowell> *nod*
01:46:51 <rlpowell> I am likely to understand that when I've read that part of the crash course, yes?
01:47:25 <donri> it takes a function from the other route type to yours (url2 -> url1), which you might wonder WTF that could possibly be but it is simply the U_AuthProfile constructor, which takes an argument of the other type and returns one of your route type
01:49:08 <donri> you'll probably have a better chance to understand web-routes if you read its tutorial, yes ;)
01:49:26 <rlpowell> OK, hold on, I thought I understood something but I don't, sec.
01:49:49 <rlpowell> (Man, this "actually undertanding things" thing is so weird)
01:50:02 <rlpowell> (so atypical for me; normally given a solution I'd just move on)
01:50:13 <rlpowell> 31-10:12 <       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 ...,  -- OK, so: Where did AuthProfileURL come in?
01:50:23 <rlpowell> The return type of handleAuthProfile is CtrlV Response.
01:51:09 <rlpowell> or, if not, I don't get how not.
01:51:28 <donri> nope, it is actually "m Response" with the constraint "URL m ~ ProfileURL"
01:51:52 <rlpowell> But the m is constraned to be the m in the "m Response" return of testTemplate.
01:51:56 <rlpowell> Which is CtrlV, no?
01:52:07 <donri> ~ is an equality constraint so it says that "the URL type for this 'm' should be ProfileURL"
01:52:17 <rlpowell> IOW, this: 31-09:58 <       donri> URL m ~ AuthProfileURL, that's an equality constraint that says your "URL" type must be AuthProfileURL, but it is in fact Route
01:52:41 <rlpowell> Too many nested types.  -___-
01:52:42 <donri> yea, that's why you got those type errors
01:52:56 <donri> that's what nestURL fixes
01:53:29 <donri> it takes a "FoundationT AuthProfileURL ..." and uses U_AuthProfile to make it a "FoundationT Route ..." aka a "CtrlV"
01:53:37 <donri> (in this particular case)
01:54:09 <rlpowell> Gah.
01:54:12 <rlpowell> OK, sorry, but.
01:54:23 <rlpowell> I'm looking here: 31-09:58 <       donri> URL m ~ AuthProfileURL, that's an equality constraint that says your
01:54:26 <rlpowell>                         "URL" type must be AuthProfileURL, but it is in fact Route
01:54:36 <donri> this isn't really beginner level haskell (type families and equality constraints and monad transformers, oh my) so it's understandable if you don't fully understand it
01:56:32 <rlpowell> Sorry, mi net keeps dropping.
01:56:44 <rlpowell> donri: Yeah, I know, but I'd like to get closer than I am.
01:57:36 <donri> oh yea AuthProfileURL not ProfileURL, i wrongly copied from handleProfile
01:57:46 <rlpowell> So, I'm looking at http://hackage.haskell.org/packages/archive/happstack-authenticate/0.9.4/doc/html/src/Happstack-Auth-Blaze-Templates.html#handleAuthProfile
01:57:57 <rlpowell> And it's got "-> (String -> Html -> Html -> m Response)"
01:58:06 <rlpowell> Now, the m there is the m from testTemplate.
01:58:20 <rlpowell> WHich is CtrlV.
01:58:30 <donri> the "m" in that whole type signature is the same m for the whole type
01:59:01 <rlpowell> Hmm.
01:59:02 <donri> yes, byron discovered that you also need to change the type for testTemplate
01:59:08 <rlpowell> Yes, I know.
01:59:14 <rlpowell> That's my question: why doesn't it erro out *there*?
01:59:30 <donri> oh :) because ghc isn't strong AI ;)
01:59:30 <rlpowell> "your testTemplate doesn't match the AuthProfileURL constraint, asshole".
01:59:33 <rlpowell> Or whatever.
01:59:40 <donri> type inference is tricky biznaz
01:59:53 <rlpowell> Ah, Ok.  So I *am* in fact looking at a weird error message, even when ou understand what's going on.
02:00:10 <donri> yes
02:00:14 <rlpowell> THat is: the error message is not the one we'd want if the world was perfect, it doesn't actually talk about the real problem.
02:00:25 <rlpowell> Fantastic.  OK, one last thing.
02:01:01 <rlpowell> I take "URL m ~ blah" to mean "the URL part of this ridiculously insane monad stack should be this type here"; is that *loosley* correct?
02:01:24 <donri> yep
02:01:38 <rlpowell> OK, so given that, where *TF* does CtrlV have *any* URL anything in it?
02:01:53 <donri> in RouteT x m a, URL m ~ x
02:02:39 <donri> FoundationT is actually a type synonym with RouteT in the outermost monad layer
02:02:50 <rlpowell> Aaaaah.
02:02:59 <rlpowell> I can't findou FoundationT; I bet that means it's in ...
02:03:02 <rlpowell> *facepalm*
02:03:02 <donri> so "URL" gets defined because you pass "Route" to "FoundationT" when you define your CtrlV type
02:03:07 <rlpowell> happ-stack-*foundation*
02:03:11 <donri> :)
02:03:20 <rlpowell> (I only just noticed that it sas "foundation" in the name)
02:03:29 <donri> heh
02:04:00 <rlpowell> OK, I lied, I have two more questions:
02:04:10 <donri> shoot
02:04:26 <rlpowell> So there's: 31-11:12 < ByronJohnso> (testTemplate is specialized to testTemplate :: String -> H.Html -> H.Html -> FoundationT' AuthProfileURL CtrlVState () IO Response .
02:04:42 <rlpowell> And you've said other stuff that makes me think that y'all have some way of seeing derived types for things that I don't.
02:04:45 <rlpowell> What are you using?
02:05:02 <rlpowell> And if it involves emacs, can you suggest alternatives?  -___-
02:05:18 <donri> we're not, you can figure that out from the types
02:05:47 <donri> but you could comment out the type signature for testTemplate, load it up in ghci with :load file.hs, and inspect it with :t testTemplate
02:05:55 <rlpowell> *Bah*.  Why does hoogle not know XMLGenT ?
02:05:59 <rlpowell> donri: Oh, nice.
02:06:27 <donri> online hoogle only indexes some haskell-platform stuff and such
02:06:35 <donri> hayoo indexes all of hackage
02:07:00 <donri> rlpowell: https://github.com/eagletmt/ghcmod-vim is also nice
02:07:15 <rlpowell> Aaah, whoops (hayoo vs hoogle
02:07:36 <donri> sadly hoogle has better type searching than hayoo
02:08:00 <donri> you can also use hoogle offline on the CLI but i haven't been able to get it to index anything other than the default (same as online one)
02:08:43 <donri> (whenever we figure that out the plan is to run a hoogle instance for happstack related packages on happstack.com, should include XMLGenT)
02:10:40 <donri> btw: darcs get --lazy darcs get http://patch-tag.com/r/mae/happstack   # if you want the happstack-foundation/CtrlV sources offline
02:10:47 <donri> argh
02:11:02 <donri> darcs get --lazy http://patch-tag.com/r/mae/happstack
02:36:40 <rlpowell> Thanks.
02:36:47 <rlpowell> (again, babies came up :)
02:37:15 <rlpowell> donri / ByronJohnson : OK, last thing: is there any special pointers you might give about how to debug this sort of weird error message in the wrong place.
02:38:09 <rlpowell> ?
02:38:33 <rlpowell> Or is it just "Try to grok the type stack, look for weird/complicated edge casey sort of stuff"?
02:39:06 <donri> hm, "follow the types" i guess. this one was particularly hairy though. but it is possible to figure out from the type of handleAuthProfile that it's not compatible with CtrlV
02:39:41 <rlpowell> *nod*
02:39:45 <rlpowell> OK, great.  THank you!
02:39:54 <donri> you got two type errors right, and at least one was pointing at the right thing
02:40:07 <rlpowell> As a general side comment, I have this itchy feeling that there's an abstraction missing here.
02:40:30 <rlpowell> Like, if good Haskell programmers advocate constructing these giant stacks, and this is the best we can handle such stacks, and we're generating error messages like that ...
02:40:49 <rlpowell> It just feels like something needs to be abstracted out of type-stacks-in-general, somehow.
02:41:09 <rlpowell> Not that I, personally, have the *slightest* idea what that might be, of course.
02:46:06 <rlpowell> Main.hs:322:5:     No instance for (FilterMonad Response m)       arising from a use of `ok' -- *sigh* :)
02:47:28 <donri> what type did you give it
03:07:41 <donri> gotta go to bed
04:40:24 <ByronJohnson> rlpowell: Lots of backlog.  Is there anythin gyou still want me to read?
04:40:51 <ByronJohnson> < rlpowell> I think I followed that, basically. — Yay. =)
04:41:26 <rlpowell> ByronJohnson: Only the last question where I named you.
04:41:32 <rlpowell> About 15 lines up.
04:43:13 <ByronJohnson> < rlpowell> donri / ByronJohnson : OK, last thing: is there any special pointers you might give about how to debug this sort of weird error message in the wrong place. — Unfortunately, I'm not aware of any useful tools for that besides ghc{,i}
04:43:34 <ByronJohnson> It probabyl wouldn't be very difficult to write one using the library that ghc provides, though, I expect
04:45:13 <ByronJohnson> I'm usually able to fix such errors with just vim/ghc/ghci
04:46:04 <ByronJohnson> A few workarounds to find the type of an expression or top-level declaration include ghci's :t, using -Wall without a type signature (ghc{,i} will emit a warning), and writing a deliberately conflicting explicit type signature for an arbitrary expression that you want to find the type of.
04:46:43 <ByronJohnson> Not very elegant solutions, but they usually work.
04:46:55 <rlpowell> Thanks!
05:11:01 <rlpowell> ByronJohnson: You have time/inclination to help me out further?
05:11:11 <rlpowell> Different issue, but very similar.
05:13:56 <ByronJohnson> After a few minutes, sure
05:15:50 <ByronJohnson> rlpowell: What's your problem?
05:17:08 <rlpowell> Well, what I'm trying to do is get happstack-authenticate working with happstack-foundation.
05:18:10 <rlpowell> I can find you the whole code if you don't already know where it is, but I'm working with demo-hsp in happstack-authenticate, and the key part appears to be: http://pastie.org/private/jufa3m2jmm1rqrelmphgya
05:18:29 <rlpowell> THe code from before was me trying to make things work with a hand-rolled template, but now I'm trying to use my HSP-based appTemplate instead.
05:18:33 <rlpowell> it's ... going poorly.  :)
06:02:51 <rlpowell> Ugh this is so frustrating.  ;'(
06:44:18 <rlpowell> Aaah, I think I see the problem.
06:45:00 <rlpowell> http://hackage.haskell.org/packages/archive/happstack-authenticate/0.9.2/doc/html/src/Happstack-Auth-Blaze-Templates.html -- authProfileHandler wants something that uses Blaze Html, but I'm trying to pass HSP.  Which essentially means making a whole interop library, I guess.
06:46:34 <rlpowell> But *not* doing that means I have to have two templates.
06:46:42 <rlpowell> Or fix happstack-authenticate, I suppose.
06:48:45 <rlpowell> Or I could give up on that particular aspect of things and move on.  :)
07:17:54 <rlpowell> No, that's not right either.  *Dammit*.
07:18:29 <rlpowell> ByronJohnson / whoever: The code is now at http://fpaste.org/oCwx/raw/
07:18:49 <rlpowell> If you comment out: appTemplate' t h b = liftM toResponse (extraAppTemplate t h b)
07:18:57 <rlpowell> And uncomment the line belowe it: -- appTemplate' t h b = liftM toResponse (HTML.defaultTemplate t h b)
07:19:00 <rlpowell> everything works fine.
07:19:06 <rlpowell> But then I'm using a super-generic template.
07:19:12 <rlpowell> I want to use my real HSP template.
07:19:54 <rlpowell> Something's wrong such that using web routes as attrs works in other places, but not in there.
07:20:01 <rlpowell> ACTION should really go to bed now.
07:20:19 <ByronJohnson> < rlpowell> THe code from before — It took me a while to realize that you were refrring tot he pastebin you made afew hours ago
07:20:49 <ByronJohnson> I accidentally broke my cabal installation by reinstalling some packages, which I've been doing for a while now
07:21:07 <ByronJohnson> Accorrding to the comments, you should be able to embed blaze's html in your hsp templates
07:21:10 <ByronJohnson> -- the key to using happstack-authenticate with HSP is simple. First
07:21:13 <ByronJohnson> -- you need to be able to embed Html in your HSP monad like this:
07:21:15 <ByronJohnson> instance (Functor m, Monad m) => EmbedAsChild (RouteT url m) Html where asChild html = asChild (CDATA False (renderHtml html))
07:22:53 <rlpowell> 01-00:23 < ByronJohnso> I accidentally broke my cabal installation by reinstalling some packages, which I've been doing for a while now -- I repeat my reccomendation for virthualenv
07:23:10 <rlpowell> ByronJohnson: Yes, I know about that; the code I just pasted uses that.
07:23:22 <rlpowell> I see part of the problem; it's falling through this instance: 01-00:23 < ByronJohnso> I accidentally broke my cabal installation by reinstalling some
07:23:25 <rlpowell> Erm.
07:23:42 <rlpowell> I see part of the problem; it's falling through this instance:  instance (Functor m, Monad m) => EmbedAsAttr (RouteT url m) (Attr String url) where
07:23:47 <rlpowell> because the two url's don't match.
07:24:32 <ByronJohnson> If you don't mind, I'd like to continue tryin gto fix cabal tomorrow
07:24:53 <rlpowell> Sure, it'll give me an excuse to go to bed. :P
07:25:03 <rlpowell> Promise me you'll look at virthualenv , though?
07:25:12 <rlpowell> It's helped me a great deal with cabal bullshit.
07:26:20 <rlpowell> OK, bed time, srsly.
07:26:26 <rlpowell> ByronJohnson: Thanks for the help.
07:26:42 <rlpowell> ByronJohnson: http://hackage.haskell.org/package/virthualenv
07:26:59 <ByronJohnson> < rlpowell> Promise me you'll look at virthualenv , though? — Yes.  I can't guarantee I'll have time or any of this tomorrow, though.
07:27:07 <rlpowell> *nod*
07:27:31 <ByronJohnson> ACTION sipna
15:12:03 <Igloo> Lemmih: Is there a doc somewhere explaining the advantage of acid-state over using a database?
15:12:17 <Igloo> s/advantage/advantages/
15:14:12 <Lemmih> Igloo: Nothing beyond acid-state.seize.it, I believe.
15:14:36 <Igloo> OK, ta
15:14:48 <Igloo> ACTION is finding the 5 minute restart time quite a big disadvantage
15:15:32 <mightybyte> Igloo: Memory consumption has been a problem for me in the past.
15:16:16 <Igloo> Mmm, good point
15:17:42 <Igloo> Querying acid-state is always done in IO, right? So it shouldn't require any significant refactoring to switch to a database-backed approach
15:20:43 <mightybyte> Yeah, I think so.
15:33:12 <Igloo> Lemmih: Oh, one other question: Am I right in thinking that if one process has an acid-state open, then it is not safe to open it from another process as well?
17:51:57 <rlpowell> \_o_/
18:17:37 <donri> rlpowell: have you looked at this http://src.seereason.com/happstack-authenticate/demo-hsp/
18:17:39 <donri> (i haven't)
18:19:37 <donri> Igloo: yes, don't open the same state twice
18:19:47 <donri> i think recent acid-state introduced some file locking
18:42:55 <rlpowell> donri: That's what I was using.
18:43:23 <rlpowell> donri: It uses a template, but an extremely basic one; using the app's own template, which has its own HSP and web-routes stuff, is quite hard.
18:43:26 <rlpowell> But I've got it.
18:43:44 <rlpowell> THe issue is that the Auth stuff has the template in a stack with "URL AuthProfileURL".
18:43:56 <rlpowell> But the app's template has routes in "URL Route", or whatever.
18:44:30 <rlpowell> afk.