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
thalerjonathan/phd
coding/prototyping/haskell/stmAgents/src/Main.hs
gpl-3.0
allQueuesEmpty :: [TQueue Msg] -> IO Bool allQueuesEmpty qs = do atomically $ foldM (\flag q -> ((&&) flag) <$> isEmptyTQueue q) True qs
138
allQueuesEmpty :: [TQueue Msg] -> IO Bool allQueuesEmpty qs = do atomically $ foldM (\flag q -> ((&&) flag) <$> isEmptyTQueue q) True qs
138
allQueuesEmpty qs = do atomically $ foldM (\flag q -> ((&&) flag) <$> isEmptyTQueue q) True qs
96
false
true
0
13
25
66
33
33
null
null
brendanhay/gogol
gogol-dlp/gen/Network/Google/Resource/DLP/Projects/Locations/StoredInfoTypes/List.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). plsitlUploadType :: Lens' ProjectsLocationsStoredInfoTypesList (Maybe Text) plsitlUploadType = lens _plsitlUploadType (\ s a -> s{_plsitlUploadType = a})
232
plsitlUploadType :: Lens' ProjectsLocationsStoredInfoTypesList (Maybe Text) plsitlUploadType = lens _plsitlUploadType (\ s a -> s{_plsitlUploadType = a})
161
plsitlUploadType = lens _plsitlUploadType (\ s a -> s{_plsitlUploadType = a})
85
true
true
0
9
34
48
25
23
null
null
hvr/text
tests/Tests/Properties.hs
bsd-2-clause
tb_decimal_int (a::Int) = tb_decimal a
38
tb_decimal_int (a::Int) = tb_decimal a
38
tb_decimal_int (a::Int) = tb_decimal a
38
false
false
0
7
4
19
9
10
null
null
erantapaa/test-spelling
src/Test4c.hs
bsd-3-clause
readDict = do allwords <- fmap (wrds . T.toLower) $ T.readFile "big.txt" let h = foldl' add H.empty allwords add h w = let c = H.lookupDefault (0 :: Int) w h in H.insert w (c+1) h member = \k -> H.member k h frequency = \k -> H.lookupDefault 0 k h return (member, frequency, T.pack)
324
readDict = do allwords <- fmap (wrds . T.toLower) $ T.readFile "big.txt" let h = foldl' add H.empty allwords add h w = let c = H.lookupDefault (0 :: Int) w h in H.insert w (c+1) h member = \k -> H.member k h frequency = \k -> H.lookupDefault 0 k h return (member, frequency, T.pack)
324
readDict = do allwords <- fmap (wrds . T.toLower) $ T.readFile "big.txt" let h = foldl' add H.empty allwords add h w = let c = H.lookupDefault (0 :: Int) w h in H.insert w (c+1) h member = \k -> H.member k h frequency = \k -> H.lookupDefault 0 k h return (member, frequency, T.pack)
324
false
false
1
16
97
161
78
83
null
null
verement/etamoo
src/MOO/Database/LambdaMOO.hs
bsd-3-clause
read_activ_as_pi :: DBParser () read_activ_as_pi = (<?> "activ_as_pi") $ do read_var _this <- signedInt char ' ' >> signedInt char ' ' >> signedInt _player <- char ' ' >> signedInt char ' ' >> signedInt _progr <- char ' ' >> signedInt _vloc <- char ' ' >> signedInt char ' ' >> signedInt _debug <- char ' ' >> signedInt char '\n' read_string -- was argstr read_string -- was dobjstr read_string -- was iobjstr read_string -- was prepstr _verb <- read_string _verbname <- read_string return ()
536
read_activ_as_pi :: DBParser () read_activ_as_pi = (<?> "activ_as_pi") $ do read_var _this <- signedInt char ' ' >> signedInt char ' ' >> signedInt _player <- char ' ' >> signedInt char ' ' >> signedInt _progr <- char ' ' >> signedInt _vloc <- char ' ' >> signedInt char ' ' >> signedInt _debug <- char ' ' >> signedInt char '\n' read_string -- was argstr read_string -- was dobjstr read_string -- was iobjstr read_string -- was prepstr _verb <- read_string _verbname <- read_string return ()
536
read_activ_as_pi = (<?> "activ_as_pi") $ do read_var _this <- signedInt char ' ' >> signedInt char ' ' >> signedInt _player <- char ' ' >> signedInt char ' ' >> signedInt _progr <- char ' ' >> signedInt _vloc <- char ' ' >> signedInt char ' ' >> signedInt _debug <- char ' ' >> signedInt char '\n' read_string -- was argstr read_string -- was dobjstr read_string -- was iobjstr read_string -- was prepstr _verb <- read_string _verbname <- read_string return ()
504
false
true
0
10
131
174
76
98
null
null
raptros/chatless-hs
client/Chatless/Client/Request.hs
bsd-3-clause
queryPtrSub :: (MChatlessClient m, FromJSON a, PathPointer p) => T.Text -> p -> m a queryPtrSub sub = queryApiJson . pathSub sub
128
queryPtrSub :: (MChatlessClient m, FromJSON a, PathPointer p) => T.Text -> p -> m a queryPtrSub sub = queryApiJson . pathSub sub
128
queryPtrSub sub = queryApiJson . pathSub sub
44
false
true
0
8
21
55
27
28
null
null
siddhanathan/yi
yi-core/src/Yi/Command.hs
gpl-2.0
--------------------------- -- | Changing the buffer name quite useful if you have -- several the same. This also breaks the relation with the file. changeBufferNameE :: YiM () changeBufferNameE = withMinibufferFree "New buffer name:" strFun where strFun :: T.Text -> YiM () strFun = withCurrentBuffer . (.=) identA . MemBuffer ---------------------------- -- | shell-command with argument prompt
408
changeBufferNameE :: YiM () changeBufferNameE = withMinibufferFree "New buffer name:" strFun where strFun :: T.Text -> YiM () strFun = withCurrentBuffer . (.=) identA . MemBuffer ---------------------------- -- | shell-command with argument prompt
258
changeBufferNameE = withMinibufferFree "New buffer name:" strFun where strFun :: T.Text -> YiM () strFun = withCurrentBuffer . (.=) identA . MemBuffer ---------------------------- -- | shell-command with argument prompt
230
true
true
0
7
68
63
34
29
null
null
geophf/1HaskellADay
exercises/HAD/Y2018/M01/D17/Exercise.hs
mit
fetchActiveAuditEntry :: Connection -> IO [AuditEntry] fetchActiveAuditEntry conn = undefined
93
fetchActiveAuditEntry :: Connection -> IO [AuditEntry] fetchActiveAuditEntry conn = undefined
93
fetchActiveAuditEntry conn = undefined
38
false
true
0
7
9
24
12
12
null
null
brendanhay/gogol
gogol-androidmanagement/gen/Network/Google/AndroidManagement/Types/Product.hs
mpl-2.0
-- | The type of system update to configure. suType :: Lens' SystemUpdate (Maybe SystemUpdateType) suType = lens _suType (\ s a -> s{_suType = a})
146
suType :: Lens' SystemUpdate (Maybe SystemUpdateType) suType = lens _suType (\ s a -> s{_suType = a})
101
suType = lens _suType (\ s a -> s{_suType = a})
47
true
true
1
9
25
51
25
26
null
null
ghc-android/ghc
compiler/basicTypes/OccName.hs
bsd-3-clause
mkInstTyTcOcc :: String -- ^ Family name, e.g. @Map@ -> OccSet -- ^ avoid these Occs -> OccName -- ^ @R:Map@ mkInstTyTcOcc str set = chooseUniqueOcc tcName ('R' : ':' : str) set
254
mkInstTyTcOcc :: String -- ^ Family name, e.g. @Map@ -> OccSet -- ^ avoid these Occs -> OccName mkInstTyTcOcc str set = chooseUniqueOcc tcName ('R' : ':' : str) set
226
mkInstTyTcOcc str set = chooseUniqueOcc tcName ('R' : ':' : str) set
70
true
true
0
8
109
45
24
21
null
null
gamelost/pcgen-rules
src/Restrictions.hs
apache-2.0
parsePreSize :: PParser PreSize parsePreSize = do op <- labeled "PRESIZE" *> choice operatorPrefixes preSizeType <- parsePreSizeType return PreSize { preSizeOperator = convertOperator op, .. } where parsePreSizeType = (Fine <$ labeled "F") <|> (Diminutive <$ labeled "D") <|> (Tiny <$ labeled "T") <|> (Small <$ labeled "S") <|> (Medium <$ labeled "M") <|> (Large <$ labeled "L") <|> (Huge <$ labeled "H") <|> (Gargantuan <$ labeled "G") <|> (Colossal <$ labeled "C") <|> (OtherSize <$> parseString) -- PRESKILL:x,y=z,y=z,.. -- x is number of skills -- y is skill name or skill type (TYPE=y) -- z is number of skill ranks
809
parsePreSize :: PParser PreSize parsePreSize = do op <- labeled "PRESIZE" *> choice operatorPrefixes preSizeType <- parsePreSizeType return PreSize { preSizeOperator = convertOperator op, .. } where parsePreSizeType = (Fine <$ labeled "F") <|> (Diminutive <$ labeled "D") <|> (Tiny <$ labeled "T") <|> (Small <$ labeled "S") <|> (Medium <$ labeled "M") <|> (Large <$ labeled "L") <|> (Huge <$ labeled "H") <|> (Gargantuan <$ labeled "G") <|> (Colossal <$ labeled "C") <|> (OtherSize <$> parseString) -- PRESKILL:x,y=z,y=z,.. -- x is number of skills -- y is skill name or skill type (TYPE=y) -- z is number of skill ranks
809
parsePreSize = do op <- labeled "PRESIZE" *> choice operatorPrefixes preSizeType <- parsePreSizeType return PreSize { preSizeOperator = convertOperator op, .. } where parsePreSizeType = (Fine <$ labeled "F") <|> (Diminutive <$ labeled "D") <|> (Tiny <$ labeled "T") <|> (Small <$ labeled "S") <|> (Medium <$ labeled "M") <|> (Large <$ labeled "L") <|> (Huge <$ labeled "H") <|> (Gargantuan <$ labeled "G") <|> (Colossal <$ labeled "C") <|> (OtherSize <$> parseString) -- PRESKILL:x,y=z,y=z,.. -- x is number of skills -- y is skill name or skill type (TYPE=y) -- z is number of skill ranks
777
false
true
0
18
288
202
102
100
null
null
beni55/IHaskell
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Float/BoundedFloat/BoundedFloatText.hs
mit
-- | Create a new widget mkBoundedFloatText :: IO BoundedFloatText mkBoundedFloatText = do -- Default properties, with a random uuid uuid <- U.random let widgetState = WidgetState $ defaultBoundedFloatWidget "FloatTextView" stateIO <- newIORef widgetState let widget = IPythonWidget uuid stateIO -- Open a comm for this widget, and store it in the kernel state widgetSendOpen widget $ toJSON widgetState -- Return the widget return widget
461
mkBoundedFloatText :: IO BoundedFloatText mkBoundedFloatText = do -- Default properties, with a random uuid uuid <- U.random let widgetState = WidgetState $ defaultBoundedFloatWidget "FloatTextView" stateIO <- newIORef widgetState let widget = IPythonWidget uuid stateIO -- Open a comm for this widget, and store it in the kernel state widgetSendOpen widget $ toJSON widgetState -- Return the widget return widget
436
mkBoundedFloatText = do -- Default properties, with a random uuid uuid <- U.random let widgetState = WidgetState $ defaultBoundedFloatWidget "FloatTextView" stateIO <- newIORef widgetState let widget = IPythonWidget uuid stateIO -- Open a comm for this widget, and store it in the kernel state widgetSendOpen widget $ toJSON widgetState -- Return the widget return widget
394
true
true
0
12
87
92
40
52
null
null
kmate/HaRe
old/testing/generativeFold/RenameParamIn3_TokOut.hs
bsd-3-clause
{- de xs = deleteBy (==) 0 xs -} de xs = (case ((==), 0, xs) of (_, _, []) -> [] (eq, x, (y : ys)) -> if x `eq` y then ys else y : (de ys))
183
de xs = (case ((==), 0, xs) of (_, _, []) -> [] (eq, x, (y : ys)) -> if x `eq` y then ys else y : (de ys))
149
de xs = (case ((==), 0, xs) of (_, _, []) -> [] (eq, x, (y : ys)) -> if x `eq` y then ys else y : (de ys))
149
true
false
0
12
82
93
55
38
null
null
beni55/ghcjs
test/ghc/th/tH_recover.hs
mit
main = print y
14
main = print y
14
main = print y
14
false
false
1
5
3
13
4
9
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_OUTPUT_TEXTURE_COORD4_EXT :: GLenum gl_OUTPUT_TEXTURE_COORD4_EXT = 0x87A1
76
gl_OUTPUT_TEXTURE_COORD4_EXT :: GLenum gl_OUTPUT_TEXTURE_COORD4_EXT = 0x87A1
76
gl_OUTPUT_TEXTURE_COORD4_EXT = 0x87A1
37
false
true
0
4
5
11
6
5
null
null
ardumont/haskell-lab
src/Parsers.hs
gpl-2.0
-- *Parsers> parse (item +++ Parsers.fail) "abcd" -- [('a',"bcd")] -- *Parsers> parse (Parsers.fail +++ item) "abcd" -- [('a',"bcd")] -- *Parsers> parse (Parsers.fail +++ return 'd') "abcd" -- [('d',"abcd")] sat :: (Char -> Bool) -> Parser Char sat p = do x <- item; if p x then return x else Parsers.fail -- *Parsers> parse (sat isDigit) "abc" -- [] -- *Parsers> parse (sat isDigit) "a1bc" -- [] -- *Parsers> parse (sat isDigit) "11a1bc" -- [('1',"1a1bc")]
459
sat :: (Char -> Bool) -> Parser Char sat p = do x <- item; if p x then return x else Parsers.fail -- *Parsers> parse (sat isDigit) "abc" -- [] -- *Parsers> parse (sat isDigit) "a1bc" -- [] -- *Parsers> parse (sat isDigit) "11a1bc" -- [('1',"1a1bc")]
250
sat p = do x <- item; if p x then return x else Parsers.fail -- *Parsers> parse (sat isDigit) "abc" -- [] -- *Parsers> parse (sat isDigit) "a1bc" -- [] -- *Parsers> parse (sat isDigit) "11a1bc" -- [('1',"1a1bc")]
213
true
true
0
9
76
72
40
32
null
null
IreneKnapp/Faction
faction/Distribution/Client/InstallPlan.hs
bsd-3-clause
showPackageProblem :: PackageProblem -> String showPackageProblem (DuplicateFlag (FlagName flag)) = "duplicate flag in the flag assignment: " ++ flag
151
showPackageProblem :: PackageProblem -> String showPackageProblem (DuplicateFlag (FlagName flag)) = "duplicate flag in the flag assignment: " ++ flag
151
showPackageProblem (DuplicateFlag (FlagName flag)) = "duplicate flag in the flag assignment: " ++ flag
104
false
true
0
9
20
34
17
17
null
null
cmc-haskell-2016/checkers
src/GraphicsProcessing.hs
bsd-3-clause
eventHandler pool (EventKey (SpecialKey KeyDown) Down _ _) (WorldObject players checkers (State 15 checkerChosen posToMoveChosen checkerIsChosen) alertMessage) = (WorldObject players checkers (State 16 checkerChosen posToMoveChosen checkerIsChosen) alertMessage)
264
eventHandler pool (EventKey (SpecialKey KeyDown) Down _ _) (WorldObject players checkers (State 15 checkerChosen posToMoveChosen checkerIsChosen) alertMessage) = (WorldObject players checkers (State 16 checkerChosen posToMoveChosen checkerIsChosen) alertMessage)
264
eventHandler pool (EventKey (SpecialKey KeyDown) Down _ _) (WorldObject players checkers (State 15 checkerChosen posToMoveChosen checkerIsChosen) alertMessage) = (WorldObject players checkers (State 16 checkerChosen posToMoveChosen checkerIsChosen) alertMessage)
264
false
false
0
9
28
79
39
40
null
null
justanotherdot/advent-linguist
2016/Haskell/AdventOfCode/src/Day02.hs
mit
transitions :: Map (KeypadPos, Command) KeypadPos transitions = M.fromList [(('1', 'R'), '2'), (('1', 'D'), '4') ,(('2', 'L'), '1'), (('2', 'R'), '3'), (('2', 'D'), '5') ,(('3', 'L'), '2'), (('3', 'D'), '6') ,(('4', 'U'), '1'), (('4', 'R'), '5'), (('4', 'D'), '7') ,(('5', 'U'), '2'), (('5', 'R'), '6'), (('5', 'D'), '8'), (('5', 'L'), '4') ,(('6', 'U'), '3'), (('6', 'L'), '5'), (('6', 'D'), '9') ,(('7', 'U'), '4'), (('7', 'R'), '8') ,(('8', 'L'), '7'), (('8', 'U'), '5'), (('8', 'R'), '9') ,(('9', 'L'), '8'), (('9', 'U'), '6')]
731
transitions :: Map (KeypadPos, Command) KeypadPos transitions = M.fromList [(('1', 'R'), '2'), (('1', 'D'), '4') ,(('2', 'L'), '1'), (('2', 'R'), '3'), (('2', 'D'), '5') ,(('3', 'L'), '2'), (('3', 'D'), '6') ,(('4', 'U'), '1'), (('4', 'R'), '5'), (('4', 'D'), '7') ,(('5', 'U'), '2'), (('5', 'R'), '6'), (('5', 'D'), '8'), (('5', 'L'), '4') ,(('6', 'U'), '3'), (('6', 'L'), '5'), (('6', 'D'), '9') ,(('7', 'U'), '4'), (('7', 'R'), '8') ,(('8', 'L'), '7'), (('8', 'U'), '5'), (('8', 'R'), '9') ,(('9', 'L'), '8'), (('9', 'U'), '6')]
731
transitions = M.fromList [(('1', 'R'), '2'), (('1', 'D'), '4') ,(('2', 'L'), '1'), (('2', 'R'), '3'), (('2', 'D'), '5') ,(('3', 'L'), '2'), (('3', 'D'), '6') ,(('4', 'U'), '1'), (('4', 'R'), '5'), (('4', 'D'), '7') ,(('5', 'U'), '2'), (('5', 'R'), '6'), (('5', 'D'), '8'), (('5', 'L'), '4') ,(('6', 'U'), '3'), (('6', 'L'), '5'), (('6', 'D'), '9') ,(('7', 'U'), '4'), (('7', 'R'), '8') ,(('8', 'L'), '7'), (('8', 'U'), '5'), (('8', 'R'), '9') ,(('9', 'L'), '8'), (('9', 'U'), '6')]
681
false
true
0
8
280
387
254
133
null
null
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/EventM.hs
mit
uiDetail :: IsUIEvent e => EventM t e Int uiDetail = event >>= UIEvent.getDetail
80
uiDetail :: IsUIEvent e => EventM t e Int uiDetail = event >>= UIEvent.getDetail
80
uiDetail = event >>= UIEvent.getDetail
38
false
true
2
7
13
39
17
22
null
null
5outh/graphene
src/Graphene/Graph.hs
mit
-- | Insert a list of edges into a graph insertVertices :: Eq b => [b] -> Graph e b -> Graph e b insertVertices vs g = foldl' (flip insertVertex) g vs
150
insertVertices :: Eq b => [b] -> Graph e b -> Graph e b insertVertices vs g = foldl' (flip insertVertex) g vs
109
insertVertices vs g = foldl' (flip insertVertex) g vs
53
true
true
0
8
32
58
28
30
null
null
noughtmare/yi
yi-mode-javascript/src/Yi/Syntax/JavaScript.hs
gpl-2.0
parExpr :: P TT (ParExpr TT) parExpr = ParExpr <$> spc '(' <*> plzExpr `sepBy` spc ',' <*> plzSpc ')' <|> ParExprErr <$> hate 1 (symbol (const True)) <|> ParExprErr <$> hate 2 (pure errorToken)
205
parExpr :: P TT (ParExpr TT) parExpr = ParExpr <$> spc '(' <*> plzExpr `sepBy` spc ',' <*> plzSpc ')' <|> ParExprErr <$> hate 1 (symbol (const True)) <|> ParExprErr <$> hate 2 (pure errorToken)
205
parExpr = ParExpr <$> spc '(' <*> plzExpr `sepBy` spc ',' <*> plzSpc ')' <|> ParExprErr <$> hate 1 (symbol (const True)) <|> ParExprErr <$> hate 2 (pure errorToken)
176
false
true
17
8
46
115
51
64
null
null
LeifW/xmonad-extras
XMonad/Actions/Volume.hs
bsd-3-clause
keyValueLine = do string " " key <- upTo ':' value <- upTo '\n' return (key, drop 1 value)
109
keyValueLine = do string " " key <- upTo ':' value <- upTo '\n' return (key, drop 1 value)
109
keyValueLine = do string " " key <- upTo ':' value <- upTo '\n' return (key, drop 1 value)
109
false
false
0
9
37
49
21
28
null
null
wxzh/fcore
lib/JavaEDSL.hs
bsd-2-clause
wrapperClass :: String -> [BlockStmt] -> Maybe Type -> Maybe Block -> TypeDecl wrapperClass className stmts returnType mainbodyDef = ClassTypeDecl (classDecl [Public] className (classBody (applyMethod : [mainMethod]))) where body = Just (block stmts) applyMethod = memberDecl $ methodDecl [Static] returnType "apply" [] body -- testMethod = memberDecl $ methodDecl [Public,Static] returnType "test" testArgType testBodyDef mainMethod = memberDecl $ methodDecl [Public,Static] Nothing "main" mainArgType mainbodyDef
578
wrapperClass :: String -> [BlockStmt] -> Maybe Type -> Maybe Block -> TypeDecl wrapperClass className stmts returnType mainbodyDef = ClassTypeDecl (classDecl [Public] className (classBody (applyMethod : [mainMethod]))) where body = Just (block stmts) applyMethod = memberDecl $ methodDecl [Static] returnType "apply" [] body -- testMethod = memberDecl $ methodDecl [Public,Static] returnType "test" testArgType testBodyDef mainMethod = memberDecl $ methodDecl [Public,Static] Nothing "main" mainArgType mainbodyDef
578
wrapperClass className stmts returnType mainbodyDef = ClassTypeDecl (classDecl [Public] className (classBody (applyMethod : [mainMethod]))) where body = Just (block stmts) applyMethod = memberDecl $ methodDecl [Static] returnType "apply" [] body -- testMethod = memberDecl $ methodDecl [Public,Static] returnType "test" testArgType testBodyDef mainMethod = memberDecl $ methodDecl [Public,Static] Nothing "main" mainArgType mainbodyDef
499
false
true
1
11
127
153
76
77
null
null
andregr/bot
lib/Bot/Util.hs
bsd-3-clause
checkMarkChar, xMarkChar :: Text checkMarkChar = "\10004"
57
checkMarkChar, xMarkChar :: Text checkMarkChar = "\10004"
57
checkMarkChar = "\10004"
24
false
true
0
4
6
13
8
5
null
null
peterokagey/haskellOEIS
src/Sandbox/CylinderLatticeWalk.hs
apache-2.0
isOngoing :: CurrentState -> Bool isOngoing (Ongoing _) = True
62
isOngoing :: CurrentState -> Bool isOngoing (Ongoing _) = True
62
isOngoing (Ongoing _) = True
28
false
true
0
7
9
24
12
12
null
null
ctford/Idris-Elba-dev
src/Idris/IBC.hs
bsd-3-clause
process :: IBCFile -> FilePath -> Idris () process i fn | ver i /= ibcVersion = do iLOG "ibc out of date" ifail "Incorrect ibc version --- please rebuild" | otherwise = do srcok <- runIO $ doesFileExist (sourcefile i) when srcok $ runIO $ timestampOlder (sourcefile i) fn v <- verbose quiet <- getQuiet -- when (v && srcok && not quiet) $ iputStrLn $ "Skipping " ++ sourcefile i pImports (ibc_imports i) pImps (ibc_implicits i) pFixes (ibc_fixes i) pStatics (ibc_statics i) pClasses (ibc_classes i) pInstances (ibc_instances i) pDSLs (ibc_dsls i) pDatatypes (ibc_datatypes i) pOptimise (ibc_optimise i) pSyntax (ibc_syntax i) pKeywords (ibc_keywords i) pObjs (ibc_objs i) pLibs (ibc_libs i) pCGFlags (ibc_cgflags i) pDyLibs (ibc_dynamic_libs i) pHdrs (ibc_hdrs i) pDefs (symbols i) (ibc_defs i) pAccess (ibc_access i) pTotal (ibc_total i) pCG (ibc_cg i) pDocs (ibc_docstrings i) pCoercions (ibc_coercions i) pTrans (ibc_transforms i) pErrRev (ibc_errRev i) pLineApps (ibc_lineapps i) pNameHints (ibc_namehints i) pMetaInformation (ibc_metainformation i) pErrorHandlers (ibc_errorhandlers i) pFunctionErrorHandlers (ibc_function_errorhandlers i)
1,687
process :: IBCFile -> FilePath -> Idris () process i fn | ver i /= ibcVersion = do iLOG "ibc out of date" ifail "Incorrect ibc version --- please rebuild" | otherwise = do srcok <- runIO $ doesFileExist (sourcefile i) when srcok $ runIO $ timestampOlder (sourcefile i) fn v <- verbose quiet <- getQuiet -- when (v && srcok && not quiet) $ iputStrLn $ "Skipping " ++ sourcefile i pImports (ibc_imports i) pImps (ibc_implicits i) pFixes (ibc_fixes i) pStatics (ibc_statics i) pClasses (ibc_classes i) pInstances (ibc_instances i) pDSLs (ibc_dsls i) pDatatypes (ibc_datatypes i) pOptimise (ibc_optimise i) pSyntax (ibc_syntax i) pKeywords (ibc_keywords i) pObjs (ibc_objs i) pLibs (ibc_libs i) pCGFlags (ibc_cgflags i) pDyLibs (ibc_dynamic_libs i) pHdrs (ibc_hdrs i) pDefs (symbols i) (ibc_defs i) pAccess (ibc_access i) pTotal (ibc_total i) pCG (ibc_cg i) pDocs (ibc_docstrings i) pCoercions (ibc_coercions i) pTrans (ibc_transforms i) pErrRev (ibc_errRev i) pLineApps (ibc_lineapps i) pNameHints (ibc_namehints i) pMetaInformation (ibc_metainformation i) pErrorHandlers (ibc_errorhandlers i) pFunctionErrorHandlers (ibc_function_errorhandlers i)
1,687
process i fn | ver i /= ibcVersion = do iLOG "ibc out of date" ifail "Incorrect ibc version --- please rebuild" | otherwise = do srcok <- runIO $ doesFileExist (sourcefile i) when srcok $ runIO $ timestampOlder (sourcefile i) fn v <- verbose quiet <- getQuiet -- when (v && srcok && not quiet) $ iputStrLn $ "Skipping " ++ sourcefile i pImports (ibc_imports i) pImps (ibc_implicits i) pFixes (ibc_fixes i) pStatics (ibc_statics i) pClasses (ibc_classes i) pInstances (ibc_instances i) pDSLs (ibc_dsls i) pDatatypes (ibc_datatypes i) pOptimise (ibc_optimise i) pSyntax (ibc_syntax i) pKeywords (ibc_keywords i) pObjs (ibc_objs i) pLibs (ibc_libs i) pCGFlags (ibc_cgflags i) pDyLibs (ibc_dynamic_libs i) pHdrs (ibc_hdrs i) pDefs (symbols i) (ibc_defs i) pAccess (ibc_access i) pTotal (ibc_total i) pCG (ibc_cg i) pDocs (ibc_docstrings i) pCoercions (ibc_coercions i) pTrans (ibc_transforms i) pErrRev (ibc_errRev i) pLineApps (ibc_lineapps i) pNameHints (ibc_namehints i) pMetaInformation (ibc_metainformation i) pErrorHandlers (ibc_errorhandlers i) pFunctionErrorHandlers (ibc_function_errorhandlers i)
1,644
false
true
1
12
703
479
203
276
null
null
zeyuanxy/haskell-playground
ninety-nine-haskell-problems/vol7/70.hs
mit
pEmpty = do char '.' return Empty
41
pEmpty = do char '.' return Empty
41
pEmpty = do char '.' return Empty
41
false
false
0
7
14
18
7
11
null
null
blancas/trex
src/Util.hs
mit
-- | Tells if s encodes a boolean. isBool :: LB.ByteString -> Bool isBool = runRegex boolRegex . lower where lower = fromText . LT.toLower . toText -- | Tells if s encodes a date.
184
isBool :: LB.ByteString -> Bool isBool = runRegex boolRegex . lower where lower = fromText . LT.toLower . toText -- | Tells if s encodes a date.
149
isBool = runRegex boolRegex . lower where lower = fromText . LT.toLower . toText -- | Tells if s encodes a date.
117
true
true
1
7
39
54
24
30
null
null
brownplt/ovid
src/Test/Environment.hs
bsd-2-clause
main = do run e1 run e2 --run e15
39
main = do run e1 run e2 --run e15
39
main = do run e1 run e2 --run e15
39
false
false
0
7
14
19
8
11
null
null
valderman/dpress
server.hs
mit
version = "0.02"
16
version = "0.02"
16
version = "0.02"
16
false
false
0
4
2
6
3
3
null
null
urbanslug/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
mkStringLitLabel :: Unique -> CLabel mkStringLitLabel = StringLitLabel
85
mkStringLitLabel :: Unique -> CLabel mkStringLitLabel = StringLitLabel
85
mkStringLitLabel = StringLitLabel
48
false
true
0
5
22
15
8
7
null
null
vladimir-ipatov/ganeti
src/Ganeti/Constants.hs
gpl-2.0
htCacheNone :: String htCacheNone = "none"
42
htCacheNone :: String htCacheNone = "none"
42
htCacheNone = "none"
20
false
true
0
6
5
18
7
11
null
null
olsner/ghc
compiler/prelude/THNames.hs
bsd-3-clause
funDepTyConKey = mkPreludeTyConUnique 222
50
funDepTyConKey = mkPreludeTyConUnique 222
50
funDepTyConKey = mkPreludeTyConUnique 222
50
false
false
0
5
12
9
4
5
null
null
esengie/fpl-exploration-tool
src/specLang/AST/Term.hs
bsd-3-clause
identicalMV :: MetaVar -> MetaVar -> Bool identicalMV (MetaVar ct1 vn1) (MetaVar ct2 vn2) = (sort ct1) == (sort ct2) && vn1 == vn2
130
identicalMV :: MetaVar -> MetaVar -> Bool identicalMV (MetaVar ct1 vn1) (MetaVar ct2 vn2) = (sort ct1) == (sort ct2) && vn1 == vn2
130
identicalMV (MetaVar ct1 vn1) (MetaVar ct2 vn2) = (sort ct1) == (sort ct2) && vn1 == vn2
88
false
true
0
9
23
64
32
32
null
null
rrnewton/accelerate
Data/Array/Accelerate/Trafo/Algebra.hs
bsd-3-clause
evalLNot x env = eval1 not x env
59
evalLNot x env = eval1 not x env
59
evalLNot x env = eval1 not x env
59
false
false
0
5
34
19
8
11
null
null
mydaum/cabal
cabal-install/Distribution/Solver/Modular/Dependency.hs
bsd-3-clause
showDep (Ext ext) = "requires " ++ display ext
48
showDep (Ext ext) = "requires " ++ display ext
48
showDep (Ext ext) = "requires " ++ display ext
48
false
false
0
7
10
22
10
12
null
null
mapinguari/SC_HS_Proxy
src/Proxy/Query/Unit.hs
mit
groundMaxRange ProtossZealot = 15
33
groundMaxRange ProtossZealot = 15
33
groundMaxRange ProtossZealot = 15
33
false
false
0
5
3
9
4
5
null
null
matonix/pfds
src/PFDS/Sec9/Ex4.hs
bsd-3-clause
add :: Nat -> Nat -> Nat add ds [] = ds
39
add :: Nat -> Nat -> Nat add ds [] = ds
39
add ds [] = ds
14
false
true
0
9
11
32
14
18
null
null
Zigazou/HaMinitel
src/Minitel/Minitel.hs
gpl-3.0
-- | Translates bit rate to SerialPort types spBitRate :: Int -> CommSpeed spBitRate 300 = CS300
97
spBitRate :: Int -> CommSpeed spBitRate 300 = CS300
52
spBitRate 300 = CS300
22
true
true
0
5
17
19
10
9
null
null
juhp/network-uri
Network/URI.hs
bsd-3-clause
-- Helper function for turning a string into a URI -- parseURIAny :: URIParser URI -> String -> Maybe URI parseURIAny parser uristr = case parseAll parser "" uristr of Left _ -> Nothing Right u -> Just u -- Helper function to test a string match to a parser --
280
parseURIAny :: URIParser URI -> String -> Maybe URI parseURIAny parser uristr = case parseAll parser "" uristr of Left _ -> Nothing Right u -> Just u -- Helper function to test a string match to a parser --
225
parseURIAny parser uristr = case parseAll parser "" uristr of Left _ -> Nothing Right u -> Just u -- Helper function to test a string match to a parser --
173
true
true
0
8
70
66
32
34
null
null
brendanhay/gogol
gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs
mpl-2.0
-- | The API version of endpoint, e.g. \"v1b3\" trsDataflowAPIVersion :: Lens' TaskRunnerSettings (Maybe Text) trsDataflowAPIVersion = lens _trsDataflowAPIVersion (\ s a -> s{_trsDataflowAPIVersion = a})
211
trsDataflowAPIVersion :: Lens' TaskRunnerSettings (Maybe Text) trsDataflowAPIVersion = lens _trsDataflowAPIVersion (\ s a -> s{_trsDataflowAPIVersion = a})
163
trsDataflowAPIVersion = lens _trsDataflowAPIVersion (\ s a -> s{_trsDataflowAPIVersion = a})
100
true
true
0
9
33
48
25
23
null
null
ahushh/Monaba
monaba/src/Foundation.hs
mit
timesRus :: Int -> String timesRus n | n `elem` [11..14] = "раз" | lastN `elem` [2,3,4] = "раза" | otherwise = "раз" where lastN = (head $ ((++)[0]) $ map (`mod`10) $ takeWhile (>0) $ iterate (`div`10) n)
231
timesRus :: Int -> String timesRus n | n `elem` [11..14] = "раз" | lastN `elem` [2,3,4] = "раза" | otherwise = "раз" where lastN = (head $ ((++)[0]) $ map (`mod`10) $ takeWhile (>0) $ iterate (`div`10) n)
231
timesRus n | n `elem` [11..14] = "раз" | lastN `elem` [2,3,4] = "раза" | otherwise = "раз" where lastN = (head $ ((++)[0]) $ map (`mod`10) $ takeWhile (>0) $ iterate (`div`10) n)
205
false
true
2
13
65
132
74
58
null
null
ggreif/clash-compiler
clash-lib/src/CLaSH/Rewrite/Combinators.hs
bsd-2-clause
-- | Apply a transformation on the subtrees of an term allR :: forall m . (Functor m, Monad m, Fresh m) => Bool -- ^ Freshen variable references in abstracted terms -> Transform m -- ^ The transformation to apply to the subtrees -> Transform m allR _ _ _ (Var t x) = return (Var t x)
300
allR :: forall m . (Functor m, Monad m, Fresh m) => Bool -- ^ Freshen variable references in abstracted terms -> Transform m -- ^ The transformation to apply to the subtrees -> Transform m allR _ _ _ (Var t x) = return (Var t x)
245
allR _ _ _ (Var t x) = return (Var t x)
41
true
true
0
12
75
86
43
43
null
null
green-haskell/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
rep1TyConKey = mkPreludeTyConUnique 156
39
rep1TyConKey = mkPreludeTyConUnique 156
39
rep1TyConKey = mkPreludeTyConUnique 156
39
false
false
0
5
3
9
4
5
null
null
ku00/h-book
src/MonoidPractice.hs
bsd-3-clause
lengthCompare :: String -> String -> Ordering lengthCompare x y = let a = length x `compare` length y b = x `compare` y in if a == EQ then b else a
191
lengthCompare :: String -> String -> Ordering lengthCompare x y = let a = length x `compare` length y b = x `compare` y in if a == EQ then b else a
191
lengthCompare x y = let a = length x `compare` length y b = x `compare` y in if a == EQ then b else a
145
false
true
0
10
76
70
37
33
null
null
kowey/GenI
geni-gui/src/NLP/GenI/Gui.hs
gpl-2.0
-- | Note the following point about pessimisations: An pessimisation -- disables a default behaviour which is assumed to be "optimisation". But of -- course we don't want to confuse the GUI user, so we confuse the programmer -- instead: Given an pessimisation DisableFoo, we have a check box UseFoo. If -- UseFoo is checked, we remove DisableFoo from the list; if it is unchecked, we -- add it to the list. This is the opposite of the default behaviour, but the -- result, I hope, is intuitive for the user. optCheckBox :: Window a -> ProgStateRef -> OptBio -> IO (CheckBox ()) optCheckBox f pstRef od = do pst <- readIORef pstRef chk <- checkBox f [ checked := flippy (hasOpt o (flags pst)) , text := odShortTxt od , tooltip := odToolTip od ] set chk [ on command := onCheck chk ] return chk where o = odOpt od flippy = case odType od of Opti -> id Pessi -> not onCheck chk = do isChecked <- get chk checked pst <- readIORef pstRef let modopt = if flippy isChecked then (o:) else delete o newopts = nub . modopt $ getListFlag OptimisationsFlg pst modifyIORef pstRef . modifyParams $ setFlag OptimisationsFlg newopts -- -------------------------------------------------------------------- -- Loading files -- -------------------------------------------------------------------- -- | Load the given test suite and update the GUI accordingly. -- This is used when you first start the graphical interface -- or when you run the configuration menu.
1,646
optCheckBox :: Window a -> ProgStateRef -> OptBio -> IO (CheckBox ()) optCheckBox f pstRef od = do pst <- readIORef pstRef chk <- checkBox f [ checked := flippy (hasOpt o (flags pst)) , text := odShortTxt od , tooltip := odToolTip od ] set chk [ on command := onCheck chk ] return chk where o = odOpt od flippy = case odType od of Opti -> id Pessi -> not onCheck chk = do isChecked <- get chk checked pst <- readIORef pstRef let modopt = if flippy isChecked then (o:) else delete o newopts = nub . modopt $ getListFlag OptimisationsFlg pst modifyIORef pstRef . modifyParams $ setFlag OptimisationsFlg newopts -- -------------------------------------------------------------------- -- Loading files -- -------------------------------------------------------------------- -- | Load the given test suite and update the GUI accordingly. -- This is used when you first start the graphical interface -- or when you run the configuration menu.
1,123
optCheckBox f pstRef od = do pst <- readIORef pstRef chk <- checkBox f [ checked := flippy (hasOpt o (flags pst)) , text := odShortTxt od , tooltip := odToolTip od ] set chk [ on command := onCheck chk ] return chk where o = odOpt od flippy = case odType od of Opti -> id Pessi -> not onCheck chk = do isChecked <- get chk checked pst <- readIORef pstRef let modopt = if flippy isChecked then (o:) else delete o newopts = nub . modopt $ getListFlag OptimisationsFlg pst modifyIORef pstRef . modifyParams $ setFlag OptimisationsFlg newopts -- -------------------------------------------------------------------- -- Loading files -- -------------------------------------------------------------------- -- | Load the given test suite and update the GUI accordingly. -- This is used when you first start the graphical interface -- or when you run the configuration menu.
1,053
true
true
0
15
444
279
137
142
null
null
edgarklerks/dotfiles
.xmonad/TopicMachine.hs
bsd-2-clause
handleOpcode Swp ms = handleStackOp 2 ms (\(x:y:xs) -> (y:x:xs))
64
handleOpcode Swp ms = handleStackOp 2 ms (\(x:y:xs) -> (y:x:xs))
64
handleOpcode Swp ms = handleStackOp 2 ms (\(x:y:xs) -> (y:x:xs))
64
false
false
1
10
9
54
25
29
null
null
olsner/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
pprInstr (IMUL2 fmt op) = pprFormatOp (sLit "imul") fmt op
59
pprInstr (IMUL2 fmt op) = pprFormatOp (sLit "imul") fmt op
59
pprInstr (IMUL2 fmt op) = pprFormatOp (sLit "imul") fmt op
59
false
false
0
7
10
30
14
16
null
null
nimiwio/WriteYouAScheme
app/Main.hs
bsd-3-clause
showNum :: LispNumber -> String showNum (LComplex c) = show (realPart c) ++ "+" ++ show (imagPart c) ++ "i"
118
showNum :: LispNumber -> String showNum (LComplex c) = show (realPart c) ++ "+" ++ show (imagPart c) ++ "i"
118
showNum (LComplex c) = show (realPart c) ++ "+" ++ show (imagPart c) ++ "i"
86
false
true
0
10
30
54
26
28
null
null
cocreature/leksah
src/IDE/Utils/GUIUtils.hs
gpl-2.0
getFullScreenState :: PaneMonad alpha => alpha Bool getFullScreenState = do ui <- getUIAction "ui/menubar/_View/_Full Screen" castToToggleAction liftIO $toggleActionGetActive ui
185
getFullScreenState :: PaneMonad alpha => alpha Bool getFullScreenState = do ui <- getUIAction "ui/menubar/_View/_Full Screen" castToToggleAction liftIO $toggleActionGetActive ui
185
getFullScreenState = do ui <- getUIAction "ui/menubar/_View/_Full Screen" castToToggleAction liftIO $toggleActionGetActive ui
133
false
true
0
8
26
42
18
24
null
null
christiaanb/fpprac
src/FPPrac/Events.hs
bsd-3-clause
eventToInput (EventKey (SpecialKey KeyEnter) Down _ _) = KeyIn '\n'
72
eventToInput (EventKey (SpecialKey KeyEnter) Down _ _) = KeyIn '\n'
72
eventToInput (EventKey (SpecialKey KeyEnter) Down _ _) = KeyIn '\n'
72
false
false
0
9
14
30
14
16
null
null
xnning/fcore
lib/Inliner.hs
bsd-2-clause
recurNum (Fix _ _ f _ _) = recurNum $ f 1 0
43
recurNum (Fix _ _ f _ _) = recurNum $ f 1 0
43
recurNum (Fix _ _ f _ _) = recurNum $ f 1 0
43
false
false
0
7
12
32
15
17
null
null
np/ling
Ling/Raw.hs
bsd-3-clause
pDot :: Op2 Proc pDot (PPrll []) proc1 = proc1
57
pDot :: Op2 Proc pDot (PPrll []) proc1 = proc1
57
pDot (PPrll []) proc1 = proc1
40
false
true
1
7
20
32
13
19
null
null
andorp/bead
src/Bead/Controller/Pages.hs
bsd-3-clause
isNewGroupAssignmentPreview (UserView (NewGroupAssignmentPreview _ _)) = True
77
isNewGroupAssignmentPreview (UserView (NewGroupAssignmentPreview _ _)) = True
77
isNewGroupAssignmentPreview (UserView (NewGroupAssignmentPreview _ _)) = True
77
false
false
0
9
6
23
11
12
null
null
charlesrosenbauer/Bzo-Compiler
src/Builtins.hs
gpl-3.0
isBuiltinFunc "#adjustMap" = 80003
37
isBuiltinFunc "#adjustMap" = 80003
37
isBuiltinFunc "#adjustMap" = 80003
37
false
false
0
5
6
9
4
5
null
null
rahulmutt/ghcvm
compiler/Eta/CodeGen/Env.hs
bsd-3-clause
rhsIdInfo :: Id -> LambdaFormInfo -> CodeGen (CgIdInfo, CgLoc) rhsIdInfo id lfInfo = do dflags <- getDynFlags modClass <- getModClass let qualifiedClass = qualifiedName modClass (idNameText dflags id) rhsGenIdInfo id lfInfo (obj qualifiedClass) -- TODO: getJavaInfo generalize to unify rhsIdInfo and rhsConIdInfo
321
rhsIdInfo :: Id -> LambdaFormInfo -> CodeGen (CgIdInfo, CgLoc) rhsIdInfo id lfInfo = do dflags <- getDynFlags modClass <- getModClass let qualifiedClass = qualifiedName modClass (idNameText dflags id) rhsGenIdInfo id lfInfo (obj qualifiedClass) -- TODO: getJavaInfo generalize to unify rhsIdInfo and rhsConIdInfo
321
rhsIdInfo id lfInfo = do dflags <- getDynFlags modClass <- getModClass let qualifiedClass = qualifiedName modClass (idNameText dflags id) rhsGenIdInfo id lfInfo (obj qualifiedClass) -- TODO: getJavaInfo generalize to unify rhsIdInfo and rhsConIdInfo
258
false
true
0
12
50
86
41
45
null
null
binesiyu/ifl
examples/ch11/Prettify2.hs
mit
{-- /snippet line --} {-- snippet hcat --} hcat :: [Doc] -> Doc hcat = fold (<>)
81
hcat :: [Doc] -> Doc hcat = fold (<>)
37
hcat = fold (<>)
16
true
true
0
6
17
25
15
10
null
null
GaloisInc/stack
src/Stack/Options.hs
bsd-3-clause
-- | Parser for build arguments. buildOptsParser :: Command -> Parser BuildOpts buildOptsParser cmd = BuildOpts <$> target <*> libProfiling <*> exeProfiling <*> optimize <*> haddock <*> haddockDeps <*> finalAction <*> dryRun <*> ghcOpts <*> flags <*> installExes <*> preFetch <*> onlySnapshot <*> fileWatch' <*> keepGoing where optimize = maybeBoolFlags "optimizations" "optimizations for TARGETs and all its dependencies" idm target = fmap (map T.pack) (many (strArgument (metavar "TARGET" <> help "If none specified, use all packages defined in current directory"))) libProfiling = boolFlags False "library-profiling" "library profiling for TARGETs and all its dependencies" idm exeProfiling = boolFlags False "executable-profiling" "library profiling for TARGETs and all its dependencies" idm haddock = boolFlags (cmd == Haddock) "haddock" "building Haddocks" idm haddockDeps = if cmd == Haddock then maybeBoolFlags "haddock-deps" "building Haddocks for dependencies" idm else pure Nothing finalAction = pure DoNothing installExes = pure False dryRun = flag False True (long "dry-run" <> help "Don't build anything, just prepare to") ghcOpts = (++) <$> flag [] ["-Wall", "-Werror"] ( long "pedantic" <> help "Turn on -Wall and -Werror (note: option name may change in the future" ) <*> many (fmap T.pack (strOption (long "ghc-options" <> metavar "OPTION" <> help "Additional options passed to GHC"))) flags = fmap (Map.unionsWith Map.union) $ many (option readFlag ( long "flag" <> metavar "PACKAGE:[-]FLAG" <> help "Override flags set in stack.yaml (applies to local packages and extra-deps)" )) preFetch = flag False True (long "prefetch" <> help "Fetch packages necessary for the build immediately, useful with --dry-run") onlySnapshot = flag False True (long "only-snapshot" <> help "Only build packages for the snapshot database, not the local database") fileWatch' = flag False True (long "file-watch" <> help "Watch for changes in local files and automatically rebuild") keepGoing = maybeBoolFlags "keep-going" "continue running after a step fails (default: false for build, true for test/bench)" idm -- | Parser for package:[-]flag
3,103
buildOptsParser :: Command -> Parser BuildOpts buildOptsParser cmd = BuildOpts <$> target <*> libProfiling <*> exeProfiling <*> optimize <*> haddock <*> haddockDeps <*> finalAction <*> dryRun <*> ghcOpts <*> flags <*> installExes <*> preFetch <*> onlySnapshot <*> fileWatch' <*> keepGoing where optimize = maybeBoolFlags "optimizations" "optimizations for TARGETs and all its dependencies" idm target = fmap (map T.pack) (many (strArgument (metavar "TARGET" <> help "If none specified, use all packages defined in current directory"))) libProfiling = boolFlags False "library-profiling" "library profiling for TARGETs and all its dependencies" idm exeProfiling = boolFlags False "executable-profiling" "library profiling for TARGETs and all its dependencies" idm haddock = boolFlags (cmd == Haddock) "haddock" "building Haddocks" idm haddockDeps = if cmd == Haddock then maybeBoolFlags "haddock-deps" "building Haddocks for dependencies" idm else pure Nothing finalAction = pure DoNothing installExes = pure False dryRun = flag False True (long "dry-run" <> help "Don't build anything, just prepare to") ghcOpts = (++) <$> flag [] ["-Wall", "-Werror"] ( long "pedantic" <> help "Turn on -Wall and -Werror (note: option name may change in the future" ) <*> many (fmap T.pack (strOption (long "ghc-options" <> metavar "OPTION" <> help "Additional options passed to GHC"))) flags = fmap (Map.unionsWith Map.union) $ many (option readFlag ( long "flag" <> metavar "PACKAGE:[-]FLAG" <> help "Override flags set in stack.yaml (applies to local packages and extra-deps)" )) preFetch = flag False True (long "prefetch" <> help "Fetch packages necessary for the build immediately, useful with --dry-run") onlySnapshot = flag False True (long "only-snapshot" <> help "Only build packages for the snapshot database, not the local database") fileWatch' = flag False True (long "file-watch" <> help "Watch for changes in local files and automatically rebuild") keepGoing = maybeBoolFlags "keep-going" "continue running after a step fails (default: false for build, true for test/bench)" idm -- | Parser for package:[-]flag
3,070
buildOptsParser cmd = BuildOpts <$> target <*> libProfiling <*> exeProfiling <*> optimize <*> haddock <*> haddockDeps <*> finalAction <*> dryRun <*> ghcOpts <*> flags <*> installExes <*> preFetch <*> onlySnapshot <*> fileWatch' <*> keepGoing where optimize = maybeBoolFlags "optimizations" "optimizations for TARGETs and all its dependencies" idm target = fmap (map T.pack) (many (strArgument (metavar "TARGET" <> help "If none specified, use all packages defined in current directory"))) libProfiling = boolFlags False "library-profiling" "library profiling for TARGETs and all its dependencies" idm exeProfiling = boolFlags False "executable-profiling" "library profiling for TARGETs and all its dependencies" idm haddock = boolFlags (cmd == Haddock) "haddock" "building Haddocks" idm haddockDeps = if cmd == Haddock then maybeBoolFlags "haddock-deps" "building Haddocks for dependencies" idm else pure Nothing finalAction = pure DoNothing installExes = pure False dryRun = flag False True (long "dry-run" <> help "Don't build anything, just prepare to") ghcOpts = (++) <$> flag [] ["-Wall", "-Werror"] ( long "pedantic" <> help "Turn on -Wall and -Werror (note: option name may change in the future" ) <*> many (fmap T.pack (strOption (long "ghc-options" <> metavar "OPTION" <> help "Additional options passed to GHC"))) flags = fmap (Map.unionsWith Map.union) $ many (option readFlag ( long "flag" <> metavar "PACKAGE:[-]FLAG" <> help "Override flags set in stack.yaml (applies to local packages and extra-deps)" )) preFetch = flag False True (long "prefetch" <> help "Fetch packages necessary for the build immediately, useful with --dry-run") onlySnapshot = flag False True (long "only-snapshot" <> help "Only build packages for the snapshot database, not the local database") fileWatch' = flag False True (long "file-watch" <> help "Watch for changes in local files and automatically rebuild") keepGoing = maybeBoolFlags "keep-going" "continue running after a step fails (default: false for build, true for test/bench)" idm -- | Parser for package:[-]flag
3,023
true
true
14
19
1,271
482
237
245
null
null
ublubu/euler
H1/H1.hs
mit
main :: IO () main = do print $ last' "asdf" print $ lastbutone "asdf" print $ nth 1 "asdf" print $ len' "asdf" print $ rev "asdf" print $ isPal "asdfdsa"
166
main :: IO () main = do print $ last' "asdf" print $ lastbutone "asdf" print $ nth 1 "asdf" print $ len' "asdf" print $ rev "asdf" print $ isPal "asdfdsa"
166
main = do print $ last' "asdf" print $ lastbutone "asdf" print $ nth 1 "asdf" print $ len' "asdf" print $ rev "asdf" print $ isPal "asdfdsa"
152
false
true
0
9
43
84
34
50
null
null
nomeata/nt-coerce
test.hs
bsd-3-clause
fNT :: NT a a' -> NT (F a b c) (F a' b c) fNT = deriveThisNT
60
fNT :: NT a a' -> NT (F a b c) (F a' b c) fNT = deriveThisNT
60
fNT = deriveThisNT
18
false
true
0
9
17
51
23
28
null
null
jonaprieto/online-atps
src/OnlineATPs/Consult.hs
mit
etResponseSystemOnTPTP ∷ SystemOnTPTP → IO L.ByteString getResponseSystemOnTPTP spec = withSocketsDo $ do initReq ← parseRequest urlSystemOnTPTPReply let dataForm ∷ [(String, String)] dataForm = getDataSystemOnTPTP spec let form = map (packChars *** packChars) dataForm let request = urlEncodedBody form initReq manager ← newManager defaultManagerSettings res ← httpLbs request manager liftIO $ do let response = responseBody res return response -- | The function 'getSystemOnTPTP' reads the options given by the user -- including the problem file and return a SystemOnTPTP data type -- with all settings.
637
getResponseSystemOnTPTP ∷ SystemOnTPTP → IO L.ByteString getResponseSystemOnTPTP spec = withSocketsDo $ do initReq ← parseRequest urlSystemOnTPTPReply let dataForm ∷ [(String, String)] dataForm = getDataSystemOnTPTP spec let form = map (packChars *** packChars) dataForm let request = urlEncodedBody form initReq manager ← newManager defaultManagerSettings res ← httpLbs request manager liftIO $ do let response = responseBody res return response -- | The function 'getSystemOnTPTP' reads the options given by the user -- including the problem file and return a SystemOnTPTP data type -- with all settings.
637
getResponseSystemOnTPTP spec = withSocketsDo $ do initReq ← parseRequest urlSystemOnTPTPReply let dataForm ∷ [(String, String)] dataForm = getDataSystemOnTPTP spec let form = map (packChars *** packChars) dataForm let request = urlEncodedBody form initReq manager ← newManager defaultManagerSettings res ← httpLbs request manager liftIO $ do let response = responseBody res return response -- | The function 'getSystemOnTPTP' reads the options given by the user -- including the problem file and return a SystemOnTPTP data type -- with all settings.
580
false
true
0
14
116
148
69
79
null
null
alexander-at-github/eta
compiler/ETA/BasicTypes/OccName.hs
bsd-3-clause
isVarNameSpace VarName = True
29
isVarNameSpace VarName = True
29
isVarNameSpace VarName = True
29
false
false
1
5
3
13
4
9
null
null
ganeti-github-testing/ganeti-test-1
src/Ganeti/WConfd/TempRes.hs
bsd-2-clause
-- ** Utility functions -- | Issues a reservation error. resError :: (MonadError GanetiException m) => String -> m a resError = throwError . ReservationError
158
resError :: (MonadError GanetiException m) => String -> m a resError = throwError . ReservationError
100
resError = throwError . ReservationError
40
true
true
0
8
25
41
20
21
null
null
aslatter/xhb
Graphics/XHB/Connection.hs
bsd-3-clause
resourceIdsFromSetup :: Setup -> [Xid] resourceIdsFromSetup s = let base = resource_id_base_Setup s mask = resource_id_mask_Setup s max = mask step = mask .&. (-mask) in map MkXid $ map (.|. base) [0,step .. max]
244
resourceIdsFromSetup :: Setup -> [Xid] resourceIdsFromSetup s = let base = resource_id_base_Setup s mask = resource_id_mask_Setup s max = mask step = mask .&. (-mask) in map MkXid $ map (.|. base) [0,step .. max]
244
resourceIdsFromSetup s = let base = resource_id_base_Setup s mask = resource_id_mask_Setup s max = mask step = mask .&. (-mask) in map MkXid $ map (.|. base) [0,step .. max]
205
false
true
0
11
66
87
46
41
null
null
kajigor/uKanren_transformations
app/console/ConsPDApp.hs
bsd-3-clause
runRep = do runJu 100 "rep" rep where rep = Program Program.Programs.rep $ fresh ["n", "x"] (call "rep" [V "n", V "x"])
129
runRep = do runJu 100 "rep" rep where rep = Program Program.Programs.rep $ fresh ["n", "x"] (call "rep" [V "n", V "x"])
129
runRep = do runJu 100 "rep" rep where rep = Program Program.Programs.rep $ fresh ["n", "x"] (call "rep" [V "n", V "x"])
129
false
false
2
10
31
71
32
39
null
null
kishoredbn/barrelfish
tools/mackerel/Checks.hs
mit
make_dup_type_error :: Dev.Rec -> TN.Name -> MacError make_dup_type_error d n = let cl = [ (TT.pos c, TT.tt_desc c) | c <- (Dev.types d), (TT.tt_name c) == n ] l = sort cl (p, _) = head l in (MacError p (printf "Type name '%s' is multiply defined, as:%s" (TN.toString n) (concat [ (printf "\n '%s' (%s)" td (show tp))::String | (tp, td) <- l ])))
399
make_dup_type_error :: Dev.Rec -> TN.Name -> MacError make_dup_type_error d n = let cl = [ (TT.pos c, TT.tt_desc c) | c <- (Dev.types d), (TT.tt_name c) == n ] l = sort cl (p, _) = head l in (MacError p (printf "Type name '%s' is multiply defined, as:%s" (TN.toString n) (concat [ (printf "\n '%s' (%s)" td (show tp))::String | (tp, td) <- l ])))
399
make_dup_type_error d n = let cl = [ (TT.pos c, TT.tt_desc c) | c <- (Dev.types d), (TT.tt_name c) == n ] l = sort cl (p, _) = head l in (MacError p (printf "Type name '%s' is multiply defined, as:%s" (TN.toString n) (concat [ (printf "\n '%s' (%s)" td (show tp))::String | (tp, td) <- l ])))
345
false
true
0
17
118
181
93
88
null
null
vladimir-ipatov/ganeti
src/Ganeti/Runtime.hs
gpl-2.0
getEnts :: IO (Result RuntimeEnts) getEnts = do users <- mapM (\daemon -> do entry <- ignoreDoesNotExistErrors . getUserEntryForName . daemonUser $ daemon return (entry >>= \e -> return (daemon, userID e)) ) [minBound..maxBound] groups <- mapM (\group -> do entry <- ignoreDoesNotExistErrors . getGroupEntryForName . daemonGroup $ group return (entry >>= \e -> return (group, groupID e)) ) allGroups return $ do -- 'Result' monad users' <- sequence users groups' <- sequence groups let usermap = M.fromList users' groupmap = M.fromList groups' return (usermap, groupmap) -- | Checks whether a daemon runs as the right user.
881
getEnts :: IO (Result RuntimeEnts) getEnts = do users <- mapM (\daemon -> do entry <- ignoreDoesNotExistErrors . getUserEntryForName . daemonUser $ daemon return (entry >>= \e -> return (daemon, userID e)) ) [minBound..maxBound] groups <- mapM (\group -> do entry <- ignoreDoesNotExistErrors . getGroupEntryForName . daemonGroup $ group return (entry >>= \e -> return (group, groupID e)) ) allGroups return $ do -- 'Result' monad users' <- sequence users groups' <- sequence groups let usermap = M.fromList users' groupmap = M.fromList groups' return (usermap, groupmap) -- | Checks whether a daemon runs as the right user.
881
getEnts = do users <- mapM (\daemon -> do entry <- ignoreDoesNotExistErrors . getUserEntryForName . daemonUser $ daemon return (entry >>= \e -> return (daemon, userID e)) ) [minBound..maxBound] groups <- mapM (\group -> do entry <- ignoreDoesNotExistErrors . getGroupEntryForName . daemonGroup $ group return (entry >>= \e -> return (group, groupID e)) ) allGroups return $ do -- 'Result' monad users' <- sequence users groups' <- sequence groups let usermap = M.fromList users' groupmap = M.fromList groups' return (usermap, groupmap) -- | Checks whether a daemon runs as the right user.
846
false
true
1
20
354
230
111
119
null
null
McCraeAndrew/cpi-ide
CPi/Signals.hs
gpl-3.0
test26 = conjSig tSigH tShift2L == tHConjFL
43
test26 = conjSig tSigH tShift2L == tHConjFL
43
test26 = conjSig tSigH tShift2L == tHConjFL
43
false
false
0
6
6
15
7
8
null
null
Gabriel439/Haskell-Pipes-Library
src/Pipes/Prelude.hs
bsd-3-clause
-- | Zip two 'Producer's using the provided combining function zipWith :: Monad m => (a -> b -> c) -> (Producer a m r) -> (Producer b m r) -> (Proxy x' x () c m r) zipWith f = go where go p1 p2 = do e1 <- lift $ next p1 case e1 of Left r -> return r Right (a, p1') -> do e2 <- lift $ next p2 case e2 of Left r -> return r Right (b, p2') -> do yield (f a b) go p1' p2'
568
zipWith :: Monad m => (a -> b -> c) -> (Producer a m r) -> (Producer b m r) -> (Proxy x' x () c m r) zipWith f = go where go p1 p2 = do e1 <- lift $ next p1 case e1 of Left r -> return r Right (a, p1') -> do e2 <- lift $ next p2 case e2 of Left r -> return r Right (b, p2') -> do yield (f a b) go p1' p2'
505
zipWith f = go where go p1 p2 = do e1 <- lift $ next p1 case e1 of Left r -> return r Right (a, p1') -> do e2 <- lift $ next p2 case e2 of Left r -> return r Right (b, p2') -> do yield (f a b) go p1' p2'
386
true
true
0
19
293
216
101
115
null
null
PaulGustafson/stringnet
Main.hs
mit
main :: IO () -- main = print $ finalMorphism -- main = print $ substM finalMorphism -- main = print $ toTree finalMorphism -- main = print $ substM $ leaves !! 0 main = putStrLn $ latex $ rmatrix
196
main :: IO () main = putStrLn $ latex $ rmatrix
47
main = putStrLn $ latex $ rmatrix
33
true
true
0
6
40
28
16
12
null
null
ghc-android/ghc
compiler/deSugar/Coverage.hs
bsd-3-clause
mkTickish :: BoxLabel -> Bool -> Bool -> SrcSpan -> OccEnv Id -> [String] -> TM (Tickish Id) mkTickish boxLabel countEntries topOnly pos fvs decl_path = do let ids = filter (not . isUnLiftedType . idType) $ occEnvElts fvs -- unlifted types cause two problems here: -- * we can't bind them at the GHCi prompt -- (bindLocalsAtBreakpoint already fliters them out), -- * the simplifier might try to substitute a literal for -- the Id, and we can't handle that. me = (pos, decl_path, map (nameOccName.idName) ids, boxLabel) cc_name | topOnly = head decl_path | otherwise = concat (intersperse "." decl_path) dflags <- getDynFlags env <- getEnv case tickishType env of HpcTicks -> do c <- liftM tickBoxCount getState setState $ \st -> st { tickBoxCount = c + 1 , mixEntries = me : mixEntries st } return $ HpcTick (this_mod env) c ProfNotes -> do ccUnique <- getUniqueM let cc = mkUserCC (mkFastString cc_name) (this_mod env) pos ccUnique count = countEntries && gopt Opt_ProfCountEntries dflags return $ ProfNote cc count True{-scopes-} Breakpoints -> do c <- liftM breakCount getState setState $ \st -> st { breakCount = c + 1 , breaks = me:breaks st } return $ Breakpoint c ids SourceNotes | RealSrcSpan pos' <- pos -> return $ SourceNote pos' cc_name _otherwise -> panic "mkTickish: bad source span!"
1,559
mkTickish :: BoxLabel -> Bool -> Bool -> SrcSpan -> OccEnv Id -> [String] -> TM (Tickish Id) mkTickish boxLabel countEntries topOnly pos fvs decl_path = do let ids = filter (not . isUnLiftedType . idType) $ occEnvElts fvs -- unlifted types cause two problems here: -- * we can't bind them at the GHCi prompt -- (bindLocalsAtBreakpoint already fliters them out), -- * the simplifier might try to substitute a literal for -- the Id, and we can't handle that. me = (pos, decl_path, map (nameOccName.idName) ids, boxLabel) cc_name | topOnly = head decl_path | otherwise = concat (intersperse "." decl_path) dflags <- getDynFlags env <- getEnv case tickishType env of HpcTicks -> do c <- liftM tickBoxCount getState setState $ \st -> st { tickBoxCount = c + 1 , mixEntries = me : mixEntries st } return $ HpcTick (this_mod env) c ProfNotes -> do ccUnique <- getUniqueM let cc = mkUserCC (mkFastString cc_name) (this_mod env) pos ccUnique count = countEntries && gopt Opt_ProfCountEntries dflags return $ ProfNote cc count True{-scopes-} Breakpoints -> do c <- liftM breakCount getState setState $ \st -> st { breakCount = c + 1 , breaks = me:breaks st } return $ Breakpoint c ids SourceNotes | RealSrcSpan pos' <- pos -> return $ SourceNote pos' cc_name _otherwise -> panic "mkTickish: bad source span!"
1,559
mkTickish boxLabel countEntries topOnly pos fvs decl_path = do let ids = filter (not . isUnLiftedType . idType) $ occEnvElts fvs -- unlifted types cause two problems here: -- * we can't bind them at the GHCi prompt -- (bindLocalsAtBreakpoint already fliters them out), -- * the simplifier might try to substitute a literal for -- the Id, and we can't handle that. me = (pos, decl_path, map (nameOccName.idName) ids, boxLabel) cc_name | topOnly = head decl_path | otherwise = concat (intersperse "." decl_path) dflags <- getDynFlags env <- getEnv case tickishType env of HpcTicks -> do c <- liftM tickBoxCount getState setState $ \st -> st { tickBoxCount = c + 1 , mixEntries = me : mixEntries st } return $ HpcTick (this_mod env) c ProfNotes -> do ccUnique <- getUniqueM let cc = mkUserCC (mkFastString cc_name) (this_mod env) pos ccUnique count = countEntries && gopt Opt_ProfCountEntries dflags return $ ProfNote cc count True{-scopes-} Breakpoints -> do c <- liftM breakCount getState setState $ \st -> st { breakCount = c + 1 , breaks = me:breaks st } return $ Breakpoint c ids SourceNotes | RealSrcSpan pos' <- pos -> return $ SourceNote pos' cc_name _otherwise -> panic "mkTickish: bad source span!"
1,456
false
true
6
16
483
409
203
206
null
null
atsukotakahashi/wi
src/library/Yi/IReader.hs
gpl-2.0
insertArticle :: ArticleDB -> Article -> ArticleDB insertArticle (ADB adb) new = ADB (new S.<| adb)
99
insertArticle :: ArticleDB -> Article -> ArticleDB insertArticle (ADB adb) new = ADB (new S.<| adb)
99
insertArticle (ADB adb) new = ADB (new S.<| adb)
48
false
true
0
7
15
46
22
24
null
null
wxwxwwxxx/ghc
testsuite/tests/typecheck/should_compile/tc114.hs
bsd-3-clause
bad:: Num e => Maybe e bad = foo 0
34
bad:: Num e => Maybe e bad = foo 0
34
bad = foo 0
11
false
true
0
6
9
24
11
13
null
null
alexander-at-github/eta
compiler/ETA/Specialise/Rules.hs
bsd-3-clause
rvInScopeEnv :: RuleMatchEnv -> InScopeEnv rvInScopeEnv renv = (rnInScopeSet (rv_lcl renv), rv_unf renv)
104
rvInScopeEnv :: RuleMatchEnv -> InScopeEnv rvInScopeEnv renv = (rnInScopeSet (rv_lcl renv), rv_unf renv)
104
rvInScopeEnv renv = (rnInScopeSet (rv_lcl renv), rv_unf renv)
61
false
true
0
9
12
42
19
23
null
null
fpco/fpco-cereal
tests/GetTests.hs
bsd-3-clause
-- Compare with chunks (==~) :: Eq a => Get a -> Get a -> Property p1 ==~ p2 = conjoin [ counterexample (show in0) $ R (runGetLazy p1 s) == R (runGetLazy p2 s) | n <- [0 .. testLength] , let Chunks in0 = mkChunks n s = LB.fromChunks [ BS.pack c | c <- in0 ] ]
277
(==~) :: Eq a => Get a -> Get a -> Property p1 ==~ p2 = conjoin [ counterexample (show in0) $ R (runGetLazy p1 s) == R (runGetLazy p2 s) | n <- [0 .. testLength] , let Chunks in0 = mkChunks n s = LB.fromChunks [ BS.pack c | c <- in0 ] ]
254
p1 ==~ p2 = conjoin [ counterexample (show in0) $ R (runGetLazy p1 s) == R (runGetLazy p2 s) | n <- [0 .. testLength] , let Chunks in0 = mkChunks n s = LB.fromChunks [ BS.pack c | c <- in0 ] ]
210
true
true
0
13
77
144
69
75
null
null
mbakke/ganeti
src/Ganeti/Storage/Drbd/Parser.hs
bsd-2-clause
-- | The parser for the version information lines. versionInfoParser :: Parser VersionInfo versionInfoParser = do versionF <- optional versionP apiF <- optional apiP protoF <- optional protoP srcVersionF <- optional srcVersion ghF <- fmap unpack <$> optional gh builderF <- fmap unpack <$> optional builder if isNothing versionF && isNothing apiF && isNothing protoF && isNothing srcVersionF && isNothing ghF && isNothing builderF then fail "versionInfo" else pure $ VersionInfo versionF apiF protoF srcVersionF ghF builderF where versionP = A.string "version:" *> skipSpaces *> fmap unpack (A.takeWhile $ not . A.isHorizontalSpace) apiP = skipSpacesAndString "(api:" . fmap unpack $ A.takeWhile (/= '/') protoP = A.string "/proto:" *> fmap Data.Text.unpack (A.takeWhile (/= ')')) <* A.takeTill A.isEndOfLine <* A.endOfLine srcVersion = A.string "srcversion:" *> AC.skipMany1 A.space *> fmap unpack (A.takeTill A.isEndOfLine) <* A.endOfLine gh = A.string "GIT-hash:" *> skipSpaces *> A.takeWhile (not . A.isHorizontalSpace) builder = skipSpacesAndString "build by" $ skipSpaces *> A.takeTill A.isEndOfLine <* A.endOfLine -- | The parser for a (multi-line) string representing a device.
1,507
versionInfoParser :: Parser VersionInfo versionInfoParser = do versionF <- optional versionP apiF <- optional apiP protoF <- optional protoP srcVersionF <- optional srcVersion ghF <- fmap unpack <$> optional gh builderF <- fmap unpack <$> optional builder if isNothing versionF && isNothing apiF && isNothing protoF && isNothing srcVersionF && isNothing ghF && isNothing builderF then fail "versionInfo" else pure $ VersionInfo versionF apiF protoF srcVersionF ghF builderF where versionP = A.string "version:" *> skipSpaces *> fmap unpack (A.takeWhile $ not . A.isHorizontalSpace) apiP = skipSpacesAndString "(api:" . fmap unpack $ A.takeWhile (/= '/') protoP = A.string "/proto:" *> fmap Data.Text.unpack (A.takeWhile (/= ')')) <* A.takeTill A.isEndOfLine <* A.endOfLine srcVersion = A.string "srcversion:" *> AC.skipMany1 A.space *> fmap unpack (A.takeTill A.isEndOfLine) <* A.endOfLine gh = A.string "GIT-hash:" *> skipSpaces *> A.takeWhile (not . A.isHorizontalSpace) builder = skipSpacesAndString "build by" $ skipSpaces *> A.takeTill A.isEndOfLine <* A.endOfLine -- | The parser for a (multi-line) string representing a device.
1,456
versionInfoParser = do versionF <- optional versionP apiF <- optional apiP protoF <- optional protoP srcVersionF <- optional srcVersion ghF <- fmap unpack <$> optional gh builderF <- fmap unpack <$> optional builder if isNothing versionF && isNothing apiF && isNothing protoF && isNothing srcVersionF && isNothing ghF && isNothing builderF then fail "versionInfo" else pure $ VersionInfo versionF apiF protoF srcVersionF ghF builderF where versionP = A.string "version:" *> skipSpaces *> fmap unpack (A.takeWhile $ not . A.isHorizontalSpace) apiP = skipSpacesAndString "(api:" . fmap unpack $ A.takeWhile (/= '/') protoP = A.string "/proto:" *> fmap Data.Text.unpack (A.takeWhile (/= ')')) <* A.takeTill A.isEndOfLine <* A.endOfLine srcVersion = A.string "srcversion:" *> AC.skipMany1 A.space *> fmap unpack (A.takeTill A.isEndOfLine) <* A.endOfLine gh = A.string "GIT-hash:" *> skipSpaces *> A.takeWhile (not . A.isHorizontalSpace) builder = skipSpacesAndString "build by" $ skipSpaces *> A.takeTill A.isEndOfLine <* A.endOfLine -- | The parser for a (multi-line) string representing a device.
1,416
true
true
28
13
487
435
194
241
null
null
brendanhay/gogol
gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Sessions/EntityTypes/Create.hs
mpl-2.0
-- | Creates a value of 'ProjectsLocationsAgentsSessionsEntityTypesCreate' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'plaSetcParent' -- -- * 'plaSetcXgafv' -- -- * 'plaSetcUploadProtocol' -- -- * 'plaSetcAccessToken' -- -- * 'plaSetcUploadType' -- -- * 'plaSetcPayload' -- -- * 'plaSetcCallback' projectsLocationsAgentsSessionsEntityTypesCreate :: Text -- ^ 'plaSetcParent' -> GoogleCloudDialogflowCxV3SessionEntityType -- ^ 'plaSetcPayload' -> ProjectsLocationsAgentsSessionsEntityTypesCreate projectsLocationsAgentsSessionsEntityTypesCreate pPlaSetcParent_ pPlaSetcPayload_ = ProjectsLocationsAgentsSessionsEntityTypesCreate' { _plaSetcParent = pPlaSetcParent_ , _plaSetcXgafv = Nothing , _plaSetcUploadProtocol = Nothing , _plaSetcAccessToken = Nothing , _plaSetcUploadType = Nothing , _plaSetcPayload = pPlaSetcPayload_ , _plaSetcCallback = Nothing }
991
projectsLocationsAgentsSessionsEntityTypesCreate :: Text -- ^ 'plaSetcParent' -> GoogleCloudDialogflowCxV3SessionEntityType -- ^ 'plaSetcPayload' -> ProjectsLocationsAgentsSessionsEntityTypesCreate projectsLocationsAgentsSessionsEntityTypesCreate pPlaSetcParent_ pPlaSetcPayload_ = ProjectsLocationsAgentsSessionsEntityTypesCreate' { _plaSetcParent = pPlaSetcParent_ , _plaSetcXgafv = Nothing , _plaSetcUploadProtocol = Nothing , _plaSetcAccessToken = Nothing , _plaSetcUploadType = Nothing , _plaSetcPayload = pPlaSetcPayload_ , _plaSetcCallback = Nothing }
604
projectsLocationsAgentsSessionsEntityTypesCreate pPlaSetcParent_ pPlaSetcPayload_ = ProjectsLocationsAgentsSessionsEntityTypesCreate' { _plaSetcParent = pPlaSetcParent_ , _plaSetcXgafv = Nothing , _plaSetcUploadProtocol = Nothing , _plaSetcAccessToken = Nothing , _plaSetcUploadType = Nothing , _plaSetcPayload = pPlaSetcPayload_ , _plaSetcCallback = Nothing }
394
true
true
0
8
150
96
62
34
null
null
gridaphobe/ghc
iserv/Main.hs
bsd-3-clause
serv :: Bool -> Pipe -> (forall a .IO a -> IO a) -> IO () serv verbose pipe@Pipe{..} restore = loop where loop = do Msg msg <- readPipe pipe getMessage discardCtrlC when verbose $ putStrLn ("iserv: " ++ show msg) case msg of Shutdown -> return () RunTH st q ty loc -> wrapRunTH $ runTH pipe st q ty loc FinishTH st -> wrapRunTH $ finishTH pipe st _other -> run msg >>= reply reply :: forall a. (Binary a, Show a) => a -> IO () reply r = do when verbose $ putStrLn ("iserv: return: " ++ show r) writePipe pipe (put r) loop wrapRunTH :: forall a. (Binary a, Show a) => IO a -> IO () wrapRunTH io = do r <- try io case r of Left e | Just (GHCiQException _ err) <- fromException e -> do when verbose $ putStrLn "iserv: QFail" writePipe pipe (putMessage (QFail err)) loop | otherwise -> do when verbose $ putStrLn "iserv: QException" str <- showException e writePipe pipe (putMessage (QException str)) loop Right a -> do when verbose $ putStrLn "iserv: QDone" writePipe pipe (putMessage QDone) reply a -- carefully when showing an exception, there might be other exceptions -- lurking inside it. If so, we return the inner exception instead. showException :: SomeException -> IO String showException e0 = do r <- try $ evaluate (force (show (e0::SomeException))) case r of Left e -> showException e Right str -> return str -- throw away any pending ^C exceptions while we're not running -- interpreted code. GHC will also get the ^C, and either ignore it -- (if this is GHCi), or tell us to quit with a Shutdown message. discardCtrlC = do r <- try $ restore $ return () case r of Left UserInterrupt -> return () >> discardCtrlC Left e -> throwIO e _ -> return ()
1,930
serv :: Bool -> Pipe -> (forall a .IO a -> IO a) -> IO () serv verbose pipe@Pipe{..} restore = loop where loop = do Msg msg <- readPipe pipe getMessage discardCtrlC when verbose $ putStrLn ("iserv: " ++ show msg) case msg of Shutdown -> return () RunTH st q ty loc -> wrapRunTH $ runTH pipe st q ty loc FinishTH st -> wrapRunTH $ finishTH pipe st _other -> run msg >>= reply reply :: forall a. (Binary a, Show a) => a -> IO () reply r = do when verbose $ putStrLn ("iserv: return: " ++ show r) writePipe pipe (put r) loop wrapRunTH :: forall a. (Binary a, Show a) => IO a -> IO () wrapRunTH io = do r <- try io case r of Left e | Just (GHCiQException _ err) <- fromException e -> do when verbose $ putStrLn "iserv: QFail" writePipe pipe (putMessage (QFail err)) loop | otherwise -> do when verbose $ putStrLn "iserv: QException" str <- showException e writePipe pipe (putMessage (QException str)) loop Right a -> do when verbose $ putStrLn "iserv: QDone" writePipe pipe (putMessage QDone) reply a -- carefully when showing an exception, there might be other exceptions -- lurking inside it. If so, we return the inner exception instead. showException :: SomeException -> IO String showException e0 = do r <- try $ evaluate (force (show (e0::SomeException))) case r of Left e -> showException e Right str -> return str -- throw away any pending ^C exceptions while we're not running -- interpreted code. GHC will also get the ^C, and either ignore it -- (if this is GHCi), or tell us to quit with a Shutdown message. discardCtrlC = do r <- try $ restore $ return () case r of Left UserInterrupt -> return () >> discardCtrlC Left e -> throwIO e _ -> return ()
1,930
serv verbose pipe@Pipe{..} restore = loop where loop = do Msg msg <- readPipe pipe getMessage discardCtrlC when verbose $ putStrLn ("iserv: " ++ show msg) case msg of Shutdown -> return () RunTH st q ty loc -> wrapRunTH $ runTH pipe st q ty loc FinishTH st -> wrapRunTH $ finishTH pipe st _other -> run msg >>= reply reply :: forall a. (Binary a, Show a) => a -> IO () reply r = do when verbose $ putStrLn ("iserv: return: " ++ show r) writePipe pipe (put r) loop wrapRunTH :: forall a. (Binary a, Show a) => IO a -> IO () wrapRunTH io = do r <- try io case r of Left e | Just (GHCiQException _ err) <- fromException e -> do when verbose $ putStrLn "iserv: QFail" writePipe pipe (putMessage (QFail err)) loop | otherwise -> do when verbose $ putStrLn "iserv: QException" str <- showException e writePipe pipe (putMessage (QException str)) loop Right a -> do when verbose $ putStrLn "iserv: QDone" writePipe pipe (putMessage QDone) reply a -- carefully when showing an exception, there might be other exceptions -- lurking inside it. If so, we return the inner exception instead. showException :: SomeException -> IO String showException e0 = do r <- try $ evaluate (force (show (e0::SomeException))) case r of Left e -> showException e Right str -> return str -- throw away any pending ^C exceptions while we're not running -- interpreted code. GHC will also get the ^C, and either ignore it -- (if this is GHCi), or tell us to quit with a Shutdown message. discardCtrlC = do r <- try $ restore $ return () case r of Left UserInterrupt -> return () >> discardCtrlC Left e -> throwIO e _ -> return ()
1,872
false
true
20
17
588
663
307
356
null
null
DanielWaterworth/Idris-dev
src/IRTS/CodegenLLVM.hs
bsd-3-clause
cgOp (LFloatInt ity) [x] = do x' <- unbox (FArith ATFloat) x x'' <- inst $ FPToSI x' (ftyToTy $ cmpResultTy ity) [] box (FArith (ATInt ity)) x''
150
cgOp (LFloatInt ity) [x] = do x' <- unbox (FArith ATFloat) x x'' <- inst $ FPToSI x' (ftyToTy $ cmpResultTy ity) [] box (FArith (ATInt ity)) x''
150
cgOp (LFloatInt ity) [x] = do x' <- unbox (FArith ATFloat) x x'' <- inst $ FPToSI x' (ftyToTy $ cmpResultTy ity) [] box (FArith (ATInt ity)) x''
150
false
false
0
12
33
88
41
47
null
null
gallais/potpourri
haskell/hsubst/TypeChecking.hs
gpl-3.0
checkTyClosed (TyFun d x) = checkTyClosed d' `seq` checkTyClosed x where d' = hSubstTy (SubstDa Nothing TyZro) DropItDa $ outScopeDa d
136
checkTyClosed (TyFun d x) = checkTyClosed d' `seq` checkTyClosed x where d' = hSubstTy (SubstDa Nothing TyZro) DropItDa $ outScopeDa d
136
checkTyClosed (TyFun d x) = checkTyClosed d' `seq` checkTyClosed x where d' = hSubstTy (SubstDa Nothing TyZro) DropItDa $ outScopeDa d
136
false
false
1
8
22
62
27
35
null
null
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/tests/PackageTests/PreProcess/Main.hs
bsd-3-clause
main :: IO () main = return ()
30
main :: IO () main = return ()
30
main = return ()
16
false
true
1
6
7
24
10
14
null
null
SKA-ScienceDataProcessor/RC
MS2/lib/DNA/CmdOpts.hs
apache-2.0
readPort :: ReadM Int readPort = do a <- auto guard (a > 0 && a < 65535) return a
93
readPort :: ReadM Int readPort = do a <- auto guard (a > 0 && a < 65535) return a
93
readPort = do a <- auto guard (a > 0 && a < 65535) return a
71
false
true
0
11
31
48
22
26
null
null
amccausl/Swish
Swish/HaskellUtils/ParseTest.hs
lgpl-2.1
testParseAlt1 = testParser "parseAlt1" parseAltParser "..." []
62
testParseAlt1 = testParser "parseAlt1" parseAltParser "..." []
62
testParseAlt1 = testParser "parseAlt1" parseAltParser "..." []
62
false
false
0
6
6
17
8
9
null
null
ian-ross/cabal
Cabal/Distribution/Simple/Setup.hs
bsd-3-clause
-- FIXME Not sure where this should live defaultDistPref :: FilePath defaultDistPref = "dist"
93
defaultDistPref :: FilePath defaultDistPref = "dist"
52
defaultDistPref = "dist"
24
true
true
0
6
13
19
8
11
null
null
Rufflewind/sci-ratio
tests/Main.hs
mit
testReadShowRead :: (String, SciRational) -> Test () testReadShowRead (s, y) = readSciRationalT s $ \ x -> if x == y then testShowRead s x else failTest $ printf "parsed result (%s) not equal to expected (%s): %s" (show x) (show y) s
266
testReadShowRead :: (String, SciRational) -> Test () testReadShowRead (s, y) = readSciRationalT s $ \ x -> if x == y then testShowRead s x else failTest $ printf "parsed result (%s) not equal to expected (%s): %s" (show x) (show y) s
266
testReadShowRead (s, y) = readSciRationalT s $ \ x -> if x == y then testShowRead s x else failTest $ printf "parsed result (%s) not equal to expected (%s): %s" (show x) (show y) s
213
false
true
0
11
75
89
46
43
null
null
fhaust/aer-utils
src/Data/SimpleMat.hs
mit
row :: KnownNat w => Int -> Mat w h a -> Mat w 1 a row y (Mat f) = Mat $ \x _ -> f x y
86
row :: KnownNat w => Int -> Mat w h a -> Mat w 1 a row y (Mat f) = Mat $ \x _ -> f x y
86
row y (Mat f) = Mat $ \x _ -> f x y
35
false
true
0
8
28
67
32
35
null
null
GaloisInc/ivory-tower-stm32
tower-echronos-stm32/src/Tower/AADL/Build/EChronos.hs
bsd-3-clause
debug_println :: Def('[IString] ':-> ()) debug_println = importProc "debug_println" "debug.h"
93
debug_println :: Def('[IString] ':-> ()) debug_println = importProc "debug_println" "debug.h"
93
debug_println = importProc "debug_println" "debug.h"
52
false
true
0
9
9
35
18
17
null
null
spechub/Hets
OWL2/ASKeywords.hs
gpl-2.0
dataOneOfS :: String dataOneOfS = "DataOneOf"
45
dataOneOfS :: String dataOneOfS = "DataOneOf"
45
dataOneOfS = "DataOneOf"
24
false
true
0
4
5
11
6
5
null
null
wavewave/madgraph-auto-dataset
src/HEP/Automation/MadGraph/Dataset/Set20110307set1.hs
gpl-3.0
psetup_axi_ttbar01j :: ProcessSetup psetup_axi_ttbar01j = PS { mversion = MadGraph4 , model = AxiGluon , process = processTTBar0or1jet , processBrief = "ttbar01j" , workname = "307Axi1J" }
209
psetup_axi_ttbar01j :: ProcessSetup psetup_axi_ttbar01j = PS { mversion = MadGraph4 , model = AxiGluon , process = processTTBar0or1jet , processBrief = "ttbar01j" , workname = "307Axi1J" }
209
psetup_axi_ttbar01j = PS { mversion = MadGraph4 , model = AxiGluon , process = processTTBar0or1jet , processBrief = "ttbar01j" , workname = "307Axi1J" }
173
false
true
0
6
47
43
27
16
null
null
notogawa/yesod-websocket-sample
main.hs
bsd-2-clause
application :: MVar ServerState -> WS.Request -> WS.WebSockets WS.Hybi10 () application state rq = do WS.acceptRequest rq WS.getVersion >>= liftIO . putStrLn . ("Client version: " ++) sink <- WS.getSink msg <- WS.receiveData liftIO $ print msg clients <- liftIO $ readMVar state case msg of _ | not (prefix `T.isPrefixOf` msg) -> WS.sendTextData ("Wrong announcement" :: Text) | any ($ fst client) [T.null, T.any isPunctuation, T.any isSpace] -> WS.sendTextData ("Name cannot " `mappend` "contain punctuation or whitespace, and " `mappend` "cannot be empty" :: Text) | clientExists client clients -> WS.sendTextData ("User already exists" :: Text) | otherwise -> do liftIO $ modifyMVar_ state $ \s -> do let s' = addClient client s WS.sendSink sink $ WS.textData $ "Welcome! Users: " `mappend` T.intercalate ", " (map fst s) broadcast (fst client `mappend` " joined") s' return s' talk state client where prefix = "Hi! I am " client = (T.drop (T.length prefix) msg, sink)
1,347
application :: MVar ServerState -> WS.Request -> WS.WebSockets WS.Hybi10 () application state rq = do WS.acceptRequest rq WS.getVersion >>= liftIO . putStrLn . ("Client version: " ++) sink <- WS.getSink msg <- WS.receiveData liftIO $ print msg clients <- liftIO $ readMVar state case msg of _ | not (prefix `T.isPrefixOf` msg) -> WS.sendTextData ("Wrong announcement" :: Text) | any ($ fst client) [T.null, T.any isPunctuation, T.any isSpace] -> WS.sendTextData ("Name cannot " `mappend` "contain punctuation or whitespace, and " `mappend` "cannot be empty" :: Text) | clientExists client clients -> WS.sendTextData ("User already exists" :: Text) | otherwise -> do liftIO $ modifyMVar_ state $ \s -> do let s' = addClient client s WS.sendSink sink $ WS.textData $ "Welcome! Users: " `mappend` T.intercalate ", " (map fst s) broadcast (fst client `mappend` " joined") s' return s' talk state client where prefix = "Hi! I am " client = (T.drop (T.length prefix) msg, sink)
1,347
application state rq = do WS.acceptRequest rq WS.getVersion >>= liftIO . putStrLn . ("Client version: " ++) sink <- WS.getSink msg <- WS.receiveData liftIO $ print msg clients <- liftIO $ readMVar state case msg of _ | not (prefix `T.isPrefixOf` msg) -> WS.sendTextData ("Wrong announcement" :: Text) | any ($ fst client) [T.null, T.any isPunctuation, T.any isSpace] -> WS.sendTextData ("Name cannot " `mappend` "contain punctuation or whitespace, and " `mappend` "cannot be empty" :: Text) | clientExists client clients -> WS.sendTextData ("User already exists" :: Text) | otherwise -> do liftIO $ modifyMVar_ state $ \s -> do let s' = addClient client s WS.sendSink sink $ WS.textData $ "Welcome! Users: " `mappend` T.intercalate ", " (map fst s) broadcast (fst client `mappend` " joined") s' return s' talk state client where prefix = "Hi! I am " client = (T.drop (T.length prefix) msg, sink)
1,271
false
true
0
22
531
399
192
207
null
null
gambogi/csh-eval
src/CSH/Eval/DB/Statements.hs
mit
-- | Fetch all question(s) with a given active status. getQuestionsActiveP :: Bool -- ^ Question activity -> H.Stmt HP.Postgres getQuestionsActiveP = [H.stmt|select * from "question" where "active" = ?|]
223
getQuestionsActiveP :: Bool -- ^ Question activity -> H.Stmt HP.Postgres getQuestionsActiveP = [H.stmt|select * from "question" where "active" = ?|]
168
getQuestionsActiveP = [H.stmt|select * from "question" where "active" = ?|]
75
true
true
0
7
49
30
18
12
null
null
krame505/board_games
haskell/RectBoard.hs
gpl-3.0
isValidLoc :: RectBoard -> Loc -> Bool isValidLoc board (x, y) = x < height board && x >= 0 && y < width board && y >= 0
120
isValidLoc :: RectBoard -> Loc -> Bool isValidLoc board (x, y) = x < height board && x >= 0 && y < width board && y >= 0
120
isValidLoc board (x, y) = x < height board && x >= 0 && y < width board && y >= 0
81
false
true
0
12
28
64
32
32
null
null
ptol/oczor
src/Oczor/Syntax/Syntax.hs
mit
isTypeIdent (TypeIdent _) = True
32
isTypeIdent (TypeIdent _) = True
32
isTypeIdent (TypeIdent _) = True
32
false
false
0
7
4
15
7
8
null
null
shlevy/ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
deTagBind (Rec prs) = Rec [(b, deTagExpr rhs) | (TB b _, rhs) <- prs]
81
deTagBind (Rec prs) = Rec [(b, deTagExpr rhs) | (TB b _, rhs) <- prs]
81
deTagBind (Rec prs) = Rec [(b, deTagExpr rhs) | (TB b _, rhs) <- prs]
81
false
false
0
10
26
49
25
24
null
null
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Layout/Hidden.hs
bsd-2-clause
hiddenWindows :: LayoutClass l Window => l Window -> ModifiedLayout HiddenWindows l Window hiddenWindows = ModifiedLayout $ HiddenWindows []
140
hiddenWindows :: LayoutClass l Window => l Window -> ModifiedLayout HiddenWindows l Window hiddenWindows = ModifiedLayout $ HiddenWindows []
140
hiddenWindows = ModifiedLayout $ HiddenWindows []
49
false
true
0
7
18
43
20
23
null
null
rahulmutt/ghcvm
compiler/Eta/HsSyn/HsDecls.hs
bsd-3-clause
lvectInstDecl _ = False
45
lvectInstDecl _ = False
45
lvectInstDecl _ = False
45
false
false
0
5
25
9
4
5
null
null
42f87d89/HSnake
snake.hs
mit
handle w e s@(State (f, Snake dir ps)) dim = case e of Just (EventCharacter 'h') -> advance (State (f, Snake (if dir /= R then L else dir) ps)) dim Just (EventCharacter 'j') -> advance (State (f, Snake (if dir /= U then D else dir) ps)) dim Just (EventCharacter 'k') -> advance (State (f, Snake (if dir /= D then U else dir) ps)) dim Just (EventCharacter 'l') -> advance (State (f, Snake (if dir /= L then R else dir) ps)) dim _ -> advance s dim
537
handle w e s@(State (f, Snake dir ps)) dim = case e of Just (EventCharacter 'h') -> advance (State (f, Snake (if dir /= R then L else dir) ps)) dim Just (EventCharacter 'j') -> advance (State (f, Snake (if dir /= U then D else dir) ps)) dim Just (EventCharacter 'k') -> advance (State (f, Snake (if dir /= D then U else dir) ps)) dim Just (EventCharacter 'l') -> advance (State (f, Snake (if dir /= L then R else dir) ps)) dim _ -> advance s dim
537
handle w e s@(State (f, Snake dir ps)) dim = case e of Just (EventCharacter 'h') -> advance (State (f, Snake (if dir /= R then L else dir) ps)) dim Just (EventCharacter 'j') -> advance (State (f, Snake (if dir /= U then D else dir) ps)) dim Just (EventCharacter 'k') -> advance (State (f, Snake (if dir /= D then U else dir) ps)) dim Just (EventCharacter 'l') -> advance (State (f, Snake (if dir /= L then R else dir) ps)) dim _ -> advance s dim
537
false
false
1
15
181
266
133
133
null
null
rahulmutt/ghcvm
compiler/Eta/Prelude/THNames.hs
bsd-3-clause
patQTyConKey = mkPreludeTyConUnique 219
50
patQTyConKey = mkPreludeTyConUnique 219
50
patQTyConKey = mkPreludeTyConUnique 219
50
false
false
0
5
14
9
4
5
null
null
olorin/amazonka
amazonka-config/test/Test/AWS/Gen/Config.hs
mpl-2.0
testDescribeDeliveryChannelStatusResponse :: DescribeDeliveryChannelStatusResponse -> TestTree testDescribeDeliveryChannelStatusResponse = res "DescribeDeliveryChannelStatusResponse" "fixture/DescribeDeliveryChannelStatusResponse.proto" config (Proxy :: Proxy DescribeDeliveryChannelStatus)
306
testDescribeDeliveryChannelStatusResponse :: DescribeDeliveryChannelStatusResponse -> TestTree testDescribeDeliveryChannelStatusResponse = res "DescribeDeliveryChannelStatusResponse" "fixture/DescribeDeliveryChannelStatusResponse.proto" config (Proxy :: Proxy DescribeDeliveryChannelStatus)
306
testDescribeDeliveryChannelStatusResponse = res "DescribeDeliveryChannelStatusResponse" "fixture/DescribeDeliveryChannelStatusResponse.proto" config (Proxy :: Proxy DescribeDeliveryChannelStatus)
211
false
true
0
6
30
36
17
19
null
null