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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
graninas/Haskell-Algorithms | Tests/Lessons/ListMap.hs | gpl-3.0 | oubleList''' = map (\x -> mul 2 x) l1
| 38 | doubleList''' = map (\x -> mul 2 x) l1 | 38 | doubleList''' = map (\x -> mul 2 x) l1 | 38 | false | false | 0 | 8 | 9 | 24 | 12 | 12 | null | null |
sol/pandoc | src/Text/Pandoc/Writers/LaTeX.hs | gpl-2.0 | elementToBeamer :: Int -> Element -> State WriterState [Block]
elementToBeamer _slideLevel (Blk b) = return [b] | 111 | elementToBeamer :: Int -> Element -> State WriterState [Block]
elementToBeamer _slideLevel (Blk b) = return [b] | 111 | elementToBeamer _slideLevel (Blk b) = return [b] | 48 | false | true | 0 | 10 | 15 | 48 | 23 | 25 | null | null |
rcook/github-api-haskell | src/Main.hs | mit | -- | Gets port number from given URI
--
-- Examples:
-- >>> uriGetPort (fromJust $ parseURI "https://www.example.com/a/b") 1234
-- Just 1234
-- >>> uriGetPort (fromJust $ parseURI "https://www.example.com:4567/a/b") 1234
-- Just 4567
-- >>> uriGetPort nullURI 1234
-- Nothing
uriGetPort :: URI -> Word16 -> Maybe Word16
uriGetPort uri defaultPort = do
auth <- uriAuthority uri
return $ case uriPort auth of
"" -> defaultPort
p -> (Prelude.read $ Prelude.tail p) :: Word16
-- | Gets full path from given URI
--
-- Examples:
-- >>> uriGetFullPath $ fromJust $ parseURI "https://www.example.com/a/b"
-- "/a/b"
-- >>> uriGetFullPath $ fromJust $ parseURI "https://www.example.com"
-- ""
-- >>> uriGetFullPath $ fromJust $ parseURI "https://www.example.com/"
-- "/"
-- >>> uriGetFullPath nullURI
-- "" | 833 | uriGetPort :: URI -> Word16 -> Maybe Word16
uriGetPort uri defaultPort = do
auth <- uriAuthority uri
return $ case uriPort auth of
"" -> defaultPort
p -> (Prelude.read $ Prelude.tail p) :: Word16
-- | Gets full path from given URI
--
-- Examples:
-- >>> uriGetFullPath $ fromJust $ parseURI "https://www.example.com/a/b"
-- "/a/b"
-- >>> uriGetFullPath $ fromJust $ parseURI "https://www.example.com"
-- ""
-- >>> uriGetFullPath $ fromJust $ parseURI "https://www.example.com/"
-- "/"
-- >>> uriGetFullPath nullURI
-- "" | 557 | uriGetPort uri defaultPort = do
auth <- uriAuthority uri
return $ case uriPort auth of
"" -> defaultPort
p -> (Prelude.read $ Prelude.tail p) :: Word16
-- | Gets full path from given URI
--
-- Examples:
-- >>> uriGetFullPath $ fromJust $ parseURI "https://www.example.com/a/b"
-- "/a/b"
-- >>> uriGetFullPath $ fromJust $ parseURI "https://www.example.com"
-- ""
-- >>> uriGetFullPath $ fromJust $ parseURI "https://www.example.com/"
-- "/"
-- >>> uriGetFullPath nullURI
-- "" | 513 | true | true | 0 | 15 | 157 | 105 | 59 | 46 | null | null |
alphaHeavy/hlint | data/Default.hs | gpl-2.0 | error = Nothing /= x ==> Data.Maybe.isJust x | 47 | error = Nothing /= x ==> Data.Maybe.isJust x | 47 | error = Nothing /= x ==> Data.Maybe.isJust x | 47 | false | false | 4 | 4 | 10 | 22 | 10 | 12 | null | null |
gentoo-haskell/hackport | Portage/Dependency/Print.hs | gpl-3.0 | -- both lower and upper bounds are present thus needs 2 atoms
-- TODO: '=foo-x.y.*' will take only one atom, not two
showDependInAnyOf d@(DependAtom (Atom _pn (DRange lb ub) _dattr))
| lb /= ZeroB && ub /= InfinityB
= sparens (showDepend d) | 283 | showDependInAnyOf d@(DependAtom (Atom _pn (DRange lb ub) _dattr))
| lb /= ZeroB && ub /= InfinityB
= sparens (showDepend d) | 166 | showDependInAnyOf d@(DependAtom (Atom _pn (DRange lb ub) _dattr))
| lb /= ZeroB && ub /= InfinityB
= sparens (showDepend d) | 166 | true | false | 0 | 11 | 84 | 70 | 33 | 37 | null | null |
haasn/vimus | src/Vimus/Command/Parser.hs | mit | satisfy :: (Char -> Bool) -> Parser Char
satisfy p = Parser go
where
go (x:xs)
| p x = Right (x, xs)
| otherwise = (Left . ParseError) ("satisfy: unexpected " ++ show x)
go "" = (Left . ParseError) "satisfy: unexpected end of input"
-- | Recognize a given character. | 303 | satisfy :: (Char -> Bool) -> Parser Char
satisfy p = Parser go
where
go (x:xs)
| p x = Right (x, xs)
| otherwise = (Left . ParseError) ("satisfy: unexpected " ++ show x)
go "" = (Left . ParseError) "satisfy: unexpected end of input"
-- | Recognize a given character. | 303 | satisfy p = Parser go
where
go (x:xs)
| p x = Right (x, xs)
| otherwise = (Left . ParseError) ("satisfy: unexpected " ++ show x)
go "" = (Left . ParseError) "satisfy: unexpected end of input"
-- | Recognize a given character. | 262 | false | true | 1 | 9 | 88 | 125 | 58 | 67 | null | null |
mortum5/programming | haskell/ITMO-Course/hw1/src/Test.hs | mit | tFirstNat = fromInteger (5) :: Nat | 34 | tFirstNat = fromInteger (5) :: Nat | 34 | tFirstNat = fromInteger (5) :: Nat | 34 | false | false | 0 | 6 | 5 | 15 | 8 | 7 | null | null |
Gwin73/Schemini | src/one-file-version/Schemini.hs | mit | evalExprList all@(List (Atom name : rest1) : rest2 : rest3) = do
env <- ask
case M.lookup name env of
(Just macro@(Macro _ _ _ _)) -> (expandMacro macro rest1) >>= \ x-> evalExprList $ x : rest2 : rest3
_ -> lift $ throwError $ BadSpecialForm $ List $ Atom "begin ..." : all | 299 | evalExprList all@(List (Atom name : rest1) : rest2 : rest3) = do
env <- ask
case M.lookup name env of
(Just macro@(Macro _ _ _ _)) -> (expandMacro macro rest1) >>= \ x-> evalExprList $ x : rest2 : rest3
_ -> lift $ throwError $ BadSpecialForm $ List $ Atom "begin ..." : all | 299 | evalExprList all@(List (Atom name : rest1) : rest2 : rest3) = do
env <- ask
case M.lookup name env of
(Just macro@(Macro _ _ _ _)) -> (expandMacro macro rest1) >>= \ x-> evalExprList $ x : rest2 : rest3
_ -> lift $ throwError $ BadSpecialForm $ List $ Atom "begin ..." : all | 299 | false | false | 0 | 14 | 79 | 142 | 70 | 72 | null | null |
pxqr/algorithm-wm | src/TyError.hs | mit | moveTop :: Exp -> [ExpPath]-> Exp
moveTop = foldr moveBack | 58 | moveTop :: Exp -> [ExpPath]-> Exp
moveTop = foldr moveBack | 58 | moveTop = foldr moveBack | 24 | false | true | 0 | 7 | 9 | 25 | 13 | 12 | null | null |
nna774/term | Testing/Term.hs | gpl-3.0 | containFreeValsT (Mul t0 t1) = containFreeValsT t0 ++ containFreeValsT t1 | 74 | containFreeValsT (Mul t0 t1) = containFreeValsT t0 ++ containFreeValsT t1 | 74 | containFreeValsT (Mul t0 t1) = containFreeValsT t0 ++ containFreeValsT t1 | 74 | false | false | 0 | 7 | 10 | 27 | 12 | 15 | null | null |
rzil/honours | LeavittPathAlgebras/LoopTest.hs | mit | bs ("",'b':ys) = [(1,("","bb"++ys))] | 36 | bs ("",'b':ys) = [(1,("","bb"++ys))] | 36 | bs ("",'b':ys) = [(1,("","bb"++ys))] | 36 | false | false | 0 | 8 | 3 | 39 | 22 | 17 | null | null |
imeckler/proof | TranslateTex.hs | mit | item = satisfy (== NoArgCmd "item") >> Block <$> many (satisfy (/= NoArgCmd "item")) | 84 | item = satisfy (== NoArgCmd "item") >> Block <$> many (satisfy (/= NoArgCmd "item")) | 84 | item = satisfy (== NoArgCmd "item") >> Block <$> many (satisfy (/= NoArgCmd "item")) | 84 | false | false | 1 | 10 | 13 | 43 | 20 | 23 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_ASM_DEFAULT :: Int
wxSTC_ASM_DEFAULT = 0 | 46 | wxSTC_ASM_DEFAULT :: Int
wxSTC_ASM_DEFAULT = 0 | 46 | wxSTC_ASM_DEFAULT = 0 | 21 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
rueshyna/gogol | gogol-books/gen/Network/Google/Books/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'AnnotationCurrentVersionRanges' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aGbImageRange'
--
-- * 'aContentVersion'
--
-- * 'aImageCfiRange'
--
-- * 'aGbTextRange'
--
-- * 'aCfiRange'
annotationCurrentVersionRanges
:: AnnotationCurrentVersionRanges
annotationCurrentVersionRanges =
AnnotationCurrentVersionRanges'
{ _aGbImageRange = Nothing
, _aContentVersion = Nothing
, _aImageCfiRange = Nothing
, _aGbTextRange = Nothing
, _aCfiRange = Nothing
} | 596 | annotationCurrentVersionRanges
:: AnnotationCurrentVersionRanges
annotationCurrentVersionRanges =
AnnotationCurrentVersionRanges'
{ _aGbImageRange = Nothing
, _aContentVersion = Nothing
, _aImageCfiRange = Nothing
, _aGbTextRange = Nothing
, _aCfiRange = Nothing
} | 296 | annotationCurrentVersionRanges =
AnnotationCurrentVersionRanges'
{ _aGbImageRange = Nothing
, _aContentVersion = Nothing
, _aImageCfiRange = Nothing
, _aGbTextRange = Nothing
, _aCfiRange = Nothing
} | 227 | true | true | 1 | 7 | 108 | 63 | 41 | 22 | null | null |
ssaavedra/liquidhaskell | src/Language/Haskell/Liquid/Types/PrettyPrint.hs | bsd-3-clause | ppTyConB bb
| ppShort bb = text . symbolString . dropModuleNames . symbol . render . ppTycon
| otherwise = ppTycon | 119 | ppTyConB bb
| ppShort bb = text . symbolString . dropModuleNames . symbol . render . ppTycon
| otherwise = ppTycon | 119 | ppTyConB bb
| ppShort bb = text . symbolString . dropModuleNames . symbol . render . ppTycon
| otherwise = ppTycon | 119 | false | false | 1 | 10 | 25 | 46 | 21 | 25 | null | null |
jtdaugherty/vty | src/Graphics/Vty/UnicodeWidthTable/Install.hs | bsd-3-clause | -- | Returns True if and only if a custom table has been allocated and
-- marked as ready for use.
--
-- This function is thread-safe.
isCustomTableReady :: IO Bool
isCustomTableReady = withInstallLock $ (== 1) <$> c_isCustomTableReady | 235 | isCustomTableReady :: IO Bool
isCustomTableReady = withInstallLock $ (== 1) <$> c_isCustomTableReady | 100 | isCustomTableReady = withInstallLock $ (== 1) <$> c_isCustomTableReady | 70 | true | true | 0 | 7 | 38 | 30 | 18 | 12 | null | null |
ejlilley/AbstractMusic | Canon.hs | gpl-3.0 | v4 = repeatPhrase 5 bass | 24 | v4 = repeatPhrase 5 bass | 24 | v4 = repeatPhrase 5 bass | 24 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
vizziv/Twocan | twocan.hs | mit | apply (VFun var expY env) valX = withEnv env . withVar var valX $ eval expY | 75 | apply (VFun var expY env) valX = withEnv env . withVar var valX $ eval expY | 75 | apply (VFun var expY env) valX = withEnv env . withVar var valX $ eval expY | 75 | false | false | 0 | 7 | 15 | 40 | 18 | 22 | null | null |
thomasjm/IHaskell | ipython-kernel/examples/Simple.hs | mit | eval (Exp x y) = eval x ^ eval y | 32 | eval (Exp x y) = eval x ^ eval y | 32 | eval (Exp x y) = eval x ^ eval y | 32 | false | false | 0 | 7 | 9 | 27 | 12 | 15 | null | null |
ardumont/haskell-lab | src/io/cli/test.hs | gpl-2.0 | -- *DeleteTodo> :browse System.Environment
-- getArgs :: IO [String]
-- getEnv :: String -> IO String
-- getEnvironment :: IO [(String, String)]
-- getProgName :: IO String
-- withArgs :: [String] -> IO a -> IO a
-- withProgName :: String -> IO a -> IO a
main :: IO ()
main = do args <- getArgs
progName <- getProgName
putStrLn "args:"
mapM_ putStrLn args
putStrLn ("progName: " ++ progName) | 432 | main :: IO ()
main = do args <- getArgs
progName <- getProgName
putStrLn "args:"
mapM_ putStrLn args
putStrLn ("progName: " ++ progName) | 176 | main = do args <- getArgs
progName <- getProgName
putStrLn "args:"
mapM_ putStrLn args
putStrLn ("progName: " ++ progName) | 162 | true | true | 1 | 10 | 110 | 68 | 32 | 36 | null | null |
ekmett/containers | Data/IntSet/Base.hs | bsd-3-clause | intersection (Tip kx1 bm1) t2 = intersectBM t2
where intersectBM (Bin p2 m2 l2 r2) | nomatch kx1 p2 m2 = Nil
| zero kx1 m2 = intersectBM l2
| otherwise = intersectBM r2
intersectBM (Tip kx2 bm2) | kx1 == kx2 = tip kx1 (bm1 .&. bm2)
| otherwise = Nil
intersectBM Nil = Nil | 413 | intersection (Tip kx1 bm1) t2 = intersectBM t2
where intersectBM (Bin p2 m2 l2 r2) | nomatch kx1 p2 m2 = Nil
| zero kx1 m2 = intersectBM l2
| otherwise = intersectBM r2
intersectBM (Tip kx2 bm2) | kx1 == kx2 = tip kx1 (bm1 .&. bm2)
| otherwise = Nil
intersectBM Nil = Nil | 413 | intersection (Tip kx1 bm1) t2 = intersectBM t2
where intersectBM (Bin p2 m2 l2 r2) | nomatch kx1 p2 m2 = Nil
| zero kx1 m2 = intersectBM l2
| otherwise = intersectBM r2
intersectBM (Tip kx2 bm2) | kx1 == kx2 = tip kx1 (bm1 .&. bm2)
| otherwise = Nil
intersectBM Nil = Nil | 413 | false | false | 1 | 8 | 197 | 141 | 64 | 77 | null | null |
michaelficarra/purescript | src/Language/PureScript/TypeChecker/Types.hs | mit | replaceTypeClassDictionaries ::
(Functor m, Applicative m, MonadState CheckState m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) =>
ModuleName ->
Expr ->
m Expr
replaceTypeClassDictionaries mn =
let (_, f, _) = everywhereOnValuesTopDownM return go return
in f
where
go (TypeClassDictionary constraint dicts) = entails mn dicts constraint
go other = return other
-- | Check the kind of a type, failing if it is not of kind *. | 457 | replaceTypeClassDictionaries ::
(Functor m, Applicative m, MonadState CheckState m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) =>
ModuleName ->
Expr ->
m Expr
replaceTypeClassDictionaries mn =
let (_, f, _) = everywhereOnValuesTopDownM return go return
in f
where
go (TypeClassDictionary constraint dicts) = entails mn dicts constraint
go other = return other
-- | Check the kind of a type, failing if it is not of kind *. | 457 | replaceTypeClassDictionaries mn =
let (_, f, _) = everywhereOnValuesTopDownM return go return
in f
where
go (TypeClassDictionary constraint dicts) = entails mn dicts constraint
go other = return other
-- | Check the kind of a type, failing if it is not of kind *. | 274 | false | true | 0 | 9 | 85 | 130 | 64 | 66 | null | null |
AubreyEAnderson/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | prop_readForClause6 = isOk readForClause "for ((;;))\ndo echo $i\ndone" | 71 | prop_readForClause6 = isOk readForClause "for ((;;))\ndo echo $i\ndone" | 71 | prop_readForClause6 = isOk readForClause "for ((;;))\ndo echo $i\ndone" | 71 | false | false | 0 | 5 | 7 | 11 | 5 | 6 | null | null |
aslatter/blog | Blog/Users.hs | gpl-3.0 | hashPassword :: ByteString -> IO ByteString
hashPassword pw = do
hashM <- BC.hashPasswordUsingPolicy hashingPolicy pw
case hashM of
Nothing{} -> error "Configuration error"
Just hash -> return hash
-- On auth success, if not using the current hashing policy,
-- re-hash and update users db with new hash. | 317 | hashPassword :: ByteString -> IO ByteString
hashPassword pw = do
hashM <- BC.hashPasswordUsingPolicy hashingPolicy pw
case hashM of
Nothing{} -> error "Configuration error"
Just hash -> return hash
-- On auth success, if not using the current hashing policy,
-- re-hash and update users db with new hash. | 317 | hashPassword pw = do
hashM <- BC.hashPasswordUsingPolicy hashingPolicy pw
case hashM of
Nothing{} -> error "Configuration error"
Just hash -> return hash
-- On auth success, if not using the current hashing policy,
-- re-hash and update users db with new hash. | 273 | false | true | 0 | 11 | 60 | 74 | 33 | 41 | null | null |
zcleghern/hchess | src/ChessRules.hs | mit | rookAtk :: Board -> Coord -> Coord -> Bool
rookAtk b (Coord x1 y1) (Coord x2 y2)
| y1 == y2 = if x1 > x2 then
rookCheckLast . take (x1 - x2) . drop x2 $ row b y1 else
rookCheckLast . take (x2 - x1) . drop x1 $ row b y1
| x1 == x2 = if y1 > y2 then
rookCheckLast . take (y1 - y2) . drop y2 $ col b x1 else
rookCheckLast . take (y2 - y1) . drop y1 $ col b x1
| otherwise = False | 465 | rookAtk :: Board -> Coord -> Coord -> Bool
rookAtk b (Coord x1 y1) (Coord x2 y2)
| y1 == y2 = if x1 > x2 then
rookCheckLast . take (x1 - x2) . drop x2 $ row b y1 else
rookCheckLast . take (x2 - x1) . drop x1 $ row b y1
| x1 == x2 = if y1 > y2 then
rookCheckLast . take (y1 - y2) . drop y2 $ col b x1 else
rookCheckLast . take (y2 - y1) . drop y1 $ col b x1
| otherwise = False | 465 | rookAtk b (Coord x1 y1) (Coord x2 y2)
| y1 == y2 = if x1 > x2 then
rookCheckLast . take (x1 - x2) . drop x2 $ row b y1 else
rookCheckLast . take (x2 - x1) . drop x1 $ row b y1
| x1 == x2 = if y1 > y2 then
rookCheckLast . take (y1 - y2) . drop y2 $ col b x1 else
rookCheckLast . take (y2 - y1) . drop y1 $ col b x1
| otherwise = False | 422 | false | true | 0 | 12 | 183 | 222 | 107 | 115 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/Resources/AppStreamImageBuilder.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appstream-imagebuilder.html#cfn-appstream-imagebuilder-name
asibName :: Lens' AppStreamImageBuilder (Maybe (Val Text))
asibName = lens _appStreamImageBuilderName (\s a -> s { _appStreamImageBuilderName = a }) | 288 | asibName :: Lens' AppStreamImageBuilder (Maybe (Val Text))
asibName = lens _appStreamImageBuilderName (\s a -> s { _appStreamImageBuilderName = a }) | 148 | asibName = lens _appStreamImageBuilderName (\s a -> s { _appStreamImageBuilderName = a }) | 89 | true | true | 0 | 9 | 22 | 52 | 28 | 24 | null | null |
erantapaa/simple-hunt | src/Hayoo/ParseSignature.hs | bsd-3-clause | isInfixType _ = False | 39 | isInfixType _ = False | 39 | isInfixType _ = False | 39 | false | false | 0 | 5 | 21 | 9 | 4 | 5 | null | null |
yu-i9/HaSC | src/HaSC/Prim/ASTtoIntermed.hs | mit | getRenameTable :: [ICode] -> IREnv [(String, String)]
getRenameTable = foldM f []
where f acc code = case code of
(ILabel lab) -> case lookup lab acc of
(Just _) -> return acc
Nothing -> do newlab <- freshLabel
return $ (lab,newlab):acc
_ -> return acc | 462 | getRenameTable :: [ICode] -> IREnv [(String, String)]
getRenameTable = foldM f []
where f acc code = case code of
(ILabel lab) -> case lookup lab acc of
(Just _) -> return acc
Nothing -> do newlab <- freshLabel
return $ (lab,newlab):acc
_ -> return acc | 462 | getRenameTable = foldM f []
where f acc code = case code of
(ILabel lab) -> case lookup lab acc of
(Just _) -> return acc
Nothing -> do newlab <- freshLabel
return $ (lab,newlab):acc
_ -> return acc | 408 | false | true | 0 | 18 | 255 | 129 | 64 | 65 | null | null |
spatial-reasoning/zeno | src/Benchmark.hs | bsd-2-clause | -- Analyze the benchmark (old version) ----------------------------------------
analyze bench = do
let (b,v,w,x,y,summaryMap, str') = Map.foldrWithKey
analyze' (0,0,0,0,0,Map.empty, "") bench
let str = "\nSUMMARY:\n\n"
++ "Networks total = " ++ show b ++ "\n\n"
++ "All methods together:\n #No, #Yes, #Undecided, #Timeout =\n "
++ (intercalate ", " $ map show [v,w,x,y]) ++ "\n\n"
++ Map.foldrWithKey showMethod "" summaryMap ++ "\n"
++ replicate 70 '-' ++ "\n" ++ str'
writeFile "BENCHMARK.RESULTS" str
putStrLn "\nResults saved to 'BENCHMARK.RESULTS'\n" | 644 | analyze bench = do
let (b,v,w,x,y,summaryMap, str') = Map.foldrWithKey
analyze' (0,0,0,0,0,Map.empty, "") bench
let str = "\nSUMMARY:\n\n"
++ "Networks total = " ++ show b ++ "\n\n"
++ "All methods together:\n #No, #Yes, #Undecided, #Timeout =\n "
++ (intercalate ", " $ map show [v,w,x,y]) ++ "\n\n"
++ Map.foldrWithKey showMethod "" summaryMap ++ "\n"
++ replicate 70 '-' ++ "\n" ++ str'
writeFile "BENCHMARK.RESULTS" str
putStrLn "\nResults saved to 'BENCHMARK.RESULTS'\n" | 563 | analyze bench = do
let (b,v,w,x,y,summaryMap, str') = Map.foldrWithKey
analyze' (0,0,0,0,0,Map.empty, "") bench
let str = "\nSUMMARY:\n\n"
++ "Networks total = " ++ show b ++ "\n\n"
++ "All methods together:\n #No, #Yes, #Undecided, #Timeout =\n "
++ (intercalate ", " $ map show [v,w,x,y]) ++ "\n\n"
++ Map.foldrWithKey showMethod "" summaryMap ++ "\n"
++ replicate 70 '-' ++ "\n" ++ str'
writeFile "BENCHMARK.RESULTS" str
putStrLn "\nResults saved to 'BENCHMARK.RESULTS'\n" | 563 | true | false | 0 | 20 | 165 | 184 | 95 | 89 | null | null |
reuleaux/pire | src/Pire/Traversal.hs | bsd-3-clause | -- trE f (Paren e) = Paren $ (trE f) e
trE f (Paren_ po e pc) = f $ Paren_ po (trE f e) pc | 91 | trE f (Paren_ po e pc) = f $ Paren_ po (trE f e) pc | 51 | trE f (Paren_ po e pc) = f $ Paren_ po (trE f e) pc | 51 | true | false | 0 | 8 | 26 | 42 | 20 | 22 | null | null |
stepcut/plugins | src/System/Plugins/Utils.hs | lgpl-2.1 | output_flags = std_flags .|. o_CREAT | 39 | output_flags = std_flags .|. o_CREAT | 39 | output_flags = std_flags .|. o_CREAT | 39 | false | false | 0 | 5 | 7 | 10 | 5 | 5 | null | null |
ClathomasPrime/ImpCore | uScheme/src/AST.hs | bsd-3-clause | lookupRef :: VarName -> RefEnv -> Maybe Location
lookupRef = Map.lookup | 71 | lookupRef :: VarName -> RefEnv -> Maybe Location
lookupRef = Map.lookup | 71 | lookupRef = Map.lookup | 22 | false | true | 0 | 7 | 10 | 24 | 12 | 12 | null | null |
avieth/Algebraic | Examples/PrinterParser.hs | bsd-3-clause | -- Example 3: we can also print/parse sums. Notice that we still give a
-- *product* of parsers.
example3 = parserPrinterOfSum (example1 .*. example1) | 150 | example3 = parserPrinterOfSum (example1 .*. example1) | 53 | example3 = parserPrinterOfSum (example1 .*. example1) | 53 | true | false | 0 | 7 | 23 | 18 | 10 | 8 | null | null |
a143753/AOJ | 0041.hs | apache-2.0 | main = do
c <- getContents
let i = takeWhile (/= [0,0,0,0]) $ map (map read) $ map words $ lines c :: [[Int]]
o = map ans i
mapM_ putStrLn o | 152 | main = do
c <- getContents
let i = takeWhile (/= [0,0,0,0]) $ map (map read) $ map words $ lines c :: [[Int]]
o = map ans i
mapM_ putStrLn o | 152 | main = do
c <- getContents
let i = takeWhile (/= [0,0,0,0]) $ map (map read) $ map words $ lines c :: [[Int]]
o = map ans i
mapM_ putStrLn o | 152 | false | false | 0 | 15 | 43 | 95 | 48 | 47 | null | null |
Chobbes/Juicy.Pixels | src/Codec/Picture/Saving.hs | bsd-3-clause | imageToGif (ImageRGBF img) = imageToGif . ImageRGB8 $ toStandardDef img | 73 | imageToGif (ImageRGBF img) = imageToGif . ImageRGB8 $ toStandardDef img | 73 | imageToGif (ImageRGBF img) = imageToGif . ImageRGB8 $ toStandardDef img | 73 | false | false | 0 | 7 | 11 | 26 | 12 | 14 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxEVT_NULL :: Int
wxEVT_NULL = 0 | 32 | wxEVT_NULL :: Int
wxEVT_NULL = 0 | 32 | wxEVT_NULL = 0 | 14 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
achirkin/qua-view | Setup.hs | mit | -- | Here is the place where we store
makeCssGenPath :: FilePath -> FilePath
makeCssGenPath buildD = buildD </> myExeName </> (myExeName ++ "-tmp") </> "CssGen" | 160 | makeCssGenPath :: FilePath -> FilePath
makeCssGenPath buildD = buildD </> myExeName </> (myExeName ++ "-tmp") </> "CssGen" | 122 | makeCssGenPath buildD = buildD </> myExeName </> (myExeName ++ "-tmp") </> "CssGen" | 83 | true | true | 0 | 8 | 25 | 38 | 20 | 18 | null | null |
ajhc/drift | src/GenUtil.hs | mit | xpandTabs' :: Int -> Int -> String -> String
expandTabs' 0 _ s = filter (/= '\t') s
| 84 | expandTabs' :: Int -> Int -> String -> String
expandTabs' 0 _ s = filter (/= '\t') s | 84 | expandTabs' 0 _ s = filter (/= '\t') s | 38 | false | true | 0 | 9 | 18 | 45 | 21 | 24 | null | null |
worksap-ate/aws-sdk | Cloud/AWS/EC2/VPC.hs | bsd-3-clause | ------------------------------------------------------------
-- describeCustomerGateway
------------------------------------------------------------
describeCustomerGateway
:: (MonadResource m, MonadBaseControl IO m)
=> [Text] -- ^ CustomerGatewayId
-> [Filter] -- ^ Filters
-> EC2 m (ResumableSource m CustomerGateway)
describeCustomerGateway ids filters = do
ec2QuerySource "DescribeCustomerGateways" params path $
itemConduit customerGatewayConv
where
path = itemsPath "customerGatewaySet"
params =
[ "CustomerGatewayId" |.#= ids
, filtersParam filters
] | 619 | describeCustomerGateway
:: (MonadResource m, MonadBaseControl IO m)
=> [Text] -- ^ CustomerGatewayId
-> [Filter] -- ^ Filters
-> EC2 m (ResumableSource m CustomerGateway)
describeCustomerGateway ids filters = do
ec2QuerySource "DescribeCustomerGateways" params path $
itemConduit customerGatewayConv
where
path = itemsPath "customerGatewaySet"
params =
[ "CustomerGatewayId" |.#= ids
, filtersParam filters
] | 470 | describeCustomerGateway ids filters = do
ec2QuerySource "DescribeCustomerGateways" params path $
itemConduit customerGatewayConv
where
path = itemsPath "customerGatewaySet"
params =
[ "CustomerGatewayId" |.#= ids
, filtersParam filters
] | 283 | true | true | 0 | 11 | 115 | 116 | 59 | 57 | null | null |
ihc/futhark | src/Futhark/Analysis/PrimExp/Convert.hs | isc | primExpToExp f (UnOpExp op x) =
BasicOp <$> (UnOp op <$> primExpToSubExp "unop_x" f x) | 88 | primExpToExp f (UnOpExp op x) =
BasicOp <$> (UnOp op <$> primExpToSubExp "unop_x" f x) | 88 | primExpToExp f (UnOpExp op x) =
BasicOp <$> (UnOp op <$> primExpToSubExp "unop_x" f x) | 88 | false | false | 2 | 8 | 16 | 42 | 19 | 23 | null | null |
kim/amazonka | amazonka-rds/gen/Network/AWS/RDS/RestoreDBInstanceFromDBSnapshot.hs | mpl-2.0 | -- | The EC2 Availability Zone that the database instance will be created in.
--
-- Default: A random, system-chosen Availability Zone.
--
-- Constraint: You cannot specify the AvailabilityZone parameter if the MultiAZ
-- parameter is set to 'true'.
--
-- Example: 'us-east-1a'
rdbifdbsAvailabilityZone :: Lens' RestoreDBInstanceFromDBSnapshot (Maybe Text)
rdbifdbsAvailabilityZone =
lens _rdbifdbsAvailabilityZone
(\s a -> s { _rdbifdbsAvailabilityZone = a }) | 472 | rdbifdbsAvailabilityZone :: Lens' RestoreDBInstanceFromDBSnapshot (Maybe Text)
rdbifdbsAvailabilityZone =
lens _rdbifdbsAvailabilityZone
(\s a -> s { _rdbifdbsAvailabilityZone = a }) | 194 | rdbifdbsAvailabilityZone =
lens _rdbifdbsAvailabilityZone
(\s a -> s { _rdbifdbsAvailabilityZone = a }) | 115 | true | true | 0 | 8 | 74 | 54 | 32 | 22 | null | null |
brendanhay/gogol | gogol-slides/gen/Network/Google/Slides/Types/Product.hs | mpl-2.0 | -- | The rotation angle of the crop window around its center, in radians.
-- Rotation angle is applied after the offset.
cpAngle :: Lens' CropProperties (Maybe Double)
cpAngle
= lens _cpAngle (\ s a -> s{_cpAngle = a}) .
mapping _Coerce | 244 | cpAngle :: Lens' CropProperties (Maybe Double)
cpAngle
= lens _cpAngle (\ s a -> s{_cpAngle = a}) .
mapping _Coerce | 123 | cpAngle
= lens _cpAngle (\ s a -> s{_cpAngle = a}) .
mapping _Coerce | 76 | true | true | 0 | 10 | 49 | 56 | 29 | 27 | null | null |
vdweegen/UvA-Software_Testing | Lab3/Jordan/Exercises.hs | gpl-3.0 | expected_forms = [
("(10 ==> 1)", Impl (Prop 10) (Prop 1)),
("(10 ==> 9)", Impl (Prop 10) (Prop 9)),
("*(10 1)", Cnj [(Prop 10),(Prop 1)]),
("-+(1 2)", Neg( Dsj [(Prop 1),(Prop 2)]))
] | 204 | expected_forms = [
("(10 ==> 1)", Impl (Prop 10) (Prop 1)),
("(10 ==> 9)", Impl (Prop 10) (Prop 9)),
("*(10 1)", Cnj [(Prop 10),(Prop 1)]),
("-+(1 2)", Neg( Dsj [(Prop 1),(Prop 2)]))
] | 204 | expected_forms = [
("(10 ==> 1)", Impl (Prop 10) (Prop 1)),
("(10 ==> 9)", Impl (Prop 10) (Prop 9)),
("*(10 1)", Cnj [(Prop 10),(Prop 1)]),
("-+(1 2)", Neg( Dsj [(Prop 1),(Prop 2)]))
] | 204 | false | false | 1 | 12 | 52 | 127 | 68 | 59 | null | null |
nevrenato/Hets_Fork | OWL2/XMLKeywords.hs | gpl-2.0 | dataMinCardinalityK :: String
dataMinCardinalityK = "DataMinCardinality" | 72 | dataMinCardinalityK :: String
dataMinCardinalityK = "DataMinCardinality" | 72 | dataMinCardinalityK = "DataMinCardinality" | 42 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
ankeshs/numerikell | dist/build/autogen/Paths_Numerikell.hs | bsd-3-clause | getLibexecDir = catchIO (getEnv "Numerikell_libexecdir") (\_ -> return libexecdir) | 82 | getLibexecDir = catchIO (getEnv "Numerikell_libexecdir") (\_ -> return libexecdir) | 82 | getLibexecDir = catchIO (getEnv "Numerikell_libexecdir") (\_ -> return libexecdir) | 82 | false | false | 0 | 8 | 8 | 28 | 14 | 14 | null | null |
IreneKnapp/Faction | libfaction/Distribution/Simple/Setup.hs | bsd-3-clause | buildCommand :: ProgramConfiguration -> CommandUI BuildFlags
buildCommand progConf = makeCommand name shortDesc longDesc defaultBuildFlags options
where
name = "build"
shortDesc = "Make this package ready for installation."
longDesc = Nothing
options showOrParseArgs =
optionVerbosity buildVerbosity (\v flags -> flags { buildVerbosity = v })
: optionDistPref
buildDistPref (\d flags -> flags { buildDistPref = d })
showOrParseArgs
: programConfigurationPaths progConf showOrParseArgs
buildProgramPaths (\v flags -> flags { buildProgramPaths = v})
++ programConfigurationOptions progConf showOrParseArgs
buildProgramArgs (\v flags -> flags { buildProgramArgs = v}) | 758 | buildCommand :: ProgramConfiguration -> CommandUI BuildFlags
buildCommand progConf = makeCommand name shortDesc longDesc defaultBuildFlags options
where
name = "build"
shortDesc = "Make this package ready for installation."
longDesc = Nothing
options showOrParseArgs =
optionVerbosity buildVerbosity (\v flags -> flags { buildVerbosity = v })
: optionDistPref
buildDistPref (\d flags -> flags { buildDistPref = d })
showOrParseArgs
: programConfigurationPaths progConf showOrParseArgs
buildProgramPaths (\v flags -> flags { buildProgramPaths = v})
++ programConfigurationOptions progConf showOrParseArgs
buildProgramArgs (\v flags -> flags { buildProgramArgs = v}) | 758 | buildCommand progConf = makeCommand name shortDesc longDesc defaultBuildFlags options
where
name = "build"
shortDesc = "Make this package ready for installation."
longDesc = Nothing
options showOrParseArgs =
optionVerbosity buildVerbosity (\v flags -> flags { buildVerbosity = v })
: optionDistPref
buildDistPref (\d flags -> flags { buildDistPref = d })
showOrParseArgs
: programConfigurationPaths progConf showOrParseArgs
buildProgramPaths (\v flags -> flags { buildProgramPaths = v})
++ programConfigurationOptions progConf showOrParseArgs
buildProgramArgs (\v flags -> flags { buildProgramArgs = v}) | 697 | false | true | 9 | 9 | 176 | 193 | 93 | 100 | null | null |
TransformingMusicology/tabcode-haskell | src/TabCode/Serialiser/MEIXML/Serialiser.hs | gpl-3.0 | meiDoc (MEIRest attrs children) xmlIds =
meiXml "rest" attrs children xmlIds | 79 | meiDoc (MEIRest attrs children) xmlIds =
meiXml "rest" attrs children xmlIds | 79 | meiDoc (MEIRest attrs children) xmlIds =
meiXml "rest" attrs children xmlIds | 79 | false | false | 0 | 7 | 13 | 28 | 13 | 15 | null | null |
danidiaz/pianola | src/Pianola/Geometry.hs | mit | mid :: Interval -> Point1d
mid (x1,x2) = div (x1+x2) 2 | 54 | mid :: Interval -> Point1d
mid (x1,x2) = div (x1+x2) 2 | 54 | mid (x1,x2) = div (x1+x2) 2 | 27 | false | true | 0 | 7 | 10 | 36 | 19 | 17 | null | null |
donnie4w/tim | protocols/gen-hs/Tim_Types.hs | apache-2.0 | write_TimRoom :: (T.Protocol p, T.Transport t) => p t -> TimRoom -> P.IO ()
write_TimRoom oprot record = T.writeVal oprot $ from_TimRoom record | 143 | write_TimRoom :: (T.Protocol p, T.Transport t) => p t -> TimRoom -> P.IO ()
write_TimRoom oprot record = T.writeVal oprot $ from_TimRoom record | 143 | write_TimRoom oprot record = T.writeVal oprot $ from_TimRoom record | 67 | false | true | 0 | 9 | 22 | 65 | 31 | 34 | null | null |
itkovian/number-six | src/NumberSix/Handlers/Gods.hs | bsd-3-clause | printGods :: Irc ()
printGods = do
gods <- getGods
write $ "My gods are " <> prettyList (map (T.pack . show) gods) <> "." | 129 | printGods :: Irc ()
printGods = do
gods <- getGods
write $ "My gods are " <> prettyList (map (T.pack . show) gods) <> "." | 129 | printGods = do
gods <- getGods
write $ "My gods are " <> prettyList (map (T.pack . show) gods) <> "." | 109 | false | true | 0 | 14 | 32 | 58 | 28 | 30 | null | null |
mattgreen/hython | src/Language/Python/Lexer.hs | gpl-3.0 | manyTill1
:: Stream s m t =>
ParsecT s u m a -> ParsecT s u m end -> ParsecT s u m [a]
manyTill1 p end = do
x <- p
xs <- manyTill p end
return (x:xs) | 171 | manyTill1
:: Stream s m t =>
ParsecT s u m a -> ParsecT s u m end -> ParsecT s u m [a]
manyTill1 p end = do
x <- p
xs <- manyTill p end
return (x:xs) | 171 | manyTill1 p end = do
x <- p
xs <- manyTill p end
return (x:xs) | 77 | false | true | 0 | 10 | 60 | 101 | 46 | 55 | null | null |
brendanhay/gogol | gogol-drive/gen/Network/Google/Drive/Types/Product.hs | mpl-2.0 | -- | The time at which this permission will expire (RFC 3339 date-time).
-- Expiration times have the following restrictions: - They can only be set
-- on user and group permissions - The time must be in the future - The
-- time cannot be more than a year in the future
pExpirationTime :: Lens' Permission (Maybe UTCTime)
pExpirationTime
= lens _pExpirationTime
(\ s a -> s{_pExpirationTime = a})
. mapping _DateTime | 430 | pExpirationTime :: Lens' Permission (Maybe UTCTime)
pExpirationTime
= lens _pExpirationTime
(\ s a -> s{_pExpirationTime = a})
. mapping _DateTime | 160 | pExpirationTime
= lens _pExpirationTime
(\ s a -> s{_pExpirationTime = a})
. mapping _DateTime | 108 | true | true | 0 | 10 | 86 | 58 | 31 | 27 | null | null |
ksaveljev/hake-2 | src/Game/Monsters/MHover.hs | bsd-3-clause | hoverFramesAttack1 :: V.Vector MFrameT
hoverFramesAttack1 =
V.fromList [ MFrameT (Just GameAI.aiCharge) (-10) (Just hoverFireBlaster)
, MFrameT (Just GameAI.aiCharge) (-10) (Just hoverFireBlaster)
, MFrameT (Just GameAI.aiCharge) 0 (Just hoverReAttack)
] | 307 | hoverFramesAttack1 :: V.Vector MFrameT
hoverFramesAttack1 =
V.fromList [ MFrameT (Just GameAI.aiCharge) (-10) (Just hoverFireBlaster)
, MFrameT (Just GameAI.aiCharge) (-10) (Just hoverFireBlaster)
, MFrameT (Just GameAI.aiCharge) 0 (Just hoverReAttack)
] | 307 | hoverFramesAttack1 =
V.fromList [ MFrameT (Just GameAI.aiCharge) (-10) (Just hoverFireBlaster)
, MFrameT (Just GameAI.aiCharge) (-10) (Just hoverFireBlaster)
, MFrameT (Just GameAI.aiCharge) 0 (Just hoverReAttack)
] | 268 | false | true | 0 | 10 | 81 | 109 | 53 | 56 | null | null |
rfranek/duckling | Duckling/Rules/RO.hs | bsd-3-clause | rules (This PhoneNumber) = [] | 29 | rules (This PhoneNumber) = [] | 29 | rules (This PhoneNumber) = [] | 29 | false | false | 0 | 6 | 4 | 18 | 8 | 10 | null | null |
kojiromike/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | process fn' (AddProof prf)
= do fn <- do
let fn'' = takeWhile (/= ' ') fn'
ex <- runIO $ doesFileExist fn''
let fnExt = fn'' <.> "idr"
exExt <- runIO $ doesFileExist fnExt
if ex
then return fn''
else if exExt
then return fnExt
else ifail $ "Neither \""++fn''++"\" nor \""++fnExt++"\" exist"
let fb = fn ++ "~"
runIO $ copyFile fn fb -- make a backup in case something goes wrong!
prog <- runIO $ readSource fb
i <- getIState
let proofs = proof_list i
n' <- case prf of
Nothing -> case proofs of
[] -> ifail "No proof to add"
((x, _) : _) -> return x
Just nm -> return nm
n <- resolveProof n'
case lookup n proofs of
Nothing -> iputStrLn "No proof to add"
Just (mode, prf) ->
do let script = if mode
then showRunElab (lit fn) n prf
else showProof (lit fn) n prf
let prog' = insertScript script ls
runIO $ writeSource fn (unlines prog')
removeProof n
iputStrLn $ "Added proof " ++ show n
where ls = (lines prog) | 1,351 | process fn' (AddProof prf)
= do fn <- do
let fn'' = takeWhile (/= ' ') fn'
ex <- runIO $ doesFileExist fn''
let fnExt = fn'' <.> "idr"
exExt <- runIO $ doesFileExist fnExt
if ex
then return fn''
else if exExt
then return fnExt
else ifail $ "Neither \""++fn''++"\" nor \""++fnExt++"\" exist"
let fb = fn ++ "~"
runIO $ copyFile fn fb -- make a backup in case something goes wrong!
prog <- runIO $ readSource fb
i <- getIState
let proofs = proof_list i
n' <- case prf of
Nothing -> case proofs of
[] -> ifail "No proof to add"
((x, _) : _) -> return x
Just nm -> return nm
n <- resolveProof n'
case lookup n proofs of
Nothing -> iputStrLn "No proof to add"
Just (mode, prf) ->
do let script = if mode
then showRunElab (lit fn) n prf
else showProof (lit fn) n prf
let prog' = insertScript script ls
runIO $ writeSource fn (unlines prog')
removeProof n
iputStrLn $ "Added proof " ++ show n
where ls = (lines prog) | 1,351 | process fn' (AddProof prf)
= do fn <- do
let fn'' = takeWhile (/= ' ') fn'
ex <- runIO $ doesFileExist fn''
let fnExt = fn'' <.> "idr"
exExt <- runIO $ doesFileExist fnExt
if ex
then return fn''
else if exExt
then return fnExt
else ifail $ "Neither \""++fn''++"\" nor \""++fnExt++"\" exist"
let fb = fn ++ "~"
runIO $ copyFile fn fb -- make a backup in case something goes wrong!
prog <- runIO $ readSource fb
i <- getIState
let proofs = proof_list i
n' <- case prf of
Nothing -> case proofs of
[] -> ifail "No proof to add"
((x, _) : _) -> return x
Just nm -> return nm
n <- resolveProof n'
case lookup n proofs of
Nothing -> iputStrLn "No proof to add"
Just (mode, prf) ->
do let script = if mode
then showRunElab (lit fn) n prf
else showProof (lit fn) n prf
let prog' = insertScript script ls
runIO $ writeSource fn (unlines prog')
removeProof n
iputStrLn $ "Added proof " ++ show n
where ls = (lines prog) | 1,351 | false | false | 0 | 18 | 623 | 407 | 190 | 217 | null | null |
m4lvin/robbed | src/Data/ROBDD/Types.hs | bsd-3-clause | varBddCmp _ One = LT | 20 | varBddCmp _ One = LT | 20 | varBddCmp _ One = LT | 20 | false | false | 1 | 5 | 4 | 13 | 5 | 8 | null | null |
codemac/yi-editor | src/Yi/UI/Cocoa/TextStorage.hs | gpl-2.0 | yts_addAttributeValueRange :: NSString t -> ID () -> NSRange -> YiTextStorage () -> IO ()
yts_addAttributeValueRange _ _ _ _ = return () | 136 | yts_addAttributeValueRange :: NSString t -> ID () -> NSRange -> YiTextStorage () -> IO ()
yts_addAttributeValueRange _ _ _ _ = return () | 136 | yts_addAttributeValueRange _ _ _ _ = return () | 46 | false | true | 0 | 10 | 22 | 59 | 27 | 32 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/HaXml/src/Text/XML/HaXml/Html/Parse.hs | bsd-3-clause | report :: (String->HParser a) -> String -> Posn -> TokenT -> HParser a
report fail exp p t = fail ("Expected "++show exp++" but found "++show t
++"\n at "++show p) | 191 | report :: (String->HParser a) -> String -> Posn -> TokenT -> HParser a
report fail exp p t = fail ("Expected "++show exp++" but found "++show t
++"\n at "++show p) | 191 | report fail exp p t = fail ("Expected "++show exp++" but found "++show t
++"\n at "++show p) | 120 | false | true | 0 | 12 | 58 | 84 | 40 | 44 | null | null |
swift-nav/plover | src/Language/Plover/SemCheck.hs | mit | withNewScope :: SemChecker v -> SemChecker v
withNewScope m = do bindings <- localBindings <$> get
v <- m
modify $ \state -> state { localBindings = bindings }
return v
-- | adds a new binding, and if one already exists, return the tag for
-- it. The v' is for α-renaming, and it should come from gensym. | 366 | withNewScope :: SemChecker v -> SemChecker v
withNewScope m = do bindings <- localBindings <$> get
v <- m
modify $ \state -> state { localBindings = bindings }
return v
-- | adds a new binding, and if one already exists, return the tag for
-- it. The v' is for α-renaming, and it should come from gensym. | 366 | withNewScope m = do bindings <- localBindings <$> get
v <- m
modify $ \state -> state { localBindings = bindings }
return v
-- | adds a new binding, and if one already exists, return the tag for
-- it. The v' is for α-renaming, and it should come from gensym. | 321 | false | true | 0 | 10 | 120 | 70 | 34 | 36 | null | null |
bjpop/berp | libs/src/Berp/Base/StdTypes/Type.hs | bsd-3-clause | mroMethod :: Procedure
mroMethod (obj:_) = return $ object_mro obj | 66 | mroMethod :: Procedure
mroMethod (obj:_) = return $ object_mro obj | 66 | mroMethod (obj:_) = return $ object_mro obj | 43 | false | true | 0 | 7 | 9 | 28 | 14 | 14 | null | null |
bitemyapp/hst | src/HST/Parse.hs | apache-2.0 | unaryMessage = lexeme identifierString >>= return . UnaryMessage | 64 | unaryMessage = lexeme identifierString >>= return . UnaryMessage | 64 | unaryMessage = lexeme identifierString >>= return . UnaryMessage | 64 | false | false | 0 | 7 | 7 | 17 | 8 | 9 | null | null |
brendanhay/gogol | gogol-analytics/gen/Network/Google/Analytics/Types/Product.hs | mpl-2.0 | -- | Whether or not Analytics will strip search category parameters from the
-- URLs in your reports.
pStripSiteSearchCategoryParameters :: Lens' ProFile (Maybe Bool)
pStripSiteSearchCategoryParameters
= lens _pStripSiteSearchCategoryParameters
(\ s a -> s{_pStripSiteSearchCategoryParameters = a}) | 306 | pStripSiteSearchCategoryParameters :: Lens' ProFile (Maybe Bool)
pStripSiteSearchCategoryParameters
= lens _pStripSiteSearchCategoryParameters
(\ s a -> s{_pStripSiteSearchCategoryParameters = a}) | 204 | pStripSiteSearchCategoryParameters
= lens _pStripSiteSearchCategoryParameters
(\ s a -> s{_pStripSiteSearchCategoryParameters = a}) | 139 | true | true | 0 | 9 | 42 | 49 | 26 | 23 | null | null |
danr/hipspec | examples/old-examples/quickspec/Implications.hs | gpl-3.0 | _ <= Z = False | 22 | _ <= Z = False | 22 | _ <= Z = False | 22 | false | false | 0 | 5 | 12 | 12 | 5 | 7 | null | null |
d0kt0r0/estuary | client/src/Estuary/Types/NoteEvent.hs | gpl-3.0 | datumToJSVal (ASCII_String x) = pToJSVal $ decodeUtf8 x | 55 | datumToJSVal (ASCII_String x) = pToJSVal $ decodeUtf8 x | 55 | datumToJSVal (ASCII_String x) = pToJSVal $ decodeUtf8 x | 55 | false | false | 2 | 6 | 7 | 25 | 10 | 15 | null | null |
tilltheis/propositional-logic | src/PropositionalLogic.hs | bsd-3-clause | isAtom T = True | 15 | isAtom T = True | 15 | isAtom T = True | 15 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
FranklinChen/Haskell-Pipes-Library | src/Pipes/Prelude.hs | bsd-3-clause | {-| Strict fold of the elements of a 'Producer' that preserves the return value
> Control.Foldl.purely fold' :: Monad m => Fold a b -> Producer a m r -> m (b, r)
-}
fold' :: Monad m => (x -> a -> x) -> x -> (x -> b) -> Producer a m r -> m (b, r)
fold' step begin done p0 = loop p0 begin
where
loop p x = case p of
Request v _ -> closed v
Respond a fu -> loop (fu ()) $! step x a
M m -> m >>= \p' -> loop p' x
Pure r -> return (done x, r)
| 497 | fold' :: Monad m => (x -> a -> x) -> x -> (x -> b) -> Producer a m r -> m (b, r)
fold' step begin done p0 = loop p0 begin
where
loop p x = case p of
Request v _ -> closed v
Respond a fu -> loop (fu ()) $! step x a
M m -> m >>= \p' -> loop p' x
Pure r -> return (done x, r)
| 331 | fold' step begin done p0 = loop p0 begin
where
loop p x = case p of
Request v _ -> closed v
Respond a fu -> loop (fu ()) $! step x a
M m -> m >>= \p' -> loop p' x
Pure r -> return (done x, r)
| 250 | true | true | 1 | 12 | 169 | 198 | 92 | 106 | null | null |
dimara/ganeti | src/Ganeti/Lens.hs | bsd-2-clause | -- | A helper lens over sets.
-- While a similar lens exists in the package (as @Lens' Set (Maybe ())@),
-- it's available only in most recent versions.
-- And using @Bool@ instead of @Maybe ()@ is more convenient.
atSet :: (Ord a) => a -> Lens' (S.Set a) Bool
atSet k = lensWith (S.member k) f
where
f s True False = S.delete k s
f s False True = S.insert k s
f s _ _ = s | 393 | atSet :: (Ord a) => a -> Lens' (S.Set a) Bool
atSet k = lensWith (S.member k) f
where
f s True False = S.delete k s
f s False True = S.insert k s
f s _ _ = s | 178 | atSet k = lensWith (S.member k) f
where
f s True False = S.delete k s
f s False True = S.insert k s
f s _ _ = s | 132 | true | true | 0 | 10 | 101 | 110 | 55 | 55 | null | null |
hguenther/smtlib2 | Language/SMTLib2/Internals/Type/List.hs | gpl-3.0 | replicate (Succ n) x = x ::: replicate n x | 42 | replicate (Succ n) x = x ::: replicate n x | 42 | replicate (Succ n) x = x ::: replicate n x | 42 | false | false | 0 | 7 | 9 | 26 | 12 | 14 | null | null |
sys1yagi/scheme-haskell-llvm | Emit.hs | apache-2.0 | --cgen (S.String n) = return $ cons_ $ C.Float (F.Double n)
--cgen (S.Call fn args) = do
-- largs <- mapM cgen args
-- call (externf (AST.Name fn)) largs
-------------------------------------------------------------------------------
-- Compilation
-------------------------------------------------------------------------------
liftError :: ErrorT String IO a -> IO a
liftError = runErrorT >=> either fail return | 417 | liftError :: ErrorT String IO a -> IO a
liftError = runErrorT >=> either fail return | 84 | liftError = runErrorT >=> either fail return | 44 | true | true | 0 | 6 | 52 | 41 | 23 | 18 | null | null |
angerman/data-bitcode-edsl | src/EDSL/Monad/Instructions/Binary.hs | bsd-3-clause | udivM lhs rhs = mkBinOp' UDIV lhs rhs | 37 | udivM lhs rhs = mkBinOp' UDIV lhs rhs | 37 | udivM lhs rhs = mkBinOp' UDIV lhs rhs | 37 | false | false | 0 | 5 | 7 | 18 | 8 | 10 | null | null |
spechub/Hets | Common/XPath.hs | gpl-2.0 | -- * parsers
-- | skip trailing spaces
skips :: Parser a -> Parser a
skips = (<< spaces) | 89 | skips :: Parser a -> Parser a
skips = (<< spaces) | 49 | skips = (<< spaces) | 19 | true | true | 0 | 6 | 19 | 27 | 15 | 12 | null | null |
ndmitchell/extra | src/Data/Tuple/Extra.hs | bsd-3-clause | -- | Apply a single function to both components of a pair.
--
-- > both succ (1,2) == (2,3)
both :: (a -> b) -> (a, a) -> (b, b)
both f (x,y) = (f x, f y) | 154 | both :: (a -> b) -> (a, a) -> (b, b)
both f (x,y) = (f x, f y) | 62 | both f (x,y) = (f x, f y) | 25 | true | true | 0 | 7 | 38 | 69 | 38 | 31 | null | null |
swift-nav/plover | src/Language/Plover/SemCheck.hs | mit | -- | Adds a global binding, though if one already exists with that
-- name, attempts to reconcile.
addGlobalBinding :: DefBinding -> SemChecker ()
addGlobalBinding def = do molddef <- lookupGlobalBinding (binding def)
case molddef of
Just olddef -> reconcileBindings olddef def
Nothing -> newBinding def
-- | Determines whether a definition has a value definition. Struct
-- declarations don't count as having values. This is for the purpose
-- of seeing whether extern declarations have an associated value. | 591 | addGlobalBinding :: DefBinding -> SemChecker ()
addGlobalBinding def = do molddef <- lookupGlobalBinding (binding def)
case molddef of
Just olddef -> reconcileBindings olddef def
Nothing -> newBinding def
-- | Determines whether a definition has a value definition. Struct
-- declarations don't count as having values. This is for the purpose
-- of seeing whether extern declarations have an associated value. | 492 | addGlobalBinding def = do molddef <- lookupGlobalBinding (binding def)
case molddef of
Just olddef -> reconcileBindings olddef def
Nothing -> newBinding def
-- | Determines whether a definition has a value definition. Struct
-- declarations don't count as having values. This is for the purpose
-- of seeing whether extern declarations have an associated value. | 444 | true | true | 0 | 11 | 161 | 78 | 37 | 41 | null | null |
LambdaHack/LambdaHack | engine-src/Game/LambdaHack/Common/Item.hs | bsd-3-clause | ncharges :: Time -> ItemQuant -> Int
ncharges localTime (itemK, itemTimers) =
itemK - length (filter (charging localTime) itemTimers) | 135 | ncharges :: Time -> ItemQuant -> Int
ncharges localTime (itemK, itemTimers) =
itemK - length (filter (charging localTime) itemTimers) | 135 | ncharges localTime (itemK, itemTimers) =
itemK - length (filter (charging localTime) itemTimers) | 98 | false | true | 0 | 9 | 20 | 58 | 27 | 31 | null | null |
Soares/tagwiki | src/Location.hs | mit | -- Flip a Child -> Parent mapping into a Parent -> [Children] mapping
invert :: Ord o => Map o (Maybe o) -> Map o [o]
invert = Map.foldWithKey inv Map.empty where
inv k (Just v) = Map.insertWith (++) v [k]
inv _ Nothing = id
-- Find elements in a map that have no parents | 280 | invert :: Ord o => Map o (Maybe o) -> Map o [o]
invert = Map.foldWithKey inv Map.empty where
inv k (Just v) = Map.insertWith (++) v [k]
inv _ Nothing = id
-- Find elements in a map that have no parents | 210 | invert = Map.foldWithKey inv Map.empty where
inv k (Just v) = Map.insertWith (++) v [k]
inv _ Nothing = id
-- Find elements in a map that have no parents | 162 | true | true | 0 | 10 | 64 | 100 | 49 | 51 | null | null |
rahulmutt/ghcvm | compiler/Eta/SimplCore/SetLevels.hs | bsd-3-clause | lvlLamBndrs :: LevelEnv -> Level -> [OutVar] -> (LevelEnv, [LevelledBndr])
-- Compute the levels for the binders of a lambda group
lvlLamBndrs env lvl bndrs
= lvlBndrs env new_lvl bndrs
where
new_lvl | any is_major bndrs = incMajorLvl lvl
| otherwise = incMinorLvl lvl
is_major bndr = isId bndr && not (isProbablyOneShotLambda bndr)
-- The "probably" part says "don't float things out of a
-- probable one-shot lambda"
-- See Note [Computing one-shot info] in Demand.lhs | 525 | lvlLamBndrs :: LevelEnv -> Level -> [OutVar] -> (LevelEnv, [LevelledBndr])
lvlLamBndrs env lvl bndrs
= lvlBndrs env new_lvl bndrs
where
new_lvl | any is_major bndrs = incMajorLvl lvl
| otherwise = incMinorLvl lvl
is_major bndr = isId bndr && not (isProbablyOneShotLambda bndr)
-- The "probably" part says "don't float things out of a
-- probable one-shot lambda"
-- See Note [Computing one-shot info] in Demand.lhs | 469 | lvlLamBndrs env lvl bndrs
= lvlBndrs env new_lvl bndrs
where
new_lvl | any is_major bndrs = incMajorLvl lvl
| otherwise = incMinorLvl lvl
is_major bndr = isId bndr && not (isProbablyOneShotLambda bndr)
-- The "probably" part says "don't float things out of a
-- probable one-shot lambda"
-- See Note [Computing one-shot info] in Demand.lhs | 394 | true | true | 5 | 11 | 130 | 120 | 56 | 64 | null | null |
ice1000/OI-codes | codewars/101-200/convert-a-string-to-a-number.hs | agpl-3.0 | stringToNumber :: String -> Integer
stringToNumber n = read n :: Integer | 72 | stringToNumber :: String -> Integer
stringToNumber n = read n :: Integer | 72 | stringToNumber n = read n :: Integer | 36 | false | true | 0 | 5 | 11 | 24 | 12 | 12 | null | null |
jsl/RunnyBabbot | src/RunnyBabbot/Spoonerize.hs | mit | substituteWords :: (AnnotatedSentence, WordInfo, WordInfo) -> String
substituteWords (oldsentence, toSpoonerizeA, toSpoonerizeB) =
unwords $ map (\(WordInfo _ word _) -> word) orderedWords
where
sequencesToReplace = wordSequenceNumbers [spoonerizedA, spoonerizedB]
minusSpoonerized = filter (\(WordInfo seq _ _) ->
(seq `notElem` sequencesToReplace)) oldsentence
(spoonerizedA, spoonerizedB) =
spoonerizeWords(toSpoonerizeA, toSpoonerizeB)
newSentence = minusSpoonerized ++ [spoonerizedA, spoonerizedB]
orderedWords = sort newSentence | 617 | substituteWords :: (AnnotatedSentence, WordInfo, WordInfo) -> String
substituteWords (oldsentence, toSpoonerizeA, toSpoonerizeB) =
unwords $ map (\(WordInfo _ word _) -> word) orderedWords
where
sequencesToReplace = wordSequenceNumbers [spoonerizedA, spoonerizedB]
minusSpoonerized = filter (\(WordInfo seq _ _) ->
(seq `notElem` sequencesToReplace)) oldsentence
(spoonerizedA, spoonerizedB) =
spoonerizeWords(toSpoonerizeA, toSpoonerizeB)
newSentence = minusSpoonerized ++ [spoonerizedA, spoonerizedB]
orderedWords = sort newSentence | 617 | substituteWords (oldsentence, toSpoonerizeA, toSpoonerizeB) =
unwords $ map (\(WordInfo _ word _) -> word) orderedWords
where
sequencesToReplace = wordSequenceNumbers [spoonerizedA, spoonerizedB]
minusSpoonerized = filter (\(WordInfo seq _ _) ->
(seq `notElem` sequencesToReplace)) oldsentence
(spoonerizedA, spoonerizedB) =
spoonerizeWords(toSpoonerizeA, toSpoonerizeB)
newSentence = minusSpoonerized ++ [spoonerizedA, spoonerizedB]
orderedWords = sort newSentence | 548 | false | true | 5 | 9 | 137 | 176 | 91 | 85 | null | null |
christiaanb/ghc | libraries/ghc-prim/GHC/Classes.hs | bsd-3-clause | (I# x) `geInt` (I# y) = isTrue# (x >=# y) | 41 | (I# x) `geInt` (I# y) = isTrue# (x >=# y) | 41 | (I# x) `geInt` (I# y) = isTrue# (x >=# y) | 41 | false | false | 0 | 7 | 9 | 36 | 18 | 18 | null | null |
Zigazou/RuzzSolver | src/Solver/Score.hs | gpl-3.0 | lengthScores 10 = 25 | 20 | lengthScores 10 = 25 | 20 | lengthScores 10 = 25 | 20 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
OS2World/DEV-UTIL-HUGS | libraries/Debug/QuickCheck.hs | bsd-3-clause | classify False _ = property | 30 | classify False _ = property | 30 | classify False _ = property | 30 | false | false | 0 | 4 | 7 | 13 | 5 | 8 | null | null |
nablaa/hirchess | src/Colors.hs | gpl-2.0 | boardColor :: ANSIColor
boardColor = yellow | 43 | boardColor :: ANSIColor
boardColor = yellow | 43 | boardColor = yellow | 19 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
qwfy/fsquery | src/System/FSQuery/Parser.hs | mit | genOrderBy = do
x <- genOrderBys
return $ if null x
then ""
else "order by " ++ intercalate "," x | 131 | genOrderBy = do
x <- genOrderBys
return $ if null x
then ""
else "order by " ++ intercalate "," x | 131 | genOrderBy = do
x <- genOrderBys
return $ if null x
then ""
else "order by " ++ intercalate "," x | 131 | false | false | 0 | 10 | 54 | 40 | 19 | 21 | null | null |
conal/lambda-ccc | src/LambdaCCC/Lambda.hs | bsd-3-clause | -- The order a c b matches 'either'
-- coerceEP :: forall a b . (Typeable a, Typeable b, Coercible a b) => EP a -> EP b
-- coerceEP = coerceE
abstEP :: forall a. HasRep a => forall a'. Rep a ~ a' => EP (a' -> a)
abstEP = kPrim AbstP | 234 | abstEP :: forall a. HasRep a => forall a'. Rep a ~ a' => EP (a' -> a)
abstEP = kPrim AbstP | 90 | abstEP = kPrim AbstP | 20 | true | true | 0 | 12 | 55 | 62 | 30 | 32 | null | null |
patperry/permutation | tests/STPermute.hs | bsd-3-clause | implements2 :: (Eq a, Show a) =>
(forall s . STPermute s -> STPermute s -> ST s a) ->
(Permute -> Permute -> (a,Permute,Permute)) ->
Property
implements2 a f =
forAll arbitrary $ \(Nat n) ->
forAll (Test.permute n) $ \p ->
forAll (Test.permute n) $ \q ->
runST $ do
p' <- unsafeThaw p
q' <- unsafeThaw q
commutes2 p' q' a f | 396 | implements2 :: (Eq a, Show a) =>
(forall s . STPermute s -> STPermute s -> ST s a) ->
(Permute -> Permute -> (a,Permute,Permute)) ->
Property
implements2 a f =
forAll arbitrary $ \(Nat n) ->
forAll (Test.permute n) $ \p ->
forAll (Test.permute n) $ \q ->
runST $ do
p' <- unsafeThaw p
q' <- unsafeThaw q
commutes2 p' q' a f | 396 | implements2 a f =
forAll arbitrary $ \(Nat n) ->
forAll (Test.permute n) $ \p ->
forAll (Test.permute n) $ \q ->
runST $ do
p' <- unsafeThaw p
q' <- unsafeThaw q
commutes2 p' q' a f | 237 | false | true | 4 | 12 | 137 | 188 | 90 | 98 | null | null |
prl-tokyo/bigul-configuration-adaptation | Transformations/src/Generics/BiGUL/TH.hs | mit | astNameSpace :: String
astNameSpace = "Generics.BiGUL.AST." | 59 | astNameSpace :: String
astNameSpace = "Generics.BiGUL.AST." | 59 | astNameSpace = "Generics.BiGUL.AST." | 36 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_336 (193#) = happyShift action_69 | 40 | action_336 (193#) = happyShift action_69 | 40 | action_336 (193#) = happyShift action_69 | 40 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
sol/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | simpleCite :: GenParser Char ParserState Inline
simpleCite = try $ do
char '\\'
let biblatex = [a ++ "cite" | a <- ["auto", "foot", "paren", "super", ""]]
++ ["footcitetext"]
normal = ["cite" ++ a ++ b | a <- ["al", ""], b <- ["p", "p*", ""]]
++ biblatex
supress = ["citeyearpar", "citeyear", "autocite*", "cite*", "parencite*"]
intext = ["textcite"] ++ ["cite" ++ a ++ b | a <- ["al", ""], b <- ["t", "t*"]]
mintext = ["textcites"]
mnormal = map (++ "s") biblatex
cmdend = notFollowedBy (letter <|> char '*')
capit [] = []
capit (x:xs) = toUpper x : xs
addUpper xs = xs ++ map capit xs
toparser l t = try $ oneOfStrings (addUpper l) >> cmdend >> return t
(mode, multi) <- toparser normal (NormalCitation, False)
<|> toparser supress (SuppressAuthor, False)
<|> toparser intext (AuthorInText , False)
<|> toparser mnormal (NormalCitation, True )
<|> toparser mintext (AuthorInText , True )
cits <- if multi then
many1 simpleCiteArgs
else
simpleCiteArgs >>= \c -> return [c]
let (c:cs) = concat cits
cits' = case mode of
AuthorInText -> c {citationMode = mode} : cs
_ -> map (\a -> a {citationMode = mode}) (c:cs)
return $ Cite cits' [] | 1,432 | simpleCite :: GenParser Char ParserState Inline
simpleCite = try $ do
char '\\'
let biblatex = [a ++ "cite" | a <- ["auto", "foot", "paren", "super", ""]]
++ ["footcitetext"]
normal = ["cite" ++ a ++ b | a <- ["al", ""], b <- ["p", "p*", ""]]
++ biblatex
supress = ["citeyearpar", "citeyear", "autocite*", "cite*", "parencite*"]
intext = ["textcite"] ++ ["cite" ++ a ++ b | a <- ["al", ""], b <- ["t", "t*"]]
mintext = ["textcites"]
mnormal = map (++ "s") biblatex
cmdend = notFollowedBy (letter <|> char '*')
capit [] = []
capit (x:xs) = toUpper x : xs
addUpper xs = xs ++ map capit xs
toparser l t = try $ oneOfStrings (addUpper l) >> cmdend >> return t
(mode, multi) <- toparser normal (NormalCitation, False)
<|> toparser supress (SuppressAuthor, False)
<|> toparser intext (AuthorInText , False)
<|> toparser mnormal (NormalCitation, True )
<|> toparser mintext (AuthorInText , True )
cits <- if multi then
many1 simpleCiteArgs
else
simpleCiteArgs >>= \c -> return [c]
let (c:cs) = concat cits
cits' = case mode of
AuthorInText -> c {citationMode = mode} : cs
_ -> map (\a -> a {citationMode = mode}) (c:cs)
return $ Cite cits' [] | 1,432 | simpleCite = try $ do
char '\\'
let biblatex = [a ++ "cite" | a <- ["auto", "foot", "paren", "super", ""]]
++ ["footcitetext"]
normal = ["cite" ++ a ++ b | a <- ["al", ""], b <- ["p", "p*", ""]]
++ biblatex
supress = ["citeyearpar", "citeyear", "autocite*", "cite*", "parencite*"]
intext = ["textcite"] ++ ["cite" ++ a ++ b | a <- ["al", ""], b <- ["t", "t*"]]
mintext = ["textcites"]
mnormal = map (++ "s") biblatex
cmdend = notFollowedBy (letter <|> char '*')
capit [] = []
capit (x:xs) = toUpper x : xs
addUpper xs = xs ++ map capit xs
toparser l t = try $ oneOfStrings (addUpper l) >> cmdend >> return t
(mode, multi) <- toparser normal (NormalCitation, False)
<|> toparser supress (SuppressAuthor, False)
<|> toparser intext (AuthorInText , False)
<|> toparser mnormal (NormalCitation, True )
<|> toparser mintext (AuthorInText , True )
cits <- if multi then
many1 simpleCiteArgs
else
simpleCiteArgs >>= \c -> return [c]
let (c:cs) = concat cits
cits' = case mode of
AuthorInText -> c {citationMode = mode} : cs
_ -> map (\a -> a {citationMode = mode}) (c:cs)
return $ Cite cits' [] | 1,384 | false | true | 0 | 18 | 496 | 533 | 284 | 249 | null | null |
wschroeder/haskell-SlidingPuzzle | src/Menu.hs | bsd-3-clause | runMenu :: IO ()
runMenu = do
putStrLn "-----------------------------"
putStrLn " S L I D I N G P U Z Z L E "
putStrLn "-----------------------------"
putStrLn " (P)lay"
putStrLn " (Q)uit"
putStrLn ""
putStr "Choice: "
hFlush stdout
response <- getLine
processInput (map toUpper response) | 310 | runMenu :: IO ()
runMenu = do
putStrLn "-----------------------------"
putStrLn " S L I D I N G P U Z Z L E "
putStrLn "-----------------------------"
putStrLn " (P)lay"
putStrLn " (Q)uit"
putStrLn ""
putStr "Choice: "
hFlush stdout
response <- getLine
processInput (map toUpper response) | 310 | runMenu = do
putStrLn "-----------------------------"
putStrLn " S L I D I N G P U Z Z L E "
putStrLn "-----------------------------"
putStrLn " (P)lay"
putStrLn " (Q)uit"
putStrLn ""
putStr "Choice: "
hFlush stdout
response <- getLine
processInput (map toUpper response) | 293 | false | true | 0 | 9 | 68 | 85 | 33 | 52 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT45.hs | gpl-3.0 | (==),(/=) :: Nat -> Nat -> Bool
Z == Z = True | 49 | (==),(/=) :: Nat -> Nat -> Bool
Z == Z = True | 49 | Z == Z = True | 17 | false | true | 0 | 6 | 15 | 31 | 18 | 13 | null | null |
urbanslug/ghc | compiler/codeGen/CgUtils.hs | bsd-3-clause | baseRegOffset dflags (ZmmReg 4) = oFFSET_StgRegTable_rZMM4 dflags | 74 | baseRegOffset dflags (ZmmReg 4) = oFFSET_StgRegTable_rZMM4 dflags | 74 | baseRegOffset dflags (ZmmReg 4) = oFFSET_StgRegTable_rZMM4 dflags | 74 | false | false | 0 | 6 | 15 | 22 | 9 | 13 | null | null |
mainland/nikola | src/Data/Vector/CUDA/UnboxedForeign.hs | bsd-3-clause | foldl1 = G.foldl1 | 17 | foldl1 = G.foldl1 | 17 | foldl1 = G.foldl1 | 17 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
pgj/bead | src/Bead/View/Content/Bootstrap.hs | bsd-3-clause | -- | Creates a dropdown button
dropdownButton text =
button ! type_ "button"
! class_ "btn btn-default dropdown-toggle"
! dataAttribute "toggle" "dropdown"
$ do (fromString text); caret
-- | Creates a list of dropdown menu items | 258 | dropdownButton text =
button ! type_ "button"
! class_ "btn btn-default dropdown-toggle"
! dataAttribute "toggle" "dropdown"
$ do (fromString text); caret
-- | Creates a list of dropdown menu items | 227 | dropdownButton text =
button ! type_ "button"
! class_ "btn btn-default dropdown-toggle"
! dataAttribute "toggle" "dropdown"
$ do (fromString text); caret
-- | Creates a list of dropdown menu items | 227 | true | false | 0 | 9 | 65 | 51 | 24 | 27 | null | null |
jthornber/language-c-ejt | src/Language/C/Analysis/AstAnalysis.hs | bsd-3-clause | -- | Analyse a function definition
analyseFunDef :: (MonadTrav m) => CFunDef -> m ()
analyseFunDef (CFunDef declspecs declr oldstyle_decls stmt node_info) = do
-- analyse the declarator
var_decl_info <- analyseVarDecl' True declspecs declr oldstyle_decls Nothing
let (VarDeclInfo name is_inline storage_spec attrs ty declr_node) = var_decl_info
when (isNoName name) $ astError node_info "NoName in analyseFunDef"
let ident = identOfVarName name
-- improve incomplete type
ty' <- improveFunDefType ty
-- compute storage
fun_storage <- computeFunDefStorage ident storage_spec
let var_decl = VarDecl name (DeclAttrs is_inline fun_storage attrs) ty'
-- callback for declaration
handleVarDecl False (Decl var_decl node_info)
-- process body
stmt' <- analyseFunctionBody node_info var_decl stmt
-- callback for definition
handleFunDef ident (FunDef var_decl stmt' node_info)
where
improveFunDefType (FunctionType (FunTypeIncomplete return_ty) attrs) =
return $ FunctionType (FunType return_ty [] False) attrs
improveFunDefType ty = return $ ty
-- | Analyse a declaration other than a function definition | 1,180 | analyseFunDef :: (MonadTrav m) => CFunDef -> m ()
analyseFunDef (CFunDef declspecs declr oldstyle_decls stmt node_info) = do
-- analyse the declarator
var_decl_info <- analyseVarDecl' True declspecs declr oldstyle_decls Nothing
let (VarDeclInfo name is_inline storage_spec attrs ty declr_node) = var_decl_info
when (isNoName name) $ astError node_info "NoName in analyseFunDef"
let ident = identOfVarName name
-- improve incomplete type
ty' <- improveFunDefType ty
-- compute storage
fun_storage <- computeFunDefStorage ident storage_spec
let var_decl = VarDecl name (DeclAttrs is_inline fun_storage attrs) ty'
-- callback for declaration
handleVarDecl False (Decl var_decl node_info)
-- process body
stmt' <- analyseFunctionBody node_info var_decl stmt
-- callback for definition
handleFunDef ident (FunDef var_decl stmt' node_info)
where
improveFunDefType (FunctionType (FunTypeIncomplete return_ty) attrs) =
return $ FunctionType (FunType return_ty [] False) attrs
improveFunDefType ty = return $ ty
-- | Analyse a declaration other than a function definition | 1,145 | analyseFunDef (CFunDef declspecs declr oldstyle_decls stmt node_info) = do
-- analyse the declarator
var_decl_info <- analyseVarDecl' True declspecs declr oldstyle_decls Nothing
let (VarDeclInfo name is_inline storage_spec attrs ty declr_node) = var_decl_info
when (isNoName name) $ astError node_info "NoName in analyseFunDef"
let ident = identOfVarName name
-- improve incomplete type
ty' <- improveFunDefType ty
-- compute storage
fun_storage <- computeFunDefStorage ident storage_spec
let var_decl = VarDecl name (DeclAttrs is_inline fun_storage attrs) ty'
-- callback for declaration
handleVarDecl False (Decl var_decl node_info)
-- process body
stmt' <- analyseFunctionBody node_info var_decl stmt
-- callback for definition
handleFunDef ident (FunDef var_decl stmt' node_info)
where
improveFunDefType (FunctionType (FunTypeIncomplete return_ty) attrs) =
return $ FunctionType (FunType return_ty [] False) attrs
improveFunDefType ty = return $ ty
-- | Analyse a declaration other than a function definition | 1,095 | true | true | 0 | 12 | 227 | 285 | 135 | 150 | null | null |
hyPiRion/swearjure | src/Swearjure/Parser.hs | gpl-3.0 | vec :: ParseState -> Parser PVal
vec b = Fix . PVec <$> delimited '[' ']' (many' $ expr b) b | 92 | vec :: ParseState -> Parser PVal
vec b = Fix . PVec <$> delimited '[' ']' (many' $ expr b) b | 92 | vec b = Fix . PVec <$> delimited '[' ']' (many' $ expr b) b | 59 | false | true | 0 | 9 | 20 | 48 | 23 | 25 | null | null |
nicklawls/transformers | app/Main.hs | bsd-3-clause | eval2c :: Env -> Exp -> Eval2 Value
eval2c _ (Lit int) = return $ IntVal int | 76 | eval2c :: Env -> Exp -> Eval2 Value
eval2c _ (Lit int) = return $ IntVal int | 76 | eval2c _ (Lit int) = return $ IntVal int | 40 | false | true | 0 | 10 | 16 | 44 | 20 | 24 | null | null |
marcinmrotek/repa-linear-algebra | src/Numeric/LinearAlgebra/Repa.hs | bsd-3-clause | invlndetP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, (t, t))
invlndetP m = do
(h, r) <- H.invlndet <$> repa2hmP m
return (hm2repa h, r) | 169 | invlndetP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, (t, t))
invlndetP m = do
(h, r) <- H.invlndet <$> repa2hmP m
return (hm2repa h, r) | 169 | invlndetP m = do
(h, r) <- H.invlndet <$> repa2hmP m
return (hm2repa h, r) | 78 | false | true | 0 | 10 | 39 | 110 | 54 | 56 | null | null |
spinningfire/aikatsu | test/Spec.hs | bsd-3-clause | photoKii = Photo "Saegusa Kii" Kii 60 1200 "Pop Flash" 6000 R Pop 52 (AppealUp 22) MagicalToy | 93 | photoKii = Photo "Saegusa Kii" Kii 60 1200 "Pop Flash" 6000 R Pop 52 (AppealUp 22) MagicalToy | 93 | photoKii = Photo "Saegusa Kii" Kii 60 1200 "Pop Flash" 6000 R Pop 52 (AppealUp 22) MagicalToy | 93 | false | false | 1 | 7 | 16 | 39 | 17 | 22 | null | null |
ian-ross/c2hs-macos-test | c2hs-0.26.1/src/C2HS/C/Attrs.hs | mit | -- | enter a new range, only for objects
--
enterNewObjRangeC :: AttrC -> AttrC
enterNewObjRangeC ac = ac {
defObjsAC = enterNewRange . defObjsAC $ ac
} | 206 | enterNewObjRangeC :: AttrC -> AttrC
enterNewObjRangeC ac = ac {
defObjsAC = enterNewRange . defObjsAC $ ac
} | 162 | enterNewObjRangeC ac = ac {
defObjsAC = enterNewRange . defObjsAC $ ac
} | 123 | true | true | 0 | 8 | 81 | 36 | 20 | 16 | null | null |
rfranek/duckling | Duckling/Ordinal/HR/Corpus.hs | bsd-3-clause | allExamples :: [Example]
allExamples = concat
[ examples (OrdinalData 3)
[ "3."
, "trece"
, "treći"
, "trećeg"
]
, examples (OrdinalData 4)
[ "4."
, "4ti"
, "4ta"
, "četvrti"
, "četvrta"
, "četvrto"
, "cetvrti"
, "cetvrta"
, "cetvrto"
]
, examples (OrdinalData 6)
[ "6."
, "6ti"
, "šesto"
, "šestoga"
, "sestog"
]
] | 596 | allExamples :: [Example]
allExamples = concat
[ examples (OrdinalData 3)
[ "3."
, "trece"
, "treći"
, "trećeg"
]
, examples (OrdinalData 4)
[ "4."
, "4ti"
, "4ta"
, "četvrti"
, "četvrta"
, "četvrto"
, "cetvrti"
, "cetvrta"
, "cetvrto"
]
, examples (OrdinalData 6)
[ "6."
, "6ti"
, "šesto"
, "šestoga"
, "sestog"
]
] | 596 | allExamples = concat
[ examples (OrdinalData 3)
[ "3."
, "trece"
, "treći"
, "trećeg"
]
, examples (OrdinalData 4)
[ "4."
, "4ti"
, "4ta"
, "četvrti"
, "četvrta"
, "četvrto"
, "cetvrti"
, "cetvrta"
, "cetvrto"
]
, examples (OrdinalData 6)
[ "6."
, "6ti"
, "šesto"
, "šestoga"
, "sestog"
]
] | 571 | false | true | 0 | 9 | 338 | 120 | 67 | 53 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.