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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Kyly/liquidhaskell
|
src/Language/Haskell/Liquid/RefType.hs
|
bsd-3-clause
|
isSizeable :: S.HashSet TyCon -> TyCon -> Bool
isSizeable autoenv tc = S.member tc autoenv
| 92
|
isSizeable :: S.HashSet TyCon -> TyCon -> Bool
isSizeable autoenv tc = S.member tc autoenv
| 92
|
isSizeable autoenv tc = S.member tc autoenv
| 44
| false
| true
| 0
| 7
| 16
| 36
| 17
| 19
| null | null |
kojiromike/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
toplevelWith :: String -> ElabInfo
toplevelWith ns = EInfo [] emptyContext id [] Nothing ns 0 [] id (\_ _ _ -> fail "Not implemented")
| 134
|
toplevelWith :: String -> ElabInfo
toplevelWith ns = EInfo [] emptyContext id [] Nothing ns 0 [] id (\_ _ _ -> fail "Not implemented")
| 134
|
toplevelWith ns = EInfo [] emptyContext id [] Nothing ns 0 [] id (\_ _ _ -> fail "Not implemented")
| 99
| false
| true
| 0
| 8
| 24
| 67
| 31
| 36
| null | null |
flowbox-public/fgl
|
Data/Graph/Inductive/Query/DFS.hs
|
bsd-3-clause
|
dfs' :: Graph gr => gr a b -> [Node]
dfs' = dfsWith' node'
| 58
|
dfs' :: Graph gr => gr a b -> [Node]
dfs' = dfsWith' node'
| 58
|
dfs' = dfsWith' node'
| 21
| false
| true
| 0
| 9
| 13
| 39
| 17
| 22
| null | null |
vincenthz/hs-foundation
|
basement/Basement/BoxedArray.hs
|
bsd-3-clause
|
-- | read a cell in a mutable array.
--
-- If the index is out of bounds, an error is raised.
read :: PrimMonad prim => MArray ty (PrimState prim) -> Offset ty -> prim ty
read array n
| isOutOfBound n len = primOutOfBound OOB_Read n len
| otherwise = unsafeRead array n
where len = mutableLengthSize array
| 325
|
read :: PrimMonad prim => MArray ty (PrimState prim) -> Offset ty -> prim ty
read array n
| isOutOfBound n len = primOutOfBound OOB_Read n len
| otherwise = unsafeRead array n
where len = mutableLengthSize array
| 231
|
read array n
| isOutOfBound n len = primOutOfBound OOB_Read n len
| otherwise = unsafeRead array n
where len = mutableLengthSize array
| 154
| true
| true
| 1
| 9
| 79
| 96
| 44
| 52
| null | null |
kawu/factorized-tag-parser
|
src/NLP/Partage/Auto/Trie.hs
|
bsd-2-clause
|
convert :: Ord a => Trie a -> ITrie a
convert t0 = ITrie
{ rootID = root
, nodeMap = nodeMap' }
where
(root, (_, nodeMap')) = E.runState (doit t0) (0 :: Int, M.empty)
doit (Trie t) = do
i <- newID
node <- M.fromList <$> sequence
[ (,) <$> pure x <*> doit s
| (x, s) <- M.toList t ]
yield i node
return i
newID = E.state $ \(n, m) -> (n, (n + 1, m))
yield i node = E.modify $ Arr.second (M.insert i node)
| 486
|
convert :: Ord a => Trie a -> ITrie a
convert t0 = ITrie
{ rootID = root
, nodeMap = nodeMap' }
where
(root, (_, nodeMap')) = E.runState (doit t0) (0 :: Int, M.empty)
doit (Trie t) = do
i <- newID
node <- M.fromList <$> sequence
[ (,) <$> pure x <*> doit s
| (x, s) <- M.toList t ]
yield i node
return i
newID = E.state $ \(n, m) -> (n, (n + 1, m))
yield i node = E.modify $ Arr.second (M.insert i node)
| 486
|
convert t0 = ITrie
{ rootID = root
, nodeMap = nodeMap' }
where
(root, (_, nodeMap')) = E.runState (doit t0) (0 :: Int, M.empty)
doit (Trie t) = do
i <- newID
node <- M.fromList <$> sequence
[ (,) <$> pure x <*> doit s
| (x, s) <- M.toList t ]
yield i node
return i
newID = E.state $ \(n, m) -> (n, (n + 1, m))
yield i node = E.modify $ Arr.second (M.insert i node)
| 448
| false
| true
| 3
| 16
| 172
| 250
| 128
| 122
| null | null |
miguelpagano/equ
|
Equ/Types.hs
|
gpl-3.0
|
tyInt :: Type
tyInt = TyAtom ATyInt
| 35
|
tyInt :: Type
tyInt = TyAtom ATyInt
| 35
|
tyInt = TyAtom ATyInt
| 21
| false
| true
| 0
| 6
| 6
| 20
| 8
| 12
| null | null |
flowbox-public/ghcjs
|
src/Gen2/Rts.hs
|
mit
|
updateThunk' :: CgSettings -> JStat
updateThunk' settings =
if csInlineBlackhole settings
then bhStats settings True
else [j| h$bh(); |]
| 146
|
updateThunk' :: CgSettings -> JStat
updateThunk' settings =
if csInlineBlackhole settings
then bhStats settings True
else [j| h$bh(); |]
| 146
|
updateThunk' settings =
if csInlineBlackhole settings
then bhStats settings True
else [j| h$bh(); |]
| 110
| false
| true
| 0
| 6
| 28
| 38
| 21
| 17
| null | null |
harendra-kumar/asyncly
|
benchmark/Chart.hs
|
bsd-3-clause
|
showStreamK Options{..} cfg inp out =
let cfg' = cfg { classifyBenchmark = classifyStreamK }
in if genGraphs
then ignoringErr $ graph inp "streamK"
cfg' {outputDir = Just out}
else ignoringErr $ report inp Nothing cfg'
where
classifyStreamK b
| "streamK/" `isPrefixOf` b = ("streamK",) <$> stripPrefix "streamK/" b
| otherwise = Nothing
------------------------------------------------------------------------------
-- text reports
------------------------------------------------------------------------------
| 575
|
showStreamK Options{..} cfg inp out =
let cfg' = cfg { classifyBenchmark = classifyStreamK }
in if genGraphs
then ignoringErr $ graph inp "streamK"
cfg' {outputDir = Just out}
else ignoringErr $ report inp Nothing cfg'
where
classifyStreamK b
| "streamK/" `isPrefixOf` b = ("streamK",) <$> stripPrefix "streamK/" b
| otherwise = Nothing
------------------------------------------------------------------------------
-- text reports
------------------------------------------------------------------------------
| 575
|
showStreamK Options{..} cfg inp out =
let cfg' = cfg { classifyBenchmark = classifyStreamK }
in if genGraphs
then ignoringErr $ graph inp "streamK"
cfg' {outputDir = Just out}
else ignoringErr $ report inp Nothing cfg'
where
classifyStreamK b
| "streamK/" `isPrefixOf` b = ("streamK",) <$> stripPrefix "streamK/" b
| otherwise = Nothing
------------------------------------------------------------------------------
-- text reports
------------------------------------------------------------------------------
| 575
| false
| false
| 0
| 12
| 122
| 129
| 66
| 63
| null | null |
vTurbine/ghc
|
compiler/main/Packages.hs
|
bsd-3-clause
|
-- | Find all the library paths in these and the preload packages
getPackageLibraryPath :: DynFlags -> [UnitId] -> IO [String]
getPackageLibraryPath dflags pkgs =
collectLibraryPaths `fmap` getPreloadPackagesAnd dflags pkgs
| 225
|
getPackageLibraryPath :: DynFlags -> [UnitId] -> IO [String]
getPackageLibraryPath dflags pkgs =
collectLibraryPaths `fmap` getPreloadPackagesAnd dflags pkgs
| 159
|
getPackageLibraryPath dflags pkgs =
collectLibraryPaths `fmap` getPreloadPackagesAnd dflags pkgs
| 98
| true
| true
| 0
| 8
| 31
| 45
| 24
| 21
| null | null |
urbanslug/ghc
|
compiler/utils/Util.hs
|
bsd-3-clause
|
partitionWith f (x:xs) = case f x of
Left b -> (b:bs, cs)
Right c -> (bs, c:cs)
where (bs,cs) = partitionWith f xs
| 169
|
partitionWith f (x:xs) = case f x of
Left b -> (b:bs, cs)
Right c -> (bs, c:cs)
where (bs,cs) = partitionWith f xs
| 169
|
partitionWith f (x:xs) = case f x of
Left b -> (b:bs, cs)
Right c -> (bs, c:cs)
where (bs,cs) = partitionWith f xs
| 169
| false
| false
| 0
| 9
| 78
| 82
| 42
| 40
| null | null |
chadbrewbaker/combinat
|
Math/Combinat/Numbers.hs
|
bsd-3-clause
|
ernoulli :: Integral a => a -> Rational
bernoulli n
| n < 0 = error "bernoulli: n should be nonnegative"
| n == 0 = 1
| n == 1 = -1/2
| otherwise = sum [ f k | k<-[1..n] ]
where
f k = toRational (paritySign (n+k) * factorial k * stirling2nd n k)
/ toRational (k+1)
--------------------------------------------------------------------------------
-- * Bell numbers
-- | Bell numbers (Sloane's A000110) from B(0) up to B(n). B(0)=B(1)=1, B(2)=2, etc.
--
-- The Bell numbers count the number of /set partitions/ of a set of size @n@
--
-- See <http://en.wikipedia.org/wiki/Bell_number>
--
| 625
|
bernoulli :: Integral a => a -> Rational
bernoulli n
| n < 0 = error "bernoulli: n should be nonnegative"
| n == 0 = 1
| n == 1 = -1/2
| otherwise = sum [ f k | k<-[1..n] ]
where
f k = toRational (paritySign (n+k) * factorial k * stirling2nd n k)
/ toRational (k+1)
--------------------------------------------------------------------------------
-- * Bell numbers
-- | Bell numbers (Sloane's A000110) from B(0) up to B(n). B(0)=B(1)=1, B(2)=2, etc.
--
-- The Bell numbers count the number of /set partitions/ of a set of size @n@
--
-- See <http://en.wikipedia.org/wiki/Bell_number>
--
| 625
|
bernoulli n
| n < 0 = error "bernoulli: n should be nonnegative"
| n == 0 = 1
| n == 1 = -1/2
| otherwise = sum [ f k | k<-[1..n] ]
where
f k = toRational (paritySign (n+k) * factorial k * stirling2nd n k)
/ toRational (k+1)
--------------------------------------------------------------------------------
-- * Bell numbers
-- | Bell numbers (Sloane's A000110) from B(0) up to B(n). B(0)=B(1)=1, B(2)=2, etc.
--
-- The Bell numbers count the number of /set partitions/ of a set of size @n@
--
-- See <http://en.wikipedia.org/wiki/Bell_number>
--
| 584
| false
| true
| 5
| 10
| 140
| 183
| 86
| 97
| null | null |
brendanhay/gogol
|
gogol-games/gen/Network/Google/Games/Types/Product.hs
|
mpl-2.0
|
-- | The player events.
pelrItems :: Lens' PlayerEventListResponse [PlayerEvent]
pelrItems
= lens _pelrItems (\ s a -> s{_pelrItems = a}) .
_Default
. _Coerce
| 172
|
pelrItems :: Lens' PlayerEventListResponse [PlayerEvent]
pelrItems
= lens _pelrItems (\ s a -> s{_pelrItems = a}) .
_Default
. _Coerce
| 148
|
pelrItems
= lens _pelrItems (\ s a -> s{_pelrItems = a}) .
_Default
. _Coerce
| 91
| true
| true
| 0
| 11
| 38
| 53
| 28
| 25
| null | null |
jmikkola/Athena
|
src/Inference.hs
|
mit
|
findDepBlock :: Set String -> [S.Statement] -> [String]
findDepBlock bound stmts = case stmts of
[] -> []
(stmt:rest) ->
let stmtDeps = findDependencies bound stmt
bound' = case stmt of
(S.Let _ name _ _) ->
Set.insert name bound
_ ->
bound
restDeps = findDepBlock bound' rest
in stmtDeps ++ restDeps
| 402
|
findDepBlock :: Set String -> [S.Statement] -> [String]
findDepBlock bound stmts = case stmts of
[] -> []
(stmt:rest) ->
let stmtDeps = findDependencies bound stmt
bound' = case stmt of
(S.Let _ name _ _) ->
Set.insert name bound
_ ->
bound
restDeps = findDepBlock bound' rest
in stmtDeps ++ restDeps
| 402
|
findDepBlock bound stmts = case stmts of
[] -> []
(stmt:rest) ->
let stmtDeps = findDependencies bound stmt
bound' = case stmt of
(S.Let _ name _ _) ->
Set.insert name bound
_ ->
bound
restDeps = findDepBlock bound' rest
in stmtDeps ++ restDeps
| 346
| false
| true
| 0
| 17
| 153
| 134
| 67
| 67
| null | null |
wxwxwwxxx/ghc
|
libraries/base/GHC/List.hs
|
bsd-3-clause
|
null (_:_) = False
| 32
|
null (_:_) = False
| 32
|
null (_:_) = False
| 32
| false
| false
| 0
| 7
| 17
| 16
| 8
| 8
| null | null |
porglezomp/learn-languages
|
haskell/99.hs
|
unlicense
|
length' (x:xs) = 1 + (length' xs)
| 33
|
length' (x:xs) = 1 + (length' xs)
| 33
|
length' (x:xs) = 1 + (length' xs)
| 33
| false
| false
| 0
| 7
| 6
| 26
| 13
| 13
| null | null |
minad/omega
|
vendor/algorithm-p/Types.hs
|
bsd-3-clause
|
showType (TyMeta idx) = '?' : show idx
| 38
|
showType (TyMeta idx) = '?' : show idx
| 38
|
showType (TyMeta idx) = '?' : show idx
| 38
| false
| false
| 0
| 7
| 7
| 22
| 10
| 12
| null | null |
Ongy/monky
|
Monky/MPD.hs
|
lgpl-3.0
|
tryConnect :: [AddrInfo] -> MPDSock -> ExceptT String IO MPDSock
tryConnect [] _ = error "Tryed to connect with non existing socket"
| 132
|
tryConnect :: [AddrInfo] -> MPDSock -> ExceptT String IO MPDSock
tryConnect [] _ = error "Tryed to connect with non existing socket"
| 132
|
tryConnect [] _ = error "Tryed to connect with non existing socket"
| 67
| false
| true
| 0
| 7
| 21
| 39
| 19
| 20
| null | null |
tjakway/ghcjvm
|
compiler/cmm/CLabel.hs
|
bsd-3-clause
|
needsCDecl (IdLabel _ _ _) = True
| 46
|
needsCDecl (IdLabel _ _ _) = True
| 46
|
needsCDecl (IdLabel _ _ _) = True
| 46
| false
| false
| 0
| 7
| 19
| 19
| 9
| 10
| null | null |
ganeti/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
cvEnodedrbdversion :: (String, String, String)
cvEnodedrbdversion =
("node",
Types.cVErrorCodeToRaw CvENODEDRBDVERSION,
"DRBD version mismatch within a node group")
| 172
|
cvEnodedrbdversion :: (String, String, String)
cvEnodedrbdversion =
("node",
Types.cVErrorCodeToRaw CvENODEDRBDVERSION,
"DRBD version mismatch within a node group")
| 172
|
cvEnodedrbdversion =
("node",
Types.cVErrorCodeToRaw CvENODEDRBDVERSION,
"DRBD version mismatch within a node group")
| 125
| false
| true
| 0
| 7
| 24
| 34
| 20
| 14
| null | null |
tsurai/hackerrank
|
functional-programming/introduction/area-under-curves-and-volume-of-revolving-a-curve.hs
|
mit
|
--Input/Output.
main :: IO ()
main = getContents >>= mapM_ (printf "%.1f\n"). (\[a, b, [l, r]] -> solve l r a b). map (map read. words). lines
| 142
|
main :: IO ()
main = getContents >>= mapM_ (printf "%.1f\n"). (\[a, b, [l, r]] -> solve l r a b). map (map read. words). lines
| 126
|
main = getContents >>= mapM_ (printf "%.1f\n"). (\[a, b, [l, r]] -> solve l r a b). map (map read. words). lines
| 112
| true
| true
| 2
| 11
| 26
| 95
| 48
| 47
| null | null |
ucsd-progsys/131-web
|
static/hs/CrashCourse.hs
|
mit
|
negate :: (a -> Bool) -> a -> Bool
negate f = \x -> not (f x)
| 61
|
negate :: (a -> Bool) -> a -> Bool
negate f = \x -> not (f x)
| 61
|
negate f = \x -> not (f x)
| 26
| false
| true
| 0
| 8
| 16
| 49
| 23
| 26
| null | null |
jboissard/GAHelloWorld
|
haskell/gahelloworld.hs
|
mit
|
maxGenerations :: Int
maxGenerations = 16384
| 45
|
maxGenerations :: Int
maxGenerations = 16384
| 44
|
maxGenerations = 16384
| 22
| false
| true
| 0
| 6
| 6
| 18
| 7
| 11
| null | null |
seppeljordan/geimskell
|
Geimskell/Sound.hs
|
gpl-3.0
|
withEmptySoundServer :: (SoundServer -> a) -> a
withEmptySoundServer action = action EmptySoundServer
| 101
|
withEmptySoundServer :: (SoundServer -> a) -> a
withEmptySoundServer action = action EmptySoundServer
| 101
|
withEmptySoundServer action = action EmptySoundServer
| 53
| false
| true
| 0
| 7
| 11
| 28
| 14
| 14
| null | null |
cauterize-tools/cauterize
|
src/Cauterize/Dynamic/Common.hs
|
bsd-3-clause
|
isNameOf "f32" (PDf32 _) = True
| 32
|
isNameOf "f32" (PDf32 _) = True
| 32
|
isNameOf "f32" (PDf32 _) = True
| 32
| false
| false
| 0
| 7
| 6
| 17
| 8
| 9
| null | null |
harry830622/cis194-solutions
|
02-ADTs/LogAnalysis.hs
|
mit
|
insert _ messageTree = messageTree
| 34
|
insert _ messageTree = messageTree
| 34
|
insert _ messageTree = messageTree
| 34
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
muhbaasu/clay
|
src/Clay/Flexbox.hs
|
bsd-3-clause
|
-------------------------------------------------------------------------------
order :: Int -> Css
order i = key "order" (fromString (show i) :: Value)
| 153
|
order :: Int -> Css
order i = key "order" (fromString (show i) :: Value)
| 72
|
order i = key "order" (fromString (show i) :: Value)
| 52
| true
| true
| 0
| 9
| 16
| 46
| 21
| 25
| null | null |
brendanhay/gogol
|
gogol-compute/gen/Network/Google/Resource/Compute/RegionURLMaps/Insert.hs
|
mpl-2.0
|
-- | Name of the region scoping this request.
rumiRegion :: Lens' RegionURLMapsInsert Text
rumiRegion
= lens _rumiRegion (\ s a -> s{_rumiRegion = a})
| 152
|
rumiRegion :: Lens' RegionURLMapsInsert Text
rumiRegion
= lens _rumiRegion (\ s a -> s{_rumiRegion = a})
| 106
|
rumiRegion
= lens _rumiRegion (\ s a -> s{_rumiRegion = a})
| 61
| true
| true
| 0
| 9
| 26
| 42
| 22
| 20
| null | null |
glguy/irc-core
|
lib/src/Irc/RateLimit.hs
|
isc
|
tickRateLimit :: RateLimit -> IO ()
tickRateLimit r = modifyMVar_ (rateStamp r) $ \stamp ->
do now <- getCurrentTime
let stamp' = ratePenalty r `addUTCTime` max stamp now
diff = diffUTCTime stamp' now
excess = diff - rateThreshold r
when (excess > 0) (threadDelay (ceiling (1000000 * excess)))
return stamp'
| 346
|
tickRateLimit :: RateLimit -> IO ()
tickRateLimit r = modifyMVar_ (rateStamp r) $ \stamp ->
do now <- getCurrentTime
let stamp' = ratePenalty r `addUTCTime` max stamp now
diff = diffUTCTime stamp' now
excess = diff - rateThreshold r
when (excess > 0) (threadDelay (ceiling (1000000 * excess)))
return stamp'
| 346
|
tickRateLimit r = modifyMVar_ (rateStamp r) $ \stamp ->
do now <- getCurrentTime
let stamp' = ratePenalty r `addUTCTime` max stamp now
diff = diffUTCTime stamp' now
excess = diff - rateThreshold r
when (excess > 0) (threadDelay (ceiling (1000000 * excess)))
return stamp'
| 310
| false
| true
| 0
| 16
| 88
| 138
| 65
| 73
| null | null |
eriksvedang/Carp
|
src/Util.hs
|
mpl-2.0
|
pairwise (x : y : xs) = (x, y) : pairwise xs
| 44
|
pairwise (x : y : xs) = (x, y) : pairwise xs
| 44
|
pairwise (x : y : xs) = (x, y) : pairwise xs
| 44
| false
| false
| 0
| 8
| 11
| 33
| 17
| 16
| null | null |
Zankoku-Okuno/ammonite
|
Language/Ammonite/Syntax/Printer.hs
|
gpl-3.0
|
showVal (TagVal (_, (Just loc, Nothing))) = "<Tag def'd at " <> report loc <> ">"
| 81
|
showVal (TagVal (_, (Just loc, Nothing))) = "<Tag def'd at " <> report loc <> ">"
| 81
|
showVal (TagVal (_, (Just loc, Nothing))) = "<Tag def'd at " <> report loc <> ">"
| 81
| false
| false
| 0
| 9
| 15
| 42
| 21
| 21
| null | null |
ambiata/mafia
|
src/Mafia/Cabal/Dependencies.hs
|
bsd-3-clause
|
pVia :: Parser [PackageId]
pVia =
pSpaceSep *> A.string "(via:" *> pSpaceSep *> pPackageId `A.sepBy1` pSpaceSep <* A.char ')'
| 127
|
pVia :: Parser [PackageId]
pVia =
pSpaceSep *> A.string "(via:" *> pSpaceSep *> pPackageId `A.sepBy1` pSpaceSep <* A.char ')'
| 127
|
pVia =
pSpaceSep *> A.string "(via:" *> pSpaceSep *> pPackageId `A.sepBy1` pSpaceSep <* A.char ')'
| 100
| false
| true
| 1
| 11
| 20
| 54
| 26
| 28
| null | null |
jhance/gba-hs
|
src/Game/GBA/Thumb/Execution.hs
|
mit
|
executeT4 T4_SBC src dest = do
in1 <- readSafeRegister src
in2 <- readSafeRegister dest
c' <- not <$> readStatus statusC
let c = fromIntegral $ fromEnum c'
result = in2 - in1 - c
sign = testBit in2 31
difSign = sign /= testBit in1 31
setZero result
setSign result
writeStatus statusC $ in2 >= in1 + c
writeStatus statusV $ difSign && sign /= testBit result 31
writeSafeRegister dest result
| 449
|
executeT4 T4_SBC src dest = do
in1 <- readSafeRegister src
in2 <- readSafeRegister dest
c' <- not <$> readStatus statusC
let c = fromIntegral $ fromEnum c'
result = in2 - in1 - c
sign = testBit in2 31
difSign = sign /= testBit in1 31
setZero result
setSign result
writeStatus statusC $ in2 >= in1 + c
writeStatus statusV $ difSign && sign /= testBit result 31
writeSafeRegister dest result
| 449
|
executeT4 T4_SBC src dest = do
in1 <- readSafeRegister src
in2 <- readSafeRegister dest
c' <- not <$> readStatus statusC
let c = fromIntegral $ fromEnum c'
result = in2 - in1 - c
sign = testBit in2 31
difSign = sign /= testBit in1 31
setZero result
setSign result
writeStatus statusC $ in2 >= in1 + c
writeStatus statusV $ difSign && sign /= testBit result 31
writeSafeRegister dest result
| 449
| false
| false
| 0
| 11
| 130
| 161
| 71
| 90
| null | null |
delta2323/NNOp
|
app/Sample.hs
|
bsd-3-clause
|
main = (putStrLn $ show $ N.forward l $ x1)
>> (putStrLn $ show $ N.forward p $ (x1, x2))
>> (putStrLn $ show $ N.forward q $ x1)
| 133
|
main = (putStrLn $ show $ N.forward l $ x1)
>> (putStrLn $ show $ N.forward p $ (x1, x2))
>> (putStrLn $ show $ N.forward q $ x1)
| 133
|
main = (putStrLn $ show $ N.forward l $ x1)
>> (putStrLn $ show $ N.forward p $ (x1, x2))
>> (putStrLn $ show $ N.forward q $ x1)
| 133
| false
| false
| 4
| 10
| 32
| 83
| 41
| 42
| null | null |
wxzh/fcore
|
lib/Playground.hs
|
bsd-2-clause
|
plus2 :: Expr t e
plus2 = (App (lam (Fun javaInt (Fun javaInt javaInt)) (\e -> (App (App (var e) one) zero)))
(lam javaInt (\e -> (lam javaInt (\f -> (var e) `mult` (var f))))))
| 190
|
plus2 :: Expr t e
plus2 = (App (lam (Fun javaInt (Fun javaInt javaInt)) (\e -> (App (App (var e) one) zero)))
(lam javaInt (\e -> (lam javaInt (\f -> (var e) `mult` (var f))))))
| 190
|
plus2 = (App (lam (Fun javaInt (Fun javaInt javaInt)) (\e -> (App (App (var e) one) zero)))
(lam javaInt (\e -> (lam javaInt (\f -> (var e) `mult` (var f))))))
| 172
| false
| true
| 0
| 17
| 47
| 128
| 68
| 60
| null | null |
charles-cooper/postgresql-orm
|
Database/PostgreSQL/Escape.hs
|
gpl-3.0
|
c2b# :: Char -> Word#
c2b# (C# i) = int2Word# (ord# i)
| 54
|
c2b# :: Char -> Word#
c2b# (C# i) = int2Word# (ord# i)
| 54
|
c2b# (C# i) = int2Word# (ord# i)
| 32
| false
| true
| 0
| 7
| 11
| 33
| 16
| 17
| null | null |
justinethier/husk-scheme
|
hs-src/Language/Scheme/Macro/ExplicitRenaming.hs
|
mit
|
-- |The explicit renaming /rename/ function
--
-- From clinger's paper "Hygienic Macros Through Explicit Renaming":
--
-- The expression returned by the transformation procedure
-- will be expanded in the syntactic environment obtained
-- from the syntactic environment of the macro application
-- by binding any fresh identifiers in the syntactic
-- environment in which the macro was defined. This means
-- that a renamed identifier will denote the same thing as
-- the original identifier unless the transformation
-- procedure that renamed the identifier placed an
-- occurrence of it in a binding position.
--
-- The renaming procedure acts as a mathematical function
-- in the sense that the idenfiers obtained from any two
-- calls with the same argument will be the same in
-- the sense of eqv?. It is an error if the renaming
-- procedure is called after the transformation
-- procedure has returned.
exRename :: Env -> Env -> Env -> Env -> [LispVal] -> IOThrowsError LispVal
exRename useEnv _ srRenameEnv defEnv [Atom a] = do
isSynRulesRenamed <- liftIO $ isRecBound srRenameEnv a
if isSynRulesRenamed -- already renamed by syntax-rules, so just return it
then getVar srRenameEnv a
else do
isDef <- liftIO $ isRecBound defEnv a
if isDef
then do
-- NOTE: useEnv/'r' is used to store renamed variables due
-- to issues with separate invocations of er macros
-- renaming the same variable differently within the
-- same context. This caused the module meta language
-- to not work properly...
r <- getNamespacedVar' useEnv 'r' a
case r of
Just renamed -> return renamed
Nothing -> do
value <- getVar defEnv a
Atom renamed <- _gensym a -- Unique name
_ <- defineVar useEnv renamed value -- divert value to Use Env
_ <- defineNamespacedVar useEnv 'r' a $ Atom renamed -- Record renamed sym
-- Keep track of diverted values for use by the compiler
List diverted <- getNamespacedVar useEnv ' ' "diverted"
_ <- setNamespacedVar useEnv ' ' "diverted" $
List (diverted ++ [List [Atom renamed, Atom a]])
return $ Atom renamed
else
return $ Atom a
| 2,288
|
exRename :: Env -> Env -> Env -> Env -> [LispVal] -> IOThrowsError LispVal
exRename useEnv _ srRenameEnv defEnv [Atom a] = do
isSynRulesRenamed <- liftIO $ isRecBound srRenameEnv a
if isSynRulesRenamed -- already renamed by syntax-rules, so just return it
then getVar srRenameEnv a
else do
isDef <- liftIO $ isRecBound defEnv a
if isDef
then do
-- NOTE: useEnv/'r' is used to store renamed variables due
-- to issues with separate invocations of er macros
-- renaming the same variable differently within the
-- same context. This caused the module meta language
-- to not work properly...
r <- getNamespacedVar' useEnv 'r' a
case r of
Just renamed -> return renamed
Nothing -> do
value <- getVar defEnv a
Atom renamed <- _gensym a -- Unique name
_ <- defineVar useEnv renamed value -- divert value to Use Env
_ <- defineNamespacedVar useEnv 'r' a $ Atom renamed -- Record renamed sym
-- Keep track of diverted values for use by the compiler
List diverted <- getNamespacedVar useEnv ' ' "diverted"
_ <- setNamespacedVar useEnv ' ' "diverted" $
List (diverted ++ [List [Atom renamed, Atom a]])
return $ Atom renamed
else
return $ Atom a
| 1,378
|
exRename useEnv _ srRenameEnv defEnv [Atom a] = do
isSynRulesRenamed <- liftIO $ isRecBound srRenameEnv a
if isSynRulesRenamed -- already renamed by syntax-rules, so just return it
then getVar srRenameEnv a
else do
isDef <- liftIO $ isRecBound defEnv a
if isDef
then do
-- NOTE: useEnv/'r' is used to store renamed variables due
-- to issues with separate invocations of er macros
-- renaming the same variable differently within the
-- same context. This caused the module meta language
-- to not work properly...
r <- getNamespacedVar' useEnv 'r' a
case r of
Just renamed -> return renamed
Nothing -> do
value <- getVar defEnv a
Atom renamed <- _gensym a -- Unique name
_ <- defineVar useEnv renamed value -- divert value to Use Env
_ <- defineNamespacedVar useEnv 'r' a $ Atom renamed -- Record renamed sym
-- Keep track of diverted values for use by the compiler
List diverted <- getNamespacedVar useEnv ' ' "diverted"
_ <- setNamespacedVar useEnv ' ' "diverted" $
List (diverted ++ [List [Atom renamed, Atom a]])
return $ Atom renamed
else
return $ Atom a
| 1,303
| true
| true
| 0
| 27
| 591
| 327
| 164
| 163
| null | null |
Peaker/lamdu
|
src/Lamdu/GUI/Expr/TagEdit.hs
|
gpl-3.0
|
makeAddNewTag ::
_ =>
Sugar.TagOption Name o ->
GuiM menv i o
( (EntityId -> Menu.PickResult) ->
SearchMenu.ResultsContext -> Maybe (Menu.Option f o)
)
makeAddNewTag tagOpt =
makeNewTagPreEvent tagOpt <&>
\newTagPreEvent mkPickResult ctx ->
let optionId =
(ctx ^. SearchMenu.rResultIdPrefix) `Widget.joinId` ["Create new"]
searchTerm = ctx ^. SearchMenu.rSearchTerm
in newTagPreEvent searchTerm mkPickResult
<&> \preEvent ->
Menu.Option
{ Menu._oId = optionId
, Menu._oSubmenuWidgets = Menu.SubmenuEmpty
, Menu._oRender =
(Widget.makeFocusableView ?? optionId <&> fmap)
<*> Styled.label Texts.createNew
<&> (`Menu.RenderedOption` preEvent)
& Styled.withColor TextColors.actionTextColor
}
| 848
|
makeAddNewTag ::
_ =>
Sugar.TagOption Name o ->
GuiM menv i o
( (EntityId -> Menu.PickResult) ->
SearchMenu.ResultsContext -> Maybe (Menu.Option f o)
)
makeAddNewTag tagOpt =
makeNewTagPreEvent tagOpt <&>
\newTagPreEvent mkPickResult ctx ->
let optionId =
(ctx ^. SearchMenu.rResultIdPrefix) `Widget.joinId` ["Create new"]
searchTerm = ctx ^. SearchMenu.rSearchTerm
in newTagPreEvent searchTerm mkPickResult
<&> \preEvent ->
Menu.Option
{ Menu._oId = optionId
, Menu._oSubmenuWidgets = Menu.SubmenuEmpty
, Menu._oRender =
(Widget.makeFocusableView ?? optionId <&> fmap)
<*> Styled.label Texts.createNew
<&> (`Menu.RenderedOption` preEvent)
& Styled.withColor TextColors.actionTextColor
}
| 848
|
makeAddNewTag tagOpt =
makeNewTagPreEvent tagOpt <&>
\newTagPreEvent mkPickResult ctx ->
let optionId =
(ctx ^. SearchMenu.rResultIdPrefix) `Widget.joinId` ["Create new"]
searchTerm = ctx ^. SearchMenu.rSearchTerm
in newTagPreEvent searchTerm mkPickResult
<&> \preEvent ->
Menu.Option
{ Menu._oId = optionId
, Menu._oSubmenuWidgets = Menu.SubmenuEmpty
, Menu._oRender =
(Widget.makeFocusableView ?? optionId <&> fmap)
<*> Styled.label Texts.createNew
<&> (`Menu.RenderedOption` preEvent)
& Styled.withColor TextColors.actionTextColor
}
| 668
| false
| true
| 0
| 19
| 242
| 223
| 117
| 106
| null | null |
imalsogreg/hackage-matrix-builder
|
src/Api/Package.hs
|
gpl-3.0
|
reportsByStamp :: (MonadIO m, MonadConfig m) => m [ReportMeta]
reportsByStamp
= fmap (map toReportMeta . sortBy (flip $ comparing snd))
. liftIO . filesByStamp (".json" `isSuffixOf`)
=<< asksConfig reportDir
where
toReportMeta :: (Text, UTCTime) -> ReportMeta
toReportMeta (a,b) = ReportMeta
{ rmPackageName = PackageName . T.reverse . T.drop 5 . T.reverse $ a
, rmModified = b
}
| 420
|
reportsByStamp :: (MonadIO m, MonadConfig m) => m [ReportMeta]
reportsByStamp
= fmap (map toReportMeta . sortBy (flip $ comparing snd))
. liftIO . filesByStamp (".json" `isSuffixOf`)
=<< asksConfig reportDir
where
toReportMeta :: (Text, UTCTime) -> ReportMeta
toReportMeta (a,b) = ReportMeta
{ rmPackageName = PackageName . T.reverse . T.drop 5 . T.reverse $ a
, rmModified = b
}
| 420
|
reportsByStamp
= fmap (map toReportMeta . sortBy (flip $ comparing snd))
. liftIO . filesByStamp (".json" `isSuffixOf`)
=<< asksConfig reportDir
where
toReportMeta :: (Text, UTCTime) -> ReportMeta
toReportMeta (a,b) = ReportMeta
{ rmPackageName = PackageName . T.reverse . T.drop 5 . T.reverse $ a
, rmModified = b
}
| 357
| false
| true
| 2
| 12
| 98
| 153
| 79
| 74
| null | null |
thalerjonathan/phd
|
thesis/code/sir/src/test/Utils/GenEventSIR.hs
|
gpl-3.0
|
genEventFreq mcf cof rcf (s,i,r) ais
= frequency [ (mcf, return MakeContact)
, (cof, do
ss <- frequency [ (s, return Susceptible)
, (i, return Infected)
, (r, return Recovered)]
ai <- elements ais
return $ Contact ai ss)
, (rcf, return Recover)]
| 397
|
genEventFreq mcf cof rcf (s,i,r) ais
= frequency [ (mcf, return MakeContact)
, (cof, do
ss <- frequency [ (s, return Susceptible)
, (i, return Infected)
, (r, return Recovered)]
ai <- elements ais
return $ Contact ai ss)
, (rcf, return Recover)]
| 397
|
genEventFreq mcf cof rcf (s,i,r) ais
= frequency [ (mcf, return MakeContact)
, (cof, do
ss <- frequency [ (s, return Susceptible)
, (i, return Infected)
, (r, return Recovered)]
ai <- elements ais
return $ Contact ai ss)
, (rcf, return Recover)]
| 397
| false
| false
| 0
| 14
| 194
| 130
| 69
| 61
| null | null |
CloudI/CloudI
|
src/api/haskell/external/binary-0.8.7.0/src/Data/Binary.hs
|
mit
|
-- | Decode a value from a file. In case of errors, 'error' will
-- be called with the error message.
--
-- @since 0.7.0.0
decodeFile :: Binary a => FilePath -> IO a
decodeFile f = do
result <- decodeFileOrFail f
case result of
Right x -> return x
Left (_,str) -> error str
-- | Decode a value from a file. In case of success, the value will be returned
-- in 'Right'. In case of decoder errors, the error message together with
-- the byte offset will be returned.
| 477
|
decodeFile :: Binary a => FilePath -> IO a
decodeFile f = do
result <- decodeFileOrFail f
case result of
Right x -> return x
Left (_,str) -> error str
-- | Decode a value from a file. In case of success, the value will be returned
-- in 'Right'. In case of decoder errors, the error message together with
-- the byte offset will be returned.
| 354
|
decodeFile f = do
result <- decodeFileOrFail f
case result of
Right x -> return x
Left (_,str) -> error str
-- | Decode a value from a file. In case of success, the value will be returned
-- in 'Right'. In case of decoder errors, the error message together with
-- the byte offset will be returned.
| 311
| true
| true
| 0
| 11
| 104
| 82
| 41
| 41
| null | null |
ekmett/search
|
src/Data/Search/Intensional.hs
|
bsd-2-clause
|
worstScore :: Hilbert (Down a) b => (b -> a) -> a
worstScore = pessimalScore epsilon
| 84
|
worstScore :: Hilbert (Down a) b => (b -> a) -> a
worstScore = pessimalScore epsilon
| 84
|
worstScore = pessimalScore epsilon
| 34
| false
| true
| 0
| 8
| 15
| 40
| 20
| 20
| null | null |
ekmett/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcTypes.hs
|
lgpl-2.1
|
withRefPrintDialogData :: (Ptr (TPrintDialogData a) -> IO ()) -> IO (PrintDialogData a)
withRefPrintDialogData f
= assignRef wxPrintDialogData_Create f
| 154
|
withRefPrintDialogData :: (Ptr (TPrintDialogData a) -> IO ()) -> IO (PrintDialogData a)
withRefPrintDialogData f
= assignRef wxPrintDialogData_Create f
| 154
|
withRefPrintDialogData f
= assignRef wxPrintDialogData_Create f
| 66
| false
| true
| 0
| 10
| 20
| 54
| 25
| 29
| null | null |
oldmanmike/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
setOutputDir f = setObjectDir f . setHiDir f . setStubDir f . setDumpDir f
| 75
|
setOutputDir f = setObjectDir f . setHiDir f . setStubDir f . setDumpDir f
| 75
|
setOutputDir f = setObjectDir f . setHiDir f . setStubDir f . setDumpDir f
| 75
| false
| false
| 0
| 8
| 14
| 33
| 14
| 19
| null | null |
sw17ch/Asdf
|
src/Language/Asdf/Misc.hs
|
bsd-3-clause
|
nubByM eq (x:xs) = liftM (x :) $ nubByM eq =<< filterM (\y -> liftM not $ eq x y) xs
| 93
|
nubByM eq (x:xs) = liftM (x :) $ nubByM eq =<< filterM (\y -> liftM not $ eq x y) xs
| 93
|
nubByM eq (x:xs) = liftM (x :) $ nubByM eq =<< filterM (\y -> liftM not $ eq x y) xs
| 93
| false
| false
| 0
| 10
| 29
| 61
| 30
| 31
| null | null |
josuf107/Adverb
|
Adverb/Common.hs
|
gpl-3.0
|
fulsomely = id
| 14
|
fulsomely = id
| 14
|
fulsomely = id
| 14
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
abhin4v/hask-irc
|
hask-irc-core/Network/IRC/Util.hs
|
apache-2.0
|
mergeMaps :: forall map map1 map2.
(IsMap map1, IsMap map2, IsMap map,
MapValue map ~ (MapValue map1, MapValue map2),
ContainerKey map1 ~ ContainerKey map,
ContainerKey map2 ~ ContainerKey map) =>
map1 -> map2 -> map
mergeMaps map1 map2 =
flip (`foldl'` mempty) (mapKeys map1) $ \acc key ->
if key `member` map2
then insertMap key (fromJust $ lookup key map1, fromJust $ lookup key map2) acc
else acc
| 486
|
mergeMaps :: forall map map1 map2.
(IsMap map1, IsMap map2, IsMap map,
MapValue map ~ (MapValue map1, MapValue map2),
ContainerKey map1 ~ ContainerKey map,
ContainerKey map2 ~ ContainerKey map) =>
map1 -> map2 -> map
mergeMaps map1 map2 =
flip (`foldl'` mempty) (mapKeys map1) $ \acc key ->
if key `member` map2
then insertMap key (fromJust $ lookup key map1, fromJust $ lookup key map2) acc
else acc
| 486
|
mergeMaps map1 map2 =
flip (`foldl'` mempty) (mapKeys map1) $ \acc key ->
if key `member` map2
then insertMap key (fromJust $ lookup key map1, fromJust $ lookup key map2) acc
else acc
| 201
| false
| true
| 0
| 11
| 153
| 176
| 91
| 85
| null | null |
diku-dk/futhark
|
src/Futhark/Analysis/PrimExp.hs
|
isc
|
-- | Zero-extend to 32 bit integer.
zExt32 :: IntExp t => TPrimExp t v -> TPrimExp Int32 v
zExt32 = isInt32 . zExt Int32 . untyped
| 130
|
zExt32 :: IntExp t => TPrimExp t v -> TPrimExp Int32 v
zExt32 = isInt32 . zExt Int32 . untyped
| 94
|
zExt32 = isInt32 . zExt Int32 . untyped
| 39
| true
| true
| 0
| 7
| 26
| 44
| 21
| 23
| null | null |
brendanhay/gogol
|
gogol-shopping-content/gen/Network/Google/Resource/Content/Csses/Updatelabels.hs
|
mpl-2.0
|
-- | V1 error format.
cuXgafv :: Lens' CssesUpdatelabels (Maybe Xgafv)
cuXgafv = lens _cuXgafv (\ s a -> s{_cuXgafv = a})
| 121
|
cuXgafv :: Lens' CssesUpdatelabels (Maybe Xgafv)
cuXgafv = lens _cuXgafv (\ s a -> s{_cuXgafv = a})
| 99
|
cuXgafv = lens _cuXgafv (\ s a -> s{_cuXgafv = a})
| 50
| true
| true
| 1
| 9
| 21
| 51
| 25
| 26
| null | null |
glguy/hm
|
src/HM/Example.hs
|
mit
|
termType And = Poly [] (logicType --> logicType --> logicType)
| 62
|
termType And = Poly [] (logicType --> logicType --> logicType)
| 62
|
termType And = Poly [] (logicType --> logicType --> logicType)
| 62
| false
| false
| 0
| 8
| 9
| 27
| 13
| 14
| null | null |
msakai/icfpc2015
|
src/Play.hs
|
bsd-3-clause
|
getGameState :: PlayerM GameState
getGameState = PGetGameState return
| 69
|
getGameState :: PlayerM GameState
getGameState = PGetGameState return
| 69
|
getGameState = PGetGameState return
| 35
| false
| true
| 0
| 5
| 7
| 17
| 8
| 9
| null | null |
alexander-at-github/eta
|
compiler/ETA/DeSugar/DsUtils.hs
|
bsd-3-clause
|
mkDataConCase :: Id -> Type -> [CaseAlt DataCon] -> MatchResult
mkDataConCase _ _ [] = panic "mkDataConCase: no alternatives"
| 139
|
mkDataConCase :: Id -> Type -> [CaseAlt DataCon] -> MatchResult
mkDataConCase _ _ [] = panic "mkDataConCase: no alternatives"
| 139
|
mkDataConCase _ _ [] = panic "mkDataConCase: no alternatives"
| 75
| false
| true
| 0
| 10
| 32
| 46
| 21
| 25
| null | null |
svaiter/fay-canvas
|
src/HtmlCanvas.hs
|
bsd-3-clause
|
clip :: Context -> Fay ()
clip = ffi "%1['clip']()"
| 51
|
clip :: Context -> Fay ()
clip = ffi "%1['clip']()"
| 51
|
clip = ffi "%1['clip']()"
| 25
| false
| true
| 0
| 7
| 9
| 23
| 11
| 12
| null | null |
kevinlmadison/advent_of_code
|
3_year_2017/day02/sol.hs
|
gpl-3.0
|
part_2 :: Integral a => [a] -> a
part_2 xs = head [x `div` y | x <- xs, y <- xs, x /= y && x `mod` y == 0]
| 106
|
part_2 :: Integral a => [a] -> a
part_2 xs = head [x `div` y | x <- xs, y <- xs, x /= y && x `mod` y == 0]
| 106
|
part_2 xs = head [x `div` y | x <- xs, y <- xs, x /= y && x `mod` y == 0]
| 73
| false
| true
| 0
| 11
| 30
| 78
| 41
| 37
| null | null |
Lysxia/twentyseven
|
src/Rubik/Cube/Moves/Internal.hs
|
mit
|
-- | Generating set of @G1@
move6' = [u,d] ++ map (<>^ 2) [l, f, r, b]
| 70
|
move6' = [u,d] ++ map (<>^ 2) [l, f, r, b]
| 42
|
move6' = [u,d] ++ map (<>^ 2) [l, f, r, b]
| 42
| true
| false
| 0
| 7
| 16
| 38
| 23
| 15
| null | null |
snoyberg/ghc
|
compiler/coreSyn/CoreSyn.hs
|
bsd-3-clause
|
-- | There is no known 'Unfolding', because this came from an
-- hi-boot file.
bootUnfolding :: Unfolding
bootUnfolding = BootUnfolding
| 135
|
bootUnfolding :: Unfolding
bootUnfolding = BootUnfolding
| 56
|
bootUnfolding = BootUnfolding
| 29
| true
| true
| 0
| 4
| 20
| 13
| 8
| 5
| null | null |
timjb/eine
|
public/style.hs
|
mit
|
outlineOffset = prop "outline-offset"
| 37
|
outlineOffset = prop "outline-offset"
| 37
|
outlineOffset = prop "outline-offset"
| 37
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
cjdibbs/ardunio
|
src/Arduino/Internal/CodeGen/C.hs
|
bsd-3-clause
|
cTypeStr :: CType -> String
cTypeStr cType = case cType of
CBit -> "bool"
CByte -> "uint8_t"
CWord -> "uint16_t"
CVoid -> "void"
CList _ -> "struct list"
CTuple itemTypes -> "struct tuple" ++ show (length itemTypes)
| 293
|
cTypeStr :: CType -> String
cTypeStr cType = case cType of
CBit -> "bool"
CByte -> "uint8_t"
CWord -> "uint16_t"
CVoid -> "void"
CList _ -> "struct list"
CTuple itemTypes -> "struct tuple" ++ show (length itemTypes)
| 293
|
cTypeStr cType = case cType of
CBit -> "bool"
CByte -> "uint8_t"
CWord -> "uint16_t"
CVoid -> "void"
CList _ -> "struct list"
CTuple itemTypes -> "struct tuple" ++ show (length itemTypes)
| 265
| false
| true
| 8
| 5
| 114
| 82
| 37
| 45
| null | null |
spechub/Hets
|
HasCASL/TypeRel.hs
|
gpl-2.0
|
zc :: VarDecl
zc = mkVarDecl (stringToId "z") cType
| 51
|
zc :: VarDecl
zc = mkVarDecl (stringToId "z") cType
| 51
|
zc = mkVarDecl (stringToId "z") cType
| 37
| false
| true
| 0
| 7
| 8
| 22
| 11
| 11
| null | null |
fmthoma/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
getEqPredRole :: PredType -> Role
getEqPredRole ty
= case splitTyConApp_maybe ty of
Just (tc, [_, _, _])
| tc `hasKey` eqTyConKey -> Nominal
| tc `hasKey` coercibleTyConKey -> Representational
_ -> pprPanic "getEqPredRole" (ppr ty)
-- | Get the equality relation relevant for a pred type.
| 319
|
getEqPredRole :: PredType -> Role
getEqPredRole ty
= case splitTyConApp_maybe ty of
Just (tc, [_, _, _])
| tc `hasKey` eqTyConKey -> Nominal
| tc `hasKey` coercibleTyConKey -> Representational
_ -> pprPanic "getEqPredRole" (ppr ty)
-- | Get the equality relation relevant for a pred type.
| 319
|
getEqPredRole ty
= case splitTyConApp_maybe ty of
Just (tc, [_, _, _])
| tc `hasKey` eqTyConKey -> Nominal
| tc `hasKey` coercibleTyConKey -> Representational
_ -> pprPanic "getEqPredRole" (ppr ty)
-- | Get the equality relation relevant for a pred type.
| 285
| false
| true
| 0
| 11
| 76
| 94
| 49
| 45
| null | null |
elginer/Delve
|
src/DHelper.hs
|
gpl-3.0
|
math_op :: ( Int -> Int -> Int ) -> DelveM ( )
math_op f = do
i1 <- get_arg_int 0
i2 <- get_arg_int 1
res <- fmap PrimAddr $ liftIO $ newIORef $! I $! i1 `f` i2
put_result res
| 187
|
math_op :: ( Int -> Int -> Int ) -> DelveM ( )
math_op f = do
i1 <- get_arg_int 0
i2 <- get_arg_int 1
res <- fmap PrimAddr $ liftIO $ newIORef $! I $! i1 `f` i2
put_result res
| 187
|
math_op f = do
i1 <- get_arg_int 0
i2 <- get_arg_int 1
res <- fmap PrimAddr $ liftIO $ newIORef $! I $! i1 `f` i2
put_result res
| 140
| false
| true
| 0
| 13
| 52
| 92
| 43
| 49
| null | null |
everyevery/programming_study
|
template/haskell/stdin_num_cases.hs
|
mit
|
-- echo :: Int -> Int
echo :: String -> String
echo x = x
| 57
|
echo :: String -> String
echo x = x
| 35
|
echo x = x
| 10
| true
| true
| 0
| 7
| 14
| 25
| 11
| 14
| null | null |
themoritz/cabal
|
Cabal/Distribution/Simple/Build.hs
|
bsd-3-clause
|
buildLib :: Verbosity -> Flag (Maybe Int)
-> PackageDescription -> LocalBuildInfo
-> Library -> ComponentLocalBuildInfo -> IO ()
buildLib verbosity numJobs pkg_descr lbi lib clbi =
case compilerFlavor (compiler lbi) of
GHC -> GHC.buildLib verbosity numJobs pkg_descr lbi lib clbi
GHCJS -> GHCJS.buildLib verbosity numJobs pkg_descr lbi lib clbi
JHC -> JHC.buildLib verbosity pkg_descr lbi lib clbi
LHC -> LHC.buildLib verbosity pkg_descr lbi lib clbi
UHC -> UHC.buildLib verbosity pkg_descr lbi lib clbi
HaskellSuite {} -> HaskellSuite.buildLib verbosity pkg_descr lbi lib clbi
_ -> die' verbosity "Building is not supported with this compiler."
-- | Build a foreign library
--
-- NOTE: We assume that we already checked that we can actually build the
-- foreign library in configure.
| 913
|
buildLib :: Verbosity -> Flag (Maybe Int)
-> PackageDescription -> LocalBuildInfo
-> Library -> ComponentLocalBuildInfo -> IO ()
buildLib verbosity numJobs pkg_descr lbi lib clbi =
case compilerFlavor (compiler lbi) of
GHC -> GHC.buildLib verbosity numJobs pkg_descr lbi lib clbi
GHCJS -> GHCJS.buildLib verbosity numJobs pkg_descr lbi lib clbi
JHC -> JHC.buildLib verbosity pkg_descr lbi lib clbi
LHC -> LHC.buildLib verbosity pkg_descr lbi lib clbi
UHC -> UHC.buildLib verbosity pkg_descr lbi lib clbi
HaskellSuite {} -> HaskellSuite.buildLib verbosity pkg_descr lbi lib clbi
_ -> die' verbosity "Building is not supported with this compiler."
-- | Build a foreign library
--
-- NOTE: We assume that we already checked that we can actually build the
-- foreign library in configure.
| 913
|
buildLib verbosity numJobs pkg_descr lbi lib clbi =
case compilerFlavor (compiler lbi) of
GHC -> GHC.buildLib verbosity numJobs pkg_descr lbi lib clbi
GHCJS -> GHCJS.buildLib verbosity numJobs pkg_descr lbi lib clbi
JHC -> JHC.buildLib verbosity pkg_descr lbi lib clbi
LHC -> LHC.buildLib verbosity pkg_descr lbi lib clbi
UHC -> UHC.buildLib verbosity pkg_descr lbi lib clbi
HaskellSuite {} -> HaskellSuite.buildLib verbosity pkg_descr lbi lib clbi
_ -> die' verbosity "Building is not supported with this compiler."
-- | Build a foreign library
--
-- NOTE: We assume that we already checked that we can actually build the
-- foreign library in configure.
| 729
| false
| true
| 0
| 12
| 247
| 212
| 103
| 109
| null | null |
chreekat/yesod
|
yesod-core/Yesod/Logger.hs
|
bsd-2-clause
|
logText :: Logger -> Text -> IO ()
logText logger = logBS logger . encodeUtf8
| 77
|
logText :: Logger -> Text -> IO ()
logText logger = logBS logger . encodeUtf8
| 77
|
logText logger = logBS logger . encodeUtf8
| 42
| false
| true
| 0
| 8
| 14
| 34
| 16
| 18
| null | null |
melted/idris-java
|
src/IRTS/CodegenJava.hs
|
bsd-3-clause
|
isDefaultOnlyCase :: [SAlt] -> Bool
isDefaultOnlyCase [SDefaultCase _] = True
| 77
|
isDefaultOnlyCase :: [SAlt] -> Bool
isDefaultOnlyCase [SDefaultCase _] = True
| 77
|
isDefaultOnlyCase [SDefaultCase _] = True
| 41
| false
| true
| 0
| 6
| 9
| 31
| 15
| 16
| null | null |
ryna4c2e/chage
|
ChageComp.hs
|
mit
|
test1 = AST [
Declare (Var "x") S32Int (Arith () Add
(Arith () Xor (ConstS32Int () 3) (ConstS32Int () 4))
(ConstS32Int () 5))]
| 205
|
test1 = AST [
Declare (Var "x") S32Int (Arith () Add
(Arith () Xor (ConstS32Int () 3) (ConstS32Int () 4))
(ConstS32Int () 5))]
| 205
|
test1 = AST [
Declare (Var "x") S32Int (Arith () Add
(Arith () Xor (ConstS32Int () 3) (ConstS32Int () 4))
(ConstS32Int () 5))]
| 205
| false
| false
| 1
| 13
| 101
| 86
| 41
| 45
| null | null |
roberth/uu-helium
|
src/Helium/Parser/Parser.hs
|
gpl-3.0
|
import_ :: HParser Import
import_ = addRange $
do
n <- var
return $ \r -> Import_Variable r n
{-
cdecls -> " {" decl1 ";" .... ";" decln "}" (n>=0)
-}
{-
cdecl -> vars "::" type (type signature)
| (funlhs | var) rhs
-}
| 250
|
import_ :: HParser Import
import_ = addRange $
do
n <- var
return $ \r -> Import_Variable r n
{-
cdecls -> " {" decl1 ";" .... ";" decln "}" (n>=0)
-}
{-
cdecl -> vars "::" type (type signature)
| (funlhs | var) rhs
-}
| 250
|
import_ = addRange $
do
n <- var
return $ \r -> Import_Variable r n
{-
cdecls -> " {" decl1 ";" .... ";" decln "}" (n>=0)
-}
{-
cdecl -> vars "::" type (type signature)
| (funlhs | var) rhs
-}
| 224
| false
| true
| 0
| 10
| 77
| 44
| 22
| 22
| null | null |
text-utf8/text
|
Data/Text.hs
|
bsd-2-clause
|
-- -----------------------------------------------------------------------------
-- * Building 'Text's
-- | /O(n)/ 'scanl' is similar to 'foldl', but returns a list of
-- successive reduced values from the left. Subject to fusion.
-- Performs replacement on invalid scalar values.
--
-- > scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
--
-- Note that
--
-- > last (scanl f z xs) == foldl f z xs.
scanl :: (Char -> Char -> Char) -> Char -> Text -> Text
scanl f z t = unstream (S.scanl g z (stream t))
where g a b = safe (f a b)
| 551
|
scanl :: (Char -> Char -> Char) -> Char -> Text -> Text
scanl f z t = unstream (S.scanl g z (stream t))
where g a b = safe (f a b)
| 135
|
scanl f z t = unstream (S.scanl g z (stream t))
where g a b = safe (f a b)
| 79
| true
| true
| 0
| 9
| 111
| 96
| 53
| 43
| null | null |
ComputationWithBoundedResources/tct-trs
|
src/Tct/Trs/Processor/Matrix/NaturalMI.hs
|
bsd-3-clause
|
weightGapDeclaration :: CD.Declaration (
'[ CD.Argument 'CD.Optional Int
, CD.Argument 'CD.Optional Int
, CD.Argument 'CD.Optional NaturalMIKind
, CD.Argument 'CD.Optional Arg.UsableArgs
, CD.Argument 'CD.Optional WgOn
] CD.:-> CD.Strategy Prob.Trs Prob.Trs)
weightGapDeclaration = CD.declare "weightgap" wgDescription (argDim,argDeg, argNMIKind, argUA, argWgOn) weightGapStrategy
where
wgDescription = [ "Uses the weight gap principle to shift some strict rules to the weak part of the problem"]
argDim = dimArg `CD.optional` 1
argDeg = degArg `CD.optional` 1
argNMIKind = nmiKindArg `CD.optional` Algebraic
argUA = Arg.usableArgs `CD.optional` Arg.UArgs
argWgOn = CD.flag "on"
[ "This flag determines which rule have to be strictly oriented by the the matrix interpretation for the weight gap principle. "
, "Here 'trs' refers to all strict non-dependency-pair rules of the considered problem, "
, "while 'any' only demands any rule at all to be strictly oriented. "
, "The default value is 'trs'."]
`CD.optional` WgOnAny
| 1,090
|
weightGapDeclaration :: CD.Declaration (
'[ CD.Argument 'CD.Optional Int
, CD.Argument 'CD.Optional Int
, CD.Argument 'CD.Optional NaturalMIKind
, CD.Argument 'CD.Optional Arg.UsableArgs
, CD.Argument 'CD.Optional WgOn
] CD.:-> CD.Strategy Prob.Trs Prob.Trs)
weightGapDeclaration = CD.declare "weightgap" wgDescription (argDim,argDeg, argNMIKind, argUA, argWgOn) weightGapStrategy
where
wgDescription = [ "Uses the weight gap principle to shift some strict rules to the weak part of the problem"]
argDim = dimArg `CD.optional` 1
argDeg = degArg `CD.optional` 1
argNMIKind = nmiKindArg `CD.optional` Algebraic
argUA = Arg.usableArgs `CD.optional` Arg.UArgs
argWgOn = CD.flag "on"
[ "This flag determines which rule have to be strictly oriented by the the matrix interpretation for the weight gap principle. "
, "Here 'trs' refers to all strict non-dependency-pair rules of the considered problem, "
, "while 'any' only demands any rule at all to be strictly oriented. "
, "The default value is 'trs'."]
`CD.optional` WgOnAny
| 1,090
|
weightGapDeclaration = CD.declare "weightgap" wgDescription (argDim,argDeg, argNMIKind, argUA, argWgOn) weightGapStrategy
where
wgDescription = [ "Uses the weight gap principle to shift some strict rules to the weak part of the problem"]
argDim = dimArg `CD.optional` 1
argDeg = degArg `CD.optional` 1
argNMIKind = nmiKindArg `CD.optional` Algebraic
argUA = Arg.usableArgs `CD.optional` Arg.UArgs
argWgOn = CD.flag "on"
[ "This flag determines which rule have to be strictly oriented by the the matrix interpretation for the weight gap principle. "
, "Here 'trs' refers to all strict non-dependency-pair rules of the considered problem, "
, "while 'any' only demands any rule at all to be strictly oriented. "
, "The default value is 'trs'."]
`CD.optional` WgOnAny
| 815
| false
| true
| 2
| 12
| 208
| 234
| 129
| 105
| null | null |
mwu-tow/cuda
|
examples/src/bandwidthTest/BandwidthTest.hs
|
bsd-3-clause
|
bandwidth DeviceToHost Pageable n =
allocaArray n $ \h_ptr ->
CUDA.withListArray [1..n] $ \d_ptr ->
bench n (CUDA.peekArray n d_ptr h_ptr)
| 156
|
bandwidth DeviceToHost Pageable n =
allocaArray n $ \h_ptr ->
CUDA.withListArray [1..n] $ \d_ptr ->
bench n (CUDA.peekArray n d_ptr h_ptr)
| 156
|
bandwidth DeviceToHost Pageable n =
allocaArray n $ \h_ptr ->
CUDA.withListArray [1..n] $ \d_ptr ->
bench n (CUDA.peekArray n d_ptr h_ptr)
| 156
| false
| false
| 0
| 12
| 38
| 61
| 30
| 31
| null | null |
tsiliakis/xmobar
|
src/Plugins/EWMH.hs
|
bsd-3-clause
|
fmt :: EwmhState -> Component -> String
fmt e (Text s) = s
| 58
|
fmt :: EwmhState -> Component -> String
fmt e (Text s) = s
| 58
|
fmt e (Text s) = s
| 18
| false
| true
| 0
| 7
| 12
| 35
| 16
| 19
| null | null |
pdmurray/haskell-book-ex
|
src/ch11/Exercises11.17.hs
|
bsd-3-clause
|
testPreorder :: IO ()
testPreorder =
if preorder testTree == [2, 1, 3]
then putStrLn "Preorder fine!"
else putStrLn "Bad news bears."
| 146
|
testPreorder :: IO ()
testPreorder =
if preorder testTree == [2, 1, 3]
then putStrLn "Preorder fine!"
else putStrLn "Bad news bears."
| 145
|
testPreorder =
if preorder testTree == [2, 1, 3]
then putStrLn "Preorder fine!"
else putStrLn "Bad news bears."
| 123
| false
| true
| 0
| 7
| 34
| 46
| 24
| 22
| null | null |
silkapp/cassava
|
tests/UnitTests.hs
|
bsd-3-clause
|
assertResult :: BL.ByteString -> [[B.ByteString]]
-> Either String (V.Vector (V.Vector B.ByteString)) -> Assertion
assertResult input expected res = case res of
Right r -> V.fromList (map V.fromList expected) @=? r
Left err -> assertFailure $
" input: " ++ show (BL8.unpack input) ++ "\n" ++
"parse error: " ++ err
| 373
|
assertResult :: BL.ByteString -> [[B.ByteString]]
-> Either String (V.Vector (V.Vector B.ByteString)) -> Assertion
assertResult input expected res = case res of
Right r -> V.fromList (map V.fromList expected) @=? r
Left err -> assertFailure $
" input: " ++ show (BL8.unpack input) ++ "\n" ++
"parse error: " ++ err
| 373
|
assertResult input expected res = case res of
Right r -> V.fromList (map V.fromList expected) @=? r
Left err -> assertFailure $
" input: " ++ show (BL8.unpack input) ++ "\n" ++
"parse error: " ++ err
| 245
| false
| true
| 0
| 15
| 108
| 141
| 67
| 74
| null | null |
nevrenato/Hets_Fork
|
CASL_DL/PredefinedCASLAxioms.hs
|
gpl-2.0
|
consChar :: Char -> TERM () -> TERM ()
consChar c t = mkAppl (mkQualOp cons $ toOP_TYPE consTy) [mkChar c, t]
| 109
|
consChar :: Char -> TERM () -> TERM ()
consChar c t = mkAppl (mkQualOp cons $ toOP_TYPE consTy) [mkChar c, t]
| 109
|
consChar c t = mkAppl (mkQualOp cons $ toOP_TYPE consTy) [mkChar c, t]
| 70
| false
| true
| 0
| 9
| 21
| 66
| 30
| 36
| null | null |
wavewave/hxournal
|
lib/Application/HXournal/GUI/Menu.hs
|
bsd-2-clause
|
int2Point PenWork 4 = predefined_verythick
| 42
|
int2Point PenWork 4 = predefined_verythick
| 42
|
int2Point PenWork 4 = predefined_verythick
| 42
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
et4te/zero
|
src/Zero/Account/Profile/Widget.hs
|
bsd-3-clause
|
routePath Nothing _ _ =
error "Error routing profile path."
| 61
|
routePath Nothing _ _ =
error "Error routing profile path."
| 61
|
routePath Nothing _ _ =
error "Error routing profile path."
| 61
| false
| false
| 0
| 5
| 11
| 16
| 7
| 9
| null | null |
abakst/symmetry
|
background/fixpoint/pingNProcsSched.hs
|
mit
|
{-@ embed Map as Map_t @-}
{-@ measure Map_select :: Map a b -> a -> b @-}
{-@ measure Map_store :: Map a b -> a -> b -> Map a b @-}
{-@ emp :: {v:Map Int {v:Int | v = 0} | true} @-}
emp :: Map Int Int
emp = undefined
| 236
|
emp :: Map Int Int
emp = undefined
| 34
|
emp = undefined
| 15
| true
| true
| 1
| 5
| 73
| 24
| 12
| 12
| null | null |
acowley/ghc
|
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
|
bsd-3-clause
|
{- | @reifyInstances nm tys@ returns a list of visible instances of @nm tys@. That is,
if @nm@ is the name of a type class, then all instances of this class at the types @tys@
are returned. Alternatively, if @nm@ is the name of a data family or type family,
all instances of this family at the types @tys@ are returned.
-}
reifyInstances :: Name -> [Type] -> Q [InstanceDec]
reifyInstances cls tys = Q (qReifyInstances cls tys)
| 427
|
reifyInstances :: Name -> [Type] -> Q [InstanceDec]
reifyInstances cls tys = Q (qReifyInstances cls tys)
| 104
|
reifyInstances cls tys = Q (qReifyInstances cls tys)
| 52
| true
| true
| 0
| 8
| 77
| 45
| 23
| 22
| null | null |
antalsz/hs-to-coq
|
src/lib/HsToCoq/ConvertHaskell/Pattern.hs
|
mit
|
refutability (NumPat _) = pure Refutable
| 56
|
refutability (NumPat _) = pure Refutable
| 56
|
refutability (NumPat _) = pure Refutable
| 56
| false
| false
| 0
| 7
| 21
| 18
| 8
| 10
| null | null |
bergmark/http2
|
Network/HTTP2/Types.hs
|
bsd-3-clause
|
----------------------------------------------------------------
-- | The length of HTTP/2 frame header.
--
-- >>> frameHeaderLength
-- 9
frameHeaderLength :: Int
frameHeaderLength = 9
| 185
|
frameHeaderLength :: Int
frameHeaderLength = 9
| 46
|
frameHeaderLength = 9
| 21
| true
| true
| 0
| 6
| 21
| 23
| 12
| 11
| null | null |
marcellussiegburg/autotool
|
collection/src/Baum/AVL/Type.hs
|
gpl-2.0
|
inorder :: AVLTree a -> [a]
inorder = foldt ( \ l k r -> l ++ [k] ++ r ) []
| 75
|
inorder :: AVLTree a -> [a]
inorder = foldt ( \ l k r -> l ++ [k] ++ r ) []
| 75
|
inorder = foldt ( \ l k r -> l ++ [k] ++ r ) []
| 47
| false
| true
| 0
| 10
| 21
| 51
| 27
| 24
| null | null |
bos/critbit
|
Data/CritBit/Set.hs
|
bsd-2-clause
|
-- | /O(k)/. Find smallest element greater than the given one.
--
-- > lookupGT "b" (fromList ["a", "b"]) == Nothing
-- > lookupGT "aa" (fromList ["a", "b"]) == Just "b"
-- > lookupGT "a" (fromList ["a", "b"]) == Just "b"
lookupGT :: (CritBitKey a) => a -> Set a -> Maybe a
lookupGT = wrapVS (fmap fst) T.lookupGT
| 315
|
lookupGT :: (CritBitKey a) => a -> Set a -> Maybe a
lookupGT = wrapVS (fmap fst) T.lookupGT
| 91
|
lookupGT = wrapVS (fmap fst) T.lookupGT
| 39
| true
| true
| 0
| 8
| 60
| 52
| 28
| 24
| null | null |
ribag/ganeti-experiments
|
src/Ganeti/Constants.hs
|
gpl-2.0
|
-- * Syslog
syslogUsage :: String
syslogUsage = AutoConf.syslogUsage
| 69
|
syslogUsage :: String
syslogUsage = AutoConf.syslogUsage
| 56
|
syslogUsage = AutoConf.syslogUsage
| 34
| true
| true
| 0
| 5
| 9
| 14
| 8
| 6
| null | null |
noughtmare/hypercube
|
src/Hypercube/Config.hs
|
gpl-3.0
|
-- An empty hourglass shape
hourglass :: V3 Int -> Block
hourglass (V3 x y z) = if y*y >= x*x + z*z then Air else Stone
| 119
|
hourglass :: V3 Int -> Block
hourglass (V3 x y z) = if y*y >= x*x + z*z then Air else Stone
| 91
|
hourglass (V3 x y z) = if y*y >= x*x + z*z then Air else Stone
| 62
| true
| true
| 0
| 10
| 26
| 66
| 32
| 34
| null | null |
phischu/fragnix
|
tests/packages/scotty/Data.Vector.Generic.hs
|
bsd-3-clause
|
postscanr f z = unstreamR . inplace (S.postscanl (flip f) z) id . streamR
| 73
|
postscanr f z = unstreamR . inplace (S.postscanl (flip f) z) id . streamR
| 73
|
postscanr f z = unstreamR . inplace (S.postscanl (flip f) z) id . streamR
| 73
| false
| false
| 0
| 11
| 13
| 40
| 19
| 21
| null | null |
mrmonday/Idris-dev
|
src/Idris/REPLParser.hs
|
bsd-3-clause
|
namespaceArg :: ([String] -> Command) -> String -> P.IdrisParser (Either String Command)
namespaceArg = genArg "namespace" (fmap (toNS . fst) P.identifier)
where
toNS = splitOn "."
| 188
|
namespaceArg :: ([String] -> Command) -> String -> P.IdrisParser (Either String Command)
namespaceArg = genArg "namespace" (fmap (toNS . fst) P.identifier)
where
toNS = splitOn "."
| 188
|
namespaceArg = genArg "namespace" (fmap (toNS . fst) P.identifier)
where
toNS = splitOn "."
| 99
| false
| true
| 1
| 10
| 33
| 85
| 39
| 46
| null | null |
ysnrkdm/Hamlet
|
src/BitBoard.hs
|
mit
|
getBoardForTurn (Bb _ white Piece.W) = white
| 44
|
getBoardForTurn (Bb _ white Piece.W) = white
| 44
|
getBoardForTurn (Bb _ white Piece.W) = white
| 44
| false
| false
| 0
| 7
| 6
| 22
| 10
| 12
| null | null |
anton-dessiatov/stack
|
src/Stack/Types/Docker.hs
|
bsd-3-clause
|
dockerEnableArgName :: Text
dockerEnableArgName = "enable"
| 58
|
dockerEnableArgName :: Text
dockerEnableArgName = "enable"
| 58
|
dockerEnableArgName = "enable"
| 30
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
danstiner/dupes
|
src/Dupes/WorkingDirectory.hs
|
mit
|
construct :: FilePath -> WorkingDirectory
construct = WorkingDirectory
| 70
|
construct :: FilePath -> WorkingDirectory
construct = WorkingDirectory
| 70
|
construct = WorkingDirectory
| 28
| false
| true
| 0
| 5
| 7
| 15
| 8
| 7
| null | null |
bitemyapp/Haskell-Turtle-Library
|
src/Turtle/Pattern.hs
|
bsd-3-clause
|
{-| Patterns that match multiple times are greedy by default, meaning that they
try to match as many times as possible. The `selfless` combinator makes a
pattern match as few times as possible
This only changes the order in which solutions are returned, by prioritizing
less greedy solutions
>>> match (prefix (selfless (some anyChar))) "123"
["1","12","123"]
>>> match (prefix (some anyChar) ) "123"
["123","12","1"]
-}
selfless :: Pattern a -> Pattern a
selfless p = Pattern (StateT (\s -> reverse (runStateT (runPattern p) s)))
| 559
|
selfless :: Pattern a -> Pattern a
selfless p = Pattern (StateT (\s -> reverse (runStateT (runPattern p) s)))
| 109
|
selfless p = Pattern (StateT (\s -> reverse (runStateT (runPattern p) s)))
| 74
| true
| true
| 0
| 14
| 112
| 64
| 30
| 34
| null | null |
mavenraven/chronic-haskell
|
tests/TestSuite.hs
|
bsd-3-clause
|
testHandleSmRmnSy :: Test
testHandleSmRmnSy = testGroup "test_handle_sm_rmn_sy"
[ exactComparisonCase "1"
(actualTime (timeLiteral (fmt "%F %T") "2011-03-30 12:00:00"))
(testTime "30-Mar-11")
(currentTime chronicNowTime)
(parserOptions [])
, exactComparisonCase "2"
(actualTime (timeLiteral (fmt "%F %T") "2012-08-31 12:00:00"))
(testTime "31-Aug-12")
(currentTime chronicNowTime)
(parserOptions [])
]
| 484
|
testHandleSmRmnSy :: Test
testHandleSmRmnSy = testGroup "test_handle_sm_rmn_sy"
[ exactComparisonCase "1"
(actualTime (timeLiteral (fmt "%F %T") "2011-03-30 12:00:00"))
(testTime "30-Mar-11")
(currentTime chronicNowTime)
(parserOptions [])
, exactComparisonCase "2"
(actualTime (timeLiteral (fmt "%F %T") "2012-08-31 12:00:00"))
(testTime "31-Aug-12")
(currentTime chronicNowTime)
(parserOptions [])
]
| 484
|
testHandleSmRmnSy = testGroup "test_handle_sm_rmn_sy"
[ exactComparisonCase "1"
(actualTime (timeLiteral (fmt "%F %T") "2011-03-30 12:00:00"))
(testTime "30-Mar-11")
(currentTime chronicNowTime)
(parserOptions [])
, exactComparisonCase "2"
(actualTime (timeLiteral (fmt "%F %T") "2012-08-31 12:00:00"))
(testTime "31-Aug-12")
(currentTime chronicNowTime)
(parserOptions [])
]
| 458
| false
| true
| 0
| 12
| 122
| 125
| 62
| 63
| null | null |
rfranek/duckling
|
Duckling/Numeral/CS/Corpus.hs
|
bsd-3-clause
|
allExamples :: [Example]
allExamples = concat
[ examples (NumeralValue 0)
[ "0"
, "nula"
]
, examples (NumeralValue 1)
[ "1"
, "jeden"
, "jedna"
, "jedno"
]
, examples (NumeralValue 2)
[ "dva"
, "dvĕ"
]
, examples (NumeralValue 3)
[ "tři"
]
, examples (NumeralValue 4)
[ "čtyři"
]
]
| 489
|
allExamples :: [Example]
allExamples = concat
[ examples (NumeralValue 0)
[ "0"
, "nula"
]
, examples (NumeralValue 1)
[ "1"
, "jeden"
, "jedna"
, "jedno"
]
, examples (NumeralValue 2)
[ "dva"
, "dvĕ"
]
, examples (NumeralValue 3)
[ "tři"
]
, examples (NumeralValue 4)
[ "čtyři"
]
]
| 489
|
allExamples = concat
[ examples (NumeralValue 0)
[ "0"
, "nula"
]
, examples (NumeralValue 1)
[ "1"
, "jeden"
, "jedna"
, "jedno"
]
, examples (NumeralValue 2)
[ "dva"
, "dvĕ"
]
, examples (NumeralValue 3)
[ "tři"
]
, examples (NumeralValue 4)
[ "čtyři"
]
]
| 464
| false
| true
| 0
| 8
| 258
| 117
| 64
| 53
| null | null |
frantisekfarka/ghc-dsi
|
compiler/nativeGen/X86/Ppr.hs
|
bsd-3-clause
|
greg :: Reg -> RegNo -> SDoc
greg reg offset = text "%st(" <> int (gregno reg - firstfake+offset) <> char ')'
| 109
|
greg :: Reg -> RegNo -> SDoc
greg reg offset = text "%st(" <> int (gregno reg - firstfake+offset) <> char ')'
| 109
|
greg reg offset = text "%st(" <> int (gregno reg - firstfake+offset) <> char ')'
| 80
| false
| true
| 0
| 11
| 21
| 60
| 27
| 33
| null | null |
andyarvanitis/Idris-dev
|
src/Idris/Core/CaseTree.hs
|
bsd-3-clause
|
partition xs = error $ "Partition " ++ show xs
| 46
|
partition xs = error $ "Partition " ++ show xs
| 46
|
partition xs = error $ "Partition " ++ show xs
| 46
| false
| false
| 0
| 6
| 9
| 20
| 9
| 11
| null | null |
beni55/logging-facade
|
src/System/Logging/Facade.hs
|
mit
|
-- | Produce a log message with log level `WARN`.
warn :: with_loc Logging m => String -> m ()
warn = log WARN
| 110
|
warn :: with_loc Logging m => String -> m ()
warn = log WARN
| 60
|
warn = log WARN
| 15
| true
| true
| 0
| 9
| 23
| 38
| 17
| 21
| null | null |
petertseng/adventofcode-hs
|
bin/12_json_numbers.hs
|
apache-2.0
|
parseC '{' ps = Right (pushNest (Object False) ps { objSum = 0:objSum ps })
| 75
|
parseC '{' ps = Right (pushNest (Object False) ps { objSum = 0:objSum ps })
| 75
|
parseC '{' ps = Right (pushNest (Object False) ps { objSum = 0:objSum ps })
| 75
| false
| false
| 0
| 11
| 14
| 43
| 21
| 22
| null | null |
saep/neil
|
src/Text/Latex/TexSoup.hs
|
bsd-3-clause
|
square = parserOne Square "[" "]" tex
| 37
|
square = parserOne Square "[" "]" tex
| 37
|
square = parserOne Square "[" "]" tex
| 37
| false
| false
| 1
| 5
| 6
| 19
| 7
| 12
| null | null |
kvelicka/Fizz
|
FixedPrecisionMath.hs
|
lgpl-2.1
|
-- Previous IntOps.hs
-- Closest integer approximation to square root
-- (could also compute lower bound too)
intSqroot :: Int -> Int
intSqroot i = intSqroot' 0 (rootBound i)
where
-- invariant: lo*lo <= i && i <= hi*hi
intSqroot' lo hi | hi == lo = hi
| hi == lo+1 = case compare (i-lo*lo) (hi*hi-i) of
LT -> lo
EQ -> lo
GT -> hi
| otherwise = let mid = (lo+hi) `div` 2 in
case compare (mid*mid) i of
LT -> intSqroot' mid hi
EQ -> mid
GT -> intSqroot' lo mid
| 744
|
intSqroot :: Int -> Int
intSqroot i = intSqroot' 0 (rootBound i)
where
-- invariant: lo*lo <= i && i <= hi*hi
intSqroot' lo hi | hi == lo = hi
| hi == lo+1 = case compare (i-lo*lo) (hi*hi-i) of
LT -> lo
EQ -> lo
GT -> hi
| otherwise = let mid = (lo+hi) `div` 2 in
case compare (mid*mid) i of
LT -> intSqroot' mid hi
EQ -> mid
GT -> intSqroot' lo mid
| 634
|
intSqroot i = intSqroot' 0 (rootBound i)
where
-- invariant: lo*lo <= i && i <= hi*hi
intSqroot' lo hi | hi == lo = hi
| hi == lo+1 = case compare (i-lo*lo) (hi*hi-i) of
LT -> lo
EQ -> lo
GT -> hi
| otherwise = let mid = (lo+hi) `div` 2 in
case compare (mid*mid) i of
LT -> intSqroot' mid hi
EQ -> mid
GT -> intSqroot' lo mid
| 610
| true
| true
| 2
| 11
| 379
| 207
| 101
| 106
| null | null |
jdpage/xmonad-config
|
lib/XMonad/Util/MPD.hs
|
mit
|
ncmpcKeys' :: XPConfig -> M.Map (KeyMask, KeySym) (X ()) -> X ()
ncmpcKeys' config map = submap $ map <+> M.fromList
[ ((0, xK_s), withMPDX stop)
, ((shiftMask, xK_p), withMPDX toggle)
, ((shiftMask, xK_comma), withMPDX previous)
, ((shiftMask, xK_period), withMPDX next)
, ((0, xK_BackSpace), withMPDX (seekcur 0))
, ((shiftMask, xK_BackSpace), withMPDX (play $ Just 0))
, ((0, xK_r), withMPDX toggleRepeat)
, ((0, xK_z), withMPDX toggleRandom)
, ((0, xK_y), withMPDX toggleSingle)
, ((shiftMask, xK_r), withMPDX toggleConsume)
, ((shiftMask, xK_z), withMPDX (shuffle Nothing))
, ((0, xK_u), withMPDX (update []))
, ((0, xK_c), withMPDX clear)
, ((0, xK_a), addMusicPrompt config)
]
| 922
|
ncmpcKeys' :: XPConfig -> M.Map (KeyMask, KeySym) (X ()) -> X ()
ncmpcKeys' config map = submap $ map <+> M.fromList
[ ((0, xK_s), withMPDX stop)
, ((shiftMask, xK_p), withMPDX toggle)
, ((shiftMask, xK_comma), withMPDX previous)
, ((shiftMask, xK_period), withMPDX next)
, ((0, xK_BackSpace), withMPDX (seekcur 0))
, ((shiftMask, xK_BackSpace), withMPDX (play $ Just 0))
, ((0, xK_r), withMPDX toggleRepeat)
, ((0, xK_z), withMPDX toggleRandom)
, ((0, xK_y), withMPDX toggleSingle)
, ((shiftMask, xK_r), withMPDX toggleConsume)
, ((shiftMask, xK_z), withMPDX (shuffle Nothing))
, ((0, xK_u), withMPDX (update []))
, ((0, xK_c), withMPDX clear)
, ((0, xK_a), addMusicPrompt config)
]
| 922
|
ncmpcKeys' config map = submap $ map <+> M.fromList
[ ((0, xK_s), withMPDX stop)
, ((shiftMask, xK_p), withMPDX toggle)
, ((shiftMask, xK_comma), withMPDX previous)
, ((shiftMask, xK_period), withMPDX next)
, ((0, xK_BackSpace), withMPDX (seekcur 0))
, ((shiftMask, xK_BackSpace), withMPDX (play $ Just 0))
, ((0, xK_r), withMPDX toggleRepeat)
, ((0, xK_z), withMPDX toggleRandom)
, ((0, xK_y), withMPDX toggleSingle)
, ((shiftMask, xK_r), withMPDX toggleConsume)
, ((shiftMask, xK_z), withMPDX (shuffle Nothing))
, ((0, xK_u), withMPDX (update []))
, ((0, xK_c), withMPDX clear)
, ((0, xK_a), addMusicPrompt config)
]
| 857
| false
| true
| 0
| 12
| 336
| 345
| 200
| 145
| null | null |
dterei/memcache-hs
|
Database/Memcache/Errors.hs
|
bsd-3-clause
|
-- | Create a properly formatted 'WrongOp' protocol error.
wrongOp :: Response -> String -> MemcacheError
wrongOp r msg = ProtocolError $
WrongOp {
protocolError = "Expected " ++ msg ++ "! Got: " ++ show (resOp r)
}
| 232
|
wrongOp :: Response -> String -> MemcacheError
wrongOp r msg = ProtocolError $
WrongOp {
protocolError = "Expected " ++ msg ++ "! Got: " ++ show (resOp r)
}
| 173
|
wrongOp r msg = ProtocolError $
WrongOp {
protocolError = "Expected " ++ msg ++ "! Got: " ++ show (resOp r)
}
| 126
| true
| true
| 0
| 11
| 55
| 58
| 30
| 28
| null | null |
sdiehl/ghc
|
compiler/GHC/Cmm/Dataflow.hs
|
bsd-3-clause
|
rewriteCmm
:: Direction
-> DataflowLattice f
-> RewriteFun f
-> CmmGraph
-> FactBase f
-> UniqSM (CmmGraph, FactBase f)
rewriteCmm dir lattice rwFun cmmGraph initFact = {-# SCC rewriteCmm #-} do
let entry = g_entry cmmGraph
hooplGraph = g_graph cmmGraph
blockMap1 =
case hooplGraph of
GMany NothingO bm NothingO -> bm
(blockMap2, facts) <-
fixpointRewrite dir lattice rwFun entry blockMap1 initFact
return (cmmGraph {g_graph = GMany NothingO blockMap2 NothingO}, facts)
| 557
|
rewriteCmm
:: Direction
-> DataflowLattice f
-> RewriteFun f
-> CmmGraph
-> FactBase f
-> UniqSM (CmmGraph, FactBase f)
rewriteCmm dir lattice rwFun cmmGraph initFact = {-# SCC rewriteCmm #-} do
let entry = g_entry cmmGraph
hooplGraph = g_graph cmmGraph
blockMap1 =
case hooplGraph of
GMany NothingO bm NothingO -> bm
(blockMap2, facts) <-
fixpointRewrite dir lattice rwFun entry blockMap1 initFact
return (cmmGraph {g_graph = GMany NothingO blockMap2 NothingO}, facts)
| 557
|
rewriteCmm dir lattice rwFun cmmGraph initFact = {-# SCC rewriteCmm #-} do
let entry = g_entry cmmGraph
hooplGraph = g_graph cmmGraph
blockMap1 =
case hooplGraph of
GMany NothingO bm NothingO -> bm
(blockMap2, facts) <-
fixpointRewrite dir lattice rwFun entry blockMap1 initFact
return (cmmGraph {g_graph = GMany NothingO blockMap2 NothingO}, facts)
| 413
| false
| true
| 0
| 14
| 157
| 164
| 79
| 85
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.