From: Matthijs Kooijman Date: Wed, 18 Feb 2009 18:30:20 +0000 (+0100) Subject: Add a getSignalInfo accessor. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=f476ee837aaea76011f8e47e1181e4a09ec86555;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Add a getSignalInfo accessor. --- diff --git a/FlattenTypes.hs b/FlattenTypes.hs index bcb8be7..c7db378 100644 --- a/FlattenTypes.hs +++ b/FlattenTypes.hs @@ -176,3 +176,10 @@ genSignalId use ty = do let s = (n, SignalInfo Nothing use ty) State.put (defs, s:sigs, n+1) return n + +-- | Returns the SignalInfo for the given signal. Errors if the signal is not +-- known in the session. +getSignalInfo :: SignalId -> FlattenState SignalInfo +getSignalInfo id = do + (defs, sigs, n) <- State.get + return $ signalInfo sigs id