Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ridiculous memory usage on formatting particular operator combinations #80

Open
pe200012 opened this issue Apr 25, 2024 · 0 comments
Open

Comments

@pe200012
Copy link

pe200012 commented Apr 25, 2024

version info:

> floskell --version
floskell 0.10.7

config.json:

{
    "extensions": [],
    "fixities": [],
    "formatting": {
        "align": {
            "case": true,
            "class": false,
            "import-module": true,
            "import-spec": true,
            "let-binds": true,
            "limits": [
                10,
                25
            ],
            "matches": true,
            "record-fields": true,
            "where": true
        },
        "group": {
            "[ in type": {
                "force-linebreak": false,
                "linebreaks": "none",
                "spaces": "both"
            },
            "default": {
                "force-linebreak": false,
                "linebreaks": "after",
                "spaces": "both"
            }
        },
        "indent": {
            "app": "indent-by 4",
            "case": "indent-by 4",
            "class": "indent-by 4",
            "deriving": 4,
            "do": "indent-by 4",
            "export-spec-list": "indent-by 4",
            "if": "indent-by 4",
            "import-spec-list": "align",
            "let": "indent-by 4",
            "let-binds": "indent-by 4",
            "let-in": "indent-by 4",
            "multi-if": "indent-by 4",
            "onside": 4,
            "typesig": "align",
            "where": 2,
            "where-binds": "indent-by 2"
        },
        "layout": {
            "app": "try-oneline",
            "con-decls": "try-oneline",
            "declaration": "try-oneline",
            "export-spec-list": "try-oneline",
            "if": "vertical",
            "import-spec-list": "try-oneline",
            "infix-app": "try-oneline",
            "let": "vertical",
            "list-comp": "try-oneline",
            "record": "try-oneline",
            "type": "try-oneline"
        },
        "op": {
            ",": {
                "force-linebreak": false,
                "linebreaks": "before",
                "spaces": "after"
            },
            ". in type": {
                "force-linebreak": false,
                "linebreaks": "after",
                "spaces": "after"
            },
            "default": {
                "force-linebreak": false,
                "linebreaks": "before",
                "spaces": "both"
            },
            "record": {
                "force-linebreak": false,
                "linebreaks": "after",
                "spaces": "after"
            }
        },
        "options": {
            "align-let-binds-and-in-expr": true,
            "align-sum-type-decl": true,
            "decl-no-blank-lines": [],
            "flexible-oneline": true,
            "preserve-vertical-space": false,
            "sort-import-lists": true,
            "sort-imports": true,
            "sort-pragmas": true,
            "split-language-pragmas": true
        },
        "penalty": {
            "indent": 1,
            "linebreak": 100,
            "max-line-length": 100,
            "overfull": 10,
            "overfull-once": 200
        }
    },
    "language": "Haskell2010",
    "style": "base"
}

MWE:

-- A.hs
module A where

someMethod
    = someF <$> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1
    <*> id 1

Invoking floskell A.hs eats up all of my 32G memory, and won't terminate.

The id 1 can be any other expression in the form of app x1 x2..., in order to trigger this bug.

Any help is appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant