Skip to content

Commit 2df2a51

Browse files
authored
Fix various warnings for dhall package (#2363)
1 parent 4687724 commit 2df2a51

File tree

13 files changed

+8
-22
lines changed

13 files changed

+8
-22
lines changed

.hlint.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
- ignore: {name: "Use ."}
3232
- ignore: {name: "Use list comprehension"}
3333
- ignore: {name: "Use fromMaybe"}
34+
- ignore: {name: "Avoid lambda using `infix`"}
35+
- ignore: {name: "Use tuple-section"}
36+
- ignore: {name: "Use <$>"}
37+
- ignore: {name: "Redundant <$>"}
38+
- ignore: {name: "Replace case with maybe"}
39+
- ignore: {name: "Replace case with fromMaybe"}
3440

3541

3642
# Specify additional command line arguments

dhall/src/Dhall.hs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
{-# LANGUAGE ApplicativeDo #-}
22
{-# LANGUAGE ConstraintKinds #-}
3-
{-# LANGUAGE DefaultSignatures #-}
4-
{-# LANGUAGE DeriveFunctor #-}
53
{-# LANGUAGE FlexibleContexts #-}
64
{-# LANGUAGE FlexibleInstances #-}
7-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
85
{-# LANGUAGE MultiParamTypeClasses #-}
9-
{-# LANGUAGE MultiWayIf #-}
106
{-# LANGUAGE OverloadedStrings #-}
117
{-# LANGUAGE PolyKinds #-}
128
{-# LANGUAGE RankNTypes #-}
139
{-# LANGUAGE RecordWildCards #-}
1410
{-# LANGUAGE ScopedTypeVariables #-}
15-
{-# LANGUAGE TupleSections #-}
16-
{-# LANGUAGE TypeApplications #-}
1711
{-# LANGUAGE TypeFamilies #-}
18-
{-# LANGUAGE TypeOperators #-}
1912
{-# LANGUAGE UndecidableInstances #-}
20-
{-# LANGUAGE ViewPatterns #-}
2113

2214
{-| Please read the "Dhall.Tutorial" module, which contains a tutorial explaining
2315
how to use the language, the compiler, and this library

dhall/src/Dhall/Deriving.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{-# LANGUAGE AllowAmbiguousTypes #-}
22
{-# LANGUAGE DataKinds #-}
33
{-# LANGUAGE FlexibleContexts #-}
4-
{-# LANGUAGE KindSignatures #-}
54
{-# LANGUAGE PolyKinds #-}
65
{-# LANGUAGE ScopedTypeVariables #-}
76
{-# LANGUAGE TypeApplications #-}

dhall/src/Dhall/Eval.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
{-# LANGUAGE UndecidableInstances #-}
1111
{-# LANGUAGE ViewPatterns #-}
1212

13-
{-# OPTIONS_GHC -O #-}
14-
1513
{-| Eval-apply environment machine with conversion checking and quoting to
1614
normal forms. Fairly similar to GHCI's STG machine algorithmically, but much
1715
simpler, with no known call optimization or environment trimming.

dhall/src/Dhall/Format.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{-# LANGUAGE LambdaCase #-}
2-
{-# LANGUAGE NamedFieldPuns #-}
31
{-# LANGUAGE OverloadedStrings #-}
42
{-# LANGUAGE RecordWildCards #-}
53

dhall/src/Dhall/Freeze.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE NamedFieldPuns #-}
21
{-# LANGUAGE OverloadedStrings #-}
32
{-# LANGUAGE RecordWildCards #-}
43
{-# LANGUAGE ViewPatterns #-}

dhall/src/Dhall/Import.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
{-# LANGUAGE RecordWildCards #-}
1010
{-# LANGUAGE ScopedTypeVariables #-}
1111
{-# LANGUAGE TypeApplications #-}
12-
{-# LANGUAGE ViewPatterns #-}
1312

1413
{-# OPTIONS_GHC -Wall #-}
1514

dhall/src/Dhall/Import/Types.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ instance Pretty Chained where
5050
pretty (Chained import_) = pretty import_
5151

5252
-- | An import that has been fully interpeted
53-
data ImportSemantics = ImportSemantics
53+
newtype ImportSemantics = ImportSemantics
5454
{ importSemantics :: Expr Void Void
5555
-- ^ The fully resolved import, typechecked and beta-normal.
5656
}

dhall/src/Dhall/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ parseMode =
361361
where
362362
-- Parse explicit stdin in the input filepaths
363363
parseStdin inputs
364-
| any (== InputFile "-") inputs = StandardInput : filter (/= InputFile "-") inputs
364+
| InputFile "-" `elem` inputs = StandardInput : filter (/= InputFile "-") inputs
365365
| otherwise = inputs
366366

367367
f = fromMaybe (pure StandardInput) . nonEmpty . parseStdin . fmap InputFile

dhall/src/Dhall/Marshal/Decode.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@
77
{-# LANGUAGE FlexibleInstances #-}
88
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
99
{-# LANGUAGE MultiParamTypeClasses #-}
10-
{-# LANGUAGE MultiWayIf #-}
1110
{-# LANGUAGE OverloadedStrings #-}
1211
{-# LANGUAGE PolyKinds #-}
1312
{-# LANGUAGE RankNTypes #-}
1413
{-# LANGUAGE RecordWildCards #-}
1514
{-# LANGUAGE ScopedTypeVariables #-}
1615
{-# LANGUAGE StandaloneDeriving #-}
17-
{-# LANGUAGE TupleSections #-}
1816
{-# LANGUAGE TypeApplications #-}
1917
{-# LANGUAGE TypeFamilies #-}
2018
{-# LANGUAGE TypeOperators #-}

dhall/src/Dhall/Schemas.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE DeriveAnyClass #-}
2-
{-# LANGUAGE OverloadedLists #-}
32
{-# LANGUAGE OverloadedStrings #-}
43
{-# LANGUAGE RecordWildCards #-}
54

dhall/src/Dhall/Syntax.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
{-# LANGUAGE DeriveLift #-}
55
{-# LANGUAGE DeriveTraversable #-}
66
{-# LANGUAGE DerivingStrategies #-}
7-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
87
{-# LANGUAGE LambdaCase #-}
98
{-# LANGUAGE OverloadedLists #-}
109
{-# LANGUAGE OverloadedStrings #-}

dhall/src/Dhall/Util.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{-# LANGUAGE NamedFieldPuns #-}
22
{-# LANGUAGE OverloadedStrings #-}
33
{-# LANGUAGE RecordWildCards #-}
4-
{-# LANGUAGE TypeApplications #-}
54

65
-- | Shared utility functions
76

0 commit comments

Comments
 (0)