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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
acowley/ghc | libraries/template-haskell/Language/Haskell/TH/Ppr.hs | bsd-3-clause | pprFixity v (Fixity i d) = ppr_fix d <+> int i <+> ppr v
where ppr_fix InfixR = text "infixr"
ppr_fix InfixL = text "infixl"
ppr_fix InfixN = text "infix"
------------------------------ | 211 | pprFixity v (Fixity i d) = ppr_fix d <+> int i <+> ppr v
where ppr_fix InfixR = text "infixr"
ppr_fix InfixL = text "infixl"
ppr_fix InfixN = text "infix"
------------------------------ | 211 | pprFixity v (Fixity i d) = ppr_fix d <+> int i <+> ppr v
where ppr_fix InfixR = text "infixr"
ppr_fix InfixL = text "infixl"
ppr_fix InfixN = text "infix"
------------------------------ | 211 | false | false | 2 | 7 | 56 | 70 | 33 | 37 | null | null |
yupferris/write-you-a-haskell | chapter7/poly_constraints/src/Parser.hs | mit | parseExpr :: L.Text -> Either ParseError Expr
parseExpr input = parse (contents expr) "<stdin>" input | 101 | parseExpr :: L.Text -> Either ParseError Expr
parseExpr input = parse (contents expr) "<stdin>" input | 101 | parseExpr input = parse (contents expr) "<stdin>" input | 55 | false | true | 0 | 7 | 14 | 38 | 18 | 20 | null | null |
hjwylde/werewolf | src/Game/Werewolf/Player.hs | bsd-3-clause | -- | The traversal of 'orphan' 'Player's.
--
-- @
-- 'orphans' = 'traverse' . 'filtered' ('is' 'orphan')
-- @
orphans :: Traversable t => Traversal' (t Player) Player
orphans = traverse . filtered (is orphan) | 208 | orphans :: Traversable t => Traversal' (t Player) Player
orphans = traverse . filtered (is orphan) | 98 | orphans = traverse . filtered (is orphan) | 41 | true | true | 0 | 9 | 35 | 52 | 26 | 26 | null | null |
fmapfmapfmap/amazonka | amazonka-efs/gen/Network/AWS/EFS/Types.hs | mpl-2.0 | -- | Returned if 'IpAddress' was not specified in the request and there are
-- no free IP addresses in the subnet.
_NoFreeAddressesInSubnet :: AsError a => Getting (First ServiceError) a ServiceError
_NoFreeAddressesInSubnet =
_ServiceError . hasStatus 409 . hasCode "NoFreeAddressesInSubnet" | 296 | _NoFreeAddressesInSubnet :: AsError a => Getting (First ServiceError) a ServiceError
_NoFreeAddressesInSubnet =
_ServiceError . hasStatus 409 . hasCode "NoFreeAddressesInSubnet" | 181 | _NoFreeAddressesInSubnet =
_ServiceError . hasStatus 409 . hasCode "NoFreeAddressesInSubnet" | 96 | true | true | 2 | 9 | 44 | 55 | 24 | 31 | null | null |
deweyvm/starstats | src/StarStats/Parsers/ZNC.hs | mit | guessYear :: Int -> Integer
guessYear year
--irc didnt exist before the 80s i dont think...
| year < 80 = fromIntegral $ 2000 + year
| otherwise = fromIntegral $ 1900 + year | 189 | guessYear :: Int -> Integer
guessYear year
--irc didnt exist before the 80s i dont think...
| year < 80 = fromIntegral $ 2000 + year
| otherwise = fromIntegral $ 1900 + year | 188 | guessYear year
--irc didnt exist before the 80s i dont think...
| year < 80 = fromIntegral $ 2000 + year
| otherwise = fromIntegral $ 1900 + year | 160 | false | true | 1 | 8 | 49 | 53 | 26 | 27 | null | null |
ganeti-github-testing/ganeti-test-1 | src/Ganeti/HTools/Cluster.hs | bsd-2-clause | -- | Extracts the node pairs for an instance. This can fail if the
-- instance is single-homed. FIXME: this needs to be improved,
-- together with the general enhancement for handling non-DRBD moves.
instanceNodes :: Node.List -> Instance.Instance ->
(Ndx, Ndx, Node.Node, Node.Node)
instanceNodes nl inst =
let old_pdx = Instance.pNode inst
old_sdx = Instance.sNode inst
old_p = Container.find old_pdx nl
old_s = Container.find old_sdx nl
in (old_pdx, old_sdx, old_p, old_s) | 514 | instanceNodes :: Node.List -> Instance.Instance ->
(Ndx, Ndx, Node.Node, Node.Node)
instanceNodes nl inst =
let old_pdx = Instance.pNode inst
old_sdx = Instance.sNode inst
old_p = Container.find old_pdx nl
old_s = Container.find old_sdx nl
in (old_pdx, old_sdx, old_p, old_s) | 314 | instanceNodes nl inst =
let old_pdx = Instance.pNode inst
old_sdx = Instance.sNode inst
old_p = Container.find old_pdx nl
old_s = Container.find old_sdx nl
in (old_pdx, old_sdx, old_p, old_s) | 213 | true | true | 0 | 10 | 110 | 109 | 59 | 50 | null | null |
hemio-ev/libghc-acme | test/TestIntegration.hs | lgpl-3.0 | config :: JWK -> CragConfig
config jwk =
(newCragConfig confUrl jwk)
{cragConfigPollingInterval = 2, cragConfigRateLimitRetryAfter = 2} | 141 | config :: JWK -> CragConfig
config jwk =
(newCragConfig confUrl jwk)
{cragConfigPollingInterval = 2, cragConfigRateLimitRetryAfter = 2} | 141 | config jwk =
(newCragConfig confUrl jwk)
{cragConfigPollingInterval = 2, cragConfigRateLimitRetryAfter = 2} | 113 | false | true | 0 | 7 | 22 | 40 | 22 | 18 | null | null |
andrewMacmurray/haskell-book-solutions | src/ch8/numbersToWords.hs | mit | digitToWord :: Int -> String
digitToWord n =
case n of
0 -> "zero"
1 -> "one"
2 -> "two"
3 -> "three"
4 -> "four"
5 -> "five"
6 -> "six"
7 -> "seven"
8 -> "eight"
9 -> "nine"
_ -> "zero" | 232 | digitToWord :: Int -> String
digitToWord n =
case n of
0 -> "zero"
1 -> "one"
2 -> "two"
3 -> "three"
4 -> "four"
5 -> "five"
6 -> "six"
7 -> "seven"
8 -> "eight"
9 -> "nine"
_ -> "zero" | 232 | digitToWord n =
case n of
0 -> "zero"
1 -> "one"
2 -> "two"
3 -> "three"
4 -> "four"
5 -> "five"
6 -> "six"
7 -> "seven"
8 -> "eight"
9 -> "nine"
_ -> "zero" | 203 | false | true | 0 | 7 | 89 | 88 | 44 | 44 | null | null |
joelburget/haste-compiler | libraries/base-ghc-7.6/GHC/IO/Exception.hs | bsd-3-clause | -- | Raise an 'IOError' in the 'IO' monad.
ioError :: IOError -> IO a
ioError = ioException | 109 | ioError :: IOError -> IO a
ioError = ioException | 65 | ioError = ioException | 30 | true | true | 0 | 7 | 35 | 25 | 11 | 14 | null | null |
juhp/stack | test/integration/tests/git-submodules/Main.hs | bsd-3-clause | main :: IO ()
main = unless isWindows $ do
let
gitInit = do
runShell "git init ."
runShell "git config user.name Test"
runShell "git config user.email test@test.com"
runShell "git config commit.gpgsign false"
let withEmptyDir name inner = do
removeDirIgnore name
createDirectoryIfMissing True name
withCurrentDirectory name inner
withEmptyDir "tmpSubSubRepo" $ do
gitInit
stack ["new", "pkg ", defaultResolverArg]
runShell "git add pkg"
runShell "git commit -m SubSubCommit"
withEmptyDir "tmpSubRepo" $ do
gitInit
runShell "git submodule add ../tmpSubSubRepo sub"
runShell "git commit -a -m SubCommit"
withEmptyDir "tmpRepo" $ do
gitInit
runShell "git submodule add ../tmpSubRepo sub"
runShell "git commit -a -m Commit"
removeDirIgnore "tmpPackage"
stack ["new", defaultResolverArg, "tmpPackage"]
curDir <- getCurrentDirectory
let tmpRepoDir = curDir </> "tmpRepo"
gitHead <- runWithCwd tmpRepoDir "git" ["rev-parse", "HEAD"]
let gitHeadCommit = stripNewline gitHead
withCurrentDirectory "tmpPackage" $ do
-- add git dependency on repo with recursive submodules
writeToStackFile (tmpRepoDir, gitHeadCommit)
-- Setup the package
stack ["setup"]
-- cleanup
removeDirIgnore "tmpRepo"
removeDirIgnore "tmpSubRepo"
removeDirIgnore "tmpSubSubRepo"
removeDirIgnore "tmpPackage" | 1,502 | main :: IO ()
main = unless isWindows $ do
let
gitInit = do
runShell "git init ."
runShell "git config user.name Test"
runShell "git config user.email test@test.com"
runShell "git config commit.gpgsign false"
let withEmptyDir name inner = do
removeDirIgnore name
createDirectoryIfMissing True name
withCurrentDirectory name inner
withEmptyDir "tmpSubSubRepo" $ do
gitInit
stack ["new", "pkg ", defaultResolverArg]
runShell "git add pkg"
runShell "git commit -m SubSubCommit"
withEmptyDir "tmpSubRepo" $ do
gitInit
runShell "git submodule add ../tmpSubSubRepo sub"
runShell "git commit -a -m SubCommit"
withEmptyDir "tmpRepo" $ do
gitInit
runShell "git submodule add ../tmpSubRepo sub"
runShell "git commit -a -m Commit"
removeDirIgnore "tmpPackage"
stack ["new", defaultResolverArg, "tmpPackage"]
curDir <- getCurrentDirectory
let tmpRepoDir = curDir </> "tmpRepo"
gitHead <- runWithCwd tmpRepoDir "git" ["rev-parse", "HEAD"]
let gitHeadCommit = stripNewline gitHead
withCurrentDirectory "tmpPackage" $ do
-- add git dependency on repo with recursive submodules
writeToStackFile (tmpRepoDir, gitHeadCommit)
-- Setup the package
stack ["setup"]
-- cleanup
removeDirIgnore "tmpRepo"
removeDirIgnore "tmpSubRepo"
removeDirIgnore "tmpSubSubRepo"
removeDirIgnore "tmpPackage" | 1,502 | main = unless isWindows $ do
let
gitInit = do
runShell "git init ."
runShell "git config user.name Test"
runShell "git config user.email test@test.com"
runShell "git config commit.gpgsign false"
let withEmptyDir name inner = do
removeDirIgnore name
createDirectoryIfMissing True name
withCurrentDirectory name inner
withEmptyDir "tmpSubSubRepo" $ do
gitInit
stack ["new", "pkg ", defaultResolverArg]
runShell "git add pkg"
runShell "git commit -m SubSubCommit"
withEmptyDir "tmpSubRepo" $ do
gitInit
runShell "git submodule add ../tmpSubSubRepo sub"
runShell "git commit -a -m SubCommit"
withEmptyDir "tmpRepo" $ do
gitInit
runShell "git submodule add ../tmpSubRepo sub"
runShell "git commit -a -m Commit"
removeDirIgnore "tmpPackage"
stack ["new", defaultResolverArg, "tmpPackage"]
curDir <- getCurrentDirectory
let tmpRepoDir = curDir </> "tmpRepo"
gitHead <- runWithCwd tmpRepoDir "git" ["rev-parse", "HEAD"]
let gitHeadCommit = stripNewline gitHead
withCurrentDirectory "tmpPackage" $ do
-- add git dependency on repo with recursive submodules
writeToStackFile (tmpRepoDir, gitHeadCommit)
-- Setup the package
stack ["setup"]
-- cleanup
removeDirIgnore "tmpRepo"
removeDirIgnore "tmpSubRepo"
removeDirIgnore "tmpSubSubRepo"
removeDirIgnore "tmpPackage" | 1,488 | false | true | 0 | 13 | 390 | 313 | 131 | 182 | null | null |
ktvoelker/FLang | src/Util.hs | gpl-3.0 | mapFst :: (a -> c) -> (a, b) -> (c, b)
mapFst f (a, b) = (f a, b) | 65 | mapFst :: (a -> c) -> (a, b) -> (c, b)
mapFst f (a, b) = (f a, b) | 65 | mapFst f (a, b) = (f a, b) | 26 | false | true | 0 | 7 | 18 | 58 | 33 | 25 | null | null |
brunjlar/neural | src/Numeric/Neural/Pipes.hs | mit | -- | A 'Pipe' for training a model: It consumes mini-batches of samples from upstream and pushes
-- the updated training state downstream.
--
descentP :: (Foldable h, Monad m) =>
Model f g a b c -- ^ initial model
-> Int -- ^ first generation
-> (Int -> Double) -- ^ computes the learning rate from the generation
-> Pipe (h a) (TS f g a b c) m r
descentP m i f = loop m i where
loop m' i' = do
xs <- await
let !eta = f i'
let (e, m'') = descent m' eta xs
m'' `deepseq` yield TS
{ tsModel = m''
, tsGeneration = i'
, tsEta = eta
, tsBatchError = e
}
loop m'' (succ i')
-- | A simple 'Producer' of mini-batches. | 835 | descentP :: (Foldable h, Monad m) =>
Model f g a b c -- ^ initial model
-> Int -- ^ first generation
-> (Int -> Double) -- ^ computes the learning rate from the generation
-> Pipe (h a) (TS f g a b c) m r
descentP m i f = loop m i where
loop m' i' = do
xs <- await
let !eta = f i'
let (e, m'') = descent m' eta xs
m'' `deepseq` yield TS
{ tsModel = m''
, tsGeneration = i'
, tsEta = eta
, tsBatchError = e
}
loop m'' (succ i')
-- | A simple 'Producer' of mini-batches. | 691 | descentP m i f = loop m i where
loop m' i' = do
xs <- await
let !eta = f i'
let (e, m'') = descent m' eta xs
m'' `deepseq` yield TS
{ tsModel = m''
, tsGeneration = i'
, tsEta = eta
, tsBatchError = e
}
loop m'' (succ i')
-- | A simple 'Producer' of mini-batches. | 381 | true | true | 1 | 12 | 358 | 223 | 110 | 113 | null | null |
pikajude/melvin | src/Melvin/Client/Packet.hs | mit | -- | Error response packets
errNoNicknameGiven, errCantNick, errNeedMoreParams, errPasswordMismatch :: Text -> Packet
errNoNicknameGiven n = Packet hostname "431" [n, "No nickname given"] | 188 | errNoNicknameGiven, errCantNick, errNeedMoreParams, errPasswordMismatch :: Text -> Packet
errNoNicknameGiven n = Packet hostname "431" [n, "No nickname given"] | 160 | errNoNicknameGiven n = Packet hostname "431" [n, "No nickname given"] | 70 | true | true | 0 | 6 | 23 | 38 | 23 | 15 | null | null |
dmalikov/HaCh | nclient/NClient/Message/History.hs | mit | previous :: History -> History
previous h@(History _ 0 _) = h | 61 | previous :: History -> History
previous h@(History _ 0 _) = h | 61 | previous h@(History _ 0 _) = h | 30 | false | true | 0 | 8 | 11 | 31 | 16 | 15 | null | null |
blambo/accelerate-examples | tests/io/BlockCopy.hs | bsd-3-clause | testBlockCopyFromArrayInt16 :: IO ()
testBlockCopyFromArrayInt16 = do
let n = 50
let (arr :: Vector Int16) = fromList (Z:.n) [2 * P.fromIntegral x | x <- [0..n-1]]
ohi <- nInt16s (P.fromIntegral n)
toPtr arr ((), ohi)
b <- isFilledWithEvens16 ohi (P.fromIntegral n)
assertEqual "Not equal" 1 b | 307 | testBlockCopyFromArrayInt16 :: IO ()
testBlockCopyFromArrayInt16 = do
let n = 50
let (arr :: Vector Int16) = fromList (Z:.n) [2 * P.fromIntegral x | x <- [0..n-1]]
ohi <- nInt16s (P.fromIntegral n)
toPtr arr ((), ohi)
b <- isFilledWithEvens16 ohi (P.fromIntegral n)
assertEqual "Not equal" 1 b | 307 | testBlockCopyFromArrayInt16 = do
let n = 50
let (arr :: Vector Int16) = fromList (Z:.n) [2 * P.fromIntegral x | x <- [0..n-1]]
ohi <- nInt16s (P.fromIntegral n)
toPtr arr ((), ohi)
b <- isFilledWithEvens16 ohi (P.fromIntegral n)
assertEqual "Not equal" 1 b | 270 | false | true | 0 | 15 | 60 | 150 | 71 | 79 | null | null |
phischu/fragnix | builtins/base/GHC.Event.Array.hs | bsd-3-clause | duplicate :: Storable a => Array a -> IO (Array a)
duplicate a = dupHack undefined a
where
dupHack :: Storable b => b -> Array b -> IO (Array b)
dupHack dummy (Array ref) = do
AC es len cap <- readIORef ref
ary <- allocArray cap
withForeignPtr ary $ \dest ->
withForeignPtr es $ \src -> do
_ <- memcpy dest src (fromIntegral (len * sizeOf dummy))
return ()
Array `fmap` newIORef (AC ary len cap) | 438 | duplicate :: Storable a => Array a -> IO (Array a)
duplicate a = dupHack undefined a
where
dupHack :: Storable b => b -> Array b -> IO (Array b)
dupHack dummy (Array ref) = do
AC es len cap <- readIORef ref
ary <- allocArray cap
withForeignPtr ary $ \dest ->
withForeignPtr es $ \src -> do
_ <- memcpy dest src (fromIntegral (len * sizeOf dummy))
return ()
Array `fmap` newIORef (AC ary len cap) | 438 | duplicate a = dupHack undefined a
where
dupHack :: Storable b => b -> Array b -> IO (Array b)
dupHack dummy (Array ref) = do
AC es len cap <- readIORef ref
ary <- allocArray cap
withForeignPtr ary $ \dest ->
withForeignPtr es $ \src -> do
_ <- memcpy dest src (fromIntegral (len * sizeOf dummy))
return ()
Array `fmap` newIORef (AC ary len cap) | 387 | false | true | 0 | 19 | 120 | 207 | 95 | 112 | null | null |
SAdams601/HaRe | old/testing/generativeFold/GuardsIn4.hs | bsd-3-clause | mergeIt xs ys = (case (compare, xs, ys) of
(cmp, xs, []) -> xs
(cmp, [], ys) -> ys
(cmp, (x : xs), (y : ys))
| x `compare` y == GT -> y : (merge cmp (x : xs) ys)
| otherwise -> x : (merge cmp xs (y : ys))) | 327 | mergeIt xs ys = (case (compare, xs, ys) of
(cmp, xs, []) -> xs
(cmp, [], ys) -> ys
(cmp, (x : xs), (y : ys))
| x `compare` y == GT -> y : (merge cmp (x : xs) ys)
| otherwise -> x : (merge cmp xs (y : ys))) | 327 | mergeIt xs ys = (case (compare, xs, ys) of
(cmp, xs, []) -> xs
(cmp, [], ys) -> ys
(cmp, (x : xs), (y : ys))
| x `compare` y == GT -> y : (merge cmp (x : xs) ys)
| otherwise -> x : (merge cmp xs (y : ys))) | 327 | false | false | 0 | 14 | 173 | 157 | 86 | 71 | null | null |
ssaavedra/liquidhaskell | src/Language/Haskell/Liquid/Types.hs | bsd-3-clause | bkArrowDeep (RFun x t t' r) = let (xs, ts, rs, t'') = bkArrowDeep t' in (x:xs, t:ts, r:rs, t'') | 96 | bkArrowDeep (RFun x t t' r) = let (xs, ts, rs, t'') = bkArrowDeep t' in (x:xs, t:ts, r:rs, t'') | 96 | bkArrowDeep (RFun x t t' r) = let (xs, ts, rs, t'') = bkArrowDeep t' in (x:xs, t:ts, r:rs, t'') | 96 | false | false | 0 | 9 | 20 | 72 | 38 | 34 | null | null |
mgsloan/airship | src/Airship/Internal/Helpers.hs | mit | -- | Parse form data uploaded with a @Content-Type@ of either
-- @www-form-urlencoded@ or @multipart/form-data@ to return a
-- list of parameter names and values and a list of uploaded
-- files and their information.
parseFormData :: Request IO -> IO ([Param], [File LazyBS.ByteString])
parseFormData r = parseRequestBody lbsBackEnd (waiRequest r) | 347 | parseFormData :: Request IO -> IO ([Param], [File LazyBS.ByteString])
parseFormData r = parseRequestBody lbsBackEnd (waiRequest r) | 130 | parseFormData r = parseRequestBody lbsBackEnd (waiRequest r) | 60 | true | true | 0 | 11 | 50 | 60 | 31 | 29 | null | null |
chris-kahn/polymorphcms | src/Utils.hs | bsd-3-clause | --------------------------------------------------------------------------------
gFromText :: (Generic a, All (Equal '[]) (Code a)) => NP (K Text) (Code a) -> Text -> Either Text a
gFromText names n = case Map.lookup n table of
Just a -> Right a
Nothing -> Left $ "Failed to parse " <> n
where
table =
Map.fromList
(hcollapse
(hczipWith (Proxy :: Proxy (Equal '[]))
(\ (K n) (Fn c) -> K (n, to (SOP (unK (c Nil)))))
names injections
)
)
-------------------------------------------------------------------------------- | 599 | gFromText :: (Generic a, All (Equal '[]) (Code a)) => NP (K Text) (Code a) -> Text -> Either Text a
gFromText names n = case Map.lookup n table of
Just a -> Right a
Nothing -> Left $ "Failed to parse " <> n
where
table =
Map.fromList
(hcollapse
(hczipWith (Proxy :: Proxy (Equal '[]))
(\ (K n) (Fn c) -> K (n, to (SOP (unK (c Nil)))))
names injections
)
)
-------------------------------------------------------------------------------- | 518 | gFromText names n = case Map.lookup n table of
Just a -> Right a
Nothing -> Left $ "Failed to parse " <> n
where
table =
Map.fromList
(hcollapse
(hczipWith (Proxy :: Proxy (Equal '[]))
(\ (K n) (Fn c) -> K (n, to (SOP (unK (c Nil)))))
names injections
)
)
-------------------------------------------------------------------------------- | 418 | true | true | 4 | 20 | 156 | 215 | 108 | 107 | null | null |
AlexanderPankiv/ghc | compiler/main/DynFlags.hs | bsd-3-clause | removeWayDyn :: DynP ()
removeWayDyn = upd (\dfs -> dfs { ways = filter (WayDyn /=) (ways dfs) }) | 97 | removeWayDyn :: DynP ()
removeWayDyn = upd (\dfs -> dfs { ways = filter (WayDyn /=) (ways dfs) }) | 97 | removeWayDyn = upd (\dfs -> dfs { ways = filter (WayDyn /=) (ways dfs) }) | 73 | false | true | 0 | 12 | 18 | 56 | 28 | 28 | null | null |
pepeiborra/narradar | src/Narradar/Types/Problem/InitialGoal.hs | bsd-3-clause | -- ^ Graph of the reachable SCCs in the dep graph
fullgraph :: DGraph t v -> Graph
fullgraph = rulesGraph . pairs | 114 | fullgraph :: DGraph t v -> Graph
fullgraph = rulesGraph . pairs | 63 | fullgraph = rulesGraph . pairs | 30 | true | true | 0 | 7 | 23 | 32 | 14 | 18 | null | null |
DATX02-17-26/DATX02-17-26 | Test/Norm/ElimRedundantTest.hs | gpl-2.0 | allTests :: TestTree
allTests = normTestsDir "Norm.ElimRedundant" "elimredundant"
[normalizers, [normSingleton]] | 136 | allTests :: TestTree
allTests = normTestsDir "Norm.ElimRedundant" "elimredundant"
[normalizers, [normSingleton]] | 136 | allTests = normTestsDir "Norm.ElimRedundant" "elimredundant"
[normalizers, [normSingleton]] | 115 | false | true | 0 | 6 | 33 | 35 | 16 | 19 | null | null |
dysinger/amazonka | amazonka-ecs/gen/Network/AWS/ECS/ListClusters.hs | mpl-2.0 | -- | 'ListClusters' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'lcMaxResults' @::@ 'Maybe' 'Int'
--
-- * 'lcNextToken' @::@ 'Maybe' 'Text'
--
listClusters :: ListClusters
listClusters = ListClusters
{ _lcNextToken = Nothing
, _lcMaxResults = Nothing
} | 304 | listClusters :: ListClusters
listClusters = ListClusters
{ _lcNextToken = Nothing
, _lcMaxResults = Nothing
} | 122 | listClusters = ListClusters
{ _lcNextToken = Nothing
, _lcMaxResults = Nothing
} | 93 | true | true | 0 | 7 | 55 | 43 | 25 | 18 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_TEXTURE24 :: GLenum
gl_TEXTURE24 = 0x84D8 | 44 | gl_TEXTURE24 :: GLenum
gl_TEXTURE24 = 0x84D8 | 44 | gl_TEXTURE24 = 0x84D8 | 21 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
GaloisInc/DSA | src/Codec/Crypto/DSA/Exceptions.hs | bsd-3-clause | -- | Using an approved hash function -- at the point of writing, a SHA-2
-- variant -- generate values of p and q for use in DSA, for which p and
-- q have a very high probability of being prime. In addition to p and q,
-- this routine returns the "domain parameter seed" and "counter" used to
-- generate the primes. These can be supplied to later validation functions;
-- their secrecy is not required for the algorithm to work.
--
-- The inputs to the function are the DSA parameters we are generating a
-- key for, a source of entropy, the hash function to use, and (optionally)
-- the length of the domain parameter seed to use. The last item must be
-- greater to or later to the value of n, if supplied, and will be set to
-- (n + 8) if not.
--
-- The security of this method depends on the strength of the hash being
-- used. To that end, FIPS 140-2 requires a SHA-2 variant.
generateProbablePrimes :: CryptoRandomGen g =>
ParameterSizes ->
g ->
(ByteString -> ByteString) ->
Maybe Integer ->
(Integer,Integer, ProbablePrimesEvidence, g)
generateProbablePrimes p g h i =
throwLeft (Pure.generateProbablePrimes p g h i) | 1,259 | generateProbablePrimes :: CryptoRandomGen g =>
ParameterSizes ->
g ->
(ByteString -> ByteString) ->
Maybe Integer ->
(Integer,Integer, ProbablePrimesEvidence, g)
generateProbablePrimes p g h i =
throwLeft (Pure.generateProbablePrimes p g h i) | 375 | generateProbablePrimes p g h i =
throwLeft (Pure.generateProbablePrimes p g h i) | 83 | true | true | 0 | 10 | 339 | 97 | 57 | 40 | null | null |
antalsz/hs-to-coq | examples/graph/graph/Data/Graph/Inductive/Query/GVD.hs | mit | -- | Try to construct a path to/from a specified node to one of the
-- root nodes of the shortest path forest.
nearestPath :: Node -> Voronoi b -> Maybe Path
nearestPath v = fmap (map fst . unLPath) . maybePath v | 214 | nearestPath :: Node -> Voronoi b -> Maybe Path
nearestPath v = fmap (map fst . unLPath) . maybePath v | 101 | nearestPath v = fmap (map fst . unLPath) . maybePath v | 54 | true | true | 0 | 9 | 44 | 50 | 24 | 26 | null | null |
amccausl/Swish | Swish/HaskellRDF/RDFDatatypeXsdIntegerTest.hs | lgpl-2.1 | testVarModifyNe04 = testVmod2 "testVarModifyNe04"
(getDTMod dmodXsdIntegerNe rdfDatatypeValXsdInteger)
[makeBVI [("b","100")]]
[] | 193 | testVarModifyNe04 = testVmod2 "testVarModifyNe04"
(getDTMod dmodXsdIntegerNe rdfDatatypeValXsdInteger)
[makeBVI [("b","100")]]
[] | 193 | testVarModifyNe04 = testVmod2 "testVarModifyNe04"
(getDTMod dmodXsdIntegerNe rdfDatatypeValXsdInteger)
[makeBVI [("b","100")]]
[] | 193 | false | false | 0 | 9 | 73 | 40 | 21 | 19 | null | null |
onponomarev/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | cvError :: String
cvError = "ERROR" | 35 | cvError :: String
cvError = "ERROR" | 35 | cvError = "ERROR" | 17 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/truncate_1.hs | mit | properFractionR xv xw = properFractionR0 xv xw (properFractionVu30 xv xw) | 73 | properFractionR xv xw = properFractionR0 xv xw (properFractionVu30 xv xw) | 73 | properFractionR xv xw = properFractionR0 xv xw (properFractionVu30 xv xw) | 73 | false | false | 0 | 7 | 9 | 26 | 12 | 14 | null | null |
SASinestro/lil-render | src/LilRender/Color.hs | isc | scaleColor ∷ RGBColor → Double → RGBColor
scaleColor (RGBColor b g r) factor = RGBColor (round r') (round g') (round b')
where
factor' = max 0 $ min 1 factor
r' = factor' * fromIntegral r
g' = factor' * fromIntegral g
b' = factor' * fromIntegral b
-- | 287 | scaleColor ∷ RGBColor → Double → RGBColor
scaleColor (RGBColor b g r) factor = RGBColor (round r') (round g') (round b')
where
factor' = max 0 $ min 1 factor
r' = factor' * fromIntegral r
g' = factor' * fromIntegral g
b' = factor' * fromIntegral b
-- | 287 | scaleColor (RGBColor b g r) factor = RGBColor (round r') (round g') (round b')
where
factor' = max 0 $ min 1 factor
r' = factor' * fromIntegral r
g' = factor' * fromIntegral g
b' = factor' * fromIntegral b
-- | 245 | false | true | 9 | 10 | 85 | 139 | 58 | 81 | null | null |
tchagnon/cs636-raytracer | a6/Math.hs | apache-2.0 | -- Element extraction
v3x, v3y, v3z :: Vec3f -> RealT
v3x (Vec3f x _ _) = x | 75 | v3x, v3y, v3z :: Vec3f -> RealT
v3x (Vec3f x _ _) = x | 53 | v3x (Vec3f x _ _) = x | 21 | true | true | 0 | 7 | 16 | 33 | 19 | 14 | null | null |
dinkelk/redo | src/PrettyPrint.hs | mit | cyan :: String
cyan = "\x1b[36m" | 32 | cyan :: String
cyan = "\x1b[36m" | 32 | cyan = "\x1b[36m" | 17 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
erithion/duo-memo | Main.hs | mit | buildDictionary :: String -> ExceptT String IO (Dictionary)
buildDictionary fileName =
do
dict <- parseFromUtf8File file fileName
let res = Prelude.concat. map ( refer . extend) $ dict
return (foldr dictionary Map.empty res)
where extend :: Row -> [LanguagePair WordCard]
extend xs =
do
(lang, ys) <- xs
y <- ys
return (lang, y)
refer :: [ExtendedSection] -> [ReferredSection]
refer xs =
do
(xlang, xword) <- xs
return (xlang, (xword, filter (\(ylang, _)-> ylang /= xlang) xs))
dictionary :: ReferredSection -> Dictionary -> Dictionary
dictionary (lang, ((word, ident), ys)) dict =
do
let mp = [(ylang, yword) | (ylang, yword) <- ys]
let val = Map.singleton lang (Map.singleton word [Wd {vFrm = ident, vTr = mp}])
update' val dict $ \fs ss ->
update' fs ss $ (++)
update' map1 map2 fn = Map.unionWith fn map1 map2
-- ExceptT :: m (Either e a) -> ExceptT e m a
-- Except String IO a => IO $ (Either String a) | 1,186 | buildDictionary :: String -> ExceptT String IO (Dictionary)
buildDictionary fileName =
do
dict <- parseFromUtf8File file fileName
let res = Prelude.concat. map ( refer . extend) $ dict
return (foldr dictionary Map.empty res)
where extend :: Row -> [LanguagePair WordCard]
extend xs =
do
(lang, ys) <- xs
y <- ys
return (lang, y)
refer :: [ExtendedSection] -> [ReferredSection]
refer xs =
do
(xlang, xword) <- xs
return (xlang, (xword, filter (\(ylang, _)-> ylang /= xlang) xs))
dictionary :: ReferredSection -> Dictionary -> Dictionary
dictionary (lang, ((word, ident), ys)) dict =
do
let mp = [(ylang, yword) | (ylang, yword) <- ys]
let val = Map.singleton lang (Map.singleton word [Wd {vFrm = ident, vTr = mp}])
update' val dict $ \fs ss ->
update' fs ss $ (++)
update' map1 map2 fn = Map.unionWith fn map1 map2
-- ExceptT :: m (Either e a) -> ExceptT e m a
-- Except String IO a => IO $ (Either String a) | 1,186 | buildDictionary fileName =
do
dict <- parseFromUtf8File file fileName
let res = Prelude.concat. map ( refer . extend) $ dict
return (foldr dictionary Map.empty res)
where extend :: Row -> [LanguagePair WordCard]
extend xs =
do
(lang, ys) <- xs
y <- ys
return (lang, y)
refer :: [ExtendedSection] -> [ReferredSection]
refer xs =
do
(xlang, xword) <- xs
return (xlang, (xword, filter (\(ylang, _)-> ylang /= xlang) xs))
dictionary :: ReferredSection -> Dictionary -> Dictionary
dictionary (lang, ((word, ident), ys)) dict =
do
let mp = [(ylang, yword) | (ylang, yword) <- ys]
let val = Map.singleton lang (Map.singleton word [Wd {vFrm = ident, vTr = mp}])
update' val dict $ \fs ss ->
update' fs ss $ (++)
update' map1 map2 fn = Map.unionWith fn map1 map2
-- ExceptT :: m (Either e a) -> ExceptT e m a
-- Except String IO a => IO $ (Either String a) | 1,126 | false | true | 5 | 17 | 438 | 387 | 205 | 182 | null | null |
ckaestne/CIDE | other/CaseStudies/fgl/CIDEfgl/Data/Graph/Inductive/Example.hs | gpl-3.0 | dag3 = mkGraph (zip [1 .. 3] "abc") (labUEdges [(1, 3)]) | 56 | dag3 = mkGraph (zip [1 .. 3] "abc") (labUEdges [(1, 3)]) | 56 | dag3 = mkGraph (zip [1 .. 3] "abc") (labUEdges [(1, 3)]) | 56 | false | false | 0 | 9 | 10 | 40 | 22 | 18 | null | null |
markus1189/xmonad-contrib-710 | XMonad/Actions/Search.hs | bsd-3-clause | {- | Changes search engine's name -}
namedEngine :: Name -> SearchEngine -> SearchEngine
namedEngine name (SearchEngine _ site) = searchEngineF name site | 153 | namedEngine :: Name -> SearchEngine -> SearchEngine
namedEngine name (SearchEngine _ site) = searchEngineF name site | 116 | namedEngine name (SearchEngine _ site) = searchEngineF name site | 64 | true | true | 0 | 10 | 22 | 43 | 20 | 23 | null | null |
beijaflor-io/haskell-language-dockerfile | src/Language/Dockerfile/Rules.hs | gpl-3.0 | isAptGetInstall cmd = ["apt-get"] `isInfixOf` cmd && ["install"] `isInfixOf` cmd | 80 | isAptGetInstall cmd = ["apt-get"] `isInfixOf` cmd && ["install"] `isInfixOf` cmd | 80 | isAptGetInstall cmd = ["apt-get"] `isInfixOf` cmd && ["install"] `isInfixOf` cmd | 80 | false | false | 0 | 8 | 9 | 31 | 18 | 13 | null | null |
paldepind/wyas | Main.hs | mit | showVal (Number contents) = show contents | 41 | showVal (Number contents) = show contents | 41 | showVal (Number contents) = show contents | 41 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
khajavi/pandoc | src/Text/Pandoc/Writers/OpenDocument.hs | gpl-2.0 | plainToPara x = x | 17 | plainToPara x = x | 17 | plainToPara x = x | 17 | false | false | 0 | 4 | 3 | 9 | 4 | 5 | null | null |
markflorisson/hpack | testrepo/bytestring-0.10.2.0/Data/ByteString.hs | bsd-3-clause | {-
-- slower. but stays inside Haskell.
split _ (PS _ _ 0) = []
split (W8# w#) (PS fp off len) = splitWith' off len fp
where
splitWith' off' len' fp' = withPtr fp $ \p ->
splitLoop p 0 off' len' fp'
splitLoop :: Ptr Word8
-> Int -> Int -> Int
-> ForeignPtr Word8
-> IO [ByteString]
STRICT5(splitLoop)
splitLoop p idx' off' len' fp'
| idx' >= len' = return [PS fp' off' idx']
| otherwise = do
(W8# x#) <- peekElemOff p (off'+idx')
if word2Int# w# ==# word2Int# x#
then return (PS fp' off' idx' :
splitWith' (off'+idx'+1) (len'-idx'-1) fp')
else splitLoop p (idx'+1) off' len' fp'
-}
{-
-- | Like 'splitWith', except that sequences of adjacent separators are
-- treated as a single separator. eg.
--
-- > tokens (=='a') "aabbaca" == ["bb","c"]
--
tokens :: (Word8 -> Bool) -> ByteString -> [ByteString]
tokens f = P.filter (not.null) . splitWith f
{-# INLINE tokens #-}
-}
-- | The 'group' function takes a ByteString and returns a list of
-- ByteStrings such that the concatenation of the result is equal to the
-- argument. Moreover, each sublist in the result contains only equal
-- elements. For example,
--
-- > group "Mississippi" = ["M","i","ss","i","ss","i","pp","i"]
--
-- It is a special case of 'groupBy', which allows the programmer to
-- supply their own equality test. It is about 40% faster than
-- /groupBy (==)/
group :: ByteString -> [ByteString]
group xs
| null xs = []
| otherwise = ys : group zs
where
(ys, zs) = spanByte (unsafeHead xs) xs
-- | The 'groupBy' function is the non-overloaded version of 'group'. | 1,790 | group :: ByteString -> [ByteString]
group xs
| null xs = []
| otherwise = ys : group zs
where
(ys, zs) = spanByte (unsafeHead xs) xs
-- | The 'groupBy' function is the non-overloaded version of 'group'. | 225 | group xs
| null xs = []
| otherwise = ys : group zs
where
(ys, zs) = spanByte (unsafeHead xs) xs
-- | The 'groupBy' function is the non-overloaded version of 'group'. | 189 | true | true | 0 | 9 | 537 | 86 | 48 | 38 | null | null |
massysett/penny | penny/lib/Penny/Copper/Copperize.hs | bsd-3-clause | tracompriComment
:: Text
-> Accuerr (NonEmptySeq (TracompriError a)) (Comment Char ())
tracompriComment txt
= Lens.over Accuerr._AccFailure (NE.singleton . TracompriBadComment txt)
. cComment
$ txt | 207 | tracompriComment
:: Text
-> Accuerr (NonEmptySeq (TracompriError a)) (Comment Char ())
tracompriComment txt
= Lens.over Accuerr._AccFailure (NE.singleton . TracompriBadComment txt)
. cComment
$ txt | 207 | tracompriComment txt
= Lens.over Accuerr._AccFailure (NE.singleton . TracompriBadComment txt)
. cComment
$ txt | 116 | false | true | 3 | 11 | 33 | 81 | 37 | 44 | null | null |
SvenWille/Haskell99Pointfree | src/Haskell99Pointfree/P25.hs | bsd-3-clause | --using until
p25_1 :: [a] -> IO [a]
p25_1 = ( newStdGen <&> ) . ((view _2 . until condition nextStep) . ) . ap (,[],,) ( subtract 1 . length ) --first postition is the actual list , second is the new list ,
where --third contains the length and fourth will contain the "Gen"
condition = null . view _1
nextStep = over _3 (subtract 1) . join (( . snd) . set _4 . view (_1._2)). ( ap (liftA2 (++) . take) (drop. (+1)) . view (_1._1) >>= over (_2._1) ) . ( ((:) . liftA2 (!!) (view (_2._1) ) (view (_1._1))) >>= over (_2._2) ) . join ((,) . liftA2 (randomR . (0,)) (view _3) (view _4))
{-
--using take, nub and map
p25_2 :: [a] -> [a]
p25_2 =
-}
{-
--using foldl and nub
p25_3 :: [a] -> [a]
p25_3 =
-} | 832 | p25_1 :: [a] -> IO [a]
p25_1 = ( newStdGen <&> ) . ((view _2 . until condition nextStep) . ) . ap (,[],,) ( subtract 1 . length ) --first postition is the actual list , second is the new list ,
where --third contains the length and fourth will contain the "Gen"
condition = null . view _1
nextStep = over _3 (subtract 1) . join (( . snd) . set _4 . view (_1._2)). ( ap (liftA2 (++) . take) (drop. (+1)) . view (_1._1) >>= over (_2._1) ) . ( ((:) . liftA2 (!!) (view (_2._1) ) (view (_1._1))) >>= over (_2._2) ) . join ((,) . liftA2 (randomR . (0,)) (view _3) (view _4))
{-
--using take, nub and map
p25_2 :: [a] -> [a]
p25_2 =
-}
{-
--using foldl and nub
p25_3 :: [a] -> [a]
p25_3 =
-} | 818 | p25_1 = ( newStdGen <&> ) . ((view _2 . until condition nextStep) . ) . ap (,[],,) ( subtract 1 . length ) --first postition is the actual list , second is the new list ,
where --third contains the length and fourth will contain the "Gen"
condition = null . view _1
nextStep = over _3 (subtract 1) . join (( . snd) . set _4 . view (_1._2)). ( ap (liftA2 (++) . take) (drop. (+1)) . view (_1._1) >>= over (_2._1) ) . ( ((:) . liftA2 (!!) (view (_2._1) ) (view (_1._1))) >>= over (_2._2) ) . join ((,) . liftA2 (randomR . (0,)) (view _3) (view _4))
{-
--using take, nub and map
p25_2 :: [a] -> [a]
p25_2 =
-}
{-
--using foldl and nub
p25_3 :: [a] -> [a]
p25_3 =
-} | 795 | true | true | 0 | 15 | 280 | 317 | 171 | 146 | null | null |
olsner/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | emitPrimOp _ [res] PopCnt16Op [w] = emitPopCntCall res w W16 | 65 | emitPrimOp _ [res] PopCnt16Op [w] = emitPopCntCall res w W16 | 65 | emitPrimOp _ [res] PopCnt16Op [w] = emitPopCntCall res w W16 | 65 | false | false | 1 | 6 | 14 | 32 | 14 | 18 | null | null |
ekmett/containers | tests/map-properties.hs | bsd-3-clause | ----------------------------------------------------------------
-- Query
test_size :: Assertion
test_size = do
null (empty) @?= True
null (singleton 1 'a') @?= False | 185 | test_size :: Assertion
test_size = do
null (empty) @?= True
null (singleton 1 'a') @?= False | 110 | test_size = do
null (empty) @?= True
null (singleton 1 'a') @?= False | 87 | true | true | 0 | 10 | 37 | 51 | 23 | 28 | null | null |
unisonweb/platform | codebase2/codebase-sqlite/U/Codebase/Sqlite/Operations.hs | mit | lookupTextId :: EDB m => Text -> m Db.TextId
lookupTextId t =
Q.loadText t >>= \case
Just textId -> pure textId
Nothing -> throwError $ UnknownText t | 159 | lookupTextId :: EDB m => Text -> m Db.TextId
lookupTextId t =
Q.loadText t >>= \case
Just textId -> pure textId
Nothing -> throwError $ UnknownText t | 159 | lookupTextId t =
Q.loadText t >>= \case
Just textId -> pure textId
Nothing -> throwError $ UnknownText t | 114 | false | true | 0 | 10 | 36 | 66 | 30 | 36 | null | null |
da-x/ghc | libraries/base/GHC/Enum.hs | bsd-3-clause | dn_fb :: (Integer -> a -> a) -> a -> Integer -> Integer -> Integer -> a
dn_fb c n x0 delta lim = go (x0 :: Integer)
where
go x | x < lim = n
| otherwise = x `c` go (x+delta) | 250 | dn_fb :: (Integer -> a -> a) -> a -> Integer -> Integer -> Integer -> a
dn_fb c n x0 delta lim = go (x0 :: Integer)
where
go x | x < lim = n
| otherwise = x `c` go (x+delta) | 250 | dn_fb c n x0 delta lim = go (x0 :: Integer)
where
go x | x < lim = n
| otherwise = x `c` go (x+delta) | 178 | false | true | 0 | 11 | 120 | 111 | 55 | 56 | null | null |
fffej/sql-server-gen | src/Database/SqlServer/Create/User.hs | bsd-2-clause | renderCertificate :: Certificate -> Doc
renderCertificate c = text "CERTIFICATE" <+>
renderRegularIdentifier (certificateName c) | 150 | renderCertificate :: Certificate -> Doc
renderCertificate c = text "CERTIFICATE" <+>
renderRegularIdentifier (certificateName c) | 150 | renderCertificate c = text "CERTIFICATE" <+>
renderRegularIdentifier (certificateName c) | 110 | false | true | 0 | 8 | 35 | 34 | 16 | 18 | null | null |
myuon/haste-jQuery | Haste/JQuery.hs | mit | jtype :: JSAny -> IO String
jtype = ffi "(function(a){ return jQuery.type(a); })" | 81 | jtype :: JSAny -> IO String
jtype = ffi "(function(a){ return jQuery.type(a); })" | 81 | jtype = ffi "(function(a){ return jQuery.type(a); })" | 53 | false | true | 0 | 6 | 12 | 21 | 10 | 11 | null | null |
sasamil/Queens | queens8.hs | gpl-3.0 | -------------------------------------------------------
-- are two queens in same diagonal
diagrelate :: Pos -> Pos -> Bool
diagrelate a b = fst a - fst b == snd a - snd b || fst a - fst b == snd b - snd a | 208 | diagrelate :: Pos -> Pos -> Bool
diagrelate a b = fst a - fst b == snd a - snd b || fst a - fst b == snd b - snd a | 114 | diagrelate a b = fst a - fst b == snd a - snd b || fst a - fst b == snd b - snd a | 81 | true | true | 3 | 10 | 44 | 85 | 37 | 48 | null | null |
SumAll/haskell-eureka-client | src/Network/Eureka/Connection.hs | apache-2.0 | eConnInstanceInfo :: EurekaConnection -> InstanceStatus -> InstanceInfo
eConnInstanceInfo eConn@EurekaConnection {
eConnDataCenterInfo
, eConnInstanceConfig = InstanceConfig {
instanceAppName
, instanceNonSecurePort
, instanceSecurePort
, instanceMetadata
}
} status = InstanceInfo {
instanceInfoHostName = eConnPublicHostname eConn
, instanceInfoAppName = instanceAppName
, instanceInfoIpAddr = eConnPublicIpv4 eConn
, instanceInfoVipAddr = eConnVirtualHostname eConn
, instanceInfoSecureVipAddr = eConnSecureVirtualHostname eConn
, instanceInfoStatus = status
, instanceInfoPort = instanceNonSecurePort
, instanceInfoSecurePort = instanceSecurePort
, instanceInfoHomePageUrl = Just $ eConnHomePageUrl eConn
, instanceInfoStatusPageUrl = Just $ eConnStatusPageUrl eConn
, instanceInfoDataCenterInfo = eConnDataCenterInfo
, instanceInfoMetadata = instanceMetadata
, instanceInfoIsCoordinatingDiscoveryServer = False
} | 1,031 | eConnInstanceInfo :: EurekaConnection -> InstanceStatus -> InstanceInfo
eConnInstanceInfo eConn@EurekaConnection {
eConnDataCenterInfo
, eConnInstanceConfig = InstanceConfig {
instanceAppName
, instanceNonSecurePort
, instanceSecurePort
, instanceMetadata
}
} status = InstanceInfo {
instanceInfoHostName = eConnPublicHostname eConn
, instanceInfoAppName = instanceAppName
, instanceInfoIpAddr = eConnPublicIpv4 eConn
, instanceInfoVipAddr = eConnVirtualHostname eConn
, instanceInfoSecureVipAddr = eConnSecureVirtualHostname eConn
, instanceInfoStatus = status
, instanceInfoPort = instanceNonSecurePort
, instanceInfoSecurePort = instanceSecurePort
, instanceInfoHomePageUrl = Just $ eConnHomePageUrl eConn
, instanceInfoStatusPageUrl = Just $ eConnStatusPageUrl eConn
, instanceInfoDataCenterInfo = eConnDataCenterInfo
, instanceInfoMetadata = instanceMetadata
, instanceInfoIsCoordinatingDiscoveryServer = False
} | 1,031 | eConnInstanceInfo eConn@EurekaConnection {
eConnDataCenterInfo
, eConnInstanceConfig = InstanceConfig {
instanceAppName
, instanceNonSecurePort
, instanceSecurePort
, instanceMetadata
}
} status = InstanceInfo {
instanceInfoHostName = eConnPublicHostname eConn
, instanceInfoAppName = instanceAppName
, instanceInfoIpAddr = eConnPublicIpv4 eConn
, instanceInfoVipAddr = eConnVirtualHostname eConn
, instanceInfoSecureVipAddr = eConnSecureVirtualHostname eConn
, instanceInfoStatus = status
, instanceInfoPort = instanceNonSecurePort
, instanceInfoSecurePort = instanceSecurePort
, instanceInfoHomePageUrl = Just $ eConnHomePageUrl eConn
, instanceInfoStatusPageUrl = Just $ eConnStatusPageUrl eConn
, instanceInfoDataCenterInfo = eConnDataCenterInfo
, instanceInfoMetadata = instanceMetadata
, instanceInfoIsCoordinatingDiscoveryServer = False
} | 959 | false | true | 0 | 8 | 204 | 160 | 93 | 67 | null | null |
vincenthz/hs-foundation | foundation/Foundation/Network/IPv6.hs | bsd-3-clause | -- | serialise to human readable IPv6
--
-- >>> toString (fromString "0:0:0:0:0:0:0:1" :: IPv6)
toString :: IPv6 -> String
toString = fromList . toLString | 154 | toString :: IPv6 -> String
toString = fromList . toLString | 58 | toString = fromList . toLString | 31 | true | true | 0 | 5 | 24 | 22 | 13 | 9 | null | null |
da-x/lamdu | Lamdu/GUI/ExpressionGui/Types.hs | gpl-3.0 | egWidget ::
Lens
(ExpressionGui m)
(ExpressionGui n)
(Widget (T m Widget.EventResult))
(Widget (T n Widget.EventResult))
egWidget = Layout.widget | 165 | egWidget ::
Lens
(ExpressionGui m)
(ExpressionGui n)
(Widget (T m Widget.EventResult))
(Widget (T n Widget.EventResult))
egWidget = Layout.widget | 165 | egWidget = Layout.widget | 24 | false | true | 2 | 9 | 37 | 76 | 33 | 43 | null | null |
minoki/LambdaQuest | src/LambdaQuest/SystemFsub/Coercion.hs | bsd-3-clause | coercionFrom :: Coercion -> Type
coercionFrom (CCoercionSeries _ ty) = ty | 73 | coercionFrom :: Coercion -> Type
coercionFrom (CCoercionSeries _ ty) = ty | 73 | coercionFrom (CCoercionSeries _ ty) = ty | 40 | false | true | 0 | 7 | 10 | 26 | 13 | 13 | null | null |
ak1t0/48hscheme | Parser.hs | mit | parseString :: Parser SchemeData
parseString = do
char '"'
x <- many1 (escapedChar <|> noneOf "\"")
char '"'
return $ String x
-- Scheme Symbol
-- a-z , A-Z, 0-9, _ | 181 | parseString :: Parser SchemeData
parseString = do
char '"'
x <- many1 (escapedChar <|> noneOf "\"")
char '"'
return $ String x
-- Scheme Symbol
-- a-z , A-Z, 0-9, _ | 181 | parseString = do
char '"'
x <- many1 (escapedChar <|> noneOf "\"")
char '"'
return $ String x
-- Scheme Symbol
-- a-z , A-Z, 0-9, _ | 148 | false | true | 0 | 12 | 47 | 64 | 27 | 37 | null | null |
brendanhay/gogol | gogol-analytics/gen/Network/Google/Analytics/Types/Product.hs | mpl-2.0 | -- | Defines the conditions to include users to the audience.
rasbadIncludeConditions :: Lens' RemarketingAudienceStateBasedAudienceDefinition (Maybe IncludeConditions)
rasbadIncludeConditions
= lens _rasbadIncludeConditions
(\ s a -> s{_rasbadIncludeConditions = a}) | 275 | rasbadIncludeConditions :: Lens' RemarketingAudienceStateBasedAudienceDefinition (Maybe IncludeConditions)
rasbadIncludeConditions
= lens _rasbadIncludeConditions
(\ s a -> s{_rasbadIncludeConditions = a}) | 213 | rasbadIncludeConditions
= lens _rasbadIncludeConditions
(\ s a -> s{_rasbadIncludeConditions = a}) | 106 | true | true | 0 | 9 | 35 | 48 | 25 | 23 | null | null |
kim/kafka-protocol | src/Network/Kafka/Protocol/Fetch.hs | mpl-2.0 | minBytes :: Proxy FMinBytes
minBytes = Proxy | 44 | minBytes :: Proxy FMinBytes
minBytes = Proxy | 44 | minBytes = Proxy | 16 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
dcreager/cabal | Distribution/Version.hs | bsd-3-clause | -- | The version range @>= v1 && <= v2@.
--
-- In practice this is not very useful because we normally use inclusive lower
-- bounds and exclusive upper bounds.
--
-- > withinRange v' (laterVersion v) = v' > v
--
betweenVersionsInclusive :: Version -> Version -> VersionRange
betweenVersionsInclusive v1 v2 =
IntersectVersionRanges (orLaterVersion v1) (orEarlierVersion v2) | 375 | betweenVersionsInclusive :: Version -> Version -> VersionRange
betweenVersionsInclusive v1 v2 =
IntersectVersionRanges (orLaterVersion v1) (orEarlierVersion v2) | 162 | betweenVersionsInclusive v1 v2 =
IntersectVersionRanges (orLaterVersion v1) (orEarlierVersion v2) | 99 | true | true | 0 | 7 | 60 | 48 | 27 | 21 | null | null |
s3rvac/blog | cs-2010-07-06-hledani-cesty-z-bludiste-v-haskellu/Main.hs | bsd-3-clause | {-|
Finds a way through the selected maze.
Returns Just Maze if some way was found, Nothing otherwise.
-}
findWayThrough :: Maze -> Maybe Maze
findWayThrough maze = solveMaze maze i j
where (i, j) = findStart maze
{-|
Finds a place (i, j) from which the maze solving
has to start.
This is the place up, down, right, or left
to the start cell.
-} | 376 | findWayThrough :: Maze -> Maybe Maze
findWayThrough maze = solveMaze maze i j
where (i, j) = findStart maze
{-|
Finds a place (i, j) from which the maze solving
has to start.
This is the place up, down, right, or left
to the start cell.
-} | 261 | findWayThrough maze = solveMaze maze i j
where (i, j) = findStart maze
{-|
Finds a place (i, j) from which the maze solving
has to start.
This is the place up, down, right, or left
to the start cell.
-} | 224 | true | true | 0 | 6 | 96 | 47 | 24 | 23 | null | null |
gergoerdi/sstg | src/Language/SSTG/GHC/CompileToSTG.hs | bsd-3-clause | parseAndTypecheck :: (GhcMonad m) => ModSummary -> m DesugaredModule
parseAndTypecheck mod = parseModule mod >>= typecheckModule >>= desugarModule | 146 | parseAndTypecheck :: (GhcMonad m) => ModSummary -> m DesugaredModule
parseAndTypecheck mod = parseModule mod >>= typecheckModule >>= desugarModule | 146 | parseAndTypecheck mod = parseModule mod >>= typecheckModule >>= desugarModule | 77 | false | true | 0 | 7 | 17 | 41 | 20 | 21 | null | null |
urbanslug/ghc | testsuite/tests/rename/should_compile/timing003.hs | bsd-3-clause | a496 = [] | 9 | a496 = [] | 9 | a496 = [] | 9 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
ghorn/dynobud | dynobud/src/Dyno/View/M.hs | lgpl-3.0 | hsplitTrip ::
forall f g h j a .
(View f, View g, View h, View j, CMatrix a)
=> M f (JTriple g h j) a -> (M f g a, M f h a, M f j a)
hsplitTrip (UnsafeM x) =
case V.toList (CM.horzsplit x ncs) of
[g,h,j] -> (mkM g, mkM h, mkM j)
n -> error $ "hsplitTrip made a bad split with length " ++ show (length n)
where
ng = size (Proxy :: Proxy g)
nh = size (Proxy :: Proxy h)
nj = size (Proxy :: Proxy j)
ncs = V.fromList [0,ng,ng+nh,ng+nh+nj] | 469 | hsplitTrip ::
forall f g h j a .
(View f, View g, View h, View j, CMatrix a)
=> M f (JTriple g h j) a -> (M f g a, M f h a, M f j a)
hsplitTrip (UnsafeM x) =
case V.toList (CM.horzsplit x ncs) of
[g,h,j] -> (mkM g, mkM h, mkM j)
n -> error $ "hsplitTrip made a bad split with length " ++ show (length n)
where
ng = size (Proxy :: Proxy g)
nh = size (Proxy :: Proxy h)
nj = size (Proxy :: Proxy j)
ncs = V.fromList [0,ng,ng+nh,ng+nh+nj] | 469 | hsplitTrip (UnsafeM x) =
case V.toList (CM.horzsplit x ncs) of
[g,h,j] -> (mkM g, mkM h, mkM j)
n -> error $ "hsplitTrip made a bad split with length " ++ show (length n)
where
ng = size (Proxy :: Proxy g)
nh = size (Proxy :: Proxy h)
nj = size (Proxy :: Proxy j)
ncs = V.fromList [0,ng,ng+nh,ng+nh+nj] | 330 | false | true | 2 | 11 | 133 | 284 | 144 | 140 | null | null |
fredcy/elm-format | parser/src/Parse/Helpers.hs | bsd-3-clause | lowVar :: IParser String
lowVar =
makeVar lower <?> "a lower case name" | 73 | lowVar :: IParser String
lowVar =
makeVar lower <?> "a lower case name" | 73 | lowVar =
makeVar lower <?> "a lower case name" | 48 | false | true | 0 | 6 | 14 | 21 | 10 | 11 | null | null |
radekm/crep | Core/Matcher.hs | bsd-3-clause | toBinSearchMatcher :: (U.IArray UArray a, Symbol a)
=> DFA a -> BinSearchMatcher a
toBinSearchMatcher dfa
= BSM (fmap (listsToTransTab . unzip . toList . sdTrans) dfa)
(fmap sdMatches dfa)
(fmap sdMatchPrio dfa)
(fmap sdReachablePrio dfa)
where
listsToTransTab (sts, symbols) = (U.listArray bnds symbols,
U.listArray bnds sts)
where
bnds = (0, pred $ length symbols)
-- ---------------------------------------------------------------------------
-- Alphabet compression.
--
-- We use algorithm described in article
-- "Efficient Signature Matching with Multiple Alphabet Compression Tables"
-- by Shijin Kong, Randy Smith and Cristian Estan
-- | Translation of symbols. | 774 | toBinSearchMatcher :: (U.IArray UArray a, Symbol a)
=> DFA a -> BinSearchMatcher a
toBinSearchMatcher dfa
= BSM (fmap (listsToTransTab . unzip . toList . sdTrans) dfa)
(fmap sdMatches dfa)
(fmap sdMatchPrio dfa)
(fmap sdReachablePrio dfa)
where
listsToTransTab (sts, symbols) = (U.listArray bnds symbols,
U.listArray bnds sts)
where
bnds = (0, pred $ length symbols)
-- ---------------------------------------------------------------------------
-- Alphabet compression.
--
-- We use algorithm described in article
-- "Efficient Signature Matching with Multiple Alphabet Compression Tables"
-- by Shijin Kong, Randy Smith and Cristian Estan
-- | Translation of symbols. | 774 | toBinSearchMatcher dfa
= BSM (fmap (listsToTransTab . unzip . toList . sdTrans) dfa)
(fmap sdMatches dfa)
(fmap sdMatchPrio dfa)
(fmap sdReachablePrio dfa)
where
listsToTransTab (sts, symbols) = (U.listArray bnds symbols,
U.listArray bnds sts)
where
bnds = (0, pred $ length symbols)
-- ---------------------------------------------------------------------------
-- Alphabet compression.
--
-- We use algorithm described in article
-- "Efficient Signature Matching with Multiple Alphabet Compression Tables"
-- by Shijin Kong, Randy Smith and Cristian Estan
-- | Translation of symbols. | 672 | false | true | 1 | 10 | 194 | 176 | 87 | 89 | null | null |
duplode/stack | src/Stack/Dot.hs | bsd-3-clause | -- | Print an edge between the two package names
printEdge :: MonadIO m => PackageName -> PackageName -> m ()
printEdge from to = liftIO $ Text.putStrLn (Text.concat [ nodeName from, " -> ", nodeName to, ";"]) | 209 | printEdge :: MonadIO m => PackageName -> PackageName -> m ()
printEdge from to = liftIO $ Text.putStrLn (Text.concat [ nodeName from, " -> ", nodeName to, ";"]) | 160 | printEdge from to = liftIO $ Text.putStrLn (Text.concat [ nodeName from, " -> ", nodeName to, ";"]) | 99 | true | true | 0 | 10 | 37 | 72 | 36 | 36 | null | null |
quickdudley/phaser | Codec/Phaser/Common.hs | bsd-3-clause | -- | sepBy1 p sep parses one or more occurrences of p, separated by sep. Returns
-- a list of values returned by p.
sepBy1 :: Monoid p => Phase p i o a -> Phase p i o s -> Phase p i o [a]
sepBy1 p sep = ((:) <$> p <*> many (sep >> p)) | 234 | sepBy1 :: Monoid p => Phase p i o a -> Phase p i o s -> Phase p i o [a]
sepBy1 p sep = ((:) <$> p <*> many (sep >> p)) | 118 | sepBy1 p sep = ((:) <$> p <*> many (sep >> p)) | 46 | true | true | 0 | 10 | 57 | 91 | 45 | 46 | null | null |
raichoo/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | getArgs _ r = ([], r) | 21 | getArgs _ r = ([], r) | 21 | getArgs _ r = ([], r) | 21 | false | false | 1 | 7 | 5 | 20 | 10 | 10 | null | null |
ezyang/ghc | compiler/main/TidyPgm.hs | bsd-3-clause | getClassImplicitBinds :: Class -> [CoreBind]
getClassImplicitBinds cls
= [ NonRec op (mkDictSelRhs cls val_index)
| (op, val_index) <- classAllSelIds cls `zip` [0..] ] | 173 | getClassImplicitBinds :: Class -> [CoreBind]
getClassImplicitBinds cls
= [ NonRec op (mkDictSelRhs cls val_index)
| (op, val_index) <- classAllSelIds cls `zip` [0..] ] | 173 | getClassImplicitBinds cls
= [ NonRec op (mkDictSelRhs cls val_index)
| (op, val_index) <- classAllSelIds cls `zip` [0..] ] | 128 | false | true | 0 | 9 | 28 | 63 | 34 | 29 | null | null |
snapframework/io-streams | test/System/IO/Streams/Tests/Combinators.hs | bsd-3-clause | testUnzip :: Test
testUnzip = testCase "combinators/unzip" $ do
let l1 = [1 .. 10 :: Int]
l2 = [2 .. 10 :: Int]
l = Prelude.zip l1 l2
(is1, is2) <- fromList l >>= unzip
toList is1 >>= assertEqual "unzip1-a" (fst $ Prelude.unzip l)
toList is2 >>= assertEqual "unzip1-b" (snd $ Prelude.unzip l)
read is1 >>= assertEqual "unzip1-read-a" Nothing
read is2 >>= assertEqual "unzip1-read-b" Nothing
(is3, is4) <- fromList l >>= unzip
toList is4 >>= assertEqual "unzip2-b" (snd $ Prelude.unzip l)
toList is3 >>= assertEqual "unzip2-a" (fst $ Prelude.unzip l)
read is4 >>= assertEqual "unzip2-read-b" Nothing
read is3 >>= assertEqual "unzip2-read" Nothing
------------------------------------------------------------------------------ | 789 | testUnzip :: Test
testUnzip = testCase "combinators/unzip" $ do
let l1 = [1 .. 10 :: Int]
l2 = [2 .. 10 :: Int]
l = Prelude.zip l1 l2
(is1, is2) <- fromList l >>= unzip
toList is1 >>= assertEqual "unzip1-a" (fst $ Prelude.unzip l)
toList is2 >>= assertEqual "unzip1-b" (snd $ Prelude.unzip l)
read is1 >>= assertEqual "unzip1-read-a" Nothing
read is2 >>= assertEqual "unzip1-read-b" Nothing
(is3, is4) <- fromList l >>= unzip
toList is4 >>= assertEqual "unzip2-b" (snd $ Prelude.unzip l)
toList is3 >>= assertEqual "unzip2-a" (fst $ Prelude.unzip l)
read is4 >>= assertEqual "unzip2-read-b" Nothing
read is3 >>= assertEqual "unzip2-read" Nothing
------------------------------------------------------------------------------ | 789 | testUnzip = testCase "combinators/unzip" $ do
let l1 = [1 .. 10 :: Int]
l2 = [2 .. 10 :: Int]
l = Prelude.zip l1 l2
(is1, is2) <- fromList l >>= unzip
toList is1 >>= assertEqual "unzip1-a" (fst $ Prelude.unzip l)
toList is2 >>= assertEqual "unzip1-b" (snd $ Prelude.unzip l)
read is1 >>= assertEqual "unzip1-read-a" Nothing
read is2 >>= assertEqual "unzip1-read-b" Nothing
(is3, is4) <- fromList l >>= unzip
toList is4 >>= assertEqual "unzip2-b" (snd $ Prelude.unzip l)
toList is3 >>= assertEqual "unzip2-a" (fst $ Prelude.unzip l)
read is4 >>= assertEqual "unzip2-read-b" Nothing
read is3 >>= assertEqual "unzip2-read" Nothing
------------------------------------------------------------------------------ | 771 | false | true | 0 | 13 | 168 | 271 | 127 | 144 | null | null |
snowleopard/alga | src/Algebra/Graph/Labelled/AdjacencyMap.hs | mit | -- | The number of vertices in a graph.
-- Complexity: /O(1)/ time.
--
-- @
-- vertexCount 'empty' == 0
-- vertexCount ('vertex' x) == 1
-- vertexCount == 'length' . 'vertexList'
-- vertexCount x \< vertexCount y ==> x \< y
-- @
vertexCount :: AdjacencyMap e a -> Int
vertexCount = Map.size . adjacencyMap | 345 | vertexCount :: AdjacencyMap e a -> Int
vertexCount = Map.size . adjacencyMap | 76 | vertexCount = Map.size . adjacencyMap | 37 | true | true | 1 | 7 | 96 | 43 | 23 | 20 | null | null |
phillipm/mlish-to-llvm | src/MSyntax.hs | bsd-3-clause | mExprPrinter MUnit = dullcyan $ text "<>" | 41 | mExprPrinter MUnit = dullcyan $ text "<>" | 41 | mExprPrinter MUnit = dullcyan $ text "<>" | 41 | false | false | 1 | 6 | 6 | 19 | 7 | 12 | null | null |
roberth/uu-helium | test/correct/EscapeInString.hs | gpl-3.0 | f "abc\ndef" = 3 | 16 | f "abc\ndef" = 3 | 16 | f "abc\ndef" = 3 | 16 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
dblia/nosql-ganeti | test/hs/Test/Ganeti/Query/Query.hs | gpl-2.0 | checkResultType :: FieldDefinition -> ResultEntry -> Property
checkResultType _ (ResultEntry RSNormal Nothing) =
failTest "Nothing result in RSNormal field" | 158 | checkResultType :: FieldDefinition -> ResultEntry -> Property
checkResultType _ (ResultEntry RSNormal Nothing) =
failTest "Nothing result in RSNormal field" | 158 | checkResultType _ (ResultEntry RSNormal Nothing) =
failTest "Nothing result in RSNormal field" | 96 | false | true | 0 | 10 | 20 | 41 | 18 | 23 | null | null |
martin-kolinek/stack | src/Stack/Build/ConstructPlan.hs | bsd-3-clause | addEllipsis :: Text -> Text
addEllipsis t
| T.length t < 100 = t
| otherwise = T.take 97 t <> "..." | 107 | addEllipsis :: Text -> Text
addEllipsis t
| T.length t < 100 = t
| otherwise = T.take 97 t <> "..." | 107 | addEllipsis t
| T.length t < 100 = t
| otherwise = T.take 97 t <> "..." | 79 | false | true | 1 | 10 | 29 | 52 | 24 | 28 | null | null |
jstolarek/ghc | libraries/base/Data/OldList.hs | bsd-3-clause | -- | The 'zip7' function takes seven lists and returns a list of
-- seven-tuples, analogous to 'zip'.
zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] ->
[g] -> [(a,b,c,d,e,f,g)]
zip7 = zipWith7 (,,,,,,) | 270 | zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] ->
[g] -> [(a,b,c,d,e,f,g)]
zip7 = zipWith7 (,,,,,,) | 168 | zip7 = zipWith7 (,,,,,,) | 44 | true | true | 0 | 13 | 107 | 97 | 60 | 37 | null | null |
mettekou/ghc | compiler/prelude/THNames.hs | bsd-3-clause | phantomRIdKey = mkPreludeMiscIdUnique 406 | 50 | phantomRIdKey = mkPreludeMiscIdUnique 406 | 50 | phantomRIdKey = mkPreludeMiscIdUnique 406 | 50 | false | false | 0 | 5 | 12 | 9 | 4 | 5 | null | null |
kuribas/hmetafont | Typography/HMetafont.hs | bsd-3-clause | z10 = Point x10 y10 | 19 | z10 = Point x10 y10 | 19 | z10 = Point x10 y10 | 19 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
shnarazk/mios | MultiConflict/SAT/Mios/Solver.hs | gpl-3.0 | valueLit :: Solver -> Lit -> IO Int
valueLit (assigns -> a) p = (\x -> if positiveLit p then x else negate x) <$!> getNth a (lit2var p) | 135 | valueLit :: Solver -> Lit -> IO Int
valueLit (assigns -> a) p = (\x -> if positiveLit p then x else negate x) <$!> getNth a (lit2var p) | 135 | valueLit (assigns -> a) p = (\x -> if positiveLit p then x else negate x) <$!> getNth a (lit2var p) | 99 | false | true | 0 | 9 | 28 | 71 | 36 | 35 | null | null |
kallisti-dev/hs-webdriver | src/Test/WebDriver/Commands/Internal.hs | bsd-3-clause | currentWindow :: WindowHandle
currentWindow = WindowHandle "current" | 68 | currentWindow :: WindowHandle
currentWindow = WindowHandle "current" | 68 | currentWindow = WindowHandle "current" | 38 | false | true | 0 | 6 | 6 | 21 | 8 | 13 | null | null |
GaloisInc/halvm-ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | monadFixClassKey :: Unique
monadFixClassKey = mkPreludeClassUnique 28 | 76 | monadFixClassKey :: Unique
monadFixClassKey = mkPreludeClassUnique 28 | 76 | monadFixClassKey = mkPreludeClassUnique 28 | 49 | false | true | 0 | 6 | 13 | 20 | 8 | 12 | null | null |
osa1/fast-tags | src/FastTags.hs | bsd-3-clause | tokToOpName ExclamationMark = Just "!" | 38 | tokToOpName ExclamationMark = Just "!" | 38 | tokToOpName ExclamationMark = Just "!" | 38 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
AlexanderPankiv/ghc | compiler/typecheck/TcEvidence.hs | bsd-3-clause | (<.>) :: HsWrapper -> HsWrapper -> HsWrapper
WpHole <.> c = c | 61 | (<.>) :: HsWrapper -> HsWrapper -> HsWrapper
WpHole <.> c = c | 61 | WpHole <.> c = c | 16 | false | true | 0 | 6 | 11 | 27 | 14 | 13 | null | null |
juodaspaulius/bclafer_old | src/Language/Clafer/Intermediate/Tracing.hs | mit | traverseEnumId _ = [] | 21 | traverseEnumId _ = [] | 21 | traverseEnumId _ = [] | 21 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
brendanhay/gogol | gogol-firestore/gen/Network/Google/Resource/FireStore/Projects/Databases/Documents/Delete.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
pdddUploadType :: Lens' ProjectsDatabasesDocumentsDelete (Maybe Text)
pdddUploadType
= lens _pdddUploadType
(\ s a -> s{_pdddUploadType = a}) | 220 | pdddUploadType :: Lens' ProjectsDatabasesDocumentsDelete (Maybe Text)
pdddUploadType
= lens _pdddUploadType
(\ s a -> s{_pdddUploadType = a}) | 149 | pdddUploadType
= lens _pdddUploadType
(\ s a -> s{_pdddUploadType = a}) | 79 | true | true | 0 | 9 | 34 | 48 | 25 | 23 | null | null |
rfranek/duckling | Duckling/Time/HR/Rules.hs | bsd-3-clause | ruleHourofdayHalf :: Rule
ruleHourofdayHalf = Rule
{ name = "<hour-of-day> half"
, pattern =
[ Predicate isAnHourOfDay
, regex "i pol?a?"
]
, prod = \tokens -> case tokens of
(Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:_) ->
tt $ hourMinute is12H hours 30
_ -> Nothing
} | 344 | ruleHourofdayHalf :: Rule
ruleHourofdayHalf = Rule
{ name = "<hour-of-day> half"
, pattern =
[ Predicate isAnHourOfDay
, regex "i pol?a?"
]
, prod = \tokens -> case tokens of
(Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:_) ->
tt $ hourMinute is12H hours 30
_ -> Nothing
} | 344 | ruleHourofdayHalf = Rule
{ name = "<hour-of-day> half"
, pattern =
[ Predicate isAnHourOfDay
, regex "i pol?a?"
]
, prod = \tokens -> case tokens of
(Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:_) ->
tt $ hourMinute is12H hours 30
_ -> Nothing
} | 318 | false | true | 0 | 22 | 90 | 121 | 63 | 58 | null | null |
rueshyna/gogol | gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'OptimizationActivity' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'oaWeight'
--
-- * 'oaFloodlightActivityId'
--
-- * 'oaFloodlightActivityIdDimensionValue'
optimizationActivity
:: OptimizationActivity
optimizationActivity =
OptimizationActivity'
{ _oaWeight = Nothing
, _oaFloodlightActivityId = Nothing
, _oaFloodlightActivityIdDimensionValue = Nothing
} | 494 | optimizationActivity
:: OptimizationActivity
optimizationActivity =
OptimizationActivity'
{ _oaWeight = Nothing
, _oaFloodlightActivityId = Nothing
, _oaFloodlightActivityIdDimensionValue = Nothing
} | 223 | optimizationActivity =
OptimizationActivity'
{ _oaWeight = Nothing
, _oaFloodlightActivityId = Nothing
, _oaFloodlightActivityIdDimensionValue = Nothing
} | 174 | true | true | 1 | 7 | 84 | 47 | 29 | 18 | null | null |
CindyLinz/Haskell.js | trans/src/Desugar/Where.hs | mit | deWhereRPat (RPCAs l name rPat) = RPCAs (id l) (deWhereName name) (deWhereRPat rPat) | 84 | deWhereRPat (RPCAs l name rPat) = RPCAs (id l) (deWhereName name) (deWhereRPat rPat) | 84 | deWhereRPat (RPCAs l name rPat) = RPCAs (id l) (deWhereName name) (deWhereRPat rPat) | 84 | false | false | 0 | 7 | 12 | 44 | 21 | 23 | null | null |
nathankot/dbmigrations | src/Database/Schema/Migrations/Store.hs | bsd-3-clause | -- |Load migrations from the specified 'MigrationStore', validate the
-- loaded migrations, and return errors or a 'MigrationMap' on
-- success. Generally speaking, this will be the first thing you
-- should call once you have constructed a 'MigrationStore'.
loadMigrations :: MigrationStore -> IO (Either [MapValidationError] StoreData)
loadMigrations store = do
migrations <- getMigrations store
loadedWithErrors <- mapM (\name -> loadMigration store name) migrations
let mMap = Map.fromList $ [ (mId e, e) | e <- loaded ]
validationErrors = validateMigrationMap mMap
(loaded, loadErrors) = sortResults loadedWithErrors ([], [])
allErrors = validationErrors ++ (InvalidMigration <$> loadErrors)
sortResults [] v = v
sortResults (Left e:rest) (ms, es) = sortResults rest (ms, e:es)
sortResults (Right m:rest) (ms, es) = sortResults rest (m:ms, es)
case null allErrors of
False -> return $ Left allErrors
True -> do
-- Construct a dependency graph and, if that succeeds, return
-- StoreData.
case depGraphFromMapping mMap of
Left e -> return $ Left [DependencyGraphError e]
Right gr -> return $ Right StoreData { storeDataMapping = mMap
, storeDataGraph = gr
}
-- |Validate a migration map. Returns zero or more validation errors. | 1,412 | loadMigrations :: MigrationStore -> IO (Either [MapValidationError] StoreData)
loadMigrations store = do
migrations <- getMigrations store
loadedWithErrors <- mapM (\name -> loadMigration store name) migrations
let mMap = Map.fromList $ [ (mId e, e) | e <- loaded ]
validationErrors = validateMigrationMap mMap
(loaded, loadErrors) = sortResults loadedWithErrors ([], [])
allErrors = validationErrors ++ (InvalidMigration <$> loadErrors)
sortResults [] v = v
sortResults (Left e:rest) (ms, es) = sortResults rest (ms, e:es)
sortResults (Right m:rest) (ms, es) = sortResults rest (m:ms, es)
case null allErrors of
False -> return $ Left allErrors
True -> do
-- Construct a dependency graph and, if that succeeds, return
-- StoreData.
case depGraphFromMapping mMap of
Left e -> return $ Left [DependencyGraphError e]
Right gr -> return $ Right StoreData { storeDataMapping = mMap
, storeDataGraph = gr
}
-- |Validate a migration map. Returns zero or more validation errors. | 1,152 | loadMigrations store = do
migrations <- getMigrations store
loadedWithErrors <- mapM (\name -> loadMigration store name) migrations
let mMap = Map.fromList $ [ (mId e, e) | e <- loaded ]
validationErrors = validateMigrationMap mMap
(loaded, loadErrors) = sortResults loadedWithErrors ([], [])
allErrors = validationErrors ++ (InvalidMigration <$> loadErrors)
sortResults [] v = v
sortResults (Left e:rest) (ms, es) = sortResults rest (ms, e:es)
sortResults (Right m:rest) (ms, es) = sortResults rest (m:ms, es)
case null allErrors of
False -> return $ Left allErrors
True -> do
-- Construct a dependency graph and, if that succeeds, return
-- StoreData.
case depGraphFromMapping mMap of
Left e -> return $ Left [DependencyGraphError e]
Right gr -> return $ Right StoreData { storeDataMapping = mMap
, storeDataGraph = gr
}
-- |Validate a migration map. Returns zero or more validation errors. | 1,073 | true | true | 0 | 18 | 366 | 345 | 178 | 167 | null | null |
yangsiwei880813/CS644 | src/Scanner.hs | gpl-2.0 | getJavaString ('"':_) = "" | 26 | getJavaString ('"':_) = "" | 26 | getJavaString ('"':_) = "" | 26 | false | false | 0 | 7 | 3 | 16 | 8 | 8 | null | null |
pascal-knodel/haskell-craft | _/links/E'6'18.hs | mit | testRectangularize1
= TestCase ( assertEqual "" ["..", "..", ".."] (rectangularize ["", ".", ".."]) ) | 103 | testRectangularize1
= TestCase ( assertEqual "" ["..", "..", ".."] (rectangularize ["", ".", ".."]) ) | 103 | testRectangularize1
= TestCase ( assertEqual "" ["..", "..", ".."] (rectangularize ["", ".", ".."]) ) | 103 | false | false | 1 | 10 | 15 | 46 | 24 | 22 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Unit.hs | mit | isSpellCaster TerranSCV = False | 31 | isSpellCaster TerranSCV = False | 31 | isSpellCaster TerranSCV = False | 31 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
graninas/Haskell-Algorithms | Tests/Rogulike/ComonadEffectTest2.hs | gpl-3.0 | t c (O c1 f) = f (merge c1 c)
c | 32 | cast c (O c1 f) = f (merge c1 c) | 32 | cast c (O c1 f) = f (merge c1 c) | 32 | false | false | 0 | 7 | 11 | 35 | 15 | 20 | null | null |
cnc-patch/cncmix | Codec/Archive/CnCMix/TiberianDawn.hs | gpl-3.0 | stringToWord32 _ accum [] = accum | 41 | stringToWord32 _ accum [] = accum | 41 | stringToWord32 _ accum [] = accum | 41 | false | false | 0 | 6 | 13 | 15 | 7 | 8 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | legalFIResultTyCon :: DynFlags -> TyCon -> Bool
legalFIResultTyCon dflags tc
| tc == unitTyCon = True
| otherwise = marshalableTyCon dflags tc | 168 | legalFIResultTyCon :: DynFlags -> TyCon -> Bool
legalFIResultTyCon dflags tc
| tc == unitTyCon = True
| otherwise = marshalableTyCon dflags tc | 168 | legalFIResultTyCon dflags tc
| tc == unitTyCon = True
| otherwise = marshalableTyCon dflags tc | 120 | false | true | 1 | 8 | 47 | 50 | 23 | 27 | null | null |
atsukotakahashi/wi | src/library/Yi/Keymap/Vim/Ex/Commands/Common.hs | gpl-2.0 | -- | Show the common error message about an unsaved file on the status line.
errorNoWrite :: EditorM ()
errorNoWrite = errorEditor "No write since last change (add ! to override)" | 179 | errorNoWrite :: EditorM ()
errorNoWrite = errorEditor "No write since last change (add ! to override)" | 102 | errorNoWrite = errorEditor "No write since last change (add ! to override)" | 75 | true | true | 0 | 7 | 30 | 26 | 11 | 15 | null | null |
janschulz/pandoc | src/Text/Pandoc/Readers/Docx.hs | gpl-2.0 | docxToOutput :: ReaderOptions -> Docx -> Either PandocError (Meta, [Block], MediaBag)
docxToOutput opts (Docx (Document _ body)) =
let dEnv = def { docxOptions = opts} in
evalDocxContext (bodyToOutput body) dEnv def | 223 | docxToOutput :: ReaderOptions -> Docx -> Either PandocError (Meta, [Block], MediaBag)
docxToOutput opts (Docx (Document _ body)) =
let dEnv = def { docxOptions = opts} in
evalDocxContext (bodyToOutput body) dEnv def | 223 | docxToOutput opts (Docx (Document _ body)) =
let dEnv = def { docxOptions = opts} in
evalDocxContext (bodyToOutput body) dEnv def | 137 | false | true | 0 | 10 | 39 | 87 | 45 | 42 | null | null |
rueshyna/gogol | gogol-genomics/gen/Network/Google/Resource/Genomics/ReadGroupSets/Patch.hs | mpl-2.0 | -- | Creates a value of 'ReadGroupSetsPatch' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'rgspXgafv'
--
-- * 'rgspReadGroupSetId'
--
-- * 'rgspUploadProtocol'
--
-- * 'rgspUpdateMask'
--
-- * 'rgspPp'
--
-- * 'rgspAccessToken'
--
-- * 'rgspUploadType'
--
-- * 'rgspPayload'
--
-- * 'rgspBearerToken'
--
-- * 'rgspCallback'
readGroupSetsPatch
:: Text -- ^ 'rgspReadGroupSetId'
-> ReadGroupSet -- ^ 'rgspPayload'
-> ReadGroupSetsPatch
readGroupSetsPatch pRgspReadGroupSetId_ pRgspPayload_ =
ReadGroupSetsPatch'
{ _rgspXgafv = Nothing
, _rgspReadGroupSetId = pRgspReadGroupSetId_
, _rgspUploadProtocol = Nothing
, _rgspUpdateMask = Nothing
, _rgspPp = True
, _rgspAccessToken = Nothing
, _rgspUploadType = Nothing
, _rgspPayload = pRgspPayload_
, _rgspBearerToken = Nothing
, _rgspCallback = Nothing
} | 947 | readGroupSetsPatch
:: Text -- ^ 'rgspReadGroupSetId'
-> ReadGroupSet -- ^ 'rgspPayload'
-> ReadGroupSetsPatch
readGroupSetsPatch pRgspReadGroupSetId_ pRgspPayload_ =
ReadGroupSetsPatch'
{ _rgspXgafv = Nothing
, _rgspReadGroupSetId = pRgspReadGroupSetId_
, _rgspUploadProtocol = Nothing
, _rgspUpdateMask = Nothing
, _rgspPp = True
, _rgspAccessToken = Nothing
, _rgspUploadType = Nothing
, _rgspPayload = pRgspPayload_
, _rgspBearerToken = Nothing
, _rgspCallback = Nothing
} | 535 | readGroupSetsPatch pRgspReadGroupSetId_ pRgspPayload_ =
ReadGroupSetsPatch'
{ _rgspXgafv = Nothing
, _rgspReadGroupSetId = pRgspReadGroupSetId_
, _rgspUploadProtocol = Nothing
, _rgspUpdateMask = Nothing
, _rgspPp = True
, _rgspAccessToken = Nothing
, _rgspUploadType = Nothing
, _rgspPayload = pRgspPayload_
, _rgspBearerToken = Nothing
, _rgspCallback = Nothing
} | 413 | true | true | 0 | 8 | 188 | 120 | 80 | 40 | null | null |
apunktbau/co4 | test/CO4/Thesis/WCB_MatrixStandalone.hs | gpl-3.0 | timesE :: Energy -> Energy -> Energy
timesE e f = case e of
Finite x -> case f of
Finite y -> Finite (plusNat x y)
MinusInfinity -> f
MinusInfinity -> e | 165 | timesE :: Energy -> Energy -> Energy
timesE e f = case e of
Finite x -> case f of
Finite y -> Finite (plusNat x y)
MinusInfinity -> f
MinusInfinity -> e | 165 | timesE e f = case e of
Finite x -> case f of
Finite y -> Finite (plusNat x y)
MinusInfinity -> f
MinusInfinity -> e | 128 | false | true | 0 | 13 | 45 | 73 | 35 | 38 | null | null |
zalora/zerobin | src/Web/ZeroBin.hs | mit | form Week = "1_week" | 21 | form Week = "1_week" | 21 | form Week = "1_week" | 21 | false | false | 1 | 5 | 4 | 13 | 4 | 9 | null | null |
anttisalonen/starrover2 | src/Universe.hs | mit | aobjs :: AObjTree
aobjs = Node (0.0, 0.0)
[ Leaf $ AObject "Star" 0 (Color4 0.9 0.0 0.0 1.0) 6.0 1.0 0 glVector3Null Nothing
, Leaf $ AObject "Murphy's" 10 (Color4 0.5 0.5 1.0 1.0) 2.0 1.0 28 glVector3Null (Just "Murphy")
, Leaf $ AObject "Loki" 250 (Color4 0.0 0.4 0.5 1.0) 4.0 1.0 55 glVector3Null (Just "Harju")
, Node (30, 115) $
[Leaf $ AObject "Harju" 30 (Color4 0.6 0.6 0.6 1.0) 9.0 1.0 0 glVector3Null (Just "Harju")
, Leaf $ AObject "Harju's Moon" 30 (Color4 0.2 0.9 0.6 1.0) 0.8 1.0 25 glVector3Null (Just "Harju")]
, Leaf $ AObject "Riesenland" 80 (Color4 0.1 0.8 0.8 1.0) 2.0 1.0 230 glVector3Null (Just "Riesenland")
, Leaf $ AObject "Riesenland" 80 (Color4 0.1 0.8 0.8 1.0) 2.0 1.0 230 glVector3Null (Just "Riesenland")
, Node (180, 480) $
[Leaf $ AObject "Natail" 180 (Color4 0.2 0.2 0.9 1.0) 1.0 1.5 60 glVector3Null (Just "Natail")
, Leaf $ AObject "Mammoth" 0 (Color4 0.3 0.0 0.6 1.0) 1.5 1.0 40 glVector3Null (Just "Natail")]
] | 1,034 | aobjs :: AObjTree
aobjs = Node (0.0, 0.0)
[ Leaf $ AObject "Star" 0 (Color4 0.9 0.0 0.0 1.0) 6.0 1.0 0 glVector3Null Nothing
, Leaf $ AObject "Murphy's" 10 (Color4 0.5 0.5 1.0 1.0) 2.0 1.0 28 glVector3Null (Just "Murphy")
, Leaf $ AObject "Loki" 250 (Color4 0.0 0.4 0.5 1.0) 4.0 1.0 55 glVector3Null (Just "Harju")
, Node (30, 115) $
[Leaf $ AObject "Harju" 30 (Color4 0.6 0.6 0.6 1.0) 9.0 1.0 0 glVector3Null (Just "Harju")
, Leaf $ AObject "Harju's Moon" 30 (Color4 0.2 0.9 0.6 1.0) 0.8 1.0 25 glVector3Null (Just "Harju")]
, Leaf $ AObject "Riesenland" 80 (Color4 0.1 0.8 0.8 1.0) 2.0 1.0 230 glVector3Null (Just "Riesenland")
, Leaf $ AObject "Riesenland" 80 (Color4 0.1 0.8 0.8 1.0) 2.0 1.0 230 glVector3Null (Just "Riesenland")
, Node (180, 480) $
[Leaf $ AObject "Natail" 180 (Color4 0.2 0.2 0.9 1.0) 1.0 1.5 60 glVector3Null (Just "Natail")
, Leaf $ AObject "Mammoth" 0 (Color4 0.3 0.0 0.6 1.0) 1.5 1.0 40 glVector3Null (Just "Natail")]
] | 1,034 | aobjs = Node (0.0, 0.0)
[ Leaf $ AObject "Star" 0 (Color4 0.9 0.0 0.0 1.0) 6.0 1.0 0 glVector3Null Nothing
, Leaf $ AObject "Murphy's" 10 (Color4 0.5 0.5 1.0 1.0) 2.0 1.0 28 glVector3Null (Just "Murphy")
, Leaf $ AObject "Loki" 250 (Color4 0.0 0.4 0.5 1.0) 4.0 1.0 55 glVector3Null (Just "Harju")
, Node (30, 115) $
[Leaf $ AObject "Harju" 30 (Color4 0.6 0.6 0.6 1.0) 9.0 1.0 0 glVector3Null (Just "Harju")
, Leaf $ AObject "Harju's Moon" 30 (Color4 0.2 0.9 0.6 1.0) 0.8 1.0 25 glVector3Null (Just "Harju")]
, Leaf $ AObject "Riesenland" 80 (Color4 0.1 0.8 0.8 1.0) 2.0 1.0 230 glVector3Null (Just "Riesenland")
, Leaf $ AObject "Riesenland" 80 (Color4 0.1 0.8 0.8 1.0) 2.0 1.0 230 glVector3Null (Just "Riesenland")
, Node (180, 480) $
[Leaf $ AObject "Natail" 180 (Color4 0.2 0.2 0.9 1.0) 1.0 1.5 60 glVector3Null (Just "Natail")
, Leaf $ AObject "Mammoth" 0 (Color4 0.3 0.0 0.6 1.0) 1.5 1.0 40 glVector3Null (Just "Natail")]
] | 1,016 | false | true | 0 | 11 | 257 | 427 | 216 | 211 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Hooks/DebugEvents.hs | bsd-2-clause | -- I am assuming for the moment that this is a single string.
-- This might be false; consider the way the STRING properties
-- handle lists.
dumpUTF :: Decoder Bool
dumpUTF = do
uTF8_STRING <- inX $ getAtom "UTF8_STRING"
guardType uTF8_STRING $ guardSize 8 $ do
s <- gets value
modify (\r -> r {value = []})
append . show . decode . map fromIntegral $ s
return True
-- dump an enumerated value using a translation table | 434 | dumpUTF :: Decoder Bool
dumpUTF = do
uTF8_STRING <- inX $ getAtom "UTF8_STRING"
guardType uTF8_STRING $ guardSize 8 $ do
s <- gets value
modify (\r -> r {value = []})
append . show . decode . map fromIntegral $ s
return True
-- dump an enumerated value using a translation table | 292 | dumpUTF = do
uTF8_STRING <- inX $ getAtom "UTF8_STRING"
guardType uTF8_STRING $ guardSize 8 $ do
s <- gets value
modify (\r -> r {value = []})
append . show . decode . map fromIntegral $ s
return True
-- dump an enumerated value using a translation table | 268 | true | true | 0 | 15 | 92 | 111 | 53 | 58 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.