Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
namespace RosettaCode
|
||||
|
||||
type BinaryTree<'T> =
|
||||
| Element of 'T
|
||||
| Tree of 'T * BinaryTree<'T> * BinaryTree<'T>
|
||||
member this.Map(f) =
|
||||
match this with
|
||||
| Element(x) -> Element(f x)
|
||||
| Tree(x,left,right) -> Tree((f x), left.Map(f), right.Map(f))
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
let t1 = Tree(2, Element(1), Tree(4,Element(3),Element(5)) )
|
||||
let t2 = t1.Map(fun x -> x * 10)
|
||||
Loading…
Add table
Add a link
Reference in a new issue