projects
/
mate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
022b945
)
basicblock: using arrows
author
Bernhard Urban
<lewurm@gmail.com>
Tue, 4 Sep 2012 16:34:01 +0000
(18:34 +0200)
committer
Bernhard Urban
<lewurm@gmail.com>
Tue, 4 Sep 2012 16:34:01 +0000
(18:34 +0200)
I feel so awesome now, woooot :D
Mate/BasicBlocks.hs
patch
|
blob
|
history
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 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