Skip to content

Lazy splitAt is too lazy? #573

Description

@Lysxia

There's a missing bang pattern which makes Text.Lazy.splitAt on the empty text lazy in the Int64 argument. In Core that causes a duplicate worker-wrapper for the first iteration which must be lazy, and the remaining ones which are strict.

Is that accidental? "laziness zeal"? Is that going to be a breaking change?

splitAtWord also has this problem but it's internal AFAICT.

splitAt:

splitAt :: Int64 -> Text -> (Text, Text)
splitAt = loop
  where
    loop :: Int64 -> Text -> (Text, Text)
    loop _ Empty      = (empty, empty)
    loop n t | n <= 0 = 

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