Ticket #6018: Injective.hs

File Injective.hs, 296 bytes (added by lunaris, 13 months ago)

Demonstration of injective families

Line 
1{-# LANGUAGE TypeFamilies #-}
2
3module Injective where
4
5injective family F (a :: *) :: *
6
7type instance F Int   = Bool
8type instance F Bool  = Int
9
10f :: F a -> F a
11f x = x
12
13--g :: F Int -> F Int
14g x = f x
15
16injective family G (a :: *) :: *
17
18type instance G a = a
19
20h :: G a -> G a
21h = id
22
23i x = h x