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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
juanbono/my-scheme | src/Parser.hs | bsd-3-clause | readBin '1' = 1 | 15 | readBin '1' = 1 | 15 | readBin '1' = 1 | 15 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
cirquit/UTFTConverter | src/Format/Converter.hs | mit | bmpToDynImg :: FilePath -> IO (Maybe DynamicImage)
bmpToDynImg fp = do
bs <- BS.readFile fp
case decodeBitmap bs of
Left err -> putStrLn ("Error happend while decoding the bmp: " ++ err) >> return Nothing
Right dynimg -> return $ Just dynimg | 257 | bmpToDynImg :: FilePath -> IO (Maybe DynamicImage)
bmpToDynImg fp = do
bs <- BS.readFile fp
case decodeBitmap bs of
Left err -> putStrLn ("Error happend while decoding the bmp: " ++ err) >> return Nothing
Right dynimg -> return $ Just dynimg | 257 | bmpToDynImg fp = do
bs <- BS.readFile fp
case decodeBitmap bs of
Left err -> putStrLn ("Error happend while decoding the bmp: " ++ err) >> return Nothing
Right dynimg -> return $ Just dynimg | 206 | false | true | 0 | 13 | 57 | 91 | 41 | 50 | null | null |
CulpaBS/wbBach | src/Futhark/Representation/Primitive.hs | bsd-3-clause | oneIsh (IntValue (Int64Value k)) = k == 1 | 41 | oneIsh (IntValue (Int64Value k)) = k == 1 | 41 | oneIsh (IntValue (Int64Value k)) = k == 1 | 41 | false | false | 0 | 8 | 7 | 26 | 12 | 14 | null | null |
brendanhay/gogol | gogol-bigquery/gen/Network/Google/BigQuery/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'RowAccessPolicyReference' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'raprPolicyId'
--
-- * 'raprDataSetId'
--
-- * 'raprProjectId'
--
-- * 'raprTableId'
rowAccessPolicyReference
:: RowAccessPolicyRefe... | 507 | rowAccessPolicyReference
:: RowAccessPolicyReference
rowAccessPolicyReference =
RowAccessPolicyReference'
{ _raprPolicyId = Nothing
, _raprDataSetId = Nothing
, _raprProjectId = Nothing
, _raprTableId = Nothing
} | 238 | rowAccessPolicyReference =
RowAccessPolicyReference'
{ _raprPolicyId = Nothing
, _raprDataSetId = Nothing
, _raprProjectId = Nothing
, _raprTableId = Nothing
} | 181 | true | true | 1 | 7 | 94 | 55 | 35 | 20 | null | null |
dterei/GhciSafe | src/GhciTags.hs | bsd-3-clause | showCTag :: TagInfo -> String
showCTag ti =
tagName ti ++ "\t" ++ tagFile ti ++ "\t" ++ tagCmd ++ ";\"\t" ++
tagKind ti : ( if tagExported ti then "" else "\tfile:" )
where
tagCmd =
case tagSrcInfo ti of
Nothing -> show $tagLine ti
Just (srcLine,_) -> "/^"++ foldr escapeSlashes [] src... | 506 | showCTag :: TagInfo -> String
showCTag ti =
tagName ti ++ "\t" ++ tagFile ti ++ "\t" ++ tagCmd ++ ";\"\t" ++
tagKind ti : ( if tagExported ti then "" else "\tfile:" )
where
tagCmd =
case tagSrcInfo ti of
Nothing -> show $tagLine ti
Just (srcLine,_) -> "/^"++ foldr escapeSlashes [] src... | 506 | showCTag ti =
tagName ti ++ "\t" ++ tagFile ti ++ "\t" ++ tagCmd ++ ";\"\t" ++
tagKind ti : ( if tagExported ti then "" else "\tfile:" )
where
tagCmd =
case tagSrcInfo ti of
Nothing -> show $tagLine ti
Just (srcLine,_) -> "/^"++ foldr escapeSlashes [] srcLine ++"$/"
where
... | 476 | false | true | 0 | 12 | 153 | 181 | 89 | 92 | null | null |
SkyA1ex/tetris | src/World.hs | bsd-3-clause | getNextFigure :: TetrisGame -> Figure
getNextFigure (nextFigures -> fs) = head fs | 81 | getNextFigure :: TetrisGame -> Figure
getNextFigure (nextFigures -> fs) = head fs | 81 | getNextFigure (nextFigures -> fs) = head fs | 43 | false | true | 0 | 7 | 11 | 28 | 14 | 14 | null | null |
prb/perpubplat | src/Blog/Widgets/StreamOfConsciousness/RssUtilities.hs | bsd-3-clause | dc_date :: TXL.QName
dc_date = TXL.QName "date" dc_uri $ Just "dc" | 67 | dc_date :: TXL.QName
dc_date = TXL.QName "date" dc_uri $ Just "dc" | 66 | dc_date = TXL.QName "date" dc_uri $ Just "dc" | 45 | false | true | 0 | 7 | 11 | 34 | 14 | 20 | null | null |
TOSPIO/yi | src/library/Yi/Mode/Haskell/Dollarify.hs | gpl-2.0 | dollarifyTop :: Tree TT -> [QueuedUpdate]
dollarifyTop p@(Paren t1 e t2)
| isNormalParen p = case stripComments e of
[Paren{}] -> [queueDelete t2, queueDelete t1]
e' -> dollarifyExpr e' | 209 | dollarifyTop :: Tree TT -> [QueuedUpdate]
dollarifyTop p@(Paren t1 e t2)
| isNormalParen p = case stripComments e of
[Paren{}] -> [queueDelete t2, queueDelete t1]
e' -> dollarifyExpr e' | 209 | dollarifyTop p@(Paren t1 e t2)
| isNormalParen p = case stripComments e of
[Paren{}] -> [queueDelete t2, queueDelete t1]
e' -> dollarifyExpr e' | 167 | false | true | 0 | 10 | 52 | 87 | 42 | 45 | null | null |
KommuSoft/dep-software | Dep.Ui.Utils.hs | gpl-3.0 | getCurrentHeight :: Widget a -- ^ The given Widget to determine its current height.
-> IO Int -- ^ The resulting height of the given Widget in rows.
getCurrentHeight = (<~) $ snd . currentSize | 196 | getCurrentHeight :: Widget a -- ^ The given Widget to determine its current height.
-> IO Int
getCurrentHeight = (<~) $ snd . currentSize | 141 | getCurrentHeight = (<~) $ snd . currentSize | 43 | true | true | 0 | 7 | 38 | 35 | 18 | 17 | null | null |
flofehrenbacher/music-project | EasyNotes/SongCollection.hs | gpl-3.0 | -- | list of all names of the current song collection
allSongs :: [String]
allSongs = map fst songCollection | 110 | allSongs :: [String]
allSongs = map fst songCollection | 56 | allSongs = map fst songCollection | 35 | true | true | 0 | 5 | 20 | 20 | 11 | 9 | null | null |
jwiegley/ghc-release | libraries/Cabal/cabal/Distribution/Simple/LocalBuildInfo.hs | gpl-3.0 | lookupComponent pkg (CExeName name) =
fmap CExe $ find ((name ==) . exeName) (executables pkg) | 98 | lookupComponent pkg (CExeName name) =
fmap CExe $ find ((name ==) . exeName) (executables pkg) | 98 | lookupComponent pkg (CExeName name) =
fmap CExe $ find ((name ==) . exeName) (executables pkg) | 98 | false | false | 0 | 9 | 18 | 46 | 23 | 23 | null | null |
tensorflow/haskell | tensorflow-ops/src/TensorFlow/Gradient.hs | apache-2.0 | opGrad "ZerosLike" _ _ _ = [Nothing] | 36 | opGrad "ZerosLike" _ _ _ = [Nothing] | 36 | opGrad "ZerosLike" _ _ _ = [Nothing] | 36 | false | false | 1 | 6 | 6 | 21 | 9 | 12 | null | null |
dpieroux/euler | 0104.hs | mit | predicate (i, n, m) = b == pandigital && a == pandigital
-- The order of the tests here is very important as computing a is slower than
-- computing b.
where
a = sort $ take 9 $ show n
b = sort $ show m | 212 | predicate (i, n, m) = b == pandigital && a == pandigital
-- The order of the tests here is very important as computing a is slower than
-- computing b.
where
a = sort $ take 9 $ show n
b = sort $ show m | 212 | predicate (i, n, m) = b == pandigital && a == pandigital
-- The order of the tests here is very important as computing a is slower than
-- computing b.
where
a = sort $ take 9 $ show n
b = sort $ show m | 212 | false | false | 2 | 7 | 56 | 73 | 34 | 39 | null | null |
adept/hledger | hledger-lib/Hledger/Reports/ReportTypes.hs | gpl-3.0 | -- | Get the full, canonical, name of a PeriodicReportRow tagged by a
-- DisplayName.
prrFullName :: PeriodicReportRow DisplayName a -> AccountName
prrFullName = displayFull . prrName | 183 | prrFullName :: PeriodicReportRow DisplayName a -> AccountName
prrFullName = displayFull . prrName | 97 | prrFullName = displayFull . prrName | 35 | true | true | 0 | 6 | 26 | 26 | 14 | 12 | null | null |
ctford/Idris-Elba-dev | src/IRTS/CodegenLLVM.hs | bsd-3-clause | cgDefaultAlt :: Name -> Name -> Maybe SExp -> Codegen (Maybe (Operand, Name, Env))
cgDefaultAlt exitName name exp = do
newBlock name
fname <- getFuncName
val <- cgExpr (fromMaybe (SError $ "Inexhaustive case failure in " ++ fname) exp)
env <- gets lexenv
block <- gets currentBlockName
case val of
Just v... | 481 | cgDefaultAlt :: Name -> Name -> Maybe SExp -> Codegen (Maybe (Operand, Name, Env))
cgDefaultAlt exitName name exp = do
newBlock name
fname <- getFuncName
val <- cgExpr (fromMaybe (SError $ "Inexhaustive case failure in " ++ fname) exp)
env <- gets lexenv
block <- gets currentBlockName
case val of
Just v... | 481 | cgDefaultAlt exitName name exp = do
newBlock name
fname <- getFuncName
val <- cgExpr (fromMaybe (SError $ "Inexhaustive case failure in " ++ fname) exp)
env <- gets lexenv
block <- gets currentBlockName
case val of
Just v ->
do terminate $ Br exitName []
return $ Just (v, block, env)
... | 398 | false | true | 0 | 14 | 131 | 186 | 86 | 100 | null | null |
nau/lasca-compiler | src/lib/Lasca/Codegen.hs | bsd-3-clause | createStruct args = C.Struct Nothing False args | 47 | createStruct args = C.Struct Nothing False args | 47 | createStruct args = C.Struct Nothing False args | 47 | false | false | 0 | 6 | 6 | 18 | 8 | 10 | null | null |
runjak/carbon-adf | Carbon/Website/Session.hs | gpl-3.0 | cookieActionKey = "actionKey" | 29 | cookieActionKey = "actionKey" | 29 | cookieActionKey = "actionKey" | 29 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
mcschroeder/ghc | compiler/prelude/PrelRules.hs | bsd-3-clause | primOpRules nm DoubleLeOp = mkFloatingRelOpRule nm (<=) | 55 | primOpRules nm DoubleLeOp = mkFloatingRelOpRule nm (<=) | 55 | primOpRules nm DoubleLeOp = mkFloatingRelOpRule nm (<=) | 55 | false | false | 0 | 5 | 6 | 18 | 9 | 9 | null | null |
GaloisInc/ivory-tower-stm32 | ivory-bsp-stm32/src/Ivory/BSP/STM32F427/GPIO/AF.hs | bsd-3-clause | gpio_af_eth = gpio_af11 | 28 | gpio_af_eth = gpio_af11 | 28 | gpio_af_eth = gpio_af11 | 28 | false | false | 1 | 5 | 7 | 10 | 3 | 7 | null | null |
cvb/hs-orgmode | Text/OrgMode/Elements/List.hs | bsd-3-clause | endOfList :: Stream Text Identity b => Indent -> Parsec Text s ()
endOfList i = try tryItem
<|> try checkIndent
<|> try tryBlanks
<|> eof
where
tryItem = do
(Item n _ _ _ _ _ ) <- itemHead i
case n <= i of
True -> return ()
False -> fail "n... | 505 | endOfList :: Stream Text Identity b => Indent -> Parsec Text s ()
endOfList i = try tryItem
<|> try checkIndent
<|> try tryBlanks
<|> eof
where
tryItem = do
(Item n _ _ _ _ _ ) <- itemHead i
case n <= i of
True -> return ()
False -> fail "n... | 505 | endOfList i = try tryItem
<|> try checkIndent
<|> try tryBlanks
<|> eof
where
tryItem = do
(Item n _ _ _ _ _ ) <- itemHead i
case n <= i of
True -> return ()
False -> fail "not eol"
tryBlanks = count 2 blankLine >> return ()
check... | 439 | false | true | 12 | 12 | 201 | 210 | 93 | 117 | null | null |
alphalambda/codeworld | codeworld-requirements/src/CodeWorld/Requirements/Checker/Eval.hs | apache-2.0 | success :: Result
success = Just [] | 35 | success :: Result
success = Just [] | 35 | success = Just [] | 17 | false | true | 0 | 6 | 6 | 16 | 8 | 8 | null | null |
hesselink/regex-crossword | src/Crossword/Parser.hs | bsd-3-clause | backRef = BackRef . read . pure <$ char '\\' <*> digit | 54 | backRef = BackRef . read . pure <$ char '\\' <*> digit | 54 | backRef = BackRef . read . pure <$ char '\\' <*> digit | 54 | false | false | 0 | 8 | 11 | 25 | 12 | 13 | null | null |
backofhan/HaskellExercises | CH18/src/Lib.hs | bsd-3-clause | -- Both ways are working. Using bind (>>=) or do syntax
-- meh (x:xs) f =
-- f x >>= \b ->
-- meh xs f >>= \bs ->
-- return (b:bs)
meh (x:xs) f = do
b <- f x
bs <- meh xs f
return (b:bs)
--6 | 207 | meh (x:xs) f = do
b <- f x
bs <- meh xs f
return (b:bs)
--6 | 70 | meh (x:xs) f = do
b <- f x
bs <- meh xs f
return (b:bs)
--6 | 70 | true | false | 0 | 9 | 65 | 59 | 30 | 29 | null | null |
sheyll/b9-vm-image-builder | src/lib/B9/DiskImages.hs | mit | getPartition NoPT = error "No partitions!" | 42 | getPartition NoPT = error "No partitions!" | 42 | getPartition NoPT = error "No partitions!" | 42 | false | false | 0 | 5 | 5 | 12 | 5 | 7 | null | null |
lunaris/hindent | benchmarks/BigDeclarations.hs | bsd-3-clause | listPrinters =
[(''[]
,\(typeVariable:_) _automaticPrinter ->
(let presentVar = varE (presentVarName typeVariable)
in lamE [varP (presentVarName typeVariable)]
[|(let typeString = "[" ++ fst $(presentVar) ++ "]"
in (typeString
,\xs ->
... | 773 | listPrinters =
[(''[]
,\(typeVariable:_) _automaticPrinter ->
(let presentVar = varE (presentVarName typeVariable)
in lamE [varP (presentVarName typeVariable)]
[|(let typeString = "[" ++ fst $(presentVar) ++ "]"
in (typeString
,\xs ->
... | 773 | listPrinters =
[(''[]
,\(typeVariable:_) _automaticPrinter ->
(let presentVar = varE (presentVarName typeVariable)
in lamE [varP (presentVarName typeVariable)]
[|(let typeString = "[" ++ fst $(presentVar) ++ "]"
in (typeString
,\xs ->
... | 773 | false | false | 1 | 16 | 388 | 80 | 41 | 39 | null | null |
ajnsit/wai-routes | src/Routes/Routes.hs | mit | -- On matching route, but no matching http method, skip to next application
-- This allows a later route to handle methods not implemented by the previous routes
app405 :: HandlerS sub master
app405 _master = runNext | 216 | app405 :: HandlerS sub master
app405 _master = runNext | 54 | app405 _master = runNext | 24 | true | true | 0 | 5 | 36 | 21 | 11 | 10 | null | null |
piyush-kurur/yesod | yesod-routes/Yesod/Routes/Parse.hs | mit | -- | A quasi-quoter to parse a string into a list of 'Resource's. Checks for
-- overlapping routes, failing if present; use 'parseRoutesNoCheck' to skip the
-- checking. See documentation site for details on syntax.
parseRoutes :: QuasiQuoter
parseRoutes = QuasiQuoter { quoteExp = x }
where
x s = do
let r... | 482 | parseRoutes :: QuasiQuoter
parseRoutes = QuasiQuoter { quoteExp = x }
where
x s = do
let res = resourcesFromString s
case findOverlapNames res of
[] -> lift res
z -> error $ "Overlapping routes: " ++ unlines (map show z) | 266 | parseRoutes = QuasiQuoter { quoteExp = x }
where
x s = do
let res = resourcesFromString s
case findOverlapNames res of
[] -> lift res
z -> error $ "Overlapping routes: " ++ unlines (map show z) | 239 | true | true | 1 | 14 | 121 | 95 | 45 | 50 | null | null |
input-output-hk/pos-haskell-prototype | chain/test/Test/Pos/Chain/Delegation/Example.hs | mit | exampleUndo :: DlgUndo
exampleUndo = DlgUndo
{ duPsks = staticProxySKHeavys
, duPrevEpochPosted = HS.singleton exampleStakeholderId
} | 139 | exampleUndo :: DlgUndo
exampleUndo = DlgUndo
{ duPsks = staticProxySKHeavys
, duPrevEpochPosted = HS.singleton exampleStakeholderId
} | 139 | exampleUndo = DlgUndo
{ duPsks = staticProxySKHeavys
, duPrevEpochPosted = HS.singleton exampleStakeholderId
} | 116 | false | true | 0 | 9 | 21 | 34 | 18 | 16 | null | null |
portnov/simple-stacked-vm | Language/SSVM/Interpreter.hs | lgpl-3.0 | runVM' :: VMState -> VM () -> IO ()
runVM' st forth = evalStateT forth st | 73 | runVM' :: VMState -> VM () -> IO ()
runVM' st forth = evalStateT forth st | 73 | runVM' st forth = evalStateT forth st | 37 | false | true | 0 | 9 | 15 | 43 | 19 | 24 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT41.hs | gpl-3.0 | exp x (S n) = x * exp x n | 25 | exp x (S n) = x * exp x n | 25 | exp x (S n) = x * exp x n | 25 | false | false | 0 | 7 | 9 | 27 | 12 | 15 | null | null |
ajjaic/iit-workshop | src/Addendum.hs | bsd-3-clause | mlist :: [Char]
mlist = L.intercalate "" $ replicate 5 "lambdarocks" | 68 | mlist :: [Char]
mlist = L.intercalate "" $ replicate 5 "lambdarocks" | 68 | mlist = L.intercalate "" $ replicate 5 "lambdarocks" | 52 | false | true | 0 | 7 | 10 | 28 | 14 | 14 | null | null |
keithodulaigh/Hets | Proofs/DGFlattening.hs | gpl-2.0 | flatRename :: DGRule
flatRename = mkFlatStr "renaming" | 54 | flatRename :: DGRule
flatRename = mkFlatStr "renaming" | 54 | flatRename = mkFlatStr "renaming" | 33 | false | true | 0 | 6 | 6 | 21 | 8 | 13 | null | null |
mhuesch/scheme_compiler | src/L5ToL4/Compile.hs | bsd-3-clause | --
--
new5X :: CFS L5.X
new5X = liftM prefix5X getIncXCount | 59 | new5X :: CFS L5.X
new5X = liftM prefix5X getIncXCount | 53 | new5X = liftM prefix5X getIncXCount | 35 | true | true | 0 | 6 | 10 | 23 | 12 | 11 | null | null |
MichaelXavier/vigilance | src/Utils/Vigilance/Web/Yesod.hs | bsd-2-clause | postPauseWatchR :: WatchName -> Handler Value
postPauseWatchR name = onWatchExists pauseWatchS name >> noContent | 112 | postPauseWatchR :: WatchName -> Handler Value
postPauseWatchR name = onWatchExists pauseWatchS name >> noContent | 112 | postPauseWatchR name = onWatchExists pauseWatchS name >> noContent | 66 | false | true | 0 | 6 | 13 | 30 | 14 | 16 | null | null |
oopsno/hrank | src/HackerRank/Utilities/Manager/Edit.hs | unlicense | editUnitTest :: FilePath -> IO ()
editUnitTest = editSource . (</> "UnitTest.hs") | 81 | editUnitTest :: FilePath -> IO ()
editUnitTest = editSource . (</> "UnitTest.hs") | 81 | editUnitTest = editSource . (</> "UnitTest.hs") | 47 | false | true | 0 | 7 | 11 | 28 | 15 | 13 | null | null |
teuffy/interactive-brokers | executable/Requests-Simple.hs | bsd-3-clause | main :: IO ()
main = do
handler <- streamHandler stdout DEBUG >>= \h -> return $
setFormatter h $ simpleLogFormatter "$time $loggername $prio: $msg"
updateGlobalLogger rootLoggerName (setLevel DEBUG . setHandlers [handler])
finally (runIB def requests) (threadDelay 1000000) | 283 | main :: IO ()
main = do
handler <- streamHandler stdout DEBUG >>= \h -> return $
setFormatter h $ simpleLogFormatter "$time $loggername $prio: $msg"
updateGlobalLogger rootLoggerName (setLevel DEBUG . setHandlers [handler])
finally (runIB def requests) (threadDelay 1000000) | 283 | main = do
handler <- streamHandler stdout DEBUG >>= \h -> return $
setFormatter h $ simpleLogFormatter "$time $loggername $prio: $msg"
updateGlobalLogger rootLoggerName (setLevel DEBUG . setHandlers [handler])
finally (runIB def requests) (threadDelay 1000000) | 269 | false | true | 0 | 13 | 46 | 103 | 46 | 57 | null | null |
hackern/network-hans | src/Network/Socket/Internal.hs | bsd-3-clause | listen :: Socket -> Int -> IO ()
listen sock _ =
do state <- takeMVar (sockState sock)
case state of
SockBoundTcp addr port ->
do nsock <- NS.listen (sockNStack sock) addr port
putMVar (sockState sock) (SockListening nsock)
_ ->
throwIO (userError "Listen called on unb... | 345 | listen :: Socket -> Int -> IO ()
listen sock _ =
do state <- takeMVar (sockState sock)
case state of
SockBoundTcp addr port ->
do nsock <- NS.listen (sockNStack sock) addr port
putMVar (sockState sock) (SockListening nsock)
_ ->
throwIO (userError "Listen called on unb... | 345 | listen sock _ =
do state <- takeMVar (sockState sock)
case state of
SockBoundTcp addr port ->
do nsock <- NS.listen (sockNStack sock) addr port
putMVar (sockState sock) (SockListening nsock)
_ ->
throwIO (userError "Listen called on unbound or non-TCP socket.") | 312 | false | true | 0 | 15 | 99 | 125 | 56 | 69 | null | null |
TomMD/ghc | compiler/basicTypes/VarEnv.hs | bsd-3-clause | elemVarEnvByKey = elemUFM_Directly | 35 | elemVarEnvByKey = elemUFM_Directly | 35 | elemVarEnvByKey = elemUFM_Directly | 35 | false | false | 1 | 5 | 3 | 10 | 3 | 7 | null | null |
beni55/ghcjs | src/Compiler/JMacro/QQ.hs | mit | l2s :: [JStat] -> JStat
l2s xs = BlockStat xs | 45 | l2s :: [JStat] -> JStat
l2s xs = BlockStat xs | 45 | l2s xs = BlockStat xs | 21 | false | true | 0 | 7 | 9 | 30 | 13 | 17 | null | null |
elieux/ghc | compiler/types/Type.hs | bsd-3-clause | splitTyConApp_maybe (TyConApp tc tys) = Just (tc, tys) | 54 | splitTyConApp_maybe (TyConApp tc tys) = Just (tc, tys) | 54 | splitTyConApp_maybe (TyConApp tc tys) = Just (tc, tys) | 54 | false | false | 0 | 7 | 7 | 26 | 13 | 13 | null | null |
gilith/opentheory | data/haskell/nth-prime/src/GenuineSieve.hs | mit | primes :: [Natural]
primes = 2 : advance 1 4 initial | 52 | primes :: [Natural]
primes = 2 : advance 1 4 initial | 52 | primes = 2 : advance 1 4 initial | 32 | false | true | 2 | 7 | 10 | 33 | 14 | 19 | null | null |
bergmark/clay | src/Clay/Color.hs | bsd-3-clause | darkgray = rgb 169 169 169 | 38 | darkgray = rgb 169 169 169 | 38 | darkgray = rgb 169 169 169 | 38 | false | false | 0 | 5 | 17 | 13 | 6 | 7 | null | null |
bergmark/hlint | data/Default.hs | bsd-3-clause | error = foldr1 (*) ==> product where note = RemovesError "on []" | 66 | error = foldr1 (*) ==> product where note = RemovesError "on []" | 66 | error = foldr1 (*) ==> product where note = RemovesError "on []" | 66 | false | false | 0 | 7 | 13 | 25 | 13 | 12 | null | null |
matterhorn-chat/mattermost-api-qc | src/Network/Mattermost/QuickCheck.hs | isc | genType :: Gen Type
genType = oneof [ return Ordinary
, return Direct
, return Private
, return Group
, Unknown <$> genText
] | 205 | genType :: Gen Type
genType = oneof [ return Ordinary
, return Direct
, return Private
, return Group
, Unknown <$> genText
] | 205 | genType = oneof [ return Ordinary
, return Direct
, return Private
, return Group
, Unknown <$> genText
] | 185 | false | true | 0 | 7 | 103 | 48 | 24 | 24 | null | null |
GaloisInc/halvm-ghc | compiler/typecheck/FamInst.hs | bsd-3-clause | -- | Check whether a new open type family equation can be added without
-- violating injectivity annotation supplied by the user. Returns True when
-- this is possible and False if adding this equation would violate injectivity
-- annotation.
checkForInjectivityConflicts :: FamInstEnvs -> FamInst -> TcM Bool
checkForIn... | 1,160 | checkForInjectivityConflicts :: FamInstEnvs -> FamInst -> TcM Bool
checkForInjectivityConflicts instEnvs famInst
| isTypeFamilyTyCon tycon
-- type family is injective in at least one argument
, Injective inj <- familyTyConInjectivityInfo tycon = do
{ let axiom = coAxiomSingleBranch fi_ax
confl... | 917 | checkForInjectivityConflicts instEnvs famInst
| isTypeFamilyTyCon tycon
-- type family is injective in at least one argument
, Injective inj <- familyTyConInjectivityInfo tycon = do
{ let axiom = coAxiomSingleBranch fi_ax
conflicts = lookupFamInstEnvInjectivityConflicts inj instEnvs famInst
... | 850 | true | true | 1 | 12 | 247 | 180 | 89 | 91 | null | null |
KommuSoft/dep-software | Dep.Algorithms.Cpu.hs | gpl-3.0 | insType Jmp = [T,F] | 24 | insType Jmp = [T,F] | 24 | insType Jmp = [T,F] | 24 | false | false | 0 | 5 | 8 | 15 | 8 | 7 | null | null |
syanidar/Sophy | src/Foundation/Bitwise.hs | bsd-3-clause | joint,disjoint :: (Bits a) => a -> a -> Bool
a `joint` b = (a.&.b) /= zeroBits | 78 | joint,disjoint :: (Bits a) => a -> a -> Bool
a `joint` b = (a.&.b) /= zeroBits | 78 | a `joint` b = (a.&.b) /= zeroBits | 33 | false | true | 2 | 7 | 16 | 57 | 28 | 29 | null | null |
joanna-/2048Haskell | src/Grid2048.hs | bsd-3-clause | removeBlankFields (x:xs) = x : removeBlankFields xs | 51 | removeBlankFields (x:xs) = x : removeBlankFields xs | 51 | removeBlankFields (x:xs) = x : removeBlankFields xs | 51 | false | false | 0 | 7 | 6 | 23 | 11 | 12 | null | null |
kustomzone/plush | src/Plush/Types.hs | apache-2.0 | expandPartsM :: (Functor m) => (Parts -> m [Parts]) -> Word -> m [Word]
expandPartsM mf (Word l p) = map (Word l) `fmap` mf p | 125 | expandPartsM :: (Functor m) => (Parts -> m [Parts]) -> Word -> m [Word]
expandPartsM mf (Word l p) = map (Word l) `fmap` mf p | 125 | expandPartsM mf (Word l p) = map (Word l) `fmap` mf p | 53 | false | true | 0 | 10 | 25 | 78 | 40 | 38 | null | null |
purebred-mua/purebred | test/TestUserAcceptance.hs | agpl-3.0 | testRepliesToMailSuccessfully :: PurebredTestCase
testRepliesToMailSuccessfully = purebredTmuxSession "replies to mail successfully" $
\step -> do
let subject = "Testmail with whitespace in the subject"
testdir <- view envConfigDir
startApplication
step "pick first mail"
sendKeys "Enter" (Substri... | 1,682 | testRepliesToMailSuccessfully :: PurebredTestCase
testRepliesToMailSuccessfully = purebredTmuxSession "replies to mail successfully" $
\step -> do
let subject = "Testmail with whitespace in the subject"
testdir <- view envConfigDir
startApplication
step "pick first mail"
sendKeys "Enter" (Substri... | 1,682 | testRepliesToMailSuccessfully = purebredTmuxSession "replies to mail successfully" $
\step -> do
let subject = "Testmail with whitespace in the subject"
testdir <- view envConfigDir
startApplication
step "pick first mail"
sendKeys "Enter" (Substring "This is a test mail for purebred") >>= put
... | 1,632 | false | true | 0 | 14 | 346 | 349 | 147 | 202 | null | null |
bitc/hs-watchman | tests/test.hs | mit | test_subscribe :: Assertion
test_subscribe = withWatchmanServer Nothing $ \sockFile -> do
withSystemTempDirectory "watchman_test" $ \tmpDir -> do
BC8.writeFile (tmpDir </> "foo.txt") "foo"
let watchDir = WFilePath (BC8.pack tmpDir)
_ <- Watchman.watch sockFile watchDir
Watchman.withC... | 1,203 | test_subscribe :: Assertion
test_subscribe = withWatchmanServer Nothing $ \sockFile -> do
withSystemTempDirectory "watchman_test" $ \tmpDir -> do
BC8.writeFile (tmpDir </> "foo.txt") "foo"
let watchDir = WFilePath (BC8.pack tmpDir)
_ <- Watchman.watch sockFile watchDir
Watchman.withC... | 1,203 | test_subscribe = withWatchmanServer Nothing $ \sockFile -> do
withSystemTempDirectory "watchman_test" $ \tmpDir -> do
BC8.writeFile (tmpDir </> "foo.txt") "foo"
let watchDir = WFilePath (BC8.pack tmpDir)
_ <- Watchman.watch sockFile watchDir
Watchman.withConnect sockFile $ \sock -> d... | 1,175 | false | true | 0 | 29 | 327 | 330 | 152 | 178 | null | null |
mitchellwrosen/Haskell-Pipes-Library | src/Pipes/Core.hs | bsd-3-clause | {-| Compose two unfolds, creating a new unfold
@
(f '/>/' g) x = f x '//>' g
@
('/>/') is the composition operator of the respond category.
-}
(/>/)
:: Monad m
=> (a -> Proxy x' x b' b m a')
-- ^
-> (b -> Proxy x' x c' c m b')
-- ^
-> (a -> Proxy x' x c' c m a')
-- ^
(fa />/ fb) a = fa... | 329 | (/>/)
:: Monad m
=> (a -> Proxy x' x b' b m a')
-- ^
-> (b -> Proxy x' x c' c m b')
-- ^
-> (a -> Proxy x' x c' c m a')
-- ^
(fa />/ fb) a = fa a //> fb | 180 | (/>/)
:: Monad m
=> (a -> Proxy x' x b' b m a')
-- ^
-> (b -> Proxy x' x c' c m b')
-- ^
-> (a -> Proxy x' x c' c m a')
-- ^
(fa />/ fb) a = fa a //> fb | 180 | true | false | 0 | 12 | 111 | 115 | 58 | 57 | null | null |
evancz/builder | src/Reporting/Task/Http.hs | bsd-3-clause | report :: Progress.Progress -> (Progress.Outcome -> Progress.Progress) -> Fetch a -> Fetch a
report =
Report | 110 | report :: Progress.Progress -> (Progress.Outcome -> Progress.Progress) -> Fetch a -> Fetch a
report =
Report | 110 | report =
Report | 17 | false | true | 0 | 10 | 17 | 48 | 22 | 26 | null | null |
mdsteele/fallback | src/Fallback/Test/Pathfind.hs | gpl-3.0 | pathfindFail :: Int -> String -> Test
pathfindFail limit terrain =
let strings = lines terrain
width = length (head strings)
height = length strings
arr = listArray ((0, 0), (width - 1, height - 1)) $ concat $
transpose strings
get (Point x y) = arr ! (x, y)
allPoints = range... | 770 | pathfindFail :: Int -> String -> Test
pathfindFail limit terrain =
let strings = lines terrain
width = length (head strings)
height = length strings
arr = listArray ((0, 0), (width - 1, height - 1)) $ concat $
transpose strings
get (Point x y) = arr ! (x, y)
allPoints = range... | 770 | pathfindFail limit terrain =
let strings = lines terrain
width = length (head strings)
height = length strings
arr = listArray ((0, 0), (width - 1, height - 1)) $ concat $
transpose strings
get (Point x y) = arr ! (x, y)
allPoints = range (Point 0 0, Point (width - 1) (height... | 732 | false | true | 0 | 14 | 234 | 319 | 165 | 154 | null | null |
MaxDaten/yage | src/Yage/Material.hs | mit | blackDummy :: MaterialPixel a => Image a
blackDummy = constColorPx (black :: Colour Double) | 91 | blackDummy :: MaterialPixel a => Image a
blackDummy = constColorPx (black :: Colour Double) | 91 | blackDummy = constColorPx (black :: Colour Double) | 50 | false | true | 0 | 7 | 13 | 33 | 16 | 17 | null | null |
a143753/AOJ | ITP1_9_B.hs | apache-2.0 | play :: [String] -> [String]
play ("-":_) = [] | 46 | play :: [String] -> [String]
play ("-":_) = [] | 46 | play ("-":_) = [] | 17 | false | true | 0 | 6 | 8 | 37 | 19 | 18 | null | null |
urbanslug/ghc | compiler/types/InstEnv.hs | bsd-3-clause | instanceCantMatch :: [Maybe Name] -> [Maybe Name] -> Bool
-- (instanceCantMatch tcs1 tcs2) returns True if tcs1 cannot
-- possibly be instantiated to actual, nor vice versa;
-- False is non-committal
instanceCantMatch (Just t : ts) (Just a : as) = t/=a || instanceCantMatch ts as | 279 | instanceCantMatch :: [Maybe Name] -> [Maybe Name] -> Bool
instanceCantMatch (Just t : ts) (Just a : as) = t/=a || instanceCantMatch ts as | 137 | instanceCantMatch (Just t : ts) (Just a : as) = t/=a || instanceCantMatch ts as | 79 | true | true | 0 | 8 | 45 | 72 | 37 | 35 | null | null |
ur-crypto/sec-lib | library/Examples.hs | mit | {-
hammingWeightEff :: Int -> [Literal] -> [Literal]
hammingWeightEff p n =
case (p>1) of
(True) -> let (leftHalf,rightHalf) = splitAt (quot p 2) n in
let (lenleft,subleft) = hammingWeight (quot p 2) leftHalf
(lenright,subright) = ham... | 1,139 | hammingWeight :: Int -> [Literal] -> [Literal]
hammingWeight p n =
case (p>1) of
(True) -> let (leftHalf,rightHalf) = splitAt (quot p 2) n in
let subleft = hammingWeight (quot p 2) leftHalf
subright = hammingWeight (quot p 2) rightHal... | 579 | hammingWeight p n =
case (p>1) of
(True) -> let (leftHalf,rightHalf) = splitAt (quot p 2) n in
let subleft = hammingWeight (quot p 2) leftHalf
subright = hammingWeight (quot p 2) rightHalf in
--a... | 532 | true | true | 1 | 19 | 508 | 189 | 96 | 93 | null | null |
robstewart57/ripl | src/Compiler.hs | bsd-3-clause | expsWithRenamedVars (R.Stencil1DSkel rhsIdent _ _ (R.Stencil1DFunC xLoc exp)) = [] | 82 | expsWithRenamedVars (R.Stencil1DSkel rhsIdent _ _ (R.Stencil1DFunC xLoc exp)) = [] | 82 | expsWithRenamedVars (R.Stencil1DSkel rhsIdent _ _ (R.Stencil1DFunC xLoc exp)) = [] | 82 | false | false | 0 | 10 | 9 | 35 | 17 | 18 | null | null |
mightymoose/liquidhaskell | src/Language/Haskell/Liquid/CoreToLogic.hs | bsd-3-clause | bops :: M.HashMap Symbol Bop
bops = M.fromList [ (numSymbol "+", Plus)
, (numSymbol "-", Minus)
, (numSymbol "*", Times)
, (numSymbol "/", Div)
, (numSymbol "%", Mod)
]
where
numSymbol :: String -> Symbol
numSymbol = s... | 343 | bops :: M.HashMap Symbol Bop
bops = M.fromList [ (numSymbol "+", Plus)
, (numSymbol "-", Minus)
, (numSymbol "*", Times)
, (numSymbol "/", Div)
, (numSymbol "%", Mod)
]
where
numSymbol :: String -> Symbol
numSymbol = s... | 343 | bops = M.fromList [ (numSymbol "+", Plus)
, (numSymbol "-", Minus)
, (numSymbol "*", Times)
, (numSymbol "/", Div)
, (numSymbol "%", Mod)
]
where
numSymbol :: String -> Symbol
numSymbol = symbol . (++) "GHC.Num." | 314 | false | true | 1 | 7 | 142 | 121 | 62 | 59 | null | null |
andorp/bead | snaplets/fay/src/DynamicContents.hs | bsd-3-clause | andM :: [Fay Bool] -> Fay Bool
andM fs = and <$> (sequence fs) | 62 | andM :: [Fay Bool] -> Fay Bool
andM fs = and <$> (sequence fs) | 62 | andM fs = and <$> (sequence fs) | 31 | false | true | 0 | 7 | 13 | 37 | 18 | 19 | null | null |
beni55/text | Data/Text/Lazy/Encoding.hs | bsd-2-clause | -- | Decode text from little endian UTF-16 encoding.
decodeUtf16LEWith :: OnDecodeError -> B.ByteString -> Text
decodeUtf16LEWith onErr bs = F.unstream (E.streamUtf16LE onErr bs) | 178 | decodeUtf16LEWith :: OnDecodeError -> B.ByteString -> Text
decodeUtf16LEWith onErr bs = F.unstream (E.streamUtf16LE onErr bs) | 125 | decodeUtf16LEWith onErr bs = F.unstream (E.streamUtf16LE onErr bs) | 66 | true | true | 0 | 8 | 23 | 42 | 21 | 21 | null | null |
maoe/htmlcat | HtmlCat/Snap.hs | bsd-3-clause | appStream :: Chan ServerEvent -> Snap ()
appStream = eventSourceApp | 67 | appStream :: Chan ServerEvent -> Snap ()
appStream = eventSourceApp | 67 | appStream = eventSourceApp | 26 | false | true | 0 | 8 | 9 | 29 | 12 | 17 | null | null |
nilthehuman/cis194 | Homework8.hs | unlicense | -- Preliminaries
glCons :: Employee -> GuestList -> GuestList
glCons e (GL es f) = GL (e:es) (f + empFun e) | 108 | glCons :: Employee -> GuestList -> GuestList
glCons e (GL es f) = GL (e:es) (f + empFun e) | 90 | glCons e (GL es f) = GL (e:es) (f + empFun e) | 45 | true | true | 0 | 10 | 21 | 60 | 29 | 31 | null | null |
csabahruska/quake3 | mapviewer/Main.hs | bsd-3-clause | driveNetwork :: (p -> IO (IO a)) -> IO (Maybe p) -> IO ()
driveNetwork network driver = do
dt <- driver
case dt of
Just dt -> do
join $ network dt
driveNetwork network driver
Nothing -> return ()
-- OpenGL/GLFW boilerplate | 271 | driveNetwork :: (p -> IO (IO a)) -> IO (Maybe p) -> IO ()
driveNetwork network driver = do
dt <- driver
case dt of
Just dt -> do
join $ network dt
driveNetwork network driver
Nothing -> return ()
-- OpenGL/GLFW boilerplate | 271 | driveNetwork network driver = do
dt <- driver
case dt of
Just dt -> do
join $ network dt
driveNetwork network driver
Nothing -> return ()
-- OpenGL/GLFW boilerplate | 213 | false | true | 0 | 13 | 91 | 107 | 49 | 58 | null | null |
adarqui/ghcjs-jquery | JavaScript/JQuery.hs | mit | focusout :: (Event -> IO ()) -> HandlerSettings -> JQuery -> IO (IO ())
focusout a = on a "focusout" | 100 | focusout :: (Event -> IO ()) -> HandlerSettings -> JQuery -> IO (IO ())
focusout a = on a "focusout" | 100 | focusout a = on a "focusout" | 28 | false | true | 0 | 11 | 19 | 54 | 26 | 28 | null | null |
Rathcke/uni | ap/advanced programming/exam/src/subs/SimpleParse.hs | gpl-3.0 | sepBy1 :: Parser a -> Parser b -> Parser [a]
p `sepBy1` sep = do {a <- p; as <- many (do {sep; p}); return (a:as)} | 125 | sepBy1 :: Parser a -> Parser b -> Parser [a]
p `sepBy1` sep = do {a <- p; as <- many (do {sep; p}); return (a:as)} | 125 | p `sepBy1` sep = do {a <- p; as <- many (do {sep; p}); return (a:as)} | 71 | false | true | 0 | 12 | 36 | 89 | 44 | 45 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | m1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "M1") | 57 | m1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "M1") | 57 | m1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "M1") | 57 | false | false | 0 | 7 | 8 | 17 | 8 | 9 | null | null |
amccausl/Swish | Swish/HaskellRDF/VarBindingTest.hs | lgpl-2.1 | vb3str = "[(1,\"a\"),(2,\"b\"),(3,\"c\"),(4,\"d\"),(5,\"e\")]" | 62 | vb3str = "[(1,\"a\"),(2,\"b\"),(3,\"c\"),(4,\"d\"),(5,\"e\")]" | 62 | vb3str = "[(1,\"a\"),(2,\"b\"),(3,\"c\"),(4,\"d\"),(5,\"e\")]" | 62 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
leshchevds/ganeti | src/Ganeti/MaintD/HandleIncidents.hs | bsd-2-clause | handleEvacuation :: L.Client -- ^ Luxi client to use
-> IORef MemoryState -- ^ memory state of the daemon
-> (Group.List, Node.List, Instance.List) -- ^ cluster
-> Idx -- ^ index of the node to evacuate
-> Bool -- ^ whether to try migrations
... | 3,606 | handleEvacuation :: L.Client -- ^ Luxi client to use
-> IORef MemoryState -- ^ memory state of the daemon
-> (Group.List, Node.List, Instance.List) -- ^ cluster
-> Idx -- ^ index of the node to evacuate
-> Bool -- ^ whether to try migrations
... | 3,579 | handleEvacuation client memst (gl, nl, il) ndx migrate freenodes incident = do
let node = Container.find ndx nl
name = Node.name node
fNdNames = map (Node.name . flip Container.find nl) $ Set.elems freenodes
evacOpts = defaultOptions { algEvacMode = True
, algIgnoreSo... | 3,104 | true | true | 0 | 24 | 1,501 | 898 | 433 | 465 | null | null |
ddssff/pandoc | src/Text/Pandoc/Writers/LaTeX.hs | gpl-2.0 | toColDescriptor :: Alignment -> String
toColDescriptor align =
case align of
AlignLeft -> "l"
AlignRight -> "r"
AlignCenter -> "c"
AlignDefault -> "l" | 194 | toColDescriptor :: Alignment -> String
toColDescriptor align =
case align of
AlignLeft -> "l"
AlignRight -> "r"
AlignCenter -> "c"
AlignDefault -> "l" | 194 | toColDescriptor align =
case align of
AlignLeft -> "l"
AlignRight -> "r"
AlignCenter -> "c"
AlignDefault -> "l" | 155 | false | true | 0 | 7 | 66 | 46 | 23 | 23 | null | null |
mre/the-coding-interview | problems/flatten-array/flatten-array.hs | mit | flatten (List y) = concatMap flatten y | 38 | flatten (List y) = concatMap flatten y | 38 | flatten (List y) = concatMap flatten y | 38 | false | false | 0 | 6 | 6 | 21 | 9 | 12 | null | null |
danr/hipspec | testsuite/zeno/Properties.hs | gpl-3.0 | prop_50 xs
= (butlast xs =:= take (len xs - S Z) xs) | 54 | prop_50 xs
= (butlast xs =:= take (len xs - S Z) xs) | 54 | prop_50 xs
= (butlast xs =:= take (len xs - S Z) xs) | 54 | false | false | 0 | 10 | 14 | 37 | 17 | 20 | null | null |
GaloisInc/pads-haskell | Language/Pads/Generic.hs | bsd-3-clause | parseBS :: Pads rep md => B.ByteString -> ((rep, md), B.ByteString)
parseBS cs = parseByteStringInput parsePP cs | 115 | parseBS :: Pads rep md => B.ByteString -> ((rep, md), B.ByteString)
parseBS cs = parseByteStringInput parsePP cs | 114 | parseBS cs = parseByteStringInput parsePP cs | 44 | false | true | 0 | 8 | 19 | 48 | 25 | 23 | null | null |
ktvoelker/brick | src/Brick/Widgets/List.hs | bsd-3-clause | listAttr :: AttrName
listAttr = "list" | 38 | listAttr :: AttrName
listAttr = "list" | 38 | listAttr = "list" | 17 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
k0001/gtk2hs | tools/c2hs/gen/GenBind.hs | gpl-3.0 | withFloatConvIde = noPosIdent "withFloatConv" | 46 | withFloatConvIde = noPosIdent "withFloatConv" | 46 | withFloatConvIde = noPosIdent "withFloatConv" | 46 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
ombocomp/MList | Control/Monad/Data/List/Unsafe.hs | apache-2.0 | initML :: Applicative m => MList m a -> m (MList m a)
initML = maybeInitML id (error "initML: empty MList!") | 108 | initML :: Applicative m => MList m a -> m (MList m a)
initML = maybeInitML id (error "initML: empty MList!") | 108 | initML = maybeInitML id (error "initML: empty MList!") | 54 | false | true | 0 | 10 | 20 | 56 | 24 | 32 | null | null |
aurapm/aura | aura/lib/Aura/Languages/Fields.hs | gpl-3.0 | votes :: Language -> Text
votes = \case
Japanese -> "投票数"
Polish -> "Głosy"
Croatian -> "Glasovi"
Swedish -> "Röster"
German -> "Stimmen"
Spanish -> "Votos"
Portuguese -> "Votos"
French -> "Votes"
Russian -> "Голоса"
Italian -> "Voti"
Serbian ->... | 468 | votes :: Language -> Text
votes = \case
Japanese -> "投票数"
Polish -> "Głosy"
Croatian -> "Glasovi"
Swedish -> "Röster"
German -> "Stimmen"
Spanish -> "Votos"
Portuguese -> "Votos"
French -> "Votes"
Russian -> "Голоса"
Italian -> "Voti"
Serbian ->... | 468 | votes = \case
Japanese -> "投票数"
Polish -> "Głosy"
Croatian -> "Glasovi"
Swedish -> "Röster"
German -> "Stimmen"
Spanish -> "Votos"
Portuguese -> "Votos"
French -> "Votes"
Russian -> "Голоса"
Italian -> "Voti"
Serbian -> "Гласови"
Norwegian ... | 442 | false | true | 16 | 5 | 167 | 144 | 57 | 87 | null | null |
haskoin/haskoin | src/Haskoin/Address/CashAddr.hs | unlicense | -- | Convert base of 'ByteString' from eight bits per byte to five bits per
-- byte, adding padding as necessary.
toBase32 :: ByteString -> ByteString
toBase32 =
B.pack .
map fromIntegral . fst . convertBits True 8 5 . map fromIntegral . B.unpack | 254 | toBase32 :: ByteString -> ByteString
toBase32 =
B.pack .
map fromIntegral . fst . convertBits True 8 5 . map fromIntegral . B.unpack | 140 | toBase32 =
B.pack .
map fromIntegral . fst . convertBits True 8 5 . map fromIntegral . B.unpack | 103 | true | true | 0 | 8 | 51 | 54 | 27 | 27 | null | null |
xu-hao/QueryArrow | QueryArrow-db-inmemory/src/QueryArrow/Binding/Binding.hs | bsd-3-clause | getBindingByPredName :: PredName -> [AbstractBinding] -> AbstractBinding
getBindingByPredName predname = fromMaybe (error "cannot find predicate") . find (\ab -> predName (bindingPred ab) == predname) | 200 | getBindingByPredName :: PredName -> [AbstractBinding] -> AbstractBinding
getBindingByPredName predname = fromMaybe (error "cannot find predicate") . find (\ab -> predName (bindingPred ab) == predname) | 200 | getBindingByPredName predname = fromMaybe (error "cannot find predicate") . find (\ab -> predName (bindingPred ab) == predname) | 127 | false | true | 0 | 12 | 23 | 67 | 32 | 35 | null | null |
gtk2hs/gi-gtk-hs | src/Data/GI/Gtk/ComboBox.hs | lgpl-2.1 | comboBoxSetModelText :: (MonadIO m, IsComboBox self) => self -> m (SeqStore Text)
comboBoxSetModelText combo = liftIO $ do
layout <- unsafeCastTo CellLayout combo
cellLayoutClear layout
store <- seqStoreNew ([] :: [Text])
comboBoxSetModel combo (Just store)
let colId = makeColumnIdString 0
customStoreSetCol... | 657 | comboBoxSetModelText :: (MonadIO m, IsComboBox self) => self -> m (SeqStore Text)
comboBoxSetModelText combo = liftIO $ do
layout <- unsafeCastTo CellLayout combo
cellLayoutClear layout
store <- seqStoreNew ([] :: [Text])
comboBoxSetModel combo (Just store)
let colId = makeColumnIdString 0
customStoreSetCol... | 657 | comboBoxSetModelText combo = liftIO $ do
layout <- unsafeCastTo CellLayout combo
cellLayoutClear layout
store <- seqStoreNew ([] :: [Text])
comboBoxSetModel combo (Just store)
let colId = makeColumnIdString 0
customStoreSetColumn store colId id
comboBoxSetEntryTextColumn combo 0
ren <- cellRendererTextN... | 575 | false | true | 2 | 11 | 102 | 194 | 86 | 108 | null | null |
jameseggers/distSysAssignment3 | src/Main.hs | bsd-3-clause | preformSockAction :: [Socket] -> Message -> [Socket]
preformSockAction sockets message =
case (socketAction message) of
"ADD" -> (selectedSocket message) : sockets
"REMOVE" -> removeSockFromList sockets [] (selectedSocket message) | 240 | preformSockAction :: [Socket] -> Message -> [Socket]
preformSockAction sockets message =
case (socketAction message) of
"ADD" -> (selectedSocket message) : sockets
"REMOVE" -> removeSockFromList sockets [] (selectedSocket message) | 240 | preformSockAction sockets message =
case (socketAction message) of
"ADD" -> (selectedSocket message) : sockets
"REMOVE" -> removeSockFromList sockets [] (selectedSocket message) | 187 | false | true | 0 | 10 | 37 | 77 | 39 | 38 | null | null |
ericmoritz/deps | src/Downloaders/Git.hs | bsd-3-clause | git_checkout dir (Just ref) = do
run checkoutCmd
where
checkoutCmd = ["cd", dir, "&&", "git", "checkout", ref] | 120 | git_checkout dir (Just ref) = do
run checkoutCmd
where
checkoutCmd = ["cd", dir, "&&", "git", "checkout", ref] | 120 | git_checkout dir (Just ref) = do
run checkoutCmd
where
checkoutCmd = ["cd", dir, "&&", "git", "checkout", ref] | 120 | false | false | 1 | 7 | 26 | 54 | 26 | 28 | null | null |
TimRichter/Idris-dev | src/Idris/Directives.hs | bsd-3-clause | directiveAction (DErrorHandlers fn nfc arg afc ns) =
do fn' <- disambiguate fn
ns' <- mapM (\(n, fc) -> do n' <- disambiguate n
return (n', fc)) ns
addFunctionErrorHandlers fn' arg (map fst ns')
mapM_ (addIBC .
IBCFunctionErrorHandler fn' arg . fst) ns'
se... | 499 | directiveAction (DErrorHandlers fn nfc arg afc ns) =
do fn' <- disambiguate fn
ns' <- mapM (\(n, fc) -> do n' <- disambiguate n
return (n', fc)) ns
addFunctionErrorHandlers fn' arg (map fst ns')
mapM_ (addIBC .
IBCFunctionErrorHandler fn' arg . fst) ns'
se... | 499 | directiveAction (DErrorHandlers fn nfc arg afc ns) =
do fn' <- disambiguate fn
ns' <- mapM (\(n, fc) -> do n' <- disambiguate n
return (n', fc)) ns
addFunctionErrorHandlers fn' arg (map fst ns')
mapM_ (addIBC .
IBCFunctionErrorHandler fn' arg . fst) ns'
se... | 499 | false | false | 0 | 14 | 152 | 201 | 100 | 101 | null | null |
brendanhay/gogol | gogol-androidmanagement/gen/Network/Google/AndroidManagement/Types/Product.hs | mpl-2.0 | -- | Rules declaring which mitigating actions to take when a device is not
-- compliant with its policy. When the conditions for multiple rules are
-- satisfied, all of the mitigating actions for the rules are taken. There
-- is a maximum limit of 100 rules. Use policy enforcement rules instead.
pComplianceRules :: Len... | 465 | pComplianceRules :: Lens' Policy [ComplianceRule]
pComplianceRules
= lens _pComplianceRules
(\ s a -> s{_pComplianceRules = a})
. _Default
. _Coerce | 168 | pComplianceRules
= lens _pComplianceRules
(\ s a -> s{_pComplianceRules = a})
. _Default
. _Coerce | 118 | true | true | 3 | 8 | 91 | 61 | 31 | 30 | null | null |
ardumont/category-theory-lab | app/Main.hs | gpl-3.0 | t ESS = E | 9 | t ESS = E | 9 | t ESS = E | 9 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
gspindles/mj-score-eval | src/Game/Mahjong/Generate.hs | mit | getTerminal :: Int -> Tile
getTerminal = helper terminals | 57 | getTerminal :: Int -> Tile
getTerminal = helper terminals | 57 | getTerminal = helper terminals | 30 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
ghc-android/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | prefixDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Prefix") | 66 | prefixDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Prefix") | 66 | prefixDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Prefix") | 66 | false | false | 0 | 7 | 9 | 17 | 8 | 9 | null | null |
johntyree/HsQML | src/Graphics/QML/Internal/Marshal.hs | bsd-3-clause | unimplFromCVal :: MFromCValFunc t
unimplFromCVal _ = error "Type does not support mFromCVal." | 93 | unimplFromCVal :: MFromCValFunc t
unimplFromCVal _ = error "Type does not support mFromCVal." | 93 | unimplFromCVal _ = error "Type does not support mFromCVal." | 59 | false | true | 0 | 5 | 12 | 20 | 9 | 11 | null | null |
ucsd-progsys/csv-table | examples/test1.hs | mit | makeEmail b r = E {
uid = "/tmp/email." ++ lookupCol (C "PID") r
, to = lookupCol (C "EMAIL") r
, cc = []
, sender = "santa.claus@gmail.com"
, subject = "ho ho ho"
, text = makeText r
, send = b
} | 249 | makeEmail b r = E {
uid = "/tmp/email." ++ lookupCol (C "PID") r
, to = lookupCol (C "EMAIL") r
, cc = []
, sender = "santa.claus@gmail.com"
, subject = "ho ho ho"
, text = makeText r
, send = b
} | 249 | makeEmail b r = E {
uid = "/tmp/email." ++ lookupCol (C "PID") r
, to = lookupCol (C "EMAIL") r
, cc = []
, sender = "santa.claus@gmail.com"
, subject = "ho ho ho"
, text = makeText r
, send = b
} | 249 | false | false | 0 | 10 | 97 | 86 | 48 | 38 | null | null |
nicklawls/transformers | app/Main.hs | bsd-3-clause | eval1 env (Var name) = return . fromJust $ M.lookup name env | 60 | eval1 env (Var name) = return . fromJust $ M.lookup name env | 60 | eval1 env (Var name) = return . fromJust $ M.lookup name env | 60 | false | false | 0 | 7 | 11 | 34 | 15 | 19 | null | null |
mgrabmueller/harpy | Harpy/X86CodeGen.hs | bsd-3-clause | x86_branch8 :: Int -> Word8 -> Bool -> CodeGen e s ()
x86_branch8 cond imm is_signed =
do if is_signed
then emit8 (x86_cc_signed_map !! cond)
else emit8 (x86_cc_unsigned_map !! cond)
x86_imm_emit8 imm | 250 | x86_branch8 :: Int -> Word8 -> Bool -> CodeGen e s ()
x86_branch8 cond imm is_signed =
do if is_signed
then emit8 (x86_cc_signed_map !! cond)
else emit8 (x86_cc_unsigned_map !! cond)
x86_imm_emit8 imm | 250 | x86_branch8 cond imm is_signed =
do if is_signed
then emit8 (x86_cc_signed_map !! cond)
else emit8 (x86_cc_unsigned_map !! cond)
x86_imm_emit8 imm | 196 | false | true | 0 | 10 | 81 | 76 | 37 | 39 | null | null |
ulricha/algebra-sql | src/Database/Algebra/SQL/Render/Query.hs | bsd-3-clause | renderFunCall :: String -> Doc -> Doc
renderFunCall funName funArg = kw funName <> parens funArg | 96 | renderFunCall :: String -> Doc -> Doc
renderFunCall funName funArg = kw funName <> parens funArg | 96 | renderFunCall funName funArg = kw funName <> parens funArg | 58 | false | true | 0 | 6 | 15 | 34 | 16 | 18 | null | null |
massysett/penny | penny/lib/Penny/Copper/Grammar.hs | bsd-3-clause | -- Digit from 0 through 8
d0'8 = union "D0'8"
[ zero, one, two, three, four, five, six, seven, eight ] | 104 | d0'8 = union "D0'8"
[ zero, one, two, three, four, five, six, seven, eight ] | 78 | d0'8 = union "D0'8"
[ zero, one, two, three, four, five, six, seven, eight ] | 78 | true | false | 0 | 5 | 22 | 40 | 24 | 16 | null | null |
jstolarek/ghc | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprInstr (MOV size src dst)
= pprSizeOpOp (sLit "mov") size src dst | 69 | pprInstr (MOV size src dst)
= pprSizeOpOp (sLit "mov") size src dst | 69 | pprInstr (MOV size src dst)
= pprSizeOpOp (sLit "mov") size src dst | 69 | false | false | 0 | 7 | 13 | 34 | 16 | 18 | null | null |
zdravkoandonov/functional-fmi | Haskell/infinitelists.hs | mit | points (x, y) = (x, y) : points (x+1, y+1) | 42 | points (x, y) = (x, y) : points (x+1, y+1) | 42 | points (x, y) = (x, y) : points (x+1, y+1) | 42 | false | false | 2 | 7 | 9 | 45 | 23 | 22 | null | null |
DaMSL/K3 | src/Language/K3/Codegen/KTrace/KTraceDB.hs | apache-2.0 | extractProgramState :: K3 Declaration -> Either String SchemaState
extractProgramState prog = do
(progSt, _) <- foldProgram schematize fId fId Nothing emptySchemaState prog
return progSt
where fId a b = return (a,b) | 221 | extractProgramState :: K3 Declaration -> Either String SchemaState
extractProgramState prog = do
(progSt, _) <- foldProgram schematize fId fId Nothing emptySchemaState prog
return progSt
where fId a b = return (a,b) | 221 | extractProgramState prog = do
(progSt, _) <- foldProgram schematize fId fId Nothing emptySchemaState prog
return progSt
where fId a b = return (a,b) | 154 | false | true | 0 | 8 | 36 | 79 | 38 | 41 | null | null |
cliffano/swaggy-jenkins | clients/haskell-http-client/generated/lib/SwaggyJenkins/ModelLens.hs | mit | -- * Queue
-- | 'queueClass' Lens
queueClassL :: Lens_' Queue (Maybe Text)
queueClassL f Queue{..} = (\queueClass -> Queue { queueClass, ..} ) <$> f queueClass | 160 | queueClassL :: Lens_' Queue (Maybe Text)
queueClassL f Queue{..} = (\queueClass -> Queue { queueClass, ..} ) <$> f queueClass | 125 | queueClassL f Queue{..} = (\queueClass -> Queue { queueClass, ..} ) <$> f queueClass | 84 | true | true | 1 | 8 | 27 | 61 | 31 | 30 | null | null |
sgillespie/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | datatypeName_RDR = varQual_RDR gHC_GENERICS (fsLit "datatypeName") | 67 | datatypeName_RDR = varQual_RDR gHC_GENERICS (fsLit "datatypeName") | 67 | datatypeName_RDR = varQual_RDR gHC_GENERICS (fsLit "datatypeName") | 67 | false | false | 0 | 7 | 6 | 17 | 8 | 9 | null | null |
pparkkin/eta | compiler/ETA/CodeGen/Expr.hs | bsd-3-clause | cgExpr (StgConApp con args) = traceCg (str "StgConApp" <+> ppr con <+> ppr args) >>
cgConApp con args | 131 | cgExpr (StgConApp con args) = traceCg (str "StgConApp" <+> ppr con <+> ppr args) >>
cgConApp con args | 131 | cgExpr (StgConApp con args) = traceCg (str "StgConApp" <+> ppr con <+> ppr args) >>
cgConApp con args | 131 | false | false | 0 | 10 | 47 | 49 | 22 | 27 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.