anchor.diff:              FSharpType.GetUnionCases t
               |> Array.find (fun (c) -> c.Name = tag)
           FSharpValue.MakeUnion(case, [||])
  -
       puniontag t |>> makeType
   
  -and ptype (aType : Type) : Parser<_,_> =
  -    if FSharpType.IsRecord aType then
  -       precord aType 
  -    else
  -        fun stream ->
  -            Reply(Error, expectedString "A Record")
  +and ptype(t : Type) : Parser<obj,unit> =
  +    let (|Record|_|) t = if FSharpType.IsRecord(t) then Some(t)  else None
  +    let (|Union|_|) t = if FSharpType.IsUnion(t) then Some(t) else None
  +    let (|EMail|_|) t = if t = typeof<MailAddress> then Some(t) else None        
  +    let (|GUID|_|) t = if t = typeof<Guid> then Some(t) else None        
  +    let (|Primative|_|) t = if Type.GetTypeCode(t) <> TypeCode.Object then Some(t) else None
  +
  +    match t with
  +    | Record t -> precord t
  +    | Union t -> punion t
  +    | EMail t -> mayThrow(restOfLine false |>> (primFromString t))
  +    | GUID t -> mayThrow(restOfLine false |>> (primFromString t))
  +    | Primative t -> mayThrow(restOfLine false |>> (primFromString t))
  +    | _ -> fail "Unsupported type"
  +
  +
   
   //======================= TESTING ======================================
   
  
positive.code: 
  and pfield (field: Reflection.PropertyInfo) : Parser<obj,unit> =
      pfieldTag field>>.
      pfieldValue field.PropertyType
  
  and precord (aType : Type) : Parser<obj,unit> =
      let makeType vals = 
  
negative.code: type Uri with
      static member Parse str = Uri(str)
  
  let primFromString (t:  Type) (str: String)  : obj =
      //this does not seem to work
      //t.GetMethod("Parse", [|typeof<string>|]).Invoke(t, [|str|]) |> box
      match t.FullName with
      |"System.Int16" -> Int16.Parse(str) |> box
      |"System.Int32" -> Int32.Parse(str) |> box
  