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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AubreyEAnderson/shellcheck
|
ShellCheck/Analytics.hs
|
gpl-3.0
|
prop_checkCharRangeGlob3 = verify checkCharRangeGlob "ls [10-15]"
| 65
|
prop_checkCharRangeGlob3 = verify checkCharRangeGlob "ls [10-15]"
| 65
|
prop_checkCharRangeGlob3 = verify checkCharRangeGlob "ls [10-15]"
| 65
| false
| false
| 0
| 5
| 5
| 11
| 5
| 6
| null | null |
syoyo/lucille
|
rnd/HaskellRSLCompiler/RSL/CodeGenC.hs
|
bsd-3-clause
|
includeHeaderLine = text "#include <li_shader.h>"
| 49
|
includeHeaderLine = text "#include <li_shader.h>"
| 49
|
includeHeaderLine = text "#include <li_shader.h>"
| 49
| false
| false
| 0
| 5
| 4
| 9
| 4
| 5
| null | null |
ancientlanguage/haskell-analysis
|
prepare/src/Prepare/Decompose.hs
|
mit
|
decomposeChar '\xF987' = "\x9A6A"
| 33
|
decomposeChar '\xF987' = "\x9A6A"
| 33
|
decomposeChar '\xF987' = "\x9A6A"
| 33
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
candidtim/euler
|
test/Problem5Tests.hs
|
bsd-3-clause
|
testMultipleOfAll :: Test
testMultipleOfAll = TestCase $ do
assertBool "6 is multiple of all 1,2,3" (6 `multipleOfAll` [1,2,3])
assertBool "9 is multiple of 3" (9 `multipleOfAll` [3])
assertBool "9 is not multiple of both 2 and 3" (not (9 `multipleOfAll` [2,3]))
| 268
|
testMultipleOfAll :: Test
testMultipleOfAll = TestCase $ do
assertBool "6 is multiple of all 1,2,3" (6 `multipleOfAll` [1,2,3])
assertBool "9 is multiple of 3" (9 `multipleOfAll` [3])
assertBool "9 is not multiple of both 2 and 3" (not (9 `multipleOfAll` [2,3]))
| 268
|
testMultipleOfAll = TestCase $ do
assertBool "6 is multiple of all 1,2,3" (6 `multipleOfAll` [1,2,3])
assertBool "9 is multiple of 3" (9 `multipleOfAll` [3])
assertBool "9 is not multiple of both 2 and 3" (not (9 `multipleOfAll` [2,3]))
| 242
| false
| true
| 0
| 13
| 46
| 90
| 50
| 40
| null | null |
SKA-ScienceDataProcessor/RC
|
MS2/lib/DNA/Controller.hs
|
apache-2.0
|
nodeController :: Process ()
-- We have to jump through quite elaborate hoops because we cannot
-- make closure of nodeController inside body of function. (Necessary
-- functions are only visible after remotable call). Instead we send
-- closure as message.
nodeController = do
(self,parent,subcads) <- expect
me <- getSelfPid
local <- getSelfNode
-- FIXME: assumes reliability. Process spaning may in fact fail
cads <- forM subcads $ \(CAD nid rest) -> do
pid <- spawn nid self
send pid (self,me,rest)
expect
let ninfo = NodeInfo { nodeCP = NCP me
-- FIXME: notion of parent.
, nodeParent = Just (NCP parent)
, nodeID = local
}
send parent $ CAD ninfo cads
-- FIXME: here we just block eternally to keep process alive. We
-- need to figure out whether we need this process
() <- expect
return ()
| 984
|
nodeController :: Process ()
nodeController = do
(self,parent,subcads) <- expect
me <- getSelfPid
local <- getSelfNode
-- FIXME: assumes reliability. Process spaning may in fact fail
cads <- forM subcads $ \(CAD nid rest) -> do
pid <- spawn nid self
send pid (self,me,rest)
expect
let ninfo = NodeInfo { nodeCP = NCP me
-- FIXME: notion of parent.
, nodeParent = Just (NCP parent)
, nodeID = local
}
send parent $ CAD ninfo cads
-- FIXME: here we just block eternally to keep process alive. We
-- need to figure out whether we need this process
() <- expect
return ()
| 755
|
nodeController = do
(self,parent,subcads) <- expect
me <- getSelfPid
local <- getSelfNode
-- FIXME: assumes reliability. Process spaning may in fact fail
cads <- forM subcads $ \(CAD nid rest) -> do
pid <- spawn nid self
send pid (self,me,rest)
expect
let ninfo = NodeInfo { nodeCP = NCP me
-- FIXME: notion of parent.
, nodeParent = Just (NCP parent)
, nodeID = local
}
send parent $ CAD ninfo cads
-- FIXME: here we just block eternally to keep process alive. We
-- need to figure out whether we need this process
() <- expect
return ()
| 726
| true
| true
| 0
| 14
| 327
| 186
| 94
| 92
| null | null |
dylex/hsaml2
|
SAML2/XML/Schema/Datatypes.hs
|
apache-2.0
|
xpBase64Binary :: XP.PU Base64Binary
xpBase64Binary = XP.xpWrapEither
( B64.decode . BS.pack . filter (not . isXmlSpaceChar)
, BS.unpack . B64.encode
) $ XP.xpText0DT $ XPS.scDTxsd XSD.xsd_base64Binary []
| 210
|
xpBase64Binary :: XP.PU Base64Binary
xpBase64Binary = XP.xpWrapEither
( B64.decode . BS.pack . filter (not . isXmlSpaceChar)
, BS.unpack . B64.encode
) $ XP.xpText0DT $ XPS.scDTxsd XSD.xsd_base64Binary []
| 210
|
xpBase64Binary = XP.xpWrapEither
( B64.decode . BS.pack . filter (not . isXmlSpaceChar)
, BS.unpack . B64.encode
) $ XP.xpText0DT $ XPS.scDTxsd XSD.xsd_base64Binary []
| 173
| false
| true
| 4
| 9
| 32
| 85
| 40
| 45
| null | null |
ChrisPenner/rasa
|
rasa-ext-slate/src/Rasa/Ext/Slate/Internal/Attributes.hs
|
gpl-3.0
|
-- | Convert flair from "Rasa.Ext.Style" into 'V.Style's
convertFlair :: Flair -> V.MaybeDefault V.Style
convertFlair Standout = V.SetTo V.standout
| 147
|
convertFlair :: Flair -> V.MaybeDefault V.Style
convertFlair Standout = V.SetTo V.standout
| 90
|
convertFlair Standout = V.SetTo V.standout
| 42
| true
| true
| 0
| 7
| 18
| 33
| 16
| 17
| null | null |
d3zd3z/HaskellNet-old
|
Network/HaskellNet/Auth.hs
|
bsd-3-clause
|
plain :: UserName -> Password -> String
plain user pass = b64Encode $ concat $ intersperse "\0" [user, user, pass]
| 114
|
plain :: UserName -> Password -> String
plain user pass = b64Encode $ concat $ intersperse "\0" [user, user, pass]
| 114
|
plain user pass = b64Encode $ concat $ intersperse "\0" [user, user, pass]
| 74
| false
| true
| 0
| 7
| 19
| 46
| 24
| 22
| null | null |
sonyandy/tnt
|
Control/Monad/Code/Opcode.hs
|
bsd-3-clause
|
baload :: Word8
baload = 0x33
| 29
|
baload :: Word8
baload = 0x33
| 29
|
baload = 0x33
| 13
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
runjak/carbon-adf
|
Carbon/Backend/PostgreSQL/AcceptanceCondition.hs
|
gpl-3.0
|
setCondition' :: Item Id -> Query ()
setCondition' i conn = void $ setCondition conn i
| 87
|
setCondition' :: Item Id -> Query ()
setCondition' i conn = void $ setCondition conn i
| 86
|
setCondition' i conn = void $ setCondition conn i
| 49
| false
| true
| 0
| 7
| 16
| 37
| 17
| 20
| null | null |
spechub/Hets
|
GMP/GMP-CoLoSS/GMP/Logics/SysS.hs
|
gpl-2.0
|
seqsAt seq (ind : inds) = seq !! ind : seqsAt seq inds
| 54
|
seqsAt seq (ind : inds) = seq !! ind : seqsAt seq inds
| 54
|
seqsAt seq (ind : inds) = seq !! ind : seqsAt seq inds
| 54
| false
| false
| 0
| 7
| 12
| 31
| 15
| 16
| null | null |
GaloisInc/stack
|
src/Path/IO.hs
|
bsd-3-clause
|
-- | Does the directory exist?
dirExists :: MonadIO m => Path b Dir -> m Bool
dirExists = liftIO . D.doesDirectoryExist . toFilePath
| 132
|
dirExists :: MonadIO m => Path b Dir -> m Bool
dirExists = liftIO . D.doesDirectoryExist . toFilePath
| 101
|
dirExists = liftIO . D.doesDirectoryExist . toFilePath
| 54
| true
| true
| 1
| 8
| 23
| 48
| 21
| 27
| null | null |
ComputationWithBoundedResources/tct-trs
|
src/Tct/Trs/Processor/DP/DPGraph/PathAnalysis.hs
|
bsd-3-clause
|
nodesFrom :: (Ord v, Ord f) => CDG f v -> NodeId -> (Rules f v, Rules f v)
nodesFrom cdg n = (RS.fromList srs, RS.fromList wrs)
where (srs,wrs) = allRulesPairFromNodes cdg [n]
| 177
|
nodesFrom :: (Ord v, Ord f) => CDG f v -> NodeId -> (Rules f v, Rules f v)
nodesFrom cdg n = (RS.fromList srs, RS.fromList wrs)
where (srs,wrs) = allRulesPairFromNodes cdg [n]
| 177
|
nodesFrom cdg n = (RS.fromList srs, RS.fromList wrs)
where (srs,wrs) = allRulesPairFromNodes cdg [n]
| 102
| false
| true
| 0
| 9
| 34
| 98
| 50
| 48
| null | null |
forked-upstream-packages-for-ghcjs/ghc
|
libraries/base/Debug/Trace.hs
|
bsd-3-clause
|
traceMarkerIO :: String -> IO ()
traceMarkerIO msg =
GHC.Foreign.withCString utf8 msg $ \(Ptr p) -> IO $ \s ->
case traceMarker# p s of s' -> (# s', () #)
| 160
|
traceMarkerIO :: String -> IO ()
traceMarkerIO msg =
GHC.Foreign.withCString utf8 msg $ \(Ptr p) -> IO $ \s ->
case traceMarker# p s of s' -> (# s', () #)
| 160
|
traceMarkerIO msg =
GHC.Foreign.withCString utf8 msg $ \(Ptr p) -> IO $ \s ->
case traceMarker# p s of s' -> (# s', () #)
| 127
| false
| true
| 2
| 13
| 36
| 84
| 40
| 44
| null | null |
taylor1791/adventofcode
|
2015/src/Day14.hs
|
bsd-2-clause
|
distance time xxs@((rate, period):xs) =
iterations * (distancePerIteration xxs) +
periodTime * rate +
distance (time - iterationsTime - periodTime) xs
where
totalTime = foldr (\x acc -> acc + snd x) 0 xxs
iterations = time `div` totalTime
iterationsTime = iterations * timePerIteration xxs
periodTime = min (time - iterationsTime) period
| 361
|
distance time xxs@((rate, period):xs) =
iterations * (distancePerIteration xxs) +
periodTime * rate +
distance (time - iterationsTime - periodTime) xs
where
totalTime = foldr (\x acc -> acc + snd x) 0 xxs
iterations = time `div` totalTime
iterationsTime = iterations * timePerIteration xxs
periodTime = min (time - iterationsTime) period
| 361
|
distance time xxs@((rate, period):xs) =
iterations * (distancePerIteration xxs) +
periodTime * rate +
distance (time - iterationsTime - periodTime) xs
where
totalTime = foldr (\x acc -> acc + snd x) 0 xxs
iterations = time `div` totalTime
iterationsTime = iterations * timePerIteration xxs
periodTime = min (time - iterationsTime) period
| 361
| false
| false
| 3
| 11
| 75
| 140
| 72
| 68
| null | null |
nevrenato/Hets_Fork
|
Common/Id.hs
|
gpl-2.0
|
-- | has a 'place'
isMixfix :: Id -> Bool
isMixfix (Id tops _ _) = any isPlace tops
| 83
|
isMixfix :: Id -> Bool
isMixfix (Id tops _ _) = any isPlace tops
| 64
|
isMixfix (Id tops _ _) = any isPlace tops
| 41
| true
| true
| 0
| 7
| 18
| 34
| 17
| 17
| null | null |
kowey/GenI
|
src/NLP/GenI/Automaton.hs
|
gpl-2.0
|
lookupTrans :: (Ord ab, Ord st) => NFA st ab -> st -> (Maybe ab) -> [st]
lookupTrans aut st ab = Map.keys $ Map.filter (elem ab) subT
where subT = Map.findWithDefault Map.empty st (transitions aut)
| 199
|
lookupTrans :: (Ord ab, Ord st) => NFA st ab -> st -> (Maybe ab) -> [st]
lookupTrans aut st ab = Map.keys $ Map.filter (elem ab) subT
where subT = Map.findWithDefault Map.empty st (transitions aut)
| 199
|
lookupTrans aut st ab = Map.keys $ Map.filter (elem ab) subT
where subT = Map.findWithDefault Map.empty st (transitions aut)
| 126
| false
| true
| 3
| 11
| 37
| 113
| 52
| 61
| null | null |
antalsz/hs-to-coq
|
examples/ghc/gen-files/CmmLex.hs
|
mit
|
--alexPrevCharIsOneOfPred :: Array Char Bool -> AlexAccPred _
alexPrevCharIsOneOf arr _ input__ _ _ = arr ! alexInputPrevChar input__
| 133
|
alexPrevCharIsOneOf arr _ input__ _ _ = arr ! alexInputPrevChar input__
| 71
|
alexPrevCharIsOneOf arr _ input__ _ _ = arr ! alexInputPrevChar input__
| 71
| true
| false
| 1
| 6
| 18
| 28
| 12
| 16
| null | null |
hguenther/smtlib2
|
Language/SMTLib2/Internals/Expression.hs
|
gpl-3.0
|
functionType _ ToReal = return (IntRepr ::: Nil,RealRepr)
| 57
|
functionType _ ToReal = return (IntRepr ::: Nil,RealRepr)
| 57
|
functionType _ ToReal = return (IntRepr ::: Nil,RealRepr)
| 57
| false
| false
| 1
| 7
| 7
| 25
| 12
| 13
| null | null |
co-dan/NPNTool
|
src/NPNTool/PTConstr.hs
|
bsd-3-clause
|
inT :: PTPlace -> Trans -> PTConstrM l ()
inT p t = do
c <- get
let pre' = tin c
put $ c { tin = M.insertWith MSet.union t (MSet.singleton p) pre'}
| 153
|
inT :: PTPlace -> Trans -> PTConstrM l ()
inT p t = do
c <- get
let pre' = tin c
put $ c { tin = M.insertWith MSet.union t (MSet.singleton p) pre'}
| 153
|
inT p t = do
c <- get
let pre' = tin c
put $ c { tin = M.insertWith MSet.union t (MSet.singleton p) pre'}
| 111
| false
| true
| 0
| 13
| 39
| 86
| 41
| 45
| null | null |
dmp1ce/Haskell-Programming-Exercises
|
Chapter 5/sing.hs
|
unlicense
|
mySong' = sing (<)
| 18
|
mySong' = sing (<)
| 18
|
mySong' = sing (<)
| 18
| false
| false
| 1
| 5
| 3
| 15
| 6
| 9
| null | null |
expipiplus1/vulkan
|
src/Vulkan/Extensions/VK_KHR_wayland_surface.hs
|
bsd-3-clause
|
enumPrefixWaylandSurfaceCreateFlagsKHR :: String
enumPrefixWaylandSurfaceCreateFlagsKHR = ""
| 92
|
enumPrefixWaylandSurfaceCreateFlagsKHR :: String
enumPrefixWaylandSurfaceCreateFlagsKHR = ""
| 92
|
enumPrefixWaylandSurfaceCreateFlagsKHR = ""
| 43
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
jbapple/three-finger-trees
|
bbb-trees/BBBPlus.hs
|
agpl-3.0
|
--joinLeftChild tree maxx
insertFull k v t@(One x _) =
case compare k x of
EQ -> One k v
LT -> More 2 [(One k v,k),(t,x)]
GT -> More 2 [(t,x),(One k v,k)]
| 178
|
insertFull k v t@(One x _) =
case compare k x of
EQ -> One k v
LT -> More 2 [(One k v,k),(t,x)]
GT -> More 2 [(t,x),(One k v,k)]
| 150
|
insertFull k v t@(One x _) =
case compare k x of
EQ -> One k v
LT -> More 2 [(One k v,k),(t,x)]
GT -> More 2 [(t,x),(One k v,k)]
| 150
| true
| false
| 1
| 11
| 57
| 120
| 60
| 60
| null | null |
VictorDenisov/openjdb
|
Main.hs
|
gpl-2.0
|
parsePrint :: CharParser st Command
parsePrint = do
string "print "
s <- many1 (noneOf "")
return $ PrintCommand s
| 126
|
parsePrint :: CharParser st Command
parsePrint = do
string "print "
s <- many1 (noneOf "")
return $ PrintCommand s
| 126
|
parsePrint = do
string "print "
s <- many1 (noneOf "")
return $ PrintCommand s
| 90
| false
| true
| 0
| 10
| 31
| 48
| 21
| 27
| null | null |
hamsal/DM-AtariAI
|
src/ConvolveGPU.hs
|
mit
|
signalFltrIndLyr1 = (A.computeAccS (foldl' R.append
(head maskListLyr1)
(tail maskListLyr1)))
| 176
|
signalFltrIndLyr1 = (A.computeAccS (foldl' R.append
(head maskListLyr1)
(tail maskListLyr1)))
| 176
|
signalFltrIndLyr1 = (A.computeAccS (foldl' R.append
(head maskListLyr1)
(tail maskListLyr1)))
| 176
| false
| false
| 0
| 10
| 91
| 38
| 19
| 19
| null | null |
urbanslug/ghc
|
compiler/utils/Encoding.hs
|
bsd-3-clause
|
unencodedChar :: Char -> Bool -- True for chars that don't need encoding
unencodedChar 'Z' = False
| 100
|
unencodedChar :: Char -> Bool
unencodedChar 'Z' = False
| 55
|
unencodedChar 'Z' = False
| 25
| true
| true
| 0
| 5
| 18
| 19
| 10
| 9
| null | null |
onponomarev/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
qrExport :: String
qrExport = "export"
| 38
|
qrExport :: String
qrExport = "export"
| 38
|
qrExport = "export"
| 19
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
philipturnbull/quenelle
|
src/Quenelle/Rule.hs
|
gpl-2.0
|
compForToPred :: Traversal' QExpr QCompFor -> QCompFor -> State RuleState CompForPred
compForToPred path (CompFor fores ine iter _) = do
foresp <- exprsToPred (path.comp_for_exprsL) fores
inep <- exprToPred (path.comp_in_exprL) ine
iterp <- compIterToPred (path.comp_for_iterL) iter
return $ pCompFor foresp inep iterp
| 334
|
compForToPred :: Traversal' QExpr QCompFor -> QCompFor -> State RuleState CompForPred
compForToPred path (CompFor fores ine iter _) = do
foresp <- exprsToPred (path.comp_for_exprsL) fores
inep <- exprToPred (path.comp_in_exprL) ine
iterp <- compIterToPred (path.comp_for_iterL) iter
return $ pCompFor foresp inep iterp
| 334
|
compForToPred path (CompFor fores ine iter _) = do
foresp <- exprsToPred (path.comp_for_exprsL) fores
inep <- exprToPred (path.comp_in_exprL) ine
iterp <- compIterToPred (path.comp_for_iterL) iter
return $ pCompFor foresp inep iterp
| 248
| false
| true
| 0
| 10
| 56
| 111
| 52
| 59
| null | null |
moonKimura/vector-0.10.9.1
|
Data/Vector/Generic.hs
|
bsd-3-clause
|
and = Stream.and . stream
| 25
|
and = Stream.and . stream
| 25
|
and = Stream.and . stream
| 25
| false
| false
| 1
| 6
| 4
| 16
| 6
| 10
| null | null |
ssaavedra/liquidhaskell
|
benchmarks/base-4.5.1.0/Control/OldException.hs
|
bsd-3-clause
|
ioErrors _ = Nothing
| 20
|
ioErrors _ = Nothing
| 20
|
ioErrors _ = Nothing
| 20
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
nevrenato/HetsAlloy
|
Comorphisms/LogicList.hs
|
gpl-2.0
|
defaultLogic :: AnyLogic
defaultLogic = Logic CASL
| 50
|
defaultLogic :: AnyLogic
defaultLogic = Logic CASL
| 50
|
defaultLogic = Logic CASL
| 25
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
andyfriesen/hs-sajson
|
src/Sajson/FromJson.hs
|
mit
|
withObject :: Value -> (Object -> Either DecodeError a) -> Either DecodeError a
withObject v f = case asObject v of
Just o -> f o
Nothing -> Left $ "Expected object, got " ++ (show v)
| 191
|
withObject :: Value -> (Object -> Either DecodeError a) -> Either DecodeError a
withObject v f = case asObject v of
Just o -> f o
Nothing -> Left $ "Expected object, got " ++ (show v)
| 191
|
withObject v f = case asObject v of
Just o -> f o
Nothing -> Left $ "Expected object, got " ++ (show v)
| 111
| false
| true
| 4
| 9
| 44
| 73
| 36
| 37
| null | null |
christiaanb/ghc
|
compiler/basicTypes/Id.hs
|
bsd-3-clause
|
setIdUnfolding :: Id -> Unfolding -> Id
setIdUnfolding id unfolding = modifyIdInfo (`setUnfoldingInfo` unfolding) id
| 116
|
setIdUnfolding :: Id -> Unfolding -> Id
setIdUnfolding id unfolding = modifyIdInfo (`setUnfoldingInfo` unfolding) id
| 116
|
setIdUnfolding id unfolding = modifyIdInfo (`setUnfoldingInfo` unfolding) id
| 76
| false
| true
| 0
| 8
| 14
| 40
| 20
| 20
| null | null |
shockone/interactive-select
|
src/System/Console/InteractiveSelect.hs
|
bsd-3-clause
|
hPrintTitle _ _ = return ()
| 27
|
hPrintTitle _ _ = return ()
| 27
|
hPrintTitle _ _ = return ()
| 27
| false
| false
| 0
| 6
| 5
| 16
| 7
| 9
| null | null |
DavidAlphaFox/ghc
|
libraries/bytestring/bench/BenchAll.hs
|
bsd-3-clause
|
benchB' :: String -> a -> (a -> Builder) -> Benchmark
benchB' name x b = bench name $ whnf (L.length . toLazyByteString . b) x
| 126
|
benchB' :: String -> a -> (a -> Builder) -> Benchmark
benchB' name x b = bench name $ whnf (L.length . toLazyByteString . b) x
| 126
|
benchB' name x b = bench name $ whnf (L.length . toLazyByteString . b) x
| 72
| false
| true
| 0
| 10
| 25
| 62
| 31
| 31
| null | null |
charlesrosenbauer/Bzo-Compiler
|
src/HigherOrder.hs
|
gpl-3.0
|
bChoices :: [Either3 a b c] -> [b]
bChoices xs = concatMap fn xs
where fn (ChoiceB x) = [x]
fn _ = [ ]
| 150
|
bChoices :: [Either3 a b c] -> [b]
bChoices xs = concatMap fn xs
where fn (ChoiceB x) = [x]
fn _ = [ ]
| 150
|
bChoices xs = concatMap fn xs
where fn (ChoiceB x) = [x]
fn _ = [ ]
| 115
| false
| true
| 0
| 9
| 72
| 65
| 33
| 32
| null | null |
mattvperry/AI-2048-hs
|
src/AI.hs
|
mit
|
getBoard :: GameTree -> Board
getBoard (PlayNode _ b) = b
| 57
|
getBoard :: GameTree -> Board
getBoard (PlayNode _ b) = b
| 57
|
getBoard (PlayNode _ b) = b
| 27
| false
| true
| 0
| 9
| 10
| 32
| 14
| 18
| null | null |
yesodweb/shakespeare
|
test/Text/HamletSpec.hs
|
mit
|
caseInputEmpty :: Assertion
caseInputEmpty = do
helper "<input>\n" [hamlet|<input>|]
helper "<input/>\n" [xhamlet|<input>|]
| 131
|
caseInputEmpty :: Assertion
caseInputEmpty = do
helper "<input>\n" [hamlet|<input>|]
helper "<input/>\n" [xhamlet|<input>|]
| 131
|
caseInputEmpty = do
helper "<input>\n" [hamlet|<input>|]
helper "<input/>\n" [xhamlet|<input>|]
| 103
| false
| true
| 0
| 8
| 19
| 42
| 21
| 21
| null | null |
dysinger/amazonka
|
amazonka-opsworks/gen/Network/AWS/OpsWorks/DeleteStack.hs
|
mpl-2.0
|
-- | 'DeleteStack' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'dsStackId' @::@ 'Text'
--
deleteStack :: Text -- ^ 'dsStackId'
-> DeleteStack
deleteStack p1 = DeleteStack
{ _dsStackId = p1
}
| 249
|
deleteStack :: Text -- ^ 'dsStackId'
-> DeleteStack
deleteStack p1 = DeleteStack
{ _dsStackId = p1
}
| 120
|
deleteStack p1 = DeleteStack
{ _dsStackId = p1
}
| 56
| true
| true
| 0
| 7
| 56
| 42
| 23
| 19
| null | null |
futtetennista/IntroductionToFunctionalProgramming
|
PiH/src/Compiler.hs
|
mit
|
meval (Catch x h) =
meval x <|> meval h
| 41
|
meval (Catch x h) =
meval x <|> meval h
| 41
|
meval (Catch x h) =
meval x <|> meval h
| 41
| false
| false
| 3
| 6
| 11
| 32
| 14
| 18
| null | null |
dzamkov/Oedel
|
src/Graphics/Oedel/Terminal/Widget.hs
|
mit
|
-- | Converts a static figure into a widget.
augment :: (Event e) => q f -> Widget e f q a
augment source = Widget $ return $ \env -> (env, mempty, const source)
| 163
|
augment :: (Event e) => q f -> Widget e f q a
augment source = Widget $ return $ \env -> (env, mempty, const source)
| 116
|
augment source = Widget $ return $ \env -> (env, mempty, const source)
| 70
| true
| true
| 2
| 9
| 36
| 71
| 35
| 36
| null | null |
Submitty/AnalysisTools
|
src/Lichen/Parser/Python.hs
|
bsd-3-clause
|
convertStatement (Assert exprs _) = Node [Tag "assert"] <$> mapM convertExpr exprs
| 82
|
convertStatement (Assert exprs _) = Node [Tag "assert"] <$> mapM convertExpr exprs
| 82
|
convertStatement (Assert exprs _) = Node [Tag "assert"] <$> mapM convertExpr exprs
| 82
| false
| false
| 0
| 8
| 11
| 35
| 16
| 19
| null | null |
josiah14/lambdaline
|
LambdaLine/XTerm/Colors.hs
|
gpl-3.0
|
blueViolet :: Color
blueViolet = "57"
| 37
|
blueViolet :: Color
blueViolet = "57"
| 37
|
blueViolet = "57"
| 17
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
vikraman/ghc
|
compiler/prelude/TysWiredIn.hs
|
bsd-3-clause
|
alpha_ty :: [Type]
alpha_ty = [alphaTy]
| 39
|
alpha_ty :: [Type]
alpha_ty = [alphaTy]
| 39
|
alpha_ty = [alphaTy]
| 20
| false
| true
| 0
| 5
| 5
| 17
| 10
| 7
| null | null |
jimsnow/polink
|
PolinkState.hs
|
gpl-2.0
|
delIssueTagU u id iid = toU $ delIssueTag u id iid
| 50
|
delIssueTagU u id iid = toU $ delIssueTag u id iid
| 50
|
delIssueTagU u id iid = toU $ delIssueTag u id iid
| 50
| false
| false
| 1
| 6
| 10
| 29
| 11
| 18
| null | null |
fredcy/elm-format
|
parser/src/Parse/Module.hs
|
bsd-3-clause
|
header :: IParser Module.Header
header =
do ((names, exports, postExports), preDocsComments) <-
option
((Commented [] ["Main"] [], Var.OpenListing (Commented [] () []), []), [])
((,) <$> moduleDecl <*> freshLine)
(docs, postDocsComments) <-
choice
[ (,) <$> addLocation (Just <$> docComment) <*> freshLine
, (,) <$> addLocation (return Nothing) <*> return []
]
imports' <- imports
return (Module.Header names docs exports postExports ((fmap Module.ImportComment (preDocsComments ++ postDocsComments)) ++ imports'))
| 607
|
header :: IParser Module.Header
header =
do ((names, exports, postExports), preDocsComments) <-
option
((Commented [] ["Main"] [], Var.OpenListing (Commented [] () []), []), [])
((,) <$> moduleDecl <*> freshLine)
(docs, postDocsComments) <-
choice
[ (,) <$> addLocation (Just <$> docComment) <*> freshLine
, (,) <$> addLocation (return Nothing) <*> return []
]
imports' <- imports
return (Module.Header names docs exports postExports ((fmap Module.ImportComment (preDocsComments ++ postDocsComments)) ++ imports'))
| 607
|
header =
do ((names, exports, postExports), preDocsComments) <-
option
((Commented [] ["Main"] [], Var.OpenListing (Commented [] () []), []), [])
((,) <$> moduleDecl <*> freshLine)
(docs, postDocsComments) <-
choice
[ (,) <$> addLocation (Just <$> docComment) <*> freshLine
, (,) <$> addLocation (return Nothing) <*> return []
]
imports' <- imports
return (Module.Header names docs exports postExports ((fmap Module.ImportComment (preDocsComments ++ postDocsComments)) ++ imports'))
| 575
| false
| true
| 0
| 15
| 160
| 232
| 121
| 111
| null | null |
termite2/tsl
|
Frontend/ExprOps.hs
|
bsd-3-clause
|
-- Check that L-expr refers to a local variable (used in checking side-effect
-- freedom of expressions)
isLocalLHS :: (?spec::Spec, ?scope::Scope) => Expr -> Bool
isLocalLHS (ETerm _ n) = case getTerm ?scope n of
ObjVar _ _ -> True
_ -> False
| 341
|
isLocalLHS :: (?spec::Spec, ?scope::Scope) => Expr -> Bool
isLocalLHS (ETerm _ n) = case getTerm ?scope n of
ObjVar _ _ -> True
_ -> False
| 235
|
isLocalLHS (ETerm _ n) = case getTerm ?scope n of
ObjVar _ _ -> True
_ -> False
| 176
| true
| true
| 0
| 8
| 140
| 69
| 37
| 32
| null | null |
pikajude/ruby-qq
|
src/RubyQQ.hs
|
mit
|
-- | @[w|input|]@ is a list containing @input@ split on all whitespace
-- characters.
--
-- Note that no escape expansion occurs:
--
-- >>> [w|hello\n world!|]
-- ["hello\\n","world!"]
w :: QuasiQuoter
w = expQuoter $
\str -> case parseString safeWords mempty (' ':str) of
Success strs -> listE $ map stringE strs
n -> error $ show n
-- | @[ww|input|]@ is a list containing @input@ split on all whitespace
-- characters, with some extra features:
--
-- * Ruby-style interpolation is supported.
--
-- >>> [ww|foo bar #{ reverse "zab" }|]
-- ["foo","bar","baz"]
--
-- /This feature uses some typeclass magic to convert input into the/
-- /friendliest possible String format. If you encounter errors like "No/
-- /instance for (Stringable' flag [a0])", add a type signature to your/
-- /input./
--
-- * All escape sequences are interpreted.
--
-- >>> [ww|Here\n are\SOH some\x123 special\1132 characters\\!|]
-- ["Here\n","are\SOH","some\291","special\1132","characters\\!"]
| 1,004
|
w :: QuasiQuoter
w = expQuoter $
\str -> case parseString safeWords mempty (' ':str) of
Success strs -> listE $ map stringE strs
n -> error $ show n
-- | @[ww|input|]@ is a list containing @input@ split on all whitespace
-- characters, with some extra features:
--
-- * Ruby-style interpolation is supported.
--
-- >>> [ww|foo bar #{ reverse "zab" }|]
-- ["foo","bar","baz"]
--
-- /This feature uses some typeclass magic to convert input into the/
-- /friendliest possible String format. If you encounter errors like "No/
-- /instance for (Stringable' flag [a0])", add a type signature to your/
-- /input./
--
-- * All escape sequences are interpreted.
--
-- >>> [ww|Here\n are\SOH some\x123 special\1132 characters\\!|]
-- ["Here\n","are\SOH","some\291","special\1132","characters\\!"]
| 819
|
w = expQuoter $
\str -> case parseString safeWords mempty (' ':str) of
Success strs -> listE $ map stringE strs
n -> error $ show n
-- | @[ww|input|]@ is a list containing @input@ split on all whitespace
-- characters, with some extra features:
--
-- * Ruby-style interpolation is supported.
--
-- >>> [ww|foo bar #{ reverse "zab" }|]
-- ["foo","bar","baz"]
--
-- /This feature uses some typeclass magic to convert input into the/
-- /friendliest possible String format. If you encounter errors like "No/
-- /instance for (Stringable' flag [a0])", add a type signature to your/
-- /input./
--
-- * All escape sequences are interpreted.
--
-- >>> [ww|Here\n are\SOH some\x123 special\1132 characters\\!|]
-- ["Here\n","are\SOH","some\291","special\1132","characters\\!"]
| 802
| true
| true
| 0
| 11
| 183
| 93
| 58
| 35
| null | null |
rueshyna/gogol
|
gogol-games/gen/Network/Google/Games/Types/Product.hs
|
mpl-2.0
|
-- | Unique identifier for this push token.
ptId :: Lens' PushToken (Maybe PushTokenId)
ptId = lens _ptId (\ s a -> s{_ptId = a})
| 129
|
ptId :: Lens' PushToken (Maybe PushTokenId)
ptId = lens _ptId (\ s a -> s{_ptId = a})
| 85
|
ptId = lens _ptId (\ s a -> s{_ptId = a})
| 41
| true
| true
| 0
| 9
| 24
| 46
| 25
| 21
| null | null |
sphynx/hamisado
|
Board/VectorBased.hs
|
bsd-3-clause
|
isPieceOfPlayer :: W -> W -> Bool
isPieceOfPlayer player = \val ->
let mask = (player `shiftL` 4) .|. 1
in mask == val .&. 0x11
| 131
|
isPieceOfPlayer :: W -> W -> Bool
isPieceOfPlayer player = \val ->
let mask = (player `shiftL` 4) .|. 1
in mask == val .&. 0x11
| 131
|
isPieceOfPlayer player = \val ->
let mask = (player `shiftL` 4) .|. 1
in mask == val .&. 0x11
| 97
| false
| true
| 0
| 12
| 29
| 59
| 31
| 28
| null | null |
nevrenato/Hets_Fork
|
CASL/AS_Basic_CASL.der.hs
|
gpl-2.0
|
-- | optimized conjunction
conjunctRange :: [FORMULA f] -> Range -> FORMULA f
conjunctRange fs ps = case fs of
[] -> True_atom ps
[phi] -> phi
_ -> Conjunction fs ps
| 171
|
conjunctRange :: [FORMULA f] -> Range -> FORMULA f
conjunctRange fs ps = case fs of
[] -> True_atom ps
[phi] -> phi
_ -> Conjunction fs ps
| 144
|
conjunctRange fs ps = case fs of
[] -> True_atom ps
[phi] -> phi
_ -> Conjunction fs ps
| 93
| true
| true
| 5
| 7
| 37
| 70
| 34
| 36
| null | null |
wavewave/gnuplot
|
src/Graphics/Gnuplot/ColorSpecification.hs
|
bsd-3-clause
|
goldenrod = makeColor "goldenrod" 0xdaa520 218 165 32
| 71
|
goldenrod = makeColor "goldenrod" 0xdaa520 218 165 32
| 71
|
goldenrod = makeColor "goldenrod" 0xdaa520 218 165 32
| 71
| false
| false
| 0
| 5
| 25
| 17
| 8
| 9
| null | null |
lally/libmet
|
src/Ppt/Frame/Parser.hs
|
bsd-3-clause
|
optionCombine :: [PartialOption] -> Either String EmitOptions
optionCombine opts = let
langs = catMaybes $ map (preview lang) opts
buffers = catMaybes $ map (preview buffer) opts
timereps = catMaybes $ map (preview time) opts
runtimes = catMaybes $ map (preview runtime) opts
lastBool lens = let list = catMaybes $ map (preview lens) opts
len = length list
in drop (max 0 (len-1)) list
-- For other runtime opts, concatenate the lists created in this form
counters = map ENativeCounter $ lastBool isNative
debugOpts = map EDebug $ lastBool isDebug
theTags = concat $ catMaybes $ map (preview tags) opts
in (EmitOptions
<$> max1 buffers "buffer line" (EBuffer "unlisted" Nothing)
<*> exact1 langs "Language"
<*> max1 timereps "Time representation" (
ETimeSpec ETimeClockMonotonic)
<*> max1 runtimes "multithread option" (ERuntime False)
<*> (pure theTags)
<*> (pure (counters ++ debugOpts)))
| 996
|
optionCombine :: [PartialOption] -> Either String EmitOptions
optionCombine opts = let
langs = catMaybes $ map (preview lang) opts
buffers = catMaybes $ map (preview buffer) opts
timereps = catMaybes $ map (preview time) opts
runtimes = catMaybes $ map (preview runtime) opts
lastBool lens = let list = catMaybes $ map (preview lens) opts
len = length list
in drop (max 0 (len-1)) list
-- For other runtime opts, concatenate the lists created in this form
counters = map ENativeCounter $ lastBool isNative
debugOpts = map EDebug $ lastBool isDebug
theTags = concat $ catMaybes $ map (preview tags) opts
in (EmitOptions
<$> max1 buffers "buffer line" (EBuffer "unlisted" Nothing)
<*> exact1 langs "Language"
<*> max1 timereps "Time representation" (
ETimeSpec ETimeClockMonotonic)
<*> max1 runtimes "multithread option" (ERuntime False)
<*> (pure theTags)
<*> (pure (counters ++ debugOpts)))
| 996
|
optionCombine opts = let
langs = catMaybes $ map (preview lang) opts
buffers = catMaybes $ map (preview buffer) opts
timereps = catMaybes $ map (preview time) opts
runtimes = catMaybes $ map (preview runtime) opts
lastBool lens = let list = catMaybes $ map (preview lens) opts
len = length list
in drop (max 0 (len-1)) list
-- For other runtime opts, concatenate the lists created in this form
counters = map ENativeCounter $ lastBool isNative
debugOpts = map EDebug $ lastBool isDebug
theTags = concat $ catMaybes $ map (preview tags) opts
in (EmitOptions
<$> max1 buffers "buffer line" (EBuffer "unlisted" Nothing)
<*> exact1 langs "Language"
<*> max1 timereps "Time representation" (
ETimeSpec ETimeClockMonotonic)
<*> max1 runtimes "multithread option" (ERuntime False)
<*> (pure theTags)
<*> (pure (counters ++ debugOpts)))
| 934
| false
| true
| 0
| 17
| 243
| 326
| 158
| 168
| null | null |
pbv/codex-quickcheck
|
examples/queue/Queue.hs
|
mit
|
simulate IsFull = do
model <- get
return (Just (fromBool $ isFull model))
-- | check if a command is valid
| 112
|
simulate IsFull = do
model <- get
return (Just (fromBool $ isFull model))
-- | check if a command is valid
| 112
|
simulate IsFull = do
model <- get
return (Just (fromBool $ isFull model))
-- | check if a command is valid
| 112
| false
| false
| 0
| 12
| 26
| 39
| 18
| 21
| null | null |
castaway/pandoc
|
src/Text/Pandoc/Readers/LaTeX.hs
|
gpl-2.0
|
circ 'G' = 'Ĝ'
| 14
|
circ 'G' = 'Ĝ'
| 14
|
circ 'G' = 'Ĝ'
| 14
| false
| false
| 0
| 4
| 3
| 10
| 4
| 6
| null | null |
csrhodes/pandoc
|
src/Text/Pandoc/Readers/LaTeX.hs
|
gpl-2.0
|
inlineCommand :: LP Inlines
inlineCommand = try $ do
name <- anyControlSeq
guard $ name /= "begin" && name /= "end"
guard $ not $ isBlockCommand name
parseRaw <- getOption readerParseRaw
star <- option "" (string "*")
let name' = name ++ star
let raw = do
rawcommand <- getRawCommand name'
transformed <- applyMacros' rawcommand
if transformed /= rawcommand
then parseFromString inlines transformed
else if parseRaw
then return $ rawInline "latex" rawcommand
else return mempty
lookupListDefault mzero [name',name] inlineCommands
<|> raw
| 641
|
inlineCommand :: LP Inlines
inlineCommand = try $ do
name <- anyControlSeq
guard $ name /= "begin" && name /= "end"
guard $ not $ isBlockCommand name
parseRaw <- getOption readerParseRaw
star <- option "" (string "*")
let name' = name ++ star
let raw = do
rawcommand <- getRawCommand name'
transformed <- applyMacros' rawcommand
if transformed /= rawcommand
then parseFromString inlines transformed
else if parseRaw
then return $ rawInline "latex" rawcommand
else return mempty
lookupListDefault mzero [name',name] inlineCommands
<|> raw
| 641
|
inlineCommand = try $ do
name <- anyControlSeq
guard $ name /= "begin" && name /= "end"
guard $ not $ isBlockCommand name
parseRaw <- getOption readerParseRaw
star <- option "" (string "*")
let name' = name ++ star
let raw = do
rawcommand <- getRawCommand name'
transformed <- applyMacros' rawcommand
if transformed /= rawcommand
then parseFromString inlines transformed
else if parseRaw
then return $ rawInline "latex" rawcommand
else return mempty
lookupListDefault mzero [name',name] inlineCommands
<|> raw
| 613
| false
| true
| 2
| 15
| 184
| 195
| 88
| 107
| null | null |
kim/amazonka
|
amazonka-codedeploy/gen/Network/AWS/CodeDeploy/Types.hs
|
mpl-2.0
|
-- | The application name.
dgiApplicationName :: Lens' DeploymentGroupInfo (Maybe Text)
dgiApplicationName =
lens _dgiApplicationName (\s a -> s { _dgiApplicationName = a })
| 177
|
dgiApplicationName :: Lens' DeploymentGroupInfo (Maybe Text)
dgiApplicationName =
lens _dgiApplicationName (\s a -> s { _dgiApplicationName = a })
| 150
|
dgiApplicationName =
lens _dgiApplicationName (\s a -> s { _dgiApplicationName = a })
| 89
| true
| true
| 0
| 9
| 27
| 46
| 25
| 21
| null | null |
bananu7/Hate
|
samples/sample_sprite.hs
|
mit
|
main :: IO ()
main = runApp config sampleLoad sampleUpdate sampleDraw
| 70
|
main :: IO ()
main = runApp config sampleLoad sampleUpdate sampleDraw
| 69
|
main = runApp config sampleLoad sampleUpdate sampleDraw
| 55
| false
| true
| 0
| 6
| 11
| 25
| 12
| 13
| null | null |
exclipy/pdata
|
Data/BitUtil.hs
|
bsd-3-clause
|
bitCount8 210 = 4
| 17
|
bitCount8 210 = 4
| 17
|
bitCount8 210 = 4
| 17
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
vikikiss/cyoa
|
src/Cyoa/Engine.hs
|
bsd-3-clause
|
evalExpr (DieRef die) = getDice die
| 35
|
evalExpr (DieRef die) = getDice die
| 35
|
evalExpr (DieRef die) = getDice die
| 35
| false
| false
| 0
| 7
| 5
| 18
| 8
| 10
| null | null |
fpinsight/hocilib
|
src/Database/Ocilib/Collections.hs
|
bsd-2-clause
|
-- | Return the element at the given position in the collection.
ociCollGetElem :: Ptr OCI_Coll -> CUInt -> IO (Maybe (Ptr OCI_Elem))
ociCollGetElem c i = fmap toMaybePtr [C.exp| OCI_Elem* { OCI_CollGetElem($(OCI_Coll *c), $(unsigned int i)) } |]
| 246
|
ociCollGetElem :: Ptr OCI_Coll -> CUInt -> IO (Maybe (Ptr OCI_Elem))
ociCollGetElem c i = fmap toMaybePtr [C.exp| OCI_Elem* { OCI_CollGetElem($(OCI_Coll *c), $(unsigned int i)) } |]
| 181
|
ociCollGetElem c i = fmap toMaybePtr [C.exp| OCI_Elem* { OCI_CollGetElem($(OCI_Coll *c), $(unsigned int i)) } |]
| 112
| true
| true
| 0
| 11
| 38
| 54
| 28
| 26
| null | null |
bfops/Chess
|
src/Config.hs
|
mit
|
-- | The format string to use while logging.
--
-- * $msg - The actual log message
-- * $loggername - The name of the logger
-- * $prio - The priority level of the message
-- * $tid - The thread ID
-- * $pid - Process ID (Not available on windows)
-- * $time - The current time
-- * $utcTime - The current time in UTC Time
logFormat :: String
logFormat = "[$time : $loggername : $prio] $msg"
| 405
|
logFormat :: String
logFormat = "[$time : $loggername : $prio] $msg"
| 68
|
logFormat = "[$time : $loggername : $prio] $msg"
| 48
| true
| true
| 0
| 4
| 95
| 20
| 15
| 5
| null | null |
kishoredbn/barrelfish
|
tools/mackerel/CAbsSyntax.hs
|
mit
|
pp_unit (HashIf s l r) = pp_cppcond "if" s l r
| 46
|
pp_unit (HashIf s l r) = pp_cppcond "if" s l r
| 46
|
pp_unit (HashIf s l r) = pp_cppcond "if" s l r
| 46
| false
| false
| 0
| 6
| 10
| 30
| 13
| 17
| null | null |
AaronFriel/eff-experiments
|
bench/Benchmarks.hs
|
bsd-3-clause
|
-- (10000000,2000001)
-- (35.60 secs, 17920031600 bytes)
{-
(10000000,2000001)
<<ghc: 8512059944 bytes, 15626 GCs, 29224/29224 avg/max bytes residency (1 samples), 1M in use, 0.00 INIT (0.00 elapsed), 3.67 MUT (3.70 elapsed), 0.09 GC (0.09 elapsed) :ghc>>
-}
mainSRRRR_Eff n = run $
flip E.runState (0::Integer) $
flip E.runReader (0::Int) $
flip E.runReader (0::Integer) $
flip E.runReader True $
flip E.runReader "0" $
benchS_Eff n
| 447
|
mainSRRRR_Eff n = run $
flip E.runState (0::Integer) $
flip E.runReader (0::Int) $
flip E.runReader (0::Integer) $
flip E.runReader True $
flip E.runReader "0" $
benchS_Eff n
| 187
|
mainSRRRR_Eff n = run $
flip E.runState (0::Integer) $
flip E.runReader (0::Int) $
flip E.runReader (0::Integer) $
flip E.runReader True $
flip E.runReader "0" $
benchS_Eff n
| 187
| true
| false
| 0
| 12
| 77
| 92
| 47
| 45
| null | null |
brendanhay/gogol
|
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
|
mpl-2.0
|
-- | Maximum number of active ads allowed for this account.
aaActiveAdsLimitTier :: Lens' Account (Maybe AccountActiveAdsLimitTier)
aaActiveAdsLimitTier
= lens _aaActiveAdsLimitTier
(\ s a -> s{_aaActiveAdsLimitTier = a})
| 229
|
aaActiveAdsLimitTier :: Lens' Account (Maybe AccountActiveAdsLimitTier)
aaActiveAdsLimitTier
= lens _aaActiveAdsLimitTier
(\ s a -> s{_aaActiveAdsLimitTier = a})
| 169
|
aaActiveAdsLimitTier
= lens _aaActiveAdsLimitTier
(\ s a -> s{_aaActiveAdsLimitTier = a})
| 97
| true
| true
| 1
| 9
| 35
| 51
| 25
| 26
| null | null |
sdiehl/ghc
|
compiler/deSugar/ExtractDocs.hs
|
bsd-3-clause
|
-- | All the sub declarations of a class (that we handle), ordered by
-- source location, with documentation attached if it exists.
classDecls :: TyClDecl GhcRn -> [(LHsDecl GhcRn, [HsDocString])]
classDecls class_ = filterDecls . collectDocs . sortByLoc $ decls
where
decls = docs ++ defs ++ sigs ++ ats
docs = mkDecls tcdDocs (DocD noExtField) class_
defs = mkDecls (bagToList . tcdMeths) (ValD noExtField) class_
sigs = mkDecls tcdSigs (SigD noExtField) class_
ats = mkDecls tcdATs (TyClD noExtField . FamDecl noExtField) class_
-- | Extract function argument docs from inside top-level decls.
| 624
|
classDecls :: TyClDecl GhcRn -> [(LHsDecl GhcRn, [HsDocString])]
classDecls class_ = filterDecls . collectDocs . sortByLoc $ decls
where
decls = docs ++ defs ++ sigs ++ ats
docs = mkDecls tcdDocs (DocD noExtField) class_
defs = mkDecls (bagToList . tcdMeths) (ValD noExtField) class_
sigs = mkDecls tcdSigs (SigD noExtField) class_
ats = mkDecls tcdATs (TyClD noExtField . FamDecl noExtField) class_
-- | Extract function argument docs from inside top-level decls.
| 492
|
classDecls class_ = filterDecls . collectDocs . sortByLoc $ decls
where
decls = docs ++ defs ++ sigs ++ ats
docs = mkDecls tcdDocs (DocD noExtField) class_
defs = mkDecls (bagToList . tcdMeths) (ValD noExtField) class_
sigs = mkDecls tcdSigs (SigD noExtField) class_
ats = mkDecls tcdATs (TyClD noExtField . FamDecl noExtField) class_
-- | Extract function argument docs from inside top-level decls.
| 427
| true
| true
| 4
| 9
| 121
| 158
| 81
| 77
| null | null |
beni55/fay
|
src/Fay/Compiler/Desugar.hs
|
bsd-3-clause
|
desugarDo :: (Data l, Typeable l) => Module l -> Desugar l (Module l)
desugarDo = transformBiM $ \ex -> case ex of
Do _ stmts -> maybe (throwError EmptyDoBlock) return $ foldl desugarStmt' Nothing (reverse stmts)
_ -> return ex
| 231
|
desugarDo :: (Data l, Typeable l) => Module l -> Desugar l (Module l)
desugarDo = transformBiM $ \ex -> case ex of
Do _ stmts -> maybe (throwError EmptyDoBlock) return $ foldl desugarStmt' Nothing (reverse stmts)
_ -> return ex
| 231
|
desugarDo = transformBiM $ \ex -> case ex of
Do _ stmts -> maybe (throwError EmptyDoBlock) return $ foldl desugarStmt' Nothing (reverse stmts)
_ -> return ex
| 161
| false
| true
| 0
| 13
| 44
| 105
| 51
| 54
| null | null |
sdiehl/ghc
|
compiler/GHC/StgToCmm/Utils.hs
|
bsd-3-clause
|
-- r := e
-- We use the strongly-connected component algorithm, in which
-- * the vertices are the statements
-- * an edge goes from s1 to s2 iff
-- s1 assigns to something s2 uses
-- that is, if s1 should *follow* s2 in the final order
emitMultiAssign [] [] = return ()
| 308
|
emitMultiAssign [] [] = return ()
| 39
|
emitMultiAssign [] [] = return ()
| 39
| true
| false
| 0
| 6
| 92
| 26
| 15
| 11
| null | null |
nateburgers/antigen
|
Main.hs
|
mit
|
configure :: PackageOperation
configure version package =
vshell $ do
run_ "mkdir" ["-p", packageBuildDirText version package]
chPackageBuildDir version package
makefileGenerated <- test_f $ fromText "Makefile"
if makefileGenerated
then return ()
else run_ (fromText configureScriptPath) configureOptions
where configureScriptPath = "../" +++ (packageFolderName package) +++ "/configure"
configureOptions = globalConfigurationOptions ++
(configurationOptions $ packageTitle package)
| 583
|
configure :: PackageOperation
configure version package =
vshell $ do
run_ "mkdir" ["-p", packageBuildDirText version package]
chPackageBuildDir version package
makefileGenerated <- test_f $ fromText "Makefile"
if makefileGenerated
then return ()
else run_ (fromText configureScriptPath) configureOptions
where configureScriptPath = "../" +++ (packageFolderName package) +++ "/configure"
configureOptions = globalConfigurationOptions ++
(configurationOptions $ packageTitle package)
| 583
|
configure version package =
vshell $ do
run_ "mkdir" ["-p", packageBuildDirText version package]
chPackageBuildDir version package
makefileGenerated <- test_f $ fromText "Makefile"
if makefileGenerated
then return ()
else run_ (fromText configureScriptPath) configureOptions
where configureScriptPath = "../" +++ (packageFolderName package) +++ "/configure"
configureOptions = globalConfigurationOptions ++
(configurationOptions $ packageTitle package)
| 553
| false
| true
| 0
| 11
| 152
| 128
| 62
| 66
| null | null |
tjakway/ghcjvm
|
compiler/utils/Util.hs
|
bsd-3-clause
|
splitAtList :: [b] -> [a] -> ([a], [a])
splitAtList [] xs = ([], xs)
| 72
|
splitAtList :: [b] -> [a] -> ([a], [a])
splitAtList [] xs = ([], xs)
| 72
|
splitAtList [] xs = ([], xs)
| 32
| false
| true
| 0
| 10
| 17
| 58
| 31
| 27
| null | null |
siddhanathan/ghc
|
compiler/main/HscTypes.hs
|
bsd-3-clause
|
isImplicitTyThing (AnId id) = isImplicitId id
| 49
|
isImplicitTyThing (AnId id) = isImplicitId id
| 49
|
isImplicitTyThing (AnId id) = isImplicitId id
| 49
| false
| false
| 0
| 7
| 9
| 18
| 8
| 10
| null | null |
spacekitteh/smcghc
|
compiler/nativeGen/PIC.hs
|
bsd-3-clause
|
pprImportedSymbol dflags platform importedLbl
| osElfTarget (platformOS platform)
= case dynamicLinkerLabelInfo importedLbl of
Just (SymbolPtr, lbl)
-> let symbolSize = case wordWidth dflags of
W32 -> sLit "\t.long"
W64 -> sLit "\t.quad"
_ -> panic "Unknown wordRep in pprImportedSymbol"
in vcat [
ptext (sLit ".section \".got2\", \"aw\""),
ptext (sLit ".LC_") <> pprCLabel platform lbl <> char ':',
ptext symbolSize <+> pprCLabel platform lbl ]
-- PLT code stubs are generated automatically by the dynamic linker.
_ -> empty
| 751
|
pprImportedSymbol dflags platform importedLbl
| osElfTarget (platformOS platform)
= case dynamicLinkerLabelInfo importedLbl of
Just (SymbolPtr, lbl)
-> let symbolSize = case wordWidth dflags of
W32 -> sLit "\t.long"
W64 -> sLit "\t.quad"
_ -> panic "Unknown wordRep in pprImportedSymbol"
in vcat [
ptext (sLit ".section \".got2\", \"aw\""),
ptext (sLit ".LC_") <> pprCLabel platform lbl <> char ':',
ptext symbolSize <+> pprCLabel platform lbl ]
-- PLT code stubs are generated automatically by the dynamic linker.
_ -> empty
| 751
|
pprImportedSymbol dflags platform importedLbl
| osElfTarget (platformOS platform)
= case dynamicLinkerLabelInfo importedLbl of
Just (SymbolPtr, lbl)
-> let symbolSize = case wordWidth dflags of
W32 -> sLit "\t.long"
W64 -> sLit "\t.quad"
_ -> panic "Unknown wordRep in pprImportedSymbol"
in vcat [
ptext (sLit ".section \".got2\", \"aw\""),
ptext (sLit ".LC_") <> pprCLabel platform lbl <> char ':',
ptext symbolSize <+> pprCLabel platform lbl ]
-- PLT code stubs are generated automatically by the dynamic linker.
_ -> empty
| 751
| false
| false
| 0
| 17
| 303
| 160
| 74
| 86
| null | null |
brendanhay/gogol
|
gogol-admin-directory/gen/Network/Google/Resource/Directory/Resources/Features/Get.hs
|
mpl-2.0
|
-- | Creates a value of 'ResourcesFeaturesGet' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'rfgXgafv'
--
-- * 'rfgUploadProtocol'
--
-- * 'rfgAccessToken'
--
-- * 'rfgUploadType'
--
-- * 'rfgCustomer'
--
-- * 'rfgFeatureKey'
--
-- * 'rfgCallback'
resourcesFeaturesGet
:: Text -- ^ 'rfgCustomer'
-> Text -- ^ 'rfgFeatureKey'
-> ResourcesFeaturesGet
resourcesFeaturesGet pRfgCustomer_ pRfgFeatureKey_ =
ResourcesFeaturesGet'
{ _rfgXgafv = Nothing
, _rfgUploadProtocol = Nothing
, _rfgAccessToken = Nothing
, _rfgUploadType = Nothing
, _rfgCustomer = pRfgCustomer_
, _rfgFeatureKey = pRfgFeatureKey_
, _rfgCallback = Nothing
}
| 758
|
resourcesFeaturesGet
:: Text -- ^ 'rfgCustomer'
-> Text -- ^ 'rfgFeatureKey'
-> ResourcesFeaturesGet
resourcesFeaturesGet pRfgCustomer_ pRfgFeatureKey_ =
ResourcesFeaturesGet'
{ _rfgXgafv = Nothing
, _rfgUploadProtocol = Nothing
, _rfgAccessToken = Nothing
, _rfgUploadType = Nothing
, _rfgCustomer = pRfgCustomer_
, _rfgFeatureKey = pRfgFeatureKey_
, _rfgCallback = Nothing
}
| 422
|
resourcesFeaturesGet pRfgCustomer_ pRfgFeatureKey_ =
ResourcesFeaturesGet'
{ _rfgXgafv = Nothing
, _rfgUploadProtocol = Nothing
, _rfgAccessToken = Nothing
, _rfgUploadType = Nothing
, _rfgCustomer = pRfgCustomer_
, _rfgFeatureKey = pRfgFeatureKey_
, _rfgCallback = Nothing
}
| 309
| true
| true
| 0
| 6
| 150
| 87
| 60
| 27
| null | null |
brendanhay/gogol
|
gogol-adexchangebuyer2/gen/Network/Google/AdExchangeBuyer2/Types/Product.hs
|
mpl-2.0
|
-- | The number of bids that won the auction.
bmrImpressionsWon :: Lens' BidMetricsRow (Maybe MetricValue)
bmrImpressionsWon
= lens _bmrImpressionsWon
(\ s a -> s{_bmrImpressionsWon = a})
| 195
|
bmrImpressionsWon :: Lens' BidMetricsRow (Maybe MetricValue)
bmrImpressionsWon
= lens _bmrImpressionsWon
(\ s a -> s{_bmrImpressionsWon = a})
| 149
|
bmrImpressionsWon
= lens _bmrImpressionsWon
(\ s a -> s{_bmrImpressionsWon = a})
| 88
| true
| true
| 2
| 9
| 34
| 55
| 25
| 30
| null | null |
seereason/HJScript
|
src/HJScript/DOM/AttributeNode.hs
|
bsd-3-clause
|
value :: Exp AttributeNode -> Var String
value = derefVar "value"
| 65
|
value :: Exp AttributeNode -> Var String
value = derefVar "value"
| 65
|
value = derefVar "value"
| 24
| false
| true
| 0
| 6
| 10
| 24
| 11
| 13
| null | null |
nyson/haste-compiler
|
libraries/ghc-7.8/base/Control/Monad.hs
|
bsd-3-clause
|
forM_ = flip mapM_
| 28
|
forM_ = flip mapM_
| 28
|
forM_ = flip mapM_
| 28
| false
| false
| 1
| 5
| 13
| 12
| 4
| 8
| null | null |
gwright83/Wheeler
|
src/Math/Symbolic/Wheeler/DummyIndices.hs
|
bsd-3-clause
|
collectIndices__ :: Expr -> MatchedIndices
collectIndices__ = resolveDummies excludeDummiesAndPatterns
| 102
|
collectIndices__ :: Expr -> MatchedIndices
collectIndices__ = resolveDummies excludeDummiesAndPatterns
| 102
|
collectIndices__ = resolveDummies excludeDummiesAndPatterns
| 59
| false
| true
| 0
| 5
| 8
| 18
| 9
| 9
| null | null |
beni55/scotty
|
test/Web/ScottySpec.hs
|
bsd-3-clause
|
availableMethods :: [StdMethod]
availableMethods = [GET, POST, HEAD, PUT, PATCH, DELETE, OPTIONS]
| 97
|
availableMethods :: [StdMethod]
availableMethods = [GET, POST, HEAD, PUT, PATCH, DELETE, OPTIONS]
| 97
|
availableMethods = [GET, POST, HEAD, PUT, PATCH, DELETE, OPTIONS]
| 65
| false
| true
| 0
| 5
| 11
| 35
| 22
| 13
| null | null |
deepfire/mood
|
src/Tracer.hs
|
agpl-3.0
|
logNotice' tr fmt ps = T.logNotice tr $ toStrict $ TF.format fmt ps
| 73
|
logNotice' tr fmt ps = T.logNotice tr $ toStrict $ TF.format fmt ps
| 73
|
logNotice' tr fmt ps = T.logNotice tr $ toStrict $ TF.format fmt ps
| 73
| false
| false
| 0
| 8
| 18
| 33
| 15
| 18
| null | null |
holzensp/ghc
|
compiler/cmm/CmmMachOp.hs
|
bsd-3-clause
|
mo_wordOr dflags = MO_Or (wordWidth dflags)
| 50
|
mo_wordOr dflags = MO_Or (wordWidth dflags)
| 50
|
mo_wordOr dflags = MO_Or (wordWidth dflags)
| 50
| false
| false
| 1
| 7
| 12
| 21
| 8
| 13
| null | null |
bitemyapp/traduisons-hs
|
src/Traduisons/Client.hs
|
bsd-3-clause
|
runCommand' :: Command -> StateT AppState (ExceptT TraduisonsError IO) (Maybe Message)
runCommand' Exit = throwError $ TErr TraduisonsExit "Exit"
| 145
|
runCommand' :: Command -> StateT AppState (ExceptT TraduisonsError IO) (Maybe Message)
runCommand' Exit = throwError $ TErr TraduisonsExit "Exit"
| 145
|
runCommand' Exit = throwError $ TErr TraduisonsExit "Exit"
| 58
| false
| true
| 0
| 8
| 18
| 48
| 23
| 25
| null | null |
y-usuzumi/survive-the-course
|
www.icourse163.org/ZJU-93001/第五周编程作业/3.hs
|
bsd-3-clause
|
insert :: Huffman -> Heap -> IO Heap
insert huff h@Heap{..} = do
let idx = size + 1
writeArray heap idx huff
adjust heap huff idx
return h{ size = size + 1
}
where
adjust :: HeapArray -> Huffman -> Int -> IO ()
adjust heap huff 1 = writeArray heap 1 huff
adjust heap huff idx
| idx < 1 = error "You idiot"
| otherwise = do
let nextIdx = idx `quot` 2
node <- readArray heap nextIdx
if (weight node < weight huff)
then do
writeArray heap idx huff
else do
writeArray heap idx node
adjust heap huff nextIdx
| 636
|
insert :: Huffman -> Heap -> IO Heap
insert huff h@Heap{..} = do
let idx = size + 1
writeArray heap idx huff
adjust heap huff idx
return h{ size = size + 1
}
where
adjust :: HeapArray -> Huffman -> Int -> IO ()
adjust heap huff 1 = writeArray heap 1 huff
adjust heap huff idx
| idx < 1 = error "You idiot"
| otherwise = do
let nextIdx = idx `quot` 2
node <- readArray heap nextIdx
if (weight node < weight huff)
then do
writeArray heap idx huff
else do
writeArray heap idx node
adjust heap huff nextIdx
| 636
|
insert huff h@Heap{..} = do
let idx = size + 1
writeArray heap idx huff
adjust heap huff idx
return h{ size = size + 1
}
where
adjust :: HeapArray -> Huffman -> Int -> IO ()
adjust heap huff 1 = writeArray heap 1 huff
adjust heap huff idx
| idx < 1 = error "You idiot"
| otherwise = do
let nextIdx = idx `quot` 2
node <- readArray heap nextIdx
if (weight node < weight huff)
then do
writeArray heap idx huff
else do
writeArray heap idx node
adjust heap huff nextIdx
| 599
| false
| true
| 0
| 11
| 237
| 246
| 114
| 132
| null | null |
elieux/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
----------------------
varQual_RDR, tcQual_RDR, clsQual_RDR, dataQual_RDR
:: Module -> FastString -> RdrName
varQual_RDR mod str = mkOrig mod (mkOccNameFS varName str)
| 172
|
varQual_RDR, tcQual_RDR, clsQual_RDR, dataQual_RDR
:: Module -> FastString -> RdrName
varQual_RDR mod str = mkOrig mod (mkOccNameFS varName str)
| 149
|
varQual_RDR mod str = mkOrig mod (mkOccNameFS varName str)
| 59
| true
| true
| 0
| 7
| 24
| 44
| 25
| 19
| null | null |
lostbean/Hammer
|
src/Hammer/VoxBox/Types.hs
|
gpl-3.0
|
castFaceVoxelPos :: FaceVoxelPos -> (Word8, VoxelPos)
castFaceVoxelPos cd = case cd of
Fx p -> (0, p)
Fy p -> (1, p)
Fz p -> (2, p)
| 139
|
castFaceVoxelPos :: FaceVoxelPos -> (Word8, VoxelPos)
castFaceVoxelPos cd = case cd of
Fx p -> (0, p)
Fy p -> (1, p)
Fz p -> (2, p)
| 139
|
castFaceVoxelPos cd = case cd of
Fx p -> (0, p)
Fy p -> (1, p)
Fz p -> (2, p)
| 85
| false
| true
| 0
| 8
| 34
| 78
| 40
| 38
| null | null |
osakunta/karma
|
src/SatO/Karma.hs
|
bsd-3-clause
|
submitAjax :: Ctx -> InsertAction -> IO ActionsResponse
submitAjax ctx@(Ctx pool _ _ _) ia = do
withResource pool $ \conn ->
void $ Postgres.execute conn "INSERT INTO karma (member, action) VALUES (?, ?)" ia
actionsResponse ctx
| 243
|
submitAjax :: Ctx -> InsertAction -> IO ActionsResponse
submitAjax ctx@(Ctx pool _ _ _) ia = do
withResource pool $ \conn ->
void $ Postgres.execute conn "INSERT INTO karma (member, action) VALUES (?, ?)" ia
actionsResponse ctx
| 243
|
submitAjax ctx@(Ctx pool _ _ _) ia = do
withResource pool $ \conn ->
void $ Postgres.execute conn "INSERT INTO karma (member, action) VALUES (?, ?)" ia
actionsResponse ctx
| 187
| false
| true
| 0
| 11
| 52
| 76
| 36
| 40
| null | null |
md5/hs-zenfolio
|
Network/JsonRpc.hs
|
bsd-3-clause
|
-- | Handle connection errors.
handleE :: Monad m => (ConnError -> m a) -> Either ConnError a -> m a
handleE h (Left e) = h e
| 125
|
handleE :: Monad m => (ConnError -> m a) -> Either ConnError a -> m a
handleE h (Left e) = h e
| 94
|
handleE h (Left e) = h e
| 24
| true
| true
| 0
| 11
| 27
| 64
| 29
| 35
| null | null |
mbakke/ganeti
|
test/hs/Test/Ganeti/OpCodes.hs
|
bsd-2-clause
|
-- * Test cases
-- | Check that opcode serialization is idempotent.
prop_serialization :: OpCodes.OpCode -> Property
prop_serialization = testSerialisation
| 156
|
prop_serialization :: OpCodes.OpCode -> Property
prop_serialization = testSerialisation
| 87
|
prop_serialization = testSerialisation
| 38
| true
| true
| 0
| 6
| 20
| 19
| 11
| 8
| null | null |
phylake/avm3
|
swf/Data/Swf/Deserialize.hs
|
mit
|
parse_swf :: Parser [Swf]
parse_swf = do
(version, file_length, compression) <- parse_header1
case compression of
None -> parse_swf2 version file_length
Zlib -> decompress (WindowBits 15) =$ parse_swf2 version file_length
LZMA -> error "LZMA unsupported"
| 270
|
parse_swf :: Parser [Swf]
parse_swf = do
(version, file_length, compression) <- parse_header1
case compression of
None -> parse_swf2 version file_length
Zlib -> decompress (WindowBits 15) =$ parse_swf2 version file_length
LZMA -> error "LZMA unsupported"
| 270
|
parse_swf = do
(version, file_length, compression) <- parse_header1
case compression of
None -> parse_swf2 version file_length
Zlib -> decompress (WindowBits 15) =$ parse_swf2 version file_length
LZMA -> error "LZMA unsupported"
| 244
| false
| true
| 0
| 13
| 49
| 84
| 41
| 43
| null | null |
brendanhay/gogol
|
gogol-cloudprivatecatalogproducer/gen/Network/Google/CloudPrivateCatalogProducer/Types/Product.hs
|
mpl-2.0
|
-- | A pagination token returned from a previous call to \`ListAssociations\`
-- that indicates where the listing should continue from. This field is
-- optional.
gcpvlarNextPageToken :: Lens' GoogleCloudPrivatecatalogproducerV1beta1ListAssociationsResponse (Maybe Text)
gcpvlarNextPageToken
= lens _gcpvlarNextPageToken
(\ s a -> s{_gcpvlarNextPageToken = a})
| 368
|
gcpvlarNextPageToken :: Lens' GoogleCloudPrivatecatalogproducerV1beta1ListAssociationsResponse (Maybe Text)
gcpvlarNextPageToken
= lens _gcpvlarNextPageToken
(\ s a -> s{_gcpvlarNextPageToken = a})
| 205
|
gcpvlarNextPageToken
= lens _gcpvlarNextPageToken
(\ s a -> s{_gcpvlarNextPageToken = a})
| 97
| true
| true
| 1
| 9
| 50
| 53
| 27
| 26
| null | null |
Fermat/higher-rank
|
test/MatchingSpec.hs
|
bsd-3-clause
|
exp2 = Var "y" dummyPos
| 23
|
exp2 = Var "y" dummyPos
| 23
|
exp2 = Var "y" dummyPos
| 23
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
vollmerm/shallow-fission
|
Data/Array/Accelerate/Fission.hs
|
bsd-3-clause
|
ac2 :: IO (A.Acc (Array (DIM0 :. Int) Double))
ac2 = runTune2 $ let a = Data.Array.Accelerate.Fission.map (+ 1) arr0
in combine $ zipWith (+) a a
| 162
|
ac2 :: IO (A.Acc (Array (DIM0 :. Int) Double))
ac2 = runTune2 $ let a = Data.Array.Accelerate.Fission.map (+ 1) arr0
in combine $ zipWith (+) a a
| 162
|
ac2 = runTune2 $ let a = Data.Array.Accelerate.Fission.map (+ 1) arr0
in combine $ zipWith (+) a a
| 115
| false
| true
| 0
| 11
| 43
| 79
| 42
| 37
| null | null |
srhb/quickcheck
|
examples/Set.hs
|
bsd-3-clause
|
x <. Node y _ s = x < y && x <. s
| 33
|
x <. Node y _ s = x < y && x <. s
| 33
|
x <. Node y _ s = x < y && x <. s
| 33
| false
| false
| 2
| 7
| 13
| 32
| 14
| 18
| null | null |
carbolymer/blockchain
|
blockchain-ui/src/Blockchain/UI/Core.hs
|
apache-2.0
|
createNewTransaction :: AppState -> NewTransactionRequest -> IO StatusMessage
createNewTransaction app newTxRequest = do
targetNode <- nodeDtoToNode <$$> listToMaybe <$> filter ((== txSender) . id) <$> (readIORef $ nodes app)
case targetNode of
Nothing -> return $ StatusMessage ERROR $ pack $ "No such node: " ++ (unpack txSender)
Just node -> do
result <- runRequests [NodeRequest node (newTransaction (restClient app) newTxRequest)]
mapM_ (warnL . show) (lefts result)
return $ case rights result of
[] -> StatusMessage ERROR "Could not send transaction"
[response] -> response
impossibleCase -> StatusMessage ERROR "Impossible happened!"
where
txSender = Transaction.newSender newTxRequest
| 753
|
createNewTransaction :: AppState -> NewTransactionRequest -> IO StatusMessage
createNewTransaction app newTxRequest = do
targetNode <- nodeDtoToNode <$$> listToMaybe <$> filter ((== txSender) . id) <$> (readIORef $ nodes app)
case targetNode of
Nothing -> return $ StatusMessage ERROR $ pack $ "No such node: " ++ (unpack txSender)
Just node -> do
result <- runRequests [NodeRequest node (newTransaction (restClient app) newTxRequest)]
mapM_ (warnL . show) (lefts result)
return $ case rights result of
[] -> StatusMessage ERROR "Could not send transaction"
[response] -> response
impossibleCase -> StatusMessage ERROR "Impossible happened!"
where
txSender = Transaction.newSender newTxRequest
| 753
|
createNewTransaction app newTxRequest = do
targetNode <- nodeDtoToNode <$$> listToMaybe <$> filter ((== txSender) . id) <$> (readIORef $ nodes app)
case targetNode of
Nothing -> return $ StatusMessage ERROR $ pack $ "No such node: " ++ (unpack txSender)
Just node -> do
result <- runRequests [NodeRequest node (newTransaction (restClient app) newTxRequest)]
mapM_ (warnL . show) (lefts result)
return $ case rights result of
[] -> StatusMessage ERROR "Could not send transaction"
[response] -> response
impossibleCase -> StatusMessage ERROR "Impossible happened!"
where
txSender = Transaction.newSender newTxRequest
| 675
| false
| true
| 0
| 19
| 154
| 230
| 110
| 120
| null | null |
mapinguari/SC_HS_Proxy
|
src/OLD/Paul/TileList.hs
|
mit
|
tilesSame :: Array Position Tile -> Position -> Position -> Bool
tilesSame a p c = (a ! p) == (a ! c)
| 101
|
tilesSame :: Array Position Tile -> Position -> Position -> Bool
tilesSame a p c = (a ! p) == (a ! c)
| 101
|
tilesSame a p c = (a ! p) == (a ! c)
| 36
| false
| true
| 1
| 9
| 22
| 60
| 29
| 31
| null | null |
wavewave/gnuplot
|
src/Graphics/Gnuplot/Frame/OptionSet/Histogram.hs
|
bsd-3-clause
|
errorbars ::
(Atom.C x, Atom.C y) =>
T (Graph2D.T x y) -> T (Graph2D.T x y)
errorbars =
OptionSet.add Option.styleHistogram ["errorbars"]
| 146
|
errorbars ::
(Atom.C x, Atom.C y) =>
T (Graph2D.T x y) -> T (Graph2D.T x y)
errorbars =
OptionSet.add Option.styleHistogram ["errorbars"]
| 146
|
errorbars =
OptionSet.add Option.styleHistogram ["errorbars"]
| 64
| false
| true
| 0
| 10
| 29
| 72
| 36
| 36
| null | null |
mhuesch/scheme_compiler
|
src/Spill/Spill.hs
|
bsd-3-clause
|
spillInstructions :: [Instruction] -> RS [Instruction]
spillInstructions ls = liftM concat $ mapM spillInstruction ls
| 117
|
spillInstructions :: [Instruction] -> RS [Instruction]
spillInstructions ls = liftM concat $ mapM spillInstruction ls
| 117
|
spillInstructions ls = liftM concat $ mapM spillInstruction ls
| 62
| false
| true
| 0
| 7
| 14
| 39
| 19
| 20
| null | null |
elbrujohalcon/wxhnotepad
|
src/Step6.hs
|
bsd-3-clause
|
openFindDialog :: GUIContext -> String -> Int -> IO ()
openFindDialog guiCtx@GUICtx{guiWin = win,
guiSearch = search} title dlgStyle =
do
frdialog <- findReplaceDialogCreate win search title $ dlgStyle + wxFR_NOWHOLEWORD
let winSet k f = let hnd _ = f guiCtx >> propagateEvent
in windowOnEvent frdialog [k] hnd hnd
winSet wxEVT_COMMAND_FIND findNextButton
winSet wxEVT_COMMAND_FIND_NEXT findNextButton
winSet wxEVT_COMMAND_FIND_REPLACE findReplaceButton
winSet wxEVT_COMMAND_FIND_REPLACE_ALL findReplaceAllButton
set frdialog [visible := True]
| 658
|
openFindDialog :: GUIContext -> String -> Int -> IO ()
openFindDialog guiCtx@GUICtx{guiWin = win,
guiSearch = search} title dlgStyle =
do
frdialog <- findReplaceDialogCreate win search title $ dlgStyle + wxFR_NOWHOLEWORD
let winSet k f = let hnd _ = f guiCtx >> propagateEvent
in windowOnEvent frdialog [k] hnd hnd
winSet wxEVT_COMMAND_FIND findNextButton
winSet wxEVT_COMMAND_FIND_NEXT findNextButton
winSet wxEVT_COMMAND_FIND_REPLACE findReplaceButton
winSet wxEVT_COMMAND_FIND_REPLACE_ALL findReplaceAllButton
set frdialog [visible := True]
| 658
|
openFindDialog guiCtx@GUICtx{guiWin = win,
guiSearch = search} title dlgStyle =
do
frdialog <- findReplaceDialogCreate win search title $ dlgStyle + wxFR_NOWHOLEWORD
let winSet k f = let hnd _ = f guiCtx >> propagateEvent
in windowOnEvent frdialog [k] hnd hnd
winSet wxEVT_COMMAND_FIND findNextButton
winSet wxEVT_COMMAND_FIND_NEXT findNextButton
winSet wxEVT_COMMAND_FIND_REPLACE findReplaceButton
winSet wxEVT_COMMAND_FIND_REPLACE_ALL findReplaceAllButton
set frdialog [visible := True]
| 603
| false
| true
| 0
| 15
| 181
| 169
| 78
| 91
| null | null |
everyevery/programming_study
|
hackerrank/functional/FunctionsOrNot/solution.hs
|
mit
|
solve :: IO String
solve = do
l <- getLine
ms <- M.replicateM (read l :: Int) readMapping
return $ check (L.sort ms)
| 122
|
solve :: IO String
solve = do
l <- getLine
ms <- M.replicateM (read l :: Int) readMapping
return $ check (L.sort ms)
| 122
|
solve = do
l <- getLine
ms <- M.replicateM (read l :: Int) readMapping
return $ check (L.sort ms)
| 103
| false
| true
| 0
| 11
| 28
| 62
| 29
| 33
| null | null |
mydaum/cabal
|
Cabal/Distribution/Simple/Compiler.hs
|
bsd-3-clause
|
compilerInfo :: Compiler -> CompilerInfo
compilerInfo c = CompilerInfo (compilerId c)
(compilerAbiTag c)
(Just . compilerCompat $ c)
(Just . map fst . compilerLanguages $ c)
(Just . map fst . compilerExtensions $ c)
| 335
|
compilerInfo :: Compiler -> CompilerInfo
compilerInfo c = CompilerInfo (compilerId c)
(compilerAbiTag c)
(Just . compilerCompat $ c)
(Just . map fst . compilerLanguages $ c)
(Just . map fst . compilerExtensions $ c)
| 335
|
compilerInfo c = CompilerInfo (compilerId c)
(compilerAbiTag c)
(Just . compilerCompat $ c)
(Just . map fst . compilerLanguages $ c)
(Just . map fst . compilerExtensions $ c)
| 294
| false
| true
| 0
| 10
| 153
| 88
| 44
| 44
| null | null |
jroesch/distribute
|
src/Distribute.hs
|
bsd-3-clause
|
broadcast :: (Serialize a) => a -> Distribute a ()
broadcast v = do
(_, Registry ref) <- S.get
reg <- lift $ readMVar ref
lift $ mapM_ sendEach (M.elems reg)
where sendEach p = write p (Value v)
| 208
|
broadcast :: (Serialize a) => a -> Distribute a ()
broadcast v = do
(_, Registry ref) <- S.get
reg <- lift $ readMVar ref
lift $ mapM_ sendEach (M.elems reg)
where sendEach p = write p (Value v)
| 208
|
broadcast v = do
(_, Registry ref) <- S.get
reg <- lift $ readMVar ref
lift $ mapM_ sendEach (M.elems reg)
where sendEach p = write p (Value v)
| 157
| false
| true
| 0
| 11
| 52
| 107
| 51
| 56
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.