Commit 256c2cfc authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #11336

parent f5ad1f03
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
module Bug where
data AST s a
where
Sym :: s a -> AST s a
(:$) :: AST s (a -> b) -> AST s a -> AST s b
data A sig where A :: A (a -> a)
data B sig where B :: B (a -> a)
data AB a
where
AA :: A a -> AB a
BB :: B a -> AB a
class Prj s where prj :: AB a -> Maybe (s a)
instance Prj A
where
prj (AA s) = Just s
prj _ = Nothing
instance Prj B
where
prj (BB s) = Just s
prj _ = Nothing
pattern SymP s <- Sym (prj -> Just s)
fun :: AST AB a -> AST AB a
fun (SymP A :$ _) = undefined
fun (SymP B :$ _) = undefined
......@@ -47,3 +47,4 @@ test('T10897', normal, multi_compile, ['T10897', [
test('T11224b', normal, compile, [''])
test('MoreEx', normal, compile, [''])
test('T11283', normal, compile, [''])
test('T11336', normal, compile, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment