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
shnarazk/satter
Satter/Player.hs
gpl-3.0
newIntention _ _ (_intention -> int@(Lost d)) = return $ keepIntension int
74
newIntention _ _ (_intention -> int@(Lost d)) = return $ keepIntension int
74
newIntention _ _ (_intention -> int@(Lost d)) = return $ keepIntension int
74
false
false
0
10
11
36
18
18
null
null
vikraman/ghc
compiler/codeGen/StgCmmUtils.hs
bsd-3-clause
emitSwitch _ [(_,code)] Nothing _ _ = emit (fst code)
57
emitSwitch _ [(_,code)] Nothing _ _ = emit (fst code)
57
emitSwitch _ [(_,code)] Nothing _ _ = emit (fst code)
57
false
false
1
7
13
35
18
17
null
null
alphaHeavy/consul-haskell
src/Network/Consul/Types.hs
bsd-3-clause
{- | Represents the case when we have no data payload (body) to include in the Consul request. @since 0.0.0.0 -} noRequestBody :: Maybe a noRequestBody = Nothing
162
noRequestBody :: Maybe a noRequestBody = Nothing
48
noRequestBody = Nothing
23
true
true
0
5
28
15
8
7
null
null
CindyLinz/Haskell.js
trans/src/Desugar/PatBind.hs
mit
dePatBindKind (KindApp l kind1 kind2) = KindApp (id l) (dePatBindKind kind1) (dePatBindKind kind2)
98
dePatBindKind (KindApp l kind1 kind2) = KindApp (id l) (dePatBindKind kind1) (dePatBindKind kind2)
98
dePatBindKind (KindApp l kind1 kind2) = KindApp (id l) (dePatBindKind kind1) (dePatBindKind kind2)
98
false
false
0
7
12
44
21
23
null
null
tolysz/prepare-ghcjs
spec-lts8/cabal/cabal-install/Distribution/Client/ComponentDeps.hs
bsd-3-clause
{------------------------------------------------------------------------------- Construction -------------------------------------------------------------------------------} empty :: ComponentDeps a empty = ComponentDeps $ Map.empty
236
empty :: ComponentDeps a empty = ComponentDeps $ Map.empty
58
empty = ComponentDeps $ Map.empty
33
true
true
0
6
14
21
11
10
null
null
infotroph/pandoc-crossref
lib/Text/Pandoc/CrossRef/References/Blocks.hs
gpl-2.0
replaceBlocks opts (Div (label,_,attrs) [Table title align widths header cells]) | not $ null title , "tbl:" `isPrefixOf` label = do idxStr <- replaceAttr opts label (lookup "label" attrs) title tblRefs let title' = case outFormat opts of f | isFormat "latex" f -> RawInline (Format "tex") (mkLaTeXLabel label) : title _ -> applyTemplate idxStr title $ tableTemplate opts return $ Table title' align widths header cells
492
replaceBlocks opts (Div (label,_,attrs) [Table title align widths header cells]) | not $ null title , "tbl:" `isPrefixOf` label = do idxStr <- replaceAttr opts label (lookup "label" attrs) title tblRefs let title' = case outFormat opts of f | isFormat "latex" f -> RawInline (Format "tex") (mkLaTeXLabel label) : title _ -> applyTemplate idxStr title $ tableTemplate opts return $ Table title' align widths header cells
492
replaceBlocks opts (Div (label,_,attrs) [Table title align widths header cells]) | not $ null title , "tbl:" `isPrefixOf` label = do idxStr <- replaceAttr opts label (lookup "label" attrs) title tblRefs let title' = case outFormat opts of f | isFormat "latex" f -> RawInline (Format "tex") (mkLaTeXLabel label) : title _ -> applyTemplate idxStr title $ tableTemplate opts return $ Table title' align widths header cells
492
false
false
0
18
139
181
85
96
null
null
raichoo/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
highestFC (PTyped tm ty) = highestFC tm <|> highestFC ty
56
highestFC (PTyped tm ty) = highestFC tm <|> highestFC ty
56
highestFC (PTyped tm ty) = highestFC tm <|> highestFC ty
56
false
false
0
7
9
27
12
15
null
null
forste/haReFork
tools/interp/HaskellCoreLite1.3.hs
bsd-3-clause
eval (Abs ps l) = arrow ps (eval l)
35
eval (Abs ps l) = arrow ps (eval l)
35
eval (Abs ps l) = arrow ps (eval l)
35
false
false
0
7
8
28
13
15
null
null
ecaustin/haskhol-math
src/HaskHOL/Lib/CalcNum/Pre2.hs
bsd-2-clause
{- return . unsafePerformIO $ do n <- c_constant_adcFlags_size s <- c_constant_adcFlags b <- unsafePackCStringLen (castPtr s, fromIntegral n) case runGetLazy safeGet . decompress $ fromChunks [b] of Left err -> fail err Right res -> return res foreign import ccall unsafe "constant_adcFlags" c_constant_adcFlags :: IO (Ptr Word8) foreign import ccall unsafe "adcFlags_size" c_constant_adcFlags_size :: IO CLong -} convNUM_SHIFT_pths1 :: WFCtxt thry => HOL cls thry [HOLThm] convNUM_SHIFT_pths1 = cacheThms "convNUM_SHIFT_pths1" . serializeValue "convNUM_SHIFT_pths1" ctxtWF $ ruleCONJUNCTS convNUM_SHIFT_pths1' where convNUM_SHIFT_pths1' :: WFCtxt thry => HOL cls thry HOLThm convNUM_SHIFT_pths1' = cacheProof "convNUM_SHIFT_pths1'" ctxtWF . prove [txt| (n = a + p * b <=> BIT0(BIT0(BIT0(BIT0 n))) = BIT0(BIT0(BIT0(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT0(BIT0(BIT0 n))) = BIT1(BIT0(BIT0(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT1(BIT0(BIT0 n))) = BIT0(BIT1(BIT0(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT1(BIT0(BIT0 n))) = BIT1(BIT1(BIT0(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT0(BIT1(BIT0 n))) = BIT0(BIT0(BIT1(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT0(BIT1(BIT0 n))) = BIT1(BIT0(BIT1(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT1(BIT1(BIT0 n))) = BIT0(BIT1(BIT1(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT1(BIT1(BIT0 n))) = BIT1(BIT1(BIT1(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT0(BIT0(BIT1 n))) = BIT0(BIT0(BIT0(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT0(BIT0(BIT1 n))) = BIT1(BIT0(BIT0(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT1(BIT0(BIT1 n))) = BIT0(BIT1(BIT0(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT1(BIT0(BIT1 n))) = BIT1(BIT1(BIT0(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT0(BIT1(BIT1 n))) = BIT0(BIT0(BIT1(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT0(BIT1(BIT1 n))) = BIT1(BIT0(BIT1(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT1(BIT1(BIT1 n))) = BIT0(BIT1(BIT1(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT1(BIT1(BIT1 n))) = BIT1(BIT1(BIT1(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) |] $ tacMP (ruleREWRITE [ruleGSYM thmMULT_2] thmBIT0) `_THEN` tacMP (ruleREWRITE [ruleGSYM thmMULT_2] thmBIT1) `_THEN` tacABBREV [txt| two = 2 |] `_THEN` _DISCH_THEN (\ th -> tacREWRITE [th]) `_THEN` _DISCH_THEN (\ th -> tacREWRITE [th]) `_THEN` _FIRST_X_ASSUM (tacSUBST1 . ruleSYM) `_THEN` tacREWRITE [ thmADD_CLAUSES, thmSUC_INJ , thmEQ_MULT_LCANCEL, thmARITH_EQ , ruleGSYM thmLEFT_ADD_DISTRIB, ruleGSYM thmMULT_ASSOC ]
3,999
convNUM_SHIFT_pths1 :: WFCtxt thry => HOL cls thry [HOLThm] convNUM_SHIFT_pths1 = cacheThms "convNUM_SHIFT_pths1" . serializeValue "convNUM_SHIFT_pths1" ctxtWF $ ruleCONJUNCTS convNUM_SHIFT_pths1' where convNUM_SHIFT_pths1' :: WFCtxt thry => HOL cls thry HOLThm convNUM_SHIFT_pths1' = cacheProof "convNUM_SHIFT_pths1'" ctxtWF . prove [txt| (n = a + p * b <=> BIT0(BIT0(BIT0(BIT0 n))) = BIT0(BIT0(BIT0(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT0(BIT0(BIT0 n))) = BIT1(BIT0(BIT0(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT1(BIT0(BIT0 n))) = BIT0(BIT1(BIT0(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT1(BIT0(BIT0 n))) = BIT1(BIT1(BIT0(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT0(BIT1(BIT0 n))) = BIT0(BIT0(BIT1(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT0(BIT1(BIT0 n))) = BIT1(BIT0(BIT1(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT1(BIT1(BIT0 n))) = BIT0(BIT1(BIT1(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT1(BIT1(BIT0 n))) = BIT1(BIT1(BIT1(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT0(BIT0(BIT1 n))) = BIT0(BIT0(BIT0(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT0(BIT0(BIT1 n))) = BIT1(BIT0(BIT0(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT1(BIT0(BIT1 n))) = BIT0(BIT1(BIT0(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT1(BIT0(BIT1 n))) = BIT1(BIT1(BIT0(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT0(BIT1(BIT1 n))) = BIT0(BIT0(BIT1(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT0(BIT1(BIT1 n))) = BIT1(BIT0(BIT1(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT1(BIT1(BIT1 n))) = BIT0(BIT1(BIT1(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT1(BIT1(BIT1 n))) = BIT1(BIT1(BIT1(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) |] $ tacMP (ruleREWRITE [ruleGSYM thmMULT_2] thmBIT0) `_THEN` tacMP (ruleREWRITE [ruleGSYM thmMULT_2] thmBIT1) `_THEN` tacABBREV [txt| two = 2 |] `_THEN` _DISCH_THEN (\ th -> tacREWRITE [th]) `_THEN` _DISCH_THEN (\ th -> tacREWRITE [th]) `_THEN` _FIRST_X_ASSUM (tacSUBST1 . ruleSYM) `_THEN` tacREWRITE [ thmADD_CLAUSES, thmSUC_INJ , thmEQ_MULT_LCANCEL, thmARITH_EQ , ruleGSYM thmLEFT_ADD_DISTRIB, ruleGSYM thmMULT_ASSOC ]
3,529
convNUM_SHIFT_pths1 = cacheThms "convNUM_SHIFT_pths1" . serializeValue "convNUM_SHIFT_pths1" ctxtWF $ ruleCONJUNCTS convNUM_SHIFT_pths1' where convNUM_SHIFT_pths1' :: WFCtxt thry => HOL cls thry HOLThm convNUM_SHIFT_pths1' = cacheProof "convNUM_SHIFT_pths1'" ctxtWF . prove [txt| (n = a + p * b <=> BIT0(BIT0(BIT0(BIT0 n))) = BIT0(BIT0(BIT0(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT0(BIT0(BIT0 n))) = BIT1(BIT0(BIT0(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT1(BIT0(BIT0 n))) = BIT0(BIT1(BIT0(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT1(BIT0(BIT0 n))) = BIT1(BIT1(BIT0(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT0(BIT1(BIT0 n))) = BIT0(BIT0(BIT1(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT0(BIT1(BIT0 n))) = BIT1(BIT0(BIT1(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT1(BIT1(BIT0 n))) = BIT0(BIT1(BIT1(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT1(BIT1(BIT0 n))) = BIT1(BIT1(BIT1(BIT0 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT0(BIT0(BIT1 n))) = BIT0(BIT0(BIT0(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT0(BIT0(BIT1 n))) = BIT1(BIT0(BIT0(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT1(BIT0(BIT1 n))) = BIT0(BIT1(BIT0(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT1(BIT0(BIT1 n))) = BIT1(BIT1(BIT0(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT0(BIT1(BIT1 n))) = BIT0(BIT0(BIT1(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT0(BIT1(BIT1 n))) = BIT1(BIT0(BIT1(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT0(BIT1(BIT1(BIT1 n))) = BIT0(BIT1(BIT1(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) /\ (n = a + p * b <=> BIT1(BIT1(BIT1(BIT1 n))) = BIT1(BIT1(BIT1(BIT1 a))) + BIT0(BIT0(BIT0(BIT0 p))) * b) |] $ tacMP (ruleREWRITE [ruleGSYM thmMULT_2] thmBIT0) `_THEN` tacMP (ruleREWRITE [ruleGSYM thmMULT_2] thmBIT1) `_THEN` tacABBREV [txt| two = 2 |] `_THEN` _DISCH_THEN (\ th -> tacREWRITE [th]) `_THEN` _DISCH_THEN (\ th -> tacREWRITE [th]) `_THEN` _FIRST_X_ASSUM (tacSUBST1 . ruleSYM) `_THEN` tacREWRITE [ thmADD_CLAUSES, thmSUC_INJ , thmEQ_MULT_LCANCEL, thmARITH_EQ , ruleGSYM thmLEFT_ADD_DISTRIB, ruleGSYM thmMULT_ASSOC ]
3,469
true
true
2
16
1,582
242
130
112
null
null
sras/html-to-lucid
app/Main.hs
bsd-3-clause
main :: IO () main = hGetContents stdin >>= putStr.makeTemplate
63
main :: IO () main = hGetContents stdin >>= putStr.makeTemplate
63
main = hGetContents stdin >>= putStr.makeTemplate
49
false
true
0
6
9
25
12
13
null
null
bgaster/idris-java
src/IRTS/Java/JTypes.hs
bsd-3-clause
sourceTypes (LZExt from _) = [intTyToJType from]
48
sourceTypes (LZExt from _) = [intTyToJType from]
48
sourceTypes (LZExt from _) = [intTyToJType from]
48
false
false
0
7
6
23
11
12
null
null
mapinguari/SC_HS_Proxy
src/Proxy/PotentialFields/NEW.hs
mit
transposeL :: Int -> [b] -> [b] transposeL _ [] = []
53
transposeL :: Int -> [b] -> [b] transposeL _ [] = []
52
transposeL _ [] = []
20
false
true
0
7
12
34
18
16
null
null
xcv-/pipes-find
src/System/HFind/Expr/Eval.hs
mit
newContext :: Baker.BakingContext -> IO EvalContext newContext ctx = do vals <- MV.replicate (Baker.ctxGetNumVars ctx) (throw UninitializedVariableException) activeMatch <- newIORef Nothing backtrace <- newIORef Err.emptyBacktrace return (EvalContext vals activeMatch backtrace ctx)
340
newContext :: Baker.BakingContext -> IO EvalContext newContext ctx = do vals <- MV.replicate (Baker.ctxGetNumVars ctx) (throw UninitializedVariableException) activeMatch <- newIORef Nothing backtrace <- newIORef Err.emptyBacktrace return (EvalContext vals activeMatch backtrace ctx)
340
newContext ctx = do vals <- MV.replicate (Baker.ctxGetNumVars ctx) (throw UninitializedVariableException) activeMatch <- newIORef Nothing backtrace <- newIORef Err.emptyBacktrace return (EvalContext vals activeMatch backtrace ctx)
288
false
true
0
11
88
91
41
50
null
null
ItsLastDay/academic_university_2016-2018
subjects/Haskell/5/Fp05LamTest.hs
gpl-3.0
omega = Lam "x" $ x :@ x
24
omega = Lam "x" $ x :@ x
24
omega = Lam "x" $ x :@ x
24
false
false
0
7
7
17
8
9
null
null
wangwangwar/cis194
src/ch12/Risk.hs
bsd-3-clause
battleResults _ [] = mempty
27
battleResults _ [] = mempty
27
battleResults _ [] = mempty
27
false
false
0
6
4
17
7
10
null
null
lucas8/MPSI
math/dm1/dm1.hs
mit
combine (e1:es) f = e1 `f` e2 : combine es f where e2 = head es
67
combine (e1:es) f = e1 `f` e2 : combine es f where e2 = head es
67
combine (e1:es) f = e1 `f` e2 : combine es f where e2 = head es
67
false
false
1
6
19
48
22
26
null
null
ku-fpg/kansas-amber
System/Hardware/Haskino/Compiler.hs
bsd-3-clause
compileProcedure (IterateI32W16E br iv bf) = do b <- nextBind let bb = RemBindI b i <- nextBind let bi = RemBindI32 i j <- nextBind let bj = RemBindW16 j _ <- compileIterateProcedure Int32Type Word16Type b bb br i bi j bj iv bf return bj
269
compileProcedure (IterateI32W16E br iv bf) = do b <- nextBind let bb = RemBindI b i <- nextBind let bi = RemBindI32 i j <- nextBind let bj = RemBindW16 j _ <- compileIterateProcedure Int32Type Word16Type b bb br i bi j bj iv bf return bj
269
compileProcedure (IterateI32W16E br iv bf) = do b <- nextBind let bb = RemBindI b i <- nextBind let bi = RemBindI32 i j <- nextBind let bj = RemBindW16 j _ <- compileIterateProcedure Int32Type Word16Type b bb br i bi j bj iv bf return bj
269
false
false
0
10
78
112
49
63
null
null
gatlin/psilo
src/Lib/Types/TypeCheck.hs
gpl-3.0
infer (_ :< IdC sym) = do te <- getEnv case envLookup te sym of Nothing -> fresh Star >>= return . TVar Just scheme -> do ty <- instantiate scheme return ty -- | A lambda abstraction is a list of symbols and an 'AnnotatedExpr' body. Each -- argument should generate a unique 'Sigma' and the 'TypeEnv' should be -- temporarily extended with them to evaluate the body.
415
infer (_ :< IdC sym) = do te <- getEnv case envLookup te sym of Nothing -> fresh Star >>= return . TVar Just scheme -> do ty <- instantiate scheme return ty -- | A lambda abstraction is a list of symbols and an 'AnnotatedExpr' body. Each -- argument should generate a unique 'Sigma' and the 'TypeEnv' should be -- temporarily extended with them to evaluate the body.
415
infer (_ :< IdC sym) = do te <- getEnv case envLookup te sym of Nothing -> fresh Star >>= return . TVar Just scheme -> do ty <- instantiate scheme return ty -- | A lambda abstraction is a list of symbols and an 'AnnotatedExpr' body. Each -- argument should generate a unique 'Sigma' and the 'TypeEnv' should be -- temporarily extended with them to evaluate the body.
415
false
false
0
13
117
84
38
46
null
null
alexbiehl/hs-fst
src/Data/FST.hs
bsd-3-clause
test = putStrLn (unpack dotAutomaton)
37
test = putStrLn (unpack dotAutomaton)
37
test = putStrLn (unpack dotAutomaton)
37
false
false
0
7
4
15
7
8
null
null
pparkkin/eta
compiler/ETA/TypeCheck/TcRnTypes.hs
bsd-3-clause
isCTyEqCan :: Ct -> Bool isCTyEqCan (CTyEqCan {}) = True
57
isCTyEqCan :: Ct -> Bool isCTyEqCan (CTyEqCan {}) = True
57
isCTyEqCan (CTyEqCan {}) = True
32
false
true
0
7
10
25
13
12
null
null
UCSD-PL/RefScript
src/Language/Rsc/Liquid/Constraints.hs
bsd-3-clause
splitC s@(Sub g i t1@(TVar _ _) t2) | Just t1' <- envFindBoundOpt g t1 = splitC (Sub g (addHist i s) t1' t2)
112
splitC s@(Sub g i t1@(TVar _ _) t2) | Just t1' <- envFindBoundOpt g t1 = splitC (Sub g (addHist i s) t1' t2)
112
splitC s@(Sub g i t1@(TVar _ _) t2) | Just t1' <- envFindBoundOpt g t1 = splitC (Sub g (addHist i s) t1' t2)
112
false
false
0
11
27
76
36
40
null
null
nastya13/binary-search-tree
dist/build/autogen/Paths_binary_search_tree.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
11
22
49
22
27
null
null
antalsz/hs-to-coq
examples/graph/graph/test/Data/Graph/Inductive/Graph/Properties.hs
mit
valid_insEdge :: (DynGraph gr, Ord a, Ord b) => gr a b -> b -> Property valid_insEdge g b = not (isEmpty g) ==> do v <- pickN w <- pickN let el = (v,w,b) g' = insEdge el g return ( sort (labEdges g') == sort (el : labEdges g) && sort (labNodes g') == sort (labNodes g)) where pickN = elements (nodes g) -- | Insert an edge for every label in the list. Multiple edges and -- loops allowed.
547
valid_insEdge :: (DynGraph gr, Ord a, Ord b) => gr a b -> b -> Property valid_insEdge g b = not (isEmpty g) ==> do v <- pickN w <- pickN let el = (v,w,b) g' = insEdge el g return ( sort (labEdges g') == sort (el : labEdges g) && sort (labNodes g') == sort (labNodes g)) where pickN = elements (nodes g) -- | Insert an edge for every label in the list. Multiple edges and -- loops allowed.
547
valid_insEdge g b = not (isEmpty g) ==> do v <- pickN w <- pickN let el = (v,w,b) g' = insEdge el g return ( sort (labEdges g') == sort (el : labEdges g) && sort (labNodes g') == sort (labNodes g)) where pickN = elements (nodes g) -- | Insert an edge for every label in the list. Multiple edges and -- loops allowed.
475
false
true
0
16
240
185
90
95
null
null
wdanilo/convert
src/Data/Convert/Bound.hs
apache-2.0
boundedBy :: Ord a => a -> Bounds a -> Bool boundedBy (Value -> a) (Bounds min max) = a >= min && a <= max
106
boundedBy :: Ord a => a -> Bounds a -> Bool boundedBy (Value -> a) (Bounds min max) = a >= min && a <= max
106
boundedBy (Value -> a) (Bounds min max) = a >= min && a <= max
62
false
true
0
8
25
61
30
31
null
null
hiratara/hs-rtb-bidder
src/Web/RTBBidder/Protocol/Adx/BidRequest/AdSlot/NativeAdTemplate/Fields.hs
bsd-3-clause
toMaybe'Enum 64 = Prelude'.Just APP_ICON
40
toMaybe'Enum 64 = Prelude'.Just APP_ICON
40
toMaybe'Enum 64 = Prelude'.Just APP_ICON
40
false
false
1
6
4
17
6
11
null
null
JacquesCarette/literate-scientific-software
code/drasil-printers/Language/Drasil/Printing/Helpers.hs
bsd-2-clause
tab = text "\t"
18
tab = text "\t"
18
tab = text "\t"
18
false
false
1
5
6
13
4
9
null
null
mainland/nikola
src/Data/Vector/UnboxedForeign.hs
bsd-3-clause
foldr1' = G.foldr1'
19
foldr1' = G.foldr1'
19
foldr1' = G.foldr1'
19
false
false
0
5
2
8
4
4
null
null
GaloisInc/halvm-ghc
compiler/coreSyn/MkCore.hs
bsd-3-clause
sortQuantVars :: [Var] -> [Var] -- Sort the variables, putting type and covars first, in scoped order, -- and then other Ids -- It is a deterministic sort, meaining it doesn't look at the values of -- Uniques. For explanation why it's important See Note [Unique Determinism] -- in Unique. sortQuantVars vs = sorted_tcvs ++ ids where (tcvs, ids) = partition (isTyVar <||> isCoVar) vs sorted_tcvs = toposortTyVars tcvs -- | Bind a binding group over an expression, using a @let@ or @case@ as -- appropriate (see "CoreSyn#let_app_invariant")
549
sortQuantVars :: [Var] -> [Var] sortQuantVars vs = sorted_tcvs ++ ids where (tcvs, ids) = partition (isTyVar <||> isCoVar) vs sorted_tcvs = toposortTyVars tcvs -- | Bind a binding group over an expression, using a @let@ or @case@ as -- appropriate (see "CoreSyn#let_app_invariant")
292
sortQuantVars vs = sorted_tcvs ++ ids where (tcvs, ids) = partition (isTyVar <||> isCoVar) vs sorted_tcvs = toposortTyVars tcvs -- | Bind a binding group over an expression, using a @let@ or @case@ as -- appropriate (see "CoreSyn#let_app_invariant")
260
true
true
1
8
98
78
41
37
null
null
teozkr/GearScript
src/GearScript/Lexer.hs
mit
gsToken :: Parser GSToken gsToken = globalVariable <|> localVariable <|> try (tok (KeywordTok <$> keyword)) <|> annotation <|> name <|> comment <|> tok (BlockBegin <$ char '{') <|> tok (BlockEnd <$ char '}') <|> tok (ParenBegin <$ char '(') <|> tok (ParenEnd <$ char ')') <|> tok (IndexBegin <$ char '[') <|> tok (IndexEnd <$ char ']') <|> tok (StmtEnd <$ char ';') <|> tok (ArgumentSeparator <$ char ',') <|> tok (Plus <$ char '+') <|> tok (Minus <$ char '-') <|> tok (Mult <$ char '*') <|> tok (Div <$ char '/') <|> tok (Mod <$ char '%') <|> tok (QuestionMark <$ char '?') <|> tok (Colon <$ char ':') <|> tok (Eq <$ try (string "==")) <|> tok (Neq <$ try (string "!=")) <|> tok (Lte <$ try (string "<=")) <|> tok (Lt <$ try (string "<")) <|> tok (Gte <$ try (string ">=")) <|> tok (Gt <$ try (string ">")) <|> tok (Not <$ char '!') <|> tok (Set <$ char '=') <|> tok (Dot <$ char '.') <|> tok (BoolAnd <$ try (string "&&")) <|> tok (BoolOr <$ try (string "||")) <|> str <|> taggedStr <|> number
1,199
gsToken :: Parser GSToken gsToken = globalVariable <|> localVariable <|> try (tok (KeywordTok <$> keyword)) <|> annotation <|> name <|> comment <|> tok (BlockBegin <$ char '{') <|> tok (BlockEnd <$ char '}') <|> tok (ParenBegin <$ char '(') <|> tok (ParenEnd <$ char ')') <|> tok (IndexBegin <$ char '[') <|> tok (IndexEnd <$ char ']') <|> tok (StmtEnd <$ char ';') <|> tok (ArgumentSeparator <$ char ',') <|> tok (Plus <$ char '+') <|> tok (Minus <$ char '-') <|> tok (Mult <$ char '*') <|> tok (Div <$ char '/') <|> tok (Mod <$ char '%') <|> tok (QuestionMark <$ char '?') <|> tok (Colon <$ char ':') <|> tok (Eq <$ try (string "==")) <|> tok (Neq <$ try (string "!=")) <|> tok (Lte <$ try (string "<=")) <|> tok (Lt <$ try (string "<")) <|> tok (Gte <$ try (string ">=")) <|> tok (Gt <$ try (string ">")) <|> tok (Not <$ char '!') <|> tok (Set <$ char '=') <|> tok (Dot <$ char '.') <|> tok (BoolAnd <$ try (string "&&")) <|> tok (BoolOr <$ try (string "||")) <|> str <|> taggedStr <|> number
1,199
gsToken = globalVariable <|> localVariable <|> try (tok (KeywordTok <$> keyword)) <|> annotation <|> name <|> comment <|> tok (BlockBegin <$ char '{') <|> tok (BlockEnd <$ char '}') <|> tok (ParenBegin <$ char '(') <|> tok (ParenEnd <$ char ')') <|> tok (IndexBegin <$ char '[') <|> tok (IndexEnd <$ char ']') <|> tok (StmtEnd <$ char ';') <|> tok (ArgumentSeparator <$ char ',') <|> tok (Plus <$ char '+') <|> tok (Minus <$ char '-') <|> tok (Mult <$ char '*') <|> tok (Div <$ char '/') <|> tok (Mod <$ char '%') <|> tok (QuestionMark <$ char '?') <|> tok (Colon <$ char ':') <|> tok (Eq <$ try (string "==")) <|> tok (Neq <$ try (string "!=")) <|> tok (Lte <$ try (string "<=")) <|> tok (Lt <$ try (string "<")) <|> tok (Gte <$ try (string ">=")) <|> tok (Gt <$ try (string ">")) <|> tok (Not <$ char '!') <|> tok (Set <$ char '=') <|> tok (Dot <$ char '.') <|> tok (BoolAnd <$ try (string "&&")) <|> tok (BoolOr <$ try (string "||")) <|> str <|> taggedStr <|> number
1,173
false
true
103
10
394
658
331
327
null
null
patperry/hs-gsl-random
lib/GSL/Random/Dist.hs
bsd-3-clause
-- | @getPoisson r mu@ gets a poisson random variable with mean @mu@. getPoisson :: RNG -> Double -> IO Int getPoisson (MkRNG fptr) mu = let mu' = realToFrac mu in withForeignPtr fptr $ \ptr -> do x <- gsl_ran_poisson ptr mu' return $ fromIntegral x
273
getPoisson :: RNG -> Double -> IO Int getPoisson (MkRNG fptr) mu = let mu' = realToFrac mu in withForeignPtr fptr $ \ptr -> do x <- gsl_ran_poisson ptr mu' return $ fromIntegral x
203
getPoisson (MkRNG fptr) mu = let mu' = realToFrac mu in withForeignPtr fptr $ \ptr -> do x <- gsl_ran_poisson ptr mu' return $ fromIntegral x
165
true
true
0
12
70
82
38
44
null
null
robmcl4/Glug
src/Glug/SubsceneDownloader.hs
bsd-3-clause
getTitles (TS.TagOpen name attrs: xs) | name == "div" && attrs == [("class", "title")] = do (href, title, rest) <- findHrefTitle xs (i, rest') <- findCount rest next <- getTitles rest' Right $ (href, title, i) : next where findHrefTitle [] = Left "No title found" findHrefTitle (TS.TagOpen name' attrs': TS.TagText title: ts) | name' == "a" = do href <- eitherAttr attrs' "href" Right (href, title, ts) | otherwise = findHrefTitle ts findHrefTitle (_:ts) = findHrefTitle ts findCount [] = Left "No count found" findCount (TS.TagOpen name' attrs':TS.TagText txt:ts) | name' == "div" && attrs' == [("class", "subtle count")] = readEither txt' >>= \i -> return (i, ts) | otherwise = findCount ts where txt' = takeWhile (/= ' ') . T.unpack $ txt findCount (_:ts) = findCount ts
992
getTitles (TS.TagOpen name attrs: xs) | name == "div" && attrs == [("class", "title")] = do (href, title, rest) <- findHrefTitle xs (i, rest') <- findCount rest next <- getTitles rest' Right $ (href, title, i) : next where findHrefTitle [] = Left "No title found" findHrefTitle (TS.TagOpen name' attrs': TS.TagText title: ts) | name' == "a" = do href <- eitherAttr attrs' "href" Right (href, title, ts) | otherwise = findHrefTitle ts findHrefTitle (_:ts) = findHrefTitle ts findCount [] = Left "No count found" findCount (TS.TagOpen name' attrs':TS.TagText txt:ts) | name' == "div" && attrs' == [("class", "subtle count")] = readEither txt' >>= \i -> return (i, ts) | otherwise = findCount ts where txt' = takeWhile (/= ' ') . T.unpack $ txt findCount (_:ts) = findCount ts
992
getTitles (TS.TagOpen name attrs: xs) | name == "div" && attrs == [("class", "title")] = do (href, title, rest) <- findHrefTitle xs (i, rest') <- findCount rest next <- getTitles rest' Right $ (href, title, i) : next where findHrefTitle [] = Left "No title found" findHrefTitle (TS.TagOpen name' attrs': TS.TagText title: ts) | name' == "a" = do href <- eitherAttr attrs' "href" Right (href, title, ts) | otherwise = findHrefTitle ts findHrefTitle (_:ts) = findHrefTitle ts findCount [] = Left "No count found" findCount (TS.TagOpen name' attrs':TS.TagText txt:ts) | name' == "div" && attrs' == [("class", "subtle count")] = readEither txt' >>= \i -> return (i, ts) | otherwise = findCount ts where txt' = takeWhile (/= ' ') . T.unpack $ txt findCount (_:ts) = findCount ts
992
false
false
5
12
348
359
180
179
null
null
green-haskell/ghc
compiler/main/ErrUtils.hs
bsd-3-clause
prettyPrintGhcErrors :: ExceptionMonad m => DynFlags -> m a -> m a prettyPrintGhcErrors dflags = ghandle $ \e -> case e of PprPanic str doc -> pprDebugAndThen dflags panic (text str) doc PprSorry str doc -> pprDebugAndThen dflags sorry (text str) doc PprProgramError str doc -> pprDebugAndThen dflags pgmError (text str) doc _ -> liftIO $ throwIO e
544
prettyPrintGhcErrors :: ExceptionMonad m => DynFlags -> m a -> m a prettyPrintGhcErrors dflags = ghandle $ \e -> case e of PprPanic str doc -> pprDebugAndThen dflags panic (text str) doc PprSorry str doc -> pprDebugAndThen dflags sorry (text str) doc PprProgramError str doc -> pprDebugAndThen dflags pgmError (text str) doc _ -> liftIO $ throwIO e
544
prettyPrintGhcErrors dflags = ghandle $ \e -> case e of PprPanic str doc -> pprDebugAndThen dflags panic (text str) doc PprSorry str doc -> pprDebugAndThen dflags sorry (text str) doc PprProgramError str doc -> pprDebugAndThen dflags pgmError (text str) doc _ -> liftIO $ throwIO e
477
false
true
2
11
253
140
65
75
null
null
MaxDaten/netwire
Control/Wire/Prefab/Analyze.hs
bsd-3-clause
-- | Calculate the average of the signal over the given number of last -- samples. If you need an average over all samples ever produced, -- consider using 'avgAll' instead. -- -- * Complexity: O(n) space wrt number of samples. -- -- * Depends: current instant. avg :: forall a m e v. (Fractional a, VectorSpace v, Scalar v ~ a) => Int -> Wire e m v v avg n | n <= 0 = error "avg: The number of samples must be positive"
438
avg :: forall a m e v. (Fractional a, VectorSpace v, Scalar v ~ a) => Int -> Wire e m v v avg n | n <= 0 = error "avg: The number of samples must be positive"
174
avg n | n <= 0 = error "avg: The number of samples must be positive"
68
true
true
0
10
103
86
45
41
null
null
Fizzixnerd/xmonad-config
site-haskell/src/XMonad/Hooks/DynamicLog/Status/DZen2/Universal.hs
gpl-3.0
ppCommand R = rText
19
ppCommand R = rText
19
ppCommand R = rText
19
false
false
1
5
3
13
4
9
null
null
christiaanb/Idris-dev
src/IRTS/CodegenLLVM.hs
bsd-3-clause
cgConst' (TT.B8V v) = C.Vector (map ((C.Int 8) . fromIntegral) . V.toList $ v)
80
cgConst' (TT.B8V v) = C.Vector (map ((C.Int 8) . fromIntegral) . V.toList $ v)
80
cgConst' (TT.B8V v) = C.Vector (map ((C.Int 8) . fromIntegral) . V.toList $ v)
80
false
false
0
14
15
53
26
27
null
null
robdockins/edison
edison-core/src/Data/Edison/Coll/Defaults.hs
mit
lookupAllUsingLookupM :: (Set c a,S.Sequence seq) => a -> c -> seq a lookupAllUsingLookupM x xs = case lookupM x xs of Nothing -> S.empty Just y -> S.singleton y
172
lookupAllUsingLookupM :: (Set c a,S.Sequence seq) => a -> c -> seq a lookupAllUsingLookupM x xs = case lookupM x xs of Nothing -> S.empty Just y -> S.singleton y
172
lookupAllUsingLookupM x xs = case lookupM x xs of Nothing -> S.empty Just y -> S.singleton y
103
false
true
3
8
40
75
36
39
null
null
rolph-recto/liquid-fixpoint
src/Language/Fixpoint/SortCheck.hs
bsd-3-clause
isFirstOrder :: Sort -> Bool ------------------------------------------------------------------------- isFirstOrder (FAbs _ t) = isFirstOrder t
146
isFirstOrder :: Sort -> Bool isFirstOrder (FAbs _ t) = isFirstOrder t
72
isFirstOrder (FAbs _ t) = isFirstOrder t
43
true
true
0
7
15
30
15
15
null
null
Alexander-Ignatyev/linalg-benchmarks
hmatrix/app/Main.hs
bsd-3-clause
reduceByColumns :: (Vector -> R) -> Matrix -> Matrix reduceByColumns f = LA.asRow . reduceByColumnsV f
102
reduceByColumns :: (Vector -> R) -> Matrix -> Matrix reduceByColumns f = LA.asRow . reduceByColumnsV f
102
reduceByColumns f = LA.asRow . reduceByColumnsV f
49
false
true
0
7
15
38
19
19
null
null
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribeNetworkAcls.hs
mpl-2.0
-- | One or more network ACL IDs. -- -- Default: Describes all your network ACLs. dna1NetworkAclIds :: Lens' DescribeNetworkAcls [Text] dna1NetworkAclIds = lens _dna1NetworkAclIds (\s a -> s { _dna1NetworkAclIds = a }) . _List
238
dna1NetworkAclIds :: Lens' DescribeNetworkAcls [Text] dna1NetworkAclIds = lens _dna1NetworkAclIds (\s a -> s { _dna1NetworkAclIds = a }) . _List
156
dna1NetworkAclIds = lens _dna1NetworkAclIds (\s a -> s { _dna1NetworkAclIds = a }) . _List
102
true
true
0
10
47
49
28
21
null
null
Copilot-Language/sbv-for-copilot
SBVUnitTest/TestSuite/CRC/CCITT_Unidir.hs
bsd-3-clause
-- Test suite testSuite :: SBVTestSuite testSuite = mkTestSuite $ \_ -> test [ "ccitHDis3" ~: assert =<< isThm (crcUniGood 3) , "ccitHDis4" ~: assert . not =<< isThm (crcUniGood 4) ]
193
testSuite :: SBVTestSuite testSuite = mkTestSuite $ \_ -> test [ "ccitHDis3" ~: assert =<< isThm (crcUniGood 3) , "ccitHDis4" ~: assert . not =<< isThm (crcUniGood 4) ]
179
testSuite = mkTestSuite $ \_ -> test [ "ccitHDis3" ~: assert =<< isThm (crcUniGood 3) , "ccitHDis4" ~: assert . not =<< isThm (crcUniGood 4) ]
153
true
true
2
11
42
75
36
39
null
null
centromere/cacophony
tests/vectors/Types.hs
unlicense
patternToHandshake PatternX1X = noiseX1X
43
patternToHandshake PatternX1X = noiseX1X
43
patternToHandshake PatternX1X = noiseX1X
43
false
false
0
5
6
9
4
5
null
null
keera-studios/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qCastList_QProgressBar x = qcl_QProgressBar [] x
48
qCastList_QProgressBar x = qcl_QProgressBar [] x
48
qCastList_QProgressBar x = qcl_QProgressBar [] x
48
false
false
0
6
5
16
7
9
null
null
balangs/eTeak
src/Report.hs
bsd-3-clause
whyToPair :: Why a -> (Completeness, a) whyToPair (Why comp ret) = (comp, ret)
82
whyToPair :: Why a -> (Completeness, a) whyToPair (Why comp ret) = (comp, ret)
78
whyToPair (Why comp ret) = (comp, ret)
38
false
true
0
7
17
41
22
19
null
null
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/Compatibility/Tokens.hs
bsd-3-clause
gl_ORDER :: GLenum gl_ORDER = 0x0A01
36
gl_ORDER :: GLenum gl_ORDER = 0x0A01
36
gl_ORDER = 0x0A01
17
false
true
0
4
5
11
6
5
null
null
Tarrasch/Hong
Fal/Fal.hs
bsd-3-clause
untilB' :: Behavior a -> Event (a -> Behavior a) -> Behavior a Behavior fb `untilB'` Event fe = memoB $ Behavior (\uts@(us,ts) -> loop us ts (fe uts) (fb uts)) where loop (_:us) (_:ts) ~(e:es) (b:bs) = b : case e of Nothing -> loop us ts es bs Just (f_fb') -> runBehavior (f_fb' b) (us,ts)
348
untilB' :: Behavior a -> Event (a -> Behavior a) -> Behavior a Behavior fb `untilB'` Event fe = memoB $ Behavior (\uts@(us,ts) -> loop us ts (fe uts) (fb uts)) where loop (_:us) (_:ts) ~(e:es) (b:bs) = b : case e of Nothing -> loop us ts es bs Just (f_fb') -> runBehavior (f_fb' b) (us,ts)
348
Behavior fb `untilB'` Event fe = memoB $ Behavior (\uts@(us,ts) -> loop us ts (fe uts) (fb uts)) where loop (_:us) (_:ts) ~(e:es) (b:bs) = b : case e of Nothing -> loop us ts es bs Just (f_fb') -> runBehavior (f_fb' b) (us,ts)
285
false
true
0
13
115
194
98
96
null
null
nevrenato/Hets_Fork
CASL/CompositionTable/ModelChecker.hs
gpl-2.0
getIdentifierForSymbAtomar :: OP_SYMB -> (OP_SYMB, String) -> String getIdentifierForSymbAtomar symb (symb2, s) = if symb == symb2 then s else ""
145
getIdentifierForSymbAtomar :: OP_SYMB -> (OP_SYMB, String) -> String getIdentifierForSymbAtomar symb (symb2, s) = if symb == symb2 then s else ""
145
getIdentifierForSymbAtomar symb (symb2, s) = if symb == symb2 then s else ""
76
false
true
0
7
20
48
27
21
null
null
spacekitteh/compdata
benchmark/Functions/Standard/FreeVars.hs
bsd-3-clause
contVar :: Int -> PExpr -> Bool contVar v e = case e of PInt i -> i == v PBool{} -> False PPair x y -> re x || re y PPlus x y -> re x || re y PMult x y -> re x || re y PIf x y z -> re x || re y || re z PEq x y -> re x || re y PLt x y -> re x || re y PAnd x y -> re x || re y PNot x -> re x PProj _ x -> re x PNeg x -> re x PMinus x y -> re x || re y PGt x y -> re x || re y POr x y -> re x || re y PImpl x y -> re x || re y where re = contVar v
549
contVar :: Int -> PExpr -> Bool contVar v e = case e of PInt i -> i == v PBool{} -> False PPair x y -> re x || re y PPlus x y -> re x || re y PMult x y -> re x || re y PIf x y z -> re x || re y || re z PEq x y -> re x || re y PLt x y -> re x || re y PAnd x y -> re x || re y PNot x -> re x PProj _ x -> re x PNeg x -> re x PMinus x y -> re x || re y PGt x y -> re x || re y POr x y -> re x || re y PImpl x y -> re x || re y where re = contVar v
549
contVar v e = case e of PInt i -> i == v PBool{} -> False PPair x y -> re x || re y PPlus x y -> re x || re y PMult x y -> re x || re y PIf x y z -> re x || re y || re z PEq x y -> re x || re y PLt x y -> re x || re y PAnd x y -> re x || re y PNot x -> re x PProj _ x -> re x PNeg x -> re x PMinus x y -> re x || re y PGt x y -> re x || re y POr x y -> re x || re y PImpl x y -> re x || re y where re = contVar v
517
false
true
0
10
251
344
150
194
null
null
davmre/matrizer
src/Matrizer/Optimization.hs
gpl-2.0
goUp (t, RhsCrumb lhs tmp body : bs) = Right (Let lhs t tmp body, bs)
69
goUp (t, RhsCrumb lhs tmp body : bs) = Right (Let lhs t tmp body, bs)
69
goUp (t, RhsCrumb lhs tmp body : bs) = Right (Let lhs t tmp body, bs)
69
false
false
0
7
15
45
22
23
null
null
elitallman/postgrest
src/PostgREST/PgQuery.hs
mit
pgFmtLit :: T.Text -> T.Text pgFmtLit x = let trimmed = trimNullChars x escaped = "'" <> T.replace "'" "''" trimmed <> "'" slashed = T.replace "\\" "\\\\" escaped in if T.isInfixOf "\\\\" escaped then "E" <> slashed else slashed
252
pgFmtLit :: T.Text -> T.Text pgFmtLit x = let trimmed = trimNullChars x escaped = "'" <> T.replace "'" "''" trimmed <> "'" slashed = T.replace "\\" "\\\\" escaped in if T.isInfixOf "\\\\" escaped then "E" <> slashed else slashed
252
pgFmtLit x = let trimmed = trimNullChars x escaped = "'" <> T.replace "'" "''" trimmed <> "'" slashed = T.replace "\\" "\\\\" escaped in if T.isInfixOf "\\\\" escaped then "E" <> slashed else slashed
223
false
true
0
12
63
97
46
51
null
null
miguel-negrao/iCalendar
Text/ICalendar/Parser/Properties.hs
bsd-3-clause
-- | Parse organizer. 3.8.4.3 parseOrganizer :: Content -> ContentParser Organizer parseOrganizer (ContentLine _ "ORGANIZER" o bs) = do organizerValue <- parseURI =<< asks (T.unpack . ($ bs) . dfBS2Text) organizerCN <- mapM paramOnlyOne $ lookup "CN" o organizerDir <- mapM (parseURI . T.unpack <=< paramOnlyOne) $ lookup "DIR" o organizerSentBy <- mapM (parseURI . T.unpack <=< paramOnlyOne) $ lookup "SENT-BY" o organizerLanguage <- mapM (Language . CI.mk .: paramOnlyOne) $ lookup "LANGUAGE" o let f x = x `notElem` ["CN", "DIR", "SENT-BY", "LANGUAGE"] o' = filter (f . fst) o return Organizer { organizerOther = toO o', .. }
680
parseOrganizer :: Content -> ContentParser Organizer parseOrganizer (ContentLine _ "ORGANIZER" o bs) = do organizerValue <- parseURI =<< asks (T.unpack . ($ bs) . dfBS2Text) organizerCN <- mapM paramOnlyOne $ lookup "CN" o organizerDir <- mapM (parseURI . T.unpack <=< paramOnlyOne) $ lookup "DIR" o organizerSentBy <- mapM (parseURI . T.unpack <=< paramOnlyOne) $ lookup "SENT-BY" o organizerLanguage <- mapM (Language . CI.mk .: paramOnlyOne) $ lookup "LANGUAGE" o let f x = x `notElem` ["CN", "DIR", "SENT-BY", "LANGUAGE"] o' = filter (f . fst) o return Organizer { organizerOther = toO o', .. }
650
parseOrganizer (ContentLine _ "ORGANIZER" o bs) = do organizerValue <- parseURI =<< asks (T.unpack . ($ bs) . dfBS2Text) organizerCN <- mapM paramOnlyOne $ lookup "CN" o organizerDir <- mapM (parseURI . T.unpack <=< paramOnlyOne) $ lookup "DIR" o organizerSentBy <- mapM (parseURI . T.unpack <=< paramOnlyOne) $ lookup "SENT-BY" o organizerLanguage <- mapM (Language . CI.mk .: paramOnlyOne) $ lookup "LANGUAGE" o let f x = x `notElem` ["CN", "DIR", "SENT-BY", "LANGUAGE"] o' = filter (f . fst) o return Organizer { organizerOther = toO o', .. }
597
true
true
0
13
151
251
123
128
null
null
DavidAlphaFox/ghc
libraries/Cabal/Cabal/tests/PackageTests/PreProcess/Check.hs
bsd-3-clause
suite :: FilePath -> Test suite ghcPath = TestCase $ do let spec = PackageSpec { directory = "PackageTests" </> "PreProcess" , distPref = Nothing , configOpts = ["--enable-tests", "--enable-benchmarks"] } result <- cabal_build spec ghcPath assertBuildSucceeded result
327
suite :: FilePath -> Test suite ghcPath = TestCase $ do let spec = PackageSpec { directory = "PackageTests" </> "PreProcess" , distPref = Nothing , configOpts = ["--enable-tests", "--enable-benchmarks"] } result <- cabal_build spec ghcPath assertBuildSucceeded result
327
suite ghcPath = TestCase $ do let spec = PackageSpec { directory = "PackageTests" </> "PreProcess" , distPref = Nothing , configOpts = ["--enable-tests", "--enable-benchmarks"] } result <- cabal_build spec ghcPath assertBuildSucceeded result
301
false
true
0
14
97
85
42
43
null
null
silky/csound-expression
src/Csound/Air/Envelope.hs
bsd-3-clause
-- | Step sequencer with unipolar exponential sawtooth. xsawSeq :: [Sig] -> Sig -> Sig xsawSeq = genSeq loopxseg sawList
120
xsawSeq :: [Sig] -> Sig -> Sig xsawSeq = genSeq loopxseg sawList
64
xsawSeq = genSeq loopxseg sawList
33
true
true
0
6
19
28
15
13
null
null
thomasbrus/imperia
src/Language/Imperia/Parser.hs
mit
expressions :: Parser Expression expressions = do list <- choice [ many1 expression, do { eof; return [] } ] return $ if length list == 1 then head list else Sequencing list
177
expressions :: Parser Expression expressions = do list <- choice [ many1 expression, do { eof; return [] } ] return $ if length list == 1 then head list else Sequencing list
177
expressions = do list <- choice [ many1 expression, do { eof; return [] } ] return $ if length list == 1 then head list else Sequencing list
144
false
true
0
14
36
81
37
44
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/floatRadix_1.hs
mit
fromIntInteger :: MyInt -> Integer fromIntInteger x = Integer x
65
fromIntInteger :: MyInt -> Integer fromIntInteger x = Integer x
65
fromIntInteger x = Integer x
28
false
true
0
5
11
21
10
11
null
null
benkolera/talk-stacking-your-monads
code-classy/Main.hs
mit
appErrorString :: AppError -> String appErrorString (AppDbError db) = dbErrorString db
88
appErrorString :: AppError -> String appErrorString (AppDbError db) = dbErrorString db
88
appErrorString (AppDbError db) = dbErrorString db
51
false
true
0
7
12
27
13
14
null
null
gbwey/persistentold
persistent/Database/Persist/Sql/Migration.hs
mit
safeSql :: CautiousMigration -> [Sql] safeSql = allSql . filter (not . fst)
75
safeSql :: CautiousMigration -> [Sql] safeSql = allSql . filter (not . fst)
75
safeSql = allSql . filter (not . fst)
37
false
true
0
8
12
38
18
20
null
null
apyrgio/snf-ganeti
src/Ganeti/Utils.hs
bsd-2-clause
exitWhen False _ = return ()
29
exitWhen False _ = return ()
29
exitWhen False _ = return ()
29
false
false
0
6
6
16
7
9
null
null
tibbe/event
src/System/Event/IntMap.hs
bsd-2-clause
zeroN :: Nat -> Nat -> Bool zeroN i m = (i .&. m) == 0
54
zeroN :: Nat -> Nat -> Bool zeroN i m = (i .&. m) == 0
54
zeroN i m = (i .&. m) == 0
26
false
true
0
7
15
40
19
21
null
null
DarrenMowat/blackbox
tests/results/TypeLineTests.hs
unlicense
-- Testing Type Signature Insertion is a bit thin -- As Blackbox doesn't really do much work in this for this at all -- All that needs tested is the ability to extract the function name -- And put a signature on the front of it in the token stream {-Exected Type :: User -> String -} test0 :: User -> [Char] test0 (Student s i ss) = s ++ ss
342
test0 :: User -> [Char] test0 (Student s i ss) = s ++ ss
56
test0 (Student s i ss) = s ++ ss
32
true
true
2
9
72
47
24
23
null
null
kaoskorobase/mescaline
resources/hugs/packages/hugsbase/Hugs/GenericPrint.hs
gpl-3.0
nameError = cellName error
29
nameError = cellName error
29
nameError = cellName error
29
false
false
1
5
6
13
4
9
null
null
chpatrick/hchip
HChip/ALU.hs
mit
genShifts oo m f = [ i (0xB0 + oo) m (r x // imm) (updateImm f) , i (0xB4 + oo) m (r x // r y) (updateReg f) ]
117
genShifts oo m f = [ i (0xB0 + oo) m (r x // imm) (updateImm f) , i (0xB4 + oo) m (r x // r y) (updateReg f) ]
117
genShifts oo m f = [ i (0xB0 + oo) m (r x // imm) (updateImm f) , i (0xB4 + oo) m (r x // r y) (updateReg f) ]
117
false
false
1
10
37
92
43
49
null
null
balodja/sesyrel
src/Sesyrel/FaultTree/Elimination.hs
bsd-3-clause
getNextVertex :: (Variable -> Int) -> Set Variable -> Variable getNextVertex f vs = let costs = S.mapMonotonic (\v -> (v, f v)) vs in fst $ minimumBy (compare `on` snd) costs
195
getNextVertex :: (Variable -> Int) -> Set Variable -> Variable getNextVertex f vs = let costs = S.mapMonotonic (\v -> (v, f v)) vs in fst $ minimumBy (compare `on` snd) costs
195
getNextVertex f vs = let costs = S.mapMonotonic (\v -> (v, f v)) vs in fst $ minimumBy (compare `on` snd) costs
132
false
true
0
13
52
87
45
42
null
null
ml9951/ghc
compiler/main/DynFlags.hs
bsd-3-clause
ignorePackage p = upd (\s -> s{ packageFlags = IgnorePackage p : packageFlags s })
84
ignorePackage p = upd (\s -> s{ packageFlags = IgnorePackage p : packageFlags s })
84
ignorePackage p = upd (\s -> s{ packageFlags = IgnorePackage p : packageFlags s })
84
false
false
1
11
16
42
19
23
null
null
mcmaniac/ghc
compiler/main/DynFlags.hs
bsd-3-clause
updM :: (DynFlags -> DynP DynFlags) -> DynP () updM f = do dflags <- liftEwM getCmdLineState dflags' <- f dflags liftEwM $ putCmdLineState $! dflags' --------------- Constructor functions for OptKind -----------------
242
updM :: (DynFlags -> DynP DynFlags) -> DynP () updM f = do dflags <- liftEwM getCmdLineState dflags' <- f dflags liftEwM $ putCmdLineState $! dflags' --------------- Constructor functions for OptKind -----------------
242
updM f = do dflags <- liftEwM getCmdLineState dflags' <- f dflags liftEwM $ putCmdLineState $! dflags' --------------- Constructor functions for OptKind -----------------
195
false
true
0
9
56
70
31
39
null
null
keera-studios/hsQt
Qtc/Gui/QPrinter.hs
bsd-2-clause
setOutputFormat :: QPrinter a -> ((OutputFormat)) -> IO () setOutputFormat x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QPrinter_setOutputFormat cobj_x0 (toCLong $ qEnum_toInt x1)
185
setOutputFormat :: QPrinter a -> ((OutputFormat)) -> IO () setOutputFormat x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QPrinter_setOutputFormat cobj_x0 (toCLong $ qEnum_toInt x1)
185
setOutputFormat x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QPrinter_setOutputFormat cobj_x0 (toCLong $ qEnum_toInt x1)
126
false
true
0
10
29
72
35
37
null
null
ivendrov/cipher-combinators
Main/Block.hs
mit
ciphertext = concat . decrypt (cfb cipher 3 iv) . chop 3 $ plaintext
68
ciphertext = concat . decrypt (cfb cipher 3 iv) . chop 3 $ plaintext
68
ciphertext = concat . decrypt (cfb cipher 3 iv) . chop 3 $ plaintext
68
false
false
0
10
13
34
16
18
null
null
GRACeFUL-project/haskelzinc
src/Interfaces/MZPrinter.hs
bsd-3-clause
printSolve :: Solve -> Doc printSolve (Satisfy ans ) = printAnnotations ans <+> text "satisfy"
96
printSolve :: Solve -> Doc printSolve (Satisfy ans ) = printAnnotations ans <+> text "satisfy"
96
printSolve (Satisfy ans ) = printAnnotations ans <+> text "satisfy"
69
false
true
0
7
16
34
16
18
null
null
andrey013/pluginstest
Plugins/Gloss/DiagramsBackend.hs
mit
initialGlossRenderState = GlossRenderState (G.makeColor 0 0 0 1) (G.makeColor 1 1 1 0) 0.01 LineCapButt LineJoinMiter GL.TessWindingNonzero [] 0 [] 1
429
initialGlossRenderState = GlossRenderState (G.makeColor 0 0 0 1) (G.makeColor 1 1 1 0) 0.01 LineCapButt LineJoinMiter GL.TessWindingNonzero [] 0 [] 1
429
initialGlossRenderState = GlossRenderState (G.makeColor 0 0 0 1) (G.makeColor 1 1 1 0) 0.01 LineCapButt LineJoinMiter GL.TessWindingNonzero [] 0 [] 1
429
false
false
1
8
300
64
30
34
null
null
AndreasVoellmy/openflow
src/Network/Data/OF13/Message.hs
bsd-3-clause
toField False 17 = (\x -> OXM { oxmOFField = SCTPSrc x, oxmHasMask = False }) <$> getWord16be
93
toField False 17 = (\x -> OXM { oxmOFField = SCTPSrc x, oxmHasMask = False }) <$> getWord16be
93
toField False 17 = (\x -> OXM { oxmOFField = SCTPSrc x, oxmHasMask = False }) <$> getWord16be
93
false
false
0
10
17
40
22
18
null
null
adizere/nifty-tree
src/Streamer/HTTPClient.hs
mit
validateFrameResponse :: Result (H.Response L.ByteString) -> IO Bool validateFrameResponse rsp = do responseCode <- H.getResponseCode rsp if responseCode == (2,0,0) then return True else return False
223
validateFrameResponse :: Result (H.Response L.ByteString) -> IO Bool validateFrameResponse rsp = do responseCode <- H.getResponseCode rsp if responseCode == (2,0,0) then return True else return False
223
validateFrameResponse rsp = do responseCode <- H.getResponseCode rsp if responseCode == (2,0,0) then return True else return False
154
false
true
0
9
49
76
37
39
null
null
kfiz/IHaskell
ipython-kernel/src/IHaskell/IPython/Message/Parser.hs
mit
outputMessageParser :: LByteString -> Message outputMessageParser = requestParser $ \obj -> do -- Handle both "data" and "text" keys maybeDataDict1 :: Maybe Object <- obj .:? "data" let displayDatas1 = getDisplayDatas maybeDataDict1 maybeDataDict2 :: Maybe Object <- obj .:? "text" let displayDatas2 = getDisplayDatas maybeDataDict2 executionCount <- obj .: "execution_count" return $ Output noHeader (displayDatas1 ++ displayDatas2) executionCount
464
outputMessageParser :: LByteString -> Message outputMessageParser = requestParser $ \obj -> do -- Handle both "data" and "text" keys maybeDataDict1 :: Maybe Object <- obj .:? "data" let displayDatas1 = getDisplayDatas maybeDataDict1 maybeDataDict2 :: Maybe Object <- obj .:? "text" let displayDatas2 = getDisplayDatas maybeDataDict2 executionCount <- obj .: "execution_count" return $ Output noHeader (displayDatas1 ++ displayDatas2) executionCount
464
outputMessageParser = requestParser $ \obj -> do -- Handle both "data" and "text" keys maybeDataDict1 :: Maybe Object <- obj .:? "data" let displayDatas1 = getDisplayDatas maybeDataDict1 maybeDataDict2 :: Maybe Object <- obj .:? "text" let displayDatas2 = getDisplayDatas maybeDataDict2 executionCount <- obj .: "execution_count" return $ Output noHeader (displayDatas1 ++ displayDatas2) executionCount
418
false
true
0
12
73
117
55
62
null
null
fmapfmapfmap/amazonka
amazonka-redshift/gen/Network/AWS/Redshift/RestoreFromClusterSnapshot.hs
mpl-2.0
-- | Undocumented member. rfcsrsCluster :: Lens' RestoreFromClusterSnapshotResponse (Maybe Cluster) rfcsrsCluster = lens _rfcsrsCluster (\ s a -> s{_rfcsrsCluster = a})
168
rfcsrsCluster :: Lens' RestoreFromClusterSnapshotResponse (Maybe Cluster) rfcsrsCluster = lens _rfcsrsCluster (\ s a -> s{_rfcsrsCluster = a})
142
rfcsrsCluster = lens _rfcsrsCluster (\ s a -> s{_rfcsrsCluster = a})
68
true
true
1
9
20
49
25
24
null
null
ony/hledger
hledger/Hledger/Cli/Commands/Registermatch.hs
gpl-3.0
compareStrings "" (_:[]) = 0
28
compareStrings "" (_:[]) = 0
28
compareStrings "" (_:[]) = 0
28
false
false
0
8
4
20
10
10
null
null
ingemaradahl/bilder
src/Compiler/Clean.hs
lgpl-3.0
stmDeps (SIfElse e trues falses) = expDeps e ++ concatMap stmDeps (trues ++ falses)
83
stmDeps (SIfElse e trues falses) = expDeps e ++ concatMap stmDeps (trues ++ falses)
83
stmDeps (SIfElse e trues falses) = expDeps e ++ concatMap stmDeps (trues ++ falses)
83
false
false
0
8
13
38
18
20
null
null
opentower/carnap
Carnap/src/Carnap/Core/Unification/Combination.hs
gpl-3.0
castOut:: (MonadVar f m, Typeable a, Typeable b, EtaExpand f b, Combineable f label) => f b -> f a -> m (f a, Equation f) castOut x y = do v <- fresh --replace x with v in y let y' = subst x v y return (y', v :=: x) --given a system of equations, returns an equivalent system of --pureEquations (in which every equation contains only terms from a single --theory), with no redundant equations.
445
castOut:: (MonadVar f m, Typeable a, Typeable b, EtaExpand f b, Combineable f label) => f b -> f a -> m (f a, Equation f) castOut x y = do v <- fresh --replace x with v in y let y' = subst x v y return (y', v :=: x) --given a system of equations, returns an equivalent system of --pureEquations (in which every equation contains only terms from a single --theory), with no redundant equations.
445
castOut x y = do v <- fresh --replace x with v in y let y' = subst x v y return (y', v :=: x) --given a system of equations, returns an equivalent system of --pureEquations (in which every equation contains only terms from a single --theory), with no redundant equations.
323
false
true
0
11
129
132
64
68
null
null
banacorn/agda-language-server
src/Control/Concurrent/SizedChan.hs
mit
isEmptySizedChan :: SizedChan a -> IO Bool isEmptySizedChan chan = do size <- measureSizedChan chan return $ size == 0
122
isEmptySizedChan :: SizedChan a -> IO Bool isEmptySizedChan chan = do size <- measureSizedChan chan return $ size == 0
122
isEmptySizedChan chan = do size <- measureSizedChan chan return $ size == 0
79
false
true
0
8
23
45
20
25
null
null
harendra-kumar/stack
src/test/Stack/ConfigSpec.hs
bsd-3-clause
setup :: IO T setup = do manager <- newTLSManager unsetEnv "STACK_YAML" return T{..}
90
setup :: IO T setup = do manager <- newTLSManager unsetEnv "STACK_YAML" return T{..}
90
setup = do manager <- newTLSManager unsetEnv "STACK_YAML" return T{..}
76
false
true
0
8
19
38
17
21
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F21.hs
bsd-3-clause
-- glProgramUniform3i64NV ------------------------------------------------------ glProgramUniform3i64NV :: MonadIO m => GLuint -- ^ @program@. -> GLint -- ^ @location@. -> GLint64EXT -- ^ @x@. -> GLint64EXT -- ^ @y@. -> GLint64EXT -- ^ @z@. -> m () glProgramUniform3i64NV v1 v2 v3 v4 v5 = liftIO $ dyn692 ptr_glProgramUniform3i64NV v1 v2 v3 v4 v5
361
glProgramUniform3i64NV :: MonadIO m => GLuint -- ^ @program@. -> GLint -- ^ @location@. -> GLint64EXT -- ^ @x@. -> GLint64EXT -- ^ @y@. -> GLint64EXT -- ^ @z@. -> m () glProgramUniform3i64NV v1 v2 v3 v4 v5 = liftIO $ dyn692 ptr_glProgramUniform3i64NV v1 v2 v3 v4 v5
279
glProgramUniform3i64NV v1 v2 v3 v4 v5 = liftIO $ dyn692 ptr_glProgramUniform3i64NV v1 v2 v3 v4 v5
97
true
true
0
13
65
81
41
40
null
null
alexander-at-github/eta
compiler/ETA/Rename/RnTypes.hs
bsd-3-clause
filterInScope :: LocalRdrEnv -> FreeKiTyVars -> FreeKiTyVars filterInScope rdr_env (kvs, tvs) = (filterOut in_scope kvs, filterOut in_scope tvs) where in_scope tv = tv `elemLocalRdrEnv` rdr_env
201
filterInScope :: LocalRdrEnv -> FreeKiTyVars -> FreeKiTyVars filterInScope rdr_env (kvs, tvs) = (filterOut in_scope kvs, filterOut in_scope tvs) where in_scope tv = tv `elemLocalRdrEnv` rdr_env
201
filterInScope rdr_env (kvs, tvs) = (filterOut in_scope kvs, filterOut in_scope tvs) where in_scope tv = tv `elemLocalRdrEnv` rdr_env
140
false
true
0
6
32
62
33
29
null
null
brendanhay/gogol
gogol-pubsub/gen/Network/Google/Resource/PubSub/Projects/Subscriptions/Create.hs
mpl-2.0
-- | Creates a value of 'ProjectsSubscriptionsCreate' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'pscXgafv' -- -- * 'pscUploadProtocol' -- -- * 'pscAccessToken' -- -- * 'pscUploadType' -- -- * 'pscPayload' -- -- * 'pscName' -- -- * 'pscCallback' projectsSubscriptionsCreate :: Subscription -- ^ 'pscPayload' -> Text -- ^ 'pscName' -> ProjectsSubscriptionsCreate projectsSubscriptionsCreate pPscPayload_ pPscName_ = ProjectsSubscriptionsCreate' { _pscXgafv = Nothing , _pscUploadProtocol = Nothing , _pscAccessToken = Nothing , _pscUploadType = Nothing , _pscPayload = pPscPayload_ , _pscName = pPscName_ , _pscCallback = Nothing }
766
projectsSubscriptionsCreate :: Subscription -- ^ 'pscPayload' -> Text -- ^ 'pscName' -> ProjectsSubscriptionsCreate projectsSubscriptionsCreate pPscPayload_ pPscName_ = ProjectsSubscriptionsCreate' { _pscXgafv = Nothing , _pscUploadProtocol = Nothing , _pscAccessToken = Nothing , _pscUploadType = Nothing , _pscPayload = pPscPayload_ , _pscName = pPscName_ , _pscCallback = Nothing }
430
projectsSubscriptionsCreate pPscPayload_ pPscName_ = ProjectsSubscriptionsCreate' { _pscXgafv = Nothing , _pscUploadProtocol = Nothing , _pscAccessToken = Nothing , _pscUploadType = Nothing , _pscPayload = pPscPayload_ , _pscName = pPscName_ , _pscCallback = Nothing }
302
true
true
0
6
150
87
60
27
null
null
RossMeikleham/AI
src/AI/Lab1/Lab1.hs
mit
-- Inside the Window -- Apply convolution to a signal with a window -- of given length in milliseconds convolute :: VU.Vector Int -> Int -> VU.Vector Int convolute signal win_sz = VU.map y $ VU.fromList [0..(numSamples - 1)] where y :: Int -> Int y n = VU.foldl' (+) 0 $ -- Sum the results -- s[k] * w[n - k] VU.map (\k -> (signal VU.! k) * (rectWindow win_sz_samples (n - k))) $ -- k values VU.fromList [(max (n - win_sz_samples + 1) 0) .. (min n (numSamples - 1))] -- k values -- Number of samples in the Window of win_sz milliseconds win_sz_samples = (numSamples `div` samplingTime) * win_sz -- Total number of samples supplied to the convolution function numSamples = VU.length signal -- Calculate energy for a given signal with a window -- of given length in milliseconds
998
convolute :: VU.Vector Int -> Int -> VU.Vector Int convolute signal win_sz = VU.map y $ VU.fromList [0..(numSamples - 1)] where y :: Int -> Int y n = VU.foldl' (+) 0 $ -- Sum the results -- s[k] * w[n - k] VU.map (\k -> (signal VU.! k) * (rectWindow win_sz_samples (n - k))) $ -- k values VU.fromList [(max (n - win_sz_samples + 1) 0) .. (min n (numSamples - 1))] -- k values -- Number of samples in the Window of win_sz milliseconds win_sz_samples = (numSamples `div` samplingTime) * win_sz -- Total number of samples supplied to the convolution function numSamples = VU.length signal -- Calculate energy for a given signal with a window -- of given length in milliseconds
893
convolute signal win_sz = VU.map y $ VU.fromList [0..(numSamples - 1)] where y :: Int -> Int y n = VU.foldl' (+) 0 $ -- Sum the results -- s[k] * w[n - k] VU.map (\k -> (signal VU.! k) * (rectWindow win_sz_samples (n - k))) $ -- k values VU.fromList [(max (n - win_sz_samples + 1) 0) .. (min n (numSamples - 1))] -- k values -- Number of samples in the Window of win_sz milliseconds win_sz_samples = (numSamples `div` samplingTime) * win_sz -- Total number of samples supplied to the convolution function numSamples = VU.length signal -- Calculate energy for a given signal with a window -- of given length in milliseconds
842
true
true
1
14
363
234
123
111
null
null
tanimoto/bart
src/Bart/Departure/Parser.hs
bsd-3-clause
parseDepart :: C.MonadThrow m => Pipe Event Event o u m (Maybe Depart) parseDepart = do withDef $ ptag "root" $ do uri <- text "uri" date <- text "date" time <- text "time" stns <- many parseStation msg <- text "message" return $ Depart <$> uri <*> date <*> time <*> Just stns <*> msg
346
parseDepart :: C.MonadThrow m => Pipe Event Event o u m (Maybe Depart) parseDepart = do withDef $ ptag "root" $ do uri <- text "uri" date <- text "date" time <- text "time" stns <- many parseStation msg <- text "message" return $ Depart <$> uri <*> date <*> time <*> Just stns <*> msg
346
parseDepart = do withDef $ ptag "root" $ do uri <- text "uri" date <- text "date" time <- text "time" stns <- many parseStation msg <- text "message" return $ Depart <$> uri <*> date <*> time <*> Just stns <*> msg
271
false
true
0
15
117
137
60
77
null
null
Alasdair/Mella
Lang/Term/Tokenizer.hs
bsd-3-clause
tokenize' :: [Operator] -> Parser [Token] tokenize' ops = do toks <- many (skipSpace >> token ops) skipSpace >> endOfInput return toks
146
tokenize' :: [Operator] -> Parser [Token] tokenize' ops = do toks <- many (skipSpace >> token ops) skipSpace >> endOfInput return toks
146
tokenize' ops = do toks <- many (skipSpace >> token ops) skipSpace >> endOfInput return toks
104
false
true
0
11
33
60
28
32
null
null
tabemann/amphibian
src_old/Network/IRC/Client/Amphibian/Commands.hs
bsd-3-clause
rpl_ENDOFINVITELIST :: MessageCommand rpl_ENDOFINVITELIST = "347"
65
rpl_ENDOFINVITELIST :: MessageCommand rpl_ENDOFINVITELIST = "347"
65
rpl_ENDOFINVITELIST = "347"
27
false
true
0
4
5
11
6
5
null
null
roberth/uu-helium
test/correct/PMC2.hs
gpl-3.0
const2 :: a -> b -> a const2 x y = x
36
const2 :: a -> b -> a const2 x y = x
36
const2 x y = x
14
false
true
0
8
11
30
13
17
null
null
simonmar/Haxl
Haxl/Core/Profile.hs
bsd-3-clause
-- | Collect profiling data and attribute it to given label. collectProfileData :: ProfileLabel -> (Env u -> IO (Result u a)) -> Env u -> IO (Result u a) collectProfileData l m env = do a0 <- getAllocationCounter r <- m env{profLabel=l} -- what if it throws? a1 <- getAllocationCounter modifyProfileData env l (a0 - a1) -- So we do not count the allocation overhead of modifyProfileData setAllocationCounter a1 case r of Done a -> return (Done a) Throw e -> return (Throw e) Blocked ivar k -> return (Blocked ivar (Cont (withLabel l (toHaxl k))))
591
collectProfileData :: ProfileLabel -> (Env u -> IO (Result u a)) -> Env u -> IO (Result u a) collectProfileData l m env = do a0 <- getAllocationCounter r <- m env{profLabel=l} -- what if it throws? a1 <- getAllocationCounter modifyProfileData env l (a0 - a1) -- So we do not count the allocation overhead of modifyProfileData setAllocationCounter a1 case r of Done a -> return (Done a) Throw e -> return (Throw e) Blocked ivar k -> return (Blocked ivar (Cont (withLabel l (toHaxl k))))
530
collectProfileData l m env = do a0 <- getAllocationCounter r <- m env{profLabel=l} -- what if it throws? a1 <- getAllocationCounter modifyProfileData env l (a0 - a1) -- So we do not count the allocation overhead of modifyProfileData setAllocationCounter a1 case r of Done a -> return (Done a) Throw e -> return (Throw e) Blocked ivar k -> return (Blocked ivar (Cont (withLabel l (toHaxl k))))
429
true
true
0
18
141
212
99
113
null
null
pparkkin/eta
compiler/ETA/Iface/IfaceEnv.hs
bsd-3-clause
newIfaceNames :: [OccName] -> IfL [Name] newIfaceNames occs = do { uniqs <- newUniqueSupply ; return [ mkInternalName uniq occ noSrcSpan | (occ,uniq) <- occs `zip` uniqsFromSupply uniqs] }
216
newIfaceNames :: [OccName] -> IfL [Name] newIfaceNames occs = do { uniqs <- newUniqueSupply ; return [ mkInternalName uniq occ noSrcSpan | (occ,uniq) <- occs `zip` uniqsFromSupply uniqs] }
216
newIfaceNames occs = do { uniqs <- newUniqueSupply ; return [ mkInternalName uniq occ noSrcSpan | (occ,uniq) <- occs `zip` uniqsFromSupply uniqs] }
175
false
true
0
12
56
76
40
36
null
null
micknelso/language-c
src/Language/CFamily/C/Analysis/AstAnalysis.hs
bsd-3-clause
-- | Analyse a function definition analyseFunDef :: (MonadTrav m) => CFunDef -> m () analyseFunDef (CFunDef declspecs declr oldstyle_decls stmt node_info) = do -- analyse the declarator var_decl_info <- analyseVarDecl' True declspecs declr oldstyle_decls Nothing let (VarDeclInfo name is_inline storage_spec attrs ty _) = var_decl_info when (isNoName name) $ astError node_info "NoName in analyseFunDef" let ident = identOfVarName name -- improve incomplete type ty' <- improveFunDefType ty -- compute storage fun_storage <- computeFunDefStorage ident storage_spec let var_decl = VarDecl name (DeclAttrs is_inline fun_storage attrs) ty' -- callback for declaration handleVarDecl False (Decl var_decl node_info) -- process body stmt' <- analyseFunctionBody node_info var_decl stmt -- callback for definition handleFunDef ident (FunDef var_decl stmt' node_info) where improveFunDefType (FunctionType (FunTypeIncomplete return_ty) attrs) = return $ FunctionType (FunType return_ty [] False) attrs improveFunDefType ty = return $ ty -- | Analyse a declaration other than a function definition
1,171
analyseFunDef :: (MonadTrav m) => CFunDef -> m () analyseFunDef (CFunDef declspecs declr oldstyle_decls stmt node_info) = do -- analyse the declarator var_decl_info <- analyseVarDecl' True declspecs declr oldstyle_decls Nothing let (VarDeclInfo name is_inline storage_spec attrs ty _) = var_decl_info when (isNoName name) $ astError node_info "NoName in analyseFunDef" let ident = identOfVarName name -- improve incomplete type ty' <- improveFunDefType ty -- compute storage fun_storage <- computeFunDefStorage ident storage_spec let var_decl = VarDecl name (DeclAttrs is_inline fun_storage attrs) ty' -- callback for declaration handleVarDecl False (Decl var_decl node_info) -- process body stmt' <- analyseFunctionBody node_info var_decl stmt -- callback for definition handleFunDef ident (FunDef var_decl stmt' node_info) where improveFunDefType (FunctionType (FunTypeIncomplete return_ty) attrs) = return $ FunctionType (FunType return_ty [] False) attrs improveFunDefType ty = return $ ty -- | Analyse a declaration other than a function definition
1,136
analyseFunDef (CFunDef declspecs declr oldstyle_decls stmt node_info) = do -- analyse the declarator var_decl_info <- analyseVarDecl' True declspecs declr oldstyle_decls Nothing let (VarDeclInfo name is_inline storage_spec attrs ty _) = var_decl_info when (isNoName name) $ astError node_info "NoName in analyseFunDef" let ident = identOfVarName name -- improve incomplete type ty' <- improveFunDefType ty -- compute storage fun_storage <- computeFunDefStorage ident storage_spec let var_decl = VarDecl name (DeclAttrs is_inline fun_storage attrs) ty' -- callback for declaration handleVarDecl False (Decl var_decl node_info) -- process body stmt' <- analyseFunctionBody node_info var_decl stmt -- callback for definition handleFunDef ident (FunDef var_decl stmt' node_info) where improveFunDefType (FunctionType (FunTypeIncomplete return_ty) attrs) = return $ FunctionType (FunType return_ty [] False) attrs improveFunDefType ty = return $ ty -- | Analyse a declaration other than a function definition
1,086
true
true
0
12
227
285
135
150
null
null
kaoskorobase/mescaline
lib/mescaline-patterns/src/Mescaline/Pattern/AST/Library.hs
gpl-3.0
-- | Returns one item from the list at random for each repeat. -- -- Similar to 'chooseNew' but but applies 'once' to each of the patterns. chooseNew1 :: (List Pattern a, Stream Pattern a) => Pattern Scalar -> [Pattern a] -> Pattern a chooseNew1 = list1 chooseNew
268
chooseNew1 :: (List Pattern a, Stream Pattern a) => Pattern Scalar -> [Pattern a] -> Pattern a chooseNew1 = list1 chooseNew
127
chooseNew1 = list1 chooseNew
28
true
true
0
10
52
62
30
32
null
null
flowbox-public/imagemagick
Graphics/ImageMagick/MagickWand/PixelWand.hs
apache-2.0
getCyan :: (MonadResource m) => PPixelWand -> m Double getCyan = (fmap realToFrac) . liftIO . F.pixelGetCyan
108
getCyan :: (MonadResource m) => PPixelWand -> m Double getCyan = (fmap realToFrac) . liftIO . F.pixelGetCyan
108
getCyan = (fmap realToFrac) . liftIO . F.pixelGetCyan
53
false
true
0
8
16
49
23
26
null
null
BeautifulDestinations/CV
CV/Conversions.hs
bsd-3-clause
-- |Copy the contents of a CArray into CV.Image type. copy8UCArrayToImage :: CArray (Int,Int) Word8 -> Image GrayScale D8 copy8UCArrayToImage carr = S $ unsafePerformIO $ creatingBareImage (withCArray carr (acquireImageSlow8U' w h)) where ((sx,sy),(ex,ey)) = bounds carr (w,h) = (fromIntegral $ ex-sx+1, fromIntegral $ ey-sy+1) -- -- |Copy the contents of a CArray into CV.Image type.
424
copy8UCArrayToImage :: CArray (Int,Int) Word8 -> Image GrayScale D8 copy8UCArrayToImage carr = S $ unsafePerformIO $ creatingBareImage (withCArray carr (acquireImageSlow8U' w h)) where ((sx,sy),(ex,ey)) = bounds carr (w,h) = (fromIntegral $ ex-sx+1, fromIntegral $ ey-sy+1) -- -- |Copy the contents of a CArray into CV.Image type.
370
copy8UCArrayToImage carr = S $ unsafePerformIO $ creatingBareImage (withCArray carr (acquireImageSlow8U' w h)) where ((sx,sy),(ex,ey)) = bounds carr (w,h) = (fromIntegral $ ex-sx+1, fromIntegral $ ey-sy+1) -- -- |Copy the contents of a CArray into CV.Image type.
302
true
true
1
10
95
135
73
62
null
null
joelburget/haste-compiler
libraries/base-ghc-7.6/GHC/ForeignPtr.hs
bsd-3-clause
unsafeForeignPtrToPtr :: ForeignPtr a -> Ptr a -- ^This function extracts the pointer component of a foreign -- pointer. This is a potentially dangerous operations, as if the -- argument to 'unsafeForeignPtrToPtr' is the last usage -- occurrence of the given foreign pointer, then its finalizer(s) will -- be run, which potentially invalidates the plain pointer just -- obtained. Hence, 'touchForeignPtr' must be used -- wherever it has to be guaranteed that the pointer lives on - i.e., -- has another usage occurrence. -- -- To avoid subtle coding errors, hand written marshalling code -- should preferably use 'Foreign.ForeignPtr.withForeignPtr' rather -- than combinations of 'unsafeForeignPtrToPtr' and -- 'touchForeignPtr'. However, the latter routines -- are occasionally preferred in tool generated marshalling code. unsafeForeignPtrToPtr (ForeignPtr fo _) = Ptr fo
876
unsafeForeignPtrToPtr :: ForeignPtr a -> Ptr a unsafeForeignPtrToPtr (ForeignPtr fo _) = Ptr fo
95
unsafeForeignPtrToPtr (ForeignPtr fo _) = Ptr fo
48
true
true
0
7
130
49
30
19
null
null
shayan-najd/QHaskell
QHaskell/Expression/Utils/Reuse/GADTHigherOrder.hs
gpl-3.0
onHOASF :: forall s a b. (TG.Type a , TG.Type b , TG.Types s) => ((TG.Type a , TG.Type b) => GFO.Exp s '[a] b -> GFO.Exp s '[a] b) -> (Exp s a -> Exp s b) -> Exp s a -> Exp s b onHOASF f e = let g = sin :: Env TG.Typ s e' :: GFO.Exp s '[a] b = cnvHOFOF g e in cnvFOHOF (f e')
351
onHOASF :: forall s a b. (TG.Type a , TG.Type b , TG.Types s) => ((TG.Type a , TG.Type b) => GFO.Exp s '[a] b -> GFO.Exp s '[a] b) -> (Exp s a -> Exp s b) -> Exp s a -> Exp s b onHOASF f e = let g = sin :: Env TG.Typ s e' :: GFO.Exp s '[a] b = cnvHOFOF g e in cnvFOHOF (f e')
351
onHOASF f e = let g = sin :: Env TG.Typ s e' :: GFO.Exp s '[a] b = cnvHOFOF g e in cnvFOHOF (f e')
133
false
true
0
13
147
202
101
101
null
null
Proclivis/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxLANGUAGE_KANNADA :: Int wxLANGUAGE_KANNADA = 112
50
wxLANGUAGE_KANNADA :: Int wxLANGUAGE_KANNADA = 112
50
wxLANGUAGE_KANNADA = 112
24
false
true
0
4
5
11
6
5
null
null
mrakgr/futhark
src/Language/Futhark/Parser.hs
bsd-3-clause
bad :: e -> ErrorIO e t bad e = ErrorIO $ return $ Left e
57
bad :: e -> ErrorIO e t bad e = ErrorIO $ return $ Left e
57
bad e = ErrorIO $ return $ Left e
33
false
true
0
6
15
37
17
20
null
null
felipeZ/Dynamics
src/InternalCoodinates.hs
bsd-3-clause
vecCross :: VD -> VD -> VD vecCross !v1 !v2 = VU.fromList $ fmap permute [(1,2),(2,0),(0,1)] where permute (i,j) = (v1 VU.! i)*(v2 VU.! j) - (v2 VU.! i)*(v1 VU.! j)
168
vecCross :: VD -> VD -> VD vecCross !v1 !v2 = VU.fromList $ fmap permute [(1,2),(2,0),(0,1)] where permute (i,j) = (v1 VU.! i)*(v2 VU.! j) - (v2 VU.! i)*(v1 VU.! j)
166
vecCross !v1 !v2 = VU.fromList $ fmap permute [(1,2),(2,0),(0,1)] where permute (i,j) = (v1 VU.! i)*(v2 VU.! j) - (v2 VU.! i)*(v1 VU.! j)
139
false
true
0
9
34
128
70
58
null
null
flocc-net/flocc
v0.1/Compiler/Back/TypeNames.hs
apache-2.0
nameTy :: String -> LfTy nameTy n = (LfTy n [])
47
nameTy :: String -> LfTy nameTy n = (LfTy n [])
47
nameTy n = (LfTy n [])
22
false
true
0
7
10
28
14
14
null
null
brendanhay/gogol
gogol-logging/gen/Network/Google/Resource/Logging/BillingAccounts/Locations/Buckets/Views/Create.hs
mpl-2.0
-- | Required. The bucket in which to create the view -- \"projects\/[PROJECT_ID]\/locations\/[LOCATION_ID]\/buckets\/[BUCKET_ID]\" -- Example: -- \"projects\/my-logging-project\/locations\/my-location\/buckets\/my-bucket\" balbvcParent :: Lens' BillingAccountsLocationsBucketsViewsCreate Text balbvcParent = lens _balbvcParent (\ s a -> s{_balbvcParent = a})
361
balbvcParent :: Lens' BillingAccountsLocationsBucketsViewsCreate Text balbvcParent = lens _balbvcParent (\ s a -> s{_balbvcParent = a})
137
balbvcParent = lens _balbvcParent (\ s a -> s{_balbvcParent = a})
67
true
true
0
9
34
45
25
20
null
null
nushio3/ghc
compiler/iface/IfaceType.hs
bsd-3-clause
pprParendIfaceTcArgs = ppr_tc_args TyConPrec
44
pprParendIfaceTcArgs = ppr_tc_args TyConPrec
44
pprParendIfaceTcArgs = ppr_tc_args TyConPrec
44
false
false
1
5
3
12
4
8
null
null
ricardopenyamari/ir2haskell
clir-parser-haskell-master/src/DataStructures/Arrays.hs
gpl-2.0
permut_all::Ord a => Array a -> Array a -> Bool permut_all a1 a2 = (snd a1) == (snd a2) && permut a1 a2 0 (snd a1)
115
permut_all::Ord a => Array a -> Array a -> Bool permut_all a1 a2 = (snd a1) == (snd a2) && permut a1 a2 0 (snd a1)
114
permut_all a1 a2 = (snd a1) == (snd a2) && permut a1 a2 0 (snd a1)
66
false
true
0
8
26
72
34
38
null
null