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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SKA-ScienceDataProcessor/RC | MS2/lib/DSL_Gridder/gridding-in-memory.hs | apache-2.0 | doThemAll :: Actor () String
doThemAll = actor $ \_ -> do
(vis_file_name, ini_name) <- liftIO mkCfg
let rawsys = $(mkStaticClosure 'rawSystemActor)
--
rgcf <- select Remote (N 1)
gcf <- startActor rgcf rawsys
sendParam ("GCF", []) gcf
gcfwaiter <- delay Remote gcf
--
retcode <- eval ... | 2,216 | doThemAll :: Actor () String
doThemAll = actor $ \_ -> do
(vis_file_name, ini_name) <- liftIO mkCfg
let rawsys = $(mkStaticClosure 'rawSystemActor)
--
rgcf <- select Remote (N 1)
gcf <- startActor rgcf rawsys
sendParam ("GCF", []) gcf
gcfwaiter <- delay Remote gcf
--
retcode <- eval ... | 2,216 | doThemAll = actor $ \_ -> do
(vis_file_name, ini_name) <- liftIO mkCfg
let rawsys = $(mkStaticClosure 'rawSystemActor)
--
rgcf <- select Remote (N 1)
gcf <- startActor rgcf rawsys
sendParam ("GCF", []) gcf
gcfwaiter <- delay Remote gcf
--
retcode <- eval rawSystemActor ("oskar_sim_in... | 2,187 | false | true | 0 | 31 | 800 | 570 | 273 | 297 | null | null |
anttisalonen/freekick | haskell/libfreekick/Freekick/Libmatch/SoccerPhysics.hs | agpl-3.0 | ballCoR :: Float
ballCoR = 0.2 | 30 | ballCoR :: Float
ballCoR = 0.2 | 30 | ballCoR = 0.2 | 13 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
hvr/containers | Data/Map/Base.hs | bsd-3-clause | showsTreeHang :: (k -> a -> String) -> Bool -> [String] -> Map k a -> ShowS
showsTreeHang showelem wide bars t
= case t of
Tip -> showsBars bars . showString "|\n"
Bin _ kx x Tip Tip
-> showsBars bars . showString (showelem kx x) . showString "\n"
Bin _ kx x l r
-> showsBars bars... | 557 | showsTreeHang :: (k -> a -> String) -> Bool -> [String] -> Map k a -> ShowS
showsTreeHang showelem wide bars t
= case t of
Tip -> showsBars bars . showString "|\n"
Bin _ kx x Tip Tip
-> showsBars bars . showString (showelem kx x) . showString "\n"
Bin _ kx x l r
-> showsBars bars... | 557 | showsTreeHang showelem wide bars t
= case t of
Tip -> showsBars bars . showString "|\n"
Bin _ kx x Tip Tip
-> showsBars bars . showString (showelem kx x) . showString "\n"
Bin _ kx x l r
-> showsBars bars . showString (showelem kx x) . showString "\n" .
showWide wide... | 481 | false | true | 0 | 16 | 180 | 220 | 102 | 118 | null | null |
ghc-android/ghc | testsuite/tests/concurrent/prog003/TestDataParser.hs | bsd-3-clause | is_delimit '\n' = True | 22 | is_delimit '\n' = True | 22 | is_delimit '\n' = True | 22 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
gcross/Privateer | src/Algorithm/GlobalVariablePrivatization/Privatization.hs | bsd-3-clause | isStorageSpec _ = False | 23 | isStorageSpec _ = False | 23 | isStorageSpec _ = False | 23 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
vikraman/ghc | libraries/template-haskell/Language/Haskell/TH/Lib.hs | bsd-3-clause | fromThenToE :: ExpQ -> ExpQ -> ExpQ -> ExpQ
fromThenToE x y z = do { a <- x; b <- y; c <- z;
return (ArithSeqE (FromThenToR a b c)) } | 158 | fromThenToE :: ExpQ -> ExpQ -> ExpQ -> ExpQ
fromThenToE x y z = do { a <- x; b <- y; c <- z;
return (ArithSeqE (FromThenToR a b c)) } | 158 | fromThenToE x y z = do { a <- x; b <- y; c <- z;
return (ArithSeqE (FromThenToR a b c)) } | 114 | false | true | 0 | 12 | 56 | 84 | 40 | 44 | null | null |
nicball/orlin | src/Orlin/Frontend/CodeGen.hs | mit | ret :: AST.Operand -> FuncGen ()
ret op = setTerminator (AST.Do (AST.Ret (Just op) [])) | 87 | ret :: AST.Operand -> FuncGen ()
ret op = setTerminator (AST.Do (AST.Ret (Just op) [])) | 87 | ret op = setTerminator (AST.Do (AST.Ret (Just op) [])) | 54 | false | true | 0 | 10 | 14 | 58 | 27 | 31 | null | null |
flipstone/orville | orville-postgresql-libpq/test/Test/Transaction.hs | mit | tracerTable :: Orville.TableDefinition Orville.NoKey Tracer Tracer
tracerTable =
Orville.mkTableDefinitionWithoutKey "tracer" tracerMarshaller | 144 | tracerTable :: Orville.TableDefinition Orville.NoKey Tracer Tracer
tracerTable =
Orville.mkTableDefinitionWithoutKey "tracer" tracerMarshaller | 144 | tracerTable =
Orville.mkTableDefinitionWithoutKey "tracer" tracerMarshaller | 77 | false | true | 0 | 6 | 12 | 29 | 14 | 15 | null | null |
tomahawkins/trs | Examples/GCD.hs | bsd-3-clause | result :: GCD -> Action Signal
result (GCD active a b) = do
when (value active) -- Only return a result if the GCD machine is active.
when (value a ==. value b) -- Only return a result if the computation is done.
active <== false -- Clear the active flag.
return (value a) -- Retur... | 337 | result :: GCD -> Action Signal
result (GCD active a b) = do
when (value active) -- Only return a result if the GCD machine is active.
when (value a ==. value b) -- Only return a result if the computation is done.
active <== false -- Clear the active flag.
return (value a) -- Retur... | 337 | result (GCD active a b) = do
when (value active) -- Only return a result if the GCD machine is active.
when (value a ==. value b) -- Only return a result if the computation is done.
active <== false -- Clear the active flag.
return (value a) -- Return the GCD result. | 306 | false | true | 0 | 10 | 97 | 85 | 40 | 45 | null | null |
brendanhay/gogol | gogol-vision/gen/Network/Google/Vision/Types/Product.hs | mpl-2.0 | -- | Google Cloud Storage URI for the input file. This must only be a Google
-- Cloud Storage object. Wildcards are not currently supported.
gcvvgsURI :: Lens' GoogleCloudVisionV1p1beta1GcsSource (Maybe Text)
gcvvgsURI
= lens _gcvvgsURI (\ s a -> s{_gcvvgsURI = a}) | 267 | gcvvgsURI :: Lens' GoogleCloudVisionV1p1beta1GcsSource (Maybe Text)
gcvvgsURI
= lens _gcvvgsURI (\ s a -> s{_gcvvgsURI = a}) | 126 | gcvvgsURI
= lens _gcvvgsURI (\ s a -> s{_gcvvgsURI = a}) | 58 | true | true | 1 | 9 | 43 | 53 | 26 | 27 | null | null |
coolhacks/scripts-hacks | examples/shellcheck-master/ShellCheck/Analytics.hs | mit | prop_checkUnquotedExpansions7 = verifyNot checkUnquotedExpansions "cat << foo\n$(ls)\nfoo" | 90 | prop_checkUnquotedExpansions7 = verifyNot checkUnquotedExpansions "cat << foo\n$(ls)\nfoo" | 90 | prop_checkUnquotedExpansions7 = verifyNot checkUnquotedExpansions "cat << foo\n$(ls)\nfoo" | 90 | false | false | 0 | 5 | 6 | 11 | 5 | 6 | null | null |
urbanslug/ghc | testsuite/tests/lib/integer/integerConstantFolding.hs | bsd-3-clause | complementInteger :: Integer
complementInteger = complement 200058 | 66 | complementInteger :: Integer
complementInteger = complement 200058 | 66 | complementInteger = complement 200058 | 37 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
DaMSL/K3 | src/Language/K3/Codegen/Haskell.hs | apache-2.0 | builtinLiftedAttribute "Collection" "update" t = typ' t >>= \t' ->
return ("update", t', Just
[hs| (\x y -> liftIO $ modifyMVar_ self (return . modifyData (\l -> (delete x l)++[y]))) |]) | 192 | builtinLiftedAttribute "Collection" "update" t = typ' t >>= \t' ->
return ("update", t', Just
[hs| (\x y -> liftIO $ modifyMVar_ self (return . modifyData (\l -> (delete x l)++[y]))) |]) | 192 | builtinLiftedAttribute "Collection" "update" t = typ' t >>= \t' ->
return ("update", t', Just
[hs| (\x y -> liftIO $ modifyMVar_ self (return . modifyData (\l -> (delete x l)++[y]))) |]) | 192 | false | false | 0 | 9 | 36 | 44 | 24 | 20 | null | null |
ghcjs/ghcjs-base | test/Tests/Properties.hs | mit | j_findAppendId = unsquare $ \(NotEmpty s) ts ->
let t = J.intercalate s ts
in all (==t) $ map (uncurry J.append) (J.breakOnAll s t) | 139 | j_findAppendId = unsquare $ \(NotEmpty s) ts ->
let t = J.intercalate s ts
in all (==t) $ map (uncurry J.append) (J.breakOnAll s t) | 139 | j_findAppendId = unsquare $ \(NotEmpty s) ts ->
let t = J.intercalate s ts
in all (==t) $ map (uncurry J.append) (J.breakOnAll s t) | 139 | false | false | 0 | 13 | 31 | 75 | 37 | 38 | null | null |
smaccm/capDL-tool | CapDL/State.hs | bsd-2-clause | validCapArch _ (IRQHandlerCap {}) = True | 40 | validCapArch _ (IRQHandlerCap {}) = True | 40 | validCapArch _ (IRQHandlerCap {}) = True | 40 | false | false | 0 | 7 | 5 | 18 | 9 | 9 | null | null |
deech/fltkhs-demos | src/Examples/tree-simple.hs | mit | main :: IO ()
main = do
_ <- FL.setScheme "gtk+"
window <- windowNew (toSize (250,400)) Nothing (Just "Simple Tree")
begin window
(Width windowWidth') <- getW window
(Height windowHeight') <- getH window
tree <- treeNew (toRectangle (10,10,windowWidth' - 20,windowHeight' - 20)) Nothing
setShowroot tree Fa... | 958 | main :: IO ()
main = do
_ <- FL.setScheme "gtk+"
window <- windowNew (toSize (250,400)) Nothing (Just "Simple Tree")
begin window
(Width windowWidth') <- getW window
(Height windowHeight') <- getH window
tree <- treeNew (toRectangle (10,10,windowWidth' - 20,windowHeight' - 20)) Nothing
setShowroot tree Fa... | 958 | main = do
_ <- FL.setScheme "gtk+"
window <- windowNew (toSize (250,400)) Nothing (Just "Simple Tree")
begin window
(Width windowWidth') <- getW window
(Height windowHeight') <- getH window
tree <- treeNew (toRectangle (10,10,windowWidth' - 20,windowHeight' - 20)) Nothing
setShowroot tree False
_ <- add... | 944 | false | true | 0 | 12 | 174 | 353 | 155 | 198 | null | null |
bergey/plots | src/Plots/Types/Ribbon.hs | bsd-3-clause | barPlot' :: (Typeable b, Renderable (Path V2 Double) b,
MonadState (Axis b c Double) m, BaseSpace c ~ V2) =>
(Double,Double) -> Double -> PlotState (RibbonPlot V2 Double) b -> m ()
barPlot' x w = ribbonPlot' (createBarData x w) | 252 | barPlot' :: (Typeable b, Renderable (Path V2 Double) b,
MonadState (Axis b c Double) m, BaseSpace c ~ V2) =>
(Double,Double) -> Double -> PlotState (RibbonPlot V2 Double) b -> m ()
barPlot' x w = ribbonPlot' (createBarData x w) | 252 | barPlot' x w = ribbonPlot' (createBarData x w) | 46 | false | true | 0 | 11 | 64 | 117 | 58 | 59 | null | null |
markus-git/imperative-edsl-vhdl | src/Language/Embedded/Hardware/Expression/Frontend.hs | bsd-3-clause | -- hmm...
cast' :: forall exp a b . (Primary exp, PrimType a, PrimType b, Integral b, Num a)
=> Proxy a -> exp b -> exp a
cast' _ = case typeRep :: TypeRep a of
Int8T -> toSigned
Int16T -> toSigned
Int32T -> toSigned
Int64T -> toSigned
Word8T -> toUnsigned
Word16T -> toUnsigned
Word32T -> t... | 634 | cast' :: forall exp a b . (Primary exp, PrimType a, PrimType b, Integral b, Num a)
=> Proxy a -> exp b -> exp a
cast' _ = case typeRep :: TypeRep a of
Int8T -> toSigned
Int16T -> toSigned
Int32T -> toSigned
Int64T -> toSigned
Word8T -> toUnsigned
Word16T -> toUnsigned
Word32T -> toUnsigned
... | 624 | cast' _ = case typeRep :: TypeRep a of
Int8T -> toSigned
Int16T -> toSigned
Int32T -> toSigned
Int64T -> toSigned
Word8T -> toUnsigned
Word16T -> toUnsigned
Word32T -> toUnsigned
Word64T -> toUnsigned
IntegerT -> toInteger
----------------------------------------------------------------... | 510 | true | true | 0 | 10 | 130 | 145 | 74 | 71 | null | null |
llllllllll/brainfuck | src/interpreter.hs | gpl-2.0 | parseCmd ValInpt = valInpt | 32 | parseCmd ValInpt = valInpt | 32 | parseCmd ValInpt = valInpt | 32 | false | false | 1 | 5 | 9 | 13 | 4 | 9 | null | null |
snoyberg/ghc | compiler/main/DriverPipeline.hs | bsd-3-clause | runPhase (RealPhase (Hsc src_flavour)) input_fn dflags0
= do -- normal Hsc mode, not mkdependHS
PipeEnv{ stop_phase=stop,
src_basename=basename,
src_suffix=suff } <- getPipeEnv
-- we add the current directory (i.e. the directory in which
-- the .hs files resides) to th... | 4,188 | runPhase (RealPhase (Hsc src_flavour)) input_fn dflags0
= do -- normal Hsc mode, not mkdependHS
PipeEnv{ stop_phase=stop,
src_basename=basename,
src_suffix=suff } <- getPipeEnv
-- we add the current directory (i.e. the directory in which
-- the .hs files resides) to th... | 4,188 | runPhase (RealPhase (Hsc src_flavour)) input_fn dflags0
= do -- normal Hsc mode, not mkdependHS
PipeEnv{ stop_phase=stop,
src_basename=basename,
src_suffix=suff } <- getPipeEnv
-- we add the current directory (i.e. the directory in which
-- the .hs files resides) to th... | 4,188 | false | false | 1 | 17 | 1,631 | 594 | 311 | 283 | null | null |
jqyu/bustle-chi | src/Rad/QL/Define/Field.hs | bsd-3-clause | resolveTypeName :: (Monad m) => Name -> FieldRunner m a
resolveTypeName tn _ _ _ = pure $ buildString tn | 104 | resolveTypeName :: (Monad m) => Name -> FieldRunner m a
resolveTypeName tn _ _ _ = pure $ buildString tn | 104 | resolveTypeName tn _ _ _ = pure $ buildString tn | 48 | false | true | 0 | 7 | 19 | 45 | 22 | 23 | null | null |
brendanhay/gogol | gogol-partners/gen/Network/Google/Resource/Partners/UpdateCompanies.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
ucUploadType :: Lens' UpdateCompanies (Maybe Text)
ucUploadType
= lens _ucUploadType (\ s a -> s{_ucUploadType = a}) | 189 | ucUploadType :: Lens' UpdateCompanies (Maybe Text)
ucUploadType
= lens _ucUploadType (\ s a -> s{_ucUploadType = a}) | 118 | ucUploadType
= lens _ucUploadType (\ s a -> s{_ucUploadType = a}) | 67 | true | true | 0 | 9 | 28 | 48 | 25 | 23 | null | null |
urbanslug/ghc | libraries/template-haskell/Language/Haskell/TH/Ppr.hs | bsd-3-clause | pprLit _ (StringL s) = pprString s | 38 | pprLit _ (StringL s) = pprString s | 38 | pprLit _ (StringL s) = pprString s | 38 | false | false | 0 | 7 | 10 | 20 | 9 | 11 | null | null |
tarleb/huskydoc | src/Text/Huskydoc/Inlines.hs | isc | inlineElementExcluding :: [InlineParser] -> Parser InlineElement
inlineElementExcluding = choice . map inlineParser . ([minBound ..] \\) | 136 | inlineElementExcluding :: [InlineParser] -> Parser InlineElement
inlineElementExcluding = choice . map inlineParser . ([minBound ..] \\) | 136 | inlineElementExcluding = choice . map inlineParser . ([minBound ..] \\) | 71 | false | true | 0 | 7 | 15 | 40 | 22 | 18 | null | null |
typedvar/hLand | hcore/GCompiler.hs | mit | compileCS [EPack t a] _ = [Pack t a] | 36 | compileCS [EPack t a] _ = [Pack t a] | 36 | compileCS [EPack t a] _ = [Pack t a] | 36 | false | false | 0 | 7 | 8 | 27 | 13 | 14 | null | null |
PierreR/basic-prelude | test-is-a-prelude.hs | mit | ioError = P.ioError | 19 | ioError = P.ioError | 19 | ioError = P.ioError | 19 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
jonsterling/Luitzen | src/Environment.hs | bsd-3-clause | -- | Extend the context with a list of modules
extendCtxMods :: (MonadReader Env m) => [Module] -> m a -> m a
extendCtxMods mods k = foldr extendCtxMod k mods | 158 | extendCtxMods :: (MonadReader Env m) => [Module] -> m a -> m a
extendCtxMods mods k = foldr extendCtxMod k mods | 111 | extendCtxMods mods k = foldr extendCtxMod k mods | 48 | true | true | 0 | 8 | 30 | 56 | 27 | 29 | null | null |
apyrgio/snf-ganeti | test/hs/Test/Ganeti/Storage/Diskstats/Parser.hs | bsd-2-clause | -- | Serialize a Diskstats in a parsable way
serializeDiskstats :: Diskstats -> String
serializeDiskstats ds =
printf "\t%d\t%d %s %d %d %d %d %d %d %d %d %d %d %d\n"
(dsMajor ds) (dsMinor ds) (dsName ds) (dsReadsNum ds) (dsMergedReads ds)
(dsSecRead ds) (dsTimeRead ds) (dsWrites ds) (dsMergedWrites ds)
(... | 395 | serializeDiskstats :: Diskstats -> String
serializeDiskstats ds =
printf "\t%d\t%d %s %d %d %d %d %d %d %d %d %d %d %d\n"
(dsMajor ds) (dsMinor ds) (dsName ds) (dsReadsNum ds) (dsMergedReads ds)
(dsSecRead ds) (dsTimeRead ds) (dsWrites ds) (dsMergedWrites ds)
(dsSecWritten ds) (dsTimeWrite ds) (dsIos ds) ... | 350 | serializeDiskstats ds =
printf "\t%d\t%d %s %d %d %d %d %d %d %d %d %d %d %d\n"
(dsMajor ds) (dsMinor ds) (dsName ds) (dsReadsNum ds) (dsMergedReads ds)
(dsSecRead ds) (dsTimeRead ds) (dsWrites ds) (dsMergedWrites ds)
(dsSecWritten ds) (dsTimeWrite ds) (dsIos ds) (dsTimeIO ds) (dsWIOmillis ds) | 308 | true | true | 0 | 7 | 72 | 148 | 68 | 80 | null | null |
mvr/at | src/Math/Topology/SGrp/KGn.hs | bsd-3-clause | criticalIso :: CC.Morphism (CriticalComplex (NChains KZ1)) CircleComplex
criticalIso = fmapBasis $
coerce $ \case
[] -> Left ()
[1 :: Integer] -> Right (ShiftBasis ())
_ -> error "impossible" | 205 | criticalIso :: CC.Morphism (CriticalComplex (NChains KZ1)) CircleComplex
criticalIso = fmapBasis $
coerce $ \case
[] -> Left ()
[1 :: Integer] -> Right (ShiftBasis ())
_ -> error "impossible" | 205 | criticalIso = fmapBasis $
coerce $ \case
[] -> Left ()
[1 :: Integer] -> Right (ShiftBasis ())
_ -> error "impossible" | 132 | false | true | 0 | 12 | 42 | 86 | 42 | 44 | null | null |
ssaavedra/liquidhaskell | benchmarks/containers-0.5.0.0/Data/Map/Base1.hs | bsd-3-clause | balanced :: Map k a -> Bool
balanced t
= case t of
Tip -> True
Bin _ _ _ l r -> (size l + size r <= 1 || (size l <= delta*size r && size r <= delta*size l)) &&
balanced l && balanced r | 234 | balanced :: Map k a -> Bool
balanced t
= case t of
Tip -> True
Bin _ _ _ l r -> (size l + size r <= 1 || (size l <= delta*size r && size r <= delta*size l)) &&
balanced l && balanced r | 234 | balanced t
= case t of
Tip -> True
Bin _ _ _ l r -> (size l + size r <= 1 || (size l <= delta*size r && size r <= delta*size l)) &&
balanced l && balanced r | 206 | false | true | 5 | 17 | 97 | 116 | 53 | 63 | null | null |
sol/wai | warp/test/RunSpec.hs | mit | consumeBody :: IO ByteString -> IO [ByteString]
consumeBody body =
loop id
where
loop front = do
bs <- body
if S.null bs
then return $ front []
else loop $ front . (bs:) | 219 | consumeBody :: IO ByteString -> IO [ByteString]
consumeBody body =
loop id
where
loop front = do
bs <- body
if S.null bs
then return $ front []
else loop $ front . (bs:) | 219 | consumeBody body =
loop id
where
loop front = do
bs <- body
if S.null bs
then return $ front []
else loop $ front . (bs:) | 171 | false | true | 0 | 10 | 83 | 85 | 41 | 44 | null | null |
epsilonhalbe/TAP | TAP.hs | gpl-2.0 | _assertNotPlanned :: TAP ()
_assertNotPlanned = do
ts <- get
when (planSet ts) $ _die "You tried to plan twice!" | 120 | _assertNotPlanned :: TAP ()
_assertNotPlanned = do
ts <- get
when (planSet ts) $ _die "You tried to plan twice!" | 120 | _assertNotPlanned = do
ts <- get
when (planSet ts) $ _die "You tried to plan twice!" | 92 | false | true | 1 | 11 | 27 | 46 | 19 | 27 | null | null |
urv/fixhs | src/Data/FIX/Spec/FIX40.hs | lgpl-2.1 | mLogout :: FIXMessageSpec
mLogout = FMSpec
{ msName = "Logout"
, msType = C.pack "5"
, msHeader = headerFIX40
, msBody = mLogoutBody
, msTrailer = trailerFIX40 }
where
mLogoutBody =
LT.insert (tnum tText) tText LT.new | 251 | mLogout :: FIXMessageSpec
mLogout = FMSpec
{ msName = "Logout"
, msType = C.pack "5"
, msHeader = headerFIX40
, msBody = mLogoutBody
, msTrailer = trailerFIX40 }
where
mLogoutBody =
LT.insert (tnum tText) tText LT.new | 251 | mLogout = FMSpec
{ msName = "Logout"
, msType = C.pack "5"
, msHeader = headerFIX40
, msBody = mLogoutBody
, msTrailer = trailerFIX40 }
where
mLogoutBody =
LT.insert (tnum tText) tText LT.new | 225 | false | true | 1 | 8 | 69 | 86 | 43 | 43 | null | null |
rohitjha/DiMPL | src/Base.hs | bsd-2-clause | {-|
The 'fromDec' function converts a number from decimal (in the form of a list of digits) to decimal.
The function takes two arguments, the first of type Integer and the second of type [Integer].
Below are a few examples:
>>> fromDec [1,5,8,2,2]
15822
>>> fromDec (toDec 635465)
635465
-}
fromD... | 368 | fromDec :: [Integer] -> Integer
fromDec = fromBase 10 | 53 | fromDec = fromBase 10 | 21 | true | true | 0 | 6 | 82 | 22 | 12 | 10 | null | null |
da-x/buildsome | src/Lib/FSHook/Protocol.hs | gpl-2.0 | showFunc (MkNod path mode dev) = unwords ["mknod:", show path, showOct mode "", show dev] | 89 | showFunc (MkNod path mode dev) = unwords ["mknod:", show path, showOct mode "", show dev] | 89 | showFunc (MkNod path mode dev) = unwords ["mknod:", show path, showOct mode "", show dev] | 89 | false | false | 0 | 7 | 14 | 46 | 22 | 24 | null | null |
AlexanderPankiv/ghc | compiler/deSugar/DsBinds.hs | bsd-3-clause | dsHsWrapper (WpEvApp tm) e = liftM (App e) (dsEvTerm tm) | 61 | dsHsWrapper (WpEvApp tm) e = liftM (App e) (dsEvTerm tm) | 61 | dsHsWrapper (WpEvApp tm) e = liftM (App e) (dsEvTerm tm) | 61 | false | false | 1 | 7 | 14 | 36 | 16 | 20 | null | null |
joshuaclayton/unused | src/Unused/Aliases.hs | mit | termsAndAliases as = L.nub . concatMap ((as >>=) . generateSearchTerms . T.pack) | 80 | termsAndAliases as = L.nub . concatMap ((as >>=) . generateSearchTerms . T.pack) | 80 | termsAndAliases as = L.nub . concatMap ((as >>=) . generateSearchTerms . T.pack) | 80 | false | false | 0 | 10 | 11 | 35 | 18 | 17 | null | null |
snoyberg/ghc | compiler/types/Type.hs | bsd-3-clause | typeKind (FunTy {}) = liftedTypeKind | 47 | typeKind (FunTy {}) = liftedTypeKind | 47 | typeKind (FunTy {}) = liftedTypeKind | 47 | false | false | 0 | 6 | 15 | 17 | 8 | 9 | null | null |
aisamanra/telml | telml/Data/TeLML/Parser.hs | bsd-3-clause | pFragments ('{':s) = bind (pFragments s) $ \case
('}':xs, cs) -> bind (pFragments xs) $ \(xs', cs') -> return (xs', cs ++ cs')
(x:_, _) -> throw ("unexpected " ++ show x ++ "; expected '}'")
([], _) -> throw ("unexpected end-of-document while parsing block") | 273 | pFragments ('{':s) = bind (pFragments s) $ \case
('}':xs, cs) -> bind (pFragments xs) $ \(xs', cs') -> return (xs', cs ++ cs')
(x:_, _) -> throw ("unexpected " ++ show x ++ "; expected '}'")
([], _) -> throw ("unexpected end-of-document while parsing block") | 273 | pFragments ('{':s) = bind (pFragments s) $ \case
('}':xs, cs) -> bind (pFragments xs) $ \(xs', cs') -> return (xs', cs ++ cs')
(x:_, _) -> throw ("unexpected " ++ show x ++ "; expected '}'")
([], _) -> throw ("unexpected end-of-document while parsing block") | 273 | false | false | 0 | 13 | 59 | 138 | 72 | 66 | null | null |
YinYanfei/CadalWorkspace | thrift/src/thrift-0.8.0/lib/hs/src/Thrift/Protocol/Binary.hs | gpl-3.0 | floatBits :: Double -> Word64
floatBits (D# d#) = W64# (unsafeCoerce# d#) | 73 | floatBits :: Double -> Word64
floatBits (D# d#) = W64# (unsafeCoerce# d#) | 73 | floatBits (D# d#) = W64# (unsafeCoerce# d#) | 43 | false | true | 0 | 7 | 11 | 33 | 16 | 17 | null | null |
GaloisInc/halvm-ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | isTopLevel TopLevel = True | 30 | isTopLevel TopLevel = True | 30 | isTopLevel TopLevel = True | 30 | false | false | 0 | 4 | 7 | 10 | 4 | 6 | null | null |
glguy/CookieCalculator | src/CookieClicker.hs | isc | initialGameState :: GameState
initialGameState = GameState
{ _buildingStats = initialBuildingStat <$> baseCps
, _multiplier = 1
, _mouseBonus = 0
, _mouseMultiplier = 1
, _prestigeMultiplier1 = 0
, _prestigeMultiplier2 = 1
, _bonusCps = 0
... | 764 | initialGameState :: GameState
initialGameState = GameState
{ _buildingStats = initialBuildingStat <$> baseCps
, _multiplier = 1
, _mouseBonus = 0
, _mouseMultiplier = 1
, _prestigeMultiplier1 = 0
, _prestigeMultiplier2 = 1
, _bonusCps = 0
... | 764 | initialGameState = GameState
{ _buildingStats = initialBuildingStat <$> baseCps
, _multiplier = 1
, _mouseBonus = 0
, _mouseMultiplier = 1
, _prestigeMultiplier1 = 0
, _prestigeMultiplier2 = 1
, _bonusCps = 0
, _buildingCostMultiplier =... | 734 | false | true | 0 | 8 | 264 | 143 | 91 | 52 | null | null |
troydm/edda | src/EDDA/Schema/OutfittingV2.hs | mit | contains s sub = not $ null (T.breakOnAll (T.toLower sub) (T.toLower s)) | 72 | contains s sub = not $ null (T.breakOnAll (T.toLower sub) (T.toLower s)) | 72 | contains s sub = not $ null (T.breakOnAll (T.toLower sub) (T.toLower s)) | 72 | false | false | 0 | 11 | 11 | 44 | 21 | 23 | null | null |
literate-unitb/literate-unitb | app/Continuous.hs | mit | handle' :: Exception e => (e -> StateT a IO b) -> StateT a IO b -> StateT a IO b
handle' h cmd = StateT $ \st -> do
handle (flip runStateT st . h) $ runStateT cmd st | 173 | handle' :: Exception e => (e -> StateT a IO b) -> StateT a IO b -> StateT a IO b
handle' h cmd = StateT $ \st -> do
handle (flip runStateT st . h) $ runStateT cmd st | 173 | handle' h cmd = StateT $ \st -> do
handle (flip runStateT st . h) $ runStateT cmd st | 92 | false | true | 2 | 13 | 47 | 101 | 46 | 55 | null | null |
herrmann/pfai-search-uct | src/AI/Search/UCT.hs | bsd-3-clause | uct :: PrimMonad m
=> Gen (PrimState m) -- ^ Random number generator
-> Int -- ^ Number of trials
-> FullUctNode -- ^ Tree root location
-> m FullUctNode -- ^ New tree root location
uct gen numTrials loc = foldM (flip ($)) loc actions
where
actions = replicate numTrials $ selectAct... | 466 | uct :: PrimMonad m
=> Gen (PrimState m) -- ^ Random number generator
-> Int -- ^ Number of trials
-> FullUctNode -- ^ Tree root location
-> m FullUctNode
uct gen numTrials loc = foldM (flip ($)) loc actions
where
actions = replicate numTrials $ selectAction gen randomExpand randomRollO... | 434 | uct gen numTrials loc = foldM (flip ($)) loc actions
where
actions = replicate numTrials $ selectAction gen randomExpand randomRollOut
-- | Does one round of UCT.
-- The random number generator is used to break ties randomly in unexpanded nodes. | 252 | true | true | 1 | 10 | 115 | 99 | 48 | 51 | null | null |
acowley/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | b_RDR = mkVarUnqual (fsLit "b") | 41 | b_RDR = mkVarUnqual (fsLit "b") | 41 | b_RDR = mkVarUnqual (fsLit "b") | 41 | false | false | 0 | 7 | 14 | 15 | 7 | 8 | null | null |
fpco/hlint | src/Hint/Structure.hs | bsd-3-clause | patHint o@(PIrrPat _ x) | f x = [err "Redundant irrefutable pattern" o x]
where f (PParen _ x) = f x
f (PAsPat _ _ x) = f x
f PWildCard{} = True
f PVar{} = True
f _ = False | 216 | patHint o@(PIrrPat _ x) | f x = [err "Redundant irrefutable pattern" o x]
where f (PParen _ x) = f x
f (PAsPat _ _ x) = f x
f PWildCard{} = True
f PVar{} = True
f _ = False | 216 | patHint o@(PIrrPat _ x) | f x = [err "Redundant irrefutable pattern" o x]
where f (PParen _ x) = f x
f (PAsPat _ _ x) = f x
f PWildCard{} = True
f PVar{} = True
f _ = False | 216 | false | false | 0 | 9 | 85 | 113 | 54 | 59 | null | null |
ratatosk/learn | Learn/NN.hs | bsd-3-clause | sqDistPenalty :: Double -> Double -> Double
sqDistPenalty a y = let d = a - y in d * d | 86 | sqDistPenalty :: Double -> Double -> Double
sqDistPenalty a y = let d = a - y in d * d | 86 | sqDistPenalty a y = let d = a - y in d * d | 42 | false | true | 0 | 9 | 20 | 43 | 21 | 22 | null | null |
beni55/haste-compiler | libraries/ghc-7.8/base/GHC/IO/Handle.hs | bsd-3-clause | dupHandle :: FilePath
-> Handle
-> Maybe (MVar Handle__)
-> Handle__
-> Maybe HandleFinalizer
-> IO Handle
dupHandle filepath h other_side h_@Handle__{..} mb_finalizer = do
-- flush the buffer first, so we don't have to copy its contents
flushBuffer h_
case other_... | 591 | dupHandle :: FilePath
-> Handle
-> Maybe (MVar Handle__)
-> Handle__
-> Maybe HandleFinalizer
-> IO Handle
dupHandle filepath h other_side h_@Handle__{..} mb_finalizer = do
-- flush the buffer first, so we don't have to copy its contents
flushBuffer h_
case other_... | 591 | dupHandle filepath h other_side h_@Handle__{..} mb_finalizer = do
-- flush the buffer first, so we don't have to copy its contents
flushBuffer h_
case other_side of
Nothing -> do
new_dev <- IODevice.dup haDevice
dupHandle_ new_dev filepath other_side h_ mb_finalizer
Just r ->
withHa... | 434 | false | true | 3 | 16 | 168 | 165 | 76 | 89 | null | null |
jstolarek/sandbox | haskell/primbool/fft/Main.hs | unlicense | benchmarks :: Array U DIM2 Word8 -> [Benchmark]
benchmarks image = [
bench "normal FFT" $ whnfIO (transformP 5 image)
, bench "hacked FFT" $ whnfIO (transformPHacked 5 image)
, bench "hacked more FFT" $ whnfIO (transformPHackedMore 5 image)
] | 276 | benchmarks :: Array U DIM2 Word8 -> [Benchmark]
benchmarks image = [
bench "normal FFT" $ whnfIO (transformP 5 image)
, bench "hacked FFT" $ whnfIO (transformPHacked 5 image)
, bench "hacked more FFT" $ whnfIO (transformPHackedMore 5 image)
] | 276 | benchmarks image = [
bench "normal FFT" $ whnfIO (transformP 5 image)
, bench "hacked FFT" $ whnfIO (transformPHacked 5 image)
, bench "hacked more FFT" $ whnfIO (transformPHackedMore 5 image)
] | 228 | false | true | 0 | 9 | 73 | 91 | 44 | 47 | null | null |
rahulmutt/ghcvm | compiler/Eta/DeSugar/DsUtils.hs | bsd-3-clause | seqVar :: Var -> CoreExpr -> CoreExpr
seqVar var body = Case (Var var) var (exprType body)
[(DEFAULT, [], body)] | 136 | seqVar :: Var -> CoreExpr -> CoreExpr
seqVar var body = Case (Var var) var (exprType body)
[(DEFAULT, [], body)] | 136 | seqVar var body = Case (Var var) var (exprType body)
[(DEFAULT, [], body)] | 98 | false | true | 0 | 8 | 43 | 59 | 31 | 28 | null | null |
hvr/jhc | src/Name/Name.hs | mit | -- the left name effectively becomes the module.
combineName :: Name -> Name -> Name
combineName (nameToBits -> (a1,nt1)) (nameToBits -> (a2,nt2)) = bitsToName ((toAtom $ "{" ++ encodeNameType nt1:show a1 ++ "}") `mappend` a2) nt2 | 231 | combineName :: Name -> Name -> Name
combineName (nameToBits -> (a1,nt1)) (nameToBits -> (a2,nt2)) = bitsToName ((toAtom $ "{" ++ encodeNameType nt1:show a1 ++ "}") `mappend` a2) nt2 | 182 | combineName (nameToBits -> (a1,nt1)) (nameToBits -> (a2,nt2)) = bitsToName ((toAtom $ "{" ++ encodeNameType nt1:show a1 ++ "}") `mappend` a2) nt2 | 146 | true | true | 0 | 12 | 36 | 90 | 49 | 41 | null | null |
ulricha/dsh | src/Database/DSH/Tests/CombinatorTests.hs | bsd-3-clause | prop_infix_or :: (BackendVector b, VectorLang v) => (Bool,Bool) -> DSHProperty (v TExpr TExpr) b
prop_infix_or = makePropEq (uncurryQ (Q.||)) (uncurry (||)) | 156 | prop_infix_or :: (BackendVector b, VectorLang v) => (Bool,Bool) -> DSHProperty (v TExpr TExpr) b
prop_infix_or = makePropEq (uncurryQ (Q.||)) (uncurry (||)) | 156 | prop_infix_or = makePropEq (uncurryQ (Q.||)) (uncurry (||)) | 59 | false | true | 0 | 10 | 20 | 77 | 40 | 37 | null | null |
jasonzoladz/persistent | persistent-test/MaxLenTest.hs | mit | specs :: Spec
specs = describe "Maximum length attribute" $ do
it "" $ db $ do
let t1 = MaxLen a a a a a a
t2 = MaxLen b b b b b b
t2' = MaxLen b b' b b' b b'
a, b, b' :: IsString t => t
a = "a"
b = "12345"
b' = "123"
t1k <- insert t1
t2k <- insert t... | 523 | specs :: Spec
specs = describe "Maximum length attribute" $ do
it "" $ db $ do
let t1 = MaxLen a a a a a a
t2 = MaxLen b b b b b b
t2' = MaxLen b b' b b' b b'
a, b, b' :: IsString t => t
a = "a"
b = "12345"
b' = "123"
t1k <- insert t1
t2k <- insert t... | 523 | specs = describe "Maximum length attribute" $ do
it "" $ db $ do
let t1 = MaxLen a a a a a a
t2 = MaxLen b b b b b b
t2' = MaxLen b b' b b' b b'
a, b, b' :: IsString t => t
a = "a"
b = "12345"
b' = "123"
t1k <- insert t1
t2k <- insert t2
Just t1v... | 509 | false | true | 0 | 16 | 237 | 212 | 100 | 112 | null | null |
ndmitchell/hlint | data/HLint_TypeCheck.hs | bsd-3-clause | --------------------------------------------------------------------
-- EXAMPLES
main :: IO ()
main = return ()
| 113 | main :: IO ()
main = return () | 30 | main = return () | 16 | true | true | 0 | 6 | 12 | 23 | 12 | 11 | null | null |
mpwillson/mal | haskell/step2_eval.hs | mpl-2.0 | sub [MalNumber a, MalNumber b] = return $ MalNumber $ a - b | 59 | sub [MalNumber a, MalNumber b] = return $ MalNumber $ a - b | 59 | sub [MalNumber a, MalNumber b] = return $ MalNumber $ a - b | 59 | false | false | 0 | 7 | 12 | 33 | 16 | 17 | null | null |
glutamate/space | VectorsL.hs | bsd-3-clause | squarev :: (Num a) => Vec n a -> Vec n a
squarev = fmap (\x->x*x) | 65 | squarev :: (Num a) => Vec n a -> Vec n a
squarev = fmap (\x->x*x) | 65 | squarev = fmap (\x->x*x) | 24 | false | true | 0 | 8 | 15 | 55 | 26 | 29 | null | null |
input-output-hk/pos-haskell-prototype | util/src/Pos/Util/Log/Internal.hs | mit | mkFileDescription :: FilePath -> FilePath -> FileDescription
mkFileDescription bp fp =
-- if fp contains a filename in a directory path
-- move this path to the prefix and only keep the name
let (extbp, fname) = splitFileName fp
in
FileDescription { prefixpath = bp </> extbp
,... | 339 | mkFileDescription :: FilePath -> FilePath -> FileDescription
mkFileDescription bp fp =
-- if fp contains a filename in a directory path
-- move this path to the prefix and only keep the name
let (extbp, fname) = splitFileName fp
in
FileDescription { prefixpath = bp </> extbp
,... | 339 | mkFileDescription bp fp =
-- if fp contains a filename in a directory path
-- move this path to the prefix and only keep the name
let (extbp, fname) = splitFileName fp
in
FileDescription { prefixpath = bp </> extbp
, filename = fname } | 278 | false | true | 0 | 9 | 94 | 65 | 35 | 30 | null | null |
fmthoma/ghc | libraries/base/GHC/Event/Internal.hs | bsd-3-clause | backend :: (a -> Maybe Timeout -> (Fd -> Event -> IO ()) -> IO Int)
-> (a -> Fd -> Event -> Event -> IO Bool)
-> (a -> Fd -> Event -> IO Bool)
-> (a -> IO ())
-> a
-> Backend
backend bPoll bModifyFd bModifyFdOnce bDelete state =
Backend state bPoll bModifyFd bModifyFdOnce bDele... | 322 | backend :: (a -> Maybe Timeout -> (Fd -> Event -> IO ()) -> IO Int)
-> (a -> Fd -> Event -> Event -> IO Bool)
-> (a -> Fd -> Event -> IO Bool)
-> (a -> IO ())
-> a
-> Backend
backend bPoll bModifyFd bModifyFdOnce bDelete state =
Backend state bPoll bModifyFd bModifyFdOnce bDele... | 322 | backend bPoll bModifyFd bModifyFdOnce bDelete state =
Backend state bPoll bModifyFd bModifyFdOnce bDelete | 107 | false | true | 0 | 14 | 99 | 142 | 70 | 72 | null | null |
kylcarte/games | src/Games/Snake.hs | bsd-3-clause | readyKeys :: Event -> Coord -> StdGen -> Game
readyKeys e crd gen = case e of
EventKey (SpecialKey KeySpace) Down mods _
| mods == noMods -> startGame crd gen
_ -> Ready crd gen | 186 | readyKeys :: Event -> Coord -> StdGen -> Game
readyKeys e crd gen = case e of
EventKey (SpecialKey KeySpace) Down mods _
| mods == noMods -> startGame crd gen
_ -> Ready crd gen | 186 | readyKeys e crd gen = case e of
EventKey (SpecialKey KeySpace) Down mods _
| mods == noMods -> startGame crd gen
_ -> Ready crd gen | 140 | false | true | 1 | 7 | 44 | 71 | 35 | 36 | null | null |
RaminHAL9001/Dao | src/Language/Interpreter/Dao/DefaultBIFs.hs | agpl-3.0 | -- | Very similar to 'setupTraceAtom': this trace function is called whenever a non-Built-In
-- Function is called, usually a function defined in a Dao Lisp database, the difference between
-- this and the function you define with 'setupTraceAtom' is that the entire 'Form' is given to this
-- function, not just the 'At... | 463 | setupTraceForm :: (Form -> DaoEval ()) -> (Environment -> Environment)
setupTraceForm f env = env{ traceForm = Just f } | 119 | setupTraceForm f env = env{ traceForm = Just f } | 48 | true | true | 0 | 9 | 76 | 59 | 31 | 28 | null | null |
brendanhay/gogol | gogol-cloudkms/gen/Network/Google/CloudKMS/Types/Product.hs | mpl-2.0 | -- | Required. The encrypted data originally returned in
-- EncryptResponse.ciphertext.
drCiphertext :: Lens' DecryptRequest (Maybe ByteString)
drCiphertext
= lens _drCiphertext (\ s a -> s{_drCiphertext = a})
. mapping _Bytes | 234 | drCiphertext :: Lens' DecryptRequest (Maybe ByteString)
drCiphertext
= lens _drCiphertext (\ s a -> s{_drCiphertext = a})
. mapping _Bytes | 146 | drCiphertext
= lens _drCiphertext (\ s a -> s{_drCiphertext = a})
. mapping _Bytes | 90 | true | true | 0 | 10 | 38 | 56 | 29 | 27 | null | null |
elieux/ghc | compiler/main/HscMain.hs | bsd-3-clause | hscParse :: HscEnv -> ModSummary -> IO HsParsedModule
hscParse hsc_env mod_summary = runHsc hsc_env $ hscParse' mod_summary | 123 | hscParse :: HscEnv -> ModSummary -> IO HsParsedModule
hscParse hsc_env mod_summary = runHsc hsc_env $ hscParse' mod_summary | 123 | hscParse hsc_env mod_summary = runHsc hsc_env $ hscParse' mod_summary | 69 | false | true | 0 | 7 | 16 | 37 | 17 | 20 | null | null |
tjakway/ghcjvm | compiler/nativeGen/SPARC/Ppr.hs | bsd-3-clause | pprInstr (FMOV format reg1 reg2)
= pprFormatRegReg (sLit "fmov") format reg1 reg2 | 89 | pprInstr (FMOV format reg1 reg2)
= pprFormatRegReg (sLit "fmov") format reg1 reg2 | 89 | pprInstr (FMOV format reg1 reg2)
= pprFormatRegReg (sLit "fmov") format reg1 reg2 | 89 | false | false | 0 | 7 | 19 | 34 | 16 | 18 | null | null |
rahulmutt/ghcvm | compiler/Eta/BasicTypes/MkId.hs | bsd-3-clause | voidPrimIdName = mkWiredInIdName gHC_PRIM (fsLit "void#") voidPrimIdKey voidPrimId | 100 | voidPrimIdName = mkWiredInIdName gHC_PRIM (fsLit "void#") voidPrimIdKey voidPrimId | 100 | voidPrimIdName = mkWiredInIdName gHC_PRIM (fsLit "void#") voidPrimIdKey voidPrimId | 100 | false | false | 0 | 7 | 25 | 21 | 10 | 11 | null | null |
meditans/documentator | src/Documentator/Descriptors.hs | gpl-3.0 | allTypes t@(TyApp _ _ _) = [t] | 30 | allTypes t@(TyApp _ _ _) = [t] | 30 | allTypes t@(TyApp _ _ _) = [t] | 30 | false | false | 0 | 8 | 6 | 25 | 13 | 12 | null | null |
hguenther/smtlib2 | Language/SMTLib2/Internals/Evaluate.hs | gpl-3.0 | arrayModelEq :: (Monad m,GetFunType fun)
=> FunctionEval m fun
-> FieldEval m fun
-> ArrayModel fun idx t
-> ArrayModel fun idx t
-> [List (EvalResult fun) idx]
-> m Bool
arrayModelEq _ _ (ArrayFun _) _ _
= error "Cannot decide array equali... | 357 | arrayModelEq :: (Monad m,GetFunType fun)
=> FunctionEval m fun
-> FieldEval m fun
-> ArrayModel fun idx t
-> ArrayModel fun idx t
-> [List (EvalResult fun) idx]
-> m Bool
arrayModelEq _ _ (ArrayFun _) _ _
= error "Cannot decide array equali... | 357 | arrayModelEq _ _ (ArrayFun _) _ _
= error "Cannot decide array equality with arrays built from functions." | 108 | false | true | 0 | 15 | 128 | 112 | 52 | 60 | null | null |
brendanhay/gogol | gogol-logging/gen/Network/Google/Resource/Logging/Folders/Locations/Buckets/Undelete.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
flbuUploadProtocol :: Lens' FoldersLocationsBucketsUndelete (Maybe Text)
flbuUploadProtocol
= lens _flbuUploadProtocol
(\ s a -> s{_flbuUploadProtocol = a}) | 226 | flbuUploadProtocol :: Lens' FoldersLocationsBucketsUndelete (Maybe Text)
flbuUploadProtocol
= lens _flbuUploadProtocol
(\ s a -> s{_flbuUploadProtocol = a}) | 164 | flbuUploadProtocol
= lens _flbuUploadProtocol
(\ s a -> s{_flbuUploadProtocol = a}) | 91 | true | true | 0 | 8 | 33 | 49 | 25 | 24 | null | null |
bitemyapp/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | ssMasterIp :: String
ssMasterIp = "master_ip" | 45 | ssMasterIp :: String
ssMasterIp = "master_ip" | 45 | ssMasterIp = "master_ip" | 24 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | saturninely = id | 16 | saturninely = id | 16 | saturninely = id | 16 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
cbrghostrider/Hacking | Euler/Misc.hs | mit | --primesUpTo num = sieve [2..num]
primesUpTo' :: Integer -> [Integer] -> [Integer]
primesUpTo' _ [] = [] | 104 | primesUpTo' :: Integer -> [Integer] -> [Integer]
primesUpTo' _ [] = [] | 70 | primesUpTo' _ [] = [] | 21 | true | true | 0 | 7 | 16 | 35 | 19 | 16 | null | null |
hasufell/CGA | GUI/Gtk.hs | gpl-2.0 | saveAndDrawDiag :: FilePath -- ^ obj file to parse
-> FilePath -- ^ if/where to save the result
-> MyGUI
-> IO Int
saveAndDrawDiag fp fps mygui =
if (==) ".obj" . takeExtension $ fp
then do
mesh <- B.readFile fp
mainDrawWindow <- widgetGetDra... | 2,957 | saveAndDrawDiag :: FilePath -- ^ obj file to parse
-> FilePath -- ^ if/where to save the result
-> MyGUI
-> IO Int
saveAndDrawDiag fp fps mygui =
if (==) ".obj" . takeExtension $ fp
then do
mesh <- B.readFile fp
mainDrawWindow <- widgetGetDra... | 2,957 | saveAndDrawDiag fp fps mygui =
if (==) ".obj" . takeExtension $ fp
then do
mesh <- B.readFile fp
mainDrawWindow <- widgetGetDrawWindow (mainDraw mygui)
treeDrawWindow <- widgetGetDrawWindow (treeDraw mygui)
adjustment <- rangeGetAdjustment (ptScale mygui)
scaleVal ... | 2,794 | false | true | 0 | 21 | 1,029 | 780 | 387 | 393 | null | null |
antalsz/hs-to-coq | src/lib/HsToCoq/ConvertHaskell/Expr.hs | mit | --------------------------------------------------------------------------------
-- Create `let x := rhs in genBody x`
-- Unless the rhs is very small, in which case it creates `genBody rhs`
bindIn :: LocalConvMonad r m => Text -> Term -> (Term -> m Term) -> m Term
bindIn _ rhs@(Qualid _) genBody = genBody rhs | 312 | bindIn :: LocalConvMonad r m => Text -> Term -> (Term -> m Term) -> m Term
bindIn _ rhs@(Qualid _) genBody = genBody rhs | 120 | bindIn _ rhs@(Qualid _) genBody = genBody rhs | 45 | true | true | 3 | 7 | 49 | 67 | 35 | 32 | null | null |
peterokagey/haskellOEIS | src/HelperSequences/A228369.hs | apache-2.0 | a228369_list = concatMap a228369_row [1..] | 42 | a228369_list = concatMap a228369_row [1..] | 42 | a228369_list = concatMap a228369_row [1..] | 42 | false | false | 0 | 6 | 4 | 14 | 7 | 7 | null | null |
AlexanderPankiv/ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | addTickCmdStmt ApplicativeStmt{} =
panic "ToDo: addTickCmdStmt ApplicativeLastStmt" | 85 | addTickCmdStmt ApplicativeStmt{} =
panic "ToDo: addTickCmdStmt ApplicativeLastStmt" | 85 | addTickCmdStmt ApplicativeStmt{} =
panic "ToDo: addTickCmdStmt ApplicativeLastStmt" | 85 | false | false | 0 | 5 | 8 | 17 | 7 | 10 | null | null |
sos22/ppres | ppres/driver/Classifier.hs | gpl-2.0 | boolOr x y = BooleanOr x y | 26 | boolOr x y = BooleanOr x y | 26 | boolOr x y = BooleanOr x y | 26 | false | false | 0 | 5 | 6 | 16 | 7 | 9 | null | null |
ganeti-github-testing/ganeti-test-1 | src/Ganeti/Constants.hs | bsd-2-clause | -- | Characters used to detect globbing filters
qlangGlobDetectionChars :: FrozenSet String
qlangGlobDetectionChars = ConstantUtils.mkSet ["*", "?"] | 148 | qlangGlobDetectionChars :: FrozenSet String
qlangGlobDetectionChars = ConstantUtils.mkSet ["*", "?"] | 100 | qlangGlobDetectionChars = ConstantUtils.mkSet ["*", "?"] | 56 | true | true | 0 | 6 | 16 | 26 | 14 | 12 | null | null |
urbanslug/ghc | testsuite/tests/rename/should_compile/rn032.hs | bsd-3-clause | sortOf :: Ord a=> [a] -> [a]
sortOf = Data.List.sort | 52 | sortOf :: Ord a=> [a] -> [a]
sortOf = Data.List.sort | 52 | sortOf = Data.List.sort | 23 | false | true | 0 | 7 | 9 | 31 | 17 | 14 | null | null |
ghcjs/ghcjs | src/Compiler/Utils.hs | mit | mkGhcjsSuf :: String -> String
mkGhcjsSuf "o" = "js_o" | 59 | mkGhcjsSuf :: String -> String
mkGhcjsSuf "o" = "js_o" | 59 | mkGhcjsSuf "o" = "js_o" | 28 | false | true | 0 | 5 | 13 | 22 | 10 | 12 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT02.hs | gpl-3.0 | [] `intersect` ys = [] | 22 | [] `intersect` ys = [] | 22 | [] `intersect` ys = [] | 22 | false | false | 0 | 6 | 4 | 22 | 10 | 12 | null | null |
RossMeikleham/GPC | src/GPC/Parser.hs | bsd-2-clause | -- | Parse if statement
ifStmt :: Parser (Stmt SrcPos)
ifStmt = try (IfElse <$> parseIf <*> stmt <*> (reserved "else" *> stmt))
<|> If <$> parseIf <*> stmt
where parseIf = reserved "if" *> parens expr
-- | Parse block to be executed sequentially | 262 | ifStmt :: Parser (Stmt SrcPos)
ifStmt = try (IfElse <$> parseIf <*> stmt <*> (reserved "else" *> stmt))
<|> If <$> parseIf <*> stmt
where parseIf = reserved "if" *> parens expr
-- | Parse block to be executed sequentially | 238 | ifStmt = try (IfElse <$> parseIf <*> stmt <*> (reserved "else" *> stmt))
<|> If <$> parseIf <*> stmt
where parseIf = reserved "if" *> parens expr
-- | Parse block to be executed sequentially | 207 | true | true | 0 | 13 | 61 | 80 | 40 | 40 | null | null |
massysett/rainbow | lib/Rainbow.hs | bsd-3-clause | brightBlue :: Y.Radiant
brightBlue = color256 12 | 48 | brightBlue :: Y.Radiant
brightBlue = color256 12 | 48 | brightBlue = color256 12 | 24 | false | true | 0 | 7 | 6 | 23 | 9 | 14 | null | null |
expipiplus1/vulkan | examples/lib/Swapchain.hs | bsd-3-clause | ----------------------------------------------------------------
-- All the resources which depend on the swapchain
----------------------------------------------------------------
-- | Allocate everything which depends on the swapchain
allocSwapchainResources
:: (MonadUnliftIO m, MonadResource m, HasVulkan m)
=> ... | 1,210 | allocSwapchainResources
:: (MonadUnliftIO m, MonadResource m, HasVulkan m)
=> SwapchainKHR
-- ^ Previous swapchain, can be NULL_HANDLE
-> Extent2D
-- ^ If the swapchain size determines the surface size, use this size
-> SurfaceKHR
-> m SwapchainResources
allocSwapchainResources oldSwapchain windowSize sur... | 972 | allocSwapchainResources oldSwapchain windowSize surface = do
info@SwapchainInfo {..} <- createSwapchain oldSwapchain windowSize surface
-- Get all the swapchain images, and create views for them
(_, swapchainImages) <- getSwapchainImagesKHR' siSwapchain
(imageViewKeys, imageViews) <-
fmap V.unzip . V.forM ... | 703 | true | true | 0 | 14 | 192 | 202 | 100 | 102 | null | null |
emc2/saltlang | src/saltc/Language/Salt/Compiler/Stages.hs | bsd-3-clause | surfaceExt :: Strict.ByteString
surfaceExt = Strict.fromString $! extSeparator : "surface" | 90 | surfaceExt :: Strict.ByteString
surfaceExt = Strict.fromString $! extSeparator : "surface" | 90 | surfaceExt = Strict.fromString $! extSeparator : "surface" | 58 | false | true | 0 | 7 | 9 | 30 | 13 | 17 | null | null |
ganeti-github-testing/ganeti-test-1 | src/Ganeti/Constants.hs | bsd-2-clause | -- | The prefix of the LUXI livelock file name
luxiLivelockPrefix :: String
luxiLivelockPrefix = "luxi-daemon" | 110 | luxiLivelockPrefix :: String
luxiLivelockPrefix = "luxi-daemon" | 63 | luxiLivelockPrefix = "luxi-daemon" | 34 | true | true | 0 | 4 | 15 | 12 | 7 | 5 | null | null |
beni55/text | tests/Tests/Properties.hs | bsd-2-clause | tl_toUpper_upper t = p (TL.toUpper t) >= p t
where p = TL.length . TL.filter isUpper | 88 | tl_toUpper_upper t = p (TL.toUpper t) >= p t
where p = TL.length . TL.filter isUpper | 88 | tl_toUpper_upper t = p (TL.toUpper t) >= p t
where p = TL.length . TL.filter isUpper | 88 | false | false | 0 | 9 | 19 | 45 | 21 | 24 | null | null |
klpn/highlighting-kate | Text/Highlighting/Kate/Common.hs | gpl-2.0 | matchGlob "" "" = True | 22 | matchGlob "" "" = True | 22 | matchGlob "" "" = True | 22 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
AlexanderPankiv/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | vecElemInjectCast :: DynFlags -> PrimOpVecCat -> Width -> Maybe MachOp
vecElemInjectCast _ FloatVec _ = Nothing | 119 | vecElemInjectCast :: DynFlags -> PrimOpVecCat -> Width -> Maybe MachOp
vecElemInjectCast _ FloatVec _ = Nothing | 119 | vecElemInjectCast _ FloatVec _ = Nothing | 48 | false | true | 0 | 8 | 23 | 33 | 16 | 17 | null | null |
m-alvarez/jhc | src/Support/TempDir.hs | mit | cleanUp :: IO ()
cleanUp = do
td <- readIORef tdRef
sequence_ (tempDirAtExit td)
if not (tempDirClean td) ||
isNothing (tempDirPath td) then return () else do
dir <- getTempDir
forM_ (reverse . Set.toList $ tempDirCleanup td) $ \fp -> do
putLog $ printf "Removing '%s'" (dir </> fp)
... | 493 | cleanUp :: IO ()
cleanUp = do
td <- readIORef tdRef
sequence_ (tempDirAtExit td)
if not (tempDirClean td) ||
isNothing (tempDirPath td) then return () else do
dir <- getTempDir
forM_ (reverse . Set.toList $ tempDirCleanup td) $ \fp -> do
putLog $ printf "Removing '%s'" (dir </> fp)
... | 493 | cleanUp = do
td <- readIORef tdRef
sequence_ (tempDirAtExit td)
if not (tempDirClean td) ||
isNothing (tempDirPath td) then return () else do
dir <- getTempDir
forM_ (reverse . Set.toList $ tempDirCleanup td) $ \fp -> do
putLog $ printf "Removing '%s'" (dir </> fp)
ignoreErro... | 476 | false | true | 0 | 17 | 129 | 191 | 88 | 103 | null | null |
beni55/pinhole | Pinhole/Play/Collisions.hs | gpl-3.0 | normal :: Float
normal = 1.10 | 29 | normal :: Float
normal = 1.10 | 29 | normal = 1.10 | 13 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
Chasego/nie | proj/lang/C++/cpp_primer_5th/[SUPPORT] learning-master/real-world-haskell/ch2/add.hs | gpl-3.0 | lastButOne :: [a] -> a
lastButOne x = last $ take ((length x) - 1) x | 68 | lastButOne :: [a] -> a
lastButOne x = last $ take ((length x) - 1) x | 68 | lastButOne x = last $ take ((length x) - 1) x | 45 | false | true | 0 | 10 | 15 | 43 | 22 | 21 | null | null |
DanielG/stack | src/Stack/PackageIndex.hs | bsd-3-clause | entrySizeInBlocks :: Tar.Entry -> Int64
entrySizeInBlocks entry = 1 + case Tar.entryContent entry of
Tar.NormalFile _ size -> bytesToBlocks size
Tar.OtherEntryType _ _ size -> bytesToBlocks size
_ -> 0
where
bytesToBlocks s = 1 + ((fromIntegral s - 1) `div` 512) | 306 | entrySizeInBlocks :: Tar.Entry -> Int64
entrySizeInBlocks entry = 1 + case Tar.entryContent entry of
Tar.NormalFile _ size -> bytesToBlocks size
Tar.OtherEntryType _ _ size -> bytesToBlocks size
_ -> 0
where
bytesToBlocks s = 1 + ((fromIntegral s - 1) `div` 512) | 306 | entrySizeInBlocks entry = 1 + case Tar.entryContent entry of
Tar.NormalFile _ size -> bytesToBlocks size
Tar.OtherEntryType _ _ size -> bytesToBlocks size
_ -> 0
where
bytesToBlocks s = 1 + ((fromIntegral s - 1) `div` 512) | 266 | false | true | 0 | 10 | 85 | 107 | 52 | 55 | null | null |
cocreature/leksah | src/IDE/Utils/GUIUtils.hs | gpl-2.0 | stockIdFromType Type = "ide_type" | 46 | stockIdFromType Type = "ide_type" | 46 | stockIdFromType Type = "ide_type" | 46 | false | false | 0 | 5 | 16 | 9 | 4 | 5 | null | null |
silkapp/haskell-opaleye | src/Opaleye/Column.hs | bsd-3-clause | -- | The Opaleye equivalent of 'Data.Maybe.Just'
toNullable :: Column a -> Column (Nullable a)
toNullable = unsafeCoerce | 120 | toNullable :: Column a -> Column (Nullable a)
toNullable = unsafeCoerce | 71 | toNullable = unsafeCoerce | 25 | true | true | 0 | 8 | 17 | 28 | 14 | 14 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/Compiler.hs | bsd-3-clause | compileProcedure (ReadRemoteRefW8E (RemoteRefW8 i)) = do
b <- compileReadRef Word8Type i
return $ remBind b | 115 | compileProcedure (ReadRemoteRefW8E (RemoteRefW8 i)) = do
b <- compileReadRef Word8Type i
return $ remBind b | 115 | compileProcedure (ReadRemoteRefW8E (RemoteRefW8 i)) = do
b <- compileReadRef Word8Type i
return $ remBind b | 115 | false | false | 0 | 9 | 22 | 43 | 19 | 24 | null | null |
rgoulter/expenses-csv-utils | src/Data/Expenses/Query.hs | mit | queryDirectives :: QueryAttribute -> [Entry] -> String
queryDirectives Earliest entries = printf "%4d-%02d-%02d" y m d
where (y, m, d) = entryDate $ head entries | 163 | queryDirectives :: QueryAttribute -> [Entry] -> String
queryDirectives Earliest entries = printf "%4d-%02d-%02d" y m d
where (y, m, d) = entryDate $ head entries | 163 | queryDirectives Earliest entries = printf "%4d-%02d-%02d" y m d
where (y, m, d) = entryDate $ head entries | 108 | false | true | 0 | 7 | 26 | 60 | 31 | 29 | null | null |
happlebao/Core-Haskell | SyntaxChecker.hs | bsd-3-clause | isCoreAsst _ src (InfixA {}) = Left [NotAllowed "InfixA" src] | 61 | isCoreAsst _ src (InfixA {}) = Left [NotAllowed "InfixA" src] | 61 | isCoreAsst _ src (InfixA {}) = Left [NotAllowed "InfixA" src] | 61 | false | false | 1 | 7 | 9 | 34 | 15 | 19 | null | null |
gilith/hol | src/HOL/OpenTheory/Article.hs | mit | pop5Object :: (Objective a, Objective b, Objective c, Objective d,
Objective e) => [Object] -> Maybe (a,b,c,d,e,[Object])
pop5Object s = do
(a,s') <- popObject s
(b,c,d,e,s'') <- pop4Object s'
return (a,b,c,d,e,s'') | 236 | pop5Object :: (Objective a, Objective b, Objective c, Objective d,
Objective e) => [Object] -> Maybe (a,b,c,d,e,[Object])
pop5Object s = do
(a,s') <- popObject s
(b,c,d,e,s'') <- pop4Object s'
return (a,b,c,d,e,s'') | 236 | pop5Object s = do
(a,s') <- popObject s
(b,c,d,e,s'') <- pop4Object s'
return (a,b,c,d,e,s'') | 99 | false | true | 0 | 9 | 51 | 143 | 79 | 64 | null | null |
reckbo/ppl | pipeline-lib/Teem/Parser.hs | bsd-3-clause | skipComments :: Parser [String]
skipComments = many (char '#' *> manyTill anyChar newline) | 90 | skipComments :: Parser [String]
skipComments = many (char '#' *> manyTill anyChar newline) | 90 | skipComments = many (char '#' *> manyTill anyChar newline) | 58 | false | true | 0 | 8 | 12 | 35 | 17 | 18 | null | null |
phischu/gtk2hs | cairo/Gtk2HsSetup.hs | lgpl-3.0 | getCppOptions :: BuildInfo -> LocalBuildInfo -> [String]
getCppOptions bi lbi
= nub $
["-I" ++ dir | dir <- PD.includeDirs bi]
++ [opt | opt@('-':c:_) <- PD.cppOptions bi ++ PD.ccOptions bi, c `elem` "DIU"] | 219 | getCppOptions :: BuildInfo -> LocalBuildInfo -> [String]
getCppOptions bi lbi
= nub $
["-I" ++ dir | dir <- PD.includeDirs bi]
++ [opt | opt@('-':c:_) <- PD.cppOptions bi ++ PD.ccOptions bi, c `elem` "DIU"] | 219 | getCppOptions bi lbi
= nub $
["-I" ++ dir | dir <- PD.includeDirs bi]
++ [opt | opt@('-':c:_) <- PD.cppOptions bi ++ PD.ccOptions bi, c `elem` "DIU"] | 162 | false | true | 2 | 12 | 46 | 106 | 54 | 52 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.