1 {-# LANGUAGE FlexibleContexts,GADTs,ExistentialQuantification,LiberalTypeSynonyms,TemplateHaskell, DeriveDataTypeable #-}
5 -- import qualified Data.Param.TFVec as TFVec
6 -- import qualified Types
7 import Language.Haskell.TH.Lift
11 --class Signal a where
12 -- hwand :: a -> a -> a
13 -- hwor :: a -> a -> a
14 -- hwxor :: a -> a -> a
17 -- -- Prettyprint a signal. We're not extending Show here, since show must
18 -- -- return a valid haskell syntax
19 -- displaysig :: a -> String
21 hwand :: Bit -> Bit -> Bit
22 hwor :: Bit -> Bit -> Bit
23 hwxor :: Bit -> Bit -> Bit
26 -- Prettyprint Bit signal. We're not extending Show here, since show must
27 -- return Bit valid haskell syntax
28 displaysig :: Bit -> String
30 --instance Signal Bit where
31 High `hwand` High = High
38 High `hwxor` Low = High
39 Low `hwxor` High = High
50 deriving (Show, Eq, Read, Typeable)
54 -- A function to prettyprint a bitvector
56 --displaysigs :: (Signal s) => [s] -> String
57 -- displaysigs :: [Bit] -> String
58 -- displaysigs = (foldl (++) "") . (map displaysig)
60 -- type Stream a = [a]
62 -- An infinite streams of highs or lows
64 -- highs = High : highs
66 -- type BitVec len = TFVec.TFVec len Bit
68 -- vim: set ts=8 sw=2 sts=2 expandtab: