Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

String: revTake, revDrop, revSplit work from the end #302

@vincenthz

Description

@vincenthz

Currently the length is calculated in o(n) before applying the reverse operation (revTake n == drop (len-n)), this is not optimised. we can use the UTF8 encoding continuation bytes to know how to process the string from the end without calculating the length.

The initial step is adding a prev function akin to next in Foundation/Primitive/UTF8/Base.hs, then a revIndexN (name for forward is: indexN)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions