Skip to content

Commit 0fcb8c9

Browse files
committed
Fix two doctests in GHC-8.2
1 parent c994bf4 commit 0fcb8c9

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/CLaSH/Sized/Vector.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,15 +1680,15 @@ lazyV = lazyV' (repeat undefined)
16801680
-- >>> let append' xs ys = foldr (:>) ys xs
16811681
-- <BLANKLINE>
16821682
-- <interactive>:...
1683-
-- • Occurs check: cannot construct the infinite type: t ~ t + 1
1684-
-- Expected type: a -> Vec t a -> Vec t a
1685-
-- Actual type: a -> Vec t a -> Vec (t + 1) a
1683+
-- • Occurs check: cannot construct the infinite type: ... ~ ... + 1
1684+
-- Expected type: a -> Vec ... a -> Vec ... a
1685+
-- Actual type: a -> Vec ... a -> Vec (... + 1) a
16861686
-- • In the first argument of ‘foldr’, namely ‘(:>)’
16871687
-- In the expression: foldr (:>) ys xs
16881688
-- In an equation for ‘append'’: append' xs ys = foldr (:>) ys xs
16891689
-- • Relevant bindings include
1690-
-- ys :: Vec t a (bound at ...)
1691-
-- append' :: Vec n a -> Vec t a -> Vec t a
1690+
-- ys :: Vec ... a (bound at ...)
1691+
-- append' :: Vec n a -> Vec ... a -> Vec ... a
16921692
-- (bound at ...)
16931693
--
16941694
-- The reason is that the type of 'foldr' is:

src/CLaSH/Tutorial.hs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,14 @@ import Data.Default
8484
{- $setup
8585
>>> :set -XTemplateHaskell
8686
>>> :set -XDataKinds
87-
>>> let ma acc (x,y) = acc + x * y
8887
>>> :{
89-
let macT acc (x,y) = (acc',o)
88+
let ma :: Num a => a -> (a, a) -> a
89+
ma acc (x,y) = acc + x * y
90+
:}
91+
92+
>>> :{
93+
let macT :: Num a => a -> (a,a) -> (a,a)
94+
macT acc (x,y) = (acc',o)
9095
where
9196
acc' = ma acc (x,y)
9297
o = acc
@@ -427,7 +432,7 @@ Going back to the original specification we note the following:
427432
When we examine the type of 'macT' we see that is still completely combinational:
428433
429434
>>> :t macT
430-
macT :: Num t => t -> (t, t) -> (t, t)
435+
macT :: Num a => a -> (a, a) -> (a, a)
431436
432437
The "CLaSH.Prelude" library contains a function that creates a sequential
433438
circuit from a combinational circuit that has the same Mealy machine type /

0 commit comments

Comments
 (0)