00:10:19 <pyro-> i guess its not a full proof way to test it, but based on the output of "strings", my page isnt present in the binary when i use INLINE pragma and -fexpose-all-unfoldings
00:10:29 <pyro-> i wonder what other interesting ghc options there are to play with :D
00:41:18 <pyro-> the filesize of executables reported by du continues growing for sometime after ghc returns :|
10:00:29 <phaazon> hi
10:00:48 <phaazon> I have a page called /upload, it checks the session (cookie) ; if the cookie is not there, it displays a form (login / password). you enter your credentials, and then it redirects to a page called /login ; now, if the cookie is there, it also redirects to the login page, which basically lookup the credentials sha3 hash in DB to check against
10:00:57 <phaazon> but in the first case, the credentials are in post arguments
10:01:02 <phaazon> in the second, just cookie values
10:01:07 <phaazon> how could I unify that?
10:01:12 <phaazon> the single thing I see is to put the cookie values in the post
17:23:33 <donri> why is FilterT a WriterT with SetAppend? how is that different from StateT? hmm i guess StateT permits "Prepend"...
17:29:27 <donri> also why is SetAppend needed at all, isn't set the same as append const?
17:32:16 <donri> no wait that would replace the response completely, not just ignore previous filters (:
17:34:48 <donri> actually i think we can do prepend already using getFilter and setFilter
17:41:27 <donri> then again getFilter requires an m a whereas StateT would work from inside the monad
19:03:07 <donri> pyro-: you probably rather want NOINLINE or no pragma there. INLINE doesn't mean "inline in the executable" it means "inline this code at the call site", which in turn means it doesn't have a top-level name that can be memoized globally
19:04:32 <donri> pyro-: to expand it at compile-time i imagine you need TH. duno if you can get ghc to do it for constant values somehow as an optimization, without TH.
19:05:57 <donri> pyro-: however if you'd be fine with merely having it memoized, ie. expanded at runtime but only the first time (save GC) that's easy to debug with some annotation pragmas and profiling
19:07:36 <donri> pyro-: http://www.haskell.org/ghc/docs/latest/html/users_guide/profiling.html#scc-pragma
19:08:34 <donri> (possibly you can do it with Debug.Trace but i'm not sure how unsafePerformIO interacts with memoization)
19:32:02 <donri> pyro-: after playing a bit with trace it seems top-level non-parametric (aka not functions) values get memoized so if you have like, page = toResponse yourTemplate that should memoize the response in memory and cut out that expense from the equation
19:32:45 <donri> pyro-: ...except Response has those stupid validator functions as fields so that might prevent memoization... warrants more research ;)
19:38:08 <donri> http://lpaste.net/107797
19:39:35 <donri> i suppose it just means calls to rsValidator functions aren't memoized, but the response containing it is
19:40:32 <stepcut> donri: dunno. In future versions that whole stack should be replaced with a Free monad.. or maybe just move to Idris and use the Effects system ;)
19:41:13 <donri> stepcut: reason i was thinking out loud there ;) was i'm pondering monad-classes for happs8
19:41:21 <stepcut> sweet
19:41:47 <stepcut> I'm still work on the new happtack-authenticate stuff and hyperdrive -- haven't gotten to the other stuff yet
19:41:53 <donri> it could simplify the API a lot if instead of stuff like askRq we just have ask, and the types figure it out
19:42:02 <donri> similarly for HasAcidState etc
19:42:28 <donri> might make some code harder to follow though i guess
19:43:05 <donri> if you mix readers etc
19:43:16 <stepcut> yeah
19:44:20 <donri> but i imagine most of the time it's obvious from context? like you don't usually askRq alone, rather you have something like https <- rsSecure <$> ask[Rq]
19:45:11 <donri> which btw means we also get "asks" for free (asks rsSecure) and don't have to duplicate it as "asksRq" which i don't think we currently have
19:45:48 <donri> (plus monad-classes solves the whole exponential instances hell thing)
20:17:35 <stepcut> it is possible to make a lot of things all map to ask and then have it resolve automatically -- but when you screw something up you get a really confusing type error
20:25:28 <donri> if i understood monad-classes correctly, the worst that can happen is a normal type ambiguity error? although not sure what the error looks like if you ask for some type you don't have an environment for...
20:25:49 <donri> in that case it might be something silly like "couldn't match True with False"  :P
20:27:43 <donri> also another reason to have apis such as this would be things like free lens support, although lens uses mtl not monad-classes so you'd still need to port lens or write a separate lib
20:32:25 <donri> technically we can support both but then we might need some lifting for anything using mtl
20:32:46 <donri> and then we still have all the problems with mtl so :P