Skip to content

Instantly share code, notes, and snippets.

@tizoc
Created May 2, 2018 16:56
Show Gist options
  • Save tizoc/8fb20e3caab040746a5c7d12150d4769 to your computer and use it in GitHub Desktop.
Save tizoc/8fb20e3caab040746a5c7d12150d4769 to your computer and use it in GitHub Desktop.
\* Aliases *\
(define dict Size -> (shen.dict Size))
(define dict? Dict -> (shen.dict? Dict))
(define dict-count Dict -> (shen.dict-count Dict))
(define dict-> Dict Key Value -> (shen.dict-> Dict Key Value))
(define <-dict Dict Key -> (shen.<-dict Dict Key))
(define dict-rm Dict Key -> (shen.dict-rm Dict Key))
(define dict-fold Dict F -> (shen.dict-fold Dict F))
(define dict-keys Dict -> (shen.dict-keys Dict))
(define dict-values Dict -> (shen.dict-values Dict))
\* Type declarations *\
(declare dict [number --> [dict K V]])
(declare dict? [A --> boolean])
(declare dict-count [[dict K V] --> number])
(declare <-dict [[dict K V] --> [K --> V]])
(declare dict-> [[dict K V] --> [K --> [V --> V]]])
(declare dict-rm [[dict K V] --> [K --> K]])
(declare dict-fold [[K --> [V --> [A --> A]]] --> [[dict K V] --> [A --> A]]])
(declare dict-keys [[dict K V] --> [list K]])
(declare dict-values [[dict K V] --> [list V]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment