You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example shows getA as a weed if foo5 is not defined:
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NamedFieldPuns #-}
moduleMyLibwheredatafamilyDFadatainstanceDFInt=A{getA::Int}foo::DFInt->IO()
foo (A x) =print x
bar::DFInt->IO()
bar (A{getA}) =print getA
baz::DFInt->IO()
baz (A{..}) =print getA
foo2::Int->DFInt
foo2 x =A x
foo3::Int->DFInt
foo3 x =A { getA = x }
foo4::Int->DFInt->DFInt
foo4 x a = a { getA = x }
foo5::DFInt->Int
foo5 a = getA a
Note that if this is not a data family, the field is declared as used as soon as it is pattern-matched, without mentioning the actual field name. This shows no weeds
moduleMyLibwheredataA=A{getA::Int}foo::A->IO()
foo (A x) =print x
I'm using the following weeder.toml file, and an executable that uses all the functions available:
Type families
Weeder cannot yet analyse uses of type family instances. For this reason type family instances will be marked as implicit roots if analysis of types is enabled via unused-types.
However either I am misunderstanding that note, or these are not being marked as roots.
The text was updated successfully, but these errors were encountered:
ryndubei
added a commit
to ryndubei/weeder
that referenced
this issue
Jul 17, 2024
This example shows
getA
as a weed iffoo5
is not defined:Note that if this is not a data family, the field is declared as used as soon as it is pattern-matched, without mentioning the actual field name. This shows no weeds
I'm using the following
weeder.toml
file, and an executable that uses all the functions available:The readme says:
However either I am misunderstanding that note, or these are not being marked as roots.
The text was updated successfully, but these errors were encountered: