Skip to content

Commit fdc5f2d

Browse files
committed
hlint
1 parent 6da2784 commit fdc5f2d

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

unicode-data-security/bench/Main.hs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,27 @@ main = defaultMain
2222
[ benchNF "isAllowedInIdentifier" Security.isAllowedInIdentifier
2323
]
2424
, bgroup "Identifier Types"
25-
[ benchNF "identifierTypes" (fmap fromEnum . Security.identifierTypes)
25+
[ benchNF "identifierTypes" (fmap fromEnum . Security.identifierTypes)
2626
]
2727
, bgroup "Confusables"
2828
[ bgroup' "confusablePrototype"
29-
[ Bench "CString" (\c -> Ptr (Confusables.confusablePrototype c))
29+
[ Bench "CString" confusablePrototype
3030
, Bench "String" Security.confusablePrototype
3131
]
3232
-- , benchNF "prototype" Security.prototype
3333
, bgroup' "intentionalConfusables"
34-
[ Bench "CString" (\c -> Ptr (Confusables.intentionalConfusables c))
34+
[ Bench "CString" intentionalConfusables
3535
, Bench "String" Security.intentionalConfusables
3636
]
3737
, benchNF "isIntentionallyConfusable" Security.intentionalConfusables
3838
]
3939
]
4040
]
4141
where
42+
-- [NOTE] Cannot use point-free because of unlifted types
43+
confusablePrototype c = Ptr (Confusables.confusablePrototype c)
44+
intentionalConfusables c = Ptr (Confusables.intentionalConfusables c)
45+
4246
bgroup' groupTitle bs = bgroup groupTitle
4347
[ benchNF' groupTitle title f
4448
| Bench title f <- bs

unicode-data-security/test/Unicode/Char/Identifiers/SecuritySpec.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ spec = do
5858
-- [TODO] more invariants
5959
traverse_ check (enumFromTo minBound maxBound)
6060
it "Identifier status is consistent with identifier types" do
61-
let checkChar c = all (== isAllowedInIdentifier c)
62-
(isIdentifierTypeAllowed <$> identifierTypes c)
61+
let checkChar c = all ((== isAllowedInIdentifier c) . isIdentifierTypeAllowed)
62+
(identifierTypes c)
6363
traverse_ (`shouldSatisfy` checkChar) (enumFromTo minBound maxBound)

unicode-data/lib/Unicode/Char/General/Blocks.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
{-# LANGUAGE PatternSynonyms #-}
2-
{-# LANGUAGE ViewPatterns #-}
3-
{-# LANGUAGE DeriveGeneric #-}
4-
51
-- |
62
-- Module : Unicode.Char.General.Blocks
73
-- Copyright : (c) 2020 Composewell Technologies and Contributors

0 commit comments

Comments
 (0)