Commit b416630f authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #11728

parent 067335a6
{-# LANGUAGE UndecidableInstances, PatternSynonyms, GADTs #-}
module T11728 where
import Data.Kind
import Data.Int
import GHC.TypeLits
import Text.Show.Functions
data Ty ty where
I :: Ty Int
A :: Ty a -> Ty [a]
class GetTy ty where getTy :: Ty ty
instance GetTy Int where getTy = I
instance GetTy ty => GetTy [ty] where
getTy = A getTy
data E a where
UnOp :: Unary a b -> (E a -> E b)
pattern LEN :: () => (GetTy a) => E [a] -> E Int
pattern LEN xs <- UnOp (Un OpLen _) xs where
LEN xs = UnOp (Un OpLen length) xs
data Unary a b where
Un :: (GetTy a, GetTy b) => UnOp a b -> (a -> b) -> Unary a b
data UnOp a b where
OpLen :: GetTy a => UnOp [a] Int
......@@ -247,3 +247,4 @@ test('T11389', req_interp, run_command, ['$MAKE -s --no-print-directory T11389']
test('T11524a', normal, ghci_script, ['T11524a.script'])
test('T11456', normal, ghci_script, ['T11456.script'])
test('TypeAppData', normal, ghci_script, ['TypeAppData.script'])
test('T11728', normal, ghci_script, ['T11728.script'])
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