I'm not sure this can (or should) be fixed, but let me report for our info.
For example, in ghci, pasting the following snippet raises a type error:
:set -XTypeOperators
:set -XDataKinds
import Data.Extensible
type Foo = Record '["func" >: Int -> Bool]
<interactive>:4:19: error:
• Expected kind ‘[Assoc k0 *]’,
but ‘'["func" >: Int -> Bool]’ has kind ‘[*]’
• In the first argument of ‘Record’, namely
‘'["func" >: Int -> Bool]’
In the type ‘Record '["func" >: Int -> Bool]’
In the type declaration for ‘Foo’
<interactive>:4:21: error:
• Expected a type, but
‘"func" >: Int’ has kind
‘Assoc GHC.Types.Symbol *’
• In the first argument of ‘Record’, namely
‘'["func" >: Int -> Bool]’
In the type ‘Record '["func" >: Int -> Bool]’
In the type declaration for ‘Foo’
Because GHC interprets "func" >: Int -> Bool as:
("func" >: Int) -> Bool
To avoid the error, we have to wrap the function with parentheses:
-> effectively has -1 fixity, which is not accessible to us. I don't think there's a way to work around. You could define a synonym for -> with higher fixity though.
I'm not sure this can (or should) be fixed, but let me report for our info.
For example, in ghci, pasting the following snippet raises a type error:
Because GHC interprets
"func" >: Int -> Bool
as:To avoid the error, we have to wrap the function with parentheses: