Skip to content

Commit 954c402

Browse files
committed
Bump fourmolu version to 0.18.0.0 in the nix shell
1 parent 6c7d7cb commit 954c402

File tree

4 files changed

+70
-35
lines changed

4 files changed

+70
-35
lines changed

flake.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nickel.lock.ncl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
organist = import "/nix/store/7zrf2b1ysrgrx7613qlmbz71cfyxgyfb-source/lib/organist.ncl",
2+
organist = import "/nix/store/fjxrgrx0s69m5vkss5ff1i5akjcx39ss-source/lib/organist.ncl",
33
}

project.ncl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
let inputs = import "./nickel.lock.ncl" in
22
let organist = inputs.organist in
33

4-
let import_hs = fun ghcver pkgname =>
5-
organist.import_nix "nixpkgs#haskell.packages.%{ghcver}.%{pkgname}"
4+
let
5+
import_hs = fun ghcver pkgname =>
6+
organist.import_nix "nixpkgs#haskell.packages.%{ghcver}.%{pkgname}"
67
in
78
let shellFor = fun ghcver =>
89
let hspkg = import_hs ghcver in {
910
packages = {
1011
haskell-language-server = hspkg "haskell-language-server",
11-
fourmolu = hspkg "fourmolu",
12+
fourmolu = organist.import_nix "nixpkgs#haskell.packages.ghc912.fourmolu",
1213
ghc = organist.import_nix "nixpkgs#haskell.compiler.%{ghcver}",
1314
cabal-install = hspkg "cabal-install",
1415
cabal-fmt = hspkg "cabal-fmt",
@@ -24,7 +25,7 @@ let shellFor = fun ghcver =>
2425
packages = {},
2526
},
2627

27-
shells.dev = shellFor "ghc964",
28+
shells.dev = shellFor "ghc910",
2829
}
2930
}
3031
| organist.OrganistExpression

