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
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Rust.hs
gpl-2.0
-- | Full name of language. syntaxName :: String syntaxName = "Rust"
68
syntaxName :: String syntaxName = "Rust"
40
syntaxName = "Rust"
19
true
true
0
4
11
12
7
5
null
null
rueshyna/gogol
gogol-admin-directory/gen/Network/Google/Resource/Directory/DomainAliases/Delete.hs
mpl-2.0
-- | Name of domain alias to be retrieved. dadDomainAliasName :: Lens' DomainAliasesDelete Text dadDomainAliasName = lens _dadDomainAliasName (\ s a -> s{_dadDomainAliasName = a})
187
dadDomainAliasName :: Lens' DomainAliasesDelete Text dadDomainAliasName = lens _dadDomainAliasName (\ s a -> s{_dadDomainAliasName = a})
144
dadDomainAliasName = lens _dadDomainAliasName (\ s a -> s{_dadDomainAliasName = a})
91
true
true
0
9
32
42
22
20
null
null
drhodes/HsQML
src/Graphics/QML/Engine.hs
bsd-3-clause
getWindowTitle _ = Nothing
26
getWindowTitle _ = Nothing
26
getWindowTitle _ = Nothing
26
false
false
0
5
3
9
4
5
null
null
prt2121/haskell-practice
hb-chap04/src/Main.hs
apache-2.0
fst' (a, b) = a
15
fst' (a, b) = a
15
fst' (a, b) = a
15
false
false
0
5
4
16
8
8
null
null
fmapfmapfmap/amazonka
amazonka-cloudsearch/gen/Network/AWS/CloudSearch/Types/Product.hs
mpl-2.0
-- | Undocumented member. toSourceField :: Lens' TextOptions (Maybe Text) toSourceField = lens _toSourceField (\ s a -> s{_toSourceField = a})
142
toSourceField :: Lens' TextOptions (Maybe Text) toSourceField = lens _toSourceField (\ s a -> s{_toSourceField = a})
116
toSourceField = lens _toSourceField (\ s a -> s{_toSourceField = a})
68
true
true
0
9
20
46
25
21
null
null
janrain/heist
src/Text/Templating/Heist/Splices/Markdown.hs
bsd-3-clause
pandoc :: FilePath -> FilePath -> IO ByteString pandoc pandocPath inputFile = do (ex, sout, serr) <- readProcessWithExitCode' pandocPath args "" when (isFail ex) $ throw $ MarkdownException serr return $ BC.concat [ "<div class=\"markdown\">\n" , sout , "\n</div>" ] where isFail ExitSuccess = False isFail _ = True -- FIXME: hardcoded path args = [ "-S", "--no-wrap", "templates/"++inputFile ]
483
pandoc :: FilePath -> FilePath -> IO ByteString pandoc pandocPath inputFile = do (ex, sout, serr) <- readProcessWithExitCode' pandocPath args "" when (isFail ex) $ throw $ MarkdownException serr return $ BC.concat [ "<div class=\"markdown\">\n" , sout , "\n</div>" ] where isFail ExitSuccess = False isFail _ = True -- FIXME: hardcoded path args = [ "-S", "--no-wrap", "templates/"++inputFile ]
483
pandoc pandocPath inputFile = do (ex, sout, serr) <- readProcessWithExitCode' pandocPath args "" when (isFail ex) $ throw $ MarkdownException serr return $ BC.concat [ "<div class=\"markdown\">\n" , sout , "\n</div>" ] where isFail ExitSuccess = False isFail _ = True -- FIXME: hardcoded path args = [ "-S", "--no-wrap", "templates/"++inputFile ]
435
false
true
0
11
148
133
67
66
null
null
kik/ToyPr
src/Parser/Token.hs
apache-2.0
opMapsTo :: Parsec String () () opMapsTo = P.reservedOp toyprToken "=>"
71
opMapsTo :: Parsec String () () opMapsTo = P.reservedOp toyprToken "=>"
71
opMapsTo = P.reservedOp toyprToken "=>"
39
false
true
0
6
10
29
14
15
null
null
massudaw/mtk
Solver/RungeKutta.hs
bsd-3-clause
r1_bs = [2%9, 1%3, 4%9]
23
r1_bs = [2%9, 1%3, 4%9]
23
r1_bs = [2%9, 1%3, 4%9]
23
false
false
0
6
4
27
15
12
null
null
tomberek/rulestesting
Arrow.hs
bsd-3-clause
normalize :: (MonadFix m,Functor m) => Arr f m a b -> Arr f m a b normalize = everywhere norm
93
normalize :: (MonadFix m,Functor m) => Arr f m a b -> Arr f m a b normalize = everywhere norm
93
normalize = everywhere norm
27
false
true
0
8
20
57
26
31
null
null
Heather/Idris-dev
src/Idris/IdrisDoc.hs
bsd-3-clause
extractPTactic (LetTacTy n p1 p2) = n : concatMap extract [p1, p2]
66
extractPTactic (LetTacTy n p1 p2) = n : concatMap extract [p1, p2]
66
extractPTactic (LetTacTy n p1 p2) = n : concatMap extract [p1, p2]
66
false
false
0
7
11
35
17
18
null
null
mstksg/hledger
hledger-ui/Hledger/UI/UIUtils.hs
gpl-3.0
borderKeysStr' :: [(String,Widget Name)] -> Widget Name borderKeysStr' keydescs = hBox $ intersperse sep $ [withAttr (borderAttr <> "keys") (str keys) <+> str ":" <+> desc | (keys, desc) <- keydescs] where -- sep = str " | " sep = str " " -- temporary shenanigans: -- | Convert the special account name "*" (from balance report with depth limit 0) to something clearer.
387
borderKeysStr' :: [(String,Widget Name)] -> Widget Name borderKeysStr' keydescs = hBox $ intersperse sep $ [withAttr (borderAttr <> "keys") (str keys) <+> str ":" <+> desc | (keys, desc) <- keydescs] where -- sep = str " | " sep = str " " -- temporary shenanigans: -- | Convert the special account name "*" (from balance report with depth limit 0) to something clearer.
387
borderKeysStr' keydescs = hBox $ intersperse sep $ [withAttr (borderAttr <> "keys") (str keys) <+> str ":" <+> desc | (keys, desc) <- keydescs] where -- sep = str " | " sep = str " " -- temporary shenanigans: -- | Convert the special account name "*" (from balance report with depth limit 0) to something clearer.
331
false
true
7
10
82
109
54
55
null
null
VinylRecords/Vinyl
tests/Aeson.hs
mit
keyFromText :: Text -> Key keyFromText = Key.fromText
53
keyFromText :: Text -> Key keyFromText = Key.fromText
53
keyFromText = Key.fromText
26
false
true
0
5
7
17
9
8
null
null
fmapfmapfmap/amazonka
amazonka-ml/gen/Network/AWS/MachineLearning/Types/Product.hs
mpl-2.0
-- | Creates a value of 'RDSDataSpec' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'rdsdsDataSchemaURI' -- -- * 'rdsdsDataSchema' -- -- * 'rdsdsDataRearrangement' -- -- * 'rdsdsDatabaseInformation' -- -- * 'rdsdsSelectSqlQuery' -- -- * 'rdsdsDatabaseCredentials' -- -- * 'rdsdsS3StagingLocation' -- -- * 'rdsdsResourceRole' -- -- * 'rdsdsServiceRole' -- -- * 'rdsdsSubnetId' -- -- * 'rdsdsSecurityGroupIds' rdsDataSpec :: RDSDatabase -- ^ 'rdsdsDatabaseInformation' -> Text -- ^ 'rdsdsSelectSqlQuery' -> RDSDatabaseCredentials -- ^ 'rdsdsDatabaseCredentials' -> Text -- ^ 'rdsdsS3StagingLocation' -> Text -- ^ 'rdsdsResourceRole' -> Text -- ^ 'rdsdsServiceRole' -> Text -- ^ 'rdsdsSubnetId' -> RDSDataSpec rdsDataSpec pDatabaseInformation_ pSelectSqlQuery_ pDatabaseCredentials_ pS3StagingLocation_ pResourceRole_ pServiceRole_ pSubnetId_ = RDSDataSpec' { _rdsdsDataSchemaURI = Nothing , _rdsdsDataSchema = Nothing , _rdsdsDataRearrangement = Nothing , _rdsdsDatabaseInformation = pDatabaseInformation_ , _rdsdsSelectSqlQuery = pSelectSqlQuery_ , _rdsdsDatabaseCredentials = pDatabaseCredentials_ , _rdsdsS3StagingLocation = pS3StagingLocation_ , _rdsdsResourceRole = pResourceRole_ , _rdsdsServiceRole = pServiceRole_ , _rdsdsSubnetId = pSubnetId_ , _rdsdsSecurityGroupIds = mempty }
1,456
rdsDataSpec :: RDSDatabase -- ^ 'rdsdsDatabaseInformation' -> Text -- ^ 'rdsdsSelectSqlQuery' -> RDSDatabaseCredentials -- ^ 'rdsdsDatabaseCredentials' -> Text -- ^ 'rdsdsS3StagingLocation' -> Text -- ^ 'rdsdsResourceRole' -> Text -- ^ 'rdsdsServiceRole' -> Text -- ^ 'rdsdsSubnetId' -> RDSDataSpec rdsDataSpec pDatabaseInformation_ pSelectSqlQuery_ pDatabaseCredentials_ pS3StagingLocation_ pResourceRole_ pServiceRole_ pSubnetId_ = RDSDataSpec' { _rdsdsDataSchemaURI = Nothing , _rdsdsDataSchema = Nothing , _rdsdsDataRearrangement = Nothing , _rdsdsDatabaseInformation = pDatabaseInformation_ , _rdsdsSelectSqlQuery = pSelectSqlQuery_ , _rdsdsDatabaseCredentials = pDatabaseCredentials_ , _rdsdsS3StagingLocation = pS3StagingLocation_ , _rdsdsResourceRole = pResourceRole_ , _rdsdsServiceRole = pServiceRole_ , _rdsdsSubnetId = pSubnetId_ , _rdsdsSecurityGroupIds = mempty }
961
rdsDataSpec pDatabaseInformation_ pSelectSqlQuery_ pDatabaseCredentials_ pS3StagingLocation_ pResourceRole_ pServiceRole_ pSubnetId_ = RDSDataSpec' { _rdsdsDataSchemaURI = Nothing , _rdsdsDataSchema = Nothing , _rdsdsDataRearrangement = Nothing , _rdsdsDatabaseInformation = pDatabaseInformation_ , _rdsdsSelectSqlQuery = pSelectSqlQuery_ , _rdsdsDatabaseCredentials = pDatabaseCredentials_ , _rdsdsS3StagingLocation = pS3StagingLocation_ , _rdsdsResourceRole = pResourceRole_ , _rdsdsServiceRole = pServiceRole_ , _rdsdsSubnetId = pSubnetId_ , _rdsdsSecurityGroupIds = mempty }
630
true
true
0
13
250
163
106
57
null
null
masaedw/Yiki
Model/Accessor.hs
bsd-2-clause
numOfPages = do Yesod.count ([] :: [Filter YikiPage])
55
numOfPages = do Yesod.count ([] :: [Filter YikiPage])
55
numOfPages = do Yesod.count ([] :: [Filter YikiPage])
55
false
false
1
11
9
32
14
18
null
null
ezyang/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
ctEvOrigin :: CtEvidence -> CtOrigin ctEvOrigin = ctLocOrigin . ctEvLoc
71
ctEvOrigin :: CtEvidence -> CtOrigin ctEvOrigin = ctLocOrigin . ctEvLoc
71
ctEvOrigin = ctLocOrigin . ctEvLoc
34
false
true
1
7
9
27
11
16
null
null
a143753/AOJ
0140.hs
apache-2.0
q = [ 6, 7, 8, 9, 5, 4, 3, 2, 1, 0 ]
36
q = [ 6, 7, 8, 9, 5, 4, 3, 2, 1, 0 ]
36
q = [ 6, 7, 8, 9, 5, 4, 3, 2, 1, 0 ]
36
false
false
1
5
13
39
23
16
null
null
ocharles/hackage-server
Distribution/Server/Framework/MemSize.hs
bsd-3-clause
memSize10 :: (MemSize a9, MemSize a8, MemSize a7, MemSize a6, MemSize a5, MemSize a4, MemSize a3, MemSize a2, MemSize a1, MemSize a) => a -> a1 -> a2 -> a3 -> a4 -> a5 -> a6 -> a7 -> a8 -> a9 -> Int memSize0 = 0
225
memSize10 :: (MemSize a9, MemSize a8, MemSize a7, MemSize a6, MemSize a5, MemSize a4, MemSize a3, MemSize a2, MemSize a1, MemSize a) => a -> a1 -> a2 -> a3 -> a4 -> a5 -> a6 -> a7 -> a8 -> a9 -> Int memSize0 = 0
223
memSize0 = 0
24
false
true
0
15
60
114
58
56
null
null
AndrewRademacher/hs-ebay-trading
src/Ebay/Types.hs
mit
parseSiteId 16 = AT
24
parseSiteId 16 = AT
24
parseSiteId 16 = AT
24
false
false
0
5
8
9
4
5
null
null
vTurbine/ghc
compiler/main/DynFlags.hs
bsd-3-clause
-- ----------------------------------------------------------------------------- -- RTS hooks -- Convert sizes like "3.5M" into integers decodeSize :: String -> Integer decodeSize str | c == "" = truncate n | c == "K" || c == "k" = truncate (n * 1000) | c == "M" || c == "m" = truncate (n * 1000 * 1000) | c == "G" || c == "g" = truncate (n * 1000 * 1000 * 1000) | otherwise = throwGhcException (CmdLineError ("can't decode size: " ++ str)) where (m, c) = span pred str n = readRational m pred c = isDigit c || c == '.'
569
decodeSize :: String -> Integer decodeSize str | c == "" = truncate n | c == "K" || c == "k" = truncate (n * 1000) | c == "M" || c == "m" = truncate (n * 1000 * 1000) | c == "G" || c == "g" = truncate (n * 1000 * 1000 * 1000) | otherwise = throwGhcException (CmdLineError ("can't decode size: " ++ str)) where (m, c) = span pred str n = readRational m pred c = isDigit c || c == '.'
431
decodeSize str | c == "" = truncate n | c == "K" || c == "k" = truncate (n * 1000) | c == "M" || c == "m" = truncate (n * 1000 * 1000) | c == "G" || c == "g" = truncate (n * 1000 * 1000 * 1000) | otherwise = throwGhcException (CmdLineError ("can't decode size: " ++ str)) where (m, c) = span pred str n = readRational m pred c = isDigit c || c == '.'
399
true
true
3
10
151
214
106
108
null
null
urv/fixhs
src/Data/FIX/Spec/FIX40.hs
lgpl-2.1
tListSeqNo :: FIXTag tListSeqNo = FIXTag { tName = "ListSeqNo" , tnum = 67 , tparser = toFIXInt , arbitraryValue = FIXInt <$> arbitrary }
150
tListSeqNo :: FIXTag tListSeqNo = FIXTag { tName = "ListSeqNo" , tnum = 67 , tparser = toFIXInt , arbitraryValue = FIXInt <$> arbitrary }
150
tListSeqNo = FIXTag { tName = "ListSeqNo" , tnum = 67 , tparser = toFIXInt , arbitraryValue = FIXInt <$> arbitrary }
129
false
true
0
8
37
51
27
24
null
null
alldne/scheme
src/Language/Scheme/Types.hs
bsd-3-clause
showError (BadSpecialForm message form) = message ++ ": " ++ show form
70
showError (BadSpecialForm message form) = message ++ ": " ++ show form
70
showError (BadSpecialForm message form) = message ++ ": " ++ show form
70
false
false
0
7
11
28
13
15
null
null
pbl64k/CodeSprints
CodeSprint-2012-05-12-Interviewstreet/Complexity/c.accepted.hs
bsd-2-clause
x_addsub '+' = XAdd
19
x_addsub '+' = XAdd
19
x_addsub '+' = XAdd
19
false
false
0
5
3
9
4
5
null
null
CrazyMerlyn/99problems-haskell
46-50.hs
mit
huffman :: [(Char, Int)] -> [(Char, String)] huffman freqs = let tree = huffmanTree freqs in [(c, getCode tree c)| (c,n)<- freqs]
129
huffman :: [(Char, Int)] -> [(Char, String)] huffman freqs = let tree = huffmanTree freqs in [(c, getCode tree c)| (c,n)<- freqs]
129
huffman freqs = let tree = huffmanTree freqs in [(c, getCode tree c)| (c,n)<- freqs]
84
false
true
0
10
21
78
43
35
null
null
brendanhay/gogol
gogol-cloudsearch/gen/Network/Google/CloudSearch/Types/Product.hs
mpl-2.0
-- | Creates a value of 'ListOperationsResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'lorNextPageToken' -- -- * 'lorOperations' listOperationsResponse :: ListOperationsResponse listOperationsResponse = ListOperationsResponse' {_lorNextPageToken = Nothing, _lorOperations = Nothing}
388
listOperationsResponse :: ListOperationsResponse listOperationsResponse = ListOperationsResponse' {_lorNextPageToken = Nothing, _lorOperations = Nothing}
163
listOperationsResponse = ListOperationsResponse' {_lorNextPageToken = Nothing, _lorOperations = Nothing}
110
true
true
0
7
59
42
24
18
null
null
jystic/QuickSpec
qs1/Examples.hs
bsd-3-clause
peeklM, peekrM :: QueueM Elem peeklM = gets peekl
49
peeklM, peekrM :: QueueM Elem peeklM = gets peekl
49
peeklM = gets peekl
19
false
true
2
6
8
29
11
18
null
null
akegalj/yesod-example
devel.hs
bsd-2-clause
main :: IO () main = do putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings defaultSettings { settingsPort = port } app loop
196
main :: IO () main = do putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings defaultSettings { settingsPort = port } app loop
196
main = do putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings defaultSettings { settingsPort = port } app loop
182
false
true
0
10
57
58
28
30
null
null
kolmodin/cabal
cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs
bsd-3-clause
projectConfigConstraintSource :: ConstraintSource projectConfigConstraintSource = ConstraintSourceProjectConfig "TODO"
123
projectConfigConstraintSource :: ConstraintSource projectConfigConstraintSource = ConstraintSourceProjectConfig "TODO"
123
projectConfigConstraintSource = ConstraintSourceProjectConfig "TODO"
73
false
true
0
5
11
14
7
7
null
null
edi-smoljan/FER-PUH-2014-Hash
Hash.hs
bsd-3-clause
runInteractive :: IO () runInteractive = do currDir <- getCurrentDirectory let ss = ScriptState "" currDir $ M.fromList [("HOME", currDir)] runInteractiveIter command_tb ss return ()
190
runInteractive :: IO () runInteractive = do currDir <- getCurrentDirectory let ss = ScriptState "" currDir $ M.fromList [("HOME", currDir)] runInteractiveIter command_tb ss return ()
190
runInteractive = do currDir <- getCurrentDirectory let ss = ScriptState "" currDir $ M.fromList [("HOME", currDir)] runInteractiveIter command_tb ss return ()
166
false
true
0
14
32
77
34
43
null
null
y-kamiya/hzk-cli
Main.hs
mit
execute :: Command -> IO () execute (Create endpoint path content) = Z.withZookeeper endpoint 1000 Nothing Nothing $ \zh -> do e <- Z.create zh path (Just $ C.pack content) Z.OpenAclUnsafe [] case e of Left err -> print err Right s -> print s
265
execute :: Command -> IO () execute (Create endpoint path content) = Z.withZookeeper endpoint 1000 Nothing Nothing $ \zh -> do e <- Z.create zh path (Just $ C.pack content) Z.OpenAclUnsafe [] case e of Left err -> print err Right s -> print s
265
execute (Create endpoint path content) = Z.withZookeeper endpoint 1000 Nothing Nothing $ \zh -> do e <- Z.create zh path (Just $ C.pack content) Z.OpenAclUnsafe [] case e of Left err -> print err Right s -> print s
237
false
true
0
14
67
120
56
64
null
null
wxwxwwxxx/ghc
compiler/basicTypes/SrcLoc.hs
bsd-3-clause
-- Show is used by Lexer.x, because we -- derive Show for Token -- | Built-in "bad" 'SrcSpan's for common sources of location uncertainty noSrcSpan, wiredInSrcSpan, interactiveSrcSpan :: SrcSpan noSrcSpan = UnhelpfulSpan (fsLit "<no location info>")
296
noSrcSpan, wiredInSrcSpan, interactiveSrcSpan :: SrcSpan noSrcSpan = UnhelpfulSpan (fsLit "<no location info>")
120
noSrcSpan = UnhelpfulSpan (fsLit "<no location info>")
63
true
true
0
7
82
27
17
10
null
null
wavewave/madgraph-auto-dataset
src/HEP/Automation/MadGraph/Dataset/Set20110412set4.hs
gpl-3.0
processTTBar :: [Char] processTTBar = "\ngenerate P P > t t~ QED=99\n"
74
processTTBar :: [Char] processTTBar = "\ngenerate P P > t t~ QED=99\n"
74
processTTBar = "\ngenerate P P > t t~ QED=99\n"
51
false
true
0
7
15
21
9
12
null
null
trskop/cabal
Cabal/Distribution/Simple/Setup.hs
bsd-3-clause
showPackageDbList :: [Maybe PackageDB] -> [String] showPackageDbList = map showPackageDb where showPackageDb Nothing = "clear" showPackageDb (Just GlobalPackageDB) = "global" showPackageDb (Just UserPackageDB) = "user" showPackageDb (Just (SpecificPackageDB db)) = db
323
showPackageDbList :: [Maybe PackageDB] -> [String] showPackageDbList = map showPackageDb where showPackageDb Nothing = "clear" showPackageDb (Just GlobalPackageDB) = "global" showPackageDb (Just UserPackageDB) = "user" showPackageDb (Just (SpecificPackageDB db)) = db
323
showPackageDbList = map showPackageDb where showPackageDb Nothing = "clear" showPackageDb (Just GlobalPackageDB) = "global" showPackageDb (Just UserPackageDB) = "user" showPackageDb (Just (SpecificPackageDB db)) = db
272
false
true
0
9
86
86
43
43
null
null
M42/mikrokosmos
source/Lambda.hs
gpl-3.0
isOpenExp (Pi1 a) = isOpenExp a
31
isOpenExp (Pi1 a) = isOpenExp a
31
isOpenExp (Pi1 a) = isOpenExp a
31
false
false
0
7
5
18
8
10
null
null
k0001/gtk2hs
gtk/demo/embedded/MPlayer.hs
gpl-3.0
mplayerStick :: MPlayer -> Container -> IO () mplayerStick (MPlayer {mplayerWidget = mWidget}) container = do widgetShowAll mWidget container `containerAdd` mWidget
168
mplayerStick :: MPlayer -> Container -> IO () mplayerStick (MPlayer {mplayerWidget = mWidget}) container = do widgetShowAll mWidget container `containerAdd` mWidget
168
mplayerStick (MPlayer {mplayerWidget = mWidget}) container = do widgetShowAll mWidget container `containerAdd` mWidget
122
false
true
3
9
24
60
28
32
null
null
reinerp/CoreFoundation
CoreFoundation/URI.hs
bsd-3-clause
filepathToUri :: FilePath -> Uri filepathToUri fp | not (isAbsolute fp) = error "CoreFoundation.Utils.filepathToUri: input path must be absolute" | otherwise = fromString $ uriToString id uri "" where uri = URI { uriScheme = fileScheme, uriAuthority = fileAuth, uriPath = escapeURIString isUnescapedInURI fp, uriQuery = fileQuery, uriFragment = fileFragment }
445
filepathToUri :: FilePath -> Uri filepathToUri fp | not (isAbsolute fp) = error "CoreFoundation.Utils.filepathToUri: input path must be absolute" | otherwise = fromString $ uriToString id uri "" where uri = URI { uriScheme = fileScheme, uriAuthority = fileAuth, uriPath = escapeURIString isUnescapedInURI fp, uriQuery = fileQuery, uriFragment = fileFragment }
445
filepathToUri fp | not (isAbsolute fp) = error "CoreFoundation.Utils.filepathToUri: input path must be absolute" | otherwise = fromString $ uriToString id uri "" where uri = URI { uriScheme = fileScheme, uriAuthority = fileAuth, uriPath = escapeURIString isUnescapedInURI fp, uriQuery = fileQuery, uriFragment = fileFragment }
412
false
true
2
10
136
112
55
57
null
null
rahulmutt/ghcvm
libraries/eta-meta/Language/Eta/Meta/Lib.hs
bsd-3-clause
infixND :: Int -> Name -> DecQ infixND prec nm = return (InfixD (Fixity prec InfixN) nm)
88
infixND :: Int -> Name -> DecQ infixND prec nm = return (InfixD (Fixity prec InfixN) nm)
88
infixND prec nm = return (InfixD (Fixity prec InfixN) nm)
57
false
true
0
9
16
43
21
22
null
null
christiaanb/clash-compiler
clash-lib/src/CLaSH/Netlist/Id.hs
bsd-2-clause
-- | Transform/format a text so that it is acceptable as a HDL identifier mkBasicId :: Text -> Text mkBasicId = mkBasicId' False
138
mkBasicId :: Text -> Text mkBasicId = mkBasicId' False
64
mkBasicId = mkBasicId' False
28
true
true
0
5
32
19
10
9
null
null
armoredsoftware/protocol
demos/demo2/Attestation.hs
bsd-3-clause
readKeys :: IO (PrivateKey, PublicKey) readKeys = do handle <- openFile attKeyFileName ReadMode priString <- hGetLine handle pubString <- hGetLine handle let pri :: PrivateKey pri = read priString pub :: PublicKey pub = read pubString hClose handle return (pri, pub) --Error messages(only for debugging, at least for now)
355
readKeys :: IO (PrivateKey, PublicKey) readKeys = do handle <- openFile attKeyFileName ReadMode priString <- hGetLine handle pubString <- hGetLine handle let pri :: PrivateKey pri = read priString pub :: PublicKey pub = read pubString hClose handle return (pri, pub) --Error messages(only for debugging, at least for now)
355
readKeys = do handle <- openFile attKeyFileName ReadMode priString <- hGetLine handle pubString <- hGetLine handle let pri :: PrivateKey pri = read priString pub :: PublicKey pub = read pubString hClose handle return (pri, pub) --Error messages(only for debugging, at least for now)
316
false
true
1
11
82
105
48
57
null
null
sgillespie/ghc
compiler/utils/Outputable.hs
bsd-3-clause
-- E.g. "three arguments" -- | Determines the pluralisation suffix appropriate for the length of a list: -- -- > plural [] = char 's' -- > plural ["Hello"] = empty -- > plural ["Hello", "World"] = char 's' plural :: [a] -> SDoc plural [_] = empty
247
plural :: [a] -> SDoc plural [_] = empty
40
plural [_] = empty
18
true
true
0
6
48
30
19
11
null
null
timtylin/scholdoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
hacek 'g' = "ǧ"
15
hacek 'g' = "ǧ"
15
hacek 'g' = "ǧ"
15
false
false
0
5
3
9
4
5
null
null
Lainepress/easy
Text/RE/PCRE/RE.hs
bsd-3-clause
reBlockSensitive = re' $ Just BlockSensitive
53
reBlockSensitive = re' $ Just BlockSensitive
53
reBlockSensitive = re' $ Just BlockSensitive
53
false
false
0
6
14
13
6
7
null
null
brendanhay/gogol
gogol-firebasehosting/gen/Network/Google/Resource/FirebaseHosting/Sites/Versions/Files/List.hs
mpl-2.0
-- | OAuth access token. svflAccessToken :: Lens' SitesVersionsFilesList (Maybe Text) svflAccessToken = lens _svflAccessToken (\ s a -> s{_svflAccessToken = a})
168
svflAccessToken :: Lens' SitesVersionsFilesList (Maybe Text) svflAccessToken = lens _svflAccessToken (\ s a -> s{_svflAccessToken = a})
143
svflAccessToken = lens _svflAccessToken (\ s a -> s{_svflAccessToken = a})
82
true
true
1
9
29
52
25
27
null
null
tort/mud-drifter
src/World.hs
mit
loadWorld :: FilePath -> IO World loadWorld currentDir = do serverLogFiles <- listFilesIn (currentDir ++ "/" ++ serverLogDir) evtLogFiles <- listFilesIn (currentDir ++ "/" ++ evtLogDir) directions <- (extractDirections . parseServerEvents . loadLogs) serverLogFiles locations <- (extractLocs . parseServerEvents . loadLogs) serverLogFiles itemsStats <- PP.toListM $ (extractItemStats . parseServerEvents . loadLogs) serverLogFiles itemsOnMap <- (discoverItems . parseServerEvents . loadLogs) serverLogFiles mobsOnMap <- ((extractDiscovered _mobs) . parseServerEvents . loadLogs) serverLogFiles questActions <- (obstacleActions . binEvtLogParser . loadLogs) evtLogFiles let worldMap = buildMap directions in return World { _worldMap = worldMap , _locations = locations , _directions = directions , _itemsOnMap = itemsOnMap , _itemStats = itemsStats , _mobsDiscovered = mobsOnMap , _mobStats = [] , _questActions = questActions }
1,116
loadWorld :: FilePath -> IO World loadWorld currentDir = do serverLogFiles <- listFilesIn (currentDir ++ "/" ++ serverLogDir) evtLogFiles <- listFilesIn (currentDir ++ "/" ++ evtLogDir) directions <- (extractDirections . parseServerEvents . loadLogs) serverLogFiles locations <- (extractLocs . parseServerEvents . loadLogs) serverLogFiles itemsStats <- PP.toListM $ (extractItemStats . parseServerEvents . loadLogs) serverLogFiles itemsOnMap <- (discoverItems . parseServerEvents . loadLogs) serverLogFiles mobsOnMap <- ((extractDiscovered _mobs) . parseServerEvents . loadLogs) serverLogFiles questActions <- (obstacleActions . binEvtLogParser . loadLogs) evtLogFiles let worldMap = buildMap directions in return World { _worldMap = worldMap , _locations = locations , _directions = directions , _itemsOnMap = itemsOnMap , _itemStats = itemsStats , _mobsDiscovered = mobsOnMap , _mobStats = [] , _questActions = questActions }
1,116
loadWorld currentDir = do serverLogFiles <- listFilesIn (currentDir ++ "/" ++ serverLogDir) evtLogFiles <- listFilesIn (currentDir ++ "/" ++ evtLogDir) directions <- (extractDirections . parseServerEvents . loadLogs) serverLogFiles locations <- (extractLocs . parseServerEvents . loadLogs) serverLogFiles itemsStats <- PP.toListM $ (extractItemStats . parseServerEvents . loadLogs) serverLogFiles itemsOnMap <- (discoverItems . parseServerEvents . loadLogs) serverLogFiles mobsOnMap <- ((extractDiscovered _mobs) . parseServerEvents . loadLogs) serverLogFiles questActions <- (obstacleActions . binEvtLogParser . loadLogs) evtLogFiles let worldMap = buildMap directions in return World { _worldMap = worldMap , _locations = locations , _directions = directions , _itemsOnMap = itemsOnMap , _itemStats = itemsStats , _mobsDiscovered = mobsOnMap , _mobStats = [] , _questActions = questActions }
1,082
false
true
0
14
306
278
139
139
null
null
ntc2/cryptol
src/Cryptol/Parser/AST.hs
bsd-3-clause
modRange :: Module -> Range modRange m = rCombs $ catMaybes [ getLoc (mName m) , getLoc (mImports m) , getLoc (mDecls m) , Just (Range { from = start, to = start, source = "" }) ]
199
modRange :: Module -> Range modRange m = rCombs $ catMaybes [ getLoc (mName m) , getLoc (mImports m) , getLoc (mDecls m) , Just (Range { from = start, to = start, source = "" }) ]
199
modRange m = rCombs $ catMaybes [ getLoc (mName m) , getLoc (mImports m) , getLoc (mDecls m) , Just (Range { from = start, to = start, source = "" }) ]
171
false
true
0
11
57
90
48
42
null
null
parapluu/encore
src/ir/AST/Util.hs
bsd-3-clause
putChildren _ e@(MiniLet{decl}) = error "'putChildren l MiniLet' expects l to have 1 element"
93
putChildren _ e@(MiniLet{decl}) = error "'putChildren l MiniLet' expects l to have 1 element"
93
putChildren _ e@(MiniLet{decl}) = error "'putChildren l MiniLet' expects l to have 1 element"
93
false
false
0
9
13
29
14
15
null
null
neothemachine/monadiccp
src/Data/Expr/Util.hs
bsd-3-clause
simplify (Minus a (Const c)) = simplify $ Plus (Const (-c)) a
61
simplify (Minus a (Const c)) = simplify $ Plus (Const (-c)) a
61
simplify (Minus a (Const c)) = simplify $ Plus (Const (-c)) a
61
false
false
0
10
11
43
21
22
null
null
c0deaddict/project-euler
src/Part2/Problem44.hs
bsd-3-clause
altProblem44 :: Maybe (Int, Int) altProblem44 = find minPair diffs where minPair (n, _) = let p1 = pentagonal n p2 = pentagonal (n + 1) in isPentagonal $ p1 + p2
179
altProblem44 :: Maybe (Int, Int) altProblem44 = find minPair diffs where minPair (n, _) = let p1 = pentagonal n p2 = pentagonal (n + 1) in isPentagonal $ p1 + p2
179
altProblem44 = find minPair diffs where minPair (n, _) = let p1 = pentagonal n p2 = pentagonal (n + 1) in isPentagonal $ p1 + p2
146
false
true
0
13
49
78
40
38
null
null
batterseapower/haskell-kata
Graphs.hs
bsd-3-clause
test2 = sccs g0
15
test2 = sccs g0
15
test2 = sccs g0
15
false
false
0
5
3
9
4
5
null
null
mettekou/ghc
compiler/deSugar/Coverage.hs
bsd-3-clause
addTickHsExpr (SectionL e1 e2) = liftM2 SectionL (addTickLHsExpr e1) (addTickLHsExprNever e2)
133
addTickHsExpr (SectionL e1 e2) = liftM2 SectionL (addTickLHsExpr e1) (addTickLHsExprNever e2)
133
addTickHsExpr (SectionL e1 e2) = liftM2 SectionL (addTickLHsExpr e1) (addTickLHsExprNever e2)
133
false
false
0
7
50
36
17
19
null
null
gabesoft/kapi
test/PersistenceElasticSearchSpec.hs
bsd-3-clause
verifySearch :: (T.Text, Either EsError Search) -> Expectation verifySearch (searchFilter, expected) = mkSearch (Just $ fromRight $ parse searchFilter) [] [] 3 12 `shouldBe` expected
184
verifySearch :: (T.Text, Either EsError Search) -> Expectation verifySearch (searchFilter, expected) = mkSearch (Just $ fromRight $ parse searchFilter) [] [] 3 12 `shouldBe` expected
184
verifySearch (searchFilter, expected) = mkSearch (Just $ fromRight $ parse searchFilter) [] [] 3 12 `shouldBe` expected
121
false
true
2
9
26
76
38
38
null
null
rumblesan/improviz
src/Language/Parser.hs
bsd-3-clause
scn :: Parser () scn = L.space space1 lineCmnt blockCmnt
56
scn :: Parser () scn = L.space space1 lineCmnt blockCmnt
56
scn = L.space space1 lineCmnt blockCmnt
39
false
true
1
6
9
28
12
16
null
null
jonpetterbergman/binary-streams
test/EncodeDecode.hs
bsd-3-clause
encodeDecodeError xs = monadicIO $ do run $ catch go $ \(_ :: DecodeException) -> return () where go = do bList <- encode xs (xs' :: [a]) <- decode $ corrupt bList evaluate xs' fail "decoding succeeded when it should fail"
281
encodeDecodeError xs = monadicIO $ do run $ catch go $ \(_ :: DecodeException) -> return () where go = do bList <- encode xs (xs' :: [a]) <- decode $ corrupt bList evaluate xs' fail "decoding succeeded when it should fail"
281
encodeDecodeError xs = monadicIO $ do run $ catch go $ \(_ :: DecodeException) -> return () where go = do bList <- encode xs (xs' :: [a]) <- decode $ corrupt bList evaluate xs' fail "decoding succeeded when it should fail"
281
false
false
1
11
100
102
45
57
null
null
danr/hipspec
testsuite/prod/zeno_version/PropT39.hs
gpl-3.0
-- Lists length :: [a] -> Nat length [] = Z
44
length :: [a] -> Nat length [] = Z
34
length [] = Z
13
true
true
0
6
11
24
13
11
null
null
kyren/hstecs
library/Tecs/Definitions.hs
unlicense
pVariableDesc PVariableTHAT = ("THAT", 0x4)
43
pVariableDesc PVariableTHAT = ("THAT", 0x4)
43
pVariableDesc PVariableTHAT = ("THAT", 0x4)
43
false
false
0
5
4
15
8
7
null
null
maarons/Cortex
Miranda/test/Commit_Test.hs
agpl-3.0
test8 :: Test test8 = TestCase $ assertBool "" $ (<) (Commit ("b", Delete, "hash", "2011.03.18 19:32:32:910425188000")) (Commit ("a", Delete, "hash", "2012.03.18 19:32:32:910425188000"))
194
test8 :: Test test8 = TestCase $ assertBool "" $ (<) (Commit ("b", Delete, "hash", "2011.03.18 19:32:32:910425188000")) (Commit ("a", Delete, "hash", "2012.03.18 19:32:32:910425188000"))
194
test8 = TestCase $ assertBool "" $ (<) (Commit ("b", Delete, "hash", "2011.03.18 19:32:32:910425188000")) (Commit ("a", Delete, "hash", "2012.03.18 19:32:32:910425188000"))
180
false
true
0
7
30
66
37
29
null
null
ezyang/ghc
compiler/simplCore/CoreMonad.hs
bsd-3-clause
tickToTag (UnfoldingDone _) = 2
43
tickToTag (UnfoldingDone _) = 2
43
tickToTag (UnfoldingDone _) = 2
43
false
false
0
6
16
16
7
9
null
null
vshatskyi/i3wm-config-haskell
app/Main.hs
bsd-3-clause
emacs = [Instance "emacs"]
26
emacs = [Instance "emacs"]
26
emacs = [Instance "emacs"]
26
false
false
0
6
3
12
6
6
null
null
gustavoramos00/tecnicas-topdown
S8_3.hs
mit
score (1,1) (1,2) = 0
22
score (1,1) (1,2) = 0
22
score (1,1) (1,2) = 0
22
false
false
0
6
5
23
13
10
null
null
drmaruyama/Paraiso
examples/InitialCondition/Generator.hs
bsd-3-clause
myVars :: [Named DynValue] myVars = [f2d table]
47
myVars :: [Named DynValue] myVars = [f2d table]
47
myVars = [f2d table]
20
false
true
0
6
7
23
12
11
null
null
AaronFriel/eff-experiments
src/Data/Iota/Tagged/Eff1.hs
bsd-3-clause
tes1 :: (Member (State Int) r, Member (Exc [Char]) r) => Eff r b tes1 = do incr throwError "exc"
98
tes1 :: (Member (State Int) r, Member (Exc [Char]) r) => Eff r b tes1 = do incr throwError "exc"
98
tes1 = do incr throwError "exc"
33
false
true
0
10
21
65
30
35
null
null
thewoolleyman/haskellbook
03/05/maor/print3flipped.hs
unlicense
main :: IO () main = do putStrLn myGreeting putStrLn secondGreeting where secondGreeting = (++) hello ((++) " " world)
130
main :: IO () main = do putStrLn myGreeting putStrLn secondGreeting where secondGreeting = (++) hello ((++) " " world)
130
main = do putStrLn myGreeting putStrLn secondGreeting where secondGreeting = (++) hello ((++) " " world)
116
false
true
0
7
31
58
27
31
null
null
ZjMNZHgG5jMXw/smallcaps
src/smallcaps/Text/SmallCaps/TeXParser.hs
bsd-3-clause
comment :: Parser TeXElement comment = fmap Comment $ do b <- commentChar c <- takeTill isEndOfLine option () endOfLine return (cons b (snoc c '\n'))
157
comment :: Parser TeXElement comment = fmap Comment $ do b <- commentChar c <- takeTill isEndOfLine option () endOfLine return (cons b (snoc c '\n'))
157
comment = fmap Comment $ do b <- commentChar c <- takeTill isEndOfLine option () endOfLine return (cons b (snoc c '\n'))
128
false
true
1
13
33
74
31
43
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\x30D3' = "\x30D2\x3099"
39
decomposeChar '\x30D3' = "\x30D2\x3099"
39
decomposeChar '\x30D3' = "\x30D2\x3099"
39
false
false
0
4
3
10
4
6
null
null
karamellpelle/grid
source/Game/Iteration.hs
gpl-3.0
mapLast f (a:as) = a : mapLast f as
39
mapLast f (a:as) = a : mapLast f as
39
mapLast f (a:as) = a : mapLast f as
39
false
false
2
6
12
32
13
19
null
null
bhamrick/record-lens
Language/Record/Lens.hs
bsd-3-clause
mkRecordInstance :: Name -> [TyVarBndr] -> String -> Name -> [Con] -> Q [Dec] mkRecordInstance tyCon tyBndrs lensNameStr recN cons = do case findRecType recN cons of Nothing -> return [] Just recTy -> do let lensName = mkName lensNameStr (inTy, (rS, rT, rA, rB)) <- instanceType tyCon tyBndrs lensNameStr recN cons clauses <- traverse (recordLensClause rS rT rA rB recN) cons return . return $ InstanceD Nothing [] inTy [FunD 'recordLens clauses] where ty = appliedType tyCon tyBndrs fConstraint = if all (recordPresent recN) cons then ConT ''Functor else ConT ''Applicative
687
mkRecordInstance :: Name -> [TyVarBndr] -> String -> Name -> [Con] -> Q [Dec] mkRecordInstance tyCon tyBndrs lensNameStr recN cons = do case findRecType recN cons of Nothing -> return [] Just recTy -> do let lensName = mkName lensNameStr (inTy, (rS, rT, rA, rB)) <- instanceType tyCon tyBndrs lensNameStr recN cons clauses <- traverse (recordLensClause rS rT rA rB recN) cons return . return $ InstanceD Nothing [] inTy [FunD 'recordLens clauses] where ty = appliedType tyCon tyBndrs fConstraint = if all (recordPresent recN) cons then ConT ''Functor else ConT ''Applicative
687
mkRecordInstance tyCon tyBndrs lensNameStr recN cons = do case findRecType recN cons of Nothing -> return [] Just recTy -> do let lensName = mkName lensNameStr (inTy, (rS, rT, rA, rB)) <- instanceType tyCon tyBndrs lensNameStr recN cons clauses <- traverse (recordLensClause rS rT rA rB recN) cons return . return $ InstanceD Nothing [] inTy [FunD 'recordLens clauses] where ty = appliedType tyCon tyBndrs fConstraint = if all (recordPresent recN) cons then ConT ''Functor else ConT ''Applicative
609
false
true
0
15
204
238
117
121
null
null
lspitzner/brittany
doc-svg-gen/Main.hs
agpl-3.0
dataTransformation :: n -> Text -> [n] -> [n] -> DotM n () dataTransformation name labelText inputs outputs = do node name [ shape PlainText , textLabel labelText , BgColor [] , color White , Margin $ DVal 0.01 ] inputs `forM_` \i -> edge i name [Dir NoDir] outputs `forM_` \o -> edge name o []
328
dataTransformation :: n -> Text -> [n] -> [n] -> DotM n () dataTransformation name labelText inputs outputs = do node name [ shape PlainText , textLabel labelText , BgColor [] , color White , Margin $ DVal 0.01 ] inputs `forM_` \i -> edge i name [Dir NoDir] outputs `forM_` \o -> edge name o []
328
dataTransformation name labelText inputs outputs = do node name [ shape PlainText , textLabel labelText , BgColor [] , color White , Margin $ DVal 0.01 ] inputs `forM_` \i -> edge i name [Dir NoDir] outputs `forM_` \o -> edge name o []
269
false
true
0
11
90
143
72
71
null
null
dirkz/google-code-jam-haskell
practice/src/Dijkstra.hs
mpl-2.0
charToQuat 'i' = Plus I
23
charToQuat 'i' = Plus I
23
charToQuat 'i' = Plus I
23
false
false
0
5
4
12
5
7
null
null
fmthoma/ghc
compiler/main/HscMain.hs
bsd-3-clause
hscParseStmtWithLocation :: String -> Int -> String -> Hsc (Maybe (GhciLStmt RdrName)) hscParseStmtWithLocation source linenumber stmt = hscParseThingWithLocation source linenumber parseStmt stmt
224
hscParseStmtWithLocation :: String -> Int -> String -> Hsc (Maybe (GhciLStmt RdrName)) hscParseStmtWithLocation source linenumber stmt = hscParseThingWithLocation source linenumber parseStmt stmt
224
hscParseStmtWithLocation source linenumber stmt = hscParseThingWithLocation source linenumber parseStmt stmt
112
false
true
0
12
50
54
26
28
null
null
AlexanderPankiv/ghc
compiler/basicTypes/Id.hs
bsd-3-clause
{- --------------------------------- -- INLINING The inline pragma tells us to be very keen to inline this Id, but it's still OK not to if optimisation is switched off. -} idInlinePragma :: Id -> InlinePragma idInlinePragma id = inlinePragInfo (idInfo id)
272
idInlinePragma :: Id -> InlinePragma idInlinePragma id = inlinePragInfo (idInfo id)
83
idInlinePragma id = inlinePragInfo (idInfo id)
46
true
true
0
7
56
28
14
14
null
null
ian-ross/c2hs-macos-test
c2hs-0.26.1/src/Main.hs
mit
processOpt (OutDir fname ) = setOutDir fname
49
processOpt (OutDir fname ) = setOutDir fname
49
processOpt (OutDir fname ) = setOutDir fname
49
false
false
0
7
11
18
8
10
null
null
michalkonecny/aern2
aern2-mfun/src/AERN2/BoxFunMinMax/Expressions/Tester.hs
bsd-3-clause
hasMinMaxE (EBinOp _ e1 e2) = hasMinMaxE e1 || hasMinMaxE e2
60
hasMinMaxE (EBinOp _ e1 e2) = hasMinMaxE e1 || hasMinMaxE e2
60
hasMinMaxE (EBinOp _ e1 e2) = hasMinMaxE e1 || hasMinMaxE e2
60
false
false
0
7
10
29
13
16
null
null
j3h/Haskell-Data-Validation
src/Rules.hs
bsd-3-clause
-- |Convert a pure function into a named validator. label :: String -> (a -> b) -> Validator e a b label lbl f = zero { describe = text lbl , go = Right . f }
186
label :: String -> (a -> b) -> Validator e a b label lbl f = zero { describe = text lbl , go = Right . f }
134
label lbl f = zero { describe = text lbl , go = Right . f }
87
true
true
0
8
65
65
33
32
null
null
Rydgel/advent-of-code-2016
src/Day2.hs
bsd-3-clause
day2' :: IO () day2' = do parseS <- T.lines . T.pack <$> readFile "resources/day2.txt" let directions = rights $ map (parseOnly parseDirections) parseS answer = foldl (\z d -> z ++ getDigit pad2 (chooseDigit' d)) "" directions print answer
251
day2' :: IO () day2' = do parseS <- T.lines . T.pack <$> readFile "resources/day2.txt" let directions = rights $ map (parseOnly parseDirections) parseS answer = foldl (\z d -> z ++ getDigit pad2 (chooseDigit' d)) "" directions print answer
251
day2' = do parseS <- T.lines . T.pack <$> readFile "resources/day2.txt" let directions = rights $ map (parseOnly parseDirections) parseS answer = foldl (\z d -> z ++ getDigit pad2 (chooseDigit' d)) "" directions print answer
236
false
true
0
16
51
105
50
55
null
null
harendra-kumar/asyncly
test/Main.hs
bsd-3-clause
main :: IO () main = hspec $ do parallelTests describe "restricts concurrency and cleans up extra tasks" $ do it "take 1 asyncly" $ checkCleanup 2 asyncly (S.take 1) it "take 1 wAsyncly" $ checkCleanup 2 wAsyncly (S.take 1) it "take 1 aheadly" $ checkCleanup 2 aheadly (S.take 1) it "takeWhile (< 0) asyncly" $ checkCleanup 2 asyncly (S.takeWhile (< 0)) it "takeWhile (< 0) wAsyncly" $ checkCleanup 2 wAsyncly (S.takeWhile (< 0)) it "takeWhile (< 0) aheadly" $ checkCleanup 2 aheadly (S.takeWhile (< 0)) #ifdef DEVBUILD let timed :: (IsStream t, Monad (t IO)) => Int -> t IO Int timed x = S.yieldM (threadDelay (x * 100000)) >> return x -- These are not run parallely because the timing gets affected -- unpredictably when other tests are running on the same machine. -- -- Also, they fail intermittently due to scheduling delays, so not run on -- CI machines. describe "Nested parallel and serial compositions" $ do let t = timed p = wAsyncly s = serially {- -- This is not correct, the result can also be [4,4,8,0,8,0,2,2] -- because of parallelism of [8,0] and [8,0]. it "Nest <|>, <>, <|> (1)" $ let t = timed in toListSerial ( ((t 8 <|> t 4) <> (t 2 <|> t 0)) <|> ((t 8 <|> t 4) <> (t 2 <|> t 0))) `shouldReturn` ([4,4,8,8,0,0,2,2]) -} it "Nest <|>, <>, <|> (2)" $ (S.toList . wAsyncly) ( s (p (t 4 <> t 8) <> p (t 1 <> t 2)) <> s (p (t 4 <> t 8) <> p (t 1 <> t 2))) `shouldReturn` ([4,4,8,8,1,1,2,2]) -- FIXME: These two keep failing intermittently on Mac OS X -- Need to examine and fix the tests. {- it "Nest <|>, <=>, <|> (1)" $ let t = timed in toListSerial ( ((t 8 <|> t 4) <=> (t 2 <|> t 0)) <|> ((t 9 <|> t 4) <=> (t 2 <|> t 0))) `shouldReturn` ([4,4,0,0,8,2,9,2]) it "Nest <|>, <=>, <|> (2)" $ let t = timed in toListSerial ( ((t 4 <|> t 8) <=> (t 1 <|> t 2)) <|> ((t 4 <|> t 9) <=> (t 1 <|> t 2))) `shouldReturn` ([4,4,1,1,8,2,9,2]) -} it "Nest <|>, <|>, <|>" $ (S.toList . wAsyncly) ( ((t 4 <> t 8) <> (t 0 <> t 2)) <> ((t 4 <> t 8) <> (t 0 <> t 2))) `shouldReturn` ([0,0,2,2,4,4,8,8]) -- parallely fails on CI machines, may need more difference in times of -- the events, but that would make tests even slower. it "take 1 parallely" $ checkCleanup 3 parallely (S.take 1) it "takeWhile (< 0) parallely" $ checkCleanup 3 parallely (S.takeWhile (< 0)) testFoldOpsCleanup "head" S.head testFoldOpsCleanup "null" S.null testFoldOpsCleanup "elem" (S.elem 0) testFoldOpsCleanup "notElem" (S.notElem 0) testFoldOpsCleanup "elemIndex" (S.elemIndex 0) -- S.lookup testFoldOpsCleanup "notElem" (S.notElem 0) testFoldOpsCleanup "find" (S.find (==0)) testFoldOpsCleanup "findIndex" (S.findIndex (==0)) testFoldOpsCleanup "all" (S.all (==1)) testFoldOpsCleanup "any" (S.any (==0)) testFoldOpsCleanup "and" (S.and . S.map (==1)) testFoldOpsCleanup "or" (S.or . S.map (==0)) #endif --------------------------------------------------------------------------- -- Semigroup/Monoidal Composition strict ordering checks --------------------------------------------------------------------------- -- test both (<>) and mappend to make sure we are using correct instance -- for Monoid that is using the right version of semigroup. Instance -- deriving can cause us to pick wrong instances sometimes. describe "WSerial interleaved (<>) ordering check" $ interleaveCheck wSerially (<>) describe "WSerial interleaved mappend ordering check" $ interleaveCheck wSerially mappend -- describe "WAsync interleaved (<>) ordering check" $ interleaveCheck wAsyncly (<>) -- describe "WAsync interleaved mappend ordering check" $ interleaveCheck wAsyncly mappend describe "Async (<>) time order check" $ parallelCheck asyncly (<>) describe "Async mappend time order check" $ parallelCheck asyncly mappend -- XXX this keeps failing intermittently, need to investigate -- describe "WAsync (<>) time order check" $ parallelCheck wAsyncly (<>) -- describe "WAsync mappend time order check" $ parallelCheck wAsyncly mappend describe "Parallel (<>) time order check" $ parallelCheck parallely (<>) describe "Parallel mappend time order check" $ parallelCheck parallely mappend
4,834
main :: IO () main = hspec $ do parallelTests describe "restricts concurrency and cleans up extra tasks" $ do it "take 1 asyncly" $ checkCleanup 2 asyncly (S.take 1) it "take 1 wAsyncly" $ checkCleanup 2 wAsyncly (S.take 1) it "take 1 aheadly" $ checkCleanup 2 aheadly (S.take 1) it "takeWhile (< 0) asyncly" $ checkCleanup 2 asyncly (S.takeWhile (< 0)) it "takeWhile (< 0) wAsyncly" $ checkCleanup 2 wAsyncly (S.takeWhile (< 0)) it "takeWhile (< 0) aheadly" $ checkCleanup 2 aheadly (S.takeWhile (< 0)) #ifdef DEVBUILD let timed :: (IsStream t, Monad (t IO)) => Int -> t IO Int timed x = S.yieldM (threadDelay (x * 100000)) >> return x -- These are not run parallely because the timing gets affected -- unpredictably when other tests are running on the same machine. -- -- Also, they fail intermittently due to scheduling delays, so not run on -- CI machines. describe "Nested parallel and serial compositions" $ do let t = timed p = wAsyncly s = serially {- -- This is not correct, the result can also be [4,4,8,0,8,0,2,2] -- because of parallelism of [8,0] and [8,0]. it "Nest <|>, <>, <|> (1)" $ let t = timed in toListSerial ( ((t 8 <|> t 4) <> (t 2 <|> t 0)) <|> ((t 8 <|> t 4) <> (t 2 <|> t 0))) `shouldReturn` ([4,4,8,8,0,0,2,2]) -} it "Nest <|>, <>, <|> (2)" $ (S.toList . wAsyncly) ( s (p (t 4 <> t 8) <> p (t 1 <> t 2)) <> s (p (t 4 <> t 8) <> p (t 1 <> t 2))) `shouldReturn` ([4,4,8,8,1,1,2,2]) -- FIXME: These two keep failing intermittently on Mac OS X -- Need to examine and fix the tests. {- it "Nest <|>, <=>, <|> (1)" $ let t = timed in toListSerial ( ((t 8 <|> t 4) <=> (t 2 <|> t 0)) <|> ((t 9 <|> t 4) <=> (t 2 <|> t 0))) `shouldReturn` ([4,4,0,0,8,2,9,2]) it "Nest <|>, <=>, <|> (2)" $ let t = timed in toListSerial ( ((t 4 <|> t 8) <=> (t 1 <|> t 2)) <|> ((t 4 <|> t 9) <=> (t 1 <|> t 2))) `shouldReturn` ([4,4,1,1,8,2,9,2]) -} it "Nest <|>, <|>, <|>" $ (S.toList . wAsyncly) ( ((t 4 <> t 8) <> (t 0 <> t 2)) <> ((t 4 <> t 8) <> (t 0 <> t 2))) `shouldReturn` ([0,0,2,2,4,4,8,8]) -- parallely fails on CI machines, may need more difference in times of -- the events, but that would make tests even slower. it "take 1 parallely" $ checkCleanup 3 parallely (S.take 1) it "takeWhile (< 0) parallely" $ checkCleanup 3 parallely (S.takeWhile (< 0)) testFoldOpsCleanup "head" S.head testFoldOpsCleanup "null" S.null testFoldOpsCleanup "elem" (S.elem 0) testFoldOpsCleanup "notElem" (S.notElem 0) testFoldOpsCleanup "elemIndex" (S.elemIndex 0) -- S.lookup testFoldOpsCleanup "notElem" (S.notElem 0) testFoldOpsCleanup "find" (S.find (==0)) testFoldOpsCleanup "findIndex" (S.findIndex (==0)) testFoldOpsCleanup "all" (S.all (==1)) testFoldOpsCleanup "any" (S.any (==0)) testFoldOpsCleanup "and" (S.and . S.map (==1)) testFoldOpsCleanup "or" (S.or . S.map (==0)) #endif --------------------------------------------------------------------------- -- Semigroup/Monoidal Composition strict ordering checks --------------------------------------------------------------------------- -- test both (<>) and mappend to make sure we are using correct instance -- for Monoid that is using the right version of semigroup. Instance -- deriving can cause us to pick wrong instances sometimes. describe "WSerial interleaved (<>) ordering check" $ interleaveCheck wSerially (<>) describe "WSerial interleaved mappend ordering check" $ interleaveCheck wSerially mappend -- describe "WAsync interleaved (<>) ordering check" $ interleaveCheck wAsyncly (<>) -- describe "WAsync interleaved mappend ordering check" $ interleaveCheck wAsyncly mappend describe "Async (<>) time order check" $ parallelCheck asyncly (<>) describe "Async mappend time order check" $ parallelCheck asyncly mappend -- XXX this keeps failing intermittently, need to investigate -- describe "WAsync (<>) time order check" $ parallelCheck wAsyncly (<>) -- describe "WAsync mappend time order check" $ parallelCheck wAsyncly mappend describe "Parallel (<>) time order check" $ parallelCheck parallely (<>) describe "Parallel mappend time order check" $ parallelCheck parallely mappend
4,834
main = hspec $ do parallelTests describe "restricts concurrency and cleans up extra tasks" $ do it "take 1 asyncly" $ checkCleanup 2 asyncly (S.take 1) it "take 1 wAsyncly" $ checkCleanup 2 wAsyncly (S.take 1) it "take 1 aheadly" $ checkCleanup 2 aheadly (S.take 1) it "takeWhile (< 0) asyncly" $ checkCleanup 2 asyncly (S.takeWhile (< 0)) it "takeWhile (< 0) wAsyncly" $ checkCleanup 2 wAsyncly (S.takeWhile (< 0)) it "takeWhile (< 0) aheadly" $ checkCleanup 2 aheadly (S.takeWhile (< 0)) #ifdef DEVBUILD let timed :: (IsStream t, Monad (t IO)) => Int -> t IO Int timed x = S.yieldM (threadDelay (x * 100000)) >> return x -- These are not run parallely because the timing gets affected -- unpredictably when other tests are running on the same machine. -- -- Also, they fail intermittently due to scheduling delays, so not run on -- CI machines. describe "Nested parallel and serial compositions" $ do let t = timed p = wAsyncly s = serially {- -- This is not correct, the result can also be [4,4,8,0,8,0,2,2] -- because of parallelism of [8,0] and [8,0]. it "Nest <|>, <>, <|> (1)" $ let t = timed in toListSerial ( ((t 8 <|> t 4) <> (t 2 <|> t 0)) <|> ((t 8 <|> t 4) <> (t 2 <|> t 0))) `shouldReturn` ([4,4,8,8,0,0,2,2]) -} it "Nest <|>, <>, <|> (2)" $ (S.toList . wAsyncly) ( s (p (t 4 <> t 8) <> p (t 1 <> t 2)) <> s (p (t 4 <> t 8) <> p (t 1 <> t 2))) `shouldReturn` ([4,4,8,8,1,1,2,2]) -- FIXME: These two keep failing intermittently on Mac OS X -- Need to examine and fix the tests. {- it "Nest <|>, <=>, <|> (1)" $ let t = timed in toListSerial ( ((t 8 <|> t 4) <=> (t 2 <|> t 0)) <|> ((t 9 <|> t 4) <=> (t 2 <|> t 0))) `shouldReturn` ([4,4,0,0,8,2,9,2]) it "Nest <|>, <=>, <|> (2)" $ let t = timed in toListSerial ( ((t 4 <|> t 8) <=> (t 1 <|> t 2)) <|> ((t 4 <|> t 9) <=> (t 1 <|> t 2))) `shouldReturn` ([4,4,1,1,8,2,9,2]) -} it "Nest <|>, <|>, <|>" $ (S.toList . wAsyncly) ( ((t 4 <> t 8) <> (t 0 <> t 2)) <> ((t 4 <> t 8) <> (t 0 <> t 2))) `shouldReturn` ([0,0,2,2,4,4,8,8]) -- parallely fails on CI machines, may need more difference in times of -- the events, but that would make tests even slower. it "take 1 parallely" $ checkCleanup 3 parallely (S.take 1) it "takeWhile (< 0) parallely" $ checkCleanup 3 parallely (S.takeWhile (< 0)) testFoldOpsCleanup "head" S.head testFoldOpsCleanup "null" S.null testFoldOpsCleanup "elem" (S.elem 0) testFoldOpsCleanup "notElem" (S.notElem 0) testFoldOpsCleanup "elemIndex" (S.elemIndex 0) -- S.lookup testFoldOpsCleanup "notElem" (S.notElem 0) testFoldOpsCleanup "find" (S.find (==0)) testFoldOpsCleanup "findIndex" (S.findIndex (==0)) testFoldOpsCleanup "all" (S.all (==1)) testFoldOpsCleanup "any" (S.any (==0)) testFoldOpsCleanup "and" (S.and . S.map (==1)) testFoldOpsCleanup "or" (S.or . S.map (==0)) #endif --------------------------------------------------------------------------- -- Semigroup/Monoidal Composition strict ordering checks --------------------------------------------------------------------------- -- test both (<>) and mappend to make sure we are using correct instance -- for Monoid that is using the right version of semigroup. Instance -- deriving can cause us to pick wrong instances sometimes. describe "WSerial interleaved (<>) ordering check" $ interleaveCheck wSerially (<>) describe "WSerial interleaved mappend ordering check" $ interleaveCheck wSerially mappend -- describe "WAsync interleaved (<>) ordering check" $ interleaveCheck wAsyncly (<>) -- describe "WAsync interleaved mappend ordering check" $ interleaveCheck wAsyncly mappend describe "Async (<>) time order check" $ parallelCheck asyncly (<>) describe "Async mappend time order check" $ parallelCheck asyncly mappend -- XXX this keeps failing intermittently, need to investigate -- describe "WAsync (<>) time order check" $ parallelCheck wAsyncly (<>) -- describe "WAsync mappend time order check" $ parallelCheck wAsyncly mappend describe "Parallel (<>) time order check" $ parallelCheck parallely (<>) describe "Parallel mappend time order check" $ parallelCheck parallely mappend
4,820
false
true
2
22
1,443
968
476
492
null
null
lucas8/netlist-compiler
parser.hs
mit
one_eq mp tps = do v <- wp varia i <- getidx mp "result" v wp $ char '=' e <- expre mp tps (tps ! i) return $ (i, e)
192
one_eq mp tps = do v <- wp varia i <- getidx mp "result" v wp $ char '=' e <- expre mp tps (tps ! i) return $ (i, e)
192
one_eq mp tps = do v <- wp varia i <- getidx mp "result" v wp $ char '=' e <- expre mp tps (tps ! i) return $ (i, e)
192
false
false
1
10
106
84
36
48
null
null
Chobbes/Juicy.Pixels
src/Codec/Picture/Metadata.hs
bsd-3-clause
-- | foldMap equivalent for metadatas. foldMap :: Monoid m => (Elem Keys -> m) -> Metadatas -> m foldMap f = foldl' (\acc v -> acc `mappend` f v) mempty
152
foldMap :: Monoid m => (Elem Keys -> m) -> Metadatas -> m foldMap f = foldl' (\acc v -> acc `mappend` f v) mempty
113
foldMap f = foldl' (\acc v -> acc `mappend` f v) mempty
55
true
true
0
9
30
64
33
31
null
null
agocorona/MFlow
Demos/Combination.hs
bsd-3-clause
focus = [("onload","this.focus()")]
35
focus = [("onload","this.focus()")]
35
focus = [("onload","this.focus()")]
35
false
false
1
6
2
18
9
9
null
null
sol/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
aelig :: GenParser Char st Inline aelig = try $ do char '\\' letter' <- oneOfStrings ["ae", "AE"] notFollowedBy letter let num = if letter' == "ae" then 230 else 198 return $ Str [chr num]
198
aelig :: GenParser Char st Inline aelig = try $ do char '\\' letter' <- oneOfStrings ["ae", "AE"] notFollowedBy letter let num = if letter' == "ae" then 230 else 198 return $ Str [chr num]
198
aelig = try $ do char '\\' letter' <- oneOfStrings ["ae", "AE"] notFollowedBy letter let num = if letter' == "ae" then 230 else 198 return $ Str [chr num]
164
false
true
0
12
45
87
41
46
null
null
brendanhay/gogol
gogol-spanner/gen/Network/Google/Spanner/Types/Product.hs
mpl-2.0
-- | Parameter names and values that bind to placeholders in the SQL string. -- A parameter placeholder consists of the \`\'\` character followed by the -- parameter name (for example, \`\'firstName\`). Parameter names must -- conform to the naming requirements of identifiers as specified at -- https:\/\/cloud.google.com\/spanner\/docs\/lexical#identifiers. -- Parameters can appear anywhere that a literal value is expected. The -- same parameter name can be used more than once, for example: \`\"WHERE -- id > \'msg_id AND id \< \'msg_id + 100\"\` It is an error to execute a -- SQL statement with unbound parameters. esqlrParams :: Lens' ExecuteSQLRequest (Maybe ExecuteSQLRequestParams) esqlrParams = lens _esqlrParams (\ s a -> s{_esqlrParams = a})
757
esqlrParams :: Lens' ExecuteSQLRequest (Maybe ExecuteSQLRequestParams) esqlrParams = lens _esqlrParams (\ s a -> s{_esqlrParams = a})
135
esqlrParams = lens _esqlrParams (\ s a -> s{_esqlrParams = a})
64
true
true
1
9
114
60
33
27
null
null
ivanperez-keera/SoOSiM-ui
src/Graphics/Diagrams/Transformations/SimState2MultiCoreStatus.hs
bsd-3-clause
compPendingInputs :: S.ComponentContext -> IO [S.Input Dynamic] compPendingInputs (S.CC _ _ _ _ _ b _ _) = readTVarIO b
119
compPendingInputs :: S.ComponentContext -> IO [S.Input Dynamic] compPendingInputs (S.CC _ _ _ _ _ b _ _) = readTVarIO b
119
compPendingInputs (S.CC _ _ _ _ _ b _ _) = readTVarIO b
55
false
true
0
9
19
56
27
29
null
null
UoYCS-plasma/LazySmallCheck2012
suite/Functionality.hs
bsd-3-clause
---------------------------------------------------------------------- -- From Claessen and Hughes, 2000 -- (f . g) . h == f . (g . h) test9 = Test "Associativity of compose." (\f g h x -> let typ_f = f :: Peano -> Peano typ_g = g :: Peano -> Peano typ_h = h :: Peano -> Peano in (f . (g . h)) x == ((f . g) . h) x) True 7
412
test9 = Test "Associativity of compose." (\f g h x -> let typ_f = f :: Peano -> Peano typ_g = g :: Peano -> Peano typ_h = h :: Peano -> Peano in (f . (g . h)) x == ((f . g) . h) x) True 7
274
test9 = Test "Associativity of compose." (\f g h x -> let typ_f = f :: Peano -> Peano typ_g = g :: Peano -> Peano typ_h = h :: Peano -> Peano in (f . (g . h)) x == ((f . g) . h) x) True 7
274
true
false
0
15
157
112
61
51
null
null
fehu/h-agents
src/AgentSystem/Simple/Template.hs
mit
_genAgentSystemInstance = _mkInstance "AgentSystem" "simpleAgentSystem" [ "listAgentsByRole", "listAgentsOfRoles" , "findAgentOfRole", "newAgentOfRole" ]
230
_genAgentSystemInstance = _mkInstance "AgentSystem" "simpleAgentSystem" [ "listAgentsByRole", "listAgentsOfRoles" , "findAgentOfRole", "newAgentOfRole" ]
230
_genAgentSystemInstance = _mkInstance "AgentSystem" "simpleAgentSystem" [ "listAgentsByRole", "listAgentsOfRoles" , "findAgentOfRole", "newAgentOfRole" ]
230
false
false
0
6
88
25
14
11
null
null
danidiaz/pianola
src/Pianola.hs
mit
feed :: Monad m => m o -> Pianola m l o a -> Producer Delay (ErrorT String (Producer l m)) a feed mom pi = let smashMaybe m = runErrorT m >>= lift . ErrorT . return smashProducer = forever $ await >>= lift . lift . yield smash mp = runEffect $ smashMaybe mp >-> smashProducer pi' = hoist (hoist (smash . hoist (hoist $ runObserver mom))) $ unPianola pi injector = forever $ do s <- await lift . lift . lift . lift $ unseal s in runEffect $ pi' >-> injector
537
feed :: Monad m => m o -> Pianola m l o a -> Producer Delay (ErrorT String (Producer l m)) a feed mom pi = let smashMaybe m = runErrorT m >>= lift . ErrorT . return smashProducer = forever $ await >>= lift . lift . yield smash mp = runEffect $ smashMaybe mp >-> smashProducer pi' = hoist (hoist (smash . hoist (hoist $ runObserver mom))) $ unPianola pi injector = forever $ do s <- await lift . lift . lift . lift $ unseal s in runEffect $ pi' >-> injector
537
feed mom pi = let smashMaybe m = runErrorT m >>= lift . ErrorT . return smashProducer = forever $ await >>= lift . lift . yield smash mp = runEffect $ smashMaybe mp >-> smashProducer pi' = hoist (hoist (smash . hoist (hoist $ runObserver mom))) $ unPianola pi injector = forever $ do s <- await lift . lift . lift . lift $ unseal s in runEffect $ pi' >-> injector
444
false
true
4
18
176
230
108
122
null
null
DaMSL/K3
examples/analysis/FusionHarness.hs
apache-2.0
mapFoldProg :: String mapFoldProg = "\ \ typedef MyC = collection {a:int} @Collection \ \ declare c : MyC \ \ declare d : MyC \ \ trigger t : () = \\_ -> ( \ \ c.insert {a:5}; \ \ ((c.map (\\r -> r.a + 1)) \ \ .fold (\\acc -> \\r -> if r.elem > 5 then () else ()) ()) \ \ ) \ \ "
604
mapFoldProg :: String mapFoldProg = "\ \ typedef MyC = collection {a:int} @Collection \ \ declare c : MyC \ \ declare d : MyC \ \ trigger t : () = \\_ -> ( \ \ c.insert {a:5}; \ \ ((c.map (\\r -> r.a + 1)) \ \ .fold (\\acc -> \\r -> if r.elem > 5 then () else ()) ()) \ \ ) \ \ "
604
mapFoldProg = "\ \ typedef MyC = collection {a:int} @Collection \ \ declare c : MyC \ \ declare d : MyC \ \ trigger t : () = \\_ -> ( \ \ c.insert {a:5}; \ \ ((c.map (\\r -> r.a + 1)) \ \ .fold (\\acc -> \\r -> if r.elem > 5 then () else ()) ()) \ \ ) \ \ "
582
false
true
0
4
393
11
6
5
null
null
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/CreateVolume.hs
mpl-2.0
cvrAttachments :: Lens' CreateVolumeResponse [VolumeAttachment] cvrAttachments = lens _cvrAttachments (\s a -> s { _cvrAttachments = a }) . _List
145
cvrAttachments :: Lens' CreateVolumeResponse [VolumeAttachment] cvrAttachments = lens _cvrAttachments (\s a -> s { _cvrAttachments = a }) . _List
145
cvrAttachments = lens _cvrAttachments (\s a -> s { _cvrAttachments = a }) . _List
81
false
true
0
10
19
46
25
21
null
null
llllllllll/h16cc
Assembler/Core.hs
gpl-2.0
suffixLength SuffixRegLit = 3
33
suffixLength SuffixRegLit = 3
33
suffixLength SuffixRegLit = 3
33
false
false
0
5
7
9
4
5
null
null
danr/hipspec
examples/old-examples/hip/Expr.hs
gpl-3.0
boolNot True = False
20
boolNot True = False
20
boolNot True = False
20
false
false
1
5
3
13
4
9
null
null
chameco/reliquary
src/Reliquary/Core/TypeCheck.hs
gpl-3.0
check _ CUnitType = return CStar
32
check _ CUnitType = return CStar
32
check _ CUnitType = return CStar
32
false
false
0
5
5
14
6
8
null
null
patperry/hs-linear-algebra
tests-old/STVector.hs
bsd-3-clause
prop_GetShiftedVector k = (\x -> getShiftedVector k x >>= abstract) `implements` (getShiftedVector_S k)
108
prop_GetShiftedVector k = (\x -> getShiftedVector k x >>= abstract) `implements` (getShiftedVector_S k)
108
prop_GetShiftedVector k = (\x -> getShiftedVector k x >>= abstract) `implements` (getShiftedVector_S k)
108
false
false
0
9
17
38
20
18
null
null
pyrtsa/yampa-demos-template
src/Graphics.hs
bsd-3-clause
renderObject :: SDL.Renderer -> Int -> Object -> IO () renderObject renderer winHeight obj = setRenderAttrs >> renderShape where setRenderAttrs = do let (RGB r g b) = toSRGB24 $ objColour obj SDL.setRenderDrawColor renderer (V4 r g b maxBound) renderShape = case objShape obj of Rectangle x y -> SDL.renderFillRect renderer $ Just $ SDL.Rectangle (P (V2 (toEnum $ floor px) (toEnum $ winHeight - floor py))) (V2 (toEnum x) (toEnum y)) Scene objs -> do SDL.renderClear renderer mapM_ (renderObject renderer winHeight) objs Circle r -> SDL.renderDrawPoints renderer $ Vector.fromList $ map (\(x,y) -> P (V2 (toEnum x) (toEnum y))) $ translate (floor px, winHeight - floor py) $ rasterCircle r (px, py) = objPos obj -- | Get octant points for a circle of given radius.
1,139
renderObject :: SDL.Renderer -> Int -> Object -> IO () renderObject renderer winHeight obj = setRenderAttrs >> renderShape where setRenderAttrs = do let (RGB r g b) = toSRGB24 $ objColour obj SDL.setRenderDrawColor renderer (V4 r g b maxBound) renderShape = case objShape obj of Rectangle x y -> SDL.renderFillRect renderer $ Just $ SDL.Rectangle (P (V2 (toEnum $ floor px) (toEnum $ winHeight - floor py))) (V2 (toEnum x) (toEnum y)) Scene objs -> do SDL.renderClear renderer mapM_ (renderObject renderer winHeight) objs Circle r -> SDL.renderDrawPoints renderer $ Vector.fromList $ map (\(x,y) -> P (V2 (toEnum x) (toEnum y))) $ translate (floor px, winHeight - floor py) $ rasterCircle r (px, py) = objPos obj -- | Get octant points for a circle of given radius.
1,139
renderObject renderer winHeight obj = setRenderAttrs >> renderShape where setRenderAttrs = do let (RGB r g b) = toSRGB24 $ objColour obj SDL.setRenderDrawColor renderer (V4 r g b maxBound) renderShape = case objShape obj of Rectangle x y -> SDL.renderFillRect renderer $ Just $ SDL.Rectangle (P (V2 (toEnum $ floor px) (toEnum $ winHeight - floor py))) (V2 (toEnum x) (toEnum y)) Scene objs -> do SDL.renderClear renderer mapM_ (renderObject renderer winHeight) objs Circle r -> SDL.renderDrawPoints renderer $ Vector.fromList $ map (\(x,y) -> P (V2 (toEnum x) (toEnum y))) $ translate (floor px, winHeight - floor py) $ rasterCircle r (px, py) = objPos obj -- | Get octant points for a circle of given radius.
1,084
false
true
2
20
500
346
165
181
null
null
hasufell/CGA
Graphics/Diagram/Core.hs
gpl-2.0
-- |Extract the upper bound of the x-axis dimension. diagXmax :: DiagProp -> Double diagXmax = snd . xDimension
111
diagXmax :: DiagProp -> Double diagXmax = snd . xDimension
58
diagXmax = snd . xDimension
27
true
true
0
7
18
27
12
15
null
null
sapek/pandoc
src/Text/Pandoc/Templates.hs
gpl-2.0
multiLookup :: [Text] -> Value -> Maybe Value multiLookup [] x = Just x
71
multiLookup :: [Text] -> Value -> Maybe Value multiLookup [] x = Just x
71
multiLookup [] x = Just x
25
false
true
0
7
13
35
17
18
null
null
mrakgr/futhark
src/Futhark/Transform/FirstOrderTransform.hs
bsd-3-clause
copyIfArray (Var v) = Var <$> copyIfArrayName v
47
copyIfArray (Var v) = Var <$> copyIfArrayName v
47
copyIfArray (Var v) = Var <$> copyIfArrayName v
47
false
false
0
7
7
22
10
12
null
null
alexander-at-github/eta
libraries/base/GHC/Natural.hs
bsd-3-clause
timesNatural (NatS# x) (NatS# y) = case timesWord2# x y of (# 0##, 0## #) -> NatS# 0## (# 0##, xy #) -> NatS# xy (# h , l #) -> NatJ# $ wordToBigNat2 h l
169
timesNatural (NatS# x) (NatS# y) = case timesWord2# x y of (# 0##, 0## #) -> NatS# 0## (# 0##, xy #) -> NatS# xy (# h , l #) -> NatJ# $ wordToBigNat2 h l
169
timesNatural (NatS# x) (NatS# y) = case timesWord2# x y of (# 0##, 0## #) -> NatS# 0## (# 0##, xy #) -> NatS# xy (# h , l #) -> NatJ# $ wordToBigNat2 h l
169
false
false
0
9
51
82
39
43
null
null
input-output-hk/pos-haskell-prototype
core/src/Pos/Core/Common/Coin.hs
mit
divCoin :: Integral b => Coin -> b -> Coin divCoin (unsafeGetCoin -> a) b = Coin (a `div` fromIntegral b)
105
divCoin :: Integral b => Coin -> b -> Coin divCoin (unsafeGetCoin -> a) b = Coin (a `div` fromIntegral b)
105
divCoin (unsafeGetCoin -> a) b = Coin (a `div` fromIntegral b)
62
false
true
0
8
20
53
27
26
null
null
synsem/texhs
src/Text/TeX/Parser/Basic.hs
gpl-3.0
-- Note: This parser will fail on certain unexpected atoms -- that are not allowed as bare (ungrouped) arguments to a command -- (e.g. whitespace, align marks, math groups, superscripts, subscripts). -- | Parse the content of an obligatory argument: -- the content of a group or a single atom. argbody :: TeXParser TeX argbody = choice [ groupbody , count 1 anyPlainChar , count 1 command ]
398
argbody :: TeXParser TeX argbody = choice [ groupbody , count 1 anyPlainChar , count 1 command ]
104
argbody = choice [ groupbody , count 1 anyPlainChar , count 1 command ]
79
true
true
0
6
75
41
23
18
null
null
pparkkin/eta
compiler/ETA/TypeCheck/TcPatSyn.hs
bsd-3-clause
------------------------- -- Shared by both tcInferPatSyn and tcCheckPatSyn tc_patsyn_finish :: Located Name -> HsPatSynDir Name -> Bool -> LPat Id -> ([TcTyVar], [PredType], TcEvBinds, [EvVar]) -> ([TcTyVar], [TcType], [PredType], TcEvBinds, [EvVar]) -> [(Var, HsWrapper)] -> TcType -> TcM (PatSyn, LHsBinds Id) tc_patsyn_finish lname dir is_infix lpat' (univ_tvs, req_theta, req_ev_binds, req_dicts) (ex_tvs, subst, prov_theta, prov_ev_binds, prov_dicts) wrapped_args pat_ty = do { -- Zonk everything. We are about to build a final PatSyn -- so there had better be no unification variables in there univ_tvs <- mapM zonkQuantifiedTyVar univ_tvs ; ex_tvs <- mapM zonkQuantifiedTyVar ex_tvs ; prov_theta <- zonkTcThetaType prov_theta ; req_theta <- zonkTcThetaType req_theta ; pat_ty <- zonkTcType pat_ty ; wrapped_args <- mapM zonk_wrapped_arg wrapped_args ; let qtvs = univ_tvs ++ ex_tvs theta = prov_theta ++ req_theta arg_tys = map (varType . fst) wrapped_args ; traceTc "tc_patsyn_finish {" $ ppr (unLoc lname) $$ ppr (unLoc lpat') $$ ppr (univ_tvs, req_theta, req_ev_binds, req_dicts) $$ ppr (ex_tvs, subst, prov_theta, prov_ev_binds, prov_dicts) $$ ppr wrapped_args $$ ppr pat_ty -- Make the 'matcher' ; (matcher_id, matcher_bind) <- tcPatSynMatcher lname lpat' (univ_tvs, req_theta, req_ev_binds, req_dicts) (ex_tvs, subst, prov_theta, prov_ev_binds, prov_dicts) wrapped_args -- Not necessarily zonked pat_ty -- Make the 'builder' ; builder_id <- mkPatSynBuilderId dir lname qtvs theta arg_tys pat_ty -- Make the PatSyn itself ; let patSyn = mkPatSyn (unLoc lname) is_infix (univ_tvs, req_theta) (ex_tvs, prov_theta) arg_tys pat_ty matcher_id builder_id ; return (patSyn, matcher_bind) } where zonk_wrapped_arg :: (Var, HsWrapper) -> TcM (Var, HsWrapper) -- The HsWrapper will get zonked later, as part of the LHsBinds zonk_wrapped_arg (arg_id, wrap) = do { arg_id <- zonkId arg_id ; return (arg_id, wrap) } {- ************************************************************************ * * Constructing the "matcher" Id and its binding * * ************************************************************************ -}
3,044
tc_patsyn_finish :: Located Name -> HsPatSynDir Name -> Bool -> LPat Id -> ([TcTyVar], [PredType], TcEvBinds, [EvVar]) -> ([TcTyVar], [TcType], [PredType], TcEvBinds, [EvVar]) -> [(Var, HsWrapper)] -> TcType -> TcM (PatSyn, LHsBinds Id) tc_patsyn_finish lname dir is_infix lpat' (univ_tvs, req_theta, req_ev_binds, req_dicts) (ex_tvs, subst, prov_theta, prov_ev_binds, prov_dicts) wrapped_args pat_ty = do { -- Zonk everything. We are about to build a final PatSyn -- so there had better be no unification variables in there univ_tvs <- mapM zonkQuantifiedTyVar univ_tvs ; ex_tvs <- mapM zonkQuantifiedTyVar ex_tvs ; prov_theta <- zonkTcThetaType prov_theta ; req_theta <- zonkTcThetaType req_theta ; pat_ty <- zonkTcType pat_ty ; wrapped_args <- mapM zonk_wrapped_arg wrapped_args ; let qtvs = univ_tvs ++ ex_tvs theta = prov_theta ++ req_theta arg_tys = map (varType . fst) wrapped_args ; traceTc "tc_patsyn_finish {" $ ppr (unLoc lname) $$ ppr (unLoc lpat') $$ ppr (univ_tvs, req_theta, req_ev_binds, req_dicts) $$ ppr (ex_tvs, subst, prov_theta, prov_ev_binds, prov_dicts) $$ ppr wrapped_args $$ ppr pat_ty -- Make the 'matcher' ; (matcher_id, matcher_bind) <- tcPatSynMatcher lname lpat' (univ_tvs, req_theta, req_ev_binds, req_dicts) (ex_tvs, subst, prov_theta, prov_ev_binds, prov_dicts) wrapped_args -- Not necessarily zonked pat_ty -- Make the 'builder' ; builder_id <- mkPatSynBuilderId dir lname qtvs theta arg_tys pat_ty -- Make the PatSyn itself ; let patSyn = mkPatSyn (unLoc lname) is_infix (univ_tvs, req_theta) (ex_tvs, prov_theta) arg_tys pat_ty matcher_id builder_id ; return (patSyn, matcher_bind) } where zonk_wrapped_arg :: (Var, HsWrapper) -> TcM (Var, HsWrapper) -- The HsWrapper will get zonked later, as part of the LHsBinds zonk_wrapped_arg (arg_id, wrap) = do { arg_id <- zonkId arg_id ; return (arg_id, wrap) } {- ************************************************************************ * * Constructing the "matcher" Id and its binding * * ************************************************************************ -}
2,968
tc_patsyn_finish lname dir is_infix lpat' (univ_tvs, req_theta, req_ev_binds, req_dicts) (ex_tvs, subst, prov_theta, prov_ev_binds, prov_dicts) wrapped_args pat_ty = do { -- Zonk everything. We are about to build a final PatSyn -- so there had better be no unification variables in there univ_tvs <- mapM zonkQuantifiedTyVar univ_tvs ; ex_tvs <- mapM zonkQuantifiedTyVar ex_tvs ; prov_theta <- zonkTcThetaType prov_theta ; req_theta <- zonkTcThetaType req_theta ; pat_ty <- zonkTcType pat_ty ; wrapped_args <- mapM zonk_wrapped_arg wrapped_args ; let qtvs = univ_tvs ++ ex_tvs theta = prov_theta ++ req_theta arg_tys = map (varType . fst) wrapped_args ; traceTc "tc_patsyn_finish {" $ ppr (unLoc lname) $$ ppr (unLoc lpat') $$ ppr (univ_tvs, req_theta, req_ev_binds, req_dicts) $$ ppr (ex_tvs, subst, prov_theta, prov_ev_binds, prov_dicts) $$ ppr wrapped_args $$ ppr pat_ty -- Make the 'matcher' ; (matcher_id, matcher_bind) <- tcPatSynMatcher lname lpat' (univ_tvs, req_theta, req_ev_binds, req_dicts) (ex_tvs, subst, prov_theta, prov_ev_binds, prov_dicts) wrapped_args -- Not necessarily zonked pat_ty -- Make the 'builder' ; builder_id <- mkPatSynBuilderId dir lname qtvs theta arg_tys pat_ty -- Make the PatSyn itself ; let patSyn = mkPatSyn (unLoc lname) is_infix (univ_tvs, req_theta) (ex_tvs, prov_theta) arg_tys pat_ty matcher_id builder_id ; return (patSyn, matcher_bind) } where zonk_wrapped_arg :: (Var, HsWrapper) -> TcM (Var, HsWrapper) -- The HsWrapper will get zonked later, as part of the LHsBinds zonk_wrapped_arg (arg_id, wrap) = do { arg_id <- zonkId arg_id ; return (arg_id, wrap) } {- ************************************************************************ * * Constructing the "matcher" Id and its binding * * ************************************************************************ -}
2,595
true
true
2
15
1,203
574
314
260
null
null
ocramz/sparse-linear-algebra
vector/src/Data/Sparse/Internal/CSB.hs
gpl-3.0
bBin, bCoords :: Integral t => t -> t -> t -> (t, t) bBin beta i j = (i `div` beta, j `div` beta)
97
bBin, bCoords :: Integral t => t -> t -> t -> (t, t) bBin beta i j = (i `div` beta, j `div` beta)
97
bBin beta i j = (i `div` beta, j `div` beta)
44
false
true
0
9
24
63
36
27
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/cmm/PprC.hs
bsd-3-clause
pprAssign _ r1 r2 | isFixedPtrReg r1 = mkAssign (mkP_ <> pprExpr1 r2) | Just ty <- strangeRegType r1 = mkAssign (parens ty <> pprExpr1 r2) | otherwise = mkAssign (pprExpr r2) where mkAssign x = if r1 == CmmGlobal BaseReg then ptext (sLit "ASSIGN_BaseReg") <> parens x <> semi else pprReg r1 <> ptext (sLit " = ") <> x <> semi -- --------------------------------------------------------------------- -- Registers
499
pprAssign _ r1 r2 | isFixedPtrReg r1 = mkAssign (mkP_ <> pprExpr1 r2) | Just ty <- strangeRegType r1 = mkAssign (parens ty <> pprExpr1 r2) | otherwise = mkAssign (pprExpr r2) where mkAssign x = if r1 == CmmGlobal BaseReg then ptext (sLit "ASSIGN_BaseReg") <> parens x <> semi else pprReg r1 <> ptext (sLit " = ") <> x <> semi -- --------------------------------------------------------------------- -- Registers
499
pprAssign _ r1 r2 | isFixedPtrReg r1 = mkAssign (mkP_ <> pprExpr1 r2) | Just ty <- strangeRegType r1 = mkAssign (parens ty <> pprExpr1 r2) | otherwise = mkAssign (pprExpr r2) where mkAssign x = if r1 == CmmGlobal BaseReg then ptext (sLit "ASSIGN_BaseReg") <> parens x <> semi else pprReg r1 <> ptext (sLit " = ") <> x <> semi -- --------------------------------------------------------------------- -- Registers
499
false
false
1
11
154
160
74
86
null
null
lukexi/freetype-gl-mini
src/Graphics/GL/Freetype/API.hs
bsd-2-clause
getGlyph :: MonadIO m => FontPtr -> Char -> m GlyphPtr getGlyph font char = liftIO $ withCWString [char] $ \charPtr -> do cwchar <- peek charPtr texture_font_get_glyph font cwchar
199
getGlyph :: MonadIO m => FontPtr -> Char -> m GlyphPtr getGlyph font char = liftIO $ withCWString [char] $ \charPtr -> do cwchar <- peek charPtr texture_font_get_glyph font cwchar
199
getGlyph font char = liftIO $ withCWString [char] $ \charPtr -> do cwchar <- peek charPtr texture_font_get_glyph font cwchar
144
false
true
0
11
49
76
34
42
null
null