00:17:55 <luite> hmm, happstack.com images don't load, and all links redirect to seereason
00:20:43 <donri> oh dear that's majorly broken
00:21:28 <donri> and stepcut is off partying :)
00:22:41 <luite> hehe doesn't anyone have his phone number? perhaps he can ssh in to restart it
00:25:17 <donri> cute new google groups
00:25:49 <luite> when it works :)
00:26:11 <luite> I've had lots of errors when moderating messages on the yesod list
00:26:24 <luite> seems better now though
00:26:49 <donri> aha
00:43:03 <luite> whoah it's service temporarily unavailable now :(
00:50:13 <donri> progress? :P
01:07:56 <luite> it'sa back!
01:17:16 <donri> yay!
01:18:28 <donri> and it brings fixes
09:11:06 <LambdaDusk> hi... 1) is there some sort of recommended directory structure for an happstack project and 2) any example with serving static sites?
09:32:19 <stepcut> LambdaDusk: I am working on a recommended directory structure.. but I don't have any thing concrete yet.. I keep fiddling with things :) For a static site.. do you mean a bunch of .html files? That could be done pretty easily with serveDirectory...
09:50:31 <LambdaDusk> stepcut: I want my happstack app to be API only and the actual app is a Sammy.js one
09:51:31 <LambdaDusk> stepcut: So I'd need to serve .js and html files ^^
11:06:42 <LambdaDusk> Also, is there a way to make subdomains with happstack
18:01:51 <hpaste> LambdaDusk pasted “Static server trial” at http://hpaste.org/66298
18:02:33 <LambdaDusk> so I want to make my routes that if they are not matched, the fallback is looking for the path in the folder './static'... I've tried it in the hpaste mentioned above, but I when I try to get to the route localhost/verify, it tells me "file not found"
18:30:34 <LambdaDusk> ok, my bad, it works, envermind
18:36:50 <parcs`> LambdaDusk: you can make subdomains with the 'host' method: http://www.happstack.com/docs/happstack-server-7.0.0/doc/html/happstack-server/Happstack-Server-Routing.html#v:host
18:37:19 <LambdaDusk> parcs`: Which is fitting to a question I was just about to ask... weird
18:39:06 <parcs`> ACTION is a mind reader
18:49:03 <LambdaDusk> parcs`: Does it require the full host name or just the subdomain
18:53:54 <parcs`> full host name i believe
18:56:32 <LambdaDusk> it does not work...
18:56:39 <LambdaDusk> I'll try using the host, then
19:02:21 <donri> lambdabot: tell tempire :HPaste should be fixed in vim2hs now
19:02:29 <donri> @tell tempire :HPaste should be fixed in vim2hs now
19:02:29 <lambdabot> Consider it noted.
19:33:32 <LambdaDusk> Spend 2 hours trying to find an error => Notice the actual problem is a spelling error in the paths
19:44:20 <stepkut> Request rate: 189882.2 req/s (0.0 ms/req)
19:44:24 <stepkut> :p
19:45:04 <parcs`> is that happstack?
19:45:22 <stepkut> not yet :)
19:45:32 <stepkut> it is some test code I wrote
19:46:37 <stepkut> a very fast, but impractical web server
19:55:52 <donri> that's insane
19:56:02 <donri> isn't warp like 80k rqs?
19:56:21 <donri> or was it 40...
19:57:26 <parcs`> g-wan is 750k req/s :)
19:57:47 <donri> g-wan?
19:57:50 <stepkut> donri: I think around 80k on my machine
19:58:45 <donri> anyway you say warp is fast because not using a real parser. i think i prefer the robustness/correctness of proper parsing, over insane performance. but perhaps grammar testing to the rescue?
19:59:25 <parcs`> donri: some super fast closed-source web server http://gwan.ch/benchmark
19:59:32 <stepkut> donri: using a real parser does not guarantee correctness either
19:59:32 <stepkut>  
20:00:17 <donri> of course
20:01:01 <LambdaDusk> is there some sort of dev-server for happstack so I don't have to restart manually?
20:01:11 <donri> LambdaDusk: happstack-plugins
20:01:56 <LambdaDusk> donri: Hackage doesn't have their docs, you have any tutorial on them?
20:03:01 <stepkut> LambdaDusk: http://happstack.blogspot.com/2010/10/recompile-your-haskell-based-templates.html
20:04:15 <LambdaDusk> stepkut: Hm but I don't have any templates in the app, only JSON responses
20:04:41 <stepkut> LambdaDusk: that tutorial is out of date anyway
20:04:43 <stepkut> one moment
20:05:12 <stepkut> you can just use plugins-auto, http://hackage.haskell.org/package/plugins-auto-0.0.1
20:05:41 <stepkut> and put your top-level handler inside the $(withMonadIO ) I think
20:05:52 <stepkut> hmm
20:05:57 <stepkut> one moment
20:13:26 <hpaste> stepcut pasted “happstack-plugins example” at http://hpaste.org/66301
20:13:56 <stepkut> so, you can make a small Main.hs and then just put a happstack-plugins wrapper around your top-level route
20:14:06 <stepkut> that route has to be import from another file
20:14:24 <stepkut> but, once you do that, it should automatically recompile and reload anytime you save a file in the project
20:14:50 <stepkut> you can get a working versions of plugins from, darcs get http://src.seereason.com/plugins/
20:15:11 <stepkut> as much as plugins works anyway
20:15:31 <stepkut> someone needs to get really excited about working on plugins
20:15:47 <LambdaDusk> stepkut: Thank you
20:20:19 <LambdaDusk> a shame plugins won't compile
20:24:24 <stepkut> LambdaDusk: http://www.haskell.org/pipermail/libraries/2012-March/017686.html
20:25:03 <LambdaDusk> stepkut: Well, thanks. I will look into it
20:25:39 <donri> ACTION just added support for pointfree to vim2hs; this could be dangerous. :D
20:27:44 <stepcut> LambdaDusk: for sub-domains check out host and withHost, http://www.happstack.com/docs/happstack-server-7.0.0/doc/html/happstack-server/Happstack-Server-Routing.html#g:4
20:27:55 <luite> what is vim2hs?
20:29:29 <donri> luite: https://github.com/dag/vim2hs
20:29:38 <donri> beta / not yet announced
20:30:23 <luite> ah
20:31:17 <luite> not terribly useful for me though :p
20:31:27 <donri> because?
20:31:45 <donri> i assumed from your asking what it is that you're using vim
20:32:09 <luite> hehe no i usually use emacs
20:32:36 <donri> yea, getting vim2hs to run in emacs should be hard
20:32:57 <luite> hehe wel,, I guess you could open some kind of shell buffer and run vim in that :)
20:33:07 <donri> :D
20:33:43 <luite> my emacs config has bitrotted a bit though, don't have functioning type information or compiler messages atm
20:34:01 <donri> ghc-mod?
20:34:39 <donri> chrisdone had some cool stuff for emacs... though he deleted the repo? looks like he's working on haskellmode now
20:34:44 <luite> yeha I had that at one point, but atm only highlighting and indenting from haskell-mode
20:35:01 <luite> right, I think he's still working on that stuff :)
20:35:32 <luite> and i'm working on webbased type hints and error reporting etc
21:22:12 <LambdaDusk> is it better to open a connection to the database when the server starts to open and close them per request?
21:27:23 <Lemmih> The best thing to do is to use AcidState. (:
21:34:15 <LambdaDusk> :(
21:35:14 <donri> LambdaDusk: what database?
21:36:03 <donri> it sort of depends on if the db handle is thread safe, i guess. acid-state is.
21:37:17 <stepcut> I pretty much only know how to use acid-state, so..
21:37:38 <stepcut> I know that there are somethings threading issues, and that sometimes people use connection pools
21:41:34 <donri> i wonder if the remote backend needs connection pooling (or it already does?)
21:45:59 <LambdaDusk> donri: The MongoDB docs say they are thread safe
21:48:11 <donri> LambdaDusk: does it do pooling?
21:48:36 <LambdaDusk> donri: It does export some Pool modules but I can't see where and how they're used
21:49:27 <stepcut> if you can open the database once at the top of the application, and the pass it to your route handler, and that works.. then do that :)
21:49:58 <donri> LambdaDusk: docs not mentioning if that's done for you?
21:50:11 <stepcut> I have no idea if it will work or not. Each request will get a copy of that handle. Which works fine for acid-state. Might work fine for mongodb as well.
21:50:21 <LambdaDusk> donri: If so, I can't find it
21:50:50 <donri> if it is thread-safe, that should work until the connection fails. if it does pooling, connections might be less prone to fail.
21:51:17 <donri> connecting for each request is probably slower than reusing connections
21:51:33 <LambdaDusk> donri: What is your suggestion?
21:52:03 <donri> i say connect at start and assume that'll work fine :)
21:52:18 <donri> if it becomes an issue, worry about it *then*? :)
21:55:10 <donri> also: "how i learned to stop worrying and love acid-state"
22:01:08 <LambdaDusk> so you mean that acid-state can replace mongo...?
22:04:11 <LambdaDusk> I mean, does acid-state only store things in memory or actually safe it in a persistent manner
22:04:30 <LambdaDusk> I thought it was like STM
22:05:10 <donri> it is kept in memory but transactions are logged to disk and replayed at restart
22:06:16 <LambdaDusk> donri: So it can't replace a database because it would use more and more RAM?
22:06:33 <donri> if you can't fit your data in RAM that's an issue yes
22:06:39 <donri> at least for now
22:07:46 <LambdaDusk> donri: My VPS has very limited RAM
22:08:18 <donri> ah
22:11:42 <stepcut> acid-state is most similar to redis (but more awesome)
22:11:58 <stepcut> and pre-dates redis as well
22:13:00 <donri> + transactional. not sure redis is?
22:15:14 <stepcut> no idea..
22:16:08 <donri> i think it has some way to do atomic updates but transactions are not logged. but not sure.
22:18:11 <LambdaDusk> redis has two engines working, but I don't think it's transactional
22:18:24 <LambdaDusk> they explicitely warn about losing data
22:18:50 <LambdaDusk> http://redis.io/topics/persistence
22:21:32 <LambdaDusk> anyway, time for bed
22:55:35 <user317> anyone know what the order is of (==) for IxSet?
22:59:57 <stepkut> order ?
23:01:35 <stepkut> the Eq (IxSet a) instance pulls out Map that holds the first index, and does a compare on those maps
23:11:09 <user317> so does it first check if the sets of keys are equal?
23:11:46 <user317> just currous, if i have two sets with a difference of one key
23:11:59 <user317> what would be the performance
23:12:07 <user317> i suppose i can just write my own for my problem )
23:15:48 <stepkut> it would do whatever Data.Map does
23:17:25 <stepkut> instance (Eq k,Eq a) => Eq (Map k a) where
23:17:25 <stepkut>   t1 == t2  = (size t1 == size t2) && (toAscList t1 == toAscList t2)