Add a testcase for PatternSynonym decls (needs fixing)
parent
2d07900005
commit
b546b514b0
|
@ -126,6 +126,26 @@ pattern myLeftVariableName `MyInfixPatternMatcher` myRightVariableName <-
|
|||
pattern J :: a -> Maybe a
|
||||
pattern J x = Just x
|
||||
|
||||
#test pattern synonym multiple cases
|
||||
{-# LANGUAGE PatternSynonyms #-}
|
||||
{-# LANGUAGE ViewPatterns #-}
|
||||
pattern Signed x <- (asSigned -> x) where
|
||||
Signed (Neg x) = -x
|
||||
Signed Zero = 0
|
||||
Signed (Pos x) = x
|
||||
|
||||
#test pattern synonym multiple cases with comments
|
||||
{-# LANGUAGE PatternSynonyms #-}
|
||||
{-# LANGUAGE ViewPatterns #-}
|
||||
pattern Signed x <- (asSigned -> x) where
|
||||
Signed (Neg x) = -x -- negative comment
|
||||
Signed Zero = 0 -- zero comment
|
||||
Signed (Pos x) = x -- positive comment
|
||||
|
||||
#test Pattern synonym types multiple names
|
||||
{-# LANGUAGE PatternSynonyms #-}
|
||||
pattern J, K :: a -> Maybe a
|
||||
|
||||
#test Pattern synonym type sig wrapped
|
||||
{-# LANGUAGE PatternSynonyms #-}
|
||||
pattern LongMatcher
|
||||
|
|
Loading…
Reference in New Issue