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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Super-Fluid/heqet | Heqet/Meters.hs | gpl-3.0 | beat5 = beatAt (4/4) | 20 | beat5 = beatAt (4/4) | 20 | beat5 = beatAt (4/4) | 20 | false | false | 0 | 7 | 3 | 16 | 8 | 8 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | primOpCanFail IndexByteArrayOp_Float = True | 43 | primOpCanFail IndexByteArrayOp_Float = True | 43 | primOpCanFail IndexByteArrayOp_Float = True | 43 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
chemouna/99Haskell | src/Problem2.hs | bsd-3-clause | myButLast3 = last . init | 24 | myButLast3 = last . init | 24 | myButLast3 = last . init | 24 | false | false | 0 | 5 | 4 | 10 | 5 | 5 | null | null |
tonyday567/tower | test/test.hs | bsd-3-clause | tests :: TestTree
tests =
testGroup "Tower"
[ testsInt
, testsFloat
, testsBool
, testsVInt
, testsVFloat
, testsMInt
, testsMFloat
, testsNInt
] | 185 | tests :: TestTree
tests =
testGroup "Tower"
[ testsInt
, testsFloat
, testsBool
, testsVInt
, testsVFloat
, testsMInt
, testsMFloat
, testsNInt
] | 185 | tests =
testGroup "Tower"
[ testsInt
, testsFloat
, testsBool
, testsVInt
, testsVFloat
, testsMInt
, testsMFloat
, testsNInt
] | 167 | false | true | 0 | 5 | 63 | 41 | 24 | 17 | null | null |
allanderek/ipclib | Language/Pepa/Print.hs | gpl-2.0 | {- End of Imports -}
{-|
The main exported function of this model.
Prints a pepa model in a human readable format.
-}
hprintPepaModel :: ParsedModel -> String
hprintPepaModel =
Pretty.render . pprintPepaModel | 219 | hprintPepaModel :: ParsedModel -> String
hprintPepaModel =
Pretty.render . pprintPepaModel | 92 | hprintPepaModel =
Pretty.render . pprintPepaModel | 51 | true | true | 0 | 6 | 43 | 23 | 13 | 10 | null | null |
spechub/Hets | Comorphisms/Hs2HOLCFaux.hs | gpl-2.0 | mthOrd = ["compare", "<", "<=", ">", ">=", "max", "min"] | 56 | mthOrd = ["compare", "<", "<=", ">", ">=", "max", "min"] | 56 | mthOrd = ["compare", "<", "<=", ">", ">=", "max", "min"] | 56 | false | false | 1 | 5 | 8 | 30 | 17 | 13 | null | null |
asr/fotc | notes/FOT/FOTC/UnguardedCorecursion/Examples.hs | mit | -- but this unguarded function is correctly rejected
bh ∷ [Int]
bh = 1 : tail bh | 80 | bh ∷ [Int]
bh = 1 : tail bh | 27 | bh = 1 : tail bh | 16 | true | true | 0 | 6 | 16 | 22 | 12 | 10 | null | null |
phaazon/igl | src/Graphics/Rendering/IGL/VertexArray.hs | bsd-3-clause | -- TODO: can’t we track the array?
enableVertexAttribArray :: (Has (Bound VertexArray) i ~ 'True)
=> Natural
-> GL i i ()
enableVertexAttribArray = wrapGL . glEnableVertexAttribArray . fromIntegral | 245 | enableVertexAttribArray :: (Has (Bound VertexArray) i ~ 'True)
=> Natural
-> GL i i ()
enableVertexAttribArray = wrapGL . glEnableVertexAttribArray . fromIntegral | 210 | enableVertexAttribArray = wrapGL . glEnableVertexAttribArray . fromIntegral | 75 | true | true | 0 | 10 | 76 | 57 | 29 | 28 | null | null |
erikd/yesod | yesod-core/Yesod/Core/Internal/Request.hs | mit | mkFileInfoSource :: Text -> Text -> Source (ResourceT IO) ByteString -> FileInfo
mkFileInfoSource name ct src = FileInfo name ct src (\dst -> runResourceT $ src $$ sinkFile dst) | 177 | mkFileInfoSource :: Text -> Text -> Source (ResourceT IO) ByteString -> FileInfo
mkFileInfoSource name ct src = FileInfo name ct src (\dst -> runResourceT $ src $$ sinkFile dst) | 177 | mkFileInfoSource name ct src = FileInfo name ct src (\dst -> runResourceT $ src $$ sinkFile dst) | 96 | false | true | 0 | 10 | 28 | 69 | 34 | 35 | null | null |
Fuuzetsu/h-booru | src/HBooru/Types.hs | gpl-3.0 | jpeg_url ∷ Proxy "jpeg_url"
jpeg_url = Proxy | 44 | jpeg_url ∷ Proxy "jpeg_url"
jpeg_url = Proxy | 44 | jpeg_url = Proxy | 16 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
rueshyna/gogol | gogol-admin-datatransfer/gen/Network/Google/DataTransfer/Types/Product.hs | mpl-2.0 | -- | Overall transfer status (Read-only).
dtOverallTransferStatusCode :: Lens' DataTransfer (Maybe Text)
dtOverallTransferStatusCode
= lens _dtOverallTransferStatusCode
(\ s a -> s{_dtOverallTransferStatusCode = a}) | 223 | dtOverallTransferStatusCode :: Lens' DataTransfer (Maybe Text)
dtOverallTransferStatusCode
= lens _dtOverallTransferStatusCode
(\ s a -> s{_dtOverallTransferStatusCode = a}) | 181 | dtOverallTransferStatusCode
= lens _dtOverallTransferStatusCode
(\ s a -> s{_dtOverallTransferStatusCode = a}) | 118 | true | true | 0 | 9 | 30 | 48 | 25 | 23 | null | null |
brendanhay/gogol | gogol-servicemanagement/gen/Network/Google/ServiceManagement/Types/Product.hs | mpl-2.0 | qlvAddtional :: Lens' QuotaLimitValues (HashMap Text Int64)
qlvAddtional
= lens _qlvAddtional (\ s a -> s{_qlvAddtional = a})
. _Coerce | 143 | qlvAddtional :: Lens' QuotaLimitValues (HashMap Text Int64)
qlvAddtional
= lens _qlvAddtional (\ s a -> s{_qlvAddtional = a})
. _Coerce | 143 | qlvAddtional
= lens _qlvAddtional (\ s a -> s{_qlvAddtional = a})
. _Coerce | 83 | false | true | 0 | 10 | 27 | 53 | 27 | 26 | null | null |
ben-schulz/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | splitName :: String -> Either String Name
splitName s = case reverse $ splitOn "." s of
[] -> Left ("Didn't understand name '" ++ s ++ "'")
[n] -> Right . sUN $ unparen n
(n:ns) -> Right $ sNS (sUN (unparen n)) ns
where unparen "" = ""
unparen ('(':x:xs) | last xs == ')' = init (x:xs)
unparen str = str | 369 | splitName :: String -> Either String Name
splitName s = case reverse $ splitOn "." s of
[] -> Left ("Didn't understand name '" ++ s ++ "'")
[n] -> Right . sUN $ unparen n
(n:ns) -> Right $ sNS (sUN (unparen n)) ns
where unparen "" = ""
unparen ('(':x:xs) | last xs == ')' = init (x:xs)
unparen str = str | 369 | splitName s = case reverse $ splitOn "." s of
[] -> Left ("Didn't understand name '" ++ s ++ "'")
[n] -> Right . sUN $ unparen n
(n:ns) -> Right $ sNS (sUN (unparen n)) ns
where unparen "" = ""
unparen ('(':x:xs) | last xs == ')' = init (x:xs)
unparen str = str | 327 | false | true | 3 | 13 | 129 | 170 | 84 | 86 | null | null |
cliffano/swaggy-jenkins | clients/haskell-http-client/generated/lib/SwaggyJenkins/ModelLens.hs | mit | -- * PipelineBranchesitem
-- | 'pipelineBranchesitemDisplayName' Lens
pipelineBranchesitemDisplayNameL :: Lens_' PipelineBranchesitem (Maybe Text)
pipelineBranchesitemDisplayNameL f PipelineBranchesitem{..} = (\pipelineBranchesitemDisplayName -> PipelineBranchesitem { pipelineBranchesitemDisplayName, ..} ) <$> f pipelineBranchesitemDisplayName | 346 | pipelineBranchesitemDisplayNameL :: Lens_' PipelineBranchesitem (Maybe Text)
pipelineBranchesitemDisplayNameL f PipelineBranchesitem{..} = (\pipelineBranchesitemDisplayName -> PipelineBranchesitem { pipelineBranchesitemDisplayName, ..} ) <$> f pipelineBranchesitemDisplayName | 275 | pipelineBranchesitemDisplayNameL f PipelineBranchesitem{..} = (\pipelineBranchesitemDisplayName -> PipelineBranchesitem { pipelineBranchesitemDisplayName, ..} ) <$> f pipelineBranchesitemDisplayName | 198 | true | true | 0 | 8 | 27 | 58 | 31 | 27 | null | null |
bcoppens/HaskellSshClient | src/Ssh/HashMac.hs | gpl-3.0 | none _ _ = [] | 13 | none _ _ = [] | 13 | none _ _ = [] | 13 | false | false | 1 | 6 | 4 | 14 | 6 | 8 | null | null |
enolan/cabal | cabal-install/Distribution/Client/Manpage.hs | bsd-3-clause | optionLines :: OptDescr flags -> [String]
optionLines (ReqArg description (optionChars, optionStrings) placeHolder _ _) =
argOptionLines description optionChars optionStrings (Required, placeHolder) | 201 | optionLines :: OptDescr flags -> [String]
optionLines (ReqArg description (optionChars, optionStrings) placeHolder _ _) =
argOptionLines description optionChars optionStrings (Required, placeHolder) | 201 | optionLines (ReqArg description (optionChars, optionStrings) placeHolder _ _) =
argOptionLines description optionChars optionStrings (Required, placeHolder) | 159 | false | true | 0 | 8 | 23 | 59 | 31 | 28 | null | null |
abbradar/dnohs | src/Codegen/Utils.hs | bsd-3-clause | load' :: Operand -> Instruction
load' a = load { address = a } | 62 | load' :: Operand -> Instruction
load' a = load { address = a } | 62 | load' a = load { address = a } | 30 | false | true | 0 | 7 | 13 | 35 | 16 | 19 | null | null |
kim/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types.hs | mpl-2.0 | vAttachments :: Lens' Volume [VolumeAttachment]
vAttachments = lens _vAttachments (\s a -> s { _vAttachments = a }) . _List | 123 | vAttachments :: Lens' Volume [VolumeAttachment]
vAttachments = lens _vAttachments (\s a -> s { _vAttachments = a }) . _List | 123 | vAttachments = lens _vAttachments (\s a -> s { _vAttachments = a }) . _List | 75 | false | true | 0 | 9 | 19 | 53 | 26 | 27 | null | null |
emacstheviking/hexwax-usb | Commands.hs | lgpl-3.0 | cGETANALOG = 0x96 ::Word8 | 27 | cGETANALOG = 0x96 ::Word8 | 27 | cGETANALOG = 0x96 ::Word8 | 27 | false | false | 0 | 4 | 5 | 9 | 5 | 4 | null | null |
djeik/goto | libgoto/Language/GoLite/Lexer/Symbols.hs | mit | -- | Parses a comma symbol \",\".
comma :: Parser HasNewline
comma = symbol_ "," | 80 | comma :: Parser HasNewline
comma = symbol_ "," | 46 | comma = symbol_ "," | 19 | true | true | 0 | 5 | 14 | 18 | 9 | 9 | null | null |
dorchard/gram_lang | frontend/src/Language/Granule/Syntax/Type.hs | bsd-3-clause | demoteKindToType :: Kind -> Maybe Type
demoteKindToType (KPromote t) = Just t | 77 | demoteKindToType :: Kind -> Maybe Type
demoteKindToType (KPromote t) = Just t | 77 | demoteKindToType (KPromote t) = Just t | 38 | false | true | 0 | 7 | 11 | 30 | 14 | 16 | null | null |
rolph-recto/liquid-fixpoint | src/Language/Fixpoint/Misc.hs | bsd-3-clause | dcolon = colon <> colon | 35 | dcolon = colon <> colon | 35 | dcolon = colon <> colon | 35 | false | false | 1 | 5 | 16 | 13 | 5 | 8 | null | null |
rubenpieters/gre-project | shared/src/Card.hs | bsd-3-clause | draw a = singleton $ Draw a | 27 | draw a = singleton $ Draw a | 27 | draw a = singleton $ Draw a | 27 | false | false | 0 | 6 | 6 | 16 | 7 | 9 | null | null |
keithodulaigh/Hets | CommonLogic/Parse_KIF.hs | gpl-2.0 | logsent :: CharParser st SENTENCE
logsent = do ch <- key notS <?> "negation"
s <- sentence <?> "sentence after \"" ++ notS ++ "\""
return $ Bool_sent (Negation s)
$ Range $ joinRanges [rangeSpan ch, rangeSpan s]
<|> do (ch, con, ident) <- parse_keys boolop_nary
s <- many sentence <?> "sentences after \"" ++ ident ++ "\""
return $ Bool_sent (con s)
$ Range $ joinRanges [rangeSpan ch, rangeSpan s]
<|> do (ch, con, ident) <- parse_keys boolop_binary
s1 <- sentence <?> "first sentence after \"" ++ ident ++ "\""
s2 <- sentence <?> "second sentence after \"" ++ ident ++ "\""
return $ Bool_sent (con s1 s2)
$ Range $ joinRanges [rangeSpan ch, rangeSpan s1, rangeSpan s2]
<|> do (ch, q, ident) <- parse_keys boolop_quant
vars <- parens (many1 (liftM Name (pToken variable)
<|> liftM SeqMark (pToken rowvar)))
<?> "quantified variables"
s <- sentence <?> "sentence after \"" ++ ident ++ "\""
return $ Quant_sent q vars s
$ Range $ joinRanges [rangeSpan ch, rangeSpan vars, rangeSpan s] | 1,248 | logsent :: CharParser st SENTENCE
logsent = do ch <- key notS <?> "negation"
s <- sentence <?> "sentence after \"" ++ notS ++ "\""
return $ Bool_sent (Negation s)
$ Range $ joinRanges [rangeSpan ch, rangeSpan s]
<|> do (ch, con, ident) <- parse_keys boolop_nary
s <- many sentence <?> "sentences after \"" ++ ident ++ "\""
return $ Bool_sent (con s)
$ Range $ joinRanges [rangeSpan ch, rangeSpan s]
<|> do (ch, con, ident) <- parse_keys boolop_binary
s1 <- sentence <?> "first sentence after \"" ++ ident ++ "\""
s2 <- sentence <?> "second sentence after \"" ++ ident ++ "\""
return $ Bool_sent (con s1 s2)
$ Range $ joinRanges [rangeSpan ch, rangeSpan s1, rangeSpan s2]
<|> do (ch, q, ident) <- parse_keys boolop_quant
vars <- parens (many1 (liftM Name (pToken variable)
<|> liftM SeqMark (pToken rowvar)))
<?> "quantified variables"
s <- sentence <?> "sentence after \"" ++ ident ++ "\""
return $ Quant_sent q vars s
$ Range $ joinRanges [rangeSpan ch, rangeSpan vars, rangeSpan s] | 1,248 | logsent = do ch <- key notS <?> "negation"
s <- sentence <?> "sentence after \"" ++ notS ++ "\""
return $ Bool_sent (Negation s)
$ Range $ joinRanges [rangeSpan ch, rangeSpan s]
<|> do (ch, con, ident) <- parse_keys boolop_nary
s <- many sentence <?> "sentences after \"" ++ ident ++ "\""
return $ Bool_sent (con s)
$ Range $ joinRanges [rangeSpan ch, rangeSpan s]
<|> do (ch, con, ident) <- parse_keys boolop_binary
s1 <- sentence <?> "first sentence after \"" ++ ident ++ "\""
s2 <- sentence <?> "second sentence after \"" ++ ident ++ "\""
return $ Bool_sent (con s1 s2)
$ Range $ joinRanges [rangeSpan ch, rangeSpan s1, rangeSpan s2]
<|> do (ch, q, ident) <- parse_keys boolop_quant
vars <- parens (many1 (liftM Name (pToken variable)
<|> liftM SeqMark (pToken rowvar)))
<?> "quantified variables"
s <- sentence <?> "sentence after \"" ++ ident ++ "\""
return $ Quant_sent q vars s
$ Range $ joinRanges [rangeSpan ch, rangeSpan vars, rangeSpan s] | 1,214 | false | true | 9 | 17 | 434 | 429 | 204 | 225 | null | null |
keithodulaigh/Hets | Common/Keywords.hs | gpl-2.0 | typeS :: String
typeS = "type" | 30 | typeS :: String
typeS = "type" | 30 | typeS = "type" | 14 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
paulp/unison | parser-typechecker/src/Unison/Typechecker/Context1.hs | mit | orElse :: M v a -> M v a -> M v a
orElse m1 m2 =
M (\menv -> either (const $ runM m2 menv) Right $ runM m1 menv) | 114 | orElse :: M v a -> M v a -> M v a
orElse m1 m2 =
M (\menv -> either (const $ runM m2 menv) Right $ runM m1 menv) | 114 | orElse m1 m2 =
M (\menv -> either (const $ runM m2 menv) Right $ runM m1 menv) | 80 | false | true | 0 | 12 | 32 | 81 | 37 | 44 | null | null |
GaloisInc/ivory-tower-stm32 | ivory-bsp-stm32/src/Ivory/BSP/STM32/Driver/SPI.hs | bsd-3-clause | debugOff Nothing = return () | 29 | debugOff Nothing = return () | 29 | debugOff Nothing = return () | 29 | false | false | 0 | 6 | 5 | 14 | 6 | 8 | null | null |
mikebenfield/hclaws | test/Tests/Math/Hclaws/FrontTracking.hs | isc | simplePiecewise :: FT.Piecewise 1
simplePiecewise = Fan [] [0] | 62 | simplePiecewise :: FT.Piecewise 1
simplePiecewise = Fan [] [0] | 62 | simplePiecewise = Fan [] [0] | 28 | false | true | 1 | 6 | 8 | 29 | 13 | 16 | null | null |
ekmett/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | translateOp _ Double2FloatOp = Just (MO_FF_Conv W64 W32) | 61 | translateOp _ Double2FloatOp = Just (MO_FF_Conv W64 W32) | 61 | translateOp _ Double2FloatOp = Just (MO_FF_Conv W64 W32) | 61 | false | false | 0 | 7 | 12 | 22 | 10 | 12 | null | null |
jdreaver/oanda-rest-api | src/OANDA/Instrument.hs | bsd-3-clause | granularityToDiffTime M5 = 5 * 60 | 33 | granularityToDiffTime M5 = 5 * 60 | 33 | granularityToDiffTime M5 = 5 * 60 | 33 | false | false | 2 | 5 | 5 | 18 | 6 | 12 | null | null |
ivanperez-keera/SoOSiM-ui | src/Graphics/UI/Gtk/Display/SoOSiMState.hs | bsd-3-clause | -- | Returns the qualified name of the box that the user
-- selected (if any)
checkSetSelection :: Point -> SystemStatus -> Maybe [Name]
checkSetSelection p st = anyArea p $ transformDiagram $ transformStatus defaultConfig st | 225 | checkSetSelection :: Point -> SystemStatus -> Maybe [Name]
checkSetSelection p st = anyArea p $ transformDiagram $ transformStatus defaultConfig st | 147 | checkSetSelection p st = anyArea p $ transformDiagram $ transformStatus defaultConfig st | 88 | true | true | 0 | 9 | 35 | 52 | 25 | 27 | null | null |
paldepind/reflex-examples | fetch-json-list/Fetch.hs | mit | main = mainWidget $ el "div" $ do
el "h1" $ text "Persons"
fetchPersons <- button "Fetch persons"
-- The type for `fetchedPersons` is inferred and the correct `FromJSON` instance is chosen
fetchedPersons <- getAndDecode (fmap (const personsUrl) fetchPersons)
persons <- holdDyn [] (fmap (fromMaybe []) fetchedPersons)
el "ul" $ simpleList persons showPerson
el "br" blank | 385 | main = mainWidget $ el "div" $ do
el "h1" $ text "Persons"
fetchPersons <- button "Fetch persons"
-- The type for `fetchedPersons` is inferred and the correct `FromJSON` instance is chosen
fetchedPersons <- getAndDecode (fmap (const personsUrl) fetchPersons)
persons <- holdDyn [] (fmap (fromMaybe []) fetchedPersons)
el "ul" $ simpleList persons showPerson
el "br" blank | 385 | main = mainWidget $ el "div" $ do
el "h1" $ text "Persons"
fetchPersons <- button "Fetch persons"
-- The type for `fetchedPersons` is inferred and the correct `FromJSON` instance is chosen
fetchedPersons <- getAndDecode (fmap (const personsUrl) fetchPersons)
persons <- holdDyn [] (fmap (fromMaybe []) fetchedPersons)
el "ul" $ simpleList persons showPerson
el "br" blank | 385 | false | false | 0 | 14 | 69 | 118 | 52 | 66 | null | null |
Noeda/caramia | src/Graphics/Caramia/ImageFormats/Internal.hs | mit | toConstantIF DEPTH_COMPONENT32 = GL_DEPTH_COMPONENT32 | 53 | toConstantIF DEPTH_COMPONENT32 = GL_DEPTH_COMPONENT32 | 53 | toConstantIF DEPTH_COMPONENT32 = GL_DEPTH_COMPONENT32 | 53 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
marcellussiegburg/autotool | collection/src/DPLLT/Trace.hs | gpl-2.0 | decide a l =
let p = positive l ; v = atom l
dl = succ $ decision_level a
in a
{ decision_level = dl
, assignment = M.insert v
(Info { value = p
, level = dl
, reason = Decision } ) $ assignment a
} | 361 | decide a l =
let p = positive l ; v = atom l
dl = succ $ decision_level a
in a
{ decision_level = dl
, assignment = M.insert v
(Info { value = p
, level = dl
, reason = Decision } ) $ assignment a
} | 361 | decide a l =
let p = positive l ; v = atom l
dl = succ $ decision_level a
in a
{ decision_level = dl
, assignment = M.insert v
(Info { value = p
, level = dl
, reason = Decision } ) $ assignment a
} | 361 | false | false | 1 | 14 | 212 | 102 | 52 | 50 | null | null |
brendanhay/gogol | gogol-games/gen/Network/Google/Games/Types/Product.hs | mpl-2.0 | -- | Whether the requested updates actually affected the achievement.
aurUpdateOccurred :: Lens' AchievementUpdateResponse (Maybe Bool)
aurUpdateOccurred
= lens _aurUpdateOccurred
(\ s a -> s{_aurUpdateOccurred = a}) | 224 | aurUpdateOccurred :: Lens' AchievementUpdateResponse (Maybe Bool)
aurUpdateOccurred
= lens _aurUpdateOccurred
(\ s a -> s{_aurUpdateOccurred = a}) | 154 | aurUpdateOccurred
= lens _aurUpdateOccurred
(\ s a -> s{_aurUpdateOccurred = a}) | 88 | true | true | 0 | 9 | 34 | 48 | 25 | 23 | null | null |
copland/cmdargs | System/Console/CmdArgs/Helper.hs | bsd-3-clause | comment :: String -> IO ()
comment x = hOut stdout $ "# " ++ x | 62 | comment :: String -> IO ()
comment x = hOut stdout $ "# " ++ x | 62 | comment x = hOut stdout $ "# " ++ x | 35 | false | true | 4 | 8 | 15 | 41 | 17 | 24 | null | null |
ejconlon/analyze | src/Analyze/RFrame.hs | bsd-3-clause | -- | Filter an 'RFrame' by row
filter :: Data k => RFrameFilter k v -> RFrame k v -> RFrame k v
filter p (RFrame ks look vs) = RFrame ks look vs'
where
vs' = V.ifilter (p ks look) vs
-- | Update row-wise, adding or replacing values per-column.
-- Retains the existing column order, appending new columns.
-- Throws on row length mismatch or duplicate columns in the update. | 384 | filter :: Data k => RFrameFilter k v -> RFrame k v -> RFrame k v
filter p (RFrame ks look vs) = RFrame ks look vs'
where
vs' = V.ifilter (p ks look) vs
-- | Update row-wise, adding or replacing values per-column.
-- Retains the existing column order, appending new columns.
-- Throws on row length mismatch or duplicate columns in the update. | 353 | filter p (RFrame ks look vs) = RFrame ks look vs'
where
vs' = V.ifilter (p ks look) vs
-- | Update row-wise, adding or replacing values per-column.
-- Retains the existing column order, appending new columns.
-- Throws on row length mismatch or duplicate columns in the update. | 288 | true | true | 1 | 11 | 82 | 98 | 45 | 53 | null | null |
mit-pdos/fscq-impl | src/hslib/Interpreter.hs | mit | -- import qualified System.Exit
-- import qualified System.Random
-- crashRandom :: IO Int
-- crashRandom = System.Random.getStdRandom (System.Random.randomR (1, 20))
-- maybeCrash :: IO ()
-- maybeCrash = do
-- x <- crashRandom
-- -- if x == 1
-- if x == 0
-- then
-- do
-- putStrLn "CRASH!"
-- System.Exit.exitFailure
-- else
-- return ()
verbose :: Bool
verbose = False | 405 | verbose :: Bool
verbose = False | 31 | verbose = False | 15 | true | true | 0 | 4 | 96 | 26 | 21 | 5 | null | null |
Javran/Project-Euler | src/ProjectEuler/Problem126.hs | mit | genCovSeqs :: Int -> [[Int]]
genCovSeqs upBound = do
x <- takeWhile (\i -> head (cuboidCovering i i i) < upBound) [1..]
y <- takeWhile (\j -> head (cuboidCovering x j j) < upBound) [x..]
z <- takeWhile (\k -> head (cuboidCovering x y k) < upBound) [y..]
pure $ takeWhile (< upBound) $ cuboidCovering x y z | 313 | genCovSeqs :: Int -> [[Int]]
genCovSeqs upBound = do
x <- takeWhile (\i -> head (cuboidCovering i i i) < upBound) [1..]
y <- takeWhile (\j -> head (cuboidCovering x j j) < upBound) [x..]
z <- takeWhile (\k -> head (cuboidCovering x y k) < upBound) [y..]
pure $ takeWhile (< upBound) $ cuboidCovering x y z | 313 | genCovSeqs upBound = do
x <- takeWhile (\i -> head (cuboidCovering i i i) < upBound) [1..]
y <- takeWhile (\j -> head (cuboidCovering x j j) < upBound) [x..]
z <- takeWhile (\k -> head (cuboidCovering x y k) < upBound) [y..]
pure $ takeWhile (< upBound) $ cuboidCovering x y z | 284 | false | true | 0 | 14 | 65 | 169 | 85 | 84 | null | null |
lukexi/ghc-7.8-arm64 | includes/CodeGen.Platform.hs | bsd-3-clause | callerSaves (VanillaReg 9 _) = True | 36 | callerSaves (VanillaReg 9 _) = True | 36 | callerSaves (VanillaReg 9 _) = True | 36 | false | false | 0 | 7 | 6 | 17 | 8 | 9 | null | null |
brendanhay/gogol | gogol-firestore/gen/Network/Google/Resource/FireStore/Projects/Databases/Documents/ListCollectionIds.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
pddlciUploadProtocol :: Lens' ProjectsDatabasesDocumentsListCollectionIds (Maybe Text)
pddlciUploadProtocol
= lens _pddlciUploadProtocol
(\ s a -> s{_pddlciUploadProtocol = a}) | 246 | pddlciUploadProtocol :: Lens' ProjectsDatabasesDocumentsListCollectionIds (Maybe Text)
pddlciUploadProtocol
= lens _pddlciUploadProtocol
(\ s a -> s{_pddlciUploadProtocol = a}) | 184 | pddlciUploadProtocol
= lens _pddlciUploadProtocol
(\ s a -> s{_pddlciUploadProtocol = a}) | 97 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
PhDP/Manticore | Akarui/Utils.hs | apache-2.0 | -- | 'any' with a Map's keys and values
anyKeyVal :: (Ord k) => (k -> v -> Bool) -> Map k v -> Bool
anyKeyVal p = Map.foldrWithKey (\key val acc -> acc || p key val) False | 171 | anyKeyVal :: (Ord k) => (k -> v -> Bool) -> Map k v -> Bool
anyKeyVal p = Map.foldrWithKey (\key val acc -> acc || p key val) False | 131 | anyKeyVal p = Map.foldrWithKey (\key val acc -> acc || p key val) False | 71 | true | true | 0 | 9 | 38 | 76 | 39 | 37 | null | null |
achirkin/ghcjs-webgl | src/JavaScript/WebGL/Const.hs | mit | gl_GREEN_BITS :: GLenum
gl_GREEN_BITS = 0x0D53 | 46 | gl_GREEN_BITS :: GLenum
gl_GREEN_BITS = 0x0D53 | 46 | gl_GREEN_BITS = 0x0D53 | 22 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
droundy/franchise | Distribution/Franchise/Trie.hs | bsd-3-clause | lookupT :: String -> Trie a -> Maybe a
lookupT "" (Trie ma _) = ma | 66 | lookupT :: String -> Trie a -> Maybe a
lookupT "" (Trie ma _) = ma | 66 | lookupT "" (Trie ma _) = ma | 27 | false | true | 0 | 7 | 15 | 38 | 18 | 20 | null | null |
gittywithexcitement/hindent | src/HIndent/Pretty.hs | bsd-3-clause | -- | Get the current line number.
getLineNum :: MonadState (PrintState s) m => m Int64
getLineNum = gets psLine | 111 | getLineNum :: MonadState (PrintState s) m => m Int64
getLineNum = gets psLine | 77 | getLineNum = gets psLine | 24 | true | true | 0 | 8 | 19 | 33 | 16 | 17 | null | null |
UBMLtonGroup/timberc | src/Syntax2Core.hs | bsd-3-clause | splitBinds bs = s2cB [] [] bs
where
s2cB sigs eqs [] = (reverse sigs, reverse eqs)
s2cB sigs eqs (BSig vs t : bs) = s2cB (vs `zip` repeat t ++ sigs) eqs bs
s2cB sigs eqs (BEqn (LFun v []) (RExp e) : bs)
= s2cB sigs ((v,e):eqs) bs
-- translate equation eqs in the scope of corresponding signatures sigs | 408 | splitBinds bs = s2cB [] [] bs
where
s2cB sigs eqs [] = (reverse sigs, reverse eqs)
s2cB sigs eqs (BSig vs t : bs) = s2cB (vs `zip` repeat t ++ sigs) eqs bs
s2cB sigs eqs (BEqn (LFun v []) (RExp e) : bs)
= s2cB sigs ((v,e):eqs) bs
-- translate equation eqs in the scope of corresponding signatures sigs | 408 | splitBinds bs = s2cB [] [] bs
where
s2cB sigs eqs [] = (reverse sigs, reverse eqs)
s2cB sigs eqs (BSig vs t : bs) = s2cB (vs `zip` repeat t ++ sigs) eqs bs
s2cB sigs eqs (BEqn (LFun v []) (RExp e) : bs)
= s2cB sigs ((v,e):eqs) bs
-- translate equation eqs in the scope of corresponding signatures sigs | 408 | false | false | 0 | 11 | 168 | 157 | 79 | 78 | null | null |
raichoo/Idris-dev | src/Idris/Elab/Record.hs | bsd-3-clause | in_name :: Name -> Name
in_name (UN n) = sMN 0 (str n ++ "_in") | 63 | in_name :: Name -> Name
in_name (UN n) = sMN 0 (str n ++ "_in") | 63 | in_name (UN n) = sMN 0 (str n ++ "_in") | 39 | false | true | 0 | 9 | 14 | 46 | 20 | 26 | null | null |
tibbe/ghc | compiler/llvmGen/LlvmCodeGen/CodeGen.hs | bsd-3-clause | genCall :: ForeignTarget -> [CmmFormal] -> [CmmActual]
-> LlvmM StmtData
-- Write barrier needs to be handled specially as it is implemented as an LLVM
-- intrinsic function.
genCall (PrimTarget MO_WriteBarrier) _ _ = do
platform <- getLlvmPlatform
ver <- getLlvmVer
case () of
_ | platformArch platform `elem` [ArchX86, ArchX86_64, ArchSPARC]
-> return (nilOL, [])
| ver > 29 -> barrier
| otherwise -> oldBarrier | 482 | genCall :: ForeignTarget -> [CmmFormal] -> [CmmActual]
-> LlvmM StmtData
genCall (PrimTarget MO_WriteBarrier) _ _ = do
platform <- getLlvmPlatform
ver <- getLlvmVer
case () of
_ | platformArch platform `elem` [ArchX86, ArchX86_64, ArchSPARC]
-> return (nilOL, [])
| ver > 29 -> barrier
| otherwise -> oldBarrier | 379 | genCall (PrimTarget MO_WriteBarrier) _ _ = do
platform <- getLlvmPlatform
ver <- getLlvmVer
case () of
_ | platformArch platform `elem` [ArchX86, ArchX86_64, ArchSPARC]
-> return (nilOL, [])
| ver > 29 -> barrier
| otherwise -> oldBarrier | 292 | true | true | 0 | 15 | 134 | 139 | 68 | 71 | null | null |
ARCCN/hcprobe | src/HCProbe/EDSL/PacketGeneration.hs | bsd-3-clause | putPortStatusPortDirect :: OfpPhyPort -> Writer (Endo OfpPortStatusData) ()
putPortStatusPortDirect p = tell . Endo $ \m -> m{opt_port_status_desc = p} | 151 | putPortStatusPortDirect :: OfpPhyPort -> Writer (Endo OfpPortStatusData) ()
putPortStatusPortDirect p = tell . Endo $ \m -> m{opt_port_status_desc = p} | 151 | putPortStatusPortDirect p = tell . Endo $ \m -> m{opt_port_status_desc = p} | 75 | false | true | 3 | 9 | 19 | 59 | 28 | 31 | null | null |
ganeti/ganeti | src/Ganeti/Locking/Locks.hs | bsd-2-clause | lockFromName "node-res/[lockset]" = return NodeResLockSet | 57 | lockFromName "node-res/[lockset]" = return NodeResLockSet | 57 | lockFromName "node-res/[lockset]" = return NodeResLockSet | 57 | false | false | 0 | 5 | 4 | 13 | 5 | 8 | null | null |
ku-fpg/marked-pretty | test/Main.hs | bsd-3-clause | html_txt (Mark (Open RED)) r = "<font color=\"red\">" ++ r | 60 | html_txt (Mark (Open RED)) r = "<font color=\"red\">" ++ r | 60 | html_txt (Mark (Open RED)) r = "<font color=\"red\">" ++ r | 60 | false | false | 0 | 9 | 11 | 27 | 13 | 14 | null | null |
axhav/AFPLAB3 | Vector.hs | bsd-3-clause | normalize :: DoubleVector -> DoubleVector
normalize v = R.computeUnboxedS $ R.map (/vLength v) v | 97 | normalize :: DoubleVector -> DoubleVector
normalize v = R.computeUnboxedS $ R.map (/vLength v) v | 97 | normalize v = R.computeUnboxedS $ R.map (/vLength v) v | 55 | false | true | 0 | 8 | 14 | 38 | 19 | 19 | null | null |
kawamuray/ganeti | src/Ganeti/OpParams.hs | gpl-2.0 | -- | Another name for the shutdown timeout, because we like to be
-- inconsistent.
pShutdownTimeout' :: Field
pShutdownTimeout' =
withDoc "How long to wait for instance to shut down" .
renameField "InstShutdownTimeout" .
defaultField [| forceNonNeg C.defaultShutdownTimeout |] $
simpleField "timeout" [t| NonNegative Int |] | 331 | pShutdownTimeout' :: Field
pShutdownTimeout' =
withDoc "How long to wait for instance to shut down" .
renameField "InstShutdownTimeout" .
defaultField [| forceNonNeg C.defaultShutdownTimeout |] $
simpleField "timeout" [t| NonNegative Int |] | 248 | pShutdownTimeout' =
withDoc "How long to wait for instance to shut down" .
renameField "InstShutdownTimeout" .
defaultField [| forceNonNeg C.defaultShutdownTimeout |] $
simpleField "timeout" [t| NonNegative Int |] | 221 | true | true | 0 | 8 | 53 | 46 | 26 | 20 | null | null |
roelvandijk/ls-usb | ls-usb.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- Main
--------------------------------------------------------------------------------
termInfo ∷ TermInfo
termInfo = defTI { termName = "ls-usb"
, version = showVersion This.version
, termDoc = "Lists connected USB devices."
} | 364 | termInfo ∷ TermInfo
termInfo = defTI { termName = "ls-usb"
, version = showVersion This.version
, termDoc = "Lists connected USB devices."
} | 193 | termInfo = defTI { termName = "ls-usb"
, version = showVersion This.version
, termDoc = "Lists connected USB devices."
} | 173 | true | true | 0 | 9 | 80 | 49 | 26 | 23 | null | null |
bitemyapp/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | isTypedBracket :: HsBracket id -> Bool
isTypedBracket (TExpBr {}) = True | 72 | isTypedBracket :: HsBracket id -> Bool
isTypedBracket (TExpBr {}) = True | 72 | isTypedBracket (TExpBr {}) = True | 33 | false | true | 0 | 7 | 10 | 28 | 14 | 14 | null | null |
GRACeFUL-project/haskelzinc | src/Interfaces/MZAuxiliary.hs | bsd-3-clause | manyTill = C1.manyTill | 22 | manyTill = C1.manyTill | 22 | manyTill = C1.manyTill | 22 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
ducis/haAni | hs/common/Graphics/UI/GLUT/Raw/Tokens.hs | gpl-2.0 | glut_KEY_F10 :: CInt
glut_KEY_F10 = 0x000A | 42 | glut_KEY_F10 :: CInt
glut_KEY_F10 = 0x000A | 42 | glut_KEY_F10 = 0x000A | 21 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_272 (166#) = happyShift action_279 | 41 | action_272 (166#) = happyShift action_279 | 41 | action_272 (166#) = happyShift action_279 | 41 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
markus1189/xmonad-contrib-710 | XMonad/Actions/WindowNavigation.hs | bsd-3-clause | -- Filters and sorts the windows in terms of what is closest from the Point in
-- the Direction2D.
navigable :: Direction2D -> Point -> [(Window, Rectangle)] -> [(Window, Rectangle)]
navigable d pt = sortby d . filter (inr d pt . snd) | 234 | navigable :: Direction2D -> Point -> [(Window, Rectangle)] -> [(Window, Rectangle)]
navigable d pt = sortby d . filter (inr d pt . snd) | 135 | navigable d pt = sortby d . filter (inr d pt . snd) | 51 | true | true | 1 | 11 | 42 | 76 | 39 | 37 | null | null |
grwlf/vsim | src_r/Test/User1.hs | gpl-3.0 | tuff x = return ()
| 19 | stuff x = return () | 19 | stuff x = return () | 19 | false | false | 1 | 6 | 5 | 17 | 6 | 11 | null | null |
mgreenly/roguelike | src/RogueLike.hs | isc | rowRenderOffset = 5 | 22 | rowRenderOffset = 5 | 22 | rowRenderOffset = 5 | 22 | false | false | 0 | 4 | 5 | 6 | 3 | 3 | null | null |
bos/text | tests/Tests/Properties/Substrings.hs | bsd-2-clause | t_isSuffixOf s = L.isSuffixOf s`eqP` T.isSuffixOf (packS s) | 62 | t_isSuffixOf s = L.isSuffixOf s`eqP` T.isSuffixOf (packS s) | 62 | t_isSuffixOf s = L.isSuffixOf s`eqP` T.isSuffixOf (packS s) | 62 | false | false | 0 | 8 | 10 | 31 | 15 | 16 | null | null |
ambiata/delorean | test/Test/Delorean/Local/QQ.hs | bsd-3-clause | tests :: IO Bool
tests = $quickCheckAll | 39 | tests :: IO Bool
tests = $quickCheckAll | 39 | tests = $quickCheckAll | 22 | false | true | 0 | 5 | 6 | 15 | 7 | 8 | null | null |
julmue/UntypedLambda | test/Language/Lambda/Semantics/Named/BigStep/Tests.hs | bsd-3-clause | -- -----------------------------------------------------------------------------
logicTests = testGroup "LogicTests"
[ if_Tests
, not_Tests
, and_Tests
, or_Tests
, imp_Tests
, iff_Tests
, logicLawsTests
] | 237 | logicTests = testGroup "LogicTests"
[ if_Tests
, not_Tests
, and_Tests
, or_Tests
, imp_Tests
, iff_Tests
, logicLawsTests
] | 156 | logicTests = testGroup "LogicTests"
[ if_Tests
, not_Tests
, and_Tests
, or_Tests
, imp_Tests
, iff_Tests
, logicLawsTests
] | 156 | true | false | 0 | 5 | 52 | 34 | 20 | 14 | null | null |
rblaze/private-cloud | src/PrivateCloud/Cloud/Crypto.hs | apache-2.0 | makeFileHash :: FilePath -> IO Hash
makeFileHash filename = do
bytes <- BL.readFile filename
ctx <- hashInit
mapM_ (hashUpdate ctx) $ BL.toChunks bytes
encodeHash <$> hashFinal ctx | 196 | makeFileHash :: FilePath -> IO Hash
makeFileHash filename = do
bytes <- BL.readFile filename
ctx <- hashInit
mapM_ (hashUpdate ctx) $ BL.toChunks bytes
encodeHash <$> hashFinal ctx | 196 | makeFileHash filename = do
bytes <- BL.readFile filename
ctx <- hashInit
mapM_ (hashUpdate ctx) $ BL.toChunks bytes
encodeHash <$> hashFinal ctx | 160 | false | true | 0 | 10 | 42 | 71 | 31 | 40 | null | null |
abakst/liquidhaskell | tests/pos/transpose.hs | bsd-3-clause | -- | Old fashioned transpose with explicit dimensions
{- transpose :: c:Nat
-> r:{v:Nat | v > 0}
-> {v:[{v:[a] | (len v) = c}] | (len v) = r}
-> {v:[{v:[a] | (len v) = r}] | (len v) = c}
-}
{-@ transpose :: c:Nat -> r:{v:Nat | v > 0} -> (MatrixCR a c r) -> (MatrixCR a r c) @-}
transpose :: Int -> Int -> [[a]] -> [[a]]
transpose 0 _ _ = [] | 404 | transpose :: Int -> Int -> [[a]] -> [[a]]
transpose 0 _ _ = [] | 79 | transpose 0 _ _ = [] | 33 | true | true | 0 | 11 | 142 | 53 | 28 | 25 | null | null |
brendanhay/gogol | gogol-datastore/gen/Network/Google/Resource/Datastore/Projects/Operations/List.hs | mpl-2.0 | -- | The standard list filter.
polFilter :: Lens' ProjectsOperationsList (Maybe Text)
polFilter
= lens _polFilter (\ s a -> s{_polFilter = a}) | 144 | polFilter :: Lens' ProjectsOperationsList (Maybe Text)
polFilter
= lens _polFilter (\ s a -> s{_polFilter = a}) | 113 | polFilter
= lens _polFilter (\ s a -> s{_polFilter = a}) | 58 | true | true | 1 | 9 | 24 | 50 | 25 | 25 | null | null |
bvdelft/paragon | src/Language/Java/Paragon/Monad/TypeCheckM.hs | bsd-3-clause | -- | Access the global type map.
getGlobalTypeMap :: TypeCheckM TypeMap
getGlobalTypeMap = tcGlobalTypeMap <$> getTypeCheckEnv | 126 | getGlobalTypeMap :: TypeCheckM TypeMap
getGlobalTypeMap = tcGlobalTypeMap <$> getTypeCheckEnv | 93 | getGlobalTypeMap = tcGlobalTypeMap <$> getTypeCheckEnv | 54 | true | true | 2 | 6 | 15 | 26 | 11 | 15 | null | null |
dkpsk/cambridge | src/Main.hs | bsd-3-clause | cambridge' :: (MonadRandom m) => String -> Int -> m T.Text
cambridge' word l | l > 3 = shuffle word
| otherwise = return $ T.pack word | 152 | cambridge' :: (MonadRandom m) => String -> Int -> m T.Text
cambridge' word l | l > 3 = shuffle word
| otherwise = return $ T.pack word | 152 | cambridge' word l | l > 3 = shuffle word
| otherwise = return $ T.pack word | 93 | false | true | 0 | 9 | 45 | 69 | 32 | 37 | null | null |
uduki/hsQt | Qtc/Enums/Core/QChar.hs | bsd-2-clause | eSeparator_Paragraph :: Category
eSeparator_Paragraph
= ieCategory $ 9 | 72 | eSeparator_Paragraph :: Category
eSeparator_Paragraph
= ieCategory $ 9 | 72 | eSeparator_Paragraph
= ieCategory $ 9 | 39 | false | true | 0 | 6 | 9 | 18 | 8 | 10 | null | null |
bgamari/text | benchmarks/haskell/Benchmarks/Search.hs | bsd-2-clause | byteString :: B.ByteString -> B.ByteString -> Int
byteString needle = length . B.indices needle | 95 | byteString :: B.ByteString -> B.ByteString -> Int
byteString needle = length . B.indices needle | 95 | byteString needle = length . B.indices needle | 45 | false | true | 0 | 7 | 13 | 35 | 17 | 18 | null | null |
DavidAlphaFox/ghc | libraries/containers/Data/IntMap/Strict.hs | bsd-3-clause | adjust :: (a -> a) -> Key -> IntMap a -> IntMap a
adjust f k m
= adjustWithKey (\_ x -> f x) k m | 99 | adjust :: (a -> a) -> Key -> IntMap a -> IntMap a
adjust f k m
= adjustWithKey (\_ x -> f x) k m | 99 | adjust f k m
= adjustWithKey (\_ x -> f x) k m | 48 | false | true | 0 | 8 | 28 | 63 | 31 | 32 | null | null |
mightymoose/liquidhaskell | tests/pos/AmortizedQueue.hs | bsd-3-clause | {-@ type SListN a N = {v:SList a | size v = N} @-}
-- | Invariant: `size` is really the size:
{-@ data SList a = SL { size :: Int
, elems :: {v:[a] | len v = size}
}
@-}
-- | Size function actually returns the size: (Duh!)
{-@ size :: q:SList a -> {v:Nat | v = size q} @-}
-- | Non-Empty Lists:
{-@ type NEList a = {v:SList a | size v > 0} @-}
{-@ nil :: SListN a 0 @-}
nil = SL 0 [] | 461 | nil = SL 0 [] | 26 | nil = SL 0 [] | 26 | true | false | 0 | 6 | 171 | 21 | 14 | 7 | null | null |
janm399/equationsolver | src/EquationSolver/Solver.hs | apache-2.0 | evaluate :: [(Char, Double)] -> Expr -> Double
evaluate substitution (Mult a b) = (evaluate substitution a) * (evaluate substitution b) | 139 | evaluate :: [(Char, Double)] -> Expr -> Double
evaluate substitution (Mult a b) = (evaluate substitution a) * (evaluate substitution b) | 137 | evaluate substitution (Mult a b) = (evaluate substitution a) * (evaluate substitution b) | 90 | false | true | 0 | 7 | 24 | 66 | 33 | 33 | null | null |
ulan/hisp | level0/Hisp0.hs | unlicense | eval env x | isTrue x = mkTrue | 30 | eval env x | isTrue x = mkTrue | 30 | eval env x | isTrue x = mkTrue | 30 | false | false | 0 | 8 | 7 | 20 | 8 | 12 | null | null |
rawlep/EQS | sourceCode/RprGD2.hs | mit | vunStdNorm' vs = vunStdNorm (vmean vs) (vstDiv vs) vs | 53 | vunStdNorm' vs = vunStdNorm (vmean vs) (vstDiv vs) vs | 53 | vunStdNorm' vs = vunStdNorm (vmean vs) (vstDiv vs) vs | 53 | false | false | 0 | 7 | 8 | 28 | 13 | 15 | null | null |
ribag/ganeti-experiments | src/Ganeti/Metad/Config.hs | gpl-2.0 | getInstanceParams :: JSValue -> Result (String, InstanceParams)
getInstanceParams json =
case json of
JSObject jsonObj -> do
name <- case lookup "name" (fromJSObject jsonObj) of
Nothing -> Error "Could not find instance name"
Just (JSString x) -> Ok (JSON.fromJSString x)
_ -> Error "Name is not a string"
ip <- getInstanceCommunicationIp jsonObj
Ok (name, Map.fromList [(ip, json)])
_ ->
Error "Expecting a dictionary" | 521 | getInstanceParams :: JSValue -> Result (String, InstanceParams)
getInstanceParams json =
case json of
JSObject jsonObj -> do
name <- case lookup "name" (fromJSObject jsonObj) of
Nothing -> Error "Could not find instance name"
Just (JSString x) -> Ok (JSON.fromJSString x)
_ -> Error "Name is not a string"
ip <- getInstanceCommunicationIp jsonObj
Ok (name, Map.fromList [(ip, json)])
_ ->
Error "Expecting a dictionary" | 521 | getInstanceParams json =
case json of
JSObject jsonObj -> do
name <- case lookup "name" (fromJSObject jsonObj) of
Nothing -> Error "Could not find instance name"
Just (JSString x) -> Ok (JSON.fromJSString x)
_ -> Error "Name is not a string"
ip <- getInstanceCommunicationIp jsonObj
Ok (name, Map.fromList [(ip, json)])
_ ->
Error "Expecting a dictionary" | 457 | false | true | 0 | 17 | 164 | 151 | 72 | 79 | null | null |
spechub/Hets | CASL/OpItem.hs | gpl-2.0 | opHead :: [String] -> AParser st OP_HEAD
opHead ks =
do Pred_head vs ps <- predHead ks
do
c <- anColon
(b, s, qs) <- opSort ks
return $ Op_head (if b then Partial else Total) vs (Just s)
(ps `appRange` tokPos c `appRange` qs)
<|> return (Op_head Partial vs Nothing ps) | 328 | opHead :: [String] -> AParser st OP_HEAD
opHead ks =
do Pred_head vs ps <- predHead ks
do
c <- anColon
(b, s, qs) <- opSort ks
return $ Op_head (if b then Partial else Total) vs (Just s)
(ps `appRange` tokPos c `appRange` qs)
<|> return (Op_head Partial vs Nothing ps) | 328 | opHead ks =
do Pred_head vs ps <- predHead ks
do
c <- anColon
(b, s, qs) <- opSort ks
return $ Op_head (if b then Partial else Total) vs (Just s)
(ps `appRange` tokPos c `appRange` qs)
<|> return (Op_head Partial vs Nothing ps) | 287 | false | true | 0 | 15 | 111 | 140 | 70 | 70 | null | null |
mariusae/sstable | src/Data/SSTable/Writer.hs | bsd-3-clause | withWriter :: String -> (Writer -> IO a) -> IO a
withWriter path f = do
writer <- openWriter path
a <- f writer
closeWriter writer
return a | 147 | withWriter :: String -> (Writer -> IO a) -> IO a
withWriter path f = do
writer <- openWriter path
a <- f writer
closeWriter writer
return a | 147 | withWriter path f = do
writer <- openWriter path
a <- f writer
closeWriter writer
return a | 98 | false | true | 0 | 9 | 35 | 69 | 30 | 39 | null | null |
stevejb71/Idris-dev | src/IRTS/CodegenJavaScript.hs | bsd-3-clause | jsSTOREOLD :: CompileInfo ->JS
jsSTOREOLD _ = JSAssign (JSProj jsMYOLDBASE "addr") jsSTACKBASE | 94 | jsSTOREOLD :: CompileInfo ->JS
jsSTOREOLD _ = JSAssign (JSProj jsMYOLDBASE "addr") jsSTACKBASE | 94 | jsSTOREOLD _ = JSAssign (JSProj jsMYOLDBASE "addr") jsSTACKBASE | 63 | false | true | 0 | 7 | 11 | 35 | 16 | 19 | null | null |
MaxGabriel/hackvote-yesod | Application.hs | cc0-1.0 | ---------------------------------------------
-- Functions for use in development with GHCi
---------------------------------------------
-- | Run a handler
handler :: Handler a -> IO a
handler h = getAppSettings >>= makeFoundation >>= flip unsafeHandler h | 257 | handler :: Handler a -> IO a
handler h = getAppSettings >>= makeFoundation >>= flip unsafeHandler h | 99 | handler h = getAppSettings >>= makeFoundation >>= flip unsafeHandler h | 70 | true | true | 0 | 6 | 32 | 41 | 21 | 20 | null | null |
AnttiLukats/orp | software/tools/tidl/src/Tidl/Generate/C.hs | apache-2.0 | deserialize FString = "string_deserialize" | 42 | deserialize FString = "string_deserialize" | 42 | deserialize FString = "string_deserialize" | 42 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
junnf/Functional-Programming | codes/useful.hs | unlicense | pairs xs = zip xs (tail xs) | 27 | pairs xs = zip xs (tail xs) | 27 | pairs xs = zip xs (tail xs) | 27 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
ghc-android/ghc | compiler/basicTypes/Var.hs | bsd-3-clause | setVarType :: Id -> Type -> Id
setVarType id ty = id { varType = ty } | 69 | setVarType :: Id -> Type -> Id
setVarType id ty = id { varType = ty } | 69 | setVarType id ty = id { varType = ty } | 38 | false | true | 0 | 8 | 16 | 41 | 19 | 22 | null | null |
andreagenso/java2scala | test/J2s/Scanner/Test.hs | apache-2.0 | tssj = scanner (path ++ "workspaceclipse_haskell/java2scala/test/J2s/Parser/java/CharArrayPropertyEditorTests.java") | 116 | tssj = scanner (path ++ "workspaceclipse_haskell/java2scala/test/J2s/Parser/java/CharArrayPropertyEditorTests.java") | 116 | tssj = scanner (path ++ "workspaceclipse_haskell/java2scala/test/J2s/Parser/java/CharArrayPropertyEditorTests.java") | 116 | false | false | 1 | 7 | 5 | 20 | 8 | 12 | null | null |
whittle/euler | src/Euler/Problem030.hs | mit | hasDigits _ [] = False | 22 | hasDigits _ [] = False | 22 | hasDigits _ [] = False | 22 | false | false | 0 | 6 | 4 | 13 | 6 | 7 | null | null |
sm-haskell-users-group/cis-194 | src/Cis194/Hw/Ring.hs | bsd-3-clause | eval (Add x y) = add (eval x) (eval y) | 39 | eval (Add x y) = add (eval x) (eval y) | 39 | eval (Add x y) = add (eval x) (eval y) | 39 | false | false | 0 | 7 | 10 | 35 | 16 | 19 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_V_COMMENTLINEBANG :: Int
wxSTC_V_COMMENTLINEBANG = 3 | 58 | wxSTC_V_COMMENTLINEBANG :: Int
wxSTC_V_COMMENTLINEBANG = 3 | 58 | wxSTC_V_COMMENTLINEBANG = 3 | 27 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
rueshyna/gogol | gogol-replicapool/gen/Network/Google/ReplicaPool/Types/Product.hs | mpl-2.0 | -- | [Output only] If operation fails, the HTTP error status code returned.
oHTTPErrorStatusCode :: Lens' Operation (Maybe Int32)
oHTTPErrorStatusCode
= lens _oHTTPErrorStatusCode
(\ s a -> s{_oHTTPErrorStatusCode = a})
. mapping _Coerce | 251 | oHTTPErrorStatusCode :: Lens' Operation (Maybe Int32)
oHTTPErrorStatusCode
= lens _oHTTPErrorStatusCode
(\ s a -> s{_oHTTPErrorStatusCode = a})
. mapping _Coerce | 175 | oHTTPErrorStatusCode
= lens _oHTTPErrorStatusCode
(\ s a -> s{_oHTTPErrorStatusCode = a})
. mapping _Coerce | 121 | true | true | 2 | 8 | 46 | 60 | 28 | 32 | null | null |
ezyang/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | userHsLTyVarBndrs :: SrcSpan -> [Located (IdP name)] -> [LHsTyVarBndr name]
-- Caller sets location
userHsLTyVarBndrs loc bndrs = [ L loc (UserTyVar v) | v <- bndrs ] | 166 | userHsLTyVarBndrs :: SrcSpan -> [Located (IdP name)] -> [LHsTyVarBndr name]
userHsLTyVarBndrs loc bndrs = [ L loc (UserTyVar v) | v <- bndrs ] | 142 | userHsLTyVarBndrs loc bndrs = [ L loc (UserTyVar v) | v <- bndrs ] | 66 | true | true | 0 | 10 | 27 | 65 | 33 | 32 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Seq/JoinList.hs | mit | foldl' f e (L x) = e `seq` f e x | 32 | foldl' f e (L x) = e `seq` f e x | 32 | foldl' f e (L x) = e `seq` f e x | 32 | false | false | 0 | 7 | 10 | 30 | 15 | 15 | null | null |
svenssonjoel/GCDObsidian | Obsidian/GCDObsidian/Array.hs | bsd-3-clause | mkPushArray p n = Array (Push p) n | 34 | mkPushArray p n = Array (Push p) n | 34 | mkPushArray p n = Array (Push p) n | 34 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
Teaspot-Studio/gore-and-ash-logging | src/Game/GoreAndAsh/Logging/State.hs | bsd-3-clause | emptyLoggingEnv :: MonadGame t m => m (LoggingEnv t)
emptyLoggingEnv = do
fileSink <- newExternalRef Nothing
lfilter <- newExternalRef mempty
debugFlag <- newExternalRef False
consoleSink <- liftIO $ newStdoutLoggerSet defaultBufSize
return LoggingEnv {
loggingFileSink = fileSink
, loggingConsoleSink = consoleSink
, loggingFilter = lfilter
, loggingDebug = debugFlag
}
-- | Returns 'True' if given message level is allowed to go in the sink | 475 | emptyLoggingEnv :: MonadGame t m => m (LoggingEnv t)
emptyLoggingEnv = do
fileSink <- newExternalRef Nothing
lfilter <- newExternalRef mempty
debugFlag <- newExternalRef False
consoleSink <- liftIO $ newStdoutLoggerSet defaultBufSize
return LoggingEnv {
loggingFileSink = fileSink
, loggingConsoleSink = consoleSink
, loggingFilter = lfilter
, loggingDebug = debugFlag
}
-- | Returns 'True' if given message level is allowed to go in the sink | 475 | emptyLoggingEnv = do
fileSink <- newExternalRef Nothing
lfilter <- newExternalRef mempty
debugFlag <- newExternalRef False
consoleSink <- liftIO $ newStdoutLoggerSet defaultBufSize
return LoggingEnv {
loggingFileSink = fileSink
, loggingConsoleSink = consoleSink
, loggingFilter = lfilter
, loggingDebug = debugFlag
}
-- | Returns 'True' if given message level is allowed to go in the sink | 422 | false | true | 0 | 10 | 96 | 112 | 53 | 59 | null | null |
scott-fleischman/greek-grammar | haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs | mit | decomposeChar '\x1FFB' = "\x03A9\x0301" | 39 | decomposeChar '\x1FFB' = "\x03A9\x0301" | 39 | decomposeChar '\x1FFB' = "\x03A9\x0301" | 39 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
maxeler/maxskins | examples/Simple/client/hs/AdvancedStatic/SimpleClient.hs | bsd-2-clause | printErrors :: [Int] -> [Double] -> [Double] -> String -> String
printErrors [] [] [] output = output | 117 | printErrors :: [Int] -> [Double] -> [Double] -> String -> String
printErrors [] [] [] output = output | 117 | printErrors [] [] [] output = output | 52 | false | true | 0 | 11 | 33 | 57 | 28 | 29 | null | null |
christiaanb/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | parseCodegen :: String -> Codegen
parseCodegen "C" = ViaC | 57 | parseCodegen :: String -> Codegen
parseCodegen "C" = ViaC | 57 | parseCodegen "C" = ViaC | 23 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
meteogrid/bindings-gdal | Setup.hs | bsd-3-clause | parseLibraries :: [String] -> [(String, Maybe FilePath)]
parseLibraries = concatMap go
where
go ('-':'l':name) = [(name, Nothing)]
go ('-':_) = []
go p = case staticLibNameAndPath p of
Just (n,p) -> [(n,Just p)]
Nothing -> [] | 316 | parseLibraries :: [String] -> [(String, Maybe FilePath)]
parseLibraries = concatMap go
where
go ('-':'l':name) = [(name, Nothing)]
go ('-':_) = []
go p = case staticLibNameAndPath p of
Just (n,p) -> [(n,Just p)]
Nothing -> [] | 316 | parseLibraries = concatMap go
where
go ('-':'l':name) = [(name, Nothing)]
go ('-':_) = []
go p = case staticLibNameAndPath p of
Just (n,p) -> [(n,Just p)]
Nothing -> [] | 259 | false | true | 2 | 11 | 126 | 132 | 70 | 62 | null | null |
adinapoli/api-tools | tests/Data/API/Test/JSON.hs | bsd-3-clause | errorDecoding :: [TestTree]
errorDecoding = [ help "not enough bytes" "" (proxy :: Int)
[(SyntaxError "not enough bytes", [])]
, help "object for int" "{}" (proxy :: Int)
[(Expected ExpInt "Int" (JS.Object HMap.empty), [])]
, help "missing alt" "{}" (proxy :: AUnion)
[(MissingAlt ["bar"], [])]
, help "unexpected value" "[\"no\"]" (proxy :: [AnEnum])
[(UnexpectedEnumVal ["bar", "foo"] "no", [InElem 0])]
, help "missing field" "{}" (proxy :: Bar)
[(MissingField, [InField "id"])]
]
where
proxy = error "proxy"
help x s v es = testCase x $ case decodeWithErrs s `asTypeOf` Right v of
Right _ -> assertFailure $ "Decode returned value: " ++ show s
Left es' -> assertBool ("Unexpected error when decoding: " ++ show s
++ "\n" ++ prettyJSONErrorPositions es'
++ "\ninstead of\n" ++ prettyJSONErrorPositions es)
(es == es') | 1,239 | errorDecoding :: [TestTree]
errorDecoding = [ help "not enough bytes" "" (proxy :: Int)
[(SyntaxError "not enough bytes", [])]
, help "object for int" "{}" (proxy :: Int)
[(Expected ExpInt "Int" (JS.Object HMap.empty), [])]
, help "missing alt" "{}" (proxy :: AUnion)
[(MissingAlt ["bar"], [])]
, help "unexpected value" "[\"no\"]" (proxy :: [AnEnum])
[(UnexpectedEnumVal ["bar", "foo"] "no", [InElem 0])]
, help "missing field" "{}" (proxy :: Bar)
[(MissingField, [InField "id"])]
]
where
proxy = error "proxy"
help x s v es = testCase x $ case decodeWithErrs s `asTypeOf` Right v of
Right _ -> assertFailure $ "Decode returned value: " ++ show s
Left es' -> assertBool ("Unexpected error when decoding: " ++ show s
++ "\n" ++ prettyJSONErrorPositions es'
++ "\ninstead of\n" ++ prettyJSONErrorPositions es)
(es == es') | 1,239 | errorDecoding = [ help "not enough bytes" "" (proxy :: Int)
[(SyntaxError "not enough bytes", [])]
, help "object for int" "{}" (proxy :: Int)
[(Expected ExpInt "Int" (JS.Object HMap.empty), [])]
, help "missing alt" "{}" (proxy :: AUnion)
[(MissingAlt ["bar"], [])]
, help "unexpected value" "[\"no\"]" (proxy :: [AnEnum])
[(UnexpectedEnumVal ["bar", "foo"] "no", [InElem 0])]
, help "missing field" "{}" (proxy :: Bar)
[(MissingField, [InField "id"])]
]
where
proxy = error "proxy"
help x s v es = testCase x $ case decodeWithErrs s `asTypeOf` Right v of
Right _ -> assertFailure $ "Decode returned value: " ++ show s
Left es' -> assertBool ("Unexpected error when decoding: " ++ show s
++ "\n" ++ prettyJSONErrorPositions es'
++ "\ninstead of\n" ++ prettyJSONErrorPositions es)
(es == es') | 1,211 | false | true | 2 | 16 | 548 | 343 | 175 | 168 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Compute/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'AutoscalingPolicy' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'apCustomMetricUtilizations'
--
-- * 'apMaxNumReplicas'
--
-- * 'apCPUUtilization'
--
-- * 'apLoadBalancingUtilization'
--
-- * 'apMinNumReplicas'
--
-- * 'apCoolDownPeriodSec'
autoscalingPolicy
:: AutoscalingPolicy
autoscalingPolicy =
AutoscalingPolicy'
{ _apCustomMetricUtilizations = Nothing
, _apMaxNumReplicas = Nothing
, _apCPUUtilization = Nothing
, _apLoadBalancingUtilization = Nothing
, _apMinNumReplicas = Nothing
, _apCoolDownPeriodSec = Nothing
} | 672 | autoscalingPolicy
:: AutoscalingPolicy
autoscalingPolicy =
AutoscalingPolicy'
{ _apCustomMetricUtilizations = Nothing
, _apMaxNumReplicas = Nothing
, _apCPUUtilization = Nothing
, _apLoadBalancingUtilization = Nothing
, _apMinNumReplicas = Nothing
, _apCoolDownPeriodSec = Nothing
} | 318 | autoscalingPolicy =
AutoscalingPolicy'
{ _apCustomMetricUtilizations = Nothing
, _apMaxNumReplicas = Nothing
, _apCPUUtilization = Nothing
, _apLoadBalancingUtilization = Nothing
, _apMinNumReplicas = Nothing
, _apCoolDownPeriodSec = Nothing
} | 275 | true | true | 0 | 7 | 120 | 74 | 48 | 26 | null | null |
urbanslug/ghc | libraries/template-haskell/Language/Haskell/TH/Syntax.hs | bsd-3-clause | -- | Module prefix of a name, if it exists
nameModule :: Name -> Maybe String
nameModule (Name _ (NameQ m)) = Just (modString m) | 132 | nameModule :: Name -> Maybe String
nameModule (Name _ (NameQ m)) = Just (modString m) | 89 | nameModule (Name _ (NameQ m)) = Just (modString m) | 54 | true | true | 0 | 9 | 28 | 45 | 22 | 23 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.