X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=Bits.hs;h=435b04e1efc5cb0292b345111f5584a694cf2521;hb=83a9910bd8031fbce225992e432e7dfba73b5c0f;hp=c0717bff475bf107e5117c5e9cb6f441787e144d;hpb=9b7d00ad53acfc821840051ef693d87470b4462b;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/Bits.hs b/Bits.hs index c0717bf..435b04e 100644 --- a/Bits.hs +++ b/Bits.hs @@ -1,5 +1,11 @@ +{-# LANGUAGE FlexibleContexts,GADTs,ExistentialQuantification,LiberalTypeSynonyms,TemplateHaskell #-} + module Bits where +import qualified Data.Param.TFVec as TFVec +import qualified Types +import Language.Haskell.TH.Lift + --class Signal a where -- hwand :: a -> a -> a -- hwor :: a -> a -> a @@ -38,9 +44,11 @@ displaysig High = "1" displaysig Low = "0" -- The plain Bit type -data Bit = High | Low | DontCare +data Bit = High | Low deriving (Show, Eq, Read) +$(deriveLift1 ''Bit) + -- A function to prettyprint a bitvector --displaysigs :: (Signal s) => [s] -> String @@ -53,4 +61,6 @@ type Stream a = [a] lows = Low : lows highs = High : highs +type BitVec len = TFVec.TFVec len Bit + -- vim: set ts=8 sw=2 sts=2 expandtab: