packages feed

clash 0.1.1.1 → 0.1.2.0

raw patch · 6 files changed

+194/−185 lines, 6 files

Files

CLasH/HardwareTypes.hs view
@@ -7,12 +7,12 @@   , module Data.Param.Index   , module Data.Param.Signed   , module Data.Param.Unsigned-  , module Prelude   , module Data.Bits   , module Language.Haskell.TH.Lift   , module Control.Category   , module Control.Arrow   , module Control.Monad.Fix+  , module CLasH.Translator.Annotations   , Bit(..)   , State(..)   , hwand@@ -27,8 +27,6 @@   , (^^^)   ) where -import qualified Prelude as P-import Prelude (Bool(..),Num(..),Eq(..),Ord(..),snd,fst,otherwise,(&&),(||),not,(>>),(>>=),fail,return) import Types import Data.Param.Integer (HWBits(..)) import Data.Param.Vector@@ -43,7 +41,11 @@ import Control.Category (Category,(.),id) import Control.Arrow (Arrow,arr,first,ArrowLoop,loop,(>>>),second,returnA) import Control.Monad.Fix (mfix)+import qualified Prelude as P+import Prelude hiding (id, (.)) +import CLasH.Translator.Annotations+ newtype State s = State s deriving (P.Show)  -- The plain Bit type@@ -58,15 +60,14 @@ hwnot :: Bit -> Bit  High `hwand` High = High-_ `hwand` _ = Low+_    `hwand` _    = Low -High `hwor` _  = High-_ `hwor` High  = High-Low `hwor` Low = Low+Low  `hwor` Low   = Low+_    `hwor` _     = High -High `hwxor` Low = High-Low `hwxor` High = High-_ `hwxor` _      = Low+High `hwxor` Low  = High+Low  `hwxor` High = High+_    `hwxor` _    = Low  hwnot High = Low hwnot Low  = High@@ -88,7 +89,7 @@     data_out  = mem!rdaddr     -- Only write data_in to memory if write is enabled     mem' =  if wrenable then-              replace mem wraddr data_in+              vreplace mem wraddr data_in             else               mem 
CLasH/Normalize.hs view
@@ -1017,7 +1017,7 @@ arrowLiftSExtract c expr@(App _ _) | isLift (appliedF, alreadyMappedArgs) = do       -- Collect the lifted function and the initial state       let (Var liftS) = appliedF-      let [realfun, Var initvalue] = get_val_args (Var.varType liftS) alreadyMappedArgs+      let [realfun, initvalue] = get_val_args (Var.varType liftS) alreadyMappedArgs       -- TODO: All of this looks/is hacked! Needs rethinking and rewriting       (realfunBndr, realfunBody) <- case realfun of         (Var realfunBndr) -> do@@ -1037,14 +1037,28 @@       id1 <- Trans.lift $ mkInternalVar "param" arg1Ty       id2 <- Trans.lift $ mkInternalVar "param" arg2Ty       -- Associate initial value with the cloned functions-      initbndr_maybe <- Trans.lift $ getGlobalBind initvalue-      initbndr <- case initbndr_maybe of-        (Just a) -> return initvalue-        Nothing -> do-          let body = Var initvalue-          initId <- Trans.lift $ mkBinderFor body ("init" ++ Name.getOccString realfunBndr)-          Trans.lift $ addGlobalBind initId body-          return initId            +      initbndr <- case initvalue of+        (Var initvalueBndr) -> do+          initBndrMaybe <- Trans.lift $ getGlobalBind initvalueBndr+          case initBndrMaybe of+            (Just a) -> return initvalueBndr+            Nothing -> do+              let body = Var initvalueBndr+              initId <- Trans.lift $ mkBinderFor body ("init" ++ Name.getOccString realfunBndr)+              Trans.lift $ addGlobalBind initId body+              return initId+        otherwise -> do+          initId <- Trans.lift $ mkBinderFor initvalue ("init" ++ Name.getOccString realfunBndr)+          Trans.lift $ addGlobalBind initId initvalue+          return initId+      -- initbndr_maybe <- Trans.lift $ getGlobalBind initvalue+      -- initbndr <- case initbndr_maybe of+      --   (Just a) -> return initvalue+      --   Nothing -> do+      --     let body = Var initvalue+      --     initId <- Trans.lift $ mkBinderFor body ("init" ++ Name.getOccString realfunBndr)+      --     Trans.lift $ addGlobalBind initId body+      --     return initId                   Trans.lift $ MonadState.modify tsInitStates (Map.insert realfunBndr initbndr)       -- Return the extracted expression              change (Lam id1 (Lam id2 (App (App realfunBody (Var id1)) (Var id2))))
CLasH/VHDL/Constants.hs view
@@ -81,7 +81,7 @@  -- | sel (function select in original Haskell source) function identifier selId :: String-selId = "select"+selId = "vselect"   -- | ltplus (function (<+) in original Haskell source) function identifier@@ -91,7 +91,7 @@  -- | plusplus (function (++) in original Haskell source) function identifier plusplusId :: String-plusplusId = "++"+plusplusId = "<++>"   -- | empty function identifier@@ -108,37 +108,37 @@  -- | length function identifier lengthId :: String-lengthId = "length"+lengthId = "vlength"   -- | isnull (function null in original Haskell source) function identifier nullId :: String-nullId = "null"+nullId = "vnull"   -- | replace function identifier replaceId :: String-replaceId = "replace"+replaceId = "vreplace"   -- | head function identifier headId :: String-headId = "head"+headId = "vhead"   -- | last function identifier lastId :: String-lastId = "last"+lastId = "vlast"   -- | init function identifier initId :: String-initId = "init"+initId = "vinit"   -- | tail function identifier tailId :: String-tailId = "tail"+tailId = "vtail"  -- | minimum ftp function identifier minimumId :: String@@ -146,84 +146,84 @@  -- | take function identifier takeId :: String-takeId = "take"+takeId = "vtake"   -- | drop function identifier dropId :: String-dropId = "drop"+dropId = "vdrop"  -- | shiftl function identifier shiftIntoLId :: String-shiftIntoLId = "shiftIntoL"+shiftIntoLId = "+>>"  -- | shiftr function identifier shiftIntoRId :: String-shiftIntoRId = "shiftIntoR"+shiftIntoRId = "<<+"  -- | rotl function identifier rotlId :: String-rotlId = "rotl"+rotlId = "vrotl"  -- | reverse function identifier rotrId :: String-rotrId = "rotr"+rotrId = "vrotr"  -- | concatenate the vectors in a vector concatId :: String-concatId = "concat"+concatId = "vconcat"  -- | reverse function identifier reverseId :: String-reverseId = "reverse"+reverseId = "vreverse"  -- | iterate function identifier iterateId :: String-iterateId = "iterate"+iterateId = "viterate"  -- | iteraten function identifier iteratenId :: String-iteratenId = "iteraten"+iteratenId = "viteraten"  -- | iterate function identifier generateId :: String-generateId = "generate"+generateId = "vgenerate"  -- | iteraten function identifier generatenId :: String-generatenId = "generaten"+generatenId = "vgeneraten"  -- | copy function identifier copyId :: String-copyId = "copy"+copyId = "vcopy"  -- | copyn function identifier copynId :: String-copynId = "copyn"+copynId = "vcopyn"  -- | map function identifier mapId :: String-mapId = "map"+mapId = "vmap"  -- | zipwith function identifier zipWithId :: String-zipWithId = "zipWith"+zipWithId = "vzipWith"  -- | foldl function identifier foldlId :: String-foldlId = "foldl"+foldlId = "vfoldl"  -- | foldr function identifier foldrId :: String-foldrId = "foldr"+foldrId = "vfoldr"  -- | zip function identifier zipId :: String-zipId = "zip"+zipId = "vzip"  -- | unzip function identifier unzipId :: String-unzipId = "unzip"+unzipId = "vunzip"  -- | hwxor function identifier hwxorId :: String@@ -251,7 +251,7 @@ shiftRId = "shiftR"  lengthTId :: String-lengthTId = "lengthT"+lengthTId = "vlengthT"  fstId :: String fstId = "fst"@@ -260,7 +260,7 @@ sndId = "snd"  splitId :: String-splitId = "split"+splitId = "vsplit"  -- Equality Operations equalityId :: String@@ -331,10 +331,10 @@ resizeId = "resize"  resizeWordId :: String-resizeWordId = "resizeWord"+resizeWordId = "resizeUnsigned"  resizeIntId :: String-resizeIntId = "resizeInt"+resizeIntId = "resizeSigned"  smallIntegerId :: String smallIntegerId = "smallInteger"
CLasH/VHDL/Generate.hs view
@@ -801,13 +801,13 @@ genSnd :: BuiltinBuilder genSnd = genNoInsts genSnd' genSnd' :: (Either CoreSyn.CoreBndr AST.VHDLName) -> CoreSyn.CoreBndr -> [(Either CoreSyn.CoreExpr AST.Expr, Type.Type)] -> TranslatorSession [AST.ConcSm]-genSnd' (Left res) f args@[(arg,argType)] = do {+genSnd' res f args@[(arg,argType)] = do {   ; arg_htype <- MonadState.lift tsType $ mkHType "\nGenerate.genSnd: Invalid argument type" argType   ; [AST.PrimName argExpr] <- argsToVHDLExprs [arg]    ; let {          ; labels      = getFieldLabels arg_htype 0         ; argexprB    = vhdlNameToVHDLExpr $ mkSelectedName argExpr (labels!!1)-        ; assign      = mkUncondAssign (Left res) argexprB+        ; assign      = mkUncondAssign res argexprB         } ;     -- Return the generate functions   ; return [assign]@@ -1532,8 +1532,8 @@     lengthTSpec = AST.Function (mkVHDLExtId lengthTId) [AST.IfaceVarDec vecPar vectorTM] naturalTM     lengthTExpr = AST.ReturnSm (Just $ AST.PrimName (AST.NAttribute $                                  AST.AttribName (AST.NSimple vecPar) (AST.NSimple $ mkVHDLBasicId lengthId) Nothing))-    shiftlSpec = AST.Function (mkVHDLExtId shiftIntoLId) [AST.IfaceVarDec vecPar vectorTM,-                                   AST.IfaceVarDec aPar   elemTM  ] vectorTM +    shiftlSpec = AST.Function (mkVHDLExtId shiftIntoLId) [AST.IfaceVarDec aPar elemTM,+                                     AST.IfaceVarDec vecPar vectorTM] vectorTM      -- variable res : fsvec_x (0 to vec'length-1);     shiftlVar =       AST.VarDec resId 
Data/Param/Vector.hs view
@@ -1,46 +1,46 @@-{-# LANGUAGE StandaloneDeriving, ExistentialQuantification, ScopedTypeVariables, TemplateHaskell, TypeOperators, TypeFamilies #-}+{-# LANGUAGE TemplateHaskell, ExistentialQuantification, TypeOperators, TypeFamilies, ScopedTypeVariables #-} module Data.Param.Vector   ( Vector   , empty   , (+>)   , singleton-  , vectorTH+  , vTH   , unsafeVector   , readVector-  , length-  , lengthT+  , vlength+  , vlengthT   , fromVector-  , null+  , vnull   , (!)-  , replace-  , head-  , last-  , init-  , tail-  , take-  , drop-  , select+  , vreplace+  , vhead+  , vlast+  , vinit+  , vtail+  , vtake+  , vdrop+  , vselect   , (<+)-  , (++)-  , map-  , zipWith-  , foldl-  , foldr-  , zip-  , unzip-  , shiftIntoL-  , shiftIntoR-  , rotl-  , rotr-  , concat-  , reverse-  , iterate-  , iteraten-  , generate-  , generaten-  , copy-  , copyn-  , split+  , (<++>)+  , vmap+  , vzipWith+  , vfoldl+  , vfoldr+  , vzip+  , vunzip+  , (+>>)+  , (<<+)+  , vrotl+  , vrotr+  , vconcat+  , vreverse+  , viterate+  , viteraten+  , vgenerate+  , vgeneraten+  , vcopy+  , vcopyn+  , vsplit   ) where      import Types@@ -49,20 +49,14 @@ import Data.Param.Index  import Data.Typeable-import qualified Prelude as P-import Prelude hiding (-  null, length, head, tail, last, init, take, drop, (++), map, foldl, foldr,-  zipWith, zip, unzip, concat, reverse, iterate )-import qualified Data.Foldable as DF (Foldable, foldr)-import qualified Data.Traversable as DT (Traversable(traverse))+import qualified Data.Foldable as DF+import qualified Data.Traversable as DT import Language.Haskell.TH hiding (Pred) import Language.Haskell.TH.Syntax (Lift(..))  newtype (NaturalT s) => Vector s a = Vector {unVec :: [a]}   deriving Eq --- deriving instance (NaturalT s, Typeable s, Data s, Typeable a, Data a) => Data (TFVec s a)- -- ========================== -- = Constructing functions = -- ==========================@@ -79,16 +73,16 @@ singleton x = x +> empty  -- FIXME: Not the most elegant solution... but it works for now in clash-vectorTH :: (Lift a) => [a] -> ExpQ+vTH :: (Lift a) => [a] -> ExpQ -- vectorTH xs = sigE [| (TFVec xs) |] (decTFVecT (toInteger (P.length xs)) xs)-vectorTH [] = [| empty |]-vectorTH [x] = [| singleton x |]-vectorTH (x:xs) = [| x +> $(vectorTH xs) |]+vTH []     = [| empty |]+vTH [x]    = [| singleton x |]+vTH (x:xs) = [| x +> $(vTH xs) |]  unsafeVector :: NaturalT s => s -> [a] -> Vector s a unsafeVector l xs-  | fromIntegerT l /= P.length xs =-    error (show 'unsafeVector P.++ ": dynamic/static lenght mismatch")+  | fromIntegerT l /= length xs =+    error (show 'unsafeVector ++ ": dynamic/static lenght mismatch")   | otherwise = Vector xs  readVector :: (Read a, NaturalT s) => String -> Vector s a@@ -97,17 +91,17 @@ -- ======================= -- = Observing functions = -- =======================-length :: forall s a . NaturalT s => Vector s a -> Int-length _ = fromIntegerT (undefined :: s)+vlength :: forall s a . NaturalT s => Vector s a -> Int+vlength _ = fromIntegerT (undefined :: s) -lengthT :: NaturalT s => Vector s a -> s-lengthT = undefined+vlengthT :: NaturalT s => Vector s a -> s+vlengthT = undefined  fromVector :: NaturalT s => Vector s a -> [a] fromVector (Vector xs) = xs -null :: Vector D0 a -> Bool-null _ = True+vnull :: Vector D0 a -> Bool+vnull _ = True  (!) :: PositiveT s => Vector s a -> Index s -> a (Vector xs) ! i = xs !! (fromInteger (toInteger i))@@ -115,121 +109,121 @@ -- ========================== -- = Transforming functions = -- ==========================-replace :: PositiveT s =>+vreplace :: PositiveT s =>   Vector s a -> Index s -> a -> Vector s a-replace (Vector xs) i y = Vector $ replace' xs (toInteger i) y+vreplace (Vector xs) i y = Vector $ replace' xs (toInteger i) y   where replace' []     _ _ = []         replace' (_:xs) 0 y = (y:xs)         replace' (x:xs) n y = x : (replace' xs (n-1) y)   -head :: PositiveT s => Vector s a -> a-head = P.head . unVec+vhead :: PositiveT s => Vector s a -> a+vhead = head . unVec -tail :: PositiveT s => Vector s a -> Vector (Pred s) a-tail = liftV P.tail+vtail :: PositiveT s => Vector s a -> Vector (Pred s) a+vtail = liftV tail -last :: PositiveT s => Vector s a -> a-last = P.last . unVec+vlast :: PositiveT s => Vector s a -> a+vlast = last . unVec -init :: PositiveT s => Vector s a -> Vector (Pred s) a-init = liftV P.init+vinit :: PositiveT s => Vector s a -> Vector (Pred s) a+vinit = liftV init -take :: NaturalT i => i -> Vector s a -> Vector (Min s i) a-take i = liftV $ P.take (fromIntegerT i)+vtake :: NaturalT i => i -> Vector s a -> Vector (Min s i) a+vtake i = liftV $ take (fromIntegerT i) -drop :: NaturalT i => i -> Vector s a -> Vector (s :-: (Min s i)) a-drop i = liftV $ P.drop (fromIntegerT i)+vdrop :: NaturalT i => i -> Vector s a -> Vector (s :-: (Min s i)) a+vdrop i = liftV $ drop (fromIntegerT i) -select :: (NaturalT f, NaturalT s, NaturalT n, (f :<: i) ~ True, -          (((s :*: n) :+: f) :<=: i) ~ True) => -          f -> s -> n -> Vector i a -> Vector n a-select f s n = liftV (select' f' s' n')+vselect :: (NaturalT f, NaturalT s, NaturalT n, (f :<: i) ~ True, +           (((s :*: n) :+: f) :<=: i) ~ True) => +           f -> s -> n -> Vector i a -> Vector n a+vselect f s n = liftV (select' f' s' n')   where (f', s', n') = (fromIntegerT f, fromIntegerT s, fromIntegerT n)-        select' f s n = ((selectFirst0 s n).(P.drop f))+        select' f s n = ((selectFirst0 s n).(drop f))         selectFirst0 :: Int -> Int -> [a] -> [a]         selectFirst0 s n l@(x:_)-          | n > 0 = x : selectFirst0 s (n-1) (P.drop s l)+          | n > 0 = x : selectFirst0 s (n-1) (drop s l)           | otherwise = []         selectFirst0 _ 0 [] = []  (<+) :: Vector s a -> a -> Vector (Succ s) a-(<+) (Vector xs) x = Vector (xs P.++ [x])+(<+) (Vector xs) x = Vector (xs ++ [x]) -(++) :: Vector s a -> Vector s2 a -> Vector (s :+: s2) a-(++) = liftV2 (P.++)+(<++>) :: Vector s a -> Vector s2 a -> Vector (s :+: s2) a+(<++>) = liftV2 (++)  infixl 5 <+-infixr 5 +++infixr 5 <++> -map :: (a -> b) -> Vector s a -> Vector s b-map f = liftV (P.map f)+vmap :: (a -> b) -> Vector s a -> Vector s b+vmap f = liftV (map f) -zipWith :: (a -> b -> c) -> Vector s a -> Vector s b -> Vector s c-zipWith f = liftV2 (P.zipWith f)+vzipWith :: (a -> b -> c) -> Vector s a -> Vector s' b -> Vector (Min s s') c+vzipWith f = liftV2 (zipWith f) -foldl :: (a -> b -> a) -> a -> Vector s b -> a-foldl f e = (P.foldl f e) . unVec+vfoldl :: (a -> b -> a) -> a -> Vector s b -> a+vfoldl f e = (foldl f e) . unVec -foldr :: (b -> a -> a) -> a -> Vector s b -> a-foldr f e = (P.foldr f e) . unVec+vfoldr :: (b -> a -> a) -> a -> Vector s b -> a+vfoldr f e = (foldr f e) . unVec -zip :: Vector s a -> Vector s b -> Vector s (a, b)-zip = liftV2 P.zip+vzip :: Vector s a -> Vector s b -> Vector s (a, b)+vzip = liftV2 zip -unzip :: Vector s (a, b) -> (Vector s a, Vector s b)-unzip (Vector xs) = let (a,b) = P.unzip xs in (Vector a, Vector b)+vunzip :: Vector s (a, b) -> (Vector s a, Vector s b)+vunzip (Vector xs) = let (a,b) = unzip xs in (Vector a, Vector b) -shiftIntoL :: (PositiveT s, NaturalT n, n ~ Pred s, s ~ Succ n) => -              Vector s a -> a -> Vector s a-shiftIntoL xs x = x +> init xs+(+>>) :: (PositiveT s, NaturalT n, n ~ Pred s, s ~ Succ n) => +              a -> Vector s a -> Vector s a+x +>> xs = x +> vinit xs -shiftIntoR :: (PositiveT s, NaturalT n, n ~ Pred s, s ~ Succ n) => +(<<+) :: (PositiveT s, NaturalT n, n ~ Pred s, s ~ Succ n) =>                Vector s a -> a -> Vector s a-shiftIntoR xs x = tail xs <+ x+xs <<+ x = vtail xs <+ x   -rotl :: forall s a . NaturalT s => Vector s a -> Vector s a-rotl = liftV rotl'+vrotl :: forall s a . NaturalT s => Vector s a -> Vector s a+vrotl = liftV rotl'   where vlen = fromIntegerT (undefined :: s)         rotl' [] = []         rotl' xs = let (i,[l]) = splitAt (vlen - 1) xs                    in l : i  -rotr :: NaturalT s => Vector s a -> Vector s a-rotr = liftV rotr'+vrotr :: NaturalT s => Vector s a -> Vector s a+vrotr = liftV rotr'   where     rotr' [] = []-    rotr' (x:xs) = xs P.++ [x] +    rotr' (x:xs) = xs ++ [x]  -concat :: Vector s1 (Vector s2 a) -> Vector (s1 :*: s2) a-concat = liftV (P.foldr ((P.++).unVec) [])+vconcat :: Vector s1 (Vector s2 a) -> Vector (s1 :*: s2) a+vconcat = liftV (foldr ((++).unVec) []) -reverse :: Vector s a -> Vector s a-reverse = liftV P.reverse+vreverse :: Vector s a -> Vector s a+vreverse = liftV reverse -iterate :: NaturalT s => (a -> a) -> a -> Vector s a-iterate = iteraten (undefined :: s)+viterate :: NaturalT s => (a -> a) -> a -> Vector s a+viterate = viteraten (undefined :: s) -iteraten :: NaturalT s => s -> (a -> a) -> a -> Vector s a-iteraten s f x = let s' = fromIntegerT s in Vector (P.take s' $ P.iterate f x)+viteraten :: NaturalT s => s -> (a -> a) -> a -> Vector s a+viteraten s f x = let s' = fromIntegerT s in Vector (take s' $ iterate f x) -generate :: NaturalT s => (a -> a) -> a -> Vector s a-generate = generaten (undefined :: s)+vgenerate :: NaturalT s => (a -> a) -> a -> Vector s a+vgenerate = vgeneraten (undefined :: s) -generaten :: NaturalT s => s -> (a -> a) -> a -> Vector s a-generaten s f x = let s' = fromIntegerT s in Vector (P.take s' $ P.tail $ P.iterate f x)+vgeneraten :: NaturalT s => s -> (a -> a) -> a -> Vector s a+vgeneraten s f x = let s' = fromIntegerT s in Vector (take s' $ tail $ iterate f x) -copy :: NaturalT s => a -> Vector s a-copy x = copyn (undefined :: s) x+vcopy :: NaturalT s => a -> Vector s a+vcopy x = vcopyn (undefined :: s) x -copyn :: NaturalT s => s -> a -> Vector s a-copyn s x = iteraten s id x+vcopyn :: NaturalT s => s -> a -> Vector s a+vcopyn s x = viteraten s id x -split :: ( NaturalT s+vsplit :: ( NaturalT s          -- , IsEven s ~ True          ) => Vector s a -> (Vector (Div2 s) a, Vector (Div2 s) a)-split (Vector xs) = (Vector (P.take vlen xs), Vector (P.drop vlen xs))+vsplit (Vector xs) = (Vector (take vlen xs), Vector (drop vlen xs))   where-    vlen = round ((fromIntegral (P.length xs)) / 2)+    vlen = round ((fromIntegral (length xs)) / 2)  -- ============= -- = Instances =@@ -244,8 +238,8 @@  instance (Read a, NaturalT nT) => Read (Vector nT a) where   readsPrec _ str-    | all fitsLength possibilities = P.map toReadS possibilities-    | otherwise = error (fName P.++ ": string/dynamic length mismatch")+    | all fitsLength possibilities = map toReadS possibilities+    | otherwise = error (fName ++ ": string/dynamic length mismatch")     where        fName = "Data.Param.TFVec.read"       expectedL = fromIntegerT (undefined :: nT)@@ -254,10 +248,10 @@       toReadS (xs, _, rest) = (Vector xs, rest)        instance NaturalT s => DF.Foldable (Vector s) where- foldr = foldr+ foldr = vfoldr   instance NaturalT s => Functor (Vector s) where- fmap = map+ fmap = vmap  instance NaturalT s => DT.Traversable (Vector s) where    traverse f = (fmap Vector).(DT.traverse f).unVec@@ -291,15 +285,15 @@ readVectorList = readParen' False (\r -> [pr | ("<",s) <- lexVector r,                                               pr <- readl s])   where-    readl   s = [([],0,t) | (">",t) <- lexVector s] P.+++    readl   s = [([],0,t) | (">",t) <- lexVector s] ++                             [(x:xs,1+n,u) | (x,t)       <- reads s,                                             (xs, n, u)  <- readl' t]-    readl'  s = [([],0,t) | (">",t) <- lexVector s] P.+++    readl'  s = [([],0,t) | (">",t) <- lexVector s] ++                             [(x:xs,1+n,v) | (",",t)   <- lex s,                                             (x,u)     <- reads t,                                             (xs,n,v)  <- readl' u]     readParen' b g  = if b then mandatory else optional-      where optional r  = g r P.++ mandatory r+      where optional r  = g r ++ mandatory r             mandatory r = [(x,n,u) | ("(",s)  <- lexVector r,                                       (x,n,t) <- optional s,                                       (")",u) <- lexVector t]
clash.cabal view
@@ -1,5 +1,5 @@ name:               clash-version:            0.1.1.1+version:            0.1.2.0 build-type:         Simple synopsis:           CAES Language for Synchronous Hardware (CLaSH) description:        CLaSH is a tool-chain/language to translate subsets of@@ -10,7 +10,7 @@ license:            BSD3 license-file:       LICENSE homepage:           http://clash.ewi.utwente.nl/-package-url:        http://github.com/christiaanb/clash/tree/master/cλash+package-url:        http://github.com/christiaanb/clash/tree/master/clash copyright:          Copyright (c) 2009-2010 Christiaan Baaij &                      Matthijs Kooijman author:             Christiaan Baaij & Matthijs Kooijman@@ -27,7 +27,6 @@                        exposed-modules:  CLasH.HardwareTypes                     CLasH.Translator-                    CLasH.Translator.Annotations                        other-modules:    Data.Param.Integer                     Data.Param.Signed@@ -35,6 +34,7 @@                     Data.Param.Index                     Data.Param.Vector                     CLasH.Translator.TranslatorTypes+                    CLasH.Translator.Annotations                     CLasH.Normalize                     CLasH.Normalize.NormalizeTypes                     CLasH.Normalize.NormalizeTools