www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

test-adt.rkt (588B)


      1 #lang typed/racket
      2 
      3 (require phc-adt
      4          phc-toolkit
      5          type-expander
      6          typed/rackunit
      7          (only-in (lib "phc-adt/tagged-structure-low-level.hl.rkt")
      8                   λ-tagged-get-field))
      9 (adt-init)
     10 
     11 (define-tagged st2 [b String] [a Number])
     12 
     13 ((tagged t a b c) 1 'b "c")
     14 ((tagged t a [b] c) 1 'b "c")
     15 ((tagged t [a] [b] [c]) 1 'b "c")
     16 ((tagged t [a : Number] [b : Symbol] [c : String]) 1 'b "c")
     17 (tagged t [a : Number 1] [b : Symbol 'b] [c : String "c"])
     18 (tagged t [a 1] [b 'b] [c "c"])
     19 
     20 (tagged t [a 1] [b 'b] [c "c"])
     21 
     22 (define-tagged tabc [a 1] [b 'b] [c "c"])