[{"name":"LimitAliasedRecordSize","comment":"\n\n\n# Motivation for the Rule\n\n`LimitAliasedRecordSize` provides an [`elm-review`](https://package.elm-lang.org/packages/jfmengels/elm-review/latest/) rule to make sure aliased records don't get too large.\n\nExperience has shown that having large record aliases (for me, more than 40 fields) can lead to large memory usage when compiling (sometimes up to 10GB).\n\nThe purpose of this rule is to identify large alias records, so they can be replaced.\n\n\n## How to tell if you might need this rule\n\nCompile your application and look at the verbose output like so:\n\n```bash\n    elm make src / Main.elm --output=/dev/null +RTS -s -w\n```\n\nIf garbage collection (GC) time is multiple seconds, or if the \"bytes allocated in the heap\" run to many gigabytes, you might benefit from this rule.\n\nAfter compilation, run\n\n```bash\n    du -hs elm-stuff/0.19.1/* | sort -h | tail -n 60 | tac\n```\n\nIf the largest `.elmi` files are run more than a few megabytes, you might benefit from this rule.\n\n\n## When not to use this rule\n\nIf neither of the above commands indicates a problem, and you have not experience problems with slow build times or exhausted memory when compiling, you probably don't need this rule.\n\n\n# Configuration\n\n@docs LimitRecordSizeConfig\n@docs maxRecordSize\n\n\n# LimitAliasedRecordSize Rule Usage\n\n@docs rule\n\n","unions":[{"name":"LimitRecordSizeConfig","comment":" `LimitRecordSizeConfig` gets passed to `rule` to configure the rule. You can't contruct this type directly, but you can use the `maxRecordSize` function to create a configuration value:\n\n    import LimitAliasedRecordSize\n    import Review.Rule exposing (Rule)\n\n    config : List Rule\n    config =\n        [ LimitAliasedRecordSize.rule\n            (20 |> LimitAliasedRecordSize.maxRecordSize)\n        ]\n\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"maxRecordSize","comment":" Assign the max record size allowed when configuring this rule.\n\n    import LimitAliasedRecordSize\n    import Review.Rule exposing (Rule)\n\n    config : List Rule\n    config =\n        [ LimitAliasedRecordSize.rule\n            (20 |> LimitAliasedRecordSize.maxRecordSize)\n        ]\n\n","type":"Basics.Int -> LimitAliasedRecordSize.LimitRecordSizeConfig"},{"name":"rule","comment":" Configure the rule in your `elm-review` configuration:\n\n    import LimitAliasedRecordSize\n    import Review.Rule exposing (Rule)\n\n    config : List Rule\n    config =\n        [ LimitAliasedRecordSize.rule\n            (20 |> LimitAliasedRecordSize.maxRecordSize)\n        ]\n\n\n## Examples\n\n\n### ✅ Good: not too many fields\n\n    type alias MyRecord =\n        { oneField : Int\n        , anotherField : String\n        , yetAnotherField : Bool\n        }\n\n\n### ❌ Bad: too many fields\n\n    type alias MyRecord =\n        { oneField : Int\n        , anotherField : String\n        , yetAnotherField : Bool\n        , andAnotherField : Int\n        , andAnotherField2 : Int\n        , andAnotherField3 : Int\n        , andAnotherField4 : Int\n        , andAnotherField5 : Int\n        , andAnotherField6 : Int\n        , andAnotherField7 : Int\n        , andAnotherField8 : Int\n        , andAnotherField9 : Int\n        , andAnotherField10 : Int\n        , andAnotherField11 : Int\n        , andAnotherField12 : Int\n        , andAnotherField13 : Int\n        }\n\n\n### How to fix\n\nOne simple approach is just to change the record into a custom type. For example, the above bad example can be changed to:\n\n    type MyRecord\n        = MyRecord\n            { oneField : Int\n            , anotherField : String\n            , yetAnotherField : Bool\n            , andAnotherField : Int\n            , andAnotherField2 : Int\n            , andAnotherField3 : Int\n            , andAnotherField4 : Int\n            , andAnotherField5 : Int\n            , andAnotherField6 : Int\n            , andAnotherField7 : Int\n            , andAnotherField8 : Int\n            , andAnotherField9 : Int\n            , andAnotherField10 : Int\n            , andAnotherField11 : Int\n            , andAnotherField12 : Int\n            , andAnotherField13 : Int\n            }\n\n\n## Try it out\n\nYou can try the example configuration above out by running the following command:\n\n```bash\nelm-review --template matzko/elm-review-limit-aliased-record-size/example\n```\n\n","type":"LimitAliasedRecordSize.LimitRecordSizeConfig -> Review.Rule.Rule"}],"binops":[]}]