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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
armoredsoftware/protocol | tpm/mainline/src/TPM/Const.hs | bsd-3-clause | tpm_key_migrate = (0x0016 :: Word16) | 36 | tpm_key_migrate = (0x0016 :: Word16) | 36 | tpm_key_migrate = (0x0016 :: Word16) | 36 | false | false | 0 | 5 | 4 | 12 | 7 | 5 | null | null |
athanclark/sets | src/Data/Set/Ordered/Many/With.hs | mit | lookupLT :: Ord k => a -> SetsWith k c a -> Maybe (c a)
lookupLT x (SetsWith (f,xs)) = snd <$> Map.lookupLT (f x) xs | 116 | lookupLT :: Ord k => a -> SetsWith k c a -> Maybe (c a)
lookupLT x (SetsWith (f,xs)) = snd <$> Map.lookupLT (f x) xs | 116 | lookupLT x (SetsWith (f,xs)) = snd <$> Map.lookupLT (f x) xs | 60 | false | true | 0 | 10 | 25 | 76 | 37 | 39 | null | null |
julienschmaltz/madl | src/Madl/Network.hs | mit | -- | The correct number of input and output ports for a macro
getRequiredPortsM :: XMacro b c -> (Int -> Bool, Int -> Bool)
getRequiredPortsM m = ((== length inports), (== length outports)) where
(inports, outports) = splitInterface m
-- | Find names assigned to multiple components/macroinstances/channels | 311 | getRequiredPortsM :: XMacro b c -> (Int -> Bool, Int -> Bool)
getRequiredPortsM m = ((== length inports), (== length outports)) where
(inports, outports) = splitInterface m
-- | Find names assigned to multiple components/macroinstances/channels | 249 | getRequiredPortsM m = ((== length inports), (== length outports)) where
(inports, outports) = splitInterface m
-- | Find names assigned to multiple components/macroinstances/channels | 187 | true | true | 0 | 9 | 52 | 81 | 43 | 38 | null | null |
lwm/haskellnews | src/HN/Controllers.hs | bsd-3-clause | -- | Grouped display.
grouped :: Controller Config PState ()
grouped = do
embeddable <- getStringMaybe "embeddable"
viewCached (Grouped (isJust embeddable)) $ do
groups <- forM allSources $ \source -> do
items <- model $ getItemsBySource source 10
return (source,items)
now <- io getZonedTime
... | 469 | grouped :: Controller Config PState ()
grouped = do
embeddable <- getStringMaybe "embeddable"
viewCached (Grouped (isJust embeddable)) $ do
groups <- forM allSources $ \source -> do
items <- model $ getItemsBySource source 10
return (source,items)
now <- io getZonedTime
return $ case embedda... | 447 | grouped = do
embeddable <- getStringMaybe "embeddable"
viewCached (Grouped (isJust embeddable)) $ do
groups <- forM allSources $ \source -> do
items <- model $ getItemsBySource source 10
return (source,items)
now <- io getZonedTime
return $ case embeddable of
Nothing -> V.grou... | 408 | true | true | 0 | 17 | 121 | 152 | 71 | 81 | null | null |
comatose/redo | src/Development/Redo/Config.hs | bsd-3-clause | printDebug :: String -> IO ()
printDebug s = when debugMode $ printWithColor [SetColor Foreground Vivid Yellow] s | 113 | printDebug :: String -> IO ()
printDebug s = when debugMode $ printWithColor [SetColor Foreground Vivid Yellow] s | 113 | printDebug s = when debugMode $ printWithColor [SetColor Foreground Vivid Yellow] s | 83 | false | true | 0 | 8 | 17 | 45 | 21 | 24 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/llvmGen/Llvm/PpLlvm.hs | bsd-3-clause | -- | Print out an LLVM type alias.
ppLlvmAlias :: LlvmAlias -> SDoc
ppLlvmAlias (name, ty)
= char '%' <> ftext name <+> equals <+> text "type" <+> ppr ty | 155 | ppLlvmAlias :: LlvmAlias -> SDoc
ppLlvmAlias (name, ty)
= char '%' <> ftext name <+> equals <+> text "type" <+> ppr ty | 120 | ppLlvmAlias (name, ty)
= char '%' <> ftext name <+> equals <+> text "type" <+> ppr ty | 87 | true | true | 0 | 9 | 31 | 53 | 26 | 27 | null | null |
fpco/statistics | Statistics/Quantile.hs | bsd-2-clause | -- | O(/n/ log /n/). Estimate the /k/th /q/-quantile of a sample /x/,
-- using the continuous sample method with the given parameters. This
-- is the method used by most statistical software, such as R,
-- Mathematica, SPSS, and S.
continuousBy :: G.Vector v Double =>
ContParam -- ^ Parameters /a/ and... | 1,273 | continuousBy :: G.Vector v Double =>
ContParam -- ^ Parameters /a/ and /b/.
-> Int -- ^ /k/, the desired quantile.
-> Int -- ^ /q/, the number of quantiles.
-> v Double -- ^ /x/, the sample data.
-> Double
continuousBy (ContParam a b) ... | 1,040 | continuousBy (ContParam a b) k q x
| q < 2 = modErr "continuousBy" "At least 2 quantiles is needed"
| k < 0 || k > q = modErr "continuousBy" "Wrong quantile number"
| G.any isNaN x = modErr "continuousBy" "Sample contains NaNs"
| otherwise = (1-h) * item (j-1) + h * item j
where
j ... | 749 | true | true | 9 | 15 | 483 | 348 | 173 | 175 | null | null |
mettekou/ghc | compiler/types/TyCoRep.hs | bsd-3-clause | extendTvSubstAndInScope :: TCvSubst -> TyVar -> Type -> TCvSubst
-- Also extends the in-scope set
extendTvSubstAndInScope (TCvSubst in_scope tenv cenv) tv ty
= TCvSubst (in_scope `extendInScopeSetSet` tyCoVarsOfType ty)
(extendVarEnv tenv tv ty)
cenv | 278 | extendTvSubstAndInScope :: TCvSubst -> TyVar -> Type -> TCvSubst
extendTvSubstAndInScope (TCvSubst in_scope tenv cenv) tv ty
= TCvSubst (in_scope `extendInScopeSetSet` tyCoVarsOfType ty)
(extendVarEnv tenv tv ty)
cenv | 245 | extendTvSubstAndInScope (TCvSubst in_scope tenv cenv) tv ty
= TCvSubst (in_scope `extendInScopeSetSet` tyCoVarsOfType ty)
(extendVarEnv tenv tv ty)
cenv | 180 | true | true | 0 | 8 | 60 | 70 | 36 | 34 | null | null |
ice1000/Kt2Dart | src/Types.hs | agpl-3.0 | userTypeP :: Parser String
userTypeP = do
ls <- reservedLP "." \|/ simpleUserTypeP
return $ join ls
-- | 106 | userTypeP :: Parser String
userTypeP = do
ls <- reservedLP "." \|/ simpleUserTypeP
return $ join ls
-- | 106 | userTypeP = do
ls <- reservedLP "." \|/ simpleUserTypeP
return $ join ls
-- | 79 | false | true | 0 | 10 | 21 | 45 | 19 | 26 | null | null |
nushio3/ghc | compiler/nativeGen/Dwarf/Constants.hs | bsd-3-clause | dW_TAG_arg_variable = 257 | 28 | dW_TAG_arg_variable = 257 | 28 | dW_TAG_arg_variable = 257 | 28 | false | false | 0 | 4 | 5 | 6 | 3 | 3 | null | null |
beni55/Midi | src/Midi.hs | bsd-3-clause | note_off :: Word8 -> Integer -> ByteString
note_off note delay = concat $ [
bs_rep delay -- Two Ticks at Two beats / Second (120 beats / Min default)
]
++
[ pack [
0x80, -- Note on, Channel 1
note,
0x60 -- Velocity
] ] | 235 | note_off :: Word8 -> Integer -> ByteString
note_off note delay = concat $ [
bs_rep delay -- Two Ticks at Two beats / Second (120 beats / Min default)
]
++
[ pack [
0x80, -- Note on, Channel 1
note,
0x60 -- Velocity
] ] | 235 | note_off note delay = concat $ [
bs_rep delay -- Two Ticks at Two beats / Second (120 beats / Min default)
]
++
[ pack [
0x80, -- Note on, Channel 1
note,
0x60 -- Velocity
] ] | 192 | false | true | 2 | 8 | 62 | 63 | 32 | 31 | null | null |
liefswanson/projectEuler | src/Cards.hs | gpl-2.0 | faceGroups :: PokerHand -> [(Int, Face)]
faceGroups (PokerHand cards) = reverse $ sort counts
where
faces = map face cards
counts = map (\(a,b) -> (b,a)) $ runLength faces | 191 | faceGroups :: PokerHand -> [(Int, Face)]
faceGroups (PokerHand cards) = reverse $ sort counts
where
faces = map face cards
counts = map (\(a,b) -> (b,a)) $ runLength faces | 191 | faceGroups (PokerHand cards) = reverse $ sort counts
where
faces = map face cards
counts = map (\(a,b) -> (b,a)) $ runLength faces | 150 | false | true | 0 | 11 | 48 | 87 | 47 | 40 | null | null |
RayRacine/hs3 | src/hs3.hs | gpl-3.0 | showFetch :: S3.Bucket -> FilePath -> FilePath -> IO ()
showFetch bucket bpath fpath = do
say $ "Fetching from bucket " ++ b ++ " at " ++ bpath ++ " to " ++ fpath
where
b = unpack bucket | 193 | showFetch :: S3.Bucket -> FilePath -> FilePath -> IO ()
showFetch bucket bpath fpath = do
say $ "Fetching from bucket " ++ b ++ " at " ++ bpath ++ " to " ++ fpath
where
b = unpack bucket | 193 | showFetch bucket bpath fpath = do
say $ "Fetching from bucket " ++ b ++ " at " ++ bpath ++ " to " ++ fpath
where
b = unpack bucket | 137 | false | true | 1 | 12 | 47 | 83 | 37 | 46 | null | null |
themoritz/cabal | cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs | bsd-3-clause | -- | Packages pkg-A, pkg-B, and pkg-C form a cycle. The solver should backtrack
-- as soon as it chooses the last package in the cycle, to avoid searching parts
-- of the tree that have no solution. Since there is no way to break the cycle,
-- it should fail with an error message describing the cycle.
testCyclicDepende... | 2,187 | testCyclicDependencyErrorMessages :: String -> SolverTest
testCyclicDependencyErrorMessages name =
goalOrder goals $
mkTest db name ["pkg-A"] $
SolverResult checkFullLog $ Left checkSummarizedLog
where
db :: ExampleDb
db = [
Right $ exAv "pkg-A" 1 [ExAny "pkg-B"]
, Right $ exAv "pkg-... | 1,884 | testCyclicDependencyErrorMessages name =
goalOrder goals $
mkTest db name ["pkg-A"] $
SolverResult checkFullLog $ Left checkSummarizedLog
where
db :: ExampleDb
db = [
Right $ exAv "pkg-A" 1 [ExAny "pkg-B"]
, Right $ exAv "pkg-B" 1 [ExAny "pkg-C"]
, Right $ exAv "pkg-C" 1 [ExAny... | 1,826 | true | true | 0 | 11 | 509 | 304 | 168 | 136 | null | null |
GaloisInc/sk-dev-platform | user/sklite/tests/ChannelExplosionTests.hs | bsd-3-clause | unidirMultiple :: Layout
unidirMultiple =
let ch1 = Channel "c1" "c2" 4096 1 "chan1" False
ch2 = Channel "c1" "c2" 4096 1 "chan2" False
c1 = Cell "c1" "" "prog" CellMain 5000 10000 [] [] []
c2 = Cell "c2" "" "prog" CellMain 5000 10000 [] [] []
in Layout [c1, c2] [] 100 [ch1, ch2] | 312 | unidirMultiple :: Layout
unidirMultiple =
let ch1 = Channel "c1" "c2" 4096 1 "chan1" False
ch2 = Channel "c1" "c2" 4096 1 "chan2" False
c1 = Cell "c1" "" "prog" CellMain 5000 10000 [] [] []
c2 = Cell "c2" "" "prog" CellMain 5000 10000 [] [] []
in Layout [c1, c2] [] 100 [ch1, ch2] | 312 | unidirMultiple =
let ch1 = Channel "c1" "c2" 4096 1 "chan1" False
ch2 = Channel "c1" "c2" 4096 1 "chan2" False
c1 = Cell "c1" "" "prog" CellMain 5000 10000 [] [] []
c2 = Cell "c2" "" "prog" CellMain 5000 10000 [] [] []
in Layout [c1, c2] [] 100 [ch1, ch2] | 287 | false | true | 0 | 10 | 87 | 145 | 70 | 75 | null | null |
thelastnode/hmenu | Main.hs | mit | main :: IO ()
main = do
list <- getContents
args <- getArgs
let input = args !! 0
let xs = lines list
putStrLn $ show $ select editDistance input xs
putStrLn $ show $ select subseqDistance input xs | 209 | main :: IO ()
main = do
list <- getContents
args <- getArgs
let input = args !! 0
let xs = lines list
putStrLn $ show $ select editDistance input xs
putStrLn $ show $ select subseqDistance input xs | 209 | main = do
list <- getContents
args <- getArgs
let input = args !! 0
let xs = lines list
putStrLn $ show $ select editDistance input xs
putStrLn $ show $ select subseqDistance input xs | 195 | false | true | 4 | 9 | 51 | 61 | 31 | 30 | null | null |
edx/patch-juggler | Juggler/Html.hs | bsd-3-clause | formatTableEntry :: FileCommit -> Html
formatTableEntry fc = td $ do
div ! class_ "filename" $ p $ toHtml $ fc ^. name
div $ mapM_ formatLineGroup $ L.groupBy ((==) `on` lineType) $ fc ^. contents | 204 | formatTableEntry :: FileCommit -> Html
formatTableEntry fc = td $ do
div ! class_ "filename" $ p $ toHtml $ fc ^. name
div $ mapM_ formatLineGroup $ L.groupBy ((==) `on` lineType) $ fc ^. contents | 204 | formatTableEntry fc = td $ do
div ! class_ "filename" $ p $ toHtml $ fc ^. name
div $ mapM_ formatLineGroup $ L.groupBy ((==) `on` lineType) $ fc ^. contents | 165 | false | true | 0 | 13 | 43 | 86 | 43 | 43 | null | null |
ezyang/ghc | testsuite/tests/programs/andy_cherry/GenUtils.hs | bsd-3-clause | -- Sorting is something almost every program needs, and this is the
-- quickest sorting function I know of.
sortWith :: (a -> a -> Bool) -> [a] -> [a]
sortWith le [] = [] | 171 | sortWith :: (a -> a -> Bool) -> [a] -> [a]
sortWith le [] = [] | 62 | sortWith le [] = [] | 19 | true | true | 0 | 8 | 35 | 47 | 26 | 21 | null | null |
charles-cooper/postgresql-orm | Database/PostgreSQL/Escape.hs | gpl-3.0 | buildSql q p = buildSqlFromActions q (toRow p) | 46 | buildSql q p = buildSqlFromActions q (toRow p) | 46 | buildSql q p = buildSqlFromActions q (toRow p) | 46 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
typelead/epm | Cabal/Distribution/Simple/Utils.hs | bsd-3-clause | debugNoWrap :: Verbosity -> String -> IO ()
debugNoWrap verbosity msg =
when (verbosity >= deafening) $ do
putStrLn msg
hFlush stdout
-- | Perform an IO action, catching any IO exceptions and printing an error
-- if one occurs. | 240 | debugNoWrap :: Verbosity -> String -> IO ()
debugNoWrap verbosity msg =
when (verbosity >= deafening) $ do
putStrLn msg
hFlush stdout
-- | Perform an IO action, catching any IO exceptions and printing an error
-- if one occurs. | 240 | debugNoWrap verbosity msg =
when (verbosity >= deafening) $ do
putStrLn msg
hFlush stdout
-- | Perform an IO action, catching any IO exceptions and printing an error
-- if one occurs. | 196 | false | true | 0 | 8 | 52 | 57 | 27 | 30 | null | null |
c089/haskell-craft3e | Chapter4Exercises.hs | mit | -------------------------------------------------------------------------------
-- Exercise 4.33 / 4.34
-------------------------------------------------------------------------------
test_allEqual = TestList
[ TestCase (assertEqual "all equal" True (allEqual 1 1 1))
, TestCase (assertEqual "1st and 2... | 1,707 | test_allEqual = TestList
[ TestCase (assertEqual "all equal" True (allEqual 1 1 1))
, TestCase (assertEqual "1st and 2nd eq" False (allEqual 1 1 2))
, TestCase (assertEqual "1st and 3rd eq" False (allEqual 1 2 1))
, TestCase (assertEqual "2nd and 3rd eq" False (allEqual 2 1 1))
, T... | 1,522 | test_allEqual = TestList
[ TestCase (assertEqual "all equal" True (allEqual 1 1 1))
, TestCase (assertEqual "1st and 2nd eq" False (allEqual 1 1 2))
, TestCase (assertEqual "1st and 3rd eq" False (allEqual 1 2 1))
, TestCase (assertEqual "2nd and 3rd eq" False (allEqual 2 1 1))
, T... | 1,522 | true | false | 1 | 13 | 410 | 664 | 349 | 315 | null | null |
olorin/amazonka | amazonka-redshift/gen/Network/AWS/Redshift/Types/Product.hs | mpl-2.0 | -- | The amount charged per the period of time specified by the recurring
-- charge frequency.
rcRecurringChargeAmount :: Lens' RecurringCharge (Maybe Double)
rcRecurringChargeAmount = lens _rcRecurringChargeAmount (\ s a -> s{_rcRecurringChargeAmount = a}) | 257 | rcRecurringChargeAmount :: Lens' RecurringCharge (Maybe Double)
rcRecurringChargeAmount = lens _rcRecurringChargeAmount (\ s a -> s{_rcRecurringChargeAmount = a}) | 162 | rcRecurringChargeAmount = lens _rcRecurringChargeAmount (\ s a -> s{_rcRecurringChargeAmount = a}) | 98 | true | true | 0 | 9 | 33 | 47 | 26 | 21 | null | null |
jprider63/aeson-ios-0.8.0.2 | dist/i386/build/autogen/Paths_aeson.hs | bsd-3-clause | bindir, libdir, datadir, libexecdir, sysconfdir :: FilePath
bindir = "/Users/james/.cabal/bin" | 99 | bindir, libdir, datadir, libexecdir, sysconfdir :: FilePath
bindir = "/Users/james/.cabal/bin" | 98 | bindir = "/Users/james/.cabal/bin" | 38 | false | true | 2 | 5 | 14 | 24 | 14 | 10 | null | null |
frantisekfarka/ghc-dsi | compiler/codeGen/StgCmmMonad.hs | bsd-3-clause | getSequel :: FCode Sequel
getSequel = do { info <- getInfoDown
; return (cgd_sequel info) } | 108 | getSequel :: FCode Sequel
getSequel = do { info <- getInfoDown
; return (cgd_sequel info) } | 108 | getSequel = do { info <- getInfoDown
; return (cgd_sequel info) } | 82 | false | true | 0 | 9 | 32 | 36 | 18 | 18 | null | null |
urbanslug/ghc | compiler/simplCore/SimplUtils.hs | bsd-3-clause | interestingArgContext :: [CoreRule] -> SimplCont -> Bool
-- If the argument has form (f x y), where x,y are boring,
-- and f is marked INLINE, then we don't want to inline f.
-- But if the context of the argument is
-- g (f x y)
-- where g has rules, then we *do* want to inline f, in case it
-- exposes a rule that... | 2,822 | interestingArgContext :: [CoreRule] -> SimplCont -> Bool
interestingArgContext rules call_cont
= notNull rules || enclosing_fn_has_rules
where
enclosing_fn_has_rules = go call_cont
go (Select {}) = False
go (ApplyToVal {}) = False -- Shouldn't really happen
go (ApplyToTy {}) = Fal... | 1,878 | interestingArgContext rules call_cont
= notNull rules || enclosing_fn_has_rules
where
enclosing_fn_has_rules = go call_cont
go (Select {}) = False
go (ApplyToVal {}) = False -- Shouldn't really happen
go (ApplyToTy {}) = False -- Ditto
go (StrictArg _ cci _) = interesting cci... | 1,821 | true | true | 0 | 7 | 640 | 223 | 123 | 100 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | zipName = varQual gHC_LIST (fsLit "zip") zipIdKey | 62 | zipName = varQual gHC_LIST (fsLit "zip") zipIdKey | 62 | zipName = varQual gHC_LIST (fsLit "zip") zipIdKey | 62 | false | false | 1 | 7 | 19 | 23 | 9 | 14 | null | null |
jystic/QuickSpec | qs1/CongruenceClosure.hs | bsd-3-clause | var :: [Int] -> PropertyM CC (Int, Int)
var xs = do
pre (not (null xs))
x <- pick (elements xs)
x' <- freeze (rep x)
return (x, x') | 139 | var :: [Int] -> PropertyM CC (Int, Int)
var xs = do
pre (not (null xs))
x <- pick (elements xs)
x' <- freeze (rep x)
return (x, x') | 139 | var xs = do
pre (not (null xs))
x <- pick (elements xs)
x' <- freeze (rep x)
return (x, x') | 99 | false | true | 0 | 11 | 36 | 94 | 45 | 49 | null | null |
haskell-distributed/distributed-process-platform | tests/TestPrimitives.hs | bsd-3-clause | main :: IO ()
main = testMain $ primitivesTests | 47 | main :: IO ()
main = testMain $ primitivesTests | 47 | main = testMain $ primitivesTests | 33 | false | true | 0 | 7 | 8 | 26 | 11 | 15 | null | null |
ezyang/ghc | compiler/utils/Util.hs | bsd-3-clause | filterByList (False:bs) (_:xs) = filterByList bs xs | 55 | filterByList (False:bs) (_:xs) = filterByList bs xs | 55 | filterByList (False:bs) (_:xs) = filterByList bs xs | 55 | false | false | 0 | 7 | 10 | 30 | 15 | 15 | null | null |
ku-fpg/remote-binary | example/Main.hs | bsd-3-clause | example :: (RemoteMonad Prim :~> IO) -> IO()
example s = do
putStrLn " push 2; push 1;"
send s $ do
push 2
push 1
res <- send s $ do
push 9
pop
putStrLn "push 9; pop:"
print res
res2 <- send s $ ... | 724 | example :: (RemoteMonad Prim :~> IO) -> IO()
example s = do
putStrLn " push 2; push 1;"
send s $ do
push 2
push 1
res <- send s $ do
push 9
pop
putStrLn "push 9; pop:"
print res
res2 <- send s $ ... | 724 | example s = do
putStrLn " push 2; push 1;"
send s $ do
push 2
push 1
res <- send s $ do
push 9
pop
putStrLn "push 9; pop:"
print res
res2 <- send s $ do add <$> pop <*> (pure 3)
putStrLn ... | 679 | false | true | 0 | 14 | 399 | 208 | 84 | 124 | null | null |
tjakway/ghcjvm | compiler/cmm/PprC.hs | bsd-3-clause | -- This is for finding the types of foreign call arguments. For a pointer
-- argument, we always cast the argument to (void *), to avoid warnings from
-- the C compiler.
machRepHintCType :: CmmType -> ForeignHint -> SDoc
machRepHintCType _ AddrHint = text "void *" | 269 | machRepHintCType :: CmmType -> ForeignHint -> SDoc
machRepHintCType _ AddrHint = text "void *" | 98 | machRepHintCType _ AddrHint = text "void *" | 47 | true | true | 0 | 6 | 50 | 30 | 16 | 14 | null | null |
wskplho/stack | src/Stack/Types/Config.hs | bsd-3-clause | -- | Directory containing snapshots
snapshotsDir :: (MonadReader env m, HasConfig env, MonadThrow m) => m (Path Abs Dir)
snapshotsDir = do
config <- asks getConfig
platform <- platformRelDir
return $ configStackRoot config </> $(mkRelDir "snapshots") </> platform
-- | Installation root for dependencies | 316 | snapshotsDir :: (MonadReader env m, HasConfig env, MonadThrow m) => m (Path Abs Dir)
snapshotsDir = do
config <- asks getConfig
platform <- platformRelDir
return $ configStackRoot config </> $(mkRelDir "snapshots") </> platform
-- | Installation root for dependencies | 280 | snapshotsDir = do
config <- asks getConfig
platform <- platformRelDir
return $ configStackRoot config </> $(mkRelDir "snapshots") </> platform
-- | Installation root for dependencies | 195 | true | true | 0 | 11 | 56 | 89 | 43 | 46 | null | null |
zobot/MeshGenerator | src/FractalSurface.hs | bsd-3-clause | mandelBulbHelper numLeft n c currentPoint | otherwise = currentPoint | 68 | mandelBulbHelper numLeft n c currentPoint | otherwise = currentPoint | 68 | mandelBulbHelper numLeft n c currentPoint | otherwise = currentPoint | 68 | false | false | 0 | 7 | 8 | 21 | 9 | 12 | null | null |
asilvestre/haskell-neo4j-rest-client | tests/IntegrationTests.hs | mit | case_batchGetRelationships :: Assertion
case_batchGetRelationships = withAuthConnection host port creds $ do
g <- B.runBatch $ do
n1 <- B.createNode someProperties
n2 <- B.createNode anotherProperties
_ <- B.createRelationship "type1" someOther... | 1,122 | case_batchGetRelationships :: Assertion
case_batchGetRelationships = withAuthConnection host port creds $ do
g <- B.runBatch $ do
n1 <- B.createNode someProperties
n2 <- B.createNode anotherProperties
_ <- B.createRelationship "type1" someOther... | 1,122 | case_batchGetRelationships = withAuthConnection host port creds $ do
g <- B.runBatch $ do
n1 <- B.createNode someProperties
n2 <- B.createNode anotherProperties
_ <- B.createRelationship "type1" someOtherProperties n1 n2
B.c... | 1,082 | false | true | 0 | 17 | 369 | 297 | 140 | 157 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Resource/Compute/TargetVPNGateways/Get.hs | mpl-2.0 | -- | Name of the region for this request.
tvggRegion :: Lens' TargetVPNGatewaysGet Text
tvggRegion
= lens _tvggRegion (\ s a -> s{_tvggRegion = a}) | 149 | tvggRegion :: Lens' TargetVPNGatewaysGet Text
tvggRegion
= lens _tvggRegion (\ s a -> s{_tvggRegion = a}) | 107 | tvggRegion
= lens _tvggRegion (\ s a -> s{_tvggRegion = a}) | 61 | true | true | 0 | 9 | 26 | 42 | 22 | 20 | null | null |
boothead/hierarchy | src/Dimensions.hs | bsd-3-clause | targetToLegacyDimensions = Map.fromList [(v, k) | (k, v) <- dimensionMapping] | 77 | targetToLegacyDimensions = Map.fromList [(v, k) | (k, v) <- dimensionMapping] | 77 | targetToLegacyDimensions = Map.fromList [(v, k) | (k, v) <- dimensionMapping] | 77 | false | false | 0 | 9 | 9 | 34 | 19 | 15 | null | null |
fredmorcos/attic | projects/pet/archive/pet_haskell_early_2/Parser.hs | isc | parseDouble :: ReadP Double
parseDouble = do f <- munch1 isDigit
remain <- look
if head remain == '.'
then do _ <- char '.'
d <- munch1 isDigit
return (read (f ++ "." ++ d) :: Double)
else return (read ... | 332 | parseDouble :: ReadP Double
parseDouble = do f <- munch1 isDigit
remain <- look
if head remain == '.'
then do _ <- char '.'
d <- munch1 isDigit
return (read (f ++ "." ++ d) :: Double)
else return (read ... | 332 | parseDouble = do f <- munch1 isDigit
remain <- look
if head remain == '.'
then do _ <- char '.'
d <- munch1 isDigit
return (read (f ++ "." ++ d) :: Double)
else return (read f :: Double) | 304 | false | true | 0 | 15 | 161 | 107 | 50 | 57 | null | null |
snoyberg/yesod-js | samples/ajax/JS/Render.hs | bsd-2-clause | showJSExp (JSValue value) = return $ fromLazyText $ decodeUtf8 $ encode value | 77 | showJSExp (JSValue value) = return $ fromLazyText $ decodeUtf8 $ encode value | 77 | showJSExp (JSValue value) = return $ fromLazyText $ decodeUtf8 $ encode value | 77 | false | false | 0 | 7 | 11 | 30 | 14 | 16 | null | null |
buckie/juno | src/Juno/Hoplite/Types.hs | bsd-3-clause | codeValueF (DirectClosureF _) = 4 | 33 | codeValueF (DirectClosureF _) = 4 | 33 | codeValueF (DirectClosureF _) = 4 | 33 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
andreyLevushkin/LambdaWars | src/WorldRules.hs | mit | - |Bot dimensions - make bots circular for now
botSize :: Double
botSize = 36
| 79 | botSize :: Double
botSize = 36 | 31 | botSize = 36 | 13 | true | true | 1 | 9 | 16 | 36 | 16 | 20 | null | null |
shlevy/ghc | compiler/deSugar/DsArrows.hs | bsd-3-clause | dsCmdStmts
:: DsCmdEnv -- arrow combinators
-> IdSet -- set of local vars available to this statement
-> [Id] -- output vars of these statements
-> [CmdLStmt GhcTc] -- statements to desugar
-> [Id] -- list of vars in ... | 578 | dsCmdStmts
:: DsCmdEnv -- arrow combinators
-> IdSet -- set of local vars available to this statement
-> [Id] -- output vars of these statements
-> [CmdLStmt GhcTc] -- statements to desugar
-> [Id] -- list of vars in ... | 529 | dsCmdStmts ids local_vars out_ids [stmt] env_ids
= dsCmdLStmt ids local_vars out_ids stmt env_ids | 99 | true | true | 0 | 11 | 215 | 84 | 47 | 37 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSQL_C_CHAR :: Int
wxSQL_C_CHAR = 1 | 36 | wxSQL_C_CHAR :: Int
wxSQL_C_CHAR = 1 | 36 | wxSQL_C_CHAR = 1 | 16 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
phischu/fragnix | builtins/ghc-prim/GHC.PrimopWrappers.hs | bsd-3-clause | indexInt64Array# :: ByteArray# -> Int# -> Int#
indexInt64Array# a1 a2 = (GHC.Prim.indexInt64Array#) a1 a2 | 105 | indexInt64Array# :: ByteArray# -> Int# -> Int#
indexInt64Array# a1 a2 = (GHC.Prim.indexInt64Array#) a1 a2 | 105 | indexInt64Array# a1 a2 = (GHC.Prim.indexInt64Array#) a1 a2 | 58 | false | true | 0 | 7 | 13 | 35 | 18 | 17 | null | null |
vs-team/Papers | Before Giuseppe's PhD/Monads/ObjectiveMonad/MonadicObjects/trunk/Src/Main.hs | mit | x |> f = f x | 12 | x |> f = f x | 12 | x |> f = f x | 12 | false | false | 0 | 5 | 5 | 18 | 7 | 11 | null | null |
RyanGlScott/vigenere | standalone/PasswordCracker.hs | gpl-3.0 | dictionary :: IO Dictionary
dictionary = fmap (fromList . map pack . splitLines) $ readFile "dict.txt" | 102 | dictionary :: IO Dictionary
dictionary = fmap (fromList . map pack . splitLines) $ readFile "dict.txt" | 102 | dictionary = fmap (fromList . map pack . splitLines) $ readFile "dict.txt" | 74 | false | true | 0 | 9 | 15 | 43 | 19 | 24 | null | null |
siddhanathan/ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | isGoodBreakExpr (NegApp {}) = True | 37 | isGoodBreakExpr (NegApp {}) = True | 37 | isGoodBreakExpr (NegApp {}) = True | 37 | false | false | 0 | 7 | 7 | 16 | 8 | 8 | null | null |
peterokagey/haskellOEIS | src/Sandbox/Sami/PermutationStatistics.hs | apache-2.0 | lengthOfFirstCycle :: Permutation -> Int
lengthOfFirstCycle p = recurse 1 (head p) where
recurse c 1 = c
recurse c p' = recurse (c + 1) (p !! (p' - 1)) | 157 | lengthOfFirstCycle :: Permutation -> Int
lengthOfFirstCycle p = recurse 1 (head p) where
recurse c 1 = c
recurse c p' = recurse (c + 1) (p !! (p' - 1)) | 157 | lengthOfFirstCycle p = recurse 1 (head p) where
recurse c 1 = c
recurse c p' = recurse (c + 1) (p !! (p' - 1)) | 116 | false | true | 0 | 11 | 36 | 77 | 39 | 38 | null | null |
foreverbell/parakeet | src/Parakeet/Printer/TeX.hs | mit | texifyAuthor :: String -> Text
texifyAuthor author = T.pack $ printf "\\author{%s}" author | 90 | texifyAuthor :: String -> Text
texifyAuthor author = T.pack $ printf "\\author{%s}" author | 90 | texifyAuthor author = T.pack $ printf "\\author{%s}" author | 59 | false | true | 0 | 6 | 12 | 29 | 14 | 15 | null | null |
zachsully/hakaru | haskell/Language/Hakaru/Syntax/AST/Sing.hs | bsd-3-clause | sing_PrimOp Atanh = (sing `Cons1` Nil1, sing) | 52 | sing_PrimOp Atanh = (sing `Cons1` Nil1, sing) | 52 | sing_PrimOp Atanh = (sing `Cons1` Nil1, sing) | 52 | false | false | 0 | 6 | 13 | 22 | 12 | 10 | null | null |
cryptonomicon314/pyccoon-hs-xml | Text/XML/Light/Cursor.hs | bsd-3-clause | setTag :: Tag -> Element -> Element
setTag t e = fromTag t (elContent e) | 72 | setTag :: Tag -> Element -> Element
setTag t e = fromTag t (elContent e) | 72 | setTag t e = fromTag t (elContent e) | 36 | false | true | 0 | 8 | 14 | 42 | 18 | 24 | null | null |
davmre/matrizer | src/Matrizer/Analysis.hs | gpl-2.0 | treeFLOPs (Let lhs rhs tmp body) tbl = do letMatrix <- treeMatrix rhs tbl
letFLOPs <- treeFLOPs rhs tbl
let newtbl = Map.insert lhs (letMatrix, Just rhs) tbl
bodyFLOPs <- (treeFLOPs body newtbl)... | 408 | treeFLOPs (Let lhs rhs tmp body) tbl = do letMatrix <- treeMatrix rhs tbl
letFLOPs <- treeFLOPs rhs tbl
let newtbl = Map.insert lhs (letMatrix, Just rhs) tbl
bodyFLOPs <- (treeFLOPs body newtbl)... | 408 | treeFLOPs (Let lhs rhs tmp body) tbl = do letMatrix <- treeMatrix rhs tbl
letFLOPs <- treeFLOPs rhs tbl
let newtbl = Map.insert lhs (letMatrix, Just rhs) tbl
bodyFLOPs <- (treeFLOPs body newtbl)... | 408 | false | false | 0 | 12 | 207 | 104 | 48 | 56 | null | null |
mzini/TcT | source/Tct/Method/Matrix/ArcticMI.hs | gpl-3.0 | partialConstraints :: Eq l => [R.Rule] -> UsablePositions -> Prob.StartTerms -> Trs.Trs -> Trs.Trs -> F.Signature -> S.TheProcessor ArcticMI -> DioFormula l DioVar ArcInt
partialConstraints oblrules = matrixConstraints (MRelative oblrules) MNoDP | 245 | partialConstraints :: Eq l => [R.Rule] -> UsablePositions -> Prob.StartTerms -> Trs.Trs -> Trs.Trs -> F.Signature -> S.TheProcessor ArcticMI -> DioFormula l DioVar ArcInt
partialConstraints oblrules = matrixConstraints (MRelative oblrules) MNoDP | 245 | partialConstraints oblrules = matrixConstraints (MRelative oblrules) MNoDP | 74 | false | true | 0 | 14 | 30 | 85 | 41 | 44 | null | null |
ivanperez-keera/Binpack | Data/BinPack/Internals.hs | bsd-3-clause | almostWorstfit = xfit chooseAlmostWorst | 39 | almostWorstfit = xfit chooseAlmostWorst | 39 | almostWorstfit = xfit chooseAlmostWorst | 39 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
dylanmann/CurriersOfCatan | src/CatanGUI.hs | gpl-3.0 | beginGUI :: CatanMVars -> IO ()
beginGUI cmvars =
startGUI defaultConfig { jsCustomHTML = Just "catan.html",
jsStatic = Just "static",
jsLog = \_ -> putStr "" ,
jsPort = Just 8022,
jsWindowReloadOnDisconnect = ... | 340 | beginGUI :: CatanMVars -> IO ()
beginGUI cmvars =
startGUI defaultConfig { jsCustomHTML = Just "catan.html",
jsStatic = Just "static",
jsLog = \_ -> putStr "" ,
jsPort = Just 8022,
jsWindowReloadOnDisconnect = ... | 340 | beginGUI cmvars =
startGUI defaultConfig { jsCustomHTML = Just "catan.html",
jsStatic = Just "static",
jsLog = \_ -> putStr "" ,
jsPort = Just 8022,
jsWindowReloadOnDisconnect = True} (setup cmvars) | 308 | false | true | 0 | 9 | 145 | 91 | 46 | 45 | null | null |
pascal-knodel/haskell-craft | _/links/E'5'26.hs | mit | fastFib :: Integer -> Integer
fastFib = fst . fibPair | 54 | fastFib :: Integer -> Integer
fastFib = fst . fibPair | 54 | fastFib = fst . fibPair | 24 | false | true | 0 | 5 | 10 | 19 | 10 | 9 | null | null |
mzini/qlogic | Qlogic/SatSolverMap.hs | gpl-3.0 | addNegatively' (p,n) fm@(SL l) = do l' <- plit fm >>= negateELit
addLitClause $ Clause [l',p]
return n | 180 | addNegatively' (p,n) fm@(SL l) = do l' <- plit fm >>= negateELit
addLitClause $ Clause [l',p]
return n | 180 | addNegatively' (p,n) fm@(SL l) = do l' <- plit fm >>= negateELit
addLitClause $ Clause [l',p]
return n | 180 | false | false | 0 | 9 | 95 | 62 | 30 | 32 | null | null |
ambiata/mafia | src/Mafia/Twine/Parallel.hs | bsd-3-clause | -- | Provide a producer and an action to be run across the result
-- of that producer in parallel.
--
--
-- Common usage:
-- @
-- let producer :: Address -> Queue Address -> IO ()
-- producer prefix q =
-- list' prefix $$ writeQueue q
--
-- consume producer 100 (\(a :: Address) -> doThis... | 1,558 | consume_ :: MonadIO m => (Queue b -> IO a) -> Int -> (b -> EitherT e IO ()) -> EitherT (RunError e) m a
consume_ pro fork action = EitherT . liftIO $ do
q <- newQueue fork
producer <- async $ pro q
workers <- emptyWorkers
result <- newResult $ Right ()
sem <- new fork
let spawn = do
m <- tryReadQu... | 1,226 | consume_ pro fork action = EitherT . liftIO $ do
q <- newQueue fork
producer <- async $ pro q
workers <- emptyWorkers
result <- newResult $ Right ()
sem <- new fork
let spawn = do
m <- tryReadQueue q
flip (maybe $ return ()) m $ \a -> do
w <- do
M.wait sem
asy... | 1,122 | true | true | 0 | 28 | 478 | 525 | 249 | 276 | null | null |
thielema/accelerate-fft | Data/Array/Accelerate/Math/FFT.hs | bsd-3-clause | fft2D :: (Elt e, IsFloating e)
=> Mode
-> Array DIM2 (Complex e)
-> Acc (Array DIM2 (Complex e))
fft2D mode arr
= let Z :. height :. width = arrayShape arr
in
fft2D' mode width height (use arr) | 221 | fft2D :: (Elt e, IsFloating e)
=> Mode
-> Array DIM2 (Complex e)
-> Acc (Array DIM2 (Complex e))
fft2D mode arr
= let Z :. height :. width = arrayShape arr
in
fft2D' mode width height (use arr) | 221 | fft2D mode arr
= let Z :. height :. width = arrayShape arr
in
fft2D' mode width height (use arr) | 106 | false | true | 0 | 13 | 66 | 109 | 51 | 58 | null | null |
tolysz/dsp | DSP/Filter/IIR/Bilinear.hs | gpl-2.0 | -- Step 4: Normalize all of the coeficients by a0
step4 :: Fractional a => a -> [a] -> [a]
step4 a0 x = map (/a0) x | 116 | step4 :: Fractional a => a -> [a] -> [a]
step4 a0 x = map (/a0) x | 65 | step4 a0 x = map (/a0) x | 24 | true | true | 0 | 10 | 27 | 54 | 26 | 28 | null | null |
AndreasPK/stack | src/Stack/Types/GhcPkgId.hs | bsd-3-clause | parseGhcPkgId :: MonadThrow m => Text -> m GhcPkgId
parseGhcPkgId x = go x
where go =
either (const (throwM (GhcPkgIdParseFail x))) return .
parseOnly (ghcPkgIdParser <* endOfInput)
-- | A parser for a package-version-hash pair. | 251 | parseGhcPkgId :: MonadThrow m => Text -> m GhcPkgId
parseGhcPkgId x = go x
where go =
either (const (throwM (GhcPkgIdParseFail x))) return .
parseOnly (ghcPkgIdParser <* endOfInput)
-- | A parser for a package-version-hash pair. | 251 | parseGhcPkgId x = go x
where go =
either (const (throwM (GhcPkgIdParseFail x))) return .
parseOnly (ghcPkgIdParser <* endOfInput)
-- | A parser for a package-version-hash pair. | 199 | false | true | 0 | 12 | 58 | 77 | 37 | 40 | null | null |
fffej/sql-server-gen | src/Database/SqlServer/Create/SecurityPolicy.hs | bsd-2-clause | renderState False = text "WITH (STATE = OFF)" | 45 | renderState False = text "WITH (STATE = OFF)" | 45 | renderState False = text "WITH (STATE = OFF)" | 45 | false | false | 0 | 5 | 7 | 12 | 5 | 7 | null | null |
ssaavedra/liquidhaskell | docs/slides/BOS14/hs/start/06_Eval.hs | bsd-3-clause | eval env (Let x e1 e2) = eval env' e2
where
env' = (x, eval env e1) : env
------------------------------------------------------------------- | 168 | eval env (Let x e1 e2) = eval env' e2
where
env' = (x, eval env e1) : env
------------------------------------------------------------------- | 168 | eval env (Let x e1 e2) = eval env' e2
where
env' = (x, eval env e1) : env
------------------------------------------------------------------- | 168 | false | false | 0 | 7 | 46 | 50 | 25 | 25 | null | null |
GaloisInc/halvm-ghc | utils/ghc-cabal/Main.hs | bsd-3-clause | main :: IO ()
main = do hSetBuffering stdout LineBuffering
args <- getArgs
case args of
"hscolour" : dir : distDir : args' ->
runHsColour dir distDir args'
"check" : dir : [] ->
doCheck dir
"copy" : dir : distDir
... | 1,324 | main :: IO ()
main = do hSetBuffering stdout LineBuffering
args <- getArgs
case args of
"hscolour" : dir : distDir : args' ->
runHsColour dir distDir args'
"check" : dir : [] ->
doCheck dir
"copy" : dir : distDir
... | 1,324 | main = do hSetBuffering stdout LineBuffering
args <- getArgs
case args of
"hscolour" : dir : distDir : args' ->
runHsColour dir distDir args'
"check" : dir : [] ->
doCheck dir
"copy" : dir : distDir
: ... | 1,310 | false | true | 1 | 21 | 621 | 312 | 150 | 162 | null | null |
mwu-tow/cuda | Foreign/CUDA/Internal/C2HS.hs | bsd-3-clause | {-
-- Storing of 'Maybe' values
-- -------------------------
instance Storable a => Storable (Maybe a) where
sizeOf _ = sizeOf (undefined :: Ptr ())
alignment _ = alignment (undefined :: Ptr ())
peek p = do
ptr <- peek (castPtr p)
if ptr == nullPtr
then return Noth... | 992 | nothingIf :: (a -> Bool) -> (a -> b) -> a -> Maybe b
nothingIf p f x = if p x then Nothing else Just $ f x | 106 | nothingIf p f x = if p x then Nothing else Just $ f x | 53 | true | true | 0 | 9 | 320 | 80 | 45 | 35 | null | null |
juhp/stack | test/integration/tests/mutable-deps/files/filepath-1.4.2.1/System/FilePath/Internal.hs | bsd-3-clause | hasLeadingPathSeparator :: FilePath -> Bool
hasLeadingPathSeparator "" = False | 78 | hasLeadingPathSeparator :: FilePath -> Bool
hasLeadingPathSeparator "" = False | 78 | hasLeadingPathSeparator "" = False | 34 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
trianglesphere/hcas | src/Floating.hs | agpl-3.0 | display :: Rational -> String
display = printRational sigfigs | 61 | display :: Rational -> String
display = printRational sigfigs | 61 | display = printRational sigfigs | 31 | false | true | 0 | 7 | 8 | 25 | 10 | 15 | null | null |
zachsully/hakaru | haskell/Language/Hakaru/CodeGen/AST.hs | bsd-3-clause | (...),(.->.) :: CExpr -> String -> CExpr
i ... n = CMember i (Ident n) True | 76 | (...),(.->.) :: CExpr -> String -> CExpr
i ... n = CMember i (Ident n) True | 76 | i ... n = CMember i (Ident n) True | 35 | false | true | 1 | 7 | 16 | 44 | 25 | 19 | null | null |
nilcons/haskell-tz | tests/testTZSys.hs | apache-2.0 | onceIO op = opWrap
where
{-# NOINLINE var #-}
var = unsafePerformIO $ newIORef $ Left op
opWrap = do
v <- readIORef var
case v of
Right x -> return x
Left _ -> do
x <- op
atomicWriteIORef var $ Right x
return x
-- On the Int32 range of POSIX times... | 618 | onceIO op = opWrap
where
{-# NOINLINE var #-}
var = unsafePerformIO $ newIORef $ Left op
opWrap = do
v <- readIORef var
case v of
Right x -> return x
Left _ -> do
x <- op
atomicWriteIORef var $ Right x
return x
-- On the Int32 range of POSIX times... | 618 | onceIO op = opWrap
where
{-# NOINLINE var #-}
var = unsafePerformIO $ newIORef $ Left op
opWrap = do
v <- readIORef var
case v of
Right x -> return x
Left _ -> do
x <- op
atomicWriteIORef var $ Right x
return x
-- On the Int32 range of POSIX times... | 618 | false | false | 3 | 15 | 181 | 118 | 52 | 66 | null | null |
yigitozkavci/glow | src/Codegen.hs | mit | store :: Operand -> Operand -> Codegen Operand
store dest src =
instr VoidType $ Store False dest src Nothing 0 [] | 116 | store :: Operand -> Operand -> Codegen Operand
store dest src =
instr VoidType $ Store False dest src Nothing 0 [] | 116 | store dest src =
instr VoidType $ Store False dest src Nothing 0 [] | 69 | false | true | 0 | 7 | 23 | 49 | 23 | 26 | null | null |
ziman/idris-ocaml | src/IRTS/CodegenOCaml.hs | bsd-3-clause | cgExp cs ns (LApp _ f args) = cgApp (cgExp cs ns f) (map (magic . cgExp cs ns) args) | 84 | cgExp cs ns (LApp _ f args) = cgApp (cgExp cs ns f) (map (magic . cgExp cs ns) args) | 84 | cgExp cs ns (LApp _ f args) = cgApp (cgExp cs ns f) (map (magic . cgExp cs ns) args) | 84 | false | false | 0 | 10 | 19 | 61 | 28 | 33 | null | null |
adityagupta1089/Project-Euler-Haskell | src/problems/Problem60.hs | bsd-3-clause | main :: IO ()
main = print . sum $ concurrent 5 primes mp
where
primes = getPrimesUpto 10000
mp = Map.fromList
[ (p, Set.fromList [ p' | p' <- primes, special p p', p' /= p ])
| p <- primes
] | 229 | main :: IO ()
main = print . sum $ concurrent 5 primes mp
where
primes = getPrimesUpto 10000
mp = Map.fromList
[ (p, Set.fromList [ p' | p' <- primes, special p p', p' /= p ])
| p <- primes
] | 229 | main = print . sum $ concurrent 5 primes mp
where
primes = getPrimesUpto 10000
mp = Map.fromList
[ (p, Set.fromList [ p' | p' <- primes, special p p', p' /= p ])
| p <- primes
] | 215 | false | true | 1 | 11 | 80 | 102 | 51 | 51 | null | null |
randen/cabal | Cabal/tests/UnitTests.hs | bsd-3-clause | tests :: TestTree
tests = testGroup "Unit Tests" $
[ testGroup "Distribution.Compat.ReadP"
UnitTests.Distribution.Compat.ReadP.tests
, testGroup "Distribution.Compat.CreatePipe"
UnitTests.Distribution.Compat.CreatePipe.tests
, testGroup "Distribution.Simple.Program.Internal"
UnitTest... | 636 | tests :: TestTree
tests = testGroup "Unit Tests" $
[ testGroup "Distribution.Compat.ReadP"
UnitTests.Distribution.Compat.ReadP.tests
, testGroup "Distribution.Compat.CreatePipe"
UnitTests.Distribution.Compat.CreatePipe.tests
, testGroup "Distribution.Simple.Program.Internal"
UnitTest... | 636 | tests = testGroup "Unit Tests" $
[ testGroup "Distribution.Compat.ReadP"
UnitTests.Distribution.Compat.ReadP.tests
, testGroup "Distribution.Compat.CreatePipe"
UnitTests.Distribution.Compat.CreatePipe.tests
, testGroup "Distribution.Simple.Program.Internal"
UnitTests.Distribution.Sim... | 618 | false | true | 0 | 8 | 105 | 97 | 59 | 38 | null | null |
albertov/hs-mapnik | bindings/src/Mapnik/Bindings/Symbolizer.hs | bsd-3-clause | keyIndex Height = [C.pure|keys{keys::height}|] | 46 | keyIndex Height = [C.pure|keys{keys::height}|] | 46 | keyIndex Height = [C.pure|keys{keys::height}|] | 46 | false | false | 1 | 6 | 3 | 19 | 9 | 10 | null | null |
timjb/lens | src/Control/Lens/Internal/Level.hs | bsd-3-clause | lappend Zero (Two n l r) = Two (n + 1) l r | 49 | lappend Zero (Two n l r) = Two (n + 1) l r | 49 | lappend Zero (Two n l r) = Two (n + 1) l r | 49 | false | false | 0 | 7 | 19 | 35 | 17 | 18 | null | null |
beni55/haste-compiler | libraries/ghc-7.10/ghc-prim/GHC/Prim.hs | bsd-3-clause | -- | Write vector; offset in scalar elements.
writeWord16OffAddrAsWord16X16# :: Addr# -> Int# -> Word16X16# -> State# s -> State# s
writeWord16OffAddrAsWord16X16# = let x = x in x | 181 | writeWord16OffAddrAsWord16X16# :: Addr# -> Int# -> Word16X16# -> State# s -> State# s
writeWord16OffAddrAsWord16X16# = let x = x in x | 133 | writeWord16OffAddrAsWord16X16# = let x = x in x | 47 | true | true | 0 | 10 | 30 | 51 | 23 | 28 | null | null |
koba-e964/hayashii-mcc | test/ParserTest.hs | bsd-3-clause | testTuple :: TF.Test
testTuple = TF.testGroup "tuple"
[ testEq "tuple1" (exprOfString "3, 4") (Tuple [Int 3, Int 4])
, testEq "tuple2" (exprOfString "(3, 4, 8)") (Tuple [Int 3, Int 4, Int 8])
, testEq "tuple3" (exprOfString "3, (4, 8)") (Tuple [Int 3, Tuple [Int 4, Int 8]])
] | 284 | testTuple :: TF.Test
testTuple = TF.testGroup "tuple"
[ testEq "tuple1" (exprOfString "3, 4") (Tuple [Int 3, Int 4])
, testEq "tuple2" (exprOfString "(3, 4, 8)") (Tuple [Int 3, Int 4, Int 8])
, testEq "tuple3" (exprOfString "3, (4, 8)") (Tuple [Int 3, Tuple [Int 4, Int 8]])
] | 284 | testTuple = TF.testGroup "tuple"
[ testEq "tuple1" (exprOfString "3, 4") (Tuple [Int 3, Int 4])
, testEq "tuple2" (exprOfString "(3, 4, 8)") (Tuple [Int 3, Int 4, Int 8])
, testEq "tuple3" (exprOfString "3, (4, 8)") (Tuple [Int 3, Tuple [Int 4, Int 8]])
] | 263 | false | true | 0 | 12 | 55 | 141 | 70 | 71 | null | null |
bacchanalia/KitchenSink | KitchenSink/Qualified.hs | gpl-3.0 | -- |'BL.takeWhile'
bl_takeWhile = BL.takeWhile | 46 | bl_takeWhile = BL.takeWhile | 27 | bl_takeWhile = BL.takeWhile | 27 | true | false | 0 | 5 | 4 | 9 | 5 | 4 | null | null |
23Skidoo/xmlhtml | test/suite/Text/XmlHtml/Tests.hs | bsd-3-clause | blazeTestMulti :: Bool
blazeTestMulti = renderHtml (selectCustom `mappend` html) == result
where
html = do
H.link ! A.rel "stylesheet"
result = HtmlDocument UTF8 Nothing
[ Element "select" [("dojoType", "select")] [TextNode "foo ", TextNode "bar"]
, Element "link" [("rel", "stylesheet"... | 335 | blazeTestMulti :: Bool
blazeTestMulti = renderHtml (selectCustom `mappend` html) == result
where
html = do
H.link ! A.rel "stylesheet"
result = HtmlDocument UTF8 Nothing
[ Element "select" [("dojoType", "select")] [TextNode "foo ", TextNode "bar"]
, Element "link" [("rel", "stylesheet"... | 335 | blazeTestMulti = renderHtml (selectCustom `mappend` html) == result
where
html = do
H.link ! A.rel "stylesheet"
result = HtmlDocument UTF8 Nothing
[ Element "select" [("dojoType", "select")] [TextNode "foo ", TextNode "bar"]
, Element "link" [("rel", "stylesheet")] []
] | 312 | false | true | 1 | 10 | 82 | 114 | 60 | 54 | null | null |
guoy34/ampersand | src/Database/Design/Ampersand/Components.hs | gpl-3.0 | -- An expression e is type ambiguous means that (showADL e) cannot be parsed (in the context of fSpec) without a type ambiguity error.
-- Q: Should we disambiguate the exprs in the fSpec i.e. mapexprs disambiguate fSpec fSpec?
-- Or do we assume a correct implementation with unambiguous expressions only?
-- A: The... | 812 | doGenADL :: FSpec -> IO()
doGenADL fSpec =
do { writeFile outputFile . showADL . originalContext $ fSpec
; verboseLn (getOpts fSpec) $ ".adl-file written to " ++ outputFile ++ "."
}
where outputFile = combine (dirOutput (getOpts fSpec)) (outputfile (getOpts fSpec)) | 275 | doGenADL fSpec =
do { writeFile outputFile . showADL . originalContext $ fSpec
; verboseLn (getOpts fSpec) $ ".adl-file written to " ++ outputFile ++ "."
}
where outputFile = combine (dirOutput (getOpts fSpec)) (outputfile (getOpts fSpec)) | 249 | true | true | 0 | 12 | 144 | 110 | 56 | 54 | null | null |
jfischoff/generic-maybe | tests/tasty.hs | bsd-3-clause | case_convert_Success
= convert (Success 'a') @?= Just 'a' | 61 | case_convert_Success
= convert (Success 'a') @?= Just 'a' | 61 | case_convert_Success
= convert (Success 'a') @?= Just 'a' | 61 | false | false | 1 | 8 | 11 | 25 | 10 | 15 | null | null |
RossMeikleham/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | tldeclared (PNamespace _ _ ds) = concatMap tldeclared ds | 56 | tldeclared (PNamespace _ _ ds) = concatMap tldeclared ds | 56 | tldeclared (PNamespace _ _ ds) = concatMap tldeclared ds | 56 | false | false | 0 | 7 | 8 | 24 | 11 | 13 | null | null |
input-output-hk/pos-haskell-prototype | core/test/Test/Pos/Core/Bi.hs | mit | --------------------------------------------------------------------------------
-- TimeDiff
--------------------------------------------------------------------------------
golden_TimeDiff :: Property
golden_TimeDiff = goldenTestBi td "test/golden/TimeDiff"
where td = TimeDiff 4747 | 285 | golden_TimeDiff :: Property
golden_TimeDiff = goldenTestBi td "test/golden/TimeDiff"
where td = TimeDiff 4747 | 111 | golden_TimeDiff = goldenTestBi td "test/golden/TimeDiff"
where td = TimeDiff 4747 | 83 | true | true | 0 | 5 | 18 | 30 | 16 | 14 | null | null |
rueshyna/gogol | gogol-drive/gen/Network/Google/Drive/Types/Product.hs | mpl-2.0 | aifAddtional :: Lens' AboutImportFormats (HashMap Text [Text])
aifAddtional
= lens _aifAddtional (\ s a -> s{_aifAddtional = a})
. _Coerce | 146 | aifAddtional :: Lens' AboutImportFormats (HashMap Text [Text])
aifAddtional
= lens _aifAddtional (\ s a -> s{_aifAddtional = a})
. _Coerce | 146 | aifAddtional
= lens _aifAddtional (\ s a -> s{_aifAddtional = a})
. _Coerce | 83 | false | true | 1 | 9 | 27 | 58 | 29 | 29 | null | null |
li-zhirui/EoplLangs | src/CallByReference/Data.hs | bsd-3-clause | applyForce :: Environment -> String -> DenotedValue
applyForce env var = fromMaybe
(error $ "Var " `mappend` var `mappend` " is not in environment!")
(apply env var) | 169 | applyForce :: Environment -> String -> DenotedValue
applyForce env var = fromMaybe
(error $ "Var " `mappend` var `mappend` " is not in environment!")
(apply env var) | 169 | applyForce env var = fromMaybe
(error $ "Var " `mappend` var `mappend` " is not in environment!")
(apply env var) | 117 | false | true | 0 | 8 | 30 | 62 | 31 | 31 | null | null |
edom/ptt | src/Parse/Monad/Parsec.hs | apache-2.0 | lex :: Parsec String a -> L.Path -> String -> Either M.Error a
lex grammar path code =
case T.parse (out grammar) path code of
Left e -> Left $ translateError e
Right x -> Right x | 199 | lex :: Parsec String a -> L.Path -> String -> Either M.Error a
lex grammar path code =
case T.parse (out grammar) path code of
Left e -> Left $ translateError e
Right x -> Right x | 199 | lex grammar path code =
case T.parse (out grammar) path code of
Left e -> Left $ translateError e
Right x -> Right x | 136 | false | true | 0 | 9 | 56 | 95 | 43 | 52 | null | null |
mokus0/schematics | pdi-dongle/BOM.hs | unlicense | oshParkPCB sz boardName =
[ Part
{ supplier = oshPark
, partNo = boardName
, minimumQty = 3
, increment = 3
, price = sz * 5 / 3
}
, Part
{ supplier = oshPark
, partNo = boardName
, minimumQty = 1... | 415 | oshParkPCB sz boardName =
[ Part
{ supplier = oshPark
, partNo = boardName
, minimumQty = 3
, increment = 3
, price = sz * 5 / 3
}
, Part
{ supplier = oshPark
, partNo = boardName
, minimumQty = 1... | 415 | oshParkPCB sz boardName =
[ Part
{ supplier = oshPark
, partNo = boardName
, minimumQty = 3
, increment = 3
, price = sz * 5 / 3
}
, Part
{ supplier = oshPark
, partNo = boardName
, minimumQty = 1... | 415 | false | false | 0 | 11 | 223 | 103 | 62 | 41 | null | null |
diminishedprime/.org | programmey_stuff/write_yourself_a_scheme/ch_08/wyas/app/Eval.hs | mit | eval _ val@(Float _) = return val | 33 | eval _ val@(Float _) = return val | 33 | eval _ val@(Float _) = return val | 33 | false | false | 0 | 8 | 6 | 27 | 12 | 15 | null | null |
slpopejoy/fadno-xml | src/Fadno/MusicXml/MusicXml30.hs | bsd-2-clause | parsePageLayout :: P.XParse PageLayout
parsePageLayout =
PageLayout
<$> P.optional (parseSeqPageLayout)
<*> P.many (P.xchild (P.name "page-margins") (parsePageMargins)) | 191 | parsePageLayout :: P.XParse PageLayout
parsePageLayout =
PageLayout
<$> P.optional (parseSeqPageLayout)
<*> P.many (P.xchild (P.name "page-margins") (parsePageMargins)) | 191 | parsePageLayout =
PageLayout
<$> P.optional (parseSeqPageLayout)
<*> P.many (P.xchild (P.name "page-margins") (parsePageMargins)) | 152 | false | true | 0 | 11 | 38 | 58 | 29 | 29 | null | null |
tek/proteome | packages/test/test/Proteome/Test/ResolveTest.hs | mit | paths :: [FilePath]
paths = [
"~/../test/dir",
"~"
] | 58 | paths :: [FilePath]
paths = [
"~/../test/dir",
"~"
] | 58 | paths = [
"~/../test/dir",
"~"
] | 38 | false | true | 0 | 5 | 14 | 20 | 12 | 8 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Upgrade.hs | mit | whatResearches ZergCarapace = ZergEvolutionChamber | 50 | whatResearches ZergCarapace = ZergEvolutionChamber | 50 | whatResearches ZergCarapace = ZergEvolutionChamber | 50 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
premium-minds/h-queries | HQueries/SqlUtils.hs | lgpl-3.0 | sql2Text s (SelectSVars l) = T.concat ["SELECT ", T.intercalate ", " (map mkName l)] | 84 | sql2Text s (SelectSVars l) = T.concat ["SELECT ", T.intercalate ", " (map mkName l)] | 84 | sql2Text s (SelectSVars l) = T.concat ["SELECT ", T.intercalate ", " (map mkName l)] | 84 | false | false | 0 | 9 | 13 | 43 | 21 | 22 | null | null |
Chase-C/Flood-Haskell | src/Board.hs | mit | changeColor :: Int -> Game ()
changeColor col = do
liftIO $ withFile "log.txt" AppendMode (\h -> hPutStrLn h ("Changed color to: " ++ show col))
board <- gets stateBoard
let newBoard = changeIndexColor board (1, 1) col
modify $ \s -> s {
stateBoard = newBoard // [(i, (col, True)) | i <- indices ... | 365 | changeColor :: Int -> Game ()
changeColor col = do
liftIO $ withFile "log.txt" AppendMode (\h -> hPutStrLn h ("Changed color to: " ++ show col))
board <- gets stateBoard
let newBoard = changeIndexColor board (1, 1) col
modify $ \s -> s {
stateBoard = newBoard // [(i, (col, True)) | i <- indices ... | 365 | changeColor col = do
liftIO $ withFile "log.txt" AppendMode (\h -> hPutStrLn h ("Changed color to: " ++ show col))
board <- gets stateBoard
let newBoard = changeIndexColor board (1, 1) col
modify $ \s -> s {
stateBoard = newBoard // [(i, (col, True)) | i <- indices newBoard, not (snd $ newBoard ... | 335 | false | true | 0 | 18 | 94 | 165 | 82 | 83 | null | null |
sulami/hGM | test/Handler/CommonSpec.hs | bsd-3-clause | spec :: Spec
spec = withApp $ do
describe "robots.txt" $ do
it "gives a 200" $ do
get RobotsR
statusIs 200
it "has correct User-agent" $ do
get RobotsR
bodyContains "User-agent: *"
describe "favicon.ico" $ do
it "gives a 200" $ do
... | 360 | spec :: Spec
spec = withApp $ do
describe "robots.txt" $ do
it "gives a 200" $ do
get RobotsR
statusIs 200
it "has correct User-agent" $ do
get RobotsR
bodyContains "User-agent: *"
describe "favicon.ico" $ do
it "gives a 200" $ do
... | 360 | spec = withApp $ do
describe "robots.txt" $ do
it "gives a 200" $ do
get RobotsR
statusIs 200
it "has correct User-agent" $ do
get RobotsR
bodyContains "User-agent: *"
describe "favicon.ico" $ do
it "gives a 200" $ do
get Favico... | 347 | false | true | 0 | 14 | 150 | 101 | 40 | 61 | null | null |
michalrus/kornel | src/Kornel/LineHandler/Chatter.hs | apache-2.0 | chatter :: Config -> TVar HState -> Text -> IO Text
chatter Config {cleverBotApiKey} state msg =
catchAny
go
(\ex -> do
L.log $ "[WARNING] Kornel.Chatter: error (resetting state): " ++ tshow ex
-- Couteract the weird API error when after a longer time it
-- returns responses with invalid ... | 984 | chatter :: Config -> TVar HState -> Text -> IO Text
chatter Config {cleverBotApiKey} state msg =
catchAny
go
(\ex -> do
L.log $ "[WARNING] Kornel.Chatter: error (resetting state): " ++ tshow ex
-- Couteract the weird API error when after a longer time it
-- returns responses with invalid ... | 984 | chatter Config {cleverBotApiKey} state msg =
catchAny
go
(\ex -> do
L.log $ "[WARNING] Kornel.Chatter: error (resetting state): " ++ tshow ex
-- Couteract the weird API error when after a longer time it
-- returns responses with invalid Unicode in `conversation_id`.
atomically . wr... | 932 | false | true | 3 | 16 | 301 | 250 | 117 | 133 | null | null |
carlostome/wlp-engine | src/Expr.hs | bsd-3-clause | tix :: Var (Array t) -> Expr INT -> Target (Prim t)
tix = TArr | 63 | tix :: Var (Array t) -> Expr INT -> Target (Prim t)
tix = TArr | 63 | tix = TArr | 11 | false | true | 0 | 10 | 15 | 46 | 20 | 26 | null | null |
AlexanderPankiv/ghc | compiler/stgSyn/StgSyn.hs | bsd-3-clause | combineStgBinderInfo _ _ = NoStgBinderInfo | 64 | combineStgBinderInfo _ _ = NoStgBinderInfo | 64 | combineStgBinderInfo _ _ = NoStgBinderInfo | 64 | false | false | 1 | 5 | 26 | 12 | 5 | 7 | null | null |
mightymoose/liquidhaskell | benchmarks/bytestring-0.9.2.1/Data/ByteString/Lazy.hs | bsd-3-clause | uncons (Chunk c cs)
= Just (S.unsafeHead c,
if S.length c == 1 then cs else Chunk (S.unsafeTail c) cs) | 118 | uncons (Chunk c cs)
= Just (S.unsafeHead c,
if S.length c == 1 then cs else Chunk (S.unsafeTail c) cs) | 118 | uncons (Chunk c cs)
= Just (S.unsafeHead c,
if S.length c == 1 then cs else Chunk (S.unsafeTail c) cs) | 118 | false | false | 0 | 11 | 35 | 61 | 30 | 31 | null | null |
zhiyuanshi/fcore | examples/case_studies/HeapSort.hs | bsd-2-clause | --function "removeMax"
removeMax :: Heap -> Heap
removeMax h = case h of (Node _ _ l r) -> merge l r
Leaf -> h
----test for removeMax | 168 | removeMax :: Heap -> Heap
removeMax h = case h of (Node _ _ l r) -> merge l r
Leaf -> h
----test for removeMax | 145 | removeMax h = case h of (Node _ _ l r) -> merge l r
Leaf -> h
----test for removeMax | 119 | true | true | 0 | 9 | 62 | 59 | 28 | 31 | null | null |
thomie/vector | Data/Vector/Unboxed/Mutable.hs | bsd-3-clause | slice = G.slice | 15 | slice = G.slice | 15 | slice = G.slice | 15 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
Erdwolf/autotool-bonn | src/Lambda/Quiz.hs | gpl-2.0 | nontrivial inst = isNothing $ result $ do
let leftmost_strategy = replicate ( fromJust $ I.steps inst ) 0
result <- derive ( I.from inst ) leftmost_strategy
assert ( result == I.to inst ) $ text "OK" | 211 | nontrivial inst = isNothing $ result $ do
let leftmost_strategy = replicate ( fromJust $ I.steps inst ) 0
result <- derive ( I.from inst ) leftmost_strategy
assert ( result == I.to inst ) $ text "OK" | 211 | nontrivial inst = isNothing $ result $ do
let leftmost_strategy = replicate ( fromJust $ I.steps inst ) 0
result <- derive ( I.from inst ) leftmost_strategy
assert ( result == I.to inst ) $ text "OK" | 211 | false | false | 0 | 15 | 48 | 88 | 40 | 48 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.