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
aisamanra/matterhorn
src/Events/ViewMessage.hs
bsd-3-clause
viewMessageKeybindings :: KeyConfig -> [Keybinding] viewMessageKeybindings = mkKeybindings [ mkKb CancelEvent "Close window" $ setMode Main , mkKb PageUpEvent "Page up" $ mh $ vScrollBy vs (-1 * pageAmount) , mkKb PageDownEvent "Page down" $ mh $ vScrollBy vs pageAmount , mkKb ScrollUpEvent "Scroll up" $ mh $ vScrollBy vs (-1) , mkKb ScrollDownEvent "Scroll down" $ mh $ vScrollBy vs 1 , mkKb ScrollBottomEvent "Scroll to the end of the message" $ mh $ vScrollToEnd vs , mkKb ScrollTopEvent "Scroll to the beginning of the message" $ mh $ vScrollToBeginning vs ]
658
viewMessageKeybindings :: KeyConfig -> [Keybinding] viewMessageKeybindings = mkKeybindings [ mkKb CancelEvent "Close window" $ setMode Main , mkKb PageUpEvent "Page up" $ mh $ vScrollBy vs (-1 * pageAmount) , mkKb PageDownEvent "Page down" $ mh $ vScrollBy vs pageAmount , mkKb ScrollUpEvent "Scroll up" $ mh $ vScrollBy vs (-1) , mkKb ScrollDownEvent "Scroll down" $ mh $ vScrollBy vs 1 , mkKb ScrollBottomEvent "Scroll to the end of the message" $ mh $ vScrollToEnd vs , mkKb ScrollTopEvent "Scroll to the beginning of the message" $ mh $ vScrollToBeginning vs ]
658
viewMessageKeybindings = mkKeybindings [ mkKb CancelEvent "Close window" $ setMode Main , mkKb PageUpEvent "Page up" $ mh $ vScrollBy vs (-1 * pageAmount) , mkKb PageDownEvent "Page down" $ mh $ vScrollBy vs pageAmount , mkKb ScrollUpEvent "Scroll up" $ mh $ vScrollBy vs (-1) , mkKb ScrollDownEvent "Scroll down" $ mh $ vScrollBy vs 1 , mkKb ScrollBottomEvent "Scroll to the end of the message" $ mh $ vScrollToEnd vs , mkKb ScrollTopEvent "Scroll to the beginning of the message" $ mh $ vScrollToBeginning vs ]
606
false
true
0
11
186
172
84
88
null
null
paf31/typescript-docs
src/Language/TypeScript/Docs/Html.hs
mit
surround :: H.Html -> H.Html -> H.Html -> H.Html surround open close inside = open >> inside >> close
101
surround :: H.Html -> H.Html -> H.Html -> H.Html surround open close inside = open >> inside >> close
101
surround open close inside = open >> inside >> close
52
false
true
0
8
18
46
23
23
null
null
li-zhirui/JSAnalyzer
JSEvaluator.hs
mit
jsLessThan (JSFloat x) (JSInt y) = return . JSBool $ x < fromInteger y
82
jsLessThan (JSFloat x) (JSInt y) = return . JSBool $ x < fromInteger y
82
jsLessThan (JSFloat x) (JSInt y) = return . JSBool $ x < fromInteger y
82
false
false
0
7
25
40
18
22
null
null
nfjinjing/moe
src/Text/HTML/Moe2/DSL/HTML.hs
bsd-3-clause
param = e "param"
22
param = e "param"
22
param = e "param"
22
false
false
0
5
8
9
4
5
null
null
coreyoconnor/ansi-terminal
System/Console/ANSI/Windows/Foreign.hs
bsd-3-clause
setConsoleTitle :: LPCTSTR -> IO () setConsoleTitle title = failIfFalse_ "setConsoleTitle" $ cSetConsoleTitle title
115
setConsoleTitle :: LPCTSTR -> IO () setConsoleTitle title = failIfFalse_ "setConsoleTitle" $ cSetConsoleTitle title
115
setConsoleTitle title = failIfFalse_ "setConsoleTitle" $ cSetConsoleTitle title
79
false
true
0
7
13
33
15
18
null
null
ranjitjhala/gradr
Foundation.hs
mit
myLoginWidget :: YesodAuthAccount db master => (Route Auth -> Route master) -> WidgetT master IO () myLoginWidget tm = do ((_,widget), enctype) <- liftHandlerT $ runFormPostNoToken $ Auth.customLoginForm $(widgetFile "login")
233
myLoginWidget :: YesodAuthAccount db master => (Route Auth -> Route master) -> WidgetT master IO () myLoginWidget tm = do ((_,widget), enctype) <- liftHandlerT $ runFormPostNoToken $ Auth.customLoginForm $(widgetFile "login")
233
myLoginWidget tm = do ((_,widget), enctype) <- liftHandlerT $ runFormPostNoToken $ Auth.customLoginForm $(widgetFile "login")
133
false
true
0
9
37
88
43
45
null
null
kmate/HaRe
old/refactorer/RefacFunDef.hs
bsd-3-clause
{-| zipHighlightedField takes the highlighted expression , and takes the expression that we are folding against. If they are both fields, it then calls zipHiglightedMatch to pair up the expressions within the fields. -} zipHighlightedField :: Monad m => FunctionPats -> WhereDecls -> HsFieldsI PNT (HsExpI PNT) -> HsFieldsI PNT (HsExpI PNT) -> m NonSetEnv zipHighlightedField pats w [] _ = return [Nothing]
450
zipHighlightedField :: Monad m => FunctionPats -> WhereDecls -> HsFieldsI PNT (HsExpI PNT) -> HsFieldsI PNT (HsExpI PNT) -> m NonSetEnv zipHighlightedField pats w [] _ = return [Nothing]
230
zipHighlightedField pats w [] _ = return [Nothing]
52
true
true
0
12
106
77
37
40
null
null
robeverest/accelerate
Data/Array/Accelerate/Analysis/Match.hs
bsd-3-clause
matchAtuple _ _ _ = Nothing
39
matchAtuple _ _ _ = Nothing
39
matchAtuple _ _ _ = Nothing
39
false
false
1
5
17
14
5
9
null
null
spechub/Hets
utils/itcor/GenItCorrections.hs
gpl-2.0
output ((s, i) : xs) str = output xs $ str ++ "(\"" ++ s ++ "\"," ++ show i ++ "),"
87
output ((s, i) : xs) str = output xs $ str ++ "(\"" ++ s ++ "\"," ++ show i ++ "),"
87
output ((s, i) : xs) str = output xs $ str ++ "(\"" ++ s ++ "\"," ++ show i ++ "),"
87
false
false
0
11
25
54
27
27
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Cities/List.hs
mpl-2.0
-- | JSONP citCallback :: Lens' CitiesList (Maybe Text) citCallback = lens _citCallback (\ s a -> s{_citCallback = a})
120
citCallback :: Lens' CitiesList (Maybe Text) citCallback = lens _citCallback (\ s a -> s{_citCallback = a})
109
citCallback = lens _citCallback (\ s a -> s{_citCallback = a})
64
true
true
2
9
21
55
25
30
null
null
jwiegley/ghc-release
compiler/main/DriverPipeline.hs
gpl-3.0
runPhase (RealPhase Cmm) input_fn dflags = do let hsc_lang = hscTarget dflags let next_phase = hscPostBackendPhase dflags HsSrcFile hsc_lang output_fn <- phaseOutputFilename next_phase PipeState{hsc_env} <- getPipeState liftIO $ hscCompileCmmFile hsc_env input_fn output_fn return (RealPhase next_phase, output_fn) ----------------------------------------------------------------------------- -- Cc phase -- we don't support preprocessing .c files (with -E) now. Doing so introduces -- way too many hacks, and I can't say I've ever used it anyway.
605
runPhase (RealPhase Cmm) input_fn dflags = do let hsc_lang = hscTarget dflags let next_phase = hscPostBackendPhase dflags HsSrcFile hsc_lang output_fn <- phaseOutputFilename next_phase PipeState{hsc_env} <- getPipeState liftIO $ hscCompileCmmFile hsc_env input_fn output_fn return (RealPhase next_phase, output_fn) ----------------------------------------------------------------------------- -- Cc phase -- we don't support preprocessing .c files (with -E) now. Doing so introduces -- way too many hacks, and I can't say I've ever used it anyway.
605
runPhase (RealPhase Cmm) input_fn dflags = do let hsc_lang = hscTarget dflags let next_phase = hscPostBackendPhase dflags HsSrcFile hsc_lang output_fn <- phaseOutputFilename next_phase PipeState{hsc_env} <- getPipeState liftIO $ hscCompileCmmFile hsc_env input_fn output_fn return (RealPhase next_phase, output_fn) ----------------------------------------------------------------------------- -- Cc phase -- we don't support preprocessing .c files (with -E) now. Doing so introduces -- way too many hacks, and I can't say I've ever used it anyway.
605
false
false
0
10
124
103
48
55
null
null
osa1/sequent-core
src/Language/SequentCore/Simpl/Env.hs
bsd-3-clause
defToUnfolding (BoundToDFun { dfunBndrs = bndrs, dfunDataCon = con, dfunArgs = args}) = mkDFunUnfolding bndrs con (map termToCoreExpr args)
141
defToUnfolding (BoundToDFun { dfunBndrs = bndrs, dfunDataCon = con, dfunArgs = args}) = mkDFunUnfolding bndrs con (map termToCoreExpr args)
141
defToUnfolding (BoundToDFun { dfunBndrs = bndrs, dfunDataCon = con, dfunArgs = args}) = mkDFunUnfolding bndrs con (map termToCoreExpr args)
141
false
false
0
9
20
48
26
22
null
null
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Graphics/Drawable.hs
mit
drawableAddLight :: (Parent Drawable a, Pointer p a, MonadIO m) => p -- ^ Pointer to Drawable or ascentor -> Ptr Light -> m () drawableAddLight p plight = liftIO $ do let ptr = parentPointer p [C.exp| void { $(Drawable* ptr)->AddLight($(Light* plight)) } |] -- | Add a per-vertex light affecting the object this frame.
329
drawableAddLight :: (Parent Drawable a, Pointer p a, MonadIO m) => p -- ^ Pointer to Drawable or ascentor -> Ptr Light -> m () drawableAddLight p plight = liftIO $ do let ptr = parentPointer p [C.exp| void { $(Drawable* ptr)->AddLight($(Light* plight)) } |] -- | Add a per-vertex light affecting the object this frame.
329
drawableAddLight p plight = liftIO $ do let ptr = parentPointer p [C.exp| void { $(Drawable* ptr)->AddLight($(Light* plight)) } |] -- | Add a per-vertex light affecting the object this frame.
196
false
true
0
11
66
85
43
42
null
null
pseudonom/persistent
persistent/Database/Persist.hs
mit
-- | Less-than check. -- -- === __Example usage__ -- -- @ -- selectLessAge :: MonadIO m => ReaderT SqlBackend m [Entity User] -- selectLessAge = selectList [UserAge <. 41 ] [] -- @ -- -- The above query when applied on <#dataset dataset-1>, will produce this: -- -- > +-----+-----+-----+ -- > |id |name |age | -- > +-----+-----+-----+ -- > |1 |SPJ |40 | -- > +-----+-----+-----+ f <. a = Filter f (Left a) Lt
419
f <. a = Filter f (Left a) Lt
30
f <. a = Filter f (Left a) Lt
30
true
false
2
7
88
40
27
13
null
null
teiche/femtocc
Parser.hs
bsd-3-clause
reservedOpNames :: [String] reservedOpNames = ["-", "==", "=", "*"]
67
reservedOpNames :: [String] reservedOpNames = ["-", "==", "=", "*"]
67
reservedOpNames = ["-", "==", "=", "*"]
39
false
true
0
7
8
33
17
16
null
null
bsl/language-dot
src/Language/Dot/Pretty.hs
bsd-3-clause
slash :: Doc langle = char '<'
32
slash :: Doc langle = char '<'
31
langle = char '<'
17
false
true
0
5
8
14
7
7
null
null
sopvop/cabal
Cabal/Distribution/PackageDescription/PrettyPrint.hs
bsd-3-clause
ppFlag :: Flag -> Doc ppFlag flag@(MkFlag name _ _ _) = emptyLine $ text "flag" <+> ppFlagName name $+$ nest indentWith fields where fields = ppFieldsFiltered flagDefaults flagFieldDescrs flag
205
ppFlag :: Flag -> Doc ppFlag flag@(MkFlag name _ _ _) = emptyLine $ text "flag" <+> ppFlagName name $+$ nest indentWith fields where fields = ppFieldsFiltered flagDefaults flagFieldDescrs flag
205
ppFlag flag@(MkFlag name _ _ _) = emptyLine $ text "flag" <+> ppFlagName name $+$ nest indentWith fields where fields = ppFieldsFiltered flagDefaults flagFieldDescrs flag
183
false
true
0
8
42
75
35
40
null
null
pauldoo/scratch
SevenLanguages/Haskell/day2.hs
isc
myEvery s n = n:(myEvery s (n+s))
33
myEvery s n = n:(myEvery s (n+s))
33
myEvery s n = n:(myEvery s (n+s))
33
false
false
0
9
6
30
15
15
null
null
sjakobi/bloodhound
src/Database/Bloodhound/Types.hs
bsd-3-clause
highlightTagToPairs Nothing = []
32
highlightTagToPairs Nothing = []
32
highlightTagToPairs Nothing = []
32
false
false
0
5
3
11
5
6
null
null
fpco/hlint
src/Test/Annotations.hs
bsd-3-clause
parseTest file i x = uncurry (Test (SrcLoc file i 0)) $ f x where f x | Just x <- stripPrefix "<COMMENT>" x = first ("--"++) $ f x f (' ':'-':'-':xs) | null xs || " " `isPrefixOf` xs = ("", Just $ dropWhile isSpace xs) f (x:xs) = first (x:) $ f xs f [] = ([], Nothing)
304
parseTest file i x = uncurry (Test (SrcLoc file i 0)) $ f x where f x | Just x <- stripPrefix "<COMMENT>" x = first ("--"++) $ f x f (' ':'-':'-':xs) | null xs || " " `isPrefixOf` xs = ("", Just $ dropWhile isSpace xs) f (x:xs) = first (x:) $ f xs f [] = ([], Nothing)
304
parseTest file i x = uncurry (Test (SrcLoc file i 0)) $ f x where f x | Just x <- stripPrefix "<COMMENT>" x = first ("--"++) $ f x f (' ':'-':'-':xs) | null xs || " " `isPrefixOf` xs = ("", Just $ dropWhile isSpace xs) f (x:xs) = first (x:) $ f xs f [] = ([], Nothing)
304
false
false
1
10
96
196
92
104
null
null
bairyn/global
examples/mvar/Main.hs
bsd-3-clause
foobarquux :: IO () foobarquux = do putStrLn $ "foobarquux begin" putStrLn $ "foobarquux begins its sleeping for 3 seconds" sleepSeconds 3 putStrLn $ "foobarquux end" -- | Alias to reading action stored in 'waitThreads' and executing it.
254
foobarquux :: IO () foobarquux = do putStrLn $ "foobarquux begin" putStrLn $ "foobarquux begins its sleeping for 3 seconds" sleepSeconds 3 putStrLn $ "foobarquux end" -- | Alias to reading action stored in 'waitThreads' and executing it.
254
foobarquux = do putStrLn $ "foobarquux begin" putStrLn $ "foobarquux begins its sleeping for 3 seconds" sleepSeconds 3 putStrLn $ "foobarquux end" -- | Alias to reading action stored in 'waitThreads' and executing it.
234
false
true
0
7
54
44
20
24
null
null
dnvriend/study-category-theory
haskell/learn_a_haskell/ch3/pattern-matching.hs
apache-2.0
lucky x = "Sorry, you're out of luck pal!"
42
lucky x = "Sorry, you're out of luck pal!"
42
lucky x = "Sorry, you're out of luck pal!"
42
false
false
1
5
8
13
4
9
null
null
nevrenato/Hets_Fork
Static/ArchDiagram.hs
gpl-2.0
-- | A mapping from extended to basic static unit context ctx :: ExtStUnitCtx -> RefStUnitCtx ctx (buc, _) = let ctx' [] _ = emptyRefStUnitCtx ctx' (id1 : ids) buc0 = let uctx = ctx' ids buc0 in case Map.lookup id1 buc0 of Just (Based_unit_sig _ rsig) -> Map.insert id1 rsig uctx Just (Based_par_unit_sig _ rsig) -> Map.insert id1 rsig uctx Just (Based_lambda_unit_sig _ rsig) -> Map.insert id1 rsig uctx _ -> uctx -- this should never be the case in ctx' (Map.keys buc) buc
674
ctx :: ExtStUnitCtx -> RefStUnitCtx ctx (buc, _) = let ctx' [] _ = emptyRefStUnitCtx ctx' (id1 : ids) buc0 = let uctx = ctx' ids buc0 in case Map.lookup id1 buc0 of Just (Based_unit_sig _ rsig) -> Map.insert id1 rsig uctx Just (Based_par_unit_sig _ rsig) -> Map.insert id1 rsig uctx Just (Based_lambda_unit_sig _ rsig) -> Map.insert id1 rsig uctx _ -> uctx -- this should never be the case in ctx' (Map.keys buc) buc
616
ctx (buc, _) = let ctx' [] _ = emptyRefStUnitCtx ctx' (id1 : ids) buc0 = let uctx = ctx' ids buc0 in case Map.lookup id1 buc0 of Just (Based_unit_sig _ rsig) -> Map.insert id1 rsig uctx Just (Based_par_unit_sig _ rsig) -> Map.insert id1 rsig uctx Just (Based_lambda_unit_sig _ rsig) -> Map.insert id1 rsig uctx _ -> uctx -- this should never be the case in ctx' (Map.keys buc) buc
580
true
true
0
16
285
189
90
99
null
null
quakehead/haskell-scheme
Parse.hs
gpl-3.0
-- different ways of writing parseDecNumber. -- parseNumber = (many1 digit) >>= (\n -> return ((Number . read) n)) parseDecNumber :: Parser LispVal parseDecNumber = parseNumberBase digit read
193
parseDecNumber :: Parser LispVal parseDecNumber = parseNumberBase digit read
76
parseDecNumber = parseNumberBase digit read
43
true
true
1
5
29
24
11
13
null
null
drbean/pdrt-sandbox
src/Data/DRS/LambdaCalculus.hs
apache-2.0
-- | Infix notation for 'drsBetaReduce' (<<@>>) :: (AbstractDRS a, DRSAtom b) => (b -> a) -> b -> a ud <<@>> ad = ud `drsBetaReduce` ad
135
(<<@>>) :: (AbstractDRS a, DRSAtom b) => (b -> a) -> b -> a ud <<@>> ad = ud `drsBetaReduce` ad
95
ud <<@>> ad = ud `drsBetaReduce` ad
35
true
true
0
8
26
56
31
25
null
null
antonpetkoff/learning
haskell/fmi-fp/project/xmltree.hs
gpl-3.0
leaf2 = Leaf "p" "myParagraph" [attr2]
38
leaf2 = Leaf "p" "myParagraph" [attr2]
38
leaf2 = Leaf "p" "myParagraph" [attr2]
38
false
false
1
6
5
20
8
12
null
null
NCrashed/hjass
test-suites/all-tests.hs
mit
--import Test.Tasty.QuickCheck as QC --import Test.Tasty.HUnit main :: IO() main = defaultMain tests
101
main :: IO() main = defaultMain tests
37
main = defaultMain tests
24
true
true
1
6
13
24
11
13
null
null
Tosainu/pwn.hs
src/Pwn/Asm.hs
mit
cpp :: Config -> FilePath -> FilePath -> IO () cpp Config { arch = a } src dst | a == "i386" = void $ runProcess "cpp" ["-o", dst, src] | a == "amd64" = void $ runProcess "cpp" ["-o", dst, src] | otherwise = fail "Unknown architecture"
245
cpp :: Config -> FilePath -> FilePath -> IO () cpp Config { arch = a } src dst | a == "i386" = void $ runProcess "cpp" ["-o", dst, src] | a == "amd64" = void $ runProcess "cpp" ["-o", dst, src] | otherwise = fail "Unknown architecture"
245
cpp Config { arch = a } src dst | a == "i386" = void $ runProcess "cpp" ["-o", dst, src] | a == "amd64" = void $ runProcess "cpp" ["-o", dst, src] | otherwise = fail "Unknown architecture"
198
false
true
3
9
58
117
58
59
null
null
HairyDude/pdxparse
src/Shared/Common.hs
mit
-- | As 'withLocAtomAndIcon' except -- -- * say "same as <foo>" if foo refers to a country (in which case, add a flag) -- * may not actually have an icon (localization file will know if it doesn't) iconOrFlag :: (IsGameData (GameData g), IsGameState (GameState g), Monad m) => HashMap Text Text -> (Text -> Text -> ScriptMessage) -> (Text -> ScriptMessage) -> StatementHandler g m iconOrFlag table iconmsg flagmsg [pdx| %_ = $name |] = msgToPP =<< do nflag <- flag name -- laziness means this might not get evaluated if isTag name || isPronoun name then return . flagmsg . Doc.doc2text $ nflag else iconmsg <$> return (iconText table . HM.lookupDefault name name $ table) <*> getGameL10n name
791
iconOrFlag :: (IsGameData (GameData g), IsGameState (GameState g), Monad m) => HashMap Text Text -> (Text -> Text -> ScriptMessage) -> (Text -> ScriptMessage) -> StatementHandler g m iconOrFlag table iconmsg flagmsg [pdx| %_ = $name |] = msgToPP =<< do nflag <- flag name -- laziness means this might not get evaluated if isTag name || isPronoun name then return . flagmsg . Doc.doc2text $ nflag else iconmsg <$> return (iconText table . HM.lookupDefault name name $ table) <*> getGameL10n name
593
iconOrFlag table iconmsg flagmsg [pdx| %_ = $name |] = msgToPP =<< do nflag <- flag name -- laziness means this might not get evaluated if isTag name || isPronoun name then return . flagmsg . Doc.doc2text $ nflag else iconmsg <$> return (iconText table . HM.lookupDefault name name $ table) <*> getGameL10n name
356
true
true
0
16
219
186
95
91
null
null
AlexeyRaga/eta
compiler/ETA/TypeCheck/TcGenDeriv.hs
bsd-3-clause
a_Expr, c_Expr, f_Expr, z_Expr, ltTag_Expr, eqTag_Expr, gtTag_Expr, false_Expr, true_Expr, fmap_Expr, pure_Expr, mempty_Expr, foldMap_Expr, traverse_Expr :: LHsExpr RdrName a_Expr = nlHsVar a_RDR
208
a_Expr, c_Expr, f_Expr, z_Expr, ltTag_Expr, eqTag_Expr, gtTag_Expr, false_Expr, true_Expr, fmap_Expr, pure_Expr, mempty_Expr, foldMap_Expr, traverse_Expr :: LHsExpr RdrName a_Expr = nlHsVar a_RDR
208
a_Expr = nlHsVar a_RDR
31
false
true
0
5
33
43
34
9
null
null
bergey/plots
examples/splitbar.hs
bsd-3-clause
data5 = [1.7, 1.3, 2.4, 2.5]
28
data5 = [1.7, 1.3, 2.4, 2.5]
28
data5 = [1.7, 1.3, 2.4, 2.5]
28
false
false
0
5
5
18
11
7
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/main/ErrUtils.hs
bsd-3-clause
mkPlainErrMsg dflags locn msg = mk_err_msg dflags SevError locn alwaysQualify msg empty
103
mkPlainErrMsg dflags locn msg = mk_err_msg dflags SevError locn alwaysQualify msg empty
103
mkPlainErrMsg dflags locn msg = mk_err_msg dflags SevError locn alwaysQualify msg empty
103
false
false
0
5
27
26
12
14
null
null
yiannist/ganeti
src/Ganeti/OpParams.hs
bsd-2-clause
pRuntimeMem :: Field pRuntimeMem = withDoc "New runtime memory" . optionalField $ simpleField "runtime_mem" [t| Positive Int |]
131
pRuntimeMem :: Field pRuntimeMem = withDoc "New runtime memory" . optionalField $ simpleField "runtime_mem" [t| Positive Int |]
131
pRuntimeMem = withDoc "New runtime memory" . optionalField $ simpleField "runtime_mem" [t| Positive Int |]
110
false
true
0
7
21
31
17
14
null
null
myfreeweb/pcre-heavy
library/Text/Regex/PCRE/Heavy.hs
unlicense
-- | Replaces all occurences of a given regex. -- -- See 'sub' for more documentation. -- -- >>> gsub [re|thing|] "world" "Hello, thing thing" :: String -- "Hello, world world" -- -- >>> gsub [re||] "" "Hello, world" :: String -- "Hello, world" -- -- https://github.com/myfreeweb/pcre-heavy/issues/2 -- >>> gsub [re|good|] "bad" "goodgoodgood" :: String -- "badbadbad" -- -- >>> gsub [re|bad|] "xxxbad" "this is bad, right? bad" :: String -- "this is xxxbad, right? xxxbad" -- -- >>> gsub [re|a|] "" "aaa" :: String -- "" gsub ∷ (ConvertibleStrings SBS a, ConvertibleStrings a SBS, RegexReplacement r) ⇒ Regex → r → a → a gsub r t s = gsubO r [] t s
649
gsub ∷ (ConvertibleStrings SBS a, ConvertibleStrings a SBS, RegexReplacement r) ⇒ Regex → r → a → a gsub r t s = gsubO r [] t s
127
gsub r t s = gsubO r [] t s
27
true
true
0
8
114
85
52
33
null
null
bgold-cosmos/Tidal
src/Sound/Tidal/Tempo.hs
gpl-3.0
sendTempo :: Tempo -> IO () sendTempo tempo = O.sendTo (localUDP tempo) (O.p_bundle (atTime tempo) [m]) (remoteAddr tempo) where m = O.Message "/transmit/cps/cycle" [O.Float $ fromRational $ atCycle tempo, O.Float $ realToFrac $ cps tempo, O.Int32 $ if paused tempo then 1 else 0 ]
417
sendTempo :: Tempo -> IO () sendTempo tempo = O.sendTo (localUDP tempo) (O.p_bundle (atTime tempo) [m]) (remoteAddr tempo) where m = O.Message "/transmit/cps/cycle" [O.Float $ fromRational $ atCycle tempo, O.Float $ realToFrac $ cps tempo, O.Int32 $ if paused tempo then 1 else 0 ]
417
sendTempo tempo = O.sendTo (localUDP tempo) (O.p_bundle (atTime tempo) [m]) (remoteAddr tempo) where m = O.Message "/transmit/cps/cycle" [O.Float $ fromRational $ atCycle tempo, O.Float $ realToFrac $ cps tempo, O.Int32 $ if paused tempo then 1 else 0 ]
389
false
true
0
9
180
130
65
65
null
null
mydaum/cabal
Cabal/Distribution/Simple/Program/HcPkg.hs
bsd-3-clause
-- | Call @hc-pkg@ to unregister a package -- -- > hc-pkg unregister [pkgid] [--user | --global | --package-db] -- unregister :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> IO () unregister hpi verbosity packagedb pkgid = runProgramInvocation verbosity (unregisterInvocation hpi verbosity packagedb pkgid)
319
unregister :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> IO () unregister hpi verbosity packagedb pkgid = runProgramInvocation verbosity (unregisterInvocation hpi verbosity packagedb pkgid)
204
unregister hpi verbosity packagedb pkgid = runProgramInvocation verbosity (unregisterInvocation hpi verbosity packagedb pkgid)
132
true
true
0
11
50
68
33
35
null
null
cartazio/omega
src/NarrowData.hs
bsd-3-clause
freshX (vs,ps,term) = do { ns <- mapM varFresh vs ; let subT = zip vs ns ; return(subTau subT ps,subTau subT term)}
127
freshX (vs,ps,term) = do { ns <- mapM varFresh vs ; let subT = zip vs ns ; return(subTau subT ps,subTau subT term)}
127
freshX (vs,ps,term) = do { ns <- mapM varFresh vs ; let subT = zip vs ns ; return(subTau subT ps,subTau subT term)}
127
false
false
0
10
34
70
35
35
null
null
genos/online_problems
advent_of_code_2019/day04/src/Main.hs
mit
answer :: ([Int] -> Bool) -> Int answer = length . flip filter (fmap digits input)
82
answer :: ([Int] -> Bool) -> Int answer = length . flip filter (fmap digits input)
82
answer = length . flip filter (fmap digits input)
49
false
true
0
8
15
42
22
20
null
null
kadena-io/pact
src-tool/Pact/Analyze/Eval/Numerical.hs
bsd-3-clause
evalNumerical (ModOp x y) = evalModOp x y
54
evalNumerical (ModOp x y) = evalModOp x y
54
evalNumerical (ModOp x y) = evalModOp x y
54
false
false
0
7
20
22
10
12
null
null
erantapaa/haskell-platform
hptool/src/Website.hs
bsd-3-clause
packageVersionInfo :: Bool -> String -> [(String, String)] packageVersionInfo searchFull pName = curr $ zipWith comp vers (drop 1 vers ++ [Nothing]) where comp Nothing _ = ("missing", "-") comp (Just v) Nothing = ("update", showVersion v) comp (Just v) (Just w) | maj v == maj w = ("same", showVersion v) | otherwise = ("update", showVersion v) maj = take 3 . versionBranch curr ((c, v) : cvs) = (c ++ " current", v) : cvs curr [] = [] vers = map (fmap pkgVersion . find ((==pName) . pkgName) . map snd . (if searchFull then allRelIncludes else relMinimalIncludes)) releasesNewToOld
704
packageVersionInfo :: Bool -> String -> [(String, String)] packageVersionInfo searchFull pName = curr $ zipWith comp vers (drop 1 vers ++ [Nothing]) where comp Nothing _ = ("missing", "-") comp (Just v) Nothing = ("update", showVersion v) comp (Just v) (Just w) | maj v == maj w = ("same", showVersion v) | otherwise = ("update", showVersion v) maj = take 3 . versionBranch curr ((c, v) : cvs) = (c ++ " current", v) : cvs curr [] = [] vers = map (fmap pkgVersion . find ((==pName) . pkgName) . map snd . (if searchFull then allRelIncludes else relMinimalIncludes)) releasesNewToOld
704
packageVersionInfo searchFull pName = curr $ zipWith comp vers (drop 1 vers ++ [Nothing]) where comp Nothing _ = ("missing", "-") comp (Just v) Nothing = ("update", showVersion v) comp (Just v) (Just w) | maj v == maj w = ("same", showVersion v) | otherwise = ("update", showVersion v) maj = take 3 . versionBranch curr ((c, v) : cvs) = (c ++ " current", v) : cvs curr [] = [] vers = map (fmap pkgVersion . find ((==pName) . pkgName) . map snd . (if searchFull then allRelIncludes else relMinimalIncludes)) releasesNewToOld
645
false
true
8
15
223
284
147
137
null
null
ezyang/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
shouldInlinePrimOp _ CopyArrayOp [src, src_off, dst, dst_off, (CmmLit (CmmInt n _))] = Just $ \ [] -> doCopyArrayOp src src_off dst dst_off (fromInteger n)
167
shouldInlinePrimOp _ CopyArrayOp [src, src_off, dst, dst_off, (CmmLit (CmmInt n _))] = Just $ \ [] -> doCopyArrayOp src src_off dst dst_off (fromInteger n)
167
shouldInlinePrimOp _ CopyArrayOp [src, src_off, dst, dst_off, (CmmLit (CmmInt n _))] = Just $ \ [] -> doCopyArrayOp src src_off dst dst_off (fromInteger n)
167
false
false
3
9
35
72
37
35
null
null
PipocaQuemada/ermine
src/Ermine/Interpreter.hs
bsd-2-clause
resolveClosure _ ms (Stack s) = GM.read (ms^.stackB) (fromIntegral s + ms^.sp.sort B)
86
resolveClosure _ ms (Stack s) = GM.read (ms^.stackB) (fromIntegral s + ms^.sp.sort B)
86
resolveClosure _ ms (Stack s) = GM.read (ms^.stackB) (fromIntegral s + ms^.sp.sort B)
86
false
false
0
9
13
52
25
27
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
3039 = 3038
11
3039 = 3038
11
3039 = 3038
11
false
false
1
5
2
10
3
7
null
null
kojiromike/Idris-dev
src/IRTS/Bytecode.hs
bsd-3-clause
bc reg (SApp True f vs) r = RESERVENOALLOC (length vs) : moveReg 0 vs ++ [SLIDE (length vs), TOPBASE (length vs), TAILCALL f]
135
bc reg (SApp True f vs) r = RESERVENOALLOC (length vs) : moveReg 0 vs ++ [SLIDE (length vs), TOPBASE (length vs), TAILCALL f]
135
bc reg (SApp True f vs) r = RESERVENOALLOC (length vs) : moveReg 0 vs ++ [SLIDE (length vs), TOPBASE (length vs), TAILCALL f]
135
false
false
0
9
33
75
36
39
null
null
gergoerdi/metafun
src/Metafun/Compiler.hs
gpl-3.0
addTypename (MPL.Call fun args) = MPL.Typename $ MPL.Call fun $ map addTypename args
96
addTypename (MPL.Call fun args) = MPL.Typename $ MPL.Call fun $ map addTypename args
96
addTypename (MPL.Call fun args) = MPL.Typename $ MPL.Call fun $ map addTypename args
96
false
false
0
8
24
39
18
21
null
null
guoy34/ampersand
src/Database/Design/Ampersand/FSpec/ToFSpec/CreateFspec.hs
gpl-3.0
doGenMetaFile :: MetaType -> FSpec -> IO() doGenMetaFile mType fSpec = do { verboseLn (getOpts fSpec) $ "Generating "++show mType++" meta file for "++name fSpec ; writeFile outputFile contents ; verboseLn (getOpts fSpec) $ show mType++" written into " ++ outputFile ++ "" } where outputFile = combine (dirOutput (getOpts fSpec)) $ fpath (fpath,contents) = makeMetaPopulationFile mType fSpec
411
doGenMetaFile :: MetaType -> FSpec -> IO() doGenMetaFile mType fSpec = do { verboseLn (getOpts fSpec) $ "Generating "++show mType++" meta file for "++name fSpec ; writeFile outputFile contents ; verboseLn (getOpts fSpec) $ show mType++" written into " ++ outputFile ++ "" } where outputFile = combine (dirOutput (getOpts fSpec)) $ fpath (fpath,contents) = makeMetaPopulationFile mType fSpec
411
doGenMetaFile mType fSpec = do { verboseLn (getOpts fSpec) $ "Generating "++show mType++" meta file for "++name fSpec ; writeFile outputFile contents ; verboseLn (getOpts fSpec) $ show mType++" written into " ++ outputFile ++ "" } where outputFile = combine (dirOutput (getOpts fSpec)) $ fpath (fpath,contents) = makeMetaPopulationFile mType fSpec
368
false
true
0
13
78
154
73
81
null
null
guibou/AdventOfCode2016
src/Day11.hs
bsd-3-clause
parseWords (x:w:xs) | "generator" `BS.isPrefixOf` w = (Generator (x)) : parseWords xs | "microchip" `BS.isPrefixOf` w = (Chip ((head (split '-' x)))) : parseWords xs | otherwise = parseWords (w:xs)
203
parseWords (x:w:xs) | "generator" `BS.isPrefixOf` w = (Generator (x)) : parseWords xs | "microchip" `BS.isPrefixOf` w = (Chip ((head (split '-' x)))) : parseWords xs | otherwise = parseWords (w:xs)
203
parseWords (x:w:xs) | "generator" `BS.isPrefixOf` w = (Generator (x)) : parseWords xs | "microchip" `BS.isPrefixOf` w = (Chip ((head (split '-' x)))) : parseWords xs | otherwise = parseWords (w:xs)
203
false
false
1
13
35
116
59
57
null
null
raventid/coursera_learning
haskell/will_kurt/30_monads_worksheet.hs
mit
creditsFromId :: GamerId -> Maybe PlayerCredits -- It's join, actually. creditsFromId id = lookupUserName id >>= lookupCredits
126
creditsFromId :: GamerId -> Maybe PlayerCredits creditsFromId id = lookupUserName id >>= lookupCredits
102
creditsFromId id = lookupUserName id >>= lookupCredits
54
true
true
0
6
16
29
14
15
null
null
rueshyna/gogol
gogol-android-enterprise/gen/Network/Google/Resource/AndroidEnterprise/Enterprises/SendTestPushNotification.hs
mpl-2.0
-- | The ID of the enterprise. estpnEnterpriseId :: Lens' EnterprisesSendTestPushNotification Text estpnEnterpriseId = lens _estpnEnterpriseId (\ s a -> s{_estpnEnterpriseId = a})
187
estpnEnterpriseId :: Lens' EnterprisesSendTestPushNotification Text estpnEnterpriseId = lens _estpnEnterpriseId (\ s a -> s{_estpnEnterpriseId = a})
156
estpnEnterpriseId = lens _estpnEnterpriseId (\ s a -> s{_estpnEnterpriseId = a})
88
true
true
1
9
30
46
22
24
null
null
joshuaclayton/unused
src/Unused/GitContext.hs
mit
gitLogSearchFor :: Int -> [String] -> IO GitOutput gitLogSearchFor commitCount ts = do (_, results, _) <- P.readProcessWithExitCode "git" ["log", "-G", L.intercalate "|" ts, "--oneline", "-n", show commitCount] "" return $ GitOutput results
244
gitLogSearchFor :: Int -> [String] -> IO GitOutput gitLogSearchFor commitCount ts = do (_, results, _) <- P.readProcessWithExitCode "git" ["log", "-G", L.intercalate "|" ts, "--oneline", "-n", show commitCount] "" return $ GitOutput results
244
gitLogSearchFor commitCount ts = do (_, results, _) <- P.readProcessWithExitCode "git" ["log", "-G", L.intercalate "|" ts, "--oneline", "-n", show commitCount] "" return $ GitOutput results
193
false
true
0
11
36
93
48
45
null
null
travitch/iiglue
tools/InterfaceDiff.hs
bsd-3-clause
cmdOpts :: Parser Opts cmdOpts = Opts <$> option ( long "format" <> short 'f' <> metavar "FORMAT" <> help "The output format. One of None, Html, or Text (default Text)" <> value Text) <*> argument str ( metavar "OLDIFACE" ) <*> argument str ( metavar "NEWIFACE" )
300
cmdOpts :: Parser Opts cmdOpts = Opts <$> option ( long "format" <> short 'f' <> metavar "FORMAT" <> help "The output format. One of None, Html, or Text (default Text)" <> value Text) <*> argument str ( metavar "OLDIFACE" ) <*> argument str ( metavar "NEWIFACE" )
300
cmdOpts = Opts <$> option ( long "format" <> short 'f' <> metavar "FORMAT" <> help "The output format. One of None, Html, or Text (default Text)" <> value Text) <*> argument str ( metavar "OLDIFACE" ) <*> argument str ( metavar "NEWIFACE" )
277
false
true
8
11
84
92
43
49
null
null
jystic/QuickSpec
qs1/Equations.hs
bsd-3-clause
-- Main program. genSeeds :: IO [(StdGen, Int)] genSeeds = do rnd <- newStdGen let rnds rnd = rnd1 : rnds rnd2 where (rnd1, rnd2) = split rnd return (zip (rnds rnd) (concat (repeat [0,2..20]))) -- A definition is something of the form -- f x1..xn = u -- where all the xi are distinct variables, there is at least one -- parameter to f, and if there is an application of f inside u, -- then one of the xi mustn't appear in that application.
449
genSeeds :: IO [(StdGen, Int)] genSeeds = do rnd <- newStdGen let rnds rnd = rnd1 : rnds rnd2 where (rnd1, rnd2) = split rnd return (zip (rnds rnd) (concat (repeat [0,2..20]))) -- A definition is something of the form -- f x1..xn = u -- where all the xi are distinct variables, there is at least one -- parameter to f, and if there is an application of f inside u, -- then one of the xi mustn't appear in that application.
431
genSeeds = do rnd <- newStdGen let rnds rnd = rnd1 : rnds rnd2 where (rnd1, rnd2) = split rnd return (zip (rnds rnd) (concat (repeat [0,2..20]))) -- A definition is something of the form -- f x1..xn = u -- where all the xi are distinct variables, there is at least one -- parameter to f, and if there is an application of f inside u, -- then one of the xi mustn't appear in that application.
400
true
true
0
15
95
118
60
58
null
null
cwlmyjm/haskell
AFP/L0216.hs
mpl-2.0
listLength (Cons _ as) = 1 + listLength as
42
listLength (Cons _ as) = 1 + listLength as
42
listLength (Cons _ as) = 1 + listLength as
42
false
false
0
7
8
24
11
13
null
null
spacekitteh/smcghc
libraries/base/Text/ParserCombinators/ReadPrec.hs
bsd-3-clause
reset :: ReadPrec a -> ReadPrec a -- ^ Resets the precedence context to zero. reset (P f) = P (\_ -> f minPrec)
111
reset :: ReadPrec a -> ReadPrec a reset (P f) = P (\_ -> f minPrec)
67
reset (P f) = P (\_ -> f minPrec)
33
true
true
0
9
23
50
23
27
null
null
hsyl20/ViperVM
haskus-system/src/lib/Haskus/Arch/X86_64/Linux/Syscall.hs
bsd-3-clause
syscall0primop :: Int64 -> IO Int64 syscall0primop (I64# n) = IO $ \s -> case (syscall0_# n s) of (# s1, r #) -> (# s1, I64# r #)
132
syscall0primop :: Int64 -> IO Int64 syscall0primop (I64# n) = IO $ \s -> case (syscall0_# n s) of (# s1, r #) -> (# s1, I64# r #)
132
syscall0primop (I64# n) = IO $ \s -> case (syscall0_# n s) of (# s1, r #) -> (# s1, I64# r #)
96
false
true
0
11
31
67
34
33
null
null
tonicebrian/sgf
Data/SGF/Parse/Util.hs
bsd-3-clause
splitColon xs | null xs = Nothing | [enum ':' ] `isPrefixOf` xs = Just ([], drop 1 xs) | [enum '\\'] `isPrefixOf` xs = continue 2 | otherwise = continue 1 where continue n = fmap (first (take n xs ++)) (splitColon (drop n xs))
288
splitColon xs | null xs = Nothing | [enum ':' ] `isPrefixOf` xs = Just ([], drop 1 xs) | [enum '\\'] `isPrefixOf` xs = continue 2 | otherwise = continue 1 where continue n = fmap (first (take n xs ++)) (splitColon (drop n xs))
288
splitColon xs | null xs = Nothing | [enum ':' ] `isPrefixOf` xs = Just ([], drop 1 xs) | [enum '\\'] `isPrefixOf` xs = continue 2 | otherwise = continue 1 where continue n = fmap (first (take n xs ++)) (splitColon (drop n xs))
288
false
false
1
10
107
138
67
71
null
null
sdiehl/ghc
compiler/deSugar/DsForeign.hs
bsd-3-clause
primTyDescChar :: DynFlags -> Type -> Char primTyDescChar dflags ty | ty `eqType` unitTy = 'v' | otherwise = case typePrimRep1 (getPrimTyOf ty) of IntRep -> signed_word WordRep -> unsigned_word Int64Rep -> 'L' Word64Rep -> 'l' AddrRep -> 'p' FloatRep -> 'f' DoubleRep -> 'd' _ -> pprPanic "primTyDescChar" (ppr ty) where (signed_word, unsigned_word) | wORD_SIZE dflags == 4 = ('W','w') | wORD_SIZE dflags == 8 = ('L','l') | otherwise = panic "primTyDescChar"
576
primTyDescChar :: DynFlags -> Type -> Char primTyDescChar dflags ty | ty `eqType` unitTy = 'v' | otherwise = case typePrimRep1 (getPrimTyOf ty) of IntRep -> signed_word WordRep -> unsigned_word Int64Rep -> 'L' Word64Rep -> 'l' AddrRep -> 'p' FloatRep -> 'f' DoubleRep -> 'd' _ -> pprPanic "primTyDescChar" (ppr ty) where (signed_word, unsigned_word) | wORD_SIZE dflags == 4 = ('W','w') | wORD_SIZE dflags == 8 = ('L','l') | otherwise = panic "primTyDescChar"
576
primTyDescChar dflags ty | ty `eqType` unitTy = 'v' | otherwise = case typePrimRep1 (getPrimTyOf ty) of IntRep -> signed_word WordRep -> unsigned_word Int64Rep -> 'L' Word64Rep -> 'l' AddrRep -> 'p' FloatRep -> 'f' DoubleRep -> 'd' _ -> pprPanic "primTyDescChar" (ppr ty) where (signed_word, unsigned_word) | wORD_SIZE dflags == 4 = ('W','w') | wORD_SIZE dflags == 8 = ('L','l') | otherwise = panic "primTyDescChar"
533
false
true
0
11
190
197
94
103
null
null
GaloisInc/mistral
src/Mistral/CodeGen/Specialize.hs
bsd-3-clause
lookupSpec :: Name -> [Type] -> Spec (Maybe Name) lookupSpec n tys = SpecM $ do rw <- get return (Map.lookup (n,tys) (rwInsts rw)) -- | Register a specialization.
170
lookupSpec :: Name -> [Type] -> Spec (Maybe Name) lookupSpec n tys = SpecM $ do rw <- get return (Map.lookup (n,tys) (rwInsts rw)) -- | Register a specialization.
170
lookupSpec n tys = SpecM $ do rw <- get return (Map.lookup (n,tys) (rwInsts rw)) -- | Register a specialization.
120
false
true
0
12
36
76
38
38
null
null
fmthoma/ghc
compiler/main/DynFlags.hs
bsd-3-clause
wayOptc _ WayDebug = []
28
wayOptc _ WayDebug = []
28
wayOptc _ WayDebug = []
28
false
false
0
5
9
13
6
7
null
null
sol/wai
warp/Network/Wai/Handler/Warp.hs
mit
-- | Cache duratoin time of file descriptors in seconds. 0 means that the cache mechanism is not used. Default value: 10 setFdCacheDuration :: Int -> Settings -> Settings setFdCacheDuration x y = y { settingsFdCacheDuration = x }
229
setFdCacheDuration :: Int -> Settings -> Settings setFdCacheDuration x y = y { settingsFdCacheDuration = x }
108
setFdCacheDuration x y = y { settingsFdCacheDuration = x }
58
true
true
0
7
38
38
19
19
null
null
k4smiley/Chan
src/Analytics.hs
bsd-3-clause
memeCount :: Meme -> Thread -> Int memeCount meme thread = sum $ (map wordCount (alias meme)) <*> (posts thread) where wordCount meme post = T.count (T.toLower meme) (T.toLower (fromMaybe "" (P.com post)))
208
memeCount :: Meme -> Thread -> Int memeCount meme thread = sum $ (map wordCount (alias meme)) <*> (posts thread) where wordCount meme post = T.count (T.toLower meme) (T.toLower (fromMaybe "" (P.com post)))
208
memeCount meme thread = sum $ (map wordCount (alias meme)) <*> (posts thread) where wordCount meme post = T.count (T.toLower meme) (T.toLower (fromMaybe "" (P.com post)))
173
false
true
0
12
35
103
51
52
null
null
lambdataro/Dive
Parser.hs
mit
topDo :: Parser (Id,String,Expr) topDo = do { e <- expr; symb ";"; return ("it", "", e) }
89
topDo :: Parser (Id,String,Expr) topDo = do { e <- expr; symb ";"; return ("it", "", e) }
89
topDo = do { e <- expr; symb ";"; return ("it", "", e) }
56
false
true
0
8
17
55
30
25
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F10.hs
bsd-3-clause
-- glGetLocalConstantBooleanvEXT ----------------------------------------------- glGetLocalConstantBooleanvEXT :: MonadIO m => GLuint -- ^ @id@. -> GLenum -- ^ @value@ of type [GetVariantValueEXT](Graphics-GL-Groups.html#GetVariantValueEXT). -> Ptr GLboolean -- ^ @data@ pointing to @COMPSIZE(id)@ elements of type [Boolean](Graphics-GL-Groups.html#Boolean). -> m () glGetLocalConstantBooleanvEXT v1 v2 v3 = liftIO $ dyn363 ptr_glGetLocalConstantBooleanvEXT v1 v2 v3
477
glGetLocalConstantBooleanvEXT :: MonadIO m => GLuint -- ^ @id@. -> GLenum -- ^ @value@ of type [GetVariantValueEXT](Graphics-GL-Groups.html#GetVariantValueEXT). -> Ptr GLboolean -- ^ @data@ pointing to @COMPSIZE(id)@ elements of type [Boolean](Graphics-GL-Groups.html#Boolean). -> m () glGetLocalConstantBooleanvEXT v1 v2 v3 = liftIO $ dyn363 ptr_glGetLocalConstantBooleanvEXT v1 v2 v3
395
glGetLocalConstantBooleanvEXT v1 v2 v3 = liftIO $ dyn363 ptr_glGetLocalConstantBooleanvEXT v1 v2 v3
99
true
true
0
11
58
66
32
34
null
null
bixuanzju/fcore
lib/Inliner.hs
bsd-2-clause
recurNum (PrimOp e1 _ e2) = recurNum e1 + recurNum e2
53
recurNum (PrimOp e1 _ e2) = recurNum e1 + recurNum e2
53
recurNum (PrimOp e1 _ e2) = recurNum e1 + recurNum e2
53
false
false
0
7
10
29
13
16
null
null
Airtnp/Freshman_Simple_Haskell_Lib
Idioms/Heterogenous-collections.hs
mit
-- -- A heteoregenous list of Showable values -- hlist :: [Showable] hlist = [ pack 3 , pack 'x' , pack pi , pack "string" , pack (Just ()) ] -- -- The only thing we can do to Showable values is show them -- -- main :: IO () -- main = print $ map f hlist where f (MkShowable a) = show a {- *Main> main ["3","'x'","3.141592653589793","\"string\"","Just ()"] -} -- One can of course make the type Showable an instance of the type class Show itself -- -- Make Showable itself an instance of Show --
548
hlist :: [Showable] hlist = [ pack 3 , pack 'x' , pack pi , pack "string" , pack (Just ()) ] -- -- The only thing we can do to Showable values is show them -- -- main :: IO () -- main = print $ map f hlist where f (MkShowable a) = show a {- *Main> main ["3","'x'","3.141592653589793","\"string\"","Just ()"] -} -- One can of course make the type Showable an instance of the type class Show itself -- -- Make Showable itself an instance of Show --
499
hlist = [ pack 3 , pack 'x' , pack pi , pack "string" , pack (Just ()) ] -- -- The only thing we can do to Showable values is show them -- -- main :: IO () -- main = print $ map f hlist where f (MkShowable a) = show a {- *Main> main ["3","'x'","3.141592653589793","\"string\"","Just ()"] -} -- One can of course make the type Showable an instance of the type class Show itself -- -- Make Showable itself an instance of Show --
479
true
true
0
9
151
84
49
35
null
null
momomimachli/Hedsql
src/Database/Hedsql/Common/CodeGenerator.hs
gpl-3.0
codeGenFromFunc codeGenerator (From tableReferences) = "FROM" <$> indent 2 (vsep $ mapButLast (\x -> x <> comma) codeGendRefs) where codeGendRefs = map (_codeGenTableRef codeGenerator) tableReferences {-| Generate code for a GROUP BY clause. For pretty print, if the group clause has only one column it is displayed on one line only. For example: > GROUP BY "col1" Otherwise, each column is displayed on a different line: @ GROUP BY "col1", "col2", [etc.] @ -}
485
codeGenFromFunc codeGenerator (From tableReferences) = "FROM" <$> indent 2 (vsep $ mapButLast (\x -> x <> comma) codeGendRefs) where codeGendRefs = map (_codeGenTableRef codeGenerator) tableReferences {-| Generate code for a GROUP BY clause. For pretty print, if the group clause has only one column it is displayed on one line only. For example: > GROUP BY "col1" Otherwise, each column is displayed on a different line: @ GROUP BY "col1", "col2", [etc.] @ -}
485
codeGenFromFunc codeGenerator (From tableReferences) = "FROM" <$> indent 2 (vsep $ mapButLast (\x -> x <> comma) codeGendRefs) where codeGendRefs = map (_codeGenTableRef codeGenerator) tableReferences {-| Generate code for a GROUP BY clause. For pretty print, if the group clause has only one column it is displayed on one line only. For example: > GROUP BY "col1" Otherwise, each column is displayed on a different line: @ GROUP BY "col1", "col2", [etc.] @ -}
485
false
false
0
12
98
69
35
34
null
null
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Input/InputConstants.hs
mit
keySeparator :: Int keySeparator = fromIntegral $ [C.pure| int {KEY_SEPARATOR} |]
81
keySeparator :: Int keySeparator = fromIntegral $ [C.pure| int {KEY_SEPARATOR} |]
81
keySeparator = fromIntegral $ [C.pure| int {KEY_SEPARATOR} |]
61
false
true
0
6
10
21
13
8
null
null
JacquesCarette/literate-scientific-software
code/drasil-printers/Language/Drasil/Plain/Print.hs
bsd-2-clause
specDoc f (Sy u) = unitDoc f u
30
specDoc f (Sy u) = unitDoc f u
30
specDoc f (Sy u) = unitDoc f u
30
false
false
0
7
7
23
10
13
null
null
beni55/LambdaHack
Game/LambdaHack/Atomic/PosAtomicRead.hs
bsd-3-clause
breakSfxAtomic :: MonadStateRead m => SfxAtomic -> m [SfxAtomic] breakSfxAtomic cmd = case cmd of SfxStrike source target _ _ _ -> do -- Hack: make a fight detectable even if one of combatants not visible. sb <- getsState $ getActorBody source return $! [ SfxEffect (bfid sb) source (IK.RefillCalm (-1)) | not $ bproj sb ] ++ [SfxEffect (bfid sb) target (IK.RefillHP (-1))] _ -> return [cmd] -- | Messages for some unseen game object creation/destruction/alteration.
511
breakSfxAtomic :: MonadStateRead m => SfxAtomic -> m [SfxAtomic] breakSfxAtomic cmd = case cmd of SfxStrike source target _ _ _ -> do -- Hack: make a fight detectable even if one of combatants not visible. sb <- getsState $ getActorBody source return $! [ SfxEffect (bfid sb) source (IK.RefillCalm (-1)) | not $ bproj sb ] ++ [SfxEffect (bfid sb) target (IK.RefillHP (-1))] _ -> return [cmd] -- | Messages for some unseen game object creation/destruction/alteration.
511
breakSfxAtomic cmd = case cmd of SfxStrike source target _ _ _ -> do -- Hack: make a fight detectable even if one of combatants not visible. sb <- getsState $ getActorBody source return $! [ SfxEffect (bfid sb) source (IK.RefillCalm (-1)) | not $ bproj sb ] ++ [SfxEffect (bfid sb) target (IK.RefillHP (-1))] _ -> return [cmd] -- | Messages for some unseen game object creation/destruction/alteration.
446
false
true
0
17
121
163
80
83
null
null
diku-dk/futhark
src/Futhark/CodeGen/Backends/GenericWASM.hs
isc
extToString (Imp.TransparentValue _ (Imp.ScalarValue (IntType Int8) Imp.TypeDirect _)) = "i8"
93
extToString (Imp.TransparentValue _ (Imp.ScalarValue (IntType Int8) Imp.TypeDirect _)) = "i8"
93
extToString (Imp.TransparentValue _ (Imp.ScalarValue (IntType Int8) Imp.TypeDirect _)) = "i8"
93
false
false
0
11
9
39
19
20
null
null
droundy/franchise
Distribution/Franchise/Buildable.hs
bsd-3-clause
getTarget :: String -> C (Maybe Target) getTarget t = do allts <- getTargets return $ lookupT t allts `mplus` lookupT (phony t) allts
150
getTarget :: String -> C (Maybe Target) getTarget t = do allts <- getTargets return $ lookupT t allts `mplus` lookupT (phony t) allts
150
getTarget t = do allts <- getTargets return $ lookupT t allts `mplus` lookupT (phony t) allts
110
false
true
0
11
40
68
31
37
null
null
keithodulaigh/Hets
QBF/ProveDepQBF.hs
gpl-2.0
depQBFGUI :: String -- ^ theory name -> Theory Sign AS.FORMULA ProofTree -> [FreeDefMorphism AS.FORMULA Morphism] -- ^ freeness constraints -> IO [ProofStatus ProofTree] -- ^ proof status for each goal depQBFGUI thName th freedefs = genericATPgui (atpFun thName) True (proverName depQBFProver) thName th freedefs emptyProofTree
382
depQBFGUI :: String -- ^ theory name -> Theory Sign AS.FORMULA ProofTree -> [FreeDefMorphism AS.FORMULA Morphism] -- ^ freeness constraints -> IO [ProofStatus ProofTree] depQBFGUI thName th freedefs = genericATPgui (atpFun thName) True (proverName depQBFProver) thName th freedefs emptyProofTree
350
depQBFGUI thName th freedefs = genericATPgui (atpFun thName) True (proverName depQBFProver) thName th freedefs emptyProofTree
147
true
true
0
10
100
88
44
44
null
null
hsyl20/ViperVM
haskus-system/src/lib/Haskus/Arch/X86_64/Linux/Syscall.hs
bsd-3-clause
syscall1safe :: (Arg a) => Int64 -> a -> IO Int64 syscall1safe n a = syscall1safe' n (toArg a)
94
syscall1safe :: (Arg a) => Int64 -> a -> IO Int64 syscall1safe n a = syscall1safe' n (toArg a)
94
syscall1safe n a = syscall1safe' n (toArg a)
44
false
true
0
8
18
47
23
24
null
null
facebookincubator/duckling
tests/Duckling/Temperature/TR/Tests.hs
bsd-3-clause
tests :: TestTree tests = testGroup "TR Tests" [ makeCorpusTest [Seal Temperature] corpus ]
95
tests :: TestTree tests = testGroup "TR Tests" [ makeCorpusTest [Seal Temperature] corpus ]
95
tests = testGroup "TR Tests" [ makeCorpusTest [Seal Temperature] corpus ]
77
false
true
0
9
17
38
16
22
null
null
drets/scheme-haskell-48h
test/Spec.hs
bsd-3-clause
badTestEval :: Env -> Test badTestEval env = TestCase $ do let testCases = [ "(if 1 (+ 2 3 (- 5 1)) \"unequal\")" , "(cond ((< 3 2) 'less) ((< 3 3) 'less))" , "(case (car '(c d)) ((a) 'a) ((b) 'b))" , "(string-ref \"Haskell\" 8)" , "(substring \"abcd\" 0 5)" , "(substring \"abcd\" -1 4)" , "(substring 4 0 4)" ] forM_ testCases $ do \input -> do assert $ isLeft (runEval env input)
461
badTestEval :: Env -> Test badTestEval env = TestCase $ do let testCases = [ "(if 1 (+ 2 3 (- 5 1)) \"unequal\")" , "(cond ((< 3 2) 'less) ((< 3 3) 'less))" , "(case (car '(c d)) ((a) 'a) ((b) 'b))" , "(string-ref \"Haskell\" 8)" , "(substring \"abcd\" 0 5)" , "(substring \"abcd\" -1 4)" , "(substring 4 0 4)" ] forM_ testCases $ do \input -> do assert $ isLeft (runEval env input)
461
badTestEval env = TestCase $ do let testCases = [ "(if 1 (+ 2 3 (- 5 1)) \"unequal\")" , "(cond ((< 3 2) 'less) ((< 3 3) 'less))" , "(case (car '(c d)) ((a) 'a) ((b) 'b))" , "(string-ref \"Haskell\" 8)" , "(substring \"abcd\" 0 5)" , "(substring \"abcd\" -1 4)" , "(substring 4 0 4)" ] forM_ testCases $ do \input -> do assert $ isLeft (runEval env input)
434
false
true
0
17
154
88
45
43
null
null
23Skidoo/heist
src/Heist/Common.hs
bsd-3-clause
splitLocalPath :: ByteString -> TPath splitLocalPath = splitPathWith pathSeparator
82
splitLocalPath :: ByteString -> TPath splitLocalPath = splitPathWith pathSeparator
82
splitLocalPath = splitPathWith pathSeparator
44
false
true
0
7
8
24
10
14
null
null
tylerjl/adventofcode
src/Y2018/D01.hs
mit
twiceFrequency :: String -> Maybe Int twiceFrequency input = case parseFrequency input of Left _ -> Nothing Right f -> Just $ findRepeatedFrequency (cycle f) [] 0
202
twiceFrequency :: String -> Maybe Int twiceFrequency input = case parseFrequency input of Left _ -> Nothing Right f -> Just $ findRepeatedFrequency (cycle f) [] 0
202
twiceFrequency input = case parseFrequency input of Left _ -> Nothing Right f -> Just $ findRepeatedFrequency (cycle f) [] 0
164
false
true
0
11
66
65
30
35
null
null
HalfWayMan/meadowstalk
src/Meadowstalk/Handlers/Admin.hs
bsd-3-clause
------------------------------------------------------------------------------- getAdminUserSignInR :: Handler Html getAdminUserSignInR = undefined
148
getAdminUserSignInR :: Handler Html getAdminUserSignInR = undefined
67
getAdminUserSignInR = undefined
31
true
true
0
5
8
15
8
7
null
null
dvcolgan/LanguageSurvey
programs/Main.hs
mit
--It would appear that the game structure, being very procedural in nature, does not benefit from a purely functional model takeTurn :: Player -> [Int] -> IO Player takeTurn player totalScores = do initialDice <- rollDice [0,0,0,0,0,0] turnLoop TurnState {remaining = initialDice, setAside = [], turnScore = 0} where turnLoop turnState | isFarkle $ remaining turnState = do warnFarkle (kind player) (remaining turnState) return player | otherwise = do newSetAside <- querySetAside (kind player) turnState totalScores newRoll <- rollDice (if length (setAside turnState) + length newSetAside == 6 then [0,0,0,0,0,0] else removeElems newSetAside (remaining turnState)) let newTurnState = TurnState { remaining = newRoll , setAside = (if length newRoll == 6 then [] else setAside turnState ++ newSetAside) , turnScore = turnScore turnState + fst (findScore newSetAside) } choice <- queryStop (kind player) (threshold player) newTurnState totalScores if choice == True then do return $ player { score = score player + turnScore newTurnState } else do turnLoop newTurnState
1,438
takeTurn :: Player -> [Int] -> IO Player takeTurn player totalScores = do initialDice <- rollDice [0,0,0,0,0,0] turnLoop TurnState {remaining = initialDice, setAside = [], turnScore = 0} where turnLoop turnState | isFarkle $ remaining turnState = do warnFarkle (kind player) (remaining turnState) return player | otherwise = do newSetAside <- querySetAside (kind player) turnState totalScores newRoll <- rollDice (if length (setAside turnState) + length newSetAside == 6 then [0,0,0,0,0,0] else removeElems newSetAside (remaining turnState)) let newTurnState = TurnState { remaining = newRoll , setAside = (if length newRoll == 6 then [] else setAside turnState ++ newSetAside) , turnScore = turnScore turnState + fst (findScore newSetAside) } choice <- queryStop (kind player) (threshold player) newTurnState totalScores if choice == True then do return $ player { score = score player + turnScore newTurnState } else do turnLoop newTurnState
1,314
takeTurn player totalScores = do initialDice <- rollDice [0,0,0,0,0,0] turnLoop TurnState {remaining = initialDice, setAside = [], turnScore = 0} where turnLoop turnState | isFarkle $ remaining turnState = do warnFarkle (kind player) (remaining turnState) return player | otherwise = do newSetAside <- querySetAside (kind player) turnState totalScores newRoll <- rollDice (if length (setAside turnState) + length newSetAside == 6 then [0,0,0,0,0,0] else removeElems newSetAside (remaining turnState)) let newTurnState = TurnState { remaining = newRoll , setAside = (if length newRoll == 6 then [] else setAside turnState ++ newSetAside) , turnScore = turnScore turnState + fst (findScore newSetAside) } choice <- queryStop (kind player) (threshold player) newTurnState totalScores if choice == True then do return $ player { score = score player + turnScore newTurnState } else do turnLoop newTurnState
1,273
true
true
0
16
529
381
192
189
null
null
beni55/haste-compiler
libraries/ghc-7.10/ghc-prim/GHC/Prim.hs
bsd-3-clause
-- |Make an immutable array mutable, without copying. unsafeThawSmallArray# :: SmallArray# a -> State# s -> (# State# s,SmallMutableArray# s a #) unsafeThawSmallArray# = let x = x in x
185
unsafeThawSmallArray# :: SmallArray# a -> State# s -> (# State# s,SmallMutableArray# s a #) unsafeThawSmallArray# = let x = x in x
130
unsafeThawSmallArray# = let x = x in x
38
true
true
0
10
30
57
25
32
null
null
pxqr/intset
src/Data/IntervalSet/Internal.hs
bsd-3-clause
isValid (Bin _ m (Fin _ m1) (Fin _ m2)) = not (m == m1 && m == m2)
69
isValid (Bin _ m (Fin _ m1) (Fin _ m2)) = not (m == m1 && m == m2)
69
isValid (Bin _ m (Fin _ m1) (Fin _ m2)) = not (m == m1 && m == m2)
69
false
false
0
9
21
55
27
28
null
null
leepike/copilot-language
src/Copilot/Language/Operators/Integral.hs
bsd-3-clause
_ ^ _ = Core.badUsage "in ^: in x ^ y, either x must be the constant 2, or y must be a constant. (Do not confuse ^ with bitwise XOR (.^.) or with ** for exponentation of floats/doubles.)"
205
_ ^ _ = Core.badUsage "in ^: in x ^ y, either x must be the constant 2, or y must be a constant. (Do not confuse ^ with bitwise XOR (.^.) or with ** for exponentation of floats/doubles.)"
205
_ ^ _ = Core.badUsage "in ^: in x ^ y, either x must be the constant 2, or y must be a constant. (Do not confuse ^ with bitwise XOR (.^.) or with ** for exponentation of floats/doubles.)"
205
false
false
0
6
56
17
7
10
null
null
beni55/cryptol
src/Cryptol/REPL/Monad.hs
bsd-3-clause
getModuleEnv :: REPL M.ModuleEnv getModuleEnv = eModuleEnv `fmap` getRW
72
getModuleEnv :: REPL M.ModuleEnv getModuleEnv = eModuleEnv `fmap` getRW
72
getModuleEnv = eModuleEnv `fmap` getRW
39
false
true
0
7
9
28
13
15
null
null
ChrisCoffey/haskell_sandbox
hackerRank/interpreters/Interpreters/src/while.hs
mit
interpret (Many (s:ls)) p = interpret (Many ls) $ interpret s p
71
interpret (Many (s:ls)) p = interpret (Many ls) $ interpret s p
71
interpret (Many (s:ls)) p = interpret (Many ls) $ interpret s p
71
false
false
0
9
19
42
20
22
null
null
whittle/bounty
lib/Bounty/Application.hs
mit
parser :: Conduit B.ByteString IO CommandParse parser = conduitParserEither command
83
parser :: Conduit B.ByteString IO CommandParse parser = conduitParserEither command
83
parser = conduitParserEither command
36
false
true
0
6
9
23
11
12
null
null
dmbarbour/awelon
hsrc/AO/Env.hs
bsd-3-clause
- | (idempotent) obtain or create the JIT directory getJitDir :: IO FS.FilePath getJitDir = getAO_TEMP >>= \ aoTmp -> let jitDir = aoTmp FS.</> FS.fromText (T.pack "jit") in FS.createDirectory True jitDir >> return jitDir
238
getJitDir :: IO FS.FilePath getJitDir = getAO_TEMP >>= \ aoTmp -> let jitDir = aoTmp FS.</> FS.fromText (T.pack "jit") in FS.createDirectory True jitDir >> return jitDir
185
getJitDir = getAO_TEMP >>= \ aoTmp -> let jitDir = aoTmp FS.</> FS.fromText (T.pack "jit") in FS.createDirectory True jitDir >> return jitDir
157
true
true
5
14
51
102
45
57
null
null
tanakh/tanakh.jp
tools/copipe-gen-gen.hs
bsd-3-clause
orQuery :: CopipeQuery -> CopipeQuery -> Fay CopipeQuery orQuery = ffi "Parse.Query.or(%1,%2)"
95
orQuery :: CopipeQuery -> CopipeQuery -> Fay CopipeQuery orQuery = ffi "Parse.Query.or(%1,%2)"
94
orQuery = ffi "Parse.Query.or(%1,%2)"
37
false
true
0
7
12
25
12
13
null
null
pyr/apotiki
System/Apotiki/Config.hs
isc
configComponent ApotikiConfig { component = x } = x
51
configComponent ApotikiConfig { component = x } = x
51
configComponent ApotikiConfig { component = x } = x
51
false
false
1
7
8
23
10
13
null
null
facebookarchive/lex-pass
src/Data/List/NonEmpty.hs
bsd-3-clause
fromList (x:xs) = Just $ NonEmpty x xs
38
fromList (x:xs) = Just $ NonEmpty x xs
38
fromList (x:xs) = Just $ NonEmpty x xs
38
false
false
0
7
7
25
12
13
null
null
ideas-edu/ideas
src/Ideas/Text/XML/Unicode.hs
apache-2.0
intpairs :: [(Char, Char)] -> [(Int, Int)] intpairs = map (ord *** ord)
72
intpairs :: [(Char, Char)] -> [(Int, Int)] intpairs = map (ord *** ord)
71
intpairs = map (ord *** ord)
28
false
true
0
9
13
50
26
24
null
null
achirkin/qua-kit
services/siren/src/Lib.hs
mit
updateScenario :: Connection -> Int64 -- ^ token (callID) -> Maybe UserId -> AuthRole -> ScenarioId -- ^ ScID (scenario id) -> BS.ByteString -- ^ GeoJSON Feature Collection -> IO (Either BS.ByteString BS.ByteString) -- ^ Either error or json result updateScenario conn token userId authRole scID scenario = do mrez <- execParams conn "SELECT wrap_result($1,update_scenario($2,$3,$4,$5));" [ mkInt64 token , userId >>= mkUserIdInt64 , mkAuthRole authRole , mkBigInt scID , Just (oidJSONB, scenario, Text) ] Text justResult mrez $ flip checkResult id
671
updateScenario :: Connection -> Int64 -- ^ token (callID) -> Maybe UserId -> AuthRole -> ScenarioId -- ^ ScID (scenario id) -> BS.ByteString -- ^ GeoJSON Feature Collection -> IO (Either BS.ByteString BS.ByteString) updateScenario conn token userId authRole scID scenario = do mrez <- execParams conn "SELECT wrap_result($1,update_scenario($2,$3,$4,$5));" [ mkInt64 token , userId >>= mkUserIdInt64 , mkAuthRole authRole , mkBigInt scID , Just (oidJSONB, scenario, Text) ] Text justResult mrez $ flip checkResult id
638
updateScenario conn token userId authRole scID scenario = do mrez <- execParams conn "SELECT wrap_result($1,update_scenario($2,$3,$4,$5));" [ mkInt64 token , userId >>= mkUserIdInt64 , mkAuthRole authRole , mkBigInt scID , Just (oidJSONB, scenario, Text) ] Text justResult mrez $ flip checkResult id
332
true
true
0
14
203
143
72
71
null
null
scottgw/language-eiffel
Language/Eiffel/Position.hs
bsd-3-clause
attachEmptyPos = attachPos (initialPos "<no file name>")
56
attachEmptyPos = attachPos (initialPos "<no file name>")
56
attachEmptyPos = attachPos (initialPos "<no file name>")
56
false
false
1
7
6
18
7
11
null
null
UCSD-PL/RefScript
src/Language/Rsc/SSA/SSA.hs
bsd-3-clause
ssaExpr g (UnaryAssignExpr l uop (LVar lv v)) = do let x = Id lv v x0 <- ssaVarRef g l x (x1, g') <- updSsaEnv g l x let (eI, eO) = unaryExprs l uop x0 (VarRef l x1) return (g', [ssaAsgnStmt l lv x x1 eI], eO) -- lv++
275
ssaExpr g (UnaryAssignExpr l uop (LVar lv v)) = do let x = Id lv v x0 <- ssaVarRef g l x (x1, g') <- updSsaEnv g l x let (eI, eO) = unaryExprs l uop x0 (VarRef l x1) return (g', [ssaAsgnStmt l lv x x1 eI], eO) -- lv++
275
ssaExpr g (UnaryAssignExpr l uop (LVar lv v)) = do let x = Id lv v x0 <- ssaVarRef g l x (x1, g') <- updSsaEnv g l x let (eI, eO) = unaryExprs l uop x0 (VarRef l x1) return (g', [ssaAsgnStmt l lv x x1 eI], eO) -- lv++
275
false
false
0
12
108
140
68
72
null
null
GregorySchwartz/tree-fun
src/Math/TreeFun/Tree.hs
gpl-3.0
-- | Return the inner nodes of the tree innerNodes :: Tree a -> [a] innerNodes (Node { rootLabel = _, subForest = [] }) = []
124
innerNodes :: Tree a -> [a] innerNodes (Node { rootLabel = _, subForest = [] }) = []
84
innerNodes (Node { rootLabel = _, subForest = [] }) = []
56
true
true
0
10
26
47
26
21
null
null
vTurbine/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
voidPrimTyConKey = mkPreludeTyConUnique 58
65
voidPrimTyConKey = mkPreludeTyConUnique 58
65
voidPrimTyConKey = mkPreludeTyConUnique 58
65
false
false
0
5
26
9
4
5
null
null
vTurbine/ghc
compiler/main/Packages.hs
bsd-3-clause
getPackageIncludePath :: DynFlags -> [UnitId] -> IO [String] getPackageIncludePath dflags pkgs = collectIncludeDirs `fmap` getPreloadPackagesAnd dflags pkgs
158
getPackageIncludePath :: DynFlags -> [UnitId] -> IO [String] getPackageIncludePath dflags pkgs = collectIncludeDirs `fmap` getPreloadPackagesAnd dflags pkgs
158
getPackageIncludePath dflags pkgs = collectIncludeDirs `fmap` getPreloadPackagesAnd dflags pkgs
97
false
true
0
8
18
44
23
21
null
null
sthiele/hasple
SPVar.hs
gpl-3.0
get_ng1 :: [Literal] -> CClause get_ng1 b = let pb = [ a | PAtom a <- b ] nb = [ a | NAtom a <- b ] in ((atoms2vars pb), ((BLit b):(atoms2vars nb)))
160
get_ng1 :: [Literal] -> CClause get_ng1 b = let pb = [ a | PAtom a <- b ] nb = [ a | NAtom a <- b ] in ((atoms2vars pb), ((BLit b):(atoms2vars nb)))
160
get_ng1 b = let pb = [ a | PAtom a <- b ] nb = [ a | NAtom a <- b ] in ((atoms2vars pb), ((BLit b):(atoms2vars nb)))
128
false
true
0
12
46
96
50
46
null
null
hobofan/dotfiles
xmonad/xmonad.hs
mit
------------------------------------------------------------------------ -- Key bindings. Add, modify or remove key bindings here. -- myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ -- launch a terminal [ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf) -- launch dmenu , ((modm, xK_p ), spawn "rofi -show run") , ((modm, xK_bracketleft ), spawn "conky -u 0.2 -i 25 | dzen2 -x '0' -w '1920' -h '24' -ta 'c' -bg '#1B1D1E' -fg '#FFFFFF' -y '0'") -- launch gmrun , ((modm .|. shiftMask, xK_p ), spawn "gmrun") -- close focused window , ((modm .|. shiftMask, xK_c ), kill) -- Rotate through the available layout algorithms , ((modm, xK_space ), sendMessage NextLayout) -- Reset the layouts on the current workspace to default , ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) -- Resize viewed windows to the correct size -- , ((modm, xK_n ), refresh) -- Move focus to the next window , ((modm, xK_Tab ), windows W.focusDown) -- Move focus to the next window , ((modm, xK_j ), windows W.focusDown) -- Move focus to the previous window , ((modm, xK_k ), windows W.focusUp ) -- Move focus to the master window --, ((modm, xK_m ), windows W.focusMaster ) -- Switch caps to escape , ((modm, xK_n ), spawn "xmodmap -e 'clear Lock' && xmodmap -e 'keycode 66 = Caps_Lock'" ) , ((modm, xK_m ), spawn "xmodmap -e 'clear Lock' && xmodmap -e 'keycode 66 = Escape'" ) -- Swap the focused window and the master window , ((modm, xK_Return), windows W.swapMaster) -- Swap the focused window with the next window , ((modm .|. shiftMask, xK_j ), windows W.swapDown ) -- Swap the focused window with the previous window , ((modm .|. shiftMask, xK_k ), windows W.swapUp ) -- Shrink the master area , ((modm, xK_h ), sendMessage Shrink) -- Expand the master area , ((modm, xK_l ), sendMessage Expand) -- Push window back into tiling , ((modm, xK_t ), withFocused $ windows . W.sink) -- Increment the number of windows in the master area , ((modm , xK_comma ), sendMessage (IncMasterN 1)) -- Deincrement the number of windows in the master area , ((modm , xK_period), sendMessage (IncMasterN (-1))) -- CUSTOM -- Switch Keyboard layout to en , ((modm , xK_i),spawn "setxkbmap -layout us && xmodmap -e 'clear Lock' && xmodmap -e 'keycode 66 = Escape'") -- Switch Keyboard layout to de , ((modm , xK_o), spawn "setxkbmap -layout de && xmodmap -e 'clear Lock' && xmodmap -e 'keycode 66 = Escape'") , ((modm , xK_KP_Page_Up), spawn "xbacklight -set 100 && xrandr --output HDMI2 --brightness 1") , ((modm , xK_KP_Up), spawn "xbacklight -set 75 && xrandr --output HDMI2 --brightness 0.9") , ((modm , xK_KP_Home), spawn "xbacklight -set 50 && xrandr --output HDMI2 --brightness 0.8") , ((modm , xK_KP_Right), spawn "xbacklight -set 25 && xrandr --output HDMI2 --brightness 0.7") , ((modm , xK_KP_Begin), spawn "xbacklight -set 10 && xrandr --output HDMI2 --brightness 0.5") , ((modm , xK_KP_Left), spawn "xbacklight -set 1") , ((modm , xK_KP_End), spawn "redshift -x") , ((modm , xK_KP_Down), spawn "redshift -O 3400") , ((modm , xK_KP_Next), spawn "redshift -O 1900") -- Toggle the status bar gap -- Use this binding with avoidStruts from Hooks.ManageDocks. -- See also the statusBar function from Hooks.DynamicLog. -- -- , ((modm , xK_b ), sendMessage ToggleStruts) -- Quit xmonad -- , ((modm .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) -- Restart xmonad -- , ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart") -- Run xmessage with a summary of the default keybindings (useful for beginners) , ((modm .|. shiftMask, xK_slash ), spawn ("echo \"" ++ help ++ "\" | xmessage -file -")) ] ++ -- -- mod-[1..9], Switch to workspace N -- mod-shift-[1..9], Move client to workspace N -- --[((m .|. modm, k), windows $ f i) -- | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9] -- , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] [((m .|. modm, k), windows $ onCurrentScreen f i) | (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9] , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] ++ -- -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3 -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3 -- [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f)) | (key, sc) <- zip [xK_e, xK_w, xK_q] [0..] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
5,190
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ -- launch a terminal [ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf) -- launch dmenu , ((modm, xK_p ), spawn "rofi -show run") , ((modm, xK_bracketleft ), spawn "conky -u 0.2 -i 25 | dzen2 -x '0' -w '1920' -h '24' -ta 'c' -bg '#1B1D1E' -fg '#FFFFFF' -y '0'") -- launch gmrun , ((modm .|. shiftMask, xK_p ), spawn "gmrun") -- close focused window , ((modm .|. shiftMask, xK_c ), kill) -- Rotate through the available layout algorithms , ((modm, xK_space ), sendMessage NextLayout) -- Reset the layouts on the current workspace to default , ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) -- Resize viewed windows to the correct size -- , ((modm, xK_n ), refresh) -- Move focus to the next window , ((modm, xK_Tab ), windows W.focusDown) -- Move focus to the next window , ((modm, xK_j ), windows W.focusDown) -- Move focus to the previous window , ((modm, xK_k ), windows W.focusUp ) -- Move focus to the master window --, ((modm, xK_m ), windows W.focusMaster ) -- Switch caps to escape , ((modm, xK_n ), spawn "xmodmap -e 'clear Lock' && xmodmap -e 'keycode 66 = Caps_Lock'" ) , ((modm, xK_m ), spawn "xmodmap -e 'clear Lock' && xmodmap -e 'keycode 66 = Escape'" ) -- Swap the focused window and the master window , ((modm, xK_Return), windows W.swapMaster) -- Swap the focused window with the next window , ((modm .|. shiftMask, xK_j ), windows W.swapDown ) -- Swap the focused window with the previous window , ((modm .|. shiftMask, xK_k ), windows W.swapUp ) -- Shrink the master area , ((modm, xK_h ), sendMessage Shrink) -- Expand the master area , ((modm, xK_l ), sendMessage Expand) -- Push window back into tiling , ((modm, xK_t ), withFocused $ windows . W.sink) -- Increment the number of windows in the master area , ((modm , xK_comma ), sendMessage (IncMasterN 1)) -- Deincrement the number of windows in the master area , ((modm , xK_period), sendMessage (IncMasterN (-1))) -- CUSTOM -- Switch Keyboard layout to en , ((modm , xK_i),spawn "setxkbmap -layout us && xmodmap -e 'clear Lock' && xmodmap -e 'keycode 66 = Escape'") -- Switch Keyboard layout to de , ((modm , xK_o), spawn "setxkbmap -layout de && xmodmap -e 'clear Lock' && xmodmap -e 'keycode 66 = Escape'") , ((modm , xK_KP_Page_Up), spawn "xbacklight -set 100 && xrandr --output HDMI2 --brightness 1") , ((modm , xK_KP_Up), spawn "xbacklight -set 75 && xrandr --output HDMI2 --brightness 0.9") , ((modm , xK_KP_Home), spawn "xbacklight -set 50 && xrandr --output HDMI2 --brightness 0.8") , ((modm , xK_KP_Right), spawn "xbacklight -set 25 && xrandr --output HDMI2 --brightness 0.7") , ((modm , xK_KP_Begin), spawn "xbacklight -set 10 && xrandr --output HDMI2 --brightness 0.5") , ((modm , xK_KP_Left), spawn "xbacklight -set 1") , ((modm , xK_KP_End), spawn "redshift -x") , ((modm , xK_KP_Down), spawn "redshift -O 3400") , ((modm , xK_KP_Next), spawn "redshift -O 1900") -- Toggle the status bar gap -- Use this binding with avoidStruts from Hooks.ManageDocks. -- See also the statusBar function from Hooks.DynamicLog. -- -- , ((modm , xK_b ), sendMessage ToggleStruts) -- Quit xmonad -- , ((modm .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) -- Restart xmonad -- , ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart") -- Run xmessage with a summary of the default keybindings (useful for beginners) , ((modm .|. shiftMask, xK_slash ), spawn ("echo \"" ++ help ++ "\" | xmessage -file -")) ] ++ -- -- mod-[1..9], Switch to workspace N -- mod-shift-[1..9], Move client to workspace N -- --[((m .|. modm, k), windows $ f i) -- | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9] -- , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] [((m .|. modm, k), windows $ onCurrentScreen f i) | (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9] , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] ++ -- -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3 -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3 -- [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f)) | (key, sc) <- zip [xK_e, xK_w, xK_q] [0..] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
5,056
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ -- launch a terminal [ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf) -- launch dmenu , ((modm, xK_p ), spawn "rofi -show run") , ((modm, xK_bracketleft ), spawn "conky -u 0.2 -i 25 | dzen2 -x '0' -w '1920' -h '24' -ta 'c' -bg '#1B1D1E' -fg '#FFFFFF' -y '0'") -- launch gmrun , ((modm .|. shiftMask, xK_p ), spawn "gmrun") -- close focused window , ((modm .|. shiftMask, xK_c ), kill) -- Rotate through the available layout algorithms , ((modm, xK_space ), sendMessage NextLayout) -- Reset the layouts on the current workspace to default , ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) -- Resize viewed windows to the correct size -- , ((modm, xK_n ), refresh) -- Move focus to the next window , ((modm, xK_Tab ), windows W.focusDown) -- Move focus to the next window , ((modm, xK_j ), windows W.focusDown) -- Move focus to the previous window , ((modm, xK_k ), windows W.focusUp ) -- Move focus to the master window --, ((modm, xK_m ), windows W.focusMaster ) -- Switch caps to escape , ((modm, xK_n ), spawn "xmodmap -e 'clear Lock' && xmodmap -e 'keycode 66 = Caps_Lock'" ) , ((modm, xK_m ), spawn "xmodmap -e 'clear Lock' && xmodmap -e 'keycode 66 = Escape'" ) -- Swap the focused window and the master window , ((modm, xK_Return), windows W.swapMaster) -- Swap the focused window with the next window , ((modm .|. shiftMask, xK_j ), windows W.swapDown ) -- Swap the focused window with the previous window , ((modm .|. shiftMask, xK_k ), windows W.swapUp ) -- Shrink the master area , ((modm, xK_h ), sendMessage Shrink) -- Expand the master area , ((modm, xK_l ), sendMessage Expand) -- Push window back into tiling , ((modm, xK_t ), withFocused $ windows . W.sink) -- Increment the number of windows in the master area , ((modm , xK_comma ), sendMessage (IncMasterN 1)) -- Deincrement the number of windows in the master area , ((modm , xK_period), sendMessage (IncMasterN (-1))) -- CUSTOM -- Switch Keyboard layout to en , ((modm , xK_i),spawn "setxkbmap -layout us && xmodmap -e 'clear Lock' && xmodmap -e 'keycode 66 = Escape'") -- Switch Keyboard layout to de , ((modm , xK_o), spawn "setxkbmap -layout de && xmodmap -e 'clear Lock' && xmodmap -e 'keycode 66 = Escape'") , ((modm , xK_KP_Page_Up), spawn "xbacklight -set 100 && xrandr --output HDMI2 --brightness 1") , ((modm , xK_KP_Up), spawn "xbacklight -set 75 && xrandr --output HDMI2 --brightness 0.9") , ((modm , xK_KP_Home), spawn "xbacklight -set 50 && xrandr --output HDMI2 --brightness 0.8") , ((modm , xK_KP_Right), spawn "xbacklight -set 25 && xrandr --output HDMI2 --brightness 0.7") , ((modm , xK_KP_Begin), spawn "xbacklight -set 10 && xrandr --output HDMI2 --brightness 0.5") , ((modm , xK_KP_Left), spawn "xbacklight -set 1") , ((modm , xK_KP_End), spawn "redshift -x") , ((modm , xK_KP_Down), spawn "redshift -O 3400") , ((modm , xK_KP_Next), spawn "redshift -O 1900") -- Toggle the status bar gap -- Use this binding with avoidStruts from Hooks.ManageDocks. -- See also the statusBar function from Hooks.DynamicLog. -- -- , ((modm , xK_b ), sendMessage ToggleStruts) -- Quit xmonad -- , ((modm .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) -- Restart xmonad -- , ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart") -- Run xmessage with a summary of the default keybindings (useful for beginners) , ((modm .|. shiftMask, xK_slash ), spawn ("echo \"" ++ help ++ "\" | xmessage -file -")) ] ++ -- -- mod-[1..9], Switch to workspace N -- mod-shift-[1..9], Move client to workspace N -- --[((m .|. modm, k), windows $ f i) -- | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9] -- , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] [((m .|. modm, k), windows $ onCurrentScreen f i) | (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9] , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] ++ -- -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3 -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3 -- [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f)) | (key, sc) <- zip [xK_e, xK_w, xK_q] [0..] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
5,056
true
false
27
16
1,595
921
570
351
null
null
cocreature/reactand
src/StackSet.hs
isc
reverseStack :: ListZipper a -> ListZipper a reverseStack (ListZipper t ls rs) = ListZipper t rs ls
99
reverseStack :: ListZipper a -> ListZipper a reverseStack (ListZipper t ls rs) = ListZipper t rs ls
99
reverseStack (ListZipper t ls rs) = ListZipper t rs ls
54
false
true
0
6
16
45
20
25
null
null
sgillespie/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
clsQual_RDR mod str = mkOrig mod (mkOccNameFS clsName str)
59
clsQual_RDR mod str = mkOrig mod (mkOccNameFS clsName str)
59
clsQual_RDR mod str = mkOrig mod (mkOccNameFS clsName str)
59
false
false
0
7
9
24
11
13
null
null