diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Types/Info.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Propellor/Types/Info.hs b/src/Propellor/Types/Info.hs index 5db1eb52..06c45ed2 100644 --- a/src/Propellor/Types/Info.hs +++ b/src/Propellor/Types/Info.hs @@ -55,16 +55,15 @@ data PropagateInfo -- | Any value in the `IsInfo` type class can be added to an Info. addInfo :: IsInfo v => Info -> v -> Info -addInfo (Info l) v = Info (InfoEntry v:l) +addInfo (Info l) v = Info (l++[InfoEntry v]) -- | Converts any value in the `IsInfo` type class into an Info, -- which is otherwise empty. toInfo :: IsInfo v => v -> Info toInfo = addInfo mempty --- The list is reversed here because addInfo builds it up in reverse order. fromInfo :: IsInfo v => Info -> v -fromInfo (Info l) = mconcat (mapMaybe extractInfoEntry (reverse l)) +fromInfo (Info l) = mconcat (mapMaybe extractInfoEntry l) -- | Maps a function over all values stored in the Info that are of the -- appropriate type. |
