Skip to content

Warning when using predicate pattern #4

@momohatt

Description

@momohatt

When compiling the latest Egison, which uses sweet-egison, we get the following warnings.
It seems that the use of predicate patterns causes them.
It'd be nice if we can remove these warnings by avoiding generating unnecessary temporary variables.

/Users/momohatt/egison/egison/hs-src/Language/Egison/Math/Rewrite.hs:57:13: warning: [-Wunused-local-binds] Defined but not used: ‘tmpM’ | 57 | [ [mc| (symbol #"w", $k & ?(>= 3)) : $xss -> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... /Users/momohatt/egison/egison/hs-src/Language/Egison/Math/Rewrite.hs:96:13: warning: [-Wunused-local-binds] Defined but not used: ‘tmpM’ | 96 | , [mc| (apply #"exp" [$x], $n & ?(>= 2)) : $xss -> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... /Users/momohatt/egison/egison/hs-src/Language/Egison/Math/Rewrite.hs:109:13: warning: [-Wunused-local-binds] Defined but not used: ‘tmpM’ | 109 | , [mc| (apply #"^" [$x, $y], $n & ?(>= 2)) : $xss -> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... /Users/momohatt/egison/egison/hs-src/Language/Egison/Math/Rewrite.hs:151:13: warning: [-Wunused-local-binds] Defined but not used: ‘tmpM’ | 151 | [ [mc| (apply #"sqrt" [$x], ?(> 1) & $k) : $xss -> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... /Users/momohatt/egison/egison/hs-src/Language/Egison/Math/Rewrite.hs:175:13: warning: [-Wunused-local-binds] Defined but not used: ‘tmpM’ | 175 | [ [mc| (apply #"rt" [singleTerm $n #1 [], $x] & $rtnx, ?(>= n) & $k) : $xss -> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... /Users/momohatt/egison/egison/hs-src/Language/Egison/Math/Rewrite.hs:186:13: warning: [-Wunused-local-binds] Defined but not used: ‘tmpM’ | 186 | [ [mc| (apply #"rtu" [singleTerm $n #1 []] & $rtun, ?(>= n) & $k) : $r -> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions