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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Dobiasd/HackerRank-solutions | Artificial_Intelligence/Natural_Language_Processing/The_Trigram/Main.hs | mit | isWordBreak :: Char -> Bool
isWordBreak ' ' = True | 50 | isWordBreak :: Char -> Bool
isWordBreak ' ' = True | 50 | isWordBreak ' ' = True | 22 | false | true | 0 | 7 | 9 | 24 | 10 | 14 | null | null |
noamz/linlam-gos | src/Viz/Lambda.hs | mit | lamTree :: String -> Bool -> L.ULT -> (Diagram B, [String])
lamTree k b (L.V _) = (spot # named k, [k]) | 103 | lamTree :: String -> Bool -> L.ULT -> (Diagram B, [String])
lamTree k b (L.V _) = (spot # named k, [k]) | 103 | lamTree k b (L.V _) = (spot # named k, [k]) | 43 | false | true | 0 | 12 | 21 | 74 | 37 | 37 | null | null |
Gabriel439/suns-cmd | Test.hs | bsd-3-clause | test :: (BS.ByteString, (FilePath, BS.ByteString)) -> IO Bool
test (result, (filePath, expectation)) = do
putStrLn $ "Testing: " ++ filePath
putStrLn $ "Expected: " ++ show expectation
putStrLn $ "Found : " ++ show result
return (result == expectation) | 271 | test :: (BS.ByteString, (FilePath, BS.ByteString)) -> IO Bool
test (result, (filePath, expectation)) = do
putStrLn $ "Testing: " ++ filePath
putStrLn $ "Expected: " ++ show expectation
putStrLn $ "Found : " ++ show result
return (result == expectation) | 271 | test (result, (filePath, expectation)) = do
putStrLn $ "Testing: " ++ filePath
putStrLn $ "Expected: " ++ show expectation
putStrLn $ "Found : " ++ show result
return (result == expectation) | 209 | false | true | 0 | 9 | 57 | 105 | 52 | 53 | null | null |
erikd/wai | wai-extra/Network/Wai/Middleware/AcceptOverride.hs | mit | acceptOverride :: Middleware
acceptOverride app req =
app req'
where
req' =
case join $ lookup "_accept" $ queryString req of
Nothing -> req
Just a -> req { requestHeaders = changeVal "Accept" a $ requestHeaders req} | 258 | acceptOverride :: Middleware
acceptOverride app req =
app req'
where
req' =
case join $ lookup "_accept" $ queryString req of
Nothing -> req
Just a -> req { requestHeaders = changeVal "Accept" a $ requestHeaders req} | 258 | acceptOverride app req =
app req'
where
req' =
case join $ lookup "_accept" $ queryString req of
Nothing -> req
Just a -> req { requestHeaders = changeVal "Accept" a $ requestHeaders req} | 229 | false | true | 0 | 11 | 78 | 80 | 38 | 42 | null | null |
futtetennista/IntroductionToFunctionalProgramming | itfp/src/Chapter9.hs | mit | curry :: GTree a -> ExpTree a
curry (GNode x ts) =
foldl ExpBin (ExpTip x) (map curry ts) | 91 | curry :: GTree a -> ExpTree a
curry (GNode x ts) =
foldl ExpBin (ExpTip x) (map curry ts) | 91 | curry (GNode x ts) =
foldl ExpBin (ExpTip x) (map curry ts) | 61 | false | true | 0 | 7 | 20 | 53 | 25 | 28 | null | null |
GaloisInc/halvm-ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprCtOrigin (DerivOriginDC dc n)
= hang (ctoHerald <+> text "the" <+> speakNth n
<+> text "field of" <+> quotes (ppr dc))
2 (parens (text "type" <+> quotes (ppr ty)))
where
ty = dataConOrigArgTys dc !! (n-1) | 232 | pprCtOrigin (DerivOriginDC dc n)
= hang (ctoHerald <+> text "the" <+> speakNth n
<+> text "field of" <+> quotes (ppr dc))
2 (parens (text "type" <+> quotes (ppr ty)))
where
ty = dataConOrigArgTys dc !! (n-1) | 232 | pprCtOrigin (DerivOriginDC dc n)
= hang (ctoHerald <+> text "the" <+> speakNth n
<+> text "field of" <+> quotes (ppr dc))
2 (parens (text "type" <+> quotes (ppr ty)))
where
ty = dataConOrigArgTys dc !! (n-1) | 232 | false | false | 3 | 11 | 60 | 116 | 51 | 65 | null | null |
trbauer/globexpr | Text/Glob.hs | mit | hasVarDef :: VarDefs -> String -> Bool
hasVarDef vs k = case lookup k vs of
Just _ -> True
Nothing -> False
-- | This function matches a glob expression against a given directory root.
-- The rules of matching are roughly the same as 'expandGlobSeq' except:
--
-- (1) The list of... | 745 | hasVarDef :: VarDefs -> String -> Bool
hasVarDef vs k = case lookup k vs of
Just _ -> True
Nothing -> False
-- | This function matches a glob expression against a given directory root.
-- The rules of matching are roughly the same as 'expandGlobSeq' except:
--
-- (1) The list of... | 745 | hasVarDef vs k = case lookup k vs of
Just _ -> True
Nothing -> False
-- | This function matches a glob expression against a given directory root.
-- The rules of matching are roughly the same as 'expandGlobSeq' except:
--
-- (1) The list of strings to match against are generated... | 706 | false | true | 0 | 8 | 193 | 66 | 36 | 30 | null | null |
kmels/hledger | hledger/Hledger/Cli/Add.hs | gpl-3.0 | capitalize :: String -> String
capitalize "" = "" | 49 | capitalize :: String -> String
capitalize "" = "" | 49 | capitalize "" = "" | 18 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
DanielWaterworth/Idris-dev | src/IRTS/CodegenLLVM.hs | bsd-3-clause | cgOp (LSLt (ATInt ity)) [x,y] = iCmp ity IPred.SLT x y | 56 | cgOp (LSLt (ATInt ity)) [x,y] = iCmp ity IPred.SLT x y | 56 | cgOp (LSLt (ATInt ity)) [x,y] = iCmp ity IPred.SLT x y | 56 | false | false | 0 | 9 | 12 | 40 | 20 | 20 | null | null |
erantapaa/rakhana | Data/Rakhana/Tape.hs | bsd-3-clause | tapeGetSeek :: MonadIO m => TapeState -> Tape m (TResp, TapeState)
tapeGetSeek s = return (RSeek i, s)
where
i = tapeStatePos s
-------------------------------------------------------------------------------- | 215 | tapeGetSeek :: MonadIO m => TapeState -> Tape m (TResp, TapeState)
tapeGetSeek s = return (RSeek i, s)
where
i = tapeStatePos s
-------------------------------------------------------------------------------- | 215 | tapeGetSeek s = return (RSeek i, s)
where
i = tapeStatePos s
-------------------------------------------------------------------------------- | 148 | false | true | 0 | 8 | 30 | 60 | 30 | 30 | null | null |
nkbt/haskell-book | 2.6.ex.hsproj/HS2_6_ex.hs | mit | -- 3
x = 7 | 10 | x = 7 | 5 | x = 7 | 5 | true | false | 1 | 5 | 4 | 11 | 4 | 7 | null | null |
markflorisson/hpack | src/HPack/Infer/Inference.hs | bsd-3-clause | -- | Run the intererence monad, returning an updated package and
-- interface repository
runInferM :: MonadIO m
=> InferM m a -> State
-> m (Either InferError (a, PkgDB, IfaceRepo))
runInferM computation state = do
eitherEitherVal <- runIface (runInfer computation)
return $ do
(eithe... | 931 | runInferM :: MonadIO m
=> InferM m a -> State
-> m (Either InferError (a, PkgDB, IfaceRepo))
runInferM computation state = do
eitherEitherVal <- runIface (runInfer computation)
return $ do
(eitherVal, ifaceRepo) <- eitherEitherVal
(val, pkgdb) <- eitherVal
return (val... | 842 | runInferM computation state = do
eitherEitherVal <- runIface (runInfer computation)
return $ do
(eitherVal, ifaceRepo) <- eitherEitherVal
(val, pkgdb) <- eitherVal
return (val, pkgdb, ifaceRepo)
where
runInfer :: Monad m => InferM m a -> IfaceRepoM m (Either InferError (a, Pk... | 729 | true | true | 6 | 11 | 267 | 282 | 141 | 141 | null | null |
ihc/futhark | src/Futhark/Construct.hs | isc | eBody :: (MonadBinder m) =>
[m (Exp (Lore m))]
-> m (Body (Lore m))
eBody es = insertStmsM $ do
es' <- sequence es
xs <- mapM (letTupExp "x") es'
mkBodyM [] $ map Var $ concat xs | 232 | eBody :: (MonadBinder m) =>
[m (Exp (Lore m))]
-> m (Body (Lore m))
eBody es = insertStmsM $ do
es' <- sequence es
xs <- mapM (letTupExp "x") es'
mkBodyM [] $ map Var $ concat xs | 232 | eBody es = insertStmsM $ do
es' <- sequence es
xs <- mapM (letTupExp "x") es'
mkBodyM [] $ map Var $ concat xs | 149 | false | true | 0 | 13 | 91 | 119 | 54 | 65 | null | null |
lubomir/dot-race | fay/FFI/SVG.hs | bsd-3-clause | svgPolygon :: Element -> [Point] -> Fay Element
svgPolygon drawing = svgPolygon' drawing . map (\(P x y) -> (x, y)) | 115 | svgPolygon :: Element -> [Point] -> Fay Element
svgPolygon drawing = svgPolygon' drawing . map (\(P x y) -> (x, y)) | 115 | svgPolygon drawing = svgPolygon' drawing . map (\(P x y) -> (x, y)) | 67 | false | true | 0 | 10 | 20 | 64 | 32 | 32 | null | null |
beni55/ghcjs | src/Gen2/Optimizer.hs | mit | deleteConstants :: IdSet -> CVals -> CVals
deleteConstants s (CReached m) = CReached (IM.filterWithKey f m)
where
f :: Id -> CFact -> Bool
f k _ | k `IS.member` s = False
f _ (CKnown ae _) | not . IS.null $ exprDeps ae `IS.intersection` s = False
f _ _ ... | 383 | deleteConstants :: IdSet -> CVals -> CVals
deleteConstants s (CReached m) = CReached (IM.filterWithKey f m)
where
f :: Id -> CFact -> Bool
f k _ | k `IS.member` s = False
f _ (CKnown ae _) | not . IS.null $ exprDeps ae `IS.intersection` s = False
f _ _ ... | 383 | deleteConstants s (CReached m) = CReached (IM.filterWithKey f m)
where
f :: Id -> CFact -> Bool
f k _ | k `IS.member` s = False
f _ (CKnown ae _) | not . IS.null $ exprDeps ae `IS.intersection` s = False
f _ _ ... | 340 | false | true | 0 | 11 | 177 | 138 | 68 | 70 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_MATRIX28_ARB :: GLenum
gl_MATRIX28_ARB = 0x88DC | 50 | gl_MATRIX28_ARB :: GLenum
gl_MATRIX28_ARB = 0x88DC | 50 | gl_MATRIX28_ARB = 0x88DC | 24 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
tamarin-prover/tamarin-prover | lib/theory/src/Theory/Proof.hs | gpl-3.0 | focusDiff path prover =
DiffProver $ \ctxt d _ prf ->
modifyAtPathDiff (prover' ctxt (d + length path)) path prf
where
prover' ctxt d prf = do
se <- dpsInfo (root prf)
runDiffProver prover ctxt d se prf
-- | Check the proof and handle new cases using the given prover. | 303 | focusDiff path prover =
DiffProver $ \ctxt d _ prf ->
modifyAtPathDiff (prover' ctxt (d + length path)) path prf
where
prover' ctxt d prf = do
se <- dpsInfo (root prf)
runDiffProver prover ctxt d se prf
-- | Check the proof and handle new cases using the given prover. | 303 | focusDiff path prover =
DiffProver $ \ctxt d _ prf ->
modifyAtPathDiff (prover' ctxt (d + length path)) path prf
where
prover' ctxt d prf = do
se <- dpsInfo (root prf)
runDiffProver prover ctxt d se prf
-- | Check the proof and handle new cases using the given prover. | 303 | false | false | 0 | 12 | 85 | 97 | 46 | 51 | null | null |
krattai/noo-ebs | docs/zeroMQ-guide2/examples/Haskell/syncpub.hs | bsd-2-clause | main :: IO ()
main = withContext 1 $ \context -> do
withSocket context Pub $ \publisher -> do
bind publisher "tcp://*:5561"
withSocket context Rep $ \syncservice -> do
bind syncservice "tcp://*:5562"
getSubs 0 syncservice
replicateM_ 1000000 $ send publisher (pack... | 377 | main :: IO ()
main = withContext 1 $ \context -> do
withSocket context Pub $ \publisher -> do
bind publisher "tcp://*:5561"
withSocket context Rep $ \syncservice -> do
bind syncservice "tcp://*:5562"
getSubs 0 syncservice
replicateM_ 1000000 $ send publisher (pack... | 377 | main = withContext 1 $ \context -> do
withSocket context Pub $ \publisher -> do
bind publisher "tcp://*:5561"
withSocket context Rep $ \syncservice -> do
bind syncservice "tcp://*:5562"
getSubs 0 syncservice
replicateM_ 1000000 $ send publisher (pack "Rhubarb") []... | 363 | false | true | 0 | 20 | 115 | 129 | 58 | 71 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES :: GLenum
gl_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES = 0x93E4 | 102 | gl_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES :: GLenum
gl_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES = 0x93E4 | 102 | gl_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES = 0x93E4 | 50 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
svalaskevicius/hob | test/Hob/Ui/Editor/SearchSpec.hs | gpl-3.0 | loadGuiWithEditor :: IO (Context, TextBuffer)
loadGuiWithEditor = loadGuiAndExecute $ const $ return () | 103 | loadGuiWithEditor :: IO (Context, TextBuffer)
loadGuiWithEditor = loadGuiAndExecute $ const $ return () | 103 | loadGuiWithEditor = loadGuiAndExecute $ const $ return () | 57 | false | true | 0 | 7 | 12 | 33 | 17 | 16 | null | null |
stackbuilders/datetime | src/Data/DateTime.hs | gpl-3.0 | startOfTime :: DateTime
startOfTime = fromGregorian' 1970 1 1 | 61 | startOfTime :: DateTime
startOfTime = fromGregorian' 1970 1 1 | 61 | startOfTime = fromGregorian' 1970 1 1 | 37 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
marklar/elm-fun | BTree/Tree/tree.hs | mit | t1 :: BTree Int
-- (4 (3 () ()) (7 5 10))
t1 = Node 4 (leaf 3) (Node 7 (leaf 5) (leaf 10)) | 90 | t1 :: BTree Int
t1 = Node 4 (leaf 3) (Node 7 (leaf 5) (leaf 10)) | 64 | t1 = Node 4 (leaf 3) (Node 7 (leaf 5) (leaf 10)) | 48 | true | true | 0 | 9 | 23 | 58 | 26 | 32 | null | null |
Bolt64/my_code | haskell/ADT.hs | mit | toList (Stil x xs) = x : toList xs | 34 | toList (Stil x xs) = x : toList xs | 34 | toList (Stil x xs) = x : toList xs | 34 | false | false | 2 | 6 | 8 | 27 | 11 | 16 | null | null |
xu-hao/QueryArrow | QueryArrow-db-cypher/src/QueryArrow/Cypher/Cypher.hs | bsd-3-clause | (.<>.) :: CypherExpr -> CypherExpr -> CypherCond
a .<>. b = CypherCompCond "<>" a b Pos | 87 | (.<>.) :: CypherExpr -> CypherExpr -> CypherCond
a .<>. b = CypherCompCond "<>" a b Pos | 87 | a .<>. b = CypherCompCond "<>" a b Pos | 38 | false | true | 0 | 9 | 15 | 37 | 18 | 19 | null | null |
nushio3/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | floatFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "floatFromInteger") floatFromIntegerIdKey | 102 | floatFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "floatFromInteger") floatFromIntegerIdKey | 102 | floatFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "floatFromInteger") floatFromIntegerIdKey | 102 | false | false | 0 | 7 | 12 | 19 | 9 | 10 | null | null |
input-output-hk/cardano-sl | chain/src/Pos/Chain/Ssc/Seed.hs | apache-2.0 | mapFailing :: (a -> Maybe b) -> HashMap k a -> Either k (HashMap k b)
mapFailing f =
HM.traverseWithKey (\k a -> maybe (Left k) Right $ f a) | 144 | mapFailing :: (a -> Maybe b) -> HashMap k a -> Either k (HashMap k b)
mapFailing f =
HM.traverseWithKey (\k a -> maybe (Left k) Right $ f a) | 144 | mapFailing f =
HM.traverseWithKey (\k a -> maybe (Left k) Right $ f a) | 74 | false | true | 0 | 11 | 33 | 83 | 40 | 43 | null | null |
albertov/hs-mapnik | bindings/src/Mapnik/Bindings/Expression.hs | bsd-3-clause | toText :: Expression -> Text
toText expr = unsafePerformIO $ newText "Expression.toText" $ \(p,len) ->
[C.block|void {
std::string s = to_expression_string(**$fptr-ptr:(expression_ptr *expr));
mallocedString(s, $(char **p), $(int *len));
}|] | 249 | toText :: Expression -> Text
toText expr = unsafePerformIO $ newText "Expression.toText" $ \(p,len) ->
[C.block|void {
std::string s = to_expression_string(**$fptr-ptr:(expression_ptr *expr));
mallocedString(s, $(char **p), $(int *len));
}|] | 249 | toText expr = unsafePerformIO $ newText "Expression.toText" $ \(p,len) ->
[C.block|void {
std::string s = to_expression_string(**$fptr-ptr:(expression_ptr *expr));
mallocedString(s, $(char **p), $(int *len));
}|] | 220 | false | true | 0 | 7 | 35 | 46 | 26 | 20 | null | null |
diku-kmc/repg | test/Tests/OneApproximation.hs | mit | -- | Converts a string of Kleenex code into a RProg
createRProg :: String -> RProgAct
createRProg s =
case HP.parseKleenex "" s of
Right p -> desugarProg p LCS Correction False
Left e -> error $ show e | 220 | createRProg :: String -> RProgAct
createRProg s =
case HP.parseKleenex "" s of
Right p -> desugarProg p LCS Correction False
Left e -> error $ show e | 168 | createRProg s =
case HP.parseKleenex "" s of
Right p -> desugarProg p LCS Correction False
Left e -> error $ show e | 134 | true | true | 0 | 9 | 57 | 64 | 30 | 34 | null | null |
marknsikora/euler | euler008/euler008.hs | mit | main :: IO ()
main = do
digits <- map digitToInt . concat . lines <$> readFile "number.txt"
print $ euler008 digits | 119 | main :: IO ()
main = do
digits <- map digitToInt . concat . lines <$> readFile "number.txt"
print $ euler008 digits | 119 | main = do
digits <- map digitToInt . concat . lines <$> readFile "number.txt"
print $ euler008 digits | 105 | false | true | 0 | 12 | 25 | 57 | 24 | 33 | null | null |
ekmett/models | src/Model/Internal/PrimRef.hs | bsd-2-clause | -- | Write a primitive value to the reference
writePrimRef :: (PrimMonad m, Prim a) => PrimRef (PrimState m) a -> a -> m ()
writePrimRef (PrimRef m) a = writeByteArray m 0 a | 173 | writePrimRef :: (PrimMonad m, Prim a) => PrimRef (PrimState m) a -> a -> m ()
writePrimRef (PrimRef m) a = writeByteArray m 0 a | 127 | writePrimRef (PrimRef m) a = writeByteArray m 0 a | 49 | true | true | 0 | 11 | 33 | 76 | 35 | 41 | null | null |
chemouna/99Haskell | src/Problem4.hs | bsd-3-clause | myLength10 :: [a] -> Int
myLength10 = snd . last . (flip zip [1..]) | 67 | myLength10 :: [a] -> Int
myLength10 = snd . last . (flip zip [1..]) | 67 | myLength10 = snd . last . (flip zip [1..]) | 42 | false | true | 2 | 8 | 13 | 46 | 21 | 25 | null | null |
mbakke/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | sshsSshHostKey :: String
sshsSshHostKey = "ssh_host_key" | 56 | sshsSshHostKey :: String
sshsSshHostKey = "ssh_host_key" | 56 | sshsSshHostKey = "ssh_host_key" | 31 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
holzensp/ghc | libraries/ghc-prim/GHC/Classes.hs | bsd-3-clause | (I# x) `neInt` (I# y) = isTrue# (x /=# y) | 41 | (I# x) `neInt` (I# y) = isTrue# (x /=# y) | 41 | (I# x) `neInt` (I# y) = isTrue# (x /=# y) | 41 | false | false | 0 | 7 | 9 | 36 | 18 | 18 | null | null |
eriksvedang/Carp | src/Constraints.hs | mpl-2.0 | solveOneInternal :: TypeMappings -> Constraint -> Either UnificationFailure TypeMappings
solveOneInternal mappings constraint =
case constraint of --trace ("SOLVE " ++ show constraint) constraint of
-- Two type variables
Constraint aTy@(VarTy aName) bTy@(VarTy bName) _ _ _ ->
if aTy == bTy
then Ri... | 2,136 | solveOneInternal :: TypeMappings -> Constraint -> Either UnificationFailure TypeMappings
solveOneInternal mappings constraint =
case constraint of --trace ("SOLVE " ++ show constraint) constraint of
-- Two type variables
Constraint aTy@(VarTy aName) bTy@(VarTy bName) _ _ _ ->
if aTy == bTy
then Ri... | 2,136 | solveOneInternal mappings constraint =
case constraint of --trace ("SOLVE " ++ show constraint) constraint of
-- Two type variables
Constraint aTy@(VarTy aName) bTy@(VarTy bName) _ _ _ ->
if aTy == bTy
then Right mappings
else do m' <- checkForConflict mappings constraint aName bTy
... | 2,047 | false | true | 9 | 13 | 630 | 653 | 325 | 328 | null | null |
peterbecich/haskell-programming-first-principles | src/Chapter18.hs | bsd-3-clause | readM :: Read a => String -> IO a
readM = return . read | 55 | readM :: Read a => String -> IO a
readM = return . read | 55 | readM = return . read | 21 | false | true | 0 | 7 | 13 | 29 | 14 | 15 | null | null |
christiaanb/ghc | compiler/rename/RnTypes.hs | bsd-3-clause | rnHsTyKi isType doc (HsEqTy ty1 ty2)
= ASSERT( isType )
do { (ty1', fvs1) <- rnLHsType doc ty1
; (ty2', fvs2) <- rnLHsType doc ty2
; return (HsEqTy ty1' ty2', fvs1 `plusFV` fvs2) } | 200 | rnHsTyKi isType doc (HsEqTy ty1 ty2)
= ASSERT( isType )
do { (ty1', fvs1) <- rnLHsType doc ty1
; (ty2', fvs2) <- rnLHsType doc ty2
; return (HsEqTy ty1' ty2', fvs1 `plusFV` fvs2) } | 200 | rnHsTyKi isType doc (HsEqTy ty1 ty2)
= ASSERT( isType )
do { (ty1', fvs1) <- rnLHsType doc ty1
; (ty2', fvs2) <- rnLHsType doc ty2
; return (HsEqTy ty1' ty2', fvs1 `plusFV` fvs2) } | 200 | false | false | 0 | 9 | 53 | 93 | 48 | 45 | null | null |
psibi/cabal2nix | src/Internal/HaskellPackage.hs | bsd-3-clause | cabalFromPath :: FilePath -> MaybeT IO (Bool, Cabal.GenericPackageDescription)
cabalFromPath path = do
d <- liftIO $ doesDirectoryExist path
(,) d <$> if d
then cabalFromDirectory path
else cabalFromFile False path | 227 | cabalFromPath :: FilePath -> MaybeT IO (Bool, Cabal.GenericPackageDescription)
cabalFromPath path = do
d <- liftIO $ doesDirectoryExist path
(,) d <$> if d
then cabalFromDirectory path
else cabalFromFile False path | 227 | cabalFromPath path = do
d <- liftIO $ doesDirectoryExist path
(,) d <$> if d
then cabalFromDirectory path
else cabalFromFile False path | 148 | false | true | 0 | 9 | 42 | 74 | 36 | 38 | null | null |
rCEx/feldspar-lang-small | src/Feldspar/Repa.hs | bsd-3-clause | sum1 :: (Syntax a, Num a) => Vector DIM1 a -> a
sum1 = foldl (+) 0 | 67 | sum1 :: (Syntax a, Num a) => Vector DIM1 a -> a
sum1 = foldl (+) 0 | 67 | sum1 = foldl (+) 0 | 19 | false | true | 0 | 7 | 17 | 42 | 22 | 20 | null | null |
tjakway/ghcjvm | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | andCts :: Cts -> Cts -> Cts
andCts = unionBags | 46 | andCts :: Cts -> Cts -> Cts
andCts = unionBags | 46 | andCts = unionBags | 18 | false | true | 0 | 8 | 9 | 26 | 11 | 15 | null | null |
romanb/amazonka | amazonka-lambda/gen/Network/AWS/Lambda/UpdateFunctionCode.hs | mpl-2.0 | -- | The Amazon Resource Name (ARN) assigned to the function.
ufcrFunctionArn :: Lens' UpdateFunctionCodeResponse (Maybe Text)
ufcrFunctionArn = lens _ufcrFunctionArn (\s a -> s { _ufcrFunctionArn = a }) | 203 | ufcrFunctionArn :: Lens' UpdateFunctionCodeResponse (Maybe Text)
ufcrFunctionArn = lens _ufcrFunctionArn (\s a -> s { _ufcrFunctionArn = a }) | 141 | ufcrFunctionArn = lens _ufcrFunctionArn (\s a -> s { _ufcrFunctionArn = a }) | 76 | true | true | 0 | 9 | 29 | 46 | 25 | 21 | null | null |
bacchanalia/KitchenSink | KitchenSink/Qualified.hs | gpl-3.0 | -- |'Seq.replicateM'
seq_replicateM = Seq.replicateM | 52 | seq_replicateM = Seq.replicateM | 31 | seq_replicateM = Seq.replicateM | 31 | true | false | 0 | 5 | 4 | 9 | 5 | 4 | null | null |
imccoy/utopia | src/Code.hs | mit | findMax :: [Binding Identity]
findMax = [ expBinding "main" $ lam [] $
app (var "listReduce")
[("listReduce_list", listOf $ lit . Number <$> [1,3,5,9,8,7,6,4,2])
,("listReduce_base", lit . Number $ 0)
,("listReduce_merge_curr", lamArgId "findM... | 1,320 | findMax :: [Binding Identity]
findMax = [ expBinding "main" $ lam [] $
app (var "listReduce")
[("listReduce_list", listOf $ lit . Number <$> [1,3,5,9,8,7,6,4,2])
,("listReduce_base", lit . Number $ 0)
,("listReduce_merge_curr", lamArgId "findM... | 1,320 | findMax = [ expBinding "main" $ lam [] $
app (var "listReduce")
[("listReduce_list", listOf $ lit . Number <$> [1,3,5,9,8,7,6,4,2])
,("listReduce_base", lit . Number $ 0)
,("listReduce_merge_curr", lamArgId "findMax_curr")
... | 1,290 | false | true | 0 | 17 | 704 | 274 | 150 | 124 | null | null |
schernichkin/supervised-concurrency | src/Control/Concurrent/Supervised.hs | bsd-3-clause | spawn :: (MonadSupervisor m) => m () -> m ThreadId
spawn = spawn' Nothing | 73 | spawn :: (MonadSupervisor m) => m () -> m ThreadId
spawn = spawn' Nothing | 73 | spawn = spawn' Nothing | 22 | false | true | 0 | 9 | 13 | 41 | 18 | 23 | null | null |
weeeeeew/petulant-cyril | exercise1/mergesort.hs | unlicense | pmsort :: Ord a => [a] -> [a]
pmsort [a] = [a] | 60 | pmsort :: Ord a => [a] -> [a]
pmsort [a] = [a] | 60 | pmsort [a] = [a] | 30 | false | true | 0 | 7 | 25 | 37 | 20 | 17 | null | null |
olsner/ghc | compiler/utils/BooleanFormula.hs | bsd-3-clause | -- we have all of xs, so one of them implying y is enough
Or xs `impliesAtom` y = all (\x -> (unLoc x) `impliesAtom` y) xs | 123 | Or xs `impliesAtom` y = all (\x -> (unLoc x) `impliesAtom` y) xs | 65 | Or xs `impliesAtom` y = all (\x -> (unLoc x) `impliesAtom` y) xs | 65 | true | false | 0 | 10 | 27 | 43 | 23 | 20 | null | null |
Zankoku-Okuno/ammonite | Language/Ammonite/Interpreter/Evaluator.hs | gpl-3.0 | apply f@(PrimAp _ _ _) (ThunkVal thunk_cell) pos = do
thunk <- liftIO $ readIORef thunk_cell
case thunk of
Left v -> apply f v pos
Right (e, env) -> do
pushCont (ApCont f, pos)
pushCont (ThunkCont thunk_cell, pos)
swapEnv env
elaborate e | 309 | apply f@(PrimAp _ _ _) (ThunkVal thunk_cell) pos = do
thunk <- liftIO $ readIORef thunk_cell
case thunk of
Left v -> apply f v pos
Right (e, env) -> do
pushCont (ApCont f, pos)
pushCont (ThunkCont thunk_cell, pos)
swapEnv env
elaborate e | 309 | apply f@(PrimAp _ _ _) (ThunkVal thunk_cell) pos = do
thunk <- liftIO $ readIORef thunk_cell
case thunk of
Left v -> apply f v pos
Right (e, env) -> do
pushCont (ApCont f, pos)
pushCont (ThunkCont thunk_cell, pos)
swapEnv env
elaborate e | 309 | false | false | 0 | 14 | 114 | 126 | 58 | 68 | null | null |
TOSPIO/yi | src/library/Yi/Mode/Haskell/Dollarify.hs | gpl-2.0 | isSimpleP (H.PAtom t _) = tokT t `elem` [Number, CharTok, StringTok, VarIdent, ConsIdent] | 89 | isSimpleP (H.PAtom t _) = tokT t `elem` [Number, CharTok, StringTok, VarIdent, ConsIdent] | 89 | isSimpleP (H.PAtom t _) = tokT t `elem` [Number, CharTok, StringTok, VarIdent, ConsIdent] | 89 | false | false | 0 | 8 | 12 | 43 | 24 | 19 | null | null |
tidalcycles/tidal-midi | Sound/Tidal/MIDI/Tetra.hs | gpl-3.0 | dpw = doublePattern 8 | 21 | dpw = doublePattern 8 | 21 | dpw = doublePattern 8 | 21 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
kaizhang/HMM | src/AI/Function.hs | bsd-3-clause | logSumExpM :: (PrimMonad m, GM.MVector v Double) => v (PrimState m) Double -> m Double
logSumExpM xs = do
m <- U.foldM' (\acc i -> return . max acc =<< GM.unsafeRead xs i) (-1/0) . U.enumFromN 0 $ n
let f acc i = do
x <- GM.unsafeRead xs i
return $ acc + exp (x-m)
s <- U.foldM' f 0 .... | 392 | logSumExpM :: (PrimMonad m, GM.MVector v Double) => v (PrimState m) Double -> m Double
logSumExpM xs = do
m <- U.foldM' (\acc i -> return . max acc =<< GM.unsafeRead xs i) (-1/0) . U.enumFromN 0 $ n
let f acc i = do
x <- GM.unsafeRead xs i
return $ acc + exp (x-m)
s <- U.foldM' f 0 .... | 392 | logSumExpM xs = do
m <- U.foldM' (\acc i -> return . max acc =<< GM.unsafeRead xs i) (-1/0) . U.enumFromN 0 $ n
let f acc i = do
x <- GM.unsafeRead xs i
return $ acc + exp (x-m)
s <- U.foldM' f 0 . U.enumFromN 0 $ n
return $! m + log s
where
n = GM.length xs
| 305 | false | true | 1 | 15 | 123 | 225 | 103 | 122 | null | null |
kim/amazonka | amazonka-emr/gen/Network/AWS/EMR/Types.hs | mpl-2.0 | -- | 'InstanceGroup' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'igBidPrice' @::@ 'Maybe' 'Text'
--
-- * 'igId' @::@ 'Maybe' 'Text'
--
-- * 'igInstanceGroupType' @::@ 'Maybe' 'InstanceGroupType'
--
-- * 'igInstanceType' @::@ 'Maybe' 'Text'
--
-- * 'igMarket' @::@ 'Maybe' 'MarketT... | 969 | instanceGroup :: InstanceGroup
instanceGroup = InstanceGroup
{ _igId = Nothing
, _igName = Nothing
, _igMarket = Nothing
, _igInstanceGroupType = Nothing
, _igBidPrice = Nothing
, _igInstanceType = Nothing
, _... | 444 | instanceGroup = InstanceGroup
{ _igId = Nothing
, _igName = Nothing
, _igMarket = Nothing
, _igInstanceGroupType = Nothing
, _igBidPrice = Nothing
, _igInstanceType = Nothing
, _igRequestedInstanceCount = Noth... | 413 | true | true | 0 | 7 | 260 | 93 | 66 | 27 | null | null |
raichoo/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reifyTTConstApp f (Constant c@(Str _))
| f == reflm "Str" = return $ c | 86 | reifyTTConstApp f (Constant c@(Str _))
| f == reflm "Str" = return $ c | 86 | reifyTTConstApp f (Constant c@(Str _))
| f == reflm "Str" = return $ c | 86 | false | false | 0 | 10 | 29 | 43 | 20 | 23 | null | null |
csabahruska/gpipe-quake3 | ShaderParser.hs | bsd-3-clause | -- sort portal|sky|opaque|banner|underwater|additive|nearest|[number]
sort = (\_ i ca -> ca {caSort = i}) <$> kw "sort" <*> (
val 1 "portal" <|>
val 2 "sky" <|>
val 3 "opaque" <|>
val 4 "decal" <|>
val 5 "seethrough" <|>
val 6 "banner" <|>
val 10 "additive" <|... | 386 | sort = (\_ i ca -> ca {caSort = i}) <$> kw "sort" <*> (
val 1 "portal" <|>
val 2 "sky" <|>
val 3 "opaque" <|>
val 4 "decal" <|>
val 5 "seethrough" <|>
val 6 "banner" <|>
val 10 "additive" <|>
val 16 "nearest" <|>
val 8 "underwater" <|>
int) | 316 | sort = (\_ i ca -> ca {caSort = i}) <$> kw "sort" <*> (
val 1 "portal" <|>
val 2 "sky" <|>
val 3 "opaque" <|>
val 4 "decal" <|>
val 5 "seethrough" <|>
val 6 "banner" <|>
val 10 "additive" <|>
val 16 "nearest" <|>
val 8 "underwater" <|>
int) | 316 | true | false | 3 | 17 | 130 | 127 | 59 | 68 | null | null |
TomMD/cryptol | notebook/Notebook.hs | bsd-3-clause | getTopDecls :: NB NamedDecls
getTopDecls = eNamedDecls `fmap` getRW | 67 | getTopDecls :: NB NamedDecls
getTopDecls = eNamedDecls `fmap` getRW | 67 | getTopDecls = eNamedDecls `fmap` getRW | 38 | false | true | 0 | 5 | 8 | 20 | 11 | 9 | null | null |
ihc/futhark | src/Futhark/Optimise/MemoryBlockMerging/Existentials.hs | isc | lookInStm :: LoreConstraints lore =>
Stm lore -> FindM lore ()
lookInStm (Let (Pattern patctxelems patvalelems) _ e) = do
forM_ patvalelems $ \(PatElem var _ membound) ->
case membound of
ExpMem.MemArray _ _ _ (ExpMem.ArrayIn mem _) ->
when (mem `L.elem` map patElemName patctxelems)
... | 1,055 | lookInStm :: LoreConstraints lore =>
Stm lore -> FindM lore ()
lookInStm (Let (Pattern patctxelems patvalelems) _ e) = do
forM_ patvalelems $ \(PatElem var _ membound) ->
case membound of
ExpMem.MemArray _ _ _ (ExpMem.ArrayIn mem _) ->
when (mem `L.elem` map patElemName patctxelems)
... | 1,055 | lookInStm (Let (Pattern patctxelems patvalelems) _ e) = do
forM_ patvalelems $ \(PatElem var _ membound) ->
case membound of
ExpMem.MemArray _ _ _ (ExpMem.ArrayIn mem _) ->
when (mem `L.elem` map patElemName patctxelems)
$ record var
_ -> return ()
case e of
DoLoop mergectxparam... | 979 | false | true | 1 | 21 | 314 | 346 | 171 | 175 | null | null |
brodyberg/LearnHaskell | CaesarCypher.hsproj/Nim.hs | mit | nim :: IO ()
nim = play initial 1 | 33 | nim :: IO ()
nim = play initial 1 | 33 | nim = play initial 1 | 20 | false | true | 0 | 6 | 8 | 21 | 10 | 11 | null | null |
GregorySchwartz/split-by-gene | app/Main.hs | gpl-2.0 | -- Command line options
options :: Parser Options
options = Options
<$> strOption
( long "input"
<> short 'i'
<> metavar "FILE"
<> value ""
<> help "The input fasta file. If nothing, then stdin" ) | 248 | options :: Parser Options
options = Options
<$> strOption
( long "input"
<> short 'i'
<> metavar "FILE"
<> value ""
<> help "The input fasta file. If nothing, then stdin" ) | 224 | options = Options
<$> strOption
( long "input"
<> short 'i'
<> metavar "FILE"
<> value ""
<> help "The input fasta file. If nothing, then stdin" ) | 198 | true | true | 0 | 12 | 87 | 56 | 26 | 30 | null | null |
rgaiacs/pandoc | src/Text/Pandoc/Writers/HTML.hs | gpl-2.0 | obfuscateLink :: WriterOptions -> Html -> String -> Html
obfuscateLink opts txt s | writerEmailObfuscation opts == NoObfuscation =
H.a ! A.href (toValue s) $ txt | 163 | obfuscateLink :: WriterOptions -> Html -> String -> Html
obfuscateLink opts txt s | writerEmailObfuscation opts == NoObfuscation =
H.a ! A.href (toValue s) $ txt | 163 | obfuscateLink opts txt s | writerEmailObfuscation opts == NoObfuscation =
H.a ! A.href (toValue s) $ txt | 106 | false | true | 0 | 10 | 27 | 64 | 30 | 34 | null | null |
bitemyapp/ganeti | src/Ganeti/OpParams.hs | bsd-2-clause | pRebootType :: Field
pRebootType =
withDoc "How to reboot the instance" $
simpleField "reboot_type" [t| RebootType |] | 121 | pRebootType :: Field
pRebootType =
withDoc "How to reboot the instance" $
simpleField "reboot_type" [t| RebootType |] | 121 | pRebootType =
withDoc "How to reboot the instance" $
simpleField "reboot_type" [t| RebootType |] | 100 | false | true | 0 | 6 | 20 | 27 | 15 | 12 | null | null |
GaloisInc/halvm-ghc | compiler/types/Type.hs | bsd-3-clause | mkAppTys ty1 tys2 = foldl AppTy ty1 tys2 | 55 | mkAppTys ty1 tys2 = foldl AppTy ty1 tys2 | 55 | mkAppTys ty1 tys2 = foldl AppTy ty1 tys2 | 55 | false | false | 0 | 5 | 22 | 19 | 8 | 11 | null | null |
sdiehl/ghc | compiler/main/HscTypes.hs | bsd-3-clause | -- | Returns @True@ if there should be no interface-file declaration
-- for this thing on its own: either it is built-in, or it is part
-- of some other declaration, or it is generated implicitly by some
-- other declaration.
isImplicitTyThing :: TyThing -> Bool
isImplicitTyThing (AConLike cl) = case cl of
... | 426 | isImplicitTyThing :: TyThing -> Bool
isImplicitTyThing (AConLike cl) = case cl of
RealDataCon {} -> True
PatSynCon {} -> False | 200 | isImplicitTyThing (AConLike cl) = case cl of
RealDataCon {} -> True
PatSynCon {} -> False | 163 | true | true | 0 | 8 | 134 | 52 | 28 | 24 | null | null |
brendanhay/gogol | gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'SplitInt64' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'siHighBits'
--
-- * 'siLowBits'
splitInt64
:: SplitInt64
splitInt64 = SplitInt64' {_siHighBits = Nothing, _siLowBits = Nothing} | 302 | splitInt64
:: SplitInt64
splitInt64 = SplitInt64' {_siHighBits = Nothing, _siLowBits = Nothing} | 99 | splitInt64 = SplitInt64' {_siHighBits = Nothing, _siLowBits = Nothing} | 70 | true | true | 0 | 6 | 53 | 32 | 22 | 10 | null | null |
copumpkin/vector-static | Data/Vector/Unboxed/Static.hs | bsd-3-clause | tail (Vec vs) = Vec (G.tail vs) | 31 | tail (Vec vs) = Vec (G.tail vs) | 31 | tail (Vec vs) = Vec (G.tail vs) | 31 | false | false | 0 | 8 | 6 | 26 | 12 | 14 | null | null |
frontrowed/wai | warp/Network/Wai/Handler/Warp/Buffer.hs | mit | ----------------------------------------------------------------
--
-- Utilities
--
toBuilderBuffer :: Buffer -> BufSize -> IO B.Buffer
toBuilderBuffer ptr size = do
fptr <- newForeignPtr_ ptr
return $ B.Buffer fptr ptr ptr (ptr `plusPtr` size)
-- | Copying the bytestring to the buffer.
-- This function ret... | 368 | toBuilderBuffer :: Buffer -> BufSize -> IO B.Buffer
toBuilderBuffer ptr size = do
fptr <- newForeignPtr_ ptr
return $ B.Buffer fptr ptr ptr (ptr `plusPtr` size)
-- | Copying the bytestring to the buffer.
-- This function returns the point where the next copy should start. | 283 | toBuilderBuffer ptr size = do
fptr <- newForeignPtr_ ptr
return $ B.Buffer fptr ptr ptr (ptr `plusPtr` size)
-- | Copying the bytestring to the buffer.
-- This function returns the point where the next copy should start. | 231 | true | true | 0 | 10 | 62 | 72 | 38 | 34 | null | null |
sdiehl/ghc | compiler/backpack/DriverBkp.hs | bsd-3-clause | -- | Get the nesting level, when recursively compiling modules.
getBkpLevel :: BkpM Int
getBkpLevel = bkp_level `fmap` getBkpEnv | 128 | getBkpLevel :: BkpM Int
getBkpLevel = bkp_level `fmap` getBkpEnv | 64 | getBkpLevel = bkp_level `fmap` getBkpEnv | 40 | true | true | 0 | 5 | 18 | 21 | 12 | 9 | null | null |
bitemyapp/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | exitNotmaster :: Int
exitNotmaster = 11 | 39 | exitNotmaster :: Int
exitNotmaster = 11 | 39 | exitNotmaster = 11 | 18 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
iqsf/HFitUI | src/WebUI/Scripts/JavaScript/HJSMath.hs | bsd-3-clause | mathLog x = HL $ "Math.log()" ++ (buildHSL_L hbConf x) ++ ")" | 67 | mathLog x = HL $ "Math.log()" ++ (buildHSL_L hbConf x) ++ ")" | 67 | mathLog x = HL $ "Math.log()" ++ (buildHSL_L hbConf x) ++ ")" | 67 | false | false | 0 | 8 | 17 | 29 | 14 | 15 | null | null |
blasterpal/my_migrate | lib/parse.hs | mit | statement :: GenParser Char st Statement
statement = dropTable <|> createTable | 78 | statement :: GenParser Char st Statement
statement = dropTable <|> createTable | 78 | statement = dropTable <|> createTable | 37 | false | true | 3 | 6 | 10 | 31 | 14 | 17 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/cabal-install/Distribution/Client/Setup.hs | bsd-3-clause | defaultGetFlags :: GetFlags
defaultGetFlags = GetFlags {
getDestDir = mempty,
getPristine = mempty,
getSourceRepository = mempty,
getVerbosity = toFlag normal
} | 203 | defaultGetFlags :: GetFlags
defaultGetFlags = GetFlags {
getDestDir = mempty,
getPristine = mempty,
getSourceRepository = mempty,
getVerbosity = toFlag normal
} | 203 | defaultGetFlags = GetFlags {
getDestDir = mempty,
getPristine = mempty,
getSourceRepository = mempty,
getVerbosity = toFlag normal
} | 175 | false | true | 0 | 8 | 63 | 50 | 26 | 24 | null | null |
ezrakilty/narc | Database/Narc/Embed.hs | bsd-2-clause | -- | Project a field out of a record value.
project :: NarcTerm -> String -> NarcTerm
project expr field = (!) <$> (Project <$> expr <*> return field) | 150 | project :: NarcTerm -> String -> NarcTerm
project expr field = (!) <$> (Project <$> expr <*> return field) | 106 | project expr field = (!) <$> (Project <$> expr <*> return field) | 64 | true | true | 0 | 8 | 28 | 45 | 24 | 21 | null | null |
urbanslug/ghc | compiler/main/HscMain.hs | bsd-3-clause | tcRnModule' :: HscEnv -> ModSummary -> Bool -> HsParsedModule
-> Hsc TcGblEnv
tcRnModule' hsc_env sum save_rn_syntax mod = do
tcg_res <- {-# SCC "Typecheck-Rename" #-}
ioMsgMaybe $
tcRnModule hsc_env (ms_hsc_src sum) save_rn_syntax mod
-- See Note [Safe Haskell Ove... | 1,839 | tcRnModule' :: HscEnv -> ModSummary -> Bool -> HsParsedModule
-> Hsc TcGblEnv
tcRnModule' hsc_env sum save_rn_syntax mod = do
tcg_res <- {-# SCC "Typecheck-Rename" #-}
ioMsgMaybe $
tcRnModule hsc_env (ms_hsc_src sum) save_rn_syntax mod
-- See Note [Safe Haskell Ove... | 1,839 | tcRnModule' hsc_env sum save_rn_syntax mod = do
tcg_res <- {-# SCC "Typecheck-Rename" #-}
ioMsgMaybe $
tcRnModule hsc_env (ms_hsc_src sum) save_rn_syntax mod
-- See Note [Safe Haskell Overlapping Instances Implementation]
-- although this is used for more than just that fa... | 1,749 | false | true | 7 | 22 | 562 | 414 | 188 | 226 | null | null |
brendanhay/gogol | gogol-dlp/gen/Network/Google/Resource/DLP/Projects/Locations/Content/Deidentify.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
plcdUploadType :: Lens' ProjectsLocationsContentDeidentify (Maybe Text)
plcdUploadType
= lens _plcdUploadType
(\ s a -> s{_plcdUploadType = a}) | 222 | plcdUploadType :: Lens' ProjectsLocationsContentDeidentify (Maybe Text)
plcdUploadType
= lens _plcdUploadType
(\ s a -> s{_plcdUploadType = a}) | 151 | plcdUploadType
= lens _plcdUploadType
(\ s a -> s{_plcdUploadType = a}) | 79 | true | true | 0 | 9 | 34 | 48 | 25 | 23 | null | null |
mimi1vx/cabal-rpm | src/Commands/Spec.hs | gpl-3.0 | findDocs :: FilePath -> [FilePath] -> IO [FilePath]
findDocs cabalPath licensefiles = do
contents <- getDirectoryContents $ dropFileName cabalPath
let docs = filter likely contents
return $ if null licensefiles
then docs
else filter unlikely $ filter (`notElem` licensefiles) docs
where nam... | 617 | findDocs :: FilePath -> [FilePath] -> IO [FilePath]
findDocs cabalPath licensefiles = do
contents <- getDirectoryContents $ dropFileName cabalPath
let docs = filter likely contents
return $ if null licensefiles
then docs
else filter unlikely $ filter (`notElem` licensefiles) docs
where nam... | 617 | findDocs cabalPath licensefiles = do
contents <- getDirectoryContents $ dropFileName cabalPath
let docs = filter likely contents
return $ if null licensefiles
then docs
else filter unlikely $ filter (`notElem` licensefiles) docs
where names = ["author", "changelog", "copying", "doc", "exam... | 565 | false | true | 2 | 11 | 160 | 197 | 105 | 92 | null | null |
gamelost/pcgen-rules | src/Lst/GlobalTags.hs | apache-2.0 | parseSourceLong :: PParser String
parseSourceLong = tag "SOURCELONG" >> restOfTag | 81 | parseSourceLong :: PParser String
parseSourceLong = tag "SOURCELONG" >> restOfTag | 81 | parseSourceLong = tag "SOURCELONG" >> restOfTag | 47 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
jwiegley/ghc-release | libraries/base/Control/Monad.hs | gpl-3.0 | -- -----------------------------------------------------------------------------
-- Other monad functions
-- | The 'join' function is the conventional monad join operator. It is used to
-- remove one level of monadic structure, projecting its bound argument into the
-- outer level.
join :: (Monad m) => m ... | 362 | join :: (Monad m) => m (m a) -> m a
join x = x >>= id | 78 | join x = x >>= id | 29 | true | true | 0 | 9 | 79 | 48 | 26 | 22 | null | null |
avieth/Authenticake | Authenticake/Authenticate.hs | mit | withAuthentication
:: forall ctx t m a .
( AuthenticationContext ctx t
, Authenticates ctx t
, Authenticator (AuthenticationAgent ctx t)
, Functor m
, Monad m
)
=> ctx
-> (forall r . AuthenticatorF (AuthenticationAgent ctx t) r -> m r)
-> t
-> Challenge (AuthenticationAgent ctx t... | 795 | withAuthentication
:: forall ctx t m a .
( AuthenticationContext ctx t
, Authenticates ctx t
, Authenticator (AuthenticationAgent ctx t)
, Functor m
, Monad m
)
=> ctx
-> (forall r . AuthenticatorF (AuthenticationAgent ctx t) r -> m r)
-> t
-> Challenge (AuthenticationAgent ctx t... | 795 | withAuthentication ctx lifter datum challenge term = do
let subject = toSubject ctx datum
let agent = authenticationAgent ctx (Proxy :: Proxy t)
decision <- lifter $ authenticate agent (Proxy :: Proxy t) subject challenge
case decision of
Just reason -> return (AuthenticationFailed reason)
... | 404 | false | true | 0 | 15 | 190 | 285 | 139 | 146 | null | null |
noteed/rescoyl-checks | Network/Docker/Registry/Checks.hs | bsd-3-clause | checkPushImageLayer :: Int -> String -> Repository -> Image -> Test
checkPushImageLayer n title r i = TestLabel title $ TestCase $
pushImageLayer r i >>= expectCode n | 168 | checkPushImageLayer :: Int -> String -> Repository -> Image -> Test
checkPushImageLayer n title r i = TestLabel title $ TestCase $
pushImageLayer r i >>= expectCode n | 168 | checkPushImageLayer n title r i = TestLabel title $ TestCase $
pushImageLayer r i >>= expectCode n | 100 | false | true | 2 | 8 | 29 | 66 | 30 | 36 | null | null |
green-haskell/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- Generics (constructors and functions)
u1DataCon_RDR, par1DataCon_RDR, rec1DataCon_RDR,
k1DataCon_RDR, m1DataCon_RDR, l1DataCon_RDR, r1DataCon_RDR,
prodDataCon_RDR, comp1DataCon_RDR,
unPar1_RDR, unRec1_RDR, unK1_RDR, unComp1_RDR,
from_RDR, from1_RDR, to_RDR, to1_RDR,
datatypeName_RDR, moduleName_RDR, isNewt... | 608 | u1DataCon_RDR, par1DataCon_RDR, rec1DataCon_RDR,
k1DataCon_RDR, m1DataCon_RDR, l1DataCon_RDR, r1DataCon_RDR,
prodDataCon_RDR, comp1DataCon_RDR,
unPar1_RDR, unRec1_RDR, unK1_RDR, unComp1_RDR,
from_RDR, from1_RDR, to_RDR, to1_RDR,
datatypeName_RDR, moduleName_RDR, isNewtypeName_RDR,
conName_RDR, conFixity_RDR... | 566 | u1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "U1") | 57 | true | true | 0 | 7 | 65 | 83 | 72 | 11 | null | null |
SeanRBurton/spaceprobe | Control/SpaceProbe/Internal/Probe.hs | bsd-3-clause | -- | Sample from the normal distribution with given mean and standard
-- deviation
normal :: (Eq a, InvErf a) => a -> a -> Probe a
normal mu sigma = (\x -> x * sigma + mu) <$> distribution invnormcdf | 199 | normal :: (Eq a, InvErf a) => a -> a -> Probe a
normal mu sigma = (\x -> x * sigma + mu) <$> distribution invnormcdf | 116 | normal mu sigma = (\x -> x * sigma + mu) <$> distribution invnormcdf | 68 | true | true | 0 | 9 | 40 | 67 | 35 | 32 | null | null |
4ZP6Capstone2015/ampersand | src/Database/Design/Ampersand/ADL1/Lattices.hs | gpl-3.0 | listAndRest :: [t] -> [(t, [t])]
listAndRest [] = [] | 52 | listAndRest :: [t] -> [(t, [t])]
listAndRest [] = [] | 52 | listAndRest [] = [] | 19 | false | true | 0 | 8 | 9 | 37 | 21 | 16 | null | null |
Teaspot-Studio/GPipe-Core | src/Graphics/GPipe/Internal/FrameBuffer.hs | mit | getGlLogicOp Invert = GL_INVERT | 31 | getGlLogicOp Invert = GL_INVERT | 31 | getGlLogicOp Invert = GL_INVERT | 31 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ndmitchell/shake | src/General/Ids.hs | bsd-3-clause | forMutate :: Ids a -> (a -> a) -> IO ()
forMutate (Ids ref) f = do
S{..} <- readIORef ref
let go !i | i >= used = pure ()
| otherwise = do
v <- readArray values i
whenJust v $ \v -> writeArray values i $! Just $! f v
go $ i+1
go 0 | 304 | forMutate :: Ids a -> (a -> a) -> IO ()
forMutate (Ids ref) f = do
S{..} <- readIORef ref
let go !i | i >= used = pure ()
| otherwise = do
v <- readArray values i
whenJust v $ \v -> writeArray values i $! Just $! f v
go $ i+1
go 0 | 304 | forMutate (Ids ref) f = do
S{..} <- readIORef ref
let go !i | i >= used = pure ()
| otherwise = do
v <- readArray values i
whenJust v $ \v -> writeArray values i $! Just $! f v
go $ i+1
go 0 | 264 | false | true | 0 | 17 | 131 | 158 | 70 | 88 | null | null |
nevrenato/HetsAlloy | Common/Lexer.hs | gpl-2.0 | simpleEscape :: CharParser st String
simpleEscape = single (oneOf "'\"\\ntrvbfa?") | 82 | simpleEscape :: CharParser st String
simpleEscape = single (oneOf "'\"\\ntrvbfa?") | 82 | simpleEscape = single (oneOf "'\"\\ntrvbfa?") | 45 | false | true | 0 | 7 | 9 | 31 | 13 | 18 | null | null |
mdsteele/pylos | src/Pylos/Draw.hs | gpl-3.0 | getRelativeMousePos :: (MonadHandler m) => m (Maybe IPoint)
getRelativeMousePos = runHandler $ Handler $ \rect -> do
suppressed <- readIORef inputsSuppressed
if suppressed then return Nothing else do
(absoluteMouseX, absoluteMouseY, _) <- SDL.getMouseState
return $ Just $ Point (absoluteMouseX - rectX rect)
... | 370 | getRelativeMousePos :: (MonadHandler m) => m (Maybe IPoint)
getRelativeMousePos = runHandler $ Handler $ \rect -> do
suppressed <- readIORef inputsSuppressed
if suppressed then return Nothing else do
(absoluteMouseX, absoluteMouseY, _) <- SDL.getMouseState
return $ Just $ Point (absoluteMouseX - rectX rect)
... | 370 | getRelativeMousePos = runHandler $ Handler $ \rect -> do
suppressed <- readIORef inputsSuppressed
if suppressed then return Nothing else do
(absoluteMouseX, absoluteMouseY, _) <- SDL.getMouseState
return $ Just $ Point (absoluteMouseX - rectX rect)
(absoluteMouseY - rectY rect) | 310 | false | true | 0 | 16 | 77 | 120 | 60 | 60 | null | null |
vTurbine/ghc | compiler/stgSyn/StgSyn.hs | bsd-3-clause | bindHasCafRefs :: GenStgBinding bndr Id -> Bool
bindHasCafRefs (StgNonRec _ rhs)
= rhsHasCafRefs rhs | 102 | bindHasCafRefs :: GenStgBinding bndr Id -> Bool
bindHasCafRefs (StgNonRec _ rhs)
= rhsHasCafRefs rhs | 102 | bindHasCafRefs (StgNonRec _ rhs)
= rhsHasCafRefs rhs | 54 | false | true | 0 | 7 | 15 | 34 | 16 | 18 | null | null |
yliu120/K3 | src/Language/K3/Analysis/Provenance/Inference.hs | apache-2.0 | pilkupas :: PIEnv -> Identifier -> Either Text PMEnv
pilkupas env x = palkups (paenv env) x | 91 | pilkupas :: PIEnv -> Identifier -> Either Text PMEnv
pilkupas env x = palkups (paenv env) x | 91 | pilkupas env x = palkups (paenv env) x | 38 | false | true | 0 | 7 | 16 | 40 | 19 | 21 | null | null |
jrraymond/ray-tracer | src/Surfaces.hs | gpl-3.0 | avgColors :: [Color] -> Color
avgColors cs = let mixed = foldl' (mixColors (+)) (Color 0 0 0) cs
in scaleColor (/ fromIntegral (length cs)) mixed | 160 | avgColors :: [Color] -> Color
avgColors cs = let mixed = foldl' (mixColors (+)) (Color 0 0 0) cs
in scaleColor (/ fromIntegral (length cs)) mixed | 160 | avgColors cs = let mixed = foldl' (mixColors (+)) (Color 0 0 0) cs
in scaleColor (/ fromIntegral (length cs)) mixed | 130 | false | true | 0 | 11 | 40 | 80 | 39 | 41 | null | null |
sulami/tinfoilsub | src/Web/Scraper.hs | bsd-3-clause | filterVideos :: Feed -> Maybe [Video] -> [Video]
filterVideos _ Nothing = [] | 80 | filterVideos :: Feed -> Maybe [Video] -> [Video]
filterVideos _ Nothing = [] | 80 | filterVideos _ Nothing = [] | 31 | false | true | 0 | 9 | 16 | 41 | 19 | 22 | null | null |
jamessanders/easy-http | src/Network/EasyHttp/RFC2616.hs | bsd-3-clause | isToken :: Word8 -> Bool
isToken w = w <= 127 && notInClass "\0-\31()<>@,;:\\\"/[]?={} \t" w | 92 | isToken :: Word8 -> Bool
isToken w = w <= 127 && notInClass "\0-\31()<>@,;:\\\"/[]?={} \t" w | 92 | isToken w = w <= 127 && notInClass "\0-\31()<>@,;:\\\"/[]?={} \t" w | 67 | false | true | 2 | 7 | 15 | 38 | 17 | 21 | null | null |
justanotherdot/advent-linguist | 2016/Haskell/AdventOfCode/src/Day01.hs | mit | solveDay01 :: FilePath -> IO ()
solveDay01 pathToInput = do
putStrLn "Solution for day one: "
ls <- readFile pathToInput
let cleanInput = splitOn ", " ls
-- Part 1
print . calcAns . processCommands . commands $ cleanInput
-- Part 2
print . calcAns . walk . processCommands' . commands $ cleanInput
putStr... | 325 | solveDay01 :: FilePath -> IO ()
solveDay01 pathToInput = do
putStrLn "Solution for day one: "
ls <- readFile pathToInput
let cleanInput = splitOn ", " ls
-- Part 1
print . calcAns . processCommands . commands $ cleanInput
-- Part 2
print . calcAns . walk . processCommands' . commands $ cleanInput
putStr... | 325 | solveDay01 pathToInput = do
putStrLn "Solution for day one: "
ls <- readFile pathToInput
let cleanInput = splitOn ", " ls
-- Part 1
print . calcAns . processCommands . commands $ cleanInput
-- Part 2
print . calcAns . walk . processCommands' . commands $ cleanInput
putStrLn "" | 293 | false | true | 0 | 12 | 70 | 108 | 48 | 60 | null | null |
alephcloud/hs-aws-kinesis-client | src/Aws/Kinesis/Client/Producer.hs | apache-2.0 | splitEvery n list = first : splitEvery n rest
where
(first,rest) = splitAt (fromIntegral n) list
-- | A conduit for sending records to Kinesis using the @PutRecords@ endpoint.
-- This is a conduit in order to restore failed messages as leftovers.
-- | 256 | splitEvery n list = first : splitEvery n rest
where
(first,rest) = splitAt (fromIntegral n) list
-- | A conduit for sending records to Kinesis using the @PutRecords@ endpoint.
-- This is a conduit in order to restore failed messages as leftovers.
-- | 256 | splitEvery n list = first : splitEvery n rest
where
(first,rest) = splitAt (fromIntegral n) list
-- | A conduit for sending records to Kinesis using the @PutRecords@ endpoint.
-- This is a conduit in order to restore failed messages as leftovers.
-- | 256 | false | false | 0 | 7 | 49 | 49 | 25 | 24 | null | null |
pocket7878/mini-reg | src/DFA.hs | gpl-3.0 | matchRule :: (Eq a) => Input b -> State a -> [Rule a b] -> Maybe (Rule a b)
matchRule (Input i) cs rs = find (\(Rule c f _) -> (cs == c) && (f i)) rs | 150 | matchRule :: (Eq a) => Input b -> State a -> [Rule a b] -> Maybe (Rule a b)
matchRule (Input i) cs rs = find (\(Rule c f _) -> (cs == c) && (f i)) rs | 150 | matchRule (Input i) cs rs = find (\(Rule c f _) -> (cs == c) && (f i)) rs | 74 | false | true | 0 | 11 | 38 | 110 | 55 | 55 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/product_2.hs | mit | primMulInt (Neg x) (Pos y) = Neg (primMulNat x y) | 49 | primMulInt (Neg x) (Pos y) = Neg (primMulNat x y) | 49 | primMulInt (Neg x) (Pos y) = Neg (primMulNat x y) | 49 | false | false | 0 | 7 | 9 | 34 | 16 | 18 | null | null |
opqdonut/riot | Riot/Style.hs | gpl-2.0 | uiattr_set a "attr_text" v = a{attr_text = v} | 45 | uiattr_set a "attr_text" v = a{attr_text = v} | 45 | uiattr_set a "attr_text" v = a{attr_text = v} | 45 | false | false | 0 | 6 | 7 | 21 | 11 | 10 | null | null |
JPMoresmau/leksah-server | tests/TestTool.hs | gpl-2.0 | -- stderr and stdout may not be in sync
check output expected = do
checkFiltered notOut
checkFiltered notErr
where
checkFiltered f = filter f output @?= filter f expected
notErr (ToolError _) = False
notErr _ = True
notOut (ToolOutput _) = False
notOut _ = True | 291 | check output expected = do
checkFiltered notOut
checkFiltered notErr
where
checkFiltered f = filter f output @?= filter f expected
notErr (ToolError _) = False
notErr _ = True
notOut (ToolOutput _) = False
notOut _ = True | 251 | check output expected = do
checkFiltered notOut
checkFiltered notErr
where
checkFiltered f = filter f output @?= filter f expected
notErr (ToolError _) = False
notErr _ = True
notOut (ToolOutput _) = False
notOut _ = True | 251 | true | false | 0 | 7 | 76 | 93 | 43 | 50 | null | null |
conal/reification-rules | src/ReificationRules/Plugin.hs | bsd-3-clause | -- Swiped from HERMIT.GHC
-- | Get the fully qualified name from a 'Name'.
qualifiedName :: Name -> String
qualifiedName nm = modStr ++ getOccString nm
where modStr = maybe "" (\m -> moduleNameString (moduleName m) ++ ".") (nameModule_maybe nm)
-- | Substitute new subexpressions for variables in an expression | 315 | qualifiedName :: Name -> String
qualifiedName nm = modStr ++ getOccString nm
where modStr = maybe "" (\m -> moduleNameString (moduleName m) ++ ".") (nameModule_maybe nm)
-- | Substitute new subexpressions for variables in an expression | 240 | qualifiedName nm = modStr ++ getOccString nm
where modStr = maybe "" (\m -> moduleNameString (moduleName m) ++ ".") (nameModule_maybe nm)
-- | Substitute new subexpressions for variables in an expression | 208 | true | true | 1 | 11 | 54 | 79 | 37 | 42 | null | null |
peterbecich/haskell-programming-first-principles | src/Chapter20.hs | bsd-3-clause | maximum' :: (Foldable t, Ord a) => t a -> Maybe a
maximum' tx = foldr maximumHelper Nothing tx | 94 | maximum' :: (Foldable t, Ord a) => t a -> Maybe a
maximum' tx = foldr maximumHelper Nothing tx | 94 | maximum' tx = foldr maximumHelper Nothing tx | 44 | false | true | 0 | 7 | 18 | 46 | 22 | 24 | null | null |
meditans/hint | src/Hint/Eval.hs | bsd-3-clause | -- | @eval expr@ will evaluate @show expr@.
-- It will succeed only if @expr@ has type t and there is a 'Show'
-- instance for t.
eval :: MonadInterpreter m => String -> m String
eval expr = do in_scope_show <- supportShow
in_scope_String <- supportString
let show_expr = unwords [in_sc... | 945 | eval :: MonadInterpreter m => String -> m String
eval expr = do in_scope_show <- supportShow
in_scope_String <- supportString
let show_expr = unwords [in_scope_show, parens expr]
unsafeInterpret show_expr in_scope_String
-- | Conceptually, @parens s = \"(\" ++ s ++ \")\"@... | 813 | eval expr = do in_scope_show <- supportShow
in_scope_String <- supportString
let show_expr = unwords [in_scope_show, parens expr]
unsafeInterpret show_expr in_scope_String
-- | Conceptually, @parens s = \"(\" ++ s ++ \")\"@, where s is any valid haskell
-- expression. In ... | 764 | true | true | 0 | 12 | 210 | 82 | 43 | 39 | null | null |
green-haskell/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | patErrorIdKey = mkPreludeMiscIdUnique 14 | 56 | patErrorIdKey = mkPreludeMiscIdUnique 14 | 56 | patErrorIdKey = mkPreludeMiscIdUnique 14 | 56 | false | false | 0 | 5 | 19 | 9 | 4 | 5 | null | null |
zeckalpha/kyle.marek-spartz.org | site.hs | mit | urlOfPost :: Item String -> Compiler String
urlOfPost =
fmap (maybe empty toUrl) . getRoute . itemIdentifier | 110 | urlOfPost :: Item String -> Compiler String
urlOfPost =
fmap (maybe empty toUrl) . getRoute . itemIdentifier | 110 | urlOfPost =
fmap (maybe empty toUrl) . getRoute . itemIdentifier | 66 | false | true | 0 | 8 | 18 | 46 | 20 | 26 | null | null |
rueshyna/gogol | gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs | mpl-2.0 | -- | Width of the window.
fcWindowWidth :: Lens' FsCommand (Maybe Int32)
fcWindowWidth
= lens _fcWindowWidth
(\ s a -> s{_fcWindowWidth = a})
. mapping _Coerce | 173 | fcWindowWidth :: Lens' FsCommand (Maybe Int32)
fcWindowWidth
= lens _fcWindowWidth
(\ s a -> s{_fcWindowWidth = a})
. mapping _Coerce | 147 | fcWindowWidth
= lens _fcWindowWidth
(\ s a -> s{_fcWindowWidth = a})
. mapping _Coerce | 100 | true | true | 2 | 8 | 39 | 59 | 28 | 31 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.