Skip to content

Commit 1fdf8b1

Browse files
committed
Predefine some root-instances for Weeder
This doesn’t yet turn off `type-class-roots`, because whitelisting all of those is a pain, but it pre-populates `root-instances` with instances that we would want to keep, even if unused.
1 parent 343364a commit 1fdf8b1

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

weeder.toml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,36 @@
66

77
## NB: The strings are triple-single-quoted to allow them to contain single quotes. It’s easier to be consistent than to
88
## special case each one.
9-
root-instances = []
9+
root-instances = [
10+
## Allow “negative” instances, which are necessarily unused.
11+
{ instance = '''^\((.* )?TypeError .*\) => .*''' },
12+
## Principled classes – even if we’re not using them, they have a single reasaonable implementation, and many of
13+
## them can be derived.
14+
##
15+
## NB: These classes aren’t always in the module you might expect, but it’s the canonical one.
16+
{ class = '''^Data\.Bifoldable\.Bifoldable$''' },
17+
{ class = '''^Data\.Bifunctor\.Bifunctor$''' },
18+
{ class = '''^Data\.Bitraversable\.Bitraversable$''' },
19+
{ class = '''^Data\.Foldable\.Foldable$''' },
20+
{ class = '''^Data\.Functor\.Classes\.Eq1$''' },
21+
{ class = '''^Data\.Functor\.Classes\.Eq2$''' },
22+
{ class = '''^Data\.Functor\.Classes\.Ord1$''' },
23+
{ class = '''^Data\.Functor\.Classes\.Ord2$''' },
24+
{ class = '''^Data\.Functor\.Classes\.Read1$''' },
25+
{ class = '''^Data\.Functor\.Classes\.Read2$''' },
26+
{ class = '''^Data\.Functor\.Classes\.Show1$''' },
27+
{ class = '''^Data\.Functor\.Classes\.Show2$''' },
28+
{ class = '''^Data\.Traversable\.Traversable$''' },
29+
{ class = '''^GHC\.Base\.Functor$''' },
30+
{ class = '''^GHC\.Base\.Monoid$''' },
31+
{ class = '''^GHC\.Classes\.Eq$''' },
32+
{ class = '''^GHC\.Classes\.Ord$''' },
33+
{ class = '''^GHC\.Generics\.Generic$''' },
34+
{ class = '''^GHC\.Generics\.Generic1$''' },
35+
{ class = '''^GHC\.Read\.Read$''' },
36+
{ class = '''^GHC\.Show\.Show$''' },
37+
{ class = '''^GHC\Base\.Semigroup$''' },
38+
]
1039
roots = [
1140
'''^Main\.main$''',
1241
'''^Paths_.*$''',

0 commit comments

Comments
 (0)