I’m not sure if this has been proposed already, but after writing PS for ~7 months now, I find that the bit of syntactic sugar I find myself wanting most is a shorter way to write.
a = Proxy :: Proxy Int
I’m not sure if this has been proposed already, nor do I know what would be the best solution. Some candidates:
@Int
!Int
^Int
Int
Int
With perhaps the same operatoin at the type level.
I think this would make code that makes heavy use of proxies easier to write and read.
z = @Int
foo :: forall z x. (@z -> x) -> x
foo i = i @z
Compared to:
z = Proxy :: Proxy Int
foo :: forall z x. ((Proxy :: Proxy z) -> x) -> x
foo i = i (Proxy :: Proxy z)
Thoughts? If this seems reasonable, I can take a crack at a PR (it’d be my first to purescript/purescript … gulp …).
It was problematic because the kind checker was broken. With PolyKinds it wouldn’t be an issue, but I think visible type applications is what we really want anyway.
Thanks. I didn’t know about the wildcard syntax. P :: _ Int is indeed more terse than Proxy :: Proxy Int, although I’d have to write it out several times to get a sense if it is more readable. I agree with Nate that visible type applications would be better as that’s a superset of what I’m talking about. Is there a GH issue and/or PR for that yet?
I’m pretty sure the @TypeName wasn’t added in v0.14.0 because we were first deprecating the @ symbol so that it wasn’t allowed anywhere except in pattern matching:
case _ of
foo@(Tuple a b) -> ...
It was my understanding that it would be added in v0.15.0, but I’m not sure. I also haven’t read through the above linked issue.