Skip to content

Instantly share code, notes, and snippets.

@jbclements
Created October 3, 2018 23:48
Show Gist options
  • Save jbclements/436c422daec55d6db0fbd7cf43caabc4 to your computer and use it in GitHub Desktop.
Save jbclements/436c422daec55d6db0fbd7cf43caabc4 to your computer and use it in GitHub Desktop.
code from the afternoon class, 2018-10-03
#lang typed/racket
(require typed/rackunit)
(define-type Value String)
(define-type ExprC (U ConcatC StrC))
(struct ConcatC ([l : ExprC] [r : ExprC])
#:transparent)
(struct StrC ([s : String]) #:transparent)
(ConcatC (StrC "abc") (StrC "def"))
#;((check-equal? (interp (parse '"apple")) "apple")
(check-equal? (interp (parse '{"abc" + "def"}))
"abcdef"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment