The following type is clearly quite large so manually writing the code to convert this to a readable form would be tedious. I would like to know the simplest way to display the tree in a readable form
I\'m looking to create a scene-graph for my F# project somthing like: root ->player_bob -->torch ->enemy_1
I\'ve used the Scrap Your Boilerplate and Uniplate libraries in the Haskell programming language, and I would find that form of generic programming over discriminated unions to be really useful.Is the
I\'m building an expression tree using discriminated uni开发者_如何学编程ons. The below code:
I want to write something like this: type NumExp = Num of float type Exp = Num of float Dot of NumExp * NumExp
[Note: This question had the original title "C (ish) style union in C#" but as Jeff\'s comment informed me, apparently this structure is called a \'discriminated union\']
In Haskell it is easy to make a开发者_运维百科n algebraic type/discriminated union \"displayable\" as a string by simply adding deriving Show to the type definition.
So, by a hilarious series of events, I downloaded the FParsec source and tried to build it. Unfortunately, it\'s not compatible with the new 1.9.9.9. I fixed the easy problems, but there are a couple
If I have a discriminate union of different types of arrays how can i convert them to their \'actual\' types?