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
antalsz/quantum-halftoning
src/lib/Graphics/QuantumHalftoning/Canvas.hs
bsd-3-clause
probabilities ∷ Canvas c s px → Vector ℝ probabilities = c_probabilities
72
probabilities ∷ Canvas c s px → Vector ℝ probabilities = c_probabilities
72
probabilities = c_probabilities
31
false
true
0
6
11
25
12
13
null
null
jfoutz/language-bash
src/Language/Bash/Parse.hs
bsd-3-clause
-- | Parse an @if@ command. ifCommand :: Parser ShellCommand ifCommand = word "if" *> if_ where if_ = If <$> compoundList <* word "then" <*> compoundList <*> alternative alternative = Just . singleton <$ word "elif" <*> if_ <|> Just <$ word "else" <*> compoundList <* word "fi" <|> Nothing <$ word "fi" -- | Parse a subshell command.
394
ifCommand :: Parser ShellCommand ifCommand = word "if" *> if_ where if_ = If <$> compoundList <* word "then" <*> compoundList <*> alternative alternative = Just . singleton <$ word "elif" <*> if_ <|> Just <$ word "else" <*> compoundList <* word "fi" <|> Nothing <$ word "fi" -- | Parse a subshell command.
366
ifCommand = word "if" *> if_ where if_ = If <$> compoundList <* word "then" <*> compoundList <*> alternative alternative = Just . singleton <$ word "elif" <*> if_ <|> Just <$ word "else" <*> compoundList <* word "fi" <|> Nothing <$ word "fi" -- | Parse a subshell command.
333
true
true
0
13
120
103
50
53
null
null
unknownloner/calccomp
FORTH/Stdlib.hs
mit
wasm "2R@" = rtn [asm| pop hl ld e,(ix + 2) ld d,(ix + 3) push de ld e,(ix + 0) ld d,(ix + 1) push de jp (hl) |]
144
wasm "2R@" = rtn [asm| pop hl ld e,(ix + 2) ld d,(ix + 3) push de ld e,(ix + 0) ld d,(ix + 1) push de jp (hl) |]
144
wasm "2R@" = rtn [asm| pop hl ld e,(ix + 2) ld d,(ix + 3) push de ld e,(ix + 0) ld d,(ix + 1) push de jp (hl) |]
144
false
false
0
5
61
17
9
8
null
null
brendanhay/gogol
gogol-dataflow/gen/Network/Google/Resource/Dataflow/Projects/Jobs/GetMetrics.hs
mpl-2.0
-- | The [regional endpoint] -- (https:\/\/cloud.google.com\/dataflow\/docs\/concepts\/regional-endpoints) -- that contains the job specified by job_id. pjgmLocation :: Lens' ProjectsJobsGetMetrics (Maybe Text) pjgmLocation = lens _pjgmLocation (\ s a -> s{_pjgmLocation = a})
278
pjgmLocation :: Lens' ProjectsJobsGetMetrics (Maybe Text) pjgmLocation = lens _pjgmLocation (\ s a -> s{_pjgmLocation = a})
125
pjgmLocation = lens _pjgmLocation (\ s a -> s{_pjgmLocation = a})
67
true
true
0
9
33
50
27
23
null
null
dblia/nosql-ganeti
test/hs/Test/Ganeti/Types.hs
gpl-2.0
-- | Test 'InstCreate' serialisation. prop_InstCreateMode_serialisation :: InstCreateMode -> Property prop_InstCreateMode_serialisation = testSerialisation
155
prop_InstCreateMode_serialisation :: InstCreateMode -> Property prop_InstCreateMode_serialisation = testSerialisation
117
prop_InstCreateMode_serialisation = testSerialisation
53
true
true
0
5
12
16
9
7
null
null
teleshoes/taffybar
src/System/Taffybar/Widget/Workspaces.hs
bsd-3-clause
getWindowIconPixbufFromChrome :: WindowIconPixbufGetter getWindowIconPixbufFromChrome _ windowData = getPixBufFromChromeData $ windowId windowData
148
getWindowIconPixbufFromChrome :: WindowIconPixbufGetter getWindowIconPixbufFromChrome _ windowData = getPixBufFromChromeData $ windowId windowData
148
getWindowIconPixbufFromChrome _ windowData = getPixBufFromChromeData $ windowId windowData
92
false
true
0
6
12
23
11
12
null
null
kim/amazonka
amazonka-cloudsearch-domains/gen/Network/AWS/CloudSearchDomains/Types.hs
mpl-2.0
-- | The fields returned from a document that matches the search request. hitFields :: Lens' Hit (HashMap Text [Text]) hitFields = lens _hitFields (\s a -> s { _hitFields = a }) . _Map
184
hitFields :: Lens' Hit (HashMap Text [Text]) hitFields = lens _hitFields (\s a -> s { _hitFields = a }) . _Map
110
hitFields = lens _hitFields (\s a -> s { _hitFields = a }) . _Map
65
true
true
0
10
34
55
30
25
null
null
alexander31415926535/Liftconsole
math-tutor2.hs
bsd-3-clause
interactive argdescr hlp function = do n <- options argdescr parser dl <- newMVar n putStrLn hlp forkIO $ forever ( readMVar dl >>= run function) catchexceptions ( forever (adjvar dl) ) where catchexceptions p = (try p :: E) >>= \case Left _ -> showCursor >> putStrLn " \nBye!" ; Right a -> return a parser = optInt "maxnumber" 'n' "Generates numbers from 0 to n" :: Parser Int -- this line is not general
424
interactive argdescr hlp function = do n <- options argdescr parser dl <- newMVar n putStrLn hlp forkIO $ forever ( readMVar dl >>= run function) catchexceptions ( forever (adjvar dl) ) where catchexceptions p = (try p :: E) >>= \case Left _ -> showCursor >> putStrLn " \nBye!" ; Right a -> return a parser = optInt "maxnumber" 'n' "Generates numbers from 0 to n" :: Parser Int -- this line is not general
424
interactive argdescr hlp function = do n <- options argdescr parser dl <- newMVar n putStrLn hlp forkIO $ forever ( readMVar dl >>= run function) catchexceptions ( forever (adjvar dl) ) where catchexceptions p = (try p :: E) >>= \case Left _ -> showCursor >> putStrLn " \nBye!" ; Right a -> return a parser = optInt "maxnumber" 'n' "Generates numbers from 0 to n" :: Parser Int -- this line is not general
424
false
false
4
11
94
166
70
96
null
null
k16shikano/qnda
src/Main.hs
mit
seqPartNumber i (x:xs) = x : (seqPartNumber i xs)
49
seqPartNumber i (x:xs) = x : (seqPartNumber i xs)
49
seqPartNumber i (x:xs) = x : (seqPartNumber i xs)
49
false
false
2
7
8
34
15
19
null
null
mcschroeder/ghc
libraries/base/GHC/Conc/Sync.hs
bsd-3-clause
-- Returns -1, 0, 1 cmpThread :: ThreadId -> ThreadId -> Ordering cmpThread t1 t2 = case cmp_thread (id2TSO t1) (id2TSO t2) of -1 -> LT 0 -> EQ _ -> GT -- must be 1
188
cmpThread :: ThreadId -> ThreadId -> Ordering cmpThread t1 t2 = case cmp_thread (id2TSO t1) (id2TSO t2) of -1 -> LT 0 -> EQ _ -> GT -- must be 1
167
cmpThread t1 t2 = case cmp_thread (id2TSO t1) (id2TSO t2) of -1 -> LT 0 -> EQ _ -> GT -- must be 1
121
true
true
0
8
59
67
34
33
null
null
forste/haReFork
StrategyLib-4.0-beta/examples/joos-rule02/Instance.hs
bsd-3-clause
referencedJoos :: TU [Identifier] Identity referencedJoos = op2TU (++) definedJoos usedJoos
92
referencedJoos :: TU [Identifier] Identity referencedJoos = op2TU (++) definedJoos usedJoos
92
referencedJoos = op2TU (++) definedJoos usedJoos
49
false
true
1
6
11
31
15
16
null
null
choener/FormalGrammars
FormalLanguage/CFG/PrettyPrint/LaTeX.hs
gpl-3.0
renderLaTeX :: Int -> Grammar -> LaTeX renderLaTeX = error "renderLaTeX"
72
renderLaTeX :: Int -> Grammar -> LaTeX renderLaTeX = error "renderLaTeX"
72
renderLaTeX = error "renderLaTeX"
33
false
true
0
6
10
22
11
11
null
null
mortberg/cubicaltt
CTT.hs
mit
def :: Decls -> Env -> Env def (MutualDecls m ds) (Env (rho,vs,fs,Nameless os)) = Env (Def m ds rho,vs,fs,Nameless (os Set.\\ Set.fromList (declIdents ds)))
156
def :: Decls -> Env -> Env def (MutualDecls m ds) (Env (rho,vs,fs,Nameless os)) = Env (Def m ds rho,vs,fs,Nameless (os Set.\\ Set.fromList (declIdents ds)))
156
def (MutualDecls m ds) (Env (rho,vs,fs,Nameless os)) = Env (Def m ds rho,vs,fs,Nameless (os Set.\\ Set.fromList (declIdents ds)))
129
false
true
0
12
24
98
51
47
null
null
elieux/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
newStablePtr_RDR :: RdrName newStablePtr_RDR = nameRdrName newStablePtrName
82
newStablePtr_RDR :: RdrName newStablePtr_RDR = nameRdrName newStablePtrName
82
newStablePtr_RDR = nameRdrName newStablePtrName
54
false
true
0
5
13
14
7
7
null
null
RossMeikleham/GPC
src/GPC/Interpreter.hs
bsd-2-clause
genMethodCall :: MethodCall -> Bool -> GenState SymbolTree genMethodCall (MethodCall var method exprs) quoted = do curThread <- getThread exprs' <- mapM reduceExpr exprs objName <- case var of VarIdent (Ident i) -> return i VarArrayElem (Ident i) e -> do e' <- reduceExpr e case e' of (ExpLit (Number (Left n))) -> return $ i ++ show n _ -> lift $ Left $ "Compiler error with array indexing, expected literal integer value got:" ++ show e' let call = Symbol $ GOpSymbol $ MkOpSymbol False ("", curThread) [objName, filter (/='"') $ show method] evalExprs <- mapM genExpr exprs' return $ SymbolList quoted (call : evalExprs) -- | Generate If Statement
798
genMethodCall :: MethodCall -> Bool -> GenState SymbolTree genMethodCall (MethodCall var method exprs) quoted = do curThread <- getThread exprs' <- mapM reduceExpr exprs objName <- case var of VarIdent (Ident i) -> return i VarArrayElem (Ident i) e -> do e' <- reduceExpr e case e' of (ExpLit (Number (Left n))) -> return $ i ++ show n _ -> lift $ Left $ "Compiler error with array indexing, expected literal integer value got:" ++ show e' let call = Symbol $ GOpSymbol $ MkOpSymbol False ("", curThread) [objName, filter (/='"') $ show method] evalExprs <- mapM genExpr exprs' return $ SymbolList quoted (call : evalExprs) -- | Generate If Statement
798
genMethodCall (MethodCall var method exprs) quoted = do curThread <- getThread exprs' <- mapM reduceExpr exprs objName <- case var of VarIdent (Ident i) -> return i VarArrayElem (Ident i) e -> do e' <- reduceExpr e case e' of (ExpLit (Number (Left n))) -> return $ i ++ show n _ -> lift $ Left $ "Compiler error with array indexing, expected literal integer value got:" ++ show e' let call = Symbol $ GOpSymbol $ MkOpSymbol False ("", curThread) [objName, filter (/='"') $ show method] evalExprs <- mapM genExpr exprs' return $ SymbolList quoted (call : evalExprs) -- | Generate If Statement
739
false
true
0
21
259
257
122
135
null
null
bitemyapp/bloodhound
src/Database/Bloodhound/Client.hs
bsd-3-clause
updateSnapshotRepo :: ( MonadBH m , SnapshotRepo repo ) => SnapshotRepoUpdateSettings -- ^ Use 'defaultSnapshotRepoUpdateSettings' if unsure -> repo -> m Reply updateSnapshotRepo SnapshotRepoUpdateSettings {..} repo = bindM2 put url (return (Just body)) where url = addQuery params <$> joinPath ["_snapshot", snapshotRepoName gSnapshotRepoName] params | repoUpdateVerify = [] | otherwise = [("verify", Just "false")] body = encode $ object [ "type" .= gSnapshotRepoType , "settings" .= gSnapshotRepoSettings ] GenericSnapshotRepo {..} = toGSnapshotRepo repo -- | Verify if a snapshot repo is working. __NOTE:__ this API did not -- make it into Elasticsearch until 1.4. If you use an older version, -- you will get an error here.
844
updateSnapshotRepo :: ( MonadBH m , SnapshotRepo repo ) => SnapshotRepoUpdateSettings -- ^ Use 'defaultSnapshotRepoUpdateSettings' if unsure -> repo -> m Reply updateSnapshotRepo SnapshotRepoUpdateSettings {..} repo = bindM2 put url (return (Just body)) where url = addQuery params <$> joinPath ["_snapshot", snapshotRepoName gSnapshotRepoName] params | repoUpdateVerify = [] | otherwise = [("verify", Just "false")] body = encode $ object [ "type" .= gSnapshotRepoType , "settings" .= gSnapshotRepoSettings ] GenericSnapshotRepo {..} = toGSnapshotRepo repo -- | Verify if a snapshot repo is working. __NOTE:__ this API did not -- make it into Elasticsearch until 1.4. If you use an older version, -- you will get an error here.
844
updateSnapshotRepo SnapshotRepoUpdateSettings {..} repo = bindM2 put url (return (Just body)) where url = addQuery params <$> joinPath ["_snapshot", snapshotRepoName gSnapshotRepoName] params | repoUpdateVerify = [] | otherwise = [("verify", Just "false")] body = encode $ object [ "type" .= gSnapshotRepoType , "settings" .= gSnapshotRepoSettings ] GenericSnapshotRepo {..} = toGSnapshotRepo repo -- | Verify if a snapshot repo is working. __NOTE:__ this API did not -- make it into Elasticsearch until 1.4. If you use an older version, -- you will get an error here.
664
false
true
14
9
222
163
89
74
null
null
sebastiaanvisser/orchid-doc
src/Text/Document/Plugin/HsColour.hs
bsd-3-clause
-------- parsers -------------------------------------------------------------- pWiki (Just (ContextWiki n)) = do (m, i) <- pIndent n (string "@@" <* many (oneOf ws) <* string "haskell") *> many pEmptyLineEol *> (trimCode <$> pLevel (m + 1)) -------- pretty printers ------------------------------------------------------
343
pWiki (Just (ContextWiki n)) = do (m, i) <- pIndent n (string "@@" <* many (oneOf ws) <* string "haskell") *> many pEmptyLineEol *> (trimCode <$> pLevel (m + 1)) -------- pretty printers ------------------------------------------------------
262
pWiki (Just (ContextWiki n)) = do (m, i) <- pIndent n (string "@@" <* many (oneOf ws) <* string "haskell") *> many pEmptyLineEol *> (trimCode <$> pLevel (m + 1)) -------- pretty printers ------------------------------------------------------
262
true
false
0
14
58
96
47
49
null
null
nevrenato/HetsAlloy
Common/Lib/Rel.hs
gpl-2.0
{- | partitions a list into a list of disjoint non-empty lists determined by the given function as equivalence classes -} partList :: (a -> a -> Bool) -> [a] -> [[a]] partList f l = case l of [] -> [] x : r -> let (ds, es) = List.partition (not . any (f x)) $ partList f r in (x : concat es) : ds -- | Divide a Set (List) into equivalence classes w.r.t. eq
369
partList :: (a -> a -> Bool) -> [a] -> [[a]] partList f l = case l of [] -> [] x : r -> let (ds, es) = List.partition (not . any (f x)) $ partList f r in (x : concat es) : ds -- | Divide a Set (List) into equivalence classes w.r.t. eq
247
partList f l = case l of [] -> [] x : r -> let (ds, es) = List.partition (not . any (f x)) $ partList f r in (x : concat es) : ds -- | Divide a Set (List) into equivalence classes w.r.t. eq
202
true
true
2
15
90
135
68
67
null
null
epeld/zatacka
old/Input.hs
apache-2.0
callback :: InputIORef -> KeyboardMouseCallback callback iorf key keyState mods pos = modifyIORef' iorf ( event : ) where event = Event key keyState mods pos
162
callback :: InputIORef -> KeyboardMouseCallback callback iorf key keyState mods pos = modifyIORef' iorf ( event : ) where event = Event key keyState mods pos
162
callback iorf key keyState mods pos = modifyIORef' iorf ( event : ) where event = Event key keyState mods pos
114
false
true
1
7
30
61
27
34
null
null
diku-kmc/repg
src/KMC/TreeWriter.hs
mit
tprepend w (Fork w' xs) = Fork (mappend w w') xs
48
tprepend w (Fork w' xs) = Fork (mappend w w') xs
48
tprepend w (Fork w' xs) = Fork (mappend w w') xs
48
false
false
0
7
10
32
15
17
null
null
ancientlanguage/haskell-analysis
grammar/src/Grammar/Common/Decompose.hs
mit
decomposeChar '\x1B0E' = "\x1B0D\x1B35"
39
decomposeChar '\x1B0E' = "\x1B0D\x1B35"
39
decomposeChar '\x1B0E' = "\x1B0D\x1B35"
39
false
false
0
5
3
9
4
5
null
null
rolph-recto/liquid-fixpoint
src/Language/Fixpoint/SortCheck.hs
bsd-3-clause
unify :: Sort -> Sort -> Maybe TVSubst ------------------------------------------------------------------------- unify t1 t2 = case runCM0 $ unify1 emptySubst t1 t2 of Left _ -> Nothing Right su -> Just su ------------------------------------------------------------------------- -- | Fast Unification; `unifyFast True` is just equality -------------------------------------------------------------------------
446
unify :: Sort -> Sort -> Maybe TVSubst unify t1 t2 = case runCM0 $ unify1 emptySubst t1 t2 of Left _ -> Nothing Right su -> Just su ------------------------------------------------------------------------- -- | Fast Unification; `unifyFast True` is just equality -------------------------------------------------------------------------
372
unify t1 t2 = case runCM0 $ unify1 emptySubst t1 t2 of Left _ -> Nothing Right su -> Just su ------------------------------------------------------------------------- -- | Fast Unification; `unifyFast True` is just equality -------------------------------------------------------------------------
333
true
true
0
8
76
71
34
37
null
null
jeremyjh/free-agent
core/src/FreeAgent/Core/Internal/Types.hs
bsd-3-clause
runAgentLoggingT :: (MonadIO m, MonadBaseControl IO m) => Int -> LoggingT m a -> m a runAgentLoggingT debugCount = runStdoutLoggingT . withChannelLogger debugCount
163
runAgentLoggingT :: (MonadIO m, MonadBaseControl IO m) => Int -> LoggingT m a -> m a runAgentLoggingT debugCount = runStdoutLoggingT . withChannelLogger debugCount
163
runAgentLoggingT debugCount = runStdoutLoggingT . withChannelLogger debugCount
78
false
true
0
8
22
57
27
30
null
null
green-haskell/ghc
compiler/prelude/TysPrim.hs
bsd-3-clause
openAlphaTyVar, openBetaTyVar :: TyVar openAlphaTyVars@(openAlphaTyVar:openBetaTyVar:_) = tyVarList openTypeKind
112
openAlphaTyVar, openBetaTyVar :: TyVar openAlphaTyVars@(openAlphaTyVar:openBetaTyVar:_) = tyVarList openTypeKind
112
openAlphaTyVars@(openAlphaTyVar:openBetaTyVar:_) = tyVarList openTypeKind
73
false
true
0
8
7
31
17
14
null
null
MarcelineVQ/advent2016
src/Day2.hs
bsd-3-clause
set :: Pos -> [Move] -> (Pos,Int) set c ms = let r = foldl (gridCursorMove grid) c ms in (r, grid ! r)
113
set :: Pos -> [Move] -> (Pos,Int) set c ms = let r = foldl (gridCursorMove grid) c ms in (r, grid ! r)
113
set c ms = let r = foldl (gridCursorMove grid) c ms in (r, grid ! r)
79
false
true
0
11
34
67
35
32
null
null
5outh/textlunky
src/Types/Room.hs
mit
addLadderD r = ladderD .~ True $ r
34
addLadderD r = ladderD .~ True $ r
34
addLadderD r = ladderD .~ True $ r
34
false
false
0
6
7
17
8
9
null
null
cdodev/scintilla
src/Scintilla/Query/Querying.hs
bsd-3-clause
mkKeyList :: Where kvs ('KV k v) -> k -> KeyList kvs mkKeyList Here k = Cons [k] mempty
87
mkKeyList :: Where kvs ('KV k v) -> k -> KeyList kvs mkKeyList Here k = Cons [k] mempty
87
mkKeyList Here k = Cons [k] mempty
34
false
true
0
10
18
54
25
29
null
null
kirhgoff/haskell-sandbox
euler28/Spiral.hs
mit
spiralAppend n (r : rs) = (r ++ [n]) : spiralAppend (n + 1) rs
62
spiralAppend n (r : rs) = (r ++ [n]) : spiralAppend (n + 1) rs
62
spiralAppend n (r : rs) = (r ++ [n]) : spiralAppend (n + 1) rs
62
false
false
0
8
14
44
23
21
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_C_COMMENTDOCKEYWORD :: Int wxSTC_C_COMMENTDOCKEYWORD = 17
63
wxSTC_C_COMMENTDOCKEYWORD :: Int wxSTC_C_COMMENTDOCKEYWORD = 17
63
wxSTC_C_COMMENTDOCKEYWORD = 17
30
false
true
0
4
5
11
6
5
null
null
tolysz/prepare-ghcjs
spec-lts8/cabal/cabal-install/Distribution/Client/ProjectConfig/Legacy.hs
bsd-3-clause
parseLegacyProjectConfig :: String -> ParseResult LegacyProjectConfig parseLegacyProjectConfig = parseConfig legacyProjectConfigFieldDescrs legacyPackageConfigSectionDescrs mempty
215
parseLegacyProjectConfig :: String -> ParseResult LegacyProjectConfig parseLegacyProjectConfig = parseConfig legacyProjectConfigFieldDescrs legacyPackageConfigSectionDescrs mempty
215
parseLegacyProjectConfig = parseConfig legacyProjectConfigFieldDescrs legacyPackageConfigSectionDescrs mempty
145
false
true
0
6
47
27
12
15
null
null
monte-language/masque
Masque/Objects/Str.hs
gpl-3.0
callStr s "multiply" [obj] _ = do count <- unwrapInt obj wrapStr . concat $ genericReplicate count s
108
callStr s "multiply" [obj] _ = do count <- unwrapInt obj wrapStr . concat $ genericReplicate count s
108
callStr s "multiply" [obj] _ = do count <- unwrapInt obj wrapStr . concat $ genericReplicate count s
108
false
false
0
8
25
44
20
24
null
null
Szczyp/lolstats
Main.hs
gpl-3.0
getSummonersChampionStats :: (MonadReader Config m, MonadWriter Log m, MonadError AppError m, MonadIO m) => Integer -> Integer -> m Text getSummonersChampionStats summonerId championId = do region <- region <$> ask let url = urlRoot region ++ "api/lol/" ++ region ++ "/v1.3/stats/by-summoner/" ++ txt summonerId ++ "/ranked" getStats <$> getData url !?? throw "Illegal json" where getStats = map (maybe "0" format . headMay . filter ((== championId) . view _1)) . mapM sequenceT . toListOf (key "champions" . values . to ((,,) <$> preview (key "id" . _Integer) <*> preview (key "stats" . key "totalSessionsPlayed" . _Integer) <*> preview (key "stats" . key "totalSessionsWon" . _Integer))) format (_, totalPlayed, won) = "(" ++ txt (round $ realToFrac won / realToFrac totalPlayed * 100) ++ "% of " ++ txt totalPlayed ++ ")"
1,104
getSummonersChampionStats :: (MonadReader Config m, MonadWriter Log m, MonadError AppError m, MonadIO m) => Integer -> Integer -> m Text getSummonersChampionStats summonerId championId = do region <- region <$> ask let url = urlRoot region ++ "api/lol/" ++ region ++ "/v1.3/stats/by-summoner/" ++ txt summonerId ++ "/ranked" getStats <$> getData url !?? throw "Illegal json" where getStats = map (maybe "0" format . headMay . filter ((== championId) . view _1)) . mapM sequenceT . toListOf (key "champions" . values . to ((,,) <$> preview (key "id" . _Integer) <*> preview (key "stats" . key "totalSessionsPlayed" . _Integer) <*> preview (key "stats" . key "totalSessionsWon" . _Integer))) format (_, totalPlayed, won) = "(" ++ txt (round $ realToFrac won / realToFrac totalPlayed * 100) ++ "% of " ++ txt totalPlayed ++ ")"
1,104
getSummonersChampionStats summonerId championId = do region <- region <$> ask let url = urlRoot region ++ "api/lol/" ++ region ++ "/v1.3/stats/by-summoner/" ++ txt summonerId ++ "/ranked" getStats <$> getData url !?? throw "Illegal json" where getStats = map (maybe "0" format . headMay . filter ((== championId) . view _1)) . mapM sequenceT . toListOf (key "champions" . values . to ((,,) <$> preview (key "id" . _Integer) <*> preview (key "stats" . key "totalSessionsPlayed" . _Integer) <*> preview (key "stats" . key "totalSessionsWon" . _Integer))) format (_, totalPlayed, won) = "(" ++ txt (round $ realToFrac won / realToFrac totalPlayed * 100) ++ "% of " ++ txt totalPlayed ++ ")"
938
false
true
3
16
411
337
159
178
null
null
snoyberg/yesodwiki
Util.hs
bsd-2-clause
nodesToText :: [Node] -> Text nodesToText input = mconcat $ unsafePerformIO $ run_ $ enumList 8 (goN input []) $$ joinI $ renderText $$ consume where goN :: [Node] -> [Event] -> [Event] goN [] e = e goN (NodeContent c:ns) e = EventContent c : goN ns e goN (NodeInstruction i:ns) e = EventInstruction i : goN ns e goN (NodeComment c:ns) e = EventComment c : goN ns e goN (NodeElement el:ns) e = goE el $ goN ns e goE :: Element -> [Event] -> [Event] goE (Element n as ns) evs = EventBeginElement n as : goN ns ( EventEndElement n : evs)
600
nodesToText :: [Node] -> Text nodesToText input = mconcat $ unsafePerformIO $ run_ $ enumList 8 (goN input []) $$ joinI $ renderText $$ consume where goN :: [Node] -> [Event] -> [Event] goN [] e = e goN (NodeContent c:ns) e = EventContent c : goN ns e goN (NodeInstruction i:ns) e = EventInstruction i : goN ns e goN (NodeComment c:ns) e = EventComment c : goN ns e goN (NodeElement el:ns) e = goE el $ goN ns e goE :: Element -> [Event] -> [Event] goE (Element n as ns) evs = EventBeginElement n as : goN ns ( EventEndElement n : evs)
600
nodesToText input = mconcat $ unsafePerformIO $ run_ $ enumList 8 (goN input []) $$ joinI $ renderText $$ consume where goN :: [Node] -> [Event] -> [Event] goN [] e = e goN (NodeContent c:ns) e = EventContent c : goN ns e goN (NodeInstruction i:ns) e = EventInstruction i : goN ns e goN (NodeComment c:ns) e = EventComment c : goN ns e goN (NodeElement el:ns) e = goE el $ goN ns e goE :: Element -> [Event] -> [Event] goE (Element n as ns) evs = EventBeginElement n as : goN ns ( EventEndElement n : evs)
570
false
true
6
12
171
308
144
164
null
null
mettekou/ghc
compiler/basicTypes/BasicTypes.hs
bsd-3-clause
isActiveIn :: PhaseNum -> Activation -> Bool isActiveIn _ NeverActive = False
84
isActiveIn :: PhaseNum -> Activation -> Bool isActiveIn _ NeverActive = False
84
isActiveIn _ NeverActive = False
39
false
true
0
8
18
30
13
17
null
null
ganeti/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
luxiReqQueryJobs :: String luxiReqQueryJobs = "QueryJobs"
57
luxiReqQueryJobs :: String luxiReqQueryJobs = "QueryJobs"
57
luxiReqQueryJobs = "QueryJobs"
30
false
true
0
4
5
11
6
5
null
null
bos/statistics
Statistics/Distribution/Hypergeometric.hs
bsd-2-clause
logProbability :: HypergeometricDistribution -> Int -> Double logProbability (HD mi li ki) n | n < max 0 (mi+ki-li) || n > min mi ki = m_neg_inf | otherwise = logChoose mi n + logChoose (li - mi) (ki - n) - logChoose li ki
254
logProbability :: HypergeometricDistribution -> Int -> Double logProbability (HD mi li ki) n | n < max 0 (mi+ki-li) || n > min mi ki = m_neg_inf | otherwise = logChoose mi n + logChoose (li - mi) (ki - n) - logChoose li ki
254
logProbability (HD mi li ki) n | n < max 0 (mi+ki-li) || n > min mi ki = m_neg_inf | otherwise = logChoose mi n + logChoose (li - mi) (ki - n) - logChoose li ki
192
false
true
3
14
76
124
58
66
null
null
AndrasKovacs/bi-zipper
Data/Traversable/BiZipper.hs
bsd-3-clause
-- | Advance the focus. Returns Nothing on walking past the end. next :: BiZipper t a -> Maybe (BiZipper t a) next (BiZipper ps (f:fs) zs@(Zipper _ k:_)) = Just $ BiZipper (f:ps) fs (k f:zs)
190
next :: BiZipper t a -> Maybe (BiZipper t a) next (BiZipper ps (f:fs) zs@(Zipper _ k:_)) = Just $ BiZipper (f:ps) fs (k f:zs)
125
next (BiZipper ps (f:fs) zs@(Zipper _ k:_)) = Just $ BiZipper (f:ps) fs (k f:zs)
80
true
true
0
10
36
99
49
50
null
null
mrBliss/haddock
haddock-api/src/Haddock/Interface/Rename.hs
bsd-2-clause
renameTyFamInstD :: TyFamInstDecl Name -> RnM (TyFamInstDecl DocName) renameTyFamInstD (TyFamInstDecl { tfid_eqn = eqn }) = do { eqn' <- renameLTyFamInstEqn eqn ; return (TyFamInstDecl { tfid_eqn = eqn' , tfid_fvs = placeHolderNames }) }
277
renameTyFamInstD :: TyFamInstDecl Name -> RnM (TyFamInstDecl DocName) renameTyFamInstD (TyFamInstDecl { tfid_eqn = eqn }) = do { eqn' <- renameLTyFamInstEqn eqn ; return (TyFamInstDecl { tfid_eqn = eqn' , tfid_fvs = placeHolderNames }) }
277
renameTyFamInstD (TyFamInstDecl { tfid_eqn = eqn }) = do { eqn' <- renameLTyFamInstEqn eqn ; return (TyFamInstDecl { tfid_eqn = eqn' , tfid_fvs = placeHolderNames }) }
207
false
true
0
10
74
78
41
37
null
null
punitrathore/haskell-first-principles
src/ReplaceExperiment.hs
bsd-3-clause
-- Prelude> :t fmap replaceWithP -- fmap replaceWithP :: Functor f => f a -> f Char liftedReplace :: Functor f => f a -> f Char liftedReplace = fmap replaceWithP
161
liftedReplace :: Functor f => f a -> f Char liftedReplace = fmap replaceWithP
77
liftedReplace = fmap replaceWithP
33
true
true
0
7
30
33
16
17
null
null
sukwon0709/mysql
src/MySQL/ParserInternal.hs
bsd-3-clause
simpleExprMinus :: Parser (Syn.SimpleExpr -> Syn.SimpleExpr) simpleExprMinus = tok' Tok.LTokMinus *> pure Syn.SEMinus
117
simpleExprMinus :: Parser (Syn.SimpleExpr -> Syn.SimpleExpr) simpleExprMinus = tok' Tok.LTokMinus *> pure Syn.SEMinus
117
simpleExprMinus = tok' Tok.LTokMinus *> pure Syn.SEMinus
56
false
true
0
8
12
39
19
20
null
null
hpacheco/HAAP
examples/plab/svn/2017li1g186/src/OracleT1.hs
mit
processa (CurvaDir:c) d a (x,y) m = processa c d' a (mexe (x,y) d') m' where m' = replace m (x,y) (blocoCurvo d d' a) d' = roda d True
148
processa (CurvaDir:c) d a (x,y) m = processa c d' a (mexe (x,y) d') m' where m' = replace m (x,y) (blocoCurvo d d' a) d' = roda d True
148
processa (CurvaDir:c) d a (x,y) m = processa c d' a (mexe (x,y) d') m' where m' = replace m (x,y) (blocoCurvo d d' a) d' = roda d True
148
false
false
3
7
43
117
50
67
null
null
CindyLinz/Haskell.js
trans/src/Opt.hs
mit
options :: [OptDescr (Options -> Options)] options = [ Option ['d'] ["desugar"] (NoArg (\opts -> opts { optDesugar = True })) "show the desugarred basic haskell source" ]
182
options :: [OptDescr (Options -> Options)] options = [ Option ['d'] ["desugar"] (NoArg (\opts -> opts { optDesugar = True })) "show the desugarred basic haskell source" ]
182
options = [ Option ['d'] ["desugar"] (NoArg (\opts -> opts { optDesugar = True })) "show the desugarred basic haskell source" ]
139
false
true
0
13
39
71
37
34
null
null
dawedawe/kripkeweb
src/Axioms.hs
bsd-3-clause
-- |Test if D (seriell): []p -> <>p All w: Ex v:(wRv) holds in the whole -- database model. isD :: Connection -> LambdaType -> Frame -> Fml -> IO Bool isD c lamType frm p@(Var _) = let fml = Imp (Box p) (Diamond p) in isFUniversallyTrue c lamType frm fml
263
isD :: Connection -> LambdaType -> Frame -> Fml -> IO Bool isD c lamType frm p@(Var _) = let fml = Imp (Box p) (Diamond p) in isFUniversallyTrue c lamType frm fml
171
isD c lamType frm p@(Var _) = let fml = Imp (Box p) (Diamond p) in isFUniversallyTrue c lamType frm fml
112
true
true
0
11
60
91
44
47
null
null
facebookincubator/duckling
Duckling/Numeral/HR/Rules.hs
bsd-3-clause
ruleNumbersSuffixesKMG :: Rule ruleNumbersSuffixesKMG = Rule { name = "numbers suffixes (K, M, G)" , pattern = [ dimension Numeral , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3 "m" -> double $ v * 1e6 "g" -> double $ v * 1e9 _ -> Nothing _ -> Nothing }
506
ruleNumbersSuffixesKMG :: Rule ruleNumbersSuffixesKMG = Rule { name = "numbers suffixes (K, M, G)" , pattern = [ dimension Numeral , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3 "m" -> double $ v * 1e6 "g" -> double $ v * 1e9 _ -> Nothing _ -> Nothing }
506
ruleNumbersSuffixesKMG = Rule { name = "numbers suffixes (K, M, G)" , pattern = [ dimension Numeral , regex "([kmg])(?=[\\W\\$€]|$)" ] , prod = \tokens -> case tokens of (Token Numeral NumeralData{TNumeral.value = v}: Token RegexMatch (GroupMatch (match:_)): _) -> case Text.toLower match of "k" -> double $ v * 1e3 "m" -> double $ v * 1e6 "g" -> double $ v * 1e9 _ -> Nothing _ -> Nothing }
475
false
true
0
19
158
170
88
82
null
null
brendanhay/gogol
gogol-sqladmin/gen/Network/Google/SQLAdmin/Types/Product.hs
mpl-2.0
-- | Path to the Certificate (.cer) in Cloud Storage, in the form -- **gs:\/\/bucketName\/fileName**. The instance must have write -- permissions to the bucket and read access to the file. icbioeoCertPath :: Lens' ImportContextBakImportOptionsEncryptionOptions (Maybe Text) icbioeoCertPath = lens _icbioeoCertPath (\ s a -> s{_icbioeoCertPath = a})
356
icbioeoCertPath :: Lens' ImportContextBakImportOptionsEncryptionOptions (Maybe Text) icbioeoCertPath = lens _icbioeoCertPath (\ s a -> s{_icbioeoCertPath = a})
167
icbioeoCertPath = lens _icbioeoCertPath (\ s a -> s{_icbioeoCertPath = a})
82
true
true
0
8
55
51
27
24
null
null
MaxDaten/yage-rendering
src/Yage/Rendering/Backend/Renderer.hs
mit
putFreeUnit :: TextureUnit -> Renderer () putFreeUnit (TextureUnit _ (Just _)) = error "putFreeUnit: not a free unit"
117
putFreeUnit :: TextureUnit -> Renderer () putFreeUnit (TextureUnit _ (Just _)) = error "putFreeUnit: not a free unit"
117
putFreeUnit (TextureUnit _ (Just _)) = error "putFreeUnit: not a free unit"
75
false
true
0
9
17
40
19
21
null
null
keithodulaigh/Hets
LF/Analysis.hs
gpl-2.0
{- --------------------------------------------------------------- --------------------------------------------------------------- -} -- converts a mapping of raw symbols to a mapping of symbols renamMapAnalysis :: Map.Map RAW_SYM RAW_SYM -> Sign -> Map.Map Symbol Symbol renamMapAnalysis m sig = let syms1 = getUnknownSyms (Map.keys m) sig syms2 = filter (not . isSym) $ Map.elems m syms = syms1 ++ syms2 in if not (null syms) then error $ badSymsError syms else Map.fromList $ map (\ (k, v) -> (toSym k, toSym v)) $ Map.toList m
563
renamMapAnalysis :: Map.Map RAW_SYM RAW_SYM -> Sign -> Map.Map Symbol Symbol renamMapAnalysis m sig = let syms1 = getUnknownSyms (Map.keys m) sig syms2 = filter (not . isSym) $ Map.elems m syms = syms1 ++ syms2 in if not (null syms) then error $ badSymsError syms else Map.fromList $ map (\ (k, v) -> (toSym k, toSym v)) $ Map.toList m
367
renamMapAnalysis m sig = let syms1 = getUnknownSyms (Map.keys m) sig syms2 = filter (not . isSym) $ Map.elems m syms = syms1 ++ syms2 in if not (null syms) then error $ badSymsError syms else Map.fromList $ map (\ (k, v) -> (toSym k, toSym v)) $ Map.toList m
290
true
true
0
14
109
165
83
82
null
null
mapinguari/SC_HS_Proxy
src/Proxy/Query/Unit.hs
mit
isBuilding ProtossScout = False
31
isBuilding ProtossScout = False
31
isBuilding ProtossScout = False
31
false
false
0
5
3
9
4
5
null
null
j-rock/strat
src/Game/Lib/Units/Instances.hs
mit
flechette :: UnitT flechette = groundUnit (Defense 40) (groundAttack 50) (defMobility 6) "Flechette"
128
flechette :: UnitT flechette = groundUnit (Defense 40) (groundAttack 50) (defMobility 6) "Flechette"
128
flechette = groundUnit (Defense 40) (groundAttack 50) (defMobility 6) "Flechette"
109
false
true
0
7
40
38
19
19
null
null
vzaccaria/bddtool
src/Paper/Paper.hs
bsd-3-clause
v3 = asMop $ (s1 `xor` m3)
26
v3 = asMop $ (s1 `xor` m3)
26
v3 = asMop $ (s1 `xor` m3)
26
false
false
3
7
6
24
11
13
null
null
noughtmare/yi
yi-core/src/Yi/MiniBuffer.hs
gpl-2.0
getMinibufferList :: [(T.Text, a)] -> Proxy a -> T.Text -> (T.Text -> YiM ()) -> YiM () getMinibufferList vs _ prompt = withMinibufferFin prompt (fmap fst vs)
176
getMinibufferList :: [(T.Text, a)] -> Proxy a -> T.Text -> (T.Text -> YiM ()) -> YiM () getMinibufferList vs _ prompt = withMinibufferFin prompt (fmap fst vs)
176
getMinibufferList vs _ prompt = withMinibufferFin prompt (fmap fst vs)
70
false
true
0
12
44
82
41
41
null
null
zaxtax/hakaru-old
Examples/Examples.hs
bsd-3-clause
outlier_detection = undefined
29
outlier_detection = undefined
29
outlier_detection = undefined
29
false
false
0
4
2
6
3
3
null
null
ntc2/cryptol
src/Cryptol/TypeCheck/Solver/InfNat.hs
bsd-3-clause
nMax _ Inf = Inf
27
nMax _ Inf = Inf
27
nMax _ Inf = Inf
27
false
false
0
5
15
11
5
6
null
null
kmate/imperative-edsl
src/Language/Embedded/Imperative/Backend/C.hs
bsd-3-clause
compIOMode WriteMode = "w"
30
compIOMode WriteMode = "w"
30
compIOMode WriteMode = "w"
30
false
false
1
5
7
13
4
9
null
null
danplubell/CTG1371
Haskeleton.hs
mit
libraryDirectory :: String libraryDirectory = "library"
55
libraryDirectory :: String libraryDirectory = "library"
55
libraryDirectory = "library"
28
false
true
0
6
5
18
7
11
null
null
tibbe/event
src/System/Event/Thread.hs
bsd-2-clause
waitForDelayEventSTM :: Int -> IO (TVar Bool) waitForDelayEventSTM usecs = do t <- atomically $ newTVar False Running mgr <- readIORef eventManager _ <- registerTimeout mgr (usecs `div` 1000) . atomically $ writeTVar t True return t -- | Block the current thread until data is available to read from the -- given file descriptor.
341
waitForDelayEventSTM :: Int -> IO (TVar Bool) waitForDelayEventSTM usecs = do t <- atomically $ newTVar False Running mgr <- readIORef eventManager _ <- registerTimeout mgr (usecs `div` 1000) . atomically $ writeTVar t True return t -- | Block the current thread until data is available to read from the -- given file descriptor.
341
waitForDelayEventSTM usecs = do t <- atomically $ newTVar False Running mgr <- readIORef eventManager _ <- registerTimeout mgr (usecs `div` 1000) . atomically $ writeTVar t True return t -- | Block the current thread until data is available to read from the -- given file descriptor.
295
false
true
0
13
66
100
46
54
null
null
GaloisInc/HaNS
src/Hans/Nat/State.hs
bsd-3-clause
removeOldest :: Sessions -> Sessions removeOldest q = case Q.minView q of Just (k,_,a,q') -> Q.delete (fmap riSource (otherSide k a)) q' Nothing -> q
167
removeOldest :: Sessions -> Sessions removeOldest q = case Q.minView q of Just (k,_,a,q') -> Q.delete (fmap riSource (otherSide k a)) q' Nothing -> q
167
removeOldest q = case Q.minView q of Just (k,_,a,q') -> Q.delete (fmap riSource (otherSide k a)) q' Nothing -> q
130
false
true
0
12
42
77
39
38
null
null
thielema/wxhaskell
wx/src/Graphics/UI/WX/Controls.hs
lgpl-2.1
-- | Create a new combo box with a given set of flags. -- -- * Instances: 'Selecting', 'Commanding','Selection','Items' -- 'Textual', 'Literate', 'Dimensions', -- 'Colored', 'Visible', 'Child', -- 'Able', 'Tipped', 'Identity', 'Styled', 'Reactive', 'Paint'. -- -- A 'command' event is triggered when the @enter@ key is pressed and when -- 'processEnter' has been set to 'True'. comboBoxEx :: Window a -> Style -> [Prop (ComboBox ())] -> IO (ComboBox ()) comboBoxEx parent flags props = feed2 props flags $ initialWindow $ \id rect -> initialText $ \txt -> initialSorted $ \props flags -> do cb <- comboBoxCreate parent id txt rect [] flags set cb props return cb -- | Complete the construction of a combo box instance which has been loaded -- from a resource file.
826
comboBoxEx :: Window a -> Style -> [Prop (ComboBox ())] -> IO (ComboBox ()) comboBoxEx parent flags props = feed2 props flags $ initialWindow $ \id rect -> initialText $ \txt -> initialSorted $ \props flags -> do cb <- comboBoxCreate parent id txt rect [] flags set cb props return cb -- | Complete the construction of a combo box instance which has been loaded -- from a resource file.
423
comboBoxEx parent flags props = feed2 props flags $ initialWindow $ \id rect -> initialText $ \txt -> initialSorted $ \props flags -> do cb <- comboBoxCreate parent id txt rect [] flags set cb props return cb -- | Complete the construction of a combo box instance which has been loaded -- from a resource file.
347
true
true
0
15
188
144
74
70
null
null
tjakway/ghcjvm
libraries/template-haskell/Language/Haskell/TH/Lib.hs
bsd-3-clause
pragSpecD :: Name -> TypeQ -> Phases -> DecQ pragSpecD n ty phases = do ty1 <- ty return $ PragmaD $ SpecialiseP n ty1 Nothing phases
150
pragSpecD :: Name -> TypeQ -> Phases -> DecQ pragSpecD n ty phases = do ty1 <- ty return $ PragmaD $ SpecialiseP n ty1 Nothing phases
150
pragSpecD n ty phases = do ty1 <- ty return $ PragmaD $ SpecialiseP n ty1 Nothing phases
105
false
true
0
8
43
57
27
30
null
null
siddhanathan/ghc
compiler/prelude/THNames.hs
bsd-3-clause
sigTName = libFun (fsLit "sigT") sigTIdKey
63
sigTName = libFun (fsLit "sigT") sigTIdKey
63
sigTName = libFun (fsLit "sigT") sigTIdKey
63
false
false
0
7
26
17
8
9
null
null
bkoropoff/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
creg Tmp = "REG1"
17
creg Tmp = "REG1"
17
creg Tmp = "REG1"
17
false
false
1
5
3
13
4
9
null
null
hvr/multi-ghc-travis
src/HaskellCI/Compiler.hs
bsd-3-clause
allCompilerVersions :: Set CompilerVersion allCompilerVersions = S.insert GHCHead $ S.fromList $ [ GHC v | v <- knownGhcVersions ] ++ [ GHCJS v | v <- knownGhcjsVersions ]
179
allCompilerVersions :: Set CompilerVersion allCompilerVersions = S.insert GHCHead $ S.fromList $ [ GHC v | v <- knownGhcVersions ] ++ [ GHCJS v | v <- knownGhcjsVersions ]
179
allCompilerVersions = S.insert GHCHead $ S.fromList $ [ GHC v | v <- knownGhcVersions ] ++ [ GHCJS v | v <- knownGhcjsVersions ]
136
false
true
1
9
35
65
30
35
null
null
nevrenato/HetsAlloy
DFOL/AS_DFOL.hs
gpl-2.0
formulaFlatForm (Conjunction fs) = Conjunction $ map formulaFlatForm fs
71
formulaFlatForm (Conjunction fs) = Conjunction $ map formulaFlatForm fs
71
formulaFlatForm (Conjunction fs) = Conjunction $ map formulaFlatForm fs
71
false
false
0
6
8
25
11
14
null
null
olorin/amazonka
amazonka-cloudfront/gen/Network/AWS/CloudFront/Types.hs
mpl-2.0
-- | Your request contains more trusted signers than are allowed per -- distribution. _TooManyTrustedSigners :: AsError a => Getting (First ServiceError) a ServiceError _TooManyTrustedSigners = _ServiceError . hasStatus 400 . hasCode "TooManyTrustedSigners"
261
_TooManyTrustedSigners :: AsError a => Getting (First ServiceError) a ServiceError _TooManyTrustedSigners = _ServiceError . hasStatus 400 . hasCode "TooManyTrustedSigners"
175
_TooManyTrustedSigners = _ServiceError . hasStatus 400 . hasCode "TooManyTrustedSigners"
92
true
true
0
8
36
47
23
24
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_FRAGMENT_NORMAL_EXT :: GLenum gl_FRAGMENT_NORMAL_EXT = 0x834A
64
gl_FRAGMENT_NORMAL_EXT :: GLenum gl_FRAGMENT_NORMAL_EXT = 0x834A
64
gl_FRAGMENT_NORMAL_EXT = 0x834A
31
false
true
0
4
5
11
6
5
null
null
nlander/bazaari
src/Bazaari/Http.hs
bsd-3-clause
apiVersion :: Version apiVersion = "2015-06-01"
47
apiVersion :: Version apiVersion = "2015-06-01"
47
apiVersion = "2015-06-01"
25
false
true
0
4
5
11
6
5
null
null
brendanhay/gogol
gogol-cloudasset/gen/Network/Google/CloudAsset/Types/Product.hs
mpl-2.0
-- | Description of the \`ServicePerimeter\` and its use. Does not affect -- behavior. giamvspDescription :: Lens' GoogleIdentityAccesscontextManagerV1ServicePerimeter (Maybe Text) giamvspDescription = lens _giamvspDescription (\ s a -> s{_giamvspDescription = a})
272
giamvspDescription :: Lens' GoogleIdentityAccesscontextManagerV1ServicePerimeter (Maybe Text) giamvspDescription = lens _giamvspDescription (\ s a -> s{_giamvspDescription = a})
185
giamvspDescription = lens _giamvspDescription (\ s a -> s{_giamvspDescription = a})
91
true
true
0
8
38
50
26
24
null
null
xuwei-k/kan-extensions
src/Data/Functor/Kan/Lan.hs
bsd-3-clause
toLan :: Functor f => (forall a. h a -> f (g a)) -> Lan g h b -> f b toLan s (Lan f v) = fmap f (s v)
101
toLan :: Functor f => (forall a. h a -> f (g a)) -> Lan g h b -> f b toLan s (Lan f v) = fmap f (s v)
101
toLan s (Lan f v) = fmap f (s v)
32
false
true
0
13
30
90
41
49
null
null
mettekou/ghc
compiler/ghci/ByteCodeGen.hs
bsd-3-clause
findPushSeq (F: rest) = (PUSH_APPLY_F, 1, rest)
49
findPushSeq (F: rest) = (PUSH_APPLY_F, 1, rest)
49
findPushSeq (F: rest) = (PUSH_APPLY_F, 1, rest)
49
false
false
0
6
8
26
14
12
null
null
ssaavedra/liquidhaskell
tests/pos/RBTree-color.hs
bsd-3-clause
rbal x l r = Node B x l r
52
rbal x l r = Node B x l r
52
rbal x l r = Node B x l r
52
false
false
0
5
36
22
10
12
null
null
urbanslug/ghc
compiler/nativeGen/Dwarf/Constants.hs
bsd-3-clause
dW_CFA_offset_extended_sf = 0x11
32
dW_CFA_offset_extended_sf = 0x11
32
dW_CFA_offset_extended_sf = 0x11
32
false
false
0
4
2
6
3
3
null
null
Shimuuar/protobuf
Data/Protobuf/Serialize/VarInt.hs
bsd-3-clause
---------------------------------------------------------------- -- Fixed width ints ---------------------------------------------------------------- getInt32le :: Get Int32 getInt32le = fromIntegral <$> getWord32le
216
getInt32le :: Get Int32 getInt32le = fromIntegral <$> getWord32le
65
getInt32le = fromIntegral <$> getWord32le
41
true
true
0
5
15
21
12
9
null
null
tonyday567/sfold
sfold/src/SFold/Examples.hs
mit
t10 :: [Int] -> IO () t10 xs = runEffect $ SFold.sfold (foldSummary 10) (Pipes.each xs) >-> Pipes.print
105
t10 :: [Int] -> IO () t10 xs = runEffect $ SFold.sfold (foldSummary 10) (Pipes.each xs) >-> Pipes.print
105
t10 xs = runEffect $ SFold.sfold (foldSummary 10) (Pipes.each xs) >-> Pipes.print
83
false
true
0
10
19
57
28
29
null
null
Soostone/bloodhound
src/Database/Bloodhound/Client.hs
bsd-3-clause
getIndexSettings :: (MonadBH m, MonadThrow m) => IndexName -> m (Either EsError IndexSettingsSummary) getIndexSettings (IndexName indexName) = do parseEsResponse =<< get =<< url where url = joinPath [indexName, "_settings"] -- | 'optimizeIndex' will optimize a single index, list of indexes or -- all indexes. Note that this call will block until finishing but -- will continue even if the request times out. Concurrent requests to -- optimize an index while another is performing will block until the -- previous one finishes. For more information see -- <https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-optimize.html>. Nothing -- worthwhile comes back in the reply body, so matching on the status -- should suffice. -- -- 'optimizeIndex' with a maxNumSegments of 1 and onlyExpungeDeletes -- to True is the main way to release disk space back to the OS being -- held by deleted documents. -- -- Note that this API was deprecated in ElasticSearch 2.1 for the -- almost completely identical forcemerge API. Adding support to that -- API would be trivial but due to the significant breaking changes, -- this library cannot currently be used with >= 2.0, so that feature was omitted. -- -- >>> let ixn = IndexName "unoptimizedindex" -- >>> _ <- runBH' $ deleteIndex ixn >> createIndex defaultIndexSettings ixn -- >>> response <- runBH' $ optimizeIndex (IndexList (ixn :| [])) (defaultIndexOptimizationSettings { maxNumSegments = Just 1, onlyExpungeDeletes = True }) -- >>> respIsTwoHunna response -- True
1,544
getIndexSettings :: (MonadBH m, MonadThrow m) => IndexName -> m (Either EsError IndexSettingsSummary) getIndexSettings (IndexName indexName) = do parseEsResponse =<< get =<< url where url = joinPath [indexName, "_settings"] -- | 'optimizeIndex' will optimize a single index, list of indexes or -- all indexes. Note that this call will block until finishing but -- will continue even if the request times out. Concurrent requests to -- optimize an index while another is performing will block until the -- previous one finishes. For more information see -- <https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-optimize.html>. Nothing -- worthwhile comes back in the reply body, so matching on the status -- should suffice. -- -- 'optimizeIndex' with a maxNumSegments of 1 and onlyExpungeDeletes -- to True is the main way to release disk space back to the OS being -- held by deleted documents. -- -- Note that this API was deprecated in ElasticSearch 2.1 for the -- almost completely identical forcemerge API. Adding support to that -- API would be trivial but due to the significant breaking changes, -- this library cannot currently be used with >= 2.0, so that feature was omitted. -- -- >>> let ixn = IndexName "unoptimizedindex" -- >>> _ <- runBH' $ deleteIndex ixn >> createIndex defaultIndexSettings ixn -- >>> response <- runBH' $ optimizeIndex (IndexList (ixn :| [])) (defaultIndexOptimizationSettings { maxNumSegments = Just 1, onlyExpungeDeletes = True }) -- >>> respIsTwoHunna response -- True
1,544
getIndexSettings (IndexName indexName) = do parseEsResponse =<< get =<< url where url = joinPath [indexName, "_settings"] -- | 'optimizeIndex' will optimize a single index, list of indexes or -- all indexes. Note that this call will block until finishing but -- will continue even if the request times out. Concurrent requests to -- optimize an index while another is performing will block until the -- previous one finishes. For more information see -- <https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-optimize.html>. Nothing -- worthwhile comes back in the reply body, so matching on the status -- should suffice. -- -- 'optimizeIndex' with a maxNumSegments of 1 and onlyExpungeDeletes -- to True is the main way to release disk space back to the OS being -- held by deleted documents. -- -- Note that this API was deprecated in ElasticSearch 2.1 for the -- almost completely identical forcemerge API. Adding support to that -- API would be trivial but due to the significant breaking changes, -- this library cannot currently be used with >= 2.0, so that feature was omitted. -- -- >>> let ixn = IndexName "unoptimizedindex" -- >>> _ <- runBH' $ deleteIndex ixn >> createIndex defaultIndexSettings ixn -- >>> response <- runBH' $ optimizeIndex (IndexList (ixn :| [])) (defaultIndexOptimizationSettings { maxNumSegments = Just 1, onlyExpungeDeletes = True }) -- >>> respIsTwoHunna response -- True
1,425
false
true
0
9
254
101
62
39
null
null
mettekou/ghc
compiler/basicTypes/Id.hs
bsd-3-clause
-- | Make a local id, with the IdDetails set to CoVarId if the type indicates -- so. mkLocalIdOrCoVarWithInfo :: Name -> Type -> IdInfo -> Id mkLocalIdOrCoVarWithInfo name ty info = Var.mkLocalVar details name ty info where details | isCoercionType ty = CoVarId | otherwise = VanillaId -- proper ids only; no covars!
349
mkLocalIdOrCoVarWithInfo :: Name -> Type -> IdInfo -> Id mkLocalIdOrCoVarWithInfo name ty info = Var.mkLocalVar details name ty info where details | isCoercionType ty = CoVarId | otherwise = VanillaId -- proper ids only; no covars!
264
mkLocalIdOrCoVarWithInfo name ty info = Var.mkLocalVar details name ty info where details | isCoercionType ty = CoVarId | otherwise = VanillaId -- proper ids only; no covars!
207
true
true
0
8
86
70
34
36
null
null
soundcloud/haskell-kubernetes
lib/Kubernetes/Model/V1/NodeList.hs
mit
mkNodeList :: [Node] -> NodeList mkNodeList xitemsx = NodeList Nothing Nothing Nothing xitemsx
94
mkNodeList :: [Node] -> NodeList mkNodeList xitemsx = NodeList Nothing Nothing Nothing xitemsx
94
mkNodeList xitemsx = NodeList Nothing Nothing Nothing xitemsx
61
false
true
0
6
12
30
15
15
null
null
kyren/hsgb
lib/Gameboy/Instructions.hs
unlicense
encodeInstruction PUSH_HL = [0xe5]
34
encodeInstruction PUSH_HL = [0xe5]
34
encodeInstruction PUSH_HL = [0xe5]
34
false
false
1
5
3
15
6
9
null
null
GRACeFUL-project/haskelzinc
src/Interfaces/MZPrinter.hs
bsd-3-clause
printInst :: Inst -> Doc printInst Dec = text "var"
51
printInst :: Inst -> Doc printInst Dec = text "var"
51
printInst Dec = text "var"
26
false
true
0
5
9
21
10
11
null
null
robdockins/edison
edison-core/src/Data/Edison/Assoc/PatriciaLoMap.hs
mit
unionr E t = t
14
unionr E t = t
14
unionr E t = t
14
false
false
0
4
4
12
5
7
null
null
ethercrow/y
src/Y/Frontend/Toy.hs
bsd-3-clause
startToyFrontend :: IO Frontend startToyFrontend = do (inputEvent, pushInput) <- Sodium.sync Sodium.newEvent let mainLoop vmEvent = do exitMVar <- newEmptyMVar unlistenOutput <- Sodium.sync . Sodium.listen vmEvent $ \e -> case e of OutputViewModel vm -> render vm OutputExit -> putMVar exitMVar () _ -> return () void . forkIO $ do putStrLn "Started input thread" forM_ "axbycxdyefghijkzabc" $ \c -> do Sodium.sync $ pushInput (KChar c) threadDelay 300000 Sodium.sync $ pushInput KEsc takeMVar exitMVar unlistenOutput return $! Frontend inputEvent mainLoop
769
startToyFrontend :: IO Frontend startToyFrontend = do (inputEvent, pushInput) <- Sodium.sync Sodium.newEvent let mainLoop vmEvent = do exitMVar <- newEmptyMVar unlistenOutput <- Sodium.sync . Sodium.listen vmEvent $ \e -> case e of OutputViewModel vm -> render vm OutputExit -> putMVar exitMVar () _ -> return () void . forkIO $ do putStrLn "Started input thread" forM_ "axbycxdyefghijkzabc" $ \c -> do Sodium.sync $ pushInput (KChar c) threadDelay 300000 Sodium.sync $ pushInput KEsc takeMVar exitMVar unlistenOutput return $! Frontend inputEvent mainLoop
769
startToyFrontend = do (inputEvent, pushInput) <- Sodium.sync Sodium.newEvent let mainLoop vmEvent = do exitMVar <- newEmptyMVar unlistenOutput <- Sodium.sync . Sodium.listen vmEvent $ \e -> case e of OutputViewModel vm -> render vm OutputExit -> putMVar exitMVar () _ -> return () void . forkIO $ do putStrLn "Started input thread" forM_ "axbycxdyefghijkzabc" $ \c -> do Sodium.sync $ pushInput (KChar c) threadDelay 300000 Sodium.sync $ pushInput KEsc takeMVar exitMVar unlistenOutput return $! Frontend inputEvent mainLoop
737
false
true
0
22
292
209
93
116
null
null
isaiah/cis194
src/HW03.hs
mit
empty :: State empty _ = 0
26
empty :: State empty _ = 0
26
empty _ = 0
11
false
true
1
5
6
19
7
12
null
null
seereason/HJScript
src/HJScript/Lang.hs
bsd-3-clause
second, y :: Exp (Rec a b) -> Exp b second = JSnd
49
second, y :: Exp (Rec a b) -> Exp b second = JSnd
49
second = JSnd
13
false
true
0
8
12
31
16
15
null
null
alexvong1995/pandoc
src/Text/Pandoc/Writers/ICML.hs
gpl-2.0
blockToICML opts style (CodeBlock _ str) = parStyle opts (codeBlockName:style) $ [Str str]
90
blockToICML opts style (CodeBlock _ str) = parStyle opts (codeBlockName:style) $ [Str str]
90
blockToICML opts style (CodeBlock _ str) = parStyle opts (codeBlockName:style) $ [Str str]
90
false
false
0
8
12
46
21
25
null
null
qnikst/network-transport
src/Network/Transport/Internal.hs
bsd-3-clause
timeoutMaybe :: Exception e => Maybe Int -> e -> IO a -> IO a timeoutMaybe Nothing _ f = f
91
timeoutMaybe :: Exception e => Maybe Int -> e -> IO a -> IO a timeoutMaybe Nothing _ f = f
91
timeoutMaybe Nothing _ f = f
29
false
true
0
9
21
46
21
25
null
null
notae/haskell-exercise
cp/SBVTest2.hs
bsd-3-clause
{-| >>> test3 [-1,0,1] -} test3 :: IO [Integer] test3 = allSat' $ \(i :: SInteger) -> return $ abs i .<= 1
106
test3 :: IO [Integer] test3 = allSat' $ \(i :: SInteger) -> return $ abs i .<= 1
80
test3 = allSat' $ \(i :: SInteger) -> return $ abs i .<= 1
58
true
true
0
9
22
45
24
21
null
null
necrobious/takusen
Foreign/C/UTF8.hs
bsd-3-clause
romUTF8Ptr0 :: Ptr Word8 -> IO String fromUTF8Ptr0 p = do len <- lengthArray0 nullByte p fromUTF8Ptr (len-1) p "" -- | The bytes parameter should be len-1 -- i.e. if the CString has length 2, then you should pass bytes=1. -- That's because we add bytes to the Ptr p to get the offset -- for each byte; byte 1 is at p+0, byte 2 is at p+1, etc.
356
fromUTF8Ptr0 :: Ptr Word8 -> IO String fromUTF8Ptr0 p = do len <- lengthArray0 nullByte p fromUTF8Ptr (len-1) p "" -- | The bytes parameter should be len-1 -- i.e. if the CString has length 2, then you should pass bytes=1. -- That's because we add bytes to the Ptr p to get the offset -- for each byte; byte 1 is at p+0, byte 2 is at p+1, etc.
355
fromUTF8Ptr0 p = do len <- lengthArray0 nullByte p fromUTF8Ptr (len-1) p "" -- | The bytes parameter should be len-1 -- i.e. if the CString has length 2, then you should pass bytes=1. -- That's because we add bytes to the Ptr p to get the offset -- for each byte; byte 1 is at p+0, byte 2 is at p+1, etc.
316
false
true
0
9
83
57
28
29
null
null
acowley/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
mkTyConApp_RDR = varQual_RDR tYPEABLE_INTERNAL (fsLit "mkTyConApp")
73
mkTyConApp_RDR = varQual_RDR tYPEABLE_INTERNAL (fsLit "mkTyConApp")
73
mkTyConApp_RDR = varQual_RDR tYPEABLE_INTERNAL (fsLit "mkTyConApp")
73
false
false
0
7
11
17
8
9
null
null
lonnen/alonzo
src/Alonzo.hs
mpl-2.0
makePort :: IOMode -> [LispVal] -> IOThrowsError LispVal makePort mode [String filename] = liftM Port $ liftIO $ openFile filename mode
135
makePort :: IOMode -> [LispVal] -> IOThrowsError LispVal makePort mode [String filename] = liftM Port $ liftIO $ openFile filename mode
135
makePort mode [String filename] = liftM Port $ liftIO $ openFile filename mode
78
false
true
0
7
20
57
26
31
null
null
brendanhay/gogol
gogol-youtube/gen/Network/Google/Resource/YouTube/ThirdPartyLinks/Insert.hs
mpl-2.0
-- | Multipart request metadata. tpliPayload :: Lens' ThirdPartyLinksInsert ThirdPartyLink tpliPayload = lens _tpliPayload (\ s a -> s{_tpliPayload = a})
155
tpliPayload :: Lens' ThirdPartyLinksInsert ThirdPartyLink tpliPayload = lens _tpliPayload (\ s a -> s{_tpliPayload = a})
122
tpliPayload = lens _tpliPayload (\ s a -> s{_tpliPayload = a})
64
true
true
1
9
22
46
22
24
null
null
matterhorn-chat/matterhorn
src/Matterhorn/Types/Users.hs
bsd-3-clause
-- | Add a member to the existing collection of Users addUser :: UserInfo -> Users -> Users addUser userinfo u = u & ofUsers %~ HM.insert (userinfo^.uiId) userinfo & usernameSet %~ S.insert (userinfo^.uiName)
218
addUser :: UserInfo -> Users -> Users addUser userinfo u = u & ofUsers %~ HM.insert (userinfo^.uiId) userinfo & usernameSet %~ S.insert (userinfo^.uiName)
164
addUser userinfo u = u & ofUsers %~ HM.insert (userinfo^.uiId) userinfo & usernameSet %~ S.insert (userinfo^.uiName)
126
true
true
0
10
43
67
34
33
null
null
phischu/fragnix
builtins/base/Data.OldList.hs
bsd-3-clause
tails lst = build (\c n -> let tailsGo xs = xs `c` case xs of [] -> n _ : xs' -> tailsGo xs' in tailsGo lst)
190
tails lst = build (\c n -> let tailsGo xs = xs `c` case xs of [] -> n _ : xs' -> tailsGo xs' in tailsGo lst)
190
tails lst = build (\c n -> let tailsGo xs = xs `c` case xs of [] -> n _ : xs' -> tailsGo xs' in tailsGo lst)
190
false
false
0
16
109
70
34
36
null
null
mcschroeder/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
externallyVisibleCLabel (ForeignLabel{}) = True
54
externallyVisibleCLabel (ForeignLabel{}) = True
54
externallyVisibleCLabel (ForeignLabel{}) = True
54
false
false
0
6
10
17
8
9
null
null
ribag/ganeti-experiments
src/Ganeti/Constants.hs
gpl-2.0
qlangOpLe :: String qlangOpLe = "<="
36
qlangOpLe :: String qlangOpLe = "<="
36
qlangOpLe = "<="
16
false
true
0
4
5
11
6
5
null
null
thelostt/climbu
src/Interpreter.hs
mit
lookupIdent ident (_:xs) = lookupIdent ident xs
47
lookupIdent ident (_:xs) = lookupIdent ident xs
47
lookupIdent ident (_:xs) = lookupIdent ident xs
47
false
false
0
7
6
23
11
12
null
null
ezyang/ghc
compiler/basicTypes/BasicTypes.hs
bsd-3-clause
pprSafeOverlap False = empty
28
pprSafeOverlap False = empty
28
pprSafeOverlap False = empty
28
false
false
0
5
3
9
4
5
null
null
TueHaulund/ROOPLC
src/Parser.hs
mit
objectCall :: Parser Statement objectCall = reserved "call" >> ObjectCall <$> identifier <* colon <* colon <*> methodName <*> parens (commaSep identifier)
182
objectCall :: Parser Statement objectCall = reserved "call" >> ObjectCall <$> identifier <* colon <* colon <*> methodName <*> parens (commaSep identifier)
182
objectCall = reserved "call" >> ObjectCall <$> identifier <* colon <* colon <*> methodName <*> parens (commaSep identifier)
151
false
true
14
7
49
68
31
37
null
null
cbaatz/hamu8080
src/Hamu8080/Types.hs
mit
setFlag Zero set byte = (if set then setBit else clearBit) byte 6
65
setFlag Zero set byte = (if set then setBit else clearBit) byte 6
65
setFlag Zero set byte = (if set then setBit else clearBit) byte 6
65
false
false
1
7
12
34
15
19
null
null
deweyvm/pone
src/Pone/Ast.hs
gpl-3.0
stripSource :: PoneProgram t -> PoneProgram t stripSource (Program defs expr) = Program defs $ stripExpr expr
109
stripSource :: PoneProgram t -> PoneProgram t stripSource (Program defs expr) = Program defs $ stripExpr expr
109
stripSource (Program defs expr) = Program defs $ stripExpr expr
63
false
true
0
7
16
42
19
23
null
null
songpp/my-haskell-playground
src/BinarySearchTree.hs
apache-2.0
insert :: Ord k => k -> v -> BSTree k v-> BSTree k v insert k a Nil = singleton k a
84
insert :: Ord k => k -> v -> BSTree k v-> BSTree k v insert k a Nil = singleton k a
84
insert k a Nil = singleton k a
30
false
true
0
9
23
56
25
31
null
null
ford-prefect/haskell-gi
lib/Data/GI/CodeGen/SymbolNaming.hs
lgpl-2.1
-- Reserved because we generate code that uses these names. escapeReserved "result" = "result_"
95
escapeReserved "result" = "result_"
35
escapeReserved "result" = "result_"
35
true
false
0
4
13
11
5
6
null
null