Skip to content

confusing documentation for the Union type decoder with empty tags #2626

Open
@amkhlv

Description

@amkhlv

Suppose that I have a union type in Dhall : let MBText = < Noth | Smth Text>

To decode it, I use:

data MBText  = Smth Text | Noth ()
mbtextDecoder = union ( 
    (Smth <$> constructor "Smth" strictText) 
    <> (Noth <$> constructor "Noth" unit)
   )

First reading of the documentation I got confused into thinking that the appropriate Dhall code would be:

let MBText = < Noth {} | Smth Text>

while in fact it is <Noth | Smth Text>

Is it true that the existing documentation is not sufficiently clear, or is it my fault ?

Merry Christmas, and thank you for this beautiful work !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions