array::fold, array::split #5

Open
opened 2026-04-10 14:08:01 +00:00 by jaynuine · 4 comments
Owner
No description provided.
jaynuine changed title from fold to array::fold 2026-04-10 14:37:26 +00:00
Author
Owner

along with fold, its inverse split may be defined

along with fold, its inverse split may be defined
Author
Owner

actually, fold induces a loss of information such that to consider split as its inverse in the sense that the two would cancel one another is flawed

summing by addition cannot be undone to recover the original set solely from the result

but this is not necessarily the case, as an operation such as string::join would not incur information loss and could be split back

what property of a function corresponds to whether it is able to be reversed ?

actually, fold induces a loss of information such that to consider split as its inverse in the sense that the two would cancel one another is flawed summing by addition cannot be undone to recover the original set solely from the result but this is not necessarily the case, as an operation such as string::join would not incur information loss and could be split back what property of a function corresponds to whether it is able to be reversed ?
Author
Owner

"able to be reversed" really means that the function is bijective, in that any input element maps to exactly one output element

in the case of addition, this is not the case ; the cardinalities of the function's domain and codomain being equal is not a requirement strong enough to prevent im tired

"able to be reversed" really means that the function is bijective, in that any input element maps to exactly one output element in the case of addition, this is not the case ; the cardinalities of the function's domain and codomain being equal is not a requirement strong enough to prevent im tired
jaynuine changed title from array::fold to array::fold, array::split 2026-04-10 15:08:50 +00:00
jaynuine added this to the spec project 2026-04-16 19:34:54 +00:00
Author
Owner

without going as far as abstracting function pointers behind structures containing their properties, i will opt for array::fold to take an optional third argument sizer, leaving the assumption of bijectivity to the caller in the form of either passing a valid function address or a null pointer.

without going as far as abstracting function pointers behind structures containing their properties, i will opt for array::fold to take an optional third argument `sizer`, leaving the assumption of bijectivity to the caller in the form of either passing a valid function address or a null pointer.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaynuine/pearr#5
No description provided.