14:17:05 <HugoDaniel> hi
14:17:13 <Entroacceptor> ho
15:21:40 <donri> bergmark, tazjin : new computer maybe? http://www.webhallen.com/se-sv/hardvara/168261-webhallen_config_d13-0107-2x_e5-2687w-64gb-960gb_ssd-6tb-2x_gtx_690-blu-ray-win8_pro
15:50:13 <HugoDaniel> can i use repa with acid-state ?
15:50:29 <HugoDaniel> and have parallel functions run inside Query ?
15:54:25 <donri> HugoDaniel: don't see why not
16:33:25 <HugoDaniel> and Update ?
17:06:17 <donri> HugoDaniel: don't see why not
17:08:39 <bergmark> donri: najs :)
17:30:04 <donri> bergmark: you ordered one right
17:30:28 <donri> 'twould be folly not to!
18:25:51 <stepcut> HugoDaniel: as long as repa does not require IO you can use it in the update and query events
18:26:11 <stepcut> donri: yeah, a bit like happy -- I need to investigate more
18:27:32 <mm_freak> acid-state + repa makes you unhappy for the same reasons AcidState (Vector a) makes you unhappy
18:29:04 <HugoDaniel> mm_freak: why ? no indexation ?
18:29:43 <mm_freak> HugoDaniel: full new copy for every change
18:30:28 <mm_freak> fine if you update most of the vector anyway, otherwise the parallelization won't help
18:31:00 <HugoDaniel> mm_freak: what should i use then ?
18:31:02 <HugoDaniel> IntMap ?
18:31:51 <mm_freak> HugoDaniel: are you updating most of the array?
18:32:08 <HugoDaniel> sometimes
18:32:35 <mm_freak> how many elements?
18:32:59 <HugoDaniel> i dont have an idea yet
18:33:24 <mm_freak> tens?  thousands?  millions?
18:33:40 <HugoDaniel> thousands
18:34:11 <HugoDaniel> < 1 million
18:35:11 <mm_freak> for the low half of 2^x with 10 <= x < 20, both are fine
18:35:28 <mm_freak> for the upper half only use vector, if your main operation is to update all of it
18:35:49 <mm_freak> or most of it, such that a new copy won't be more expensive than the update
18:37:41 <HugoDaniel> how can i avoid a new copy ?
18:37:58 <HugoDaniel> tree base data types void new copy ?
18:38:15 <HugoDaniel> do they only copy the branches needed for an update ?
18:39:28 <mm_freak> HugoDaniel: yes
18:39:54 <HugoDaniel> cool
18:47:04 <donri> HugoDaniel: O(log n) for 10^6 is, of course, O(6), so don't worry about it.
18:47:50 <HugoDaniel> :D
18:48:08 <mm_freak> where log = logBase 2
18:48:12 <HugoDaniel> isn't log in trees usualy base 2 ?
18:48:14 <mm_freak> but yes, that's common
18:48:45 <HugoDaniel> if its a 10-ary tree
18:57:15 <HugoDaniel> mm_freak: what if i have a small vector of IntMap's and i need to update all the intmaps ?
18:57:27 <HugoDaniel> does this make sense ?
18:59:28 <HugoDaniel> but only a single value in each intmap
18:59:45 <mm_freak> HugoDaniel: it makes sense
18:59:52 <HugoDaniel> this means that all of the vector is going to be copied, right ?
19:00:09 <HugoDaniel> along with all the contents of all the intmaps, these contents are going to be duplicated until gc comes in action, right ?
19:01:24 <mm_freak> the intmaps change as before, only the update path
19:03:06 <mm_freak> the rest is shared
19:03:06 <HugoDaniel> ok
19:03:06 <HugoDaniel> nice
21:16:35 <stepkut> if wonder if the Update monad creates a transaction even if you don't call 'put'
21:19:46 <azathoth991> so is happstack more fun than php mysql?
21:20:09 <stepkut> azathoth991: I think so
21:20:13 <bergmark> most def
21:21:29 <azathoth991> and acidstate is FAST?
21:21:38 <azathoth991> I think acidstate needs a easier to say name
21:21:51 <azathoth991> like whats a mean acid with a short title?
21:21:58 <azathoth991> nitre
21:22:00 <azathoth991> or somthing
21:22:01 <stepkut> azathoth991: LSD?
21:22:06 <azathoth991> greek fire
21:22:06 <bergmark> easier to say than postgresql at least :D
21:22:08 <azathoth991> i dunno
21:22:11 <azathoth991> LOL
21:22:14 <azathoth991> try that
21:22:18 <azathoth991> tru that
21:22:19 <mm_freak> stepkut: yes, it does
21:22:26 <stepkut> mm_freak: shame
21:22:46 <mm_freak> stepkut: obviously, since it can't know whether it's going to put or not without actually running the action
21:22:51 <stepkut> though.. probably not a big deal in practice
21:22:53 <mm_freak> Update s is a monad after all
21:23:13 <stepkut> mm_freak: yeah
21:23:27 <stepkut> I guess it has to write the transaction at the beginning not the end
21:23:33 <mm_freak> if you want something fancier, you have to write an Update arrow =)
21:23:41 <stepkut> perhaps
21:23:59 <stepkut> ACTION ponders
21:24:13 <stepkut> yeah.. it does
21:24:16 <mm_freak> in fact you could probably unify Update and Query to a single arrow
21:24:32 <mm_freak> but it would be a lot uglier than the current solution
21:24:47 <stepkut> \o/
21:25:03 <stepkut> Happstack needs moar arrows!
21:25:41 <mm_freak> stepkut: definitely not =)
21:25:56 <mm_freak> reform could try on an arrow suit
21:26:02 <stepkut> the look* functions would actually be a lot more usable as arrows
21:26:12 <mm_freak> how?
21:27:39 <stepkut> you could specify which field values should be stored in files and which should be in ram and specify quotas for each field value -- and not have to use any tmp files
21:27:59 <mm_freak> you can do that with a monad, too
21:28:13 <stepkut> well.. we don't at the moment, please send a patch ;)
21:28:48 <mm_freak> ah, i think i know what you mean
21:29:01 <mm_freak> well, it's probably easy to write a Look arrow
21:29:09 <stepkut> indeed, I already have
21:29:15 <mm_freak> (PLEASE don't forget to write the Applicative instance)
21:29:19 <stepkut> just haven't committed it, blogged about it, etc
21:29:36 <mm_freak> yeah…  the pass a Loop a b to decodeBody
21:29:40 <mm_freak> then
21:30:09 <stepkut> the decodeBody function itself wolud not be needed anymore
21:30:40 <stepkut> I'll do that blog post next perhaps
21:30:50 <mm_freak> stepkut: sure?  consider this:  a <|> b <|> c, where a, b and c are server parts, each decoding the body
21:30:51 <stepkut> it should be short ;)
21:31:16 <stepkut> mm_freak: hmm
21:31:54 <stepkut> that does require caching to disk
21:33:05 <stepkut> but.. i don't like <|> anyway :)
21:33:10 <mm_freak> perhaps the current approach isn't too bad after all
21:33:16 <mm_freak> why don't you like it?
21:34:41 <stepkut> it just seems weird to always do full backtracking with not try/cut operators
21:34:53 <mm_freak> backtracking?
21:35:09 <mm_freak> (<|>) should be almost free except for a comparison
21:36:18 <stepkut> yeah.. if I have, msum [ do dir "foo" $ mzero ; dir "bar" $ ok "You've got bar!" ]
21:36:37 <stepkut> once dir "foo" has matched.. there is no chance that dir "bar" is going to match.. but the code is going to check anyway..
21:36:55 <mm_freak> that's an implementation error
21:37:11 <mm_freak> in fact it doesn't even make sense to me
21:37:16 <mm_freak> dir "foo" mzero = mzero
21:37:23 <stepkut> indeed
21:37:27 <mm_freak> mzero `mplus` dir "bar" x = dir "bar" x
21:37:45 <stepkut> well.. usually there is other stuff besides just the mzero
21:38:21 <mm_freak> then that's fine…  the point of having (<|>) is compositionality between different web applications
21:38:21 <stepkut> msum [ do dir "foo" $ if someBool then ok "foo" else mzero ; dir "bar" $ ok "br" ]
21:38:52 <mm_freak> yeah, in that case the checking is fine
21:39:06 <mm_freak> consider this:  app1 <|> app2 <|> notFoundPage
21:39:11 <stepkut> checking dir "bar" is still pointless if dir "foo" matched..
21:39:22 <mm_freak> no, it's not
21:39:28 <mm_freak> it's correct to check it
21:39:35 <stepkut> it's pointless
21:39:45 <stepkut> dir "bar" will *never* match if dir "foo" did
21:39:47 <mm_freak> in c1 <|> c2, if c1 turns out to reject, c2 should be able to accept
21:40:10 <stepkut> right.. that is the idea... I'm just not convinced it is a good idea
21:40:20 <mm_freak> it's necessary
21:40:45 <mm_freak> you certainly want (<|>) to be associative and do nothing weird with emptys
21:41:24 <mm_freak> your case can be written as:  (a <|> b) <|> c
21:41:34 <mm_freak> where 'a' corresponds to someBool == True
21:41:52 <mm_freak> and b is empty
21:42:40 <stepkut> it seems to opaque to me.. you have 'a' which works fine and 'b' which works fine, and you compose them and a <|> b works fine, and then one day 'a' starts handling something that 'b' used to handle, but it can't really easily see that and you don't know that they behavior changed or why
21:42:49 <mm_freak> if someBool is true, a always accepts and c is never checked
21:43:04 <mm_freak> c is only checked, when a rejects
21:44:07 <stepkut> but, in most cases where 'a' got a partial match 'c' will always reject
21:44:23 <mm_freak> c doesn't know about a
21:44:39 <stepkut> yes.. that is all part of the problem :)
21:44:52 <mm_freak> c shouldn't be influenced by a
21:45:01 <stepkut> but it is influenced by a
21:45:09 <mm_freak> that's a design problem
21:45:23 <mm_freak> in snap and yesod c isn't influenced by a
21:45:28 <mm_freak> which i consider correct behavior
21:45:39 <stepkut> 'a' can affect with 'c' is run at all.. and when you compose a <|> c, you really don't have any good idea of when that will happen
21:45:56 <stepkut> happstack works the same as snap and yesod.. they are all broken IMO
21:46:07 <mm_freak> 'a' shouldn't be able to affect that
21:46:22 <mm_freak> (<|>) controls when c is considered and when not
21:46:24 <stepkut> affect what? Whether 'c' gets called or not ?
21:46:32 <mm_freak> yes
21:46:44 <stepkut> sure.. <|> controls it.. but <|> is controlled by what 'a' does
21:46:47 <mm_freak> a perfectly reasonable implementation of (<|>) would always ask 'c'
21:46:53 <mm_freak> s/would/could/
21:47:03 <mm_freak> it could always ask both, or ask them in order
21:47:29 <mm_freak> 'a' can really only do two things in a nice, coherent design:  return a response or reject the request
21:47:36 <mm_freak> Either e Response
21:47:41 <stepkut> yes
21:47:47 <stepkut> that is how it works
21:48:02 <mm_freak> now if there isn't a StateT somewhere, i don't see a problem
21:48:23 <mm_freak> netwire for example builds on about the same idea
21:48:36 <mm_freak> "yes" . wackelkontakt 0.5 <|> "no"
21:48:50 <mm_freak> displays "yes" half of the time and "no" otherwise
21:49:33 <azathoth991> ok
21:49:37 <azathoth991> leme see some siteS?
21:49:42 <stepkut> i still think it is bogus that if 'c' works by itself and then you do, a <|> c, 'c' might break
21:49:48 <azathoth991> any free blgo liek livejournal.com in happs?
21:50:04 <azathoth991> it seems haskell can collect needed things and lazily to them mroe efficiently but
21:50:11 <azathoth991> what if have 500 concurrent users?
21:50:22 <mm_freak> stepkut: 'c' shouldn't "break"…  the idea is that (<|>) is closed for correct web applications for some value of "correct"
21:50:24 <stepkut> azathoth991: clckwrks.com aims to be that, but it is not there yet. Though it does power happstack.com and clckwrks.com
21:50:31 <mm_freak> i.e. if a and b are correct, then a <|> b is also correct
21:50:40 <stepkut> mm_freak: exactly.. and that is not true
21:50:41 <stepkut> consider
21:51:19 <stepkut> c = msum [ dir "handle-form" $ doFormHandlingForFormC ; dir "view-form" $ renderFormC ]
21:51:24 <stepkut> let's say that works all fine
21:51:39 <mm_freak> yes, i know what you're getting at
21:51:40 <stepkut> and then you have  a = msum [ dir "handle-form" $ doFormHandlingForFormC ; dir "view-form-a" $ renderFormA ]
21:51:43 <stepkut> and that works all fine
21:51:52 <stepkut> but, a <|> c will not work fine
21:51:57 <stepkut> because 'a' stole one of the routes from 'c'
21:52:24 <stepkut> there is, in fact, no safe way to compose those two server parts.. but it is a subtle runtime failure
21:53:03 <stepkut> (this assumes that both formA and formC are trying to submit to /handle-form)
21:53:21 <mm_freak> if that is part of the correctness requirement, then the solution is:  either provide the routes as static info or have the sitemap type as an argument to ServerPartT
21:53:38 <stepkut> and.. this is why I invented web-routes ;)
21:53:59 <mm_freak> web-routes doesn't /solve/ the fundamental problem, it just hides it
21:54:29 <stepkut> oh ?
21:55:10 <mm_freak> now you're pattern-matching on a sitemap type, for which of course haskell helps to keep it clean
21:55:36 <mm_freak> but once you have two sitemap types, the problem reappears
21:56:01 <stepkut> when you compose to site maps, you use a newtype that prefixes the sitemaps to keep them unique
21:56:19 <stepkut> data Sitemap = SitemapA SitemapA | SitemapB SitemapB
21:56:38 <stepkut> so then you get /sitemap-a/handle-form and /sitemap-b/handle-form
21:57:00 <mm_freak> yeah…  it puts an abstraction on top that hides the problem
21:57:36 <mm_freak> but remember that we are still in RouteT, where we can lift ServerPartT computations
21:58:14 <stepkut> yeah.. we need to get rid of <|> next ;)
21:58:26 <mm_freak> no, we need to fix it
21:58:31 <stepkut> fix what?
21:58:43 <mm_freak> i don't want to lose the nice categorical properties of web applications =)
21:59:21 <mm_freak> category theory is the best web framework…  it can solve all these problems, if we only let it
21:59:34 <stepkut> well.. first you have to show that web applications actually have nice categorical properties
21:59:52 <stepkut> the ability of the w3c to screw you over knows no bounds
21:59:57 <mm_freak> they do…  it's easy to build a category of web applications
22:00:14 <mm_freak> the tricky part is getting the constraints right
22:00:58 <mm_freak> if you have a clear definition of what makes a correct web application, then CT does the rest
22:01:23 <stepkut> I'm not opposed to that idea
22:01:41 <stepkut> I'm not attached to anything in H7, we can throw it all out for H8
22:01:54 <mm_freak> remember the original idea of hAppS:  composable web apps, everything developed in isolation
22:01:55 <stepkut> and I do want to reconsider whether things like the current msum behavior is really all that sensible
22:02:08 <donri> wait aren't we tracking 'put' monadically in happstack-clientsession
22:02:14 <stepkut> donri: yes
22:02:22 <donri> so why can't acid-state do that
22:02:44 <mm_freak> donri: it's easy to ask, "did it use 'put'?", but it's impossible to ask, "will it use 'put'?"
22:02:50 <donri> ah
22:02:55 <stepkut> donri: because cookies are already so broken that we can do more stupid stuff and not make it any stupider
22:02:58 <donri> and you need to know it before. i see.
22:03:21 <stepkut> yeah, what mm_freak said
22:03:29 <mm_freak> stepkut: i get the impression that you are the main developer of happstack =)
22:03:40 <donri> i guess it could still be useful to avoid the write, but you still have to block until the computation is evaluated?
22:03:52 <stepkut> mm_freak: yes.. but I didn't create it -- I inherited a bunch of stuff which I have been slowly replacing ;)
22:04:03 <stepkut> donri: right
22:04:05 <mm_freak> i see
22:04:33 <stepkut> I started using happstack back when it was HAppS 0.4 or something
22:04:48 <mm_freak> stepkut: if you're interested, i could create a theoretical framework for the next happstack
22:05:01 <donri> what if updates were just applicative... what power do we lose
22:05:02 <stepkut> mm_freak: yeah, that would be neat
22:05:24 <mm_freak> donri: the power to make the update dependent on the current state? ;)
22:05:36 <donri> ah yea, so completely useless
22:05:41 <mm_freak> =)
22:05:45 <donri> can't increment a counter even
22:06:02 <mm_freak> well, you could, if acid-state provides a "incrCounter" primitive =)
22:06:07 <donri> lol
22:06:34 <donri> but would that work in a non-ArrowApply arrow though?
22:06:40 <mm_freak> yes
22:06:47 <mm_freak> Category changes everything
22:06:50 <donri> ah
22:07:00 <donri> so applicative+category could do
22:07:04 <mm_freak> yes
22:07:09 <mm_freak> and that's basically Arrow
22:07:15 <donri> yea ;p
22:07:30 <donri> just everyone seems to be hatin' on arrow these days
22:07:38 <stepkut> mm_freak: so when you say a categorical web-framework.. do you mean you want to have, instance Category Happstack ?
22:07:45 <mm_freak> i'm not hating arrows…  i hate Arrow
22:07:54 <donri> anyway not sure not putting in an update is a common use case
22:08:04 <mm_freak> i like ArrowChoice and ArrowLoop together with -XArrows
22:08:07 <donri> hah well yea that :)
22:08:10 <mm_freak> but other than that i prefer Applicative
22:08:28 <stepkut> donri: in happstack-authenticate I have a function that purges expired authentication tokens.. but if non are expired then nothing happens..
22:08:30 <mm_freak> stepkut: no, it would still be monadic
22:08:35 <mm_freak> (likely)
22:08:52 <mm_freak> unless i find that a category would be necessary to enforce the correctness
22:08:58 <stepkut> :)
22:09:31 <mm_freak> for PR reasons i'd like to use Category only for specific things =)
22:10:13 <stepkut> :p
22:10:36 <mm_freak> as the author of netwire i know how difficult it is to sell arrows ;)
22:12:46 <stepkut> :)
22:13:16 <donri> i'm stupid enough to like arrow :)
22:14:51 <donri> a theoretical framework based in category theory for happstack / web applications sounds great btw
22:16:13 <stepkut> with pipes, we will have a firm Categorical foundation :)
22:17:18 <mm_freak> btw, pipes and netwire are quite similar
22:17:34 <mm_freak> you can bend either to do what the other does
22:18:27 <azathoth991> clckwrks motto should be "Now you dont need php mysql and a php cms, just use happs and haskell!!"
22:18:39 <azathoth991> or "when you know wordpres sux0r"
22:20:09 <donri> my dream: netwire and acid-state on the server, netwire and acid-state on the client via ghcjs and websockets
22:20:53 <stepcut> azathoth991: http://i.imgur.com/OdYxZ.jpg
22:21:15 <donri> although, i think you said banana is better for UIs? but i like netwire's design more for some reason ...
22:21:33 <donri> read: i don't understand reactive-banana, netwire "clicks"
22:22:22 <stepkut> i need a good FRP library for a robot
22:24:10 <donri> i think that's the kind of thing netwire is supposed to be good for
22:24:25 <stepkut> could be
22:25:29 <donri> let's ask mm_freak if he's heard of netwire
22:25:50 <donri> don't you just love it when you get recommended your own project by someone
22:26:06 <donri> "hey you might like this" "yea i wrote it"
22:27:09 <donri> http://news.ycombinator.com/item?id=4993053
22:27:50 <stepkut> hmm.. for happstack-authenticate.. should the session lifetime be a compile time value that is passed to the handler function.. or a value in the database that can be changed at runtime.. I think the latter sounds more better ?
22:29:22 <donri> don't ask me! i don't make Serious Real stuff where that matters ;)
22:30:08 <donri> database sounds more complicated, but hs-auth already needs an acid-state eh?
22:33:22 <stepkut> yeah, I already have a database
22:33:52 <stepkut> seems like for something like a clckwrks site, different admins might want to have a different session lifetime.. having to recompile the server just to change that seems a little silly
22:37:03 <donri> well if you pass it in to handlers you could get it from the db yourself, or via command line options etc?
22:37:43 <stepkut> yeah.. but then you have to write the code to store it somewhere yourself..
22:37:54 <stepkut> and pass more arguments to the code
22:38:52 <stepkut> i think i will just store the default timeout in the AuthState database for now
22:38:52 <stepkut> seems sensible
22:40:59 <azathoth991> awesome!!!
22:41:01 <azathoth991> get rida oo
22:41:06 <azathoth991> and use functional!!!!!
22:41:08 <azathoth991> YEAHEHAHAE!!!
22:41:11 <azathoth991> AWESOMEE!!!!!!!!
22:43:05 <donri> lol
22:47:52 <azathoth991> I saw thsi brilliant guy who made gforth start to make an object system and I was like dude noooooooooooooooooooooo
22:48:27 <azathoth991> so haskell can hang with scheme as far as abstractions? right?
22:48:34 <azathoth991> I started to read SICP
22:49:55 <stepkut> azathoth991: yes indeed
23:45:52 <azathoth991> :)
23:46:24 <azathoth991> haskell needs a graphing monitoring thingy like graphite so we can all get rida cacti and nagios n friends
23:46:25 <azathoth991> also
23:46:43 <azathoth991> is darcs as good as git now? is darcs 2 high performance? I heard someoen talking smak liek darcs is slowness
23:53:02 <mm_freak> donri: reactive-banana is not better for UIs…  it's just currently more practical =)
23:53:15 <mm_freak> feel free to write a wx or GTK binding =)
23:53:36 <donri> ah so the only win is preexisting integration with wx or gtk?
23:53:37 <mm_freak> you could in fact combine reform and netwire to write reactive UIs
23:54:04 <mm_freak> yes, that's the win
23:54:04 <donri> not sure reform is any good for reactivity though
23:54:05 <azathoth991> you know someone sent me a smlserver link with reactive html they have working, was pretty cool
23:54:50 <mm_freak> donri: and yeah, it feels great to reply, "i'm the author" =)
23:55:01 <donri> :)