Skip to content

Type inferred proxy literal #3075

@kcsongor

Description

@kcsongor

The new proxy syntax makes specifying types inline a lot nicer, but there are still situations where it would be preferable to lift the proxy out of the context to a top-level definition, e.g.:

p :: @"Some long string"
p = @

However, the bare @ is a syntax error, currently - and having to copy the type would be a little inconvenient.

My current workaround is a little clunky:

p :: SProxy "Some long string"
p = SProxy

fromSProxy :: forall a. SProxy a -> @a
fromSProxy _ = @a

and then using fromSProxy p when I need p in a context that expects a @

/cc @rightfold

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions