Skip to content

Instantly share code, notes, and snippets.

@shirok
Created March 13, 2013 00:01
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 shirok/5148225 to your computer and use it in GitHub Desktop.
Save shirok/5148225 to your computer and use it in GitHub Desktop.
(define %word ($->rope ($do [h ($one-of #[A-Za-z_$])]
[t ($many-chars #[A-Za-z0-9_$])]
($return (cons h t)))))
(define %key ($or %word %string))
(define %object
(let1 %member ($do [k %key] %ws
%name-separator
[v %value]
($return (cons k v)))
($between %begin-object
($fmap ($ build-object $ rope-finalize $)
($sep-by %member %value-separator))
%end-object)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment