projects
/
mate.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
basicblock: using arrows
[mate.git]
/
Mate
/
BasicBlocks.hs
diff --git
a/Mate/BasicBlocks.hs
b/Mate/BasicBlocks.hs
index 3fa4a6c699b73931ec8045d50db8a458e07af622..e81282022ceb9ba2b7f423bb54ea7934f0d5017e 100644
(file)
--- 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 Data.Maybe
import Control.Monad.State
import Control.Applicative
+import Control.Arrow
import JVM.ClassFile
import JVM.Converter
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
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
| otherwise = (Just x, [x])
where
next = takeWhilePlusOne p omit xs