07:59:47 <Palmik> Hi guys, do you make your ACID State models rather relational or document-oriented?
08:00:16 <Palmik> I'm not sure what works beter with ACID (performance wise).
09:38:34 <Lemmih> Palmik: Document-oriented, usually.
09:39:16 <Palmik> Lemmih, thanks. :)
09:40:07 <Lemmih> New (minor) version of acid-state is out.
09:40:09 <Lemmih> yay
14:17:38 <Palmik> Hmm, can I make deriveSafeCopy work with associated data-types? (I have something like "class IsEntity a where data EntityID a :: *")
14:24:50 <Lemmih> No, not really.
14:25:13 <Lemmih> I'll get around to fixing that eventually.
14:26:49 <Lemmih> You can do: newtype EntryID YourType = ... deriving (SafeCopy).
14:30:10 <Palmik> Thanks, yes that does the trick (with newtype wrappers and generalized newtype deriving at least :)).
14:49:29 <Palmik> Hmm, I guess I can not have it after all, since deriving Typeable for multiple instances results in overlapping instances of Typeable1.
14:51:04 <Palmik> Guess I will have to revert back to associated type synonyms.
15:09:30 <Lemmih> I'm having the same problem at work so I'll probably fix it soonish.
15:09:51 <Lemmih> Technically it's not a problem. I just have to write the TH for it.
15:13:42 <Palmik> OK, by the way thanks for your work on acid-state.
15:13:59 <Lemmih> Cheers, I'm glad you like it.
15:19:57 <etarasov> Hi!
15:20:15 <etarasov> can you help to resolve dependency hell while installing clckwrks?
15:20:59 <hpaste> a pasted “clckwrks install” at http://hpaste.org/72784
15:59:13 <Palmik> Hmm, if I have data A = A { b :: B } and then I have foo = AcidState A, can I somehow get AcidState B from that or is that not possible (and/or) implemented?
16:01:54 <Palmik> etarasov, for some reason clckwrks requires 4.0 version of containers, which is up to 5.0. You already have 5.0 installed, since you have installed template-haskell which also requires containers (but does not specify a version, so the most up-to-date was chosen).
16:02:35 <Palmik> I recommend doing a clean install, also take a look at cabal-dev
16:03:58 <stepcut> i should probably bump the version for containers to accept 0.5
16:04:06 <stepcut> assuming it doesn't break anything
16:04:19 <Palmik> Or you could try installing containers 4.0 beforehand (by cabal install 'containers==4.0.*' (or whatever is the syntax)) and the install clckwrks
16:04:49 <Palmik> Also, it's quite hard to write clckwrks. :D
16:05:13 <stepcut> Palmik: takes a little practice
16:06:04 <stepcut> though.. I type on dvorak, so maybe it is easier. At least it isn't like 'darcs' which is all on the left hand on qwerty :p
16:06:39 <Lemmih> Palmik: Not possible.
16:08:07 <Palmik> Lemmih, OK, thanks.
16:10:46 <stepcut> ACTION tests containers 0.5
16:24:06 <etarasov> Palmik: thanks, container reinstalling brakes 'ghc-7.4.2' package
16:24:23 <etarasov> I have not idea what is it
16:24:50 <etarasov> *no
16:25:24 <etarasov> ACTION uses 'dk' alias for darcs
16:30:15 <Palmik> I would either use cabal-dev or wait for stepcut then.
16:30:50 <etarasov> ok
16:33:09 <Palmik> Hmm, anyone implemented threaded comments with acid-state yet? If so, what data structure did you choose to implement them?
16:33:55 <Palmik> Eventually I would like to convert it to Forest, but It does not seem to be ideal for storage.
16:34:18 <stepcut> Palmik: I think I have.. why do you think Forest is a bad idea?
16:34:36 <stepcut> I think Forest is a bad idea.. just curious why you do :)
16:36:20 <Palmik> Well, I would like to efficiently query for sub-threads (or sub-forests) for example, I did not give it much though yet, but for now I'm not sure how I would do that other than query for the whole forest and then lookup the sub-thread.
16:36:45 <Palmik> That is the first thing that comes to mind.
16:37:08 <stepcut> right
16:37:29 <Palmik> So I wonder whether it would be better to store it in more relational flattened way and then reconstruct it to Forest rrespresentation.
16:37:58 <stepcut> you want to be able to permalink to individual comments, and you need a way to insert new comments into a specific position in the tree. But because of the nature of HTTP you can't use a Zipper or anything like that
16:40:40 <Palmik> Yes, that is also true.
16:42:27 <Palmik> Basically anything othe than querying for the whole discussion (Forest) or some reasonable part of it (for example all top-level comments) would be cumbersome.
16:42:43 <stepcut> yes
16:43:20 <stepcut> and if you order the comment in different ways for different users, that would make things even worse
16:44:30 <stepcut> threaded comments are definitely not as trivial as they might seem as first. I have been wanting to release a threaded-comments library for a while
16:44:54 <stepcut> the first step is to come up with a clear list of requirements
16:45:14 <stepcut> and then design some types around those requirements.
16:45:23 <stepcut> the rest should be straight-forward from there
16:58:41 <stepcut> hmm, testing if containers 0.5 works is tough, because I need to rebuild a bunch of packages that depend on 0.4 on my system
16:59:15 <stepcut> maybe I should just assume it will work and upload a new version :p
16:59:22 <stepcut> or learn how to use cabal-dev
17:02:06 <stepcut> Building source dist for clckwrks-0.10.0...
17:02:07 <stepcut> setup: Error: Could not find module: Paths_clckwrks with any suffix:
17:02:08 <stepcut> ["gc","chs","hsc","x","y","ly","cpphs","hs","lhs"]
17:02:09 <stepcut> :(
17:04:35 <stepcut> cabal: dist/src/sdist.-6441/reform-0.1.1: does not exist
17:04:42 <stepcut> so far cabal-dev is not winning me over
17:12:23 <stepcut> cabal-dev: /home/stepcut/n-heptane/projects/haskell/reform/reform/dist/reform-0.1.2.tar.gz: rename: unsupported operation (Invalid cross-device link)
17:12:28 <stepcut> joy \o/
17:18:16 <stepcut> actually.. plain old cabal is giving me that error about not being able to find Paths_clckwrks.. but that is not new :-(
17:22:48 <Palmik> Well, is not cabal-dev just a cabal wrapper?
17:22:57 <stepcut> yes
17:23:10 <stepcut> I didn't get this error prior to install cabal-dev.. not sure what happen
17:23:12 <stepcut> happened
17:23:24 <Palmik> Ah, OK. :)
17:26:56 <donri> huh, i've never seen or heard of such errors from cabal-dev
17:27:30 <donri> my issues has been that runhaskell doesn't work and that trhsx isn't in $PATH
17:31:56 <stepcut> oh, hmm.
17:32:08 <stepcut> I have never uploaded this package to hackage.. so maybe it never worked
17:33:01 <stepcut> but, this does leave a question.. how do I export Paths_clckwrks ?
17:33:16 <donri> you add it to other-modules
17:33:21 <levi> Ooh, you released the screencast.  I have queued it in youtube, will watch during lunch.
17:33:33 <stepcut> levi: yeah.. sorry it is so long :)
17:33:54 <stepcut> I feel like I should do a speed run where I don't explain stuff as much
17:34:28 <stepcut> donri: but.. Other-Modules are not visible to other packages
17:34:37 <donri> or exposed-modules
17:35:36 <donri> maybe your custom setup.hs is the problem, i've never used those
17:36:26 <stepcut> it is already in exposed-modules, which works fine until I try to use sdist
17:36:58 <donri> you shouldn't include it in the sdist if that's what you're trying
17:37:46 <stepcut> putting it in Exposed-modules is what makes sdist try to find it
17:37:55 <donri> ah yea you're right
17:38:00 <stepcut> I can't put it in Exposed-modules and not put it in Exposed-modules at the same time :)
17:38:05 <donri> you could re-export it from an exposed module
17:38:15 <stepcut> yes, I considered that
17:38:34 <stepcut> but I asked on #hackage first to see if there is a better workaround
17:40:06 <stepcut> etarasov: I uploaded a new reform that allows containers 0.5 and pushed a patch to the clckwrks darcs repo that does the same… how do things look now ?
17:40:18 <stepcut> ACTION probably needs to patch web-routes or something else as well
17:44:01 <etarasov> trying to compile...
18:13:51 <etarasov> need to rebuild cereal and all packages depended on it
18:18:16 <etarasov> deleting ~/.ghc ...
18:20:55 <etarasov> rejecting: containers- (conflict: happstack-authenticate =>
18:20:55 <etarasov> containers==0.4.*)
18:21:08 <Palmik> Did you do cabal update?
18:21:09 <etarasov> I probably need to install happstack from darcs
18:21:16 <etarasov> I did
18:21:41 <stepcut> I probably need to update happstack-authenticate
18:21:43 <stepcut> one moment
18:21:46 <Palmik> You are right, not on hackage yet.
18:25:50 <stepcut> it is now :)
18:25:56 <stepcut> happstack-authenticate 0.9.5
18:26:02 <stepcut> i mean, 0.9.4
18:27:22 <mekeor> cool.
18:28:09 <etarasov> $ cabal install        ...        template-haskell- (reinstall) changes: containers- ->       ...        cabal: The following packages are likely to be broken by the reinstalls:
18:28:09 <etarasov> ghc-7.4.2
18:29:11 <etarasov> not sure what it can broke
18:29:29 <stepcut> >:(
18:29:41 <stepcut> I though the issue here is that your whole system was compiled against containers 0.5?
18:29:43 <etarasov> processing with compilation...
18:34:44 <etarasov> it seems that I already broke this package some time ago and now restored original state by deleting user's package database
18:35:39 <etarasov> I'm really sorry that I took your time
18:40:31 <stepkut> well, I needed to update those packages to allow containers 0.5 anyway
19:02:09 <Palmik> Hmm, does vim-haskell or haskell-mode make importing easier? Since most of my modules have loads of imports, that alone would make a compeling reason to switch to proper text editor.
19:11:59 <etarasov> got clckwrks running, thanks!
19:21:50 <stepcut> sweet!
19:31:38 <etarasov> On http://www.clckwrks.com/C/ViewPage/3 you write "On Fedora you need:"
19:31:43 <etarasov> It also works on centos 6
19:32:37 <stepcut> nice
19:33:50 <stepcut> updated
20:40:36 <donri> Palmik: ghc-mod does
20:41:04 <donri> Palmik: https://github.com/ujihisa/neco-ghc
20:42:10 <donri> Palmik: i also have some snippets for dealing with qualified imports in https://github.com/dag/vim2hs
20:44:27 <Palmik> Thanks, that look interesting, will look into that. :)
21:11:14 <donri> stepcut: so i guess you want a monadic interface for the type safe css so you can e.g. use web-routes for url() or load some user theme preferences from acid-state or whatever
21:11:49 <donri> stepcut: but then you need to make everything kind * -> * right and the constructors aren't really type safe anymore :( so you have to write smart constructors for everything -.-
21:13:33 <donri> is it all worth it, just so you can do like, background SomeImageURL, instead of, url <- showURL someImageURL; return background url
21:14:00 <donri> well, return $ Background (URL url)
21:14:55 <donri> what do you think
21:15:18 <stepcut> dunno
21:15:36 <stepcut> sounds complicated
21:15:52 <donri> hehe
21:16:14 <stepcut> could we build it on top of a less type-safe AST, etc ?
21:16:32 <donri> yea, that's the solution that requires "smart constructors" of everything
21:17:11 <stepcut> in my experience, the haskell type system is not really poweful enough for this type of thing.. you need agda or something
21:17:24 <stepcut> while you can  make the haskell type system do it, it is often too ugly to use
21:17:40 <donri> like, background :: (EmbedAsValue a, Monad m) => a -> m Property; background a = return $ Background (asValue a)
21:17:56 <donri> instead of just using Background directly
21:18:11 <stepcut> sure
21:18:13 <hpaste> donri pasted “this is what i have working now” at http://hpaste.org/72799
21:18:48 <stepcut> neat
21:19:00 <hpaste> donri annotated “this is what i have working now” with “rendered” at http://hpaste.org/72799#a72800
21:19:40 <stepcut> also the sort of thing that makes me think that QQ is the right way to go for most embedded CSS
21:20:31 <donri> maybe
21:20:52 <donri> i'm undecided on that; plain DSL is nice because it works with auto-completion etc
21:20:59 <stepcut> yup
21:21:06 <stepcut> and is nice when you are trying to map something over something
21:21:10 <donri> yea
21:21:27 <stepcut> though.. in html it makes since to try to map, <li> over a list of elements.. not sure when that would arise in CSS
21:21:40 <donri> yea probably not too common
21:21:58 <donri> more interesting is things like what SASS does, which you get for free by having haskell
21:22:02 <donri> mixins and shit
21:22:32 <stepcut> whatever that is :)
21:23:06 <donri> left dist = Float Left <> MarginLeft dist
21:23:15 <donri> now you can use "left" like any property
21:23:25 <donri> from the example at http://sass-lang.com/
21:23:31 <stepcut> I am mostly interested in defining constants for colors and being able to theme elements that have ids that are dynamically generated, or embedding haskell values into the template
21:23:40 <stepcut> which are all kind of the same thing I guess
21:24:08 <stepcut> yeah, this type of thing, $blue: #3bbfce;
21:24:10 <donri> but is the "dumb constructor" approach good enough?
21:24:28 <donri> it the same issue we have with blaze-html
21:24:36 <stepcut> yeah
21:24:45 <donri> but maybe less important for css?
21:24:47 <stepcut> i think the blaze-html approach is good enough..
21:25:41 <donri> i think i'll still have a monad on the top for "chaining" rules, and keep it a proper transformer
21:26:14 <stepcut> right
21:26:31 <donri> so at least you can use showURL at that level
21:26:34 <donri> etc
21:26:36 <stepcut> exactly
21:27:13 <stepcut> we can do better in Happstack 9 when we rewrite it all in Agda ;)
21:27:18 <donri> yay!
21:27:41 <donri> it can be done in haskell too, it just requires a lot of duplication
21:27:50 <donri> i suppose i could generate some of the code
21:28:37 <donri> i sort of like the simplicity and transparency of algebraic data types though
21:28:41 <stepcut> yeah
21:28:55 <stepcut> I feel like simple is better here
21:29:17 <stepcut> integrated runtime validation might be good enough
21:29:23 <stepcut> we have that already for html
21:29:39 <stepcut> and it could be extended to css
21:29:43 <donri> this issue isn't about validation though, it's about how flexible the code is
21:29:59 <stepcut> ah
21:30:12 <donri> or rather the API
21:31:42 <stepcut> what are the smart constructors buying us ? and what are you trying to generate?
21:31:52 <stepcut> not sure I quite follow yet
21:32:10 <donri> the smart constructors buy us a type-safe monadic API
21:33:35 <donri> i have like, data Property = BorderTopColor Color; to make Color monadic there you need, data Property a = BorderTopColor a; and it's no longer type safe; so you need a class "can be made into a Color" and a "smart constructor" e.g. a function wrapper around BorderTopColor
21:34:20 <donri> hm i guess you can have, data Property m = BorderTopColor (m Color) ?
21:34:49 <stepcut> ah
21:35:55 <stepcut> data PropertyM m = BorderTopColor (m Color) ; type Property = PropertyM Identity
21:36:25 <stepcut> at some point you need smart constructors anyway, since the order and number of parameters can vary?
21:36:51 <donri> yea if you want it really type safe; i just do Padding [Size] for now
21:37:51 <stepcut> yeah
21:38:04 <donri> although the issue remains, if you want to do, BackgroundImage SomeWebRoutesURL, you have to do something like, BackgroundImage (showURL SomeURL)
21:38:15 <stepcut> right
21:41:46 <stepcut> it's too bad we can make a function named, border-color
21:41:54 <stepcut> rather, background-color
21:42:18 <stepcut> go go gadget Agda!
21:42:53 <donri> yea i quite like that about agda/lisp/perl6
21:43:11 <donri> and the mixfix in agda, it's probably insane but seems cute ;)
21:43:23 <stepcut> yeah
21:43:34 <stepcut> I like the mixfix stuff to the limited degree I have used it
21:43:47 <stepcut> its fun that if_then_else can be a normal function :p
21:43:52 <donri> yea
21:43:58 <stepcut> if_then_else_
21:44:21 <stepcut> so, right now you are trying to avoid having to create smart combinators like, borderTopColor ?
21:44:39 <donri> i'm trying to decide what to do :P
21:44:49 <stepcut> 'smart' possibly being as dumb as, borderTopColor = BorderTopColor
21:45:09 <stepcut> personally, I like the look of the lower case names better ;)
21:45:10 <donri> yea, but if that's all you have it's not really any win
21:45:21 <stepcut> right
21:45:26 <donri> i tend to think that lowerCamelCase looks unbalanced
21:45:41 <stepcut> yeah
21:45:50 <stepcut> but, lower_camel_case is not that great either
21:46:06 <donri> also it might arguably be a good thing that actual properties and "mixins" and such things look different
21:46:26 <donri> e.g. you said blaze was hard to read, maybe in part because you mix lower case functions and tags
21:46:34 <stepcut> if we make the smart combinators monadic, then perhaps we can leverage the do notation like blaze does ?
21:46:56 <donri> in deed
21:47:07 <donri> not even sure monoid is powerful enough at that point
21:47:11 <stepcut> it seems like putting the 'm' in the data type is not the right solution.. though I can't say exactly why yet
21:47:46 <donri> the most powerful API, ignoring simplicity, would be something like what HSX does
21:47:55 <donri> but i'm not sure if it's worth it for something as simple as CSS
21:48:36 <donri> and in fact it would be much more complex than HSX even because i'm going crazy and aiming for type safety at the property level
21:48:42 <stepcut> if we have smart constructors, the next question is, how dumb should the underlying data-type be?
21:49:19 <donri> yea if you have smart constructors you can have like, data Property = Property Text Text, :P
21:49:38 <stepcut> having more type information in the CSS types can make something things easier.. like applying a transformation to all Size properties
21:49:54 <donri> yea
21:50:20 <hpaste> donri annotated “this is what i have working now” with “unrendered” at http://hpaste.org/72799#a72805
21:50:36 <stepcut> it makes the parser more complicated, because the parser has to actually parse everything for real.. but it also means that you get better syntax checking
21:50:37 <donri> ^ it's nice that you can "show" an AST like that
21:50:47 <donri> and manipulate it
21:50:53 <stepcut> yeah
21:51:01 <stepcut> I am currently in favor of keeping the strong AST
21:51:18 <stepcut> and having smart constructors
21:51:29 <donri> why the smart constructors?
21:51:56 <stepcut> for monadic stuff, and the ability to handle variable numbers of arguments better?
21:52:19 <stepcut> polyvadiac or whatever it's called
21:52:26 <donri> so you think making it monadic is worth it?
21:52:50 <stepcut> yes, even if you are not using web-routes, you might want to use a reader monad to hold color values or something
21:53:08 <donri> well i'm thinking Rule would be monadic but maybe Property don't need to
21:53:19 <stepcut> hmm
21:53:27 <stepcut> seems useful to have property as well:
21:53:44 <stepcut> backgroundColor (get "background")
21:53:46 <stepcut> :p
21:54:04 <stepcut> i think I missed something there.. but whatever :)
21:54:16 <donri> useful sure. but can it be done without making the AST monadic as well?
21:54:35 <stepcut> sure
21:54:48 <donri> ah yea
21:54:52 <stepcut> maybe we need a Free monad :P
21:55:12 <stepcut> the GenCSS free monad
21:55:23 <donri> backgroundImage url = do url' <- url; return $ BackgroundImage url
21:55:30 <donri> although then you still need to call showURL manually
21:55:48 <donri> we could introduce embed classes for every value type ;)
21:56:26 <stepcut> yeah
21:56:43 <donri> anyway i'm now thinking that this can be added later on so i can continue doing the lower-level stuff as i have been doing them for now
21:57:04 <stepcut> right
21:57:05 <stepcut> i think so
21:57:23 <stepcut> i think we should start with a pure, fairly type-safe AST, and then create a parser/renderer
21:57:25 <stepcut> then we do can CSS
21:57:33 <stepcut> s/CSS/QQ/
21:57:42 <stepcut> and then we can add a fancy pants combinator library
21:57:47 <donri> yea
22:46:51 <levi> Hmm.
22:47:37 <levi> Are you sure thinking of things in terms of CSS is the right approach? CSS, after all, is already a declarative language for stating properties about DOM attributes.
22:49:05 <donri> levi: how do you mean
22:53:01 <levi> CSS defines a fairly limited DOM-transformation function.  Maybe there's a more natural way to express that in Haskell than trying to model it after CSS.
22:54:11 <donri> possibly. the end-goal is to output css though. what are you proposing?
22:54:47 <levi> I don't have any concrete proposal, it was just a notion I thought I'd throw out in case it caught anyone's interest.
22:55:00 <donri> it certainly sounds interesting :)
22:55:35 <donri> maybe it's still useful to do what i'm doing first and then build something cool on top of it?
22:55:42 <levi> There have been a number of different 'stylesheet' languages associated with SGML and XML.
22:56:14 <levi> Well, defining an AST for CSS would definitely be required in the back end, since CSS is what browsers understand.
22:56:46 <donri> yea
22:57:30 <donri> the same goes for html. it could potentially be interesting to have something GWT-esque with more high-level widgets in the haskell-layer, although you still need lower-level html to implement the higher-level.
22:57:59 <levi> It would be cool to be able to specify arbitrary transformations and derive CSS for static stuff and javascript for stuff that can't be done with CSS.
23:01:41 <donri> stepcut: random thought. are you planning to use http-types for 8 and would that gain us anything?
23:01:53 <stepcut> nope
23:02:56 <stepcut> I will consider it though
23:02:57 <donri> we should call our wai "web-servers" ^_^
23:03:12 <stepcut> hyperdrive
23:03:16 <donri> (web-{routes,styles})
23:03:22 <donri> hehe
23:03:27 <stepcut> because its for hypertext :)
23:03:30 <donri> condu.. oh wait
23:03:40 <donri> ah nice
23:04:34 <donri> that could be the server though ;P
23:04:42 <levi> imATeaPot418
23:05:50 <donri> we should use Web.* more i think, Happstack and Network are boring top-levels
23:08:29 <donri> Network.HTTP.* even more so
23:08:51 <donri> nested top-levels sux0rz
23:30:23 <stepcut> :)
23:30:55 <stepcut> oh right. hyperdrive is supposed to be the underlying server, not the API
23:52:38 <levi> hyperdrive is Happstack's answer to warp?
23:52:49 <stepcut> yup
23:52:53 <stepcut> well, not really
23:54:01 <stepcut> it's the answer to this bug, http://code.google.com/p/happstack/issues/detail?id=29, which is older than yesod :p
23:54:32 <donri> stepcut: so unless someone comes up with something better, i propose web-servers for the API. consistent with web-routes and my new web-styles, and is descriptive of what it is: a generic API for web servers
23:54:45 <stepcut> ok
23:56:40 <donri> and admits the Web.Servers module namespace. i don't like plural in module names but consistent with Web.Routes (and Web.Styles) ... :P
23:57:01 <levi> You need Web.Documents
23:57:11 <stepcut> we could switch to singular
23:57:27 <donri> that works too
23:57:42 <stepcut> though i am not sure if that type of consistency is correct
23:57:50 <stepcut> an application use has multiple routes but only one server?
23:58:15 <levi> Modern web apps typically have multiple servers, especially at scale.
23:58:52 <levi> Although that doesn't apply so much at the API level.
23:58:54 <stepcut> levi: well, that is different
23:58:57 <donri> stepcut: well it's more about modules defining a concept
23:59:23 <donri> Control.Monad not Monads, even though there's more than one