From bc9e5b0ea863a17537987faa5a72b00efc7767d1 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 18 Jul 2022 22:09:58 -0400 Subject: Upgrade nixpkgs, ghc923 I ended up deleting miso, and consequently all files under Hero/ and Miso/, because I couldn't get miso to build with GHC 9.2. Other things: - Niv has been wrapped by Biz/Bild/Deps.hs, so I can extend it to my liking. - Apply-refact is gone because I couldn't get it to build. - Disabled python stuff. --- Biz/Dragons.hs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Biz/Dragons.hs') diff --git a/Biz/Dragons.hs b/Biz/Dragons.hs index 0a3583d..7307f69 100644 --- a/Biz/Dragons.hs +++ b/Biz/Dragons.hs @@ -540,9 +540,9 @@ data Keep = Keep $(deriveSafeCopy 0 'base ''Keep) createUser :: User -> Acid.Update Keep User -createUser u = do +createUser User {..} = do keep <- get - let newUser = u {userId = nextUserId keep} :: User + let newUser = User {userId = nextUserId keep, ..} put <| keep { users = IxSet.insert newUser (users keep), @@ -644,9 +644,10 @@ upsertGitHubUser keep tok ghUser = |> GetUserByGitHubId |> Acid.query keep +> \case - Just user -> + Just User {..} -> -- if we already know this user, we need to refresh the token - UpdateUser user {userGitHubToken = Encoding.decodeUtf8 tok} + User {userGitHubToken = Encoding.decodeUtf8 tok, ..} + |> UpdateUser |> Acid.update keep Nothing -> CreateUser @@ -1036,8 +1037,9 @@ htmlApp jwtCfg cooks kp cfg oAuthArgs = guardAuth >=> UserAccount .> App.Html .> pure, postAccount = \a subscription -> guardAuth a - +> \user -> - UpdateUser user {userSubscription = subscription} + +> \User {..} -> + User {userSubscription = subscription, ..} + |> UpdateUser |> Acid.update' kp +> UserAccount .> App.Html -- cgit v1.2.3