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
brendanhay/gogol
gogol-logging/gen/Network/Google/Resource/Logging/Folders/Exclusions/Get.hs
mpl-2.0
-- | V1 error format. fegXgafv :: Lens' FoldersExclusionsGet (Maybe Xgafv) fegXgafv = lens _fegXgafv (\ s a -> s{_fegXgafv = a})
128
fegXgafv :: Lens' FoldersExclusionsGet (Maybe Xgafv) fegXgafv = lens _fegXgafv (\ s a -> s{_fegXgafv = a})
106
fegXgafv = lens _fegXgafv (\ s a -> s{_fegXgafv = a})
53
true
true
1
9
21
51
25
26
null
null
yangsiwei880813/CS644
src/TypeChecking.hs
gpl-2.0
primitiveConversionB TypeShort t = if elem t [TypeByte, TypeShort, TypeInt, TypeChar] then [t] else []
102
primitiveConversionB TypeShort t = if elem t [TypeByte, TypeShort, TypeInt, TypeChar] then [t] else []
102
primitiveConversionB TypeShort t = if elem t [TypeByte, TypeShort, TypeInt, TypeChar] then [t] else []
102
false
false
1
7
14
46
23
23
null
null
andbroby/Harlequin
src/Main.hs
gpl-2.0
listq (List _) = Right (Bool True)
34
listq (List _) = Right (Bool True)
34
listq (List _) = Right (Bool True)
34
false
false
0
7
6
25
11
14
null
null
maarons/Cortex
Miranda/test/Commit_Test.hs
agpl-3.0
test5 :: Test test5 = TestCase $ assertBool "" $ (<) (Commit ("a", Delete, "hash", "2012.03.18 19:32:32:910425188000")) (Commit ("a", Set "moo", "hash", "2012.03.18 19:32:32:910425188000"))
197
test5 :: Test test5 = TestCase $ assertBool "" $ (<) (Commit ("a", Delete, "hash", "2012.03.18 19:32:32:910425188000")) (Commit ("a", Set "moo", "hash", "2012.03.18 19:32:32:910425188000"))
197
test5 = TestCase $ assertBool "" $ (<) (Commit ("a", Delete, "hash", "2012.03.18 19:32:32:910425188000")) (Commit ("a", Set "moo", "hash", "2012.03.18 19:32:32:910425188000"))
183
false
true
0
8
31
69
38
31
null
null
mwm/xyzify
Util.hs
bsd-3-clause
fixName :: FilePath -> FilePath fixName nIn = (if takeExtension nIn == ".gcode" then replaceExtension else addExtension) nIn ".3w"
134
fixName :: FilePath -> FilePath fixName nIn = (if takeExtension nIn == ".gcode" then replaceExtension else addExtension) nIn ".3w"
134
fixName nIn = (if takeExtension nIn == ".gcode" then replaceExtension else addExtension) nIn ".3w"
102
false
true
0
8
22
42
21
21
null
null
marcmo/hsDiagnosis
src/Diag/Web/SessionSupport.hs
bsd-3-clause
nullEnv :: IO Env nullEnv = newIORef []
39
nullEnv :: IO Env nullEnv = newIORef []
39
nullEnv = newIORef []
21
false
true
0
6
7
19
9
10
null
null
karamellpelle/MEnv
source/GUI/Widget/Output.hs
bsd-2-clause
incDepth :: GUIData -> GUIState -> IO GUIState incDepth gd gs = do let depth' = guistateDepth gs + epsilon glUniform1f (guiShadeUniDepth $ guistateGUIShade gs) (rTF depth') return gs { guistateDepth = depth' } where -- this needs to be low for clipping, and also if we want to draw -- GUI in 3D: epsilon = 0.01
363
incDepth :: GUIData -> GUIState -> IO GUIState incDepth gd gs = do let depth' = guistateDepth gs + epsilon glUniform1f (guiShadeUniDepth $ guistateGUIShade gs) (rTF depth') return gs { guistateDepth = depth' } where -- this needs to be low for clipping, and also if we want to draw -- GUI in 3D: epsilon = 0.01
363
incDepth gd gs = do let depth' = guistateDepth gs + epsilon glUniform1f (guiShadeUniDepth $ guistateGUIShade gs) (rTF depth') return gs { guistateDepth = depth' } where -- this needs to be low for clipping, and also if we want to draw -- GUI in 3D: epsilon = 0.01
316
false
true
0
11
109
91
44
47
null
null
jcowgill/cs-work
syac/compilers/Prac2/Lexer.hs
gpl-3.0
-- Matches character set which matches a given function range :: (a -> Bool) -> RegExp a range f (x:xs) | f x = (Just [x], xs)
126
range :: (a -> Bool) -> RegExp a range f (x:xs) | f x = (Just [x], xs)
70
range f (x:xs) | f x = (Just [x], xs)
37
true
true
0
8
26
59
30
29
null
null
seL4/capDL-tool
CapDL/State.hs
bsd-2-clause
validCapArch _ (PDCap {}) = True
32
validCapArch _ (PDCap {}) = True
32
validCapArch _ (PDCap {}) = True
32
false
false
0
7
5
18
9
9
null
null
ezyang/ghc
compiler/stgSyn/CoreToStg.hs
bsd-3-clause
coreToStgArgs :: [CoreArg] -> CtsM ([StgArg], FreeVarsInfo, [Tickish Id]) coreToStgArgs [] = return ([], emptyFVInfo, [])
123
coreToStgArgs :: [CoreArg] -> CtsM ([StgArg], FreeVarsInfo, [Tickish Id]) coreToStgArgs [] = return ([], emptyFVInfo, [])
123
coreToStgArgs [] = return ([], emptyFVInfo, [])
49
false
true
0
9
17
60
33
27
null
null
sof/twitter
Web/Twitter/Types.hs
bsd-3-clause
nullRateLimit :: RateLimit nullRateLimit = RateLimit { rateLimitResetSecs = 0 , rateLimitResetTime = "" , rateLimitRemHits = 0 , rateLimitHourlyLimit = 0 }
182
nullRateLimit :: RateLimit nullRateLimit = RateLimit { rateLimitResetSecs = 0 , rateLimitResetTime = "" , rateLimitRemHits = 0 , rateLimitHourlyLimit = 0 }
182
nullRateLimit = RateLimit { rateLimitResetSecs = 0 , rateLimitResetTime = "" , rateLimitRemHits = 0 , rateLimitHourlyLimit = 0 }
155
false
true
0
6
49
37
23
14
null
null
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/OpsWorksLayerLoadBasedAutoScaling.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-loadbasedautoscaling.html#cfn-opsworks-layer-loadbasedautoscaling-enable owllbasEnable :: Lens' OpsWorksLayerLoadBasedAutoScaling (Maybe (Val Bool)) owllbasEnable = lens _opsWorksLayerLoadBasedAutoScalingEnable (\s a -> s { _opsWorksLayerLoadBasedAutoScalingEnable = a })
368
owllbasEnable :: Lens' OpsWorksLayerLoadBasedAutoScaling (Maybe (Val Bool)) owllbasEnable = lens _opsWorksLayerLoadBasedAutoScalingEnable (\s a -> s { _opsWorksLayerLoadBasedAutoScalingEnable = a })
198
owllbasEnable = lens _opsWorksLayerLoadBasedAutoScalingEnable (\s a -> s { _opsWorksLayerLoadBasedAutoScalingEnable = a })
122
true
true
0
9
22
52
28
24
null
null
haskoin/haskoin
src/Haskoin/Keys/Extended.hs
unlicense
derivePath :: DerivPathI t -> XPrvKey -> XPrvKey derivePath = go id where -- Build the full derivation function starting from the end go f p = case p of next :| i -> go (f . flip hardSubKey i) next next :/ i -> go (f . flip prvSubKey i) next _ -> f -- | Derive a public key from a soft derivation path
344
derivePath :: DerivPathI t -> XPrvKey -> XPrvKey derivePath = go id where -- Build the full derivation function starting from the end go f p = case p of next :| i -> go (f . flip hardSubKey i) next next :/ i -> go (f . flip prvSubKey i) next _ -> f -- | Derive a public key from a soft derivation path
344
derivePath = go id where -- Build the full derivation function starting from the end go f p = case p of next :| i -> go (f . flip hardSubKey i) next next :/ i -> go (f . flip prvSubKey i) next _ -> f -- | Derive a public key from a soft derivation path
295
false
true
1
11
108
115
52
63
null
null
vincenthz/language-c
src/Language/C/Analysis/AstAnalysis.hs
bsd-3-clause
tStmt c (CGotoPtr e ni) = do t <- tExpr c RValue e case t of (PtrType _ _ _) -> return voidType _ -> typeError ni "can't goto non-pointer" -- | Typecheck a block item. When statement expressions are blocks, -- they have the type of their last expression statement, so this -- needs to return a type.
348
tStmt c (CGotoPtr e ni) = do t <- tExpr c RValue e case t of (PtrType _ _ _) -> return voidType _ -> typeError ni "can't goto non-pointer" -- | Typecheck a block item. When statement expressions are blocks, -- they have the type of their last expression statement, so this -- needs to return a type.
348
tStmt c (CGotoPtr e ni) = do t <- tExpr c RValue e case t of (PtrType _ _ _) -> return voidType _ -> typeError ni "can't goto non-pointer" -- | Typecheck a block item. When statement expressions are blocks, -- they have the type of their last expression statement, so this -- needs to return a type.
348
false
false
0
11
107
73
35
38
null
null
SergeyKrivohatskiy/fp_haskell
hw08/Expr.hs
mit
bool = Const . B
16
bool = Const . B
16
bool = Const . B
16
false
false
2
5
4
15
5
10
null
null
beni55/haste-compiler
src/Haste/Opts.hs
bsd-3-clause
-- | Enable optimizations over the entire program. enableWholeProgramOpts :: Config -> Config enableWholeProgramOpts cfg = cfg {wholeProgramOpts = True}
152
enableWholeProgramOpts :: Config -> Config enableWholeProgramOpts cfg = cfg {wholeProgramOpts = True}
101
enableWholeProgramOpts cfg = cfg {wholeProgramOpts = True}
58
true
true
0
6
19
27
15
12
null
null
dysinger/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/DescribeSnapshotSchedule.hs
mpl-2.0
-- | The Amazon Resource Name (ARN) of the volume. Use the 'ListVolumes' operation -- to return a list of gateway volumes. dssVolumeARN :: Lens' DescribeSnapshotSchedule Text dssVolumeARN = lens _dssVolumeARN (\s a -> s { _dssVolumeARN = a })
242
dssVolumeARN :: Lens' DescribeSnapshotSchedule Text dssVolumeARN = lens _dssVolumeARN (\s a -> s { _dssVolumeARN = a })
119
dssVolumeARN = lens _dssVolumeARN (\s a -> s { _dssVolumeARN = a })
67
true
true
0
9
39
41
23
18
null
null
opensuse-haskell/configuration
src/regression-test/regression-test.hs
gpl-3.0
prettyVersion :: (Version, Revision) -> String prettyVersion = undefined
72
prettyVersion :: (Version, Revision) -> String prettyVersion = undefined
72
prettyVersion = undefined
25
false
true
0
6
8
21
12
9
null
null
andgate/vish
src/Vish/Graphics/Image.hs
bsd-3-clause
loadXY :: V2 Double -- ^ Image position -> FilePath -- ^ Image file path -> IO Image loadXY p fp = liftM (mkImageXY p) $ Tex.load fp
148
loadXY :: V2 Double -- ^ Image position -> FilePath -- ^ Image file path -> IO Image loadXY p fp = liftM (mkImageXY p) $ Tex.load fp
148
loadXY p fp = liftM (mkImageXY p) $ Tex.load fp
49
false
true
0
8
43
50
24
26
null
null
DavidAlphaFox/ghc
utils/haddock/haddock-library/src/Documentation/Haddock/Parser/Monad.hs
bsd-3-clause
initialParserState :: ParserState initialParserState = ParserState Nothing
74
initialParserState :: ParserState initialParserState = ParserState Nothing
74
initialParserState = ParserState Nothing
40
false
true
0
5
6
14
7
7
null
null
michalt/cvector
Data/CVector/Unboxed.hs
bsd-3-clause
minimumBy :: (Unbox a) => (a -> a -> Ordering) -> CVector a -> a minimumBy = G.minimumBy
88
minimumBy :: (Unbox a) => (a -> a -> Ordering) -> CVector a -> a minimumBy = G.minimumBy
88
minimumBy = G.minimumBy
23
false
true
0
9
17
44
23
21
null
null
IxpertaSolutions/hsua
src/Phone/Account.hs
gpl-2.0
unregisterAccount :: MonadPJ m => AccountId -> m () unregisterAccount accId = liftPJ . FFI.check Unregistration $ FFI.setAccountRegistration accId FFI.pjFalse
162
unregisterAccount :: MonadPJ m => AccountId -> m () unregisterAccount accId = liftPJ . FFI.check Unregistration $ FFI.setAccountRegistration accId FFI.pjFalse
162
unregisterAccount accId = liftPJ . FFI.check Unregistration $ FFI.setAccountRegistration accId FFI.pjFalse
110
false
true
2
9
23
57
25
32
null
null
ian-ross/cabal
Cabal/Distribution/Simple/Setup.hs
bsd-3-clause
readPackageDbList "global" = [Just GlobalPackageDB]
51
readPackageDbList "global" = [Just GlobalPackageDB]
51
readPackageDbList "global" = [Just GlobalPackageDB]
51
false
false
1
6
4
18
7
11
null
null
kovach/web
res2/Syntax.hs
gpl-2.0
fixChar :: Char -> String fixChar c | c `elem` delims = [' ', c, ' ']
69
fixChar :: Char -> String fixChar c | c `elem` delims = [' ', c, ' ']
69
fixChar c | c `elem` delims = [' ', c, ' ']
43
false
true
0
8
16
43
22
21
null
null
eugenkiss/loopgotowhile
tests/Language/LoopGotoWhile/Goto/Strict/Tests.hs
bsd-3-clause
-- Helper runProgram :: [Integer] -> String -> Either String Integer runProgram = flip $ mkStdRunner parse eval
112
runProgram :: [Integer] -> String -> Either String Integer runProgram = flip $ mkStdRunner parse eval
101
runProgram = flip $ mkStdRunner parse eval
42
true
true
2
8
18
43
20
23
null
null
matterhorn-chat/matterhorn
test/RichText_QCA.hs
bsd-3-clause
genBlock :: Gen Block genBlock = oneof [ Para <$> genInlines , Header <$> arbitrary <*> genInlines , Blockquote <$> genBlocks , List <$> genListType <*> genListSpacing <*> seqOf genBlocks , CodeBlock <$> genCodeBlockInfo <*> genText , HTMLBlock <$> genText , return HRule ]
392
genBlock :: Gen Block genBlock = oneof [ Para <$> genInlines , Header <$> arbitrary <*> genInlines , Blockquote <$> genBlocks , List <$> genListType <*> genListSpacing <*> seqOf genBlocks , CodeBlock <$> genCodeBlockInfo <*> genText , HTMLBlock <$> genText , return HRule ]
392
genBlock = oneof [ Para <$> genInlines , Header <$> arbitrary <*> genInlines , Blockquote <$> genBlocks , List <$> genListType <*> genListSpacing <*> seqOf genBlocks , CodeBlock <$> genCodeBlockInfo <*> genText , HTMLBlock <$> genText , return HRule ]
370
false
true
0
9
162
84
44
40
null
null
valderman/himitsu
src/AppState.hs
bsd-3-clause
setAppState :: AppState -> IO () setAppState st = writeIORef appState st
72
setAppState :: AppState -> IO () setAppState st = writeIORef appState st
72
setAppState st = writeIORef appState st
39
false
true
0
7
11
28
13
15
null
null
ublubu/zombieapaperclypse
NGL/LoadShaders.hs
mit
-------------------------------------------------------------------------------- -- | Create a new program object from the given shaders, throwing an -- 'IOException' if something goes wrong. loadShaders :: [ShaderInfo] -> IO Program loadShaders infos = createProgram `bracketOnError` deleteObjectName $ \program -> do loadCompileAttach program infos linkAndCheck program return program
409
loadShaders :: [ShaderInfo] -> IO Program loadShaders infos = createProgram `bracketOnError` deleteObjectName $ \program -> do loadCompileAttach program infos linkAndCheck program return program
215
loadShaders infos = createProgram `bracketOnError` deleteObjectName $ \program -> do loadCompileAttach program infos linkAndCheck program return program
173
true
true
2
9
65
71
33
38
null
null
NinjaTrappeur/DobadoBots
src/DobadoBots/GameEngine/Data.hs
bsd-3-clause
parseSize :: Maybe AT.Value -> AT.Parser (V2 Float) parseSize (Just(AT.Object v)) = V2 <$> v .: "width" <*> v .: "height"
121
parseSize :: Maybe AT.Value -> AT.Parser (V2 Float) parseSize (Just(AT.Object v)) = V2 <$> v .: "width" <*> v .: "height"
121
parseSize (Just(AT.Object v)) = V2 <$> v .: "width" <*> v .: "height"
69
false
true
0
12
20
69
32
37
null
null
uuhan/Idris-dev
src/Idris/IBC.hs
bsd-3-clause
ibc i (IBCInjective n a) f = return f { ibc_injective = (n,a) : ibc_injective f }
81
ibc i (IBCInjective n a) f = return f { ibc_injective = (n,a) : ibc_injective f }
81
ibc i (IBCInjective n a) f = return f { ibc_injective = (n,a) : ibc_injective f }
81
false
false
1
9
16
54
24
30
null
null
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/CreateImage.hs
mpl-2.0
-- | Information about one or more block device mappings. ci1BlockDeviceMappings :: Lens' CreateImage [BlockDeviceMapping] ci1BlockDeviceMappings = lens _ci1BlockDeviceMappings (\s a -> s { _ci1BlockDeviceMappings = a }) . _List
240
ci1BlockDeviceMappings :: Lens' CreateImage [BlockDeviceMapping] ci1BlockDeviceMappings = lens _ci1BlockDeviceMappings (\s a -> s { _ci1BlockDeviceMappings = a }) . _List
182
ci1BlockDeviceMappings = lens _ci1BlockDeviceMappings (\s a -> s { _ci1BlockDeviceMappings = a }) . _List
117
true
true
0
10
41
47
26
21
null
null
Chiel92/ants
simulation/Ants.hs
gpl-2.0
(.^.) :: StaticText () -> Layout -> Layout st .^. l = column 5 [hfill $ widget st, l]
85
(.^.) :: StaticText () -> Layout -> Layout st .^. l = column 5 [hfill $ widget st, l]
85
st .^. l = column 5 [hfill $ widget st, l]
42
false
true
0
9
18
54
26
28
null
null
lukexi/ghc
compiler/nativeGen/X86/Regs.hs
bsd-3-clause
xmm10 = regSingle 34
20
xmm10 = regSingle 34
20
xmm10 = regSingle 34
20
false
false
1
5
3
12
4
8
null
null
ezyang/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
emitPrimOp _ [res] BSwap32Op [w] = emitBSwapCall res w W32
63
emitPrimOp _ [res] BSwap32Op [w] = emitBSwapCall res w W32
63
emitPrimOp _ [res] BSwap32Op [w] = emitBSwapCall res w W32
63
false
false
1
6
14
32
14
18
null
null
sfultong/stand-in-language
src/PrettyPrint.hs
apache-2.0
showFragInds inds = let showInd (FragIndex i) = i in show (map showInd inds)
76
showFragInds inds = let showInd (FragIndex i) = i in show (map showInd inds)
76
showFragInds inds = let showInd (FragIndex i) = i in show (map showInd inds)
76
false
false
0
11
13
40
18
22
null
null
sdiehl/ghc
compiler/basicTypes/BasicTypes.hs
bsd-3-clause
isActive :: CompilerPhase -> Activation -> Bool isActive InitialPhase AlwaysActive = True
94
isActive :: CompilerPhase -> Activation -> Bool isActive InitialPhase AlwaysActive = True
94
isActive InitialPhase AlwaysActive = True
46
false
true
0
8
16
30
13
17
null
null
robrix/derivative-parsing
src/Data/Pattern/Char.hs
bsd-3-clause
octDigit :: (Alternative r, Pattern r Char) => r Char octDigit = oneOf (char <$> ['0'..'7'])
92
octDigit :: (Alternative r, Pattern r Char) => r Char octDigit = oneOf (char <$> ['0'..'7'])
92
octDigit = oneOf (char <$> ['0'..'7'])
38
false
true
0
8
15
51
25
26
null
null
bergey/diagrams-opengl
src/Graphics/Rendering/Util.hs
bsd-3-clause
fi :: (Integral a, Num b) => a -> b fi = fromIntegral
53
fi :: (Integral a, Num b) => a -> b fi = fromIntegral
53
fi = fromIntegral
17
false
true
0
8
12
37
17
20
null
null
ssaavedra/liquidhaskell
benchmarks/esop2013-submission/Base.hs
bsd-3-clause
ordered :: Ord a => Map a b -> Bool ordered t = bounded (const True) (const True) t where bounded lo hi t' = case t' of Tip -> True Bin _ kx _ l r -> (lo kx) && (hi kx) && bounded lo (<kx) l && bounded (>kx) hi r -- | Exported only for "Debug.QuickCheck"
303
ordered :: Ord a => Map a b -> Bool ordered t = bounded (const True) (const True) t where bounded lo hi t' = case t' of Tip -> True Bin _ kx _ l r -> (lo kx) && (hi kx) && bounded lo (<kx) l && bounded (>kx) hi r -- | Exported only for "Debug.QuickCheck"
303
ordered t = bounded (const True) (const True) t where bounded lo hi t' = case t' of Tip -> True Bin _ kx _ l r -> (lo kx) && (hi kx) && bounded lo (<kx) l && bounded (>kx) hi r -- | Exported only for "Debug.QuickCheck"
267
false
true
0
12
107
138
68
70
null
null
rahulmutt/ghcvm
libraries/base/GHC/Int.hs
bsd-3-clause
neInt32 (I32# x) (I32# y) = isTrue# (x /=# y)
45
neInt32 (I32# x) (I32# y) = isTrue# (x /=# y)
45
neInt32 (I32# x) (I32# y) = isTrue# (x /=# y)
45
false
false
0
7
9
33
16
17
null
null
ganeti/ganeti
src/Ganeti/Types.hs
bsd-2-clause
parseJobId x = fail $ "Wrong type/value for job id: " ++ show x
63
parseJobId x = fail $ "Wrong type/value for job id: " ++ show x
63
parseJobId x = fail $ "Wrong type/value for job id: " ++ show x
63
false
false
0
6
13
20
9
11
null
null
alanz/Hs2010To201x
test/TransformSpec.hs
bsd-3-clause
logTestSettings :: RefactSettings logTestSettings = defaultSettings { rsetVerboseLevel = Debug }
96
logTestSettings :: RefactSettings logTestSettings = defaultSettings { rsetVerboseLevel = Debug }
96
logTestSettings = defaultSettings { rsetVerboseLevel = Debug }
62
false
true
0
6
10
19
11
8
null
null
stiell/phec
Haskeleton.hs
gpl-3.0
writeLibraryFile :: String -> IO () writeLibraryFile m = writeFile (libraryPath m) (libraryTemplate m)
102
writeLibraryFile :: String -> IO () writeLibraryFile m = writeFile (libraryPath m) (libraryTemplate m)
102
writeLibraryFile m = writeFile (libraryPath m) (libraryTemplate m)
66
false
true
0
7
13
40
19
21
null
null
jamesdarcy/DicomH
src/Data/Dicom/Jpeg2000.hs
bsd-3-clause
-- Quantization Component j2K_QCC :: Word16 j2K_QCC = 0xff5d
60
j2K_QCC :: Word16 j2K_QCC = 0xff5d
34
j2K_QCC = 0xff5d
16
true
true
0
4
8
12
7
5
null
null
CanvasHS/Canvas.hs
demo/chart/Chart.hs
lgpl-2.1
-- registreer jezelf bij Canvas.hs met de functie handler en de initiele state 0 main = installEventHandler handler initState
125
main = installEventHandler handler initState
44
main = installEventHandler handler initState
44
true
false
0
5
18
12
6
6
null
null
cetinkaya/sdkhs
Sdk.hs
gpl-3.0
testCase :: [[Int]] testCase = [[1, 2, 3, 4, 5, 6, 7, 8, 9], [4, 5, 6, 7, 8, 9, 1, 2, 3], [7, 8, 9, 1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6, 7, 8, 9, 1], [5, 6, 7, 8, 9, 1, 2, 3, 4], [8, 9, 1, 2, 3, 4, 5, 6, 7], [3, 4, 5, 6, 7, 8, 9, 1, 2], [6, 7, 8, 9, 1, 2, 3, 4, 5], [9, 1, 2, 3, 4, 5, 6, 7, 8]]
388
testCase :: [[Int]] testCase = [[1, 2, 3, 4, 5, 6, 7, 8, 9], [4, 5, 6, 7, 8, 9, 1, 2, 3], [7, 8, 9, 1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6, 7, 8, 9, 1], [5, 6, 7, 8, 9, 1, 2, 3, 4], [8, 9, 1, 2, 3, 4, 5, 6, 7], [3, 4, 5, 6, 7, 8, 9, 1, 2], [6, 7, 8, 9, 1, 2, 3, 4, 5], [9, 1, 2, 3, 4, 5, 6, 7, 8]]
388
testCase = [[1, 2, 3, 4, 5, 6, 7, 8, 9], [4, 5, 6, 7, 8, 9, 1, 2, 3], [7, 8, 9, 1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6, 7, 8, 9, 1], [5, 6, 7, 8, 9, 1, 2, 3, 4], [8, 9, 1, 2, 3, 4, 5, 6, 7], [3, 4, 5, 6, 7, 8, 9, 1, 2], [6, 7, 8, 9, 1, 2, 3, 4, 5], [9, 1, 2, 3, 4, 5, 6, 7, 8]]
368
false
true
0
8
181
294
191
103
null
null
lukexi/ghc-7.8-arm64
compiler/nativeGen/PPC/CodeGen.hs
bsd-3-clause
selExpr64 (CmmMachOp (MO_Add _) [e1,e2]) = do ChildCode64 code1 r1lo <- iselExpr64 e1 ChildCode64 code2 r2lo <- iselExpr64 e2 (rlo,rhi) <- getNewRegPairNat II32 let r1hi = getHiVRegFromLo r1lo r2hi = getHiVRegFromLo r2lo code = code1 `appOL` code2 `appOL` toOL [ ADDC rlo r1lo r2lo, ADDE rhi r1hi r2hi ] return (ChildCode64 code rlo)
429
iselExpr64 (CmmMachOp (MO_Add _) [e1,e2]) = do ChildCode64 code1 r1lo <- iselExpr64 e1 ChildCode64 code2 r2lo <- iselExpr64 e2 (rlo,rhi) <- getNewRegPairNat II32 let r1hi = getHiVRegFromLo r1lo r2hi = getHiVRegFromLo r2lo code = code1 `appOL` code2 `appOL` toOL [ ADDC rlo r1lo r2lo, ADDE rhi r1hi r2hi ] return (ChildCode64 code rlo)
429
iselExpr64 (CmmMachOp (MO_Add _) [e1,e2]) = do ChildCode64 code1 r1lo <- iselExpr64 e1 ChildCode64 code2 r2lo <- iselExpr64 e2 (rlo,rhi) <- getNewRegPairNat II32 let r1hi = getHiVRegFromLo r1lo r2hi = getHiVRegFromLo r2lo code = code1 `appOL` code2 `appOL` toOL [ ADDC rlo r1lo r2lo, ADDE rhi r1hi r2hi ] return (ChildCode64 code rlo)
429
false
false
0
13
148
149
72
77
null
null
lupuionut/homedmanager
src/Fs.hs
bsd-3-clause
doesDirectoryExist :: FilePath -> IO Bool doesDirectoryExist = D.doesDirectoryExist
83
doesDirectoryExist :: FilePath -> IO Bool doesDirectoryExist = D.doesDirectoryExist
83
doesDirectoryExist = D.doesDirectoryExist
41
false
true
0
7
8
26
11
15
null
null
bergmark/binary
src/Data/Binary/Put.hs
bsd-3-clause
-- | Run the 'Put' monad with a serialiser and get its result runPutM :: PutM a -> (a, L.ByteString) runPutM (Put (PairS f s)) = (f, toLazyByteString s)
152
runPutM :: PutM a -> (a, L.ByteString) runPutM (Put (PairS f s)) = (f, toLazyByteString s)
90
runPutM (Put (PairS f s)) = (f, toLazyByteString s)
51
true
true
0
9
28
53
28
25
null
null
songpp/my-haskell-playground
src/BinarySearchTree.hs
apache-2.0
empty :: Ord k => BSTree k v empty = Nil
40
empty :: Ord k => BSTree k v empty = Nil
40
empty = Nil
11
false
true
0
7
10
29
12
17
null
null
rueshyna/gogol
gogol-admin-reports/gen/Network/Google/Reports/Types/Product.hs
mpl-2.0
-- | Kind of list response this is. aKind :: Lens' Activities Text aKind = lens _aKind (\ s a -> s{_aKind = a})
111
aKind :: Lens' Activities Text aKind = lens _aKind (\ s a -> s{_aKind = a})
75
aKind = lens _aKind (\ s a -> s{_aKind = a})
44
true
true
1
9
23
43
22
21
null
null
phischu/fragnix
tests/packages/scotty/Network.Wai.Handler.Warp.Header.hs
bsd-3-clause
---------------------------------------------------------------- indexResponseHeader :: ResponseHeaders -> IndexedHeader indexResponseHeader hdr = traverseHeader hdr responseMaxIndex responseKeyIndex
200
indexResponseHeader :: ResponseHeaders -> IndexedHeader indexResponseHeader hdr = traverseHeader hdr responseMaxIndex responseKeyIndex
134
indexResponseHeader hdr = traverseHeader hdr responseMaxIndex responseKeyIndex
78
true
true
0
5
13
26
13
13
null
null
iatorm/shift
shift.hs
mit
main :: IO () main = do [file] <- getArgs prog <- readFile file putStrLn $ interpret prog
95
main :: IO () main = do [file] <- getArgs prog <- readFile file putStrLn $ interpret prog
95
main = do [file] <- getArgs prog <- readFile file putStrLn $ interpret prog
81
false
true
0
9
23
52
22
30
null
null
ArekCzarnik/Uthenga
src/Database/Subscriber.hs
bsd-3-clause
createTable :: MySQLConn -> IO () createTable mysqlConnection = do _ <- liftIO $ execute_ mysqlConnection createTableSQL return ()
136
createTable :: MySQLConn -> IO () createTable mysqlConnection = do _ <- liftIO $ execute_ mysqlConnection createTableSQL return ()
136
createTable mysqlConnection = do _ <- liftIO $ execute_ mysqlConnection createTableSQL return ()
102
false
true
0
10
24
52
22
30
null
null
futufeld/eclogues
eclogues-impl/gen-hs/Api_Consts.hs
bsd-3-clause
aURORA_EXECUTOR_NAME :: LT.Text aURORA_EXECUTOR_NAME = "AuroraExecutor"
71
aURORA_EXECUTOR_NAME :: LT.Text aURORA_EXECUTOR_NAME = "AuroraExecutor"
71
aURORA_EXECUTOR_NAME = "AuroraExecutor"
39
false
true
0
7
5
20
8
12
null
null
olorin/github
Github/Private.hs
bsd-3-clause
doHttpsStatus :: BS.ByteString -> String -> GithubAuth -> Maybe RequestBody -> IO (Either Error Status) doHttpsStatus reqMethod p auth payload = do result <- doHttps reqMethod (apiEndpoint (Just auth) ++ p) (Just auth) payload case result of Left e -> return (Left (HTTPConnectionError e)) Right resp -> let status = responseStatus resp headers = responseHeaders resp in if status == notFound404 -- doHttps silently absorbs 404 errors, but for this operation -- we want the user to know if they've tried to delete a -- non-existent repository then return (Left (HTTPConnectionError (E.toException (StatusCodeException status headers #if MIN_VERSION_http_conduit(1, 9, 0) (responseCookieJar resp) #endif )))) else return (Right status)
949
doHttpsStatus :: BS.ByteString -> String -> GithubAuth -> Maybe RequestBody -> IO (Either Error Status) doHttpsStatus reqMethod p auth payload = do result <- doHttps reqMethod (apiEndpoint (Just auth) ++ p) (Just auth) payload case result of Left e -> return (Left (HTTPConnectionError e)) Right resp -> let status = responseStatus resp headers = responseHeaders resp in if status == notFound404 -- doHttps silently absorbs 404 errors, but for this operation -- we want the user to know if they've tried to delete a -- non-existent repository then return (Left (HTTPConnectionError (E.toException (StatusCodeException status headers #if MIN_VERSION_http_conduit(1, 9, 0) (responseCookieJar resp) #endif )))) else return (Right status)
949
doHttpsStatus reqMethod p auth payload = do result <- doHttps reqMethod (apiEndpoint (Just auth) ++ p) (Just auth) payload case result of Left e -> return (Left (HTTPConnectionError e)) Right resp -> let status = responseStatus resp headers = responseHeaders resp in if status == notFound404 -- doHttps silently absorbs 404 errors, but for this operation -- we want the user to know if they've tried to delete a -- non-existent repository then return (Left (HTTPConnectionError (E.toException (StatusCodeException status headers #if MIN_VERSION_http_conduit(1, 9, 0) (responseCookieJar resp) #endif )))) else return (Right status)
845
false
true
0
24
321
222
107
115
null
null
bixuanzju/fcore
testsuite/TestTerms.hs
bsd-2-clause
-- should infer (forall (x0 : int) . int) intapp = TApp idF (JClass "java.lang.Integer")
88
intapp = TApp idF (JClass "java.lang.Integer")
46
intapp = TApp idF (JClass "java.lang.Integer")
46
true
false
0
7
14
18
9
9
null
null
agentm/project-m36
test/TutorialD/InterpreterTest.hs
unlicense
testDefineWithTypeVar :: Test testDefineWithTypeVar = TestCase $ do (sessionId, dbconn) <- dateExamplesConnection emptyNotificationCallback let err1 = "TypeConstructorTypeVarMissing" expectTutorialDErr sessionId dbconn (T.isInfixOf err1) "y::{a int, b invalidtype}"
277
testDefineWithTypeVar :: Test testDefineWithTypeVar = TestCase $ do (sessionId, dbconn) <- dateExamplesConnection emptyNotificationCallback let err1 = "TypeConstructorTypeVarMissing" expectTutorialDErr sessionId dbconn (T.isInfixOf err1) "y::{a int, b invalidtype}"
275
testDefineWithTypeVar = TestCase $ do (sessionId, dbconn) <- dateExamplesConnection emptyNotificationCallback let err1 = "TypeConstructorTypeVarMissing" expectTutorialDErr sessionId dbconn (T.isInfixOf err1) "y::{a int, b invalidtype}"
245
false
true
0
11
37
60
29
31
null
null
christiaanb/ghc
compiler/coreSyn/CoreTidy.hs
bsd-3-clause
tidyExpr env (Cast e co) = Cast (tidyExpr env e) (tidyCo env co)
65
tidyExpr env (Cast e co) = Cast (tidyExpr env e) (tidyCo env co)
65
tidyExpr env (Cast e co) = Cast (tidyExpr env e) (tidyCo env co)
65
false
false
0
7
13
42
19
23
null
null
Slava/6.035-decaf-compiler
src/LLIR.hs
mit
replaceUse :: VFunction -> Use -> ValueRef -> VFunction replaceUse func use val = replaceInstrOp func (useInstruction use) (useIndex use) val
141
replaceUse :: VFunction -> Use -> ValueRef -> VFunction replaceUse func use val = replaceInstrOp func (useInstruction use) (useIndex use) val
141
replaceUse func use val = replaceInstrOp func (useInstruction use) (useIndex use) val
85
false
true
0
7
20
51
25
26
null
null
ml9951/ghc
compiler/cmm/PprC.hs
bsd-3-clause
is_cishCC PrimCallConv = False
30
is_cishCC PrimCallConv = False
30
is_cishCC PrimCallConv = False
30
false
false
0
5
3
9
4
5
null
null
sdiehl/ghc
compiler/prelude/THNames.hs
bsd-3-clause
lamEIdKey = mkPreludeMiscIdUnique 279
50
lamEIdKey = mkPreludeMiscIdUnique 279
50
lamEIdKey = mkPreludeMiscIdUnique 279
50
false
false
0
5
16
9
4
5
null
null
juhp/stack
src/Stack/Types/Config.hs
bsd-3-clause
resolveOptions :: String resolveOptions = unlines [ "\nThis may be resolved by:" , " - Using '--omit-packages' to exclude mismatching package(s)." , " - Using '--resolver' to specify a matching snapshot/resolver" ]
252
resolveOptions :: String resolveOptions = unlines [ "\nThis may be resolved by:" , " - Using '--omit-packages' to exclude mismatching package(s)." , " - Using '--resolver' to specify a matching snapshot/resolver" ]
252
resolveOptions = unlines [ "\nThis may be resolved by:" , " - Using '--omit-packages' to exclude mismatching package(s)." , " - Using '--resolver' to specify a matching snapshot/resolver" ]
227
false
true
0
6
69
23
13
10
null
null
dbp/snap-plus
src/Snap/Plus/Paths.hs
bsd-3-clause
showPath :: Paths k => k -> Text showPath k = (indexPath k) ++ tshow (getKey k)
79
showPath :: Paths k => k -> Text showPath k = (indexPath k) ++ tshow (getKey k)
79
showPath k = (indexPath k) ++ tshow (getKey k)
46
false
true
0
8
16
49
22
27
null
null
rblaze/private-cloud
src/PrivateCloud/Aws/Logging.hs
apache-2.0
s3LoggerName :: String s3LoggerName = awsLoggerName <> ".S3"
60
s3LoggerName :: String s3LoggerName = awsLoggerName <> ".S3"
60
s3LoggerName = awsLoggerName <> ".S3"
37
false
true
2
6
7
23
9
14
null
null
michaelt/pipes-bytestring-mmap
bench/GHCBufMain.hs
bsd-3-clause
go handle bufPtr = do read <- hGetBuf handle bufPtr bufsize when (read > 0) $ do hPutBuf stdout bufPtr read go handle bufPtr
136
go handle bufPtr = do read <- hGetBuf handle bufPtr bufsize when (read > 0) $ do hPutBuf stdout bufPtr read go handle bufPtr
136
go handle bufPtr = do read <- hGetBuf handle bufPtr bufsize when (read > 0) $ do hPutBuf stdout bufPtr read go handle bufPtr
136
false
false
0
10
35
61
26
35
null
null
qnikst/ygruq
devel.hs
bsd-2-clause
main :: IO () main = do putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings defaultSettings { settingsPort = port } app loop
196
main :: IO () main = do putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings defaultSettings { settingsPort = port } app loop
196
main = do putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings defaultSettings { settingsPort = port } app loop
182
false
true
0
10
57
58
28
30
null
null
motiz88/postgrest
src/PostgREST/Parsers.hs
mit
pJsonPathStep :: Parser Text pJsonPathStep = cs <$> try (string "->" *> pFieldName)
83
pJsonPathStep :: Parser Text pJsonPathStep = cs <$> try (string "->" *> pFieldName)
83
pJsonPathStep = cs <$> try (string "->" *> pFieldName)
54
false
true
0
9
12
31
15
16
null
null
hanshoglund/reenact
src/Control/Reactive/Var.hs
bsd-3-clause
readVar :: Var a -> IO a readVar = atomically . readTVar . getVar
65
readVar :: Var a -> IO a readVar = atomically . readTVar . getVar
65
readVar = atomically . readTVar . getVar
40
false
true
0
6
13
29
14
15
null
null
spacekitteh/smcghc
compiler/codeGen/StgCmmForeign.hs
bsd-3-clause
hpLim = CmmGlobal HpLim
35
hpLim = CmmGlobal HpLim
35
hpLim = CmmGlobal HpLim
35
false
false
0
5
15
9
4
5
null
null
printedheart/atomspace
opencog/haskell/OpenCog/AtomSpace/Sugar.hs
agpl-3.0
stv :: Double -> Double -> Maybe TruthVal stv a b = Just $ SimpleTV a b
71
stv :: Double -> Double -> Maybe TruthVal stv a b = Just $ SimpleTV a b
71
stv a b = Just $ SimpleTV a b
29
false
true
0
7
16
40
18
22
null
null
lambdageek/insomnia
src/Insomnia/ToF/ModuleType.hs
bsd-3-clause
model :: ToF m => Signature -> m F.AbstractSig model sig = do abstr <- signature sig let s = F.ModelSem abstr return $ F.AbstractSig $ U.bind [] s
152
model :: ToF m => Signature -> m F.AbstractSig model sig = do abstr <- signature sig let s = F.ModelSem abstr return $ F.AbstractSig $ U.bind [] s
152
model sig = do abstr <- signature sig let s = F.ModelSem abstr return $ F.AbstractSig $ U.bind [] s
105
false
true
0
12
34
81
35
46
null
null
AlexanderPankiv/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
fromString_RDR = nameRdrName fromStringName
52
fromString_RDR = nameRdrName fromStringName
52
fromString_RDR = nameRdrName fromStringName
52
false
false
0
5
12
9
4
5
null
null
brendanhay/gogol
gogol-serviceuser/gen/Network/Google/ServiceUser/Types/Product.hs
mpl-2.0
-- | The list of custom error detail types, e.g. -- \'google.foo.v1.CustomError\'. ceTypes :: Lens' CustomError [Text] ceTypes = lens _ceTypes (\ s a -> s{_ceTypes = a}) . _Default . _Coerce
198
ceTypes :: Lens' CustomError [Text] ceTypes = lens _ceTypes (\ s a -> s{_ceTypes = a}) . _Default . _Coerce
115
ceTypes = lens _ceTypes (\ s a -> s{_ceTypes = a}) . _Default . _Coerce
79
true
true
0
11
39
54
29
25
null
null
icidasset/shikensu
tests/Test/Contrib.hs
mit
testSetContent :: TestTree testSetContent = let content = Text.encodeUtf8 "<html># Example\n</html>" dictionary = fmap (Contrib.setContent content) (example_md >>= Contrib.IO.read) definition = fmap List.head dictionary in testCase "Should `setContent`" $ assertDef definition Shikensu.content (Just content)
359
testSetContent :: TestTree testSetContent = let content = Text.encodeUtf8 "<html># Example\n</html>" dictionary = fmap (Contrib.setContent content) (example_md >>= Contrib.IO.read) definition = fmap List.head dictionary in testCase "Should `setContent`" $ assertDef definition Shikensu.content (Just content)
359
testSetContent = let content = Text.encodeUtf8 "<html># Example\n</html>" dictionary = fmap (Contrib.setContent content) (example_md >>= Contrib.IO.read) definition = fmap List.head dictionary in testCase "Should `setContent`" $ assertDef definition Shikensu.content (Just content)
332
false
true
2
12
84
97
45
52
null
null
k16shikano/wikipepub
Wpub/ReadMediaWiki.hs
mit
refref :: WParser XmlTree refref = do string "<ref" >> spaces >> manyTill inlineChar (try (string ">"))>> spaces manyTill inline (try (string "</ref>")) <* (skipMany (string " ")) return $ mkText ""
205
refref :: WParser XmlTree refref = do string "<ref" >> spaces >> manyTill inlineChar (try (string ">"))>> spaces manyTill inline (try (string "</ref>")) <* (skipMany (string " ")) return $ mkText ""
205
refref = do string "<ref" >> spaces >> manyTill inlineChar (try (string ">"))>> spaces manyTill inline (try (string "</ref>")) <* (skipMany (string " ")) return $ mkText ""
179
false
true
1
14
38
99
44
55
null
null
atsukotakahashi/wi
src/library/Yi/Editor.hs
gpl-2.0
-- | Return the windows that are currently open on the buffer whose -- key is given windowsOnBufferE :: BufferRef -> EditorM [Window] windowsOnBufferE k = do ts <- use tabsA let tabBufEq = concatMap (\win -> [win | bufkey win == k]) . (^. tabWindowsA) return $ concatMap tabBufEq ts -- | bring the editor focus the window with the given key. -- -- Fails if no window with the given key is found.
402
windowsOnBufferE :: BufferRef -> EditorM [Window] windowsOnBufferE k = do ts <- use tabsA let tabBufEq = concatMap (\win -> [win | bufkey win == k]) . (^. tabWindowsA) return $ concatMap tabBufEq ts -- | bring the editor focus the window with the given key. -- -- Fails if no window with the given key is found.
318
windowsOnBufferE k = do ts <- use tabsA let tabBufEq = concatMap (\win -> [win | bufkey win == k]) . (^. tabWindowsA) return $ concatMap tabBufEq ts -- | bring the editor focus the window with the given key. -- -- Fails if no window with the given key is found.
268
true
true
0
17
81
93
48
45
null
null
sonyxperiadev/dataflow
src/DataFlow/Graphviz/EdgeNormalization.hs
bsd-3-clause
normalize' :: Graph -> Normalizer Graph normalize' (Digraph id' stmts) = do s <- mapM normalizeStmt stmts return $ Digraph id' s -- | Normalizes all edges between nodes to have the same declaration order and -- to use the @dir@ attribute for occurrences of opposite edge direction -- between nodes. This is done to avoid the problem in Graphviz described -- here at http://stackoverflow.com/questions/1510784/right-to-left-edges-in-dot-graphviz. -- -- __Example:__ -- -- @ -- a -> b; -- b -> a; -- -- c -> d; -- c <- d; -- -- e <- f; -- @ -- -- gets converted to: -- -- @ -- a -> b; -- a -> b [dir="back"]; -- -- c -> d; -- c -> d [dir="back"]; -- -- f -> e; -- @
668
normalize' :: Graph -> Normalizer Graph normalize' (Digraph id' stmts) = do s <- mapM normalizeStmt stmts return $ Digraph id' s -- | Normalizes all edges between nodes to have the same declaration order and -- to use the @dir@ attribute for occurrences of opposite edge direction -- between nodes. This is done to avoid the problem in Graphviz described -- here at http://stackoverflow.com/questions/1510784/right-to-left-edges-in-dot-graphviz. -- -- __Example:__ -- -- @ -- a -> b; -- b -> a; -- -- c -> d; -- c <- d; -- -- e <- f; -- @ -- -- gets converted to: -- -- @ -- a -> b; -- a -> b [dir="back"]; -- -- c -> d; -- c -> d [dir="back"]; -- -- f -> e; -- @
668
normalize' (Digraph id' stmts) = do s <- mapM normalizeStmt stmts return $ Digraph id' s -- | Normalizes all edges between nodes to have the same declaration order and -- to use the @dir@ attribute for occurrences of opposite edge direction -- between nodes. This is done to avoid the problem in Graphviz described -- here at http://stackoverflow.com/questions/1510784/right-to-left-edges-in-dot-graphviz. -- -- __Example:__ -- -- @ -- a -> b; -- b -> a; -- -- c -> d; -- c <- d; -- -- e <- f; -- @ -- -- gets converted to: -- -- @ -- a -> b; -- a -> b [dir="back"]; -- -- c -> d; -- c -> d [dir="back"]; -- -- f -> e; -- @
628
false
true
0
8
133
81
52
29
null
null
JoeyEremondi/haskelm-old
src/Docs.hs
bsd-3-clause
document :: IParser [(String, D.ParseDeclaration, String)] document = onFreshLines (\t ts -> ts ++ [t]) [] docThing
115
document :: IParser [(String, D.ParseDeclaration, String)] document = onFreshLines (\t ts -> ts ++ [t]) [] docThing
115
document = onFreshLines (\t ts -> ts ++ [t]) [] docThing
56
false
true
0
9
16
54
30
24
null
null
dominicprior/ghcjs-demos
lu/src/Main.hs
mit
g :: [String] -> Int g = f'
27
g :: [String] -> Int g = f'
27
g = f'
6
false
true
0
7
7
25
11
14
null
null
foreverbell/unlimited-plt-toys
tapl/simplesub/Type.hs
bsd-3-clause
meet (TypeRecord fields1) (TypeRecord fields2) = TypeRecord $ union (sortFields fields1) (sortFields fields2) where union [] x = x union x [] = x union v1@((f1, ty1) : r1) v2@((f2, ty2) : r2) = case compare f1 f2 of LT -> (f1, ty1) : union r1 v2 GT -> (f2, ty2) : union v1 r2 EQ -> (f1, meet ty1 ty2) : union r1 r2
346
meet (TypeRecord fields1) (TypeRecord fields2) = TypeRecord $ union (sortFields fields1) (sortFields fields2) where union [] x = x union x [] = x union v1@((f1, ty1) : r1) v2@((f2, ty2) : r2) = case compare f1 f2 of LT -> (f1, ty1) : union r1 v2 GT -> (f2, ty2) : union v1 r2 EQ -> (f1, meet ty1 ty2) : union r1 r2
346
meet (TypeRecord fields1) (TypeRecord fields2) = TypeRecord $ union (sortFields fields1) (sortFields fields2) where union [] x = x union x [] = x union v1@((f1, ty1) : r1) v2@((f2, ty2) : r2) = case compare f1 f2 of LT -> (f1, ty1) : union r1 v2 GT -> (f2, ty2) : union v1 r2 EQ -> (f1, meet ty1 ty2) : union r1 r2
346
false
false
2
11
96
192
98
94
null
null
amccausl/Swish
Swish/HaskellRDF/GraphPartition.hs
lgpl-2.1
testRemove3 = remove 3 [1,2,4,5]
33
testRemove3 = remove 3 [1,2,4,5]
33
testRemove3 = remove 3 [1,2,4,5]
33
false
false
0
6
5
23
13
10
null
null
ntc2/cryptol
src/Cryptol/Parser/AST.hs
bsd-3-clause
isEApp _ = Nothing
35
isEApp _ = Nothing
35
isEApp _ = Nothing
35
false
false
0
5
20
9
4
5
null
null
Neuromancer42/ministgwasm
src/Language/MiniStg/Prettyprint.hs
bsd-3-clause
prettyprintModified :: Pretty a => (Doc -> Doc) -> a -> Text prettyprintModified modifier input = T.pack (displayS (renderPretty 0.4 1000 (modifier (pretty input))) "")
172
prettyprintModified :: Pretty a => (Doc -> Doc) -> a -> Text prettyprintModified modifier input = T.pack (displayS (renderPretty 0.4 1000 (modifier (pretty input))) "")
172
prettyprintModified modifier input = T.pack (displayS (renderPretty 0.4 1000 (modifier (pretty input))) "")
111
false
true
0
13
28
78
37
41
null
null
jchitel/ProjectEuler.hs
Problems/Problem0015.hs
mit
getProblem15Value :: Integer getProblem15Value = getNumberOfPaths 20 20
71
getProblem15Value :: Integer getProblem15Value = getNumberOfPaths 20 20
71
getProblem15Value = getNumberOfPaths 20 20
42
false
true
0
6
7
22
9
13
null
null
DavidAlphaFox/ghc
compiler/hsSyn/HsTypes.hs
bsd-3-clause
splitLHsForAllTy :: LHsType name -> (LHsTyVarBndrs name, HsContext name, LHsType name) splitLHsForAllTy poly_ty = case unLoc poly_ty of HsParTy ty -> splitLHsForAllTy ty HsForAllTy _ _ tvs cxt ty -> (tvs, unLoc cxt, ty) _ -> (emptyHsQTvs, [], poly_ty) -- The type vars should have been computed by now, even if they were implicit
410
splitLHsForAllTy :: LHsType name -> (LHsTyVarBndrs name, HsContext name, LHsType name) splitLHsForAllTy poly_ty = case unLoc poly_ty of HsParTy ty -> splitLHsForAllTy ty HsForAllTy _ _ tvs cxt ty -> (tvs, unLoc cxt, ty) _ -> (emptyHsQTvs, [], poly_ty) -- The type vars should have been computed by now, even if they were implicit
410
splitLHsForAllTy poly_ty = case unLoc poly_ty of HsParTy ty -> splitLHsForAllTy ty HsForAllTy _ _ tvs cxt ty -> (tvs, unLoc cxt, ty) _ -> (emptyHsQTvs, [], poly_ty) -- The type vars should have been computed by now, even if they were implicit
315
false
true
0
9
134
105
53
52
null
null
julienschmaltz/madl
test/app/Parser/TypeCheckerTest.hs
mit
illegalForLoopNameTest2 :: String illegalForLoopNameTest2 = "pred i () {true};\n\ \for (int i = 0; i < 5; i++) {};"
123
illegalForLoopNameTest2 :: String illegalForLoopNameTest2 = "pred i () {true};\n\ \for (int i = 0; i < 5; i++) {};"
123
illegalForLoopNameTest2 = "pred i () {true};\n\ \for (int i = 0; i < 5; i++) {};"
89
false
true
0
4
26
11
6
5
null
null
zeniuseducation/poly-euler
Alfa/haskell/tutorial/two.hs
epl-1.0
sol2 lim = sum $ filter even $ takeWhile (lim > ) fibo
54
sol2 lim = sum $ filter even $ takeWhile (lim > ) fibo
54
sol2 lim = sum $ filter even $ takeWhile (lim > ) fibo
54
false
false
0
7
12
29
14
15
null
null
enolan/Idris-dev
src/Idris/Delaborate.hs
bsd-3-clause
pprintErr' i (CantUnify _ (x_in, xprov) (y_in, yprov) e sc s) = let (x_ns, y_ns, nms) = renameMNs x_in y_in (x, y) = addImplicitDiffs (delabSugared i x_ns) (delabSugared i y_ns) in text "Type mismatch between" <> indented (annTm x_ns (pprintTerm' i (map (\ (n, b) -> (n, False)) sc ++ zip nms (repeat False)) x)) <> case xprov of Nothing -> empty Just t -> text " (" <> pprintProv i sc t <> text ")" <$> text "and" <> indented (annTm y_ns (pprintTerm' i (map (\ (n, b) -> (n, False)) sc ++ zip nms (repeat False)) y)) <> case yprov of Nothing -> empty Just t -> text " (" <> pprintProv i sc t <> text ")" <> case e of Msg "" -> empty -- if the specific error is the same as the one we just printed, -- there's no need to print it CantUnify _ (x_in', _) (y_in',_) _ _ _ | x_in == x_in' && y_in == y_in' -> empty _ -> line <> line <> text "Specifically:" <> indented (pprintErr' i e) <> if (opt_errContext (idris_options i)) then text "Unification failure" <$> showSc i sc else empty
1,303
pprintErr' i (CantUnify _ (x_in, xprov) (y_in, yprov) e sc s) = let (x_ns, y_ns, nms) = renameMNs x_in y_in (x, y) = addImplicitDiffs (delabSugared i x_ns) (delabSugared i y_ns) in text "Type mismatch between" <> indented (annTm x_ns (pprintTerm' i (map (\ (n, b) -> (n, False)) sc ++ zip nms (repeat False)) x)) <> case xprov of Nothing -> empty Just t -> text " (" <> pprintProv i sc t <> text ")" <$> text "and" <> indented (annTm y_ns (pprintTerm' i (map (\ (n, b) -> (n, False)) sc ++ zip nms (repeat False)) y)) <> case yprov of Nothing -> empty Just t -> text " (" <> pprintProv i sc t <> text ")" <> case e of Msg "" -> empty -- if the specific error is the same as the one we just printed, -- there's no need to print it CantUnify _ (x_in', _) (y_in',_) _ _ _ | x_in == x_in' && y_in == y_in' -> empty _ -> line <> line <> text "Specifically:" <> indented (pprintErr' i e) <> if (opt_errContext (idris_options i)) then text "Unification failure" <$> showSc i sc else empty
1,303
pprintErr' i (CantUnify _ (x_in, xprov) (y_in, yprov) e sc s) = let (x_ns, y_ns, nms) = renameMNs x_in y_in (x, y) = addImplicitDiffs (delabSugared i x_ns) (delabSugared i y_ns) in text "Type mismatch between" <> indented (annTm x_ns (pprintTerm' i (map (\ (n, b) -> (n, False)) sc ++ zip nms (repeat False)) x)) <> case xprov of Nothing -> empty Just t -> text " (" <> pprintProv i sc t <> text ")" <$> text "and" <> indented (annTm y_ns (pprintTerm' i (map (\ (n, b) -> (n, False)) sc ++ zip nms (repeat False)) y)) <> case yprov of Nothing -> empty Just t -> text " (" <> pprintProv i sc t <> text ")" <> case e of Msg "" -> empty -- if the specific error is the same as the one we just printed, -- there's no need to print it CantUnify _ (x_in', _) (y_in',_) _ _ _ | x_in == x_in' && y_in == y_in' -> empty _ -> line <> line <> text "Specifically:" <> indented (pprintErr' i e) <> if (opt_errContext (idris_options i)) then text "Unification failure" <$> showSc i sc else empty
1,303
false
false
8
16
516
474
235
239
null
null
mmn80/feed-reader
src/FeedReader/DB.hs
bsd-3-clause
runUnique :: (Document a, ToKey (Unique b), LogState l, MonadIO m) => Handle l -> Property a -> Unique b -> m (Either TransactionAbort (Maybe (Reference a, a))) runUnique h p k = runQuery h $ unique p k
230
runUnique :: (Document a, ToKey (Unique b), LogState l, MonadIO m) => Handle l -> Property a -> Unique b -> m (Either TransactionAbort (Maybe (Reference a, a))) runUnique h p k = runQuery h $ unique p k
230
runUnique h p k = runQuery h $ unique p k
41
false
true
0
15
66
110
53
57
null
null
davmre/matrizer
src/Matrizer/RewriteRules.hs
gpl-2.0
rtrHelper tbl z = let x:xs = reverse $ productsToList z candidate = expandProductRtL $ (xs ++ [x]) in case treeMatrix candidate tbl of Right m -> Just (Branch1 MTrace candidate) Left err -> Nothing ------------------------------------------------- -- (AC + BC) -> (A+B)C
391
rtrHelper tbl z = let x:xs = reverse $ productsToList z candidate = expandProductRtL $ (xs ++ [x]) in case treeMatrix candidate tbl of Right m -> Just (Branch1 MTrace candidate) Left err -> Nothing ------------------------------------------------- -- (AC + BC) -> (A+B)C
391
rtrHelper tbl z = let x:xs = reverse $ productsToList z candidate = expandProductRtL $ (xs ++ [x]) in case treeMatrix candidate tbl of Right m -> Just (Branch1 MTrace candidate) Left err -> Nothing ------------------------------------------------- -- (AC + BC) -> (A+B)C
391
false
false
0
12
162
93
45
48
null
null
benmos/reflex-dropzone
src/JavaScript/Dropzone/Reflex.hs
bsd-3-clause
dropzoneReset :: forall t m . MonadWidget t m => Dropzone -> m (Event t GJST.Event) dropzoneReset = dropzoneEventForDOMEvent "reset"
132
dropzoneReset :: forall t m . MonadWidget t m => Dropzone -> m (Event t GJST.Event) dropzoneReset = dropzoneEventForDOMEvent "reset"
132
dropzoneReset = dropzoneEventForDOMEvent "reset"
48
false
true
0
11
19
46
23
23
null
null
nomeata/ghc
compiler/codeGen/StgCmm.hs
bsd-3-clause
--------------------------------------------------------------- -- Top-level bindings --------------------------------------------------------------- {- 'cgTopBinding' is only used for top-level bindings, since they need to be allocated statically (not in the heap) and need to be labelled. No unboxed bindings can happen at top level. In the code below, the static bindings are accumulated in the @MkCgState@, and transferred into the ``statics'' slot by @forkStatics@. This is so that we can write the top level processing in a compositional style, with the increasing static environment being plumbed as a state variable. -} cgTopBinding :: DynFlags -> (StgBinding,[(Id,[Id])]) -> FCode () cgTopBinding dflags (StgNonRec id rhs, _srts) = do { id' <- maybeExternaliseId dflags id ; (info, fcode) <- cgTopRhs id' rhs ; fcode ; addBindC (cg_id info) info -- Add the *un-externalised* Id to the envt, -- so we find it when we look up occurrences }
1,026
cgTopBinding :: DynFlags -> (StgBinding,[(Id,[Id])]) -> FCode () cgTopBinding dflags (StgNonRec id rhs, _srts) = do { id' <- maybeExternaliseId dflags id ; (info, fcode) <- cgTopRhs id' rhs ; fcode ; addBindC (cg_id info) info -- Add the *un-externalised* Id to the envt, -- so we find it when we look up occurrences }
390
cgTopBinding dflags (StgNonRec id rhs, _srts) = do { id' <- maybeExternaliseId dflags id ; (info, fcode) <- cgTopRhs id' rhs ; fcode ; addBindC (cg_id info) info -- Add the *un-externalised* Id to the envt, -- so we find it when we look up occurrences }
325
true
true
0
10
218
121
65
56
null
null
vincenthz/hs-foundation
basement/Basement/Sized/List.hs
bsd-3-clause
-- | Zip 3 lists using a function zipWith3 :: (a -> b -> c -> x) -> ListN n a -> ListN n b -> ListN n c -> ListN n x zipWith3 f (ListN (v1:vs)) (ListN (w1:ws)) (ListN (x1:xs)) = ListN (f v1 w1 x1 : unListN (zipWith3 f (ListN vs) (ListN ws) (ListN xs)))
292
zipWith3 :: (a -> b -> c -> x) -> ListN n a -> ListN n b -> ListN n c -> ListN n x zipWith3 f (ListN (v1:vs)) (ListN (w1:ws)) (ListN (x1:xs)) = ListN (f v1 w1 x1 : unListN (zipWith3 f (ListN vs) (ListN ws) (ListN xs)))
258
zipWith3 f (ListN (v1:vs)) (ListN (w1:ws)) (ListN (x1:xs)) = ListN (f v1 w1 x1 : unListN (zipWith3 f (ListN vs) (ListN ws) (ListN xs)))
139
true
true
0
14
96
166
81
85
null
null
modeswitch/barrelfish
hake/Main.hs
mit
resolveRelativePathName o BuildTree a f root = resolveRelativePathName' ("." ./. a) a f root
96
resolveRelativePathName o BuildTree a f root = resolveRelativePathName' ("." ./. a) a f root
96
resolveRelativePathName o BuildTree a f root = resolveRelativePathName' ("." ./. a) a f root
96
false
false
0
7
17
33
16
17
null
null
notae/haskell-exercise
cp/CFPFD2.hs
bsd-3-clause
eq :: FDBinding m s v => FDVar m s v -> FDVar m s v -> m s () eq = arcConstraint eqConstraint
93
eq :: FDBinding m s v => FDVar m s v -> FDVar m s v -> m s () eq = arcConstraint eqConstraint
93
eq = arcConstraint eqConstraint
31
false
true
0
10
23
59
26
33
null
null
Forec/learn
2017.3/Parallel Haskell/ch12/chat.hs
mit
runClient :: Server -> Client -> IO () runClient serv@Server{..} client@Client{..} = do race server receive return () where receive = forever $ do msg <- hGetLine clientHandle atomically $ sendMessage client (Command msg) server = join $ atomically $ do k <- readTVar clientKicked case k of Just reason -> return $ hPutStrLn clientHandle $ "You have been kicked: " ++ reason Nothing -> do msg <- readTChan clientSendChan return $ do continue <- handleMessage serv client msg when continue server
576
runClient :: Server -> Client -> IO () runClient serv@Server{..} client@Client{..} = do race server receive return () where receive = forever $ do msg <- hGetLine clientHandle atomically $ sendMessage client (Command msg) server = join $ atomically $ do k <- readTVar clientKicked case k of Just reason -> return $ hPutStrLn clientHandle $ "You have been kicked: " ++ reason Nothing -> do msg <- readTChan clientSendChan return $ do continue <- handleMessage serv client msg when continue server
576
runClient serv@Server{..} client@Client{..} = do race server receive return () where receive = forever $ do msg <- hGetLine clientHandle atomically $ sendMessage client (Command msg) server = join $ atomically $ do k <- readTVar clientKicked case k of Just reason -> return $ hPutStrLn clientHandle $ "You have been kicked: " ++ reason Nothing -> do msg <- readTChan clientSendChan return $ do continue <- handleMessage serv client msg when continue server
537
false
true
0
17
162
202
92
110
null
null
AndrewRademacher/twitter-conduit
sample/oauth_callback.hs
bsd-2-clause
getTokens :: IO OAuth getTokens = do consumerKey <- getEnv "OAUTH_CONSUMER_KEY" consumerSecret <- getEnv "OAUTH_CONSUMER_SECRET" return $ twitterOAuth { oauthConsumerKey = S8.pack consumerKey , oauthConsumerSecret = S8.pack consumerSecret , oauthCallback = Just $ S8.pack callback }
334
getTokens :: IO OAuth getTokens = do consumerKey <- getEnv "OAUTH_CONSUMER_KEY" consumerSecret <- getEnv "OAUTH_CONSUMER_SECRET" return $ twitterOAuth { oauthConsumerKey = S8.pack consumerKey , oauthConsumerSecret = S8.pack consumerSecret , oauthCallback = Just $ S8.pack callback }
334
getTokens = do consumerKey <- getEnv "OAUTH_CONSUMER_KEY" consumerSecret <- getEnv "OAUTH_CONSUMER_SECRET" return $ twitterOAuth { oauthConsumerKey = S8.pack consumerKey , oauthConsumerSecret = S8.pack consumerSecret , oauthCallback = Just $ S8.pack callback }
312
false
true
0
12
87
80
39
41
null
null
5outh/Haskell-Graphics-Projects
Project3/Algorithms.hs
mit
randomShortLine alg = do x <- getStdRandom $ randomR (10, 630) y <- getStdRandom $ randomR (10, 630) dx <- getStdRandom $ randomR (-10, 10) dy <- getStdRandom $ randomR (-10, 10) alg $ Line (x, y) (x + dx, y + dy)
228
randomShortLine alg = do x <- getStdRandom $ randomR (10, 630) y <- getStdRandom $ randomR (10, 630) dx <- getStdRandom $ randomR (-10, 10) dy <- getStdRandom $ randomR (-10, 10) alg $ Line (x, y) (x + dx, y + dy)
228
randomShortLine alg = do x <- getStdRandom $ randomR (10, 630) y <- getStdRandom $ randomR (10, 630) dx <- getStdRandom $ randomR (-10, 10) dy <- getStdRandom $ randomR (-10, 10) alg $ Line (x, y) (x + dx, y + dy)
228
false
false
0
11
57
125
63
62
null
null
thewoolleyman/haskellbook
08/06/eric/WordNumber.hs
unlicense
digits :: Int -> [Int] digits n | n < 10 = [n] | otherwise = digits (fst res) ++ [snd res] where res = divMod n 10
122
digits :: Int -> [Int] digits n | n < 10 = [n] | otherwise = digits (fst res) ++ [snd res] where res = divMod n 10
122
digits n | n < 10 = [n] | otherwise = digits (fst res) ++ [snd res] where res = divMod n 10
99
false
true
1
9
35
85
38
47
null
null