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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Xophmeister/tapestry | Image.hs | mit | toGrey (ImageYA8 img) = return $ pixelMap dropTransparency img | 65 | toGrey (ImageYA8 img) = return $ pixelMap dropTransparency img | 65 | toGrey (ImageYA8 img) = return $ pixelMap dropTransparency img | 65 | false | false | 0 | 6 | 11 | 25 | 11 | 14 | null | null |
piyush-kurur/shakespeare | hamlet/test/HamletTest.hs | bsd-2-clause | caseWith :: Assertion
caseWith = do
helper "it's embedded" [hamlet|
$with n <- embed theArg
it's ^{n}ded
|] | 120 | caseWith :: Assertion
caseWith = do
helper "it's embedded" [hamlet|
$with n <- embed theArg
it's ^{n}ded
|] | 119 | caseWith = do
helper "it's embedded" [hamlet|
$with n <- embed theArg
it's ^{n}ded
|] | 97 | false | true | 0 | 8 | 30 | 30 | 14 | 16 | null | null |
hdevtools/hdevtools | src/CommandLoop.hs | mit | configSession :: IORef State -> ClientSend -> Config -> GHC.Ghc (Either String ())
configSession state clientSend config = do
eCabalGhcOpts <- case configCabal config of
Nothing ->
return $ Right []
Just cabalConfig -> do
... | 1,437 | configSession :: IORef State -> ClientSend -> Config -> GHC.Ghc (Either String ())
configSession state clientSend config = do
eCabalGhcOpts <- case configCabal config of
Nothing ->
return $ Right []
Just cabalConfig -> do
... | 1,437 | configSession state clientSend config = do
eCabalGhcOpts <- case configCabal config of
Nothing ->
return $ Right []
Just cabalConfig -> do
liftIO $ setCurrentDirectory . takeDirectory $ cabalConfigPath cabalConfig
... | 1,354 | false | true | 0 | 16 | 462 | 385 | 183 | 202 | null | null |
cbare/Etudes | haskell/interpretter_03.hs | apache-2.0 | unitM a = ("", a) | 23 | unitM a = ("", a) | 23 | unitM a = ("", a) | 23 | false | false | 1 | 5 | 10 | 18 | 8 | 10 | null | null |
AntonXue/SSTG | src/SSTG/Core/Preprocessing/Defunctionalization.hs | bsd-3-clause | defunctionalize :: a
defunctionalize = undefined | 48 | defunctionalize :: a
defunctionalize = undefined | 48 | defunctionalize = undefined | 27 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
kindohm/Tidal | Sound/Tidal/Tempo.hs | gpl-3.0 | addClient client clients = client : clients | 43 | addClient client clients = client : clients | 43 | addClient client clients = client : clients | 43 | false | false | 0 | 5 | 6 | 16 | 7 | 9 | null | null |
tittoassini/flat | test/Test/Data/Values.hs | bsd-3-clause | wordsT = ("words",wordsV) | 25 | wordsT = ("words",wordsV) | 25 | wordsT = ("words",wordsV) | 25 | false | false | 0 | 5 | 2 | 12 | 7 | 5 | null | null |
diagrams/diagrams-contrib | src/Diagrams/Color/XKCD.hs | bsd-3-clause | lightPastelGreen = fromJust $ readHexColor "#b2fba5" | 57 | lightPastelGreen = fromJust $ readHexColor "#b2fba5" | 57 | lightPastelGreen = fromJust $ readHexColor "#b2fba5" | 57 | false | false | 0 | 6 | 10 | 13 | 6 | 7 | null | null |
janschulz/pandoc | src/Text/Pandoc/Readers/Markdown.hs | gpl-2.0 | indentSpaces :: MarkdownParser String
indentSpaces = try $ do
tabStop <- getOption readerTabStop
count tabStop (char ' ') <|>
string "\t" <?> "indentation" | 163 | indentSpaces :: MarkdownParser String
indentSpaces = try $ do
tabStop <- getOption readerTabStop
count tabStop (char ' ') <|>
string "\t" <?> "indentation" | 163 | indentSpaces = try $ do
tabStop <- getOption readerTabStop
count tabStop (char ' ') <|>
string "\t" <?> "indentation" | 125 | false | true | 0 | 12 | 30 | 53 | 24 | 29 | null | null |
mstksg/hledger | hledger-lib/Hledger/Data/Journal.hs | gpl-3.0 | journalConvertAmountsToCost :: Journal -> Journal
journalConvertAmountsToCost j@Journal{jtxns=ts} = j{jtxns=map fixtransaction ts}
where
-- similar to journalApplyCommodityStyles
fixtransaction t@Transaction{tpostings=ps} = t{tpostings=map fixposting ps}
fixposting p@Posting{pamount=a} = p{pamount... | 2,001 | journalConvertAmountsToCost :: Journal -> Journal
journalConvertAmountsToCost j@Journal{jtxns=ts} = j{jtxns=map fixtransaction ts}
where
-- similar to journalApplyCommodityStyles
fixtransaction t@Transaction{tpostings=ps} = t{tpostings=map fixposting ps}
fixposting p@Posting{pamount=a} = p{pamount... | 2,001 | journalConvertAmountsToCost j@Journal{jtxns=ts} = j{jtxns=map fixtransaction ts}
where
-- similar to journalApplyCommodityStyles
fixtransaction t@Transaction{tpostings=ps} = t{tpostings=map fixposting ps}
fixposting p@Posting{pamount=a} = p{pamount=fixmixedamount a}
fixmixedamount (Mixed as)... | 1,951 | false | true | 4 | 8 | 320 | 201 | 107 | 94 | null | null |
rueshyna/gogol | gogol-apps-licensing/gen/Network/Google/Resource/Licensing/LicenseAssignments/Patch.hs | mpl-2.0 | -- | Name for sku for which license would be revoked
lapSKUId :: Lens' LicenseAssignmentsPatch Text
lapSKUId = lens _lapSKUId (\ s a -> s{_lapSKUId = a}) | 153 | lapSKUId :: Lens' LicenseAssignmentsPatch Text
lapSKUId = lens _lapSKUId (\ s a -> s{_lapSKUId = a}) | 100 | lapSKUId = lens _lapSKUId (\ s a -> s{_lapSKUId = a}) | 53 | true | true | 0 | 9 | 26 | 40 | 22 | 18 | null | null |
brendanhay/gogol | gogol-youtube/gen/Network/Google/Resource/YouTube/Comments/Insert.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
comUploadType :: Lens' CommentsInsert (Maybe Text)
comUploadType
= lens _comUploadType
(\ s a -> s{_comUploadType = a}) | 198 | comUploadType :: Lens' CommentsInsert (Maybe Text)
comUploadType
= lens _comUploadType
(\ s a -> s{_comUploadType = a}) | 127 | comUploadType
= lens _comUploadType
(\ s a -> s{_comUploadType = a}) | 76 | true | true | 0 | 9 | 34 | 46 | 25 | 21 | null | null |
kongra/kask-base | src/Kask/Data/List.hs | bsd-3-clause | takeWhileI p (x:xs) = x : if p x then takeWhileI p xs else [] | 61 | takeWhileI p (x:xs) = x : if p x then takeWhileI p xs else [] | 61 | takeWhileI p (x:xs) = x : if p x then takeWhileI p xs else [] | 61 | false | false | 0 | 7 | 14 | 40 | 20 | 20 | null | null |
joshcough/Scrabble | src/Scrabble/Game.hs | mit | newGame :: NonEmpty (Int -> Player) -> IO Game
newGame ps = do
let players = (\(f,i) -> f i) <$> NE.zip ps (NE.fromList [0..])
bag <- newBag
dict <- Scrabble.Dictionary.englishDictionary
let (players',bag') = filledRacks players bag
return $ Game (NE.reverse players') newBoard bag' dict [] where
filledRack... | 571 | newGame :: NonEmpty (Int -> Player) -> IO Game
newGame ps = do
let players = (\(f,i) -> f i) <$> NE.zip ps (NE.fromList [0..])
bag <- newBag
dict <- Scrabble.Dictionary.englishDictionary
let (players',bag') = filledRacks players bag
return $ Game (NE.reverse players') newBoard bag' dict [] where
filledRack... | 571 | newGame ps = do
let players = (\(f,i) -> f i) <$> NE.zip ps (NE.fromList [0..])
bag <- newBag
dict <- Scrabble.Dictionary.englishDictionary
let (players',bag') = filledRacks players bag
return $ Game (NE.reverse players') newBoard bag' dict [] where
filledRacks :: NonEmpty Player -> Bag -> (NonEmpty Player... | 524 | false | true | 0 | 14 | 116 | 307 | 154 | 153 | null | null |
ganeti-github-testing/ganeti-test-1 | src/Ganeti/Query/Instance.hs | bsd-2-clause | statusExtract :: ConfigData -> Runtime -> Instance -> ResultEntry
statusExtract cfg res inst =
rsNormal . J.showJSON . instanceStatusToRaw $
determineInstanceStatus cfg res inst | 183 | statusExtract :: ConfigData -> Runtime -> Instance -> ResultEntry
statusExtract cfg res inst =
rsNormal . J.showJSON . instanceStatusToRaw $
determineInstanceStatus cfg res inst | 183 | statusExtract cfg res inst =
rsNormal . J.showJSON . instanceStatusToRaw $
determineInstanceStatus cfg res inst | 117 | false | true | 0 | 8 | 29 | 51 | 25 | 26 | null | null |
Yuras/hfd | src/hfd.hs | bsd-3-clause | rocessCmd UCmdTest = processUserInput
| 52 | processCmd UCmdTest = processUserInput | 52 | processCmd UCmdTest = processUserInput | 52 | false | false | 0 | 5 | 18 | 9 | 4 | 5 | null | null |
lpeterse/koka | src/Kind/Kind.hs | apache-2.0 | -- | Standard kind constants with their kind.
builtinKinds :: [(Name,Kind)]
builtinKinds
= [(nameKindStar, kindStar)
,(nameKindFun, kindArrow)
,(nameKindPred, kindPred)
,(nameKindEffect, kindEffect)
,(nameKindLabel, kindLabel)
,(nameKindHeap, kindHeap)
] | 280 | builtinKinds :: [(Name,Kind)]
builtinKinds
= [(nameKindStar, kindStar)
,(nameKindFun, kindArrow)
,(nameKindPred, kindPred)
,(nameKindEffect, kindEffect)
,(nameKindLabel, kindLabel)
,(nameKindHeap, kindHeap)
] | 234 | builtinKinds
= [(nameKindStar, kindStar)
,(nameKindFun, kindArrow)
,(nameKindPred, kindPred)
,(nameKindEffect, kindEffect)
,(nameKindLabel, kindLabel)
,(nameKindHeap, kindHeap)
] | 204 | true | true | 0 | 8 | 51 | 78 | 49 | 29 | null | null |
siddhanathan/ghc | compiler/coreSyn/CoreFVs.hs | bsd-3-clause | expr_fvs (Let (Rec pairs) body)
= addBndrs (map fst pairs)
(foldr (union . rhs_fvs) (expr_fvs body) pairs) | 121 | expr_fvs (Let (Rec pairs) body)
= addBndrs (map fst pairs)
(foldr (union . rhs_fvs) (expr_fvs body) pairs) | 121 | expr_fvs (Let (Rec pairs) body)
= addBndrs (map fst pairs)
(foldr (union . rhs_fvs) (expr_fvs body) pairs) | 121 | false | false | 0 | 8 | 31 | 61 | 29 | 32 | null | null |
reuleaux/pire | src/Pire/Parser/Binder.hs | bsd-3-clause | inder_ :: (TokParsing m
, DeltaParsing m
, MonadState PiState m
)
=> m (Binder T.Text)
binder_ =
try (do
bo <- bracketOpen_
(n, ws) <- var2_
bc <- bracketClose_
return (BinderInBrackets bo (Binder_ n ws) bc)
... | 375 | binder_ :: (TokParsing m
, DeltaParsing m
, MonadState PiState m
)
=> m (Binder T.Text)
binder_ =
try (do
bo <- bracketOpen_
(n, ws) <- var2_
bc <- bracketClose_
return (BinderInBrackets bo (Binder_ n ws) bc)
... | 375 | binder_ =
try (do
bo <- bracketOpen_
(n, ws) <- var2_
bc <- bracketClose_
return (BinderInBrackets bo (Binder_ n ws) bc)
)
<|> (var2_ >>= \(n, ws) -> return (Binder_ n ws)) | 223 | false | true | 3 | 12 | 163 | 143 | 71 | 72 | null | null |
sordina/blank-canvas | examples/square/Main.hs | bsd-3-clause | main = blankCanvas 3000 $ \ context -> do
let loop (x,y) (color:colors) = do
send context $ do
save()
translate (x,y)
beginPath()
moveTo(-100,-100)
lineTo(-100,100)
... | 964 | main = blankCanvas 3000 $ \ context -> do
let loop (x,y) (color:colors) = do
send context $ do
save()
translate (x,y)
beginPath()
moveTo(-100,-100)
lineTo(-100,100)
... | 964 | main = blankCanvas 3000 $ \ context -> do
let loop (x,y) (color:colors) = do
send context $ do
save()
translate (x,y)
beginPath()
moveTo(-100,-100)
lineTo(-100,100)
... | 964 | false | false | 0 | 19 | 505 | 309 | 147 | 162 | null | null |
fpco/hlint | src/Settings.hs | bsd-3-clause | readFuncs :: Exp_ -> [(String, String)]
readFuncs (App _ x y) = readFuncs x ++ readFuncs y | 90 | readFuncs :: Exp_ -> [(String, String)]
readFuncs (App _ x y) = readFuncs x ++ readFuncs y | 90 | readFuncs (App _ x y) = readFuncs x ++ readFuncs y | 50 | false | true | 0 | 7 | 16 | 47 | 24 | 23 | null | null |
shlevy/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | setCtLocOrigin :: CtLoc -> CtOrigin -> CtLoc
setCtLocOrigin ctl orig = ctl { ctl_origin = orig } | 96 | setCtLocOrigin :: CtLoc -> CtOrigin -> CtLoc
setCtLocOrigin ctl orig = ctl { ctl_origin = orig } | 96 | setCtLocOrigin ctl orig = ctl { ctl_origin = orig } | 51 | false | true | 0 | 8 | 16 | 41 | 19 | 22 | null | null |
jdreaver/eventful | eventful-dynamodb/src/Eventful/Store/DynamoDB/DynamoJSON.hs | mit | attributeValueToValue :: AttributeValue -> Value
attributeValueToValue av
| Just "__eventful-dynamodb-empty-object__" <- av ^. avS = Object HM.empty
| Just v <- av ^. avS = String v
| Just v <- av ^. avN = Number $ read $ T.unpack v
| Just v <- av ^. avBOOL = Bool v
| Just _ <- av ^. avNULL = Null
| v <- av... | 478 | attributeValueToValue :: AttributeValue -> Value
attributeValueToValue av
| Just "__eventful-dynamodb-empty-object__" <- av ^. avS = Object HM.empty
| Just v <- av ^. avS = String v
| Just v <- av ^. avN = Number $ read $ T.unpack v
| Just v <- av ^. avBOOL = Bool v
| Just _ <- av ^. avNULL = Null
| v <- av... | 478 | attributeValueToValue av
| Just "__eventful-dynamodb-empty-object__" <- av ^. avS = Object HM.empty
| Just v <- av ^. avS = String v
| Just v <- av ^. avN = Number $ read $ T.unpack v
| Just v <- av ^. avBOOL = Bool v
| Just _ <- av ^. avNULL = Null
| v <- av ^. avM, not (HM.null v) = Object $ fmap attribut... | 429 | false | true | 0 | 11 | 108 | 236 | 107 | 129 | null | null |
philipcraig/hutton | src/Exercises/ChapterOneToFive.hs | bsd-3-clause | luhn :: Int -> Int -> Int -> Int -> Bool
luhn a b c d = total `mod` 10 == 0
where
total = luhnDouble a + b + luhnDouble c + d
-- Chapter 5 | 145 | luhn :: Int -> Int -> Int -> Int -> Bool
luhn a b c d = total `mod` 10 == 0
where
total = luhnDouble a + b + luhnDouble c + d
-- Chapter 5 | 145 | luhn a b c d = total `mod` 10 == 0
where
total = luhnDouble a + b + luhnDouble c + d
-- Chapter 5 | 104 | false | true | 0 | 8 | 43 | 73 | 37 | 36 | null | null |
akru/haste-webaudio | src/Haste/WebAudio/Node.hs | mit | -- | Analyser
setFFTSize :: Analyser -> Int -> WebAudio ()
setFFTSize = (liftIO .) . jsAnalyserFFTSize | 102 | setFFTSize :: Analyser -> Int -> WebAudio ()
setFFTSize = (liftIO .) . jsAnalyserFFTSize | 88 | setFFTSize = (liftIO .) . jsAnalyserFFTSize | 43 | true | true | 0 | 8 | 16 | 33 | 18 | 15 | null | null |
airt/Haskell-99 | src/NinetyNine/P4X.hs | mit | huffman :: (Ord a, Ord n, Num n) => [(a, n)] -> [(a, String)]
huffman = sortOn fst . serialize . htree . leaves
where
leaves :: (Ord n, Num n) => [(a, n)] -> [(HTree a, n)]
leaves = sortOn snd . map (first HLeaf)
htree :: (Ord n, Num n) => [(HTree a, n)] -> HTree a
htree [(t, _)] = t
htree (x1 : ... | 780 | huffman :: (Ord a, Ord n, Num n) => [(a, n)] -> [(a, String)]
huffman = sortOn fst . serialize . htree . leaves
where
leaves :: (Ord n, Num n) => [(a, n)] -> [(HTree a, n)]
leaves = sortOn snd . map (first HLeaf)
htree :: (Ord n, Num n) => [(HTree a, n)] -> HTree a
htree [(t, _)] = t
htree (x1 : ... | 780 | huffman = sortOn fst . serialize . htree . leaves
where
leaves :: (Ord n, Num n) => [(a, n)] -> [(HTree a, n)]
leaves = sortOn snd . map (first HLeaf)
htree :: (Ord n, Num n) => [(HTree a, n)] -> HTree a
htree [(t, _)] = t
htree (x1 : x2 : xs) = htree . insertOn snd (merge x1 x2) $ xs
merge ... | 718 | false | true | 0 | 11 | 230 | 516 | 268 | 248 | null | null |
dtrifuno/holz | src/Prompt.hs | gpl-3.0 | giveEVs :: Player -> Player -> Card -> IO ()
giveEVs (Player b1 m1 t1) p2 c = do
putStrLn ""
done <- newIORef (3 :: Int)
when (length b1 < 5) $
do res <- simulate (Player b1' m1 t1) p2 sims
printResult "Bottom: " res
when (length m1 < 5) $
do res <- simulate (Player b1 m1' t1) p2 sims
prin... | 652 | giveEVs :: Player -> Player -> Card -> IO ()
giveEVs (Player b1 m1 t1) p2 c = do
putStrLn ""
done <- newIORef (3 :: Int)
when (length b1 < 5) $
do res <- simulate (Player b1' m1 t1) p2 sims
printResult "Bottom: " res
when (length m1 < 5) $
do res <- simulate (Player b1 m1' t1) p2 sims
prin... | 652 | giveEVs (Player b1 m1 t1) p2 c = do
putStrLn ""
done <- newIORef (3 :: Int)
when (length b1 < 5) $
do res <- simulate (Player b1' m1 t1) p2 sims
printResult "Bottom: " res
when (length m1 < 5) $
do res <- simulate (Player b1 m1' t1) p2 sims
printResult "Middle: " res
when (length t1 < 3)... | 607 | false | true | 4 | 13 | 204 | 322 | 148 | 174 | null | null |
snoyberg/hackage-server | Distribution/Server/Framework/Cron.hs | bsd-3-clause | armTimer :: CronState -> IO CronState
armTimer cstate@CronState{waitVar, jobQueue} = do
tid <- forkIO $
case Map.minViewWithKey jobQueue of
Nothing -> return ()
Just ((t, _), _) -> do
threadDelayUntil t
putMVar waitVar ()
return cstate { timerThread = tid } | 316 | armTimer :: CronState -> IO CronState
armTimer cstate@CronState{waitVar, jobQueue} = do
tid <- forkIO $
case Map.minViewWithKey jobQueue of
Nothing -> return ()
Just ((t, _), _) -> do
threadDelayUntil t
putMVar waitVar ()
return cstate { timerThread = tid } | 316 | armTimer cstate@CronState{waitVar, jobQueue} = do
tid <- forkIO $
case Map.minViewWithKey jobQueue of
Nothing -> return ()
Just ((t, _), _) -> do
threadDelayUntil t
putMVar waitVar ()
return cstate { timerThread = tid } | 278 | false | true | 0 | 15 | 99 | 115 | 56 | 59 | null | null |
ggreif/clash-compiler | clash-lib/src/CLaSH/Netlist/BlackBox/Util.hs | bsd-2-clause | renderTag _ (IsLit _) = error $ $(curLoc) ++ "Unexpected ~ISLIT" | 70 | renderTag _ (IsLit _) = error $ $(curLoc) ++ "Unexpected ~ISLIT" | 70 | renderTag _ (IsLit _) = error $ $(curLoc) ++ "Unexpected ~ISLIT" | 70 | false | false | 1 | 8 | 16 | 32 | 14 | 18 | null | null |
creichert/persistent | persistent-mongoDB/Database/Persist/MongoDB.hs | mit | withConnection :: (Trans.MonadIO m)
=> MongoConf
-> (ConnectionPool -> m b) -> m b
withConnection mc =
withMongoDBPool (mgDatabase mc) (T.unpack $ mgHost mc) (mgPort mc) (mgAuth mc) (mgPoolStripes mc) (mgStripeConnections mc) (mgConnectionIdleTime mc) | 283 | withConnection :: (Trans.MonadIO m)
=> MongoConf
-> (ConnectionPool -> m b) -> m b
withConnection mc =
withMongoDBPool (mgDatabase mc) (T.unpack $ mgHost mc) (mgPort mc) (mgAuth mc) (mgPoolStripes mc) (mgStripeConnections mc) (mgConnectionIdleTime mc) | 283 | withConnection mc =
withMongoDBPool (mgDatabase mc) (T.unpack $ mgHost mc) (mgPort mc) (mgAuth mc) (mgPoolStripes mc) (mgStripeConnections mc) (mgConnectionIdleTime mc) | 170 | false | true | 0 | 10 | 65 | 109 | 54 | 55 | null | null |
dec9ue/jhc_copygc | src/FrontEnd/KindInfer.hs | gpl-2.0 | aHsTypeToType :: KindEnv -> HsType -> Type
aHsTypeToType kt@KindEnv { kindEnvAssocs = at } t | (HsTyCon con,xs) <- fromTyApp t, let nn = toName TypeConstructor con, Just (n1,n2) <- Map.lookup nn at =
TAssoc {
typeCon = Tycon nn (kindOf nn kt),
typeClassArgs = map (aHsTypeToType kt) (take n1 xs),
... | 392 | aHsTypeToType :: KindEnv -> HsType -> Type
aHsTypeToType kt@KindEnv { kindEnvAssocs = at } t | (HsTyCon con,xs) <- fromTyApp t, let nn = toName TypeConstructor con, Just (n1,n2) <- Map.lookup nn at =
TAssoc {
typeCon = Tycon nn (kindOf nn kt),
typeClassArgs = map (aHsTypeToType kt) (take n1 xs),
... | 392 | aHsTypeToType kt@KindEnv { kindEnvAssocs = at } t | (HsTyCon con,xs) <- fromTyApp t, let nn = toName TypeConstructor con, Just (n1,n2) <- Map.lookup nn at =
TAssoc {
typeCon = Tycon nn (kindOf nn kt),
typeClassArgs = map (aHsTypeToType kt) (take n1 xs),
typeExtraArgs = map (aHsTypeToType kt)... | 349 | false | true | 0 | 11 | 94 | 175 | 88 | 87 | null | null |
pseudonom/persistent | persistent-test/src/Init.hs | mit | --, /=@
actual @/= expected = liftIO $ assertNotEqual "" expected actual | 72 | actual @/= expected = liftIO $ assertNotEqual "" expected actual | 64 | actual @/= expected = liftIO $ assertNotEqual "" expected actual | 64 | true | false | 0 | 6 | 11 | 24 | 11 | 13 | null | null |
onponomarev/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | enableRestrictedCommands :: Bool
enableRestrictedCommands = AutoConf.enableRestrictedCommands | 93 | enableRestrictedCommands :: Bool
enableRestrictedCommands = AutoConf.enableRestrictedCommands | 93 | enableRestrictedCommands = AutoConf.enableRestrictedCommands | 60 | false | true | 0 | 6 | 5 | 20 | 8 | 12 | null | null |
jgm/pandoc-types | src/Text/Pandoc/Builder.hs | bsd-3-clause | headerWith :: Attr -> Int -> Inlines -> Blocks
headerWith attr level = singleton . Header level attr . toList | 109 | headerWith :: Attr -> Int -> Inlines -> Blocks
headerWith attr level = singleton . Header level attr . toList | 109 | headerWith attr level = singleton . Header level attr . toList | 62 | false | true | 0 | 9 | 19 | 47 | 21 | 26 | null | null |
cies/bloodhound | src/Database/Bloodhound/Types.hs | bsd-3-clause | nonPostingsToPairs (Just (NonPostings npFragSize npNumOfFrags)) =
[ "fragment_size" .= npFragSize
, "number_of_fragments" .= npNumOfFrags] | 146 | nonPostingsToPairs (Just (NonPostings npFragSize npNumOfFrags)) =
[ "fragment_size" .= npFragSize
, "number_of_fragments" .= npNumOfFrags] | 146 | nonPostingsToPairs (Just (NonPostings npFragSize npNumOfFrags)) =
[ "fragment_size" .= npFragSize
, "number_of_fragments" .= npNumOfFrags] | 146 | false | false | 0 | 9 | 21 | 37 | 19 | 18 | null | null |
haroldcarr/juno | test/WireFormatSpec.hs | bsd-3-clause | cmdSignedRPC1, cmdSignedRPC2 :: SignedRPC
cmdSignedRPC1 = toWire nodeIdClient pubKeyClient privKeyClient cmdRPC1 | 112 | cmdSignedRPC1, cmdSignedRPC2 :: SignedRPC
cmdSignedRPC1 = toWire nodeIdClient pubKeyClient privKeyClient cmdRPC1 | 112 | cmdSignedRPC1 = toWire nodeIdClient pubKeyClient privKeyClient cmdRPC1 | 70 | false | true | 0 | 5 | 10 | 22 | 12 | 10 | null | null |
Gwin73/Schemini | src/primitives.hs | mit | intBoolBinop = binop unpackInt unpackInt Bool | 45 | intBoolBinop = binop unpackInt unpackInt Bool | 45 | intBoolBinop = binop unpackInt unpackInt Bool | 45 | false | false | 0 | 5 | 5 | 13 | 6 | 7 | null | null |
xrl/zmqhs | ZMQHS/Message.hs | bsd-3-clause | parseFrames :: AP.Parser [FrameData]
parseFrames = do
frame <- frameParser
case frame of
(MoreFrame payload) -> (payload :) <$> parseFrames
(FinalFrame payload) -> return [payload] | 193 | parseFrames :: AP.Parser [FrameData]
parseFrames = do
frame <- frameParser
case frame of
(MoreFrame payload) -> (payload :) <$> parseFrames
(FinalFrame payload) -> return [payload] | 193 | parseFrames = do
frame <- frameParser
case frame of
(MoreFrame payload) -> (payload :) <$> parseFrames
(FinalFrame payload) -> return [payload] | 156 | false | true | 0 | 11 | 37 | 71 | 36 | 35 | null | null |
urbanslug/ghc | testsuite/tests/haddock/should_compile_noflag_haddock/haddockC005.hs | bsd-3-clause | -- | 1l3i1j3 as
main = undefined | 32 | main = undefined | 16 | main = undefined | 16 | true | false | 1 | 5 | 6 | 11 | 4 | 7 | null | null |
stefan-hoeck/labeled-graph | test/GraphQC.hs | bsd-3-clause | maxChainSize ∷ Int
maxChainSize = 100 | 37 | maxChainSize ∷ Int
maxChainSize = 100 | 37 | maxChainSize = 100 | 18 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
TransformingMusicology/tabcode-haskell | src/TabCode/Serialiser/MEIXML/Elements.hs | gpl-3.0 | atNumbase :: Int -> MEIAttrs
atNumbase b = [ IntAttr "numbase" b ] | 66 | atNumbase :: Int -> MEIAttrs
atNumbase b = [ IntAttr "numbase" b ] | 66 | atNumbase b = [ IntAttr "numbase" b ] | 37 | false | true | 0 | 7 | 12 | 32 | 14 | 18 | null | null |
jaiyalas/sdl2-image | src/SDL/Image/General.hs | mit | --
bittizedFlag :: ImgInitFlag -> CInt
bittizedFlag InitJPG = IRaw.IMG_INIT_JPG | 79 | bittizedFlag :: ImgInitFlag -> CInt
bittizedFlag InitJPG = IRaw.IMG_INIT_JPG | 76 | bittizedFlag InitJPG = IRaw.IMG_INIT_JPG | 40 | true | true | 0 | 5 | 9 | 25 | 12 | 13 | null | null |
timjb/lens | src/Control/Lens/Internal/FieldTH.hs | bsd-3-clause | -- | Apply a substitution to a type. This is used after unifying
-- the types of the fields in unifyTypes.
applyTypeSubst :: Map Name Type -> Type -> Type
applyTypeSubst sub = rewrite aux
where
aux (VarT n) = Map.lookup n sub
aux _ = Nothing
---------------------------------------------------------------... | 433 | applyTypeSubst :: Map Name Type -> Type -> Type
applyTypeSubst sub = rewrite aux
where
aux (VarT n) = Map.lookup n sub
aux _ = Nothing
------------------------------------------------------------------------
-- Field generation parameters
------------------------------------------------------------------... | 326 | applyTypeSubst sub = rewrite aux
where
aux (VarT n) = Map.lookup n sub
aux _ = Nothing
------------------------------------------------------------------------
-- Field generation parameters
------------------------------------------------------------------------ | 278 | true | true | 0 | 7 | 67 | 67 | 34 | 33 | null | null |
MnO2/hindley-milner | src/HM/Normal.hs | bsd-3-clause | instSigma t1 (Infer r) = do { t1' <- instantiate t1
; writeTcRef r t1'
} | 131 | instSigma t1 (Infer r) = do { t1' <- instantiate t1
; writeTcRef r t1'
} | 131 | instSigma t1 (Infer r) = do { t1' <- instantiate t1
; writeTcRef r t1'
} | 131 | false | false | 0 | 8 | 74 | 40 | 18 | 22 | null | null |
izgzhen/aliyun-haskell-sdk | src/Aliyun/OSS.hs | apache-2.0 | putObject obj config bucketName filename region = do
let ossHeaders = []
let ossresource = Bucket bucketName (Just (filename, []))
req <- packageData obj region config NB.PUT ossHeaders ossresource bucketName
res <- Aliyun.HTTP.http req
return (H.getResponseBody res) | 288 | putObject obj config bucketName filename region = do
let ossHeaders = []
let ossresource = Bucket bucketName (Just (filename, []))
req <- packageData obj region config NB.PUT ossHeaders ossresource bucketName
res <- Aliyun.HTTP.http req
return (H.getResponseBody res) | 288 | putObject obj config bucketName filename region = do
let ossHeaders = []
let ossresource = Bucket bucketName (Just (filename, []))
req <- packageData obj region config NB.PUT ossHeaders ossresource bucketName
res <- Aliyun.HTTP.http req
return (H.getResponseBody res) | 288 | false | false | 0 | 14 | 57 | 107 | 50 | 57 | null | null |
exercism/xhaskell | exercises/practice/clock/.meta/examples/success-standard/src/Clock.hs | mit | clockHour :: Clock -> Int
clockHour = (`div` 60) . unClock | 58 | clockHour :: Clock -> Int
clockHour = (`div` 60) . unClock | 58 | clockHour = (`div` 60) . unClock | 32 | false | true | 0 | 6 | 10 | 25 | 15 | 10 | null | null |
eklinkhammer/haskell-vision | BasicIP.hs | mit | contrast :: (Image i, FromFunction i, FromFunctionPixel i ~ ImagePixel i,
PixelSize (ImagePixel i) BigRGBPixel,
Convertible i RGB,
FunctorImage RGB i)
=> Int16 -- contrast factor
-> Int16 -- Midpoint
-> i -- src
-> i -- output
contrast ... | 462 | contrast :: (Image i, FromFunction i, FromFunctionPixel i ~ ImagePixel i,
PixelSize (ImagePixel i) BigRGBPixel,
Convertible i RGB,
FunctorImage RGB i)
=> Int16 -- contrast factor
-> Int16 -- Midpoint
-> i -- src
-> i
contrast !factor !m... | 452 | contrast !factor !mid img
= let rgb = convert img :: RGB
in map (shrink . (addPixel mid) . (multPixel factor) . (subPixel mid) . expand) rgb | 151 | true | true | 0 | 12 | 159 | 163 | 80 | 83 | null | null |
aaronc/Idris-dev | src/IRTS/JavaScript/AST.hs | bsd-3-clause | jsPackSBits8 :: JS -> JS
jsPackSBits8 js = JSNew "Int8Array" [JSArray [js]] | 75 | jsPackSBits8 :: JS -> JS
jsPackSBits8 js = JSNew "Int8Array" [JSArray [js]] | 75 | jsPackSBits8 js = JSNew "Int8Array" [JSArray [js]] | 50 | false | true | 0 | 8 | 11 | 32 | 16 | 16 | null | null |
agrif/gammac | src/Language/Gamma/Typecheck.hs | apache-2.0 | abstract :: (Data a) => GammaType a -> Int -> GammaType a
abstract templ n | Set.member n (freeTypeVars templ) = UnivType (templ ^. annotation) (go 0 templ)
| otherwise = templ
where go i (FunType a x ys) = FunType a (go i x) (fmap (go i) ys)
go i (UnivType a x) = UnivType a (go (i + 1) x)
... | 534 | abstract :: (Data a) => GammaType a -> Int -> GammaType a
abstract templ n | Set.member n (freeTypeVars templ) = UnivType (templ ^. annotation) (go 0 templ)
| otherwise = templ
where go i (FunType a x ys) = FunType a (go i x) (fmap (go i) ys)
go i (UnivType a x) = UnivType a (go (i + 1) x)
... | 534 | abstract templ n | Set.member n (freeTypeVars templ) = UnivType (templ ^. annotation) (go 0 templ)
| otherwise = templ
where go i (FunType a x ys) = FunType a (go i x) (fmap (go i) ys)
go i (UnivType a x) = UnivType a (go (i + 1) x)
go i (ConstrainedType a b xs y) = ConstrainedType... | 476 | false | true | 3 | 10 | 191 | 304 | 139 | 165 | null | null |
opqdonut/riot | Riot/UI.hs | gpl-2.0 | do_draw_infoline_align status line left right = do
Curses.wMove Curses.stdScr line 0
cset_attr (attr_infoline $ attr status)
waddstr Curses.stdScr ((take n_l left_)++(take n_r right_))
creset_attr
where
left_ = left ++ (repeat ' ')
right_ = ' ':right
w = screen_width status
... | 382 | do_draw_infoline_align status line left right = do
Curses.wMove Curses.stdScr line 0
cset_attr (attr_infoline $ attr status)
waddstr Curses.stdScr ((take n_l left_)++(take n_r right_))
creset_attr
where
left_ = left ++ (repeat ' ')
right_ = ' ':right
w = screen_width status
... | 382 | do_draw_infoline_align status line left right = do
Curses.wMove Curses.stdScr line 0
cset_attr (attr_infoline $ attr status)
waddstr Curses.stdScr ((take n_l left_)++(take n_r right_))
creset_attr
where
left_ = left ++ (repeat ' ')
right_ = ' ':right
w = screen_width status
... | 382 | false | false | 4 | 11 | 110 | 152 | 72 | 80 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/showSigned_3.hs | mit | primCmpInt (Neg Zero) (Pos Zero) = EQ | 37 | primCmpInt (Neg Zero) (Pos Zero) = EQ | 37 | primCmpInt (Neg Zero) (Pos Zero) = EQ | 37 | false | false | 0 | 7 | 6 | 23 | 11 | 12 | null | null |
sellout/truffled-purescript | purescript-corefn-gen/Main.hs | apache-2.0 | jsonExpr (Case ann es as) =
J.object [ "tag" J..= ("case" :: J.Value)
-- , "ann" J..= jsonAnn ann
, "exprs" J..= (jsonExpr <$> es)
, "alternatives" J..= (jsonAlternative <$> as)
] | 225 | jsonExpr (Case ann es as) =
J.object [ "tag" J..= ("case" :: J.Value)
-- , "ann" J..= jsonAnn ann
, "exprs" J..= (jsonExpr <$> es)
, "alternatives" J..= (jsonAlternative <$> as)
] | 225 | jsonExpr (Case ann es as) =
J.object [ "tag" J..= ("case" :: J.Value)
-- , "ann" J..= jsonAnn ann
, "exprs" J..= (jsonExpr <$> es)
, "alternatives" J..= (jsonAlternative <$> as)
] | 225 | false | false | 0 | 9 | 77 | 74 | 40 | 34 | null | null |
mimi1vx/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkGrepQ5= verifyNot checkShouldUseGrepQ "rm $(ls | grep file)" | 70 | prop_checkGrepQ5= verifyNot checkShouldUseGrepQ "rm $(ls | grep file)" | 70 | prop_checkGrepQ5= verifyNot checkShouldUseGrepQ "rm $(ls | grep file)" | 70 | false | false | 1 | 5 | 7 | 15 | 5 | 10 | null | null |
aaronc/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v (LSRem (ATInt (ITFixed ty))) [x, y] = bitOp v "SRem" ty [x, y] | 69 | doOp v (LSRem (ATInt (ITFixed ty))) [x, y] = bitOp v "SRem" ty [x, y] | 69 | doOp v (LSRem (ATInt (ITFixed ty))) [x, y] = bitOp v "SRem" ty [x, y] | 69 | false | false | 1 | 11 | 14 | 55 | 27 | 28 | null | null |
thulishuang/Compiler | src/Parser.hs | bsd-3-clause | genStatsTree :: Statements -> Tree String
genStatsTree NilStat = Node "nil" Nil Nil Nil | 87 | genStatsTree :: Statements -> Tree String
genStatsTree NilStat = Node "nil" Nil Nil Nil | 87 | genStatsTree NilStat = Node "nil" Nil Nil Nil | 45 | false | true | 0 | 6 | 13 | 30 | 14 | 16 | null | null |
buckie/tsds | src/Tsds/Prim/Types.hs | apache-2.0 | nullShowVal :: (Show a) => Maybe a -> String
nullShowVal (Just v) = show v | 74 | nullShowVal :: (Show a) => Maybe a -> String
nullShowVal (Just v) = show v | 74 | nullShowVal (Just v) = show v | 29 | false | true | 0 | 7 | 14 | 39 | 19 | 20 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV :: GLenum
gl_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1 | 88 | gl_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV :: GLenum
gl_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1 | 88 | gl_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1 | 43 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
paulkoerbitz/hsbci | src/Data/HBCI/Types.hs | agpl-3.0 | liftReader :: (Monad m, MonadState HbciState m) => HbciReader a -> Hbci' HbciInfo m a
liftReader action = do
info <- ask
state <- get
hoistEither $! runIdentity $! runReaderT (runEitherT action) (HbciInfoInternal info state) | 230 | liftReader :: (Monad m, MonadState HbciState m) => HbciReader a -> Hbci' HbciInfo m a
liftReader action = do
info <- ask
state <- get
hoistEither $! runIdentity $! runReaderT (runEitherT action) (HbciInfoInternal info state) | 230 | liftReader action = do
info <- ask
state <- get
hoistEither $! runIdentity $! runReaderT (runEitherT action) (HbciInfoInternal info state) | 144 | false | true | 0 | 11 | 40 | 94 | 43 | 51 | null | null |
sebastiaanvisser/islay | src/Container/Tree/PersistentCont.hs | bsd-3-clause | member :: (Ord k, Binary k, Binary a) => k -> Map k a -> HeapR Bool
member k t = isJust <$> lookup k t | 102 | member :: (Ord k, Binary k, Binary a) => k -> Map k a -> HeapR Bool
member k t = isJust <$> lookup k t | 102 | member k t = isJust <$> lookup k t | 34 | false | true | 2 | 9 | 25 | 67 | 31 | 36 | null | null |
nevrenato/Hets_Fork | Syntax/ToXml.hs | gpl-2.0 | itemNameOrMap :: ItemNameMap -> Element
itemNameOrMap (ItemNameMap name m) =
add_attrs (mkNameAttr (iriToStringUnsecure name) : case m of
Nothing -> []
Just as -> [mkAttr "as" $ iriToStringUnsecure as])
$ unode "Item" () | 232 | itemNameOrMap :: ItemNameMap -> Element
itemNameOrMap (ItemNameMap name m) =
add_attrs (mkNameAttr (iriToStringUnsecure name) : case m of
Nothing -> []
Just as -> [mkAttr "as" $ iriToStringUnsecure as])
$ unode "Item" () | 232 | itemNameOrMap (ItemNameMap name m) =
add_attrs (mkNameAttr (iriToStringUnsecure name) : case m of
Nothing -> []
Just as -> [mkAttr "as" $ iriToStringUnsecure as])
$ unode "Item" () | 192 | false | true | 2 | 13 | 44 | 91 | 43 | 48 | null | null |
Dr-Horv/Advent-of-code | day09/day9.hs | mit | main :: IO ()
main = do
ls <- readInputLines "input.txt"
let paths = map readPath ls
let cityNames = cities paths
let possibleRoutes = filter (isValidRoute paths) $ permutations cityNames
let distancesOfRoutes = map (totalDistanceOfPath paths) possibleRoutes
print $ head $ reverse $ sort distan... | 346 | main :: IO ()
main = do
ls <- readInputLines "input.txt"
let paths = map readPath ls
let cityNames = cities paths
let possibleRoutes = filter (isValidRoute paths) $ permutations cityNames
let distancesOfRoutes = map (totalDistanceOfPath paths) possibleRoutes
print $ head $ reverse $ sort distan... | 346 | main = do
ls <- readInputLines "input.txt"
let paths = map readPath ls
let cityNames = cities paths
let possibleRoutes = filter (isValidRoute paths) $ permutations cityNames
let distancesOfRoutes = map (totalDistanceOfPath paths) possibleRoutes
print $ head $ reverse $ sort distancesOfRoutes
... | 332 | false | true | 0 | 13 | 77 | 123 | 54 | 69 | null | null |
rfw/cosanostra | src/Game/Cosanostra/Resolver/Action.hs | mit | emergencyPrecedence KamikazeKill{} = 8 | 38 | emergencyPrecedence KamikazeKill{} = 8 | 38 | emergencyPrecedence KamikazeKill{} = 8 | 38 | false | false | 0 | 5 | 3 | 14 | 6 | 8 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT41.hs | gpl-3.0 | sorted _ = True | 15 | sorted _ = True | 15 | sorted _ = True | 15 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
zeekay/lambdabot | unlambda/Language/Unlambda.hs | mit | apply C x = callCC (apply x . Cont) | 42 | apply C x = callCC (apply x . Cont) | 42 | apply C x = callCC (apply x . Cont) | 42 | false | false | 0 | 8 | 15 | 25 | 11 | 14 | null | null |
matthieubulte/sequent | test/Sequent/Tests.hs | bsd-3-clause | --
nestedForAll :: Predicate2 -> Judgment
nestedForAll p = [ForAll $ \a -> ForAll $ \b -> TTerm $ App2 p a b]
|- [ForAll $ \b -> ForAll $ \a -> TTerm $ App2 p a b] | 178 | nestedForAll :: Predicate2 -> Judgment
nestedForAll p = [ForAll $ \a -> ForAll $ \b -> TTerm $ App2 p a b]
|- [ForAll $ \b -> ForAll $ \a -> TTerm $ App2 p a b] | 174 | nestedForAll p = [ForAll $ \a -> ForAll $ \b -> TTerm $ App2 p a b]
|- [ForAll $ \b -> ForAll $ \a -> TTerm $ App2 p a b] | 135 | true | true | 0 | 12 | 52 | 87 | 46 | 41 | null | null |
zmoazeni/hackerrank-solutions | haskell/saveprincess/Main2.hs | mit | main :: IO ()
main = do
allInput <- getContents
let (matrix, marioPosition) = buildMatrix allInput
princessPosition = fromJust $ findPositionForChar isPrincess matrix
path = pathFromMarioToPrincess marioPosition princessPosition
printNextDirection path
where
printNextDirection = ... | 488 | main :: IO ()
main = do
allInput <- getContents
let (matrix, marioPosition) = buildMatrix allInput
princessPosition = fromJust $ findPositionForChar isPrincess matrix
path = pathFromMarioToPrincess marioPosition princessPosition
printNextDirection path
where
printNextDirection = ... | 488 | main = do
allInput <- getContents
let (matrix, marioPosition) = buildMatrix allInput
princessPosition = fromJust $ findPositionForChar isPrincess matrix
path = pathFromMarioToPrincess marioPosition princessPosition
printNextDirection path
where
printNextDirection = putStrLn . for... | 474 | false | true | 1 | 11 | 128 | 126 | 60 | 66 | null | null |
jtdaugherty/vty | tools/BuildWidthTable.hs | bsd-3-clause | updateConfigFromArg :: Arg -> Config -> Config
updateConfigFromArg Help c =
c | 81 | updateConfigFromArg :: Arg -> Config -> Config
updateConfigFromArg Help c =
c | 81 | updateConfigFromArg Help c =
c | 34 | false | true | 0 | 6 | 15 | 29 | 13 | 16 | null | null |
ezyang/ghc | compiler/utils/BooleanFormula.hs | bsd-3-clause | mkTrue = And [] | 15 | mkTrue = And [] | 15 | mkTrue = And [] | 15 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
badp/ganeti | src/Ganeti/Types.hs | gpl-2.0 | -- | Smart constructor for 'NonEmpty'.
mkNonEmpty :: (Monad m) => [a] -> m (NonEmpty a)
mkNonEmpty [] = fail "Received empty value for non-empty list" | 150 | mkNonEmpty :: (Monad m) => [a] -> m (NonEmpty a)
mkNonEmpty [] = fail "Received empty value for non-empty list" | 111 | mkNonEmpty [] = fail "Received empty value for non-empty list" | 62 | true | true | 0 | 10 | 25 | 49 | 24 | 25 | null | null |
ownclo/alohas | src/User.hs | bsd-3-clause | cleanUser :: User -> User
cleanUser = over algState ALG.cleanState | 66 | cleanUser :: User -> User
cleanUser = over algState ALG.cleanState | 66 | cleanUser = over algState ALG.cleanState | 40 | false | true | 0 | 7 | 9 | 29 | 12 | 17 | null | null |
DougBurke/swish | tests/RDFProofContextTest.hs | lgpl-2.1 | ------------------------------------------------------------
-- Full test suite, main program,
-- and useful expressions for interactive use
------------------------------------------------------------
allTests :: [TF.Test]
allTests =
[ conv "rules" testRules
, conv "rdf" testRdf
] | 291 | allTests :: [TF.Test]
allTests =
[ conv "rules" testRules
, conv "rdf" testRdf
] | 86 | allTests =
[ conv "rules" testRules
, conv "rdf" testRdf
] | 64 | true | true | 0 | 6 | 37 | 36 | 21 | 15 | null | null |
hspec/hspec | hspec-core/src/Test/Hspec/Core/Tree.hs | mit | bimapForest :: (a -> b) -> (c -> d) -> [Tree a c] -> [Tree b d]
bimapForest g f = map (bimapTree g f) | 101 | bimapForest :: (a -> b) -> (c -> d) -> [Tree a c] -> [Tree b d]
bimapForest g f = map (bimapTree g f) | 101 | bimapForest g f = map (bimapTree g f) | 37 | false | true | 0 | 9 | 24 | 69 | 35 | 34 | null | null |
rueshyna/gogol | gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs | mpl-2.0 | -- | Whether to enable all reach dimension combinations in the report.
-- Defaults to false. If enabled, the date range of the report should be
-- within the last three months.
rrcEnableAllDimensionCombinations :: Lens' ReportReachCriteria (Maybe Bool)
rrcEnableAllDimensionCombinations
= lens _rrcEnableAllDimensionCo... | 389 | rrcEnableAllDimensionCombinations :: Lens' ReportReachCriteria (Maybe Bool)
rrcEnableAllDimensionCombinations
= lens _rrcEnableAllDimensionCombinations
(\ s a -> s{_rrcEnableAllDimensionCombinations = a}) | 212 | rrcEnableAllDimensionCombinations
= lens _rrcEnableAllDimensionCombinations
(\ s a -> s{_rrcEnableAllDimensionCombinations = a}) | 136 | true | true | 0 | 8 | 56 | 51 | 27 | 24 | null | null |
mstksg/hledger | hledger-lib/Hledger/Read/Common.hs | gpl-3.0 | addAccountAlias :: MonadState Journal m => AccountAlias -> m ()
addAccountAlias a = modify' (\(j@Journal{..}) -> j{jparsealiases=a:jparsealiases}) | 146 | addAccountAlias :: MonadState Journal m => AccountAlias -> m ()
addAccountAlias a = modify' (\(j@Journal{..}) -> j{jparsealiases=a:jparsealiases}) | 146 | addAccountAlias a = modify' (\(j@Journal{..}) -> j{jparsealiases=a:jparsealiases}) | 82 | false | true | 0 | 11 | 16 | 67 | 35 | 32 | null | null |
apyrgio/snf-ganeti | src/Ganeti/Constants.hs | bsd-2-clause | -- | Overall timeout for establishing connection
rieConnectTimeout :: Int
rieConnectTimeout = 180 | 97 | rieConnectTimeout :: Int
rieConnectTimeout = 180 | 48 | rieConnectTimeout = 180 | 23 | true | true | 0 | 4 | 12 | 12 | 7 | 5 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/WebGLRenderingContextBase.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContextBase.getVertexAttrib Mozilla WebGLRenderingContextBase.getVertexAttrib documentation>
getVertexAttrib_ ::
(MonadDOM m, IsWebGLRenderingContextBase self) =>
self -> GLuint -> GLenum -> m ()
getVertexAttrib_ s... | 474 | getVertexAttrib_ ::
(MonadDOM m, IsWebGLRenderingContextBase self) =>
self -> GLuint -> GLenum -> m ()
getVertexAttrib_ self index pname
= liftDOM
(void
((toWebGLRenderingContextBase self) ^. jsf "getVertexAttrib"
[toJSVal index, toJSVal pname])) | 311 | getVertexAttrib_ self index pname
= liftDOM
(void
((toWebGLRenderingContextBase self) ^. jsf "getVertexAttrib"
[toJSVal index, toJSVal pname])) | 172 | true | true | 0 | 12 | 102 | 95 | 46 | 49 | null | null |
d12frosted/CanonicalPath | Filesystem/CanonicalPath/Internal.hs | mit | tryHome :: MonadIO m => Parser m
tryHome x = when' ("~" == x) (Just $ liftM Right homeDirectory) | 96 | tryHome :: MonadIO m => Parser m
tryHome x = when' ("~" == x) (Just $ liftM Right homeDirectory) | 96 | tryHome x = when' ("~" == x) (Just $ liftM Right homeDirectory) | 63 | false | true | 0 | 8 | 18 | 54 | 24 | 30 | null | null |
comonoidial/ALFIN | Backend/OptimizeAsm.hs | mit | substTCafTerm s (CaseOf c cc ms md xs) = (CaseOf c cc ms (fmap fst mdx) xs', fromMaybe [] (fmap snd mdx) ++ concat cs) where
mdx = fmap (substTCafBlock s) md
(xs', cs) = unzip $ map (substTCafAlt s) xs | 211 | substTCafTerm s (CaseOf c cc ms md xs) = (CaseOf c cc ms (fmap fst mdx) xs', fromMaybe [] (fmap snd mdx) ++ concat cs) where
mdx = fmap (substTCafBlock s) md
(xs', cs) = unzip $ map (substTCafAlt s) xs | 211 | substTCafTerm s (CaseOf c cc ms md xs) = (CaseOf c cc ms (fmap fst mdx) xs', fromMaybe [] (fmap snd mdx) ++ concat cs) where
mdx = fmap (substTCafBlock s) md
(xs', cs) = unzip $ map (substTCafAlt s) xs | 211 | false | false | 0 | 10 | 50 | 119 | 58 | 61 | null | null |
39aldo39/klfc | src/Util.hs | gpl-3.0 | lookupBy ∷ MonadFail m ⇒ (α → α → Bool) → α → [(α, β)] → m β
lookupBy = lookupByFrom "lookupBy" | 95 | lookupBy ∷ MonadFail m ⇒ (α → α → Bool) → α → [(α, β)] → m β
lookupBy = lookupByFrom "lookupBy" | 95 | lookupBy = lookupByFrom "lookupBy" | 34 | false | true | 0 | 10 | 21 | 56 | 29 | 27 | null | null |
Heather/Idris-dev | src/Idris/Error.hs | bsd-3-clause | getErrSpan (UniverseError fc _ _ _ _) = fc | 42 | getErrSpan (UniverseError fc _ _ _ _) = fc | 42 | getErrSpan (UniverseError fc _ _ _ _) = fc | 42 | false | false | 0 | 7 | 8 | 23 | 11 | 12 | null | null |
marcusbuffett/Clanki | src/Remove.hs | mit | runRemoveAction :: Maybe RemoveAction -> [Card] -> IO [Card]
runRemoveAction (Just RemoveDeck) cards = removeDeck cards | 123 | runRemoveAction :: Maybe RemoveAction -> [Card] -> IO [Card]
runRemoveAction (Just RemoveDeck) cards = removeDeck cards | 123 | runRemoveAction (Just RemoveDeck) cards = removeDeck cards | 62 | false | true | 0 | 8 | 19 | 45 | 22 | 23 | null | null |
dmjio/aeson | tests/ErrorMessages.hs | bsd-3-clause | outputGeneric :: Choice -> Output
outputGeneric choice = concat
[ testWith "OneConstructor"
(select
thOneConstructorParseJSONDefault
gOneConstructorParseJSONDefault)
[ "\"X\""
, "[0]"
]
, testWith "Nullary"
(select
thNullaryParseJSONString
gNullaryParse... | 2,640 | outputGeneric :: Choice -> Output
outputGeneric choice = concat
[ testWith "OneConstructor"
(select
thOneConstructorParseJSONDefault
gOneConstructorParseJSONDefault)
[ "\"X\""
, "[0]"
]
, testWith "Nullary"
(select
thNullaryParseJSONString
gNullaryParse... | 2,640 | outputGeneric choice = concat
[ testWith "OneConstructor"
(select
thOneConstructorParseJSONDefault
gOneConstructorParseJSONDefault)
[ "\"X\""
, "[0]"
]
, testWith "Nullary"
(select
thNullaryParseJSONString
gNullaryParseJSONString)
[ "\"X\""
... | 2,606 | false | true | 0 | 8 | 787 | 345 | 191 | 154 | null | null |
sinelaw/fresh | test/Spec.hs | gpl-2.0 | prop_unifySame :: Type -> Bool
prop_unifySame t =
case kind t of
Just Star -> Right () == testUnify t t
_ -> True -- don't test | 147 | prop_unifySame :: Type -> Bool
prop_unifySame t =
case kind t of
Just Star -> Right () == testUnify t t
_ -> True -- don't test | 147 | prop_unifySame t =
case kind t of
Just Star -> Right () == testUnify t t
_ -> True -- don't test | 116 | false | true | 0 | 10 | 46 | 61 | 27 | 34 | null | null |
kazu-yamamoto/http2 | bench-priority/Main.hs | bsd-3-clause | enqdeqO :: [(Key,Weight)] -> O.PriorityQueue Int
enqdeqO xs = loop pq numOfTrials
where
!pq = createO xs O.empty
loop !q 0 = q
loop !q !n = case O.dequeue q of
Nothing -> error "enqdeqO"
Just (k,p,v,q') -> loop (O.enqueue k p v q') (n - 1) | 270 | enqdeqO :: [(Key,Weight)] -> O.PriorityQueue Int
enqdeqO xs = loop pq numOfTrials
where
!pq = createO xs O.empty
loop !q 0 = q
loop !q !n = case O.dequeue q of
Nothing -> error "enqdeqO"
Just (k,p,v,q') -> loop (O.enqueue k p v q') (n - 1) | 270 | enqdeqO xs = loop pq numOfTrials
where
!pq = createO xs O.empty
loop !q 0 = q
loop !q !n = case O.dequeue q of
Nothing -> error "enqdeqO"
Just (k,p,v,q') -> loop (O.enqueue k p v q') (n - 1) | 221 | false | true | 1 | 11 | 77 | 151 | 71 | 80 | null | null |
rueshyna/gogol | gogol-classroom/gen/Network/Google/Classroom/Types/Product.hs | mpl-2.0 | -- | Token identifying the next page of results to return. If empty, no
-- further results are available.
lcwrNextPageToken :: Lens' ListCourseWorkResponse (Maybe Text)
lcwrNextPageToken
= lens _lcwrNextPageToken
(\ s a -> s{_lcwrNextPageToken = a}) | 257 | lcwrNextPageToken :: Lens' ListCourseWorkResponse (Maybe Text)
lcwrNextPageToken
= lens _lcwrNextPageToken
(\ s a -> s{_lcwrNextPageToken = a}) | 151 | lcwrNextPageToken
= lens _lcwrNextPageToken
(\ s a -> s{_lcwrNextPageToken = a}) | 88 | true | true | 2 | 9 | 43 | 56 | 26 | 30 | null | null |
jstolarek/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | needLlvm :: NatM a
needLlvm =
sorry $ unlines ["The native code generator does not support vector"
,"instructions. Please use -fllvm."] | 159 | needLlvm :: NatM a
needLlvm =
sorry $ unlines ["The native code generator does not support vector"
,"instructions. Please use -fllvm."] | 159 | needLlvm =
sorry $ unlines ["The native code generator does not support vector"
,"instructions. Please use -fllvm."] | 140 | false | true | 1 | 7 | 44 | 30 | 14 | 16 | null | null |
uduki/hsQt | Qtc/Core/QLocale.hs | bsd-2-clause | setNumberOptions :: QLocale a -> ((NumberOptions)) -> IO ()
setNumberOptions x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QLocale_setNumberOptions cobj_x0 (toCLong $ qFlags_toInt x1) | 188 | setNumberOptions :: QLocale a -> ((NumberOptions)) -> IO ()
setNumberOptions x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QLocale_setNumberOptions cobj_x0 (toCLong $ qFlags_toInt x1) | 188 | setNumberOptions x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QLocale_setNumberOptions cobj_x0 (toCLong $ qFlags_toInt x1) | 128 | false | true | 0 | 10 | 29 | 68 | 34 | 34 | null | null |
aartifact/aartifact-verifier | src/Exp.hs | mit | mkBrack Round Round e = e | 25 | mkBrack Round Round e = e | 25 | mkBrack Round Round e = e | 25 | false | false | 1 | 5 | 5 | 19 | 6 | 13 | null | null |
quyse/flaw | flaw-gl/Flaw/Graphics/GlContext.hs | mit | glSetupTextureSampling :: GLenum -> SamplerStateInfo -> IO ()
glSetupTextureSampling target samplerStateInfo@SamplerStateInfo
{ samplerWrapU = wrapU
, samplerWrapV = wrapV
, samplerWrapW = wrapW
, samplerMinLod = minLod
, samplerMaxLod = maxLod
, samplerBorderColor = borderColor
, samplerMaxAnisotropy = m... | 1,564 | glSetupTextureSampling :: GLenum -> SamplerStateInfo -> IO ()
glSetupTextureSampling target samplerStateInfo@SamplerStateInfo
{ samplerWrapU = wrapU
, samplerWrapV = wrapV
, samplerWrapW = wrapW
, samplerMinLod = minLod
, samplerMaxLod = maxLod
, samplerBorderColor = borderColor
, samplerMaxAnisotropy = m... | 1,564 | glSetupTextureSampling target samplerStateInfo@SamplerStateInfo
{ samplerWrapU = wrapU
, samplerWrapV = wrapV
, samplerWrapW = wrapW
, samplerMinLod = minLod
, samplerMaxLod = maxLod
, samplerBorderColor = borderColor
, samplerMaxAnisotropy = maxAnisotropy
} = do
-- min filter
glTexParameteri target... | 1,502 | false | true | 0 | 11 | 257 | 245 | 121 | 124 | null | null |
forste/haReFork | refactorer/RefacAsPatterns.hs | bsd-3-clause | checkPats :: String -> HsPatP -> [ HsPatP ] -> [ HsPatP ]
checkPats _ _ [] = [] | 79 | checkPats :: String -> HsPatP -> [ HsPatP ] -> [ HsPatP ]
checkPats _ _ [] = [] | 79 | checkPats _ _ [] = [] | 21 | false | true | 0 | 8 | 18 | 40 | 21 | 19 | null | null |
neothemachine/monadiccp | src/Control/CP/FD/FD.hs | bsd-3-clause | dumpSpec :: FDSolver s => FDState s -> String
dumpSpec s =
foldl (++) "" (map (\(i,r) -> "i" ++ (show $ unVarId i) ++ "\n" ++ foldl (++) "" (map (\x -> " "++x++"\n") (mapVals (fdspIntSpec r) (Nothing : (map Just $ Set.toList $ fdspIntTypes r))))) $ Map.toList (fdsIntVars s)) ++
foldl (++) "" (map (\(i,r) -> "b" +... | 728 | dumpSpec :: FDSolver s => FDState s -> String
dumpSpec s =
foldl (++) "" (map (\(i,r) -> "i" ++ (show $ unVarId i) ++ "\n" ++ foldl (++) "" (map (\x -> " "++x++"\n") (mapVals (fdspIntSpec r) (Nothing : (map Just $ Set.toList $ fdspIntTypes r))))) $ Map.toList (fdsIntVars s)) ++
foldl (++) "" (map (\(i,r) -> "b" +... | 728 | dumpSpec s =
foldl (++) "" (map (\(i,r) -> "i" ++ (show $ unVarId i) ++ "\n" ++ foldl (++) "" (map (\x -> " "++x++"\n") (mapVals (fdspIntSpec r) (Nothing : (map Just $ Set.toList $ fdspIntTypes r))))) $ Map.toList (fdsIntVars s)) ++
foldl (++) "" (map (\(i,r) -> "b" ++ (show $ unVarId i) ++ "\n" ++ foldl (++) "" ... | 682 | false | true | 0 | 24 | 140 | 453 | 236 | 217 | null | null |
ryoia/utah-haskell | infrastructure/src/Service/Interact.hs | apache-2.0 | mkInvalidMsgResponse :: IO Msg
mkInvalidMsgResponse = mkInvalidResponse "INVALID INPUT MESSAGE" | 99 | mkInvalidMsgResponse :: IO Msg
mkInvalidMsgResponse = mkInvalidResponse "INVALID INPUT MESSAGE" | 99 | mkInvalidMsgResponse = mkInvalidResponse "INVALID INPUT MESSAGE" | 66 | false | true | 0 | 5 | 13 | 17 | 8 | 9 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2016/M12/D05/Solution.hs | mit | -- In 'backward-looking' extensional functions (such as sma), extend2
-- needs the reverse . reverse to take 'back' into the history.
-- so then we simply write here:
computeSMAs :: Fractional a => [a] -> [Indicators a]
computeSMAs = uncurry extend2 (adjoin sma (15, 50)) | 273 | computeSMAs :: Fractional a => [a] -> [Indicators a]
computeSMAs = uncurry extend2 (adjoin sma (15, 50)) | 104 | computeSMAs = uncurry extend2 (adjoin sma (15, 50)) | 51 | true | true | 0 | 10 | 46 | 59 | 30 | 29 | null | null |
DataStewardshipPortal/ds-form-engine | JQuery.hs | apache-2.0 | setCss :: String -> String -> JQuery -> IO JQuery
setCss key val jq = let keyJs = toJSString key; valJs = toJSString val in doFFI keyJs valJs jq
where
doFFI :: JSString -> JSString -> JQuery -> IO JQuery
doFFI = ffi "(function (key, val, jq) { jq.css(key, val); return jq; })" | 286 | setCss :: String -> String -> JQuery -> IO JQuery
setCss key val jq = let keyJs = toJSString key; valJs = toJSString val in doFFI keyJs valJs jq
where
doFFI :: JSString -> JSString -> JQuery -> IO JQuery
doFFI = ffi "(function (key, val, jq) { jq.css(key, val); return jq; })" | 286 | setCss key val jq = let keyJs = toJSString key; valJs = toJSString val in doFFI keyJs valJs jq
where
doFFI :: JSString -> JSString -> JQuery -> IO JQuery
doFFI = ffi "(function (key, val, jq) { jq.css(key, val); return jq; })" | 236 | false | true | 4 | 9 | 62 | 94 | 45 | 49 | null | null |
spechub/Hets | Common/XmlPickler.hs | gpl-2.0 | puWrap :: PU b c -> PU a b -> PU a c
puWrap pbc pab = PU
{ pickle = pickle pbc . pickle pab
, unpickle = \ c ->
unpickle pbc c >>= unpickle pab
} | 157 | puWrap :: PU b c -> PU a b -> PU a c
puWrap pbc pab = PU
{ pickle = pickle pbc . pickle pab
, unpickle = \ c ->
unpickle pbc c >>= unpickle pab
} | 157 | puWrap pbc pab = PU
{ pickle = pickle pbc . pickle pab
, unpickle = \ c ->
unpickle pbc c >>= unpickle pab
} | 120 | false | true | 0 | 10 | 50 | 84 | 40 | 44 | null | null |
neosam/esge | src/Esge/Base.hs | bsd-3-clause | showStorageAction :: EC.Action ()
showStorageAction = do
ingame <- EC.getIngame
let stateText = show $ EC.storage ingame
EC.setIngameResponseA "output" stateText
-- | Run given action and re register | 214 | showStorageAction :: EC.Action ()
showStorageAction = do
ingame <- EC.getIngame
let stateText = show $ EC.storage ingame
EC.setIngameResponseA "output" stateText
-- | Run given action and re register | 214 | showStorageAction = do
ingame <- EC.getIngame
let stateText = show $ EC.storage ingame
EC.setIngameResponseA "output" stateText
-- | Run given action and re register | 180 | false | true | 0 | 13 | 42 | 62 | 27 | 35 | null | null |
geekingfrog/advent-of-code | src/Y2018/Day16.hs | bsd-3-clause | exec :: Ins -> Word16 -> Word16 -> Word16 -> CPU -> Maybe CPU
exec = \case
Addr -> binOp (+) getReg getReg
Addi -> binOp (+) getReg getVal
Mulr -> binOp (*) getReg getReg
Muli -> binOp (*) getReg getVal
Banr -> binOp (.&.) getReg getReg
Bani -> binOp (.&.) getReg getVal
Borr -> binOp (.|.) getReg getReg
... | 785 | exec :: Ins -> Word16 -> Word16 -> Word16 -> CPU -> Maybe CPU
exec = \case
Addr -> binOp (+) getReg getReg
Addi -> binOp (+) getReg getVal
Mulr -> binOp (*) getReg getReg
Muli -> binOp (*) getReg getVal
Banr -> binOp (.&.) getReg getReg
Bani -> binOp (.&.) getReg getVal
Borr -> binOp (.|.) getReg getReg
... | 785 | exec = \case
Addr -> binOp (+) getReg getReg
Addi -> binOp (+) getReg getVal
Mulr -> binOp (*) getReg getReg
Muli -> binOp (*) getReg getVal
Banr -> binOp (.&.) getReg getReg
Bani -> binOp (.&.) getReg getVal
Borr -> binOp (.|.) getReg getReg
Bori -> binOp (.|.) getReg getVal
Setr -> unOp id getReg
... | 723 | false | true | 0 | 12 | 202 | 388 | 206 | 182 | null | null |
deontologician/orbRPG | Game/OrbRPG/Combinations.hs | gpl-3.0 | P Red @>> E Erbium = P Red | 26 | P Red @>> E Erbium = P Red | 26 | P Red @>> E Erbium = P Red | 26 | false | false | 3 | 6 | 7 | 23 | 9 | 14 | null | null |
omefire/lens | src/Control/Lens/Setter.hs | bsd-3-clause | -- | Adjust every target of an 'IndexedSetter', 'IndexedLens' or 'IndexedTraversal'
-- with access to the index.
--
-- @
-- ('%@~') ≡ 'iover'
-- @
--
-- When you do not need access to the index then ('%~') is more liberal in what it can accept.
--
-- @
-- l '%~' f ≡ l '%@~' 'const' f
-- @
--
-- @
-- ('%@~') :: 'Indexed... | 588 | (%@~) :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t
(%@~) = iover | 75 | (%@~) = iover | 13 | true | true | 0 | 10 | 151 | 74 | 46 | 28 | null | null |
rvion/lamdu | Lamdu/Builtins.hs | gpl-3.0 | eval :: Def.FFIName -> EvalResult pl -> EvalResult pl
eval name =
case name of
Def.FFIName ["Prelude"] "==" -> builtinEq
Def.FFIName ["Prelude"] "/=" -> builtinNotEq
Def.FFIName ["Prelude"] "<" -> builtin2Infix $ intArg (<)
Def.FFIName ["Prelude"] "<=" -> builtin2Infix $ intArg (<=)... | 1,027 | eval :: Def.FFIName -> EvalResult pl -> EvalResult pl
eval name =
case name of
Def.FFIName ["Prelude"] "==" -> builtinEq
Def.FFIName ["Prelude"] "/=" -> builtinNotEq
Def.FFIName ["Prelude"] "<" -> builtin2Infix $ intArg (<)
Def.FFIName ["Prelude"] "<=" -> builtin2Infix $ intArg (<=)... | 1,027 | eval name =
case name of
Def.FFIName ["Prelude"] "==" -> builtinEq
Def.FFIName ["Prelude"] "/=" -> builtinNotEq
Def.FFIName ["Prelude"] "<" -> builtin2Infix $ intArg (<)
Def.FFIName ["Prelude"] "<=" -> builtin2Infix $ intArg (<=)
Def.FFIName ["Prelude"] ">" -> builtin2Infix... | 973 | false | true | 0 | 14 | 250 | 371 | 187 | 184 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.