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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DominikDitoIvosevic/Uni | IRG/src/Irg/Lab1/Geometry/Shapes.hs | mit | myTrace :: Show a => a -> a
myTrace x = if False then traceShowId x else x | 74 | myTrace :: Show a => a -> a
myTrace x = if False then traceShowId x else x | 74 | myTrace x = if False then traceShowId x else x | 46 | false | true | 0 | 6 | 17 | 36 | 18 | 18 | null | null |
Noeda/Megaman | src/NetHack/Data/Level.hs | mit | maybeMarkAsOpenDoor :: Level -> T.Terminal -> Coords -> Level
maybeMarkAsOpenDoor level term coords
| featureAt level coords /= Just ClosedDoor = level
| featureByCh char attributes /= [] = level
| otherwise =
updateElement level coords
(\elem -> setFeature ... | 433 | maybeMarkAsOpenDoor :: Level -> T.Terminal -> Coords -> Level
maybeMarkAsOpenDoor level term coords
| featureAt level coords /= Just ClosedDoor = level
| featureByCh char attributes /= [] = level
| otherwise =
updateElement level coords
(\elem -> setFeature ... | 433 | maybeMarkAsOpenDoor level term coords
| featureAt level coords /= Just ClosedDoor = level
| featureByCh char attributes /= [] = level
| otherwise =
updateElement level coords
(\elem -> setFeature elem (Just OpenedDoor))
where
char = head $ T.strAt coor... | 371 | false | true | 1 | 10 | 126 | 136 | 65 | 71 | null | null |
andygill/er-systemf | Language/SystemF/Parser.hs | bsd-3-clause | parseContextName :: Parser String
parseContextName = lexeme $ primParseContextName | 82 | parseContextName :: Parser String
parseContextName = lexeme $ primParseContextName | 82 | parseContextName = lexeme $ primParseContextName | 48 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
brendanhay/gogol | gogol-cloudsearch/gen/Network/Google/CloudSearch/Types/Product.hs | mpl-2.0 | -- | Can this operator be used to get facets.
qoIsFacetable :: Lens' QueryOperator (Maybe Bool)
qoIsFacetable
= lens _qoIsFacetable
(\ s a -> s{_qoIsFacetable = a}) | 172 | qoIsFacetable :: Lens' QueryOperator (Maybe Bool)
qoIsFacetable
= lens _qoIsFacetable
(\ s a -> s{_qoIsFacetable = a}) | 126 | qoIsFacetable
= lens _qoIsFacetable
(\ s a -> s{_qoIsFacetable = a}) | 76 | true | true | 1 | 9 | 34 | 52 | 25 | 27 | null | null |
cchalmers/geometry | src/Geometry/TwoD/Curvature.hs | bsd-3-clause | -- Package up problematic values with the appropriate infinity.
toPosInf :: RealFloat a => V2 a -> PosInf a
toPosInf (V2 _ 0) = Infinity | 136 | toPosInf :: RealFloat a => V2 a -> PosInf a
toPosInf (V2 _ 0) = Infinity | 72 | toPosInf (V2 _ 0) = Infinity | 28 | true | true | 0 | 10 | 24 | 45 | 20 | 25 | null | null |
mdsteele/fallback | src/Fallback/Test/Pathfind.hs | gpl-3.0 | -------------------------------------------------------------------------------
pathfindTest :: Int -> String -> Test
pathfindTest limit terrain =
let strings = lines terrain
width = length (head strings)
height = length strings
arr = listArray ((0, 0), (width - 1, height - 1)) $ concat $
... | 1,347 | pathfindTest :: Int -> String -> Test
pathfindTest limit terrain =
let strings = lines terrain
width = length (head strings)
height = length strings
arr = listArray ((0, 0), (width - 1, height - 1)) $ concat $
transpose strings
get (Point x y) = arr ! (x, y)
allPoints = range... | 1,266 | pathfindTest limit terrain =
let strings = lines terrain
width = length (head strings)
height = length strings
arr = listArray ((0, 0), (width - 1, height - 1)) $ concat $
transpose strings
get (Point x y) = arr ! (x, y)
allPoints = range (Point 0 0, Point (width - 1) (height... | 1,228 | true | true | 5 | 13 | 462 | 463 | 248 | 215 | null | null |
mumuki/mumuki-hspec-server | src/Server/Test/TestRunner.hs | mit | toTestResults :: [Maybe (String, String, String)] -> TestResults
toTestResults = map (toTestResult.fromJust) . filter isJust | 124 | toTestResults :: [Maybe (String, String, String)] -> TestResults
toTestResults = map (toTestResult.fromJust) . filter isJust | 124 | toTestResults = map (toTestResult.fromJust) . filter isJust | 59 | false | true | 0 | 9 | 14 | 51 | 25 | 26 | null | null |
ddssff/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | circ :: Char -> String
circ 'A' = "Â" | 37 | circ :: Char -> String
circ 'A' = "Â" | 37 | circ 'A' = "Â" | 14 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
juodaspaulius/bclafer_old | src/Language/Clafer/Front/LayoutResolver.hs | mit | readC n = if n > 0 then getc else return '\n' | 45 | readC n = if n > 0 then getc else return '\n' | 45 | readC n = if n > 0 then getc else return '\n' | 45 | false | false | 0 | 6 | 11 | 24 | 12 | 12 | null | null |
ozgurakgun/cmdargs | System/Console/CmdArgs/Test/Implicit/Tests.hs | bsd-3-clause | test10 = do
let Tester{..} = tester "Test10" mode10
isHelp ["-?=one"] [" -f --food=INT"]
isHelpNot ["-?=one"] [" -b --bard=INT"]
-- test for GHC over-optimising | 175 | test10 = do
let Tester{..} = tester "Test10" mode10
isHelp ["-?=one"] [" -f --food=INT"]
isHelpNot ["-?=one"] [" -b --bard=INT"]
-- test for GHC over-optimising | 175 | test10 = do
let Tester{..} = tester "Test10" mode10
isHelp ["-?=one"] [" -f --food=INT"]
isHelpNot ["-?=one"] [" -b --bard=INT"]
-- test for GHC over-optimising | 175 | false | false | 0 | 11 | 38 | 56 | 27 | 29 | null | null |
snapframework/snap-core | test/Snap/Internal/Routing/Tests.hs | bsd-3-clause | testRouting6 :: Test
testRouting6 = testCase "route/6" $ do
r5 <- go routes "foo/bar/sproing"
assertEqual "/foo/bar/sproing" "fooBar" r5
------------------------------------------------------------------------------ | 225 | testRouting6 :: Test
testRouting6 = testCase "route/6" $ do
r5 <- go routes "foo/bar/sproing"
assertEqual "/foo/bar/sproing" "fooBar" r5
------------------------------------------------------------------------------ | 225 | testRouting6 = testCase "route/6" $ do
r5 <- go routes "foo/bar/sproing"
assertEqual "/foo/bar/sproing" "fooBar" r5
------------------------------------------------------------------------------ | 204 | false | true | 0 | 9 | 28 | 41 | 19 | 22 | null | null |
apunktbau/co4 | test/CO4/Thesis/WCB_MatrixStandalone.hs | gpl-3.0 | tail' :: List a -> List a
tail' xs = case xs of
Nill -> Nill
Conss y ys -> ys | 81 | tail' :: List a -> List a
tail' xs = case xs of
Nill -> Nill
Conss y ys -> ys | 81 | tail' xs = case xs of
Nill -> Nill
Conss y ys -> ys | 55 | false | true | 0 | 8 | 24 | 49 | 22 | 27 | null | null |
GaloisInc/saw-script | heapster-saw/src/Verifier/SAW/Heapster/archival/Permissions.hs | bsd-3-clause | remLLVMFieldAt off (LLVMFieldShapePerm (LLVMFieldPerm off' spl p) : shapes)
| off' == off = Just (spl, p, shapes) | 115 | remLLVMFieldAt off (LLVMFieldShapePerm (LLVMFieldPerm off' spl p) : shapes)
| off' == off = Just (spl, p, shapes) | 115 | remLLVMFieldAt off (LLVMFieldShapePerm (LLVMFieldPerm off' spl p) : shapes)
| off' == off = Just (spl, p, shapes) | 115 | false | false | 0 | 10 | 19 | 53 | 26 | 27 | null | null |
prt2121/haskell-practice | parconc/distrib-db/DatabaseSample.hs | apache-2.0 | loop :: [[ProcessId]] -> Int -> Process ()
loop worker_pairs n_slices
= receiveWait
[ match $ \req -> handleRequest req >> loop worker_pairs n_slices
, match $ \(ProcessMonitorNotification _ pid reason) -> do
say (printf "process %s died: %s" (show pid) (show reason))
loop (map ... | 665 | loop :: [[ProcessId]] -> Int -> Process ()
loop worker_pairs n_slices
= receiveWait
[ match $ \req -> handleRequest req >> loop worker_pairs n_slices
, match $ \(ProcessMonitorNotification _ pid reason) -> do
say (printf "process %s died: %s" (show pid) (show reason))
loop (map ... | 665 | loop worker_pairs n_slices
= receiveWait
[ match $ \req -> handleRequest req >> loop worker_pairs n_slices
, match $ \(ProcessMonitorNotification _ pid reason) -> do
say (printf "process %s died: %s" (show pid) (show reason))
loop (map (filter (/= pid)) worker_pairs) n_slices
... | 622 | false | true | 0 | 16 | 185 | 265 | 133 | 132 | null | null |
urbanslug/nairobi-bot | tests/Bot/EchoSpec.hs | gpl-3.0 | echoBotProperties :: Spec
echoBotProperties = do
describe "Echo property tests" $ do
it "Echobot just echoes what it receives but escapes unsafe chars" $ do
--property $ forAll (arbitrary :: Gen String) propEcho
pendingWith "Fix propEcho" | 256 | echoBotProperties :: Spec
echoBotProperties = do
describe "Echo property tests" $ do
it "Echobot just echoes what it receives but escapes unsafe chars" $ do
--property $ forAll (arbitrary :: Gen String) propEcho
pendingWith "Fix propEcho" | 256 | echoBotProperties = do
describe "Echo property tests" $ do
it "Echobot just echoes what it receives but escapes unsafe chars" $ do
--property $ forAll (arbitrary :: Gen String) propEcho
pendingWith "Fix propEcho" | 230 | false | true | 0 | 13 | 53 | 38 | 17 | 21 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/enumFromThenTo_6.hs | mit | toEnum4 wx wy = toEnum3 wy | 26 | toEnum4 wx wy = toEnum3 wy | 26 | toEnum4 wx wy = toEnum3 wy | 26 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
alphaHeavy/quickfix-hs | src/AlphaHeavy/QuickFIX.hs | bsd-3-clause | sourceQuickFIX
:: (Generic a, GRecvMessage (Rep a), MonadIO m)
=> ConduitApp
-> Source m a
sourceQuickFIX ConduitApp{conduitAppRecv, conduitAppStatus} = step where
step = do
mval <- liftIO . atomically $ do
mval <- Right <$> takeTMVar conduitAppRecv <|> Left <$> readTVar conduitAppStatus
case mv... | 1,109 | sourceQuickFIX
:: (Generic a, GRecvMessage (Rep a), MonadIO m)
=> ConduitApp
-> Source m a
sourceQuickFIX ConduitApp{conduitAppRecv, conduitAppStatus} = step where
step = do
mval <- liftIO . atomically $ do
mval <- Right <$> takeTMVar conduitAppRecv <|> Left <$> readTVar conduitAppStatus
case mv... | 1,109 | sourceQuickFIX ConduitApp{conduitAppRecv, conduitAppStatus} = step where
step = do
mval <- liftIO . atomically $ do
mval <- Right <$> takeTMVar conduitAppRecv <|> Left <$> readTVar conduitAppStatus
case mval of
Left EngineRunning -> retry
_ -> return mval
case mval of
Right ... | 1,012 | false | true | 4 | 22 | 322 | 284 | 134 | 150 | null | null |
brendanhay/gogol | gogol-dlp/gen/Network/Google/Resource/DLP/Projects/JobTriggers/List.hs | mpl-2.0 | -- | V1 error format.
pjtlXgafv :: Lens' ProjectsJobTriggersList (Maybe Xgafv)
pjtlXgafv
= lens _pjtlXgafv (\ s a -> s{_pjtlXgafv = a}) | 137 | pjtlXgafv :: Lens' ProjectsJobTriggersList (Maybe Xgafv)
pjtlXgafv
= lens _pjtlXgafv (\ s a -> s{_pjtlXgafv = a}) | 115 | pjtlXgafv
= lens _pjtlXgafv (\ s a -> s{_pjtlXgafv = a}) | 58 | true | true | 0 | 9 | 23 | 48 | 25 | 23 | null | null |
haskellbr/missingh | missingh-all/src/System/Path/WildMatch.hs | mit | convpat :: String -> String
convpat ('\\':xs) = "\\\\" ++ convpat xs | 68 | convpat :: String -> String
convpat ('\\':xs) = "\\\\" ++ convpat xs | 68 | convpat ('\\':xs) = "\\\\" ++ convpat xs | 40 | false | true | 2 | 9 | 11 | 38 | 17 | 21 | null | null |
bergmark/clay | src/Clay/Text.hs | bsd-3-clause | preLine = WhiteSpace "pre-line" | 31 | preLine = WhiteSpace "pre-line" | 31 | preLine = WhiteSpace "pre-line" | 31 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
daewon/til | exercism/haskell/raindrops/src/Raindrops.hs | mpl-2.0 | toRainStr :: Int -> String
toRainStr 3 = "Pling" | 48 | toRainStr :: Int -> String
toRainStr 3 = "Pling" | 48 | toRainStr 3 = "Pling" | 21 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
mightymoose/liquidhaskell | benchmarks/base-4.5.1.0/Foreign/C/Error.hs | bsd-3-clause | throwErrnoIf_ :: (a -> Bool) -> String -> IO a -> IO ()
throwErrnoIf_ pred loc f = void $ throwErrnoIf pred loc f | 116 | throwErrnoIf_ :: (a -> Bool) -> String -> IO a -> IO ()
throwErrnoIf_ pred loc f = void $ throwErrnoIf pred loc f | 116 | throwErrnoIf_ pred loc f = void $ throwErrnoIf pred loc f | 58 | false | true | 0 | 9 | 26 | 56 | 27 | 29 | null | null |
ctford/Idris-Elba-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | getConsts :: [PArg] -> [PTerm]
getConsts [] = [] | 48 | getConsts :: [PArg] -> [PTerm]
getConsts [] = [] | 48 | getConsts [] = [] | 17 | false | true | 0 | 6 | 8 | 28 | 15 | 13 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Seq/MyersStack.hs | mit | fold = foldr | 13 | fold = foldr | 13 | fold = foldr | 13 | false | false | 0 | 4 | 3 | 6 | 3 | 3 | null | null |
Rydgel/advent-of-code | src/Day6.hs | bsd-3-clause | instruction :: Parser Instruction
instruction = action <*> (char ' ' *> range) | 78 | instruction :: Parser Instruction
instruction = action <*> (char ' ' *> range) | 78 | instruction = action <*> (char ' ' *> range) | 44 | false | true | 0 | 8 | 12 | 28 | 14 | 14 | null | null |
ytakano/tsukuyomi | validator/lunar_lisp/lunar_lisp_parser.hs | bsd-3-clause | -- op ::= '+' | '/' | '~' | '!' | '@' | '#' | '$' | '%' | ':' | '?'
-- '^' | '*' | '-' | '=' | '_' | '<' | '>' | '|' | '&'
parseOp :: Parsec.Parsec String () Char
parseOp = Parsec.oneOf "+/~!@#$%:?^*-=_<>|&" | 224 | parseOp :: Parsec.Parsec String () Char
parseOp = Parsec.oneOf "+/~!@#$%:?^*-=_<>|&" | 84 | parseOp = Parsec.oneOf "+/~!@#$%:?^*-=_<>|&" | 44 | true | true | 0 | 6 | 66 | 29 | 15 | 14 | null | null |
hvr/jhc | src/FrontEnd/KindInfer.hs | mit | hsAsstToPred' _ kt (HsAsstEq t1 t2) = IsEq (runIdentity $ hsTypeToType' kt t1) (runIdentity $ hsTypeToType' kt t2) | 114 | hsAsstToPred' _ kt (HsAsstEq t1 t2) = IsEq (runIdentity $ hsTypeToType' kt t1) (runIdentity $ hsTypeToType' kt t2) | 114 | hsAsstToPred' _ kt (HsAsstEq t1 t2) = IsEq (runIdentity $ hsTypeToType' kt t1) (runIdentity $ hsTypeToType' kt t2) | 114 | false | false | 1 | 8 | 17 | 52 | 24 | 28 | null | null |
pparkkin/eta | compiler/ETA/Main/DynFlags.hs | bsd-3-clause | -- See Note [Supporting CLI completion]
package_flags :: [Flag (CmdLineP DynFlags)]
package_flags = [
------- Packages ----------------------------------------------------
defFlag "package-db" (HasArg (addPkgConfRef . PkgConfFile))
, defFlag "clear-package-db" (NoArg clearPkgConf)
, defF... | 2,183 | package_flags :: [Flag (CmdLineP DynFlags)]
package_flags = [
------- Packages ----------------------------------------------------
defFlag "package-db" (HasArg (addPkgConfRef . PkgConfFile))
, defFlag "clear-package-db" (NoArg clearPkgConf)
, defFlag "no-global-package-db" (NoArg remov... | 2,143 | package_flags = [
------- Packages ----------------------------------------------------
defFlag "package-db" (HasArg (addPkgConfRef . PkgConfFile))
, defFlag "clear-package-db" (NoArg clearPkgConf)
, defFlag "no-global-package-db" (NoArg removeGlobalPkgConf)
, defFlag "no-user-package... | 2,099 | true | true | 0 | 14 | 628 | 461 | 231 | 230 | null | null |
a143753/AOJ | 0087.hs | apache-2.0 | op :: (Double -> Double -> Double) -> [String] -> [String]
op e (s0:s1:ss) =
let s0' = read s0 :: Double
s1' = read s1 :: Double
re = e s1' s0'
r' = show re
in
r':ss | 193 | op :: (Double -> Double -> Double) -> [String] -> [String]
op e (s0:s1:ss) =
let s0' = read s0 :: Double
s1' = read s1 :: Double
re = e s1' s0'
r' = show re
in
r':ss | 193 | op e (s0:s1:ss) =
let s0' = read s0 :: Double
s1' = read s1 :: Double
re = e s1' s0'
r' = show re
in
r':ss | 134 | false | true | 2 | 9 | 66 | 109 | 54 | 55 | null | null |
lambdacms/lambdacms.org | lambdacmsorg-tutorial/LambdaCmsOrg/Tutorial/Foundation.hs | mit | defaultTutorialAdminMenu :: LambdaCmsOrgTutorial master => (Route TutorialAdmin -> Route master) -> [AdminMenuItem master]
defaultTutorialAdminMenu tp = [ MenuItem (SomeMessage Msg.MenuTutorial) (tp TutorialAdminIndexR) "book" ] | 228 | defaultTutorialAdminMenu :: LambdaCmsOrgTutorial master => (Route TutorialAdmin -> Route master) -> [AdminMenuItem master]
defaultTutorialAdminMenu tp = [ MenuItem (SomeMessage Msg.MenuTutorial) (tp TutorialAdminIndexR) "book" ] | 228 | defaultTutorialAdminMenu tp = [ MenuItem (SomeMessage Msg.MenuTutorial) (tp TutorialAdminIndexR) "book" ] | 105 | false | true | 0 | 9 | 23 | 68 | 33 | 35 | null | null |
rsasse/tamarin-prover | lib/theory/src/Theory/Text/Parser/Token.hs | gpl-3.0 | -- | Parse a graph node variable.
nodevar :: Parser NodeId
nodevar = asum
[ sortedLVar [LSortNode]
, (\(n, i) -> LVar n LSortNode i) <$> indexedIdentifier ]
<?> "timepoint variable" | 187 | nodevar :: Parser NodeId
nodevar = asum
[ sortedLVar [LSortNode]
, (\(n, i) -> LVar n LSortNode i) <$> indexedIdentifier ]
<?> "timepoint variable" | 153 | nodevar = asum
[ sortedLVar [LSortNode]
, (\(n, i) -> LVar n LSortNode i) <$> indexedIdentifier ]
<?> "timepoint variable" | 128 | true | true | 2 | 9 | 36 | 61 | 32 | 29 | null | null |
sgillespie/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | callishOp _ = Nothing | 21 | callishOp _ = Nothing | 21 | callishOp _ = Nothing | 21 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
armoredsoftware/protocol | tpm/mainline/protoMonad/ProtoActions.hs | bsd-3-clause | --mconcat bslist
--where bslist = map tobs as
--Concrete unpacking implementation
unpackImpl :: Binary a => ByteString -> [a]
unpackImpl bs = decode bs | 153 | unpackImpl :: Binary a => ByteString -> [a]
unpackImpl bs = decode bs | 69 | unpackImpl bs = decode bs | 25 | true | true | 0 | 9 | 25 | 40 | 19 | 21 | null | null |
antalsz/hs-to-coq | src/lib/HsToCoq/ConvertHaskell/Type.hs | mit | convertType (HsDocTy NOEXTP ty _doc) =
convertLType ty | 56 | convertType (HsDocTy NOEXTP ty _doc) =
convertLType ty | 56 | convertType (HsDocTy NOEXTP ty _doc) =
convertLType ty | 56 | false | false | 0 | 7 | 9 | 22 | 10 | 12 | null | null |
afiskon/simple-neural-networks | src/MainXorLogistic.hs | bsd-2-clause | calcXor net x y =
let [r] = runNeuralNetwork net [x, y]
in r | 69 | calcXor net x y =
let [r] = runNeuralNetwork net [x, y]
in r | 69 | calcXor net x y =
let [r] = runNeuralNetwork net [x, y]
in r | 69 | false | false | 0 | 10 | 22 | 39 | 19 | 20 | null | null |
ony/Yampa-core | tests/AFRPTestsLaws.hs | bsd-3-clause | laws_t5_lhs :: [(Double, Double)]
laws_t5_lhs = testSF1 (arr dup >>> (first (integral >>> arr (+3.0)))) | 103 | laws_t5_lhs :: [(Double, Double)]
laws_t5_lhs = testSF1 (arr dup >>> (first (integral >>> arr (+3.0)))) | 103 | laws_t5_lhs = testSF1 (arr dup >>> (first (integral >>> arr (+3.0)))) | 69 | false | true | 0 | 13 | 14 | 53 | 29 | 24 | null | null |
ice1000/Kt2Dart | src/Statements.hs | agpl-3.0 | --
declarationP :: Parser String
declarationP = functionP
<|> propertyP
<|> classP
<|> typeAliasP
<|> objectP | 118 | declarationP :: Parser String
declarationP = functionP
<|> propertyP
<|> classP
<|> typeAliasP
<|> objectP | 114 | declarationP = functionP
<|> propertyP
<|> classP
<|> typeAliasP
<|> objectP | 84 | true | true | 12 | 5 | 24 | 44 | 24 | 20 | null | null |
GaloisInc/halvm-ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | -- | The number of argument expressions that are values rather than types at their top level
valArgCount :: [Arg b] -> Int
valArgCount = count isValArg | 151 | valArgCount :: [Arg b] -> Int
valArgCount = count isValArg | 58 | valArgCount = count isValArg | 28 | true | true | 0 | 8 | 26 | 32 | 14 | 18 | null | null |
fcostantini/QuickFuzz | src/DeriveMArbitrary.hs | gpl-3.0 | compat tname (ConT c) = unqualify tname == unqualify c | 54 | compat tname (ConT c) = unqualify tname == unqualify c | 54 | compat tname (ConT c) = unqualify tname == unqualify c | 54 | false | false | 0 | 7 | 9 | 27 | 12 | 15 | null | null |
bens/hurtle | test-src/Main.hs | apache-2.0 | joinXs :: Int -> Hurtle s TestConn [Int]
joinXs = makeGolden $ \xm xsm ysm -> do
xs <- xsm
return $ do
x <- xm
ys <- ysm
return $ x : xs ++ ys | 175 | joinXs :: Int -> Hurtle s TestConn [Int]
joinXs = makeGolden $ \xm xsm ysm -> do
xs <- xsm
return $ do
x <- xm
ys <- ysm
return $ x : xs ++ ys | 175 | joinXs = makeGolden $ \xm xsm ysm -> do
xs <- xsm
return $ do
x <- xm
ys <- ysm
return $ x : xs ++ ys | 134 | false | true | 0 | 14 | 68 | 81 | 39 | 42 | null | null |
RossMeikleham/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v (LEq ATFloat) [l, r] = v ++ "FLOATBOP(==," ++ creg l ++ ", " ++ creg r ++ ")" | 84 | doOp v (LEq ATFloat) [l, r] = v ++ "FLOATBOP(==," ++ creg l ++ ", " ++ creg r ++ ")" | 84 | doOp v (LEq ATFloat) [l, r] = v ++ "FLOATBOP(==," ++ creg l ++ ", " ++ creg r ++ ")" | 84 | false | false | 0 | 9 | 20 | 51 | 25 | 26 | null | null |
prl-tokyo/bigul-configuration-adaptation | Transformations/src/BiFlux/Trans/Translation.hs | mit | varPat2DirectionEnv (VarT var _) dynRPat@(DynR tv' ev' RVar) = return $ Map.singleton var (DynD tv' ev' tv' DVar RVar) | 118 | varPat2DirectionEnv (VarT var _) dynRPat@(DynR tv' ev' RVar) = return $ Map.singleton var (DynD tv' ev' tv' DVar RVar) | 118 | varPat2DirectionEnv (VarT var _) dynRPat@(DynR tv' ev' RVar) = return $ Map.singleton var (DynD tv' ev' tv' DVar RVar) | 118 | false | false | 0 | 8 | 18 | 57 | 28 | 29 | null | null |
mightybyte/reflex-dom-stubs | src/GHCJS/DOM/HTMLElement.hs | bsd-3-clause | ghcjs_dom_html_element_get_webkitdropzone = undefined | 53 | ghcjs_dom_html_element_get_webkitdropzone = undefined | 53 | ghcjs_dom_html_element_get_webkitdropzone = undefined | 53 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
blamario/incremental-parser | Test/TestIncrementalParser.hs | gpl-3.0 | parser3l :: TestParser LeftBiasedLocal (String, String, String)
parser3l = undefined | 84 | parser3l :: TestParser LeftBiasedLocal (String, String, String)
parser3l = undefined | 84 | parser3l = undefined | 20 | false | true | 0 | 6 | 9 | 25 | 14 | 11 | null | null |
alexander-at-github/eta | compiler/ETA/TypeCheck/TcType.hs | bsd-3-clause | -----------------------
tcTyConAppTyCon :: Type -> TyCon
tcTyConAppTyCon ty = case tcSplitTyConApp_maybe ty of
Just (tc, _) -> tc
Nothing -> pprPanic "tcTyConAppTyCon" (pprType ty) | 233 | tcTyConAppTyCon :: Type -> TyCon
tcTyConAppTyCon ty = case tcSplitTyConApp_maybe ty of
Just (tc, _) -> tc
Nothing -> pprPanic "tcTyConAppTyCon" (pprType ty) | 209 | tcTyConAppTyCon ty = case tcSplitTyConApp_maybe ty of
Just (tc, _) -> tc
Nothing -> pprPanic "tcTyConAppTyCon" (pprType ty) | 176 | true | true | 0 | 10 | 76 | 58 | 29 | 29 | null | null |
polux/snippets | Merge.hs | apache-2.0 | lparen = symbol (char '(') | 26 | lparen = symbol (char '(') | 26 | lparen = symbol (char '(') | 26 | false | false | 1 | 7 | 4 | 19 | 7 | 12 | null | null |
phadej/streaming-commons | test/Data/Streaming/ByteString/BuilderSpec.hs | mit | testerFlush :: StreamingBuilder b
=> BufferAllocStrategy -> [Maybe b] -> IO [Maybe S.ByteString]
testerFlush strat builders0 = do
(recv, finish) <- newBuilderRecv strat
let loop front [] = do
mbs <- finish
return $ front $ maybe [] (return . Just) mbs
loop front0 (mbu... | 778 | testerFlush :: StreamingBuilder b
=> BufferAllocStrategy -> [Maybe b] -> IO [Maybe S.ByteString]
testerFlush strat builders0 = do
(recv, finish) <- newBuilderRecv strat
let loop front [] = do
mbs <- finish
return $ front $ maybe [] (return . Just) mbs
loop front0 (mbu... | 778 | testerFlush strat builders0 = do
(recv, finish) <- newBuilderRecv strat
let loop front [] = do
mbs <- finish
return $ front $ maybe [] (return . Just) mbs
loop front0 (mbu:bus) = do
popper <- recv $ fromMaybe builderFlush mbu
let go front = do
... | 669 | false | true | 0 | 24 | 364 | 253 | 120 | 133 | null | null |
suhailshergill/hakaru | Historical/Partial.hs | bsd-3-clause | toDynamic :: Partial repr a -> Maybe (repr a)
toDynamic (Partial d _) = d | 73 | toDynamic :: Partial repr a -> Maybe (repr a)
toDynamic (Partial d _) = d | 73 | toDynamic (Partial d _) = d | 27 | false | true | 0 | 8 | 14 | 40 | 19 | 21 | null | null |
lih/Alpha | src/Context/Language.hs | bsd-2-clause | createSym l@(Language { maxIDL = m }) = (m,l { maxIDL = succ m }) | 65 | createSym l@(Language { maxIDL = m }) = (m,l { maxIDL = succ m }) | 65 | createSym l@(Language { maxIDL = m }) = (m,l { maxIDL = succ m }) | 65 | false | false | 7 | 6 | 14 | 46 | 23 | 23 | null | null |
geophf/1HaskellADay | exercises/HAD/Control/Map.hs | mit | {--
for example:
to make a simple multimap from a [(k,v)]
snarf return
If we have something like:
match :: Map Name Winery -> (Neo4jIxWinery, Country) -> Maybe (Country, IxWikiWinery)
match m (neo, c) = (c,) . flip IxWiki (ix neo) <$> Map.lookup (namei neo) m
see Y2021.M01.D29.Solution
then
snarf (match . byName... | 605 | snarfL :: Ord c => (a -> Maybe (c,d)) -> [a] -> Map c [d]
snarfL f = foldr inserterL Map.empty . mapMaybe f | 107 | snarfL f = foldr inserterL Map.empty . mapMaybe f | 49 | true | true | 0 | 10 | 114 | 72 | 37 | 35 | null | null |
spechub/Hets | CASL/Sign.hs | gpl-2.0 | addSort :: SortsKind -> Annoted a -> SORT -> State.State (Sign f e) ()
addSort sk a s = do
e <- State.get
let r = sortRel e
em = emptySortSet e
known = Rel.memberKey s r
if known then addDiags [mkDiag Hint "redeclared sort" s]
else do
State.put e { sortRel = Rel.insertKey s r }
addDiag... | 794 | addSort :: SortsKind -> Annoted a -> SORT -> State.State (Sign f e) ()
addSort sk a s = do
e <- State.get
let r = sortRel e
em = emptySortSet e
known = Rel.memberKey s r
if known then addDiags [mkDiag Hint "redeclared sort" s]
else do
State.put e { sortRel = Rel.insertKey s r }
addDiag... | 794 | addSort sk a s = do
e <- State.get
let r = sortRel e
em = emptySortSet e
known = Rel.memberKey s r
if known then addDiags [mkDiag Hint "redeclared sort" s]
else do
State.put e { sortRel = Rel.insertKey s r }
addDiags $ checkNamePrefix s
case sk of
NonEmptySorts -> when (Set.membe... | 723 | false | true | 0 | 17 | 222 | 300 | 141 | 159 | null | null |
aszlig/language-javascript | src/Language/JavaScript/Parser/AST.hs | bsd-3-clause | showStrippedNode (JSLabelled x1 _c x2) = "JSLabelled (" ++ ss x1 ++ ") (" ++ ss x2 ++ ")" | 89 | showStrippedNode (JSLabelled x1 _c x2) = "JSLabelled (" ++ ss x1 ++ ") (" ++ ss x2 ++ ")" | 89 | showStrippedNode (JSLabelled x1 _c x2) = "JSLabelled (" ++ ss x1 ++ ") (" ++ ss x2 ++ ")" | 89 | false | false | 0 | 9 | 18 | 42 | 19 | 23 | null | null |
ihc/futhark | src/Futhark/Pass/ExtractKernels.hs | isc | transformStm (Let pat _ (Op (Stream w
(Parallel o comm red_fun nes) fold_fun arrs)))
| Just fold_fun' <- extLambdaToLambda fold_fun = do
-- Generate a kernel immediately.
red_fun_sequential <- Kernelise.transformLambda red_fun
fold_fun_sequential <- Kernelise.transformLambda fold_... | 542 | transformStm (Let pat _ (Op (Stream w
(Parallel o comm red_fun nes) fold_fun arrs)))
| Just fold_fun' <- extLambdaToLambda fold_fun = do
-- Generate a kernel immediately.
red_fun_sequential <- Kernelise.transformLambda red_fun
fold_fun_sequential <- Kernelise.transformLambda fold_... | 542 | transformStm (Let pat _ (Op (Stream w
(Parallel o comm red_fun nes) fold_fun arrs)))
| Just fold_fun' <- extLambdaToLambda fold_fun = do
-- Generate a kernel immediately.
red_fun_sequential <- Kernelise.transformLambda red_fun
fold_fun_sequential <- Kernelise.transformLambda fold_... | 542 | false | false | 1 | 12 | 143 | 145 | 65 | 80 | null | null |
unknownloner/calccomp | Asm/QQ.hs | mit | parseExp f s = case P.parseExp s of
Left err -> fail err
Right x -> f `appE` return x | 119 | parseExp f s = case P.parseExp s of
Left err -> fail err
Right x -> f `appE` return x | 119 | parseExp f s = case P.parseExp s of
Left err -> fail err
Right x -> f `appE` return x | 119 | false | false | 0 | 9 | 53 | 50 | 23 | 27 | null | null |
thenaesh/SoCFault | src/Config.hs | gpl-3.0 | loadConfig :: FilePath -> IO Config
loadConfig fileName = do
file <- B.readFile path
case decode file of
Nothing -> error errorMsg -- unrecoverable error, terminate the program
Just config -> return config
where
path = mconcat [basePath, "/", fileName]
basePath = "config"
... | 371 | loadConfig :: FilePath -> IO Config
loadConfig fileName = do
file <- B.readFile path
case decode file of
Nothing -> error errorMsg -- unrecoverable error, terminate the program
Just config -> return config
where
path = mconcat [basePath, "/", fileName]
basePath = "config"
... | 371 | loadConfig fileName = do
file <- B.readFile path
case decode file of
Nothing -> error errorMsg -- unrecoverable error, terminate the program
Just config -> return config
where
path = mconcat [basePath, "/", fileName]
basePath = "config"
errorMsg = "Error reading " ++ ... | 335 | false | true | 2 | 10 | 103 | 105 | 50 | 55 | null | null |
simonmichael/hledger | hledger-lib/Hledger/Read/CsvReader.hs | gpl-3.0 | tests_CsvReader = testGroup "CsvReader" [
testGroup "parseCsvRules" [
testCase "empty file" $
parseCsvRules "unknown" "" @?= Right (mkrules defrules)
]
,testGroup "rulesp" [
testCase "trailing comments" $
parseWithState' defrules rulesp "skip\n# \n#\n" @?= Right (mkrules $ defrules{rdirect... | 4,472 | tests_CsvReader = testGroup "CsvReader" [
testGroup "parseCsvRules" [
testCase "empty file" $
parseCsvRules "unknown" "" @?= Right (mkrules defrules)
]
,testGroup "rulesp" [
testCase "trailing comments" $
parseWithState' defrules rulesp "skip\n# \n#\n" @?= Right (mkrules $ defrules{rdirect... | 4,472 | tests_CsvReader = testGroup "CsvReader" [
testGroup "parseCsvRules" [
testCase "empty file" $
parseCsvRules "unknown" "" @?= Right (mkrules defrules)
]
,testGroup "rulesp" [
testCase "trailing comments" $
parseWithState' defrules rulesp "skip\n# \n#\n" @?= Right (mkrules $ defrules{rdirect... | 4,472 | false | false | 0 | 22 | 701 | 1,379 | 731 | 648 | null | null |
arne-schroppe/dash | src/Language/Dash/BuiltIn/BuiltInDefinitions.hs | mit | bifStringLengthName = "string_length" | 37 | bifStringLengthName = "string_length" | 37 | bifStringLengthName = "string_length" | 37 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
nomeata/cryptonite | Crypto/PubKey/RSA.hs | bsd-3-clause | {-
-- some bad implementation will not serialize ASN.1 integer properly, leading
-- to negative modulus.
-- TODO : Find a better place for this
toPositive :: Integer -> Integer
toPositive int
| int < 0 = uintOfBytes $ bytesOfInt int
| otherwise = int
where uintOfBytes = foldl (\acc n -> (acc `shiftL` 8) + f... | 2,338 | generateWith :: (Integer, Integer) -- ^ chosen distinct primes p and q
-> Int -- ^ size in bytes
-> Integer -- ^ RSA public exponant 'e'
-> Maybe (PublicKey, PrivateKey)
generateWith (p,q) size e =
case inverse e phi of
Nothing -> Nothing
... | 1,117 | generateWith (p,q) size e =
case inverse e phi of
Nothing -> Nothing
Just d -> Just (pub,priv d)
where n = p*q
phi = (p-1)*(q-1)
-- q and p should be *distinct* *prime* numbers, hence always coprime
qinv = inverseCoprimes q p
pub = PublicKey { public_size = size
... | 882 | true | true | 7 | 10 | 888 | 284 | 155 | 129 | null | null |
mettekou/ghc | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | pprBasicBlock :: BlockEnv CmmStatics -> NatBasicBlock Instr -> SDoc
pprBasicBlock info_env (BasicBlock blockid instrs)
= maybe_infotable $$
pprLabel (mkAsmTempLabel (getUnique blockid)) $$
vcat (map pprInstr instrs)
where
maybe_infotable = case mapLookup blockid info_env of
Nothing -> empty
... | 460 | pprBasicBlock :: BlockEnv CmmStatics -> NatBasicBlock Instr -> SDoc
pprBasicBlock info_env (BasicBlock blockid instrs)
= maybe_infotable $$
pprLabel (mkAsmTempLabel (getUnique blockid)) $$
vcat (map pprInstr instrs)
where
maybe_infotable = case mapLookup blockid info_env of
Nothing -> empty
... | 460 | pprBasicBlock info_env (BasicBlock blockid instrs)
= maybe_infotable $$
pprLabel (mkAsmTempLabel (getUnique blockid)) $$
vcat (map pprInstr instrs)
where
maybe_infotable = case mapLookup blockid info_env of
Nothing -> empty
Just (Statics info_lbl info) ->
pprAlignForSection Te... | 392 | false | true | 0 | 12 | 116 | 141 | 65 | 76 | null | null |
fpco/cabal | Cabal/Distribution/Simple/Program/Db.hs | bsd-3-clause | -- -------------------------------
-- Managing unconfigured programs
-- | Add a known program that we may configure later
--
addKnownProgram :: Program -> ProgramDb -> ProgramDb
addKnownProgram prog = updateUnconfiguredProgs $
Map.insertWith combine (programName prog) (prog, Nothing, [])
where combine _ (_, path, ... | 346 | addKnownProgram :: Program -> ProgramDb -> ProgramDb
addKnownProgram prog = updateUnconfiguredProgs $
Map.insertWith combine (programName prog) (prog, Nothing, [])
where combine _ (_, path, args) = (prog, path, args) | 220 | addKnownProgram prog = updateUnconfiguredProgs $
Map.insertWith combine (programName prog) (prog, Nothing, [])
where combine _ (_, path, args) = (prog, path, args) | 167 | true | true | 0 | 8 | 51 | 86 | 49 | 37 | null | null |
kelnage/tamarin-prover | lib/theory/src/Theory/Model/Rule.hs | gpl-3.0 | unifiableRuleACInsts :: RuleACInst -> RuleACInst -> WithMaude Bool
unifiableRuleACInsts ru1 ru2 =
(not . null) <$> unifyRuleACInstEqs [Equal ru1 ru2] | 153 | unifiableRuleACInsts :: RuleACInst -> RuleACInst -> WithMaude Bool
unifiableRuleACInsts ru1 ru2 =
(not . null) <$> unifyRuleACInstEqs [Equal ru1 ru2] | 153 | unifiableRuleACInsts ru1 ru2 =
(not . null) <$> unifyRuleACInstEqs [Equal ru1 ru2] | 86 | false | true | 0 | 8 | 23 | 49 | 24 | 25 | null | null |
Icelandjack/lens | src/Control/Lens/Fold.hs | bsd-3-clause | -- | Return whether or not none of the elements viewed through an 'IndexedFold' or 'IndexedTraversal'
-- satisfy a predicate, with access to the @i@.
--
-- When you don't need access to the index then 'noneOf' is more flexible in what it accepts.
--
-- @
-- 'noneOf' l ≡ 'inoneOf' l '.' 'const'
-- @
--
-- @
-- 'inoneOf'... | 729 | inoneOf :: IndexedGetting i Any s a -> (i -> a -> Bool) -> s -> Bool
inoneOf l = noneOf l .# Indexed | 100 | inoneOf l = noneOf l .# Indexed | 31 | true | true | 2 | 10 | 168 | 76 | 43 | 33 | null | null |
mcschroeder/ghc | compiler/stgSyn/StgLint.hs | bsd-3-clause | addLoc :: LintLocInfo -> LintM a -> LintM a
addLoc extra_loc m = LintM $ \loc scope errs
-> unLintM m (extra_loc:loc) scope errs | 131 | addLoc :: LintLocInfo -> LintM a -> LintM a
addLoc extra_loc m = LintM $ \loc scope errs
-> unLintM m (extra_loc:loc) scope errs | 131 | addLoc extra_loc m = LintM $ \loc scope errs
-> unLintM m (extra_loc:loc) scope errs | 87 | false | true | 0 | 7 | 26 | 65 | 30 | 35 | null | null |
loganbraga/hunch | app/Hunch/Options/CommandLine.hs | mit | noChecksOpt :: Parser Bool
noChecksOpt = switch $
long "no-check"
<> short 'c'
<> help "Do not check input for invalid names or not found templates" | 165 | noChecksOpt :: Parser Bool
noChecksOpt = switch $
long "no-check"
<> short 'c'
<> help "Do not check input for invalid names or not found templates" | 165 | noChecksOpt = switch $
long "no-check"
<> short 'c'
<> help "Do not check input for invalid names or not found templates" | 138 | false | true | 6 | 6 | 42 | 44 | 17 | 27 | null | null |
nushio3/ghc | libraries/base/Foreign/C/Error.hs | bsd-3-clause | eBUSY = Errno (CONST_EBUSY) | 37 | eBUSY = Errno (CONST_EBUSY) | 37 | eBUSY = Errno (CONST_EBUSY) | 37 | false | false | 0 | 6 | 13 | 12 | 6 | 6 | null | null |
yav/monadlib | tests/DynamicScopeRW.hs | mit | testWStat = runId $ runContT return $ runWriterT $ testW () | 64 | testWStat = runId $ runContT return $ runWriterT $ testW () | 64 | testWStat = runId $ runContT return $ runWriterT $ testW () | 64 | false | false | 0 | 8 | 15 | 26 | 12 | 14 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs | bsd-3-clause | ghcProgram :: Program
ghcProgram = (simpleProgram "ghc") {
programFindVersion = findProgramVersion "--numeric-version" id,
-- Workaround for https://ghc.haskell.org/trac/ghc/ticket/8825
-- (spurious warning on non-english locales)
programPostConf = \_verbosity ghcProg ->
do let ghcProg' = ghcPro... | 898 | ghcProgram :: Program
ghcProgram = (simpleProgram "ghc") {
programFindVersion = findProgramVersion "--numeric-version" id,
-- Workaround for https://ghc.haskell.org/trac/ghc/ticket/8825
-- (spurious warning on non-english locales)
programPostConf = \_verbosity ghcProg ->
do let ghcProg' = ghcPro... | 898 | ghcProgram = (simpleProgram "ghc") {
programFindVersion = findProgramVersion "--numeric-version" id,
-- Workaround for https://ghc.haskell.org/trac/ghc/ticket/8825
-- (spurious warning on non-english locales)
programPostConf = \_verbosity ghcProg ->
do let ghcProg' = ghcProg {
progr... | 876 | false | true | 0 | 17 | 303 | 176 | 96 | 80 | null | null |
aztek/voogie | src/Voogie/Boogie/Smart.hs | gpl-3.0 | assume, assert :: Formula -> Property
assume = Assume | 53 | assume, assert :: Formula -> Property
assume = Assume | 53 | assume = Assume | 15 | false | true | 0 | 5 | 8 | 17 | 10 | 7 | null | null |
text-utf8/text | Data/Text.hs | bsd-2-clause | -- | /O(1)/ Returns the last character of a 'Text', which must be
-- non-empty. Subject to fusion.
last :: Text -> Char
last (Text arr off len)
| len <= 0 = emptyError "last"
| otherwise = U8.reverseDecodeCharIndex (\c _ -> c) idx (off + len - 1)
where
idx = A.unsafeIndex arr
| 308 | last :: Text -> Char
last (Text arr off len)
| len <= 0 = emptyError "last"
| otherwise = U8.reverseDecodeCharIndex (\c _ -> c) idx (off + len - 1)
where
idx = A.unsafeIndex arr
| 208 | last (Text arr off len)
| len <= 0 = emptyError "last"
| otherwise = U8.reverseDecodeCharIndex (\c _ -> c) idx (off + len - 1)
where
idx = A.unsafeIndex arr
| 187 | true | true | 1 | 8 | 85 | 93 | 47 | 46 | null | null |
vTurbine/ghc | compiler/types/Type.hs | bsd-3-clause | seqTypes (ty:tys) = seqType ty `seq` seqTypes tys | 49 | seqTypes (ty:tys) = seqType ty `seq` seqTypes tys | 49 | seqTypes (ty:tys) = seqType ty `seq` seqTypes tys | 49 | false | false | 0 | 7 | 7 | 28 | 14 | 14 | null | null |
svenssonjoel/MonadObsidian | Obsidian/MonadObsidian/GenCuda.hs | bsd-3-clause | -- -----------------------------------------------------------------------------
rename :: Name -> MemoryMap -> Name
rename n mm = if (not ("source" `isPrefixOf` n))
then n'
else n
where
(j,at) = case Map.lookup n mm of
Nothing -> error $ "error: "++ n ++"... | 680 | rename :: Name -> MemoryMap -> Name
rename n mm = if (not ("source" `isPrefixOf` n))
then n'
else n
where
(j,at) = case Map.lookup n mm of
Nothing -> error $ "error: "++ n ++" not found in MemoryMap"
Just a -> a
n' = case at of
... | 598 | rename n mm = if (not ("source" `isPrefixOf` n))
then n'
else n
where
(j,at) = case Map.lookup n mm of
Nothing -> error $ "error: "++ n ++" not found in MemoryMap"
Just a -> a
n' = case at of
Global_Array t ->
... | 562 | true | true | 0 | 14 | 261 | 202 | 100 | 102 | null | null |
ambiata/zodiac | zodiac-http-client/src/Zodiac/HttpClient/Request.hs | bsd-3-clause | -- | Convert an http-client Request to canonical form for signing or
-- verification.
toCanonicalRequest :: Request -> Either RequestError CRequest
toCanonicalRequest r =
-- URI part and query string are both already URL-encoded in http-client.
let uri = toCURI $ HC.path r
qs = toCQueryString $ HC.queryString... | 646 | toCanonicalRequest :: Request -> Either RequestError CRequest
toCanonicalRequest r =
-- URI part and query string are both already URL-encoded in http-client.
let uri = toCURI $ HC.path r
qs = toCQueryString $ HC.queryString r in do
method <- reqCMethod r
payload <- reqCPayload r
headers <- reqCHeaders ... | 560 | toCanonicalRequest r =
-- URI part and query string are both already URL-encoded in http-client.
let uri = toCURI $ HC.path r
qs = toCQueryString $ HC.queryString r in do
method <- reqCMethod r
payload <- reqCPayload r
headers <- reqCHeaders r
pure $ CRequest method uri qs headers payload
-- | Canoni... | 498 | true | true | 0 | 11 | 122 | 111 | 53 | 58 | null | null |
fmapfmapfmap/amazonka | amazonka-codepipeline/gen/Network/AWS/CodePipeline/Types/Product.hs | mpl-2.0 | -- | The stage of the pipeline.
pcStage :: Lens' PipelineContext (Maybe StageContext)
pcStage = lens _pcStage (\ s a -> s{_pcStage = a}) | 136 | pcStage :: Lens' PipelineContext (Maybe StageContext)
pcStage = lens _pcStage (\ s a -> s{_pcStage = a}) | 104 | pcStage = lens _pcStage (\ s a -> s{_pcStage = a}) | 50 | true | true | 0 | 9 | 23 | 46 | 25 | 21 | null | null |
Velro/sdl2 | src/SDL/Raw/Filesystem.hs | bsd-3-clause | rwClose :: MonadIO m => Ptr RWops -> m CInt
rwClose v1 = liftIO $ rwCloseFFI v1 | 79 | rwClose :: MonadIO m => Ptr RWops -> m CInt
rwClose v1 = liftIO $ rwCloseFFI v1 | 79 | rwClose v1 = liftIO $ rwCloseFFI v1 | 35 | false | true | 2 | 8 | 16 | 44 | 18 | 26 | null | null |
flipstone/orville | orville-postgresql/test/WhereConditionTest.hs | mit | -- Order definitions
orderTable :: O.TableDefinition Order Order OrderId
orderTable =
O.mkTableDefinition $
O.TableParams
{ O.tblName = "order"
, O.tblPrimaryKey = O.primaryKey orderIdField
, O.tblMapper =
Order <$> O.attrField orderId orderIdField <*>
O.attrField customerFkId customerFk... | 474 | orderTable :: O.TableDefinition Order Order OrderId
orderTable =
O.mkTableDefinition $
O.TableParams
{ O.tblName = "order"
, O.tblPrimaryKey = O.primaryKey orderIdField
, O.tblMapper =
Order <$> O.attrField orderId orderIdField <*>
O.attrField customerFkId customerFkIdField <*>
O... | 453 | orderTable =
O.mkTableDefinition $
O.TableParams
{ O.tblName = "order"
, O.tblPrimaryKey = O.primaryKey orderIdField
, O.tblMapper =
Order <$> O.attrField orderId orderIdField <*>
O.attrField customerFkId customerFkIdField <*>
O.attrField orderName orderNameField
, O.tblGetKe... | 401 | true | true | 0 | 12 | 107 | 121 | 65 | 56 | null | null |
nikai3d/ce-challenges | easy/sum_digits.hs | bsd-3-clause | main :: IO ()
main = do
[inpFile] <- getArgs
input <- readFile inpFile
putStr . unlines . map (show . sum . map (read . (:[]))) $ lines input | 153 | main :: IO ()
main = do
[inpFile] <- getArgs
input <- readFile inpFile
putStr . unlines . map (show . sum . map (read . (:[]))) $ lines input | 153 | main = do
[inpFile] <- getArgs
input <- readFile inpFile
putStr . unlines . map (show . sum . map (read . (:[]))) $ lines input | 139 | false | true | 0 | 16 | 41 | 84 | 41 | 43 | null | null |
nc6/cabin | Cabin/Package.hs | bsd-3-clause | findCabinByName :: String -> CabinDB -> Maybe Cabin
findCabinByName name = findCabin (\(Cabin name' _) -> name == name') | 120 | findCabinByName :: String -> CabinDB -> Maybe Cabin
findCabinByName name = findCabin (\(Cabin name' _) -> name == name') | 120 | findCabinByName name = findCabin (\(Cabin name' _) -> name == name') | 68 | false | true | 0 | 9 | 18 | 48 | 24 | 24 | null | null |
vincenthz/hs-foundation | basement/Basement/BoxedArray.hs | bsd-3-clause | arrayType :: DataType
arrayType = mkNoRepType "Foundation.Array" | 64 | arrayType :: DataType
arrayType = mkNoRepType "Foundation.Array" | 64 | arrayType = mkNoRepType "Foundation.Array" | 42 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
luzhuomi/cpp-obs | Language/C/Obfuscate/ASTUtils.hs | apache-2.0 | endsWithBreak :: [AST.CCompoundBlockItem N.NodeInfo] -> Bool
endsWithBreak [] = False | 86 | endsWithBreak :: [AST.CCompoundBlockItem N.NodeInfo] -> Bool
endsWithBreak [] = False | 85 | endsWithBreak [] = False | 24 | false | true | 0 | 8 | 10 | 30 | 15 | 15 | null | null |
narrative/stack | src/Stack/Init.hs | bsd-3-clause | checkBundleResolver
:: ( MonadBaseControl IO m, MonadIO m, MonadLogger m, MonadMask m
, MonadReader env m, HasConfig env , HasGHCVariant env
, HasHttpManager env , HasLogLevel env , HasReExec env
, HasTerminal env)
=> Path Abs File -- ^ stack.yaml
-> InitOpts
-> Map PackageName (P... | 4,425 | checkBundleResolver
:: ( MonadBaseControl IO m, MonadIO m, MonadLogger m, MonadMask m
, MonadReader env m, HasConfig env , HasGHCVariant env
, HasHttpManager env , HasLogLevel env , HasReExec env
, HasTerminal env)
=> Path Abs File -- ^ stack.yaml
-> InitOpts
-> Map PackageName (P... | 4,425 | checkBundleResolver stackYaml initOpts bundle resolver = do
result <- checkResolverSpec gpds Nothing resolver
case result of
BuildPlanCheckOk f -> return $ Right (f, Map.empty)
BuildPlanCheckPartial f e
| needSolver resolver initOpts -> do
warnPartial result
... | 3,851 | false | true | 7 | 17 | 1,533 | 1,123 | 532 | 591 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_TRANSFORM_BIT :: GLbitfield
gl_TRANSFORM_BIT = 0x00001000 | 60 | gl_TRANSFORM_BIT :: GLbitfield
gl_TRANSFORM_BIT = 0x00001000 | 60 | gl_TRANSFORM_BIT = 0x00001000 | 29 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_445 x = happyTcHack x happyReduce_267 | 44 | action_445 x = happyTcHack x happyReduce_267 | 44 | action_445 x = happyTcHack x happyReduce_267 | 44 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
spechub/Hets | THF/Utils.hs | gpl-2.0 | thfMappingTypeToType :: [THFUnitaryType] -> Maybe Type
thfMappingTypeToType [] = Nothing | 88 | thfMappingTypeToType :: [THFUnitaryType] -> Maybe Type
thfMappingTypeToType [] = Nothing | 88 | thfMappingTypeToType [] = Nothing | 33 | false | true | 0 | 6 | 9 | 26 | 13 | 13 | null | null |
jacekszymanski/wxHaskell | samples/wx/TimeFlowsEx.hs | lgpl-2.1 | -- | Return the mouse position at a certain time.
posAtTime :: Time -> History -> Point
posAtTime _time [(_t,pos)] = pos | 122 | posAtTime :: Time -> History -> Point
posAtTime _time [(_t,pos)] = pos | 72 | posAtTime _time [(_t,pos)] = pos | 34 | true | true | 0 | 7 | 23 | 34 | 19 | 15 | null | null |
flannelhead/flannelhead.github.io | site.hs | bsd-3-clause | main :: IO ()
main = hakyll $ do
let pandocMathCompiler =
let pandocOptions = defaultHakyllWriterOptions
{ writerHTMLMathMethod = MathJax "" }
in pandocCompilerWith defaultHakyllReaderOptions pandocOptions
match "images/*" $ do
route idRoute
compile... | 1,454 | main :: IO ()
main = hakyll $ do
let pandocMathCompiler =
let pandocOptions = defaultHakyllWriterOptions
{ writerHTMLMathMethod = MathJax "" }
in pandocCompilerWith defaultHakyllReaderOptions pandocOptions
match "images/*" $ do
route idRoute
compile... | 1,454 | main = hakyll $ do
let pandocMathCompiler =
let pandocOptions = defaultHakyllWriterOptions
{ writerHTMLMathMethod = MathJax "" }
in pandocCompilerWith defaultHakyllReaderOptions pandocOptions
match "images/*" $ do
route idRoute
compile copyFileCompi... | 1,440 | false | true | 2 | 20 | 482 | 317 | 134 | 183 | null | null |
TomMD/ghc | utils/deriveConstants/DeriveConstants.hs | bsd-3-clause | getWanted :: Bool -> FilePath -> FilePath -> [String] -> FilePath -> IO Results
getWanted verbose tmpdir gccProgram gccFlags nmProgram
= do let cStuff = unlines (headers ++ concatMap (doWanted . snd) wanteds)
cFile = tmpdir </> "tmp.c"
oFile = tmpdir </> "tmp.o"
writeFile cFile cS... | 7,649 | getWanted :: Bool -> FilePath -> FilePath -> [String] -> FilePath -> IO Results
getWanted verbose tmpdir gccProgram gccFlags nmProgram
= do let cStuff = unlines (headers ++ concatMap (doWanted . snd) wanteds)
cFile = tmpdir </> "tmp.c"
oFile = tmpdir </> "tmp.o"
writeFile cFile cS... | 7,649 | getWanted verbose tmpdir gccProgram gccFlags nmProgram
= do let cStuff = unlines (headers ++ concatMap (doWanted . snd) wanteds)
cFile = tmpdir </> "tmp.c"
oFile = tmpdir </> "tmp.o"
writeFile cFile cStuff
execute verbose gccProgram (gccFlags ++ ["-c", cFile, "-o", oFile]... | 7,569 | false | true | 0 | 17 | 3,179 | 1,954 | 1,003 | 951 | null | null |
bergmark/clay | src/Clay/Selector.hs | bsd-3-clause | -- | Named alias for `|>`.
child :: Selector -> Selector -> Selector
child a b = In (SelectorF (Refinement []) (Child a b)) | 124 | child :: Selector -> Selector -> Selector
child a b = In (SelectorF (Refinement []) (Child a b)) | 96 | child a b = In (SelectorF (Refinement []) (Child a b)) | 54 | true | true | 0 | 9 | 24 | 57 | 27 | 30 | null | null |
RayRacine/aws | Aws/DynamoDb/Commands/Table.hs | bsd-3-clause | dropOpt :: Int -> A.Options
dropOpt d = A.defaultOptions { A.fieldLabelModifier = drop d } | 90 | dropOpt :: Int -> A.Options
dropOpt d = A.defaultOptions { A.fieldLabelModifier = drop d } | 90 | dropOpt d = A.defaultOptions { A.fieldLabelModifier = drop d } | 62 | false | true | 0 | 7 | 14 | 35 | 18 | 17 | null | null |
mariefarrell/Hets | CspCASLProver/CspProverConsts.hs | gpl-2.0 | cspProver_action_prefixAltArgPrios :: [Int]
cspProver_action_prefixAltArgPrios = [150, 80] | 90 | cspProver_action_prefixAltArgPrios :: [Int]
cspProver_action_prefixAltArgPrios = [150, 80] | 90 | cspProver_action_prefixAltArgPrios = [150, 80] | 46 | false | true | 0 | 5 | 6 | 20 | 12 | 8 | null | null |
pack-it-forms/msgfmt | src/PackItForms/MsgFmt.hs | apache-2.0 | -- | Accessor for the value of an envelope field
getEnvVal :: MsgFmt -> String -> Maybe String
getEnvVal (MsgFmt e _ _) k = M.lookup k e | 136 | getEnvVal :: MsgFmt -> String -> Maybe String
getEnvVal (MsgFmt e _ _) k = M.lookup k e | 87 | getEnvVal (MsgFmt e _ _) k = M.lookup k e | 41 | true | true | 0 | 7 | 27 | 45 | 22 | 23 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Unit.hs | mit | buildTime ZergNydusCanal = 600 | 30 | buildTime ZergNydusCanal = 600 | 30 | buildTime ZergNydusCanal = 600 | 30 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
agentm/project-m36 | src/lib/ProjectM36/AtomType.hs | unlicense | atomTypeForAttributeExpr (AttributeAndTypeNameExpr _ tCons _) tConsMap tvMap = atomTypeForTypeConstructorValidate True tCons tConsMap tvMap | 139 | atomTypeForAttributeExpr (AttributeAndTypeNameExpr _ tCons _) tConsMap tvMap = atomTypeForTypeConstructorValidate True tCons tConsMap tvMap | 139 | atomTypeForAttributeExpr (AttributeAndTypeNameExpr _ tCons _) tConsMap tvMap = atomTypeForTypeConstructorValidate True tCons tConsMap tvMap | 139 | false | false | 0 | 7 | 12 | 32 | 15 | 17 | null | null |
snoyberg/ghc | compiler/codeGen/StgCmmClosure.hs | bsd-3-clause | might_be_a_function :: Type -> Bool
-- Return False only if we are *sure* it's a data type
-- Look through newtypes etc as much as poss
might_be_a_function ty
| UnaryRep rep <- repType ty
, Just tc <- tyConAppTyCon_maybe rep
, isDataTyCon tc
= False
| otherwise
= True | 280 | might_be_a_function :: Type -> Bool
might_be_a_function ty
| UnaryRep rep <- repType ty
, Just tc <- tyConAppTyCon_maybe rep
, isDataTyCon tc
= False
| otherwise
= True | 180 | might_be_a_function ty
| UnaryRep rep <- repType ty
, Just tc <- tyConAppTyCon_maybe rep
, isDataTyCon tc
= False
| otherwise
= True | 144 | true | true | 0 | 9 | 60 | 69 | 31 | 38 | null | null |
MichielDerhaeg/stack | src/Stack/Types/Package.hs | bsd-3-clause | isCExe :: NamedComponent -> Bool
isCExe CExe{} = True | 53 | isCExe :: NamedComponent -> Bool
isCExe CExe{} = True | 53 | isCExe CExe{} = True | 20 | false | true | 0 | 6 | 8 | 22 | 11 | 11 | null | null |
JohnLato/jaek | src/Jaek/UI/Controllers/Base.hs | lgpl-3.0 | aKeys :: ControlGraph (Event KeyVal)
aKeys = (extract keysPass . last) <$> St.get | 81 | aKeys :: ControlGraph (Event KeyVal)
aKeys = (extract keysPass . last) <$> St.get | 81 | aKeys = (extract keysPass . last) <$> St.get | 44 | false | true | 0 | 8 | 12 | 36 | 18 | 18 | null | null |
reuleaux/pire | src/Pire/Parser/Decl.hs | bsd-3-clause | Def_ :: (TokenParsing m
-- , Fresh m
, LookAheadParsing m
, DeltaParsing m
, MonadState PiState m) => m (Decl T.Text T.Text)
valDef_ = do
-- (n, e) <- try (do {n <- var_; e <- eq_; return (n, e)})
-- val <- expr_
-- return $ Def_ n e val
(n, ws, e) <- try (do {(n, ws)... | 728 | valDef_ :: (TokenParsing m
-- , Fresh m
, LookAheadParsing m
, DeltaParsing m
, MonadState PiState m) => m (Decl T.Text T.Text)
valDef_ = do
-- (n, e) <- try (do {n <- var_; e <- eq_; return (n, e)})
-- val <- expr_
-- return $ Def_ n e val
(n, ws, e) <- try (do {(n, ... | 728 | valDef_ = do
-- (n, e) <- try (do {n <- var_; e <- eq_; return (n, e)})
-- val <- expr_
-- return $ Def_ n e val
(n, ws, e) <- try (do {(n, ws) <- var2_; e <- eq_; return (n, ws, e)})
val <- expr_
return $ Def_ (Nm1_ n ws) e val
-- for testing
-- let natstr = unlines [ "data Nat : Type where", " Zer... | 556 | false | true | 0 | 13 | 211 | 169 | 92 | 77 | null | null |
peterson/lets-tree | src/Lets/BinomialHeap.hs | bsd-3-clause | t2 = Node 1 1 [Node 0 5 []] | 27 | t2 = Node 1 1 [Node 0 5 []] | 27 | t2 = Node 1 1 [Node 0 5 []] | 27 | false | false | 1 | 7 | 8 | 30 | 12 | 18 | null | null |
d0kt0r0/estuary | client/src/Estuary/Types/Terminal.hs | gpl-3.0 | -- <?> "expecting view"
identifierText :: H Text
identifierText = do
s <- identifier
return $ T.pack s | 107 | identifierText :: H Text
identifierText = do
s <- identifier
return $ T.pack s | 82 | identifierText = do
s <- identifier
return $ T.pack s | 57 | true | true | 0 | 10 | 22 | 40 | 17 | 23 | null | null |
kapilash/dc | src/ccs2c/ccs2cs-lib/src/Language/CCS/Parser.hs | bsd-3-clause | enumValue = hashedEnumVal <|> enumComplex
<?> "Enum Value" | 70 | enumValue = hashedEnumVal <|> enumComplex
<?> "Enum Value" | 70 | enumValue = hashedEnumVal <|> enumComplex
<?> "Enum Value" | 70 | false | false | 0 | 6 | 19 | 14 | 7 | 7 | null | null |
IanConnolly/aws-sdk-fork | AWS/Lib/Parser.hs | bsd-3-clause | fromMaybeM :: Monad m => m a -> Maybe a -> m a
fromMaybeM a Nothing = a | 72 | fromMaybeM :: Monad m => m a -> Maybe a -> m a
fromMaybeM a Nothing = a | 72 | fromMaybeM a Nothing = a | 25 | false | true | 0 | 8 | 18 | 40 | 18 | 22 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.