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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MateVM/harpy | examples/evaluator/Evaluator.hs | gpl-2.0 | compileAndRun :: Stmt -> CodeGen (Ptr Int32) s (Int32, [Instruction])
compileAndRun (Assign c exp) =
do entryCode
compileExp exp
env <- getEnv
mov (variableAddress env c) eax
exitCode
d <- disassemble
callAsVoid
return (0, d) | 279 | compileAndRun :: Stmt -> CodeGen (Ptr Int32) s (Int32, [Instruction])
compileAndRun (Assign c exp) =
do entryCode
compileExp exp
env <- getEnv
mov (variableAddress env c) eax
exitCode
d <- disassemble
callAsVoid
return (0, d) | 279 | compileAndRun (Assign c exp) =
do entryCode
compileExp exp
env <- getEnv
mov (variableAddress env c) eax
exitCode
d <- disassemble
callAsVoid
return (0, d) | 209 | false | true | 0 | 10 | 88 | 110 | 50 | 60 | null | null |
cirquit/genetic-tic-tac-toe | src/Board/Utils.hs | mit | toMoveRot 8 rot = applyRot C3 rot | 33 | toMoveRot 8 rot = applyRot C3 rot | 33 | toMoveRot 8 rot = applyRot C3 rot | 33 | false | false | 0 | 5 | 6 | 16 | 7 | 9 | null | null |
aaronc/Idris-dev | src/IRTS/Compiler.hs | bsd-3-clause | irTerm vs env Erased = return $ LNothing | 46 | irTerm vs env Erased = return $ LNothing | 46 | irTerm vs env Erased = return $ LNothing | 46 | false | false | 0 | 5 | 13 | 20 | 8 | 12 | null | null |
denisenkom/hspkcs11 | src/System/Crypto/Pkcs11/Attribs.hs | mit | getPrime (Object funcListPtr sessHandle objHandle) = do
(Prime p) <- getObjectAttr' funcListPtr sessHandle objHandle PrimeType
return p | 139 | getPrime (Object funcListPtr sessHandle objHandle) = do
(Prime p) <- getObjectAttr' funcListPtr sessHandle objHandle PrimeType
return p | 139 | getPrime (Object funcListPtr sessHandle objHandle) = do
(Prime p) <- getObjectAttr' funcListPtr sessHandle objHandle PrimeType
return p | 139 | false | false | 0 | 9 | 20 | 47 | 21 | 26 | null | null |
nikivazou/verified_string_matching | src/Proofs/mergeIndices.hs | bsd-3-clause | {-@ makeNewIndicesBadLast
:: input:RString -> target:RString -> lo:INat -> hi:{Integer | lo <= hi && (not (isGoodIndex input target hi))}
-> {makeIndices input target lo hi == makeIndices input target lo (hi-1)}
/ [hi - lo + 1]
@-}
-- NV sweet proof
makeNewIndicesBadLast input target lo hi
| lo == hi, not (isGoodIndex input target lo)
= makeIndices input target lo (hi-1)
==. N
==. makeIndices input target (lo+1) hi
==. makeIndices input target lo hi
*** QED
| not (isGoodIndex input target lo), not (isGoodIndex input target hi)
= makeIndices input target lo hi
==. makeIndices input target (lo+1) hi
==. makeIndices input target (lo+1) (hi-1)
? makeNewIndicesBadLast input target (lo+1) hi
==. makeIndices input target lo (hi-1)
*** QED
| isGoodIndex input target lo , not (isGoodIndex input target hi)
= makeIndices input target lo hi
==. lo `C` makeIndices input target (lo+1) hi
==. lo `C` makeIndices input target (lo+1) (hi-1)
? makeNewIndicesBadLast input target (lo+1) hi
==. makeIndices input target lo (hi-1)
*** QED | 1,109 | makeNewIndicesBadLast input target lo hi
| lo == hi, not (isGoodIndex input target lo)
= makeIndices input target lo (hi-1)
==. N
==. makeIndices input target (lo+1) hi
==. makeIndices input target lo hi
*** QED
| not (isGoodIndex input target lo), not (isGoodIndex input target hi)
= makeIndices input target lo hi
==. makeIndices input target (lo+1) hi
==. makeIndices input target (lo+1) (hi-1)
? makeNewIndicesBadLast input target (lo+1) hi
==. makeIndices input target lo (hi-1)
*** QED
| isGoodIndex input target lo , not (isGoodIndex input target hi)
= makeIndices input target lo hi
==. lo `C` makeIndices input target (lo+1) hi
==. lo `C` makeIndices input target (lo+1) (hi-1)
? makeNewIndicesBadLast input target (lo+1) hi
==. makeIndices input target lo (hi-1)
*** QED | 851 | makeNewIndicesBadLast input target lo hi
| lo == hi, not (isGoodIndex input target lo)
= makeIndices input target lo (hi-1)
==. N
==. makeIndices input target (lo+1) hi
==. makeIndices input target lo hi
*** QED
| not (isGoodIndex input target lo), not (isGoodIndex input target hi)
= makeIndices input target lo hi
==. makeIndices input target (lo+1) hi
==. makeIndices input target (lo+1) (hi-1)
? makeNewIndicesBadLast input target (lo+1) hi
==. makeIndices input target lo (hi-1)
*** QED
| isGoodIndex input target lo , not (isGoodIndex input target hi)
= makeIndices input target lo hi
==. lo `C` makeIndices input target (lo+1) hi
==. lo `C` makeIndices input target (lo+1) (hi-1)
? makeNewIndicesBadLast input target (lo+1) hi
==. makeIndices input target lo (hi-1)
*** QED | 851 | true | false | 9 | 17 | 247 | 390 | 190 | 200 | null | null |
RobinKrom/fasths | examples/parseFile.hs | bsd-3-clause | tid2temp i = error ("Template id unknown." ++ " " ++ show i) | 60 | tid2temp i = error ("Template id unknown." ++ " " ++ show i) | 60 | tid2temp i = error ("Template id unknown." ++ " " ++ show i) | 60 | false | false | 0 | 8 | 12 | 26 | 12 | 14 | null | null |
nikita-volkov/graph-db | library/GraphDB/Util/FileSystem.hs | mit | getStatus :: FilePath -> IO Status
getStatus path = do
z <- isFile path
if z
then return File
else do
z <- isDirectory path
if z
then return Directory
else return NotExists | 212 | getStatus :: FilePath -> IO Status
getStatus path = do
z <- isFile path
if z
then return File
else do
z <- isDirectory path
if z
then return Directory
else return NotExists | 212 | getStatus path = do
z <- isFile path
if z
then return File
else do
z <- isDirectory path
if z
then return Directory
else return NotExists | 177 | false | true | 0 | 11 | 72 | 72 | 33 | 39 | null | null |
nomeata/nofib-analyse | CmdLine.hs | bsd-3-clause | devs, nodevs :: Bool
devs = OptDeviations `elem` flags | 58 | devs, nodevs :: Bool
devs = OptDeviations `elem` flags | 58 | devs = OptDeviations `elem` flags | 37 | false | true | 2 | 6 | 12 | 30 | 13 | 17 | null | null |
da-x/lamdu | Lamdu/Sugar/Convert/Apply.hs | gpl-3.0 | convert ::
(Monad m, Monoid a) => V.Apply (Val (Input.Payload m a)) ->
Input.Payload m a -> ConvertM m (ExpressionU m a)
convert app@(V.Apply funcI argI) exprPl =
runMatcherT $
do
(funcS, argS) <-
do
argS <- lift $ ConvertM.convertSubexpression argI
justToLeft $ convertAppliedHole app argS exprPl
funcS <- ConvertM.convertSubexpression funcI & lift
protectedSetToVal <- lift ConvertM.typeProtectedSetToVal
let setToFuncAction =
funcI ^. Val.payload . Input.stored
& Property.value
& protectedSetToVal (exprPl ^. Input.stored)
<&> EntityId.ofValI
& SetToInnerExpr
if Lens.has (rBody . _BodyHole) argS
then
return
( funcS & rPayload . plActions . setToHole .~ AlreadyAppliedToHole
, argS & rPayload . plActions . setToInnerExpr .~ setToFuncAction
)
else return (funcS, argS)
justToLeft $ convertAppliedCase funcS (funcI ^. Val.payload) argS exprPl
justToLeft $ convertLabeled funcS argS argI exprPl
lift $ convertPrefix funcS argS exprPl | 1,332 | convert ::
(Monad m, Monoid a) => V.Apply (Val (Input.Payload m a)) ->
Input.Payload m a -> ConvertM m (ExpressionU m a)
convert app@(V.Apply funcI argI) exprPl =
runMatcherT $
do
(funcS, argS) <-
do
argS <- lift $ ConvertM.convertSubexpression argI
justToLeft $ convertAppliedHole app argS exprPl
funcS <- ConvertM.convertSubexpression funcI & lift
protectedSetToVal <- lift ConvertM.typeProtectedSetToVal
let setToFuncAction =
funcI ^. Val.payload . Input.stored
& Property.value
& protectedSetToVal (exprPl ^. Input.stored)
<&> EntityId.ofValI
& SetToInnerExpr
if Lens.has (rBody . _BodyHole) argS
then
return
( funcS & rPayload . plActions . setToHole .~ AlreadyAppliedToHole
, argS & rPayload . plActions . setToInnerExpr .~ setToFuncAction
)
else return (funcS, argS)
justToLeft $ convertAppliedCase funcS (funcI ^. Val.payload) argS exprPl
justToLeft $ convertLabeled funcS argS argI exprPl
lift $ convertPrefix funcS argS exprPl | 1,332 | convert app@(V.Apply funcI argI) exprPl =
runMatcherT $
do
(funcS, argS) <-
do
argS <- lift $ ConvertM.convertSubexpression argI
justToLeft $ convertAppliedHole app argS exprPl
funcS <- ConvertM.convertSubexpression funcI & lift
protectedSetToVal <- lift ConvertM.typeProtectedSetToVal
let setToFuncAction =
funcI ^. Val.payload . Input.stored
& Property.value
& protectedSetToVal (exprPl ^. Input.stored)
<&> EntityId.ofValI
& SetToInnerExpr
if Lens.has (rBody . _BodyHole) argS
then
return
( funcS & rPayload . plActions . setToHole .~ AlreadyAppliedToHole
, argS & rPayload . plActions . setToInnerExpr .~ setToFuncAction
)
else return (funcS, argS)
justToLeft $ convertAppliedCase funcS (funcI ^. Val.payload) argS exprPl
justToLeft $ convertLabeled funcS argS argI exprPl
lift $ convertPrefix funcS argS exprPl | 1,203 | false | true | 0 | 20 | 526 | 351 | 170 | 181 | null | null |
karamellpelle/MEnv | source/Font/FontShade.hs | bsd-2-clause | valueFontMaxCharacters :: UInt
valueFontMaxCharacters =
64 | 62 | valueFontMaxCharacters :: UInt
valueFontMaxCharacters =
64 | 62 | valueFontMaxCharacters =
64 | 31 | false | true | 0 | 4 | 9 | 11 | 6 | 5 | null | null |
brendanhay/gogol | gogol-videointelligence/gen/Network/Google/VideoIntelligence/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'GoogleCloudVideointelligenceV1p2beta1_LabelSegment' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvls1Confidence'
--
-- * 'gcvvls1Segment'
googleCloudVideointelligenceV1p2beta1_LabelSegment
:: GoogleCloudVideointelligenceV1p2beta1_LabelSegment
googleCloudVideointelligenceV1p2beta1_LabelSegment =
GoogleCloudVideointelligenceV1p2beta1_LabelSegment'
{_gcvvls1Confidence = Nothing, _gcvvls1Segment = Nothing} | 532 | googleCloudVideointelligenceV1p2beta1_LabelSegment
:: GoogleCloudVideointelligenceV1p2beta1_LabelSegment
googleCloudVideointelligenceV1p2beta1_LabelSegment =
GoogleCloudVideointelligenceV1p2beta1_LabelSegment'
{_gcvvls1Confidence = Nothing, _gcvvls1Segment = Nothing} | 277 | googleCloudVideointelligenceV1p2beta1_LabelSegment =
GoogleCloudVideointelligenceV1p2beta1_LabelSegment'
{_gcvvls1Confidence = Nothing, _gcvvls1Segment = Nothing} | 168 | true | true | 0 | 6 | 59 | 32 | 22 | 10 | null | null |
nevrenato/Hets_Fork | Isabelle/IsaParse.hs | gpl-2.0 | indexsuffix :: Parser String
indexsuffix = optionL (char '.' <:> nat) | 69 | indexsuffix :: Parser String
indexsuffix = optionL (char '.' <:> nat) | 69 | indexsuffix = optionL (char '.' <:> nat) | 40 | false | true | 0 | 8 | 10 | 27 | 13 | 14 | null | null |
bolo1729/Mastermind | Mastermind.hs | gpl-3.0 | best :: [Turn] -> [(Int, Pattern)]
best turns = sort . map evaluate $ universe' where
evaluate :: Pattern -> (Int, Pattern)
evaluate p = (maximum . map length . group . sort . map (check p) $ universe', p)
universe' :: [Pattern]
universe' = possible turns
-- Helper functions | 284 | best :: [Turn] -> [(Int, Pattern)]
best turns = sort . map evaluate $ universe' where
evaluate :: Pattern -> (Int, Pattern)
evaluate p = (maximum . map length . group . sort . map (check p) $ universe', p)
universe' :: [Pattern]
universe' = possible turns
-- Helper functions | 284 | best turns = sort . map evaluate $ universe' where
evaluate :: Pattern -> (Int, Pattern)
evaluate p = (maximum . map length . group . sort . map (check p) $ universe', p)
universe' :: [Pattern]
universe' = possible turns
-- Helper functions | 249 | false | true | 0 | 11 | 58 | 120 | 65 | 55 | null | null |
olsner/ghc | compiler/main/HscTypes.hs | bsd-3-clause | {-
Names in a NameCache are always stored as a Global, and have the SrcLoc
of their binding locations.
Actually that's not quite right. When we first encounter the original
name, we might not be at its binding site (e.g. we are reading an
interface file); so we give it 'noSrcLoc' then. Later, when we find
its binding site, we fix it up.
-}
updNameCacheIO :: HscEnv
-> (NameCache -> (NameCache, c)) -- The updating function
-> IO c
updNameCacheIO hsc_env upd_fn
= atomicModifyIORef' (hsc_NC hsc_env) upd_fn | 544 | updNameCacheIO :: HscEnv
-> (NameCache -> (NameCache, c)) -- The updating function
-> IO c
updNameCacheIO hsc_env upd_fn
= atomicModifyIORef' (hsc_NC hsc_env) upd_fn | 198 | updNameCacheIO hsc_env upd_fn
= atomicModifyIORef' (hsc_NC hsc_env) upd_fn | 76 | true | true | 0 | 10 | 123 | 57 | 29 | 28 | null | null |
TikhonJelvis/array-forth-sketch | src/GenerateSketch.hs | bsd-3-clause | callOpcode :: Opcode -> String
callOpcode instr = let (f:rest) = showConstr $ toConstr instr in toLower f : rest ++ "(step)" | 124 | callOpcode :: Opcode -> String
callOpcode instr = let (f:rest) = showConstr $ toConstr instr in toLower f : rest ++ "(step)" | 124 | callOpcode instr = let (f:rest) = showConstr $ toConstr instr in toLower f : rest ++ "(step)" | 93 | false | true | 0 | 10 | 21 | 61 | 27 | 34 | null | null |
keithodulaigh/Hets | Common/Amalgamate.hs | gpl-2.0 | {- ^ the reason for unknown status
The default value for 'DontKnow' amalgamability result -}
defaultDontKnow :: Amalgamates
defaultDontKnow = DontKnow "Unable to assert that amalgamability is ensured" | 200 | defaultDontKnow :: Amalgamates
defaultDontKnow = DontKnow "Unable to assert that amalgamability is ensured" | 107 | defaultDontKnow = DontKnow "Unable to assert that amalgamability is ensured" | 76 | true | true | 0 | 5 | 27 | 15 | 8 | 7 | null | null |
markus-git/imperative-edsl-vhdl | src/Language/Embedded/Hardware/Expression/Represent.hs | bsd-3-clause | declareFloating :: MonadV m => m ()
declareFloating =
do addLibrary "IEEE"
addImport "IEEE.float_pkg"
-------------------------------------------------------------------------------- | 191 | declareFloating :: MonadV m => m ()
declareFloating =
do addLibrary "IEEE"
addImport "IEEE.float_pkg"
-------------------------------------------------------------------------------- | 191 | declareFloating =
do addLibrary "IEEE"
addImport "IEEE.float_pkg"
-------------------------------------------------------------------------------- | 155 | false | true | 0 | 7 | 23 | 36 | 16 | 20 | null | null |
peterokagey/haskellOEIS | src/Sandbox/Sami/CycleStructure.hs | apache-2.0 | cascade :: Int -> CycleStructure -> CycleStructure
cascade x [] = [[x]] | 90 | cascade :: Int -> CycleStructure -> CycleStructure
cascade x [] = [[x]] | 90 | cascade x [] = [[x]] | 39 | false | true | 0 | 6 | 30 | 32 | 17 | 15 | null | null |
Cahu/krpc-hs | src/KRPCHS/SpaceCenter.hs | gpl-3.0 | {-
- Converts a position vector from one reference frame to another.<param name="position">Position vector in reference frame <paramref name="from" />.<param name="from">The reference frame that the position vector is in.<param name="to">The reference frame to covert the position vector to.The corresponding position vector in reference frame <paramref name="to" />.
-}
transformPosition :: (Double, Double, Double) -> KRPCHS.SpaceCenter.ReferenceFrame -> KRPCHS.SpaceCenter.ReferenceFrame -> RPCContext ((Double, Double, Double))
transformPosition positionArg fromArg toArg = do
let r = makeRequest "SpaceCenter" "TransformPosition" [makeArgument 0 positionArg, makeArgument 1 fromArg, makeArgument 2 toArg]
res <- sendRequest r
processResponse res | 764 | transformPosition :: (Double, Double, Double) -> KRPCHS.SpaceCenter.ReferenceFrame -> KRPCHS.SpaceCenter.ReferenceFrame -> RPCContext ((Double, Double, Double))
transformPosition positionArg fromArg toArg = do
let r = makeRequest "SpaceCenter" "TransformPosition" [makeArgument 0 positionArg, makeArgument 1 fromArg, makeArgument 2 toArg]
res <- sendRequest r
processResponse res | 391 | transformPosition positionArg fromArg toArg = do
let r = makeRequest "SpaceCenter" "TransformPosition" [makeArgument 0 positionArg, makeArgument 1 fromArg, makeArgument 2 toArg]
res <- sendRequest r
processResponse res | 230 | true | true | 0 | 13 | 102 | 123 | 61 | 62 | null | null |
sdiehl/ghc | compiler/basicTypes/Module.hs | bsd-3-clause | mkModuleEnv :: [(Module, a)] -> ModuleEnv a
mkModuleEnv xs = ModuleEnv (Map.fromList [(NDModule k, v) | (k,v) <- xs]) | 117 | mkModuleEnv :: [(Module, a)] -> ModuleEnv a
mkModuleEnv xs = ModuleEnv (Map.fromList [(NDModule k, v) | (k,v) <- xs]) | 117 | mkModuleEnv xs = ModuleEnv (Map.fromList [(NDModule k, v) | (k,v) <- xs]) | 73 | false | true | 0 | 11 | 18 | 72 | 37 | 35 | null | null |
h-youhei/myconfig | xmonad/xmonad.hs | mit | launchTerminalOn :: WorkspaceId -> X ()
launchTerminalOn ws = spawnOn ws =<< getTerminal | 88 | launchTerminalOn :: WorkspaceId -> X ()
launchTerminalOn ws = spawnOn ws =<< getTerminal | 88 | launchTerminalOn ws = spawnOn ws =<< getTerminal | 48 | false | true | 0 | 7 | 12 | 30 | 14 | 16 | null | null |
hpacheco/HAAP | src/HAAP/Code/Haskell.hs | mit | parseHaskellFile :: (MonadIO m,HaapStack t m) => FilePath -> Haap t m (Module SrcSpanInfo)
parseHaskellFile file = parseHaskellFileWith file Nothing Nothing | 156 | parseHaskellFile :: (MonadIO m,HaapStack t m) => FilePath -> Haap t m (Module SrcSpanInfo)
parseHaskellFile file = parseHaskellFileWith file Nothing Nothing | 156 | parseHaskellFile file = parseHaskellFileWith file Nothing Nothing | 65 | false | true | 0 | 10 | 20 | 59 | 28 | 31 | null | null |
AlexanderPankiv/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | trivialCode' _ width instr _ a b
= genTrivialCode (intFormat width) instr a b | 79 | trivialCode' _ width instr _ a b
= genTrivialCode (intFormat width) instr a b | 79 | trivialCode' _ width instr _ a b
= genTrivialCode (intFormat width) instr a b | 79 | false | false | 1 | 7 | 15 | 38 | 16 | 22 | null | null |
wavewave/madgraph-auto-dataset | src/HEP/Automation/MadGraph/Dataset/Set20110709set1.hs | gpl-3.0 | psetup_zph_TTBar0or1J :: ProcessSetup ZpH
psetup_zph_TTBar0or1J = PS {
model = ZpH
, process = preDefProcess TTBar0or1J
, processBrief = "TTBar0or1J"
, workname = "707_ZpH_TTBar0or1J_TEV"
} | 206 | psetup_zph_TTBar0or1J :: ProcessSetup ZpH
psetup_zph_TTBar0or1J = PS {
model = ZpH
, process = preDefProcess TTBar0or1J
, processBrief = "TTBar0or1J"
, workname = "707_ZpH_TTBar0or1J_TEV"
} | 206 | psetup_zph_TTBar0or1J = PS {
model = ZpH
, process = preDefProcess TTBar0or1J
, processBrief = "TTBar0or1J"
, workname = "707_ZpH_TTBar0or1J_TEV"
} | 164 | false | true | 0 | 7 | 41 | 43 | 25 | 18 | null | null |
spinda/liquidhaskell | src/Language/Haskell/Liquid/Constraint/Types.hs | bsd-3-clause | addRTyConInv _ t
= t | 22 | addRTyConInv _ t
= t | 22 | addRTyConInv _ t
= t | 22 | false | false | 0 | 5 | 6 | 11 | 5 | 6 | null | null |
dolio/vector | Data/Vector/Unboxed.hs | bsd-3-clause | scanr = G.scanr | 15 | scanr = G.scanr | 15 | scanr = G.scanr | 15 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
FiskerLars/scorg | src/Data/RDF/NS/Foaf.hs | gpl-3.0 | foafNameView g s = headObjView g "Name of Subject Missing" s foafName | 69 | foafNameView g s = headObjView g "Name of Subject Missing" s foafName | 69 | foafNameView g s = headObjView g "Name of Subject Missing" s foafName | 69 | false | false | 0 | 5 | 11 | 20 | 9 | 11 | null | null |
Rizary/hackage-matrix-builder | src-ui.v3/src/API.hs | gpl-3.0 | putTags :: forall t m. (Reflex t, SupportsServantReflex t m, MonadHold t m) => Dynamic t (Either Text TagN) -> Dynamic t (Either Text PkgN) -> Event t () -> m (Event t NoContent)
putTags tagNDyn pkgNDyn evSubmit = wireClientRes =<< putV2PackageTags tagNDyn pkgNDyn evSubmit | 273 | putTags :: forall t m. (Reflex t, SupportsServantReflex t m, MonadHold t m) => Dynamic t (Either Text TagN) -> Dynamic t (Either Text PkgN) -> Event t () -> m (Event t NoContent)
putTags tagNDyn pkgNDyn evSubmit = wireClientRes =<< putV2PackageTags tagNDyn pkgNDyn evSubmit | 273 | putTags tagNDyn pkgNDyn evSubmit = wireClientRes =<< putV2PackageTags tagNDyn pkgNDyn evSubmit | 94 | false | true | 0 | 12 | 44 | 116 | 57 | 59 | null | null |
phischu/fragnix | tests/packages/scotty/Control.Monad.Trans.List.hs | bsd-3-clause | mapListT :: (m [a] -> n [b]) -> ListT m a -> ListT n b
mapListT f m = ListT $ f (runListT m) | 92 | mapListT :: (m [a] -> n [b]) -> ListT m a -> ListT n b
mapListT f m = ListT $ f (runListT m) | 92 | mapListT f m = ListT $ f (runListT m) | 37 | false | true | 0 | 9 | 23 | 66 | 32 | 34 | null | null |
39aldo39/klfc | src/Lookup/Linux.hs | gpl-3.0 | printLinuxAction ∷ Logger m ⇒ LinuxAction → m String
printLinuxAction (Symbol _) = pure "NoAction()" | 100 | printLinuxAction ∷ Logger m ⇒ LinuxAction → m String
printLinuxAction (Symbol _) = pure "NoAction()" | 100 | printLinuxAction (Symbol _) = pure "NoAction()" | 47 | false | true | 0 | 7 | 14 | 37 | 17 | 20 | null | null |
kumasento/accelerate | Data/Array/Accelerate/AST.hs | bsd-3-clause | showPreAccOp Transform{} = "Transform" | 45 | showPreAccOp Transform{} = "Transform" | 45 | showPreAccOp Transform{} = "Transform" | 45 | false | false | 0 | 6 | 10 | 13 | 6 | 7 | null | null |
reflex-frp/reflex | src/Reflex/Class.hs | bsd-3-clause | -- | Similar to 'accumIncremental' but the combining function runs in 'PushM'
accumMIncremental
:: (Reflex t, Patch p, MonadHold t m, MonadFix m)
=> (PatchTarget p -> b -> PushM t p)
-> PatchTarget p
-> Event t b
-> m (Incremental t p)
accumMIncremental f = accumMaybeMIncremental $ \v o -> Just <$> f v o | 315 | accumMIncremental
:: (Reflex t, Patch p, MonadHold t m, MonadFix m)
=> (PatchTarget p -> b -> PushM t p)
-> PatchTarget p
-> Event t b
-> m (Incremental t p)
accumMIncremental f = accumMaybeMIncremental $ \v o -> Just <$> f v o | 237 | accumMIncremental f = accumMaybeMIncremental $ \v o -> Just <$> f v o | 69 | true | true | 0 | 12 | 66 | 118 | 57 | 61 | null | null |
rueshyna/gogol | gogol-identity-toolkit/gen/Network/Google/IdentityToolkit/Types/Product.hs | mpl-2.0 | -- | Whitelisted client IDs for audience check.
icWhiteListedAudiences :: Lens' IdpConfig [Text]
icWhiteListedAudiences
= lens _icWhiteListedAudiences
(\ s a -> s{_icWhiteListedAudiences = a})
. _Default
. _Coerce | 233 | icWhiteListedAudiences :: Lens' IdpConfig [Text]
icWhiteListedAudiences
= lens _icWhiteListedAudiences
(\ s a -> s{_icWhiteListedAudiences = a})
. _Default
. _Coerce | 185 | icWhiteListedAudiences
= lens _icWhiteListedAudiences
(\ s a -> s{_icWhiteListedAudiences = a})
. _Default
. _Coerce | 136 | true | true | 3 | 8 | 47 | 58 | 28 | 30 | null | null |
kelecorix/api-afftrack | src/Afftrack/API/Brand/Offers.hs | bsd-3-clause | getCreativeCounts :: [Text] -> Call
getCreativeCounts params =
Call "offer_offer"
"getCreativeCounts"
"GET"
[ Param "offer_id" True (getValue params 0)] | 181 | getCreativeCounts :: [Text] -> Call
getCreativeCounts params =
Call "offer_offer"
"getCreativeCounts"
"GET"
[ Param "offer_id" True (getValue params 0)] | 175 | getCreativeCounts params =
Call "offer_offer"
"getCreativeCounts"
"GET"
[ Param "offer_id" True (getValue params 0)] | 139 | false | true | 0 | 9 | 47 | 48 | 24 | 24 | null | null |
vladfi1/hs-misc | FactorGraph/FactorGraphVinyl.hs | mit | runzip ((Lift (fx, gx)) :& xs) = (fx :& fxs, gx :& gxs)
where (fxs, gxs) = runzip xs | 86 | runzip ((Lift (fx, gx)) :& xs) = (fx :& fxs, gx :& gxs)
where (fxs, gxs) = runzip xs | 86 | runzip ((Lift (fx, gx)) :& xs) = (fx :& fxs, gx :& gxs)
where (fxs, gxs) = runzip xs | 86 | false | false | 0 | 10 | 20 | 59 | 32 | 27 | null | null |
brendanhay/gogol | gogol-iam/gen/Network/Google/Resource/IAM/Projects/Locations/WorkLoadIdentityPools/Providers/Get.hs | mpl-2.0 | -- | V1 error format.
plwlippgXgafv :: Lens' ProjectsLocationsWorkLoadIdentityPoolsProvidersGet (Maybe Xgafv)
plwlippgXgafv
= lens _plwlippgXgafv
(\ s a -> s{_plwlippgXgafv = a}) | 186 | plwlippgXgafv :: Lens' ProjectsLocationsWorkLoadIdentityPoolsProvidersGet (Maybe Xgafv)
plwlippgXgafv
= lens _plwlippgXgafv
(\ s a -> s{_plwlippgXgafv = a}) | 164 | plwlippgXgafv
= lens _plwlippgXgafv
(\ s a -> s{_plwlippgXgafv = a}) | 76 | true | true | 0 | 9 | 29 | 48 | 25 | 23 | null | null |
bredelings/BAli-Phy | haskell/SModel.hs | gpl-2.0 | -- In theory we could take just (a,q) since we could compute smap from a (if states are simple) and pi from q.
baseModel (MixtureModel l) i = snd (l !! i) | 154 | baseModel (MixtureModel l) i = snd (l !! i) | 43 | baseModel (MixtureModel l) i = snd (l !! i) | 43 | true | false | 1 | 7 | 31 | 30 | 14 | 16 | null | null |
clinty/Juicy.Pixels | src/Codec/Picture/Saving.hs | bsd-3-clause | imageToTiff (ImageY8 img) = encodeTiff img | 46 | imageToTiff (ImageY8 img) = encodeTiff img | 46 | imageToTiff (ImageY8 img) = encodeTiff img | 46 | false | false | 0 | 7 | 9 | 18 | 8 | 10 | null | null |
gnn/Hets | Maude/Maude2DG.hs | gpl-2.0 | getOpDeclSet :: OpDeclSet -> Symbols -> SymbolMap -> OpDeclSet
getOpDeclSet ods ss sm = Set.singleton (op_sym', ats)
where f ~(Operator _ x _) b = x == ss || b
g = Set.fold f False . fst
(ods', ats) : _ = Set.toList $ Set.filter g ods
h ~(Operator _ y _) = y == ss
ods'' = Set.filter h ods'
op_sym : _ = Set.toList ods''
op_sym' = applyRenamingOpSymbol op_sym sm
-- | applies the renaming in the map to the operator declaration | 527 | getOpDeclSet :: OpDeclSet -> Symbols -> SymbolMap -> OpDeclSet
getOpDeclSet ods ss sm = Set.singleton (op_sym', ats)
where f ~(Operator _ x _) b = x == ss || b
g = Set.fold f False . fst
(ods', ats) : _ = Set.toList $ Set.filter g ods
h ~(Operator _ y _) = y == ss
ods'' = Set.filter h ods'
op_sym : _ = Set.toList ods''
op_sym' = applyRenamingOpSymbol op_sym sm
-- | applies the renaming in the map to the operator declaration | 527 | getOpDeclSet ods ss sm = Set.singleton (op_sym', ats)
where f ~(Operator _ x _) b = x == ss || b
g = Set.fold f False . fst
(ods', ats) : _ = Set.toList $ Set.filter g ods
h ~(Operator _ y _) = y == ss
ods'' = Set.filter h ods'
op_sym : _ = Set.toList ods''
op_sym' = applyRenamingOpSymbol op_sym sm
-- | applies the renaming in the map to the operator declaration | 464 | false | true | 6 | 9 | 183 | 195 | 90 | 105 | null | null |
tiqwab/md-parser | src/Text/Md/ParseUtils.hs | bsd-3-clause | -- | Parse a newline.
-- This function also handles quote marks at the beginning of lines and update the parser state.
newlineQuote :: Stream s m Char => ParsecT s ParseContext m Char
newlineQuote = do
c <- lineStart <$> P.getState
level <- quoteLevel <$> P.getState
nl <- P.newline
-- `P.optionMaybe (P.try (P.count level xxx))` parses no input if xxx does not occurs `level` times.
isQuoted <- isJust <$> P.optionMaybe (P.try (P.count level (P.char c <* P.optional spaceChar)))
-- consume quotes when `quote` does not occur `level` times
unless isQuoted (void (P.many (P.char c <* P.optional spaceChar)))
P.modifyState (\context -> context { isLastNewLineQuoted = isQuoted })
return nl
-- | Parse a blank line. | 731 | newlineQuote :: Stream s m Char => ParsecT s ParseContext m Char
newlineQuote = do
c <- lineStart <$> P.getState
level <- quoteLevel <$> P.getState
nl <- P.newline
-- `P.optionMaybe (P.try (P.count level xxx))` parses no input if xxx does not occurs `level` times.
isQuoted <- isJust <$> P.optionMaybe (P.try (P.count level (P.char c <* P.optional spaceChar)))
-- consume quotes when `quote` does not occur `level` times
unless isQuoted (void (P.many (P.char c <* P.optional spaceChar)))
P.modifyState (\context -> context { isLastNewLineQuoted = isQuoted })
return nl
-- | Parse a blank line. | 612 | newlineQuote = do
c <- lineStart <$> P.getState
level <- quoteLevel <$> P.getState
nl <- P.newline
-- `P.optionMaybe (P.try (P.count level xxx))` parses no input if xxx does not occurs `level` times.
isQuoted <- isJust <$> P.optionMaybe (P.try (P.count level (P.char c <* P.optional spaceChar)))
-- consume quotes when `quote` does not occur `level` times
unless isQuoted (void (P.many (P.char c <* P.optional spaceChar)))
P.modifyState (\context -> context { isLastNewLineQuoted = isQuoted })
return nl
-- | Parse a blank line. | 547 | true | true | 0 | 18 | 133 | 197 | 94 | 103 | null | null |
nwf/wl-pprint-extras | src/Text/PrettyPrint/Free/Internal.hs | bsd-2-clause | flatten_ (Char _) = Nothing | 33 | flatten_ (Char _) = Nothing | 33 | flatten_ (Char _) = Nothing | 33 | false | false | 0 | 6 | 10 | 16 | 7 | 9 | null | null |
jmiszczak/hoqus | Hoqus/MtxOrd.hs | mit | -- | Function 'unres' provides row-based unvectorization.
unres :: Int -> [a] -> [[a]]
unres d v = transpose $ unvec d v | 120 | unres :: Int -> [a] -> [[a]]
unres d v = transpose $ unvec d v | 62 | unres d v = transpose $ unvec d v | 33 | true | true | 2 | 10 | 22 | 49 | 24 | 25 | null | null |
DFLY-Entertainment/mc-map | src/Game/Minecraft/Map/NBT.hs | gpl-3.0 | findContent _ _ = [] | 20 | findContent _ _ = [] | 20 | findContent _ _ = [] | 20 | false | false | 0 | 5 | 4 | 13 | 6 | 7 | null | null |
luzhuomi/cpp-obs | Language/C/Obfuscate/CFG.hs | apache-2.0 | getVarsFromExp (AST.CComma exps _) =
case unzip (map getVarsFromExp exps) of
{ (ll, rr) -> (concat ll, concat rr) } | 130 | getVarsFromExp (AST.CComma exps _) =
case unzip (map getVarsFromExp exps) of
{ (ll, rr) -> (concat ll, concat rr) } | 130 | getVarsFromExp (AST.CComma exps _) =
case unzip (map getVarsFromExp exps) of
{ (ll, rr) -> (concat ll, concat rr) } | 130 | false | false | 0 | 9 | 34 | 60 | 31 | 29 | null | null |
jbearer/hspl | benchmarks/utils/Bench.hs | mit | genPrologGoal (Or g1 g2) = "(" ++ genPrologGoal g1 ++ ";" ++ genPrologGoal g2 ++ ")" | 84 | genPrologGoal (Or g1 g2) = "(" ++ genPrologGoal g1 ++ ";" ++ genPrologGoal g2 ++ ")" | 84 | genPrologGoal (Or g1 g2) = "(" ++ genPrologGoal g1 ++ ";" ++ genPrologGoal g2 ++ ")" | 84 | false | false | 0 | 9 | 15 | 39 | 18 | 21 | null | null |
GaloisInc/gidl | src/Gidl.hs | bsd-3-clause | parseOptions :: [OptDescr (OptParser opt)] -> [String]
-> Either [String] (opt -> opt)
parseOptions opts args = case getOpt Permute opts args of
(fs,[],[]) -> case mconcat fs of
OptParser [] f -> Right f
OptParser es _ -> Left es
(_,_,es) -> Left es | 274 | parseOptions :: [OptDescr (OptParser opt)] -> [String]
-> Either [String] (opt -> opt)
parseOptions opts args = case getOpt Permute opts args of
(fs,[],[]) -> case mconcat fs of
OptParser [] f -> Right f
OptParser es _ -> Left es
(_,_,es) -> Left es | 274 | parseOptions opts args = case getOpt Permute opts args of
(fs,[],[]) -> case mconcat fs of
OptParser [] f -> Right f
OptParser es _ -> Left es
(_,_,es) -> Left es | 174 | false | true | 0 | 12 | 69 | 143 | 71 | 72 | null | null |
AlexeyRaga/eta | compiler/ETA/CodeGen/Rts.hs | bsd-3-clause | stgInd = thunk "StgInd" | 30 | stgInd = thunk "StgInd" | 30 | stgInd = thunk "StgInd" | 30 | false | false | 0 | 5 | 10 | 9 | 4 | 5 | null | null |
heathweiss/Tricad | src/Examples/ShoeLift/SandalsHeel.hs | gpl-2.0 | shoeFlatOrigin = (Point{x_axis=0, y_axis=(0), z_axis=70}) | 57 | shoeFlatOrigin = (Point{x_axis=0, y_axis=(0), z_axis=70}) | 57 | shoeFlatOrigin = (Point{x_axis=0, y_axis=(0), z_axis=70}) | 57 | false | false | 1 | 8 | 4 | 35 | 20 | 15 | null | null |
UU-ComputerScience/uulib | src/UU/PPrint.hs | bsd-3-clause | displayS (SLine i x) = showString ('\n':indentation i) . displayS x | 74 | displayS (SLine i x) = showString ('\n':indentation i) . displayS x | 74 | displayS (SLine i x) = showString ('\n':indentation i) . displayS x | 74 | false | false | 0 | 9 | 17 | 37 | 17 | 20 | null | null |
denibertovic/haskell | kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs | bsd-3-clause | -- | 'v1alpha1PodPresetSpec' Lens
v1alpha1PodPresetSpecL :: Lens_' V1alpha1PodPreset (Maybe V1alpha1PodPresetSpec)
v1alpha1PodPresetSpecL f V1alpha1PodPreset{..} = (\v1alpha1PodPresetSpec -> V1alpha1PodPreset { v1alpha1PodPresetSpec, ..} ) <$> f v1alpha1PodPresetSpec | 267 | v1alpha1PodPresetSpecL :: Lens_' V1alpha1PodPreset (Maybe V1alpha1PodPresetSpec)
v1alpha1PodPresetSpecL f V1alpha1PodPreset{..} = (\v1alpha1PodPresetSpec -> V1alpha1PodPreset { v1alpha1PodPresetSpec, ..} ) <$> f v1alpha1PodPresetSpec | 233 | v1alpha1PodPresetSpecL f V1alpha1PodPreset{..} = (\v1alpha1PodPresetSpec -> V1alpha1PodPreset { v1alpha1PodPresetSpec, ..} ) <$> f v1alpha1PodPresetSpec | 152 | true | true | 1 | 8 | 23 | 62 | 30 | 32 | null | null |
nikita-volkov/wobsurv | library/Wobsurv/Response.hs | mit | okFile :: FilePath -> Maybe KeepAliveTimeout -> MimeMappings -> Response ()
okFile path keepAliveTimeout mimeMappings =
do
statusLine Protocol.ok
case keepAliveTimeout of
Nothing -> do
connectionHeader False
Just v -> do
connectionHeader True
keepAliveHeader (v, Nothing)
forM_ contentType $ \x -> contentTypeHeader (x, Nothing)
newLine
file path
where
contentType =
Path.extension path >>= \e -> Data.HashMap.Strict.lookup e mimeMappings | 515 | okFile :: FilePath -> Maybe KeepAliveTimeout -> MimeMappings -> Response ()
okFile path keepAliveTimeout mimeMappings =
do
statusLine Protocol.ok
case keepAliveTimeout of
Nothing -> do
connectionHeader False
Just v -> do
connectionHeader True
keepAliveHeader (v, Nothing)
forM_ contentType $ \x -> contentTypeHeader (x, Nothing)
newLine
file path
where
contentType =
Path.extension path >>= \e -> Data.HashMap.Strict.lookup e mimeMappings | 515 | okFile path keepAliveTimeout mimeMappings =
do
statusLine Protocol.ok
case keepAliveTimeout of
Nothing -> do
connectionHeader False
Just v -> do
connectionHeader True
keepAliveHeader (v, Nothing)
forM_ contentType $ \x -> contentTypeHeader (x, Nothing)
newLine
file path
where
contentType =
Path.extension path >>= \e -> Data.HashMap.Strict.lookup e mimeMappings | 439 | false | true | 0 | 13 | 134 | 156 | 72 | 84 | null | null |
isomorphism/csound-expression | src/Csound/Air/Misc.hs | bsd-3-clause | writeHifi :: D -> String -> SE Sig2 -> IO ()
writeHifi n fileName a = writeSndBy (setRates 48000 10) fileName $ fmap (setDur $ n) a | 131 | writeHifi :: D -> String -> SE Sig2 -> IO ()
writeHifi n fileName a = writeSndBy (setRates 48000 10) fileName $ fmap (setDur $ n) a | 131 | writeHifi n fileName a = writeSndBy (setRates 48000 10) fileName $ fmap (setDur $ n) a | 86 | false | true | 0 | 9 | 26 | 67 | 32 | 35 | null | null |
zoranbosnjak/longrun | Control/Concurrent/Longrun/Base.hs | gpl-3.0 | finally :: Process a -> Process b -> Process a
finally action cleanup = Process (ReaderT run) where
action' = runReaderT $ unProcess action
cleanup' = runReaderT $ unProcess cleanup
run config = action' config `Control.Exception.finally` cleanup' config
-- | Try to run an action (try wrapper). | 307 | finally :: Process a -> Process b -> Process a
finally action cleanup = Process (ReaderT run) where
action' = runReaderT $ unProcess action
cleanup' = runReaderT $ unProcess cleanup
run config = action' config `Control.Exception.finally` cleanup' config
-- | Try to run an action (try wrapper). | 307 | finally action cleanup = Process (ReaderT run) where
action' = runReaderT $ unProcess action
cleanup' = runReaderT $ unProcess cleanup
run config = action' config `Control.Exception.finally` cleanup' config
-- | Try to run an action (try wrapper). | 260 | false | true | 0 | 8 | 59 | 96 | 46 | 50 | null | null |
mathk/arm-isa | Arm/ThumbDecode.hs | mit | parseHalfMiscellaneous :: ThumbStreamState ArmInstr
parseHalfMiscellaneous = do
bitsField <- instructionArrayBits [11,10,9,8,7,6,5]
case bitsField of
[0,0,0,0,0,_,_] -> partialInstruction Add <*> parseMiscArithmeticT2Args
[0,0,0,0,1,_,_] -> partialInstruction Sub <*> parseMiscArithmeticT2Args
[0,0,0,1,_,_,_] -> partialInstruction Cbz <*> parseCompareBranchT1Args
[0,0,1,0,0,0,_] -> partialInstruction Sxth <*> parseCompareBranchT1Args
[0,0,1,0,0,1,_] -> partialInstruction Sxtb <*> parseCompareBranchT1Args
[0,0,1,0,1,0,_] -> partialInstruction Uxth <*> parseCompareBranchT1Args
[0,0,1,0,1,1,_] -> partialInstruction Uxtb <*> parseCompareBranchT1Args
[0,0,1,1,_,_,_] -> partialInstruction Cbz <*> parseCompareBranchT1Args
[0,1,0,_,_,_,_] -> partialInstruction Push <*> parsePushRegisterListT1Args
[0,1,1,0,0,1,0] -> partialInstruction Setend <*> parseSetEndianessT1Args
[0,1,1,0,0,1,1] -> partialInstruction Cps <*> parseSetEndianessT1Args
[1,0,0,1,_,_,_] -> partialInstruction Cbnz <*> parseCompareBranchT1Args
[1,0,1,0,0,0,_] -> partialInstruction Rev <*> parseRegisterToRegisterT1Args
[1,0,1,0,0,1,_] -> partialInstruction Rev16 <*> parseRegisterToRegisterT1Args
[1,0,1,0,1,1,_] -> partialInstruction Revsh <*> parseRegisterToRegisterT1Args
[1,0,1,1,_,_,_] -> partialInstruction Cbnz <*> parseCompareBranchT1Args
[1,1,0,_,_,_,_] -> partialInstruction Pop <*> parsePopRegisterListT1Args
[1,1,1,0,_,_,_] -> partialInstruction Bkpt <*> pure NullArgs
[1,1,1,1,_,_,_] -> parseIfThenHint
otherwise -> undefinedInstruction
-- | If then and hints
-- Section A6.2.5 second page of the reference manual. | 1,794 | parseHalfMiscellaneous :: ThumbStreamState ArmInstr
parseHalfMiscellaneous = do
bitsField <- instructionArrayBits [11,10,9,8,7,6,5]
case bitsField of
[0,0,0,0,0,_,_] -> partialInstruction Add <*> parseMiscArithmeticT2Args
[0,0,0,0,1,_,_] -> partialInstruction Sub <*> parseMiscArithmeticT2Args
[0,0,0,1,_,_,_] -> partialInstruction Cbz <*> parseCompareBranchT1Args
[0,0,1,0,0,0,_] -> partialInstruction Sxth <*> parseCompareBranchT1Args
[0,0,1,0,0,1,_] -> partialInstruction Sxtb <*> parseCompareBranchT1Args
[0,0,1,0,1,0,_] -> partialInstruction Uxth <*> parseCompareBranchT1Args
[0,0,1,0,1,1,_] -> partialInstruction Uxtb <*> parseCompareBranchT1Args
[0,0,1,1,_,_,_] -> partialInstruction Cbz <*> parseCompareBranchT1Args
[0,1,0,_,_,_,_] -> partialInstruction Push <*> parsePushRegisterListT1Args
[0,1,1,0,0,1,0] -> partialInstruction Setend <*> parseSetEndianessT1Args
[0,1,1,0,0,1,1] -> partialInstruction Cps <*> parseSetEndianessT1Args
[1,0,0,1,_,_,_] -> partialInstruction Cbnz <*> parseCompareBranchT1Args
[1,0,1,0,0,0,_] -> partialInstruction Rev <*> parseRegisterToRegisterT1Args
[1,0,1,0,0,1,_] -> partialInstruction Rev16 <*> parseRegisterToRegisterT1Args
[1,0,1,0,1,1,_] -> partialInstruction Revsh <*> parseRegisterToRegisterT1Args
[1,0,1,1,_,_,_] -> partialInstruction Cbnz <*> parseCompareBranchT1Args
[1,1,0,_,_,_,_] -> partialInstruction Pop <*> parsePopRegisterListT1Args
[1,1,1,0,_,_,_] -> partialInstruction Bkpt <*> pure NullArgs
[1,1,1,1,_,_,_] -> parseIfThenHint
otherwise -> undefinedInstruction
-- | If then and hints
-- Section A6.2.5 second page of the reference manual. | 1,793 | parseHalfMiscellaneous = do
bitsField <- instructionArrayBits [11,10,9,8,7,6,5]
case bitsField of
[0,0,0,0,0,_,_] -> partialInstruction Add <*> parseMiscArithmeticT2Args
[0,0,0,0,1,_,_] -> partialInstruction Sub <*> parseMiscArithmeticT2Args
[0,0,0,1,_,_,_] -> partialInstruction Cbz <*> parseCompareBranchT1Args
[0,0,1,0,0,0,_] -> partialInstruction Sxth <*> parseCompareBranchT1Args
[0,0,1,0,0,1,_] -> partialInstruction Sxtb <*> parseCompareBranchT1Args
[0,0,1,0,1,0,_] -> partialInstruction Uxth <*> parseCompareBranchT1Args
[0,0,1,0,1,1,_] -> partialInstruction Uxtb <*> parseCompareBranchT1Args
[0,0,1,1,_,_,_] -> partialInstruction Cbz <*> parseCompareBranchT1Args
[0,1,0,_,_,_,_] -> partialInstruction Push <*> parsePushRegisterListT1Args
[0,1,1,0,0,1,0] -> partialInstruction Setend <*> parseSetEndianessT1Args
[0,1,1,0,0,1,1] -> partialInstruction Cps <*> parseSetEndianessT1Args
[1,0,0,1,_,_,_] -> partialInstruction Cbnz <*> parseCompareBranchT1Args
[1,0,1,0,0,0,_] -> partialInstruction Rev <*> parseRegisterToRegisterT1Args
[1,0,1,0,0,1,_] -> partialInstruction Rev16 <*> parseRegisterToRegisterT1Args
[1,0,1,0,1,1,_] -> partialInstruction Revsh <*> parseRegisterToRegisterT1Args
[1,0,1,1,_,_,_] -> partialInstruction Cbnz <*> parseCompareBranchT1Args
[1,1,0,_,_,_,_] -> partialInstruction Pop <*> parsePopRegisterListT1Args
[1,1,1,0,_,_,_] -> partialInstruction Bkpt <*> pure NullArgs
[1,1,1,1,_,_,_] -> parseIfThenHint
otherwise -> undefinedInstruction
-- | If then and hints
-- Section A6.2.5 second page of the reference manual. | 1,741 | false | true | 0 | 11 | 339 | 702 | 411 | 291 | null | null |
fros1y/umbral | src/GameM.hs | bsd-3-clause | getEntity :: EntityRef -> GameM (Maybe Entity)
getEntity ref = do
state <- ask
return $ IntMap.lookup ref (state ^. (currLevel. gameEntities)) | 150 | getEntity :: EntityRef -> GameM (Maybe Entity)
getEntity ref = do
state <- ask
return $ IntMap.lookup ref (state ^. (currLevel. gameEntities)) | 150 | getEntity ref = do
state <- ask
return $ IntMap.lookup ref (state ^. (currLevel. gameEntities)) | 103 | false | true | 0 | 12 | 29 | 62 | 30 | 32 | null | null |
gcampax/ghc | compiler/types/TyCon.hs | bsd-3-clause | tyConCType_maybe _ = Nothing | 28 | tyConCType_maybe _ = Nothing | 28 | tyConCType_maybe _ = Nothing | 28 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
fhsjaagshs/niagra | src/Data/Niagra/Selector/Tags.hs | mit | h1 :: Selector
h1 = "h1" | 24 | h1 :: Selector
h1 = "h1" | 24 | h1 = "h1" | 9 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/book/2007-Programming_in_Haskell-1st_Edition-Graham_Hutton/ch_09_9.hs | unlicense | life' :: Board -> IO ()
life' b = do initialize b
lifeloop b nextgen' | 82 | life' :: Board -> IO ()
life' b = do initialize b
lifeloop b nextgen' | 82 | life' b = do initialize b
lifeloop b nextgen' | 58 | false | true | 0 | 8 | 27 | 42 | 17 | 25 | null | null |
chris-wood/flux | src/FluxParser.hs | mit | for :: Parser Expr
for = do
reserved "for"
var <- identifier
reservedOp "="
start <- expr
reservedOp ","
cond <- expr
reservedOp ","
step <- expr
reserved "in"
body <- expr
return $ For var start cond step body | 254 | for :: Parser Expr
for = do
reserved "for"
var <- identifier
reservedOp "="
start <- expr
reservedOp ","
cond <- expr
reservedOp ","
step <- expr
reserved "in"
body <- expr
return $ For var start cond step body | 254 | for = do
reserved "for"
var <- identifier
reservedOp "="
start <- expr
reservedOp ","
cond <- expr
reservedOp ","
step <- expr
reserved "in"
body <- expr
return $ For var start cond step body | 235 | false | true | 0 | 8 | 83 | 97 | 40 | 57 | null | null |
sklam/fretted | Fretted/Basic.hs | mit | addOctaveMark :: Int -> String
addOctaveMark n
| n > 0 = "'" ++ addOctaveMark (n - 1)
| n == 0 = ""
| n < 0 = "," ++ addOctaveMark (n + 1) | 161 | addOctaveMark :: Int -> String
addOctaveMark n
| n > 0 = "'" ++ addOctaveMark (n - 1)
| n == 0 = ""
| n < 0 = "," ++ addOctaveMark (n + 1) | 161 | addOctaveMark n
| n > 0 = "'" ++ addOctaveMark (n - 1)
| n == 0 = ""
| n < 0 = "," ++ addOctaveMark (n + 1) | 130 | false | true | 4 | 8 | 57 | 93 | 42 | 51 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/lens/2019-12-chris-penner-advent-of-optics/test/TestDay01.hs | unlicense | solve2'' :: IO Double
solve2'' = do
input <- Prelude.readFile "test/01.txt"
pure $ input &
sumOf (worded . _Show . takingWhile (>0) (dropping 1 (iterated calculateRequiredFuel)) ) | 188 | solve2'' :: IO Double
solve2'' = do
input <- Prelude.readFile "test/01.txt"
pure $ input &
sumOf (worded . _Show . takingWhile (>0) (dropping 1 (iterated calculateRequiredFuel)) ) | 188 | solve2'' = do
input <- Prelude.readFile "test/01.txt"
pure $ input &
sumOf (worded . _Show . takingWhile (>0) (dropping 1 (iterated calculateRequiredFuel)) ) | 166 | false | true | 0 | 16 | 35 | 80 | 37 | 43 | null | null |
GaloisInc/halvm-ghc | compiler/ghci/ByteCodeGen.hs | bsd-3-clause | splitApp (AnnApp (_,f) (_,a)) = case splitApp f of
(f', as) -> (f', a:as) | 114 | splitApp (AnnApp (_,f) (_,a)) = case splitApp f of
(f', as) -> (f', a:as) | 114 | splitApp (AnnApp (_,f) (_,a)) = case splitApp f of
(f', as) -> (f', a:as) | 114 | false | false | 0 | 9 | 54 | 58 | 32 | 26 | null | null |
Multi-Axis/habbix | src/Forecast.hs | mit | apply aggregate = case aggregate of
Max -> DV.maximumBy (compare `on` snd)
Min -> DV.minimumBy (compare `on` snd)
Avg -> (vectorMedian *** vectorAvg) . DV.unzip
-- | Fold left; accumulate the current index (and timestamp) when day changes. | 249 | apply aggregate = case aggregate of
Max -> DV.maximumBy (compare `on` snd)
Min -> DV.minimumBy (compare `on` snd)
Avg -> (vectorMedian *** vectorAvg) . DV.unzip
-- | Fold left; accumulate the current index (and timestamp) when day changes. | 249 | apply aggregate = case aggregate of
Max -> DV.maximumBy (compare `on` snd)
Min -> DV.minimumBy (compare `on` snd)
Avg -> (vectorMedian *** vectorAvg) . DV.unzip
-- | Fold left; accumulate the current index (and timestamp) when day changes. | 249 | false | false | 0 | 10 | 47 | 73 | 39 | 34 | null | null |
literate-unitb/literate-unitb | src/Document/Pipeline.hs | mit | convertInput :: InputBuilder -> Input
convertInput (Input mch ctx) = Input
(M.map convertBlocks mch)
(M.map convertBlocks ctx) | 144 | convertInput :: InputBuilder -> Input
convertInput (Input mch ctx) = Input
(M.map convertBlocks mch)
(M.map convertBlocks ctx) | 144 | convertInput (Input mch ctx) = Input
(M.map convertBlocks mch)
(M.map convertBlocks ctx) | 106 | false | true | 0 | 8 | 34 | 51 | 25 | 26 | null | null |
ezyang/ghc | testsuite/tests/pmcheck/should_compile/T11276.hs | bsd-3-clause | peek :: Monad m => Consumer a m (Maybe a)
peek = undefined | 58 | peek :: Monad m => Consumer a m (Maybe a)
peek = undefined | 58 | peek = undefined | 16 | false | true | 0 | 8 | 12 | 31 | 15 | 16 | null | null |
keera-studios/hsQt | Qtc/Enums/Core/QVariant.hs | bsd-2-clause | eTextLength :: QVariantType
eTextLength
= ieQVariantType $ 78 | 63 | eTextLength :: QVariantType
eTextLength
= ieQVariantType $ 78 | 63 | eTextLength
= ieQVariantType $ 78 | 35 | false | true | 0 | 6 | 9 | 18 | 8 | 10 | null | null |
SaneApp/elastic-search-api | src/ElasticSearch/Query.hs | mit | filtered :: Query
filtered = undefined | 38 | filtered :: Query
filtered = undefined | 38 | filtered = undefined | 20 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
yzhou61/xmonad-contrib | XMonad/Prompt/Pass.hs | bsd-3-clause | selectShowPassword :: String -> X ()
selectShowPassword passLabel = runInTerm "" $ "zsh -c \"/home/yzhou/bin/scripts/pass1 " ++ passLabel ++ "| less\"" | 151 | selectShowPassword :: String -> X ()
selectShowPassword passLabel = runInTerm "" $ "zsh -c \"/home/yzhou/bin/scripts/pass1 " ++ passLabel ++ "| less\"" | 151 | selectShowPassword passLabel = runInTerm "" $ "zsh -c \"/home/yzhou/bin/scripts/pass1 " ++ passLabel ++ "| less\"" | 114 | false | true | 0 | 8 | 20 | 42 | 19 | 23 | null | null |
trskop/toolbox-tray-icon | src/WxMain.hs | bsd-3-clause | taskBarIcon
:: Icon ()
-> String
-> (TaskBarIcon () -> EventTaskBarIcon -> IO ())
-> IO ()
taskBarIcon icon str f = do
tbi <- taskBarIconCreate
_ <- taskBarIconSetIcon tbi icon str
evtHandlerOnTaskBarIconEvent tbi $ f tbi | 249 | taskBarIcon
:: Icon ()
-> String
-> (TaskBarIcon () -> EventTaskBarIcon -> IO ())
-> IO ()
taskBarIcon icon str f = do
tbi <- taskBarIconCreate
_ <- taskBarIconSetIcon tbi icon str
evtHandlerOnTaskBarIconEvent tbi $ f tbi | 249 | taskBarIcon icon str f = do
tbi <- taskBarIconCreate
_ <- taskBarIconSetIcon tbi icon str
evtHandlerOnTaskBarIconEvent tbi $ f tbi | 142 | false | true | 0 | 13 | 64 | 100 | 44 | 56 | null | null |
knalbant/wrangell | main.hs | bsd-3-clause | evalAndPrint :: Env -> Table -> String -> IO ()
evalAndPrint env table expr = evalString env table expr >>= putStrLn | 116 | evalAndPrint :: Env -> Table -> String -> IO ()
evalAndPrint env table expr = evalString env table expr >>= putStrLn | 116 | evalAndPrint env table expr = evalString env table expr >>= putStrLn | 68 | false | true | 0 | 9 | 20 | 46 | 22 | 24 | null | null |
izgzhen/bbq-sg | src/BBQ/Component/Common.hs | mit | markDownExtract :: Text -> Text -> FilePath -> Maybe (FilePath, Text, Maybe UTCTime, Pandoc)
markDownExtract text gitDate path = do
pandoc@(Pandoc meta _) <- eitherToMaybe $ readMarkdown def (unpack text)
let title = pandocMetaToTitle meta
let name = takeFileName $ dropExtension path
let mDate = parseModifiedDate gitDate
return (name, title, mDate, pandoc) | 380 | markDownExtract :: Text -> Text -> FilePath -> Maybe (FilePath, Text, Maybe UTCTime, Pandoc)
markDownExtract text gitDate path = do
pandoc@(Pandoc meta _) <- eitherToMaybe $ readMarkdown def (unpack text)
let title = pandocMetaToTitle meta
let name = takeFileName $ dropExtension path
let mDate = parseModifiedDate gitDate
return (name, title, mDate, pandoc) | 379 | markDownExtract text gitDate path = do
pandoc@(Pandoc meta _) <- eitherToMaybe $ readMarkdown def (unpack text)
let title = pandocMetaToTitle meta
let name = takeFileName $ dropExtension path
let mDate = parseModifiedDate gitDate
return (name, title, mDate, pandoc) | 286 | false | true | 0 | 12 | 73 | 144 | 69 | 75 | null | null |
brendanhay/gogol | gogol-cloudkms/gen/Network/Google/Resource/CloudKMS/Projects/Locations/KeyRings/Create.hs | mpl-2.0 | -- | JSONP
plkrcCallback :: Lens' ProjectsLocationsKeyRingsCreate (Maybe Text)
plkrcCallback
= lens _plkrcCallback
(\ s a -> s{_plkrcCallback = a}) | 155 | plkrcCallback :: Lens' ProjectsLocationsKeyRingsCreate (Maybe Text)
plkrcCallback
= lens _plkrcCallback
(\ s a -> s{_plkrcCallback = a}) | 144 | plkrcCallback
= lens _plkrcCallback
(\ s a -> s{_plkrcCallback = a}) | 76 | true | true | 0 | 8 | 27 | 49 | 25 | 24 | null | null |
gcross/habit-of-fate | sources/library/HabitOfFate/Quests/DarkLord/Part2/Paladin.hs | agpl-3.0 | frost = [outcomes|
= Common Title =
Chilly
= Common Story =
The Dark Lord shoots a bold of frost at the Paladin.
= Common Question =
How quickly does the Paladin move?
= Success Choice =
Like a rabbit.
= Success Title =
The Cold Front Passes By
= Success Story =
Quickly, the Paladin jumps to the side and the bold of frost flies past him/her|.
= Failure Choice =
Like a turtle.
= Failure Title =
Frostbite
= Failure Story =
Unfortunately, the Paladin responds a little too slowly and bolt freezes him.
The Paladin struggles as hard as he/she| can, but is unable to move. He/she|
watches in horror as the Dark Lord approaches. The Dark Lord laughs as he floats
up to the frozen Paladin. When he is next to the Paladin he says "Good night!"
and smashes his head into the Paladin, causing the Paladin to shatter into a
thousand pieces.
= Shame =
Rest in pieces, |.
|] | 865 | frost = [outcomes|
= Common Title =
Chilly
= Common Story =
The Dark Lord shoots a bold of frost at the Paladin.
= Common Question =
How quickly does the Paladin move?
= Success Choice =
Like a rabbit.
= Success Title =
The Cold Front Passes By
= Success Story =
Quickly, the Paladin jumps to the side and the bold of frost flies past him/her|.
= Failure Choice =
Like a turtle.
= Failure Title =
Frostbite
= Failure Story =
Unfortunately, the Paladin responds a little too slowly and bolt freezes him.
The Paladin struggles as hard as he/she| can, but is unable to move. He/she|
watches in horror as the Dark Lord approaches. The Dark Lord laughs as he floats
up to the frozen Paladin. When he is next to the Paladin he says "Good night!"
and smashes his head into the Paladin, causing the Paladin to shatter into a
thousand pieces.
= Shame =
Rest in pieces, |.
|] | 865 | frost = [outcomes|
= Common Title =
Chilly
= Common Story =
The Dark Lord shoots a bold of frost at the Paladin.
= Common Question =
How quickly does the Paladin move?
= Success Choice =
Like a rabbit.
= Success Title =
The Cold Front Passes By
= Success Story =
Quickly, the Paladin jumps to the side and the bold of frost flies past him/her|.
= Failure Choice =
Like a turtle.
= Failure Title =
Frostbite
= Failure Story =
Unfortunately, the Paladin responds a little too slowly and bolt freezes him.
The Paladin struggles as hard as he/she| can, but is unable to move. He/she|
watches in horror as the Dark Lord approaches. The Dark Lord laughs as he floats
up to the frozen Paladin. When he is next to the Paladin he says "Good night!"
and smashes his head into the Paladin, causing the Paladin to shatter into a
thousand pieces.
= Shame =
Rest in pieces, |.
|] | 865 | false | false | 1 | 5 | 164 | 14 | 7 | 7 | null | null |
ekmett/text | tests/Tests/Properties.hs | bsd-2-clause | tl_lines = L.lines `eqP` (map unpackS . TL.lines) | 64 | tl_lines = L.lines `eqP` (map unpackS . TL.lines) | 64 | tl_lines = L.lines `eqP` (map unpackS . TL.lines) | 64 | false | false | 0 | 8 | 22 | 26 | 14 | 12 | null | null |
kadena-io/pact | src/Pact/Native.hs | bsd-3-clause | -- | Change of base for Text-based representations of integrals. Only bases
-- 2 through 16 are supported, for non-empty text of length <= 128
--
-- e.g.
-- -- hexadecimal to decimal
-- baseStrToInt 10 "abcdef123456" = 188900967593046
--
baseStrToInt :: Integer -> Text -> Either Text Integer
baseStrToInt base t =
if base <= 1 || base > 16
then Left $ "unsupported base: " `T.append` asString base
else
if T.null t
then Left $ "empty text: " `T.append` asString t
else foldM go 0 $ T.unpack t
where
go :: Integer -> Char -> Either Text Integer
go acc c' =
let val = fromIntegral . Char.digitToInt $ c'
in if val < base
then pure $ base * acc + val
else Left $ "character '" <> T.singleton c' <>
"' is out of range for base " <> tShow base <> ": " <> t
| 831 | baseStrToInt :: Integer -> Text -> Either Text Integer
baseStrToInt base t =
if base <= 1 || base > 16
then Left $ "unsupported base: " `T.append` asString base
else
if T.null t
then Left $ "empty text: " `T.append` asString t
else foldM go 0 $ T.unpack t
where
go :: Integer -> Char -> Either Text Integer
go acc c' =
let val = fromIntegral . Char.digitToInt $ c'
in if val < base
then pure $ base * acc + val
else Left $ "character '" <> T.singleton c' <>
"' is out of range for base " <> tShow base <> ": " <> t
| 589 | baseStrToInt base t =
if base <= 1 || base > 16
then Left $ "unsupported base: " `T.append` asString base
else
if T.null t
then Left $ "empty text: " `T.append` asString t
else foldM go 0 $ T.unpack t
where
go :: Integer -> Char -> Either Text Integer
go acc c' =
let val = fromIntegral . Char.digitToInt $ c'
in if val < base
then pure $ base * acc + val
else Left $ "character '" <> T.singleton c' <>
"' is out of range for base " <> tShow base <> ": " <> t
| 534 | true | true | 0 | 14 | 228 | 221 | 114 | 107 | null | null |
davidzhulijun/TAM | RegisterMachine/Models/CM1.hs | bsd-3-clause | trans Halt = id | 19 | trans Halt = id | 19 | trans Halt = id | 19 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
andorp/hs-bluesnap | src/Bluesnap/API/Request.hs | gpl-3.0 | elementParameter :: XMLParser Parameter
elementParameter = parseSchemaType "parameter" | 86 | elementParameter :: XMLParser Parameter
elementParameter = parseSchemaType "parameter" | 86 | elementParameter = parseSchemaType "parameter" | 46 | false | true | 0 | 5 | 7 | 17 | 8 | 9 | null | null |
tamasgal/haskell_exercises | Real_World_Haskell/ch04/ch04.exercises.hs | mit | asIntFold :: String -> Maybe Int
asIntFold "" = Nothing | 55 | asIntFold :: String -> Maybe Int
asIntFold "" = Nothing | 55 | asIntFold "" = Nothing | 22 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
uduki/hsQt | Qtc/Gui/QGradient.hs | bsd-2-clause | coordinateMode :: QGradient a -> (()) -> IO (CoordinateMode)
coordinateMode x0 ()
= withQEnumResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QGradient_coordinateMode cobj_x0 | 179 | coordinateMode :: QGradient a -> (()) -> IO (CoordinateMode)
coordinateMode x0 ()
= withQEnumResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QGradient_coordinateMode cobj_x0 | 179 | coordinateMode x0 ()
= withQEnumResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QGradient_coordinateMode cobj_x0 | 118 | false | true | 0 | 8 | 31 | 59 | 29 | 30 | null | null |
NickAger/LearningHaskell | HaskellProgrammingFromFirstPrinciples/Chapter7.hsproj/Chapter7.hs | mit | roundTrip3 :: (Show a, Read b) => a -> b
roundTrip3 = read . show | 65 | roundTrip3 :: (Show a, Read b) => a -> b
roundTrip3 = read . show | 65 | roundTrip3 = read . show | 24 | false | true | 1 | 8 | 14 | 42 | 19 | 23 | null | null |
SAdams601/ParRegexSearch | test/fst-0.9.0.1/FST/TransducerInterface.hs | mit | numberOfStates :: Ord a => Transducer a -> Int
numberOfStates transducer = length $ states transducer | 101 | numberOfStates :: Ord a => Transducer a -> Int
numberOfStates transducer = length $ states transducer | 101 | numberOfStates transducer = length $ states transducer | 54 | false | true | 0 | 7 | 15 | 35 | 16 | 19 | null | null |
SeanRBurton/aeson | Data/Aeson/TH.hs | bsd-3-clause | -- A single constructor is directly encoded. The constructor itself may be
-- forgotten.
consToValue opts [con] = do
value <- newName "value"
lam1E (varP value) $ caseE (varE value) [argsToValue opts False con] | 218 | consToValue opts [con] = do
value <- newName "value"
lam1E (varP value) $ caseE (varE value) [argsToValue opts False con] | 129 | consToValue opts [con] = do
value <- newName "value"
lam1E (varP value) $ caseE (varE value) [argsToValue opts False con] | 129 | true | false | 0 | 10 | 41 | 63 | 30 | 33 | null | null |
sol/wai | warp/test/RequestSpec.hs | mit | headerLinesList' orig = do
ref <- newIORef orig
let src = do
x <- readIORef ref
case x of
[] -> return S.empty
y:z -> do
writeIORef ref z
return y
src' <- mkSource src
res <- headerLines src'
return (res, src') | 326 | headerLinesList' orig = do
ref <- newIORef orig
let src = do
x <- readIORef ref
case x of
[] -> return S.empty
y:z -> do
writeIORef ref z
return y
src' <- mkSource src
res <- headerLines src'
return (res, src') | 326 | headerLinesList' orig = do
ref <- newIORef orig
let src = do
x <- readIORef ref
case x of
[] -> return S.empty
y:z -> do
writeIORef ref z
return y
src' <- mkSource src
res <- headerLines src'
return (res, src') | 326 | false | false | 0 | 17 | 157 | 114 | 49 | 65 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Reports/Update.hs | mpl-2.0 | -- | The ID of the report.
ruReportId :: Lens' ReportsUpdate Int64
ruReportId
= lens _ruReportId (\ s a -> s{_ruReportId = a}) .
_Coerce | 144 | ruReportId :: Lens' ReportsUpdate Int64
ruReportId
= lens _ruReportId (\ s a -> s{_ruReportId = a}) .
_Coerce | 117 | ruReportId
= lens _ruReportId (\ s a -> s{_ruReportId = a}) .
_Coerce | 77 | true | true | 0 | 10 | 32 | 46 | 24 | 22 | null | null |
rahulmutt/ghcvm | compiler/Eta/Types/TyCon.hs | bsd-3-clause | tyConParent _ = NoParentTyCon | 64 | tyConParent _ = NoParentTyCon | 64 | tyConParent _ = NoParentTyCon | 64 | false | false | 0 | 4 | 38 | 10 | 4 | 6 | null | null |
comonoidial/ALFIN | RunTest.hs | mit | testAA :: TestCase -> IO ()
testAA (m,(f,_)) = do
xs <- L.readFile m
let p = parseModule "Test" xs
case p of
Left e -> putStrLn $ show e
Right m -> mapM_ (putStrLn . show) $ analyseMod $ preOptimM f $ fromCoreMod $ lowerMod $ cleanMod $ convertMod m
-- shows a testcase converted to pilgrim assembly | 314 | testAA :: TestCase -> IO ()
testAA (m,(f,_)) = do
xs <- L.readFile m
let p = parseModule "Test" xs
case p of
Left e -> putStrLn $ show e
Right m -> mapM_ (putStrLn . show) $ analyseMod $ preOptimM f $ fromCoreMod $ lowerMod $ cleanMod $ convertMod m
-- shows a testcase converted to pilgrim assembly | 314 | testAA (m,(f,_)) = do
xs <- L.readFile m
let p = parseModule "Test" xs
case p of
Left e -> putStrLn $ show e
Right m -> mapM_ (putStrLn . show) $ analyseMod $ preOptimM f $ fromCoreMod $ lowerMod $ cleanMod $ convertMod m
-- shows a testcase converted to pilgrim assembly | 286 | false | true | 0 | 18 | 73 | 134 | 64 | 70 | null | null |
haskellbr/missingh | missingh-all/testsrc/Listtest.hs | mit | test_fixedWidth =
let f inplen inplist exp = TestLabel ((show inplen) ++ ", " ++
(show inplist)) $ TestCase $
wholeMap (fixedWidth inplen) inplist @=? exp in
[
f [] ([]::[Int]) ([]::[[Int]])
,f [1] [5] [[5]]
,f [1] [3, 4, 5, 6] [[3], [4, 5, 6]]
,f [1] ([]::[Int]) ([]::[[Int]])
,f [2] [3] [[3]]
,f [2] [3, 4, 5, 6] [[3, 4], [5, 6]]
,f [2] [3, 4, 5] [[3, 4], [5]]
,f [1, 2, 3] "1234567890" ["1","23","456","7890"]
,f (repeat 2) "123456789" ["12","34","56","78","9"]
,f [] "123456789" ["123456789"]
,f [5, 3, 6, 1] "Hello, This is a test."
["Hello",", T","his is"," ","a test."]
] | 777 | test_fixedWidth =
let f inplen inplist exp = TestLabel ((show inplen) ++ ", " ++
(show inplist)) $ TestCase $
wholeMap (fixedWidth inplen) inplist @=? exp in
[
f [] ([]::[Int]) ([]::[[Int]])
,f [1] [5] [[5]]
,f [1] [3, 4, 5, 6] [[3], [4, 5, 6]]
,f [1] ([]::[Int]) ([]::[[Int]])
,f [2] [3] [[3]]
,f [2] [3, 4, 5, 6] [[3, 4], [5, 6]]
,f [2] [3, 4, 5] [[3, 4], [5]]
,f [1, 2, 3] "1234567890" ["1","23","456","7890"]
,f (repeat 2) "123456789" ["12","34","56","78","9"]
,f [] "123456789" ["123456789"]
,f [5, 3, 6, 1] "Hello, This is a test."
["Hello",", T","his is"," ","a test."]
] | 777 | test_fixedWidth =
let f inplen inplist exp = TestLabel ((show inplen) ++ ", " ++
(show inplist)) $ TestCase $
wholeMap (fixedWidth inplen) inplist @=? exp in
[
f [] ([]::[Int]) ([]::[[Int]])
,f [1] [5] [[5]]
,f [1] [3, 4, 5, 6] [[3], [4, 5, 6]]
,f [1] ([]::[Int]) ([]::[[Int]])
,f [2] [3] [[3]]
,f [2] [3, 4, 5, 6] [[3, 4], [5, 6]]
,f [2] [3, 4, 5] [[3, 4], [5]]
,f [1, 2, 3] "1234567890" ["1","23","456","7890"]
,f (repeat 2) "123456789" ["12","34","56","78","9"]
,f [] "123456789" ["123456789"]
,f [5, 3, 6, 1] "Hello, This is a test."
["Hello",", T","his is"," ","a test."]
] | 777 | false | false | 0 | 17 | 301 | 429 | 251 | 178 | null | null |
DanielSchiavini/ampersand | src/Database/Design/Ampersand/Input/ADL1/ParsingLib.hs | gpl-3.0 | pIsThere :: AmpParser a -> AmpParser Bool
pIsThere p = (True <$ p) `opt` False | 78 | pIsThere :: AmpParser a -> AmpParser Bool
pIsThere p = (True <$ p) `opt` False | 78 | pIsThere p = (True <$ p) `opt` False | 36 | false | true | 0 | 7 | 14 | 37 | 19 | 18 | null | null |
NicolasDP/hit | Data/Git/Storage/Pack.hs | bsd-3-clause | -- | Enumerate the pack refs available in this repository.
packEnumerate repoPath = map onlyHash . filter isPackFile . map (Rules.encodeString Rules.posix . filename) <$> listDirectory (repoPath </> "objects" </> "pack")
where
isPackFile :: String -> Bool
isPackFile x = ".pack" `isSuffixOf` x
onlyHash = fromHexString . takebut 5 . drop 5
takebut n l = take (length l - n) l
-- | open a pack | 427 | packEnumerate repoPath = map onlyHash . filter isPackFile . map (Rules.encodeString Rules.posix . filename) <$> listDirectory (repoPath </> "objects" </> "pack")
where
isPackFile :: String -> Bool
isPackFile x = ".pack" `isSuffixOf` x
onlyHash = fromHexString . takebut 5 . drop 5
takebut n l = take (length l - n) l
-- | open a pack | 368 | packEnumerate repoPath = map onlyHash . filter isPackFile . map (Rules.encodeString Rules.posix . filename) <$> listDirectory (repoPath </> "objects" </> "pack")
where
isPackFile :: String -> Bool
isPackFile x = ".pack" `isSuffixOf` x
onlyHash = fromHexString . takebut 5 . drop 5
takebut n l = take (length l - n) l
-- | open a pack | 368 | true | false | 4 | 11 | 101 | 131 | 64 | 67 | null | null |
momomimachli/Hedsql | tests/Database/Hedsql/Statements/Select.hs | gpl-3.0 | --------------------
-- FROM
--------------------
-- Joins
--------------------
-- | > SELECT * FROM "People" CROSS JOIN "Countries"
fromCrossJoin :: Select [[Undefined]] dbVendor
fromCrossJoin =
select (//*)
|> from ("People" `crossJoin` "Countries")
|> end | 275 | fromCrossJoin :: Select [[Undefined]] dbVendor
fromCrossJoin =
select (//*)
|> from ("People" `crossJoin` "Countries")
|> end | 140 | fromCrossJoin =
select (//*)
|> from ("People" `crossJoin` "Countries")
|> end | 93 | true | true | 5 | 9 | 49 | 63 | 35 | 28 | null | null |
fpco/binary | tests/QC.hs | bsd-3-clause | tests :: [Test]
tests =
[ testGroup "Utils"
[ testProperty "refragment id" (p prop_refragment)
, testProperty "refragment invariant" (p prop_refragment_inv)
]
, testGroup "Boundaries"
[ testProperty "read to much" (p (prop_readTooMuch :: B Word8))
, testProperty "read negative length" (p (prop_getByteString_negative :: T Int))
, -- Arbitrary test input
let testInput :: [Int] ; testInput = [0 .. 10]
in testProperty "look-ahead independent of chunking" (p (prop_lookAheadIndepOfChunking testInput))
]
, testGroup "Partial"
[ testProperty "partial" (p prop_partial)
, testProperty "fail" (p prop_fail)
, testProperty "bytesRead" (p prop_bytesRead)
, testProperty "partial only once" (p prop_partialOnlyOnce)
]
, testGroup "Model"
Action.tests
, testGroup "Primitives"
[ testProperty "Word16be" (p prop_Word16be)
, testProperty "Word16le" (p prop_Word16le)
, testProperty "Word16host" (p prop_Word16host)
, testProperty "Word32be" (p prop_Word32be)
, testProperty "Word32le" (p prop_Word32le)
, testProperty "Word32host" (p prop_Word32host)
, testProperty "Word64be" (p prop_Word64be)
, testProperty "Word64le" (p prop_Word64le)
, testProperty "Word64host" (p prop_Word64host)
, testProperty "Wordhost" (p prop_Wordhost)
]
, testGroup "String utils"
[ testProperty "getLazyByteString" prop_getLazyByteString
, testProperty "getLazyByteStringNul" prop_getLazyByteStringNul
, testProperty "getLazyByteStringNul No Null" prop_getLazyByteStringNul_noNul
, testProperty "getRemainingLazyByteString" prop_getRemainingLazyByteString
]
, testGroup "Using Binary class, refragmented ByteString" $ map (uncurry testProperty)
[ ("()", p (test :: T () ))
, ("Bool", p (test :: T Bool ))
, ("Ordering", p (test :: T Ordering ))
, ("Ratio Int", p (test :: T (Ratio Int) ))
, ("Word8", p (test :: T Word8 ))
, ("Word16", p (test :: T Word16 ))
, ("Word32", p (test :: T Word32 ))
, ("Word64", p (test :: T Word64 ))
, ("Int8", p (test :: T Int8 ))
, ("Int16", p (test :: T Int16 ))
, ("Int32", p (test :: T Int32 ))
, ("Int64", p (test :: T Int64 ))
, ("Word", p (test :: T Word ))
, ("Int", p (test :: T Int ))
, ("Integer", p (test :: T Integer ))
#ifdef HAS_NATURAL
, ("Natural", (prop_test_Natural :: Property ))
#endif
, ("Float", p (test :: T Float ))
, ("Double", p (test :: T Double ))
, ("Char", p (test :: T Char ))
, ("[()]", p (test :: T [()] ))
, ("[Word8]", p (test :: T [Word8] ))
, ("[Word32]", p (test :: T [Word32] ))
, ("[Word64]", p (test :: T [Word64] ))
, ("[Word]", p (test :: T [Word] ))
, ("[Int]", p (test :: T [Int] ))
, ("[Integer]", p (test :: T [Integer] ))
, ("String", p (test :: T String ))
, ("((), ())", p (test :: T ((), ()) ))
, ("(Word8, Word32)", p (test :: T (Word8, Word32) ))
, ("(Int8, Int32)", p (test :: T (Int8, Int32) ))
, ("(Int32, [Int])", p (test :: T (Int32, [Int]) ))
, ("Maybe Int8", p (test :: T (Maybe Int8) ))
, ("Either Int8 Int16", p (test :: T (Either Int8 Int16) ))
, ("(Int, ByteString)",
p (test :: T (Int, B.ByteString) ))
, ("[(Int, ByteString)]",
p (test :: T [(Int, B.ByteString)] ))
, ("(Maybe Int64, Bool, [Int])",
p (test :: T (Maybe Int64, Bool, [Int])))
, ("(Maybe Word8, Bool, [Int], Either Bool Word8)",
p (test :: T (Maybe Word8, Bool, [Int], Either Bool Word8) ))
, ("(Maybe Word16, Bool, [Int], Either Bool Word16, Int)",
p (test :: T (Maybe Word16, Bool, [Int], Either Bool Word16, Int) ))
, ("(Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int)))
, ("(Int,Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int,Int)))
, ("(Int,Int,Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int,Int,Int)))
, ("(Int,Int,Int,Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int,Int,Int,Int)))
, ("(Int,Int,Int,Int,Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int,Int,Int,Int,Int)))
, ("B.ByteString", p (test :: T B.ByteString ))
, ("L.ByteString", p (test :: T L.ByteString ))
]
, testGroup "Invariants" $ map (uncurry testProperty)
[ ("B.ByteString invariant", p (prop_invariant :: B B.ByteString ))
, ("[B.ByteString] invariant", p (prop_invariant :: B [B.ByteString] ))
, ("L.ByteString invariant", p (prop_invariant :: B L.ByteString ))
, ("[L.ByteString] invariant", p (prop_invariant :: B [L.ByteString] ))
]
] | 6,245 | tests :: [Test]
tests =
[ testGroup "Utils"
[ testProperty "refragment id" (p prop_refragment)
, testProperty "refragment invariant" (p prop_refragment_inv)
]
, testGroup "Boundaries"
[ testProperty "read to much" (p (prop_readTooMuch :: B Word8))
, testProperty "read negative length" (p (prop_getByteString_negative :: T Int))
, -- Arbitrary test input
let testInput :: [Int] ; testInput = [0 .. 10]
in testProperty "look-ahead independent of chunking" (p (prop_lookAheadIndepOfChunking testInput))
]
, testGroup "Partial"
[ testProperty "partial" (p prop_partial)
, testProperty "fail" (p prop_fail)
, testProperty "bytesRead" (p prop_bytesRead)
, testProperty "partial only once" (p prop_partialOnlyOnce)
]
, testGroup "Model"
Action.tests
, testGroup "Primitives"
[ testProperty "Word16be" (p prop_Word16be)
, testProperty "Word16le" (p prop_Word16le)
, testProperty "Word16host" (p prop_Word16host)
, testProperty "Word32be" (p prop_Word32be)
, testProperty "Word32le" (p prop_Word32le)
, testProperty "Word32host" (p prop_Word32host)
, testProperty "Word64be" (p prop_Word64be)
, testProperty "Word64le" (p prop_Word64le)
, testProperty "Word64host" (p prop_Word64host)
, testProperty "Wordhost" (p prop_Wordhost)
]
, testGroup "String utils"
[ testProperty "getLazyByteString" prop_getLazyByteString
, testProperty "getLazyByteStringNul" prop_getLazyByteStringNul
, testProperty "getLazyByteStringNul No Null" prop_getLazyByteStringNul_noNul
, testProperty "getRemainingLazyByteString" prop_getRemainingLazyByteString
]
, testGroup "Using Binary class, refragmented ByteString" $ map (uncurry testProperty)
[ ("()", p (test :: T () ))
, ("Bool", p (test :: T Bool ))
, ("Ordering", p (test :: T Ordering ))
, ("Ratio Int", p (test :: T (Ratio Int) ))
, ("Word8", p (test :: T Word8 ))
, ("Word16", p (test :: T Word16 ))
, ("Word32", p (test :: T Word32 ))
, ("Word64", p (test :: T Word64 ))
, ("Int8", p (test :: T Int8 ))
, ("Int16", p (test :: T Int16 ))
, ("Int32", p (test :: T Int32 ))
, ("Int64", p (test :: T Int64 ))
, ("Word", p (test :: T Word ))
, ("Int", p (test :: T Int ))
, ("Integer", p (test :: T Integer ))
#ifdef HAS_NATURAL
, ("Natural", (prop_test_Natural :: Property ))
#endif
, ("Float", p (test :: T Float ))
, ("Double", p (test :: T Double ))
, ("Char", p (test :: T Char ))
, ("[()]", p (test :: T [()] ))
, ("[Word8]", p (test :: T [Word8] ))
, ("[Word32]", p (test :: T [Word32] ))
, ("[Word64]", p (test :: T [Word64] ))
, ("[Word]", p (test :: T [Word] ))
, ("[Int]", p (test :: T [Int] ))
, ("[Integer]", p (test :: T [Integer] ))
, ("String", p (test :: T String ))
, ("((), ())", p (test :: T ((), ()) ))
, ("(Word8, Word32)", p (test :: T (Word8, Word32) ))
, ("(Int8, Int32)", p (test :: T (Int8, Int32) ))
, ("(Int32, [Int])", p (test :: T (Int32, [Int]) ))
, ("Maybe Int8", p (test :: T (Maybe Int8) ))
, ("Either Int8 Int16", p (test :: T (Either Int8 Int16) ))
, ("(Int, ByteString)",
p (test :: T (Int, B.ByteString) ))
, ("[(Int, ByteString)]",
p (test :: T [(Int, B.ByteString)] ))
, ("(Maybe Int64, Bool, [Int])",
p (test :: T (Maybe Int64, Bool, [Int])))
, ("(Maybe Word8, Bool, [Int], Either Bool Word8)",
p (test :: T (Maybe Word8, Bool, [Int], Either Bool Word8) ))
, ("(Maybe Word16, Bool, [Int], Either Bool Word16, Int)",
p (test :: T (Maybe Word16, Bool, [Int], Either Bool Word16, Int) ))
, ("(Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int)))
, ("(Int,Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int,Int)))
, ("(Int,Int,Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int,Int,Int)))
, ("(Int,Int,Int,Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int,Int,Int,Int)))
, ("(Int,Int,Int,Int,Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int,Int,Int,Int,Int)))
, ("B.ByteString", p (test :: T B.ByteString ))
, ("L.ByteString", p (test :: T L.ByteString ))
]
, testGroup "Invariants" $ map (uncurry testProperty)
[ ("B.ByteString invariant", p (prop_invariant :: B B.ByteString ))
, ("[B.ByteString] invariant", p (prop_invariant :: B [B.ByteString] ))
, ("L.ByteString invariant", p (prop_invariant :: B L.ByteString ))
, ("[L.ByteString] invariant", p (prop_invariant :: B [L.ByteString] ))
]
] | 6,245 | tests =
[ testGroup "Utils"
[ testProperty "refragment id" (p prop_refragment)
, testProperty "refragment invariant" (p prop_refragment_inv)
]
, testGroup "Boundaries"
[ testProperty "read to much" (p (prop_readTooMuch :: B Word8))
, testProperty "read negative length" (p (prop_getByteString_negative :: T Int))
, -- Arbitrary test input
let testInput :: [Int] ; testInput = [0 .. 10]
in testProperty "look-ahead independent of chunking" (p (prop_lookAheadIndepOfChunking testInput))
]
, testGroup "Partial"
[ testProperty "partial" (p prop_partial)
, testProperty "fail" (p prop_fail)
, testProperty "bytesRead" (p prop_bytesRead)
, testProperty "partial only once" (p prop_partialOnlyOnce)
]
, testGroup "Model"
Action.tests
, testGroup "Primitives"
[ testProperty "Word16be" (p prop_Word16be)
, testProperty "Word16le" (p prop_Word16le)
, testProperty "Word16host" (p prop_Word16host)
, testProperty "Word32be" (p prop_Word32be)
, testProperty "Word32le" (p prop_Word32le)
, testProperty "Word32host" (p prop_Word32host)
, testProperty "Word64be" (p prop_Word64be)
, testProperty "Word64le" (p prop_Word64le)
, testProperty "Word64host" (p prop_Word64host)
, testProperty "Wordhost" (p prop_Wordhost)
]
, testGroup "String utils"
[ testProperty "getLazyByteString" prop_getLazyByteString
, testProperty "getLazyByteStringNul" prop_getLazyByteStringNul
, testProperty "getLazyByteStringNul No Null" prop_getLazyByteStringNul_noNul
, testProperty "getRemainingLazyByteString" prop_getRemainingLazyByteString
]
, testGroup "Using Binary class, refragmented ByteString" $ map (uncurry testProperty)
[ ("()", p (test :: T () ))
, ("Bool", p (test :: T Bool ))
, ("Ordering", p (test :: T Ordering ))
, ("Ratio Int", p (test :: T (Ratio Int) ))
, ("Word8", p (test :: T Word8 ))
, ("Word16", p (test :: T Word16 ))
, ("Word32", p (test :: T Word32 ))
, ("Word64", p (test :: T Word64 ))
, ("Int8", p (test :: T Int8 ))
, ("Int16", p (test :: T Int16 ))
, ("Int32", p (test :: T Int32 ))
, ("Int64", p (test :: T Int64 ))
, ("Word", p (test :: T Word ))
, ("Int", p (test :: T Int ))
, ("Integer", p (test :: T Integer ))
#ifdef HAS_NATURAL
, ("Natural", (prop_test_Natural :: Property ))
#endif
, ("Float", p (test :: T Float ))
, ("Double", p (test :: T Double ))
, ("Char", p (test :: T Char ))
, ("[()]", p (test :: T [()] ))
, ("[Word8]", p (test :: T [Word8] ))
, ("[Word32]", p (test :: T [Word32] ))
, ("[Word64]", p (test :: T [Word64] ))
, ("[Word]", p (test :: T [Word] ))
, ("[Int]", p (test :: T [Int] ))
, ("[Integer]", p (test :: T [Integer] ))
, ("String", p (test :: T String ))
, ("((), ())", p (test :: T ((), ()) ))
, ("(Word8, Word32)", p (test :: T (Word8, Word32) ))
, ("(Int8, Int32)", p (test :: T (Int8, Int32) ))
, ("(Int32, [Int])", p (test :: T (Int32, [Int]) ))
, ("Maybe Int8", p (test :: T (Maybe Int8) ))
, ("Either Int8 Int16", p (test :: T (Either Int8 Int16) ))
, ("(Int, ByteString)",
p (test :: T (Int, B.ByteString) ))
, ("[(Int, ByteString)]",
p (test :: T [(Int, B.ByteString)] ))
, ("(Maybe Int64, Bool, [Int])",
p (test :: T (Maybe Int64, Bool, [Int])))
, ("(Maybe Word8, Bool, [Int], Either Bool Word8)",
p (test :: T (Maybe Word8, Bool, [Int], Either Bool Word8) ))
, ("(Maybe Word16, Bool, [Int], Either Bool Word16, Int)",
p (test :: T (Maybe Word16, Bool, [Int], Either Bool Word16, Int) ))
, ("(Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int)))
, ("(Int,Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int,Int)))
, ("(Int,Int,Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int,Int,Int)))
, ("(Int,Int,Int,Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int,Int,Int,Int)))
, ("(Int,Int,Int,Int,Int,Int,Int,Int,Int,Int)",
p (test :: T (Int,Int,Int,Int,Int,Int,Int,Int,Int,Int)))
, ("B.ByteString", p (test :: T B.ByteString ))
, ("L.ByteString", p (test :: T L.ByteString ))
]
, testGroup "Invariants" $ map (uncurry testProperty)
[ ("B.ByteString invariant", p (prop_invariant :: B B.ByteString ))
, ("[B.ByteString] invariant", p (prop_invariant :: B [B.ByteString] ))
, ("L.ByteString invariant", p (prop_invariant :: B L.ByteString ))
, ("[L.ByteString] invariant", p (prop_invariant :: B [L.ByteString] ))
]
] | 6,229 | false | true | 0 | 16 | 2,652 | 1,784 | 1,005 | 779 | null | null |
wuerges/solutions_for_graph_problems | app/Prob1119.hs | bsd-3-clause | decomp :: V -> G -> [(V, Double)]
decomp v g = vertexM g ! v | 60 | decomp :: V -> G -> [(V, Double)]
decomp v g = vertexM g ! v | 60 | decomp v g = vertexM g ! v | 26 | false | true | 0 | 8 | 15 | 40 | 21 | 19 | null | null |
crvs/scythe | src/Math/CGraphs.hs | bsd-3-clause | markCrit :: Eq a => CGraph a -> CVertex a -> CGraph a
markCrit g v = CGraph ((vertices g \\ [v]) ++ [CVert (label v) True]) (edges g) | 133 | markCrit :: Eq a => CGraph a -> CVertex a -> CGraph a
markCrit g v = CGraph ((vertices g \\ [v]) ++ [CVert (label v) True]) (edges g) | 133 | markCrit g v = CGraph ((vertices g \\ [v]) ++ [CVert (label v) True]) (edges g) | 79 | false | true | 0 | 11 | 28 | 85 | 41 | 44 | null | null |
jstolarek/lattice-structure-hs | tests/Signal/Wavelet/ReferenceITest.hs | bsd-3-clause | propIDWTEval1LikeList1 :: DwtInputList -> Bool
propIDWTEval1LikeList1 (DwtInputList (ls, sig)) =
L1.idwt ls sig =~ E1.idwt ls sig | 133 | propIDWTEval1LikeList1 :: DwtInputList -> Bool
propIDWTEval1LikeList1 (DwtInputList (ls, sig)) =
L1.idwt ls sig =~ E1.idwt ls sig | 133 | propIDWTEval1LikeList1 (DwtInputList (ls, sig)) =
L1.idwt ls sig =~ E1.idwt ls sig | 86 | false | true | 0 | 8 | 20 | 48 | 24 | 24 | null | null |
tomjaguarpaw/postgresql-simple | src/Database/PostgreSQL/Simple.hs | bsd-3-clause | foldWithOptions_ :: (FromRow r) =>
FoldOptions
-> Connection
-> Query -- ^ Query.
-> a -- ^ Initial state for result consumer.
-> (a -> r -> IO a) -- ^ Result consumer.
-> IO a
foldWithOptions_ opts conn query' a f = doFold opts fromRow conn query' query' a f | 393 | foldWithOptions_ :: (FromRow r) =>
FoldOptions
-> Connection
-> Query -- ^ Query.
-> a -- ^ Initial state for result consumer.
-> (a -> r -> IO a) -- ^ Result consumer.
-> IO a
foldWithOptions_ opts conn query' a f = doFold opts fromRow conn query' query' a f | 393 | foldWithOptions_ opts conn query' a f = doFold opts fromRow conn query' query' a f | 82 | false | true | 0 | 14 | 184 | 86 | 44 | 42 | null | null |
tulcod/haskell-xkbcommon | Utils.hs | mit | replace :: Eq a => [a] -> [a] -> [a] -> [a]
replace a b = intercalate b . splitOn a | 83 | replace :: Eq a => [a] -> [a] -> [a] -> [a]
replace a b = intercalate b . splitOn a | 83 | replace a b = intercalate b . splitOn a | 39 | false | true | 0 | 9 | 20 | 57 | 29 | 28 | null | null |
sdiehl/ghc | compiler/llvmGen/LlvmCodeGen/Base.hs | bsd-3-clause | liftIO :: IO a -> LlvmM a
liftIO m = LlvmM $ \env -> do x <- m
return (x, env)
-- | Get initial Llvm environment. | 144 | liftIO :: IO a -> LlvmM a
liftIO m = LlvmM $ \env -> do x <- m
return (x, env)
-- | Get initial Llvm environment. | 144 | liftIO m = LlvmM $ \env -> do x <- m
return (x, env)
-- | Get initial Llvm environment. | 118 | false | true | 0 | 11 | 57 | 58 | 27 | 31 | null | null |
arjantop/gifter | test/Gifter/Giveaway/ParserSpec.hs | bsd-3-clause | loadXcomDlcMissingBaseGame :: IO Cursor
loadXcomDlcMissingBaseGame =
loadHtml "test/files/XcomEliteSoldierPackMissingBaseGame.html" | 139 | loadXcomDlcMissingBaseGame :: IO Cursor
loadXcomDlcMissingBaseGame =
loadHtml "test/files/XcomEliteSoldierPackMissingBaseGame.html" | 139 | loadXcomDlcMissingBaseGame =
loadHtml "test/files/XcomEliteSoldierPackMissingBaseGame.html" | 99 | false | true | 0 | 5 | 15 | 17 | 8 | 9 | null | null |
na4zagin3/uhim-dict | src/Language/UHIM/Japanese/Verb.hs | gpl-3.0 | stemRepresentive StemB = "バ" | 28 | stemRepresentive StemB = "バ" | 28 | stemRepresentive StemB = "バ" | 28 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
dgvncsz0f/nws | src/Jerimum/Storage/PostgreSQL/Service.hs | bsd-3-clause | saveSchemas ::
Context
-> Event.EventSchema
-> SqlMonad (M.Map Version UUID, M.Map Version UUID)
saveSchemas ctx schema = do
let cached = knownSchemas ctx
allSchemas = map fst (Event.event schema)
toSave = schemasToSave cached allSchemas
saved <- M.fromList <$> mapM (saveSchema ctx) toSave
pure (saved, M.union cached saved) | 352 | saveSchemas ::
Context
-> Event.EventSchema
-> SqlMonad (M.Map Version UUID, M.Map Version UUID)
saveSchemas ctx schema = do
let cached = knownSchemas ctx
allSchemas = map fst (Event.event schema)
toSave = schemasToSave cached allSchemas
saved <- M.fromList <$> mapM (saveSchema ctx) toSave
pure (saved, M.union cached saved) | 352 | saveSchemas ctx schema = do
let cached = knownSchemas ctx
allSchemas = map fst (Event.event schema)
toSave = schemasToSave cached allSchemas
saved <- M.fromList <$> mapM (saveSchema ctx) toSave
pure (saved, M.union cached saved) | 246 | false | true | 0 | 14 | 73 | 137 | 64 | 73 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.