Skip to content

Commit aa4635a

Browse files
committed
Use -XDeriveFunctor for data InstallDirs
1 parent 04e0ac4 commit aa4635a

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

Cabal/Distribution/Simple/InstallDirs.hs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE CPP #-}
22
{-# LANGUAGE ForeignFunctionInterface #-}
3+
{-# LANGUAGE DeriveFunctor #-}
34
{-# LANGUAGE DeriveGeneric #-}
45

56
-----------------------------------------------------------------------------
@@ -90,28 +91,10 @@ data InstallDirs dir = InstallDirs {
9091
htmldir :: dir,
9192
haddockdir :: dir,
9293
sysconfdir :: dir
93-
} deriving (Eq, Read, Show, Generic)
94+
} deriving (Eq, Read, Show, Functor, Generic)
9495

9596
instance Binary dir => Binary (InstallDirs dir)
9697

97-
instance Functor InstallDirs where
98-
fmap f dirs = InstallDirs {
99-
prefix = f (prefix dirs),
100-
bindir = f (bindir dirs),
101-
libdir = f (libdir dirs),
102-
libsubdir = f (libsubdir dirs),
103-
dynlibdir = f (dynlibdir dirs),
104-
libexecdir = f (libexecdir dirs),
105-
includedir = f (includedir dirs),
106-
datadir = f (datadir dirs),
107-
datasubdir = f (datasubdir dirs),
108-
docdir = f (docdir dirs),
109-
mandir = f (mandir dirs),
110-
htmldir = f (htmldir dirs),
111-
haddockdir = f (haddockdir dirs),
112-
sysconfdir = f (sysconfdir dirs)
113-
}
114-
11598
instance (Semigroup dir, Monoid dir) => Monoid (InstallDirs dir) where
11699
mempty = gmempty
117100
mappend = (Semi.<>)

0 commit comments

Comments
 (0)