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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dnvriend/study-category-theory
|
haskell/learn_a_haskell/ch3/guards.hs
|
apache-2.0
|
-- based on your bmi, the function tells you off (omg!)
bmiTell :: (RealFloat a) => a -> String
bmiTell bmi
| bmi <= 18.5 = "You're underweight, you emo you!"
| bmi <= 25.0 = "You're supposedly normal. Pfft, I bet you're ugly!"
| bmi <= 30.0 = "You're fat! Lose some weight, fatty!"
| otherwise = "You're a whale, congratulations!"
| 350
|
bmiTell :: (RealFloat a) => a -> String
bmiTell bmi
| bmi <= 18.5 = "You're underweight, you emo you!"
| bmi <= 25.0 = "You're supposedly normal. Pfft, I bet you're ugly!"
| bmi <= 30.0 = "You're fat! Lose some weight, fatty!"
| otherwise = "You're a whale, congratulations!"
| 294
|
bmiTell bmi
| bmi <= 18.5 = "You're underweight, you emo you!"
| bmi <= 25.0 = "You're supposedly normal. Pfft, I bet you're ugly!"
| bmi <= 30.0 = "You're fat! Lose some weight, fatty!"
| otherwise = "You're a whale, congratulations!"
| 254
| true
| true
| 0
| 8
| 80
| 85
| 39
| 46
| null | null |
phischu/haskell-rest
|
src/Web/Rest/IOStreams.hs
|
bsd-3-clause
|
methodToMethod :: Method -> Network.Http.Client.Method
methodToMethod GET = Network.Http.Client.GET
| 102
|
methodToMethod :: Method -> Network.Http.Client.Method
methodToMethod GET = Network.Http.Client.GET
| 102
|
methodToMethod GET = Network.Http.Client.GET
| 47
| false
| true
| 0
| 6
| 11
| 30
| 16
| 14
| null | null |
ihc/futhark
|
src/Futhark/Analysis/HORepresentation/SOAC.hs
|
isc
|
lambda (Redomap _ _ _ lam2 _ _) = lam2
| 39
|
lambda (Redomap _ _ _ lam2 _ _) = lam2
| 39
|
lambda (Redomap _ _ _ lam2 _ _) = lam2
| 39
| false
| false
| 0
| 7
| 10
| 25
| 12
| 13
| null | null |
jhnesk/project-euler
|
src/Solutions/Problem025.hs
|
unlicense
|
solution n = 1 + ( length $ takeWhile (\x -> digitLength x < n) fibs)
| 69
|
solution n = 1 + ( length $ takeWhile (\x -> digitLength x < n) fibs)
| 69
|
solution n = 1 + ( length $ takeWhile (\x -> digitLength x < n) fibs)
| 69
| false
| false
| 3
| 12
| 15
| 45
| 20
| 25
| null | null |
renevp/hello-haskell
|
src/test.hs
|
bsd-3-clause
|
ackermann 0 y = y + 1
| 21
|
ackermann 0 y = y + 1
| 21
|
ackermann 0 y = y + 1
| 21
| false
| false
| 3
| 5
| 6
| 21
| 7
| 14
| null | null |
bmmoore/logic
|
Logic/Orders.hs
|
bsd-3-clause
|
lpo _ (VarTerm v) t@(Term _ _) = if Set.member v (vars t) then Ordered LT else Unordered
| 88
|
lpo _ (VarTerm v) t@(Term _ _) = if Set.member v (vars t) then Ordered LT else Unordered
| 88
|
lpo _ (VarTerm v) t@(Term _ _) = if Set.member v (vars t) then Ordered LT else Unordered
| 88
| false
| false
| 2
| 9
| 17
| 59
| 27
| 32
| null | null |
supki/ldap-client
|
test/SpecHelper.hs
|
bsd-2-clause
|
oddish :: Dn
oddish = Dn "cn=oddish,o=localhost"
| 48
|
oddish :: Dn
oddish = Dn "cn=oddish,o=localhost"
| 48
|
oddish = Dn "cn=oddish,o=localhost"
| 35
| false
| true
| 0
| 6
| 6
| 21
| 8
| 13
| null | null |
paulrzcz/takusen-oracle
|
Database/Oracle/Test/Enumerator.hs
|
bsd-3-clause
|
lectNestedMultiResultSet3 :: OracleFunctions -> DBM mark Session ()
selectNestedMultiResultSet3 _ = do
let
q = "select n, cursor(SELECT nat2.n, cursor"
++ " (SELECT nat3.n from t_natural nat3 where nat3.n < nat2.n order by n)"
++ " from t_natural nat2 where nat2.n < nat.n order by n)"
++ " from t_natural nat where n < 10 order by n"
iterMain (outer::Int) (c::RefCursor StmtHandle) acc = do
rs <- doQuery c (iterInner outer) []
let expect = drop (9-outer) [8,7,6,5,4,3,2,1]
assertEqual "processOuter" expect (map fst rs)
result' ((outer,c):acc)
iterInner outer (inner::Int) (c::RefCursor StmtHandle) acc = do
rs <- doQuery c (iterInner2 outer inner) []
let expect = drop (9-inner) [8,7,6,5,4,3,2,1]
assertEqual "processInner" expect rs
result' ((inner,c):acc)
iterInner2 outer inner (i::Int) acc = do
--print_ (show outer ++ " " ++ show inner ++ " " ++ show i)
assertBool "processInner2" (i < inner)
result' (i:acc)
withTransaction RepeatableRead $ do
rs <- doQuery (sql q) iterMain []
assertEqual "selectNestedMultiResultSet" [9,8,7,6,5,4,3,2,1] (map fst rs)
--print_ ""
| 1,234
|
selectNestedMultiResultSet3 :: OracleFunctions -> DBM mark Session ()
selectNestedMultiResultSet3 _ = do
let
q = "select n, cursor(SELECT nat2.n, cursor"
++ " (SELECT nat3.n from t_natural nat3 where nat3.n < nat2.n order by n)"
++ " from t_natural nat2 where nat2.n < nat.n order by n)"
++ " from t_natural nat where n < 10 order by n"
iterMain (outer::Int) (c::RefCursor StmtHandle) acc = do
rs <- doQuery c (iterInner outer) []
let expect = drop (9-outer) [8,7,6,5,4,3,2,1]
assertEqual "processOuter" expect (map fst rs)
result' ((outer,c):acc)
iterInner outer (inner::Int) (c::RefCursor StmtHandle) acc = do
rs <- doQuery c (iterInner2 outer inner) []
let expect = drop (9-inner) [8,7,6,5,4,3,2,1]
assertEqual "processInner" expect rs
result' ((inner,c):acc)
iterInner2 outer inner (i::Int) acc = do
--print_ (show outer ++ " " ++ show inner ++ " " ++ show i)
assertBool "processInner2" (i < inner)
result' (i:acc)
withTransaction RepeatableRead $ do
rs <- doQuery (sql q) iterMain []
assertEqual "selectNestedMultiResultSet" [9,8,7,6,5,4,3,2,1] (map fst rs)
--print_ ""
| 1,233
|
selectNestedMultiResultSet3 _ = do
let
q = "select n, cursor(SELECT nat2.n, cursor"
++ " (SELECT nat3.n from t_natural nat3 where nat3.n < nat2.n order by n)"
++ " from t_natural nat2 where nat2.n < nat.n order by n)"
++ " from t_natural nat where n < 10 order by n"
iterMain (outer::Int) (c::RefCursor StmtHandle) acc = do
rs <- doQuery c (iterInner outer) []
let expect = drop (9-outer) [8,7,6,5,4,3,2,1]
assertEqual "processOuter" expect (map fst rs)
result' ((outer,c):acc)
iterInner outer (inner::Int) (c::RefCursor StmtHandle) acc = do
rs <- doQuery c (iterInner2 outer inner) []
let expect = drop (9-inner) [8,7,6,5,4,3,2,1]
assertEqual "processInner" expect rs
result' ((inner,c):acc)
iterInner2 outer inner (i::Int) acc = do
--print_ (show outer ++ " " ++ show inner ++ " " ++ show i)
assertBool "processInner2" (i < inner)
result' (i:acc)
withTransaction RepeatableRead $ do
rs <- doQuery (sql q) iterMain []
assertEqual "selectNestedMultiResultSet" [9,8,7,6,5,4,3,2,1] (map fst rs)
--print_ ""
| 1,163
| false
| true
| 0
| 17
| 323
| 438
| 225
| 213
| null | null |
mettekou/ghc
|
compiler/typecheck/TcEvidence.hs
|
bsd-3-clause
|
isIdHsWrapper _ = False
| 28
|
isIdHsWrapper _ = False
| 28
|
isIdHsWrapper _ = False
| 28
| false
| false
| 0
| 5
| 8
| 9
| 4
| 5
| null | null |
vikraman/ghc
|
compiler/basicTypes/NameSet.hs
|
bsd-3-clause
|
unitNameSet = unitUniqSet
| 31
|
unitNameSet = unitUniqSet
| 31
|
unitNameSet = unitUniqSet
| 31
| false
| false
| 0
| 4
| 8
| 6
| 3
| 3
| null | null |
nobsun/koneta
|
src/MyNumber/Validate.hs
|
bsd-3-clause
|
valid :: String -> Bool
valid = check 11 0
where
check 0 s [c] = isDigit c && 11 - s `mod` 11 == digitToInt c
check n s (c:cs)
| n >= 7 = isDigit c && check (n-1) (s+(n-5)*digitToInt c) cs
| n >= 1 = isDigit c && check (n-1) (s+(n+1)*digitToInt c) cs
check _ _ _ = False
-- ^ validate "My Number" string
--
-- >>> valid "123456789010"
-- False
-- >>> valid "123456789011"
-- False
-- >>> valid "123456789012"
-- False
-- >>> valid "123456789013"
-- False
-- >>> valid "123456789014"
-- False
-- >>> valid "123456789015"
-- False
-- >>> valid "123456789016"
-- False
-- >>> valid "123456789017"
-- False
-- >>> valid "123456789018"
-- True
-- >>> valid "123456789019"
-- False
-- >>> valid "1234567890180"
-- False
-- >>> valid "12345678901"
-- False
-- >>> valid "123456789abc"
-- False
| 821
|
valid :: String -> Bool
valid = check 11 0
where
check 0 s [c] = isDigit c && 11 - s `mod` 11 == digitToInt c
check n s (c:cs)
| n >= 7 = isDigit c && check (n-1) (s+(n-5)*digitToInt c) cs
| n >= 1 = isDigit c && check (n-1) (s+(n+1)*digitToInt c) cs
check _ _ _ = False
-- ^ validate "My Number" string
--
-- >>> valid "123456789010"
-- False
-- >>> valid "123456789011"
-- False
-- >>> valid "123456789012"
-- False
-- >>> valid "123456789013"
-- False
-- >>> valid "123456789014"
-- False
-- >>> valid "123456789015"
-- False
-- >>> valid "123456789016"
-- False
-- >>> valid "123456789017"
-- False
-- >>> valid "123456789018"
-- True
-- >>> valid "123456789019"
-- False
-- >>> valid "1234567890180"
-- False
-- >>> valid "12345678901"
-- False
-- >>> valid "123456789abc"
-- False
| 821
|
valid = check 11 0
where
check 0 s [c] = isDigit c && 11 - s `mod` 11 == digitToInt c
check n s (c:cs)
| n >= 7 = isDigit c && check (n-1) (s+(n-5)*digitToInt c) cs
| n >= 1 = isDigit c && check (n-1) (s+(n+1)*digitToInt c) cs
check _ _ _ = False
-- ^ validate "My Number" string
--
-- >>> valid "123456789010"
-- False
-- >>> valid "123456789011"
-- False
-- >>> valid "123456789012"
-- False
-- >>> valid "123456789013"
-- False
-- >>> valid "123456789014"
-- False
-- >>> valid "123456789015"
-- False
-- >>> valid "123456789016"
-- False
-- >>> valid "123456789017"
-- False
-- >>> valid "123456789018"
-- True
-- >>> valid "123456789019"
-- False
-- >>> valid "1234567890180"
-- False
-- >>> valid "12345678901"
-- False
-- >>> valid "123456789abc"
-- False
| 797
| false
| true
| 1
| 12
| 182
| 244
| 128
| 116
| null | null |
BlairArchibald/bones
|
apps/maxclique/src/Main.hs
|
bsd-3-clause
|
--------------------------------------------------------------------------------
-- HdpH
--------------------------------------------------------------------------------
parseHdpHOpts :: [String] -> IO (RTSConf, Int, [String])
parseHdpHOpts args = do
either_conf <- updateConf args defaultRTSConf
case either_conf of
Left err_msg -> error $ "parseHdpHOpts: " ++ err_msg
Right (conf, []) -> return (conf, 0, [])
Right (conf, arg':args') ->
case stripPrefix "-rand=" arg' of
Just s -> return (conf, read s, args')
Nothing -> return (conf, 0, arg':args')
| 618
|
parseHdpHOpts :: [String] -> IO (RTSConf, Int, [String])
parseHdpHOpts args = do
either_conf <- updateConf args defaultRTSConf
case either_conf of
Left err_msg -> error $ "parseHdpHOpts: " ++ err_msg
Right (conf, []) -> return (conf, 0, [])
Right (conf, arg':args') ->
case stripPrefix "-rand=" arg' of
Just s -> return (conf, read s, args')
Nothing -> return (conf, 0, arg':args')
| 447
|
parseHdpHOpts args = do
either_conf <- updateConf args defaultRTSConf
case either_conf of
Left err_msg -> error $ "parseHdpHOpts: " ++ err_msg
Right (conf, []) -> return (conf, 0, [])
Right (conf, arg':args') ->
case stripPrefix "-rand=" arg' of
Just s -> return (conf, read s, args')
Nothing -> return (conf, 0, arg':args')
| 390
| true
| true
| 0
| 15
| 130
| 184
| 95
| 89
| null | null |
pstiasny/mgr
|
Sampling.hs
|
lgpl-3.0
|
squareBatches w h count =
[ [(u, v) | u <- [x0..x1-1], v <- [y0..y1-1]]
| i <- [0..count-1], let (x0, y0, x1, y1) = batchWindow w h i count ]
| 150
|
squareBatches w h count =
[ [(u, v) | u <- [x0..x1-1], v <- [y0..y1-1]]
| i <- [0..count-1], let (x0, y0, x1, y1) = batchWindow w h i count ]
| 150
|
squareBatches w h count =
[ [(u, v) | u <- [x0..x1-1], v <- [y0..y1-1]]
| i <- [0..count-1], let (x0, y0, x1, y1) = batchWindow w h i count ]
| 150
| false
| false
| 0
| 10
| 39
| 108
| 58
| 50
| null | null |
ekmett/ghc
|
compiler/nativeGen/X86/CodeGen.hs
|
bsd-3-clause
|
-- This is re-used for floating pt instructions too.
genTrivialCode :: Size -> (Operand -> Operand -> Instr)
-> CmmExpr -> CmmExpr -> NatM Register
genTrivialCode rep instr a b = do
(b_op, b_code) <- getNonClobberedOperand b
a_code <- getAnyReg a
tmp <- getNewRegNat rep
let
-- We want the value of b to stay alive across the computation of a.
-- But, we want to calculate a straight into the destination register,
-- because the instruction only has two operands (dst := dst `op` src).
-- The troublesome case is when the result of b is in the same register
-- as the destination reg. In this case, we have to save b in a
-- new temporary across the computation of a.
code dst
| dst `regClashesWithOp` b_op =
b_code `appOL`
unitOL (MOV rep b_op (OpReg tmp)) `appOL`
a_code dst `snocOL`
instr (OpReg tmp) (OpReg dst)
| otherwise =
b_code `appOL`
a_code dst `snocOL`
instr b_op (OpReg dst)
return (Any rep code)
| 1,099
|
genTrivialCode :: Size -> (Operand -> Operand -> Instr)
-> CmmExpr -> CmmExpr -> NatM Register
genTrivialCode rep instr a b = do
(b_op, b_code) <- getNonClobberedOperand b
a_code <- getAnyReg a
tmp <- getNewRegNat rep
let
-- We want the value of b to stay alive across the computation of a.
-- But, we want to calculate a straight into the destination register,
-- because the instruction only has two operands (dst := dst `op` src).
-- The troublesome case is when the result of b is in the same register
-- as the destination reg. In this case, we have to save b in a
-- new temporary across the computation of a.
code dst
| dst `regClashesWithOp` b_op =
b_code `appOL`
unitOL (MOV rep b_op (OpReg tmp)) `appOL`
a_code dst `snocOL`
instr (OpReg tmp) (OpReg dst)
| otherwise =
b_code `appOL`
a_code dst `snocOL`
instr b_op (OpReg dst)
return (Any rep code)
| 1,046
|
genTrivialCode rep instr a b = do
(b_op, b_code) <- getNonClobberedOperand b
a_code <- getAnyReg a
tmp <- getNewRegNat rep
let
-- We want the value of b to stay alive across the computation of a.
-- But, we want to calculate a straight into the destination register,
-- because the instruction only has two operands (dst := dst `op` src).
-- The troublesome case is when the result of b is in the same register
-- as the destination reg. In this case, we have to save b in a
-- new temporary across the computation of a.
code dst
| dst `regClashesWithOp` b_op =
b_code `appOL`
unitOL (MOV rep b_op (OpReg tmp)) `appOL`
a_code dst `snocOL`
instr (OpReg tmp) (OpReg dst)
| otherwise =
b_code `appOL`
a_code dst `snocOL`
instr b_op (OpReg dst)
return (Any rep code)
| 936
| true
| true
| 0
| 19
| 352
| 228
| 114
| 114
| null | null |
scravy/multimap
|
src/Data/BagMultiMap.hs
|
mit
|
toMapOfSets :: Ord a => BagMultiMap k a -> Map k (Set a)
-- ^ /O(k*m*log m) where k is the number of keys and m the
-- maximum number of elements associated with a single key/
toMapOfSets (BagMultiMap (_, _, map)) = Map.map Set.fromList map
| 240
|
toMapOfSets :: Ord a => BagMultiMap k a -> Map k (Set a)
toMapOfSets (BagMultiMap (_, _, map)) = Map.map Set.fromList map
| 121
|
toMapOfSets (BagMultiMap (_, _, map)) = Map.map Set.fromList map
| 64
| true
| true
| 0
| 9
| 45
| 67
| 34
| 33
| null | null |
fmapfmapfmap/amazonka
|
amazonka-route53/gen/Network/AWS/Route53/Types/Product.hs
|
mpl-2.0
|
-- | /Alias resource record sets only:/ The external DNS name associated with
-- the AWS Resource.
--
-- For more information and an example, see
-- <http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingAliasRRSets.html Creating Alias Resource Record Sets>
-- in the /Amazon Route 53 Developer Guide/
--
-- .
atDNSName :: Lens' AliasTarget Text
atDNSName = lens _atDNSName (\ s a -> s{_atDNSName = a})
| 413
|
atDNSName :: Lens' AliasTarget Text
atDNSName = lens _atDNSName (\ s a -> s{_atDNSName = a})
| 92
|
atDNSName = lens _atDNSName (\ s a -> s{_atDNSName = a})
| 56
| true
| true
| 0
| 9
| 59
| 47
| 29
| 18
| null | null |
alexander-at-github/eta
|
compiler/ETA/Utils/Stream.hs
|
bsd-3-clause
|
liftIO :: IO a -> Stream IO b a
liftIO io = Stream $ io >>= return . Left
| 73
|
liftIO :: IO a -> Stream IO b a
liftIO io = Stream $ io >>= return . Left
| 73
|
liftIO io = Stream $ io >>= return . Left
| 41
| false
| true
| 0
| 7
| 18
| 40
| 19
| 21
| null | null |
DavidAlphaFox/ghc
|
libraries/Cabal/Cabal/Distribution/Simple/Utils.hs
|
bsd-3-clause
|
createDirectoryVerbose :: Verbosity -> FilePath -> IO ()
createDirectoryVerbose verbosity dir = do
info verbosity $ "creating " ++ dir
createDirectory dir
setDirOrdinary dir
-- | Copies a file without copying file permissions. The target file is created
-- with default permissions. Any existing target file is replaced.
--
-- At higher verbosity levels it logs an info message.
--
| 388
|
createDirectoryVerbose :: Verbosity -> FilePath -> IO ()
createDirectoryVerbose verbosity dir = do
info verbosity $ "creating " ++ dir
createDirectory dir
setDirOrdinary dir
-- | Copies a file without copying file permissions. The target file is created
-- with default permissions. Any existing target file is replaced.
--
-- At higher verbosity levels it logs an info message.
--
| 388
|
createDirectoryVerbose verbosity dir = do
info verbosity $ "creating " ++ dir
createDirectory dir
setDirOrdinary dir
-- | Copies a file without copying file permissions. The target file is created
-- with default permissions. Any existing target file is replaced.
--
-- At higher verbosity levels it logs an info message.
--
| 331
| false
| true
| 0
| 9
| 66
| 60
| 29
| 31
| null | null |
jaalonso/I1M-Cod-Temas
|
src/Tema_12/Analizador.hs
|
gpl-2.0
|
-- alfanumerico analiza si el primer carácter es una letra o un
-- número. Por ejemplo,
-- analiza alfanumerico "Eva" == [('E',"va")]
-- analiza alfanumerico "eva" == [('e',"va")]
-- analiza alfanumerico "123" == [('1',"23")]
-- analiza alfanumerico " 123" == []
alfanumerico :: Analizador Char
alfanumerico = sat isAlphaNum
| 347
|
alfanumerico :: Analizador Char
alfanumerico = sat isAlphaNum
| 61
|
alfanumerico = sat isAlphaNum
| 29
| true
| true
| 0
| 5
| 71
| 23
| 14
| 9
| null | null |
wavewave/gnuplot
|
src/Graphics/Gnuplot/ColorSpecification.hs
|
bsd-3-clause
|
grey70 = makeColor "grey70" 0xb3b3b3 179 179 179
| 71
|
grey70 = makeColor "grey70" 0xb3b3b3 179 179 179
| 71
|
grey70 = makeColor "grey70" 0xb3b3b3 179 179 179
| 71
| false
| false
| 0
| 5
| 30
| 17
| 8
| 9
| null | null |
abuiles/turbinado-blog
|
Turbinado/Environment/CodeStore.hs
|
bsd-3-clause
|
makeCode :: (HasEnvironment m) => CodeType -> CodeMap -> CodeLocation -> [Arg] -> FilePath -> m CodeMap
makeCode ct cmap cl args fp = do
ms <- liftIO $ makeAll fp (compileArgs++args)
case ms of
MakeFailure err -> do debugM ("\tMake error : " ++ (show err))
return (insert cl (CodeLoadFailure $ unlines err) cmap)
MakeSuccess NotReq _ -> do debugM ("\tMake success : No recomp required")
return cmap
MakeSuccess _ fp -> do debugM ("\tMake success : " ++ fp)
case ct of
CTLayout -> _loadView ct cmap cl args fp
CTView -> _loadView ct cmap cl args fp
CTComponentView -> _loadView ct cmap cl args fp
CTController -> _loadController ct cmap cl args fp
CTComponentController -> _loadController ct cmap cl args fp
-- | Attempt to load the code and return the 'CodeMap' with the newly loaded code in it. This
-- function is specialized for Views.
| 1,279
|
makeCode :: (HasEnvironment m) => CodeType -> CodeMap -> CodeLocation -> [Arg] -> FilePath -> m CodeMap
makeCode ct cmap cl args fp = do
ms <- liftIO $ makeAll fp (compileArgs++args)
case ms of
MakeFailure err -> do debugM ("\tMake error : " ++ (show err))
return (insert cl (CodeLoadFailure $ unlines err) cmap)
MakeSuccess NotReq _ -> do debugM ("\tMake success : No recomp required")
return cmap
MakeSuccess _ fp -> do debugM ("\tMake success : " ++ fp)
case ct of
CTLayout -> _loadView ct cmap cl args fp
CTView -> _loadView ct cmap cl args fp
CTComponentView -> _loadView ct cmap cl args fp
CTController -> _loadController ct cmap cl args fp
CTComponentController -> _loadController ct cmap cl args fp
-- | Attempt to load the code and return the 'CodeMap' with the newly loaded code in it. This
-- function is specialized for Views.
| 1,279
|
makeCode ct cmap cl args fp = do
ms <- liftIO $ makeAll fp (compileArgs++args)
case ms of
MakeFailure err -> do debugM ("\tMake error : " ++ (show err))
return (insert cl (CodeLoadFailure $ unlines err) cmap)
MakeSuccess NotReq _ -> do debugM ("\tMake success : No recomp required")
return cmap
MakeSuccess _ fp -> do debugM ("\tMake success : " ++ fp)
case ct of
CTLayout -> _loadView ct cmap cl args fp
CTView -> _loadView ct cmap cl args fp
CTComponentView -> _loadView ct cmap cl args fp
CTController -> _loadController ct cmap cl args fp
CTComponentController -> _loadController ct cmap cl args fp
-- | Attempt to load the code and return the 'CodeMap' with the newly loaded code in it. This
-- function is specialized for Views.
| 1,175
| false
| true
| 0
| 17
| 589
| 285
| 135
| 150
| null | null |
mpickering/hackage-server
|
MirrorClient.hs
|
bsd-3-clause
|
formatErrorResponse :: ErrorResponse -> String
formatErrorResponse (ErrorResponse uri (a,b,c) reason mBody) =
"HTTP error code " ++ show a ++ show b ++ show c
++ ", " ++ reason ++ "\n " ++ show uri
++ maybe "" (('\n':) . unlines . map (" "++) . lines . wrapText) mBody
| 277
|
formatErrorResponse :: ErrorResponse -> String
formatErrorResponse (ErrorResponse uri (a,b,c) reason mBody) =
"HTTP error code " ++ show a ++ show b ++ show c
++ ", " ++ reason ++ "\n " ++ show uri
++ maybe "" (('\n':) . unlines . map (" "++) . lines . wrapText) mBody
| 277
|
formatErrorResponse (ErrorResponse uri (a,b,c) reason mBody) =
"HTTP error code " ++ show a ++ show b ++ show c
++ ", " ++ reason ++ "\n " ++ show uri
++ maybe "" (('\n':) . unlines . map (" "++) . lines . wrapText) mBody
| 230
| false
| true
| 4
| 11
| 59
| 122
| 61
| 61
| null | null |
mettekou/ghc
|
compiler/hsSyn/HsDecls.hs
|
bsd-3-clause
|
hasReturnKindSignature (TyVarSig (L _ (UserTyVar _))) = False
| 61
|
hasReturnKindSignature (TyVarSig (L _ (UserTyVar _))) = False
| 61
|
hasReturnKindSignature (TyVarSig (L _ (UserTyVar _))) = False
| 61
| false
| false
| 0
| 11
| 7
| 29
| 14
| 15
| null | null |
kairuku/stack
|
src/Stack/Build/Source.hs
|
bsd-3-clause
|
-- | Create FileCacheInfo for a file.
calcFci :: MonadIO m => ModTime -> FilePath -> m FileCacheInfo
calcFci modTime' fp = liftIO $
withBinaryFile fp ReadMode $ \h -> do
(size, digest) <- CB.sourceHandle h $$ getZipSink
((,)
<$> ZipSink (CL.fold
(\x y -> x + fromIntegral (S.length y))
0)
<*> ZipSink sinkHash)
return FileCacheInfo
{ fciModTime = modTime'
, fciSize = size
, fciHash = toBytes (digest :: Digest SHA256)
}
| 572
|
calcFci :: MonadIO m => ModTime -> FilePath -> m FileCacheInfo
calcFci modTime' fp = liftIO $
withBinaryFile fp ReadMode $ \h -> do
(size, digest) <- CB.sourceHandle h $$ getZipSink
((,)
<$> ZipSink (CL.fold
(\x y -> x + fromIntegral (S.length y))
0)
<*> ZipSink sinkHash)
return FileCacheInfo
{ fciModTime = modTime'
, fciSize = size
, fciHash = toBytes (digest :: Digest SHA256)
}
| 534
|
calcFci modTime' fp = liftIO $
withBinaryFile fp ReadMode $ \h -> do
(size, digest) <- CB.sourceHandle h $$ getZipSink
((,)
<$> ZipSink (CL.fold
(\x y -> x + fromIntegral (S.length y))
0)
<*> ZipSink sinkHash)
return FileCacheInfo
{ fciModTime = modTime'
, fciSize = size
, fciHash = toBytes (digest :: Digest SHA256)
}
| 471
| true
| true
| 0
| 24
| 224
| 171
| 87
| 84
| null | null |
elieux/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
rtsIsProfiled :: Bool
rtsIsProfiled = unsafeDupablePerformIO rtsIsProfiledIO /= 0
| 81
|
rtsIsProfiled :: Bool
rtsIsProfiled = unsafeDupablePerformIO rtsIsProfiledIO /= 0
| 81
|
rtsIsProfiled = unsafeDupablePerformIO rtsIsProfiledIO /= 0
| 59
| false
| true
| 0
| 6
| 8
| 25
| 10
| 15
| null | null |
michaxm/haskell-hdfs-thrift-client
|
src-gen-thrift/ThriftHadoopFileSystem.hs
|
bsd-3-clause
|
decode_Rename_args :: (T.Protocol p, T.Transport t) => p t -> LBS.ByteString -> Rename_args
decode_Rename_args iprot bs = to_Rename_args $ T.deserializeVal iprot (T.T_STRUCT typemap_Rename_args) bs
| 197
|
decode_Rename_args :: (T.Protocol p, T.Transport t) => p t -> LBS.ByteString -> Rename_args
decode_Rename_args iprot bs = to_Rename_args $ T.deserializeVal iprot (T.T_STRUCT typemap_Rename_args) bs
| 197
|
decode_Rename_args iprot bs = to_Rename_args $ T.deserializeVal iprot (T.T_STRUCT typemap_Rename_args) bs
| 105
| false
| true
| 0
| 9
| 23
| 69
| 34
| 35
| null | null |
dysinger/amazonka
|
amazonka-rds/gen/Network/AWS/RDS/CreateDBInstance.hs
|
mpl-2.0
|
-- | License model information for this DB instance.
--
-- Valid values: 'license-included' | 'bring-your-own-license' | 'general-public-license'
cdbiLicenseModel :: Lens' CreateDBInstance (Maybe Text)
cdbiLicenseModel = lens _cdbiLicenseModel (\s a -> s { _cdbiLicenseModel = a })
| 281
|
cdbiLicenseModel :: Lens' CreateDBInstance (Maybe Text)
cdbiLicenseModel = lens _cdbiLicenseModel (\s a -> s { _cdbiLicenseModel = a })
| 135
|
cdbiLicenseModel = lens _cdbiLicenseModel (\s a -> s { _cdbiLicenseModel = a })
| 79
| true
| true
| 1
| 9
| 36
| 53
| 27
| 26
| null | null |
uduki/hsQt
|
Qtc/Enums/Core/QVariant.hs
|
bsd-2-clause
|
ePolygon :: QVariantType
ePolygon
= ieQVariantType $ 71
| 57
|
ePolygon :: QVariantType
ePolygon
= ieQVariantType $ 71
| 57
|
ePolygon
= ieQVariantType $ 71
| 32
| false
| true
| 0
| 6
| 9
| 18
| 8
| 10
| null | null |
denibertovic/haskell
|
kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs
|
bsd-3-clause
|
-- | 'v1SelfSubjectAccessReviewStatus' Lens
v1SelfSubjectAccessReviewStatusL :: Lens_' V1SelfSubjectAccessReview (Maybe V1SubjectAccessReviewStatus)
v1SelfSubjectAccessReviewStatusL f V1SelfSubjectAccessReview{..} = (\v1SelfSubjectAccessReviewStatus -> V1SelfSubjectAccessReview { v1SelfSubjectAccessReviewStatus, ..} ) <$> f v1SelfSubjectAccessReviewStatus
| 357
|
v1SelfSubjectAccessReviewStatusL :: Lens_' V1SelfSubjectAccessReview (Maybe V1SubjectAccessReviewStatus)
v1SelfSubjectAccessReviewStatusL f V1SelfSubjectAccessReview{..} = (\v1SelfSubjectAccessReviewStatus -> V1SelfSubjectAccessReview { v1SelfSubjectAccessReviewStatus, ..} ) <$> f v1SelfSubjectAccessReviewStatus
| 313
|
v1SelfSubjectAccessReviewStatusL f V1SelfSubjectAccessReview{..} = (\v1SelfSubjectAccessReviewStatus -> V1SelfSubjectAccessReview { v1SelfSubjectAccessReviewStatus, ..} ) <$> f v1SelfSubjectAccessReviewStatus
| 208
| true
| true
| 0
| 8
| 23
| 57
| 30
| 27
| null | null |
alexander-at-github/eta
|
compiler/ETA/TypeCheck/TcRnTypes.hs
|
bsd-3-clause
|
setCtLocEnv :: CtLoc -> TcLclEnv -> CtLoc
setCtLocEnv ctl env = ctl { ctl_env = env }
| 85
|
setCtLocEnv :: CtLoc -> TcLclEnv -> CtLoc
setCtLocEnv ctl env = ctl { ctl_env = env }
| 85
|
setCtLocEnv ctl env = ctl { ctl_env = env }
| 43
| false
| true
| 0
| 6
| 16
| 32
| 17
| 15
| null | null |
ganeti-github-testing/ganeti-test-1
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
jobQueueFilesPerms :: Int
jobQueueFilesPerms = 0o640
| 52
|
jobQueueFilesPerms :: Int
jobQueueFilesPerms = 0o640
| 52
|
jobQueueFilesPerms = 0o640
| 26
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
PaulGustafson/stringnet
|
Stringnet.hs
|
mit
|
isolateR :: InteriorVertex -> State ColoredGraph ()
isolateR v0 = state $ \tc ->
((), isolateHelperR v0 tc)
| 109
|
isolateR :: InteriorVertex -> State ColoredGraph ()
isolateR v0 = state $ \tc ->
((), isolateHelperR v0 tc)
| 109
|
isolateR v0 = state $ \tc ->
((), isolateHelperR v0 tc)
| 57
| false
| true
| 2
| 8
| 19
| 53
| 25
| 28
| null | null |
mono0926/ParallelConcurrentHaskell
|
fwaccel-gpu.hs
|
bsd-3-clause
|
test :: Bool
test = toList (shortestPaths testGraph) == toList expectedResult
| 77
|
test :: Bool
test = toList (shortestPaths testGraph) == toList expectedResult
| 77
|
test = toList (shortestPaths testGraph) == toList expectedResult
| 64
| false
| true
| 0
| 7
| 10
| 33
| 14
| 19
| null | null |
sdiehl/ghc
|
compiler/GHC/Stg/Lift.hs
|
bsd-3-clause
|
liftRhs
:: Maybe (DIdSet)
-- ^ @Just former_fvs@ <=> this RHS was lifted and we have to add @former_fvs@
-- as lambda binders, discarding all free vars.
-> LlStgRhs
-> LiftM OutStgRhs
liftRhs mb_former_fvs rhs@(StgRhsCon ccs con args)
= ASSERT2(isNothing mb_former_fvs, text "Should never lift a constructor" $$ ppr rhs)
StgRhsCon ccs con <$> traverse liftArgs args
| 381
|
liftRhs
:: Maybe (DIdSet)
-- ^ @Just former_fvs@ <=> this RHS was lifted and we have to add @former_fvs@
-- as lambda binders, discarding all free vars.
-> LlStgRhs
-> LiftM OutStgRhs
liftRhs mb_former_fvs rhs@(StgRhsCon ccs con args)
= ASSERT2(isNothing mb_former_fvs, text "Should never lift a constructor" $$ ppr rhs)
StgRhsCon ccs con <$> traverse liftArgs args
| 381
|
liftRhs mb_former_fvs rhs@(StgRhsCon ccs con args)
= ASSERT2(isNothing mb_former_fvs, text "Should never lift a constructor" $$ ppr rhs)
StgRhsCon ccs con <$> traverse liftArgs args
| 187
| false
| true
| 5
| 8
| 72
| 86
| 43
| 43
| null | null |
uuhan/Idris-dev
|
src/Idris/Core/ProofState.hs
|
bsd-3-clause
|
complete_fill :: RunTactic
complete_fill ctxt env (Bind x (Guess ty val) sc) =
do let guess = forget val
(val', valty) <- lift $ check ctxt env guess
unify' ctxt env (valty, Just $ SourceTerm val')
(ty, Just ExpectedType)
return $ Bind x (Guess ty val) sc
| 303
|
complete_fill :: RunTactic
complete_fill ctxt env (Bind x (Guess ty val) sc) =
do let guess = forget val
(val', valty) <- lift $ check ctxt env guess
unify' ctxt env (valty, Just $ SourceTerm val')
(ty, Just ExpectedType)
return $ Bind x (Guess ty val) sc
| 303
|
complete_fill ctxt env (Bind x (Guess ty val) sc) =
do let guess = forget val
(val', valty) <- lift $ check ctxt env guess
unify' ctxt env (valty, Just $ SourceTerm val')
(ty, Just ExpectedType)
return $ Bind x (Guess ty val) sc
| 276
| false
| true
| 1
| 11
| 94
| 135
| 62
| 73
| null | null |
siddhanathan/ghc
|
testsuite/tests/programs/andy_cherry/Interp.hs
|
bsd-3-clause
|
{- back one -}
updateBoard :: Board -> Par StoreBoard
updateBoard brd (FirstBoard old_brd)
= UndoableBoard brd old_brd
| 129
|
updateBoard :: Board -> Par StoreBoard
updateBoard brd (FirstBoard old_brd)
= UndoableBoard brd old_brd
| 111
|
updateBoard brd (FirstBoard old_brd)
= UndoableBoard brd old_brd
| 72
| true
| true
| 0
| 6
| 28
| 40
| 18
| 22
| null | null |
GaloisInc/halvm-ghc
|
compiler/hsSyn/HsPat.hs
|
bsd-3-clause
|
looksLazyLPat (L _ (BangPat {})) = False
| 50
|
looksLazyLPat (L _ (BangPat {})) = False
| 50
|
looksLazyLPat (L _ (BangPat {})) = False
| 50
| false
| false
| 0
| 8
| 16
| 25
| 12
| 13
| null | null |
wangbj/excises
|
find.hs
|
bsd-3-clause
|
walk = walkIf (const True)
| 26
|
walk = walkIf (const True)
| 26
|
walk = walkIf (const True)
| 26
| false
| false
| 0
| 7
| 4
| 15
| 7
| 8
| null | null |
mrd/camfort
|
src/Camfort/Output.hs
|
apache-2.0
|
refactoring :: Typeable a
=> FPM.FortranVersion
-> a -> SourceText -> StateT FU.Position Identity (SourceText, Bool)
refactoring v z inp = ((catchAll inp `extQ` refactoringsForProgramUnits v inp) `extQ` refactoringsForBlocks v inp) $ z
where
catchAll :: SourceText -> a -> StateT FU.Position Identity (SourceText, Bool)
catchAll _ _ = return (B.empty, False)
| 392
|
refactoring :: Typeable a
=> FPM.FortranVersion
-> a -> SourceText -> StateT FU.Position Identity (SourceText, Bool)
refactoring v z inp = ((catchAll inp `extQ` refactoringsForProgramUnits v inp) `extQ` refactoringsForBlocks v inp) $ z
where
catchAll :: SourceText -> a -> StateT FU.Position Identity (SourceText, Bool)
catchAll _ _ = return (B.empty, False)
| 392
|
refactoring v z inp = ((catchAll inp `extQ` refactoringsForProgramUnits v inp) `extQ` refactoringsForBlocks v inp) $ z
where
catchAll :: SourceText -> a -> StateT FU.Position Identity (SourceText, Bool)
catchAll _ _ = return (B.empty, False)
| 251
| false
| true
| 0
| 10
| 85
| 141
| 73
| 68
| null | null |
rob-b/pivotal
|
src/Pivotal/Format.hs
|
bsd-3-clause
|
mkOwners :: [Person] -> T.Text
mkOwners xs = T.intercalate ", " $ map userName xs
| 81
|
mkOwners :: [Person] -> T.Text
mkOwners xs = T.intercalate ", " $ map userName xs
| 81
|
mkOwners xs = T.intercalate ", " $ map userName xs
| 50
| false
| true
| 0
| 7
| 14
| 37
| 18
| 19
| null | null |
sakshamsharma/acehack
|
site.hs
|
mit
|
postPattern :: Pattern
postPattern = "posts/*.md" .||. "posts/*.org"
| 68
|
postPattern :: Pattern
postPattern = "posts/*.md" .||. "posts/*.org"
| 68
|
postPattern = "posts/*.md" .||. "posts/*.org"
| 45
| false
| true
| 0
| 5
| 7
| 15
| 8
| 7
| null | null |
rahulmutt/ghcvm
|
compiler/Eta/Utils/Outputable.hs
|
bsd-3-clause
|
speakNth :: Int -> SDoc
speakNth 1 = ptext (sLit "first")
| 57
|
speakNth :: Int -> SDoc
speakNth 1 = ptext (sLit "first")
| 57
|
speakNth 1 = ptext (sLit "first")
| 33
| false
| true
| 0
| 7
| 10
| 27
| 13
| 14
| null | null |
pontarius/pontarius-service
|
source/Persist.hs
|
agpl-3.0
|
getByNotFound :: (Show a, MonadThrow m, MonadIO m, PersistEntity val,
PersistEntityBackend val ~ SqlBackend) =>
Text
-> a
-> Unique val
-> PSM m (Entity val)
getByNotFound desc item unique = do
res <- runDB $ getBy unique
case res of
Nothing ->
throwM $
MsgError{ errorName = "org.pontarius.Error"
, errorText = Just $ mconcat
[ "Could not find "
, desc
, " : "
, Text.pack $ show item
]
, errorBody = []
}
Just r -> return r
| 715
|
getByNotFound :: (Show a, MonadThrow m, MonadIO m, PersistEntity val,
PersistEntityBackend val ~ SqlBackend) =>
Text
-> a
-> Unique val
-> PSM m (Entity val)
getByNotFound desc item unique = do
res <- runDB $ getBy unique
case res of
Nothing ->
throwM $
MsgError{ errorName = "org.pontarius.Error"
, errorText = Just $ mconcat
[ "Could not find "
, desc
, " : "
, Text.pack $ show item
]
, errorBody = []
}
Just r -> return r
| 715
|
getByNotFound desc item unique = do
res <- runDB $ getBy unique
case res of
Nothing ->
throwM $
MsgError{ errorName = "org.pontarius.Error"
, errorText = Just $ mconcat
[ "Could not find "
, desc
, " : "
, Text.pack $ show item
]
, errorBody = []
}
Just r -> return r
| 480
| false
| true
| 0
| 17
| 371
| 175
| 88
| 87
| null | null |
fpinsight/hadron
|
src/Hadron/Run/Hadoop.hs
|
bsd-3-clause
|
mrSettings
:: [String]
-- ^ Input files
-> String
-- ^ Output files
-> HadoopRunOpts
mrSettings ins out = def { _mrsInput = ins, _mrsOutput = out }
| 167
|
mrSettings
:: [String]
-- ^ Input files
-> String
-- ^ Output files
-> HadoopRunOpts
mrSettings ins out = def { _mrsInput = ins, _mrsOutput = out }
| 167
|
mrSettings ins out = def { _mrsInput = ins, _mrsOutput = out }
| 62
| false
| true
| 0
| 8
| 47
| 49
| 26
| 23
| null | null |
chrisbanks/cpiwb
|
profileMC4.hs
|
gpl-3.0
|
f32 = Nec (0,infty) f24
| 23
|
f32 = Nec (0,infty) f24
| 23
|
f32 = Nec (0,infty) f24
| 23
| false
| false
| 1
| 6
| 4
| 20
| 9
| 11
| null | null |
hopper-lang/hazel
|
src/Hazel.hs
|
bsd-3-clause
|
assert :: MonadError String m => Bool -> LocationDirections -> String -> m ()
assert True _ _ = return ()
| 105
|
assert :: MonadError String m => Bool -> LocationDirections -> String -> m ()
assert True _ _ = return ()
| 105
|
assert True _ _ = return ()
| 27
| false
| true
| 0
| 10
| 20
| 49
| 23
| 26
| null | null |
svenssonjoel/ArrowObsidian
|
Obsidian/ArrowObsidian/Exp.hs
|
bsd-3-clause
|
compOptU (E (LitUInt a)) = (E (LitUInt (complement a)))
| 55
|
compOptU (E (LitUInt a)) = (E (LitUInt (complement a)))
| 55
|
compOptU (E (LitUInt a)) = (E (LitUInt (complement a)))
| 55
| false
| false
| 0
| 10
| 8
| 39
| 19
| 20
| null | null |
spechub/Hets
|
Common/Lexer.hs
|
gpl-2.0
|
caslChar :: CharParser st String
caslChar = escapeChar <|> printable
| 68
|
caslChar :: CharParser st String
caslChar = escapeChar <|> printable
| 68
|
caslChar = escapeChar <|> printable
| 35
| false
| true
| 0
| 5
| 9
| 20
| 10
| 10
| null | null |
Soares/tagwiki
|
src/Control/DateTime/Absolute.hs
|
mit
|
daysIn :: Int -> Int -> Int
daysIn y m | isZeroMonth m && isLeapYear y = 1
| isZeroMonth m = 0
| mod m 13 `elem` [2, 5, 8, 11] = 31
| otherwise = 30
| 181
|
daysIn :: Int -> Int -> Int
daysIn y m | isZeroMonth m && isLeapYear y = 1
| isZeroMonth m = 0
| mod m 13 `elem` [2, 5, 8, 11] = 31
| otherwise = 30
| 181
|
daysIn y m | isZeroMonth m && isLeapYear y = 1
| isZeroMonth m = 0
| mod m 13 `elem` [2, 5, 8, 11] = 31
| otherwise = 30
| 153
| false
| true
| 0
| 9
| 70
| 93
| 45
| 48
| null | null |
mhwombat/exp-audio-id-wains
|
src/ALife/Creatur/Wain/AudioID/Action.hs
|
bsd-3-clause
|
numeralFor Identify_6 = '6'
| 27
|
numeralFor Identify_6 = '6'
| 27
|
numeralFor Identify_6 = '6'
| 27
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
dysinger/amazonka
|
amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/UpdateEnvironment.hs
|
mpl-2.0
|
-- | The current operational status of the environment:
--
-- 'Launching': Environment is in the process of initial deployment. 'Updating': Environment is in the process of updating its configuration settings or application version.
-- 'Ready': Environment is available to have an action performed on it, such as
-- update or terminate. 'Terminating': Environment is in the shut-down process.
-- 'Terminated': Environment is not running.
uerStatus :: Lens' UpdateEnvironmentResponse (Maybe EnvironmentStatus)
uerStatus = lens _uerStatus (\s a -> s { _uerStatus = a })
| 571
|
uerStatus :: Lens' UpdateEnvironmentResponse (Maybe EnvironmentStatus)
uerStatus = lens _uerStatus (\s a -> s { _uerStatus = a })
| 129
|
uerStatus = lens _uerStatus (\s a -> s { _uerStatus = a })
| 58
| true
| true
| 1
| 9
| 87
| 56
| 30
| 26
| null | null |
brendanhay/gogol
|
gogol-chat/gen/Network/Google/Chat/Types/Product.hs
|
mpl-2.0
|
-- | The wrap text setting. If \`true\`, the text is wrapped and displayed in
-- multiline. Otherwise, the text is truncated.
gacvdtWrapText :: Lens' GoogleAppsCardV1DecoratedText (Maybe Bool)
gacvdtWrapText
= lens _gacvdtWrapText
(\ s a -> s{_gacvdtWrapText = a})
| 272
|
gacvdtWrapText :: Lens' GoogleAppsCardV1DecoratedText (Maybe Bool)
gacvdtWrapText
= lens _gacvdtWrapText
(\ s a -> s{_gacvdtWrapText = a})
| 146
|
gacvdtWrapText
= lens _gacvdtWrapText
(\ s a -> s{_gacvdtWrapText = a})
| 79
| true
| true
| 1
| 9
| 46
| 52
| 26
| 26
| null | null |
diku-dk/futhark
|
src/Futhark/Pass/ExtractKernels/Distribution.hs
|
isc
|
tryDistributeStm ::
(MonadFreshNames m, HasScope t m, ASTRep rep) =>
Nestings ->
Targets ->
Stm rep ->
m (Maybe (Result, Targets, KernelNest))
tryDistributeStm nest targets stm =
fmap addRes <$> createKernelNest nest dist_body
where
(dist_body, res) = distributionBodyFromStm targets stm
addRes (targets', kernel_nest) = (res, targets', kernel_nest)
| 371
|
tryDistributeStm ::
(MonadFreshNames m, HasScope t m, ASTRep rep) =>
Nestings ->
Targets ->
Stm rep ->
m (Maybe (Result, Targets, KernelNest))
tryDistributeStm nest targets stm =
fmap addRes <$> createKernelNest nest dist_body
where
(dist_body, res) = distributionBodyFromStm targets stm
addRes (targets', kernel_nest) = (res, targets', kernel_nest)
| 371
|
tryDistributeStm nest targets stm =
fmap addRes <$> createKernelNest nest dist_body
where
(dist_body, res) = distributionBodyFromStm targets stm
addRes (targets', kernel_nest) = (res, targets', kernel_nest)
| 218
| false
| true
| 2
| 13
| 68
| 133
| 67
| 66
| null | null |
nakamuray/mangekyo
|
src/Mangekyo/Conduit/Csv.hs
|
bsd-2-clause
|
toText v = string' v
| 20
|
toText v = string' v
| 20
|
toText v = string' v
| 20
| false
| false
| 0
| 5
| 4
| 12
| 5
| 7
| null | null |
ivan-m/testbench
|
src/TestBench.hs
|
mit
|
baselineWith :: (b -> b -> Assertion) -> String -> a -> CompParams a b
baselineWith mkAssert nm arg = mempty { withOps = addOp
, mkOps = Endo setTest
}
where
opFrom ci = Op { opName = nm
, opBench = toBench ci (func ci) arg
, opWeigh = toWeigh ci (func ci) arg
, opTest = Nothing
}
addOp ci = Endo (opFrom ci:)
setTest ci = ci { toTest = Just . mkAssert (func ci arg) }
-- | Specify a predicate that all results should satisfy.
--
-- Note that the last statement between 'testWith', 'baseline' and
-- 'noTests' \"wins\" in specifying which testing (if any) to do.
| 740
|
baselineWith :: (b -> b -> Assertion) -> String -> a -> CompParams a b
baselineWith mkAssert nm arg = mempty { withOps = addOp
, mkOps = Endo setTest
}
where
opFrom ci = Op { opName = nm
, opBench = toBench ci (func ci) arg
, opWeigh = toWeigh ci (func ci) arg
, opTest = Nothing
}
addOp ci = Endo (opFrom ci:)
setTest ci = ci { toTest = Just . mkAssert (func ci arg) }
-- | Specify a predicate that all results should satisfy.
--
-- Note that the last statement between 'testWith', 'baseline' and
-- 'noTests' \"wins\" in specifying which testing (if any) to do.
| 740
|
baselineWith mkAssert nm arg = mempty { withOps = addOp
, mkOps = Endo setTest
}
where
opFrom ci = Op { opName = nm
, opBench = toBench ci (func ci) arg
, opWeigh = toWeigh ci (func ci) arg
, opTest = Nothing
}
addOp ci = Endo (opFrom ci:)
setTest ci = ci { toTest = Just . mkAssert (func ci arg) }
-- | Specify a predicate that all results should satisfy.
--
-- Note that the last statement between 'testWith', 'baseline' and
-- 'noTests' \"wins\" in specifying which testing (if any) to do.
| 669
| false
| true
| 3
| 11
| 289
| 199
| 99
| 100
| null | null |
ambiata/highlighting-kate
|
Text/Highlighting/Kate/Syntax/Markdown.hs
|
gpl-2.0
|
regex_'28'5cs'7c'5e'29'5b'5c'2a'5f'5d'7b3'7d'5b'5e'5c'2a'5f'5d'2b'5b'5c'2a'5f'5d'7b3'7d'28'5cs'7c'5c'2e'7c'2c'7c'3b'7c'3a'7c'5c'2d'7c'5c'3f'7c'24'29 = compileRegex True "(\\s|^)[\\*_]{3}[^\\*_]+[\\*_]{3}(\\s|\\.|,|;|:|\\-|\\?|$)"
| 229
|
regex_'28'5cs'7c'5e'29'5b'5c'2a'5f'5d'7b3'7d'5b'5e'5c'2a'5f'5d'2b'5b'5c'2a'5f'5d'7b3'7d'28'5cs'7c'5c'2e'7c'2c'7c'3b'7c'3a'7c'5c'2d'7c'5c'3f'7c'24'29 = compileRegex True "(\\s|^)[\\*_]{3}[^\\*_]+[\\*_]{3}(\\s|\\.|,|;|:|\\-|\\?|$)"
| 229
|
regex_'28'5cs'7c'5e'29'5b'5c'2a'5f'5d'7b3'7d'5b'5e'5c'2a'5f'5d'2b'5b'5c'2a'5f'5d'7b3'7d'28'5cs'7c'5c'2e'7c'2c'7c'3b'7c'3a'7c'5c'2d'7c'5c'3f'7c'24'29 = compileRegex True "(\\s|^)[\\*_]{3}[^\\*_]+[\\*_]{3}(\\s|\\.|,|;|:|\\-|\\?|$)"
| 229
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
beni55/hermit
|
src/HERMIT/Dictionary/GHC.hs
|
bsd-2-clause
|
-------------------------------------------
----------------------------------------------------------------------
-- TODO: Ideally, occurAnalyseExprR would fail if nothing changed.
-- This is tricky though, as it's not just the structure of the expression, but also the meta-data.
-- | Zap the 'OccInfo' in a zombie identifier.
dezombifyR :: (ExtendPath c Crumb, Monad m) => Rewrite c m CoreExpr
dezombifyR = varR (acceptR isDeadBinder >>^ zapVarOccInfo)
| 464
|
dezombifyR :: (ExtendPath c Crumb, Monad m) => Rewrite c m CoreExpr
dezombifyR = varR (acceptR isDeadBinder >>^ zapVarOccInfo)
| 126
|
dezombifyR = varR (acceptR isDeadBinder >>^ zapVarOccInfo)
| 58
| true
| true
| 0
| 8
| 65
| 59
| 30
| 29
| null | null |
abuiles/turbinado-blog
|
tmp/dependencies/hs-plugins-1.3.1/testsuite/reload/null/prog/Main.hs
|
bsd-3-clause
|
-- an example where we just want to load an object and run it
main = do
m_v <- load "../Null.o" ["../api"] [] "resource"
(m,v) <- case m_v of
LoadSuccess m v -> return (m,v)
_ -> error "load failed"
putStrLn ( show (a v) )
m_v <- reload m "resource" -- get a new version
v' <- case m_v of
LoadSuccess _ v -> return v
_ -> error "load failed"
putStrLn ( show (a v') )
| 455
|
main = do
m_v <- load "../Null.o" ["../api"] [] "resource"
(m,v) <- case m_v of
LoadSuccess m v -> return (m,v)
_ -> error "load failed"
putStrLn ( show (a v) )
m_v <- reload m "resource" -- get a new version
v' <- case m_v of
LoadSuccess _ v -> return v
_ -> error "load failed"
putStrLn ( show (a v') )
| 392
|
main = do
m_v <- load "../Null.o" ["../api"] [] "resource"
(m,v) <- case m_v of
LoadSuccess m v -> return (m,v)
_ -> error "load failed"
putStrLn ( show (a v) )
m_v <- reload m "resource" -- get a new version
v' <- case m_v of
LoadSuccess _ v -> return v
_ -> error "load failed"
putStrLn ( show (a v') )
| 392
| true
| false
| 0
| 12
| 166
| 157
| 74
| 83
| null | null |
rodrigogribeiro/mptc
|
test/Cases/IfaceWriterTest.hs
|
bsd-3-clause
|
m = ModuleName "Teste1"
| 23
|
m = ModuleName "Teste1"
| 23
|
m = ModuleName "Teste1"
| 23
| false
| false
| 1
| 5
| 3
| 12
| 4
| 8
| null | null |
kuitang/monad-learner
|
polyreg.hs
|
mit
|
sumSquareDiff x y = sumVector $ squareDiff x y
| 46
|
sumSquareDiff x y = sumVector $ squareDiff x y
| 46
|
sumSquareDiff x y = sumVector $ squareDiff x y
| 46
| false
| false
| 1
| 6
| 8
| 24
| 9
| 15
| null | null |
bananu7/Turnip
|
src/Turnip/Eval.hs
|
mit
|
defaultCtx :: Context
defaultCtx = Context {
_gRef = gTableRef,
_functions = Map.empty,
_tables = Map.fromList [(gTableRef, gTable)],
_lastId = 10
}
where
gTableRef = TableRef 1
gTable = TableData gTableData Nothing
gTableData = Map.fromList [
(Str "_G", Table gTableRef),
(Str "_VERSION", Str $ "Turnip " ++ showVersion version)
]
| 389
|
defaultCtx :: Context
defaultCtx = Context {
_gRef = gTableRef,
_functions = Map.empty,
_tables = Map.fromList [(gTableRef, gTable)],
_lastId = 10
}
where
gTableRef = TableRef 1
gTable = TableData gTableData Nothing
gTableData = Map.fromList [
(Str "_G", Table gTableRef),
(Str "_VERSION", Str $ "Turnip " ++ showVersion version)
]
| 389
|
defaultCtx = Context {
_gRef = gTableRef,
_functions = Map.empty,
_tables = Map.fromList [(gTableRef, gTable)],
_lastId = 10
}
where
gTableRef = TableRef 1
gTable = TableData gTableData Nothing
gTableData = Map.fromList [
(Str "_G", Table gTableRef),
(Str "_VERSION", Str $ "Turnip " ++ showVersion version)
]
| 367
| false
| true
| 1
| 9
| 107
| 134
| 69
| 65
| null | null |
tolysz/prepare-ghcjs
|
spec-lts8/aeson/pure/Data/Aeson/Parser/Unescape.hs
|
bsd-3-clause
|
setByte3Top point word = point .|. ((fromIntegral $ word .&. 0xf) `shiftL` 12)
| 78
|
setByte3Top point word = point .|. ((fromIntegral $ word .&. 0xf) `shiftL` 12)
| 78
|
setByte3Top point word = point .|. ((fromIntegral $ word .&. 0xf) `shiftL` 12)
| 78
| false
| false
| 0
| 10
| 12
| 35
| 19
| 16
| null | null |
8l/barrelfish
|
hake/RuleDefs.hs
|
mit
|
extraCDependency :: Options -> String -> String -> HRule
extraCDependency opts file s = Rule (extraCDependencyForObj opts file s obj)
where obj = objectFilePath opts s
| 171
|
extraCDependency :: Options -> String -> String -> HRule
extraCDependency opts file s = Rule (extraCDependencyForObj opts file s obj)
where obj = objectFilePath opts s
| 171
|
extraCDependency opts file s = Rule (extraCDependencyForObj opts file s obj)
where obj = objectFilePath opts s
| 114
| false
| true
| 1
| 7
| 29
| 66
| 29
| 37
| null | null |
byorgey/Idris-dev
|
src/Idris/Completion.hs
|
bsd-3-clause
|
modules :: Idris [String]
modules = do i <- get
return $ map show $ imported i
| 91
|
modules :: Idris [String]
modules = do i <- get
return $ map show $ imported i
| 91
|
modules = do i <- get
return $ map show $ imported i
| 65
| false
| true
| 1
| 10
| 29
| 45
| 19
| 26
| null | null |
wavewave/madgraph-auto-dataset
|
src/HEP/Automation/MadGraph/Dataset/Set20110630set1.hs
|
gpl-3.0
|
psetup_zph_TTBar0or1J :: ProcessSetup ZpH
psetup_zph_TTBar0or1J = PS {
mversion = MadGraph4
, model = ZpH
, process = preDefProcess TTBar0or1J
, processBrief = "TTBar0or1J"
, workname = "630ZpH_TTBar0or1J"
}
| 226
|
psetup_zph_TTBar0or1J :: ProcessSetup ZpH
psetup_zph_TTBar0or1J = PS {
mversion = MadGraph4
, model = ZpH
, process = preDefProcess TTBar0or1J
, processBrief = "TTBar0or1J"
, workname = "630ZpH_TTBar0or1J"
}
| 226
|
psetup_zph_TTBar0or1J = PS {
mversion = MadGraph4
, model = ZpH
, process = preDefProcess TTBar0or1J
, processBrief = "TTBar0or1J"
, workname = "630ZpH_TTBar0or1J"
}
| 184
| false
| true
| 0
| 7
| 47
| 49
| 29
| 20
| null | null |
rahulmutt/ghcvm
|
compiler/Eta/BasicTypes/VarSet.hs
|
bsd-3-clause
|
intersectDVarSet :: DVarSet -> DVarSet -> DVarSet
intersectDVarSet = intersectUniqDSets
| 87
|
intersectDVarSet :: DVarSet -> DVarSet -> DVarSet
intersectDVarSet = intersectUniqDSets
| 87
|
intersectDVarSet = intersectUniqDSets
| 37
| false
| true
| 0
| 6
| 9
| 19
| 10
| 9
| null | null |
foreverbell/project-euler-solutions
|
src/54.hs
|
bsd-3-clause
|
cardValue :: Card -> Int
cardValue = fst
| 40
|
cardValue :: Card -> Int
cardValue = fst
| 40
|
cardValue = fst
| 15
| false
| true
| 0
| 5
| 7
| 15
| 8
| 7
| null | null |
holzensp/ghc
|
libraries/base/GHC/IO/Handle/Types.hs
|
bsd-3-clause
|
isReadableHandleType :: HandleType -> Bool
isReadableHandleType ReadHandle = True
| 89
|
isReadableHandleType :: HandleType -> Bool
isReadableHandleType ReadHandle = True
| 89
|
isReadableHandleType ReadHandle = True
| 46
| false
| true
| 0
| 5
| 16
| 18
| 9
| 9
| null | null |
jsavatgy/talvipaivanseisauksen-ajanlasku
|
bmt-test-02.hs
|
gpl-3.0
|
solsticesUtcList = [
"2015-12-22 04:48",
"2016-12-21 10:44",
"2017-12-21 16:28",
"2018-12-21 22:22",
"2019-12-22 04:19",
"2020-12-21 10:02",
"2021-12-21 15:59",
"2022-12-21 21:47",
"2023-12-22 03:27",
"2024-12-21 09:20",
"2025-12-21 15:02",
"2026-12-21 20:49",
"2027-12-22 02:41",
"2028-12-21 08:19",
"2029-12-21 14:14",
"2030-12-21 20:09",
"2031-12-22 01:55",
"2032-12-21 07:55",
"2033-12-21 13:45",
"2034-12-21 19:33",
"2035-12-22 01:30",
"2036-12-21 07:12",
"2037-12-21 13:07",
"2038-12-21 19:01",
"2039-12-22 00:40",
"2040-12-21 06:32",
"2041-12-21 12:17",
"2042-12-21 18:03",
"2043-12-22 00:01",
"2044-12-21 05:43",
"2045-12-21 11:34",
"2046-12-21 17:27",
"2047-12-21 23:07",
"2048-12-21 05:01",
"2049-12-21 10:51",
"2050-12-21 16:37",
"2051-12-21 22:33",
"2052-12-21 04:16",
"2053-12-21 10:09",
"2054-12-21 16:09",
"2055-12-21 21:55",
"2056-12-21 03:50",
"2057-12-21 09:42",
"2058-12-21 15:24",
"2059-12-21 21:17",
"2060-12-21 03:00",
"2061-12-21 08:48",
"2062-12-21 14:42",
"2063-12-21 20:20",
"2064-12-21 02:08",
"2065-12-21 07:59",
"2066-12-21 13:45",
"2067-12-21 19:43",
"2068-12-21 01:32",
"2069-12-21 07:21",
"2070-12-21 13:19",
"2071-12-21 19:03",
"2072-12-21 00:55",
"2073-12-21 06:50",
"2074-12-21 12:35",
"2075-12-21 18:26",
"2076-12-21 00:13",
"2077-12-21 06:00",
"2078-12-21 11:57",
"2079-12-21 17:43",
"2080-12-20 23:32",
"2081-12-21 05:22",
"2082-12-21 11:04",
"2083-12-21 16:52",
"2084-12-20 22:41",
"2085-12-21 04:28",
"2086-12-21 10:22",
"2087-12-21 16:08",
"2088-12-20 21:56",
"2089-12-21 03:52",
"2090-12-21 09:43",
"2091-12-21 15:38",
"2092-12-20 21:31",
"2093-12-21 03:20",
"2094-12-21 09:13",
"2095-12-21 15:00",
"2096-12-20 20:46",
"2097-12-21 02:36",
"2098-12-21 08:20",
"2099-12-21 14:04",
"2100-12-21 19:50",
"2101-12-22 01:38",
"2102-12-22 07:32",
"2103-12-22 13:24",
"2104-12-21 19:12",
"2105-12-22 01:03",
"2106-12-22 06:53",
"2107-12-22 12:42",
"2108-12-21 18:34",
"2109-12-22 00:27",
"2110-12-22 06:18",
"2111-12-22 12:07",
"2112-12-21 17:55",
"2113-12-21 23:46",
"2114-12-22 05:39",
"2115-12-22 11:27" ]
| 2,243
|
solsticesUtcList = [
"2015-12-22 04:48",
"2016-12-21 10:44",
"2017-12-21 16:28",
"2018-12-21 22:22",
"2019-12-22 04:19",
"2020-12-21 10:02",
"2021-12-21 15:59",
"2022-12-21 21:47",
"2023-12-22 03:27",
"2024-12-21 09:20",
"2025-12-21 15:02",
"2026-12-21 20:49",
"2027-12-22 02:41",
"2028-12-21 08:19",
"2029-12-21 14:14",
"2030-12-21 20:09",
"2031-12-22 01:55",
"2032-12-21 07:55",
"2033-12-21 13:45",
"2034-12-21 19:33",
"2035-12-22 01:30",
"2036-12-21 07:12",
"2037-12-21 13:07",
"2038-12-21 19:01",
"2039-12-22 00:40",
"2040-12-21 06:32",
"2041-12-21 12:17",
"2042-12-21 18:03",
"2043-12-22 00:01",
"2044-12-21 05:43",
"2045-12-21 11:34",
"2046-12-21 17:27",
"2047-12-21 23:07",
"2048-12-21 05:01",
"2049-12-21 10:51",
"2050-12-21 16:37",
"2051-12-21 22:33",
"2052-12-21 04:16",
"2053-12-21 10:09",
"2054-12-21 16:09",
"2055-12-21 21:55",
"2056-12-21 03:50",
"2057-12-21 09:42",
"2058-12-21 15:24",
"2059-12-21 21:17",
"2060-12-21 03:00",
"2061-12-21 08:48",
"2062-12-21 14:42",
"2063-12-21 20:20",
"2064-12-21 02:08",
"2065-12-21 07:59",
"2066-12-21 13:45",
"2067-12-21 19:43",
"2068-12-21 01:32",
"2069-12-21 07:21",
"2070-12-21 13:19",
"2071-12-21 19:03",
"2072-12-21 00:55",
"2073-12-21 06:50",
"2074-12-21 12:35",
"2075-12-21 18:26",
"2076-12-21 00:13",
"2077-12-21 06:00",
"2078-12-21 11:57",
"2079-12-21 17:43",
"2080-12-20 23:32",
"2081-12-21 05:22",
"2082-12-21 11:04",
"2083-12-21 16:52",
"2084-12-20 22:41",
"2085-12-21 04:28",
"2086-12-21 10:22",
"2087-12-21 16:08",
"2088-12-20 21:56",
"2089-12-21 03:52",
"2090-12-21 09:43",
"2091-12-21 15:38",
"2092-12-20 21:31",
"2093-12-21 03:20",
"2094-12-21 09:13",
"2095-12-21 15:00",
"2096-12-20 20:46",
"2097-12-21 02:36",
"2098-12-21 08:20",
"2099-12-21 14:04",
"2100-12-21 19:50",
"2101-12-22 01:38",
"2102-12-22 07:32",
"2103-12-22 13:24",
"2104-12-21 19:12",
"2105-12-22 01:03",
"2106-12-22 06:53",
"2107-12-22 12:42",
"2108-12-21 18:34",
"2109-12-22 00:27",
"2110-12-22 06:18",
"2111-12-22 12:07",
"2112-12-21 17:55",
"2113-12-21 23:46",
"2114-12-22 05:39",
"2115-12-22 11:27" ]
| 2,243
|
solsticesUtcList = [
"2015-12-22 04:48",
"2016-12-21 10:44",
"2017-12-21 16:28",
"2018-12-21 22:22",
"2019-12-22 04:19",
"2020-12-21 10:02",
"2021-12-21 15:59",
"2022-12-21 21:47",
"2023-12-22 03:27",
"2024-12-21 09:20",
"2025-12-21 15:02",
"2026-12-21 20:49",
"2027-12-22 02:41",
"2028-12-21 08:19",
"2029-12-21 14:14",
"2030-12-21 20:09",
"2031-12-22 01:55",
"2032-12-21 07:55",
"2033-12-21 13:45",
"2034-12-21 19:33",
"2035-12-22 01:30",
"2036-12-21 07:12",
"2037-12-21 13:07",
"2038-12-21 19:01",
"2039-12-22 00:40",
"2040-12-21 06:32",
"2041-12-21 12:17",
"2042-12-21 18:03",
"2043-12-22 00:01",
"2044-12-21 05:43",
"2045-12-21 11:34",
"2046-12-21 17:27",
"2047-12-21 23:07",
"2048-12-21 05:01",
"2049-12-21 10:51",
"2050-12-21 16:37",
"2051-12-21 22:33",
"2052-12-21 04:16",
"2053-12-21 10:09",
"2054-12-21 16:09",
"2055-12-21 21:55",
"2056-12-21 03:50",
"2057-12-21 09:42",
"2058-12-21 15:24",
"2059-12-21 21:17",
"2060-12-21 03:00",
"2061-12-21 08:48",
"2062-12-21 14:42",
"2063-12-21 20:20",
"2064-12-21 02:08",
"2065-12-21 07:59",
"2066-12-21 13:45",
"2067-12-21 19:43",
"2068-12-21 01:32",
"2069-12-21 07:21",
"2070-12-21 13:19",
"2071-12-21 19:03",
"2072-12-21 00:55",
"2073-12-21 06:50",
"2074-12-21 12:35",
"2075-12-21 18:26",
"2076-12-21 00:13",
"2077-12-21 06:00",
"2078-12-21 11:57",
"2079-12-21 17:43",
"2080-12-20 23:32",
"2081-12-21 05:22",
"2082-12-21 11:04",
"2083-12-21 16:52",
"2084-12-20 22:41",
"2085-12-21 04:28",
"2086-12-21 10:22",
"2087-12-21 16:08",
"2088-12-20 21:56",
"2089-12-21 03:52",
"2090-12-21 09:43",
"2091-12-21 15:38",
"2092-12-20 21:31",
"2093-12-21 03:20",
"2094-12-21 09:13",
"2095-12-21 15:00",
"2096-12-20 20:46",
"2097-12-21 02:36",
"2098-12-21 08:20",
"2099-12-21 14:04",
"2100-12-21 19:50",
"2101-12-22 01:38",
"2102-12-22 07:32",
"2103-12-22 13:24",
"2104-12-21 19:12",
"2105-12-22 01:03",
"2106-12-22 06:53",
"2107-12-22 12:42",
"2108-12-21 18:34",
"2109-12-22 00:27",
"2110-12-22 06:18",
"2111-12-22 12:07",
"2112-12-21 17:55",
"2113-12-21 23:46",
"2114-12-22 05:39",
"2115-12-22 11:27" ]
| 2,243
| false
| false
| 0
| 5
| 407
| 309
| 205
| 104
| null | null |
ihc/futhark
|
src/Futhark/Optimise/MemoryBlockMerging.hs
|
isc
|
-- Do we print an overview of the program with all "filler" statements filtered
-- out (based on what is most relevant for memory block merging)? Currently
-- disabled by default. Enable by setting the environment variable
-- MEMORY_BLOCK_MERGING_OVERVIEW_PRINT=1.
usesMemoryBlockMergingOverviewPrint :: Bool
usesMemoryBlockMergingOverviewPrint =
isEnvVarSet "MEMORY_BLOCK_MERGING_OVERVIEW_PRINT" False
| 406
|
usesMemoryBlockMergingOverviewPrint :: Bool
usesMemoryBlockMergingOverviewPrint =
isEnvVarSet "MEMORY_BLOCK_MERGING_OVERVIEW_PRINT" False
| 139
|
usesMemoryBlockMergingOverviewPrint =
isEnvVarSet "MEMORY_BLOCK_MERGING_OVERVIEW_PRINT" False
| 95
| true
| true
| 0
| 5
| 50
| 20
| 12
| 8
| null | null |
Qu4tro/CP
|
CP.hs
|
mit
|
- pwnil = split id (!)
br = split id (!)
| 42
|
br = split id (!)
| 17
|
br = split id (!)
| 17
| true
| false
| 2
| 5
| 12
| 35
| 15
| 20
| null | null |
rvion/lamdu
|
test/InferCombinators.hs
|
gpl-3.0
|
($.) :: ExprWithResumptions -> T.Tag -> ExprWithResumptions
($.) = getField
| 75
|
($.) :: ExprWithResumptions -> T.Tag -> ExprWithResumptions
($.) = getField
| 75
|
($.) = getField
| 15
| false
| true
| 0
| 8
| 9
| 32
| 16
| 16
| null | null |
mettekou/ghc
|
compiler/typecheck/TcRnTypes.hs
|
bsd-3-clause
|
-- NB: topModIdentity, not topModSemantic!
-- Definition sites of orphan identities will be identity modules, not semantic
-- modules.
-- Note [Constraints in static forms]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
-- When a static form produces constraints like
--
-- f :: StaticPtr (Bool -> String)
-- f = static show
--
-- we collect them in tcg_static_wc and resolve them at the end
-- of type checking. They need to be resolved separately because
-- we don't want to resolve them in the context of the enclosing
-- expression. Consider
--
-- g :: Show a => StaticPtr (a -> String)
-- g = static show
--
-- If the @Show a0@ constraint that the body of the static form produces was
-- resolved in the context of the enclosing expression, then the body of the
-- static form wouldn't be closed because the Show dictionary would come from
-- g's context instead of coming from the top level.
tcVisibleOrphanMods :: TcGblEnv -> ModuleSet
tcVisibleOrphanMods tcg_env
= mkModuleSet (tcg_mod tcg_env : imp_orphs (tcg_imports tcg_env))
| 1,036
|
tcVisibleOrphanMods :: TcGblEnv -> ModuleSet
tcVisibleOrphanMods tcg_env
= mkModuleSet (tcg_mod tcg_env : imp_orphs (tcg_imports tcg_env))
| 142
|
tcVisibleOrphanMods tcg_env
= mkModuleSet (tcg_mod tcg_env : imp_orphs (tcg_imports tcg_env))
| 97
| true
| true
| 0
| 10
| 178
| 63
| 42
| 21
| null | null |
bens/hurtle
|
src/System/Hurtle/Log.hs
|
apache-2.0
|
firstId :: Id
firstId = Id 0
| 28
|
firstId :: Id
firstId = Id 0
| 28
|
firstId = Id 0
| 14
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
kylcarte/ink-ui
|
src/Lucid/Ink.hs
|
bsd-3-clause
|
font500_ = fw_ 500
| 18
|
font500_ = fw_ 500
| 18
|
font500_ = fw_ 500
| 18
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
HostsTools/Haskell-Console
|
Main.hs
|
gpl-3.0
|
strHostsBeginMark = B.pack "# Copyright (c) 2014-2016, racaljk."
| 64
|
strHostsBeginMark = B.pack "# Copyright (c) 2014-2016, racaljk."
| 64
|
strHostsBeginMark = B.pack "# Copyright (c) 2014-2016, racaljk."
| 64
| false
| false
| 0
| 6
| 7
| 11
| 5
| 6
| null | null |
Happstack/reform-hamlet
|
Text/Reform/Hamlet/Text.hs
|
bsd-3-clause
|
-- | wrap a @\<fieldset class=\"reform\"\>@ around a 'Form'
--
fieldset :: (Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
fieldset = C.fieldset
| 226
|
fieldset :: (Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
fieldset = C.fieldset
| 163
|
fieldset = C.fieldset
| 21
| true
| true
| 0
| 9
| 58
| 72
| 37
| 35
| null | null |
danr/hipspec
|
tfp1/tests/App.hs
|
gpl-3.0
|
k f x = case f x of
(g,h) -> (g x,case h x of (k,_) -> k x (g x))
| 75
|
k f x = case f x of
(g,h) -> (g x,case h x of (k,_) -> k x (g x))
| 75
|
k f x = case f x of
(g,h) -> (g x,case h x of (k,_) -> k x (g x))
| 75
| false
| false
| 0
| 14
| 30
| 70
| 35
| 35
| null | null |
thsutton/rossum
|
src/Rossum/LC.hs
|
bsd-3-clause
|
arseAbs :: Parser -> Parser
parseAbs parseTerm = do
char '\\'
v <- parseName
modifyScope (v:)
char '.'
term <- parseTerm
modifyScope tail
pos <- getPosition
return (Abs (loc pos) v term)
| 203
|
parseAbs :: Parser -> Parser
parseAbs parseTerm = do
char '\\'
v <- parseName
modifyScope (v:)
char '.'
term <- parseTerm
modifyScope tail
pos <- getPosition
return (Abs (loc pos) v term)
| 203
|
parseAbs parseTerm = do
char '\\'
v <- parseName
modifyScope (v:)
char '.'
term <- parseTerm
modifyScope tail
pos <- getPosition
return (Abs (loc pos) v term)
| 174
| false
| true
| 0
| 11
| 48
| 89
| 39
| 50
| null | null |
sgillespie/ghc
|
compiler/typecheck/TcType.hs
|
bsd-3-clause
|
mkCheckExpType :: TcType -> ExpType
mkCheckExpType = Check
| 58
|
mkCheckExpType :: TcType -> ExpType
mkCheckExpType = Check
| 58
|
mkCheckExpType = Check
| 22
| false
| true
| 0
| 5
| 7
| 15
| 8
| 7
| null | null |
sopvop/snap-core
|
src/Snap/Util/Proxy.hs
|
bsd-3-clause
|
------------------------------------------------------------------------------
xForwardedFor :: Request -> Request
xForwardedFor req = req { rqClientAddr = ip
, rqClientPort = port
}
where
proxyString = getHeader "Forwarded-For" req <|>
getHeader "X-Forwarded-For" req <|>
Just (rqClientAddr req)
proxyAddr = trim . snd . S.breakEnd (== ',') . fromJust $ proxyString
trim = fst . S.spanEnd isSpace . S.dropWhile isSpace
(ip,portStr) = second (S.drop 1) . S.break (== ':') $ proxyAddr
port = fromJust (fst <$> S.readInt portStr <|>
Just (rqClientPort req))
| 719
|
xForwardedFor :: Request -> Request
xForwardedFor req = req { rqClientAddr = ip
, rqClientPort = port
}
where
proxyString = getHeader "Forwarded-For" req <|>
getHeader "X-Forwarded-For" req <|>
Just (rqClientAddr req)
proxyAddr = trim . snd . S.breakEnd (== ',') . fromJust $ proxyString
trim = fst . S.spanEnd isSpace . S.dropWhile isSpace
(ip,portStr) = second (S.drop 1) . S.break (== ':') $ proxyAddr
port = fromJust (fst <$> S.readInt portStr <|>
Just (rqClientPort req))
| 640
|
xForwardedFor req = req { rqClientAddr = ip
, rqClientPort = port
}
where
proxyString = getHeader "Forwarded-For" req <|>
getHeader "X-Forwarded-For" req <|>
Just (rqClientAddr req)
proxyAddr = trim . snd . S.breakEnd (== ',') . fromJust $ proxyString
trim = fst . S.spanEnd isSpace . S.dropWhile isSpace
(ip,portStr) = second (S.drop 1) . S.break (== ':') $ proxyAddr
port = fromJust (fst <$> S.readInt portStr <|>
Just (rqClientPort req))
| 604
| true
| true
| 6
| 10
| 240
| 216
| 101
| 115
| null | null |
chrisdone/haskell-docs
|
src/Haskell/Docs/Cabal.hs
|
bsd-3-clause
|
-- * Internal modules
-- | Convert a Cabal module name to a GHC module name.
convModule :: Distribution.ModuleName.ModuleName -> Module.ModuleName
convModule = makeModuleName . intercalate "." . components
| 206
|
convModule :: Distribution.ModuleName.ModuleName -> Module.ModuleName
convModule = makeModuleName . intercalate "." . components
| 128
|
convModule = makeModuleName . intercalate "." . components
| 58
| true
| true
| 0
| 7
| 29
| 33
| 18
| 15
| null | null |
Gurrt/software-testing
|
week-3/Lab3.hs
|
mit
|
-- Test if the given formula is a conjunction of clauses.
isConjOfClauses :: Form -> Bool
isConjOfClauses (Cnj fs) = all isClause fs
| 132
|
isConjOfClauses :: Form -> Bool
isConjOfClauses (Cnj fs) = all isClause fs
| 74
|
isConjOfClauses (Cnj fs) = all isClause fs
| 42
| true
| true
| 0
| 9
| 22
| 35
| 16
| 19
| null | null |
matthew-eads/agpl
|
Agpl_lib.hs
|
isc
|
iToC :: Int -> Int -> Int-> (Int, Int)
iToC rows cols i = if cols > rows then
let c = if (i `mod` cols) == 0 then cols else (i `mod` cols)
r = ceiling ((realToFrac (i-c)) / (realToFrac cols))
r2 = if r == 0 then 1 else r+1
in (r2, c)
else
let c = if (i `mod` cols) == 0 then cols else (i `mod` cols)
r = ceiling ((realToFrac (i-c)) / (realToFrac cols))
r2 = if r == 0 then 1 else r+1
in (r2, c)
| 616
|
iToC :: Int -> Int -> Int-> (Int, Int)
iToC rows cols i = if cols > rows then
let c = if (i `mod` cols) == 0 then cols else (i `mod` cols)
r = ceiling ((realToFrac (i-c)) / (realToFrac cols))
r2 = if r == 0 then 1 else r+1
in (r2, c)
else
let c = if (i `mod` cols) == 0 then cols else (i `mod` cols)
r = ceiling ((realToFrac (i-c)) / (realToFrac cols))
r2 = if r == 0 then 1 else r+1
in (r2, c)
| 616
|
iToC rows cols i = if cols > rows then
let c = if (i `mod` cols) == 0 then cols else (i `mod` cols)
r = ceiling ((realToFrac (i-c)) / (realToFrac cols))
r2 = if r == 0 then 1 else r+1
in (r2, c)
else
let c = if (i `mod` cols) == 0 then cols else (i `mod` cols)
r = ceiling ((realToFrac (i-c)) / (realToFrac cols))
r2 = if r == 0 then 1 else r+1
in (r2, c)
| 577
| false
| true
| 0
| 16
| 313
| 258
| 143
| 115
| null | null |
fffej/HS-Poker
|
LookupPatternMatch.hs
|
bsd-3-clause
|
getValueFromProduct 2471045 = 2641
| 34
|
getValueFromProduct 2471045 = 2641
| 34
|
getValueFromProduct 2471045 = 2641
| 34
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
wstrinz/school-of-haskell
|
cis194/homework-1/src/HW1/TowersOfHanoi.hs
|
mit
|
hanoi :: Integer -> Peg -> Peg -> Peg -> [Move]
hanoi = undefined
| 65
|
hanoi :: Integer -> Peg -> Peg -> Peg -> [Move]
hanoi = undefined
| 65
|
hanoi = undefined
| 17
| false
| true
| 0
| 9
| 13
| 30
| 16
| 14
| null | null |
kadena-io/pact
|
src/Pact/Compile.hs
|
bsd-3-clause
|
topLevel :: Compile (Term Name)
topLevel = specialFormOrApp topLevelForm <|> literals <|> varAtom where
topLevelForm r = case r of
RUse -> return useForm
RLet -> return letForm
RLetStar -> return letsForm
RModule -> return moduleForm
RInterface -> return interface
_ -> expected "top-level form (use, let[*], module, interface)"
| 355
|
topLevel :: Compile (Term Name)
topLevel = specialFormOrApp topLevelForm <|> literals <|> varAtom where
topLevelForm r = case r of
RUse -> return useForm
RLet -> return letForm
RLetStar -> return letsForm
RModule -> return moduleForm
RInterface -> return interface
_ -> expected "top-level form (use, let[*], module, interface)"
| 355
|
topLevel = specialFormOrApp topLevelForm <|> literals <|> varAtom where
topLevelForm r = case r of
RUse -> return useForm
RLet -> return letForm
RLetStar -> return letsForm
RModule -> return moduleForm
RInterface -> return interface
_ -> expected "top-level form (use, let[*], module, interface)"
| 323
| false
| true
| 0
| 8
| 75
| 98
| 46
| 52
| null | null |
mightymoose/liquidhaskell
|
benchmarks/bytestring-0.9.2.1/Data/ByteString/Unsafe.hs
|
bsd-3-clause
|
-- | /O(1) construction/ Use a @ByteString@ with a function requiring a
-- @CStringLen@.
--
-- This function does zero copying, and merely unwraps a @ByteString@ to
-- appear as a @CStringLen@. It is /unsafe/:
--
-- * After calling this function the @CStringLen@ shares the underlying
-- byte buffer with the original @ByteString@. Thus modifying the
-- @CStringLen@, either in C, or using poke, will cause the contents of the
-- @ByteString@ to change, breaking referential transparency. Other
-- @ByteStrings@ created by sharing (such as those produced via 'take'
-- or 'drop') will also reflect these changes. Modifying the @CStringLen@
-- will break referential transparency. To avoid this, use
-- @useAsCStringLen@, which makes a copy of the original @ByteString@.
--
{-@ unsafeUseAsCStringLen :: b:ByteString -> ((CStringLenN (bLength b)) -> IO a) -> IO a @-}
unsafeUseAsCStringLen :: ByteString -> (CStringLen -> IO a) -> IO a
unsafeUseAsCStringLen (PS ps s l) f = withForeignPtr ps $ \p -> f (castPtr p `plusPtr` s,l)
| 1,028
|
unsafeUseAsCStringLen :: ByteString -> (CStringLen -> IO a) -> IO a
unsafeUseAsCStringLen (PS ps s l) f = withForeignPtr ps $ \p -> f (castPtr p `plusPtr` s,l)
| 159
|
unsafeUseAsCStringLen (PS ps s l) f = withForeignPtr ps $ \p -> f (castPtr p `plusPtr` s,l)
| 91
| true
| true
| 0
| 10
| 166
| 93
| 55
| 38
| null | null |
travitch/hbgl-experimental
|
src/Data/Graph/Algorithms/Dominators.hs
|
bsd-3-clause
|
idomWork :: (DecomposableGraph gr, VertexListGraph gr, BidirectionalAdjacencyGraph gr)
=> gr -> Vertex -> Maybe (IDom, ToNode, FromNode)
idomWork g root
| null trees = Nothing
| otherwise = Just (doms, toNode, fromNode)
where
trees@(~[tree]) = dff [root] g
(s, ntree) = numberTree 0 tree
idom0 = array (1, s-1) (treeEdges ntree)
fromNode = M.unionWith const (M.fromList (zip (T.flatten tree) (T.flatten ntree))) (M.fromList (zip (vertices g) (repeat (-1))))
toNode = array (0, s-1) (zip (T.flatten ntree) (T.flatten tree))
preds = array (1, s-1) [(i, filter (/= -1) (map (fromNode M.!) (pre g (toNode ! i)))) | i <- [1..s-1]]
doms = fixEq (refineIDom preds) idom0
| 709
|
idomWork :: (DecomposableGraph gr, VertexListGraph gr, BidirectionalAdjacencyGraph gr)
=> gr -> Vertex -> Maybe (IDom, ToNode, FromNode)
idomWork g root
| null trees = Nothing
| otherwise = Just (doms, toNode, fromNode)
where
trees@(~[tree]) = dff [root] g
(s, ntree) = numberTree 0 tree
idom0 = array (1, s-1) (treeEdges ntree)
fromNode = M.unionWith const (M.fromList (zip (T.flatten tree) (T.flatten ntree))) (M.fromList (zip (vertices g) (repeat (-1))))
toNode = array (0, s-1) (zip (T.flatten ntree) (T.flatten tree))
preds = array (1, s-1) [(i, filter (/= -1) (map (fromNode M.!) (pre g (toNode ! i)))) | i <- [1..s-1]]
doms = fixEq (refineIDom preds) idom0
| 709
|
idomWork g root
| null trees = Nothing
| otherwise = Just (doms, toNode, fromNode)
where
trees@(~[tree]) = dff [root] g
(s, ntree) = numberTree 0 tree
idom0 = array (1, s-1) (treeEdges ntree)
fromNode = M.unionWith const (M.fromList (zip (T.flatten tree) (T.flatten ntree))) (M.fromList (zip (vertices g) (repeat (-1))))
toNode = array (0, s-1) (zip (T.flatten ntree) (T.flatten tree))
preds = array (1, s-1) [(i, filter (/= -1) (map (fromNode M.!) (pre g (toNode ! i)))) | i <- [1..s-1]]
doms = fixEq (refineIDom preds) idom0
| 560
| false
| true
| 7
| 13
| 149
| 415
| 203
| 212
| null | null |
snoyberg/ghc
|
compiler/cmm/CmmUtils.hs
|
bsd-3-clause
|
cmmNegate dflags e = CmmMachOp (MO_S_Neg (cmmExprWidth dflags e)) [e]
| 91
|
cmmNegate dflags e = CmmMachOp (MO_S_Neg (cmmExprWidth dflags e)) [e]
| 91
|
cmmNegate dflags e = CmmMachOp (MO_S_Neg (cmmExprWidth dflags e)) [e]
| 91
| false
| false
| 0
| 9
| 31
| 33
| 16
| 17
| null | null |
jgoerzen/missingpy
|
testsrc/Testutil.hs
|
gpl-2.0
|
mapassertEqual :: (Show b, Eq b) => String -> (a -> b) -> [(a, b)] -> [Test]
mapassertEqual descrip func [] = []
| 112
|
mapassertEqual :: (Show b, Eq b) => String -> (a -> b) -> [(a, b)] -> [Test]
mapassertEqual descrip func [] = []
| 112
|
mapassertEqual descrip func [] = []
| 35
| false
| true
| 0
| 10
| 22
| 68
| 37
| 31
| null | null |
atzedijkstra/blog-server
|
src/Site.hs
|
bsd-3-clause
|
handleLoginSubmit :: Handler App (AuthManager App) ()
handleLoginSubmit =
loginUser "login" "password" Nothing
(\_ -> handleLogin err) defaultHandler
where
err = Just "Unknown user or password"
------------------------------------------------------------------------------
-- | Logs out and redirects the user to the site index.
| 354
|
handleLoginSubmit :: Handler App (AuthManager App) ()
handleLoginSubmit =
loginUser "login" "password" Nothing
(\_ -> handleLogin err) defaultHandler
where
err = Just "Unknown user or password"
------------------------------------------------------------------------------
-- | Logs out and redirects the user to the site index.
| 354
|
handleLoginSubmit =
loginUser "login" "password" Nothing
(\_ -> handleLogin err) defaultHandler
where
err = Just "Unknown user or password"
------------------------------------------------------------------------------
-- | Logs out and redirects the user to the site index.
| 300
| false
| true
| 0
| 8
| 64
| 61
| 31
| 30
| null | null |
d0kt0r0/Tidal
|
src/Sound/Tidal/old/Transition.hs
|
gpl-3.0
|
wait t now (p:_) = playWhen (>= (nextSam (now+t-1))) p
| 54
|
wait t now (p:_) = playWhen (>= (nextSam (now+t-1))) p
| 54
|
wait t now (p:_) = playWhen (>= (nextSam (now+t-1))) p
| 54
| false
| false
| 0
| 11
| 9
| 49
| 24
| 25
| null | null |
david-caro/shellcheck
|
ShellCheck/Analytics.hs
|
gpl-3.0
|
checkDivBeforeMult _ _ = return ()
| 34
|
checkDivBeforeMult _ _ = return ()
| 34
|
checkDivBeforeMult _ _ = return ()
| 34
| false
| false
| 0
| 6
| 5
| 16
| 7
| 9
| null | null |
robstewart57/ripl
|
src/AstMappings.hs
|
bsd-3-clause
|
idFromStmt (R.StmtAssignDecrVar ident exp) =
Just ident
: map Just (idsFromExp exp)
| 87
|
idFromStmt (R.StmtAssignDecrVar ident exp) =
Just ident
: map Just (idsFromExp exp)
| 87
|
idFromStmt (R.StmtAssignDecrVar ident exp) =
Just ident
: map Just (idsFromExp exp)
| 87
| false
| false
| 2
| 7
| 15
| 40
| 17
| 23
| null | null |
xcv-/LCC
|
lib/Language/LCC/TypeChecker.hs
|
gpl-3.0
|
foldInfer :: ExprTypeM ret m => SigReturnGetter m -> TypeFolder m
foldInfer getSigReturn known =
foldl' (liftM2 (<|>)) (return known) . map exprType'
where
exprType' = exprType (foldInfer getSigReturn) getSigReturn
| 224
|
foldInfer :: ExprTypeM ret m => SigReturnGetter m -> TypeFolder m
foldInfer getSigReturn known =
foldl' (liftM2 (<|>)) (return known) . map exprType'
where
exprType' = exprType (foldInfer getSigReturn) getSigReturn
| 224
|
foldInfer getSigReturn known =
foldl' (liftM2 (<|>)) (return known) . map exprType'
where
exprType' = exprType (foldInfer getSigReturn) getSigReturn
| 158
| false
| true
| 0
| 8
| 39
| 80
| 38
| 42
| null | null |
HJvT/hdirect
|
src/Parser.hs
|
bsd-3-clause
|
action_493 (38#) = happyGoto action_268
| 39
|
action_493 (38#) = happyGoto action_268
| 39
|
action_493 (38#) = happyGoto action_268
| 39
| false
| false
| 0
| 6
| 4
| 15
| 7
| 8
| null | null |
ocharles/virtual-dom
|
src/VirtualDom/HTML.hs
|
bsd-3-clause
|
source_ :: (Term arg result) => arg -> result
source_ = term "source"
| 69
|
source_ :: (Term arg result) => arg -> result
source_ = term "source"
| 69
|
source_ = term "source"
| 23
| false
| true
| 0
| 8
| 12
| 36
| 16
| 20
| null | null |
kmate/HaRe
|
old/tools/base/AST/HasBaseStruct.hs
|
bsd-3-clause
|
hsPIrrPat p = base $ HsPIrrPat p
| 48
|
hsPIrrPat p = base $ HsPIrrPat p
| 48
|
hsPIrrPat p = base $ HsPIrrPat p
| 48
| false
| false
| 0
| 6
| 22
| 16
| 7
| 9
| null | null |
text-utf8/text
|
benchmarks/haskell/Benchmarks/WordFrequencies.hs
|
bsd-2-clause
|
frequencies :: Ord a => [a] -> Map a Int
frequencies = foldl' (\m k -> M.insertWith (+) k 1 m) M.empty
| 102
|
frequencies :: Ord a => [a] -> Map a Int
frequencies = foldl' (\m k -> M.insertWith (+) k 1 m) M.empty
| 102
|
frequencies = foldl' (\m k -> M.insertWith (+) k 1 m) M.empty
| 61
| false
| true
| 0
| 9
| 21
| 66
| 32
| 34
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.