f# - What replaces the deprecated any_to_string function? -


I think this is now the object. Toastring () But I'm unsure ... Thanks!

I think the only way to get any _to_string functionality is with the "% A" formatter The alert tells you this.

Enter any _to_string = sprintf "% A"

does not initiate it. Toaster (). For 'simple' types like lists. Toasting () already provides a good representation. But while using their own custom type,% A formatters are very useful. For example, in the case of tree structures, it runs along the tree. For example:

   

For example:

type tree = tree node * tree |

and in FSI:

  envelope, & gt; MyTree.ToString () ;; This value is: string = "FSI_0002 + tree + node" & gt; Sprintf "% O" myTree ;; This value is: string = "FSI_0002 + tree + node" & gt; Sprintf "% A" myTree ;; This value is: string = "node (node ​​(address, address), node (address, node (address, address))"  

Comments