Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
Loading in …5
×

# Domain Transformations

388 views

Published on

Published in: Technology
• Full Name
Comment goes here.

Are you sure you want to Yes No
Your message goes here
• Be the first to comment

• Be the first to like this

### Domain Transformations

1. 1. 
2. 2.      
3. 3. type Expression = | Math of Expression list | Menclose of Expression list  | Mrow of Expression list  | Mi of string | MiNormal of string | Mo of string | Mtd of Expression list  | Mtr of Expression list | Mn of string Mn(42) | Mroot of Expression * Expression | Mfrac of Expression * Expression  | Msub of Expression * Expression | Msup of Expression * Expression Mi(  (etc.) Mfrac(Mn(1),Mn(2))  Mtd([…])
4. 4. l e t c a s e s = R e f l e c t i o n . F S h a r p Typ e . G e t U n i o n C a s e s ( t yp e o f <E xp r e s s i o n >) |> A r r a y. m ap ( f u n f - > ( f . N a me , R e f l e c t i o n .F S h a r p Va l u e . P r e C o mp u t e U n i o n C o n s t r u c to r ( f) ) ) |> M a p . o f A r r a y let ctor = cases.Item name (ctor parameters) :?> Expression   0 (* sorry, supporting integrals is just too hard *)
5. 5.  
6. 6.  
7. 7.  
8. 8.      a*b*c
9. 9.       x*x  Math.Pow(x, n) <msub>  x_3__2 <msup>
10. 10.  
11. 11.
12. 12.   
13. 13.  Add, Mul Div, Sqrt Pow Sub 
14. 14.     | "E" | "ⅇ" | "e" when settings.EIsConstant   | Mo(op) :: (UnitOfMeasureBraces(units) as uu) :: t   let rec (|Simple|_|) = function | SimpleAndPhysical x -> Some x | Mrow(content) -> match content with | Simple h :: [] -> Some h | _ -> None | _ -> None  let (<@>) (dictName:Map<_,_>) keyName = if dictName.ContainsKey keyName then dictName.[keyName] else keyName
15. 15. 
16. 16.   Excel  C#, F# C++  NMath Boost  Web iPad  Code Svc apps
17. 17.       