MicroHs
MicroHs copied to clipboard
bidirectional pattern synonyms problem
ghc 9.6.6 -XPatternSynonyms accepts
newtype WindowsString = WindowsString{ getWindowsString :: String }
pattern WS :: String -> WindowsString
pattern WS { unWS } <- WindowsString unWS where
WS a = WindowsString a
{-# COMPLETE WS #-}
main = return ()
mhs 0.14.17.0 rejects
mhs: uncaught exception: error: "bidirectional-pattern-synonym.hs": line 4, col 12:
found: {
expected: LIdent ( = <- , :: ∷
based on real code in os-string package
That's right. MicroHs does not implement record pattern synonyms. I will take a look to see if it looks easy.
Record pattern synonyms is not easy to implement in MicroHs. I'll tag this as an enhancement.