Skip to content

Function type mistaken for ViewPatterns in T2T VDQ

Passing 'function type` arguments to VDQ functions, without the type keyword, causes GHC to get confused, and think it's a view pattern.

Example (card is defined in #24225):

t1 = card (type (Bool -> Bool)) -- Fine

-- Fails and triggers the error message below
t2 = card (Bool -> Bool) 
{-
src/VDQ.hs:71:11-22: error: [GHC-66228] …
    View pattern in expression context: Bool -> Bool
   |
Compilation failed.
-}

GHC version: 9.9.20231126

Edited by Artin Ghasivand
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information