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
voidlizard/emufat
src/FatGen.hs
bsd-3-clause
fatSample7 = filesystem $ do file "00.mp3" CB_STREAM (gigs 2) $ const $ runPut $ do putWord32be 0xCAFEBABE putWord8 192 putWord8 168 putWord8 1 putWord8 1 putWord32be 3000 putLazyByteString "/jopakita/pechentreski.mp3" putWord8 0 file "01.mp3" CB_STREAM (gigs 2) $ const $ runPut $ do putWord32be 0xCAFEBABE putWord8 192 putWord8 168 putWord8 1 putWord8 1 putWord32be 3000 putLazyByteString "lalalalala/qlqlqlqlqql/jopakita/pechentreski.mp3" putWord8 0
521
fatSample7 = filesystem $ do file "00.mp3" CB_STREAM (gigs 2) $ const $ runPut $ do putWord32be 0xCAFEBABE putWord8 192 putWord8 168 putWord8 1 putWord8 1 putWord32be 3000 putLazyByteString "/jopakita/pechentreski.mp3" putWord8 0 file "01.mp3" CB_STREAM (gigs 2) $ const $ runPut $ do putWord32be 0xCAFEBABE putWord8 192 putWord8 168 putWord8 1 putWord8 1 putWord32be 3000 putLazyByteString "lalalalala/qlqlqlqlqql/jopakita/pechentreski.mp3" putWord8 0
521
fatSample7 = filesystem $ do file "00.mp3" CB_STREAM (gigs 2) $ const $ runPut $ do putWord32be 0xCAFEBABE putWord8 192 putWord8 168 putWord8 1 putWord8 1 putWord32be 3000 putLazyByteString "/jopakita/pechentreski.mp3" putWord8 0 file "01.mp3" CB_STREAM (gigs 2) $ const $ runPut $ do putWord32be 0xCAFEBABE putWord8 192 putWord8 168 putWord8 1 putWord8 1 putWord32be 3000 putLazyByteString "lalalalala/qlqlqlqlqql/jopakita/pechentreski.mp3" putWord8 0
521
false
false
0
13
127
162
63
99
null
null
hsyl20/HaskellPU
lib/HaskellPU/Algorithms/QR.hs
lgpl-3.0
unsplit :: Word -> Word -> HighMatrix (Matrix Float) -> Matrix Float unsplit _ _ _ = undefined
94
unsplit :: Word -> Word -> HighMatrix (Matrix Float) -> Matrix Float unsplit _ _ _ = undefined
94
unsplit _ _ _ = undefined
25
false
true
0
11
17
47
21
26
null
null
jystic/river
src/River/Source/Analysis/Live.hs
bsd-3-clause
liveOfProgram :: Ord a => Program a -> Map Identifier (Set a) liveOfProgram = \case Program _ ss -> liveOfBlock Set.empty ss
130
liveOfProgram :: Ord a => Program a -> Map Identifier (Set a) liveOfProgram = \case Program _ ss -> liveOfBlock Set.empty ss
130
liveOfProgram = \case Program _ ss -> liveOfBlock Set.empty ss
68
false
true
0
9
27
56
26
30
null
null
olorin/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs
mpl-2.0
-- | The kernel associated with this instance. insKernelId :: Lens' Instance (Maybe Text) insKernelId = lens _insKernelId (\ s a -> s{_insKernelId = a})
152
insKernelId :: Lens' Instance (Maybe Text) insKernelId = lens _insKernelId (\ s a -> s{_insKernelId = a})
105
insKernelId = lens _insKernelId (\ s a -> s{_insKernelId = a})
62
true
true
0
9
24
46
25
21
null
null
hvr/unordered-containers
tests/HashMapProperties.hs
bsd-3-clause
Intersection :: [(Key, Int)] -> [(Key, Int)] -> Bool pIntersection xs ys = M.intersection (M.fromList xs) `eq_` HM.intersection (HM.fromList xs) $ ys
172
pIntersection :: [(Key, Int)] -> [(Key, Int)] -> Bool pIntersection xs ys = M.intersection (M.fromList xs) `eq_` HM.intersection (HM.fromList xs) $ ys
172
pIntersection xs ys = M.intersection (M.fromList xs) `eq_` HM.intersection (HM.fromList xs) $ ys
118
false
true
0
10
44
80
42
38
null
null
ssaavedra/liquidhaskell
benchmarks/bytestring-0.9.2.1/Data/ByteString/Lazy/Char8.hs
bsd-3-clause
-- | /O(n)/ and /O(n\/c) space/ A first order equivalent of /filter . -- (==)/, for the common case of filtering a single Char. It is more -- efficient to use /filterChar/ in this case. -- -- > filterByte == filter . (==) -- -- filterChar is around 10x faster, and uses much less space, than its -- filter equivalent -- filterChar :: Char -> ByteString -> ByteString filterChar c ps = replicate (count c ps) c
409
filterChar :: Char -> ByteString -> ByteString filterChar c ps = replicate (count c ps) c
89
filterChar c ps = replicate (count c ps) c
42
true
true
0
7
76
46
27
19
null
null
AleXoundOS/mpv-cut
src/MPV_Cut.hs
gpl-3.0
myToLower :: Char -> Char myToLower c = toEnum (fromEnum c + 32)
64
myToLower :: Char -> Char myToLower c = toEnum (fromEnum c + 32)
64
myToLower c = toEnum (fromEnum c + 32)
38
false
true
0
8
12
37
16
21
null
null
rmcmaho/games
tictactoe/GameState.hs
apache-2.0
renderBoard :: GameState -> String renderBoard gameState = show $ board gameState
81
renderBoard :: GameState -> String renderBoard gameState = show $ board gameState
81
renderBoard gameState = show $ board gameState
46
false
true
0
6
11
25
12
13
null
null
danr/hipspec
examples/old-examples/quickspec/ProductiveUseOfFailure.hs
gpl-3.0
insert :: Nat -> [Nat] -> [Nat] insert n [] = [n]
49
insert :: Nat -> [Nat] -> [Nat] insert n [] = [n]
49
insert n [] = [n]
17
false
true
0
7
11
35
19
16
null
null
miguelpagano/equ
TestSuite/Tests/Rules.hs
gpl-3.0
testEqTypes :: PreExpr -> PreExpr -> Assertion testEqTypes e e' = case checkPreExpr e of Left _ -> err e Right t -> case checkPreExpr e' of Left _ -> err e' Right t' -> case unify t t' emptySubst of Left _ -> err' t t' Right _ -> return () where err er = assertFailure $ "No se pudo tipar la expresión: " ++ show er err' t t' = assertFailure $ "Los tipos de lhs con rhs no son unificables: (" ++ show t ++"," ++ show t' ++")" -- TODO: Verificar que los tipos son iguales. -- | Controla que los dos lados de una regla estén bien tipados.
838
testEqTypes :: PreExpr -> PreExpr -> Assertion testEqTypes e e' = case checkPreExpr e of Left _ -> err e Right t -> case checkPreExpr e' of Left _ -> err e' Right t' -> case unify t t' emptySubst of Left _ -> err' t t' Right _ -> return () where err er = assertFailure $ "No se pudo tipar la expresión: " ++ show er err' t t' = assertFailure $ "Los tipos de lhs con rhs no son unificables: (" ++ show t ++"," ++ show t' ++")" -- TODO: Verificar que los tipos son iguales. -- | Controla que los dos lados de una regla estén bien tipados.
838
testEqTypes e e' = case checkPreExpr e of Left _ -> err e Right t -> case checkPreExpr e' of Left _ -> err e' Right t' -> case unify t t' emptySubst of Left _ -> err' t t' Right _ -> return () where err er = assertFailure $ "No se pudo tipar la expresión: " ++ show er err' t t' = assertFailure $ "Los tipos de lhs con rhs no son unificables: (" ++ show t ++"," ++ show t' ++")" -- TODO: Verificar que los tipos son iguales. -- | Controla que los dos lados de una regla estén bien tipados.
791
false
true
2
15
414
192
83
109
null
null
pepeiborra/bytestring-xml
src/Text/Xml/Tiny/Internal/Monad.hs
bsd-3-clause
-- | Arbitrary look-ahead (CPS) peekAt :: Config => Int32 -> (Char -> a) -> ParseMonad s a peekAt i pred = withCursor $ \p o l -> if (l < i) then throw UnexpectedEndOfStream else peekAtUnsafePO i pred p o
206
peekAt :: Config => Int32 -> (Char -> a) -> ParseMonad s a peekAt i pred = withCursor $ \p o l -> if (l < i) then throw UnexpectedEndOfStream else peekAtUnsafePO i pred p o
174
peekAt i pred = withCursor $ \p o l -> if (l < i) then throw UnexpectedEndOfStream else peekAtUnsafePO i pred p o
115
true
true
0
9
42
82
42
40
null
null
pjonsson/parser-helper
src/Development/Main.hs
apache-2.0
handleArgs ["--version"] = putStrLn $ "parser-helper v" ++ showVersion version
86
handleArgs ["--version"] = putStrLn $ "parser-helper v" ++ showVersion version
86
handleArgs ["--version"] = putStrLn $ "parser-helper v" ++ showVersion version
86
false
false
0
6
17
24
11
13
null
null
fabioyamate/programming-in-haskell
ch08/parser.hs
mit
-- Parser Char = String -> [(Char, String)] item :: Parser Char item = \inp -> case inp of [] -> [] (x:xs) -> [(x, xs)] -- parse is a function that applies the Parser function to the String input -- It could be simplified as -- -- parse p = p -- -- which means that parse is the identity function. However, it is common to -- have a function like this.
387
item :: Parser Char item = \inp -> case inp of [] -> [] (x:xs) -> [(x, xs)] -- parse is a function that applies the Parser function to the String input -- It could be simplified as -- -- parse p = p -- -- which means that parse is the identity function. However, it is common to -- have a function like this.
343
item = \inp -> case inp of [] -> [] (x:xs) -> [(x, xs)] -- parse is a function that applies the Parser function to the String input -- It could be simplified as -- -- parse p = p -- -- which means that parse is the identity function. However, it is common to -- have a function like this.
323
true
true
0
10
107
63
38
25
null
null
brendanhay/gogol
gogol-jobs/gen/Network/Google/Resource/Jobs/Projects/Jobs/List.hs
mpl-2.0
-- | V1 error format. pjlXgafv :: Lens' ProjectsJobsList (Maybe Xgafv) pjlXgafv = lens _pjlXgafv (\ s a -> s{_pjlXgafv = a})
124
pjlXgafv :: Lens' ProjectsJobsList (Maybe Xgafv) pjlXgafv = lens _pjlXgafv (\ s a -> s{_pjlXgafv = a})
102
pjlXgafv = lens _pjlXgafv (\ s a -> s{_pjlXgafv = a})
53
true
true
0
9
21
46
25
21
null
null
meoblast001/ext2-info
src/Data/EXT2/Superblock.hs
mit
fileSystemSize :: Superblock -> Integer fileSystemSize sb = sb ^. to numBlockGroups * sb ^. blocksPerGroup * sb ^. logBlockSize
129
fileSystemSize :: Superblock -> Integer fileSystemSize sb = sb ^. to numBlockGroups * sb ^. blocksPerGroup * sb ^. logBlockSize
129
fileSystemSize sb = sb ^. to numBlockGroups * sb ^. blocksPerGroup * sb ^. logBlockSize
89
false
true
0
10
21
41
20
21
null
null
unisonweb/platform
unison-core/src/Unison/DataDeclaration.hs
mit
-- | All variables mentioned in the given declaration. -- Includes both term and type variables, both free and bound. allVars' :: Ord v => Decl v a -> Set v allVars' = allVars . either toDataDecl id
198
allVars' :: Ord v => Decl v a -> Set v allVars' = allVars . either toDataDecl id
80
allVars' = allVars . either toDataDecl id
41
true
true
1
8
37
48
21
27
null
null
brendanhay/gogol
gogol-dlp/gen/Network/Google/DLP/Types/Product.hs
mpl-2.0
-- | Offset of the row for tables. Populate if the row(s) being scanned are -- part of a bigger dataset and you want to keep track of their absolute -- position. gpdvhfdRowOffSet :: Lens' GooglePrivacyDlpV2HybridFindingDetails (Maybe Int64) gpdvhfdRowOffSet = lens _gpdvhfdRowOffSet (\ s a -> s{_gpdvhfdRowOffSet = a}) . mapping _Coerce
350
gpdvhfdRowOffSet :: Lens' GooglePrivacyDlpV2HybridFindingDetails (Maybe Int64) gpdvhfdRowOffSet = lens _gpdvhfdRowOffSet (\ s a -> s{_gpdvhfdRowOffSet = a}) . mapping _Coerce
188
gpdvhfdRowOffSet = lens _gpdvhfdRowOffSet (\ s a -> s{_gpdvhfdRowOffSet = a}) . mapping _Coerce
109
true
true
0
10
65
57
30
27
null
null
feuerbach/tasty-golden
Test/Tasty/Golden.hs
mit
readFileStrict :: FilePath -> IO LBS.ByteString readFileStrict path = do s <- LBS.readFile path evaluate $ forceLbs s return s
132
readFileStrict :: FilePath -> IO LBS.ByteString readFileStrict path = do s <- LBS.readFile path evaluate $ forceLbs s return s
132
readFileStrict path = do s <- LBS.readFile path evaluate $ forceLbs s return s
84
false
true
0
9
25
51
22
29
null
null
unsw-comp4181/accelerate-c-stub
Data/Array/Accelerate/C/Exp.hs
bsd-3-clause
absToC (IntegralNumType ty) x = case ty of TypeWord _ -> x TypeWord8 _ -> x TypeWord16 _ -> x TypeWord32 _ -> x TypeWord64 _ -> x TypeCUShort _ -> x TypeCUInt _ -> x TypeCULong _ -> x TypeCULLong _ -> x _ -> ccall "abs" [x]
348
absToC (IntegralNumType ty) x = case ty of TypeWord _ -> x TypeWord8 _ -> x TypeWord16 _ -> x TypeWord32 _ -> x TypeWord64 _ -> x TypeCUShort _ -> x TypeCUInt _ -> x TypeCULong _ -> x TypeCULLong _ -> x _ -> ccall "abs" [x]
348
absToC (IntegralNumType ty) x = case ty of TypeWord _ -> x TypeWord8 _ -> x TypeWord16 _ -> x TypeWord32 _ -> x TypeWord64 _ -> x TypeCUShort _ -> x TypeCUInt _ -> x TypeCULong _ -> x TypeCULLong _ -> x _ -> ccall "abs" [x]
348
false
false
1
9
173
120
53
67
null
null
solorab/proof-haskell
Control/Proof/Linear.hs
mit
isInUpper :: Ord a => a -> Interval a -> Bool isInUpper x y = fromMaybe True $ f <$> upperLimit y where f (oc, r) = comparator oc x r
137
isInUpper :: Ord a => a -> Interval a -> Bool isInUpper x y = fromMaybe True $ f <$> upperLimit y where f (oc, r) = comparator oc x r
137
isInUpper x y = fromMaybe True $ f <$> upperLimit y where f (oc, r) = comparator oc x r
91
false
true
0
8
34
71
34
37
null
null
paf31/language-typescript
src/Language/TypeScript/Pretty.hs
mit
declarationSourceFile :: [DeclarationElement] -> Doc declarationSourceFile = vcat . map declarationElement
106
declarationSourceFile :: [DeclarationElement] -> Doc declarationSourceFile = vcat . map declarationElement
106
declarationSourceFile = vcat . map declarationElement
53
false
true
0
6
10
25
13
12
null
null
amtal/soyuz
DCPU16/Assembly/Optimizer.hs
mit
isLit :: Operand -> Bool isLit (DirectLiteral _) = True
55
isLit :: Operand -> Bool isLit (DirectLiteral _) = True
55
isLit (DirectLiteral _) = True
30
false
true
0
7
9
24
12
12
null
null
brendanhay/gogol
gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs
mpl-2.0
-- | Creates a value of 'ActivityContentDetailsBulletin' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'acdbResourceId' activityContentDetailsBulletin :: ActivityContentDetailsBulletin activityContentDetailsBulletin = ActivityContentDetailsBulletin' {_acdbResourceId = Nothing}
370
activityContentDetailsBulletin :: ActivityContentDetailsBulletin activityContentDetailsBulletin = ActivityContentDetailsBulletin' {_acdbResourceId = Nothing}
163
activityContentDetailsBulletin = ActivityContentDetailsBulletin' {_acdbResourceId = Nothing}
94
true
true
0
6
48
24
16
8
null
null
jeyoor/haskell-learning-challenge
learn_haskell_github_courses/Cis194/test/Homework01Test.hs
bsd-3-clause
testSumDigits4 :: Test testSumDigits4 = TestCase (assertEqual "for (sumDigits [16, 1, 2, 3, 1, 1, 1])," (17) (sumDigits [16, 1, 2, 3, 1, 1, 1, 1]))
147
testSumDigits4 :: Test testSumDigits4 = TestCase (assertEqual "for (sumDigits [16, 1, 2, 3, 1, 1, 1])," (17) (sumDigits [16, 1, 2, 3, 1, 1, 1, 1]))
147
testSumDigits4 = TestCase (assertEqual "for (sumDigits [16, 1, 2, 3, 1, 1, 1])," (17) (sumDigits [16, 1, 2, 3, 1, 1, 1, 1]))
124
false
true
0
10
25
57
33
24
null
null
tulcod/megaparsec
Text/Megaparsec/Char.hs
bsd-2-clause
-- | Skips /zero/ or more white space characters. See also 'skipMany' and -- 'spaceChar'. space :: Stream s m Char => ParsecT s u m () space = skipMany spaceChar
162
space :: Stream s m Char => ParsecT s u m () space = skipMany spaceChar
71
space = skipMany spaceChar
26
true
true
0
7
31
38
19
19
null
null
tomlokhorst/bool-extras
examples/Bool.hs
bsd-3-clause
yesOrNo :: Bool -> String yesOrNo = bool "no" "yes"
51
yesOrNo :: Bool -> String yesOrNo = bool "no" "yes"
51
yesOrNo = bool "no" "yes"
25
false
true
0
5
9
20
10
10
null
null
keera-studios/hsQt
Qtc/Gui/QListView.hs
bsd-2-clause
isSelectionRectVisible :: QListView a -> (()) -> IO (Bool) isSelectionRectVisible x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QListView_isSelectionRectVisible cobj_x0
192
isSelectionRectVisible :: QListView a -> (()) -> IO (Bool) isSelectionRectVisible x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QListView_isSelectionRectVisible cobj_x0
192
isSelectionRectVisible x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QListView_isSelectionRectVisible cobj_x0
133
false
true
0
8
31
59
29
30
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Sizes/List.hs
mpl-2.0
-- | Creates a value of 'SizesList' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'slXgafv' -- -- * 'slHeight' -- -- * 'slUploadProtocol' -- -- * 'slAccessToken' -- -- * 'slUploadType' -- -- * 'slIds' -- -- * 'slWidth' -- -- * 'slProFileId' -- -- * 'slIabStandard' -- -- * 'slCallback' sizesList :: Int64 -- ^ 'slProFileId' -> SizesList sizesList pSlProFileId_ = SizesList' { _slXgafv = Nothing , _slHeight = Nothing , _slUploadProtocol = Nothing , _slAccessToken = Nothing , _slUploadType = Nothing , _slIds = Nothing , _slWidth = Nothing , _slProFileId = _Coerce # pSlProFileId_ , _slIabStandard = Nothing , _slCallback = Nothing }
774
sizesList :: Int64 -- ^ 'slProFileId' -> SizesList sizesList pSlProFileId_ = SizesList' { _slXgafv = Nothing , _slHeight = Nothing , _slUploadProtocol = Nothing , _slAccessToken = Nothing , _slUploadType = Nothing , _slIds = Nothing , _slWidth = Nothing , _slProFileId = _Coerce # pSlProFileId_ , _slIabStandard = Nothing , _slCallback = Nothing }
401
sizesList pSlProFileId_ = SizesList' { _slXgafv = Nothing , _slHeight = Nothing , _slUploadProtocol = Nothing , _slAccessToken = Nothing , _slUploadType = Nothing , _slIds = Nothing , _slWidth = Nothing , _slProFileId = _Coerce # pSlProFileId_ , _slIabStandard = Nothing , _slCallback = Nothing }
342
true
true
0
8
178
117
78
39
null
null
olive/antiqua-prime
src/Antiqua/Data/NonEmpty.hs
mit
concat :: NonEmpty (NonEmpty x) -> NonEmpty x concat (NonEmpty (NonEmpty x xs) xxs) = NonEmpty x (Prelude.concat (xs:(toList <$> xxs)))
135
concat :: NonEmpty (NonEmpty x) -> NonEmpty x concat (NonEmpty (NonEmpty x xs) xxs) = NonEmpty x (Prelude.concat (xs:(toList <$> xxs)))
135
concat (NonEmpty (NonEmpty x xs) xxs) = NonEmpty x (Prelude.concat (xs:(toList <$> xxs)))
89
false
true
0
11
20
73
36
37
null
null
emwap/feldspar-language
src/Feldspar/Par.hs
bsd-3-clause
runPar :: Syntax a => P a -> a runPar = sugarSymC ParRun
56
runPar :: Syntax a => P a -> a runPar = sugarSymC ParRun
56
runPar = sugarSymC ParRun
25
false
true
0
8
12
34
14
20
null
null
WraithM/haskell-opaleye
opaleye-sqlite/src/Opaleye/SQLite/Internal/PackMap.hs
bsd-3-clause
extractAttr :: String -> T.Tag -> primExpr -> PM [(HPQ.Symbol, primExpr)] HPQ.PrimExpr extractAttr s = extractAttrPE (const (s ++))
146
extractAttr :: String -> T.Tag -> primExpr -> PM [(HPQ.Symbol, primExpr)] HPQ.PrimExpr extractAttr s = extractAttrPE (const (s ++))
146
extractAttr s = extractAttrPE (const (s ++))
44
false
true
0
12
33
63
32
31
null
null
andregrigon/Lambda
executable/Main.hs
mit
reduce :: Term -> Term reduce t = if j < 100 then n else error $ "Stopped after 100 reductions: " ++ pretty n where iterations = zip ([1..] :: [Integer]) $ iterate (>>= leftmostReduction) (Just t) (j, Just n) = last $ takeWhile (\(i,m) -> i <= 100 && isJust m) iterations
282
reduce :: Term -> Term reduce t = if j < 100 then n else error $ "Stopped after 100 reductions: " ++ pretty n where iterations = zip ([1..] :: [Integer]) $ iterate (>>= leftmostReduction) (Just t) (j, Just n) = last $ takeWhile (\(i,m) -> i <= 100 && isJust m) iterations
282
reduce t = if j < 100 then n else error $ "Stopped after 100 reductions: " ++ pretty n where iterations = zip ([1..] :: [Integer]) $ iterate (>>= leftmostReduction) (Just t) (j, Just n) = last $ takeWhile (\(i,m) -> i <= 100 && isJust m) iterations
259
false
true
0
10
64
137
71
66
null
null
acowley/ghc
compiler/nativeGen/X86/Regs.hs
bsd-3-clause
-- argRegs is the set of regs which are read for an n-argument call to C. -- For archs which pass all args on the stack (x86), is empty. -- Sparc passes up to the first 6 args in regs. argRegs :: RegNo -> [Reg] argRegs _ = panic "MachRegs.argRegs(x86): should not be used!"
279
argRegs :: RegNo -> [Reg] argRegs _ = panic "MachRegs.argRegs(x86): should not be used!"
94
argRegs _ = panic "MachRegs.argRegs(x86): should not be used!"
68
true
true
0
6
59
27
15
12
null
null
jaapweel/bloop
ParseBloop.hs
gpl-2.0
reservedOp = P.reservedOp lexer
31
reservedOp = P.reservedOp lexer
31
reservedOp = P.reservedOp lexer
31
false
false
1
5
3
15
5
10
null
null
shlevy/ghc
compiler/simplCore/SimplUtils.hs
bsd-3-clause
-- Warning: don't call mkCase recursively! -- Firstly, there's no point, because inner alts have already had -- mkCase applied to them, so they won't have a case in their default -- Secondly, if you do, you get an infinite loop, because the bindCaseBndr -- in munge_rhs may put a case into the DEFAULT branch! mkCase dflags scrut bndr alts_ty alts = mkCase1 dflags scrut bndr alts_ty alts
421
mkCase dflags scrut bndr alts_ty alts = mkCase1 dflags scrut bndr alts_ty alts
78
mkCase dflags scrut bndr alts_ty alts = mkCase1 dflags scrut bndr alts_ty alts
78
true
false
0
5
100
35
18
17
null
null
bgamari/criterion
Criterion/Measurement.hs
bsd-2-clause
applyGCStatistics _ _ m = m
27
applyGCStatistics _ _ m = m
27
applyGCStatistics _ _ m = m
27
false
false
0
5
5
13
6
7
null
null
bgwines/avalon-meta-comparison
src/Metas.hs
bsd-3-clause
getMissionSize 5 3 = 3
22
getMissionSize 5 3 = 3
22
getMissionSize 5 3 = 3
22
false
false
0
5
4
11
5
6
null
null
Jem777/deepthought
src/StdLib.hs
gpl-3.0
mul _ [Number a, Number b] = goRight (Number (a * b))
53
mul _ [Number a, Number b] = goRight (Number (a * b))
53
mul _ [Number a, Number b] = goRight (Number (a * b))
53
false
false
1
9
11
41
19
22
null
null
charles-l/comp
build_me_a_scheme/scheme.hs
mit
unpackStr (Number s) = return $ show s
38
unpackStr (Number s) = return $ show s
38
unpackStr (Number s) = return $ show s
38
false
false
0
6
7
23
10
13
null
null
jtdaugherty/language-mixal
src/Language/MIXAL/PP.hs
bsd-3-clause
ppAddress :: Address -> Doc ppAddress (LitConst wv) = text "=" <> ppWValue wv <> text "="
89
ppAddress :: Address -> Doc ppAddress (LitConst wv) = text "=" <> ppWValue wv <> text "="
89
ppAddress (LitConst wv) = text "=" <> ppWValue wv <> text "="
61
false
true
0
7
16
45
20
25
null
null
fmthoma/ghc
compiler/simplCore/SimplUtils.hs
bsd-3-clause
contIsRhsOrArg (StrictBind {}) = True
37
contIsRhsOrArg (StrictBind {}) = True
37
contIsRhsOrArg (StrictBind {}) = True
37
false
false
0
7
4
16
8
8
null
null
portnov/xtt
XMonad/TimeTracker/Eval.hs
bsd-3-clause
cut :: String -> String -> String cut str regex = let (_,result,_) = str =~ regex :: (String, String, String) in result
124
cut :: String -> String -> String cut str regex = let (_,result,_) = str =~ regex :: (String, String, String) in result
124
cut str regex = let (_,result,_) = str =~ regex :: (String, String, String) in result
90
false
true
0
9
27
67
34
33
null
null
pparkkin/eta
compiler/ETA/TypeCheck/TcType.hs
bsd-3-clause
isSigmaTy (ForAllTy _ _) = True
31
isSigmaTy (ForAllTy _ _) = True
31
isSigmaTy (ForAllTy _ _) = True
31
false
false
0
6
5
18
8
10
null
null
robdockins/edison
edison-core/src/Data/Edison/Seq/FingerSeq.hs
mit
unzipWith = unzipWithUsingFoldr
31
unzipWith = unzipWithUsingFoldr
31
unzipWith = unzipWithUsingFoldr
31
false
false
0
4
2
6
3
3
null
null
jfischoff/LambdaPrettyQuote
src/Language/Lambda/Untyped/Parser.hs
bsd-3-clause
parse_lambda :: SymParser u s -> ParsecT String u M (Output s) parse_lambda sp = do _ <- char '\\' spaces sym <- (p_sym sp) <?> "lambda argument" _ <- char '.' spaces expr <- (parse_expr sp) <?> "lambda expression" return $ MLam sym expr
266
parse_lambda :: SymParser u s -> ParsecT String u M (Output s) parse_lambda sp = do _ <- char '\\' spaces sym <- (p_sym sp) <?> "lambda argument" _ <- char '.' spaces expr <- (parse_expr sp) <?> "lambda expression" return $ MLam sym expr
266
parse_lambda sp = do _ <- char '\\' spaces sym <- (p_sym sp) <?> "lambda argument" _ <- char '.' spaces expr <- (parse_expr sp) <?> "lambda expression" return $ MLam sym expr
203
false
true
0
11
73
115
50
65
null
null
sthiele/hasple
ASP.hs
gpl-3.0
--move negation outwards mkSubtraction (Negation a) b = (mkNegation (mkAddition a b))
85
mkSubtraction (Negation a) b = (mkNegation (mkAddition a b))
60
mkSubtraction (Negation a) b = (mkNegation (mkAddition a b))
60
true
false
0
8
11
32
16
16
null
null
edofic/core.js
src/Immediate/GenerateJs.hs
mit
genVdef :: Vdef -> JS.Statement () genVdef (Vdef name expr) = varDecl name $ genExpr expr
89
genVdef :: Vdef -> JS.Statement () genVdef (Vdef name expr) = varDecl name $ genExpr expr
89
genVdef (Vdef name expr) = varDecl name $ genExpr expr
54
false
true
0
9
15
47
21
26
null
null
bjornbm/HList-classic
Data/HList/Record.hs
mit
recordLabels :: RecordLabels r ls => Record r -> ls recordLabels (Record r) = recordLabels' r
93
recordLabels :: RecordLabels r ls => Record r -> ls recordLabels (Record r) = recordLabels' r
93
recordLabels (Record r) = recordLabels' r
41
false
true
0
7
15
39
18
21
null
null
rawlep/MML
sourceCode/RprMix2.hs
mit
dataError :: Mmodel -> Vector Double -> Vector Double -> (Vector Double,Vector Double) dataError mod actual predicted = (mkProbs (>= am) , mkProbs (< am) ) where --mn = am = let a = alph mod in a -- - (0.05 * a) --am' = let a = alph mod in a + (0.05 * a) mkProbs f = zipVectorWith (\a b -> if f (calProbs mod a b) then a else -10) actual predicted calProbs mod x mu = let dataProb = am * normal x mu (sigD mod) errorProb = (1- am) * normal x mu (sigE mod) in dataProb / (dataProb + errorProb)
695
dataError :: Mmodel -> Vector Double -> Vector Double -> (Vector Double,Vector Double) dataError mod actual predicted = (mkProbs (>= am) , mkProbs (< am) ) where --mn = am = let a = alph mod in a -- - (0.05 * a) --am' = let a = alph mod in a + (0.05 * a) mkProbs f = zipVectorWith (\a b -> if f (calProbs mod a b) then a else -10) actual predicted calProbs mod x mu = let dataProb = am * normal x mu (sigD mod) errorProb = (1- am) * normal x mu (sigE mod) in dataProb / (dataProb + errorProb)
695
dataError mod actual predicted = (mkProbs (>= am) , mkProbs (< am) ) where --mn = am = let a = alph mod in a -- - (0.05 * a) --am' = let a = alph mod in a + (0.05 * a) mkProbs f = zipVectorWith (\a b -> if f (calProbs mod a b) then a else -10) actual predicted calProbs mod x mu = let dataProb = am * normal x mu (sigD mod) errorProb = (1- am) * normal x mu (sigE mod) in dataProb / (dataProb + errorProb)
608
false
true
0
12
308
228
114
114
null
null
fcharlie/hgit
src/Git/Store/ObjectStore.hs
bsd-3-clause
createRef :: String -> String -> WithRepository () createRef ref sha = do repo <- ask let (path, name) = splitFileName ref dir = getGitDirectory repo </> path _ <- liftIO $ createDirectoryIfMissing True dir liftIO $ writeFile (dir </> name) (sha ++ "\n")
287
createRef :: String -> String -> WithRepository () createRef ref sha = do repo <- ask let (path, name) = splitFileName ref dir = getGitDirectory repo </> path _ <- liftIO $ createDirectoryIfMissing True dir liftIO $ writeFile (dir </> name) (sha ++ "\n")
287
createRef ref sha = do repo <- ask let (path, name) = splitFileName ref dir = getGitDirectory repo </> path _ <- liftIO $ createDirectoryIfMissing True dir liftIO $ writeFile (dir </> name) (sha ++ "\n")
236
false
true
0
12
76
114
53
61
null
null
TK009/CESH
src/EntityManager.hs
mit
entityLookup :: EntityId -> IntMap a -> Maybe a entityLookup (EntityId eid) = I.lookup eid
90
entityLookup :: EntityId -> IntMap a -> Maybe a entityLookup (EntityId eid) = I.lookup eid
90
entityLookup (EntityId eid) = I.lookup eid
42
false
true
0
7
14
39
18
21
null
null
tlaitinen/fuzzy-timings
FuzzyTimings/WeeklySlicedTime.hs
mit
flattenWeeklySlicedTime :: WeeklySlicedTime a -> WeeklySlicedTime a flattenWeeklySlicedTime wst = WeeklySlicedTime { wstSlices = Map.map (flatten . sort) (wstSlices wst) } where flatten (t1:t2:tss) -- |----| -- |----| | todsStart t1 < todsStart t2 && todsStart t2 < todsEnd t1 && todsEnd t2 > todsEnd t1 = if todsPriority t1 > todsPriority t2 then t1 : flatten (t2 { todsStart = todsEnd t1 } : tss) else (t1 { todsEnd = todsStart t2 }) : flatten (t2:tss) -- |----| -- |--| | todsStart t1 < todsStart t2 && todsEnd t1 == todsEnd t2 = if todsPriority t1 > todsPriority t2 then flatten (t1:tss) else flatten ((t1 { todsEnd = todsStart t2 }) : t2:tss) -- |----| -- |--| | todsStart t1 < todsStart t2 && todsEnd t2 < todsEnd t1 = if todsPriority t1 > todsPriority t2 then flatten (t1:tss) else flatten $ (t1 { todsEnd = todsStart t2}) : (t2:(t1 { todsStart=todsEnd t2 }):tss) -- |----| -- |-------| | todsStart t1 == todsStart t2 && todsEnd t2 > todsEnd t1 = if todsPriority t1 > todsPriority t2 then flatten (t1:t2 { todsStart = todsEnd t1 } : tss) else flatten (t2:tss) -- |----| -- |----| | todsStart t1 == todsStart t2 && todsEnd t1 == todsEnd t2 = if todsPriority t1 > todsPriority t2 then flatten (t1:tss) else flatten (t2:tss) -- |----| -- |---| | todsStart t1 == todsStart t2 && todsEnd t1 > todsEnd t2 = if todsPriority t1 > todsPriority t2 then flatten (t1:tss) else flatten (t2:(t1 { todsStart = todsEnd t2 }):tss) | otherwise = t1 : flatten (t2:tss) flatten tss = tss
2,368
flattenWeeklySlicedTime :: WeeklySlicedTime a -> WeeklySlicedTime a flattenWeeklySlicedTime wst = WeeklySlicedTime { wstSlices = Map.map (flatten . sort) (wstSlices wst) } where flatten (t1:t2:tss) -- |----| -- |----| | todsStart t1 < todsStart t2 && todsStart t2 < todsEnd t1 && todsEnd t2 > todsEnd t1 = if todsPriority t1 > todsPriority t2 then t1 : flatten (t2 { todsStart = todsEnd t1 } : tss) else (t1 { todsEnd = todsStart t2 }) : flatten (t2:tss) -- |----| -- |--| | todsStart t1 < todsStart t2 && todsEnd t1 == todsEnd t2 = if todsPriority t1 > todsPriority t2 then flatten (t1:tss) else flatten ((t1 { todsEnd = todsStart t2 }) : t2:tss) -- |----| -- |--| | todsStart t1 < todsStart t2 && todsEnd t2 < todsEnd t1 = if todsPriority t1 > todsPriority t2 then flatten (t1:tss) else flatten $ (t1 { todsEnd = todsStart t2}) : (t2:(t1 { todsStart=todsEnd t2 }):tss) -- |----| -- |-------| | todsStart t1 == todsStart t2 && todsEnd t2 > todsEnd t1 = if todsPriority t1 > todsPriority t2 then flatten (t1:t2 { todsStart = todsEnd t1 } : tss) else flatten (t2:tss) -- |----| -- |----| | todsStart t1 == todsStart t2 && todsEnd t1 == todsEnd t2 = if todsPriority t1 > todsPriority t2 then flatten (t1:tss) else flatten (t2:tss) -- |----| -- |---| | todsStart t1 == todsStart t2 && todsEnd t1 > todsEnd t2 = if todsPriority t1 > todsPriority t2 then flatten (t1:tss) else flatten (t2:(t1 { todsStart = todsEnd t2 }):tss) | otherwise = t1 : flatten (t2:tss) flatten tss = tss
2,368
flattenWeeklySlicedTime wst = WeeklySlicedTime { wstSlices = Map.map (flatten . sort) (wstSlices wst) } where flatten (t1:t2:tss) -- |----| -- |----| | todsStart t1 < todsStart t2 && todsStart t2 < todsEnd t1 && todsEnd t2 > todsEnd t1 = if todsPriority t1 > todsPriority t2 then t1 : flatten (t2 { todsStart = todsEnd t1 } : tss) else (t1 { todsEnd = todsStart t2 }) : flatten (t2:tss) -- |----| -- |--| | todsStart t1 < todsStart t2 && todsEnd t1 == todsEnd t2 = if todsPriority t1 > todsPriority t2 then flatten (t1:tss) else flatten ((t1 { todsEnd = todsStart t2 }) : t2:tss) -- |----| -- |--| | todsStart t1 < todsStart t2 && todsEnd t2 < todsEnd t1 = if todsPriority t1 > todsPriority t2 then flatten (t1:tss) else flatten $ (t1 { todsEnd = todsStart t2}) : (t2:(t1 { todsStart=todsEnd t2 }):tss) -- |----| -- |-------| | todsStart t1 == todsStart t2 && todsEnd t2 > todsEnd t1 = if todsPriority t1 > todsPriority t2 then flatten (t1:t2 { todsStart = todsEnd t1 } : tss) else flatten (t2:tss) -- |----| -- |----| | todsStart t1 == todsStart t2 && todsEnd t1 == todsEnd t2 = if todsPriority t1 > todsPriority t2 then flatten (t1:tss) else flatten (t2:tss) -- |----| -- |---| | todsStart t1 == todsStart t2 && todsEnd t1 > todsEnd t2 = if todsPriority t1 > todsPriority t2 then flatten (t1:tss) else flatten (t2:(t1 { todsStart = todsEnd t2 }):tss) | otherwise = t1 : flatten (t2:tss) flatten tss = tss
2,300
false
true
2
14
1,160
692
340
352
null
null
aelve/shortcut-links
src/ShortcutLinks/All.hs
bsd-3-clause
{- | __Bash__ – <http://bpkg.io bpkg> (shortcut: “bpkg”) Link to a package: @ \[markdown\](\@bpkg) <http://www.bpkg.io/pkg/markdown> @ -} bpkg :: Shortcut bpkg _ q = return $ "http://bpkg.io/pkg/" <> q
203
bpkg :: Shortcut bpkg _ q = return $ "http://bpkg.io/pkg/" <> q
63
bpkg _ q = return $ "http://bpkg.io/pkg/" <> q
46
true
true
2
6
30
31
14
17
null
null
sproctor/dirtywater
src/UserConnection.hs
gpl-2.0
removeUserConnection :: UserConnectionList -> UserConnection -> STM () removeUserConnection usersVar user = do users <- readTVar usersVar let updatedUsers = filter (/= user) users writeTVar usersVar updatedUsers
217
removeUserConnection :: UserConnectionList -> UserConnection -> STM () removeUserConnection usersVar user = do users <- readTVar usersVar let updatedUsers = filter (/= user) users writeTVar usersVar updatedUsers
217
removeUserConnection usersVar user = do users <- readTVar usersVar let updatedUsers = filter (/= user) users writeTVar usersVar updatedUsers
146
false
true
0
11
32
65
30
35
null
null
johnellis1392/Haskell-Scheme
Scheme/Eval/EvalUtil.hs
mit
-- Apply a function call to a list of arguments eval env (List (Atom f : args)) = mapM (eval env) args >>= liftThrows . apply f
128
eval env (List (Atom f : args)) = mapM (eval env) args >>= liftThrows . apply f
79
eval env (List (Atom f : args)) = mapM (eval env) args >>= liftThrows . apply f
79
true
false
0
9
27
52
24
28
null
null
michalkonecny/aern2
aern2-mfun/src/AERN2/BoxFunMinMax/Expressions/Parsers/Smt.hs
bsd-3-clause
-- |Process a parsed list of expressions to a VC. Everything in the context implies the goal. -- If the goal cannot be determined, we return Nothing processVC :: [LD.Expression] -> Maybe F processVC parsedExpressions = trace (show (maybe Nothing termToF mGoal)) $ trace (show variablesWithTypes) $ case mGoalF of Just goalF -> if null contextF then Just goalF else Just $ FConn Impl (foldContextF contextF) goalF Nothing -> Nothing where (goalWithNot, context) = (takeGoalFromAssertions . findAssertions) parsedExpressions mGoal = case goalWithNot of LD.Application (LD.Variable "not") [operand] -> Just operand -- Goals in SMT look like this _ -> Nothing contextF = mapMaybe (`determineFloatTypeF` variablesWithTypes) $ termsToF context mGoalF = maybe Nothing (`determineFloatTypeF` variablesWithTypes) $ maybe Nothing termToF mGoal variablesWithTypes = findVariables parsedExpressions foldContextF :: [F] -> F foldContextF [] = error "processVC - foldContextF: Empty list given" foldContextF [f] = f foldContextF (f : fs) = FConn And f (foldContextF fs) -- contextFAnd = foldl -- |Derive ranges for a VC (Implication where a CNF implies a goal) -- Remove anything which refers to a variable for which we cannot derive ranges -- If the goal contains underivable variables, return Nothing
1,419
processVC :: [LD.Expression] -> Maybe F processVC parsedExpressions = trace (show (maybe Nothing termToF mGoal)) $ trace (show variablesWithTypes) $ case mGoalF of Just goalF -> if null contextF then Just goalF else Just $ FConn Impl (foldContextF contextF) goalF Nothing -> Nothing where (goalWithNot, context) = (takeGoalFromAssertions . findAssertions) parsedExpressions mGoal = case goalWithNot of LD.Application (LD.Variable "not") [operand] -> Just operand -- Goals in SMT look like this _ -> Nothing contextF = mapMaybe (`determineFloatTypeF` variablesWithTypes) $ termsToF context mGoalF = maybe Nothing (`determineFloatTypeF` variablesWithTypes) $ maybe Nothing termToF mGoal variablesWithTypes = findVariables parsedExpressions foldContextF :: [F] -> F foldContextF [] = error "processVC - foldContextF: Empty list given" foldContextF [f] = f foldContextF (f : fs) = FConn And f (foldContextF fs) -- contextFAnd = foldl -- |Derive ranges for a VC (Implication where a CNF implies a goal) -- Remove anything which refers to a variable for which we cannot derive ranges -- If the goal contains underivable variables, return Nothing
1,270
processVC parsedExpressions = trace (show (maybe Nothing termToF mGoal)) $ trace (show variablesWithTypes) $ case mGoalF of Just goalF -> if null contextF then Just goalF else Just $ FConn Impl (foldContextF contextF) goalF Nothing -> Nothing where (goalWithNot, context) = (takeGoalFromAssertions . findAssertions) parsedExpressions mGoal = case goalWithNot of LD.Application (LD.Variable "not") [operand] -> Just operand -- Goals in SMT look like this _ -> Nothing contextF = mapMaybe (`determineFloatTypeF` variablesWithTypes) $ termsToF context mGoalF = maybe Nothing (`determineFloatTypeF` variablesWithTypes) $ maybe Nothing termToF mGoal variablesWithTypes = findVariables parsedExpressions foldContextF :: [F] -> F foldContextF [] = error "processVC - foldContextF: Empty list given" foldContextF [f] = f foldContextF (f : fs) = FConn And f (foldContextF fs) -- contextFAnd = foldl -- |Derive ranges for a VC (Implication where a CNF implies a goal) -- Remove anything which refers to a variable for which we cannot derive ranges -- If the goal contains underivable variables, return Nothing
1,229
true
true
6
12
322
333
161
172
null
null
lehins/unm-hip
Data/Image/Boxed.hs
gpl-3.0
colorOp :: (Double -> Double -> Double) -> Color -> Color -> Color colorOp op (toRGB -> (a, b, c)) (toRGB -> (d, e, f)) = RGB (op a d, op b e, op c f)
150
colorOp :: (Double -> Double -> Double) -> Color -> Color -> Color colorOp op (toRGB -> (a, b, c)) (toRGB -> (d, e, f)) = RGB (op a d, op b e, op c f)
150
colorOp op (toRGB -> (a, b, c)) (toRGB -> (d, e, f)) = RGB (op a d, op b e, op c f)
83
false
true
0
8
35
100
54
46
null
null
bhickey/catamad
src/Keyboard.hs
gpl-3.0
getAction :: KeyboardMap Action -> Char -> Action getAction m k = M.findWithDefault (Right NoAction) k m
104
getAction :: KeyboardMap Action -> Char -> Action getAction m k = M.findWithDefault (Right NoAction) k m
104
getAction m k = M.findWithDefault (Right NoAction) k m
54
false
true
0
7
16
42
20
22
null
null
rueshyna/gogol
gogol-games/gen/Network/Google/Games/Types/Product.hs
mpl-2.0
-- | The value of the contribution. qValue :: Lens' QuestContribution (Maybe Int64) qValue = lens _qValue (\ s a -> s{_qValue = a}) . mapping _Coerce
157
qValue :: Lens' QuestContribution (Maybe Int64) qValue = lens _qValue (\ s a -> s{_qValue = a}) . mapping _Coerce
121
qValue = lens _qValue (\ s a -> s{_qValue = a}) . mapping _Coerce
73
true
true
0
10
34
55
28
27
null
null
oldmanmike/ghc
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
assignReg_IntCode pk reg (CmmLoad src _) = do load_code <- intLoadCode (MOV pk) src dflags <- getDynFlags let platform = targetPlatform dflags return (load_code (getRegisterReg platform False{-no sse2-} reg)) -- dst is a reg, but src could be anything
260
assignReg_IntCode pk reg (CmmLoad src _) = do load_code <- intLoadCode (MOV pk) src dflags <- getDynFlags let platform = targetPlatform dflags return (load_code (getRegisterReg platform False{-no sse2-} reg)) -- dst is a reg, but src could be anything
260
assignReg_IntCode pk reg (CmmLoad src _) = do load_code <- intLoadCode (MOV pk) src dflags <- getDynFlags let platform = targetPlatform dflags return (load_code (getRegisterReg platform False{-no sse2-} reg)) -- dst is a reg, but src could be anything
260
false
false
0
11
47
85
38
47
null
null
fmapfmapfmap/amazonka
amazonka-importexport/gen/Network/AWS/ImportExport/Types/Product.hs
mpl-2.0
-- | Undocumented member. jobIsCanceled :: Lens' Job Bool jobIsCanceled = lens _jobIsCanceled (\ s a -> s{_jobIsCanceled = a})
126
jobIsCanceled :: Lens' Job Bool jobIsCanceled = lens _jobIsCanceled (\ s a -> s{_jobIsCanceled = a})
100
jobIsCanceled = lens _jobIsCanceled (\ s a -> s{_jobIsCanceled = a})
68
true
true
0
9
19
40
22
18
null
null
pranjaltale16/codeworld
codeworld-api/src/CodeWorld/Picture.hs
apache-2.0
{-| Angle is in radians -} rotatedVector :: Double -> Vector -> Vector rotatedVector angle (x, y) = (x * cos angle - y * sin angle, x * sin angle + y * cos angle)
166
rotatedVector :: Double -> Vector -> Vector rotatedVector angle (x, y) = (x * cos angle - y * sin angle, x * sin angle + y * cos angle)
139
rotatedVector angle (x, y) = (x * cos angle - y * sin angle, x * sin angle + y * cos angle)
95
true
true
0
9
39
73
37
36
null
null
wouwouwou/2017_module_8
src/haskell/PP-project-2016/Checker.hs
apache-2.0
checker2 (ASTPrint exprs _) check = ASTPrint (map (\x -> checker2 x check) exprs) check
91
checker2 (ASTPrint exprs _) check = ASTPrint (map (\x -> checker2 x check) exprs) check
91
checker2 (ASTPrint exprs _) check = ASTPrint (map (\x -> checker2 x check) exprs) check
91
false
false
1
10
18
49
22
27
null
null
syanidar/Sophy
src/Test/SpeedTest.hs
bsd-3-clause
speedtest :: Int -> String -> IO () speedtest x y = do let extract = fromMaybe (error "Depth must be greater than 0.") . foldl1 (>=>) . replicate x $ legalPositions nodeCount = length . extract $ fromFEN y start <- getCurrentTime putStrLn $ "NODE: " ++ show nodeCount end <- getCurrentTime let elapse = fromEnum (diffUTCTime end start) `div` 1000000000 putStrLn $ "TIME(MILLISECOND): " ++ show elapse putStrLn $ "NPS: " ++ show (nodeCount * 1000 `div` elapse)
557
speedtest :: Int -> String -> IO () speedtest x y = do let extract = fromMaybe (error "Depth must be greater than 0.") . foldl1 (>=>) . replicate x $ legalPositions nodeCount = length . extract $ fromFEN y start <- getCurrentTime putStrLn $ "NODE: " ++ show nodeCount end <- getCurrentTime let elapse = fromEnum (diffUTCTime end start) `div` 1000000000 putStrLn $ "TIME(MILLISECOND): " ++ show elapse putStrLn $ "NPS: " ++ show (nodeCount * 1000 `div` elapse)
557
speedtest x y = do let extract = fromMaybe (error "Depth must be greater than 0.") . foldl1 (>=>) . replicate x $ legalPositions nodeCount = length . extract $ fromFEN y start <- getCurrentTime putStrLn $ "NODE: " ++ show nodeCount end <- getCurrentTime let elapse = fromEnum (diffUTCTime end start) `div` 1000000000 putStrLn $ "TIME(MILLISECOND): " ++ show elapse putStrLn $ "NPS: " ++ show (nodeCount * 1000 `div` elapse)
521
false
true
2
15
177
177
85
92
null
null
Gabriel439/suns-search
src/AMQP/Error.hs
gpl-3.0
warnDeclareQueue :: QueueName -> QueueName -> String warnDeclareQueue name name' = "'declareQueue' returned a new queue name\n\ \ Requested queue name: '" ++ unpack name ++ "'\n\ \ Returned queue name: '" ++ unpack name' ++ "'"
238
warnDeclareQueue :: QueueName -> QueueName -> String warnDeclareQueue name name' = "'declareQueue' returned a new queue name\n\ \ Requested queue name: '" ++ unpack name ++ "'\n\ \ Returned queue name: '" ++ unpack name' ++ "'"
238
warnDeclareQueue name name' = "'declareQueue' returned a new queue name\n\ \ Requested queue name: '" ++ unpack name ++ "'\n\ \ Returned queue name: '" ++ unpack name' ++ "'"
185
false
true
0
9
47
46
22
24
null
null
Cahu/krpc-hs
src/KRPCHS/SpaceCenter.hs
gpl-3.0
{- - The name of the current engine mode. -} getEngineMode :: KRPCHS.SpaceCenter.Engine -> RPCContext (Data.Text.Text) getEngineMode thisArg = do let r = makeRequest "SpaceCenter" "Engine_get_Mode" [makeArgument 0 thisArg] res <- sendRequest r processResponse res
277
getEngineMode :: KRPCHS.SpaceCenter.Engine -> RPCContext (Data.Text.Text) getEngineMode thisArg = do let r = makeRequest "SpaceCenter" "Engine_get_Mode" [makeArgument 0 thisArg] res <- sendRequest r processResponse res
230
getEngineMode thisArg = do let r = makeRequest "SpaceCenter" "Engine_get_Mode" [makeArgument 0 thisArg] res <- sendRequest r processResponse res
156
true
true
0
13
48
76
35
41
null
null
danr/structural-induction
Induction/Structural/Linearise.hs
lgpl-3.0
-- | Linearises an `Obligation` using a given `Style`. The output format is -- inspired by TPTP, but with typed quantifiers. linObligation :: Style c v t -> Obligation c v t -> Doc linObligation s@Style{..} x = case x of Obligation sks [] concl -> linForall sks <+> linPred concl Obligation sks hyps concl -> hang (linForall sks) 4 $ cat $ parList $ punctuate (fluff ampersand) (map linHyp hyps) ++ [space <> darrow <+> linPred concl] where linTypedVar v t = linv v <+> colon <+> lint t linForall [] = empty linForall qs = bang <+> brackets (csv (map (uncurry linTypedVar) qs)) <+> colon linPred xs = char 'P' <> parens (csv (map (linTerm s) xs)) linHyp ([],hyp) = linPred hyp linHyp (qs,hyp) = parens (linForall qs <+> linPred hyp) -- | Linearises a `Term` using a given `Style`.
860
linObligation :: Style c v t -> Obligation c v t -> Doc linObligation s@Style{..} x = case x of Obligation sks [] concl -> linForall sks <+> linPred concl Obligation sks hyps concl -> hang (linForall sks) 4 $ cat $ parList $ punctuate (fluff ampersand) (map linHyp hyps) ++ [space <> darrow <+> linPred concl] where linTypedVar v t = linv v <+> colon <+> lint t linForall [] = empty linForall qs = bang <+> brackets (csv (map (uncurry linTypedVar) qs)) <+> colon linPred xs = char 'P' <> parens (csv (map (linTerm s) xs)) linHyp ([],hyp) = linPred hyp linHyp (qs,hyp) = parens (linForall qs <+> linPred hyp) -- | Linearises a `Term` using a given `Style`.
735
linObligation s@Style{..} x = case x of Obligation sks [] concl -> linForall sks <+> linPred concl Obligation sks hyps concl -> hang (linForall sks) 4 $ cat $ parList $ punctuate (fluff ampersand) (map linHyp hyps) ++ [space <> darrow <+> linPred concl] where linTypedVar v t = linv v <+> colon <+> lint t linForall [] = empty linForall qs = bang <+> brackets (csv (map (uncurry linTypedVar) qs)) <+> colon linPred xs = char 'P' <> parens (csv (map (linTerm s) xs)) linHyp ([],hyp) = linPred hyp linHyp (qs,hyp) = parens (linForall qs <+> linPred hyp) -- | Linearises a `Term` using a given `Style`.
679
true
true
14
13
221
254
134
120
null
null
mcschroeder/ghc
compiler/main/DynFlags.hs
bsd-3-clause
wayOptc _ WayProf = ["-DPROFILING"]
41
wayOptc _ WayProf = ["-DPROFILING"]
41
wayOptc _ WayProf = ["-DPROFILING"]
41
false
false
1
6
10
16
7
9
null
null
mettekou/ghc
compiler/basicTypes/Module.hs
bsd-3-clause
-- | Like 'renameHoleModule', but requires only 'PackageConfigMap' -- so it can be used by "Packages". renameHoleModule' :: PackageConfigMap -> ShHoleSubst -> Module -> Module renameHoleModule' pkg_map env m | not (isHoleModule m) = let uid = renameHoleUnitId' pkg_map env (moduleUnitId m) in mkModule uid (moduleName m) | Just m' <- lookupUFM env (moduleName m) = m' -- NB m = <Blah>, that's what's in scope. | otherwise = m
449
renameHoleModule' :: PackageConfigMap -> ShHoleSubst -> Module -> Module renameHoleModule' pkg_map env m | not (isHoleModule m) = let uid = renameHoleUnitId' pkg_map env (moduleUnitId m) in mkModule uid (moduleName m) | Just m' <- lookupUFM env (moduleName m) = m' -- NB m = <Blah>, that's what's in scope. | otherwise = m
346
renameHoleModule' pkg_map env m | not (isHoleModule m) = let uid = renameHoleUnitId' pkg_map env (moduleUnitId m) in mkModule uid (moduleName m) | Just m' <- lookupUFM env (moduleName m) = m' -- NB m = <Blah>, that's what's in scope. | otherwise = m
273
true
true
1
12
93
120
57
63
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
mpl-2.0
-- | The list of custom rich media events to include. rptccCustomRichMediaEvents :: Lens' ReportPathToConversionCriteria [DimensionValue] rptccCustomRichMediaEvents = lens _rptccCustomRichMediaEvents (\ s a -> s{_rptccCustomRichMediaEvents = a}) . _Default . _Coerce
286
rptccCustomRichMediaEvents :: Lens' ReportPathToConversionCriteria [DimensionValue] rptccCustomRichMediaEvents = lens _rptccCustomRichMediaEvents (\ s a -> s{_rptccCustomRichMediaEvents = a}) . _Default . _Coerce
232
rptccCustomRichMediaEvents = lens _rptccCustomRichMediaEvents (\ s a -> s{_rptccCustomRichMediaEvents = a}) . _Default . _Coerce
148
true
true
0
11
50
51
28
23
null
null
thomie/vector
Data/Vector.hs
bsd-3-clause
minimumBy = G.minimumBy
23
minimumBy = G.minimumBy
23
minimumBy = G.minimumBy
23
false
false
0
5
2
8
4
4
null
null
snowleopard/alga
test/Algebra/Graph/Test/RewriteRules.hs
mit
connectI, connectIR :: b -> (a -> b) -> (b -> b -> b) -> (b -> b -> b) -> Graph a -> Graph a -> b connectI e v o c x y = foldg e v o c (Connect x y)
151
connectI, connectIR :: b -> (a -> b) -> (b -> b -> b) -> (b -> b -> b) -> Graph a -> Graph a -> b connectI e v o c x y = foldg e v o c (Connect x y)
151
connectI e v o c x y = foldg e v o c (Connect x y)
51
false
true
2
12
46
110
53
57
null
null
lihlcnkr/codejam
backup/src/R1/AmpleSyrup.hs
apache-2.0
--getAmpleSyrup' :: Int -> [(Double,Double)] -> Double --getAmpleSyrup' y zss@(z:zs) = getCirleSuface (fst z) + sum (fmap getHeightSuface zss) getAmpleSyrup' :: Int -> [(Double,Double)] -> Double getAmpleSyrup' y zss@(z:zs) | y >= (length zss) = getCirleSuface (fst z) + sum (fmap getHeightSuface zss) | otherwise = let fcs = getCirleSuface (fst z) in fcs + (getHeightSuface z) + sum (take (y-1) (sortBy (\x' y' -> compare y' x') (fmap getHeightSuface zs)))
483
getAmpleSyrup' :: Int -> [(Double,Double)] -> Double getAmpleSyrup' y zss@(z:zs) | y >= (length zss) = getCirleSuface (fst z) + sum (fmap getHeightSuface zss) | otherwise = let fcs = getCirleSuface (fst z) in fcs + (getHeightSuface z) + sum (take (y-1) (sortBy (\x' y' -> compare y' x') (fmap getHeightSuface zs)))
339
getAmpleSyrup' y zss@(z:zs) | y >= (length zss) = getCirleSuface (fst z) + sum (fmap getHeightSuface zss) | otherwise = let fcs = getCirleSuface (fst z) in fcs + (getHeightSuface z) + sum (take (y-1) (sortBy (\x' y' -> compare y' x') (fmap getHeightSuface zs)))
286
true
true
1
15
96
175
89
86
null
null
psfblair/freepalace
src/FreePalace/Messages/PalaceProtocol/InboundReader.hs
apache-2.0
readRoomDescription :: (Int -> IO [Word8]) -> IO Word16 -> IO Int -> Inbound.Header -> IO Inbound.InboundMessage readRoomDescription readBytes readShort readInt header = do roomFlags <- readInt -- unused face <- readInt -- unused roomId <- fromIntegral <$> readShort roomNameOffset <- fromIntegral <$> readShort backgroundImageNameOffset <- fromIntegral <$> readShort artistNameOffset <- fromIntegral <$> readShort passwordOffset <- fromIntegral <$> readShort hotSpotCount <- fromIntegral <$> readShort hotSpotOffset <- fromIntegral <$> readShort overlayImageCount <- fromIntegral <$> readShort overlayImageOffset <- fromIntegral <$> readShort drawCommandsCount <- fromIntegral <$> readShort firstDrawCommand <- readShort peopleCount <- fromIntegral <$> readShort loosePropCount <- fromIntegral <$> readShort firstLooseProp <- readShort unused <- readShort roomDataLength <- fromIntegral <$> readShort roomData <- readBytes $ roomDataLength let paddingLength = (Inbound.messageSize header) - roomDataLength - 40 -- We have used (roomDataLength + 40 bytes so far) padding <- readBytes paddingLength -- This message doesn't come in very often so we're not going to use arrays unless it really makes things slow. let roomNameLength = fromIntegral $ head $ drop roomNameOffset roomData roomName = map Convert.convert $ take roomNameLength $ drop (roomNameOffset + 1) roomData backgroundImageNameLength = fromIntegral $ head $ drop backgroundImageNameOffset roomData backgroundImageName = map Convert.convert $ take backgroundImageNameLength $ drop (backgroundImageNameOffset + 1) roomData roomDescription = Inbound.RoomDescription { Inbound.roomDescId = roomId , Inbound.roomDescName = roomName , Inbound.roomDescBackground = backgroundImageName } return $ Inbound.RoomDescriptionMessage roomDescription {- Next, load: -- overlay images -- hotspots -- loose props -- draw commands For each overlay image: refCon = imageBA.readInt(); -- unused id = imageBA.readShort(); picNameOffset = imageBA.readShort(); transparencyIndex = imageBA.readShort(); readShort(); -- Reserved: padding for field alignment picNameLength <- readByte picName <- readBytes -- from picNameOffset using picNameLength. -- This is the filename. May need URL escaping based on configuration For each hotspot: scriptEventMask <- readInt flags <- readInt -- unused? secureInfo <- readInt refCon <- readInt location.y <- readShort location.x <- readShort id <- readShort -- unused? dest <- readShort numPoints <- readShort -- local, used for loading vertices (below) pointsOffset <- readShort type <- readShort groupId <- readShort nbrScripts <- readShort scriptRecordOffset <- readShort state <- readShort numStates <- readShort var stateRecordOffset:int <- readShort var nameOffset:int <- readShort var scriptTextOffset:int <- readShort readShort -- unused? nameLength name -- using nameOffset and nameLength Now look for script info using the scriptTextOffset: scriptString <- readBytes ... -- all the bytes to the end of the hotspot bytes (this then gets parsed and loaded) Now go back into the array and read the vertices of the points of the hotspot, starting with pointsOffset, loop numPoints times: y <- readShort x <- readShort Now go back into the array and read the hotspot states starting at stateOffset and looping numStates times. A state is 8 bytes: pictureId <- readShort readShort -- unused y <- readShort x <- readShort For each loose prop -- this is 24 bytes: nextOffset <- readShort -- This is the offset into the room data bytes for the next loose prop readShort id <- readUnsignedInt crc <- readUnsignedInt flags <- readUnsignedInt readInt y <- readShort x <- readShort For each draw command -- has a 10-byte header and then a length specified by commandLength: Header: nextOffset <- readShort -- offset into the room data bytes for the next draw command ba.readShort -- reserved, unused command <- readUnsignedShort -- contains both flags and command, obtained by bit shifting/masking. Ignore CMD_DETONATE and CMD_DELETE (?) commandLength <- readUnsignedShort commandStart <- readShort -- if it's 0, reset to 10 to start after header. (?) Starting at commandStart, read pen size and colors (add a preset alpha): penSize <- readShort numPoints <- readShort red <- readUnsignedByte readUnsignedByte -- Values are doubled; unclear why. green <- readUnsignedByte readUnsignedByte -- doubled greem blue <- readUnsignedByte readUnsignedByte -- doubled blue For each point in the polygon up to numPoints: y <- readShort x <- readShort If there are remaining bytes (if this fails, fall back to using pen color for everything - this means PalaceChat 3 style packets?) alphaInt <- readUnsignedByte -- line color and alpha red <- readUnsignedByte green <- readUnsignedByte blue <- readUnsignedByte alphaInt <- readUnsignedByte -- fill color and alpha red <- readUnsignedByte green <- readUnsignedByte blue <- readUnsignedByte -} -- List of users in the current room
5,433
readRoomDescription :: (Int -> IO [Word8]) -> IO Word16 -> IO Int -> Inbound.Header -> IO Inbound.InboundMessage readRoomDescription readBytes readShort readInt header = do roomFlags <- readInt -- unused face <- readInt -- unused roomId <- fromIntegral <$> readShort roomNameOffset <- fromIntegral <$> readShort backgroundImageNameOffset <- fromIntegral <$> readShort artistNameOffset <- fromIntegral <$> readShort passwordOffset <- fromIntegral <$> readShort hotSpotCount <- fromIntegral <$> readShort hotSpotOffset <- fromIntegral <$> readShort overlayImageCount <- fromIntegral <$> readShort overlayImageOffset <- fromIntegral <$> readShort drawCommandsCount <- fromIntegral <$> readShort firstDrawCommand <- readShort peopleCount <- fromIntegral <$> readShort loosePropCount <- fromIntegral <$> readShort firstLooseProp <- readShort unused <- readShort roomDataLength <- fromIntegral <$> readShort roomData <- readBytes $ roomDataLength let paddingLength = (Inbound.messageSize header) - roomDataLength - 40 -- We have used (roomDataLength + 40 bytes so far) padding <- readBytes paddingLength -- This message doesn't come in very often so we're not going to use arrays unless it really makes things slow. let roomNameLength = fromIntegral $ head $ drop roomNameOffset roomData roomName = map Convert.convert $ take roomNameLength $ drop (roomNameOffset + 1) roomData backgroundImageNameLength = fromIntegral $ head $ drop backgroundImageNameOffset roomData backgroundImageName = map Convert.convert $ take backgroundImageNameLength $ drop (backgroundImageNameOffset + 1) roomData roomDescription = Inbound.RoomDescription { Inbound.roomDescId = roomId , Inbound.roomDescName = roomName , Inbound.roomDescBackground = backgroundImageName } return $ Inbound.RoomDescriptionMessage roomDescription {- Next, load: -- overlay images -- hotspots -- loose props -- draw commands For each overlay image: refCon = imageBA.readInt(); -- unused id = imageBA.readShort(); picNameOffset = imageBA.readShort(); transparencyIndex = imageBA.readShort(); readShort(); -- Reserved: padding for field alignment picNameLength <- readByte picName <- readBytes -- from picNameOffset using picNameLength. -- This is the filename. May need URL escaping based on configuration For each hotspot: scriptEventMask <- readInt flags <- readInt -- unused? secureInfo <- readInt refCon <- readInt location.y <- readShort location.x <- readShort id <- readShort -- unused? dest <- readShort numPoints <- readShort -- local, used for loading vertices (below) pointsOffset <- readShort type <- readShort groupId <- readShort nbrScripts <- readShort scriptRecordOffset <- readShort state <- readShort numStates <- readShort var stateRecordOffset:int <- readShort var nameOffset:int <- readShort var scriptTextOffset:int <- readShort readShort -- unused? nameLength name -- using nameOffset and nameLength Now look for script info using the scriptTextOffset: scriptString <- readBytes ... -- all the bytes to the end of the hotspot bytes (this then gets parsed and loaded) Now go back into the array and read the vertices of the points of the hotspot, starting with pointsOffset, loop numPoints times: y <- readShort x <- readShort Now go back into the array and read the hotspot states starting at stateOffset and looping numStates times. A state is 8 bytes: pictureId <- readShort readShort -- unused y <- readShort x <- readShort For each loose prop -- this is 24 bytes: nextOffset <- readShort -- This is the offset into the room data bytes for the next loose prop readShort id <- readUnsignedInt crc <- readUnsignedInt flags <- readUnsignedInt readInt y <- readShort x <- readShort For each draw command -- has a 10-byte header and then a length specified by commandLength: Header: nextOffset <- readShort -- offset into the room data bytes for the next draw command ba.readShort -- reserved, unused command <- readUnsignedShort -- contains both flags and command, obtained by bit shifting/masking. Ignore CMD_DETONATE and CMD_DELETE (?) commandLength <- readUnsignedShort commandStart <- readShort -- if it's 0, reset to 10 to start after header. (?) Starting at commandStart, read pen size and colors (add a preset alpha): penSize <- readShort numPoints <- readShort red <- readUnsignedByte readUnsignedByte -- Values are doubled; unclear why. green <- readUnsignedByte readUnsignedByte -- doubled greem blue <- readUnsignedByte readUnsignedByte -- doubled blue For each point in the polygon up to numPoints: y <- readShort x <- readShort If there are remaining bytes (if this fails, fall back to using pen color for everything - this means PalaceChat 3 style packets?) alphaInt <- readUnsignedByte -- line color and alpha red <- readUnsignedByte green <- readUnsignedByte blue <- readUnsignedByte alphaInt <- readUnsignedByte -- fill color and alpha red <- readUnsignedByte green <- readUnsignedByte blue <- readUnsignedByte -} -- List of users in the current room
5,433
readRoomDescription readBytes readShort readInt header = do roomFlags <- readInt -- unused face <- readInt -- unused roomId <- fromIntegral <$> readShort roomNameOffset <- fromIntegral <$> readShort backgroundImageNameOffset <- fromIntegral <$> readShort artistNameOffset <- fromIntegral <$> readShort passwordOffset <- fromIntegral <$> readShort hotSpotCount <- fromIntegral <$> readShort hotSpotOffset <- fromIntegral <$> readShort overlayImageCount <- fromIntegral <$> readShort overlayImageOffset <- fromIntegral <$> readShort drawCommandsCount <- fromIntegral <$> readShort firstDrawCommand <- readShort peopleCount <- fromIntegral <$> readShort loosePropCount <- fromIntegral <$> readShort firstLooseProp <- readShort unused <- readShort roomDataLength <- fromIntegral <$> readShort roomData <- readBytes $ roomDataLength let paddingLength = (Inbound.messageSize header) - roomDataLength - 40 -- We have used (roomDataLength + 40 bytes so far) padding <- readBytes paddingLength -- This message doesn't come in very often so we're not going to use arrays unless it really makes things slow. let roomNameLength = fromIntegral $ head $ drop roomNameOffset roomData roomName = map Convert.convert $ take roomNameLength $ drop (roomNameOffset + 1) roomData backgroundImageNameLength = fromIntegral $ head $ drop backgroundImageNameOffset roomData backgroundImageName = map Convert.convert $ take backgroundImageNameLength $ drop (backgroundImageNameOffset + 1) roomData roomDescription = Inbound.RoomDescription { Inbound.roomDescId = roomId , Inbound.roomDescName = roomName , Inbound.roomDescBackground = backgroundImageName } return $ Inbound.RoomDescriptionMessage roomDescription {- Next, load: -- overlay images -- hotspots -- loose props -- draw commands For each overlay image: refCon = imageBA.readInt(); -- unused id = imageBA.readShort(); picNameOffset = imageBA.readShort(); transparencyIndex = imageBA.readShort(); readShort(); -- Reserved: padding for field alignment picNameLength <- readByte picName <- readBytes -- from picNameOffset using picNameLength. -- This is the filename. May need URL escaping based on configuration For each hotspot: scriptEventMask <- readInt flags <- readInt -- unused? secureInfo <- readInt refCon <- readInt location.y <- readShort location.x <- readShort id <- readShort -- unused? dest <- readShort numPoints <- readShort -- local, used for loading vertices (below) pointsOffset <- readShort type <- readShort groupId <- readShort nbrScripts <- readShort scriptRecordOffset <- readShort state <- readShort numStates <- readShort var stateRecordOffset:int <- readShort var nameOffset:int <- readShort var scriptTextOffset:int <- readShort readShort -- unused? nameLength name -- using nameOffset and nameLength Now look for script info using the scriptTextOffset: scriptString <- readBytes ... -- all the bytes to the end of the hotspot bytes (this then gets parsed and loaded) Now go back into the array and read the vertices of the points of the hotspot, starting with pointsOffset, loop numPoints times: y <- readShort x <- readShort Now go back into the array and read the hotspot states starting at stateOffset and looping numStates times. A state is 8 bytes: pictureId <- readShort readShort -- unused y <- readShort x <- readShort For each loose prop -- this is 24 bytes: nextOffset <- readShort -- This is the offset into the room data bytes for the next loose prop readShort id <- readUnsignedInt crc <- readUnsignedInt flags <- readUnsignedInt readInt y <- readShort x <- readShort For each draw command -- has a 10-byte header and then a length specified by commandLength: Header: nextOffset <- readShort -- offset into the room data bytes for the next draw command ba.readShort -- reserved, unused command <- readUnsignedShort -- contains both flags and command, obtained by bit shifting/masking. Ignore CMD_DETONATE and CMD_DELETE (?) commandLength <- readUnsignedShort commandStart <- readShort -- if it's 0, reset to 10 to start after header. (?) Starting at commandStart, read pen size and colors (add a preset alpha): penSize <- readShort numPoints <- readShort red <- readUnsignedByte readUnsignedByte -- Values are doubled; unclear why. green <- readUnsignedByte readUnsignedByte -- doubled greem blue <- readUnsignedByte readUnsignedByte -- doubled blue For each point in the polygon up to numPoints: y <- readShort x <- readShort If there are remaining bytes (if this fails, fall back to using pen color for everything - this means PalaceChat 3 style packets?) alphaInt <- readUnsignedByte -- line color and alpha red <- readUnsignedByte green <- readUnsignedByte blue <- readUnsignedByte alphaInt <- readUnsignedByte -- fill color and alpha red <- readUnsignedByte green <- readUnsignedByte blue <- readUnsignedByte -} -- List of users in the current room
5,320
false
true
0
14
1,191
443
213
230
null
null
dolio/vector
Data/Vector/Generic/New.hs
bsd-3-clause
slice i n m = apply (MVector.slice i n) m
41
slice i n m = apply (MVector.slice i n) m
41
slice i n m = apply (MVector.slice i n) m
41
false
false
0
8
9
30
13
17
null
null
sgraf812/lowgl
Graphics/GL/Low/Texture.hs
bsd-2-clause
newEmptyCubeMap :: (MonadIO m, InternalFormat a) => Int -> Int -> m (CubeMap a) newEmptyCubeMap w h = do let w' = fromIntegral w let h' = fromIntegral h n <- liftIO $ alloca (\ptr -> glGenTextures 1 ptr >> peek ptr) tex <- return (CubeMap n) let fmt = internalFormat tex let fmt' = internalFormat tex glBindTexture GL_TEXTURE_CUBE_MAP n glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_X 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr return tex -- | Delete a texture.
929
newEmptyCubeMap :: (MonadIO m, InternalFormat a) => Int -> Int -> m (CubeMap a) newEmptyCubeMap w h = do let w' = fromIntegral w let h' = fromIntegral h n <- liftIO $ alloca (\ptr -> glGenTextures 1 ptr >> peek ptr) tex <- return (CubeMap n) let fmt = internalFormat tex let fmt' = internalFormat tex glBindTexture GL_TEXTURE_CUBE_MAP n glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_X 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr return tex -- | Delete a texture.
929
newEmptyCubeMap w h = do let w' = fromIntegral w let h' = fromIntegral h n <- liftIO $ alloca (\ptr -> glGenTextures 1 ptr >> peek ptr) tex <- return (CubeMap n) let fmt = internalFormat tex let fmt' = internalFormat tex glBindTexture GL_TEXTURE_CUBE_MAP n glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_X 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0 fmt w' h' 0 fmt' GL_UNSIGNED_BYTE nullPtr return tex -- | Delete a texture.
849
false
true
0
13
157
293
133
160
null
null
clarkcb/xsearch
haskell/hssearch/test/HsSearch/SearchResultTest.hs
mit
getBinaryFileSearchResultTests :: IO [Test] getBinaryFileSearchResultTests = do xsearchPath <- getXsearchPath let binaryFilePath = xsearchPath ++ "/csharp/CsSearch/CsSearch/Searcher.exe" let binaryFileSearchResult = blankSearchResult { filePath=binaryFilePath , lineNum=0 , matchStartIndex=0 , matchEndIndex=0 } let settings = defaultSearchSettings let formattedResult = formatSearchResult settings binaryFileSearchResult let expectedFormat = binaryFilePath ++ " matches at [0:0]" return [testCase "binaryFileSearchResult" (formattedResult @?= expectedFormat)]
770
getBinaryFileSearchResultTests :: IO [Test] getBinaryFileSearchResultTests = do xsearchPath <- getXsearchPath let binaryFilePath = xsearchPath ++ "/csharp/CsSearch/CsSearch/Searcher.exe" let binaryFileSearchResult = blankSearchResult { filePath=binaryFilePath , lineNum=0 , matchStartIndex=0 , matchEndIndex=0 } let settings = defaultSearchSettings let formattedResult = formatSearchResult settings binaryFileSearchResult let expectedFormat = binaryFilePath ++ " matches at [0:0]" return [testCase "binaryFileSearchResult" (formattedResult @?= expectedFormat)]
770
getBinaryFileSearchResultTests = do xsearchPath <- getXsearchPath let binaryFilePath = xsearchPath ++ "/csharp/CsSearch/CsSearch/Searcher.exe" let binaryFileSearchResult = blankSearchResult { filePath=binaryFilePath , lineNum=0 , matchStartIndex=0 , matchEndIndex=0 } let settings = defaultSearchSettings let formattedResult = formatSearchResult settings binaryFileSearchResult let expectedFormat = binaryFilePath ++ " matches at [0:0]" return [testCase "binaryFileSearchResult" (formattedResult @?= expectedFormat)]
726
false
true
1
7
263
118
65
53
null
null
m-alvarez/jhc
lib/jhc/Foreign/Marshal/Array.hs
mit
newArray :: Storable a => [a] -> IO (Ptr a) newArray vals = do ptr <- mallocArray (length vals) pokeArray ptr vals return ptr -- |Write a list of storable elements into a newly allocated, consecutive -- sequence of storable values, where the end is fixed by the given end marker --
294
newArray :: Storable a => [a] -> IO (Ptr a) newArray vals = do ptr <- mallocArray (length vals) pokeArray ptr vals return ptr -- |Write a list of storable elements into a newly allocated, consecutive -- sequence of storable values, where the end is fixed by the given end marker --
294
newArray vals = do ptr <- mallocArray (length vals) pokeArray ptr vals return ptr -- |Write a list of storable elements into a newly allocated, consecutive -- sequence of storable values, where the end is fixed by the given end marker --
245
false
true
0
10
64
70
33
37
null
null
sopvop/snap
test/suite/Snap/Snaplet/Auth/Handlers/Tests.hs
bsd-3-clause
------------------------------------------------------------------------------ isLeftFailure :: AuthFailure -> Either AuthFailure AuthUser -> Bool isLeftFailure failure (Left expected) = failure == expected
206
isLeftFailure :: AuthFailure -> Either AuthFailure AuthUser -> Bool isLeftFailure failure (Left expected) = failure == expected
127
isLeftFailure failure (Left expected) = failure == expected
59
true
true
0
7
17
40
20
20
null
null
vdweegen/UvA-Software_Testing
Lab6/Lecture6.hs
gpl-3.0
mers 14 = 2^607-1
17
mers 14 = 2^607-1
17
mers 14 = 2^607-1
17
false
false
3
5
3
23
8
15
null
null
mumuki/mulang
src/Language/Mulang/Analyzer/ExpectationsCompiler.hs
gpl-3.0
compileBinding ('~':name) = Like name
39
compileBinding ('~':name) = Like name
39
compileBinding ('~':name) = Like name
39
false
false
0
6
6
20
9
11
null
null
olsner/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
pprInstr (PREFETCH Lvl2 format src) = pprFormatOp_ (sLit "prefetcht2") format src
81
pprInstr (PREFETCH Lvl2 format src) = pprFormatOp_ (sLit "prefetcht2") format src
81
pprInstr (PREFETCH Lvl2 format src) = pprFormatOp_ (sLit "prefetcht2") format src
81
false
false
0
7
10
32
15
17
null
null
clinty/Juicy.Pixels
src/Codec/Picture/Saving.hs
bsd-3-clause
imageToPng (ImageRGB16 img) = encodePng img
44
imageToPng (ImageRGB16 img) = encodePng img
44
imageToPng (ImageRGB16 img) = encodePng img
44
false
false
0
7
6
18
8
10
null
null
micknelso/language-c
src/Language/CFamily/C/Analysis/TypeUtils.hs
bsd-3-clause
-- | Check whether a type is a floating-point numeric type. This -- function does not attempt to resolve @typedef@ types. isFloatingType :: Type -> Bool isFloatingType (DirectType (TyFloating _) _ _) = True
208
isFloatingType :: Type -> Bool isFloatingType (DirectType (TyFloating _) _ _) = True
84
isFloatingType (DirectType (TyFloating _) _ _) = True
53
true
true
0
9
35
36
19
17
null
null
Feeniks/valkyrie
src/Valkyrie/Math.hs
bsd-3-clause
rotationZ :: Angle -> Matrix44 rotationZ a = zero44 { m11 = cos r, m12 = sin r, m21 = -(sin r), m22 = cos r, m33 = 1, m44 = 1 } where r = toRadians a
149
rotationZ :: Angle -> Matrix44 rotationZ a = zero44 { m11 = cos r, m12 = sin r, m21 = -(sin r), m22 = cos r, m33 = 1, m44 = 1 } where r = toRadians a
149
rotationZ a = zero44 { m11 = cos r, m12 = sin r, m21 = -(sin r), m22 = cos r, m33 = 1, m44 = 1 } where r = toRadians a
118
false
true
0
9
37
83
46
37
null
null
tadeuzagallo/verve-lang
src/Syntax/Decl.hs
mit
p_typeAlias :: Parser Decl p_typeAlias = liftParser $ do reserved "type" aliasName <- ucid aliasVars <- option [] (angles . commaSep $ ucid) symbol "=" aliasType <- p_type return TypeAlias { aliasName, aliasVars, aliasType, resolvedType = Nothing }
260
p_typeAlias :: Parser Decl p_typeAlias = liftParser $ do reserved "type" aliasName <- ucid aliasVars <- option [] (angles . commaSep $ ucid) symbol "=" aliasType <- p_type return TypeAlias { aliasName, aliasVars, aliasType, resolvedType = Nothing }
260
p_typeAlias = liftParser $ do reserved "type" aliasName <- ucid aliasVars <- option [] (angles . commaSep $ ucid) symbol "=" aliasType <- p_type return TypeAlias { aliasName, aliasVars, aliasType, resolvedType = Nothing }
233
false
true
0
12
49
92
44
48
null
null
tcrs/lit
src/Html.hs
gpl-2.0
(<++>) :: T.Text -> T.Text -> T.Text (<++>) = T.append
54
(<++>) :: T.Text -> T.Text -> T.Text (<++>) = T.append
54
(<++>) = T.append
17
false
true
0
7
9
31
18
13
null
null
brendanhay/gogol
gogol-cloudasset/gen/Network/Google/CloudAsset/Types/Product.hs
mpl-2.0
-- | Allowed OS versions, an empty list allows all types and all versions. giamvdpOSConstraints :: Lens' GoogleIdentityAccesscontextManagerV1DevicePolicy [GoogleIdentityAccesscontextManagerV1OSConstraint] giamvdpOSConstraints = lens _giamvdpOSConstraints (\ s a -> s{_giamvdpOSConstraints = a}) . _Default . _Coerce
335
giamvdpOSConstraints :: Lens' GoogleIdentityAccesscontextManagerV1DevicePolicy [GoogleIdentityAccesscontextManagerV1OSConstraint] giamvdpOSConstraints = lens _giamvdpOSConstraints (\ s a -> s{_giamvdpOSConstraints = a}) . _Default . _Coerce
260
giamvdpOSConstraints = lens _giamvdpOSConstraints (\ s a -> s{_giamvdpOSConstraints = a}) . _Default . _Coerce
130
true
true
2
8
53
57
28
29
null
null
mbakke/ganeti
test/hs/Test/Ganeti/WConfd/TempRes.hs
bsd-2-clause
prop_TempRes_serialisation :: TempRes Int Int -> Property prop_TempRes_serialisation = testSerialisation
104
prop_TempRes_serialisation :: TempRes Int Int -> Property prop_TempRes_serialisation = testSerialisation
104
prop_TempRes_serialisation = testSerialisation
46
false
true
0
6
9
20
10
10
null
null
dylex/range-set
src/Data/RangeSet/Internal.hs
mit
-- |Add @[x,y]@. -- There are three possibilities we consider, when inserting into non-empty set: -- * discretely after: continue -- * discretely before: prepend -- * overlapping: union and prepend insertRangeList :: (Ord a, Enum a) => a -> a -> [(a, a)] -> [(a, a)] insertRangeList x y set@(uv@(u,v) : xs) | v < x && succ v /= x = uv : insertRangeList x y xs | y < u && succ y /= u = (x,y) : set | otherwise = prependRangeList (min x u) (max y v) xs
467
insertRangeList :: (Ord a, Enum a) => a -> a -> [(a, a)] -> [(a, a)] insertRangeList x y set@(uv@(u,v) : xs) | v < x && succ v /= x = uv : insertRangeList x y xs | y < u && succ y /= u = (x,y) : set | otherwise = prependRangeList (min x u) (max y v) xs
269
insertRangeList x y set@(uv@(u,v) : xs) | v < x && succ v /= x = uv : insertRangeList x y xs | y < u && succ y /= u = (x,y) : set | otherwise = prependRangeList (min x u) (max y v) xs
200
true
true
1
10
109
190
100
90
null
null
cutsea110/aop
src/Hamming.hs
bsd-3-clause
-- hamming = 1 : merge (merge [2*x|x<-fs] [3*x|x<-fs]) [5*x|x<-fs] -- where fs = hamming hamming = 1 : foldl1 merge (map ((`map` hamming) . (*)) [2,3,5])
156
hamming = 1 : foldl1 merge (map ((`map` hamming) . (*)) [2,3,5])
64
hamming = 1 : foldl1 merge (map ((`map` hamming) . (*)) [2,3,5])
64
true
false
0
11
29
49
30
19
null
null
sjakobi/heist
src/Heist/Common.hs
bsd-3-clause
------------------------------------------------------------------------------ -- | Searches for a template by looking in the full path then backing up into -- each of the parent directories until the template is found. traversePath :: (Eq a, Hashable a) => HashMap [a] t -> [a] -> a -> Maybe (t, [a]) traversePath tm [] name = fmap (\a -> (a,[])) (Map.lookup [name] tm)
383
traversePath :: (Eq a, Hashable a) => HashMap [a] t -> [a] -> a -> Maybe (t, [a]) traversePath tm [] name = fmap (\a -> (a,[])) (Map.lookup [name] tm)
163
traversePath tm [] name = fmap (\a -> (a,[])) (Map.lookup [name] tm)
68
true
true
0
11
70
107
59
48
null
null
siddhanathan/ghc
testsuite/tests/plugins/HomePackagePlugin.hs
bsd-3-clause
-- The payload replaceInExpr (Lit l) = Lit l
44
replaceInExpr (Lit l) = Lit l
29
replaceInExpr (Lit l) = Lit l
29
true
false
0
7
8
19
9
10
null
null
Philonous/d-bus
tests/Main.hs
mit
isRight (Left _) = False
24
isRight (Left _) = False
24
isRight (Left _) = False
24
false
false
0
7
4
15
7
8
null
null
scslab/iterIO
Data/IterIO/Iter.hs
bsd-3-clause
fmapR f (Done a c) = Done (f a) c
35
fmapR f (Done a c) = Done (f a) c
35
fmapR f (Done a c) = Done (f a) c
35
false
false
0
7
11
30
14
16
null
null
nushio3/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
pluginTyConName :: Name pluginTyConName = tcQual pLUGINS (fsLit "Plugin") pluginTyConKey
88
pluginTyConName :: Name pluginTyConName = tcQual pLUGINS (fsLit "Plugin") pluginTyConKey
88
pluginTyConName = tcQual pLUGINS (fsLit "Plugin") pluginTyConKey
64
false
true
0
7
9
30
13
17
null
null
ktvoelker/state-record
src/Data/Record/StateFields/Containers.hs
gpl-3.0
setElem :: (Ord a) => a -> IdField (S.Set a) Bool setElem x = IdField { getField = S.member x , putField = \b -> (if b then S.insert else S.delete) x }
157
setElem :: (Ord a) => a -> IdField (S.Set a) Bool setElem x = IdField { getField = S.member x , putField = \b -> (if b then S.insert else S.delete) x }
157
setElem x = IdField { getField = S.member x , putField = \b -> (if b then S.insert else S.delete) x }
107
false
true
0
12
38
86
45
41
null
null
haskell/haddock
haddock-api/src/Haddock/Backends/Hoogle.hs
bsd-2-clause
-- | for constructors, and named-fields... lookupCon :: DynFlags -> [(Name, DocForDecl Name)] -> LocatedN Name -> [String] lookupCon dflags subdocs (L _ name) = case lookup name subdocs of Just (d, _) -> ppDocumentation dflags d _ -> []
240
lookupCon :: DynFlags -> [(Name, DocForDecl Name)] -> LocatedN Name -> [String] lookupCon dflags subdocs (L _ name) = case lookup name subdocs of Just (d, _) -> ppDocumentation dflags d _ -> []
197
lookupCon dflags subdocs (L _ name) = case lookup name subdocs of Just (d, _) -> ppDocumentation dflags d _ -> []
117
true
true
0
9
43
94
48
46
null
null
rrnewton/accelerate
Data/Array/Accelerate/Array/Sugar.hs
bsd-3-clause
toTuple :: IsTuple tup => TupleRepr tup -> tup toTuple = toProd (Proxy :: Proxy Elt)
84
toTuple :: IsTuple tup => TupleRepr tup -> tup toTuple = toProd (Proxy :: Proxy Elt)
84
toTuple = toProd (Proxy :: Proxy Elt)
37
false
true
0
7
15
37
18
19
null
null
uuhan/Idris-dev
src/Idris/WhoCalls.hs
bsd-3-clause
namesCaseAlt (SucCase _ sc) = namesSC sc
40
namesCaseAlt (SucCase _ sc) = namesSC sc
40
namesCaseAlt (SucCase _ sc) = namesSC sc
40
false
false
0
7
6
20
9
11
null
null