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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jparyani/capnproto-boostpython | compiler/src/Grammar.hs | bsd-2-clause | declarationName (StructDecl n _ _ _ _) = Just n | 51 | declarationName (StructDecl n _ _ _ _) = Just n | 51 | declarationName (StructDecl n _ _ _ _) = Just n | 51 | false | false | 0 | 7 | 13 | 26 | 12 | 14 | null | null |
lymar/hastache | Text/Hastache.hs | bsd-3-clause | -- | Render Hastache template from 'Text'
hastacheStrBuilder :: (MonadIO m) =>
MuConfig m -- ^ Configuration
-> Text -- ^ Template
-> MuContext m -- ^ Context
-> m TLB.Builder
hastacheStrBuilder conf str context = do
rf <- newIORef mempty ~> liftIO
runReaderT (processB... | 431 | hastacheStrBuilder :: (MonadIO m) =>
MuConfig m -- ^ Configuration
-> Text -- ^ Template
-> MuContext m -- ^ Context
-> m TLB.Builder
hastacheStrBuilder conf str context = do
rf <- newIORef mempty ~> liftIO
runReaderT (processBlock str [context] defOTag defCTag conf) r... | 389 | hastacheStrBuilder conf str context = do
rf <- newIORef mempty ~> liftIO
runReaderT (processBlock str [context] defOTag defCTag conf) rf
readIORef rf ~> liftIO
-- | Render Hastache template from file | 212 | true | true | 0 | 11 | 117 | 105 | 51 | 54 | null | null |
brendanhay/gogol | gogol-resourcemanager/gen/Network/Google/ResourceManager/Types/Product.hs | mpl-2.0 | -- | Output only. Timestamp when the Organization was last modified.
orgUpdateTime :: Lens' Organization (Maybe UTCTime)
orgUpdateTime
= lens _orgUpdateTime
(\ s a -> s{_orgUpdateTime = a})
. mapping _DateTime | 223 | orgUpdateTime :: Lens' Organization (Maybe UTCTime)
orgUpdateTime
= lens _orgUpdateTime
(\ s a -> s{_orgUpdateTime = a})
. mapping _DateTime | 154 | orgUpdateTime
= lens _orgUpdateTime
(\ s a -> s{_orgUpdateTime = a})
. mapping _DateTime | 102 | true | true | 0 | 10 | 44 | 55 | 28 | 27 | null | null |
ezyang/ghc | compiler/coreSyn/TrieMap.hs | bsd-3-clause | xtVar :: CmEnv -> Var -> XT a -> VarMap a -> VarMap a
xtVar env v f m
| Just bv <- lookupCME env v = m { vm_bvar = vm_bvar m |> alterTM bv f }
| otherwise = m { vm_fvar = vm_fvar m |> xtDFreeVar v f } | 221 | xtVar :: CmEnv -> Var -> XT a -> VarMap a -> VarMap a
xtVar env v f m
| Just bv <- lookupCME env v = m { vm_bvar = vm_bvar m |> alterTM bv f }
| otherwise = m { vm_fvar = vm_fvar m |> xtDFreeVar v f } | 221 | xtVar env v f m
| Just bv <- lookupCME env v = m { vm_bvar = vm_bvar m |> alterTM bv f }
| otherwise = m { vm_fvar = vm_fvar m |> xtDFreeVar v f } | 167 | false | true | 1 | 9 | 72 | 111 | 52 | 59 | null | null |
GaloisInc/sk-dev-platform | user/sklite/src/Sklite/Boot.hs | bsd-3-clause | writeHostBootScript :: FilePath -> Layout -> IO ()
writeHostBootScript scriptPath layout =
writeFile scriptPath $ bootScript False layout | 141 | writeHostBootScript :: FilePath -> Layout -> IO ()
writeHostBootScript scriptPath layout =
writeFile scriptPath $ bootScript False layout | 141 | writeHostBootScript scriptPath layout =
writeFile scriptPath $ bootScript False layout | 90 | false | true | 0 | 8 | 21 | 41 | 19 | 22 | null | null |
changlinli/tictactoe-haskell | Tictactoe.hs | gpl-3.0 | isValidMove :: (Int, Int) -> GameBoard -> Bool
isValidMove (a, b) board = if a < boardSize &&
b < boardSize &&
0 <= a &&
0 <= b &&
(board !! b) !! a == Nothing
then True
else Fal... | 322 | isValidMove :: (Int, Int) -> GameBoard -> Bool
isValidMove (a, b) board = if a < boardSize &&
b < boardSize &&
0 <= a &&
0 <= b &&
(board !! b) !! a == Nothing
then True
else Fal... | 322 | isValidMove (a, b) board = if a < boardSize &&
b < boardSize &&
0 <= a &&
0 <= b &&
(board !! b) !! a == Nothing
then True
else False | 275 | false | true | 0 | 15 | 182 | 91 | 49 | 42 | null | null |
AlexanderAA/haskell-contract-valuation | DSL.hs | mit | convertTo m t c0 (One (Amt amt c))
| (c0 == c) = One $ Amt amt c0 -- No need to convert anything
| otherwise = One $ Amt (amt *. currentER) c0
where
-- Exchange Rates
observableER = (exchangeRate m) c c0
currentER = realToFrac $ getValue observableER t | 293 | convertTo m t c0 (One (Amt amt c))
| (c0 == c) = One $ Amt amt c0 -- No need to convert anything
| otherwise = One $ Amt (amt *. currentER) c0
where
-- Exchange Rates
observableER = (exchangeRate m) c c0
currentER = realToFrac $ getValue observableER t | 293 | convertTo m t c0 (One (Amt amt c))
| (c0 == c) = One $ Amt amt c0 -- No need to convert anything
| otherwise = One $ Amt (amt *. currentER) c0
where
-- Exchange Rates
observableER = (exchangeRate m) c c0
currentER = realToFrac $ getValue observableER t | 293 | false | false | 2 | 9 | 91 | 110 | 54 | 56 | null | null |
Risto-Stevcev/haskell-church-encodings | Rank1Types/TestChurch.hs | bsd-3-clause | test_add_zero_one = TestCase $ assertEqual "add zero one == 1" | 62 | test_add_zero_one = TestCase $ assertEqual "add zero one == 1" | 62 | test_add_zero_one = TestCase $ assertEqual "add zero one == 1" | 62 | false | false | 0 | 6 | 9 | 13 | 6 | 7 | null | null |
amccausl/RDF4H | testsuite/tests/Text/RDF/RDF4H/TurtleParser_ConformanceTest.hs | bsd-3-clause | normalizeN n = n | 27 | normalizeN n = n | 27 | normalizeN n = n | 27 | false | false | 0 | 4 | 14 | 9 | 4 | 5 | null | null |
sleexyz/haskell-fun | readerfun.hs | bsd-3-clause | -- every a is isomorphic to
-- a computation of b depending on (a way to get from a to b)
cont'' :: a -> forall b. b `DependingOn` (a -> b)
cont'' = cont | 154 | cont'' :: a -> forall b. b `DependingOn` (a -> b)
cont'' = cont | 63 | cont'' = cont | 13 | true | true | 0 | 11 | 35 | 43 | 22 | 21 | null | null |
uduki/hsQt | Qtc/Gui/QSizePolicy.hs | bsd-2-clause | horizontalStretch :: QSizePolicy a -> (()) -> IO (Int)
horizontalStretch x0 ()
= withIntResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QSizePolicy_horizontalStretch cobj_x0 | 179 | horizontalStretch :: QSizePolicy a -> (()) -> IO (Int)
horizontalStretch x0 ()
= withIntResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QSizePolicy_horizontalStretch cobj_x0 | 179 | horizontalStretch x0 ()
= withIntResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QSizePolicy_horizontalStretch cobj_x0 | 124 | false | true | 4 | 9 | 31 | 65 | 30 | 35 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- Word module
word8TyConName, word16TyConName, word32TyConName, word64TyConName :: Name
word8TyConName = tcQual gHC_WORD (fsLit "Word8") word8TyConKey | 156 | word8TyConName, word16TyConName, word32TyConName, word64TyConName :: Name
word8TyConName = tcQual gHC_WORD (fsLit "Word8") word8TyConKey | 141 | word8TyConName = tcQual gHC_WORD (fsLit "Word8") word8TyConKey | 67 | true | true | 3 | 7 | 20 | 39 | 19 | 20 | null | null |
fmthoma/ghc | compiler/typecheck/TcEvidence.hs | bsd-3-clause | evVarsOfTerm (EvLit _) = emptyVarSet | 47 | evVarsOfTerm (EvLit _) = emptyVarSet | 47 | evVarsOfTerm (EvLit _) = emptyVarSet | 47 | false | false | 0 | 6 | 15 | 16 | 7 | 9 | null | null |
brendanhay/gogol | gogol-tpu/gen/Network/Google/Resource/TPU/Projects/Locations/Nodes/Get.hs | mpl-2.0 | -- | V1 error format.
plngXgafv :: Lens' ProjectsLocationsNodesGet (Maybe Xgafv)
plngXgafv
= lens _plngXgafv (\ s a -> s{_plngXgafv = a}) | 139 | plngXgafv :: Lens' ProjectsLocationsNodesGet (Maybe Xgafv)
plngXgafv
= lens _plngXgafv (\ s a -> s{_plngXgafv = a}) | 117 | plngXgafv
= lens _plngXgafv (\ s a -> s{_plngXgafv = a}) | 58 | true | true | 1 | 9 | 23 | 52 | 25 | 27 | null | null |
abstools/habs | src/ABS/Compiler/Utils.hs | bsd-3-clause | -- | Querying a statement AST
--
errorPos :: (Int, Int) -> String -> a
errorPos pos msg = error ("[error #" ++ showPos pos ++ "]" ++ msg) | 139 | errorPos :: (Int, Int) -> String -> a
errorPos pos msg = error ("[error #" ++ showPos pos ++ "]" ++ msg) | 105 | errorPos pos msg = error ("[error #" ++ showPos pos ++ "]" ++ msg) | 67 | true | true | 0 | 10 | 30 | 53 | 28 | 25 | null | null |
shockkolate/containers | Data/IntSet/Base.hs | bsd-3-clause | difference t@(Bin _ _ _ _) Nil = t | 34 | difference t@(Bin _ _ _ _) Nil = t | 34 | difference t@(Bin _ _ _ _) Nil = t | 34 | false | false | 0 | 8 | 8 | 26 | 13 | 13 | null | null |
olsner/ghc | compiler/nativeGen/PPC/CodeGen.hs | bsd-3-clause | remainderCode :: Width -> (Reg -> Reg -> Reg -> Instr)
-> CmmExpr -> CmmExpr -> NatM Register
remainderCode rep div x y = do
dflags <- getDynFlags
let mull_instr = if target32Bit $ targetPlatform dflags then MULLW
else MULLD
(src1, code1) <- ge... | 588 | remainderCode :: Width -> (Reg -> Reg -> Reg -> Instr)
-> CmmExpr -> CmmExpr -> NatM Register
remainderCode rep div x y = do
dflags <- getDynFlags
let mull_instr = if target32Bit $ targetPlatform dflags then MULLW
else MULLD
(src1, code1) <- ge... | 588 | remainderCode rep div x y = do
dflags <- getDynFlags
let mull_instr = if target32Bit $ targetPlatform dflags then MULLW
else MULLD
(src1, code1) <- getSomeReg x
(src2, code2) <- getSomeReg y
let code dst = code1 `appOL` code2 `appOL` toOL [... | 490 | false | true | 0 | 15 | 226 | 201 | 99 | 102 | null | null |
bgamari/text | tests/Tests/Properties.hs | bsd-2-clause | t_dropEnd n = (L.reverse . L.drop n . L.reverse) `eqP`
(unpackS . T.dropEnd n) | 104 | t_dropEnd n = (L.reverse . L.drop n . L.reverse) `eqP`
(unpackS . T.dropEnd n) | 104 | t_dropEnd n = (L.reverse . L.drop n . L.reverse) `eqP`
(unpackS . T.dropEnd n) | 104 | false | false | 0 | 10 | 39 | 47 | 24 | 23 | null | null |
danidiaz/lens | scripts/DocTypes.hs | bsd-3-clause | processCpp = readProcess "cpp" ["-P","-include","dist/build/autogen/cabal_macros.h","-DHLINT"] | 94 | processCpp = readProcess "cpp" ["-P","-include","dist/build/autogen/cabal_macros.h","-DHLINT"] | 94 | processCpp = readProcess "cpp" ["-P","-include","dist/build/autogen/cabal_macros.h","-DHLINT"] | 94 | false | false | 0 | 6 | 4 | 23 | 13 | 10 | null | null |
isomorphism/typewriter | Data/Typewriter/Data/Vec.hs | bsd-3-clause | -- hey! listen! er, I mean, stop and think about this one for a moment:
consVec :: (Natural n) => a -> Vec n a -> Vec (S n) a
consVec x (Vec xs) = Vec (V x xs) | 159 | consVec :: (Natural n) => a -> Vec n a -> Vec (S n) a
consVec x (Vec xs) = Vec (V x xs) | 87 | consVec x (Vec xs) = Vec (V x xs) | 33 | true | true | 0 | 10 | 38 | 72 | 34 | 38 | null | null |
david-caro/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkUnpassedInFunctions7 = verifyTree checkUnpassedInFunctions "foo() { echo $1; }; foo; foo;" | 100 | prop_checkUnpassedInFunctions7 = verifyTree checkUnpassedInFunctions "foo() { echo $1; }; foo; foo;" | 100 | prop_checkUnpassedInFunctions7 = verifyTree checkUnpassedInFunctions "foo() { echo $1; }; foo; foo;" | 100 | false | false | 0 | 5 | 10 | 11 | 5 | 6 | null | null |
candidtim/euler | src/Problem17.hs | bsd-3-clause | spellNumber 3 = "three" | 23 | spellNumber 3 = "three" | 23 | spellNumber 3 = "three" | 23 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
Warbo/quickcheck | Test/QuickCheck/Test.hs | bsd-3-clause | localMin :: State -> P.Result -> P.Result -> [Rose P.Result] -> IO (Int, Int, Int)
localMin st MkResult{P.theException = Just e} lastRes _
| isInterrupt e = localMinFound st lastRes | 183 | localMin :: State -> P.Result -> P.Result -> [Rose P.Result] -> IO (Int, Int, Int)
localMin st MkResult{P.theException = Just e} lastRes _
| isInterrupt e = localMinFound st lastRes | 183 | localMin st MkResult{P.theException = Just e} lastRes _
| isInterrupt e = localMinFound st lastRes | 100 | false | true | 0 | 11 | 31 | 88 | 43 | 45 | null | null |
nyaxt/dmix | nkmd/as/Mnemonic.hs | mit | assemble i@CntlFInsn{imm = (ExprInteger n)} | (n > 0 && n <= 0xff) =
jmpEn .|. cmpEn .|.
((regSelBits (rd i)) `shiftL` 24) .|.
((cmpBits (cmp i)) `shiftL` 22) .|. ((b (cmpneg i)) `shiftL` 21) .|.
((regSelBits (rs i)) `shiftL` 17) .|.
((regSelBits (rt i)) `shiftL` 8) .|.
(immBits n) | 306 | assemble i@CntlFInsn{imm = (ExprInteger n)} | (n > 0 && n <= 0xff) =
jmpEn .|. cmpEn .|.
((regSelBits (rd i)) `shiftL` 24) .|.
((cmpBits (cmp i)) `shiftL` 22) .|. ((b (cmpneg i)) `shiftL` 21) .|.
((regSelBits (rs i)) `shiftL` 17) .|.
((regSelBits (rt i)) `shiftL` 8) .|.
(immBits n) | 306 | assemble i@CntlFInsn{imm = (ExprInteger n)} | (n > 0 && n <= 0xff) =
jmpEn .|. cmpEn .|.
((regSelBits (rd i)) `shiftL` 24) .|.
((cmpBits (cmp i)) `shiftL` 22) .|. ((b (cmpneg i)) `shiftL` 21) .|.
((regSelBits (rs i)) `shiftL` 17) .|.
((regSelBits (rt i)) `shiftL` 8) .|.
(immBits n) | 306 | false | false | 8 | 11 | 73 | 207 | 108 | 99 | null | null |
dzhus/snap-metaforms | src/Application.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- | Render empty login form.
loginForm :: AppHandler ()
loginForm = do
serveFile $ "resources/templates/login.html"
------------------------------------------------------------------------------
-- | Login user. | 295 | loginForm :: AppHandler ()
loginForm = do
serveFile $ "resources/templates/login.html"
------------------------------------------------------------------------------
-- | Login user. | 186 | loginForm = do
serveFile $ "resources/templates/login.html"
------------------------------------------------------------------------------
-- | Login user. | 159 | true | true | 0 | 7 | 25 | 27 | 15 | 12 | null | null |
spoqa/nirum | src/Nirum/Parser.hs | gpl-3.0 | typeIdentifier :: Parser TypeExpression
typeIdentifier = do
typeIdentifier' <- identifier <?> "type identifier"
return $ TypeIdentifier typeIdentifier' | 159 | typeIdentifier :: Parser TypeExpression
typeIdentifier = do
typeIdentifier' <- identifier <?> "type identifier"
return $ TypeIdentifier typeIdentifier' | 159 | typeIdentifier = do
typeIdentifier' <- identifier <?> "type identifier"
return $ TypeIdentifier typeIdentifier' | 119 | false | true | 0 | 8 | 24 | 35 | 16 | 19 | null | null |
Heather/Idris-dev | src/Idris/ElabDecls.hs | bsd-3-clause | elabDecl' what info (PData doc argDocs s f co d)
| what /= ETypes
= do logElab 1 $ "Elaborating " ++ show (d_name d)
elabData info s doc argDocs f co d
| otherwise
= do logElab 1 $ "Elaborating [type of] " ++ show (d_name d)
elabData info s doc argDocs f co (PLaterdecl (d_name d) (d_name_f... | 336 | elabDecl' what info (PData doc argDocs s f co d)
| what /= ETypes
= do logElab 1 $ "Elaborating " ++ show (d_name d)
elabData info s doc argDocs f co d
| otherwise
= do logElab 1 $ "Elaborating [type of] " ++ show (d_name d)
elabData info s doc argDocs f co (PLaterdecl (d_name d) (d_name_f... | 336 | elabDecl' what info (PData doc argDocs s f co d)
| what /= ETypes
= do logElab 1 $ "Elaborating " ++ show (d_name d)
elabData info s doc argDocs f co d
| otherwise
= do logElab 1 $ "Elaborating [type of] " ++ show (d_name d)
elabData info s doc argDocs f co (PLaterdecl (d_name d) (d_name_f... | 336 | false | false | 0 | 13 | 91 | 165 | 73 | 92 | null | null |
green-haskell/ghc | compiler/nativeGen/SPARC/Ppr.hs | bsd-3-clause | pprInstr (RDY rd) = ptext (sLit "\trd\t%y,") <> pprReg rd | 70 | pprInstr (RDY rd) = ptext (sLit "\trd\t%y,") <> pprReg rd | 70 | pprInstr (RDY rd) = ptext (sLit "\trd\t%y,") <> pprReg rd | 70 | false | false | 0 | 8 | 22 | 31 | 14 | 17 | null | null |
ggreif/clash-compiler | clash-lib/src/CLaSH/Netlist/BlackBox/Util.hs | bsd-2-clause | prettyElem (IndexType e) = do
e' <- prettyElem e
(displayT . renderOneLine) <$> (text "~INDEXTYPE" <> brackets (text e')) | 125 | prettyElem (IndexType e) = do
e' <- prettyElem e
(displayT . renderOneLine) <$> (text "~INDEXTYPE" <> brackets (text e')) | 125 | prettyElem (IndexType e) = do
e' <- prettyElem e
(displayT . renderOneLine) <$> (text "~INDEXTYPE" <> brackets (text e')) | 125 | false | false | 0 | 12 | 22 | 59 | 27 | 32 | null | null |
trskop/data-analysis | src/DataAnalysis/Decode/Aeson.hs | bsd-3-clause | aesonDecode
:: Aeson.FromJSON a
=> AesonOptions
-> Lazy.ByteString
-> Maybe a
aesonDecode AesonOptions{..}
| useStrictParser = Aeson.decode'
| otherwise = Aeson.decode | 193 | aesonDecode
:: Aeson.FromJSON a
=> AesonOptions
-> Lazy.ByteString
-> Maybe a
aesonDecode AesonOptions{..}
| useStrictParser = Aeson.decode'
| otherwise = Aeson.decode | 193 | aesonDecode AesonOptions{..}
| useStrictParser = Aeson.decode'
| otherwise = Aeson.decode | 99 | false | true | 1 | 8 | 46 | 60 | 28 | 32 | null | null |
johnfn/hrogue | Main.hs | mit | renderGame :: Game -> String
renderGame (Game (Content mapList) (Player px py)) =
show2 [[(renderChar x y) | x <- [0..10]] | y <- [0..10]]
where
bareMap = map2 extractCell mapList
renderChar x y = if (px == x && py == y) then '@' else get2 bareMap x y | 265 | renderGame :: Game -> String
renderGame (Game (Content mapList) (Player px py)) =
show2 [[(renderChar x y) | x <- [0..10]] | y <- [0..10]]
where
bareMap = map2 extractCell mapList
renderChar x y = if (px == x && py == y) then '@' else get2 bareMap x y | 265 | renderGame (Game (Content mapList) (Player px py)) =
show2 [[(renderChar x y) | x <- [0..10]] | y <- [0..10]]
where
bareMap = map2 extractCell mapList
renderChar x y = if (px == x && py == y) then '@' else get2 bareMap x y | 236 | false | true | 1 | 10 | 63 | 136 | 70 | 66 | null | null |
cdornan/idiot | Text/RE/PCRE/RE.hs | bsd-3-clause | compileRegex' :: (Functor m,Monad m)
=> Options
-> String
-> m (CaptureNames,Regex)
compileRegex' Options{..} s0 = do
(cnms,s2) <- either fail return $ extractNamedCaptures s1
(,) cnms <$> makeRegexOptsM optionsComp optionsExec s2
where
s1 = expandMacros reSource ... | 334 | compileRegex' :: (Functor m,Monad m)
=> Options
-> String
-> m (CaptureNames,Regex)
compileRegex' Options{..} s0 = do
(cnms,s2) <- either fail return $ extractNamedCaptures s1
(,) cnms <$> makeRegexOptsM optionsComp optionsExec s2
where
s1 = expandMacros reSource ... | 334 | compileRegex' Options{..} s0 = do
(cnms,s2) <- either fail return $ extractNamedCaptures s1
(,) cnms <$> makeRegexOptsM optionsComp optionsExec s2
where
s1 = expandMacros reSource optionsMacs s0 | 208 | false | true | 0 | 9 | 94 | 114 | 56 | 58 | null | null |
daniel-beard/projecteulerhaskell | Problems/p3.hs | mit | main :: IO ()
main = do
print calc | 39 | main :: IO ()
main = do
print calc | 39 | main = do
print calc | 25 | false | true | 0 | 8 | 13 | 28 | 11 | 17 | null | null |
sifmelcara/pgdl | src/DownloadInterface.hs | unlicense | download :: DownloadSettings ->
(DownloadEvent -> IO ()) ->
IO ()
download dSettings tell = do
-- this implementation needs to be change
-- since some filename contains characters that cannot be represented by String
let
filepath = T.unpack $ localStoragePath dSettings
... | 1,772 | download :: DownloadSettings ->
(DownloadEvent -> IO ()) ->
IO ()
download dSettings tell = do
-- this implementation needs to be change
-- since some filename contains characters that cannot be represented by String
let
filepath = T.unpack $ localStoragePath dSettings
... | 1,772 | download dSettings tell = do
-- this implementation needs to be change
-- since some filename contains characters that cannot be represented by String
let
filepath = T.unpack $ localStoragePath dSettings
checkFile :: IO ()
checkFile = forever $ do
threadDelay 100000 -- 0.... | 1,682 | false | true | 0 | 24 | 544 | 458 | 214 | 244 | null | null |
antalsz/hs-to-coq | examples/ghc/gen-files/Lexer.hs | mit | alex_action_78 = idtoken qvarid | 32 | alex_action_78 = idtoken qvarid | 32 | alex_action_78 = idtoken qvarid | 32 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
chadbrewbaker/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | isCommandMatch token matcher = fromMaybe False $ do
cmd <- getCommandName token
return $ matcher cmd | 108 | isCommandMatch token matcher = fromMaybe False $ do
cmd <- getCommandName token
return $ matcher cmd | 108 | isCommandMatch token matcher = fromMaybe False $ do
cmd <- getCommandName token
return $ matcher cmd | 108 | false | false | 0 | 9 | 23 | 38 | 16 | 22 | null | null |
christiaanb/fpprac | examples/Graphics.hs | bsd-3-clause | edgeWidthThick = 1.5 | 20 | edgeWidthThick = 1.5 | 20 | edgeWidthThick = 1.5 | 20 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
leroux/bf-interpreter | bf.hs | bsd-3-clause | -- `+` | increment the byte at the data pointer
(^+) :: Memory -> Memory
(^+) (ls, f, rs) = (ls, f + 1, rs) | 107 | (^+) :: Memory -> Memory
(^+) (ls, f, rs) = (ls, f + 1, rs) | 59 | (^+) (ls, f, rs) = (ls, f + 1, rs) | 34 | true | true | 0 | 6 | 24 | 45 | 28 | 17 | null | null |
termite2/code-widget | cwtest.hs | bsd-3-clause | rgnText :: CwAPI -> CodeWidget.Region -> IO ()
rgnText c r = do t <- regionGetText c r
putStrLn $ "getText Region=" ++ show r
putStrLn t
--dialog <- messageDialogNew Nothing [DialogModal] MessageInfo ButtonsOk t
--_ <- onResponse dialog (\_ -> widgetDe... | 373 | rgnText :: CwAPI -> CodeWidget.Region -> IO ()
rgnText c r = do t <- regionGetText c r
putStrLn $ "getText Region=" ++ show r
putStrLn t
--dialog <- messageDialogNew Nothing [DialogModal] MessageInfo ButtonsOk t
--_ <- onResponse dialog (\_ -> widgetDe... | 373 | rgnText c r = do t <- regionGetText c r
putStrLn $ "getText Region=" ++ show r
putStrLn t
--dialog <- messageDialogNew Nothing [DialogModal] MessageInfo ButtonsOk t
--_ <- onResponse dialog (\_ -> widgetDestroy dialog)
--windowPresent ... | 326 | false | true | 0 | 8 | 129 | 66 | 31 | 35 | null | null |
glguy/irc-core | src/Client/State.hs | isc | applyMessageToClientState ::
ZonedTime {- ^ timestamp -} ->
IrcMsg {- ^ message received -} ->
Text {- ^ network name -} ->
NetworkState {- ^ network connection state -} ->
ClientState {-... | 812 | applyMessageToClientState ::
ZonedTime {- ^ timestamp -} ->
IrcMsg {- ^ message received -} ->
Text {- ^ network name -} ->
NetworkState {- ^ network connection state -} ->
ClientState {-... | 766 | applyMessageToClientState time irc network cs st =
cs' `seq` (reply, st')
where
Apply reply cs' = applyMessage time irc cs
st' = applyWindowRenames network irc
$ set (clientConnections . ix network) cs' st
-- | When a nick change happens and there is an open query window for that nick
-- and there ... | 383 | true | true | 3 | 11 | 280 | 130 | 68 | 62 | null | null |
graydon/metrics | tests/MeterTest.hs | mit | testTicks = runST $ do
r <- newSTRef 0
m <- mkMeter $ increment1s r
mark m
mark m
mark m
mark m
mark m
md <- readMutVar (fromMeter m)
x <- readSTRef r
return $ (meterLastTick md, x) | 201 | testTicks = runST $ do
r <- newSTRef 0
m <- mkMeter $ increment1s r
mark m
mark m
mark m
mark m
mark m
md <- readMutVar (fromMeter m)
x <- readSTRef r
return $ (meterLastTick md, x) | 201 | testTicks = runST $ do
r <- newSTRef 0
m <- mkMeter $ increment1s r
mark m
mark m
mark m
mark m
mark m
md <- readMutVar (fromMeter m)
x <- readSTRef r
return $ (meterLastTick md, x) | 201 | false | false | 0 | 11 | 58 | 106 | 44 | 62 | null | null |
sdiehl/ghc | compiler/basicTypes/Module.hs | bsd-3-clause | pprUnitId (IndefiniteUnitId uid) = ppr uid | 42 | pprUnitId (IndefiniteUnitId uid) = ppr uid | 42 | pprUnitId (IndefiniteUnitId uid) = ppr uid | 42 | false | false | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
kazu-yamamoto/network-uri | tests/uri001.hs | bsd-3-clause | tn04str = "eXAMPLE://a/b/%7bfoo%7d" | 35 | tn04str = "eXAMPLE://a/b/%7bfoo%7d" | 35 | tn04str = "eXAMPLE://a/b/%7bfoo%7d" | 35 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
vincenthz/cryptonite | Crypto/ConstructHash/MiyaguchiPreneel.hs | bsd-3-clause | compute :: (ByteArrayAccess bin, BlockCipher cipher)
=> bin -- ^ input message
-> MiyaguchiPreneel cipher -- ^ output tag
compute = compute' $ throwCryptoError . cipherInit | 208 | compute :: (ByteArrayAccess bin, BlockCipher cipher)
=> bin -- ^ input message
-> MiyaguchiPreneel cipher
compute = compute' $ throwCryptoError . cipherInit | 192 | compute = compute' $ throwCryptoError . cipherInit | 50 | true | true | 0 | 7 | 61 | 43 | 23 | 20 | null | null |
ssaavedra/liquidhaskell | src/Language/Haskell/Liquid/Desugar710/DsUtils.hs | bsd-3-clause | extractMatchResult (MatchResult CanFail match_fn) fail_expr = do
(fail_bind, if_it_fails) <- mkFailurePair fail_expr
body <- match_fn if_it_fails
return (mkCoreLet fail_bind body) | 191 | extractMatchResult (MatchResult CanFail match_fn) fail_expr = do
(fail_bind, if_it_fails) <- mkFailurePair fail_expr
body <- match_fn if_it_fails
return (mkCoreLet fail_bind body) | 191 | extractMatchResult (MatchResult CanFail match_fn) fail_expr = do
(fail_bind, if_it_fails) <- mkFailurePair fail_expr
body <- match_fn if_it_fails
return (mkCoreLet fail_bind body) | 191 | false | false | 0 | 9 | 31 | 59 | 27 | 32 | null | null |
DavidAlphaFox/ghc | utils/haddock/html-test/src/QuasiExpr.hs | bsd-3-clause | eval :: Expr -> Integer
eval (IntExpr n) = n | 51 | eval :: Expr -> Integer
eval (IntExpr n) = n | 51 | eval (IntExpr n) = n | 27 | false | true | 0 | 7 | 16 | 24 | 12 | 12 | null | null |
music-suite/music-preludes | tests/tests.hs | bsd-3-clause | mySystem str = do
(_,_,_,p) <- createProcess $ (shell str) { delegate_ctlc = False }
waitForProcess p
{-
This test will always fail if the test files have been edited.
If you have edited one or more test files and DEFINITELY intend to make
your changes permanent, please assure that you are in a clean wo... | 508 | mySystem str = do
(_,_,_,p) <- createProcess $ (shell str) { delegate_ctlc = False }
waitForProcess p
{-
This test will always fail if the test files have been edited.
If you have edited one or more test files and DEFINITELY intend to make
your changes permanent, please assure that you are in a clean wo... | 508 | mySystem str = do
(_,_,_,p) <- createProcess $ (shell str) { delegate_ctlc = False }
waitForProcess p
{-
This test will always fail if the test files have been edited.
If you have edited one or more test files and DEFINITELY intend to make
your changes permanent, please assure that you are in a clean wo... | 508 | false | false | 1 | 12 | 112 | 57 | 28 | 29 | null | null |
IreneKnapp/Faction | libfaction/Distribution/ParseUtils.hs | bsd-3-clause | tokeniseLineFlat :: (LineNo, Indent, HasTabs, String) -> [Token]
tokeniseLineFlat (n0, i, t, l)
| null l' = []
| otherwise = [Line n0 i t l']
where
l' = trimTrailing (trimLeading l) | 193 | tokeniseLineFlat :: (LineNo, Indent, HasTabs, String) -> [Token]
tokeniseLineFlat (n0, i, t, l)
| null l' = []
| otherwise = [Line n0 i t l']
where
l' = trimTrailing (trimLeading l) | 193 | tokeniseLineFlat (n0, i, t, l)
| null l' = []
| otherwise = [Line n0 i t l']
where
l' = trimTrailing (trimLeading l) | 128 | false | true | 1 | 8 | 43 | 92 | 49 | 43 | null | null |
edsko/cabal | cabal-install/Distribution/Client/Install.hs | bsd-3-clause | onFailure :: (SomeException -> BuildFailure) -> IO BuildResult -> IO BuildResult
onFailure result action =
action `catches`
[ Handler $ \ioe -> handler (ioe :: IOException)
, Handler $ \exit -> handler (exit :: ExitCode)
]
where
handler :: Exception e => e -> IO BuildResult
handler = return . ... | 502 | onFailure :: (SomeException -> BuildFailure) -> IO BuildResult -> IO BuildResult
onFailure result action =
action `catches`
[ Handler $ \ioe -> handler (ioe :: IOException)
, Handler $ \exit -> handler (exit :: ExitCode)
]
where
handler :: Exception e => e -> IO BuildResult
handler = return . ... | 502 | onFailure result action =
action `catches`
[ Handler $ \ioe -> handler (ioe :: IOException)
, Handler $ \exit -> handler (exit :: ExitCode)
]
where
handler :: Exception e => e -> IO BuildResult
handler = return . Left . result . toException
-- ------------------------------------------------... | 421 | false | true | 0 | 10 | 91 | 127 | 68 | 59 | null | null |
well-typed/generics-sop | sop-core/src/Data/SOP/Dict.hs | bsd-3-clause | -- | The constraint @'All' ('All' c)@ is convertible to @'All2' c@.
--
-- @since 0.2
--
all2 :: Dict (All (All c)) xss -> Dict (All2 c) xss
all2 = id | 149 | all2 :: Dict (All (All c)) xss -> Dict (All2 c) xss
all2 = id | 61 | all2 = id | 9 | true | true | 2 | 8 | 31 | 51 | 25 | 26 | null | null |
rafalnowak/RaytracaH | src/RaytracaH/Ray.hs | apache-2.0 | screenCoordsToCameraCoords :: Float -> Vector2D -> Vector3D
screenCoordsToCameraCoords cameraFov (Vec2F x y) =
Vec3F (x * fovTanValue) (y * fovTanValue) (-1.0)
where
fovTanValue = tan (deg2rad (cameraFov / 2)) | 225 | screenCoordsToCameraCoords :: Float -> Vector2D -> Vector3D
screenCoordsToCameraCoords cameraFov (Vec2F x y) =
Vec3F (x * fovTanValue) (y * fovTanValue) (-1.0)
where
fovTanValue = tan (deg2rad (cameraFov / 2)) | 225 | screenCoordsToCameraCoords cameraFov (Vec2F x y) =
Vec3F (x * fovTanValue) (y * fovTanValue) (-1.0)
where
fovTanValue = tan (deg2rad (cameraFov / 2)) | 165 | false | true | 0 | 9 | 44 | 82 | 42 | 40 | null | null |
cdparks/mini-core | src/MiniCore/Transforms/Constructors.hs | mit | replaceDataDecls :: Program -> Gen Program
replaceDataDecls program = do
let (dataDecls, combinators) = partition isData program
constructors = concatMap getConstructors dataDecls
combinators' <- mapM newCombinator constructors
return (combinators' ++ combinators)
-- After all the Data declarations have be... | 413 | replaceDataDecls :: Program -> Gen Program
replaceDataDecls program = do
let (dataDecls, combinators) = partition isData program
constructors = concatMap getConstructors dataDecls
combinators' <- mapM newCombinator constructors
return (combinators' ++ combinators)
-- After all the Data declarations have be... | 413 | replaceDataDecls program = do
let (dataDecls, combinators) = partition isData program
constructors = concatMap getConstructors dataDecls
combinators' <- mapM newCombinator constructors
return (combinators' ++ combinators)
-- After all the Data declarations have been converted, use the ConstructorEnv
-- to ... | 370 | false | true | 0 | 10 | 64 | 79 | 38 | 41 | null | null |
kantp/Haxl | Haxl/Core/Types.hs | bsd-3-clause | putFailure :: (Exception e) => ResultVar a -> e -> IO ()
putFailure r = putResult r . except | 92 | putFailure :: (Exception e) => ResultVar a -> e -> IO ()
putFailure r = putResult r . except | 92 | putFailure r = putResult r . except | 35 | false | true | 0 | 10 | 18 | 50 | 23 | 27 | null | null |
rbermani/ib-api | src/IB/Client/Parser.hs | gpl-3.0 | pTagValueCons :: Parser [TagValue]
pTagValueCons =
do listCount <- pStrInt
if listCount > 0
then replicateM listCount pTagValue
else return [] | 170 | pTagValueCons :: Parser [TagValue]
pTagValueCons =
do listCount <- pStrInt
if listCount > 0
then replicateM listCount pTagValue
else return [] | 170 | pTagValueCons =
do listCount <- pStrInt
if listCount > 0
then replicateM listCount pTagValue
else return [] | 135 | false | true | 1 | 10 | 48 | 53 | 24 | 29 | null | null |
jimburton/steg | test-steg/TestSteg.hs | mit | tests :: [Test]
tests = [ testProperty "prop_codecRAWPGM" prop_codecRAWPGM
, testProperty "prop_codecBMP" prop_codecBMP ] | 129 | tests :: [Test]
tests = [ testProperty "prop_codecRAWPGM" prop_codecRAWPGM
, testProperty "prop_codecBMP" prop_codecBMP ] | 129 | tests = [ testProperty "prop_codecRAWPGM" prop_codecRAWPGM
, testProperty "prop_codecBMP" prop_codecBMP ] | 113 | false | true | 0 | 6 | 21 | 30 | 16 | 14 | null | null |
copumpkin/vector-static | Data/Vector/Storable/Static.hs | bsd-3-clause | maxIndex (Vec vs) = G.maxIndex vs | 33 | maxIndex (Vec vs) = G.maxIndex vs | 33 | maxIndex (Vec vs) = G.maxIndex vs | 33 | false | false | 0 | 6 | 5 | 21 | 9 | 12 | null | null |
rleshchinskiy/vector | Data/Vector/Storable.hs | bsd-3-clause | zipWith6 = G.zipWith6 | 21 | zipWith6 = G.zipWith6 | 21 | zipWith6 = G.zipWith6 | 21 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
fredyr/copilot-libraries | src/Copilot/Library/Utils.hs | bsd-3-clause | nfoldl :: ( Typed a, Typed b )
=> Int -> ( Stream a -> Stream b -> Stream a )
-> Stream a -> Stream b -> Stream a
nfoldl n f e s = foldl f e $ take n s | 180 | nfoldl :: ( Typed a, Typed b )
=> Int -> ( Stream a -> Stream b -> Stream a )
-> Stream a -> Stream b -> Stream a
nfoldl n f e s = foldl f e $ take n s | 180 | nfoldl n f e s = foldl f e $ take n s | 37 | false | true | 0 | 11 | 71 | 94 | 44 | 50 | null | null |
kovach/web2 | src/Reflection.hs | mit | flattenQ r c (QBinOp op e1 e2) = do
q <- fresh
makeT "constraint" [q, r]
makeT "operator" [opNode, q]
c1 <- flattenE q c 1 e1
c2 <- flattenE q c1 3 e2
return c2
where
opNode =
case op of
QEq -> NString "="
QDisEq -> NString "/="
QLess -> NString "<"
QM... | 434 | flattenQ r c (QBinOp op e1 e2) = do
q <- fresh
makeT "constraint" [q, r]
makeT "operator" [opNode, q]
c1 <- flattenE q c 1 e1
c2 <- flattenE q c1 3 e2
return c2
where
opNode =
case op of
QEq -> NString "="
QDisEq -> NString "/="
QLess -> NString "<"
QM... | 434 | flattenQ r c (QBinOp op e1 e2) = do
q <- fresh
makeT "constraint" [q, r]
makeT "operator" [opNode, q]
c1 <- flattenE q c 1 e1
c2 <- flattenE q c1 3 e2
return c2
where
opNode =
case op of
QEq -> NString "="
QDisEq -> NString "/="
QLess -> NString "<"
QM... | 434 | false | false | 0 | 8 | 155 | 163 | 75 | 88 | null | null |
flowbox-public/language-c-quote | Language/C/Quote/Base.hs | bsd-3-clause | qqCEnumListP :: [C.CEnum] -> Maybe (Q Pat)
qqCEnumListP [] = Just $ listP [] | 76 | qqCEnumListP :: [C.CEnum] -> Maybe (Q Pat)
qqCEnumListP [] = Just $ listP [] | 76 | qqCEnumListP [] = Just $ listP [] | 33 | false | true | 0 | 8 | 13 | 43 | 21 | 22 | null | null |
cbrghostrider/Hacking | HackerRank/FunctionalProgramming/AdHoc/bubbleWrap.hs | mit | bubbleExpectedAttempts :: Int -> Int -> Double
bubbleExpectedAttempts n m = sum . map (expectedAttemptsIthUnpopped n m) . init $ [0..(n*m)] | 139 | bubbleExpectedAttempts :: Int -> Int -> Double
bubbleExpectedAttempts n m = sum . map (expectedAttemptsIthUnpopped n m) . init $ [0..(n*m)] | 139 | bubbleExpectedAttempts n m = sum . map (expectedAttemptsIthUnpopped n m) . init $ [0..(n*m)] | 92 | false | true | 0 | 10 | 20 | 64 | 31 | 33 | null | null |
denibertovic/haskell | kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs | bsd-3-clause | -- | 'v1EndpointPortPort' Lens
v1EndpointPortPortL :: Lens_' V1EndpointPort (Int)
v1EndpointPortPortL f V1EndpointPort{..} = (\v1EndpointPortPort -> V1EndpointPort { v1EndpointPortPort, ..} ) <$> f v1EndpointPortPort | 216 | v1EndpointPortPortL :: Lens_' V1EndpointPort (Int)
v1EndpointPortPortL f V1EndpointPort{..} = (\v1EndpointPortPort -> V1EndpointPort { v1EndpointPortPort, ..} ) <$> f v1EndpointPortPort | 185 | v1EndpointPortPortL f V1EndpointPort{..} = (\v1EndpointPortPort -> V1EndpointPort { v1EndpointPortPort, ..} ) <$> f v1EndpointPortPort | 134 | true | true | 1 | 8 | 22 | 59 | 29 | 30 | null | null |
bartoszw/yelca | Handler/Util.hs | gpl-2.0 | roundingList = [Rounded,Truncated] | 34 | roundingList = [Rounded,Truncated] | 34 | roundingList = [Rounded,Truncated] | 34 | false | false | 0 | 5 | 2 | 12 | 7 | 5 | null | null |
mightymoose/liquidhaskell | benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Termination.hs | bsd-3-clause | loop3 :: Int -> Int -> Int
loop3 l u
| len < 100 = len
| otherwise = let a = loop3 l mid
b = loop3 mid u
in a + b
where len = u - l
mid = (u + l) `shiftRI` 1 | 235 | loop3 :: Int -> Int -> Int
loop3 l u
| len < 100 = len
| otherwise = let a = loop3 l mid
b = loop3 mid u
in a + b
where len = u - l
mid = (u + l) `shiftRI` 1 | 235 | loop3 l u
| len < 100 = len
| otherwise = let a = loop3 l mid
b = loop3 mid u
in a + b
where len = u - l
mid = (u + l) `shiftRI` 1 | 208 | false | true | 2 | 9 | 124 | 108 | 52 | 56 | null | null |
llllllllll/h16cc | Assembler/Validation.hs | gpl-2.0 | validateOnePOp OpWrite [p]
| isRegOrLit p = Nothing
| otherwise = Just $ ExpectedRegOrLit p | 134 | validateOnePOp OpWrite [p]
| isRegOrLit p = Nothing
| otherwise = Just $ ExpectedRegOrLit p | 134 | validateOnePOp OpWrite [p]
| isRegOrLit p = Nothing
| otherwise = Just $ ExpectedRegOrLit p | 134 | false | false | 1 | 8 | 57 | 37 | 17 | 20 | null | null |
DigitalBrains1/clash-lt24 | UnitTest/LT24/Framebuffer/BouncyCommon.hs | bsd-2-clause | -- Radius of blue ball
outerRBall = 23 | 38 | outerRBall = 23 | 15 | outerRBall = 23 | 15 | true | false | 0 | 4 | 7 | 7 | 4 | 3 | null | null |
ice1000/OI-codes | codewars/401-500/sure-but-can-you-ski-i.hs | agpl-3.0 | -- We can't write `fix` i.e Y in Haskell because Haskell is typed
-- (well, at least without recursive types), but we can still write `join`
join :: SKI ((a -> a -> b) -> a -> b)
join = Ap (Ap S S) (Ap S K) | 206 | join :: SKI ((a -> a -> b) -> a -> b)
join = Ap (Ap S S) (Ap S K) | 65 | join = Ap (Ap S S) (Ap S K) | 27 | true | true | 0 | 11 | 46 | 64 | 32 | 32 | null | null |
AlexanderPankiv/ghc | compiler/nativeGen/SPARC/CodeGen.hs | bsd-3-clause | genBranch :: BlockId -> NatM InstrBlock
genBranch = return . toOL . mkJumpInstr | 79 | genBranch :: BlockId -> NatM InstrBlock
genBranch = return . toOL . mkJumpInstr | 79 | genBranch = return . toOL . mkJumpInstr | 39 | false | true | 0 | 6 | 12 | 26 | 13 | 13 | null | null |
tismith/tlisp | write-yourself-a-scheme/listings/listing6.2.hs | mit | trapError action = catchError action (return . show) | 52 | trapError action = catchError action (return . show) | 52 | trapError action = catchError action (return . show) | 52 | false | false | 0 | 7 | 7 | 21 | 10 | 11 | null | null |
beni55/pretty | src/Text/PrettyPrint/HughesPJ.hs | bsd-3-clause | isEmpty _ = False | 21 | isEmpty _ = False | 21 | isEmpty _ = False | 21 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
DaMSL/K3 | src/Language/K3/Analysis/SEffects/Constructors.hs | apache-2.0 | ffvar :: Identifier -> K3 Effect
ffvar i = leaf $! FFVar i | 58 | ffvar :: Identifier -> K3 Effect
ffvar i = leaf $! FFVar i | 58 | ffvar i = leaf $! FFVar i | 25 | false | true | 2 | 7 | 12 | 33 | 14 | 19 | null | null |
zakharvoit/haskell-homework | Base.hs | gpl-3.0 | eqInteger, neInteger :: Integer → Integer → Bool
eqInteger = (P.==) | 67 | eqInteger, neInteger :: Integer → Integer → Bool
eqInteger = (P.==) | 67 | eqInteger = (P.==) | 18 | false | true | 2 | 8 | 10 | 36 | 16 | 20 | null | null |
riccardotommasini/plp16 | haskell/prepared/ESE20181123/bintreecont.hs | apache-2.0 | -- here I actually made an implicit assumption. I decided what tree concatenation means
tconcat t = tfoldr tconc Nil t | 123 | tconcat t = tfoldr tconc Nil t | 30 | tconcat t = tfoldr tconc Nil t | 30 | true | false | 0 | 5 | 25 | 17 | 8 | 9 | null | null |
changlinli/tictactoe-haskell | Negamax.hs | gpl-3.0 | evaluate :: NegamaxTree state -> (state -> ExtendedNum Integer) -> Int -> ExtendedNum Integer
evaluate (Node state [] ) evalFunc _ = evalFunc state | 147 | evaluate :: NegamaxTree state -> (state -> ExtendedNum Integer) -> Int -> ExtendedNum Integer
evaluate (Node state [] ) evalFunc _ = evalFunc state | 147 | evaluate (Node state [] ) evalFunc _ = evalFunc state | 53 | false | true | 0 | 9 | 23 | 59 | 28 | 31 | null | null |
nimia/bottle | codeedit/Editor/BottleWidgets.hs | gpl-3.0 | makeChoice
:: (Monad m, Eq a)
=> Widget.Id -> Box.Orientation -> [(a, WidgetT t m)] -> a -> TWidget t m
makeChoice selectionAnimId orientation children curChild = do
let
mCurChildIndex = findIndex ((curChild ==) . fst) children
colorizedChildren =
map (uncurry colorize . first (curChild ==)) childre... | 646 | makeChoice
:: (Monad m, Eq a)
=> Widget.Id -> Box.Orientation -> [(a, WidgetT t m)] -> a -> TWidget t m
makeChoice selectionAnimId orientation children curChild = do
let
mCurChildIndex = findIndex ((curChild ==) . fst) children
colorizedChildren =
map (uncurry colorize . first (curChild ==)) childre... | 646 | makeChoice selectionAnimId orientation children curChild = do
let
mCurChildIndex = findIndex ((curChild ==) . fst) children
colorizedChildren =
map (uncurry colorize . first (curChild ==)) children
box = Box.make orientation colorizedChildren
return $
maybe Box.toWidget Box.toWidgetBiased mCur... | 538 | false | true | 2 | 14 | 130 | 203 | 102 | 101 | null | null |
duplode/dohaskell | src/Foundation.hs | bsd-3-clause | unsafeHandler :: App -> Handler a -> IO a
unsafeHandler = Unsafe.fakeHandlerGetLogger appLogger | 95 | unsafeHandler :: App -> Handler a -> IO a
unsafeHandler = Unsafe.fakeHandlerGetLogger appLogger | 95 | unsafeHandler = Unsafe.fakeHandlerGetLogger appLogger | 53 | false | true | 0 | 7 | 12 | 30 | 14 | 16 | null | null |
EDmitry/ircbot-hs | IrcBot.hs | mit | nickNegotiation :: Consumer IRC.Message Bot ()
nickNegotiation = do m <- await
if IRC.msg_command m == "376"
then do liftIO $ putStrLn "connected!"
np <- asks $ nickPassword . botSettings
lift $ privmsg "NickServ" ... | 383 | nickNegotiation :: Consumer IRC.Message Bot ()
nickNegotiation = do m <- await
if IRC.msg_command m == "376"
then do liftIO $ putStrLn "connected!"
np <- asks $ nickPassword . botSettings
lift $ privmsg "NickServ" ... | 383 | nickNegotiation = do m <- await
if IRC.msg_command m == "376"
then do liftIO $ putStrLn "connected!"
np <- asks $ nickPassword . botSettings
lift $ privmsg "NickServ" ("identify " <> np)
else... | 336 | false | true | 1 | 13 | 168 | 97 | 44 | 53 | null | null |
silkapp/tagsoup | dead/parser/Compiler/CodeGen.hs | bsd-3-clause | genChoice :: Choice -> Exp
genChoice (NoChoice x) = genSeq x | 60 | genChoice :: Choice -> Exp
genChoice (NoChoice x) = genSeq x | 60 | genChoice (NoChoice x) = genSeq x | 33 | false | true | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
homam/fsm-conversational-ui | src/IndexedState.hs | bsd-3-clause | persist :: Suspended -> IO ()
persist = print | 45 | persist :: Suspended -> IO ()
persist = print | 45 | persist = print | 15 | false | true | 0 | 7 | 8 | 20 | 10 | 10 | null | null |
badp/ganeti | src/Ganeti/Objects.hs | gpl-2.0 | lidDiskType (LIDRados {}) = DTRbd | 33 | lidDiskType (LIDRados {}) = DTRbd | 33 | lidDiskType (LIDRados {}) = DTRbd | 33 | false | false | 0 | 6 | 4 | 17 | 8 | 9 | null | null |
MaxDaten/yage-geometry | src/Yage/Geometry/D2/Bound.hs | mit | compareCenter :: ( Num a, Ord a ) => Bound a -> Bound a -> Ordering
compareCenter a b = (a^.center) `compare` (b^.center) | 121 | compareCenter :: ( Num a, Ord a ) => Bound a -> Bound a -> Ordering
compareCenter a b = (a^.center) `compare` (b^.center) | 121 | compareCenter a b = (a^.center) `compare` (b^.center) | 53 | false | true | 0 | 8 | 22 | 65 | 34 | 31 | null | null |
ezyang/ghc | compiler/hsSyn/HsDecls.hs | bsd-3-clause | pp_vanilla_decl_head :: (SourceTextX pass, OutputableBndrId pass)
=> Located (IdP pass)
-> LHsQTyVars pass
-> LexicalFixity
-> HsContext pass
-> SDoc
pp_vanilla_decl_head thing (HsQTvs { hsq_explicit = tyvars }) fixity context
= hsep [pprHsContext context, pp_tyvars tyvars]
where
pp_tyvars (varl:v... | 813 | pp_vanilla_decl_head :: (SourceTextX pass, OutputableBndrId pass)
=> Located (IdP pass)
-> LHsQTyVars pass
-> LexicalFixity
-> HsContext pass
-> SDoc
pp_vanilla_decl_head thing (HsQTvs { hsq_explicit = tyvars }) fixity context
= hsep [pprHsContext context, pp_tyvars tyvars]
where
pp_tyvars (varl:v... | 813 | pp_vanilla_decl_head thing (HsQTvs { hsq_explicit = tyvars }) fixity context
= hsep [pprHsContext context, pp_tyvars tyvars]
where
pp_tyvars (varl:varsr)
| fixity == Infix && length varsr > 1
= hsep [char '(',ppr (unLoc varl), pprInfixOcc (unLoc thing)
, (ppr.unLoc) (head varsr), c... | 648 | false | true | 1 | 12 | 224 | 333 | 165 | 168 | null | null |
scvalex/ltorrent | BitTorrent/Tracker.hs | lgpl-3.0 | emptyRequest :: TrackerRequest
emptyRequest = TrackerRequest
L.empty -- getInfoHash
"-ZQ0000-123456654321" -- getPeerId
6883 -- getPort
0 -- getUploaded
0 -- getDownloaded
0 -- getLeft
True -- getCompact
... | 499 | emptyRequest :: TrackerRequest
emptyRequest = TrackerRequest
L.empty -- getInfoHash
"-ZQ0000-123456654321" -- getPeerId
6883 -- getPort
0 -- getUploaded
0 -- getDownloaded
0 -- getLeft
True -- getCompact
... | 499 | emptyRequest = TrackerRequest
L.empty -- getInfoHash
"-ZQ0000-123456654321" -- getPeerId
6883 -- getPort
0 -- getUploaded
0 -- getDownloaded
0 -- getLeft
True -- getCompact
True -- getNoPeerId
... | 468 | false | true | 0 | 6 | 238 | 71 | 33 | 38 | null | null |
jfischoff/th-instances | src/Language/Haskell/TH/Instances.hs | bsd-3-clause | type_arb :: Int -> Gen Type
type_arb depth = do
let max_option = if depth > 0 then 8 else (5 :: Int)
typ <- choose (0, max_option)
case typ of
0 -> VarT <$> mkName <$> listOf lowerAlpha
1 -> ConT <$> arb_constructor_name
2 -> TupleT <$> arbitrary
... | 631 | type_arb :: Int -> Gen Type
type_arb depth = do
let max_option = if depth > 0 then 8 else (5 :: Int)
typ <- choose (0, max_option)
case typ of
0 -> VarT <$> mkName <$> listOf lowerAlpha
1 -> ConT <$> arb_constructor_name
2 -> TupleT <$> arbitrary
3... | 624 | type_arb depth = do
let max_option = if depth > 0 then 8 else (5 :: Int)
typ <- choose (0, max_option)
case typ of
0 -> VarT <$> mkName <$> listOf lowerAlpha
1 -> ConT <$> arb_constructor_name
2 -> TupleT <$> arbitrary
3 -> UnboxedTupleT <$> arbitr... | 596 | false | true | 0 | 15 | 236 | 227 | 111 | 116 | null | null |
stevezhee/eel | src/CEel.hs | bsd-3-clause | oneof :: Phi r => M r -> [(Bool', M r)] -> M r
oneof = foldr (\(r,a) b -> if' r a b) | 85 | oneof :: Phi r => M r -> [(Bool', M r)] -> M r
oneof = foldr (\(r,a) b -> if' r a b) | 84 | oneof = foldr (\(r,a) b -> if' r a b) | 37 | false | true | 0 | 11 | 24 | 76 | 37 | 39 | null | null |
elegios/datalang | src/Main.hs | mit | isRight _ = False | 17 | isRight _ = False | 17 | isRight _ = False | 17 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
Cahu/nbody-test | src/GLUtils.hs | bsd-3-clause | mkShader :: GL.ShaderType -> FilePath -> IO GL.Shader
mkShader shaderType sourcePath = do
s <- GL.createShader shaderType
c <- BS.readFile sourcePath
GL.shaderSourceBS s $= c
GL.compileShader s
status <- GL.compileStatus s
unless status $ do
info <- GL.shaderInfoLog s
error info
... | 332 | mkShader :: GL.ShaderType -> FilePath -> IO GL.Shader
mkShader shaderType sourcePath = do
s <- GL.createShader shaderType
c <- BS.readFile sourcePath
GL.shaderSourceBS s $= c
GL.compileShader s
status <- GL.compileStatus s
unless status $ do
info <- GL.shaderInfoLog s
error info
... | 332 | mkShader shaderType sourcePath = do
s <- GL.createShader shaderType
c <- BS.readFile sourcePath
GL.shaderSourceBS s $= c
GL.compileShader s
status <- GL.compileStatus s
unless status $ do
info <- GL.shaderInfoLog s
error info
return s | 278 | false | true | 0 | 13 | 86 | 126 | 52 | 74 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/types/Type.hs | bsd-3-clause | cmpTypeX _ (ForAllTy _ _) (FunTy _ _) = GT | 45 | cmpTypeX _ (ForAllTy _ _) (FunTy _ _) = GT | 45 | cmpTypeX _ (ForAllTy _ _) (FunTy _ _) = GT | 45 | false | false | 1 | 6 | 12 | 32 | 14 | 18 | null | null |
jgm/texmath | src/Text/TeXMath/Readers/TeX.hs | gpl-2.0 | isConvertible (ESymbol Bin _) = True | 36 | isConvertible (ESymbol Bin _) = True | 36 | isConvertible (ESymbol Bin _) = True | 36 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
mmarx/curry | Curry/Matrix.hs | bsd-3-clause | --columns :: Matrix b -> [Int]
columns = rows . transpose | 57 | columns = rows . transpose | 26 | columns = rows . transpose | 26 | true | false | 0 | 5 | 10 | 11 | 6 | 5 | null | null |
dysinger/amazonka | amazonka-ecs/gen/Network/AWS/ECS/ListClusters.hs | mpl-2.0 | -- | The maximum number of cluster results returned by 'ListClusters' in paginated
-- output. When this parameter is used, 'ListClusters' only returns 'maxResults'
-- results in a single page along with a 'nextToken' response element. The
-- remaining results of the initial request can be seen by sending another 'ListC... | 647 | lcMaxResults :: Lens' ListClusters (Maybe Int)
lcMaxResults = lens _lcMaxResults (\s a -> s { _lcMaxResults = a }) | 114 | lcMaxResults = lens _lcMaxResults (\s a -> s { _lcMaxResults = a }) | 67 | true | true | 2 | 9 | 104 | 60 | 30 | 30 | null | null |
felixlawrence/scrabble-ladder | scrabble-ladder.hs | apache-2.0 | main = do
contents <- getContents
let sortedWords = sort $ lines $ map toUpper contents
word4List = reverse $ getWord4List sortedWords
revDicts = getReverseDicts sortedWords
allTiles = "AAAAAAAAABBCCDDDDEEEEEEEEEEEEFFGGGHHIIIIIIIIIJKLLLLMMNNNNNNOOOOOOOOPPQRRRRRRSSSSTTTTTTUUUUVVWWXYYZ"
printLadde... | 396 | main = do
contents <- getContents
let sortedWords = sort $ lines $ map toUpper contents
word4List = reverse $ getWord4List sortedWords
revDicts = getReverseDicts sortedWords
allTiles = "AAAAAAAAABBCCDDDDEEEEEEEEEEEEFFGGGHHIIIIIIIIIJKLLLLMMNNNNNNOOOOOOOOPPQRRRRRRSSSSTTTTTTUUUUVVWWXYYZ"
printLadde... | 396 | main = do
contents <- getContents
let sortedWords = sort $ lines $ map toUpper contents
word4List = reverse $ getWord4List sortedWords
revDicts = getReverseDicts sortedWords
allTiles = "AAAAAAAAABBCCDDDDEEEEEEEEEEEEFFGGGHHIIIIIIIIIJKLLLLMMNNNNNNOOOOOOOOPPQRRRRRRSSSSTTTTTTUUUUVVWWXYYZ"
printLadde... | 396 | false | false | 0 | 11 | 60 | 84 | 41 | 43 | null | null |
nightscape/platform | node/tests/Unison/Test/ResourcePool.hs | mit | eventually :: Assertion -> Assertion
eventually cond = go 1 where
go n | n > 8 = cond
go n = cond <|> (delaySeconds n >> go (n*2)) | 134 | eventually :: Assertion -> Assertion
eventually cond = go 1 where
go n | n > 8 = cond
go n = cond <|> (delaySeconds n >> go (n*2)) | 134 | eventually cond = go 1 where
go n | n > 8 = cond
go n = cond <|> (delaySeconds n >> go (n*2)) | 97 | false | true | 0 | 10 | 32 | 72 | 35 | 37 | null | null |
thasenpusch/scheme | parser.hs | isc | parseEllipsis :: Parser Ellipsis
parseEllipsis = expectIdent >> pure Ellipsis | 77 | parseEllipsis :: Parser Ellipsis
parseEllipsis = expectIdent >> pure Ellipsis | 77 | parseEllipsis = expectIdent >> pure Ellipsis | 44 | false | true | 2 | 6 | 9 | 28 | 11 | 17 | null | null |
technogeeky/pearl-sorting-with-bialgebras | src/Pearl/SWB/Section06.hs | gpl-3.0 | -- ^
-- >>> :t withr
-- withr :: KTree (t :/\: SList t) -> SList (t :\/: KTree t)
shear :: STree (Lf STree :/\: SList (Lf STree)) -> SList (Lf STree)
shear KE = SNil | 207 | shear :: STree (Lf STree :/\: SList (Lf STree)) -> SList (Lf STree)
shear KE = SNil | 119 | shear KE = SNil | 51 | true | true | 0 | 11 | 78 | 56 | 27 | 29 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/KinesisAnalyticsApplicationOutputOutput.hs | mit | kinesisAnalyticsApplicationOutputOutput
:: KinesisAnalyticsApplicationOutputDestinationSchema -- ^ 'kaaooDestinationSchema'
-> KinesisAnalyticsApplicationOutputOutput
kinesisAnalyticsApplicationOutputOutput destinationSchemaarg =
KinesisAnalyticsApplicationOutputOutput
{ _kinesisAnalyticsApplicationOutputOutput... | 641 | kinesisAnalyticsApplicationOutputOutput
:: KinesisAnalyticsApplicationOutputDestinationSchema -- ^ 'kaaooDestinationSchema'
-> KinesisAnalyticsApplicationOutputOutput
kinesisAnalyticsApplicationOutputOutput destinationSchemaarg =
KinesisAnalyticsApplicationOutputOutput
{ _kinesisAnalyticsApplicationOutputOutput... | 641 | kinesisAnalyticsApplicationOutputOutput destinationSchemaarg =
KinesisAnalyticsApplicationOutputOutput
{ _kinesisAnalyticsApplicationOutputOutputDestinationSchema = destinationSchemaarg
, _kinesisAnalyticsApplicationOutputOutputKinesisFirehoseOutput = Nothing
, _kinesisAnalyticsApplicationOutputOutputKinesisStr... | 470 | false | true | 0 | 7 | 50 | 60 | 33 | 27 | null | null |
stevezhee/pec | Pec/C.hs | bsd-3-clause | isNoOpS _ = False | 17 | isNoOpS _ = False | 17 | isNoOpS _ = False | 17 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
andgate/gwtrader | src/Main.hs | bsd-3-clause | parseArgs ("rebuild":args) =
buildMarket | 42 | parseArgs ("rebuild":args) =
buildMarket | 42 | parseArgs ("rebuild":args) =
buildMarket | 42 | false | false | 0 | 6 | 5 | 17 | 8 | 9 | null | null |
brendanhay/gogol | gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/CourseWorkMaterials/Delete.hs | mpl-2.0 | -- | JSONP
ccwmdCallback :: Lens' CoursesCourseWorkMaterialsDelete (Maybe Text)
ccwmdCallback
= lens _ccwmdCallback
(\ s a -> s{_ccwmdCallback = a}) | 156 | ccwmdCallback :: Lens' CoursesCourseWorkMaterialsDelete (Maybe Text)
ccwmdCallback
= lens _ccwmdCallback
(\ s a -> s{_ccwmdCallback = a}) | 145 | ccwmdCallback
= lens _ccwmdCallback
(\ s a -> s{_ccwmdCallback = a}) | 76 | true | true | 1 | 9 | 27 | 51 | 25 | 26 | null | null |
sethfowler/pygmalion | indexers/Pygmalion/Index/Source.hs | bsd-3-clause | toSourceKind C.Cursor_ObjCMessageExpr = ObjCMessageExpr | 74 | toSourceKind C.Cursor_ObjCMessageExpr = ObjCMessageExpr | 74 | toSourceKind C.Cursor_ObjCMessageExpr = ObjCMessageExpr | 74 | false | false | 0 | 6 | 22 | 11 | 5 | 6 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.