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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ghcjs/jsaddle-dom
|
src/JSDOM/Generated/Enums.hs
|
mit
|
js_ResponseTypeCors = "cors"
| 28
|
js_ResponseTypeCors = "cors"
| 28
|
js_ResponseTypeCors = "cors"
| 28
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
zeyuanxy/haskell-playground
|
ninety-nine-haskell-problems/vol3/27.hs
|
mit
|
group :: [Int] -> [a] -> [[[a]]]
group [] _ = [[]]
| 50
|
group :: [Int] -> [a] -> [[[a]]]
group [] _ = [[]]
| 50
|
group [] _ = [[]]
| 17
| false
| true
| 0
| 9
| 11
| 46
| 26
| 20
| null | null |
imccoy/utopia
|
app/Main.hs
|
mit
|
--import qualified Html
main :: IO ()
main = do
-- (v1bindingsWithIds, v1projection) <- projectCode Code.v1
-- putStrLn "v1========="
-- let initialDb = initFromProjection v1projection
-- printProjection v1projection
--
-- putStrLn "v2========="
-- (v2bindingsWithIds, v2projection) <- projectCode Code.v2
-- printProjection v2projection
putStrLn "oneshoty====="
oneshotParseTree <- eitherToError . mapLeft (userError . show) $ Code.oneshot
(oneshotBindingsWithIds, oneshotProjection) <- projectCode oneshotParseTree
printProjection oneshotProjection
-- let (reversedDiffResult, diffResult) = diffProjection initialDb v2projection
-- putStrLn $ T.pack $ show diffResult
-- run $ do
-- (m_bindingsWithIds, ch_evaluated) <- runProjection v1bindingsWithIds
-- inM . putStrLn . T.pack . show =<< ch_evaluated
--
-- change m_bindingsWithIds v2bindingsWithIds
-- propagate
-- inM . putStrLn . T.pack . show =<< ch_evaluated
--
-- run $ do
-- m_bindingsWithIds <- newModBy (\bs1 bs2 -> (Set.fromList . map Id._id $ bs1) == (Set.fromList . map Id._id $ bs2)) $ inM $ pure v1bindingsWithIds
-- m_bindingsWithMod <- newMod (mapM Eval.bindingWithMod =<< readMod m_bindingsWithIds)
-- let ch_bindingsWithMod = readMod m_bindingsWithMod
-- let ch_evaluated = eval m_bindingsWithIds ch_bindingsWithMod
--
-- inM . putStrLn . T.pack . show =<< ch_evaluated
--
-- m_v2bindingsWithIds <- newModBy (\bs1 bs2 -> (Set.fromList . map Id._id $ bs1) == (Set.fromList . map Id._id $ bs2)) $ inM $ pure v2bindingsWithIds
-- let zeroCostMappings = Map.map (CodeDbId . DiffTree.dstNodeIdText) $ Map.mapKeys (CodeDbId . DiffTree.srcNodeIdText) $ Diff.zeroCostMappings diffResult
-- let v2reuses = pure . Map.unions =<< mapM (\b -> Eval.bindingExp b >>= Eval.reuses zeroCostMappings) =<< ch_bindingsWithMod
-- let ch_v2bindingsWithMod = do reuses <- v2reuses
-- bindingsWithIds <- readMod m_v2bindingsWithIds
-- mapM (\binding -> Eval.bindingWithModReusing reuses binding) bindingsWithIds
--
-- change m_bindingsWithMod =<< inCh ch_v2bindingsWithMod
-- change m_bindingsWithIds v2bindingsWithIds
-- propagate
-- inM . putStrLn . T.pack . show =<< ch_evaluated
let evaluated = runProjection oneshotBindingsWithIds
case evaluated of
Right success -> putStrLn . T.pack . Eval.pprintVal $ success
Left failure -> mapM_ printError failure
-- let html = renderHtml $ Html.mappingHtml reversedDiffResult diffResult
-- (filePath, handle) <- openTempFile "." ".html"
-- LB.hPut handle html
-- hClose handle
-- putStrLn $ T.pack filePath
-- void $ spawnCommand $ "open " ++ filePath
return ()
| 2,729
|
main :: IO ()
main = do
-- (v1bindingsWithIds, v1projection) <- projectCode Code.v1
-- putStrLn "v1========="
-- let initialDb = initFromProjection v1projection
-- printProjection v1projection
--
-- putStrLn "v2========="
-- (v2bindingsWithIds, v2projection) <- projectCode Code.v2
-- printProjection v2projection
putStrLn "oneshoty====="
oneshotParseTree <- eitherToError . mapLeft (userError . show) $ Code.oneshot
(oneshotBindingsWithIds, oneshotProjection) <- projectCode oneshotParseTree
printProjection oneshotProjection
-- let (reversedDiffResult, diffResult) = diffProjection initialDb v2projection
-- putStrLn $ T.pack $ show diffResult
-- run $ do
-- (m_bindingsWithIds, ch_evaluated) <- runProjection v1bindingsWithIds
-- inM . putStrLn . T.pack . show =<< ch_evaluated
--
-- change m_bindingsWithIds v2bindingsWithIds
-- propagate
-- inM . putStrLn . T.pack . show =<< ch_evaluated
--
-- run $ do
-- m_bindingsWithIds <- newModBy (\bs1 bs2 -> (Set.fromList . map Id._id $ bs1) == (Set.fromList . map Id._id $ bs2)) $ inM $ pure v1bindingsWithIds
-- m_bindingsWithMod <- newMod (mapM Eval.bindingWithMod =<< readMod m_bindingsWithIds)
-- let ch_bindingsWithMod = readMod m_bindingsWithMod
-- let ch_evaluated = eval m_bindingsWithIds ch_bindingsWithMod
--
-- inM . putStrLn . T.pack . show =<< ch_evaluated
--
-- m_v2bindingsWithIds <- newModBy (\bs1 bs2 -> (Set.fromList . map Id._id $ bs1) == (Set.fromList . map Id._id $ bs2)) $ inM $ pure v2bindingsWithIds
-- let zeroCostMappings = Map.map (CodeDbId . DiffTree.dstNodeIdText) $ Map.mapKeys (CodeDbId . DiffTree.srcNodeIdText) $ Diff.zeroCostMappings diffResult
-- let v2reuses = pure . Map.unions =<< mapM (\b -> Eval.bindingExp b >>= Eval.reuses zeroCostMappings) =<< ch_bindingsWithMod
-- let ch_v2bindingsWithMod = do reuses <- v2reuses
-- bindingsWithIds <- readMod m_v2bindingsWithIds
-- mapM (\binding -> Eval.bindingWithModReusing reuses binding) bindingsWithIds
--
-- change m_bindingsWithMod =<< inCh ch_v2bindingsWithMod
-- change m_bindingsWithIds v2bindingsWithIds
-- propagate
-- inM . putStrLn . T.pack . show =<< ch_evaluated
let evaluated = runProjection oneshotBindingsWithIds
case evaluated of
Right success -> putStrLn . T.pack . Eval.pprintVal $ success
Left failure -> mapM_ printError failure
-- let html = renderHtml $ Html.mappingHtml reversedDiffResult diffResult
-- (filePath, handle) <- openTempFile "." ".html"
-- LB.hPut handle html
-- hClose handle
-- putStrLn $ T.pack filePath
-- void $ spawnCommand $ "open " ++ filePath
return ()
| 2,704
|
main = do
-- (v1bindingsWithIds, v1projection) <- projectCode Code.v1
-- putStrLn "v1========="
-- let initialDb = initFromProjection v1projection
-- printProjection v1projection
--
-- putStrLn "v2========="
-- (v2bindingsWithIds, v2projection) <- projectCode Code.v2
-- printProjection v2projection
putStrLn "oneshoty====="
oneshotParseTree <- eitherToError . mapLeft (userError . show) $ Code.oneshot
(oneshotBindingsWithIds, oneshotProjection) <- projectCode oneshotParseTree
printProjection oneshotProjection
-- let (reversedDiffResult, diffResult) = diffProjection initialDb v2projection
-- putStrLn $ T.pack $ show diffResult
-- run $ do
-- (m_bindingsWithIds, ch_evaluated) <- runProjection v1bindingsWithIds
-- inM . putStrLn . T.pack . show =<< ch_evaluated
--
-- change m_bindingsWithIds v2bindingsWithIds
-- propagate
-- inM . putStrLn . T.pack . show =<< ch_evaluated
--
-- run $ do
-- m_bindingsWithIds <- newModBy (\bs1 bs2 -> (Set.fromList . map Id._id $ bs1) == (Set.fromList . map Id._id $ bs2)) $ inM $ pure v1bindingsWithIds
-- m_bindingsWithMod <- newMod (mapM Eval.bindingWithMod =<< readMod m_bindingsWithIds)
-- let ch_bindingsWithMod = readMod m_bindingsWithMod
-- let ch_evaluated = eval m_bindingsWithIds ch_bindingsWithMod
--
-- inM . putStrLn . T.pack . show =<< ch_evaluated
--
-- m_v2bindingsWithIds <- newModBy (\bs1 bs2 -> (Set.fromList . map Id._id $ bs1) == (Set.fromList . map Id._id $ bs2)) $ inM $ pure v2bindingsWithIds
-- let zeroCostMappings = Map.map (CodeDbId . DiffTree.dstNodeIdText) $ Map.mapKeys (CodeDbId . DiffTree.srcNodeIdText) $ Diff.zeroCostMappings diffResult
-- let v2reuses = pure . Map.unions =<< mapM (\b -> Eval.bindingExp b >>= Eval.reuses zeroCostMappings) =<< ch_bindingsWithMod
-- let ch_v2bindingsWithMod = do reuses <- v2reuses
-- bindingsWithIds <- readMod m_v2bindingsWithIds
-- mapM (\binding -> Eval.bindingWithModReusing reuses binding) bindingsWithIds
--
-- change m_bindingsWithMod =<< inCh ch_v2bindingsWithMod
-- change m_bindingsWithIds v2bindingsWithIds
-- propagate
-- inM . putStrLn . T.pack . show =<< ch_evaluated
let evaluated = runProjection oneshotBindingsWithIds
case evaluated of
Right success -> putStrLn . T.pack . Eval.pprintVal $ success
Left failure -> mapM_ printError failure
-- let html = renderHtml $ Html.mappingHtml reversedDiffResult diffResult
-- (filePath, handle) <- openTempFile "." ".html"
-- LB.hPut handle html
-- hClose handle
-- putStrLn $ T.pack filePath
-- void $ spawnCommand $ "open " ++ filePath
return ()
| 2,690
| true
| true
| 0
| 13
| 517
| 181
| 106
| 75
| null | null |
BlackBrane/quantum-random-numbers
|
src-ex/Main.hs
|
mit
|
interp (PeekAll msty) = peekAll msty
| 44
|
interp (PeekAll msty) = peekAll msty
| 44
|
interp (PeekAll msty) = peekAll msty
| 44
| false
| false
| 0
| 6
| 13
| 19
| 8
| 11
| null | null |
joelburget/interplanetary-computation
|
src/Planetary/Library.hs
|
bsd-3-clause
|
-- TODO: converting between uidmap and hashmap is weird
resolve :: Tm' -> Either ResolutionErr TmI
resolve = resolveTm (repo ^. globalCids . to toList . to fromList)
| 165
|
resolve :: Tm' -> Either ResolutionErr TmI
resolve = resolveTm (repo ^. globalCids . to toList . to fromList)
| 109
|
resolve = resolveTm (repo ^. globalCids . to toList . to fromList)
| 66
| true
| true
| 0
| 9
| 27
| 50
| 23
| 27
| null | null |
izgzhen/region
|
src/Transpile.hs
|
mit
|
transpile (EVar x) = return x
| 33
|
transpile (EVar x) = return x
| 33
|
transpile (EVar x) = return x
| 33
| false
| false
| 0
| 7
| 9
| 18
| 8
| 10
| null | null |
sboehler/haskell-valuation
|
src/AAPL/Options.hs
|
bsd-3-clause
|
sigma :: Double
sigma = 0.3
| 27
|
sigma :: Double
sigma = 0.3
| 27
|
sigma = 0.3
| 11
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
tnrangwi/grill
|
src/FormulaEngine/Evaluate.hs
|
mit
|
eval r@(T.Reference _) (SheetRef s) = eval r (FullRef s [])
| 59
|
eval r@(T.Reference _) (SheetRef s) = eval r (FullRef s [])
| 59
|
eval r@(T.Reference _) (SheetRef s) = eval r (FullRef s [])
| 59
| false
| false
| 0
| 8
| 10
| 47
| 21
| 26
| null | null |
danr/hipspec
|
testsuite/prod/zeno_version/PropT47.hs
|
gpl-3.0
|
union [] ys = ys
| 16
|
union [] ys = ys
| 16
|
union [] ys = ys
| 16
| false
| false
| 0
| 6
| 4
| 13
| 6
| 7
| null | null |
Peaker/cabal
|
Cabal/Distribution/Simple.hs
|
bsd-3-clause
|
installAction :: UserHooks -> InstallFlags -> Args -> IO ()
installAction hooks flags args = do
distPref <- findDistPrefOrDefault (installDistPref flags)
let verbosity = fromFlag $ installVerbosity flags
flags' = flags { installDistPref = toFlag distPref }
hookedAction preInst instHook postInst
(getBuildConfig hooks verbosity distPref)
hooks flags' args
| 409
|
installAction :: UserHooks -> InstallFlags -> Args -> IO ()
installAction hooks flags args = do
distPref <- findDistPrefOrDefault (installDistPref flags)
let verbosity = fromFlag $ installVerbosity flags
flags' = flags { installDistPref = toFlag distPref }
hookedAction preInst instHook postInst
(getBuildConfig hooks verbosity distPref)
hooks flags' args
| 409
|
installAction hooks flags args = do
distPref <- findDistPrefOrDefault (installDistPref flags)
let verbosity = fromFlag $ installVerbosity flags
flags' = flags { installDistPref = toFlag distPref }
hookedAction preInst instHook postInst
(getBuildConfig hooks verbosity distPref)
hooks flags' args
| 349
| false
| true
| 0
| 12
| 101
| 111
| 53
| 58
| null | null |
smurphy8/issue-add
|
src/Action/Internal/Label.hs
|
bsd-3-clause
|
-- |These colors have labels
fromLabelColorString :: String -> Either String RepoLabel
fromLabelColorString "FF0000" = Right Bug
| 128
|
fromLabelColorString :: String -> Either String RepoLabel
fromLabelColorString "FF0000" = Right Bug
| 99
|
fromLabelColorString "FF0000" = Right Bug
| 41
| true
| true
| 0
| 6
| 16
| 27
| 13
| 14
| null | null |
leshchevds/ganeti
|
src/Ganeti/WConfd/Core.hs
|
bsd-2-clause
|
-- | Intersect the possesed locks of an owner with a given set.
intersectLocks :: ClientId -> [GanetiLocks] -> WConfdMonad ()
intersectLocks cid locks = modifyLockWaiting_ $ LW.intersectLocks locks cid
| 201
|
intersectLocks :: ClientId -> [GanetiLocks] -> WConfdMonad ()
intersectLocks cid locks = modifyLockWaiting_ $ LW.intersectLocks locks cid
| 137
|
intersectLocks cid locks = modifyLockWaiting_ $ LW.intersectLocks locks cid
| 75
| true
| true
| 0
| 8
| 29
| 44
| 22
| 22
| null | null |
TomMD/ghc
|
compiler/prelude/TysWiredIn.hs
|
bsd-3-clause
|
unboxedTupleArr = listArray (0,mAX_TUPLE_SIZE) [mk_tuple Unboxed i | i <- [0..mAX_TUPLE_SIZE]]
| 94
|
unboxedTupleArr = listArray (0,mAX_TUPLE_SIZE) [mk_tuple Unboxed i | i <- [0..mAX_TUPLE_SIZE]]
| 94
|
unboxedTupleArr = listArray (0,mAX_TUPLE_SIZE) [mk_tuple Unboxed i | i <- [0..mAX_TUPLE_SIZE]]
| 94
| false
| false
| 0
| 9
| 10
| 38
| 20
| 18
| null | null |
hnakamur/haskell-sandbox
|
sandbox-css/SandBox/Text/CSS/Char.hs
|
bsd-3-clause
|
isSpaceChar '\t' = True
| 23
|
isSpaceChar '\t' = True
| 23
|
isSpaceChar '\t' = True
| 23
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
sajit/learnyou
|
haskell/src/baby.hs
|
mit
|
maxValList (x:xs) = max x (maxValList xs)
| 42
|
maxValList (x:xs) = max x (maxValList xs)
| 42
|
maxValList (x:xs) = max x (maxValList xs)
| 42
| false
| false
| 0
| 7
| 7
| 27
| 13
| 14
| null | null |
vladimir-ipatov/ganeti
|
src/Ganeti/Types.hs
|
gpl-2.0
|
-- | Parse submit priorities from a string.
parseSubmitPriority :: (Monad m) => String -> m OpSubmitPriority
parseSubmitPriority "low" = return OpPrioLow
| 156
|
parseSubmitPriority :: (Monad m) => String -> m OpSubmitPriority
parseSubmitPriority "low" = return OpPrioLow
| 112
|
parseSubmitPriority "low" = return OpPrioLow
| 47
| true
| true
| 0
| 7
| 24
| 34
| 17
| 17
| null | null |
Sword-Smith/hfasto
|
src/AMD64CodeGenerator.hs
|
mit
|
ppAMD64 (AMD64.JE l) = "je " ++ l
| 38
|
ppAMD64 (AMD64.JE l) = "je " ++ l
| 38
|
ppAMD64 (AMD64.JE l) = "je " ++ l
| 38
| false
| false
| 0
| 8
| 12
| 21
| 10
| 11
| null | null |
cauterize-tools/crucible
|
lib/Cauterize/Crucible/Prototypes.hs
|
bsd-3-clause
|
protoVarToStr PVVector = "vector"
| 38
|
protoVarToStr PVVector = "vector"
| 38
|
protoVarToStr PVVector = "vector"
| 38
| false
| false
| 0
| 5
| 8
| 9
| 4
| 5
| null | null |
urbanslug/ghc
|
compiler/hsSyn/HsExpr.hs
|
bsd-3-clause
|
ppr_expr (PArrSeq _ info) = paBrackets (ppr info)
| 50
|
ppr_expr (PArrSeq _ info) = paBrackets (ppr info)
| 50
|
ppr_expr (PArrSeq _ info) = paBrackets (ppr info)
| 50
| false
| false
| 0
| 7
| 8
| 26
| 12
| 14
| null | null |
codemac/yi-editor
|
src/Yi/Buffer/Normal.hs
|
gpl-2.0
|
-- maybe do an optimized version?
untilB_ :: BufferM Bool -> BufferM a -> BufferM ()
untilB_ cond f = untilB cond f >> return ()
| 129
|
untilB_ :: BufferM Bool -> BufferM a -> BufferM ()
untilB_ cond f = untilB cond f >> return ()
| 94
|
untilB_ cond f = untilB cond f >> return ()
| 43
| true
| true
| 0
| 8
| 26
| 50
| 23
| 27
| null | null |
edom/sound
|
src/Sound/Hint.hs
|
bsd-3-clause
|
-- | Execute the action and convert a 'Left' result into an 'IOError'.
ioioe :: (Show e) => IO (Either e a) -> IO a
ioioe = (>>= either (Ioe.ioError . Ioe.userError . show) return)
| 180
|
ioioe :: (Show e) => IO (Either e a) -> IO a
ioioe = (>>= either (Ioe.ioError . Ioe.userError . show) return)
| 109
|
ioioe = (>>= either (Ioe.ioError . Ioe.userError . show) return)
| 64
| true
| true
| 0
| 11
| 34
| 69
| 34
| 35
| null | null |
ak1t0/48hscheme
|
Parser.hs
|
mit
|
toDouble (Float x) = x
| 22
|
toDouble (Float x) = x
| 22
|
toDouble (Float x) = x
| 22
| false
| false
| 0
| 6
| 4
| 16
| 7
| 9
| null | null |
urbit/archaeology2
|
outside/commonmark/specfilter.hs
|
mit
|
exampleDivs x = x
| 17
|
exampleDivs x = x
| 17
|
exampleDivs x = x
| 17
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
sgillespie/ghc
|
compiler/cmm/CmmUtils.hs
|
bsd-3-clause
|
cmmNegate dflags e = CmmMachOp (MO_S_Neg (cmmExprWidth dflags e)) [e]
| 91
|
cmmNegate dflags e = CmmMachOp (MO_S_Neg (cmmExprWidth dflags e)) [e]
| 91
|
cmmNegate dflags e = CmmMachOp (MO_S_Neg (cmmExprWidth dflags e)) [e]
| 91
| false
| false
| 0
| 9
| 31
| 34
| 16
| 18
| null | null |
DavidAlphaFox/ghc
|
libraries/Cabal/Cabal/Distribution/Simple/Build.hs
|
bsd-3-clause
|
-- -----------------------------------------------------------------------------
-- |Build the libraries and executables in this package.
build :: PackageDescription -- ^ Mostly information from the .cabal file
-> LocalBuildInfo -- ^ Configuration information
-> BuildFlags -- ^ Flags that the user passed to build
-> [ PPSuffixHandler ] -- ^ preprocessors to run before compiling
-> IO ()
build pkg_descr lbi flags suffixes = do
let distPref = fromFlag (buildDistPref flags)
verbosity = fromFlag (buildVerbosity flags)
targets <- readBuildTargets pkg_descr (buildArgs flags)
targets' <- checkBuildTargets verbosity pkg_descr targets
let componentsToBuild = map fst (componentsInBuildOrder lbi (map fst targets'))
info verbosity $ "Component build order: "
++ intercalate ", " (map showComponentName componentsToBuild)
initialBuildSteps distPref pkg_descr lbi verbosity
when (null targets) $
-- Only bother with this message if we're building the whole package
setupMessage verbosity "Building" (packageId pkg_descr)
internalPackageDB <- createInternalPackageDB verbosity lbi distPref
withComponentsInBuildOrder pkg_descr lbi componentsToBuild $ \comp clbi ->
let bi = componentBuildInfo comp
progs' = addInternalBuildTools pkg_descr lbi bi (withPrograms lbi)
lbi' = lbi {
withPrograms = progs',
withPackageDB = withPackageDB lbi ++ [internalPackageDB]
}
in buildComponent verbosity (buildNumJobs flags) pkg_descr
lbi' suffixes comp clbi distPref
| 1,663
|
build :: PackageDescription -- ^ Mostly information from the .cabal file
-> LocalBuildInfo -- ^ Configuration information
-> BuildFlags -- ^ Flags that the user passed to build
-> [ PPSuffixHandler ] -- ^ preprocessors to run before compiling
-> IO ()
build pkg_descr lbi flags suffixes = do
let distPref = fromFlag (buildDistPref flags)
verbosity = fromFlag (buildVerbosity flags)
targets <- readBuildTargets pkg_descr (buildArgs flags)
targets' <- checkBuildTargets verbosity pkg_descr targets
let componentsToBuild = map fst (componentsInBuildOrder lbi (map fst targets'))
info verbosity $ "Component build order: "
++ intercalate ", " (map showComponentName componentsToBuild)
initialBuildSteps distPref pkg_descr lbi verbosity
when (null targets) $
-- Only bother with this message if we're building the whole package
setupMessage verbosity "Building" (packageId pkg_descr)
internalPackageDB <- createInternalPackageDB verbosity lbi distPref
withComponentsInBuildOrder pkg_descr lbi componentsToBuild $ \comp clbi ->
let bi = componentBuildInfo comp
progs' = addInternalBuildTools pkg_descr lbi bi (withPrograms lbi)
lbi' = lbi {
withPrograms = progs',
withPackageDB = withPackageDB lbi ++ [internalPackageDB]
}
in buildComponent verbosity (buildNumJobs flags) pkg_descr
lbi' suffixes comp clbi distPref
| 1,524
|
build pkg_descr lbi flags suffixes = do
let distPref = fromFlag (buildDistPref flags)
verbosity = fromFlag (buildVerbosity flags)
targets <- readBuildTargets pkg_descr (buildArgs flags)
targets' <- checkBuildTargets verbosity pkg_descr targets
let componentsToBuild = map fst (componentsInBuildOrder lbi (map fst targets'))
info verbosity $ "Component build order: "
++ intercalate ", " (map showComponentName componentsToBuild)
initialBuildSteps distPref pkg_descr lbi verbosity
when (null targets) $
-- Only bother with this message if we're building the whole package
setupMessage verbosity "Building" (packageId pkg_descr)
internalPackageDB <- createInternalPackageDB verbosity lbi distPref
withComponentsInBuildOrder pkg_descr lbi componentsToBuild $ \comp clbi ->
let bi = componentBuildInfo comp
progs' = addInternalBuildTools pkg_descr lbi bi (withPrograms lbi)
lbi' = lbi {
withPrograms = progs',
withPackageDB = withPackageDB lbi ++ [internalPackageDB]
}
in buildComponent verbosity (buildNumJobs flags) pkg_descr
lbi' suffixes comp clbi distPref
| 1,218
| true
| true
| 0
| 16
| 401
| 334
| 162
| 172
| null | null |
mcmaniac/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
-- | These @-f\<blah\>@ flags can all be reversed with @-fno-\<blah\>@
fLangFlags :: [FlagSpec ExtensionFlag]
fLangFlags = [
( "th", Opt_TemplateHaskell,
deprecatedForExtension "TemplateHaskell" >> checkTemplateHaskellOk ),
( "fi", Opt_ForeignFunctionInterface,
deprecatedForExtension "ForeignFunctionInterface" ),
( "ffi", Opt_ForeignFunctionInterface,
deprecatedForExtension "ForeignFunctionInterface" ),
( "arrows", Opt_Arrows,
deprecatedForExtension "Arrows" ),
( "implicit-prelude", Opt_ImplicitPrelude,
deprecatedForExtension "ImplicitPrelude" ),
( "bang-patterns", Opt_BangPatterns,
deprecatedForExtension "BangPatterns" ),
( "monomorphism-restriction", Opt_MonomorphismRestriction,
deprecatedForExtension "MonomorphismRestriction" ),
( "mono-pat-binds", Opt_MonoPatBinds,
deprecatedForExtension "MonoPatBinds" ),
( "extended-default-rules", Opt_ExtendedDefaultRules,
deprecatedForExtension "ExtendedDefaultRules" ),
( "implicit-params", Opt_ImplicitParams,
deprecatedForExtension "ImplicitParams" ),
( "scoped-type-variables", Opt_ScopedTypeVariables,
deprecatedForExtension "ScopedTypeVariables" ),
( "parr", Opt_ParallelArrays,
deprecatedForExtension "ParallelArrays" ),
( "PArr", Opt_ParallelArrays,
deprecatedForExtension "ParallelArrays" ),
( "allow-overlapping-instances", Opt_OverlappingInstances,
deprecatedForExtension "OverlappingInstances" ),
( "allow-undecidable-instances", Opt_UndecidableInstances,
deprecatedForExtension "UndecidableInstances" ),
( "allow-incoherent-instances", Opt_IncoherentInstances,
deprecatedForExtension "IncoherentInstances" )
]
| 1,959
|
fLangFlags :: [FlagSpec ExtensionFlag]
fLangFlags = [
( "th", Opt_TemplateHaskell,
deprecatedForExtension "TemplateHaskell" >> checkTemplateHaskellOk ),
( "fi", Opt_ForeignFunctionInterface,
deprecatedForExtension "ForeignFunctionInterface" ),
( "ffi", Opt_ForeignFunctionInterface,
deprecatedForExtension "ForeignFunctionInterface" ),
( "arrows", Opt_Arrows,
deprecatedForExtension "Arrows" ),
( "implicit-prelude", Opt_ImplicitPrelude,
deprecatedForExtension "ImplicitPrelude" ),
( "bang-patterns", Opt_BangPatterns,
deprecatedForExtension "BangPatterns" ),
( "monomorphism-restriction", Opt_MonomorphismRestriction,
deprecatedForExtension "MonomorphismRestriction" ),
( "mono-pat-binds", Opt_MonoPatBinds,
deprecatedForExtension "MonoPatBinds" ),
( "extended-default-rules", Opt_ExtendedDefaultRules,
deprecatedForExtension "ExtendedDefaultRules" ),
( "implicit-params", Opt_ImplicitParams,
deprecatedForExtension "ImplicitParams" ),
( "scoped-type-variables", Opt_ScopedTypeVariables,
deprecatedForExtension "ScopedTypeVariables" ),
( "parr", Opt_ParallelArrays,
deprecatedForExtension "ParallelArrays" ),
( "PArr", Opt_ParallelArrays,
deprecatedForExtension "ParallelArrays" ),
( "allow-overlapping-instances", Opt_OverlappingInstances,
deprecatedForExtension "OverlappingInstances" ),
( "allow-undecidable-instances", Opt_UndecidableInstances,
deprecatedForExtension "UndecidableInstances" ),
( "allow-incoherent-instances", Opt_IncoherentInstances,
deprecatedForExtension "IncoherentInstances" )
]
| 1,888
|
fLangFlags = [
( "th", Opt_TemplateHaskell,
deprecatedForExtension "TemplateHaskell" >> checkTemplateHaskellOk ),
( "fi", Opt_ForeignFunctionInterface,
deprecatedForExtension "ForeignFunctionInterface" ),
( "ffi", Opt_ForeignFunctionInterface,
deprecatedForExtension "ForeignFunctionInterface" ),
( "arrows", Opt_Arrows,
deprecatedForExtension "Arrows" ),
( "implicit-prelude", Opt_ImplicitPrelude,
deprecatedForExtension "ImplicitPrelude" ),
( "bang-patterns", Opt_BangPatterns,
deprecatedForExtension "BangPatterns" ),
( "monomorphism-restriction", Opt_MonomorphismRestriction,
deprecatedForExtension "MonomorphismRestriction" ),
( "mono-pat-binds", Opt_MonoPatBinds,
deprecatedForExtension "MonoPatBinds" ),
( "extended-default-rules", Opt_ExtendedDefaultRules,
deprecatedForExtension "ExtendedDefaultRules" ),
( "implicit-params", Opt_ImplicitParams,
deprecatedForExtension "ImplicitParams" ),
( "scoped-type-variables", Opt_ScopedTypeVariables,
deprecatedForExtension "ScopedTypeVariables" ),
( "parr", Opt_ParallelArrays,
deprecatedForExtension "ParallelArrays" ),
( "PArr", Opt_ParallelArrays,
deprecatedForExtension "ParallelArrays" ),
( "allow-overlapping-instances", Opt_OverlappingInstances,
deprecatedForExtension "OverlappingInstances" ),
( "allow-undecidable-instances", Opt_UndecidableInstances,
deprecatedForExtension "UndecidableInstances" ),
( "allow-incoherent-instances", Opt_IncoherentInstances,
deprecatedForExtension "IncoherentInstances" )
]
| 1,849
| true
| true
| 0
| 8
| 500
| 262
| 156
| 106
| null | null |
m-alvarez/jhc
|
src/Stats.hs
|
mit
|
mticks 0 _ = return ()
| 22
|
mticks 0 _ = return ()
| 22
|
mticks 0 _ = return ()
| 22
| false
| false
| 0
| 6
| 5
| 16
| 7
| 9
| null | null |
vbalalla/financial_contract_language
|
pfp-jun06/BayesianNetwork.hs
|
mit
|
g = network [source 0.1 A,
source 0.2 B,
bin A B 1 1 0.5 0 E]
| 87
|
g = network [source 0.1 A,
source 0.2 B,
bin A B 1 1 0.5 0 E]
| 87
|
g = network [source 0.1 A,
source 0.2 B,
bin A B 1 1 0.5 0 E]
| 87
| false
| false
| 1
| 7
| 42
| 46
| 21
| 25
| null | null |
ganeti/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
ispecsMin :: String
ispecsMin = "min"
| 37
|
ispecsMin :: String
ispecsMin = "min"
| 37
|
ispecsMin = "min"
| 17
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
quyse/flaw
|
flaw-ui/Flaw/UI/Frame.hs
|
mit
|
-- | Create frame.
-- Internally frame uses panel, and places multiple special elements on it.
newFrame :: Element e => e -> Metrics -> STM Frame
newFrame element Metrics
{ metricsFrameClient = Vec4 clientLeft clientTop clientRight clientBottom
, metricsFrameTopBorder = topBorder
} = do
-- create panel
panel@Panel
{ panelSizeVar = pnlSizeVar
} <- newPanel True
-- create vars
textVar <- newTVar T.empty
textScriptVar <- newTVar fontScriptUnknown
focusedVar <- newTVar False
freeChildVar <- newTVar Nothing
resizableVar <- newTVar False
-- create frame
let
frame = Frame
{ frameElement = SomeElement element
, framePanel = panel
, frameTextVar = textVar
, frameTextScriptVar = textScriptVar
, frameFocusedVar = focusedVar
, frameFreeChildVar = freeChildVar
, frameResizableVar = resizableVar
}
-- add element to panel
elementChild <- addFreeChild panel element
-- create resize elements
let
createFRE (kx, ky, kw, kh) mouseCursor = do
lastMousePositionVar <- newTVar Nothing
let
processInput inputEvent InputState
{ inputStateMouse = mouseState
} = case inputEvent of
MouseInputEvent mouseEvent -> case mouseEvent of
MouseDownEvent LeftMouseButton -> do
-- if we don't have free child, don't even remember last mouse position
maybeSomeFreeChild <- readTVar freeChildVar
when (isJust maybeSomeFreeChild) $ do
(x, y) <- getMouseCursor mouseState
writeTVar lastMousePositionVar $ Just $ Vec2 x y
return True
CursorMoveEvent _x _y -> do
lastMousePosition <- readTVar lastMousePositionVar
case lastMousePosition of
Just (Vec2 lx ly) -> do
maybeSomeFreeChild <- readTVar freeChildVar
case maybeSomeFreeChild of
Just (SomeFreeChild freeContainer freeChild) -> do
-- check that we are resizable (or we don't need to resize anything)
resizable <- readTVar resizableVar
let needSizeChange = kw /= 0 || kh /= 0
when (resizable || not needSizeChange) $ do
(x, y) <- getMouseCursor mouseState
let
dx = x - lx
dy = y - ly
-- change position if needed
when (kx /= 0 || ky /= 0) $
placeFreeChildRelatively freeContainer freeChild $ Vec2 (dx * kx) (dy * ky)
-- change size if needed
when needSizeChange $ do
size <- readTVar pnlSizeVar
let Vec2 sx sy = size
layoutElement frame $ Vec2 (sx + dx * kw) (sy + dy * kh)
-- remember new coordinates
writeTVar lastMousePositionVar $ Just $ Vec2 x y
Nothing -> return ()
return True
Nothing -> return False
MouseUpEvent LeftMouseButton -> do
writeTVar lastMousePositionVar Nothing
return True
_ -> return False
MouseLeaveEvent -> do
writeTVar lastMousePositionVar Nothing
return True
_ -> return False
sizeVar <- newTVar $ Vec2 0 0
let
fre = FrameResizeElement
{ freProcessInput = processInput
, freMouseCursor = mouseCursor
, freSizeVar = sizeVar
, freShowCursorExp = if kw == 0 && kh == 0 then isJust <$> readTVar freeChildVar else readTVar resizableVar
}
freeChild <- addFreeChild panel fre
return (fre, freeChild)
(freNW, freNWChild) <- createFRE (1, 1, -1, -1) MouseCursorSizeNWSE
(freW, freWChild) <- createFRE (1, 0, -1, 0) MouseCursorSizeWE
(freSW, freSWChild) <- createFRE (1, 0, -1, 1) MouseCursorSizeNESW
(freN, freNChild) <- createFRE (0, 1, 0, -1) MouseCursorSizeNS
(freM, freMChild) <- createFRE (1, 1, 0, 0) MouseCursorSizeAll
(freS, freSChild) <- createFRE (0, 0, 0, 1) MouseCursorSizeNS
(freNE, freNEChild) <- createFRE (0, 1, 1, -1) MouseCursorSizeNESW
(freE, freEChild) <- createFRE (0, 0, 1, 0) MouseCursorSizeWE
(freSE, freSEChild) <- createFRE (0, 0, 1, 1) MouseCursorSizeNWSE
-- set layout function
setLayoutHandler panel $ \(Vec2 sx sy) -> do
-- element
placeFreeChild panel elementChild $ Vec2 clientLeft clientTop
layoutElement element $ Vec2 (sx - clientLeft - clientRight) (sy - clientTop - clientBottom)
-- NW
placeFreeChild panel freNWChild $ Vec2 0 0
layoutElement freNW $ Vec2 clientLeft topBorder
-- W
placeFreeChild panel freWChild $ Vec2 0 topBorder
layoutElement freW $ Vec2 clientLeft (sy - topBorder - clientBottom)
-- SW
placeFreeChild panel freSWChild $ Vec2 0 (sy - clientBottom)
layoutElement freSW $ Vec2 clientLeft clientBottom
-- N
placeFreeChild panel freNChild $ Vec2 clientLeft 0
layoutElement freN $ Vec2 (sx - clientLeft - clientRight) topBorder
-- M
placeFreeChild panel freMChild $ Vec2 clientLeft topBorder
layoutElement freM $ Vec2 (sx - clientLeft - clientRight) (clientTop - topBorder)
-- S
placeFreeChild panel freSChild $ Vec2 clientLeft (sy - clientBottom)
layoutElement freS $ Vec2 (sx - clientLeft - clientRight) clientBottom
-- NE
placeFreeChild panel freNEChild $ Vec2 (sx - clientRight) 0
layoutElement freNE $ Vec2 clientRight topBorder
-- E
placeFreeChild panel freEChild $ Vec2 (sx - clientRight) topBorder
layoutElement freE $ Vec2 clientRight (sy - topBorder - clientBottom)
-- SE
placeFreeChild panel freSEChild $ Vec2 (sx - clientRight) (sy - clientBottom)
layoutElement freSE $ Vec2 clientRight clientBottom
return frame
| 5,998
|
newFrame :: Element e => e -> Metrics -> STM Frame
newFrame element Metrics
{ metricsFrameClient = Vec4 clientLeft clientTop clientRight clientBottom
, metricsFrameTopBorder = topBorder
} = do
-- create panel
panel@Panel
{ panelSizeVar = pnlSizeVar
} <- newPanel True
-- create vars
textVar <- newTVar T.empty
textScriptVar <- newTVar fontScriptUnknown
focusedVar <- newTVar False
freeChildVar <- newTVar Nothing
resizableVar <- newTVar False
-- create frame
let
frame = Frame
{ frameElement = SomeElement element
, framePanel = panel
, frameTextVar = textVar
, frameTextScriptVar = textScriptVar
, frameFocusedVar = focusedVar
, frameFreeChildVar = freeChildVar
, frameResizableVar = resizableVar
}
-- add element to panel
elementChild <- addFreeChild panel element
-- create resize elements
let
createFRE (kx, ky, kw, kh) mouseCursor = do
lastMousePositionVar <- newTVar Nothing
let
processInput inputEvent InputState
{ inputStateMouse = mouseState
} = case inputEvent of
MouseInputEvent mouseEvent -> case mouseEvent of
MouseDownEvent LeftMouseButton -> do
-- if we don't have free child, don't even remember last mouse position
maybeSomeFreeChild <- readTVar freeChildVar
when (isJust maybeSomeFreeChild) $ do
(x, y) <- getMouseCursor mouseState
writeTVar lastMousePositionVar $ Just $ Vec2 x y
return True
CursorMoveEvent _x _y -> do
lastMousePosition <- readTVar lastMousePositionVar
case lastMousePosition of
Just (Vec2 lx ly) -> do
maybeSomeFreeChild <- readTVar freeChildVar
case maybeSomeFreeChild of
Just (SomeFreeChild freeContainer freeChild) -> do
-- check that we are resizable (or we don't need to resize anything)
resizable <- readTVar resizableVar
let needSizeChange = kw /= 0 || kh /= 0
when (resizable || not needSizeChange) $ do
(x, y) <- getMouseCursor mouseState
let
dx = x - lx
dy = y - ly
-- change position if needed
when (kx /= 0 || ky /= 0) $
placeFreeChildRelatively freeContainer freeChild $ Vec2 (dx * kx) (dy * ky)
-- change size if needed
when needSizeChange $ do
size <- readTVar pnlSizeVar
let Vec2 sx sy = size
layoutElement frame $ Vec2 (sx + dx * kw) (sy + dy * kh)
-- remember new coordinates
writeTVar lastMousePositionVar $ Just $ Vec2 x y
Nothing -> return ()
return True
Nothing -> return False
MouseUpEvent LeftMouseButton -> do
writeTVar lastMousePositionVar Nothing
return True
_ -> return False
MouseLeaveEvent -> do
writeTVar lastMousePositionVar Nothing
return True
_ -> return False
sizeVar <- newTVar $ Vec2 0 0
let
fre = FrameResizeElement
{ freProcessInput = processInput
, freMouseCursor = mouseCursor
, freSizeVar = sizeVar
, freShowCursorExp = if kw == 0 && kh == 0 then isJust <$> readTVar freeChildVar else readTVar resizableVar
}
freeChild <- addFreeChild panel fre
return (fre, freeChild)
(freNW, freNWChild) <- createFRE (1, 1, -1, -1) MouseCursorSizeNWSE
(freW, freWChild) <- createFRE (1, 0, -1, 0) MouseCursorSizeWE
(freSW, freSWChild) <- createFRE (1, 0, -1, 1) MouseCursorSizeNESW
(freN, freNChild) <- createFRE (0, 1, 0, -1) MouseCursorSizeNS
(freM, freMChild) <- createFRE (1, 1, 0, 0) MouseCursorSizeAll
(freS, freSChild) <- createFRE (0, 0, 0, 1) MouseCursorSizeNS
(freNE, freNEChild) <- createFRE (0, 1, 1, -1) MouseCursorSizeNESW
(freE, freEChild) <- createFRE (0, 0, 1, 0) MouseCursorSizeWE
(freSE, freSEChild) <- createFRE (0, 0, 1, 1) MouseCursorSizeNWSE
-- set layout function
setLayoutHandler panel $ \(Vec2 sx sy) -> do
-- element
placeFreeChild panel elementChild $ Vec2 clientLeft clientTop
layoutElement element $ Vec2 (sx - clientLeft - clientRight) (sy - clientTop - clientBottom)
-- NW
placeFreeChild panel freNWChild $ Vec2 0 0
layoutElement freNW $ Vec2 clientLeft topBorder
-- W
placeFreeChild panel freWChild $ Vec2 0 topBorder
layoutElement freW $ Vec2 clientLeft (sy - topBorder - clientBottom)
-- SW
placeFreeChild panel freSWChild $ Vec2 0 (sy - clientBottom)
layoutElement freSW $ Vec2 clientLeft clientBottom
-- N
placeFreeChild panel freNChild $ Vec2 clientLeft 0
layoutElement freN $ Vec2 (sx - clientLeft - clientRight) topBorder
-- M
placeFreeChild panel freMChild $ Vec2 clientLeft topBorder
layoutElement freM $ Vec2 (sx - clientLeft - clientRight) (clientTop - topBorder)
-- S
placeFreeChild panel freSChild $ Vec2 clientLeft (sy - clientBottom)
layoutElement freS $ Vec2 (sx - clientLeft - clientRight) clientBottom
-- NE
placeFreeChild panel freNEChild $ Vec2 (sx - clientRight) 0
layoutElement freNE $ Vec2 clientRight topBorder
-- E
placeFreeChild panel freEChild $ Vec2 (sx - clientRight) topBorder
layoutElement freE $ Vec2 clientRight (sy - topBorder - clientBottom)
-- SE
placeFreeChild panel freSEChild $ Vec2 (sx - clientRight) (sy - clientBottom)
layoutElement freSE $ Vec2 clientRight clientBottom
return frame
| 5,903
|
newFrame element Metrics
{ metricsFrameClient = Vec4 clientLeft clientTop clientRight clientBottom
, metricsFrameTopBorder = topBorder
} = do
-- create panel
panel@Panel
{ panelSizeVar = pnlSizeVar
} <- newPanel True
-- create vars
textVar <- newTVar T.empty
textScriptVar <- newTVar fontScriptUnknown
focusedVar <- newTVar False
freeChildVar <- newTVar Nothing
resizableVar <- newTVar False
-- create frame
let
frame = Frame
{ frameElement = SomeElement element
, framePanel = panel
, frameTextVar = textVar
, frameTextScriptVar = textScriptVar
, frameFocusedVar = focusedVar
, frameFreeChildVar = freeChildVar
, frameResizableVar = resizableVar
}
-- add element to panel
elementChild <- addFreeChild panel element
-- create resize elements
let
createFRE (kx, ky, kw, kh) mouseCursor = do
lastMousePositionVar <- newTVar Nothing
let
processInput inputEvent InputState
{ inputStateMouse = mouseState
} = case inputEvent of
MouseInputEvent mouseEvent -> case mouseEvent of
MouseDownEvent LeftMouseButton -> do
-- if we don't have free child, don't even remember last mouse position
maybeSomeFreeChild <- readTVar freeChildVar
when (isJust maybeSomeFreeChild) $ do
(x, y) <- getMouseCursor mouseState
writeTVar lastMousePositionVar $ Just $ Vec2 x y
return True
CursorMoveEvent _x _y -> do
lastMousePosition <- readTVar lastMousePositionVar
case lastMousePosition of
Just (Vec2 lx ly) -> do
maybeSomeFreeChild <- readTVar freeChildVar
case maybeSomeFreeChild of
Just (SomeFreeChild freeContainer freeChild) -> do
-- check that we are resizable (or we don't need to resize anything)
resizable <- readTVar resizableVar
let needSizeChange = kw /= 0 || kh /= 0
when (resizable || not needSizeChange) $ do
(x, y) <- getMouseCursor mouseState
let
dx = x - lx
dy = y - ly
-- change position if needed
when (kx /= 0 || ky /= 0) $
placeFreeChildRelatively freeContainer freeChild $ Vec2 (dx * kx) (dy * ky)
-- change size if needed
when needSizeChange $ do
size <- readTVar pnlSizeVar
let Vec2 sx sy = size
layoutElement frame $ Vec2 (sx + dx * kw) (sy + dy * kh)
-- remember new coordinates
writeTVar lastMousePositionVar $ Just $ Vec2 x y
Nothing -> return ()
return True
Nothing -> return False
MouseUpEvent LeftMouseButton -> do
writeTVar lastMousePositionVar Nothing
return True
_ -> return False
MouseLeaveEvent -> do
writeTVar lastMousePositionVar Nothing
return True
_ -> return False
sizeVar <- newTVar $ Vec2 0 0
let
fre = FrameResizeElement
{ freProcessInput = processInput
, freMouseCursor = mouseCursor
, freSizeVar = sizeVar
, freShowCursorExp = if kw == 0 && kh == 0 then isJust <$> readTVar freeChildVar else readTVar resizableVar
}
freeChild <- addFreeChild panel fre
return (fre, freeChild)
(freNW, freNWChild) <- createFRE (1, 1, -1, -1) MouseCursorSizeNWSE
(freW, freWChild) <- createFRE (1, 0, -1, 0) MouseCursorSizeWE
(freSW, freSWChild) <- createFRE (1, 0, -1, 1) MouseCursorSizeNESW
(freN, freNChild) <- createFRE (0, 1, 0, -1) MouseCursorSizeNS
(freM, freMChild) <- createFRE (1, 1, 0, 0) MouseCursorSizeAll
(freS, freSChild) <- createFRE (0, 0, 0, 1) MouseCursorSizeNS
(freNE, freNEChild) <- createFRE (0, 1, 1, -1) MouseCursorSizeNESW
(freE, freEChild) <- createFRE (0, 0, 1, 0) MouseCursorSizeWE
(freSE, freSEChild) <- createFRE (0, 0, 1, 1) MouseCursorSizeNWSE
-- set layout function
setLayoutHandler panel $ \(Vec2 sx sy) -> do
-- element
placeFreeChild panel elementChild $ Vec2 clientLeft clientTop
layoutElement element $ Vec2 (sx - clientLeft - clientRight) (sy - clientTop - clientBottom)
-- NW
placeFreeChild panel freNWChild $ Vec2 0 0
layoutElement freNW $ Vec2 clientLeft topBorder
-- W
placeFreeChild panel freWChild $ Vec2 0 topBorder
layoutElement freW $ Vec2 clientLeft (sy - topBorder - clientBottom)
-- SW
placeFreeChild panel freSWChild $ Vec2 0 (sy - clientBottom)
layoutElement freSW $ Vec2 clientLeft clientBottom
-- N
placeFreeChild panel freNChild $ Vec2 clientLeft 0
layoutElement freN $ Vec2 (sx - clientLeft - clientRight) topBorder
-- M
placeFreeChild panel freMChild $ Vec2 clientLeft topBorder
layoutElement freM $ Vec2 (sx - clientLeft - clientRight) (clientTop - topBorder)
-- S
placeFreeChild panel freSChild $ Vec2 clientLeft (sy - clientBottom)
layoutElement freS $ Vec2 (sx - clientLeft - clientRight) clientBottom
-- NE
placeFreeChild panel freNEChild $ Vec2 (sx - clientRight) 0
layoutElement freNE $ Vec2 clientRight topBorder
-- E
placeFreeChild panel freEChild $ Vec2 (sx - clientRight) topBorder
layoutElement freE $ Vec2 clientRight (sy - topBorder - clientBottom)
-- SE
placeFreeChild panel freSEChild $ Vec2 (sx - clientRight) (sy - clientBottom)
layoutElement freSE $ Vec2 clientRight clientBottom
return frame
| 5,852
| true
| true
| 0
| 43
| 1,907
| 1,636
| 798
| 838
| null | null |
berdario/managemytime
|
src/ManageMyTime.hs
|
bsd-3-clause
|
userLink :: Key User -> URI
userLink = apiLink (Proxy :: Proxy (Auth :> "user" :> Capture "id" (Key User) :> Get '[JSON] UserWithPerm))
| 135
|
userLink :: Key User -> URI
userLink = apiLink (Proxy :: Proxy (Auth :> "user" :> Capture "id" (Key User) :> Get '[JSON] UserWithPerm))
| 135
|
userLink = apiLink (Proxy :: Proxy (Auth :> "user" :> Capture "id" (Key User) :> Get '[JSON] UserWithPerm))
| 107
| false
| true
| 0
| 14
| 23
| 66
| 33
| 33
| null | null |
iu-parfunc/haskell-streamit
|
Language/StreamIt/Compile.hs
|
bsd-3-clause
|
generateSharedLib :: FilePath -> IO String
generateSharedLib tdir = do
bracket getCurrentDirectory setCurrentDirectory
(\_ -> do
setCurrentDirectory tdir
txt <- readFile "combined_threads.cpp"
writeFile "combined_threads.cpp" $
DT.unpack (DT.replace (DT.pack "int main(int argc") (DT.pack "extern \"C\" int smain(int argc") (DT.pack txt))
exist <- fileExist "combined_threads.o"
when exist $ removeFile "combined_threads.o"
exitCode <- rawSystem "g++" ["-O3 -fPIC -I$STREAMIT_HOME/library/cluster", "-c -o combined_threads.o" , "combined_threads.cpp"]
when (exitCode /= ExitSuccess) $
fail "g++ failed."
exitCode <- rawSystem "g++" ["-O3 -fPIC -shared -Wl,-soname,libaout.so -o ../libaout.so", "combined_threads.o", "-L$STREAMIT_HOME/library/cluster", "-lpthread -lcluster -lstdc++"]
when (exitCode /= ExitSuccess) $
fail "g++ failed.")
return "libaout.so"
-- Compile and embed the resulting executable as a lazy bytestring
| 1,035
|
generateSharedLib :: FilePath -> IO String
generateSharedLib tdir = do
bracket getCurrentDirectory setCurrentDirectory
(\_ -> do
setCurrentDirectory tdir
txt <- readFile "combined_threads.cpp"
writeFile "combined_threads.cpp" $
DT.unpack (DT.replace (DT.pack "int main(int argc") (DT.pack "extern \"C\" int smain(int argc") (DT.pack txt))
exist <- fileExist "combined_threads.o"
when exist $ removeFile "combined_threads.o"
exitCode <- rawSystem "g++" ["-O3 -fPIC -I$STREAMIT_HOME/library/cluster", "-c -o combined_threads.o" , "combined_threads.cpp"]
when (exitCode /= ExitSuccess) $
fail "g++ failed."
exitCode <- rawSystem "g++" ["-O3 -fPIC -shared -Wl,-soname,libaout.so -o ../libaout.so", "combined_threads.o", "-L$STREAMIT_HOME/library/cluster", "-lpthread -lcluster -lstdc++"]
when (exitCode /= ExitSuccess) $
fail "g++ failed.")
return "libaout.so"
-- Compile and embed the resulting executable as a lazy bytestring
| 1,035
|
generateSharedLib tdir = do
bracket getCurrentDirectory setCurrentDirectory
(\_ -> do
setCurrentDirectory tdir
txt <- readFile "combined_threads.cpp"
writeFile "combined_threads.cpp" $
DT.unpack (DT.replace (DT.pack "int main(int argc") (DT.pack "extern \"C\" int smain(int argc") (DT.pack txt))
exist <- fileExist "combined_threads.o"
when exist $ removeFile "combined_threads.o"
exitCode <- rawSystem "g++" ["-O3 -fPIC -I$STREAMIT_HOME/library/cluster", "-c -o combined_threads.o" , "combined_threads.cpp"]
when (exitCode /= ExitSuccess) $
fail "g++ failed."
exitCode <- rawSystem "g++" ["-O3 -fPIC -shared -Wl,-soname,libaout.so -o ../libaout.so", "combined_threads.o", "-L$STREAMIT_HOME/library/cluster", "-lpthread -lcluster -lstdc++"]
when (exitCode /= ExitSuccess) $
fail "g++ failed.")
return "libaout.so"
-- Compile and embed the resulting executable as a lazy bytestring
| 992
| false
| true
| 0
| 18
| 215
| 221
| 103
| 118
| null | null |
jtobin/okasaki
|
working/RedBlackTree.hs
|
mit
|
-- exercise 3.10a (improve balance)
lbalance :: Color -> Tree a -> a -> Tree a -> Tree a
lbalance Black (Node Red (Node Red a x b) y c) z d =
Node Red (Node Black a x b) y (Node Black c z d)
| 192
|
lbalance :: Color -> Tree a -> a -> Tree a -> Tree a
lbalance Black (Node Red (Node Red a x b) y c) z d =
Node Red (Node Black a x b) y (Node Black c z d)
| 156
|
lbalance Black (Node Red (Node Red a x b) y c) z d =
Node Red (Node Black a x b) y (Node Black c z d)
| 103
| true
| true
| 0
| 14
| 47
| 109
| 51
| 58
| null | null |
denibertovic/haskell
|
kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs
|
bsd-3-clause
|
-- | 'v1APIResourceGroup' Lens
v1APIResourceGroupL :: Lens_' V1APIResource (Maybe Text)
v1APIResourceGroupL f V1APIResource{..} = (\v1APIResourceGroup -> V1APIResource { v1APIResourceGroup, ..} ) <$> f v1APIResourceGroup
| 220
|
v1APIResourceGroupL :: Lens_' V1APIResource (Maybe Text)
v1APIResourceGroupL f V1APIResource{..} = (\v1APIResourceGroup -> V1APIResource { v1APIResourceGroup, ..} ) <$> f v1APIResourceGroup
| 189
|
v1APIResourceGroupL f V1APIResource{..} = (\v1APIResourceGroup -> V1APIResource { v1APIResourceGroup, ..} ) <$> f v1APIResourceGroup
| 132
| true
| true
| 1
| 8
| 23
| 62
| 30
| 32
| null | null |
josuf107/Adverb
|
Adverb/Common.hs
|
gpl-3.0
|
frostily = id
| 13
|
frostily = id
| 13
|
frostily = id
| 13
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
antalsz/hs-to-coq
|
structural-isomorphism-plugin/src/StructuralIsomorphism/Isomorphizing.hs
|
mit
|
--------------------------------------------------------------------------------
alreadyIsomorphic :: Monad m => Name -> Name -> IsomorphizingT m Bool
alreadyIsomorphic n1 n2 = gets $ S.member (n1,n2)
| 201
|
alreadyIsomorphic :: Monad m => Name -> Name -> IsomorphizingT m Bool
alreadyIsomorphic n1 n2 = gets $ S.member (n1,n2)
| 119
|
alreadyIsomorphic n1 n2 = gets $ S.member (n1,n2)
| 49
| true
| true
| 0
| 8
| 21
| 52
| 26
| 26
| null | null |
apunktbau/co4
|
test/CO4/Example/WCB_MatrixStandalone.hs
|
gpl-3.0
|
cost :: Base -> Base -> Energy
cost b1 b2 = case b1 of
A -> case b2 of { U -> two ; _ -> mi }
C -> case b2 of { G -> three; _ -> mi }
G -> case b2 of { C -> three; U -> one; _ -> mi }
U -> case b2 of { A -> two ; G -> one; _ -> mi }
-- * secondary struct
| 286
|
cost :: Base -> Base -> Energy
cost b1 b2 = case b1 of
A -> case b2 of { U -> two ; _ -> mi }
C -> case b2 of { G -> three; _ -> mi }
G -> case b2 of { C -> three; U -> one; _ -> mi }
U -> case b2 of { A -> two ; G -> one; _ -> mi }
-- * secondary struct
| 286
|
cost b1 b2 = case b1 of
A -> case b2 of { U -> two ; _ -> mi }
C -> case b2 of { G -> three; _ -> mi }
G -> case b2 of { C -> three; U -> one; _ -> mi }
U -> case b2 of { A -> two ; G -> one; _ -> mi }
-- * secondary struct
| 255
| false
| true
| 0
| 10
| 109
| 143
| 79
| 64
| null | null |
alexander-at-github/eta
|
compiler/ETA/TypeCheck/TcRnTypes.hs
|
bsd-3-clause
|
pprCtO (LiteralOrigin lit) = hsep [ptext (sLit "the literal"), quotes (ppr lit)]
| 82
|
pprCtO (LiteralOrigin lit) = hsep [ptext (sLit "the literal"), quotes (ppr lit)]
| 82
|
pprCtO (LiteralOrigin lit) = hsep [ptext (sLit "the literal"), quotes (ppr lit)]
| 82
| false
| false
| 0
| 9
| 13
| 43
| 20
| 23
| null | null |
Lepovirta/Crystallize
|
test/Web/ServerSpec.hs
|
bsd-3-clause
|
validParams =
[ ("crystal[company]","")
, ("crystal[email]","")
, ("crystal[topaasia_green]","")
, ("crystal[topaasia_red]","")
, ("crystal[improvement_green]","")
, ("crystal[improvement_red]","")
, ("crystal[lead_green]","")
, ("crystal[lead_red]","")
, ("crystal[last_used]","")
, ("crystal[rating]","")
, ("crystal[next_session]","")
, ("crystal[category_cards_red_1]","")
, ("crystal[category_cards_red_2]","")
, ("crystal[category_cards_red_3]","")
, ("crystal[category_cards_red_4]","")
, ("crystal[category_cards_red_5]","")
, ("crystal[category_cards_red_6]","")
, ("crystal[category_cards_green_1]","")
, ("crystal[category_cards_green_2]","")
, ("crystal[category_cards_green_3]","")
, ("crystal[category_cards_green_4]","")
, ("crystal[category_cards_green_5]","")
, ("crystal[category_cards_green_6]","")
]
| 915
|
validParams =
[ ("crystal[company]","")
, ("crystal[email]","")
, ("crystal[topaasia_green]","")
, ("crystal[topaasia_red]","")
, ("crystal[improvement_green]","")
, ("crystal[improvement_red]","")
, ("crystal[lead_green]","")
, ("crystal[lead_red]","")
, ("crystal[last_used]","")
, ("crystal[rating]","")
, ("crystal[next_session]","")
, ("crystal[category_cards_red_1]","")
, ("crystal[category_cards_red_2]","")
, ("crystal[category_cards_red_3]","")
, ("crystal[category_cards_red_4]","")
, ("crystal[category_cards_red_5]","")
, ("crystal[category_cards_red_6]","")
, ("crystal[category_cards_green_1]","")
, ("crystal[category_cards_green_2]","")
, ("crystal[category_cards_green_3]","")
, ("crystal[category_cards_green_4]","")
, ("crystal[category_cards_green_5]","")
, ("crystal[category_cards_green_6]","")
]
| 915
|
validParams =
[ ("crystal[company]","")
, ("crystal[email]","")
, ("crystal[topaasia_green]","")
, ("crystal[topaasia_red]","")
, ("crystal[improvement_green]","")
, ("crystal[improvement_red]","")
, ("crystal[lead_green]","")
, ("crystal[lead_red]","")
, ("crystal[last_used]","")
, ("crystal[rating]","")
, ("crystal[next_session]","")
, ("crystal[category_cards_red_1]","")
, ("crystal[category_cards_red_2]","")
, ("crystal[category_cards_red_3]","")
, ("crystal[category_cards_red_4]","")
, ("crystal[category_cards_red_5]","")
, ("crystal[category_cards_red_6]","")
, ("crystal[category_cards_green_1]","")
, ("crystal[category_cards_green_2]","")
, ("crystal[category_cards_green_3]","")
, ("crystal[category_cards_green_4]","")
, ("crystal[category_cards_green_5]","")
, ("crystal[category_cards_green_6]","")
]
| 915
| false
| false
| 1
| 6
| 144
| 216
| 141
| 75
| null | null |
vjoki/llvm-hs-pretty
|
src/LLVM/Pretty.hs
|
mit
|
hlinecat :: [Doc] -> Doc
hlinecat = vcat . intersperse softbreak
| 64
|
hlinecat :: [Doc] -> Doc
hlinecat = vcat . intersperse softbreak
| 64
|
hlinecat = vcat . intersperse softbreak
| 39
| false
| true
| 0
| 6
| 10
| 25
| 13
| 12
| null | null |
peterokagey/haskellOEIS
|
src/Sandbox/Sami/CycleStructureTools.hs
|
apache-2.0
|
firstDifference = permutationProduct . map reverse
| 50
|
firstDifference = permutationProduct . map reverse
| 50
|
firstDifference = permutationProduct . map reverse
| 50
| false
| false
| 0
| 6
| 5
| 13
| 6
| 7
| null | null |
timjb/protocol-buffers
|
hprotoc/Text/ProtocolBuffers/ProtoCompile/Gen.hs
|
apache-2.0
|
useType 17 = Just "Int32"
| 25
|
useType 17 = Just "Int32"
| 25
|
useType 17 = Just "Int32"
| 25
| false
| false
| 1
| 5
| 4
| 16
| 5
| 11
| null | null |
rueshyna/gogol
|
gogol-logging/gen/Network/Google/Resource/Logging/Projects/Sinks/Create.hs
|
mpl-2.0
|
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
pscUploadProtocol :: Lens' ProjectsSinksCreate (Maybe Text)
pscUploadProtocol
= lens _pscUploadProtocol
(\ s a -> s{_pscUploadProtocol = a})
| 210
|
pscUploadProtocol :: Lens' ProjectsSinksCreate (Maybe Text)
pscUploadProtocol
= lens _pscUploadProtocol
(\ s a -> s{_pscUploadProtocol = a})
| 148
|
pscUploadProtocol
= lens _pscUploadProtocol
(\ s a -> s{_pscUploadProtocol = a})
| 88
| true
| true
| 0
| 8
| 33
| 49
| 25
| 24
| null | null |
nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles
|
BasicLibraries/src/Queue.hs
|
gpl-3.0
|
-- adds an item
push :: a -> Queue a -> Queue a
push x (Queue enq deq) = Queue (x:enq) deq
| 90
|
push :: a -> Queue a -> Queue a
push x (Queue enq deq) = Queue (x:enq) deq
| 74
|
push x (Queue enq deq) = Queue (x:enq) deq
| 42
| true
| true
| 0
| 10
| 21
| 55
| 26
| 29
| null | null |
janschulz/pandoc
|
src/Text/Pandoc/Writers/CommonMark.hs
|
gpl-2.0
|
blockToNodes (BlockQuote bs) =
(node BLOCK_QUOTE (blocksToNodes bs) :)
| 72
|
blockToNodes (BlockQuote bs) =
(node BLOCK_QUOTE (blocksToNodes bs) :)
| 72
|
blockToNodes (BlockQuote bs) =
(node BLOCK_QUOTE (blocksToNodes bs) :)
| 72
| false
| false
| 0
| 8
| 10
| 30
| 15
| 15
| null | null |
sjoerdvisscher/icfp2011
|
src/Brain/Tom.hs
|
bsd-3-clause
|
doAttack :: B SlotNr
doAttack = do
opSlots <- slots opponent
let ss = map snd . sortBy cmp . (map . first $ Core.vitality &&& size . Core.field)
$ zip (V.toList opSlots) [255,254..]
(s:_) <- return ss
let opSlot = opSlots V.! (255 - s)
let v = Core.vitality opSlot
if v == 0
then return s
else if v == 1
then do
(p:_) <- free
p `applyFieldToCard` Dec
p `applyInt` s
doAttack
else do
(p:q:_) <- free
proSlots <- slots proponent
let proSlot = proSlots V.! p
let v' = Core.vitality proSlot
attack p s (minimum [v * 10 `div` 9 + 1, v' - 1, 5556]) q
doAttack
| 714
|
doAttack :: B SlotNr
doAttack = do
opSlots <- slots opponent
let ss = map snd . sortBy cmp . (map . first $ Core.vitality &&& size . Core.field)
$ zip (V.toList opSlots) [255,254..]
(s:_) <- return ss
let opSlot = opSlots V.! (255 - s)
let v = Core.vitality opSlot
if v == 0
then return s
else if v == 1
then do
(p:_) <- free
p `applyFieldToCard` Dec
p `applyInt` s
doAttack
else do
(p:q:_) <- free
proSlots <- slots proponent
let proSlot = proSlots V.! p
let v' = Core.vitality proSlot
attack p s (minimum [v * 10 `div` 9 + 1, v' - 1, 5556]) q
doAttack
| 714
|
doAttack = do
opSlots <- slots opponent
let ss = map snd . sortBy cmp . (map . first $ Core.vitality &&& size . Core.field)
$ zip (V.toList opSlots) [255,254..]
(s:_) <- return ss
let opSlot = opSlots V.! (255 - s)
let v = Core.vitality opSlot
if v == 0
then return s
else if v == 1
then do
(p:_) <- free
p `applyFieldToCard` Dec
p `applyInt` s
doAttack
else do
(p:q:_) <- free
proSlots <- slots proponent
let proSlot = proSlots V.! p
let v' = Core.vitality proSlot
attack p s (minimum [v * 10 `div` 9 + 1, v' - 1, 5556]) q
doAttack
| 693
| false
| true
| 2
| 14
| 272
| 308
| 155
| 153
| null | null |
jeannekamikaze/Spear
|
Spear/Math/Matrix4.hs
|
mit
|
-- | Transpose the specified matrix.
transpose :: Matrix4 -> Matrix4
transpose m = mat4
(m00 m) (m01 m) (m02 m) (m03 m)
(m10 m) (m11 m) (m12 m) (m13 m)
(m20 m) (m21 m) (m22 m) (m23 m)
(m30 m) (m31 m) (m32 m) (m33 m)
| 237
|
transpose :: Matrix4 -> Matrix4
transpose m = mat4
(m00 m) (m01 m) (m02 m) (m03 m)
(m10 m) (m11 m) (m12 m) (m13 m)
(m20 m) (m21 m) (m22 m) (m23 m)
(m30 m) (m31 m) (m32 m) (m33 m)
| 198
|
transpose m = mat4
(m00 m) (m01 m) (m02 m) (m03 m)
(m10 m) (m11 m) (m12 m) (m13 m)
(m20 m) (m21 m) (m22 m) (m23 m)
(m30 m) (m31 m) (m32 m) (m33 m)
| 166
| true
| true
| 0
| 7
| 68
| 168
| 75
| 93
| null | null |
wxwxwwxxx/ghc
|
compiler/rename/RnTypes.hs
|
bsd-3-clause
|
-- emptyFVs: this occurrence does not refer to a
-- binding, so don't treat it as a free variable
rnHsTyKi isType doc (HsWildCardTy (NamedWildCard rdr_name))
= ASSERT( isType )
do { not_in_scope <- isNothing `fmap` lookupOccRn_maybe rdr_name
; when not_in_scope $
-- When the named wild card is not in scope, it means it shouldn't be
-- there in the first place, i.e. rnHsSigTypeWithWildCards wasn't
-- used, so fail.
failWith $ text "Unexpected wild card:" <+> quotes (ppr rdr_name) $$
docOfHsDocContext doc
; name <- rnTyVar isType rdr_name
; return (HsWildCardTy (NamedWildCard name), emptyFVs) }
| 702
|
rnHsTyKi isType doc (HsWildCardTy (NamedWildCard rdr_name))
= ASSERT( isType )
do { not_in_scope <- isNothing `fmap` lookupOccRn_maybe rdr_name
; when not_in_scope $
-- When the named wild card is not in scope, it means it shouldn't be
-- there in the first place, i.e. rnHsSigTypeWithWildCards wasn't
-- used, so fail.
failWith $ text "Unexpected wild card:" <+> quotes (ppr rdr_name) $$
docOfHsDocContext doc
; name <- rnTyVar isType rdr_name
; return (HsWildCardTy (NamedWildCard name), emptyFVs) }
| 584
|
rnHsTyKi isType doc (HsWildCardTy (NamedWildCard rdr_name))
= ASSERT( isType )
do { not_in_scope <- isNothing `fmap` lookupOccRn_maybe rdr_name
; when not_in_scope $
-- When the named wild card is not in scope, it means it shouldn't be
-- there in the first place, i.e. rnHsSigTypeWithWildCards wasn't
-- used, so fail.
failWith $ text "Unexpected wild card:" <+> quotes (ppr rdr_name) $$
docOfHsDocContext doc
; name <- rnTyVar isType rdr_name
; return (HsWildCardTy (NamedWildCard name), emptyFVs) }
| 584
| true
| false
| 0
| 12
| 197
| 129
| 65
| 64
| null | null |
bitemyapp/ghc
|
compiler/basicTypes/SrcLoc.hs
|
bsd-3-clause
|
srcSpanEndCol SrcSpanOneLine{ srcSpanECol=c } = c
| 49
|
srcSpanEndCol SrcSpanOneLine{ srcSpanECol=c } = c
| 49
|
srcSpanEndCol SrcSpanOneLine{ srcSpanECol=c } = c
| 49
| false
| false
| 0
| 8
| 5
| 18
| 9
| 9
| null | null |
ezyang/ghc
|
testsuite/tests/pmcheck/should_compile/T2204.hs
|
bsd-3-clause
|
f :: String -> Int
f "01" = 0
| 29
|
f :: String -> Int
f "01" = 0
| 29
|
f "01" = 0
| 10
| false
| true
| 0
| 7
| 8
| 24
| 10
| 14
| null | null |
rueshyna/gogol
|
gogol-script/gen/Network/Google/Script/Types/Product.hs
|
mpl-2.0
|
-- | The error type, for example \`TypeError\` or \`ReferenceError\`. If the
-- error type is unavailable, this field is not included.
eeErrorType :: Lens' ExecutionError (Maybe Text)
eeErrorType
= lens _eeErrorType (\ s a -> s{_eeErrorType = a})
| 248
|
eeErrorType :: Lens' ExecutionError (Maybe Text)
eeErrorType
= lens _eeErrorType (\ s a -> s{_eeErrorType = a})
| 113
|
eeErrorType
= lens _eeErrorType (\ s a -> s{_eeErrorType = a})
| 64
| true
| true
| 1
| 9
| 40
| 53
| 26
| 27
| null | null |
chaosim/peasy
|
coffee/samples/Parsing.hs
|
mit
|
orderedListMarker :: ListNumberStyle
-> ListNumberDelim
-> Parser [Char] ParserState Int
orderedListMarker style delim = do
let num = defaultNum <|> -- # can continue any kind of list
case style of
DefaultStyle -> decimal
Example -> exampleNum
Decimal -> decimal
UpperRoman -> upperRoman
LowerRoman -> lowerRoman
UpperAlpha -> upperAlpha
LowerAlpha -> lowerAlpha
let context = case delim of
DefaultDelim -> inPeriod
Period -> inPeriod
OneParen -> inOneParen
TwoParens -> inTwoParens
(start, _, _) <- context num
return start
-- | Parses a character reference and returns a Str element.
| 839
|
orderedListMarker :: ListNumberStyle
-> ListNumberDelim
-> Parser [Char] ParserState Int
orderedListMarker style delim = do
let num = defaultNum <|> -- # can continue any kind of list
case style of
DefaultStyle -> decimal
Example -> exampleNum
Decimal -> decimal
UpperRoman -> upperRoman
LowerRoman -> lowerRoman
UpperAlpha -> upperAlpha
LowerAlpha -> lowerAlpha
let context = case delim of
DefaultDelim -> inPeriod
Period -> inPeriod
OneParen -> inOneParen
TwoParens -> inTwoParens
(start, _, _) <- context num
return start
-- | Parses a character reference and returns a Str element.
| 839
|
orderedListMarker style delim = do
let num = defaultNum <|> -- # can continue any kind of list
case style of
DefaultStyle -> decimal
Example -> exampleNum
Decimal -> decimal
UpperRoman -> upperRoman
LowerRoman -> lowerRoman
UpperAlpha -> upperAlpha
LowerAlpha -> lowerAlpha
let context = case delim of
DefaultDelim -> inPeriod
Period -> inPeriod
OneParen -> inOneParen
TwoParens -> inTwoParens
(start, _, _) <- context num
return start
-- | Parses a character reference and returns a Str element.
| 714
| false
| true
| 0
| 13
| 342
| 157
| 78
| 79
| null | null |
urv/fixhs
|
src/Data/FIX/Spec/FIX42.hs
|
lgpl-2.1
|
tTickDirection :: FIXTag
tTickDirection = FIXTag
{ tName = "TickDirection"
, tnum = 274
, tparser = toFIXChar
, arbitraryValue = FIXChar <$> (return 'A') }
| 168
|
tTickDirection :: FIXTag
tTickDirection = FIXTag
{ tName = "TickDirection"
, tnum = 274
, tparser = toFIXChar
, arbitraryValue = FIXChar <$> (return 'A') }
| 168
|
tTickDirection = FIXTag
{ tName = "TickDirection"
, tnum = 274
, tparser = toFIXChar
, arbitraryValue = FIXChar <$> (return 'A') }
| 143
| false
| true
| 0
| 10
| 38
| 51
| 29
| 22
| null | null |
JoshuaGross/haskell-learning-log
|
Code/Haskellbook/catchall/src/LearnParsers.hs
|
mit
|
oneEof :: Parser ()
oneEof = one >> eof
| 39
|
oneEof :: Parser ()
oneEof = one >> eof
| 39
|
oneEof = one >> eof
| 19
| false
| true
| 0
| 6
| 8
| 20
| 10
| 10
| null | null |
nevrenato/Hets_Fork
|
CSL/ATC_CSL.hs
|
gpl-2.0
|
_tcEXTPARAMTc :: TyCon
_tcEXTPARAMTc = mkTyCon "CSL.AS_BASIC_CSL.EXTPARAM"
| 74
|
_tcEXTPARAMTc :: TyCon
_tcEXTPARAMTc = mkTyCon "CSL.AS_BASIC_CSL.EXTPARAM"
| 74
|
_tcEXTPARAMTc = mkTyCon "CSL.AS_BASIC_CSL.EXTPARAM"
| 51
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
svenssonjoel/GCDObsidian
|
Examples.hs
|
bsd-3-clause
|
getReduceSAdd = putStrLn$ CUDA.genKernel "reduceSAdd" (reduceS (+)) input8
| 74
|
getReduceSAdd = putStrLn$ CUDA.genKernel "reduceSAdd" (reduceS (+)) input8
| 74
|
getReduceSAdd = putStrLn$ CUDA.genKernel "reduceSAdd" (reduceS (+)) input8
| 74
| false
| false
| 3
| 7
| 7
| 33
| 14
| 19
| null | null |
dterei/Scraps
|
haskell/freemtl/FAlgebra.hs
|
bsd-3-clause
|
lst :: Fix (ListF Int)
lst = Fx $ Cons 1 $ Fx $ Cons 2 $ Fx $ Cons 3 $ Fx Nil
| 77
|
lst :: Fix (ListF Int)
lst = Fx $ Cons 1 $ Fx $ Cons 2 $ Fx $ Cons 3 $ Fx Nil
| 77
|
lst = Fx $ Cons 1 $ Fx $ Cons 2 $ Fx $ Cons 3 $ Fx Nil
| 54
| false
| true
| 8
| 8
| 23
| 65
| 26
| 39
| null | null |
brendanhay/gogol
|
gogol-sourcerepo/gen/Network/Google/Resource/SourceRepo/Projects/UpdateConfig.hs
|
mpl-2.0
|
-- | Multipart request metadata.
pucPayload :: Lens' ProjectsUpdateConfig UpdateProjectConfigRequest
pucPayload
= lens _pucPayload (\ s a -> s{_pucPayload = a})
| 162
|
pucPayload :: Lens' ProjectsUpdateConfig UpdateProjectConfigRequest
pucPayload
= lens _pucPayload (\ s a -> s{_pucPayload = a})
| 129
|
pucPayload
= lens _pucPayload (\ s a -> s{_pucPayload = a})
| 61
| true
| true
| 1
| 9
| 22
| 46
| 22
| 24
| null | null |
ony/hledger
|
site/hakyll-std/TableOfContents.hs
|
gpl-3.0
|
generateTOC _ _ x = x
| 21
|
generateTOC _ _ x = x
| 21
|
generateTOC _ _ x = x
| 21
| false
| false
| 1
| 5
| 5
| 12
| 5
| 7
| null | null |
djeik/goto
|
libgoto/Language/X86/Virtual/Registers.hs
|
mit
|
r10 :: VirtualOperand label
r10 = fixedIntReg64 R10
| 51
|
r10 :: VirtualOperand label
r10 = fixedIntReg64 R10
| 51
|
r10 = fixedIntReg64 R10
| 23
| false
| true
| 0
| 6
| 7
| 23
| 9
| 14
| null | null |
ucsd-progsys/nanomaly
|
src/NanoML/Step.hs
|
bsd-3-clause
|
isValueOrFunVar e = return (isValue e)
| 38
|
isValueOrFunVar e = return (isValue e)
| 38
|
isValueOrFunVar e = return (isValue e)
| 38
| false
| false
| 0
| 7
| 5
| 18
| 8
| 10
| null | null |
kfish/zoom-cache
|
tests/Properties.hs
|
bsd-2-clause
|
roundTripWord :: Word -> Bool
roundTripWord = roundTrip
| 55
|
roundTripWord :: Word -> Bool
roundTripWord = roundTrip
| 55
|
roundTripWord = roundTrip
| 25
| false
| true
| 0
| 5
| 7
| 15
| 8
| 7
| null | null |
alexander-at-github/eta
|
compiler/ETA/Utils/Pretty.hs
|
bsd-3-clause
|
punctuate _ [] = []
| 23
|
punctuate _ [] = []
| 23
|
punctuate _ [] = []
| 23
| false
| false
| 0
| 6
| 8
| 19
| 8
| 11
| null | null |
olorin/amazonka
|
amazonka-ec2/gen/Network/AWS/EC2/ReplaceNetworkACLEntry.hs
|
mpl-2.0
|
-- | Creates a value of 'ReplaceNetworkACLEntry' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'rnaeICMPTypeCode'
--
-- * 'rnaePortRange'
--
-- * 'rnaeDryRun'
--
-- * 'rnaeNetworkACLId'
--
-- * 'rnaeRuleNumber'
--
-- * 'rnaeProtocol'
--
-- * 'rnaeRuleAction'
--
-- * 'rnaeEgress'
--
-- * 'rnaeCIdRBlock'
replaceNetworkACLEntry
:: Text -- ^ 'rnaeNetworkACLId'
-> Int -- ^ 'rnaeRuleNumber'
-> Text -- ^ 'rnaeProtocol'
-> RuleAction -- ^ 'rnaeRuleAction'
-> Bool -- ^ 'rnaeEgress'
-> Text -- ^ 'rnaeCIdRBlock'
-> ReplaceNetworkACLEntry
replaceNetworkACLEntry pNetworkACLId_ pRuleNumber_ pProtocol_ pRuleAction_ pEgress_ pCIdRBlock_ =
ReplaceNetworkACLEntry'
{ _rnaeICMPTypeCode = Nothing
, _rnaePortRange = Nothing
, _rnaeDryRun = Nothing
, _rnaeNetworkACLId = pNetworkACLId_
, _rnaeRuleNumber = pRuleNumber_
, _rnaeProtocol = pProtocol_
, _rnaeRuleAction = pRuleAction_
, _rnaeEgress = pEgress_
, _rnaeCIdRBlock = pCIdRBlock_
}
| 1,084
|
replaceNetworkACLEntry
:: Text -- ^ 'rnaeNetworkACLId'
-> Int -- ^ 'rnaeRuleNumber'
-> Text -- ^ 'rnaeProtocol'
-> RuleAction -- ^ 'rnaeRuleAction'
-> Bool -- ^ 'rnaeEgress'
-> Text -- ^ 'rnaeCIdRBlock'
-> ReplaceNetworkACLEntry
replaceNetworkACLEntry pNetworkACLId_ pRuleNumber_ pProtocol_ pRuleAction_ pEgress_ pCIdRBlock_ =
ReplaceNetworkACLEntry'
{ _rnaeICMPTypeCode = Nothing
, _rnaePortRange = Nothing
, _rnaeDryRun = Nothing
, _rnaeNetworkACLId = pNetworkACLId_
, _rnaeRuleNumber = pRuleNumber_
, _rnaeProtocol = pProtocol_
, _rnaeRuleAction = pRuleAction_
, _rnaeEgress = pEgress_
, _rnaeCIdRBlock = pCIdRBlock_
}
| 693
|
replaceNetworkACLEntry pNetworkACLId_ pRuleNumber_ pProtocol_ pRuleAction_ pEgress_ pCIdRBlock_ =
ReplaceNetworkACLEntry'
{ _rnaeICMPTypeCode = Nothing
, _rnaePortRange = Nothing
, _rnaeDryRun = Nothing
, _rnaeNetworkACLId = pNetworkACLId_
, _rnaeRuleNumber = pRuleNumber_
, _rnaeProtocol = pProtocol_
, _rnaeRuleAction = pRuleAction_
, _rnaeEgress = pEgress_
, _rnaeCIdRBlock = pCIdRBlock_
}
| 436
| true
| true
| 0
| 12
| 216
| 140
| 90
| 50
| null | null |
apollo-lang/apollo
|
src/Midi.hs
|
mit
|
- Takes a part and outputs [[Track]] with padding using partToTracKHelp
partToTrack :: [Atom] -> [[(Ticks, Message)]]
partToTrack atoms = partToTrackHelp (replicate (longestAtom atoms) []) atoms
| 195
|
partToTrack :: [Atom] -> [[(Ticks, Message)]]
partToTrack atoms = partToTrackHelp (replicate (longestAtom atoms) []) atoms
| 122
|
partToTrack atoms = partToTrackHelp (replicate (longestAtom atoms) []) atoms
| 76
| true
| true
| 2
| 9
| 26
| 77
| 40
| 37
| null | null |
tibbe/network-bytestring
|
tests/Simple.hs
|
bsd-2-clause
|
testRecv :: Test
testRecv = TestCase $ connectedTest client server
where
server sock = recv sock 1024 >>= (@=?) testMsg
client sock = send sock testMsg
| 167
|
testRecv :: Test
testRecv = TestCase $ connectedTest client server
where
server sock = recv sock 1024 >>= (@=?) testMsg
client sock = send sock testMsg
| 167
|
testRecv = TestCase $ connectedTest client server
where
server sock = recv sock 1024 >>= (@=?) testMsg
client sock = send sock testMsg
| 150
| false
| true
| 0
| 8
| 41
| 57
| 28
| 29
| null | null |
ambiata/highlighting-kate
|
Text/Highlighting/Kate/Syntax/Email.hs
|
gpl-2.0
|
-- | Parse an expression using appropriate local context.
parseExpression :: Maybe (String,String)
-> KateParser Token
parseExpression mbcontext = do
(lang,cont) <- maybe currentContext return mbcontext
result <- parseRules (lang,cont)
optional $ do eof
updateState $ \st -> st{ synStPrevChar = '\n' }
pEndLine
return result
| 380
|
parseExpression :: Maybe (String,String)
-> KateParser Token
parseExpression mbcontext = do
(lang,cont) <- maybe currentContext return mbcontext
result <- parseRules (lang,cont)
optional $ do eof
updateState $ \st -> st{ synStPrevChar = '\n' }
pEndLine
return result
| 322
|
parseExpression mbcontext = do
(lang,cont) <- maybe currentContext return mbcontext
result <- parseRules (lang,cont)
optional $ do eof
updateState $ \st -> st{ synStPrevChar = '\n' }
pEndLine
return result
| 245
| true
| true
| 0
| 13
| 101
| 106
| 52
| 54
| null | null |
ktvoelker/hjc
|
Util.hs
|
gpl-3.0
|
unique :: HsU.Uniquable u => u -> Expr
unique = Literal . LitInteger . toInteger . HsU.getKey . HsU.getUnique
| 109
|
unique :: HsU.Uniquable u => u -> Expr
unique = Literal . LitInteger . toInteger . HsU.getKey . HsU.getUnique
| 109
|
unique = Literal . LitInteger . toInteger . HsU.getKey . HsU.getUnique
| 70
| false
| true
| 2
| 8
| 18
| 53
| 23
| 30
| null | null |
rubik/stack
|
src/Stack/Types/BuildPlan.hs
|
bsd-3-clause
|
compToText CompBenchmark = "benchmark"
| 38
|
compToText CompBenchmark = "benchmark"
| 38
|
compToText CompBenchmark = "benchmark"
| 38
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
maruks/haskell-book
|
src/Chapter11_adt.hs
|
gpl-3.0
|
fingerTaps :: [(Digit, Presses)] -> Presses
fingerTaps xs = getSum $ foldMap (Sum . snd) xs
| 92
|
fingerTaps :: [(Digit, Presses)] -> Presses
fingerTaps xs = getSum $ foldMap (Sum . snd) xs
| 91
|
fingerTaps xs = getSum $ foldMap (Sum . snd) xs
| 47
| false
| true
| 0
| 8
| 16
| 43
| 23
| 20
| null | null |
icyfork/shellcheck
|
ShellCheck/Analytics.hs
|
gpl-3.0
|
prop_checkPSf2 = verify checkPS1Assignments "PS1='\\h \\e[0m\\$ '"
| 66
|
prop_checkPSf2 = verify checkPS1Assignments "PS1='\\h \\e[0m\\$ '"
| 66
|
prop_checkPSf2 = verify checkPS1Assignments "PS1='\\h \\e[0m\\$ '"
| 66
| false
| false
| 1
| 5
| 6
| 15
| 5
| 10
| null | null |
pgj/bead
|
src/Bead/Config/Configuration.hs
|
bsd-3-clause
|
-- The defualt system parameters
defaultConfiguration = Config {
userActionLogFile = joinPath ["log", "useractions.log"]
, sessionTimeout = 1200
#ifdef EmailEnabled
, emailHostname = "http://127.0.0.1:8000"
, emailFromAddress = "noreply@bead.org"
#endif
, defaultLoginLanguage = "en"
, defaultRegistrationTimezone = "UTC"
, timeZoneInfoDirectory = "/usr/share/zoneinfo"
, maxUploadSizeInKb = 128
, loginConfig = defaultLoginConfig
, persistConfig = defaultPersistConfig
}
| 503
|
defaultConfiguration = Config {
userActionLogFile = joinPath ["log", "useractions.log"]
, sessionTimeout = 1200
#ifdef EmailEnabled
, emailHostname = "http://127.0.0.1:8000"
, emailFromAddress = "noreply@bead.org"
#endif
, defaultLoginLanguage = "en"
, defaultRegistrationTimezone = "UTC"
, timeZoneInfoDirectory = "/usr/share/zoneinfo"
, maxUploadSizeInKb = 128
, loginConfig = defaultLoginConfig
, persistConfig = defaultPersistConfig
}
| 470
|
defaultConfiguration = Config {
userActionLogFile = joinPath ["log", "useractions.log"]
, sessionTimeout = 1200
#ifdef EmailEnabled
, emailHostname = "http://127.0.0.1:8000"
, emailFromAddress = "noreply@bead.org"
#endif
, defaultLoginLanguage = "en"
, defaultRegistrationTimezone = "UTC"
, timeZoneInfoDirectory = "/usr/share/zoneinfo"
, maxUploadSizeInKb = 128
, loginConfig = defaultLoginConfig
, persistConfig = defaultPersistConfig
}
| 470
| true
| false
| 1
| 9
| 85
| 84
| 52
| 32
| null | null |
DominikJaniec/LearnHaskell
|
problems/calculator/src/ArgsParser.hs
|
mit
|
help :: String
help = unlines
[ "Incorrect execution parameters:"
, " $ calculator -n:SAMPLE expr1 [expr2..n]"
, ""
, " -n:SAMPLE - where {SAMPLE} is Mathematical Notation key"
, " expr1 [expr2..n] - list of expressions in given Notation to calculate"
]
| 291
|
help :: String
help = unlines
[ "Incorrect execution parameters:"
, " $ calculator -n:SAMPLE expr1 [expr2..n]"
, ""
, " -n:SAMPLE - where {SAMPLE} is Mathematical Notation key"
, " expr1 [expr2..n] - list of expressions in given Notation to calculate"
]
| 291
|
help = unlines
[ "Incorrect execution parameters:"
, " $ calculator -n:SAMPLE expr1 [expr2..n]"
, ""
, " -n:SAMPLE - where {SAMPLE} is Mathematical Notation key"
, " expr1 [expr2..n] - list of expressions in given Notation to calculate"
]
| 276
| false
| true
| 0
| 6
| 80
| 29
| 17
| 12
| null | null |
Zolomon/edan40-chatterbot
|
Pattern.hs
|
mit
|
longerWildcardMatch _ [] = Nothing
| 34
|
longerWildcardMatch _ [] = Nothing
| 34
|
longerWildcardMatch _ [] = Nothing
| 34
| false
| false
| 0
| 6
| 4
| 13
| 6
| 7
| null | null |
xymostech/tsh-hs
|
Tsh.hs
|
bsd-2-clause
|
doLoop :: IORef [Job] -> IO ()
doLoop jobsvar = do
putStr "tsh> "
hFlush stdout
eof <- isEOF
if eof then
return ()
else do
line <- getLine
wait <- evalCommand line jobsvar
case wait of
True -> waitFG jobsvar
False -> return ()
doLoop jobsvar
| 325
|
doLoop :: IORef [Job] -> IO ()
doLoop jobsvar = do
putStr "tsh> "
hFlush stdout
eof <- isEOF
if eof then
return ()
else do
line <- getLine
wait <- evalCommand line jobsvar
case wait of
True -> waitFG jobsvar
False -> return ()
doLoop jobsvar
| 325
|
doLoop jobsvar = do
putStr "tsh> "
hFlush stdout
eof <- isEOF
if eof then
return ()
else do
line <- getLine
wait <- evalCommand line jobsvar
case wait of
True -> waitFG jobsvar
False -> return ()
doLoop jobsvar
| 294
| false
| true
| 0
| 14
| 130
| 116
| 51
| 65
| null | null |
keithodulaigh/Hets
|
OWL2/XML.hs
|
gpl-2.0
|
getOntologyIRI :: XMLBase -> Element -> OntologyIRI
getOntologyIRI b e =
let oi = findAttr (unqual "ontologyIRI") e
in case oi of
Nothing -> dummyQName
Just iri -> appendBase b
$ nullQName {localPart = iri, iriType = cssIRI iri}
| 248
|
getOntologyIRI :: XMLBase -> Element -> OntologyIRI
getOntologyIRI b e =
let oi = findAttr (unqual "ontologyIRI") e
in case oi of
Nothing -> dummyQName
Just iri -> appendBase b
$ nullQName {localPart = iri, iriType = cssIRI iri}
| 248
|
getOntologyIRI b e =
let oi = findAttr (unqual "ontologyIRI") e
in case oi of
Nothing -> dummyQName
Just iri -> appendBase b
$ nullQName {localPart = iri, iriType = cssIRI iri}
| 196
| false
| true
| 0
| 13
| 58
| 89
| 44
| 45
| null | null |
fmapfmapfmap/amazonka
|
amazonka-iam/gen/Network/AWS/IAM/Types/Product.hs
|
mpl-2.0
|
-- | The date when the access key was created.
akmCreateDate :: Lens' AccessKeyMetadata (Maybe UTCTime)
akmCreateDate = lens _akmCreateDate (\ s a -> s{_akmCreateDate = a}) . mapping _Time
| 188
|
akmCreateDate :: Lens' AccessKeyMetadata (Maybe UTCTime)
akmCreateDate = lens _akmCreateDate (\ s a -> s{_akmCreateDate = a}) . mapping _Time
| 141
|
akmCreateDate = lens _akmCreateDate (\ s a -> s{_akmCreateDate = a}) . mapping _Time
| 84
| true
| true
| 0
| 10
| 29
| 53
| 28
| 25
| null | null |
UweSchmidt/ppl2
|
src/PPL2/VM/ALU/MicroOps.hs
|
mit
|
-- ----------------------------------------
--
-- lift for binary functions with 2 results
microComp2'2 :: Prism' v a ->
Prism' v b ->
Prism' v c ->
Prism' v d ->
(a -> b -> (c, d)) ->
MicroInstr v
microComp2'2 pa pb pc pd oc = do -- !!! last operand is on top of stack
(res1, res2) <- flip oc <$> popMV pb <*> popMV pa
pushMV pc res1
pushMV pd res2
-- ----------------------------------------
| 486
|
microComp2'2 :: Prism' v a ->
Prism' v b ->
Prism' v c ->
Prism' v d ->
(a -> b -> (c, d)) ->
MicroInstr v
microComp2'2 pa pb pc pd oc = do -- !!! last operand is on top of stack
(res1, res2) <- flip oc <$> popMV pb <*> popMV pa
pushMV pc res1
pushMV pd res2
-- ----------------------------------------
| 393
|
microComp2'2 pa pb pc pd oc = do -- !!! last operand is on top of stack
(res1, res2) <- flip oc <$> popMV pb <*> popMV pa
pushMV pc res1
pushMV pd res2
-- ----------------------------------------
| 206
| true
| true
| 0
| 13
| 166
| 133
| 65
| 68
| null | null |
rgleichman/roshask
|
src/executable/PkgBuilder.hs
|
bsd-3-clause
|
packageRegistered :: ToolPaths -> FilePath -> IO Bool
packageRegistered tools pkg =
any (isPrefixOf cabalPkg . dropWhile isSpace) . lines <$> getList
where cabalPkg = (rosPkg2CabalPkg $ pathToRosPkg pkg) ++
"-" ++ B.unpack roshaskVersion
getList = myReadProcess $ ghcPkg tools ["list", cabalPkg]
-- | Build all messages defined by a ROS package unless the corresponding
-- Haskell package is already registered with ghc-pkg.
| 457
|
packageRegistered :: ToolPaths -> FilePath -> IO Bool
packageRegistered tools pkg =
any (isPrefixOf cabalPkg . dropWhile isSpace) . lines <$> getList
where cabalPkg = (rosPkg2CabalPkg $ pathToRosPkg pkg) ++
"-" ++ B.unpack roshaskVersion
getList = myReadProcess $ ghcPkg tools ["list", cabalPkg]
-- | Build all messages defined by a ROS package unless the corresponding
-- Haskell package is already registered with ghc-pkg.
| 457
|
packageRegistered tools pkg =
any (isPrefixOf cabalPkg . dropWhile isSpace) . lines <$> getList
where cabalPkg = (rosPkg2CabalPkg $ pathToRosPkg pkg) ++
"-" ++ B.unpack roshaskVersion
getList = myReadProcess $ ghcPkg tools ["list", cabalPkg]
-- | Build all messages defined by a ROS package unless the corresponding
-- Haskell package is already registered with ghc-pkg.
| 403
| false
| true
| 1
| 10
| 95
| 105
| 52
| 53
| null | null |
aweinstock314/neural-networks
|
emit_neuralnet_tikzcode.hs
|
apache-2.0
|
nn_xs 2 = [0..3]
| 16
|
nn_xs 2 = [0..3]
| 16
|
nn_xs 2 = [0..3]
| 16
| false
| false
| 0
| 5
| 3
| 14
| 7
| 7
| null | null |
uuhan/Idris-dev
|
src/Idris/Unlit.hs
|
bsd-3-clause
|
-- Replace with spaces, otherwise text position numbers will be bogus.
ulLine ('>':xs) = (Prog, ' ' :xs)
| 118
|
ulLine ('>':xs) = (Prog, ' ' :xs)
| 47
|
ulLine ('>':xs) = (Prog, ' ' :xs)
| 47
| true
| false
| 0
| 7
| 31
| 27
| 15
| 12
| null | null |
marknsikora/codejam
|
351101/C.hs
|
mit
|
main = do
tests <- readLn
forM_ [1..tests] $ \caseNum -> do
str <- getLine
let ans = concatMap insertPause . groupBy pauseNeeded $ numified where
numified = map numify str
pauseNeeded = (==) `on` head
insertPause = unwords
printf "Case #%d: %s\n" (caseNum::Int) ans
| 314
|
main = do
tests <- readLn
forM_ [1..tests] $ \caseNum -> do
str <- getLine
let ans = concatMap insertPause . groupBy pauseNeeded $ numified where
numified = map numify str
pauseNeeded = (==) `on` head
insertPause = unwords
printf "Case #%d: %s\n" (caseNum::Int) ans
| 314
|
main = do
tests <- readLn
forM_ [1..tests] $ \caseNum -> do
str <- getLine
let ans = concatMap insertPause . groupBy pauseNeeded $ numified where
numified = map numify str
pauseNeeded = (==) `on` head
insertPause = unwords
printf "Case #%d: %s\n" (caseNum::Int) ans
| 314
| false
| false
| 0
| 16
| 93
| 109
| 55
| 54
| null | null |
ben-han-cn/hdns
|
Network/ZDNS/Types/Name.hs
|
bsd-3-clause
|
mkLabels :: String -> LabelVec -> Maybe LabelVec
mkLabels s labels = if L.null ls
then Just $ V.snoc labels emptyLabel
else
case mkLabel ls of
Nothing -> Nothing
Just l -> mkLabels (L.drop 1 left) (V.snoc labels l)
where (ls, left) = L.break (\c -> c == '.') s
| 402
|
mkLabels :: String -> LabelVec -> Maybe LabelVec
mkLabels s labels = if L.null ls
then Just $ V.snoc labels emptyLabel
else
case mkLabel ls of
Nothing -> Nothing
Just l -> mkLabels (L.drop 1 left) (V.snoc labels l)
where (ls, left) = L.break (\c -> c == '.') s
| 402
|
mkLabels s labels = if L.null ls
then Just $ V.snoc labels emptyLabel
else
case mkLabel ls of
Nothing -> Nothing
Just l -> mkLabels (L.drop 1 left) (V.snoc labels l)
where (ls, left) = L.break (\c -> c == '.') s
| 353
| false
| true
| 0
| 12
| 191
| 135
| 66
| 69
| null | null |
rueshyna/gogol
|
gogol-fitness/gen/Network/Google/Fitness/Types/Product.hs
|
mpl-2.0
|
-- | An optional URI that can be used to link back to the application.
aDetailsURL :: Lens' Application (Maybe Text)
aDetailsURL
= lens _aDetailsURL (\ s a -> s{_aDetailsURL = a})
| 181
|
aDetailsURL :: Lens' Application (Maybe Text)
aDetailsURL
= lens _aDetailsURL (\ s a -> s{_aDetailsURL = a})
| 110
|
aDetailsURL
= lens _aDetailsURL (\ s a -> s{_aDetailsURL = a})
| 64
| true
| true
| 0
| 9
| 33
| 48
| 25
| 23
| null | null |
hasufell/hsfm
|
src/HSFM/FileSystem/FileType.hs
|
gpl-2.0
|
pathToFile :: (Path Abs -> IO a)
-> Path Abs
-> IO (File a)
pathToFile ff p = do
fs <- PF.getSymbolicLinkStatus (P.toFilePath p)
fv <- ff p
constructFile fs fv p
where
constructFile fs fv p'
| PF.isSymbolicLink fs = do
-- symlink madness, we need to make sure we save the correct
-- File
x <- PF.readSymbolicLink (P.fromAbs p')
resolvedSyml <- handleIOError (\_ -> return Nothing) $ do
-- watch out, we call </> from 'filepath' here, but it is safe
let sfp = (P.fromAbs . P.dirname $ p') </> x
rsfp <- realpath sfp
f <- pathToFile ff =<< P.parseAbs rsfp
return $ Just f
return $ SymLink p' fv resolvedSyml x
| PF.isDirectory fs = return $ Dir p' fv
| PF.isRegularFile fs = return $ RegFile p' fv
| PF.isBlockDevice fs = return $ BlockDev p' fv
| PF.isCharacterDevice fs = return $ CharDev p' fv
| PF.isNamedPipe fs = return $ NamedPipe p' fv
| PF.isSocket fs = return $ Socket p' fv
| otherwise = ioError $ userError "Unknown filetype!"
-- |Get the contents of a given directory and return them as a list
-- of `AnchoredFile`.
| 1,290
|
pathToFile :: (Path Abs -> IO a)
-> Path Abs
-> IO (File a)
pathToFile ff p = do
fs <- PF.getSymbolicLinkStatus (P.toFilePath p)
fv <- ff p
constructFile fs fv p
where
constructFile fs fv p'
| PF.isSymbolicLink fs = do
-- symlink madness, we need to make sure we save the correct
-- File
x <- PF.readSymbolicLink (P.fromAbs p')
resolvedSyml <- handleIOError (\_ -> return Nothing) $ do
-- watch out, we call </> from 'filepath' here, but it is safe
let sfp = (P.fromAbs . P.dirname $ p') </> x
rsfp <- realpath sfp
f <- pathToFile ff =<< P.parseAbs rsfp
return $ Just f
return $ SymLink p' fv resolvedSyml x
| PF.isDirectory fs = return $ Dir p' fv
| PF.isRegularFile fs = return $ RegFile p' fv
| PF.isBlockDevice fs = return $ BlockDev p' fv
| PF.isCharacterDevice fs = return $ CharDev p' fv
| PF.isNamedPipe fs = return $ NamedPipe p' fv
| PF.isSocket fs = return $ Socket p' fv
| otherwise = ioError $ userError "Unknown filetype!"
-- |Get the contents of a given directory and return them as a list
-- of `AnchoredFile`.
| 1,290
|
pathToFile ff p = do
fs <- PF.getSymbolicLinkStatus (P.toFilePath p)
fv <- ff p
constructFile fs fv p
where
constructFile fs fv p'
| PF.isSymbolicLink fs = do
-- symlink madness, we need to make sure we save the correct
-- File
x <- PF.readSymbolicLink (P.fromAbs p')
resolvedSyml <- handleIOError (\_ -> return Nothing) $ do
-- watch out, we call </> from 'filepath' here, but it is safe
let sfp = (P.fromAbs . P.dirname $ p') </> x
rsfp <- realpath sfp
f <- pathToFile ff =<< P.parseAbs rsfp
return $ Just f
return $ SymLink p' fv resolvedSyml x
| PF.isDirectory fs = return $ Dir p' fv
| PF.isRegularFile fs = return $ RegFile p' fv
| PF.isBlockDevice fs = return $ BlockDev p' fv
| PF.isCharacterDevice fs = return $ CharDev p' fv
| PF.isNamedPipe fs = return $ NamedPipe p' fv
| PF.isSocket fs = return $ Socket p' fv
| otherwise = ioError $ userError "Unknown filetype!"
-- |Get the contents of a given directory and return them as a list
-- of `AnchoredFile`.
| 1,208
| false
| true
| 0
| 21
| 457
| 401
| 181
| 220
| null | null |
Shou/Tombot
|
Tombot/Utils.hs
|
gpl-2.0
|
- }}}
-- {{{ Mind utils
-- XXX Do we make functions that use warn and verb, or do we use a verbosity
-- checking function, comparable to `when', except only taking one argument
-- - We should move the verbosity utils elsewhere; Debug utils?
-- TODO check verbosity
warn :: (MonadIO m, Show a) => a -> m ()
warn x = liftIO $ putStrLn $ "\x1b[0;33mWarning " <> show x <> "\x1b[0m"
| 386
|
warn :: (MonadIO m, Show a) => a -> m ()
warn x = liftIO $ putStrLn $ "\x1b[0;33mWarning " <> show x <> "\x1b[0m"
| 113
|
warn x = liftIO $ putStrLn $ "\x1b[0;33mWarning " <> show x <> "\x1b[0m"
| 72
| true
| true
| 1
| 8
| 81
| 67
| 37
| 30
| null | null |
facebookincubator/duckling
|
Duckling/Time/NB/Rules.hs
|
bsd-3-clause
|
ruleLastYear :: Rule
ruleLastYear = Rule
{ name = "Last year"
, pattern =
[ regex "i fjor"
]
, prod = \_ -> tt . cycleNth TG.Year $ - 1
}
| 153
|
ruleLastYear :: Rule
ruleLastYear = Rule
{ name = "Last year"
, pattern =
[ regex "i fjor"
]
, prod = \_ -> tt . cycleNth TG.Year $ - 1
}
| 153
|
ruleLastYear = Rule
{ name = "Last year"
, pattern =
[ regex "i fjor"
]
, prod = \_ -> tt . cycleNth TG.Year $ - 1
}
| 132
| false
| true
| 0
| 12
| 47
| 61
| 33
| 28
| null | null |
antalsz/hs-to-coq
|
src/lib/HsToCoq/ConvertHaskell/Parameters/Edits.hs
|
mit
|
defName :: CoqDefinition -> Qualid
defName (CoqDefinitionDef (DefinitionDef _ x _ _ _ _)) = x
| 106
|
defName :: CoqDefinition -> Qualid
defName (CoqDefinitionDef (DefinitionDef _ x _ _ _ _)) = x
| 106
|
defName (CoqDefinitionDef (DefinitionDef _ x _ _ _ _)) = x
| 71
| false
| true
| 0
| 9
| 28
| 40
| 20
| 20
| null | null |
kmate/raw-feldspar-mcs
|
src/Feldspar/Multicore/Representation.hs
|
bsd-3-clause
|
runAllocCMD (AllocSArr size) = SArr <$> newArr (value size)
| 61
|
runAllocCMD (AllocSArr size) = SArr <$> newArr (value size)
| 61
|
runAllocCMD (AllocSArr size) = SArr <$> newArr (value size)
| 61
| false
| false
| 0
| 8
| 10
| 28
| 13
| 15
| null | null |
basvandijk/lifted-base
|
Data/IORef/Lifted.hs
|
bsd-3-clause
|
--------------------------------------------------------------------------------
-- * IORefs
--------------------------------------------------------------------------------
-- | Generalized version of 'R.newIORef'.
newIORef :: MonadBase IO m => a -> m (IORef a)
newIORef = liftBase . R.newIORef
| 296
|
newIORef :: MonadBase IO m => a -> m (IORef a)
newIORef = liftBase . R.newIORef
| 79
|
newIORef = liftBase . R.newIORef
| 32
| true
| true
| 0
| 9
| 27
| 43
| 23
| 20
| null | null |
jovermann/tip-toi-reveng
|
src/tttool.hs
|
mit
|
export :: FilePath -> FilePath -> IO ()
export inf out = do
(tt,_) <- parseTipToiFile <$> B.readFile inf
let tty = tt2ttYaml (printf "media/%s_%%s" (takeBaseName inf)) tt
ex <- doesFileExist out
if ex
then printf "File \"%s\" does already exist. Please remove it first\nif you want to export \"%s\" again.\n" out inf >> exitFailure
else writeTipToiYaml out tty
| 392
|
export :: FilePath -> FilePath -> IO ()
export inf out = do
(tt,_) <- parseTipToiFile <$> B.readFile inf
let tty = tt2ttYaml (printf "media/%s_%%s" (takeBaseName inf)) tt
ex <- doesFileExist out
if ex
then printf "File \"%s\" does already exist. Please remove it first\nif you want to export \"%s\" again.\n" out inf >> exitFailure
else writeTipToiYaml out tty
| 392
|
export inf out = do
(tt,_) <- parseTipToiFile <$> B.readFile inf
let tty = tt2ttYaml (printf "media/%s_%%s" (takeBaseName inf)) tt
ex <- doesFileExist out
if ex
then printf "File \"%s\" does already exist. Please remove it first\nif you want to export \"%s\" again.\n" out inf >> exitFailure
else writeTipToiYaml out tty
| 352
| false
| true
| 0
| 14
| 90
| 116
| 55
| 61
| null | null |
ndmitchell/hlint
|
src/Hint/Lambda.hs
|
bsd-3-clause
|
lambdaExp _ _ = []
| 18
|
lambdaExp _ _ = []
| 18
|
lambdaExp _ _ = []
| 18
| false
| false
| 1
| 6
| 4
| 14
| 6
| 8
| null | null |
blitzcode/rust-exp
|
hs-src/GLFWHelpers.hs
|
mit
|
windowSizeCallback :: TQueue GLFWEvent -> GLFW.Window -> Int -> Int -> IO ()
windowSizeCallback tq win w h = atomically . writeTQueue tq $ GLFWEventWindowSize win w h
| 166
|
windowSizeCallback :: TQueue GLFWEvent -> GLFW.Window -> Int -> Int -> IO ()
windowSizeCallback tq win w h = atomically . writeTQueue tq $ GLFWEventWindowSize win w h
| 166
|
windowSizeCallback tq win w h = atomically . writeTQueue tq $ GLFWEventWindowSize win w h
| 89
| false
| true
| 0
| 10
| 27
| 64
| 30
| 34
| null | null |
exFalso/lambda
|
src/lib/Compile/Compile.hs
|
bsd-3-clause
|
toThunkAddr :: (TopStackThunkType, [Instruction Symbol]) -> [Instruction Symbol]
toThunkAddr (TopStackThunkValue, instrs) = instrs ++ [CreateThunk]
| 147
|
toThunkAddr :: (TopStackThunkType, [Instruction Symbol]) -> [Instruction Symbol]
toThunkAddr (TopStackThunkValue, instrs) = instrs ++ [CreateThunk]
| 147
|
toThunkAddr (TopStackThunkValue, instrs) = instrs ++ [CreateThunk]
| 66
| false
| true
| 0
| 8
| 14
| 53
| 28
| 25
| null | null |
olsner/ghc
|
compiler/typecheck/TcPatSyn.hs
|
bsd-3-clause
|
{-
************************************************************************
* *
Constructing the "builder" Id
* *
************************************************************************
-}
mkPatSynBuilderId :: HsPatSynDir a -> Located Name
-> [TyVarBinder] -> ThetaType
-> [TyVarBinder] -> ThetaType
-> [Type] -> Type
-> TcM (Maybe (Id, Bool))
mkPatSynBuilderId dir (L _ name)
univ_bndrs req_theta ex_bndrs prov_theta
arg_tys pat_ty
| isUnidirectional dir
= return Nothing
| otherwise
= do { builder_name <- newImplicitBinder name mkBuilderOcc
; let theta = req_theta ++ prov_theta
need_dummy_arg = isUnliftedType pat_ty && null arg_tys && null theta
builder_sigma = add_void need_dummy_arg $
mkForAllTys univ_bndrs $
mkForAllTys ex_bndrs $
mkFunTys theta $
mkFunTys arg_tys $
pat_ty
builder_id = mkExportedVanillaId builder_name builder_sigma
-- See Note [Exported LocalIds] in Id
; return (Just (builder_id, need_dummy_arg)) }
where
| 1,433
|
mkPatSynBuilderId :: HsPatSynDir a -> Located Name
-> [TyVarBinder] -> ThetaType
-> [TyVarBinder] -> ThetaType
-> [Type] -> Type
-> TcM (Maybe (Id, Bool))
mkPatSynBuilderId dir (L _ name)
univ_bndrs req_theta ex_bndrs prov_theta
arg_tys pat_ty
| isUnidirectional dir
= return Nothing
| otherwise
= do { builder_name <- newImplicitBinder name mkBuilderOcc
; let theta = req_theta ++ prov_theta
need_dummy_arg = isUnliftedType pat_ty && null arg_tys && null theta
builder_sigma = add_void need_dummy_arg $
mkForAllTys univ_bndrs $
mkForAllTys ex_bndrs $
mkFunTys theta $
mkFunTys arg_tys $
pat_ty
builder_id = mkExportedVanillaId builder_name builder_sigma
-- See Note [Exported LocalIds] in Id
; return (Just (builder_id, need_dummy_arg)) }
where
| 1,095
|
mkPatSynBuilderId dir (L _ name)
univ_bndrs req_theta ex_bndrs prov_theta
arg_tys pat_ty
| isUnidirectional dir
= return Nothing
| otherwise
= do { builder_name <- newImplicitBinder name mkBuilderOcc
; let theta = req_theta ++ prov_theta
need_dummy_arg = isUnliftedType pat_ty && null arg_tys && null theta
builder_sigma = add_void need_dummy_arg $
mkForAllTys univ_bndrs $
mkForAllTys ex_bndrs $
mkFunTys theta $
mkFunTys arg_tys $
pat_ty
builder_id = mkExportedVanillaId builder_name builder_sigma
-- See Note [Exported LocalIds] in Id
; return (Just (builder_id, need_dummy_arg)) }
where
| 868
| true
| true
| 0
| 16
| 614
| 246
| 119
| 127
| null | null |
Zoetermeer/latro
|
src/Latro/Reorder.hs
|
mit
|
rewriteInfix (ExpGetAdtField p e n) =
ExpGetAdtField p (rewriteInfix e) n
| 75
|
rewriteInfix (ExpGetAdtField p e n) =
ExpGetAdtField p (rewriteInfix e) n
| 75
|
rewriteInfix (ExpGetAdtField p e n) =
ExpGetAdtField p (rewriteInfix e) n
| 75
| false
| false
| 0
| 7
| 12
| 32
| 15
| 17
| null | null |
apunktbau/co4
|
src/CO4/Frontend/THPreprocess.hs
|
gpl-3.0
|
noWildcardPattern :: MonadUnique u => Pat -> u Pat
noWildcardPattern pat = case pat of
WildP -> liftM VarP $ newTHName "wildcard"
_ -> return pat
| 153
|
noWildcardPattern :: MonadUnique u => Pat -> u Pat
noWildcardPattern pat = case pat of
WildP -> liftM VarP $ newTHName "wildcard"
_ -> return pat
| 153
|
noWildcardPattern pat = case pat of
WildP -> liftM VarP $ newTHName "wildcard"
_ -> return pat
| 102
| false
| true
| 2
| 7
| 33
| 58
| 26
| 32
| null | null |
ancientlanguage/haskell-analysis
|
grammar/src/Grammar/Common/Decompose.hs
|
mit
|
decomposeChar '\x2F9A8' = "\x84F1"
| 34
|
decomposeChar '\x2F9A8' = "\x84F1"
| 34
|
decomposeChar '\x2F9A8' = "\x84F1"
| 34
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
sdiehl/ghc
|
compiler/prelude/PrimOp.hs
|
bsd-3-clause
|
primOpType :: PrimOp -> Type -- you may want to use primOpSig instead
primOpType op
= case primOpInfo op of
Dyadic _occ ty -> dyadic_fun_ty ty
Monadic _occ ty -> monadic_fun_ty ty
Compare _occ ty -> compare_fun_ty ty
GenPrimOp _occ tyvars arg_tys res_ty ->
mkSpecForAllTys tyvars (mkVisFunTys arg_tys res_ty)
| 337
|
primOpType :: PrimOp -> Type
primOpType op
= case primOpInfo op of
Dyadic _occ ty -> dyadic_fun_ty ty
Monadic _occ ty -> monadic_fun_ty ty
Compare _occ ty -> compare_fun_ty ty
GenPrimOp _occ tyvars arg_tys res_ty ->
mkSpecForAllTys tyvars (mkVisFunTys arg_tys res_ty)
| 295
|
primOpType op
= case primOpInfo op of
Dyadic _occ ty -> dyadic_fun_ty ty
Monadic _occ ty -> monadic_fun_ty ty
Compare _occ ty -> compare_fun_ty ty
GenPrimOp _occ tyvars arg_tys res_ty ->
mkSpecForAllTys tyvars (mkVisFunTys arg_tys res_ty)
| 266
| true
| true
| 6
| 9
| 77
| 91
| 44
| 47
| null | null |
FranklinChen/brick
|
programs/DialogDemo.hs
|
bsd-3-clause
|
appEvent :: D.Dialog Choice -> V.Event -> M.EventM (M.Next (D.Dialog Choice))
appEvent d ev =
case ev of
V.EvKey V.KEsc [] -> M.halt d
V.EvKey V.KEnter [] -> M.halt d
_ -> M.continue $ T.handleEvent ev d
| 231
|
appEvent :: D.Dialog Choice -> V.Event -> M.EventM (M.Next (D.Dialog Choice))
appEvent d ev =
case ev of
V.EvKey V.KEsc [] -> M.halt d
V.EvKey V.KEnter [] -> M.halt d
_ -> M.continue $ T.handleEvent ev d
| 231
|
appEvent d ev =
case ev of
V.EvKey V.KEsc [] -> M.halt d
V.EvKey V.KEnter [] -> M.halt d
_ -> M.continue $ T.handleEvent ev d
| 153
| false
| true
| 0
| 12
| 64
| 119
| 56
| 63
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.