From: Matthijs Kooijman Date: Wed, 5 Aug 2009 12:51:53 +0000 (+0200) Subject: Add unzipM helper function. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=6f06707bcacea3913a21e30c0d7e61f35dcfb066;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Add unzipM helper function. --- diff --git "a/c\316\273ash/CLasH/Utils.hs" "b/c\316\273ash/CLasH/Utils.hs" index 705a466..3ce4b9e 100644 --- "a/c\316\273ash/CLasH/Utils.hs" +++ "b/c\316\273ash/CLasH/Utils.hs" @@ -1,13 +1,10 @@ -module CLasH.Utils - ( listBindings - , listBind - , makeCached - ) where +module CLasH.Utils where -- Standard Imports import qualified Maybe import Data.Accessor import qualified Data.Map as Map +import qualified Control.Monad as Monad import qualified Control.Monad.Trans.State as State -- GHC API @@ -69,3 +66,8 @@ makeCached key accessor create = do value <- create modA accessor (Map.insert key value) return value + +unzipM :: (Monad m) => + m [(a, b)] + -> m ([a], [b]) +unzipM = Monad.liftM unzip