Skip to content

Instantly share code, notes, and snippets.

@ilya-klyuchnikov
Created March 27, 2021 09:08
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 ilya-klyuchnikov/0096f744e023579962abb13cbcb81fb8 to your computer and use it in GitHub Desktop.
Save ilya-klyuchnikov/0096f744e023579962abb13cbcb81fb8 to your computer and use it in GitHub Desktop.
#lang typed/racket
(define-type
(MyRec a)
(U a (Pair 'rec (MyRec a))))
(: unwrap (-> (MyRec (MyRec Symbol)) (MyRec Symbol)))
(define (unwrap my_rec)
(match my_rec [(cons 'rec elem) elem]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment