01:43:17 <mafs> stepkut: Also, is there a good example of how I would use web routes as a 3rd party library?
01:43:33 <mafs> That is, it looks to me like I'd need to define everything in my Sitemap (or whatever) datatype
01:43:48 <mafs> which leaves no room for plugging in other libraries' site maps, unless I'm missing something here
01:44:05 <mafs> Or do I need to wrap the other sitemap in a new data type, like:
01:44:20 <mafs> data Sitemap = Home | Blah | ThirdParty ThirdPartySitemap deriving ...
02:17:29 <stepcut> yeah, you wrap like that
02:17:37 <stepcut> that will be part III of the tutorial
03:06:59 <mafs> Okay, cool
03:06:59 <mafs> thanks
18:01:15 <stepkut> Lemmih: deriveSafeCopyHappstackData does not work as well as one might expect
18:06:47 <Lemmih> Oh.
18:06:56 <stepkut> yeah
18:06:58 <stepkut> one moment
18:07:26 <stepkut> if I have, data Bar = Bar
18:07:34 <stepkut> happstack will serialize Bar as:
18:07:45 <stepkut> "\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL"
18:08:19 <stepkut> but with deriveSafeCopyHappstackData it is, "\NUL\NUL\NUL\NUL\NUL"
18:08:27 <stepkut> haven't track down where the difference is yet
18:10:53 <stepkut> though my current suspicion is that happstack-data uses 64-bits for the version tag and safecopy uses 32
18:13:51 <stepkut> yeah, SafeCopy use Int32, but happstack-data uses Int -- which gets serialized as 8 bytes
18:14:30 <stepkut> that seems fixable though
18:15:04 <stepkut> this line just needs to check deriveType: valD (varP 'version) (normalB $ litE $ integerL $ fromIntegral $ unVersion versionId) []
18:15:44 <stepkut> hmm
18:15:53 <stepkut> though it seems that should be casting it to something else anyway ;-/
18:17:01 <stepkut> oh. not the right line to change.
18:17:15 <stepkut> the other annoyance is that you can't just do:
18:17:57 <stepkut> $(deriveSafeCopyHappstackData 0 'base ''Bar) ; $(deriveSafeCopy 1 'extension ''Bar). Because those both attempt to create SafeCopy Bar instances
18:18:34 <stepkut> You have to rename the type and do a normal migration, even though nothing about the type itself has changed
18:19:50 <stepkut> but, probably not worth fixing
18:20:10 <stepkut> unless serialization format changes are expected to be come more common
18:21:04 <Lemmih> Hm.
18:23:49 <stepkut> actually, this Int32 vs Int problem is a bit tricky
18:24:51 <stepkut> because that version number is written by getSafeGet / getSafePut funtions which do not look at the deriveType flag
18:30:33 <stepkut> so, to migrate data from happstack-state to acid-state, you have to write some manual migration code anyway
18:30:59 <stepkut> so I think that having to depend on happstack-data to do that is ok
18:31:54 <stepkut> or we would need to make alternate versions of safeGet / safePut that are happstack-data compatible -- which seems like too much work given the number of people affected by it
18:34:49 <stepkut> especially given the fact that even the current code worked, you would have to duplicate all your types and write migration instances that are all 'id'
18:35:42 <stepkut> easier to just use happstack-data to read in the old data and then use safecopy / acid-state to write it back out
18:36:33 <stepkut> for happstack-state -> acid-state migration, you need to write a little glue code that maps the various happstack-state components to acid-state stores
18:40:49 <stepkut> I am going to actually do a happstack-state -> acid-state migration in the next week, so I will let you know what I find out
18:47:15 <stepkut> in happier news, I just uploaded, http://hackage.haskell.org/package/ixset
18:47:45 <stepkut> which is just like happstack-ixset, execpt with out the Happstack. prefix, and it uses safecopy instead of happstack-data
18:57:31 <Lemmih> neat
19:03:29 <mafs> stepkut: should link to your web-routes crash course section at http://happstack.com/docs
19:03:37 <mafs> under the 'Happstack & web-routes' section
19:05:08 <stepkut> yeah..
19:05:15 <stepkut> that whole site needs an overhaul :-/
21:10:50 <mafs> Ah, that explains it
21:10:55 <mafs> when you derive pathinfo
21:11:00 <mafs> It's case sensitive
21:12:06 <st3pcut> yes
21:12:15 <st3pcut> because constructors are case sensitive
21:12:24 <st3pcut> by default it is very conservative
21:12:50 <st3pcut> you could, of course, make a version that is less conservative
21:13:11 <mafs> yeah, gonna work on that soon
21:13:23 <mafs> right now just playing with it to get used to the libraries and such
21:13:40 <st3pcut> it would be nice if there was general version that took a pair of functions that converted the constructor name to a string and back
21:13:54 <st3pcut> so that people could easily supply their own rules
21:14:12 <st3pcut> actually, it is a little more complicated than that
21:14:25 <st3pcut> I remember now :)
21:14:27 <mafs> Wouldn't you just do that via defining your own read and show?
21:14:40 <st3pcut> no
21:14:49 <st3pcut> it does not use read and show at all
21:14:55 <mafs> oh, ok
21:14:56 <st3pcut> you can define PathInfo instances by hand though
21:15:20 <st3pcut> using parsec and string concatenation
21:15:32 <st3pcut> but there is a cooler way that I am in the process of documenting
21:15:42 <st3pcut> but had to do other work first
21:16:03 <st3pcut> like release ixset and migrate an existing site from happstack-state to acid-state
21:16:13 <mafs> ah
21:16:22 <st3pcut> also, making some updates to happstack.com
21:16:34 <st3pcut> not sure if the new copy is better or worse :p (not live yet)