Re: [elm-discuss] Decoding JSON tree using Either type

2016-08-19 Thread Dimitri Tcaciuc
e, you need to merge it with Either. > > type Node = Internal Group | Leaf Dataset > > > > On Fri, Aug 19, 2016 at 7:26 PM, Dimitri Tcaciuc <dtcac...@gmail.com> > wrote: > >> Hmm, that turns the type set back into mutually recursive, and so the >> compiler i

Re: [elm-discuss] Decoding JSON tree using Either type

2016-08-19 Thread Dimitri Tcaciuc
a type constructor for Node. > > You need to change > > type Node = Either Group Datase > > to > > type alias Node = Either Group Dataset > > > > > > > On Fri, Aug 19, 2016 at 6:55 PM, Dimitri Tcaciuc <dtca...@gmail.com > > wrote: > >>

[elm-discuss] Decoding JSON tree using Either type

2016-08-19 Thread Dimitri Tcaciuc
Hello, I'm trying to decode a tree structure where each node can either have children nodes or be a leaf and have data attached to it. Here are the types and a decoder I've come up with so far: type Either a b = Left a | Right b type Node = Either Group Dataset type alias Group = { nodes: