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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ExNexu/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | annotationColour ist (AnnConst c) =
let theme = idris_colourTheme ist
in Just $ if constIsType c
then typeColour theme
else dataColour theme | 180 | annotationColour ist (AnnConst c) =
let theme = idris_colourTheme ist
in Just $ if constIsType c
then typeColour theme
else dataColour theme | 180 | annotationColour ist (AnnConst c) =
let theme = idris_colourTheme ist
in Just $ if constIsType c
then typeColour theme
else dataColour theme | 180 | false | false | 2 | 9 | 61 | 55 | 24 | 31 | null | null |
geraldus/yesod | yesod-form/Yesod/Form/Functions.hs | mit | runFormPostNoToken :: MonadHandler m
=> (Html -> MForm m a)
-> m (a, Enctype)
runFormPostNoToken form = do
langs <- languages
m <- getYesod
env <- postEnv
runFormGeneric (form mempty) m langs env | 249 | runFormPostNoToken :: MonadHandler m
=> (Html -> MForm m a)
-> m (a, Enctype)
runFormPostNoToken form = do
langs <- languages
m <- getYesod
env <- postEnv
runFormGeneric (form mempty) m langs env | 249 | runFormPostNoToken form = do
langs <- languages
m <- getYesod
env <- postEnv
runFormGeneric (form mempty) m langs env | 133 | false | true | 0 | 9 | 86 | 85 | 40 | 45 | null | null |
alexander-at-github/eta | compiler/ETA/SimplCore/SetLevels.hs | bsd-3-clause | lookupVar :: LevelEnv -> Id -> LevelledExpr
lookupVar le v = case lookupVarEnv (le_env le) v of
Just (_, expr) -> expr
_ -> Var v | 182 | lookupVar :: LevelEnv -> Id -> LevelledExpr
lookupVar le v = case lookupVarEnv (le_env le) v of
Just (_, expr) -> expr
_ -> Var v | 182 | lookupVar le v = case lookupVarEnv (le_env le) v of
Just (_, expr) -> expr
_ -> Var v | 138 | false | true | 0 | 9 | 78 | 68 | 32 | 36 | null | null |
romanb/amazonka | amazonka-rds/gen/Network/AWS/RDS/Types.hs | mpl-2.0 | -- | Indicates the major engine version associated with this option group.
ogMajorEngineVersion :: Lens' OptionGroup (Maybe Text)
ogMajorEngineVersion =
lens _ogMajorEngineVersion (\s a -> s { _ogMajorEngineVersion = a }) | 225 | ogMajorEngineVersion :: Lens' OptionGroup (Maybe Text)
ogMajorEngineVersion =
lens _ogMajorEngineVersion (\s a -> s { _ogMajorEngineVersion = a }) | 150 | ogMajorEngineVersion =
lens _ogMajorEngineVersion (\s a -> s { _ogMajorEngineVersion = a }) | 95 | true | true | 0 | 9 | 34 | 46 | 25 | 21 | null | null |
beni55/cps-core | CPS/Syntax.hs | bsd-3-clause | stackLookup u (kf:k) = case M.lookup u kf of
Just res -> Just (res, kf:k)
Nothing -> stackLookup u k | 109 | stackLookup u (kf:k) = case M.lookup u kf of
Just res -> Just (res, kf:k)
Nothing -> stackLookup u k | 109 | stackLookup u (kf:k) = case M.lookup u kf of
Just res -> Just (res, kf:k)
Nothing -> stackLookup u k | 109 | false | false | 0 | 10 | 28 | 64 | 30 | 34 | null | null |
seckcoder/vector | Data/Vector/Storable.hs | bsd-3-clause | unsafeLast = G.unsafeLast | 25 | unsafeLast = G.unsafeLast | 25 | unsafeLast = G.unsafeLast | 25 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
andorp/grin | grin/src/Test/Test.hs | bsd-3-clause | downScale :: Gen a -> Gen a
downScale = scale (`div` 2) | 55 | downScale :: Gen a -> Gen a
downScale = scale (`div` 2) | 55 | downScale = scale (`div` 2) | 27 | false | true | 0 | 7 | 11 | 35 | 17 | 18 | null | null |
MichaelXavier/HTTPMock | src/Network/HTTPMock.hs | bsd-2-clause | --withMocker_ mocker action = snd <$> runWithMocker_ mocker action
resetRecorder :: HTTPMocker -> HTTPMocker
resetRecorder mocker = mocker & recordedRequests .~ empty | 167 | resetRecorder :: HTTPMocker -> HTTPMocker
resetRecorder mocker = mocker & recordedRequests .~ empty | 99 | resetRecorder mocker = mocker & recordedRequests .~ empty | 57 | true | true | 0 | 7 | 22 | 33 | 15 | 18 | null | null |
rueshyna/gogol | gogol-bigquery/gen/Network/Google/BigQuery/Types/Product.hs | mpl-2.0 | -- | [Optional] Accept rows that contain values that do not match the schema.
-- The unknown values are ignored. Default is false, which treats unknown
-- values as errors.
tdiarIgnoreUnknownValues :: Lens' TableDataInsertAllRequest (Maybe Bool)
tdiarIgnoreUnknownValues
= lens _tdiarIgnoreUnknownValues
(\ s a -... | 355 | tdiarIgnoreUnknownValues :: Lens' TableDataInsertAllRequest (Maybe Bool)
tdiarIgnoreUnknownValues
= lens _tdiarIgnoreUnknownValues
(\ s a -> s{_tdiarIgnoreUnknownValues = a}) | 182 | tdiarIgnoreUnknownValues
= lens _tdiarIgnoreUnknownValues
(\ s a -> s{_tdiarIgnoreUnknownValues = a}) | 109 | true | true | 0 | 9 | 54 | 50 | 27 | 23 | null | null |
Cordite-Studios/solar | solar-wind/Solar/Utility/Delta.hs | mit | insertZipper :: (Num b, Ord b) => Queue a b -> DeltaContainer a b -> QueueZipper a b
insertZipper qs c = (before, c':after)
where
rc = remaining c
(before, after) = zipTo qs rc
c' = c {remaining = rc - sumQueue before} | 246 | insertZipper :: (Num b, Ord b) => Queue a b -> DeltaContainer a b -> QueueZipper a b
insertZipper qs c = (before, c':after)
where
rc = remaining c
(before, after) = zipTo qs rc
c' = c {remaining = rc - sumQueue before} | 246 | insertZipper qs c = (before, c':after)
where
rc = remaining c
(before, after) = zipTo qs rc
c' = c {remaining = rc - sumQueue before} | 161 | false | true | 1 | 9 | 71 | 123 | 59 | 64 | null | null |
frantisekfarka/ghc-dsi | testsuite/tests/profiling/should_run/T3001-2.hs | bsd-3-clause | nitState :: L.ByteString -> S
initState xs = mkState xs 0
| 58 | initState :: L.ByteString -> S
initState xs = mkState xs 0 | 58 | initState xs = mkState xs 0 | 27 | false | true | 0 | 6 | 11 | 25 | 12 | 13 | null | null |
snowmantw/Frag | src/Main.hs | gpl-2.0 | msInterval :: Int
msInterval = 16 | 33 | msInterval :: Int
msInterval = 16 | 33 | msInterval = 16 | 15 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
Crazycolorz5/Haskell-Code | fizzBuzz_tasks.hs | unlicense | {-
problem_seven::(Eq a)=>[a]->[a]
problem_seven lst = let
count::(Eq a)=>a->[a]->Int
count elem = length . filter (==elem)
add_counts::[(a, Int)]
add_counts = map (\x->(x, count x lst)) lst
in problem_six add_counts
-}
a = take 99 [2..] | 269 | a = take 99 [2..] | 17 | a = take 99 [2..] | 17 | true | false | 1 | 6 | 66 | 18 | 8 | 10 | null | null |
AlainODea-haskell/uuid | tests/TestUUID.hs | bsd-3-clause | prop_v5NotNull :: Test
prop_v5NotNull = testProperty "V5 not null" v5NotNull
where v5NotNull :: [Word8] -> Bool
v5NotNull = not . U.null . U5.generateNamed U5.namespaceDNS | 185 | prop_v5NotNull :: Test
prop_v5NotNull = testProperty "V5 not null" v5NotNull
where v5NotNull :: [Word8] -> Bool
v5NotNull = not . U.null . U5.generateNamed U5.namespaceDNS | 185 | prop_v5NotNull = testProperty "V5 not null" v5NotNull
where v5NotNull :: [Word8] -> Bool
v5NotNull = not . U.null . U5.generateNamed U5.namespaceDNS | 162 | false | true | 0 | 9 | 37 | 52 | 27 | 25 | null | null |
GaloisInc/galua | lib/macho/src/Data/Macho.hs | mit | getVM_PROT :: MachoReader -> Get [VM_PROT]
getVM_PROT mr = getVM_PROT_ (31::Int) <$> getWord32 mr
where getVM_PROT_ 0 _ = []
getVM_PROT_ 1 word | testBit word 0 = VM_PROT_READ : getVM_PROT_ 0 word
getVM_PROT_ 2 word | testBit word 1 = VM_PROT_WRITE : getVM_PROT_ 1 word
getVM_PROT_... | 437 | getVM_PROT :: MachoReader -> Get [VM_PROT]
getVM_PROT mr = getVM_PROT_ (31::Int) <$> getWord32 mr
where getVM_PROT_ 0 _ = []
getVM_PROT_ 1 word | testBit word 0 = VM_PROT_READ : getVM_PROT_ 0 word
getVM_PROT_ 2 word | testBit word 1 = VM_PROT_WRITE : getVM_PROT_ 1 word
getVM_PROT_... | 437 | getVM_PROT mr = getVM_PROT_ (31::Int) <$> getWord32 mr
where getVM_PROT_ 0 _ = []
getVM_PROT_ 1 word | testBit word 0 = VM_PROT_READ : getVM_PROT_ 0 word
getVM_PROT_ 2 word | testBit word 1 = VM_PROT_WRITE : getVM_PROT_ 1 word
getVM_PROT_ 3 word | testBit word 2 = VM_PROT_EXECUTE ... | 394 | false | true | 4 | 8 | 114 | 177 | 78 | 99 | null | null |
spechub/Hets | OWL2/ParseMS.hs | gpl-2.0 | bjectPropertyFrame :: GA.PrefixMap -> CharParser st [Axiom]
objectPropertyFrame pm = do
pkeyword objectPropertyC
oe <- objectPropertyExpr pm
bits <- many $ objectPropertyFrameBit pm oe
return $ case oe of
ObjectProp i -> Declaration [] (mkEntity ObjectProperty i) : concat bits
_ -> concat bi... | 323 | objectPropertyFrame :: GA.PrefixMap -> CharParser st [Axiom]
objectPropertyFrame pm = do
pkeyword objectPropertyC
oe <- objectPropertyExpr pm
bits <- many $ objectPropertyFrameBit pm oe
return $ case oe of
ObjectProp i -> Declaration [] (mkEntity ObjectProperty i) : concat bits
_ -> concat b... | 323 | objectPropertyFrame pm = do
pkeyword objectPropertyC
oe <- objectPropertyExpr pm
bits <- many $ objectPropertyFrameBit pm oe
return $ case oe of
ObjectProp i -> Declaration [] (mkEntity ObjectProperty i) : concat bits
_ -> concat bits | 262 | false | true | 0 | 14 | 72 | 111 | 50 | 61 | null | null |
ksaveljev/hake-2 | src/CVarVariables.hs | bsd-3-clause | maxClientsCVar = CVar.getExisting "maxclients" | 60 | maxClientsCVar = CVar.getExisting "maxclients" | 60 | maxClientsCVar = CVar.getExisting "maxclients" | 60 | false | false | 0 | 6 | 17 | 11 | 5 | 6 | null | null |
sos22/himap | HeaderParse.hs | gpl-3.0 | msgId :: Parser [DS.SQLData]
msgId =
alternatives [do descr <- liftM (maybe [] singleton) $ optional $ phrase `followedBy` skipCFWS
_ <- many1greedy $ char '<'
l <- skipSpace $ many1Sep (alternatives [noFoldQuote, noFoldLiteral, localPart, domainLiteral]) (char '@')
... | 636 | msgId :: Parser [DS.SQLData]
msgId =
alternatives [do descr <- liftM (maybe [] singleton) $ optional $ phrase `followedBy` skipCFWS
_ <- many1greedy $ char '<'
l <- skipSpace $ many1Sep (alternatives [noFoldQuote, noFoldLiteral, localPart, domainLiteral]) (char '@')
... | 636 | msgId =
alternatives [do descr <- liftM (maybe [] singleton) $ optional $ phrase `followedBy` skipCFWS
_ <- many1greedy $ char '<'
l <- skipSpace $ many1Sep (alternatives [noFoldQuote, noFoldLiteral, localPart, domainLiteral]) (char '@')
_ <- skipSpace $ many1g... | 607 | false | true | 0 | 16 | 189 | 239 | 117 | 122 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Yacc.hs | gpl-2.0 | -- | Full name of language.
syntaxName :: String
syntaxName = "Yacc/Bison" | 74 | syntaxName :: String
syntaxName = "Yacc/Bison" | 46 | syntaxName = "Yacc/Bison" | 25 | true | true | 0 | 6 | 11 | 19 | 8 | 11 | null | null |
alexander-at-github/eta | compiler/ETA/Core/CoreFVs.hs | bsd-3-clause | -- See Note [Rule free var hack]
-- | Those variables free in the both the left right hand sides of a rule
ruleFreeVars :: CoreRule -> VarSet
ruleFreeVars (BuiltinRule {}) = noFVs | 180 | ruleFreeVars :: CoreRule -> VarSet
ruleFreeVars (BuiltinRule {}) = noFVs | 72 | ruleFreeVars (BuiltinRule {}) = noFVs | 37 | true | true | 0 | 7 | 33 | 27 | 15 | 12 | null | null |
fibsifan/pandoc | src/Text/Pandoc/Readers/Org.hs | gpl-2.0 | -- | The maximum number of newlines within
emphasisAllowedNewlines :: Int
emphasisAllowedNewlines = 1 | 101 | emphasisAllowedNewlines :: Int
emphasisAllowedNewlines = 1 | 58 | emphasisAllowedNewlines = 1 | 27 | true | true | 0 | 6 | 13 | 19 | 8 | 11 | null | null |
JustusAdam/marvin | src/Marvin/Adapter/Telegram/Internal/Common.hs | bsd-3-clause | parseFileHelper :: (Object -> Parser TelegramRemoteFileStruct) -> Value -> Parser (Object, TelegramRemoteFileStruct)
parseFileHelper f = withObject "expected object" $ \o -> (o, ) <$> f o | 187 | parseFileHelper :: (Object -> Parser TelegramRemoteFileStruct) -> Value -> Parser (Object, TelegramRemoteFileStruct)
parseFileHelper f = withObject "expected object" $ \o -> (o, ) <$> f o | 187 | parseFileHelper f = withObject "expected object" $ \o -> (o, ) <$> f o | 70 | false | true | 0 | 9 | 25 | 68 | 34 | 34 | null | null |
mcschroeder/ghc | compiler/basicTypes/Id.hs | bsd-3-clause | isDataConWorkId id = case Var.idDetails id of
DataConWorkId _ -> True
_ -> False | 142 | isDataConWorkId id = case Var.idDetails id of
DataConWorkId _ -> True
_ -> False | 142 | isDataConWorkId id = case Var.idDetails id of
DataConWorkId _ -> True
_ -> False | 142 | false | false | 0 | 8 | 75 | 33 | 15 | 18 | null | null |
brendanhay/gogol | gogol-accesscontextmanager/gen/Network/Google/AccessContextManager/Types/Product.hs | mpl-2.0 | -- | Required. The parent of this \`AccessPolicy\` in the Cloud Resource
-- Hierarchy. Currently immutable once created. Format:
-- \`organizations\/{organization_id}\`
apParent :: Lens' AccessPolicy (Maybe Text)
apParent = lens _apParent (\ s a -> s{_apParent = a}) | 266 | apParent :: Lens' AccessPolicy (Maybe Text)
apParent = lens _apParent (\ s a -> s{_apParent = a}) | 97 | apParent = lens _apParent (\ s a -> s{_apParent = a}) | 53 | true | true | 0 | 9 | 37 | 48 | 27 | 21 | null | null |
rcook/mlutil | mlutil/src/MLUtil/Graphics/Flowchart.hs | mit | defaultFlowchartLayout :: FlowchartLayout
defaultFlowchartLayout = FlowchartLayout
{ flBoxInnerWidth = 10
, flBoxInnerHeight = 5
, flBoxFrameWidth = 2
, flBranchFontSize = 6
, flLeafFontSize = 7
, flNodeFontSize = 7
} | 245 | defaultFlowchartLayout :: FlowchartLayout
defaultFlowchartLayout = FlowchartLayout
{ flBoxInnerWidth = 10
, flBoxInnerHeight = 5
, flBoxFrameWidth = 2
, flBranchFontSize = 6
, flLeafFontSize = 7
, flNodeFontSize = 7
} | 245 | defaultFlowchartLayout = FlowchartLayout
{ flBoxInnerWidth = 10
, flBoxInnerHeight = 5
, flBoxFrameWidth = 2
, flBranchFontSize = 6
, flLeafFontSize = 7
, flNodeFontSize = 7
} | 203 | false | true | 0 | 6 | 58 | 49 | 31 | 18 | null | null |
planrich/abstractmachines | src/Interpretor.hs | bsd-3-clause | subsBinding fname ((BList (_,(BVar tail'))):bs) es'@(e:es) ex
| isListExpr e = do
subs' <- (subs ex tail' (listTail e))
subsBinding fname bs es subs'
| otherwise = throwError $ Fallback $ "could not match " ++ (show e) ++ " agains a list or string" | 273 | subsBinding fname ((BList (_,(BVar tail'))):bs) es'@(e:es) ex
| isListExpr e = do
subs' <- (subs ex tail' (listTail e))
subsBinding fname bs es subs'
| otherwise = throwError $ Fallback $ "could not match " ++ (show e) ++ " agains a list or string" | 273 | subsBinding fname ((BList (_,(BVar tail'))):bs) es'@(e:es) ex
| isListExpr e = do
subs' <- (subs ex tail' (listTail e))
subsBinding fname bs es subs'
| otherwise = throwError $ Fallback $ "could not match " ++ (show e) ++ " agains a list or string" | 273 | false | false | 1 | 13 | 69 | 125 | 61 | 64 | null | null |
frp-arduino/frp-arduino | src/Arduino/Library/LCD.hs | gpl-3.0 | getBit :: Int -> Int -> Int
getBit bit number = (number `shiftR` bit) .&. 0x1 | 77 | getBit :: Int -> Int -> Int
getBit bit number = (number `shiftR` bit) .&. 0x1 | 77 | getBit bit number = (number `shiftR` bit) .&. 0x1 | 49 | false | true | 0 | 8 | 15 | 43 | 21 | 22 | null | null |
snoyberg/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | bumpVersion :: Version -> Version
bumpVersion v = v+1 | 53 | bumpVersion :: Version -> Version
bumpVersion v = v+1 | 53 | bumpVersion v = v+1 | 19 | false | true | 0 | 5 | 8 | 22 | 11 | 11 | null | null |
Oblosys/webviews | src/lib/BlazeHtml.hs | mit | white = "white" | 15 | white = "white" | 15 | white = "white" | 15 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
jotrk/xhb-ewmh | src/Graphics/XHB/Ewmh/Error.hs | bsd-2-clause | getNetWmVisibleName :: EwmhErrorCtx m => Connection -> WINDOW -> m [String]
getNetWmVisibleName c w = E.getNetWmVisibleName c w >>= eitherToError | 145 | getNetWmVisibleName :: EwmhErrorCtx m => Connection -> WINDOW -> m [String]
getNetWmVisibleName c w = E.getNetWmVisibleName c w >>= eitherToError | 145 | getNetWmVisibleName c w = E.getNetWmVisibleName c w >>= eitherToError | 69 | false | true | 0 | 9 | 19 | 48 | 23 | 25 | null | null |
oldmanmike/ghc | libraries/template-haskell/Language/Haskell/TH/Syntax.hs | bsd-3-clause | -- | @reifyConStrictness nm@ looks up the strictness information for the fields
-- of the constructor with the name @nm@. Note that the strictness information
-- that 'reifyConStrictness' returns may not correspond to what is written in
-- the source code. For example, in the following data declaration:
--
-- @
-- data... | 656 | reifyConStrictness :: Name -> Q [DecidedStrictness]
reifyConStrictness n = Q (qReifyConStrictness n) | 100 | reifyConStrictness n = Q (qReifyConStrictness n) | 48 | true | true | 0 | 7 | 97 | 45 | 28 | 17 | null | null |
AlexeyRaga/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | tagOf_PrimOp Word2DoubleOp = _ILIT(33) | 38 | tagOf_PrimOp Word2DoubleOp = _ILIT(33) | 38 | tagOf_PrimOp Word2DoubleOp = _ILIT(33) | 38 | false | false | 0 | 6 | 3 | 16 | 7 | 9 | null | null |
keera-studios/hsQt | Qtc/Enums/Gui/QAbstractItemView.hs | bsd-2-clause | ieQAbstractItemViewSelectionMode :: Int -> QAbstractItemViewSelectionMode
ieQAbstractItemViewSelectionMode x = QEnum (CQAbstractItemViewSelectionMode x) | 152 | ieQAbstractItemViewSelectionMode :: Int -> QAbstractItemViewSelectionMode
ieQAbstractItemViewSelectionMode x = QEnum (CQAbstractItemViewSelectionMode x) | 152 | ieQAbstractItemViewSelectionMode x = QEnum (CQAbstractItemViewSelectionMode x) | 78 | false | true | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
typelead/epm | Cabal/Distribution/Simple/ETA.hs | bsd-3-clause | checkPackageDbStack :: PackageDBStack -> IO ()
checkPackageDbStack (GlobalPackageDB:rest)
| GlobalPackageDB `notElem` rest = return () | 136 | checkPackageDbStack :: PackageDBStack -> IO ()
checkPackageDbStack (GlobalPackageDB:rest)
| GlobalPackageDB `notElem` rest = return () | 136 | checkPackageDbStack (GlobalPackageDB:rest)
| GlobalPackageDB `notElem` rest = return () | 89 | false | true | 0 | 8 | 16 | 47 | 23 | 24 | null | null |
naushadh/persistent | persistent-mongoDB/Database/Persist/MongoDB.hs | mit | mongoFilterToDoc :: PersistEntity record => MongoFilter record -> DB.Document
mongoFilterToDoc (NestedFilter field op) = mongoFilterToBSON (nestedFieldName field) op | 167 | mongoFilterToDoc :: PersistEntity record => MongoFilter record -> DB.Document
mongoFilterToDoc (NestedFilter field op) = mongoFilterToBSON (nestedFieldName field) op | 167 | mongoFilterToDoc (NestedFilter field op) = mongoFilterToBSON (nestedFieldName field) op | 89 | false | true | 0 | 7 | 19 | 49 | 23 | 26 | null | null |
codecurve/FieldML-Haskell-01 | src/FieldML/Utility01.hs | bsd-2-clause | -- Todo: This assumes that the index selector is always "hard coded", we will possibly in future want to support using an integer expression for the index.
freeVariables (KroneckerProduct xs) = freeVariables $ Tuple xs | 218 | freeVariables (KroneckerProduct xs) = freeVariables $ Tuple xs | 62 | freeVariables (KroneckerProduct xs) = freeVariables $ Tuple xs | 62 | true | false | 0 | 6 | 34 | 24 | 11 | 13 | null | null |
keithodulaigh/Hets | Isabelle/IsaImport.hs | gpl-2.0 | hXmlBody_2IsaSentence (Body_Primrec (Primrec a (NonEmpty funs))) =
IsaSign.Primrec {
IsaSign.primrecTarget = fmap IsaSign.mkQName $ primrecTarget a,
IsaSign.primrecEquations = map (\ (Fun a' mx tp (NonEmpty eqs)) ->
(funName a', fmap hXmlMixfix2IsaMixfix mx,
hXmlOneOf3_2IsaTyp tp, map (\ (Equation (NonEmpty... | 431 | hXmlBody_2IsaSentence (Body_Primrec (Primrec a (NonEmpty funs))) =
IsaSign.Primrec {
IsaSign.primrecTarget = fmap IsaSign.mkQName $ primrecTarget a,
IsaSign.primrecEquations = map (\ (Fun a' mx tp (NonEmpty eqs)) ->
(funName a', fmap hXmlMixfix2IsaMixfix mx,
hXmlOneOf3_2IsaTyp tp, map (\ (Equation (NonEmpty... | 431 | hXmlBody_2IsaSentence (Body_Primrec (Primrec a (NonEmpty funs))) =
IsaSign.Primrec {
IsaSign.primrecTarget = fmap IsaSign.mkQName $ primrecTarget a,
IsaSign.primrecEquations = map (\ (Fun a' mx tp (NonEmpty eqs)) ->
(funName a', fmap hXmlMixfix2IsaMixfix mx,
hXmlOneOf3_2IsaTyp tp, map (\ (Equation (NonEmpty... | 431 | false | false | 0 | 21 | 84 | 176 | 89 | 87 | null | null |
spell-music/temporal-music-notation-demo | examples/break.hs | bsd-3-clause | tom12 = mel [qd 0, qd 0, qnr, qd 0, hd 0.5, qnr, qd 0] | 54 | tom12 = mel [qd 0, qd 0, qnr, qd 0, hd 0.5, qnr, qd 0] | 54 | tom12 = mel [qd 0, qd 0, qnr, qd 0, hd 0.5, qnr, qd 0] | 54 | false | false | 0 | 7 | 14 | 45 | 23 | 22 | null | null |
urbanslug/ghc | compiler/types/FamInstEnv.hs | bsd-3-clause | pprFamInstHdr :: FamInst -> SDoc
pprFamInstHdr fi@(FamInst {fi_flavor = flavor})
= pprTyConSort <+> pp_instance <+> pp_head
where
-- For *associated* types, say "type T Int = blah"
-- For *top level* type instances, say "type instance T Int = blah"
pp_instance
| isTyConAssoc fam_tc = empty
|... | 1,681 | pprFamInstHdr :: FamInst -> SDoc
pprFamInstHdr fi@(FamInst {fi_flavor = flavor})
= pprTyConSort <+> pp_instance <+> pp_head
where
-- For *associated* types, say "type T Int = blah"
-- For *top level* type instances, say "type instance T Int = blah"
pp_instance
| isTyConAssoc fam_tc = empty
|... | 1,681 | pprFamInstHdr fi@(FamInst {fi_flavor = flavor})
= pprTyConSort <+> pp_instance <+> pp_head
where
-- For *associated* types, say "type T Int = blah"
-- For *top level* type instances, say "type instance T Int = blah"
pp_instance
| isTyConAssoc fam_tc = empty
| otherwise = ptext (sLi... | 1,648 | false | true | 10 | 13 | 628 | 346 | 161 | 185 | null | null |
mietek/stack | src/Path/IO.hs | bsd-3-clause | removeFileIfExists :: MonadIO m => Path b File -> m ()
removeFileIfExists fp =
liftIO (catch
(removeFile
(toFilePath fp))
(\e ->
if isDoesNotExistError e
then return ()
else throwIO e)) | 316 | removeFileIfExists :: MonadIO m => Path b File -> m ()
removeFileIfExists fp =
liftIO (catch
(removeFile
(toFilePath fp))
(\e ->
if isDoesNotExistError e
then return ()
else throwIO e)) | 316 | removeFileIfExists fp =
liftIO (catch
(removeFile
(toFilePath fp))
(\e ->
if isDoesNotExistError e
then return ()
else throwIO e)) | 261 | false | true | 0 | 12 | 160 | 90 | 42 | 48 | null | null |
lwm/haskellnews | upstream/snap-app/src/Snap/App/RSS.hs | bsd-3-clause | -- | Make a simple RSS feed.
makeFeed :: String -> String -> [(UTCTime,Text,Text,Text)] -> Element
makeFeed title link = xmlFeed . RSSFeed . makeRSS where
makeRSS qs = (nullRSS title link)
{ rssChannel = makeChannel qs }
makeChannel qs = (nullChannel title link)
{ rssItems = map ma... | 631 | makeFeed :: String -> String -> [(UTCTime,Text,Text,Text)] -> Element
makeFeed title link = xmlFeed . RSSFeed . makeRSS where
makeRSS qs = (nullRSS title link)
{ rssChannel = makeChannel qs }
makeChannel qs = (nullChannel title link)
{ rssItems = map makeItem qs }
makeItem (time,... | 602 | makeFeed title link = xmlFeed . RSSFeed . makeRSS where
makeRSS qs = (nullRSS title link)
{ rssChannel = makeChannel qs }
makeChannel qs = (nullChannel title link)
{ rssItems = map makeItem qs }
makeItem (time,itemtitle,desc,itemlink) =
(nullItem (T.unpack itemtitle))
{ r... | 532 | true | true | 0 | 12 | 147 | 205 | 110 | 95 | null | null |
unsw-comp4181/accelerate-c-stub | Data/Array/Accelerate/C/Type.hs | bsd-3-clause | integralTypeToC (TypeWord8 _) = typename "HsWord8" | 52 | integralTypeToC (TypeWord8 _) = typename "HsWord8" | 52 | integralTypeToC (TypeWord8 _) = typename "HsWord8" | 52 | false | false | 0 | 6 | 7 | 19 | 8 | 11 | null | null |
rueshyna/gogol | gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/Edits/Listings/List.hs | mpl-2.0 | -- | Unique identifier for the Android app that is being updated; for
-- example, \"com.spiffygame\".
ellPackageName :: Lens' EditsListingsList Text
ellPackageName
= lens _ellPackageName
(\ s a -> s{_ellPackageName = a}) | 228 | ellPackageName :: Lens' EditsListingsList Text
ellPackageName
= lens _ellPackageName
(\ s a -> s{_ellPackageName = a}) | 126 | ellPackageName
= lens _ellPackageName
(\ s a -> s{_ellPackageName = a}) | 79 | true | true | 0 | 9 | 39 | 43 | 23 | 20 | null | null |
altschuler/kite | src/Kite/Syntax.hs | mit | free PCharType = [] | 22 | free PCharType = [] | 22 | free PCharType = [] | 22 | false | false | 0 | 5 | 6 | 11 | 5 | 6 | null | null |
gridaphobe/ghc | compiler/stranal/WwLib.hs | bsd-3-clause | mkWWcpr :: Bool
-> FamInstEnvs
-> Type -- function body type
-> DmdResult -- CPR analysis results
-> UniqSM (Bool, -- Is w/w'ing useful?
CoreExpr -> CoreExpr, -- New wrapper
... | 1,130 | mkWWcpr :: Bool
-> FamInstEnvs
-> Type -- function body type
-> DmdResult -- CPR analysis results
-> UniqSM (Bool, -- Is w/w'ing useful?
CoreExpr -> CoreExpr, -- New wrapper
... | 1,084 | mkWWcpr opt_CprAnal fam_envs body_ty res
-- CPR explicitly turned off (or in -O0)
| not opt_CprAnal = return (False, id, id, body_ty)
-- CPR is turned on by default for -O and O2
| otherwise
= case returnsCPR_maybe res of
Nothing -> return (False, id, id, body_ty) -- No CPR info
Just c... | 698 | true | true | 0 | 13 | 467 | 212 | 110 | 102 | null | null |
jystic/dipper | src/Dipper/Core.hs | bsd-3-clause | isAtomDependent :: Ord n => Set n -> Atom n a -> Bool
isAtomDependent ns atom = case atom of
Var (Name n) -> S.member n ns
Const _ -> False | 152 | isAtomDependent :: Ord n => Set n -> Atom n a -> Bool
isAtomDependent ns atom = case atom of
Var (Name n) -> S.member n ns
Const _ -> False | 152 | isAtomDependent ns atom = case atom of
Var (Name n) -> S.member n ns
Const _ -> False | 98 | false | true | 3 | 8 | 43 | 67 | 33 | 34 | null | null |
ml9951/ghc | compiler/coreSyn/CoreFVs.hs | bsd-3-clause | freeVars (Type ty) = (tyVarsOfType ty, AnnType ty) | 50 | freeVars (Type ty) = (tyVarsOfType ty, AnnType ty) | 50 | freeVars (Type ty) = (tyVarsOfType ty, AnnType ty) | 50 | false | false | 0 | 7 | 7 | 27 | 13 | 14 | null | null |
schell/odin | src/Odin/Scripts/ArrowControl.hs | mit | directionToV2 South = V2 0 1 | 28 | directionToV2 South = V2 0 1 | 28 | directionToV2 South = V2 0 1 | 28 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
vito/atomo | src/Atomo/Lexer/Primitive.hs | bsd-3-clause | -- | Integer literal.
--
-- Examples: @1@, @2@, @-1@, @-2@
lvInteger :: Lexer Value
lvInteger = liftM Integer integer | 117 | lvInteger :: Lexer Value
lvInteger = liftM Integer integer | 58 | lvInteger = liftM Integer integer | 33 | true | true | 0 | 5 | 19 | 22 | 12 | 10 | null | null |
bacchanalia/KitchenSink | KitchenSink/Qualified.hs | gpl-3.0 | -- |'ArrayUS.unsafeForeignPtrToStorableArray'
a_unsafeForeignPtrToStorableArray = ArrayUS.unsafeForeignPtrToStorableArray | 121 | a_unsafeForeignPtrToStorableArray = ArrayUS.unsafeForeignPtrToStorableArray | 75 | a_unsafeForeignPtrToStorableArray = ArrayUS.unsafeForeignPtrToStorableArray | 75 | true | false | 0 | 5 | 4 | 9 | 5 | 4 | null | null |
rueshyna/gogol | gogol-youtube-reporting/gen/Network/Google/Resource/YouTubeReporting/Jobs/Delete.hs | mpl-2.0 | -- | OAuth access token.
jdAccessToken :: Lens' JobsDelete (Maybe Text)
jdAccessToken
= lens _jdAccessToken
(\ s a -> s{_jdAccessToken = a}) | 148 | jdAccessToken :: Lens' JobsDelete (Maybe Text)
jdAccessToken
= lens _jdAccessToken
(\ s a -> s{_jdAccessToken = a}) | 123 | jdAccessToken
= lens _jdAccessToken
(\ s a -> s{_jdAccessToken = a}) | 76 | true | true | 1 | 9 | 29 | 52 | 25 | 27 | null | null |
sgillespie/ghc | compiler/types/InstEnv.hs | bsd-3-clause | deleteFromInstEnv :: InstEnv -> ClsInst -> InstEnv
deleteFromInstEnv inst_env ins_item@(ClsInst { is_cls_nm = cls_nm })
= adjustUDFM adjust inst_env cls_nm
where
adjust (ClsIE items) = ClsIE (filterOut (identicalClsInstHead ins_item) items) | 248 | deleteFromInstEnv :: InstEnv -> ClsInst -> InstEnv
deleteFromInstEnv inst_env ins_item@(ClsInst { is_cls_nm = cls_nm })
= adjustUDFM adjust inst_env cls_nm
where
adjust (ClsIE items) = ClsIE (filterOut (identicalClsInstHead ins_item) items) | 248 | deleteFromInstEnv inst_env ins_item@(ClsInst { is_cls_nm = cls_nm })
= adjustUDFM adjust inst_env cls_nm
where
adjust (ClsIE items) = ClsIE (filterOut (identicalClsInstHead ins_item) items) | 197 | false | true | 0 | 10 | 37 | 79 | 40 | 39 | null | null |
mzini/termlib | Termlib/Term.hs | gpl-3.0 | canonise :: Term -> Renaming -> (Term, Renaming)
canonise (Var x) varmap =
case Map.lookup x varmap of
Nothing -> (Var freshVar, Map.insert x freshVar varmap)
where freshVar = canonical $ 1 + Map.fold (\ (Canon i) n -> max i n) 0 varmap
Just oldelem -> (Var oldelem, varmap) | 301 | canonise :: Term -> Renaming -> (Term, Renaming)
canonise (Var x) varmap =
case Map.lookup x varmap of
Nothing -> (Var freshVar, Map.insert x freshVar varmap)
where freshVar = canonical $ 1 + Map.fold (\ (Canon i) n -> max i n) 0 varmap
Just oldelem -> (Var oldelem, varmap) | 301 | canonise (Var x) varmap =
case Map.lookup x varmap of
Nothing -> (Var freshVar, Map.insert x freshVar varmap)
where freshVar = canonical $ 1 + Map.fold (\ (Canon i) n -> max i n) 0 varmap
Just oldelem -> (Var oldelem, varmap) | 252 | false | true | 0 | 15 | 76 | 140 | 69 | 71 | null | null |
alexander-at-github/eta | compiler/ETA/Interactive/ByteCodeInstr.hs | bsd-3-clause | bciStackUse PUSH_APPLY_D{} = 1 | 37 | bciStackUse PUSH_APPLY_D{} = 1 | 37 | bciStackUse PUSH_APPLY_D{} = 1 | 37 | false | false | 0 | 5 | 10 | 14 | 6 | 8 | null | null |
Lykos/Sara | tests/Sara/TestUtils/AstGenUtils.hs | gpl-3.0 | arbitraryInnerExpression :: (MonadGen g, MonadReader GeneratorEnv g) => Type -> g IncompleteExpression
arbitraryInnerExpression t = do
binOps <- arbitraryBinaryOperations t
unOps <- arbitraryUnaryOperations t
let numUnOps = length unOps
let numBinOps = length binOps
let weightUnOps = if numBinOps == 0 then 1 ... | 1,119 | arbitraryInnerExpression :: (MonadGen g, MonadReader GeneratorEnv g) => Type -> g IncompleteExpression
arbitraryInnerExpression t = do
binOps <- arbitraryBinaryOperations t
unOps <- arbitraryUnaryOperations t
let numUnOps = length unOps
let numBinOps = length binOps
let weightUnOps = if numBinOps == 0 then 1 ... | 1,119 | arbitraryInnerExpression t = do
binOps <- arbitraryBinaryOperations t
unOps <- arbitraryUnaryOperations t
let numUnOps = length unOps
let numBinOps = length binOps
let weightUnOps = if numBinOps == 0 then 1 else numBinOps
let weightBinOps = if numUnOps == 0 then 1 else numUnOps
let weightOthers = case (nu... | 1,016 | false | true | 0 | 16 | 258 | 340 | 171 | 169 | null | null |
UCSD-PL/RefScript | src/Language/Rsc/Typecheck/Checker.hs | bsd-3-clause | tcCall γ (InfixExpr l o@OpInstanceof e1 e2) _
= do (e2',t) <- tcExpr γ e2 Nothing
case t of
TClass (BGen (QN _ x) _) ->
do opTy <- safeEnvFindTy l γ (infixOpId o :: Identifier)
([e1',_], t') <- let args = [e1, StringLit l2 (F.symbolSafeString x)] in
... | 579 | tcCall γ (InfixExpr l o@OpInstanceof e1 e2) _
= do (e2',t) <- tcExpr γ e2 Nothing
case t of
TClass (BGen (QN _ x) _) ->
do opTy <- safeEnvFindTy l γ (infixOpId o :: Identifier)
([e1',_], t') <- let args = [e1, StringLit l2 (F.symbolSafeString x)] in
... | 579 | tcCall γ (InfixExpr l o@OpInstanceof e1 e2) _
= do (e2',t) <- tcExpr γ e2 Nothing
case t of
TClass (BGen (QN _ x) _) ->
do opTy <- safeEnvFindTy l γ (infixOpId o :: Identifier)
([e1',_], t') <- let args = [e1, StringLit l2 (F.symbolSafeString x)] in
... | 579 | false | false | 2 | 21 | 215 | 235 | 111 | 124 | null | null |
ganeti-github-testing/ganeti-test-1 | test/hs/Test/Ganeti/THH.hs | bsd-2-clause | -- | Test serialization of UnitObj.
prop_UnitObj_serialization :: UnitObj -> Property
prop_UnitObj_serialization = testArraySerialisation | 137 | prop_UnitObj_serialization :: UnitObj -> Property
prop_UnitObj_serialization = testArraySerialisation | 101 | prop_UnitObj_serialization = testArraySerialisation | 51 | true | true | 0 | 5 | 13 | 16 | 9 | 7 | null | null |
NorfairKing/the-notes | src/Logic/PropositionalLogic/Sentence.hs | gpl-2.0 | mapSub :: (Sentence -> Sentence) -> Sentence -> Sentence
mapSub f = f . mapSubs (mapSub f) | 90 | mapSub :: (Sentence -> Sentence) -> Sentence -> Sentence
mapSub f = f . mapSubs (mapSub f) | 90 | mapSub f = f . mapSubs (mapSub f) | 33 | false | true | 0 | 8 | 16 | 42 | 21 | 21 | null | null |
changlinli/nikki | src/Game/Scene.hs | lgpl-3.0 | -- | RenderScene (for the rendering thread)
-- Gets created in the logic thread
mkRenderState :: IORef CameraState -> Scene Object_ -> M RenderStateRefs
mkRenderState cameraStateRef scene = do
controls_ <- (^. controls) <$> getConfiguration
let noop :: DebuggingCommand = const $ const $ return ()
newScene <... | 498 | mkRenderState :: IORef CameraState -> Scene Object_ -> M RenderStateRefs
mkRenderState cameraStateRef scene = do
controls_ <- (^. controls) <$> getConfiguration
let noop :: DebuggingCommand = const $ const $ return ()
newScene <- io $ sceneImmutableCopy scene
sceneMVar <- io $ newMVar (newScene, noop)
... | 418 | mkRenderState cameraStateRef scene = do
controls_ <- (^. controls) <$> getConfiguration
let noop :: DebuggingCommand = const $ const $ return ()
newScene <- io $ sceneImmutableCopy scene
sceneMVar <- io $ newMVar (newScene, noop)
fpsRef <- initialFPSRef
return $ RenderStateRefs controls_ sceneM... | 345 | true | true | 0 | 12 | 93 | 134 | 63 | 71 | null | null |
mzero/PlainChanges2 | src/PartII.hs | bsd-3-clause | percB3 :: Music Pitch
percB3 = onDrums $ vol MP $ chord [riff 4 5, riff 10 4]
where
riff d n = delayM ((8+d)*r4phraseDur + dhn) $ timesM n ride
ride = ringPerc sn [AcousticSnare, RideCymbal2, RideCymbal2] | 214 | percB3 :: Music Pitch
percB3 = onDrums $ vol MP $ chord [riff 4 5, riff 10 4]
where
riff d n = delayM ((8+d)*r4phraseDur + dhn) $ timesM n ride
ride = ringPerc sn [AcousticSnare, RideCymbal2, RideCymbal2] | 214 | percB3 = onDrums $ vol MP $ chord [riff 4 5, riff 10 4]
where
riff d n = delayM ((8+d)*r4phraseDur + dhn) $ timesM n ride
ride = ringPerc sn [AcousticSnare, RideCymbal2, RideCymbal2] | 192 | false | true | 0 | 11 | 47 | 106 | 53 | 53 | null | null |
higgsd/euler | hs/99.hs | bsd-2-clause | main = do
ns <- readFile "../files/p099_base_exp.txt"
putStrLn $ show $ findLargest $ lines ns | 102 | main = do
ns <- readFile "../files/p099_base_exp.txt"
putStrLn $ show $ findLargest $ lines ns | 102 | main = do
ns <- readFile "../files/p099_base_exp.txt"
putStrLn $ show $ findLargest $ lines ns | 102 | false | false | 1 | 10 | 22 | 38 | 15 | 23 | null | null |
reedrosenbluth/othello | src/Game.hs | bsd-3-clause | line (x, y) E = [(x + h, y) | h <- [1..8], x+h <= 8] | 57 | line (x, y) E = [(x + h, y) | h <- [1..8], x+h <= 8] | 57 | line (x, y) E = [(x + h, y) | h <- [1..8], x+h <= 8] | 57 | false | false | 0 | 8 | 20 | 55 | 30 | 25 | null | null |
gizmo-mk0/kartofwar-server | src/Lobby.hs | unlicense | mkLobby :: LobbyData
mkLobby = LobbyData M.empty | 48 | mkLobby :: LobbyData
mkLobby = LobbyData M.empty | 48 | mkLobby = LobbyData M.empty | 27 | false | true | 0 | 6 | 6 | 22 | 9 | 13 | null | null |
julienschmaltz/madl | src/Parser/MadlParser.hs | mit | -- | Parse a 'ForLoopHeader'
parseForLoopHeader :: Parser ForLoopHeader
parseForLoopHeader = (do
reserved "int"
name <- identifier
reservedOp "="
low <- parseIntegerExpression
semi
_ <- identifier
reservedOp "<"
high <- parseIntegerExpression
semi
_ <- identifier
reservedOp "... | 392 | parseForLoopHeader :: Parser ForLoopHeader
parseForLoopHeader = (do
reserved "int"
name <- identifier
reservedOp "="
low <- parseIntegerExpression
semi
_ <- identifier
reservedOp "<"
high <- parseIntegerExpression
semi
_ <- identifier
reservedOp "++"
return $ ForLoopHeade... | 363 | parseForLoopHeader = (do
reserved "int"
name <- identifier
reservedOp "="
low <- parseIntegerExpression
semi
_ <- identifier
reservedOp "<"
high <- parseIntegerExpression
semi
_ <- identifier
reservedOp "++"
return $ ForLoopHeader name low high
) <?> "For loop header" | 320 | true | true | 2 | 9 | 99 | 103 | 43 | 60 | null | null |
ganeti/htools | Ganeti/HTools/Text.hs | gpl-2.0 | -- | Load a node from a field list.
loadNode :: (Monad m) => NameAssoc -> [String] -> m (String, Node.Node)
loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu] = do
gdx <- lookupGroup ktg name gu
new_node <-
if any (== "?") [tm,nm,fm,td,fd,tc] || fo == "Y" then
return $ Node.create name 0 0 0 0 0 0 ... | 622 | loadNode :: (Monad m) => NameAssoc -> [String] -> m (String, Node.Node)
loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu] = do
gdx <- lookupGroup ktg name gu
new_node <-
if any (== "?") [tm,nm,fm,td,fd,tc] || fo == "Y" then
return $ Node.create name 0 0 0 0 0 0 True gdx
else do
vtm <... | 586 | loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu] = do
gdx <- lookupGroup ktg name gu
new_node <-
if any (== "?") [tm,nm,fm,td,fd,tc] || fo == "Y" then
return $ Node.create name 0 0 0 0 0 0 True gdx
else do
vtm <- tryRead name tm
vnm <- tryRead name nm
vfm <- tryRead ... | 514 | true | true | 0 | 13 | 194 | 281 | 141 | 140 | null | null |
plow-technologies/ircbrowse | src/Ircbrowse/Model/Events.hs | bsd-3-clause | getPaginatedEvents :: FromRow r
=> Channel -> Pagination -> Model c s (Pagination,[r])
getPaginatedEvents channel pagination = do
count <- single ["SELECT count FROM event_count where channel = ?"] (Only (showChanInt channel))
events <- query ["SELECT idx.id,e.timestamp,e.network,e.channel,e.type... | 865 | getPaginatedEvents :: FromRow r
=> Channel -> Pagination -> Model c s (Pagination,[r])
getPaginatedEvents channel pagination = do
count <- single ["SELECT count FROM event_count where channel = ?"] (Only (showChanInt channel))
events <- query ["SELECT idx.id,e.timestamp,e.network,e.channel,e.type... | 865 | getPaginatedEvents channel pagination = do
count <- single ["SELECT count FROM event_count where channel = ?"] (Only (showChanInt channel))
events <- query ["SELECT idx.id,e.timestamp,e.network,e.channel,e.type,e.nick,e.text FROM event e,"
,"event_order_index idx"
,"WHERE e.id = ... | 759 | false | true | 1 | 12 | 287 | 191 | 98 | 93 | null | null |
noughtmare/yi | yi-core/src/Yi/Buffer/Implementation.hs | gpl-2.0 | deleteMarkValueBI :: Mark -> BufferImpl syntax -> BufferImpl syntax
deleteMarkValueBI m fb = fb { marks = M.delete m (marks fb) } | 129 | deleteMarkValueBI :: Mark -> BufferImpl syntax -> BufferImpl syntax
deleteMarkValueBI m fb = fb { marks = M.delete m (marks fb) } | 129 | deleteMarkValueBI m fb = fb { marks = M.delete m (marks fb) } | 61 | false | true | 0 | 10 | 21 | 56 | 26 | 30 | null | null |
gridaphobe/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprCtO PatOrigin = text "a pattern" | 47 | pprCtO PatOrigin = text "a pattern" | 47 | pprCtO PatOrigin = text "a pattern" | 47 | false | false | 0 | 5 | 17 | 13 | 5 | 8 | null | null |
quchen/stg | test/Testsuite/Test/Marshal.hs | bsd-3-clause | crazyRoundtrip :: TestTree
crazyRoundtrip = roundTripTest defSpec
{ testName = "Crazy giant type"
, testType = Proxy :: Proxy [Either ([[[Integer]]], [Maybe ()]) (Maybe [([Bool], Integer, [Bool])])]
, maxSteps = 10e5 } | 230 | crazyRoundtrip :: TestTree
crazyRoundtrip = roundTripTest defSpec
{ testName = "Crazy giant type"
, testType = Proxy :: Proxy [Either ([[[Integer]]], [Maybe ()]) (Maybe [([Bool], Integer, [Bool])])]
, maxSteps = 10e5 } | 230 | crazyRoundtrip = roundTripTest defSpec
{ testName = "Crazy giant type"
, testType = Proxy :: Proxy [Either ([[[Integer]]], [Maybe ()]) (Maybe [([Bool], Integer, [Bool])])]
, maxSteps = 10e5 } | 203 | false | true | 0 | 15 | 43 | 105 | 58 | 47 | null | null |
maurer/15-411-Haskell-Base-Code | src/Text/Parsec/Char.hs | bsd-3-clause | -- | The parser @satisfy f@ succeeds for any character for which the
-- supplied function @f@ returns 'True'. Returns the character that is
-- actually parsed.
-- > digit = satisfy isDigit
-- > oneOf cs = satisfy (\c -> c `elem` cs)
satisfy :: (Stream s m Char) => (Char -> Bool) -> ParsecT s u m Char
satisfy f... | 499 | satisfy :: (Stream s m Char) => (Char -> Bool) -> ParsecT s u m Char
satisfy f = tokenPrim (\c -> show [c])
(\pos c _cs -> updatePosChar pos c)
(\c -> if f c then Just c else Nothing) | 257 | satisfy f = tokenPrim (\c -> show [c])
(\pos c _cs -> updatePosChar pos c)
(\c -> if f c then Just c else Nothing) | 188 | true | true | 0 | 9 | 167 | 119 | 62 | 57 | null | null |
ghc-android/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | collectLocalBinders EmptyLocalBinds = [] | 43 | collectLocalBinders EmptyLocalBinds = [] | 43 | collectLocalBinders EmptyLocalBinds = [] | 43 | false | false | 0 | 5 | 6 | 12 | 5 | 7 | null | null |
chpatrick/hmidi | System/MIDI.hs | bsd-3-clause | - | Creates a new MIDI destination (which is a source for /us/), to which other programs can connect to.
-- There are two possibilites to receive MIDI messages. The user can either supply a callback function,
-- or get the messages from an asynchronous buffer. However, mixing the two approaches is not allowed.
createDe... | 421 | createDestination :: String -> Maybe ClientCallback -> IO Connection
createDestination = S.createDestination | 108 | createDestination = S.createDestination | 39 | true | true | 1 | 11 | 66 | 76 | 40 | 36 | null | null |
xcthulhu/lambda-geda | Geda/ShowGSchem.hs | gpl-3.0 | {- Calculates the number of lines represented by a string -}
numLines :: String -> Int
numLines s = 1 + (length $ filter (=='\n') s) | 132 | numLines :: String -> Int
numLines s = 1 + (length $ filter (=='\n') s) | 71 | numLines s = 1 + (length $ filter (=='\n') s) | 45 | true | true | 0 | 9 | 25 | 39 | 21 | 18 | null | null |
johnjcamilleri/fst | FST/TransducerInterface.hs | bsd-3-clause | -- | Make a transducer minimal
minimize :: Ord a => Transducer a -> Transducer a
minimize = D.determinize . reversal . D.determinize . reversal | 143 | minimize :: Ord a => Transducer a -> Transducer a
minimize = D.determinize . reversal . D.determinize . reversal | 112 | minimize = D.determinize . reversal . D.determinize . reversal | 62 | true | true | 1 | 8 | 24 | 52 | 23 | 29 | null | null |
dysinger/amazonka | amazonka-dynamodb/gen/Network/AWS/DynamoDB/BatchGetItem.hs | mpl-2.0 | -- | 'BatchGetItem' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'bgiRequestItems' @::@ 'HashMap' 'Text' 'KeysAndAttributes'
--
-- * 'bgiReturnConsumedCapacity' @::@ 'Maybe' 'ReturnConsumedCapacity'
--
batchGetItem :: BatchGetItem
batchGetItem = BatchGetItem
{ _bgiRequestItems ... | 387 | batchGetItem :: BatchGetItem
batchGetItem = BatchGetItem
{ _bgiRequestItems = mempty
, _bgiReturnConsumedCapacity = Nothing
} | 147 | batchGetItem = BatchGetItem
{ _bgiRequestItems = mempty
, _bgiReturnConsumedCapacity = Nothing
} | 118 | true | true | 0 | 6 | 65 | 33 | 23 | 10 | null | null |
kristoff3r/importify | HLint.hs | mit | warn "liftIO is not needed" = liftIO (Universum.writeFile x y) ==> Universum.writeFile x y
where
note = "If you import 'writeFile' from Universum, it's already lifted" | 173 | warn "liftIO is not needed" = liftIO (Universum.writeFile x y) ==> Universum.writeFile x y
where
note = "If you import 'writeFile' from Universum, it's already lifted" | 173 | warn "liftIO is not needed" = liftIO (Universum.writeFile x y) ==> Universum.writeFile x y
where
note = "If you import 'writeFile' from Universum, it's already lifted" | 173 | false | false | 0 | 9 | 31 | 41 | 19 | 22 | null | null |
orion-42/my-lisp | LispData.hs | mit | formatLispVal (List [Symbol "quasiquote", arg]) = "`" ++ formatLispVal arg | 74 | formatLispVal (List [Symbol "quasiquote", arg]) = "`" ++ formatLispVal arg | 74 | formatLispVal (List [Symbol "quasiquote", arg]) = "`" ++ formatLispVal arg | 74 | false | false | 0 | 8 | 9 | 32 | 15 | 17 | null | null |
dzeban/haskell-exercises | hw3/Golf.hs | mit | findLocalMaxima [] = [] | 23 | findLocalMaxima [] = [] | 23 | findLocalMaxima [] = [] | 23 | false | false | 1 | 6 | 3 | 17 | 6 | 11 | null | null |
TC1211/TCP | src/3a/tester-src/Examples/reliable/NetSim.hs | apache-2.0 | badlength :: Float -> NetSim a
badlength prob = mkInum $ do
pkt <- headI
doit <- rndBoolI prob
return [if doit then corrupt pkt else pkt]
where
corrupt pkt | L.null pkt = pkt
| otherwise = L.cons (L.head pkt .|. 0x80)
(L.drop 1 pkt) | 300 | badlength :: Float -> NetSim a
badlength prob = mkInum $ do
pkt <- headI
doit <- rndBoolI prob
return [if doit then corrupt pkt else pkt]
where
corrupt pkt | L.null pkt = pkt
| otherwise = L.cons (L.head pkt .|. 0x80)
(L.drop 1 pkt) | 300 | badlength prob = mkInum $ do
pkt <- headI
doit <- rndBoolI prob
return [if doit then corrupt pkt else pkt]
where
corrupt pkt | L.null pkt = pkt
| otherwise = L.cons (L.head pkt .|. 0x80)
(L.drop 1 pkt) | 269 | false | true | 0 | 11 | 113 | 125 | 57 | 68 | null | null |
RayRacine/aws | Aws/ElasticTranscoder/Json/Test.hs | bsd-3-clause | cnv_result :: QC.Result -> TS.Result
cnv_result qcr =
case qcr of
QC.Success _ _ _ -> TS.Pass
_ -> TS.Fail "Failed"
-- AETest adds a phantom index to SimpleTest as a convenience
-- to simplify usage of mk_aet, the generator for the
-- aeson-round-trip tests. | 302 | cnv_result :: QC.Result -> TS.Result
cnv_result qcr =
case qcr of
QC.Success _ _ _ -> TS.Pass
_ -> TS.Fail "Failed"
-- AETest adds a phantom index to SimpleTest as a convenience
-- to simplify usage of mk_aet, the generator for the
-- aeson-round-trip tests. | 302 | cnv_result qcr =
case qcr of
QC.Success _ _ _ -> TS.Pass
_ -> TS.Fail "Failed"
-- AETest adds a phantom index to SimpleTest as a convenience
-- to simplify usage of mk_aet, the generator for the
-- aeson-round-trip tests. | 265 | false | true | 0 | 9 | 88 | 57 | 29 | 28 | null | null |
ezyang/ghc | compiler/simplCore/OccurAnal.hs | bsd-3-clause | mk_non_loop_breaker :: VarSet -> LetrecNode -> Binding
-- See Note [Weak loop breakers]
mk_non_loop_breaker weak_fvs (node_payload -> ND { nd_bndr = bndr
, nd_rhs = rhs})
| bndr `elemVarSet` weak_fvs = (setIdOccInfo bndr occ', rhs)
| otherwise = (bnd... | 469 | mk_non_loop_breaker :: VarSet -> LetrecNode -> Binding
mk_non_loop_breaker weak_fvs (node_payload -> ND { nd_bndr = bndr
, nd_rhs = rhs})
| bndr `elemVarSet` weak_fvs = (setIdOccInfo bndr occ', rhs)
| otherwise = (bndr, rhs)
where
occ' = weakLo... | 436 | mk_non_loop_breaker weak_fvs (node_payload -> ND { nd_bndr = bndr
, nd_rhs = rhs})
| bndr `elemVarSet` weak_fvs = (setIdOccInfo bndr occ', rhs)
| otherwise = (bndr, rhs)
where
occ' = weakLoopBreaker { occ_tail = tail_info }
tail_info = tail... | 381 | true | true | 1 | 10 | 135 | 114 | 63 | 51 | null | null |
hydrogen-tools/hydrogen-multimap | src/Hydrogen/MultiMap.hs | mit | keys :: MultiMap k v -> [k]
keys (MultiMap m _) = Map.keys m | 60 | keys :: MultiMap k v -> [k]
keys (MultiMap m _) = Map.keys m | 60 | keys (MultiMap m _) = Map.keys m | 32 | false | true | 0 | 9 | 13 | 44 | 20 | 24 | null | null |
othercriteria/website | generator/Main.hs | mit | ------------------------------------------------------------------------------
-- Contexts
------------------------------------------------------------------------------
baseCtx :: Context String
baseCtx =
constField "mathjax" "" <>
defaultContext | 256 | baseCtx :: Context String
baseCtx =
constField "mathjax" "" <>
defaultContext | 85 | baseCtx =
constField "mathjax" "" <>
defaultContext | 59 | true | true | 0 | 6 | 23 | 26 | 14 | 12 | null | null |
minoki/jstrans | JSTrans/Parser/Prim.hs | mit | disallowIn :: Parser a -> Parser a
disallowIn p = do{ state <- getState
; setState (state {psAllowIn = False})
; x <- p
; updateState (\s -> s {psAllowIn = psAllowIn state})
; return x
} | 271 | disallowIn :: Parser a -> Parser a
disallowIn p = do{ state <- getState
; setState (state {psAllowIn = False})
; x <- p
; updateState (\s -> s {psAllowIn = psAllowIn state})
; return x
} | 271 | disallowIn p = do{ state <- getState
; setState (state {psAllowIn = False})
; x <- p
; updateState (\s -> s {psAllowIn = psAllowIn state})
; return x
} | 236 | false | true | 0 | 12 | 121 | 92 | 47 | 45 | null | null |
Muzietto/transformerz | haskell/nilsson/TestNilsson_03.hs | mit | testEval5dVarUndefined :: Test
testEval5dVarUndefined =
TestCase $ assertEqual "eval5d should fail on non-existing vars and write about it while updating state and filling the log"
((Nothing, ["lookup zzzz","lookup ko"]), 1)
(runEval5d two_vars_env 0 (eval5d (Var "zzzz"))) | 298 | testEval5dVarUndefined :: Test
testEval5dVarUndefined =
TestCase $ assertEqual "eval5d should fail on non-existing vars and write about it while updating state and filling the log"
((Nothing, ["lookup zzzz","lookup ko"]), 1)
(runEval5d two_vars_env 0 (eval5d (Var "zzzz"))) | 296 | testEval5dVarUndefined =
TestCase $ assertEqual "eval5d should fail on non-existing vars and write about it while updating state and filling the log"
((Nothing, ["lookup zzzz","lookup ko"]), 1)
(runEval5d two_vars_env 0 (eval5d (Var "zzzz"))) | 265 | false | true | 0 | 12 | 60 | 62 | 34 | 28 | null | null |
adunning/pandoc-citeproc | src/Text/CSL/Pandoc.hs | bsd-3-clause | pLocatorLabelDelimited :: LocatorMap -> Parsec [Inline] st (String, Bool)
pLocatorLabelDelimited locMap
= pLocatorLabel' locMap lim <|> return ("page", True)
where
lim = stringify <$> anyToken | 206 | pLocatorLabelDelimited :: LocatorMap -> Parsec [Inline] st (String, Bool)
pLocatorLabelDelimited locMap
= pLocatorLabel' locMap lim <|> return ("page", True)
where
lim = stringify <$> anyToken | 206 | pLocatorLabelDelimited locMap
= pLocatorLabel' locMap lim <|> return ("page", True)
where
lim = stringify <$> anyToken | 132 | false | true | 0 | 7 | 38 | 63 | 33 | 30 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/Parsing.hs | gpl-2.0 | removeOneLeadingSpace :: [String] -> [String]
removeOneLeadingSpace xs =
if all startsWithSpace xs
then map (drop 1) xs
else xs
where startsWithSpace "" = True
startsWithSpace (y:_) = y == ' ' | 220 | removeOneLeadingSpace :: [String] -> [String]
removeOneLeadingSpace xs =
if all startsWithSpace xs
then map (drop 1) xs
else xs
where startsWithSpace "" = True
startsWithSpace (y:_) = y == ' ' | 220 | removeOneLeadingSpace xs =
if all startsWithSpace xs
then map (drop 1) xs
else xs
where startsWithSpace "" = True
startsWithSpace (y:_) = y == ' ' | 174 | false | true | 0 | 9 | 58 | 77 | 40 | 37 | null | null |
rrnewton/hgdata_trash | src/Main.hs | mit | dispatch (GSPut accessToken projectId bucket key input acl recipients) =
do
let putter = if null recipients then putObject else putEncryptedObject recipients
bytes <- LBS.readFile input
putter projectId (read acl) bucket key Nothing bytes Nothing (toAccessToken accessToken)
return () | 302 | dispatch (GSPut accessToken projectId bucket key input acl recipients) =
do
let putter = if null recipients then putObject else putEncryptedObject recipients
bytes <- LBS.readFile input
putter projectId (read acl) bucket key Nothing bytes Nothing (toAccessToken accessToken)
return () | 302 | dispatch (GSPut accessToken projectId bucket key input acl recipients) =
do
let putter = if null recipients then putObject else putEncryptedObject recipients
bytes <- LBS.readFile input
putter projectId (read acl) bucket key Nothing bytes Nothing (toAccessToken accessToken)
return () | 302 | false | false | 0 | 11 | 56 | 102 | 47 | 55 | null | null |
jaalonso/I1M-Cod-Temas | src/Tema_30.hs | gpl-2.0 | -- Definición con programación dinámica
-- ====================================
levenshtein2 :: String -> String -> Int
levenshtein2 xs ys = (matrizLevenshtein xs ys) ! (m,n)
where m = length xs
n = length ys
-- (matrizLevenshtein xs ys) es la matriz cuyo número de filas es la
-- longitud de xs, cuyo núme... | 766 | levenshtein2 :: String -> String -> Int
levenshtein2 xs ys = (matrizLevenshtein xs ys) ! (m,n)
where m = length xs
n = length ys
-- (matrizLevenshtein xs ys) es la matriz cuyo número de filas es la
-- longitud de xs, cuyo número de columnas es la longitud de ys y en
-- valor en la posición (i,j) es la dist... | 685 | levenshtein2 xs ys = (matrizLevenshtein xs ys) ! (m,n)
where m = length xs
n = length ys
-- (matrizLevenshtein xs ys) es la matriz cuyo número de filas es la
-- longitud de xs, cuyo número de columnas es la longitud de ys y en
-- valor en la posición (i,j) es la distancia de Levenshtein entre los
-- primer... | 645 | true | true | 1 | 7 | 156 | 77 | 47 | 30 | null | null |
brendanhay/gogol | gogol-monitoring/gen/Network/Google/Resource/Monitoring/Folders/TimeSeries/List.hs | mpl-2.0 | -- | Unsupported: must be left blank. The points in each time series are
-- currently returned in reverse time order (most recent to oldest).
ftslOrderBy :: Lens' FoldersTimeSeriesList (Maybe Text)
ftslOrderBy
= lens _ftslOrderBy (\ s a -> s{_ftslOrderBy = a}) | 262 | ftslOrderBy :: Lens' FoldersTimeSeriesList (Maybe Text)
ftslOrderBy
= lens _ftslOrderBy (\ s a -> s{_ftslOrderBy = a}) | 120 | ftslOrderBy
= lens _ftslOrderBy (\ s a -> s{_ftslOrderBy = a}) | 64 | true | true | 0 | 9 | 43 | 49 | 26 | 23 | null | null |
Dronte/Operads | examples/example.hs | bsd-3-clause | b = corolla 2 [1,2] | 19 | b = corolla 2 [1,2] | 19 | b = corolla 2 [1,2] | 19 | false | false | 1 | 6 | 4 | 20 | 9 | 11 | null | null |
coolhacks/scripts-hacks | examples/shellcheck-master/ShellCheck/Analytics.hs | mit | prop_checkMkdirDashPM14 = verifyNot checkMkdirDashPM "mkdir -p -m 0755 singlelevel" | 83 | prop_checkMkdirDashPM14 = verifyNot checkMkdirDashPM "mkdir -p -m 0755 singlelevel" | 83 | prop_checkMkdirDashPM14 = verifyNot checkMkdirDashPM "mkdir -p -m 0755 singlelevel" | 83 | false | false | 0 | 5 | 8 | 11 | 5 | 6 | null | null |
dysinger/amazonka | amazonka-codedeploy/gen/Network/AWS/CodeDeploy/ListDeploymentInstances.hs | mpl-2.0 | -- | The unique ID of a deployment.
ldiDeploymentId :: Lens' ListDeploymentInstances Text
ldiDeploymentId = lens _ldiDeploymentId (\s a -> s { _ldiDeploymentId = a }) | 166 | ldiDeploymentId :: Lens' ListDeploymentInstances Text
ldiDeploymentId = lens _ldiDeploymentId (\s a -> s { _ldiDeploymentId = a }) | 130 | ldiDeploymentId = lens _ldiDeploymentId (\s a -> s { _ldiDeploymentId = a }) | 76 | true | true | 0 | 9 | 25 | 40 | 22 | 18 | null | null |
diegomachadosoares/hcomp | Main.hs | gpl-3.0 | env1 :: Map.Map String Bnd
env1 = Map.insert "constA" (BndVal $ ValueI 1) Map.empty | 83 | env1 :: Map.Map String Bnd
env1 = Map.insert "constA" (BndVal $ ValueI 1) Map.empty | 83 | env1 = Map.insert "constA" (BndVal $ ValueI 1) Map.empty | 56 | false | true | 1 | 8 | 13 | 42 | 19 | 23 | null | null |
rightfold/snek | src/SNEK/Read.hs | bsd-3-clause | -- | Turn a string into a sequence of data.
readData :: String -> Maybe Data
readData = Just . parse . alexScanTokens | 117 | readData :: String -> Maybe Data
readData = Just . parse . alexScanTokens | 73 | readData = Just . parse . alexScanTokens | 40 | true | true | 0 | 6 | 22 | 27 | 14 | 13 | null | null |
SimonRichards/HaskellOfLife | georgie.hs | apache-2.0 | zip' (x:xs) (y:ys) = (x,y):zip' xs ys | 37 | zip' (x:xs) (y:ys) = (x,y):zip' xs ys | 37 | zip' (x:xs) (y:ys) = (x,y):zip' xs ys | 37 | false | false | 0 | 7 | 6 | 40 | 21 | 19 | null | null |
phylake/avm3 | llvm/passes/abct.hs | mit | abcT1 {- 0xC1 -} i u d s m (br, Abc.DecrementInt) = (br, [DecrementInt]) | 72 | abcT1 {- 0xC1 -} i u d s m (br, Abc.DecrementInt) = (br, [DecrementInt]) | 72 | abcT1 {- 0xC1 -} i u d s m (br, Abc.DecrementInt) = (br, [DecrementInt]) | 72 | false | false | 0 | 7 | 13 | 38 | 21 | 17 | null | null |
christiaanb/ghc | compiler/cmm/PprC.hs | bsd-3-clause | pprLit1 lit@(CmmLabelDiffOff _ _ _) = parens (pprLit lit) | 57 | pprLit1 lit@(CmmLabelDiffOff _ _ _) = parens (pprLit lit) | 57 | pprLit1 lit@(CmmLabelDiffOff _ _ _) = parens (pprLit lit) | 57 | false | false | 1 | 8 | 8 | 35 | 15 | 20 | null | null |
OCExercise/haskellbook-solutions | chapters/chapter07/scratch/penguins.hs | bsd-2-clause | isSouthAfrica Antarctica = False | 32 | isSouthAfrica Antarctica = False | 32 | isSouthAfrica Antarctica = False | 32 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
kim/amazonka | amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/UpdateEnvironment.hs | mpl-2.0 | -- | This specifies the tier to use to update the environment.
--
-- Condition: You can only update the tier version for an environment. If you
-- change the name of the type, AWS Elastic Beanstalk returns 'InvalidParameterValue' error.
ueTier :: Lens' UpdateEnvironment (Maybe EnvironmentTier)
ueTier = lens _ueTier (\s... | 344 | ueTier :: Lens' UpdateEnvironment (Maybe EnvironmentTier)
ueTier = lens _ueTier (\s a -> s { _ueTier = a }) | 107 | ueTier = lens _ueTier (\s a -> s { _ueTier = a }) | 49 | true | true | 1 | 9 | 58 | 52 | 28 | 24 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.