Skip to content

Stan 0206 should not fire for type data #544

@noughtmare

Description

@noughtmare

I have this code:

{-# LANGUAGE TypeData #-}

infixr :->
type data PCFType = PCFType :-> PCFType | Nat

And Stan reports:

 ✲ Name:        Data types with non-strict fields
 ✲ Description: Defining lazy fields in data types can lead to unexpected space leaks
 ✲ Severity:    Performance
 ✲ Category:    #SpaceLeak #Syntax
Possible solutions:
  - Add '!' before the type, e.g. !Int or !(Maybe Bool)
  - Enable the 'StrictData' extension: {-# LANGUAGE StrictData #-}
stan(STAN-0206)

But strictness fields are not allowed in type data declarations.

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