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
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/CreativeGroups/List.hs
mpl-2.0
-- | Allows searching for creative groups by name or ID. Wildcards (*) are -- allowed. For example, \"creativegroup*2015\" will return creative groups -- with names like \"creativegroup June 2015\", \"creativegroup April -- 2015\", or simply \"creativegroup 2015\". Most of the searches also add -- wild-cards implicitly at the start and the end of the search string. For -- example, a search string of \"creativegroup\" will match creative groups -- with the name \"my creativegroup\", \"creativegroup 2015\", or simply -- \"creativegroup\". cglSearchString :: Lens' CreativeGroupsList (Maybe Text) cglSearchString = lens _cglSearchString (\ s a -> s{_cglSearchString = a})
682
cglSearchString :: Lens' CreativeGroupsList (Maybe Text) cglSearchString = lens _cglSearchString (\ s a -> s{_cglSearchString = a})
139
cglSearchString = lens _cglSearchString (\ s a -> s{_cglSearchString = a})
82
true
true
0
9
105
55
32
23
null
null
thalerjonathan/phd
coding/learning/haskell/grahambook/Code_Solutions/calculator.hs
gpl-3.0
buttons :: String buttons = standard ++ extra where standard = "qcd=123+456-789*0()/" extra = "QCD \ESC\BS\DEL\n"
152
buttons :: String buttons = standard ++ extra where standard = "qcd=123+456-789*0()/" extra = "QCD \ESC\BS\DEL\n"
152
buttons = standard ++ extra where standard = "qcd=123+456-789*0()/" extra = "QCD \ESC\BS\DEL\n"
134
false
true
1
6
54
36
16
20
null
null
aburnett88/HSat
src/HSat/Problem/Instances/Common/Variable.hs
mit
{-| Constructs a 'Variable from an 'Integer'. Throws a run time error if the value is 0, or above the maximum value for a 'Word' -} mkVariableFromInteger :: Integer -> Variable mkVariableFromInteger integer = let name' = ":mkVariableFromInteger. Argument " absInteger = case compare integer 0 of EQ -> error (name ++ name' ++ show integer) LT -> abs integer GT -> integer in case compare absInteger maxWord of GT -> error (name ++ name' ++ show integer) _ -> Variable $ fromInteger absInteger {-| The maximum 'Integer' representation of a 'Word'. It is used to deduce whether an error should be thrown. It is put through the constructor for mkVariable to make sure that no run-time errors are thrown -}
756
mkVariableFromInteger :: Integer -> Variable mkVariableFromInteger integer = let name' = ":mkVariableFromInteger. Argument " absInteger = case compare integer 0 of EQ -> error (name ++ name' ++ show integer) LT -> abs integer GT -> integer in case compare absInteger maxWord of GT -> error (name ++ name' ++ show integer) _ -> Variable $ fromInteger absInteger {-| The maximum 'Integer' representation of a 'Word'. It is used to deduce whether an error should be thrown. It is put through the constructor for mkVariable to make sure that no run-time errors are thrown -}
623
mkVariableFromInteger integer = let name' = ":mkVariableFromInteger. Argument " absInteger = case compare integer 0 of EQ -> error (name ++ name' ++ show integer) LT -> abs integer GT -> integer in case compare absInteger maxWord of GT -> error (name ++ name' ++ show integer) _ -> Variable $ fromInteger absInteger {-| The maximum 'Integer' representation of a 'Word'. It is used to deduce whether an error should be thrown. It is put through the constructor for mkVariable to make sure that no run-time errors are thrown -}
570
true
true
0
15
174
128
62
66
null
null
jwiegley/ghc-release
libraries/Cabal/cabal/Distribution/Simple/GHC.hs
gpl-3.0
-- Cabal does not use the environment variable GHC_PACKAGE_PATH; let users -- know that this is the case. See ticket #335. Simply ignoring it is not a -- good idea, since then ghc and cabal are looking at different sets of -- package dbs and chaos is likely to ensue. checkPackageDbEnvVar :: IO () checkPackageDbEnvVar = do hasGPP <- (getEnv "GHC_PACKAGE_PATH" >> return True) `catchIO` (\_ -> return False) when hasGPP $ die $ "Use of GHC's environment variable GHC_PACKAGE_PATH is " ++ "incompatible with Cabal. Use the flag --package-db to specify a " ++ "package database (it can be used multiple times)."
655
checkPackageDbEnvVar :: IO () checkPackageDbEnvVar = do hasGPP <- (getEnv "GHC_PACKAGE_PATH" >> return True) `catchIO` (\_ -> return False) when hasGPP $ die $ "Use of GHC's environment variable GHC_PACKAGE_PATH is " ++ "incompatible with Cabal. Use the flag --package-db to specify a " ++ "package database (it can be used multiple times)."
387
checkPackageDbEnvVar = do hasGPP <- (getEnv "GHC_PACKAGE_PATH" >> return True) `catchIO` (\_ -> return False) when hasGPP $ die $ "Use of GHC's environment variable GHC_PACKAGE_PATH is " ++ "incompatible with Cabal. Use the flag --package-db to specify a " ++ "package database (it can be used multiple times)."
357
true
true
0
11
148
79
41
38
null
null
romildo/hprettybox
src/Text/PrettyPrint/Box.hs
bsd-3-clause
heighten b@(Box xs) h | h <= hei = b | otherwise = top $$ b $$ bottom where wid = width b hei = height b top = uniform ' ' wid ((h - hei) `div` 2) bottom = uniform ' ' wid (h - hei - height top)
254
heighten b@(Box xs) h | h <= hei = b | otherwise = top $$ b $$ bottom where wid = width b hei = height b top = uniform ' ' wid ((h - hei) `div` 2) bottom = uniform ' ' wid (h - hei - height top)
254
heighten b@(Box xs) h | h <= hei = b | otherwise = top $$ b $$ bottom where wid = width b hei = height b top = uniform ' ' wid ((h - hei) `div` 2) bottom = uniform ' ' wid (h - hei - height top)
254
false
false
3
9
109
120
60
60
null
null
miguelpagano/equ
TestSuite/Tests/Matching.hs
gpl-3.0
testCase1 :: Assertion testCase1 = testMatch pVq trueVfalse (Right s) where s = emp ./ (p,true) ./ (q,false) -- | Sy + S(x+S0) + z -m-> x + Sy + z : [x->Sy, y->x+S0]
170
testCase1 :: Assertion testCase1 = testMatch pVq trueVfalse (Right s) where s = emp ./ (p,true) ./ (q,false) -- | Sy + S(x+S0) + z -m-> x + Sy + z : [x->Sy, y->x+S0]
170
testCase1 = testMatch pVq trueVfalse (Right s) where s = emp ./ (p,true) ./ (q,false) -- | Sy + S(x+S0) + z -m-> x + Sy + z : [x->Sy, y->x+S0]
147
false
true
2
7
38
61
31
30
null
null
wereHamster/yag
Git/Utils.hs
unlicense
lstrip :: String -> String lstrip s = case s of [] -> [] (x:xs) -> if elem x whitespaceCharacters then lstrip xs else s
131
lstrip :: String -> String lstrip s = case s of [] -> [] (x:xs) -> if elem x whitespaceCharacters then lstrip xs else s
131
lstrip s = case s of [] -> [] (x:xs) -> if elem x whitespaceCharacters then lstrip xs else s
104
false
true
0
9
36
67
32
35
null
null
juhp/stack
src/Stack/Storage/User.hs
bsd-3-clause
loadDockerImageExeCache :: (HasConfig env, HasLogFunc env) => Text -> Path Abs File -> UTCTime -> RIO env (Maybe Bool) loadDockerImageExeCache imageId exePath exeTimestamp = withUserStorage $ fmap (dockerImageExeCacheCompatible . entityVal) <$> getBy (DockerImageExeCacheUnique imageId (toFilePath exePath) exeTimestamp)
355
loadDockerImageExeCache :: (HasConfig env, HasLogFunc env) => Text -> Path Abs File -> UTCTime -> RIO env (Maybe Bool) loadDockerImageExeCache imageId exePath exeTimestamp = withUserStorage $ fmap (dockerImageExeCacheCompatible . entityVal) <$> getBy (DockerImageExeCacheUnique imageId (toFilePath exePath) exeTimestamp)
355
loadDockerImageExeCache imageId exePath exeTimestamp = withUserStorage $ fmap (dockerImageExeCacheCompatible . entityVal) <$> getBy (DockerImageExeCacheUnique imageId (toFilePath exePath) exeTimestamp)
213
false
true
0
12
71
99
48
51
null
null
Rotsor/wheeled-vehicle
Position.hs
bsd-3-clause
worldHeight = 600 *~ meter
26
worldHeight = 600 *~ meter
26
worldHeight = 600 *~ meter
26
false
false
3
5
4
16
6
10
null
null
mitchellwrosen/json-validation
src/internal/Data/Aeson/Validation/Internal/Schema.hs
bsd-3-clause
validateObject' :: (Applicative m, MonadReader Context m) => [ShallowField] -> HashMap Text Value -> m (Seq Text) validateObject' [] obj = case HashMap.keys obj of [] -> pure mempty ks -> err ("extra fields: " <> Text.intercalate ", " (map tshow ks))
264
validateObject' :: (Applicative m, MonadReader Context m) => [ShallowField] -> HashMap Text Value -> m (Seq Text) validateObject' [] obj = case HashMap.keys obj of [] -> pure mempty ks -> err ("extra fields: " <> Text.intercalate ", " (map tshow ks))
264
validateObject' [] obj = case HashMap.keys obj of [] -> pure mempty ks -> err ("extra fields: " <> Text.intercalate ", " (map tshow ks))
146
false
true
0
13
55
115
55
60
null
null
Macil-dev/verhface-ll
src/Bindings/Verba/ErrorCodes.hs
unlicense
verr 31 = VerbaError 31 "E_SEEK" "Ошибка смещения файлового указателя"
86
verr 31 = VerbaError 31 "E_SEEK" "Ошибка смещения файлового указателя"
86
verr 31 = VerbaError 31 "E_SEEK" "Ошибка смещения файлового указателя"
86
false
false
1
5
25
19
7
12
null
null
byorgey/Idris-dev
src/Core/CoreParser.hs
bsd-3-clause
operator = PTok.operator lexer
31
operator = PTok.operator lexer
31
operator = PTok.operator lexer
31
false
false
1
5
4
15
5
10
null
null
afronski/playground-algorithms
spoj-challenges/FLAMASTE/main.hs
mit
convert :: (Int, Char) -> String convert (amount, char) | amount > 2 = printf "%c%d" char amount | otherwise = replicate amount char
137
convert :: (Int, Char) -> String convert (amount, char) | amount > 2 = printf "%c%d" char amount | otherwise = replicate amount char
137
convert (amount, char) | amount > 2 = printf "%c%d" char amount | otherwise = replicate amount char
104
false
true
0
8
28
69
32
37
null
null
k32/zenmaster
LinkGrammar/Parsec.hs
unlicense
linkDirection :: Monad m => ParsecT String u m LinkDirection linkDirection = choice [ rOp "+" *> pure Plus , rOp "-" *> pure Minus ]
178
linkDirection :: Monad m => ParsecT String u m LinkDirection linkDirection = choice [ rOp "+" *> pure Plus , rOp "-" *> pure Minus ]
178
linkDirection = choice [ rOp "+" *> pure Plus , rOp "-" *> pure Minus ]
117
false
true
0
8
71
56
26
30
null
null
mightybyte/reflex-dom-stubs
src/GHCJS/DOM/UIEvent.hs
bsd-3-clause
uiEventGetLayerY = undefined
28
uiEventGetLayerY = undefined
28
uiEventGetLayerY = undefined
28
false
false
0
4
2
6
3
3
null
null
rodrigo-machado/ufrgs-grt
src/MainWindow.hs
gpl-3.0
openFileAndGetContents :: FileChooserDialog -> IO (Maybe String) openFileAndGetContents openDialog = do response <- dialogRun openDialog case response of ResponseAccept -> do filename <- fileChooserGetFilename openDialog case filename of Nothing -> do alert "Please enter a file name!" widgetHide openDialog return Nothing Just path -> catch (do t <- TIO.readFile path widgetHide openDialog return $ Just $ T.unpack t) (\e -> do alert (show (e::SomeException)) widgetHide openDialog return $ Nothing) _ -> do widgetHide openDialog return $ Nothing -------------------- writing strings as files --------------------------- -- -- Salva arquivo
941
openFileAndGetContents :: FileChooserDialog -> IO (Maybe String) openFileAndGetContents openDialog = do response <- dialogRun openDialog case response of ResponseAccept -> do filename <- fileChooserGetFilename openDialog case filename of Nothing -> do alert "Please enter a file name!" widgetHide openDialog return Nothing Just path -> catch (do t <- TIO.readFile path widgetHide openDialog return $ Just $ T.unpack t) (\e -> do alert (show (e::SomeException)) widgetHide openDialog return $ Nothing) _ -> do widgetHide openDialog return $ Nothing -------------------- writing strings as files --------------------------- -- -- Salva arquivo
941
openFileAndGetContents openDialog = do response <- dialogRun openDialog case response of ResponseAccept -> do filename <- fileChooserGetFilename openDialog case filename of Nothing -> do alert "Please enter a file name!" widgetHide openDialog return Nothing Just path -> catch (do t <- TIO.readFile path widgetHide openDialog return $ Just $ T.unpack t) (\e -> do alert (show (e::SomeException)) widgetHide openDialog return $ Nothing) _ -> do widgetHide openDialog return $ Nothing -------------------- writing strings as files --------------------------- -- -- Salva arquivo
876
false
true
1
23
386
204
90
114
null
null
JanAhrens/xing-api-haskell
lib/Web/XING/Types/User/FullUser.hs
bsd-3-clause
premiumServices, badges :: FullUser -> [Text] premiumServices = _premiumServices
84
premiumServices, badges :: FullUser -> [Text] premiumServices = _premiumServices
84
premiumServices = _premiumServices
34
false
true
2
8
12
31
13
18
null
null
agrafix/typed-wire
src/TW/CodeGen/Elm.hs
mit
jsonEncFor :: Type -> T.Text jsonEncFor t = case isBuiltIn t of Nothing -> case t of TyVar v -> varEnc v TyCon qt args -> let ty = makeQualEnc qt in case args of [] -> ty _ -> "(" <> ty <> " " <> T.intercalate " " (map jsonEncFor args) <> ")" Just (bi, tvars) | bi == tyString -> jsonEnc "string" | bi == tyInt -> jsonEnc "int" | bi == tyBool -> jsonEnc "bool" | bi == tyFloat -> jsonEnc "float" | bi == tyBytes -> "TW.encAsBase64" | bi == tyDateTime -> "TW.encDateTime" | bi == tyTime -> "TW.encTime" | bi == tyDate -> "TW.encDate" | bi == tyList -> case tvars of [arg] -> "(" <> jsonEnc "list" <> " << L.map (" <> jsonEncFor arg <> "))" _ -> error $ "Elm: odly shaped List value" | bi == tyMaybe -> case tvars of [arg] -> "TW.encMaybe (" <> jsonEncFor arg <> ")" _ -> error $ "Elm: odly shaped Maybe value" | otherwise -> error $ "Elm: Missing jsonEnc for built in type: " ++ show t
1,244
jsonEncFor :: Type -> T.Text jsonEncFor t = case isBuiltIn t of Nothing -> case t of TyVar v -> varEnc v TyCon qt args -> let ty = makeQualEnc qt in case args of [] -> ty _ -> "(" <> ty <> " " <> T.intercalate " " (map jsonEncFor args) <> ")" Just (bi, tvars) | bi == tyString -> jsonEnc "string" | bi == tyInt -> jsonEnc "int" | bi == tyBool -> jsonEnc "bool" | bi == tyFloat -> jsonEnc "float" | bi == tyBytes -> "TW.encAsBase64" | bi == tyDateTime -> "TW.encDateTime" | bi == tyTime -> "TW.encTime" | bi == tyDate -> "TW.encDate" | bi == tyList -> case tvars of [arg] -> "(" <> jsonEnc "list" <> " << L.map (" <> jsonEncFor arg <> "))" _ -> error $ "Elm: odly shaped List value" | bi == tyMaybe -> case tvars of [arg] -> "TW.encMaybe (" <> jsonEncFor arg <> ")" _ -> error $ "Elm: odly shaped Maybe value" | otherwise -> error $ "Elm: Missing jsonEnc for built in type: " ++ show t
1,244
jsonEncFor t = case isBuiltIn t of Nothing -> case t of TyVar v -> varEnc v TyCon qt args -> let ty = makeQualEnc qt in case args of [] -> ty _ -> "(" <> ty <> " " <> T.intercalate " " (map jsonEncFor args) <> ")" Just (bi, tvars) | bi == tyString -> jsonEnc "string" | bi == tyInt -> jsonEnc "int" | bi == tyBool -> jsonEnc "bool" | bi == tyFloat -> jsonEnc "float" | bi == tyBytes -> "TW.encAsBase64" | bi == tyDateTime -> "TW.encDateTime" | bi == tyTime -> "TW.encTime" | bi == tyDate -> "TW.encDate" | bi == tyList -> case tvars of [arg] -> "(" <> jsonEnc "list" <> " << L.map (" <> jsonEncFor arg <> "))" _ -> error $ "Elm: odly shaped List value" | bi == tyMaybe -> case tvars of [arg] -> "TW.encMaybe (" <> jsonEncFor arg <> ")" _ -> error $ "Elm: odly shaped Maybe value" | otherwise -> error $ "Elm: Missing jsonEnc for built in type: " ++ show t
1,215
false
true
0
20
544
376
176
200
null
null
spechub/Hets
HasCASL/ConvertTypePattern.hs
gpl-2.0
illegalTypePattern :: TypePattern -> Result a illegalTypePattern = mkError "illegal type pattern"
97
illegalTypePattern :: TypePattern -> Result a illegalTypePattern = mkError "illegal type pattern"
97
illegalTypePattern = mkError "illegal type pattern"
51
false
true
0
6
11
21
10
11
null
null
alanz/Blobs
lib/DData/IntMap.hs
lgpl-2.1
difference t Nil = t
26
difference t Nil = t
26
difference t Nil = t
26
false
false
1
5
10
16
5
11
null
null
sgillespie/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
toEntryLbl (IdLabel n c ConInfoTable) = IdLabel n c ConEntry
63
toEntryLbl (IdLabel n c ConInfoTable) = IdLabel n c ConEntry
63
toEntryLbl (IdLabel n c ConInfoTable) = IdLabel n c ConEntry
63
false
false
0
7
12
26
12
14
null
null
dzeban/haskell-exercises
hw2/LogAnalysis.hs
mit
-- Insert of unknown message must return tree unchanged insert (Unknown _) tree = tree
86
insert (Unknown _) tree = tree
30
insert (Unknown _) tree = tree
30
true
false
0
7
14
18
9
9
null
null
rrnewton/accelerate
Data/Array/Accelerate/Interpreter.hs
bsd-3-clause
evalPrim (PrimQuotRem ty) = evalQuotRem ty
50
evalPrim (PrimQuotRem ty) = evalQuotRem ty
50
evalPrim (PrimQuotRem ty) = evalQuotRem ty
50
false
false
0
6
13
19
8
11
null
null
nevrenato/HetsAlloy
CMDL/DgCommands.hs
gpl-2.0
commandDg :: (LibName -> [LEdge DGLinkLab] -> LibEnv -> Result LibEnv) -> String -> CmdlState -> IO CmdlState commandDg fn input state = case i_state $ intState state of Nothing -> return $ genMsgAndCode "No library loaded" 1 state Just ist -> do let (_, edg, nbEdg, errs) = decomposeIntoGoals input tmpErrs = prettyPrintErrList errs case (edg, nbEdg) of ([], []) -> -- leave the internal state intact so that the interface can recover return $ genMsgAndCode (tmpErrs ++ "No edges in input string\n") 1 state (_, _) -> do let lsNodes = getAllNodes ist lsEdges = getAllEdges ist -- compute the list of edges from the input (errs', listEdges) = obtainEdgeList edg nbEdg lsNodes lsEdges tmpErrs' = tmpErrs ++ prettyPrintErrList errs' case listEdges of [] -> return $ genMsgAndCode (tmpErrs' ++ "No edge in input string\n") 1 state _ -> case fn (i_ln ist) listEdges (i_libEnv ist) of Result _ (Just nwLibEnv) -> -- name added later !! return $ add2hist [IStateChange $ Just ist] $ genMessage tmpErrs' [] state { intState = (intState state) { i_state = Just $ emptyIntIState nwLibEnv $ i_ln ist } } Result diag Nothing -> return $ genMsgAndCode (concatMap diagString diag) 1 state {- | The function 'cUse' implements the Use commands, i.e. given a path it tries to load the library at that path -}
1,656
commandDg :: (LibName -> [LEdge DGLinkLab] -> LibEnv -> Result LibEnv) -> String -> CmdlState -> IO CmdlState commandDg fn input state = case i_state $ intState state of Nothing -> return $ genMsgAndCode "No library loaded" 1 state Just ist -> do let (_, edg, nbEdg, errs) = decomposeIntoGoals input tmpErrs = prettyPrintErrList errs case (edg, nbEdg) of ([], []) -> -- leave the internal state intact so that the interface can recover return $ genMsgAndCode (tmpErrs ++ "No edges in input string\n") 1 state (_, _) -> do let lsNodes = getAllNodes ist lsEdges = getAllEdges ist -- compute the list of edges from the input (errs', listEdges) = obtainEdgeList edg nbEdg lsNodes lsEdges tmpErrs' = tmpErrs ++ prettyPrintErrList errs' case listEdges of [] -> return $ genMsgAndCode (tmpErrs' ++ "No edge in input string\n") 1 state _ -> case fn (i_ln ist) listEdges (i_libEnv ist) of Result _ (Just nwLibEnv) -> -- name added later !! return $ add2hist [IStateChange $ Just ist] $ genMessage tmpErrs' [] state { intState = (intState state) { i_state = Just $ emptyIntIState nwLibEnv $ i_ln ist } } Result diag Nothing -> return $ genMsgAndCode (concatMap diagString diag) 1 state {- | The function 'cUse' implements the Use commands, i.e. given a path it tries to load the library at that path -}
1,656
commandDg fn input state = case i_state $ intState state of Nothing -> return $ genMsgAndCode "No library loaded" 1 state Just ist -> do let (_, edg, nbEdg, errs) = decomposeIntoGoals input tmpErrs = prettyPrintErrList errs case (edg, nbEdg) of ([], []) -> -- leave the internal state intact so that the interface can recover return $ genMsgAndCode (tmpErrs ++ "No edges in input string\n") 1 state (_, _) -> do let lsNodes = getAllNodes ist lsEdges = getAllEdges ist -- compute the list of edges from the input (errs', listEdges) = obtainEdgeList edg nbEdg lsNodes lsEdges tmpErrs' = tmpErrs ++ prettyPrintErrList errs' case listEdges of [] -> return $ genMsgAndCode (tmpErrs' ++ "No edge in input string\n") 1 state _ -> case fn (i_ln ist) listEdges (i_libEnv ist) of Result _ (Just nwLibEnv) -> -- name added later !! return $ add2hist [IStateChange $ Just ist] $ genMessage tmpErrs' [] state { intState = (intState state) { i_state = Just $ emptyIntIState nwLibEnv $ i_ln ist } } Result diag Nothing -> return $ genMsgAndCode (concatMap diagString diag) 1 state {- | The function 'cUse' implements the Use commands, i.e. given a path it tries to load the library at that path -}
1,536
false
true
2
28
586
422
209
213
null
null
tolysz/dsp
Numeric/Transform/Fourier/FFT.hs
gpl-2.0
choose2 :: (Integral a) => a -> a choose2 n = loop2 1 1 where loop2 i f | i * i > n = f | n `mod` i == 0 = loop2 (i+1) i | otherwise = loop2 (i+1) f
194
choose2 :: (Integral a) => a -> a choose2 n = loop2 1 1 where loop2 i f | i * i > n = f | n `mod` i == 0 = loop2 (i+1) i | otherwise = loop2 (i+1) f
194
choose2 n = loop2 1 1 where loop2 i f | i * i > n = f | n `mod` i == 0 = loop2 (i+1) i | otherwise = loop2 (i+1) f
160
false
true
0
9
87
110
54
56
null
null
tobyp/bills
bills.hs
mit
money = do e <- expr ps <- getState case eval (psVariables ps) e of Left error -> fail error Right result -> return result -- [Share]
162
money = do e <- expr ps <- getState case eval (psVariables ps) e of Left error -> fail error Right result -> return result -- [Share]
162
money = do e <- expr ps <- getState case eval (psVariables ps) e of Left error -> fail error Right result -> return result -- [Share]
162
false
false
0
10
55
63
28
35
null
null
ezyang/ghc
compiler/basicTypes/Name.hs
bsd-3-clause
nameSrcLoc name = srcSpanStart (n_loc name)
44
nameSrcLoc name = srcSpanStart (n_loc name)
44
nameSrcLoc name = srcSpanStart (n_loc name)
44
false
false
1
7
6
21
8
13
null
null
romanb/aws
Aws/S3/Core.hs
bsd-3-clause
parseObjectMetadata :: MonadThrow m => HTTP.ResponseHeaders -> m ObjectMetadata parseObjectMetadata h = ObjectMetadata `liftM` deleteMarker `ap` etag `ap` lastModified `ap` return versionId -- `ap` expiration `ap` return userMetadata `ap` return missingUserMetadata `ap` serverSideEncryption where deleteMarker = case B8.unpack `fmap` lookup "x-amz-delete-marker" h of Nothing -> return False Just "true" -> return True Just "false" -> return False Just x -> throwM $ HeaderException ("Invalid x-amz-delete-marker " ++ x) etag = case T.decodeUtf8 `fmap` lookup "ETag" h of Just x -> return x Nothing -> throwM $ HeaderException "ETag missing" lastModified = case B8.unpack `fmap` lookup "Last-Modified" h of Just ts -> case parseHttpDate ts of Just t -> return t Nothing -> throwM $ HeaderException ("Invalid Last-Modified: " ++ ts) Nothing -> throwM $ HeaderException "Last-Modified missing" versionId = T.decodeUtf8 `fmap` lookup "x-amz-version-id" h -- expiration = return undefined userMetadata = flip mapMaybe ht $ \(k, v) -> do i <- T.stripPrefix "x-amz-meta-" k return (i, v) missingUserMetadata = T.decodeUtf8 `fmap` lookup "x-amz-missing-meta" h serverSideEncryption = case T.decodeUtf8 `fmap` lookup "x-amz-server-side-encryption" h of Just x -> return $ parseServerSideEncryption x Nothing -> return Nothing ht = map ((T.decodeUtf8 . CI.foldedCase) *** T.decodeUtf8) h
2,023
parseObjectMetadata :: MonadThrow m => HTTP.ResponseHeaders -> m ObjectMetadata parseObjectMetadata h = ObjectMetadata `liftM` deleteMarker `ap` etag `ap` lastModified `ap` return versionId -- `ap` expiration `ap` return userMetadata `ap` return missingUserMetadata `ap` serverSideEncryption where deleteMarker = case B8.unpack `fmap` lookup "x-amz-delete-marker" h of Nothing -> return False Just "true" -> return True Just "false" -> return False Just x -> throwM $ HeaderException ("Invalid x-amz-delete-marker " ++ x) etag = case T.decodeUtf8 `fmap` lookup "ETag" h of Just x -> return x Nothing -> throwM $ HeaderException "ETag missing" lastModified = case B8.unpack `fmap` lookup "Last-Modified" h of Just ts -> case parseHttpDate ts of Just t -> return t Nothing -> throwM $ HeaderException ("Invalid Last-Modified: " ++ ts) Nothing -> throwM $ HeaderException "Last-Modified missing" versionId = T.decodeUtf8 `fmap` lookup "x-amz-version-id" h -- expiration = return undefined userMetadata = flip mapMaybe ht $ \(k, v) -> do i <- T.stripPrefix "x-amz-meta-" k return (i, v) missingUserMetadata = T.decodeUtf8 `fmap` lookup "x-amz-missing-meta" h serverSideEncryption = case T.decodeUtf8 `fmap` lookup "x-amz-server-side-encryption" h of Just x -> return $ parseServerSideEncryption x Nothing -> return Nothing ht = map ((T.decodeUtf8 . CI.foldedCase) *** T.decodeUtf8) h
2,023
parseObjectMetadata h = ObjectMetadata `liftM` deleteMarker `ap` etag `ap` lastModified `ap` return versionId -- `ap` expiration `ap` return userMetadata `ap` return missingUserMetadata `ap` serverSideEncryption where deleteMarker = case B8.unpack `fmap` lookup "x-amz-delete-marker" h of Nothing -> return False Just "true" -> return True Just "false" -> return False Just x -> throwM $ HeaderException ("Invalid x-amz-delete-marker " ++ x) etag = case T.decodeUtf8 `fmap` lookup "ETag" h of Just x -> return x Nothing -> throwM $ HeaderException "ETag missing" lastModified = case B8.unpack `fmap` lookup "Last-Modified" h of Just ts -> case parseHttpDate ts of Just t -> return t Nothing -> throwM $ HeaderException ("Invalid Last-Modified: " ++ ts) Nothing -> throwM $ HeaderException "Last-Modified missing" versionId = T.decodeUtf8 `fmap` lookup "x-amz-version-id" h -- expiration = return undefined userMetadata = flip mapMaybe ht $ \(k, v) -> do i <- T.stripPrefix "x-amz-meta-" k return (i, v) missingUserMetadata = T.decodeUtf8 `fmap` lookup "x-amz-missing-meta" h serverSideEncryption = case T.decodeUtf8 `fmap` lookup "x-amz-server-side-encryption" h of Just x -> return $ parseServerSideEncryption x Nothing -> return Nothing ht = map ((T.decodeUtf8 . CI.foldedCase) *** T.decodeUtf8) h
1,943
false
true
0
14
836
458
233
225
null
null
spacekitteh/smcghc
libraries/base/Data/OldList.hs
bsd-3-clause
-- | The 'zip5' function takes five lists and returns a list of -- five-tuples, analogous to 'zip'. zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a,b,c,d,e)] zip5 = zipWith5 (,,,,)
218
zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a,b,c,d,e)] zip5 = zipWith5 (,,,,)
118
zip5 = zipWith5 (,,,,)
42
true
true
0
11
73
75
46
29
null
null
brendanhay/gogol
gogol-android-enterprise/gen/Network/Google/Resource/AndroidEnterprise/ManagedConfigurationssettings/List.hs
mpl-2.0
-- | The ID of the enterprise. mclEnterpriseId :: Lens' ManagedConfigurationssettingsList Text mclEnterpriseId = lens _mclEnterpriseId (\ s a -> s{_mclEnterpriseId = a})
177
mclEnterpriseId :: Lens' ManagedConfigurationssettingsList Text mclEnterpriseId = lens _mclEnterpriseId (\ s a -> s{_mclEnterpriseId = a})
146
mclEnterpriseId = lens _mclEnterpriseId (\ s a -> s{_mclEnterpriseId = a})
82
true
true
1
9
30
45
22
23
null
null
andrewMacmurray/haskell-book-solutions
src/ch11/vehicles.hs
mit
isCar :: Vehichle -> Bool isCar (Car _ _) = True
48
isCar :: Vehichle -> Bool isCar (Car _ _) = True
48
isCar (Car _ _) = True
22
false
true
0
7
10
26
13
13
null
null
abbradar/comps
src/Lab5a.hs
bsd-3-clause
tableOp :: OpCompare tableOp op a b = relationTable op M.! (a, b)
65
tableOp :: OpCompare tableOp op a b = relationTable op M.! (a, b)
65
tableOp op a b = relationTable op M.! (a, b)
44
false
true
0
7
12
39
18
21
null
null
takoeight0821/malgo
src/Malgo/Refine/Space.hs
bsd-3-clause
decompose (TyRecord kts) = do env <- ask pure $ Record $ over (mapped . _2) (space env) $ Map.toList kts
108
decompose (TyRecord kts) = do env <- ask pure $ Record $ over (mapped . _2) (space env) $ Map.toList kts
108
decompose (TyRecord kts) = do env <- ask pure $ Record $ over (mapped . _2) (space env) $ Map.toList kts
108
false
false
0
11
24
60
28
32
null
null
smly/dtwitzen
Request.hs
bsd-3-clause
reqTimeline :: Account -> IO (Result Response) reqTimeline = httpRequest . mkRequest
84
reqTimeline :: Account -> IO (Result Response) reqTimeline = httpRequest . mkRequest
84
reqTimeline = httpRequest . mkRequest
37
false
true
0
9
11
34
15
19
null
null
teuffy/min-var-ci
src/DataAnalysis/Application/Handler/Review.hs
mit
-- | Review the imported data, and the analysis upon that data. getReviewR :: Handler Html getReviewR = do SomeAnalysis{..} <- fmap appAnalysis getYesod (widget,enctype) <- runFormWithPolling (makeParamsForm analysisForm) {-(source,_) <- getById ident Nothing-} (datapoints,rows,timing,errs) <- runBenchedAnalysis defaultLayout $ do let title = "Stock Analysis" datapointsJson = toHtml (decodeUtf8 (encode (take 100 datapoints))) messages = toListOf (traverse . _DPM) datapoints ++ errs setTitle title $(widgetFileReload def "review") -- | Run the polling form, this is only activated from JavaScript.
640
getReviewR :: Handler Html getReviewR = do SomeAnalysis{..} <- fmap appAnalysis getYesod (widget,enctype) <- runFormWithPolling (makeParamsForm analysisForm) {-(source,_) <- getById ident Nothing-} (datapoints,rows,timing,errs) <- runBenchedAnalysis defaultLayout $ do let title = "Stock Analysis" datapointsJson = toHtml (decodeUtf8 (encode (take 100 datapoints))) messages = toListOf (traverse . _DPM) datapoints ++ errs setTitle title $(widgetFileReload def "review") -- | Run the polling form, this is only activated from JavaScript.
576
getReviewR = do SomeAnalysis{..} <- fmap appAnalysis getYesod (widget,enctype) <- runFormWithPolling (makeParamsForm analysisForm) {-(source,_) <- getById ident Nothing-} (datapoints,rows,timing,errs) <- runBenchedAnalysis defaultLayout $ do let title = "Stock Analysis" datapointsJson = toHtml (decodeUtf8 (encode (take 100 datapoints))) messages = toListOf (traverse . _DPM) datapoints ++ errs setTitle title $(widgetFileReload def "review") -- | Run the polling form, this is only activated from JavaScript.
549
true
true
0
19
117
159
79
80
null
null
pawel-n/lambda
Lambda/PrimOp.hs
apache-2.0
primNull :: MonadEval m => PrimOp m primNull = PrimOp "null" (TypeScheme (Set.singleton "a") (TFun (TList (TVar "a")) tBool)) (newObj . OFun $ \list -> do OList list' <- eval list if null list' then newObj $ OCons "True" [] else newObj $ OCons "False" [])
301
primNull :: MonadEval m => PrimOp m primNull = PrimOp "null" (TypeScheme (Set.singleton "a") (TFun (TList (TVar "a")) tBool)) (newObj . OFun $ \list -> do OList list' <- eval list if null list' then newObj $ OCons "True" [] else newObj $ OCons "False" [])
301
primNull = PrimOp "null" (TypeScheme (Set.singleton "a") (TFun (TList (TVar "a")) tBool)) (newObj . OFun $ \list -> do OList list' <- eval list if null list' then newObj $ OCons "True" [] else newObj $ OCons "False" [])
265
false
true
0
13
91
131
62
69
null
null
DanielWaterworth/Idris-dev
src/Idris/WhoCalls.hs
bsd-3-clause
occursBinder :: Name -> Binder Term -> Bool occursBinder n (Let ty val) = occurs n ty || occurs n val
101
occursBinder :: Name -> Binder Term -> Bool occursBinder n (Let ty val) = occurs n ty || occurs n val
101
occursBinder n (Let ty val) = occurs n ty || occurs n val
57
false
true
0
10
20
54
24
30
null
null
sol/pandoc
src/Text/Pandoc/Writers/OpenDocument.hs
gpl-2.0
-- | Auxiliary function to convert Plain block to Para. plainToPara :: Block -> Block plainToPara (Plain x) = Para x
116
plainToPara :: Block -> Block plainToPara (Plain x) = Para x
60
plainToPara (Plain x) = Para x
30
true
true
0
7
20
28
14
14
null
null
ComputationWithBoundedResources/jat
src/JFlow/ReachAC.hs
bsd-3-clause
rename :: (Var -> Var) -> RACFact -> RACFact rename f (RACFact rs cs) = RACFact (k `S.map` rs) (f `S.map` cs) where k (x:~>:y) = f x:~>:f y
141
rename :: (Var -> Var) -> RACFact -> RACFact rename f (RACFact rs cs) = RACFact (k `S.map` rs) (f `S.map` cs) where k (x:~>:y) = f x:~>:f y
141
rename f (RACFact rs cs) = RACFact (k `S.map` rs) (f `S.map` cs) where k (x:~>:y) = f x:~>:f y
96
false
true
0
7
30
99
50
49
null
null
thegreatpissant/haskell
LearnYouaHaskell/baby.hs
bsd-2-clause
circumference :: Float -> Float circumference r = 2 * pi * r
60
circumference :: Float -> Float circumference r = 2 * pi * r
60
circumference r = 2 * pi * r
28
false
true
0
6
12
26
13
13
null
null
tomahawkins/gigl
Hotel.hs
bsd-3-clause
-- Runs a RoomKey through a lock. Return a signal if the door unlocks. doorLock :: Int -> RoomKey -> GIGL (E Bool) doorLock room key = do -- Lock state. lock <- var ("doorLockState" ++ show room ++ "_lock") -- $ Just initLock -- Unlock the door if the key matches the lock state or if the old key value matches the new lock value. unlock <- var' ("doorLockState" ++ show room ++ "_unlock") $ key .== lock ||| old key .== new lock -- Update lock state: if the old key matches the new lock, then use the key as the next lock state, else keep the state the same. lock <== mux (old key .== new lock) key lock return unlock where old = Fst new = Snd -- Hotel events (event code, (room#, data pair)): -- checkin (1, (room#, _)) -- checkout (2, (room#, _)) -- access room (3, (room#, room key))
822
doorLock :: Int -> RoomKey -> GIGL (E Bool) doorLock room key = do -- Lock state. lock <- var ("doorLockState" ++ show room ++ "_lock") -- $ Just initLock -- Unlock the door if the key matches the lock state or if the old key value matches the new lock value. unlock <- var' ("doorLockState" ++ show room ++ "_unlock") $ key .== lock ||| old key .== new lock -- Update lock state: if the old key matches the new lock, then use the key as the next lock state, else keep the state the same. lock <== mux (old key .== new lock) key lock return unlock where old = Fst new = Snd -- Hotel events (event code, (room#, data pair)): -- checkin (1, (room#, _)) -- checkout (2, (room#, _)) -- access room (3, (room#, room key))
750
doorLock room key = do -- Lock state. lock <- var ("doorLockState" ++ show room ++ "_lock") -- $ Just initLock -- Unlock the door if the key matches the lock state or if the old key value matches the new lock value. unlock <- var' ("doorLockState" ++ show room ++ "_unlock") $ key .== lock ||| old key .== new lock -- Update lock state: if the old key matches the new lock, then use the key as the next lock state, else keep the state the same. lock <== mux (old key .== new lock) key lock return unlock where old = Fst new = Snd -- Hotel events (event code, (room#, data pair)): -- checkin (1, (room#, _)) -- checkout (2, (room#, _)) -- access room (3, (room#, room key))
706
true
true
0
16
190
158
78
80
null
null
jtapolczai/wumpus
Agent/Intelligent/Affect/Fragments.hs
apache-2.0
personalityFragment Enthusiasm "strong" = strongEnthusiasm
58
personalityFragment Enthusiasm "strong" = strongEnthusiasm
58
personalityFragment Enthusiasm "strong" = strongEnthusiasm
58
false
false
0
5
4
11
5
6
null
null
kim/amazonka
amazonka-rds/gen/Network/AWS/RDS/Types.hs
mpl-2.0
-- | Boolean value where true indicates that this option group option can be -- changed from the default value. ogosIsModifiable :: Lens' OptionGroupOptionSetting (Maybe Bool) ogosIsModifiable = lens _ogosIsModifiable (\s a -> s { _ogosIsModifiable = a })
255
ogosIsModifiable :: Lens' OptionGroupOptionSetting (Maybe Bool) ogosIsModifiable = lens _ogosIsModifiable (\s a -> s { _ogosIsModifiable = a })
143
ogosIsModifiable = lens _ogosIsModifiable (\s a -> s { _ogosIsModifiable = a })
79
true
true
1
9
38
52
26
26
null
null
olsner/ghc
testsuite/tests/typecheck/should_compile/T11397.hs
bsd-3-clause
unfoldrResult :: (a -> Either c (b, a)) -> a -> (VectorLazy b, c) unfoldrResult = undefined
91
unfoldrResult :: (a -> Either c (b, a)) -> a -> (VectorLazy b, c) unfoldrResult = undefined
91
unfoldrResult = undefined
25
false
true
0
9
16
46
25
21
null
null
rueshyna/gogol
gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs
mpl-2.0
-- | Identifies the message. This is automatically generated by the service; -- the caller should treat it as an opaque string. jmId :: Lens' JobMessage (Maybe Text) jmId = lens _jmId (\ s a -> s{_jmId = a})
207
jmId :: Lens' JobMessage (Maybe Text) jmId = lens _jmId (\ s a -> s{_jmId = a})
79
jmId = lens _jmId (\ s a -> s{_jmId = a})
41
true
true
2
9
38
56
26
30
null
null
markflorisson/hpack
testrepo/bytestring-0.10.2.0/tests/builder/Data/ByteString/Builder/Prim/TestUtils.hs
bsd-3-clause
coerceFloatToWord32 :: Float -> Word32 coerceFloatToWord32 = (.&. maxBound) . unsafeCoerce
90
coerceFloatToWord32 :: Float -> Word32 coerceFloatToWord32 = (.&. maxBound) . unsafeCoerce
90
coerceFloatToWord32 = (.&. maxBound) . unsafeCoerce
51
false
true
0
6
10
23
13
10
null
null
winterland1989/mysql-haskell
Database/MySQL/Protocol/ColumnDef.hs
bsd-3-clause
mySQLTypeEnum = FieldType 0xf7
40
mySQLTypeEnum = FieldType 0xf7
40
mySQLTypeEnum = FieldType 0xf7
40
false
false
1
5
13
12
4
8
null
null
uuhan/Idris-dev
src/Idris/REPL/Parser.hs
bsd-3-clause
optArgCmd names command doc = (names, OptionArg, doc, optArg command)
71
optArgCmd names command doc = (names, OptionArg, doc, optArg command)
71
optArgCmd names command doc = (names, OptionArg, doc, optArg command)
71
false
false
0
6
11
30
15
15
null
null
sw17ch/gator
examples/fullAdder.hs
bsd-3-clause
main :: IO () main = do l <- compile logic putStrLn "/* " print l putStrLn " */" putStrLn $ mkDot l
119
main :: IO () main = do l <- compile logic putStrLn "/* " print l putStrLn " */" putStrLn $ mkDot l
119
main = do l <- compile logic putStrLn "/* " print l putStrLn " */" putStrLn $ mkDot l
105
false
true
0
9
42
60
23
37
null
null
dfoxfranke/llvm-general-util
LLVM/General/Util/LibraryInfo.hs
mit
getLibraryFunctionName :: (MonadBaseControl IO m) => LibraryFunction -> L b m String getLibraryFunctionName lf = do li <- getLibraryInfo liftBase $ catchInternal 'T.getLibraryFunctionName $ T.getLibraryFunctionName li lf
260
getLibraryFunctionName :: (MonadBaseControl IO m) => LibraryFunction -> L b m String getLibraryFunctionName lf = do li <- getLibraryInfo liftBase $ catchInternal 'T.getLibraryFunctionName $ T.getLibraryFunctionName li lf
260
getLibraryFunctionName lf = do li <- getLibraryInfo liftBase $ catchInternal 'T.getLibraryFunctionName $ T.getLibraryFunctionName li lf
149
false
true
0
10
66
67
32
35
null
null
haskell/haddock
haddock-api/src/Haddock/GhcUtils.hs
bsd-2-clause
mkEmptySigType :: LHsType GhcRn -> LHsSigType GhcRn -- Dubious, because the implicit binders are empty even -- though the type might have free varaiables mkEmptySigType lty@(L loc ty) = L loc $ case ty of HsForAllTy { hst_tele = HsForAllInvis { hsf_invis_bndrs = bndrs } , hst_body = body } -> HsSig { sig_ext = noExtField , sig_bndrs = HsOuterExplicit { hso_xexplicit = noExtField , hso_bndrs = bndrs } , sig_body = body } _ -> HsSig { sig_ext = noExtField , sig_bndrs = HsOuterImplicit{hso_ximplicit = []} , sig_body = lty }
648
mkEmptySigType :: LHsType GhcRn -> LHsSigType GhcRn mkEmptySigType lty@(L loc ty) = L loc $ case ty of HsForAllTy { hst_tele = HsForAllInvis { hsf_invis_bndrs = bndrs } , hst_body = body } -> HsSig { sig_ext = noExtField , sig_bndrs = HsOuterExplicit { hso_xexplicit = noExtField , hso_bndrs = bndrs } , sig_body = body } _ -> HsSig { sig_ext = noExtField , sig_bndrs = HsOuterImplicit{hso_ximplicit = []} , sig_body = lty }
546
mkEmptySigType lty@(L loc ty) = L loc $ case ty of HsForAllTy { hst_tele = HsForAllInvis { hsf_invis_bndrs = bndrs } , hst_body = body } -> HsSig { sig_ext = noExtField , sig_bndrs = HsOuterExplicit { hso_xexplicit = noExtField , hso_bndrs = bndrs } , sig_body = body } _ -> HsSig { sig_ext = noExtField , sig_bndrs = HsOuterImplicit{hso_ximplicit = []} , sig_body = lty }
494
true
true
7
10
213
106
70
36
null
null
sheepforce/Haskell_Data.Chemistry
src/modules/Data/Chemistry/Spectrum.hs
gpl-3.0
convolutionSum :: Floating a => ((a, a) -> a -> a) -> [(a, a)] -> [a] -> [(a, a)] convolutionSum convFunc peaks grid = gridResult where convFunc' grid' peaks' = convFunc peaks' grid' gridPointVal p = sum . map (convFunc' p) $ peaks gridVal = map gridPointVal grid gridResult = zip grid gridVal -- | Convert from oscillator strength (dimensionless) to absorption coefficients (litre / (mol cm)) -- | The prefactor is taken from the Gaussian whitepaper, and the nominator multiplicator comes -- | from the prefactor expecting σ to be in cm^-1, but i give it in electron Volts instead
600
convolutionSum :: Floating a => ((a, a) -> a -> a) -> [(a, a)] -> [a] -> [(a, a)] convolutionSum convFunc peaks grid = gridResult where convFunc' grid' peaks' = convFunc peaks' grid' gridPointVal p = sum . map (convFunc' p) $ peaks gridVal = map gridPointVal grid gridResult = zip grid gridVal -- | Convert from oscillator strength (dimensionless) to absorption coefficients (litre / (mol cm)) -- | The prefactor is taken from the Gaussian whitepaper, and the nominator multiplicator comes -- | from the prefactor expecting σ to be in cm^-1, but i give it in electron Volts instead
600
convolutionSum convFunc peaks grid = gridResult where convFunc' grid' peaks' = convFunc peaks' grid' gridPointVal p = sum . map (convFunc' p) $ peaks gridVal = map gridPointVal grid gridResult = zip grid gridVal -- | Convert from oscillator strength (dimensionless) to absorption coefficients (litre / (mol cm)) -- | The prefactor is taken from the Gaussian whitepaper, and the nominator multiplicator comes -- | from the prefactor expecting σ to be in cm^-1, but i give it in electron Volts instead
518
false
true
3
10
119
141
75
66
null
null
kmilner/tamarin-prover
lib/theory/src/Theory/Text/Parser/Token.hs
gpl-3.0
hexColor :: Parser String hexColor = T.lexeme spthy (singleQuoted hexCode <|> hexCode) where hexCode = optional (symbol "#") *> many1 hexDigit -- | Parse a logical variable with the given sorts allowed.
209
hexColor :: Parser String hexColor = T.lexeme spthy (singleQuoted hexCode <|> hexCode) where hexCode = optional (symbol "#") *> many1 hexDigit -- | Parse a logical variable with the given sorts allowed.
209
hexColor = T.lexeme spthy (singleQuoted hexCode <|> hexCode) where hexCode = optional (symbol "#") *> many1 hexDigit -- | Parse a logical variable with the given sorts allowed.
183
false
true
0
8
38
56
27
29
null
null
arj/accelerate-matrices
Data/Array/Accelerate/Math/SMVM/MatrixMarket.hs
bsd-3-clause
format :: Parser Format format = string "coordinate" *> pure Coordinate <|> string "array" *> pure Array <?> "matrix format"
142
format :: Parser Format format = string "coordinate" *> pure Coordinate <|> string "array" *> pure Array <?> "matrix format"
142
format = string "coordinate" *> pure Coordinate <|> string "array" *> pure Array <?> "matrix format"
118
false
true
0
9
37
42
19
23
null
null
chrra/iCalendar
Text/ICalendar/Parser/Properties.hs
bsd-3-clause
parseTZName x = throwError $ "parseTZName: " ++ show x
54
parseTZName x = throwError $ "parseTZName: " ++ show x
54
parseTZName x = throwError $ "parseTZName: " ++ show x
54
false
false
5
5
9
26
9
17
null
null
ku-fpg/kansas-amber
System/Hardware/Haskino/Compiler.hs
bsd-3-clause
compileProcedure (IterateI8I32E br iv bf) = do b <- nextBind let bb = RemBindI b i <- nextBind let bi = RemBindI8 i j <- nextBind let bj = RemBindI32 j _ <- compileIterateProcedure Int8Type Int32Type b bb br i bi j bj iv bf return bj
265
compileProcedure (IterateI8I32E br iv bf) = do b <- nextBind let bb = RemBindI b i <- nextBind let bi = RemBindI8 i j <- nextBind let bj = RemBindI32 j _ <- compileIterateProcedure Int8Type Int32Type b bb br i bi j bj iv bf return bj
265
compileProcedure (IterateI8I32E br iv bf) = do b <- nextBind let bb = RemBindI b i <- nextBind let bi = RemBindI8 i j <- nextBind let bj = RemBindI32 j _ <- compileIterateProcedure Int8Type Int32Type b bb br i bi j bj iv bf return bj
265
false
false
0
10
78
112
49
63
null
null
Ming-Tang/FP15
src/FP15/Compiler/ImportedNames.hs
mit
empty :: ImportedNames empty = Imported MB.empty
48
empty :: ImportedNames empty = Imported MB.empty
48
empty = Imported MB.empty
25
false
true
0
6
6
16
8
8
null
null
HIPERFIT/futhark
src/Futhark/Analysis/PrimExp/Convert.hs
isc
primExpFromSubExpM _ (Constant v) = pure $ ValueExp v
53
primExpFromSubExpM _ (Constant v) = pure $ ValueExp v
53
primExpFromSubExpM _ (Constant v) = pure $ ValueExp v
53
false
false
1
6
8
26
11
15
null
null
mbrock/HBEAM
src/Language/Erlang/BEAM/Opcodes.hs
gpl-3.0
opcodeInfo 23 = ("loop_rec", 2)
31
opcodeInfo 23 = ("loop_rec", 2)
31
opcodeInfo 23 = ("loop_rec", 2)
31
false
false
0
5
4
15
8
7
null
null
TOSPIO/yi
src/library/Yi/Eval.hs
gpl-2.0
-- | Accessor for the published actions. Consider using -- 'publishAction'. publishedActions :: Field (M.HashMap String Action) publishedActions = customVariable . _publishedActionsA
182
publishedActions :: Field (M.HashMap String Action) publishedActions = customVariable . _publishedActionsA
106
publishedActions = customVariable . _publishedActionsA
54
true
true
0
8
21
30
16
14
null
null
alexander-at-github/eta
compiler/ETA/Prelude/PrelNames.hs
bsd-3-clause
realClassName = clsQual gHC_REAL (fsLit "Real") realClassKey
74
realClassName = clsQual gHC_REAL (fsLit "Real") realClassKey
74
realClassName = clsQual gHC_REAL (fsLit "Real") realClassKey
74
false
false
1
7
20
22
9
13
null
null
michaelficarra/purescript
src/Language/PureScript/TypeChecker/Skolems.hs
mit
skolemEscapeCheck _ = internalError "Untyped value passed to skolemEscapeCheck"
79
skolemEscapeCheck _ = internalError "Untyped value passed to skolemEscapeCheck"
79
skolemEscapeCheck _ = internalError "Untyped value passed to skolemEscapeCheck"
79
false
false
0
4
8
13
5
8
null
null
tyfkda/SolokusSolver
src/Parser.hs
bsd-3-clause
-- ex. "1,4" -> (0, 3) parsePos :: String -> Pos parsePos = (\(r : c : _) -> (read r - 1, read c - 1)) . splitString ','
120
parsePos :: String -> Pos parsePos = (\(r : c : _) -> (read r - 1, read c - 1)) . splitString ','
97
parsePos = (\(r : c : _) -> (read r - 1, read c - 1)) . splitString ','
71
true
true
0
10
29
62
33
29
null
null
vikraman/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
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribeSnapshotAttribute.hs
mpl-2.0
-- | The snapshot attribute you would like to view. dsaAttribute :: Lens' DescribeSnapshotAttribute SnapshotAttributeName dsaAttribute = lens _dsaAttribute (\s a -> s { _dsaAttribute = a })
189
dsaAttribute :: Lens' DescribeSnapshotAttribute SnapshotAttributeName dsaAttribute = lens _dsaAttribute (\s a -> s { _dsaAttribute = a })
137
dsaAttribute = lens _dsaAttribute (\s a -> s { _dsaAttribute = a })
67
true
true
0
9
27
40
22
18
null
null
ctlab/gShell
src/Main.hs
mit
parseCheckout :: Parser Command parseCheckout = parseEnterRevision
66
parseCheckout :: Parser Command parseCheckout = parseEnterRevision
66
parseCheckout = parseEnterRevision
34
false
true
0
5
6
14
7
7
null
null
piccolo-lang/piccolo
src/Core/Parser.hs
gpl-3.0
definition :: Parser Definition definition = do pos <- getPosition reserved "def" name <- identifier params <- parens $ commaSep param reserved "=" body <- process pos' <- getPosition return $ Definition name params body (-1) (mkLoc pos pos')
267
definition :: Parser Definition definition = do pos <- getPosition reserved "def" name <- identifier params <- parens $ commaSep param reserved "=" body <- process pos' <- getPosition return $ Definition name params body (-1) (mkLoc pos pos')
267
definition = do pos <- getPosition reserved "def" name <- identifier params <- parens $ commaSep param reserved "=" body <- process pos' <- getPosition return $ Definition name params body (-1) (mkLoc pos pos')
235
false
true
0
10
63
99
44
55
null
null
angerman/HInvoice
Views/AddProduct.hs
bsd-3-clause
toProduct st = do name' <- get $ name st price' <- liftM read . get $ price st base' <- liftM read . get $ base st currency' <- get $ currency st return $ mkProduct 0 name' price' base' currency' where get = liftM T.unpack . getEditText
259
toProduct st = do name' <- get $ name st price' <- liftM read . get $ price st base' <- liftM read . get $ base st currency' <- get $ currency st return $ mkProduct 0 name' price' base' currency' where get = liftM T.unpack . getEditText
259
toProduct st = do name' <- get $ name st price' <- liftM read . get $ price st base' <- liftM read . get $ base st currency' <- get $ currency st return $ mkProduct 0 name' price' base' currency' where get = liftM T.unpack . getEditText
259
false
false
2
10
71
121
50
71
null
null
bredelings/BAli-Phy
haskell/Probability/Distribution/Multinomial.hs
gpl-2.0
sample_multinomial n (p:ps) = do let normalize xs = map (/sum xs) xs m <- binomial n p ms <- sample_multinomial (n-m) (normalize ps) return (m:ms)
154
sample_multinomial n (p:ps) = do let normalize xs = map (/sum xs) xs m <- binomial n p ms <- sample_multinomial (n-m) (normalize ps) return (m:ms)
154
sample_multinomial n (p:ps) = do let normalize xs = map (/sum xs) xs m <- binomial n p ms <- sample_multinomial (n-m) (normalize ps) return (m:ms)
154
false
false
0
12
33
92
43
49
null
null
abakst/liquidhaskell
benchmarks/vector-0.10.0.1/Data/Vector/Primitive/Mutable.nocpp.hs
bsd-3-clause
unsafeDrop = G.unsafeDrop
25
unsafeDrop = G.unsafeDrop
25
unsafeDrop = G.unsafeDrop
25
false
false
0
5
2
8
4
4
null
null
Super-Fluid/heqet
Heqet/Input/Parse.hs
gpl-3.0
noteItem :: Parser NoteItem1 noteItem = (tie <|> try articulation <|> try with <|> try cents1 <|> try noteCommand) <* whiteSpace
128
noteItem :: Parser NoteItem1 noteItem = (tie <|> try articulation <|> try with <|> try cents1 <|> try noteCommand) <* whiteSpace
128
noteItem = (tie <|> try articulation <|> try with <|> try cents1 <|> try noteCommand) <* whiteSpace
99
false
true
0
11
20
49
23
26
null
null
simhu/cubical
CTT.hs
mit
-- Primitive notions primHandle :: [(Ident,Int,PN)] primHandle = [("Id" , 3, Id ), ("refl" , 2, Refl ), -- ("funExt" , 5, Ext ), ("funHExt" , 5, HExt ), ("inh" , 1, Inh ), ("inc" , 2, Inc ), ("squash" , 3, Squash ), ("inhrec" , 5, InhRec ), ("equivEq" , 5, EquivEq ), ("transport" , 4, TransU ), ("transpInv" , 4, TransInvU ), ("contrSingl" , 4, CSingl ), ("transportRef" , 2, TransURef ), ("equivEqRef" , 3, EquivEqRef ), ("transpEquivEq" , 6, TransUEquivEq), ("appOnPath" , 8, AppOnPath ), ("mapOnPath" , 6, MapOnPath ), ("IdP" , 5, IdP ), ("mapOnPathD" , 6, MapOnPathD ), ("mapOnPathS" , 10, MapOnPathS ), ("S1" , 0, Circle ), ("base" , 0, Base ), ("loop" , 0, Loop ), ("S1rec" , 4, CircleRec ), ("I" , 0, I ), ("I0" , 0, I0 ), ("I1" , 0, I1 ), ("line" , 0, Line ), ("intrec" , 5, IntRec )]
1,286
primHandle :: [(Ident,Int,PN)] primHandle = [("Id" , 3, Id ), ("refl" , 2, Refl ), -- ("funExt" , 5, Ext ), ("funHExt" , 5, HExt ), ("inh" , 1, Inh ), ("inc" , 2, Inc ), ("squash" , 3, Squash ), ("inhrec" , 5, InhRec ), ("equivEq" , 5, EquivEq ), ("transport" , 4, TransU ), ("transpInv" , 4, TransInvU ), ("contrSingl" , 4, CSingl ), ("transportRef" , 2, TransURef ), ("equivEqRef" , 3, EquivEqRef ), ("transpEquivEq" , 6, TransUEquivEq), ("appOnPath" , 8, AppOnPath ), ("mapOnPath" , 6, MapOnPath ), ("IdP" , 5, IdP ), ("mapOnPathD" , 6, MapOnPathD ), ("mapOnPathS" , 10, MapOnPathS ), ("S1" , 0, Circle ), ("base" , 0, Base ), ("loop" , 0, Loop ), ("S1rec" , 4, CircleRec ), ("I" , 0, I ), ("I0" , 0, I0 ), ("I1" , 0, I1 ), ("line" , 0, Line ), ("intrec" , 5, IntRec )]
1,265
primHandle = [("Id" , 3, Id ), ("refl" , 2, Refl ), -- ("funExt" , 5, Ext ), ("funHExt" , 5, HExt ), ("inh" , 1, Inh ), ("inc" , 2, Inc ), ("squash" , 3, Squash ), ("inhrec" , 5, InhRec ), ("equivEq" , 5, EquivEq ), ("transport" , 4, TransU ), ("transpInv" , 4, TransInvU ), ("contrSingl" , 4, CSingl ), ("transportRef" , 2, TransURef ), ("equivEqRef" , 3, EquivEqRef ), ("transpEquivEq" , 6, TransUEquivEq), ("appOnPath" , 8, AppOnPath ), ("mapOnPath" , 6, MapOnPath ), ("IdP" , 5, IdP ), ("mapOnPathD" , 6, MapOnPathD ), ("mapOnPathS" , 10, MapOnPathS ), ("S1" , 0, Circle ), ("base" , 0, Base ), ("loop" , 0, Loop ), ("S1rec" , 4, CircleRec ), ("I" , 0, I ), ("I0" , 0, I0 ), ("I1" , 0, I1 ), ("line" , 0, Line ), ("intrec" , 5, IntRec )]
1,234
true
true
0
6
645
361
240
121
null
null
google/hrepl
hrepl/tests/Warning.hs
apache-2.0
unused = "UNUSED"
17
unused = "UNUSED"
17
unused = "UNUSED"
17
false
false
1
5
2
10
3
7
null
null
23Skidoo/snap-loader-dynamic
src/Snap/Loader/Dynamic.hs
bsd-3-clause
format :: InterpreterError -> String format (UnknownError e) = "Unknown interpreter error:\r\n\r\n" ++ e
106
format :: InterpreterError -> String format (UnknownError e) = "Unknown interpreter error:\r\n\r\n" ++ e
106
format (UnknownError e) = "Unknown interpreter error:\r\n\r\n" ++ e
69
false
true
0
7
15
28
14
14
null
null
reiddraper/cauterize
src/Cauterize/Dynamic/Common.hs
bsd-3-clause
isNameOf "u32" (BDu32 _) = True
31
isNameOf "u32" (BDu32 _) = True
31
isNameOf "u32" (BDu32 _) = True
31
false
false
0
6
5
19
8
11
null
null
spacekitteh/smcghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
loadArrPtrsSize :: DynFlags -> CmmExpr -> CmmExpr loadArrPtrsSize dflags addr = CmmLoad (cmmOffsetB dflags addr off) (bWord dflags) where off = fixedHdrSize dflags + oFFSET_StgMutArrPtrs_ptrs dflags
199
loadArrPtrsSize :: DynFlags -> CmmExpr -> CmmExpr loadArrPtrsSize dflags addr = CmmLoad (cmmOffsetB dflags addr off) (bWord dflags) where off = fixedHdrSize dflags + oFFSET_StgMutArrPtrs_ptrs dflags
199
loadArrPtrsSize dflags addr = CmmLoad (cmmOffsetB dflags addr off) (bWord dflags) where off = fixedHdrSize dflags + oFFSET_StgMutArrPtrs_ptrs dflags
149
false
true
1
7
26
70
31
39
null
null
uwap/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
reflectErr (NoSuchVariable n) = raw_apply (Var $ reflErrName "NoSuchVariable") [reflectName n]
94
reflectErr (NoSuchVariable n) = raw_apply (Var $ reflErrName "NoSuchVariable") [reflectName n]
94
reflectErr (NoSuchVariable n) = raw_apply (Var $ reflErrName "NoSuchVariable") [reflectName n]
94
false
false
0
8
10
37
17
20
null
null
vikraman/ghc
compiler/types/Type.hs
bsd-3-clause
-- | If the type is a tyvar, possibly under a cast, returns it, along -- with the coercion. Thus, the co is :: kind tv ~R kind type getCastedTyVar_maybe :: Type -> Maybe (TyVar, Coercion) getCastedTyVar_maybe ty | Just ty' <- coreView ty = getCastedTyVar_maybe ty'
264
getCastedTyVar_maybe :: Type -> Maybe (TyVar, Coercion) getCastedTyVar_maybe ty | Just ty' <- coreView ty = getCastedTyVar_maybe ty'
132
getCastedTyVar_maybe ty | Just ty' <- coreView ty = getCastedTyVar_maybe ty'
76
true
true
0
9
46
52
24
28
null
null
antalsz/hs-to-coq
src/lib/HsToCoq/ConvertHaskell/Expr.hs
mit
convertExpr_ (HsLit NOEXTP lit) = case lit of GHC.HsChar _ c -> pure $ HsChar c HsCharPrim _ _ -> convUnsupported "`Char#' literals" GHC.HsString _ fs -> pure $ convertFastString fs HsStringPrim _ _ -> convUnsupported "`Addr#' literals" HsInt _ intl -> convert_int_literal "`Int'" (il_integer intl) HsIntPrim _ int -> convert_int_literal "`IntPrim'" int HsWordPrim _ _ -> convUnsupported "`Word#' literals" HsInt64Prim _ _ -> convUnsupported "`Int64#' literals" HsWord64Prim _ _ -> convUnsupported "`Word64#' literals" HsInteger _ int _ty -> convert_int_literal "`Integer'" int HsRat _ _ _ -> convUnsupported "`Rational' literals" HsFloatPrim _ _ -> convUnsupported "`Float#' literals" HsDoublePrim _ _ -> convUnsupported "`Double#' literals" #if __GLASGOW_HASKELL__ >= 806 XLit v -> noExtCon v #endif
951
convertExpr_ (HsLit NOEXTP lit) = case lit of GHC.HsChar _ c -> pure $ HsChar c HsCharPrim _ _ -> convUnsupported "`Char#' literals" GHC.HsString _ fs -> pure $ convertFastString fs HsStringPrim _ _ -> convUnsupported "`Addr#' literals" HsInt _ intl -> convert_int_literal "`Int'" (il_integer intl) HsIntPrim _ int -> convert_int_literal "`IntPrim'" int HsWordPrim _ _ -> convUnsupported "`Word#' literals" HsInt64Prim _ _ -> convUnsupported "`Int64#' literals" HsWord64Prim _ _ -> convUnsupported "`Word64#' literals" HsInteger _ int _ty -> convert_int_literal "`Integer'" int HsRat _ _ _ -> convUnsupported "`Rational' literals" HsFloatPrim _ _ -> convUnsupported "`Float#' literals" HsDoublePrim _ _ -> convUnsupported "`Double#' literals" #if __GLASGOW_HASKELL__ >= 806 XLit v -> noExtCon v #endif
951
convertExpr_ (HsLit NOEXTP lit) = case lit of GHC.HsChar _ c -> pure $ HsChar c HsCharPrim _ _ -> convUnsupported "`Char#' literals" GHC.HsString _ fs -> pure $ convertFastString fs HsStringPrim _ _ -> convUnsupported "`Addr#' literals" HsInt _ intl -> convert_int_literal "`Int'" (il_integer intl) HsIntPrim _ int -> convert_int_literal "`IntPrim'" int HsWordPrim _ _ -> convUnsupported "`Word#' literals" HsInt64Prim _ _ -> convUnsupported "`Int64#' literals" HsWord64Prim _ _ -> convUnsupported "`Word64#' literals" HsInteger _ int _ty -> convert_int_literal "`Integer'" int HsRat _ _ _ -> convUnsupported "`Rational' literals" HsFloatPrim _ _ -> convUnsupported "`Float#' literals" HsDoublePrim _ _ -> convUnsupported "`Double#' literals" #if __GLASGOW_HASKELL__ >= 806 XLit v -> noExtCon v #endif
951
false
false
0
10
263
246
109
137
null
null
patperry/hs-linear-algebra
tests-old/STMatrix.hs
bsd-3-clause
getIndices_S a = ( indices a, a )
33
getIndices_S a = ( indices a, a )
33
getIndices_S a = ( indices a, a )
33
false
false
0
6
7
18
9
9
null
null
julienschmaltz/madl
src/Deadlock/Nuxmv.hs
mit
-- | Produce a nuxmv model according to synchronous semantics syncModel :: ReachabilityInput -> String syncModel (ReachabilityInput net defs spec invs) = T.unpack . T.unlines $ nuxmv_module "main" varDefinitions ++ nuxmv_assign assignments ++ invariants ++ specification where varDefinitions = typesVar ++ concatMap (\cID -> varDefinition net cID (head $ outputTypes net cID)) (getComponentIDs net) ++ litVariables typesVar = if null types then [] else [nuxmv_constants $ map nuxmv_color types] litVariables = Set.toList . Set.fromList $ concatMap (nuxmvLiteralDecl net) (Map.keys defs) assignments = varInits ++ queueAssignments varInits = concatMap (\(n, c) -> varInit c (head $ outputTypes net n)) (getComponentsWithID net) queueAssignments = concatMap (\(n, c) -> stateUpdate net (n,c) (head $ outputTypes net n) islands) (getComponentsWithID net) invariants = generateInvariants net invs ++ map (nuxmvLiteralDef net) (Map.assocs defs) specification = case spec of Nothing -> [] Just spec' -> ["", nuxmv_invarspec (nuxmv_negate $ nuxmvFormula net spec')] types = networkTypes net islands = transferIslands contextNet contextNet = mapOnChannelsWithID getExtendedContext net getExtendedContext :: ChannelID -> a -> ChannelID getExtendedContext n _ = n -- | Translate a literal to nuxmv
1,376
syncModel :: ReachabilityInput -> String syncModel (ReachabilityInput net defs spec invs) = T.unpack . T.unlines $ nuxmv_module "main" varDefinitions ++ nuxmv_assign assignments ++ invariants ++ specification where varDefinitions = typesVar ++ concatMap (\cID -> varDefinition net cID (head $ outputTypes net cID)) (getComponentIDs net) ++ litVariables typesVar = if null types then [] else [nuxmv_constants $ map nuxmv_color types] litVariables = Set.toList . Set.fromList $ concatMap (nuxmvLiteralDecl net) (Map.keys defs) assignments = varInits ++ queueAssignments varInits = concatMap (\(n, c) -> varInit c (head $ outputTypes net n)) (getComponentsWithID net) queueAssignments = concatMap (\(n, c) -> stateUpdate net (n,c) (head $ outputTypes net n) islands) (getComponentsWithID net) invariants = generateInvariants net invs ++ map (nuxmvLiteralDef net) (Map.assocs defs) specification = case spec of Nothing -> [] Just spec' -> ["", nuxmv_invarspec (nuxmv_negate $ nuxmvFormula net spec')] types = networkTypes net islands = transferIslands contextNet contextNet = mapOnChannelsWithID getExtendedContext net getExtendedContext :: ChannelID -> a -> ChannelID getExtendedContext n _ = n -- | Translate a literal to nuxmv
1,314
syncModel (ReachabilityInput net defs spec invs) = T.unpack . T.unlines $ nuxmv_module "main" varDefinitions ++ nuxmv_assign assignments ++ invariants ++ specification where varDefinitions = typesVar ++ concatMap (\cID -> varDefinition net cID (head $ outputTypes net cID)) (getComponentIDs net) ++ litVariables typesVar = if null types then [] else [nuxmv_constants $ map nuxmv_color types] litVariables = Set.toList . Set.fromList $ concatMap (nuxmvLiteralDecl net) (Map.keys defs) assignments = varInits ++ queueAssignments varInits = concatMap (\(n, c) -> varInit c (head $ outputTypes net n)) (getComponentsWithID net) queueAssignments = concatMap (\(n, c) -> stateUpdate net (n,c) (head $ outputTypes net n) islands) (getComponentsWithID net) invariants = generateInvariants net invs ++ map (nuxmvLiteralDef net) (Map.assocs defs) specification = case spec of Nothing -> [] Just spec' -> ["", nuxmv_invarspec (nuxmv_negate $ nuxmvFormula net spec')] types = networkTypes net islands = transferIslands contextNet contextNet = mapOnChannelsWithID getExtendedContext net getExtendedContext :: ChannelID -> a -> ChannelID getExtendedContext n _ = n -- | Translate a literal to nuxmv
1,273
true
true
16
13
266
468
221
247
null
null
DavidAlphaFox/ghc
libraries/containers/benchmarks/Map.hs
bsd-3-clause
alt :: (Maybe Int -> Maybe Int) -> [Int] -> M.Map Int Int -> M.Map Int Int alt f xs m = foldl' (\m k -> M.alter f k m) m xs
123
alt :: (Maybe Int -> Maybe Int) -> [Int] -> M.Map Int Int -> M.Map Int Int alt f xs m = foldl' (\m k -> M.alter f k m) m xs
123
alt f xs m = foldl' (\m k -> M.alter f k m) m xs
48
false
true
0
10
31
91
43
48
null
null
andorp/grin
grin/src/AbstractInterpretation/LiveVariable/Result.hs
bsd-3-clause
hasLiveField :: Node -> Bool hasLiveField (Node tagLv fieldsLv) = or fieldsLv
77
hasLiveField :: Node -> Bool hasLiveField (Node tagLv fieldsLv) = or fieldsLv
77
hasLiveField (Node tagLv fieldsLv) = or fieldsLv
48
false
true
0
7
11
29
14
15
null
null
bitemyapp/hlint
data/Default.hs
bsd-3-clause
error "Evaluate" = x - 0 ==> x
30
error "Evaluate" = x - 0 ==> x
30
error "Evaluate" = x - 0 ==> x
30
false
false
2
5
7
25
9
16
null
null
aisamanra/matterhorn
src/Types.hs
bsd-3-clause
sendLogMessage :: LogManager -> LogMessage -> IO () sendLogMessage mgr lm = sendLogCommand mgr $ LogAMessage lm
111
sendLogMessage :: LogManager -> LogMessage -> IO () sendLogMessage mgr lm = sendLogCommand mgr $ LogAMessage lm
111
sendLogMessage mgr lm = sendLogCommand mgr $ LogAMessage lm
59
false
true
0
8
16
43
19
24
null
null
zaxtax/hakaru
haskell/Examples/SlamEmbed.hs
bsd-3-clause
sigmaZRads :: (Base repr) => repr Prob sigmaZRads = 1
53
sigmaZRads :: (Base repr) => repr Prob sigmaZRads = 1
53
sigmaZRads = 1
14
false
true
0
6
9
23
12
11
null
null
vikraman/ghc
compiler/basicTypes/NameEnv.hs
bsd-3-clause
disjointNameEnv x y = isNullUFM (intersectUFM x y)
54
disjointNameEnv x y = isNullUFM (intersectUFM x y)
54
disjointNameEnv x y = isNullUFM (intersectUFM x y)
54
false
false
0
7
11
22
10
12
null
null
TomMD/cbbgp
src/Main.hs
bsd-3-clause
-- Given an Ini that contains all required field, make a temporary -- directory and for each project: -- - C: git clone -- - B: build -- - B: benchmark -- - G: graph -- - P: git push runBenchs :: Config -> IO () runBenchs cfg = forM_ (HashMap.keys cfg) (\k -> cbbgp k (cfg HashMap.! k)) where -- For each project, build and run the relevant set of benchmarks. cbbgp :: Text -> BenchInfo -> IO () cbbgp (Text.unpack -> project) (BI {..}) = withSystemTempDirectory project $ \tmp -> do putStrLn $ "Benchmarking " ++ project ++ "..." setCurrentDirectory tmp srcDir <- gitClone srcRepo project putStrLn "\tCloned source repository" resultDir <- gitClone resultRepo (project ++ "-results") putStrLn "\tCloned result repository" buildResult <- doBuild buildCommand srcDir putStrLn "\tDone building" numbers <- doBench benchmarks srcDir putStrLn "\tDone running" dayHour <- formatTime defaultTimeLocale "%F::%T" <$> getCurrentTime let newResultsName = project </> dayHour <.> "raw.results" createDirectoryIfMissing True (resultDir </> project) tag <- getTag tagCommand project writeFile (resultDir </> newResultsName) (show (tag,numbers)) gitAddCommit resultDir newResultsName gitPush resultDir putStrLn "\tPushed raw results" X.catch (do graphFiles <- doGraph resultDir project putStrLn "\tGraphed results" mapM_ (gitAddCommit resultDir) graphFiles gitPush resultDir) (\(_ :: X.SomeException) -> return ()) -- Sometimes gnuplot produces an identical file and commit -- then fails. We don't care. putStrLn "\tPushed graphs - complete!" -- Build the project, returning an error or unit.
1,911
runBenchs :: Config -> IO () runBenchs cfg = forM_ (HashMap.keys cfg) (\k -> cbbgp k (cfg HashMap.! k)) where -- For each project, build and run the relevant set of benchmarks. cbbgp :: Text -> BenchInfo -> IO () cbbgp (Text.unpack -> project) (BI {..}) = withSystemTempDirectory project $ \tmp -> do putStrLn $ "Benchmarking " ++ project ++ "..." setCurrentDirectory tmp srcDir <- gitClone srcRepo project putStrLn "\tCloned source repository" resultDir <- gitClone resultRepo (project ++ "-results") putStrLn "\tCloned result repository" buildResult <- doBuild buildCommand srcDir putStrLn "\tDone building" numbers <- doBench benchmarks srcDir putStrLn "\tDone running" dayHour <- formatTime defaultTimeLocale "%F::%T" <$> getCurrentTime let newResultsName = project </> dayHour <.> "raw.results" createDirectoryIfMissing True (resultDir </> project) tag <- getTag tagCommand project writeFile (resultDir </> newResultsName) (show (tag,numbers)) gitAddCommit resultDir newResultsName gitPush resultDir putStrLn "\tPushed raw results" X.catch (do graphFiles <- doGraph resultDir project putStrLn "\tGraphed results" mapM_ (gitAddCommit resultDir) graphFiles gitPush resultDir) (\(_ :: X.SomeException) -> return ()) -- Sometimes gnuplot produces an identical file and commit -- then fails. We don't care. putStrLn "\tPushed graphs - complete!" -- Build the project, returning an error or unit.
1,703
runBenchs cfg = forM_ (HashMap.keys cfg) (\k -> cbbgp k (cfg HashMap.! k)) where -- For each project, build and run the relevant set of benchmarks. cbbgp :: Text -> BenchInfo -> IO () cbbgp (Text.unpack -> project) (BI {..}) = withSystemTempDirectory project $ \tmp -> do putStrLn $ "Benchmarking " ++ project ++ "..." setCurrentDirectory tmp srcDir <- gitClone srcRepo project putStrLn "\tCloned source repository" resultDir <- gitClone resultRepo (project ++ "-results") putStrLn "\tCloned result repository" buildResult <- doBuild buildCommand srcDir putStrLn "\tDone building" numbers <- doBench benchmarks srcDir putStrLn "\tDone running" dayHour <- formatTime defaultTimeLocale "%F::%T" <$> getCurrentTime let newResultsName = project </> dayHour <.> "raw.results" createDirectoryIfMissing True (resultDir </> project) tag <- getTag tagCommand project writeFile (resultDir </> newResultsName) (show (tag,numbers)) gitAddCommit resultDir newResultsName gitPush resultDir putStrLn "\tPushed raw results" X.catch (do graphFiles <- doGraph resultDir project putStrLn "\tGraphed results" mapM_ (gitAddCommit resultDir) graphFiles gitPush resultDir) (\(_ :: X.SomeException) -> return ()) -- Sometimes gnuplot produces an identical file and commit -- then fails. We don't care. putStrLn "\tPushed graphs - complete!" -- Build the project, returning an error or unit.
1,674
true
true
0
15
562
416
195
221
null
null
xmonad/xmonad-contrib
XMonad/Util/PureX.hs
bsd-3-clause
runPureX :: PureX a -> XConf -> XState -> (a, XState) runPureX (PureX m) = runState . runReaderT m
98
runPureX :: PureX a -> XConf -> XState -> (a, XState) runPureX (PureX m) = runState . runReaderT m
98
runPureX (PureX m) = runState . runReaderT m
44
false
true
0
8
18
48
24
24
null
null
gamebytes/helm
src/FRP/Helm/Utilities.hs
mit
{-| Applies a function to eight signals. -} lift8 :: (a -> b -> c -> d -> e -> f -> g -> h -> i) -> SignalGen (Signal a) -> SignalGen (Signal b) -> SignalGen (Signal c) -> SignalGen (Signal d) -> SignalGen (Signal e) -> SignalGen (Signal f) -> SignalGen (Signal g) -> SignalGen (Signal h) -> SignalGen (Signal i) lift8 f a b c d e f1 g h = f <~ a ~~ b ~~ c ~~ d ~~ e ~~ f1 ~~ g ~~ h
488
lift8 :: (a -> b -> c -> d -> e -> f -> g -> h -> i) -> SignalGen (Signal a) -> SignalGen (Signal b) -> SignalGen (Signal c) -> SignalGen (Signal d) -> SignalGen (Signal e) -> SignalGen (Signal f) -> SignalGen (Signal g) -> SignalGen (Signal h) -> SignalGen (Signal i) lift8 f a b c d e f1 g h = f <~ a ~~ b ~~ c ~~ d ~~ e ~~ f1 ~~ g ~~ h
444
lift8 f a b c d e f1 g h = f <~ a ~~ b ~~ c ~~ d ~~ e ~~ f1 ~~ g ~~ h
69
true
true
4
17
196
222
105
117
null
null
massysett/penny
penny/lib/Penny/Clatcher.hs
bsd-3-clause
-- | Choose which report to run. If you use multiple 'report' -- options, the reports will be shown one after the other. report :: Lens.Lens' Clatcher Report report = Lens.lens _report (\b l -> b { _report = l })
213
report :: Lens.Lens' Clatcher Report report = Lens.lens _report (\b l -> b { _report = l })
91
report = Lens.lens _report (\b l -> b { _report = l })
54
true
true
0
9
41
45
25
20
null
null
Ma-Ni/haspell
lib/Data/Trie.hs
mit
member (w:ws) (Trie _ _ st) = case M.lookup w st of Just st' -> member ws st' Nothing -> False -- | Insert new element in the @Trie@. -- If @Trie@ always contains the prefix of the element don't rewrite it.
217
member (w:ws) (Trie _ _ st) = case M.lookup w st of Just st' -> member ws st' Nothing -> False -- | Insert new element in the @Trie@. -- If @Trie@ always contains the prefix of the element don't rewrite it.
217
member (w:ws) (Trie _ _ st) = case M.lookup w st of Just st' -> member ws st' Nothing -> False -- | Insert new element in the @Trie@. -- If @Trie@ always contains the prefix of the element don't rewrite it.
217
false
false
0
8
52
63
30
33
null
null
Pold87/Haggressive
src-lib/Evaluation.hs
gpl-2.0
main :: IO () main = do (dir:_) <- getArgs files <- getFiles dir csvs <- mapM TI.readFile $ sort files let processedCsvs = map preprocess csvs r = map parseCsv processedCsvs listOfVectorOfTweets = rights r :: [V.Vector Tweet] -- Tweet vectors vTweets = V.concat listOfVectorOfTweets :: V.Vector Tweet aggTweets = filterByLabel vTweets "aggressive" :: V.Vector Tweet nonAggTweets = filterByLabel vTweets "non_aggressive" :: V.Vector Tweet -- Tweet dictionaries dict = createDictionary vTweets aggDict = createDictionary aggTweets nonAggDict = createDictionary nonAggTweets words = (encode $ sortBy (comparing $ snd) $ M.toList dict) :: L.ByteString aggWords = (encode $ sortBy (comparing $ snd) $ M.toList aggDict) :: L.ByteString nonAggWords = (encode $ sortBy (comparing $ snd) $ M.toList nonAggDict) :: L.ByteString -- Create a header header = encode ["word","frequency"] -- Write output to csv L.writeFile "agg_words.csv" $ header `L.append` aggWords L.writeFile "non_agg_words.csv" $ header `L.append` nonAggWords L.writeFile "words.csv" $ header `L.append` words print $ V.length aggTweets
1,255
main :: IO () main = do (dir:_) <- getArgs files <- getFiles dir csvs <- mapM TI.readFile $ sort files let processedCsvs = map preprocess csvs r = map parseCsv processedCsvs listOfVectorOfTweets = rights r :: [V.Vector Tweet] -- Tweet vectors vTweets = V.concat listOfVectorOfTweets :: V.Vector Tweet aggTweets = filterByLabel vTweets "aggressive" :: V.Vector Tweet nonAggTweets = filterByLabel vTweets "non_aggressive" :: V.Vector Tweet -- Tweet dictionaries dict = createDictionary vTweets aggDict = createDictionary aggTweets nonAggDict = createDictionary nonAggTweets words = (encode $ sortBy (comparing $ snd) $ M.toList dict) :: L.ByteString aggWords = (encode $ sortBy (comparing $ snd) $ M.toList aggDict) :: L.ByteString nonAggWords = (encode $ sortBy (comparing $ snd) $ M.toList nonAggDict) :: L.ByteString -- Create a header header = encode ["word","frequency"] -- Write output to csv L.writeFile "agg_words.csv" $ header `L.append` aggWords L.writeFile "non_agg_words.csv" $ header `L.append` nonAggWords L.writeFile "words.csv" $ header `L.append` words print $ V.length aggTweets
1,255
main = do (dir:_) <- getArgs files <- getFiles dir csvs <- mapM TI.readFile $ sort files let processedCsvs = map preprocess csvs r = map parseCsv processedCsvs listOfVectorOfTweets = rights r :: [V.Vector Tweet] -- Tweet vectors vTweets = V.concat listOfVectorOfTweets :: V.Vector Tweet aggTweets = filterByLabel vTweets "aggressive" :: V.Vector Tweet nonAggTweets = filterByLabel vTweets "non_aggressive" :: V.Vector Tweet -- Tweet dictionaries dict = createDictionary vTweets aggDict = createDictionary aggTweets nonAggDict = createDictionary nonAggTweets words = (encode $ sortBy (comparing $ snd) $ M.toList dict) :: L.ByteString aggWords = (encode $ sortBy (comparing $ snd) $ M.toList aggDict) :: L.ByteString nonAggWords = (encode $ sortBy (comparing $ snd) $ M.toList nonAggDict) :: L.ByteString -- Create a header header = encode ["word","frequency"] -- Write output to csv L.writeFile "agg_words.csv" $ header `L.append` aggWords L.writeFile "non_agg_words.csv" $ header `L.append` nonAggWords L.writeFile "words.csv" $ header `L.append` words print $ V.length aggTweets
1,241
false
true
0
15
314
378
191
187
null
null
SamirTalwar/Smoke
src/lib/Test/Smoke/Types/Tests.hs
mit
manyMaybe :: FromJSON a => Maybe Value -> Parser (Vector a) manyMaybe = maybe (return Vector.empty) many
104
manyMaybe :: FromJSON a => Maybe Value -> Parser (Vector a) manyMaybe = maybe (return Vector.empty) many
104
manyMaybe = maybe (return Vector.empty) many
44
false
true
0
10
16
53
23
30
null
null
vTurbine/ghc
compiler/cmm/PprC.hs
bsd-3-clause
te_Stmt (CmmUnsafeForeignCall target rs es) = do te_Target target mapM_ te_temp rs mapM_ te_Expr es
118
te_Stmt (CmmUnsafeForeignCall target rs es) = do te_Target target mapM_ te_temp rs mapM_ te_Expr es
118
te_Stmt (CmmUnsafeForeignCall target rs es) = do te_Target target mapM_ te_temp rs mapM_ te_Expr es
118
false
false
0
7
33
41
17
24
null
null
kadena-io/pact
src/Pact/Types/Persistence.hs
bsd-3-clause
toPersistDirect :: Term Name -> Either Text PersistDirect toPersistDirect (TNative n _ _ _ _ _ _) = pure $ PDNative n
117
toPersistDirect :: Term Name -> Either Text PersistDirect toPersistDirect (TNative n _ _ _ _ _ _) = pure $ PDNative n
117
toPersistDirect (TNative n _ _ _ _ _ _) = pure $ PDNative n
59
false
true
0
9
21
55
25
30
null
null
spechub/Hets
Persistence/Utils.hs
gpl-2.0
logicNameForDB :: Logic.Logic lid sublogics basic_spec sentence symb_items symb_map_items sign morphism symbol raw_symbol proof_tree => lid -> sublogics -> String logicNameForDB lid sublogic = logicNameForDBByName (language_name lid) $ sublogicName sublogic
294
logicNameForDB :: Logic.Logic lid sublogics basic_spec sentence symb_items symb_map_items sign morphism symbol raw_symbol proof_tree => lid -> sublogics -> String logicNameForDB lid sublogic = logicNameForDBByName (language_name lid) $ sublogicName sublogic
294
logicNameForDB lid sublogic = logicNameForDBByName (language_name lid) $ sublogicName sublogic
96
false
true
0
8
66
69
33
36
null
null
rueshyna/gogol
gogol-servicemanagement/gen/Network/Google/Resource/ServiceManagement/Services/GetIAMPolicy.hs
mpl-2.0
-- | Multipart request metadata. sgipPayload :: Lens' ServicesGetIAMPolicy GetIAMPolicyRequest sgipPayload = lens _sgipPayload (\ s a -> s{_sgipPayload = a})
159
sgipPayload :: Lens' ServicesGetIAMPolicy GetIAMPolicyRequest sgipPayload = lens _sgipPayload (\ s a -> s{_sgipPayload = a})
126
sgipPayload = lens _sgipPayload (\ s a -> s{_sgipPayload = a})
64
true
true
0
9
22
42
22
20
null
null
gitrookie/functionalcode
code/Haskell/stackjsonparser/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/autogen/Paths_jsonparser.hs
mit
bindir, libdir, datadir, libexecdir, sysconfdir :: FilePath bindir = "/home/gaurav/Documents/Programming/Haskell/jsonparser/.stack-work/install/x86_64-linux/lts-6.7/7.10.3/bin"
181
bindir, libdir, datadir, libexecdir, sysconfdir :: FilePath bindir = "/home/gaurav/Documents/Programming/Haskell/jsonparser/.stack-work/install/x86_64-linux/lts-6.7/7.10.3/bin"
180
bindir = "/home/gaurav/Documents/Programming/Haskell/jsonparser/.stack-work/install/x86_64-linux/lts-6.7/7.10.3/bin"
120
false
true
5
5
14
31
14
17
null
null
futtetennista/IntroductionToFunctionalProgramming
itfp/src/Chapter4.hs
mit
picture :: [Point] -> [String] picture = symbolise . bitmap . sortpoints
74
picture :: [Point] -> [String] picture = symbolise . bitmap . sortpoints
74
picture = symbolise . bitmap . sortpoints
43
false
true
0
6
13
29
16
13
null
null