--- Log opened Sat Mar 21 00:00:50 2009
09:29 < insane_> hi i've got a problem with happstack-data-0.1 installation
09:29 < insane_> src/HAppS/Data/Pairs.hs:15:7:
09:29 < insane_>     Could not find module `HAppS.Util.Common':
09:29 < insane_>       it is a member of package happstack-util-0.1, which is hidden
09:39 < fxr> insane_: using cabal install?
14:12 < mae> guenni: yes, i have a full time job though, so probably the best way to reach me is email :) i am usually around in the evening on chat if I come on
14:12 < mae> evening ps
14:12 < mae> pst
14:13 < guenni> hi there
14:13 < guenni> hi mae
14:14 < mae> stepcut: re rebuilding the whole executable: yes -- actually not rebuilding the whole exe, it just rebuilds the modules which need it, then relinks the exe .. although admittedly i have been using cabal configure && build for this so it works great :)
14:15 < mae> stepcut: only question is where this little tool belongs, it will be an executable file. happstack or happstack-util?
14:15 < mae> guenni: hi there
14:16 < mae> stepcut: i'm thinking happstack-util, since it is probably useful for other projects as well
14:21 < mae> guenni: how can i help you :) I am hopping in the shower but i have a few mins if you wanna talk
14:21 < mae> be back in 10
14:33 < mae> dsrogers: hello!
14:33 < mae> wb
14:33 < mae> heh
14:33 < dsrogers> thanks.
14:33 < mae> been busy?
14:33 < dsrogers> yeah
14:34 < dsrogers> how did 0.2 go?
14:34 < dsrogers> any complaints?
14:34 < mae> dsrogers: pretty good overall
14:35 < mae> 0.3 is going to be alot more mellow
14:35 < mae> some guest app reorg
14:35 < mae> auto-rebuild-on-change tool
14:35 < mae> (similar to searchpath)
14:35 < mae> oh, i added a simple email thing to Happstack.Util
14:36 < mae> http://patch-tag.com/repo/happstack/browse/happstack/templates/project/src/App/Logger.hs
14:36 < mae> arg
14:36 < mae> http://patch-tag.com/repo/happstack/browse/happstack-util/src/Happstack/Util/Mail.hs
14:36 < mae> there it is
14:36 < mae> i added alot of nice haddocks there as well
14:38 < dsrogers> yay
14:39 < dsrogers> I managed to convince my boss to let me add scala to our build system.
14:39 < dsrogers> I told him I'd write in Scala instead of perl...
14:40 < dsrogers> I know this seems totally unrelated, but ... the only reason I picked up Scala so quickly was because of haskell and happs.
14:41 < mae> haha
14:41 < mae> scala is the erlang kvs right?
14:41 < mae> like memcached on steroids?
14:42 < mae> oh oh
14:42 < mae> scalaa
14:42 < mae> java
14:42 < mae> nm
14:42 < mae> yeah i looked at that before too
14:42 < mae> a bit rubyish
14:42 < mae> if i had to write something on JVM i'd probably do scala or clojure
14:43 < stepcut> mae: unfortunately, relinking the whole app can take a very long time (10+ seconds), then nice part about the old happs-hsp-templates stuff is that it could rebuild and reload a template faster than you save the file and switch to the browser
14:43 < mae> stepcut: yeah but you lose your typesafety
14:43 < mae> its a tradeoff
14:44 < mae> i know there is probably a more complicated and better way to do this, but I know the searchpath method works, and i want to get something in there before 0.3
14:44 < dsrogers> in what package is their file test functions like "isWritable" is"readable" "isDirectory" or the like?
14:45 < mae> if you come up with a better tool that achieves the same goals of typesafety, I will be more than glad to make use of it.
14:45 < mae> System.Directory?
14:45 < stepcut> mae: I think the system that Saizan and I sketched out preserved type safetly
14:46 < mae> stepcut: do you have a working implementation?
14:46 < stepcut> mae: only in my head
14:46 < stepcut> :)
14:46 < Saizan_> those are the best ones
14:46 < stepcut> Saizan_: yep. Though formal proofs that it would work if you actually wrote the code is nice too
14:46 < mae> stepcut: hehe, well, ok, like i said, i am by no means saying that my method (taken from sp) is that great, its just that its way better than the method right now of manually having to rebuild after each change, yeah i could use ghci but that is a bit painful sometimes in terms of perf
14:47 < dsrogers> I'm assuming I'm not lucky and System.Posix.Files is not available on windows, right?
14:47 < mae> stepcut, Saizan_: if you guys come up with something way better then I am totally for it, but right now I want to release something that works in the next week
14:47 < mae> it works for me right now
14:47 < mae> i'm just going to slightly generalize it
14:47 < mae> so its not so rigid
14:47 < stepcut> mae: happs-hsp-templates (and the system in my head) actually do compile the templates to native code
14:48 < dsrogers> ok, wtf, is there essentially zero portable file information APIs?
14:48 < mae> dsrogers: yeah its pretty bad :(
14:48 < Saizan_> there's something in System.Directory
14:49 < mae> stepcut: happs-hsp-templates uses json, hence throwing out haskell types, you are talking about something that doesn't do this lossy conversion?
14:51 < dsrogers> System.Directory doesn't have something as simples as isDirectory :: FilePath -> IO Bool
14:52 < mae> err
14:52 < mae> 1 sec
14:52 < Saizan_> dsrogers: doesDirectoryExists
14:52 < Saizan_> s/Exists/Exist/
14:54 < dsrogers> but there is no "isDirectory"
14:54 < dsrogers> err, doesExist
14:54 < mae> http://patch-tag.com/repo/happstack/browse/happstack-util/src/Happstack/Util/Mail.hs
14:54 < dsrogers> sorr...
14:54 < mae> yeah
14:54 < mae> what saizan says
14:54 < mae> same thing
14:54 < mae>  : )
14:54 < dsrogers> so it'll return false, and I don't even know why...
14:54 < mae> doesDirectoryExist
14:54 < dsrogers> nono, doesExist.
14:54 < dsrogers> I just want to know if there's a file there at all, for example.
14:54 < Saizan_> what?
14:54 < dsrogers> then I want to know what kind of file it is.
14:55 < mae> um
14:55 < mae> thats generalizes
14:55 < mae> err
14:55 < dsrogers> -e && -f
14:55 < mae> you don't know in advance?
14:55 < mae> what you want
14:55 < mae> what are you trying to achieve
14:55 < mae> a file listing?
14:55 < mae> with types?
14:55 < dsrogers> no, something that maps a request to a file path
14:55 < mae> do you treat files different than folders?
14:56 < mae> when you get them
14:56 < dsrogers> yes
14:56 < mae> so handle the logic in IO
14:56 < mae> if file this
14:56 < mae> if path this
14:56 < Saizan_> i fear that you've to call both that and doesFileExist
14:56 < mae> if nothing that
14:56 < dsrogers> ah... is there a doesFileExist?
14:56 < dsrogers> see, that's what I was asking for.
14:56 < Saizan_> yes
14:56 < Saizan_> just above
14:56 < stepcut> mae: yep. in our system you just called function and passed in values as arguments like, $(applyTemplate someFunction) arg1 arg2 arg3. At compile time you could decide if the applyTemplate instances should use dynamic linking and link in the ghc-api, or just do normal static linking and not bring in all of ghc-api
14:56 < Saizan_> http://haskell.org/ghc/docs/latest/html/libraries/directory/System-Directory.html#v%3AdoesFileExist <-- haddock docs are your friend :)
14:57 < mae> stepcut: can you have a prototype committed by next week?
14:57 < dsrogers> I was looking at them.
14:57 < stepcut> mae: nope
14:57 < dsrogers> apparently this is not my morning
14:57 < mae> stepcut: hehe
14:58 < mae> stepcut: how long before a prototype
14:58 < stepcut> mae: it could probably be written in a few days, I just don't have a few days :)
14:58 < Saizan_> stepcut: does the impl. in your head look something like this? http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2114#a2114
14:58 < mae> heh
14:58 < mae> stepcut: same here
14:58 < stepcut> mae: unless someone is funding it ;)
14:59 < mae> i wish i could
14:59 < mae> i'm in the same boat as you
14:59 < mae> stepcut: do you think this is something you could find time to do before say may?
14:59 < mae> or saizan
14:59 < Saizan_> btw, how does a facebook app works? they run your code?
15:01 < stepcut> Saizan_: regarding that impl. Dunno.
15:01 < mae> you know i just thought of a fairly reasonable way to do this
15:01 < mae> run the app in bytecode mode
15:01 < mae> recompile the changed module (don't relink the exe), reload in ghci
15:01 < mae> but i don't know how to script something like that in ghci
15:02 < mae> the reload part that is
15:02 < stepcut> Saizan_: you write an application server. When someone goes to your app on facebook, facebook calls your server and passing in some request information. You then generate some xml for your response, which they convert into something that gets displayed to the user.
15:03 < stepcut> your app can also call the facebook APIs to get additional information or perform actions (like posting stories, etc)
15:03 < mae> stepcut: have you found a performance diff in general by compiling with -O2 for example
15:03 < mae> from standard
15:03 < stepcut> mae: depends on the app
15:03 < rovar> hey guys
15:04 < stepcut> mae: I had one app that went from 30+ seconds to less than a second ;)
15:04 < Saizan_> without -O you risk getting pretty silly code
15:04 < stepcut> mae: did you see the bug about cron being busted
15:04 < mae> stepcut: yes i did
15:05 < stepcut> pretty lame :)
15:06 < mae> is it an easy fix?
15:07 < stepcut> mae: dunno...
15:08 < stepcut> mae: either you need a threadDelay like thing that wait longer, or you have to write some loop so that it sleeps and wakes multiple times before running the real event
15:09 < mae> or use a lib which already addresses this
15:09 < mae> there ws that timeout one
15:09 < mae> i can't remember
15:09 < stepcut> mae: yeah
15:09 < stepcut> mae: maybe just using that other lib is the right way to go
15:09 < mae> my time is so crunched right now
15:09 < mae> job kids happstack patch-tag
15:09 < mae> barbecue
15:09 < mae> today
15:09 < mae> hehe
15:09 < mae> stepcut: other lib sounds good
15:10 < mae> stepcut: i don't know, for me, the relinking is actually pretty fast / neat, i mean if you have a decent system i don't think there will be much of a diff
15:11 < stepcut> mae: ghc's linker may be faster now. But, maybe your code just has less dependencies than mine :)
15:11 < mae> possibly :)
15:11 < mae> ok well another method would be
15:11 < mae> compile modules w/ out linking, and then use runghc
15:11 < mae> if linking is the major bottleneck
15:12 < Saizan_> ghc just uses ld
15:12 < mae> runghc ?
15:12 < dsrogers> if I must return an IO Maybe a, and I do a do { do { to use the Maybe monad, is it possible to do IO inside the Maybe monad?
15:12 < Saizan_> runghc uses the ghci linker
15:12 < mae> exactly
15:13 < mae> dsrogers: no..
15:13 < mae> unless you make Maybe a member of MonadIO i guess
15:13 < mae> and use liftIO
15:13 < Saizan_> you can't reasonably do that.
15:13 < mae> but i ddon't think its a good idea
15:13 < mae> Maybe an Instance of MonadIO is what i meant
15:14 < Saizan_> instance MonadIO Maybe where liftIO ioAction = ???
15:14 < Saizan_> you can only use unsafePerformIO or return undefined there
15:14 < mae> it just depends on what your trying to accomplisxh
15:14 < mae> if you want to turn an exception into Nothing
15:15 < mae> you can use fail
15:15 < mae> and then make the type be IO :: Maybe a
15:15 < mae> err
15:15 < mae> -> IO Maybe a
15:15 < mae> or IO Either a b
15:21  * mae <3's haskell
15:22 < mae> yeah linking is a slow bitch of a process
15:22 < mae> but wait
15:23 < mae> on subsequent links doesn't it cache ?
15:27 < rovar> is there a general strategy for comet?
15:27 < rovar> aka push over ajax
15:37 < mae> not yet
15:37 < mae> i mean
15:38 < mae> you tell me :)
15:38 < guenni> hi mae, no I'm back too, sry but there was free food, I never say no to that
15:38 < guenni> s/no/now
15:38 < mae> ok
15:39 < guenni> and thx for not letting happs rest in peace btw
15:39 < mae> yw :)
15:39 < mae> so what brings you to this fine irc channel on this beautiful day or night
15:40 < guenni> well I heard that this is the place where the hot guys hang out .....
15:40 < guenni> sry, fc
15:41 < guenni> well my main interest in IxSet, at this moment
15:41 < mae> neat, that is a area of code that needs some love
15:41 < mae> so whats up
15:41 < guenni> So I'm taking an interest in that
15:42 < guenni> well first of all I find the idea absolutely great, I'm surprised that no one came up with something like that before
15:42 < guenni> or expressed a need of it
15:43 < guenni> anyway I ran into trouble with stack overflows when I feed it large data, but I think I have a solution for that
15:44 < guenni> I will test it in the next few days and then submit it to the board for review and possible adaptation
15:44 < guenni> the board that's you :)
15:45 < guenni> and I believe I have already mentioned the problem I see with sets as the backend implementation ..
15:45 < guenni> are you still there?
15:46 < rovar> mae, I'll look into it, I'm almost done with my BSON/MongoDB stuff. So that's my next frontier.
15:46 < rovar> guenni, mae is narcoleptic
15:46 < rovar> guenni, was it you that posted to cafe?
15:47 < mae> guenni: yeah i'm here, i have seen people mentioning strictness issues before when using fold.. if there is an easy way to make this less of a pain then I am all for it
15:47 < mae> guenni: and as far as prototype goes, i am releasing 0.3 on april 4, so this would probably be a 0.4 candidate
15:47 < guenni> I believe there is
15:48 < guenni> the problem with strictness
15:48 < mae> You have my vote as long as it works, but I want at least another one of my contribs like Saizan or stepcut to take a look at it too before we accept it
15:48 < guenni> as I said once I tested it I will submit it for review
15:48 < mae> k
15:49 < guenni> rovar: guilty as charged
15:49 < mae> either submit the patch to the mailing list, or fork your own darcs repo and post your repo on the list (if your doing extensive development, the latter option is probably more efficient)
15:49 < wchogg> I'd be more than happy to look at it.  I've been thinking a lot about IxSet the past few days anyway.
15:49 < mae> then we can easily pull your patches
15:49 < mae> you can get free darcs hosting on patch-tag
15:49 < mae> wchogg: cool
15:50 < mae> yeah work with wchogg if you can
15:50 < rovar> it seems like a hot topic right now.. and it is part of Happstack's secret sauce, IMO
15:50 < mae> my time is always evaporating, but i will do my best to respond to emails asynchronously
15:50 < mae> ixset is nice :)
15:50 < guenni> well what I will submit is more a technique than ready to go code and a few explanations why I chose it
15:50 < mae> great :)
15:51 < guenni> rovar: what makes you say that?
15:51 < rovar> guenni: which part?
15:52 < guenni> rovar: *what* is the hot topic?
15:52 < rovar> ixset
15:52 < guenni> and what make you say that?
15:52 < rovar> there is a lot of talk on  #happs and #haskell, and cafe about it
15:52 < guenni> I mean I didn't discover anyone else but me that takes an interest
15:53 < guenni> strange, I must have missed that
15:53 < guenni> because all the recent posts originate from me
15:54 < rovar> everyone in #happs is interested, but it's not at the top of anyone's task list
15:54 < rovar> except yours now.
15:54 < guenni> :)
15:54 < guenni> mae: still there or asleep again?
15:55 < guenni> mae: I have one more question about IxSet
15:55 < wchogg> what's the question?
15:55 < guenni> it seems you were serious then with the narcoleptic
15:56 < guenni> wchogg: I had mailed him about Set as the actually backend being possibly a problem
15:57 < guenni> certainly when the whole thing is supposed to be a replacement for SQL databases
15:58 < guenni> brb: nicotine
16:02 < guenni> back
16:04 < wchogg> I'm not sure Set itself is the problem, but I know some of the fundamental methods in IxSet make use of toSet and fromSet, which is probably not the greatest.
16:05 < guenni> well I meant if I insert 2 identical values let's say 5 than there will only be one 5 in the set, right?
16:06 < guenni> wchogg: and when I then do something like a sum of the values in the set I will get 5 instead of 10, right?
16:06 < guenni> wchogg: and then, there is a problem large as life
16:08 < guenni> wchogg: so the new MultiSet might be a good alternative
16:08 < wchogg> Yes, glancing over the code I believe you're right about the behavior.
16:10 < guenni> I had posted this actually on the mailing list and got an answer where I can only presume the responder missed the point, the same goes for the second responder which happened to be mae, which is why I wanted to meet him here in the chat and ask him about it
17:22 < mae> guenni: i don't use ixset very much right now, so really i would love for some love to be given to it, but these discussions will probably be harder on chat with me personally since I find it hard to get on very often lately. but definitely there are others around which can talk to you about it, and like i said before, I will be able to give much more attention to you asynchronously via mailing list or email
17:23 < mae> guenni: what is the point that is missed? the fact that strictness should be default?
17:23 < guenni> no, the part about the short comings of using set, and welcome back
17:25 < mae> right
17:25 < mae> i saw that
17:25 < guenni> but?
17:25 < mae> i tend to think a set makes total sense for what ixset is doing
17:25 < mae> ixset is for indexes
17:25 < guenni> true it is
17:25 < guenni> but what about importing stuff from a RBDMS
17:25 < mae> well
17:26 < guenni> and *then* wanting to do sums
17:26 < mae> lets say you have [MyType]
17:26 < guenni> as an example
17:26 < guenni> ok
17:26 < mae> and you want to convert it into an IxSet instance to take advantage of easy searchability etc
17:27 < guenni> ok
17:27 < mae> so you use the fold technique
17:27 < mae> yeah ok so some fields might be duplicates, and this won't be reflected in the Maps that it creates
17:27 < guenni> ok
17:28 < mae> but how is that a "shortcoming" of ixset?
17:28 < mae> i'm talking a real high level btw
17:28 < mae> present your use case
17:28 < guenni> the set as the actual backend is the problem
17:29 < guenni> let's say I'm using a groupby which I actually do in this rl app
17:29 < guenni> one of the indexes
17:29 < guenni> and I want to do the sums of all elements in the set
17:29 < guenni> well one of the fields of my data
17:30 < guenni> then I get a different result if there happened to be 2 or more *identical* entries
17:30 < guenni> lets say my data is:
17:31 < guenni> [Example 23 99, Example 23 99]
17:31 < guenni> and I want a sum of the second field of the record
17:31 < guenni> which should be 46
17:31 < mae> ok
17:32 < guenni> well if thats stuffed into a set there will effectively be only one [Example 23 99]
17:32 < guenni> and the sum of that is 23
17:32 < guenni> *problem*
17:32 < mae> these are duplicate records
17:32 < guenni> yes
17:32 < mae> completely identical
17:32 < guenni> as can happen in rl
17:32 < mae> your saying you want to allow this?
17:32 < guenni> they are duplicate but not redundant
17:33 < guenni> I think using MultiSet instead of Set might be worth thinking about ...
17:34 < guenni> which in all honesty I have not fully checked out yet
17:34 < mae> ok so
17:34 < guenni> it was pointed out to me at the cafe list
17:34 < mae> duplicates..
17:34 < mae> i think this is not something that really belongs..
17:35 < mae> i mean, completely identical..
17:35 < guenni> yes, which are not necessarily the same thing as redundancies
17:35 < mae> if you want this you need something that is not identical
17:35 < mae> even databases require this
17:35 < mae> the best practice currently is to create a "id" column
17:35 < guenni> excuse me?
17:35 < mae> Integer
17:35 < mae> this would solve your problem in ixset
17:35 < guenni> yes, I know and I was going to do that
17:36 < guenni> it is just something users of IxSet might need to be made aware of
17:36 < mae> well i mean
17:36 < mae> there are database purists and database pragmatists
17:36 < mae> the purists say you should not use id in all cases
17:36 < guenni> as it can produce incorrect results which might go totally unnoticed
17:37 < mae> hmm incorrect results?
17:37 < guenni> mae, let's not argue about that point, let's just acknowldege that users might not be aware of this and thus have to take percaution
17:37 < mae> i mean, if you add a duplicate to the set, what happens currently?
17:37 < mae> it is silent right?
17:37 < guenni> it goes to /dev/null
17:38 < mae> silent
17:38 < mae> so perhaps what needs to happen is, when you are inserting, it needs to call fail
17:38 < mae> if you are inserting a duplicate
17:38 < mae> this can turn into an Either a b or a Maybe
17:39 < mae> this would solve the silent behavior wouldn't it?
17:39 < mae> and address your concern of unawareness
17:39 < guenni> well my main goal was to stress that this *is* a problem that users aren't aware of
17:40 < guenni> there are of course several options on the table to remedy this in one way or the other
17:40 < mae> right
17:40 < guenni> all of the above would do
17:40 < mae> well from my point of view, the main issue is that duplicates are silently accepted and thrown out
17:40 < mae> a user might expect that you have 2 items in the database now, but there is still only 1
17:40 < guenni> *bingo*
17:41 < guenni> glad we made it passed that stage :)
17:42 < guenni> brb, nikotine
17:46 < mae> guenni: ok so please, can you file this as a bug on the google code page? (see the website for a link)
17:47 < guenni> mae: ok, will do
17:48 < mae> mark it as 0.4 milestone
17:48 < guenni> may I suggest a remedy which I think might be the least invasive?
17:53 < mae> absolutely
17:53 < mae> put it in the bug report
17:55 < guenni> will do
17:55 < guenni> and thanks for listening
17:58 < mae> np
17:58 < mae> afk
20:14 < mae_> guys, let me know if the happstack command works for you still, i uploaded an update so that stepcuts changes work
--- Log closed Sun Mar 22 00:00:51 2009