basicblock: using arrows
[mate.git] / Mate / BasicBlocks.hs
index 3fa4a6c699b73931ec8045d50db8a458e07af622..e81282022ceb9ba2b7f423bb54ea7934f0d5017e 100644 (file)
@@ -17,6 +17,7 @@ import qualified Data.ByteString.Lazy as B
 import Data.Maybe
 import Control.Monad.State
 import Control.Applicative
+import Control.Arrow
 
 import JVM.ClassFile
 import JVM.Converter
@@ -173,7 +174,7 @@ parseBasicBlock i insns = BasicBlock insonly endblock
     takeWhilePlusOne _ _ [] = (Nothing, [])
     takeWhilePlusOne p omit (x:xs)
       | omit x    = next
-      | p x       = (\(ys, xs') -> (ys, x:xs')) next
+      | p x       = second (x:) next
       | otherwise = (Just x, [x])
       where
         next = takeWhilePlusOne p omit xs