00:04:49 <stepkut> kxra: any idea what's up with this, rejecting: clckwrks-cli-0.2.7, 0.2.6 (global constraint requires ==0.2.5)
00:05:01 <stepkut> what global constrait would force it to use an old version of clckwrks-cli?
00:06:24 <stepkut> kxra: try, runhaskell Setup.hs configure --user
00:06:31 <stepkut> see if it produces a more useful error
05:42:04 <kxra> stepkut: Setup.hs: At least the following dependencies are missing:
05:42:06 <kxra> clckwrks >=0.12 && <0.18, haskeline ==0.7.*
12:10:37 <stepkut> kxra: oh. it seems I only pushed the patches to clckwrks-dev and not clckwrks. fixed.
12:10:44 <stepkut> I should also upload new versions to hackage
14:47:57 <kxra> stepkut: cool, and it should fick the error i just sent, too?
15:23:41 <kxra> ACTION will find out soon enough
15:43:43 <kxra> success!
15:52:47 <donri> great success
18:28:09 <kxra> stepkut: did you decide if the last part of 6d in "getting started" was out of date, or whether that was a bug in example.org?
18:28:12 <kxra> http://clckwrks.com/page/view-page-slug/3/get-started
18:31:17 <stepcut> I dunno :)
18:31:44 <stepcut> in theory what the getting started guide is what we want, but I am not sure what prompted me to make that change locally and then accidentally commit it
18:36:55 <jonkri> Why do I get an acid-state message saying "Data.Acid: Invalid subtype cast: RemoteState -> LocalState"? I have an acid-state "server" that opens a local state and does "acidServer acid (UnixSocket "socket")". Clients then connect to the server using "openRemoteState "" (UnixSocket "socket")". Anyone?
18:37:53 <kxra> stepcut: hm. should i un-comment that line?
18:37:57 <kxra> will it work if i don't?
18:39:17 <stepcut> jonkri: which sides spits out that error ?
18:39:34 <jonkri> stepcut: The clients.
18:39:51 <stepcut> kxra: well.. you only need one of those lines.. one just uses PackageImports so that it knows which package to get Theme from, since that module could appear in multiple libraries..
18:40:06 <stepcut> kxra: when building via cabal, it doesn't matter, but for loading into GHCi it could
18:40:23 <kxra> so i can just leave it commented out, and it should get the theme from elsewhere?
18:40:29 <stepcut> jonkri: the error happens as a result of the call to openRemoteState ?
18:40:48 <kxra> welp, i'll try it
18:41:04 <jonkri> stepcut: All I know is that I get the error when I run this code: main = bracket (openRemoteState "" (UnixSocket "socket")) (createCheckpointAndClose) (\acid -> query' acid AcidMyTest >>= \output -> liftIO (print output))
18:41:28 <stepcut> kxra: it will get the Theme module from some clckwrks-theme-package that is in scope..
18:41:49 <stepcut> jonkri: what version of acid-state ?
18:41:52 <kxra> so it could just use any one? confusing
18:41:56 <kxra> i guess i'll uncomment the line
18:42:26 <jonkri> stepcut: I don't know. Doing "cabal-dev update" now.
18:42:48 <jonkri> >= 0.8 is specified in my Cabal file.
18:42:56 <jonkri> I will set it to the latest.
18:43:38 <stepcut> kxra: yes and no. It is capable with any theme package -- generally you select one by specifying the one you want in the .cabal file. However, ghci does not usually read the .cabal file. If there is only one theme package available, then ghci will use that theme package, if there are multiple theme packages available it will complain
18:44:10 <jonkri> Oh, I had capped it to 0.8.3. :-> I will try with the latest.
18:44:14 <stepcut> jonkri: in acid-state < 0.12.0, you can not call createCheckpointAndClose on a remote acid state -- it is the server that gets to decide when to create a checkpoint, not the client. You would just use a normal close
18:44:34 <stepcut> jonkri: ah.. for remote stuff, you definitely want something newer.. there has been a lot of work on it
18:44:51 <stepcut> I think in 0.12.0 the remote client might be able to create a checkpoint as well
18:44:53 <kxra> huh, Warning: 'license: AGPLv3' is not a recognised license. The known licenses
18:45:10 <stepcut> kxra: what package has that license?
18:45:24 <jonkri> stepcut: Ah, thanks for that. What's a normal close?
18:45:36 <kxra> stepcut: i was trying to use it for myself
18:45:47 <stepcut> kxra: trying changing it to BSD3 ;)
18:45:52 <kxra> i guess the standard format is AGPL-3 not v3, but either way it isn't recognized
18:46:17 <jonkri> closeAcidState?
18:46:21 <kxra> stepcut: hah, i'm a copyleft person for my own projects
18:46:21 <stepcut> jonkri: yes
18:46:24 <jonkri> Thanks!
18:46:54 <kxra> stepcut: is it cabal that doesn't recognize AGPL, or is it another package that handles that?
18:47:22 <stepcut> kxra: i dunno.. I've only tried using BSD3
19:00:04 <kxra> stepcut: can i run more than one clckwrks instance at once?
19:00:17 <kxra> seems like clckwrks-cli might get confused if i tried
19:00:19 <stepcut> kxra: yup, on different ports
19:00:23 <kxra> ahh, i see
19:00:33 <stepcut> no, clckwrks-cli requires that you give it a path to the socket file
19:01:14 <stepcut> you need to run the instances on different ports and with different directories for the state files, etc
19:01:21 <stepcut> there are command-line flags for that
19:01:48 <stepcut> the server running happstack.com and clciwrks.com is running 4 different clckwrks instances at once
19:02:15 <kxra> ah, cool [=
19:10:11 <jonkri> Anyone seen this error with acid-state before? SerializeError "too few bytes\nFrom:\tdemandInput\n\n"
19:21:02 <stepcut> jonkri: all the time.. usually if you change your type with out bumping the version and providing a migration instance
19:21:18 <jonkri> Okay, cool! Thanks!
19:21:23 <stepcut> jonkri: or if you change the arguments to an update method but don't restore from a checkpoint
19:21:46 <jonkri> stepcut: Ah, that was the one that caused it for me, I think.
19:21:52 <stepcut> and, yes, it would be nice if the error  message was more informative
19:22:10 <jonkri> Yeah.
19:55:00 <jonkri> stepcut: I have the database that I described above with two clients. I don't recompile my program, but I get those errors anyway.
19:55:07 <jonkri> I create the server like this: bracket (openLocalState myDefaultState) (createCheckpointAndClose) (\acid -> acidServer (\_ -> return True) (UnixSocket "socket") acid)
19:56:08 <stepcut> and when do you get that error?
19:58:01 <jonkri> This is the server: bracket (openRemoteState (\_ -> return ()) "" (UnixSocket "socket")) closeAcidState (\acid -> query' acid AcidMyTest >>= \output -> liftIO (print output))
19:58:09 <jonkri> Client, I mean.
19:58:40 <jonkri> It seem to be caused by an Update function.
19:58:57 <jonkri> After re-compiling, I did "rm socket; rm -R state". Is that enough?
20:06:15 <jonkri> Correction: It happens with just a Query.
20:07:11 <jonkri> And the one client that I pasted above.
20:07:22 <jonkri> Could it be that the clients should not closeAcidState after all?
20:30:59 <jonkri> Do I need to create checkpoints manually?
20:52:27 <donri> kxra: AGPL is new in a recent cabal, what version you on?
20:53:10 <donri> kxra: in fact it's new in .18, the latest
20:54:51 <donri> kxra: i don't think anything much worse than a warning happens for unknown licenses, though
21:07:19 <jonkri> stepcut: I think I figured it out. I used unsafePerformIO to call newStdGen in my query, which seemed to cause the function to go into some kind of loop.
21:07:41 <donri> jonkri: oh dear
21:08:25 <donri> jonkri: acid-state relies on transactions to be pure to work correctly
21:09:05 <jonkri> Why does this interfere?
21:09:10 <donri> jonkri: imagine what happens if you open a log without a checkpoint; you now get a new random seed
21:09:11 <jonkri> I have to randomize and identifier and make sure that it's unique before I insert it into the acid-state database. How can I do that?
21:09:26 <jonkri> Ouch. :->
21:09:28 <donri> jonkri: instead track the seed in the state and include it in your initial state
21:09:50 <jonkri> Thanks.
21:10:59 <donri> main = do s <- newStdGen; acid <- openLocalState (MyState { seed = s, awesomePosts = [] })
21:11:02 <donri> etc
21:11:21 <jonkri> Thanks. :-)
21:11:59 <donri> jonkri: but why do you feel you need random identifiers with acid-state?
21:13:32 <jonkri> They are exposed, and should have a certain format while not being ordered.
21:13:48 <donri> i suppose if you have multiple independent states that still need identifiers unique globally for every state...
21:14:32 <donri> jonkri: hashable might work for you
21:16:38 <jonkri> Thanks.
21:29:50 <jonkri> How do I track the seed with System.Random?
21:30:38 <jonkri> Generate a new Int every time?
21:33:42 <donri> jonkri: randomUpdate = do g <- gets randomGen; let (a,g') = random g; put (\s -> s { randomGen = g' }); return a
21:33:47 <donri> something like that
21:33:53 <donri> where randomGen is a field in your state
21:34:05 <donri> (lenses would make this suck less, as always with acid-state transactions)
21:34:43 <donri> then you use randomUpdate in your Update transactions (but you don't makeAcidic ['randomUpdate])
21:39:03 <jonkri> Thanks!
21:41:06 <donri> :t state random
21:41:07 <lambdabot> (MonadState s m, RandomGen s, Random a) => m a
21:41:16 <donri> might also be able to use that somehow
21:41:24 <donri> maybe with a lens zoom :)
21:42:15 <donri> :t zoom _1 $ state random
21:42:16 <lambdabot> (Functor (Control.Lens.Internal.Zoom.Zoomed n c), Zoom m n b t, Field1 t t b b, RandomGen b, Random c) => n c
21:42:55 <donri> scary type, but in theory that should be the same as randomUpdate where the state is a tuple
21:44:12 <donri> randomU = zoom randomGen $ state random
21:48:54 <jonkri> Good night!
21:51:00 <donri> > let rand = zoom _1 (state random) in evalState ((,,) <$> rand <*> rand <*> rand) (mkStdGen minBound,x)
21:51:02 <lambdabot>   Ambiguous occurrence `x'
21:51:02 <lambdabot>  It could refer to either `L.x', defined at L.hs:1...
21:51:08 <donri> > let rand = zoom _1 (state random) in evalState ((,,) <$> rand <*> rand <*> rand) (mkStdGen minBound,'x')
21:51:09 <lambdabot>   (2092838931,-2143208520,2034827062)
21:51:12 <donri> ^_^
22:33:47 <kxra> i can't tell if i didn't configure my domain's zone file properly, or if the DNS is just slow to update
22:34:04 <kxra> but i'm using google's now, which is supposed to be instant, and it still just shows the domain as parked