Skip to content

bidirectional pattern synonyms problem #294

@claudeha

Description

@claudeha

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions