[racket] fingertree / nested datatype

From: Anthony Carrico (acarrico at memebeam.org)
Date: Sat Apr 13 20:56:04 EDT 2013

On 04/13/2013 09:00 AM, Sam Tobin-Hochstadt wrote:
> So I think we need to think harder about this, but I don't have a
> great suggestion for fixing it at the moment.
> 
> Anthony, for your use, you can probably use the encoding technique
> described in the paper I linked to about data structures in TR.

(struct: (a) Leaf ((leaf : a)))

(struct: (a) Deep ((left : (Digit (U (Leaf a) (Node a))))
		   (spine : (Fingertree a))
		   (right : (Digit (U (Leaf a) (Node a))))))

(define-type (Fingertree a) (U Empty (Single a) (Deep a)))

:).

-- 
Anthony Carrico

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.racket-lang.org/users/archive/attachments/20130413/fb20202e/attachment.sig>

Posted on the users mailing list.