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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
vTurbine/ghc | compiler/typecheck/TcBinds.hs | bsd-3-clause | recoveryCode :: [Name] -> TcSigFun -> TcM (LHsBinds TcId, [Id])
recoveryCode binder_names sig_fn
= do { traceTc "tcBindsWithSigs: error recovery" (ppr binder_names)
; let poly_ids = map mk_dummy binder_names
; return (emptyBag, poly_ids) }
where
mk_dummy name
| Just sig <- sig_fn name
... | 436 | recoveryCode :: [Name] -> TcSigFun -> TcM (LHsBinds TcId, [Id])
recoveryCode binder_names sig_fn
= do { traceTc "tcBindsWithSigs: error recovery" (ppr binder_names)
; let poly_ids = map mk_dummy binder_names
; return (emptyBag, poly_ids) }
where
mk_dummy name
| Just sig <- sig_fn name
... | 436 | recoveryCode binder_names sig_fn
= do { traceTc "tcBindsWithSigs: error recovery" (ppr binder_names)
; let poly_ids = map mk_dummy binder_names
; return (emptyBag, poly_ids) }
where
mk_dummy name
| Just sig <- sig_fn name
, Just poly_id <- completeSigPolyId_maybe sig
= poly_id... | 372 | false | true | 0 | 10 | 111 | 152 | 70 | 82 | null | null |
hjwylde/haskell-type-classes-workshop | src/Executor.hs | bsd-3-clause | simplifyStatement :: Statement -> State (Map String Int) Statement
simplifyStatement = undefined | 96 | simplifyStatement :: Statement -> State (Map String Int) Statement
simplifyStatement = undefined | 96 | simplifyStatement = undefined | 29 | false | true | 0 | 8 | 11 | 28 | 14 | 14 | null | null |
mightybyte/cabal | cabal-install/Distribution/Client/Sandbox.hs | bsd-3-clause | tryLoadSandboxConfig :: Verbosity -> GlobalFlags
-> IO (FilePath, PackageEnvironment)
tryLoadSandboxConfig verbosity globalFlags = do
path <- getSandboxConfigFilePath globalFlags
tryLoadSandboxPackageEnvironmentFile verbosity path
(globalConfigFile globalFlags)
-- | Return the name of t... | 371 | tryLoadSandboxConfig :: Verbosity -> GlobalFlags
-> IO (FilePath, PackageEnvironment)
tryLoadSandboxConfig verbosity globalFlags = do
path <- getSandboxConfigFilePath globalFlags
tryLoadSandboxPackageEnvironmentFile verbosity path
(globalConfigFile globalFlags)
-- | Return the name of t... | 371 | tryLoadSandboxConfig verbosity globalFlags = do
path <- getSandboxConfigFilePath globalFlags
tryLoadSandboxPackageEnvironmentFile verbosity path
(globalConfigFile globalFlags)
-- | Return the name of the package index file for this package environment. | 261 | false | true | 0 | 9 | 69 | 60 | 29 | 31 | null | null |
ekmett/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcObject.hs | lgpl-2.1 | wxManagedPtrDeleteFunction :: IO (ManagedPtr a -> IO ())
wxManagedPtrDeleteFunction
= do fun <- wxManagedPtr_GetDeleteFunction
return $ wxManagedPtr_CallbackFunction fun
{--------------------------------------------------------------------------
Managed pointers
---------------------------------------------... | 350 | wxManagedPtrDeleteFunction :: IO (ManagedPtr a -> IO ())
wxManagedPtrDeleteFunction
= do fun <- wxManagedPtr_GetDeleteFunction
return $ wxManagedPtr_CallbackFunction fun
{--------------------------------------------------------------------------
Managed pointers
---------------------------------------------... | 350 | wxManagedPtrDeleteFunction
= do fun <- wxManagedPtr_GetDeleteFunction
return $ wxManagedPtr_CallbackFunction fun
{--------------------------------------------------------------------------
Managed pointers
--------------------------------------------------------------------------} | 293 | false | true | 0 | 10 | 33 | 53 | 23 | 30 | null | null |
juhp/stack | src/Stack/Storage/User.hs | bsd-3-clause | loadPrecompiledCache ::
(HasConfig env, HasLogFunc env)
=> PrecompiledCacheKey
-> RIO env (Maybe (PrecompiledCache Rel))
loadPrecompiledCache key = withUserStorage $ fmap snd <$> readPrecompiledCache key | 218 | loadPrecompiledCache ::
(HasConfig env, HasLogFunc env)
=> PrecompiledCacheKey
-> RIO env (Maybe (PrecompiledCache Rel))
loadPrecompiledCache key = withUserStorage $ fmap snd <$> readPrecompiledCache key | 218 | loadPrecompiledCache key = withUserStorage $ fmap snd <$> readPrecompiledCache key | 82 | false | true | 0 | 12 | 38 | 65 | 31 | 34 | null | null |
niexshao/Exercises | src/HQuestions.hs | bsd-3-clause | h6 :: Eq a => [a] -> Bool
h6 xs = xs == h5 xs | 45 | h6 :: Eq a => [a] -> Bool
h6 xs = xs == h5 xs | 45 | h6 xs = xs == h5 xs | 19 | false | true | 1 | 8 | 14 | 41 | 18 | 23 | null | null |
cullina/Extractor | src/LevTests.hs | bsd-3-clause | cliqueAssistedColor (c:cs) =
cAC . sortBy (compare `on` length) $ foldr deleteVertex cs c
where cAC [] = []
cAC ([]:cs) = cAC cs
cAC ([c]:cs) = cAC . sortBy (compare `on` length) $ deleteVertex c cs
cAC cs = cs | 239 | cliqueAssistedColor (c:cs) =
cAC . sortBy (compare `on` length) $ foldr deleteVertex cs c
where cAC [] = []
cAC ([]:cs) = cAC cs
cAC ([c]:cs) = cAC . sortBy (compare `on` length) $ deleteVertex c cs
cAC cs = cs | 239 | cliqueAssistedColor (c:cs) =
cAC . sortBy (compare `on` length) $ foldr deleteVertex cs c
where cAC [] = []
cAC ([]:cs) = cAC cs
cAC ([c]:cs) = cAC . sortBy (compare `on` length) $ deleteVertex c cs
cAC cs = cs | 239 | false | false | 3 | 9 | 69 | 140 | 66 | 74 | null | null |
nevrenato/HetsAlloy | OWL2/Parse.hs | gpl-2.0 | abbrIriNoPos :: CharParser st QName
abbrIriNoPos = try $ do
pre <- try $ prefix << char ':'
r <- hierPartWithOpts <|> return "" -- allow an empty local part
return nullQName { namePrefix = pre, localPart = r }
<|> fmap mkQName hierPartWithOpts | 257 | abbrIriNoPos :: CharParser st QName
abbrIriNoPos = try $ do
pre <- try $ prefix << char ':'
r <- hierPartWithOpts <|> return "" -- allow an empty local part
return nullQName { namePrefix = pre, localPart = r }
<|> fmap mkQName hierPartWithOpts | 257 | abbrIriNoPos = try $ do
pre <- try $ prefix << char ':'
r <- hierPartWithOpts <|> return "" -- allow an empty local part
return nullQName { namePrefix = pre, localPart = r }
<|> fmap mkQName hierPartWithOpts | 221 | false | true | 6 | 9 | 57 | 91 | 42 | 49 | null | null |
peterbecich/haskell-programming-first-principles | src/SimpleTransformer.hs | bsd-3-clause | askFor2 :: String -> MaybeT IO String
askFor2 prompt = do
liftIO $ putStr $ "what is your " ++ prompt ++ " (type END to quit)?"
response <- liftIO getLine
if response == "END"
then MaybeT (return Nothing)
else MaybeT (return (Just response)) | 255 | askFor2 :: String -> MaybeT IO String
askFor2 prompt = do
liftIO $ putStr $ "what is your " ++ prompt ++ " (type END to quit)?"
response <- liftIO getLine
if response == "END"
then MaybeT (return Nothing)
else MaybeT (return (Just response)) | 255 | askFor2 prompt = do
liftIO $ putStr $ "what is your " ++ prompt ++ " (type END to quit)?"
response <- liftIO getLine
if response == "END"
then MaybeT (return Nothing)
else MaybeT (return (Just response)) | 217 | false | true | 0 | 12 | 57 | 91 | 43 | 48 | null | null |
valis/hoq | src/TypeChecking/Definitions/Termination.hs | gpl-2.0 | checkTerm :: Eq a => Term Int a -> Term Semantics a -> Ordering
checkTerm (Apply con _) (Apply (Semantics _ (ICon con')) []) | con == iConToInt con' = EQ
where
iConToInt ILeft = 0
iConToInt IRight = 1 | 211 | checkTerm :: Eq a => Term Int a -> Term Semantics a -> Ordering
checkTerm (Apply con _) (Apply (Semantics _ (ICon con')) []) | con == iConToInt con' = EQ
where
iConToInt ILeft = 0
iConToInt IRight = 1 | 211 | checkTerm (Apply con _) (Apply (Semantics _ (ICon con')) []) | con == iConToInt con' = EQ
where
iConToInt ILeft = 0
iConToInt IRight = 1 | 147 | false | true | 2 | 15 | 50 | 117 | 50 | 67 | null | null |
tonosaman/haskell-code-snippets | src/Examples/Transformers.hs | bsd-2-clause | eval0 env (App e1 e2) =
let FunVal env' n e = eval0 env e1
iv@(IntVal _) = eval0 env e2
in eval0 (Map.insert n iv env') e | 132 | eval0 env (App e1 e2) =
let FunVal env' n e = eval0 env e1
iv@(IntVal _) = eval0 env e2
in eval0 (Map.insert n iv env') e | 132 | eval0 env (App e1 e2) =
let FunVal env' n e = eval0 env e1
iv@(IntVal _) = eval0 env e2
in eval0 (Map.insert n iv env') e | 132 | false | false | 0 | 11 | 38 | 83 | 37 | 46 | null | null |
ghc-android/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | setCtLocEnv :: CtLoc -> TcLclEnv -> CtLoc
setCtLocEnv ctl env = ctl { ctl_env = env } | 85 | setCtLocEnv :: CtLoc -> TcLclEnv -> CtLoc
setCtLocEnv ctl env = ctl { ctl_env = env } | 85 | setCtLocEnv ctl env = ctl { ctl_env = env } | 43 | false | true | 0 | 8 | 16 | 41 | 19 | 22 | null | null |
mstksg/prompt | src/Control/Monad/Prompt.hs | mit | mapPromptT f (PromptT p) = PromptT $ fmap f . p | 47 | mapPromptT f (PromptT p) = PromptT $ fmap f . p | 47 | mapPromptT f (PromptT p) = PromptT $ fmap f . p | 47 | false | false | 0 | 7 | 10 | 30 | 13 | 17 | null | null |
m-alvarez/jhc | src/Info/Binary.hs | mit | u :: (Typeable a, Binary a) => a
u = u | 38 | u :: (Typeable a, Binary a) => a
u = u | 38 | u = u | 5 | false | true | 0 | 7 | 10 | 33 | 15 | 18 | null | null |
ghorn/dynobud | dynobud/src/Dyno/DirectCollocation/Dynamic.hs | lgpl-3.0 | toMeta :: forall x z u p o q qo po h .
( Lookup (x ()), Lookup (z ()), Lookup (u ()), Lookup (p ()), Lookup (o ()), Lookup (q ())
, Lookup (h ()), Lookup (po ()), Lookup (qo ())
)
=> MetaProxy x z u p o q qo po h -> CollTrajMeta
toMeta _ =
CollTrajMeta
{ ctmX = namesFromAccT... | 826 | toMeta :: forall x z u p o q qo po h .
( Lookup (x ()), Lookup (z ()), Lookup (u ()), Lookup (p ()), Lookup (o ()), Lookup (q ())
, Lookup (h ()), Lookup (po ()), Lookup (qo ())
)
=> MetaProxy x z u p o q qo po h -> CollTrajMeta
toMeta _ =
CollTrajMeta
{ ctmX = namesFromAccT... | 826 | toMeta _ =
CollTrajMeta
{ ctmX = namesFromAccTree (accessors :: AccessorTree (x ()))
, ctmZ = namesFromAccTree (accessors :: AccessorTree (z ()))
, ctmU = namesFromAccTree (accessors :: AccessorTree (u ()))
, ctmP = namesFromAccTree (accessors :: AccessorTree (p ()))
, ctmO = namesFromAccTree (accessor... | 557 | false | true | 0 | 13 | 201 | 397 | 210 | 187 | null | null |
laszlopandy/elm-compiler | src/Type/Type.hs | bsd-3-clause | mkVar :: Maybe Super -> IO Variable
mkVar maybeSuper =
UF.fresh $ mkDescriptor (Var Flex maybeSuper Nothing) | 110 | mkVar :: Maybe Super -> IO Variable
mkVar maybeSuper =
UF.fresh $ mkDescriptor (Var Flex maybeSuper Nothing) | 110 | mkVar maybeSuper =
UF.fresh $ mkDescriptor (Var Flex maybeSuper Nothing) | 74 | false | true | 0 | 8 | 18 | 43 | 20 | 23 | null | null |
thalerjonathan/phd | coding/prototyping/haskell/YampaWildfire/src/WildFireFrontend.hs | gpl-3.0 | cellDimensions :: (Int, Int) -> (GLdouble, GLdouble)
cellDimensions (dimX, dimY) = (cellWidth, cellHeight)
where
cellWidth = ( fromIntegral (winDimXInt winSize) / fromIntegral dimX ) :: GLdouble
cellHeight = ( fromIntegral (winDimYInt winSize) / fromIntegral dimY ) :: GLdouble | 306 | cellDimensions :: (Int, Int) -> (GLdouble, GLdouble)
cellDimensions (dimX, dimY) = (cellWidth, cellHeight)
where
cellWidth = ( fromIntegral (winDimXInt winSize) / fromIntegral dimX ) :: GLdouble
cellHeight = ( fromIntegral (winDimYInt winSize) / fromIntegral dimY ) :: GLdouble | 306 | cellDimensions (dimX, dimY) = (cellWidth, cellHeight)
where
cellWidth = ( fromIntegral (winDimXInt winSize) / fromIntegral dimX ) :: GLdouble
cellHeight = ( fromIntegral (winDimYInt winSize) / fromIntegral dimY ) :: GLdouble | 253 | false | true | 0 | 11 | 66 | 98 | 54 | 44 | null | null |
bitemyapp/serials | server/Serials/Route/UserSignup.hs | mit | sendWelcomeEmail :: User -> App ()
sendWelcomeEmail u = do
ep <- asks (endpoint . env)
sendMail [User.email u] (welcomeEmail ep u) | 134 | sendWelcomeEmail :: User -> App ()
sendWelcomeEmail u = do
ep <- asks (endpoint . env)
sendMail [User.email u] (welcomeEmail ep u) | 134 | sendWelcomeEmail u = do
ep <- asks (endpoint . env)
sendMail [User.email u] (welcomeEmail ep u) | 99 | false | true | 0 | 10 | 25 | 64 | 30 | 34 | null | null |
silkapp/xmlhtml | src/Text/XmlHtml/HTML/Meta.hs | bsd-3-clause | reftab18 :: [(Text,Text)]
reftab18 =
[ ("angmsdae", "\x029AC"),
("angmsdaf", "\x029AD"),
("angmsdag", "\x029AE"),
("angmsdah", "\x029AF"),
("angrt", "\x0221F"),
("angrtvb", "\x022BE"),
("angrtvbd", "\x0299D"),
("angsph", "\x02222"),
("angst", "\x000C5"),
("angzarr", "\x0237C"),
... | 1,036 | reftab18 :: [(Text,Text)]
reftab18 =
[ ("angmsdae", "\x029AC"),
("angmsdaf", "\x029AD"),
("angmsdag", "\x029AE"),
("angmsdah", "\x029AF"),
("angrt", "\x0221F"),
("angrtvb", "\x022BE"),
("angrtvbd", "\x0299D"),
("angsph", "\x02222"),
("angst", "\x000C5"),
("angzarr", "\x0237C"),
... | 1,036 | reftab18 =
[ ("angmsdae", "\x029AC"),
("angmsdaf", "\x029AD"),
("angmsdag", "\x029AE"),
("angmsdah", "\x029AF"),
("angrt", "\x0221F"),
("angrtvb", "\x022BE"),
("angrtvbd", "\x0299D"),
("angsph", "\x02222"),
("angst", "\x000C5"),
("angzarr", "\x0237C"),
("aogon", "\x00105"),
... | 1,010 | false | true | 0 | 6 | 226 | 353 | 234 | 119 | null | null |
rueshyna/gogol | gogol-appengine/gen/Network/Google/Resource/AppEngine/Apps/Operations/List.hs | mpl-2.0 | -- | V1 error format.
aolXgafv :: Lens' AppsOperationsList (Maybe Text)
aolXgafv = lens _aolXgafv (\ s a -> s{_aolXgafv = a}) | 125 | aolXgafv :: Lens' AppsOperationsList (Maybe Text)
aolXgafv = lens _aolXgafv (\ s a -> s{_aolXgafv = a}) | 103 | aolXgafv = lens _aolXgafv (\ s a -> s{_aolXgafv = a}) | 53 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
Concelo/concelo | src/Database/Concelo/Subscriber.hs | bsd-3-clause | diffChunks oldChunks oldRoot newChunks newRoot =
snd <$> diffChunksAll oldChunks oldRoot newChunks newRoot | 108 | diffChunks oldChunks oldRoot newChunks newRoot =
snd <$> diffChunksAll oldChunks oldRoot newChunks newRoot | 108 | diffChunks oldChunks oldRoot newChunks newRoot =
snd <$> diffChunksAll oldChunks oldRoot newChunks newRoot | 108 | false | false | 2 | 5 | 14 | 29 | 13 | 16 | null | null |
beni55/texmath | src/Text/TeXMath/Readers/TeX/Macros.hs | gpl-2.0 | inBrackets :: GenParser Char st String
inBrackets = try $ do
char '['
pSkipSpaceComments
res <- manyTill (skipComment >> (escaped "[]" <|> count 1 anyChar))
(try $ pSkipSpaceComments >> char ']')
return $ concat res | 233 | inBrackets :: GenParser Char st String
inBrackets = try $ do
char '['
pSkipSpaceComments
res <- manyTill (skipComment >> (escaped "[]" <|> count 1 anyChar))
(try $ pSkipSpaceComments >> char ']')
return $ concat res | 233 | inBrackets = try $ do
char '['
pSkipSpaceComments
res <- manyTill (skipComment >> (escaped "[]" <|> count 1 anyChar))
(try $ pSkipSpaceComments >> char ']')
return $ concat res | 194 | false | true | 0 | 14 | 52 | 89 | 41 | 48 | null | null |
laanwj/Purecoin | Purecoin/PSQueue.hs | mit | right Start = error "right: empty loser tree" | 64 | right Start = error "right: empty loser tree" | 64 | right Start = error "right: empty loser tree" | 64 | false | false | 0 | 5 | 26 | 12 | 5 | 7 | null | null |
kmate/raw-feldspar-mcs | benchmarking/GenSamples.hs | bsd-3-clause | main = do
[ n, m ] <- getArgs
withFile ("samples_" ++ m ++ ".dat") WriteMode $ \h -> do
void $ replicateM (read n - 1) $ do
r <- randomRIO (1,255) :: IO Int
hPutStrLn h $ show r
hPutStrLn h "0" | 241 | main = do
[ n, m ] <- getArgs
withFile ("samples_" ++ m ++ ".dat") WriteMode $ \h -> do
void $ replicateM (read n - 1) $ do
r <- randomRIO (1,255) :: IO Int
hPutStrLn h $ show r
hPutStrLn h "0" | 241 | main = do
[ n, m ] <- getArgs
withFile ("samples_" ++ m ++ ".dat") WriteMode $ \h -> do
void $ replicateM (read n - 1) $ do
r <- randomRIO (1,255) :: IO Int
hPutStrLn h $ show r
hPutStrLn h "0" | 241 | false | false | 0 | 16 | 91 | 114 | 54 | 60 | null | null |
msullivan/advent-of-code | 2016/A11a.hs | mit | done _ = False | 14 | done _ = False | 14 | done _ = False | 14 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
caiorss/Functional-Programming | haskell/src/readerMonad.hs | unlicense | ask :: Reader r r
ask = Reader (\ r -> r) | 41 | ask :: Reader r r
ask = Reader (\ r -> r) | 41 | ask = Reader (\ r -> r) | 23 | false | true | 0 | 7 | 11 | 27 | 14 | 13 | null | null |
etrepat/cis194 | src/Week1/Homework.hs | mit | -- Exercise 4
validate :: Integer -> Bool
validate n = (sumDigits . doubleEveryOther . toDigits) n `mod` 10 == 0 | 112 | validate :: Integer -> Bool
validate n = (sumDigits . doubleEveryOther . toDigits) n `mod` 10 == 0 | 98 | validate n = (sumDigits . doubleEveryOther . toDigits) n `mod` 10 == 0 | 70 | true | true | 0 | 10 | 20 | 43 | 23 | 20 | null | null |
ctford/Idris-Elba-dev | src/IRTS/Java/JTypes.hs | bsd-3-clause | sourceTypes (LIntFloat from) = [intTyToJType from] | 50 | sourceTypes (LIntFloat from) = [intTyToJType from] | 50 | sourceTypes (LIntFloat from) = [intTyToJType from] | 50 | false | false | 0 | 7 | 5 | 21 | 10 | 11 | null | null |
benb/MetAl | src/AlnDistSet.hs | gpl-3.0 | goTree dist x y (Left err) a b = err | 36 | goTree dist x y (Left err) a b = err | 36 | goTree dist x y (Left err) a b = err | 36 | false | false | 1 | 6 | 9 | 34 | 12 | 22 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_HPA_STRING :: Int
wxSTC_HPA_STRING = 109 | 46 | wxSTC_HPA_STRING :: Int
wxSTC_HPA_STRING = 109 | 46 | wxSTC_HPA_STRING = 109 | 22 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
DanielG/kvm-in-a-box | src/Iptables.hs | agpl-3.0 | prop_insertAcceptRulesIntoTables :: Bool
prop_insertAcceptRulesIntoTables =
insertAcceptRulesIntoTables c1 c2 == c3
where
c1 = IptablesSave [] $ (:[]) $ ("filter",) $ ([],) $ (:[]) $ (,) "INPUT" $ [
["-A", "INPUT", "-j", "ACCEPT"],
["-A", "INPUT", "-j", "ACCEPT"],
["-A", "INPUT", "-j... | 800 | prop_insertAcceptRulesIntoTables :: Bool
prop_insertAcceptRulesIntoTables =
insertAcceptRulesIntoTables c1 c2 == c3
where
c1 = IptablesSave [] $ (:[]) $ ("filter",) $ ([],) $ (:[]) $ (,) "INPUT" $ [
["-A", "INPUT", "-j", "ACCEPT"],
["-A", "INPUT", "-j", "ACCEPT"],
["-A", "INPUT", "-j... | 800 | prop_insertAcceptRulesIntoTables =
insertAcceptRulesIntoTables c1 c2 == c3
where
c1 = IptablesSave [] $ (:[]) $ ("filter",) $ ([],) $ (:[]) $ (,) "INPUT" $ [
["-A", "INPUT", "-j", "ACCEPT"],
["-A", "INPUT", "-j", "ACCEPT"],
["-A", "INPUT", "-j", "DROP"],
["-A", "INPUT", "-j"... | 759 | false | true | 17 | 10 | 232 | 371 | 213 | 158 | null | null |
AlexeyRaga/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | primOpCanFail ReadJIntArrayOp = True | 41 | primOpCanFail ReadJIntArrayOp = True | 41 | primOpCanFail ReadJIntArrayOp = True | 41 | false | false | 0 | 4 | 8 | 10 | 4 | 6 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Attoparsec.Text.Lazy.hs | bsd-3-clause | parseTest :: (Show a) => A.Parser a -> Text -> IO ()
parseTest p s = print (parse p s) | 86 | parseTest :: (Show a) => A.Parser a -> Text -> IO ()
parseTest p s = print (parse p s) | 86 | parseTest p s = print (parse p s) | 33 | false | true | 0 | 9 | 19 | 54 | 26 | 28 | null | null |
nivox/halm | src/Text/Halm/Dictionary.hs | gpl-2.0 | -- | Computes the dictionary of the specified file
computeF :: FilePath -> IO Dictionary
computeF f = extendF f empty | 117 | computeF :: FilePath -> IO Dictionary
computeF f = extendF f empty | 66 | computeF f = extendF f empty | 28 | true | true | 0 | 6 | 20 | 27 | 13 | 14 | null | null |
gcampax/ghc | compiler/main/Packages.hs | bsd-3-clause | -- | Get a list of entries from the package database. NB: be careful with
-- this function, although all packages in this map are "visible", this
-- does not imply that the exposed-modules of the package are available
-- (they may have been thinned or renamed).
listPackageConfigMap :: DynFlags -> [PackageConfig]
listP... | 381 | listPackageConfigMap :: DynFlags -> [PackageConfig]
listPackageConfigMap dflags = eltsUFM (pkgIdMap (pkgState dflags)) | 118 | listPackageConfigMap dflags = eltsUFM (pkgIdMap (pkgState dflags)) | 66 | true | true | 0 | 9 | 59 | 40 | 22 | 18 | null | null |
plumlife/cabal | Cabal/Distribution/Simple/Haddock.hs | bsd-3-clause | renderArgs :: Verbosity
-> TempFileOptions
-> Version
-> Compiler
-> HaddockArgs
-> (([String], FilePath) -> IO a)
-> IO a
renderArgs verbosity tmpFileOpts version comp args k = do
createDirectoryIfMissingVerbose verbosity True output... | 1,151 | renderArgs :: Verbosity
-> TempFileOptions
-> Version
-> Compiler
-> HaddockArgs
-> (([String], FilePath) -> IO a)
-> IO a
renderArgs verbosity tmpFileOpts version comp args k = do
createDirectoryIfMissingVerbose verbosity True output... | 1,151 | renderArgs verbosity tmpFileOpts version comp args k = do
createDirectoryIfMissingVerbose verbosity True outputDir
withTempFileEx tmpFileOpts outputDir "haddock-prologue.txt" $
\prologueFileName h -> do
do
when (version >= Version [2,14,4] []) (hSetEncoding h utf8)
hPutStrLn ... | 944 | false | true | 0 | 18 | 467 | 312 | 151 | 161 | null | null |
koengit/induction-examples | List.hs | mit | evens [] = [] | 17 | evens [] = [] | 17 | evens [] = [] | 17 | false | false | 0 | 6 | 7 | 13 | 6 | 7 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2017/M11/D01/Exercise.hs | mit | -- Returns Left (), meaning no new special chars in the new archive, or
-- Right set, with the new special chars not found in our config.
{--
Now, from the result returned by scanArchive, call a function that either
replaces the special characters in the target archive or adds the new
characters to the config file for... | 453 | replaceSpecialChars :: SpecialCharTable -> Block -> Block
replaceSpecialChars specialCharTable block = undefined | 112 | replaceSpecialChars specialCharTable block = undefined | 54 | true | true | 0 | 6 | 74 | 27 | 15 | 12 | null | null |
erantapaa/haskell-platform | hptool/src/OS/Win/WinPaths.hs | bsd-3-clause | -- | The installer file name, dependent on the HP version and architecture
winProductFileName :: Bool -> Version -> String -> FilePath
winProductFileName isFull hpv arch =
("HaskellPlatform-" ++ versionAndArch ++ "-setup") <.> "exe"
where versionAndArch = showVersion hpv ++ (if isFull then "-full" else "-minimal"... | 386 | winProductFileName :: Bool -> Version -> String -> FilePath
winProductFileName isFull hpv arch =
("HaskellPlatform-" ++ versionAndArch ++ "-setup") <.> "exe"
where versionAndArch = showVersion hpv ++ (if isFull then "-full" else "-minimal") ++ '-' : arch
-- | Directory where the installer file is built. | 311 | winProductFileName isFull hpv arch =
("HaskellPlatform-" ++ versionAndArch ++ "-setup") <.> "exe"
where versionAndArch = showVersion hpv ++ (if isFull then "-full" else "-minimal") ++ '-' : arch
-- | Directory where the installer file is built. | 251 | true | true | 0 | 9 | 65 | 81 | 43 | 38 | null | null |
takagi/SimulationDSL | SimulationDSL/SimulationDSL/Language/Equations.hs | bsd-3-clause | checkEquationWithInitialCondition :: Equation -> Equations -> Equations
checkEquationWithInitialCondition eq eqs
| isIntegral (equationExp eq) = eqs
| otherwise
= case equationsInitialCondition eqs (equationSymbol eq) of
Just x -> error msg
Nothing -> eqs
where msg = "checkEquations: no... | 406 | checkEquationWithInitialCondition :: Equation -> Equations -> Equations
checkEquationWithInitialCondition eq eqs
| isIntegral (equationExp eq) = eqs
| otherwise
= case equationsInitialCondition eqs (equationSymbol eq) of
Just x -> error msg
Nothing -> eqs
where msg = "checkEquations: no... | 406 | checkEquationWithInitialCondition eq eqs
| isIntegral (equationExp eq) = eqs
| otherwise
= case equationsInitialCondition eqs (equationSymbol eq) of
Just x -> error msg
Nothing -> eqs
where msg = "checkEquations: non-integral equation with initial condition"
++ ", which wo... | 334 | false | true | 1 | 10 | 94 | 92 | 43 | 49 | null | null |
mohamedhayibor/haskelling-hard | cs194/validatingCreditCardNumbers.hs | mit | toDigitsRev :: Int -> [Int]
toDigitsRev = map digitToInt . reverse . show | 73 | toDigitsRev :: Int -> [Int]
toDigitsRev = map digitToInt . reverse . show | 73 | toDigitsRev = map digitToInt . reverse . show | 45 | false | true | 0 | 7 | 12 | 29 | 15 | 14 | null | null |
evolutics/haskell-formatter | src/library/Language/Haskell/Formatter/Process/FormatActualCode.hs | gpl-3.0 | mode :: Style.Style -> Source.PPHsMode
mode style
= Source.defaultMode{Source.classIndent = Style.classIndentation style,
Source.doIndent = Style.doIndentation style,
Source.caseIndent = Style.caseIndentation style,
Source.letIndent = Style.letInden... | 483 | mode :: Style.Style -> Source.PPHsMode
mode style
= Source.defaultMode{Source.classIndent = Style.classIndentation style,
Source.doIndent = Style.doIndentation style,
Source.caseIndent = Style.caseIndentation style,
Source.letIndent = Style.letInden... | 483 | mode style
= Source.defaultMode{Source.classIndent = Style.classIndentation style,
Source.doIndent = Style.doIndentation style,
Source.caseIndent = Style.caseIndentation style,
Source.letIndent = Style.letIndentation style,
So... | 444 | false | true | 0 | 8 | 148 | 104 | 55 | 49 | null | null |
seckcoder/vector | Data/Vector/Storable.hs | bsd-3-clause | scanl = G.scanl | 15 | scanl = G.scanl | 15 | scanl = G.scanl | 15 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
olsner/ghc | compiler/specialise/Rules.hs | bsd-3-clause | extendRuleInfo :: RuleInfo -> [CoreRule] -> RuleInfo
extendRuleInfo (RuleInfo rs1 fvs1) rs2
= RuleInfo (rs2 ++ rs1) (rulesFreeVarsDSet rs2 `unionDVarSet` fvs1) | 161 | extendRuleInfo :: RuleInfo -> [CoreRule] -> RuleInfo
extendRuleInfo (RuleInfo rs1 fvs1) rs2
= RuleInfo (rs2 ++ rs1) (rulesFreeVarsDSet rs2 `unionDVarSet` fvs1) | 161 | extendRuleInfo (RuleInfo rs1 fvs1) rs2
= RuleInfo (rs2 ++ rs1) (rulesFreeVarsDSet rs2 `unionDVarSet` fvs1) | 108 | false | true | 0 | 10 | 22 | 66 | 32 | 34 | null | null |
lunaris/hindent | src/HIndent/Styles/Cramer.hs | bsd-3-clause | -- Do not modify indent level
extDeclHead :: Extend DeclHead
extDeclHead (DHApp _ dhead var) =
do pretty dhead
space
pretty var | 145 | extDeclHead :: Extend DeclHead
extDeclHead (DHApp _ dhead var) =
do pretty dhead
space
pretty var | 115 | extDeclHead (DHApp _ dhead var) =
do pretty dhead
space
pretty var | 84 | true | true | 0 | 7 | 39 | 43 | 19 | 24 | null | null |
tomjaguarpaw/postgresql-simple | src/Database/PostgreSQL/Simple/TypeInfo/Static.hs | bsd-3-clause | array_varcharOid :: Oid
array_varcharOid = Oid 1015 | 51 | array_varcharOid :: Oid
array_varcharOid = Oid 1015 | 51 | array_varcharOid = Oid 1015 | 27 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
enolan/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | -- this will overwrite already existing definitions
addDef :: Name -> a -> Ctxt a -> Ctxt a
addDef n v ctxt = case Map.lookup (nsroot n) ctxt of
Nothing -> Map.insert (nsroot n)
(Map.insert n v Map.empty) ctxt
Just xs -> Map.insert ... | 824 | addDef :: Name -> a -> Ctxt a -> Ctxt a
addDef n v ctxt = case Map.lookup (nsroot n) ctxt of
Nothing -> Map.insert (nsroot n)
(Map.insert n v Map.empty) ctxt
Just xs -> Map.insert (nsroot n)
(... | 772 | addDef n v ctxt = case Map.lookup (nsroot n) ctxt of
Nothing -> Map.insert (nsroot n)
(Map.insert n v Map.empty) ctxt
Just xs -> Map.insert (nsroot n)
(Map.insert n v xs) ctxt
{-| Look up a n... | 732 | true | true | 0 | 11 | 283 | 126 | 61 | 65 | null | null |
sdiehl/ghc | testsuite/tests/typecheck/should_fail/T17213a.hs | bsd-3-clause | foo :: (forall a. a->a)-> Int
foo x = error "ukr" | 49 | foo :: (forall a. a->a)-> Int
foo x = error "ukr" | 49 | foo x = error "ukr" | 19 | false | true | 0 | 9 | 10 | 39 | 18 | 21 | null | null |
danr/hipspec | src/HipSpec/Lang/Renamer.hs | gpl-3.0 | runRenameM :: Ord b => Suggestor a b -> [b] -> RenameM a b r -> r
runRenameM f block m = evalState (runReaderT m f) (M.empty,S.fromList block) | 142 | runRenameM :: Ord b => Suggestor a b -> [b] -> RenameM a b r -> r
runRenameM f block m = evalState (runReaderT m f) (M.empty,S.fromList block) | 142 | runRenameM f block m = evalState (runReaderT m f) (M.empty,S.fromList block) | 76 | false | true | 0 | 9 | 27 | 78 | 38 | 40 | null | null |
khibino/haskell-hdbc-tool.201303 | src/Database/HDBC/TH.hs | bsd-3-clause | unCapitalize :: String -> String
unCapitalize (c:cs) = toLower c : cs | 69 | unCapitalize :: String -> String
unCapitalize (c:cs) = toLower c : cs | 69 | unCapitalize (c:cs) = toLower c : cs | 36 | false | true | 0 | 7 | 11 | 32 | 16 | 16 | null | null |
bitemyapp/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | htKvmValidDiskTypes :: FrozenSet String
htKvmValidDiskTypes =
ConstantUtils.mkSet [htDiskIde,
htDiskMtd,
htDiskParavirtual,
htDiskPflash,
htDiskScsi,
htDiskSd] | 276 | htKvmValidDiskTypes :: FrozenSet String
htKvmValidDiskTypes =
ConstantUtils.mkSet [htDiskIde,
htDiskMtd,
htDiskParavirtual,
htDiskPflash,
htDiskScsi,
htDiskSd] | 276 | htKvmValidDiskTypes =
ConstantUtils.mkSet [htDiskIde,
htDiskMtd,
htDiskParavirtual,
htDiskPflash,
htDiskScsi,
htDiskSd] | 236 | false | true | 1 | 5 | 129 | 40 | 21 | 19 | null | null |
dec9ue/jhc_copygc | src/Grin/Show.hs | gpl-2.0 | prettyExp vl (BaseOp GcPush xs) = vl <> keyword "gcPush" <+> tupled (map prettyVal xs) | 86 | prettyExp vl (BaseOp GcPush xs) = vl <> keyword "gcPush" <+> tupled (map prettyVal xs) | 86 | prettyExp vl (BaseOp GcPush xs) = vl <> keyword "gcPush" <+> tupled (map prettyVal xs) | 86 | false | false | 0 | 8 | 14 | 43 | 19 | 24 | null | null |
joelwilliamson/validator | Maker.hs | agpl-3.0 | fetchBool = Maker $ \t → case firstChild key of
Maker f -> case f t of
Left e → Left e
Right (Label k) → case k of
"false" → Right False
"no" → Right False
"true" → Right True
"yes" → Right True
_ → Left ((k <> " is not a boolean value.", source t), BadConversion)
Right (Numb... | 428 | fetchBool = Maker $ \t → case firstChild key of
Maker f -> case f t of
Left e → Left e
Right (Label k) → case k of
"false" → Right False
"no" → Right False
"true" → Right True
"yes" → Right True
_ → Left ((k <> " is not a boolean value.", source t), BadConversion)
Right (Numb... | 428 | fetchBool = Maker $ \t → case firstChild key of
Maker f -> case f t of
Left e → Left e
Right (Label k) → case k of
"false" → Right False
"no" → Right False
"true" → Right True
"yes" → Right True
_ → Left ((k <> " is not a boolean value.", source t), BadConversion)
Right (Numb... | 428 | false | false | 0 | 19 | 147 | 173 | 83 | 90 | null | null |
sdiehl/ghc | hadrian/src/Settings.hs | bsd-3-clause | getRtsWays :: Ways
getRtsWays = expr flavour >>= rtsWays | 56 | getRtsWays :: Ways
getRtsWays = expr flavour >>= rtsWays | 56 | getRtsWays = expr flavour >>= rtsWays | 37 | false | true | 0 | 6 | 8 | 18 | 9 | 9 | null | null |
frantisekfarka/ghc-dsi | libraries/base/Data/List.hs | bsd-3-clause | unlines = concatMap (++ "\n") | 46 | unlines = concatMap (++ "\n") | 46 | unlines = concatMap (++ "\n") | 46 | false | false | 0 | 6 | 21 | 13 | 7 | 6 | null | null |
kowey/pandoc-old | src/Text/Pandoc/Writers/Markdown.hs | gpl-2.0 | inlineToMarkdown opts (Quoted SingleQuote lst) = do
contents <- inlineListToMarkdown opts lst
return $ char '\'' <> contents <> char '\'' | 141 | inlineToMarkdown opts (Quoted SingleQuote lst) = do
contents <- inlineListToMarkdown opts lst
return $ char '\'' <> contents <> char '\'' | 141 | inlineToMarkdown opts (Quoted SingleQuote lst) = do
contents <- inlineListToMarkdown opts lst
return $ char '\'' <> contents <> char '\'' | 141 | false | false | 0 | 10 | 24 | 52 | 23 | 29 | null | null |
kernelim/gitomail | src/Gitomail/Maintainers/Base.hs | apache-2.0 | -- Link the lexer and the parser:
lexer :: (Token -> Parser a) -> Parser a
lexer f = alexMonadScan >>= f | 104 | lexer :: (Token -> Parser a) -> Parser a
lexer f = alexMonadScan >>= f | 70 | lexer f = alexMonadScan >>= f | 29 | true | true | 0 | 8 | 21 | 36 | 18 | 18 | null | null |
trobertson/merch | src/Merchandise/Types/Location.hs | bsd-3-clause | -- removes the child designation from a Location
removeChild :: LocationID -> Location -> Location
removeChild lid = children . contains lid .~ True | 148 | removeChild :: LocationID -> Location -> Location
removeChild lid = children . contains lid .~ True | 99 | removeChild lid = children . contains lid .~ True | 49 | true | true | 0 | 7 | 23 | 34 | 17 | 17 | null | null |
sjakobi/brick | src/Brick/BorderMap.hs | bsd-3-clause | -- | Bulk insertion of horizontally-adjacent values. The 'Location' gives the
-- start point, and the 'Run' extends in the "larger columns" direction.
insertH :: Location -> Run a -> BorderMap a -> BorderMap a
insertH = insertDirAgnostic (Edges insertPar insertPar insertPerp insertPerp) . swapLoc
where
swapLoc ... | 510 | insertH :: Location -> Run a -> BorderMap a -> BorderMap a
insertH = insertDirAgnostic (Edges insertPar insertPar insertPerp insertPerp) . swapLoc
where
swapLoc (Location (col, row)) = Location (row, col)
-- | Bulk insertion of vertically-adjacent values. The 'Location' gives the
-- start point, and the 'Run' ... | 359 | insertH = insertDirAgnostic (Edges insertPar insertPar insertPerp insertPerp) . swapLoc
where
swapLoc (Location (col, row)) = Location (row, col)
-- | Bulk insertion of vertically-adjacent values. The 'Location' gives the
-- start point, and the 'Run' extends in the "larger rows" direction. | 300 | true | true | 0 | 8 | 85 | 87 | 45 | 42 | null | null |
abdulrahimnizamani/OccamStar | LogicAgentOld.hs | gpl-2.0 | -- OR truth table
--valid (F :| F) = F
valid (x :| T) = T | 57 | valid (x :| T) = T | 18 | valid (x :| T) = T | 18 | true | false | 0 | 7 | 15 | 18 | 10 | 8 | null | null |
rueshyna/gogol | gogol-identity-toolkit/gen/Network/Google/IdentityToolkit/Types/Product.hs | mpl-2.0 | -- | The full name of the user.
varFullName :: Lens' VerifyAssertionResponse (Maybe Text)
varFullName
= lens _varFullName (\ s a -> s{_varFullName = a}) | 154 | varFullName :: Lens' VerifyAssertionResponse (Maybe Text)
varFullName
= lens _varFullName (\ s a -> s{_varFullName = a}) | 122 | varFullName
= lens _varFullName (\ s a -> s{_varFullName = a}) | 64 | true | true | 1 | 9 | 26 | 52 | 25 | 27 | null | null |
linuborj/cubicaltt | Eval.hs | mit | sndVal u = error $ "sndVal: " ++ show u ++ " is not neutral." | 75 | sndVal u = error $ "sndVal: " ++ show u ++ " is not neutral." | 75 | sndVal u = error $ "sndVal: " ++ show u ++ " is not neutral." | 75 | false | false | 1 | 7 | 28 | 28 | 11 | 17 | null | null |
SWP-Ubau-SoSe2014-Haskell/SWPSoSe14 | src/RailCompiler/Preprocessor.hs | mit | maximize (x:xs) = stretchto (max maxlines maxcols) x:xs
where
stretchto count line = take count (line ++ repeat ' ')
maxlines = maximum $ map length (x:xs)
maxcols = length (x:xs)
-- |Return False iff the first character is a dollar sign. | 251 | maximize (x:xs) = stretchto (max maxlines maxcols) x:xs
where
stretchto count line = take count (line ++ repeat ' ')
maxlines = maximum $ map length (x:xs)
maxcols = length (x:xs)
-- |Return False iff the first character is a dollar sign. | 251 | maximize (x:xs) = stretchto (max maxlines maxcols) x:xs
where
stretchto count line = take count (line ++ repeat ' ')
maxlines = maximum $ map length (x:xs)
maxcols = length (x:xs)
-- |Return False iff the first character is a dollar sign. | 251 | false | false | 0 | 8 | 54 | 98 | 49 | 49 | null | null |
amcphail/hsignal | lib/Numeric/Signal/Multichannel.hs | bsd-3-clause | mapConcurrently :: Storable b
=> (Vector a -> Vector b) -- ^ the function to be mapped
-> Multichannel a -- ^ input data
-> Multichannel b -- ^ output data
mapConcurrently f (MC sr p c _ de fi d) = let d' = mapArrayConcurrently f d
... | 399 | mapConcurrently :: Storable b
=> (Vector a -> Vector b) -- ^ the function to be mapped
-> Multichannel a -- ^ input data
-> Multichannel b
mapConcurrently f (MC sr p c _ de fi d) = let d' = mapArrayConcurrently f d
... | 369 | mapConcurrently f (MC sr p c _ de fi d) = let d' = mapArrayConcurrently f d
in MC sr p c (GV.length $ d' I.! 1) de fi d' | 162 | true | true | 0 | 11 | 183 | 121 | 58 | 63 | null | null |
sdiehl/ghc | libraries/base/GHC/List.hs | bsd-3-clause | take n (x:xs) = x : take (n-1) xs | 43 | take n (x:xs) = x : take (n-1) xs | 43 | take n (x:xs) = x : take (n-1) xs | 43 | false | false | 0 | 8 | 18 | 36 | 17 | 19 | null | null |
tjakway/ghcjvm | compiler/main/DynFlags.hs | bsd-3-clause | pgm_c :: DynFlags -> (String,[Option])
pgm_c dflags = sPgm_c (settings dflags) | 94 | pgm_c :: DynFlags -> (String,[Option])
pgm_c dflags = sPgm_c (settings dflags) | 94 | pgm_c dflags = sPgm_c (settings dflags) | 39 | false | true | 0 | 9 | 26 | 42 | 20 | 22 | null | null |
tidalcycles/Tidal | src/Sound/Tidal/Stream.hs | gpl-3.0 | streamUnmuteAll :: Stream -> IO ()
streamUnmuteAll s = modifyMVar_ (sPMapMV s) $ return . fmap (\x -> x {mute = False}) | 119 | streamUnmuteAll :: Stream -> IO ()
streamUnmuteAll s = modifyMVar_ (sPMapMV s) $ return . fmap (\x -> x {mute = False}) | 119 | streamUnmuteAll s = modifyMVar_ (sPMapMV s) $ return . fmap (\x -> x {mute = False}) | 84 | false | true | 0 | 10 | 21 | 63 | 31 | 32 | null | null |
haskell/haddock | haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | bsd-2-clause | subArguments :: Maybe Package -> Qualification -> [SubDecl] -> Html
subArguments pkg qual = divSubDecls "arguments" "Arguments" . subTable pkg qual | 147 | subArguments :: Maybe Package -> Qualification -> [SubDecl] -> Html
subArguments pkg qual = divSubDecls "arguments" "Arguments" . subTable pkg qual | 147 | subArguments pkg qual = divSubDecls "arguments" "Arguments" . subTable pkg qual | 79 | false | true | 0 | 8 | 20 | 52 | 24 | 28 | null | null |
beni55/haste-compiler | libraries/ghc-7.8/array/Data/Array/Base.hs | bsd-3-clause | dOUBLE_SCALE n# = scale# *# n# where !(I# scale#) = SIZEOF_HSDOUBLE | 67 | dOUBLE_SCALE n# = scale# *# n# where !(I# scale#) = SIZEOF_HSDOUBLE | 67 | dOUBLE_SCALE n# = scale# *# n# where !(I# scale#) = SIZEOF_HSDOUBLE | 67 | false | false | 0 | 9 | 10 | 28 | 13 | 15 | null | null |
markus1189/xmonad-contrib-710 | XMonad/Hooks/Place.hs | bsd-3-clause | r2rr :: Rectangle -> Rectangle -> S.RationalRect
r2rr (Rectangle x0 y0 w0 h0) (Rectangle x y w h)
= S.RationalRect ((fi x-fi x0) % fi w0)
((fi y-fi y0) % fi h0)
(fi w % fi w0)
(fi h % fi h0) | 249 | r2rr :: Rectangle -> Rectangle -> S.RationalRect
r2rr (Rectangle x0 y0 w0 h0) (Rectangle x y w h)
= S.RationalRect ((fi x-fi x0) % fi w0)
((fi y-fi y0) % fi h0)
(fi w % fi w0)
(fi h % fi h0) | 249 | r2rr (Rectangle x0 y0 w0 h0) (Rectangle x y w h)
= S.RationalRect ((fi x-fi x0) % fi w0)
((fi y-fi y0) % fi h0)
(fi w % fi w0)
(fi h % fi h0) | 200 | false | true | 0 | 10 | 100 | 138 | 65 | 73 | null | null |
forste/haReFork | refactorer/RefacUnGuard.hs | bsd-3-clause | replaceRhs u v lc (HsGuard lst) = HsGuard $
map (\(l,e1,e2)->(l,replaceExp u v lc e1,replaceExp u v lc e2))
lst | 173 | replaceRhs u v lc (HsGuard lst) = HsGuard $
map (\(l,e1,e2)->(l,replaceExp u v lc e1,replaceExp u v lc e2))
lst | 173 | replaceRhs u v lc (HsGuard lst) = HsGuard $
map (\(l,e1,e2)->(l,replaceExp u v lc e1,replaceExp u v lc e2))
lst | 173 | false | false | 0 | 10 | 81 | 75 | 39 | 36 | null | null |
narurien/ganeti-ceph | src/Ganeti/Types.hs | gpl-2.0 | -- | Composes a string representation of the LVM storage types
showSULvm :: StorageType -> StorageKey -> SPExclusiveStorage -> String
showSULvm st sk es = show (storageTypeToRaw st, sk, [es]) | 191 | showSULvm :: StorageType -> StorageKey -> SPExclusiveStorage -> String
showSULvm st sk es = show (storageTypeToRaw st, sk, [es]) | 128 | showSULvm st sk es = show (storageTypeToRaw st, sk, [es]) | 57 | true | true | 0 | 7 | 29 | 49 | 26 | 23 | null | null |
jwiegley/ghc-release | utils/haddock/src/Haddock/Interface/Rename.hs | gpl-3.0 | renameForD (ForeignExport lname ltype co x) = do
lname' <- renameL lname
ltype' <- renameLType ltype
return (ForeignExport lname' ltype' co x) | 148 | renameForD (ForeignExport lname ltype co x) = do
lname' <- renameL lname
ltype' <- renameLType ltype
return (ForeignExport lname' ltype' co x) | 148 | renameForD (ForeignExport lname ltype co x) = do
lname' <- renameL lname
ltype' <- renameLType ltype
return (ForeignExport lname' ltype' co x) | 148 | false | false | 0 | 9 | 27 | 59 | 26 | 33 | null | null |
rodrigo-machado/verigraph | src/library/GrLang/Parser.hs | gpl-3.0 | makeIdentifier (c:cs) = prefix c ++ map escapeInvalid (c:cs)
where
prefix c
| Char.isLetter c || c == '_' = ""
| otherwise = "_"
escapeInvalid c
| Char.isAlphaNum c || c == '_' || c == '\'' = c
| otherwise = '_' | 245 | makeIdentifier (c:cs) = prefix c ++ map escapeInvalid (c:cs)
where
prefix c
| Char.isLetter c || c == '_' = ""
| otherwise = "_"
escapeInvalid c
| Char.isAlphaNum c || c == '_' || c == '\'' = c
| otherwise = '_' | 245 | makeIdentifier (c:cs) = prefix c ++ map escapeInvalid (c:cs)
where
prefix c
| Char.isLetter c || c == '_' = ""
| otherwise = "_"
escapeInvalid c
| Char.isAlphaNum c || c == '_' || c == '\'' = c
| otherwise = '_' | 245 | false | false | 0 | 13 | 77 | 117 | 54 | 63 | null | null |
apuchenkin/balls-collision | src/Model.hs | bsd-3-clause | checkBallCollision :: Ball -> Ball -> Bool
checkBallCollision b1 b2 = dist < (r b1 + r b2)
where dist = mag (position b1 ^-^ position b2) | 141 | checkBallCollision :: Ball -> Ball -> Bool
checkBallCollision b1 b2 = dist < (r b1 + r b2)
where dist = mag (position b1 ^-^ position b2) | 141 | checkBallCollision b1 b2 = dist < (r b1 + r b2)
where dist = mag (position b1 ^-^ position b2) | 98 | false | true | 0 | 10 | 30 | 64 | 31 | 33 | null | null |
uduki/hsQt | Qtc/Gui/QStyleOptionTabWidgetFrame.hs | bsd-2-clause | qleftCornerWidgetSize :: QStyleOptionTabWidgetFrame a -> (()) -> IO (QSize ())
qleftCornerWidgetSize x0 ()
= withQSizeResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QStyleOptionTabWidgetFrame_leftCornerWidgetSize cobj_x0 | 227 | qleftCornerWidgetSize :: QStyleOptionTabWidgetFrame a -> (()) -> IO (QSize ())
qleftCornerWidgetSize x0 ()
= withQSizeResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QStyleOptionTabWidgetFrame_leftCornerWidgetSize cobj_x0 | 227 | qleftCornerWidgetSize x0 ()
= withQSizeResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QStyleOptionTabWidgetFrame_leftCornerWidgetSize cobj_x0 | 148 | false | true | 0 | 10 | 32 | 64 | 31 | 33 | null | null |
nomeata/ghc | utils/genapply/GenApply.hs | bsd-3-clause | genStackApply :: RegStatus -> [ArgRep] -> Doc
genStackApply regstatus args =
let fn_entry_label = mkStackApplyEntryLabel args in
vcat [
fn_entry_label,
text "{", nest 4 body, text "}"
]
where
(assign_regs, sp') = loadRegArgs regstatus 0 args
body = vcat [assign_regs,
text "Sp_adj"... | 801 | genStackApply :: RegStatus -> [ArgRep] -> Doc
genStackApply regstatus args =
let fn_entry_label = mkStackApplyEntryLabel args in
vcat [
fn_entry_label,
text "{", nest 4 body, text "}"
]
where
(assign_regs, sp') = loadRegArgs regstatus 0 args
body = vcat [assign_regs,
text "Sp_adj"... | 801 | genStackApply regstatus args =
let fn_entry_label = mkStackApplyEntryLabel args in
vcat [
fn_entry_label,
text "{", nest 4 body, text "}"
]
where
(assign_regs, sp') = loadRegArgs regstatus 0 args
body = vcat [assign_regs,
text "Sp_adj" <> parens (int sp') <> semi,
... | 755 | false | true | 0 | 11 | 181 | 136 | 71 | 65 | null | null |
deepakjois/hs-gchart | Graphics/GChart/DataEncoding.hs | bsd-3-clause | showDecimal :: Float -> String
showDecimal i | makeFloat (truncate i) - i == 0 = show $ truncate i
| otherwise = show (fromIntegral (round (i * 10.0)) / 10.0) | 200 | showDecimal :: Float -> String
showDecimal i | makeFloat (truncate i) - i == 0 = show $ truncate i
| otherwise = show (fromIntegral (round (i * 10.0)) / 10.0) | 200 | showDecimal i | makeFloat (truncate i) - i == 0 = show $ truncate i
| otherwise = show (fromIntegral (round (i * 10.0)) / 10.0) | 169 | false | true | 0 | 13 | 72 | 83 | 39 | 44 | null | null |
nevrenato/HetsAlloy | OMDoc/XmlInterface.hs | gpl-2.0 | listToXml :: XmlRepresentable a => [a] -> [Content]
listToXml = map toXml | 73 | listToXml :: XmlRepresentable a => [a] -> [Content]
listToXml = map toXml | 73 | listToXml = map toXml | 21 | false | true | 0 | 7 | 11 | 31 | 16 | 15 | null | null |
imuli/gitit | Network/Gitit/Framework.hs | gpl-2.0 | isPage ('_':_) = False | 22 | isPage ('_':_) = False | 22 | isPage ('_':_) = False | 22 | false | false | 0 | 7 | 3 | 16 | 8 | 8 | null | null |
corajr/scalar-convert | test/Text/Pandoc/Readers/ScalarSpec.hs | bsd-3-clause | noteSpan :: Inline
noteSpan = Span ("",["note"],[("rev","scalar:has_note"),("resource","note-on-notes")]) [Str "notes"] | 119 | noteSpan :: Inline
noteSpan = Span ("",["note"],[("rev","scalar:has_note"),("resource","note-on-notes")]) [Str "notes"] | 119 | noteSpan = Span ("",["note"],[("rev","scalar:has_note"),("resource","note-on-notes")]) [Str "notes"] | 100 | false | true | 0 | 8 | 8 | 52 | 31 | 21 | null | null |
tomtitchener/RealSimpleMusic | src/Music/RealSimpleMusic/Music/Data.hs | cc0-1.0 | scaleToAscendingPitchClasses :: Scale -> [PitchClass]
scaleToAscendingPitchClasses = ascendingScale | 99 | scaleToAscendingPitchClasses :: Scale -> [PitchClass]
scaleToAscendingPitchClasses = ascendingScale | 99 | scaleToAscendingPitchClasses = ascendingScale | 45 | false | true | 0 | 6 | 7 | 18 | 10 | 8 | null | null |
ProLambda/Times | Utilities/Msg/Mailbox.hs | gpl-3.0 | connStr = "dbname=tutorial host=localhost user=tutorial password=tutorial port=5432" | 84 | connStr = "dbname=tutorial host=localhost user=tutorial password=tutorial port=5432" | 84 | connStr = "dbname=tutorial host=localhost user=tutorial password=tutorial port=5432" | 84 | false | false | 1 | 5 | 6 | 10 | 3 | 7 | null | null |
ulricha/dsh | src/Database/DSH/VSL/Builtins.hs | bsd-3-clause | nub :: UnVectMacro
nub dv l = do
v <- C.distinct (dvPhysVec dv)
return (dv { dvPhysVec = v }, l)
--------------------------------------------------------------------------------
-- reverse | 197 | nub :: UnVectMacro
nub dv l = do
v <- C.distinct (dvPhysVec dv)
return (dv { dvPhysVec = v }, l)
--------------------------------------------------------------------------------
-- reverse | 197 | nub dv l = do
v <- C.distinct (dvPhysVec dv)
return (dv { dvPhysVec = v }, l)
--------------------------------------------------------------------------------
-- reverse | 178 | false | true | 0 | 11 | 32 | 62 | 30 | 32 | null | null |
juretta/course | src/L03/Parser.hs | bsd-3-clause | -- Exercise 19
-- Write a parser for Person.
-- ~~~ Use bindParser, value, (>>>)
-- ageParser,
-- firstNameParser,
-- surnameParser,
-- genderParser,
-- phoneParser ~~~
personParser :: Parser Person
personParser = error "todo" | 266 | personParser :: Parser Person
personParser = error "todo" | 57 | personParser = error "todo" | 27 | true | true | 0 | 6 | 73 | 31 | 17 | 14 | null | null |
rrnewton/stack | src/Stack/Types/Config.hs | bsd-3-clause | packageDatabaseDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
packageDatabaseDeps = do
root <- installationRootDeps
return $ root </> $(mkRelDir "pkgdb")
-- | Package database for installing local packages into | 252 | packageDatabaseDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
packageDatabaseDeps = do
root <- installationRootDeps
return $ root </> $(mkRelDir "pkgdb")
-- | Package database for installing local packages into | 252 | packageDatabaseDeps = do
root <- installationRootDeps
return $ root </> $(mkRelDir "pkgdb")
-- | Package database for installing local packages into | 157 | false | true | 0 | 10 | 43 | 71 | 35 | 36 | null | null |
ademinn/JavaWithClasses | src/Native.hs | bsd-3-clause | constants :: [(String, T.Type, C.Constant)]
constants = map f
[ (intWF, "%d\n")
, (longWF, "%ld\n")
, (doubleWF, "%f\n")
, (byteRF, "%hhd")
, (shortRF, "%hd")
, (intRF, "%d")
, (longRF, "%lld")
, (floatRF, "%f")
, (doubleRF, "%lf")
]
wh... | 432 | constants :: [(String, T.Type, C.Constant)]
constants = map f
[ (intWF, "%d\n")
, (longWF, "%ld\n")
, (doubleWF, "%f\n")
, (byteRF, "%hhd")
, (shortRF, "%hd")
, (intRF, "%d")
, (longRF, "%lld")
, (floatRF, "%f")
, (doubleRF, "%lf")
]
wh... | 432 | constants = map f
[ (intWF, "%d\n")
, (longWF, "%ld\n")
, (doubleWF, "%f\n")
, (byteRF, "%hhd")
, (shortRF, "%hd")
, (intRF, "%d")
, (longRF, "%lld")
, (floatRF, "%f")
, (doubleRF, "%lf")
]
where
f (name, str) =
let ... | 388 | false | true | 0 | 11 | 169 | 176 | 102 | 74 | null | null |
GaloisInc/saw-script | saw-core/src/Verifier/SAW/Simulator/Prims.hs | bsd-3-clause | -- | Call this function to indicate that a programming error has
-- occurred, e.g. a datatype invariant has been violated.
panic :: HasCallStack => String -> a
panic msg = Panic.panic "Verifier.SAW.Simulator.Prims" [msg] | 220 | panic :: HasCallStack => String -> a
panic msg = Panic.panic "Verifier.SAW.Simulator.Prims" [msg] | 97 | panic msg = Panic.panic "Verifier.SAW.Simulator.Prims" [msg] | 60 | true | true | 0 | 8 | 33 | 41 | 19 | 22 | null | null |
nfjinjing/mps | src/MPS/Math/Six.hs | bsd-3-clause | synthesize [] _ _ = [] | 22 | synthesize [] _ _ = [] | 22 | synthesize [] _ _ = [] | 22 | false | false | 1 | 6 | 5 | 19 | 8 | 11 | null | null |
Concomitant/LambdaHack | Game/LambdaHack/Client/AI/ConditionClient.hs | bsd-3-clause | condEnoughGearM :: MonadClient m => ActorId -> m Bool
condEnoughGearM aid = do
eqpAssocs <- fullAssocsClient aid [CEqp]
invAssocs <- fullAssocsClient aid [CInv]
return $ any (isMelee . snd) eqpAssocs
|| length (eqpAssocs ++ invAssocs) >= 5
-- keep it lazy
-- | Require that the actor can project an... | 328 | condEnoughGearM :: MonadClient m => ActorId -> m Bool
condEnoughGearM aid = do
eqpAssocs <- fullAssocsClient aid [CEqp]
invAssocs <- fullAssocsClient aid [CInv]
return $ any (isMelee . snd) eqpAssocs
|| length (eqpAssocs ++ invAssocs) >= 5
-- keep it lazy
-- | Require that the actor can project an... | 328 | condEnoughGearM aid = do
eqpAssocs <- fullAssocsClient aid [CEqp]
invAssocs <- fullAssocsClient aid [CInv]
return $ any (isMelee . snd) eqpAssocs
|| length (eqpAssocs ++ invAssocs) >= 5
-- keep it lazy
-- | Require that the actor can project any items. | 274 | false | true | 0 | 12 | 72 | 97 | 47 | 50 | null | null |
rfranek/duckling | Duckling/Email/FR/Rules.hs | bsd-3-clause | rules :: [Rule]
rules =
[ ruleEmailSpelledOut
] | 51 | rules :: [Rule]
rules =
[ ruleEmailSpelledOut
] | 51 | rules =
[ ruleEmailSpelledOut
] | 35 | false | true | 0 | 5 | 11 | 17 | 10 | 7 | null | null |
GaloisInc/halvm-ghc | compiler/utils/Util.hs | bsd-3-clause | getCmd :: String -> Either String -- Error
(String, String) -- (Cmd, Rest)
getCmd s = case break isSpace $ dropWhile isSpace s of
([], _) -> Left ("Couldn't find command in " ++ show s)
res -> Right res | 263 | getCmd :: String -> Either String -- Error
(String, String)
getCmd s = case break isSpace $ dropWhile isSpace s of
([], _) -> Left ("Couldn't find command in " ++ show s)
res -> Right res | 248 | getCmd s = case break isSpace $ dropWhile isSpace s of
([], _) -> Left ("Couldn't find command in " ++ show s)
res -> Right res | 149 | true | true | 0 | 11 | 100 | 87 | 43 | 44 | null | null |
duplode/stack | src/Options/Applicative/Builder/Extra.hs | bsd-3-clause | -- | Enable/disable flags for a @(Maybe Bool)@.
maybeBoolFlags :: String -> String -> Mod FlagFields (Maybe Bool) -> Parser (Maybe Bool)
maybeBoolFlags = enableDisableFlags Nothing (Just True) (Just False) | 205 | maybeBoolFlags :: String -> String -> Mod FlagFields (Maybe Bool) -> Parser (Maybe Bool)
maybeBoolFlags = enableDisableFlags Nothing (Just True) (Just False) | 157 | maybeBoolFlags = enableDisableFlags Nothing (Just True) (Just False) | 68 | true | true | 0 | 10 | 29 | 63 | 31 | 32 | null | null |
bjpop/haskell-mpi | test/StorableArrayTests.hs | bsd-3-clause | reduceTest myRank = do
numProcs <- commSize commWorld
(src :: ArrMsg) <- newListArray (0,99) [0..99]
if myRank /= root
then reduceSend commWorld root sumOp src
else do
(result :: ArrMsg) <- intoNewArray_ (0,99) $ reduceRecv commWorld root sumOp src
recvMsg <- getElems result
let expected = map... | 425 | reduceTest myRank = do
numProcs <- commSize commWorld
(src :: ArrMsg) <- newListArray (0,99) [0..99]
if myRank /= root
then reduceSend commWorld root sumOp src
else do
(result :: ArrMsg) <- intoNewArray_ (0,99) $ reduceRecv commWorld root sumOp src
recvMsg <- getElems result
let expected = map... | 425 | reduceTest myRank = do
numProcs <- commSize commWorld
(src :: ArrMsg) <- newListArray (0,99) [0..99]
if myRank /= root
then reduceSend commWorld root sumOp src
else do
(result :: ArrMsg) <- intoNewArray_ (0,99) $ reduceRecv commWorld root sumOp src
recvMsg <- getElems result
let expected = map... | 425 | false | false | 0 | 14 | 95 | 171 | 83 | 88 | null | null |
thielema/gitit | Network/Gitit/Layout.hs | gpl-2.0 | linkForTab tabli base' page rev EditTab =
tabli EditTab << anchor !
[href $ base' ++ "/_edit" ++ urlForPage page ++
case rev of
Just r -> "?revision=" ++ r ++ "&" ++
urlEncodeVars [("logMsg", "Revert to " ++ r)]
Nothing -> ""] << if... | 442 | linkForTab tabli base' page rev EditTab =
tabli EditTab << anchor !
[href $ base' ++ "/_edit" ++ urlForPage page ++
case rev of
Just r -> "?revision=" ++ r ++ "&" ++
urlEncodeVars [("logMsg", "Revert to " ++ r)]
Nothing -> ""] << if... | 442 | linkForTab tabli base' page rev EditTab =
tabli EditTab << anchor !
[href $ base' ++ "/_edit" ++ urlForPage page ++
case rev of
Just r -> "?revision=" ++ r ++ "&" ++
urlEncodeVars [("logMsg", "Revert to " ++ r)]
Nothing -> ""] << if... | 442 | false | false | 2 | 16 | 220 | 115 | 56 | 59 | null | null |
brunjlar/protop | src/Protop/Logic/Builder.hs | mit | popM :: Monad m => M m ()
popM = do
sc <- S.get
case headTail sc of
Nothing -> fail "can't pop empty scope"
Just (_, sc') -> S.put sc' | 160 | popM :: Monad m => M m ()
popM = do
sc <- S.get
case headTail sc of
Nothing -> fail "can't pop empty scope"
Just (_, sc') -> S.put sc' | 160 | popM = do
sc <- S.get
case headTail sc of
Nothing -> fail "can't pop empty scope"
Just (_, sc') -> S.put sc' | 134 | false | true | 0 | 11 | 56 | 73 | 34 | 39 | null | null |
RefactoringTools/HaRe | hareview/src/Language/Hareview/GUIActions.hs | bsd-3-clause | actionGetSrcLoc :: Area -> AstAction TreePath
actionGetSrcLoc a ref = do
tv <- getTreeView a ref
gui <- getGui ref
(CursorP l r) <- getCursorPosition a ref
-- reparse and set cursor in treeview
maybeLang <- getLanguage a ref
case maybeLang of
Nothing -> return []
Just lang -> do
t <- actionPa... | 900 | actionGetSrcLoc :: Area -> AstAction TreePath
actionGetSrcLoc a ref = do
tv <- getTreeView a ref
gui <- getGui ref
(CursorP l r) <- getCursorPosition a ref
-- reparse and set cursor in treeview
maybeLang <- getLanguage a ref
case maybeLang of
Nothing -> return []
Just lang -> do
t <- actionPa... | 900 | actionGetSrcLoc a ref = do
tv <- getTreeView a ref
gui <- getGui ref
(CursorP l r) <- getCursorPosition a ref
-- reparse and set cursor in treeview
maybeLang <- getLanguage a ref
case maybeLang of
Nothing -> return []
Just lang -> do
t <- actionParse a lang ref
let sl = sourceLocations ... | 854 | false | true | 0 | 20 | 271 | 311 | 147 | 164 | null | null |
spechub/Hets | Proofs/Composition.hs | gpl-2.0 | handleConservativityMono :: LEdge DGLinkLab -> [LEdge DGLinkLab]
-> Maybe (LEdge DGLinkLab, [LEdge DGLinkLab])
handleConservativityMono newEdge path =
case calculateMorphismOfPath path of
Nothing -> Nothing
Just morph -> if isTransportable morph then Just (newEdge, path)
... | 338 | handleConservativityMono :: LEdge DGLinkLab -> [LEdge DGLinkLab]
-> Maybe (LEdge DGLinkLab, [LEdge DGLinkLab])
handleConservativityMono newEdge path =
case calculateMorphismOfPath path of
Nothing -> Nothing
Just morph -> if isTransportable morph then Just (newEdge, path)
... | 338 | handleConservativityMono newEdge path =
case calculateMorphismOfPath path of
Nothing -> Nothing
Just morph -> if isTransportable morph then Just (newEdge, path)
else Nothing | 202 | false | true | 0 | 10 | 89 | 93 | 46 | 47 | null | null |
keera-studios/hsQt | Qtc/Enums/Gui/QPrinter.hs | bsd-2-clause | eLetter :: PageSize
eLetter
= iePageSize $ 2 | 46 | eLetter :: PageSize
eLetter
= iePageSize $ 2 | 46 | eLetter
= iePageSize $ 2 | 26 | false | true | 2 | 6 | 9 | 23 | 9 | 14 | null | null |
brendanhay/gogol | gogol-appengine/gen/Network/Google/AppEngine/Types/Product.hs | mpl-2.0 | -- | Target scaling by CPU usage.
asCPUUtilization :: Lens' AutomaticScaling (Maybe CPUUtilization)
asCPUUtilization
= lens _asCPUUtilization
(\ s a -> s{_asCPUUtilization = a}) | 185 | asCPUUtilization :: Lens' AutomaticScaling (Maybe CPUUtilization)
asCPUUtilization
= lens _asCPUUtilization
(\ s a -> s{_asCPUUtilization = a}) | 151 | asCPUUtilization
= lens _asCPUUtilization
(\ s a -> s{_asCPUUtilization = a}) | 85 | true | true | 1 | 9 | 31 | 52 | 25 | 27 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.