 M: union read-bare
     [ uint read-bare ] dip members>> ?value-at
     [ read-bare ] [ invalid-union ] if ;
-
-M: user read-bare type>> read-bare ;
 
 M: struct read-bare
     fields>> [ read-bare ] assoc-map ;

TUPLE: map from to ;
TUPLE: union members ;
TUPLE: struct fields ;
TUPLE: user name type ;
TUPLE: schema types ;

! errors


user-type-name = (alpha|digit)+     => [[ >string ]]
user-type = "type"~ ws user-type-name ws any-type
          => [[ first2 [ 2array ] 2keep swap user-types [ ?set-at ] change ]]

user-types = user-type (ws user-type)* => [[ first2 swap prefix ]]
schema = ws user-types ws => [[ <schema> ]]
