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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jhartikainen/hs-language-php | Evaluator.hs | bsd-3-clause | exprVal _ = error "Value that are not literals must be evaluated first" | 71 | exprVal _ = error "Value that are not literals must be evaluated first" | 71 | exprVal _ = error "Value that are not literals must be evaluated first" | 71 | false | false | 0 | 5 | 12 | 12 | 5 | 7 | null | null |
Michaelt293/Lipid-Haskell | src/Lipid/Parsers/UnknownSn/Glycerophospholipid.hs | gpl-3.0 | pip2Delta :: QuasiQuoter
pip2Delta = qQuoter pip2DeltaP | 55 | pip2Delta :: QuasiQuoter
pip2Delta = qQuoter pip2DeltaP | 55 | pip2Delta = qQuoter pip2DeltaP | 30 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
anton-dessiatov/stack | src/Stack/Ghci.hs | bsd-3-clause | parseMainIsTargets :: HasEnvConfig env => BuildOptsCLI -> Maybe Text -> RIO env (Maybe (Map PackageName Target))
parseMainIsTargets buildOptsCLI mtarget = forM mtarget $ \target -> do
(_,_,targets) <- parseTargets AllowNoTargets buildOptsCLI
{ boptsCLITargets = [target] }
return targets | 306 | parseMainIsTargets :: HasEnvConfig env => BuildOptsCLI -> Maybe Text -> RIO env (Maybe (Map PackageName Target))
parseMainIsTargets buildOptsCLI mtarget = forM mtarget $ \target -> do
(_,_,targets) <- parseTargets AllowNoTargets buildOptsCLI
{ boptsCLITargets = [target] }
return targets | 306 | parseMainIsTargets buildOptsCLI mtarget = forM mtarget $ \target -> do
(_,_,targets) <- parseTargets AllowNoTargets buildOptsCLI
{ boptsCLITargets = [target] }
return targets | 193 | false | true | 0 | 13 | 56 | 103 | 51 | 52 | null | null |
jff/TeLLer | src/Arbitrary.hs | gpl-3.0 | as :: Gen a -> (a -> b) -> Gen b
as = flip fmap | 47 | as :: Gen a -> (a -> b) -> Gen b
as = flip fmap | 47 | as = flip fmap | 14 | false | true | 0 | 9 | 14 | 41 | 18 | 23 | null | null |
RobinKrom/interactive-brokers | library/API/IB/Util.hs | bsd-3-clause | stringToMaybe :: String -> Maybe String
stringToMaybe s
| null s = Nothing
| otherwise = Just s | 99 | stringToMaybe :: String -> Maybe String
stringToMaybe s
| null s = Nothing
| otherwise = Just s | 99 | stringToMaybe s
| null s = Nothing
| otherwise = Just s | 59 | false | true | 1 | 8 | 21 | 40 | 18 | 22 | null | null |
Taketrung/HsPredictor | tests/TestSuites/HashCSVSpec.hs | mit | spec = fromHUnitTest $ TestList [
TestLabel ">>genHash" test_genHash
, TestLabel ">>checkHash" test_checkHash
] | 117 | spec = fromHUnitTest $ TestList [
TestLabel ">>genHash" test_genHash
, TestLabel ">>checkHash" test_checkHash
] | 117 | spec = fromHUnitTest $ TestList [
TestLabel ">>genHash" test_genHash
, TestLabel ">>checkHash" test_checkHash
] | 117 | false | false | 3 | 7 | 19 | 33 | 14 | 19 | null | null |
cbrghostrider/Hacking | HackerRank/FunctionalProgramming/Recursion/convexHull.hs | mit | distFinal = distance (head prms) (last prms) | 44 | distFinal = distance (head prms) (last prms) | 44 | distFinal = distance (head prms) (last prms) | 44 | false | false | 0 | 7 | 6 | 23 | 11 | 12 | null | null |
tpltnt/Tidal | Sound/Tidal/Strategies.hs | gpl-3.0 | {-
scrumple :: Time -> Pattern a -> Pattern a -> Pattern a
scrumple o p p' = p'' -- overlay p (o ~> p'')
where p'' = Pattern $ \a -> concatMap
(\((s,d), vs) -> map (\x -> ((s,d),
snd x
... | 814 | spreadf ts p = spread ($) | 25 | spreadf ts p = spread ($) | 25 | true | false | 1 | 5 | 462 | 28 | 15 | 13 | null | null |
gafiatulin/codewars | src/6 kyu/Sumdignth.hs | mit | sumDigNthTerm :: Int -> [Int] -> Int -> Int
sumDigNthTerm initval patternl nthterm = sum . map digitToInt . show . (!! pred nthterm) . scanl (+) initval . cycle $ patternl | 171 | sumDigNthTerm :: Int -> [Int] -> Int -> Int
sumDigNthTerm initval patternl nthterm = sum . map digitToInt . show . (!! pred nthterm) . scanl (+) initval . cycle $ patternl | 171 | sumDigNthTerm initval patternl nthterm = sum . map digitToInt . show . (!! pred nthterm) . scanl (+) initval . cycle $ patternl | 127 | false | true | 0 | 11 | 31 | 79 | 39 | 40 | null | null |
AndrewRademacher/stack | src/Stack/Ghci.hs | bsd-3-clause | setScriptPerms _ = do
return ()
#else
setScriptPerms fp = do
liftIO $ Posix.setFileMode fp $ foldl1 Posix.unionFileModes
[ Posix.ownerReadMode
, Posix.ownerWriteMode
, Posix.groupReadMode
, Posix.otherReadMode
]
#endif
{- Copied from Stack.Ide, may be useful in the futur... | 1,955 | setScriptPerms _ = do
return ()
#else
setScriptPerms fp = do
liftIO $ Posix.setFileMode fp $ foldl1 Posix.unionFileModes
[ Posix.ownerReadMode
, Posix.ownerWriteMode
, Posix.groupReadMode
, Posix.otherReadMode
]
#endif
{- Copied from Stack.Ide, may be useful in the futur... | 1,955 | setScriptPerms _ = do
return ()
#else
setScriptPerms fp = do
liftIO $ Posix.setFileMode fp $ foldl1 Posix.unionFileModes
[ Posix.ownerReadMode
, Posix.ownerWriteMode
, Posix.groupReadMode
, Posix.otherReadMode
]
#endif
{- Copied from Stack.Ide, may be useful in the futur... | 1,955 | false | false | 0 | 8 | 546 | 20 | 10 | 10 | null | null |
olorin/amazonka | amazonka-ec2/gen/Network/AWS/EC2/RunInstances.hs | mpl-2.0 | -- | If you set this parameter to 'true', you can\'t terminate the instance
-- using the Amazon EC2 console, CLI, or API; otherwise, you can. If you
-- set this parameter to 'true' and then later want to be able to terminate
-- the instance, you must first change the value of the
-- 'disableApiTermination' attribute to... | 705 | rDisableAPITermination :: Lens' RunInstances (Maybe Bool)
rDisableAPITermination = lens _rDisableAPITermination (\ s a -> s{_rDisableAPITermination = a}) | 153 | rDisableAPITermination = lens _rDisableAPITermination (\ s a -> s{_rDisableAPITermination = a}) | 95 | true | true | 0 | 9 | 104 | 55 | 34 | 21 | null | null |
stevedonnelly/haskell | code/Geometry/Line.hs | mit | projectionScalar = \line point -> let
in (V.projectionScalar (direction line) (V.subtract point (point0 line))) | 115 | projectionScalar = \line point -> let
in (V.projectionScalar (direction line) (V.subtract point (point0 line))) | 115 | projectionScalar = \line point -> let
in (V.projectionScalar (direction line) (V.subtract point (point0 line))) | 115 | false | false | 1 | 14 | 17 | 54 | 25 | 29 | null | null |
Physwf/physwf-haskell-lab | maximum.hs | apache-2.0 | maximum' :: (Ord a) => [a] -> a
maximum' [] = error "Cant apply to empty list!" | 79 | maximum' :: (Ord a) => [a] -> a
maximum' [] = error "Cant apply to empty list!" | 79 | maximum' [] = error "Cant apply to empty list!" | 47 | false | true | 0 | 7 | 16 | 35 | 18 | 17 | null | null |
cpdurham/accelerate-camera-sandbox | src/Fluid/Pipe.hs | bsd-3-clause | fromVectorSource
:: Acc ((DensitySource, VelocitySource), DensityField, VelocityField)
-> (Acc DensityField, Acc VelocityField)
fromVectorSource input =
let
(sources,df,vf) = unlift input
:: (Acc (DensitySource, VelocitySource), Acc DensityField, Acc VelocityField)
(ds,vs) = unlift sources
df' =... | 375 | fromVectorSource
:: Acc ((DensitySource, VelocitySource), DensityField, VelocityField)
-> (Acc DensityField, Acc VelocityField)
fromVectorSource input =
let
(sources,df,vf) = unlift input
:: (Acc (DensitySource, VelocitySource), Acc DensityField, Acc VelocityField)
(ds,vs) = unlift sources
df' =... | 375 | fromVectorSource input =
let
(sources,df,vf) = unlift input
:: (Acc (DensitySource, VelocitySource), Acc DensityField, Acc VelocityField)
(ds,vs) = unlift sources
df' = inject ds df
vf' = inject vs vf
in
(df',vf') | 243 | false | true | 0 | 11 | 77 | 146 | 76 | 70 | null | null |
rbermani/ib-api | src/IB/Client/Exception.hs | gpl-3.0 | excToPair FailSendCanHistData= (528, "Cancel Historical Data Sending Error - ") | 79 | excToPair FailSendCanHistData= (528, "Cancel Historical Data Sending Error - ") | 79 | excToPair FailSendCanHistData= (528, "Cancel Historical Data Sending Error - ") | 79 | false | false | 0 | 5 | 9 | 16 | 8 | 8 | null | null |
Kagami/cirno | src/Network/XMPP/XML.hs | bsd-3-clause | getCData _ = Nothing | 20 | getCData _ = Nothing | 20 | getCData _ = Nothing | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
tpsinnem/Idris-dev | src/Idris/Core/ProofTerm.hs | bsd-3-clause | same (Just x) n = x == n | 24 | same (Just x) n = x == n | 24 | same (Just x) n = x == n | 24 | false | false | 1 | 8 | 7 | 25 | 10 | 15 | null | null |
kmate/HaRe | old/testing/simplifyExpr/ListToMaybeIn1AST.hs | bsd-3-clause | listToMaybe :: [a] -> Maybe a
listToMaybe [] = Nothing | 56 | listToMaybe :: [a] -> Maybe a
listToMaybe [] = Nothing | 54 | listToMaybe [] = Nothing | 24 | false | true | 0 | 6 | 11 | 30 | 14 | 16 | null | null |
gridaphobe/ghc | compiler/types/OptCoercion.hs | bsd-3-clause | etaTyConAppCo_maybe :: TyCon -> Coercion -> Maybe [Coercion]
-- If possible, split a coercion
-- g :: T s1 .. sn ~ T t1 .. tn
-- into [ Nth 0 g :: s1~t1, ..., Nth (n-1) g :: sn~tn ]
etaTyConAppCo_maybe tc (TyConAppCo _ tc2 cos2)
= ASSERT( tc == tc2 ) Just cos2 | 268 | etaTyConAppCo_maybe :: TyCon -> Coercion -> Maybe [Coercion]
etaTyConAppCo_maybe tc (TyConAppCo _ tc2 cos2)
= ASSERT( tc == tc2 ) Just cos2 | 141 | etaTyConAppCo_maybe tc (TyConAppCo _ tc2 cos2)
= ASSERT( tc == tc2 ) Just cos2 | 80 | true | true | 0 | 8 | 62 | 63 | 31 | 32 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/playpen/aeson/src/AesonTut.hs | unlicense | createPrivacy3 :: Parser String -> Parser Privacy3
createPrivacy3 x =
x >>= \c -> case c of
"EVERYONE" -> return Everyone3
"ALL_FRIENDS" -> return AllFriends3
"FRIENDS_OF_FRIENDS" -> return FriendsOfFriends3
"SELF" ... | 422 | createPrivacy3 :: Parser String -> Parser Privacy3
createPrivacy3 x =
x >>= \c -> case c of
"EVERYONE" -> return Everyone3
"ALL_FRIENDS" -> return AllFriends3
"FRIENDS_OF_FRIENDS" -> return FriendsOfFriends3
"SELF" ... | 422 | createPrivacy3 x =
x >>= \c -> case c of
"EVERYONE" -> return Everyone3
"ALL_FRIENDS" -> return AllFriends3
"FRIENDS_OF_FRIENDS" -> return FriendsOfFriends3
"SELF" -> return Self3
_ ... | 371 | false | true | 0 | 10 | 192 | 82 | 38 | 44 | null | null |
evanrinehart/lowgl | Graphics/GL/Low/Texture.hs | bsd-2-clause | setCubeMapFiltering :: Filtering -> IO ()
setCubeMapFiltering filt = do
glTexParameteri GL_TEXTURE_CUBE_MAP GL_TEXTURE_MIN_FILTER (toGL filt)
glTexParameteri GL_TEXTURE_CUBE_MAP GL_TEXTURE_MAG_FILTER (toGL filt)
-- | Set the wrapping mode for the 2D texture currently bound to the 2D
-- texture binding target. | 315 | setCubeMapFiltering :: Filtering -> IO ()
setCubeMapFiltering filt = do
glTexParameteri GL_TEXTURE_CUBE_MAP GL_TEXTURE_MIN_FILTER (toGL filt)
glTexParameteri GL_TEXTURE_CUBE_MAP GL_TEXTURE_MAG_FILTER (toGL filt)
-- | Set the wrapping mode for the 2D texture currently bound to the 2D
-- texture binding target. | 315 | setCubeMapFiltering filt = do
glTexParameteri GL_TEXTURE_CUBE_MAP GL_TEXTURE_MIN_FILTER (toGL filt)
glTexParameteri GL_TEXTURE_CUBE_MAP GL_TEXTURE_MAG_FILTER (toGL filt)
-- | Set the wrapping mode for the 2D texture currently bound to the 2D
-- texture binding target. | 273 | false | true | 0 | 10 | 43 | 61 | 28 | 33 | null | null |
thalerjonathan/phd | public/ArtIterating/code/haskell/PureAgentsSeq/src/SpacialGameMsg/SGModelMsg.hs | gpl-3.0 | sgStateMsg :: SGAgent -> SGState -> SGAgent
sgStateMsg a s = if ( allNeighboursTicked a'' ) then
broadCastLocalPayoff a''
else
a''
where
lp = sgLocalPayoff (PA.state a)
poIncrease = payoffWith a s
newLp = lp + poIncrease
... | 413 | sgStateMsg :: SGAgent -> SGState -> SGAgent
sgStateMsg a s = if ( allNeighboursTicked a'' ) then
broadCastLocalPayoff a''
else
a''
where
lp = sgLocalPayoff (PA.state a)
poIncrease = payoffWith a s
newLp = lp + poIncrease
... | 413 | sgStateMsg a s = if ( allNeighboursTicked a'' ) then
broadCastLocalPayoff a''
else
a''
where
lp = sgLocalPayoff (PA.state a)
poIncrease = payoffWith a s
newLp = lp + poIncrease
a' = PA.updateState a (\s -> s { sgLocalPay... | 369 | false | true | 0 | 11 | 160 | 114 | 60 | 54 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/Resources/IAMAccessKey.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html#cfn-iam-accesskey-username
iamakUserName :: Lens' IAMAccessKey (Val Text)
iamakUserName = lens _iAMAccessKeyUserName (\s a -> s { _iAMAccessKeyUserName = a }) | 259 | iamakUserName :: Lens' IAMAccessKey (Val Text)
iamakUserName = lens _iAMAccessKeyUserName (\s a -> s { _iAMAccessKeyUserName = a }) | 131 | iamakUserName = lens _iAMAccessKeyUserName (\s a -> s { _iAMAccessKeyUserName = a }) | 84 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
cryptica/CodeEval | Challenges/84_BalancedSmileys/main.hs | gpl-3.0 | processLine :: String -> String
processLine line =
if any (=="") $ parseLine line then "YES" else "NO" | 106 | processLine :: String -> String
processLine line =
if any (=="") $ parseLine line then "YES" else "NO" | 106 | processLine line =
if any (=="") $ parseLine line then "YES" else "NO" | 74 | false | true | 0 | 8 | 21 | 46 | 22 | 24 | null | null |
bkoropoff/Idris-dev | src/Idris/IdeMode.hs | bsd-3-clause | sexpToCommand (SexpList [SymbolAtom "add-clause", IntegerAtom line, StringAtom name]) = Just (AddClause (fromInteger line) name) | 130 | sexpToCommand (SexpList [SymbolAtom "add-clause", IntegerAtom line, StringAtom name]) = Just (AddClause (fromInteger line) name) | 130 | sexpToCommand (SexpList [SymbolAtom "add-clause", IntegerAtom line, StringAtom name]) = Just (AddClause (fromInteger line) name) | 130 | false | false | 0 | 9 | 15 | 50 | 24 | 26 | null | null |
projectorhq/haskell-liquid | test/Text/Liquid/ParserTests.hs | bsd-3-clause | case_elseClause2 = parseOnly elseClause "{%else%}" @?= Right Else | 65 | case_elseClause2 = parseOnly elseClause "{%else%}" @?= Right Else | 65 | case_elseClause2 = parseOnly elseClause "{%else%}" @?= Right Else | 65 | false | false | 1 | 6 | 7 | 22 | 8 | 14 | null | null |
haskell/haddock | hypsrc-test/src/TemplateHaskellSplices.hs | bsd-2-clause | foo = id $(anExpression2) | 25 | foo = id $(anExpression2) | 25 | foo = id $(anExpression2) | 25 | false | false | 0 | 7 | 3 | 13 | 6 | 7 | null | null |
vTurbine/ghc | compiler/basicTypes/VarSet.hs | bsd-3-clause | extendVarSet_C = addOneToUniqSet_C | 35 | extendVarSet_C = addOneToUniqSet_C | 35 | extendVarSet_C = addOneToUniqSet_C | 35 | false | false | 0 | 4 | 3 | 6 | 3 | 3 | null | null |
CIFASIS/megadeth | Megadeth/Prim.hs | bsd-3-clause | tocheck :: [TyVarBndr] -> Name -> Type
tocheck bndrs nm =
let ns = map VarT $ paramNames bndrs in foldl AppT (ConT nm) ns | 125 | tocheck :: [TyVarBndr] -> Name -> Type
tocheck bndrs nm =
let ns = map VarT $ paramNames bndrs in foldl AppT (ConT nm) ns | 125 | tocheck bndrs nm =
let ns = map VarT $ paramNames bndrs in foldl AppT (ConT nm) ns | 86 | false | true | 0 | 10 | 28 | 66 | 30 | 36 | null | null |
Super-Fluid/heqet | Heqet/Input/Parse.hs | gpl-3.0 | {-
Transformation.
-}
pitch5toPitch :: Tree5 -> Tree6
pitch5toPitch (ParallelY muss) = ParallelY (map pitch5toPitch muss) | 123 | pitch5toPitch :: Tree5 -> Tree6
pitch5toPitch (ParallelY muss) = ParallelY (map pitch5toPitch muss) | 99 | pitch5toPitch (ParallelY muss) = ParallelY (map pitch5toPitch muss) | 67 | true | true | 0 | 7 | 17 | 36 | 18 | 18 | null | null |
josefs/autosar | ARSim/arsim/AUTOSAR/ARSim.hs | bsd-3-clause | {- There are two ways to run the Simulink model. One way is to run the simulation
- from Simulink directly (for example by using the MATLAB gui). In this case
- it's the Simulink C stub that creates named pipes and launches the
- Haskell AUTOSAR simulator (handled by simulateUsingExternal).
- The second way is to r... | 1,289 | simulateUsingExternal :: External a => Bool -> AUTOSAR a -> TFGen -> IO (a, Trace)
simulateUsingExternal useTasks sys rng =
do args <- getArgs
case args of
[inFifo, outFifo] -> runWithFIFOs useTasks rng inFifo outFifo sys
_ ->
do logWrite $ "Wrong number of arguments. Proceeding with default ... | 566 | simulateUsingExternal useTasks sys rng =
do args <- getArgs
case args of
[inFifo, outFifo] -> runWithFIFOs useTasks rng inFifo outFifo sys
_ ->
do logWrite $ "Wrong number of arguments. Proceeding with default " ++
"FIFOs."
runWithFIFOs useTasks rng "/tmp/infi... | 483 | true | true | 0 | 13 | 268 | 122 | 61 | 61 | null | null |
kawu/french-tag | src/NLP/Partage4Xmg/Ensemble.hs | bsd-2-clause | getTrees
:: Grammar
-> Term
-- ^ A wordform
-> Morph.Ana
-- ^ The analysis corresponding the wordform
-- -> [(Tree Term, C.Comp CFS)]
-> [(C.TreeID, Env.EnvM Val (FSTree Term Key))]
getTrees gram term ana
-- = mapMaybe process
= map process
. M.toList
$ _getTrees gram ana
where
-- pro... | 1,016 | getTrees
:: Grammar
-> Term
-- ^ A wordform
-> Morph.Ana
-- ^ The analysis corresponding the wordform
-- -> [(Tree Term, C.Comp CFS)]
-> [(C.TreeID, Env.EnvM Val (FSTree Term Key))]
getTrees gram term ana
-- = mapMaybe process
= map process
. M.toList
$ _getTrees gram ana
where
-- pro... | 1,016 | getTrees gram term ana
-- = mapMaybe process
= map process
. M.toList
$ _getTrees gram ana
where
-- process tree = splitFSTree . fmap simplifyFS $ do
process (tree, treeID) = (treeID,) . fmap simplify $ do
-- let term = Morph.lemma ana
converted <- withVarMap (convert tree)
let fs =... | 814 | false | true | 10 | 18 | 298 | 257 | 134 | 123 | null | null |
jaalonso/I1M-Cod-Temas | src/Tema_7.hs | gpl-2.0 | dosVecesSC f x = f (f x) | 33 | dosVecesSC f x = f (f x) | 33 | dosVecesSC f x = f (f x) | 33 | false | false | 0 | 7 | 15 | 20 | 9 | 11 | null | null |
dbp/thistle | src/Lang.hs | isc | tc _ env (EDot e f) =
case fst $ tc False env e of
to@(TObject fs) ->
case M.lookup f fs of
Just t -> (t, env)
Nothing -> error $ "tc: field " <> show f <> " not found on object: " <> show to
t -> error $ "tc: got non-object in dot: " <> show t | 291 | tc _ env (EDot e f) =
case fst $ tc False env e of
to@(TObject fs) ->
case M.lookup f fs of
Just t -> (t, env)
Nothing -> error $ "tc: field " <> show f <> " not found on object: " <> show to
t -> error $ "tc: got non-object in dot: " <> show t | 291 | tc _ env (EDot e f) =
case fst $ tc False env e of
to@(TObject fs) ->
case M.lookup f fs of
Just t -> (t, env)
Nothing -> error $ "tc: field " <> show f <> " not found on object: " <> show to
t -> error $ "tc: got non-object in dot: " <> show t | 291 | false | false | 1 | 14 | 107 | 125 | 59 | 66 | null | null |
rfranek/duckling | Duckling/Dimensions.hs | bsd-3-clause | langDimensions EN = ENDimensions.allDimensions | 46 | langDimensions EN = ENDimensions.allDimensions | 46 | langDimensions EN = ENDimensions.allDimensions | 46 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
sdiehl/ghc | compiler/nativeGen/X86/Instr.hs | bsd-3-clause | x86_jumpDestsOfInstr
:: Instr
-> [BlockId]
x86_jumpDestsOfInstr insn
= case insn of
JXX _ id -> [id]
JMP_TBL _ ids _ _ -> [id | Just (DestBlockId id) <- ids]
_ -> [] | 229 | x86_jumpDestsOfInstr
:: Instr
-> [BlockId]
x86_jumpDestsOfInstr insn
= case insn of
JXX _ id -> [id]
JMP_TBL _ ids _ _ -> [id | Just (DestBlockId id) <- ids]
_ -> [] | 228 | x86_jumpDestsOfInstr insn
= case insn of
JXX _ id -> [id]
JMP_TBL _ ids _ _ -> [id | Just (DestBlockId id) <- ids]
_ -> [] | 169 | false | true | 0 | 13 | 95 | 88 | 42 | 46 | null | null |
gridaphobe/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | collectStmtsBinders :: [StmtLR idL idR body] -> [idL]
collectStmtsBinders = concatMap collectStmtBinders | 104 | collectStmtsBinders :: [StmtLR idL idR body] -> [idL]
collectStmtsBinders = concatMap collectStmtBinders | 104 | collectStmtsBinders = concatMap collectStmtBinders | 50 | false | true | 0 | 7 | 11 | 31 | 16 | 15 | null | null |
huggaida/haskell-game | .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen/Paths_haskell_game.hs | bsd-3-clause | getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name) | 118 | getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name) | 118 | getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name) | 75 | false | true | 0 | 10 | 22 | 45 | 21 | 24 | null | null |
saltlang/compiler-toolbox | src/Control/Monad/Positions.hs | bsd-3-clause | fileInfo' :: Monad m => Filename -> (ReaderT Info m) FileInfo
fileInfo' pos = liftM ((! pos) . fileInfoArray) ask | 113 | fileInfo' :: Monad m => Filename -> (ReaderT Info m) FileInfo
fileInfo' pos = liftM ((! pos) . fileInfoArray) ask | 113 | fileInfo' pos = liftM ((! pos) . fileInfoArray) ask | 51 | false | true | 0 | 10 | 19 | 56 | 27 | 29 | null | null |
rueshyna/gogol | gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/InAppProducts/Update.hs | mpl-2.0 | -- | Multipart request metadata.
iapuPayload :: Lens' InAppProductsUpdate InAppProduct
iapuPayload
= lens _iapuPayload (\ s a -> s{_iapuPayload = a}) | 151 | iapuPayload :: Lens' InAppProductsUpdate InAppProduct
iapuPayload
= lens _iapuPayload (\ s a -> s{_iapuPayload = a}) | 118 | iapuPayload
= lens _iapuPayload (\ s a -> s{_iapuPayload = a}) | 64 | true | true | 0 | 9 | 22 | 42 | 22 | 20 | null | null |
zhangjiji/real-world-haskell | ch14/Random.hs | mit | getTwoRandoms :: Random a => RandomState (a, a)
getTwoRandoms = liftM2 (,) getRandom getRandom | 94 | getTwoRandoms :: Random a => RandomState (a, a)
getTwoRandoms = liftM2 (,) getRandom getRandom | 94 | getTwoRandoms = liftM2 (,) getRandom getRandom | 46 | false | true | 0 | 8 | 13 | 42 | 20 | 22 | null | null |
ihc/futhark | src/Futhark/Representation/ExplicitMemory/IndexFunction.hs | isc | rotate ixfun offsets = Rotate ixfun offsets | 43 | rotate ixfun offsets = Rotate ixfun offsets | 43 | rotate ixfun offsets = Rotate ixfun offsets | 43 | false | false | 1 | 5 | 6 | 21 | 7 | 14 | null | null |
robdockins/edison | test/src/Data/Edison/Test/Bag.hs | mit | prop_member_count :: BagTest Int bag => bag Int -> Int -> bag Int -> Bool
prop_member_count bag x xs =
member x xs == (c > 0)
&&
c == Prelude.length (Prelude.filter (== x) (toOrdList xs))
where c = count x xs
-------------------------------------------------------
-- Coll operations | 298 | prop_member_count :: BagTest Int bag => bag Int -> Int -> bag Int -> Bool
prop_member_count bag x xs =
member x xs == (c > 0)
&&
c == Prelude.length (Prelude.filter (== x) (toOrdList xs))
where c = count x xs
-------------------------------------------------------
-- Coll operations | 298 | prop_member_count bag x xs =
member x xs == (c > 0)
&&
c == Prelude.length (Prelude.filter (== x) (toOrdList xs))
where c = count x xs
-------------------------------------------------------
-- Coll operations | 224 | false | true | 0 | 10 | 60 | 109 | 54 | 55 | null | null |
olsner/ghc | compiler/nativeGen/PprBase.hs | bsd-3-clause | -- ----------------------------------------------------------------------------
-- Printing section headers.
--
-- If -split-section was specified, include the suffix label, otherwise just
-- print the section type. For Darwin, where subsections-for-symbols are
-- used instead, only print section type.
--
-- For string... | 775 | pprSectionHeader :: Platform -> Section -> SDoc
pprSectionHeader platform (Section t suffix) =
case platformOS platform of
OSAIX -> pprXcoffSectionHeader t
OSDarwin -> pprDarwinSectionHeader t
_ -> pprGNUSectionHeader t suffix | 246 | pprSectionHeader platform (Section t suffix) =
case platformOS platform of
OSAIX -> pprXcoffSectionHeader t
OSDarwin -> pprDarwinSectionHeader t
_ -> pprGNUSectionHeader t suffix | 198 | true | true | 0 | 8 | 123 | 78 | 42 | 36 | null | null |
olsner/ghc | testsuite/tests/programs/life_space_leak/Main.hs | bsd-3-clause | append3 :: L Int -> L Int -> L Int
append3 N ys = ys | 52 | append3 :: L Int -> L Int -> L Int
append3 N ys = ys | 52 | append3 N ys = ys | 17 | false | true | 0 | 7 | 14 | 38 | 16 | 22 | null | null |
Purview/purview | src/Graphics/Forensics/Analyser.hs | gpl-3.0 | -- | Reports something with a 'CriticalLevel' of importance
reportCritical :: Text -> ReportData -> Analysis ()
reportCritical msg = reportEntry . ReportEntry CriticalLevel msg | 176 | reportCritical :: Text -> ReportData -> Analysis ()
reportCritical msg = reportEntry . ReportEntry CriticalLevel msg | 116 | reportCritical msg = reportEntry . ReportEntry CriticalLevel msg | 64 | true | true | 0 | 8 | 24 | 37 | 18 | 19 | null | null |
mavenraven/github | samples/Pulls/ShowCommits.hs | bsd-3-clause | main = do
possiblePullRequestCommits <- Github.pullRequestCommits "thoughtbot" "paperclip" 575
case possiblePullRequestCommits of
(Left error) -> putStrLn $ "Error: " ++ (show error)
(Right commits) -> putStrLn $ intercalate "\n" $ map formatCommit commits | 277 | main = do
possiblePullRequestCommits <- Github.pullRequestCommits "thoughtbot" "paperclip" 575
case possiblePullRequestCommits of
(Left error) -> putStrLn $ "Error: " ++ (show error)
(Right commits) -> putStrLn $ intercalate "\n" $ map formatCommit commits | 277 | main = do
possiblePullRequestCommits <- Github.pullRequestCommits "thoughtbot" "paperclip" 575
case possiblePullRequestCommits of
(Left error) -> putStrLn $ "Error: " ++ (show error)
(Right commits) -> putStrLn $ intercalate "\n" $ map formatCommit commits | 277 | false | false | 0 | 12 | 53 | 83 | 39 | 44 | null | null |
janschulz/pandoc | src/Text/Pandoc/Readers/Markdown.hs | gpl-2.0 | lhsCodeBlockBird :: MarkdownParser String
lhsCodeBlockBird = lhsCodeBlockBirdWith '>' | 85 | lhsCodeBlockBird :: MarkdownParser String
lhsCodeBlockBird = lhsCodeBlockBirdWith '>' | 85 | lhsCodeBlockBird = lhsCodeBlockBirdWith '>' | 43 | false | true | 0 | 5 | 7 | 17 | 8 | 9 | null | null |
input-output-hk/pos-haskell-prototype | crypto/test/Test/Pos/Crypto/Json.hs | mit | -- Legacy JSON encoding where requiresNetworkMagic was
-- encoded as "NMMustBeNothing" or "NMMustBeJust"
golden_ProtocolMagic3AesonDec_NMMustBeJust :: Property
golden_ProtocolMagic3AesonDec_NMMustBeJust =
goldenTestJSONDec
exampleProtocolMagic3
"test/golden/json/ProtocolMagic_Legacy_NMMustBeJus... | 322 | golden_ProtocolMagic3AesonDec_NMMustBeJust :: Property
golden_ProtocolMagic3AesonDec_NMMustBeJust =
goldenTestJSONDec
exampleProtocolMagic3
"test/golden/json/ProtocolMagic_Legacy_NMMustBeJust" | 216 | golden_ProtocolMagic3AesonDec_NMMustBeJust =
goldenTestJSONDec
exampleProtocolMagic3
"test/golden/json/ProtocolMagic_Legacy_NMMustBeJust" | 161 | true | true | 0 | 5 | 45 | 18 | 10 | 8 | null | null |
sdiehl/ghc | libraries/ghci/GHCi/ResolvedBCO.hs | bsd-3-clause | isLittleEndian = True | 21 | isLittleEndian = True | 21 | isLittleEndian = True | 21 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
urbanslug/ghc | testsuite/tests/codeGen/should_run/T8103_A.hs | bsd-3-clause | foo :: Double# -> Double# -> Double#
foo a b = (a +## b) | 57 | foo :: Double# -> Double# -> Double#
foo a b = (a +## b) | 57 | foo a b = (a +## b) | 19 | false | true | 0 | 8 | 14 | 37 | 17 | 20 | null | null |
dbp/karamaan-opaleye | Karamaan/Opaleye/Predicates.hs | bsd-3-clause | wireIs :: Wire a -> Literal -> PrimExpr
wireIs = wireOp OpEq | 60 | wireIs :: Wire a -> Literal -> PrimExpr
wireIs = wireOp OpEq | 60 | wireIs = wireOp OpEq | 20 | false | true | 0 | 6 | 11 | 25 | 12 | 13 | null | null |
revnull/noisefunge | src/Language/NoiseFunge/Befunge/Process.hs | gpl-3.0 | -- Convert a list of lines into a program array. The height will be the number
-- of lines and the width will be the length of the longest line.
makeProgArray :: [String] -> ProgArray
makeProgArray strs = arr where
rows = fromIntegral $ length strs
cols = fromIntegral $ maximum $ fmap length strs
bnds = ((0... | 523 | makeProgArray :: [String] -> ProgArray
makeProgArray strs = arr where
rows = fromIntegral $ length strs
cols = fromIntegral $ maximum $ fmap length strs
bnds = ((0,0), (rows-1, cols-1))
arr = array bnds $ do
(r, row) <- zip [0..] strs
(c, char) <- zip [0..cols-1] (row ++ pad)
re... | 378 | makeProgArray strs = arr where
rows = fromIntegral $ length strs
cols = fromIntegral $ maximum $ fmap length strs
bnds = ((0,0), (rows-1, cols-1))
arr = array bnds $ do
(r, row) <- zip [0..] strs
(c, char) <- zip [0..cols-1] (row ++ pad)
return ((r,c), fromIntegral $ ord char)
... | 339 | true | true | 12 | 10 | 135 | 208 | 101 | 107 | null | null |
redelmann/haskell-unix-utilities | iconv/Main.hs | bsd-3-clause | options :: Parser Options
options = Options <$> optional (strOption (short 'f'
<> long "from-code"
<> help "Specify the encoding of the input"
<> metavar "encoding"))
<*> optional (strOption (short 't'
<> long "to-code"
... | 489 | options :: Parser Options
options = Options <$> optional (strOption (short 'f'
<> long "from-code"
<> help "Specify the encoding of the input"
<> metavar "encoding"))
<*> optional (strOption (short 't'
<> long "to-code"
... | 489 | options = Options <$> optional (strOption (short 'f'
<> long "from-code"
<> help "Specify the encoding of the input"
<> metavar "encoding"))
<*> optional (strOption (short 't'
<> long "to-code"
<> help ... | 463 | false | true | 0 | 15 | 206 | 109 | 50 | 59 | null | null |
pparkkin/eta | compiler/ETA/CodeGen/Bind.hs | bsd-3-clause | cgRhs recIds name (StgRhsClosure _ binderInfo fvs updateFlag _ args body)
= mkRhsClosure name binderInfo nonVoidFvs updateFlag args body recIds
where nonVoidFvs = nonVoidIds fvs | 181 | cgRhs recIds name (StgRhsClosure _ binderInfo fvs updateFlag _ args body)
= mkRhsClosure name binderInfo nonVoidFvs updateFlag args body recIds
where nonVoidFvs = nonVoidIds fvs | 181 | cgRhs recIds name (StgRhsClosure _ binderInfo fvs updateFlag _ args body)
= mkRhsClosure name binderInfo nonVoidFvs updateFlag args body recIds
where nonVoidFvs = nonVoidIds fvs | 181 | false | false | 0 | 6 | 28 | 60 | 27 | 33 | null | null |
fmapfmapfmap/amazonka | amazonka-cloudformation/gen/Network/AWS/CloudFormation/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'Tag' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'tagValue'
--
-- * 'tagKey'
tag
:: Tag
tag =
Tag'
{ _tagValue = Nothing
, _tagKey = Nothing
} | 276 | tag
:: Tag
tag =
Tag'
{ _tagValue = Nothing
, _tagKey = Nothing
} | 85 | tag =
Tag'
{ _tagValue = Nothing
, _tagKey = Nothing
} | 70 | true | true | 0 | 6 | 72 | 32 | 22 | 10 | null | null |
Airtnp/Freshman_Simple_Haskell_Lib | Intro/TAPL/subtying.hs | mit | extendStore store v = (length store, store ++ [v]) | 50 | extendStore store v = (length store, store ++ [v]) | 50 | extendStore store v = (length store, store ++ [v]) | 50 | false | false | 0 | 7 | 8 | 27 | 14 | 13 | null | null |
samvher/translatethenews | app/TTN/Controller/Shared.hs | mit | -- | Get current time (use in validators in forms)
now :: TTNAction ctx UTCTime
now = liftIO getCurrentTime | 107 | now :: TTNAction ctx UTCTime
now = liftIO getCurrentTime | 56 | now = liftIO getCurrentTime | 27 | true | true | 0 | 6 | 18 | 26 | 11 | 15 | null | null |
brendanhay/gogol | gogol-datafusion/gen/Network/Google/Resource/DataFusion/Projects/Locations/Instances/Create.hs | mpl-2.0 | -- | Multipart request metadata.
plicPayload :: Lens' ProjectsLocationsInstancesCreate Instance
plicPayload
= lens _plicPayload (\ s a -> s{_plicPayload = a}) | 160 | plicPayload :: Lens' ProjectsLocationsInstancesCreate Instance
plicPayload
= lens _plicPayload (\ s a -> s{_plicPayload = a}) | 127 | plicPayload
= lens _plicPayload (\ s a -> s{_plicPayload = a}) | 64 | true | true | 0 | 9 | 22 | 42 | 22 | 20 | null | null |
AaronFriel/eff-experiments | src/Data/Iota/Tagged/Eff1.hs | bsd-3-clause | -- E u q <*> E u' q' = E u (q |> (\f -> E u' (q' |> (Val . f))))
{-
-- The opposite of admin, occasionally useful
-- See the soft-cut for an example
-- It is currently quite inefficient. There are better ways
reflect :: VE a r -> Eff r a
reflect (Val x) = return x
reflect (E u) = Eff (\k -> E $ fmap (loop k) u)
where... | 674 | run :: Eff '[] w -> w
run (Val x) = x | 37 | run (Val x) = x | 15 | true | true | 0 | 9 | 158 | 45 | 23 | 22 | null | null |
pikajude/mono-traversable | src/Data/MinLen.hs | mit | -- | Returns all but the first element of a sequence, reducing its 'MinLen' by 1.
--
-- Safe, only works on sequences wrapped in a @'MinLen' ('Succ' nat)@.
--
-- ==== __Examples__
--
-- @
-- > let xs = 'toMinLen' [1,2,3] :: 'Maybe' ('MinLen' ('Succ' 'Zero') ['Int'])
-- > 'fmap' 'tailML' xs
-- 'Just' ('MinLen' {unMinLen... | 439 | tailML :: IsSequence seq => MinLen (Succ nat) seq -> MinLen nat seq
tailML = MinLen . tailEx . unMinLen | 103 | tailML = MinLen . tailEx . unMinLen | 35 | true | true | 0 | 9 | 81 | 57 | 33 | 24 | null | null |
holzensp/ghc | compiler/vectorise/Vectorise/Monad/Base.hs | bsd-3-clause | maybeV :: SDoc -> VM (Maybe a) -> VM a
maybeV reason p = maybe (noV reason) return =<< p | 88 | maybeV :: SDoc -> VM (Maybe a) -> VM a
maybeV reason p = maybe (noV reason) return =<< p | 88 | maybeV reason p = maybe (noV reason) return =<< p | 49 | false | true | 0 | 10 | 19 | 57 | 25 | 32 | null | null |
hanshoglund/imitator | src/Music/Imitator/Util.hs | gpl-3.0 | - |
-- Synonym for 'fmap Char.toLower'
toLowerString :: String -> String
toLowerString = fmap Char.toLower
| 107 | toLowerString :: String -> String
toLowerString = fmap Char.toLower | 67 | toLowerString = fmap Char.toLower | 33 | true | true | 1 | 8 | 16 | 29 | 13 | 16 | null | null |
ivokosir/gearh | test/renderResources.hs | mit | initialState :: State
initialState = State 0 0 False | 52 | initialState :: State
initialState = State 0 0 False | 52 | initialState = State 0 0 False | 30 | false | true | 0 | 6 | 8 | 24 | 10 | 14 | null | null |
cglazner/ibd_stitch | src/Joint.hs | bsd-3-clause | doOnePostCons :: IntSet -> (Int, Int) -> (Int, Int) -> IntPartition -> IntPartition -> Constraint
doOnePostCons ny x@(x1,x2) y@(y1,y2) pri prev = a <> b <> c <> d
where (inx, iny) = over both (uncurry (equiv prev)) (x, y)
(setx1, setx2) = over both ((intersection ny) . myfind pri) x
... | 1,266 | doOnePostCons :: IntSet -> (Int, Int) -> (Int, Int) -> IntPartition -> IntPartition -> Constraint
doOnePostCons ny x@(x1,x2) y@(y1,y2) pri prev = a <> b <> c <> d
where (inx, iny) = over both (uncurry (equiv prev)) (x, y)
(setx1, setx2) = over both ((intersection ny) . myfind pri) x
... | 1,266 | doOnePostCons ny x@(x1,x2) y@(y1,y2) pri prev = a <> b <> c <> d
where (inx, iny) = over both (uncurry (equiv prev)) (x, y)
(setx1, setx2) = over both ((intersection ny) . myfind pri) x
(sety1, sety2) = over both (myfind prev) y
a = if equiv pri x1 y1 || (iny ... | 1,168 | false | true | 5 | 12 | 441 | 493 | 252 | 241 | null | null |
mightymoose/liquidhaskell | benchmarks/text-0.11.2.3/Data/Text/Lazy.hs | bsd-3-clause | {-@ init_go :: t:TextNE -> ts:Text
-> {v:Text | ((ltlength v) = ((tlength t) + (ltlength ts) - 1))}
@-}
{-@ Decrease init_go 2 @-}
init_go t (Chunk t' ts) = Chunk t (init_go t' ts) | 194 | init_go t (Chunk t' ts) = Chunk t (init_go t' ts) | 49 | init_go t (Chunk t' ts) = Chunk t (init_go t' ts) | 49 | true | false | 0 | 7 | 49 | 34 | 17 | 17 | null | null |
rahulmutt/ghcvm | compiler/Eta/Types/CoAxiom.hs | bsd-3-clause | brListZipWith f (NextBranch a ta) (NextBranch b tb) = f a b : brListZipWith f ta tb | 83 | brListZipWith f (NextBranch a ta) (NextBranch b tb) = f a b : brListZipWith f ta tb | 83 | brListZipWith f (NextBranch a ta) (NextBranch b tb) = f a b : brListZipWith f ta tb | 83 | false | false | 0 | 7 | 16 | 45 | 21 | 24 | null | null |
nushio3/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | gen1ClassKey = mkPreludeClassUnique 38 | 39 | gen1ClassKey = mkPreludeClassUnique 38 | 39 | gen1ClassKey = mkPreludeClassUnique 38 | 39 | false | false | 1 | 5 | 4 | 12 | 4 | 8 | null | null |
kowey/GenI | src/NLP/GenI/Simple/SimpleBuilder.hs | gpl-2.0 | canAdjoin :: SimpleItem -> TagSite -> Maybe (TagSite, TagSite, Subst)
canAdjoin aItem pSite = do
-- let's go!
let r = siRoot aItem -- auxiliary tree, eh?
f <- siFoot aItem -- should really be an error if fails
(anr_up', subst1) <- hush $ unifyFeat (tsUp r) (tsUp pSite)
(anf_down, subst2) <- hush $ unifyFea... | 731 | canAdjoin :: SimpleItem -> TagSite -> Maybe (TagSite, TagSite, Subst)
canAdjoin aItem pSite = do
-- let's go!
let r = siRoot aItem -- auxiliary tree, eh?
f <- siFoot aItem -- should really be an error if fails
(anr_up', subst1) <- hush $ unifyFeat (tsUp r) (tsUp pSite)
(anf_down, subst2) <- hush $ unifyFea... | 731 | canAdjoin aItem pSite = do
-- let's go!
let r = siRoot aItem -- auxiliary tree, eh?
f <- siFoot aItem -- should really be an error if fails
(anr_up', subst1) <- hush $ unifyFeat (tsUp r) (tsUp pSite)
(anf_down, subst2) <- hush $ unifyFeat (replace subst1 $ tsDown f) (replace subst1 $ tsDown pSite)
let --... | 661 | false | true | 0 | 13 | 164 | 220 | 111 | 109 | null | null |
rfranek/duckling | Duckling/Time/SV/Rules.hs | bsd-3-clause | ruleTheCycleBeforeTime :: Rule
ruleTheCycleBeforeTime = Rule
{ name = "the <cycle> before <time>"
, pattern =
[ dimension TimeGrain
, regex "(en|na|et)? f\x00f6re"
, dimension Time
]
, prod = \tokens -> case tokens of
(Token TimeGrain grain:_:Token Time td:_) ->
tt $ cycleNthAfter Fa... | 360 | ruleTheCycleBeforeTime :: Rule
ruleTheCycleBeforeTime = Rule
{ name = "the <cycle> before <time>"
, pattern =
[ dimension TimeGrain
, regex "(en|na|et)? f\x00f6re"
, dimension Time
]
, prod = \tokens -> case tokens of
(Token TimeGrain grain:_:Token Time td:_) ->
tt $ cycleNthAfter Fa... | 360 | ruleTheCycleBeforeTime = Rule
{ name = "the <cycle> before <time>"
, pattern =
[ dimension TimeGrain
, regex "(en|na|et)? f\x00f6re"
, dimension Time
]
, prod = \tokens -> case tokens of
(Token TimeGrain grain:_:Token Time td:_) ->
tt $ cycleNthAfter False grain (-1) td
_ -> No... | 329 | false | true | 0 | 16 | 95 | 117 | 61 | 56 | null | null |
sorpaas/munje | src/Munje/Parser.hs | mit | aExpression :: IParser Expression
aExpression = choice [do
girzu <- aGirzu
return $ Right girzu,
do
bridi <- aBridi
return $ Left bridi
] | 280 | aExpression :: IParser Expression
aExpression = choice [do
girzu <- aGirzu
return $ Right girzu,
do
bridi <- aBridi
return $ Left bridi
] | 280 | aExpression = choice [do
girzu <- aGirzu
return $ Right girzu,
do
bridi <- aBridi
return $ Left bridi
] | 246 | false | true | 0 | 10 | 166 | 57 | 26 | 31 | null | null |
olsner/ghc | compiler/nativeGen/PPC/CodeGen.hs | bsd-3-clause | condFltReg cond x y = condReg (condFltCode cond x y) | 52 | condFltReg cond x y = condReg (condFltCode cond x y) | 52 | condFltReg cond x y = condReg (condFltCode cond x y) | 52 | false | false | 0 | 7 | 9 | 26 | 12 | 14 | null | null |
josercruz01/hsoptions | tests/unit/System/Console/HsOptionsTest.hs | apache-2.0 | testConfFileHierarchy :: UnitTest
testConfFileHierarchy = "Conf files include is recursive" `unitTest`
do let flagData = makeFlagData [f2d userId, f2d userName]
pr <- process flagData "--usingFile = tests/unit/ConfFiles/user_name.conf"
assertFlagValueEquals pr userId 123
assertFlagValueEquals pr userNa... | 380 | testConfFileHierarchy :: UnitTest
testConfFileHierarchy = "Conf files include is recursive" `unitTest`
do let flagData = makeFlagData [f2d userId, f2d userName]
pr <- process flagData "--usingFile = tests/unit/ConfFiles/user_name.conf"
assertFlagValueEquals pr userId 123
assertFlagValueEquals pr userNa... | 380 | testConfFileHierarchy = "Conf files include is recursive" `unitTest`
do let flagData = makeFlagData [f2d userId, f2d userName]
pr <- process flagData "--usingFile = tests/unit/ConfFiles/user_name.conf"
assertFlagValueEquals pr userId 123
assertFlagValueEquals pr userName "batman"
assertArgsEquals ... | 346 | false | true | 0 | 13 | 61 | 90 | 43 | 47 | null | null |
peterson/lets-tree | src/Lets/BinomialHeap.hs | bsd-3-clause | size :: Ord a => BinHeap a -> Int
size = length . toList | 56 | size :: Ord a => BinHeap a -> Int
size = length . toList | 56 | size = length . toList | 22 | false | true | 1 | 8 | 13 | 37 | 15 | 22 | null | null |
pirapira/hashprice | Util.hs | bsd-3-clause | rawBlockURL :: Hash -> String
rawBlockURL h = "https://blockchain.info/rawblock/" ++ (unpack (unHash h)) | 104 | rawBlockURL :: Hash -> String
rawBlockURL h = "https://blockchain.info/rawblock/" ++ (unpack (unHash h)) | 104 | rawBlockURL h = "https://blockchain.info/rawblock/" ++ (unpack (unHash h)) | 74 | false | true | 0 | 10 | 12 | 40 | 18 | 22 | null | null |
adarqui/ZTail-Lib | src/ZTail/TailTypes.hs | bsd-3-clause | tailErrMsg :: Tail -> String -> IO ()
tailErrMsg t msg =
errMsg ("ztail " ++ tailName t ++ ": " ++ msg) | 105 | tailErrMsg :: Tail -> String -> IO ()
tailErrMsg t msg =
errMsg ("ztail " ++ tailName t ++ ": " ++ msg) | 105 | tailErrMsg t msg =
errMsg ("ztail " ++ tailName t ++ ": " ++ msg) | 67 | false | true | 0 | 10 | 24 | 50 | 24 | 26 | null | null |
vigoos/Farrago-OS | aura-master/aura-master/src/Aura/Build.hs | gpl-2.0 | build built ps@(p:_) = do
notify $ buildPackages_1 pn
(paths,rest) <- catch (withTempDir pn (build' ps)) (buildFail built ps)
build (paths ++ built) rest
where pn = baseNameOf p
-- | Perform the actual build. | 229 | build built ps@(p:_) = do
notify $ buildPackages_1 pn
(paths,rest) <- catch (withTempDir pn (build' ps)) (buildFail built ps)
build (paths ++ built) rest
where pn = baseNameOf p
-- | Perform the actual build. | 229 | build built ps@(p:_) = do
notify $ buildPackages_1 pn
(paths,rest) <- catch (withTempDir pn (build' ps)) (buildFail built ps)
build (paths ++ built) rest
where pn = baseNameOf p
-- | Perform the actual build. | 229 | false | false | 0 | 12 | 55 | 97 | 48 | 49 | null | null |
green-haskell/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | -- | It is always safe to assume that an 'Id' has no lambda-bound variable information
noOneShotInfo :: OneShotInfo
noOneShotInfo = NoOneShotInfo | 145 | noOneShotInfo :: OneShotInfo
noOneShotInfo = NoOneShotInfo | 58 | noOneShotInfo = NoOneShotInfo | 29 | true | true | 0 | 4 | 21 | 12 | 7 | 5 | null | null |
graninas/Haskell-Algorithms | Tests/Maybe.hs | gpl-3.0 | main''2 = printPhone $ getPhone "Alice" | 39 | main''2 = printPhone $ getPhone "Alice" | 39 | main''2 = printPhone $ getPhone "Alice" | 39 | false | false | 0 | 6 | 5 | 13 | 6 | 7 | null | null |
fmapfmapfmap/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'ReservedInstanceLimitPrice' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'rilpAmount'
--
-- * 'rilpCurrencyCode'
reservedInstanceLimitPrice
:: ReservedInstanceLimitPrice
reservedInstanceLimitPrice =
... | 415 | reservedInstanceLimitPrice
:: ReservedInstanceLimitPrice
reservedInstanceLimitPrice =
ReservedInstanceLimitPrice'
{ _rilpAmount = Nothing
, _rilpCurrencyCode = Nothing
} | 189 | reservedInstanceLimitPrice =
ReservedInstanceLimitPrice'
{ _rilpAmount = Nothing
, _rilpCurrencyCode = Nothing
} | 128 | true | true | 0 | 6 | 72 | 32 | 22 | 10 | null | null |
agrafix/typed-wire | test/TW/CodeGen/HaskellTest.hs | mit | runner :: FilePath -> (Module -> T.Text) -> (ModuleName -> FilePath) -> Module -> IO ()
runner baseDir mkModule mkFilename m =
let moduleSrc = mkModule m
moduleFp = baseDir </> mkFilename (m_name m)
in do createDirectoryIfMissing True (takeDirectory moduleFp)
T.writeFile moduleFp moduleSrc | 316 | runner :: FilePath -> (Module -> T.Text) -> (ModuleName -> FilePath) -> Module -> IO ()
runner baseDir mkModule mkFilename m =
let moduleSrc = mkModule m
moduleFp = baseDir </> mkFilename (m_name m)
in do createDirectoryIfMissing True (takeDirectory moduleFp)
T.writeFile moduleFp moduleSrc | 316 | runner baseDir mkModule mkFilename m =
let moduleSrc = mkModule m
moduleFp = baseDir </> mkFilename (m_name m)
in do createDirectoryIfMissing True (takeDirectory moduleFp)
T.writeFile moduleFp moduleSrc | 228 | false | true | 0 | 12 | 68 | 113 | 54 | 59 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Doxygenlua.hs | gpl-2.0 | parseRules ("DoxygenLua","SL_htmltag") =
(((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))
<|>
((pDetectChar False '>' >>= withAttribute KeywordTok) >>~ (popContext))
<|>
((pRegExpr regex_'5cs'2a'3d'5cs'2a >>= withAttribute OtherTok) >>~ pushContext ("DoxygenLua","SL_identifie... | 443 | parseRules ("DoxygenLua","SL_htmltag") =
(((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))
<|>
((pDetectChar False '>' >>= withAttribute KeywordTok) >>~ (popContext))
<|>
((pRegExpr regex_'5cs'2a'3d'5cs'2a >>= withAttribute OtherTok) >>~ pushContext ("DoxygenLua","SL_identifie... | 443 | parseRules ("DoxygenLua","SL_htmltag") =
(((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))
<|>
((pDetectChar False '>' >>= withAttribute KeywordTok) >>~ (popContext))
<|>
((pRegExpr regex_'5cs'2a'3d'5cs'2a >>= withAttribute OtherTok) >>~ pushContext ("DoxygenLua","SL_identifie... | 443 | false | false | 0 | 15 | 63 | 151 | 79 | 72 | null | null |
lunaris/hindent | src/HIndent/Pretty.hs | bsd-3-clause | exp x@XChildTag{} = pretty' x | 29 | exp x@XChildTag{} = pretty' x | 29 | exp x@XChildTag{} = pretty' x | 29 | false | false | 1 | 7 | 4 | 23 | 10 | 13 | null | null |
39aldo39/klfc | src/Xkb/Types.hs | gpl-3.0 | printTypes ∷ (Logger m, MonadReader XkbConfig m) ⇒ Layout → m (Maybe String)
printTypes = runMaybeT <<< prepareLayout >=> \layout → do
types ← nub <$> concatMapM (getTypes ∘ (layout ⊕) ∘ variantToLayout) ((∅) : view _variants layout)
guard (not (null types))
let virtualMods = S.unions (map __typeMods types)... | 908 | printTypes ∷ (Logger m, MonadReader XkbConfig m) ⇒ Layout → m (Maybe String)
printTypes = runMaybeT <<< prepareLayout >=> \layout → do
types ← nub <$> concatMapM (getTypes ∘ (layout ⊕) ∘ variantToLayout) ((∅) : view _variants layout)
guard (not (null types))
let virtualMods = S.unions (map __typeMods types)... | 908 | printTypes = runMaybeT <<< prepareLayout >=> \layout → do
types ← nub <$> concatMapM (getTypes ∘ (layout ⊕) ∘ variantToLayout) ((∅) : view _variants layout)
guard (not (null types))
let virtualMods = S.unions (map __typeMods types)
pure ∘ unlines $
[ "// Generated by KLFC " ⊕ versionStr
... | 831 | false | true | 0 | 17 | 247 | 294 | 155 | 139 | null | null |
urv/fixhs | src/Data/FIX/Spec/FIX43.hs | lgpl-2.1 | tLiquidityIndType :: FIXTag
tLiquidityIndType = FIXTag
{ tName = "LiquidityIndType"
, tnum = 409
, tparser = toFIXInt
, arbitraryValue = FIXInt <$> arbitrary } | 172 | tLiquidityIndType :: FIXTag
tLiquidityIndType = FIXTag
{ tName = "LiquidityIndType"
, tnum = 409
, tparser = toFIXInt
, arbitraryValue = FIXInt <$> arbitrary } | 172 | tLiquidityIndType = FIXTag
{ tName = "LiquidityIndType"
, tnum = 409
, tparser = toFIXInt
, arbitraryValue = FIXInt <$> arbitrary } | 144 | false | true | 0 | 8 | 37 | 45 | 26 | 19 | null | null |
ben-schulz/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | runIdeModeCommand h id orig fn modes (IdeMode.ErrString e) =
do ist <- getIState
let out = displayS . renderPretty 1.0 60 $ pprintErr ist e
msg = (IdeMode.SymbolAtom "ok", IdeMode.StringAtom $ out "")
runIO . hPutStrLn h $ IdeMode.convSExp "return" msg id | 276 | runIdeModeCommand h id orig fn modes (IdeMode.ErrString e) =
do ist <- getIState
let out = displayS . renderPretty 1.0 60 $ pprintErr ist e
msg = (IdeMode.SymbolAtom "ok", IdeMode.StringAtom $ out "")
runIO . hPutStrLn h $ IdeMode.convSExp "return" msg id | 276 | runIdeModeCommand h id orig fn modes (IdeMode.ErrString e) =
do ist <- getIState
let out = displayS . renderPretty 1.0 60 $ pprintErr ist e
msg = (IdeMode.SymbolAtom "ok", IdeMode.StringAtom $ out "")
runIO . hPutStrLn h $ IdeMode.convSExp "return" msg id | 276 | false | false | 0 | 12 | 62 | 109 | 51 | 58 | null | null |
susanctu/Haskell-In-Memory-DB | src/Server.hs | mit | bStRep = typeOf(B.empty) | 24 | bStRep = typeOf(B.empty) | 24 | bStRep = typeOf(B.empty) | 24 | false | false | 1 | 7 | 2 | 18 | 7 | 11 | null | null |
phischu/fragnix | builtins/base/GHC.IO.Handle.Text.hs | bsd-3-clause | hGetChar :: Handle -> IO Char
hGetChar handle =
wantReadableHandle_ "hGetChar" handle $ \handle_@Handle__{..} -> do
-- buffering mode makes no difference: we just read whatever is available
-- from the device (blocking only if there is nothing available), and then
-- return the first character.
-- See [note ... | 1,997 | hGetChar :: Handle -> IO Char
hGetChar handle =
wantReadableHandle_ "hGetChar" handle $ \handle_@Handle__{..} -> do
-- buffering mode makes no difference: we just read whatever is available
-- from the device (blocking only if there is nothing available), and then
-- return the first character.
-- See [note ... | 1,997 | hGetChar handle =
wantReadableHandle_ "hGetChar" handle $ \handle_@Handle__{..} -> do
-- buffering mode makes no difference: we just read whatever is available
-- from the device (blocking only if there is nothing available), and then
-- return the first character.
-- See [note Buffered Reading] in GHC.IO.Ha... | 1,967 | false | true | 0 | 22 | 683 | 329 | 162 | 167 | null | null |
paulolieuthier/criterion | Criterion/Types.hs | bsd-2-clause | whnf :: (a -> b) -> a -> Benchmarkable
whnf = pureFunc id | 57 | whnf :: (a -> b) -> a -> Benchmarkable
whnf = pureFunc id | 57 | whnf = pureFunc id | 18 | false | true | 0 | 8 | 12 | 36 | 16 | 20 | null | null |
HIPERFIT/futhark | src/Futhark/Optimise/Simplify/Rules/Simple.hs | isc | simplifyReshapeReplicate :: SimpleRule rep
simplifyReshapeReplicate defOf seType (Reshape newshape v)
| Just (BasicOp (Replicate _ se), v_cs) <- defOf v,
Just oldshape <- arrayShape <$> seType se,
shapeDims oldshape `isSuffixOf` newDims newshape =
let new =
take (length newshape - shapeRank olds... | 402 | simplifyReshapeReplicate :: SimpleRule rep
simplifyReshapeReplicate defOf seType (Reshape newshape v)
| Just (BasicOp (Replicate _ se), v_cs) <- defOf v,
Just oldshape <- arrayShape <$> seType se,
shapeDims oldshape `isSuffixOf` newDims newshape =
let new =
take (length newshape - shapeRank olds... | 402 | simplifyReshapeReplicate defOf seType (Reshape newshape v)
| Just (BasicOp (Replicate _ se), v_cs) <- defOf v,
Just oldshape <- arrayShape <$> seType se,
shapeDims oldshape `isSuffixOf` newDims newshape =
let new =
take (length newshape - shapeRank oldshape) $
newDims newshape
i... | 359 | false | true | 0 | 14 | 92 | 150 | 70 | 80 | null | null |
andorp/bead | test/Test/Property/EntityGen.hs | bsd-3-clause | roleGen = elements [Student, GroupAdmin, CourseAdmin, Admin] | 60 | roleGen = elements [Student, GroupAdmin, CourseAdmin, Admin] | 60 | roleGen = elements [Student, GroupAdmin, CourseAdmin, Admin] | 60 | false | false | 1 | 5 | 6 | 24 | 12 | 12 | null | null |
sergv/vector | Data/Vector.hs | bsd-3-clause | izipWithM_ = G.izipWithM_ | 25 | izipWithM_ = G.izipWithM_ | 25 | izipWithM_ = G.izipWithM_ | 25 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
byteally/dbrecord-opaleye | src/Opaleye/DBRecord.hs | bsd-3-clause | query :: forall db tab flds opFlds.
( Table db (tab Hask)
, Default ColumnMaker (HList Identity opFlds) (HList Identity opFlds)
, flds ~ (OriginalTableFields (tab Hask))
, opFlds ~ GetOpFields Op flds
, TabProps2 db tab flds
, Generic (tab Op)
, GRecToType Identit... | 572 | query :: forall db tab flds opFlds.
( Table db (tab Hask)
, Default ColumnMaker (HList Identity opFlds) (HList Identity opFlds)
, flds ~ (OriginalTableFields (tab Hask))
, opFlds ~ GetOpFields Op flds
, TabProps2 db tab flds
, Generic (tab Op)
, GRecToType Identit... | 572 | query tab =
let cols = getTableHFields (Proxy @db) (Proxy @(tab Hask))
in queryTable (O.Table (T.unpack $ getConst $ getTableName @db @(tab Hask)) (tabProps2 tab cols)) >>^ recToType | 186 | false | true | 0 | 14 | 153 | 256 | 126 | 130 | null | null |
lamdu/lamdu | src/Lamdu/GUI/Monad.hs | gpl-3.0 | readGuiAnchors :: MonadReader (Askable env i o) m => m (Anchors.GuiAnchors i o)
readGuiAnchors = Lens.view aGuiAnchors | 118 | readGuiAnchors :: MonadReader (Askable env i o) m => m (Anchors.GuiAnchors i o)
readGuiAnchors = Lens.view aGuiAnchors | 118 | readGuiAnchors = Lens.view aGuiAnchors | 38 | false | true | 0 | 9 | 16 | 48 | 23 | 25 | null | null |
hucal/SCMinHS | Scheme/Eval.hs | bsd-3-clause | evalExpr env fname s = liftIO $
runErrorT (readLisp fname s >>= eval env) >>=
return . either errToLisp id | 114 | evalExpr env fname s = liftIO $
runErrorT (readLisp fname s >>= eval env) >>=
return . either errToLisp id | 114 | evalExpr env fname s = liftIO $
runErrorT (readLisp fname s >>= eval env) >>=
return . either errToLisp id | 114 | false | false | 0 | 11 | 27 | 48 | 22 | 26 | null | null |
spechub/Hets | Static/DGTranslation.hs | gpl-2.0 | {- | get the maximal sublogic of a graph.
each DGraph and each node will be tested, in order to find
the maximal sublogic of th Graph.
All edges and nodes will be searched also in the meantime, so as to test,
whether the GMorphism of edges is homogeneous, and the logics of nodes are
equal. -}
getDGLogic :: LibEnv ... | 444 | getDGLogic :: LibEnv -> Result G_sublogics
getDGLogic libEnv =
mapM (getSublogicFromDGraph libEnv) (Map.keys libEnv)
>>= combineSublogics | 145 | getDGLogic libEnv =
mapM (getSublogicFromDGraph libEnv) (Map.keys libEnv)
>>= combineSublogics | 102 | true | true | 2 | 8 | 85 | 52 | 24 | 28 | null | null |
fmthoma/ghc | utils/ghc-cabal/Main.hs | bsd-3-clause | generate :: FilePath -> FilePath -> String -> [String] -> IO ()
generate directory distdir dll0Modules config_args
= withCurrentDirectory directory
$ do let verbosity = normal
-- XXX We shouldn't just configure with the default flags
-- XXX And this, and thus the "getPersistBuildConfig distdir" below,
... | 11,254 | generate :: FilePath -> FilePath -> String -> [String] -> IO ()
generate directory distdir dll0Modules config_args
= withCurrentDirectory directory
$ do let verbosity = normal
-- XXX We shouldn't just configure with the default flags
-- XXX And this, and thus the "getPersistBuildConfig distdir" below,
... | 11,254 | generate directory distdir dll0Modules config_args
= withCurrentDirectory directory
$ do let verbosity = normal
-- XXX We shouldn't just configure with the default flags
-- XXX And this, and thus the "getPersistBuildConfig distdir" below,
-- aren't going to work when the deps aren't built yet
... | 11,190 | false | true | 17 | 21 | 3,934 | 2,169 | 1,086 | 1,083 | null | null |
bgamari/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | macron 'o' = "ō" | 16 | macron 'o' = "ō" | 16 | macron 'o' = "ō" | 16 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
spechub/Hets | TPTP/Parser.hs | gpl-2.0 | -- <thf_subtype> ::= <thf_atom> <subtype_sign> <thf_atom>
thf_subtype :: CharParser st THF_subtype
thf_subtype = parserTrace "thf_subtype" ((do
c1 <- try (thf_atom << subtype_sign)
c2 <- thf_atom
return $ THF_subtype c1 c2)
<?> "thf_subtype"
) | 262 | thf_subtype :: CharParser st THF_subtype
thf_subtype = parserTrace "thf_subtype" ((do
c1 <- try (thf_atom << subtype_sign)
c2 <- thf_atom
return $ THF_subtype c1 c2)
<?> "thf_subtype"
) | 195 | thf_subtype = parserTrace "thf_subtype" ((do
c1 <- try (thf_atom << subtype_sign)
c2 <- thf_atom
return $ THF_subtype c1 c2)
<?> "thf_subtype"
) | 154 | true | true | 0 | 14 | 51 | 68 | 33 | 35 | null | null |
MarcoSero/Norvigs-Spelling-Corrector | src/Spelling.hs | mit | edits1 :: B.ByteString -> WordSet
edits1 w = S.fromList $ deletes ++ transposes ++ replaces ++ inserts
where splits :: [(B.ByteString, B.ByteString)]
splits = [ B.splitAt n w | n <- [0 .. B.length w - 1] ]
deletes :: [B.ByteString]
deletes = map (\(a, b) -> B.concat[a, B.tail b]) splits
... | 740 | edits1 :: B.ByteString -> WordSet
edits1 w = S.fromList $ deletes ++ transposes ++ replaces ++ inserts
where splits :: [(B.ByteString, B.ByteString)]
splits = [ B.splitAt n w | n <- [0 .. B.length w - 1] ]
deletes :: [B.ByteString]
deletes = map (\(a, b) -> B.concat[a, B.tail b]) splits
... | 740 | edits1 w = S.fromList $ deletes ++ transposes ++ replaces ++ inserts
where splits :: [(B.ByteString, B.ByteString)]
splits = [ B.splitAt n w | n <- [0 .. B.length w - 1] ]
deletes :: [B.ByteString]
deletes = map (\(a, b) -> B.concat[a, B.tail b]) splits
transposes :: [B.ByteString]
... | 706 | false | true | 2 | 11 | 242 | 369 | 187 | 182 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.