From c2cb52c1fb9f86a4b5d2bc584ce8a7f07a03f014 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Tue, 4 Sep 2012 18:34:01 +0200 Subject: [PATCH] basicblock: using arrows I feel so awesome now, woooot :D --- Mate/BasicBlocks.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mate/BasicBlocks.hs b/Mate/BasicBlocks.hs index 3fa4a6c..e812820 100644 --- a/Mate/BasicBlocks.hs +++ b/Mate/BasicBlocks.hs @@ -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 -- 2.25.1