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
kawu/dawg-ord
src/Data/DAWG/Gen/HashMap.hs
bsd-2-clause
-- instance (Ord a, Binary a, Binary b) => Binary (HashMap a b) where -- put HashMap{..} = put size >> put hashMap -- get = HashMap <$> get <*> get -- | Empty map. empty :: HashMap a b empty = HashMap 0 I.empty
220
empty :: HashMap a b empty = HashMap 0 I.empty
46
empty = HashMap 0 I.empty
25
true
true
0
6
54
34
16
18
null
null
relrod/cx
src/Game/Chess/Piece.hs
bsd-2-clause
-- | Determines the directions a 'Piece' can move in one step. -- Does not work for pawns, since their directional vector differs depending on -- color. Use "movingVectors'" if you know the color. movingVectors :: Piece -> [MovingVector Int] movingVectors King = movingVectors Bishop ++ movingVectors Rook
307
movingVectors :: Piece -> [MovingVector Int] movingVectors King = movingVectors Bishop ++ movingVectors Rook
110
movingVectors King = movingVectors Bishop ++ movingVectors Rook
65
true
true
0
7
49
37
19
18
null
null
swift-nav/plover
relics/Reduce.hs
mit
typeCheck' (Ptr a) = do t <-typeCheck' a case t of VecType d b -> return $ VecType (1 : d) b _ -> return $ VecType [1] t
132
typeCheck' (Ptr a) = do t <-typeCheck' a case t of VecType d b -> return $ VecType (1 : d) b _ -> return $ VecType [1] t
132
typeCheck' (Ptr a) = do t <-typeCheck' a case t of VecType d b -> return $ VecType (1 : d) b _ -> return $ VecType [1] t
132
false
false
0
13
40
78
36
42
null
null
ihc/futhark
src/Futhark/CodeGen/ImpGen.hs
isc
-- No arms, no cake. defCompileBasicOp target e = compilerBugS $ "ImpGen.defCompileBasicOp: Invalid target\n " ++ show target ++ "\nfor expression\n " ++ pretty e
169
defCompileBasicOp target e = compilerBugS $ "ImpGen.defCompileBasicOp: Invalid target\n " ++ show target ++ "\nfor expression\n " ++ pretty e
147
defCompileBasicOp target e = compilerBugS $ "ImpGen.defCompileBasicOp: Invalid target\n " ++ show target ++ "\nfor expression\n " ++ pretty e
147
true
false
0
8
31
34
16
18
null
null
iand675/bearcat
src/Elements.hs
bsd-3-clause
-- | The HTML Underline Element (<u>) renders text with an underline, a line under the baseline of its content. u_ :: MonadBase Incremental m => m (ElementOptions "u") -> [Attribute "u"] -> m a -> m (Element, a) u_ = element (Proxy :: Proxy "u") "u"
255
u_ :: MonadBase Incremental m => m (ElementOptions "u") -> [Attribute "u"] -> m a -> m (Element, a) u_ = element (Proxy :: Proxy "u") "u"
143
u_ = element (Proxy :: Proxy "u") "u"
37
true
true
0
11
52
79
38
41
null
null
diku-dk/futhark
src/Futhark/IR/Primitive.hs
isc
doCmpOp FCmpLt {} (FloatValue v1) (FloatValue v2) = Just $ doFCmpLt v1 v2
73
doCmpOp FCmpLt {} (FloatValue v1) (FloatValue v2) = Just $ doFCmpLt v1 v2
73
doCmpOp FCmpLt {} (FloatValue v1) (FloatValue v2) = Just $ doFCmpLt v1 v2
73
false
false
0
7
12
38
18
20
null
null
TomMD/cryptol
sbv/Data/SBV/BitVectors/Data.hs
bsd-3-clause
-- | Handling constraints imposeConstraint :: SBool -> Symbolic () imposeConstraint c = do st <- ask case runMode st of CodeGen -> error "SBV: constraints are not allowed in code-generation" _ -> do liftIO $ do v <- sbvToSW st c modifyIORef (rConstraints st) (v:) -- | Add a constraint with a given probability
445
imposeConstraint :: SBool -> Symbolic () imposeConstraint c = do st <- ask case runMode st of CodeGen -> error "SBV: constraints are not allowed in code-generation" _ -> do liftIO $ do v <- sbvToSW st c modifyIORef (rConstraints st) (v:) -- | Add a constraint with a given probability
419
imposeConstraint c = do st <- ask case runMode st of CodeGen -> error "SBV: constraints are not allowed in code-generation" _ -> do liftIO $ do v <- sbvToSW st c modifyIORef (rConstraints st) (v:) -- | Add a constraint with a given probability
378
true
true
0
17
189
94
44
50
null
null
ademinn/JavaWithClasses
src/Checker.hs
bsd-3-clause
checkBoolExpr :: Expression -> SemanticError -> Checker () checkBoolExpr expr err = ifOkExpr expr $ \mt -> CM.unless (mt == ReturnType (PrimaryType TBoolean)) $ newLineError expr err
182
checkBoolExpr :: Expression -> SemanticError -> Checker () checkBoolExpr expr err = ifOkExpr expr $ \mt -> CM.unless (mt == ReturnType (PrimaryType TBoolean)) $ newLineError expr err
182
checkBoolExpr expr err = ifOkExpr expr $ \mt -> CM.unless (mt == ReturnType (PrimaryType TBoolean)) $ newLineError expr err
123
false
true
0
13
26
71
34
37
null
null
liwanwei/pandoc
src/Text/Pandoc/Parsing.hs
gpl-2.0
readWithWarnings :: Parser [Char] ParserState a -> ParserState -> String -> Either PandocError (a, [String]) readWithWarnings p = readWith $ do doc <- p warnings <- stateWarnings <$> getState return (doc, warnings) -- | Parse a string with @parser@ (for testing).
351
readWithWarnings :: Parser [Char] ParserState a -> ParserState -> String -> Either PandocError (a, [String]) readWithWarnings p = readWith $ do doc <- p warnings <- stateWarnings <$> getState return (doc, warnings) -- | Parse a string with @parser@ (for testing).
351
readWithWarnings p = readWith $ do doc <- p warnings <- stateWarnings <$> getState return (doc, warnings) -- | Parse a string with @parser@ (for testing).
182
false
true
0
10
128
85
43
42
null
null
alogic0/onu-course
Pictures.hs
mit
pictures :: Int -> [Picture] pictures d = do size <- [0..d] map (fromList size) $ replicateM (size^2) [' ', '#']
116
pictures :: Int -> [Picture] pictures d = do size <- [0..d] map (fromList size) $ replicateM (size^2) [' ', '#']
116
pictures d = do size <- [0..d] map (fromList size) $ replicateM (size^2) [' ', '#']
87
false
true
0
10
24
67
34
33
null
null
uduki/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qStyleOptionFocusRectAddFinalizer :: QStyleOptionFocusRect a -> IO () qStyleOptionFocusRectAddFinalizer (Object fp) = addForeignPtrFinalizer qtc_QStyleOptionFocusRect_getFinalizer fp
184
qStyleOptionFocusRectAddFinalizer :: QStyleOptionFocusRect a -> IO () qStyleOptionFocusRectAddFinalizer (Object fp) = addForeignPtrFinalizer qtc_QStyleOptionFocusRect_getFinalizer fp
184
qStyleOptionFocusRectAddFinalizer (Object fp) = addForeignPtrFinalizer qtc_QStyleOptionFocusRect_getFinalizer fp
114
false
true
0
7
15
37
17
20
null
null
olsner/sedition
IR.hs
mit
newPred = Pred <$> freshUnique
30
newPred = Pred <$> freshUnique
30
newPred = Pred <$> freshUnique
30
false
false
3
5
4
15
5
10
null
null
reckbo/ppl
pipeline-lib/Node.hs
bsd-3-clause
pathsDwi projdir idx n@(Node.Dwi.Dwi{..}) = [("dwi" ++ show idx,projdir </> path n)]
86
pathsDwi projdir idx n@(Node.Dwi.Dwi{..}) = [("dwi" ++ show idx,projdir </> path n)]
86
pathsDwi projdir idx n@(Node.Dwi.Dwi{..}) = [("dwi" ++ show idx,projdir </> path n)]
86
false
false
0
9
13
51
27
24
null
null
unisonweb/platform
parser-typechecker/src/Unison/Util/Pretty.hs
mit
hiBlack = map CT.hiBlack
24
hiBlack = map CT.hiBlack
24
hiBlack = map CT.hiBlack
24
false
false
0
6
3
11
5
6
null
null
blamario/incremental-parser
src/Text/ParserCombinators/Incremental.hs
gpl-3.0
completeResults _ = []
22
completeResults _ = []
22
completeResults _ = []
22
false
false
0
5
3
12
5
7
null
null
sopvop/cabal
Cabal/Distribution/Types/ComponentEnabledSpec.hs
bsd-3-clause
-- | Is this component disabled, and if so, why? -- -- @since 2.0.0.0 componentDisabledReason :: ComponentEnabledSpec -> Component -> Maybe ComponentDisabledReason componentDisabledReason enabled comp = componentNameDisabledReason enabled (componentName comp)
287
componentDisabledReason :: ComponentEnabledSpec -> Component -> Maybe ComponentDisabledReason componentDisabledReason enabled comp = componentNameDisabledReason enabled (componentName comp)
217
componentDisabledReason enabled comp = componentNameDisabledReason enabled (componentName comp)
99
true
true
0
7
57
41
21
20
null
null
Heather/stack
src/main/Main.hs
bsd-3-clause
uninstallCmd :: [String] -> GlobalOpts -> IO () uninstallCmd _ go = withConfigAndLock go $ do $logError "stack does not manage installations in global locations" $logError "The only global mutation stack performs is executable copying" $logError "For the default executable destination, please run 'stack path --local-bin-path'" -- | Unpack packages to the filesystem
380
uninstallCmd :: [String] -> GlobalOpts -> IO () uninstallCmd _ go = withConfigAndLock go $ do $logError "stack does not manage installations in global locations" $logError "The only global mutation stack performs is executable copying" $logError "For the default executable destination, please run 'stack path --local-bin-path'" -- | Unpack packages to the filesystem
380
uninstallCmd _ go = withConfigAndLock go $ do $logError "stack does not manage installations in global locations" $logError "The only global mutation stack performs is executable copying" $logError "For the default executable destination, please run 'stack path --local-bin-path'" -- | Unpack packages to the filesystem
332
false
true
0
9
65
61
26
35
null
null
uduki/hsQt
Qtc/Enums/Network/QHostAddress.hs
bsd-2-clause
eBroadcast :: SpecialAddress eBroadcast = ieSpecialAddress $ 1
64
eBroadcast :: SpecialAddress eBroadcast = ieSpecialAddress $ 1
64
eBroadcast = ieSpecialAddress $ 1
35
false
true
0
6
9
18
8
10
null
null
mitchellwrosen/dohaskell
src/Model/ResourceEdit.hs
bsd-3-clause
fetchEditRemoveTagsDB = fetchEditDB EditRemoveTagResId
61
fetchEditRemoveTagsDB = fetchEditDB EditRemoveTagResId
61
fetchEditRemoveTagsDB = fetchEditDB EditRemoveTagResId
61
false
false
0
5
10
9
4
5
null
null
josuf107/Adverb
Adverb/Common.hs
gpl-3.0
retributively = id
18
retributively = id
18
retributively = id
18
false
false
0
4
2
6
3
3
null
null
stu-smith/project-euler-haskell
Euler-003.hs
mit
factors :: (Integral a) => a -> [a] factors x = filter (\ y -> x `mod` y == 0) [1 .. limit] where limit = ceiling $ sqrt $ fromIntegral x
141
factors :: (Integral a) => a -> [a] factors x = filter (\ y -> x `mod` y == 0) [1 .. limit] where limit = ceiling $ sqrt $ fromIntegral x
140
factors x = filter (\ y -> x `mod` y == 0) [1 .. limit] where limit = ceiling $ sqrt $ fromIntegral x
104
false
true
0
9
35
78
42
36
null
null
fmthoma/ghc
compiler/basicTypes/BasicTypes.hs
bsd-3-clause
boolToRecFlag :: Bool -> RecFlag boolToRecFlag True = Recursive
64
boolToRecFlag :: Bool -> RecFlag boolToRecFlag True = Recursive
64
boolToRecFlag True = Recursive
31
false
true
0
5
9
18
9
9
null
null
fredcy/elm-format
tests/Parse/TypeTest.hs
bsd-3-clause
example name input expected = testCase name $ assertParse expr input expected
89
example name input expected = testCase name $ assertParse expr input expected
89
example name input expected = testCase name $ assertParse expr input expected
89
false
false
0
6
23
27
12
15
null
null
ahodgen/archer-calc
src/BuiltIn/Date.hs
bsd-2-clause
today _ = infError
19
today _ = infError
19
today _ = infError
19
false
false
0
4
4
10
4
6
null
null
sphynx/hamisado
Game.hs
bsd-3-clause
isOver :: Board b => Position b -> Bool isOver p | Winner _ <- roundResult p = True
83
isOver :: Board b => Position b -> Bool isOver p | Winner _ <- roundResult p = True
83
isOver p | Winner _ <- roundResult p = True
43
false
true
0
9
18
44
19
25
null
null
dolio/vector
Data/Vector.hs
bsd-3-clause
ifoldM = G.ifoldM
17
ifoldM = G.ifoldM
17
ifoldM = G.ifoldM
17
false
false
1
6
2
12
4
8
null
null
Lysxia/unparse-attoparsec
example/regex.hs
mit
main :: IO () main = for_ examples $ \s -> do BS8.putStrLn s v <- unwrap $ parse regex s print v s'_ <- unwrap $ unparse regex v let s' = LBS.toStrict s'_ v' <- unwrap $ parse regex s' assertEqual v v' BS8.putStrLn s'
233
main :: IO () main = for_ examples $ \s -> do BS8.putStrLn s v <- unwrap $ parse regex s print v s'_ <- unwrap $ unparse regex v let s' = LBS.toStrict s'_ v' <- unwrap $ parse regex s' assertEqual v v' BS8.putStrLn s'
233
main = for_ examples $ \s -> do BS8.putStrLn s v <- unwrap $ parse regex s print v s'_ <- unwrap $ unparse regex v let s' = LBS.toStrict s'_ v' <- unwrap $ parse regex s' assertEqual v v' BS8.putStrLn s'
219
false
true
0
13
62
120
52
68
null
null
DavidAlphaFox/darcs
src/Darcs/Patch/Match.hs
gpl-2.0
applyNInv _ (PatchSet NilRL NilRL) = error "Index out of range."
64
applyNInv _ (PatchSet NilRL NilRL) = error "Index out of range."
64
applyNInv _ (PatchSet NilRL NilRL) = error "Index out of range."
64
false
false
0
7
10
22
10
12
null
null
wujf/yesod
yesod-core/Yesod/Core/Handler.hs
mit
-- | Internal use only, not to be confused with 'setHeader'. addHeaderInternal :: MonadHandler m => Header -> m () addHeaderInternal = tell . Endo . (:)
152
addHeaderInternal :: MonadHandler m => Header -> m () addHeaderInternal = tell . Endo . (:)
91
addHeaderInternal = tell . Endo . (:)
37
true
true
0
9
26
44
21
23
null
null
input-output-hk/pos-haskell-prototype
client/test/Test/Pos/Client/Txp/UtilSpec.hs
mit
secretKeyToAddress :: NetworkMagic -> SecretKey -> Address secretKeyToAddress nm = makePubKeyAddressBoot nm . toPublic
118
secretKeyToAddress :: NetworkMagic -> SecretKey -> Address secretKeyToAddress nm = makePubKeyAddressBoot nm . toPublic
118
secretKeyToAddress nm = makePubKeyAddressBoot nm . toPublic
59
false
true
0
8
13
35
15
20
null
null
glguy/Yinsh
Yinsh.hs
bsd-3-clause
goalRunLength = 5
19
goalRunLength = 5
19
goalRunLength = 5
19
false
false
1
5
4
10
3
7
null
null
narurien/ganeti-ceph
src/Ganeti/HTools/CLI.hs
gpl-2.0
oNodeTags :: OptType oNodeTags = (Option "" ["node-tags"] (ReqArg (\ f opts -> Ok opts { optNodeTags = Just $ sepSplit ',' f }) "TAG,...") "Restrict to nodes with the given tags", OptComplString)
207
oNodeTags :: OptType oNodeTags = (Option "" ["node-tags"] (ReqArg (\ f opts -> Ok opts { optNodeTags = Just $ sepSplit ',' f }) "TAG,...") "Restrict to nodes with the given tags", OptComplString)
207
oNodeTags = (Option "" ["node-tags"] (ReqArg (\ f opts -> Ok opts { optNodeTags = Just $ sepSplit ',' f }) "TAG,...") "Restrict to nodes with the given tags", OptComplString)
186
false
true
0
15
44
67
36
31
null
null
fmapfmapfmap/amazonka
amazonka-redshift/test/Test/AWS/Gen/Redshift.hs
mpl-2.0
testModifyClusterResponse :: ModifyClusterResponse -> TestTree testModifyClusterResponse = res "ModifyClusterResponse" "fixture/ModifyClusterResponse.proto" redshift (Proxy :: Proxy ModifyCluster)
212
testModifyClusterResponse :: ModifyClusterResponse -> TestTree testModifyClusterResponse = res "ModifyClusterResponse" "fixture/ModifyClusterResponse.proto" redshift (Proxy :: Proxy ModifyCluster)
212
testModifyClusterResponse = res "ModifyClusterResponse" "fixture/ModifyClusterResponse.proto" redshift (Proxy :: Proxy ModifyCluster)
149
false
true
0
7
30
42
18
24
null
null
mettekou/ghc
compiler/types/Coercion.hs
bsd-3-clause
coercionSize (CoherenceCo c1 c2) = 1 + coercionSize c1 + coercionSize c2
72
coercionSize (CoherenceCo c1 c2) = 1 + coercionSize c1 + coercionSize c2
72
coercionSize (CoherenceCo c1 c2) = 1 + coercionSize c1 + coercionSize c2
72
false
false
0
7
11
31
14
17
null
null
dustinrohde/TicTacToe
src/Main.hs
lgpl-3.0
promptForName :: String -> IO String promptForName = prompt . (++ ", what is your name? ")
90
promptForName :: String -> IO String promptForName = prompt . (++ ", what is your name? ")
90
promptForName = prompt . (++ ", what is your name? ")
53
false
true
0
6
16
26
14
12
null
null
tylerwx51/StartStopFRP
Buttons.hs
bsd-3-clause
buttonT5 = makeExtent (-5) (-35) 40 (-40)
47
buttonT5 = makeExtent (-5) (-35) 40 (-40)
47
buttonT5 = makeExtent (-5) (-35) 40 (-40)
47
false
false
0
7
12
30
16
14
null
null
thoughtpolice/infinity
src/Infinity/Main.hs
bsd-3-clause
imain :: Module -> Reboot -> IO () imain mod reboot = imain' mod reboot newbot
78
imain :: Module -> Reboot -> IO () imain mod reboot = imain' mod reboot newbot
78
imain mod reboot = imain' mod reboot newbot
43
false
true
0
8
15
40
18
22
null
null
EPashkin/gamenumber-gloss
src/View/State.hs
gpl-3.0
inPanel :: (Coord, Coord) -> ViewData -> Bool inPanel (x, y) state = x >= panelLeftX state
90
inPanel :: (Coord, Coord) -> ViewData -> Bool inPanel (x, y) state = x >= panelLeftX state
90
inPanel (x, y) state = x >= panelLeftX state
44
false
true
0
6
16
43
23
20
null
null
phaazon/OpenGLRawgen
src/Spec/Parsing.hs
bsd-3-clause
updateNonProfile :: Bool -> IE -> ProfileBuild -> ProfileBuild updateNonProfile addRem ie (gen, profs) = let update = (if addRem then S.insert else S.delete) ie in (update gen, fmap update profs)
203
updateNonProfile :: Bool -> IE -> ProfileBuild -> ProfileBuild updateNonProfile addRem ie (gen, profs) = let update = (if addRem then S.insert else S.delete) ie in (update gen, fmap update profs)
203
updateNonProfile addRem ie (gen, profs) = let update = (if addRem then S.insert else S.delete) ie in (update gen, fmap update profs)
140
false
true
0
12
38
84
42
42
null
null
muhbaasu/hmon
src/Collectors/NetDev.hs
apache-2.0
toMetric :: [Int] -> (NetReceivedMetric, NetTransmittedMetric) toMetric ms = (recvdMetric, transMetric) where (rList, tList) = splitAt 8 ms (b:p:e:d:fi:fr:c:m:_) = rList (bytes:pkts:errs:drp:fifo:colls:carr:compr:_) = tList recvdMetric = NetReceivedMetric b p e d fi fr c m transMetric = NetTransmittedMetric bytes pkts errs drp fifo colls carr compr
368
toMetric :: [Int] -> (NetReceivedMetric, NetTransmittedMetric) toMetric ms = (recvdMetric, transMetric) where (rList, tList) = splitAt 8 ms (b:p:e:d:fi:fr:c:m:_) = rList (bytes:pkts:errs:drp:fifo:colls:carr:compr:_) = tList recvdMetric = NetReceivedMetric b p e d fi fr c m transMetric = NetTransmittedMetric bytes pkts errs drp fifo colls carr compr
368
toMetric ms = (recvdMetric, transMetric) where (rList, tList) = splitAt 8 ms (b:p:e:d:fi:fr:c:m:_) = rList (bytes:pkts:errs:drp:fifo:colls:carr:compr:_) = tList recvdMetric = NetReceivedMetric b p e d fi fr c m transMetric = NetTransmittedMetric bytes pkts errs drp fifo colls carr compr
305
false
true
1
13
63
195
94
101
null
null
lifengsun/haskell-exercise
scheme/03/evaluator3.hs
gpl-3.0
parseList :: Parser LispVal parseList = liftM List . sepBy parseExpr $ spaces
77
parseList :: Parser LispVal parseList = liftM List . sepBy parseExpr $ spaces
77
parseList = liftM List . sepBy parseExpr $ spaces
49
false
true
0
7
12
28
13
15
null
null
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
mpl-2.0
-- | Name of this event tag. This is a required field and must be less than -- 256 characters long. etName :: Lens' EventTag (Maybe Text) etName = lens _etName (\ s a -> s{_etName = a})
185
etName :: Lens' EventTag (Maybe Text) etName = lens _etName (\ s a -> s{_etName = a})
85
etName = lens _etName (\ s a -> s{_etName = a})
47
true
true
1
9
37
52
26
26
null
null
kim/amazonka
amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/Types.hs
mpl-2.0
-- | The name of the configuration option. cosOptionName :: Lens' ConfigurationOptionSetting (Maybe Text) cosOptionName = lens _cosOptionName (\s a -> s { _cosOptionName = a })
176
cosOptionName :: Lens' ConfigurationOptionSetting (Maybe Text) cosOptionName = lens _cosOptionName (\s a -> s { _cosOptionName = a })
133
cosOptionName = lens _cosOptionName (\s a -> s { _cosOptionName = a })
70
true
true
0
9
26
46
25
21
null
null
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/DiskTypes/Get.hs
mpl-2.0
-- | Name of the disk type to return. dtgDiskType :: Lens' DiskTypesGet Text dtgDiskType = lens _dtgDiskType (\ s a -> s{_dtgDiskType = a})
141
dtgDiskType :: Lens' DiskTypesGet Text dtgDiskType = lens _dtgDiskType (\ s a -> s{_dtgDiskType = a})
103
dtgDiskType = lens _dtgDiskType (\ s a -> s{_dtgDiskType = a})
64
true
true
0
9
26
42
22
20
null
null
craigbilner/advent-of-code-2016
day-8.hs
apache-2.0
rowRegex :: Regex rowRegex = mkRegex "rotate row y=([0-9]*) by ([0-9]*)"
72
rowRegex :: Regex rowRegex = mkRegex "rotate row y=([0-9]*) by ([0-9]*)"
72
rowRegex = mkRegex "rotate row y=([0-9]*) by ([0-9]*)"
54
false
true
0
6
10
21
8
13
null
null
erantapaa/henigma
Test.hs
bsd-3-clause
upperToLower ch = chr( ord('a') + ord(ch) - ord('A') )
54
upperToLower ch = chr( ord('a') + ord(ch) - ord('A') )
54
upperToLower ch = chr( ord('a') + ord(ch) - ord('A') )
54
false
false
1
10
9
44
20
24
null
null
ekmett/ghclive
src-main/SeqMap.hs
bsd-3-clause
setNext n (SM v p _) = SM v p n
31
setNext n (SM v p _) = SM v p n
31
setNext n (SM v p _) = SM v p n
31
false
false
0
7
10
28
13
15
null
null
tonymorris/geo-osm
src/Data/Geo/OSM/BoundOption.hs
bsd-3-clause
foldBoundOption _ _ f Empty = f
33
foldBoundOption _ _ f Empty = f
33
foldBoundOption _ _ f Empty = f
33
false
false
0
5
8
15
7
8
null
null
brendanhay/gogol
gogol-securitycenter/gen/Network/Google/SecurityCenter/Types/Product.hs
mpl-2.0
-- | Creates a value of 'StreamingConfig' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'scFilter' streamingConfig :: StreamingConfig streamingConfig = StreamingConfig' {_scFilter = Nothing}
281
streamingConfig :: StreamingConfig streamingConfig = StreamingConfig' {_scFilter = Nothing}
95
streamingConfig = StreamingConfig' {_scFilter = Nothing}
56
true
true
0
6
46
24
16
8
null
null
mcschroeder/ghc
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
bsd-3-clause
-- | Look up the given name in the (type namespace of the) current splice's scope. See "Language.Haskell.TH.Syntax#namelookup" for more details. lookupTypeName :: String -> Q (Maybe Name) lookupTypeName s = Q (qLookupName True s)
230
lookupTypeName :: String -> Q (Maybe Name) lookupTypeName s = Q (qLookupName True s)
85
lookupTypeName s = Q (qLookupName True s)
42
true
true
0
8
35
39
19
20
null
null
shlevy/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
ctEvidence :: Ct -> CtEvidence ctEvidence = cc_ev
49
ctEvidence :: Ct -> CtEvidence ctEvidence = cc_ev
49
ctEvidence = cc_ev
18
false
true
0
7
7
22
9
13
null
null
noteed/humming
bin/humming.hs
bsd-3-clause
-- | Run a sub-command. runCmd :: Cmd -> IO () runCmd cmd = do con <- connectPostgreSQL . pack $ cmdDatabaseUrl cmd _ <- execute_ con "SET application_name='humming'" case cmd of Create{..} -> do Q.create con when (not cmdNoScheduling) $ S.create con Drop{..} -> do Q.drop con S.drop con Enqueue{..} -> do case parse json (L.pack cmdArguments) of Done _ arguments -> do let q = Q.Queue $ pack cmdQueueName i <- Q.enqueue con q (pack cmdMethod) arguments putStrLn $ "Enqueued job #" ++ show i ++ "." _ -> putStrLn "The argument ain't no valid JSON." Count{..} -> do Q.runCount con (fmap pack cmdMQueueName) >>= putStrLn . show Delete{..} -> do case (cmdMQueueName, cmdMJobId) of (Just _, Just _) -> putStrLn "Only at most one of --queue and --job can be given." (Just queueName, _) -> Q.runDeleteQueue con $ pack queueName (_, Just jobId) -> Q.runDeleteJob con jobId (_, _) -> Q.runDeleteAll con Lock{..} -> do Q.runLock con (pack cmdQueueName) 10 >>= print UnlockDeads{..} -> do Q.unlockJobsOfDeadWorkers con Listen{..} -> do Q.listenNotifications con cmdQueueName Notify{..} -> do Q.sendNotification con cmdQueueName Work{..} -> do w_ <- Q.defaultWorker let w = w_ { Q.workerQueue = Q.Queue (pack cmdQueueName) } if cmdWorkOnce then Q.work con w else Q.start con w Schedule{..} -> do S.schedule con Plan{..} -> do case parse json (L.pack cmdArguments) of Done _ arguments -> do now <- getCurrentTime let at = now .+^ fromSeconds cmdSeconds S.plan con (T.pack cmdQueueName) (T.pack cmdMethod) arguments at _ -> putStrLn "The argument ain't no valid JSON." close con
1,867
runCmd :: Cmd -> IO () runCmd cmd = do con <- connectPostgreSQL . pack $ cmdDatabaseUrl cmd _ <- execute_ con "SET application_name='humming'" case cmd of Create{..} -> do Q.create con when (not cmdNoScheduling) $ S.create con Drop{..} -> do Q.drop con S.drop con Enqueue{..} -> do case parse json (L.pack cmdArguments) of Done _ arguments -> do let q = Q.Queue $ pack cmdQueueName i <- Q.enqueue con q (pack cmdMethod) arguments putStrLn $ "Enqueued job #" ++ show i ++ "." _ -> putStrLn "The argument ain't no valid JSON." Count{..} -> do Q.runCount con (fmap pack cmdMQueueName) >>= putStrLn . show Delete{..} -> do case (cmdMQueueName, cmdMJobId) of (Just _, Just _) -> putStrLn "Only at most one of --queue and --job can be given." (Just queueName, _) -> Q.runDeleteQueue con $ pack queueName (_, Just jobId) -> Q.runDeleteJob con jobId (_, _) -> Q.runDeleteAll con Lock{..} -> do Q.runLock con (pack cmdQueueName) 10 >>= print UnlockDeads{..} -> do Q.unlockJobsOfDeadWorkers con Listen{..} -> do Q.listenNotifications con cmdQueueName Notify{..} -> do Q.sendNotification con cmdQueueName Work{..} -> do w_ <- Q.defaultWorker let w = w_ { Q.workerQueue = Q.Queue (pack cmdQueueName) } if cmdWorkOnce then Q.work con w else Q.start con w Schedule{..} -> do S.schedule con Plan{..} -> do case parse json (L.pack cmdArguments) of Done _ arguments -> do now <- getCurrentTime let at = now .+^ fromSeconds cmdSeconds S.plan con (T.pack cmdQueueName) (T.pack cmdMethod) arguments at _ -> putStrLn "The argument ain't no valid JSON." close con
1,843
runCmd cmd = do con <- connectPostgreSQL . pack $ cmdDatabaseUrl cmd _ <- execute_ con "SET application_name='humming'" case cmd of Create{..} -> do Q.create con when (not cmdNoScheduling) $ S.create con Drop{..} -> do Q.drop con S.drop con Enqueue{..} -> do case parse json (L.pack cmdArguments) of Done _ arguments -> do let q = Q.Queue $ pack cmdQueueName i <- Q.enqueue con q (pack cmdMethod) arguments putStrLn $ "Enqueued job #" ++ show i ++ "." _ -> putStrLn "The argument ain't no valid JSON." Count{..} -> do Q.runCount con (fmap pack cmdMQueueName) >>= putStrLn . show Delete{..} -> do case (cmdMQueueName, cmdMJobId) of (Just _, Just _) -> putStrLn "Only at most one of --queue and --job can be given." (Just queueName, _) -> Q.runDeleteQueue con $ pack queueName (_, Just jobId) -> Q.runDeleteJob con jobId (_, _) -> Q.runDeleteAll con Lock{..} -> do Q.runLock con (pack cmdQueueName) 10 >>= print UnlockDeads{..} -> do Q.unlockJobsOfDeadWorkers con Listen{..} -> do Q.listenNotifications con cmdQueueName Notify{..} -> do Q.sendNotification con cmdQueueName Work{..} -> do w_ <- Q.defaultWorker let w = w_ { Q.workerQueue = Q.Queue (pack cmdQueueName) } if cmdWorkOnce then Q.work con w else Q.start con w Schedule{..} -> do S.schedule con Plan{..} -> do case parse json (L.pack cmdArguments) of Done _ arguments -> do now <- getCurrentTime let at = now .+^ fromSeconds cmdSeconds S.plan con (T.pack cmdQueueName) (T.pack cmdMethod) arguments at _ -> putStrLn "The argument ain't no valid JSON." close con
1,820
true
true
0
21
558
699
325
374
null
null
mrgaaron/tempo-proxy
src/Server.hs
mit
proxy :: Request -> Method -> L.ByteString -> IO (Client.Response, S.ByteString) proxy req method body = do let path = rqURI req c <- Client.openConnection "api.tempo-db.com" 443 q <- Client.buildRequest $ do Client.http (castSnapMethod method) path forM_ (listHeaders req) $ \(k,v) -> do Client.setHeader (original k) v Client.sendRequest c q $ \o -> Streams.write (Just (Builder.fromLazyByteString body)) o (resp, body) <- Client.receiveResponse c streamHandler Client.closeConnection c return (resp, body)
542
proxy :: Request -> Method -> L.ByteString -> IO (Client.Response, S.ByteString) proxy req method body = do let path = rqURI req c <- Client.openConnection "api.tempo-db.com" 443 q <- Client.buildRequest $ do Client.http (castSnapMethod method) path forM_ (listHeaders req) $ \(k,v) -> do Client.setHeader (original k) v Client.sendRequest c q $ \o -> Streams.write (Just (Builder.fromLazyByteString body)) o (resp, body) <- Client.receiveResponse c streamHandler Client.closeConnection c return (resp, body)
542
proxy req method body = do let path = rqURI req c <- Client.openConnection "api.tempo-db.com" 443 q <- Client.buildRequest $ do Client.http (castSnapMethod method) path forM_ (listHeaders req) $ \(k,v) -> do Client.setHeader (original k) v Client.sendRequest c q $ \o -> Streams.write (Just (Builder.fromLazyByteString body)) o (resp, body) <- Client.receiveResponse c streamHandler Client.closeConnection c return (resp, body)
461
false
true
0
17
102
223
106
117
null
null
pparkkin/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
primOpCanFail ReadOffAddrOp_Int = True
38
primOpCanFail ReadOffAddrOp_Int = True
38
primOpCanFail ReadOffAddrOp_Int = True
38
false
false
0
5
3
9
4
5
null
null
contivero/hasmin
src/Hasmin/Types/Declaration.hs
bsd-3-clause
-- Map of property specific reducers, for properties that don't fit in the -- normal declaration minification scheme and need special treatment. declarationExceptions :: Map Text (Declaration -> Values -> Inheritance -> Declaration) declarationExceptions = Map.fromList $ map (first T.toCaseFold) [("background-size", backgroundSizeReduce) ,("-webkit-background-size", backgroundSizeReduce) ,("border-bottom-left-radius", reduceDefaultingToFirst) ,("border-bottom-right-radius", reduceDefaultingToFirst) ,("border-top-left-radius", reduceDefaultingToFirst) ,("border-top-right-radius", reduceDefaultingToFirst) ,("font-synthesis", reduceTwoKeywordInitial) ,("overflow", reduceDefaultingToFirst) ,("overscroll-behavior", reduceDefaultingToFirst) ,("text-emphasis-position", reduceTwoKeywordInitial) -- Needed because otherwise the reducer replaces commas by spaces. -- i.e. text-shadow: 1px 1px red,2px 2px blue ==> -- text-shadow: 1px 1px red 2px 2px blue. ,("text-shadow", \d _ _ -> d) ] where -- For properties that take two keywords as initial value, such as: -- * font-synthesis: weight style -- * text-emphasis-position: right over reduceTwoKeywordInitial :: Declaration -> Values -> Inheritance -> Declaration reduceTwoKeywordInitial d@(Declaration _ vs _ _) initVals inhs = case valuesToList initVals \\ valuesToList vs of [] -> d {valueList = shortestEquiv initial initVals inhs} _ -> d {valueList = shortestEquiv vs initVals inhs} -- For properties whose second value, if omitted, is copied from the first -- (for instance 'overflow'). reduceDefaultingToFirst :: Declaration -> Values -> Inheritance -> Declaration reduceDefaultingToFirst d@(Declaration _ vs _ _) initVals inhs = case valuesToList vs of [v1,v2] -> if v1 == v2 then reduceDeclaration (d { valueList = mkValues [v1] }) initVals inhs else d _ -> reduceDeclaration d initVals inhs backgroundSizeReduce :: Declaration -> Values -> Inheritance -> Declaration backgroundSizeReduce d@(Declaration _ vs _ _) initVals inhs = case valuesToList vs of [v1,v2] -> if v2 == mkOther "auto" then d { valueList = mkValues [v1] } else d _ -> d { valueList = shortestEquiv vs initVals inhs }
2,528
declarationExceptions :: Map Text (Declaration -> Values -> Inheritance -> Declaration) declarationExceptions = Map.fromList $ map (first T.toCaseFold) [("background-size", backgroundSizeReduce) ,("-webkit-background-size", backgroundSizeReduce) ,("border-bottom-left-radius", reduceDefaultingToFirst) ,("border-bottom-right-radius", reduceDefaultingToFirst) ,("border-top-left-radius", reduceDefaultingToFirst) ,("border-top-right-radius", reduceDefaultingToFirst) ,("font-synthesis", reduceTwoKeywordInitial) ,("overflow", reduceDefaultingToFirst) ,("overscroll-behavior", reduceDefaultingToFirst) ,("text-emphasis-position", reduceTwoKeywordInitial) -- Needed because otherwise the reducer replaces commas by spaces. -- i.e. text-shadow: 1px 1px red,2px 2px blue ==> -- text-shadow: 1px 1px red 2px 2px blue. ,("text-shadow", \d _ _ -> d) ] where -- For properties that take two keywords as initial value, such as: -- * font-synthesis: weight style -- * text-emphasis-position: right over reduceTwoKeywordInitial :: Declaration -> Values -> Inheritance -> Declaration reduceTwoKeywordInitial d@(Declaration _ vs _ _) initVals inhs = case valuesToList initVals \\ valuesToList vs of [] -> d {valueList = shortestEquiv initial initVals inhs} _ -> d {valueList = shortestEquiv vs initVals inhs} -- For properties whose second value, if omitted, is copied from the first -- (for instance 'overflow'). reduceDefaultingToFirst :: Declaration -> Values -> Inheritance -> Declaration reduceDefaultingToFirst d@(Declaration _ vs _ _) initVals inhs = case valuesToList vs of [v1,v2] -> if v1 == v2 then reduceDeclaration (d { valueList = mkValues [v1] }) initVals inhs else d _ -> reduceDeclaration d initVals inhs backgroundSizeReduce :: Declaration -> Values -> Inheritance -> Declaration backgroundSizeReduce d@(Declaration _ vs _ _) initVals inhs = case valuesToList vs of [v1,v2] -> if v2 == mkOther "auto" then d { valueList = mkValues [v1] } else d _ -> d { valueList = shortestEquiv vs initVals inhs }
2,383
declarationExceptions = Map.fromList $ map (first T.toCaseFold) [("background-size", backgroundSizeReduce) ,("-webkit-background-size", backgroundSizeReduce) ,("border-bottom-left-radius", reduceDefaultingToFirst) ,("border-bottom-right-radius", reduceDefaultingToFirst) ,("border-top-left-radius", reduceDefaultingToFirst) ,("border-top-right-radius", reduceDefaultingToFirst) ,("font-synthesis", reduceTwoKeywordInitial) ,("overflow", reduceDefaultingToFirst) ,("overscroll-behavior", reduceDefaultingToFirst) ,("text-emphasis-position", reduceTwoKeywordInitial) -- Needed because otherwise the reducer replaces commas by spaces. -- i.e. text-shadow: 1px 1px red,2px 2px blue ==> -- text-shadow: 1px 1px red 2px 2px blue. ,("text-shadow", \d _ _ -> d) ] where -- For properties that take two keywords as initial value, such as: -- * font-synthesis: weight style -- * text-emphasis-position: right over reduceTwoKeywordInitial :: Declaration -> Values -> Inheritance -> Declaration reduceTwoKeywordInitial d@(Declaration _ vs _ _) initVals inhs = case valuesToList initVals \\ valuesToList vs of [] -> d {valueList = shortestEquiv initial initVals inhs} _ -> d {valueList = shortestEquiv vs initVals inhs} -- For properties whose second value, if omitted, is copied from the first -- (for instance 'overflow'). reduceDefaultingToFirst :: Declaration -> Values -> Inheritance -> Declaration reduceDefaultingToFirst d@(Declaration _ vs _ _) initVals inhs = case valuesToList vs of [v1,v2] -> if v1 == v2 then reduceDeclaration (d { valueList = mkValues [v1] }) initVals inhs else d _ -> reduceDeclaration d initVals inhs backgroundSizeReduce :: Declaration -> Values -> Inheritance -> Declaration backgroundSizeReduce d@(Declaration _ vs _ _) initVals inhs = case valuesToList vs of [v1,v2] -> if v2 == mkOther "auto" then d { valueList = mkValues [v1] } else d _ -> d { valueList = shortestEquiv vs initVals inhs }
2,295
true
true
0
14
654
499
278
221
null
null
mdsteele/fallback
src/Fallback/Scenario/Script/Other.hs
gpl-3.0
getHitTargetHeadPos (HitPosition pos) = return pos
50
getHitTargetHeadPos (HitPosition pos) = return pos
50
getHitTargetHeadPos (HitPosition pos) = return pos
50
false
false
0
7
5
18
8
10
null
null
erikd/yesod
yesod-core/Yesod/Core/Class/Yesod.hs
mit
envClientSessionBackend :: Int -- ^ minutes -> String -- ^ environment variable name -> IO SessionBackend envClientSessionBackend minutes name = do key <- CS.getKeyEnv name (getCachedDate, _closeDateCacher) <- clientSessionDateCacher $ minToSec minutes return $ clientSessionBackend key getCachedDate
360
envClientSessionBackend :: Int -- ^ minutes -> String -- ^ environment variable name -> IO SessionBackend envClientSessionBackend minutes name = do key <- CS.getKeyEnv name (getCachedDate, _closeDateCacher) <- clientSessionDateCacher $ minToSec minutes return $ clientSessionBackend key getCachedDate
360
envClientSessionBackend minutes name = do key <- CS.getKeyEnv name (getCachedDate, _closeDateCacher) <- clientSessionDateCacher $ minToSec minutes return $ clientSessionBackend key getCachedDate
206
false
true
0
9
96
73
35
38
null
null
beni55/hdbc-postgresql
Database/HDBC/PostgreSQL/ErrorCodes.hs
bsd-3-clause
-- |Is set to @\"0P000\"@. invalidRoleSpecification :: String invalidRoleSpecification = "0P000"
96
invalidRoleSpecification :: String invalidRoleSpecification = "0P000"
69
invalidRoleSpecification = "0P000"
34
true
true
0
4
10
12
7
5
null
null
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
mpl-2.0
-- | The code [ISO 3166-1 -- alpha-2](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1_alpha-2) of the -- country for which review is to be requested. rrsarRegionCode :: Lens' RequestReviewShoppingAdsRequest (Maybe Text) rrsarRegionCode = lens _rrsarRegionCode (\ s a -> s{_rrsarRegionCode = a})
299
rrsarRegionCode :: Lens' RequestReviewShoppingAdsRequest (Maybe Text) rrsarRegionCode = lens _rrsarRegionCode (\ s a -> s{_rrsarRegionCode = a})
152
rrsarRegionCode = lens _rrsarRegionCode (\ s a -> s{_rrsarRegionCode = a})
82
true
true
0
9
43
50
27
23
null
null
foreverbell/project-euler-solutions
lib/Common/Matrix/Matrix.hs
bsd-3-clause
encode m (i, j) = (i - 1) * m + j - 1
37
encode m (i, j) = (i - 1) * m + j - 1
37
encode m (i, j) = (i - 1) * m + j - 1
37
false
false
0
9
13
38
19
19
null
null
alanz/Hs2010To201x
src/Transform.hs
bsd-3-clause
doRefact :: FilePath -> RefactGhc [ApplyRefacResult] doRefact absFileName = do (r,_) <- applyRefac (comp absFileName ) (RSFile absFileName) return [r]
154
doRefact :: FilePath -> RefactGhc [ApplyRefacResult] doRefact absFileName = do (r,_) <- applyRefac (comp absFileName ) (RSFile absFileName) return [r]
154
doRefact absFileName = do (r,_) <- applyRefac (comp absFileName ) (RSFile absFileName) return [r]
101
false
true
0
10
23
63
31
32
null
null
pauloborba/plc
src/ExistentialTypes.hs
cc0-1.0
termo3 = (Seq (Atr "y" termo2) termo2)
38
termo3 = (Seq (Atr "y" termo2) termo2)
38
termo3 = (Seq (Atr "y" termo2) termo2)
38
false
false
1
8
6
25
11
14
null
null
ombocomp/listsafe
Data/List/Safe.hs
apache-2.0
-- |'minimum' returns the maximum value from a list, which must be non-empty, -- finite, and of an ordered type. It is a special case of 'minimumBy', which -- allows the programmer to supply their own comparison function. -- Empty lists throw an 'EmptyListException'. minimum :: (MonadThrow m, Ord a) => [a] -> m a minimum = wrap L.minimum
342
minimum :: (MonadThrow m, Ord a) => [a] -> m a minimum = wrap L.minimum
71
minimum = wrap L.minimum
24
true
true
0
8
61
51
26
25
null
null
paulbarbu/haskell-ground
htol.hs
apache-2.0
optimalPath :: RoadSystem -> (Path, Int) optimalPath roadSystem = if costA < costB then (reverse pathA, costA) else (reverse pathB, costB) where (pathA, pathB, costA, costB) = foldl (flip roadStep) ([],[], 0, 0) roadSystem
228
optimalPath :: RoadSystem -> (Path, Int) optimalPath roadSystem = if costA < costB then (reverse pathA, costA) else (reverse pathB, costB) where (pathA, pathB, costA, costB) = foldl (flip roadStep) ([],[], 0, 0) roadSystem
228
optimalPath roadSystem = if costA < costB then (reverse pathA, costA) else (reverse pathB, costB) where (pathA, pathB, costA, costB) = foldl (flip roadStep) ([],[], 0, 0) roadSystem
187
false
true
0
7
39
104
58
46
null
null
ghcjs/ghcjs
utils/pkg-cache/ghc/includes/dist-derivedconstants/header/GHCConstantsHaskellWrappers.hs
mit
oFFSET_StgTSO_stackobj :: DynFlags -> Int oFFSET_StgTSO_stackobj dflags = pc_OFFSET_StgTSO_stackobj (platformConstants dflags)
126
oFFSET_StgTSO_stackobj :: DynFlags -> Int oFFSET_StgTSO_stackobj dflags = pc_OFFSET_StgTSO_stackobj (platformConstants dflags)
126
oFFSET_StgTSO_stackobj dflags = pc_OFFSET_StgTSO_stackobj (platformConstants dflags)
84
false
true
0
7
10
30
14
16
null
null
brianshourd/adventOfCode2016
src/Day17.hs
mit
day17' :: String -> Int day17' = pathLength . findLongestPath
61
day17' :: String -> Int day17' = pathLength . findLongestPath
61
day17' = pathLength . findLongestPath
37
false
true
0
7
9
26
11
15
null
null
kelnage/tamarin-prover
lib/term/src/Term/Rewriting/Norm.hs
gpl-3.0
---------------------------------------------------------------------- -- Normal-form check using Maude and Haskell ---------------------------------------------------------------------- -- | @nfViaHaskell t@ returns @True@ if the term @t@ is in normal form. nfViaHaskell :: LNTerm -> WithMaude Bool nfViaHaskell t0 = reader $ \hnd -> check hnd where check hnd = go t0 where go t = case viewTerm2 t of -- irreducible function symbols FAppNoEq o ts | (NoEq o) `S.member` irreducible -> all go ts FList ts -> all go ts FPair t1 t2 -> go t1 && go t2 FDiff t1 t2 -> go t1 && go t2 One -> True Lit2 _ -> True -- subterm rules FAppNoEq _ _ | setAny (struleApplicable t) strules -> False -- exponentiation FExp (viewTerm2 -> FExp _ _) _ -> False FExp _ (viewTerm2 -> One) -> False -- inverses FInv (viewTerm2 -> FInv _) -> False FInv (viewTerm2 -> FMult ts) | any isInverse ts -> False FInv (viewTerm2 -> One) -> False -- multiplication FMult ts | fAppOne `elem` ts || any isProduct ts || invalidMult ts -> False -- point multiplication FPMult _ (viewTerm2 -> FPMult _ _) -> False FPMult (viewTerm2 -> One) _ -> False -- bilinear map FEMap _ (viewTerm2 -> FPMult _ _) -> False FEMap (viewTerm2 -> FPMult _ _) _ -> False -- topmost position not reducible, check subterms FExp t1 t2 -> go t1 && go t2 FPMult t1 t2 -> go t1 && go t2 FEMap t1 t2 -> go t1 && go t2 FInv t1 -> go t1 FMult ts -> all go ts FUnion ts -> all go ts FAppNoEq _ ts -> all go ts FAppC _ ts -> all go ts struleApplicable t (CtxtStRule lhs rhs) = case solveMatchLNTerm (t `matchWith` lhs) `runReader` hnd of [] -> False _:_ -> case rhs of StRhs [] s -> not (t == s) -- reducible, but RHS might be already equal to t StRhs _ _ -> True invalidMult ts = case partition isInverse ts of ([],_) -> False ([ viewTerm2 -> FInv (viewTerm2 -> FMult ifactors) ], factors) -> (ifactors \\ factors /= ifactors) || (factors \\ ifactors /= factors) ([ viewTerm2 -> FInv t ], factors) -> t `elem` factors (_:_:_, _) -> True _ -> False msig = mhMaudeSig hnd strules = stRules msig irreducible = irreducibleFunSyms msig -- | @nf' t@ returns @True@ if the term @t@ is in normal form.
3,222
nfViaHaskell :: LNTerm -> WithMaude Bool nfViaHaskell t0 = reader $ \hnd -> check hnd where check hnd = go t0 where go t = case viewTerm2 t of -- irreducible function symbols FAppNoEq o ts | (NoEq o) `S.member` irreducible -> all go ts FList ts -> all go ts FPair t1 t2 -> go t1 && go t2 FDiff t1 t2 -> go t1 && go t2 One -> True Lit2 _ -> True -- subterm rules FAppNoEq _ _ | setAny (struleApplicable t) strules -> False -- exponentiation FExp (viewTerm2 -> FExp _ _) _ -> False FExp _ (viewTerm2 -> One) -> False -- inverses FInv (viewTerm2 -> FInv _) -> False FInv (viewTerm2 -> FMult ts) | any isInverse ts -> False FInv (viewTerm2 -> One) -> False -- multiplication FMult ts | fAppOne `elem` ts || any isProduct ts || invalidMult ts -> False -- point multiplication FPMult _ (viewTerm2 -> FPMult _ _) -> False FPMult (viewTerm2 -> One) _ -> False -- bilinear map FEMap _ (viewTerm2 -> FPMult _ _) -> False FEMap (viewTerm2 -> FPMult _ _) _ -> False -- topmost position not reducible, check subterms FExp t1 t2 -> go t1 && go t2 FPMult t1 t2 -> go t1 && go t2 FEMap t1 t2 -> go t1 && go t2 FInv t1 -> go t1 FMult ts -> all go ts FUnion ts -> all go ts FAppNoEq _ ts -> all go ts FAppC _ ts -> all go ts struleApplicable t (CtxtStRule lhs rhs) = case solveMatchLNTerm (t `matchWith` lhs) `runReader` hnd of [] -> False _:_ -> case rhs of StRhs [] s -> not (t == s) -- reducible, but RHS might be already equal to t StRhs _ _ -> True invalidMult ts = case partition isInverse ts of ([],_) -> False ([ viewTerm2 -> FInv (viewTerm2 -> FMult ifactors) ], factors) -> (ifactors \\ factors /= ifactors) || (factors \\ ifactors /= factors) ([ viewTerm2 -> FInv t ], factors) -> t `elem` factors (_:_:_, _) -> True _ -> False msig = mhMaudeSig hnd strules = stRules msig irreducible = irreducibleFunSyms msig -- | @nf' t@ returns @True@ if the term @t@ is in normal form.
2,962
nfViaHaskell t0 = reader $ \hnd -> check hnd where check hnd = go t0 where go t = case viewTerm2 t of -- irreducible function symbols FAppNoEq o ts | (NoEq o) `S.member` irreducible -> all go ts FList ts -> all go ts FPair t1 t2 -> go t1 && go t2 FDiff t1 t2 -> go t1 && go t2 One -> True Lit2 _ -> True -- subterm rules FAppNoEq _ _ | setAny (struleApplicable t) strules -> False -- exponentiation FExp (viewTerm2 -> FExp _ _) _ -> False FExp _ (viewTerm2 -> One) -> False -- inverses FInv (viewTerm2 -> FInv _) -> False FInv (viewTerm2 -> FMult ts) | any isInverse ts -> False FInv (viewTerm2 -> One) -> False -- multiplication FMult ts | fAppOne `elem` ts || any isProduct ts || invalidMult ts -> False -- point multiplication FPMult _ (viewTerm2 -> FPMult _ _) -> False FPMult (viewTerm2 -> One) _ -> False -- bilinear map FEMap _ (viewTerm2 -> FPMult _ _) -> False FEMap (viewTerm2 -> FPMult _ _) _ -> False -- topmost position not reducible, check subterms FExp t1 t2 -> go t1 && go t2 FPMult t1 t2 -> go t1 && go t2 FEMap t1 t2 -> go t1 && go t2 FInv t1 -> go t1 FMult ts -> all go ts FUnion ts -> all go ts FAppNoEq _ ts -> all go ts FAppC _ ts -> all go ts struleApplicable t (CtxtStRule lhs rhs) = case solveMatchLNTerm (t `matchWith` lhs) `runReader` hnd of [] -> False _:_ -> case rhs of StRhs [] s -> not (t == s) -- reducible, but RHS might be already equal to t StRhs _ _ -> True invalidMult ts = case partition isInverse ts of ([],_) -> False ([ viewTerm2 -> FInv (viewTerm2 -> FMult ifactors) ], factors) -> (ifactors \\ factors /= ifactors) || (factors \\ ifactors /= factors) ([ viewTerm2 -> FInv t ], factors) -> t `elem` factors (_:_:_, _) -> True _ -> False msig = mhMaudeSig hnd strules = stRules msig irreducible = irreducibleFunSyms msig -- | @nf' t@ returns @True@ if the term @t@ is in normal form.
2,921
true
true
0
16
1,496
841
409
432
null
null
gridaphobe/ghc
compiler/main/HscTypes.hs
bsd-3-clause
-- | Is this a bytecode linkable with no file on disk? isInterpretable :: Unlinked -> Bool isInterpretable = not . isObject
123
isInterpretable :: Unlinked -> Bool isInterpretable = not . isObject
68
isInterpretable = not . isObject
32
true
true
1
7
21
28
12
16
null
null
mhuesch/scheme_compiler
src/Liveness/Liveness.hs
bsd-3-clause
gen (IArith w1 _ t) = case t of (Tx (Xw w2)) -> liveSet [w1,w2] _ -> liveSet [w1] --
92
gen (IArith w1 _ t) = case t of (Tx (Xw w2)) -> liveSet [w1,w2] _ -> liveSet [w1] --
92
gen (IArith w1 _ t) = case t of (Tx (Xw w2)) -> liveSet [w1,w2] _ -> liveSet [w1] --
92
false
false
2
8
27
65
32
33
null
null
beni55/hermit
src/HERMIT/Dictionary/Reasoning.hs
bsd-2-clause
trueImpliesR :: Monad m => Rewrite c m Clause trueImpliesR = do Impl _ CTrue cl <- idR return cl
104
trueImpliesR :: Monad m => Rewrite c m Clause trueImpliesR = do Impl _ CTrue cl <- idR return cl
104
trueImpliesR = do Impl _ CTrue cl <- idR return cl
58
false
true
0
9
27
51
21
30
null
null
asivitz/Hickory
Hickory/Graphics/DirectXModel.hs
mit
faceNumForFaceIdx :: Int -> Int faceNumForFaceIdx x = floor $ (realToFrac x :: Double) / 3
90
faceNumForFaceIdx :: Int -> Int faceNumForFaceIdx x = floor $ (realToFrac x :: Double) / 3
90
faceNumForFaceIdx x = floor $ (realToFrac x :: Double) / 3
58
false
true
2
7
15
42
19
23
null
null
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Scene/Node.hs
mit
nodeGetWorldUp :: (Parent Node a, Pointer p a, MonadIO m) => p -- ^ Node pointer or pointer to ascentor -> m Vector3 nodeGetWorldUp p = liftIO $ do let ptr = parentPointer p pvec <- [C.exp| Vector3* {new Vector3($(Node* ptr)->GetWorldUp())} |] v <- peek pvec [C.exp| void { delete $(Vector3* pvec) } |] return v -- | Return node's right vector in world space.
374
nodeGetWorldUp :: (Parent Node a, Pointer p a, MonadIO m) => p -- ^ Node pointer or pointer to ascentor -> m Vector3 nodeGetWorldUp p = liftIO $ do let ptr = parentPointer p pvec <- [C.exp| Vector3* {new Vector3($(Node* ptr)->GetWorldUp())} |] v <- peek pvec [C.exp| void { delete $(Vector3* pvec) } |] return v -- | Return node's right vector in world space.
374
nodeGetWorldUp p = liftIO $ do let ptr = parentPointer p pvec <- [C.exp| Vector3* {new Vector3($(Node* ptr)->GetWorldUp())} |] v <- peek pvec [C.exp| void { delete $(Vector3* pvec) } |] return v -- | Return node's right vector in world space.
253
false
true
2
11
79
108
53
55
null
null
pikajude/yesod
yesod-core/test/YesodCoreTest/ErrorHandling.hs
mit
caseErrorInBodyNoEval :: IO () caseErrorInBodyNoEval = do eres <- try $ runner $ do request defaultRequest { pathInfo = ["error-in-body-noeval"] } case eres of Left (_ :: SomeException) -> return () Right x -> error $ "Expected an exception, got: " ++ show x
290
caseErrorInBodyNoEval :: IO () caseErrorInBodyNoEval = do eres <- try $ runner $ do request defaultRequest { pathInfo = ["error-in-body-noeval"] } case eres of Left (_ :: SomeException) -> return () Right x -> error $ "Expected an exception, got: " ++ show x
290
caseErrorInBodyNoEval = do eres <- try $ runner $ do request defaultRequest { pathInfo = ["error-in-body-noeval"] } case eres of Left (_ :: SomeException) -> return () Right x -> error $ "Expected an exception, got: " ++ show x
259
false
true
0
14
75
96
46
50
null
null
romanb/aws
Aws/S3/Core.hs
bsd-3-clause
writeCannedAcl AclBucketOwnerFullControl = "bucket-owner-full-control"
70
writeCannedAcl AclBucketOwnerFullControl = "bucket-owner-full-control"
70
writeCannedAcl AclBucketOwnerFullControl = "bucket-owner-full-control"
70
false
false
0
5
3
9
4
5
null
null
NCrashed/servant-auth-token
servant-auth-token-leveldb/src/Servant/Server/Auth/Token/LevelDB/Schema.hs
bsd-3-clause
load :: (MonadResource m, Key i a, SafeCopy a) => LevelDBEnv -> i -> m (Maybe a) load (LevelDBEnv db ropts _ _) i = do mbs <- get db ropts (encodeKey i) return $ join $ either (const Nothing) Just . runGet safeGet <$> mbs -- | Store object by id in leveldb
261
load :: (MonadResource m, Key i a, SafeCopy a) => LevelDBEnv -> i -> m (Maybe a) load (LevelDBEnv db ropts _ _) i = do mbs <- get db ropts (encodeKey i) return $ join $ either (const Nothing) Just . runGet safeGet <$> mbs -- | Store object by id in leveldb
261
load (LevelDBEnv db ropts _ _) i = do mbs <- get db ropts (encodeKey i) return $ join $ either (const Nothing) Just . runGet safeGet <$> mbs -- | Store object by id in leveldb
180
false
true
0
12
58
122
59
63
null
null
tangboyun/miranda
src/MiRanda/Score.hs
gpl-3.0
calcPct bl (b0,b1,b2,b3) = max 0 $ b0 + b1 / ( 1 + exp (negate b2 * bl + b3))
77
calcPct bl (b0,b1,b2,b3) = max 0 $ b0 + b1 / ( 1 + exp (negate b2 * bl + b3))
77
calcPct bl (b0,b1,b2,b3) = max 0 $ b0 + b1 / ( 1 + exp (negate b2 * bl + b3))
77
false
false
0
12
20
63
32
31
null
null
nbloomf/carl
src/Carl/Struct/Matrix.hs
gpl-3.0
{--------------} {- :Structure -} {--------------} mRowOf :: Integer -> Matrix a -> Either AlgErr (Matrix a) i `mRowOf` m = do p <- i `mIsRowIndexOf` m (r,c) <- mDim m if not p then Left (InvalidRowIndex $ show i ++ show (r,c)) else do let foo (h,k) = (h+i-1,k) `mEntryOf` m mFromMapM (1,c) foo
321
mRowOf :: Integer -> Matrix a -> Either AlgErr (Matrix a) i `mRowOf` m = do p <- i `mIsRowIndexOf` m (r,c) <- mDim m if not p then Left (InvalidRowIndex $ show i ++ show (r,c)) else do let foo (h,k) = (h+i-1,k) `mEntryOf` m mFromMapM (1,c) foo
269
i `mRowOf` m = do p <- i `mIsRowIndexOf` m (r,c) <- mDim m if not p then Left (InvalidRowIndex $ show i ++ show (r,c)) else do let foo (h,k) = (h+i-1,k) `mEntryOf` m mFromMapM (1,c) foo
211
true
true
0
17
80
169
87
82
null
null
AndrewRademacher/wai
warp/Network/Wai/Handler/Warp/HTTP2.hs
mit
goaway :: Connection -> ErrorCodeId -> ByteString -> IO () goaway Connection{..} etype debugmsg = connSendAll bytestream where bytestream = goawayFrame 0 etype debugmsg
174
goaway :: Connection -> ErrorCodeId -> ByteString -> IO () goaway Connection{..} etype debugmsg = connSendAll bytestream where bytestream = goawayFrame 0 etype debugmsg
174
goaway Connection{..} etype debugmsg = connSendAll bytestream where bytestream = goawayFrame 0 etype debugmsg
115
false
true
0
9
29
59
28
31
null
null
FranklinChen/maam
src/FP/Pretty.hs
bsd-3-clause
setFG :: Color256 -> Format setFG fg = null { foreground = Just fg }
68
setFG :: Color256 -> Format setFG fg = null { foreground = Just fg }
68
setFG fg = null { foreground = Just fg }
40
false
true
0
8
14
38
17
21
null
null
bkoropoff/Idris-dev
src/Idris/IBC.hs
bsd-3-clause
pDocs :: [(Name, (Docstring D.DocTerm, [(Name, Docstring D.DocTerm)]))] -> Idris () pDocs ds = mapM_ (\(n, a) -> addDocStr n (fst a) (snd a)) ds
144
pDocs :: [(Name, (Docstring D.DocTerm, [(Name, Docstring D.DocTerm)]))] -> Idris () pDocs ds = mapM_ (\(n, a) -> addDocStr n (fst a) (snd a)) ds
144
pDocs ds = mapM_ (\(n, a) -> addDocStr n (fst a) (snd a)) ds
60
false
true
3
11
24
100
51
49
null
null
sharkspeed/dororis
languages/haskell/LYHGG/7-modules/0-load-modules.hs
bsd-2-clause
numUniques :: (Eq a) => [a] -> Int numUniques = length . nub
60
numUniques :: (Eq a) => [a] -> Int numUniques = length . nub
60
numUniques = length . nub
25
false
true
0
7
12
31
17
14
null
null
GaloisInc/orc
src/Orc/Combinators.hs
bsd-3-clause
-------------------------------------------------------------------------- -- | Analogous to the list scan function, but the order in which -- the combining function is applied to the results produced by -- @p@ is nondeterministic. scan :: (a -> s -> s) -> s -> Orc a -> Orc s scan f s p = do accum <- newTVar s x <- p (_w,w') <- modifyTVar accum (f x) return w' -- | A variant of '<+>', pronounced or-else, which performs and returns -- the results of @p@, and if @p@ produced no answers go on and performa -- dn return the results of @q@.
551
scan :: (a -> s -> s) -> s -> Orc a -> Orc s scan f s p = do accum <- newTVar s x <- p (_w,w') <- modifyTVar accum (f x) return w' -- | A variant of '<+>', pronounced or-else, which performs and returns -- the results of @p@, and if @p@ produced no answers go on and performa -- dn return the results of @q@.
317
scan f s p = do accum <- newTVar s x <- p (_w,w') <- modifyTVar accum (f x) return w' -- | A variant of '<+>', pronounced or-else, which performs and returns -- the results of @p@, and if @p@ produced no answers go on and performa -- dn return the results of @q@.
272
true
true
0
10
109
105
52
53
null
null
literate-unitb/literate-unitb
src/Document/Tests/GarbageCollector.hs
mit
test_case :: TestCase test_case = test_cases "Garbage collector" [ poCase "test0: verify m0" case0 result0 , poCase "test1: verify m1" case1 result1 , poCase "test2: verify m2" case2 result2 , stringCase "test3: monotonic simplification" case3 result3 , stringCase "test4: monotonicity of POs" case4 result4 , stringCase "test5: monotonicity in relation theory" case5 result5 , stringCase "test6: monotonicity of POs" case6 result6 , stringCase "test7: POs, step 3 (monotonicity, associativity)" case7 result7 , stringCase "test8: POs, step 4 (monotonicity, associativity)" case8 result8 ]
641
test_case :: TestCase test_case = test_cases "Garbage collector" [ poCase "test0: verify m0" case0 result0 , poCase "test1: verify m1" case1 result1 , poCase "test2: verify m2" case2 result2 , stringCase "test3: monotonic simplification" case3 result3 , stringCase "test4: monotonicity of POs" case4 result4 , stringCase "test5: monotonicity in relation theory" case5 result5 , stringCase "test6: monotonicity of POs" case6 result6 , stringCase "test7: POs, step 3 (monotonicity, associativity)" case7 result7 , stringCase "test8: POs, step 4 (monotonicity, associativity)" case8 result8 ]
641
test_case = test_cases "Garbage collector" [ poCase "test0: verify m0" case0 result0 , poCase "test1: verify m1" case1 result1 , poCase "test2: verify m2" case2 result2 , stringCase "test3: monotonic simplification" case3 result3 , stringCase "test4: monotonicity of POs" case4 result4 , stringCase "test5: monotonicity in relation theory" case5 result5 , stringCase "test6: monotonicity of POs" case6 result6 , stringCase "test7: POs, step 3 (monotonicity, associativity)" case7 result7 , stringCase "test8: POs, step 4 (monotonicity, associativity)" case8 result8 ]
619
false
true
0
6
133
107
53
54
null
null
SKA-ScienceDataProcessor/RC
MS6/programs/continuum.hs
apache-2.0
splitModel :: Flow Cleaned -> Flow Image splitModel = flow "model from cleaning"
80
splitModel :: Flow Cleaned -> Flow Image splitModel = flow "model from cleaning"
80
splitModel = flow "model from cleaning"
39
false
true
0
6
12
24
11
13
null
null
KommuSoft/dep-software
Dep.Ui.Utils.hs
gpl-3.0
flatImg :: (b -> Bool) -> [(a,[[b]])] -> [[(a,b)]] flatImg f = genericFlatImage fc where fc (ab@(_,bi):_:_) | f bi = ab fc (_:ab@(_:_)) = fc ab fc (ab:_) = ab fc [] = error "Cannot work on empty list"
234
flatImg :: (b -> Bool) -> [(a,[[b]])] -> [[(a,b)]] flatImg f = genericFlatImage fc where fc (ab@(_,bi):_:_) | f bi = ab fc (_:ab@(_:_)) = fc ab fc (ab:_) = ab fc [] = error "Cannot work on empty list"
234
flatImg f = genericFlatImage fc where fc (ab@(_,bi):_:_) | f bi = ab fc (_:ab@(_:_)) = fc ab fc (ab:_) = ab fc [] = error "Cannot work on empty list"
183
false
true
3
12
73
155
83
72
null
null
ullet/exercism
haskell/bob/bob.hs
mit
shout :: String -> Bool shout chars = any isAlpha chars && all (not . isLower) chars
84
shout :: String -> Bool shout chars = any isAlpha chars && all (not . isLower) chars
84
shout chars = any isAlpha chars && all (not . isLower) chars
60
false
true
0
8
16
39
19
20
null
null
markus1189/xmonad-contrib-710
XMonad/Util/EZConfig.hs
bsd-3-clause
-- | Like 'removeKeys', but for mouse bindings. removeMouseBindings :: XConfig a -> [(ButtonMask, Button)] -> XConfig a removeMouseBindings conf mouseBindingList = conf { mouseBindings = \cnf -> mouseBindings conf cnf `M.difference` M.fromList (zip mouseBindingList $ repeat ()) }
319
removeMouseBindings :: XConfig a -> [(ButtonMask, Button)] -> XConfig a removeMouseBindings conf mouseBindingList = conf { mouseBindings = \cnf -> mouseBindings conf cnf `M.difference` M.fromList (zip mouseBindingList $ repeat ()) }
271
removeMouseBindings conf mouseBindingList = conf { mouseBindings = \cnf -> mouseBindings conf cnf `M.difference` M.fromList (zip mouseBindingList $ repeat ()) }
199
true
true
0
13
77
86
45
41
null
null
sproctor/dirtywater
src/UserConnection.hs
gpl-2.0
getCommand :: UserConnection -> STM (Maybe Command) getCommand uconn = tryReadTBQueue (userCommandQueue uconn)
110
getCommand :: UserConnection -> STM (Maybe Command) getCommand uconn = tryReadTBQueue (userCommandQueue uconn)
110
getCommand uconn = tryReadTBQueue (userCommandQueue uconn)
58
false
true
0
8
12
36
17
19
null
null
ivan-m/structured-haskell-mode
src/Main.hs
bsd-3-clause
readExtension :: String -> Maybe Extension readExtension x = case classifyExtension x of UnknownExtension _ -> Nothing x' -> Just x' -- | Default extensions.
168
readExtension :: String -> Maybe Extension readExtension x = case classifyExtension x of UnknownExtension _ -> Nothing x' -> Just x' -- | Default extensions.
168
readExtension x = case classifyExtension x of UnknownExtension _ -> Nothing x' -> Just x' -- | Default extensions.
125
false
true
0
8
35
51
23
28
null
null
keithodulaigh/Hets
CASL/Sign.hs
gpl-2.0
addSymbol :: Symbol -> State.State (Sign f e) () addSymbol s = do e <- State.get State.put $ addSymbToDeclSymbs e s
119
addSymbol :: Symbol -> State.State (Sign f e) () addSymbol s = do e <- State.get State.put $ addSymbToDeclSymbs e s
119
addSymbol s = do e <- State.get State.put $ addSymbToDeclSymbs e s
70
false
true
0
8
24
58
27
31
null
null
surajx/learn-haskell
crash.hs
mit
len' acc (_:xs) = len' (acc+1) xs
33
len' acc (_:xs) = len' (acc+1) xs
33
len' acc (_:xs) = len' (acc+1) xs
33
false
false
0
7
6
33
15
18
null
null
Javran/twitter-conduit
Web/Twitter/Conduit/ParametersDeprecated.hs
bsd-2-clause
contributorDetails :: (Parameters p, HasParam "contributor_details" Bool (SupportParameters p)) => Lens' p (Maybe Bool) contributorDetails = rawParam "contributor_details"
171
contributorDetails :: (Parameters p, HasParam "contributor_details" Bool (SupportParameters p)) => Lens' p (Maybe Bool) contributorDetails = rawParam "contributor_details"
171
contributorDetails = rawParam "contributor_details"
51
false
true
0
8
17
50
25
25
null
null
google/codeworld
codeworld-base/src/Internal/Color.hs
apache-2.0
luminosity = fromDouble . CW.luminosity . toCWColor
51
luminosity = fromDouble . CW.luminosity . toCWColor
51
luminosity = fromDouble . CW.luminosity . toCWColor
51
false
false
0
7
6
16
8
8
null
null
iambernie/tryhaskell
parsecex/parsecexample.hs
mit
-- I want to return a list of pairs without a final separator: myPairs2b :: Parsec.Parsec String () [(String,String)] myPairs2b = Parsec.sepBy myParser mySeparator
163
myPairs2b :: Parsec.Parsec String () [(String,String)] myPairs2b = Parsec.sepBy myParser mySeparator
100
myPairs2b = Parsec.sepBy myParser mySeparator
45
true
true
1
7
23
42
21
21
null
null
lihlcnkr/codejam
Setup.hs
apache-2.0
checkNumberContains:: String -> Set Int -> Set Int checkNumberContains xs ss | xs > 9 = let m = div xs 10 n = (xs - 10 * m) in checkNumberContains m (insert n ss) | otherwise = xs
207
checkNumberContains:: String -> Set Int -> Set Int checkNumberContains xs ss | xs > 9 = let m = div xs 10 n = (xs - 10 * m) in checkNumberContains m (insert n ss) | otherwise = xs
207
checkNumberContains xs ss | xs > 9 = let m = div xs 10 n = (xs - 10 * m) in checkNumberContains m (insert n ss) | otherwise = xs
156
false
true
1
12
66
93
44
49
null
null
FranklinChen/hugs98-plus-Sep2006
packages/fgl/Data/Graph/Inductive/Example.hs
bsd-3-clause
-- three edges (two labels) a-->b loop = ([],1,'a',[((),1)]) & empty
68
loop = ([],1,'a',[((),1)]) & empty
34
loop = ([],1,'a',[((),1)]) & empty
34
true
false
1
9
10
39
22
17
null
null
creichert/persistent
persistent-mongoDB/Database/Persist/MongoDB.hs
mit
fieldToLabel :: EmbedFieldDef -> Text fieldToLabel = unDBName . emFieldDB
73
fieldToLabel :: EmbedFieldDef -> Text fieldToLabel = unDBName . emFieldDB
73
fieldToLabel = unDBName . emFieldDB
35
false
true
0
5
9
19
10
9
null
null
fmapfmapfmap/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribeReservedInstancesListings.hs
mpl-2.0
-- | Information about the Reserved Instance listing. drilrsReservedInstancesListings :: Lens' DescribeReservedInstancesListingsResponse [ReservedInstancesListing] drilrsReservedInstancesListings = lens _drilrsReservedInstancesListings (\ s a -> s{_drilrsReservedInstancesListings = a}) . _Default . _Coerce
307
drilrsReservedInstancesListings :: Lens' DescribeReservedInstancesListingsResponse [ReservedInstancesListing] drilrsReservedInstancesListings = lens _drilrsReservedInstancesListings (\ s a -> s{_drilrsReservedInstancesListings = a}) . _Default . _Coerce
253
drilrsReservedInstancesListings = lens _drilrsReservedInstancesListings (\ s a -> s{_drilrsReservedInstancesListings = a}) . _Default . _Coerce
143
true
true
0
11
27
51
28
23
null
null
hpacheco/jasminv
src/Utils.hs
gpl-3.0
snd4 (x,y,z,w) = y
18
snd4 (x,y,z,w) = y
18
snd4 (x,y,z,w) = y
18
false
false
0
5
3
22
12
10
null
null
michaelbeaumont/hatic
Hatic/Types.hs
bsd-3-clause
defaultConfig :: ClientSettings defaultConfig = ClientSettings "localhost" "7900"
81
defaultConfig :: ClientSettings defaultConfig = ClientSettings "localhost" "7900"
81
defaultConfig = ClientSettings "localhost" "7900"
49
false
true
0
5
7
16
8
8
null
null