Search is not available for this dataset
repo_name
string | path
string | license
string | full_code
string | full_size
int64 | uncommented_code
string | uncommented_size
int64 | function_only_code
string | function_only_size
int64 | is_commented
bool | is_signatured
bool | n_ast_errors
int64 | ast_max_depth
int64 | n_whitespaces
int64 | n_ast_nodes
int64 | n_ast_terminals
int64 | n_ast_nonterminals
int64 | loc
int64 | cycloplexity
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
JustinUnger/haskell-book
|
ch17/list-app-ex.hs
|
mit
|
concat' :: List (List a) -> List a
concat' = fold append Nil
| 60
|
concat' :: List (List a) -> List a
concat' = fold append Nil
| 60
|
concat' = fold append Nil
| 25
| false
| true
| 0
| 9
| 12
| 39
| 16
| 23
| null | null |
christiaanb/Idris-dev
|
src/IRTS/CodegenC.hs
|
bsd-3-clause
|
bcc i (TOPBASE n) = indent i ++ "TOPBASE(" ++ show n ++ ");\n"
| 62
|
bcc i (TOPBASE n) = indent i ++ "TOPBASE(" ++ show n ++ ");\n"
| 62
|
bcc i (TOPBASE n) = indent i ++ "TOPBASE(" ++ show n ++ ");\n"
| 62
| false
| false
| 0
| 8
| 13
| 37
| 16
| 21
| null | null |
muspellsson/hiccup
|
TclChan.hs
|
lgpl-2.1
|
namesChan (CM m) = Map.keys m
| 29
|
namesChan (CM m) = Map.keys m
| 29
|
namesChan (CM m) = Map.keys m
| 29
| false
| false
| 0
| 7
| 5
| 20
| 9
| 11
| null | null |
brendanhay/gogol
|
gogol-youtube/gen/Network/Google/Resource/YouTube/ChannelSections/Update.hs
|
mpl-2.0
|
-- | The *part* parameter serves two purposes in this operation. It
-- identifies the properties that the write operation will set as well as
-- the properties that the API response will include. The part names that
-- you can include in the parameter value are snippet and contentDetails.
csuPart :: Lens' ChannelSectionsUpdate [Text]
csuPart
= lens _csuPart (\ s a -> s{_csuPart = a}) . _Coerce
| 398
|
csuPart :: Lens' ChannelSectionsUpdate [Text]
csuPart
= lens _csuPart (\ s a -> s{_csuPart = a}) . _Coerce
| 108
|
csuPart
= lens _csuPart (\ s a -> s{_csuPart = a}) . _Coerce
| 62
| true
| true
| 0
| 10
| 69
| 52
| 29
| 23
| null | null |
Tr1p0d/WisRegister
|
dist/build/autogen/Paths_WisRegister.hs
|
gpl-3.0
|
getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name)
| 118
|
getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name)
| 118
|
getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name)
| 75
| false
| true
| 0
| 10
| 22
| 45
| 21
| 24
| null | null |
Mokosha/HsTetrisAttack
|
TetrisAttack/Grid.hs
|
mit
|
imapGridM :: Monad m => ((Int, Int) -> a -> m b) -> Grid2D a -> m (Grid2D b)
imapGridM f grid = mapGridM (uncurry f) (zipGrid locGrid grid)
where
locGrid = uncurry generateGrid (gridSize grid) (,)
| 202
|
imapGridM :: Monad m => ((Int, Int) -> a -> m b) -> Grid2D a -> m (Grid2D b)
imapGridM f grid = mapGridM (uncurry f) (zipGrid locGrid grid)
where
locGrid = uncurry generateGrid (gridSize grid) (,)
| 202
|
imapGridM f grid = mapGridM (uncurry f) (zipGrid locGrid grid)
where
locGrid = uncurry generateGrid (gridSize grid) (,)
| 125
| false
| true
| 0
| 10
| 42
| 106
| 52
| 54
| null | null |
mainland/dph
|
dph-prim-seq/Data/Array/Parallel/Unlifted/Stream/Locked.hs
|
bsd-3-clause
|
-------------------------------------------------
-- | Zip the first 'n' elements of five streams.
lockedZip5S
:: Monad m
=> Int
-> Bundle m v a -> Bundle m v b -> Bundle m v c -> Bundle m v d -> Bundle m v e
-> Bundle m v (a, b, c, d, e)
lockedZip5S len
(Bundle {sElems=Stream mkStep1 sa1})
(Bundle {sElems=Stream mkStep2 sa2})
(Bundle {sElems=Stream mkStep3 sa3})
(Bundle {sElems=Stream mkStep4 sa4})
(Bundle {sElems=Stream mkStep5 sa5})
= B.fromStream (Stream step (sa1, sa2, sa3, sa4, sa5, 0)) (S.Exact len)
where
{-# INLINE_INNER step #-}
step (s1, s2, s3, s4, s5, i)
= i `seq`
do step1 <- mkStep1 s1
step2 <- mkStep2 s2
step3 <- mkStep3 s3
step4 <- mkStep4 s4
step5 <- mkStep5 s5
return $ case (step1, step2, step3, step4, step5) of
(Yield x1 s1', Yield x2 s2', Yield x3 s3', Yield x4 s4', Yield x5 s5')
| i < len -> Yield (x1, x2, x3, x4, x5) (s1', s2', s3', s4', s5', i + 1)
_ -> Done
| 1,183
|
lockedZip5S
:: Monad m
=> Int
-> Bundle m v a -> Bundle m v b -> Bundle m v c -> Bundle m v d -> Bundle m v e
-> Bundle m v (a, b, c, d, e)
lockedZip5S len
(Bundle {sElems=Stream mkStep1 sa1})
(Bundle {sElems=Stream mkStep2 sa2})
(Bundle {sElems=Stream mkStep3 sa3})
(Bundle {sElems=Stream mkStep4 sa4})
(Bundle {sElems=Stream mkStep5 sa5})
= B.fromStream (Stream step (sa1, sa2, sa3, sa4, sa5, 0)) (S.Exact len)
where
{-# INLINE_INNER step #-}
step (s1, s2, s3, s4, s5, i)
= i `seq`
do step1 <- mkStep1 s1
step2 <- mkStep2 s2
step3 <- mkStep3 s3
step4 <- mkStep4 s4
step5 <- mkStep5 s5
return $ case (step1, step2, step3, step4, step5) of
(Yield x1 s1', Yield x2 s2', Yield x3 s3', Yield x4 s4', Yield x5 s5')
| i < len -> Yield (x1, x2, x3, x4, x5) (s1', s2', s3', s4', s5', i + 1)
_ -> Done
| 1,083
|
lockedZip5S len
(Bundle {sElems=Stream mkStep1 sa1})
(Bundle {sElems=Stream mkStep2 sa2})
(Bundle {sElems=Stream mkStep3 sa3})
(Bundle {sElems=Stream mkStep4 sa4})
(Bundle {sElems=Stream mkStep5 sa5})
= B.fromStream (Stream step (sa1, sa2, sa3, sa4, sa5, 0)) (S.Exact len)
where
{-# INLINE_INNER step #-}
step (s1, s2, s3, s4, s5, i)
= i `seq`
do step1 <- mkStep1 s1
step2 <- mkStep2 s2
step3 <- mkStep3 s3
step4 <- mkStep4 s4
step5 <- mkStep5 s5
return $ case (step1, step2, step3, step4, step5) of
(Yield x1 s1', Yield x2 s2', Yield x3 s3', Yield x4 s4', Yield x5 s5')
| i < len -> Yield (x1, x2, x3, x4, x5) (s1', s2', s3', s4', s5', i + 1)
_ -> Done
| 910
| true
| true
| 0
| 15
| 457
| 455
| 238
| 217
| null | null |
ItsLastDay/academic_university_2016-2018
|
subjects/Haskell/5/homework.hs
|
gpl-3.0
|
sum3 [] x [] = x
| 16
|
sum3 [] x [] = x
| 16
|
sum3 [] x [] = x
| 16
| false
| false
| 1
| 5
| 5
| 23
| 8
| 15
| null | null |
unisonweb/platform
|
parser-typechecker/src/Unison/Codebase/Branch.hs
|
mit
|
-- Discards the history of a Branch0's children, recursively
discardHistory0 :: Applicative m => Branch0 m -> Branch0 m
discardHistory0 = over children (fmap tweak) where
tweak b = cons (discardHistory0 (head b)) empty
| 220
|
discardHistory0 :: Applicative m => Branch0 m -> Branch0 m
discardHistory0 = over children (fmap tweak) where
tweak b = cons (discardHistory0 (head b)) empty
| 159
|
discardHistory0 = over children (fmap tweak) where
tweak b = cons (discardHistory0 (head b)) empty
| 100
| true
| true
| 0
| 9
| 35
| 66
| 32
| 34
| null | null |
keithodulaigh/Hets
|
THF/ParseTHF.hs
|
gpl-2.0
|
fileInfo :: CharParser st (Maybe Name)
fileInfo = fmap Just (comma >> name)
<|> (notFollowedBy (char ',') >> return Nothing)
| 126
|
fileInfo :: CharParser st (Maybe Name)
fileInfo = fmap Just (comma >> name)
<|> (notFollowedBy (char ',') >> return Nothing)
| 126
|
fileInfo = fmap Just (comma >> name)
<|> (notFollowedBy (char ',') >> return Nothing)
| 87
| false
| true
| 5
| 10
| 21
| 69
| 30
| 39
| null | null |
sdiehl/ghc
|
compiler/typecheck/TcType.hs
|
bsd-3-clause
|
metaTyVarTcLevel :: TcTyVar -> TcLevel
metaTyVarTcLevel tv
= case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tclvl } -> tclvl
_ -> pprPanic "metaTyVarTcLevel" (ppr tv)
| 180
|
metaTyVarTcLevel :: TcTyVar -> TcLevel
metaTyVarTcLevel tv
= case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tclvl } -> tclvl
_ -> pprPanic "metaTyVarTcLevel" (ppr tv)
| 180
|
metaTyVarTcLevel tv
= case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tclvl } -> tclvl
_ -> pprPanic "metaTyVarTcLevel" (ppr tv)
| 141
| false
| true
| 2
| 7
| 39
| 58
| 28
| 30
| null | null |
misgeatgit/opencog
|
opencog/nlp/lojban/HaskellLib/src/OpenCog/Lojban/Syntax/Util.hs
|
agpl-3.0
|
withEmptyState :: SynIso a b -> SynIso a b
withEmptyState iso = Iso f g
where
f a = do
atoms <- gets sAtoms
setAtoms []
b <- apply iso a
pushAtoms atoms
pure b
g = unapply iso
| 220
|
withEmptyState :: SynIso a b -> SynIso a b
withEmptyState iso = Iso f g
where
f a = do
atoms <- gets sAtoms
setAtoms []
b <- apply iso a
pushAtoms atoms
pure b
g = unapply iso
| 220
|
withEmptyState iso = Iso f g
where
f a = do
atoms <- gets sAtoms
setAtoms []
b <- apply iso a
pushAtoms atoms
pure b
g = unapply iso
| 177
| false
| true
| 2
| 8
| 83
| 105
| 41
| 64
| null | null |
hdevtools/hdevtools
|
src/CommandArgs.hs
|
mit
|
pathArg' a@Type {} = path a
| 28
|
pathArg' a@Type {} = path a
| 28
|
pathArg' a@Type {} = path a
| 28
| false
| false
| 0
| 7
| 6
| 19
| 9
| 10
| null | null |
mathhun/stack
|
src/System/Process/PagerEditor.hs
|
bsd-3-clause
|
-- | Run pager to display a string.
pageString :: String -> IO ()
pageString = pageBuilder . stringUtf8
| 103
|
pageString :: String -> IO ()
pageString = pageBuilder . stringUtf8
| 67
|
pageString = pageBuilder . stringUtf8
| 37
| true
| true
| 0
| 7
| 18
| 25
| 13
| 12
| null | null |
benkolera/phb
|
hs/Site/Customer.hs
|
mit
|
customerRowSplice :: PhbRuntimeSplice [Entity Customer] -> PhbSplice
customerRowSplice = rowSplice (ts <> ss)
where
ts = mapV (C.pureSplice . C.textSplice) $ do
"name" ## (^.eVal.customerName)
"id" ## (^.eKey.to spliceKey)
ss = mempty
| 276
|
customerRowSplice :: PhbRuntimeSplice [Entity Customer] -> PhbSplice
customerRowSplice = rowSplice (ts <> ss)
where
ts = mapV (C.pureSplice . C.textSplice) $ do
"name" ## (^.eVal.customerName)
"id" ## (^.eKey.to spliceKey)
ss = mempty
| 276
|
customerRowSplice = rowSplice (ts <> ss)
where
ts = mapV (C.pureSplice . C.textSplice) $ do
"name" ## (^.eVal.customerName)
"id" ## (^.eKey.to spliceKey)
ss = mempty
| 207
| false
| true
| 0
| 11
| 73
| 94
| 48
| 46
| null | null |
jrraymond/ray-tracer
|
src/BoundingVolumeHierarchy.hs
|
gpl-3.0
|
midPt YAxis (Sphere (Vec3 _ y _) _ _) = y
| 41
|
midPt YAxis (Sphere (Vec3 _ y _) _ _) = y
| 41
|
midPt YAxis (Sphere (Vec3 _ y _) _ _) = y
| 41
| false
| false
| 0
| 9
| 10
| 31
| 15
| 16
| null | null |
christiaanb/clash-tryout
|
src/CLaSH/Builtin.hs
|
bsd-3-clause
|
_ `andB` _ = L
| 14
|
_ `andB` _ = L
| 14
|
_ `andB` _ = L
| 14
| false
| false
| 0
| 5
| 4
| 14
| 7
| 7
| null | null |
alexander-at-github/eta
|
compiler/ETA/TypeCheck/TcArrows.hs
|
bsd-3-clause
|
-------------------------------------------
-- Lambda
--
-- D;G,x:t |-a cmd : stk --> res
-- ------------------------------
-- D;G |-a (\x.cmd) : (t,stk) --> res
tc_cmd env
(HsCmdLam (MG { mg_alts = [L mtch_loc
(match@(Match _ pats _maybe_rhs_sig grhss))],
mg_origin = origin }))
(cmd_stk, res_ty)
= addErrCtxt (pprMatchInCtxt match_ctxt match) $
do { (co, arg_tys, cmd_stk') <- matchExpectedCmdArgs n_pats cmd_stk
-- Check the patterns, and the GRHSs inside
; (pats', grhss') <- setSrcSpan mtch_loc $
tcPats LambdaExpr pats arg_tys $
tc_grhss grhss cmd_stk' res_ty
; let match' = L mtch_loc (Match Nothing pats' Nothing grhss')
arg_tys = map hsLPatType pats'
cmd' = HsCmdLam (MG { mg_alts = [match'], mg_arg_tys = arg_tys
, mg_res_ty = res_ty, mg_origin = origin })
; return (mkHsCmdCast co cmd') }
where
n_pats = length pats
match_ctxt = (LambdaExpr :: HsMatchContext Name) -- Maybe KappaExpr?
pg_ctxt = PatGuard match_ctxt
tc_grhss (GRHSs grhss binds) stk_ty res_ty
= do { (binds', grhss') <- tcLocalBinds binds $
mapM (wrapLocM (tc_grhs stk_ty res_ty)) grhss
; return (GRHSs grhss' binds') }
tc_grhs stk_ty res_ty (GRHS guards body)
= do { (guards', rhs') <- tcStmtsAndThen pg_ctxt tcGuardStmt guards res_ty $
\ res_ty -> tcCmd env body (stk_ty, res_ty)
; return (GRHS guards' rhs') }
-------------------------------------------
-- Do notation
| 1,787
|
tc_cmd env
(HsCmdLam (MG { mg_alts = [L mtch_loc
(match@(Match _ pats _maybe_rhs_sig grhss))],
mg_origin = origin }))
(cmd_stk, res_ty)
= addErrCtxt (pprMatchInCtxt match_ctxt match) $
do { (co, arg_tys, cmd_stk') <- matchExpectedCmdArgs n_pats cmd_stk
-- Check the patterns, and the GRHSs inside
; (pats', grhss') <- setSrcSpan mtch_loc $
tcPats LambdaExpr pats arg_tys $
tc_grhss grhss cmd_stk' res_ty
; let match' = L mtch_loc (Match Nothing pats' Nothing grhss')
arg_tys = map hsLPatType pats'
cmd' = HsCmdLam (MG { mg_alts = [match'], mg_arg_tys = arg_tys
, mg_res_ty = res_ty, mg_origin = origin })
; return (mkHsCmdCast co cmd') }
where
n_pats = length pats
match_ctxt = (LambdaExpr :: HsMatchContext Name) -- Maybe KappaExpr?
pg_ctxt = PatGuard match_ctxt
tc_grhss (GRHSs grhss binds) stk_ty res_ty
= do { (binds', grhss') <- tcLocalBinds binds $
mapM (wrapLocM (tc_grhs stk_ty res_ty)) grhss
; return (GRHSs grhss' binds') }
tc_grhs stk_ty res_ty (GRHS guards body)
= do { (guards', rhs') <- tcStmtsAndThen pg_ctxt tcGuardStmt guards res_ty $
\ res_ty -> tcCmd env body (stk_ty, res_ty)
; return (GRHS guards' rhs') }
-------------------------------------------
-- Do notation
| 1,611
|
tc_cmd env
(HsCmdLam (MG { mg_alts = [L mtch_loc
(match@(Match _ pats _maybe_rhs_sig grhss))],
mg_origin = origin }))
(cmd_stk, res_ty)
= addErrCtxt (pprMatchInCtxt match_ctxt match) $
do { (co, arg_tys, cmd_stk') <- matchExpectedCmdArgs n_pats cmd_stk
-- Check the patterns, and the GRHSs inside
; (pats', grhss') <- setSrcSpan mtch_loc $
tcPats LambdaExpr pats arg_tys $
tc_grhss grhss cmd_stk' res_ty
; let match' = L mtch_loc (Match Nothing pats' Nothing grhss')
arg_tys = map hsLPatType pats'
cmd' = HsCmdLam (MG { mg_alts = [match'], mg_arg_tys = arg_tys
, mg_res_ty = res_ty, mg_origin = origin })
; return (mkHsCmdCast co cmd') }
where
n_pats = length pats
match_ctxt = (LambdaExpr :: HsMatchContext Name) -- Maybe KappaExpr?
pg_ctxt = PatGuard match_ctxt
tc_grhss (GRHSs grhss binds) stk_ty res_ty
= do { (binds', grhss') <- tcLocalBinds binds $
mapM (wrapLocM (tc_grhs stk_ty res_ty)) grhss
; return (GRHSs grhss' binds') }
tc_grhs stk_ty res_ty (GRHS guards body)
= do { (guards', rhs') <- tcStmtsAndThen pg_ctxt tcGuardStmt guards res_ty $
\ res_ty -> tcCmd env body (stk_ty, res_ty)
; return (GRHS guards' rhs') }
-------------------------------------------
-- Do notation
| 1,611
| true
| false
| 2
| 16
| 642
| 449
| 234
| 215
| null | null |
ComputationWithBoundedResources/ara-inference
|
doc/tpdb_trs/Haskell/basic_haskell/take_1.hs
|
mit
|
primCmpInt :: MyInt -> MyInt -> Ordering;
primCmpInt (Pos Zero) (Pos Zero) = EQ
| 83
|
primCmpInt :: MyInt -> MyInt -> Ordering
primCmpInt (Pos Zero) (Pos Zero) = EQ
| 82
|
primCmpInt (Pos Zero) (Pos Zero) = EQ
| 37
| false
| true
| 0
| 7
| 17
| 37
| 19
| 18
| null | null |
Proclivis/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxSTC_ERLANG_CHARACTER :: Int
wxSTC_ERLANG_CHARACTER = 9
| 56
|
wxSTC_ERLANG_CHARACTER :: Int
wxSTC_ERLANG_CHARACTER = 9
| 56
|
wxSTC_ERLANG_CHARACTER = 9
| 26
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
Proclivis/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxBRUSHSTYLE_LAST_HATCH :: Int
wxBRUSHSTYLE_LAST_HATCH = wxHATCHSTYLE_LAST
| 74
|
wxBRUSHSTYLE_LAST_HATCH :: Int
wxBRUSHSTYLE_LAST_HATCH = wxHATCHSTYLE_LAST
| 74
|
wxBRUSHSTYLE_LAST_HATCH = wxHATCHSTYLE_LAST
| 43
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
jeroennoels/exact-real
|
test/Ternary/Examples.hs
|
mit
|
z = Exact (cycle allT2) 0
| 25
|
z = Exact (cycle allT2) 0
| 25
|
z = Exact (cycle allT2) 0
| 25
| false
| false
| 1
| 7
| 5
| 20
| 8
| 12
| null | null |
oldmanmike/ghc
|
compiler/simplStg/UnariseStg.hs
|
bsd-3-clause
|
unariseBinding :: UniqSupply -> UnariseEnv -> StgBinding -> StgBinding
unariseBinding us rho bind = case bind of
StgNonRec x rhs -> StgNonRec x (unariseRhs us rho rhs)
StgRec xrhss -> StgRec $ zipWith (\us (x, rhs) -> (x, unariseRhs us rho rhs))
(listSplitUniqSupply us) xrhss
| 321
|
unariseBinding :: UniqSupply -> UnariseEnv -> StgBinding -> StgBinding
unariseBinding us rho bind = case bind of
StgNonRec x rhs -> StgNonRec x (unariseRhs us rho rhs)
StgRec xrhss -> StgRec $ zipWith (\us (x, rhs) -> (x, unariseRhs us rho rhs))
(listSplitUniqSupply us) xrhss
| 321
|
unariseBinding us rho bind = case bind of
StgNonRec x rhs -> StgNonRec x (unariseRhs us rho rhs)
StgRec xrhss -> StgRec $ zipWith (\us (x, rhs) -> (x, unariseRhs us rho rhs))
(listSplitUniqSupply us) xrhss
| 250
| false
| true
| 6
| 9
| 89
| 115
| 58
| 57
| null | null |
bravit/Idris-dev
|
src/Idris/Core/TT.hs
|
bsd-3-clause
|
showEnvDbg env t = showEnv' env t True
| 38
|
showEnvDbg env t = showEnv' env t True
| 38
|
showEnvDbg env t = showEnv' env t True
| 38
| false
| false
| 0
| 5
| 7
| 19
| 8
| 11
| null | null |
FranklinChen/ghc-vis
|
src/GHC/Vis.hs
|
bsd-3-clause
|
mVisMainThread :: IO ()
mVisMainThread = do
initGUI
window <- windowNew
canvas <- drawingAreaNew
widgetModifyBg canvas StateNormal backgroundColor
set window [ windowTitle := title
, containerChild := canvas
]
(uncurry $ windowSetDefaultSize window) defaultSize
on canvas draw $ do
runCorrect redraw >>= \f -> f canvas
runCorrect move >>= \f -> liftIO $ f canvas
dummy <- windowNew
setupGUI window canvas dummy
#ifdef SDL_WINDOW
| 487
|
mVisMainThread :: IO ()
mVisMainThread = do
initGUI
window <- windowNew
canvas <- drawingAreaNew
widgetModifyBg canvas StateNormal backgroundColor
set window [ windowTitle := title
, containerChild := canvas
]
(uncurry $ windowSetDefaultSize window) defaultSize
on canvas draw $ do
runCorrect redraw >>= \f -> f canvas
runCorrect move >>= \f -> liftIO $ f canvas
dummy <- windowNew
setupGUI window canvas dummy
#ifdef SDL_WINDOW
| 487
|
mVisMainThread = do
initGUI
window <- windowNew
canvas <- drawingAreaNew
widgetModifyBg canvas StateNormal backgroundColor
set window [ windowTitle := title
, containerChild := canvas
]
(uncurry $ windowSetDefaultSize window) defaultSize
on canvas draw $ do
runCorrect redraw >>= \f -> f canvas
runCorrect move >>= \f -> liftIO $ f canvas
dummy <- windowNew
setupGUI window canvas dummy
#ifdef SDL_WINDOW
| 463
| false
| true
| 0
| 13
| 122
| 151
| 68
| 83
| null | null |
klarh/temper
|
src/Text/Temper.hs
|
mit
|
encodeElement (SpecialTag conts) = "<!" `T.append` conts `T.snoc` '>'
| 69
|
encodeElement (SpecialTag conts) = "<!" `T.append` conts `T.snoc` '>'
| 69
|
encodeElement (SpecialTag conts) = "<!" `T.append` conts `T.snoc` '>'
| 69
| false
| false
| 0
| 7
| 8
| 31
| 17
| 14
| null | null |
jtdaugherty/vty
|
test/Rogue.hs
|
bsd-3-clause
|
pieceA, dumpA :: Attr
pieceA = defAttr `withForeColor` blue `withBackColor` green
| 81
|
pieceA, dumpA :: Attr
pieceA = defAttr `withForeColor` blue `withBackColor` green
| 81
|
pieceA = defAttr `withForeColor` blue `withBackColor` green
| 59
| false
| true
| 2
| 6
| 10
| 33
| 16
| 17
| null | null |
gcampax/ghc
|
compiler/hsSyn/HsExpr.hs
|
bsd-3-clause
|
-----------------
pprAStmtContext, pprStmtContext :: Outputable id => HsStmtContext id -> SDoc
pprAStmtContext ctxt = article <+> pprStmtContext ctxt
where
pp_an = ptext (sLit "an")
pp_a = ptext (sLit "a")
article = case ctxt of
MDoExpr -> pp_an
PArrComp -> pp_an
GhciStmtCtxt -> pp_an
_ -> pp_a
-----------------
| 426
|
pprAStmtContext, pprStmtContext :: Outputable id => HsStmtContext id -> SDoc
pprAStmtContext ctxt = article <+> pprStmtContext ctxt
where
pp_an = ptext (sLit "an")
pp_a = ptext (sLit "a")
article = case ctxt of
MDoExpr -> pp_an
PArrComp -> pp_an
GhciStmtCtxt -> pp_an
_ -> pp_a
-----------------
| 408
|
pprAStmtContext ctxt = article <+> pprStmtContext ctxt
where
pp_an = ptext (sLit "an")
pp_a = ptext (sLit "a")
article = case ctxt of
MDoExpr -> pp_an
PArrComp -> pp_an
GhciStmtCtxt -> pp_an
_ -> pp_a
-----------------
| 331
| true
| true
| 2
| 9
| 159
| 105
| 52
| 53
| null | null |
tbarnetlamb/hyphen
|
hyphen/lowlevel_src/Hyphen.hs
|
gpl-2.0
|
from_haskell_Int_impl = withHsObjRawSimp pythonateInt
| 61
|
from_haskell_Int_impl = withHsObjRawSimp pythonateInt
| 61
|
from_haskell_Int_impl = withHsObjRawSimp pythonateInt
| 61
| false
| false
| 0
| 5
| 11
| 9
| 4
| 5
| null | null |
aartamonau/repo-bisect
|
src/Snapshot.hs
|
gpl-3.0
|
options :: [OptDescr (Options -> Options)]
options = [ forceDateOpt
, overwriteSnapshot
, resolveRefNames
]
where forceDateOpt = Option "d" ["--force-date"]
(NoArg $ \opts -> opts { forceDate = True })
"interpret command argument as a date"
overwriteSnapshot = Option "F" ["--overwrite-snapshot"]
(NoArg $ \opts -> opts { overwriteSnapshot = True })
"overwrite snapshot if it already exists"
resolveRefNames = Option "r" ["--resolve-refnames"]
(NoArg $ \opts -> opts { resolveRefNames = True })
"resolve reference names before saving snapshot"
| 771
|
options :: [OptDescr (Options -> Options)]
options = [ forceDateOpt
, overwriteSnapshot
, resolveRefNames
]
where forceDateOpt = Option "d" ["--force-date"]
(NoArg $ \opts -> opts { forceDate = True })
"interpret command argument as a date"
overwriteSnapshot = Option "F" ["--overwrite-snapshot"]
(NoArg $ \opts -> opts { overwriteSnapshot = True })
"overwrite snapshot if it already exists"
resolveRefNames = Option "r" ["--resolve-refnames"]
(NoArg $ \opts -> opts { resolveRefNames = True })
"resolve reference names before saving snapshot"
| 771
|
options = [ forceDateOpt
, overwriteSnapshot
, resolveRefNames
]
where forceDateOpt = Option "d" ["--force-date"]
(NoArg $ \opts -> opts { forceDate = True })
"interpret command argument as a date"
overwriteSnapshot = Option "F" ["--overwrite-snapshot"]
(NoArg $ \opts -> opts { overwriteSnapshot = True })
"overwrite snapshot if it already exists"
resolveRefNames = Option "r" ["--resolve-refnames"]
(NoArg $ \opts -> opts { resolveRefNames = True })
"resolve reference names before saving snapshot"
| 728
| false
| true
| 0
| 10
| 306
| 153
| 84
| 69
| null | null |
Peaker/lamdu
|
src/Lamdu/GUI/Expr/LiteralEdit.hs
|
gpl-3.0
|
textEdit :: _ => Property o Text -> Sugar.Payload v o -> m (M.TextWidget o)
textEdit prop pl =
do
text <- TextEdits.make ?? emptyTexts ?? prop ?? WidgetIds.literalEditOf (WidgetIds.fromExprPayload pl)
label Texts.textOpener
M./|/ pure text
M./|/ ((M.tValue %~)
<$> (Element.padToSize ?? (text ^. Element.size & _1 .~ 0) ?? 1)
<*> label Texts.textCloser
)
& withStyle Style.text
| 481
|
textEdit :: _ => Property o Text -> Sugar.Payload v o -> m (M.TextWidget o)
textEdit prop pl =
do
text <- TextEdits.make ?? emptyTexts ?? prop ?? WidgetIds.literalEditOf (WidgetIds.fromExprPayload pl)
label Texts.textOpener
M./|/ pure text
M./|/ ((M.tValue %~)
<$> (Element.padToSize ?? (text ^. Element.size & _1 .~ 0) ?? 1)
<*> label Texts.textCloser
)
& withStyle Style.text
| 481
|
textEdit prop pl =
do
text <- TextEdits.make ?? emptyTexts ?? prop ?? WidgetIds.literalEditOf (WidgetIds.fromExprPayload pl)
label Texts.textOpener
M./|/ pure text
M./|/ ((M.tValue %~)
<$> (Element.padToSize ?? (text ^. Element.size & _1 .~ 0) ?? 1)
<*> label Texts.textCloser
)
& withStyle Style.text
| 405
| false
| true
| 0
| 19
| 161
| 170
| 82
| 88
| null | null |
keithodulaigh/Hets
|
QVTR/StatAna.hs
|
gpl-2.0
|
getSomething :: [Maybe a] -> [a]
getSomething list =
case list of
[] -> []
el : rest -> case el of
Nothing -> getSomething rest
Just typ -> typ : getSomething rest
-- Creates a non-top version of a top rule in order to generate a parametrized version of itself
| 310
|
getSomething :: [Maybe a] -> [a]
getSomething list =
case list of
[] -> []
el : rest -> case el of
Nothing -> getSomething rest
Just typ -> typ : getSomething rest
-- Creates a non-top version of a top rule in order to generate a parametrized version of itself
| 310
|
getSomething list =
case list of
[] -> []
el : rest -> case el of
Nothing -> getSomething rest
Just typ -> typ : getSomething rest
-- Creates a non-top version of a top rule in order to generate a parametrized version of itself
| 277
| false
| true
| 0
| 12
| 100
| 86
| 41
| 45
| null | null |
calebgregory/fp101x
|
wk3/lab2.hs
|
mit
|
n = 1234
| 8
|
n = 1234
| 8
|
n = 1234
| 8
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
rueshyna/gogol
|
gogol-genomics/gen/Network/Google/Resource/Genomics/Variants/Search.hs
|
mpl-2.0
|
-- | OAuth access token.
vsAccessToken :: Lens' VariantsSearch (Maybe Text)
vsAccessToken
= lens _vsAccessToken
(\ s a -> s{_vsAccessToken = a})
| 152
|
vsAccessToken :: Lens' VariantsSearch (Maybe Text)
vsAccessToken
= lens _vsAccessToken
(\ s a -> s{_vsAccessToken = a})
| 127
|
vsAccessToken
= lens _vsAccessToken
(\ s a -> s{_vsAccessToken = a})
| 76
| true
| true
| 0
| 9
| 29
| 48
| 25
| 23
| null | null |
typedvar/hLand
|
hcore/GMachine.hs
|
mit
|
gmDispatch Eq = comparison (==)
| 31
|
gmDispatch Eq = comparison (==)
| 31
|
gmDispatch Eq = comparison (==)
| 31
| false
| false
| 0
| 5
| 4
| 14
| 7
| 7
| null | null |
gust/feature-creature
|
feature-creature/backend/app/Routing.hs
|
mit
|
eitherToMaybe (Right r) = Just r
| 32
|
eitherToMaybe (Right r) = Just r
| 32
|
eitherToMaybe (Right r) = Just r
| 32
| false
| false
| 0
| 7
| 5
| 18
| 8
| 10
| null | null |
DavidAlphaFox/ghc
|
libraries/bytestring/Data/ByteString/Char8.hs
|
bsd-3-clause
|
readInteger :: ByteString -> Maybe (Integer, ByteString)
readInteger as
| null as = Nothing
| otherwise =
case unsafeHead as of
'-' -> first (B.unsafeTail as) >>= \(n, bs) -> return (-n, bs)
'+' -> first (B.unsafeTail as)
_ -> first as
where first ps | null ps = Nothing
| otherwise =
case B.unsafeHead ps of
w | w >= 0x30 && w <= 0x39 -> Just $
loop 1 (fromIntegral w - 0x30) [] (B.unsafeTail ps)
| otherwise -> Nothing
loop :: Int -> Int -> [Integer]
-> ByteString -> (Integer, ByteString)
loop !d !acc ns !ps
| null ps = combine d acc ns empty
| otherwise =
case B.unsafeHead ps of
w | w >= 0x30 && w <= 0x39 ->
if d == 9 then loop 1 (fromIntegral w - 0x30)
(toInteger acc : ns)
(B.unsafeTail ps)
else loop (d+1)
(10*acc + (fromIntegral w - 0x30))
ns (B.unsafeTail ps)
| otherwise -> combine d acc ns ps
combine _ acc [] ps = (toInteger acc, ps)
combine d acc ns ps =
((10^d * combine1 1000000000 ns + toInteger acc), ps)
combine1 _ [n] = n
combine1 b ns = combine1 (b*b) $ combine2 b ns
combine2 b (n:m:ns) = let t = m*b + n in t `seq` (t : combine2 b ns)
combine2 _ ns = ns
------------------------------------------------------------------------
-- For non-binary text processing:
-- | Read an entire file strictly into a 'ByteString'. This is far more
-- efficient than reading the characters into a 'String' and then using
-- 'pack'. It also may be more efficient than opening the file and
-- reading it using hGet.
| 2,059
|
readInteger :: ByteString -> Maybe (Integer, ByteString)
readInteger as
| null as = Nothing
| otherwise =
case unsafeHead as of
'-' -> first (B.unsafeTail as) >>= \(n, bs) -> return (-n, bs)
'+' -> first (B.unsafeTail as)
_ -> first as
where first ps | null ps = Nothing
| otherwise =
case B.unsafeHead ps of
w | w >= 0x30 && w <= 0x39 -> Just $
loop 1 (fromIntegral w - 0x30) [] (B.unsafeTail ps)
| otherwise -> Nothing
loop :: Int -> Int -> [Integer]
-> ByteString -> (Integer, ByteString)
loop !d !acc ns !ps
| null ps = combine d acc ns empty
| otherwise =
case B.unsafeHead ps of
w | w >= 0x30 && w <= 0x39 ->
if d == 9 then loop 1 (fromIntegral w - 0x30)
(toInteger acc : ns)
(B.unsafeTail ps)
else loop (d+1)
(10*acc + (fromIntegral w - 0x30))
ns (B.unsafeTail ps)
| otherwise -> combine d acc ns ps
combine _ acc [] ps = (toInteger acc, ps)
combine d acc ns ps =
((10^d * combine1 1000000000 ns + toInteger acc), ps)
combine1 _ [n] = n
combine1 b ns = combine1 (b*b) $ combine2 b ns
combine2 b (n:m:ns) = let t = m*b + n in t `seq` (t : combine2 b ns)
combine2 _ ns = ns
------------------------------------------------------------------------
-- For non-binary text processing:
-- | Read an entire file strictly into a 'ByteString'. This is far more
-- efficient than reading the characters into a 'String' and then using
-- 'pack'. It also may be more efficient than opening the file and
-- reading it using hGet.
| 2,059
|
readInteger as
| null as = Nothing
| otherwise =
case unsafeHead as of
'-' -> first (B.unsafeTail as) >>= \(n, bs) -> return (-n, bs)
'+' -> first (B.unsafeTail as)
_ -> first as
where first ps | null ps = Nothing
| otherwise =
case B.unsafeHead ps of
w | w >= 0x30 && w <= 0x39 -> Just $
loop 1 (fromIntegral w - 0x30) [] (B.unsafeTail ps)
| otherwise -> Nothing
loop :: Int -> Int -> [Integer]
-> ByteString -> (Integer, ByteString)
loop !d !acc ns !ps
| null ps = combine d acc ns empty
| otherwise =
case B.unsafeHead ps of
w | w >= 0x30 && w <= 0x39 ->
if d == 9 then loop 1 (fromIntegral w - 0x30)
(toInteger acc : ns)
(B.unsafeTail ps)
else loop (d+1)
(10*acc + (fromIntegral w - 0x30))
ns (B.unsafeTail ps)
| otherwise -> combine d acc ns ps
combine _ acc [] ps = (toInteger acc, ps)
combine d acc ns ps =
((10^d * combine1 1000000000 ns + toInteger acc), ps)
combine1 _ [n] = n
combine1 b ns = combine1 (b*b) $ combine2 b ns
combine2 b (n:m:ns) = let t = m*b + n in t `seq` (t : combine2 b ns)
combine2 _ ns = ns
------------------------------------------------------------------------
-- For non-binary text processing:
-- | Read an entire file strictly into a 'ByteString'. This is far more
-- efficient than reading the characters into a 'String' and then using
-- 'pack'. It also may be more efficient than opening the file and
-- reading it using hGet.
| 2,002
| false
| true
| 8
| 18
| 909
| 631
| 313
| 318
| null | null |
Ericson2314/clash-prelude
|
src/CLaSH/Prelude/BlockRam.hs
|
bsd-2-clause
|
blockRam# :: KnownNat n
=> SClock clk -- ^ 'Clock' to synchronize to
-> Vec n a -- ^ Initial content of the BRAM, also
-- determines the size, @n@, of the BRAM.
--
-- __NB__: __MUST__ be a constant.
-> Signal' clk Int -- ^ Write address @w@
-> Signal' clk Int -- ^ Read address @r@
-> Signal' clk Bool -- ^ Write enable
-> Signal' clk a -- ^ Value to write (at address @w@)
-> Signal' clk a
-- ^ Value of the @blockRAM@ at address @r@ from the previous clock
-- cycle
blockRam# clk content wr rd en din = register' clk undefined dout
where
szI = maxIndex content
dout = runST $ do
arr <- newListArray (0,szI) (toList content)
traverse (ramT arr) (bundle' clk (wr,rd,en,din))
ramT :: STArray s Int e -> (Int,Int,Bool,e) -> ST s e
ramT ram (w,r,e,d) = do
d' <- readArray ram r
when e (writeArray ram w d)
return d'
| 1,062
|
blockRam# :: KnownNat n
=> SClock clk -- ^ 'Clock' to synchronize to
-> Vec n a -- ^ Initial content of the BRAM, also
-- determines the size, @n@, of the BRAM.
--
-- __NB__: __MUST__ be a constant.
-> Signal' clk Int -- ^ Write address @w@
-> Signal' clk Int -- ^ Read address @r@
-> Signal' clk Bool -- ^ Write enable
-> Signal' clk a -- ^ Value to write (at address @w@)
-> Signal' clk a
blockRam# clk content wr rd en din = register' clk undefined dout
where
szI = maxIndex content
dout = runST $ do
arr <- newListArray (0,szI) (toList content)
traverse (ramT arr) (bundle' clk (wr,rd,en,din))
ramT :: STArray s Int e -> (Int,Int,Bool,e) -> ST s e
ramT ram (w,r,e,d) = do
d' <- readArray ram r
when e (writeArray ram w d)
return d'
| 965
|
blockRam# clk content wr rd en din = register' clk undefined dout
where
szI = maxIndex content
dout = runST $ do
arr <- newListArray (0,szI) (toList content)
traverse (ramT arr) (bundle' clk (wr,rd,en,din))
ramT :: STArray s Int e -> (Int,Int,Bool,e) -> ST s e
ramT ram (w,r,e,d) = do
d' <- readArray ram r
when e (writeArray ram w d)
return d'
| 394
| true
| true
| 4
| 12
| 410
| 274
| 142
| 132
| null | null |
Lainepress/hledger
|
hledger-lib/Hledger/Utils.hs
|
gpl-3.0
|
isLeft _ = False
| 23
|
isLeft _ = False
| 23
|
isLeft _ = False
| 23
| false
| false
| 0
| 4
| 10
| 10
| 4
| 6
| null | null |
ghcjs/jsaddle-dom
|
src/JSDOM/Generated/SVGFECompositeElement.hs
|
mit
|
-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGFECompositeElement.k2 Mozilla SVGFECompositeElement.k2 documentation>
getK2 ::
(MonadDOM m) => SVGFECompositeElement -> m SVGAnimatedNumber
getK2 self = liftDOM ((self ^. js "k2") >>= fromJSValUnchecked)
| 268
|
getK2 ::
(MonadDOM m) => SVGFECompositeElement -> m SVGAnimatedNumber
getK2 self = liftDOM ((self ^. js "k2") >>= fromJSValUnchecked)
| 139
|
getK2 self = liftDOM ((self ^. js "k2") >>= fromJSValUnchecked)
| 63
| true
| true
| 0
| 10
| 31
| 56
| 27
| 29
| null | null |
prashant007/AMPL
|
myAMPL/src/Semantics/AMPL_am.hs
|
mit
|
seq_step ((AMC_CASE cs):c,e,V_CONS(i,sl):s) defs = (ci,sl ++ e,V_CLO(c,e):s)
where ci = get_from_list "Case!" cs (i-1)
------------------------------------------------------------------------------
| 223
|
seq_step ((AMC_CASE cs):c,e,V_CONS(i,sl):s) defs = (ci,sl ++ e,V_CLO(c,e):s)
where ci = get_from_list "Case!" cs (i-1)
------------------------------------------------------------------------------
| 223
|
seq_step ((AMC_CASE cs):c,e,V_CONS(i,sl):s) defs = (ci,sl ++ e,V_CLO(c,e):s)
where ci = get_from_list "Case!" cs (i-1)
------------------------------------------------------------------------------
| 223
| false
| false
| 1
| 9
| 41
| 95
| 50
| 45
| null | null |
prasmussen/glot-www
|
Glot/Language.hs
|
mit
|
idToText :: Id -> Text.Text
idToText (Id id) =
id
| 53
|
idToText :: Id -> Text.Text
idToText (Id id) =
id
| 53
|
idToText (Id id) =
id
| 25
| false
| true
| 0
| 9
| 13
| 32
| 14
| 18
| null | null |
tjunier/mlgsc
|
src/TaxoParser.hs
|
mit
|
taxolines = map (ST.splitOn (ST.pack "; ")) $ ST.lines taxo
| 59
|
taxolines = map (ST.splitOn (ST.pack "; ")) $ ST.lines taxo
| 59
|
taxolines = map (ST.splitOn (ST.pack "; ")) $ ST.lines taxo
| 59
| false
| false
| 1
| 10
| 9
| 37
| 16
| 21
| null | null |
haroldcarr/learn-haskell-coq-ml-etc
|
haskell/book/2011-Learn_You_a_Haskell/Learn_You_a_Haskell.hs
|
unlicense
|
-- patterns p 37
-- a handy way of breaking something via pattern and binding to names
-- while keeping a reference to the whole thing
capital :: String -> String
capital "" = "Empty string , whoops!"
| 201
|
capital :: String -> String
capital "" = "Empty string , whoops!"
| 65
|
capital "" = "Empty string , whoops!"
| 37
| true
| true
| 0
| 7
| 38
| 27
| 13
| 14
| null | null |
gridaphobe/ghc
|
compiler/typecheck/TcRnTypes.hs
|
bsd-3-clause
|
pprEvVarWithType :: EvVar -> SDoc
pprEvVarWithType v = ppr v <+> dcolon <+> pprType (evVarPred v)
| 97
|
pprEvVarWithType :: EvVar -> SDoc
pprEvVarWithType v = ppr v <+> dcolon <+> pprType (evVarPred v)
| 97
|
pprEvVarWithType v = ppr v <+> dcolon <+> pprType (evVarPred v)
| 63
| false
| true
| 0
| 8
| 15
| 43
| 19
| 24
| null | null |
mikeizbicki/homoiconic
|
src/Homoiconic/Common/TH.hs
|
bsd-3-clause
|
isList _ = False
| 16
|
isList _ = False
| 16
|
isList _ = False
| 16
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
ollef/Grempa
|
examples/Ex1SimpleExprParser.hs
|
bsd-3-clause
|
parseExprStatic :: Parser Char E
-- For making static parsers, Grempa needs both the "representation" of the
-- grammar, which in this case is achieved by [|expr|], and the grammar itself,
-- which is the reason for the repetition of arguments to the function.
parseExprStatic = $(mkStaticParser expr [|expr|])
| 310
|
parseExprStatic :: Parser Char E
parseExprStatic = $(mkStaticParser expr [|expr|])
| 82
|
parseExprStatic = $(mkStaticParser expr [|expr|])
| 49
| true
| true
| 1
| 8
| 48
| 35
| 18
| 17
| null | null |
ideas-edu/ideas
|
src/Ideas/Common/Predicate.hs
|
apache-2.0
|
predicateView :: View a b -> Predicate a
predicateView = PView
| 63
|
predicateView :: View a b -> Predicate a
predicateView = PView
| 62
|
predicateView = PView
| 21
| false
| true
| 0
| 6
| 11
| 23
| 11
| 12
| null | null |
beni55/haste-compiler
|
libraries/ghc-7.10/ghc-prim/GHC/Prim.hs
|
bsd-3-clause
|
-- | Reads vector; offset in scalar elements.
readInt8OffAddrAsInt8X64# :: Addr# -> Int# -> State# s -> (# State# s,Int8X64# #)
readInt8OffAddrAsInt8X64# = let x = x in x
| 172
|
readInt8OffAddrAsInt8X64# :: Addr# -> Int# -> State# s -> (# State# s,Int8X64# #)
readInt8OffAddrAsInt8X64# = let x = x in x
| 124
|
readInt8OffAddrAsInt8X64# = let x = x in x
| 42
| true
| true
| 0
| 11
| 30
| 53
| 24
| 29
| null | null |
romanb/amazonka
|
amazonka-autoscaling/gen/Network/AWS/AutoScaling/CreateAutoScalingGroup.hs
|
mpl-2.0
|
-- | The tag to be created or updated. Each tag should be defined by its resource
-- type, resource ID, key, value, and a propagate flag. Valid values: key=/value/,
-- value=/value/, propagate=/true/ or /false/. Value and propagate are optional
-- parameters.
--
-- For more information, see <http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html Add, Modify, or Remove Auto Scaling Group Tags> in
-- the /Auto Scaling Developer Guide/.
casgTags :: Lens' CreateAutoScalingGroup [Tag]
casgTags = lens _casgTags (\s a -> s { _casgTags = a }) . _List
| 569
|
casgTags :: Lens' CreateAutoScalingGroup [Tag]
casgTags = lens _casgTags (\s a -> s { _casgTags = a }) . _List
| 110
|
casgTags = lens _casgTags (\s a -> s { _casgTags = a }) . _List
| 63
| true
| true
| 0
| 10
| 83
| 53
| 32
| 21
| null | null |
ocharles/hs-quake-3
|
Quake3/Shader/TypeCheck.hs
|
bsd-3-clause
|
--------------------------------------------------------------------------------
tcInt :: String -> Validation [String] Int
tcInt s = maybe (Failure ["\"" ++ s ++ "\" is not an Int"]) pure (readMaybe s)
| 203
|
tcInt :: String -> Validation [String] Int
tcInt s = maybe (Failure ["\"" ++ s ++ "\" is not an Int"]) pure (readMaybe s)
| 121
|
tcInt s = maybe (Failure ["\"" ++ s ++ "\" is not an Int"]) pure (readMaybe s)
| 78
| true
| true
| 0
| 10
| 25
| 62
| 30
| 32
| null | null |
brendanhay/gogol
|
gogol-drive/gen/Network/Google/Drive/Types/Product.hs
|
mpl-2.0
|
-- | Whether the current user can change the securityUpdateEnabled field on
-- link share metadata.
fcCanChangeSecurityUpdateEnabled :: Lens' FileCapabilities (Maybe Bool)
fcCanChangeSecurityUpdateEnabled
= lens _fcCanChangeSecurityUpdateEnabled
(\ s a -> s{_fcCanChangeSecurityUpdateEnabled = a})
| 305
|
fcCanChangeSecurityUpdateEnabled :: Lens' FileCapabilities (Maybe Bool)
fcCanChangeSecurityUpdateEnabled
= lens _fcCanChangeSecurityUpdateEnabled
(\ s a -> s{_fcCanChangeSecurityUpdateEnabled = a})
| 205
|
fcCanChangeSecurityUpdateEnabled
= lens _fcCanChangeSecurityUpdateEnabled
(\ s a -> s{_fcCanChangeSecurityUpdateEnabled = a})
| 133
| true
| true
| 0
| 9
| 40
| 49
| 26
| 23
| null | null |
mightymoose/liquidhaskell
|
src/Language/Haskell/Liquid/RefType.hs
|
bsd-3-clause
|
strengthenRefType_ f (RAllP p t1) t2
= RAllP p $ strengthenRefType_ f t1 t2
| 77
|
strengthenRefType_ f (RAllP p t1) t2
= RAllP p $ strengthenRefType_ f t1 t2
| 77
|
strengthenRefType_ f (RAllP p t1) t2
= RAllP p $ strengthenRefType_ f t1 t2
| 77
| false
| false
| 0
| 7
| 15
| 35
| 16
| 19
| null | null |
oldmanmike/ghc
|
compiler/nativeGen/X86/Ppr.hs
|
bsd-3-clause
|
{- Gruesome swamp follows. If you're unfortunate enough to have ventured
this far into the jungle AND you give a Rat's Ass (tm) what's going
on, here's the deal. Generate code to do a floating point comparison
of src1 and src2, of kind cond, and set the Zero flag if true.
The complications are to do with handling NaNs correctly. We want the
property that if either argument is NaN, then the result of the
comparison is False ... except if we're comparing for inequality,
in which case the answer is True.
Here's how the general (non-inequality) case works. As an
example, consider generating the an equality test:
pushl %eax -- we need to mess with this
<get src1 to top of FPU stack>
fcomp <src2 location in FPU stack> and pop pushed src1
-- Result of comparison is in FPU Status Register bits
-- C3 C2 and C0
fstsw %ax -- Move FPU Status Reg to %ax
sahf -- move C3 C2 C0 from %ax to integer flag reg
-- now the serious magic begins
setpo %ah -- %ah = if comparable(neither arg was NaN) then 1 else 0
sete %al -- %al = if arg1 == arg2 then 1 else 0
andb %ah,%al -- %al &= %ah
-- so %al == 1 iff (comparable && same); else it holds 0
decb %al -- %al == 0, ZeroFlag=1 iff (comparable && same);
else %al == 0xFF, ZeroFlag=0
-- the zero flag is now set as we desire.
popl %eax
The special case of inequality differs thusly:
setpe %ah -- %ah = if incomparable(either arg was NaN) then 1 else 0
setne %al -- %al = if arg1 /= arg2 then 1 else 0
orb %ah,%al -- %al = if (incomparable || different) then 1 else 0
decb %al -- if (incomparable || different) then (%al == 0, ZF=1)
else (%al == 0xFF, ZF=0)
-}
pprInstr g@(GCMP cond src1 src2)
| case cond of { NE -> True; _ -> False }
= pprG g (vcat [
hcat [gtab, text "pushl %eax ; ",gpush src1 0],
hcat [gtab, text "fcomp ", greg src2 1,
text "; fstsw %ax ; sahf ; setpe %ah"],
hcat [gtab, text "setne %al ; ",
text "orb %ah,%al ; decb %al ; popl %eax"]
])
| otherwise
= pprG g (vcat [
hcat [gtab, text "pushl %eax ; ",gpush src1 0],
hcat [gtab, text "fcomp ", greg src2 1,
text "; fstsw %ax ; sahf ; setpo %ah"],
hcat [gtab, text "set", pprCond (fix_FP_cond cond), text " %al ; ",
text "andb %ah,%al ; decb %al ; popl %eax"]
])
where
{- On the 486, the flags set by FP compare are the unsigned ones!
(This looks like a HACK to me. WDP 96/03)
-}
fix_FP_cond :: Cond -> Cond
fix_FP_cond GE = GEU
fix_FP_cond GTT = GU
fix_FP_cond LTT = LU
fix_FP_cond LE = LEU
fix_FP_cond EQQ = EQQ
fix_FP_cond NE = NE
fix_FP_cond _ = panic "X86.Ppr.fix_FP_cond: no match"
-- there should be no others
| 3,075
|
pprInstr g@(GCMP cond src1 src2)
| case cond of { NE -> True; _ -> False }
= pprG g (vcat [
hcat [gtab, text "pushl %eax ; ",gpush src1 0],
hcat [gtab, text "fcomp ", greg src2 1,
text "; fstsw %ax ; sahf ; setpe %ah"],
hcat [gtab, text "setne %al ; ",
text "orb %ah,%al ; decb %al ; popl %eax"]
])
| otherwise
= pprG g (vcat [
hcat [gtab, text "pushl %eax ; ",gpush src1 0],
hcat [gtab, text "fcomp ", greg src2 1,
text "; fstsw %ax ; sahf ; setpo %ah"],
hcat [gtab, text "set", pprCond (fix_FP_cond cond), text " %al ; ",
text "andb %ah,%al ; decb %al ; popl %eax"]
])
where
{- On the 486, the flags set by FP compare are the unsigned ones!
(This looks like a HACK to me. WDP 96/03)
-}
fix_FP_cond :: Cond -> Cond
fix_FP_cond GE = GEU
fix_FP_cond GTT = GU
fix_FP_cond LTT = LU
fix_FP_cond LE = LEU
fix_FP_cond EQQ = EQQ
fix_FP_cond NE = NE
fix_FP_cond _ = panic "X86.Ppr.fix_FP_cond: no match"
-- there should be no others
| 1,184
|
pprInstr g@(GCMP cond src1 src2)
| case cond of { NE -> True; _ -> False }
= pprG g (vcat [
hcat [gtab, text "pushl %eax ; ",gpush src1 0],
hcat [gtab, text "fcomp ", greg src2 1,
text "; fstsw %ax ; sahf ; setpe %ah"],
hcat [gtab, text "setne %al ; ",
text "orb %ah,%al ; decb %al ; popl %eax"]
])
| otherwise
= pprG g (vcat [
hcat [gtab, text "pushl %eax ; ",gpush src1 0],
hcat [gtab, text "fcomp ", greg src2 1,
text "; fstsw %ax ; sahf ; setpo %ah"],
hcat [gtab, text "set", pprCond (fix_FP_cond cond), text " %al ; ",
text "andb %ah,%al ; decb %al ; popl %eax"]
])
where
{- On the 486, the flags set by FP compare are the unsigned ones!
(This looks like a HACK to me. WDP 96/03)
-}
fix_FP_cond :: Cond -> Cond
fix_FP_cond GE = GEU
fix_FP_cond GTT = GU
fix_FP_cond LTT = LU
fix_FP_cond LE = LEU
fix_FP_cond EQQ = EQQ
fix_FP_cond NE = NE
fix_FP_cond _ = panic "X86.Ppr.fix_FP_cond: no match"
-- there should be no others
| 1,184
| true
| false
| 0
| 14
| 1,052
| 317
| 162
| 155
| null | null |
bgamari/text
|
src/Data/Text/Lazy.hs
|
bsd-2-clause
|
-- ----------------------------------------------------------------------------
-- ** Case conversions (folds)
-- $case
--
-- With Unicode text, it is incorrect to use combinators like @map
-- toUpper@ to case convert each character of a string individually.
-- Instead, use the whole-string case conversion functions from this
-- module. For correctness in different writing systems, these
-- functions may map one input character to two or three output
-- characters.
-- | /O(n)/ Convert a string to folded case. Subject to fusion.
--
-- This function is mainly useful for performing caseless (or case
-- insensitive) string comparisons.
--
-- A string @x@ is a caseless match for a string @y@ if and only if:
--
-- @toCaseFold x == toCaseFold y@
--
-- The result string may be longer than the input string, and may
-- differ from applying 'toLower' to the input string. For instance,
-- the Armenian small ligature men now (U+FB13) is case folded to the
-- bigram men now (U+0574 U+0576), while the micro sign (U+00B5) is
-- case folded to the Greek small letter letter mu (U+03BC) instead of
-- itself.
toCaseFold :: Text -> Text
toCaseFold t = unstream (S.toCaseFold (stream t))
| 1,188
|
toCaseFold :: Text -> Text
toCaseFold t = unstream (S.toCaseFold (stream t))
| 76
|
toCaseFold t = unstream (S.toCaseFold (stream t))
| 49
| true
| true
| 0
| 9
| 199
| 60
| 42
| 18
| null | null |
junjihashimoto/hsverilog
|
src/HsVerilog/Simulation.hs
|
bsd-3-clause
|
readReg :: Monad m => T.Text -> StateT Circuit m Integer
readReg name = do
cir <- get
let m = M.fromList $ map (\sig -> (sname sig,sig)) $ concat $ map (\f -> f cir) [(map alsig).creg]
return $ sval $ m M.! name
| 218
|
readReg :: Monad m => T.Text -> StateT Circuit m Integer
readReg name = do
cir <- get
let m = M.fromList $ map (\sig -> (sname sig,sig)) $ concat $ map (\f -> f cir) [(map alsig).creg]
return $ sval $ m M.! name
| 218
|
readReg name = do
cir <- get
let m = M.fromList $ map (\sig -> (sname sig,sig)) $ concat $ map (\f -> f cir) [(map alsig).creg]
return $ sval $ m M.! name
| 160
| false
| true
| 0
| 17
| 51
| 133
| 64
| 69
| null | null |
spechub/Hets
|
Comorphisms/THFP2THF0.hs
|
gpl-2.0
|
isProdT m (ParType t) = isProdT m t
| 35
|
isProdT m (ParType t) = isProdT m t
| 35
|
isProdT m (ParType t) = isProdT m t
| 35
| false
| false
| 0
| 7
| 7
| 22
| 10
| 12
| null | null |
atomb/dalvik
|
Dalvik/Instruction.hs
|
bsd-3-clause
|
iparser :: Word8 -> IFormatParser
iparser = (!) iparseTable
| 59
|
iparser :: Word8 -> IFormatParser
iparser = (!) iparseTable
| 59
|
iparser = (!) iparseTable
| 25
| false
| true
| 0
| 5
| 8
| 20
| 11
| 9
| null | null |
luebbers/reconos
|
tools/fsmLanguage/kurm/assembler/Parser.hs
|
gpl-3.0
|
r0 = dreg "r0" 0
| 17
|
r0 = dreg "r0" 0
| 17
|
r0 = dreg "r0" 0
| 17
| false
| false
| 1
| 5
| 5
| 14
| 5
| 9
| null | null |
feuerbach/stackage
|
stackage-upload.hs
|
mit
|
mkIndex :: String -> [String] -> String
mkIndex snapid dirs = concat
[ "<!DOCTYPE html>\n<html lang='en'><head><title>Haddocks index</title>"
, "<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'>"
, "<link rel='stylesheet' href='style.css'>"
, "<link rel='shortcut icon' href='http://www.stackage.org/static/img/favicon.ico' />"
, "</head>"
, "<body><div class='container'>"
, "<div class='row'><div class='span12 col-md-12'>"
, "<h1>Haddock documentation index</h1>"
, "<p class='return'><a href=\"http://www.stackage.org/stackage/"
, snapid
, "\">Return to snapshot</a></p><ul>"
, concatMap toLI dirs
, "</ul></div></div></div></body></html>"
]
where
toLI name = concat
[ "<li><a href='"
, name
, "/index.html'>"
, name
, "</a></li>"
]
| 897
|
mkIndex :: String -> [String] -> String
mkIndex snapid dirs = concat
[ "<!DOCTYPE html>\n<html lang='en'><head><title>Haddocks index</title>"
, "<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'>"
, "<link rel='stylesheet' href='style.css'>"
, "<link rel='shortcut icon' href='http://www.stackage.org/static/img/favicon.ico' />"
, "</head>"
, "<body><div class='container'>"
, "<div class='row'><div class='span12 col-md-12'>"
, "<h1>Haddock documentation index</h1>"
, "<p class='return'><a href=\"http://www.stackage.org/stackage/"
, snapid
, "\">Return to snapshot</a></p><ul>"
, concatMap toLI dirs
, "</ul></div></div></div></body></html>"
]
where
toLI name = concat
[ "<li><a href='"
, name
, "/index.html'>"
, name
, "</a></li>"
]
| 897
|
mkIndex snapid dirs = concat
[ "<!DOCTYPE html>\n<html lang='en'><head><title>Haddocks index</title>"
, "<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'>"
, "<link rel='stylesheet' href='style.css'>"
, "<link rel='shortcut icon' href='http://www.stackage.org/static/img/favicon.ico' />"
, "</head>"
, "<body><div class='container'>"
, "<div class='row'><div class='span12 col-md-12'>"
, "<h1>Haddock documentation index</h1>"
, "<p class='return'><a href=\"http://www.stackage.org/stackage/"
, snapid
, "\">Return to snapshot</a></p><ul>"
, concatMap toLI dirs
, "</ul></div></div></div></body></html>"
]
where
toLI name = concat
[ "<li><a href='"
, name
, "/index.html'>"
, name
, "</a></li>"
]
| 857
| false
| true
| 1
| 8
| 188
| 111
| 60
| 51
| null | null |
skeskinen/neflEFortress
|
Creature.hs
|
mit
|
nameGenerator :: String
nameGenerator = "Uther"
| 47
|
nameGenerator :: String
nameGenerator = "Uther"
| 47
|
nameGenerator = "Uther"
| 23
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
bitemyapp/hoq
|
src/Semantics.hs
|
gpl-2.0
|
isInj Universe{} = True
| 23
|
isInj Universe{} = True
| 23
|
isInj Universe{} = True
| 23
| false
| false
| 1
| 5
| 3
| 16
| 6
| 10
| null | null |
dmpots/fibon
|
FindConfig.hs
|
bsd-3-clause
|
modulesList :: [String] -> String
modulesList mods = typ ++ lst
where
typ = "localConfigs :: [RunConfig]\n"
lst = "localConfigs = [" ++ (join ", " cfgs) ++ "]"
cfgs = map (++".config") mods
join s = concat . intersperse s
| 232
|
modulesList :: [String] -> String
modulesList mods = typ ++ lst
where
typ = "localConfigs :: [RunConfig]\n"
lst = "localConfigs = [" ++ (join ", " cfgs) ++ "]"
cfgs = map (++".config") mods
join s = concat . intersperse s
| 232
|
modulesList mods = typ ++ lst
where
typ = "localConfigs :: [RunConfig]\n"
lst = "localConfigs = [" ++ (join ", " cfgs) ++ "]"
cfgs = map (++".config") mods
join s = concat . intersperse s
| 198
| false
| true
| 0
| 8
| 51
| 83
| 43
| 40
| null | null |
codingiam/sandbox-hs
|
src/Hw04.hs
|
bsd-3-clause
|
fun2 n | even n = n + fun2 (n `div` 2)
| otherwise = fun2 (3 * n + 1)
| 79
|
fun2 n | even n = n + fun2 (n `div` 2)
| otherwise = fun2 (3 * n + 1)
| 79
|
fun2 n | even n = n + fun2 (n `div` 2)
| otherwise = fun2 (3 * n + 1)
| 79
| false
| false
| 2
| 8
| 30
| 64
| 29
| 35
| null | null |
dbp/snaplet-wordpress
|
src/Web/Offset/Cache.hs
|
bsd-3-clause
|
cacheSet :: CacheBehavior -> Text -> Text -> Redis Bool
cacheSet b k v =
case b of
(CacheSeconds n) -> rsetex k n v
CacheForever -> rset k v
NoCache -> return True
| 174
|
cacheSet :: CacheBehavior -> Text -> Text -> Redis Bool
cacheSet b k v =
case b of
(CacheSeconds n) -> rsetex k n v
CacheForever -> rset k v
NoCache -> return True
| 174
|
cacheSet b k v =
case b of
(CacheSeconds n) -> rsetex k n v
CacheForever -> rset k v
NoCache -> return True
| 118
| false
| true
| 0
| 9
| 44
| 76
| 36
| 40
| null | null |
urbanslug/ghc
|
compiler/simplCore/CoreMonad.hs
|
bsd-3-clause
|
getAnnotations :: Typeable a => ([Word8] -> a) -> ModGuts -> CoreM (UniqFM [a])
getAnnotations deserialize guts = do
hsc_env <- getHscEnv
ann_env <- liftIO $ prepareAnnotations hsc_env (Just guts)
return (deserializeAnns deserialize ann_env)
-- | Get at most one annotation of a given type per Unique.
| 317
|
getAnnotations :: Typeable a => ([Word8] -> a) -> ModGuts -> CoreM (UniqFM [a])
getAnnotations deserialize guts = do
hsc_env <- getHscEnv
ann_env <- liftIO $ prepareAnnotations hsc_env (Just guts)
return (deserializeAnns deserialize ann_env)
-- | Get at most one annotation of a given type per Unique.
| 317
|
getAnnotations deserialize guts = do
hsc_env <- getHscEnv
ann_env <- liftIO $ prepareAnnotations hsc_env (Just guts)
return (deserializeAnns deserialize ann_env)
-- | Get at most one annotation of a given type per Unique.
| 237
| false
| true
| 0
| 12
| 62
| 102
| 48
| 54
| null | null |
tolysz/prepare-ghcjs
|
spec-lts8/base/GHC/Foreign.hs
|
bsd-3-clause
|
withEncodedCString :: TextEncoding -- ^ Encoding of CString to create
-> Bool -- ^ Null-terminate?
-> String -- ^ String to encode
-> (CStringLen -> IO a) -- ^ Worker that can safely use the allocated memory
-> IO a
withEncodedCString (TextEncoding { mkTextEncoder = mk_encoder }) null_terminate s act
= bracket mk_encoder close $ \encoder -> withArrayLen s $ \sz p -> do
from <- fmap (\fp -> bufferAdd sz (emptyBuffer fp sz ReadBuffer)) $ newForeignPtr_ p
let go iteration to_sz_bytes = do
putDebugMsg ("withEncodedCString: " ++ show iteration)
allocaBytes to_sz_bytes $ \to_p -> do
mb_res <- tryFillBufferAndCall encoder null_terminate from to_p to_sz_bytes act
case mb_res of
Nothing -> go (iteration + 1) (to_sz_bytes * 2)
Just res -> return res
-- If the input string is ASCII, this value will ensure we only allocate once
go (0 :: Int) (cCharSize * (sz + 1))
| 1,083
|
withEncodedCString :: TextEncoding -- ^ Encoding of CString to create
-> Bool -- ^ Null-terminate?
-> String -- ^ String to encode
-> (CStringLen -> IO a) -- ^ Worker that can safely use the allocated memory
-> IO a
withEncodedCString (TextEncoding { mkTextEncoder = mk_encoder }) null_terminate s act
= bracket mk_encoder close $ \encoder -> withArrayLen s $ \sz p -> do
from <- fmap (\fp -> bufferAdd sz (emptyBuffer fp sz ReadBuffer)) $ newForeignPtr_ p
let go iteration to_sz_bytes = do
putDebugMsg ("withEncodedCString: " ++ show iteration)
allocaBytes to_sz_bytes $ \to_p -> do
mb_res <- tryFillBufferAndCall encoder null_terminate from to_p to_sz_bytes act
case mb_res of
Nothing -> go (iteration + 1) (to_sz_bytes * 2)
Just res -> return res
-- If the input string is ASCII, this value will ensure we only allocate once
go (0 :: Int) (cCharSize * (sz + 1))
| 1,083
|
withEncodedCString (TextEncoding { mkTextEncoder = mk_encoder }) null_terminate s act
= bracket mk_encoder close $ \encoder -> withArrayLen s $ \sz p -> do
from <- fmap (\fp -> bufferAdd sz (emptyBuffer fp sz ReadBuffer)) $ newForeignPtr_ p
let go iteration to_sz_bytes = do
putDebugMsg ("withEncodedCString: " ++ show iteration)
allocaBytes to_sz_bytes $ \to_p -> do
mb_res <- tryFillBufferAndCall encoder null_terminate from to_p to_sz_bytes act
case mb_res of
Nothing -> go (iteration + 1) (to_sz_bytes * 2)
Just res -> return res
-- If the input string is ASCII, this value will ensure we only allocate once
go (0 :: Int) (cCharSize * (sz + 1))
| 753
| false
| true
| 0
| 25
| 364
| 271
| 134
| 137
| null | null |
lally/org-issue-sync
|
src/TestParse.hs
|
apache-2.0
|
main :: IO ()
main = do
argv <- getArgs
case getOpt Permute options argv of
(_, _, errs@(e:es)) -> ioError (
userError (concat errs ++ usageInfo "Org Test Parse" options))
(o, files, []) -> do
let opts = foldl (flip id) dfltOptions o
mapM_ (processFile opts) files
| 294
|
main :: IO ()
main = do
argv <- getArgs
case getOpt Permute options argv of
(_, _, errs@(e:es)) -> ioError (
userError (concat errs ++ usageInfo "Org Test Parse" options))
(o, files, []) -> do
let opts = foldl (flip id) dfltOptions o
mapM_ (processFile opts) files
| 294
|
main = do
argv <- getArgs
case getOpt Permute options argv of
(_, _, errs@(e:es)) -> ioError (
userError (concat errs ++ usageInfo "Org Test Parse" options))
(o, files, []) -> do
let opts = foldl (flip id) dfltOptions o
mapM_ (processFile opts) files
| 280
| false
| true
| 1
| 10
| 77
| 126
| 68
| 58
| null | null |
forked-upstream-packages-for-ghcjs/ghcjs
|
ghcjs/src/Gen2/Archive.hs
|
mit
|
withEntry :: String -> String
-> (Entry -> Bool) -> (Handle -> Int64 -> IO a)
-> Sections -> Index -> Handle
-> IO a
withEntry name entryName p f sections index h =
case filter (p . ieEntry) index of
[] -> error (name ++ ": cannot find " ++ entryName)
[IndexEntry _ o l] -> do
hSeek h AbsoluteSeek (dataSectionStart sections + toInteger o)
f h (fromIntegral l)
_ -> error (name ++ ": multiple matches for " ++ entryName)
| 476
|
withEntry :: String -> String
-> (Entry -> Bool) -> (Handle -> Int64 -> IO a)
-> Sections -> Index -> Handle
-> IO a
withEntry name entryName p f sections index h =
case filter (p . ieEntry) index of
[] -> error (name ++ ": cannot find " ++ entryName)
[IndexEntry _ o l] -> do
hSeek h AbsoluteSeek (dataSectionStart sections + toInteger o)
f h (fromIntegral l)
_ -> error (name ++ ": multiple matches for " ++ entryName)
| 476
|
withEntry name entryName p f sections index h =
case filter (p . ieEntry) index of
[] -> error (name ++ ": cannot find " ++ entryName)
[IndexEntry _ o l] -> do
hSeek h AbsoluteSeek (dataSectionStart sections + toInteger o)
f h (fromIntegral l)
_ -> error (name ++ ": multiple matches for " ++ entryName)
| 329
| false
| true
| 0
| 13
| 137
| 193
| 93
| 100
| null | null |
tonyday567/lucid-page
|
src/Web/Rep/SharedReps.hs
|
mit
|
-- | turns a SharedRep into a fiddle
viaFiddle ::
(Monad m) =>
SharedRep m a ->
SharedRep m (Bool, Concerns Text, a)
viaFiddle sr = SharedRep $ do
sr'@(Rep h _) <- unshare sr
hrep <- unshare $ textarea 10 (Just "html") (toText h)
crep <- unshare $ textarea 10 (Just "css") mempty
jrep <- unshare $ textarea 10 (Just "js") mempty
u <- unshare $ button (Just "update")
pure $
bimap
(\up a b c _ -> Lucid.with div_ [class__ "fiddle "] $ mconcat [up, a, b, c])
(\up a b c d -> (up, Concerns a b c, d))
u
<<*>> crep
<<*>> jrep
<<*>> hrep
<<*>> sr'
| 606
|
viaFiddle ::
(Monad m) =>
SharedRep m a ->
SharedRep m (Bool, Concerns Text, a)
viaFiddle sr = SharedRep $ do
sr'@(Rep h _) <- unshare sr
hrep <- unshare $ textarea 10 (Just "html") (toText h)
crep <- unshare $ textarea 10 (Just "css") mempty
jrep <- unshare $ textarea 10 (Just "js") mempty
u <- unshare $ button (Just "update")
pure $
bimap
(\up a b c _ -> Lucid.with div_ [class__ "fiddle "] $ mconcat [up, a, b, c])
(\up a b c d -> (up, Concerns a b c, d))
u
<<*>> crep
<<*>> jrep
<<*>> hrep
<<*>> sr'
| 569
|
viaFiddle sr = SharedRep $ do
sr'@(Rep h _) <- unshare sr
hrep <- unshare $ textarea 10 (Just "html") (toText h)
crep <- unshare $ textarea 10 (Just "css") mempty
jrep <- unshare $ textarea 10 (Just "js") mempty
u <- unshare $ button (Just "update")
pure $
bimap
(\up a b c _ -> Lucid.with div_ [class__ "fiddle "] $ mconcat [up, a, b, c])
(\up a b c d -> (up, Concerns a b c, d))
u
<<*>> crep
<<*>> jrep
<<*>> hrep
<<*>> sr'
| 483
| true
| true
| 2
| 18
| 174
| 289
| 142
| 147
| null | null |
c0deaddict/project-euler
|
src/Part1/Problem17.hs
|
bsd-3-clause
|
numberLetters 14 = "fourteen"
| 29
|
numberLetters 14 = "fourteen"
| 29
|
numberLetters 14 = "fourteen"
| 29
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
phi16/Lambia
|
src/Lambia/Parse.hs
|
gpl-3.0
|
lf :: Parser ()
lf = eof <|> do
let
l = let
a = try $ do
none
string "//" <|> string ":"
manyTill anyChar $ try $ void endOfLine <|> eof
return ()
b = try $ do
none
void endOfLine
c = do
spaces1
eof
in choice [a,b,c]
l
manyTill l $ try $ eof <|> notFollowedBy l
return ()
| 393
|
lf :: Parser ()
lf = eof <|> do
let
l = let
a = try $ do
none
string "//" <|> string ":"
manyTill anyChar $ try $ void endOfLine <|> eof
return ()
b = try $ do
none
void endOfLine
c = do
spaces1
eof
in choice [a,b,c]
l
manyTill l $ try $ eof <|> notFollowedBy l
return ()
| 393
|
lf = eof <|> do
let
l = let
a = try $ do
none
string "//" <|> string ":"
manyTill anyChar $ try $ void endOfLine <|> eof
return ()
b = try $ do
none
void endOfLine
c = do
spaces1
eof
in choice [a,b,c]
l
manyTill l $ try $ eof <|> notFollowedBy l
return ()
| 377
| false
| true
| 9
| 16
| 184
| 158
| 74
| 84
| null | null |
adamgundry/units-parser
|
Tests/Parser.hs
|
bsd-3-clause
|
leftOnly :: Either a b -> Maybe a
leftOnly (Left a) = Just a
| 60
|
leftOnly :: Either a b -> Maybe a
leftOnly (Left a) = Just a
| 60
|
leftOnly (Left a) = Just a
| 26
| false
| true
| 0
| 7
| 13
| 35
| 16
| 19
| null | null |
gbaz/cabal
|
cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs
|
bsd-3-clause
|
prop_roundtrip_legacytypes_all :: ProjectConfig -> Bool
prop_roundtrip_legacytypes_all =
roundtrip_legacytypes
| 114
|
prop_roundtrip_legacytypes_all :: ProjectConfig -> Bool
prop_roundtrip_legacytypes_all =
roundtrip_legacytypes
| 114
|
prop_roundtrip_legacytypes_all =
roundtrip_legacytypes
| 58
| false
| true
| 0
| 5
| 11
| 15
| 8
| 7
| null | null |
edsko/cabal
|
Cabal/src/Distribution/PackageDescription.hs
|
bsd-3-clause
|
emptyLibrary :: Library
emptyLibrary = mempty
| 45
|
emptyLibrary :: Library
emptyLibrary = mempty
| 45
|
emptyLibrary = mempty
| 21
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
ryota-ka/yo-slack-adapter
|
src/Web/Slack/IncomingWebhook/Message.hs
|
bsd-3-clause
|
withChannel :: Message -> String -> Message
withChannel m channel = m { messageChannel = Just channel }
| 103
|
withChannel :: Message -> String -> Message
withChannel m channel = m { messageChannel = Just channel }
| 103
|
withChannel m channel = m { messageChannel = Just channel }
| 59
| false
| true
| 0
| 7
| 17
| 35
| 18
| 17
| null | null |
CloudI/CloudI
|
src/api/haskell/external/bytestring-0.10.10.0/Data/ByteString/Short/Internal.hs
|
mit
|
copyAddrToByteArray :: Ptr a -> MBA RealWorld -> Int -> Int -> ST RealWorld ()
copyAddrToByteArray (Ptr src#) (MBA# dst#) (I# dst_off#) (I# len#) =
ST $ \s -> case copyAddrToByteArray# src# dst# dst_off# len# s of
s -> (# s, () #)
| 251
|
copyAddrToByteArray :: Ptr a -> MBA RealWorld -> Int -> Int -> ST RealWorld ()
copyAddrToByteArray (Ptr src#) (MBA# dst#) (I# dst_off#) (I# len#) =
ST $ \s -> case copyAddrToByteArray# src# dst# dst_off# len# s of
s -> (# s, () #)
| 251
|
copyAddrToByteArray (Ptr src#) (MBA# dst#) (I# dst_off#) (I# len#) =
ST $ \s -> case copyAddrToByteArray# src# dst# dst_off# len# s of
s -> (# s, () #)
| 172
| false
| true
| 2
| 12
| 63
| 116
| 55
| 61
| null | null |
ihc/futhark
|
src/Futhark/Optimise/Simplifier/Engine.hs
|
isc
|
putEngineState :: State (SimpleM lore) -> SimpleM lore ()
putEngineState x = modify $ \(_, y) -> (x,y)
| 102
|
putEngineState :: State (SimpleM lore) -> SimpleM lore ()
putEngineState x = modify $ \(_, y) -> (x,y)
| 102
|
putEngineState x = modify $ \(_, y) -> (x,y)
| 44
| false
| true
| 0
| 8
| 17
| 55
| 29
| 26
| null | null |
orchid-hybrid/WHILE
|
EllaBased/Assembly.hs
|
gpl-2.0
|
s' (ADec x) = sp "dec" ++ op x
| 30
|
s' (ADec x) = sp "dec" ++ op x
| 30
|
s' (ADec x) = sp "dec" ++ op x
| 30
| false
| false
| 0
| 7
| 8
| 25
| 11
| 14
| null | null |
jbracker/supermonad-plugin
|
examples/monad/hmtc/supermonad/CodeGenMonad.hs
|
bsd-3-clause
|
cgTest :: CG String Int ()
cgTest = do
l1 <- newName
l2 <- newName
emitAux 0
emit ("LABEL " ++ l1)
emit ("PUSH 0")
divert cgTest1
emit ("JUMPIFZ " ++ l2)
emit ("JUMP " ++ l1)
emitAux 10
l3 <- newName
emit ("LABEL " ++ l2)
emit ("LABEL " ++ l3)
| 291
|
cgTest :: CG String Int ()
cgTest = do
l1 <- newName
l2 <- newName
emitAux 0
emit ("LABEL " ++ l1)
emit ("PUSH 0")
divert cgTest1
emit ("JUMPIFZ " ++ l2)
emit ("JUMP " ++ l1)
emitAux 10
l3 <- newName
emit ("LABEL " ++ l2)
emit ("LABEL " ++ l3)
| 291
|
cgTest = do
l1 <- newName
l2 <- newName
emitAux 0
emit ("LABEL " ++ l1)
emit ("PUSH 0")
divert cgTest1
emit ("JUMPIFZ " ++ l2)
emit ("JUMP " ++ l1)
emitAux 10
l3 <- newName
emit ("LABEL " ++ l2)
emit ("LABEL " ++ l3)
| 264
| false
| true
| 1
| 10
| 99
| 139
| 59
| 80
| null | null |
svaiter/fay-canvas
|
src/HtmlCanvas.hs
|
bsd-3-clause
|
newImage :: Fay Image
newImage = ffi "new Image()"
| 50
|
newImage :: Fay Image
newImage = ffi "new Image()"
| 50
|
newImage = ffi "new Image()"
| 28
| false
| true
| 0
| 5
| 8
| 17
| 8
| 9
| null | null |
rahulmutt/ghcvm
|
compiler/Eta/HsSyn/HsDecls.hs
|
bsd-3-clause
|
appendGroups :: HsGroup a -> HsGroup a -> HsGroup a
appendGroups
HsGroup {
hs_valds = val_groups1,
hs_splcds = spliceds1,
hs_tyclds = tyclds1,
hs_instds = instds1,
hs_derivds = derivds1,
hs_fixds = fixds1,
hs_defds = defds1,
hs_annds = annds1,
hs_fords = fords1,
hs_warnds = warnds1,
hs_ruleds = rulds1,
hs_vects = vects1,
hs_docs = docs1 }
HsGroup {
hs_valds = val_groups2,
hs_splcds = spliceds2,
hs_tyclds = tyclds2,
hs_instds = instds2,
hs_derivds = derivds2,
hs_fixds = fixds2,
hs_defds = defds2,
hs_annds = annds2,
hs_fords = fords2,
hs_warnds = warnds2,
hs_ruleds = rulds2,
hs_vects = vects2,
hs_docs = docs2 }
=
HsGroup {
hs_valds = val_groups1 `plusHsValBinds` val_groups2,
hs_splcds = spliceds1 ++ spliceds2,
hs_tyclds = tyclds1 ++ tyclds2,
hs_instds = instds1 ++ instds2,
hs_derivds = derivds1 ++ derivds2,
hs_fixds = fixds1 ++ fixds2,
hs_annds = annds1 ++ annds2,
hs_defds = defds1 ++ defds2,
hs_fords = fords1 ++ fords2,
hs_warnds = warnds1 ++ warnds2,
hs_ruleds = rulds1 ++ rulds2,
hs_vects = vects1 ++ vects2,
hs_docs = docs1 ++ docs2 }
| 1,465
|
appendGroups :: HsGroup a -> HsGroup a -> HsGroup a
appendGroups
HsGroup {
hs_valds = val_groups1,
hs_splcds = spliceds1,
hs_tyclds = tyclds1,
hs_instds = instds1,
hs_derivds = derivds1,
hs_fixds = fixds1,
hs_defds = defds1,
hs_annds = annds1,
hs_fords = fords1,
hs_warnds = warnds1,
hs_ruleds = rulds1,
hs_vects = vects1,
hs_docs = docs1 }
HsGroup {
hs_valds = val_groups2,
hs_splcds = spliceds2,
hs_tyclds = tyclds2,
hs_instds = instds2,
hs_derivds = derivds2,
hs_fixds = fixds2,
hs_defds = defds2,
hs_annds = annds2,
hs_fords = fords2,
hs_warnds = warnds2,
hs_ruleds = rulds2,
hs_vects = vects2,
hs_docs = docs2 }
=
HsGroup {
hs_valds = val_groups1 `plusHsValBinds` val_groups2,
hs_splcds = spliceds1 ++ spliceds2,
hs_tyclds = tyclds1 ++ tyclds2,
hs_instds = instds1 ++ instds2,
hs_derivds = derivds1 ++ derivds2,
hs_fixds = fixds1 ++ fixds2,
hs_annds = annds1 ++ annds2,
hs_defds = defds1 ++ defds2,
hs_fords = fords1 ++ fords2,
hs_warnds = warnds1 ++ warnds2,
hs_ruleds = rulds1 ++ rulds2,
hs_vects = vects1 ++ vects2,
hs_docs = docs1 ++ docs2 }
| 1,465
|
appendGroups
HsGroup {
hs_valds = val_groups1,
hs_splcds = spliceds1,
hs_tyclds = tyclds1,
hs_instds = instds1,
hs_derivds = derivds1,
hs_fixds = fixds1,
hs_defds = defds1,
hs_annds = annds1,
hs_fords = fords1,
hs_warnds = warnds1,
hs_ruleds = rulds1,
hs_vects = vects1,
hs_docs = docs1 }
HsGroup {
hs_valds = val_groups2,
hs_splcds = spliceds2,
hs_tyclds = tyclds2,
hs_instds = instds2,
hs_derivds = derivds2,
hs_fixds = fixds2,
hs_defds = defds2,
hs_annds = annds2,
hs_fords = fords2,
hs_warnds = warnds2,
hs_ruleds = rulds2,
hs_vects = vects2,
hs_docs = docs2 }
=
HsGroup {
hs_valds = val_groups1 `plusHsValBinds` val_groups2,
hs_splcds = spliceds1 ++ spliceds2,
hs_tyclds = tyclds1 ++ tyclds2,
hs_instds = instds1 ++ instds2,
hs_derivds = derivds1 ++ derivds2,
hs_fixds = fixds1 ++ fixds2,
hs_annds = annds1 ++ annds2,
hs_defds = defds1 ++ defds2,
hs_fords = fords1 ++ fords2,
hs_warnds = warnds1 ++ warnds2,
hs_ruleds = rulds1 ++ rulds2,
hs_vects = vects1 ++ vects2,
hs_docs = docs1 ++ docs2 }
| 1,413
| false
| true
| 0
| 7
| 578
| 330
| 202
| 128
| null | null |
sdiehl/ghc
|
compiler/nativeGen/PPC/Instr.hs
|
bsd-3-clause
|
interesting _ (RegReal (RealRegPair{}))
= panic "PPC.Instr.interesting: no reg pairs on this arch"
| 109
|
interesting _ (RegReal (RealRegPair{}))
= panic "PPC.Instr.interesting: no reg pairs on this arch"
| 109
|
interesting _ (RegReal (RealRegPair{}))
= panic "PPC.Instr.interesting: no reg pairs on this arch"
| 109
| false
| false
| 0
| 9
| 23
| 27
| 13
| 14
| null | null |
noteed/rescoyl
|
Rescoyl/Handlers.hs
|
bsd-3-clause
|
catch500 :: Handler App App a -> Handler App App ()
catch500 m = (m >> return ()) `catch` \(e::SomeException) -> do
putResponse $ setContentType "text/html" $
setResponseStatus 500 "Internal Server Error" emptyResponse
writeText "The Rescoyl Docker registry exploded. Exception:\n\n"
writeText $ T.pack $ show e
logError $ B.concat [ "caught exception: ", B.pack $ show e ]
| 386
|
catch500 :: Handler App App a -> Handler App App ()
catch500 m = (m >> return ()) `catch` \(e::SomeException) -> do
putResponse $ setContentType "text/html" $
setResponseStatus 500 "Internal Server Error" emptyResponse
writeText "The Rescoyl Docker registry exploded. Exception:\n\n"
writeText $ T.pack $ show e
logError $ B.concat [ "caught exception: ", B.pack $ show e ]
| 386
|
catch500 m = (m >> return ()) `catch` \(e::SomeException) -> do
putResponse $ setContentType "text/html" $
setResponseStatus 500 "Internal Server Error" emptyResponse
writeText "The Rescoyl Docker registry exploded. Exception:\n\n"
writeText $ T.pack $ show e
logError $ B.concat [ "caught exception: ", B.pack $ show e ]
| 334
| false
| true
| 0
| 14
| 70
| 139
| 65
| 74
| null | null |
phadej/base-orphans
|
test/System/Posix/Types/OrphansSpec.hs
|
mit
|
pred1HDevHDev :: (CDev -> CDev) -> (HDev -> HDev) -> HDev -> Bool
pred1HDevHDev = pred1HDev eqCDevHDev
| 102
|
pred1HDevHDev :: (CDev -> CDev) -> (HDev -> HDev) -> HDev -> Bool
pred1HDevHDev = pred1HDev eqCDevHDev
| 102
|
pred1HDevHDev = pred1HDev eqCDevHDev
| 36
| false
| true
| 0
| 8
| 16
| 40
| 21
| 19
| null | null |
mastensg/monitor
|
monitor.hs
|
mit
|
parse :: [String] -> IO ()
parse (command:paths) = do
_ <- addWatches (eventHandler command paths) $ uniqDirs paths
wait command
| 136
|
parse :: [String] -> IO ()
parse (command:paths) = do
_ <- addWatches (eventHandler command paths) $ uniqDirs paths
wait command
| 136
|
parse (command:paths) = do
_ <- addWatches (eventHandler command paths) $ uniqDirs paths
wait command
| 109
| false
| true
| 0
| 11
| 28
| 64
| 30
| 34
| null | null |
stevana/yeast
|
src/Yeast/Fetch.hs
|
isc
|
------------------------------------------------------------------------
-- $fetching
-- We can fetch feeds in various ways.
-- | Fetch a single feed.
fetch
:: String -- ^ URL.
-> IO (Either FetchError Feed)
fetch url = head <$> fetchMany [url]
| 271
|
fetch
:: String -- ^ URL.
-> IO (Either FetchError Feed)
fetch url = head <$> fetchMany [url]
| 119
|
fetch url = head <$> fetchMany [url]
| 36
| true
| true
| 2
| 9
| 61
| 49
| 25
| 24
| null | null |
tittoassini/typed
|
src/ZM/To/Encoder.hs
|
bsd-3-clause
|
flds :: TypeEncoderMap -> [AbsType] -> Parser OBJ
flds env ps = mconcat (map (typeEncoder_ env) ps)
| 99
|
flds :: TypeEncoderMap -> [AbsType] -> Parser OBJ
flds env ps = mconcat (map (typeEncoder_ env) ps)
| 99
|
flds env ps = mconcat (map (typeEncoder_ env) ps)
| 49
| false
| true
| 0
| 9
| 16
| 52
| 24
| 28
| null | null |
TorosFanny/kaleidoscope
|
preprocessor.hs
|
mit
|
doSlice :: Block -> IO Block
doSlice cb@(CodeBlock (id, classes, namevals) contents) = do
res <- return $ do
upper <- readMaybe =<< lookup "upper" namevals
lower <- readMaybe =<< lookup "lower" namevals
file <- lookup "slice" namevals
return (upper, lower, file)
case res of
Nothing -> return cb
Just (upper, lower, f) -> do
contents <- readFile f
let lns = unlines $ slice lower upper (lines contents)
return (CodeBlock (id, classes, namevals) lns)
| 497
|
doSlice :: Block -> IO Block
doSlice cb@(CodeBlock (id, classes, namevals) contents) = do
res <- return $ do
upper <- readMaybe =<< lookup "upper" namevals
lower <- readMaybe =<< lookup "lower" namevals
file <- lookup "slice" namevals
return (upper, lower, file)
case res of
Nothing -> return cb
Just (upper, lower, f) -> do
contents <- readFile f
let lns = unlines $ slice lower upper (lines contents)
return (CodeBlock (id, classes, namevals) lns)
| 497
|
doSlice cb@(CodeBlock (id, classes, namevals) contents) = do
res <- return $ do
upper <- readMaybe =<< lookup "upper" namevals
lower <- readMaybe =<< lookup "lower" namevals
file <- lookup "slice" namevals
return (upper, lower, file)
case res of
Nothing -> return cb
Just (upper, lower, f) -> do
contents <- readFile f
let lns = unlines $ slice lower upper (lines contents)
return (CodeBlock (id, classes, namevals) lns)
| 468
| false
| true
| 0
| 18
| 122
| 204
| 99
| 105
| null | null |
kurnevsky/missile
|
src/Game.hs
|
agpl-3.0
|
playFieldMoves :: [Field] -> [(Pos, Player)] -> [Field]
playFieldMoves = foldl $ \fields (pos, player) -> putPoint pos player (head fields) : fields
| 148
|
playFieldMoves :: [Field] -> [(Pos, Player)] -> [Field]
playFieldMoves = foldl $ \fields (pos, player) -> putPoint pos player (head fields) : fields
| 148
|
playFieldMoves = foldl $ \fields (pos, player) -> putPoint pos player (head fields) : fields
| 92
| false
| true
| 0
| 10
| 22
| 68
| 38
| 30
| null | null |
penguinland/nlp
|
RuleGenerators.hs
|
gpl-3.0
|
-- The Rules for the new Node are the rules for the last Node merged.
makeRule2AdoptingRules :: (Grammar -> Bool) -> (Grammar -> Bool) ->
(Grammar -> Grammar -> Bool) ->
(Grammar -> Grammar -> Grammar) -> Rule
makeRule2AdoptingRules =
makeRule2ArbitraryRules (\_ (Node _ rules _) -> rules)
| 319
|
makeRule2AdoptingRules :: (Grammar -> Bool) -> (Grammar -> Bool) ->
(Grammar -> Grammar -> Bool) ->
(Grammar -> Grammar -> Grammar) -> Rule
makeRule2AdoptingRules =
makeRule2ArbitraryRules (\_ (Node _ rules _) -> rules)
| 249
|
makeRule2AdoptingRules =
makeRule2ArbitraryRules (\_ (Node _ rules _) -> rules)
| 83
| true
| true
| 0
| 11
| 77
| 87
| 47
| 40
| null | null |
beni55/text
|
Data/Text/Lazy.hs
|
bsd-2-clause
|
-- | /O(n)/, where @n@ is the length of the result. The 'unfoldr'
-- function is analogous to the List 'L.unfoldr'. 'unfoldr' builds a
-- 'Text' from a seed value. The function takes the element and
-- returns 'Nothing' if it is done producing the 'Text', otherwise
-- 'Just' @(a,b)@. In this case, @a@ is the next 'Char' in the
-- string, and @b@ is the seed value for further production. Performs
-- replacement on invalid scalar values.
unfoldr :: (a -> Maybe (Char,a)) -> a -> Text
unfoldr f s = unstream (S.unfoldr (firstf safe . f) s)
| 542
|
unfoldr :: (a -> Maybe (Char,a)) -> a -> Text
unfoldr f s = unstream (S.unfoldr (firstf safe . f) s)
| 100
|
unfoldr f s = unstream (S.unfoldr (firstf safe . f) s)
| 54
| true
| true
| 0
| 10
| 100
| 70
| 39
| 31
| null | null |
lindenbaum/mediabus
|
specs/Data/MediaBus/Conduit/ReorderSpec.hs
|
bsd-3-clause
|
isMonoIncreasingAndHigherThanStartSeqNumN sn (MkStream (Next (MkFrame () snFrame ())) : rest)
| snFrame >= sn = isMonoIncreasingAndHigherThanStartSeqNumN snFrame rest
| otherwise = False
| 190
|
isMonoIncreasingAndHigherThanStartSeqNumN sn (MkStream (Next (MkFrame () snFrame ())) : rest)
| snFrame >= sn = isMonoIncreasingAndHigherThanStartSeqNumN snFrame rest
| otherwise = False
| 190
|
isMonoIncreasingAndHigherThanStartSeqNumN sn (MkStream (Next (MkFrame () snFrame ())) : rest)
| snFrame >= sn = isMonoIncreasingAndHigherThanStartSeqNumN snFrame rest
| otherwise = False
| 190
| false
| false
| 1
| 13
| 25
| 64
| 30
| 34
| null | null |
ice1000/OI-codes
|
codewars/1-100/is-number-prime.hs
|
agpl-3.0
|
isPrime (-1) = False
| 20
|
isPrime (-1) = False
| 20
|
isPrime (-1) = False
| 20
| false
| false
| 0
| 7
| 3
| 14
| 7
| 7
| null | null |
carliros/dbjava
|
src/Jvm/PrettyClass.hs
|
bsd-3-clause
|
instruction2pp (inst:xs) counter =
case inst of
0 -> (pp counter >#< text "nop"):instruction2pp xs (counter + 1)
1 -> (pp counter >#< text "aconst_null"):instruction2pp xs (counter + 1)
2 -> (pp counter >#< text "iconst_m1"):instruction2pp xs (counter + 1)
3 -> (pp counter >#< text "iconst_0"):instruction2pp xs (counter + 1)
4 -> (pp counter >#< text "iconst_1"):instruction2pp xs (counter + 1)
5 -> (pp counter >#< text "iconst_2"):instruction2pp xs (counter + 1)
6 -> (pp counter >#< text "iconst_3"):instruction2pp xs (counter + 1)
7 -> (pp counter >#< text "iconst_4"):instruction2pp xs (counter + 1)
8 -> (pp counter >#< text "iconst_5"):instruction2pp xs (counter + 1)
9 -> (pp counter >#< text "lconst_0"):instruction2pp xs (counter + 1)
10 -> (pp counter >#< text "lconst_1"):instruction2pp xs (counter + 1)
11 -> (pp counter >#< text "fconst_0"):instruction2pp xs (counter + 1)
12 -> (pp counter >#< text "fconst_1"):instruction2pp xs (counter + 1)
13 -> (pp counter >#< text "fconst_2"):instruction2pp xs (counter + 1)
14 -> (pp counter >#< text "dconst_0"):instruction2pp xs (counter + 1)
15 -> (pp counter >#< text "dconst_1"):instruction2pp xs (counter + 1)
16 -> (pp counter >#< text "bipush" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
17 -> (pp counter >#< text "sipush" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
18 -> (pp counter >#< text "ldc" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
19 -> (pp counter >#< text "ldc_w" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
20 -> (pp counter >#< text "ldc2_w" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
21 -> (pp counter >#< text "iload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
22 -> (pp counter >#< text "lload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
23 -> (pp counter >#< text "fload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
24 -> (pp counter >#< text "dload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
25 -> (pp counter >#< text "aload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
26 -> (pp counter >#< text "iload_0"):instruction2pp xs (counter + 1)
27 -> (pp counter >#< text "iload_1"):instruction2pp xs (counter + 1)
28 -> (pp counter >#< text "iload_2"):instruction2pp xs (counter + 1)
29 -> (pp counter >#< text "iload_3"):instruction2pp xs (counter + 1)
30 -> (pp counter >#< text "lload_0"):instruction2pp xs (counter + 1)
31 -> (pp counter >#< text "lload_1"):instruction2pp xs (counter + 1)
32 -> (pp counter >#< text "lload_2"):instruction2pp xs (counter + 1)
33 -> (pp counter >#< text "lload_3"):instruction2pp xs (counter + 1)
34 -> (pp counter >#< text "fload_0"):instruction2pp xs (counter + 1)
35 -> (pp counter >#< text "fload_1"):instruction2pp xs (counter + 1)
36 -> (pp counter >#< text "fload_2"):instruction2pp xs (counter + 1)
37 -> (pp counter >#< text "fload_3"):instruction2pp xs (counter + 1)
38 -> (pp counter >#< text "dload_0"):instruction2pp xs (counter + 1)
39 -> (pp counter >#< text "dload_1"):instruction2pp xs (counter + 1)
40 -> (pp counter >#< text "dload_2"):instruction2pp xs (counter + 1)
41 -> (pp counter >#< text "dload_3"):instruction2pp xs (counter + 1)
42 -> (pp counter >#< text "aload_0"):instruction2pp xs (counter + 1)
43 -> (pp counter >#< text "aload_1"):instruction2pp xs (counter + 1)
44 -> (pp counter >#< text "aload_2"):instruction2pp xs (counter + 1)
45 -> (pp counter >#< text "aload_3"):instruction2pp xs (counter + 1)
46 -> (pp counter >#< text "iaload"):instruction2pp xs (counter + 1)
47 -> (pp counter >#< text "laload"):instruction2pp xs (counter + 1)
48 -> (pp counter >#< text "faload"):instruction2pp xs (counter + 1)
49 -> (pp counter >#< text "daload"):instruction2pp xs (counter + 1)
50 -> (pp counter >#< text "aaload"):instruction2pp xs (counter + 1)
51 -> (pp counter >#< text "baload"):instruction2pp xs (counter + 1)
52 -> (pp counter >#< text "caload"):instruction2pp xs (counter + 1)
53 -> (pp counter >#< text "saload"):instruction2pp xs (counter + 1)
54 -> (pp counter >#< text "istore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
55 -> (pp counter >#< text "lstore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
56 -> (pp counter >#< text "fstore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
57 -> (pp counter >#< text "dstore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
58 -> (pp counter >#< text "astore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
59 -> (pp counter >#< text "istore_0"):instruction2pp xs (counter + 1)
60 -> (pp counter >#< text "istore_1"):instruction2pp xs (counter + 1)
61 -> (pp counter >#< text "istore_2"):instruction2pp xs (counter + 1)
62 -> (pp counter >#< text "istore_3"):instruction2pp xs (counter + 1)
63 -> (pp counter >#< text "lstore_0"):instruction2pp xs (counter + 1)
64 -> (pp counter >#< text "lstore_1"):instruction2pp xs (counter + 1)
65 -> (pp counter >#< text "lstore_2"):instruction2pp xs (counter + 1)
66 -> (pp counter >#< text "lstore_3"):instruction2pp xs (counter + 1)
67 -> (pp counter >#< text "fstore_0"):instruction2pp xs (counter + 1)
68 -> (pp counter >#< text "fstore_1"):instruction2pp xs (counter + 1)
69 -> (pp counter >#< text "fstore_2"):instruction2pp xs (counter + 1)
70 -> (pp counter >#< text "fstore_3"):instruction2pp xs (counter + 1)
71 -> (pp counter >#< text "dstore_0"):instruction2pp xs (counter + 1)
72 -> (pp counter >#< text "dstore_1"):instruction2pp xs (counter + 1)
73 -> (pp counter >#< text "dstore_2"):instruction2pp xs (counter + 1)
74 -> (pp counter >#< text "dstore_3"):instruction2pp xs (counter + 1)
75 -> (pp counter >#< text "astore_0"):instruction2pp xs (counter + 1)
76 -> (pp counter >#< text "astore_1"):instruction2pp xs (counter + 1)
77 -> (pp counter >#< text "astore_2"):instruction2pp xs (counter + 1)
78 -> (pp counter >#< text "astore_3"):instruction2pp xs (counter + 1)
79 -> (pp counter >#< text "iastore"):instruction2pp xs (counter + 1)
80 -> (pp counter >#< text "lastore"):instruction2pp xs (counter + 1)
81 -> (pp counter >#< text "fastore"):instruction2pp xs (counter + 1)
82 -> (pp counter >#< text "dastore"):instruction2pp xs (counter + 1)
83 -> (pp counter >#< text "aastore"):instruction2pp xs (counter + 1)
84 -> (pp counter >#< text "bastore"):instruction2pp xs (counter + 1)
85 -> (pp counter >#< text "castore"):instruction2pp xs (counter + 1)
86 -> (pp counter >#< text "sastore"):instruction2pp xs (counter + 1)
87 -> (pp counter >#< text "pop"):instruction2pp xs (counter + 1)
88 -> (pp counter >#< text "pop2"):instruction2pp xs (counter + 1)
89 -> (pp counter >#< text "dup"):instruction2pp xs (counter + 1)
90 -> (pp counter >#< text "dup_x1"):instruction2pp xs (counter + 1)
91 -> (pp counter >#< text "dup_x2"):instruction2pp xs (counter + 1)
92 -> (pp counter >#< text "dup2"):instruction2pp xs (counter + 1)
93 -> (pp counter >#< text "dup2_x1"):instruction2pp xs (counter + 1)
94 -> (pp counter >#< text "dup2_x2"):instruction2pp xs (counter + 1)
95 -> (pp counter >#< text "swap"):instruction2pp xs (counter + 1)
96 -> (pp counter >#< text "iadd"):instruction2pp xs (counter + 1)
97 -> (pp counter >#< text "ladd"):instruction2pp xs (counter + 1)
98 -> (pp counter >#< text "fadd"):instruction2pp xs (counter + 1)
99 -> (pp counter >#< text "dadd"):instruction2pp xs (counter + 1)
100 -> (pp counter >#< text "isub"):instruction2pp xs (counter + 1)
101 -> (pp counter >#< text "lsub"):instruction2pp xs (counter + 1)
102 -> (pp counter >#< text "fsub"):instruction2pp xs (counter + 1)
103 -> (pp counter >#< text "dsub"):instruction2pp xs (counter + 1)
104 -> (pp counter >#< text "imul"):instruction2pp xs (counter + 1)
105 -> (pp counter >#< text "lmul"):instruction2pp xs (counter + 1)
106 -> (pp counter >#< text "fmul"):instruction2pp xs (counter + 1)
107 -> (pp counter >#< text "dmul"):instruction2pp xs (counter + 1)
108 -> (pp counter >#< text "idiv"):instruction2pp xs (counter + 1)
109 -> (pp counter >#< text "ldiv"):instruction2pp xs (counter + 1)
110 -> (pp counter >#< text "fdiv"):instruction2pp xs (counter + 1)
111 -> (pp counter >#< text "ddiv"):instruction2pp xs (counter + 1)
112 -> (pp counter >#< text "irem"):instruction2pp xs (counter + 1)
113 -> (pp counter >#< text "lrem"):instruction2pp xs (counter + 1)
114 -> (pp counter >#< text "frem"):instruction2pp xs (counter + 1)
115 -> (pp counter >#< text "drem"):instruction2pp xs (counter + 1)
116 -> (pp counter >#< text "ineg"):instruction2pp xs (counter + 1)
117 -> (pp counter >#< text "lneg"):instruction2pp xs (counter + 1)
118 -> (pp counter >#< text "fneg"):instruction2pp xs (counter + 1)
119 -> (pp counter >#< text "dneg"):instruction2pp xs (counter + 1)
120 -> (pp counter >#< text "ishl"):instruction2pp xs (counter + 1)
121 -> (pp counter >#< text "lshl"):instruction2pp xs (counter + 1)
122 -> (pp counter >#< text "ishr"):instruction2pp xs (counter + 1)
123 -> (pp counter >#< text "lshr"):instruction2pp xs (counter + 1)
124 -> (pp counter >#< text "iushr"):instruction2pp xs (counter + 1)
125 -> (pp counter >#< text "lushr"):instruction2pp xs (counter + 1)
126 -> (pp counter >#< text "iand"):instruction2pp xs (counter + 1)
127 -> (pp counter >#< text "land"):instruction2pp xs (counter + 1)
128 -> (pp counter >#< text "ior"):instruction2pp xs (counter + 1)
129 -> (pp counter >#< text "lor"):instruction2pp xs (counter + 1)
130 -> (pp counter >#< text "ixor"):instruction2pp xs (counter + 1)
131 -> (pp counter >#< text "lxor"):instruction2pp xs (counter + 1)
132 -> (pp counter >#< text "iinc" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
133 -> (pp counter >#< text "i2l"):instruction2pp xs (counter + 1)
134 -> (pp counter >#< text "i2f"):instruction2pp xs (counter + 1)
135 -> (pp counter >#< text "i2d"):instruction2pp xs (counter + 1)
136 -> (pp counter >#< text "l2i"):instruction2pp xs (counter + 1)
137 -> (pp counter >#< text "l2f"):instruction2pp xs (counter + 1)
138 -> (pp counter >#< text "l2d"):instruction2pp xs (counter + 1)
139 -> (pp counter >#< text "f2i"):instruction2pp xs (counter + 1)
140 -> (pp counter >#< text "f2l"):instruction2pp xs (counter + 1)
141 -> (pp counter >#< text "f2d"):instruction2pp xs (counter + 1)
142 -> (pp counter >#< text "d2i"):instruction2pp xs (counter + 1)
143 -> (pp counter >#< text "d2l"):instruction2pp xs (counter + 1)
144 -> (pp counter >#< text "d2f"):instruction2pp xs (counter + 1)
145 -> (pp counter >#< text "i2b"):instruction2pp xs (counter + 1)
146 -> (pp counter >#< text "i2c"):instruction2pp xs (counter + 1)
147 -> (pp counter >#< text "i2s"):instruction2pp xs (counter + 1)
148 -> (pp counter >#< text "lcmp"):instruction2pp xs (counter + 1)
149 -> (pp counter >#< text "fcmpl"):instruction2pp xs (counter + 1)
150 -> (pp counter >#< text "fcmpg"):instruction2pp xs (counter + 1)
151 -> (pp counter >#< text "dcmpl"):instruction2pp xs (counter + 1)
152 -> (pp counter >#< text "dcmpg"):instruction2pp xs (counter + 1)
153 -> (pp counter >#< text "ifeq" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
154 -> (pp counter >#< text "ifne" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
155 -> (pp counter >#< text "iflt" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
156 -> (pp counter >#< text "ifge" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
157 -> (pp counter >#< text "ifgt" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
158 -> (pp counter >#< text "ifle" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
159 -> (pp counter >#< text "if_icmpeq" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
160 -> (pp counter >#< text "if_icmpne" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
161 -> (pp counter >#< text "if_icmplt" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
162 -> (pp counter >#< text "if_icmpge" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
163 -> (pp counter >#< text "if_icmpgt" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
164 -> (pp counter >#< text "if_icmple" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
165 -> (pp counter >#< text "if_acmpeq" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
166 -> (pp counter >#< text "if_acmpne" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
167 -> (pp counter >#< text "goto" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
168 -> (pp counter >#< text "jsr" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
169 -> (pp counter >#< text "ret" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
170 -> let npad = (counter + 1) `mod` 4
(bpad, rs1) = splitAt npad xs
(defpos,rs2) = (fromBytes2Int $ take 4 rs1, drop 4 rs1)
(low, rs3) = (fromBytes2Int $ take 4 rs1, drop 4 rs2)
(hight, rs4) = (fromBytes2Int $ take 4 rs1, drop 4 rs3)
(lstbr, rs5) = let n = 4*(hight-low+1) in (toInts (take n rs4), drop n rs4)
in (pp counter >#< text "tableswitch" >#< text "[ hight :" >#< pp hight >#< text "low :" >#< pp low >#< text " ]" >-<
vlist ((map (\br -> text "->" >#< pp br) lstbr) ++ [text "-> default :" >#< pp defpos])) : instruction2pp rs5 (counter + npad + 12 + (hight-low+1)*4)
171 -> let npad = (counter+1) `mod` 4
(bpad, rs1) = splitAt npad xs
(defpos,rs2) = (fromBytes2Int $ take 4 rs1, drop 4 rs1)
(npairs,rs3) = (fromBytes2Int $ take 4 rs2, drop 4 rs2)
(lstpairs, rs4) = (fromBytes2Tupla $ take (npairs*2*4) rs3, drop (npairs*2*4) rs3)
in (pp counter >#< text "lookupswitch" >#< text "[ pad :" >#< pp npad >#< text ", ntable :" >#< pp npairs >#< text " ]" >-<
vlist ((map (\(n1,n2) -> pp n1 >#< text "->" >#< pp n2) lstpairs) ++ [text "default ->" >#< pp defpos])) : instruction2pp rs4 (counter + npad + 8 + npairs*2*4)
172 -> (pp counter >#< text "ireturn"):instruction2pp xs (counter + 1)
173 -> (pp counter >#< text "lreturn"):instruction2pp xs (counter + 1)
174 -> (pp counter >#< text "freturn"):instruction2pp xs (counter + 1)
175 -> (pp counter >#< text "dreturn"):instruction2pp xs (counter + 1)
176 -> (pp counter >#< text "areturn"):instruction2pp xs (counter + 1)
177 -> (pp counter >#< text "return"):instruction2pp xs (counter + 1)
178 -> (pp counter >#< text "getstatic" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
179 -> (pp counter >#< text "putstatic" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
180 -> (pp counter >#< text "getfield" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
181 -> (pp counter >#< text "putfield" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
182 -> (pp counter >#< text "invokevirtual" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
183 -> (pp counter >#< text "invokespecial" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
184 -> (pp counter >#< text "invokestatic" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
185 -> (pp counter >#< text "invokeinterface" >#< let [b1,b2,b3,b4] = take 4 xs in pp b1 >#< pp b2 >#< pp b3 >#< pp b4):instruction2pp (drop 4 xs) (counter + 5)
--186 (0xba) xxxunusedxxx1
187 -> (pp counter >#< text "new" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
188 -> (pp counter >#< text "newarray" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
189 -> (pp counter >#< text "anewarray" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
190 -> (pp counter >#< text "arraylength"):instruction2pp xs (counter + 1)
191 -> (pp counter >#< text "athrow"):instruction2pp xs (counter + 1)
192 -> (pp counter >#< text "checkcast" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
193 -> (pp counter >#< text "instanceof" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
194 -> (pp counter >#< text "monitorenter"):instruction2pp xs (counter + 1)
195 -> (pp counter >#< text "monitorexit"):instruction2pp xs (counter + 1)
196 -> let (vinstr, rs1) = (head xs, tail xs)
(vindex, rs2) = (fromBytes2Int (take 2 rs1), drop 2 rs1)
in if (vinstr == 132) -- 132 == iinc
then let (vconst, rs3) = (fromBytes2Int (take 2 rs2), drop 2 rs2)
in (pp counter >#< text "wide" >#< toPP vinstr >#< text "index :" >#< pp vindex >#< text "const :" >#< pp vconst) : instruction2pp rs3 (counter + 6)
else (pp counter >#< text "wide" >#< toPP vinstr >#< text "index :" >#< pp vindex) : instruction2pp rs2 (counter + 4)
197 -> (pp counter >#< text "multianewarray" >#< let [b1,b2,b3] = take 3 xs in pp b1 >#< pp b2 >#< pp b3):instruction2pp (drop 3 xs) (counter + 4)
198 -> (pp counter >#< text "ifnull" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
199 -> (pp counter >#< text "ifnonnull" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
200 -> (pp counter >#< text "goto_w" >#< let n = fromBytes2Int (take 4 xs) in pp (getSignedInt (n+counter) 33)):instruction2pp (drop 4 xs) (counter + 5)
201 -> (pp counter >#< text "jsr_w" >#< let n = fromBytes2Int (take 4 xs) in pp (getSignedInt (n+counter) 33)):instruction2pp (drop 4 xs) (counter + 5)
--Reserved ocounterodes:
--202 (0xca) breakpoint
--254 (0xfe) impdep1
--255 (0xff) impdep2
-- Auxiliar functions
| 20,798
|
instruction2pp (inst:xs) counter =
case inst of
0 -> (pp counter >#< text "nop"):instruction2pp xs (counter + 1)
1 -> (pp counter >#< text "aconst_null"):instruction2pp xs (counter + 1)
2 -> (pp counter >#< text "iconst_m1"):instruction2pp xs (counter + 1)
3 -> (pp counter >#< text "iconst_0"):instruction2pp xs (counter + 1)
4 -> (pp counter >#< text "iconst_1"):instruction2pp xs (counter + 1)
5 -> (pp counter >#< text "iconst_2"):instruction2pp xs (counter + 1)
6 -> (pp counter >#< text "iconst_3"):instruction2pp xs (counter + 1)
7 -> (pp counter >#< text "iconst_4"):instruction2pp xs (counter + 1)
8 -> (pp counter >#< text "iconst_5"):instruction2pp xs (counter + 1)
9 -> (pp counter >#< text "lconst_0"):instruction2pp xs (counter + 1)
10 -> (pp counter >#< text "lconst_1"):instruction2pp xs (counter + 1)
11 -> (pp counter >#< text "fconst_0"):instruction2pp xs (counter + 1)
12 -> (pp counter >#< text "fconst_1"):instruction2pp xs (counter + 1)
13 -> (pp counter >#< text "fconst_2"):instruction2pp xs (counter + 1)
14 -> (pp counter >#< text "dconst_0"):instruction2pp xs (counter + 1)
15 -> (pp counter >#< text "dconst_1"):instruction2pp xs (counter + 1)
16 -> (pp counter >#< text "bipush" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
17 -> (pp counter >#< text "sipush" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
18 -> (pp counter >#< text "ldc" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
19 -> (pp counter >#< text "ldc_w" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
20 -> (pp counter >#< text "ldc2_w" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
21 -> (pp counter >#< text "iload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
22 -> (pp counter >#< text "lload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
23 -> (pp counter >#< text "fload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
24 -> (pp counter >#< text "dload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
25 -> (pp counter >#< text "aload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
26 -> (pp counter >#< text "iload_0"):instruction2pp xs (counter + 1)
27 -> (pp counter >#< text "iload_1"):instruction2pp xs (counter + 1)
28 -> (pp counter >#< text "iload_2"):instruction2pp xs (counter + 1)
29 -> (pp counter >#< text "iload_3"):instruction2pp xs (counter + 1)
30 -> (pp counter >#< text "lload_0"):instruction2pp xs (counter + 1)
31 -> (pp counter >#< text "lload_1"):instruction2pp xs (counter + 1)
32 -> (pp counter >#< text "lload_2"):instruction2pp xs (counter + 1)
33 -> (pp counter >#< text "lload_3"):instruction2pp xs (counter + 1)
34 -> (pp counter >#< text "fload_0"):instruction2pp xs (counter + 1)
35 -> (pp counter >#< text "fload_1"):instruction2pp xs (counter + 1)
36 -> (pp counter >#< text "fload_2"):instruction2pp xs (counter + 1)
37 -> (pp counter >#< text "fload_3"):instruction2pp xs (counter + 1)
38 -> (pp counter >#< text "dload_0"):instruction2pp xs (counter + 1)
39 -> (pp counter >#< text "dload_1"):instruction2pp xs (counter + 1)
40 -> (pp counter >#< text "dload_2"):instruction2pp xs (counter + 1)
41 -> (pp counter >#< text "dload_3"):instruction2pp xs (counter + 1)
42 -> (pp counter >#< text "aload_0"):instruction2pp xs (counter + 1)
43 -> (pp counter >#< text "aload_1"):instruction2pp xs (counter + 1)
44 -> (pp counter >#< text "aload_2"):instruction2pp xs (counter + 1)
45 -> (pp counter >#< text "aload_3"):instruction2pp xs (counter + 1)
46 -> (pp counter >#< text "iaload"):instruction2pp xs (counter + 1)
47 -> (pp counter >#< text "laload"):instruction2pp xs (counter + 1)
48 -> (pp counter >#< text "faload"):instruction2pp xs (counter + 1)
49 -> (pp counter >#< text "daload"):instruction2pp xs (counter + 1)
50 -> (pp counter >#< text "aaload"):instruction2pp xs (counter + 1)
51 -> (pp counter >#< text "baload"):instruction2pp xs (counter + 1)
52 -> (pp counter >#< text "caload"):instruction2pp xs (counter + 1)
53 -> (pp counter >#< text "saload"):instruction2pp xs (counter + 1)
54 -> (pp counter >#< text "istore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
55 -> (pp counter >#< text "lstore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
56 -> (pp counter >#< text "fstore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
57 -> (pp counter >#< text "dstore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
58 -> (pp counter >#< text "astore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
59 -> (pp counter >#< text "istore_0"):instruction2pp xs (counter + 1)
60 -> (pp counter >#< text "istore_1"):instruction2pp xs (counter + 1)
61 -> (pp counter >#< text "istore_2"):instruction2pp xs (counter + 1)
62 -> (pp counter >#< text "istore_3"):instruction2pp xs (counter + 1)
63 -> (pp counter >#< text "lstore_0"):instruction2pp xs (counter + 1)
64 -> (pp counter >#< text "lstore_1"):instruction2pp xs (counter + 1)
65 -> (pp counter >#< text "lstore_2"):instruction2pp xs (counter + 1)
66 -> (pp counter >#< text "lstore_3"):instruction2pp xs (counter + 1)
67 -> (pp counter >#< text "fstore_0"):instruction2pp xs (counter + 1)
68 -> (pp counter >#< text "fstore_1"):instruction2pp xs (counter + 1)
69 -> (pp counter >#< text "fstore_2"):instruction2pp xs (counter + 1)
70 -> (pp counter >#< text "fstore_3"):instruction2pp xs (counter + 1)
71 -> (pp counter >#< text "dstore_0"):instruction2pp xs (counter + 1)
72 -> (pp counter >#< text "dstore_1"):instruction2pp xs (counter + 1)
73 -> (pp counter >#< text "dstore_2"):instruction2pp xs (counter + 1)
74 -> (pp counter >#< text "dstore_3"):instruction2pp xs (counter + 1)
75 -> (pp counter >#< text "astore_0"):instruction2pp xs (counter + 1)
76 -> (pp counter >#< text "astore_1"):instruction2pp xs (counter + 1)
77 -> (pp counter >#< text "astore_2"):instruction2pp xs (counter + 1)
78 -> (pp counter >#< text "astore_3"):instruction2pp xs (counter + 1)
79 -> (pp counter >#< text "iastore"):instruction2pp xs (counter + 1)
80 -> (pp counter >#< text "lastore"):instruction2pp xs (counter + 1)
81 -> (pp counter >#< text "fastore"):instruction2pp xs (counter + 1)
82 -> (pp counter >#< text "dastore"):instruction2pp xs (counter + 1)
83 -> (pp counter >#< text "aastore"):instruction2pp xs (counter + 1)
84 -> (pp counter >#< text "bastore"):instruction2pp xs (counter + 1)
85 -> (pp counter >#< text "castore"):instruction2pp xs (counter + 1)
86 -> (pp counter >#< text "sastore"):instruction2pp xs (counter + 1)
87 -> (pp counter >#< text "pop"):instruction2pp xs (counter + 1)
88 -> (pp counter >#< text "pop2"):instruction2pp xs (counter + 1)
89 -> (pp counter >#< text "dup"):instruction2pp xs (counter + 1)
90 -> (pp counter >#< text "dup_x1"):instruction2pp xs (counter + 1)
91 -> (pp counter >#< text "dup_x2"):instruction2pp xs (counter + 1)
92 -> (pp counter >#< text "dup2"):instruction2pp xs (counter + 1)
93 -> (pp counter >#< text "dup2_x1"):instruction2pp xs (counter + 1)
94 -> (pp counter >#< text "dup2_x2"):instruction2pp xs (counter + 1)
95 -> (pp counter >#< text "swap"):instruction2pp xs (counter + 1)
96 -> (pp counter >#< text "iadd"):instruction2pp xs (counter + 1)
97 -> (pp counter >#< text "ladd"):instruction2pp xs (counter + 1)
98 -> (pp counter >#< text "fadd"):instruction2pp xs (counter + 1)
99 -> (pp counter >#< text "dadd"):instruction2pp xs (counter + 1)
100 -> (pp counter >#< text "isub"):instruction2pp xs (counter + 1)
101 -> (pp counter >#< text "lsub"):instruction2pp xs (counter + 1)
102 -> (pp counter >#< text "fsub"):instruction2pp xs (counter + 1)
103 -> (pp counter >#< text "dsub"):instruction2pp xs (counter + 1)
104 -> (pp counter >#< text "imul"):instruction2pp xs (counter + 1)
105 -> (pp counter >#< text "lmul"):instruction2pp xs (counter + 1)
106 -> (pp counter >#< text "fmul"):instruction2pp xs (counter + 1)
107 -> (pp counter >#< text "dmul"):instruction2pp xs (counter + 1)
108 -> (pp counter >#< text "idiv"):instruction2pp xs (counter + 1)
109 -> (pp counter >#< text "ldiv"):instruction2pp xs (counter + 1)
110 -> (pp counter >#< text "fdiv"):instruction2pp xs (counter + 1)
111 -> (pp counter >#< text "ddiv"):instruction2pp xs (counter + 1)
112 -> (pp counter >#< text "irem"):instruction2pp xs (counter + 1)
113 -> (pp counter >#< text "lrem"):instruction2pp xs (counter + 1)
114 -> (pp counter >#< text "frem"):instruction2pp xs (counter + 1)
115 -> (pp counter >#< text "drem"):instruction2pp xs (counter + 1)
116 -> (pp counter >#< text "ineg"):instruction2pp xs (counter + 1)
117 -> (pp counter >#< text "lneg"):instruction2pp xs (counter + 1)
118 -> (pp counter >#< text "fneg"):instruction2pp xs (counter + 1)
119 -> (pp counter >#< text "dneg"):instruction2pp xs (counter + 1)
120 -> (pp counter >#< text "ishl"):instruction2pp xs (counter + 1)
121 -> (pp counter >#< text "lshl"):instruction2pp xs (counter + 1)
122 -> (pp counter >#< text "ishr"):instruction2pp xs (counter + 1)
123 -> (pp counter >#< text "lshr"):instruction2pp xs (counter + 1)
124 -> (pp counter >#< text "iushr"):instruction2pp xs (counter + 1)
125 -> (pp counter >#< text "lushr"):instruction2pp xs (counter + 1)
126 -> (pp counter >#< text "iand"):instruction2pp xs (counter + 1)
127 -> (pp counter >#< text "land"):instruction2pp xs (counter + 1)
128 -> (pp counter >#< text "ior"):instruction2pp xs (counter + 1)
129 -> (pp counter >#< text "lor"):instruction2pp xs (counter + 1)
130 -> (pp counter >#< text "ixor"):instruction2pp xs (counter + 1)
131 -> (pp counter >#< text "lxor"):instruction2pp xs (counter + 1)
132 -> (pp counter >#< text "iinc" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
133 -> (pp counter >#< text "i2l"):instruction2pp xs (counter + 1)
134 -> (pp counter >#< text "i2f"):instruction2pp xs (counter + 1)
135 -> (pp counter >#< text "i2d"):instruction2pp xs (counter + 1)
136 -> (pp counter >#< text "l2i"):instruction2pp xs (counter + 1)
137 -> (pp counter >#< text "l2f"):instruction2pp xs (counter + 1)
138 -> (pp counter >#< text "l2d"):instruction2pp xs (counter + 1)
139 -> (pp counter >#< text "f2i"):instruction2pp xs (counter + 1)
140 -> (pp counter >#< text "f2l"):instruction2pp xs (counter + 1)
141 -> (pp counter >#< text "f2d"):instruction2pp xs (counter + 1)
142 -> (pp counter >#< text "d2i"):instruction2pp xs (counter + 1)
143 -> (pp counter >#< text "d2l"):instruction2pp xs (counter + 1)
144 -> (pp counter >#< text "d2f"):instruction2pp xs (counter + 1)
145 -> (pp counter >#< text "i2b"):instruction2pp xs (counter + 1)
146 -> (pp counter >#< text "i2c"):instruction2pp xs (counter + 1)
147 -> (pp counter >#< text "i2s"):instruction2pp xs (counter + 1)
148 -> (pp counter >#< text "lcmp"):instruction2pp xs (counter + 1)
149 -> (pp counter >#< text "fcmpl"):instruction2pp xs (counter + 1)
150 -> (pp counter >#< text "fcmpg"):instruction2pp xs (counter + 1)
151 -> (pp counter >#< text "dcmpl"):instruction2pp xs (counter + 1)
152 -> (pp counter >#< text "dcmpg"):instruction2pp xs (counter + 1)
153 -> (pp counter >#< text "ifeq" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
154 -> (pp counter >#< text "ifne" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
155 -> (pp counter >#< text "iflt" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
156 -> (pp counter >#< text "ifge" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
157 -> (pp counter >#< text "ifgt" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
158 -> (pp counter >#< text "ifle" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
159 -> (pp counter >#< text "if_icmpeq" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
160 -> (pp counter >#< text "if_icmpne" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
161 -> (pp counter >#< text "if_icmplt" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
162 -> (pp counter >#< text "if_icmpge" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
163 -> (pp counter >#< text "if_icmpgt" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
164 -> (pp counter >#< text "if_icmple" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
165 -> (pp counter >#< text "if_acmpeq" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
166 -> (pp counter >#< text "if_acmpne" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
167 -> (pp counter >#< text "goto" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
168 -> (pp counter >#< text "jsr" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
169 -> (pp counter >#< text "ret" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
170 -> let npad = (counter + 1) `mod` 4
(bpad, rs1) = splitAt npad xs
(defpos,rs2) = (fromBytes2Int $ take 4 rs1, drop 4 rs1)
(low, rs3) = (fromBytes2Int $ take 4 rs1, drop 4 rs2)
(hight, rs4) = (fromBytes2Int $ take 4 rs1, drop 4 rs3)
(lstbr, rs5) = let n = 4*(hight-low+1) in (toInts (take n rs4), drop n rs4)
in (pp counter >#< text "tableswitch" >#< text "[ hight :" >#< pp hight >#< text "low :" >#< pp low >#< text " ]" >-<
vlist ((map (\br -> text "->" >#< pp br) lstbr) ++ [text "-> default :" >#< pp defpos])) : instruction2pp rs5 (counter + npad + 12 + (hight-low+1)*4)
171 -> let npad = (counter+1) `mod` 4
(bpad, rs1) = splitAt npad xs
(defpos,rs2) = (fromBytes2Int $ take 4 rs1, drop 4 rs1)
(npairs,rs3) = (fromBytes2Int $ take 4 rs2, drop 4 rs2)
(lstpairs, rs4) = (fromBytes2Tupla $ take (npairs*2*4) rs3, drop (npairs*2*4) rs3)
in (pp counter >#< text "lookupswitch" >#< text "[ pad :" >#< pp npad >#< text ", ntable :" >#< pp npairs >#< text " ]" >-<
vlist ((map (\(n1,n2) -> pp n1 >#< text "->" >#< pp n2) lstpairs) ++ [text "default ->" >#< pp defpos])) : instruction2pp rs4 (counter + npad + 8 + npairs*2*4)
172 -> (pp counter >#< text "ireturn"):instruction2pp xs (counter + 1)
173 -> (pp counter >#< text "lreturn"):instruction2pp xs (counter + 1)
174 -> (pp counter >#< text "freturn"):instruction2pp xs (counter + 1)
175 -> (pp counter >#< text "dreturn"):instruction2pp xs (counter + 1)
176 -> (pp counter >#< text "areturn"):instruction2pp xs (counter + 1)
177 -> (pp counter >#< text "return"):instruction2pp xs (counter + 1)
178 -> (pp counter >#< text "getstatic" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
179 -> (pp counter >#< text "putstatic" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
180 -> (pp counter >#< text "getfield" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
181 -> (pp counter >#< text "putfield" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
182 -> (pp counter >#< text "invokevirtual" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
183 -> (pp counter >#< text "invokespecial" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
184 -> (pp counter >#< text "invokestatic" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
185 -> (pp counter >#< text "invokeinterface" >#< let [b1,b2,b3,b4] = take 4 xs in pp b1 >#< pp b2 >#< pp b3 >#< pp b4):instruction2pp (drop 4 xs) (counter + 5)
--186 (0xba) xxxunusedxxx1
187 -> (pp counter >#< text "new" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
188 -> (pp counter >#< text "newarray" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
189 -> (pp counter >#< text "anewarray" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
190 -> (pp counter >#< text "arraylength"):instruction2pp xs (counter + 1)
191 -> (pp counter >#< text "athrow"):instruction2pp xs (counter + 1)
192 -> (pp counter >#< text "checkcast" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
193 -> (pp counter >#< text "instanceof" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
194 -> (pp counter >#< text "monitorenter"):instruction2pp xs (counter + 1)
195 -> (pp counter >#< text "monitorexit"):instruction2pp xs (counter + 1)
196 -> let (vinstr, rs1) = (head xs, tail xs)
(vindex, rs2) = (fromBytes2Int (take 2 rs1), drop 2 rs1)
in if (vinstr == 132) -- 132 == iinc
then let (vconst, rs3) = (fromBytes2Int (take 2 rs2), drop 2 rs2)
in (pp counter >#< text "wide" >#< toPP vinstr >#< text "index :" >#< pp vindex >#< text "const :" >#< pp vconst) : instruction2pp rs3 (counter + 6)
else (pp counter >#< text "wide" >#< toPP vinstr >#< text "index :" >#< pp vindex) : instruction2pp rs2 (counter + 4)
197 -> (pp counter >#< text "multianewarray" >#< let [b1,b2,b3] = take 3 xs in pp b1 >#< pp b2 >#< pp b3):instruction2pp (drop 3 xs) (counter + 4)
198 -> (pp counter >#< text "ifnull" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
199 -> (pp counter >#< text "ifnonnull" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
200 -> (pp counter >#< text "goto_w" >#< let n = fromBytes2Int (take 4 xs) in pp (getSignedInt (n+counter) 33)):instruction2pp (drop 4 xs) (counter + 5)
201 -> (pp counter >#< text "jsr_w" >#< let n = fromBytes2Int (take 4 xs) in pp (getSignedInt (n+counter) 33)):instruction2pp (drop 4 xs) (counter + 5)
--Reserved ocounterodes:
--202 (0xca) breakpoint
--254 (0xfe) impdep1
--255 (0xff) impdep2
-- Auxiliar functions
| 20,798
|
instruction2pp (inst:xs) counter =
case inst of
0 -> (pp counter >#< text "nop"):instruction2pp xs (counter + 1)
1 -> (pp counter >#< text "aconst_null"):instruction2pp xs (counter + 1)
2 -> (pp counter >#< text "iconst_m1"):instruction2pp xs (counter + 1)
3 -> (pp counter >#< text "iconst_0"):instruction2pp xs (counter + 1)
4 -> (pp counter >#< text "iconst_1"):instruction2pp xs (counter + 1)
5 -> (pp counter >#< text "iconst_2"):instruction2pp xs (counter + 1)
6 -> (pp counter >#< text "iconst_3"):instruction2pp xs (counter + 1)
7 -> (pp counter >#< text "iconst_4"):instruction2pp xs (counter + 1)
8 -> (pp counter >#< text "iconst_5"):instruction2pp xs (counter + 1)
9 -> (pp counter >#< text "lconst_0"):instruction2pp xs (counter + 1)
10 -> (pp counter >#< text "lconst_1"):instruction2pp xs (counter + 1)
11 -> (pp counter >#< text "fconst_0"):instruction2pp xs (counter + 1)
12 -> (pp counter >#< text "fconst_1"):instruction2pp xs (counter + 1)
13 -> (pp counter >#< text "fconst_2"):instruction2pp xs (counter + 1)
14 -> (pp counter >#< text "dconst_0"):instruction2pp xs (counter + 1)
15 -> (pp counter >#< text "dconst_1"):instruction2pp xs (counter + 1)
16 -> (pp counter >#< text "bipush" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
17 -> (pp counter >#< text "sipush" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
18 -> (pp counter >#< text "ldc" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
19 -> (pp counter >#< text "ldc_w" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
20 -> (pp counter >#< text "ldc2_w" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
21 -> (pp counter >#< text "iload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
22 -> (pp counter >#< text "lload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
23 -> (pp counter >#< text "fload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
24 -> (pp counter >#< text "dload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
25 -> (pp counter >#< text "aload" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
26 -> (pp counter >#< text "iload_0"):instruction2pp xs (counter + 1)
27 -> (pp counter >#< text "iload_1"):instruction2pp xs (counter + 1)
28 -> (pp counter >#< text "iload_2"):instruction2pp xs (counter + 1)
29 -> (pp counter >#< text "iload_3"):instruction2pp xs (counter + 1)
30 -> (pp counter >#< text "lload_0"):instruction2pp xs (counter + 1)
31 -> (pp counter >#< text "lload_1"):instruction2pp xs (counter + 1)
32 -> (pp counter >#< text "lload_2"):instruction2pp xs (counter + 1)
33 -> (pp counter >#< text "lload_3"):instruction2pp xs (counter + 1)
34 -> (pp counter >#< text "fload_0"):instruction2pp xs (counter + 1)
35 -> (pp counter >#< text "fload_1"):instruction2pp xs (counter + 1)
36 -> (pp counter >#< text "fload_2"):instruction2pp xs (counter + 1)
37 -> (pp counter >#< text "fload_3"):instruction2pp xs (counter + 1)
38 -> (pp counter >#< text "dload_0"):instruction2pp xs (counter + 1)
39 -> (pp counter >#< text "dload_1"):instruction2pp xs (counter + 1)
40 -> (pp counter >#< text "dload_2"):instruction2pp xs (counter + 1)
41 -> (pp counter >#< text "dload_3"):instruction2pp xs (counter + 1)
42 -> (pp counter >#< text "aload_0"):instruction2pp xs (counter + 1)
43 -> (pp counter >#< text "aload_1"):instruction2pp xs (counter + 1)
44 -> (pp counter >#< text "aload_2"):instruction2pp xs (counter + 1)
45 -> (pp counter >#< text "aload_3"):instruction2pp xs (counter + 1)
46 -> (pp counter >#< text "iaload"):instruction2pp xs (counter + 1)
47 -> (pp counter >#< text "laload"):instruction2pp xs (counter + 1)
48 -> (pp counter >#< text "faload"):instruction2pp xs (counter + 1)
49 -> (pp counter >#< text "daload"):instruction2pp xs (counter + 1)
50 -> (pp counter >#< text "aaload"):instruction2pp xs (counter + 1)
51 -> (pp counter >#< text "baload"):instruction2pp xs (counter + 1)
52 -> (pp counter >#< text "caload"):instruction2pp xs (counter + 1)
53 -> (pp counter >#< text "saload"):instruction2pp xs (counter + 1)
54 -> (pp counter >#< text "istore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
55 -> (pp counter >#< text "lstore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
56 -> (pp counter >#< text "fstore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
57 -> (pp counter >#< text "dstore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
58 -> (pp counter >#< text "astore" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
59 -> (pp counter >#< text "istore_0"):instruction2pp xs (counter + 1)
60 -> (pp counter >#< text "istore_1"):instruction2pp xs (counter + 1)
61 -> (pp counter >#< text "istore_2"):instruction2pp xs (counter + 1)
62 -> (pp counter >#< text "istore_3"):instruction2pp xs (counter + 1)
63 -> (pp counter >#< text "lstore_0"):instruction2pp xs (counter + 1)
64 -> (pp counter >#< text "lstore_1"):instruction2pp xs (counter + 1)
65 -> (pp counter >#< text "lstore_2"):instruction2pp xs (counter + 1)
66 -> (pp counter >#< text "lstore_3"):instruction2pp xs (counter + 1)
67 -> (pp counter >#< text "fstore_0"):instruction2pp xs (counter + 1)
68 -> (pp counter >#< text "fstore_1"):instruction2pp xs (counter + 1)
69 -> (pp counter >#< text "fstore_2"):instruction2pp xs (counter + 1)
70 -> (pp counter >#< text "fstore_3"):instruction2pp xs (counter + 1)
71 -> (pp counter >#< text "dstore_0"):instruction2pp xs (counter + 1)
72 -> (pp counter >#< text "dstore_1"):instruction2pp xs (counter + 1)
73 -> (pp counter >#< text "dstore_2"):instruction2pp xs (counter + 1)
74 -> (pp counter >#< text "dstore_3"):instruction2pp xs (counter + 1)
75 -> (pp counter >#< text "astore_0"):instruction2pp xs (counter + 1)
76 -> (pp counter >#< text "astore_1"):instruction2pp xs (counter + 1)
77 -> (pp counter >#< text "astore_2"):instruction2pp xs (counter + 1)
78 -> (pp counter >#< text "astore_3"):instruction2pp xs (counter + 1)
79 -> (pp counter >#< text "iastore"):instruction2pp xs (counter + 1)
80 -> (pp counter >#< text "lastore"):instruction2pp xs (counter + 1)
81 -> (pp counter >#< text "fastore"):instruction2pp xs (counter + 1)
82 -> (pp counter >#< text "dastore"):instruction2pp xs (counter + 1)
83 -> (pp counter >#< text "aastore"):instruction2pp xs (counter + 1)
84 -> (pp counter >#< text "bastore"):instruction2pp xs (counter + 1)
85 -> (pp counter >#< text "castore"):instruction2pp xs (counter + 1)
86 -> (pp counter >#< text "sastore"):instruction2pp xs (counter + 1)
87 -> (pp counter >#< text "pop"):instruction2pp xs (counter + 1)
88 -> (pp counter >#< text "pop2"):instruction2pp xs (counter + 1)
89 -> (pp counter >#< text "dup"):instruction2pp xs (counter + 1)
90 -> (pp counter >#< text "dup_x1"):instruction2pp xs (counter + 1)
91 -> (pp counter >#< text "dup_x2"):instruction2pp xs (counter + 1)
92 -> (pp counter >#< text "dup2"):instruction2pp xs (counter + 1)
93 -> (pp counter >#< text "dup2_x1"):instruction2pp xs (counter + 1)
94 -> (pp counter >#< text "dup2_x2"):instruction2pp xs (counter + 1)
95 -> (pp counter >#< text "swap"):instruction2pp xs (counter + 1)
96 -> (pp counter >#< text "iadd"):instruction2pp xs (counter + 1)
97 -> (pp counter >#< text "ladd"):instruction2pp xs (counter + 1)
98 -> (pp counter >#< text "fadd"):instruction2pp xs (counter + 1)
99 -> (pp counter >#< text "dadd"):instruction2pp xs (counter + 1)
100 -> (pp counter >#< text "isub"):instruction2pp xs (counter + 1)
101 -> (pp counter >#< text "lsub"):instruction2pp xs (counter + 1)
102 -> (pp counter >#< text "fsub"):instruction2pp xs (counter + 1)
103 -> (pp counter >#< text "dsub"):instruction2pp xs (counter + 1)
104 -> (pp counter >#< text "imul"):instruction2pp xs (counter + 1)
105 -> (pp counter >#< text "lmul"):instruction2pp xs (counter + 1)
106 -> (pp counter >#< text "fmul"):instruction2pp xs (counter + 1)
107 -> (pp counter >#< text "dmul"):instruction2pp xs (counter + 1)
108 -> (pp counter >#< text "idiv"):instruction2pp xs (counter + 1)
109 -> (pp counter >#< text "ldiv"):instruction2pp xs (counter + 1)
110 -> (pp counter >#< text "fdiv"):instruction2pp xs (counter + 1)
111 -> (pp counter >#< text "ddiv"):instruction2pp xs (counter + 1)
112 -> (pp counter >#< text "irem"):instruction2pp xs (counter + 1)
113 -> (pp counter >#< text "lrem"):instruction2pp xs (counter + 1)
114 -> (pp counter >#< text "frem"):instruction2pp xs (counter + 1)
115 -> (pp counter >#< text "drem"):instruction2pp xs (counter + 1)
116 -> (pp counter >#< text "ineg"):instruction2pp xs (counter + 1)
117 -> (pp counter >#< text "lneg"):instruction2pp xs (counter + 1)
118 -> (pp counter >#< text "fneg"):instruction2pp xs (counter + 1)
119 -> (pp counter >#< text "dneg"):instruction2pp xs (counter + 1)
120 -> (pp counter >#< text "ishl"):instruction2pp xs (counter + 1)
121 -> (pp counter >#< text "lshl"):instruction2pp xs (counter + 1)
122 -> (pp counter >#< text "ishr"):instruction2pp xs (counter + 1)
123 -> (pp counter >#< text "lshr"):instruction2pp xs (counter + 1)
124 -> (pp counter >#< text "iushr"):instruction2pp xs (counter + 1)
125 -> (pp counter >#< text "lushr"):instruction2pp xs (counter + 1)
126 -> (pp counter >#< text "iand"):instruction2pp xs (counter + 1)
127 -> (pp counter >#< text "land"):instruction2pp xs (counter + 1)
128 -> (pp counter >#< text "ior"):instruction2pp xs (counter + 1)
129 -> (pp counter >#< text "lor"):instruction2pp xs (counter + 1)
130 -> (pp counter >#< text "ixor"):instruction2pp xs (counter + 1)
131 -> (pp counter >#< text "lxor"):instruction2pp xs (counter + 1)
132 -> (pp counter >#< text "iinc" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
133 -> (pp counter >#< text "i2l"):instruction2pp xs (counter + 1)
134 -> (pp counter >#< text "i2f"):instruction2pp xs (counter + 1)
135 -> (pp counter >#< text "i2d"):instruction2pp xs (counter + 1)
136 -> (pp counter >#< text "l2i"):instruction2pp xs (counter + 1)
137 -> (pp counter >#< text "l2f"):instruction2pp xs (counter + 1)
138 -> (pp counter >#< text "l2d"):instruction2pp xs (counter + 1)
139 -> (pp counter >#< text "f2i"):instruction2pp xs (counter + 1)
140 -> (pp counter >#< text "f2l"):instruction2pp xs (counter + 1)
141 -> (pp counter >#< text "f2d"):instruction2pp xs (counter + 1)
142 -> (pp counter >#< text "d2i"):instruction2pp xs (counter + 1)
143 -> (pp counter >#< text "d2l"):instruction2pp xs (counter + 1)
144 -> (pp counter >#< text "d2f"):instruction2pp xs (counter + 1)
145 -> (pp counter >#< text "i2b"):instruction2pp xs (counter + 1)
146 -> (pp counter >#< text "i2c"):instruction2pp xs (counter + 1)
147 -> (pp counter >#< text "i2s"):instruction2pp xs (counter + 1)
148 -> (pp counter >#< text "lcmp"):instruction2pp xs (counter + 1)
149 -> (pp counter >#< text "fcmpl"):instruction2pp xs (counter + 1)
150 -> (pp counter >#< text "fcmpg"):instruction2pp xs (counter + 1)
151 -> (pp counter >#< text "dcmpl"):instruction2pp xs (counter + 1)
152 -> (pp counter >#< text "dcmpg"):instruction2pp xs (counter + 1)
153 -> (pp counter >#< text "ifeq" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
154 -> (pp counter >#< text "ifne" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
155 -> (pp counter >#< text "iflt" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
156 -> (pp counter >#< text "ifge" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
157 -> (pp counter >#< text "ifgt" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
158 -> (pp counter >#< text "ifle" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
159 -> (pp counter >#< text "if_icmpeq" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
160 -> (pp counter >#< text "if_icmpne" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
161 -> (pp counter >#< text "if_icmplt" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
162 -> (pp counter >#< text "if_icmpge" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
163 -> (pp counter >#< text "if_icmpgt" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
164 -> (pp counter >#< text "if_icmple" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
165 -> (pp counter >#< text "if_acmpeq" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
166 -> (pp counter >#< text "if_acmpne" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
167 -> (pp counter >#< text "goto" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
168 -> (pp counter >#< text "jsr" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
169 -> (pp counter >#< text "ret" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
170 -> let npad = (counter + 1) `mod` 4
(bpad, rs1) = splitAt npad xs
(defpos,rs2) = (fromBytes2Int $ take 4 rs1, drop 4 rs1)
(low, rs3) = (fromBytes2Int $ take 4 rs1, drop 4 rs2)
(hight, rs4) = (fromBytes2Int $ take 4 rs1, drop 4 rs3)
(lstbr, rs5) = let n = 4*(hight-low+1) in (toInts (take n rs4), drop n rs4)
in (pp counter >#< text "tableswitch" >#< text "[ hight :" >#< pp hight >#< text "low :" >#< pp low >#< text " ]" >-<
vlist ((map (\br -> text "->" >#< pp br) lstbr) ++ [text "-> default :" >#< pp defpos])) : instruction2pp rs5 (counter + npad + 12 + (hight-low+1)*4)
171 -> let npad = (counter+1) `mod` 4
(bpad, rs1) = splitAt npad xs
(defpos,rs2) = (fromBytes2Int $ take 4 rs1, drop 4 rs1)
(npairs,rs3) = (fromBytes2Int $ take 4 rs2, drop 4 rs2)
(lstpairs, rs4) = (fromBytes2Tupla $ take (npairs*2*4) rs3, drop (npairs*2*4) rs3)
in (pp counter >#< text "lookupswitch" >#< text "[ pad :" >#< pp npad >#< text ", ntable :" >#< pp npairs >#< text " ]" >-<
vlist ((map (\(n1,n2) -> pp n1 >#< text "->" >#< pp n2) lstpairs) ++ [text "default ->" >#< pp defpos])) : instruction2pp rs4 (counter + npad + 8 + npairs*2*4)
172 -> (pp counter >#< text "ireturn"):instruction2pp xs (counter + 1)
173 -> (pp counter >#< text "lreturn"):instruction2pp xs (counter + 1)
174 -> (pp counter >#< text "freturn"):instruction2pp xs (counter + 1)
175 -> (pp counter >#< text "dreturn"):instruction2pp xs (counter + 1)
176 -> (pp counter >#< text "areturn"):instruction2pp xs (counter + 1)
177 -> (pp counter >#< text "return"):instruction2pp xs (counter + 1)
178 -> (pp counter >#< text "getstatic" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
179 -> (pp counter >#< text "putstatic" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
180 -> (pp counter >#< text "getfield" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
181 -> (pp counter >#< text "putfield" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
182 -> (pp counter >#< text "invokevirtual" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
183 -> (pp counter >#< text "invokespecial" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
184 -> (pp counter >#< text "invokestatic" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
185 -> (pp counter >#< text "invokeinterface" >#< let [b1,b2,b3,b4] = take 4 xs in pp b1 >#< pp b2 >#< pp b3 >#< pp b4):instruction2pp (drop 4 xs) (counter + 5)
--186 (0xba) xxxunusedxxx1
187 -> (pp counter >#< text "new" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
188 -> (pp counter >#< text "newarray" >#< pp (take 1 xs)):instruction2pp (drop 1 xs) (counter + 2)
189 -> (pp counter >#< text "anewarray" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
190 -> (pp counter >#< text "arraylength"):instruction2pp xs (counter + 1)
191 -> (pp counter >#< text "athrow"):instruction2pp xs (counter + 1)
192 -> (pp counter >#< text "checkcast" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
193 -> (pp counter >#< text "instanceof" >#< let [b1,b2] = take 2 xs in pp b1 >#< pp b2):instruction2pp (drop 2 xs) (counter + 3)
194 -> (pp counter >#< text "monitorenter"):instruction2pp xs (counter + 1)
195 -> (pp counter >#< text "monitorexit"):instruction2pp xs (counter + 1)
196 -> let (vinstr, rs1) = (head xs, tail xs)
(vindex, rs2) = (fromBytes2Int (take 2 rs1), drop 2 rs1)
in if (vinstr == 132) -- 132 == iinc
then let (vconst, rs3) = (fromBytes2Int (take 2 rs2), drop 2 rs2)
in (pp counter >#< text "wide" >#< toPP vinstr >#< text "index :" >#< pp vindex >#< text "const :" >#< pp vconst) : instruction2pp rs3 (counter + 6)
else (pp counter >#< text "wide" >#< toPP vinstr >#< text "index :" >#< pp vindex) : instruction2pp rs2 (counter + 4)
197 -> (pp counter >#< text "multianewarray" >#< let [b1,b2,b3] = take 3 xs in pp b1 >#< pp b2 >#< pp b3):instruction2pp (drop 3 xs) (counter + 4)
198 -> (pp counter >#< text "ifnull" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
199 -> (pp counter >#< text "ifnonnull" >#< let n = fromBytes2Int (take 2 xs) in pp (getSignedInt (n+counter) 17)):instruction2pp (drop 2 xs) (counter + 3)
200 -> (pp counter >#< text "goto_w" >#< let n = fromBytes2Int (take 4 xs) in pp (getSignedInt (n+counter) 33)):instruction2pp (drop 4 xs) (counter + 5)
201 -> (pp counter >#< text "jsr_w" >#< let n = fromBytes2Int (take 4 xs) in pp (getSignedInt (n+counter) 33)):instruction2pp (drop 4 xs) (counter + 5)
--Reserved ocounterodes:
--202 (0xca) breakpoint
--254 (0xfe) impdep1
--255 (0xff) impdep2
-- Auxiliar functions
| 20,798
| false
| false
| 30
| 49
| 5,354
| 10,009
| 4,859
| 5,150
| null | null |
foreverbell/project-euler-solutions
|
src/185.hs
|
bsd-3-clause
|
main = (print . solve . parse) =<< readFile "input/p185_input.txt"
| 66
|
main = (print . solve . parse) =<< readFile "input/p185_input.txt"
| 66
|
main = (print . solve . parse) =<< readFile "input/p185_input.txt"
| 66
| false
| false
| 0
| 8
| 9
| 24
| 12
| 12
| null | null |
5outh/Bang
|
src/Bang.hs
|
mit
|
runComposition :: StateT (Connection, [Primitive PercussionSound]) IO ()
runComposition = do
(conn, evs) <- get
t <- lift $ currentTime conn
case evs of
[] -> return ()
(Rest _ : xs) -> do
put (conn, xs)
lift $ threadDelay 250
runComposition
(e@(Note _ _) : xs) -> do
let (MidiEvent s ev) = drumToMidiEvent e
when (s < t) $ do
put (conn, xs)
lift $ send conn ev
lift $ threadDelay 250
runComposition
| 497
|
runComposition :: StateT (Connection, [Primitive PercussionSound]) IO ()
runComposition = do
(conn, evs) <- get
t <- lift $ currentTime conn
case evs of
[] -> return ()
(Rest _ : xs) -> do
put (conn, xs)
lift $ threadDelay 250
runComposition
(e@(Note _ _) : xs) -> do
let (MidiEvent s ev) = drumToMidiEvent e
when (s < t) $ do
put (conn, xs)
lift $ send conn ev
lift $ threadDelay 250
runComposition
| 497
|
runComposition = do
(conn, evs) <- get
t <- lift $ currentTime conn
case evs of
[] -> return ()
(Rest _ : xs) -> do
put (conn, xs)
lift $ threadDelay 250
runComposition
(e@(Note _ _) : xs) -> do
let (MidiEvent s ev) = drumToMidiEvent e
when (s < t) $ do
put (conn, xs)
lift $ send conn ev
lift $ threadDelay 250
runComposition
| 424
| false
| true
| 3
| 16
| 172
| 226
| 104
| 122
| null | null |
rueshyna/gogol
|
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Sites/List.hs
|
mpl-2.0
|
-- | Value of the nextPageToken from the previous result page.
sitPageToken :: Lens' SitesList (Maybe Text)
sitPageToken
= lens _sitPageToken (\ s a -> s{_sitPageToken = a})
| 175
|
sitPageToken :: Lens' SitesList (Maybe Text)
sitPageToken
= lens _sitPageToken (\ s a -> s{_sitPageToken = a})
| 112
|
sitPageToken
= lens _sitPageToken (\ s a -> s{_sitPageToken = a})
| 67
| true
| true
| 0
| 9
| 29
| 48
| 25
| 23
| null | null |
siddhanathan/ghc
|
compiler/deSugar/Coverage.hs
|
bsd-3-clause
|
getFreeVars :: TM a -> TM (FreeVars, a)
getFreeVars (TM m)
= TM $ \ env st -> case m env st of (a, fv, st') -> ((fv,a), fv, st')
| 130
|
getFreeVars :: TM a -> TM (FreeVars, a)
getFreeVars (TM m)
= TM $ \ env st -> case m env st of (a, fv, st') -> ((fv,a), fv, st')
| 130
|
getFreeVars (TM m)
= TM $ \ env st -> case m env st of (a, fv, st') -> ((fv,a), fv, st')
| 90
| false
| true
| 0
| 11
| 31
| 86
| 47
| 39
| null | null |
MichaelBaker/proof-club
|
src/Schedule.hs
|
mit
|
extractExercises :: Lister Note b -> [Note]
extractExercises = fst . partition isExercise . extract
| 99
|
extractExercises :: Lister Note b -> [Note]
extractExercises = fst . partition isExercise . extract
| 99
|
extractExercises = fst . partition isExercise . extract
| 55
| false
| true
| 0
| 7
| 14
| 34
| 17
| 17
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.