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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
akaspin/couchdb-conduit | test/Database/CouchDB/Conduit/Test/Base.hs | bsd-2-clause | caseDbPut :: Assertion
caseDbPut = runCouch def {couchLogin = login,
couchPass=pass} $ do
couchPutDB_ "cdbc_dbputdel"
couchDeleteDB "cdbc_dbputdel" | 193 | caseDbPut :: Assertion
caseDbPut = runCouch def {couchLogin = login,
couchPass=pass} $ do
couchPutDB_ "cdbc_dbputdel"
couchDeleteDB "cdbc_dbputdel" | 188 | caseDbPut = runCouch def {couchLogin = login,
couchPass=pass} $ do
couchPutDB_ "cdbc_dbputdel"
couchDeleteDB "cdbc_dbputdel" | 165 | false | true | 0 | 8 | 62 | 44 | 22 | 22 | null | null |
banacorn/Graphentheoretische-Paralleler-Algorithmus | src/Bench.hs | mit | runBench :: IO ()
runBench = do
d <- genGraph 1000
e <- genGraph 2000
let d' = toSparseSet d
let e' = toSparseSet e
defaultMain
[ bgroup "Bron-Kerbosch SparseSet"
[ bench "1K" $ whnf SS.bronKerboschLai d'
, bench "2K" $ whnf SS.bronKerboschLai e'
... | 530 | runBench :: IO ()
runBench = do
d <- genGraph 1000
e <- genGraph 2000
let d' = toSparseSet d
let e' = toSparseSet e
defaultMain
[ bgroup "Bron-Kerbosch SparseSet"
[ bench "1K" $ whnf SS.bronKerboschLai d'
, bench "2K" $ whnf SS.bronKerboschLai e'
... | 530 | runBench = do
d <- genGraph 1000
e <- genGraph 2000
let d' = toSparseSet d
let e' = toSparseSet e
defaultMain
[ bgroup "Bron-Kerbosch SparseSet"
[ bench "1K" $ whnf SS.bronKerboschLai d'
, bench "2K" $ whnf SS.bronKerboschLai e'
]
... | 512 | false | true | 3 | 9 | 217 | 142 | 68 | 74 | null | null |
martin-kolinek/some-board-game | src/Player/Building/Dom.hs | mit | drawDynTileInfo :: PlayerWidget t m x => DynamicInfo t -> Position -> Dynamic t TileInfo -> m (TileResults t)
drawDynTileInfo dynamicInfo position tileInfoDyn = do
uniqTileInfo <- holdUniqDyn tileInfoDyn
resultEvent <- dyn $ drawTileInfo dynamicInfo position <$> uniqTileInfo
held <- holdDyn (TileResults never nev... | 386 | drawDynTileInfo :: PlayerWidget t m x => DynamicInfo t -> Position -> Dynamic t TileInfo -> m (TileResults t)
drawDynTileInfo dynamicInfo position tileInfoDyn = do
uniqTileInfo <- holdUniqDyn tileInfoDyn
resultEvent <- dyn $ drawTileInfo dynamicInfo position <$> uniqTileInfo
held <- holdDyn (TileResults never nev... | 386 | drawDynTileInfo dynamicInfo position tileInfoDyn = do
uniqTileInfo <- holdUniqDyn tileInfoDyn
resultEvent <- dyn $ drawTileInfo dynamicInfo position <$> uniqTileInfo
held <- holdDyn (TileResults never never $ constDyn []) resultEvent
extractTileResultsFromDynamic held | 276 | false | true | 0 | 12 | 57 | 123 | 55 | 68 | null | null |
enolan/Idris-dev | src/Idris/IBC.hs | bsd-3-clause | ibc i (IBCDeprecate n r) f = return f { ibc_deprecated = (n, r) : ibc_deprecated f } | 84 | ibc i (IBCDeprecate n r) f = return f { ibc_deprecated = (n, r) : ibc_deprecated f } | 84 | ibc i (IBCDeprecate n r) f = return f { ibc_deprecated = (n, r) : ibc_deprecated f } | 84 | false | false | 1 | 9 | 17 | 48 | 23 | 25 | null | null |
runjak/carbon-adf | Carbon/Main/CompileTime.hs | gpl-3.0 | date = (stringE . init) =<< runIO (Process.readProcess "date" [] "") | 68 | date = (stringE . init) =<< runIO (Process.readProcess "date" [] "") | 68 | date = (stringE . init) =<< runIO (Process.readProcess "date" [] "") | 68 | false | false | 0 | 9 | 10 | 34 | 17 | 17 | null | null |
neosam/esge | src/Esge/Core.hs | bsd-3-clause | insertStoragesA :: Storageable a => [a] -> Action ()
insertStoragesA xs = replaceIngame $ insertStorages_ xs | 108 | insertStoragesA :: Storageable a => [a] -> Action ()
insertStoragesA xs = replaceIngame $ insertStorages_ xs | 108 | insertStoragesA xs = replaceIngame $ insertStorages_ xs | 55 | false | true | 0 | 8 | 15 | 40 | 19 | 21 | null | null |
glutamate/cmdtheline | src/System/Console/CmdTheLine/CmdLine.hs | mit | create :: [ArgInfo] -> [String] -> Err CmdLine
create ais args = processPosArgs posAis =<< parseArgs optTrie cl args
where
( optTrie, posAis, cl ) = argInfoIndexes ais | 171 | create :: [ArgInfo] -> [String] -> Err CmdLine
create ais args = processPosArgs posAis =<< parseArgs optTrie cl args
where
( optTrie, posAis, cl ) = argInfoIndexes ais | 171 | create ais args = processPosArgs posAis =<< parseArgs optTrie cl args
where
( optTrie, posAis, cl ) = argInfoIndexes ais | 124 | false | true | 0 | 7 | 31 | 68 | 34 | 34 | null | null |
Airtnp/Freshman_Simple_Haskell_Lib | Intro/TAPL/subtying.hs | mit | promote ctx t = case t of -- \Gamma |- S ⇑ T (T是S的最小不变超类型)
TyVar i _ -> case getBinding ctx i of
TyVarBinding tyT -> tyT
_ -> (error "No Rule Applies")
_ -> (error "No Rule Applies") | 259 | promote ctx t = case t of -- \Gamma |- S ⇑ T (T是S的最小不变超类型)
TyVar i _ -> case getBinding ctx i of
TyVarBinding tyT -> tyT
_ -> (error "No Rule Applies")
_ -> (error "No Rule Applies") | 259 | promote ctx t = case t of -- \Gamma |- S ⇑ T (T是S的最小不变超类型)
TyVar i _ -> case getBinding ctx i of
TyVarBinding tyT -> tyT
_ -> (error "No Rule Applies")
_ -> (error "No Rule Applies") | 259 | false | false | 2 | 9 | 115 | 71 | 33 | 38 | null | null |
brownsys/nettle-openflow | src/Nettle/OpenFlow/Match.hs | bsd-3-clause | frameToExactMatchNoPort :: EthernetFrame -> Match
frameToExactMatchNoPort frame = foldEthernetFrame frameToMatch frame
where frameToMatch hdr body =
let m1 = addEthHeaders matchAny hdr
in foldEthernetBody (addIPHeaders m1) (addARPHeaders m1) (const m1) body | 285 | frameToExactMatchNoPort :: EthernetFrame -> Match
frameToExactMatchNoPort frame = foldEthernetFrame frameToMatch frame
where frameToMatch hdr body =
let m1 = addEthHeaders matchAny hdr
in foldEthernetBody (addIPHeaders m1) (addARPHeaders m1) (const m1) body | 285 | frameToExactMatchNoPort frame = foldEthernetFrame frameToMatch frame
where frameToMatch hdr body =
let m1 = addEthHeaders matchAny hdr
in foldEthernetBody (addIPHeaders m1) (addARPHeaders m1) (const m1) body | 235 | false | true | 1 | 9 | 58 | 89 | 38 | 51 | null | null |
xenog/haskoin | src/Network/Haskoin/Crypto/Base58.hs | unlicense | encodeBase58 :: ByteString -> ByteString
encodeBase58 bs =
l `mappend` r
where
(z, b) = BS.span (== 0) bs
l = BS.replicate (BS.length z) (BS.index b58Data 0) -- preserve leading 0's
r | BS.null b = BS.empty
| otherwise = encodeBase58I $ bsToInteger b
-- | Decode a base58-encoded 'ByteString'. T... | 416 | encodeBase58 :: ByteString -> ByteString
encodeBase58 bs =
l `mappend` r
where
(z, b) = BS.span (== 0) bs
l = BS.replicate (BS.length z) (BS.index b58Data 0) -- preserve leading 0's
r | BS.null b = BS.empty
| otherwise = encodeBase58I $ bsToInteger b
-- | Decode a base58-encoded 'ByteString'. T... | 416 | encodeBase58 bs =
l `mappend` r
where
(z, b) = BS.span (== 0) bs
l = BS.replicate (BS.length z) (BS.index b58Data 0) -- preserve leading 0's
r | BS.null b = BS.empty
| otherwise = encodeBase58I $ bsToInteger b
-- | Decode a base58-encoded 'ByteString'. This can fail if the input
-- 'ByteString'... | 375 | false | true | 1 | 9 | 92 | 135 | 64 | 71 | null | null |
jdiez17/HaskellHawk | Config.hs | mit | content :: Parser String
content = many (noneOf "\r\n") | 55 | content :: Parser String
content = many (noneOf "\r\n") | 55 | content = many (noneOf "\r\n") | 30 | false | true | 0 | 7 | 8 | 23 | 11 | 12 | null | null |
Concomitant/LambdaHack | Game/LambdaHack/Atomic/HandleAtomicWrite.hs | bsd-3-clause | updLeadFaction :: MonadStateWrite m
=> FactionId
-> Maybe (ActorId, Maybe Target)
-> Maybe (ActorId, Maybe Target)
-> m ()
updLeadFaction fid source target = assert (source /= target) $ do
fact <- getsState $ (EM.! fid) . sfactionD
let !_A = assert (fleade... | 789 | updLeadFaction :: MonadStateWrite m
=> FactionId
-> Maybe (ActorId, Maybe Target)
-> Maybe (ActorId, Maybe Target)
-> m ()
updLeadFaction fid source target = assert (source /= target) $ do
fact <- getsState $ (EM.! fid) . sfactionD
let !_A = assert (fleade... | 789 | updLeadFaction fid source target = assert (source /= target) $ do
fact <- getsState $ (EM.! fid) . sfactionD
let !_A = assert (fleaderMode (gplayer fact) /= LeaderNull) ()
-- @PosNone@ ensures this
mtb <- getsState $ \s -> flip getActorBody s . fst <$> target
let !_A = assert (maybe True (not . bproj) mtb
... | 606 | false | true | 0 | 16 | 249 | 304 | 153 | 151 | null | null |
rgllm/uminho | 01/LI1/lightbot/src/TA/tarefa1.hs | mit | estaTab (x:xs) = verificaTab (length x) 1 (x:xs)
| 49 | testaTab (x:xs) = verificaTab (length x) 1 (x:xs) | 49 | testaTab (x:xs) = verificaTab (length x) 1 (x:xs) | 49 | false | false | 0 | 7 | 8 | 36 | 18 | 18 | null | null |
jwiegley/ghc-release | libraries/bytestring/Data/ByteString/Builder/ASCII.hs | gpl-3.0 | wordDec :: Word -> Builder
wordDec = P.primBounded P.wordDec | 60 | wordDec :: Word -> Builder
wordDec = P.primBounded P.wordDec | 60 | wordDec = P.primBounded P.wordDec | 33 | false | true | 0 | 6 | 8 | 22 | 11 | 11 | null | null |
kmate/HaRe | old/refactorer/RefacMerge.hs | bsd-3-clause | replaceInE :: (Monad m, MonadPlus m) => PNT -> String -> HsExpP -> m HsExpP
replaceInE origName newName e
= applyTP (once_tdTP (adhocTP idTP rename')) e
where
rename' (e'@(Exp (HsId (HsVar x)))::HsExpP)
| pNTtoName x == pNTtoName origName = return (Exp (HsId (HsVar (nameToPNT newName) )))
... | 524 | replaceInE :: (Monad m, MonadPlus m) => PNT -> String -> HsExpP -> m HsExpP
replaceInE origName newName e
= applyTP (once_tdTP (adhocTP idTP rename')) e
where
rename' (e'@(Exp (HsId (HsVar x)))::HsExpP)
| pNTtoName x == pNTtoName origName = return (Exp (HsId (HsVar (nameToPNT newName) )))
... | 524 | replaceInE origName newName e
= applyTP (once_tdTP (adhocTP idTP rename')) e
where
rename' (e'@(Exp (HsId (HsVar x)))::HsExpP)
| pNTtoName x == pNTtoName origName = return (Exp (HsId (HsVar (nameToPNT newName) )))
| otherwise = return e'
rename' e@(Exp (HsApp e1 e2))
= ... | 448 | false | true | 0 | 16 | 161 | 236 | 112 | 124 | null | null |
rahulmutt/ghcvm | compiler/Eta/HsSyn/HsPat.hs | bsd-3-clause | isCompoundPat (SigPatOut {}) = True | 41 | isCompoundPat (SigPatOut {}) = True | 41 | isCompoundPat (SigPatOut {}) = True | 41 | false | false | 0 | 7 | 10 | 16 | 8 | 8 | null | null |
ganeti-github-testing/ganeti-test-1 | src/Ganeti/HTools/Program/Hspace.hs | bsd-2-clause | printISpec False ispec spec disk_template print_spn =
let spdata = if print_spn then specDataSpn else specData
in printf "%s instance spec is:\n %s, using disk\
\ template '%s'.\n"
(specDescription spec)
(formatResources ispec spdata) (diskTemplateToRaw disk_template) | 309 | printISpec False ispec spec disk_template print_spn =
let spdata = if print_spn then specDataSpn else specData
in printf "%s instance spec is:\n %s, using disk\
\ template '%s'.\n"
(specDescription spec)
(formatResources ispec spdata) (diskTemplateToRaw disk_template) | 309 | printISpec False ispec spec disk_template print_spn =
let spdata = if print_spn then specDataSpn else specData
in printf "%s instance spec is:\n %s, using disk\
\ template '%s'.\n"
(specDescription spec)
(formatResources ispec spdata) (diskTemplateToRaw disk_template) | 309 | false | false | 0 | 9 | 75 | 71 | 32 | 39 | null | null |
ancientlanguage/haskell-analysis | prepare/src/Prepare/Decompose.hs | mit | decomposeChar '\x1E45' = "\x006E\x0307" | 39 | decomposeChar '\x1E45' = "\x006E\x0307" | 39 | decomposeChar '\x1E45' = "\x006E\x0307" | 39 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
spikelynch/annales | app/Annales/Descriptions.hs | bsd-3-clause | descCourtTribe :: Empire -> TextGenCh
descCourtTribe e = list [ defeated, w "the", currentTribe e ]
where defeated = chw [
"defeated", "exterminated", "punished", "quelled"
, "triumphed over", "repressed", "embarrassed", "harassed"
, "controlled", "bested"
] | 300 | descCourtTribe :: Empire -> TextGenCh
descCourtTribe e = list [ defeated, w "the", currentTribe e ]
where defeated = chw [
"defeated", "exterminated", "punished", "quelled"
, "triumphed over", "repressed", "embarrassed", "harassed"
, "controlled", "bested"
] | 300 | descCourtTribe e = list [ defeated, w "the", currentTribe e ]
where defeated = chw [
"defeated", "exterminated", "punished", "quelled"
, "triumphed over", "repressed", "embarrassed", "harassed"
, "controlled", "bested"
] | 262 | false | true | 0 | 7 | 76 | 77 | 43 | 34 | null | null |
phischu/fragnix | tests/packages/scotty/Network.HPACK.Huffman.Encode.hs | bsd-3-clause | enc :: WorkingBuffer -> ReadBuffer -> IO Int
enc WorkingBuffer{..} rbuf = do
beg <- readIORef offset
end <- go (beg,0,initialOffset)
writeIORef offset end
let !len = end `minusPtr` beg
return len
where
go (dst,encoded,off) = do
!i <- getByte' rbuf
if i >= 0 then
cop... | 1,307 | enc :: WorkingBuffer -> ReadBuffer -> IO Int
enc WorkingBuffer{..} rbuf = do
beg <- readIORef offset
end <- go (beg,0,initialOffset)
writeIORef offset end
let !len = end `minusPtr` beg
return len
where
go (dst,encoded,off) = do
!i <- getByte' rbuf
if i >= 0 then
cop... | 1,307 | enc WorkingBuffer{..} rbuf = do
beg <- readIORef offset
end <- go (beg,0,initialOffset)
writeIORef offset end
let !len = end `minusPtr` beg
return len
where
go (dst,encoded,off) = do
!i <- getByte' rbuf
if i >= 0 then
copy dst (bond i) >>= go
else if off =... | 1,262 | false | true | 60 | 9 | 554 | 445 | 241 | 204 | null | null |
HaskellCNOrg/snap-web | src/Controllers/Exception.hs | bsd-3-clause | toErrorPage :: Text -- ^ Errors
-> AppHandler ()
toErrorPage err = heistLocal (I.bindSplice "error" (I.textSplice err)) $ render "error-page" | 166 | toErrorPage :: Text -- ^ Errors
-> AppHandler ()
toErrorPage err = heistLocal (I.bindSplice "error" (I.textSplice err)) $ render "error-page" | 166 | toErrorPage err = heistLocal (I.bindSplice "error" (I.textSplice err)) $ render "error-page" | 92 | false | true | 0 | 10 | 44 | 56 | 26 | 30 | null | null |
vincenthz/hs-packer | Data/Packer.hs | bsd-2-clause | -- | Put a Word16 Hole
putHoleWord16_ :: (Word16 -> Word16) -> Packing (Hole Word16)
putHoleWord16_ f = packHole 2 (\ptr w -> poke (castPtr ptr) (f w)) | 151 | putHoleWord16_ :: (Word16 -> Word16) -> Packing (Hole Word16)
putHoleWord16_ f = packHole 2 (\ptr w -> poke (castPtr ptr) (f w)) | 128 | putHoleWord16_ f = packHole 2 (\ptr w -> poke (castPtr ptr) (f w)) | 66 | true | true | 0 | 10 | 27 | 67 | 34 | 33 | null | null |
ezyang/ghc | compiler/cmm/PprCmmExpr.hs | bsd-3-clause | infixMachOp7 _ = Nothing | 34 | infixMachOp7 _ = Nothing | 34 | infixMachOp7 _ = Nothing | 34 | false | false | 0 | 5 | 13 | 9 | 4 | 5 | null | null |
nuttycom/haskoin | tests/Network/Haskoin/Crypto/ExtendedKeys/Units.hs | unlicense | xKeyVec :: [([String],XPrvKey)]
xKeyVec = zip xKeyResVec $ catMaybes $ foldl f [m] der
where f acc d = acc ++ [d =<< last acc]
m = makeXPrvKey $ fromJust $ hexToBS m0
der = [ flip primeSubKey 0
, flip prvSubKey 1
, flip primeSubKey 2
, flip prvSu... | 388 | xKeyVec :: [([String],XPrvKey)]
xKeyVec = zip xKeyResVec $ catMaybes $ foldl f [m] der
where f acc d = acc ++ [d =<< last acc]
m = makeXPrvKey $ fromJust $ hexToBS m0
der = [ flip primeSubKey 0
, flip prvSubKey 1
, flip primeSubKey 2
, flip prvSu... | 388 | xKeyVec = zip xKeyResVec $ catMaybes $ foldl f [m] der
where f acc d = acc ++ [d =<< last acc]
m = makeXPrvKey $ fromJust $ hexToBS m0
der = [ flip primeSubKey 0
, flip prvSubKey 1
, flip primeSubKey 2
, flip prvSubKey 2
, flip pr... | 356 | false | true | 5 | 9 | 161 | 150 | 69 | 81 | null | null |
diminishedprime/.org | reading-list/learn_you_a_haskell/recursion.hs | mit | reverse' (x:xs) = reverse' xs ++ [x] | 36 | reverse' (x:xs) = reverse' xs ++ [x] | 36 | reverse' (x:xs) = reverse' xs ++ [x] | 36 | false | false | 0 | 7 | 6 | 26 | 13 | 13 | null | null |
SamirTalwar/advent-of-code | 2015/AOC_05_1.hs | mit | pairs :: [a] -> [(a, a)]
pairs [] = [] | 38 | pairs :: [a] -> [(a, a)]
pairs [] = [] | 38 | pairs [] = [] | 13 | false | true | 0 | 7 | 9 | 34 | 19 | 15 | null | null |
beni55/hspec | doc/_includes/introduction/MathSpec.hs | mit | main :: IO ()
main = hspec $ do
describe "absolute" $ do
it "returns the original number when given a positive input" $
absolute 1 `shouldBe` 1
it "returns a positive number when given a negative input" $
absolute (-1) `shouldBe` 1
it "returns zero when given zero" $
absolute 0 `should... | 325 | main :: IO ()
main = hspec $ do
describe "absolute" $ do
it "returns the original number when given a positive input" $
absolute 1 `shouldBe` 1
it "returns a positive number when given a negative input" $
absolute (-1) `shouldBe` 1
it "returns zero when given zero" $
absolute 0 `should... | 325 | main = hspec $ do
describe "absolute" $ do
it "returns the original number when given a positive input" $
absolute 1 `shouldBe` 1
it "returns a positive number when given a negative input" $
absolute (-1) `shouldBe` 1
it "returns zero when given zero" $
absolute 0 `shouldBe` 0 | 311 | false | true | 0 | 15 | 87 | 92 | 44 | 48 | null | null |
idleberg/NSIS | Development/NSIS/Show.hs | apache-2.0 | out fs (HeaderImage x) = "!define MUI_HEADERIMAGE" : ["!define MUI_HEADERIMAGE_BITMAP " ++ show x | Just x <- [x]] | 114 | out fs (HeaderImage x) = "!define MUI_HEADERIMAGE" : ["!define MUI_HEADERIMAGE_BITMAP " ++ show x | Just x <- [x]] | 114 | out fs (HeaderImage x) = "!define MUI_HEADERIMAGE" : ["!define MUI_HEADERIMAGE_BITMAP " ++ show x | Just x <- [x]] | 114 | false | false | 0 | 9 | 18 | 46 | 22 | 24 | null | null |
ulricha/dsh-example-queries | data_generators/OrganisationGen.hs | bsd-3-clause | -- | Make a text value unique by appending a unique integer
textKey :: Int -> T.Text -> T.Text
textKey k t = T.append t (T.pack $ show k) | 137 | textKey :: Int -> T.Text -> T.Text
textKey k t = T.append t (T.pack $ show k) | 77 | textKey k t = T.append t (T.pack $ show k) | 42 | true | true | 0 | 8 | 28 | 52 | 25 | 27 | null | null |
MetaMemoryT/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | showDeclImp o (PParams _ ns ps) = text "params" <+> braces (text (show ns) <> line <> showDecls o ps <> line) | 109 | showDeclImp o (PParams _ ns ps) = text "params" <+> braces (text (show ns) <> line <> showDecls o ps <> line) | 109 | showDeclImp o (PParams _ ns ps) = text "params" <+> braces (text (show ns) <> line <> showDecls o ps <> line) | 109 | false | false | 0 | 13 | 21 | 60 | 28 | 32 | null | null |
antalsz/hs-to-coq | examples/ghc/gen-files/Lexer.hs | mit | mkPState :: DynFlags -> StringBuffer -> RealSrcLoc -> PState
mkPState flags = mkPStatePure (mkParserFlags flags) | 112 | mkPState :: DynFlags -> StringBuffer -> RealSrcLoc -> PState
mkPState flags = mkPStatePure (mkParserFlags flags) | 112 | mkPState flags = mkPStatePure (mkParserFlags flags) | 51 | false | true | 0 | 7 | 14 | 35 | 17 | 18 | null | null |
Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/UI/DropDownList.hs | mit | dropDownListGetNumItems :: (Parent DropDownList a, Pointer ptr a, MonadIO m)
=> ptr -- ^ Pointer to DropDownList or ascentor
-> m Word
dropDownListGetNumItems p = liftIO $ do
let ptr = parentPointer p
fromIntegral <$> [C.exp| unsigned int {$(DropDownList* ptr)->GetNumItems()} |]
-- | Return item at index.
-- U... | 360 | dropDownListGetNumItems :: (Parent DropDownList a, Pointer ptr a, MonadIO m)
=> ptr -- ^ Pointer to DropDownList or ascentor
-> m Word
dropDownListGetNumItems p = liftIO $ do
let ptr = parentPointer p
fromIntegral <$> [C.exp| unsigned int {$(DropDownList* ptr)->GetNumItems()} |]
-- | Return item at index.
-- U... | 360 | dropDownListGetNumItems p = liftIO $ do
let ptr = parentPointer p
fromIntegral <$> [C.exp| unsigned int {$(DropDownList* ptr)->GetNumItems()} |]
-- | Return item at index.
-- UIElement* GetItem(unsigned index) const; | 221 | false | true | 0 | 11 | 60 | 79 | 41 | 38 | null | null |
INSAlgo/codingbattle-2017 | pre-concours/a_dis_papa/sol/sol-hs.hs | gpl-3.0 | main :: IO ()
main = do
line <- getLine
putStrLn $ substring 4 line | 75 | main :: IO ()
main = do
line <- getLine
putStrLn $ substring 4 line | 75 | main = do
line <- getLine
putStrLn $ substring 4 line | 61 | false | true | 0 | 8 | 22 | 35 | 16 | 19 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | heraldically = id | 17 | heraldically = id | 17 | heraldically = id | 17 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
jean-edouard/idl | rpcgen/Model.hs | gpl-2.0 | -- properties implemented by given set of interfaces (tupled with relevant interface)
propertiesFromInterfaceSet :: [Interface] -> [(Interface,Property)]
propertiesFromInterfaceSet intfs =
concat $ map property_pairs intfs
where
property_pairs intf = zip (repeat intf) (interfaceProperties intf)
-- make g... | 355 | propertiesFromInterfaceSet :: [Interface] -> [(Interface,Property)]
propertiesFromInterfaceSet intfs =
concat $ map property_pairs intfs
where
property_pairs intf = zip (repeat intf) (interfaceProperties intf)
-- make getter/setter methods for a property | 269 | propertiesFromInterfaceSet intfs =
concat $ map property_pairs intfs
where
property_pairs intf = zip (repeat intf) (interfaceProperties intf)
-- make getter/setter methods for a property | 201 | true | true | 2 | 7 | 55 | 71 | 37 | 34 | null | null |
keera-studios/hsQt | Qtc/Core/QTranslator.hs | bsd-2-clause | qTranslator_delete :: QTranslator a -> IO ()
qTranslator_delete x0
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QTranslator_delete cobj_x0 | 136 | qTranslator_delete :: QTranslator a -> IO ()
qTranslator_delete x0
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QTranslator_delete cobj_x0 | 136 | qTranslator_delete x0
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QTranslator_delete cobj_x0 | 91 | false | true | 0 | 8 | 22 | 45 | 20 | 25 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_H_SGML_SPECIAL :: Int
wxSTC_H_SGML_SPECIAL = 27 | 53 | wxSTC_H_SGML_SPECIAL :: Int
wxSTC_H_SGML_SPECIAL = 27 | 53 | wxSTC_H_SGML_SPECIAL = 27 | 25 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
urbanslug/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | isValueUnfolding _ = False | 67 | isValueUnfolding _ = False | 67 | isValueUnfolding _ = False | 67 | false | false | 0 | 4 | 44 | 10 | 4 | 6 | null | null |
snoyberg/ghc | compiler/llvmGen/Llvm/Types.hs | bsd-3-clause | getLitType (LMVectorLit []) = panic "getLitType" | 49 | getLitType (LMVectorLit []) = panic "getLitType" | 49 | getLitType (LMVectorLit []) = panic "getLitType" | 49 | false | false | 0 | 7 | 6 | 21 | 9 | 12 | null | null |
brendanhay/gogol | gogol-blogger/gen/Network/Google/Resource/Blogger/Pages/List.hs | mpl-2.0 | -- | Creates a value of 'PagesList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'plStatus'
--
-- * 'plXgafv'
--
-- * 'plUploadProtocol'
--
-- * 'plAccessToken'
--
-- * 'plUploadType'
--
-- * 'plBlogId'
--
-- * 'plFetchBodies'
--
--... | 811 | pagesList
:: Text -- ^ 'plBlogId'
-> PagesList
pagesList pPlBlogId_ =
PagesList'
{ _plStatus = Nothing
, _plXgafv = Nothing
, _plUploadProtocol = Nothing
, _plAccessToken = Nothing
, _plUploadType = Nothing
, _plBlogId = pPlBlogId_
, _plFetchBodies = Nothing
, _plView = Nothing... | 413 | pagesList pPlBlogId_ =
PagesList'
{ _plStatus = Nothing
, _plXgafv = Nothing
, _plUploadProtocol = Nothing
, _plAccessToken = Nothing
, _plUploadType = Nothing
, _plBlogId = pPlBlogId_
, _plFetchBodies = Nothing
, _plView = Nothing
, _plPageToken = Nothing
, _plMaxResults = Not... | 358 | true | true | 0 | 6 | 188 | 112 | 80 | 32 | null | null |
leptonyu/mint | corn/src/Base/Context.hs | bsd-3-clause | addEventHandler' :: (MonadIO m, MonadThrow m, Event e) => Proxy e -> Maybe Text -> (e -> AppM IO ()) -> AppM m ()
addEventHandler' p hname h = do
hs <- getEventConsumer p
context <- get
let key = "Event." <> cs (eventKey p)
h' = runAppM context . h
name = fromMaybe (key <> "." <> showText (len... | 427 | addEventHandler' :: (MonadIO m, MonadThrow m, Event e) => Proxy e -> Maybe Text -> (e -> AppM IO ()) -> AppM m ()
addEventHandler' p hname h = do
hs <- getEventConsumer p
context <- get
let key = "Event." <> cs (eventKey p)
h' = runAppM context . h
name = fromMaybe (key <> "." <> showText (len... | 427 | addEventHandler' p hname h = do
hs <- getEventConsumer p
context <- get
let key = "Event." <> cs (eventKey p)
h' = runAppM context . h
name = fromMaybe (key <> "." <> showText (length hs + 1)) hname
infoLn $ "Register eventHandler " <> name <> " for " <> key
setExtension key (h':hs) | 313 | false | true | 0 | 16 | 109 | 197 | 94 | 103 | null | null |
nushio3/authoring | old-src/Text/Authoring/Commands.hs | bsd-3-clause | getReference :: (MonadState AuthorState m) => AS.Label -> m Text
getReference lab = do
map0 <- use labelMap
case Map.lookup lab map0 of
Just str -> return str
Nothing -> do
let cands :: [String]
cands = cand0 : [s ++ [c]| s <- cands, c <- ['a'..'z']]
cand0 = filter isAlphaNum $ sh... | 643 | getReference :: (MonadState AuthorState m) => AS.Label -> m Text
getReference lab = do
map0 <- use labelMap
case Map.lookup lab map0 of
Just str -> return str
Nothing -> do
let cands :: [String]
cands = cand0 : [s ++ [c]| s <- cands, c <- ['a'..'z']]
cand0 = filter isAlphaNum $ sh... | 643 | getReference lab = do
map0 <- use labelMap
case Map.lookup lab map0 of
Just str -> return str
Nothing -> do
let cands :: [String]
cands = cand0 : [s ++ [c]| s <- cands, c <- ['a'..'z']]
cand0 = filter isAlphaNum $ show lab
takens :: Set.Set Text.Text
takens = ... | 578 | false | true | 0 | 19 | 206 | 251 | 123 | 128 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/Storage/Utils.hs | gpl-2.0 | getExclusiveStorage :: ConfigData -> Node -> Maybe Bool
getExclusiveStorage cfg n = liftM ndpExclusiveStorage (getNodeNdParams cfg n) | 133 | getExclusiveStorage :: ConfigData -> Node -> Maybe Bool
getExclusiveStorage cfg n = liftM ndpExclusiveStorage (getNodeNdParams cfg n) | 133 | getExclusiveStorage cfg n = liftM ndpExclusiveStorage (getNodeNdParams cfg n) | 77 | false | true | 0 | 7 | 16 | 40 | 19 | 21 | null | null |
brendanhay/gogol | gogol-serviceuser/gen/Network/Google/Resource/ServiceUser/Projects/Services/List.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
pslUploadProtocol :: Lens' ProjectsServicesList (Maybe Text)
pslUploadProtocol
= lens _pslUploadProtocol
(\ s a -> s{_pslUploadProtocol = a}) | 211 | pslUploadProtocol :: Lens' ProjectsServicesList (Maybe Text)
pslUploadProtocol
= lens _pslUploadProtocol
(\ s a -> s{_pslUploadProtocol = a}) | 149 | pslUploadProtocol
= lens _pslUploadProtocol
(\ s a -> s{_pslUploadProtocol = a}) | 88 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
databrary/databrary | src/Model/AssetSlot.hs | agpl-3.0 | lookupAssetSlot :: (MonadHasIdentity c m, MonadDB c m) => Id Asset -> m (Maybe AssetSlot)
lookupAssetSlot ai = do
ident <- peek
dbQuery1 $(selectQuery (selectAssetSlot 'ident) "$WHERE asset.id = ${ai}") | 206 | lookupAssetSlot :: (MonadHasIdentity c m, MonadDB c m) => Id Asset -> m (Maybe AssetSlot)
lookupAssetSlot ai = do
ident <- peek
dbQuery1 $(selectQuery (selectAssetSlot 'ident) "$WHERE asset.id = ${ai}") | 206 | lookupAssetSlot ai = do
ident <- peek
dbQuery1 $(selectQuery (selectAssetSlot 'ident) "$WHERE asset.id = ${ai}") | 116 | false | true | 0 | 12 | 33 | 78 | 37 | 41 | null | null |
rimmington/cabal | Cabal/Distribution/Simple/Utils.hs | bsd-3-clause | -- | More detail on the operation of some action.
--
-- We display these messages when the verbosity level is 'verbose'
--
info :: Verbosity -> String -> IO ()
info verbosity msg =
when (verbosity >= verbose) $
putStr (wrapText msg) | 238 | info :: Verbosity -> String -> IO ()
info verbosity msg =
when (verbosity >= verbose) $
putStr (wrapText msg) | 115 | info verbosity msg =
when (verbosity >= verbose) $
putStr (wrapText msg) | 78 | true | true | 0 | 8 | 48 | 60 | 30 | 30 | null | null |
jstolarek/ghc | libraries/template-haskell/Language/Haskell/TH/Syntax.hs | bsd-3-clause | {- Note [Representing concrete syntax in types]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Haskell has a rich concrete syntax for types, including
t1 -> t2, (t1,t2), [t], and so on
In TH we represent all of this using AppT, with a distinguished
type constructor at the head. So,
Type TH representa... | 1,507 | cmpEq :: Ordering -> Bool
cmpEq EQ = True | 41 | cmpEq EQ = True | 15 | true | true | 0 | 7 | 346 | 28 | 14 | 14 | null | null |
AKST/scheme.llvm | src/Scheme/Simplified.hs | mit | nameList (Simplified{_namespace=ns}) = Set.toList ns | 52 | nameList (Simplified{_namespace=ns}) = Set.toList ns | 52 | nameList (Simplified{_namespace=ns}) = Set.toList ns | 52 | false | false | 0 | 9 | 4 | 26 | 13 | 13 | null | null |
capital-match/raptr | test/Network/Raptr/StorageSpec.hs | bsd-3-clause | runActions log (AddEntry s:as) = insertEntry log e >> runActions log as
where
e = Entry index0 term0 (toStrict $ encode s) | 130 | runActions log (AddEntry s:as) = insertEntry log e >> runActions log as
where
e = Entry index0 term0 (toStrict $ encode s) | 130 | runActions log (AddEntry s:as) = insertEntry log e >> runActions log as
where
e = Entry index0 term0 (toStrict $ encode s) | 130 | false | false | 0 | 8 | 29 | 60 | 28 | 32 | null | null |
neongreen/megaparsec | Text/Megaparsec/Prim.hs | bsd-2-clause | pEof :: Stream s t => ParsecT s m ()
pEof = label eoi $ ParsecT $ \s@(State input pos _) _ _ eok eerr ->
case uncons input of
Nothing -> eok () s mempty
Just (x,_) -> eerr $ unexpectedErr (showToken x) pos
| 219 | pEof :: Stream s t => ParsecT s m ()
pEof = label eoi $ ParsecT $ \s@(State input pos _) _ _ eok eerr ->
case uncons input of
Nothing -> eok () s mempty
Just (x,_) -> eerr $ unexpectedErr (showToken x) pos
| 219 | pEof = label eoi $ ParsecT $ \s@(State input pos _) _ _ eok eerr ->
case uncons input of
Nothing -> eok () s mempty
Just (x,_) -> eerr $ unexpectedErr (showToken x) pos
| 182 | false | true | 4 | 12 | 58 | 125 | 59 | 66 | null | null |
nevrenato/HetsAlloy | Taxonomy/MMiSSOntology.hs | gpl-2.0 | insertLink :: MMiSSOntology -> String -> String -> String
-> WithError MMiSSOntology
insertLink onto source target relName = do
let objs = objects onto
case Map.lookup source objs of
Just _ -> return ()
Nothing -> insErr' "Object" source
case Map.lookup target objs of
Just _ -> ... | 1,657 | insertLink :: MMiSSOntology -> String -> String -> String
-> WithError MMiSSOntology
insertLink onto source target relName = do
let objs = objects onto
case Map.lookup source objs of
Just _ -> return ()
Nothing -> insErr' "Object" source
case Map.lookup target objs of
Just _ -> ... | 1,657 | insertLink onto source target relName = do
let objs = objects onto
case Map.lookup source objs of
Just _ -> return ()
Nothing -> insErr' "Object" source
case Map.lookup target objs of
Just _ -> return ()
Nothing -> insErr' "Object" target
case Map.lookup relName $ relations onto ... | 1,561 | false | true | 0 | 12 | 503 | 359 | 168 | 191 | null | null |
dservgun/haskell_test_code | src/HandleIO.hs | gpl-2.0 | hClose :: Handle -> HandleIO ()
hClose = HandleIO . System.IO.hClose | 68 | hClose :: Handle -> HandleIO ()
hClose = HandleIO . System.IO.hClose | 68 | hClose = HandleIO . System.IO.hClose | 36 | false | true | 1 | 8 | 10 | 34 | 15 | 19 | null | null |
vaibhav276/exercism_haskell | leap/src/LeapYear.hs | mit | isLeapYear :: Integer -> Bool
isLeapYear year
| year `mod` 100 == 0 = if (year `mod` 400 == 0) then True else False
| year `mod` 4 == 0 = True
| otherwise = False | 174 | isLeapYear :: Integer -> Bool
isLeapYear year
| year `mod` 100 == 0 = if (year `mod` 400 == 0) then True else False
| year `mod` 4 == 0 = True
| otherwise = False | 174 | isLeapYear year
| year `mod` 100 == 0 = if (year `mod` 400 == 0) then True else False
| year `mod` 4 == 0 = True
| otherwise = False | 144 | false | true | 1 | 9 | 47 | 84 | 45 | 39 | null | null |
frenetic-lang/nettle-openflow | src/Nettle/OpenFlow/MessagesBinary.hs | bsd-3-clause | actionSizeInBytes StripVlanHeader = 8 | 41 | actionSizeInBytes StripVlanHeader = 8 | 41 | actionSizeInBytes StripVlanHeader = 8 | 41 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
patrickherrmann/sudoku | src/Sudoku.hs | mit | set :: Board -> Loc -> Val -> Board
set b loc v = foldr (eliminate v) (b // [(loc, [v])]) $ relatedLocs loc | 107 | set :: Board -> Loc -> Val -> Board
set b loc v = foldr (eliminate v) (b // [(loc, [v])]) $ relatedLocs loc | 107 | set b loc v = foldr (eliminate v) (b // [(loc, [v])]) $ relatedLocs loc | 71 | false | true | 0 | 11 | 23 | 73 | 36 | 37 | null | null |
brendanhay/gogol | gogol-accessapproval/gen/Network/Google/Resource/AccessApproval/Folders/GetAccessApprovalSettings.hs | mpl-2.0 | -- | V1 error format.
fgaasXgafv :: Lens' FoldersGetAccessApprovalSettings (Maybe Xgafv)
fgaasXgafv
= lens _fgaasXgafv (\ s a -> s{_fgaasXgafv = a}) | 150 | fgaasXgafv :: Lens' FoldersGetAccessApprovalSettings (Maybe Xgafv)
fgaasXgafv
= lens _fgaasXgafv (\ s a -> s{_fgaasXgafv = a}) | 128 | fgaasXgafv
= lens _fgaasXgafv (\ s a -> s{_fgaasXgafv = a}) | 61 | true | true | 1 | 9 | 23 | 52 | 25 | 27 | null | null |
bitemyapp/tandoori | src/Tandoori/Typing/Infer.hs | bsd-3-clause | inferExpr (NegApp expr negfun) = error "infer': TODO: NegApp" | 61 | inferExpr (NegApp expr negfun) = error "infer': TODO: NegApp" | 61 | inferExpr (NegApp expr negfun) = error "infer': TODO: NegApp" | 61 | false | false | 0 | 7 | 8 | 20 | 9 | 11 | null | null |
schell/germs | src/Parser.hs | mit | wild :: Parser TCell
wild = TWild <$ char '*' <?> "TCell Wildcard" | 66 | wild :: Parser TCell
wild = TWild <$ char '*' <?> "TCell Wildcard" | 66 | wild = TWild <$ char '*' <?> "TCell Wildcard" | 45 | false | true | 0 | 7 | 12 | 25 | 12 | 13 | null | null |
akegalj/snowdrift | Handler/Project.hs | agpl-3.0 | projectDiscussionPage :: Text -> Widget -> Widget
projectDiscussionPage project_handle widget = do
$(widgetFile "project_discussion_wrapper")
toWidget $(cassiusFile "templates/comment.cassius")
-------------------------------------------------------------------------------
-- | 286 | projectDiscussionPage :: Text -> Widget -> Widget
projectDiscussionPage project_handle widget = do
$(widgetFile "project_discussion_wrapper")
toWidget $(cassiusFile "templates/comment.cassius")
-------------------------------------------------------------------------------
-- | 286 | projectDiscussionPage project_handle widget = do
$(widgetFile "project_discussion_wrapper")
toWidget $(cassiusFile "templates/comment.cassius")
-------------------------------------------------------------------------------
-- | 236 | false | true | 0 | 11 | 28 | 55 | 24 | 31 | null | null |
yu-i9/HaSS | src/Assembler.hs | mit | zipLeftover (x:xs) (y:ys) = zipLeftover xs ys | 45 | zipLeftover (x:xs) (y:ys) = zipLeftover xs ys | 45 | zipLeftover (x:xs) (y:ys) = zipLeftover xs ys | 45 | false | false | 0 | 7 | 6 | 30 | 15 | 15 | null | null |
bitemyapp/ghc | compiler/main/DynFlags.hs | bsd-3-clause | -- | Unset a 'WarningFlag'
wopt_unset :: DynFlags -> WarningFlag -> DynFlags
wopt_unset dfs f = dfs{ warningFlags = IntSet.delete (fromEnum f) (warningFlags dfs) } | 163 | wopt_unset :: DynFlags -> WarningFlag -> DynFlags
wopt_unset dfs f = dfs{ warningFlags = IntSet.delete (fromEnum f) (warningFlags dfs) } | 136 | wopt_unset dfs f = dfs{ warningFlags = IntSet.delete (fromEnum f) (warningFlags dfs) } | 86 | true | true | 0 | 9 | 24 | 52 | 27 | 25 | null | null |
manyoo/reflex-dom | src/Reflex/Dom/Widget/Basic.hs | bsd-3-clause | applyMapKeysSet :: Ord k => Map k (Maybe v) -> Set k -> Set k
applyMapKeysSet patch old = Map.keysSet insertions `Set.union` (old `Set.difference` Map.keysSet deletions)
where (insertions, deletions) = Map.partition isJust patch
--TODO: Something better than Dynamic t (Map k v) - we want something where the Events c... | 351 | applyMapKeysSet :: Ord k => Map k (Maybe v) -> Set k -> Set k
applyMapKeysSet patch old = Map.keysSet insertions `Set.union` (old `Set.difference` Map.keysSet deletions)
where (insertions, deletions) = Map.partition isJust patch
--TODO: Something better than Dynamic t (Map k v) - we want something where the Events c... | 351 | applyMapKeysSet patch old = Map.keysSet insertions `Set.union` (old `Set.difference` Map.keysSet deletions)
where (insertions, deletions) = Map.partition isJust patch
--TODO: Something better than Dynamic t (Map k v) - we want something where the Events carry diffs, not the whole value | 289 | false | true | 0 | 9 | 57 | 99 | 50 | 49 | null | null |
wxwxwwxxx/ghc | compiler/utils/Panic.hs | bsd-3-clause | pushInterruptTargetThread :: ThreadId -> IO ()
pushInterruptTargetThread tid = do
wtid <- mkWeakThreadId tid
modifyMVar_ interruptTargetThread $ return . (wtid :) | 164 | pushInterruptTargetThread :: ThreadId -> IO ()
pushInterruptTargetThread tid = do
wtid <- mkWeakThreadId tid
modifyMVar_ interruptTargetThread $ return . (wtid :) | 164 | pushInterruptTargetThread tid = do
wtid <- mkWeakThreadId tid
modifyMVar_ interruptTargetThread $ return . (wtid :) | 117 | false | true | 0 | 9 | 22 | 56 | 25 | 31 | null | null |
slpopejoy/fadno-xml | src/Fadno/MusicXml/MusicXml20.hs | bsd-2-clause | -- | Smart constructor for 'Bend'
mkBend :: Semitones -> Bend
mkBend n = Bend Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing n Nothing Nothing | 199 | mkBend :: Semitones -> Bend
mkBend n = Bend Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing n Nothing Nothing | 165 | mkBend n = Bend Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing n Nothing Nothing | 137 | true | true | 0 | 7 | 30 | 59 | 27 | 32 | null | null |
batterseapower/supercompilation-by-evaluation | Utilities.hs | bsd-3-clause | restrict :: Ord k => M.Map k v -> S.Set k -> M.Map k v
restrict m s = M.filterWithKey (\k _ -> k `S.member` s) m | 112 | restrict :: Ord k => M.Map k v -> S.Set k -> M.Map k v
restrict m s = M.filterWithKey (\k _ -> k `S.member` s) m | 112 | restrict m s = M.filterWithKey (\k _ -> k `S.member` s) m | 57 | false | true | 0 | 9 | 26 | 75 | 37 | 38 | null | null |
michaxm/task-distribution | src/Control/Distributed/Task/Distribution/TaskDistribution.hs | bsd-3-clause | handleQuerySlavePreparation :: Int -> Process QuerySlavePreparationResponse
handleQuerySlavePreparation hash = liftIO (RemoteStore.get hash) >>= return . (maybe Unprepared (\_ -> Prepared)) | 189 | handleQuerySlavePreparation :: Int -> Process QuerySlavePreparationResponse
handleQuerySlavePreparation hash = liftIO (RemoteStore.get hash) >>= return . (maybe Unprepared (\_ -> Prepared)) | 189 | handleQuerySlavePreparation hash = liftIO (RemoteStore.get hash) >>= return . (maybe Unprepared (\_ -> Prepared)) | 113 | false | true | 0 | 10 | 19 | 60 | 29 | 31 | null | null |
nushio3/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | gtDataCon = pcDataCon gtDataConName [] [] orderingTyCon | 56 | gtDataCon = pcDataCon gtDataConName [] [] orderingTyCon | 56 | gtDataCon = pcDataCon gtDataConName [] [] orderingTyCon | 56 | false | false | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
prowdsponsor/mangopay | mangopay/src/Web/MangoPay/Types.hs | bsd-3-clause | incomeRange (Amount _ _) = error "Amount should be given in euros" | 66 | incomeRange (Amount _ _) = error "Amount should be given in euros" | 66 | incomeRange (Amount _ _) = error "Amount should be given in euros" | 66 | false | false | 0 | 7 | 11 | 20 | 9 | 11 | null | null |
piccolo-lang/piccolo | src/Core/Typecheck.hs | gpl-3.0 | isBool _ = False | 38 | isBool _ = False | 38 | isBool _ = False | 38 | false | false | 0 | 5 | 25 | 9 | 4 | 5 | null | null |
benkio/VRP | src/Parameters.hs | gpl-3.0 | -- Index of the Y coordinate
yLineIndex :: Int
yLineIndex = 1 | 61 | yLineIndex :: Int
yLineIndex = 1 | 32 | yLineIndex = 1 | 14 | true | true | 0 | 4 | 11 | 12 | 7 | 5 | null | null |
HanStolpo/ghc-edit | src/GhcEdit.hs | mit | testAdder :: Int -> Int -> IO Int
testAdder x y = return $ G.testAdder x y | 74 | testAdder :: Int -> Int -> IO Int
testAdder x y = return $ G.testAdder x y | 74 | testAdder x y = return $ G.testAdder x y | 40 | false | true | 0 | 7 | 16 | 38 | 18 | 20 | null | null |
bitemyapp/ganeti | src/Ganeti/OpParams.hs | bsd-2-clause | -- | Custom reader for 'ExportTarget'.
readExportTarget :: JSValue -> Text.JSON.Result ExportTarget
readExportTarget (JSString s) = liftM ExportTargetLocal $
mkNonEmpty (fromJSString s) | 217 | readExportTarget :: JSValue -> Text.JSON.Result ExportTarget
readExportTarget (JSString s) = liftM ExportTargetLocal $
mkNonEmpty (fromJSString s) | 178 | readExportTarget (JSString s) = liftM ExportTargetLocal $
mkNonEmpty (fromJSString s) | 117 | true | true | 0 | 8 | 53 | 47 | 23 | 24 | null | null |
bjpop/berp | libs/src/Berp/Compile/PySyntaxUtils.hs | bsd-3-clause | call :: ExprSpan -> [ExprSpan] -> ExprSpan
call fun args =
Call { call_fun = fun, call_args = map argExpr args, expr_annot = SpanEmpty } | 139 | call :: ExprSpan -> [ExprSpan] -> ExprSpan
call fun args =
Call { call_fun = fun, call_args = map argExpr args, expr_annot = SpanEmpty } | 139 | call fun args =
Call { call_fun = fun, call_args = map argExpr args, expr_annot = SpanEmpty } | 96 | false | true | 0 | 7 | 27 | 52 | 29 | 23 | null | null |
jean-edouard/manager | dbd2/Utils.hs | gpl-2.0 | mapOne el f (x:xs)
| x == el = f x : xs
| otherwise = x : mapOne el f xs | 88 | mapOne el f (x:xs)
| x == el = f x : xs
| otherwise = x : mapOne el f xs | 88 | mapOne el f (x:xs)
| x == el = f x : xs
| otherwise = x : mapOne el f xs | 88 | false | false | 1 | 8 | 37 | 57 | 26 | 31 | null | null |
msakai/folkung | Haskell/Equinox/ConSat.hs | mit | newCon :: String -> Weight -> C Con
newCon x w = MkC (\s ->
let n = counter s
n' = n+1
c = con n w x
in n' `seq` c `seq` return (c, s{ counter = n' })
) | 173 | newCon :: String -> Weight -> C Con
newCon x w = MkC (\s ->
let n = counter s
n' = n+1
c = con n w x
in n' `seq` c `seq` return (c, s{ counter = n' })
) | 173 | newCon x w = MkC (\s ->
let n = counter s
n' = n+1
c = con n w x
in n' `seq` c `seq` return (c, s{ counter = n' })
) | 137 | false | true | 0 | 14 | 62 | 102 | 54 | 48 | null | null |
jsnajder/fer3-catalogue | src/CSV.hs | bsd-3-clause | printCSV :: CSV -> IO ()
printCSV = putStr . showCSV | 52 | printCSV :: CSV -> IO ()
printCSV = putStr . showCSV | 52 | printCSV = putStr . showCSV | 27 | false | true | 0 | 7 | 10 | 24 | 12 | 12 | null | null |
sdiehl/ghc | libraries/base/Text/ParserCombinators/ReadPrec.hs | bsd-3-clause | lift :: ReadP a -> ReadPrec a
-- ^ Lift a precedence-insensitive 'ReadP' to a 'ReadPrec'.
lift m = P (\_ -> m) | 110 | lift :: ReadP a -> ReadPrec a
lift m = P (\_ -> m) | 50 | lift m = P (\_ -> m) | 20 | true | true | 0 | 7 | 22 | 36 | 18 | 18 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | primOpInfo Int642Word64 =
mkGenPrimOp (fsLit "int64ToWord64#") [] [int64PrimTy] word64PrimTy | 101 | primOpInfo Int642Word64 =
mkGenPrimOp (fsLit "int64ToWord64#") [] [int64PrimTy] word64PrimTy | 101 | primOpInfo Int642Word64 =
mkGenPrimOp (fsLit "int64ToWord64#") [] [int64PrimTy] word64PrimTy | 101 | false | false | 0 | 7 | 17 | 29 | 14 | 15 | null | null |
neothemachine/monadiccp | src/Control/CP/FD/SimpleFD.hs | bsd-3-clause | itake [] _ _ = [] | 17 | itake [] _ _ = [] | 17 | itake [] _ _ = [] | 17 | false | false | 0 | 6 | 5 | 17 | 8 | 9 | null | null |
mocnik-science/chorale-geo | tests/Chorale/Geo/Test/Coordinates.hs | mit | -- --== Symmetry
testSymmetry :: Test
testSymmetry = testGroup "Symmetry" [
testProperty "cartesian coordinates" propSymmetryCartesian,
testProperty "geographic coordinates (WGS84)" propSymmetryWGS84
] | 222 | testSymmetry :: Test
testSymmetry = testGroup "Symmetry" [
testProperty "cartesian coordinates" propSymmetryCartesian,
testProperty "geographic coordinates (WGS84)" propSymmetryWGS84
] | 204 | testSymmetry = testGroup "Symmetry" [
testProperty "cartesian coordinates" propSymmetryCartesian,
testProperty "geographic coordinates (WGS84)" propSymmetryWGS84
] | 183 | true | true | 0 | 7 | 41 | 33 | 17 | 16 | null | null |
intolerable/project-utilities | pull-posts/Main.hs | bsd-3-clause | getRandomComments :: Text -> Text -> TMChan (Bool, Text, Text, Text, Text) -> IO (Either (APIError RedditError) ())
getRandomComments u p outChan = runRedditWithRateLimiting u p $ run 2500 (Just Nothing)
where
run :: MonadIO m => Int -> Maybe (Maybe (PaginationOption PostID)) -> RedditT m ()
run _ Nothing = l... | 727 | getRandomComments :: Text -> Text -> TMChan (Bool, Text, Text, Text, Text) -> IO (Either (APIError RedditError) ())
getRandomComments u p outChan = runRedditWithRateLimiting u p $ run 2500 (Just Nothing)
where
run :: MonadIO m => Int -> Maybe (Maybe (PaginationOption PostID)) -> RedditT m ()
run _ Nothing = l... | 727 | getRandomComments u p outChan = runRedditWithRateLimiting u p $ run 2500 (Just Nothing)
where
run :: MonadIO m => Int -> Maybe (Maybe (PaginationOption PostID)) -> RedditT m ()
run _ Nothing = liftIO $ atomically $ closeTMChan outChan
run n _ | n <= 0 = liftIO $ atomically $ closeTMChan outChan
run n ... | 611 | false | true | 7 | 15 | 188 | 324 | 156 | 168 | null | null |
Submitty/AnalysisTools | test/Lichen/Plagiarism/WinnowSpec.hs | bsd-3-clause | prop_windows_size :: Int -> [Int] -> Bool
prop_windows_size k l | k > 0 && k <= length l = case windows k l of
Just ws -> all (\x -> NE.length x == k) ws
Nothing -> False
| otherwise = case wi... | 365 | prop_windows_size :: Int -> [Int] -> Bool
prop_windows_size k l | k > 0 && k <= length l = case windows k l of
Just ws -> all (\x -> NE.length x == k) ws
Nothing -> False
| otherwise = case wi... | 365 | prop_windows_size k l | k > 0 && k <= length l = case windows k l of
Just ws -> all (\x -> NE.length x == k) ws
Nothing -> False
| otherwise = case windows k l of Just _ -> False; Nothing -> T... | 323 | false | true | 1 | 14 | 181 | 132 | 62 | 70 | null | null |
Chobbes/BatchMTLR | BatchMTLR/Main.hs | mit | runEverything :: CreateProcess -> [[ArgumentFile]] -> IO [(Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)]
runEverything process = mapM (runFileArgs process) | 167 | runEverything :: CreateProcess -> [[ArgumentFile]] -> IO [(Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)]
runEverything process = mapM (runFileArgs process) | 167 | runEverything process = mapM (runFileArgs process) | 50 | false | true | 0 | 11 | 19 | 68 | 34 | 34 | null | null |
romanb/amazonka | amazonka-ecs/gen/Network/AWS/ECS/ListTasks.hs | mpl-2.0 | -- | The 'startedBy' value that you want to filter the task results with. Specifying
-- a 'startedBy' value will limit the results to tasks that were started with that
-- value.
ltStartedBy :: Lens' ListTasks (Maybe Text)
ltStartedBy = lens _ltStartedBy (\s a -> s { _ltStartedBy = a }) | 286 | ltStartedBy :: Lens' ListTasks (Maybe Text)
ltStartedBy = lens _ltStartedBy (\s a -> s { _ltStartedBy = a }) | 108 | ltStartedBy = lens _ltStartedBy (\s a -> s { _ltStartedBy = a }) | 64 | true | true | 0 | 9 | 50 | 48 | 27 | 21 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/Resources/ElasticLoadBalancingV2TargetGroup.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-targetgroup.html#cfn-elasticloadbalancingv2-targetgroup-healthcheckport
elbvtgHealthCheckPort :: Lens' ElasticLoadBalancingV2TargetGroup (Maybe (Val Text))
elbvtgHealthCheckPort = lens _elasticLoadBalancingV2TargetGro... | 407 | elbvtgHealthCheckPort :: Lens' ElasticLoadBalancingV2TargetGroup (Maybe (Val Text))
elbvtgHealthCheckPort = lens _elasticLoadBalancingV2TargetGroupHealthCheckPort (\s a -> s { _elasticLoadBalancingV2TargetGroupHealthCheckPort = a }) | 232 | elbvtgHealthCheckPort = lens _elasticLoadBalancingV2TargetGroupHealthCheckPort (\s a -> s { _elasticLoadBalancingV2TargetGroupHealthCheckPort = a }) | 148 | true | true | 1 | 9 | 22 | 55 | 28 | 27 | null | null |
samstokes/yesodoro-reboot | Application.hs | bsd-2-clause | combineMappings _ _ = error "not a mapping!" | 44 | combineMappings _ _ = error "not a mapping!" | 44 | combineMappings _ _ = error "not a mapping!" | 44 | false | false | 0 | 5 | 7 | 14 | 6 | 8 | null | null |
rhysd/mal | haskell/Types.hs | mpl-2.0 | _get_call _ = throwStr "_get_call first parameter is not a function " | 69 | _get_call _ = throwStr "_get_call first parameter is not a function " | 69 | _get_call _ = throwStr "_get_call first parameter is not a function " | 69 | false | false | 0 | 5 | 11 | 12 | 5 | 7 | null | null |
CindyLinz/Haskell.js | trans/src/Desugar/String.hs | mit | deStringBooleanFormula (AndFormula l booleanFormula) = AndFormula (id l) (fmap (deStringBooleanFormula) booleanFormula) | 119 | deStringBooleanFormula (AndFormula l booleanFormula) = AndFormula (id l) (fmap (deStringBooleanFormula) booleanFormula) | 119 | deStringBooleanFormula (AndFormula l booleanFormula) = AndFormula (id l) (fmap (deStringBooleanFormula) booleanFormula) | 119 | false | false | 0 | 8 | 10 | 39 | 19 | 20 | null | null |
tidalcycles/tidal-midi | Sound/Tidal/MIDI/Control.hs | gpl-3.0 | mCC :: S.Param -> Int -> ControlChange
mCC p m = CC {param=p, midi=m, range=(0, 127), scalef=mapRange } | 103 | mCC :: S.Param -> Int -> ControlChange
mCC p m = CC {param=p, midi=m, range=(0, 127), scalef=mapRange } | 103 | mCC p m = CC {param=p, midi=m, range=(0, 127), scalef=mapRange } | 64 | false | true | 0 | 7 | 17 | 58 | 34 | 24 | null | null |
tonymorris/validation | examples/PolymorphicEmail.hs | bsd-3-clause | -- ***** Example usage *****
success :: (Applicative (f [VError]), Validate f) => f [VError] Email
success = email "bob@gmail.com" | 130 | success :: (Applicative (f [VError]), Validate f) => f [VError] Email
success = email "bob@gmail.com" | 101 | success = email "bob@gmail.com" | 31 | true | true | 0 | 10 | 19 | 53 | 26 | 27 | null | null |
nh2/shake | Development/Shake/Util.hs | bsd-3-clause | writeIORef'' :: IORef a -> a -> IO ()
writeIORef'' ref !x = writeIORef ref x | 76 | writeIORef'' :: IORef a -> a -> IO ()
writeIORef'' ref !x = writeIORef ref x | 76 | writeIORef'' ref !x = writeIORef ref x | 38 | false | true | 0 | 8 | 15 | 38 | 17 | 21 | null | null |
elaye/svg-parser | example/Main.hs | bsd-3-clause | printSVG :: SVG -> IO ()
printSVG svg = do
putStrLn "\n-------------------------"
putStrLn "SVG\n"
putStrLn (SVG.prettyPrint svg)
putStrLn "\n-------------------------"
putStrLn "Cleaned SVG\n"
putStrLn $ case (SVG.clean svg) of
Just s -> SVG.prettyPrint s
Nothing -> "Empty SVG"
putStrLn "--------... | 338 | printSVG :: SVG -> IO ()
printSVG svg = do
putStrLn "\n-------------------------"
putStrLn "SVG\n"
putStrLn (SVG.prettyPrint svg)
putStrLn "\n-------------------------"
putStrLn "Cleaned SVG\n"
putStrLn $ case (SVG.clean svg) of
Just s -> SVG.prettyPrint s
Nothing -> "Empty SVG"
putStrLn "--------... | 338 | printSVG svg = do
putStrLn "\n-------------------------"
putStrLn "SVG\n"
putStrLn (SVG.prettyPrint svg)
putStrLn "\n-------------------------"
putStrLn "Cleaned SVG\n"
putStrLn $ case (SVG.clean svg) of
Just s -> SVG.prettyPrint s
Nothing -> "Empty SVG"
putStrLn "-------------------------" | 313 | false | true | 0 | 13 | 60 | 111 | 46 | 65 | null | null |
mfine/postgresql-schema | src/Database/PostgreSQL/Schema.hs | mit | add :: FilePath -> FilePath -> FilePath -> Sh ()
add migration file dir = do
echo $ "A " <> toTextIgnore file <> " -> " <> toTextIgnore (dir </> migration)
mv file (dir </> migration)
-- | Apply bootstrap migrations to a database. Checks if a database
-- has been previously bootstrapped, and applies all bootstrap
... | 478 | add :: FilePath -> FilePath -> FilePath -> Sh ()
add migration file dir = do
echo $ "A " <> toTextIgnore file <> " -> " <> toTextIgnore (dir </> migration)
mv file (dir </> migration)
-- | Apply bootstrap migrations to a database. Checks if a database
-- has been previously bootstrapped, and applies all bootstrap
... | 478 | add migration file dir = do
echo $ "A " <> toTextIgnore file <> " -> " <> toTextIgnore (dir </> migration)
mv file (dir </> migration)
-- | Apply bootstrap migrations to a database. Checks if a database
-- has been previously bootstrapped, and applies all bootstrap
-- migrations if it has not been previously boots... | 429 | false | true | 0 | 10 | 87 | 87 | 44 | 43 | null | null |
grzegorzbalcerek/orgmode | Render.hs | bsd-2-clause | -- jak jest w tekście ¨ lub w separatorze, to albo zaczyna się albo kontynuuje wielokomórkowa seria
renderCells n sep (cell:nextcell:cells)
| elem '¨' cell || elem '¨' sep
= renderCells n ('¨':sep) $ (cell ++ nextcell):cells | 228 | renderCells n sep (cell:nextcell:cells)
| elem '¨' cell || elem '¨' sep
= renderCells n ('¨':sep) $ (cell ++ nextcell):cells | 128 | renderCells n sep (cell:nextcell:cells)
| elem '¨' cell || elem '¨' sep
= renderCells n ('¨':sep) $ (cell ++ nextcell):cells | 128 | true | false | 0 | 10 | 40 | 72 | 35 | 37 | null | null |
mettekou/ghc | compiler/iface/IfaceType.hs | bsd-3-clause | suppressIfaceInvisibles :: DynFlags -> [IfaceTyConBinder] -> [a] -> [a]
suppressIfaceInvisibles dflags tys xs
| gopt Opt_PrintExplicitKinds dflags = xs
| otherwise = suppress tys xs
where
suppress _ [] = []
suppress [] a = a
suppress (k:ks) a@(_:xs)
| isInvisibleT... | 388 | suppressIfaceInvisibles :: DynFlags -> [IfaceTyConBinder] -> [a] -> [a]
suppressIfaceInvisibles dflags tys xs
| gopt Opt_PrintExplicitKinds dflags = xs
| otherwise = suppress tys xs
where
suppress _ [] = []
suppress [] a = a
suppress (k:ks) a@(_:xs)
| isInvisibleT... | 388 | suppressIfaceInvisibles dflags tys xs
| gopt Opt_PrintExplicitKinds dflags = xs
| otherwise = suppress tys xs
where
suppress _ [] = []
suppress [] a = a
suppress (k:ks) a@(_:xs)
| isInvisibleTyConBinder k = suppress ks xs
| otherwise = a | 316 | false | true | 6 | 8 | 128 | 137 | 69 | 68 | null | null |
GaloisInc/halvm-ghc | compiler/basicTypes/NameEnv.hs | bsd-3-clause | extendNameEnvList_C x y z = addListToUFM_C x y z | 48 | extendNameEnvList_C x y z = addListToUFM_C x y z | 48 | extendNameEnvList_C x y z = addListToUFM_C x y z | 48 | false | false | 1 | 5 | 8 | 27 | 9 | 18 | null | null |
Megaleo/Minehack | src/World.hs | bsd-3-clause | -- | The standart multiplication factor for
-- CPM and biome generation (CPM stands for
-- "Chunk Perlin Map").
stdMult :: Double
stdMult = 100.0 | 145 | stdMult :: Double
stdMult = 100.0 | 33 | stdMult = 100.0 | 15 | true | true | 0 | 4 | 24 | 14 | 9 | 5 | null | null |
ezyang/ghc | testsuite/tests/rts/T10672/Printf.hs | bsd-3-clause | -- Parse a format string. This is left largely to you
-- as we are here interested in building our first ever
-- Template Haskell program and not in building printf.
parse :: String -> [Format]
parse s = [ L s ] | 214 | parse :: String -> [Format]
parse s = [ L s ] | 47 | parse s = [ L s ] | 19 | true | true | 0 | 6 | 45 | 30 | 17 | 13 | null | null |
yu-i9/HaSC | src/HaSC/Prim/Parser.hs | mit | lexer :: P.TokenParser st
lexer = P.makeTokenParser def | 55 | lexer :: P.TokenParser st
lexer = P.makeTokenParser def | 55 | lexer = P.makeTokenParser def | 29 | false | true | 0 | 6 | 7 | 21 | 10 | 11 | null | null |
dvcolgan/LanguageSurvey | programs/Main.hs | mit | removeNOfAKind :: Int -> (Int, [Int]) -> (Int, [Int])
removeNOfAKind n (score, dice)
| length dice < n = (score, dice)
| all (== head dice) firstN = (score + scoreNOfAKind firstN, drop n dice)
| otherwise = (score, dice)
where firstN = take n dice
scoreNOfAKind dice =
case length... | 573 | removeNOfAKind :: Int -> (Int, [Int]) -> (Int, [Int])
removeNOfAKind n (score, dice)
| length dice < n = (score, dice)
| all (== head dice) firstN = (score + scoreNOfAKind firstN, drop n dice)
| otherwise = (score, dice)
where firstN = take n dice
scoreNOfAKind dice =
case length... | 573 | removeNOfAKind n (score, dice)
| length dice < n = (score, dice)
| all (== head dice) firstN = (score + scoreNOfAKind firstN, drop n dice)
| otherwise = (score, dice)
where firstN = take n dice
scoreNOfAKind dice =
case length dice of
6 -> 3000
... | 519 | false | true | 2 | 12 | 224 | 207 | 107 | 100 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.