nwolverson / purescript-language-server

MIT License
183 stars 41 forks source link

Lenses and inlined types #166

Closed wclr closed 2 years ago

wclr commented 2 years ago

I believe we don't need signature lenses for such a case:

image

nwolverson commented 2 years ago

Does the compiler suppress the declaration type warning in this case?

natefaubion commented 2 years ago

Does the compiler suppress the declaration type warning in this case?

Yeah, at this point in type checking

x :: Int
x = 42

Has been desugared into

x = 42 :: Int

So there's no difference to the compiler.

nwolverson commented 2 years ago

Thanks @natefaubion, I didn't realise that. In fact I've never come across any code formatted like this either.

In which case I fully agree, we shouldn't show a lens in this situation.

thomashoneyman commented 2 years ago

In fact I've never come across any code formatted like this either.

I mostly see it in modules that define proxies or constants, like

_foo = Proxy :: Proxy "foo"