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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
spechub/Hets | Temporal/ModalCasl.hs | gpl-2.0 | showPathFormula (Por phi psi) True = showPathFormula phi False ++ " \\/ " ++
showPathFormula psi False | 103 | showPathFormula (Por phi psi) True = showPathFormula phi False ++ " \\/ " ++
showPathFormula psi False | 103 | showPathFormula (Por phi psi) True = showPathFormula phi False ++ " \\/ " ++
showPathFormula psi False | 103 | false | false | 0 | 7 | 17 | 37 | 17 | 20 | null | null |
lamdu/lamdu | test/Tests/Config.hs | gpl-3.0 | verifySprites :: IO ()
verifySprites =
Folder.getSelections (Proxy @Theme)
>>= traverse (Folder.selectionToPath (Proxy @Theme))
>>= traverse loadJsonPath
>>= traverse_ verifySpritesOf
where
verifySpritesOf theme =
theme ^. Theme.sprites
& traverse Folder.spritePath
... | 359 | verifySprites :: IO ()
verifySprites =
Folder.getSelections (Proxy @Theme)
>>= traverse (Folder.selectionToPath (Proxy @Theme))
>>= traverse loadJsonPath
>>= traverse_ verifySpritesOf
where
verifySpritesOf theme =
theme ^. Theme.sprites
& traverse Folder.spritePath
... | 359 | verifySprites =
Folder.getSelections (Proxy @Theme)
>>= traverse (Folder.selectionToPath (Proxy @Theme))
>>= traverse loadJsonPath
>>= traverse_ verifySpritesOf
where
verifySpritesOf theme =
theme ^. Theme.sprites
& traverse Folder.spritePath
>>= traverse_... | 336 | false | true | 0 | 13 | 96 | 100 | 47 | 53 | null | null |
alexander-at-github/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | -- Class Ix
ixClassName :: Name
ixClassName = clsQual gHC_ARR (fsLit "Ix") ixClassKey | 85 | ixClassName :: Name
ixClassName = clsQual gHC_ARR (fsLit "Ix") ixClassKey | 73 | ixClassName = clsQual gHC_ARR (fsLit "Ix") ixClassKey | 53 | true | true | 0 | 7 | 12 | 32 | 14 | 18 | null | null |
vincenthz/hs-bytedump | Text/Bytedump.hs | bsd-3-clause | - | Dump a lazy bytestring into a formatted string of hex value
dumpDiffLBS :: L.ByteString -> L.ByteString -> String
dumpDiffLBS l1 l2 = dumpDiff (L.unpack l1) (L.unpack l2)
| 175 | dumpDiffLBS :: L.ByteString -> L.ByteString -> String
dumpDiffLBS l1 l2 = dumpDiff (L.unpack l1) (L.unpack l2) | 110 | dumpDiffLBS l1 l2 = dumpDiff (L.unpack l1) (L.unpack l2) | 56 | true | true | 1 | 9 | 29 | 72 | 34 | 38 | null | null |
mgold/Elm | src/Reporting/Error/Type.hs | bsd-3-clause | singleRigidError :: String
singleRigidError =
"A type annotation is too generic. You can probably just switch to the\
\ type I inferred. These issues can be subtle though, so read more about it. "
++ Help.hintLink "type-annotations" | 238 | singleRigidError :: String
singleRigidError =
"A type annotation is too generic. You can probably just switch to the\
\ type I inferred. These issues can be subtle though, so read more about it. "
++ Help.hintLink "type-annotations" | 238 | singleRigidError =
"A type annotation is too generic. You can probably just switch to the\
\ type I inferred. These issues can be subtle though, so read more about it. "
++ Help.hintLink "type-annotations" | 211 | false | true | 2 | 6 | 42 | 21 | 10 | 11 | null | null |
andreagenso/java2scala | src/Main.hs | apache-2.0 | writeScalaFile nameFile content = do
writeFile nameFile content
putStrLn (" Writing scala file " ++ nameFile ++ "..... ") | 129 | writeScalaFile nameFile content = do
writeFile nameFile content
putStrLn (" Writing scala file " ++ nameFile ++ "..... ") | 129 | writeScalaFile nameFile content = do
writeFile nameFile content
putStrLn (" Writing scala file " ++ nameFile ++ "..... ") | 129 | false | false | 0 | 10 | 26 | 36 | 16 | 20 | null | null |
gdevanla/scotty-from-ground-up | app/Main5.hs | bsd-3-clause | cond :: Eq t => t -> t -> Bool
cond condition_str = f where
f i = i == condition_str | 86 | cond :: Eq t => t -> t -> Bool
cond condition_str = f where
f i = i == condition_str | 86 | cond condition_str = f where
f i = i == condition_str | 55 | false | true | 0 | 7 | 22 | 43 | 21 | 22 | null | null |
headprogrammingczar/cabal | Cabal/Distribution/Simple/Utils.hs | bsd-3-clause | tryFindPackageDesc :: FilePath -> IO FilePath
tryFindPackageDesc dir = either die return =<< findPackageDesc dir | 112 | tryFindPackageDesc :: FilePath -> IO FilePath
tryFindPackageDesc dir = either die return =<< findPackageDesc dir | 112 | tryFindPackageDesc dir = either die return =<< findPackageDesc dir | 66 | false | true | 0 | 6 | 14 | 33 | 15 | 18 | null | null |
pparkkin/eta | compiler/ETA/HsSyn/HsUtils.hs | bsd-3-clause | mkHsIsString src s = OverLit (HsIsString src s) noRebindableInfo noSyntaxExpr | 80 | mkHsIsString src s = OverLit (HsIsString src s) noRebindableInfo noSyntaxExpr | 80 | mkHsIsString src s = OverLit (HsIsString src s) noRebindableInfo noSyntaxExpr | 80 | false | false | 0 | 7 | 12 | 26 | 12 | 14 | null | null |
emwap/feldspar-compiler | lib/Feldspar/Compiler/Imperative/ExternalProgram.hs | bsd-3-clause | blockItemToProgram env (BlockStm (Exp (Just e@(FnCall (Var (Id "run2" _) _) _ _)) _))
= (env, ProcedureCall s (FunParameter e1:tp))
where (FunctionCall (Function s _) [VarExpr (Variable _ e1)]) = expToExpression env e
tp = map TypeParameter $ lookup3 e1 (headerDefs env) | 284 | blockItemToProgram env (BlockStm (Exp (Just e@(FnCall (Var (Id "run2" _) _) _ _)) _))
= (env, ProcedureCall s (FunParameter e1:tp))
where (FunctionCall (Function s _) [VarExpr (Variable _ e1)]) = expToExpression env e
tp = map TypeParameter $ lookup3 e1 (headerDefs env) | 284 | blockItemToProgram env (BlockStm (Exp (Just e@(FnCall (Var (Id "run2" _) _) _ _)) _))
= (env, ProcedureCall s (FunParameter e1:tp))
where (FunctionCall (Function s _) [VarExpr (Variable _ e1)]) = expToExpression env e
tp = map TypeParameter $ lookup3 e1 (headerDefs env) | 284 | false | false | 0 | 18 | 55 | 147 | 73 | 74 | null | null |
rylev/blankfuck | Interpreter.hs | mit | stepState DecrementPointer = moveTapeHead $ subtract 1 | 54 | stepState DecrementPointer = moveTapeHead $ subtract 1 | 54 | stepState DecrementPointer = moveTapeHead $ subtract 1 | 54 | false | false | 1 | 6 | 6 | 19 | 7 | 12 | null | null |
neglectedvalue/xmobar-freebsd | Plugins/EWMH.hs | bsd-3-clause | updateClientList _ = do
(C {root}) <- ask
mwp <- windowProperty32 "_NET_CLIENT_LIST" root
case mwp of
Just xs -> do
cl <- gets clients
let cl' = Map.fromList $ map (flip (,) initialClient . fromIntegral) xs
dels = Map.difference cl cl'
... | 879 | updateClientList _ = do
(C {root}) <- ask
mwp <- windowProperty32 "_NET_CLIENT_LIST" root
case mwp of
Just xs -> do
cl <- gets clients
let cl' = Map.fromList $ map (flip (,) initialClient . fromIntegral) xs
dels = Map.difference cl cl'
... | 879 | updateClientList _ = do
(C {root}) <- ask
mwp <- windowProperty32 "_NET_CLIENT_LIST" root
case mwp of
Just xs -> do
cl <- gets clients
let cl' = Map.fromList $ map (flip (,) initialClient . fromIntegral) xs
dels = Map.difference cl cl'
... | 879 | false | false | 0 | 20 | 335 | 330 | 156 | 174 | null | null |
arekfu/project_euler | p0060/p0060.hs | mit | makeChildren (PrimeTuple l (x:xs)) = (newTuple : (makeChildren newTuple)) ++ (makeChildren (PrimeTuple l xs))
where newL = x:l
newTuple = PrimeTuple newL (restOf x xs) | 189 | makeChildren (PrimeTuple l (x:xs)) = (newTuple : (makeChildren newTuple)) ++ (makeChildren (PrimeTuple l xs))
where newL = x:l
newTuple = PrimeTuple newL (restOf x xs) | 189 | makeChildren (PrimeTuple l (x:xs)) = (newTuple : (makeChildren newTuple)) ++ (makeChildren (PrimeTuple l xs))
where newL = x:l
newTuple = PrimeTuple newL (restOf x xs) | 189 | false | false | 4 | 9 | 46 | 96 | 43 | 53 | null | null |
wereHamster/yag | Git/Ref.hs | unlicense | firstTrue (x:xs) = do
test <- x
case test of
Just _ -> return test
Nothing -> firstTrue xs | 114 | firstTrue (x:xs) = do
test <- x
case test of
Just _ -> return test
Nothing -> firstTrue xs | 114 | firstTrue (x:xs) = do
test <- x
case test of
Just _ -> return test
Nothing -> firstTrue xs | 114 | false | false | 0 | 10 | 42 | 51 | 23 | 28 | null | null |
elginer/Delve | src/VMCompiler.hs | gpl-3.0 | push_arg :: LVar -> Word8 -> Expr
push_arg v n =
case v of
LLocalVar i p ->
PushLocalArg i p n
LObjVar p ->
PushObjArg p n
-- There is duplication between a couple of backends here
-- But I have yet to seperate the generation of the call code from these functions ( no_opt_call, lo... | 377 | push_arg :: LVar -> Word8 -> Expr
push_arg v n =
case v of
LLocalVar i p ->
PushLocalArg i p n
LObjVar p ->
PushObjArg p n
-- There is duplication between a couple of backends here
-- But I have yet to seperate the generation of the call code from these functions ( no_opt_call, loc... | 376 | push_arg v n =
case v of
LLocalVar i p ->
PushLocalArg i p n
LObjVar p ->
PushObjArg p n
-- There is duplication between a couple of backends here
-- But I have yet to seperate the generation of the call code from these functions ( no_opt_call, local_tail_call , frame_tail_call )
-... | 342 | false | true | 0 | 8 | 103 | 63 | 31 | 32 | null | null |
nikivazou/verified_string_matching | src/tests/Test.hs | bsd-3-clause | testRunTimeOnTarget :: String -> Target -> IO ()
testRunTimeOnTarget fn target = do
writeInit fn tabsep
["Parfactor", "Chunks Number", "Time (sec)\t", "Speedup\t\t" ,"Input Size", "Target Size", "Indices Found"]
t <- doSeqStringMatch fn Nothing target
ts <- mapM (\(pf, csz) -> doParStringMatch fn (fst t) p... | 445 | testRunTimeOnTarget :: String -> Target -> IO ()
testRunTimeOnTarget fn target = do
writeInit fn tabsep
["Parfactor", "Chunks Number", "Time (sec)\t", "Speedup\t\t" ,"Input Size", "Target Size", "Indices Found"]
t <- doSeqStringMatch fn Nothing target
ts <- mapM (\(pf, csz) -> doParStringMatch fn (fst t) p... | 445 | testRunTimeOnTarget fn target = do
writeInit fn tabsep
["Parfactor", "Chunks Number", "Time (sec)\t", "Speedup\t\t" ,"Input Size", "Target Size", "Indices Found"]
t <- doSeqStringMatch fn Nothing target
ts <- mapM (\(pf, csz) -> doParStringMatch fn (fst t) pf csz Nothing target)
[ (i, j) | i... | 396 | false | true | 0 | 13 | 97 | 173 | 88 | 85 | null | null |
jaanos/TPJ-2015-16 | microhaskell/MH_Evaluator.hs | mit | evaluate env (UOp("-", exp1)) =
let val1 = evaluate env exp1
in case val1 of
Num n -> Num (-n)
_ -> error "Runtime type error" | 150 | evaluate env (UOp("-", exp1)) =
let val1 = evaluate env exp1
in case val1 of
Num n -> Num (-n)
_ -> error "Runtime type error" | 150 | evaluate env (UOp("-", exp1)) =
let val1 = evaluate env exp1
in case val1 of
Num n -> Num (-n)
_ -> error "Runtime type error" | 150 | false | false | 0 | 12 | 49 | 69 | 33 | 36 | null | null |
gafiatulin/codewars | src/8 kyu/Basic.hs | mit | a = "code" | 10 | a = "code" | 10 | a = "code" | 10 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
fmapfmapfmap/amazonka | amazonka-ec2/gen/Network/AWS/EC2/DescribeBundleTasks.hs | mpl-2.0 | -- | Creates a value of 'DescribeBundleTasksResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dbtrsBundleTasks'
--
-- * 'dbtrsResponseStatus'
describeBundleTasksResponse
:: Int -- ^ 'dbtrsResponseStatus'
-> DescribeBun... | 502 | describeBundleTasksResponse
:: Int -- ^ 'dbtrsResponseStatus'
-> DescribeBundleTasksResponse
describeBundleTasksResponse pResponseStatus_ =
DescribeBundleTasksResponse'
{ _dbtrsBundleTasks = Nothing
, _dbtrsResponseStatus = pResponseStatus_
} | 266 | describeBundleTasksResponse pResponseStatus_ =
DescribeBundleTasksResponse'
{ _dbtrsBundleTasks = Nothing
, _dbtrsResponseStatus = pResponseStatus_
} | 165 | true | true | 0 | 7 | 82 | 49 | 28 | 21 | null | null |
frp-arduino/frp-arduino | src/Arduino/Library/LCD.hs | gpl-3.0 | command :: CommandType
-> Int
-> Int
-> Int
-> Int
-> Word
-> Expression Command
command commandType b3 b2 b1 b0 delay =
pack6 ( typeToBit commandType
, bitFromValue b3
, bitFromValue b2
, bitFromValue b1
, bitFromValue b0
... | 597 | command :: CommandType
-> Int
-> Int
-> Int
-> Int
-> Word
-> Expression Command
command commandType b3 b2 b1 b0 delay =
pack6 ( typeToBit commandType
, bitFromValue b3
, bitFromValue b2
, bitFromValue b1
, bitFromValue b0
... | 597 | command commandType b3 b2 b1 b0 delay =
pack6 ( typeToBit commandType
, bitFromValue b3
, bitFromValue b2
, bitFromValue b1
, bitFromValue b0
, fromIntegral delay
)
where
typeToBit :: CommandType -> Expression Bit
typeToBit Command = bi... | 468 | false | true | 2 | 12 | 236 | 168 | 76 | 92 | null | null |
rolph-recto/liquid-fixpoint | src/Language/Fixpoint/Smt/Bitvector.hs | bsd-3-clause | eOp :: BvOp -> [Expr] -> Expr
eOp b es = foldl EApp (EVar $ opName b) es | 72 | eOp :: BvOp -> [Expr] -> Expr
eOp b es = foldl EApp (EVar $ opName b) es | 72 | eOp b es = foldl EApp (EVar $ opName b) es | 42 | false | true | 0 | 8 | 17 | 44 | 22 | 22 | null | null |
ben-schulz/Idris-dev | src/IRTS/JavaScript/AST.hs | bsd-3-clause | compileJS' indent (JSTernary cond true false) =
let c = compileJS' indent cond
t = compileJS' indent true
f = compileJS' indent false in
"("
`T.append` c
`T.append` ")?("
`T.append` t
`T.append` "):("
`T.append` f
`T.append` ")" | 286 | compileJS' indent (JSTernary cond true false) =
let c = compileJS' indent cond
t = compileJS' indent true
f = compileJS' indent false in
"("
`T.append` c
`T.append` ")?("
`T.append` t
`T.append` "):("
`T.append` f
`T.append` ")" | 286 | compileJS' indent (JSTernary cond true false) =
let c = compileJS' indent cond
t = compileJS' indent true
f = compileJS' indent false in
"("
`T.append` c
`T.append` ")?("
`T.append` t
`T.append` "):("
`T.append` f
`T.append` ")" | 286 | false | false | 0 | 9 | 94 | 126 | 63 | 63 | null | null |
m00nlight/99-problems | haskell/p-84.hs | bsd-3-clause | g2 :: Graph Int Weight
g2 = Graph [1,2,3,4] [(1,2,1), (2,3,1), (3,4,1), (4,1,1), (1,3,4), (2,4,4)] | 98 | g2 :: Graph Int Weight
g2 = Graph [1,2,3,4] [(1,2,1), (2,3,1), (3,4,1), (4,1,1), (1,3,4), (2,4,4)] | 98 | g2 = Graph [1,2,3,4] [(1,2,1), (2,3,1), (3,4,1), (4,1,1), (1,3,4), (2,4,4)] | 75 | false | true | 0 | 6 | 14 | 111 | 67 | 44 | null | null |
ben-schulz/Idris-dev | src/Idris/Delaborate.hs | bsd-3-clause | pprintErr' i (FancyMsg parts) =
fillSep (map (showPart i) parts) | 66 | pprintErr' i (FancyMsg parts) =
fillSep (map (showPart i) parts) | 66 | pprintErr' i (FancyMsg parts) =
fillSep (map (showPart i) parts) | 66 | false | false | 0 | 9 | 11 | 34 | 16 | 18 | null | null |
ghcjs/ghcjs | src/Gen2/RtsTypes.hs | mit | gsIdents :: Lens' GenState IdCache
gsIdents f gs = fmap (\x -> gs { _gsIdents = x }) (f $ _gsIdents gs) | 103 | gsIdents :: Lens' GenState IdCache
gsIdents f gs = fmap (\x -> gs { _gsIdents = x }) (f $ _gsIdents gs) | 103 | gsIdents f gs = fmap (\x -> gs { _gsIdents = x }) (f $ _gsIdents gs) | 68 | false | true | 0 | 9 | 21 | 52 | 27 | 25 | null | null |
TC1211/TCP | src/3a/tester-src/Data/IterIO/Parse.hs | apache-2.0 | - | Throw an 'Iter' exception that describes expected input not
-- found.
expectedI :: String -- ^ Input actually received
-> String -- ^ Description of input that was wanted
-> Iter t m a
expectedI saw target = throwI $ IterExpected saw [target]
| 291 | expectedI :: String -- ^ Input actually received
-> String -- ^ Description of input that was wanted
-> Iter t m a
expectedI saw target = throwI $ IterExpected saw [target] | 216 | expectedI saw target = throwI $ IterExpected saw [target] | 57 | true | true | 1 | 8 | 89 | 57 | 31 | 26 | null | null |
saep/nvim-hs | library/Neovim/Test.hs | apache-2.0 | -- | Run the given 'Neovim' action according to the given parameters.
-- The embedded neovim instance is started without a config (i.e. it is passed
-- @-u NONE@).
--
-- If you want to run your tests purely from haskell, you have to setup
-- the desired state of neovim with the help of the functions in
-- "Neovim.API.S... | 1,472 | testWithEmbeddedNeovim
:: Maybe (Path b File) -- ^ Optional path to a file that should be opened
-> Seconds -- ^ Maximum time (in seconds) that a test is allowed to run
-> env -- ^ Read-only configuration
-> Neovim env a -- ^ Test case
-> IO ()
testWithEmbeddedNeov... | 1,144 | testWithEmbeddedNeovim file timeout r (Internal.Neovim a) =
runTest `catch` catchIfNvimIsNotOnPath
where
runTest = do
(nvimProcess, cfg, cleanUp) <- startEmbeddedNvim file timeout
let testCfg = Internal.retypeConfig r cfg
void $ runReaderT (runResourceT a) testCfg
-- vim_com... | 844 | true | true | 0 | 13 | 426 | 249 | 121 | 128 | null | null |
c19/Exercism-Haskell | pythagorean-triplet/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/autogen/Paths_pythagorean_triplet.hs | mit | getDataDir = catchIO (getEnv "pythagorean_triplet_datadir") (\_ -> return datadir) | 82 | getDataDir = catchIO (getEnv "pythagorean_triplet_datadir") (\_ -> return datadir) | 82 | getDataDir = catchIO (getEnv "pythagorean_triplet_datadir") (\_ -> return datadir) | 82 | false | false | 0 | 8 | 8 | 28 | 14 | 14 | null | null |
mcmaniac/ghc | compiler/cmm/CmmType.hs | bsd-3-clause | halfWordWidth | wORD_SIZE == 4 = W16
| wORD_SIZE == 8 = W32
| otherwise = panic "MachOp.halfWordRep: Unknown word size" | 152 | halfWordWidth | wORD_SIZE == 4 = W16
| wORD_SIZE == 8 = W32
| otherwise = panic "MachOp.halfWordRep: Unknown word size" | 152 | halfWordWidth | wORD_SIZE == 4 = W16
| wORD_SIZE == 8 = W32
| otherwise = panic "MachOp.halfWordRep: Unknown word size" | 152 | false | false | 1 | 8 | 53 | 44 | 20 | 24 | null | null |
tedkornish/stack | src/Stack/Build/Execute.hs | bsd-3-clause | -- | Get a compiled Setup exe
getSetupExe :: M env m
=> Path Abs File -- ^ Setup.hs input file
-> Path Abs Dir -- ^ temporary directory
-> m (Maybe (Path Abs File))
getSetupExe setupHs tmpdir = do
wc <- getWhichCompiler
econfig <- asks getEnvConfig
let config = getConfig ... | 2,436 | getSetupExe :: M env m
=> Path Abs File -- ^ Setup.hs input file
-> Path Abs Dir -- ^ temporary directory
-> m (Maybe (Path Abs File))
getSetupExe setupHs tmpdir = do
wc <- getWhichCompiler
econfig <- asks getEnvConfig
let config = getConfig econfig
baseNameS = co... | 2,406 | getSetupExe setupHs tmpdir = do
wc <- getWhichCompiler
econfig <- asks getEnvConfig
let config = getConfig econfig
baseNameS = concat
[ "setup-Simple-Cabal-"
, versionString $ envConfigCabalVersion econfig
, "-"
, Distribution.Text.display $ configPlat... | 2,235 | true | true | 0 | 18 | 969 | 551 | 270 | 281 | null | null |
cblp/hindent | src/HIndent/Pretty.hs | bsd-3-clause | exp (Var _ q) = case q of
Special _ Cons{} -> parens (pretty q)
Qual _ _ (Symbol _ _) -> parens (pretty q)
UnQual _ (Symbol _ _) -> parens (pretty q)
_ -> pretty q | 235 | exp (Var _ q) = case q of
Special _ Cons{} -> parens (pretty q)
Qual _ _ (Symbol _ _) -> parens (pretty q)
UnQual _ (Symbol _ _) -> parens (pretty q)
_ -> pretty q | 235 | exp (Var _ q) = case q of
Special _ Cons{} -> parens (pretty q)
Qual _ _ (Symbol _ _) -> parens (pretty q)
UnQual _ (Symbol _ _) -> parens (pretty q)
_ -> pretty q | 235 | false | false | 0 | 10 | 109 | 113 | 52 | 61 | null | null |
energyflowanalysis/efa-2.1 | src/EFA/Utility/List.hs | bsd-3-clause | vlast caller _ = error $ "vlast, " ++ caller ++ ": empty list" | 62 | vlast caller _ = error $ "vlast, " ++ caller ++ ": empty list" | 62 | vlast caller _ = error $ "vlast, " ++ caller ++ ": empty list" | 62 | false | false | 0 | 7 | 13 | 24 | 11 | 13 | null | null |
DougBurke/swish | src/Swish/RDF/ProofContext.hs | lgpl-2.1 | rdfsa12 :: RDFFormula
rdfsa12 = makeFormula scopeRDFS "a12"
"rdf:subject rdfs:range rdfs:Resource ." | 112 | rdfsa12 :: RDFFormula
rdfsa12 = makeFormula scopeRDFS "a12"
"rdf:subject rdfs:range rdfs:Resource ." | 112 | rdfsa12 = makeFormula scopeRDFS "a12"
"rdf:subject rdfs:range rdfs:Resource ." | 90 | false | true | 0 | 5 | 23 | 19 | 9 | 10 | null | null |
dmbarbour/vcache-trie | hsrc_lib/Data/VCache/Trie.hs | bsd-2-clause | mbrun action (Just a) = M.liftM Just (action a) | 47 | mbrun action (Just a) = M.liftM Just (action a) | 47 | mbrun action (Just a) = M.liftM Just (action a) | 47 | false | false | 0 | 7 | 8 | 32 | 14 | 18 | null | null |
adamschoenemann/simple-frp | src/FRP/Parser/Term.hs | mit | tmfix :: Parser ParsedTerm
tmfix = do
_ <- reserved "fix"
(nm, ty) <- tmparam
trm <- reservedOp "." *> term
C.tmfix <*> return nm <*> return ty <*> return trm | 166 | tmfix :: Parser ParsedTerm
tmfix = do
_ <- reserved "fix"
(nm, ty) <- tmparam
trm <- reservedOp "." *> term
C.tmfix <*> return nm <*> return ty <*> return trm | 166 | tmfix = do
_ <- reserved "fix"
(nm, ty) <- tmparam
trm <- reservedOp "." *> term
C.tmfix <*> return nm <*> return ty <*> return trm | 139 | false | true | 0 | 10 | 38 | 77 | 35 | 42 | null | null |
danr/hipspec | testsuite/zeno/Properties.hs | gpl-3.0 | prop_51 xs x
= (butlast (xs ++ [x]) =:= xs) | 45 | prop_51 xs x
= (butlast (xs ++ [x]) =:= xs) | 45 | prop_51 xs x
= (butlast (xs ++ [x]) =:= xs) | 45 | false | false | 0 | 10 | 11 | 31 | 16 | 15 | null | null |
vollmerm/shallow-fission | tests/n-body/src-acc/Solver.hs | bsd-3-clause | -- | Calculate accelerations on these particles in a naïve O(n^2) way.
--
-- This maps a _sequential_ reduction to get the total contribution for this
-- body from all other bodies in the system.
--
calcAccels :: Exp R -> Acc (Vector PointMass) -> Acc (Vector Accel)
calcAccels epsilon bodies
= let move body ... | 540 | calcAccels :: Exp R -> Acc (Vector PointMass) -> Acc (Vector Accel)
calcAccels epsilon bodies
= let move body = A.sfoldl (\acc next -> acc .+. accel epsilon body next)
(vec 0)
(constant Z)
bodies
in
... | 337 | calcAccels epsilon bodies
= let move body = A.sfoldl (\acc next -> acc .+. accel epsilon body next)
(vec 0)
(constant Z)
bodies
in
A.map move bodies | 269 | true | true | 0 | 13 | 199 | 115 | 57 | 58 | null | null |
fmthoma/ghc | compiler/types/TypeRep.hs | bsd-3-clause | ---------------
tidyOpenTyVars :: TidyEnv -> [TyVar] -> (TidyEnv, [TyVar])
tidyOpenTyVars env tyvars = mapAccumL tidyOpenTyVar env tyvars | 137 | tidyOpenTyVars :: TidyEnv -> [TyVar] -> (TidyEnv, [TyVar])
tidyOpenTyVars env tyvars = mapAccumL tidyOpenTyVar env tyvars | 121 | tidyOpenTyVars env tyvars = mapAccumL tidyOpenTyVar env tyvars | 62 | true | true | 0 | 8 | 16 | 44 | 24 | 20 | null | null |
sleepomeno/snooker-statistics | src/Fetcher.hs | apache-2.0 | starts = map (T.pack . show) [0, 30 ..] | 39 | starts = map (T.pack . show) [0, 30 ..] | 39 | starts = map (T.pack . show) [0, 30 ..] | 39 | false | false | 1 | 8 | 8 | 31 | 15 | 16 | null | null |
ddccffvv/fun-with-haskell | avi.hs | mit | mempty = StringAddition "" | 26 | mempty = StringAddition "" | 26 | mempty = StringAddition "" | 26 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
keithodulaigh/Hets | OWL2/Sublogic.hs | gpl-2.0 | slSig :: Sign -> OWLSub
slSig sig = let dts = Set.toList $ datatypes sig in
if Set.size (dataProperties sig) == 0 && null dts
then slBottom else foldl slMax slBottom $ map slDatatype dts | 194 | slSig :: Sign -> OWLSub
slSig sig = let dts = Set.toList $ datatypes sig in
if Set.size (dataProperties sig) == 0 && null dts
then slBottom else foldl slMax slBottom $ map slDatatype dts | 194 | slSig sig = let dts = Set.toList $ datatypes sig in
if Set.size (dataProperties sig) == 0 && null dts
then slBottom else foldl slMax slBottom $ map slDatatype dts | 170 | false | true | 0 | 12 | 42 | 82 | 39 | 43 | null | null |
Teaspot-Studio/bmstu-radio-problem-haste | Radio/Task.hs | bsd-3-clause | initialPlotState :: PlotState
initialPlotState = PlotState [] | 62 | initialPlotState :: PlotState
initialPlotState = PlotState [] | 61 | initialPlotState = PlotState [] | 31 | false | true | 0 | 6 | 7 | 16 | 8 | 8 | null | null |
takagi/SimulationDSL | Examples/InterpreterRun.hs | bsd-3-clause | machine3 = do define "x" (integral (constantS 1))
initialConditionS "x" (fromList [0,1])
-- ok | 109 | machine3 = do define "x" (integral (constantS 1))
initialConditionS "x" (fromList [0,1])
-- ok | 109 | machine3 = do define "x" (integral (constantS 1))
initialConditionS "x" (fromList [0,1])
-- ok | 109 | false | false | 1 | 12 | 28 | 51 | 23 | 28 | null | null |
josefs/autosar | oldARSim/ARSim.hs | bsd-3-clause | trig :: Connected -> Name2 -> Static -> Bool
trig conn a s = or [ a `conn` b | b <- triggers s ] | 98 | trig :: Connected -> Name2 -> Static -> Bool
trig conn a s = or [ a `conn` b | b <- triggers s ] | 98 | trig conn a s = or [ a `conn` b | b <- triggers s ] | 53 | false | true | 0 | 9 | 26 | 59 | 28 | 31 | null | null |
flyingleafe/parser-gen | src/Generator.hs | bsd-3-clause | returnDataDatatypes ∷ Generator ()
returnDataDatatypes = do
pgr ← asks pGrammar
let nts = M.keys pgr
forM_ nts $ \nt → do
curData ← returnDataDatatype nt
let curValues = concatMap returnVals $ maybeToList $ M.lookup nt pgr
curValues' = map (\(p, t) → nt ++ "_" ++ p ++ " :: " ++ t) curValues
... | 488 | returnDataDatatypes ∷ Generator ()
returnDataDatatypes = do
pgr ← asks pGrammar
let nts = M.keys pgr
forM_ nts $ \nt → do
curData ← returnDataDatatype nt
let curValues = concatMap returnVals $ maybeToList $ M.lookup nt pgr
curValues' = map (\(p, t) → nt ++ "_" ++ p ++ " :: " ++ t) curValues
... | 488 | returnDataDatatypes = do
pgr ← asks pGrammar
let nts = M.keys pgr
forM_ nts $ \nt → do
curData ← returnDataDatatype nt
let curValues = concatMap returnVals $ maybeToList $ M.lookup nt pgr
curValues' = map (\(p, t) → nt ++ "_" ++ p ++ " :: " ++ t) curValues
dataSet = if length curValues'... | 453 | false | true | 0 | 20 | 128 | 195 | 95 | 100 | null | null |
dagit/zenc | Text/Encoding/Z.hs | bsd-3-clause | decode_lower 'u' = '_' | 22 | decode_lower 'u' = '_' | 22 | decode_lower 'u' = '_' | 22 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
mrakgr/futhark | src/Futhark/Transform/Rename.hs | bsd-3-clause | -- | Perform a renaming using the 'Substitute' instance. This only
-- works if the argument does not itself perform any name binding, but
-- it can save on boilerplate for simple types.
substituteRename :: Substitute a => a -> RenameM a
substituteRename x = do
substs <- renamerSubstitutions
return $ substituteName... | 407 | substituteRename :: Substitute a => a -> RenameM a
substituteRename x = do
substs <- renamerSubstitutions
return $ substituteNames substs x
-- | Return a fresh, unique name. The @VName@ is prepended to the
-- name. | 220 | substituteRename x = do
substs <- renamerSubstitutions
return $ substituteNames substs x
-- | Return a fresh, unique name. The @VName@ is prepended to the
-- name. | 169 | true | true | 0 | 8 | 75 | 52 | 26 | 26 | null | null |
Tarrasch/timed-repeating | Control/Concurrent/TimedRepeating.hs | bsd-3-clause | -- | For usage of this value, please read about
-- <http://www.yesodweb.com/blog/2011/10/settings-types>
defaultTrSettings :: TrSettings
defaultTrSettings = TrSettings (60*1000000) | 182 | defaultTrSettings :: TrSettings
defaultTrSettings = TrSettings (60*1000000) | 75 | defaultTrSettings = TrSettings (60*1000000) | 43 | true | true | 0 | 7 | 20 | 23 | 13 | 10 | null | null |
alexisVallet/deep-banana | test/Test/DeepBanana/Layer/CUDA.hs | bsd-3-clause | test_sumRows :: Spec
test_sumRows = describe "DeepBanana.Layer.Cuda.sumRows" $ do
let x = tensorFromList' (2:.2:.Z) [1,2,3,4] :: Tensor TestDevice (Dim 2) CFloat
expected = [3,7] :: [CFloat]
it "returns the right result for a simple example" $ do
let (actual,_) = runCudaEx (generator 42) $ forward sumRows... | 372 | test_sumRows :: Spec
test_sumRows = describe "DeepBanana.Layer.Cuda.sumRows" $ do
let x = tensorFromList' (2:.2:.Z) [1,2,3,4] :: Tensor TestDevice (Dim 2) CFloat
expected = [3,7] :: [CFloat]
it "returns the right result for a simple example" $ do
let (actual,_) = runCudaEx (generator 42) $ forward sumRows... | 372 | test_sumRows = describe "DeepBanana.Layer.Cuda.sumRows" $ do
let x = tensorFromList' (2:.2:.Z) [1,2,3,4] :: Tensor TestDevice (Dim 2) CFloat
expected = [3,7] :: [CFloat]
it "returns the right result for a simple example" $ do
let (actual,_) = runCudaEx (generator 42) $ forward sumRows (W Z) x
tensorTo... | 351 | false | true | 0 | 17 | 70 | 152 | 78 | 74 | null | null |
grumply/Ef | tests/Test.hs | bsd-3-clause | prompt str f = I.send (Put str ()) >> I.send (Get f) | 52 | prompt str f = I.send (Put str ()) >> I.send (Get f) | 52 | prompt str f = I.send (Put str ()) >> I.send (Get f) | 52 | false | false | 0 | 9 | 11 | 41 | 19 | 22 | null | null |
acowley/ghc | compiler/nativeGen/Dwarf/Constants.hs | bsd-3-clause | dW_TAG_variable = 52 | 27 | dW_TAG_variable = 52 | 27 | dW_TAG_variable = 52 | 27 | false | false | 0 | 4 | 9 | 6 | 3 | 3 | null | null |
k0001/gtk2hs | tools/apiGen/src/MarshalFixup.hs | gpl-3.0 | fixModuleDocMapping "GtkStyle" = "Styles" | 45 | fixModuleDocMapping "GtkStyle" = "Styles" | 45 | fixModuleDocMapping "GtkStyle" = "Styles" | 45 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
spechub/Hets | Maude/PreComorphism.hs | gpl-2.0 | token2id :: Token -> Id
token2id t = mkId ts
where ts = maudeSymbol2validCASLSymbol t
-- | build an Id from a Maude symbol | 127 | token2id :: Token -> Id
token2id t = mkId ts
where ts = maudeSymbol2validCASLSymbol t
-- | build an Id from a Maude symbol | 127 | token2id t = mkId ts
where ts = maudeSymbol2validCASLSymbol t
-- | build an Id from a Maude symbol | 103 | false | true | 0 | 5 | 28 | 33 | 16 | 17 | null | null |
craft095/scandir | ScanDir.hs | bsd-3-clause | scan ScanOpts {..} = do
-- let f d = d </> ".." </> template
-- print $ take limit $ iterate f dir
xs <- filterM doesFileExist $ take limit $ map (\i-> dir </> i </> template) $ iterate (".." </>) "."
maybe (return "") canonicalizePath $ safeHead xs | 265 | scan ScanOpts {..} = do
-- let f d = d </> ".." </> template
-- print $ take limit $ iterate f dir
xs <- filterM doesFileExist $ take limit $ map (\i-> dir </> i </> template) $ iterate (".." </>) "."
maybe (return "") canonicalizePath $ safeHead xs | 265 | scan ScanOpts {..} = do
-- let f d = d </> ".." </> template
-- print $ take limit $ iterate f dir
xs <- filterM doesFileExist $ take limit $ map (\i-> dir </> i </> template) $ iterate (".." </>) "."
maybe (return "") canonicalizePath $ safeHead xs | 265 | false | false | 0 | 14 | 66 | 91 | 44 | 47 | null | null |
Chobbes/TimePaper | TimePaper/Parser.hs | mit | parseDate :: Parser Day
parseDate = do year <- decimal
char '.'
month <- decimal
char '.'
day <- decimal
return (fromGregorian year month day)
-- | Parse the time of day. | 246 | parseDate :: Parser Day
parseDate = do year <- decimal
char '.'
month <- decimal
char '.'
day <- decimal
return (fromGregorian year month day)
-- | Parse the time of day. | 246 | parseDate = do year <- decimal
char '.'
month <- decimal
char '.'
day <- decimal
return (fromGregorian year month day)
-- | Parse the time of day. | 222 | false | true | 0 | 9 | 107 | 64 | 28 | 36 | null | null |
pqwy/redex | src/Repr/Stringy.hs | bsd-3-clause | showsAST (ast -> Lam x t) =
('λ' :) <<< shows x <<<
fix ( \f t -> case ast t of
Lam x t' -> shows x <<< f t'
_ -> ('.' :) <<< showsAST t ) t | 179 | showsAST (ast -> Lam x t) =
('λ' :) <<< shows x <<<
fix ( \f t -> case ast t of
Lam x t' -> shows x <<< f t'
_ -> ('.' :) <<< showsAST t ) t | 179 | showsAST (ast -> Lam x t) =
('λ' :) <<< shows x <<<
fix ( \f t -> case ast t of
Lam x t' -> shows x <<< f t'
_ -> ('.' :) <<< showsAST t ) t | 179 | false | false | 2 | 12 | 78 | 99 | 47 | 52 | null | null |
prl-tokyo/bigul-configuration-adaptation | Transformations/src/Generics/BiGUL/AST.hs | mit | checkUPat' (UProd upatl upatr) = checkUPat' upatl >> checkUPat' upatr | 69 | checkUPat' (UProd upatl upatr) = checkUPat' upatl >> checkUPat' upatr | 69 | checkUPat' (UProd upatl upatr) = checkUPat' upatl >> checkUPat' upatr | 69 | false | false | 0 | 7 | 9 | 27 | 12 | 15 | null | null |
amutake/imp | src/Imp/Eval.hs | bsd-3-clause | step :: Env -> Statement -> IO (Maybe Value)
step env (Var ident expr) = do
value <- eval env expr
declare env ident value
return Nothing | 149 | step :: Env -> Statement -> IO (Maybe Value)
step env (Var ident expr) = do
value <- eval env expr
declare env ident value
return Nothing | 149 | step env (Var ident expr) = do
value <- eval env expr
declare env ident value
return Nothing | 104 | false | true | 0 | 9 | 38 | 69 | 31 | 38 | null | null |
NorfairKing/the-notes | src/Cryptography/SymmetricCryptography.hs | gpl-2.0 | oneTimePadSecure :: Note
oneTimePadSecure = prop $ do
lab oneTimePadSecurePropertyLabel
let n = "n"
s [the, oneTimePad <> "'s", ciphertexts, "are", independent, "of their", messages, "for a given message length", m n]
proof $ do
let m_ = "M"
k_ = "K"
c_ = "C"
... | 1,244 | oneTimePadSecure :: Note
oneTimePadSecure = prop $ do
lab oneTimePadSecurePropertyLabel
let n = "n"
s [the, oneTimePad <> "'s", ciphertexts, "are", independent, "of their", messages, "for a given message length", m n]
proof $ do
let m_ = "M"
k_ = "K"
c_ = "C"
... | 1,244 | oneTimePadSecure = prop $ do
lab oneTimePadSecurePropertyLabel
let n = "n"
s [the, oneTimePad <> "'s", ciphertexts, "are", independent, "of their", messages, "for a given message length", m n]
proof $ do
let m_ = "M"
k_ = "K"
c_ = "C"
n = "n"
s ["Let",... | 1,219 | false | true | 0 | 20 | 384 | 514 | 270 | 244 | null | null |
vincenthz/cryptonite | Crypto/Number/F2m.hs | bsd-3-clause | -- | Multiplication over F₂m.
--
-- This function is undefined for negative arguments, because their bit
-- representation is platform-dependent. Zero modulus is also prohibited.
mulF2m :: BinaryPolynomial -- ^ Modulus
-> Integer
-> Integer
-> Integer
mulF2m fx n1 n2
| fx < 0
|| n1 < 0... | 762 | mulF2m :: BinaryPolynomial -- ^ Modulus
-> Integer
-> Integer
-> Integer
mulF2m fx n1 n2
| fx < 0
|| n1 < 0
|| n2 < 0 = error "mulF2m: negative number represent no binary polynomial"
| fx == 0 = error "mulF2m: cannot multiply modulo zero polynomial"
| otherwise = modF2m... | 583 | mulF2m fx n1 n2
| fx < 0
|| n1 < 0
|| n2 < 0 = error "mulF2m: negative number represent no binary polynomial"
| fx == 0 = error "mulF2m: cannot multiply modulo zero polynomial"
| otherwise = modF2m fx $ go (if n2 `mod` 2 == 1 then n1 else 0) (log2 n2)
where
go n s | s == 0 = ... | 489 | true | true | 1 | 12 | 271 | 222 | 110 | 112 | null | null |
rueshyna/gogol | gogol-vision/gen/Network/Google/Vision/Types/Product.hs | mpl-2.0 | -- | Opaque entity ID. Some IDs may be available in [Google Knowledge Graph
-- Search API](https:\/\/developers.google.com\/knowledge-graph\/).
eaMid :: Lens' EntityAnnotation (Maybe Text)
eaMid = lens _eaMid (\ s a -> s{_eaMid = a}) | 233 | eaMid :: Lens' EntityAnnotation (Maybe Text)
eaMid = lens _eaMid (\ s a -> s{_eaMid = a}) | 89 | eaMid = lens _eaMid (\ s a -> s{_eaMid = a}) | 44 | true | true | 2 | 9 | 33 | 56 | 26 | 30 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/xhtml/Text/XHtml/Strict/Attributes.hs | bsd-3-clause | theclass = strAttr "class" | 39 | theclass = strAttr "class" | 39 | theclass = strAttr "class" | 39 | false | false | 1 | 5 | 16 | 12 | 4 | 8 | null | null |
dankamongmen/raptitude | tools/resolver-visualize/Resolver/Log.hs | gpl-2.0 | parseMatch :: Parser a
-> ByteString
-> (MatchOffset, MatchLength)
-> LogParse a
parseMatch subParser source (start, length) =
do when (start == (-1) || length == (-1))
(fail "No match to parse.")
sourceName <- getSourceName
currentLine <- getCurrentLine
... | 608 | parseMatch :: Parser a
-> ByteString
-> (MatchOffset, MatchLength)
-> LogParse a
parseMatch subParser source (start, length) =
do when (start == (-1) || length == (-1))
(fail "No match to parse.")
sourceName <- getSourceName
currentLine <- getCurrentLine
... | 608 | parseMatch subParser source (start, length) =
do when (start == (-1) || length == (-1))
(fail "No match to parse.")
sourceName <- getSourceName
currentLine <- getCurrentLine
let currentColumn = start
pos = newPos sourceName currentLine currentColumn
text = extr... | 494 | false | true | 0 | 13 | 178 | 160 | 81 | 79 | null | null |
CindyLinz/Haskell.js | trans/src/Desugar/LambdaCase.hs | mit | deLambdaCaseInstHead (IHParen l instHead) = IHParen (id l) (deLambdaCaseInstHead instHead) | 90 | deLambdaCaseInstHead (IHParen l instHead) = IHParen (id l) (deLambdaCaseInstHead instHead) | 90 | deLambdaCaseInstHead (IHParen l instHead) = IHParen (id l) (deLambdaCaseInstHead instHead) | 90 | false | false | 0 | 7 | 9 | 34 | 16 | 18 | null | null |
msakai/icfpc2013 | test/TestBV.hs | bsd-2-clause | case_fold = do
forM_ (zip inputs outputs) $ \(x,y) -> do
eval prog x @?= y
where
-- (lambda (x) (fold x 1 (lambda (y z) (xor y (shl1 z)))))
prog = Program "x" (fold x b1 "y" "z" (xor' y (shl1 z)))
x = var "x"
y = var "y"
z = var "z"
inputs = [0x0,0x1,0x2,0x3,0x4,0x5,0x112233,0x112233445... | 542 | case_fold = do
forM_ (zip inputs outputs) $ \(x,y) -> do
eval prog x @?= y
where
-- (lambda (x) (fold x 1 (lambda (y z) (xor y (shl1 z)))))
prog = Program "x" (fold x b1 "y" "z" (xor' y (shl1 z)))
x = var "x"
y = var "y"
z = var "z"
inputs = [0x0,0x1,0x2,0x3,0x4,0x5,0x112233,0x112233445... | 542 | case_fold = do
forM_ (zip inputs outputs) $ \(x,y) -> do
eval prog x @?= y
where
-- (lambda (x) (fold x 1 (lambda (y z) (xor y (shl1 z)))))
prog = Program "x" (fold x b1 "y" "z" (xor' y (shl1 z)))
x = var "x"
y = var "y"
z = var "z"
inputs = [0x0,0x1,0x2,0x3,0x4,0x5,0x112233,0x112233445... | 542 | false | false | 0 | 12 | 105 | 177 | 98 | 79 | null | null |
HIPERFIT/futhark | src/Futhark/CodeGen/ImpGen.hs | isc | sUpdate :: VName -> Slice (Imp.TExp Int64) -> SubExp -> ImpM rep r op ()
sUpdate arr slice v = copyDWIM arr (unSlice slice) v [] | 128 | sUpdate :: VName -> Slice (Imp.TExp Int64) -> SubExp -> ImpM rep r op ()
sUpdate arr slice v = copyDWIM arr (unSlice slice) v [] | 128 | sUpdate arr slice v = copyDWIM arr (unSlice slice) v [] | 55 | false | true | 0 | 10 | 25 | 69 | 33 | 36 | null | null |
spockwangs/scheme.in.haskell | list6.1.hs | unlicense | parseString :: Parser LispVal
parseString = do char '"'
x <- many parseChar
char '"'
return $ String x | 153 | parseString :: Parser LispVal
parseString = do char '"'
x <- many parseChar
char '"'
return $ String x | 153 | parseString = do char '"'
x <- many parseChar
char '"'
return $ String x | 123 | false | true | 0 | 8 | 69 | 46 | 19 | 27 | null | null |
jacekszymanski/wxHaskell | wx/src/Graphics/UI/WX/Controls.hs | lgpl-2.1 | wxMEDIABACKEND_GSTREAMER :: String
wxMEDIABACKEND_GSTREAMER = "wxGStreamerMediaBackend" | 89 | wxMEDIABACKEND_GSTREAMER :: String
wxMEDIABACKEND_GSTREAMER = "wxGStreamerMediaBackend" | 89 | wxMEDIABACKEND_GSTREAMER = "wxGStreamerMediaBackend" | 53 | false | true | 0 | 4 | 7 | 11 | 6 | 5 | null | null |
wellecks/coltrane | Coltrane.hs | bsd-3-clause | matchesPath :: [DT.Text] -> [DT.Text] -> Maybe Params
matchesPath ((r1:rs1)) ((r2:rs2)) =
case DT.unpack r1 of
x:_ -> if isWildcard x then
combine (Just [(DT.unpack r1, DT.unpack r2)]) matchesRemaining
else
strictlyMatches
_ -> strictlyMatches
where
isWildcard... | 480 | matchesPath :: [DT.Text] -> [DT.Text] -> Maybe Params
matchesPath ((r1:rs1)) ((r2:rs2)) =
case DT.unpack r1 of
x:_ -> if isWildcard x then
combine (Just [(DT.unpack r1, DT.unpack r2)]) matchesRemaining
else
strictlyMatches
_ -> strictlyMatches
where
isWildcard... | 480 | matchesPath ((r1:rs1)) ((r2:rs2)) =
case DT.unpack r1 of
x:_ -> if isWildcard x then
combine (Just [(DT.unpack r1, DT.unpack r2)]) matchesRemaining
else
strictlyMatches
_ -> strictlyMatches
where
isWildcard = (==':')
matchesRemaining = matchesPath (rs1... | 426 | false | true | 0 | 15 | 136 | 178 | 96 | 82 | null | null |
facebook/Haxl | Haxl/Core/DataSource.hs | bsd-3-clause | backgroundFetchAcquireRelease
:: IO service
-- ^ Resource acquisition for this datasource
-> (service -> IO ())
-- ^ Resource release
-> (service -> Int -> StablePtr PrimMVar -> IO ())
-- ^ Dispatch all the pending requests and when ready trigger the given mvar
-> (service -> IO ())
-- ^ Process all ... | 843 | backgroundFetchAcquireRelease
:: IO service
-- ^ Resource acquisition for this datasource
-> (service -> IO ())
-- ^ Resource release
-> (service -> Int -> StablePtr PrimMVar -> IO ())
-- ^ Dispatch all the pending requests and when ready trigger the given mvar
-> (service -> IO ())
-- ^ Process all ... | 842 | backgroundFetchAcquireRelease
a r dispatch = backgroundFetchAcquireReleaseMVar
a
r
(\s c mvar -> do
sp <- newStablePtrPrimMVar mvar
dispatch s c sp) | 243 | false | true | 0 | 19 | 256 | 193 | 96 | 97 | null | null |
fxmy/haskell-book-exercise | src/Wat.hs | gpl-3.0 | execMoi :: Moi s a -> s -> s
execMoi (Moi sa) s = snd $ sa s | 62 | execMoi :: Moi s a -> s -> s
execMoi (Moi sa) s = snd $ sa s | 60 | execMoi (Moi sa) s = snd $ sa s | 31 | false | true | 0 | 10 | 19 | 47 | 21 | 26 | null | null |
bitemyapp/uri-bytestring | src/URI/ByteString/Internal.hs | bsd-3-clause | mPortParser :: URIParser (Maybe Port)
mPortParser = word8' colon `thenJust` portParser | 86 | mPortParser :: URIParser (Maybe Port)
mPortParser = word8' colon `thenJust` portParser | 86 | mPortParser = word8' colon `thenJust` portParser | 48 | false | true | 0 | 7 | 10 | 29 | 15 | 14 | null | null |
beni55/haste-compiler | libraries/ghc-7.10/ghc-prim/GHC/Prim.hs | bsd-3-clause | -- |Convert to integers.
-- First @Int\#@ in result is the mantissa; second is the exponent.
decodeFloat_Int# :: Float# -> (# Int#,Int# #)
decodeFloat_Int# = let x = x in x | 177 | decodeFloat_Int# :: Float# -> (# Int#,Int# #)
decodeFloat_Int# = let x = x in x | 79 | decodeFloat_Int# = let x = x in x | 33 | true | true | 0 | 8 | 35 | 40 | 19 | 21 | null | null |
jsnajder/fer3-catalogue | src/Data/EdgeLabeledGraph.hs | bsd-3-clause | inEdges' :: (Vertex v k, Ord k) => k -> Graph k v l -> [(l,k)]
inEdges' k g = [ (l,k1) | (k1,l,k2) <- toEdgeList' g, k2==k ] | 124 | inEdges' :: (Vertex v k, Ord k) => k -> Graph k v l -> [(l,k)]
inEdges' k g = [ (l,k1) | (k1,l,k2) <- toEdgeList' g, k2==k ] | 124 | inEdges' k g = [ (l,k1) | (k1,l,k2) <- toEdgeList' g, k2==k ] | 61 | false | true | 0 | 9 | 28 | 94 | 51 | 43 | null | null |
magicant/flesh | src/Flesh/Source/Position/Print.hs | gpl-2.0 | showsBlock :: Block -> Writer (Endo String) ()
showsBlock blk = do
showsBlockHead blk
showsBlockTail (position blk)
-- | Optionally prints a sub-block for describing the situation. | 185 | showsBlock :: Block -> Writer (Endo String) ()
showsBlock blk = do
showsBlockHead blk
showsBlockTail (position blk)
-- | Optionally prints a sub-block for describing the situation. | 185 | showsBlock blk = do
showsBlockHead blk
showsBlockTail (position blk)
-- | Optionally prints a sub-block for describing the situation. | 138 | false | true | 0 | 9 | 31 | 50 | 23 | 27 | null | null |
uuhan/Idris-dev | src/Idris/Core/CaseTree.hs | bsd-3-clause | mixture vs (Vars ms : ps) err = do fallthrough <- mixture vs ps err
varRule vs ms fallthrough
-- Return the list of inaccessible arguments of a data constructor. | 197 | mixture vs (Vars ms : ps) err = do fallthrough <- mixture vs ps err
varRule vs ms fallthrough
-- Return the list of inaccessible arguments of a data constructor. | 197 | mixture vs (Vars ms : ps) err = do fallthrough <- mixture vs ps err
varRule vs ms fallthrough
-- Return the list of inaccessible arguments of a data constructor. | 197 | false | false | 0 | 8 | 65 | 48 | 22 | 26 | null | null |
rosenbergdm/language-r | src/Language/R/temp.hs | bsd-3-clause | rReserved = reserved rlang | 34 | rReserved = reserved rlang | 34 | rReserved = reserved rlang | 34 | false | false | 0 | 5 | 11 | 9 | 4 | 5 | null | null |
byorgey/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | process fn (UnsetOpt _) = iFail "Not a valid option" | 52 | process fn (UnsetOpt _) = iFail "Not a valid option" | 52 | process fn (UnsetOpt _) = iFail "Not a valid option" | 52 | false | false | 0 | 7 | 9 | 20 | 9 | 11 | null | null |
brunoczim/PulseLambda | PulseLambda/Parser.hs | gpl-3.0 | parseVar :: Token -> Node
parseVar (Token loc (IdentifierToken identf)) = Node loc (VarMention identf) | 102 | parseVar :: Token -> Node
parseVar (Token loc (IdentifierToken identf)) = Node loc (VarMention identf) | 102 | parseVar (Token loc (IdentifierToken identf)) = Node loc (VarMention identf) | 76 | false | true | 0 | 11 | 14 | 48 | 22 | 26 | null | null |
MnM/http-client-auth | src/Network/HTTP/Client/Auth.hs | bsd-3-clause | token :: MaybeT (State String) String
token = do
str <- lift get
let ~(tok, rst) = span isWordChar str
guard $ not $ null tok
lift $ put $ dropWhile isSpace rst
return tok | 191 | token :: MaybeT (State String) String
token = do
str <- lift get
let ~(tok, rst) = span isWordChar str
guard $ not $ null tok
lift $ put $ dropWhile isSpace rst
return tok | 191 | token = do
str <- lift get
let ~(tok, rst) = span isWordChar str
guard $ not $ null tok
lift $ put $ dropWhile isSpace rst
return tok | 153 | false | true | 0 | 11 | 54 | 90 | 40 | 50 | null | null |
stgm/prac-testing | week4/Week3.hs | mit | termVal :: Lookup a -> Fint a -> Term -> a
termVal g i (V name) = g name | 73 | termVal :: Lookup a -> Fint a -> Term -> a
termVal g i (V name) = g name | 72 | termVal g i (V name) = g name | 29 | false | true | 0 | 11 | 19 | 51 | 22 | 29 | null | null |
balez/ag-a-la-carte | Language/Grammars/AGalacarte/Examples/Desk.hs | gpl-3.0 | add_left = n0 | 15 | add_left = n0 | 15 | add_left = n0 | 15 | false | false | 0 | 4 | 4 | 6 | 3 | 3 | null | null |
hguenther/smtlib2 | Language/SMTLib2/Internals/Type.hs | gpl-3.0 | datatypeCompare :: (IsDatatype dt1,IsDatatype dt2)
=> Datatype dt1 -> Datatype dt2
-> GOrdering dt1 dt2
datatypeCompare (d1 :: Datatype dt1) (d2 :: Datatype dt2)
= case eqT of
Just (Refl :: dt1 :~: dt2) -> case compare d1 d2 of
EQ -> GEQ
LT -> GLT
GT -> GGT
Nothing -> c... | 456 | datatypeCompare :: (IsDatatype dt1,IsDatatype dt2)
=> Datatype dt1 -> Datatype dt2
-> GOrdering dt1 dt2
datatypeCompare (d1 :: Datatype dt1) (d2 :: Datatype dt2)
= case eqT of
Just (Refl :: dt1 :~: dt2) -> case compare d1 d2 of
EQ -> GEQ
LT -> GLT
GT -> GGT
Nothing -> c... | 456 | datatypeCompare (d1 :: Datatype dt1) (d2 :: Datatype dt2)
= case eqT of
Just (Refl :: dt1 :~: dt2) -> case compare d1 d2 of
EQ -> GEQ
LT -> GLT
GT -> GGT
Nothing -> case compare
(typeRep (Proxy::Proxy dt1))
(typeRep (Proxy::Proxy dt2)) of
LT -> GLT
GT -> GGT | 320 | false | true | 0 | 13 | 159 | 181 | 89 | 92 | null | null |
triplepointfive/cereal | src/Data/Serialize/Put.hs | bsd-3-clause | putMaybeOf :: Putter a -> Putter (Maybe a)
putMaybeOf _ Nothing = putWord8 0 | 78 | putMaybeOf :: Putter a -> Putter (Maybe a)
putMaybeOf _ Nothing = putWord8 0 | 78 | putMaybeOf _ Nothing = putWord8 0 | 35 | false | true | 0 | 8 | 15 | 35 | 16 | 19 | null | null |
anttisalonen/starrover2 | src/TextScreen.hs | mit | drawButton :: Maybe (String, Font) -> ((GLdouble, GLdouble), (GLdouble, GLdouble)) -> IO ()
drawButton ms ((tlx, tly), (diffx, diffy)) = do
loadIdentity
translate $ Vector3 tlx (tly + 2) (0 :: GLdouble)
currentColor $= Color4 1.0 1.0 1.0 1.0
renderPrimitive LineLoop $
mapM_ vertex [Vertex3 (0 :: GLdouble) 0... | 527 | drawButton :: Maybe (String, Font) -> ((GLdouble, GLdouble), (GLdouble, GLdouble)) -> IO ()
drawButton ms ((tlx, tly), (diffx, diffy)) = do
loadIdentity
translate $ Vector3 tlx (tly + 2) (0 :: GLdouble)
currentColor $= Color4 1.0 1.0 1.0 1.0
renderPrimitive LineLoop $
mapM_ vertex [Vertex3 (0 :: GLdouble) 0... | 527 | drawButton ms ((tlx, tly), (diffx, diffy)) = do
loadIdentity
translate $ Vector3 tlx (tly + 2) (0 :: GLdouble)
currentColor $= Color4 1.0 1.0 1.0 1.0
renderPrimitive LineLoop $
mapM_ vertex [Vertex3 (0 :: GLdouble) 0 0, Vertex3 0 diffy 0, Vertex3 diffx diffy 0, Vertex3 diffx 0 0]
case ms of
Nothing ->... | 435 | false | true | 0 | 16 | 119 | 252 | 127 | 125 | null | null |
spacekitteh/smcghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | doPrefetchAddrOp _ _ _
= panic "StgCmmPrim: doPrefetchAddrOp" | 65 | doPrefetchAddrOp _ _ _
= panic "StgCmmPrim: doPrefetchAddrOp" | 65 | doPrefetchAddrOp _ _ _
= panic "StgCmmPrim: doPrefetchAddrOp" | 65 | false | false | 1 | 5 | 11 | 17 | 6 | 11 | null | null |
graninas/Haskell-Algorithms | Programs/SimpleFormat/Process.hs | gpl-3.0 | process (x:xs) el tags b = x : process xs el tags b | 51 | process (x:xs) el tags b = x : process xs el tags b | 51 | process (x:xs) el tags b = x : process xs el tags b | 51 | false | false | 0 | 7 | 12 | 35 | 17 | 18 | null | null |
gridaphobe/ghc | compiler/types/Type.hs | bsd-3-clause | mkCoercionTy :: Coercion -> Type
mkCoercionTy = CoercionTy | 58 | mkCoercionTy :: Coercion -> Type
mkCoercionTy = CoercionTy | 58 | mkCoercionTy = CoercionTy | 25 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
ksaveljev/hake-2 | src/Game/Cmd.hs | bsd-3-clause | execF :: XCommandT
execF =
XCommandT "Cmd.execF" (do
c <- argc
if c /= 2
then Com.printf "exec <filename> : execute a script file\n"
else do
v1 <- argv 1
f <- FS.loadFile v1
case f of
Nothing -> Com.printf $ "couldn't exec " `B.append` v1 `B.append` "\n"
... | 449 | execF :: XCommandT
execF =
XCommandT "Cmd.execF" (do
c <- argc
if c /= 2
then Com.printf "exec <filename> : execute a script file\n"
else do
v1 <- argv 1
f <- FS.loadFile v1
case f of
Nothing -> Com.printf $ "couldn't exec " `B.append` v1 `B.append` "\n"
... | 449 | execF =
XCommandT "Cmd.execF" (do
c <- argc
if c /= 2
then Com.printf "exec <filename> : execute a script file\n"
else do
v1 <- argv 1
f <- FS.loadFile v1
case f of
Nothing -> Com.printf $ "couldn't exec " `B.append` v1 `B.append` "\n"
Just contents ->... | 430 | false | true | 0 | 20 | 156 | 153 | 73 | 80 | null | null |
frontrowed/esqueleto | src/Database/Esqueleto/Internal/Sql.hs | bsd-3-clause | ifNotEmptyList :: SqlExpr (ValueList a) -> Bool -> SqlExpr (Value Bool) -> SqlExpr (Value Bool)
ifNotEmptyList EEmptyList b _ = val b | 133 | ifNotEmptyList :: SqlExpr (ValueList a) -> Bool -> SqlExpr (Value Bool) -> SqlExpr (Value Bool)
ifNotEmptyList EEmptyList b _ = val b | 133 | ifNotEmptyList EEmptyList b _ = val b | 37 | false | true | 0 | 10 | 21 | 60 | 28 | 32 | null | null |
eddywestbrook/hobbits | archival/TermNoHack.hs | bsd-3-clause | liftTy :: Mb ctx Ty -> Ty
liftTy b = case mbMatch Tag b of
BBase i -> Base (mbInt i)
BArrow ty1 ty2 -> Arrow (liftTy ty1) (liftTy ty2)
-- now, the actual parser! | 188 | liftTy :: Mb ctx Ty -> Ty
liftTy b = case mbMatch Tag b of
BBase i -> Base (mbInt i)
BArrow ty1 ty2 -> Arrow (liftTy ty1) (liftTy ty2)
-- now, the actual parser! | 188 | liftTy b = case mbMatch Tag b of
BBase i -> Base (mbInt i)
BArrow ty1 ty2 -> Arrow (liftTy ty1) (liftTy ty2)
-- now, the actual parser! | 162 | false | true | 0 | 10 | 61 | 79 | 37 | 42 | null | null |
AlexeyRaga/eta | compiler/ETA/CodeGen/Expr.hs | bsd-3-clause | cgConApp :: DataCon -> [StgArg] -> CodeGen ()
cgConApp con args
| isUnboxedTupleCon con = do
repCodes <- getNonVoidArgRepCodes args
emitReturn $ map mkRepLocDirect repCodes
| otherwise = do
-- TODO: Is dataConWorkId the right thing to pass?
(idInfo, genInitCode) <- buildDynCon (dataConWorkId... | 429 | cgConApp :: DataCon -> [StgArg] -> CodeGen ()
cgConApp con args
| isUnboxedTupleCon con = do
repCodes <- getNonVoidArgRepCodes args
emitReturn $ map mkRepLocDirect repCodes
| otherwise = do
-- TODO: Is dataConWorkId the right thing to pass?
(idInfo, genInitCode) <- buildDynCon (dataConWorkId... | 429 | cgConApp con args
| isUnboxedTupleCon con = do
repCodes <- getNonVoidArgRepCodes args
emitReturn $ map mkRepLocDirect repCodes
| otherwise = do
-- TODO: Is dataConWorkId the right thing to pass?
(idInfo, genInitCode) <- buildDynCon (dataConWorkId con) con args []
(initCode, _) <- genIn... | 383 | false | true | 0 | 12 | 101 | 142 | 64 | 78 | null | null |
vlastachu/milan | old/milan.hs | mit | pExpr :: GenParser Char st Expr
pExpr = try (Binary <$> pExpr2 <*> pBinary <*> pExpr) --FIXME ready parsec operator parser
<|> pExpr2
<?> "expression" | 162 | pExpr :: GenParser Char st Expr
pExpr = try (Binary <$> pExpr2 <*> pBinary <*> pExpr) --FIXME ready parsec operator parser
<|> pExpr2
<?> "expression" | 162 | pExpr = try (Binary <$> pExpr2 <*> pBinary <*> pExpr) --FIXME ready parsec operator parser
<|> pExpr2
<?> "expression" | 130 | false | true | 5 | 8 | 36 | 55 | 26 | 29 | null | null |
asi1024/haling | test/ParserSpec.hs | mit | spec :: Spec
spec = do
describe "Parser" $ do
it "should return Val 1 with 1" $ do
parseStmt "1" `shouldBe` (Right $ Exp $ Val 1)
it "should return wrapped primitive operator" $ do
opExpr "+" `shouldBe` Fun "@x" (Fun "@y" $ Prim "+" (Var "@x") (Var "@y"))
opExpr "&=" `shouldBe` Fun "@x" (F... | 5,210 | spec :: Spec
spec = do
describe "Parser" $ do
it "should return Val 1 with 1" $ do
parseStmt "1" `shouldBe` (Right $ Exp $ Val 1)
it "should return wrapped primitive operator" $ do
opExpr "+" `shouldBe` Fun "@x" (Fun "@y" $ Prim "+" (Var "@x") (Var "@y"))
opExpr "&=" `shouldBe` Fun "@x" (F... | 5,210 | spec = do
describe "Parser" $ do
it "should return Val 1 with 1" $ do
parseStmt "1" `shouldBe` (Right $ Exp $ Val 1)
it "should return wrapped primitive operator" $ do
opExpr "+" `shouldBe` Fun "@x" (Fun "@y" $ Prim "+" (Var "@x") (Var "@y"))
opExpr "&=" `shouldBe` Fun "@x" (Fun "@y" $ App... | 5,197 | false | true | 0 | 26 | 1,702 | 2,304 | 1,139 | 1,165 | null | null |
futtetennista/IntroductionToFunctionalProgramming | PiH/src/Exercises.hs | mit | takeBTree' 0 _ =
Nil | 22 | takeBTree' 0 _ =
Nil | 22 | takeBTree' 0 _ =
Nil | 22 | false | false | 0 | 5 | 6 | 11 | 5 | 6 | null | null |
ozgurakgun/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | replSettings :: Maybe FilePath -> Settings Idris
replSettings hFile = setComplete replCompletion $ defaultSettings {
historyFile = hFile
} | 182 | replSettings :: Maybe FilePath -> Settings Idris
replSettings hFile = setComplete replCompletion $ defaultSettings {
historyFile = hFile
} | 182 | replSettings hFile = setComplete replCompletion $ defaultSettings {
historyFile = hFile
} | 133 | false | true | 0 | 7 | 62 | 39 | 19 | 20 | null | null |
DavidAlphaFox/ghc | libraries/bytestring/tests/QuickCheckUtils.hs | bsd-3-clause | eqnotnull3 f g = \x y z -> (not (isNull z)) ==> eq3 f g x y z | 61 | eqnotnull3 f g = \x y z -> (not (isNull z)) ==> eq3 f g x y z | 61 | eqnotnull3 f g = \x y z -> (not (isNull z)) ==> eq3 f g x y z | 61 | false | false | 1 | 10 | 17 | 51 | 23 | 28 | null | null |
ekmett/fixed-precision | Numeric/Fixed.hs | bsd-3-clause | retagSucc :: Tagged n a -> Tagged (PrecSucc n) a
retagSucc = retag | 66 | retagSucc :: Tagged n a -> Tagged (PrecSucc n) a
retagSucc = retag | 66 | retagSucc = retag | 17 | false | true | 0 | 9 | 12 | 37 | 16 | 21 | null | null |
jonathankochems/hi | src/Hi.hs | bsd-3-clause | dropExtraRegularFiles xs = go (map getFilePath xs) xs
where
go _ [] = []
go paths (y@(RegularFile p _):ys) = if p `elem` (paths \\ [p])
then go paths ys
else y : go paths ys
go paths (y@(TemplateFile _ _):ys) = y ... | 569 | dropExtraRegularFiles xs = go (map getFilePath xs) xs
where
go _ [] = []
go paths (y@(RegularFile p _):ys) = if p `elem` (paths \\ [p])
then go paths ys
else y : go paths ys
go paths (y@(TemplateFile _ _):ys) = y ... | 569 | dropExtraRegularFiles xs = go (map getFilePath xs) xs
where
go _ [] = []
go paths (y@(RegularFile p _):ys) = if p `elem` (paths \\ [p])
then go paths ys
else y : go paths ys
go paths (y@(TemplateFile _ _):ys) = y ... | 569 | false | false | 1 | 9 | 183 | 153 | 78 | 75 | null | null |
capitanbatata/sandbox | free-monads/src/Toy.hs | gpl-3.0 | -- End of execution.
-- | Let's write an interpreter for this language. We simply convert this to a String.
interpret :: Show a => Fix (Toy a) -> String
-- | Try some examples in the REPL:
--
-- > ghci> :t Output 'a' Done
-- > Output 'a' Done :: Toy Char (Toy b next)
--
-- > ghci> :t Bell (Output 'a' Done)
-- > Bell... | 508 | interpret :: Show a => Fix (Toy a) -> String
-- | Try some examples in the REPL:
--
-- > ghci> :t Output 'a' Done
-- > Output 'a' Done :: Toy Char (Toy b next)
--
-- > ghci> :t Bell (Output 'a' Done)
-- > Bell (Output 'a' Done) :: Toy b (Toy Char (Toy b1 next))
--
-- So it seems the types are getting more complex. We ... | 398 | interpret :: Show a => Fix (Toy a) -> String
-- | Try some examples in the REPL:
--
-- > ghci> :t Output 'a' Done
-- > Output 'a' Done :: Toy Char (Toy b next)
--
-- > ghci> :t Bell (Output 'a' Done)
-- > Bell (Output 'a' Done) :: Toy b (Toy Char (Toy b1 next))
--
-- So it seems the types are getting more complex. We ... | 398 | true | false | 0 | 10 | 114 | 69 | 37 | 32 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.