This module
module Foo (Foo, qux) where
data Foo = Foo {bla::Int}
qux :: Foo
qux = Foo 37
causes a warning when compiled with -Wall
:
/tmp/wtmpf-file12937.hs:3:17: warning: [-Wunused-top-binds]
Defined but not used: ‘bla’
|
3 | data Foo = Foo {bla::Int}
| ^^^
Ok – if bla
were just a standalone function, this would be easy and should be fixed by removing bla
. But for a record, the fields do more than just provide a name that can be used, they also serve as documentation in the code.
What is the preferred way to get rid of the warning?
It should be a permanent solution, should preferrably keep the record as-is, and preferrably not disable any warnings for the rest of the module.
_blah
– Seller