Commit 5e36a28a authored by chak@cse.unsw.edu.au.'s avatar chak@cse.unsw.edu.au.

TFs: Examples for Relaxed Conditions

parent f8d0b067
{-# LANGUAGE TypeFamilies #-}
module RelaxedExamples where
type family F1 a
type family F2 a
type family F3 a
type family F4 a
type instance F1 x = x
type instance F2 [Bool] = F2 Char
type instance F3 (a, b) = (F3 a, F3 b)
type instance F4 x = (x, x)
\ No newline at end of file
......@@ -26,6 +26,7 @@ test('Simple22', normal, compile, [''])
test('Simple23', normal, compile, [''])
test('Simple24', normal, compile, [''])
test('RelaxedExamples', normal, compile, [''])
test('NonLinearLHS', normal, compile, [''])
test('ind1', normal, compile, [''])
......
{-# LANGUAGE TypeFamilies #-}
module NotRelaxedExamples where
type family F1 a
type family F2 a
type family F3 a
type instance F1 Char = F1 (F1 Char)
type instance F2 [x] = F2 [x]
type instance F3 Bool = F3 [Char]
NotRelaxedExamples.hs:9:0:
Nested type family application
in the type family application: F1 (F1 Char)
(Use -XUndecidableInstances to permit this)
In the type synonym instance declaration for `F1'
NotRelaxedExamples.hs:10:0:
Application is no smaller than the instance head
in the type family application: F2 [x]
(Use -XUndecidableInstances to permit this)
In the type synonym instance declaration for `F2'
NotRelaxedExamples.hs:11:0:
Application is no smaller than the instance head
in the type family application: F3 [Char]
(Use -XUndecidableInstances to permit this)
In the type synonym instance declaration for `F3'
......@@ -26,6 +26,8 @@ test('Simple16', normal, compile_fail, [''])
test('TyFamArity1', normal, compile_fail, [''])
test('TyFamArity2', normal, compile_fail, [''])
test('TyFamUndec', normal, compile_fail, [''])
test('NotRelaxedExamples', normal, compile_fail, [''])
test('NonLinearSigErr', normal, compile_fail, [''])
test('GADTwrong1', normal, compile_fail, [''])
......
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