https://github.com/JuliaLang/julia/issues/269

kl. 21:52:05 UTC+1 torsdag 6. november 2014 skrev Evan Pu følgende:
>
> Quick question:
>
> In haskell one can do something like the following to define a type:
>
>  data Tree a = Branch (Tree a) (Tree a) | Leaf a
>
>
> Is there something analogous in the Julia world?
> I'm sure I'm doing something wrong here...
>
> julia> type Tree
>        body :: Union(Branch, Leaf)
>        end
> ERROR: Branch not defined
>
> julia> type Branch
>        a :: Tree
>        b :: Tree
>        end
> ERROR: Tree not defined
>
> julia> type Leaf
>        a
>        end
>
> thanks!
>

Reply via email to