Skip to content

How do I actually create bottom values? #26

@cgohla

Description

@cgohla

It's not clear to me at all from the README or from the generated code, how to create the bottom value (or Nothing in Haskell parlance).

I have this generated code:

// OptionalFlavor is an optional Flavor.
type OptionalFlavor struct {
        value *Flavor
}

// NewOptionalFlavor creates an optional.OptionalFlavor from a Flavor.
func NewOptionalFlavor(v Flavor) OptionalFlavor {
        return OptionalFlavor{&v}
}

so if I have a Flavor I know how to get an OptionalFlavor. What I expected to find here was a nullary function that returns the Nothing case.

Perhaps I don't understand how this is supposed to work, or the README needs clarification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions