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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
phadej/boolean-normal-forms
|
tests/CNFSet.hs
|
mit
|
eq :: CNF (Maybe (Sum Int)) -> CNF (Maybe (Sum Int)) -> Bool
eq = (==) `on` toBool
| 82
|
eq :: CNF (Maybe (Sum Int)) -> CNF (Maybe (Sum Int)) -> Bool
eq = (==) `on` toBool
| 82
|
eq = (==) `on` toBool
| 21
| false
| true
| 2
| 8
| 17
| 49
| 29
| 20
| null | null |
alexvong1995/pandoc
|
src/Text/Pandoc/Readers/Textile.hs
|
gpl-2.0
|
str :: Parser [Char] ParserState Inlines
str = do
baseStr <- hyphenedWords
-- RedCloth compliance : if parsed word is uppercase and immediatly
-- followed by parens, parens content is unconditionally word acronym
fullStr <- option baseStr $ try $ do
guard $ all isUpper baseStr
acro <- enclosed (char '(') (char ')') anyChar'
return $ concat [baseStr, " (", acro, ")"]
updateLastStrPos
return $ B.str fullStr
-- | Some number of space chars
| 465
|
str :: Parser [Char] ParserState Inlines
str = do
baseStr <- hyphenedWords
-- RedCloth compliance : if parsed word is uppercase and immediatly
-- followed by parens, parens content is unconditionally word acronym
fullStr <- option baseStr $ try $ do
guard $ all isUpper baseStr
acro <- enclosed (char '(') (char ')') anyChar'
return $ concat [baseStr, " (", acro, ")"]
updateLastStrPos
return $ B.str fullStr
-- | Some number of space chars
| 465
|
str = do
baseStr <- hyphenedWords
-- RedCloth compliance : if parsed word is uppercase and immediatly
-- followed by parens, parens content is unconditionally word acronym
fullStr <- option baseStr $ try $ do
guard $ all isUpper baseStr
acro <- enclosed (char '(') (char ')') anyChar'
return $ concat [baseStr, " (", acro, ")"]
updateLastStrPos
return $ B.str fullStr
-- | Some number of space chars
| 424
| false
| true
| 1
| 15
| 98
| 128
| 60
| 68
| null | null |
kapilash/hs-azure
|
azure-acs/Network/MicrosoftAzure/ACS.hs
|
apache-2.0
|
-- | If a valid token is available, it is returned. Otherwise, requests password a fresh password token from windows azure acs
--
-- Refer to <http://www.yesodweb.com/book/http-conduit HTTP Conduit> for information about creating and using 'Manager'
acsToken :: Manager -> AcsContext -> IO AcsToken
acsToken manager (AcsContext info mv) = do
utcTime <- getCurrentTime
acsResp <- takeMVar mv
if canReuse utcTime acsResp
then do { putMVar mv acsResp; return (wrapToken acsResp)}
else do
resp <- doAcsPost info manager
putMVar mv resp
return (wrapToken resp)
| 585
|
acsToken :: Manager -> AcsContext -> IO AcsToken
acsToken manager (AcsContext info mv) = do
utcTime <- getCurrentTime
acsResp <- takeMVar mv
if canReuse utcTime acsResp
then do { putMVar mv acsResp; return (wrapToken acsResp)}
else do
resp <- doAcsPost info manager
putMVar mv resp
return (wrapToken resp)
| 332
|
acsToken manager (AcsContext info mv) = do
utcTime <- getCurrentTime
acsResp <- takeMVar mv
if canReuse utcTime acsResp
then do { putMVar mv acsResp; return (wrapToken acsResp)}
else do
resp <- doAcsPost info manager
putMVar mv resp
return (wrapToken resp)
| 283
| true
| true
| 0
| 12
| 113
| 126
| 59
| 67
| null | null |
keera-studios/hsQt
|
Qtc/Gui/QUndoGroup.hs
|
bsd-2-clause
|
removeStack :: QUndoGroup a -> ((QUndoStack t1)) -> IO ()
removeStack x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QUndoGroup_removeStack cobj_x0 cobj_x1
| 194
|
removeStack :: QUndoGroup a -> ((QUndoStack t1)) -> IO ()
removeStack x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QUndoGroup_removeStack cobj_x0 cobj_x1
| 194
|
removeStack x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QUndoGroup_removeStack cobj_x0 cobj_x1
| 136
| false
| true
| 0
| 9
| 36
| 73
| 36
| 37
| null | null |
wavewave/lhc-analysis-collection
|
lib/HEP/Physics/Analysis/ATLAS/SUSY/SUSY_1to2L2to6JMET_8TeV.hs
|
gpl-3.0
|
--------------------------
-- Soft1L channel check --
--------------------------
-- | > 180, > 25, > 25
soft1L3JCheckPTJet :: MultiJet -> Either String ()
soft1L3JCheckPTJet (MultiJet3 (j1,j2,j3) js) =
guardE "soft1L3JCheckPTJet: jet pT condition not satisfied" (pt j1 > 180 && pt j2 > 25 && pt j3 > 25)
| 311
|
soft1L3JCheckPTJet :: MultiJet -> Either String ()
soft1L3JCheckPTJet (MultiJet3 (j1,j2,j3) js) =
guardE "soft1L3JCheckPTJet: jet pT condition not satisfied" (pt j1 > 180 && pt j2 > 25 && pt j3 > 25)
| 203
|
soft1L3JCheckPTJet (MultiJet3 (j1,j2,j3) js) =
guardE "soft1L3JCheckPTJet: jet pT condition not satisfied" (pt j1 > 180 && pt j2 > 25 && pt j3 > 25)
| 152
| true
| true
| 0
| 12
| 55
| 88
| 44
| 44
| null | null |
mbrock/HBEAM
|
src/Language/Erlang/BEAM/Emulator.hs
|
gpl-3.0
|
doReturn :: Emulation ()
doReturn = do x <- popRetStack
case x of
Just (f, pc) ->
local (\c -> c { emuFunction = f }) (interpret pc)
Nothing ->
return ()
--- Evaluation.
| 253
|
doReturn :: Emulation ()
doReturn = do x <- popRetStack
case x of
Just (f, pc) ->
local (\c -> c { emuFunction = f }) (interpret pc)
Nothing ->
return ()
--- Evaluation.
| 253
|
doReturn = do x <- popRetStack
case x of
Just (f, pc) ->
local (\c -> c { emuFunction = f }) (interpret pc)
Nothing ->
return ()
--- Evaluation.
| 228
| false
| true
| 0
| 14
| 117
| 84
| 43
| 41
| null | null |
HJvT/hdirect
|
src/Parser.hs
|
bsd-3-clause
|
action_324 x = happyTcHack x happyFail
| 38
|
action_324 x = happyTcHack x happyFail
| 38
|
action_324 x = happyTcHack x happyFail
| 38
| false
| false
| 0
| 5
| 5
| 14
| 6
| 8
| null | null |
peteg/ADHOC
|
Tests/08_Kesterel/142_nondet_bits_weak_abort.hs
|
gpl-2.0
|
test_input_process_hold = isOK (mc ctlM (ag (neg (probe nextBitP) --> (probe bitP <-> ax (probe bitP)))))
| 105
|
test_input_process_hold = isOK (mc ctlM (ag (neg (probe nextBitP) --> (probe bitP <-> ax (probe bitP)))))
| 105
|
test_input_process_hold = isOK (mc ctlM (ag (neg (probe nextBitP) --> (probe bitP <-> ax (probe bitP)))))
| 105
| false
| false
| 0
| 16
| 15
| 58
| 28
| 30
| null | null |
vTurbine/ghc
|
compiler/hsSyn/HsExpr.hs
|
bsd-3-clause
|
ppr_expr (HsTick tickish exp)
= pprTicks (ppr exp) $
ppr tickish <+> ppr_lexpr exp
| 88
|
ppr_expr (HsTick tickish exp)
= pprTicks (ppr exp) $
ppr tickish <+> ppr_lexpr exp
| 88
|
ppr_expr (HsTick tickish exp)
= pprTicks (ppr exp) $
ppr tickish <+> ppr_lexpr exp
| 88
| false
| false
| 4
| 6
| 19
| 43
| 18
| 25
| null | null |
vikraman/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
getEqPredRole :: PredType -> Role
getEqPredRole ty = eqRelRole (predTypeEqRel ty)
| 81
|
getEqPredRole :: PredType -> Role
getEqPredRole ty = eqRelRole (predTypeEqRel ty)
| 81
|
getEqPredRole ty = eqRelRole (predTypeEqRel ty)
| 47
| false
| true
| 0
| 7
| 10
| 33
| 14
| 19
| null | null |
fmapfmapfmap/amazonka
|
amazonka-swf/gen/Network/AWS/SWF/Types/Product.hs
|
mpl-2.0
|
-- | The ID of the 'DecisionTaskCompleted' event corresponding to the
-- decision task that resulted in the 'FailWorkflowExecution' decision to
-- fail this execution. This information can be useful for diagnosing
-- problems by tracing back the chain of events leading up to this event.
fwefeaDecisionTaskCompletedEventId :: Lens' FailWorkflowExecutionFailedEventAttributes Integer
fwefeaDecisionTaskCompletedEventId = lens _fwefeaDecisionTaskCompletedEventId (\ s a -> s{_fwefeaDecisionTaskCompletedEventId = a})
| 514
|
fwefeaDecisionTaskCompletedEventId :: Lens' FailWorkflowExecutionFailedEventAttributes Integer
fwefeaDecisionTaskCompletedEventId = lens _fwefeaDecisionTaskCompletedEventId (\ s a -> s{_fwefeaDecisionTaskCompletedEventId = a})
| 226
|
fwefeaDecisionTaskCompletedEventId = lens _fwefeaDecisionTaskCompletedEventId (\ s a -> s{_fwefeaDecisionTaskCompletedEventId = a})
| 131
| true
| true
| 0
| 9
| 61
| 43
| 25
| 18
| null | null |
TomMD/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
showParen_RDR = varQual_RDR gHC_SHOW (fsLit "showParen")
| 66
|
showParen_RDR = varQual_RDR gHC_SHOW (fsLit "showParen")
| 66
|
showParen_RDR = varQual_RDR gHC_SHOW (fsLit "showParen")
| 66
| false
| false
| 0
| 7
| 15
| 17
| 8
| 9
| null | null |
bgamari/sump
|
src/System/Hardware/Sump.hs
|
bsd-3-clause
|
run :: Sump -> ExceptT String IO (V.Vector Sample)
run sump = do
void $ command [0x1] 0 sump
let go accum = do
ss <- readSample sump
case ss of
Just s -> go $ V.snoc accum s
Nothing -> return $ V.reverse accum
let readFirst = do
ss <- readSample sump
case ss of
Just s -> return s
Nothing -> readFirst
first <- readFirst
go (V.singleton first)
| 453
|
run :: Sump -> ExceptT String IO (V.Vector Sample)
run sump = do
void $ command [0x1] 0 sump
let go accum = do
ss <- readSample sump
case ss of
Just s -> go $ V.snoc accum s
Nothing -> return $ V.reverse accum
let readFirst = do
ss <- readSample sump
case ss of
Just s -> return s
Nothing -> readFirst
first <- readFirst
go (V.singleton first)
| 453
|
run sump = do
void $ command [0x1] 0 sump
let go accum = do
ss <- readSample sump
case ss of
Just s -> go $ V.snoc accum s
Nothing -> return $ V.reverse accum
let readFirst = do
ss <- readSample sump
case ss of
Just s -> return s
Nothing -> readFirst
first <- readFirst
go (V.singleton first)
| 402
| false
| true
| 0
| 18
| 179
| 184
| 81
| 103
| null | null |
mishun/tangles
|
src/Math/Topology/KnotTh/Algebra/Dihedral/D4.hs
|
lgpl-3.0
|
d4EC2 = D4 5
| 12
|
d4EC2 = D4 5
| 12
|
d4EC2 = D4 5
| 12
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
quchen/shaking-up-ghc
|
src/Rules/Libffi.hs
|
bsd-3-clause
|
libffiDependencies :: [FilePath]
libffiDependencies = (rtsBuildPath -/-) <$> [ "ffi.h", "ffitarget.h" ]
| 103
|
libffiDependencies :: [FilePath]
libffiDependencies = (rtsBuildPath -/-) <$> [ "ffi.h", "ffitarget.h" ]
| 103
|
libffiDependencies = (rtsBuildPath -/-) <$> [ "ffi.h", "ffitarget.h" ]
| 70
| false
| true
| 0
| 6
| 11
| 28
| 17
| 11
| null | null |
vikraman/ghc
|
compiler/prelude/THNames.hs
|
bsd-3-clause
|
unTypeName = thFun (fsLit "unType") unTypeIdKey
| 55
|
unTypeName = thFun (fsLit "unType") unTypeIdKey
| 55
|
unTypeName = thFun (fsLit "unType") unTypeIdKey
| 55
| false
| false
| 0
| 7
| 13
| 17
| 8
| 9
| null | null |
gnn/Hets
|
TPTP/Pretty.hs
|
gpl-2.0
|
-- <tff_and_formula> ::= <tff_unitary_formula> & <tff_unitary_formula> |
-- <tff_and_formula> & <tff_unitary_formula>
printTFF_and_formula :: TFF_and_formula -> Doc
printTFF_and_formula = sepBy andD . map pretty
| 243
|
printTFF_and_formula :: TFF_and_formula -> Doc
printTFF_and_formula = sepBy andD . map pretty
| 93
|
printTFF_and_formula = sepBy andD . map pretty
| 46
| true
| true
| 0
| 6
| 54
| 27
| 14
| 13
| null | null |
davidlazar/generic-k
|
src/Data/Generics/K/FromK.hs
|
mit
|
kToExp :: K -> Exp
kToExp (KApp (KLabel (Syntax "ListExp" : _)) ks) = fromConstrK (toConstr (List [])) ks
| 105
|
kToExp :: K -> Exp
kToExp (KApp (KLabel (Syntax "ListExp" : _)) ks) = fromConstrK (toConstr (List [])) ks
| 105
|
kToExp (KApp (KLabel (Syntax "ListExp" : _)) ks) = fromConstrK (toConstr (List [])) ks
| 86
| false
| true
| 0
| 12
| 18
| 61
| 30
| 31
| null | null |
shayan-najd/HsParser
|
U/Exception.hs
|
gpl-3.0
|
-- | Generalised version of 'Control.Exception.handle', allowing an arbitrary
-- exception handling monad instead of just 'IO'.
ghandle :: (ExceptionMonad m, Exception e) => (e -> m a) -> m a -> m a
ghandle = flip gcatch
| 220
|
ghandle :: (ExceptionMonad m, Exception e) => (e -> m a) -> m a -> m a
ghandle = flip gcatch
| 92
|
ghandle = flip gcatch
| 21
| true
| true
| 0
| 9
| 37
| 55
| 28
| 27
| null | null |
fmapfmapfmap/amazonka
|
amazonka-ec2/test/Test/AWS/Gen/EC2.hs
|
mpl-2.0
|
testAttachNetworkInterfaceResponse :: AttachNetworkInterfaceResponse -> TestTree
testAttachNetworkInterfaceResponse = res
"AttachNetworkInterfaceResponse"
"fixture/AttachNetworkInterfaceResponse.proto"
eC2
(Proxy :: Proxy AttachNetworkInterface)
| 261
|
testAttachNetworkInterfaceResponse :: AttachNetworkInterfaceResponse -> TestTree
testAttachNetworkInterfaceResponse = res
"AttachNetworkInterfaceResponse"
"fixture/AttachNetworkInterfaceResponse.proto"
eC2
(Proxy :: Proxy AttachNetworkInterface)
| 261
|
testAttachNetworkInterfaceResponse = res
"AttachNetworkInterfaceResponse"
"fixture/AttachNetworkInterfaceResponse.proto"
eC2
(Proxy :: Proxy AttachNetworkInterface)
| 180
| false
| true
| 0
| 7
| 30
| 33
| 17
| 16
| null | null |
christiaanb/ghc
|
compiler/coreSyn/CoreSyn.hs
|
bsd-3-clause
|
isEvaldUnfolding _ = False
| 67
|
isEvaldUnfolding _ = False
| 67
|
isEvaldUnfolding _ = False
| 67
| false
| false
| 0
| 4
| 44
| 10
| 4
| 6
| null | null |
jstolarek/ghc
|
compiler/nativeGen/X86/CodeGen.hs
|
bsd-3-clause
|
reg `regClashesWithOp` OpAddr amode = any (==reg) (addrModeRegs amode)
| 70
|
reg `regClashesWithOp` OpAddr amode = any (==reg) (addrModeRegs amode)
| 70
|
reg `regClashesWithOp` OpAddr amode = any (==reg) (addrModeRegs amode)
| 70
| false
| false
| 0
| 7
| 8
| 35
| 17
| 18
| null | null |
merijn/SNet2.0
|
SNet/Record.hs
|
gpl-3.0
|
isTerminate :: Record a -> Bool
isTerminate Terminate = True
| 60
|
isTerminate :: Record a -> Bool
isTerminate Terminate = True
| 60
|
isTerminate Terminate = True
| 28
| false
| true
| 0
| 6
| 9
| 21
| 10
| 11
| null | null |
cocreature/stack
|
src/Stack/Build/Execute.hs
|
bsd-3-clause
|
printPlan :: M env m
=> FinalAction
-> Plan
-> m ()
printPlan finalAction plan = do
case Map.toList $ planUnregisterLocal plan of
[] -> $logInfo "Nothing to unregister"
xs -> do
$logInfo "Would unregister locally:"
forM_ xs $ \(gid, reason) -> $logInfo $ T.concat
[ T.pack $ ghcPkgIdString gid
, " ("
, reason
, ")"
]
$logInfo ""
case Map.elems $ planTasks plan of
[] -> $logInfo "Nothing to build"
xs -> do
$logInfo "Would build:"
mapM_ ($logInfo . displayTask) xs
let mfinalLabel =
case finalAction of
DoNothing -> Nothing
DoBenchmarks -> Just "benchmark"
DoTests _ -> Just "test"
case mfinalLabel of
Nothing -> return ()
Just finalLabel -> do
$logInfo ""
case Map.toList $ planFinals plan of
[] -> $logInfo $ "Nothing to " <> finalLabel
xs -> do
$logInfo $ "Would " <> finalLabel <> ":"
forM_ xs $ \(name, _) -> $logInfo $ T.pack $ packageNameString name
$logInfo ""
case Map.toList $ planInstallExes plan of
[] -> $logInfo "No executables to be installed"
xs -> do
$logInfo "Would install executables:"
forM_ xs $ \(name, loc) -> $logInfo $ T.concat
[ name
, " from "
, case loc of
Snap -> "snapshot"
Local -> "local"
, " database"
]
-- | For a dry run
| 1,713
|
printPlan :: M env m
=> FinalAction
-> Plan
-> m ()
printPlan finalAction plan = do
case Map.toList $ planUnregisterLocal plan of
[] -> $logInfo "Nothing to unregister"
xs -> do
$logInfo "Would unregister locally:"
forM_ xs $ \(gid, reason) -> $logInfo $ T.concat
[ T.pack $ ghcPkgIdString gid
, " ("
, reason
, ")"
]
$logInfo ""
case Map.elems $ planTasks plan of
[] -> $logInfo "Nothing to build"
xs -> do
$logInfo "Would build:"
mapM_ ($logInfo . displayTask) xs
let mfinalLabel =
case finalAction of
DoNothing -> Nothing
DoBenchmarks -> Just "benchmark"
DoTests _ -> Just "test"
case mfinalLabel of
Nothing -> return ()
Just finalLabel -> do
$logInfo ""
case Map.toList $ planFinals plan of
[] -> $logInfo $ "Nothing to " <> finalLabel
xs -> do
$logInfo $ "Would " <> finalLabel <> ":"
forM_ xs $ \(name, _) -> $logInfo $ T.pack $ packageNameString name
$logInfo ""
case Map.toList $ planInstallExes plan of
[] -> $logInfo "No executables to be installed"
xs -> do
$logInfo "Would install executables:"
forM_ xs $ \(name, loc) -> $logInfo $ T.concat
[ name
, " from "
, case loc of
Snap -> "snapshot"
Local -> "local"
, " database"
]
-- | For a dry run
| 1,713
|
printPlan finalAction plan = do
case Map.toList $ planUnregisterLocal plan of
[] -> $logInfo "Nothing to unregister"
xs -> do
$logInfo "Would unregister locally:"
forM_ xs $ \(gid, reason) -> $logInfo $ T.concat
[ T.pack $ ghcPkgIdString gid
, " ("
, reason
, ")"
]
$logInfo ""
case Map.elems $ planTasks plan of
[] -> $logInfo "Nothing to build"
xs -> do
$logInfo "Would build:"
mapM_ ($logInfo . displayTask) xs
let mfinalLabel =
case finalAction of
DoNothing -> Nothing
DoBenchmarks -> Just "benchmark"
DoTests _ -> Just "test"
case mfinalLabel of
Nothing -> return ()
Just finalLabel -> do
$logInfo ""
case Map.toList $ planFinals plan of
[] -> $logInfo $ "Nothing to " <> finalLabel
xs -> do
$logInfo $ "Would " <> finalLabel <> ":"
forM_ xs $ \(name, _) -> $logInfo $ T.pack $ packageNameString name
$logInfo ""
case Map.toList $ planInstallExes plan of
[] -> $logInfo "No executables to be installed"
xs -> do
$logInfo "Would install executables:"
forM_ xs $ \(name, loc) -> $logInfo $ T.concat
[ name
, " from "
, case loc of
Snap -> "snapshot"
Local -> "local"
, " database"
]
-- | For a dry run
| 1,631
| false
| true
| 0
| 22
| 766
| 473
| 214
| 259
| null | null |
castaway/pandoc
|
src/Text/Pandoc/Readers/LaTeX.hs
|
gpl-2.0
|
circ 'a' = 'â'
| 14
|
circ 'a' = 'â'
| 14
|
circ 'a' = 'â'
| 14
| false
| false
| 0
| 4
| 3
| 10
| 4
| 6
| null | null |
haskell-opengl/OpenGLRaw
|
src/Graphics/GL/Functions/F07.hs
|
bsd-3-clause
|
-- glEnablei -------------------------------------------------------------------
-- | Manual pages for <https://www.opengl.org/sdk/docs/man3/xhtml/glEnable.xml OpenGL 3.x> or <https://www.opengl.org/sdk/docs/man4/html/glEnable.xhtml OpenGL 4.x>.
glEnablei
:: MonadIO m
=> GLenum -- ^ @target@ of type [EnableCap](Graphics-GL-Groups.html#EnableCap).
-> GLuint -- ^ @index@.
-> m ()
glEnablei v1 v2 = liftIO $ dyn19 ptr_glEnablei v1 v2
| 442
|
glEnablei
:: MonadIO m
=> GLenum -- ^ @target@ of type [EnableCap](Graphics-GL-Groups.html#EnableCap).
-> GLuint -- ^ @index@.
-> m ()
glEnablei v1 v2 = liftIO $ dyn19 ptr_glEnablei v1 v2
| 195
|
glEnablei v1 v2 = liftIO $ dyn19 ptr_glEnablei v1 v2
| 52
| true
| true
| 0
| 10
| 53
| 55
| 27
| 28
| null | null |
NicolasDP/hit
|
Data/Git/Monad.hs
|
bsd-3-clause
|
appendCommitM :: CommitM (a -> b) -> CommitM a -> CommitM b
appendCommitM m1f m2 = m1f >>= \f -> m2 >>= \v -> return (f v)
| 122
|
appendCommitM :: CommitM (a -> b) -> CommitM a -> CommitM b
appendCommitM m1f m2 = m1f >>= \f -> m2 >>= \v -> return (f v)
| 122
|
appendCommitM m1f m2 = m1f >>= \f -> m2 >>= \v -> return (f v)
| 62
| false
| true
| 2
| 10
| 26
| 73
| 35
| 38
| null | null |
romanb/amazonka
|
amazonka-storagegateway/gen/Network/AWS/StorageGateway/DescribeVTLDevices.hs
|
mpl-2.0
|
-- | Specifies that the number of VTL devices described be limited to the
-- specified number.
dvtldLimit :: Lens' DescribeVTLDevices (Maybe Natural)
dvtldLimit = lens _dvtldLimit (\s a -> s { _dvtldLimit = a }) . mapping _Nat
| 226
|
dvtldLimit :: Lens' DescribeVTLDevices (Maybe Natural)
dvtldLimit = lens _dvtldLimit (\s a -> s { _dvtldLimit = a }) . mapping _Nat
| 131
|
dvtldLimit = lens _dvtldLimit (\s a -> s { _dvtldLimit = a }) . mapping _Nat
| 76
| true
| true
| 2
| 9
| 38
| 62
| 29
| 33
| null | null |
cem3394/haskell
|
tensorflow-mnist-input-data/Setup.hs
|
apache-2.0
|
httpDownload :: String -> FilePath -> IO ()
httpDownload url outFile = do
let uri = fromMaybe
(error ("Can't be: invalid URI " ++ url))
(URI.parseURI url)
result <- HTTP.simpleHTTP (HTTP.defaultGETRequest_ uri)
HTTP.getResponseCode result >>= \case
(2, 0, 0) -> HTTP.getResponseBody result >>= B.writeFile outFile
s -> error ( "Failed to download " ++ url ++ " error code " ++ show s
++ helpfulMessage
)
| 500
|
httpDownload :: String -> FilePath -> IO ()
httpDownload url outFile = do
let uri = fromMaybe
(error ("Can't be: invalid URI " ++ url))
(URI.parseURI url)
result <- HTTP.simpleHTTP (HTTP.defaultGETRequest_ uri)
HTTP.getResponseCode result >>= \case
(2, 0, 0) -> HTTP.getResponseBody result >>= B.writeFile outFile
s -> error ( "Failed to download " ++ url ++ " error code " ++ show s
++ helpfulMessage
)
| 500
|
httpDownload url outFile = do
let uri = fromMaybe
(error ("Can't be: invalid URI " ++ url))
(URI.parseURI url)
result <- HTTP.simpleHTTP (HTTP.defaultGETRequest_ uri)
HTTP.getResponseCode result >>= \case
(2, 0, 0) -> HTTP.getResponseBody result >>= B.writeFile outFile
s -> error ( "Failed to download " ++ url ++ " error code " ++ show s
++ helpfulMessage
)
| 456
| false
| true
| 0
| 17
| 162
| 163
| 77
| 86
| null | null |
gcampax/ghc
|
compiler/nativeGen/PPC/CodeGen.hs
|
bsd-3-clause
|
getAmode (CmmLit lit)
= do
tmp <- getNewRegNat II32
let imm = litToImm lit
code = unitOL (LIS tmp (HA imm))
return (Amode (AddrRegImm tmp (LO imm)) code)
| 191
|
getAmode (CmmLit lit)
= do
tmp <- getNewRegNat II32
let imm = litToImm lit
code = unitOL (LIS tmp (HA imm))
return (Amode (AddrRegImm tmp (LO imm)) code)
| 191
|
getAmode (CmmLit lit)
= do
tmp <- getNewRegNat II32
let imm = litToImm lit
code = unitOL (LIS tmp (HA imm))
return (Amode (AddrRegImm tmp (LO imm)) code)
| 191
| false
| false
| 0
| 14
| 65
| 88
| 40
| 48
| null | null |
yliu120/K3
|
src/Language/K3/Metaprogram/DataTypes.hs
|
apache-2.0
|
{- Generator monad helpers -}
runGeneratorM :: GeneratorState -> GeneratorM a -> IO (Either String a)
runGeneratorM st action = do
actE <- HIU.unsafeRunInterpreterWithArgs (mpInterpArgs $ mpEvalOpts st) $
flip runStateT st $ runEitherT
( (initializeInterpreter $ mpEvalOpts st) >> action )
return $ either (Left . show) fst actE
-- | Run a parser and return its result in the generator monad.
| 423
|
runGeneratorM :: GeneratorState -> GeneratorM a -> IO (Either String a)
runGeneratorM st action = do
actE <- HIU.unsafeRunInterpreterWithArgs (mpInterpArgs $ mpEvalOpts st) $
flip runStateT st $ runEitherT
( (initializeInterpreter $ mpEvalOpts st) >> action )
return $ either (Left . show) fst actE
-- | Run a parser and return its result in the generator monad.
| 393
|
runGeneratorM st action = do
actE <- HIU.unsafeRunInterpreterWithArgs (mpInterpArgs $ mpEvalOpts st) $
flip runStateT st $ runEitherT
( (initializeInterpreter $ mpEvalOpts st) >> action )
return $ either (Left . show) fst actE
-- | Run a parser and return its result in the generator monad.
| 321
| true
| true
| 0
| 14
| 93
| 116
| 56
| 60
| null | null |
flatrapp/core
|
app/Query/Util.hs
|
apache-2.0
|
runSQL :: (HasSpock m, SpockConn m ~ SqlBackend)
=> SqlQuery a -> m a
runSQL action = runQuery $ \conn -> runStdoutLoggingT $ runSqlConn action conn
| 155
|
runSQL :: (HasSpock m, SpockConn m ~ SqlBackend)
=> SqlQuery a -> m a
runSQL action = runQuery $ \conn -> runStdoutLoggingT $ runSqlConn action conn
| 155
|
runSQL action = runQuery $ \conn -> runStdoutLoggingT $ runSqlConn action conn
| 78
| false
| true
| 0
| 9
| 32
| 66
| 31
| 35
| null | null |
energyflowanalysis/efa-2.1
|
examples/advanced/vehicle/src/Main.hs
|
bsd-3-clause
|
energyIndexSec :: SeqIdx.Energy System.Node
energyIndexSec = Idx.InPart (Idx.Section 18) energyIndex
| 100
|
energyIndexSec :: SeqIdx.Energy System.Node
energyIndexSec = Idx.InPart (Idx.Section 18) energyIndex
| 100
|
energyIndexSec = Idx.InPart (Idx.Section 18) energyIndex
| 56
| false
| true
| 1
| 8
| 9
| 36
| 16
| 20
| null | null |
antalsz/hs-to-coq
|
examples/graph/graph/test/Data/Graph/Inductive/Graph/Properties.hs
|
mit
|
-- | Check that having an edge in a graph is equivalent to
-- 'hasNeighbor' reporting that the edge is there.
valid_hasNeighbor :: (Graph gr) => gr a b -> Node -> Node -> Bool
valid_hasNeighbor gr v w =
any (`elem` [(v,w), (w,v)]) (edges gr) == (hasNeighbor gr v w && hasNeighbor gr w v)
| 289
|
valid_hasNeighbor :: (Graph gr) => gr a b -> Node -> Node -> Bool
valid_hasNeighbor gr v w =
any (`elem` [(v,w), (w,v)]) (edges gr) == (hasNeighbor gr v w && hasNeighbor gr w v)
| 179
|
valid_hasNeighbor gr v w =
any (`elem` [(v,w), (w,v)]) (edges gr) == (hasNeighbor gr v w && hasNeighbor gr w v)
| 113
| true
| true
| 0
| 9
| 57
| 106
| 58
| 48
| null | null |
bacher09/darkplaces-demo
|
src/DarkPlaces/ProtocolConstants.hs
|
gpl-2.0
|
e_model1_bit :: Int
e_model1_bit = 6
| 36
|
e_model1_bit :: Int
e_model1_bit = 6
| 36
|
e_model1_bit = 6
| 16
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
glguy/animated-dangerzone
|
src/Client.hs
|
bsd-3-clause
|
cellImage (Just Rock) = char def_attr 'R'
| 41
|
cellImage (Just Rock) = char def_attr 'R'
| 41
|
cellImage (Just Rock) = char def_attr 'R'
| 41
| false
| false
| 0
| 7
| 6
| 20
| 9
| 11
| null | null |
meteficha/yesod
|
yesod-bin/main.hs
|
mit
|
touch' :: IO ()
touch' = touch
| 30
|
touch' :: IO ()
touch' = touch
| 30
|
touch' = touch
| 14
| false
| true
| 1
| 6
| 6
| 20
| 8
| 12
| null | null |
danr/hipspec
|
src/HipSpec/ATP/Results.hs
|
gpl-3.0
|
-- ^ Unrecognised output. For debugging
-- | Make a Success result, but register nothing about lemmas
mkSuccess :: ProverResult
mkSuccess = Success Nothing
| 156
|
mkSuccess :: ProverResult
mkSuccess = Success Nothing
| 53
|
mkSuccess = Success Nothing
| 27
| true
| true
| 0
| 5
| 24
| 16
| 9
| 7
| null | null |
jhoxray/muon
|
src/Quark/Base/Aggregation.hs
|
bsd-3-clause
|
-- pattern GnAm - group by n cols aggregate by m cols
-- what to do about boilerplate?????? --> see zipFTuples and mkGTuple helper functions
{-
groupColumnsG1A2 xs f g ys f1 g1 ys1 =
G.ifoldl' (\ !acc i x -> Map.insertWith (zipFTuples2 (f,f1)) x (mkGTuple2 (g, g1) (ys, ys1) i) acc) Map.empty xs
-}
-- changing signature to use tuples: ft = (f1, f2), gt = (g1, g2), yt = (y1, y2), xt = (x1, x2, ...) etc
-- this set of functions takes set of tuples:
-- xt - columns to group by
-- yt - columns to aggregate by
-- gt - functions applied to each member of yt before applying ft
-- ft - aggregation functions
-- So, groupby col1, col2 aggregate sum col3, count col4 will be transformed to:
-- groupColumnsG2A2 (col1, col2) ((+), (+)) (id, const 1) (col3, col4)
-- (as sum == (+) id while count == (+) (const 1))
groupColumnsG1A2 xs ft gt yt =
G.ifoldl' (\ !acc i x -> Map.insertWith (zipFTuples2 ft) x (mkATuple2 gt yt i) acc) Map.empty xs
| 977
|
groupColumnsG1A2 xs ft gt yt =
G.ifoldl' (\ !acc i x -> Map.insertWith (zipFTuples2 ft) x (mkATuple2 gt yt i) acc) Map.empty xs
| 132
|
groupColumnsG1A2 xs ft gt yt =
G.ifoldl' (\ !acc i x -> Map.insertWith (zipFTuples2 ft) x (mkATuple2 gt yt i) acc) Map.empty xs
| 132
| true
| false
| 1
| 10
| 220
| 85
| 44
| 41
| null | null |
gtk2hs/gi-gtk-hs
|
src/Data/GI/Gtk/ModelView/SeqStore.hs
|
lgpl-2.1
|
seqStoreInsertBefore :: (Applicative m, MonadIO m) => SeqStore a -> TreeIter -> a -> m ()
seqStoreInsertBefore store iter value = do
n <- seqStoreIterToIndex iter
seqStoreInsert store n value
-- | Insert an element after the given element.
| 248
|
seqStoreInsertBefore :: (Applicative m, MonadIO m) => SeqStore a -> TreeIter -> a -> m ()
seqStoreInsertBefore store iter value = do
n <- seqStoreIterToIndex iter
seqStoreInsert store n value
-- | Insert an element after the given element.
| 248
|
seqStoreInsertBefore store iter value = do
n <- seqStoreIterToIndex iter
seqStoreInsert store n value
-- | Insert an element after the given element.
| 158
| false
| true
| 0
| 10
| 47
| 74
| 35
| 39
| null | null |
diku-dk/futhark
|
src/Futhark/Analysis/Interference.hs
|
isc
|
applyAliases :: MemAlias.MemAliases -> Graph VName -> Graph VName
applyAliases aliases =
-- For each pair @(x, y)@ in graph, all memory aliases of x should interfere with all memory aliases of y
foldMap
( \(x, y) ->
let xs = MemAlias.aliasesOf aliases x <> oneName x
ys = MemAlias.aliasesOf aliases y <> oneName y
in cartesian makeEdge (namesToList xs) (namesToList ys)
)
| 412
|
applyAliases :: MemAlias.MemAliases -> Graph VName -> Graph VName
applyAliases aliases =
-- For each pair @(x, y)@ in graph, all memory aliases of x should interfere with all memory aliases of y
foldMap
( \(x, y) ->
let xs = MemAlias.aliasesOf aliases x <> oneName x
ys = MemAlias.aliasesOf aliases y <> oneName y
in cartesian makeEdge (namesToList xs) (namesToList ys)
)
| 412
|
applyAliases aliases =
-- For each pair @(x, y)@ in graph, all memory aliases of x should interfere with all memory aliases of y
foldMap
( \(x, y) ->
let xs = MemAlias.aliasesOf aliases x <> oneName x
ys = MemAlias.aliasesOf aliases y <> oneName y
in cartesian makeEdge (namesToList xs) (namesToList ys)
)
| 346
| false
| true
| 0
| 13
| 103
| 111
| 54
| 57
| null | null |
lpsmith/blaze-builder-compat
|
src/Blaze/ByteString/Builder/Char/Utf8.hs
|
bsd-3-clause
|
fromLazyText :: TL.Text -> Builder
fromLazyText = fromString . TL.unpack
| 72
|
fromLazyText :: TL.Text -> Builder
fromLazyText = fromString . TL.unpack
| 72
|
fromLazyText = fromString . TL.unpack
| 37
| false
| true
| 0
| 7
| 9
| 30
| 13
| 17
| null | null |
mcimini/GradualizerDynamicSemantics
|
DestinationType.hs
|
mit
|
-- Given a pattern-maching variable, it searches its pattern-matching premise in the rule
patternMatchByVar :: Rule -> Term -> Maybe Premise
patternMatchByVar rule term = searchPremiseByPredAndVar rule "match" term
| 214
|
patternMatchByVar :: Rule -> Term -> Maybe Premise
patternMatchByVar rule term = searchPremiseByPredAndVar rule "match" term
| 124
|
patternMatchByVar rule term = searchPremiseByPredAndVar rule "match" term
| 73
| true
| true
| 0
| 7
| 28
| 35
| 17
| 18
| null | null |
yuvallanger/threepenny-gui
|
src/Graphics/UI/Threepenny/Attributes.hs
|
bsd-3-clause
|
name = strAttr "name"
| 38
|
name = strAttr "name"
| 38
|
name = strAttr "name"
| 38
| false
| false
| 1
| 5
| 20
| 12
| 4
| 8
| null | null |
pparkkin/eta
|
compiler/ETA/Prelude/PrelNames.hs
|
bsd-3-clause
|
word32TyConName = tcQual gHC_WORD (fsLit "Word32") word32TyConKey
| 68
|
word32TyConName = tcQual gHC_WORD (fsLit "Word32") word32TyConKey
| 68
|
word32TyConName = tcQual gHC_WORD (fsLit "Word32") word32TyConKey
| 68
| false
| false
| 0
| 7
| 9
| 19
| 9
| 10
| null | null |
tomberek/RETE
|
src/RETE/Lib3.hs
|
bsd-3-clause
|
ordHelp :: (Traversable f,Ord a,VAR :<: f,LAM :<: f,VAR :<: PF (RHS f),LAM :<: PF (RHS f),APP :<: f,OrdF f)
=> [Ordering] -> RHS f a -> RHS f a -> Term (BOOL f)
ordHelp ords a b = Term $ Boolean $ \subs -> do
a' <- substitute app subs a
b' <- substitute app subs b
return $ elem (compareF (stripAnn a') (stripAnn b')) ords
| 338
|
ordHelp :: (Traversable f,Ord a,VAR :<: f,LAM :<: f,VAR :<: PF (RHS f),LAM :<: PF (RHS f),APP :<: f,OrdF f)
=> [Ordering] -> RHS f a -> RHS f a -> Term (BOOL f)
ordHelp ords a b = Term $ Boolean $ \subs -> do
a' <- substitute app subs a
b' <- substitute app subs b
return $ elem (compareF (stripAnn a') (stripAnn b')) ords
| 338
|
ordHelp ords a b = Term $ Boolean $ \subs -> do
a' <- substitute app subs a
b' <- substitute app subs b
return $ elem (compareF (stripAnn a') (stripAnn b')) ords
| 173
| false
| true
| 0
| 14
| 82
| 204
| 98
| 106
| null | null |
tjakway/ghcjvm
|
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
|
bsd-3-clause
|
arg_vars ((e, _):rest) (vars, stmts, tops)
= do (v1, stmts', top') <- exprToVar e
arg_vars rest (vars ++ [v1], stmts `appOL` stmts', tops ++ top')
-- | Cast a collection of LLVM variables to specific types.
| 217
|
arg_vars ((e, _):rest) (vars, stmts, tops)
= do (v1, stmts', top') <- exprToVar e
arg_vars rest (vars ++ [v1], stmts `appOL` stmts', tops ++ top')
-- | Cast a collection of LLVM variables to specific types.
| 217
|
arg_vars ((e, _):rest) (vars, stmts, tops)
= do (v1, stmts', top') <- exprToVar e
arg_vars rest (vars ++ [v1], stmts `appOL` stmts', tops ++ top')
-- | Cast a collection of LLVM variables to specific types.
| 217
| false
| false
| 0
| 10
| 46
| 87
| 49
| 38
| null | null |
jkozlowski/better-bot
|
src/Network/Better/Session.hs
|
mit
|
createSessionInteractive :: MonadIO m => String -> m S.Session
createSessionInteractive email = liftIO $ S.withSession $ \sess -> do
loginInteractive sess (T.pack email)
return sess
| 185
|
createSessionInteractive :: MonadIO m => String -> m S.Session
createSessionInteractive email = liftIO $ S.withSession $ \sess -> do
loginInteractive sess (T.pack email)
return sess
| 185
|
createSessionInteractive email = liftIO $ S.withSession $ \sess -> do
loginInteractive sess (T.pack email)
return sess
| 122
| false
| true
| 0
| 12
| 28
| 67
| 31
| 36
| null | null |
spechub/Hets
|
HasCASL/Subst.hs
|
gpl-2.0
|
typeEmpty :: Subst -> Bool
typeEmpty (Subst (_, m, _)) = Map.null m
| 67
|
typeEmpty :: Subst -> Bool
typeEmpty (Subst (_, m, _)) = Map.null m
| 67
|
typeEmpty (Subst (_, m, _)) = Map.null m
| 40
| false
| true
| 0
| 10
| 12
| 44
| 21
| 23
| null | null |
LambdaHack/LambdaHack
|
engine-src/Game/LambdaHack/Common/Save.hs
|
bsd-3-clause
|
wrapInSaves cops stateToFileName exe = do
-- We don't merge this with the other calls to waitForChildren,
-- because, e.g., for server, we don't want to wait for clients to exit,
-- if the server crashes (but we wait for the save to finish).
toSave <- newEmptyMVar
a <- async $ loopSave cops stateToFileName toSave
link a
let fin = do
-- Wait until the last save (if any) starts
-- and tell the save thread to end.
putMVar toSave Nothing
-- Wait 0.5s to flush debug and then until the save thread ends.
threadDelay 500000
wait a
exe toSave `Ex.finally` fin
-- The creation of, e.g., the initial client state, is outside the 'finally'
-- clause, but this is OK, since no saves are ordered until 'runActionCli'.
-- We save often, not only in the 'finally' section, in case of
-- power outages, kill -9, GHC runtime crashes, etc. For internal game
-- crashes, C-c, etc., the finalizer would be enough.
-- If we implement incremental saves, saving often will help
-- to spread the cost, to avoid a long pause at game exit.
-- | Restore a saved game, if it exists. Initialize directory structure
-- and copy over data files, if needed.
| 1,209
|
wrapInSaves cops stateToFileName exe = do
-- We don't merge this with the other calls to waitForChildren,
-- because, e.g., for server, we don't want to wait for clients to exit,
-- if the server crashes (but we wait for the save to finish).
toSave <- newEmptyMVar
a <- async $ loopSave cops stateToFileName toSave
link a
let fin = do
-- Wait until the last save (if any) starts
-- and tell the save thread to end.
putMVar toSave Nothing
-- Wait 0.5s to flush debug and then until the save thread ends.
threadDelay 500000
wait a
exe toSave `Ex.finally` fin
-- The creation of, e.g., the initial client state, is outside the 'finally'
-- clause, but this is OK, since no saves are ordered until 'runActionCli'.
-- We save often, not only in the 'finally' section, in case of
-- power outages, kill -9, GHC runtime crashes, etc. For internal game
-- crashes, C-c, etc., the finalizer would be enough.
-- If we implement incremental saves, saving often will help
-- to spread the cost, to avoid a long pause at game exit.
-- | Restore a saved game, if it exists. Initialize directory structure
-- and copy over data files, if needed.
| 1,209
|
wrapInSaves cops stateToFileName exe = do
-- We don't merge this with the other calls to waitForChildren,
-- because, e.g., for server, we don't want to wait for clients to exit,
-- if the server crashes (but we wait for the save to finish).
toSave <- newEmptyMVar
a <- async $ loopSave cops stateToFileName toSave
link a
let fin = do
-- Wait until the last save (if any) starts
-- and tell the save thread to end.
putMVar toSave Nothing
-- Wait 0.5s to flush debug and then until the save thread ends.
threadDelay 500000
wait a
exe toSave `Ex.finally` fin
-- The creation of, e.g., the initial client state, is outside the 'finally'
-- clause, but this is OK, since no saves are ordered until 'runActionCli'.
-- We save often, not only in the 'finally' section, in case of
-- power outages, kill -9, GHC runtime crashes, etc. For internal game
-- crashes, C-c, etc., the finalizer would be enough.
-- If we implement incremental saves, saving often will help
-- to spread the cost, to avoid a long pause at game exit.
-- | Restore a saved game, if it exists. Initialize directory structure
-- and copy over data files, if needed.
| 1,209
| false
| false
| 0
| 12
| 283
| 102
| 52
| 50
| null | null |
mdsteele/fallback
|
src/Fallback/Utility.hs
|
gpl-3.0
|
-- | Return 'True' if the number is non-infinite and non-NaN, 'False'
-- otherwise.
isFinite :: Double -> Bool
isFinite x = not (isNaN x || isInfinite x)
| 153
|
isFinite :: Double -> Bool
isFinite x = not (isNaN x || isInfinite x)
| 69
|
isFinite x = not (isNaN x || isInfinite x)
| 42
| true
| true
| 0
| 8
| 27
| 42
| 19
| 23
| null | null |
entropia/tip-toi-reveng
|
src/TipToiYaml.hs
|
mit
|
emptyCodeYaml :: TipToiCodesYAML
emptyCodeYaml = TipToiCodesYAML M.empty Nothing Nothing
| 88
|
emptyCodeYaml :: TipToiCodesYAML
emptyCodeYaml = TipToiCodesYAML M.empty Nothing Nothing
| 88
|
emptyCodeYaml = TipToiCodesYAML M.empty Nothing Nothing
| 55
| false
| true
| 0
| 6
| 8
| 20
| 10
| 10
| null | null |
romanb/amazonka
|
amazonka-elb/gen/Network/AWS/ELB/DescribeLoadBalancerPolicyTypes.hs
|
mpl-2.0
|
describeLoadBalancerPolicyTypes :: DescribeLoadBalancerPolicyTypes
describeLoadBalancerPolicyTypes = DescribeLoadBalancerPolicyTypes
{ _dlbptPolicyTypeNames = mempty
}
| 175
|
describeLoadBalancerPolicyTypes :: DescribeLoadBalancerPolicyTypes
describeLoadBalancerPolicyTypes = DescribeLoadBalancerPolicyTypes
{ _dlbptPolicyTypeNames = mempty
}
| 175
|
describeLoadBalancerPolicyTypes = DescribeLoadBalancerPolicyTypes
{ _dlbptPolicyTypeNames = mempty
}
| 108
| false
| true
| 0
| 6
| 18
| 22
| 12
| 10
| null | null |
alexander-at-github/eta
|
libraries/base/GHC/IO/Exception.hs
|
bsd-3-clause
|
userError :: String -> IOError
userError str = IOError Nothing UserError "" str Nothing Nothing
| 105
|
userError :: String -> IOError
userError str = IOError Nothing UserError "" str Nothing Nothing
| 105
|
userError str = IOError Nothing UserError "" str Nothing Nothing
| 67
| false
| true
| 0
| 5
| 24
| 31
| 15
| 16
| null | null |
ameingast/yawn
|
src/Yawn/HTTP/Response.hs
|
bsd-3-clause
|
packResponse :: Configuration -> Response -> IO ((Response, BS.ByteString))
packResponse conf r = do
response <- addMetaInfo conf r
let bytes = (BS8.pack $ show response) `BS.append` (fromMaybe BS.empty $ responseBody r)
return (response, bytes)
| 251
|
packResponse :: Configuration -> Response -> IO ((Response, BS.ByteString))
packResponse conf r = do
response <- addMetaInfo conf r
let bytes = (BS8.pack $ show response) `BS.append` (fromMaybe BS.empty $ responseBody r)
return (response, bytes)
| 251
|
packResponse conf r = do
response <- addMetaInfo conf r
let bytes = (BS8.pack $ show response) `BS.append` (fromMaybe BS.empty $ responseBody r)
return (response, bytes)
| 175
| false
| true
| 0
| 15
| 40
| 111
| 54
| 57
| null | null |
grachyov/Rogue-like-game-experiments
|
main.hs
|
mit
|
colorizeSlot (Door d) = colorProduct cDefault
| 45
|
colorizeSlot (Door d) = colorProduct cDefault
| 45
|
colorizeSlot (Door d) = colorProduct cDefault
| 45
| false
| false
| 0
| 6
| 5
| 19
| 8
| 11
| null | null |
mhwombat/creatur-realtra.OLD
|
src/ALife/Realtra/Image.hs
|
bsd-3-clause
|
-- row, column, colour channel
-- indices :: Int -> Int -> [(Int, Int, Int)]
-- indices w h = [(i,j) | i <- [0..h-1], j <- [0..w-1]]
-- -- row, column, colour channel
stripedImage :: Int -> Int -> Image
stripedImage w h = Image w h . map f $ indices w h
where f (i,_) | i < halfWidth = 255
| otherwise = 0
halfWidth = round $ (fromIntegral w :: Double) / 2
| 394
|
stripedImage :: Int -> Int -> Image
stripedImage w h = Image w h . map f $ indices w h
where f (i,_) | i < halfWidth = 255
| otherwise = 0
halfWidth = round $ (fromIntegral w :: Double) / 2
| 219
|
stripedImage w h = Image w h . map f $ indices w h
where f (i,_) | i < halfWidth = 255
| otherwise = 0
halfWidth = round $ (fromIntegral w :: Double) / 2
| 183
| true
| true
| 1
| 9
| 115
| 108
| 54
| 54
| null | null |
brendanhay/gogol
|
gogol-appstate/gen/Network/Google/Resource/AppState/States/Update.hs
|
mpl-2.0
|
-- | Creates a value of 'StatesUpdate' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'suCurrentStateVersion'
--
-- * 'suStateKey'
--
-- * 'suPayload'
statesUpdate
:: Int32 -- ^ 'suStateKey'
-> UpdateRequest -- ^ 'suPayload'
-> StatesUpdate
statesUpdate pSuStateKey_ pSuPayload_ =
StatesUpdate'
{ _suCurrentStateVersion = Nothing
, _suStateKey = _Coerce # pSuStateKey_
, _suPayload = pSuPayload_
}
| 513
|
statesUpdate
:: Int32 -- ^ 'suStateKey'
-> UpdateRequest -- ^ 'suPayload'
-> StatesUpdate
statesUpdate pSuStateKey_ pSuPayload_ =
StatesUpdate'
{ _suCurrentStateVersion = Nothing
, _suStateKey = _Coerce # pSuStateKey_
, _suPayload = pSuPayload_
}
| 276
|
statesUpdate pSuStateKey_ pSuPayload_ =
StatesUpdate'
{ _suCurrentStateVersion = Nothing
, _suStateKey = _Coerce # pSuStateKey_
, _suPayload = pSuPayload_
}
| 174
| true
| true
| 0
| 8
| 104
| 68
| 40
| 28
| null | null |
cabrera/elerea
|
FRP/Elerea/Legacy/Internal.hs
|
bsd-3-clause
|
sample (SNM b sm) dt = do c <- signalValue b dt
SM m <- signalValue sm dt
if c then m else return undefined
| 198
|
sample (SNM b sm) dt = do c <- signalValue b dt
SM m <- signalValue sm dt
if c then m else return undefined
| 198
|
sample (SNM b sm) dt = do c <- signalValue b dt
SM m <- signalValue sm dt
if c then m else return undefined
| 198
| false
| false
| 1
| 9
| 115
| 63
| 27
| 36
| null | null |
emilaxelsson/ag-graph
|
src/PAG/Internal.hs
|
bsd-3-clause
|
-- | Combines the semantic functions for two inherited attributes to
-- form a semantic function for the compound attribute consisting of
-- the two original attributes.
prodInh :: (p :< c, q :< c, Functor p, Functor q) => Inh f c p g -> Inh f c q g -> Inh f c (p :*: q) g
prodInh sp sq t = prodMapWith (:*:) (fmap Ret above) (fmap Ret above) (sp t) (sq t)
| 357
|
prodInh :: (p :< c, q :< c, Functor p, Functor q) => Inh f c p g -> Inh f c q g -> Inh f c (p :*: q) g
prodInh sp sq t = prodMapWith (:*:) (fmap Ret above) (fmap Ret above) (sp t) (sq t)
| 186
|
prodInh sp sq t = prodMapWith (:*:) (fmap Ret above) (fmap Ret above) (sp t) (sq t)
| 83
| true
| true
| 0
| 10
| 76
| 135
| 69
| 66
| null | null |
jtobin/okasaki
|
working/BinomialHeap.hs
|
mit
|
insertTree :: Ord a => Tree a -> Heap a -> Heap a
insertTree t [] = [t]
| 71
|
insertTree :: Ord a => Tree a -> Heap a -> Heap a
insertTree t [] = [t]
| 71
|
insertTree t [] = [t]
| 21
| false
| true
| 0
| 8
| 17
| 45
| 21
| 24
| null | null |
Catchouli/neuron
|
src/Neural.hs
|
bsd-3-clause
|
gradientDescent :: Network -> Vector R -> [Vector R] -> [Vector R] -> R -> Network
gradientDescent network input activations error learnRate =
gradientDescentM network (vecToMat input) (map vecToMat activations) (map vecToMat error) learnRate
| 244
|
gradientDescent :: Network -> Vector R -> [Vector R] -> [Vector R] -> R -> Network
gradientDescent network input activations error learnRate =
gradientDescentM network (vecToMat input) (map vecToMat activations) (map vecToMat error) learnRate
| 244
|
gradientDescent network input activations error learnRate =
gradientDescentM network (vecToMat input) (map vecToMat activations) (map vecToMat error) learnRate
| 161
| false
| true
| 0
| 10
| 35
| 90
| 44
| 46
| null | null |
TomMD/ghc
|
compiler/types/TyCon.hs
|
bsd-3-clause
|
tyConFamInstSig_maybe :: TyCon -> Maybe (TyCon, [Type], CoAxiom Unbranched)
tyConFamInstSig_maybe tc
= case tyConParent tc of
FamInstTyCon ax f ts -> Just (f, ts, ax)
_ -> Nothing
-- | If this 'TyCon' is that of a family instance, return the family in question
-- and the instance types. Otherwise, return @Nothing@
| 349
|
tyConFamInstSig_maybe :: TyCon -> Maybe (TyCon, [Type], CoAxiom Unbranched)
tyConFamInstSig_maybe tc
= case tyConParent tc of
FamInstTyCon ax f ts -> Just (f, ts, ax)
_ -> Nothing
-- | If this 'TyCon' is that of a family instance, return the family in question
-- and the instance types. Otherwise, return @Nothing@
| 349
|
tyConFamInstSig_maybe tc
= case tyConParent tc of
FamInstTyCon ax f ts -> Just (f, ts, ax)
_ -> Nothing
-- | If this 'TyCon' is that of a family instance, return the family in question
-- and the instance types. Otherwise, return @Nothing@
| 273
| false
| true
| 0
| 9
| 85
| 76
| 40
| 36
| null | null |
mikeplus64/fixed-array
|
src/Data/Array/Fixed.hs
|
mit
|
(!>) :: Storable a => Array i a -> Int -> a
(!>) arr i = unsafeInlineIO (Mut.unsafeIndex (Mut.unsafeThaw arr) i)
| 112
|
(!>) :: Storable a => Array i a -> Int -> a
(!>) arr i = unsafeInlineIO (Mut.unsafeIndex (Mut.unsafeThaw arr) i)
| 112
|
(!>) arr i = unsafeInlineIO (Mut.unsafeIndex (Mut.unsafeThaw arr) i)
| 68
| false
| true
| 0
| 10
| 20
| 61
| 31
| 30
| null | null |
raventid/coursera_learning
|
optics/project/Main.hs
|
mit
|
userInfo :: Lens' Session (UserId, UserName)
userInfo = U.lensProduct userId userName
| 85
|
userInfo :: Lens' Session (UserId, UserName)
userInfo = U.lensProduct userId userName
| 85
|
userInfo = U.lensProduct userId userName
| 40
| false
| true
| 0
| 6
| 10
| 29
| 15
| 14
| null | null |
input-output-hk/daedalus
|
installers/Installer.hs
|
apache-2.0
|
genSignedInstaller :: OS -> Options -> IO ()
genSignedInstaller os options'= do
putStrLn $ "Generating installer for " <> Sys.os <> "-" <> Sys.arch
export "NETWORK" (clusterNetwork $ oCluster options')
case os of
Linux64 -> putStrLn ("Use default.nix, please." :: String)
Macos64 -> MacInstaller.main options'
Win64 -> WindowsInstaller.main options'
| 392
|
genSignedInstaller :: OS -> Options -> IO ()
genSignedInstaller os options'= do
putStrLn $ "Generating installer for " <> Sys.os <> "-" <> Sys.arch
export "NETWORK" (clusterNetwork $ oCluster options')
case os of
Linux64 -> putStrLn ("Use default.nix, please." :: String)
Macos64 -> MacInstaller.main options'
Win64 -> WindowsInstaller.main options'
| 392
|
genSignedInstaller os options'= do
putStrLn $ "Generating installer for " <> Sys.os <> "-" <> Sys.arch
export "NETWORK" (clusterNetwork $ oCluster options')
case os of
Linux64 -> putStrLn ("Use default.nix, please." :: String)
Macos64 -> MacInstaller.main options'
Win64 -> WindowsInstaller.main options'
| 347
| false
| true
| 0
| 11
| 91
| 114
| 54
| 60
| null | null |
olorin/amazonka
|
amazonka-iam/gen/Network/AWS/IAM/CreateAccessKey.hs
|
mpl-2.0
|
-- | Creates a value of 'CreateAccessKeyResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cakrsResponseStatus'
--
-- * 'cakrsAccessKey'
createAccessKeyResponse
:: Int -- ^ 'cakrsResponseStatus'
-> AccessKey -- ^ 'cakrsAccessKey'
-> CreateAccessKeyResponse
createAccessKeyResponse pResponseStatus_ pAccessKey_ =
CreateAccessKeyResponse'
{ _cakrsResponseStatus = pResponseStatus_
, _cakrsAccessKey = pAccessKey_
}
| 533
|
createAccessKeyResponse
:: Int -- ^ 'cakrsResponseStatus'
-> AccessKey -- ^ 'cakrsAccessKey'
-> CreateAccessKeyResponse
createAccessKeyResponse pResponseStatus_ pAccessKey_ =
CreateAccessKeyResponse'
{ _cakrsResponseStatus = pResponseStatus_
, _cakrsAccessKey = pAccessKey_
}
| 303
|
createAccessKeyResponse pResponseStatus_ pAccessKey_ =
CreateAccessKeyResponse'
{ _cakrsResponseStatus = pResponseStatus_
, _cakrsAccessKey = pAccessKey_
}
| 171
| true
| true
| 0
| 6
| 92
| 47
| 30
| 17
| null | null |
urbanslug/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
word32PrimTyConKey = mkPreludeTyConUnique 62
| 65
|
word32PrimTyConKey = mkPreludeTyConUnique 62
| 65
|
word32PrimTyConKey = mkPreludeTyConUnique 62
| 65
| false
| false
| 0
| 5
| 24
| 9
| 4
| 5
| null | null |
beni55/hermit
|
src/HERMIT/Dictionary/Rules.hs
|
bsd-2-clause
|
pListT :: (HasCoreRules c, HasHermitMEnv m, LiftCoreM m, MonadIO m) => Transform c m a String
rulesHelpListT = do
rulesEnv <- getHermitRulesT
return (intercalate "\n" $ reverse $ map (show.fst) rulesEnv)
-- | Print a named CoreRule using the quantified printer.
ruleHel
| 278
|
rulesHelpListT :: (HasCoreRules c, HasHermitMEnv m, LiftCoreM m, MonadIO m) => Transform c m a String
rulesHelpListT = do
rulesEnv <- getHermitRulesT
return (intercalate "\n" $ reverse $ map (show.fst) rulesEnv)
-- | Print a named CoreRule using the quantified printer.
| 278
|
rulesHelpListT = do
rulesEnv <- getHermitRulesT
return (intercalate "\n" $ reverse $ map (show.fst) rulesEnv)
-- | Print a named CoreRule using the quantified printer.
| 176
| false
| true
| 0
| 12
| 50
| 88
| 43
| 45
| null | null |
gridaphobe/ghc
|
compiler/utils/Outputable.hs
|
bsd-3-clause
|
-- E.g. "he has one"
speakN 2 = text "two"
| 43
|
speakN 2 = text "two"
| 21
|
speakN 2 = text "two"
| 21
| true
| false
| 0
| 5
| 10
| 14
| 6
| 8
| null | null |
mattias-lundell/timber-llvm
|
src/Scp.hs
|
bsd-3-clause
|
maybeInline env n
| Just e <- lookup n (locEqns env) = Just e
| Just e <- lookup n (globEqns env) = Just e
| otherwise = Nothing
| 135
|
maybeInline env n
| Just e <- lookup n (locEqns env) = Just e
| Just e <- lookup n (globEqns env) = Just e
| otherwise = Nothing
| 135
|
maybeInline env n
| Just e <- lookup n (locEqns env) = Just e
| Just e <- lookup n (globEqns env) = Just e
| otherwise = Nothing
| 135
| false
| false
| 1
| 11
| 35
| 78
| 34
| 44
| null | null |
M42/mikrokosmos
|
source/NamedLambda.hs
|
gpl-3.0
|
showNamedLambdaPar l@(TypedPair _ _) = showNamedLambda l
| 56
|
showNamedLambdaPar l@(TypedPair _ _) = showNamedLambda l
| 56
|
showNamedLambdaPar l@(TypedPair _ _) = showNamedLambda l
| 56
| false
| false
| 1
| 8
| 6
| 27
| 11
| 16
| null | null |
juanbono/tapl-haskell
|
untyped/src/Language/Untyped/Eval.hs
|
gpl-3.0
|
bindings (NmAbs b t1) = (b, NameBind) : bindings t1
| 52
|
bindings (NmAbs b t1) = (b, NameBind) : bindings t1
| 52
|
bindings (NmAbs b t1) = (b, NameBind) : bindings t1
| 52
| false
| false
| 0
| 7
| 10
| 30
| 15
| 15
| null | null |
jthornber/language-c-ejt
|
src/Language/C/Analysis/TypeCheck.hs
|
bsd-3-clause
|
compositeParamDecl (AbstractParamDecl vd1 ni1) (AbstractParamDecl vd2 _) =
compositeParamDecl' AbstractParamDecl vd1 vd2 ni1
| 126
|
compositeParamDecl (AbstractParamDecl vd1 ni1) (AbstractParamDecl vd2 _) =
compositeParamDecl' AbstractParamDecl vd1 vd2 ni1
| 126
|
compositeParamDecl (AbstractParamDecl vd1 ni1) (AbstractParamDecl vd2 _) =
compositeParamDecl' AbstractParamDecl vd1 vd2 ni1
| 126
| false
| false
| 0
| 7
| 14
| 36
| 17
| 19
| null | null |
AlbinTheander/oden
|
cli/Oden/CLI.hs
|
mit
|
help :: String
help = usageInfo (usage ++ "\n\n" ++ commandsInfo ++ "Options:\n") options
| 89
|
help :: String
help = usageInfo (usage ++ "\n\n" ++ commandsInfo ++ "Options:\n") options
| 89
|
help = usageInfo (usage ++ "\n\n" ++ commandsInfo ++ "Options:\n") options
| 74
| false
| true
| 0
| 9
| 13
| 31
| 16
| 15
| null | null |
mapinguari/SC_HS_Proxy
|
src/Proxy/Query/Unit.hs
|
mit
|
gasCost TerranValkyrie = 125
| 28
|
gasCost TerranValkyrie = 125
| 28
|
gasCost TerranValkyrie = 125
| 28
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
ideas-edu/ideas
|
src/Ideas/Common/ExerciseTests.hs
|
apache-2.0
|
showAs :: (a -> String) -> Gen a -> Gen (ShowAs a)
showAs f = fmap (S f)
| 73
|
showAs :: (a -> String) -> Gen a -> Gen (ShowAs a)
showAs f = fmap (S f)
| 72
|
showAs f = fmap (S f)
| 21
| false
| true
| 0
| 9
| 18
| 50
| 24
| 26
| null | null |
vikraman/ghc
|
compiler/basicTypes/BasicTypes.hs
|
bsd-3-clause
|
mulWithInf _ Infinity = Infinity
| 39
|
mulWithInf _ Infinity = Infinity
| 39
|
mulWithInf _ Infinity = Infinity
| 39
| false
| false
| 1
| 5
| 11
| 13
| 5
| 8
| null | null |
brunjlar/pell
|
Math/NumberTheory/Pell.hs
|
mit
|
solve :: Integer -> Integer -> [Solution]
solve d n
| d <= 0 = error $ "D must be positive, but D == " ++ show d ++ "."
| isSquare d = error $ "D must not be a square, but D == " ++ show (integerSquareRoot d) ++ "^2."
| n == 0 = error "N must not be zero."
| otherwise = case getMinimalReps d n of
(_, []) -> []
((r, s), xys) -> go xys where
go xys' = normalize xys' ++ go (step xys')
normalize = sort . nub
step = map (mul d (r, s))
| 576
|
solve :: Integer -> Integer -> [Solution]
solve d n
| d <= 0 = error $ "D must be positive, but D == " ++ show d ++ "."
| isSquare d = error $ "D must not be a square, but D == " ++ show (integerSquareRoot d) ++ "^2."
| n == 0 = error "N must not be zero."
| otherwise = case getMinimalReps d n of
(_, []) -> []
((r, s), xys) -> go xys where
go xys' = normalize xys' ++ go (step xys')
normalize = sort . nub
step = map (mul d (r, s))
| 576
|
solve d n
| d <= 0 = error $ "D must be positive, but D == " ++ show d ++ "."
| isSquare d = error $ "D must not be a square, but D == " ++ show (integerSquareRoot d) ++ "^2."
| n == 0 = error "N must not be zero."
| otherwise = case getMinimalReps d n of
(_, []) -> []
((r, s), xys) -> go xys where
go xys' = normalize xys' ++ go (step xys')
normalize = sort . nub
step = map (mul d (r, s))
| 534
| false
| true
| 4
| 14
| 245
| 226
| 109
| 117
| null | null |
drpowell/Prokka-web
|
WJR/Mail.hs
|
gpl-3.0
|
-- | Helper function to convert a name and email address into a proper 'Address'
mkAddress :: String -> String -> Address
mkAddress name email = Address (Just $ fromString name) $ fromString email
| 196
|
mkAddress :: String -> String -> Address
mkAddress name email = Address (Just $ fromString name) $ fromString email
| 115
|
mkAddress name email = Address (Just $ fromString name) $ fromString email
| 74
| true
| true
| 0
| 9
| 33
| 45
| 22
| 23
| null | null |
EXio4/netza
|
src/QuoteBot.hs
|
mit
|
makeConfig :: String -> Text -> [Text] -> Config NotLoaded
makeConfig db prefix admins = Config (C_S db) prefix (map (Regex.regex []) admins)
| 141
|
makeConfig :: String -> Text -> [Text] -> Config NotLoaded
makeConfig db prefix admins = Config (C_S db) prefix (map (Regex.regex []) admins)
| 141
|
makeConfig db prefix admins = Config (C_S db) prefix (map (Regex.regex []) admins)
| 82
| false
| true
| 0
| 10
| 22
| 73
| 34
| 39
| null | null |
ghorn/monadic-modeling-test
|
LogsAndErrors.hs
|
bsd-3-clause
|
warn :: MonadWriter [LogMessage] m => String -> m ()
warn = logMessage . Warning
| 80
|
warn :: MonadWriter [LogMessage] m => String -> m ()
warn = logMessage . Warning
| 80
|
warn = logMessage . Warning
| 27
| false
| true
| 0
| 8
| 14
| 36
| 18
| 18
| null | null |
nh2/quickcheck
|
examples/Simple.hs
|
bsd-3-clause
|
--------------------------------------------------------------------------
-- example 1
allEqual x y z = x == y && y == z
| 123
|
allEqual x y z = x == y && y == z
| 34
|
allEqual x y z = x == y && y == z
| 34
| true
| false
| 0
| 7
| 17
| 27
| 14
| 13
| null | null |
yigitozkavci/ivy
|
src/Cenary/EvmAPI/API.hs
|
mit
|
dec :: OpcodeM m => Integer -> m ()
dec val = push32 val >> swap1 >> sub
| 72
|
dec :: OpcodeM m => Integer -> m ()
dec val = push32 val >> swap1 >> sub
| 72
|
dec val = push32 val >> swap1 >> sub
| 36
| false
| true
| 0
| 8
| 17
| 41
| 19
| 22
| null | null |
haskell-wasm/wasm
|
src/Language/Wasm/Binary.hs
|
mit
|
relOp (op, I64) = putWord8 $ case op of
Eqz -> 0x50
Eq -> 0x51
Ne -> 0x52
LtS -> 0x53
LtU -> 0x54
GtS -> 0x55
GtU -> 0x56
LeS -> 0x57
LeU -> 0x58
GeS -> 0x59
GeU -> 0x5a
_ -> todo -- not supported
| 224
|
relOp (op, I64) = putWord8 $ case op of
Eqz -> 0x50
Eq -> 0x51
Ne -> 0x52
LtS -> 0x53
LtU -> 0x54
GtS -> 0x55
GtU -> 0x56
LeS -> 0x57
LeU -> 0x58
GeS -> 0x59
GeU -> 0x5a
_ -> todo -- not supported
| 224
|
relOp (op, I64) = putWord8 $ case op of
Eqz -> 0x50
Eq -> 0x51
Ne -> 0x52
LtS -> 0x53
LtU -> 0x54
GtS -> 0x55
GtU -> 0x56
LeS -> 0x57
LeU -> 0x58
GeS -> 0x59
GeU -> 0x5a
_ -> todo -- not supported
| 224
| false
| false
| 0
| 8
| 75
| 96
| 49
| 47
| null | null |
keera-studios/hsQt
|
Qtc/ClassTypes/Gui.hs
|
bsd-2-clause
|
qCommonStyleListFromPtrList :: [Ptr (TQCommonStyle a)] -> IO [QCommonStyle a]
qCommonStyleListFromPtrList p
= objectListFromPtrList qtc_QCommonStyle_getFinalizer p
| 165
|
qCommonStyleListFromPtrList :: [Ptr (TQCommonStyle a)] -> IO [QCommonStyle a]
qCommonStyleListFromPtrList p
= objectListFromPtrList qtc_QCommonStyle_getFinalizer p
| 165
|
qCommonStyleListFromPtrList p
= objectListFromPtrList qtc_QCommonStyle_getFinalizer p
| 87
| false
| true
| 0
| 9
| 16
| 44
| 21
| 23
| null | null |
limaner2002/EPC-tools
|
RapidFire/src/Appian/Client.hs
|
bsd-3-clause
|
-- | Will find a text field on the page with the given label and
-- set insert the given text into the text field
textUpdate :: Text -> Text -> Value -> Either Text Update
textUpdate label txt v = toUpdate <$> (_Right . tfValue .~ txt $ tf)
where
tf = maybeToEither ("Could not find TextField " <> tshow label) $ v ^? getTextField label
-- | Reified version of 'textUpdate'
| 380
|
textUpdate :: Text -> Text -> Value -> Either Text Update
textUpdate label txt v = toUpdate <$> (_Right . tfValue .~ txt $ tf)
where
tf = maybeToEither ("Could not find TextField " <> tshow label) $ v ^? getTextField label
-- | Reified version of 'textUpdate'
| 266
|
textUpdate label txt v = toUpdate <$> (_Right . tfValue .~ txt $ tf)
where
tf = maybeToEither ("Could not find TextField " <> tshow label) $ v ^? getTextField label
-- | Reified version of 'textUpdate'
| 208
| true
| true
| 0
| 10
| 79
| 89
| 45
| 44
| null | null |
ihc/futhark
|
src/Futhark/Representation/ExplicitMemory.hs
|
isc
|
varMemInfo :: ExplicitMemorish lore =>
VName -> TC.TypeM lore (MemInfo SubExp NoUniqueness MemBind)
varMemInfo name = do
attr <- TC.lookupVar name
case attr of
LetInfo (_, summary) -> return summary
FParamInfo summary -> return $ noUniquenessReturns summary
LParamInfo summary -> return summary
IndexInfo it -> return $ MemPrim $ IntType it
| 375
|
varMemInfo :: ExplicitMemorish lore =>
VName -> TC.TypeM lore (MemInfo SubExp NoUniqueness MemBind)
varMemInfo name = do
attr <- TC.lookupVar name
case attr of
LetInfo (_, summary) -> return summary
FParamInfo summary -> return $ noUniquenessReturns summary
LParamInfo summary -> return summary
IndexInfo it -> return $ MemPrim $ IntType it
| 375
|
varMemInfo name = do
attr <- TC.lookupVar name
case attr of
LetInfo (_, summary) -> return summary
FParamInfo summary -> return $ noUniquenessReturns summary
LParamInfo summary -> return summary
IndexInfo it -> return $ MemPrim $ IntType it
| 261
| false
| true
| 0
| 11
| 85
| 127
| 58
| 69
| null | null |
david-caro/shellcheck
|
ShellCheck/Analytics.hs
|
gpl-3.0
|
prop_checkTimeParameters1 = verify checkTimeParameters "time -f lol sleep 10"
| 77
|
prop_checkTimeParameters1 = verify checkTimeParameters "time -f lol sleep 10"
| 77
|
prop_checkTimeParameters1 = verify checkTimeParameters "time -f lol sleep 10"
| 77
| false
| false
| 0
| 5
| 8
| 11
| 5
| 6
| null | null |
jeremy-w/Idris-dev
|
src/Idris/Core/ProofState.hs
|
bsd-3-clause
|
hnf_compute :: RunTactic
hnf_compute ctxt env (Bind x (Hole ty) sc) =
do let ty' = hnf ctxt env ty in
-- trace ("HNF " ++ show (ty, ty')) $
return $ Bind x (Hole ty') sc
| 193
|
hnf_compute :: RunTactic
hnf_compute ctxt env (Bind x (Hole ty) sc) =
do let ty' = hnf ctxt env ty in
-- trace ("HNF " ++ show (ty, ty')) $
return $ Bind x (Hole ty') sc
| 193
|
hnf_compute ctxt env (Bind x (Hole ty) sc) =
do let ty' = hnf ctxt env ty in
-- trace ("HNF " ++ show (ty, ty')) $
return $ Bind x (Hole ty') sc
| 168
| false
| true
| 0
| 12
| 60
| 73
| 35
| 38
| null | null |
mfpi/OpenGLRaw
|
src/Graphics/Rendering/OpenGL/Raw/ARB/Compatibility/Tokens.hs
|
bsd-3-clause
|
gl_NORMALIZE :: GLenum
gl_NORMALIZE = 0x0BA1
| 44
|
gl_NORMALIZE :: GLenum
gl_NORMALIZE = 0x0BA1
| 44
|
gl_NORMALIZE = 0x0BA1
| 21
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
spicyj/tex-parser
|
src/TeX/Parser/Util.hs
|
mit
|
optionalSpaces :: TeXParser ()
optionalSpaces =
(expand (categoryToken Space) >> optionalSpaces) <|>
(return ()) <?>
"optional spaces"
| 140
|
optionalSpaces :: TeXParser ()
optionalSpaces =
(expand (categoryToken Space) >> optionalSpaces) <|>
(return ()) <?>
"optional spaces"
| 140
|
optionalSpaces =
(expand (categoryToken Space) >> optionalSpaces) <|>
(return ()) <?>
"optional spaces"
| 109
| false
| true
| 0
| 11
| 22
| 48
| 24
| 24
| null | null |
gnn/Hets
|
DFOL/Parse_AS_DFOL.hs
|
gpl-2.0
|
-- parser for basic items
basicItemP :: AnnoState.AParser st BASIC_ITEM
basicItemP = do AnnoState.dotT
f <- formulaP
return $ Axiom_item f
<|>
do ns <- namesP
AnnoState.asKey "::"
t <- typeP
return $ Decl_item (ns, t)
-- parser for all types
| 348
|
basicItemP :: AnnoState.AParser st BASIC_ITEM
basicItemP = do AnnoState.dotT
f <- formulaP
return $ Axiom_item f
<|>
do ns <- namesP
AnnoState.asKey "::"
t <- typeP
return $ Decl_item (ns, t)
-- parser for all types
| 322
|
basicItemP = do AnnoState.dotT
f <- formulaP
return $ Axiom_item f
<|>
do ns <- namesP
AnnoState.asKey "::"
t <- typeP
return $ Decl_item (ns, t)
-- parser for all types
| 276
| true
| true
| 0
| 10
| 147
| 84
| 39
| 45
| null | null |
unisonweb/platform
|
parser-typechecker/src/Unison/Runtime/Pattern.hs
|
mit
|
seqPSize (P.SequenceOp _ _ Cons r) = (1+) <$> seqPSize r
| 56
|
seqPSize (P.SequenceOp _ _ Cons r) = (1+) <$> seqPSize r
| 56
|
seqPSize (P.SequenceOp _ _ Cons r) = (1+) <$> seqPSize r
| 56
| false
| false
| 0
| 8
| 10
| 34
| 17
| 17
| null | null |
haskell-opengl/OpenGLRaw
|
src/Graphics/GL/Functions/F17.hs
|
bsd-3-clause
|
-- glMultiTexCoord1dvARB -------------------------------------------------------
-- | This command is an alias for 'glMultiTexCoord1dv'.
glMultiTexCoord1dvARB
:: MonadIO m
=> GLenum -- ^ @target@ of type [TextureUnit](Graphics-GL-Groups.html#TextureUnit).
-> Ptr GLdouble -- ^ @v@ pointing to @1@ element of type @CoordD@.
-> m ()
glMultiTexCoord1dvARB v1 v2 = liftIO $ dyn100 ptr_glMultiTexCoord1dvARB v1 v2
| 417
|
glMultiTexCoord1dvARB
:: MonadIO m
=> GLenum -- ^ @target@ of type [TextureUnit](Graphics-GL-Groups.html#TextureUnit).
-> Ptr GLdouble -- ^ @v@ pointing to @1@ element of type @CoordD@.
-> m ()
glMultiTexCoord1dvARB v1 v2 = liftIO $ dyn100 ptr_glMultiTexCoord1dvARB v1 v2
| 279
|
glMultiTexCoord1dvARB v1 v2 = liftIO $ dyn100 ptr_glMultiTexCoord1dvARB v1 v2
| 77
| true
| true
| 0
| 10
| 58
| 58
| 28
| 30
| null | null |
acowley/ghc
|
compiler/rename/RnTypes.hs
|
bsd-3-clause
|
--------------------------------------
mkConOpPatRn :: Located Name -> Fixity -> LPat Name -> LPat Name
-> RnM (Pat Name)
mkConOpPatRn op2 fix2 p1@(L loc (ConPatIn op1 (InfixCon p11 p12))) p2
= do { fix1 <- lookupFixityRn (unLoc op1)
; let (nofix_error, associate_right) = compareFixity fix1 fix2
; if nofix_error then do
{ precParseErr (unLoc op1,fix1) (unLoc op2,fix2)
; return (ConPatIn op2 (InfixCon p1 p2)) }
else if associate_right then do
{ new_p <- mkConOpPatRn op2 fix2 p12 p2
; return (ConPatIn op1 (InfixCon p11 (L loc new_p))) } -- XXX loc right?
else return (ConPatIn op2 (InfixCon p1 p2)) }
| 723
|
mkConOpPatRn :: Located Name -> Fixity -> LPat Name -> LPat Name
-> RnM (Pat Name)
mkConOpPatRn op2 fix2 p1@(L loc (ConPatIn op1 (InfixCon p11 p12))) p2
= do { fix1 <- lookupFixityRn (unLoc op1)
; let (nofix_error, associate_right) = compareFixity fix1 fix2
; if nofix_error then do
{ precParseErr (unLoc op1,fix1) (unLoc op2,fix2)
; return (ConPatIn op2 (InfixCon p1 p2)) }
else if associate_right then do
{ new_p <- mkConOpPatRn op2 fix2 p12 p2
; return (ConPatIn op1 (InfixCon p11 (L loc new_p))) } -- XXX loc right?
else return (ConPatIn op2 (InfixCon p1 p2)) }
| 683
|
mkConOpPatRn op2 fix2 p1@(L loc (ConPatIn op1 (InfixCon p11 p12))) p2
= do { fix1 <- lookupFixityRn (unLoc op1)
; let (nofix_error, associate_right) = compareFixity fix1 fix2
; if nofix_error then do
{ precParseErr (unLoc op1,fix1) (unLoc op2,fix2)
; return (ConPatIn op2 (InfixCon p1 p2)) }
else if associate_right then do
{ new_p <- mkConOpPatRn op2 fix2 p12 p2
; return (ConPatIn op1 (InfixCon p11 (L loc new_p))) } -- XXX loc right?
else return (ConPatIn op2 (InfixCon p1 p2)) }
| 587
| true
| true
| 6
| 17
| 216
| 264
| 133
| 131
| null | null |
haroldcarr/learn-haskell-coq-ml-etc
|
haskell/topic/logging/structured-log-lines/src/LogData.hs
|
unlicense
|
decodeLogList :: BSL.ByteString -> Either T.Text LogList
decodeLogList a = case JS.eitherDecode a of
Left e -> Left $ "decodeLogList: " <> T.pack e
Right v -> logListArrayToTaggedJsonValues v
>>= taggedJsonValuesToLogItems
>>= Right . LogList
| 265
|
decodeLogList :: BSL.ByteString -> Either T.Text LogList
decodeLogList a = case JS.eitherDecode a of
Left e -> Left $ "decodeLogList: " <> T.pack e
Right v -> logListArrayToTaggedJsonValues v
>>= taggedJsonValuesToLogItems
>>= Right . LogList
| 265
|
decodeLogList a = case JS.eitherDecode a of
Left e -> Left $ "decodeLogList: " <> T.pack e
Right v -> logListArrayToTaggedJsonValues v
>>= taggedJsonValuesToLogItems
>>= Right . LogList
| 208
| false
| true
| 0
| 11
| 57
| 87
| 39
| 48
| null | null |
beni55/fay
|
examples/CodeWorld.hs
|
bsd-3-clause
|
randomR :: (Double, Double) -> StdGen -> (Double, StdGen)
randomR (lo, hi) g = (unsafeRand lo (hi - lo), g)
| 107
|
randomR :: (Double, Double) -> StdGen -> (Double, StdGen)
randomR (lo, hi) g = (unsafeRand lo (hi - lo), g)
| 107
|
randomR (lo, hi) g = (unsafeRand lo (hi - lo), g)
| 49
| false
| true
| 0
| 8
| 19
| 60
| 34
| 26
| null | null |
aslatter/hmumps
|
HMumps/Parsers.hs
|
gpl-3.0
|
parseRead :: Parser Command
parseRead = do stringOrPrefix1 "read"
cond <- postCondition
char_ ' '
args <- mlist1 parseWriteArg
case last args of
WriteExpression (ExpVn vn) -> return $ Read cond (init args) vn
_ -> fail "last argument to READ must be a variable name"
| 360
|
parseRead :: Parser Command
parseRead = do stringOrPrefix1 "read"
cond <- postCondition
char_ ' '
args <- mlist1 parseWriteArg
case last args of
WriteExpression (ExpVn vn) -> return $ Read cond (init args) vn
_ -> fail "last argument to READ must be a variable name"
| 360
|
parseRead = do stringOrPrefix1 "read"
cond <- postCondition
char_ ' '
args <- mlist1 parseWriteArg
case last args of
WriteExpression (ExpVn vn) -> return $ Read cond (init args) vn
_ -> fail "last argument to READ must be a variable name"
| 332
| false
| true
| 1
| 14
| 139
| 98
| 41
| 57
| null | null |
spinda/liquidhaskell
|
tests/gsoc15/working/pos/meas2.hs
|
bsd-3-clause
|
zs :: [Int]
zs = [1..100]
| 25
|
zs :: [Int]
zs = [1..100]
| 25
|
zs = [1..100]
| 13
| false
| true
| 0
| 5
| 5
| 19
| 11
| 8
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.