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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
TomMD/ghc | compiler/prelude/THNames.hs | bsd-3-clause | tildePName = libFun (fsLit "tildeP") tildePIdKey | 48 | tildePName = libFun (fsLit "tildeP") tildePIdKey | 48 | tildePName = libFun (fsLit "tildeP") tildePIdKey | 48 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
mb21/qua-kit | apps/hs/qua-server/src/Handler/Mooc.hs | mit | fetchReviews :: UserId -> Handler [(UTCTime, Widget)]
fetchReviews uId = do
reviewData <- runDB $ select $
from $ \(review
`InnerJoin` scenario
`InnerJoin` criterion
`InnerJoin` user
) -> do
on (review ^. ReviewReviewerId ==. user ^. UserId)
on (review ^. ReviewCriterionId ==. criterion ^. CriterionId)
on (review ^. ReviewScenarioId ==. scenario ^. ScenarioId)
where_ $ scenario ^. ScenarioAuthorId ==. val uId
orderBy [desc $ review ^. ReviewTimestamp]
limit newsLimit
return (review, scenario, criterion, user)
let renderReview (Entity _ r, Entity _ sc, Entity _ crit, Entity _ reviewer) =
let critIcon = Blaze.preEscapedToMarkup $ criterionIcon crit
widget =
[whamlet|
^{viewSubmissionBtn sc}
<p .commentPara>
<span .critIcon>#{ critIcon }
<span class="icon icon24 text-brand-accent">
$if reviewPositive r
thumb_up
$else
thumb_down
Review from #{userName reviewer}
<p>
#{reviewComment r}
|]
in (reviewTimestamp r, widget)
return $ map renderReview reviewData | 1,462 | fetchReviews :: UserId -> Handler [(UTCTime, Widget)]
fetchReviews uId = do
reviewData <- runDB $ select $
from $ \(review
`InnerJoin` scenario
`InnerJoin` criterion
`InnerJoin` user
) -> do
on (review ^. ReviewReviewerId ==. user ^. UserId)
on (review ^. ReviewCriterionId ==. criterion ^. CriterionId)
on (review ^. ReviewScenarioId ==. scenario ^. ScenarioId)
where_ $ scenario ^. ScenarioAuthorId ==. val uId
orderBy [desc $ review ^. ReviewTimestamp]
limit newsLimit
return (review, scenario, criterion, user)
let renderReview (Entity _ r, Entity _ sc, Entity _ crit, Entity _ reviewer) =
let critIcon = Blaze.preEscapedToMarkup $ criterionIcon crit
widget =
[whamlet|
^{viewSubmissionBtn sc}
<p .commentPara>
<span .critIcon>#{ critIcon }
<span class="icon icon24 text-brand-accent">
$if reviewPositive r
thumb_up
$else
thumb_down
Review from #{userName reviewer}
<p>
#{reviewComment r}
|]
in (reviewTimestamp r, widget)
return $ map renderReview reviewData | 1,462 | fetchReviews uId = do
reviewData <- runDB $ select $
from $ \(review
`InnerJoin` scenario
`InnerJoin` criterion
`InnerJoin` user
) -> do
on (review ^. ReviewReviewerId ==. user ^. UserId)
on (review ^. ReviewCriterionId ==. criterion ^. CriterionId)
on (review ^. ReviewScenarioId ==. scenario ^. ScenarioId)
where_ $ scenario ^. ScenarioAuthorId ==. val uId
orderBy [desc $ review ^. ReviewTimestamp]
limit newsLimit
return (review, scenario, criterion, user)
let renderReview (Entity _ r, Entity _ sc, Entity _ crit, Entity _ reviewer) =
let critIcon = Blaze.preEscapedToMarkup $ criterionIcon crit
widget =
[whamlet|
^{viewSubmissionBtn sc}
<p .commentPara>
<span .critIcon>#{ critIcon }
<span class="icon icon24 text-brand-accent">
$if reviewPositive r
thumb_up
$else
thumb_down
Review from #{userName reviewer}
<p>
#{reviewComment r}
|]
in (reviewTimestamp r, widget)
return $ map renderReview reviewData | 1,408 | false | true | 0 | 17 | 632 | 296 | 148 | 148 | null | null |
arnizamani/aiw | Instances.hs | gpl-2.0 | getConstsAx :: Axiom -> [String]
getConstsAx (Axiom (_,_,_,_,_,(x,_,y))) = getConsts x ++ getConsts y | 101 | getConstsAx :: Axiom -> [String]
getConstsAx (Axiom (_,_,_,_,_,(x,_,y))) = getConsts x ++ getConsts y | 101 | getConstsAx (Axiom (_,_,_,_,_,(x,_,y))) = getConsts x ++ getConsts y | 68 | false | true | 0 | 11 | 13 | 69 | 37 | 32 | null | null |
nomeata/ghc | compiler/cmm/CmmCommonBlockElim.hs | bsd-3-clause | iterate :: [(HashCode,CmmBlock)] -> BlockEnv BlockId -> BlockEnv BlockId
iterate blocks subst =
case foldl common_block (False, emptyUFM, subst) blocks of
(changed, _, subst)
| changed -> iterate blocks subst
| otherwise -> subst | 252 | iterate :: [(HashCode,CmmBlock)] -> BlockEnv BlockId -> BlockEnv BlockId
iterate blocks subst =
case foldl common_block (False, emptyUFM, subst) blocks of
(changed, _, subst)
| changed -> iterate blocks subst
| otherwise -> subst | 252 | iterate blocks subst =
case foldl common_block (False, emptyUFM, subst) blocks of
(changed, _, subst)
| changed -> iterate blocks subst
| otherwise -> subst | 179 | false | true | 0 | 10 | 56 | 99 | 49 | 50 | null | null |
Jiggins/Matrix | Math/Vector.hs | gpl-3.0 | -- | Multiply a functor (Matrix or Vector) by a scalar
(<·) :: (Functor f, Num a) => a -> f a -> f a
scalar <· vector = vector ·> scalar | 136 | (<·) :: (Functor f, Num a) => a -> f a -> f a
scalar <· vector = vector ·> scalar | 81 | scalar <· vector = vector ·> scalar | 35 | true | true | 0 | 10 | 31 | 57 | 28 | 29 | null | null |
a1880/xor | xcnf-preprocess/XorGauss.hs | gpl-3.0 | gaussEliminate :: VarHeuristic -> ClauseHeuristic -> [Clause] -> [Clause]
gaussEliminate varH clauseH clauses = gauss varOrder clauseH xors ++ cnf
where
varOrder = varH clauses
xors = filter isXor clauses
cnf = filter (not . isXor) clauses | 267 | gaussEliminate :: VarHeuristic -> ClauseHeuristic -> [Clause] -> [Clause]
gaussEliminate varH clauseH clauses = gauss varOrder clauseH xors ++ cnf
where
varOrder = varH clauses
xors = filter isXor clauses
cnf = filter (not . isXor) clauses | 267 | gaussEliminate varH clauseH clauses = gauss varOrder clauseH xors ++ cnf
where
varOrder = varH clauses
xors = filter isXor clauses
cnf = filter (not . isXor) clauses | 193 | false | true | 2 | 8 | 64 | 97 | 44 | 53 | null | null |
ramaciotti/dependent-types | src/lib/DependentTypes/Semantic.hs | gpl-3.0 | checkConsSignature :: Env -> String -> Signature -> IO ()
checkConsSignature env name (Signature []) = error $ name ++ ": Constructor must have signature" | 154 | checkConsSignature :: Env -> String -> Signature -> IO ()
checkConsSignature env name (Signature []) = error $ name ++ ": Constructor must have signature" | 154 | checkConsSignature env name (Signature []) = error $ name ++ ": Constructor must have signature" | 96 | false | true | 0 | 9 | 24 | 51 | 25 | 26 | null | null |
nimia/bottle | codeedit/Editor/BottleWidgets.hs | gpl-3.0 | vboxK :: [(key, Widget f)] -> KBox key f
vboxK = vboxAlignK 0.5 | 63 | vboxK :: [(key, Widget f)] -> KBox key f
vboxK = vboxAlignK 0.5 | 63 | vboxK = vboxAlignK 0.5 | 22 | false | true | 0 | 8 | 12 | 35 | 18 | 17 | null | null |
danidiaz/dani-dn | library/Data/Dani/Encode.hs | mit | escapeText :: Char -> (Char -> Bool) -> T.Text -> B.Builder
escapeText c ef = go mempty
where
go acc txt =
let (prefix, T.uncons -> msuffix) = T.break ef txt
acc' = acc <> B.fromText prefix
in
case msuffix of
Nothing -> acc'
Just (c', suffix) ->
go (acc' <> escapeChar c') suffix
escapeChar z = B.singleton c <> B.singleton z | 416 | escapeText :: Char -> (Char -> Bool) -> T.Text -> B.Builder
escapeText c ef = go mempty
where
go acc txt =
let (prefix, T.uncons -> msuffix) = T.break ef txt
acc' = acc <> B.fromText prefix
in
case msuffix of
Nothing -> acc'
Just (c', suffix) ->
go (acc' <> escapeChar c') suffix
escapeChar z = B.singleton c <> B.singleton z | 416 | escapeText c ef = go mempty
where
go acc txt =
let (prefix, T.uncons -> msuffix) = T.break ef txt
acc' = acc <> B.fromText prefix
in
case msuffix of
Nothing -> acc'
Just (c', suffix) ->
go (acc' <> escapeChar c') suffix
escapeChar z = B.singleton c <> B.singleton z | 356 | false | true | 0 | 13 | 152 | 162 | 79 | 83 | null | null |
notogawa/monarch | src/Database/Monarch/Types.hs | bsd-3-clause | -- | Run Monarch with TokyoTyrant at target host and port.
runMonarch :: MonadIO m =>
Connection
-> MonarchT m a
-> m (Either Code a)
runMonarch conn action =
runReaderT (runErrorT $ unMonarchT action) conn | 246 | runMonarch :: MonadIO m =>
Connection
-> MonarchT m a
-> m (Either Code a)
runMonarch conn action =
runReaderT (runErrorT $ unMonarchT action) conn | 187 | runMonarch conn action =
runReaderT (runErrorT $ unMonarchT action) conn | 76 | true | true | 0 | 11 | 75 | 68 | 31 | 37 | null | null |
HIPERFIT/futhark | src/Futhark/CodeGen/RTS/JavaScript.hs | isc | -- | @rts/javascript/server.js@
serverJs :: T.Text
serverJs = $(embedStringFile "rts/javascript/server.js") | 107 | serverJs :: T.Text
serverJs = $(embedStringFile "rts/javascript/server.js") | 75 | serverJs = $(embedStringFile "rts/javascript/server.js") | 56 | true | true | 0 | 7 | 9 | 21 | 11 | 10 | null | null |
kirhgoff/haskell-sandbox | euler40/euler40.hs | mit | digit :: Integer -> Integer
digit a
| a < 10 = a
| a >= 10 && a < 20 && (a `mod` 2 == 0) = 1
| a >= 10 && a < 20 && (a `mod` 2 == 1) = a `mod` 10 `quot` 2 | 161 | digit :: Integer -> Integer
digit a
| a < 10 = a
| a >= 10 && a < 20 && (a `mod` 2 == 0) = 1
| a >= 10 && a < 20 && (a `mod` 2 == 1) = a `mod` 10 `quot` 2 | 161 | digit a
| a < 10 = a
| a >= 10 && a < 20 && (a `mod` 2 == 0) = 1
| a >= 10 && a < 20 && (a `mod` 2 == 1) = a `mod` 10 `quot` 2 | 133 | false | true | 0 | 11 | 55 | 121 | 63 | 58 | null | null |
jeffreyrosenbluth/Cards | src/Lib.hs | bsd-3-clause | deal :: MonadRandom m => Int -> Int -> [[Card -> Bool]] -> m [[Card]]
deal m n ps = do
let ps' = take m $ ps <> replicate (m - length ps) []
go (q:qs) d = do
h <- fillWithPreds d n q
t <- go qs (d \\ h)
return $ h:t
go [] _ = return []
go ps' deck | 287 | deal :: MonadRandom m => Int -> Int -> [[Card -> Bool]] -> m [[Card]]
deal m n ps = do
let ps' = take m $ ps <> replicate (m - length ps) []
go (q:qs) d = do
h <- fillWithPreds d n q
t <- go qs (d \\ h)
return $ h:t
go [] _ = return []
go ps' deck | 287 | deal m n ps = do
let ps' = take m $ ps <> replicate (m - length ps) []
go (q:qs) d = do
h <- fillWithPreds d n q
t <- go qs (d \\ h)
return $ h:t
go [] _ = return []
go ps' deck | 217 | false | true | 0 | 16 | 104 | 184 | 87 | 97 | null | null |
CulpaBS/wbBach | src/Futhark/Representation/SOACS/Simplify.hs | bsd-3-clause | removeReplicateRedomap _ _ = cannotSimplify | 43 | removeReplicateRedomap _ _ = cannotSimplify | 43 | removeReplicateRedomap _ _ = cannotSimplify | 43 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
albertoruiz/hTensor | lib/Numeric/LinearAlgebra/Array/Decomposition.hs | bsd-3-clause | hosvd :: Array Double -> [Array Double]
hosvd a = truncateFactors rs h where
(h,info) = hosvd' a
rs = map fst info
-- get the matrices of the flattened tensor for all dimensions | 187 | hosvd :: Array Double -> [Array Double]
hosvd a = truncateFactors rs h where
(h,info) = hosvd' a
rs = map fst info
-- get the matrices of the flattened tensor for all dimensions | 187 | hosvd a = truncateFactors rs h where
(h,info) = hosvd' a
rs = map fst info
-- get the matrices of the flattened tensor for all dimensions | 147 | false | true | 0 | 7 | 43 | 60 | 30 | 30 | null | null |
asi1024/haling | src/Typing.hs | mit | tyPrim "<=" ty1 ty2 = ([(ty1, tyInt), (ty2, tyInt)], tyBool) | 60 | tyPrim "<=" ty1 ty2 = ([(ty1, tyInt), (ty2, tyInt)], tyBool) | 60 | tyPrim "<=" ty1 ty2 = ([(ty1, tyInt), (ty2, tyInt)], tyBool) | 60 | false | false | 0 | 7 | 9 | 37 | 22 | 15 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrimOp.hs | bsd-3-clause | primOpInfo CtzOp = mkMonadic (fsLit "ctz#") wordPrimTy | 54 | primOpInfo CtzOp = mkMonadic (fsLit "ctz#") wordPrimTy | 54 | primOpInfo CtzOp = mkMonadic (fsLit "ctz#") wordPrimTy | 54 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
keithodulaigh/Hets | HasCASL/Sublogic.hs | gpl-2.0 | need_ghorn :: Sublogic
need_ghorn = bottom { which_logic = GHorn } | 66 | need_ghorn :: Sublogic
need_ghorn = bottom { which_logic = GHorn } | 66 | need_ghorn = bottom { which_logic = GHorn } | 43 | false | true | 0 | 6 | 10 | 19 | 11 | 8 | null | null |
ocramz/slepc-hs | src/Numerical/SLEPc/Raw/PutGet.hs | lgpl-3.0 | validDims (MIVarNZPR mi nnz) =
validDims' mi && length nnz == matRows mi && all withinCols nnz where
withinCols x = x >= 0 && x <= matCols mi | 147 | validDims (MIVarNZPR mi nnz) =
validDims' mi && length nnz == matRows mi && all withinCols nnz where
withinCols x = x >= 0 && x <= matCols mi | 147 | validDims (MIVarNZPR mi nnz) =
validDims' mi && length nnz == matRows mi && all withinCols nnz where
withinCols x = x >= 0 && x <= matCols mi | 147 | false | false | 0 | 9 | 34 | 69 | 31 | 38 | null | null |
sdiehl/ghc | compiler/typecheck/Constraint.hs | bsd-3-clause | -- Consider: Put the new constraints at the front, so they get solved first
addImplics :: WantedConstraints -> Bag Implication -> WantedConstraints
addImplics wc implic = wc { wc_impl = wc_impl wc `unionBags` implic } | 218 | addImplics :: WantedConstraints -> Bag Implication -> WantedConstraints
addImplics wc implic = wc { wc_impl = wc_impl wc `unionBags` implic } | 141 | addImplics wc implic = wc { wc_impl = wc_impl wc `unionBags` implic } | 69 | true | true | 0 | 9 | 35 | 51 | 25 | 26 | null | null |
beni55/http-types | test/runtests.hs | bsd-3-clause | main :: IO ()
main = hspec $ do
describe "encode/decode path" $ do
it "is identity to encode and then decode" $
property propEncodeDecodePath
it "does not escape period and dash" $
Blaze.toByteString (encodePath ["foo-bar.baz"] []) `shouldBe` "/foo-bar.baz"
describe "encode/decode query" $ do
it "is identity to encode and then decode" $
property propEncodeDecodeQuery
it "add ? in front of Query if and only if necessary" $
property propQueryQuestionMark
describe "encode/decode path segments" $ do
it "is identity to encode and then decode" $
property propEncodeDecodePathSegments
describe "encode ByteRanges" $ do
it "first 500 bytes" $
renderByteRanges [ByteRangeFromTo 0 499] `shouldBe` "bytes=0-499"
it "second 500 bytes" $
renderByteRanges [ByteRangeFromTo 500 999] `shouldBe` "bytes=500-999"
it "final 500 bytes" $
renderByteRanges [ByteRangeSuffix 500] `shouldBe` "bytes=-500"
it "final 500 bytes (of 1000, absolute)" $
renderByteRanges [ByteRangeFrom 9500] `shouldBe` "bytes=9500-"
it "first and last bytes only" $
renderByteRanges [ByteRangeFromTo 0 0, ByteRangeSuffix 1] `shouldBe` "bytes=0-0,-1"
it "non-canonical second 500 bytes (1)" $
renderByteRanges [ByteRangeFromTo 500 600, ByteRangeFromTo 601 999] `shouldBe` "bytes=500-600,601-999"
it "non-canonical second 500 bytes (2)" $
renderByteRanges [ByteRangeFromTo 500 700, ByteRangeFromTo 601 999] `shouldBe` "bytes=500-700,601-999" | 1,586 | main :: IO ()
main = hspec $ do
describe "encode/decode path" $ do
it "is identity to encode and then decode" $
property propEncodeDecodePath
it "does not escape period and dash" $
Blaze.toByteString (encodePath ["foo-bar.baz"] []) `shouldBe` "/foo-bar.baz"
describe "encode/decode query" $ do
it "is identity to encode and then decode" $
property propEncodeDecodeQuery
it "add ? in front of Query if and only if necessary" $
property propQueryQuestionMark
describe "encode/decode path segments" $ do
it "is identity to encode and then decode" $
property propEncodeDecodePathSegments
describe "encode ByteRanges" $ do
it "first 500 bytes" $
renderByteRanges [ByteRangeFromTo 0 499] `shouldBe` "bytes=0-499"
it "second 500 bytes" $
renderByteRanges [ByteRangeFromTo 500 999] `shouldBe` "bytes=500-999"
it "final 500 bytes" $
renderByteRanges [ByteRangeSuffix 500] `shouldBe` "bytes=-500"
it "final 500 bytes (of 1000, absolute)" $
renderByteRanges [ByteRangeFrom 9500] `shouldBe` "bytes=9500-"
it "first and last bytes only" $
renderByteRanges [ByteRangeFromTo 0 0, ByteRangeSuffix 1] `shouldBe` "bytes=0-0,-1"
it "non-canonical second 500 bytes (1)" $
renderByteRanges [ByteRangeFromTo 500 600, ByteRangeFromTo 601 999] `shouldBe` "bytes=500-600,601-999"
it "non-canonical second 500 bytes (2)" $
renderByteRanges [ByteRangeFromTo 500 700, ByteRangeFromTo 601 999] `shouldBe` "bytes=500-700,601-999" | 1,586 | main = hspec $ do
describe "encode/decode path" $ do
it "is identity to encode and then decode" $
property propEncodeDecodePath
it "does not escape period and dash" $
Blaze.toByteString (encodePath ["foo-bar.baz"] []) `shouldBe` "/foo-bar.baz"
describe "encode/decode query" $ do
it "is identity to encode and then decode" $
property propEncodeDecodeQuery
it "add ? in front of Query if and only if necessary" $
property propQueryQuestionMark
describe "encode/decode path segments" $ do
it "is identity to encode and then decode" $
property propEncodeDecodePathSegments
describe "encode ByteRanges" $ do
it "first 500 bytes" $
renderByteRanges [ByteRangeFromTo 0 499] `shouldBe` "bytes=0-499"
it "second 500 bytes" $
renderByteRanges [ByteRangeFromTo 500 999] `shouldBe` "bytes=500-999"
it "final 500 bytes" $
renderByteRanges [ByteRangeSuffix 500] `shouldBe` "bytes=-500"
it "final 500 bytes (of 1000, absolute)" $
renderByteRanges [ByteRangeFrom 9500] `shouldBe` "bytes=9500-"
it "first and last bytes only" $
renderByteRanges [ByteRangeFromTo 0 0, ByteRangeSuffix 1] `shouldBe` "bytes=0-0,-1"
it "non-canonical second 500 bytes (1)" $
renderByteRanges [ByteRangeFromTo 500 600, ByteRangeFromTo 601 999] `shouldBe` "bytes=500-600,601-999"
it "non-canonical second 500 bytes (2)" $
renderByteRanges [ByteRangeFromTo 500 700, ByteRangeFromTo 601 999] `shouldBe` "bytes=500-700,601-999" | 1,572 | false | true | 2 | 15 | 370 | 360 | 164 | 196 | null | null |
ozgurakgun/Idris-dev | src/Idris/Parser/Helpers.hs | bsd-3-clause | symbolFC :: MonadicParsing m => String -> m FC
symbolFC str = do (FC file (l, c) _) <- getFC
Tok.symbol str
return $ FC file (l, c) (l, c + length str)
-- | Parses a reserved identifier | 222 | symbolFC :: MonadicParsing m => String -> m FC
symbolFC str = do (FC file (l, c) _) <- getFC
Tok.symbol str
return $ FC file (l, c) (l, c + length str)
-- | Parses a reserved identifier | 222 | symbolFC str = do (FC file (l, c) _) <- getFC
Tok.symbol str
return $ FC file (l, c) (l, c + length str)
-- | Parses a reserved identifier | 175 | false | true | 0 | 11 | 75 | 93 | 46 | 47 | null | null |
sordina/GLM | src/GLM/Parser.hs | mit | nested :: [T.Token] -> T.T EntryItem
nested p = Nested <$> braced p | 67 | nested :: [T.Token] -> T.T EntryItem
nested p = Nested <$> braced p | 67 | nested p = Nested <$> braced p | 30 | false | true | 2 | 8 | 12 | 41 | 18 | 23 | null | null |
dylanmc/cryptol | sbv/Data/SBV/BitVectors/AlgReals.hs | bsd-3-clause | lift2 nm _ a b = error $ "AlgReal." ++ nm ++ ": unsupported arguments: " ++ show (a, b) | 125 | lift2 nm _ a b = error $ "AlgReal." ++ nm ++ ": unsupported arguments: " ++ show (a, b) | 125 | lift2 nm _ a b = error $ "AlgReal." ++ nm ++ ": unsupported arguments: " ++ show (a, b) | 125 | false | false | 0 | 8 | 57 | 40 | 20 | 20 | null | null |
sru-systems/protobuf-simple | src/Data/ProtoBuf/WireTag.hs | mit | -- | Convert a WireTag into a Word32.
fromWireTag :: WireTag -> Word32
fromWireTag (WireTag fn wt) = fromFieldNumber fn .|. fromWireType wt | 139 | fromWireTag :: WireTag -> Word32
fromWireTag (WireTag fn wt) = fromFieldNumber fn .|. fromWireType wt | 101 | fromWireTag (WireTag fn wt) = fromFieldNumber fn .|. fromWireType wt | 68 | true | true | 0 | 9 | 22 | 42 | 19 | 23 | null | null |
cchalmers/dense | src/Data/Dense/Generic.hs | bsd-3-clause | -- | 1D arrays are just vectors. You are free to change the length of
-- the vector when going 'over' this 'Iso' (unlike 'linear').
--
-- Note that 'V1' arrays are an instance of 'Vector' so you can use
-- any of the functions in "Data.Vector.Generic" on them without
-- needing to convert.
flat :: Vector w b => Iso (Array v V1 a) (Array w V1 b) (v a) (w b)
flat = iso (\(Array _ v) -> v) (\v -> Array (V1 $ G.length v) v) | 431 | flat :: Vector w b => Iso (Array v V1 a) (Array w V1 b) (v a) (w b)
flat = iso (\(Array _ v) -> v) (\v -> Array (V1 $ G.length v) v) | 132 | flat = iso (\(Array _ v) -> v) (\v -> Array (V1 $ G.length v) v) | 64 | true | true | 0 | 12 | 96 | 119 | 61 | 58 | null | null |
francesco-kriegel/conexp-hs | src/NextClosure/FormalImplications.hs | apache-2.0 | -- this method tests, whether an attribute list respects all implications in a list
x ??? impls
= all (x ??) impls | 116 | x ??? impls
= all (x ??) impls | 32 | x ??? impls
= all (x ??) impls | 32 | true | false | 3 | 6 | 23 | 25 | 11 | 14 | null | null |
snoyberg/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | narrowOp Narrow16WordOp = Just (MO_UU_Conv, W16) | 48 | narrowOp Narrow16WordOp = Just (MO_UU_Conv, W16) | 48 | narrowOp Narrow16WordOp = Just (MO_UU_Conv, W16) | 48 | false | false | 0 | 6 | 5 | 18 | 9 | 9 | null | null |
green-haskell/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | isExprHoleCt _ = False | 22 | isExprHoleCt _ = False | 22 | isExprHoleCt _ = False | 22 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
olsner/ghc | compiler/coreSyn/CoreStats.hs | bsd-3-clause | exprStats (App f a) = exprStats f `plusCS` exprStats a | 60 | exprStats (App f a) = exprStats f `plusCS` exprStats a | 60 | exprStats (App f a) = exprStats f `plusCS` exprStats a | 60 | false | false | 0 | 7 | 15 | 29 | 14 | 15 | null | null |
TravisWhitaker/BroScore-backend | BroScore/WebHandlers.hs | mit | mkUserHandler :: BroAction
mkUserHandler bs = do
un <- param "username"
pw <- param "password"
liftIO (mkUser bs un pw) >>= \case Left s -> status s
Right k -> json $ object ["key" .= (encode k)] | 246 | mkUserHandler :: BroAction
mkUserHandler bs = do
un <- param "username"
pw <- param "password"
liftIO (mkUser bs un pw) >>= \case Left s -> status s
Right k -> json $ object ["key" .= (encode k)] | 246 | mkUserHandler bs = do
un <- param "username"
pw <- param "password"
liftIO (mkUser bs un pw) >>= \case Left s -> status s
Right k -> json $ object ["key" .= (encode k)] | 219 | false | true | 0 | 17 | 87 | 103 | 45 | 58 | null | null |
puffnfresh/language-scala | test/golden/Main.hs | mit | main :: IO ()
main =
tests >>= defaultMain | 44 | main :: IO ()
main =
tests >>= defaultMain | 44 | main =
tests >>= defaultMain | 30 | false | true | 0 | 6 | 10 | 20 | 10 | 10 | null | null |
TomMD/cryptol | src/Cryptol/Eval/Value.hs | bsd-3-clause | isTSeq :: TValue -> Maybe (TValue, TValue)
isTSeq (TValue (TCon (TC TCSeq) [t1,t2])) = Just (TValue t1, TValue t2) | 114 | isTSeq :: TValue -> Maybe (TValue, TValue)
isTSeq (TValue (TCon (TC TCSeq) [t1,t2])) = Just (TValue t1, TValue t2) | 114 | isTSeq (TValue (TCon (TC TCSeq) [t1,t2])) = Just (TValue t1, TValue t2) | 71 | false | true | 0 | 11 | 18 | 68 | 35 | 33 | null | null |
patperry/hs-gsl-random | lib/GSL/Random/Quasi/Internal.hs | bsd-3-clause | getReverseHalton :: IO QRNGType
getReverseHalton = gsl_qrng_get_reversehalton >>= (return . MkQRNGType) | 103 | getReverseHalton :: IO QRNGType
getReverseHalton = gsl_qrng_get_reversehalton >>= (return . MkQRNGType) | 103 | getReverseHalton = gsl_qrng_get_reversehalton >>= (return . MkQRNGType) | 71 | false | true | 0 | 7 | 10 | 25 | 13 | 12 | null | null |
YelaSeamless/cgrep | src/CGrep/Lang.hs | gpl-2.0 | forcedLang :: Options -> Maybe Lang
forcedLang Options{ force_language = l }
| Nothing <- l = Nothing
| otherwise = Map.lookup (Ext $ fromJust l) langRevMap <|> Map.lookup (Name $ fromJust l) langRevMap | 213 | forcedLang :: Options -> Maybe Lang
forcedLang Options{ force_language = l }
| Nothing <- l = Nothing
| otherwise = Map.lookup (Ext $ fromJust l) langRevMap <|> Map.lookup (Name $ fromJust l) langRevMap | 213 | forcedLang Options{ force_language = l }
| Nothing <- l = Nothing
| otherwise = Map.lookup (Ext $ fromJust l) langRevMap <|> Map.lookup (Name $ fromJust l) langRevMap | 177 | false | true | 3 | 10 | 44 | 93 | 43 | 50 | null | null |
AKST/Data-mining | haskell/src/Localise.hs | mit | getIdentifier :: Learner t Word64
getIdentifier = do
idenifier <- use idenifierCount
idenifierCount %= (+) 1
return idenifier | 131 | getIdentifier :: Learner t Word64
getIdentifier = do
idenifier <- use idenifierCount
idenifierCount %= (+) 1
return idenifier | 131 | getIdentifier = do
idenifier <- use idenifierCount
idenifierCount %= (+) 1
return idenifier | 97 | false | true | 0 | 8 | 23 | 44 | 20 | 24 | null | null |
seckcoder/lang-learn | haskell/algo/src/Algo/List.hs | unlicense | inRange :: Int -> (Int,Int) -> Bool
inRange x (p,r) = p <= x && x <= r | 70 | inRange :: Int -> (Int,Int) -> Bool
inRange x (p,r) = p <= x && x <= r | 70 | inRange x (p,r) = p <= x && x <= r | 34 | false | true | 6 | 9 | 17 | 59 | 29 | 30 | null | null |
sdiehl/ghc | compiler/GHC/StgToCmm/ArgRep.hs | bsd-3-clause | argRepString N = "N" | 20 | argRepString N = "N" | 20 | argRepString N = "N" | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
davmre/matrizer | src/Matrizer/Analysis.hs | gpl-2.0 | -- for now, let's say we can only apply linsolve to square matrices
prodSizeCheck r1 c1 r2 _ = (c1 == r2) | 105 | prodSizeCheck r1 c1 r2 _ = (c1 == r2) | 37 | prodSizeCheck r1 c1 r2 _ = (c1 == r2) | 37 | true | false | 0 | 6 | 21 | 23 | 12 | 11 | null | null |
2ion/yst | Yst/Data.hs | gpl-2.0 | applyDataOption :: Node -> DataOption -> Node
applyDataOption (NList ns) (Limit lim) =
NList $ take lim ns | 108 | applyDataOption :: Node -> DataOption -> Node
applyDataOption (NList ns) (Limit lim) =
NList $ take lim ns | 108 | applyDataOption (NList ns) (Limit lim) =
NList $ take lim ns | 62 | false | true | 2 | 10 | 19 | 53 | 23 | 30 | null | null |
kim/amazonka | amazonka-cognito-sync/gen/Network/AWS/CognitoSync/GetBulkPublishDetails.hs | mpl-2.0 | -- | 'GetBulkPublishDetailsResponse' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'gbpdrBulkPublishCompleteTime' @::@ 'Maybe' 'UTCTime'
--
-- * 'gbpdrBulkPublishStartTime' @::@ 'Maybe' 'UTCTime'
--
-- * 'gbpdrBulkPublishStatus' @::@ 'Maybe' 'BulkPublishStatus'
--
-- * 'gbpdrFailureMessage' @::@ 'Maybe' 'Text'
--
-- * 'gbpdrIdentityPoolId' @::@ 'Maybe' 'Text'
--
getBulkPublishDetailsResponse :: GetBulkPublishDetailsResponse
getBulkPublishDetailsResponse = GetBulkPublishDetailsResponse
{ _gbpdrIdentityPoolId = Nothing
, _gbpdrBulkPublishStartTime = Nothing
, _gbpdrBulkPublishCompleteTime = Nothing
, _gbpdrBulkPublishStatus = Nothing
, _gbpdrFailureMessage = Nothing
} | 762 | getBulkPublishDetailsResponse :: GetBulkPublishDetailsResponse
getBulkPublishDetailsResponse = GetBulkPublishDetailsResponse
{ _gbpdrIdentityPoolId = Nothing
, _gbpdrBulkPublishStartTime = Nothing
, _gbpdrBulkPublishCompleteTime = Nothing
, _gbpdrBulkPublishStatus = Nothing
, _gbpdrFailureMessage = Nothing
} | 360 | getBulkPublishDetailsResponse = GetBulkPublishDetailsResponse
{ _gbpdrIdentityPoolId = Nothing
, _gbpdrBulkPublishStartTime = Nothing
, _gbpdrBulkPublishCompleteTime = Nothing
, _gbpdrBulkPublishStatus = Nothing
, _gbpdrFailureMessage = Nothing
} | 297 | true | true | 0 | 6 | 126 | 57 | 41 | 16 | null | null |
jbracker/supermonad-plugin | examples/monad/hmtc/original/Env.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- Test utilities
------------------------------------------------------------------------------
-- A faulty top-level environment
env1 = mkTopLvlEnv [("T1", Integer), ("T2", Integer), ("T1", Integer)] [] | 284 | env1 = mkTopLvlEnv [("T1", Integer), ("T2", Integer), ("T1", Integer)] [] | 73 | env1 = mkTopLvlEnv [("T1", Integer), ("T2", Integer), ("T1", Integer)] [] | 73 | true | false | 1 | 7 | 20 | 48 | 28 | 20 | null | null |
gree/haskell-prefork | src/System/Prefork/Worker.hs | mit | forkWorkerProcessWithArgs :: (WorkerContext a)
=> a -- ^ a worker context
-> [String] -- ^ command line arguments
-> IO ProcessID -- ^ a process id of a created worker
forkWorkerProcessWithArgs opt args = do
exe <- liftM encodeString getArgv0
(Just hIn, Just hOut, Just hErr, ph) <- createProcess $ (proc exe options)
{ std_in = CreatePipe
, std_out = CreatePipe
, std_err = CreatePipe
}
forkIO $ hPutStr stdout =<< hGetContents hOut
forkIO $ hPutStr stderr =<< hGetContents hErr
hPutStrLn hIn $ encodeToString opt
hFlush hIn
extractProcessID ph
where
options :: [String]
options = case rtsOptions opt of
[] -> args
rtsopts -> args ++ ["+RTS"] ++ rtsopts ++ ["-RTS"]
extractProcessID :: ProcessHandle -> IO ProcessID
extractProcessID h = withProcessHandle h $ \x -> case x of
OpenHandle pid -> return pid
_ -> throwIO $ userError "Unable to retrieve child process ID."
{- | create a new worker
-} | 1,072 | forkWorkerProcessWithArgs :: (WorkerContext a)
=> a -- ^ a worker context
-> [String] -- ^ command line arguments
-> IO ProcessID
forkWorkerProcessWithArgs opt args = do
exe <- liftM encodeString getArgv0
(Just hIn, Just hOut, Just hErr, ph) <- createProcess $ (proc exe options)
{ std_in = CreatePipe
, std_out = CreatePipe
, std_err = CreatePipe
}
forkIO $ hPutStr stdout =<< hGetContents hOut
forkIO $ hPutStr stderr =<< hGetContents hErr
hPutStrLn hIn $ encodeToString opt
hFlush hIn
extractProcessID ph
where
options :: [String]
options = case rtsOptions opt of
[] -> args
rtsopts -> args ++ ["+RTS"] ++ rtsopts ++ ["-RTS"]
extractProcessID :: ProcessHandle -> IO ProcessID
extractProcessID h = withProcessHandle h $ \x -> case x of
OpenHandle pid -> return pid
_ -> throwIO $ userError "Unable to retrieve child process ID."
{- | create a new worker
-} | 1,034 | forkWorkerProcessWithArgs opt args = do
exe <- liftM encodeString getArgv0
(Just hIn, Just hOut, Just hErr, ph) <- createProcess $ (proc exe options)
{ std_in = CreatePipe
, std_out = CreatePipe
, std_err = CreatePipe
}
forkIO $ hPutStr stdout =<< hGetContents hOut
forkIO $ hPutStr stderr =<< hGetContents hErr
hPutStrLn hIn $ encodeToString opt
hFlush hIn
extractProcessID ph
where
options :: [String]
options = case rtsOptions opt of
[] -> args
rtsopts -> args ++ ["+RTS"] ++ rtsopts ++ ["-RTS"]
extractProcessID :: ProcessHandle -> IO ProcessID
extractProcessID h = withProcessHandle h $ \x -> case x of
OpenHandle pid -> return pid
_ -> throwIO $ userError "Unable to retrieve child process ID."
{- | create a new worker
-} | 802 | true | true | 0 | 11 | 326 | 290 | 143 | 147 | null | null |
alexvong1995/pandoc | src/Text/Pandoc.hs | gpl-2.0 | getDefaultExtensions "plain" = plainExtensions | 56 | getDefaultExtensions "plain" = plainExtensions | 56 | getDefaultExtensions "plain" = plainExtensions | 56 | false | false | 0 | 4 | 13 | 10 | 4 | 6 | null | null |
8c6794b6/tokyodystopia-haskell | Database/TokyoDystopia/WDB.hs | bsd-3-clause | -- | Search phrase with given GetMode.
search :: WDB -> String -> IO [Int64]
search db query = do
FG.with 0 $ \counterP ->
CS.withCString query $ \query' -> do
res <- FW.c_search (unWDB db) query' counterP
numResult <- fromIntegral `fmap` FG.peek counterP
res' <- FG.peekArray numResult res
FG.free res
return res'
-- | Set caching parameters. Must be used before opening database. | 423 | search :: WDB -> String -> IO [Int64]
search db query = do
FG.with 0 $ \counterP ->
CS.withCString query $ \query' -> do
res <- FW.c_search (unWDB db) query' counterP
numResult <- fromIntegral `fmap` FG.peek counterP
res' <- FG.peekArray numResult res
FG.free res
return res'
-- | Set caching parameters. Must be used before opening database. | 384 | search db query = do
FG.with 0 $ \counterP ->
CS.withCString query $ \query' -> do
res <- FW.c_search (unWDB db) query' counterP
numResult <- fromIntegral `fmap` FG.peek counterP
res' <- FG.peekArray numResult res
FG.free res
return res'
-- | Set caching parameters. Must be used before opening database. | 346 | true | true | 0 | 17 | 105 | 136 | 63 | 73 | null | null |
kawamuray/ganeti | test/hs/Test/Ganeti/Utils.hs | gpl-2.0 | -- | Test that 'chompPrefix' correctly allows the last char (the separator) to
-- be absent if the string terminates there.
prop_chompPrefix_last :: Property
prop_chompPrefix_last =
forAll (choose (1, 20)) $ \len ->
forAll (vectorOf len arbitrary) $ \pfx ->
chompPrefix pfx pfx ==? Just "" .&&.
chompPrefix pfx (init pfx) ==? Just "" | 341 | prop_chompPrefix_last :: Property
prop_chompPrefix_last =
forAll (choose (1, 20)) $ \len ->
forAll (vectorOf len arbitrary) $ \pfx ->
chompPrefix pfx pfx ==? Just "" .&&.
chompPrefix pfx (init pfx) ==? Just "" | 217 | prop_chompPrefix_last =
forAll (choose (1, 20)) $ \len ->
forAll (vectorOf len arbitrary) $ \pfx ->
chompPrefix pfx pfx ==? Just "" .&&.
chompPrefix pfx (init pfx) ==? Just "" | 183 | true | true | 5 | 10 | 61 | 106 | 51 | 55 | null | null |
fmthoma/ghc | compiler/types/TypeRep.hs | bsd-3-clause | ------------
pprClassPred :: Class -> [Type] -> SDoc
pprClassPred clas tys = pprTypeApp (classTyCon clas) tys | 109 | pprClassPred :: Class -> [Type] -> SDoc
pprClassPred clas tys = pprTypeApp (classTyCon clas) tys | 96 | pprClassPred clas tys = pprTypeApp (classTyCon clas) tys | 56 | true | true | 0 | 7 | 15 | 39 | 20 | 19 | null | null |
alexander-at-github/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | primOpInfo ShrinkMutableByteArrayOp_Char = mkGenPrimOp (fsLit "shrinkMutableByteArray#") [deltaTyVar] [mkMutableByteArrayPrimTy deltaTy, intPrimTy, mkStatePrimTy deltaTy] (mkStatePrimTy deltaTy) | 195 | primOpInfo ShrinkMutableByteArrayOp_Char = mkGenPrimOp (fsLit "shrinkMutableByteArray#") [deltaTyVar] [mkMutableByteArrayPrimTy deltaTy, intPrimTy, mkStatePrimTy deltaTy] (mkStatePrimTy deltaTy) | 195 | primOpInfo ShrinkMutableByteArrayOp_Char = mkGenPrimOp (fsLit "shrinkMutableByteArray#") [deltaTyVar] [mkMutableByteArrayPrimTy deltaTy, intPrimTy, mkStatePrimTy deltaTy] (mkStatePrimTy deltaTy) | 195 | false | false | 0 | 7 | 14 | 48 | 24 | 24 | null | null |
bitemyapp/haskell-vcache | hsrc_lib/Database/VCache/Write.hs | bsd-2-clause | -- GC from given address (affects next frame)
continueGC :: VSpace -> Address -> IO ()
continueGC vc !addr = writeIORef (vcache_gc_start vc) (Just addr) | 152 | continueGC :: VSpace -> Address -> IO ()
continueGC vc !addr = writeIORef (vcache_gc_start vc) (Just addr) | 106 | continueGC vc !addr = writeIORef (vcache_gc_start vc) (Just addr) | 65 | true | true | 0 | 8 | 24 | 48 | 23 | 25 | null | null |
danr/hipspec | examples/old-examples/hip/NatDoubleSlow.hs | gpl-3.0 | -- Only properties directly or indirectly regarding +
prop_assoc_plus :: Nat -> Nat -> Nat -> Prop Nat
prop_assoc_plus x y z
= x + (y + z) =:= (x + y) + z | 157 | prop_assoc_plus :: Nat -> Nat -> Nat -> Prop Nat
prop_assoc_plus x y z
= x + (y + z) =:= (x + y) + z | 102 | prop_assoc_plus x y z
= x + (y + z) =:= (x + y) + z | 53 | true | true | 0 | 9 | 36 | 60 | 31 | 29 | null | null |
vikraman/ghc | compiler/coreSyn/TrieMap.hs | bsd-3-clause | xtInt :: Int -> XT a -> IntMap.IntMap a -> IntMap.IntMap a
xtInt k f m = IntMap.alter f k m | 91 | xtInt :: Int -> XT a -> IntMap.IntMap a -> IntMap.IntMap a
xtInt k f m = IntMap.alter f k m | 91 | xtInt k f m = IntMap.alter f k m | 32 | false | true | 0 | 9 | 20 | 52 | 24 | 28 | null | null |
hemio-ev/hamsql | src/Database/HamSql/Internal/Documentation.hs | gpl-3.0 | docWrite :: OptDoc -> Setup -> IO ()
docWrite optDoc s = do
t <- templateFromFile (optTemplate optDoc)
mapM_ (docWriteSchema optDoc t) (fromMaybe [] $ _setupSchemaData s)
return () | 186 | docWrite :: OptDoc -> Setup -> IO ()
docWrite optDoc s = do
t <- templateFromFile (optTemplate optDoc)
mapM_ (docWriteSchema optDoc t) (fromMaybe [] $ _setupSchemaData s)
return () | 186 | docWrite optDoc s = do
t <- templateFromFile (optTemplate optDoc)
mapM_ (docWriteSchema optDoc t) (fromMaybe [] $ _setupSchemaData s)
return () | 149 | false | true | 0 | 11 | 34 | 84 | 38 | 46 | null | null |
GaloisInc/ivory-tower-stm32 | ivory-bsp-stm32/src/Ivory/BSP/STM32/ClockConfig.hs | bsd-3-clause | clockPLL48ClkHz :: ClockConfig -> Integer
clockPLL48ClkHz cc = ((source `div` m) * n) `div` q
where
source = clockSourceHz (clockconfig_source cc)
m = pll_m (clockconfig_pll cc)
n = pll_n (clockconfig_pll cc)
q = pll_q (clockconfig_pll cc) | 288 | clockPLL48ClkHz :: ClockConfig -> Integer
clockPLL48ClkHz cc = ((source `div` m) * n) `div` q
where
source = clockSourceHz (clockconfig_source cc)
m = pll_m (clockconfig_pll cc)
n = pll_n (clockconfig_pll cc)
q = pll_q (clockconfig_pll cc) | 288 | clockPLL48ClkHz cc = ((source `div` m) * n) `div` q
where
source = clockSourceHz (clockconfig_source cc)
m = pll_m (clockconfig_pll cc)
n = pll_n (clockconfig_pll cc)
q = pll_q (clockconfig_pll cc) | 246 | false | true | 0 | 9 | 84 | 99 | 52 | 47 | null | null |
BakerSmithA/Turing | src/Syntax/Tree.hs | bsd-3-clause | -- Returns the type of the variable in the struct.
memberVarType :: StructMemberVar -> DataType
memberVarType = snd | 115 | memberVarType :: StructMemberVar -> DataType
memberVarType = snd | 64 | memberVarType = snd | 19 | true | true | 0 | 5 | 17 | 16 | 9 | 7 | null | null |
rodrigogribeiro/mptc | test/Data/Full/PreludeList.hs | bsd-3-clause | drop _ [] = [] | 14 | drop _ [] = [] | 14 | drop _ [] = [] | 14 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
walpurgisriot/unitparty | UnitParty/Units.hs | gpl-3.0 | metricPrefixes :: Map String (Unit -> Unit)
metricPrefixes = M.fromList $
[ ("yotta", yotta)
, ("zetta", zetta)
, ("exa", exa)
, ("peta", peta)
, ("tera", tera)
, ("giga", giga)
, ("mega", mega)
, ("kilo", kilo)
, ("hecto", hecto)
, ("deca", deca)
, ("deci", deci)
, ("centi", centi)
, ("milli", milli)
, ("micro", micro)
, ("nano", nano)
, ("pico", pico)
, ("femto", femto)
, ("atto", atto)
, ("zepto", zepto)
, ("yocto", yocto)
] | 485 | metricPrefixes :: Map String (Unit -> Unit)
metricPrefixes = M.fromList $
[ ("yotta", yotta)
, ("zetta", zetta)
, ("exa", exa)
, ("peta", peta)
, ("tera", tera)
, ("giga", giga)
, ("mega", mega)
, ("kilo", kilo)
, ("hecto", hecto)
, ("deca", deca)
, ("deci", deci)
, ("centi", centi)
, ("milli", milli)
, ("micro", micro)
, ("nano", nano)
, ("pico", pico)
, ("femto", femto)
, ("atto", atto)
, ("zepto", zepto)
, ("yocto", yocto)
] | 485 | metricPrefixes = M.fromList $
[ ("yotta", yotta)
, ("zetta", zetta)
, ("exa", exa)
, ("peta", peta)
, ("tera", tera)
, ("giga", giga)
, ("mega", mega)
, ("kilo", kilo)
, ("hecto", hecto)
, ("deca", deca)
, ("deci", deci)
, ("centi", centi)
, ("milli", milli)
, ("micro", micro)
, ("nano", nano)
, ("pico", pico)
, ("femto", femto)
, ("atto", atto)
, ("zepto", zepto)
, ("yocto", yocto)
] | 441 | false | true | 0 | 7 | 125 | 209 | 135 | 74 | null | null |
tfausak/threase | test-suite/ThreaseSpec.hs | mit | spec :: Spec
spec = it "is" pending | 35 | spec :: Spec
spec = it "is" pending | 35 | spec = it "is" pending | 22 | false | true | 0 | 6 | 7 | 24 | 9 | 15 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/Compiler.hs | bsd-3-clause | compileExpr (ShfRW16 e1 e2) = compileShiftRight e1 e2 | 53 | compileExpr (ShfRW16 e1 e2) = compileShiftRight e1 e2 | 53 | compileExpr (ShfRW16 e1 e2) = compileShiftRight e1 e2 | 53 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
lih/Alpha | src/My/Control/Monad/State.hs | bsd-2-clause | putting f v = modifying f (const v) | 51 | putting f v = modifying f (const v) | 51 | putting f v = modifying f (const v) | 51 | false | false | 0 | 7 | 23 | 23 | 10 | 13 | null | null |
kevinbackhouse/Control-Monad-MultiPass | src/Control/Monad/MultiPass/Example/CFG.hs | bsd-3-clause | emitMain
:: (Monad p1, Monad p2, Monad p3)
=> CFG
-> EmitCFGType r w p1 p2 p3 tc
emitMain g kn emitter delay12 =
mkMultiPassMain
(return ())
(\() -> knot3 kn (emitNodes emitter delay12 g))
(\() -> getResult emitter) | 235 | emitMain
:: (Monad p1, Monad p2, Monad p3)
=> CFG
-> EmitCFGType r w p1 p2 p3 tc
emitMain g kn emitter delay12 =
mkMultiPassMain
(return ())
(\() -> knot3 kn (emitNodes emitter delay12 g))
(\() -> getResult emitter) | 235 | emitMain g kn emitter delay12 =
mkMultiPassMain
(return ())
(\() -> knot3 kn (emitNodes emitter delay12 g))
(\() -> getResult emitter) | 148 | false | true | 0 | 10 | 58 | 115 | 57 | 58 | null | null |
duncanburke/toliman-graphical | src-lib/Game/Toliman/Graphical/SDL/Log.hs | mpl-2.0 | logPureInfoApplication = pureLogMessage SDL_LOG_CATEGORY_APPLICATION SDL_LOG_PRIORITY_INFO | 90 | logPureInfoApplication = pureLogMessage SDL_LOG_CATEGORY_APPLICATION SDL_LOG_PRIORITY_INFO | 90 | logPureInfoApplication = pureLogMessage SDL_LOG_CATEGORY_APPLICATION SDL_LOG_PRIORITY_INFO | 90 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
rueshyna/gogol | gogol-classroom/gen/Network/Google/Classroom/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'ReturnStudentSubmissionRequest' with the minimum fields required to make a request.
--
returnStudentSubmissionRequest
:: ReturnStudentSubmissionRequest
returnStudentSubmissionRequest = ReturnStudentSubmissionRequest' | 245 | returnStudentSubmissionRequest
:: ReturnStudentSubmissionRequest
returnStudentSubmissionRequest = ReturnStudentSubmissionRequest' | 133 | returnStudentSubmissionRequest = ReturnStudentSubmissionRequest' | 64 | true | true | 0 | 6 | 26 | 20 | 9 | 11 | null | null |
jmct/IterativeCompiler | frontend/Compiler.hs | mit | showInstruction Ne = IStr "Ne" | 42 | showInstruction Ne = IStr "Ne" | 42 | showInstruction Ne = IStr "Ne" | 42 | false | false | 0 | 5 | 16 | 13 | 5 | 8 | null | null |
artems/FlashBit | src/Supervisor.hs | bsd-3-clause | needRestart :: Int -> Int -> [UTCTime] -> Bool
needRestart maxRestart maxRestartTime crashes
| length crashes == 0 = True
| maxRestart >= length crashes = True
| otherwise = let
hi = head crashes
lo = last crashes
in floor (diffUTCTime hi lo) > maxRestartTime | 295 | needRestart :: Int -> Int -> [UTCTime] -> Bool
needRestart maxRestart maxRestartTime crashes
| length crashes == 0 = True
| maxRestart >= length crashes = True
| otherwise = let
hi = head crashes
lo = last crashes
in floor (diffUTCTime hi lo) > maxRestartTime | 295 | needRestart maxRestart maxRestartTime crashes
| length crashes == 0 = True
| maxRestart >= length crashes = True
| otherwise = let
hi = head crashes
lo = last crashes
in floor (diffUTCTime hi lo) > maxRestartTime | 248 | false | true | 1 | 10 | 81 | 109 | 51 | 58 | null | null |
VictorCMiraldo/mmm | MMM/HsMMM.hs | mit | buildBinary max i f
| max > i = let aux = foldl1 HsEComp $ replicate (max - i) (f 1)
in HsEComp (f 2) aux
| otherwise = f 2 | 142 | buildBinary max i f
| max > i = let aux = foldl1 HsEComp $ replicate (max - i) (f 1)
in HsEComp (f 2) aux
| otherwise = f 2 | 142 | buildBinary max i f
| max > i = let aux = foldl1 HsEComp $ replicate (max - i) (f 1)
in HsEComp (f 2) aux
| otherwise = f 2 | 142 | false | false | 0 | 13 | 49 | 86 | 38 | 48 | null | null |
jsavatgy/hatupist | hatupist-104.hs | gpl-2.0 | tableRRefreshMs = 500 | 21 | tableRRefreshMs = 500 | 21 | tableRRefreshMs = 500 | 21 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
afcowie/shlurp | lib/Shlurp/Summary.hs | bsd-3-clause | renderIssue :: Issue -> Doc
renderIssue issue =
let
title = renderTitle '-' (issueTitle issue)
labels = renderLabels issue
description = renderBody (issueBody issue)
in
vcat
[ title
, empty
, labels
, empty
, description
, linebreak
] | 310 | renderIssue :: Issue -> Doc
renderIssue issue =
let
title = renderTitle '-' (issueTitle issue)
labels = renderLabels issue
description = renderBody (issueBody issue)
in
vcat
[ title
, empty
, labels
, empty
, description
, linebreak
] | 310 | renderIssue issue =
let
title = renderTitle '-' (issueTitle issue)
labels = renderLabels issue
description = renderBody (issueBody issue)
in
vcat
[ title
, empty
, labels
, empty
, description
, linebreak
] | 282 | false | true | 0 | 11 | 114 | 83 | 43 | 40 | null | null |
beni55/language-c-inline | Language/C/Inline/State.hs | bsd-3-clause | getForeignLabels :: Q [Name]
getForeignLabels = readState foreignLabels | 71 | getForeignLabels :: Q [Name]
getForeignLabels = readState foreignLabels | 71 | getForeignLabels = readState foreignLabels | 42 | false | true | 0 | 7 | 7 | 26 | 11 | 15 | null | null |
nushio3/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | exprCtOrigin (HsLit {}) = Shouldn'tHappenOrigin "concrete literal" | 74 | exprCtOrigin (HsLit {}) = Shouldn'tHappenOrigin "concrete literal" | 74 | exprCtOrigin (HsLit {}) = Shouldn'tHappenOrigin "concrete literal" | 74 | false | false | 0 | 6 | 14 | 20 | 9 | 11 | null | null |
judah/tensorflow-haskell | tensorflow-ops/src/TensorFlow/Gradient.hs | apache-2.0 | opGrad "SparseSegmentSum" _ [toT -> x, toT -> y, toT -> t] [dz] =
[ Just $ CoreOps.unsortedSegmentSum
(CoreOps.gather dz (t :: Tensor Build Int32))
(y :: Tensor Build Int32) inputRows
, Nothing
, Nothing
]
where inputRows = flatSlice (shape (x :: Tensor Build a)) 0 1 | 311 | opGrad "SparseSegmentSum" _ [toT -> x, toT -> y, toT -> t] [dz] =
[ Just $ CoreOps.unsortedSegmentSum
(CoreOps.gather dz (t :: Tensor Build Int32))
(y :: Tensor Build Int32) inputRows
, Nothing
, Nothing
]
where inputRows = flatSlice (shape (x :: Tensor Build a)) 0 1 | 311 | opGrad "SparseSegmentSum" _ [toT -> x, toT -> y, toT -> t] [dz] =
[ Just $ CoreOps.unsortedSegmentSum
(CoreOps.gather dz (t :: Tensor Build Int32))
(y :: Tensor Build Int32) inputRows
, Nothing
, Nothing
]
where inputRows = flatSlice (shape (x :: Tensor Build a)) 0 1 | 311 | false | false | 0 | 11 | 91 | 125 | 66 | 59 | null | null |
gcampax/ghc | compiler/prelude/TysPrim.hs | bsd-3-clause | word64PrimTyCon :: TyCon
word64PrimTyCon = pcPrimTyCon0 word64PrimTyConName Word64Rep | 85 | word64PrimTyCon :: TyCon
word64PrimTyCon = pcPrimTyCon0 word64PrimTyConName Word64Rep | 85 | word64PrimTyCon = pcPrimTyCon0 word64PrimTyConName Word64Rep | 60 | false | true | 0 | 6 | 7 | 22 | 9 | 13 | null | null |
42f87d89/HSnake | snake.hs | mit | slither (Snake dir (p:ps)) dim = Snake dir ((move dir p dim):(init (p:ps))) | 75 | slither (Snake dir (p:ps)) dim = Snake dir ((move dir p dim):(init (p:ps))) | 75 | slither (Snake dir (p:ps)) dim = Snake dir ((move dir p dim):(init (p:ps))) | 75 | false | false | 1 | 11 | 12 | 63 | 31 | 32 | null | null |
jonascarpay/visor | src/Lib.hs | bsd-3-clause | roundF x = fromInteger (round x :: Integer) | 45 | roundF x = fromInteger (round x :: Integer) | 45 | roundF x = fromInteger (round x :: Integer) | 45 | false | false | 1 | 7 | 9 | 25 | 10 | 15 | null | null |
unisonweb/platform | codebase2/codebase-sqlite/U/Codebase/Sqlite/Operations.hs | mit | declReferencesByPrefix :: EDB m => Text -> Maybe Word64 -> m [C.Reference.Id]
declReferencesByPrefix t w =
componentReferencesByPrefix OT.DeclComponent t w
>>= traverse (C.Reference.idH loadHashByObjectId) | 211 | declReferencesByPrefix :: EDB m => Text -> Maybe Word64 -> m [C.Reference.Id]
declReferencesByPrefix t w =
componentReferencesByPrefix OT.DeclComponent t w
>>= traverse (C.Reference.idH loadHashByObjectId) | 211 | declReferencesByPrefix t w =
componentReferencesByPrefix OT.DeclComponent t w
>>= traverse (C.Reference.idH loadHashByObjectId) | 133 | false | true | 2 | 10 | 29 | 70 | 34 | 36 | null | null |
23Skidoo/snap | src/Snap/Snaplet/HeistNoClass.hs | bsd-3-clause | ------------------------------------------------------------------------------
heistServe :: Handler b (Heist b) ()
heistServe =
ifTop (render "index") <|> (render =<< serveURI) | 181 | heistServe :: Handler b (Heist b) ()
heistServe =
ifTop (render "index") <|> (render =<< serveURI) | 102 | heistServe =
ifTop (render "index") <|> (render =<< serveURI) | 65 | true | true | 0 | 8 | 20 | 53 | 25 | 28 | null | null |
Hexirp/depgraphdiv | app/Main.hs | bsd-3-clause | contain :: Eq a => a -> [a] -> Bool
contain a = go
where
go [] = False
go (x:xs) = (a == x) || go xs | 113 | contain :: Eq a => a -> [a] -> Bool
contain a = go
where
go [] = False
go (x:xs) = (a == x) || go xs | 112 | contain a = go
where
go [] = False
go (x:xs) = (a == x) || go xs | 76 | false | true | 0 | 8 | 40 | 79 | 38 | 41 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | -- See Note [TcLevel and untouchable type variables] for what this Int is
{-
Note [TcLevel and untouchable type variables]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Each unification variable (MetaTv)
and each Implication
has a level number (of type TcLevel)
* INVARIANTS. In a tree of Implications,
(ImplicInv) The level number of an Implication is
STRICTLY GREATER THAN that of its parent
(MetaTvInv) The level number of a unification variable is
LESS THAN OR EQUAL TO that of its parent
implication
* A unification variable is *touchable* if its level number
is EQUAL TO that of its immediate parent implication.
* INVARIANT
(GivenInv) The free variables of the ic_given of an
implication are all untouchable; ie their level
numbers are LESS THAN the ic_tclvl of the implication
Note [Skolem escape prevention]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We only unify touchable unification variables. Because of
(MetaTvInv), there can be no occurrences of he variable further out,
so the unification can't cause the kolems to escape. Example:
data T = forall a. MkT a (a->Int)
f x (MkT v f) = length [v,x]
We decide (x::alpha), and generate an implication like
[1]forall a. (a ~ alpha[0])
But we must not unify alpha:=a, because the skolem would escape.
For the cases where we DO want to unify, we rely on floating the
equality. Example (with same T)
g x (MkT v f) = x && True
We decide (x::alpha), and generate an implication like
[1]forall a. (Bool ~ alpha[0])
We do NOT unify directly, bur rather float out (if the constraint
does not mention 'a') to get
(Bool ~ alpha[0]) /\ [1]forall a.()
and NOW we can unify alpha.
The same idea of only unifying touchables solves another problem.
Suppose we had
(F Int ~ uf[0]) /\ [1](forall a. C a => F Int ~ beta[1])
In this example, beta is touchable inside the implication. The
first solveSimpleWanteds step leaves 'uf' un-unified. Then we move inside
the implication where a new constraint
uf ~ beta
emerges. If we (wrongly) spontaneously solved it to get uf := beta,
the whole implication disappears but when we pop out again we are left with
(F Int ~ uf) which will be unified by our final zonking stage and
uf will get unified *once more* to (F Int).
-}
fskTcLevel :: TcLevel
fskTcLevel = TcLevel 0 | 2,405 | fskTcLevel :: TcLevel
fskTcLevel = TcLevel 0 | 44 | fskTcLevel = TcLevel 0 | 22 | true | true | 0 | 5 | 541 | 16 | 9 | 7 | null | null |
NicolasDP/hs-packer | Data/Packer.hs | bsd-2-clause | -- | Put a Word16 serialized in little endian.
putWord16LE :: Word16 -> Packing ()
putWord16LE w = putStorable (toLE w) | 119 | putWord16LE :: Word16 -> Packing ()
putWord16LE w = putStorable (toLE w) | 72 | putWord16LE w = putStorable (toLE w) | 36 | true | true | 0 | 7 | 20 | 33 | 16 | 17 | null | null |
alanz/Blobs | lib/DData/Map.hs | lgpl-2.1 | {--------------------------------------------------------------------
Building trees from ascending/descending lists can be done in linear time.
Note that if [xs] is ascending that:
fromAscList xs == fromList xs
fromAscListWith f xs == fromListWith f xs
--------------------------------------------------------------------}
-- | /O(n)/. Build a map from an ascending list in linear time.
fromAscList :: Eq k => [(k,a)] -> Map k a
fromAscList xs
= fromAscListWithKey (\k x y -> x) xs | 507 | fromAscList :: Eq k => [(k,a)] -> Map k a
fromAscList xs
= fromAscListWithKey (\k x y -> x) xs | 96 | fromAscList xs
= fromAscListWithKey (\k x y -> x) xs | 54 | true | true | 0 | 8 | 89 | 58 | 31 | 27 | null | null |
brendanhay/gogol | gogol-logging/gen/Network/Google/Resource/Logging/Projects/Locations/Operations/List.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
plolUploadType :: Lens' ProjectsLocationsOperationsList (Maybe Text)
plolUploadType
= lens _plolUploadType
(\ s a -> s{_plolUploadType = a}) | 219 | plolUploadType :: Lens' ProjectsLocationsOperationsList (Maybe Text)
plolUploadType
= lens _plolUploadType
(\ s a -> s{_plolUploadType = a}) | 148 | plolUploadType
= lens _plolUploadType
(\ s a -> s{_plolUploadType = a}) | 79 | true | true | 1 | 9 | 34 | 52 | 25 | 27 | null | null |
hsyl20/HViperVM | lib/ViperVM/Parsing/Lisp.hs | lgpl-3.0 | makeExpr ctx (List (x:xs)) = do
int <- makeExpr ctx x
foldM (\a1 a2 -> newNodeIO =<< (G.App a1 <$> makeExpr ctx a2)) int xs | 129 | makeExpr ctx (List (x:xs)) = do
int <- makeExpr ctx x
foldM (\a1 a2 -> newNodeIO =<< (G.App a1 <$> makeExpr ctx a2)) int xs | 129 | makeExpr ctx (List (x:xs)) = do
int <- makeExpr ctx x
foldM (\a1 a2 -> newNodeIO =<< (G.App a1 <$> makeExpr ctx a2)) int xs | 129 | false | false | 0 | 14 | 30 | 79 | 37 | 42 | null | null |
da-x/hakyll-site | src/Site/WebSockets.hs | bsd-3-clause | webSocketPipe :: Channels -> Item String -> Compiler (Item String)
webSocketPipe channels item =
unsafeCompiler $ do
let path = toFilePath . itemIdentifier $ item
body = itemBody item
void . forkIO $ atomically $ do
chans <- readTVar channels
case Map.lookup path chans of
Just (ch, _) -> writeTChan ch body
Nothing -> return ()
return item | 393 | webSocketPipe :: Channels -> Item String -> Compiler (Item String)
webSocketPipe channels item =
unsafeCompiler $ do
let path = toFilePath . itemIdentifier $ item
body = itemBody item
void . forkIO $ atomically $ do
chans <- readTVar channels
case Map.lookup path chans of
Just (ch, _) -> writeTChan ch body
Nothing -> return ()
return item | 393 | webSocketPipe channels item =
unsafeCompiler $ do
let path = toFilePath . itemIdentifier $ item
body = itemBody item
void . forkIO $ atomically $ do
chans <- readTVar channels
case Map.lookup path chans of
Just (ch, _) -> writeTChan ch body
Nothing -> return ()
return item | 326 | false | true | 0 | 15 | 110 | 141 | 65 | 76 | null | null |
RAFIRAF/HASKELL | kk.hs | mit | zamieniajNaDuze = do
s <- getLine
if s /= ""
then do
print . map toUpper $ s
zamieniajNaDuze
else return () | 133 | zamieniajNaDuze = do
s <- getLine
if s /= ""
then do
print . map toUpper $ s
zamieniajNaDuze
else return () | 133 | zamieniajNaDuze = do
s <- getLine
if s /= ""
then do
print . map toUpper $ s
zamieniajNaDuze
else return () | 133 | false | false | 0 | 12 | 47 | 50 | 23 | 27 | null | null |
GaloisInc/sk-dev-platform | libs/SCD/src/SCD/GenShrimp/FromCoreLob.hs | bsd-3-clause | ppCoupler :: Env -> ClassName -> PortName -> [Ifc] -> Doc
ppCoupler env c0 p0 vps = vcat
[ text $ "define(Ifc" ++ c0 ++ "_" ++ p0 ++ ",`"
, nest 2 $ sepWith (\d1 d2 -> vcat [d1 <> text ",", d2])
[ ppCouplerCall env False p v | (v,p) <- vps ] <> text "')"
] | 268 | ppCoupler :: Env -> ClassName -> PortName -> [Ifc] -> Doc
ppCoupler env c0 p0 vps = vcat
[ text $ "define(Ifc" ++ c0 ++ "_" ++ p0 ++ ",`"
, nest 2 $ sepWith (\d1 d2 -> vcat [d1 <> text ",", d2])
[ ppCouplerCall env False p v | (v,p) <- vps ] <> text "')"
] | 268 | ppCoupler env c0 p0 vps = vcat
[ text $ "define(Ifc" ++ c0 ++ "_" ++ p0 ++ ",`"
, nest 2 $ sepWith (\d1 d2 -> vcat [d1 <> text ",", d2])
[ ppCouplerCall env False p v | (v,p) <- vps ] <> text "')"
] | 210 | false | true | 0 | 14 | 70 | 139 | 71 | 68 | null | null |
UU-ComputerScience/uu-cco | uu-cco/src/CCO/Parsing.hs | bsd-3-clause | satisfy :: Symbol s => (s -> Bool) -> Parser s s
satisfy test = P p
where
p _ _ macc (Symbols src [])
= Fail (SourcePos src EOF) Nothing (maybe id id macc)
p k h macc (Symbols src (Token s pos lx _ : units))
| test s = Step (k (h, s) Nothing (Symbols src units))
| otherwise = Fail (SourcePos src pos) (Just (describe s lx))
(maybe id id macc)
p _ _ _ (Symbols src (Error pos lx _ : _))
= LexFail Nothing (SourcePos src pos) lx
p _ _ _ (Symbols src (Msg msg pos lx _ : _))
= LexFail (Just msg) (SourcePos src pos) lx
-- | A 'Parser' that recognises the end of input. | 676 | satisfy :: Symbol s => (s -> Bool) -> Parser s s
satisfy test = P p
where
p _ _ macc (Symbols src [])
= Fail (SourcePos src EOF) Nothing (maybe id id macc)
p k h macc (Symbols src (Token s pos lx _ : units))
| test s = Step (k (h, s) Nothing (Symbols src units))
| otherwise = Fail (SourcePos src pos) (Just (describe s lx))
(maybe id id macc)
p _ _ _ (Symbols src (Error pos lx _ : _))
= LexFail Nothing (SourcePos src pos) lx
p _ _ _ (Symbols src (Msg msg pos lx _ : _))
= LexFail (Just msg) (SourcePos src pos) lx
-- | A 'Parser' that recognises the end of input. | 676 | satisfy test = P p
where
p _ _ macc (Symbols src [])
= Fail (SourcePos src EOF) Nothing (maybe id id macc)
p k h macc (Symbols src (Token s pos lx _ : units))
| test s = Step (k (h, s) Nothing (Symbols src units))
| otherwise = Fail (SourcePos src pos) (Just (describe s lx))
(maybe id id macc)
p _ _ _ (Symbols src (Error pos lx _ : _))
= LexFail Nothing (SourcePos src pos) lx
p _ _ _ (Symbols src (Msg msg pos lx _ : _))
= LexFail (Just msg) (SourcePos src pos) lx
-- | A 'Parser' that recognises the end of input. | 627 | false | true | 6 | 10 | 234 | 316 | 158 | 158 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/types/CoAxiom.hs | bsd-3-clause | fromBranchList (NextBranch h t) = h : (fromBranchList t) | 56 | fromBranchList (NextBranch h t) = h : (fromBranchList t) | 56 | fromBranchList (NextBranch h t) = h : (fromBranchList t) | 56 | false | false | 2 | 7 | 8 | 30 | 13 | 17 | null | null |
michalkonecny/aern2 | aern2-fnreps/main/fnreps-ops.hs | bsd-3-clause | -----------------------------------
-----------------------------------
sinesine_Name :: String
sinesine_Name = "sin(10x+sin(7pi*x^2)) over [-1,1]" | 148 | sinesine_Name :: String
sinesine_Name = "sin(10x+sin(7pi*x^2)) over [-1,1]" | 75 | sinesine_Name = "sin(10x+sin(7pi*x^2)) over [-1,1]" | 51 | true | true | 0 | 4 | 10 | 13 | 8 | 5 | null | null |
adamsmasher/EMA | Parser.hs | gpl-3.0 | orExpr = do e1 <- l6
whitespaces
char '|'
whitespaces
e2 <- l7
return $ BinOp e1 e2 Or | 146 | orExpr = do e1 <- l6
whitespaces
char '|'
whitespaces
e2 <- l7
return $ BinOp e1 e2 Or | 146 | orExpr = do e1 <- l6
whitespaces
char '|'
whitespaces
e2 <- l7
return $ BinOp e1 e2 Or | 146 | false | false | 1 | 9 | 78 | 50 | 19 | 31 | null | null |
d3sformal/bacon-core | src/System/Expression.hs | mit | not :: Formula -> Formula
not a = normalise $ Not a | 51 | not :: Formula -> Formula
not a = normalise $ Not a | 51 | not a = normalise $ Not a | 25 | false | true | 2 | 7 | 11 | 32 | 13 | 19 | null | null |
cbrghostrider/Hacking | codeJam/2009/alienLanguage/qual2.hs | mit | -- takes string made up so far for curr token
-- and unconsumed input
-- returns (string for curr token, rest of unconsumed input)
consumeLtr :: String -> String -> (String, String)
consumeLtr strSoFar [] = (strSoFar, []) | 221 | consumeLtr :: String -> String -> (String, String)
consumeLtr strSoFar [] = (strSoFar, []) | 90 | consumeLtr strSoFar [] = (strSoFar, []) | 39 | true | true | 0 | 9 | 37 | 49 | 26 | 23 | null | null |
sebastianbeyer/flycheck | test/resources/checkers/Haskell/Warnings.hs | gpl-3.0 | spam :: [String] -> [[String]]
spam eggs = map lines eggs | 57 | spam :: [String] -> [[String]]
spam eggs = map lines eggs | 57 | spam eggs = map lines eggs | 26 | false | true | 0 | 7 | 10 | 32 | 17 | 15 | null | null |
kkspeed/PigLet | src/Util/GenerateHtmlCombinators.hs | mit | makeDocTypeHtml :: [String] -- ^ The doctype.
-> String -- ^ Resulting combinator function.
makeDocTypeHtml lines' = unlines
[ DO_NOT_EDIT
, "-- | Combinator for the @\\<html>@ element. This combinator will also"
, "-- insert the correct doctype."
, "--"
, "-- Example:"
, "--"
, "-- > docTypeHtml $ span $ text \"foo\""
, "--"
, "-- Result:"
, "--"
, unlines (map ("-- > " ++) lines') ++ "-- > <html><span>foo</span></html>"
, "--"
, "docTypeHtml :: Html -- ^ Inner HTML."
, " -> Html -- ^ Resulting HTML."
, "docTypeHtml inner = docType >> html inner"
, "{-# INLINE docTypeHtml #-}"
] | 687 | makeDocTypeHtml :: [String] -- ^ The doctype.
-> String
makeDocTypeHtml lines' = unlines
[ DO_NOT_EDIT
, "-- | Combinator for the @\\<html>@ element. This combinator will also"
, "-- insert the correct doctype."
, "--"
, "-- Example:"
, "--"
, "-- > docTypeHtml $ span $ text \"foo\""
, "--"
, "-- Result:"
, "--"
, unlines (map ("-- > " ++) lines') ++ "-- > <html><span>foo</span></html>"
, "--"
, "docTypeHtml :: Html -- ^ Inner HTML."
, " -> Html -- ^ Resulting HTML."
, "docTypeHtml inner = docType >> html inner"
, "{-# INLINE docTypeHtml #-}"
] | 648 | makeDocTypeHtml lines' = unlines
[ DO_NOT_EDIT
, "-- | Combinator for the @\\<html>@ element. This combinator will also"
, "-- insert the correct doctype."
, "--"
, "-- Example:"
, "--"
, "-- > docTypeHtml $ span $ text \"foo\""
, "--"
, "-- Result:"
, "--"
, unlines (map ("-- > " ++) lines') ++ "-- > <html><span>foo</span></html>"
, "--"
, "docTypeHtml :: Html -- ^ Inner HTML."
, " -> Html -- ^ Resulting HTML."
, "docTypeHtml inner = docType >> html inner"
, "{-# INLINE docTypeHtml #-}"
] | 575 | true | true | 0 | 10 | 205 | 93 | 56 | 37 | null | null |
sdiehl/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | monoidClassKey = mkPreludeClassUnique 47 | 43 | monoidClassKey = mkPreludeClassUnique 47 | 43 | monoidClassKey = mkPreludeClassUnique 47 | 43 | false | false | 0 | 5 | 6 | 9 | 4 | 5 | null | null |
malie/drolesat | HypergraphPartitioning.hs | bsd-3-clause | improve graph _ _ (bestcl, lastimp, bestcut) | lastimp > 23 =
do print("no improvements for long time", bestcut)
return bestcl
---} | 144 | improve graph _ _ (bestcl, lastimp, bestcut) | lastimp > 23 =
do print("no improvements for long time", bestcut)
return bestcl
---} | 144 | improve graph _ _ (bestcl, lastimp, bestcut) | lastimp > 23 =
do print("no improvements for long time", bestcut)
return bestcl
---} | 144 | false | false | 1 | 10 | 34 | 55 | 25 | 30 | null | null |
rahulmutt/ghcvm | compiler/Eta/CodeGen/Name.hs | bsd-3-clause | filterDataTyCons :: Text -> Bool
filterDataTyCons t
| isLastOf "/datacons/" = True
| isLastOf "/tycons/" = True
| otherwise = False
where isLastOf pat
| (match, rest) <- T.breakOnEnd pat t
= not (T.null match) && isNothing (T.find (== '/') rest) | 273 | filterDataTyCons :: Text -> Bool
filterDataTyCons t
| isLastOf "/datacons/" = True
| isLastOf "/tycons/" = True
| otherwise = False
where isLastOf pat
| (match, rest) <- T.breakOnEnd pat t
= not (T.null match) && isNothing (T.find (== '/') rest) | 273 | filterDataTyCons t
| isLastOf "/datacons/" = True
| isLastOf "/tycons/" = True
| otherwise = False
where isLastOf pat
| (match, rest) <- T.breakOnEnd pat t
= not (T.null match) && isNothing (T.find (== '/') rest) | 240 | false | true | 2 | 10 | 68 | 109 | 53 | 56 | null | null |
feuerbach/regex-applicative | Text/Regex/Applicative/Interface.hs | mit | gotResult :: InfixMatchingState s a -> Bool
gotResult GotResult {} = True | 73 | gotResult :: InfixMatchingState s a -> Bool
gotResult GotResult {} = True | 73 | gotResult GotResult {} = True | 29 | false | true | 0 | 6 | 11 | 27 | 13 | 14 | null | null |
ygale/timezone-series | Data/Time/LocalTime/TimeZone/Series.hs | bsd-3-clause | -- | Convert a local time to UTC using the "TimeZone" that is in
-- effect at that time in the timezone represented by TimeZoneSeries.
-- Local times that are invalid or redundant are treated as described above.
localTimeToUTC' :: TimeZoneSeries -> LocalTime -> UTCTime
localTimeToUTC' (TimeZoneSeries dfault changes) lt =
fromMaybe (localTimeToUTC dfault lt) . fmap snd . listToMaybe .
dropWhile (uncurry (>)) $
zip (map fst changes) (map (flip localTimeToUTC lt . snd) changes) | 485 | localTimeToUTC' :: TimeZoneSeries -> LocalTime -> UTCTime
localTimeToUTC' (TimeZoneSeries dfault changes) lt =
fromMaybe (localTimeToUTC dfault lt) . fmap snd . listToMaybe .
dropWhile (uncurry (>)) $
zip (map fst changes) (map (flip localTimeToUTC lt . snd) changes) | 273 | localTimeToUTC' (TimeZoneSeries dfault changes) lt =
fromMaybe (localTimeToUTC dfault lt) . fmap snd . listToMaybe .
dropWhile (uncurry (>)) $
zip (map fst changes) (map (flip localTimeToUTC lt . snd) changes) | 215 | true | true | 0 | 11 | 81 | 110 | 55 | 55 | null | null |
Regulareveryday/our_sorting_algos | src/Heapsort.hs | bsd-3-clause | -- |Function which takes index of a cell in a table and returns its right child
rightChild :: (Num a) => a -> a
rightChild a = 2*a + 2 | 134 | rightChild :: (Num a) => a -> a
rightChild a = 2*a + 2 | 54 | rightChild a = 2*a + 2 | 22 | true | true | 0 | 6 | 29 | 36 | 19 | 17 | null | null |
beni55/base-compat | src/Foreign/Marshal/Array/Compat.hs | mit | -- |Like 'mallocArray', but allocated memory is filled with bytes of value zero.
--
callocArray :: Storable a => Int -> IO (Ptr a)
callocArray = doCalloc undefined
where
doCalloc :: Storable a' => a' -> Int -> IO (Ptr a')
doCalloc dummy size = callocBytes (size * sizeOf dummy)
-- |Like 'callocArray0', but allocated memory is filled with bytes of value
-- zero.
-- | 378 | callocArray :: Storable a => Int -> IO (Ptr a)
callocArray = doCalloc undefined
where
doCalloc :: Storable a' => a' -> Int -> IO (Ptr a')
doCalloc dummy size = callocBytes (size * sizeOf dummy)
-- |Like 'callocArray0', but allocated memory is filled with bytes of value
-- zero.
-- | 294 | callocArray = doCalloc undefined
where
doCalloc :: Storable a' => a' -> Int -> IO (Ptr a')
doCalloc dummy size = callocBytes (size * sizeOf dummy)
-- |Like 'callocArray0', but allocated memory is filled with bytes of value
-- zero.
-- | 247 | true | true | 0 | 10 | 77 | 103 | 49 | 54 | null | null |
ruiting/opencog | opencog/nlp/lojban/HaskellLib/src/OpenCog/Lojban/Syntax/Util.hs | agpl-3.0 | collapsState :: Iso (State (State a)) (State a)
collapsState = Iso (Just . f) (Just . g) where
f ((a,ys),xs) = (a,xs++ys)
g (a,xs) = ((a,xs),xs) | 152 | collapsState :: Iso (State (State a)) (State a)
collapsState = Iso (Just . f) (Just . g) where
f ((a,ys),xs) = (a,xs++ys)
g (a,xs) = ((a,xs),xs) | 152 | collapsState = Iso (Just . f) (Just . g) where
f ((a,ys),xs) = (a,xs++ys)
g (a,xs) = ((a,xs),xs) | 104 | false | true | 2 | 8 | 33 | 123 | 62 | 61 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.