Can't bind with ScopedTypeVariables in a let - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Georgi Lyubenov // googleson78
     You cannot bind scoped type variable a
        in a pattern binding signature

why tho?

Georgi Lyubenov // googleson78
let (smth :: Smth a) = ...
 in ...
TheMatten

Try case - I think there were some technicalities behind that decision

TheMatten

https://stackoverflow.com/questions/46077442/why-do-haskells-scoped-type-variables-not-allow-binding-of-type-variables-in-pa

I noticed that GHC's ScopedTypeVariables is able to bind type variables in function patterns but not let patterns. As a minimal example, consider the type data Foo where Foo :: Typeable a => ...
Georgi Lyubenov // googleson78

thanks for using google in my stead!

Georgi Lyubenov // googleson78

:grinning_face_with_smiling_eyes: sorry

Georgi Lyubenov // googleson78

honestly wasn't expecting to find an answer so I didn't even bother..

TheMatten

I additionally found this (see 5))