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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
lordi/jazzmate | src/Core.hs | gpl-2.0 | fromPitch :: V.Pitch -> Note
fromPitch p = toEnum (V.fromPitch p `mod` fromEnum PerfectOctave) | 94 | fromPitch :: V.Pitch -> Note
fromPitch p = toEnum (V.fromPitch p `mod` fromEnum PerfectOctave) | 94 | fromPitch p = toEnum (V.fromPitch p `mod` fromEnum PerfectOctave) | 65 | false | true | 0 | 9 | 13 | 40 | 20 | 20 | null | null |
ihc/futhark | src/Futhark/Pass/ExplicitAllocations.hs | isc | inKernelExpHints e =
return $ replicate (expExtTypeSize e) NoHint | 67 | inKernelExpHints e =
return $ replicate (expExtTypeSize e) NoHint | 67 | inKernelExpHints e =
return $ replicate (expExtTypeSize e) NoHint | 67 | false | false | 3 | 7 | 10 | 29 | 11 | 18 | null | null |
Mahdi89/eTeak | src/SimTypes.hs | bsd-3-clause | showSimValue :: Bool -> Type -> SimValue -> ShowS
showSimValue bareString typ val = body typ
where
body (Bits {}) = (numberToString typ int 10 0 False ++)
body (SignedBits {}) = (numberToString typ int 10 0 False ++)
body (BuiltinType "String")
| bareStrin... | 1,733 | showSimValue :: Bool -> Type -> SimValue -> ShowS
showSimValue bareString typ val = body typ
where
body (Bits {}) = (numberToString typ int 10 0 False ++)
body (SignedBits {}) = (numberToString typ int 10 0 False ++)
body (BuiltinType "String")
| bareString = ... | 1,729 | showSimValue bareString typ val = body typ
where
body (Bits {}) = (numberToString typ int 10 0 False ++)
body (SignedBits {}) = (numberToString typ int 10 0 False ++)
body (BuiltinType "String")
| bareString = showString str
| otherwise = showS... | 1,679 | false | true | 17 | 9 | 662 | 574 | 255 | 319 | null | null |
ambiata/mafia | main/mafia.hs | bsd-3-clause | pScriptPath :: Parser File
pScriptPath =
argument scriptRead $
metavar "SCRIPT_PATH"
<> help "The path to a Haskell script to execute." | 148 | pScriptPath :: Parser File
pScriptPath =
argument scriptRead $
metavar "SCRIPT_PATH"
<> help "The path to a Haskell script to execute." | 148 | pScriptPath =
argument scriptRead $
metavar "SCRIPT_PATH"
<> help "The path to a Haskell script to execute." | 121 | false | true | 3 | 5 | 33 | 36 | 14 | 22 | null | null |
rimmington/unordered-containers | Data/HashMap/Base.hs | bsd-3-clause | -- | In-place update version of insert
unsafeInsert :: (Eq k, Hashable k) => k -> v -> HashMap k v -> HashMap k v
unsafeInsert k0 v0 m0 = runST (go h0 k0 v0 0 m0)
where
h0 = hash k0
go !h !k x !_ Empty = return $! Leaf h (L k x)
go h k x s t@(Leaf hy l@(L ky y))
| hy == h = if ky == k
... | 1,312 | unsafeInsert :: (Eq k, Hashable k) => k -> v -> HashMap k v -> HashMap k v
unsafeInsert k0 v0 m0 = runST (go h0 k0 v0 0 m0)
where
h0 = hash k0
go !h !k x !_ Empty = return $! Leaf h (L k x)
go h k x s t@(Leaf hy l@(L ky y))
| hy == h = if ky == k
then if x `ptrEq` y
... | 1,273 | unsafeInsert k0 v0 m0 = runST (go h0 k0 v0 0 m0)
where
h0 = hash k0
go !h !k x !_ Empty = return $! Leaf h (L k x)
go h k x s t@(Leaf hy l@(L ky y))
| hy == h = if ky == k
then if x `ptrEq` y
then return t
else return $! Leaf h ... | 1,198 | true | true | 48 | 9 | 544 | 605 | 308 | 297 | null | null |
oldmanmike/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- Monad comprehensions
guardMIdKey, liftMIdKey, mzipIdKey :: Unique
guardMIdKey = mkPreludeMiscIdUnique 194 | 112 | guardMIdKey, liftMIdKey, mzipIdKey :: Unique
guardMIdKey = mkPreludeMiscIdUnique 194 | 88 | guardMIdKey = mkPreludeMiscIdUnique 194 | 43 | true | true | 0 | 5 | 15 | 19 | 12 | 7 | null | null |
junjihashimoto/th-cas | Algebra/CAS/TH.hs | mit | val2exp (S (Sin a)) = (AppE (VarE 'sin) (val2exp a)) | 52 | val2exp (S (Sin a)) = (AppE (VarE 'sin) (val2exp a)) | 52 | val2exp (S (Sin a)) = (AppE (VarE 'sin) (val2exp a)) | 52 | false | false | 0 | 9 | 9 | 42 | 21 | 21 | null | null |
Zigazou/deadlink | src/Database/MissingSQLite3.hs | gpl-3.0 | toMaybeText SQLVFSUnixNamedSem = Just "unix-namedsem" | 53 | toMaybeText SQLVFSUnixNamedSem = Just "unix-namedsem" | 53 | toMaybeText SQLVFSUnixNamedSem = Just "unix-namedsem" | 53 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
v0lkan/learning-haskell | session-002/double.hs | mit | getProduct =
product [12,121,1,14,46,22] | 44 | getProduct =
product [12,121,1,14,46,22] | 44 | getProduct =
product [12,121,1,14,46,22] | 44 | false | false | 1 | 5 | 7 | 30 | 16 | 14 | null | null |
rickynils/kdmswitch | KDMSwitch.hs | bsd-3-clause | runKdmCtl opts = do
(r,o,e) <- readProcessWithExitCode "kdmctl" opts ""
if (r /= ExitSuccess)
then failure "Failed running kdmctl"
else return (r,o,e) | 162 | runKdmCtl opts = do
(r,o,e) <- readProcessWithExitCode "kdmctl" opts ""
if (r /= ExitSuccess)
then failure "Failed running kdmctl"
else return (r,o,e) | 162 | runKdmCtl opts = do
(r,o,e) <- readProcessWithExitCode "kdmctl" opts ""
if (r /= ExitSuccess)
then failure "Failed running kdmctl"
else return (r,o,e) | 162 | false | false | 0 | 9 | 33 | 65 | 34 | 31 | null | null |
nikivazou/verified_string_matching | src/Data/RString/RString.hs | bsd-3-clause | stringLen :: RString -> Integer
{-@ assume stringLen :: x:RString -> {v:INat | v == stringLen x} @-}
stringLen s = toInteger (BS.length s) | 141 | stringLen :: RString -> Integer
stringLen s = toInteger (BS.length s) | 69 | stringLen s = toInteger (BS.length s) | 37 | true | true | 0 | 8 | 26 | 30 | 15 | 15 | null | null |
ezyang/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | pfail_RDR = varQual_RDR rEAD_PREC (fsLit "pfail") | 64 | pfail_RDR = varQual_RDR rEAD_PREC (fsLit "pfail") | 64 | pfail_RDR = varQual_RDR rEAD_PREC (fsLit "pfail") | 64 | false | false | 1 | 7 | 20 | 20 | 8 | 12 | null | null |
aleksj/lamdu | Lamdu/Sugar/Convert.hs | gpl-3.0 | newField ::
MonadA m => T m (Guid, (ExprIRef.ExpressionIM m, ExprIRef.ExpressionIM m))
newField = do
tag <- Transaction.newKey
newTagI <- ExprIRef.newExprBody (ExprLens.bodyTag # tag)
holeI <- DataOps.newHole
return (tag, (newTagI, holeI)) | 249 | newField ::
MonadA m => T m (Guid, (ExprIRef.ExpressionIM m, ExprIRef.ExpressionIM m))
newField = do
tag <- Transaction.newKey
newTagI <- ExprIRef.newExprBody (ExprLens.bodyTag # tag)
holeI <- DataOps.newHole
return (tag, (newTagI, holeI)) | 249 | newField = do
tag <- Transaction.newKey
newTagI <- ExprIRef.newExprBody (ExprLens.bodyTag # tag)
holeI <- DataOps.newHole
return (tag, (newTagI, holeI)) | 160 | false | true | 0 | 12 | 40 | 108 | 52 | 56 | null | null |
tjakway/ghcjvm | compiler/basicTypes/RdrName.hs | bsd-3-clause | isSrcRdrName :: RdrName -> Bool
isSrcRdrName (Unqual _) = True | 62 | isSrcRdrName :: RdrName -> Bool
isSrcRdrName (Unqual _) = True | 62 | isSrcRdrName (Unqual _) = True | 30 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
olorin/amazonka | amazonka-redshift/gen/Network/AWS/Redshift/Types/Product.hs | mpl-2.0 | -- | The last time when logs were delivered.
lsLastSuccessfulDeliveryTime :: Lens' LoggingStatus (Maybe UTCTime)
lsLastSuccessfulDeliveryTime = lens _lsLastSuccessfulDeliveryTime (\ s a -> s{_lsLastSuccessfulDeliveryTime = a}) . mapping _Time | 242 | lsLastSuccessfulDeliveryTime :: Lens' LoggingStatus (Maybe UTCTime)
lsLastSuccessfulDeliveryTime = lens _lsLastSuccessfulDeliveryTime (\ s a -> s{_lsLastSuccessfulDeliveryTime = a}) . mapping _Time | 197 | lsLastSuccessfulDeliveryTime = lens _lsLastSuccessfulDeliveryTime (\ s a -> s{_lsLastSuccessfulDeliveryTime = a}) . mapping _Time | 129 | true | true | 0 | 10 | 28 | 53 | 28 | 25 | null | null |
d0kt0r0/estuary | client/src/Estuary/Help/Sucixxx.hs | gpl-3.0 | about :: MonadWidget t m => m ()
about = do
divClass "about primary-color code-font" $ text "Sucixxx"
divClass "about primary-color code-font" $ text "A mini live coding esolang developed in Quito, Ecuador." | 209 | about :: MonadWidget t m => m ()
about = do
divClass "about primary-color code-font" $ text "Sucixxx"
divClass "about primary-color code-font" $ text "A mini live coding esolang developed in Quito, Ecuador." | 209 | about = do
divClass "about primary-color code-font" $ text "Sucixxx"
divClass "about primary-color code-font" $ text "A mini live coding esolang developed in Quito, Ecuador." | 176 | false | true | 0 | 8 | 34 | 51 | 22 | 29 | null | null |
wavewave/madgraph-auto-dataset | src/HEP/Automation/MadGraph/Dataset/Set20110412set2.hs | gpl-3.0 | processTTBar :: [Char]
processTTBar =
"\ngenerate P P > t t~ QED=99\n" | 74 | processTTBar :: [Char]
processTTBar =
"\ngenerate P P > t t~ QED=99\n" | 74 | processTTBar =
"\ngenerate P P > t t~ QED=99\n" | 51 | false | true | 0 | 7 | 15 | 21 | 9 | 12 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2020/M12/D15/Solution.hs | mit | asciiOnly :: CountryCapRel -> Bool
asciiOnly (Rel (Country c) _ (Capital (WD _qid n) _)) =
all ((< 128) . ord) (concat [c, T.unpack n]) | 138 | asciiOnly :: CountryCapRel -> Bool
asciiOnly (Rel (Country c) _ (Capital (WD _qid n) _)) =
all ((< 128) . ord) (concat [c, T.unpack n]) | 138 | asciiOnly (Rel (Country c) _ (Capital (WD _qid n) _)) =
all ((< 128) . ord) (concat [c, T.unpack n]) | 103 | false | true | 0 | 13 | 27 | 90 | 44 | 46 | null | null |
lamdu/lamdu | src/Lamdu/Eval/JS/Compiler.hs | gpl-3.0 | compileToNom ::
Monad m =>
IsTailCall -> ToNom T.NominalId V.Term # Annotated ValId -> M m CodeGen
compileToNom isTail (ToNom tId x) =
case x ^? ExprLens.valLiteral <&> PrimVal.toKnown of
Just (PrimVal.Bytes bytes)
| tId == Builtins.textTid
&& all (< 128) (BS.unpack bytes) ->
... | 514 | compileToNom ::
Monad m =>
IsTailCall -> ToNom T.NominalId V.Term # Annotated ValId -> M m CodeGen
compileToNom isTail (ToNom tId x) =
case x ^? ExprLens.valLiteral <&> PrimVal.toKnown of
Just (PrimVal.Bytes bytes)
| tId == Builtins.textTid
&& all (< 128) (BS.unpack bytes) ->
... | 514 | compileToNom isTail (ToNom tId x) =
case x ^? ExprLens.valLiteral <&> PrimVal.toKnown of
Just (PrimVal.Bytes bytes)
| tId == Builtins.textTid
&& all (< 128) (BS.unpack bytes) ->
-- The JS is more readable with string constants
rts "bytesFromAscii" $$ JS.string (Text.unpac... | 407 | false | true | 0 | 16 | 140 | 172 | 82 | 90 | null | null |
olorin/nagios-perfdata | src/Data/Nagios/Perfdata/Template.hs | bsd-3-clause | extractItems (Partial f) = extractItems (f "") | 46 | extractItems (Partial f) = extractItems (f "") | 46 | extractItems (Partial f) = extractItems (f "") | 46 | false | false | 0 | 7 | 6 | 24 | 11 | 13 | null | null |
KasperJanssens/Worksheet | src/Postgres.hs | bsd-3-clause | draai :: IO ()
draai =
let connStr = "host=localhost dbname=kasper user=kasper password=kasper port=5432" in
runStderrLoggingT $ withPostgresqlPool connStr 10 $ \pool -> liftIO $
flip runSqlPersistMPool pool $ do
runMigration migrateAll
utcTime <- liftIO getCurrentTime
let today = utc... | 501 | draai :: IO ()
draai =
let connStr = "host=localhost dbname=kasper user=kasper password=kasper port=5432" in
runStderrLoggingT $ withPostgresqlPool connStr 10 $ \pool -> liftIO $
flip runSqlPersistMPool pool $ do
runMigration migrateAll
utcTime <- liftIO getCurrentTime
let today = utc... | 501 | draai =
let connStr = "host=localhost dbname=kasper user=kasper password=kasper port=5432" in
runStderrLoggingT $ withPostgresqlPool connStr 10 $ \pool -> liftIO $
flip runSqlPersistMPool pool $ do
runMigration migrateAll
utcTime <- liftIO getCurrentTime
let today = utctDay utcTime
... | 486 | false | true | 2 | 12 | 131 | 148 | 63 | 85 | null | null |
ezyang/ghc | compiler/iface/ToIface.hs | bsd-3-clause | ---------------------
toIfaceType :: Type -> IfaceType
toIfaceType = toIfaceTypeX emptyVarSet | 93 | toIfaceType :: Type -> IfaceType
toIfaceType = toIfaceTypeX emptyVarSet | 71 | toIfaceType = toIfaceTypeX emptyVarSet | 38 | true | true | 0 | 5 | 9 | 19 | 10 | 9 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/TargetPools/AggregatedList.hs | mpl-2.0 | -- | Project ID for this request.
tpalProject :: Lens' TargetPoolsAggregatedList Text
tpalProject
= lens _tpalProject (\ s a -> s{_tpalProject = a}) | 150 | tpalProject :: Lens' TargetPoolsAggregatedList Text
tpalProject
= lens _tpalProject (\ s a -> s{_tpalProject = a}) | 116 | tpalProject
= lens _tpalProject (\ s a -> s{_tpalProject = a}) | 64 | true | true | 1 | 9 | 24 | 46 | 22 | 24 | null | null |
adk9/haskell-streamit | Language/StreamIt/Filter.hs | bsd-3-clause | peek :: Elt a => Exp Int -> Exp a
-- RRN: Shouldn't the type be:
-- peek :: (Elt a, Elt b) => Exp Int -> Filter a b (Exp b)
peek = PeekExp | 139 | peek :: Elt a => Exp Int -> Exp a
peek = PeekExp | 48 | peek = PeekExp | 14 | true | true | 0 | 7 | 35 | 30 | 15 | 15 | null | null |
ulricha/dsh | src/Database/DSH/FKL/Kure.hs | bsd-3-clause | imprintT :: Monad m => Transform FlatCtx m FExpr a1
-> Transform FlatCtx m FExpr a2
-> (Nat -> Type -> a1 -> a2 -> b)
-> Transform FlatCtx m ShapeExt b
imprintT t1 t2 f = transform $ \c expr -> case expr of
Imprint n ty e1 e2 -> f n ty <$>... | 504 | imprintT :: Monad m => Transform FlatCtx m FExpr a1
-> Transform FlatCtx m FExpr a2
-> (Nat -> Type -> a1 -> a2 -> b)
-> Transform FlatCtx m ShapeExt b
imprintT t1 t2 f = transform $ \c expr -> case expr of
Imprint n ty e1 e2 -> f n ty <$>... | 504 | imprintT t1 t2 f = transform $ \c expr -> case expr of
Imprint n ty e1 e2 -> f n ty <$> applyT t1 (c@@ImprintArg1) e1
<*> applyT t2 (c@@ImprintArg2) e2
_ -> fail "not a imprint call"
| 292 | false | true | 0 | 14 | 240 | 163 | 79 | 84 | null | null |
pepeiborra/narradar | src/Narradar/Framework/Ppr.hs | bsd-3-clause | vcat = Ppr.vcat . map pPrint | 28 | vcat = Ppr.vcat . map pPrint | 28 | vcat = Ppr.vcat . map pPrint | 28 | false | false | 0 | 6 | 5 | 15 | 7 | 8 | null | null |
oldmanmike/ghc | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprInstr (TEST format src dst) = sdocWithPlatform $ \platform ->
let format' = case (src,dst) of
-- Match instructions like 'test $0x3,%esi' or 'test $0x7,%rbx'.
-- We can replace them by equivalent, but smaller instructions
-- by reducing the size of the immediate operand as far as possible.
... | 1,012 | pprInstr (TEST format src dst) = sdocWithPlatform $ \platform ->
let format' = case (src,dst) of
-- Match instructions like 'test $0x3,%esi' or 'test $0x7,%rbx'.
-- We can replace them by equivalent, but smaller instructions
-- by reducing the size of the immediate operand as far as possible.
... | 1,012 | pprInstr (TEST format src dst) = sdocWithPlatform $ \platform ->
let format' = case (src,dst) of
-- Match instructions like 'test $0x3,%esi' or 'test $0x7,%rbx'.
-- We can replace them by equivalent, but smaller instructions
-- by reducing the size of the immediate operand as far as possible.
... | 1,012 | false | false | 1 | 19 | 297 | 225 | 112 | 113 | null | null |
qpliu/esolang | blo/hs/Check.hs | gpl-3.0 | checkStmt :: Map String AstType -> Map String AstFuncSig -> Map String AstType
-> Map String () -> Maybe AstType -> Stmt
-> Compile AstStmt
checkStmt types funcSigs scope forLabels retType (StmtBlock pos stmts) = do
checkedStmts <- fmap (reverse . snd)... | 1,013 | checkStmt :: Map String AstType -> Map String AstFuncSig -> Map String AstType
-> Map String () -> Maybe AstType -> Stmt
-> Compile AstStmt
checkStmt types funcSigs scope forLabels retType (StmtBlock pos stmts) = do
checkedStmts <- fmap (reverse . snd)... | 1,013 | checkStmt types funcSigs scope forLabels retType (StmtBlock pos stmts) = do
checkedStmts <- fmap (reverse . snd)
(foldM checkBlockStmt ((True,scope),[]) stmts)
return (AstStmtBlock pos checkedStmts)
where
checkBlockStmt ((False,_),_) stmt =
compileError (stmtSourcePos stmt... | 809 | false | true | 2 | 16 | 347 | 302 | 147 | 155 | null | null |
ksaveljev/hake-2 | src/Game/Monsters/MGladiator.hs | bsd-3-clause | gladiatorDead :: EntThink
gladiatorDead =
GenericEntThink "gladiator_dead" $ \selfRef -> do
modifyRef selfRef (\v -> v & eMins .~ V3 (-16) (-16) (-24)
& eMaxs .~ V3 16 16 (-8)
& eMoveType .~ Constants.moveTypeToss
... | 526 | gladiatorDead :: EntThink
gladiatorDead =
GenericEntThink "gladiator_dead" $ \selfRef -> do
modifyRef selfRef (\v -> v & eMins .~ V3 (-16) (-16) (-24)
& eMaxs .~ V3 16 16 (-8)
& eMoveType .~ Constants.moveTypeToss
... | 526 | gladiatorDead =
GenericEntThink "gladiator_dead" $ \selfRef -> do
modifyRef selfRef (\v -> v & eMins .~ V3 (-16) (-16) (-24)
& eMaxs .~ V3 16 16 (-8)
& eMoveType .~ Constants.moveTypeToss
& eSvFlags %~ (.|. Const... | 500 | false | true | 2 | 23 | 207 | 156 | 75 | 81 | null | null |
ComputationWithBoundedResources/jat | src/Jat/PState/Fun.hs | bsd-3-clause | -- | Checks if two states are similar.
-- Two states are similar if the class name, field name and program counter of
-- its frames correspond.
isSimilar :: PState i a -> PState i a -> Bool
isSimilar (PState _ frms1 _) (PState _ frms2 _) = isSimilarFS frms1 frms2
where
isSimilarFS (f1:fs1) (f2:fs2) = isSimilarF f... | 620 | isSimilar :: PState i a -> PState i a -> Bool
isSimilar (PState _ frms1 _) (PState _ frms2 _) = isSimilarFS frms1 frms2
where
isSimilarFS (f1:fs1) (f2:fs2) = isSimilarF f1 f2 && isSimilarFS fs1 fs2
isSimilarFS [][] = True
isSimilarFS _ _ = False
isSimilarF (Frame loc1 stk1 c... | 476 | isSimilar (PState _ frms1 _) (PState _ frms2 _) = isSimilarFS frms1 frms2
where
isSimilarFS (f1:fs1) (f2:fs2) = isSimilarF f1 f2 && isSimilarFS fs1 fs2
isSimilarFS [][] = True
isSimilarFS _ _ = False
isSimilarF (Frame loc1 stk1 cn1 mn1 pc1) (Frame loc2 stk2 cn2 mn2 pc2) =
... | 430 | true | true | 0 | 13 | 167 | 213 | 104 | 109 | null | null |
eijian/deeplearning | CNN/Layer.hs | bsd-3-clause | showFilter (FullConnLayer fs) = show fs | 39 | showFilter (FullConnLayer fs) = show fs | 39 | showFilter (FullConnLayer fs) = show fs | 39 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
chpatrick/hchip | HChip/Sound.hs | mit | step :: SoundStep -> Word64 -> Double
step s t = stepStart s + fromIntegral t * stepSlope s | 91 | step :: SoundStep -> Word64 -> Double
step s t = stepStart s + fromIntegral t * stepSlope s | 91 | step s t = stepStart s + fromIntegral t * stepSlope s | 53 | false | true | 0 | 7 | 18 | 41 | 19 | 22 | null | null |
ekmett/wl-pprint-extras | src/Text/PrettyPrint/Free/Internal.hs | bsd-2-clause | column, nesting :: (Int -> Doc a e) -> Doc a e
column = Column | 62 | column, nesting :: (Int -> Doc a e) -> Doc a e
column = Column | 62 | column = Column | 15 | false | true | 0 | 8 | 14 | 34 | 18 | 16 | null | null |
brendanhay/gogol | gogol-logging/gen/Network/Google/Resource/Logging/BillingAccounts/Sinks/Update.hs | mpl-2.0 | -- | Optional. Field mask that specifies the fields in sink that need an
-- update. A sink field will be overwritten if, and only if, it is in the
-- update mask. name and output only fields cannot be updated.An empty
-- updateMask is temporarily treated as using the following mask for
-- backwards compatibility purpos... | 807 | basuUpdateMask :: Lens' BillingAccountsSinksUpdate (Maybe GFieldMask)
basuUpdateMask
= lens _basuUpdateMask
(\ s a -> s{_basuUpdateMask = a}) | 149 | basuUpdateMask
= lens _basuUpdateMask
(\ s a -> s{_basuUpdateMask = a}) | 79 | true | true | 0 | 9 | 113 | 57 | 34 | 23 | null | null |
creichert/wai | warp/test/WithApplicationSpec.hs | mit | spec :: Spec
spec = do
runIO $ do
unsetEnv "http_proxy"
unsetEnv "https_proxy"
describe "withApplication" $ do
it "runs a wai Application while executing the given action" $ do
let mkApp = return $ \ _request respond -> respond $ responseLBS ok200 [] "foo"
withApplication mkApp $ \ port ... | 1,452 | spec :: Spec
spec = do
runIO $ do
unsetEnv "http_proxy"
unsetEnv "https_proxy"
describe "withApplication" $ do
it "runs a wai Application while executing the given action" $ do
let mkApp = return $ \ _request respond -> respond $ responseLBS ok200 [] "foo"
withApplication mkApp $ \ port ... | 1,452 | spec = do
runIO $ do
unsetEnv "http_proxy"
unsetEnv "https_proxy"
describe "withApplication" $ do
it "runs a wai Application while executing the given action" $ do
let mkApp = return $ \ _request respond -> respond $ responseLBS ok200 [] "foo"
withApplication mkApp $ \ port -> do
... | 1,439 | false | true | 0 | 22 | 380 | 343 | 163 | 180 | null | null |
mydaum/cabal | cabal-install/tests/UnitTests/Distribution/Client/FileMonitor.hs | bsd-3-clause | checkChanged :: (Binary a, Binary b)
=> RootPath -> FileMonitor a b
-> a -> IO (MonitorChanged a b)
checkChanged (RootPath root) monitor key =
checkFileMonitorChanged monitor root key | 211 | checkChanged :: (Binary a, Binary b)
=> RootPath -> FileMonitor a b
-> a -> IO (MonitorChanged a b)
checkChanged (RootPath root) monitor key =
checkFileMonitorChanged monitor root key | 211 | checkChanged (RootPath root) monitor key =
checkFileMonitorChanged monitor root key | 85 | false | true | 0 | 11 | 56 | 74 | 36 | 38 | null | null |
vTurbine/ghc | compiler/main/DynFlags.hs | bsd-3-clause | setPackageTrust :: DynP ()
setPackageTrust = do
setGeneralFlag Opt_PackageTrust
l <- getCurLoc
upd $ \d -> d { pkgTrustOnLoc = l } | 142 | setPackageTrust :: DynP ()
setPackageTrust = do
setGeneralFlag Opt_PackageTrust
l <- getCurLoc
upd $ \d -> d { pkgTrustOnLoc = l } | 142 | setPackageTrust = do
setGeneralFlag Opt_PackageTrust
l <- getCurLoc
upd $ \d -> d { pkgTrustOnLoc = l } | 115 | false | true | 1 | 11 | 33 | 53 | 24 | 29 | null | null |
Saulzar/reflex | test/Reflex/Bench/Focused.hs | bsd-3-clause | dynamics :: Word -> [(String, TestCase)]
dynamics n =
[ testE "mapDynChain" $ fmap updated $ mapDynChain n =<< d
, testE "joinDynChain" $ fmap updated $ joinDynChain n =<< d
, testE "holdDynChain" $ fmap updated $ holdDynChain n =<< d
, testE "buildDynChain" $ fmap updated $ buildDy... | 866 | dynamics :: Word -> [(String, TestCase)]
dynamics n =
[ testE "mapDynChain" $ fmap updated $ mapDynChain n =<< d
, testE "joinDynChain" $ fmap updated $ joinDynChain n =<< d
, testE "holdDynChain" $ fmap updated $ holdDynChain n =<< d
, testE "buildDynChain" $ fmap updated $ buildDy... | 866 | dynamics n =
[ testE "mapDynChain" $ fmap updated $ mapDynChain n =<< d
, testE "joinDynChain" $ fmap updated $ joinDynChain n =<< d
, testE "holdDynChain" $ fmap updated $ holdDynChain n =<< d
, testE "buildDynChain" $ fmap updated $ buildDynChain n =<< d
, testE "combineDynChain... | 825 | false | true | 0 | 11 | 233 | 322 | 156 | 166 | null | null |
jasonbaker/hamt | Data/Hamt.hs | mit | findWithDefault :: Eq a
=> a -- ^ The key to search for
-> b -- ^ The default value
-> HashTrie a b -- ^ The hash trie
-> b -- ^ The found value
findWithDefault key def trie = case find key trie of
... | 392 | findWithDefault :: Eq a
=> a -- ^ The key to search for
-> b -- ^ The default value
-> HashTrie a b -- ^ The hash trie
-> b
findWithDefault key def trie = case find key trie of
Just val -> val
... | 364 | findWithDefault key def trie = case find key trie of
Just val -> val
Nothing -> def | 149 | true | true | 0 | 9 | 216 | 70 | 35 | 35 | null | null |
ian-ross/cabal | cabal-install/Distribution/Client/Init.hs | bsd-3-clause | findNewName :: FilePath -> IO FilePath
findNewName oldName = findNewName' 0
where
findNewName' :: Integer -> IO FilePath
findNewName' n = do
let newName = oldName <.> ("save" ++ show n)
e <- doesFileExist newName
if e then findNewName' (n+1) else return newName
-- | Generate a .cabal file f... | 802 | findNewName :: FilePath -> IO FilePath
findNewName oldName = findNewName' 0
where
findNewName' :: Integer -> IO FilePath
findNewName' n = do
let newName = oldName <.> ("save" ++ show n)
e <- doesFileExist newName
if e then findNewName' (n+1) else return newName
-- | Generate a .cabal file f... | 802 | findNewName oldName = findNewName' 0
where
findNewName' :: Integer -> IO FilePath
findNewName' n = do
let newName = oldName <.> ("save" ++ show n)
e <- doesFileExist newName
if e then findNewName' (n+1) else return newName
-- | Generate a .cabal file from an InitFlags structure. NOTE: this... | 763 | false | true | 0 | 14 | 171 | 121 | 59 | 62 | null | null |
quchen/binary-typed | benchmark/CriterionOverview.hs | bsd-2-clause | bench_decode_typed :: Benchmark
bench_decode_typed = bench d (nf f value_encodedTyped)
where d = "Typed with " ++ show mode
f :: ByteString -> Complicated
f = unsafeDecodeTyped
-- #############################################################################
-- ### Encode+decode ####... | 454 | bench_decode_typed :: Benchmark
bench_decode_typed = bench d (nf f value_encodedTyped)
where d = "Typed with " ++ show mode
f :: ByteString -> Complicated
f = unsafeDecodeTyped
-- #############################################################################
-- ### Encode+decode ####... | 454 | bench_decode_typed = bench d (nf f value_encodedTyped)
where d = "Typed with " ++ show mode
f :: ByteString -> Complicated
f = unsafeDecodeTyped
-- #############################################################################
-- ### Encode+decode ####################################... | 422 | false | true | 2 | 7 | 71 | 58 | 30 | 28 | null | null |
ixmatus/grob | src/Data/Grob/Attoparsec.hs | bsd-3-clause | -- | @doParse@ Run the parser, complete the partial if the end of the stream has
-- a newline with an empty string
doParse :: ByteString -> [RuleSet]
doParse cont =
case parse (many1 parseUABlock) cont of
Done _ set -> set
Partial f -> handlePartial (f B.empty)
Fail {} -> []
-- | @handlePar... | 403 | doParse :: ByteString -> [RuleSet]
doParse cont =
case parse (many1 parseUABlock) cont of
Done _ set -> set
Partial f -> handlePartial (f B.empty)
Fail {} -> []
-- | @handlePartial@ Handle a partial with empty string by simply
-- returning the last completion | 288 | doParse cont =
case parse (many1 parseUABlock) cont of
Done _ set -> set
Partial f -> handlePartial (f B.empty)
Fail {} -> []
-- | @handlePartial@ Handle a partial with empty string by simply
-- returning the last completion | 253 | true | true | 0 | 11 | 96 | 83 | 42 | 41 | null | null |
alexandersjosten/AI-shrdlite | haskell/Interpreter.hs | gpl-3.0 | createTriples' :: [Id] -> Relation -> [(Id, Object)] -> Id -> [[(Id, Relation, Id)]]
createTriples' [] _ _ _ = [] | 119 | createTriples' :: [Id] -> Relation -> [(Id, Object)] -> Id -> [[(Id, Relation, Id)]]
createTriples' [] _ _ _ = [] | 119 | createTriples' [] _ _ _ = [] | 34 | false | true | 0 | 11 | 26 | 67 | 38 | 29 | null | null |
urbanslug/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | genericWordQuotRem2Op :: DynFlags -> GenericOp
genericWordQuotRem2Op dflags [res_q, res_r] [arg_x_high, arg_x_low, arg_y]
= emit =<< f (widthInBits (wordWidth dflags)) zero arg_x_high arg_x_low
where ty = cmmExprType dflags arg_x_high
shl x i = CmmMachOp (MO_Shl (wordWidth dflags)) [x, i]
... | 2,809 | genericWordQuotRem2Op :: DynFlags -> GenericOp
genericWordQuotRem2Op dflags [res_q, res_r] [arg_x_high, arg_x_low, arg_y]
= emit =<< f (widthInBits (wordWidth dflags)) zero arg_x_high arg_x_low
where ty = cmmExprType dflags arg_x_high
shl x i = CmmMachOp (MO_Shl (wordWidth dflags)) [x, i]
... | 2,809 | genericWordQuotRem2Op dflags [res_q, res_r] [arg_x_high, arg_x_low, arg_y]
= emit =<< f (widthInBits (wordWidth dflags)) zero arg_x_high arg_x_low
where ty = cmmExprType dflags arg_x_high
shl x i = CmmMachOp (MO_Shl (wordWidth dflags)) [x, i]
shr x i = CmmMachOp (MO_U_Shr (wor... | 2,762 | false | true | 2 | 17 | 1,400 | 827 | 414 | 413 | null | null |
HIPERFIT/futhark | src/Futhark/CodeGen/ImpGen.hs | isc | dPrimVE :: String -> Imp.TExp t -> ImpM rep r op (Imp.TExp t)
dPrimVE name e = do
name' <- dPrim name $ primExpType $ untyped e
name' <-- e
return $ tvExp name' | 166 | dPrimVE :: String -> Imp.TExp t -> ImpM rep r op (Imp.TExp t)
dPrimVE name e = do
name' <- dPrim name $ primExpType $ untyped e
name' <-- e
return $ tvExp name' | 166 | dPrimVE name e = do
name' <- dPrim name $ primExpType $ untyped e
name' <-- e
return $ tvExp name' | 104 | false | true | 0 | 11 | 39 | 89 | 39 | 50 | null | null |
imccoy/utopia | web/app/Main.hs | mit | renderVal onEvent (ValList [ Primitive (Text "textInput")
, ValFrame frame
]) = E.input (Ev.change (\e -> onEvent frame . ChangeEvent =<< (fromMaybe "" <$> inputTextFromEvent e)))
([] :: [VNode]) | 289 | renderVal onEvent (ValList [ Primitive (Text "textInput")
, ValFrame frame
]) = E.input (Ev.change (\e -> onEvent frame . ChangeEvent =<< (fromMaybe "" <$> inputTextFromEvent e)))
([] :: [VNode]) | 289 | renderVal onEvent (ValList [ Primitive (Text "textInput")
, ValFrame frame
]) = E.input (Ev.change (\e -> onEvent frame . ChangeEvent =<< (fromMaybe "" <$> inputTextFromEvent e)))
([] :: [VNode]) | 289 | false | false | 0 | 13 | 122 | 95 | 47 | 48 | null | null |
rahulmutt/ghcvm | compiler/Eta/BasicTypes/Unique.hs | bsd-3-clause | pprUniqueAlways :: Unique -> SDoc
-- The "always" means regardless of -dsuppress-uniques
-- It replaces the old pprUnique to remind callers that
-- they should consider whether they want to consult
-- Opt_SuppressUniques
pprUniqueAlways u
= text (showUnique u) | 262 | pprUniqueAlways :: Unique -> SDoc
pprUniqueAlways u
= text (showUnique u) | 75 | pprUniqueAlways u
= text (showUnique u) | 41 | true | true | 0 | 7 | 40 | 31 | 17 | 14 | null | null |
fabianbergmark/ECMA-262 | src/Language/JavaScript/JSON.hs | bsd-2-clause | jsonStringCharacters =
do { c <- jsonStringCharacter; ms <- optionMaybe jsonStringCharacters; return () } | 107 | jsonStringCharacters =
do { c <- jsonStringCharacter; ms <- optionMaybe jsonStringCharacters; return () } | 107 | jsonStringCharacters =
do { c <- jsonStringCharacter; ms <- optionMaybe jsonStringCharacters; return () } | 107 | false | false | 0 | 8 | 15 | 35 | 17 | 18 | null | null |
wayofthepie/vulgr | vulgr-service/src/Main.hs | bsd-3-clause | readerServerT :: ServerT API App
readerServerT = getCve :<|> postCves | 69 | readerServerT :: ServerT API App
readerServerT = getCve :<|> postCves | 69 | readerServerT = getCve :<|> postCves | 36 | false | true | 0 | 5 | 9 | 20 | 10 | 10 | null | null |
DavidAlphaFox/darcs | src/Darcs/UI/RemoteApply.hs | gpl-2.0 | applyViaLocal :: [DarcsFlag] -> String -> Doc -> IO ExitCode
applyViaLocal opts repo bundle =
darcsProgram >>= \darcs ->
pipeDoc Standard darcs ("apply":"--all":"--repodir":repo:applyopts opts) bundle | 208 | applyViaLocal :: [DarcsFlag] -> String -> Doc -> IO ExitCode
applyViaLocal opts repo bundle =
darcsProgram >>= \darcs ->
pipeDoc Standard darcs ("apply":"--all":"--repodir":repo:applyopts opts) bundle | 208 | applyViaLocal opts repo bundle =
darcsProgram >>= \darcs ->
pipeDoc Standard darcs ("apply":"--all":"--repodir":repo:applyopts opts) bundle | 147 | false | true | 0 | 12 | 32 | 76 | 38 | 38 | null | null |
zmoazeni/hackerrank-solutions | haskell/botclean_large/LookAhead.hs | mit | lookAhead :: Reader Env [Path]
lookAhead = do
env@Env {envPath=positions, envAllDirtyEntries=dirtyEntries} <- ask
let
currentPosition = last positions
dirtyEntriesWithoutCurrentPosition = filter (\Entry{getPosition=position} -> position /= currentPosition) dirtyEntries
pathsWithCost ... | 1,216 | lookAhead :: Reader Env [Path]
lookAhead = do
env@Env {envPath=positions, envAllDirtyEntries=dirtyEntries} <- ask
let
currentPosition = last positions
dirtyEntriesWithoutCurrentPosition = filter (\Entry{getPosition=position} -> position /= currentPosition) dirtyEntries
pathsWithCost ... | 1,216 | lookAhead = do
env@Env {envPath=positions, envAllDirtyEntries=dirtyEntries} <- ask
let
currentPosition = last positions
dirtyEntriesWithoutCurrentPosition = filter (\Entry{getPosition=position} -> position /= currentPosition) dirtyEntries
pathsWithCost = sortBy co... | 1,185 | false | true | 0 | 23 | 357 | 294 | 154 | 140 | null | null |
jstolarek/ghc | libraries/base/Data/Traversable.hs | bsd-3-clause | for = flip traverse | 19 | for = flip traverse | 19 | for = flip traverse | 19 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
gspindles/mj-score-eval | src/Game/Mahjong/Static/Melds.hs | mit | characterMelds :: [Meld]
characterMelds = concat [characterSequences, characterTriplets, characterQuartets, characterPairs] | 124 | characterMelds :: [Meld]
characterMelds = concat [characterSequences, characterTriplets, characterQuartets, characterPairs] | 123 | characterMelds = concat [characterSequences, characterTriplets, characterQuartets, characterPairs] | 98 | false | true | 0 | 6 | 10 | 29 | 17 | 12 | null | null |
alfpark/bond | compiler/src/Language/Bond/Codegen/TypeMapping.hs | mit | cppTypeCustomAlloc alloc BT_MetaFullName = cppTypeCustomAlloc alloc BT_String | 77 | cppTypeCustomAlloc alloc BT_MetaFullName = cppTypeCustomAlloc alloc BT_String | 77 | cppTypeCustomAlloc alloc BT_MetaFullName = cppTypeCustomAlloc alloc BT_String | 77 | false | false | 0 | 5 | 6 | 16 | 7 | 9 | null | null |
kmate/HaRe | old/testing/duplication/D2_TokOut.hs | bsd-3-clause | anotherFun [] = 0 | 17 | anotherFun [] = 0 | 17 | anotherFun [] = 0 | 17 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
AlexanderPankiv/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | unpackCStringIdKey = mkPreludeMiscIdUnique 20 | 56 | unpackCStringIdKey = mkPreludeMiscIdUnique 20 | 56 | unpackCStringIdKey = mkPreludeMiscIdUnique 20 | 56 | false | false | 0 | 5 | 14 | 9 | 4 | 5 | null | null |
RAFIRAF/HASKELL | bubbleSort4.hs | mit | bubbleSortIter (x:y:t) = if x <= y then x:bubbleSortIter (y:t) else y:bubbleSortIter (x:t) | 90 | bubbleSortIter (x:y:t) = if x <= y then x:bubbleSortIter (y:t) else y:bubbleSortIter (x:t) | 90 | bubbleSortIter (x:y:t) = if x <= y then x:bubbleSortIter (y:t) else y:bubbleSortIter (x:t) | 90 | false | false | 0 | 9 | 12 | 60 | 31 | 29 | null | null |
vluukkal/aspreify | testaspparse.hs | mit | -- trel4 = TestCase $ assertEqual "rel 4" (Typed [Plain (Const "lc") [Sym (Var "X"),Sym (Var "Y")] True,Weighed (Sym (Var "L")) (Plain (Const "arc") [Sym (Var "X"),Sym (Var "Y"),Sym (Var "L")] True)]) (wrapparser_bl' rel "" "lc(X,Y) : arc(X, Y, L) = L")
trel4 = TestCase $ assertEqual "rel 4" (Typed [Plain (Const "lc") ... | 509 | trel4 = TestCase $ assertEqual "rel 4" (Typed [Plain (Const "lc") [Sym (Var "X"),Sym (Var "Y")] True,Weighed (Sym (Var "L")) (Plain (Const "arc") [Sym (Var "X"),Sym (Var "Y"),Sym (Var "L")] True) True]) (wrapparser_bl' rel "" "lc(X,Y) : arc(X, Y, L) = L") | 255 | trel4 = TestCase $ assertEqual "rel 4" (Typed [Plain (Const "lc") [Sym (Var "X"),Sym (Var "Y")] True,Weighed (Sym (Var "L")) (Plain (Const "arc") [Sym (Var "X"),Sym (Var "Y"),Sym (Var "L")] True) True]) (wrapparser_bl' rel "" "lc(X,Y) : arc(X, Y, L) = L") | 255 | true | false | 1 | 16 | 83 | 151 | 74 | 77 | null | null |
vincenthz/cryptonite | Crypto/PubKey/ECC/Types.hs | bsd-3-clause | getCurveByName SEC_t571r1 = CurveF2m $ CurveBinary
0x080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425
(CurveCommon
{ ecc_a = 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000... | 1,086 | getCurveByName SEC_t571r1 = CurveF2m $ CurveBinary
0x080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425
(CurveCommon
{ ecc_a = 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000... | 1,086 | getCurveByName SEC_t571r1 = CurveF2m $ CurveBinary
0x080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425
(CurveCommon
{ ecc_a = 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000... | 1,086 | false | false | 0 | 8 | 110 | 60 | 33 | 27 | null | null |
AlexanderPankiv/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | showList___RDR = varQual_RDR gHC_SHOW (fsLit "showList__") | 67 | showList___RDR = varQual_RDR gHC_SHOW (fsLit "showList__") | 67 | showList___RDR = varQual_RDR gHC_SHOW (fsLit "showList__") | 67 | false | false | 0 | 7 | 14 | 17 | 8 | 9 | null | null |
olorin/amazonka | amazonka-redshift/gen/Network/AWS/Redshift/DeleteClusterSecurityGroup.hs | mpl-2.0 | -- | The name of the cluster security group to be deleted.
dClusterSecurityGroupName :: Lens' DeleteClusterSecurityGroup Text
dClusterSecurityGroupName = lens _dClusterSecurityGroupName (\ s a -> s{_dClusterSecurityGroupName = a}) | 230 | dClusterSecurityGroupName :: Lens' DeleteClusterSecurityGroup Text
dClusterSecurityGroupName = lens _dClusterSecurityGroupName (\ s a -> s{_dClusterSecurityGroupName = a}) | 171 | dClusterSecurityGroupName = lens _dClusterSecurityGroupName (\ s a -> s{_dClusterSecurityGroupName = a}) | 104 | true | true | 0 | 9 | 27 | 40 | 22 | 18 | null | null |
mimi1vx/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkAliasesUsesArgs1 = verify checkAliasesUsesArgs "alias a='cp $1 /a'" | 77 | prop_checkAliasesUsesArgs1 = verify checkAliasesUsesArgs "alias a='cp $1 /a'" | 77 | prop_checkAliasesUsesArgs1 = verify checkAliasesUsesArgs "alias a='cp $1 /a'" | 77 | false | false | 0 | 5 | 7 | 11 | 5 | 6 | null | null |
chreekat/snowdrift | Model/User/Internal.hs | agpl-3.0 | fetchUserEmail :: UserId -> DB (Maybe Text)
fetchUserEmail user_id
= (\case [] -> Nothing
(x:_) -> unValue x)
<$> (select $ from $ \user -> do
where_ $ user ^. UserId ==. val user_id
return $ user ^. UserEmail) | 254 | fetchUserEmail :: UserId -> DB (Maybe Text)
fetchUserEmail user_id
= (\case [] -> Nothing
(x:_) -> unValue x)
<$> (select $ from $ \user -> do
where_ $ user ^. UserId ==. val user_id
return $ user ^. UserEmail) | 254 | fetchUserEmail user_id
= (\case [] -> Nothing
(x:_) -> unValue x)
<$> (select $ from $ \user -> do
where_ $ user ^. UserId ==. val user_id
return $ user ^. UserEmail) | 210 | false | true | 2 | 13 | 82 | 107 | 52 | 55 | null | null |
antalsz/hs-to-coq | examples/containers/extraction/SetProperties.hs | mit | prop_sameNull :: Set Int -> Bool
prop_sameNull xs = DS.null (toDataSet xs) == null xs | 85 | prop_sameNull :: Set Int -> Bool
prop_sameNull xs = DS.null (toDataSet xs) == null xs | 85 | prop_sameNull xs = DS.null (toDataSet xs) == null xs | 52 | false | true | 0 | 8 | 14 | 39 | 18 | 21 | null | null |
ksaveljev/hake-2 | src/Game/Monsters/MBoss32.hs | bsd-3-clause | makronTorsoThink :: EntThink
makronTorsoThink =
GenericEntThink "makron_torso_think" $ \selfRef -> do
self <- readRef selfRef
if (self^.eEntityState.esFrame) < 365
then modifyRef selfRef (\v -> v & eEntityState.esFrame +~ 1)
else modifyRef selfRef (\v -> v & eEntityState.esFrame .~ 346)
leve... | 462 | makronTorsoThink :: EntThink
makronTorsoThink =
GenericEntThink "makron_torso_think" $ \selfRef -> do
self <- readRef selfRef
if (self^.eEntityState.esFrame) < 365
then modifyRef selfRef (\v -> v & eEntityState.esFrame +~ 1)
else modifyRef selfRef (\v -> v & eEntityState.esFrame .~ 346)
leve... | 462 | makronTorsoThink =
GenericEntThink "makron_torso_think" $ \selfRef -> do
self <- readRef selfRef
if (self^.eEntityState.esFrame) < 365
then modifyRef selfRef (\v -> v & eEntityState.esFrame +~ 1)
else modifyRef selfRef (\v -> v & eEntityState.esFrame .~ 346)
levelTime <- use $ gameBaseGlobal... | 433 | false | true | 0 | 15 | 93 | 154 | 77 | 77 | null | null |
michaelt/streaming-utils | Streaming/Zip.hs | bsd-3-clause | decompress
:: MonadIO m
=> Z.WindowBits
-> ByteString m r -- ^ Compressed stream
-> ByteString m r -- ^ Decompressed stream
decompress wbits p0 = do
inf <- liftIO $ Z.initInflate wbits
r <- for p0 $ \bs -> do
popper <- liftIO (Z.feedInflate inf bs)
fromPopper popper
bs <- liftIO $ Z.fi... | 383 | decompress
:: MonadIO m
=> Z.WindowBits
-> ByteString m r -- ^ Compressed stream
-> ByteString m r
decompress wbits p0 = do
inf <- liftIO $ Z.initInflate wbits
r <- for p0 $ \bs -> do
popper <- liftIO (Z.feedInflate inf bs)
fromPopper popper
bs <- liftIO $ Z.finishInflate inf
unles... | 358 | decompress wbits p0 = do
inf <- liftIO $ Z.initInflate wbits
r <- for p0 $ \bs -> do
popper <- liftIO (Z.feedInflate inf bs)
fromPopper popper
bs <- liftIO $ Z.finishInflate inf
unless (B.null bs) (chunk bs)
return r
| 251 | true | true | 0 | 16 | 104 | 154 | 69 | 85 | null | null |
olsner/m3 | Grammar/Expr.hs | bsd-3-clause | -- TODO bitshifts
pAdditiveExpression = leftAssocBinops pMultiplicativeExpression $
[Minus,Plus] | 99 | pAdditiveExpression = leftAssocBinops pMultiplicativeExpression $
[Minus,Plus] | 80 | pAdditiveExpression = leftAssocBinops pMultiplicativeExpression $
[Minus,Plus] | 80 | true | false | 1 | 7 | 11 | 24 | 11 | 13 | null | null |
ArturB/Multilinear | test/all/MultilinearTests.hs | gpl-3.0 | -- | Order of the tensor must be equal to number of its covariant and contravariant indices
orderIndices ::Multilinear t a => t a -> Bool
orderIndices t =
let (conv, cov) = order t
iConv = Set.fromList $ Index.isContravariant `Prelude.filter` indices t
iCov = Set.fromList $ Index.isCovariant `Pre... | 397 | orderIndices ::Multilinear t a => t a -> Bool
orderIndices t =
let (conv, cov) = order t
iConv = Set.fromList $ Index.isContravariant `Prelude.filter` indices t
iCov = Set.fromList $ Index.isCovariant `Prelude.filter` indices t
in conv == Set.size iConv && cov == Set.size iCov | 305 | orderIndices t =
let (conv, cov) = order t
iConv = Set.fromList $ Index.isContravariant `Prelude.filter` indices t
iCov = Set.fromList $ Index.isCovariant `Prelude.filter` indices t
in conv == Set.size iConv && cov == Set.size iCov | 259 | true | true | 0 | 11 | 88 | 122 | 61 | 61 | null | null |
Teino1978-Corp/Teino1978-Corp-alex | src/Main.hs | bsd-3-clause | alexReadFile file = do
h <- alexOpenFile file ReadMode
hGetContents h
#else
alexReadFile = readFile
#endif
-- We need to force every file we write to be written
-- to as UTF8 | 179 | alexReadFile file = do
h <- alexOpenFile file ReadMode
hGetContents h
#else
alexReadFile = readFile
#endif
-- We need to force every file we write to be written
-- to as UTF8 | 179 | alexReadFile file = do
h <- alexOpenFile file ReadMode
hGetContents h
#else
alexReadFile = readFile
#endif
-- We need to force every file we write to be written
-- to as UTF8 | 179 | false | false | 0 | 8 | 36 | 31 | 15 | 16 | null | null |
Cordite-Studios/solar-dial | play/Time.hs | mit | doDemo x = do
d <- mkDemo
showDemo d
time <- getCurrentTime
let endtime = addUTCTime (fromInteger x) time
stepUntil d time 1.0 endtime | 154 | doDemo x = do
d <- mkDemo
showDemo d
time <- getCurrentTime
let endtime = addUTCTime (fromInteger x) time
stepUntil d time 1.0 endtime | 154 | doDemo x = do
d <- mkDemo
showDemo d
time <- getCurrentTime
let endtime = addUTCTime (fromInteger x) time
stepUntil d time 1.0 endtime | 154 | false | false | 1 | 13 | 43 | 65 | 26 | 39 | null | null |
yoo-e/weixin-mp-sdk | WeiXin/PublicPlatform/Pay/Function.hs | mit | wxUserPayParseRefundQueryItem :: (MonadLogger m)
=> Int
-> WxPayParams
-> m (Either WxPayDiagError WxUserPayRefundQueryItem)
-- {{{1
wxUserPayParseRefundQueryItem n resp_params = runExceptT $ do
out_refund_no <- fmap WxUserPayOu... | 2,263 | wxUserPayParseRefundQueryItem :: (MonadLogger m)
=> Int
-> WxPayParams
-> m (Either WxPayDiagError WxUserPayRefundQueryItem)
wxUserPayParseRefundQueryItem n resp_params = runExceptT $ do
out_refund_no <- fmap WxUserPayOutRefundN... | 2,255 | wxUserPayParseRefundQueryItem n resp_params = runExceptT $ do
out_refund_no <- fmap WxUserPayOutRefundNo $ req_param $ "out_refund_no" <> suffix
refund_id <- fmap WxUserPayRefundId $ req_param $ "refund_id" <> suffix
status <- case join $ fmap nullToNothing $ lookup ("refund_status" <> suffix) resp_params of
... | 2,040 | true | true | 1 | 17 | 675 | 531 | 251 | 280 | null | null |
phischu/fragnix | tests/packages/scotty/Data.ByteString.Builder.hs | bsd-3-clause | doubleLE :: Double -> Builder
doubleLE = P.primFixed P.doubleLE | 63 | doubleLE :: Double -> Builder
doubleLE = P.primFixed P.doubleLE | 63 | doubleLE = P.primFixed P.doubleLE | 33 | false | true | 0 | 6 | 8 | 22 | 11 | 11 | null | null |
mwotton/dictparser | src/NLP/DictParser/Internal.hs | bsd-3-clause | headerP = do
string "00-database-"
header <- choice $ map string acceptedHeaders
newline
descriptions <- many dashLine
newline
return (header, unlines descriptions) | 176 | headerP = do
string "00-database-"
header <- choice $ map string acceptedHeaders
newline
descriptions <- many dashLine
newline
return (header, unlines descriptions) | 176 | headerP = do
string "00-database-"
header <- choice $ map string acceptedHeaders
newline
descriptions <- many dashLine
newline
return (header, unlines descriptions) | 176 | false | false | 0 | 9 | 33 | 59 | 25 | 34 | null | null |
brendanhay/gogol | gogol-resourcemanager/gen/Network/Google/ResourceManager/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'MoveProjectMetadata' with the minimum fields required to make a request.
--
moveProjectMetadata
:: MoveProjectMetadata
moveProjectMetadata = MoveProjectMetadata' | 190 | moveProjectMetadata
:: MoveProjectMetadata
moveProjectMetadata = MoveProjectMetadata' | 89 | moveProjectMetadata = MoveProjectMetadata' | 42 | true | true | 1 | 5 | 26 | 17 | 8 | 9 | null | null |
johnellis1392/Haskell-Scheme | Scheme/Eval/Comp.hs | mit | -- Dynamic equality comparison
eqv :: [LispVal] -> ThrowsError LispVal
eqv [(Bool x), (Bool y)] = return $ Bool $ x == y | 121 | eqv :: [LispVal] -> ThrowsError LispVal
eqv [(Bool x), (Bool y)] = return $ Bool $ x == y | 89 | eqv [(Bool x), (Bool y)] = return $ Bool $ x == y | 49 | true | true | 0 | 10 | 23 | 60 | 30 | 30 | null | null |
markhibberd/fp-syd-free | src/Talks/Free/Ugly.hs | bsd-3-clause | setPasswords :: Map Text Text -> IO ()
setPasswords ps =
(\x -> x { passwords = ps }) <$> getStore >>= setStore | 113 | setPasswords :: Map Text Text -> IO ()
setPasswords ps =
(\x -> x { passwords = ps }) <$> getStore >>= setStore | 113 | setPasswords ps =
(\x -> x { passwords = ps }) <$> getStore >>= setStore | 74 | false | true | 0 | 10 | 24 | 57 | 28 | 29 | null | null |
ihc/futhark | src/Language/Futhark/TypeChecker/Terms.hs | isc | runTermTypeM :: TermTypeM a -> TypeM (a, Occurences)
runTermTypeM (TermTypeM m) = do
initial_scope <- (initialTermScope<>) <$> (envToTermScope <$> askEnv)
runWriterT (runReaderT m initial_scope) | 198 | runTermTypeM :: TermTypeM a -> TypeM (a, Occurences)
runTermTypeM (TermTypeM m) = do
initial_scope <- (initialTermScope<>) <$> (envToTermScope <$> askEnv)
runWriterT (runReaderT m initial_scope) | 198 | runTermTypeM (TermTypeM m) = do
initial_scope <- (initialTermScope<>) <$> (envToTermScope <$> askEnv)
runWriterT (runReaderT m initial_scope) | 145 | false | true | 0 | 11 | 27 | 77 | 37 | 40 | null | null |
AndrewRademacher/hasql-postgres | library/Hasql/Postgres/ErrorCode.hs | mit | -- * Class 0A — Feature Not Supported
-------------------------
-- | Code \"0A000\".
feature_not_supported :: ErrorCode = "0A000" | 161 | feature_not_supported :: ErrorCode = "0A000" | 75 | feature_not_supported :: ErrorCode = "0A000" | 75 | true | false | 0 | 5 | 49 | 14 | 8 | 6 | null | null |
mikeizbicki/dominion | src/Dominion/Cards.hs | bsd-3-clause | -- |
--
-- TODO:
-- Interestingly, the cardAttack makes this card worse against a big money deck.
-- I'm not sure if that's because it improves the opponents' decks cycling or if there's a bug somewhere.
--
-- FIXME:
-- The player should be able to choose which card to delete.
bandit :: Card
bandit = defCard
{ ca... | 1,037 | bandit :: Card
bandit = defCard
{ cardAction = \cs gs -> do
gs <- MaybeT $ return $ drawCardFromSupply gold gs
return $ updatePlayerState CurrentPlayer (\ps -> ps { discard = gold:discard ps }) gs
, cardAttack = \i gs -> updatePlayerStateM (OnlyPlayer i) trashGoodMoney gs
, cardCost = 5
... | 757 | bandit = defCard
{ cardAction = \cs gs -> do
gs <- MaybeT $ return $ drawCardFromSupply gold gs
return $ updatePlayerState CurrentPlayer (\ps -> ps { discard = gold:discard ps }) gs
, cardAttack = \i gs -> updatePlayerStateM (OnlyPlayer i) trashGoodMoney gs
, cardCost = 5
, cardName = "b... | 742 | true | true | 3 | 17 | 313 | 259 | 138 | 121 | null | null |
AshyIsMe/lambdatwit | Main.hs | mit | statusToText :: Status -> T.Text
statusToText status = T.concat [ T.pack . show $ status ^. statusId
, ": "
, status ^. statusUser . userScreenName
, ": "
, status ... | 374 | statusToText :: Status -> T.Text
statusToText status = T.concat [ T.pack . show $ status ^. statusId
, ": "
, status ^. statusUser . userScreenName
, ": "
, status ... | 374 | statusToText status = T.concat [ T.pack . show $ status ^. statusId
, ": "
, status ^. statusUser . userScreenName
, ": "
, status ^. statusText
... | 341 | false | true | 0 | 10 | 228 | 66 | 35 | 31 | null | null |
sjindel/lotus | JPP.hs | bsd-2-clause | initialize (Cost c) =
do s <- SR.newSTRef H.empty
return (CCost s c) | 75 | initialize (Cost c) =
do s <- SR.newSTRef H.empty
return (CCost s c) | 75 | initialize (Cost c) =
do s <- SR.newSTRef H.empty
return (CCost s c) | 75 | false | false | 0 | 9 | 19 | 43 | 19 | 24 | null | null |
brendanhay/gogol | gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer/Types.hs | mpl-2.0 | -- | Default request referring to version 'v1.4' of the Ad Exchange Buyer API. This contains the host and root path used as a starting point for constructing service requests.
adExchangeBuyerService :: ServiceConfig
adExchangeBuyerService
= defaultService (ServiceId "adexchangebuyer:v1.4")
"www.googleapis.com" | 319 | adExchangeBuyerService :: ServiceConfig
adExchangeBuyerService
= defaultService (ServiceId "adexchangebuyer:v1.4")
"www.googleapis.com" | 143 | adExchangeBuyerService
= defaultService (ServiceId "adexchangebuyer:v1.4")
"www.googleapis.com" | 103 | true | true | 0 | 6 | 46 | 31 | 13 | 18 | null | null |
li-zhirui/EoplLangs | src/MutablePairs/Parser.hs | bsd-3-clause | manyExprs :: Parser [Expression]
manyExprs = sepBy expression comma | 67 | manyExprs :: Parser [Expression]
manyExprs = sepBy expression comma | 67 | manyExprs = sepBy expression comma | 34 | false | true | 0 | 7 | 8 | 28 | 12 | 16 | null | null |
continuouspi/cpiwb | CPi/Plot.hs | gpl-3.0 | plotphase pts
= toPlot
$ plot_lines_values .~ [pts]
$ plot_lines_style .~ solidLine 1 (opaque blue)
$ def | 127 | plotphase pts
= toPlot
$ plot_lines_values .~ [pts]
$ plot_lines_style .~ solidLine 1 (opaque blue)
$ def | 127 | plotphase pts
= toPlot
$ plot_lines_values .~ [pts]
$ plot_lines_style .~ solidLine 1 (opaque blue)
$ def | 127 | false | false | 0 | 9 | 38 | 43 | 21 | 22 | null | null |
sdiehl/ghc | compiler/coreSyn/CoreStats.hs | bsd-3-clause | exprStats :: CoreExpr -> CoreStats
exprStats (Var {}) = oneTM | 68 | exprStats :: CoreExpr -> CoreStats
exprStats (Var {}) = oneTM | 68 | exprStats (Var {}) = oneTM | 33 | false | true | 0 | 7 | 16 | 25 | 13 | 12 | null | null |
k0001/tisch | src/lib/Tisch/Internal/Aggregation.hs | apache-2.0 | -- | Sample variance of the input values (square of the sample standard
-- deviation 'stdevgg').
variancegg :: AggStdDev a b => O.Aggregator (Kol a) (Kol b)
variancegg = unsafeMakeAggr HDB.AggrVar | 196 | variancegg :: AggStdDev a b => O.Aggregator (Kol a) (Kol b)
variancegg = unsafeMakeAggr HDB.AggrVar | 99 | variancegg = unsafeMakeAggr HDB.AggrVar | 39 | true | true | 0 | 9 | 30 | 51 | 24 | 27 | null | null |
markuspf/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | -- | Get the docstring for a Const
constDocs :: Const -> String
constDocs c@(AType (ATInt ITBig)) = "Arbitrary-precision integers" | 139 | constDocs :: Const -> String
constDocs c@(AType (ATInt ITBig)) = "Arbitrary-precision integers" | 104 | constDocs c@(AType (ATInt ITBig)) = "Arbitrary-precision integers" | 75 | true | true | 2 | 9 | 28 | 40 | 19 | 21 | null | null |
purcell/adventofcodeteam | app/Twenty.hs | bsd-3-clause | presentsForHouse :: Int -> Int
presentsForHouse num = sum $ map (* 10) elves
where
elves = factors num | 108 | presentsForHouse :: Int -> Int
presentsForHouse num = sum $ map (* 10) elves
where
elves = factors num | 108 | presentsForHouse num = sum $ map (* 10) elves
where
elves = factors num | 77 | false | true | 0 | 7 | 24 | 42 | 21 | 21 | null | null |
fmapfmapfmap/amazonka | amazonka-ecs/test/Test/AWS/Gen/ECS.hs | mpl-2.0 | testStartTaskResponse :: StartTaskResponse -> TestTree
testStartTaskResponse = res
"StartTaskResponse"
"fixture/StartTaskResponse.proto"
eCS
(Proxy :: Proxy StartTask) | 183 | testStartTaskResponse :: StartTaskResponse -> TestTree
testStartTaskResponse = res
"StartTaskResponse"
"fixture/StartTaskResponse.proto"
eCS
(Proxy :: Proxy StartTask) | 183 | testStartTaskResponse = res
"StartTaskResponse"
"fixture/StartTaskResponse.proto"
eCS
(Proxy :: Proxy StartTask) | 128 | false | true | 0 | 7 | 30 | 42 | 18 | 24 | null | null |
gsdlab/claferIG | src/Language/Clafer/IG/CommandLineParser.hs | mit | commandLine :: Parser Command
commandLine =
do
name <- command
case lookup name commandMap of
Just x -> x
Nothing ->
fail $ "Unknown command \"" ++ name ++ "\"" ++ hint didYouMean
where
quote x = '"' : x ++ "\""
... | 499 | commandLine :: Parser Command
commandLine =
do
name <- command
case lookup name commandMap of
Just x -> x
Nothing ->
fail $ "Unknown command \"" ++ name ++ "\"" ++ hint didYouMean
where
quote x = '"' : x ++ "\""
... | 499 | commandLine =
do
name <- command
case lookup name commandMap of
Just x -> x
Nothing ->
fail $ "Unknown command \"" ++ name ++ "\"" ++ hint didYouMean
where
quote x = '"' : x ++ "\""
didYouMean = filter (name `is... | 469 | false | true | 0 | 17 | 210 | 147 | 70 | 77 | null | null |
hansbugge/cubicaltt | Eval.hs | mit | -------------------------------------------------------------------------------
-- Composition and filling
comp :: Name -> Val -> Val -> System Val -> Val
comp i a u ts | eps `member` ts = (ts ! eps) `face` (i ~> 1) | 216 | comp :: Name -> Val -> Val -> System Val -> Val
comp i a u ts | eps `member` ts = (ts ! eps) `face` (i ~> 1) | 108 | comp i a u ts | eps `member` ts = (ts ! eps) `face` (i ~> 1) | 60 | true | true | 0 | 10 | 34 | 79 | 40 | 39 | null | null |
diku-dk/futhark | src/Futhark/CodeGen/Backends/SimpleRep.hs | isc | cproduct (e : es) = foldl mult e es
where
mult x y = [C.cexp|$exp:x * $exp:y|]
-- | Return an expression summing the given expressions.
-- If an empty list is given, the expression @0@ is returned. | 204 | cproduct (e : es) = foldl mult e es
where
mult x y = [C.cexp|$exp:x * $exp:y|]
-- | Return an expression summing the given expressions.
-- If an empty list is given, the expression @0@ is returned. | 204 | cproduct (e : es) = foldl mult e es
where
mult x y = [C.cexp|$exp:x * $exp:y|]
-- | Return an expression summing the given expressions.
-- If an empty list is given, the expression @0@ is returned. | 204 | false | false | 0 | 7 | 44 | 44 | 24 | 20 | null | null |
shayan-najd/HsParser | U/Outputable.hs | gpl-3.0 | speakN n = int n | 16 | speakN n = int n | 16 | speakN n = int n | 16 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
rumblesan/improviz | src/Gfx/Commands.hs | bsd-3-clause | setUniform ("Vmatrix", _, UniformLocation uniformLoc) = do
viewMat <- use viewMatrix
liftIO
$ with viewMat
$ GLRaw.glUniformMatrix4fv uniformLoc 1 (fromBool True)
. castPtr | 188 | setUniform ("Vmatrix", _, UniformLocation uniformLoc) = do
viewMat <- use viewMatrix
liftIO
$ with viewMat
$ GLRaw.glUniformMatrix4fv uniformLoc 1 (fromBool True)
. castPtr | 188 | setUniform ("Vmatrix", _, UniformLocation uniformLoc) = do
viewMat <- use viewMatrix
liftIO
$ with viewMat
$ GLRaw.glUniformMatrix4fv uniformLoc 1 (fromBool True)
. castPtr | 188 | false | false | 0 | 11 | 38 | 64 | 30 | 34 | null | null |
mettekou/ghc | compiler/nativeGen/SPARC/Ppr.hs | bsd-3-clause | pprData :: CmmStatic -> SDoc
pprData (CmmString str) = pprASCII str | 76 | pprData :: CmmStatic -> SDoc
pprData (CmmString str) = pprASCII str | 76 | pprData (CmmString str) = pprASCII str | 47 | false | true | 0 | 9 | 19 | 32 | 14 | 18 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Prompt/Window.hs | bsd-2-clause | -- | Pops open a prompt with window titles. Choose one, and you will be
-- taken to the corresponding workspace.
doPrompt :: WindowPrompt -> XPConfig -> X ()
doPrompt t c = do
a <- case t of
Goto -> fmap gotoAction windowMap
Bring -> fmap bringAction windowMap
BringCopy -> fmap bringCopyA... | 772 | doPrompt :: WindowPrompt -> XPConfig -> X ()
doPrompt t c = do
a <- case t of
Goto -> fmap gotoAction windowMap
Bring -> fmap bringAction windowMap
BringCopy -> fmap bringCopyAction windowMap
wm <- windowMap
mkXPrompt t c (compList wm) a
where
winAction a m = flip whenJu... | 659 | doPrompt t c = do
a <- case t of
Goto -> fmap gotoAction windowMap
Bring -> fmap bringAction windowMap
BringCopy -> fmap bringCopyAction windowMap
wm <- windowMap
mkXPrompt t c (compList wm) a
where
winAction a m = flip whenJust (windows . a) . flip M.lookup m
goto... | 614 | true | true | 6 | 11 | 206 | 229 | 99 | 130 | null | null |
eneas193933/regex-derivatives | test/RegexSpec.hs | bsd-2-clause | exhaustiveMatches Dot = ["."] | 37 | exhaustiveMatches Dot = ["."] | 37 | exhaustiveMatches Dot = ["."] | 37 | false | false | 0 | 5 | 11 | 13 | 6 | 7 | null | null |
fmthoma/ghc | compiler/main/DynFlags.hs | bsd-3-clause | setDynHiSuf f d = d{ dynHiSuf = f} | 42 | setDynHiSuf f d = d{ dynHiSuf = f} | 42 | setDynHiSuf f d = d{ dynHiSuf = f} | 42 | false | false | 0 | 6 | 15 | 19 | 10 | 9 | null | null |
rosenbergdm/language-r | src/Language/R/SrcLocation.hs | bsd-3-clause | -- | Get the column of the start of a span.
startCol :: SrcSpan -> Int
startCol (SpanCoLinear { span_start_column = col }) = col | 128 | startCol :: SrcSpan -> Int
startCol (SpanCoLinear { span_start_column = col }) = col | 84 | startCol (SpanCoLinear { span_start_column = col }) = col | 57 | true | true | 0 | 9 | 24 | 31 | 17 | 14 | null | null |
tangboyun/miranda | src/MiRanda/Util.hs | gpl-3.0 | extractSeq :: UTR -> ByteString
extractSeq = unGS . alignment | 61 | extractSeq :: UTR -> ByteString
extractSeq = unGS . alignment | 61 | extractSeq = unGS . alignment | 29 | false | true | 1 | 7 | 9 | 27 | 11 | 16 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.