Skip to content

Make group Fail faster #112

@sjakobi

Description

@sjakobi

I noticed that in many Unions, the Fail is somewhat hidden. E.g.

> diag $ group $ "x" <> hardline
Union 
    ( Cat ( Char 'x' ) Fail ) 
    ( Cat ( Char 'x' ) Line )

To detect that the first alternative fails, the layout algorithm has to traverse everything that comes before the Fail.

I wonder whether group could simply produce this instead:

> diag $ group $ "x" <> hardline
Union 
    Fail
    ( Cat ( Char 'x' ) Line )

This could save a lot of work for the layouters!

Is there any reason why group shouldn't do this?

(#99 is somewhat related)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions