Skip to content

Enable Polymorphic Outputs From Pure Procedures #196

@everythingfunctional

Description

@everythingfunctional

Is there any change that could be made to the language to allow for polymorphic outputs (or outputs with polymorphic components) from pure procedures. As mentioned in #189, there are currently a couple of constraints that disallow this. This significantly conflicts with a functional programming style, as evidenced by a few of my open source libraries; namely erloff, parff, and jsonff. Nothing impure is done anywhere within those libraries, but large swaths of them cannot be marked as pure because of these constraints.

As has been explained to me, the primary reason those constraints exist is that at compile time it cannot be guaranteed that a polymorphic entity won't have a dynamic type with an impure final subroutine. It would seem to me that adding a purefinal attribute to a type, restricting a type and any extended types to having pure final subroutines would be a straightforward fix for this.

Does anyone else have any ideas? Would there be support for a paper? What are the chances we could get this into 202X, or would it have to wait til 202Y?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Clause 15Standard Clause 15: Procedures

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions