Skip to content

Commit 77ad814

Browse files
Merge pull request #163 from aloussase/master
feat: Add Default instance for Config
2 parents d3d7953 + 74dd193 commit 77ad814

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

dotenv.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ library
9898
, text
9999
, exceptions >= 0.8 && < 0.11
100100
, mtl >= 2.2.2 && < 2.4
101+
, data-default-class >= 0.1.2 && < 0.2
101102

102103
hs-source-dirs: src
103104
ghc-options: -Wall
@@ -134,6 +135,7 @@ test-suite dotenv-test
134135
, exceptions >= 0.8 && < 0.11
135136
, hspec-megaparsec >= 2.0 && < 3.0
136137
, mtl
138+
, data-default-class >= 0.1.2 && < 0.2
137139

138140
build-tools: hspec-discover >= 2.0 && < 3.0
139141

src/Configuration/Dotenv/Types.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ module Configuration.Dotenv.Types
1515
)
1616
where
1717

18+
import Data.Default.Class
19+
1820
-- | Configuration Data Types with extra options for executing dotenv.
1921
data Config = Config
2022
{ configPath :: [FilePath] -- ^ The paths for the .env files
@@ -35,3 +37,5 @@ defaultConfig =
3537
, configVerbose = False
3638
, allowDuplicates = True
3739
}
40+
41+
instance Default Config where def = defaultConfig

0 commit comments

Comments
 (0)