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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
markuspf/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | showCG (MN _ u) | u == txt "underscore" = "_" | 45 | showCG (MN _ u) | u == txt "underscore" = "_" | 45 | showCG (MN _ u) | u == txt "underscore" = "_" | 45 | false | false | 0 | 9 | 10 | 31 | 13 | 18 | null | null |
tolysz/hiccup | attic/Hash.hs | lgpl-2.1 | mainhash :: B.ByteString -> Int
mainhash !s = B.foldl' (\i c -> ((i `shiftL` 5) + i) `xor` ord c) 5381 s | 104 | mainhash :: B.ByteString -> Int
mainhash !s = B.foldl' (\i c -> ((i `shiftL` 5) + i) `xor` ord c) 5381 s | 104 | mainhash !s = B.foldl' (\i c -> ((i `shiftL` 5) + i) `xor` ord c) 5381 s | 72 | false | true | 0 | 12 | 21 | 65 | 35 | 30 | null | null |
vikraman/ghc | compiler/rename/RnBinds.hs | bsd-3-clause | {-
************************************************************************
* *
\subsubsection{Guarded right-hand sides (GRHSs)}
* *
*************************************************... | 768 | rnGRHSs :: HsMatchContext Name
-> (Located (body RdrName) -> RnM (Located (body Name), FreeVars))
-> GRHSs RdrName (Located (body RdrName))
-> RnM (GRHSs Name (Located (body Name)), FreeVars)
rnGRHSs ctxt rnBody (GRHSs grhss (L l binds))
= rnLocalBindsAndThen binds $ \ binds' _ -> do
(gr... | 420 | rnGRHSs ctxt rnBody (GRHSs grhss (L l binds))
= rnLocalBindsAndThen binds $ \ binds' _ -> do
(grhss', fvGRHSs) <- mapFvRn (rnGRHS ctxt rnBody) grhss
return (GRHSs grhss' (L l binds'), fvGRHSs) | 204 | true | true | 0 | 14 | 246 | 192 | 95 | 97 | null | null |
utky/lycopene | src/Lycopene/Freer.hs | apache-2.0 | liftR :: f a -> Freer f a
liftR = liftF . Coyoneda id | 53 | liftR :: f a -> Freer f a
liftR = liftF . Coyoneda id | 53 | liftR = liftF . Coyoneda id | 27 | false | true | 0 | 7 | 13 | 35 | 15 | 20 | null | null |
seagreen/station | src/Station/Types/Card/Hardcoded.hs | mit | cardSchemaId :: Id
cardSchemaId = unsafeId "a7917e8d-8ef3-44d0-bb27-f2ac0edc3851" | 81 | cardSchemaId :: Id
cardSchemaId = unsafeId "a7917e8d-8ef3-44d0-bb27-f2ac0edc3851" | 81 | cardSchemaId = unsafeId "a7917e8d-8ef3-44d0-bb27-f2ac0edc3851" | 62 | false | true | 0 | 6 | 6 | 20 | 8 | 12 | null | null |
tonymorris/osmaustralia | Main.hs | bsd-3-clause | main ::
IO ()
main =
do a <- getArgs
case a of
[] -> putStrLn "Usage: osmgarmin <output-dir>" >> exitWith (exitCode 107)
(o:_) -> do e <- gmapsupp [minBound .. maxBound] (\st p -> let o' = o </> show st
in do mkdir o'
... | 463 | main ::
IO ()
main =
do a <- getArgs
case a of
[] -> putStrLn "Usage: osmgarmin <output-dir>" >> exitWith (exitCode 107)
(o:_) -> do e <- gmapsupp [minBound .. maxBound] (\st p -> let o' = o </> show st
in do mkdir o'
... | 463 | main =
do a <- getArgs
case a of
[] -> putStrLn "Usage: osmgarmin <output-dir>" >> exitWith (exitCode 107)
(o:_) -> do e <- gmapsupp [minBound .. maxBound] (\st p -> let o' = o </> show st
in do mkdir o'
... | 447 | false | true | 0 | 26 | 236 | 157 | 73 | 84 | null | null |
tamarin-prover/tamarin-prover | lib/term/src/Term/Builtin/Convenience.hs | gpl-3.0 | fx4 = freshVar "fx" 4 | 22 | fx4 = freshVar "fx" 4 | 22 | fx4 = freshVar "fx" 4 | 22 | false | false | 1 | 5 | 5 | 14 | 5 | 9 | null | null |
fffej/codekatas | POFAD/smallestfreenumber/SmallestFreeNumber.hs | mit | minFree2 :: [Int] -> Int
minFree2 = search . checklist | 54 | minFree2 :: [Int] -> Int
minFree2 = search . checklist | 54 | minFree2 = search . checklist | 29 | false | true | 0 | 6 | 9 | 22 | 12 | 10 | null | null |
dmwit/pi-eta-epsilon | tests/Main.hs | bsd-3-clause | sp f g (x, y, z) = sp' f g x y z | 32 | sp f g (x, y, z) = sp' f g x y z | 32 | sp f g (x, y, z) = sp' f g x y z | 32 | false | false | 0 | 6 | 12 | 35 | 17 | 18 | null | null |
nevrenato/HetsAlloy | QBF/AS_BASIC_QBF.der.hs | gpl-2.0 | printSymbItems :: SYMBITEMS -> Doc
printSymbItems (SymbItems xs _) = fsep $ map pretty xs | 89 | printSymbItems :: SYMBITEMS -> Doc
printSymbItems (SymbItems xs _) = fsep $ map pretty xs | 89 | printSymbItems (SymbItems xs _) = fsep $ map pretty xs | 54 | false | true | 0 | 7 | 14 | 35 | 17 | 18 | null | null |
brendanhay/gogol | gogol-tpu/gen/Network/Google/Resource/TPU/Projects/Locations/Nodes/Create.hs | mpl-2.0 | -- | JSONP
plncCallback :: Lens' ProjectsLocationsNodesCreate (Maybe Text)
plncCallback
= lens _plncCallback (\ s a -> s{_plncCallback = a}) | 142 | plncCallback :: Lens' ProjectsLocationsNodesCreate (Maybe Text)
plncCallback
= lens _plncCallback (\ s a -> s{_plncCallback = a}) | 131 | plncCallback
= lens _plncCallback (\ s a -> s{_plncCallback = a}) | 67 | true | true | 0 | 9 | 21 | 48 | 25 | 23 | null | null |
hekt/blog-system | src/Web/Kirstie/Server.hs | mit | params2aid :: [Param] -> Maybe ArticleId
params2aid ps = "aid" `lookup` ps >>= safeRead . TL.unpack | 99 | params2aid :: [Param] -> Maybe ArticleId
params2aid ps = "aid" `lookup` ps >>= safeRead . TL.unpack | 99 | params2aid ps = "aid" `lookup` ps >>= safeRead . TL.unpack | 58 | false | true | 0 | 7 | 15 | 40 | 21 | 19 | null | null |
junnf/Functional-Programming | codes/safefunctions.hs | unlicense | safeInit :: [a] -> Maybe [a]
safeInit [] = Nothing | 50 | safeInit :: [a] -> Maybe [a]
safeInit [] = Nothing | 50 | safeInit [] = Nothing | 21 | false | true | 0 | 7 | 9 | 29 | 15 | 14 | null | null |
GaloisInc/SpreadsheetML | test.hs | bsd-3-clause | cells1 = [ [string "Quantity", string "Multiplier", string "Product"]
, [number 1, number 0.9, formula "=RC[-2]*RC[-1]"]
, [number 10, number 1.1, formula "=RC[-2]*RC[-1]"]
, [number 12, number 0.2, formula "=RC[-2]*RC[-1]"]
] | 314 | cells1 = [ [string "Quantity", string "Multiplier", string "Product"]
, [number 1, number 0.9, formula "=RC[-2]*RC[-1]"]
, [number 10, number 1.1, formula "=RC[-2]*RC[-1]"]
, [number 12, number 0.2, formula "=RC[-2]*RC[-1]"]
] | 314 | cells1 = [ [string "Quantity", string "Multiplier", string "Product"]
, [number 1, number 0.9, formula "=RC[-2]*RC[-1]"]
, [number 10, number 1.1, formula "=RC[-2]*RC[-1]"]
, [number 12, number 0.2, formula "=RC[-2]*RC[-1]"]
] | 314 | false | false | 0 | 7 | 118 | 90 | 47 | 43 | null | null |
YtGz/Analyzing-the-Complexity-of-Monotone-Prolog | src/SymbolicEvaluationGraphs/Heuristic.hs | lgpl-3.0 | firstChild' :: TreePos Full a -> TreePos Full a
firstChild' = fromJust . firstChild | 83 | firstChild' :: TreePos Full a -> TreePos Full a
firstChild' = fromJust . firstChild | 83 | firstChild' = fromJust . firstChild | 35 | false | true | 0 | 6 | 13 | 29 | 14 | 15 | null | null |
acowley/Dogleg | src/Numeric/Dogleg.hs | bsd-3-clause | updateBasis :: (Floating a, Ord t, Epsilon a, Metric f, Show (f a)) =>
SearchParams a -> [f a] -> [t] -> f a -> [f a]
updateBasis sp basis gains goodDir =
if dropBestBasis sp
then let (_,i) = maximum $ zip gains [0..]
in take i basis ++ goodDir:drop (i+1) basis
else basis | 302 | updateBasis :: (Floating a, Ord t, Epsilon a, Metric f, Show (f a)) =>
SearchParams a -> [f a] -> [t] -> f a -> [f a]
updateBasis sp basis gains goodDir =
if dropBestBasis sp
then let (_,i) = maximum $ zip gains [0..]
in take i basis ++ goodDir:drop (i+1) basis
else basis | 302 | updateBasis sp basis gains goodDir =
if dropBestBasis sp
then let (_,i) = maximum $ zip gains [0..]
in take i basis ++ goodDir:drop (i+1) basis
else basis | 169 | false | true | 0 | 12 | 84 | 162 | 81 | 81 | null | null |
andorp/bead | src/Bead/View/Content/Bootstrap.hs | bsd-3-clause | -- | Creates a submit small button with a given name and the given text
smallSubmitButton nameValue text =
button ! type_ "submit"
! (name $ fromString nameValue)
! class_ "btn btn-default"
$ fromString text | 236 | smallSubmitButton nameValue text =
button ! type_ "submit"
! (name $ fromString nameValue)
! class_ "btn btn-default"
$ fromString text | 164 | smallSubmitButton nameValue text =
button ! type_ "submit"
! (name $ fromString nameValue)
! class_ "btn btn-default"
$ fromString text | 164 | true | false | 0 | 10 | 63 | 47 | 22 | 25 | null | null |
teleshoes/taffybar | src/System/Taffybar/Widget/DiskIOMonitor.hs | bsd-3-clause | probeDisk :: String -> IO [Double]
probeDisk disk = do
transfer <- getDiskTransfer disk
let top = foldr max 1.0 transfer
return $ map (/top) transfer | 155 | probeDisk :: String -> IO [Double]
probeDisk disk = do
transfer <- getDiskTransfer disk
let top = foldr max 1.0 transfer
return $ map (/top) transfer | 155 | probeDisk disk = do
transfer <- getDiskTransfer disk
let top = foldr max 1.0 transfer
return $ map (/top) transfer | 120 | false | true | 0 | 10 | 31 | 66 | 31 | 35 | null | null |
siddhanathan/yi | yi-frontend-vty/src/Yi/Frontend/Vty.hs | gpl-2.0 | requestRefresh :: FrontendState -> Editor -> IO ()
requestRefresh fs e = do
writeIORef (fsEditorRef fs) e
void $ tryPutMVar (fsDirty fs) () | 147 | requestRefresh :: FrontendState -> Editor -> IO ()
requestRefresh fs e = do
writeIORef (fsEditorRef fs) e
void $ tryPutMVar (fsDirty fs) () | 147 | requestRefresh fs e = do
writeIORef (fsEditorRef fs) e
void $ tryPutMVar (fsDirty fs) () | 96 | false | true | 0 | 11 | 30 | 68 | 30 | 38 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_TEXTURE_MAX_LEVEL_SGIS :: GLenum
gl_TEXTURE_MAX_LEVEL_SGIS = 0x813D | 70 | gl_TEXTURE_MAX_LEVEL_SGIS :: GLenum
gl_TEXTURE_MAX_LEVEL_SGIS = 0x813D | 70 | gl_TEXTURE_MAX_LEVEL_SGIS = 0x813D | 34 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
HSU-MilitaryLogisticsClub/Free-Test | src/bmphask/bmpread24.hs | mit | --if and [(rsInt r) >= 128 , (rsInt b) < 100 , (rsInt g) < 100]
-- then [b,g,r]
-- else [0,0,0]
bgr2Red as = as | 157 | bgr2Red as = as | 15 | bgr2Red as = as | 15 | true | false | 0 | 5 | 71 | 12 | 7 | 5 | null | null |
nevrenato/HetsAlloy | CASL/AS_Basic_CASL.der.hs | gpl-2.0 | mkEqv :: FORMULA f -> FORMULA f -> FORMULA f
mkEqv = mkRel Equivalence | 70 | mkEqv :: FORMULA f -> FORMULA f -> FORMULA f
mkEqv = mkRel Equivalence | 70 | mkEqv = mkRel Equivalence | 25 | false | true | 0 | 7 | 13 | 31 | 14 | 17 | null | null |
UBMLtonGroup/timberc | src/Desugar2.hs | bsd-3-clause | dsQual (PType t) = PType (dsQualPred t) | 54 | dsQual (PType t) = PType (dsQualPred t) | 54 | dsQual (PType t) = PType (dsQualPred t) | 54 | false | false | 0 | 7 | 21 | 24 | 11 | 13 | null | null |
benekastah/ebitor | src/Ebitor/Rope.hs | bsd-3-clause | defaultChunkSize :: Int
defaultChunkSize = 1200 | 47 | defaultChunkSize :: Int
defaultChunkSize = 1200 | 47 | defaultChunkSize = 1200 | 23 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
Knewton/rifactor | src/Rifactor/AWS.hs | apache-2.0 | isMergeable _ _ = False | 23 | isMergeable _ _ = False | 23 | isMergeable _ _ = False | 23 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
anton-dessiatov/stack | src/Stack/Config.hs | bsd-3-clause | makeConcreteResolver root ar = do
snapshots <- getSnapshots
r <-
case ar of
ARResolver r -> assert False $ makeConcreteResolver root $ ARResolver r
ARGlobal -> do
config <- view configL
implicitGlobalDir <- getImplicitGlobalProjectDir config
... | 1,315 | makeConcreteResolver root ar = do
snapshots <- getSnapshots
r <-
case ar of
ARResolver r -> assert False $ makeConcreteResolver root $ ARResolver r
ARGlobal -> do
config <- view configL
implicitGlobalDir <- getImplicitGlobalProjectDir config
... | 1,315 | makeConcreteResolver root ar = do
snapshots <- getSnapshots
r <-
case ar of
ARResolver r -> assert False $ makeConcreteResolver root $ ARResolver r
ARGlobal -> do
config <- view configL
implicitGlobalDir <- getImplicitGlobalProjectDir config
... | 1,315 | false | false | 0 | 18 | 461 | 312 | 139 | 173 | null | null |
spacekitteh/smcghc | libraries/bin-package-db/GHC/PackageDb.hs | bsd-3-clause | readPackageDbForGhcPkg :: Binary pkgs => FilePath -> IO pkgs
readPackageDbForGhcPkg file =
decodeFromFile file getDbForGhcPkg
where
getDbForGhcPkg = do
_version <- getHeader
-- skip over the ghc part
ghcPartLen <- get :: Get Word32
_ghcPart <- skip (fromIntegral ghcPartLen)
... | 458 | readPackageDbForGhcPkg :: Binary pkgs => FilePath -> IO pkgs
readPackageDbForGhcPkg file =
decodeFromFile file getDbForGhcPkg
where
getDbForGhcPkg = do
_version <- getHeader
-- skip over the ghc part
ghcPartLen <- get :: Get Word32
_ghcPart <- skip (fromIntegral ghcPartLen)
... | 458 | readPackageDbForGhcPkg file =
decodeFromFile file getDbForGhcPkg
where
getDbForGhcPkg = do
_version <- getHeader
-- skip over the ghc part
ghcPartLen <- get :: Get Word32
_ghcPart <- skip (fromIntegral ghcPartLen)
-- the next part is for ghc-pkg
ghcPkgPart <- get
... | 397 | false | true | 0 | 10 | 123 | 94 | 44 | 50 | null | null |
silkapp/tagsoup | Text/HTML/TagSoup/Implementation.hs | bsd-3-clause | fromWarn (_,Warn x:_) = Just x | 30 | fromWarn (_,Warn x:_) = Just x | 30 | fromWarn (_,Warn x:_) = Just x | 30 | false | false | 0 | 8 | 5 | 25 | 12 | 13 | null | null |
tphyahoo/haskoin-wallet | Network/Haskoin/Wallet/Client/Commands.hs | unlicense | cmdRescan :: [String] -> Handler ()
cmdRescan timeLs =
sendZmq (PostNodeR $ NodeActionRescan timeM) $ \(RescanRes ts) ->
putStrLn $ unwords [ "Timestamp:", show ts]
where
timeM = read <$> listToMaybe timeLs | 224 | cmdRescan :: [String] -> Handler ()
cmdRescan timeLs =
sendZmq (PostNodeR $ NodeActionRescan timeM) $ \(RescanRes ts) ->
putStrLn $ unwords [ "Timestamp:", show ts]
where
timeM = read <$> listToMaybe timeLs | 224 | cmdRescan timeLs =
sendZmq (PostNodeR $ NodeActionRescan timeM) $ \(RescanRes ts) ->
putStrLn $ unwords [ "Timestamp:", show ts]
where
timeM = read <$> listToMaybe timeLs | 188 | false | true | 7 | 8 | 49 | 96 | 43 | 53 | null | null |
frublox/aichanbot | src/Command/Parser.hs | bsd-3-clause | unprefixedCommandP :: Monad m => (Text -> m (Maybe Command)) -> ParserM m Command
unprefixedCommandP resolveCmd = do
cmdName <- many alphaNumChar
result <- lift $ resolveCmd (Text.pack cmdName)
case result of
Nothing -> fail ("Couldn't resolve command: " <> cmdName)
Just cmd -> pure cmd | 316 | unprefixedCommandP :: Monad m => (Text -> m (Maybe Command)) -> ParserM m Command
unprefixedCommandP resolveCmd = do
cmdName <- many alphaNumChar
result <- lift $ resolveCmd (Text.pack cmdName)
case result of
Nothing -> fail ("Couldn't resolve command: " <> cmdName)
Just cmd -> pure cmd | 316 | unprefixedCommandP resolveCmd = do
cmdName <- many alphaNumChar
result <- lift $ resolveCmd (Text.pack cmdName)
case result of
Nothing -> fail ("Couldn't resolve command: " <> cmdName)
Just cmd -> pure cmd | 234 | false | true | 0 | 13 | 74 | 117 | 53 | 64 | null | null |
cblp/tasknight-dashboard | ff/exe/Main.hs | gpl-3.0 | loadKey :: MonadIO io => io Key
loadKey = Key <$> readCacheItem "key" | 69 | loadKey :: MonadIO io => io Key
loadKey = Key <$> readCacheItem "key" | 69 | loadKey = Key <$> readCacheItem "key" | 37 | false | true | 0 | 6 | 12 | 28 | 13 | 15 | null | null |
brendanhay/gogol | gogol-websecurityscanner/gen/Network/Google/WebSecurityScanner/Types/Product.hs | mpl-2.0 | -- | The excluded URL patterns as described in
-- https:\/\/cloud.google.com\/security-command-center\/docs\/how-to-use-web-security-scanner#excluding_urls
scBlackListPatterns :: Lens' ScanConfig [Text]
scBlackListPatterns
= lens _scBlackListPatterns
(\ s a -> s{_scBlackListPatterns = a})
. _Default
... | 330 | scBlackListPatterns :: Lens' ScanConfig [Text]
scBlackListPatterns
= lens _scBlackListPatterns
(\ s a -> s{_scBlackListPatterns = a})
. _Default
. _Coerce | 174 | scBlackListPatterns
= lens _scBlackListPatterns
(\ s a -> s{_scBlackListPatterns = a})
. _Default
. _Coerce | 127 | true | true | 2 | 8 | 50 | 58 | 29 | 29 | null | null |
kazu-yamamoto/http2 | Network/HPACK/Token.hs | bsd-3-clause | tokenTransferEncoding = Token 47 True False "Transfer-Encoding" | 72 | tokenTransferEncoding = Token 47 True False "Transfer-Encoding" | 72 | tokenTransferEncoding = Token 47 True False "Transfer-Encoding" | 72 | false | false | 0 | 5 | 15 | 15 | 7 | 8 | null | null |
dimitriv/ziria-sem | Haskell/ZirScheduled.hs | apache-2.0 | signal_on :: TChan () -> IO ()
signal_on ch = atomically $ writeTChan ch () | 75 | signal_on :: TChan () -> IO ()
signal_on ch = atomically $ writeTChan ch () | 75 | signal_on ch = atomically $ writeTChan ch () | 44 | false | true | 0 | 7 | 14 | 39 | 18 | 21 | null | null |
abuiles/turbinado-blog | tmp/dependencies/hdbc-postgresql-1.1.4.1/testsrc/SpecificDBTests.hs | bsd-3-clause | testp inp exp = TestCase $
case convertSQL inp of
Right x -> assertEqual "" exp x
Left y -> assertFailure $ show y | 130 | testp inp exp = TestCase $
case convertSQL inp of
Right x -> assertEqual "" exp x
Left y -> assertFailure $ show y | 130 | testp inp exp = TestCase $
case convertSQL inp of
Right x -> assertEqual "" exp x
Left y -> assertFailure $ show y | 130 | false | false | 0 | 10 | 39 | 54 | 24 | 30 | null | null |
hucal/SCMinHS | Scheme/Eval/DynamicTypes.hs | bsd-3-clause | oneArgOnly ([a]) = return a | 27 | oneArgOnly ([a]) = return a | 27 | oneArgOnly ([a]) = return a | 27 | false | false | 0 | 6 | 4 | 19 | 9 | 10 | null | null |
karamellpelle/grid | designer/source/Game/Grid/Helpers/Camera.hs | gpl-3.0 | cameraToTurnTicks :: Camera -> Float -> Turn -> Camera
cameraToTurnTicks camera ticks turn =
cameraToTurn camera (1.0 / ticks) turn | 135 | cameraToTurnTicks :: Camera -> Float -> Turn -> Camera
cameraToTurnTicks camera ticks turn =
cameraToTurn camera (1.0 / ticks) turn | 135 | cameraToTurnTicks camera ticks turn =
cameraToTurn camera (1.0 / ticks) turn | 80 | false | true | 0 | 7 | 23 | 44 | 22 | 22 | null | null |
yxm4109/pandoc | src/Text/Pandoc/Readers/HTML.hs | gpl-2.0 | definitionListItem :: GenParser Char ParserState ([Inline], [[Block]])
definitionListItem = try $ do
terms <- sepEndBy1 (inlinesIn "dt") spaces
defs <- sepEndBy1 (blocksIn "dd") spaces
let term = intercalate [LineBreak] terms
return (term, defs)
--
-- paragraph block
-- | 279 | definitionListItem :: GenParser Char ParserState ([Inline], [[Block]])
definitionListItem = try $ do
terms <- sepEndBy1 (inlinesIn "dt") spaces
defs <- sepEndBy1 (blocksIn "dd") spaces
let term = intercalate [LineBreak] terms
return (term, defs)
--
-- paragraph block
-- | 279 | definitionListItem = try $ do
terms <- sepEndBy1 (inlinesIn "dt") spaces
defs <- sepEndBy1 (blocksIn "dd") spaces
let term = intercalate [LineBreak] terms
return (term, defs)
--
-- paragraph block
-- | 208 | false | true | 1 | 13 | 46 | 109 | 54 | 55 | null | null |
nikai3d/ce-challenges | easy/matrix_rotation.hs | bsd-3-clause | main :: IO ()
main = do
[inpFile] <- getArgs
input <- readFile inpFile
putStr . unlines . map (unwords . rotate . words) $ lines input | 146 | main :: IO ()
main = do
[inpFile] <- getArgs
input <- readFile inpFile
putStr . unlines . map (unwords . rotate . words) $ lines input | 146 | main = do
[inpFile] <- getArgs
input <- readFile inpFile
putStr . unlines . map (unwords . rotate . words) $ lines input | 132 | false | true | 1 | 13 | 38 | 72 | 32 | 40 | null | null |
rfranek/duckling | Duckling/Numeral/VI/Rules.hs | bsd-3-clause | ruleT :: Rule
ruleT = Rule
{ name = "tá"
, pattern =
[ regex "t\x00e1"
]
, prod = \_ -> integer 12 >>= withGrain 1 >>= withMultipliable
} | 153 | ruleT :: Rule
ruleT = Rule
{ name = "tá"
, pattern =
[ regex "t\x00e1"
]
, prod = \_ -> integer 12 >>= withGrain 1 >>= withMultipliable
} | 153 | ruleT = Rule
{ name = "tá"
, pattern =
[ regex "t\x00e1"
]
, prod = \_ -> integer 12 >>= withGrain 1 >>= withMultipliable
} | 139 | false | true | 0 | 11 | 45 | 60 | 32 | 28 | null | null |
sdiehl/ghc | testsuite/tests/th/T16895e.hs | bsd-3-clause | main = print $(infixE Nothing [|id id|] Nothing) | 48 | main = print $(infixE Nothing [|id id|] Nothing) | 48 | main = print $(infixE Nothing [|id id|] Nothing) | 48 | false | false | 0 | 8 | 7 | 23 | 12 | 11 | null | null |
Tuplanolla/ties341-unsafe | Lottery.hs | gpl-3.0 | choose :: Ord a => Int -> [a] -> Set a
choose =
let f ys n _ | n <= 0 = ys
f ys n (x : xs)
| x `member` ys = f ys n xs
| otherwise = f (x `insert` ys) (n - 1) xs
f _ n _ = error $ "missing at least " ++ show n ++ " options" in
f empty | 270 | choose :: Ord a => Int -> [a] -> Set a
choose =
let f ys n _ | n <= 0 = ys
f ys n (x : xs)
| x `member` ys = f ys n xs
| otherwise = f (x `insert` ys) (n - 1) xs
f _ n _ = error $ "missing at least " ++ show n ++ " options" in
f empty | 270 | choose =
let f ys n _ | n <= 0 = ys
f ys n (x : xs)
| x `member` ys = f ys n xs
| otherwise = f (x `insert` ys) (n - 1) xs
f _ n _ = error $ "missing at least " ++ show n ++ " options" in
f empty | 231 | false | true | 0 | 12 | 105 | 160 | 78 | 82 | null | null |
sdiehl/ghc | compiler/GHC/Cmm/Dataflow.hs | bsd-3-clause | -- Fixpoint algorithm.
fixpointAnalysis
:: forall f.
Direction
-> DataflowLattice f
-> TransferFun f
-> Label
-> LabelMap CmmBlock
-> FactBase f
-> FactBase f
fixpointAnalysis direction lattice do_block entry blockmap = loop start
where
-- Sorting the blocks helps to minimize th... | 1,630 | fixpointAnalysis
:: forall f.
Direction
-> DataflowLattice f
-> TransferFun f
-> Label
-> LabelMap CmmBlock
-> FactBase f
-> FactBase f
fixpointAnalysis direction lattice do_block entry blockmap = loop start
where
-- Sorting the blocks helps to minimize the number of times we ne... | 1,607 | fixpointAnalysis direction lattice do_block entry blockmap = loop start
where
-- Sorting the blocks helps to minimize the number of times we need to
-- process blocks. For instance, for forward analysis we want to look at
-- blocks in reverse postorder. Also, see comments for sortBlocks.
blocks = ... | 1,436 | true | true | 0 | 13 | 471 | 297 | 151 | 146 | null | null |
siddhanathan/ghc | compiler/nativeGen/AsmCodeGen.hs | bsd-3-clause | nativeCodeGen' :: (Outputable statics, Outputable instr, Instruction instr)
=> DynFlags
-> Module -> ModLocation
-> NcgImpl statics instr jumpDest
-> Handle
-> UniqSupply
-> Stream IO RawCmmGroup ()
-> IO UniqSupply... | 855 | nativeCodeGen' :: (Outputable statics, Outputable instr, Instruction instr)
=> DynFlags
-> Module -> ModLocation
-> NcgImpl statics instr jumpDest
-> Handle
-> UniqSupply
-> Stream IO RawCmmGroup ()
-> IO UniqSupply... | 855 | nativeCodeGen' dflags this_mod modLoc ncgImpl h us cmms
= do
-- BufHandle is a performance hack. We could hide it inside
-- Pretty if it weren't for the fact that we do lots of little
-- printDocs here (in order to do codegen in constant space).
bufh <- newBufHandle h
let ngs0 ... | 534 | false | true | 0 | 14 | 313 | 187 | 91 | 96 | null | null |
thewildweasel/todo-list | src/readtest.hs | gpl-3.0 | rename_list :: [[String]] -> [String] -> IO()
rename_list list args =
do
if (length args > 1)
then
do
let newList = [["# " ++ args !! 1]] ++ (tail list)
write_file newList args
else
putStrLn "Incorrect number of... | 352 | rename_list :: [[String]] -> [String] -> IO()
rename_list list args =
do
if (length args > 1)
then
do
let newList = [["# " ++ args !! 1]] ++ (tail list)
write_file newList args
else
putStrLn "Incorrect number of... | 352 | rename_list list args =
do
if (length args > 1)
then
do
let newList = [["# " ++ args !! 1]] ++ (tail list)
write_file newList args
else
putStrLn "Incorrect number of arguments - no new name given." | 306 | false | true | 0 | 17 | 153 | 103 | 52 | 51 | null | null |
mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/NV/PathRendering.hs | bsd-3-clause | gl_COUNT_DOWN_NV :: GLenum
gl_COUNT_DOWN_NV = 0x9089 | 52 | gl_COUNT_DOWN_NV :: GLenum
gl_COUNT_DOWN_NV = 0x9089 | 52 | gl_COUNT_DOWN_NV = 0x9089 | 25 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
lynnard/cocos2d-hs | src/Graphics/UI/Cocos2d/Director.hs | bsd-3-clause | director_getZEye :: (DirectorValue arg'1) => arg'1 -> HoppyP.IO HoppyP.Float
director_getZEye arg'1 =
withDirectorPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
HoppyP.fmap HoppyP.realToFrac
(director_getZEye' arg'1') | 233 | director_getZEye :: (DirectorValue arg'1) => arg'1 -> HoppyP.IO HoppyP.Float
director_getZEye arg'1 =
withDirectorPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
HoppyP.fmap HoppyP.realToFrac
(director_getZEye' arg'1') | 233 | director_getZEye arg'1 =
withDirectorPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
HoppyP.fmap HoppyP.realToFrac
(director_getZEye' arg'1') | 156 | false | true | 0 | 8 | 29 | 73 | 35 | 38 | null | null |
massysett/pipes-cliff | pipes-cliff/lib/Pipes/Cliff/Core.hs | bsd-3-clause | -- | Is this process still running?
--
-- Side effects: examines the process handle to see if it has yet
-- returned a value. Does not block; should return immediately.
isStillRunning :: ProcessHandle -> IO Bool
isStillRunning ph = do
cnsl <- phConsole ph
cd <- Process.getProcessExitCode (csHandle cnsl)
return .... | 453 | isStillRunning :: ProcessHandle -> IO Bool
isStillRunning ph = do
cnsl <- phConsole ph
cd <- Process.getProcessExitCode (csHandle cnsl)
return . maybe True (const False) $ cd
-- | Allows you to terminate the process, as well as to obtain some
-- information about the process. | 283 | isStillRunning ph = do
cnsl <- phConsole ph
cd <- Process.getProcessExitCode (csHandle cnsl)
return . maybe True (const False) $ cd
-- | Allows you to terminate the process, as well as to obtain some
-- information about the process. | 240 | true | true | 0 | 11 | 84 | 82 | 39 | 43 | null | null |
jml/graphql-api | src/GraphQL/Internal/OrderedMap.hs | bsd-3-clause | -- | Take two ordered maps, append the second one to the first. If the second
-- contains any keys that also appear in the first, combine the two values
-- with the given function.
unionWithM :: (Monad m, Ord key)
=> (value -> value -> m value)
-> OrderedMap key value
-> OrderedMap key ... | 442 | unionWithM :: (Monad m, Ord key)
=> (value -> value -> m value)
-> OrderedMap key value
-> OrderedMap key value
-> m (OrderedMap key value)
unionWithM f x y = sequenceA (unionWith (liftMM f) (map pure x) (map pure y)) | 261 | unionWithM f x y = sequenceA (unionWith (liftMM f) (map pure x) (map pure y)) | 77 | true | true | 0 | 11 | 119 | 118 | 59 | 59 | null | null |
tabemann/botwars | src/Robots/Genetic/HunterKiller/Params.hs | bsd-3-clause | -- | Parse a configuration vector.
parseConfigVector :: Atto.Parser (Seq.Seq RobotConfigValue)
parseConfigVector =
Atto.skipSpace *>
"[" *>
Atto.option Seq.empty
(((<|) <$> parseConfigValue
<*> (Seq.fromList <$> (Atto.many'
(Atto.skipSpace *>
... | 440 | parseConfigVector :: Atto.Parser (Seq.Seq RobotConfigValue)
parseConfigVector =
Atto.skipSpace *>
"[" *>
Atto.option Seq.empty
(((<|) <$> parseConfigValue
<*> (Seq.fromList <$> (Atto.many'
(Atto.skipSpace *>
"," *>
... | 405 | parseConfigVector =
Atto.skipSpace *>
"[" *>
Atto.option Seq.empty
(((<|) <$> parseConfigValue
<*> (Seq.fromList <$> (Atto.many'
(Atto.skipSpace *>
"," *>
parseConfigValue))))) <*
Atto.skipSpace <*
... | 345 | true | true | 4 | 17 | 162 | 112 | 58 | 54 | null | null |
dfordivam/lava | Lava/Combinational.hs | bsd-3-clause | ----------------------------------------------------------------
-- simulate
simulate :: Generic b => (a -> b) -> a -> b
simulate circ inp = runST (
do sr <- netlistST new define (struct (circ inp))
sa <- mmap (fmap symbol . readSTRef) sr
let res = construct sa
return res
)
where
new =
newSTR... | 513 | simulate :: Generic b => (a -> b) -> a -> b
simulate circ inp = runST (
do sr <- netlistST new define (struct (circ inp))
sa <- mmap (fmap symbol . readSTRef) sr
let res = construct sa
return res
)
where
new =
newSTRef (wrong Lava.Error.CombinationalLoop)
define r s =
do s' <- mmap read... | 435 | simulate circ inp = runST (
do sr <- netlistST new define (struct (circ inp))
sa <- mmap (fmap symbol . readSTRef) sr
let res = construct sa
return res
)
where
new =
newSTRef (wrong Lava.Error.CombinationalLoop)
define r s =
do s' <- mmap readSTRef s
writeSTRef r (eval s')
-----... | 391 | true | true | 0 | 14 | 111 | 170 | 81 | 89 | null | null |
GetShopTV/swagger2 | src/Data/Swagger/Internal.hs | bsd-3-clause | swaggerCommonTypes :: [SwaggerType k]
swaggerCommonTypes = [SwaggerString, SwaggerNumber, SwaggerInteger, SwaggerBoolean, SwaggerArray] | 135 | swaggerCommonTypes :: [SwaggerType k]
swaggerCommonTypes = [SwaggerString, SwaggerNumber, SwaggerInteger, SwaggerBoolean, SwaggerArray] | 135 | swaggerCommonTypes = [SwaggerString, SwaggerNumber, SwaggerInteger, SwaggerBoolean, SwaggerArray] | 97 | false | true | 0 | 6 | 10 | 32 | 19 | 13 | null | null |
ezyang/ghc | testsuite/tests/gadt/nbe.hs | bsd-3-clause | eqE (If e1 e2 e3) (If e1_ e2_ e3_) = eqE e1 e1_ && (eqE e2 e2_ && eqE e3 e3_) | 77 | eqE (If e1 e2 e3) (If e1_ e2_ e3_) = eqE e1 e1_ && (eqE e2 e2_ && eqE e3 e3_) | 77 | eqE (If e1 e2 e3) (If e1_ e2_ e3_) = eqE e1 e1_ && (eqE e2 e2_ && eqE e3 e3_) | 77 | false | false | 0 | 8 | 20 | 59 | 27 | 32 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/HaXml/src/Text/XML/HaXml/ParseLazy.hs | bsd-3-clause | nottok :: [TokenT] -> XParser TokenT
nottok ts = do (p,t) <- next
if t`elem`ts then report fail ("no "++show t) p t
else return t
-- | Return just a name, e.g. element name, attribute name. | 233 | nottok :: [TokenT] -> XParser TokenT
nottok ts = do (p,t) <- next
if t`elem`ts then report fail ("no "++show t) p t
else return t
-- | Return just a name, e.g. element name, attribute name. | 233 | nottok ts = do (p,t) <- next
if t`elem`ts then report fail ("no "++show t) p t
else return t
-- | Return just a name, e.g. element name, attribute name. | 196 | false | true | 0 | 11 | 80 | 77 | 40 | 37 | null | null |
AlexanderPankiv/ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | isGoodBreakExpr (RecordCon {}) = True | 37 | isGoodBreakExpr (RecordCon {}) = True | 37 | isGoodBreakExpr (RecordCon {}) = True | 37 | false | false | 0 | 6 | 4 | 17 | 8 | 9 | null | null |
SeanTater/albemarle | src/NLP/Albemarle/Tokens.hs | bsd-3-clause | -- | Tokenize text according to the best method available
wordTokenize :: Text -> [Text]
wordTokenize = icuTokenize | 115 | wordTokenize :: Text -> [Text]
wordTokenize = icuTokenize | 57 | wordTokenize = icuTokenize | 26 | true | true | 0 | 6 | 17 | 19 | 11 | 8 | null | null |
CindyLinz/Haskell.js | trans/src/Desugar/Where.hs | mit | deWhereType (TyBang l bangType type0) = TyBang (id l) (deWhereBangType bangType) (deWhereType type0) | 100 | deWhereType (TyBang l bangType type0) = TyBang (id l) (deWhereBangType bangType) (deWhereType type0) | 100 | deWhereType (TyBang l bangType type0) = TyBang (id l) (deWhereBangType bangType) (deWhereType type0) | 100 | false | false | 0 | 7 | 12 | 44 | 21 | 23 | null | null |
gelisam/hawk | src/Data/HaskellExpr.hs | apache-2.0 | qualified :: String -> String -> HaskellExpr a
qualified moduleName unqualifiedName = HaskellExpr qualifiedName
where
qualifiedName = printf "%s.%s" moduleName unqualifiedName
| 183 | qualified :: String -> String -> HaskellExpr a
qualified moduleName unqualifiedName = HaskellExpr qualifiedName
where
qualifiedName = printf "%s.%s" moduleName unqualifiedName
| 183 | qualified moduleName unqualifiedName = HaskellExpr qualifiedName
where
qualifiedName = printf "%s.%s" moduleName unqualifiedName
| 136 | false | true | 0 | 7 | 28 | 45 | 21 | 24 | null | null |
carliros/lsystem | src/SistemaL.hs | bsd-3-clause | Elem e1 ((Simbolo e2,_):xs) = if e1 == e2
then True
else myElem e1 xs
{ | 135 | myElem e1 ((Simbolo e2,_):xs) = if e1 == e2
then True
else myElem e1 xs | 135 | myElem e1 ((Simbolo e2,_):xs) = if e1 == e2
then True
else myElem e1 xs | 135 | false | false | 1 | 9 | 79 | 47 | 24 | 23 | null | null |
wouwouwou/2017_module_8 | src/haskell/series1/series1.hs | apache-2.0 | myelem a (x:xs) | x == a = True
| otherwise = myelem a xs | 84 | myelem a (x:xs) | x == a = True
| otherwise = myelem a xs | 84 | myelem a (x:xs) | x == a = True
| otherwise = myelem a xs | 84 | false | false | 0 | 8 | 41 | 43 | 19 | 24 | null | null |
rodrigosetti/master-plan | src/MasterPlan/Data.hs | mit | defaultProgress ∷ Progress
defaultProgress = 0 | 46 | defaultProgress ∷ Progress
defaultProgress = 0 | 46 | defaultProgress = 0 | 19 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
dylex/hsaml2 | SAML2/XML/Types.hs | apache-2.0 | httpURI :: String -> String -> String -> String -> URI
httpURI host = URI "http:" $ Just $ URIAuth "" host "" | 109 | httpURI :: String -> String -> String -> String -> URI
httpURI host = URI "http:" $ Just $ URIAuth "" host "" | 109 | httpURI host = URI "http:" $ Just $ URIAuth "" host "" | 54 | false | true | 0 | 8 | 22 | 48 | 23 | 25 | null | null |
sgrif/haskell-game | Game/Keyboard.hs | mit | removeKey :: Key -> Keyboard -> Keyboard
removeKey k (Keyboard s) = Keyboard $ Set.delete k s | 93 | removeKey :: Key -> Keyboard -> Keyboard
removeKey k (Keyboard s) = Keyboard $ Set.delete k s | 93 | removeKey k (Keyboard s) = Keyboard $ Set.delete k s | 52 | false | true | 0 | 10 | 16 | 46 | 21 | 25 | null | null |
mettekou/ghc | compiler/prelude/TysPrim.hs | bsd-3-clause | charPrimTyCon :: TyCon
charPrimTyCon = pcPrimTyCon0 charPrimTyConName WordRep | 79 | charPrimTyCon :: TyCon
charPrimTyCon = pcPrimTyCon0 charPrimTyConName WordRep | 79 | charPrimTyCon = pcPrimTyCon0 charPrimTyConName WordRep | 56 | false | true | 0 | 6 | 9 | 22 | 9 | 13 | null | null |
edsko/cabal | cabal-install/Distribution/Client/InstallPlan.hs | bsd-3-clause | stateDependencyRelation (Configured _) (Configured _) = True | 64 | stateDependencyRelation (Configured _) (Configured _) = True | 64 | stateDependencyRelation (Configured _) (Configured _) = True | 64 | false | false | 0 | 7 | 10 | 23 | 11 | 12 | null | null |
mikehat/blaze-css | src/Text/Blaze/Css21/Value.hs | bsd-3-clause | to_string (Rect t r b l) = "rect(" ++ showCss t "," ++ showCss r "," ++ showCss b "," ++ showCss l ")" | 110 | to_string (Rect t r b l) = "rect(" ++ showCss t "," ++ showCss r "," ++ showCss b "," ++ showCss l ")" | 110 | to_string (Rect t r b l) = "rect(" ++ showCss t "," ++ showCss r "," ++ showCss b "," ++ showCss l ")" | 110 | false | false | 0 | 9 | 31 | 57 | 26 | 31 | null | null |
tonicebrian/sgf | Data/SGF/Parse/Util.hs | bsd-3-clause | none p = tell [PropValueForNonePropertyOmitted p] | 49 | none p = tell [PropValueForNonePropertyOmitted p] | 49 | none p = tell [PropValueForNonePropertyOmitted p] | 49 | false | false | 1 | 6 | 5 | 21 | 8 | 13 | null | null |
kmels/hledger | hledger-lib/Hledger/Query.hs | gpl-3.0 | queryIsAcct :: Query -> Bool
queryIsAcct (Acct _) = True | 56 | queryIsAcct :: Query -> Bool
queryIsAcct (Acct _) = True | 56 | queryIsAcct (Acct _) = True | 27 | false | true | 0 | 9 | 9 | 30 | 13 | 17 | null | null |
glutamate/blaze-bootstrap | Text/Blaze/Html/Bootstrap.hs | mit | progressBar = H.div !. "progress" $ do
H.div !. "progress-bar" ! role "progressbar" ! A.style "width: 0%;" $ "" | 113 | progressBar = H.div !. "progress" $ do
H.div !. "progress-bar" ! role "progressbar" ! A.style "width: 0%;" $ "" | 113 | progressBar = H.div !. "progress" $ do
H.div !. "progress-bar" ! role "progressbar" ! A.style "width: 0%;" $ "" | 113 | false | false | 0 | 12 | 20 | 45 | 21 | 24 | null | null |
cutsea110/aop | src/FixPrime.hs | bsd-3-clause | -- prepro :: Functor f => (f (Fix f) -> f (Fix f)) -> (f a -> a) -> Fix f -> a
prepro :: Functor f => (f :~> f) -> (f a -> a) -> Fix f -> a
prepro h alg = alg . fmap (prepro h alg . cata (In . h)) . out | 202 | prepro :: Functor f => (f :~> f) -> (f a -> a) -> Fix f -> a
prepro h alg = alg . fmap (prepro h alg . cata (In . h)) . out | 123 | prepro h alg = alg . fmap (prepro h alg . cata (In . h)) . out | 62 | true | true | 0 | 12 | 57 | 89 | 44 | 45 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_285 (176#) = happyShift action_86 | 40 | action_285 (176#) = happyShift action_86 | 40 | action_285 (176#) = happyShift action_86 | 40 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
gcampax/ghc | compiler/rename/RnTypes.hs | bsd-3-clause | mkOpFormRn :: LHsCmdTop Name -- Left operand; already rearranged
-> LHsExpr Name -> Fixity -- Operator and fixity
-> LHsCmdTop Name -- Right operand (not an infix)
-> RnM (HsCmd Name)
-- (e11 `op1` e12) `op2` e2
mkOpFormRn a1@(L loc (HsCmdTop (L _ (HsCmdArrForm ... | 836 | mkOpFormRn :: LHsCmdTop Name -- Left operand; already rearranged
-> LHsExpr Name -> Fixity -- Operator and fixity
-> LHsCmdTop Name -- Right operand (not an infix)
-> RnM (HsCmd Name)
mkOpFormRn a1@(L loc (HsCmdTop (L _ (HsCmdArrForm op1 (Just fix1) [a11,a12])) _... | 807 | mkOpFormRn a1@(L loc (HsCmdTop (L _ (HsCmdArrForm op1 (Just fix1) [a11,a12])) _ _ _))
op2 fix2 a2
| nofix_error
= do precParseErr (get_op op1,fix1) (get_op op2,fix2)
return (HsCmdArrForm op2 (Just fix2) [a1, a2])
| associate_right
= do new_c <- mkOpFormRn a12 op2 fix2 a2
return (HsCmdArrF... | 566 | true | true | 0 | 16 | 249 | 275 | 137 | 138 | null | null |
pparkkin/eta | compiler/ETA/CodeGen/Rts.hs | bsd-3-clause | spTopMethod :: Code
spTopMethod = invokevirtual (mkMethodRef stgContext "stackTop" [] (ret frameType)) | 102 | spTopMethod :: Code
spTopMethod = invokevirtual (mkMethodRef stgContext "stackTop" [] (ret frameType)) | 102 | spTopMethod = invokevirtual (mkMethodRef stgContext "stackTop" [] (ret frameType)) | 82 | false | true | 0 | 9 | 11 | 34 | 17 | 17 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Unit.hs | mit | mineralsCost SpecialProtossTemple = 250 | 39 | mineralsCost SpecialProtossTemple = 250 | 39 | mineralsCost SpecialProtossTemple = 250 | 39 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
siddhanathan/ghc | testsuite/tests/rename/should_compile/timing001.hs | bsd-3-clause | a290 = a291 | 11 | a290 = a291 | 11 | a290 = a291 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
supermitch/learn-haskell | real-world-haskell/ch03/Distinctions.hs | mit | b = ("Table", "Oak") | 20 | b = ("Table", "Oak") | 20 | b = ("Table", "Oak") | 20 | false | false | 1 | 5 | 3 | 15 | 7 | 8 | null | null |
sdiehl/ghc | testsuite/tests/codeGen/should_run/cgrun071.hs | bsd-3-clause | popcnt64 :: Word64 -> Word
popcnt64 (W64# w#) =
#if SIZEOF_HSWORD == 4
W# (popCnt64# w#) | 92 | popcnt64 :: Word64 -> Word
popcnt64 (W64# w#) =
#if SIZEOF_HSWORD == 4
W# (popCnt64# w#) | 92 | popcnt64 (W64# w#) =
#if SIZEOF_HSWORD == 4
W# (popCnt64# w#) | 65 | false | true | 0 | 7 | 19 | 34 | 17 | 17 | null | null |
akiomik/dtx2midi | src/DTX2MIDI/MIDI.hs | bsd-3-clause | -- | Euterpeaの固定テンポ(bpm = 120, tempo = 500000)を上書きする
updateInitialTempo :: Midi.Tempo -> MIDI -> MIDI
updateInitialTempo tempo midi =
midi {Midi.tracks = mapTrack update $ Midi.tracks midi}
where
mapTrack f tracks = map (map f) tracks
update (0, Midi.TempoChange 500000) = (0, Midi.TempoChange tempo)
upd... | 375 | updateInitialTempo :: Midi.Tempo -> MIDI -> MIDI
updateInitialTempo tempo midi =
midi {Midi.tracks = mapTrack update $ Midi.tracks midi}
where
mapTrack f tracks = map (map f) tracks
update (0, Midi.TempoChange 500000) = (0, Midi.TempoChange tempo)
update t = t
-- bpm (beat/minute) を tempo (μs/beat) に変換... | 322 | updateInitialTempo tempo midi =
midi {Midi.tracks = mapTrack update $ Midi.tracks midi}
where
mapTrack f tracks = map (map f) tracks
update (0, Midi.TempoChange 500000) = (0, Midi.TempoChange tempo)
update t = t
-- bpm (beat/minute) を tempo (μs/beat) に変換する | 273 | true | true | 2 | 9 | 71 | 130 | 59 | 71 | null | null |
trskop/cabal | Cabal/tests/PackageTests/TestSuiteTests/ExeV10/Check.hs | bsd-3-clause | correctHpcVersion :: IO Bool
correctHpcVersion = do
let programDb' = emptyProgramDb
let verbosity = Verbosity.normal
let verRange = orLaterVersion (Version [0,7] [])
programDb <- configureProgram verbosity hpcProgram programDb'
(requireProgramVersion verbosity hpcProgram verRange programDb
>> ... | 496 | correctHpcVersion :: IO Bool
correctHpcVersion = do
let programDb' = emptyProgramDb
let verbosity = Verbosity.normal
let verRange = orLaterVersion (Version [0,7] [])
programDb <- configureProgram verbosity hpcProgram programDb'
(requireProgramVersion verbosity hpcProgram verRange programDb
>> ... | 496 | correctHpcVersion = do
let programDb' = emptyProgramDb
let verbosity = Verbosity.normal
let verRange = orLaterVersion (Version [0,7] [])
programDb <- configureProgram verbosity hpcProgram programDb'
(requireProgramVersion verbosity hpcProgram verRange programDb
>> return True) `catchIO` (\_ ->... | 467 | false | true | 0 | 13 | 100 | 157 | 77 | 80 | null | null |
rueshyna/gogol | gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs | mpl-2.0 | -- | The full title of the promotion.
opLongTitle :: Lens' OrderPromotion (Maybe Text)
opLongTitle
= lens _opLongTitle (\ s a -> s{_opLongTitle = a}) | 151 | opLongTitle :: Lens' OrderPromotion (Maybe Text)
opLongTitle
= lens _opLongTitle (\ s a -> s{_opLongTitle = a}) | 113 | opLongTitle
= lens _opLongTitle (\ s a -> s{_opLongTitle = a}) | 64 | true | true | 0 | 9 | 26 | 48 | 25 | 23 | null | null |
mbakke/ganeti | src/Ganeti/JQScheduler.hs | bsd-2-clause | -- | Get the maximual number of jobs to be run simultaneously from the
-- configuration. If the configuration is not available, be conservative
-- and use the smallest possible value, i.e., 1.
getMaxRunningJobs :: JQStatus -> IO Int
getMaxRunningJobs = getConfigValue clusterMaxRunningJobs 1 | 291 | getMaxRunningJobs :: JQStatus -> IO Int
getMaxRunningJobs = getConfigValue clusterMaxRunningJobs 1 | 98 | getMaxRunningJobs = getConfigValue clusterMaxRunningJobs 1 | 58 | true | true | 0 | 6 | 43 | 26 | 14 | 12 | null | null |
parvmor/codeworld | codeworld-server/src/DataUtil.hs | apache-2.0 | sourceToDeployId :: ByteString -> DeployId
sourceToDeployId = DeployId . hashToId "D" . ("DEPLOY_ID" <>) | 104 | sourceToDeployId :: ByteString -> DeployId
sourceToDeployId = DeployId . hashToId "D" . ("DEPLOY_ID" <>) | 104 | sourceToDeployId = DeployId . hashToId "D" . ("DEPLOY_ID" <>) | 61 | false | true | 0 | 7 | 13 | 30 | 16 | 14 | null | null |
ssaavedra/liquidhaskell | benchmarks/icfp15/pos/DataBase.hs | bsd-3-clause | {-@ select :: forall <range :: key -> val -> Prop, p :: Dict key val -> Prop>.
(Dict <range> key val <<p>> -> Bool)
-> x:[Dict <range> key val <<p>>]
-> {v:[Dict <range> key val <<p>>] | Set_sub (listElts v) (listElts x)}
@-}
select :: (Dict key val -> Bool) -> Table key val -> Tabl... | 361 | select :: (Dict key val -> Bool) -> Table key val -> Table key val
select prop xs = filter prop xs | 98 | select prop xs = filter prop xs | 31 | true | true | 0 | 8 | 102 | 56 | 26 | 30 | null | null |
DanielSchuessler/hstri | MathUtil.hs | gpl-3.0 | matrixApproxEq :: MatrixNorms m => m -> m -> Bool
matrixApproxEq m1 m2 = matrixDistance m1 m2 < 1E-10 | 101 | matrixApproxEq :: MatrixNorms m => m -> m -> Bool
matrixApproxEq m1 m2 = matrixDistance m1 m2 < 1E-10 | 101 | matrixApproxEq m1 m2 = matrixDistance m1 m2 < 1E-10 | 51 | false | true | 0 | 7 | 18 | 40 | 19 | 21 | null | null |
ezyang/ghc | compiler/main/GhcMake.hs | bsd-3-clause | -- | Discard the contents of the InteractiveContext, but keep the DynFlags.
-- It will also keep ic_int_print and ic_monad if their names are from
-- external packages.
discardIC :: HscEnv -> HscEnv
discardIC hsc_env
= hsc_env { hsc_IC = empty_ic { ic_int_print = new_ic_int_print
, ic_... | 947 | discardIC :: HscEnv -> HscEnv
discardIC hsc_env
= hsc_env { hsc_IC = empty_ic { ic_int_print = new_ic_int_print
, ic_monad = new_ic_monad } }
where
-- Force the new values for ic_int_print and ic_monad to avoid leaking old_ic
!new_ic_int_print = keep_external_name ic_int_print
... | 778 | discardIC hsc_env
= hsc_env { hsc_IC = empty_ic { ic_int_print = new_ic_int_print
, ic_monad = new_ic_monad } }
where
-- Force the new values for ic_int_print and ic_monad to avoid leaking old_ic
!new_ic_int_print = keep_external_name ic_int_print
!new_ic_monad = keep_external_... | 748 | true | true | 0 | 8 | 201 | 142 | 72 | 70 | null | null |
rvion/ride | jetpack/src/System/IO/AsEnv.hs | bsd-3-clause | -- env_hTell :: Handle -> IO Integer
env_hTell = I.hTell | 56 | env_hTell = I.hTell | 19 | env_hTell = I.hTell | 19 | true | false | 0 | 5 | 9 | 9 | 5 | 4 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Ads/List.hs | mpl-2.0 | -- | Select default ads with the specified compatibility. Applicable when
-- type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
-- rendering either on desktop or on mobile devices for regular or
-- interstitial ads, respectively. APP and APP_INTERSTITIAL are for
-- rendering in mobile apps. IN_STR... | 554 | alCompatibility :: Lens' AdsList (Maybe AdsListCompatibility)
alCompatibility
= lens _alCompatibility
(\ s a -> s{_alCompatibility = a}) | 144 | alCompatibility
= lens _alCompatibility
(\ s a -> s{_alCompatibility = a}) | 82 | true | true | 2 | 9 | 84 | 60 | 30 | 30 | null | null |
fpoli/abstat | src/While/Compiler.hs | gpl-3.0 | compileABinOp Subtract = "-" | 28 | compileABinOp Subtract = "-" | 28 | compileABinOp Subtract = "-" | 28 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
nikai3d/ce-challenges | moderate/overlapping_rectangles.hs | bsd-3-clause | within :: [Int] -> Int -> Int -> Int -> Bool
within xs r p q = xs!!p >= xs!!r && xs!!p <= xs!!(r+2) && xs!!q >= xs!!(r+3) && xs!!q <= xs!!(r+1) | 151 | within :: [Int] -> Int -> Int -> Int -> Bool
within xs r p q = xs!!p >= xs!!r && xs!!p <= xs!!(r+2) && xs!!q >= xs!!(r+3) && xs!!q <= xs!!(r+1) | 151 | within xs r p q = xs!!p >= xs!!r && xs!!p <= xs!!(r+2) && xs!!q >= xs!!(r+3) && xs!!q <= xs!!(r+1) | 98 | false | true | 0 | 19 | 39 | 120 | 62 | 58 | null | null |
brendanhay/gogol | gogol-blogger/gen/Network/Google/Resource/Blogger/Pages/Delete.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
pddUploadType :: Lens' PagesDelete (Maybe Text)
pddUploadType
= lens _pddUploadType
(\ s a -> s{_pddUploadType = a}) | 195 | pddUploadType :: Lens' PagesDelete (Maybe Text)
pddUploadType
= lens _pddUploadType
(\ s a -> s{_pddUploadType = a}) | 124 | pddUploadType
= lens _pddUploadType
(\ s a -> s{_pddUploadType = a}) | 76 | true | true | 0 | 9 | 34 | 48 | 25 | 23 | null | null |
Copilot-Language/sbv-for-copilot | Data/SBV/BitVectors/Model.hs | bsd-3-clause | mkSymOp :: Op -> State -> Kind -> SW -> SW -> IO SW
mkSymOp = mkSymOpSC (const (const Nothing)) | 95 | mkSymOp :: Op -> State -> Kind -> SW -> SW -> IO SW
mkSymOp = mkSymOpSC (const (const Nothing)) | 95 | mkSymOp = mkSymOpSC (const (const Nothing)) | 43 | false | true | 0 | 10 | 19 | 49 | 24 | 25 | null | null |
eryx67/haskell-libtorrent | src/Network/Libtorrent/Inline.hs | bsd-3-clause | libtorrentTypesTable :: C.TypesTable
libtorrentTypesTable = M.fromList
[ (C.TypeName "bool" , [t| C.CInt |])
, (C.TypeName "session", [t| C'Session|])
, (C.TypeName "session_status", [t| C'SessionStatus|])
, (C.TypeName "utp_status", [t| C'UtpStatus|])
, (C.TypeName "session_proxy", [t| C'SessionProxy|... | 9,924 | libtorrentTypesTable :: C.TypesTable
libtorrentTypesTable = M.fromList
[ (C.TypeName "bool" , [t| C.CInt |])
, (C.TypeName "session", [t| C'Session|])
, (C.TypeName "session_status", [t| C'SessionStatus|])
, (C.TypeName "utp_status", [t| C'UtpStatus|])
, (C.TypeName "session_proxy", [t| C'SessionProxy|... | 9,924 | libtorrentTypesTable = M.fromList
[ (C.TypeName "bool" , [t| C.CInt |])
, (C.TypeName "session", [t| C'Session|])
, (C.TypeName "session_status", [t| C'SessionStatus|])
, (C.TypeName "utp_status", [t| C'UtpStatus|])
, (C.TypeName "session_proxy", [t| C'SessionProxy|])
, (C.TypeName "torrent_info", [t... | 9,887 | false | true | 0 | 8 | 2,132 | 2,581 | 1,715 | 866 | null | null |
silky/csound-expression | src/Csound/Air/Fx.hs | bsd-3-clause | trackerSplice :: D -> Sig -> Sig -> Sig -> SE Sig
trackerSplice maxLength segLengthSeconds kmode asig = do
setksmps 1
kindxRef <- newRef (0 :: Sig)
ksampRef <- newRef (1 :: D)
aoutRef <- newRef (0 :: Sig)
buf <- newTab (tabSizeSecondsPower2 maxLength)
let segLength = segLengthSeconds * sig get... | 1,610 | trackerSplice :: D -> Sig -> Sig -> Sig -> SE Sig
trackerSplice maxLength segLengthSeconds kmode asig = do
setksmps 1
kindxRef <- newRef (0 :: Sig)
ksampRef <- newRef (1 :: D)
aoutRef <- newRef (0 :: Sig)
buf <- newTab (tabSizeSecondsPower2 maxLength)
let segLength = segLengthSeconds * sig get... | 1,610 | trackerSplice maxLength segLengthSeconds kmode asig = do
setksmps 1
kindxRef <- newRef (0 :: Sig)
ksampRef <- newRef (1 :: D)
aoutRef <- newRef (0 :: Sig)
buf <- newTab (tabSizeSecondsPower2 maxLength)
let segLength = segLengthSeconds * sig getSampleRate
andx = phasor (sig $ getSampleR... | 1,560 | false | true | 0 | 18 | 623 | 583 | 279 | 304 | null | null |
nushio3/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | isEvaldUnfolding (CoreUnfolding { uf_is_value = is_evald }) = is_evald | 70 | isEvaldUnfolding (CoreUnfolding { uf_is_value = is_evald }) = is_evald | 70 | isEvaldUnfolding (CoreUnfolding { uf_is_value = is_evald }) = is_evald | 70 | false | false | 0 | 9 | 8 | 21 | 11 | 10 | null | null |
slpopejoy/fadno-xml | src/Fadno/MusicXml/MusicXml20.hs | bsd-2-clause | -- | Smart constructor for 'AccidentalText'
mkAccidentalText :: AccidentalValue -> AccidentalText
mkAccidentalText a = AccidentalText a Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing | 303 | mkAccidentalText :: AccidentalValue -> AccidentalText
mkAccidentalText a = AccidentalText a Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing | 259 | mkAccidentalText a = AccidentalText a Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing | 205 | true | true | 0 | 7 | 36 | 69 | 33 | 36 | null | null |
lens/lens-opengl | src/Graphics/Rendering/OpenGL/Lens.hs | bsd-3-clause | vaPtr :: Lens (VertexArrayDescriptor a) (VertexArrayDescriptor b) (Ptr a) (Ptr b)
vaPtr = lens
(\(VertexArrayDescriptor _ _ _ ptr) -> ptr)
(\(VertexArrayDescriptor c dt s _) ptr -> VertexArrayDescriptor c dt s ptr) | 224 | vaPtr :: Lens (VertexArrayDescriptor a) (VertexArrayDescriptor b) (Ptr a) (Ptr b)
vaPtr = lens
(\(VertexArrayDescriptor _ _ _ ptr) -> ptr)
(\(VertexArrayDescriptor c dt s _) ptr -> VertexArrayDescriptor c dt s ptr) | 224 | vaPtr = lens
(\(VertexArrayDescriptor _ _ _ ptr) -> ptr)
(\(VertexArrayDescriptor c dt s _) ptr -> VertexArrayDescriptor c dt s ptr) | 142 | false | true | 0 | 9 | 42 | 107 | 52 | 55 | null | null |
kazu-yamamoto/domain-auth | Network/DomainAuth/Mail/Parser.hs | bsd-3-clause | findEOH :: RawMail -> Int -> Maybe Int
findEOH "" _ = Nothing | 61 | findEOH :: RawMail -> Int -> Maybe Int
findEOH "" _ = Nothing | 61 | findEOH "" _ = Nothing | 22 | false | true | 0 | 7 | 12 | 27 | 13 | 14 | null | null |
lynnard/cocos2d-hs | src/Graphics/UI/Cocos2d/Widget.hs | bsd-3-clause | widget_isClippingParentContainsPoint :: (WidgetPtr arg'1, M2.Vec2Value arg'2) => arg'1 -> arg'2 -> HoppyP.IO HoppyP.Bool
widget_isClippingParentContainsPoint arg'1 arg'2 =
HoppyFHR.withCppPtr (toWidget arg'1) $ \arg'1' ->
M2.withVec2Ptr arg'2 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'2' ->
HoppyP.fmap (/= 0)
(wi... | 370 | widget_isClippingParentContainsPoint :: (WidgetPtr arg'1, M2.Vec2Value arg'2) => arg'1 -> arg'2 -> HoppyP.IO HoppyP.Bool
widget_isClippingParentContainsPoint arg'1 arg'2 =
HoppyFHR.withCppPtr (toWidget arg'1) $ \arg'1' ->
M2.withVec2Ptr arg'2 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'2' ->
HoppyP.fmap (/= 0)
(wi... | 370 | widget_isClippingParentContainsPoint arg'1 arg'2 =
HoppyFHR.withCppPtr (toWidget arg'1) $ \arg'1' ->
M2.withVec2Ptr arg'2 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'2' ->
HoppyP.fmap (/= 0)
(widget_isClippingParentContainsPoint' arg'1' arg'2') | 249 | false | true | 0 | 10 | 44 | 113 | 56 | 57 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/Resources/OpsWorksStack.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-configmanager
owsConfigurationManager :: Lens' OpsWorksStack (Maybe OpsWorksStackStackConfigurationManager)
owsConfigurationManager = lens _opsWorksStackConfigurationManager (\s a -> s { _opsWorksStack... | 347 | owsConfigurationManager :: Lens' OpsWorksStack (Maybe OpsWorksStackStackConfigurationManager)
owsConfigurationManager = lens _opsWorksStackConfigurationManager (\s a -> s { _opsWorksStackConfigurationManager = a }) | 214 | owsConfigurationManager = lens _opsWorksStackConfigurationManager (\s a -> s { _opsWorksStackConfigurationManager = a }) | 120 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
achirkin/qua-kit | apps/hs/qua-server/src/Handler/Mooc/Analysis/VoteOrder.hs | mit | lookupParam :: Read a => Text -> Handler (Maybe a)
lookupParam pname = (>>= (readMaybe . unpack)) <$> lookupPostParam pname | 123 | lookupParam :: Read a => Text -> Handler (Maybe a)
lookupParam pname = (>>= (readMaybe . unpack)) <$> lookupPostParam pname | 123 | lookupParam pname = (>>= (readMaybe . unpack)) <$> lookupPostParam pname | 72 | false | true | 0 | 9 | 19 | 52 | 26 | 26 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.