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
GaloisInc/hpb
src/Data/HPB.hs
apache-2.0
bytesField :: Text -> Required B.ByteString -> FieldDef a B.ByteString bytesField = lengthDelimField id id
106
bytesField :: Text -> Required B.ByteString -> FieldDef a B.ByteString bytesField = lengthDelimField id id
106
bytesField = lengthDelimField id id
35
false
true
0
9
14
43
18
25
null
null
kemskems/cis194-spring13
src/HW07/Editor.hs
bsd-3-clause
doCommand Noop = return ()
26
doCommand Noop = return ()
26
doCommand Noop = return ()
26
false
false
1
6
4
17
6
11
null
null
NCrashed/Kaissa
source/Parser/GraphLoader.hs
gpl-3.0
firstCell :: CSVParser String firstCell = manyTill anyChar tab
62
firstCell :: CSVParser String firstCell = manyTill anyChar tab
62
firstCell = manyTill anyChar tab
32
false
true
0
5
8
19
9
10
null
null
apollo-lang/apollo
src/Util.hs
mit
akeAtom (VAtom p@(VPitch _) d@(VDuration _)) = AtomNote $ Note (toPitch p) (toDuration d)
90
makeAtom (VAtom p@(VPitch _) d@(VDuration _)) = AtomNote $ Note (toPitch p) (toDuration d)
90
makeAtom (VAtom p@(VPitch _) d@(VDuration _)) = AtomNote $ Note (toPitch p) (toDuration d)
90
false
false
0
10
14
56
28
28
null
null
rsasse/tamarin-prover
lib/theory/src/Theory.hs
gpl-3.0
-- | All lemmas of a theory. diffTheorySideLemmas :: Side -> DiffTheory sig c r r2 p p2 -> [Lemma p2] diffTheorySideLemmas s = foldDiffTheoryItem (const []) (const []) (const []) (\(x, y) -> if (x == s) then [y] else []) (const []) (const []) <=< L.get diffThyItems
269
diffTheorySideLemmas :: Side -> DiffTheory sig c r r2 p p2 -> [Lemma p2] diffTheorySideLemmas s = foldDiffTheoryItem (const []) (const []) (const []) (\(x, y) -> if (x == s) then [y] else []) (const []) (const []) <=< L.get diffThyItems
240
diffTheorySideLemmas s = foldDiffTheoryItem (const []) (const []) (const []) (\(x, y) -> if (x == s) then [y] else []) (const []) (const []) <=< L.get diffThyItems
167
true
true
0
11
52
138
72
66
null
null
byteally/webapi
webapi-swagger/src/Constants.hs
bsd-3-clause
localRouteMethodTypesModName :: RouteName -> Method -> String localRouteMethodTypesModName rName stdMethod = "Types." ++ rName ++ "." ++ (show stdMethod) ++ "."
160
localRouteMethodTypesModName :: RouteName -> Method -> String localRouteMethodTypesModName rName stdMethod = "Types." ++ rName ++ "." ++ (show stdMethod) ++ "."
160
localRouteMethodTypesModName rName stdMethod = "Types." ++ rName ++ "." ++ (show stdMethod) ++ "."
98
false
true
0
8
20
46
23
23
null
null
urbanslug/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
canDischargeFR (Wanted, _) (Wanted, _) = True
47
canDischargeFR (Wanted, _) (Wanted, _) = True
47
canDischargeFR (Wanted, _) (Wanted, _) = True
47
false
false
0
6
8
23
13
10
null
null
AlexanderPankiv/ghc
compiler/ghci/ByteCodeGen.hs
bsd-3-clause
schemeE d s p (AnnCase scrut bndr _ alts) = doCase d s p scrut bndr alts Nothing
83
schemeE d s p (AnnCase scrut bndr _ alts) = doCase d s p scrut bndr alts Nothing
83
schemeE d s p (AnnCase scrut bndr _ alts) = doCase d s p scrut bndr alts Nothing
83
false
false
0
6
20
50
20
30
null
null
futtetennista/IntroductionToFunctionalProgramming
itfp/src/Chapter7.hs
mit
iterate' :: (a -> a) -> a -> [a] iterate' f x = zs where zs = x : map f zs -- Ex. 7.2.2
103
iterate' :: (a -> a) -> a -> [a] iterate' f x = zs where zs = x : map f zs -- Ex. 7.2.2
103
iterate' f x = zs where zs = x : map f zs -- Ex. 7.2.2
70
false
true
3
9
40
63
28
35
null
null
caneroj1/HaskellDocs
Views/Index.hs
mit
index = html $ do renderHead "My Documents" body $ do container $ do HTML.div ! class_ "col-md-8 col-md-offset-1" $ do indexHeader hr renderSideNav renderJavascript
230
index = html $ do renderHead "My Documents" body $ do container $ do HTML.div ! class_ "col-md-8 col-md-offset-1" $ do indexHeader hr renderSideNav renderJavascript
230
index = html $ do renderHead "My Documents" body $ do container $ do HTML.div ! class_ "col-md-8 col-md-offset-1" $ do indexHeader hr renderSideNav renderJavascript
230
false
false
0
16
90
58
24
34
null
null
soscpd/bee
root/tests/zguide/examples/Haskell/interrupt.hs
mit
main :: IO () main = withContext $ \ctx -> withSocket ctx Rep $ \socket -> do bind socket "tcp://*:5555" s_interrupted <- newMVar 0 installHandler sigINT (Catch $ handler s_interrupted) Nothing installHandler sigTERM (Catch $ handler s_interrupted) Nothing recvFunction s_interrupted socket
324
main :: IO () main = withContext $ \ctx -> withSocket ctx Rep $ \socket -> do bind socket "tcp://*:5555" s_interrupted <- newMVar 0 installHandler sigINT (Catch $ handler s_interrupted) Nothing installHandler sigTERM (Catch $ handler s_interrupted) Nothing recvFunction s_interrupted socket
324
main = withContext $ \ctx -> withSocket ctx Rep $ \socket -> do bind socket "tcp://*:5555" s_interrupted <- newMVar 0 installHandler sigINT (Catch $ handler s_interrupted) Nothing installHandler sigTERM (Catch $ handler s_interrupted) Nothing recvFunction s_interrupted socket
310
false
true
0
14
74
105
48
57
null
null
kishoredbn/barrelfish
tools/flounder/CAbsSyntax.hs
mit
pp_strelem (NStr s) = s
23
pp_strelem (NStr s) = s
23
pp_strelem (NStr s) = s
23
false
false
0
7
4
15
7
8
null
null
Ninju/reflex-dom-demos
step-by-step-todo-list/stage-6-clear-completed/source.hs
mit
satisfiesFilter Active = not . view taskCompleted
52
satisfiesFilter Active = not . view taskCompleted
52
satisfiesFilter Active = not . view taskCompleted
52
false
false
0
6
9
17
7
10
null
null
trxeste/wrk
haskell/TrabalhoIA/src/Parser.hs
bsd-3-clause
parseObject (Dungeon _) = do object' <- letter <|> char '_' case object' of 'P' -> return Pendant 'O' -> return . Gate $ Overworld '_' -> return Empty _ -> fail "Objeto desconhecido"
204
parseObject (Dungeon _) = do object' <- letter <|> char '_' case object' of 'P' -> return Pendant 'O' -> return . Gate $ Overworld '_' -> return Empty _ -> fail "Objeto desconhecido"
204
parseObject (Dungeon _) = do object' <- letter <|> char '_' case object' of 'P' -> return Pendant 'O' -> return . Gate $ Overworld '_' -> return Empty _ -> fail "Objeto desconhecido"
204
false
false
0
11
55
78
35
43
null
null
rCEx/feldspar-lang-small
src/Feldspar/Core/Frontend/MutableArray.hs
bsd-3-clause
-- | Create a new 'Mutable' Array and initialize with elements from the -- list newListArr :: forall a. Type a => [Data a] -> M (Data (MArr a)) newListArr xs = do arr <- newArr_ (value $ genericLength xs) zipWithM_ (setArr arr . value) [0..] xs return arr -- | Extract the element at index
328
newListArr :: forall a. Type a => [Data a] -> M (Data (MArr a)) newListArr xs = do arr <- newArr_ (value $ genericLength xs) zipWithM_ (setArr arr . value) [0..] xs return arr -- | Extract the element at index
248
newListArr xs = do arr <- newArr_ (value $ genericLength xs) zipWithM_ (setArr arr . value) [0..] xs return arr -- | Extract the element at index
184
true
true
0
13
94
108
51
57
null
null
rimmington/cabal
Cabal/Distribution/PackageDescription/Check.hs
bsd-3-clause
checkTarPath :: FilePath -> Maybe PackageCheck checkTarPath path | length path > 255 = Just longPath | otherwise = case pack nameMax (reverse (splitPath path)) of Left err -> Just err Right [] -> Nothing Right (first:rest) -> case pack prefixMax remainder of Left err -> Just err Right [] -> Nothing Right (_:_) -> Just noSplit where -- drop the '/' between the name and prefix: remainder = init first : rest where nameMax, prefixMax :: Int nameMax = 100 prefixMax = 155 pack _ [] = Left emptyName pack maxLen (c:cs) | n > maxLen = Left longName | otherwise = Right (pack' maxLen n cs) where n = length c pack' maxLen n (c:cs) | n' <= maxLen = pack' maxLen n' cs where n' = n + length c pack' _ _ cs = cs longPath = PackageDistInexcusable $ "The following file name is too long to store in a portable POSIX " ++ "format tar archive. The maximum length is 255 ASCII characters.\n" ++ "The file in question is:\n " ++ path longName = PackageDistInexcusable $ "The following file name is too long to store in a portable POSIX " ++ "format tar archive. The maximum length for the name part (including " ++ "extension) is 100 ASCII characters. The maximum length for any " ++ "individual directory component is 155.\n" ++ "The file in question is:\n " ++ path noSplit = PackageDistInexcusable $ "The following file name is too long to store in a portable POSIX " ++ "format tar archive. While the total length is less than 255 ASCII " ++ "characters, there are unfortunately further restrictions. It has to " ++ "be possible to split the file path on a directory separator into " ++ "two parts such that the first part fits in 155 characters or less " ++ "and the second part fits in 100 characters or less. Basically you " ++ "have to make the file name or directory names shorter, or you could " ++ "split a long directory name into nested subdirectories with shorter " ++ "names.\nThe file in question is:\n " ++ path emptyName = PackageDistInexcusable $ "Encountered a file with an empty name, something is very wrong! " ++ "Files with an empty name cannot be stored in a tar archive or in " ++ "standard file systems." -- ------------------------------------------------------------ -- * Utils -- ------------------------------------------------------------
2,586
checkTarPath :: FilePath -> Maybe PackageCheck checkTarPath path | length path > 255 = Just longPath | otherwise = case pack nameMax (reverse (splitPath path)) of Left err -> Just err Right [] -> Nothing Right (first:rest) -> case pack prefixMax remainder of Left err -> Just err Right [] -> Nothing Right (_:_) -> Just noSplit where -- drop the '/' between the name and prefix: remainder = init first : rest where nameMax, prefixMax :: Int nameMax = 100 prefixMax = 155 pack _ [] = Left emptyName pack maxLen (c:cs) | n > maxLen = Left longName | otherwise = Right (pack' maxLen n cs) where n = length c pack' maxLen n (c:cs) | n' <= maxLen = pack' maxLen n' cs where n' = n + length c pack' _ _ cs = cs longPath = PackageDistInexcusable $ "The following file name is too long to store in a portable POSIX " ++ "format tar archive. The maximum length is 255 ASCII characters.\n" ++ "The file in question is:\n " ++ path longName = PackageDistInexcusable $ "The following file name is too long to store in a portable POSIX " ++ "format tar archive. The maximum length for the name part (including " ++ "extension) is 100 ASCII characters. The maximum length for any " ++ "individual directory component is 155.\n" ++ "The file in question is:\n " ++ path noSplit = PackageDistInexcusable $ "The following file name is too long to store in a portable POSIX " ++ "format tar archive. While the total length is less than 255 ASCII " ++ "characters, there are unfortunately further restrictions. It has to " ++ "be possible to split the file path on a directory separator into " ++ "two parts such that the first part fits in 155 characters or less " ++ "and the second part fits in 100 characters or less. Basically you " ++ "have to make the file name or directory names shorter, or you could " ++ "split a long directory name into nested subdirectories with shorter " ++ "names.\nThe file in question is:\n " ++ path emptyName = PackageDistInexcusable $ "Encountered a file with an empty name, something is very wrong! " ++ "Files with an empty name cannot be stored in a tar archive or in " ++ "standard file systems." -- ------------------------------------------------------------ -- * Utils -- ------------------------------------------------------------
2,586
checkTarPath path | length path > 255 = Just longPath | otherwise = case pack nameMax (reverse (splitPath path)) of Left err -> Just err Right [] -> Nothing Right (first:rest) -> case pack prefixMax remainder of Left err -> Just err Right [] -> Nothing Right (_:_) -> Just noSplit where -- drop the '/' between the name and prefix: remainder = init first : rest where nameMax, prefixMax :: Int nameMax = 100 prefixMax = 155 pack _ [] = Left emptyName pack maxLen (c:cs) | n > maxLen = Left longName | otherwise = Right (pack' maxLen n cs) where n = length c pack' maxLen n (c:cs) | n' <= maxLen = pack' maxLen n' cs where n' = n + length c pack' _ _ cs = cs longPath = PackageDistInexcusable $ "The following file name is too long to store in a portable POSIX " ++ "format tar archive. The maximum length is 255 ASCII characters.\n" ++ "The file in question is:\n " ++ path longName = PackageDistInexcusable $ "The following file name is too long to store in a portable POSIX " ++ "format tar archive. The maximum length for the name part (including " ++ "extension) is 100 ASCII characters. The maximum length for any " ++ "individual directory component is 155.\n" ++ "The file in question is:\n " ++ path noSplit = PackageDistInexcusable $ "The following file name is too long to store in a portable POSIX " ++ "format tar archive. While the total length is less than 255 ASCII " ++ "characters, there are unfortunately further restrictions. It has to " ++ "be possible to split the file path on a directory separator into " ++ "two parts such that the first part fits in 155 characters or less " ++ "and the second part fits in 100 characters or less. Basically you " ++ "have to make the file name or directory names shorter, or you could " ++ "split a long directory name into nested subdirectories with shorter " ++ "names.\nThe file in question is:\n " ++ path emptyName = PackageDistInexcusable $ "Encountered a file with an empty name, something is very wrong! " ++ "Files with an empty name cannot be stored in a tar archive or in " ++ "standard file systems." -- ------------------------------------------------------------ -- * Utils -- ------------------------------------------------------------
2,539
false
true
15
28
728
458
218
240
null
null
Concomitant/LambdaHack
Game/LambdaHack/Atomic/MonadStateWrite.hs
bsd-3-clause
insertItemEqp :: MonadStateWrite m => ItemId -> ItemQuant -> ActorId -> m () insertItemEqp iid kit aid = do let bag = EM.singleton iid kit upd = EM.unionWith mergeItemQuant bag updateActor aid $ \b -> b {beqp = upd (beqp b)}
248
insertItemEqp :: MonadStateWrite m => ItemId -> ItemQuant -> ActorId -> m () insertItemEqp iid kit aid = do let bag = EM.singleton iid kit upd = EM.unionWith mergeItemQuant bag updateActor aid $ \b -> b {beqp = upd (beqp b)}
248
insertItemEqp iid kit aid = do let bag = EM.singleton iid kit upd = EM.unionWith mergeItemQuant bag updateActor aid $ \b -> b {beqp = upd (beqp b)}
157
false
true
0
13
64
102
49
53
null
null
koengit/modalox
Modalox.hs
bsd-2-clause
store :: Ord m => Form m Lit -> (Bool,Bool,Lit) -> M m () store p t = M (\s say ref -> do mp <- modifyIORef ref (M.insert p t); return ((),[],[]))
146
store :: Ord m => Form m Lit -> (Bool,Bool,Lit) -> M m () store p t = M (\s say ref -> do mp <- modifyIORef ref (M.insert p t); return ((),[],[]))
146
store p t = M (\s say ref -> do mp <- modifyIORef ref (M.insert p t); return ((),[],[]))
88
false
true
0
14
32
111
56
55
null
null
leskiw77/Checkers
src/ChessBoard.hs
bsd-3-clause
mkMove :: Board -> (Int, Int) -- ^ begin cords -> (Int, Int) -- ^ final cords -> Mode -- ^ with removing enemy or not -> Board mkMove board (x1,y1) (x2,y2) mode = do let newboard = move board (x1,y1) (x2,y2) if mode == Kill then readBoard $ exchangeElement2D (toStringBoard newboard) ((min x1 x2) + 1) ((min y1 y2) + 1) ' ' else newboard
417
mkMove :: Board -> (Int, Int) -- ^ begin cords -> (Int, Int) -- ^ final cords -> Mode -- ^ with removing enemy or not -> Board mkMove board (x1,y1) (x2,y2) mode = do let newboard = move board (x1,y1) (x2,y2) if mode == Kill then readBoard $ exchangeElement2D (toStringBoard newboard) ((min x1 x2) + 1) ((min y1 y2) + 1) ' ' else newboard
417
mkMove board (x1,y1) (x2,y2) mode = do let newboard = move board (x1,y1) (x2,y2) if mode == Kill then readBoard $ exchangeElement2D (toStringBoard newboard) ((min x1 x2) + 1) ((min y1 y2) + 1) ' ' else newboard
242
false
true
0
13
145
161
86
75
null
null
paulajessicab/DBReport-SQLite3
DBReport.hs
gpl-3.0
title_font :: FontName -> Repo -> Repo title_font font (R (Title ttl stl) col cond bstl conn) = R (Title ttl stl') col cond bstl conn where stl' = change_tfont font stl --Cambia el tamaño del título
290
title_font :: FontName -> Repo -> Repo title_font font (R (Title ttl stl) col cond bstl conn) = R (Title ttl stl') col cond bstl conn where stl' = change_tfont font stl --Cambia el tamaño del título
290
title_font font (R (Title ttl stl) col cond bstl conn) = R (Title ttl stl') col cond bstl conn where stl' = change_tfont font stl --Cambia el tamaño del título
251
false
true
0
9
128
78
39
39
null
null
green-haskell/ghc
utils/hpc/HpcDraft.hs
bsd-3-clause
mkTickInside :: [String] -> HpcPos -> [PleaseTick] -> [PleaseTick] -> [PleaseTick] mkTickInside _ _ [] = id
127
mkTickInside :: [String] -> HpcPos -> [PleaseTick] -> [PleaseTick] -> [PleaseTick] mkTickInside _ _ [] = id
127
mkTickInside _ _ [] = id
31
false
true
0
9
36
48
26
22
null
null
rahulmutt/ghcvm
compiler/Eta/Utils/UniqFM.hs
bsd-3-clause
delFromUFM :: Uniquable key => UniqFM elt -> key -> UniqFM elt delFromUFM (UFM m) k = UFM (M.delete (getKey $ getUnique k) m)
128
delFromUFM :: Uniquable key => UniqFM elt -> key -> UniqFM elt delFromUFM (UFM m) k = UFM (M.delete (getKey $ getUnique k) m)
128
delFromUFM (UFM m) k = UFM (M.delete (getKey $ getUnique k) m)
62
false
true
0
11
26
70
32
38
null
null
kosmoskatten/ghost-lang
ghost-lang/src/GhostLang/Compiler/Linker.hs
mit
-- | Make sure that there's exactly one module named "Main". uniqueMainModule :: [GhostModule a] -> Either String [GhostModule a] uniqueMainModule xs = let ys = getMainModules xs in case length ys of 0 -> Left "No module named \"Main\"" 1 -> Right xs _ -> Left (ambiguousMain ys) where ambiguousMain :: [GhostModule a] -> String ambiguousMain ys = execWriter $ do tell "Ambiguous references of module \"Main\":\n" forM_ ys $ \(GhostModule mdecl _ _ _) -> tell $ printf " %s\n" (show $ srcPos mdecl) -- | Check that the main module implement at least one pattern.
672
uniqueMainModule :: [GhostModule a] -> Either String [GhostModule a] uniqueMainModule xs = let ys = getMainModules xs in case length ys of 0 -> Left "No module named \"Main\"" 1 -> Right xs _ -> Left (ambiguousMain ys) where ambiguousMain :: [GhostModule a] -> String ambiguousMain ys = execWriter $ do tell "Ambiguous references of module \"Main\":\n" forM_ ys $ \(GhostModule mdecl _ _ _) -> tell $ printf " %s\n" (show $ srcPos mdecl) -- | Check that the main module implement at least one pattern.
611
uniqueMainModule xs = let ys = getMainModules xs in case length ys of 0 -> Left "No module named \"Main\"" 1 -> Right xs _ -> Left (ambiguousMain ys) where ambiguousMain :: [GhostModule a] -> String ambiguousMain ys = execWriter $ do tell "Ambiguous references of module \"Main\":\n" forM_ ys $ \(GhostModule mdecl _ _ _) -> tell $ printf " %s\n" (show $ srcPos mdecl) -- | Check that the main module implement at least one pattern.
542
true
true
0
14
207
173
82
91
null
null
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/AcceleratorTypes/List.hs
mpl-2.0
-- | Project ID for this request. atlProject :: Lens' AcceleratorTypesList Text atlProject = lens _atlProject (\ s a -> s{_atlProject = a})
141
atlProject :: Lens' AcceleratorTypesList Text atlProject = lens _atlProject (\ s a -> s{_atlProject = a})
107
atlProject = lens _atlProject (\ s a -> s{_atlProject = a})
61
true
true
1
9
24
44
22
22
null
null
sgillespie/ghc
compiler/hsSyn/HsBinds.hs
bsd-3-clause
pprVarSig :: (OutputableBndr id) => [id] -> SDoc -> SDoc pprVarSig vars pp_ty = sep [pprvars <+> dcolon, nest 2 pp_ty] where pprvars = hsep $ punctuate comma (map pprPrefixOcc vars)
187
pprVarSig :: (OutputableBndr id) => [id] -> SDoc -> SDoc pprVarSig vars pp_ty = sep [pprvars <+> dcolon, nest 2 pp_ty] where pprvars = hsep $ punctuate comma (map pprPrefixOcc vars)
187
pprVarSig vars pp_ty = sep [pprvars <+> dcolon, nest 2 pp_ty] where pprvars = hsep $ punctuate comma (map pprPrefixOcc vars)
130
false
true
0
8
36
79
40
39
null
null
alexlegg/couchgames
src/CouchGames/Resistance.hs
bsd-3-clause
gameAction p (VoteOnProposal v) g = return (voteOnProposal p v g)
65
gameAction p (VoteOnProposal v) g = return (voteOnProposal p v g)
65
gameAction p (VoteOnProposal v) g = return (voteOnProposal p v g)
65
false
false
1
7
10
35
15
20
null
null
thalerjonathan/phd
coding/prototyping/haskell/declarativeABM/haskell/MinABS/src/SIRS/SIRSModel.hs
gpl-3.0
clipCoords :: [SIRSCoord] -> (Int, Int) -> [SIRSCoord] clipCoords cs max = filter (\c -> validCoord c max ) cs where validCoord :: SIRSCoord -> (Int, Int) -> Bool validCoord (x, y) (xMax, yMax) | x < 0 = False | y < 0 = False | x >= xMax = False | y >= yMax = False | otherwise = True
364
clipCoords :: [SIRSCoord] -> (Int, Int) -> [SIRSCoord] clipCoords cs max = filter (\c -> validCoord c max ) cs where validCoord :: SIRSCoord -> (Int, Int) -> Bool validCoord (x, y) (xMax, yMax) | x < 0 = False | y < 0 = False | x >= xMax = False | y >= yMax = False | otherwise = True
364
clipCoords cs max = filter (\c -> validCoord c max ) cs where validCoord :: SIRSCoord -> (Int, Int) -> Bool validCoord (x, y) (xMax, yMax) | x < 0 = False | y < 0 = False | x >= xMax = False | y >= yMax = False | otherwise = True
309
false
true
0
9
141
176
86
90
null
null
wouwouwou/2017_module_8
src/haskell/PP-project-2017/ASTBuilder.hs
apache-2.0
getTypeStr _ = error "Not a valid type in: getStr :: Alphabet -> String"
79
getTypeStr _ = error "Not a valid type in: getStr :: Alphabet -> String"
79
getTypeStr _ = error "Not a valid type in: getStr :: Alphabet -> String"
79
false
false
0
5
20
13
5
8
null
null
tumarkin/vandelay
src/Vandelay/App/Cmd/Init.hs
bsd-3-clause
askContents = asks dataFileContents
47
askContents = asks dataFileContents
47
askContents = asks dataFileContents
47
false
false
0
5
15
9
4
5
null
null
iu-parfunc/containers
tests/set-properties.hs
bsd-3-clause
prop_List :: [Int] -> Bool prop_List xs = (sort (nub xs) == toList (fromList xs))
81
prop_List :: [Int] -> Bool prop_List xs = (sort (nub xs) == toList (fromList xs))
81
prop_List xs = (sort (nub xs) == toList (fromList xs))
54
false
true
0
9
14
46
23
23
null
null
pgj/bead
test/Test/Property/Persistence.hs
bsd-3-clause
systemNotifications :: Int -> IO [NotificationKey] systemNotifications n = do list <- createListRef quick n $ do nk <- saveAndLoadIdenpotent "Notification" saveSystemNotification loadNotification Gen.notifications run $ insertListRef list nk listInRef list -- Generates and stores the given number of comment notifications for randomly selected comments -- Returns the list of the associated notification and comment keys.
437
systemNotifications :: Int -> IO [NotificationKey] systemNotifications n = do list <- createListRef quick n $ do nk <- saveAndLoadIdenpotent "Notification" saveSystemNotification loadNotification Gen.notifications run $ insertListRef list nk listInRef list -- Generates and stores the given number of comment notifications for randomly selected comments -- Returns the list of the associated notification and comment keys.
437
systemNotifications n = do list <- createListRef quick n $ do nk <- saveAndLoadIdenpotent "Notification" saveSystemNotification loadNotification Gen.notifications run $ insertListRef list nk listInRef list -- Generates and stores the given number of comment notifications for randomly selected comments -- Returns the list of the associated notification and comment keys.
386
false
true
0
12
70
79
36
43
null
null
phischu/fragnix
tests/packages/scotty/Network.Wai.Handler.Warp.hs
bsd-3-clause
-- | Disable HTTP2. -- -- Since 3.1.7 setHTTP2Disabled :: Settings -> Settings setHTTP2Disabled y = y { settingsHTTP2Enabled = False }
134
setHTTP2Disabled :: Settings -> Settings setHTTP2Disabled y = y { settingsHTTP2Enabled = False }
96
setHTTP2Disabled y = y { settingsHTTP2Enabled = False }
55
true
true
0
6
21
29
17
12
null
null
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/OpsWorksAppSource.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html#cfn-opsworks-custcookbooksource-sshkey owasSshKey :: Lens' OpsWorksAppSource (Maybe (Val Text)) owasSshKey = lens _opsWorksAppSourceSshKey (\s a -> s { _opsWorksAppSourceSshKey = a })
292
owasSshKey :: Lens' OpsWorksAppSource (Maybe (Val Text)) owasSshKey = lens _opsWorksAppSourceSshKey (\s a -> s { _opsWorksAppSourceSshKey = a })
144
owasSshKey = lens _opsWorksAppSourceSshKey (\s a -> s { _opsWorksAppSourceSshKey = a })
87
true
true
0
9
22
52
28
24
null
null
kadircet/CENG
242/HW2.hs
gpl-3.0
delpath fs@(FS (x@(a,b):xs)) p@(y:[]) | a<y = FS (x:(getList $ delpath (FS xs) p)) | a==y = FS xs | otherwise = fs
117
delpath fs@(FS (x@(a,b):xs)) p@(y:[]) | a<y = FS (x:(getList $ delpath (FS xs) p)) | a==y = FS xs | otherwise = fs
117
delpath fs@(FS (x@(a,b):xs)) p@(y:[]) | a<y = FS (x:(getList $ delpath (FS xs) p)) | a==y = FS xs | otherwise = fs
117
false
false
1
13
25
112
57
55
null
null
damoxc/ganeti
src/Ganeti/HTools/CLI.hs
gpl-2.0
oGroup :: OptType oGroup = (Option "G" ["group"] (ReqArg (\ f o -> Ok o { optGroup = Just f }) "ID") "the target node group (name or UUID)", OptComplOneGroup)
169
oGroup :: OptType oGroup = (Option "G" ["group"] (ReqArg (\ f o -> Ok o { optGroup = Just f }) "ID") "the target node group (name or UUID)", OptComplOneGroup)
169
oGroup = (Option "G" ["group"] (ReqArg (\ f o -> Ok o { optGroup = Just f }) "ID") "the target node group (name or UUID)", OptComplOneGroup)
151
false
true
0
15
40
68
34
34
null
null
MostAwesomeDude/lollerskates
Lol/FD.hs
bsd-2-clause
(.<=.) :: FDVar s -> FDVar s -> FD s () (.<=.) = addBinaryConstraint $ \x y -> do xv <- lookup x yv <- lookup y let xv' = IntSet.filter (<= IntSet.findMax yv) xv let yv' = IntSet.filter (>= IntSet.findMin xv) yv guard $ not $ IntSet.null xv' guard $ not $ IntSet.null yv' when (xv /= xv') $ update x xv' when (yv /= yv') $ update y yv' -- | Force variables to all be ordered according to order of enumeration, -- exclusive. This means that [a, b, c..] will satisfy a < b < c ...
513
(.<=.) :: FDVar s -> FDVar s -> FD s () (.<=.) = addBinaryConstraint $ \x y -> do xv <- lookup x yv <- lookup y let xv' = IntSet.filter (<= IntSet.findMax yv) xv let yv' = IntSet.filter (>= IntSet.findMin xv) yv guard $ not $ IntSet.null xv' guard $ not $ IntSet.null yv' when (xv /= xv') $ update x xv' when (yv /= yv') $ update y yv' -- | Force variables to all be ordered according to order of enumeration, -- exclusive. This means that [a, b, c..] will satisfy a < b < c ...
513
(.<=.) = addBinaryConstraint $ \x y -> do xv <- lookup x yv <- lookup y let xv' = IntSet.filter (<= IntSet.findMax yv) xv let yv' = IntSet.filter (>= IntSet.findMin xv) yv guard $ not $ IntSet.null xv' guard $ not $ IntSet.null yv' when (xv /= xv') $ update x xv' when (yv /= yv') $ update y yv' -- | Force variables to all be ordered according to order of enumeration, -- exclusive. This means that [a, b, c..] will satisfy a < b < c ...
473
false
true
0
16
134
201
94
107
null
null
alexander-at-github/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
primOpInfo JBool2IntOp = mkGenPrimOp (fsLit "jbool2int#") [] [jboolPrimTy] intPrimTy
85
primOpInfo JBool2IntOp = mkGenPrimOp (fsLit "jbool2int#") [] [jboolPrimTy] intPrimTy
85
primOpInfo JBool2IntOp = mkGenPrimOp (fsLit "jbool2int#") [] [jboolPrimTy] intPrimTy
85
false
false
0
7
9
29
14
15
null
null
fcostantini/PlEb
src/Misc.hs
gpl-3.0
write Pls = writePls
20
write Pls = writePls
20
write Pls = writePls
20
false
false
0
5
3
9
4
5
null
null
a143753/AOJ
0124.hs
apache-2.0
main = do c <- getContents let i = lines c o = ans i putStr $ concat' o
83
main = do c <- getContents let i = lines c o = ans i putStr $ concat' o
83
main = do c <- getContents let i = lines c o = ans i putStr $ concat' o
83
false
false
0
10
30
43
19
24
null
null
atemerev/icfpc2013
src/solver-lib/ProgramCounting.hs
apache-2.0
defaultAllowedOp2 = [And, Or, Xor, Plus]
40
defaultAllowedOp2 = [And, Or, Xor, Plus]
40
defaultAllowedOp2 = [And, Or, Xor, Plus]
40
false
false
0
5
5
18
11
7
null
null
kaizhang/haskell-igraph
src/IGraph.hs
mit
-- | Delete nodes from the graph. delNodes :: (Ord v, Serialize v) => [Node] -> Graph d v e -> Graph d v e delNodes nds gr = runST $ do gr' <- thaw gr GM.delNodes nds gr' unsafeFreeze gr'
209
delNodes :: (Ord v, Serialize v) => [Node] -> Graph d v e -> Graph d v e delNodes nds gr = runST $ do gr' <- thaw gr GM.delNodes nds gr' unsafeFreeze gr'
175
delNodes nds gr = runST $ do gr' <- thaw gr GM.delNodes nds gr' unsafeFreeze gr'
93
true
true
0
9
62
87
41
46
null
null
defanor/pancake
Pancake/Command.hs
gpl-3.0
-- | 'URI' parser. pURI :: Parser URI pURI = do s <- many1 (satisfy isAllowedInURI) <?> "URI" maybe (fail "Failed to parse URI") pure $ parseURIReference s -- | 'FilePath' parser.
184
pURI :: Parser URI pURI = do s <- many1 (satisfy isAllowedInURI) <?> "URI" maybe (fail "Failed to parse URI") pure $ parseURIReference s -- | 'FilePath' parser.
165
pURI = do s <- many1 (satisfy isAllowedInURI) <?> "URI" maybe (fail "Failed to parse URI") pure $ parseURIReference s -- | 'FilePath' parser.
146
true
true
1
12
36
61
27
34
null
null
kylcarte/threepenny-extra
src/Reactive/Threepenny/Extra.hs
bsd-3-clause
(<!>) :: Event (a -> b) -> Behavior a -> Event b e <!> b = ((&) <$> b) <@> e
76
(<!>) :: Event (a -> b) -> Behavior a -> Event b e <!> b = ((&) <$> b) <@> e
76
e <!> b = ((&) <$> b) <@> e
27
false
true
0
9
20
56
29
27
null
null
cbpark/HiggsDitau
src/higgs_ditau_jet.hs
gpl-3.0
basicSelection' :: PhyObj a -> Bool basicSelection' (ObjPhoton _) = False
98
basicSelection' :: PhyObj a -> Bool basicSelection' (ObjPhoton _) = False
98
basicSelection' (ObjPhoton _) = False
62
false
true
0
9
35
33
14
19
null
null
shnarazk/CNFIO
SAT/BoolExp.hs
bsd-3-clause
asList :: BoolForm -> [[Int]] asList cnf@(Cnf (m,n) l) | isTrue cnf = [] | isFalse cnf = [[]] | n <= tseitinBase = l | otherwise = [m'] : l' where (Cnf (m', _) l', _) = renumber (m + 1) cnf -- | make latex string from CNF -- -- >>> asLatex $ "3" -|- "4" -- "\\begin{displaymath}\n( x_{3} \\vee x_{4} )\n\\end{displaymath}\n" --
344
asList :: BoolForm -> [[Int]] asList cnf@(Cnf (m,n) l) | isTrue cnf = [] | isFalse cnf = [[]] | n <= tseitinBase = l | otherwise = [m'] : l' where (Cnf (m', _) l', _) = renumber (m + 1) cnf -- | make latex string from CNF -- -- >>> asLatex $ "3" -|- "4" -- "\\begin{displaymath}\n( x_{3} \\vee x_{4} )\n\\end{displaymath}\n" --
344
asList cnf@(Cnf (m,n) l) | isTrue cnf = [] | isFalse cnf = [[]] | n <= tseitinBase = l | otherwise = [m'] : l' where (Cnf (m', _) l', _) = renumber (m + 1) cnf -- | make latex string from CNF -- -- >>> asLatex $ "3" -|- "4" -- "\\begin{displaymath}\n( x_{3} \\vee x_{4} )\n\\end{displaymath}\n" --
314
false
true
3
9
81
136
74
62
null
null
bartavelle/withdependencies
Control/Dependency.hs
gpl-3.0
-- | Evaluate a computation, given a map of key/values for possible -- parameters. computeRequire :: forall identifier content f a. (Ord identifier, Eq identifier, Monad f, Alternative f) => [(identifier, content)] -> Require identifier content a -> f a computeRequire = computeRequireG Final
305
computeRequire :: forall identifier content f a. (Ord identifier, Eq identifier, Monad f, Alternative f) => [(identifier, content)] -> Require identifier content a -> f a computeRequire = computeRequireG Final
222
computeRequire = computeRequireG Final
38
true
true
0
10
56
83
44
39
null
null
GaloisInc/gidl
src/Gidl/Parse.hs
bsd-3-clause
tEnumName :: Parse (Identifier, Bits) tEnumName (L [name, size]) = (,) <$> tSymbol name <*> tBits size
102
tEnumName :: Parse (Identifier, Bits) tEnumName (L [name, size]) = (,) <$> tSymbol name <*> tBits size
102
tEnumName (L [name, size]) = (,) <$> tSymbol name <*> tBits size
64
false
true
3
7
16
57
27
30
null
null
phischu/fragnix
tests/packages/scotty/Network.Wai.Middleware.StripHeaders.hs
bsd-3-clause
-- | If the request satisifes the provided predicate, strip all headers whose -- header name is in the list of provided header names. -- -- Since 3.0.8 stripHeadersIf :: [ByteString] -> (Request -> Bool) -> Middleware stripHeadersIf hs rpred = ifRequest rpred (modifyResponse $ stripHeaders hs)
296
stripHeadersIf :: [ByteString] -> (Request -> Bool) -> Middleware stripHeadersIf hs rpred = ifRequest rpred (modifyResponse $ stripHeaders hs)
144
stripHeadersIf hs rpred = ifRequest rpred (modifyResponse $ stripHeaders hs)
78
true
true
0
8
48
53
29
24
null
null
lukexi/haskell-opencv
test/test.hs
bsd-3-clause
depthUnmarshalUnknown :: Int32 -> QC.Property depthUnmarshalUnknown n = n `notElem` knownEncodings ==> QC.expectFailure (unmarshalDepth n `seq` True) where knownEncodings = map marshalDepth [minBound .. maxBound]
222
depthUnmarshalUnknown :: Int32 -> QC.Property depthUnmarshalUnknown n = n `notElem` knownEncodings ==> QC.expectFailure (unmarshalDepth n `seq` True) where knownEncodings = map marshalDepth [minBound .. maxBound]
222
depthUnmarshalUnknown n = n `notElem` knownEncodings ==> QC.expectFailure (unmarshalDepth n `seq` True) where knownEncodings = map marshalDepth [minBound .. maxBound]
176
false
true
2
8
34
81
38
43
null
null
kevinbackhouse/Control-Monad-MultiPass
tests/TestCounter.hs
bsd-3-clause
instanceTest :: ST2 r w () instanceTest = do instanceTest1 instanceTest2
79
instanceTest :: ST2 r w () instanceTest = do instanceTest1 instanceTest2
79
instanceTest = do instanceTest1 instanceTest2
52
false
true
0
7
17
32
13
19
null
null
ndmitchell/qed
v1/HSE.hs
bsd-3-clause
irrefutable :: Pat -> Bool irrefutable x = case deflatePat x of PApp (UnQual (Ident ('(':(dropWhile (== ',') -> ")")))) xs -> all irrefutable xs PVar{} -> True _ -> False
182
irrefutable :: Pat -> Bool irrefutable x = case deflatePat x of PApp (UnQual (Ident ('(':(dropWhile (== ',') -> ")")))) xs -> all irrefutable xs PVar{} -> True _ -> False
182
irrefutable x = case deflatePat x of PApp (UnQual (Ident ('(':(dropWhile (== ',') -> ")")))) xs -> all irrefutable xs PVar{} -> True _ -> False
155
false
true
0
18
42
96
46
50
null
null
MadSciGuys/trebuchet
src/Treb/Config.hs
mit
unlessDebugMode :: Monad m => TrebConfig -> m a -> m (Maybe a) unlessDebugMode conf action = bool (action >>= return . Just) (return Nothing) (confDebugMode conf)
162
unlessDebugMode :: Monad m => TrebConfig -> m a -> m (Maybe a) unlessDebugMode conf action = bool (action >>= return . Just) (return Nothing) (confDebugMode conf)
162
unlessDebugMode conf action = bool (action >>= return . Just) (return Nothing) (confDebugMode conf)
99
false
true
0
10
26
73
35
38
null
null
vincenthz/hs-foundation
foundation/tests/Test/Foundation/Random.hs
bsd-3-clause
rngv1Check = pick "get-rng" getRng >>= testDataAppearRandom where getRng = do rng <- randomNew :: IO RNG pure $ mconcat $ fst $ withRandomGenerator rng $ mapM getRandomBytes [1,2,4,8,32,80,250,2139] -- property to check that the data appears random enough -- -- if this test fails it doesn't necessarily means it's not normal.
349
rngv1Check = pick "get-rng" getRng >>= testDataAppearRandom where getRng = do rng <- randomNew :: IO RNG pure $ mconcat $ fst $ withRandomGenerator rng $ mapM getRandomBytes [1,2,4,8,32,80,250,2139] -- property to check that the data appears random enough -- -- if this test fails it doesn't necessarily means it's not normal.
349
rngv1Check = pick "get-rng" getRng >>= testDataAppearRandom where getRng = do rng <- randomNew :: IO RNG pure $ mconcat $ fst $ withRandomGenerator rng $ mapM getRandomBytes [1,2,4,8,32,80,250,2139] -- property to check that the data appears random enough -- -- if this test fails it doesn't necessarily means it's not normal.
349
false
false
0
10
74
90
48
42
null
null
rohitjha/DiMPL
src/Tree.hs
bsd-2-clause
{-| The 'singleton' function returns a single childless node. For example: >>> singleton 10 Node 10 Leaf Leaf >>> singleton 'a' Node 'a' Leaf Leaf >>> singleton 'A' Node 'A' Leaf Leaf -} singleton :: a -> BinTree a singleton x = Node x Leaf Leaf
281
singleton :: a -> BinTree a singleton x = Node x Leaf Leaf
58
singleton x = Node x Leaf Leaf
30
true
true
0
6
81
29
14
15
null
null
ulricha/dsh-sql
src/Database/DSH/Backend/Sql/Opt/Properties/Auxiliary.hs
bsd-3-clause
aggrInput (CountDistinct e) = exprCols e
40
aggrInput (CountDistinct e) = exprCols e
40
aggrInput (CountDistinct e) = exprCols e
40
false
false
0
7
5
18
8
10
null
null
zaxtax/hakaru
haskell/Language/Hakaru/CodeGen/AST.hs
bsd-3-clause
a .*=. b = CAssign CMulAssOp a b
32
a .*=. b = CAssign CMulAssOp a b
32
a .*=. b = CAssign CMulAssOp a b
32
false
false
2
5
7
23
10
13
null
null
tolysz/hs-tls
core/Network/TLS/Extra/Cipher.hs
bsd-3-clause
bulk_aes256gcm = Bulk { bulkName = "AES256GCM" , bulkKeySize = 32 -- RFC 5116 Sec 5.1: K_LEN , bulkIVSize = 4 -- RFC 5288 GCMNonce.salt, fixed_iv_length , bulkExplicitIV = 8 , bulkAuthTagLen = 16 , bulkBlockSize = 0 -- dummy, not used , bulkF = BulkAeadF aes256gcm }
337
bulk_aes256gcm = Bulk { bulkName = "AES256GCM" , bulkKeySize = 32 -- RFC 5116 Sec 5.1: K_LEN , bulkIVSize = 4 -- RFC 5288 GCMNonce.salt, fixed_iv_length , bulkExplicitIV = 8 , bulkAuthTagLen = 16 , bulkBlockSize = 0 -- dummy, not used , bulkF = BulkAeadF aes256gcm }
337
bulk_aes256gcm = Bulk { bulkName = "AES256GCM" , bulkKeySize = 32 -- RFC 5116 Sec 5.1: K_LEN , bulkIVSize = 4 -- RFC 5288 GCMNonce.salt, fixed_iv_length , bulkExplicitIV = 8 , bulkAuthTagLen = 16 , bulkBlockSize = 0 -- dummy, not used , bulkF = BulkAeadF aes256gcm }
337
false
false
0
8
118
60
37
23
null
null
ian-mi/haskell-riak-client
Network/Riak/Connection.hs
apache-2.0
connect :: HostName -> ServiceName -> IO Connection connect host port = getAddrInfo (Just hints) (Just host) (Just port) >>= connectSock . Prelude.head >>= newConnection where hints = defaultHints {addrFlags = [AI_ADDRCONFIG], addrSocketType = Stream}
253
connect :: HostName -> ServiceName -> IO Connection connect host port = getAddrInfo (Just hints) (Just host) (Just port) >>= connectSock . Prelude.head >>= newConnection where hints = defaultHints {addrFlags = [AI_ADDRCONFIG], addrSocketType = Stream}
253
connect host port = getAddrInfo (Just hints) (Just host) (Just port) >>= connectSock . Prelude.head >>= newConnection where hints = defaultHints {addrFlags = [AI_ADDRCONFIG], addrSocketType = Stream}
201
false
true
0
10
36
91
47
44
null
null
dillonhuff/Proper
src/Proper/Parser.hs
bsd-3-clause
parseFormula :: [Token] -> Error (Formula String) parseFormula toks = case parse parseForm "PARSER" toks of Left err -> Failed $ show err Right formula -> Succeeded formula
176
parseFormula :: [Token] -> Error (Formula String) parseFormula toks = case parse parseForm "PARSER" toks of Left err -> Failed $ show err Right formula -> Succeeded formula
176
parseFormula toks = case parse parseForm "PARSER" toks of Left err -> Failed $ show err Right formula -> Succeeded formula
126
false
true
3
8
31
57
29
28
null
null
xJom/mbunit-v3
tools/Thrift/src/lib/hs/src/Thrift/Protocol.hs
apache-2.0
skip p T_I64 = readI64 p >> return ()
37
skip p T_I64 = readI64 p >> return ()
37
skip p T_I64 = readI64 p >> return ()
37
false
false
0
7
8
23
10
13
null
null
underhilllabs/project-euler-in-haskell
primes.hs
mit
mult3or5 :: Int -> Bool mult3or5 n | rem n 3 == 0 = True | rem n 5 == 0 = True | otherwise = False
123
mult3or5 :: Int -> Bool mult3or5 n | rem n 3 == 0 = True | rem n 5 == 0 = True | otherwise = False
123
mult3or5 n | rem n 3 == 0 = True | rem n 5 == 0 = True | otherwise = False
99
false
true
0
9
51
70
30
40
null
null
bitemyapp/serials
server/Serials/Model/Invite.hs
mit
codeIndex = Index codeIndexName
35
codeIndex = Index codeIndexName
35
codeIndex = Index codeIndexName
35
false
false
0
5
7
9
4
5
null
null
DougBurke/swish
tests/N3ParserTest.hs
lgpl-2.1
t1733 = arc s3 p3 lfrxml
24
t1733 = arc s3 p3 lfrxml
24
t1733 = arc s3 p3 lfrxml
24
false
false
1
5
5
19
6
13
null
null
green-haskell/ghc
libraries/base/GHC/List.hs
bsd-3-clause
init [x] = []
29
init [x] = []
29
init [x] = []
29
false
false
0
6
19
14
7
7
null
null
ingemaradahl/bilder
src/Compiler/SimpleInliner.hs
lgpl-3.0
simpleEnough _ _ = False
24
simpleEnough _ _ = False
24
simpleEnough _ _ = False
24
false
false
0
5
4
11
5
6
null
null
spacekitteh/compdata
src/Data/Comp/TermRewriting.hs
bsd-3-clause
{-| This function tries to match the given rule against the given term (resp. context in general) at the root. If successful, the function returns the right hand side of the rule and the matching substitution. -} matchRule :: (Ord v, EqF f, Eq a, Functor f, Foldable f) => Rule f g v -> Cxt h f a -> Maybe (Context g v, Map v (Cxt h f a)) matchRule (lhs,rhs) t = do subst <- matchCxt lhs t return (rhs,subst) -- | This function tries to match the rules of the given TRS against -- the given term (resp. context in general) at the root. The first -- rule in the TRS that matches is then used and the corresponding -- right-hand side as well the matching substitution is returned.
695
matchRule :: (Ord v, EqF f, Eq a, Functor f, Foldable f) => Rule f g v -> Cxt h f a -> Maybe (Context g v, Map v (Cxt h f a)) matchRule (lhs,rhs) t = do subst <- matchCxt lhs t return (rhs,subst) -- | This function tries to match the rules of the given TRS against -- the given term (resp. context in general) at the root. The first -- rule in the TRS that matches is then used and the corresponding -- right-hand side as well the matching substitution is returned.
481
matchRule (lhs,rhs) t = do subst <- matchCxt lhs t return (rhs,subst) -- | This function tries to match the rules of the given TRS against -- the given term (resp. context in general) at the root. The first -- rule in the TRS that matches is then used and the corresponding -- right-hand side as well the matching substitution is returned.
344
true
true
0
13
148
140
70
70
null
null
romanb/amazonka
amazonka-kms/gen/Network/AWS/KMS/ReEncrypt.hs
mpl-2.0
-- | 'ReEncrypt' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'reCiphertextBlob' @::@ 'Base64' -- -- * 'reDestinationEncryptionContext' @::@ 'HashMap' 'Text' 'Text' -- -- * 'reDestinationKeyId' @::@ 'Text' -- -- * 'reGrantTokens' @::@ ['Text'] -- -- * 'reSourceEncryptionContext' @::@ 'HashMap' 'Text' 'Text' -- reEncrypt :: Base64 -- ^ 'reCiphertextBlob' -> Text -- ^ 'reDestinationKeyId' -> ReEncrypt reEncrypt p1 p2 = ReEncrypt { _reCiphertextBlob = p1 , _reDestinationKeyId = p2 , _reSourceEncryptionContext = mempty , _reDestinationEncryptionContext = mempty , _reGrantTokens = mempty }
721
reEncrypt :: Base64 -- ^ 'reCiphertextBlob' -> Text -- ^ 'reDestinationKeyId' -> ReEncrypt reEncrypt p1 p2 = ReEncrypt { _reCiphertextBlob = p1 , _reDestinationKeyId = p2 , _reSourceEncryptionContext = mempty , _reDestinationEncryptionContext = mempty , _reGrantTokens = mempty }
371
reEncrypt p1 p2 = ReEncrypt { _reCiphertextBlob = p1 , _reDestinationKeyId = p2 , _reSourceEncryptionContext = mempty , _reDestinationEncryptionContext = mempty , _reGrantTokens = mempty }
260
true
true
0
6
178
72
49
23
null
null
Saulzar/reflex
src/Reflex/Class.hs
bsd-3-clause
-- | Filter 'Right's from 'f (Either a b)' into 'b'. filterRight :: Filterable f => f (Either a b) -> f b filterRight = mapMaybe (either (const Nothing) Just)
158
filterRight :: Filterable f => f (Either a b) -> f b filterRight = mapMaybe (either (const Nothing) Just)
105
filterRight = mapMaybe (either (const Nothing) Just)
52
true
true
0
10
29
60
27
33
null
null
csabahruska/quake3
game-engine/GameEngine/Loader/MD3.hs
bsd-3-clause
getLowerCaseString :: Int -> Get ByteString getLowerCaseString len = SB8.map toLower . SB8.takeWhile (/= '\0') <$> getByteString len
132
getLowerCaseString :: Int -> Get ByteString getLowerCaseString len = SB8.map toLower . SB8.takeWhile (/= '\0') <$> getByteString len
132
getLowerCaseString len = SB8.map toLower . SB8.takeWhile (/= '\0') <$> getByteString len
88
false
true
0
8
17
46
22
24
null
null
coubeatczech/product-profunctors
Data/Profunctor/Product/TH.hs
bsd-3-clause
xTuple :: ([Pat] -> Pat) -> ([Exp] -> Exp) -> (Name, Int) -> Dec xTuple patCon retCon (funN, numTyVars) = FunD funN [clause] where clause = Clause [pat] body [] pat = patCon varPats body = NormalB (retCon varExps) varPats = map varPS (allTyVars numTyVars) varExps = map varS (allTyVars numTyVars)
330
xTuple :: ([Pat] -> Pat) -> ([Exp] -> Exp) -> (Name, Int) -> Dec xTuple patCon retCon (funN, numTyVars) = FunD funN [clause] where clause = Clause [pat] body [] pat = patCon varPats body = NormalB (retCon varExps) varPats = map varPS (allTyVars numTyVars) varExps = map varS (allTyVars numTyVars)
330
xTuple patCon retCon (funN, numTyVars) = FunD funN [clause] where clause = Clause [pat] body [] pat = patCon varPats body = NormalB (retCon varExps) varPats = map varPS (allTyVars numTyVars) varExps = map varS (allTyVars numTyVars)
265
false
true
4
9
84
144
76
68
null
null
baldo/derive-trie
src/Data/KeyMap.hs
bsd-3-clause
just :: a -> Maybe a just = (Just $!)
37
just :: a -> Maybe a just = (Just $!)
37
just = (Just $!)
16
false
true
0
6
9
22
12
10
null
null
hvr/containers
Data/Set/Base.hs
bsd-3-clause
-- | /O(log n)/. Performs a 'split' but also returns whether the pivot -- element was found in the original set. splitMember :: Ord a => a -> Set a -> (Set a,Bool,Set a) splitMember _ Tip = (Tip, False, Tip)
207
splitMember :: Ord a => a -> Set a -> (Set a,Bool,Set a) splitMember _ Tip = (Tip, False, Tip)
94
splitMember _ Tip = (Tip, False, Tip)
37
true
true
0
9
40
60
32
28
null
null
TomMD/ghc
compiler/types/CoAxiom.hs
bsd-3-clause
toBranchedAxiom :: CoAxiom br -> CoAxiom Branched toBranchedAxiom (CoAxiom unique name role tc branches implicit) = CoAxiom unique name role tc (toBranchedList branches) implicit
180
toBranchedAxiom :: CoAxiom br -> CoAxiom Branched toBranchedAxiom (CoAxiom unique name role tc branches implicit) = CoAxiom unique name role tc (toBranchedList branches) implicit
180
toBranchedAxiom (CoAxiom unique name role tc branches implicit) = CoAxiom unique name role tc (toBranchedList branches) implicit
130
false
true
0
7
25
59
28
31
null
null
badi/super-user-spark
src/Constants.hs
mit
blockCommentStrs :: (String, String) blockCommentStrs = ("[[", "]]")
68
blockCommentStrs :: (String, String) blockCommentStrs = ("[[", "]]")
68
blockCommentStrs = ("[[", "]]")
31
false
true
0
5
7
23
14
9
null
null
m3mitsuppe/haskell
exercises/Programming Haskell Book Exercises.hsproj/Ch_09_zip.hs
unlicense
myzip (a:as) (b:bs) = (a, b) : myzip as bs
42
myzip (a:as) (b:bs) = (a, b) : myzip as bs
42
myzip (a:as) (b:bs) = (a, b) : myzip as bs
42
false
false
0
7
9
40
21
19
null
null
Polybulle/reedsolomon
src/Poly.hs
bsd-3-clause
modP :: (Fractional a, Eq a) => Poly a -> Poly a -> Poly a modP poly base = snd $ divEucl poly base
99
modP :: (Fractional a, Eq a) => Poly a -> Poly a -> Poly a modP poly base = snd $ divEucl poly base
99
modP poly base = snd $ divEucl poly base
40
false
true
0
8
23
61
28
33
null
null
robstewart57/ripl
src/AstMappings.hs
bsd-3-clause
dimensionFromTuple e _ = error ("not a tuple: " ++ show e)
58
dimensionFromTuple e _ = error ("not a tuple: " ++ show e)
58
dimensionFromTuple e _ = error ("not a tuple: " ++ show e)
58
false
false
0
8
11
24
11
13
null
null
hengchu/CoreLang
CoreLang/TInst.hs
mit
showState :: TiState -> Iseq showState (stack, dump, heap, globals, stats) = iConcat [ showStack heap stack, iNewline, showHeap heap ]
148
showState :: TiState -> Iseq showState (stack, dump, heap, globals, stats) = iConcat [ showStack heap stack, iNewline, showHeap heap ]
148
showState (stack, dump, heap, globals, stats) = iConcat [ showStack heap stack, iNewline, showHeap heap ]
119
false
true
0
8
34
59
30
29
null
null
m4lvin/HasCacBDD
Setup.hs
gpl-2.0
main :: IO () main = defaultMainWithHooks simpleUserHooks { preConf = makeExtLib , confHook = \a f -> confHook simpleUserHooks a f >>= updateExtraLibDirs , postConf = disablePostConfHooks -- seems crucial to not reset extraLibDir , preBuild = updateLibDirs , postCopy = copyExtLib , postClean = cleanExtLib }
326
main :: IO () main = defaultMainWithHooks simpleUserHooks { preConf = makeExtLib , confHook = \a f -> confHook simpleUserHooks a f >>= updateExtraLibDirs , postConf = disablePostConfHooks -- seems crucial to not reset extraLibDir , preBuild = updateLibDirs , postCopy = copyExtLib , postClean = cleanExtLib }
326
main = defaultMainWithHooks simpleUserHooks { preConf = makeExtLib , confHook = \a f -> confHook simpleUserHooks a f >>= updateExtraLibDirs , postConf = disablePostConfHooks -- seems crucial to not reset extraLibDir , preBuild = updateLibDirs , postCopy = copyExtLib , postClean = cleanExtLib }
312
false
true
0
10
65
80
45
35
null
null
ekmett/reactive
src/FRP/Reactive/Internal/Chan.hs
agpl-3.0
---- New bit: -- | A weak channel writer. Sustained by the read head. Thus channel -- consumers keep channel producers alive. weakChanWriter :: Chan a -> IO (IO (Maybe (a -> IO ()))) weakChanWriter ch@(Chan readVar _) = fmap deRefWeak (mkWeak readVar (writeChan ch) Nothing)
279
weakChanWriter :: Chan a -> IO (IO (Maybe (a -> IO ()))) weakChanWriter ch@(Chan readVar _) = fmap deRefWeak (mkWeak readVar (writeChan ch) Nothing)
150
weakChanWriter ch@(Chan readVar _) = fmap deRefWeak (mkWeak readVar (writeChan ch) Nothing)
93
true
true
1
14
50
93
43
50
null
null
alanz/Blobs
src/Graphics/Blobs/Colors.hs
lgpl-2.1
systemGrey :: Color -- wx type systemGrey = colorSystem Color3DFace
67
systemGrey :: Color systemGrey = colorSystem Color3DFace
56
systemGrey = colorSystem Color3DFace
36
true
true
0
6
9
22
9
13
null
null
olsner/ghc
compiler/ghci/ByteCodeGen.hs
bsd-3-clause
findPushSeq (P: P: P: P: P: rest) = (PUSH_APPLY_PPPPP, 5, rest)
65
findPushSeq (P: P: P: P: P: rest) = (PUSH_APPLY_PPPPP, 5, rest)
65
findPushSeq (P: P: P: P: P: rest) = (PUSH_APPLY_PPPPP, 5, rest)
65
false
false
0
11
12
41
22
19
null
null
fpco/schoolofhaskell.com
src/Azure/BlobStorage.hs
mit
extractBlobIDs :: MonadThrow m => Conduit XML.Event m BlobID extractBlobIDs = lookForBlobTag where lookForBlobTag = do x <- await case x of Just (XML.EventBeginElement "Blob" _) -> extractBlobName Just _ -> lookForBlobTag Nothing -> return () extractBlobName = do x <- await case x of Just (XML.EventBeginElement "Name" _) -> do yield =<< fmap BlobID XML.content lookForEndTag Just (XML.EventEndElement "Blob") -> lookForBlobTag Just _ -> extractBlobName Nothing -> return () lookForEndTag = do x <- await case x of Just (XML.EventEndElement "Blob") -> lookForBlobTag Just _ -> lookForEndTag Nothing -> return ()
762
extractBlobIDs :: MonadThrow m => Conduit XML.Event m BlobID extractBlobIDs = lookForBlobTag where lookForBlobTag = do x <- await case x of Just (XML.EventBeginElement "Blob" _) -> extractBlobName Just _ -> lookForBlobTag Nothing -> return () extractBlobName = do x <- await case x of Just (XML.EventBeginElement "Name" _) -> do yield =<< fmap BlobID XML.content lookForEndTag Just (XML.EventEndElement "Blob") -> lookForBlobTag Just _ -> extractBlobName Nothing -> return () lookForEndTag = do x <- await case x of Just (XML.EventEndElement "Blob") -> lookForBlobTag Just _ -> lookForEndTag Nothing -> return ()
762
extractBlobIDs = lookForBlobTag where lookForBlobTag = do x <- await case x of Just (XML.EventBeginElement "Blob" _) -> extractBlobName Just _ -> lookForBlobTag Nothing -> return () extractBlobName = do x <- await case x of Just (XML.EventBeginElement "Name" _) -> do yield =<< fmap BlobID XML.content lookForEndTag Just (XML.EventEndElement "Blob") -> lookForBlobTag Just _ -> extractBlobName Nothing -> return () lookForEndTag = do x <- await case x of Just (XML.EventEndElement "Blob") -> lookForBlobTag Just _ -> lookForEndTag Nothing -> return ()
701
false
true
0
14
241
236
109
127
null
null
sdiehl/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
-- | Access the 'EvBindsVar' carried by the 'TcPluginM' during -- constraint solving. Returns 'Nothing' if invoked during -- 'tcPluginInit' or 'tcPluginStop'. getEvBindsTcPluginM :: TcPluginM EvBindsVar getEvBindsTcPluginM = TcPluginM return
242
getEvBindsTcPluginM :: TcPluginM EvBindsVar getEvBindsTcPluginM = TcPluginM return
82
getEvBindsTcPluginM = TcPluginM return
38
true
true
0
5
30
20
11
9
null
null
oden-lang/oden
src/Oden/Type/Traversal.hs
mit
traverseType :: Monad m => (Type -> m Type) -> Type -> m Type traverseType onType' type' = do let recurse = traverseType onType' case type' of t@TVar{} -> onType' t TTuple si f s r -> TTuple si <$> recurse f <*> recurse s <*> mapM recurse r >>= onType' TApp si f p -> TApp si <$> recurse f <*> recurse p >>= onType' TFn si p r -> TFn si <$> recurse p <*> recurse r >>= onType' TNoArgFn si r -> TNoArgFn si <$> recurse r >>= onType' t@TCon{} -> onType' t TSlice si t -> TSlice si <$> recurse t >>= onType' TRecord si fs -> TRecord si <$> recurse fs >>= onType' TNamed si n t -> TNamed si n <$> recurse t >>= onType' TConstrained cs t -> TConstrained cs <$> recurse t >>= onType' t@REmpty{} -> onType' t RExtension si l t r -> RExtension si l <$> recurse t <*> recurse r >>= onType' TForeignFn si v p r -> TForeignFn si v <$> mapM recurse p <*> mapM recurse r >>= onType'
1,037
traverseType :: Monad m => (Type -> m Type) -> Type -> m Type traverseType onType' type' = do let recurse = traverseType onType' case type' of t@TVar{} -> onType' t TTuple si f s r -> TTuple si <$> recurse f <*> recurse s <*> mapM recurse r >>= onType' TApp si f p -> TApp si <$> recurse f <*> recurse p >>= onType' TFn si p r -> TFn si <$> recurse p <*> recurse r >>= onType' TNoArgFn si r -> TNoArgFn si <$> recurse r >>= onType' t@TCon{} -> onType' t TSlice si t -> TSlice si <$> recurse t >>= onType' TRecord si fs -> TRecord si <$> recurse fs >>= onType' TNamed si n t -> TNamed si n <$> recurse t >>= onType' TConstrained cs t -> TConstrained cs <$> recurse t >>= onType' t@REmpty{} -> onType' t RExtension si l t r -> RExtension si l <$> recurse t <*> recurse r >>= onType' TForeignFn si v p r -> TForeignFn si v <$> mapM recurse p <*> mapM recurse r >>= onType'
1,037
traverseType onType' type' = do let recurse = traverseType onType' case type' of t@TVar{} -> onType' t TTuple si f s r -> TTuple si <$> recurse f <*> recurse s <*> mapM recurse r >>= onType' TApp si f p -> TApp si <$> recurse f <*> recurse p >>= onType' TFn si p r -> TFn si <$> recurse p <*> recurse r >>= onType' TNoArgFn si r -> TNoArgFn si <$> recurse r >>= onType' t@TCon{} -> onType' t TSlice si t -> TSlice si <$> recurse t >>= onType' TRecord si fs -> TRecord si <$> recurse fs >>= onType' TNamed si n t -> TNamed si n <$> recurse t >>= onType' TConstrained cs t -> TConstrained cs <$> recurse t >>= onType' t@REmpty{} -> onType' t RExtension si l t r -> RExtension si l <$> recurse t <*> recurse r >>= onType' TForeignFn si v p r -> TForeignFn si v <$> mapM recurse p <*> mapM recurse r >>= onType'
936
false
true
0
15
349
439
197
242
null
null
ksaveljev/hake-2
src/Constants.hs
bsd-3-clause
teExplosion1Np = 54 :: Int
30
teExplosion1Np = 54 :: Int
30
teExplosion1Np = 54 :: Int
30
false
false
0
4
8
9
5
4
null
null
kristoff3r/importify
HLint.hs
mit
warn = (m >>= \case Left _ -> return (); Right x -> f x) ==> Universum.whenRightM m f
85
warn = (m >>= \case Left _ -> return (); Right x -> f x) ==> Universum.whenRightM m f
85
warn = (m >>= \case Left _ -> return (); Right x -> f x) ==> Universum.whenRightM m f
85
false
false
0
12
18
53
25
28
null
null
qmenoret/gitlab-report-generator
src/json-parser/Task.hs
bsd-3-clause
getComparators :: [String] -> [(Task -> Task -> Ordering)] getComparators = map getComparator
93
getComparators :: [String] -> [(Task -> Task -> Ordering)] getComparators = map getComparator
93
getComparators = map getComparator
34
false
true
0
9
12
35
19
16
null
null
acowley/ghc
compiler/utils/Outputable.hs
bsd-3-clause
lparen, rparen, lbrack, rbrack, lbrace, rbrace, blankLine :: SDoc blankLine = docToSDoc $ Pretty.ptext (sLit "")
114
lparen, rparen, lbrack, rbrack, lbrace, rbrace, blankLine :: SDoc blankLine = docToSDoc $ Pretty.ptext (sLit "")
113
blankLine = docToSDoc $ Pretty.ptext (sLit "")
47
false
true
2
8
17
42
25
17
null
null
robeverest/accelerate
Data/Array/Accelerate/Language.hs
bsd-3-clause
-- | Map a multi-dimensional index into a linear, row-major representation of an -- array. The first argument is the array shape, the second is the index. -- toIndex :: Shape sh => Exp sh -> Exp sh -> Exp Int toIndex = Exp $$ ToIndex
233
toIndex :: Shape sh => Exp sh -> Exp sh -> Exp Int toIndex = Exp $$ ToIndex
75
toIndex = Exp $$ ToIndex
24
true
true
0
8
45
42
21
21
null
null
chengzh2008/hpffp
src/ch19-ApplyingStructure/shawty/src/Lib.hs
bsd-3-clause
shortyGen :: IO [Char] shortyGen = replicateM 7 (randomElement alphaNum)
72
shortyGen :: IO [Char] shortyGen = replicateM 7 (randomElement alphaNum)
72
shortyGen = replicateM 7 (randomElement alphaNum)
49
false
true
0
7
9
28
14
14
null
null
peter-fogg/pardoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
inBrackets :: Inlines -> Inlines inBrackets x = (str "[") <> x <> (str "]")
75
inBrackets :: Inlines -> Inlines inBrackets x = (str "[") <> x <> (str "]")
75
inBrackets x = (str "[") <> x <> (str "]")
42
false
true
0
8
14
38
19
19
null
null
yiannist/ganeti
src/Ganeti/JSON.hs
bsd-2-clause
getMaybeJsonElem (_:xs) n f | n < 0 = J.JSNull | otherwise = getMaybeJsonElem xs (n - 1) f
94
getMaybeJsonElem (_:xs) n f | n < 0 = J.JSNull | otherwise = getMaybeJsonElem xs (n - 1) f
94
getMaybeJsonElem (_:xs) n f | n < 0 = J.JSNull | otherwise = getMaybeJsonElem xs (n - 1) f
94
false
false
1
8
22
53
26
27
null
null
fmapfmapfmap/amazonka
amazonka-glacier/test/Test/AWS/Gen/Glacier.hs
mpl-2.0
testCompleteMultipartUploadResponse :: ArchiveCreationOutput -> TestTree testCompleteMultipartUploadResponse = res "CompleteMultipartUploadResponse" "fixture/CompleteMultipartUploadResponse.proto" glacier (Proxy :: Proxy CompleteMultipartUpload)
261
testCompleteMultipartUploadResponse :: ArchiveCreationOutput -> TestTree testCompleteMultipartUploadResponse = res "CompleteMultipartUploadResponse" "fixture/CompleteMultipartUploadResponse.proto" glacier (Proxy :: Proxy CompleteMultipartUpload)
261
testCompleteMultipartUploadResponse = res "CompleteMultipartUploadResponse" "fixture/CompleteMultipartUploadResponse.proto" glacier (Proxy :: Proxy CompleteMultipartUpload)
188
false
true
0
6
30
36
17
19
null
null
benjaminy/Charcoal
Testing/MicroTests/JustCalling/non_rec.hs
mit
a = a `seq` b `seq` f02 b
25
a = a `seq` b `seq` f02 b
25
a = a `seq` b `seq` f02 b
25
false
false
2
4
7
20
10
10
null
null
bitemyapp/tandoori
src/Tandoori/GHC/Parse.hs
bsd-3-clause
getDecls mod = hsmodDecls $ unLoc mod
37
getDecls mod = hsmodDecls $ unLoc mod
37
getDecls mod = hsmodDecls $ unLoc mod
37
false
false
0
6
6
16
7
9
null
null
nushio3/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
isRhoTy (ForAllTy (Named {}) _) = False
39
isRhoTy (ForAllTy (Named {}) _) = False
39
isRhoTy (ForAllTy (Named {}) _) = False
39
false
false
0
8
6
25
12
13
null
null
dmcclean/HPi
System/RaspberryPi/GPIO.hs
bsd-3-clause
getHwPin PinV1_22 = 25
22
getHwPin PinV1_22 = 25
22
getHwPin PinV1_22 = 25
22
false
false
0
5
3
9
4
5
null
null
edgarklerks/dotfiles
.xmonad/TopicMachine.hs
bsd-2-clause
handleOpcode Add ms = handleNOp "add" (+) (+) ms
48
handleOpcode Add ms = handleNOp "add" (+) (+) ms
48
handleOpcode Add ms = handleNOp "add" (+) (+) ms
48
false
false
1
5
8
30
13
17
null
null
Zigazou/containers
Data/Set/Base.hs
bsd-3-clause
-- | /O(n)/. Convert the set to a descending list of elements. Subject to list -- fusion. toDescList :: Set a -> [a] toDescList = foldl (flip (:)) []
149
toDescList :: Set a -> [a] toDescList = foldl (flip (:)) []
59
toDescList = foldl (flip (:)) []
32
true
true
0
7
28
38
21
17
null
null