X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fc%CE%BBash.git;a=blobdiff_plain;f=Bits.hs;h=558a12b1f24b5b7465baecda7cc402eeabd84c30;hp=845105d02a49cd4d3966405a316ff021dc4e96fb;hb=3f39038911a675d91b5147761e16296d3ab25743;hpb=89dda45ec76981b8f3b84cac1537b776df479efa diff --git a/Bits.hs b/Bits.hs index 845105d..558a12b 100644 --- a/Bits.hs +++ b/Bits.hs @@ -1,5 +1,13 @@ +{-# LANGUAGE FlexibleContexts,GADTs,ExistentialQuantification,LiberalTypeSynonyms,TemplateHaskell, DeriveDataTypeable #-} + module Bits where +-- import qualified Data.Param.TFVec as TFVec +-- import qualified Types +import Language.Haskell.TH.Lift + +import Data.Typeable + --class Signal a where -- hwand :: a -> a -> a -- hwor :: a -> a -> a @@ -38,19 +46,23 @@ displaysig High = "1" displaysig Low = "0" -- The plain Bit type -data Bit = High | Low -- | DontCare - deriving (Show, Eq, Read) +data Bit = High | Low + deriving (Show, Eq, Read, Typeable) + +$(deriveLift1 ''Bit) -- A function to prettyprint a bitvector --displaysigs :: (Signal s) => [s] -> String -displaysigs :: [Bit] -> String -displaysigs = (foldl (++) "") . (map displaysig) +-- displaysigs :: [Bit] -> String +-- displaysigs = (foldl (++) "") . (map displaysig) -type Stream a = [a] +-- type Stream a = [a] -- An infinite streams of highs or lows -lows = Low : lows -highs = High : highs +-- lows = Low : lows +-- highs = High : highs +-- +-- type BitVec len = TFVec.TFVec len Bit -- vim: set ts=8 sw=2 sts=2 expandtab: