anchor.diff:                                       |> Array.map (fun field -> Reflection.FSharpValue.PreComputeRecordFieldReader field)
                                        |> Array.toList
                           let stringBuilder = new System.Text.StringBuilder()
  -                        let stringFuncs =
  -                            let fstRecord = data |> Seq.head
  -                            let fieldTypes = 
  -                                fields 
  -                                |> List.map (fun field -> field fstRecord)
  -
  -                            let inline funcPrecHead input =
  -                                let o = box input
  -                                match o with
  -                                | :? string -> fun (x: obj) -> 
  -                                    let sb = new System.Text.StringBuilder()
  -                                    sb.AppendFormat("{0}", x) |> ignore
  -                                    let res = sb.ToString()
  -                                    sb.Clear() |> ignore
  -                                    res
  -                                | :? System.Enum -> fun x -> 
  -                                    let sb = new System.Text.StringBuilder()
  -                                    sb.AppendFormat("{0}", x) |> ignore
  -                                    let res = sb.ToString()
  -                                    sb.Clear() |> ignore
  -                                    res
  -                                | :? System.Collections.Generic.IEnumerable<'T> -> fun x -> 
  -                                    let sb = new System.Text.StringBuilder()
  -                                    let a = x :?>  System.Collections.Generic.IEnumerable<'T>
  -                                    a
  -                                    |> Seq.iteri (fun i x -> 
  -                                        if i = 0 then 
  -                                            sb.AppendFormat("{0}", x) |> ignore
  -                                        else
  -                                            sb.AppendFormat("\t{0}", x) |> ignore
  -                                                )
  -                                    let res = sb.ToString()
  -                                    sb.Clear() |> ignore
  -                                    res
  -                                | _ -> fun x -> 
  -                                    let sb = new System.Text.StringBuilder()
  -                                    sb.AppendFormat("{0}", x) |> ignore
  -                                    let res = sb.ToString()
  -                                    sb.Clear() |> ignore
  -                                    res
  -
  -                            let inline funcPrec input =
  -                                let o = box input
  -                                match o with
  -                                | :? string -> fun (x: obj) -> 
  -                                    let sb = new System.Text.StringBuilder()
  -                                    sb.AppendFormat("\t{0}", x) |> ignore
  -                                    let res = sb.ToString()
  -                                    sb.Clear() |> ignore
  -                                    res
  -                                | :? System.Enum -> fun x -> 
  -                                    let sb = new System.Text.StringBuilder()
  -                                    sb.AppendFormat("\t{0}", x) |> ignore
  -                                    let res = sb.ToString()
  -                                    sb.Clear() |> ignore
  -                                    res
  -                                | :? System.Collections.IEnumerable -> fun x -> 
  -                                    let sb = new System.Text.StringBuilder()
  -                                    let a = x :?> System.Collections.IEnumerable
  -                                    for i in a do
  -                                        sb.AppendFormat("\t{0}", i) |> ignore
  -                                    let res = sb.ToString()
  -                                    sb.Clear() |> ignore
  -                                    res
  -                                | _ -> fun x -> 
  -                                    let sb = new System.Text.StringBuilder()
  -                                    sb.AppendFormat("\t{0}", x) |> ignore
  -                                    let res = sb.ToString()
  -                                    sb.Clear() |> ignore
  -                                    res
  -                            let rec loop n list =
  -                                if n = fieldTypes.Length then
  -                                    list |> List.rev
  -                                elif n = 0 then
  -                                    loop (n + 1) ((funcPrecHead fieldTypes.[n])::list)
  -                                else
  -                                    loop (n + 1) ((funcPrec fieldTypes.[n])::list)
  -                            loop 0 []
   
                           let elemToStr (elem:'record) =
                               //for each field get value
                               fields
                               |> Seq.fold2(fun (sb:System.Text.StringBuilder) (stringFunc:(obj -> string)) fieldFunc -> 
  -                                sb.Append(stringFunc (fieldFunc elem))) stringBuilder stringFuncs |> ignore
  +                                sb.Append(stringFunc (fieldFunc elem))) stringBuilder formatFunctions |> ignore
                               let res = stringBuilder.ToString()
                               stringBuilder.Clear() |> ignore
                               res
  
positive.code: 
          /// Convertes a generic sequence to a sequence of seperated string
          /// use write afterwards to save to file
          static member inline toCSV (separator:string) (header:bool) (data:'a seq) =
  
              let inline toPrettyString sep input =
                  let o = box input
  
negative.code:                                     prop.GetValue(line, null) )) |> Seq.map (toPrettyString separator)
  
                  yield! lines
              }
  
          static member inline toCSV (separator:string) (header:bool) (data:'a seq) =
              
              let formatFunc = 
                  let dataType = typeof<'a>
                  match dataType with
                  | ty when FSharpType.IsRecord ty ->
                      let fields = Reflection.FSharpType.GetRecordFields(dataType)
                                   |> Array.map (fun field -> Reflection.FSharpValue.PreComputeRecordFieldReader field)
                                   |> Array.toList
                      let stringBuilder = new System.Text.StringBuilder()
                      let stringFuncs =
                          let fstRecord = data |> Seq.head
                          let fieldTypes = 
                              fields 
                              |> List.map (fun field -> field fstRecord)
  
                          let inline funcPrecHead input =
                              let o = box input
                              match o with
                              | :? string -> fun (x: obj) -> 
                                  let sb = new System.Text.StringBuilder()
                                  sb.AppendFormat("{0}", x) |> ignore
                                  let res = sb.ToString()
                                  sb.Clear() |> ignore
                                  res
                              | :? System.Enum -> fun x -> 
                                  let sb = new System.Text.StringBuilder()
                                  sb.AppendFormat("{0}", x) |> ignore
                                  let res = sb.ToString()
                                  sb.Clear() |> ignore
                                  res
                              | :? System.Collections.Generic.IEnumerable<'T> -> fun x -> 
                                  let sb = new System.Text.StringBuilder()
                                  let a = x :?>  System.Collections.Generic.IEnumerable<'T>
                                  a
                                  |> Seq.iteri (fun i x -> 
                                      if i = 0 then 
                                          sb.AppendFormat("{0}", x) |> ignore
                                      else
                                          sb.AppendFormat("\t{0}", x) |> ignore
                                              )
                                  let res = sb.ToString()
                                  sb.Clear() |> ignore
                                  res
                              | _ -> fun x -> 
                                  let sb = new System.Text.StringBuilder()
                                  sb.AppendFormat("{0}", x) |> ignore
                                  let res = sb.ToString()
                                  sb.Clear() |> ignore
                                  res
  
                          let inline funcPrec input =
                              let o = box input
                              match o with
                              | :? string -> fun (x: obj) -> 
                                  let sb = new System.Text.StringBuilder()
                                  sb.AppendFormat("\t{0}", x) |> ignore
                                  let res = sb.ToString()
                                  sb.Clear() |> ignore
                                  res
                              | :? System.Enum -> fun x -> 
                                  let sb = new System.Text.StringBuilder()
                                  sb.AppendFormat("\t{0}", x) |> ignore
                                  let res = sb.ToString()
                                  sb.Clear() |> ignore
                                  res
                              | :? System.Collections.IEnumerable -> fun x -> 
                                  let sb = new System.Text.StringBuilder()
                                  let a = x :?> System.Collections.IEnumerable
                                  for i in a do
                                      sb.AppendFormat("\t{0}", i) |> ignore
                                  let res = sb.ToString()
                                  sb.Clear() |> ignore
                                  res
                              | _ -> fun x -> 
                                  let sb = new System.Text.StringBuilder()
                                  sb.AppendFormat("\t{0}", x) |> ignore
                                  let res = sb.ToString()
                                  sb.Clear() |> ignore
                                  res
                          let rec loop n list =
                              if n = fieldTypes.Length then
                                  list |> List.rev
                              elif n = 0 then
                                  loop (n + 1) ((funcPrecHead fieldTypes.[n])::list)
                              else
                                  loop (n + 1) ((funcPrec fieldTypes.[n])::list)
                          loop 0 []
                      stringFuncs
                  | _ -> [(fun a -> string a)]
  
              let inline toPrettyString sep input =
                  let o = box input
                  match o with
                  | :? string as s -> sprintf "%s" s
                  | :? System.Enum as en -> string en
                  | :? System.Collections.IEnumerable as e -> seq { for i in e do yield sprintf "%A" i } |> String.concat sep
                  | _ -> sprintf "%A" input
  
  
              let toPrettyHeaderString sep input fieldName  =
                  let o = box input
                  match o with
                  | :? string       -> fieldName
                  | :? System.Enum  -> fieldName
                  | :? System.Collections.IEnumerable as e -> let count = seq {for i in e do yield i.ToString() } |> Seq.length
                                                              seq { for c = 1 to count do yield (sprintf "%s%i" fieldName c) } |> String.concat sep
                  | _               -> fieldName
  
              Seq.toCSVwith separator header data formatFunc