Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(nix): Bump dependencies. #219

Merged
merged 3 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 62 additions & 38 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,17 @@
# we're using.
haskellNixTools = pkgs.haskell-nix.tools ghcVersion {
hlint = "latest";
fourmolu = "latest";
cabal-fmt = "latest";

# https://github.com/input-output-hk/haskell.nix/issues/1337
fourmolu = {
version = "latest";
modules = [
({ lib, ... }: {
options.nonReinstallablePkgs = lib.mkOption { apply = lib.remove "Cabal"; };
})
];
};
};
in
pre-commit-hooks-nix.lib.${system}.run {
Expand Down Expand Up @@ -313,7 +322,17 @@
haskell-language-server = "latest";
cabal = "latest";
hlint = "latest";
fourmolu = "latest";

# https://github.com/input-output-hk/haskell.nix/issues/1337
fourmolu = {
version = "latest";
modules = [
({ lib, ... }: {
options.nonReinstallablePkgs = lib.mkOption { apply = lib.remove "Cabal"; };
})
];
};

cabal-edit = "latest";
cabal-fmt = "latest";
#TODO Explicitly requiring tasty-discover shouldn't be necessary - see the commented-out `build-tool-depends` in primer.cabal.
Expand Down
34 changes: 17 additions & 17 deletions primer-selda/src/Primer/Database/Selda.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@ import Primer.Database (
-- consisting of the session's 'App', the git version of Primer that
-- last updated it, and the session's name.
data SessionRow = SessionRow
{ -- | The session's UUID.
uuid :: UUID
, -- | Primer's git version. We would prefer that this were a git
-- rev, but for technical reasons, it may also be a last-modified
-- date.
gitversion :: Version
, -- | The session's 'App'. Note that the 'App' is serialized to
-- JSON before being stored as a bytestring in the database.
app :: BL.ByteString
, -- | The session's name.
--
-- This should be of type 'SessionName', but Selda doesn't make it
-- particularly easy to derive @SqlType@ from a newtype wrapper
-- around 'Text', so rather than copy-pasting the 'Text' instance,
-- we just convert back to 'Text' before serializing to the
-- database.
name :: Text
{ uuid :: UUID
-- ^ The session's UUID.
, gitversion :: Version
-- ^ Primer's git version. We would prefer that this were a git
-- rev, but for technical reasons, it may also be a last-modified
-- date.
, app :: BL.ByteString
-- ^ The session's 'App'. Note that the 'App' is serialized to
-- JSON before being stored as a bytestring in the database.
, name :: Text
-- ^ The session's name.
--
-- This should be of type 'SessionName', but Selda doesn't make it
-- particularly easy to derive @SqlType@ from a newtype wrapper
-- around 'Text', so rather than copy-pasting the 'Text' instance,
-- we just convert back to 'Text' before serializing to the
-- database.
}
deriving (Generic)

Expand Down
8 changes: 4 additions & 4 deletions primer-service/src/Primer/Pagination.hs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ type PP api =
:> api

data Pagination = Pagination
{ -- | Defaults to @1@ if not given in the query parameters
page :: Positive
, -- | Does not default, since there is no default that would work for all cases
size :: Maybe Positive
{ page :: Positive
-- ^ Defaults to @1@ if not given in the query parameters
, size :: Maybe Positive
-- ^ Does not default, since there is no default that would work for all cases
}

instance
Expand Down
12 changes: 6 additions & 6 deletions primer/src/Primer/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,12 @@ instance ToJSON Tree
data Prog = Prog
{ types :: [Name]
, -- We don't use Map ID Def, as the JSON encoding would be as an object,
-- where keys are IDs converted to strings and we have no nice way of
-- saying "all the keys of this object should parse as numbers". Similarly,
-- it is rather redundant as each Def carries a defID field (which is
-- encoded as a number), and it is difficult to enforce that "the keys of
-- this object match the defID field of the corresponding value".
defs :: [Def]
-- where keys are IDs converted to strings and we have no nice way of
-- saying "all the keys of this object should parse as numbers". Similarly,
-- it is rather redundant as each Def carries a defID field (which is
-- encoded as a number), and it is difficult to enforce that "the keys of
-- this object match the defID field of the corresponding value".
defs :: [Def]
}
deriving (Generic)

Expand Down
48 changes: 24 additions & 24 deletions primer/src/Primer/Action.hs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ data OfferedAction a = OfferedAction
, description :: Text
, input :: ActionInput a
, priority :: Int
, -- | Used primarily for display purposes.
actionType :: ActionType
, actionType :: ActionType
-- ^ Used primarily for display purposes.
}
deriving (Functor)

Expand Down Expand Up @@ -599,7 +599,7 @@ moveExpr m@(Branch c) z | Case _ _ brs <- target z =
moveExpr m@(Branch _) _ = throwError $ CustomFailure (Move m) "Move-to-branch failed: this is not a case expression"
moveExpr Child2 z
| Case{} <- target z =
throwError $ CustomFailure (Move Child2) "cannot move to 'Child2' of a case: use Branch instead"
throwError $ CustomFailure (Move Child2) "cannot move to 'Child2' of a case: use Branch instead"
moveExpr m z = move m z

-- | Apply a movement to a zipper
Expand Down Expand Up @@ -914,11 +914,11 @@ renameLam y ze = case target ze of
Lam m x e
| unName x == y -> pure ze
| otherwise -> do
let y' = unsafeMkName y
case renameVar x y' e of
Just e' -> pure $ replace (Lam m y' e') ze
Nothing ->
throwError NameCapture
let y' = unsafeMkName y
case renameVar x y' e of
Just e' -> pure $ replace (Lam m y' e') ze
Nothing ->
throwError NameCapture
_ ->
throwError $ CustomFailure (RenameLam y) "the focused expression is not a lambda"

Expand All @@ -928,11 +928,11 @@ renameLAM b ze = case target ze of
LAM m a e
| unName a == b -> pure ze
| otherwise -> do
let b' = unsafeMkName b
case renameTyVarExpr a b' e of
Just e' -> pure $ replace (LAM m b' e') ze
Nothing ->
throwError NameCapture
let b' = unsafeMkName b
case renameTyVarExpr a b' e of
Just e' -> pure $ replace (LAM m b' e') ze
Nothing ->
throwError NameCapture
_ ->
throwError $ CustomFailure (RenameLAM b) "the focused expression is not a type abstraction"

Expand All @@ -942,15 +942,15 @@ renameLet y ze = case target ze of
Let m x e1 e2
| unName x == y -> pure ze
| otherwise -> do
let y' = unsafeMkName y
(e1', e2') <- doRename x y' e1 e2
pure $ replace (Let m y' e1' e2') ze
let y' = unsafeMkName y
(e1', e2') <- doRename x y' e1 e2
pure $ replace (Let m y' e1' e2') ze
Letrec m x e1 t1 e2
| unName x == y -> pure ze
| otherwise -> do
let y' = unsafeMkName y
(e1', e2') <- doRename x y' e1 e2
pure $ replace (Letrec m y' e1' t1 e2') ze
let y' = unsafeMkName y
(e1', e2') <- doRename x y' e1 e2
pure $ replace (Letrec m y' e1' t1 e2') ze
_ ->
throwError $ CustomFailure (RenameLet y) "the focused expression is not a let"
where
Expand Down Expand Up @@ -1028,10 +1028,10 @@ renameForall b zt = case target zt of
TForall m a k t
| unName a == b -> pure zt
| otherwise -> do
let b' = unsafeMkName b
case renameTyVar a b' t of
Just t' -> pure $ replace (TForall m b' k t') zt
Nothing ->
throwError NameCapture
let b' = unsafeMkName b
case renameTyVar a b' t of
Just t' -> pure $ replace (TForall m b' k t') zt
Nothing ->
throwError NameCapture
_ ->
throwError $ CustomFailure (RenameForall b) "the focused expression is not a forall type"
Loading