
On Sat, Jan 21, 2023 at 10:52:33PM +0100, Jaro Reinders wrote:
On 21-01-2023 20:00, Ben Gamari wrote:
However, I suspect you do have a point when it comes to unlifted data constructors. I think it would be fine to allow an application of a data constructor of an unlifted type on the top-level:
type UMaybe :: Type -> UnliftedType data UMaybe a = UNothing | UJust a
x :: UMaybe Int x = UJust 42
Perhaps you could open a ticket for this?
This ticket seems related: #17521 Consider top-level unlifted bindings [1].
Or do you think it needs a separate ticket?
Thanks Jaro. That ticket contains the observation "there are other cases where unlifted types are desireable at the top-level (e.g. saturated data constructor applications). In principle it would be fairly straightforward to incorporate a validity check that admits top-level constructor applications which rejecting function applications if we wanted." So I think that ticket subsumes my question, and filing another one would be redundant. Tom