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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wilbowma/accelerate
|
Data/Array/Accelerate/CUDA/CodeGen/Util.hs
|
bsd-3-clause
|
mkDeviceFun :: String -> CType -> [(CType,String)] -> [CExpr] -> CExtDecl
mkDeviceFun name tyout args expr =
let body = [ CBlockDecl (CDecl (map CTypeSpec tyout) [(Just (CDeclr (Just (internalIdent "r")) [] Nothing [] internalNode), Just (mkInitList expr), Nothing)] internalNode)
, CBlockStmt (CReturn (Just (CVar (internalIdent "r") internalNode)) internalNode)]
in
mkDeviceFun' name tyout args body
| 420
|
mkDeviceFun :: String -> CType -> [(CType,String)] -> [CExpr] -> CExtDecl
mkDeviceFun name tyout args expr =
let body = [ CBlockDecl (CDecl (map CTypeSpec tyout) [(Just (CDeclr (Just (internalIdent "r")) [] Nothing [] internalNode), Just (mkInitList expr), Nothing)] internalNode)
, CBlockStmt (CReturn (Just (CVar (internalIdent "r") internalNode)) internalNode)]
in
mkDeviceFun' name tyout args body
| 420
|
mkDeviceFun name tyout args expr =
let body = [ CBlockDecl (CDecl (map CTypeSpec tyout) [(Just (CDeclr (Just (internalIdent "r")) [] Nothing [] internalNode), Just (mkInitList expr), Nothing)] internalNode)
, CBlockStmt (CReturn (Just (CVar (internalIdent "r") internalNode)) internalNode)]
in
mkDeviceFun' name tyout args body
| 346
| false
| true
| 0
| 21
| 73
| 189
| 93
| 96
| null | null |
spaceships/circuit-synthesis
|
src/Circuit/Format/Graphviz.hs
|
mit
|
mkGroup ds = encloseSep lbrace rbrace semi ds
| 46
|
mkGroup ds = encloseSep lbrace rbrace semi ds
| 46
|
mkGroup ds = encloseSep lbrace rbrace semi ds
| 46
| false
| false
| 0
| 5
| 8
| 18
| 8
| 10
| null | null |
TOSPIO/yi
|
example-configs/yi-vim.hs
|
gpl-2.0
|
myModes :: [AnyMode]
myModes = [
AnyMode Haskell.fastMode {
-- Disable beautification
modePrettify = const $ return ()
}
]
| 170
|
myModes :: [AnyMode]
myModes = [
AnyMode Haskell.fastMode {
-- Disable beautification
modePrettify = const $ return ()
}
]
| 170
|
myModes = [
AnyMode Haskell.fastMode {
-- Disable beautification
modePrettify = const $ return ()
}
]
| 149
| false
| true
| 0
| 11
| 67
| 40
| 22
| 18
| null | null |
ku-fpg/marked-pretty
|
src/Text/PrettyPrint/MarkedHughesPJ.hs
|
bsd-3-clause
|
-- Specification: sepNB p k ys = sep1 (text "" <> p) k ys
-- Called when we have already found some text in the first item
-- We have to eat up nests
sepNB :: Bool -> MDoc a -> Int -> [MDoc a] -> MDoc a
sepNB g (Nest _ p) k ys
= sepNB g p k ys
| 245
|
sepNB :: Bool -> MDoc a -> Int -> [MDoc a] -> MDoc a
sepNB g (Nest _ p) k ys
= sepNB g p k ys
| 95
|
sepNB g (Nest _ p) k ys
= sepNB g p k ys
| 42
| true
| true
| 0
| 10
| 62
| 68
| 34
| 34
| null | null |
ksaveljev/hake-2
|
src/Render/OpenGL/QGLConstants.hs
|
bsd-3-clause
|
glNotEqual = 0x0205 :: Int
| 26
|
glNotEqual = 0x0205 :: Int
| 26
|
glNotEqual = 0x0205 :: Int
| 26
| false
| false
| 2
| 5
| 4
| 15
| 5
| 10
| null | null |
keithodulaigh/Hets
|
RelationalScheme/Keywords.hs
|
gpl-2.0
|
rsDatetimeId :: Id
rsDatetimeId = stringToId rsDatetime
| 55
|
rsDatetimeId :: Id
rsDatetimeId = stringToId rsDatetime
| 55
|
rsDatetimeId = stringToId rsDatetime
| 36
| false
| true
| 0
| 6
| 6
| 21
| 8
| 13
| null | null |
ihc/futhark
|
src/Futhark/Transform/FirstOrderTransform.hs
|
isc
|
transformLambda :: (MonadFreshNames m,
Bindable lore, BinderOps lore,
LocalScope somelore m,
SameScope somelore lore,
LetAttr SOACS ~ LetAttr lore,
CanBeAliased (Op lore)) =>
Lambda -> m (AST.Lambda lore)
transformLambda (Lambda params body rettype) = do
body' <- runBodyBinder $
localScope (scopeOfLParams params) $
transformBody body
return $ Lambda params body' rettype
-- | Recursively first-order-transform a lambda.
| 567
|
transformLambda :: (MonadFreshNames m,
Bindable lore, BinderOps lore,
LocalScope somelore m,
SameScope somelore lore,
LetAttr SOACS ~ LetAttr lore,
CanBeAliased (Op lore)) =>
Lambda -> m (AST.Lambda lore)
transformLambda (Lambda params body rettype) = do
body' <- runBodyBinder $
localScope (scopeOfLParams params) $
transformBody body
return $ Lambda params body' rettype
-- | Recursively first-order-transform a lambda.
| 567
|
transformLambda (Lambda params body rettype) = do
body' <- runBodyBinder $
localScope (scopeOfLParams params) $
transformBody body
return $ Lambda params body' rettype
-- | Recursively first-order-transform a lambda.
| 243
| false
| true
| 0
| 12
| 202
| 144
| 69
| 75
| null | null |
ksaveljev/hake-2
|
src/Client/MenuGlobals.hs
|
bsd-3-clause
|
creditsActionRef :: Ref MenuActionS
creditsActionRef = Ref 7
| 60
|
creditsActionRef :: Ref MenuActionS
creditsActionRef = Ref 7
| 60
|
creditsActionRef = Ref 7
| 24
| false
| true
| 0
| 5
| 7
| 17
| 8
| 9
| null | null |
Kyly/liquidhaskell
|
benchmarks/icfp15/neg/DataBase.hs
|
bsd-3-clause
|
select prop (x:xs) | prop x = x : select prop xs
| otherwise = select prop xs
| 99
|
select prop (x:xs) | prop x = x : select prop xs
| otherwise = select prop xs
| 99
|
select prop (x:xs) | prop x = x : select prop xs
| otherwise = select prop xs
| 99
| false
| false
| 1
| 8
| 39
| 50
| 22
| 28
| null | null |
mettekou/ghc
|
compiler/main/Hooks.hs
|
bsd-3-clause
|
lookupHook :: (Hooks -> Maybe a) -> a -> DynFlags -> a
lookupHook hook def = fromMaybe def . hook . hooks
| 105
|
lookupHook :: (Hooks -> Maybe a) -> a -> DynFlags -> a
lookupHook hook def = fromMaybe def . hook . hooks
| 105
|
lookupHook hook def = fromMaybe def . hook . hooks
| 50
| false
| true
| 0
| 9
| 21
| 55
| 25
| 30
| null | null |
olorin/amazonka
|
amazonka-ec2/gen/Network/AWS/EC2/DescribeVPCAttribute.hs
|
mpl-2.0
|
-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is 'DryRunOperation'.
-- Otherwise, it is 'UnauthorizedOperation'.
dvpcaDryRun :: Lens' DescribeVPCAttribute (Maybe Bool)
dvpcaDryRun = lens _dvpcaDryRun (\ s a -> s{_dvpcaDryRun = a})
| 386
|
dvpcaDryRun :: Lens' DescribeVPCAttribute (Maybe Bool)
dvpcaDryRun = lens _dvpcaDryRun (\ s a -> s{_dvpcaDryRun = a})
| 117
|
dvpcaDryRun = lens _dvpcaDryRun (\ s a -> s{_dvpcaDryRun = a})
| 62
| true
| true
| 0
| 9
| 56
| 49
| 28
| 21
| null | null |
xcv-/LCC
|
lib/Language/LCC/Parser.hs
|
gpl-3.0
|
importParser :: Parser Import
importParser = do
path <- Lex.reserved "import" *> Lex.identifier
name <- Lex.reserved "as" *> Lex.identifier
return (Import path name)
| 182
|
importParser :: Parser Import
importParser = do
path <- Lex.reserved "import" *> Lex.identifier
name <- Lex.reserved "as" *> Lex.identifier
return (Import path name)
| 182
|
importParser = do
path <- Lex.reserved "import" *> Lex.identifier
name <- Lex.reserved "as" *> Lex.identifier
return (Import path name)
| 152
| false
| true
| 0
| 10
| 39
| 64
| 29
| 35
| null | null |
RobinKrom/fasths
|
src/Codec/Fast/Test/Data.hs
|
bsd-3-clause
|
arbitraryValueForByteVectorField _ (FieldInstrContent _ (Just Mandatory) (Just(Delta _ ))) _ = Just <$> arbitrary
| 113
|
arbitraryValueForByteVectorField _ (FieldInstrContent _ (Just Mandatory) (Just(Delta _ ))) _ = Just <$> arbitrary
| 113
|
arbitraryValueForByteVectorField _ (FieldInstrContent _ (Just Mandatory) (Just(Delta _ ))) _ = Just <$> arbitrary
| 113
| false
| false
| 0
| 11
| 13
| 45
| 22
| 23
| null | null |
themoritz/cabal
|
cabal-install/Distribution/Client/TargetSelector.hs
|
bsd-3-clause
|
guardNamespaceModule :: String -> Match ()
guardNamespaceModule = guardToken ["mod", "module"] "'module' namespace"
| 115
|
guardNamespaceModule :: String -> Match ()
guardNamespaceModule = guardToken ["mod", "module"] "'module' namespace"
| 115
|
guardNamespaceModule = guardToken ["mod", "module"] "'module' namespace"
| 72
| false
| true
| 0
| 7
| 12
| 31
| 16
| 15
| null | null |
chemouna/99Haskell
|
src/Problem12.hs
|
bsd-3-clause
|
-- Test
decodeModifiedSpec :: Spec
decodeModifiedSpec = do
describe "decodeModified" $ do
it "Decode a run-length encoded list." $ do
decodeModified [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
it "[decodeModified2] Decode a run-length encoded list." $ do
decodeModified2 [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
it "[decodeModified3] Decode a run-length encoded list." $ do
decodeModified3 [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
it "[decodeModified4] Decode a run-length encoded list." $ do
decodeModified4 [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
it "[decodeModified5] Decode a run-length encoded list." $ do
decodeModified5 [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
-- quickCheck
| 1,169
|
decodeModifiedSpec :: Spec
decodeModifiedSpec = do
describe "decodeModified" $ do
it "Decode a run-length encoded list." $ do
decodeModified [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
it "[decodeModified2] Decode a run-length encoded list." $ do
decodeModified2 [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
it "[decodeModified3] Decode a run-length encoded list." $ do
decodeModified3 [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
it "[decodeModified4] Decode a run-length encoded list." $ do
decodeModified4 [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
it "[decodeModified5] Decode a run-length encoded list." $ do
decodeModified5 [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
-- quickCheck
| 1,161
|
decodeModifiedSpec = do
describe "decodeModified" $ do
it "Decode a run-length encoded list." $ do
decodeModified [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
it "[decodeModified2] Decode a run-length encoded list." $ do
decodeModified2 [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
it "[decodeModified3] Decode a run-length encoded list." $ do
decodeModified3 [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
it "[decodeModified4] Decode a run-length encoded list." $ do
decodeModified4 [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
it "[decodeModified5] Decode a run-length encoded list." $ do
decodeModified5 [Multiple 4 'a',Single 'b',Multiple 2 'c', Multiple 2 'a',Single 'd',Multiple 4 'e']
`shouldBe` "aaaabccaadeeee"
-- quickCheck
| 1,134
| true
| true
| 0
| 16
| 262
| 360
| 173
| 187
| null | null |
tsujigiri/markov-text
|
app/Main.hs
|
bsd-3-clause
|
takeUntilFullStop :: String -> String
takeUntilFullStop (char:text)
| char `elem` ".?!" = [char]
| otherwise = char:(takeUntilFullStop text)
| 148
|
takeUntilFullStop :: String -> String
takeUntilFullStop (char:text)
| char `elem` ".?!" = [char]
| otherwise = char:(takeUntilFullStop text)
| 148
|
takeUntilFullStop (char:text)
| char `elem` ".?!" = [char]
| otherwise = char:(takeUntilFullStop text)
| 110
| false
| true
| 2
| 9
| 25
| 69
| 32
| 37
| null | null |
forked-upstream-packages-for-ghcjs/ghc
|
compiler/types/TyCon.hs
|
bsd-3-clause
|
tyConParent _ = NoParentTyCon
| 64
|
tyConParent _ = NoParentTyCon
| 64
|
tyConParent _ = NoParentTyCon
| 64
| false
| false
| 0
| 4
| 38
| 10
| 4
| 6
| null | null |
JoeyEremondi/utrecht-apa-p1
|
src/Docs.hs
|
bsd-3-clause
|
filterAliases :: Var.Listing Var.Value -> [Docs.Alias] -> [Docs.Alias]
filterAliases (Var.Listing exports open) aliases =
case open of
True -> aliases
False ->
let names =
Set.fromList (Var.getAliases exports)
in
filter (\value -> Set.member (Docs.aliasName value) names) aliases
| 323
|
filterAliases :: Var.Listing Var.Value -> [Docs.Alias] -> [Docs.Alias]
filterAliases (Var.Listing exports open) aliases =
case open of
True -> aliases
False ->
let names =
Set.fromList (Var.getAliases exports)
in
filter (\value -> Set.member (Docs.aliasName value) names) aliases
| 323
|
filterAliases (Var.Listing exports open) aliases =
case open of
True -> aliases
False ->
let names =
Set.fromList (Var.getAliases exports)
in
filter (\value -> Set.member (Docs.aliasName value) names) aliases
| 252
| false
| true
| 0
| 16
| 80
| 119
| 59
| 60
| null | null |
neglectedvalue/xmobar-freebsd
|
Plugins/EWMH.hs
|
bsd-3-clause
|
modifier (Color fg bg) = \x -> concat ["<fc=", fg, if null bg then "" else "," ++ bg
, ">", x, "</fc>"]
| 141
|
modifier (Color fg bg) = \x -> concat ["<fc=", fg, if null bg then "" else "," ++ bg
, ">", x, "</fc>"]
| 141
|
modifier (Color fg bg) = \x -> concat ["<fc=", fg, if null bg then "" else "," ++ bg
, ">", x, "</fc>"]
| 141
| false
| false
| 0
| 9
| 60
| 58
| 32
| 26
| null | null |
pgj/bead
|
src/Bead/Persistence/NoSQLDir.hs
|
bsd-3-clause
|
getFile :: Username -> UsersFile -> Persist FilePath
getFile username userfile = do
checkIfUserDir username
let dirname = dirName username
fname = dirname </> (usersFile (const "public-files") (const "private-files") userfile)
</> (usersFile id id userfile)
exist <- hasNoRollback $ doesFileExist fname
unless exist . throwEx . userError $ concat [
"File (", fname, ") does not exist in users folder ("
, show username, ")"
]
return fname
| 494
|
getFile :: Username -> UsersFile -> Persist FilePath
getFile username userfile = do
checkIfUserDir username
let dirname = dirName username
fname = dirname </> (usersFile (const "public-files") (const "private-files") userfile)
</> (usersFile id id userfile)
exist <- hasNoRollback $ doesFileExist fname
unless exist . throwEx . userError $ concat [
"File (", fname, ") does not exist in users folder ("
, show username, ")"
]
return fname
| 494
|
getFile username userfile = do
checkIfUserDir username
let dirname = dirName username
fname = dirname </> (usersFile (const "public-files") (const "private-files") userfile)
</> (usersFile id id userfile)
exist <- hasNoRollback $ doesFileExist fname
unless exist . throwEx . userError $ concat [
"File (", fname, ") does not exist in users folder ("
, show username, ")"
]
return fname
| 441
| false
| true
| 0
| 15
| 123
| 149
| 71
| 78
| null | null |
dvvc/gapaint
|
Bitmap.hs
|
gpl-3.0
|
readPixels :: [String] -> [Color]
readPixels [] = []
| 52
|
readPixels :: [String] -> [Color]
readPixels [] = []
| 52
|
readPixels [] = []
| 18
| false
| true
| 0
| 6
| 8
| 28
| 15
| 13
| null | null |
sdiehl/ghc
|
compiler/GHC/HsToCore/PmCheck.hs
|
bsd-3-clause
|
translateLPat :: FamInstEnvs -> Id -> LPat GhcTc -> DsM GrdVec
translateLPat fam_insts x = translatePat fam_insts x . unLoc
| 123
|
translateLPat :: FamInstEnvs -> Id -> LPat GhcTc -> DsM GrdVec
translateLPat fam_insts x = translatePat fam_insts x . unLoc
| 123
|
translateLPat fam_insts x = translatePat fam_insts x . unLoc
| 60
| false
| true
| 0
| 8
| 19
| 43
| 20
| 23
| null | null |
GaloisInc/HaNS
|
src/Hans/IP4/ArpTable.hs
|
bsd-3-clause
|
-- | Returns either the address, or an empty 'MVar' that will eventually contain
-- the 'Mac', or 'Nothing' if the Arp request fails.
resolveAddr :: ArpTable -> IP4 -> WaitStrategy res -> IO (QueryResult res)
resolveAddr arp addr strategy =
do mb <- lookupEntry arp addr
case mb of
Just mac -> return (Known mac)
Nothing -> registerWaiter arp addr strategy
-- | Register to wait on an entry in the table.
| 428
|
resolveAddr :: ArpTable -> IP4 -> WaitStrategy res -> IO (QueryResult res)
resolveAddr arp addr strategy =
do mb <- lookupEntry arp addr
case mb of
Just mac -> return (Known mac)
Nothing -> registerWaiter arp addr strategy
-- | Register to wait on an entry in the table.
| 294
|
resolveAddr arp addr strategy =
do mb <- lookupEntry arp addr
case mb of
Just mac -> return (Known mac)
Nothing -> registerWaiter arp addr strategy
-- | Register to wait on an entry in the table.
| 219
| true
| true
| 0
| 12
| 96
| 95
| 45
| 50
| null | null |
pawel-n/semi-iso
|
Control/Lens/SemiIso.hs
|
mit
|
-- | \-> Always returns the argument.
--
-- \<- Maps everything to a @()@.
--
-- Note that this isn't an @Iso'@ because
--
-- > unapply (constant x) >=> apply (constant x) /= id
--
-- But SemiIso laws do hold.
constant :: a -> SemiIso' () a
constant x = semiIso (\_ -> Right x) (\_ -> Right ())
| 294
|
constant :: a -> SemiIso' () a
constant x = semiIso (\_ -> Right x) (\_ -> Right ())
| 84
|
constant x = semiIso (\_ -> Right x) (\_ -> Right ())
| 53
| true
| true
| 0
| 9
| 61
| 63
| 36
| 27
| null | null |
msakai/multiset-large
|
Data/MultiSet/Large.hs
|
bsd-3-clause
|
-- | /O(log n)/. Retrieves the minimal element of the multiset,
-- and the set with that element removed.
-- @fail@s (in the monad) when passed an empty multiset.
minView :: Monad m => MultiSet a -> m (a, MultiSet a)
minView x
| null x = fail "MultiSet.minView: empty multiset"
| otherwise = return (deleteFindMin x)
| 327
|
minView :: Monad m => MultiSet a -> m (a, MultiSet a)
minView x
| null x = fail "MultiSet.minView: empty multiset"
| otherwise = return (deleteFindMin x)
| 160
|
minView x
| null x = fail "MultiSet.minView: empty multiset"
| otherwise = return (deleteFindMin x)
| 106
| true
| true
| 1
| 9
| 67
| 71
| 34
| 37
| null | null |
ekmett/ghc
|
compiler/cmm/CmmUtils.hs
|
bsd-3-clause
|
primElemRepCmmType Word32ElemRep = b32
| 38
|
primElemRepCmmType Word32ElemRep = b32
| 38
|
primElemRepCmmType Word32ElemRep = b32
| 38
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
badp/ganeti
|
src/Ganeti/OpParams.hs
|
gpl-2.0
|
pX509KeyName :: Field
pX509KeyName =
withDoc "Name of X509 key (remote export only)" .
optionalField $ simpleField "x509_key_name" [t| [JSValue] |]
| 151
|
pX509KeyName :: Field
pX509KeyName =
withDoc "Name of X509 key (remote export only)" .
optionalField $ simpleField "x509_key_name" [t| [JSValue] |]
| 151
|
pX509KeyName =
withDoc "Name of X509 key (remote export only)" .
optionalField $ simpleField "x509_key_name" [t| [JSValue] |]
| 129
| false
| true
| 0
| 7
| 24
| 31
| 17
| 14
| null | null |
fmapfmapfmap/amazonka
|
amazonka-opsworks/gen/Network/AWS/OpsWorks/DescribeRDSDBInstances.hs
|
mpl-2.0
|
-- | Creates a value of 'DescribeRDSDBInstancesResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'drdirsRDSDBInstances'
--
-- * 'drdirsResponseStatus'
describeRDSDBInstancesResponse
:: Int -- ^ 'drdirsResponseStatus'
-> DescribeRDSDBInstancesResponse
describeRDSDBInstancesResponse pResponseStatus_ =
DescribeRDSDBInstancesResponse'
{ _drdirsRDSDBInstances = Nothing
, _drdirsResponseStatus = pResponseStatus_
}
| 528
|
describeRDSDBInstancesResponse
:: Int -- ^ 'drdirsResponseStatus'
-> DescribeRDSDBInstancesResponse
describeRDSDBInstancesResponse pResponseStatus_ =
DescribeRDSDBInstancesResponse'
{ _drdirsRDSDBInstances = Nothing
, _drdirsResponseStatus = pResponseStatus_
}
| 284
|
describeRDSDBInstancesResponse pResponseStatus_ =
DescribeRDSDBInstancesResponse'
{ _drdirsRDSDBInstances = Nothing
, _drdirsResponseStatus = pResponseStatus_
}
| 176
| true
| true
| 0
| 7
| 82
| 49
| 28
| 21
| null | null |
lynnard/cocos2d-hs
|
src/Graphics/UI/Cocos2d/Widget.hs
|
bsd-3-clause
|
castTextToConst :: Text -> TextConst
castTextToConst (Text ptr') = TextConst $ HoppyF.castPtr ptr'
| 98
|
castTextToConst :: Text -> TextConst
castTextToConst (Text ptr') = TextConst $ HoppyF.castPtr ptr'
| 98
|
castTextToConst (Text ptr') = TextConst $ HoppyF.castPtr ptr'
| 61
| false
| true
| 0
| 7
| 12
| 33
| 16
| 17
| null | null |
nevrenato/Hets_Fork
|
CSL/Print_AS.hs
|
gpl-2.0
|
printCMD c@(Cmd s exps) -- TODO: remove the case := later
| s == ":=" = error $ "printCMD: use Ass for assignment representation! "
++ show c
| s == "constraint" = printExpression (exps !! 0)
| otherwise = let f l = text s <> parens (sepByCommas l)
in liftM f $ mapM printExpression exps
| 335
|
printCMD c@(Cmd s exps) -- TODO: remove the case := later
| s == ":=" = error $ "printCMD: use Ass for assignment representation! "
++ show c
| s == "constraint" = printExpression (exps !! 0)
| otherwise = let f l = text s <> parens (sepByCommas l)
in liftM f $ mapM printExpression exps
| 335
|
printCMD c@(Cmd s exps) -- TODO: remove the case := later
| s == ":=" = error $ "printCMD: use Ass for assignment representation! "
++ show c
| s == "constraint" = printExpression (exps !! 0)
| otherwise = let f l = text s <> parens (sepByCommas l)
in liftM f $ mapM printExpression exps
| 335
| false
| false
| 0
| 13
| 104
| 116
| 53
| 63
| null | null |
apyrgio/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
confdErrorArgument :: Int
confdErrorArgument = Types.confdErrorTypeToRaw ConfdErrorArgument
| 91
|
confdErrorArgument :: Int
confdErrorArgument = Types.confdErrorTypeToRaw ConfdErrorArgument
| 91
|
confdErrorArgument = Types.confdErrorTypeToRaw ConfdErrorArgument
| 65
| false
| true
| 0
| 6
| 6
| 16
| 8
| 8
| null | null |
urbanslug/ghc
|
compiler/codeGen/StgCmmPrim.hs
|
bsd-3-clause
|
-- The rest just translate straightforwardly
emitPrimOp dflags [res] op [arg]
| nopOp op
= emitAssign (CmmLocal res) arg
| Just (mop,rep) <- narrowOp op
= emitAssign (CmmLocal res) $
CmmMachOp (mop rep (wordWidth dflags)) [CmmMachOp (mop (wordWidth dflags) rep) [arg]]
| 292
|
emitPrimOp dflags [res] op [arg]
| nopOp op
= emitAssign (CmmLocal res) arg
| Just (mop,rep) <- narrowOp op
= emitAssign (CmmLocal res) $
CmmMachOp (mop rep (wordWidth dflags)) [CmmMachOp (mop (wordWidth dflags) rep) [arg]]
| 247
|
emitPrimOp dflags [res] op [arg]
| nopOp op
= emitAssign (CmmLocal res) arg
| Just (mop,rep) <- narrowOp op
= emitAssign (CmmLocal res) $
CmmMachOp (mop rep (wordWidth dflags)) [CmmMachOp (mop (wordWidth dflags) rep) [arg]]
| 247
| true
| false
| 0
| 13
| 64
| 127
| 61
| 66
| null | null |
olsner/ghc
|
compiler/basicTypes/VarEnv.hs
|
bsd-3-clause
|
delDVarEnvList :: DVarEnv a -> [Var] -> DVarEnv a
delDVarEnvList = delListFromUDFM
| 82
|
delDVarEnvList :: DVarEnv a -> [Var] -> DVarEnv a
delDVarEnvList = delListFromUDFM
| 82
|
delDVarEnvList = delListFromUDFM
| 32
| false
| true
| 0
| 7
| 11
| 28
| 14
| 14
| null | null |
akaihola/palindromi-haskell
|
src/Main.hs
|
mit
|
main :: IO ()
main = defaultMain [
bgroup "fib" [ bench "10" $ whnf isPalindrome ""
, bench "35" $ whnf isPalindrome "a"
, bench "37" $ whnf isPalindrome "aa"
]
]
| 248
|
main :: IO ()
main = defaultMain [
bgroup "fib" [ bench "10" $ whnf isPalindrome ""
, bench "35" $ whnf isPalindrome "a"
, bench "37" $ whnf isPalindrome "aa"
]
]
| 248
|
main = defaultMain [
bgroup "fib" [ bench "10" $ whnf isPalindrome ""
, bench "35" $ whnf isPalindrome "a"
, bench "37" $ whnf isPalindrome "aa"
]
]
| 234
| false
| true
| 0
| 10
| 118
| 72
| 34
| 38
| null | null |
farrellm/advent-2016
|
src/Day12.hs
|
mit
|
input :: IO Text
input = readFile "data/day12.txt"
| 50
|
input :: IO Text
input = readFile "data/day12.txt"
| 50
|
input = readFile "data/day12.txt"
| 33
| false
| true
| 0
| 5
| 7
| 17
| 8
| 9
| null | null |
pkukulak/courseography
|
hs/Scripts.hs
|
gpl-3.0
|
timetableScripts :: H.Html
timetableScripts = do
sequence_ (map toScript $
["/static/js/grid/mouse_events.js",
"//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js",
"/static/js/common/cookie_handler.js",
"/static/js/common/objects/course.js",
"/static/js/common/objects/section.js",
"/static/js/common/utilities/util.js",
"/static/js/common/grid_image.js",
"/static/js/common/image_conversion.js",
"/static/js/draw/draw.js",
"/static/js/common/course_videos.js",
"/static/js/common/modal.js",
"/static/js/common/course_description.js",
"/static/js/common/export/export.js"] ++
if enableFb then facebookScripts else [])
H.script ! H.dataAttribute "main" "/static/js/grid" ! A.src "/static/js/require.js" $ ""
| 850
|
timetableScripts :: H.Html
timetableScripts = do
sequence_ (map toScript $
["/static/js/grid/mouse_events.js",
"//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js",
"/static/js/common/cookie_handler.js",
"/static/js/common/objects/course.js",
"/static/js/common/objects/section.js",
"/static/js/common/utilities/util.js",
"/static/js/common/grid_image.js",
"/static/js/common/image_conversion.js",
"/static/js/draw/draw.js",
"/static/js/common/course_videos.js",
"/static/js/common/modal.js",
"/static/js/common/course_description.js",
"/static/js/common/export/export.js"] ++
if enableFb then facebookScripts else [])
H.script ! H.dataAttribute "main" "/static/js/grid" ! A.src "/static/js/require.js" $ ""
| 850
|
timetableScripts = do
sequence_ (map toScript $
["/static/js/grid/mouse_events.js",
"//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js",
"/static/js/common/cookie_handler.js",
"/static/js/common/objects/course.js",
"/static/js/common/objects/section.js",
"/static/js/common/utilities/util.js",
"/static/js/common/grid_image.js",
"/static/js/common/image_conversion.js",
"/static/js/draw/draw.js",
"/static/js/common/course_videos.js",
"/static/js/common/modal.js",
"/static/js/common/course_description.js",
"/static/js/common/export/export.js"] ++
if enableFb then facebookScripts else [])
H.script ! H.dataAttribute "main" "/static/js/grid" ! A.src "/static/js/require.js" $ ""
| 823
| false
| true
| 0
| 11
| 171
| 111
| 61
| 50
| null | null |
tibbe/ghc
|
compiler/codeGen/StgCmmPrim.hs
|
bsd-3-clause
|
mkBasicPrefetch :: Int -- Locality level 0-3
-> ByteOff -- Initial offset in bytes
-> [LocalReg] -- Destination
-> CmmExpr -- Base address
-> CmmExpr -- Index
-> FCode ()
mkBasicPrefetch locality off res base idx
= do dflags <- getDynFlags
emitPrimCall [] (MO_Prefetch_Data locality) [cmmIndexExpr dflags W8 (cmmOffsetB dflags base off) idx]
case res of
[] -> return ()
[reg] -> emitAssign (CmmLocal reg) base
_ -> panic "StgCmmPrim: mkBasicPrefetch"
-- ----------------------------------------------------------------------------
-- Allocating byte arrays
-- | Takes a register to return the newly allocated array in and the
-- size of the new array in bytes. Allocates a new
-- 'MutableByteArray#'.
| 864
|
mkBasicPrefetch :: Int -- Locality level 0-3
-> ByteOff -- Initial offset in bytes
-> [LocalReg] -- Destination
-> CmmExpr -- Base address
-> CmmExpr -- Index
-> FCode ()
mkBasicPrefetch locality off res base idx
= do dflags <- getDynFlags
emitPrimCall [] (MO_Prefetch_Data locality) [cmmIndexExpr dflags W8 (cmmOffsetB dflags base off) idx]
case res of
[] -> return ()
[reg] -> emitAssign (CmmLocal reg) base
_ -> panic "StgCmmPrim: mkBasicPrefetch"
-- ----------------------------------------------------------------------------
-- Allocating byte arrays
-- | Takes a register to return the newly allocated array in and the
-- size of the new array in bytes. Allocates a new
-- 'MutableByteArray#'.
| 864
|
mkBasicPrefetch locality off res base idx
= do dflags <- getDynFlags
emitPrimCall [] (MO_Prefetch_Data locality) [cmmIndexExpr dflags W8 (cmmOffsetB dflags base off) idx]
case res of
[] -> return ()
[reg] -> emitAssign (CmmLocal reg) base
_ -> panic "StgCmmPrim: mkBasicPrefetch"
-- ----------------------------------------------------------------------------
-- Allocating byte arrays
-- | Takes a register to return the newly allocated array in and the
-- size of the new array in bytes. Allocates a new
-- 'MutableByteArray#'.
| 587
| false
| true
| 0
| 12
| 267
| 156
| 80
| 76
| null | null |
nushio3/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
metaDataDataConName = dcQual gHC_GENERICS (fsLit "MetaData") metaDataDataConKey
| 81
|
metaDataDataConName = dcQual gHC_GENERICS (fsLit "MetaData") metaDataDataConKey
| 81
|
metaDataDataConName = dcQual gHC_GENERICS (fsLit "MetaData") metaDataDataConKey
| 81
| false
| false
| 0
| 7
| 8
| 19
| 9
| 10
| null | null |
unisonweb/platform
|
codebase2/util/U/Util/Components.hs
|
mit
|
-- | Order bindings by dependencies and group into components.
-- Each component consists of > 1 bindings, each of which depends
-- transitively on all other bindings in the component.
--
-- 1-element components may or may not depend on themselves.
--
-- The order is such that a component at index i will not depend
-- on components and indexes > i. But a component at index i does not
-- _necessarily_ depend on any components at earlier indices.
--
-- Example:
--
-- let rec
-- ping n = pong (n + 1);
-- pong n = ping (n + 1);
-- g = id 42;
-- y = id "hi"
-- id x = x;
-- in ping g
--
-- `components` would produce `[[ping,pong], [id], [g], [y]]`
-- Notice that `id` comes before `g` and `y` in the output, since
-- both `g` and `y` depend on `id`.
--
-- Uses Tarjan's algorithm:
-- https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm
components :: Ord v => (t -> Set v) -> [(v, t)] -> [[(v, t)]]
components freeVars bs =
let varIds =
Map.fromList (map fst bs `zip` reverse [(1 :: Int) .. length bs])
-- something horribly wrong if this bombs
varId v = fromMaybe msg $ Map.lookup v varIds
where msg = error "Components.components bug"
-- use ints as keys for graph to preserve original source order as much as
-- possible
graph = [ ((v, b), varId v, deps b) | (v, b) <- bs ]
vars = Set.fromList (map fst bs)
deps b = varId <$> Set.toList (Set.intersection vars (freeVars b))
in Graph.flattenSCC <$> Graph.stronglyConnComp graph
| 1,550
|
components :: Ord v => (t -> Set v) -> [(v, t)] -> [[(v, t)]]
components freeVars bs =
let varIds =
Map.fromList (map fst bs `zip` reverse [(1 :: Int) .. length bs])
-- something horribly wrong if this bombs
varId v = fromMaybe msg $ Map.lookup v varIds
where msg = error "Components.components bug"
-- use ints as keys for graph to preserve original source order as much as
-- possible
graph = [ ((v, b), varId v, deps b) | (v, b) <- bs ]
vars = Set.fromList (map fst bs)
deps b = varId <$> Set.toList (Set.intersection vars (freeVars b))
in Graph.flattenSCC <$> Graph.stronglyConnComp graph
| 657
|
components freeVars bs =
let varIds =
Map.fromList (map fst bs `zip` reverse [(1 :: Int) .. length bs])
-- something horribly wrong if this bombs
varId v = fromMaybe msg $ Map.lookup v varIds
where msg = error "Components.components bug"
-- use ints as keys for graph to preserve original source order as much as
-- possible
graph = [ ((v, b), varId v, deps b) | (v, b) <- bs ]
vars = Set.fromList (map fst bs)
deps b = varId <$> Set.toList (Set.intersection vars (freeVars b))
in Graph.flattenSCC <$> Graph.stronglyConnComp graph
| 595
| true
| true
| 2
| 14
| 359
| 282
| 159
| 123
| null | null |
brianshourd/adventOfCode2015
|
src/Day6.hs
|
mit
|
parseInstruction :: Parser Instruction
parseInstruction = do
operation <- parseOperation
range <- parseBulbRange
return $ Instruction operation range
| 161
|
parseInstruction :: Parser Instruction
parseInstruction = do
operation <- parseOperation
range <- parseBulbRange
return $ Instruction operation range
| 161
|
parseInstruction = do
operation <- parseOperation
range <- parseBulbRange
return $ Instruction operation range
| 122
| false
| true
| 0
| 8
| 29
| 40
| 18
| 22
| null | null |
rrnewton/accelerate
|
Data/Array/Accelerate/Trafo/Sharing.hs
|
bsd-3-clause
|
-- Debugging
-- ---------
traceLine :: String -> String -> IO ()
traceLine header msg
= Debug.traceIO Debug.dump_sharing
$ header ++ ": " ++ msg
| 149
|
traceLine :: String -> String -> IO ()
traceLine header msg
= Debug.traceIO Debug.dump_sharing
$ header ++ ": " ++ msg
| 122
|
traceLine header msg
= Debug.traceIO Debug.dump_sharing
$ header ++ ": " ++ msg
| 83
| true
| true
| 4
| 8
| 29
| 56
| 26
| 30
| null | null |
xmonad/xmonad-contrib
|
XMonad/Hooks/DebugStack.hs
|
bsd-3-clause
|
-- | 'debugStack' packaged as a 'handleEventHook'. You almost certainly do not
-- want to use this unconditionally, as it will cause massive amounts of
-- output and possibly slow @xmonad@ down severely.
debugStackEventHook :: Event -> X All
debugStackEventHook _ = debugStack >> return (All True)
| 305
|
debugStackEventHook :: Event -> X All
debugStackEventHook _ = debugStack >> return (All True)
| 96
|
debugStackEventHook _ = debugStack >> return (All True)
| 56
| true
| true
| 0
| 8
| 54
| 37
| 19
| 18
| null | null |
YelaSeamless/cgrep
|
src/CGrep/Token.hs
|
gpl-2.0
|
mkToken :: Offset -> DString -> Token
mkToken off ds = (off - length str, str)
where str = DL.toList ds
| 108
|
mkToken :: Offset -> DString -> Token
mkToken off ds = (off - length str, str)
where str = DL.toList ds
| 108
|
mkToken off ds = (off - length str, str)
where str = DL.toList ds
| 70
| false
| true
| 1
| 8
| 25
| 59
| 26
| 33
| null | null |
eryx67/haskell-libtorrent
|
src/Network/Libtorrent/Session/SessionStatus.hs
|
bsd-3-clause
|
getTrackerUploadRate :: MonadIO m => SessionStatus -> m CInt
getTrackerUploadRate ho =
liftIO . withPtr ho $ \hoPtr ->
[CU.exp| int { $(session_status * hoPtr)->tracker_upload_rate } |]
| 190
|
getTrackerUploadRate :: MonadIO m => SessionStatus -> m CInt
getTrackerUploadRate ho =
liftIO . withPtr ho $ \hoPtr ->
[CU.exp| int { $(session_status * hoPtr)->tracker_upload_rate } |]
| 190
|
getTrackerUploadRate ho =
liftIO . withPtr ho $ \hoPtr ->
[CU.exp| int { $(session_status * hoPtr)->tracker_upload_rate } |]
| 128
| false
| true
| 0
| 7
| 31
| 50
| 26
| 24
| null | null |
randallalexander/LYAH
|
src/Ch7.hs
|
bsd-3-clause
|
groupBy1 = List.groupBy (\x y -> (x > 0) == (y > 0)) values
| 59
|
groupBy1 = List.groupBy (\x y -> (x > 0) == (y > 0)) values
| 59
|
groupBy1 = List.groupBy (\x y -> (x > 0) == (y > 0)) values
| 59
| false
| false
| 0
| 10
| 13
| 41
| 22
| 19
| null | null |
alephcloud/hs-aws-kinesis-client
|
cli/CLI/Config.hs
|
apache-2.0
|
configIteratorType ∷ Lens' Config ShardIteratorType
configIteratorType = lens _configIteratorType $ \x y → x { _configIteratorType = y }
| 136
|
configIteratorType ∷ Lens' Config ShardIteratorType
configIteratorType = lens _configIteratorType $ \x y → x { _configIteratorType = y }
| 136
|
configIteratorType = lens _configIteratorType $ \x y → x { _configIteratorType = y }
| 84
| false
| true
| 1
| 9
| 18
| 42
| 20
| 22
| null | null |
forsyde/forsyde-atom
|
src/ForSyDe/Atom/Skel/FastVector/Lib.hs
|
bsd-3-clause
|
unsafeLift f (Vector a) = Vector (f a)
| 39
|
unsafeLift f (Vector a) = Vector (f a)
| 39
|
unsafeLift f (Vector a) = Vector (f a)
| 39
| false
| false
| 0
| 7
| 8
| 26
| 12
| 14
| null | null |
batterseapower/graph-wrapper
|
Data/Graph/Wrapper.hs
|
bsd-3-clause
|
thd3 :: (a, b, c) -> c
thd3 (_, _, c) = c
| 41
|
thd3 :: (a, b, c) -> c
thd3 (_, _, c) = c
| 41
|
thd3 (_, _, c) = c
| 18
| false
| true
| 0
| 6
| 12
| 36
| 21
| 15
| null | null |
tolysz/hs-tls
|
debug/src/SimpleServer.hs
|
bsd-3-clause
|
sessionRef ref = SessionManager
{ sessionEstablish = \sid sdata -> writeIORef ref (sid,sdata)
, sessionResume = \sid -> readIORef ref >>= \(s,d) -> if s == sid then return (Just d) else return Nothing
, sessionInvalidate = \_ -> return ()
}
| 275
|
sessionRef ref = SessionManager
{ sessionEstablish = \sid sdata -> writeIORef ref (sid,sdata)
, sessionResume = \sid -> readIORef ref >>= \(s,d) -> if s == sid then return (Just d) else return Nothing
, sessionInvalidate = \_ -> return ()
}
| 275
|
sessionRef ref = SessionManager
{ sessionEstablish = \sid sdata -> writeIORef ref (sid,sdata)
, sessionResume = \sid -> readIORef ref >>= \(s,d) -> if s == sid then return (Just d) else return Nothing
, sessionInvalidate = \_ -> return ()
}
| 275
| false
| false
| 0
| 13
| 76
| 104
| 57
| 47
| null | null |
makemeunsee/interpolateme
|
Main.hs
|
gpl-3.0
|
defaultCamState :: OrbitingStatef
defaultCamState = OrbitingState { theta = pi/2
, phi = pi/2
, distance = 50
, thetaSpeed = 0.005
, phiSpeed = 0.005
}
| 311
|
defaultCamState :: OrbitingStatef
defaultCamState = OrbitingState { theta = pi/2
, phi = pi/2
, distance = 50
, thetaSpeed = 0.005
, phiSpeed = 0.005
}
| 311
|
defaultCamState = OrbitingState { theta = pi/2
, phi = pi/2
, distance = 50
, thetaSpeed = 0.005
, phiSpeed = 0.005
}
| 277
| false
| true
| 0
| 7
| 186
| 51
| 31
| 20
| null | null |
byorgey/Idris-dev
|
src/IRTS/LParser.hs
|
bsd-3-clause
|
binary name f assoc = Infix (do reservedOp name; return f) assoc
| 64
|
binary name f assoc = Infix (do reservedOp name; return f) assoc
| 64
|
binary name f assoc = Infix (do reservedOp name; return f) assoc
| 64
| false
| false
| 1
| 9
| 11
| 40
| 15
| 25
| null | null |
lambda-11235/funcmap
|
src/Parser.hs
|
gpl-2.0
|
variable :: Parser AST
variable = do name <- many1 letter
return $ Var name
| 89
|
variable :: Parser AST
variable = do name <- many1 letter
return $ Var name
| 89
|
variable = do name <- many1 letter
return $ Var name
| 66
| false
| true
| 1
| 9
| 28
| 38
| 15
| 23
| null | null |
urbanslug/ghc
|
compiler/typecheck/TcRnTypes.hs
|
bsd-3-clause
|
pprCtOrigin (DerivOriginCoerce meth ty1 ty2)
= hang (ctoHerald <+> ptext (sLit "the coercion of the method") <+> quotes (ppr meth))
2 (sep [ text "from type" <+> quotes (ppr ty1)
, nest 2 $ text "to type" <+> quotes (ppr ty2) ])
| 251
|
pprCtOrigin (DerivOriginCoerce meth ty1 ty2)
= hang (ctoHerald <+> ptext (sLit "the coercion of the method") <+> quotes (ppr meth))
2 (sep [ text "from type" <+> quotes (ppr ty1)
, nest 2 $ text "to type" <+> quotes (ppr ty2) ])
| 251
|
pprCtOrigin (DerivOriginCoerce meth ty1 ty2)
= hang (ctoHerald <+> ptext (sLit "the coercion of the method") <+> quotes (ppr meth))
2 (sep [ text "from type" <+> quotes (ppr ty1)
, nest 2 $ text "to type" <+> quotes (ppr ty2) ])
| 251
| false
| false
| 0
| 12
| 64
| 108
| 50
| 58
| null | null |
CGenie/platform
|
node/src/Unison/NodeServer.hs
|
mit
|
originOptions :: ActionM ()
originOptions = do
S.addHeader "Access-Control-Allow-Origin" "*"
S.addHeader "Access-Control-Allow-Methods" "GET, POST"
S.addHeader "Access-Control-Allow-Headers" "Content-Type"
| 211
|
originOptions :: ActionM ()
originOptions = do
S.addHeader "Access-Control-Allow-Origin" "*"
S.addHeader "Access-Control-Allow-Methods" "GET, POST"
S.addHeader "Access-Control-Allow-Headers" "Content-Type"
| 211
|
originOptions = do
S.addHeader "Access-Control-Allow-Origin" "*"
S.addHeader "Access-Control-Allow-Methods" "GET, POST"
S.addHeader "Access-Control-Allow-Headers" "Content-Type"
| 183
| false
| true
| 0
| 8
| 22
| 46
| 20
| 26
| null | null |
np/hlatex
|
Language/LaTeX/Types.hs
|
bsd-3-clause
|
uncatParItm :: ParItm -> [ParItm]
uncatParItm (ParConcat pars) = pars
| 69
|
uncatParItm :: ParItm -> [ParItm]
uncatParItm (ParConcat pars) = pars
| 69
|
uncatParItm (ParConcat pars) = pars
| 35
| false
| true
| 0
| 7
| 9
| 27
| 14
| 13
| null | null |
nevrenato/Hets_Fork
|
CommonLogic/Morphism.hs
|
gpl-2.0
|
mapSen_nos :: Morphism -> AS.NAME_OR_SEQMARK -> AS.NAME_OR_SEQMARK
mapSen_nos mor nos = case nos of
AS.Name n -> AS.Name (mapSen_tok mor n)
AS.SeqMark s -> AS.SeqMark (mapSen_tok mor s)
| 189
|
mapSen_nos :: Morphism -> AS.NAME_OR_SEQMARK -> AS.NAME_OR_SEQMARK
mapSen_nos mor nos = case nos of
AS.Name n -> AS.Name (mapSen_tok mor n)
AS.SeqMark s -> AS.SeqMark (mapSen_tok mor s)
| 189
|
mapSen_nos mor nos = case nos of
AS.Name n -> AS.Name (mapSen_tok mor n)
AS.SeqMark s -> AS.SeqMark (mapSen_tok mor s)
| 122
| false
| true
| 0
| 10
| 31
| 80
| 38
| 42
| null | null |
haskell/haddock
|
haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
|
bsd-2-clause
|
ppForAllPart :: Unicode -> Qualification -> HsForAllTelescope DocNameI -> Html
ppForAllPart unicode qual tele = case tele of
HsForAllVis { hsf_vis_bndrs = bndrs } ->
hsep (forallSymbol unicode : ppTyVars unicode qual bndrs) +++
spaceHtml +++ arrow unicode
HsForAllInvis { hsf_invis_bndrs = bndrs } ->
hsep (forallSymbol unicode : ppTyVars unicode qual bndrs) +++ dot
| 383
|
ppForAllPart :: Unicode -> Qualification -> HsForAllTelescope DocNameI -> Html
ppForAllPart unicode qual tele = case tele of
HsForAllVis { hsf_vis_bndrs = bndrs } ->
hsep (forallSymbol unicode : ppTyVars unicode qual bndrs) +++
spaceHtml +++ arrow unicode
HsForAllInvis { hsf_invis_bndrs = bndrs } ->
hsep (forallSymbol unicode : ppTyVars unicode qual bndrs) +++ dot
| 383
|
ppForAllPart unicode qual tele = case tele of
HsForAllVis { hsf_vis_bndrs = bndrs } ->
hsep (forallSymbol unicode : ppTyVars unicode qual bndrs) +++
spaceHtml +++ arrow unicode
HsForAllInvis { hsf_invis_bndrs = bndrs } ->
hsep (forallSymbol unicode : ppTyVars unicode qual bndrs) +++ dot
| 304
| false
| true
| 0
| 13
| 71
| 128
| 60
| 68
| null | null |
kylcarte/snap-elm
|
src/Snap/Elm.hs
|
bsd-3-clause
|
-- | Set the directory to use for storing the compiled .html
-- that @elm@ produces.
setElmBuildPath :: FilePath -> ElmOptions -> ElmOptions
setElmBuildPath bld opts = opts { elmBuildPath = bld }
| 195
|
setElmBuildPath :: FilePath -> ElmOptions -> ElmOptions
setElmBuildPath bld opts = opts { elmBuildPath = bld }
| 110
|
setElmBuildPath bld opts = opts { elmBuildPath = bld }
| 54
| true
| true
| 0
| 8
| 32
| 43
| 21
| 22
| null | null |
m-alvarez/jhc
|
src/Support/CFF.hs
|
mit
|
getByte :: Handle -> IO Word8
getByte h = liftM (fromIntegral . ord) (hGetChar h)
| 81
|
getByte :: Handle -> IO Word8
getByte h = liftM (fromIntegral . ord) (hGetChar h)
| 81
|
getByte h = liftM (fromIntegral . ord) (hGetChar h)
| 51
| false
| true
| 0
| 7
| 14
| 43
| 20
| 23
| null | null |
DanielSchuessler/hstri
|
FaceLattice.hs
|
gpl-3.0
|
flnColour :: FLN -> Colour Double
flnColour (FLN _ c) = c
| 57
|
flnColour :: FLN -> Colour Double
flnColour (FLN _ c) = c
| 57
|
flnColour (FLN _ c) = c
| 23
| false
| true
| 0
| 7
| 11
| 29
| 14
| 15
| null | null |
ekmett/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxBITMAP_TYPE_GIF :: Int
wxBITMAP_TYPE_GIF = 13
| 47
|
wxBITMAP_TYPE_GIF :: Int
wxBITMAP_TYPE_GIF = 13
| 47
|
wxBITMAP_TYPE_GIF = 13
| 22
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
christiaanb/ghc
|
compiler/prelude/ForeignCall.hs
|
bsd-3-clause
|
ccallConvAttribute JavaScriptCallConv = panic "ccallConvAttribute JavaScriptCallConv"
| 85
|
ccallConvAttribute JavaScriptCallConv = panic "ccallConvAttribute JavaScriptCallConv"
| 85
|
ccallConvAttribute JavaScriptCallConv = panic "ccallConvAttribute JavaScriptCallConv"
| 85
| false
| false
| 0
| 5
| 5
| 12
| 5
| 7
| null | null |
GaloisInc/halvm-ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
{-
---------------------------------------------------------------------
SynTy
~~~~~
Notes on type synonyms
~~~~~~~~~~~~~~~~~~~~~~
The various "split" functions (splitFunTy, splitRhoTy, splitForAllTy) try
to return type synonyms wherever possible. Thus
type Foo a = a -> a
we want
splitFunTys (a -> Foo a) = ([a], Foo a)
not ([a], a -> a)
The reason is that we then get better (shorter) type signatures in
interfaces. Notably this plays a role in tcTySigs in TcBinds.hs.
---------------------------------------------------------------------
ForAllTy
~~~~~~~~
-}
mkForAllTy :: TyBinder -> Type -> Type
mkForAllTy = ForAllTy
| 805
|
mkForAllTy :: TyBinder -> Type -> Type
mkForAllTy = ForAllTy
| 60
|
mkForAllTy = ForAllTy
| 21
| true
| true
| 0
| 8
| 265
| 27
| 12
| 15
| null | null |
hguenther/smtlib2
|
Language/SMTLib2/Internals/Expression.hs
|
gpl-3.0
|
renderFunction SMTRendering _ (Ord _ Lt) = showString "<"
| 57
|
renderFunction SMTRendering _ (Ord _ Lt) = showString "<"
| 57
|
renderFunction SMTRendering _ (Ord _ Lt) = showString "<"
| 57
| false
| false
| 0
| 7
| 8
| 26
| 11
| 15
| null | null |
sjpet/quark
|
src/Quark/Flipper.hs
|
mit
|
-- | Flip to the next element, wrapping around at the end
flipNext :: Flipper a -> Flipper a
flipNext (x, [], []) = (x, [], [])
| 127
|
flipNext :: Flipper a -> Flipper a
flipNext (x, [], []) = (x, [], [])
| 69
|
flipNext (x, [], []) = (x, [], [])
| 34
| true
| true
| 0
| 7
| 26
| 51
| 28
| 23
| null | null |
lennart/tidal-midi
|
Sound/Tidal/Tetra.hs
|
gpl-3.0
|
lfo1rate = makeF oscPolysynth "lfo1rate"
| 45
|
lfo1rate = makeF oscPolysynth "lfo1rate"
| 45
|
lfo1rate = makeF oscPolysynth "lfo1rate"
| 45
| false
| false
| 0
| 5
| 9
| 11
| 5
| 6
| null | null |
TomMD/ghc
|
compiler/types/TyCon.hs
|
bsd-3-clause
|
pprPromotionQuote _ = empty
| 46
|
pprPromotionQuote _ = empty
| 46
|
pprPromotionQuote _ = empty
| 46
| false
| false
| 0
| 5
| 22
| 9
| 4
| 5
| null | null |
tomberek/rulestesting
|
src/Morte/Core.hs
|
bsd-3-clause
|
axiom Box = Left (TypeError [] (Const Box) (Untyped Box))
| 58
|
axiom Box = Left (TypeError [] (Const Box) (Untyped Box))
| 58
|
axiom Box = Left (TypeError [] (Const Box) (Untyped Box))
| 58
| false
| false
| 0
| 9
| 10
| 37
| 17
| 20
| null | null |
diku-dk/futhark
|
src/Futhark/Actions.hs
|
isc
|
compilePythonAction :: FutharkConfig -> CompilerMode -> FilePath -> Action SeqMem
compilePythonAction fcfg mode outpath =
Action
{ actionName = "Compile to PyOpenCL",
actionDescription = "Compile to Python with OpenCL",
actionProcedure = pythonCommon SequentialPy.compileProg fcfg mode outpath
}
| 317
|
compilePythonAction :: FutharkConfig -> CompilerMode -> FilePath -> Action SeqMem
compilePythonAction fcfg mode outpath =
Action
{ actionName = "Compile to PyOpenCL",
actionDescription = "Compile to Python with OpenCL",
actionProcedure = pythonCommon SequentialPy.compileProg fcfg mode outpath
}
| 317
|
compilePythonAction fcfg mode outpath =
Action
{ actionName = "Compile to PyOpenCL",
actionDescription = "Compile to Python with OpenCL",
actionProcedure = pythonCommon SequentialPy.compileProg fcfg mode outpath
}
| 235
| false
| true
| 0
| 8
| 58
| 64
| 34
| 30
| null | null |
siddhanathan/ghc
|
compiler/deSugar/Coverage.hs
|
bsd-3-clause
|
addTickHsLocalBinds (EmptyLocalBinds) = return EmptyLocalBinds
| 63
|
addTickHsLocalBinds (EmptyLocalBinds) = return EmptyLocalBinds
| 63
|
addTickHsLocalBinds (EmptyLocalBinds) = return EmptyLocalBinds
| 63
| false
| false
| 0
| 6
| 5
| 15
| 7
| 8
| null | null |
nevrenato/Hets_Fork
|
Common/Keywords.hs
|
gpl-2.0
|
rigidS :: String
rigidS = "rigid"
| 33
|
rigidS :: String
rigidS = "rigid"
| 33
|
rigidS = "rigid"
| 16
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
Thell/pandoc
|
src/Text/Pandoc/Writers/Markdown.hs
|
gpl-2.0
|
inlineToMarkdown opts (Emph lst) = do
plain <- gets stPlain
contents <- inlineListToMarkdown opts lst
return $ if plain
then "_" <> contents <> "_"
else "*" <> contents <> "*"
| 209
|
inlineToMarkdown opts (Emph lst) = do
plain <- gets stPlain
contents <- inlineListToMarkdown opts lst
return $ if plain
then "_" <> contents <> "_"
else "*" <> contents <> "*"
| 209
|
inlineToMarkdown opts (Emph lst) = do
plain <- gets stPlain
contents <- inlineListToMarkdown opts lst
return $ if plain
then "_" <> contents <> "_"
else "*" <> contents <> "*"
| 209
| false
| false
| 0
| 10
| 64
| 70
| 33
| 37
| null | null |
ghcjs/jsaddle-dom
|
src/JSDOM/Generated/WebGLRenderingContextBase.hs
|
mit
|
-- | <https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContextBase.compressedTexSubImage2D Mozilla WebGLRenderingContextBase.compressedTexSubImage2D documentation>
compressedTexSubImage2D ::
(MonadDOM m, IsWebGLRenderingContextBase self,
IsArrayBufferView data') =>
self ->
GLenum ->
GLint ->
GLint -> GLint -> GLsizei -> GLsizei -> GLenum -> data' -> m ()
compressedTexSubImage2D self target level xoffset yoffset width
height format data'
= liftDOM
(void
((toWebGLRenderingContextBase self) ^.
jsf "compressedTexSubImage2D"
[toJSVal target, toJSVal level, toJSVal xoffset, toJSVal yoffset,
toJSVal width, toJSVal height, toJSVal format, toJSVal data']))
| 891
|
compressedTexSubImage2D ::
(MonadDOM m, IsWebGLRenderingContextBase self,
IsArrayBufferView data') =>
self ->
GLenum ->
GLint ->
GLint -> GLint -> GLsizei -> GLsizei -> GLenum -> data' -> m ()
compressedTexSubImage2D self target level xoffset yoffset width
height format data'
= liftDOM
(void
((toWebGLRenderingContextBase self) ^.
jsf "compressedTexSubImage2D"
[toJSVal target, toJSVal level, toJSVal xoffset, toJSVal yoffset,
toJSVal width, toJSVal height, toJSVal format, toJSVal data']))
| 712
|
compressedTexSubImage2D self target level xoffset yoffset width
height format data'
= liftDOM
(void
((toWebGLRenderingContextBase self) ^.
jsf "compressedTexSubImage2D"
[toJSVal target, toJSVal level, toJSVal xoffset, toJSVal yoffset,
toJSVal width, toJSVal height, toJSVal format, toJSVal data']))
| 354
| true
| true
| 0
| 16
| 290
| 174
| 85
| 89
| null | null |
paldepind/dffptch-haskell
|
Dffptch/Internal.hs
|
mit
|
objToArr :: Object -> Value
objToArr = Array . V.fromList . map snd . sortBy (comparing fst) . H.toList
| 103
|
objToArr :: Object -> Value
objToArr = Array . V.fromList . map snd . sortBy (comparing fst) . H.toList
| 103
|
objToArr = Array . V.fromList . map snd . sortBy (comparing fst) . H.toList
| 75
| false
| true
| 0
| 9
| 18
| 54
| 24
| 30
| null | null |
ku-fpg/sunroof-compiler
|
Language/Sunroof/Compiler.hs
|
bsd-3-clause
|
unroofCompileJSB :: CompilerOpts -> String -> JS 'B () -> IO String
sunroofCompileJSB opts fName f = sunroofCompileJSA opts fName $ do
k <- continuation (\ () -> f)
goto k () :: JS 'A ()
-- | Extracts the 'Control.Monad.Operational.Program' from the given
-- Javascript computation using the given continuation closer.
| 332
|
sunroofCompileJSB :: CompilerOpts -> String -> JS 'B () -> IO String
sunroofCompileJSB opts fName f = sunroofCompileJSA opts fName $ do
k <- continuation (\ () -> f)
goto k () :: JS 'A ()
-- | Extracts the 'Control.Monad.Operational.Program' from the given
-- Javascript computation using the given continuation closer.
| 331
|
sunroofCompileJSB opts fName f = sunroofCompileJSA opts fName $ do
k <- continuation (\ () -> f)
goto k () :: JS 'A ()
-- | Extracts the 'Control.Monad.Operational.Program' from the given
-- Javascript computation using the given continuation closer.
| 262
| false
| true
| 0
| 12
| 65
| 95
| 46
| 49
| null | null |
diku-dk/futhark
|
src/Futhark/Analysis/LastUse.hs
|
isc
|
analyseGPUOp pat_name (lumap, used) (Inner (SegOp (SegHist lvl _ binops tps body))) = do
(lumap', used') <- foldM analyseHistOp (lumap, used) $ reverse binops
(lumap'', used'') <- analyseKernelBody (lumap', used') body
let nms = (freeIn lvl <> freeIn tps) `namesSubtract` used''
return (insertNames pat_name nms lumap'', used'' <> nms)
| 343
|
analyseGPUOp pat_name (lumap, used) (Inner (SegOp (SegHist lvl _ binops tps body))) = do
(lumap', used') <- foldM analyseHistOp (lumap, used) $ reverse binops
(lumap'', used'') <- analyseKernelBody (lumap', used') body
let nms = (freeIn lvl <> freeIn tps) `namesSubtract` used''
return (insertNames pat_name nms lumap'', used'' <> nms)
| 343
|
analyseGPUOp pat_name (lumap, used) (Inner (SegOp (SegHist lvl _ binops tps body))) = do
(lumap', used') <- foldM analyseHistOp (lumap, used) $ reverse binops
(lumap'', used'') <- analyseKernelBody (lumap', used') body
let nms = (freeIn lvl <> freeIn tps) `namesSubtract` used''
return (insertNames pat_name nms lumap'', used'' <> nms)
| 343
| false
| false
| 0
| 13
| 56
| 151
| 77
| 74
| null | null |
bonnefoa/Shaker
|
src/Shaker/Conductor.hs
|
isc
|
cleanAllThreads :: Shaker IO ()
cleanAllThreads = do
asks ( threadDataListenList . shakerThreadData ) >>= cleanThreads
asks ( threadDataQuitList . shakerThreadData ) >>= cleanThreads
| 186
|
cleanAllThreads :: Shaker IO ()
cleanAllThreads = do
asks ( threadDataListenList . shakerThreadData ) >>= cleanThreads
asks ( threadDataQuitList . shakerThreadData ) >>= cleanThreads
| 186
|
cleanAllThreads = do
asks ( threadDataListenList . shakerThreadData ) >>= cleanThreads
asks ( threadDataQuitList . shakerThreadData ) >>= cleanThreads
| 154
| false
| true
| 0
| 10
| 27
| 52
| 25
| 27
| null | null |
antarestrader/sapphire
|
Builtin/Bool.hs
|
gpl-3.0
|
tand (v:_) | (v==VFalse || v==VNil) = replyM_ VFalse
| 52
|
tand (v:_) | (v==VFalse || v==VNil) = replyM_ VFalse
| 52
|
tand (v:_) | (v==VFalse || v==VNil) = replyM_ VFalse
| 52
| false
| false
| 0
| 11
| 8
| 41
| 19
| 22
| null | null |
andrewthad/yesod
|
yesod-core/Yesod/Core/Handler.hs
|
mit
|
-- | Switch over to handling the current request with a WAI @Application@.
--
-- Since 1.2.17
sendWaiApplication :: MonadHandler m => W.Application -> m b
sendWaiApplication = handlerError . HCWaiApp
| 199
|
sendWaiApplication :: MonadHandler m => W.Application -> m b
sendWaiApplication = handlerError . HCWaiApp
| 105
|
sendWaiApplication = handlerError . HCWaiApp
| 44
| true
| true
| 0
| 7
| 30
| 34
| 18
| 16
| null | null |
xu-hao/QueryArrow
|
QueryArrow-db-sql-hdbc-common/src/QueryArrow/SQL/HDBC.hs
|
bsd-3-clause
|
convertResultValueToSQLText crv@ListNilValue = listToSQLText crv
| 64
|
convertResultValueToSQLText crv@ListNilValue = listToSQLText crv
| 64
|
convertResultValueToSQLText crv@ListNilValue = listToSQLText crv
| 64
| false
| false
| 0
| 6
| 4
| 15
| 7
| 8
| null | null |
steve-chavez/postgrest
|
src/PostgREST/Query/SqlFragment.hs
|
mit
|
pgFmtJoinCondition :: JoinCondition -> H.Snippet
pgFmtJoinCondition (JoinCondition (qi1, col1) (qi2, col2)) =
H.sql $ pgFmtColumn qi1 col1 <> " = " <> pgFmtColumn qi2 col2
| 173
|
pgFmtJoinCondition :: JoinCondition -> H.Snippet
pgFmtJoinCondition (JoinCondition (qi1, col1) (qi2, col2)) =
H.sql $ pgFmtColumn qi1 col1 <> " = " <> pgFmtColumn qi2 col2
| 173
|
pgFmtJoinCondition (JoinCondition (qi1, col1) (qi2, col2)) =
H.sql $ pgFmtColumn qi1 col1 <> " = " <> pgFmtColumn qi2 col2
| 124
| false
| true
| 0
| 8
| 26
| 64
| 33
| 31
| null | null |
RossMeikleham/GPC
|
src/GPC/TypelessAST.hs
|
bsd-2-clause
|
isReturn :: Stmt -> Bool
isReturn (Return e) = True
| 51
|
isReturn :: Stmt -> Bool
isReturn (Return e) = True
| 51
|
isReturn (Return e) = True
| 26
| false
| true
| 0
| 7
| 9
| 24
| 12
| 12
| null | null |
mfpi/OpenGLRaw
|
src/Graphics/Rendering/OpenGL/Raw/NV/PathRendering.hs
|
bsd-3-clause
|
-- Accepted by the <fillMode> parameter of StencilFillPathNV and
-- StencilFillPathInstancedNV:
gl_COUNT_UP_NV :: GLenum
gl_COUNT_UP_NV = 0x9088
| 144
|
gl_COUNT_UP_NV :: GLenum
gl_COUNT_UP_NV = 0x9088
| 48
|
gl_COUNT_UP_NV = 0x9088
| 23
| true
| true
| 0
| 4
| 16
| 13
| 8
| 5
| null | null |
frontrowed/stratosphere
|
library-gen/Stratosphere/ResourceProperties/CloudFrontDistributionDefaultCacheBehavior.hs
|
mit
|
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-targetoriginid
cfddcbTargetOriginId :: Lens' CloudFrontDistributionDefaultCacheBehavior (Val Text)
cfddcbTargetOriginId = lens _cloudFrontDistributionDefaultCacheBehaviorTargetOriginId (\s a -> s { _cloudFrontDistributionDefaultCacheBehaviorTargetOriginId = a })
| 443
|
cfddcbTargetOriginId :: Lens' CloudFrontDistributionDefaultCacheBehavior (Val Text)
cfddcbTargetOriginId = lens _cloudFrontDistributionDefaultCacheBehaviorTargetOriginId (\s a -> s { _cloudFrontDistributionDefaultCacheBehaviorTargetOriginId = a })
| 247
|
cfddcbTargetOriginId = lens _cloudFrontDistributionDefaultCacheBehaviorTargetOriginId (\s a -> s { _cloudFrontDistributionDefaultCacheBehaviorTargetOriginId = a })
| 163
| true
| true
| 0
| 9
| 21
| 46
| 25
| 21
| null | null |
raviqqe/jack
|
command/Parser.hs
|
unlicense
|
toplevel :: Parser [Expr]
toplevel = many $ do
def <- defn
reservedOp ";"
return def
| 90
|
toplevel :: Parser [Expr]
toplevel = many $ do
def <- defn
reservedOp ";"
return def
| 90
|
toplevel = many $ do
def <- defn
reservedOp ";"
return def
| 64
| false
| true
| 0
| 8
| 21
| 40
| 18
| 22
| null | null |
ComputationWithBoundedResources/ara-inference
|
doc/tpdb_trs/Haskell/basic_haskell/index_4.hs
|
mit
|
compare2 x y MyFalse = compare1 x y (ltEsOrdering x y)
| 54
|
compare2 x y MyFalse = compare1 x y (ltEsOrdering x y)
| 54
|
compare2 x y MyFalse = compare1 x y (ltEsOrdering x y)
| 54
| false
| false
| 1
| 7
| 10
| 33
| 13
| 20
| null | null |
CulpaBS/wbBach
|
src/Futhark/Analysis/SymbolTable.hs
|
bsd-3-clause
|
lookup :: VName -> SymbolTable lore -> Maybe (Entry lore)
lookup name = HM.lookup name . bindings
| 97
|
lookup :: VName -> SymbolTable lore -> Maybe (Entry lore)
lookup name = HM.lookup name . bindings
| 97
|
lookup name = HM.lookup name . bindings
| 39
| false
| true
| 0
| 9
| 16
| 43
| 20
| 23
| null | null |
CarstenKoenig/DOS2015
|
Countdown/CountdownFast.hs
|
unlicense
|
formatEx prec (Apply op l r)
| opPrec <= prec = (prec, "(" ++ formatted ++ ")")
| otherwise = (prec, formatted)
where opPrec = precedence op
formatted = let (lp, ls) = formatEx opPrec l
(_, rs) = formatEx lp r
in ls ++ show op ++ rs
| 299
|
formatEx prec (Apply op l r)
| opPrec <= prec = (prec, "(" ++ formatted ++ ")")
| otherwise = (prec, formatted)
where opPrec = precedence op
formatted = let (lp, ls) = formatEx opPrec l
(_, rs) = formatEx lp r
in ls ++ show op ++ rs
| 299
|
formatEx prec (Apply op l r)
| opPrec <= prec = (prec, "(" ++ formatted ++ ")")
| otherwise = (prec, formatted)
where opPrec = precedence op
formatted = let (lp, ls) = formatEx opPrec l
(_, rs) = formatEx lp r
in ls ++ show op ++ rs
| 299
| false
| false
| 6
| 9
| 115
| 140
| 64
| 76
| null | null |
nushio3/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
supportedLanguagesAndExtensions :: [String]
supportedLanguagesAndExtensions =
supportedLanguages ++ supportedLanguageOverlays ++ supportedExtensions
| 152
|
supportedLanguagesAndExtensions :: [String]
supportedLanguagesAndExtensions =
supportedLanguages ++ supportedLanguageOverlays ++ supportedExtensions
| 152
|
supportedLanguagesAndExtensions =
supportedLanguages ++ supportedLanguageOverlays ++ supportedExtensions
| 108
| false
| true
| 0
| 6
| 13
| 22
| 12
| 10
| null | null |
kolmodin/cabal
|
Cabal/Distribution/PackageDescription/Check.hs
|
bsd-3-clause
|
checkCCOptions :: PackageDescription -> [PackageCheck]
checkCCOptions pkg =
catMaybes [
checkAlternatives "cc-options" "include-dirs"
[ (flag, dir) | flag@('-':'I':dir) <- all_ccOptions ]
, checkAlternatives "cc-options" "extra-libraries"
[ (flag, lib) | flag@('-':'l':lib) <- all_ccOptions ]
, checkAlternatives "cc-options" "extra-lib-dirs"
[ (flag, dir) | flag@('-':'L':dir) <- all_ccOptions ]
, checkAlternatives "ld-options" "extra-libraries"
[ (flag, lib) | flag@('-':'l':lib) <- all_ldOptions ]
, checkAlternatives "ld-options" "extra-lib-dirs"
[ (flag, dir) | flag@('-':'L':dir) <- all_ldOptions ]
, checkCCFlags [ "-O", "-Os", "-O0", "-O1", "-O2", "-O3" ] $
PackageDistSuspicious $
"'cc-options: -O[n]' is generally not needed. When building with "
++ " optimisations Cabal automatically adds '-O2' for C code. "
++ "Setting it yourself interferes with the --disable-optimization "
++ "flag."
]
where all_ccOptions = [ opts | bi <- allBuildInfo pkg
, opts <- ccOptions bi ]
all_ldOptions = [ opts | bi <- allBuildInfo pkg
, opts <- ldOptions bi ]
checkCCFlags :: [String] -> PackageCheck -> Maybe PackageCheck
checkCCFlags flags = check (any (`elem` flags) all_ccOptions)
| 1,364
|
checkCCOptions :: PackageDescription -> [PackageCheck]
checkCCOptions pkg =
catMaybes [
checkAlternatives "cc-options" "include-dirs"
[ (flag, dir) | flag@('-':'I':dir) <- all_ccOptions ]
, checkAlternatives "cc-options" "extra-libraries"
[ (flag, lib) | flag@('-':'l':lib) <- all_ccOptions ]
, checkAlternatives "cc-options" "extra-lib-dirs"
[ (flag, dir) | flag@('-':'L':dir) <- all_ccOptions ]
, checkAlternatives "ld-options" "extra-libraries"
[ (flag, lib) | flag@('-':'l':lib) <- all_ldOptions ]
, checkAlternatives "ld-options" "extra-lib-dirs"
[ (flag, dir) | flag@('-':'L':dir) <- all_ldOptions ]
, checkCCFlags [ "-O", "-Os", "-O0", "-O1", "-O2", "-O3" ] $
PackageDistSuspicious $
"'cc-options: -O[n]' is generally not needed. When building with "
++ " optimisations Cabal automatically adds '-O2' for C code. "
++ "Setting it yourself interferes with the --disable-optimization "
++ "flag."
]
where all_ccOptions = [ opts | bi <- allBuildInfo pkg
, opts <- ccOptions bi ]
all_ldOptions = [ opts | bi <- allBuildInfo pkg
, opts <- ldOptions bi ]
checkCCFlags :: [String] -> PackageCheck -> Maybe PackageCheck
checkCCFlags flags = check (any (`elem` flags) all_ccOptions)
| 1,364
|
checkCCOptions pkg =
catMaybes [
checkAlternatives "cc-options" "include-dirs"
[ (flag, dir) | flag@('-':'I':dir) <- all_ccOptions ]
, checkAlternatives "cc-options" "extra-libraries"
[ (flag, lib) | flag@('-':'l':lib) <- all_ccOptions ]
, checkAlternatives "cc-options" "extra-lib-dirs"
[ (flag, dir) | flag@('-':'L':dir) <- all_ccOptions ]
, checkAlternatives "ld-options" "extra-libraries"
[ (flag, lib) | flag@('-':'l':lib) <- all_ldOptions ]
, checkAlternatives "ld-options" "extra-lib-dirs"
[ (flag, dir) | flag@('-':'L':dir) <- all_ldOptions ]
, checkCCFlags [ "-O", "-Os", "-O0", "-O1", "-O2", "-O3" ] $
PackageDistSuspicious $
"'cc-options: -O[n]' is generally not needed. When building with "
++ " optimisations Cabal automatically adds '-O2' for C code. "
++ "Setting it yourself interferes with the --disable-optimization "
++ "flag."
]
where all_ccOptions = [ opts | bi <- allBuildInfo pkg
, opts <- ccOptions bi ]
all_ldOptions = [ opts | bi <- allBuildInfo pkg
, opts <- ldOptions bi ]
checkCCFlags :: [String] -> PackageCheck -> Maybe PackageCheck
checkCCFlags flags = check (any (`elem` flags) all_ccOptions)
| 1,309
| false
| true
| 2
| 13
| 345
| 394
| 209
| 185
| null | null |
AndrewWUw/cs9181
|
Data/Array/Accelerate/C/Exp.hs
|
bsd-3-clause
|
primToC (PrimBShiftL _) [a,b] = [cexp|$exp:a << $exp:b|]
| 65
|
primToC (PrimBShiftL _) [a,b] = [cexp|$exp:a << $exp:b|]
| 65
|
primToC (PrimBShiftL _) [a,b] = [cexp|$exp:a << $exp:b|]
| 65
| false
| false
| 0
| 7
| 16
| 31
| 17
| 14
| null | null |
BakerSmithA/Metal
|
test/Syntax/VariableExprSpec.hs
|
mit
|
objExprSpec :: Spec
objExprSpec = do
describe "objExpr" $ do
it "parses new objects" $ do
let expected = NewObj "S" [(S (SymLit 'a')), (T (TapeLit "abc"))]
state = Env.fromList [("S", PStruct [("x", SymType), ("y", TapeType)]), ("tape", PVar TapeType)]
parseEvalState state objExpr "" "S 'a' \"abc\"" `shouldParse` expected
it "parses object variables" $ do
let expected = ObjVar "S" ["obj"]
state = Env.fromList [("obj", PVar (CustomType "S"))]
parseEvalState state objExpr "" "obj" `shouldParse` expected
it "parses variables in structs" $ do
let expected = ObjVar "S" ["x", "m_o"]
state = Env.fromList [("S", PStruct [("m_o", CustomType "S")]), ("x", PVar (CustomType "S"))]
parseEvalState state objExpr "" "x.m_o" `shouldParse` expected
it "parses new objects where arguments have parenthesis" $ do
let expected = NewObj "S" [(S (Read (TapeVar ["tape"])))]
state = Env.fromList [("S", PStruct [("x", SymType)]), ("tape", PVar TapeType)]
parseEvalState state objExpr "" "S (read tape)" `shouldParse` expected
it "fails if the incorrect number of arguments are given to a constructor" $ do
let state = Env.fromList [("S", PStruct [("x", SymType), ("y", SymType)])]
parseEvalState state objExpr "" `shouldFailOn` "S 'a'"
parseEvalState state objExpr "" `shouldFailOn` "S 'a' \"abc\" \"abc\""
it "fails if the incorrect type is given as an argument" $ do
let state = Env.fromList [("S", PStruct [("x", SymType)]), ("tape", PVar TapeType)]
parseEvalState state objExpr "" `shouldFailOn` "S tape"
it "fails if the variable is not an object" $ do
let state = Env.fromList [("x", PVar TapeType)]
parseEvalState state objExpr "" `shouldFailOn` "x"
| 1,952
|
objExprSpec :: Spec
objExprSpec = do
describe "objExpr" $ do
it "parses new objects" $ do
let expected = NewObj "S" [(S (SymLit 'a')), (T (TapeLit "abc"))]
state = Env.fromList [("S", PStruct [("x", SymType), ("y", TapeType)]), ("tape", PVar TapeType)]
parseEvalState state objExpr "" "S 'a' \"abc\"" `shouldParse` expected
it "parses object variables" $ do
let expected = ObjVar "S" ["obj"]
state = Env.fromList [("obj", PVar (CustomType "S"))]
parseEvalState state objExpr "" "obj" `shouldParse` expected
it "parses variables in structs" $ do
let expected = ObjVar "S" ["x", "m_o"]
state = Env.fromList [("S", PStruct [("m_o", CustomType "S")]), ("x", PVar (CustomType "S"))]
parseEvalState state objExpr "" "x.m_o" `shouldParse` expected
it "parses new objects where arguments have parenthesis" $ do
let expected = NewObj "S" [(S (Read (TapeVar ["tape"])))]
state = Env.fromList [("S", PStruct [("x", SymType)]), ("tape", PVar TapeType)]
parseEvalState state objExpr "" "S (read tape)" `shouldParse` expected
it "fails if the incorrect number of arguments are given to a constructor" $ do
let state = Env.fromList [("S", PStruct [("x", SymType), ("y", SymType)])]
parseEvalState state objExpr "" `shouldFailOn` "S 'a'"
parseEvalState state objExpr "" `shouldFailOn` "S 'a' \"abc\" \"abc\""
it "fails if the incorrect type is given as an argument" $ do
let state = Env.fromList [("S", PStruct [("x", SymType)]), ("tape", PVar TapeType)]
parseEvalState state objExpr "" `shouldFailOn` "S tape"
it "fails if the variable is not an object" $ do
let state = Env.fromList [("x", PVar TapeType)]
parseEvalState state objExpr "" `shouldFailOn` "x"
| 1,952
|
objExprSpec = do
describe "objExpr" $ do
it "parses new objects" $ do
let expected = NewObj "S" [(S (SymLit 'a')), (T (TapeLit "abc"))]
state = Env.fromList [("S", PStruct [("x", SymType), ("y", TapeType)]), ("tape", PVar TapeType)]
parseEvalState state objExpr "" "S 'a' \"abc\"" `shouldParse` expected
it "parses object variables" $ do
let expected = ObjVar "S" ["obj"]
state = Env.fromList [("obj", PVar (CustomType "S"))]
parseEvalState state objExpr "" "obj" `shouldParse` expected
it "parses variables in structs" $ do
let expected = ObjVar "S" ["x", "m_o"]
state = Env.fromList [("S", PStruct [("m_o", CustomType "S")]), ("x", PVar (CustomType "S"))]
parseEvalState state objExpr "" "x.m_o" `shouldParse` expected
it "parses new objects where arguments have parenthesis" $ do
let expected = NewObj "S" [(S (Read (TapeVar ["tape"])))]
state = Env.fromList [("S", PStruct [("x", SymType)]), ("tape", PVar TapeType)]
parseEvalState state objExpr "" "S (read tape)" `shouldParse` expected
it "fails if the incorrect number of arguments are given to a constructor" $ do
let state = Env.fromList [("S", PStruct [("x", SymType), ("y", SymType)])]
parseEvalState state objExpr "" `shouldFailOn` "S 'a'"
parseEvalState state objExpr "" `shouldFailOn` "S 'a' \"abc\" \"abc\""
it "fails if the incorrect type is given as an argument" $ do
let state = Env.fromList [("S", PStruct [("x", SymType)]), ("tape", PVar TapeType)]
parseEvalState state objExpr "" `shouldFailOn` "S tape"
it "fails if the variable is not an object" $ do
let state = Env.fromList [("x", PVar TapeType)]
parseEvalState state objExpr "" `shouldFailOn` "x"
| 1,932
| false
| true
| 0
| 21
| 550
| 638
| 329
| 309
| null | null |
yuga/haskell-relational-record-driver-sqlserver
|
src/Database/HDBC/Schema/SQLServer.hs
|
bsd-3-clause
|
driverSQLServer :: IConnection conn => Driver conn
driverSQLServer =
emptyDriver { getFieldsWithMap = getFields' }
{ getPrimaryKey = getPrimaryKey' }
| 172
|
driverSQLServer :: IConnection conn => Driver conn
driverSQLServer =
emptyDriver { getFieldsWithMap = getFields' }
{ getPrimaryKey = getPrimaryKey' }
| 172
|
driverSQLServer =
emptyDriver { getFieldsWithMap = getFields' }
{ getPrimaryKey = getPrimaryKey' }
| 121
| false
| true
| 0
| 7
| 42
| 37
| 20
| 17
| null | null |
athanclark/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
highestFC (PDoBlock lines) =
case map getDoFC lines of
[] -> Nothing
(fc:_) -> Just fc
where
getDoFC (DoExp fc t) = fc
getDoFC (DoBind fc nm nfc t) = fc
getDoFC (DoBindP fc l r alts) = fc
getDoFC (DoLet fc nm nfc l r) = fc
getDoFC (DoLetP fc l r) = fc
| 299
|
highestFC (PDoBlock lines) =
case map getDoFC lines of
[] -> Nothing
(fc:_) -> Just fc
where
getDoFC (DoExp fc t) = fc
getDoFC (DoBind fc nm nfc t) = fc
getDoFC (DoBindP fc l r alts) = fc
getDoFC (DoLet fc nm nfc l r) = fc
getDoFC (DoLetP fc l r) = fc
| 299
|
highestFC (PDoBlock lines) =
case map getDoFC lines of
[] -> Nothing
(fc:_) -> Just fc
where
getDoFC (DoExp fc t) = fc
getDoFC (DoBind fc nm nfc t) = fc
getDoFC (DoBindP fc l r alts) = fc
getDoFC (DoLet fc nm nfc l r) = fc
getDoFC (DoLetP fc l r) = fc
| 299
| false
| false
| 0
| 9
| 102
| 153
| 72
| 81
| null | null |
wando-hs/H-99
|
src/Problem32.hs
|
gpl-3.0
|
myGCD x y
| x < y = myGCD y x
| otherwise = myGCD y $ mod x y
| 69
|
myGCD x y
| x < y = myGCD y x
| otherwise = myGCD y $ mod x y
| 69
|
myGCD x y
| x < y = myGCD y x
| otherwise = myGCD y $ mod x y
| 69
| false
| false
| 2
| 8
| 27
| 57
| 22
| 35
| null | null |
mapinguari/SC_HS_Proxy
|
src/Proxy/Math/Line.hs
|
mit
|
lineSegLength :: (Floating a) => LineSeg -> a
lineSegLength ls = distance (start ls) (end ls)
| 93
|
lineSegLength :: (Floating a) => LineSeg -> a
lineSegLength ls = distance (start ls) (end ls)
| 93
|
lineSegLength ls = distance (start ls) (end ls)
| 47
| false
| true
| 0
| 8
| 15
| 50
| 23
| 27
| null | null |
hamishmack/haskell-gi
|
cmdline/haskell-gi.hs
|
lgpl-2.1
|
parseKeyValue :: String -> (String, String)
parseKeyValue s =
let (a, '=':b) = break (=='=') s
in (a, b)
| 109
|
parseKeyValue :: String -> (String, String)
parseKeyValue s =
let (a, '=':b) = break (=='=') s
in (a, b)
| 109
|
parseKeyValue s =
let (a, '=':b) = break (=='=') s
in (a, b)
| 65
| false
| true
| 0
| 10
| 23
| 61
| 33
| 28
| null | null |
asr/apia
|
src/Apia/Defaults.hs
|
mit
|
etWithOnlineATPs ∷ Config → Options → Options
setWithOnlineATPs config opts = newOpts
where
newOpts ∷ Options
newOpts = case lookConfig "with-online-atps" config of
Just val → opts { optWithOnlineATPs = val }
_ → opts
| 247
|
setWithOnlineATPs ∷ Config → Options → Options
setWithOnlineATPs config opts = newOpts
where
newOpts ∷ Options
newOpts = case lookConfig "with-online-atps" config of
Just val → opts { optWithOnlineATPs = val }
_ → opts
| 247
|
setWithOnlineATPs config opts = newOpts
where
newOpts ∷ Options
newOpts = case lookConfig "with-online-atps" config of
Just val → opts { optWithOnlineATPs = val }
_ → opts
| 200
| false
| true
| 0
| 9
| 64
| 79
| 37
| 42
| null | null |
sonyandy/var
|
tests/properties.hs
|
bsd-3-clause
|
prop_IOUTuple (SomeByteArraySlice2 a a',
SomeByteArraySlice2 b b',
SomeByteArraySlice2 c c',
SomeByteArraySlice2 d d',
SomeByteArraySlice2 e e') = monadicIO $ do
let xs = (a, b, c, d, e)
tuple <- run $ thawIOUTuple xs
tupleWriteRead tuple (a', b', c', d', e')
tupleThawFreeze thawIOUTuple xs
| 359
|
prop_IOUTuple (SomeByteArraySlice2 a a',
SomeByteArraySlice2 b b',
SomeByteArraySlice2 c c',
SomeByteArraySlice2 d d',
SomeByteArraySlice2 e e') = monadicIO $ do
let xs = (a, b, c, d, e)
tuple <- run $ thawIOUTuple xs
tupleWriteRead tuple (a', b', c', d', e')
tupleThawFreeze thawIOUTuple xs
| 359
|
prop_IOUTuple (SomeByteArraySlice2 a a',
SomeByteArraySlice2 b b',
SomeByteArraySlice2 c c',
SomeByteArraySlice2 d d',
SomeByteArraySlice2 e e') = monadicIO $ do
let xs = (a, b, c, d, e)
tuple <- run $ thawIOUTuple xs
tupleWriteRead tuple (a', b', c', d', e')
tupleThawFreeze thawIOUTuple xs
| 359
| false
| false
| 0
| 11
| 111
| 122
| 62
| 60
| null | null |
olsner/ghc
|
compiler/nativeGen/PPC/CodeGen.hs
|
bsd-3-clause
|
getRegister' dflags (CmmLit lit)
| target32Bit (targetPlatform dflags)
= let rep = cmmLitType dflags lit
imm = litToImm lit
code dst = toOL [
LIS dst (HA imm),
ADD dst dst (RIImm (LO imm))
]
in return (Any (cmmTypeFormat rep) code)
| otherwise
= do lbl <- getNewLabelNat
dflags <- getDynFlags
dynRef <- cmmMakeDynamicReference dflags DataReference lbl
Amode addr addr_code <- getAmode D dynRef
let rep = cmmLitType dflags lit
format = cmmTypeFormat rep
code dst =
LDATA (Section ReadOnlyData lbl) (Statics lbl [CmmStaticLit lit])
`consOL` (addr_code `snocOL` LD format dst addr)
return (Any format code)
| 750
|
getRegister' dflags (CmmLit lit)
| target32Bit (targetPlatform dflags)
= let rep = cmmLitType dflags lit
imm = litToImm lit
code dst = toOL [
LIS dst (HA imm),
ADD dst dst (RIImm (LO imm))
]
in return (Any (cmmTypeFormat rep) code)
| otherwise
= do lbl <- getNewLabelNat
dflags <- getDynFlags
dynRef <- cmmMakeDynamicReference dflags DataReference lbl
Amode addr addr_code <- getAmode D dynRef
let rep = cmmLitType dflags lit
format = cmmTypeFormat rep
code dst =
LDATA (Section ReadOnlyData lbl) (Statics lbl [CmmStaticLit lit])
`consOL` (addr_code `snocOL` LD format dst addr)
return (Any format code)
| 750
|
getRegister' dflags (CmmLit lit)
| target32Bit (targetPlatform dflags)
= let rep = cmmLitType dflags lit
imm = litToImm lit
code dst = toOL [
LIS dst (HA imm),
ADD dst dst (RIImm (LO imm))
]
in return (Any (cmmTypeFormat rep) code)
| otherwise
= do lbl <- getNewLabelNat
dflags <- getDynFlags
dynRef <- cmmMakeDynamicReference dflags DataReference lbl
Amode addr addr_code <- getAmode D dynRef
let rep = cmmLitType dflags lit
format = cmmTypeFormat rep
code dst =
LDATA (Section ReadOnlyData lbl) (Statics lbl [CmmStaticLit lit])
`consOL` (addr_code `snocOL` LD format dst addr)
return (Any format code)
| 750
| false
| false
| 0
| 17
| 242
| 270
| 126
| 144
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.