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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wavewave/cvmaker | src/ContentBuild.hs | gpl-3.0 | makeEducations :: STGroup String -> [EducationContent] -> String
makeEducations templates = concatMap (makeEducation templates) | 127 | makeEducations :: STGroup String -> [EducationContent] -> String
makeEducations templates = concatMap (makeEducation templates) | 127 | makeEducations templates = concatMap (makeEducation templates) | 62 | false | true | 0 | 8 | 13 | 42 | 19 | 23 | null | null |
pooster/phdtracker | Main.hs | bsd-3-clause | main = do
(command:args) <- getArgs
let (Just action) = lookup command dispatch
action | 92 | main = do
(command:args) <- getArgs
let (Just action) = lookup command dispatch
action | 92 | main = do
(command:args) <- getArgs
let (Just action) = lookup command dispatch
action | 92 | false | false | 1 | 11 | 19 | 48 | 20 | 28 | null | null |
Ian-Stewart-Binks/courseography | dependencies/HaXml-1.25.3/src/Text/XML/HaXml/DtdToHaskell/TypeDef.hs | gpl-3.0 | ppST Any = text "ANYContent" | 36 | ppST Any = text "ANYContent" | 36 | ppST Any = text "ANYContent" | 36 | false | false | 0 | 5 | 12 | 12 | 5 | 7 | null | null |
roberth/uu-helium | test/benchmarks/Parser.hs | gpl-3.0 | -- ==========================================================--
--
leFail l n m
= faiL ("Lexical error, line " ++ show l ++ ", col " ++ show n ++
":\n " ++ m ) | 174 | leFail l n m
= faiL ("Lexical error, line " ++ show l ++ ", col " ++ show n ++
":\n " ++ m ) | 107 | leFail l n m
= faiL ("Lexical error, line " ++ show l ++ ", col " ++ show n ++
":\n " ++ m ) | 107 | true | false | 1 | 12 | 43 | 53 | 23 | 30 | null | null |
spacekitteh/smcghc | compiler/cmm/CLabel.hs | bsd-3-clause | pprDynamicLinkerAsmLabel :: Platform -> DynamicLinkerLabelInfo -> CLabel -> SDoc
pprDynamicLinkerAsmLabel platform dllInfo lbl
= if platformOS platform == OSDarwin
then if platformArch platform == ArchX86_64
then case dllInfo of
CodeStub -> char 'L' <> ppr lbl <> text "$stub"
SymbolPtr -> char 'L' <> ppr lbl <> text "$non_lazy_ptr"
GotSymbolPtr -> ppr lbl <> text "@GOTPCREL"
GotSymbolOffset -> ppr lbl
else case dllInfo of
CodeStub -> char 'L' <> ppr lbl <> text "$stub"
SymbolPtr -> char 'L' <> ppr lbl <> text "$non_lazy_ptr"
_ -> panic "pprDynamicLinkerAsmLabel"
else if osElfTarget (platformOS platform)
then if platformArch platform == ArchPPC
then case dllInfo of
CodeStub -> ppr lbl <> text "@plt"
SymbolPtr -> text ".LC_" <> ppr lbl
_ -> panic "pprDynamicLinkerAsmLabel"
else if platformArch platform == ArchX86_64
then case dllInfo of
CodeStub -> ppr lbl <> text "@plt"
GotSymbolPtr -> ppr lbl <> text "@gotpcrel"
GotSymbolOffset -> ppr lbl
SymbolPtr -> text ".LC_" <> ppr lbl
else case dllInfo of
CodeStub -> ppr lbl <> text "@plt"
SymbolPtr -> text ".LC_" <> ppr lbl
GotSymbolPtr -> ppr lbl <> text "@got"
GotSymbolOffset -> ppr lbl <> text "@gotoff"
else if platformOS platform == OSMinGW32
then case dllInfo of
SymbolPtr -> text "__imp_" <> ppr lbl
_ -> panic "pprDynamicLinkerAsmLabel"
else panic "pprDynamicLinkerAsmLabel" | 1,827 | pprDynamicLinkerAsmLabel :: Platform -> DynamicLinkerLabelInfo -> CLabel -> SDoc
pprDynamicLinkerAsmLabel platform dllInfo lbl
= if platformOS platform == OSDarwin
then if platformArch platform == ArchX86_64
then case dllInfo of
CodeStub -> char 'L' <> ppr lbl <> text "$stub"
SymbolPtr -> char 'L' <> ppr lbl <> text "$non_lazy_ptr"
GotSymbolPtr -> ppr lbl <> text "@GOTPCREL"
GotSymbolOffset -> ppr lbl
else case dllInfo of
CodeStub -> char 'L' <> ppr lbl <> text "$stub"
SymbolPtr -> char 'L' <> ppr lbl <> text "$non_lazy_ptr"
_ -> panic "pprDynamicLinkerAsmLabel"
else if osElfTarget (platformOS platform)
then if platformArch platform == ArchPPC
then case dllInfo of
CodeStub -> ppr lbl <> text "@plt"
SymbolPtr -> text ".LC_" <> ppr lbl
_ -> panic "pprDynamicLinkerAsmLabel"
else if platformArch platform == ArchX86_64
then case dllInfo of
CodeStub -> ppr lbl <> text "@plt"
GotSymbolPtr -> ppr lbl <> text "@gotpcrel"
GotSymbolOffset -> ppr lbl
SymbolPtr -> text ".LC_" <> ppr lbl
else case dllInfo of
CodeStub -> ppr lbl <> text "@plt"
SymbolPtr -> text ".LC_" <> ppr lbl
GotSymbolPtr -> ppr lbl <> text "@got"
GotSymbolOffset -> ppr lbl <> text "@gotoff"
else if platformOS platform == OSMinGW32
then case dllInfo of
SymbolPtr -> text "__imp_" <> ppr lbl
_ -> panic "pprDynamicLinkerAsmLabel"
else panic "pprDynamicLinkerAsmLabel" | 1,827 | pprDynamicLinkerAsmLabel platform dllInfo lbl
= if platformOS platform == OSDarwin
then if platformArch platform == ArchX86_64
then case dllInfo of
CodeStub -> char 'L' <> ppr lbl <> text "$stub"
SymbolPtr -> char 'L' <> ppr lbl <> text "$non_lazy_ptr"
GotSymbolPtr -> ppr lbl <> text "@GOTPCREL"
GotSymbolOffset -> ppr lbl
else case dllInfo of
CodeStub -> char 'L' <> ppr lbl <> text "$stub"
SymbolPtr -> char 'L' <> ppr lbl <> text "$non_lazy_ptr"
_ -> panic "pprDynamicLinkerAsmLabel"
else if osElfTarget (platformOS platform)
then if platformArch platform == ArchPPC
then case dllInfo of
CodeStub -> ppr lbl <> text "@plt"
SymbolPtr -> text ".LC_" <> ppr lbl
_ -> panic "pprDynamicLinkerAsmLabel"
else if platformArch platform == ArchX86_64
then case dllInfo of
CodeStub -> ppr lbl <> text "@plt"
GotSymbolPtr -> ppr lbl <> text "@gotpcrel"
GotSymbolOffset -> ppr lbl
SymbolPtr -> text ".LC_" <> ppr lbl
else case dllInfo of
CodeStub -> ppr lbl <> text "@plt"
SymbolPtr -> text ".LC_" <> ppr lbl
GotSymbolPtr -> ppr lbl <> text "@got"
GotSymbolOffset -> ppr lbl <> text "@gotoff"
else if platformOS platform == OSMinGW32
then case dllInfo of
SymbolPtr -> text "__imp_" <> ppr lbl
_ -> panic "pprDynamicLinkerAsmLabel"
else panic "pprDynamicLinkerAsmLabel" | 1,746 | false | true | 0 | 13 | 698 | 462 | 214 | 248 | null | null |
rpglover64/lens | src/Control/Lens/Setter.hs | bsd-3-clause | -- | This 'setter' can be used to modify all of the values in a 'Monad'.
--
-- You sometimes have to use this rather than 'mapped' -- due to
-- temporary insanity 'Functor' is not a superclass of 'Monad'.
--
-- @
-- 'liftM' ≡ 'over' 'lifted'
-- @
--
-- >>> over lifted f [a,b,c]
-- [f a,f b,f c]
--
-- >>> set lifted b (Just a)
-- Just b
--
-- If you want an 'IndexPreservingSetter' use @'setting' 'liftM'@.
lifted :: Monad m => Setter (m a) (m b) a b
lifted = sets liftM | 471 | lifted :: Monad m => Setter (m a) (m b) a b
lifted = sets liftM | 63 | lifted = sets liftM | 19 | true | true | 0 | 9 | 98 | 64 | 37 | 27 | null | null |
luqui/tigress | Solver.hs | bsd-3-clause | instantiate :: forall a c. (FreeVars a, Subst c a) => a -> Solver c a
instantiate x = do
sub <- Map.fromList <$> mapM (\v -> (v,) . Var <$> alloc) (Set.toList (freeVars x))
return $ subst (sub :: Substitution c) x | 221 | instantiate :: forall a c. (FreeVars a, Subst c a) => a -> Solver c a
instantiate x = do
sub <- Map.fromList <$> mapM (\v -> (v,) . Var <$> alloc) (Set.toList (freeVars x))
return $ subst (sub :: Substitution c) x | 221 | instantiate x = do
sub <- Map.fromList <$> mapM (\v -> (v,) . Var <$> alloc) (Set.toList (freeVars x))
return $ subst (sub :: Substitution c) x | 151 | false | true | 0 | 15 | 50 | 124 | 62 | 62 | null | null |
urbanslug/wai | warp/Network/Wai/Handler/Warp/HTTP2/Sender.hs | mit | runStreamFile _ buf room path part = do
let start = filePartOffset part
bytes = filePartByteCount part
-- fixme: how to close Handle? GC does it at this moment.
h <- IO.openBinaryFile path IO.ReadMode
IO.hSeek h IO.AbsoluteSeek start
fillBufFile buf room h start bytes (return ()) | 308 | runStreamFile _ buf room path part = do
let start = filePartOffset part
bytes = filePartByteCount part
-- fixme: how to close Handle? GC does it at this moment.
h <- IO.openBinaryFile path IO.ReadMode
IO.hSeek h IO.AbsoluteSeek start
fillBufFile buf room h start bytes (return ()) | 308 | runStreamFile _ buf room path part = do
let start = filePartOffset part
bytes = filePartByteCount part
-- fixme: how to close Handle? GC does it at this moment.
h <- IO.openBinaryFile path IO.ReadMode
IO.hSeek h IO.AbsoluteSeek start
fillBufFile buf room h start bytes (return ()) | 308 | false | false | 1 | 11 | 73 | 87 | 39 | 48 | null | null |
joachifm/pwcrypt | src/Crypto.hs | mit | ------------------------------------------------------------------------
-- Internals
sha256 :: SB.ByteString -> SB.ByteString
sha256 = SHA256.hash | 148 | sha256 :: SB.ByteString -> SB.ByteString
sha256 = SHA256.hash | 61 | sha256 = SHA256.hash | 20 | true | true | 0 | 8 | 11 | 30 | 14 | 16 | null | null |
paulbarbu/ePseudocode | src/Main.hs | bsd-3-clause | runRepl :: IO ()
runRepl = do
stdLibEnv <- runExceptT $ getStdLibEnv ".stdlib.epc"
case stdLibEnv of
Left err -> putStrLn $ "Error: " ++ err
Right stdlib -> runInputT defaultSettings $ loop (stdlib ++ builtinEnv) | 236 | runRepl :: IO ()
runRepl = do
stdLibEnv <- runExceptT $ getStdLibEnv ".stdlib.epc"
case stdLibEnv of
Left err -> putStrLn $ "Error: " ++ err
Right stdlib -> runInputT defaultSettings $ loop (stdlib ++ builtinEnv) | 236 | runRepl = do
stdLibEnv <- runExceptT $ getStdLibEnv ".stdlib.epc"
case stdLibEnv of
Left err -> putStrLn $ "Error: " ++ err
Right stdlib -> runInputT defaultSettings $ loop (stdlib ++ builtinEnv) | 219 | false | true | 0 | 13 | 58 | 80 | 37 | 43 | null | null |
Gabriel439/suns-cmd | Executable.hs | bsd-3-clause | parserInfo :: ParserInfo Options
parserInfo = info (helper <*> options) $ mconcat
[ fullDesc
, header "suns-cmd: The Suns search command line client"
, progDesc "Send search requests and store results as PDB files"
, footer "Report bugs to suns-search@googlegroups.com"
] | 291 | parserInfo :: ParserInfo Options
parserInfo = info (helper <*> options) $ mconcat
[ fullDesc
, header "suns-cmd: The Suns search command line client"
, progDesc "Send search requests and store results as PDB files"
, footer "Report bugs to suns-search@googlegroups.com"
] | 291 | parserInfo = info (helper <*> options) $ mconcat
[ fullDesc
, header "suns-cmd: The Suns search command line client"
, progDesc "Send search requests and store results as PDB files"
, footer "Report bugs to suns-search@googlegroups.com"
] | 258 | false | true | 0 | 8 | 60 | 52 | 26 | 26 | null | null |
mrehayden1/lji | src/LJI/Music/Notation.hs | bsd-3-clause | gff = FlatFlat G | 16 | gff = FlatFlat G | 16 | gff = FlatFlat G | 16 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
mtak/chess-hs | src/Game.hs | mit | newGame :: Game
newGame = Game
{ chess = newChess
, selectedSq = Nothing
} | 80 | newGame :: Game
newGame = Game
{ chess = newChess
, selectedSq = Nothing
} | 80 | newGame = Game
{ chess = newChess
, selectedSq = Nothing
} | 64 | false | true | 0 | 7 | 20 | 29 | 16 | 13 | null | null |
facebookincubator/duckling | Duckling/Time/PT/Rules.hs | bsd-3-clause | ruleNextTime :: Rule
ruleNextTime = Rule
{ name = "next <time>"
, pattern =
[ regex "(d[ao]) pr(ó|o)xim[ao]s?|que vem"
, Predicate isNotLatent
]
, prod = \tokens -> case tokens of
(_:Token Time td:_) ->
tt $ predNth 0 True td
_ -> Nothing
} | 280 | ruleNextTime :: Rule
ruleNextTime = Rule
{ name = "next <time>"
, pattern =
[ regex "(d[ao]) pr(ó|o)xim[ao]s?|que vem"
, Predicate isNotLatent
]
, prod = \tokens -> case tokens of
(_:Token Time td:_) ->
tt $ predNth 0 True td
_ -> Nothing
} | 280 | ruleNextTime = Rule
{ name = "next <time>"
, pattern =
[ regex "(d[ao]) pr(ó|o)xim[ao]s?|que vem"
, Predicate isNotLatent
]
, prod = \tokens -> case tokens of
(_:Token Time td:_) ->
tt $ predNth 0 True td
_ -> Nothing
} | 259 | false | true | 0 | 15 | 84 | 101 | 51 | 50 | null | null |
sampou-org/pfad | Code/Code10.hs | bsd-3-clause | nub1 :: Ord a => [a] -> [a]
nub1 = hub1 [] | 42 | nub1 :: Ord a => [a] -> [a]
nub1 = hub1 [] | 42 | nub1 = hub1 [] | 14 | false | true | 0 | 9 | 11 | 39 | 18 | 21 | null | null |
ezyang/ghc | compiler/nativeGen/Dwarf/Types.hs | bsd-3-clause | sectionOffset :: SDoc -> SDoc -> SDoc
sectionOffset target section = sdocWithPlatform $ \plat ->
case platformOS plat of
OSDarwin -> pprDwWord (target <> char '-' <> section)
OSMinGW32 -> text "\t.secrel32 " <> target
_other -> pprDwWord target | 262 | sectionOffset :: SDoc -> SDoc -> SDoc
sectionOffset target section = sdocWithPlatform $ \plat ->
case platformOS plat of
OSDarwin -> pprDwWord (target <> char '-' <> section)
OSMinGW32 -> text "\t.secrel32 " <> target
_other -> pprDwWord target | 262 | sectionOffset target section = sdocWithPlatform $ \plat ->
case platformOS plat of
OSDarwin -> pprDwWord (target <> char '-' <> section)
OSMinGW32 -> text "\t.secrel32 " <> target
_other -> pprDwWord target | 224 | false | true | 3 | 9 | 56 | 87 | 41 | 46 | null | null |
martijnbastiaan/sprockell | src/DemoRandomOrder.hs | mit | prog :: [Instruction]
prog = [
Const (ord 'A') RegA
, Const (ord 'a' - ord 'A') RegE
, Compute Add RegA SPID RegB -- sprockell id as ascii character (uppercase)
, Compute Add RegB RegE RegC -- (lowercase)
, Const loopCount RegD
, Const 1 RegE
, Write RegB stdio -- write uppercase letter
, Write RegC stdio -- write lowercase letter
, Compute Sub RegD RegE RegD
, Branch RegD (Rel (-3))
--, Read (Addr 0x0) -- dummy read to ensure that
--, Receive RegA -- all write request are done
, EndProg
] | 629 | prog :: [Instruction]
prog = [
Const (ord 'A') RegA
, Const (ord 'a' - ord 'A') RegE
, Compute Add RegA SPID RegB -- sprockell id as ascii character (uppercase)
, Compute Add RegB RegE RegC -- (lowercase)
, Const loopCount RegD
, Const 1 RegE
, Write RegB stdio -- write uppercase letter
, Write RegC stdio -- write lowercase letter
, Compute Sub RegD RegE RegD
, Branch RegD (Rel (-3))
--, Read (Addr 0x0) -- dummy read to ensure that
--, Receive RegA -- all write request are done
, EndProg
] | 629 | prog = [
Const (ord 'A') RegA
, Const (ord 'a' - ord 'A') RegE
, Compute Add RegA SPID RegB -- sprockell id as ascii character (uppercase)
, Compute Add RegB RegE RegC -- (lowercase)
, Const loopCount RegD
, Const 1 RegE
, Write RegB stdio -- write uppercase letter
, Write RegC stdio -- write lowercase letter
, Compute Sub RegD RegE RegD
, Branch RegD (Rel (-3))
--, Read (Addr 0x0) -- dummy read to ensure that
--, Receive RegA -- all write request are done
, EndProg
] | 607 | false | true | 0 | 10 | 230 | 145 | 77 | 68 | null | null |
bruno-cadorette/AdventOfCode | Day 18/Day18.hs | mit | main = do
board <- initBoard 99 99 <$> readFile "inputDay18.txt"
print $ countLights 100 $ stuckCorners board | 117 | main = do
board <- initBoard 99 99 <$> readFile "inputDay18.txt"
print $ countLights 100 $ stuckCorners board | 117 | main = do
board <- initBoard 99 99 <$> readFile "inputDay18.txt"
print $ countLights 100 $ stuckCorners board | 117 | false | false | 0 | 9 | 25 | 42 | 18 | 24 | null | null |
Gabriel439/fficxx | lib/FFICXX/Generate/Type/Class.hs | bsd-2-clause | argToString (SelfType, varname) = "Type ## _p " ++ varname | 58 | argToString (SelfType, varname) = "Type ## _p " ++ varname | 58 | argToString (SelfType, varname) = "Type ## _p " ++ varname | 58 | false | false | 0 | 6 | 9 | 19 | 10 | 9 | null | null |
jmitchell/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v (LSGe (ATInt ITNative)) [l, r] = v ++ "INTOP(>=," ++ creg l ++ ", " ++ creg r ++ ")" | 91 | doOp v (LSGe (ATInt ITNative)) [l, r] = v ++ "INTOP(>=," ++ creg l ++ ", " ++ creg r ++ ")" | 91 | doOp v (LSGe (ATInt ITNative)) [l, r] = v ++ "INTOP(>=," ++ creg l ++ ", " ++ creg r ++ ")" | 91 | false | false | 0 | 9 | 21 | 57 | 28 | 29 | null | null |
DaMSL/K3 | src/Language/K3/Interpreter/Data/Accessors.hs | apache-2.0 | valueOfEntryOptIO :: Maybe (IEnvEntry Value) -> IO (Maybe Value)
valueOfEntryOptIO (Just e) = valueOfEntryIO e >>= return . Just | 128 | valueOfEntryOptIO :: Maybe (IEnvEntry Value) -> IO (Maybe Value)
valueOfEntryOptIO (Just e) = valueOfEntryIO e >>= return . Just | 128 | valueOfEntryOptIO (Just e) = valueOfEntryIO e >>= return . Just | 63 | false | true | 0 | 8 | 18 | 53 | 25 | 28 | null | null |
ixmatus/prizm | src/Data/Prizm/Color/CIE/Matrices/RGB.hs | bsd-3-clause | -- TODO: this should probably be a vector of triples.
d65SRGB :: RGBtoXYZ
d65SRGB = Matrix [
[0.4124564, 0.3575761, 0.1804375],
[0.2126729, 0.7151522, 0.0721750],
[0.0193339, 0.1191920, 0.9503041]] | 203 | d65SRGB :: RGBtoXYZ
d65SRGB = Matrix [
[0.4124564, 0.3575761, 0.1804375],
[0.2126729, 0.7151522, 0.0721750],
[0.0193339, 0.1191920, 0.9503041]] | 149 | d65SRGB = Matrix [
[0.4124564, 0.3575761, 0.1804375],
[0.2126729, 0.7151522, 0.0721750],
[0.0193339, 0.1191920, 0.9503041]] | 129 | true | true | 0 | 7 | 31 | 51 | 32 | 19 | null | null |
text-utf8/text | tests/Tests/Properties.hs | bsd-2-clause | t_isInfixOf s = L.isInfixOf s `eqP` T.isInfixOf (packS s) | 61 | t_isInfixOf s = L.isInfixOf s `eqP` T.isInfixOf (packS s) | 61 | t_isInfixOf s = L.isInfixOf s `eqP` T.isInfixOf (packS s) | 61 | false | false | 0 | 8 | 12 | 31 | 15 | 16 | null | null |
ChShersh/rogue-lang | src/Rogue/LLVM/Codegen.hs | bsd-3-clause | igeq :: Operand -> Operand -> Codegen Operand
igeq = icmp IP.SGE | 64 | igeq :: Operand -> Operand -> Codegen Operand
igeq = icmp IP.SGE | 64 | igeq = icmp IP.SGE | 18 | false | true | 0 | 8 | 11 | 33 | 14 | 19 | null | null |
ezyang/ghc | compiler/coreSyn/PprCore.hs | bsd-3-clause | pprParendExpr :: OutputableBndr b => Expr b -> SDoc
pprCoreBindings = pprTopBinds noAnn | 91 | pprParendExpr :: OutputableBndr b => Expr b -> SDoc
pprCoreBindings = pprTopBinds noAnn | 90 | pprCoreBindings = pprTopBinds noAnn | 35 | false | true | 0 | 7 | 16 | 28 | 13 | 15 | null | null |
andorp/bead | src/Bead/View/DataBridge.hs | bsd-3-clause | newPasswordAgainPrm :: Parameter String
newPasswordAgainPrm = validateBy isPassword $ passwordPrm (fieldName newPasswordAgainField) "New password (again)" | 154 | newPasswordAgainPrm :: Parameter String
newPasswordAgainPrm = validateBy isPassword $ passwordPrm (fieldName newPasswordAgainField) "New password (again)" | 154 | newPasswordAgainPrm = validateBy isPassword $ passwordPrm (fieldName newPasswordAgainField) "New password (again)" | 114 | false | true | 0 | 8 | 14 | 32 | 15 | 17 | null | null |
haskell-infra/hackage-server | Distribution/Server/Packages/Unpack.hs | bsd-3-clause | explainTarError :: CombinedTarErrs -> String
explainTarError (TarBombError filename expectedDir) =
"Bad file name in package tarball: " ++ quote filename
++ "\nAll the file in the package tarball must be in the subdirectory "
++ quote expectedDir ++ "." | 259 | explainTarError :: CombinedTarErrs -> String
explainTarError (TarBombError filename expectedDir) =
"Bad file name in package tarball: " ++ quote filename
++ "\nAll the file in the package tarball must be in the subdirectory "
++ quote expectedDir ++ "." | 259 | explainTarError (TarBombError filename expectedDir) =
"Bad file name in package tarball: " ++ quote filename
++ "\nAll the file in the package tarball must be in the subdirectory "
++ quote expectedDir ++ "." | 214 | false | true | 4 | 7 | 44 | 51 | 23 | 28 | null | null |
fmapfmapfmap/amazonka | amazonka-s3/test/Test/AWS/Gen/S3.hs | mpl-2.0 | testHeadObjectResponse :: HeadObjectResponse -> TestTree
testHeadObjectResponse = res
"HeadObjectResponse"
"fixture/HeadObjectResponse.proto"
s3
(Proxy :: Proxy HeadObject) | 188 | testHeadObjectResponse :: HeadObjectResponse -> TestTree
testHeadObjectResponse = res
"HeadObjectResponse"
"fixture/HeadObjectResponse.proto"
s3
(Proxy :: Proxy HeadObject) | 188 | testHeadObjectResponse = res
"HeadObjectResponse"
"fixture/HeadObjectResponse.proto"
s3
(Proxy :: Proxy HeadObject) | 131 | false | true | 0 | 6 | 30 | 36 | 17 | 19 | null | null |
tidalcycles/Tidal | src/Sound/Tidal/Control.hs | gpl-3.0 | _stutWith :: (Num n, Ord n) => n -> Time -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
_stutWith count steptime f p | count <= 1 = p
| otherwise = overlay (f (steptime `rotR` _stutWith (count-1) steptime f p)) p | 248 | _stutWith :: (Num n, Ord n) => n -> Time -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
_stutWith count steptime f p | count <= 1 = p
| otherwise = overlay (f (steptime `rotR` _stutWith (count-1) steptime f p)) p | 248 | _stutWith count steptime f p | count <= 1 = p
| otherwise = overlay (f (steptime `rotR` _stutWith (count-1) steptime f p)) p | 153 | false | true | 0 | 13 | 74 | 125 | 61 | 64 | null | null |
misterbeebee/calisson-hs | src/Hexagrid/Grid.hs | bsd-3-clause | -- hacky int representation of Position
posToInt (Position (r,c)) =
let sr = signum r in
let sc = signum c in
-- extra multiplication by signum makes 0 go to 0 sign bit
let i = (shiftL (abs r) 16) + (shiftL (abs c) 2) + (sr*sr*(1 - sr)) + (shiftR (sc*sc*(1 - sc)) 1) in
trace ("posToInt " ++ show (r,c) ++ " -> " ++ show i)
i | 350 | posToInt (Position (r,c)) =
let sr = signum r in
let sc = signum c in
-- extra multiplication by signum makes 0 go to 0 sign bit
let i = (shiftL (abs r) 16) + (shiftL (abs c) 2) + (sr*sr*(1 - sr)) + (shiftR (sc*sc*(1 - sc)) 1) in
trace ("posToInt " ++ show (r,c) ++ " -> " ++ show i)
i | 310 | posToInt (Position (r,c)) =
let sr = signum r in
let sc = signum c in
-- extra multiplication by signum makes 0 go to 0 sign bit
let i = (shiftL (abs r) 16) + (shiftL (abs c) 2) + (sr*sr*(1 - sr)) + (shiftR (sc*sc*(1 - sc)) 1) in
trace ("posToInt " ++ show (r,c) ++ " -> " ++ show i)
i | 310 | true | false | 0 | 19 | 95 | 179 | 90 | 89 | null | null |
plow-technologies/persistent | persistent/Database/Persist/Sql/Orphan/PersistUnique.hs | mit | dummyFromUnique :: Unique v -> Maybe v
dummyFromUnique _ = Nothing | 66 | dummyFromUnique :: Unique v -> Maybe v
dummyFromUnique _ = Nothing | 66 | dummyFromUnique _ = Nothing | 27 | false | true | 0 | 7 | 10 | 29 | 12 | 17 | null | null |
nbrunt/JSHOP | src/old/ver0/posix_prototype.hs | mit | something = wBoundary++space++"\\$"++space++wBoundary | 53 | something = wBoundary++space++"\\$"++space++wBoundary | 53 | something = wBoundary++space++"\\$"++space++wBoundary | 53 | false | false | 5 | 6 | 2 | 30 | 11 | 19 | null | null |
nfjinjing/luka | vendor/libffi-0.1/Foreign/LibFFI/Types.hs | bsd-3-clause | retCString :: RetType CString
retCString = retPtr retCChar | 76 | retCString :: RetType CString
retCString = retPtr retCChar | 76 | retCString = retPtr retCChar | 37 | false | true | 1 | 5 | 25 | 21 | 8 | 13 | null | null |
dasuxullebt/inflate.hs | inflate.recSlowdown.hs | gpl-3.0 | lsbToInt :: [Bool] -> Int
lsbToInt bits = foldr (\ b acc -> acc * 2 + if b then 1 else 0) 0 bits | 96 | lsbToInt :: [Bool] -> Int
lsbToInt bits = foldr (\ b acc -> acc * 2 + if b then 1 else 0) 0 bits | 96 | lsbToInt bits = foldr (\ b acc -> acc * 2 + if b then 1 else 0) 0 bits | 70 | false | true | 0 | 9 | 24 | 54 | 29 | 25 | null | null |
facebookincubator/duckling | Duckling/Time/ES/Rules.hs | bsd-3-clause | ruleTimeofdayLatent :: Rule
ruleTimeofdayLatent = Rule
{ name = "time-of-day (latent)"
, pattern =
[ Predicate $ isIntegerBetween 0 23
]
, prod = \tokens -> case tokens of
(token:_) -> do
v <- getIntValue token
tt . mkLatent $ hour (v < 13) v
_ -> Nothing
} | 301 | ruleTimeofdayLatent :: Rule
ruleTimeofdayLatent = Rule
{ name = "time-of-day (latent)"
, pattern =
[ Predicate $ isIntegerBetween 0 23
]
, prod = \tokens -> case tokens of
(token:_) -> do
v <- getIntValue token
tt . mkLatent $ hour (v < 13) v
_ -> Nothing
} | 301 | ruleTimeofdayLatent = Rule
{ name = "time-of-day (latent)"
, pattern =
[ Predicate $ isIntegerBetween 0 23
]
, prod = \tokens -> case tokens of
(token:_) -> do
v <- getIntValue token
tt . mkLatent $ hour (v < 13) v
_ -> Nothing
} | 273 | false | true | 0 | 17 | 92 | 108 | 56 | 52 | null | null |
steveshogren/haskell-katas | src/PokerHands.hs | bsd-3-clause | parseFace 'K' = Just King | 25 | parseFace 'K' = Just King | 25 | parseFace 'K' = Just King | 25 | false | false | 0 | 5 | 4 | 13 | 5 | 8 | null | null |
pparkkin/eta | compiler/ETA/BasicTypes/Lexeme.hs | bsd-3-clause | -- Infix Ids
startsConSym c = c == ':' | 38 | startsConSym c = c == ':' | 25 | startsConSym c = c == ':' | 25 | true | false | 1 | 5 | 8 | 17 | 7 | 10 | null | null |
gregorias/rummikubsolver | executables/Main.hs | gpl-3.0 | helpOptions :: [String]
helpOptions = ["-h", "--help"] | 54 | helpOptions :: [String]
helpOptions = ["-h", "--help"] | 54 | helpOptions = ["-h", "--help"] | 30 | false | true | 0 | 7 | 6 | 27 | 13 | 14 | null | null |
mrmonday/Idris-dev | src/IRTS/JavaScript/AST.hs | bsd-3-clause | compileJS' indent (JSCond branches) =
T.intercalate " else " $ map createIfBlock branches
where
createIfBlock (JSNoop, e@(JSSeq _)) =
"{\n"
`T.append` compileJS' (indent + 2) e
`T.append` "\n" `T.append` T.replicate indent " " `T.append` "}"
createIfBlock (JSNoop, e) =
"{\n"
`T.append` compileJS' (indent + 2) e
`T.append` ";\n" `T.append` T.replicate indent " " `T.append` "}"
createIfBlock (cond, e@(JSSeq _)) =
"if (" `T.append` compileJS' indent cond `T.append`") {\n"
`T.append` compileJS' (indent + 2) e
`T.append` "\n" `T.append` T.replicate indent " " `T.append` "}"
createIfBlock (cond, e) =
"if (" `T.append` compileJS' indent cond `T.append`") {\n"
`T.append` T.replicate (indent + 2) " "
`T.append` compileJS' (indent + 2) e
`T.append` ";\n"
`T.append` T.replicate indent " "
`T.append` "}" | 925 | compileJS' indent (JSCond branches) =
T.intercalate " else " $ map createIfBlock branches
where
createIfBlock (JSNoop, e@(JSSeq _)) =
"{\n"
`T.append` compileJS' (indent + 2) e
`T.append` "\n" `T.append` T.replicate indent " " `T.append` "}"
createIfBlock (JSNoop, e) =
"{\n"
`T.append` compileJS' (indent + 2) e
`T.append` ";\n" `T.append` T.replicate indent " " `T.append` "}"
createIfBlock (cond, e@(JSSeq _)) =
"if (" `T.append` compileJS' indent cond `T.append`") {\n"
`T.append` compileJS' (indent + 2) e
`T.append` "\n" `T.append` T.replicate indent " " `T.append` "}"
createIfBlock (cond, e) =
"if (" `T.append` compileJS' indent cond `T.append`") {\n"
`T.append` T.replicate (indent + 2) " "
`T.append` compileJS' (indent + 2) e
`T.append` ";\n"
`T.append` T.replicate indent " "
`T.append` "}" | 925 | compileJS' indent (JSCond branches) =
T.intercalate " else " $ map createIfBlock branches
where
createIfBlock (JSNoop, e@(JSSeq _)) =
"{\n"
`T.append` compileJS' (indent + 2) e
`T.append` "\n" `T.append` T.replicate indent " " `T.append` "}"
createIfBlock (JSNoop, e) =
"{\n"
`T.append` compileJS' (indent + 2) e
`T.append` ";\n" `T.append` T.replicate indent " " `T.append` "}"
createIfBlock (cond, e@(JSSeq _)) =
"if (" `T.append` compileJS' indent cond `T.append`") {\n"
`T.append` compileJS' (indent + 2) e
`T.append` "\n" `T.append` T.replicate indent " " `T.append` "}"
createIfBlock (cond, e) =
"if (" `T.append` compileJS' indent cond `T.append`") {\n"
`T.append` T.replicate (indent + 2) " "
`T.append` compileJS' (indent + 2) e
`T.append` ";\n"
`T.append` T.replicate indent " "
`T.append` "}" | 925 | false | false | 0 | 12 | 238 | 376 | 209 | 167 | null | null |
capitanbatata/sandbox | monadic-counter/src/Counter.hs | gpl-3.0 | -- | 'inc c n' increments the counter by 'n' units.
inc :: Counter -> Int -> Counter
inc (MkCounter c) n = MkCounter (c + n) | 124 | inc :: Counter -> Int -> Counter
inc (MkCounter c) n = MkCounter (c + n) | 72 | inc (MkCounter c) n = MkCounter (c + n) | 39 | true | true | 0 | 10 | 26 | 46 | 22 | 24 | null | null |
nh2/quickcheck | examples/Set.hs | bsd-3-clause | prop_Insert x (s :: Set Int) =
insert x s ==? (x : toList s) | 62 | prop_Insert x (s :: Set Int) =
insert x s ==? (x : toList s) | 62 | prop_Insert x (s :: Set Int) =
insert x s ==? (x : toList s) | 62 | false | false | 0 | 8 | 16 | 40 | 19 | 21 | null | null |
haskell/haddock | haddock-library/fixtures/Fixtures.hs | bsd-2-clause | acceptFixtures :: [Fixture] -> IO ()
acceptFixtures = traverse_ $ \(Fixture i o) -> do
input <- readFile i
let doc = parseString input
let actual = show (prettyExpr $ toExpr doc) ++ "\n"
writeFile o actual | 221 | acceptFixtures :: [Fixture] -> IO ()
acceptFixtures = traverse_ $ \(Fixture i o) -> do
input <- readFile i
let doc = parseString input
let actual = show (prettyExpr $ toExpr doc) ++ "\n"
writeFile o actual | 221 | acceptFixtures = traverse_ $ \(Fixture i o) -> do
input <- readFile i
let doc = parseString input
let actual = show (prettyExpr $ toExpr doc) ++ "\n"
writeFile o actual | 184 | false | true | 0 | 16 | 52 | 96 | 45 | 51 | null | null |
joranvar/GCJ | src/gcj-lib/Y2017/R1B/A.hs | gpl-3.0 | example :: String
example = "3\n2525 1\n2400 5\n300 2\n120 60\n60 90\n100 2\n80 100\n70 10\n" | 93 | example :: String
example = "3\n2525 1\n2400 5\n300 2\n120 60\n60 90\n100 2\n80 100\n70 10\n" | 93 | example = "3\n2525 1\n2400 5\n300 2\n120 60\n60 90\n100 2\n80 100\n70 10\n" | 75 | false | true | 0 | 4 | 13 | 11 | 6 | 5 | null | null |
abakst/brisk-prelude | examples/SpawnSym.hs | bsd-3-clause | broadCast :: SymSet ProcessId -> Process ()
broadCast pids
= do foldM go () pids
return ()
where
go _ = ack | 136 | broadCast :: SymSet ProcessId -> Process ()
broadCast pids
= do foldM go () pids
return ()
where
go _ = ack | 136 | broadCast pids
= do foldM go () pids
return ()
where
go _ = ack | 92 | false | true | 0 | 8 | 50 | 56 | 25 | 31 | null | null |
HIPERFIT/futhark | src/Futhark/IR/GPU/Op.hs | isc | typeCheckSizeOp (CalcNumGroups w _ group_size) = do
TC.require [Prim int64] w
TC.require [Prim int64] group_size
-- | A host-level operation; parameterised by what else it can do. | 184 | typeCheckSizeOp (CalcNumGroups w _ group_size) = do
TC.require [Prim int64] w
TC.require [Prim int64] group_size
-- | A host-level operation; parameterised by what else it can do. | 184 | typeCheckSizeOp (CalcNumGroups w _ group_size) = do
TC.require [Prim int64] w
TC.require [Prim int64] group_size
-- | A host-level operation; parameterised by what else it can do. | 184 | false | false | 0 | 9 | 31 | 52 | 24 | 28 | null | null |
svenssonjoel/GCDObsidian | Obsidian/GCDObsidian/CodeGen/SPMDC.hs | bsd-3-clause | ppSPMDC ppc (CIf e xs []) = line "if " >>
wrap "(" ")" (ppCExpr ppc e) >>
begin >> indent >> newline >>
ppSPMDCList ppc xs >> unindent >> end | 230 | ppSPMDC ppc (CIf e xs []) = line "if " >>
wrap "(" ")" (ppCExpr ppc e) >>
begin >> indent >> newline >>
ppSPMDCList ppc xs >> unindent >> end | 230 | ppSPMDC ppc (CIf e xs []) = line "if " >>
wrap "(" ")" (ppCExpr ppc e) >>
begin >> indent >> newline >>
ppSPMDCList ppc xs >> unindent >> end | 230 | false | false | 0 | 14 | 119 | 76 | 35 | 41 | null | null |
ranjitjhala/gradr | Utils.hs | mit | groupBase :: (Eq k, Hashable k) => M.HashMap k [v] -> [(k, v)] -> M.HashMap k [v]
groupBase = L.foldl' (\m (k, v) -> inserts k v m) | 131 | groupBase :: (Eq k, Hashable k) => M.HashMap k [v] -> [(k, v)] -> M.HashMap k [v]
groupBase = L.foldl' (\m (k, v) -> inserts k v m) | 131 | groupBase = L.foldl' (\m (k, v) -> inserts k v m) | 49 | false | true | 0 | 10 | 27 | 97 | 50 | 47 | null | null |
codecurve/FieldML-Haskell-01 | src/FieldML/Utility01.hs | bsd-2-clause | freeVariables (Or a b) = freeVariables $ Tuple [ a, b ] | 55 | freeVariables (Or a b) = freeVariables $ Tuple [ a, b ] | 55 | freeVariables (Or a b) = freeVariables $ Tuple [ a, b ] | 55 | false | false | 0 | 7 | 11 | 31 | 15 | 16 | null | null |
kwangkim/pigment | src-lib/Cochon/TermController.hs | mit | termDispatch :: TermTransition -> InteractionState -> InteractionState
termDispatch (ToggleTerm name) state = toggleTerm name state | 131 | termDispatch :: TermTransition -> InteractionState -> InteractionState
termDispatch (ToggleTerm name) state = toggleTerm name state | 131 | termDispatch (ToggleTerm name) state = toggleTerm name state | 60 | false | true | 0 | 10 | 14 | 40 | 18 | 22 | null | null |
fjarri/wigner | src/Wigner/DefineExpression.hs | bsd-3-clause | matrixFunc s = matrixFuncIx s [] | 32 | matrixFunc s = matrixFuncIx s [] | 32 | matrixFunc s = matrixFuncIx s [] | 32 | false | false | 1 | 6 | 5 | 19 | 7 | 12 | null | null |
takoeight0821/malgo | src/Koriel/Core/Syntax.hs | bsd-3-clause | appProgram :: Traversal' (Program a) (Exp a)
appProgram f Program {..} =
Program _moduleName <$> traverseOf (traversed . _2) f _topVars <*> traverseOf (traversed . _2 . _2) f _topFuncs | 186 | appProgram :: Traversal' (Program a) (Exp a)
appProgram f Program {..} =
Program _moduleName <$> traverseOf (traversed . _2) f _topVars <*> traverseOf (traversed . _2 . _2) f _topFuncs | 186 | appProgram f Program {..} =
Program _moduleName <$> traverseOf (traversed . _2) f _topVars <*> traverseOf (traversed . _2 . _2) f _topFuncs | 141 | false | true | 4 | 9 | 31 | 94 | 41 | 53 | null | null |
asvyazin/kafka-conduit | Kafka/BrokerConnection.hs | bsd-3-clause | apiKey :: RequestMessage -> ApiKey
apiKey (MetadataRequestMessage _) = Metadata.apiKey | 86 | apiKey :: RequestMessage -> ApiKey
apiKey (MetadataRequestMessage _) = Metadata.apiKey | 86 | apiKey (MetadataRequestMessage _) = Metadata.apiKey | 51 | false | true | 0 | 7 | 9 | 26 | 13 | 13 | null | null |
UCSD-PL/RefScript | src/Language/Rsc/Parser/Common.hs | bsd-3-clause | question :: Parser String
----------------------------------------------------------------------------------
dot = T.dot lexer | 140 | question :: Parser String
dot = T.dot lexer | 57 | dot = T.dot lexer | 31 | true | true | 0 | 6 | 22 | 20 | 10 | 10 | null | null |
leksah/yi | src/library/Yi/Buffer/HighLevel.hs | gpl-2.0 | leftOnEol :: BufferM ()
-- @savingPrefCol@ is needed, because deep down @leftB@ contains @forgetPrefCol@
-- which messes up vertical cursor motion in Vim normal mode
leftOnEol = savingPrefCol $ do
eol <- atEol
sol <- atSol
when (eol && not sol) leftB
-- | Move @x@ chars back, or to the sol, whichever is less | 334 | leftOnEol :: BufferM ()
leftOnEol = savingPrefCol $ do
eol <- atEol
sol <- atSol
when (eol && not sol) leftB
-- | Move @x@ chars back, or to the sol, whichever is less | 192 | leftOnEol = savingPrefCol $ do
eol <- atEol
sol <- atSol
when (eol && not sol) leftB
-- | Move @x@ chars back, or to the sol, whichever is less | 168 | true | true | 0 | 11 | 79 | 55 | 27 | 28 | null | null |
fpco/th-utilities | src/TH/ReifySimple.hs | mit | -- | Reifies a 'Name' as a 'TypeInfo', and calls 'fail' if this doesn't
-- work. Use 'reify' with 'infoToType' if you want to handle the failure
-- case more gracefully.
--
-- This does not yet support reifying typeclasses, primitive type
-- constructors, or type variables ('TyVarI').
reifyType :: Name -> Q TypeInfo
reifyType name = do
info <- reify name
mres <- infoToType info
case mres of
Just res -> return res
Nothing -> fail $
"Expected to reify a data type, data family, or type family. Instead got:\n" ++
pprint info
-- | Convert an 'Info' into a 'TypeInfo' if possible, and otherwise
-- yield 'Nothing'. Needs to run in 'Q' so that | 689 | reifyType :: Name -> Q TypeInfo
reifyType name = do
info <- reify name
mres <- infoToType info
case mres of
Just res -> return res
Nothing -> fail $
"Expected to reify a data type, data family, or type family. Instead got:\n" ++
pprint info
-- | Convert an 'Info' into a 'TypeInfo' if possible, and otherwise
-- yield 'Nothing'. Needs to run in 'Q' so that | 403 | reifyType name = do
info <- reify name
mres <- infoToType info
case mres of
Just res -> return res
Nothing -> fail $
"Expected to reify a data type, data family, or type family. Instead got:\n" ++
pprint info
-- | Convert an 'Info' into a 'TypeInfo' if possible, and otherwise
-- yield 'Nothing'. Needs to run in 'Q' so that | 371 | true | true | 0 | 11 | 162 | 85 | 42 | 43 | null | null |
nikita-volkov/record-syntax | library/Record/Syntax/Parser.hs | mit | nonEOLSpaces :: Parser TextBuilder
nonEOLSpaces =
manyMerged nonEOLSpace | 74 | nonEOLSpaces :: Parser TextBuilder
nonEOLSpaces =
manyMerged nonEOLSpace | 74 | nonEOLSpaces =
manyMerged nonEOLSpace | 39 | false | true | 0 | 5 | 9 | 17 | 8 | 9 | null | null |
alexvong1995/pandoc | src/Text/Pandoc/Readers/Docx/Parse.hs | gpl-2.0 | ---------------------------------------------
---------------------------------------------
elemToTblGrid :: NameSpaces -> Element -> D TblGrid
elemToTblGrid ns element | isElem ns "w" "tblGrid" element =
let cols = findChildren (elemName ns "w" "gridCol") element
in
mapD (\e -> maybeToD (findAttr (elemName ns "w" "val") e >>= stringToInteger))
cols | 362 | elemToTblGrid :: NameSpaces -> Element -> D TblGrid
elemToTblGrid ns element | isElem ns "w" "tblGrid" element =
let cols = findChildren (elemName ns "w" "gridCol") element
in
mapD (\e -> maybeToD (findAttr (elemName ns "w" "val") e >>= stringToInteger))
cols | 269 | elemToTblGrid ns element | isElem ns "w" "tblGrid" element =
let cols = findChildren (elemName ns "w" "gridCol") element
in
mapD (\e -> maybeToD (findAttr (elemName ns "w" "val") e >>= stringToInteger))
cols | 217 | true | true | 0 | 16 | 53 | 109 | 52 | 57 | null | null |
gridaphobe/liquid-fixpoint | src/Language/Fixpoint/SortCheck.hs | bsd-3-clause | checkPred f (PNot p) = checkPred f p | 42 | checkPred f (PNot p) = checkPred f p | 42 | checkPred f (PNot p) = checkPred f p | 42 | false | false | 0 | 6 | 13 | 24 | 10 | 14 | null | null |
rahulmutt/ghcvm | compiler/Eta/HsSyn/HsDecls.hs | bsd-3-clause | lvectDeclName (L _ (HsVectInstOut _))
= panic "HsDecls.lvectDeclName: HsVectInstOut" | 87 | lvectDeclName (L _ (HsVectInstOut _))
= panic "HsDecls.lvectDeclName: HsVectInstOut" | 87 | lvectDeclName (L _ (HsVectInstOut _))
= panic "HsDecls.lvectDeclName: HsVectInstOut" | 87 | false | false | 0 | 9 | 11 | 26 | 12 | 14 | null | null |
nevvi/Declarative-D7012E | pre2/expr.hs | gpl-3.0 | eval (App "exp" arg) env = exp (eval arg env) | 45 | eval (App "exp" arg) env = exp (eval arg env) | 45 | eval (App "exp" arg) env = exp (eval arg env) | 45 | false | false | 1 | 7 | 9 | 32 | 14 | 18 | null | null |
Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Graphics/Camera.hs | mit | cameraGetDistance :: (Parent Camera a, Pointer p a, MonadIO m) => p -- ^ Camera pointer or child
-> Vector3 -- ^ World pos
-> m Float
cameraGetDistance p v = liftIO $ with v $ \v' -> do
let ptr = parentPointer p
realToFrac <$> [C.exp| float {$(Camera* ptr)->GetDistance(*$(Vector3* v'))} |]
-- | Return squared distance to position. In orthographic mode uses only Z coordinate.
-- float GetDistanceSquared(const Vector3& worldPos) const; | 446 | cameraGetDistance :: (Parent Camera a, Pointer p a, MonadIO m) => p -- ^ Camera pointer or child
-> Vector3 -- ^ World pos
-> m Float
cameraGetDistance p v = liftIO $ with v $ \v' -> do
let ptr = parentPointer p
realToFrac <$> [C.exp| float {$(Camera* ptr)->GetDistance(*$(Vector3* v'))} |]
-- | Return squared distance to position. In orthographic mode uses only Z coordinate.
-- float GetDistanceSquared(const Vector3& worldPos) const; | 446 | cameraGetDistance p v = liftIO $ with v $ \v' -> do
let ptr = parentPointer p
realToFrac <$> [C.exp| float {$(Camera* ptr)->GetDistance(*$(Vector3* v'))} |]
-- | Return squared distance to position. In orthographic mode uses only Z coordinate.
-- float GetDistanceSquared(const Vector3& worldPos) const; | 308 | false | true | 0 | 12 | 80 | 102 | 52 | 50 | null | null |
uduki/hsQt | Qtc/Core/QVariant.hs | bsd-2-clause | qqVariantValue_QSize :: QVariant a -> IO (QSize ())
qqVariantValue_QSize x0
= withQSizeResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QVariantValue_QSize cobj_x0 | 168 | qqVariantValue_QSize :: QVariant a -> IO (QSize ())
qqVariantValue_QSize x0
= withQSizeResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QVariantValue_QSize cobj_x0 | 168 | qqVariantValue_QSize x0
= withQSizeResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QVariantValue_QSize cobj_x0 | 116 | false | true | 0 | 9 | 29 | 51 | 24 | 27 | null | null |
8l/barrelfish | hake/RuleDefs.hs | mit | mackerel_generic :: Options -> String -> String -> HRule
mackerel_generic opts dev flag =
let
arch = optArch opts
in
Rule [ mackerelProgLoc,
Str ("--" ++ flag),
Str "-c", mackerelDevFileLoc dev,
Str "-o", Out arch (mackerelDevHdrPath dev)
] | 312 | mackerel_generic :: Options -> String -> String -> HRule
mackerel_generic opts dev flag =
let
arch = optArch opts
in
Rule [ mackerelProgLoc,
Str ("--" ++ flag),
Str "-c", mackerelDevFileLoc dev,
Str "-o", Out arch (mackerelDevHdrPath dev)
] | 312 | mackerel_generic opts dev flag =
let
arch = optArch opts
in
Rule [ mackerelProgLoc,
Str ("--" ++ flag),
Str "-c", mackerelDevFileLoc dev,
Str "-o", Out arch (mackerelDevHdrPath dev)
] | 255 | false | true | 0 | 9 | 109 | 101 | 48 | 53 | null | null |
RAFIRAF/HASKELL | hehe.hs | mit | whitePieceKillMove :: Pos -> Pos -> Board -> Board
whitePieceKillMove p0 p1 b = (remFig (killedPos p0 p1) (placeFig W (remFig p0 b) p1)) | 136 | whitePieceKillMove :: Pos -> Pos -> Board -> Board
whitePieceKillMove p0 p1 b = (remFig (killedPos p0 p1) (placeFig W (remFig p0 b) p1)) | 136 | whitePieceKillMove p0 p1 b = (remFig (killedPos p0 p1) (placeFig W (remFig p0 b) p1)) | 85 | false | true | 0 | 11 | 23 | 70 | 33 | 37 | null | null |
termite2/tsl | Abstract/BFormula.hs | bsd-3-clause | fRel :: (?spec::Spec) => RelOp -> Expr -> Expr -> Formula
-- type-independent cases
fRel op e1 e2 | isConstExpr e1 && isConstExpr e2 = if (evalConstExpr $ EBinOp (relOpToBOp op) e1 e2) == BoolVal True then FTrue else FFalse
| isConstExpr e1 = fRel (relOpSwap op) e2 e1 | 304 | fRel :: (?spec::Spec) => RelOp -> Expr -> Expr -> Formula
fRel op e1 e2 | isConstExpr e1 && isConstExpr e2 = if (evalConstExpr $ EBinOp (relOpToBOp op) e1 e2) == BoolVal True then FTrue else FFalse
| isConstExpr e1 = fRel (relOpSwap op) e2 e1 | 278 | fRel op e1 e2 | isConstExpr e1 && isConstExpr e2 = if (evalConstExpr $ EBinOp (relOpToBOp op) e1 e2) == BoolVal True then FTrue else FFalse
| isConstExpr e1 = fRel (relOpSwap op) e2 e1 | 220 | true | true | 1 | 12 | 84 | 119 | 58 | 61 | null | null |
tphyahoo/haskoin | haskoin-core/tests/Network/Haskoin/Transaction/Tests.hs | unlicense | {- Building Transactions -}
testBuildAddrTx :: ArbitraryAddress -> ArbitrarySatoshi -> Bool
testBuildAddrTx (ArbitraryAddress a) (ArbitrarySatoshi v) = case a of
x@(PubKeyAddress _) -> Right (PayPKHash x) == out
x@(ScriptAddress _) -> Right (PayScriptHash x) == out
where
tx = buildAddrTx [] [(addrToBase58 a,v)]
out = decodeOutputBS $ scriptOutput $ txOut (fromRight tx) !! 0 | 396 | testBuildAddrTx :: ArbitraryAddress -> ArbitrarySatoshi -> Bool
testBuildAddrTx (ArbitraryAddress a) (ArbitrarySatoshi v) = case a of
x@(PubKeyAddress _) -> Right (PayPKHash x) == out
x@(ScriptAddress _) -> Right (PayScriptHash x) == out
where
tx = buildAddrTx [] [(addrToBase58 a,v)]
out = decodeOutputBS $ scriptOutput $ txOut (fromRight tx) !! 0 | 367 | testBuildAddrTx (ArbitraryAddress a) (ArbitrarySatoshi v) = case a of
x@(PubKeyAddress _) -> Right (PayPKHash x) == out
x@(ScriptAddress _) -> Right (PayScriptHash x) == out
where
tx = buildAddrTx [] [(addrToBase58 a,v)]
out = decodeOutputBS $ scriptOutput $ txOut (fromRight tx) !! 0 | 303 | true | true | 0 | 11 | 73 | 150 | 76 | 74 | null | null |
jtojnar/haste-compiler | src/Haste/Environment.hs | bsd-3-clause | -- | Base directory for Haste's system libraries.
pkgSysLibDir :: FilePath
pkgSysLibDir = hasteSysDir | 101 | pkgSysLibDir :: FilePath
pkgSysLibDir = hasteSysDir | 51 | pkgSysLibDir = hasteSysDir | 26 | true | true | 0 | 4 | 13 | 12 | 7 | 5 | null | null |
dancor/melang | src/Main/goog-vs-lcmc.hs | mit | main :: IO ()
main = do
wdLwiMap <- Map.fromList . map (\lwi -> (lwiWd lwi, lwi)) <$> loadLwis
kDeck <- loadKiloDeck (kiloDir </> "mando-gloss-1k.txt")
let procKLine kLine =
case lwiMb of
Nothing -> Nothing
Just lwi ->
if
takeWhile (/= ':') (snd . head $ lwiPos lwi) /=
DT.unpack
(DT.takeWhile (/= ':') . killNum $ kLGloss kLine)
then
Just $ DT.intercalate ": "
[ showKiloLine kLine
, maybe "XXX" showLwi $ Map.lookup (kLWord kLine) wdLwiMap
]
else Nothing
where
lwiMb = Map.lookup (kLWord kLine) wdLwiMap
mapM_ DTI.putStrLn . catMaybes $ map procKLine kDeck | 836 | main :: IO ()
main = do
wdLwiMap <- Map.fromList . map (\lwi -> (lwiWd lwi, lwi)) <$> loadLwis
kDeck <- loadKiloDeck (kiloDir </> "mando-gloss-1k.txt")
let procKLine kLine =
case lwiMb of
Nothing -> Nothing
Just lwi ->
if
takeWhile (/= ':') (snd . head $ lwiPos lwi) /=
DT.unpack
(DT.takeWhile (/= ':') . killNum $ kLGloss kLine)
then
Just $ DT.intercalate ": "
[ showKiloLine kLine
, maybe "XXX" showLwi $ Map.lookup (kLWord kLine) wdLwiMap
]
else Nothing
where
lwiMb = Map.lookup (kLWord kLine) wdLwiMap
mapM_ DTI.putStrLn . catMaybes $ map procKLine kDeck | 836 | main = do
wdLwiMap <- Map.fromList . map (\lwi -> (lwiWd lwi, lwi)) <$> loadLwis
kDeck <- loadKiloDeck (kiloDir </> "mando-gloss-1k.txt")
let procKLine kLine =
case lwiMb of
Nothing -> Nothing
Just lwi ->
if
takeWhile (/= ':') (snd . head $ lwiPos lwi) /=
DT.unpack
(DT.takeWhile (/= ':') . killNum $ kLGloss kLine)
then
Just $ DT.intercalate ": "
[ showKiloLine kLine
, maybe "XXX" showLwi $ Map.lookup (kLWord kLine) wdLwiMap
]
else Nothing
where
lwiMb = Map.lookup (kLWord kLine) wdLwiMap
mapM_ DTI.putStrLn . catMaybes $ map procKLine kDeck | 822 | false | true | 1 | 21 | 371 | 251 | 121 | 130 | null | null |
edgarklerks/rewrite_systems | RewriteSystem.hs | bsd-3-clause | {-- Some tests --}
prop_searchStringValid = property test_searchStringValid | 76 | prop_searchStringValid = property test_searchStringValid | 56 | prop_searchStringValid = property test_searchStringValid | 56 | true | false | 0 | 5 | 8 | 10 | 5 | 5 | null | null |
agentm/project-m36 | src/lib/ProjectM36/DataTypes/ByteString.hs | unlicense | bytestringAtomFunctions :: AtomFunctions
bytestringAtomFunctions = HS.fromList [
Function { funcName = "bytestring",
funcType = [TextAtomType, ByteStringAtomType],
funcBody = compiledAtomFunctionBody $ \(TextAtom textIn:_) -> case B64.decode (TE.encodeUtf8 textIn) of
Left err -> Left (AtomFunctionBytesDecodingError err)
Right bs -> pure (ByteStringAtom bs)
}
] | 446 | bytestringAtomFunctions :: AtomFunctions
bytestringAtomFunctions = HS.fromList [
Function { funcName = "bytestring",
funcType = [TextAtomType, ByteStringAtomType],
funcBody = compiledAtomFunctionBody $ \(TextAtom textIn:_) -> case B64.decode (TE.encodeUtf8 textIn) of
Left err -> Left (AtomFunctionBytesDecodingError err)
Right bs -> pure (ByteStringAtom bs)
}
] | 446 | bytestringAtomFunctions = HS.fromList [
Function { funcName = "bytestring",
funcType = [TextAtomType, ByteStringAtomType],
funcBody = compiledAtomFunctionBody $ \(TextAtom textIn:_) -> case B64.decode (TE.encodeUtf8 textIn) of
Left err -> Left (AtomFunctionBytesDecodingError err)
Right bs -> pure (ByteStringAtom bs)
}
] | 405 | false | true | 0 | 16 | 125 | 123 | 62 | 61 | null | null |
Fuuzetsu/yi-haskell-utils | src/Yi/Mode/Haskell/Utils/Internal.hs | gpl-3.0 | getModuleName :: YiM (Either T.Text ModuleString)
getModuleName = do
bufLines <- T.lines . R.toText <$> withCurrentBuffer elemsB
return $ case mods bufLines of
[] -> Left "Couldn't find the module name in the file."
(x:_) -> Right . T.unpack . T.takeWhile (/= ' ') $ dropMod x
where
dropMod = T.drop (T.length "module ")
mods x = filter (T.isPrefixOf "module ") x
-- | Decide how to possible break up the types.
-- For now we just blindly insert identifiers. | 481 | getModuleName :: YiM (Either T.Text ModuleString)
getModuleName = do
bufLines <- T.lines . R.toText <$> withCurrentBuffer elemsB
return $ case mods bufLines of
[] -> Left "Couldn't find the module name in the file."
(x:_) -> Right . T.unpack . T.takeWhile (/= ' ') $ dropMod x
where
dropMod = T.drop (T.length "module ")
mods x = filter (T.isPrefixOf "module ") x
-- | Decide how to possible break up the types.
-- For now we just blindly insert identifiers. | 481 | getModuleName = do
bufLines <- T.lines . R.toText <$> withCurrentBuffer elemsB
return $ case mods bufLines of
[] -> Left "Couldn't find the module name in the file."
(x:_) -> Right . T.unpack . T.takeWhile (/= ' ') $ dropMod x
where
dropMod = T.drop (T.length "module ")
mods x = filter (T.isPrefixOf "module ") x
-- | Decide how to possible break up the types.
-- For now we just blindly insert identifiers. | 431 | false | true | 0 | 14 | 102 | 154 | 75 | 79 | null | null |
owestphal/PoE-FilterScript | src/haskell/ScriptParser.hs | bsd-3-clause | styleExpr = do
reserved "Style"
name <- identifier
operator "="
d <- styleDef
return $ StyleExpr name d | 123 | styleExpr = do
reserved "Style"
name <- identifier
operator "="
d <- styleDef
return $ StyleExpr name d | 123 | styleExpr = do
reserved "Style"
name <- identifier
operator "="
d <- styleDef
return $ StyleExpr name d | 123 | false | false | 0 | 8 | 37 | 44 | 18 | 26 | null | null |
rawlep/EQS | sourceCode/HMDIFPrelude.hs | mit | emicolon = L.cons ';' L.empty
| 31 | semicolon = L.cons ';' L.empty | 31 | semicolon = L.cons ';' L.empty | 31 | false | false | 1 | 5 | 6 | 19 | 7 | 12 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/playpen/blockchain/ben-kirwin-merkle/test/TrieSpec.hs | unlicense | runEmptyTrie = runEmpty . runTrie | 33 | runEmptyTrie = runEmpty . runTrie | 33 | runEmptyTrie = runEmpty . runTrie | 33 | false | false | 0 | 5 | 4 | 10 | 5 | 5 | null | null |
Numberartificial/workflow | snipets/.stack-work/intero/intero30430oOV.hs | mit | sumInteract :: IO ()
sumInteract
= do putStrLn "Enter integers one per line"
putStrLn "These will be summed until zero is entered"
sum <- sumInts 0
putStr "The sum is "
print sum
-- Copy from input to output | 238 | sumInteract :: IO ()
sumInteract
= do putStrLn "Enter integers one per line"
putStrLn "These will be summed until zero is entered"
sum <- sumInts 0
putStr "The sum is "
print sum
-- Copy from input to output | 238 | sumInteract
= do putStrLn "Enter integers one per line"
putStrLn "These will be summed until zero is entered"
sum <- sumInts 0
putStr "The sum is "
print sum
-- Copy from input to output | 217 | false | true | 0 | 8 | 69 | 53 | 21 | 32 | null | null |
DougBurke/swish | tests/GraphPartitionTest.hs | lgpl-2.1 | pb4af = toPV "b4" [ (LF "p",PartObj (LF "s2"))
, (LF "p",PartObj (LV "b3"))
] | 113 | pb4af = toPV "b4" [ (LF "p",PartObj (LF "s2"))
, (LF "p",PartObj (LV "b3"))
] | 113 | pb4af = toPV "b4" [ (LF "p",PartObj (LF "s2"))
, (LF "p",PartObj (LV "b3"))
] | 113 | false | false | 1 | 10 | 50 | 56 | 27 | 29 | null | null |
zeniuseducation/poly-euler | haskell/next/one.hs | epl-1.0 | sum_primes lim = 2 + (sum $ filter prime' [3,5..lim])
where prime' n = all (\x -> 0 /= rem n x) (takeWhile (\x -> x*x <= n) [3,5..]) | 135 | sum_primes lim = 2 + (sum $ filter prime' [3,5..lim])
where prime' n = all (\x -> 0 /= rem n x) (takeWhile (\x -> x*x <= n) [3,5..]) | 135 | sum_primes lim = 2 + (sum $ filter prime' [3,5..lim])
where prime' n = all (\x -> 0 /= rem n x) (takeWhile (\x -> x*x <= n) [3,5..]) | 135 | false | false | 0 | 11 | 31 | 96 | 50 | 46 | null | null |
GRACeFUL-project/haskelzinc | src/Interfaces/MZBuiltIns.hs | bsd-3-clause | mz_and = infOp "/\\" | 24 | mz_and = infOp "/\\" | 24 | mz_and = infOp "/\\" | 24 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
fmapfmapfmap/amazonka | amazonka-dynamodb/gen/Network/AWS/DynamoDB/UpdateItem.hs | mpl-2.0 | -- | This is a legacy parameter, for backward compatibility. New applications
-- should use /ConditionExpression/ instead. Do not combine legacy
-- parameters and expression parameters in a single API call; otherwise,
-- DynamoDB will return a /ValidationException/ exception.
--
-- A map of attribute\/condition pairs. /Expected/ provides a conditional
-- block for the /UpdateItem/ operation.
--
-- Each element of /Expected/ consists of an attribute name, a comparison
-- operator, and one or more values. DynamoDB compares the attribute with
-- the value(s) you supplied, using the comparison operator. For each
-- /Expected/ element, the result of the evaluation is either true or
-- false.
--
-- If you specify more than one element in the /Expected/ map, then by
-- default all of the conditions must evaluate to true. In other words, the
-- conditions are ANDed together. (You can use the /ConditionalOperator/
-- parameter to OR the conditions instead. If you do this, then at least
-- one of the conditions must evaluate to true, rather than all of them.)
--
-- If the /Expected/ map evaluates to true, then the conditional operation
-- succeeds; otherwise, it fails.
--
-- /Expected/ contains the following:
--
-- - /AttributeValueList/ - One or more values to evaluate against the
-- supplied attribute. The number of values in the list depends on the
-- /ComparisonOperator/ being used.
--
-- For type Number, value comparisons are numeric.
--
-- String value comparisons for greater than, equals, or less than are
-- based on ASCII character code values. For example, 'a' is greater
-- than 'A', and 'a' is greater than 'B'. For a list of code values,
-- see <http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters>.
--
-- For type Binary, DynamoDB treats each byte of the binary data as
-- unsigned when it compares binary values.
--
-- - /ComparisonOperator/ - A comparator for evaluating attributes in the
-- /AttributeValueList/. When performing the comparison, DynamoDB uses
-- strongly consistent reads.
--
-- The following comparison operators are available:
--
-- 'EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN'
--
-- The following are descriptions of each comparison operator.
--
-- - 'EQ' : Equal. 'EQ' is supported for all datatypes, including
-- lists and maps.
--
-- /AttributeValueList/ can contain only one /AttributeValue/
-- element of type String, Number, Binary, String Set, Number Set,
-- or Binary Set. If an item contains an /AttributeValue/ element
-- of a different type than the one provided in the request, the
-- value does not match. For example, '{\"S\":\"6\"}' does not
-- equal '{\"N\":\"6\"}'. Also, '{\"N\":\"6\"}' does not equal
-- '{\"NS\":[\"6\", \"2\", \"1\"]}'.
--
-- - 'NE' : Not equal. 'NE' is supported for all datatypes, including
-- lists and maps.
--
-- /AttributeValueList/ can contain only one /AttributeValue/ of
-- type String, Number, Binary, String Set, Number Set, or Binary
-- Set. If an item contains an /AttributeValue/ of a different type
-- than the one provided in the request, the value does not match.
-- For example, '{\"S\":\"6\"}' does not equal '{\"N\":\"6\"}'.
-- Also, '{\"N\":\"6\"}' does not equal
-- '{\"NS\":[\"6\", \"2\", \"1\"]}'.
--
-- - 'LE' : Less than or equal.
--
-- /AttributeValueList/ can contain only one /AttributeValue/
-- element of type String, Number, or Binary (not a set type). If
-- an item contains an /AttributeValue/ element of a different type
-- than the one provided in the request, the value does not match.
-- For example, '{\"S\":\"6\"}' does not equal '{\"N\":\"6\"}'.
-- Also, '{\"N\":\"6\"}' does not compare to
-- '{\"NS\":[\"6\", \"2\", \"1\"]}'.
--
-- - 'LT' : Less than.
--
-- /AttributeValueList/ can contain only one /AttributeValue/ of
-- type String, Number, or Binary (not a set type). If an item
-- contains an /AttributeValue/ element of a different type than
-- the one provided in the request, the value does not match. For
-- example, '{\"S\":\"6\"}' does not equal '{\"N\":\"6\"}'. Also,
-- '{\"N\":\"6\"}' does not compare to
-- '{\"NS\":[\"6\", \"2\", \"1\"]}'.
--
-- - 'GE' : Greater than or equal.
--
-- /AttributeValueList/ can contain only one /AttributeValue/
-- element of type String, Number, or Binary (not a set type). If
-- an item contains an /AttributeValue/ element of a different type
-- than the one provided in the request, the value does not match.
-- For example, '{\"S\":\"6\"}' does not equal '{\"N\":\"6\"}'.
-- Also, '{\"N\":\"6\"}' does not compare to
-- '{\"NS\":[\"6\", \"2\", \"1\"]}'.
--
-- - 'GT' : Greater than.
--
-- /AttributeValueList/ can contain only one /AttributeValue/
-- element of type String, Number, or Binary (not a set type). If
-- an item contains an /AttributeValue/ element of a different type
-- than the one provided in the request, the value does not match.
-- For example, '{\"S\":\"6\"}' does not equal '{\"N\":\"6\"}'.
-- Also, '{\"N\":\"6\"}' does not compare to
-- '{\"NS\":[\"6\", \"2\", \"1\"]}'.
--
-- - 'NOT_NULL' : The attribute exists. 'NOT_NULL' is supported for
-- all datatypes, including lists and maps.
--
-- This operator tests for the existence of an attribute, not its
-- data type. If the data type of attribute \"'a'\" is null, and
-- you evaluate it using 'NOT_NULL', the result is a Boolean
-- /true/. This result is because the attribute \"'a'\" exists; its
-- data type is not relevant to the 'NOT_NULL' comparison operator.
--
-- - 'NULL' : The attribute does not exist. 'NULL' is supported for
-- all datatypes, including lists and maps.
--
-- This operator tests for the nonexistence of an attribute, not
-- its data type. If the data type of attribute \"'a'\" is null,
-- and you evaluate it using 'NULL', the result is a Boolean
-- /false/. This is because the attribute \"'a'\" exists; its data
-- type is not relevant to the 'NULL' comparison operator.
--
-- - 'CONTAINS' : Checks for a subsequence, or value in a set.
--
-- /AttributeValueList/ can contain only one /AttributeValue/
-- element of type String, Number, or Binary (not a set type). If
-- the target attribute of the comparison is of type String, then
-- the operator checks for a substring match. If the target
-- attribute of the comparison is of type Binary, then the operator
-- looks for a subsequence of the target that matches the input. If
-- the target attribute of the comparison is a set (\"'SS'\",
-- \"'NS'\", or \"'BS'\"), then the operator evaluates to true if
-- it finds an exact match with any member of the set.
--
-- CONTAINS is supported for lists: When evaluating
-- \"'a CONTAINS b'\", \"'a'\" can be a list; however, \"'b'\"
-- cannot be a set, a map, or a list.
--
-- - 'NOT_CONTAINS' : Checks for absence of a subsequence, or absence
-- of a value in a set.
--
-- /AttributeValueList/ can contain only one /AttributeValue/
-- element of type String, Number, or Binary (not a set type). If
-- the target attribute of the comparison is a String, then the
-- operator checks for the absence of a substring match. If the
-- target attribute of the comparison is Binary, then the operator
-- checks for the absence of a subsequence of the target that
-- matches the input. If the target attribute of the comparison is
-- a set (\"'SS'\", \"'NS'\", or \"'BS'\"), then the operator
-- evaluates to true if it /does not/ find an exact match with any
-- member of the set.
--
-- NOT_CONTAINS is supported for lists: When evaluating
-- \"'a NOT CONTAINS b'\", \"'a'\" can be a list; however, \"'b'\"
-- cannot be a set, a map, or a list.
--
-- - 'BEGINS_WITH' : Checks for a prefix.
--
-- /AttributeValueList/ can contain only one /AttributeValue/ of
-- type String or Binary (not a Number or a set type). The target
-- attribute of the comparison must be of type String or Binary
-- (not a Number or a set type).
--
-- - 'IN' : Checks for matching elements within two sets.
--
-- /AttributeValueList/ can contain one or more /AttributeValue/
-- elements of type String, Number, or Binary (not a set type).
-- These attributes are compared against an existing set type
-- attribute of an item. If any elements of the input set are
-- present in the item attribute, the expression evaluates to true.
--
-- - 'BETWEEN' : Greater than or equal to the first value, and less
-- than or equal to the second value.
--
-- /AttributeValueList/ must contain two /AttributeValue/ elements
-- of the same type, either String, Number, or Binary (not a set
-- type). A target attribute matches if the target value is greater
-- than, or equal to, the first element and less than, or equal to,
-- the second element. If an item contains an /AttributeValue/
-- element of a different type than the one provided in the
-- request, the value does not match. For example, '{\"S\":\"6\"}'
-- does not compare to '{\"N\":\"6\"}'. Also, '{\"N\":\"6\"}' does
-- not compare to '{\"NS\":[\"6\", \"2\", \"1\"]}'
--
-- For usage examples of /AttributeValueList/ and /ComparisonOperator/, see
-- <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html Legacy Conditional Parameters>
-- in the /Amazon DynamoDB Developer Guide/.
--
-- For backward compatibility with previous DynamoDB releases, the
-- following parameters can be used instead of /AttributeValueList/ and
-- /ComparisonOperator/:
--
-- - /Value/ - A value for DynamoDB to compare with an attribute.
--
-- - /Exists/ - A Boolean value that causes DynamoDB to evaluate the
-- value before attempting the conditional operation:
--
-- - If /Exists/ is 'true', DynamoDB will check to see if that
-- attribute value already exists in the table. If it is found,
-- then the condition evaluates to true; otherwise the condition
-- evaluate to false.
--
-- - If /Exists/ is 'false', DynamoDB assumes that the attribute
-- value does /not/ exist in the table. If in fact the value does
-- not exist, then the assumption is valid and the condition
-- evaluates to true. If the value is found, despite the assumption
-- that it does not exist, the condition evaluates to false.
--
-- Note that the default value for /Exists/ is 'true'.
--
-- The /Value/ and /Exists/ parameters are incompatible with
-- /AttributeValueList/ and /ComparisonOperator/. Note that if you use both
-- sets of parameters at once, DynamoDB will return a /ValidationException/
-- exception.
--
-- This parameter does not support attributes of type List or Map.
uiExpected :: Lens' UpdateItem (HashMap Text ExpectedAttributeValue)
uiExpected = lens _uiExpected (\ s a -> s{_uiExpected = a}) . _Default . _Map | 11,630 | uiExpected :: Lens' UpdateItem (HashMap Text ExpectedAttributeValue)
uiExpected = lens _uiExpected (\ s a -> s{_uiExpected = a}) . _Default . _Map | 146 | uiExpected = lens _uiExpected (\ s a -> s{_uiExpected = a}) . _Default . _Map | 77 | true | true | 1 | 11 | 2,803 | 284 | 252 | 32 | null | null |
korczis/haskell-world | lib/Statistics.hs | mit | mean :: Fractional a => [a] -> a
mean xs = sum xs / fromIntegral(length xs) | 75 | mean :: Fractional a => [a] -> a
mean xs = sum xs / fromIntegral(length xs) | 75 | mean xs = sum xs / fromIntegral(length xs) | 42 | false | true | 2 | 8 | 15 | 50 | 22 | 28 | null | null |
karamellpelle/grid | source/Game/Run/Iteration/Pause.hs | gpl-3.0 | iterationPauseEnd' :: Tick -> Iteration' RunWorld
iterationPauseEnd' tick =
pauseEndIteration tick outputMain' $ defaultStep doEmpty $ \s run b -> do
if tick + rTF valueRunPauseTicks <= worldTick run
then return (run, b, [])
else return (run, b, [iterationPauseEnd' tick])
--------------------------------------------------------------------------------
-- pauseIteration | 423 | iterationPauseEnd' :: Tick -> Iteration' RunWorld
iterationPauseEnd' tick =
pauseEndIteration tick outputMain' $ defaultStep doEmpty $ \s run b -> do
if tick + rTF valueRunPauseTicks <= worldTick run
then return (run, b, [])
else return (run, b, [iterationPauseEnd' tick])
--------------------------------------------------------------------------------
-- pauseIteration | 423 | iterationPauseEnd' tick =
pauseEndIteration tick outputMain' $ defaultStep doEmpty $ \s run b -> do
if tick + rTF valueRunPauseTicks <= worldTick run
then return (run, b, [])
else return (run, b, [iterationPauseEnd' tick])
--------------------------------------------------------------------------------
-- pauseIteration | 373 | false | true | 0 | 13 | 94 | 105 | 54 | 51 | null | null |
balez/lambda-coinduction | Auxiliary/Composition.hs | gpl-3.0 | arg2 = res1 . arg1 | 18 | arg2 = res1 . arg1 | 18 | arg2 = res1 . arg1 | 18 | false | false | 0 | 5 | 4 | 10 | 5 | 5 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/course/2013-11-coursera-fp-odersky-but-in-haskell/FP04PatMatTest.hs | unlicense | frenchCode :: CodeTree
frenchCode = createCodeTreeFromUnorderPairs [('s', 121895),
('d', 56269),
('x', 5928),
('j', 8351),
('f', 16351),
('z', 2093),
('k', 745),
('w', 1747),
('y', 4725),
('h', 11298),
('q', 20889),
('o', 82762),
('l', 83668),
('m', 45521),
('p', 46335),
('u', 96785),
('r', 100500),
('c', 50003),
('v', 24975),
('g', 13288),
('b', 13822),
('n', 108812),
('t', 111103),
('e', 225947),
('i', 115465),
('a', 117110)] | 1,580 | frenchCode :: CodeTree
frenchCode = createCodeTreeFromUnorderPairs [('s', 121895),
('d', 56269),
('x', 5928),
('j', 8351),
('f', 16351),
('z', 2093),
('k', 745),
('w', 1747),
('y', 4725),
('h', 11298),
('q', 20889),
('o', 82762),
('l', 83668),
('m', 45521),
('p', 46335),
('u', 96785),
('r', 100500),
('c', 50003),
('v', 24975),
('g', 13288),
('b', 13822),
('n', 108812),
('t', 111103),
('e', 225947),
('i', 115465),
('a', 117110)] | 1,580 | frenchCode = createCodeTreeFromUnorderPairs [('s', 121895),
('d', 56269),
('x', 5928),
('j', 8351),
('f', 16351),
('z', 2093),
('k', 745),
('w', 1747),
('y', 4725),
('h', 11298),
('q', 20889),
('o', 82762),
('l', 83668),
('m', 45521),
('p', 46335),
('u', 96785),
('r', 100500),
('c', 50003),
('v', 24975),
('g', 13288),
('b', 13822),
('n', 108812),
('t', 111103),
('e', 225947),
('i', 115465),
('a', 117110)] | 1,557 | false | true | 0 | 7 | 1,206 | 248 | 163 | 85 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Text.hs | bsd-3-clause | -- | /O(n)/ 'all' @p@ @t@ determines whether all characters in the
-- 'Text' @t@ satisfy the predicate @p@. Subject to fusion.
all :: (Char -> Bool) -> Text -> Bool
all p t = S.all p (stream t) | 193 | all :: (Char -> Bool) -> Text -> Bool
all p t = S.all p (stream t) | 66 | all p t = S.all p (stream t) | 28 | true | true | 0 | 8 | 38 | 53 | 25 | 28 | null | null |
deech/LibClang | Setup.hs | bsd-3-clause | buildHookM :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()
buildHookM pd lbi uh bf = do
let staticBuildingSpecified = lookup (FlagName "staticbuild") (configConfigurationsFlags (configFlags lbi))
buildNormally = (buildHook simpleUserHooks) pd lbi uh bf
maybe
((buildHook simpleUserHooks) pd lbi uh bf)
(\shouldStaticBuild->
if shouldStaticBuild
then do
buildNormally
linkWithLLVMLibs lbi bf
else buildNormally)
staticBuildingSpecified | 523 | buildHookM :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()
buildHookM pd lbi uh bf = do
let staticBuildingSpecified = lookup (FlagName "staticbuild") (configConfigurationsFlags (configFlags lbi))
buildNormally = (buildHook simpleUserHooks) pd lbi uh bf
maybe
((buildHook simpleUserHooks) pd lbi uh bf)
(\shouldStaticBuild->
if shouldStaticBuild
then do
buildNormally
linkWithLLVMLibs lbi bf
else buildNormally)
staticBuildingSpecified | 523 | buildHookM pd lbi uh bf = do
let staticBuildingSpecified = lookup (FlagName "staticbuild") (configConfigurationsFlags (configFlags lbi))
buildNormally = (buildHook simpleUserHooks) pd lbi uh bf
maybe
((buildHook simpleUserHooks) pd lbi uh bf)
(\shouldStaticBuild->
if shouldStaticBuild
then do
buildNormally
linkWithLLVMLibs lbi bf
else buildNormally)
staticBuildingSpecified | 436 | false | true | 0 | 15 | 115 | 153 | 73 | 80 | null | null |
nickng/gong | Liveness.hs | apache-2.0 | barbs t = [] | 12 | barbs t = [] | 12 | barbs t = [] | 12 | false | false | 1 | 6 | 3 | 15 | 5 | 10 | null | null |
HIPERFIT/futhark | src/Futhark/Tools.hs | isc | sequentialStreamWholeArray ::
(MonadBuilder m, Buildable (Rep m)) =>
Pat (Rep m) ->
SubExp ->
[SubExp] ->
LambdaT (Rep m) ->
[VName] ->
m ()
sequentialStreamWholeArray pat w nes lam arrs = do
-- We just set the chunksize to w and inline the lambda body. There
-- is no difference between parallel and sequential streams here.
let (chunk_size_param, fold_params, arr_params) =
partitionChunkedFoldParameters (length nes) $ lambdaParams lam
-- The chunk size is the full size of the array.
letBindNames [paramName chunk_size_param] $ BasicOp $ SubExp w
-- The accumulator parameters are initialised to the neutral element.
forM_ (zip fold_params nes) $ \(p, ne) ->
letBindNames [paramName p] $ BasicOp $ SubExp ne
-- Finally, the array parameters are set to the arrays (but reshaped
-- to make the types work out; this will be simplified rapidly).
forM_ (zip arr_params arrs) $ \(p, arr) ->
letBindNames [paramName p] $
BasicOp $
Reshape (map DimCoercion $ arrayDims $ paramType p) arr
-- Then we just inline the lambda body.
mapM_ addStm $ bodyStms $ lambdaBody lam
-- The number of results in the body matches exactly the size (and
-- order) of 'pat', so we bind them up here, again with a reshape to
-- make the types work out.
forM_ (zip (patElems pat) $ bodyResult $ lambdaBody lam) $ \(pe, SubExpRes cs se) ->
certifying cs $ case (arrayDims $ patElemType pe, se) of
(dims, Var v)
| not $ null dims ->
letBindNames [patElemName pe] $ BasicOp $ Reshape (map DimCoercion dims) v
_ -> letBindNames [patElemName pe] $ BasicOp $ SubExp se
-- | Split the parameters of a stream reduction lambda into the chunk
-- size parameter, the accumulator parameters, and the input chunk
-- parameters. The integer argument is how many accumulators are
-- used. | 1,866 | sequentialStreamWholeArray ::
(MonadBuilder m, Buildable (Rep m)) =>
Pat (Rep m) ->
SubExp ->
[SubExp] ->
LambdaT (Rep m) ->
[VName] ->
m ()
sequentialStreamWholeArray pat w nes lam arrs = do
-- We just set the chunksize to w and inline the lambda body. There
-- is no difference between parallel and sequential streams here.
let (chunk_size_param, fold_params, arr_params) =
partitionChunkedFoldParameters (length nes) $ lambdaParams lam
-- The chunk size is the full size of the array.
letBindNames [paramName chunk_size_param] $ BasicOp $ SubExp w
-- The accumulator parameters are initialised to the neutral element.
forM_ (zip fold_params nes) $ \(p, ne) ->
letBindNames [paramName p] $ BasicOp $ SubExp ne
-- Finally, the array parameters are set to the arrays (but reshaped
-- to make the types work out; this will be simplified rapidly).
forM_ (zip arr_params arrs) $ \(p, arr) ->
letBindNames [paramName p] $
BasicOp $
Reshape (map DimCoercion $ arrayDims $ paramType p) arr
-- Then we just inline the lambda body.
mapM_ addStm $ bodyStms $ lambdaBody lam
-- The number of results in the body matches exactly the size (and
-- order) of 'pat', so we bind them up here, again with a reshape to
-- make the types work out.
forM_ (zip (patElems pat) $ bodyResult $ lambdaBody lam) $ \(pe, SubExpRes cs se) ->
certifying cs $ case (arrayDims $ patElemType pe, se) of
(dims, Var v)
| not $ null dims ->
letBindNames [patElemName pe] $ BasicOp $ Reshape (map DimCoercion dims) v
_ -> letBindNames [patElemName pe] $ BasicOp $ SubExp se
-- | Split the parameters of a stream reduction lambda into the chunk
-- size parameter, the accumulator parameters, and the input chunk
-- parameters. The integer argument is how many accumulators are
-- used. | 1,866 | sequentialStreamWholeArray pat w nes lam arrs = do
-- We just set the chunksize to w and inline the lambda body. There
-- is no difference between parallel and sequential streams here.
let (chunk_size_param, fold_params, arr_params) =
partitionChunkedFoldParameters (length nes) $ lambdaParams lam
-- The chunk size is the full size of the array.
letBindNames [paramName chunk_size_param] $ BasicOp $ SubExp w
-- The accumulator parameters are initialised to the neutral element.
forM_ (zip fold_params nes) $ \(p, ne) ->
letBindNames [paramName p] $ BasicOp $ SubExp ne
-- Finally, the array parameters are set to the arrays (but reshaped
-- to make the types work out; this will be simplified rapidly).
forM_ (zip arr_params arrs) $ \(p, arr) ->
letBindNames [paramName p] $
BasicOp $
Reshape (map DimCoercion $ arrayDims $ paramType p) arr
-- Then we just inline the lambda body.
mapM_ addStm $ bodyStms $ lambdaBody lam
-- The number of results in the body matches exactly the size (and
-- order) of 'pat', so we bind them up here, again with a reshape to
-- make the types work out.
forM_ (zip (patElems pat) $ bodyResult $ lambdaBody lam) $ \(pe, SubExpRes cs se) ->
certifying cs $ case (arrayDims $ patElemType pe, se) of
(dims, Var v)
| not $ null dims ->
letBindNames [patElemName pe] $ BasicOp $ Reshape (map DimCoercion dims) v
_ -> letBindNames [patElemName pe] $ BasicOp $ SubExp se
-- | Split the parameters of a stream reduction lambda into the chunk
-- size parameter, the accumulator parameters, and the input chunk
-- parameters. The integer argument is how many accumulators are
-- used. | 1,711 | false | true | 0 | 19 | 415 | 460 | 227 | 233 | null | null |
alexander-at-github/eta | compiler/ETA/Utils/GraphOps.hs | bsd-3-clause | -- | Get a node from the graph, throwing an error if it's not there
getNode
:: Uniquable k
=> Graph k cls color
-> k -> Node k cls color
getNode graph k
= case lookupUFM (graphMap graph) k of
Just node -> node
Nothing -> panic "ColorOps.getNode: not found"
-- | Add a node to the graph, linking up its edges | 365 | getNode
:: Uniquable k
=> Graph k cls color
-> k -> Node k cls color
getNode graph k
= case lookupUFM (graphMap graph) k of
Just node -> node
Nothing -> panic "ColorOps.getNode: not found"
-- | Add a node to the graph, linking up its edges | 296 | getNode graph k
= case lookupUFM (graphMap graph) k of
Just node -> node
Nothing -> panic "ColorOps.getNode: not found"
-- | Add a node to the graph, linking up its edges | 203 | true | true | 0 | 9 | 120 | 84 | 39 | 45 | null | null |
glennrfisher/cis194-haskell | 08 IO/Party.hs | mit | -- Read a company hierarchy to compute the optimal guest list.
main :: IO ()
main =
(readLn :: IO (Tree Employee)) >>= putStr . format . maxFun | 148 | main :: IO ()
main =
(readLn :: IO (Tree Employee)) >>= putStr . format . maxFun | 84 | main =
(readLn :: IO (Tree Employee)) >>= putStr . format . maxFun | 70 | true | true | 0 | 11 | 32 | 44 | 23 | 21 | null | null |
AlephAlpha/Samau | OldSamau/Parser.hs | gpl-2.0 | parseList :: Parser SmExpression
parseList = do
char '['
optional spaces
x <- many parseExpression
char ']'
return $ SmList x | 135 | parseList :: Parser SmExpression
parseList = do
char '['
optional spaces
x <- many parseExpression
char ']'
return $ SmList x | 135 | parseList = do
char '['
optional spaces
x <- many parseExpression
char ']'
return $ SmList x | 102 | false | true | 0 | 8 | 30 | 52 | 21 | 31 | null | null |
brendanhay/gogol | gogol-adexchangebuyer2/gen/Network/Google/Resource/AdExchangeBuyer2/Accounts/PublisherProFiles/List.hs | mpl-2.0 | -- | JSONP
appflCallback :: Lens' AccountsPublisherProFilesList (Maybe Text)
appflCallback
= lens _appflCallback
(\ s a -> s{_appflCallback = a}) | 153 | appflCallback :: Lens' AccountsPublisherProFilesList (Maybe Text)
appflCallback
= lens _appflCallback
(\ s a -> s{_appflCallback = a}) | 142 | appflCallback
= lens _appflCallback
(\ s a -> s{_appflCallback = a}) | 76 | true | true | 0 | 9 | 27 | 48 | 25 | 23 | null | null |
prowdsponsor/country-codes | src/Data/CountryCodes/ISO31661.hs | bsd-3-clause | fromMText "GE" = Just GE | 24 | fromMText "GE" = Just GE | 24 | fromMText "GE" = Just GE | 24 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
nkaretnikov/hhammer | Hammer.hs | gpl-2.0 | p'HParseResult'bit_length :: Ptr (C'HParseResult) -> Ptr (CLong)
p'HParseResult'arena p = plusPtr p 12 | 102 | p'HParseResult'bit_length :: Ptr (C'HParseResult) -> Ptr (CLong)
p'HParseResult'arena p = plusPtr p 12 | 102 | p'HParseResult'arena p = plusPtr p 12 | 37 | false | true | 0 | 8 | 12 | 41 | 18 | 23 | null | null |
mikolajsacha/HaskellPics | pixel.hs | gpl-3.0 | map' :: (a -> b) -> (a, a, a) -> (b, b, b)
map' f (a, b, c) = (f a, f b, f c) | 77 | map' :: (a -> b) -> (a, a, a) -> (b, b, b)
map' f (a, b, c) = (f a, f b, f c) | 77 | map' f (a, b, c) = (f a, f b, f c) | 34 | false | true | 0 | 7 | 24 | 81 | 44 | 37 | null | null |
kim/amazonka | amazonka-emr/gen/Network/AWS/EMR/Types.hs | mpl-2.0 | -- | Bid price for each Amazon EC2 instance in the instance group when launching
-- nodes as Spot Instances, expressed in USD.
igcBidPrice :: Lens' InstanceGroupConfig (Maybe Text)
igcBidPrice = lens _igcBidPrice (\s a -> s { _igcBidPrice = a }) | 245 | igcBidPrice :: Lens' InstanceGroupConfig (Maybe Text)
igcBidPrice = lens _igcBidPrice (\s a -> s { _igcBidPrice = a }) | 118 | igcBidPrice = lens _igcBidPrice (\s a -> s { _igcBidPrice = a }) | 64 | true | true | 0 | 9 | 41 | 47 | 26 | 21 | null | null |
olorin/amazonka | amazonka-cloudwatch-logs/gen/Network/AWS/CloudWatchLogs/CreateExportTask.hs | mpl-2.0 | -- | Will only export log streams that match the provided
-- logStreamNamePrefix. If you don\'t specify a value, no prefix filter is
-- applied.
cetLogStreamNamePrefix :: Lens' CreateExportTask (Maybe Text)
cetLogStreamNamePrefix = lens _cetLogStreamNamePrefix (\ s a -> s{_cetLogStreamNamePrefix = a}) | 302 | cetLogStreamNamePrefix :: Lens' CreateExportTask (Maybe Text)
cetLogStreamNamePrefix = lens _cetLogStreamNamePrefix (\ s a -> s{_cetLogStreamNamePrefix = a}) | 157 | cetLogStreamNamePrefix = lens _cetLogStreamNamePrefix (\ s a -> s{_cetLogStreamNamePrefix = a}) | 95 | true | true | 0 | 9 | 41 | 48 | 27 | 21 | null | null |
sebashack/LensPlayground | src/Setter.hs | bsd-3-clause | speedcOrStrengh _ = Just (SuperStrengh, "Strong Guy") | 53 | speedcOrStrengh _ = Just (SuperStrengh, "Strong Guy") | 53 | speedcOrStrengh _ = Just (SuperStrengh, "Strong Guy") | 53 | false | false | 0 | 5 | 6 | 19 | 9 | 10 | null | null |
dysinger/amazonka | amazonka-ecs/gen/Network/AWS/ECS/DescribeTasks.hs | mpl-2.0 | -- | The short name or full Amazon Resource Name (ARN) of the cluster that hosts
-- the task you want to describe. If you do not specify a cluster, the default
-- cluster is assumed.
dtCluster :: Lens' DescribeTasks (Maybe Text)
dtCluster = lens _dtCluster (\s a -> s { _dtCluster = a }) | 287 | dtCluster :: Lens' DescribeTasks (Maybe Text)
dtCluster = lens _dtCluster (\s a -> s { _dtCluster = a }) | 104 | dtCluster = lens _dtCluster (\s a -> s { _dtCluster = a }) | 58 | true | true | 0 | 9 | 54 | 48 | 27 | 21 | null | null |
23Skidoo/aeson | tests/DataFamilies/Encoders.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- SomeType encoders/decoders
--------------------------------------------------------------------------------
thSomeTypeToJSON2ElemArray :: SomeType c () Int -> Value
thSomeTypeToJSON2ElemArray = $(mkToJSON opts2ElemArray 'Nullary) | 314 | thSomeTypeToJSON2ElemArray :: SomeType c () Int -> Value
thSomeTypeToJSON2ElemArray = $(mkToJSON opts2ElemArray 'Nullary) | 121 | thSomeTypeToJSON2ElemArray = $(mkToJSON opts2ElemArray 'Nullary) | 64 | true | true | 0 | 7 | 18 | 37 | 20 | 17 | null | null |
hvr/containers | Data/Map/Base.hs | bsd-3-clause | -- | /O(n)/. Map a function over all values in the map.
--
-- > let f key x = (show key) ++ ":" ++ x
-- > mapWithKey f (fromList [(5,"a"), (3,"b")]) == fromList [(3, "3:b"), (5, "5:a")]
mapWithKey :: (k -> a -> b) -> Map k a -> Map k b
mapWithKey _ Tip = Tip | 259 | mapWithKey :: (k -> a -> b) -> Map k a -> Map k b
mapWithKey _ Tip = Tip | 72 | mapWithKey _ Tip = Tip | 22 | true | true | 0 | 9 | 59 | 54 | 27 | 27 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.