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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sitewisely/zellige | src/Data/Geometry/Clip/Internal/LineLiangBarsky.hs | apache-2.0 | calcPAndQ :: TypesGeography.BoundingBox -> TypesGeography.GeoStorableLine -> DxAndDy -> Edge -> PAndQ
calcPAndQ (TypesGeography.BoundingBox minX minY maxX maxY) (TypesGeography.GeoStorableLine (Geospatial.PointXY x1 y1) _) (DxAndDy dX dY) e =
case e of
LeftEdge -> PAndQ (-1 * dX) (x1 - minX)
RightEdge -> P... | 424 | calcPAndQ :: TypesGeography.BoundingBox -> TypesGeography.GeoStorableLine -> DxAndDy -> Edge -> PAndQ
calcPAndQ (TypesGeography.BoundingBox minX minY maxX maxY) (TypesGeography.GeoStorableLine (Geospatial.PointXY x1 y1) _) (DxAndDy dX dY) e =
case e of
LeftEdge -> PAndQ (-1 * dX) (x1 - minX)
RightEdge -> P... | 424 | calcPAndQ (TypesGeography.BoundingBox minX minY maxX maxY) (TypesGeography.GeoStorableLine (Geospatial.PointXY x1 y1) _) (DxAndDy dX dY) e =
case e of
LeftEdge -> PAndQ (-1 * dX) (x1 - minX)
RightEdge -> PAndQ dX (maxX - x1)
BottomEdge -> PAndQ (-1 * dY) (y1 - minY)
TopEdge -> PAndQ dY (maxY - y... | 322 | false | true | 0 | 11 | 85 | 176 | 89 | 87 | null | null |
anthony-coble/puzzle | app/puzzle_cuda.hs | bsd-3-clause | rotate tile =
let (a, b, c, d) = unlift tile :: (Exp Edge, Exp Edge, Exp Edge, Exp Edge)
in
lift (d, a, b, c) :: Exp (Edge, Edge, Edge, Edge) | 147 | rotate tile =
let (a, b, c, d) = unlift tile :: (Exp Edge, Exp Edge, Exp Edge, Exp Edge)
in
lift (d, a, b, c) :: Exp (Edge, Edge, Edge, Edge) | 147 | rotate tile =
let (a, b, c, d) = unlift tile :: (Exp Edge, Exp Edge, Exp Edge, Exp Edge)
in
lift (d, a, b, c) :: Exp (Edge, Edge, Edge, Edge) | 147 | false | false | 0 | 10 | 37 | 96 | 52 | 44 | null | null |
plindbe2/xmonad-windownames | src/XMonad/Actions/WindowNames.hs | bsd-3-clause | -- | Modifed 'XMonad.Hooks.DynamicLog.dynamicLogString' which takes an
-- additional WindowSet to Map of WorkspaceId to String.
dynamicLogStringMap :: (WindowSet -> X (M.Map WorkspaceId String)) -> PP -> X String
dynamicLogStringMap wsIdMap pp = do
winset <- gets windowset
urgents <- readUrgents
sort' <- ... | 1,020 | dynamicLogStringMap :: (WindowSet -> X (M.Map WorkspaceId String)) -> PP -> X String
dynamicLogStringMap wsIdMap pp = do
winset <- gets windowset
urgents <- readUrgents
sort' <- ppSort pp
-- layout description
let ld = description . W.layout . W.workspace . W.current $ winset
-- workspace list... | 890 | dynamicLogStringMap wsIdMap pp = do
winset <- gets windowset
urgents <- readUrgents
sort' <- ppSort pp
-- layout description
let ld = description . W.layout . W.workspace . W.current $ winset
-- workspace list
ws <- pprWindowSetMap wsIdMap sort' urgents pp winset
-- window title
w... | 805 | true | true | 0 | 14 | 315 | 258 | 125 | 133 | null | null |
luzhuomi/cpp-obs | Language/C/Obfuscate/SSA.hs | apache-2.0 | buildDF' :: (DTree, DTreeMap, SDom, CFG) -> DFTable
buildDF' (dtree, pcm, sdom, cfg) =
-- traversing the dtree in post order
-- build the df1 and df, for leaf nodes df == df1
-- for non-leaf nodes, df = df1 \union dfup(c) for all child node c.
-- DF1(a) is the local dominance frontier for node a.
-- DF1(a) =... | 4,040 | buildDF' :: (DTree, DTreeMap, SDom, CFG) -> DFTable
buildDF' (dtree, pcm, sdom, cfg) =
-- traversing the dtree in post order
-- build the df1 and df, for leaf nodes df == df1
-- for non-leaf nodes, df = df1 \union dfup(c) for all child node c.
-- DF1(a) is the local dominance frontier for node a.
-- DF1(a) =... | 4,040 | buildDF' (dtree, pcm, sdom, cfg) =
-- traversing the dtree in post order
-- build the df1 and df, for leaf nodes df == df1
-- for non-leaf nodes, df = df1 \union dfup(c) for all child node c.
-- DF1(a) is the local dominance frontier for node a.
-- DF1(a) = { b | b \in succ(a), not (a sdom b) }
-- e.g. DF1... | 3,988 | false | true | 0 | 25 | 1,697 | 819 | 442 | 377 | null | null |
xenog/haskoin | src/Network/Haskoin/Test/Crypto.hs | unlicense | -- | Arbitrary compressed private key
arbitraryPrvKeyC :: Gen PrvKeyC
arbitraryPrvKeyC = makePrvKeyC <$> arbitrary | 114 | arbitraryPrvKeyC :: Gen PrvKeyC
arbitraryPrvKeyC = makePrvKeyC <$> arbitrary | 76 | arbitraryPrvKeyC = makePrvKeyC <$> arbitrary | 44 | true | true | 0 | 6 | 14 | 25 | 11 | 14 | null | null |
bgamari/text | tests/Tests/Properties.hs | bsd-2-clause | tb_hexadecimal_int64 (a::Int64) = tb_hex a | 42 | tb_hexadecimal_int64 (a::Int64) = tb_hex a | 42 | tb_hexadecimal_int64 (a::Int64) = tb_hex a | 42 | false | false | 0 | 7 | 4 | 19 | 9 | 10 | null | null |
snoyberg/photosorter | fay/Language/Fay/JQuery.hs | bsd-2-clause | closestWithContext :: String -> String -> JQuery -> Fay JQuery
closestWithContext = ffi "%3['closest'](%1, %2)" | 111 | closestWithContext :: String -> String -> JQuery -> Fay JQuery
closestWithContext = ffi "%3['closest'](%1, %2)" | 111 | closestWithContext = ffi "%3['closest'](%1, %2)" | 48 | false | true | 0 | 8 | 14 | 29 | 14 | 15 | null | null |
molysgaard/Sirkel | examples/TestClient.hs | bsd-3-clause | _PROGRAM_NAME :: String
_PROGRAM_NAME = "TestClient" | 52 | _PROGRAM_NAME :: String
_PROGRAM_NAME = "TestClient" | 52 | _PROGRAM_NAME = "TestClient" | 28 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
camiara/uvaSTesting15 | Week 1/HW01Tests.hs | mit | -- Exercise 5 -----------------------------------------
ex5Tests :: [Test]
ex5Tests = [] | 89 | ex5Tests :: [Test]
ex5Tests = [] | 32 | ex5Tests = [] | 13 | true | true | 0 | 7 | 10 | 24 | 11 | 13 | null | null |
todesking/YampaSynth | src/Main/OpenAL.hs | bsd-3-clause | printErrs :: String -> [String] -> IO ()
printErrs s x = when (not $ null x) . putStrLn $ s ++ ": " ++ show x | 109 | printErrs :: String -> [String] -> IO ()
printErrs s x = when (not $ null x) . putStrLn $ s ++ ": " ++ show x | 109 | printErrs s x = when (not $ null x) . putStrLn $ s ++ ": " ++ show x | 68 | false | true | 0 | 12 | 26 | 64 | 31 | 33 | null | null |
neothemachine/monadiccp | src/Control/CP/FD/SimpleFD.hs | bsd-3-clause | trueSpec = FDSpecInfoBool {fdspBoolSpec=const Nothing,fdspBoolVar=Nothing,fdspBoolVal=Just $ BoolConst True,fdspBoolTypes=Set.empty} | 132 | trueSpec = FDSpecInfoBool {fdspBoolSpec=const Nothing,fdspBoolVar=Nothing,fdspBoolVal=Just $ BoolConst True,fdspBoolTypes=Set.empty} | 132 | trueSpec = FDSpecInfoBool {fdspBoolSpec=const Nothing,fdspBoolVar=Nothing,fdspBoolVal=Just $ BoolConst True,fdspBoolTypes=Set.empty} | 132 | false | false | 0 | 8 | 7 | 44 | 25 | 19 | null | null |
jthornber/language-c-ejt | test-framework/Language/C/Test/ParseTests.hs | bsd-3-clause | compileTestTemplate :: Test
compileTestTemplate = Test
{
testName = "compile",
testDescr = "compile the given file using gcc",
preferredScale = Kilo,
inputUnit = linesOfCode
} | 195 | compileTestTemplate :: Test
compileTestTemplate = Test
{
testName = "compile",
testDescr = "compile the given file using gcc",
preferredScale = Kilo,
inputUnit = linesOfCode
} | 195 | compileTestTemplate = Test
{
testName = "compile",
testDescr = "compile the given file using gcc",
preferredScale = Kilo,
inputUnit = linesOfCode
} | 167 | false | true | 0 | 7 | 44 | 41 | 24 | 17 | null | null |
TomMD/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | reset_RDR = varQual_RDR rEAD_PREC (fsLit "reset") | 64 | reset_RDR = varQual_RDR rEAD_PREC (fsLit "reset") | 64 | reset_RDR = varQual_RDR rEAD_PREC (fsLit "reset") | 64 | false | false | 0 | 7 | 20 | 17 | 8 | 9 | null | null |
ezyang/ghc | compiler/ghci/ByteCodeAsm.hs | bsd-3-clause | mkLitI i = [fromIntegral i :: Word] | 35 | mkLitI i = [fromIntegral i :: Word] | 35 | mkLitI i = [fromIntegral i :: Word] | 35 | false | false | 1 | 7 | 6 | 22 | 9 | 13 | null | null |
lukexi/ghc-7.8-arm64 | compiler/main/HscMain.hs | bsd-3-clause | tryNewCodeGen :: HscEnv -> Module -> [TyCon]
-> CollectedCCs
-> [StgBinding]
-> HpcInfo
-> IO (Stream IO CmmGroup ())
-- Note we produce a 'Stream' of CmmGroups, so that the
-- backend can be run incrementally. Otherwise it generates a... | 2,462 | tryNewCodeGen :: HscEnv -> Module -> [TyCon]
-> CollectedCCs
-> [StgBinding]
-> HpcInfo
-> IO (Stream IO CmmGroup ())
tryNewCodeGen hsc_env this_mod data_tycons
cost_centre_info stg_binds hpc_info = do
let dflags = hsc_dflags hsc_env
... | 2,257 | tryNewCodeGen hsc_env this_mod data_tycons
cost_centre_info stg_binds hpc_info = do
let dflags = hsc_dflags hsc_env
let cmm_stream :: Stream IO CmmGroup ()
cmm_stream = {-# SCC "StgCmm" #-}
StgCmm.codeGen dflags this_mod data_tycons
cost_centre_info ... | 2,073 | true | true | 2 | 19 | 843 | 449 | 213 | 236 | null | null |
TomMD/ghc | compiler/main/DynFlags.hs | bsd-3-clause | addDepSuffix :: FilePath -> DynFlags -> DynFlags
addDepSuffix s d = d { depSuffixes = s : depSuffixes d } | 105 | addDepSuffix :: FilePath -> DynFlags -> DynFlags
addDepSuffix s d = d { depSuffixes = s : depSuffixes d } | 105 | addDepSuffix s d = d { depSuffixes = s : depSuffixes d } | 56 | false | true | 0 | 9 | 19 | 48 | 22 | 26 | null | null |
SWP-Ubau-SoSe2014-Haskell/SWPSoSe14 | src/RailEditor/Selection.hs | mit | getMinimum :: [TAC.Position] -> TAC.Position
getMinimum [] = (0,0) | 66 | getMinimum :: [TAC.Position] -> TAC.Position
getMinimum [] = (0,0) | 66 | getMinimum [] = (0,0) | 21 | false | true | 0 | 7 | 8 | 33 | 18 | 15 | null | null |
sdiehl/ghc | compiler/GHC/Stg/Stats.hs | bsd-3-clause | gatherStgStats :: [StgTopBinding] -> StatEnv
gatherStgStats binds = combineSEs (map statTopBinding binds) | 105 | gatherStgStats :: [StgTopBinding] -> StatEnv
gatherStgStats binds = combineSEs (map statTopBinding binds) | 105 | gatherStgStats binds = combineSEs (map statTopBinding binds) | 60 | false | true | 0 | 7 | 11 | 35 | 17 | 18 | null | null |
athanclark/tries | src/Data/Trie/Pseudo.hs | bsd-3-clause | -- | The meet of two @PseudoTrie@s
intersectionWith :: (Eq t) =>
(a -> b -> c)
-> PseudoTrie t a
-> PseudoTrie t b
-> PseudoTrie t c
intersectionWith _ _ Nil = Nil | 234 | intersectionWith :: (Eq t) =>
(a -> b -> c)
-> PseudoTrie t a
-> PseudoTrie t b
-> PseudoTrie t c
intersectionWith _ _ Nil = Nil | 199 | intersectionWith _ _ Nil = Nil | 30 | true | true | 0 | 9 | 105 | 66 | 33 | 33 | null | null |
michalkonecny/aern | aern-mpfr-rounded/src/Numeric/AERN/RealArithmetic/Basis/MPFR/Conversion.hs | bsd-3-clause | dblMinBound, dblMaxBound :: Double
dblMinBound = encodeFloat (negate $ dblSigMaxBound - 1) dblExpMaxBound | 105 | dblMinBound, dblMaxBound :: Double
dblMinBound = encodeFloat (negate $ dblSigMaxBound - 1) dblExpMaxBound | 105 | dblMinBound = encodeFloat (negate $ dblSigMaxBound - 1) dblExpMaxBound | 70 | false | true | 2 | 8 | 12 | 40 | 17 | 23 | null | null |
UBMLtonGroup/timberc | src/Env.hs | bsd-3-clause | a = TId (name0 "a") | 41 | a = TId (name0 "a") | 41 | a = TId (name0 "a") | 41 | false | false | 0 | 7 | 26 | 15 | 7 | 8 | null | null |
kim/amazonka | amazonka-cloudwatch/gen/Network/AWS/CloudWatch/DescribeAlarms.hs | mpl-2.0 | -- | The maximum number of alarm descriptions to retrieve.
daMaxRecords :: Lens' DescribeAlarms (Maybe Natural)
daMaxRecords = lens _daMaxRecords (\s a -> s { _daMaxRecords = a }) . mapping _Nat | 194 | daMaxRecords :: Lens' DescribeAlarms (Maybe Natural)
daMaxRecords = lens _daMaxRecords (\s a -> s { _daMaxRecords = a }) . mapping _Nat | 135 | daMaxRecords = lens _daMaxRecords (\s a -> s { _daMaxRecords = a }) . mapping _Nat | 82 | true | true | 0 | 10 | 31 | 53 | 28 | 25 | null | null |
gcross/habit-of-fate | sources/tests/test-server.hs | agpl-3.0 | main ∷ HasCallStack ⇒ IO ()
main = doMain
------------------------------------------------------------------------------
[ testGroup "HabitOfFate.Server"
------------------------------------------------------------------------------
[ testGroup "JSON API" $
------------------------------------------------... | 29,003 | main ∷ HasCallStack ⇒ IO ()
main = doMain
------------------------------------------------------------------------------
[ testGroup "HabitOfFate.Server"
------------------------------------------------------------------------------
[ testGroup "JSON API" $
------------------------------------------------... | 29,003 | main = doMain
------------------------------------------------------------------------------
[ testGroup "HabitOfFate.Server"
------------------------------------------------------------------------------
[ testGroup "JSON API" $
----------------------------------------------------------------------------... | 28,975 | false | true | 0 | 27 | 8,715 | 4,184 | 2,114 | 2,070 | null | null |
drbean/pdrt-sandbox | src/Data/DRS/LambdaCalculus.hs | apache-2.0 | renameCons (Merge _ _) _ _ = [] | 34 | renameCons (Merge _ _) _ _ = [] | 34 | renameCons (Merge _ _) _ _ = [] | 34 | false | false | 0 | 7 | 10 | 23 | 11 | 12 | null | null |
MichielDerhaeg/stack | src/Stack/Types/Config.hs | bsd-3-clause | readColorWhen :: ReadM ColorWhen
readColorWhen = do
s <- OA.readerAsk
case s of
"never" -> return ColorNever
"always" -> return ColorAlways
"auto" -> return ColorAuto
_ -> OA.readerError "Expected values of color option are 'never', 'always', or 'auto'."
-- | A superset of 'Conf... | 578 | readColorWhen :: ReadM ColorWhen
readColorWhen = do
s <- OA.readerAsk
case s of
"never" -> return ColorNever
"always" -> return ColorAlways
"auto" -> return ColorAuto
_ -> OA.readerError "Expected values of color option are 'never', 'always', or 'auto'."
-- | A superset of 'Conf... | 578 | readColorWhen = do
s <- OA.readerAsk
case s of
"never" -> return ColorNever
"always" -> return ColorAlways
"auto" -> return ColorAuto
_ -> OA.readerError "Expected values of color option are 'never', 'always', or 'auto'."
-- | A superset of 'Config' adding information on how to ... | 545 | false | true | 0 | 12 | 128 | 79 | 37 | 42 | null | null |
schernichkin/snakes | src/Data/Snakes.hs | bsd-3-clause | diffStream :: (Stream s m t, Eq t, Num a, Ord a)
=> SnakeShape -> Maybe a -> s -> s -> m (Maybe (DiffStream s t a))
diffStream sh d l r = fmap (snakeToDiffStream sh l r) <$> snake d l r | 198 | diffStream :: (Stream s m t, Eq t, Num a, Ord a)
=> SnakeShape -> Maybe a -> s -> s -> m (Maybe (DiffStream s t a))
diffStream sh d l r = fmap (snakeToDiffStream sh l r) <$> snake d l r | 197 | diffStream sh d l r = fmap (snakeToDiffStream sh l r) <$> snake d l r | 69 | false | true | 0 | 14 | 56 | 113 | 55 | 58 | null | null |
Daniel-Diaz/rachel | Rachel/Compilation.hs | bsd-3-clause | isDecHead :: String -> Bool
isDecHead str = not (null str) && (isAlpha (head str) || head str == '(' || head str == '#') | 120 | isDecHead :: String -> Bool
isDecHead str = not (null str) && (isAlpha (head str) || head str == '(' || head str == '#') | 120 | isDecHead str = not (null str) && (isAlpha (head str) || head str == '(' || head str == '#') | 92 | false | true | 2 | 13 | 24 | 72 | 32 | 40 | null | null |
ancientlanguage/haskell-analysis | grammar/src/Grammar/Common/Decompose.hs | mit | decomposeChar '\xF981' = "\x5973" | 33 | decomposeChar '\xF981' = "\x5973" | 33 | decomposeChar '\xF981' = "\x5973" | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
PuZZleDucK/Hls | Hbasename.hs | gpl-3.0 | startsWith [] _ = False | 23 | startsWith [] _ = False | 23 | startsWith [] _ = False | 23 | false | false | 0 | 5 | 4 | 15 | 6 | 9 | null | null |
gcampax/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | true_Expr = nlHsVar true_RDR | 34 | true_Expr = nlHsVar true_RDR | 34 | true_Expr = nlHsVar true_RDR | 34 | false | false | 1 | 5 | 9 | 12 | 4 | 8 | null | null |
alekar/hugs | packages/Cabal/Network/Hackage/CabalInstall/TarUtils.hs | bsd-3-clause | locateFile :: [FilePath] -- ^File list.
-> FilePath -- ^Base directory.
-> [FilePath] -- ^List of filenames to locate.
-> Maybe FilePath
locateFile files dir names
= find findFile files
where findFile file
= let (root,name) = splitFileName file
in... | 527 | locateFile :: [FilePath] -- ^File list.
-> FilePath -- ^Base directory.
-> [FilePath] -- ^List of filenames to locate.
-> Maybe FilePath
locateFile files dir names
= find findFile files
where findFile file
= let (root,name) = splitFileName file
in... | 527 | locateFile files dir names
= find findFile files
where findFile file
= let (root,name) = splitFileName file
in root == dir && name `elem` names
{-|
Locate all files with a given extension and return the shortest result.
@
locateFileExt [\"somedir\/test.cabal\"] \"cabal\"
=... | 355 | false | true | 0 | 11 | 150 | 93 | 49 | 44 | null | null |
urbit/urbit | pkg/hs/urbit-king/lib/Urbit/Vere/Dawn.hs | mit | dawnSendHTTP :: String -> L.ByteString -> RIO e (Either Int L.ByteString)
dawnSendHTTP endpoint requestData = liftIO do
manager <- C.newManager TLS.tlsManagerSettings
initialRequest <- C.parseRequest endpoint
let request = initialRequest
{ C.method = "POST"
, C.requestBody = C.RequestBodyLBS $ re... | 737 | dawnSendHTTP :: String -> L.ByteString -> RIO e (Either Int L.ByteString)
dawnSendHTTP endpoint requestData = liftIO do
manager <- C.newManager TLS.tlsManagerSettings
initialRequest <- C.parseRequest endpoint
let request = initialRequest
{ C.method = "POST"
, C.requestBody = C.RequestBodyLBS $ re... | 737 | dawnSendHTTP endpoint requestData = liftIO do
manager <- C.newManager TLS.tlsManagerSettings
initialRequest <- C.parseRequest endpoint
let request = initialRequest
{ C.method = "POST"
, C.requestBody = C.RequestBodyLBS $ requestData
, C.requestHeaders = [("Accept", "application/json"),
... | 663 | false | true | 1 | 14 | 201 | 212 | 107 | 105 | null | null |
brendanhay/gogol | gogol-resourcemanager/gen/Network/Google/Resource/CloudResourceManager/Projects/Patch.hs | mpl-2.0 | -- | Multipart request metadata.
ppPayload :: Lens' ProjectsPatch Project
ppPayload
= lens _ppPayload (\ s a -> s{_ppPayload = a}) | 132 | ppPayload :: Lens' ProjectsPatch Project
ppPayload
= lens _ppPayload (\ s a -> s{_ppPayload = a}) | 99 | ppPayload
= lens _ppPayload (\ s a -> s{_ppPayload = a}) | 58 | true | true | 1 | 9 | 22 | 44 | 22 | 22 | null | null |
mhwombat/creatur-wains-iomha | src/ALife/Creatur/Wain/Iomha/Experiment.hs | bsd-3-clause | updateChildren :: StateT Experiment IO ()
updateChildren = do
(a:matureChildren) <- W.weanMatureChildren <$> use subject
assign subject a
(a':deadChildren) <- W.pruneDeadChildren <$> use subject
assign subject a'
assign weanlings (matureChildren ++ deadChildren)
(summary.rWeanCount) += length matureChildren | 320 | updateChildren :: StateT Experiment IO ()
updateChildren = do
(a:matureChildren) <- W.weanMatureChildren <$> use subject
assign subject a
(a':deadChildren) <- W.pruneDeadChildren <$> use subject
assign subject a'
assign weanlings (matureChildren ++ deadChildren)
(summary.rWeanCount) += length matureChildren | 320 | updateChildren = do
(a:matureChildren) <- W.weanMatureChildren <$> use subject
assign subject a
(a':deadChildren) <- W.pruneDeadChildren <$> use subject
assign subject a'
assign weanlings (matureChildren ++ deadChildren)
(summary.rWeanCount) += length matureChildren | 278 | false | true | 0 | 9 | 47 | 112 | 52 | 60 | null | null |
mjhopkins/StopPayingForFreeMonads | Expressions.hs | mit | projR :: (f :+: g) a -> Maybe (g a)
projR s = case s of
Inl _ -> Nothing
Inr ga -> Just ga
-- Fix | 103 | projR :: (f :+: g) a -> Maybe (g a)
projR s = case s of
Inl _ -> Nothing
Inr ga -> Just ga
-- Fix | 103 | projR s = case s of
Inl _ -> Nothing
Inr ga -> Just ga
-- Fix | 67 | false | true | 0 | 8 | 32 | 63 | 30 | 33 | null | null |
perryleo/sicp | ch1/sicpc1e28.hs | mit | -- To implement Miller-Rabin test, we need a procedure that computes the
-- exponential of a number modulo another number
expmod :: (Integral a) => a -> a -> a -> a
expmod base 0 m = 1 | 184 | expmod :: (Integral a) => a -> a -> a -> a
expmod base 0 m = 1 | 62 | expmod base 0 m = 1 | 19 | true | true | 0 | 10 | 37 | 47 | 23 | 24 | null | null |
avieth/diplomacy | Data/AtLeast.hs | bsd-3-clause | fromList :: [t] -> AtLeast Z t
fromList xs = AtLeast VNil xs | 60 | fromList :: [t] -> AtLeast Z t
fromList xs = AtLeast VNil xs | 60 | fromList xs = AtLeast VNil xs | 29 | false | true | 0 | 6 | 12 | 31 | 15 | 16 | null | null |
Mathnerd314/lamdu | src/Lamdu/CodeEdit/Sugar/Monad.hs | gpl-3.0 | convertSubexpression :: (MonadA m, Monoid a) => ExprMM m a -> SugarM m (ExpressionU m a)
convertSubexpression exprI = do
convertSub <- scConvertSubexpression <$> readContext
convertSub exprI | 194 | convertSubexpression :: (MonadA m, Monoid a) => ExprMM m a -> SugarM m (ExpressionU m a)
convertSubexpression exprI = do
convertSub <- scConvertSubexpression <$> readContext
convertSub exprI | 194 | convertSubexpression exprI = do
convertSub <- scConvertSubexpression <$> readContext
convertSub exprI | 105 | false | true | 0 | 9 | 30 | 68 | 32 | 36 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_PIXEL_MAP_B_TO_B :: GLenum
gl_PIXEL_MAP_B_TO_B = 0x0C78 | 58 | gl_PIXEL_MAP_B_TO_B :: GLenum
gl_PIXEL_MAP_B_TO_B = 0x0C78 | 58 | gl_PIXEL_MAP_B_TO_B = 0x0C78 | 28 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
rueshyna/gogol | gogol-oauth2/gen/Network/Google/OAuth2/Types.hs | mpl-2.0 | -- | Know the list of people in your circles, your age range, and language
plusLoginScope :: Proxy '["https://www.googleapis.com/auth/plus.login"]
plusLoginScope = Proxy | 169 | plusLoginScope :: Proxy '["https://www.googleapis.com/auth/plus.login"]
plusLoginScope = Proxy | 94 | plusLoginScope = Proxy | 22 | true | true | 0 | 7 | 21 | 20 | 11 | 9 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs | mpl-2.0 | -- | Name of this placement strategy. This is a required field. It must be
-- less than 256 characters long and unique among placement strategies of
-- the same account.
psName :: Lens' PlacementStrategy (Maybe Text)
psName = lens _psName (\ s a -> s{_psName = a}) | 264 | psName :: Lens' PlacementStrategy (Maybe Text)
psName = lens _psName (\ s a -> s{_psName = a}) | 94 | psName = lens _psName (\ s a -> s{_psName = a}) | 47 | true | true | 1 | 9 | 47 | 54 | 27 | 27 | null | null |
kaoskorobase/mescaline | resources/hugs/packages/base/Data/IntMap.hs | gpl-3.0 | intersectionWithKey f t1 (Tip k y)
= case lookup k t1 of
Just x -> Tip k (f k x y)
Nothing -> Nil | 113 | intersectionWithKey f t1 (Tip k y)
= case lookup k t1 of
Just x -> Tip k (f k x y)
Nothing -> Nil | 113 | intersectionWithKey f t1 (Tip k y)
= case lookup k t1 of
Just x -> Tip k (f k x y)
Nothing -> Nil | 113 | false | false | 4 | 8 | 39 | 59 | 28 | 31 | null | null |
sof/hdirect | src/CustomAttributes.hs | bsd-3-clause | tyArgsAttr :: Name
tyArgsAttr = "ty_args" | 49 | tyArgsAttr :: Name
tyArgsAttr = "ty_args" | 49 | tyArgsAttr = "ty_args" | 26 | false | true | 0 | 4 | 13 | 11 | 6 | 5 | null | null |
ssaavedra/liquidhaskell | benchmarks/vector-0.10.0.1/Data/Vector.hs | bsd-3-clause | unsafeUpd = G.unsafeUpd | 23 | unsafeUpd = G.unsafeUpd | 23 | unsafeUpd = G.unsafeUpd | 23 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
ghcjs/ghcjs | src/Gen2/Compactor.hs | mit | -- do not deduplicate thunks
ignoreStatic :: StaticInfo -> Bool
ignoreStatic (StaticInfo _ StaticThunk {} _) = True | 115 | ignoreStatic :: StaticInfo -> Bool
ignoreStatic (StaticInfo _ StaticThunk {} _) = True | 86 | ignoreStatic (StaticInfo _ StaticThunk {} _) = True | 51 | true | true | 0 | 8 | 17 | 33 | 17 | 16 | null | null |
keithodulaigh/Hets | HasCASL/Sublogic.hs | gpl-2.0 | sl_opInfo :: OpInfo -> Sublogic
sl_opInfo o = comp_list $ sl_typeScheme (opType o) : sl_opDefn (opDefn o)
: map sl_opAttr (Set.toList $ opAttrs o) | 160 | sl_opInfo :: OpInfo -> Sublogic
sl_opInfo o = comp_list $ sl_typeScheme (opType o) : sl_opDefn (opDefn o)
: map sl_opAttr (Set.toList $ opAttrs o) | 160 | sl_opInfo o = comp_list $ sl_typeScheme (opType o) : sl_opDefn (opDefn o)
: map sl_opAttr (Set.toList $ opAttrs o) | 128 | false | true | 0 | 10 | 37 | 65 | 31 | 34 | null | null |
Happy0/haskellscrabble | src/Wordify/Rules/Dictionary.hs | gpl-3.0 | upperCaseWords :: [String] -> [String]
upperCaseWords = (map . map) toUpper | 77 | upperCaseWords :: [String] -> [String]
upperCaseWords = (map . map) toUpper | 75 | upperCaseWords = (map . map) toUpper | 36 | false | true | 0 | 8 | 12 | 37 | 18 | 19 | null | null |
leroux/packages-haskeline | System/Console/Haskeline/Command.hs | bsd-2-clause | setState :: (Monad m, LineState s) => Command m s s
setState s = effect (lineChange s) >> return s | 98 | setState :: (Monad m, LineState s) => Command m s s
setState s = effect (lineChange s) >> return s | 98 | setState s = effect (lineChange s) >> return s | 46 | false | true | 0 | 8 | 19 | 52 | 25 | 27 | null | null |
fabianbergmark/ECMA-262 | src/Language/JavaScript/Host/Console.hs | bsd-2-clause | consoleLogCallImpl :: (Functor m, Monad m, MonadIO m) => InternalCallType m
consoleLogCallImpl f this (List args) = do
forM (intersperse (r.r.r.r.inj $ " ") args) $ \v -> toString v >>= liftIO . putStr
liftIO $ putStrLn ""
return . r.r.r.inj $ Undefined | 259 | consoleLogCallImpl :: (Functor m, Monad m, MonadIO m) => InternalCallType m
consoleLogCallImpl f this (List args) = do
forM (intersperse (r.r.r.r.inj $ " ") args) $ \v -> toString v >>= liftIO . putStr
liftIO $ putStrLn ""
return . r.r.r.inj $ Undefined | 259 | consoleLogCallImpl f this (List args) = do
forM (intersperse (r.r.r.r.inj $ " ") args) $ \v -> toString v >>= liftIO . putStr
liftIO $ putStrLn ""
return . r.r.r.inj $ Undefined | 183 | false | true | 0 | 16 | 48 | 124 | 60 | 64 | null | null |
yanatan16/haskell-chp-wc | src/Data/WordCount/Types.hs | mit | summarize :: Counts -> IO ()
summarize = flip printCounts "total" | 65 | summarize :: Counts -> IO ()
summarize = flip printCounts "total" | 65 | summarize = flip printCounts "total" | 36 | false | true | 0 | 7 | 10 | 25 | 12 | 13 | null | null |
nicoan/miniLogo | src/Evaluation.hs | gpl-3.0 | evalColor (Left Yellow) _ = return (rgb 255 255 0) | 50 | evalColor (Left Yellow) _ = return (rgb 255 255 0) | 50 | evalColor (Left Yellow) _ = return (rgb 255 255 0) | 50 | false | false | 0 | 7 | 9 | 32 | 14 | 18 | null | null |
Numberartificial/workflow | snipets/src/Craft/Chapter18.hs | mit | -- Programming with monads
-- ^^^^^^^^^^^^^^^^^^^^^^^
-- The basics of input/output
-- ^^^^^^^^^^^^^^^^^^^^^^^^^^
-- Reading input is done by getLine and getChar: see Prelude for details.
-- getLine :: IO String
-- getChar :: IO Char
-- Text strings are written using
--
-- putStr :: String -> IO ()
-- putSt... | 426 | helloWorld :: IO ()
helloWorld = putStr "Hello, World!" | 55 | helloWorld = putStr "Hello, World!" | 35 | true | true | 0 | 7 | 84 | 37 | 22 | 15 | null | null |
BurntSushi/fex | Development/FexA/Experiment.hs | unlicense | -- | Just like `evalIO`, except it stops the program and outputs an error
-- message if one occurs.
evalIO' :: Fex -> IO Value
evalIO' e = evalIO e >>= \e' ->
case e' of
Left err -> putStrLn err >> exitFailure
Right v -> return v
-- | Completely evaluate a Fex term to a v... | 474 | evalIO' :: Fex -> IO Value
evalIO' e = evalIO e >>= \e' ->
case e' of
Left err -> putStrLn err >> exitFailure
Right v -> return v
-- | Completely evaluate a Fex term to a value after checking if the static
-- dependencies of the given term exist. If not, then an error mes... | 374 | evalIO' e = evalIO e >>= \e' ->
case e' of
Left err -> putStrLn err >> exitFailure
Right v -> return v
-- | Completely evaluate a Fex term to a value after checking if the static
-- dependencies of the given term exist. If not, then an error message is
-- returned detaili... | 347 | true | true | 0 | 11 | 130 | 70 | 35 | 35 | null | null |
leshchevds/ganeti | src/Ganeti/BasicTypes.hs | bsd-2-clause | -- | Converts a monadic result with a 'String' message into
-- a 'ResultT' with an arbitrary 'Error'.
--
-- Expects that the given action has already taken care of any possible
-- errors. In particular, if applied on @IO (Result a)@, any exceptions
-- should be handled by the given action.
--
-- See also 'toErrorStr'.
... | 428 | mkResultT :: (Monad m, FromString e) => m (Result a) -> ResultT e m a
mkResultT = ResultT . liftM toErrorStr | 108 | mkResultT = ResultT . liftM toErrorStr | 38 | true | true | 1 | 10 | 77 | 67 | 35 | 32 | null | null |
google/codeworld | codeworld-base/src/Extras/Util.hs | apache-2.0 | foreach :: ([input], input -> output) -> [output]
foreach (l, f) = P.map f l | 76 | foreach :: ([input], input -> output) -> [output]
foreach (l, f) = P.map f l | 76 | foreach (l, f) = P.map f l | 26 | false | true | 0 | 7 | 14 | 51 | 27 | 24 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_QUERY_RESULT_ARB :: GLenum
gl_QUERY_RESULT_ARB = 0x8866 | 58 | gl_QUERY_RESULT_ARB :: GLenum
gl_QUERY_RESULT_ARB = 0x8866 | 58 | gl_QUERY_RESULT_ARB = 0x8866 | 28 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 440781 = 4518 | 33 | getValueFromProduct 440781 = 4518 | 33 | getValueFromProduct 440781 = 4518 | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/playpen/conal-elliot/2019-03-conal-elliott-convolution/src/Lib.hs | unlicense | toEndo :: Monoid a => a -> Endo a
toEndo a = Endo (\z -> a <> z ) | 74 | toEndo :: Monoid a => a -> Endo a
toEndo a = Endo (\z -> a <> z ) | 74 | toEndo a = Endo (\z -> a <> z ) | 40 | false | true | 0 | 8 | 27 | 46 | 22 | 24 | null | null |
laughedelic/sparse-lin-alg | Tests/Matrix.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- LOOKUP/UPDATE --
-------------------
testgr_lookup_update = testGroup "LOOKUP/UPDATE"
[ testProperty "Insert/Erase" prop_ins ] | 215 | testgr_lookup_update = testGroup "LOOKUP/UPDATE"
[ testProperty "Insert/Erase" prop_ins ] | 93 | testgr_lookup_update = testGroup "LOOKUP/UPDATE"
[ testProperty "Insert/Erase" prop_ins ] | 93 | true | false | 0 | 6 | 18 | 23 | 12 | 11 | null | null |
fpco/statistics | Statistics/Distribution/StudentT.hs | bsd-2-clause | logDensityUnscaled :: StudentT -> Double -> Double
logDensityUnscaled (StudentT ndf) x =
log (ndf / (ndf + x*x)) * (0.5 * (1 + ndf)) - logBeta 0.5 (0.5 * ndf) | 162 | logDensityUnscaled :: StudentT -> Double -> Double
logDensityUnscaled (StudentT ndf) x =
log (ndf / (ndf + x*x)) * (0.5 * (1 + ndf)) - logBeta 0.5 (0.5 * ndf) | 162 | logDensityUnscaled (StudentT ndf) x =
log (ndf / (ndf + x*x)) * (0.5 * (1 + ndf)) - logBeta 0.5 (0.5 * ndf) | 111 | false | true | 0 | 12 | 33 | 85 | 44 | 41 | null | null |
meditans/logicExperiments | src/RestrictedSequentCalculus.hs | bsd-3-clause | isUnexaminedTree _ = False | 48 | isUnexaminedTree _ = False | 48 | isUnexaminedTree _ = False | 48 | false | false | 0 | 5 | 25 | 9 | 4 | 5 | null | null |
takayuki/natume | Re.hs | gpl-2.0 | literal :: Parser Char
literal (_,_ ,[]) = syntaxerror | 54 | literal :: Parser Char
literal (_,_ ,[]) = syntaxerror | 54 | literal (_,_ ,[]) = syntaxerror | 31 | false | true | 0 | 7 | 8 | 28 | 15 | 13 | null | null |
infotroph/pandoc | src/Text/Pandoc/Writers/OpenDocument.hs | gpl-2.0 | addTableStyle :: Doc -> State WriterState ()
addTableStyle i = modify $ \s -> s { stTableStyles = i : stTableStyles s } | 119 | addTableStyle :: Doc -> State WriterState ()
addTableStyle i = modify $ \s -> s { stTableStyles = i : stTableStyles s } | 119 | addTableStyle i = modify $ \s -> s { stTableStyles = i : stTableStyles s } | 74 | false | true | 2 | 10 | 22 | 55 | 26 | 29 | null | null |
rjeli/luatalk | src/Lexer.hs | bsd-3-clause | ppToken (Symbol s) = s | 29 | ppToken (Symbol s) = s | 29 | ppToken (Symbol s) = s | 29 | false | false | 0 | 7 | 11 | 15 | 7 | 8 | null | null |
robeverest/accelerate-fft | Data/Array/Accelerate/Math/FFT.hs | bsd-3-clause | isPow2 :: Int -> Bool
isPow2 x = x .&. (x-1) == 0 | 49 | isPow2 :: Int -> Bool
isPow2 x = x .&. (x-1) == 0 | 49 | isPow2 x = x .&. (x-1) == 0 | 27 | false | true | 0 | 8 | 12 | 33 | 17 | 16 | null | null |
urbanslug/ghc | testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.hs | bsd-3-clause | last :: _ => _
last = P.last | 28 | last :: _ => _
last = P.last | 28 | last = P.last | 13 | false | true | 0 | 7 | 7 | 25 | 10 | 15 | null | null |
mhwombat/creatur-wains-iomha | test/SOMTest.hs | bsd-3-clause | main :: IO ()
main = do
files <- map (dir ++) . take 100 . drop 2 <$> getDirectoryContents dir
imgs <- mapM readImage files
som <- evalRandIO makeClassifier
let som' = foldl' update som imgs
let ss = mkSizeSpec2D (Just 500) Nothing
let diagram = drawClassifier . toList $ som' :: QDiagram SVG V2 Double Any
... | 355 | main :: IO ()
main = do
files <- map (dir ++) . take 100 . drop 2 <$> getDirectoryContents dir
imgs <- mapM readImage files
som <- evalRandIO makeClassifier
let som' = foldl' update som imgs
let ss = mkSizeSpec2D (Just 500) Nothing
let diagram = drawClassifier . toList $ som' :: QDiagram SVG V2 Double Any
... | 355 | main = do
files <- map (dir ++) . take 100 . drop 2 <$> getDirectoryContents dir
imgs <- mapM readImage files
som <- evalRandIO makeClassifier
let som' = foldl' update som imgs
let ss = mkSizeSpec2D (Just 500) Nothing
let diagram = drawClassifier . toList $ som' :: QDiagram SVG V2 Double Any
renderSVG "SO... | 341 | false | true | 1 | 11 | 75 | 141 | 67 | 74 | null | null |
diku-dk/futhark | src/Language/Futhark/TypeChecker/Terms/Monad.hs | isc | initialTermScope :: TermScope
initialTermScope =
TermScope
{ scopeVtable = initialVtable,
scopeTypeTable = mempty,
scopeNameMap = topLevelNameMap,
scopeModTable = mempty
}
where
initialVtable = M.fromList $ mapMaybe addIntrinsicF $ M.toList intrinsics
prim = Scalar . Prim
arro... | 1,095 | initialTermScope :: TermScope
initialTermScope =
TermScope
{ scopeVtable = initialVtable,
scopeTypeTable = mempty,
scopeNameMap = topLevelNameMap,
scopeModTable = mempty
}
where
initialVtable = M.fromList $ mapMaybe addIntrinsicF $ M.toList intrinsics
prim = Scalar . Prim
arro... | 1,095 | initialTermScope =
TermScope
{ scopeVtable = initialVtable,
scopeTypeTable = mempty,
scopeNameMap = topLevelNameMap,
scopeModTable = mempty
}
where
initialVtable = M.fromList $ mapMaybe addIntrinsicF $ M.toList intrinsics
prim = Scalar . Prim
arrow x y = Scalar $ Arrow mempty ... | 1,065 | false | true | 7 | 13 | 341 | 357 | 181 | 176 | null | null |
kyren/hsgb | lib/Gameboy/CPU.hs | unlicense | doInstruction (ADD_SP_N n) = do
sp <- getStackPointer
let (res, h, c) = add16 sp (fromIntegral n)
setFlags (Just False) (Just False) (Just h) (Just c)
setStackPointer res
tick 16 | 188 | doInstruction (ADD_SP_N n) = do
sp <- getStackPointer
let (res, h, c) = add16 sp (fromIntegral n)
setFlags (Just False) (Just False) (Just h) (Just c)
setStackPointer res
tick 16 | 188 | doInstruction (ADD_SP_N n) = do
sp <- getStackPointer
let (res, h, c) = add16 sp (fromIntegral n)
setFlags (Just False) (Just False) (Just h) (Just c)
setStackPointer res
tick 16 | 188 | false | false | 0 | 12 | 39 | 100 | 46 | 54 | null | null |
csakatoku/hello-yesod | test/TestImport.hs | bsd-2-clause | runDBWithApp :: App -> SqlPersistM a -> IO a
runDBWithApp app query = runSqlPersistMPool query (appConnPool app) | 112 | runDBWithApp :: App -> SqlPersistM a -> IO a
runDBWithApp app query = runSqlPersistMPool query (appConnPool app) | 112 | runDBWithApp app query = runSqlPersistMPool query (appConnPool app) | 67 | false | true | 0 | 7 | 16 | 41 | 19 | 22 | null | null |
hvr/text | tests/Tests/Properties.hs | bsd-2-clause | tl_rational = tl_read_rational TL.rational 1e-16 | 48 | tl_rational = tl_read_rational TL.rational 1e-16 | 48 | tl_rational = tl_read_rational TL.rational 1e-16 | 48 | false | false | 0 | 6 | 4 | 13 | 6 | 7 | null | null |
Zimmi48/gps-bank-data-analysis | XmlInputReader.hs | mpl-2.0 | name_amount_date ("DTPOSTED" : date : tl) = let (name , amount , Nothing) = name_amount_date tl in (name , amount , Just date) | 126 | name_amount_date ("DTPOSTED" : date : tl) = let (name , amount , Nothing) = name_amount_date tl in (name , amount , Just date) | 126 | name_amount_date ("DTPOSTED" : date : tl) = let (name , amount , Nothing) = name_amount_date tl in (name , amount , Just date) | 126 | false | false | 0 | 9 | 22 | 57 | 29 | 28 | null | null |
urbanslug/ghc | compiler/main/DynFlags.hs | bsd-3-clause | supportedExtensions :: [String]
supportedExtensions
= concatMap (\name -> [name, "No" ++ name]) (map flagSpecName xFlags) | 125 | supportedExtensions :: [String]
supportedExtensions
= concatMap (\name -> [name, "No" ++ name]) (map flagSpecName xFlags) | 125 | supportedExtensions
= concatMap (\name -> [name, "No" ++ name]) (map flagSpecName xFlags) | 93 | false | true | 0 | 9 | 18 | 48 | 25 | 23 | null | null |
jamesyang124/haskell-playground | src/Chp5.hs | bsd-3-clause | -- | Recursion with pattern matching
maximum1' [] = error "maximum of empty list" | 82 | maximum1' [] = error "maximum of empty list" | 44 | maximum1' [] = error "maximum of empty list" | 44 | true | false | 0 | 6 | 14 | 15 | 7 | 8 | null | null |
idf/haskell-examples | fundamentals/0_basics.hs | bsd-3-clause | -- | length
length' xs = sum [1 | _ <- xs] | 42 | length' xs = sum [1 | _ <- xs] | 30 | length' xs = sum [1 | _ <- xs] | 30 | true | false | 0 | 8 | 11 | 24 | 12 | 12 | null | null |
8l/barrelfish | tools/flounder/AHCI.hs | mit | ahci_header_file :: String -> Interface -> [C.Unit]
ahci_header_file infile interface@(Interface name descr decls) =
let
(types, messagedecls) = Backend.partitionTypesMessages decls
rpcs = [ rpc | rpc@(RPC _ _ _) <- messagedecls ]
rpc_msgs = concat $ map rpc_to_msgs rpcs
rx_rpc_msgs ... | 1,053 | ahci_header_file :: String -> Interface -> [C.Unit]
ahci_header_file infile interface@(Interface name descr decls) =
let
(types, messagedecls) = Backend.partitionTypesMessages decls
rpcs = [ rpc | rpc@(RPC _ _ _) <- messagedecls ]
rpc_msgs = concat $ map rpc_to_msgs rpcs
rx_rpc_msgs ... | 1,053 | ahci_header_file infile interface@(Interface name descr decls) =
let
(types, messagedecls) = Backend.partitionTypesMessages decls
rpcs = [ rpc | rpc@(RPC _ _ _) <- messagedecls ]
rpc_msgs = concat $ map rpc_to_msgs rpcs
rx_rpc_msgs = [ msg | msg@(Message MResponse _ _ _) <- rpc_msgs ... | 1,001 | false | true | 0 | 14 | 304 | 310 | 164 | 146 | null | null |
shlevy/ghc | compiler/specialise/Rules.hs | bsd-3-clause | ruleCheck _ (Coercion _) = emptyBag | 38 | ruleCheck _ (Coercion _) = emptyBag | 38 | ruleCheck _ (Coercion _) = emptyBag | 38 | false | false | 1 | 6 | 8 | 20 | 8 | 12 | null | null |
alphaHeavy/cabal | cabal-install/Distribution/Client/Dependency/Modular/Dependency.hs | bsd-3-clause | goalReasonToVars :: GoalReason qpn -> ConflictSet qpn
goalReasonToVars UserGoal = S.empty | 105 | goalReasonToVars :: GoalReason qpn -> ConflictSet qpn
goalReasonToVars UserGoal = S.empty | 105 | goalReasonToVars UserGoal = S.empty | 51 | false | true | 0 | 6 | 26 | 30 | 13 | 17 | null | null |
dennis84/collab-haskell | test/Collab/Test/Util.hs | mit | withServerApp :: IO () -> IO ()
withServerApp action = do
thread <- forkIO runServerApp
waitSome
result <- action
killThread thread
return result | 155 | withServerApp :: IO () -> IO ()
withServerApp action = do
thread <- forkIO runServerApp
waitSome
result <- action
killThread thread
return result | 155 | withServerApp action = do
thread <- forkIO runServerApp
waitSome
result <- action
killThread thread
return result | 123 | false | true | 0 | 8 | 32 | 60 | 25 | 35 | null | null |
ianagbip1oti/ProC | src/ProC/Parser/ProC.hs | mit | exitBlockM :: Parser ()
exitBlockM = getState >>= liftIO . atomically . HM.pop >>= putState | 91 | exitBlockM :: Parser ()
exitBlockM = getState >>= liftIO . atomically . HM.pop >>= putState | 91 | exitBlockM = getState >>= liftIO . atomically . HM.pop >>= putState | 67 | false | true | 0 | 8 | 14 | 34 | 17 | 17 | null | null |
sgraf812/worklist | test/Main.hs | isc | huTests :: [TestTree]
huTests =
[ testGroup "Memoization"
[ testCase "fibonacci 10" (evaluate fibFramework 10 @?= fib 10)
, testCase "factorial 100" (evaluate facFramework 100 @?= fac 100)
]
, testGroup "mutual recursion"
[ testCase "stabilizes mutual recursive nodes" (evaluate mutualRecursi... | 438 | huTests :: [TestTree]
huTests =
[ testGroup "Memoization"
[ testCase "fibonacci 10" (evaluate fibFramework 10 @?= fib 10)
, testCase "factorial 100" (evaluate facFramework 100 @?= fac 100)
]
, testGroup "mutual recursion"
[ testCase "stabilizes mutual recursive nodes" (evaluate mutualRecursi... | 438 | huTests =
[ testGroup "Memoization"
[ testCase "fibonacci 10" (evaluate fibFramework 10 @?= fib 10)
, testCase "factorial 100" (evaluate facFramework 100 @?= fac 100)
]
, testGroup "mutual recursion"
[ testCase "stabilizes mutual recursive nodes" (evaluate mutualRecursiveFramework 1 @?= 10)
... | 416 | false | true | 0 | 12 | 97 | 123 | 59 | 64 | null | null |
mikeplus64/trifecta | src/Text/Trifecta/Util/Array.hs | bsd-3-clause | thaw !ary !_o@(I# o#) !n@(I# n#) =
CHECK_LE("thaw", _o + n, length ary)
ST $ \ s -> case thawArray# (unArray ary) o# n# s of
(# s2, mary# #) -> (# s2, marray mary# n #)
#else
thaw !ary !o !n =
CHECK_LE("thaw", o + n, length ary)
do mary <- new_ n
copy ary o mary 0 n
return mary
#endif
| 308 | thaw !ary !_o@(I# o#) !n@(I# n#) =
CHECK_LE("thaw", _o + n, length ary)
ST $ \ s -> case thawArray# (unArray ary) o# n# s of
(# s2, mary# #) -> (# s2, marray mary# n #)
#else
thaw !ary !o !n =
CHECK_LE("thaw", o + n, length ary)
do mary <- new_ n
copy ary o mary 0 n
return mary
#endif
| 308 | thaw !ary !_o@(I# o#) !n@(I# n#) =
CHECK_LE("thaw", _o + n, length ary)
ST $ \ s -> case thawArray# (unArray ary) o# n# s of
(# s2, mary# #) -> (# s2, marray mary# n #)
#else
thaw !ary !o !n =
CHECK_LE("thaw", o + n, length ary)
do mary <- new_ n
copy ary o mary 0 n
return mary
#endif
| 308 | false | false | 1 | 10 | 85 | 107 | 54 | 53 | null | null |
Teaspot-Studio/gore-and-ash-logging | src/Game/GoreAndAsh/Logging/API.hs | bsd-3-clause | -- | Put error msg to console
logError :: LoggingMonad t m => Behavior t LogStr -> m ()
logError = logMsgLn LogError . fmap ("Error: " <>) | 138 | logError :: LoggingMonad t m => Behavior t LogStr -> m ()
logError = logMsgLn LogError . fmap ("Error: " <>) | 108 | logError = logMsgLn LogError . fmap ("Error: " <>) | 50 | true | true | 0 | 8 | 27 | 49 | 24 | 25 | null | null |
uuhan/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | showCG (MN i s) = "{" ++ T.unpack s ++ "_" ++ show i ++ "}" | 59 | showCG (MN i s) = "{" ++ T.unpack s ++ "_" ++ show i ++ "}" | 59 | showCG (MN i s) = "{" ++ T.unpack s ++ "_" ++ show i ++ "}" | 59 | false | false | 0 | 10 | 15 | 42 | 19 | 23 | null | null |
jean-edouard/manager | disksync/Config.hs | gpl-2.0 | setVhdsyncVerbose :: Bool -> Rpc ()
setVhdsyncVerbose = dbWrite (diskSyncDBPath ++ "/vhdsync-verbose") | 102 | setVhdsyncVerbose :: Bool -> Rpc ()
setVhdsyncVerbose = dbWrite (diskSyncDBPath ++ "/vhdsync-verbose") | 102 | setVhdsyncVerbose = dbWrite (diskSyncDBPath ++ "/vhdsync-verbose") | 66 | false | true | 0 | 7 | 11 | 30 | 15 | 15 | null | null |
conal/TV | src/Interface/TV/IO.hs | bsd-3-clause | {----------------------------------------------------------
Outputs
----------------------------------------------------------}
-- | Equivalent of 'interact'. See also 'Interface.TV.interactLine'
interactOut :: Output IO OI (String -> String)
interactOut = oLambda contentsIn stringOut | 291 | interactOut :: Output IO OI (String -> String)
interactOut = oLambda contentsIn stringOut | 89 | interactOut = oLambda contentsIn stringOut | 42 | true | true | 0 | 7 | 29 | 32 | 17 | 15 | null | null |
joelchelliah/rock-paper-scissors-hs | src/Printer.hs | bsd-3-clause | indent :: String -> String
indent = (" " ++) | 45 | indent :: String -> String
indent = (" " ++) | 45 | indent = (" " ++) | 18 | false | true | 0 | 5 | 10 | 19 | 11 | 8 | null | null |
dinkelk/redo | src/FilePathUtil.hs | mit | unescapeFilePath :: FilePath -> FilePath
unescapeFilePath "" = "" | 65 | unescapeFilePath :: FilePath -> FilePath
unescapeFilePath "" = "" | 65 | unescapeFilePath "" = "" | 24 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
onponomarev/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | hvDiskCache :: String
hvDiskCache = "disk_cache" | 48 | hvDiskCache :: String
hvDiskCache = "disk_cache" | 48 | hvDiskCache = "disk_cache" | 26 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
jgm/pandoc-types | src/Text/Pandoc/Walk.hs | bsd-3-clause | walkMetaValueM f (MetaInlines xs) = MetaInlines <$> walkM f xs | 62 | walkMetaValueM f (MetaInlines xs) = MetaInlines <$> walkM f xs | 62 | walkMetaValueM f (MetaInlines xs) = MetaInlines <$> walkM f xs | 62 | false | false | 0 | 7 | 9 | 26 | 12 | 14 | null | null |
NCrashed/hjass | src/library/Language/Jass/Parser/Grammar.hs | mit | getPosition' :: JassParser SrcPos
getPosition' = do
pos <- getPosition
return $ SrcPos (sourceName pos) (sourceLine pos) (sourceColumn pos) | 147 | getPosition' :: JassParser SrcPos
getPosition' = do
pos <- getPosition
return $ SrcPos (sourceName pos) (sourceLine pos) (sourceColumn pos) | 147 | getPosition' = do
pos <- getPosition
return $ SrcPos (sourceName pos) (sourceLine pos) (sourceColumn pos) | 113 | false | true | 0 | 10 | 26 | 53 | 25 | 28 | null | null |
anttisalonen/cgen | src/Options.hs | bsd-3-clause | parseInterfaceFile fun (l:ls) opts = do
ofun <- fun l
parseInterfaceFile fun ls (ofun opts) | 99 | parseInterfaceFile fun (l:ls) opts = do
ofun <- fun l
parseInterfaceFile fun ls (ofun opts) | 99 | parseInterfaceFile fun (l:ls) opts = do
ofun <- fun l
parseInterfaceFile fun ls (ofun opts) | 99 | false | false | 0 | 9 | 22 | 46 | 21 | 25 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Advertisers/List.hs | mpl-2.0 | -- | Select only advertisers which do not belong to any advertiser group.
allIncludeAdvertisersWithoutGroupsOnly :: Lens' AdvertisersList (Maybe Bool)
allIncludeAdvertisersWithoutGroupsOnly
= lens _allIncludeAdvertisersWithoutGroupsOnly
(\ s a ->
s{_allIncludeAdvertisersWithoutGroupsOnly = a}) | 311 | allIncludeAdvertisersWithoutGroupsOnly :: Lens' AdvertisersList (Maybe Bool)
allIncludeAdvertisersWithoutGroupsOnly
= lens _allIncludeAdvertisersWithoutGroupsOnly
(\ s a ->
s{_allIncludeAdvertisersWithoutGroupsOnly = a}) | 237 | allIncludeAdvertisersWithoutGroupsOnly
= lens _allIncludeAdvertisersWithoutGroupsOnly
(\ s a ->
s{_allIncludeAdvertisersWithoutGroupsOnly = a}) | 160 | true | true | 0 | 9 | 46 | 48 | 25 | 23 | null | null |
Shimuuar/protobuf | Data/Protobuf/Internal/Names.hs | bsd-3-clause | mergeNamespaces :: Namespace -> Namespace -> PbMonadE Namespace
mergeNamespaces namespace (Namespace ns2)
= F.foldlM insertName namespace ns2 | 143 | mergeNamespaces :: Namespace -> Namespace -> PbMonadE Namespace
mergeNamespaces namespace (Namespace ns2)
= F.foldlM insertName namespace ns2 | 143 | mergeNamespaces namespace (Namespace ns2)
= F.foldlM insertName namespace ns2 | 79 | false | true | 0 | 7 | 18 | 42 | 20 | 22 | null | null |
nomeata/cryptonite | Crypto/Cipher/ChaChaPoly1305.hs | bsd-3-clause | appendAAD :: ByteArrayAccess ba => ba -> State -> State
appendAAD ba (State encState macState aadLength plainLength) =
State encState newMacState newLength plainLength
where
newMacState = Poly1305.update macState ba
newLength = aadLength + fromIntegral (B.length ba) | 282 | appendAAD :: ByteArrayAccess ba => ba -> State -> State
appendAAD ba (State encState macState aadLength plainLength) =
State encState newMacState newLength plainLength
where
newMacState = Poly1305.update macState ba
newLength = aadLength + fromIntegral (B.length ba) | 282 | appendAAD ba (State encState macState aadLength plainLength) =
State encState newMacState newLength plainLength
where
newMacState = Poly1305.update macState ba
newLength = aadLength + fromIntegral (B.length ba) | 226 | false | true | 1 | 9 | 51 | 95 | 43 | 52 | null | null |
kojiromike/Idris-dev | src/Idris/Options.hs | bsd-3-clause | getCodegenArgs :: Opt -> Maybe String
getCodegenArgs (CodegenArgs args) = Just args | 83 | getCodegenArgs :: Opt -> Maybe String
getCodegenArgs (CodegenArgs args) = Just args | 83 | getCodegenArgs (CodegenArgs args) = Just args | 45 | false | true | 0 | 7 | 11 | 30 | 14 | 16 | null | null |
mongodb-haskell/mongodb | Database/MongoDB/Admin.hs | apache-2.0 | removeUser :: (MonadIO m)
=> Username -> Action m ()
removeUser user = delete (select ["user" =: user] "system.users") | 129 | removeUser :: (MonadIO m)
=> Username -> Action m ()
removeUser user = delete (select ["user" =: user] "system.users") | 129 | removeUser user = delete (select ["user" =: user] "system.users") | 65 | false | true | 0 | 9 | 29 | 57 | 27 | 30 | null | null |
conal/lambda-ccc | src/LambdaCCC/Unused/ReifyLambda.hs | bsd-3-clause | -- inlineNamesTD :: [String] -> RewriteH Core
-- inlineNamesTD nms = anytdER (inlineNamesR nms)
-- #define FactorReified
reifyNamed :: String -> RewriteH Core
reifyNamed nm = snocPathIn (rhsOfT cmpNm)
( inlineCleanup (lamName "ifThenElse")
-- >>> (tryR $ anytdER $ rule "if/pair")... | 1,625 | reifyNamed :: String -> RewriteH Core
reifyNamed nm = snocPathIn (rhsOfT cmpNm)
( inlineCleanup (lamName "ifThenElse")
-- >>> (tryR $ anytdER $ rule "if/pair")
>>> reifyExprC
>>> reifyRules
#ifdef FactorReified
>>> pathR [App_Ar... | 1,502 | reifyNamed nm = snocPathIn (rhsOfT cmpNm)
( inlineCleanup (lamName "ifThenElse")
-- >>> (tryR $ anytdER $ rule "if/pair")
>>> reifyExprC
>>> reifyRules
#ifdef FactorReified
>>> pathR [App_Arg] (promoteExprR (letIntroR (nm ++ "_r... | 1,464 | true | true | 0 | 19 | 431 | 177 | 95 | 82 | null | null |
energyflowanalysis/efa-2.1 | attic/src/EFA2/Solver/Horn.hs | bsd-3-clause | makeAnd :: NonEmpty.T [] Formula -> Formula
makeAnd = NonEmpty.foldl1 And | 73 | makeAnd :: NonEmpty.T [] Formula -> Formula
makeAnd = NonEmpty.foldl1 And | 73 | makeAnd = NonEmpty.foldl1 And | 29 | false | true | 0 | 8 | 10 | 35 | 15 | 20 | null | null |
yupferris/write-you-a-haskell | chapter7/poly/src/Main.hs | mit | -------------------------------------------------------------------------------
-- Toplevel
-------------------------------------------------------------------------------
main :: IO ()
main = do
args <- getArgs
case args of
[] -> shell (return ())
[fname] -> shell (load [fname])
["test", fname] -... | 404 | main :: IO ()
main = do
args <- getArgs
case args of
[] -> shell (return ())
[fname] -> shell (load [fname])
["test", fname] -> shell (load [fname] >> browse [] >> quit ())
_ -> putStrLn "invalid arguments" | 231 | main = do
args <- getArgs
case args of
[] -> shell (return ())
[fname] -> shell (load [fname])
["test", fname] -> shell (load [fname] >> browse [] >> quit ())
_ -> putStrLn "invalid arguments" | 217 | true | true | 0 | 16 | 69 | 130 | 63 | 67 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.