Skip to content

Instantly share code, notes, and snippets.

@kunigami
Created August 6, 2017 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunigami/6262854be79e43d47135ca6df4f947f8 to your computer and use it in GitHub Desktop.
Save kunigami/6262854be79e43d47135ca6df4f947f8 to your computer and use it in GitHub Desktop.
let invalidate rotationStep = match rotationStep with
| Reversing ({validCount; front; frontReversed; rear; rearReversed})
-> Reversing ({
validCount = validCount - 1;
front;
frontReversed;
rear;
rearReversed;
})
| Appending ({validCount = 0; rear = lastElem :: restRear})
-> Done restRear
| Appending ({validCount; front; rear}) ->
Appending ({validCount = validCount - 1; front; rear})
| rotationStep -> rotationStep
;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment