Skip to content

Prelude asTypeOf isn't very useful #354

@treeowl

Description

@treeowl

The linear prelude exports

asTypeOf :: a %q-> a -> a
asTypeOf = const

That seems practically useless in a linear context. The traditional alternative is found in Data.Proxy, and can be given the following type:

asProxyTypeOf :: a %q-> proxy a -> a
asProxyTypeOf a _ = a

Of course, if one is using TypeApplications, id is also an option. But I'd consider just removing asTypeOf here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions