From: Matthijs Kooijman Date: Wed, 18 Feb 2009 19:18:36 +0000 (+0100) Subject: Add setSignalInfo accessor for FlattenState. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=2ab93a2a97e22ca0bd57a2738fd0a48104fffbe5;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Add setSignalInfo accessor for FlattenState. --- diff --git a/FlattenTypes.hs b/FlattenTypes.hs index c7db378..8dbdc3b 100644 --- a/FlattenTypes.hs +++ b/FlattenTypes.hs @@ -183,3 +183,9 @@ getSignalInfo :: SignalId -> FlattenState SignalInfo getSignalInfo id = do (defs, sigs, n) <- State.get return $ signalInfo sigs id + +setSignalInfo :: SignalId -> SignalInfo -> FlattenState () +setSignalInfo id' info' = do + (defs, sigs, n) <- State.get + let sigs' = map (\(id, info) -> (id, if id == id' then info' else info)) sigs + State.put (defs, sigs', n)