src/Codec/CBOR/Cuddle/CBOR/Validator.hs

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ validateCBOR' bs rule cddl@(CTreeRoot tree) =
145145
-- spec
146146
validateTerm ::
147147
MonadReader CDDL m =>
148-
Term -> Rule -> m CBORTermResult
148+
Term ->
149+
Rule ->
150+
m CBORTermResult
149151
validateTerm term rule =
150152
let f = case term of
151153
TInt i -> validateInteger (fromIntegral i)
@@ -183,7 +185,9 @@ validateTerm term rule =
183185
-- Ints, so we convert everything to Integer.
184186
validateInteger ::
185187
MonadReader CDDL m =>
186-
Integer -> Rule -> m CDDLResult
188+
Integer ->
189+
Rule ->
190+
m CDDLResult
187191
validateInteger i rule =
188192
($ rule) <$> do
189193
getRule rule >>= \case
@@ -308,7 +312,9 @@ controlInteger i Ne ctrl =
308312
-- | Validating a `Float16`
309313
validateHalf ::
310314
MonadReader CDDL m =>
311-
Float -> Rule -> m CDDLResult
315+
Float ->
316+
Rule ->
317+
m CDDLResult
312318
validateHalf f rule =
313319
($ rule) <$> do
314320
getRule rule >>= \case
@@ -343,7 +349,9 @@ controlHalf f Ne ctrl =
343349
-- | Validating a `Float32`
344350
validateFloat ::
345351
MonadReader CDDL m =>
346-
Float -> Rule -> m CDDLResult
352+
Float ->
353+
Rule ->
354+
m CDDLResult
347355
validateFloat f rule =
348356
($ rule) <$> do
349357
getRule rule >>= \case
@@ -383,7 +391,9 @@ controlFloat f Ne ctrl =
383391
-- | Validating a `Float64`
384392
validateDouble ::
385393
MonadReader CDDL m =>
386-
Double -> Rule -> m CDDLResult
394+
Double ->
395+
Rule ->
396+
m CDDLResult
387397
validateDouble f rule =
388398
($ rule) <$> do
389399
getRule rule >>= \case
@@ -430,7 +440,9 @@ controlDouble f Ne ctrl =
430440
-- | Validating a boolean
431441
validateBool ::
432442
MonadReader CDDL m =>
433-
Bool -> Rule -> m CDDLResult
443+
Bool ->
444+
Rule ->
445+
m CDDLResult
434446
validateBool b rule =
435447
($ rule) <$> do
436448
getRule rule >>= \case
@@ -463,7 +475,9 @@ controlBool b Ne ctrl =
463475
-- | Validating a `TSimple`. It is unclear if this is used for anything else than undefined.
464476
validateSimple ::
465477
MonadReader CDDL m =>
466-
Word8 -> Rule -> m CDDLResult
478+
Word8 ->
479+
Rule ->
480+
m CDDLResult
467481
validateSimple 23 rule =
468482
($ rule) <$> do
469483
getRule rule >>= \case
@@ -498,7 +512,9 @@ validateNull rule =
498512
-- | Validating a byte sequence
499513
validateBytes ::
500514
MonadReader CDDL m =>
501-
BS.ByteString -> Rule -> m CDDLResult
515+
BS.ByteString ->
516+
Rule ->
517+
m CDDLResult
502518
validateBytes bs rule =
503519
($ rule) <$> do
504520
getRule rule >>= \case
@@ -517,7 +533,11 @@ validateBytes bs rule =
517533
-- | Controls for byte strings
518534
controlBytes ::
519535
forall m.
520-
MonadReader CDDL m => BS.ByteString -> CtlOp -> Rule -> m (Either (Maybe CBORTermResult) ())
536+
MonadReader CDDL m =>
537+
BS.ByteString ->
538+
CtlOp ->
539+
Rule ->
540+
m (Either (Maybe CBORTermResult) ())
521541
controlBytes bs Size ctrl =
522542
getRule ctrl >>= \case
523543
Literal (Value (VUInt (fromIntegral -> sz)) _) -> pure $ boolCtrl $ BS.length bs == sz
@@ -568,7 +588,9 @@ controlBytes bs Cborseq ctrl =
568588
-- | Validating text strings
569589
validateText ::
570590
MonadReader CDDL m =>
571-
T.Text -> Rule -> m CDDLResult
591+
T.Text ->
592+
Rule ->
593+
m CDDLResult
572594
validateText txt rule =
573595
($ rule) <$> do
574596
getRule rule >>= \case
@@ -607,7 +629,10 @@ controlText s Regexp ctrl =
607629
-- | Validating a `TTagged`
608630
validateTagged ::
609631
MonadReader CDDL m =>
610-
Word64 -> Term -> Rule -> m CDDLResult
632+
Word64 ->
633+
Term ->
634+
Rule ->
635+
m CDDLResult
611636
validateTagged tag term rule =
612637
($ rule) <$> do
613638
getRule rule >>= \case
@@ -725,7 +750,9 @@ isOptional rule =
725750
validateListWithExpandedRules ::
726751
forall m.
727752
MonadReader CDDL m =>
728-
[Term] -> [Rule] -> m [(Rule, CBORTermResult)]
753+
[Term] ->
754+
[Rule] ->
755+
m [(Rule, CBORTermResult)]
729756
validateListWithExpandedRules terms rules =
730757
go (zip terms rules)
731758
where
@@ -795,7 +822,9 @@ validateList terms rule =
795822
validateMapWithExpandedRules ::
796823
forall m.
797824
MonadReader CDDL m =>
798-
[(Term, Term)] -> [Rule] -> m ([AMatchedItem], Maybe ANonMatchedItem)
825+
[(Term, Term)] ->
826+
[Rule] ->
827+
m ([AMatchedItem], Maybe ANonMatchedItem)
799828
validateMapWithExpandedRules =
800829
go
801830
where
@@ -853,7 +882,9 @@ validateExpandedMap terms rules = go rules
853882

854883
validateMap ::
855884
MonadReader CDDL m =>
856-
[(Term, Term)] -> Rule -> m CDDLResult
885+
[(Term, Term)] ->
886+
Rule ->
887+
m CDDLResult
857888
validateMap terms rule =
858889
($ rule) <$> do
859890
getRule rule >>= \case
@@ -899,7 +930,10 @@ dummyRule = MRuleRef (Name "dummy" mempty)
899930
-- | Validate both rules
900931
ctrlAnd ::
901932
Monad m =>
902-
(Rule -> m CDDLResult) -> Rule -> Rule -> m (Rule -> CDDLResult)
933+
(Rule -> m CDDLResult) ->
934+
Rule ->
935+
Rule ->
936+
m (Rule -> CDDLResult)
903937
ctrlAnd v tgt ctrl =
904938
v tgt >>= \case
905939
Valid _ ->

0 commit comments

Comments
 (0)