Last active
September 28, 2017 17:06
-
-
Save kunigami/cb0c6292ff1a10394f5ceef8bb8c0aa4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec push: 'a. 'a -> 'a seq -> 'a seq = | |
fun element digits -> match digits with | |
| Nil -> One (element, Nil) | |
| Zero restDigits -> One (element, restDigits) | |
| One (currentElement, restDigits) -> | |
Zero (push (element, currentElement) restDigits) | |
;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment