on master help sign in
Make arguments implicit in HVect.Shows
commit8e43d11ae54b950f52e3aaea73b1d448a9107c34 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateFri 7 Oct 2016, 10:00 (10 years ago) parentf467346
2 files changed+6−6
libs/base/Data/HVect.idr+4−4 test/regression001/reg036.idr+2−2
libs/base/Data/HVect.idr+4−4
@@ -59,16 +59,16 @@ implementation (DecEq t, DecEq (HVect ts)) => DecEq (HVect (t::ts)) where
5959 decEq (z::xs) (z::ys) | Yes Refl | No ctr = No (ctr . hvectInjective2)
6060 decEq (x::xs) (y::ys) | No ctr = No (ctr . hvectInjective1)
6161
62−interface Shows (k : Nat) (ts : Vect k Type) where
62+interface Shows (ts : Vect k Type) where
6363 shows : HVect ts -> Vect k String
6464
65−implementation Shows Z [] where
65+implementation Shows [] where
6666 shows [] = []
6767
68−implementation (Show t, Shows k ts) => Shows (S k) (t::ts) where
68+implementation (Show t, Shows ts) => Shows (t::ts) where
6969 shows (x::xs) = show x :: shows xs
7070
71−implementation (Shows k ts) => Show (HVect ts) where
71+implementation (Shows ts) => Show (HVect ts) where
7272 show xs = "[" ++ (pack . intercalate [','] . map unpack . toList $ shows xs) ++ "]"
7373
7474||| Extract an arbitrary element of the correct type.
test/regression001/reg036.idr+2−2
@@ -5,8 +5,8 @@ using (m : Nat, ts : Vect m Type)
55 data HV : Vect n Type -> Type where
66 MkHV : HVect ts -> HV ts
77
8− showHV : Shows m ts => HV ts -> String
8+ showHV : Shows ts => HV ts -> String
99 showHV (MkHV v) = show v
1010
11− implementation Shows m ts => Show (HV ts) where
11+ implementation Shows ts => Show (HV ts) where
1212 show = showHV