You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It indexes the pivot like a list, without any regard to where the center is.
It may be beneficial to have a relative version.
zipRelative :Pivot a ->Pivot(Int, a )
zipRelative pvt =let
onC =\x ->(0,x)
onL =List.indexedMap (\i x ->(-1- i,x))
onR =List.indexedMap (\i x ->(i +1, x))in mapCLR_ onC onL onR pvt
For example, a situation where one knows their pivot is going to get jumbled, and would like to retain their current positions afterwards.
In such a case we could also change the name of zip to zipAbsolute, leaving less room for confusion. To increase uniformity, we could further replace goTo by goAbsolute; and goBy by goRelative.
In fact, why is it called zip in the first place? index is better...
The text was updated successfully, but these errors were encountered:
This is
zip
as it is now:elm-pivot/Pivot/Map.elm
Lines 81 to 96 in cee1b98
It indexes the pivot like a list, without any regard to where the center is.
It may be beneficial to have a relative version.
For example, a situation where one knows their pivot is going to get jumbled, and would like to retain their current positions afterwards.
In such a case we could also change the name of
zip
tozipAbsolute
, leaving less room for confusion. To increase uniformity, we could further replacegoTo
bygoAbsolute
; andgoBy
bygoRelative
.In fact, why is it called
zip
in the first place?index
is better...The text was updated successfully, but these errors were encountered: