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
dorchard/pde-specs
Output.hs
bsd-2-clause
parensL t = (fromString "(") <> t <> (fromString ")")
53
parensL t = (fromString "(") <> t <> (fromString ")")
53
parensL t = (fromString "(") <> t <> (fromString ")")
53
false
false
0
8
9
29
14
15
null
null
ben-schulz/Idris-dev
src/IRTS/JavaScript/AST.hs
bsd-3-clause
compileJS' indent (JSSeq seq) = T.intercalate ";\n" ( map ( (T.replicate indent " " `T.append`) . (compileJS' indent) ) $ filter (/= JSNoop) seq ) `T.append` ";"
179
compileJS' indent (JSSeq seq) = T.intercalate ";\n" ( map ( (T.replicate indent " " `T.append`) . (compileJS' indent) ) $ filter (/= JSNoop) seq ) `T.append` ";"
179
compileJS' indent (JSSeq seq) = T.intercalate ";\n" ( map ( (T.replicate indent " " `T.append`) . (compileJS' indent) ) $ filter (/= JSNoop) seq ) `T.append` ";"
179
false
false
0
12
44
86
43
43
null
null
ibabushkin/hweather
Main.hs
gpl-3.0
defaultOptions :: Options defaultOptions = Options { optUnit = Fetch.Default , optNumIntervals = 8 , optSkipIntervals = 0 , optAPIKey = "" , optLocation = Fetch.City "Berlin" "de" , optOutput = putStrLn , optFormat = ANSI }
398
defaultOptions :: Options defaultOptions = Options { optUnit = Fetch.Default , optNumIntervals = 8 , optSkipIntervals = 0 , optAPIKey = "" , optLocation = Fetch.City "Berlin" "de" , optOutput = putStrLn , optFormat = ANSI }
398
defaultOptions = Options { optUnit = Fetch.Default , optNumIntervals = 8 , optSkipIntervals = 0 , optAPIKey = "" , optLocation = Fetch.City "Berlin" "de" , optOutput = putStrLn , optFormat = ANSI }
372
false
true
0
8
211
64
39
25
null
null
fibsifan/pandoc
src/Text/Pandoc/Readers/HTML.hs
gpl-2.0
pListItem :: TagParser a -> TagParser Blocks pListItem nonItem = do TagOpen _ attr <- lookAhead $ pSatisfy (~== TagOpen "li" []) let liDiv = maybe mempty (\x -> B.divWith (x, [], []) mempty) (lookup "id" attr) (liDiv <>) <$> pInTags "li" block <* skipMany nonItem
269
pListItem :: TagParser a -> TagParser Blocks pListItem nonItem = do TagOpen _ attr <- lookAhead $ pSatisfy (~== TagOpen "li" []) let liDiv = maybe mempty (\x -> B.divWith (x, [], []) mempty) (lookup "id" attr) (liDiv <>) <$> pInTags "li" block <* skipMany nonItem
269
pListItem nonItem = do TagOpen _ attr <- lookAhead $ pSatisfy (~== TagOpen "li" []) let liDiv = maybe mempty (\x -> B.divWith (x, [], []) mempty) (lookup "id" attr) (liDiv <>) <$> pInTags "li" block <* skipMany nonItem
224
false
true
0
16
51
134
64
70
null
null
ashgti/DTI
src/Language/Perl/Types.hs
mit
showVal (String contents) = "\"" ++ contents ++ "\""
52
showVal (String contents) = "\"" ++ contents ++ "\""
52
showVal (String contents) = "\"" ++ contents ++ "\""
52
false
false
0
7
8
23
11
12
null
null
ideas-edu/ideas
src/Ideas/Common/Rewriting/Confluence.hs
apache-2.0
rewriteTerm :: RewriteRule a -> Term -> [Term] rewriteTerm r t = do let lhs :~> rhs = ruleSpecTerm $ renumberRewriteRule (nextMetaVar t) r sub <- match lhs t return (sub |-> rhs) -- uniplate-like helper-functions
239
rewriteTerm :: RewriteRule a -> Term -> [Term] rewriteTerm r t = do let lhs :~> rhs = ruleSpecTerm $ renumberRewriteRule (nextMetaVar t) r sub <- match lhs t return (sub |-> rhs) -- uniplate-like helper-functions
238
rewriteTerm r t = do let lhs :~> rhs = ruleSpecTerm $ renumberRewriteRule (nextMetaVar t) r sub <- match lhs t return (sub |-> rhs) -- uniplate-like helper-functions
191
false
true
0
14
62
91
41
50
null
null
GaloisInc/elf
src/Data/ElfEdit/Get.hs
bsd-3-clause
parseElfResult (Right (_,_,v)) = Right v
40
parseElfResult (Right (_,_,v)) = Right v
40
parseElfResult (Right (_,_,v)) = Right v
40
false
false
0
7
5
28
14
14
null
null
juventietis/HLINQ
benchmark/HDB/Connect.hs
mit
withDB :: (Database -> IO a) -> IO a withDB = sqliteConnect "test.db"
69
withDB :: (Database -> IO a) -> IO a withDB = sqliteConnect "test.db"
69
withDB = sqliteConnect "test.db"
32
false
true
0
9
12
36
16
20
null
null
Philonous/xml-picklers
tests/Tests.hs
bsd-3-clause
prop_flattenContent :: [(Node, Content)] -> Property prop_flattenContent ncs = hasContent (map fst ncs) ==> let combined = map (\(n, c) -> case (n, c) of (NodeContent (ContentText t), ContentText t')-> NodeContent (ContentText (Text.concat [t, t'])) (NodeContent (ContentEntity _), _) -> error "Content entities not supported!" _ -> n) ncs split = concat $ map (\(n, c) -> case (n, c) of (NodeContent (ContentText t), ContentText t') -> [ NodeContent (ContentText t) , NodeContent (ContentText t') ] (NodeContent _, _) -> error "Content entities not supported!" _ -> [n]) ncs in (flattenContent combined) == (flattenContent split) where hasContent :: [Node] -> Bool hasContent [] = False hasContent ((NodeContent _):_) = True hasContent (_:ns) = hasContent ns -- Get the `Text' value based on a list of the `Content' values.
1,180
prop_flattenContent :: [(Node, Content)] -> Property prop_flattenContent ncs = hasContent (map fst ncs) ==> let combined = map (\(n, c) -> case (n, c) of (NodeContent (ContentText t), ContentText t')-> NodeContent (ContentText (Text.concat [t, t'])) (NodeContent (ContentEntity _), _) -> error "Content entities not supported!" _ -> n) ncs split = concat $ map (\(n, c) -> case (n, c) of (NodeContent (ContentText t), ContentText t') -> [ NodeContent (ContentText t) , NodeContent (ContentText t') ] (NodeContent _, _) -> error "Content entities not supported!" _ -> [n]) ncs in (flattenContent combined) == (flattenContent split) where hasContent :: [Node] -> Bool hasContent [] = False hasContent ((NodeContent _):_) = True hasContent (_:ns) = hasContent ns -- Get the `Text' value based on a list of the `Content' values.
1,180
prop_flattenContent ncs = hasContent (map fst ncs) ==> let combined = map (\(n, c) -> case (n, c) of (NodeContent (ContentText t), ContentText t')-> NodeContent (ContentText (Text.concat [t, t'])) (NodeContent (ContentEntity _), _) -> error "Content entities not supported!" _ -> n) ncs split = concat $ map (\(n, c) -> case (n, c) of (NodeContent (ContentText t), ContentText t') -> [ NodeContent (ContentText t) , NodeContent (ContentText t') ] (NodeContent _, _) -> error "Content entities not supported!" _ -> [n]) ncs in (flattenContent combined) == (flattenContent split) where hasContent :: [Node] -> Bool hasContent [] = False hasContent ((NodeContent _):_) = True hasContent (_:ns) = hasContent ns -- Get the `Text' value based on a list of the `Content' values.
1,127
false
true
4
16
483
374
188
186
null
null
strake/monad-classes.hs
Control/Monad/Classes/Reader.hs
mit
runReader :: r -> R.ReaderT r m a -> m a runReader = flip R.runReaderT
70
runReader :: r -> R.ReaderT r m a -> m a runReader = flip R.runReaderT
70
runReader = flip R.runReaderT
29
false
true
0
9
14
42
18
24
null
null
CodaFi/language-swift
src/Language/Swift/Lexer.hs
mit
braces = P.braces lexer
28
braces = P.braces lexer
28
braces = P.braces lexer
28
false
false
0
6
8
11
5
6
null
null
ganeti/ganeti
src/Ganeti/OpParams.hs
bsd-2-clause
pFileDriver :: Field pFileDriver = withDoc "Driver for file-backed disks" . optionalField $ simpleField "file_driver" [t| FileDriver |]
139
pFileDriver :: Field pFileDriver = withDoc "Driver for file-backed disks" . optionalField $ simpleField "file_driver" [t| FileDriver |]
139
pFileDriver = withDoc "Driver for file-backed disks" . optionalField $ simpleField "file_driver" [t| FileDriver |]
118
false
true
2
6
21
39
18
21
null
null
Icelandjack/lens
src/Control/Lens/Fold.hs
bsd-3-clause
-- | Obtain an 'Fold' that can be composed with to filter another 'Lens', 'Iso', 'Getter', 'Fold' (or 'Traversal'). -- -- Note: This is /not/ a legal 'Traversal', unless you are very careful not to invalidate the predicate on the target. -- -- Note: This is also /not/ a legal 'Prism', unless you are very careful not to inject a value that matches the predicate. -- -- As a counter example, consider that given @evens = 'filtered' 'even'@ the second 'Traversal' law is violated: -- -- @ -- 'Control.Lens.Setter.over' evens 'succ' '.' 'Control.Lens.Setter.over' evens 'succ' '/=' 'Control.Lens.Setter.over' evens ('succ' '.' 'succ') -- @ -- -- So, in order for this to qualify as a legal 'Traversal' you can only use it for actions that preserve the result of the predicate! -- -- >>> [1..10]^..folded.filtered even -- [2,4,6,8,10] -- -- This will preserve an index if it is present. filtered :: (Choice p, Applicative f) => (a -> Bool) -> Optic' p f a a filtered p = dimap (\x -> if p x then Right x else Left x) (either pure id) . right'
1,039
filtered :: (Choice p, Applicative f) => (a -> Bool) -> Optic' p f a a filtered p = dimap (\x -> if p x then Right x else Left x) (either pure id) . right'
155
filtered p = dimap (\x -> if p x then Right x else Left x) (either pure id) . right'
84
true
true
0
10
183
115
65
50
null
null
olsner/ghc
compiler/utils/Bag.hs
bsd-3-clause
foldrBagM k z (ListBag xs) = foldrM k z xs
45
foldrBagM k z (ListBag xs) = foldrM k z xs
45
foldrBagM k z (ListBag xs) = foldrM k z xs
45
false
false
0
7
12
26
12
14
null
null
matterhorn-chat/matterhorn
src/Matterhorn/State/ThemeListOverlay.hs
bsd-3-clause
-- | Transform the user list results in some way, e.g. by moving the -- cursor, and then check to see whether the modification warrants a -- prefetch of more search results. themeListMove :: (L.List Name InternalTheme -> L.List Name InternalTheme) -> MH () themeListMove = listOverlayMove (csCurrentTeam.tsThemeListOverlay)
323
themeListMove :: (L.List Name InternalTheme -> L.List Name InternalTheme) -> MH () themeListMove = listOverlayMove (csCurrentTeam.tsThemeListOverlay)
149
themeListMove = listOverlayMove (csCurrentTeam.tsThemeListOverlay)
66
true
true
0
9
47
52
27
25
null
null
danr/hipspec
src/HipSpec/Property.hs
gpl-3.0
-- | Maybe the QuickSpec equation this originated from propEquation :: Property eq -> Maybe eq propEquation p = case prop_origin p of Equation eq -> Just eq _ -> Nothing -- | Lint pass on a property
217
propEquation :: Property eq -> Maybe eq propEquation p = case prop_origin p of Equation eq -> Just eq _ -> Nothing -- | Lint pass on a property
162
propEquation p = case prop_origin p of Equation eq -> Just eq _ -> Nothing -- | Lint pass on a property
122
true
true
0
8
56
56
25
31
null
null
technogeeky/centered
src/Pearl/GaDtTLHT/Section03.hs
gpl-3.0
-- ^ -- @ -- ('p05') 'splits' . 'k' = 'map' ('id' '><' k) . 'unfoldrp' ('||>') -- @ p06 :: property p06 = undefined
130
p06 :: property p06 = undefined
31
p06 = undefined
15
true
true
0
6
39
22
11
11
null
null
michalkonecny/aern2
aern2-mfun/src/AERN2/BoxFunMinMax/Expressions/DeriveBounds.hs
bsd-3-clause
scanHypothesis (FComp Ge e1 e2) True intervals = scanHypothesis (FComp Lt e1 e2) False intervals
99
scanHypothesis (FComp Ge e1 e2) True intervals = scanHypothesis (FComp Lt e1 e2) False intervals
99
scanHypothesis (FComp Ge e1 e2) True intervals = scanHypothesis (FComp Lt e1 e2) False intervals
99
false
false
0
7
17
40
19
21
null
null
seckcoder/lang-learn
haskell/algo/src/Leetcode/AddTwoNumbers.hs
unlicense
zipWithPadding :: a -> b -> [a] -> [b] -> [(a,b)] zipWithPadding a b (x:xs) (y:ys) = (x,y) : zipWithPadding a b xs ys
117
zipWithPadding :: a -> b -> [a] -> [b] -> [(a,b)] zipWithPadding a b (x:xs) (y:ys) = (x,y) : zipWithPadding a b xs ys
117
zipWithPadding a b (x:xs) (y:ys) = (x,y) : zipWithPadding a b xs ys
67
false
true
0
10
23
84
46
38
null
null
cutsea110/aop
src/Infinity.hs
bsd-3-clause
idList = foldr (Nil, Cons)
26
idList = foldr (Nil, Cons)
26
idList = foldr (Nil, Cons)
26
false
false
0
6
4
15
8
7
null
null
SamirTalwar/advent-of-code
2015/AOC_03_1.hs
mit
parseInput :: String -> [Direction] parseInput = map parseChar where parseChar '^' = North parseChar '>' = East parseChar 'v' = South parseChar '<' = West
172
parseInput :: String -> [Direction] parseInput = map parseChar where parseChar '^' = North parseChar '>' = East parseChar 'v' = South parseChar '<' = West
172
parseInput = map parseChar where parseChar '^' = North parseChar '>' = East parseChar 'v' = South parseChar '<' = West
136
false
true
4
8
43
75
29
46
null
null
JPMoresmau/leksah
src/IDE/ImportTool.hs
gpl-2.0
selectModuleDialog :: Window -> [Descr] -> Text -> Maybe Text -> Maybe Descr -> IO (Maybe Descr) selectModuleDialog parentWindow list id mbQual mbDescr = let selectionList = (nub . sort) $ map (T.pack . render . disp . modu . fromJust . dsMbModu) list in if length selectionList == 1 then return (Just (head list)) else do let mbSelectedString = case mbDescr of Nothing -> Nothing Just descr -> case dsMbModu descr of Nothing -> Nothing Just pm -> Just ((T.pack . render . disp . modu) pm) let realSelectionString = case mbSelectedString of Nothing -> head selectionList Just str -> if str `elem` selectionList then str else head selectionList let qualId = case mbQual of Nothing -> id Just str -> str <> "." <> id dia <- dialogNew setWindowTransientFor dia parentWindow upper <- dialogGetContentArea dia >>= unsafeCastTo Box okButton <- dialogAddButton' dia (__"Add Import") ResponseTypeOk dialogAddButton' dia (__"Cancel") ResponseTypeCancel (widget,inj,ext,_) <- buildEditor (moduleFields selectionList qualId) realSelectionString boxPackStart' upper widget PackGrow 7 dialogSetDefaultResponse' dia ResponseTypeOk --does not work for the tree view widgetShowAll dia rw <- getRealWidget widget setWidgetCanDefault okButton True widgetGrabDefault okButton resp <- dialogRun' dia value <- ext T.empty widgetHide dia widgetDestroy dia --find case (resp,value) of (ResponseTypeOk,Just v) -> return (Just (head (filter (\e -> case dsMbModu e of Nothing -> False Just pm -> (T.pack . render . disp . modu) pm == v) list))) _ -> return Nothing
2,586
selectModuleDialog :: Window -> [Descr] -> Text -> Maybe Text -> Maybe Descr -> IO (Maybe Descr) selectModuleDialog parentWindow list id mbQual mbDescr = let selectionList = (nub . sort) $ map (T.pack . render . disp . modu . fromJust . dsMbModu) list in if length selectionList == 1 then return (Just (head list)) else do let mbSelectedString = case mbDescr of Nothing -> Nothing Just descr -> case dsMbModu descr of Nothing -> Nothing Just pm -> Just ((T.pack . render . disp . modu) pm) let realSelectionString = case mbSelectedString of Nothing -> head selectionList Just str -> if str `elem` selectionList then str else head selectionList let qualId = case mbQual of Nothing -> id Just str -> str <> "." <> id dia <- dialogNew setWindowTransientFor dia parentWindow upper <- dialogGetContentArea dia >>= unsafeCastTo Box okButton <- dialogAddButton' dia (__"Add Import") ResponseTypeOk dialogAddButton' dia (__"Cancel") ResponseTypeCancel (widget,inj,ext,_) <- buildEditor (moduleFields selectionList qualId) realSelectionString boxPackStart' upper widget PackGrow 7 dialogSetDefaultResponse' dia ResponseTypeOk --does not work for the tree view widgetShowAll dia rw <- getRealWidget widget setWidgetCanDefault okButton True widgetGrabDefault okButton resp <- dialogRun' dia value <- ext T.empty widgetHide dia widgetDestroy dia --find case (resp,value) of (ResponseTypeOk,Just v) -> return (Just (head (filter (\e -> case dsMbModu e of Nothing -> False Just pm -> (T.pack . render . disp . modu) pm == v) list))) _ -> return Nothing
2,586
selectModuleDialog parentWindow list id mbQual mbDescr = let selectionList = (nub . sort) $ map (T.pack . render . disp . modu . fromJust . dsMbModu) list in if length selectionList == 1 then return (Just (head list)) else do let mbSelectedString = case mbDescr of Nothing -> Nothing Just descr -> case dsMbModu descr of Nothing -> Nothing Just pm -> Just ((T.pack . render . disp . modu) pm) let realSelectionString = case mbSelectedString of Nothing -> head selectionList Just str -> if str `elem` selectionList then str else head selectionList let qualId = case mbQual of Nothing -> id Just str -> str <> "." <> id dia <- dialogNew setWindowTransientFor dia parentWindow upper <- dialogGetContentArea dia >>= unsafeCastTo Box okButton <- dialogAddButton' dia (__"Add Import") ResponseTypeOk dialogAddButton' dia (__"Cancel") ResponseTypeCancel (widget,inj,ext,_) <- buildEditor (moduleFields selectionList qualId) realSelectionString boxPackStart' upper widget PackGrow 7 dialogSetDefaultResponse' dia ResponseTypeOk --does not work for the tree view widgetShowAll dia rw <- getRealWidget widget setWidgetCanDefault okButton True widgetGrabDefault okButton resp <- dialogRun' dia value <- ext T.empty widgetHide dia widgetDestroy dia --find case (resp,value) of (ResponseTypeOk,Just v) -> return (Just (head (filter (\e -> case dsMbModu e of Nothing -> False Just pm -> (T.pack . render . disp . modu) pm == v) list))) _ -> return Nothing
2,489
false
true
0
31
1,281
602
284
318
null
null
keera-studios/hsQt
Qtc/Gui/QDialogButtonBox.hs
bsd-2-clause
qDialogButtonBox_deleteLater :: QDialogButtonBox a -> IO () qDialogButtonBox_deleteLater x0 = withObjectPtr x0 $ \cobj_x0 -> qtc_QDialogButtonBox_deleteLater cobj_x0
171
qDialogButtonBox_deleteLater :: QDialogButtonBox a -> IO () qDialogButtonBox_deleteLater x0 = withObjectPtr x0 $ \cobj_x0 -> qtc_QDialogButtonBox_deleteLater cobj_x0
171
qDialogButtonBox_deleteLater x0 = withObjectPtr x0 $ \cobj_x0 -> qtc_QDialogButtonBox_deleteLater cobj_x0
111
false
true
0
7
22
41
19
22
null
null
a143753/AOJ
0101.hs
apache-2.0
ans :: [String] -> [String] ans inputs = map (replace "Hoshino" "Hoshina") inputs
83
ans :: [String] -> [String] ans inputs = map (replace "Hoshino" "Hoshina") inputs
83
ans inputs = map (replace "Hoshino" "Hoshina") inputs
55
false
true
0
7
14
40
20
20
null
null
jwiegley/ghc-release
libraries/process/System/Process.hs
gpl-3.0
readProcess :: FilePath -- ^ Filename of the executable (see 'proc' for details) -> [String] -- ^ any arguments -> String -- ^ standard input -> IO String -- ^ stdout readProcess cmd args input = do let cp_opts = (proc cmd args) { std_in = CreatePipe, std_out = CreatePipe, std_err = Inherit } (ex, output) <- withCreateProcess_ "readProcess" cp_opts $ \(Just inh) (Just outh) _ ph -> do -- fork off a thread to start consuming the output output <- hGetContents outh withForkWait (C.evaluate $ rnf output) $ \waitOut -> do -- now write any input unless (null input) $ ignoreSigPipe $ hPutStr inh input -- hClose performs implicit hFlush, and thus may trigger a SIGPIPE ignoreSigPipe $ hClose inh -- wait on the output waitOut hClose outh -- wait on the process ex <- waitForProcess ph return (ex, output) case ex of ExitSuccess -> return output ExitFailure r -> processFailedException "readProcess" cmd args r {- | @readProcessWithExitCode@ creates an external process, reads its standard output and standard error strictly, waits until the process terminates, and then returns the 'ExitCode' of the process, the standard output, and the standard error. If an asynchronous exception is thrown to the thread executing @readProcessWithExitCode@. The forked process will be terminated and @readProcessWithExitCode@ will wait (block) until the process has been terminated. 'readProcess' and 'readProcessWithExitCode' are fairly simple wrappers around 'createProcess'. Constructing variants of these functions is quite easy: follow the link to the source code to see how 'readProcess' is implemented. On Unix systems, see 'waitForProcess' for the meaning of exit codes when the process died as the result of a signal. -}
2,046
readProcess :: FilePath -- ^ Filename of the executable (see 'proc' for details) -> [String] -- ^ any arguments -> String -- ^ standard input -> IO String readProcess cmd args input = do let cp_opts = (proc cmd args) { std_in = CreatePipe, std_out = CreatePipe, std_err = Inherit } (ex, output) <- withCreateProcess_ "readProcess" cp_opts $ \(Just inh) (Just outh) _ ph -> do -- fork off a thread to start consuming the output output <- hGetContents outh withForkWait (C.evaluate $ rnf output) $ \waitOut -> do -- now write any input unless (null input) $ ignoreSigPipe $ hPutStr inh input -- hClose performs implicit hFlush, and thus may trigger a SIGPIPE ignoreSigPipe $ hClose inh -- wait on the output waitOut hClose outh -- wait on the process ex <- waitForProcess ph return (ex, output) case ex of ExitSuccess -> return output ExitFailure r -> processFailedException "readProcess" cmd args r {- | @readProcessWithExitCode@ creates an external process, reads its standard output and standard error strictly, waits until the process terminates, and then returns the 'ExitCode' of the process, the standard output, and the standard error. If an asynchronous exception is thrown to the thread executing @readProcessWithExitCode@. The forked process will be terminated and @readProcessWithExitCode@ will wait (block) until the process has been terminated. 'readProcess' and 'readProcessWithExitCode' are fairly simple wrappers around 'createProcess'. Constructing variants of these functions is quite easy: follow the link to the source code to see how 'readProcess' is implemented. On Unix systems, see 'waitForProcess' for the meaning of exit codes when the process died as the result of a signal. -}
2,019
readProcess cmd args input = do let cp_opts = (proc cmd args) { std_in = CreatePipe, std_out = CreatePipe, std_err = Inherit } (ex, output) <- withCreateProcess_ "readProcess" cp_opts $ \(Just inh) (Just outh) _ ph -> do -- fork off a thread to start consuming the output output <- hGetContents outh withForkWait (C.evaluate $ rnf output) $ \waitOut -> do -- now write any input unless (null input) $ ignoreSigPipe $ hPutStr inh input -- hClose performs implicit hFlush, and thus may trigger a SIGPIPE ignoreSigPipe $ hClose inh -- wait on the output waitOut hClose outh -- wait on the process ex <- waitForProcess ph return (ex, output) case ex of ExitSuccess -> return output ExitFailure r -> processFailedException "readProcess" cmd args r {- | @readProcessWithExitCode@ creates an external process, reads its standard output and standard error strictly, waits until the process terminates, and then returns the 'ExitCode' of the process, the standard output, and the standard error. If an asynchronous exception is thrown to the thread executing @readProcessWithExitCode@. The forked process will be terminated and @readProcessWithExitCode@ will wait (block) until the process has been terminated. 'readProcess' and 'readProcessWithExitCode' are fairly simple wrappers around 'createProcess'. Constructing variants of these functions is quite easy: follow the link to the source code to see how 'readProcess' is implemented. On Unix systems, see 'waitForProcess' for the meaning of exit codes when the process died as the result of a signal. -}
1,798
true
true
0
20
601
265
132
133
null
null
sdiehl/ghc
hadrian/src/Rules/SimpleTargets.hs
bsd-3-clause
-- | A phony @autocomplete@ rule that prints all valid setting keys -- completions of the value specified in the @--complete-setting=...@ flag, -- or simply all valid setting keys if no such argument is passed to Hadrian. -- -- It is based on the 'completeSetting' function, from the "Settings" module. completionRule :: Rules () completionRule = "autocomplete" ~> do partialStr <- fromMaybe "" <$> cmdCompleteSetting case completeSetting (splitOn "." partialStr) of [] -> fail $ "No valid completion found for " ++ partialStr cs -> forM_ cs $ \ks -> liftIO . putStrLn $ intercalate "." ks
625
completionRule :: Rules () completionRule = "autocomplete" ~> do partialStr <- fromMaybe "" <$> cmdCompleteSetting case completeSetting (splitOn "." partialStr) of [] -> fail $ "No valid completion found for " ++ partialStr cs -> forM_ cs $ \ks -> liftIO . putStrLn $ intercalate "." ks
316
completionRule = "autocomplete" ~> do partialStr <- fromMaybe "" <$> cmdCompleteSetting case completeSetting (splitOn "." partialStr) of [] -> fail $ "No valid completion found for " ++ partialStr cs -> forM_ cs $ \ks -> liftIO . putStrLn $ intercalate "." ks
289
true
true
0
14
132
104
52
52
null
null
mb21/qua-kit
apps/hs/qua-server/src/Handler/Mooc/Admin/ScenarioEditor.hs
mit
postScenarioProblemAttachCriterionR :: ScenarioProblemId -> CriterionId -> Handler () postScenarioProblemAttachCriterionR s c = do void $ runDB $ do mr <- selectFirst [ ProblemCriterionProblemId P.==. s , ProblemCriterionCriterionId P.==. c ] [] case mr of Nothing -> insert_ ProblemCriterion { problemCriterionProblemId = s , problemCriterionCriterionId = c } Just _ -> pure () redirect $ ScenarioProblemEditR s
703
postScenarioProblemAttachCriterionR :: ScenarioProblemId -> CriterionId -> Handler () postScenarioProblemAttachCriterionR s c = do void $ runDB $ do mr <- selectFirst [ ProblemCriterionProblemId P.==. s , ProblemCriterionCriterionId P.==. c ] [] case mr of Nothing -> insert_ ProblemCriterion { problemCriterionProblemId = s , problemCriterionCriterionId = c } Just _ -> pure () redirect $ ScenarioProblemEditR s
703
postScenarioProblemAttachCriterionR s c = do void $ runDB $ do mr <- selectFirst [ ProblemCriterionProblemId P.==. s , ProblemCriterionCriterionId P.==. c ] [] case mr of Nothing -> insert_ ProblemCriterion { problemCriterionProblemId = s , problemCriterionCriterionId = c } Just _ -> pure () redirect $ ScenarioProblemEditR s
610
false
true
0
15
346
126
61
65
null
null
geophf/1HaskellADay
exercises/HAD/Y2017/M03/D14/Exercise.hs
mit
{-- Show the first 5 partial values for √2 >>> nthConvergent 1 sqrt2 1 % 1 >>> nthConvergent 2 sqrt2 3 % 2 >>> nthConvergent 3 sqrt2 7 % 5 >>> nthConvergent 4 sqrt2 17 % 12 >>> nthConvergent 5 sqrt2 41 % 29 --} -- define e as a continued fraction: e :: ContinuedFraction e = undefined
287
e :: ContinuedFraction e = undefined
36
e = undefined
13
true
true
0
6
60
20
9
11
null
null
tjakway/ghcjvm
compiler/prelude/PrelNames.hs
bsd-3-clause
mconcatClassOpKey = mkPreludeMiscIdUnique 516
45
mconcatClassOpKey = mkPreludeMiscIdUnique 516
45
mconcatClassOpKey = mkPreludeMiscIdUnique 516
45
false
false
0
5
3
9
4
5
null
null
takayuki/natume
ScmParse.hs
gpl-2.0
leftparen :: Parser Token () leftparen = MkParser f where f [] = [] f ((TokenLeftParen):ts) = [((),ts)] f (_:_) = []
205
leftparen :: Parser Token () leftparen = MkParser f where f [] = [] f ((TokenLeftParen):ts) = [((),ts)] f (_:_) = []
205
leftparen = MkParser f where f [] = [] f ((TokenLeftParen):ts) = [((),ts)] f (_:_) = []
175
false
true
0
10
110
81
43
38
null
null
siddhanathan/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
randomClassName = clsQual rANDOM (fsLit "Random") randomClassKey
75
randomClassName = clsQual rANDOM (fsLit "Random") randomClassKey
75
randomClassName = clsQual rANDOM (fsLit "Random") randomClassKey
75
false
false
0
7
17
19
9
10
null
null
ezyang/ghc
testsuite/tests/codeGen/should_run/T12433.hs
bsd-3-clause
main = f 8
10
main = f 8
10
main = f 8
10
false
false
1
5
3
12
4
8
null
null
plietar/super-user-spark
src/Compiler.hs
mit
done :: SparkCompiler Bool done = fmap null $ gets state_declarations_left
74
done :: SparkCompiler Bool done = fmap null $ gets state_declarations_left
74
done = fmap null $ gets state_declarations_left
47
false
true
0
6
10
24
11
13
null
null
travitch/dalvik
src/Dalvik/Printer.hs
bsd-3-clause
dfmt :: Double -> PP.Doc dfmt d | isNaN d = "nan" | otherwise = PP.text $ fshowFFloat (Just 6) (FD d) ""
111
dfmt :: Double -> PP.Doc dfmt d | isNaN d = "nan" | otherwise = PP.text $ fshowFFloat (Just 6) (FD d) ""
111
dfmt d | isNaN d = "nan" | otherwise = PP.text $ fshowFFloat (Just 6) (FD d) ""
86
false
true
0
9
29
63
29
34
null
null
expipiplus1/vulkan
generate-new/vma/VMA/RenderParams.hs
bsd-3-clause
dropPrefix :: Text -- ^ Prefix -> Text -- ^ body -> Maybe Text -- ^ Nothing if 'body' didn't begin with 'prefix' dropPrefix p t = if p `T.isPrefixOf` T.toLower t then Just . T.dropWhile (== '_') . T.drop (T.length p) $ t else Nothing
249
dropPrefix :: Text -- ^ Prefix -> Text -- ^ body -> Maybe Text dropPrefix p t = if p `T.isPrefixOf` T.toLower t then Just . T.dropWhile (== '_') . T.drop (T.length p) $ t else Nothing
197
dropPrefix p t = if p `T.isPrefixOf` T.toLower t then Just . T.dropWhile (== '_') . T.drop (T.length p) $ t else Nothing
124
true
true
0
11
61
90
46
44
null
null
urbanslug/ghc
compiler/utils/Util.hs
bsd-3-clause
zipWith3Equal _ = zipWith3
26
zipWith3Equal _ = zipWith3
26
zipWith3Equal _ = zipWith3
26
false
false
0
5
3
9
4
5
null
null
monte-language/masque
Masque/AST.hs
gpl-3.0
getVarInt :: StateT MASTContext Get Integer getVarInt = do b <- lift getWord8 let rv = toInteger $ b .&. 0x7f if b .&. 0x80 == 0x00 then return rv else do vi <- getVarInt return $ rv .|. vi `shiftL` 7
252
getVarInt :: StateT MASTContext Get Integer getVarInt = do b <- lift getWord8 let rv = toInteger $ b .&. 0x7f if b .&. 0x80 == 0x00 then return rv else do vi <- getVarInt return $ rv .|. vi `shiftL` 7
252
getVarInt = do b <- lift getWord8 let rv = toInteger $ b .&. 0x7f if b .&. 0x80 == 0x00 then return rv else do vi <- getVarInt return $ rv .|. vi `shiftL` 7
208
false
true
1
12
93
95
44
51
null
null
brendanhay/gogol
gogol-iap/gen/Network/Google/IAP/Types/Product.hs
mpl-2.0
-- | Brands existing in the project. lbrBrands :: Lens' ListBrandsResponse [Brand] lbrBrands = lens _lbrBrands (\ s a -> s{_lbrBrands = a}) . _Default . _Coerce
174
lbrBrands :: Lens' ListBrandsResponse [Brand] lbrBrands = lens _lbrBrands (\ s a -> s{_lbrBrands = a}) . _Default . _Coerce
137
lbrBrands = lens _lbrBrands (\ s a -> s{_lbrBrands = a}) . _Default . _Coerce
91
true
true
0
11
40
53
28
25
null
null
brendanhay/gogol
gogol-cloudshell/gen/Network/Google/Resource/CloudShell/Operations/Delete.hs
mpl-2.0
-- | Upload protocol for media (e.g. \"raw\", \"multipart\"). odUploadProtocol :: Lens' OperationsDelete (Maybe Text) odUploadProtocol = lens _odUploadProtocol (\ s a -> s{_odUploadProtocol = a})
203
odUploadProtocol :: Lens' OperationsDelete (Maybe Text) odUploadProtocol = lens _odUploadProtocol (\ s a -> s{_odUploadProtocol = a})
141
odUploadProtocol = lens _odUploadProtocol (\ s a -> s{_odUploadProtocol = a})
85
true
true
1
9
33
51
25
26
null
null
tidalcycles/tidal-midi
Sound/Tidal/MIDI/Tetra.hs
gpl-3.0
(btnvel, btnvel_p) = pF "btnvel" (Just 1)
41
(btnvel, btnvel_p) = pF "btnvel" (Just 1)
41
(btnvel, btnvel_p) = pF "btnvel" (Just 1)
41
false
false
0
7
6
24
12
12
null
null
kylcarte/threepenny-extras
src/Foundation/Common.hs
bsd-3-clause
image :: String -> IO Element image source = UI.img # set UI.src source
71
image :: String -> IO Element image source = UI.img # set UI.src source
71
image source = UI.img # set UI.src source
41
false
true
0
7
13
34
16
18
null
null
gbwey/persistent
persistent-sqlite/Database/Sqlite.hs
mit
decodeError 15 = ErrorProtocol
30
decodeError 15 = ErrorProtocol
30
decodeError 15 = ErrorProtocol
30
false
false
1
5
3
13
4
9
null
null
osa1/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
defined (PParams _ _ ds) = concatMap defined ds
47
defined (PParams _ _ ds) = concatMap defined ds
47
defined (PParams _ _ ds) = concatMap defined ds
47
false
false
0
6
8
25
11
14
null
null
brendanhay/gogol
gogol-drive/gen/Network/Google/Drive/Types/Product.hs
mpl-2.0
-- | Declares a new parameter by name. cpAddtional :: Lens' ChannelParams (HashMap Text Text) cpAddtional = lens _cpAddtional (\ s a -> s{_cpAddtional = a}) . _Coerce
174
cpAddtional :: Lens' ChannelParams (HashMap Text Text) cpAddtional = lens _cpAddtional (\ s a -> s{_cpAddtional = a}) . _Coerce
135
cpAddtional = lens _cpAddtional (\ s a -> s{_cpAddtional = a}) . _Coerce
80
true
true
0
10
35
54
28
26
null
null
JustusAdam/schedule-planner
src/SchedulePlanner/Calculator/Scale.hs
lgpl-3.0
calcMaps :: [Rule] -> WeightMap calcMaps = flip calcMapsStep mempty
67
calcMaps :: [Rule] -> WeightMap calcMaps = flip calcMapsStep mempty
67
calcMaps = flip calcMapsStep mempty
35
false
true
0
7
9
29
13
16
null
null
green-haskell/ghc
compiler/utils/Outputable.hs
bsd-3-clause
pprPrefixVar :: Bool -> SDoc -> SDoc pprPrefixVar is_operator pp_v | is_operator = parens pp_v | otherwise = pp_v
119
pprPrefixVar :: Bool -> SDoc -> SDoc pprPrefixVar is_operator pp_v | is_operator = parens pp_v | otherwise = pp_v
119
pprPrefixVar is_operator pp_v | is_operator = parens pp_v | otherwise = pp_v
82
false
true
1
7
24
41
19
22
null
null
plumlife/cabal
Cabal/Distribution/Simple/Program/GHC.hs
bsd-3-clause
ghcInvocation :: ConfiguredProgram -> Compiler -> GhcOptions -> ProgramInvocation ghcInvocation prog comp opts = programInvocation prog (renderGhcOptions comp opts)
168
ghcInvocation :: ConfiguredProgram -> Compiler -> GhcOptions -> ProgramInvocation ghcInvocation prog comp opts = programInvocation prog (renderGhcOptions comp opts)
168
ghcInvocation prog comp opts = programInvocation prog (renderGhcOptions comp opts)
86
false
true
0
7
22
43
21
22
null
null
awalterschulze/xhaskell-regex-deriv
Text/Regex/Deriv/ByteString/Posix.hs
bsd-3-clause
nub2Choice :: [[(Pat, Int -> SBinder -> SBinder)]] -> M.Map Pat (Int -> SBinder -> SBinder) -> [(Pat, Int -> SBinder -> SBinder)] -- the return type is a singleton list. nub2Choice [] _ = return (PChoice [] Greedy, (\_ !sb -> {-# SCC "nubChoice/id0" #-} sb ))
259
nub2Choice :: [[(Pat, Int -> SBinder -> SBinder)]] -> M.Map Pat (Int -> SBinder -> SBinder) -> [(Pat, Int -> SBinder -> SBinder)] nub2Choice [] _ = return (PChoice [] Greedy, (\_ !sb -> {-# SCC "nubChoice/id0" #-} sb ))
219
nub2Choice [] _ = return (PChoice [] Greedy, (\_ !sb -> {-# SCC "nubChoice/id0" #-} sb ))
89
true
true
0
10
47
110
60
50
null
null
gonimo/gonimo-back
src/Gonimo/Server/Error.hs
agpl-3.0
getServantErr AlreadyFamilyMember = err409
47
getServantErr AlreadyFamilyMember = err409
47
getServantErr AlreadyFamilyMember = err409
47
false
false
0
5
8
9
4
5
null
null
nightuser/parensprinter
src/PrinterParser.hs
mit
identifier :: Syntax delta => delta String identifier = subset (`notElem` keywords) . cons <$> letter <*> many (letter <|> digit)
129
identifier :: Syntax delta => delta String identifier = subset (`notElem` keywords) . cons <$> letter <*> many (letter <|> digit)
129
identifier = subset (`notElem` keywords) . cons <$> letter <*> many (letter <|> digit)
86
false
true
0
9
20
52
27
25
null
null
vito/atomo
src/Atomo/Method.hs
bsd-3-clause
comparePrecision (PHeadTail _ _) _ = LT
39
comparePrecision (PHeadTail _ _) _ = LT
39
comparePrecision (PHeadTail _ _) _ = LT
39
false
false
0
7
6
19
9
10
null
null
jtojnar/haste-compiler
libraries/ghc-7.10/base/GHC/Conc/Sync.hs
bsd-3-clause
{- | 'killThread' raises the 'ThreadKilled' exception in the given thread (GHC only). > killThread tid = throwTo tid ThreadKilled -} killThread :: ThreadId -> IO () killThread tid = throwTo tid ThreadKilled
208
killThread :: ThreadId -> IO () killThread tid = throwTo tid ThreadKilled
73
killThread tid = throwTo tid ThreadKilled
41
true
true
0
7
34
29
14
15
null
null
gridaphobe/target
bench/RBTreeCoverage.hs
mit
mapPool max f xs = do sem <- new max mapConcurrently (with sem . f) xs -- checkMany :: GhcSpec -> Handle -> IO [(Int, Double, Outcome)]
140
mapPool max f xs = do sem <- new max mapConcurrently (with sem . f) xs -- checkMany :: GhcSpec -> Handle -> IO [(Int, Double, Outcome)]
140
mapPool max f xs = do sem <- new max mapConcurrently (with sem . f) xs -- checkMany :: GhcSpec -> Handle -> IO [(Int, Double, Outcome)]
140
false
false
0
10
31
42
19
23
null
null
spire/spire
src/Spire/Canonical/Evaluator.hs
bsd-3-clause
sub2 :: Bind Nom2 Value -> (Value , Value) -> SpireM Value sub2 b (x1 , x2) = do ((nm1 , nm2) , f) <- unbind b substsM [(nm1 , x1) , (nm2 , x2)] f
150
sub2 :: Bind Nom2 Value -> (Value , Value) -> SpireM Value sub2 b (x1 , x2) = do ((nm1 , nm2) , f) <- unbind b substsM [(nm1 , x1) , (nm2 , x2)] f
150
sub2 b (x1 , x2) = do ((nm1 , nm2) , f) <- unbind b substsM [(nm1 , x1) , (nm2 , x2)] f
91
false
true
0
9
39
92
50
42
null
null
harendra-kumar/unicode-transforms
unicode-data/UCD2Haskell.hs
bsd-3-clause
processFile :: FilePath -> FilePath -> IO () processFile src outdir = do props <- (readSavedProps dst `catch` \(_e::IOException) -> xmlToProps src dst) -- print $ length props emitFile "Decomposable" $ genDecomposable Canonical props emitFile "DecomposableK" $ genDecomposable Kompat props emitFile "Decompositions" $ genDecompositions props emitFile "DecompositionsK" $ genDecompositionsK props emitFile "DecompositionsK2" $ genDecompositionsK2 props emitFile "Compositions" $ genCompositions props emitFile "CombiningClass" $ genCombiningClass props where -- properties db file dst = src -<.> ".pdb" emitFile name gen = writeFile (outdir <> "/" <> name <> ".hs") $ gen name
789
processFile :: FilePath -> FilePath -> IO () processFile src outdir = do props <- (readSavedProps dst `catch` \(_e::IOException) -> xmlToProps src dst) -- print $ length props emitFile "Decomposable" $ genDecomposable Canonical props emitFile "DecomposableK" $ genDecomposable Kompat props emitFile "Decompositions" $ genDecompositions props emitFile "DecompositionsK" $ genDecompositionsK props emitFile "DecompositionsK2" $ genDecompositionsK2 props emitFile "Compositions" $ genCompositions props emitFile "CombiningClass" $ genCombiningClass props where -- properties db file dst = src -<.> ".pdb" emitFile name gen = writeFile (outdir <> "/" <> name <> ".hs") $ gen name
789
processFile src outdir = do props <- (readSavedProps dst `catch` \(_e::IOException) -> xmlToProps src dst) -- print $ length props emitFile "Decomposable" $ genDecomposable Canonical props emitFile "DecomposableK" $ genDecomposable Kompat props emitFile "Decompositions" $ genDecompositions props emitFile "DecompositionsK" $ genDecompositionsK props emitFile "DecompositionsK2" $ genDecompositionsK2 props emitFile "Compositions" $ genCompositions props emitFile "CombiningClass" $ genCombiningClass props where -- properties db file dst = src -<.> ".pdb" emitFile name gen = writeFile (outdir <> "/" <> name <> ".hs") $ gen name
744
false
true
1
12
203
209
95
114
null
null
ezyang/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
exprCtOrigin (HsArrApp {}) = panic "exprCtOrigin HsArrApp"
63
exprCtOrigin (HsArrApp {}) = panic "exprCtOrigin HsArrApp"
63
exprCtOrigin (HsArrApp {}) = panic "exprCtOrigin HsArrApp"
63
false
false
0
6
11
20
9
11
null
null
denibertovic/haskell
kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs
bsd-3-clause
-- | 'v1CSIPersistentVolumeSourceReadOnly' Lens v1CSIPersistentVolumeSourceReadOnlyL :: Lens_' V1CSIPersistentVolumeSource (Maybe Bool) v1CSIPersistentVolumeSourceReadOnlyL f V1CSIPersistentVolumeSource{..} = (\v1CSIPersistentVolumeSourceReadOnly -> V1CSIPersistentVolumeSource { v1CSIPersistentVolumeSourceReadOnly, ..} ) <$> f v1CSIPersistentVolumeSourceReadOnly
364
v1CSIPersistentVolumeSourceReadOnlyL :: Lens_' V1CSIPersistentVolumeSource (Maybe Bool) v1CSIPersistentVolumeSourceReadOnlyL f V1CSIPersistentVolumeSource{..} = (\v1CSIPersistentVolumeSourceReadOnly -> V1CSIPersistentVolumeSource { v1CSIPersistentVolumeSourceReadOnly, ..} ) <$> f v1CSIPersistentVolumeSourceReadOnly
316
v1CSIPersistentVolumeSourceReadOnlyL f V1CSIPersistentVolumeSource{..} = (\v1CSIPersistentVolumeSourceReadOnly -> V1CSIPersistentVolumeSource { v1CSIPersistentVolumeSourceReadOnly, ..} ) <$> f v1CSIPersistentVolumeSourceReadOnly
228
true
true
0
8
23
57
30
27
null
null
shlevy/ghc
compiler/basicTypes/Module.hs
bsd-3-clause
extendModuleEnv :: ModuleEnv a -> Module -> a -> ModuleEnv a extendModuleEnv (ModuleEnv e) m x = ModuleEnv (Map.insert (NDModule m) x e)
136
extendModuleEnv :: ModuleEnv a -> Module -> a -> ModuleEnv a extendModuleEnv (ModuleEnv e) m x = ModuleEnv (Map.insert (NDModule m) x e)
136
extendModuleEnv (ModuleEnv e) m x = ModuleEnv (Map.insert (NDModule m) x e)
75
false
true
0
9
22
63
30
33
null
null
zeekay/lambdabot
Plugin/Quote/Text.hs
mit
-- -- Actual quotes from an asshat called Keal over Jan 12-14 2006. -- -- Reappared as OrangeKid, -- 06.10.18:19:44:00 --- join: OrangeKid -- (n=TRK@unaffiliated/Keal) joined #haskell -- kealList :: [String] kealList = ["endian mirrors the decimal" ,"primary elemental assumption of integer coefficients to roots in counting sytem is wrong" ,"actually it bug in math" ,"b*(Floor[v/b^p]/b-Floor[Floor[v/b^p]/b])" ,"proofs are no longer sound" ,"my proof show math is broken right now" ,"doctor just give meds not fix prollem" ,"Keal was so happy with T, coded in basic so run on anything, and does lot" ,"one prollem. T broke confines of the visual basic langage and would not compile" ,"perhaps i just genius and never tested" ,"and yes that was with zero formal training in all realms" ,"somone would expect that trees 500gb hdds of expressions as if they were floppy dicks" ,"can you make a macro that builds the expression accoridng to a genetic algorithm where you decide what is good and what is bad?" ,"T could perform expressions 600mb and bigger" ,"what is the max amount of operands haskell can handle in a single expression?" ,"T seems to be haskell, except with a decent interface at this point" ,"love a black and white lower 128 from 32 up of ascii glyphs?" ,"evaluating expressions is ALL haskell does?????" ,"you think i am one of them persnipity uppity men are pig lesbian mathematicians?" ,"how bout i say ick no unicorn and daisy loving girl mathematician will ever enjoy this" ,"better be atleast 16x16 color with extended ascii set" ,"what the hell does Prelude > mean?" ,"how do i search for someone saying 'Keal' in mirc" ,"i have basically written a proof that shows an assumption is wrong" ,"they dumbified you" ,"antiparsimony were 100% correct..." ,"its because the timeline diverges and past events themselves unhappen" ,"all i know is i have experienced my own death unhappening..." ," what have you been smoking? you narrow minded Haskell user?" ,"i use an 8088" ,"are there full body recognition files for sorting art?" ,"my very first computer was an 80-0840" ,"it is very easy to go off topic" ,"someone needs to write a boids for haskell that emulates humans going on and off topic" ,"i just got banned from math because i not have good ability to convey thoughts" ,"i lack in verbal and social expression" ,"i try make program called Glyph to do it but my script lang called T too slow. i invent T" ,"can GMP support KealDigit? I invent KealDigit" ,"with KealDigit quantum crackproof encryption possible" ,"i show how spell triangle in less than three corners using darkmanifold" ,"can haskell pipe the raw irrational megaequation into an analog device" ,"the fractal is 5 irrationals" ,"99% of my book has been erased by faulty hdd's" ,"last day i was in my lab i had a diagram which might have removed pi" ,"i only trust opensource tools. where can i download haskell for windows?" ,"obviously you never heard of Tier. theoretically it would work using nanobots" ,"you need a Zh function in Haskell" ,"can haskell compile flash animations and java apps?" ,"i need math friendly compiler to compile for jvm or flash" ,"Cale etc already pointed out Haskell is puny to nothing to emulate using my barrage of mathematic theories" ,"i prove infinity never ends in both directions" ,"are you saying i am MegaMonad?" ,"Keal angry @ dons" ,"i can explain why something is without knowing what the rules decided by man are" ,"making a bot of me is highly offensive" ,"just seeing how offtopic i could get everyone" ,"intuitive != imperative" ,"doubles and floats cause b*(Floor[v/b^p]/b-Floor[Floor[v/b^p]/b) to fuck up" ,"what are epsilons?" ,"haskell always said undefined" ,"bot seems useless" ,"when i put what i dat recoved from that tile into a ti92. the damn thing blew up" ,"i think it because mathematics damage you cpu" ,"ithink has to do with hardcased government failsafe in chip" ,"i suggest you tear apart a 20q and plug it with the alg" ,"nsa has all the profiling info you need to come up with the correct survey answers" ,"write an algorthim that generates the correct responses for a phone survey based on number of rings whether answered how quickly hung up on and the mood of the receiver" ,"where can i find opensource schematics of Linus Torvalds' x86 clone?" ,"need to plan a fieldtrip to Frederick B. Mancoff of Freescale Semiconductor" ,"ghc need to have plugin that allow copy paste in xp" ,"know you know this 24 periods Keal SecretTM" ,"tomorrow i share next mathematical secrety" ,"nsa prevent me from returning to math on efnet" ,"nsa try kill me numerous times" ,"#haskell needs to take its meds" ,"i think i know what code does but code looks to simple to actually do it" ,"need 1 to do a while 0 does !a. need 1 to do a while 0 does !a" ,"will it return [] if map gives fpu infinite list?" ,"today's 24hour project was supposed to be logical overloading using plegm method" ,"there is no way to prove the failsafe exists" ,"oh btw my fpu is blown due to a hardcased failsafe i have 3 year warranty right. and then they call fads" ,"i aint running that on my puter" ,"lamadabot took 5 to 8 whole seconds to return []" ,"bot defective" ,"i changed my user od" ,"i cant think anymore" ,"i want to invent white dye" ,"pork steaks taste like dick" ,"i dont really eat vegetables unless cheese is a vegetable" ,"the [nsa] even make light green both ways once" ,"i still dont understand how gci is supposed to do anything other than mathematics" ]
5,868
kealList :: [String] kealList = ["endian mirrors the decimal" ,"primary elemental assumption of integer coefficients to roots in counting sytem is wrong" ,"actually it bug in math" ,"b*(Floor[v/b^p]/b-Floor[Floor[v/b^p]/b])" ,"proofs are no longer sound" ,"my proof show math is broken right now" ,"doctor just give meds not fix prollem" ,"Keal was so happy with T, coded in basic so run on anything, and does lot" ,"one prollem. T broke confines of the visual basic langage and would not compile" ,"perhaps i just genius and never tested" ,"and yes that was with zero formal training in all realms" ,"somone would expect that trees 500gb hdds of expressions as if they were floppy dicks" ,"can you make a macro that builds the expression accoridng to a genetic algorithm where you decide what is good and what is bad?" ,"T could perform expressions 600mb and bigger" ,"what is the max amount of operands haskell can handle in a single expression?" ,"T seems to be haskell, except with a decent interface at this point" ,"love a black and white lower 128 from 32 up of ascii glyphs?" ,"evaluating expressions is ALL haskell does?????" ,"you think i am one of them persnipity uppity men are pig lesbian mathematicians?" ,"how bout i say ick no unicorn and daisy loving girl mathematician will ever enjoy this" ,"better be atleast 16x16 color with extended ascii set" ,"what the hell does Prelude > mean?" ,"how do i search for someone saying 'Keal' in mirc" ,"i have basically written a proof that shows an assumption is wrong" ,"they dumbified you" ,"antiparsimony were 100% correct..." ,"its because the timeline diverges and past events themselves unhappen" ,"all i know is i have experienced my own death unhappening..." ," what have you been smoking? you narrow minded Haskell user?" ,"i use an 8088" ,"are there full body recognition files for sorting art?" ,"my very first computer was an 80-0840" ,"it is very easy to go off topic" ,"someone needs to write a boids for haskell that emulates humans going on and off topic" ,"i just got banned from math because i not have good ability to convey thoughts" ,"i lack in verbal and social expression" ,"i try make program called Glyph to do it but my script lang called T too slow. i invent T" ,"can GMP support KealDigit? I invent KealDigit" ,"with KealDigit quantum crackproof encryption possible" ,"i show how spell triangle in less than three corners using darkmanifold" ,"can haskell pipe the raw irrational megaequation into an analog device" ,"the fractal is 5 irrationals" ,"99% of my book has been erased by faulty hdd's" ,"last day i was in my lab i had a diagram which might have removed pi" ,"i only trust opensource tools. where can i download haskell for windows?" ,"obviously you never heard of Tier. theoretically it would work using nanobots" ,"you need a Zh function in Haskell" ,"can haskell compile flash animations and java apps?" ,"i need math friendly compiler to compile for jvm or flash" ,"Cale etc already pointed out Haskell is puny to nothing to emulate using my barrage of mathematic theories" ,"i prove infinity never ends in both directions" ,"are you saying i am MegaMonad?" ,"Keal angry @ dons" ,"i can explain why something is without knowing what the rules decided by man are" ,"making a bot of me is highly offensive" ,"just seeing how offtopic i could get everyone" ,"intuitive != imperative" ,"doubles and floats cause b*(Floor[v/b^p]/b-Floor[Floor[v/b^p]/b) to fuck up" ,"what are epsilons?" ,"haskell always said undefined" ,"bot seems useless" ,"when i put what i dat recoved from that tile into a ti92. the damn thing blew up" ,"i think it because mathematics damage you cpu" ,"ithink has to do with hardcased government failsafe in chip" ,"i suggest you tear apart a 20q and plug it with the alg" ,"nsa has all the profiling info you need to come up with the correct survey answers" ,"write an algorthim that generates the correct responses for a phone survey based on number of rings whether answered how quickly hung up on and the mood of the receiver" ,"where can i find opensource schematics of Linus Torvalds' x86 clone?" ,"need to plan a fieldtrip to Frederick B. Mancoff of Freescale Semiconductor" ,"ghc need to have plugin that allow copy paste in xp" ,"know you know this 24 periods Keal SecretTM" ,"tomorrow i share next mathematical secrety" ,"nsa prevent me from returning to math on efnet" ,"nsa try kill me numerous times" ,"#haskell needs to take its meds" ,"i think i know what code does but code looks to simple to actually do it" ,"need 1 to do a while 0 does !a. need 1 to do a while 0 does !a" ,"will it return [] if map gives fpu infinite list?" ,"today's 24hour project was supposed to be logical overloading using plegm method" ,"there is no way to prove the failsafe exists" ,"oh btw my fpu is blown due to a hardcased failsafe i have 3 year warranty right. and then they call fads" ,"i aint running that on my puter" ,"lamadabot took 5 to 8 whole seconds to return []" ,"bot defective" ,"i changed my user od" ,"i cant think anymore" ,"i want to invent white dye" ,"pork steaks taste like dick" ,"i dont really eat vegetables unless cheese is a vegetable" ,"the [nsa] even make light green both ways once" ,"i still dont understand how gci is supposed to do anything other than mathematics" ]
5,681
kealList = ["endian mirrors the decimal" ,"primary elemental assumption of integer coefficients to roots in counting sytem is wrong" ,"actually it bug in math" ,"b*(Floor[v/b^p]/b-Floor[Floor[v/b^p]/b])" ,"proofs are no longer sound" ,"my proof show math is broken right now" ,"doctor just give meds not fix prollem" ,"Keal was so happy with T, coded in basic so run on anything, and does lot" ,"one prollem. T broke confines of the visual basic langage and would not compile" ,"perhaps i just genius and never tested" ,"and yes that was with zero formal training in all realms" ,"somone would expect that trees 500gb hdds of expressions as if they were floppy dicks" ,"can you make a macro that builds the expression accoridng to a genetic algorithm where you decide what is good and what is bad?" ,"T could perform expressions 600mb and bigger" ,"what is the max amount of operands haskell can handle in a single expression?" ,"T seems to be haskell, except with a decent interface at this point" ,"love a black and white lower 128 from 32 up of ascii glyphs?" ,"evaluating expressions is ALL haskell does?????" ,"you think i am one of them persnipity uppity men are pig lesbian mathematicians?" ,"how bout i say ick no unicorn and daisy loving girl mathematician will ever enjoy this" ,"better be atleast 16x16 color with extended ascii set" ,"what the hell does Prelude > mean?" ,"how do i search for someone saying 'Keal' in mirc" ,"i have basically written a proof that shows an assumption is wrong" ,"they dumbified you" ,"antiparsimony were 100% correct..." ,"its because the timeline diverges and past events themselves unhappen" ,"all i know is i have experienced my own death unhappening..." ," what have you been smoking? you narrow minded Haskell user?" ,"i use an 8088" ,"are there full body recognition files for sorting art?" ,"my very first computer was an 80-0840" ,"it is very easy to go off topic" ,"someone needs to write a boids for haskell that emulates humans going on and off topic" ,"i just got banned from math because i not have good ability to convey thoughts" ,"i lack in verbal and social expression" ,"i try make program called Glyph to do it but my script lang called T too slow. i invent T" ,"can GMP support KealDigit? I invent KealDigit" ,"with KealDigit quantum crackproof encryption possible" ,"i show how spell triangle in less than three corners using darkmanifold" ,"can haskell pipe the raw irrational megaequation into an analog device" ,"the fractal is 5 irrationals" ,"99% of my book has been erased by faulty hdd's" ,"last day i was in my lab i had a diagram which might have removed pi" ,"i only trust opensource tools. where can i download haskell for windows?" ,"obviously you never heard of Tier. theoretically it would work using nanobots" ,"you need a Zh function in Haskell" ,"can haskell compile flash animations and java apps?" ,"i need math friendly compiler to compile for jvm or flash" ,"Cale etc already pointed out Haskell is puny to nothing to emulate using my barrage of mathematic theories" ,"i prove infinity never ends in both directions" ,"are you saying i am MegaMonad?" ,"Keal angry @ dons" ,"i can explain why something is without knowing what the rules decided by man are" ,"making a bot of me is highly offensive" ,"just seeing how offtopic i could get everyone" ,"intuitive != imperative" ,"doubles and floats cause b*(Floor[v/b^p]/b-Floor[Floor[v/b^p]/b) to fuck up" ,"what are epsilons?" ,"haskell always said undefined" ,"bot seems useless" ,"when i put what i dat recoved from that tile into a ti92. the damn thing blew up" ,"i think it because mathematics damage you cpu" ,"ithink has to do with hardcased government failsafe in chip" ,"i suggest you tear apart a 20q and plug it with the alg" ,"nsa has all the profiling info you need to come up with the correct survey answers" ,"write an algorthim that generates the correct responses for a phone survey based on number of rings whether answered how quickly hung up on and the mood of the receiver" ,"where can i find opensource schematics of Linus Torvalds' x86 clone?" ,"need to plan a fieldtrip to Frederick B. Mancoff of Freescale Semiconductor" ,"ghc need to have plugin that allow copy paste in xp" ,"know you know this 24 periods Keal SecretTM" ,"tomorrow i share next mathematical secrety" ,"nsa prevent me from returning to math on efnet" ,"nsa try kill me numerous times" ,"#haskell needs to take its meds" ,"i think i know what code does but code looks to simple to actually do it" ,"need 1 to do a while 0 does !a. need 1 to do a while 0 does !a" ,"will it return [] if map gives fpu infinite list?" ,"today's 24hour project was supposed to be logical overloading using plegm method" ,"there is no way to prove the failsafe exists" ,"oh btw my fpu is blown due to a hardcased failsafe i have 3 year warranty right. and then they call fads" ,"i aint running that on my puter" ,"lamadabot took 5 to 8 whole seconds to return []" ,"bot defective" ,"i changed my user od" ,"i cant think anymore" ,"i want to invent white dye" ,"pork steaks taste like dick" ,"i dont really eat vegetables unless cheese is a vegetable" ,"the [nsa] even make light green both ways once" ,"i still dont understand how gci is supposed to do anything other than mathematics" ]
5,660
true
true
0
5
1,305
293
196
97
null
null
LinusU/fbthrift
thrift/compiler/test/fixtures/namespace/gen-hs/TestService_Fuzzer.hs
apache-2.0
-- Fuzzers and exception handlers init_fuzzer :: Options -> IO () init_fuzzer opts = do a1 <- Applicative.ZipList <$> inf_Int_Int64 _ <- forM (Applicative.getZipList a1) init_fuzzFunc return () where init_fuzzFunc a1 = let param = (a1) in if opt_framed opts then withThriftDo opts (withFramedTransport opts) (init_fuzzOnce param) (init_exceptionHandler param) else withThriftDo opts (withHandle opts) (init_fuzzOnce param) (init_exceptionHandler param)
474
init_fuzzer :: Options -> IO () init_fuzzer opts = do a1 <- Applicative.ZipList <$> inf_Int_Int64 _ <- forM (Applicative.getZipList a1) init_fuzzFunc return () where init_fuzzFunc a1 = let param = (a1) in if opt_framed opts then withThriftDo opts (withFramedTransport opts) (init_fuzzOnce param) (init_exceptionHandler param) else withThriftDo opts (withHandle opts) (init_fuzzOnce param) (init_exceptionHandler param)
440
init_fuzzer opts = do a1 <- Applicative.ZipList <$> inf_Int_Int64 _ <- forM (Applicative.getZipList a1) init_fuzzFunc return () where init_fuzzFunc a1 = let param = (a1) in if opt_framed opts then withThriftDo opts (withFramedTransport opts) (init_fuzzOnce param) (init_exceptionHandler param) else withThriftDo opts (withHandle opts) (init_fuzzOnce param) (init_exceptionHandler param)
408
true
true
0
11
79
155
74
81
null
null
mathhun/stack
src/Stack/Types/Package.hs
bsd-3-clause
dotCabalModulePath _ = Nothing
30
dotCabalModulePath _ = Nothing
30
dotCabalModulePath _ = Nothing
30
false
false
0
5
3
9
4
5
null
null
SonOfLilit/purewars
Game.hs
bsd-3-clause
screenHeight = 480
18
screenHeight = 480
18
screenHeight = 480
18
false
false
1
5
2
10
3
7
null
null
kmels/hledger
hledger-lib/Hledger/Data/Amount.hs
gpl-3.0
maxprecision :: Int maxprecision = 999998
41
maxprecision :: Int maxprecision = 999998
41
maxprecision = 999998
21
false
true
0
4
5
11
6
5
null
null
bkoropoff/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
discard :: Monad m => m a -> m () discard f = f >> return ()
60
discard :: Monad m => m a -> m () discard f = f >> return ()
60
discard f = f >> return ()
26
false
true
2
9
16
48
20
28
null
null
nitrix/lspace
legacy/World.hs
unlicense
-- TODO: higher-order "atObject" would be nice worldAtObjectAddObject :: Link Object -> Link Object -> Game () worldAtObjectAddObject targetLink whatLink = do worldCoord <- worldObjectLocation targetLink worldAddObject whatLink worldCoord
246
worldAtObjectAddObject :: Link Object -> Link Object -> Game () worldAtObjectAddObject targetLink whatLink = do worldCoord <- worldObjectLocation targetLink worldAddObject whatLink worldCoord
199
worldAtObjectAddObject targetLink whatLink = do worldCoord <- worldObjectLocation targetLink worldAddObject whatLink worldCoord
135
true
true
0
8
36
54
24
30
null
null
cbaatz/hamu8080
src/Hamu8080/Compute.hs
mit
-- OR A, C doOp 0xB2 = liftM2 (.|.) (getReg A) (getReg D) >>= setResult
71
doOp 0xB2 = liftM2 (.|.) (getReg A) (getReg D) >>= setResult
60
doOp 0xB2 = liftM2 (.|.) (getReg A) (getReg D) >>= setResult
60
true
false
0
8
14
35
18
17
null
null
NorfairKing/the-notes
src/Cryptography/MACs.hs
gpl-2.0
encryptThenMACDefinition :: Note encryptThenMACDefinition = de $ do lab encryptThenMACDefinitionLabel s [the, encryptThenMAC', "(" <> etM' <> ")", "approach uses a", symmetricCryptosystem, m scs_, "with", messageSpace, m msp_ <> ",", keySpace, m ksp_, and, ciphertextSpace, m csp_, anda, mAC, m mfn_, "with", messageSpace, m csp_, and, keySpace, m ksp_, "as follows"] let mesg = "m" tag = "t" ciph = "c" s ["First the", plaintext, m mesg, "is encrypted to", m ciph <> ", then a", mAC, m tag, "is produced based on the resulting", ciphertext] s [the, "result is the tuple", m $ tuple ciph tag] tikzFig encryptThenMAC [] $ raw $ [litFile|src/Cryptography/MACs/encryptThenMACTikZ.tex|]
722
encryptThenMACDefinition :: Note encryptThenMACDefinition = de $ do lab encryptThenMACDefinitionLabel s [the, encryptThenMAC', "(" <> etM' <> ")", "approach uses a", symmetricCryptosystem, m scs_, "with", messageSpace, m msp_ <> ",", keySpace, m ksp_, and, ciphertextSpace, m csp_, anda, mAC, m mfn_, "with", messageSpace, m csp_, and, keySpace, m ksp_, "as follows"] let mesg = "m" tag = "t" ciph = "c" s ["First the", plaintext, m mesg, "is encrypted to", m ciph <> ", then a", mAC, m tag, "is produced based on the resulting", ciphertext] s [the, "result is the tuple", m $ tuple ciph tag] tikzFig encryptThenMAC [] $ raw $ [litFile|src/Cryptography/MACs/encryptThenMACTikZ.tex|]
722
encryptThenMACDefinition = de $ do lab encryptThenMACDefinitionLabel s [the, encryptThenMAC', "(" <> etM' <> ")", "approach uses a", symmetricCryptosystem, m scs_, "with", messageSpace, m msp_ <> ",", keySpace, m ksp_, and, ciphertextSpace, m csp_, anda, mAC, m mfn_, "with", messageSpace, m csp_, and, keySpace, m ksp_, "as follows"] let mesg = "m" tag = "t" ciph = "c" s ["First the", plaintext, m mesg, "is encrypted to", m ciph <> ", then a", mAC, m tag, "is produced based on the resulting", ciphertext] s [the, "result is the tuple", m $ tuple ciph tag] tikzFig encryptThenMAC [] $ raw $ [litFile|src/Cryptography/MACs/encryptThenMACTikZ.tex|]
689
false
true
0
11
143
243
132
111
null
null
nstott/GradeLevel
src/NLP/Syllables.hs
bsd-3-clause
isVowel (x:_) = x `elem` vowels
31
isVowel (x:_) = x `elem` vowels
31
isVowel (x:_) = x `elem` vowels
31
false
false
0
6
5
26
13
13
null
null
joom/Guguk
src/Guguk/Tokenization/SentenceBoundary.hs
mit
squishBy :: (String -> String-> Bool) -> [String] -> [String] squishBy _ [] = []
84
squishBy :: (String -> String-> Bool) -> [String] -> [String] squishBy _ [] = []
84
squishBy _ [] = []
22
false
true
0
8
18
45
24
21
null
null
narurien/ganeti-ceph
src/Ganeti/Utils.hs
gpl-2.0
-- | Resolves a numeric address. resolveAddr :: Int -> String -> IO (Result (Family, SockAddr)) resolveAddr port str = do resolved <- getAddrInfo resolveAddrHints (Just str) (Just (show port)) return $ case resolved of [] -> Bad "Invalid results from lookup?" best:_ -> Ok (addrFamily best, addrAddress best) -- | Set the owner and the group of a file (given as names, not numeric id).
416
resolveAddr :: Int -> String -> IO (Result (Family, SockAddr)) resolveAddr port str = do resolved <- getAddrInfo resolveAddrHints (Just str) (Just (show port)) return $ case resolved of [] -> Bad "Invalid results from lookup?" best:_ -> Ok (addrFamily best, addrAddress best) -- | Set the owner and the group of a file (given as names, not numeric id).
383
resolveAddr port str = do resolved <- getAddrInfo resolveAddrHints (Just str) (Just (show port)) return $ case resolved of [] -> Bad "Invalid results from lookup?" best:_ -> Ok (addrFamily best, addrAddress best) -- | Set the owner and the group of a file (given as names, not numeric id).
320
true
true
0
13
96
120
59
61
null
null
GaloisInc/halvm-ghc
compiler/types/Type.hs
bsd-3-clause
-- | Take a forall type apart, or panics if that is not possible. splitForAllTy :: Type -> (TyVar, Type) splitForAllTy ty | Just answer <- splitForAllTy_maybe ty = answer | otherwise = pprPanic "splitForAllTy" (ppr ty)
250
splitForAllTy :: Type -> (TyVar, Type) splitForAllTy ty | Just answer <- splitForAllTy_maybe ty = answer | otherwise = pprPanic "splitForAllTy" (ppr ty)
184
splitForAllTy ty | Just answer <- splitForAllTy_maybe ty = answer | otherwise = pprPanic "splitForAllTy" (ppr ty)
145
true
true
1
9
68
64
30
34
null
null
bgold-cosmos/Tidal
src/Sound/Tidal/Params.hs
gpl-3.0
delaybus :: Pattern Int -> Pattern Double -> ControlPattern delaybus busid pat = (pF "delay" pat) # (pI "^delay" busid)
119
delaybus :: Pattern Int -> Pattern Double -> ControlPattern delaybus busid pat = (pF "delay" pat) # (pI "^delay" busid)
119
delaybus busid pat = (pF "delay" pat) # (pI "^delay" busid)
59
false
true
2
8
19
57
25
32
null
null
andyarvanitis/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
showEnvDbg env t = showEnv' env t True
38
showEnvDbg env t = showEnv' env t True
38
showEnvDbg env t = showEnv' env t True
38
false
false
1
5
7
25
8
17
null
null
stain/jdk8u
src/macosx/native/jobjc/src/core/PrimitiveCoder.hs
gpl-2.0
capitalize s = [toUpper $ head s] ++ tail s
43
capitalize s = [toUpper $ head s] ++ tail s
43
capitalize s = [toUpper $ head s] ++ tail s
43
false
false
1
8
9
29
12
17
null
null
dsorokin/aivika-experiment
Simulation/Aivika/Experiment/Base/ExperimentSpecsWriter.hs
bsd-3-clause
ethodName RungeKutta2 = experimentSpecsRungeKutta2Text
55
methodName RungeKutta2 = experimentSpecsRungeKutta2Text
55
methodName RungeKutta2 = experimentSpecsRungeKutta2Text
55
false
false
0
5
4
9
4
5
null
null
OpenXT/manager
xenmgr/Vm/Monitor.hs
gpl-2.0
submitVmEvent :: VmMonitor -> VmEvent -> Rpc () submitVmEvent m e = liftIO $ (vmm_submit m) e
93
submitVmEvent :: VmMonitor -> VmEvent -> Rpc () submitVmEvent m e = liftIO $ (vmm_submit m) e
93
submitVmEvent m e = liftIO $ (vmm_submit m) e
45
false
true
0
8
16
42
20
22
null
null
jfranklin9000/urbit
pkg/hs/proto/lib/Untyped/Parser.hs
mit
rune0 ∷ a → Parser a rune0 = pure
33
rune0 ∷ a → Parser a rune0 = pure
33
rune0 = pure
12
false
true
0
6
8
18
9
9
null
null
spechub/Hets
Common/Keywords.hs
gpl-2.0
lambdaS :: String lambdaS = "lambda"
36
lambdaS :: String lambdaS = "lambda"
36
lambdaS = "lambda"
18
false
true
0
6
5
18
7
11
null
null
snoyberg/ghc
libraries/base/GHC/List.hs
bsd-3-clause
-- | Test whether a list is empty. null :: [a] -> Bool null [] = True
105
null :: [a] -> Bool null [] = True
70
null [] = True
31
true
true
0
6
52
24
13
11
null
null
siddhanathan/ghc
compiler/prelude/THNames.hs
bsd-3-clause
phantomRName = libFun (fsLit "phantomR") phantomRIdKey
72
phantomRName = libFun (fsLit "phantomR") phantomRIdKey
72
phantomRName = libFun (fsLit "phantomR") phantomRIdKey
72
false
false
0
7
23
17
8
9
null
null
bordaigorl/jamesbound
src/Language/PiCalc/Parser.hs
gpl-2.0
piLang = javaStyle { P.commentLine = "//" , P.caseSensitive = True , P.identStart = lower <|> oneOf "'_" -- identifiers are only names, process variables are treated separately -- , P.identLetter = alphaNum <|> oneOf "_':" , P.opLetter = oneOf "" -- no custom operators in this language! , P.reservedOpNames = ["|", "‖", "+", "!", "?",":=", "*"] , P.reservedNames = ["new", "ν", "zero", "tau", "τ", "#global"] }
527
piLang = javaStyle { P.commentLine = "//" , P.caseSensitive = True , P.identStart = lower <|> oneOf "'_" -- identifiers are only names, process variables are treated separately -- , P.identLetter = alphaNum <|> oneOf "_':" , P.opLetter = oneOf "" -- no custom operators in this language! , P.reservedOpNames = ["|", "‖", "+", "!", "?",":=", "*"] , P.reservedNames = ["new", "ν", "zero", "tau", "τ", "#global"] }
527
piLang = javaStyle { P.commentLine = "//" , P.caseSensitive = True , P.identStart = lower <|> oneOf "'_" -- identifiers are only names, process variables are treated separately -- , P.identLetter = alphaNum <|> oneOf "_':" , P.opLetter = oneOf "" -- no custom operators in this language! , P.reservedOpNames = ["|", "‖", "+", "!", "?",":=", "*"] , P.reservedNames = ["new", "ν", "zero", "tau", "τ", "#global"] }
527
false
false
0
8
182
108
67
41
null
null
amar47shah/summer-2015-haskell-class
Lab1.hs
mit
-- Defining a function, `oneThirdRoundingUp`, that will be used later on. oneThirdRoundingUp :: Int -> Int oneThirdRoundingUp n = (n + 2) `quot` 3
147
oneThirdRoundingUp :: Int -> Int oneThirdRoundingUp n = (n + 2) `quot` 3
72
oneThirdRoundingUp n = (n + 2) `quot` 3
39
true
true
0
7
24
32
18
14
null
null
kawu/factorized-tag-parser
tests/TestSet.hs
bsd-2-clause
gram2Tests :: [Test] gram2Tests = [ test "S" ("a b e a b") Yes , test "S" ("a b e a a") No , test "S" ("a b a b a b a b e a b a b a b a b") Yes , test "S" ("a b a b a b a b e a b a b a b a") No #ifdef NoAdjunctionRestriction #else -- Only fails if multiple adjunction is not allowed , test "S" ("a b e b a") No #endif , test "S" ("b e a") No , test "S" ("a b a b") No ] where test start sent res = Test start (toks sent) M.empty res toks = map tok . words tok t = Term t Nothing --------------------------------------------------------------------- -- Grammar 3 ---------------------------------------------------------------------
674
gram2Tests :: [Test] gram2Tests = [ test "S" ("a b e a b") Yes , test "S" ("a b e a a") No , test "S" ("a b a b a b a b e a b a b a b a b") Yes , test "S" ("a b a b a b a b e a b a b a b a") No #ifdef NoAdjunctionRestriction #else -- Only fails if multiple adjunction is not allowed , test "S" ("a b e b a") No #endif , test "S" ("b e a") No , test "S" ("a b a b") No ] where test start sent res = Test start (toks sent) M.empty res toks = map tok . words tok t = Term t Nothing --------------------------------------------------------------------- -- Grammar 3 ---------------------------------------------------------------------
674
gram2Tests = [ test "S" ("a b e a b") Yes , test "S" ("a b e a a") No , test "S" ("a b a b a b a b e a b a b a b a b") Yes , test "S" ("a b a b a b a b e a b a b a b a") No #ifdef NoAdjunctionRestriction #else -- Only fails if multiple adjunction is not allowed , test "S" ("a b e b a") No #endif , test "S" ("b e a") No , test "S" ("a b a b") No ] where test start sent res = Test start (toks sent) M.empty res toks = map tok . words tok t = Term t Nothing --------------------------------------------------------------------- -- Grammar 3 ---------------------------------------------------------------------
653
false
true
2
8
173
154
83
71
null
null
GaloisInc/halvm-ghc
compiler/utils/Outputable.hs
bsd-3-clause
primWordSuffix = text "##"
28
primWordSuffix = text "##"
28
primWordSuffix = text "##"
28
false
false
0
5
5
9
4
5
null
null
ezyang/ghc
compiler/prelude/TysWiredIn.hs
bsd-3-clause
listTyCon :: TyCon listTyCon = buildAlgTyCon listTyConName alpha_tyvar [Representational] Nothing [] (DataTyCon [nilDataCon, consDataCon] False ) False (VanillaAlgTyCon $ mkPrelTyConRepName listTyConName)
308
listTyCon :: TyCon listTyCon = buildAlgTyCon listTyConName alpha_tyvar [Representational] Nothing [] (DataTyCon [nilDataCon, consDataCon] False ) False (VanillaAlgTyCon $ mkPrelTyConRepName listTyConName)
308
listTyCon = buildAlgTyCon listTyConName alpha_tyvar [Representational] Nothing [] (DataTyCon [nilDataCon, consDataCon] False ) False (VanillaAlgTyCon $ mkPrelTyConRepName listTyConName)
289
false
true
0
8
124
57
30
27
null
null
dcreager/cabal
Distribution/Simple/PreProcess/Unlit.hs
bsd-3-clause
-- | 'unlit' takes a filename (for error reports), and transforms the -- given string, to eliminate the literate comments from the program text. unlit :: FilePath -> String -> Either String String unlit file input = let (usesBirdTracks, classified) = classifyAndCheckForBirdTracks . inlines $ input in either (Left . unlines . map (unclassify usesBirdTracks)) Right . checkErrors . reclassify $ classified where -- So haddock requires comments and code to align, since it treats comments -- as following the layout rule. This is a pain for us since bird track -- style literate code typically gets indented by two since ">" is replaced -- by " " and people usually use one additional space of indent ie -- "> then the code". On the other hand we cannot just go and indent all -- the comments by two since that does not work for latex style literate -- code. So the hacky solution we use here is that if we see any bird track -- style code then we'll indent all comments by two, otherwise by none. -- Of course this will not work for mixed latex/bird track .lhs files but -- nobody does that, it's silly and specifically recommended against in the -- H98 unlit spec. -- classifyAndCheckForBirdTracks = flip mapAccumL False $ \seenBirdTrack line -> let classification = classify line in (seenBirdTrack || isBirdTrack classification, classification) isBirdTrack (BirdTrack _) = True isBirdTrack _ = False checkErrors ls = case [ e | Error e <- ls ] of [] -> Left ls (message:_) -> Right (f ++ ":" ++ show n ++ ": " ++ message) where (f, n) = errorPos file 1 ls errorPos f n [] = (f, n) errorPos f n (Error _:_) = (f, n) errorPos _ _ (Line n' f':ls) = errorPos f' n' ls errorPos f n (_ :ls) = errorPos f (n+1) ls -- Here we model a state machine, with each state represented by -- a local function. We only have four states (well, five, -- if you count the error state), but the rules -- to transition between then are not so simple. -- Would it be simpler to have more states? -- -- Each state represents the type of line that was last read -- i.e. are we in a comment section, or a latex-code section, -- or a bird-code section, etc?
2,411
unlit :: FilePath -> String -> Either String String unlit file input = let (usesBirdTracks, classified) = classifyAndCheckForBirdTracks . inlines $ input in either (Left . unlines . map (unclassify usesBirdTracks)) Right . checkErrors . reclassify $ classified where -- So haddock requires comments and code to align, since it treats comments -- as following the layout rule. This is a pain for us since bird track -- style literate code typically gets indented by two since ">" is replaced -- by " " and people usually use one additional space of indent ie -- "> then the code". On the other hand we cannot just go and indent all -- the comments by two since that does not work for latex style literate -- code. So the hacky solution we use here is that if we see any bird track -- style code then we'll indent all comments by two, otherwise by none. -- Of course this will not work for mixed latex/bird track .lhs files but -- nobody does that, it's silly and specifically recommended against in the -- H98 unlit spec. -- classifyAndCheckForBirdTracks = flip mapAccumL False $ \seenBirdTrack line -> let classification = classify line in (seenBirdTrack || isBirdTrack classification, classification) isBirdTrack (BirdTrack _) = True isBirdTrack _ = False checkErrors ls = case [ e | Error e <- ls ] of [] -> Left ls (message:_) -> Right (f ++ ":" ++ show n ++ ": " ++ message) where (f, n) = errorPos file 1 ls errorPos f n [] = (f, n) errorPos f n (Error _:_) = (f, n) errorPos _ _ (Line n' f':ls) = errorPos f' n' ls errorPos f n (_ :ls) = errorPos f (n+1) ls -- Here we model a state machine, with each state represented by -- a local function. We only have four states (well, five, -- if you count the error state), but the rules -- to transition between then are not so simple. -- Would it be simpler to have more states? -- -- Each state represents the type of line that was last read -- i.e. are we in a comment section, or a latex-code section, -- or a bird-code section, etc?
2,264
unlit file input = let (usesBirdTracks, classified) = classifyAndCheckForBirdTracks . inlines $ input in either (Left . unlines . map (unclassify usesBirdTracks)) Right . checkErrors . reclassify $ classified where -- So haddock requires comments and code to align, since it treats comments -- as following the layout rule. This is a pain for us since bird track -- style literate code typically gets indented by two since ">" is replaced -- by " " and people usually use one additional space of indent ie -- "> then the code". On the other hand we cannot just go and indent all -- the comments by two since that does not work for latex style literate -- code. So the hacky solution we use here is that if we see any bird track -- style code then we'll indent all comments by two, otherwise by none. -- Of course this will not work for mixed latex/bird track .lhs files but -- nobody does that, it's silly and specifically recommended against in the -- H98 unlit spec. -- classifyAndCheckForBirdTracks = flip mapAccumL False $ \seenBirdTrack line -> let classification = classify line in (seenBirdTrack || isBirdTrack classification, classification) isBirdTrack (BirdTrack _) = True isBirdTrack _ = False checkErrors ls = case [ e | Error e <- ls ] of [] -> Left ls (message:_) -> Right (f ++ ":" ++ show n ++ ": " ++ message) where (f, n) = errorPos file 1 ls errorPos f n [] = (f, n) errorPos f n (Error _:_) = (f, n) errorPos _ _ (Line n' f':ls) = errorPos f' n' ls errorPos f n (_ :ls) = errorPos f (n+1) ls -- Here we model a state machine, with each state represented by -- a local function. We only have four states (well, five, -- if you count the error state), but the rules -- to transition between then are not so simple. -- Would it be simpler to have more states? -- -- Each state represents the type of line that was last read -- i.e. are we in a comment section, or a latex-code section, -- or a bird-code section, etc?
2,212
true
true
10
13
674
425
210
215
null
null
d0kt0r0/estuary
client/src/Estuary/Widgets/Reflex.hs
gpl-3.0
hideableWidgetWFlexColumn :: MonadWidget t m => Dynamic t Bool -> m a -> m a hideableWidgetWFlexColumn b m = do let attrs = fmap (bool (fromList [("hidden","true")]) (fromList [("style", "display: flex; flex-direction: column;")])) b elDynAttr "div" attrs m
262
hideableWidgetWFlexColumn :: MonadWidget t m => Dynamic t Bool -> m a -> m a hideableWidgetWFlexColumn b m = do let attrs = fmap (bool (fromList [("hidden","true")]) (fromList [("style", "display: flex; flex-direction: column;")])) b elDynAttr "div" attrs m
262
hideableWidgetWFlexColumn b m = do let attrs = fmap (bool (fromList [("hidden","true")]) (fromList [("style", "display: flex; flex-direction: column;")])) b elDynAttr "div" attrs m
185
false
true
0
16
42
106
52
54
null
null
helino/wham
src/Wham/SignExc.hs
bsd-3-clause
_ `div` NonPositive = AnyS
26
_ `div` NonPositive = AnyS
26
_ `div` NonPositive = AnyS
26
false
false
0
5
4
14
7
7
null
null
jlubi333/Camille
camille/hs/Parser.hs
mit
space :: Parser () space = oneOf [' ', '\t'] >> return ()
57
space :: Parser () space = oneOf [' ', '\t'] >> return ()
57
space = oneOf [' ', '\t'] >> return ()
38
false
true
1
7
12
37
17
20
null
null
urbanslug/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
tcTyFamInsts (LitTy {}) = []
36
tcTyFamInsts (LitTy {}) = []
36
tcTyFamInsts (LitTy {}) = []
36
false
false
0
7
12
18
9
9
null
null
rueshyna/gogol
gogol-sqladmin/gen/Network/Google/SQLAdmin/Types/Product.hs
mpl-2.0
-- | If the instance state is SUSPENDED, the reason for the suspension. datSuspensionReason :: Lens' DatabaseInstance [Text] datSuspensionReason = lens _datSuspensionReason (\ s a -> s{_datSuspensionReason = a}) . _Default . _Coerce
252
datSuspensionReason :: Lens' DatabaseInstance [Text] datSuspensionReason = lens _datSuspensionReason (\ s a -> s{_datSuspensionReason = a}) . _Default . _Coerce
180
datSuspensionReason = lens _datSuspensionReason (\ s a -> s{_datSuspensionReason = a}) . _Default . _Coerce
127
true
true
3
8
52
58
28
30
null
null
dorchard/gram_lang
frontend/src/Language/Granule/Checker/KindsHelpers.hs
bsd-3-clause
isEffectKind _ = False
22
isEffectKind _ = False
22
isEffectKind _ = False
22
false
false
0
5
3
9
4
5
null
null
printedheart/Dao
src/Dao/Text/Editor.hs
agpl-3.0
-- | You can set a list of tab stops so every 'tab' operation steps to the next stop rather than the -- default behavior of stepping forward to a column that is some multiple 'tabWidth'. tabStops :: Monad m => Lens m PPrintState [Int] tabStops = pPrintStateLens >>> tuple3
272
tabStops :: Monad m => Lens m PPrintState [Int] tabStops = pPrintStateLens >>> tuple3
85
tabStops = pPrintStateLens >>> tuple3
37
true
true
0
7
49
34
18
16
null
null
olsner/ghc
compiler/types/Type.hs
bsd-3-clause
seqType :: Type -> () seqType (LitTy n) = n `seq` ()
70
seqType :: Type -> () seqType (LitTy n) = n `seq` ()
70
seqType (LitTy n) = n `seq` ()
48
false
true
0
7
29
34
18
16
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
mpl-2.0
-- | DART ID of the country to which this mobile carrier belongs. mcCountryDartId :: Lens' MobileCarrier (Maybe Int64) mcCountryDartId = lens _mcCountryDartId (\ s a -> s{_mcCountryDartId = a}) . mapping _Coerce
225
mcCountryDartId :: Lens' MobileCarrier (Maybe Int64) mcCountryDartId = lens _mcCountryDartId (\ s a -> s{_mcCountryDartId = a}) . mapping _Coerce
159
mcCountryDartId = lens _mcCountryDartId (\ s a -> s{_mcCountryDartId = a}) . mapping _Coerce
106
true
true
2
8
46
59
28
31
null
null
m3mitsuppe/haskell
exercises/d_type.hs
unlicense
-- f5 :: Int f5 = length [1, 2, 3, 4, 5]
40
f5 = length [1, 2, 3, 4, 5]
27
f5 = length [1, 2, 3, 4, 5]
27
true
false
1
5
11
28
15
13
null
null
Hodapp87/ivory
ivory-serialize/src/Ivory/Serialize/Safe/LittleEndian.hs
bsd-3-clause
unpackFrom :: (Packable a, ANat len) => ConstRef s1 (Array len (Stored Uint8)) -- ^ buf -> Uint32 -- ^ offset -> Ref s2 a -- ^ value -> Ivory ('Effects r b (Scope s3)) () unpackFrom = unpackFrom' packRep
247
unpackFrom :: (Packable a, ANat len) => ConstRef s1 (Array len (Stored Uint8)) -- ^ buf -> Uint32 -- ^ offset -> Ref s2 a -- ^ value -> Ivory ('Effects r b (Scope s3)) () unpackFrom = unpackFrom' packRep
247
unpackFrom = unpackFrom' packRep
32
false
true
0
13
83
93
47
46
null
null
patrikja/testing-feat
Test/Feat/Class.hs
bsd-3-clause
hared :: (Sized f, Enumerable a, Typeable f) => Shareable f a shared = access
79
shared :: (Sized f, Enumerable a, Typeable f) => Shareable f a shared = access
78
shared = access
15
false
true
0
7
16
43
20
23
null
null
agrafix/hackage-server
Distribution/Server/Features/Search/SearchIndex.hs
bsd-3-clause
getDocTermIds :: SearchIndex key field feature -> DocId -> DocTermIds field getDocTermIds SearchIndex{docIdMap} docid = case docIdMap IntMap.! fromEnum docid of DocInfo _ doctermids _ -> doctermids -------------------- -- Insert & delete -- -- Procedure for adding a new doc... -- (key, field -> [Term]) -- alloc docid for key -- add term occurences for docid (include rev map for termid) -- construct indexdoc now that we have all the term -> termid entries -- insert indexdoc -- Procedure for updating a doc... -- (key, field -> [Term]) -- find docid for key -- lookup old terms for docid (using termid rev map) -- calc term occurrences to add, term occurrences to delete -- add new term occurrences, delete old term occurrences -- construct indexdoc now that we have all the term -> termid entries -- insert indexdoc -- Procedure for deleting a doc... -- (key, field -> [Term]) -- find docid for key -- lookup old terms for docid (using termid rev map) -- delete old term occurrences -- delete indexdoc -- | This is the representation for documents to be added to the index. -- Documents may --
1,112
getDocTermIds :: SearchIndex key field feature -> DocId -> DocTermIds field getDocTermIds SearchIndex{docIdMap} docid = case docIdMap IntMap.! fromEnum docid of DocInfo _ doctermids _ -> doctermids -------------------- -- Insert & delete -- -- Procedure for adding a new doc... -- (key, field -> [Term]) -- alloc docid for key -- add term occurences for docid (include rev map for termid) -- construct indexdoc now that we have all the term -> termid entries -- insert indexdoc -- Procedure for updating a doc... -- (key, field -> [Term]) -- find docid for key -- lookup old terms for docid (using termid rev map) -- calc term occurrences to add, term occurrences to delete -- add new term occurrences, delete old term occurrences -- construct indexdoc now that we have all the term -> termid entries -- insert indexdoc -- Procedure for deleting a doc... -- (key, field -> [Term]) -- find docid for key -- lookup old terms for docid (using termid rev map) -- delete old term occurrences -- delete indexdoc -- | This is the representation for documents to be added to the index. -- Documents may --
1,112
getDocTermIds SearchIndex{docIdMap} docid = case docIdMap IntMap.! fromEnum docid of DocInfo _ doctermids _ -> doctermids -------------------- -- Insert & delete -- -- Procedure for adding a new doc... -- (key, field -> [Term]) -- alloc docid for key -- add term occurences for docid (include rev map for termid) -- construct indexdoc now that we have all the term -> termid entries -- insert indexdoc -- Procedure for updating a doc... -- (key, field -> [Term]) -- find docid for key -- lookup old terms for docid (using termid rev map) -- calc term occurrences to add, term occurrences to delete -- add new term occurrences, delete old term occurrences -- construct indexdoc now that we have all the term -> termid entries -- insert indexdoc -- Procedure for deleting a doc... -- (key, field -> [Term]) -- find docid for key -- lookup old terms for docid (using termid rev map) -- delete old term occurrences -- delete indexdoc -- | This is the representation for documents to be added to the index. -- Documents may --
1,036
false
true
1
8
204
99
58
41
null
null
isomorphism/webgl
src/Graphics/Rendering/WebGL/Constants.hs
mit
gl_TEXTURE_COMPRESSION_HINT :: GLenum gl_TEXTURE_COMPRESSION_HINT = 0x84EF
74
gl_TEXTURE_COMPRESSION_HINT :: GLenum gl_TEXTURE_COMPRESSION_HINT = 0x84EF
74
gl_TEXTURE_COMPRESSION_HINT = 0x84EF
36
false
true
0
4
5
11
6
5
null
null