Search is not available for this dataset
repo_name string | path string | license string | full_code string | full_size int64 | uncommented_code string | uncommented_size int64 | function_only_code string | function_only_size int64 | is_commented bool | is_signatured bool | n_ast_errors int64 | ast_max_depth int64 | n_whitespaces int64 | n_ast_nodes int64 | n_ast_terminals int64 | n_ast_nonterminals int64 | loc int64 | cycloplexity int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
TomMD/cryptol | src/Cryptol/Parser/NoInclude.hs | bsd-3-clause | noIncludeModule :: Module -> NoIncM Module
noIncludeModule m = update `fmap` collectErrors noIncTopDecl (mDecls m)
where
update tds = m { mDecls = concat tds }
-- | Remove includes from a program. | 201 | noIncludeModule :: Module -> NoIncM Module
noIncludeModule m = update `fmap` collectErrors noIncTopDecl (mDecls m)
where
update tds = m { mDecls = concat tds }
-- | Remove includes from a program. | 201 | noIncludeModule m = update `fmap` collectErrors noIncTopDecl (mDecls m)
where
update tds = m { mDecls = concat tds }
-- | Remove includes from a program. | 158 | false | true | 1 | 8 | 37 | 72 | 33 | 39 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | ppr_expr (HsMultiIf _ alts)
= sep $ ptext (sLit "if") : map ppr_alt alts
where ppr_alt (L _ (GRHS guards expr)) =
sep [ char '|' <+> interpp'SP guards
, ptext (sLit "->") <+> pprDeeper (ppr expr) ]
-- special case: let ... in let ... | 262 | ppr_expr (HsMultiIf _ alts)
= sep $ ptext (sLit "if") : map ppr_alt alts
where ppr_alt (L _ (GRHS guards expr)) =
sep [ char '|' <+> interpp'SP guards
, ptext (sLit "->") <+> pprDeeper (ppr expr) ]
-- special case: let ... in let ... | 262 | ppr_expr (HsMultiIf _ alts)
= sep $ ptext (sLit "if") : map ppr_alt alts
where ppr_alt (L _ (GRHS guards expr)) =
sep [ char '|' <+> interpp'SP guards
, ptext (sLit "->") <+> pprDeeper (ppr expr) ]
-- special case: let ... in let ... | 262 | false | false | 2 | 10 | 74 | 112 | 51 | 61 | null | null |
brendanhay/gogol | gogol-indexing/gen/Network/Google/Indexing/Types/Product.hs | mpl-2.0 | -- | The URL life cycle event that Google is being notified about.
unType :: Lens' URLNotification (Maybe URLNotificationType)
unType = lens _unType (\ s a -> s{_unType = a}) | 174 | unType :: Lens' URLNotification (Maybe URLNotificationType)
unType = lens _unType (\ s a -> s{_unType = a}) | 107 | unType = lens _unType (\ s a -> s{_unType = a}) | 47 | true | true | 0 | 9 | 29 | 46 | 25 | 21 | null | null |
brendanhay/gogol | gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer/Types/Product.hs | mpl-2.0 | ppfapName :: Lens' PublisherProFileAPIProto (Maybe Text)
ppfapName
= lens _ppfapName (\ s a -> s{_ppfapName = a}) | 115 | ppfapName :: Lens' PublisherProFileAPIProto (Maybe Text)
ppfapName
= lens _ppfapName (\ s a -> s{_ppfapName = a}) | 115 | ppfapName
= lens _ppfapName (\ s a -> s{_ppfapName = a}) | 58 | false | true | 1 | 9 | 18 | 51 | 24 | 27 | null | null |
holzensp/ghc | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprData (CmmUninitialised bytes)
= sdocWithPlatform $ \platform ->
if platformOS platform == OSDarwin then ptext (sLit ".space ") <> int bytes
else ptext (sLit ".skip ") <> int bytes | 225 | pprData (CmmUninitialised bytes)
= sdocWithPlatform $ \platform ->
if platformOS platform == OSDarwin then ptext (sLit ".space ") <> int bytes
else ptext (sLit ".skip ") <> int bytes | 225 | pprData (CmmUninitialised bytes)
= sdocWithPlatform $ \platform ->
if platformOS platform == OSDarwin then ptext (sLit ".space ") <> int bytes
else ptext (sLit ".skip ") <> int bytes | 225 | false | false | 0 | 11 | 71 | 71 | 34 | 37 | null | null |
lukexi/rumpus | pristine/CubeSea/Platform.hs | bsd-3-clause | start :: Start
start = do
spawnChild_ $ do
myPose ==> position (V3 0 (-d/2) 0)
myShape ==> Cube
myBody ==> Animated
myBodyFlags ==> [Ungrabbable, Teleportable]
mySize ==> V3 w d w
myColor ==> colorHSL 0.25 0.8 0.2 | 304 | start :: Start
start = do
spawnChild_ $ do
myPose ==> position (V3 0 (-d/2) 0)
myShape ==> Cube
myBody ==> Animated
myBodyFlags ==> [Ungrabbable, Teleportable]
mySize ==> V3 w d w
myColor ==> colorHSL 0.25 0.8 0.2 | 303 | start = do
spawnChild_ $ do
myPose ==> position (V3 0 (-d/2) 0)
myShape ==> Cube
myBody ==> Animated
myBodyFlags ==> [Ungrabbable, Teleportable]
mySize ==> V3 w d w
myColor ==> colorHSL 0.25 0.8 0.2 | 288 | false | true | 0 | 17 | 128 | 109 | 49 | 60 | null | null |
elieux/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- Annotation type checking
toAnnotationWrapperName :: Name
toAnnotationWrapperName = varQual gHC_DESUGAR (fsLit "toAnnotationWrapper") toAnnotationWrapperIdKey | 160 | toAnnotationWrapperName :: Name
toAnnotationWrapperName = varQual gHC_DESUGAR (fsLit "toAnnotationWrapper") toAnnotationWrapperIdKey | 132 | toAnnotationWrapperName = varQual gHC_DESUGAR (fsLit "toAnnotationWrapper") toAnnotationWrapperIdKey | 100 | true | true | 0 | 7 | 13 | 25 | 13 | 12 | null | null |
cpettitt/haskell-ptree | test/qc/Main.hs | mit | prop_insertWith' (t :: T) k v v2 = P.insertWith' (+) k v2 (P.insert k v t) P.! k == v + v2 | 90 | prop_insertWith' (t :: T) k v v2 = P.insertWith' (+) k v2 (P.insert k v t) P.! k == v + v2 | 90 | prop_insertWith' (t :: T) k v v2 = P.insertWith' (+) k v2 (P.insert k v t) P.! k == v + v2 | 90 | false | false | 0 | 11 | 21 | 61 | 31 | 30 | null | null |
dgonyeo/brandskell | Handler/ModSources.hs | mit | newSourceAForm :: AForm Handler PSource
newSourceAForm = PSource <$> areq textField "New Source" Nothing
<* bootstrapSubmit ("Submit" :: BootstrapSubmit Text) | 182 | newSourceAForm :: AForm Handler PSource
newSourceAForm = PSource <$> areq textField "New Source" Nothing
<* bootstrapSubmit ("Submit" :: BootstrapSubmit Text) | 182 | newSourceAForm = PSource <$> areq textField "New Source" Nothing
<* bootstrapSubmit ("Submit" :: BootstrapSubmit Text) | 142 | false | true | 0 | 8 | 43 | 43 | 21 | 22 | null | null |
mgrabmueller/harpy | examples/evaluator/ArithParser.hs | bsd-3-clause | semi = P.semi lexer | 24 | semi = P.semi lexer | 24 | semi = P.semi lexer | 24 | false | false | 1 | 5 | 8 | 15 | 5 | 10 | null | null |
ghcjs/ghcjs | src/Compiler/JMacro/Base.hs | mit | jsv :: Text -> JExpr
jsv = ValExpr . JVar . TxtI | 48 | jsv :: Text -> JExpr
jsv = ValExpr . JVar . TxtI | 48 | jsv = ValExpr . JVar . TxtI | 27 | false | true | 1 | 7 | 11 | 30 | 13 | 17 | null | null |
faylang/fay-server | modules/library/Language/Fay/Three.hs | bsd-3-clause | mkScene :: Fay Object3D
mkScene = ffi "new THREE.Scene()" | 57 | mkScene :: Fay Object3D
mkScene = ffi "new THREE.Scene()" | 57 | mkScene = ffi "new THREE.Scene()" | 33 | false | true | 0 | 5 | 8 | 17 | 8 | 9 | null | null |
DavidAlphaFox/ghc | utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | bsd-3-clause | ppr_tylit :: HsTyLit -> Html
ppr_tylit (HsNumTy _ n) = toHtml (show n) | 70 | ppr_tylit :: HsTyLit -> Html
ppr_tylit (HsNumTy _ n) = toHtml (show n) | 70 | ppr_tylit (HsNumTy _ n) = toHtml (show n) | 41 | false | true | 0 | 7 | 12 | 35 | 17 | 18 | null | null |
lgeorget/ogmarkup | src/Text/Ogmarkup/Private/Generator.hs | mit | sections :: (Monoid a, GenConf c a)
=> [Ast.Section a]
-> Generator c a ()
sections (s:r) = do section s
sections r | 153 | sections :: (Monoid a, GenConf c a)
=> [Ast.Section a]
-> Generator c a ()
sections (s:r) = do section s
sections r | 153 | sections (s:r) = do section s
sections r | 60 | false | true | 0 | 9 | 60 | 71 | 34 | 37 | null | null |
athanclark/rose-trees | src/Data/Tree/Set.hs | bsd-3-clause | eqHead :: Eq a => SetTree a -> SetTree a -> Bool
eqHead (SetTree x _) (SetTree y _) = x == y | 92 | eqHead :: Eq a => SetTree a -> SetTree a -> Bool
eqHead (SetTree x _) (SetTree y _) = x == y | 92 | eqHead (SetTree x _) (SetTree y _) = x == y | 43 | false | true | 0 | 8 | 22 | 57 | 27 | 30 | null | null |
mettekou/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | falseDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "False") falseDataConKey falseDataCon | 106 | falseDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "False") falseDataConKey falseDataCon | 106 | falseDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "False") falseDataConKey falseDataCon | 106 | false | false | 0 | 7 | 9 | 23 | 11 | 12 | null | null |
ddssff/pandoc | src/Text/Pandoc/Writers/RST.hs | gpl-2.0 | escapeString :: String -> String
escapeString = escapeStringUsing (backslashEscapes "`\\|*_") | 93 | escapeString :: String -> String
escapeString = escapeStringUsing (backslashEscapes "`\\|*_") | 93 | escapeString = escapeStringUsing (backslashEscapes "`\\|*_") | 60 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
bravit/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | failMsg :: String -> TC a
failMsg str = Error (Msg str) | 55 | failMsg :: String -> TC a
failMsg str = Error (Msg str) | 55 | failMsg str = Error (Msg str) | 29 | false | true | 0 | 7 | 11 | 34 | 15 | 19 | null | null |
rootzlevel/hledger-add | tests/ConfigParserSpec.hs | bsd-3-clause | exampleParseableProp :: TestData -> Property
exampleParseableProp testData =
let parser = TestData <$> option "someInt" (someInt testData) "help"
<*> option "someInteger" (someInteger testData) "help"
<*> option "someString" (someString testData) "help"
... | 445 | exampleParseableProp :: TestData -> Property
exampleParseableProp testData =
let parser = TestData <$> option "someInt" (someInt testData) "help"
<*> option "someInteger" (someInteger testData) "help"
<*> option "someString" (someString testData) "help"
... | 445 | exampleParseableProp testData =
let parser = TestData <$> option "someInt" (someInt testData) "help"
<*> option "someInteger" (someInteger testData) "help"
<*> option "someString" (someString testData) "help"
<*> option "someText" (someText testD... | 400 | false | true | 0 | 15 | 120 | 122 | 56 | 66 | null | null |
Numberartificial/workflow | snipets/src/Craft/Set.hs | mit | subSet :: Ord a => Set a -> Set a -> Bool
subSet (Set xs) (Set ys) = subS xs ys | 79 | subSet :: Ord a => Set a -> Set a -> Bool
subSet (Set xs) (Set ys) = subS xs ys | 79 | subSet (Set xs) (Set ys) = subS xs ys | 37 | false | true | 0 | 8 | 20 | 54 | 25 | 29 | null | null |
apoco/wave-machine | src/WaveMachine/Audio/Sequencing.hs | unlicense | delay :: Double -> WaveFunction -> WaveFunction
delay delayTime waveFunc t = if t < delayTime then 0 else waveFunc (t - delayTime) | 130 | delay :: Double -> WaveFunction -> WaveFunction
delay delayTime waveFunc t = if t < delayTime then 0 else waveFunc (t - delayTime) | 130 | delay delayTime waveFunc t = if t < delayTime then 0 else waveFunc (t - delayTime) | 82 | false | true | 0 | 8 | 22 | 48 | 25 | 23 | null | null |
DougBurke/swish | src/Swish/RDF/Graph.hs | lgpl-2.1 | textToDouble :: T.Text -> Maybe Double
textToDouble = textToRealFloat Just | 80 | textToDouble :: T.Text -> Maybe Double
textToDouble = textToRealFloat Just | 74 | textToDouble = textToRealFloat Just | 35 | false | true | 0 | 7 | 15 | 28 | 12 | 16 | null | null |
rrnewton/pcg-random | src/System/Random/PCG/Class.hs | bsd-3-clause | wordToBool :: Word32 -> Bool
wordToBool i = (i .&. 1) /= 0 | 58 | wordToBool :: Word32 -> Bool
wordToBool i = (i .&. 1) /= 0 | 58 | wordToBool i = (i .&. 1) /= 0 | 29 | false | true | 2 | 7 | 12 | 37 | 17 | 20 | null | null |
michalkonecny/aern2 | aern2-mp/bench/old/Values.hs | bsd-3-clause | ballsSmallExact :: [MPBall]
ballsSmallExact = map centreAsBall ballsSmall | 73 | ballsSmallExact :: [MPBall]
ballsSmallExact = map centreAsBall ballsSmall | 73 | ballsSmallExact = map centreAsBall ballsSmall | 45 | false | true | 0 | 5 | 7 | 19 | 10 | 9 | null | null |
Rufflewind/sci-ratio | src/Data/SciRatio.hs | mit | -- | Same as @'factorizeBase'@ but doesn't validate the arguments, so it might
-- loop forever or return something nonsensical.
_factorizeBase :: (Integral a, Integral b) => a -> a -> (a, b)
_factorizeBase b n | r /= 0 = (n, 0)
| r' /= 0 = (n'', e2 + 1)
| otherwise = (n'... | 626 | _factorizeBase :: (Integral a, Integral b) => a -> a -> (a, b)
_factorizeBase b n | r /= 0 = (n, 0)
| r' /= 0 = (n'', e2 + 1)
| otherwise = (n''', e2 + 2)
where (n', r) = n `quotRem` b
(n'', e) = _factorizeBase (b * b) n'
(n''', r') = n'' `quotRem`... | 496 | _factorizeBase b n | r /= 0 = (n, 0)
| r' /= 0 = (n'', e2 + 1)
| otherwise = (n''', e2 + 2)
where (n', r) = n `quotRem` b
(n'', e) = _factorizeBase (b * b) n'
(n''', r') = n'' `quotRem` b
e2 = e * 2
-- | Alias of @'factorizeBase'@.... | 433 | true | true | 3 | 10 | 208 | 196 | 105 | 91 | null | null |
fmapfmapfmap/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/Types/Product.hs | mpl-2.0 | -- | A JSON object that contains user-defined attributes to be added to the
-- stack configuration and deployment attributes. You can use custom JSON
-- to override the corresponding default stack configuration attribute
-- values or to pass data to recipes. The string should be in the following
-- format and must esca... | 720 | sCustomJSON :: Lens' Stack (Maybe Text)
sCustomJSON = lens _sCustomJSON (\ s a -> s{_sCustomJSON = a}) | 102 | sCustomJSON = lens _sCustomJSON (\ s a -> s{_sCustomJSON = a}) | 62 | true | true | 0 | 9 | 100 | 55 | 34 | 21 | null | null |
tchoutri/Hexon | src/Shell.hs | bsd-3-clause | parse :: String -> IO (Either String Response)
parse kmd =
eval command arguments
where
textCommand = Text.pack kmd
(command:arguments) = Text.split (== ' ') textCommand | 193 | parse :: String -> IO (Either String Response)
parse kmd =
eval command arguments
where
textCommand = Text.pack kmd
(command:arguments) = Text.split (== ' ') textCommand | 193 | parse kmd =
eval command arguments
where
textCommand = Text.pack kmd
(command:arguments) = Text.split (== ' ') textCommand | 146 | false | true | 1 | 9 | 49 | 79 | 36 | 43 | null | null |
dillonhuff/Folly | src/Folly/Lexer.hs | bsd-3-clause | separator = do
pos <- getPosition
name <- choice $ map string ["(", ")", "]", "[", ",", "."]
return $ Sep name pos | 120 | separator = do
pos <- getPosition
name <- choice $ map string ["(", ")", "]", "[", ",", "."]
return $ Sep name pos | 120 | separator = do
pos <- getPosition
name <- choice $ map string ["(", ")", "]", "[", ",", "."]
return $ Sep name pos | 120 | false | false | 0 | 10 | 28 | 59 | 30 | 29 | null | null |
bravit/Idris-dev | src/Idris/Core/Evaluate.hs | bsd-3-clause | -- | Evaluate in a context of locally named things (i.e. not de Bruijn indexed,
-- such as we might have during construction of a proof)
-- The (Name, Int) pair in the arguments is the maximum depth of unfolding of
-- a name. The corresponding pair in the state is the maximum number of
-- unfoldings overall.
eval :: ... | 16,616 | eval :: Bool -> Context -> [(Name, Int)] -> Env -> TT Name ->
[EvalOpt] -> Eval Value
eval traceon ctxt ntimes genv tm opts = ev ntimes [] True [] tm where
spec = Spec `elem` opts
simpl = Simplify True `elem` opts || Simplify False `elem` opts
simpl_inline = Simplify False `elem` opts
runtime = ... | 16,304 | eval traceon ctxt ntimes genv tm opts = ev ntimes [] True [] tm where
spec = Spec `elem` opts
simpl = Simplify True `elem` opts || Simplify False `elem` opts
simpl_inline = Simplify False `elem` opts
runtime = RunTT `elem` opts
atRepl = AtREPL `elem` opts
unfold = Unfold `elem` opts
noFree ... | 16,210 | true | true | 188 | 28 | 6,876 | 5,988 | 3,037 | 2,951 | null | null |
mimi1vx/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkSetAssignment3 = verify checkSetAssignment "set foo=42" | 65 | prop_checkSetAssignment3 = verify checkSetAssignment "set foo=42" | 65 | prop_checkSetAssignment3 = verify checkSetAssignment "set foo=42" | 65 | false | false | 0 | 5 | 5 | 11 | 5 | 6 | null | null |
jgoerzen/dtmconv | HaXml-1.12/src/Text/XML/HaXml/Html/Parse.hs | gpl-2.0 | "LABEL" `closes` "LABEL" = True | 35 | "LABEL" `closes` "LABEL" = True | 35 | "LABEL" `closes` "LABEL" = True | 35 | false | false | 0 | 5 | 8 | 18 | 8 | 10 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Coll/SkewHeap.hs | mit | fold f e (T x a b) = f x (fold f (fold f e a) b) | 48 | fold f e (T x a b) = f x (fold f (fold f e a) b) | 48 | fold f e (T x a b) = f x (fold f (fold f e a) b) | 48 | false | false | 0 | 9 | 16 | 48 | 23 | 25 | null | null |
danr/tfp1 | Lang/PrettyPolyFOL.hs | gpl-3.0 | ppTerm :: Id a -> Term a -> Doc
ppTerm p = go
where
go tm0 = case tm0 of
Apply f ts as -> p f <> csv (map (ppType p) ts ++ map go as)
Var v -> p v
Lit x -> integer x | 211 | ppTerm :: Id a -> Term a -> Doc
ppTerm p = go
where
go tm0 = case tm0 of
Apply f ts as -> p f <> csv (map (ppType p) ts ++ map go as)
Var v -> p v
Lit x -> integer x | 211 | ppTerm p = go
where
go tm0 = case tm0 of
Apply f ts as -> p f <> csv (map (ppType p) ts ++ map go as)
Var v -> p v
Lit x -> integer x | 179 | false | true | 1 | 14 | 92 | 121 | 52 | 69 | null | null |
irreverent-pixel-feats/bitbucket | bitbucket-json/src/Irreverent/Bitbucket/Json/Common.hs | bsd-3-clause | parseRepoSlug :: Value -> Parser RepoSlug
parseRepoSlug v = RepoSlug <$> parseJSON v | 84 | parseRepoSlug :: Value -> Parser RepoSlug
parseRepoSlug v = RepoSlug <$> parseJSON v | 84 | parseRepoSlug v = RepoSlug <$> parseJSON v | 42 | false | true | 0 | 6 | 12 | 28 | 13 | 15 | null | null |
vvmann/tyckiting-bot | clients/haskell/src/Tyckiting/AI/Joker.hs | mit | -- | Positions on the whole map, yet without borders
allPositions :: GameConfig -> JokerState
allPositions gameConfig =
neighbours (cfgFieldRadius gameConfig - cfgCannon gameConfig) origo | 191 | allPositions :: GameConfig -> JokerState
allPositions gameConfig =
neighbours (cfgFieldRadius gameConfig - cfgCannon gameConfig) origo | 138 | allPositions gameConfig =
neighbours (cfgFieldRadius gameConfig - cfgCannon gameConfig) origo | 97 | true | true | 0 | 8 | 28 | 37 | 18 | 19 | null | null |
mrk21/study_haskell | find_max/Main.hs | mit | main :: IO ()
main = print $ max2 [3,2,1,5,-4] | 46 | main :: IO ()
main = print $ max2 [3,2,1,5,-4] | 46 | main = print $ max2 [3,2,1,5,-4] | 32 | false | true | 2 | 7 | 9 | 46 | 23 | 23 | null | null |
nadavshemer/buildsome | src/Lib/FilePath.hs | gpl-2.0 | (<.>) :: FilePath -> ByteString -> FilePath
f <.> g = f <> "." <> g | 67 | (<.>) :: FilePath -> ByteString -> FilePath
f <.> g = f <> "." <> g | 67 | f <.> g = f <> "." <> g | 23 | false | true | 2 | 9 | 15 | 40 | 19 | 21 | null | null |
urbanslug/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | gen_Traversable_binds :: SrcSpan -> TyCon -> (LHsBinds RdrName, BagDerivStuff)
gen_Traversable_binds loc tycon
= (unitBag traverse_bind, emptyBag)
where
data_cons = tyConDataCons tycon
traverse_bind = mkRdrFunBind (L loc traverse_RDR) eqns
eqns = map traverse_eqn data_cons
traverse_eqn con = evalSt... | 2,255 | gen_Traversable_binds :: SrcSpan -> TyCon -> (LHsBinds RdrName, BagDerivStuff)
gen_Traversable_binds loc tycon
= (unitBag traverse_bind, emptyBag)
where
data_cons = tyConDataCons tycon
traverse_bind = mkRdrFunBind (L loc traverse_RDR) eqns
eqns = map traverse_eqn data_cons
traverse_eqn con = evalSt... | 2,255 | gen_Traversable_binds loc tycon
= (unitBag traverse_bind, emptyBag)
where
data_cons = tyConDataCons tycon
traverse_bind = mkRdrFunBind (L loc traverse_RDR) eqns
eqns = map traverse_eqn data_cons
traverse_eqn con = evalState (match_for_con [f_Pat] con =<< parts) bs_RDRs
where
parts = s... | 2,176 | false | true | 2 | 11 | 823 | 402 | 208 | 194 | null | null |
khibino/haskell-debian-build.rebuild | src/Debian/Package/Data/Packages.hs | bsd-3-clause | -- | Source package name of 'Source'
sourceName :: Source -> String
sourceName (Source n _) = n | 95 | sourceName :: Source -> String
sourceName (Source n _) = n | 58 | sourceName (Source n _) = n | 27 | true | true | 0 | 7 | 17 | 27 | 14 | 13 | null | null |
plaprade/haskoin | haskoin-wallet/test/Network/Haskoin/Wallet/Units.hs | unlicense | testDiceToMnemonic :: Assertion
testDiceToMnemonic = do
assertEqual "Unit 1" (diceToMnemonic "666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666") $ Right "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon... | 704 | testDiceToMnemonic :: Assertion
testDiceToMnemonic = do
assertEqual "Unit 1" (diceToMnemonic "666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666") $ Right "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon... | 704 | testDiceToMnemonic = do
assertEqual "Unit 1" (diceToMnemonic "666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666") $ Right "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon... | 672 | false | true | 0 | 10 | 75 | 53 | 24 | 29 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_346 (172#) = happyShift action_106 | 41 | action_346 (172#) = happyShift action_106 | 41 | action_346 (172#) = happyShift action_106 | 41 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
wz1000/haskell-lsp | lsp/example/Reactor.hs | mit | handle :: Handlers (LspM Config)
handle = mconcat
[ notificationHandler J.SInitialized $ \_msg -> do
liftIO $ debugM "reactor.handle" "Processing the Initialized notification"
-- We're initialized! Lets send a showMessageRequest now
let params = J.ShowMessageRequestParams
... | 6,479 | handle :: Handlers (LspM Config)
handle = mconcat
[ notificationHandler J.SInitialized $ \_msg -> do
liftIO $ debugM "reactor.handle" "Processing the Initialized notification"
-- We're initialized! Lets send a showMessageRequest now
let params = J.ShowMessageRequestParams
... | 6,479 | handle = mconcat
[ notificationHandler J.SInitialized $ \_msg -> do
liftIO $ debugM "reactor.handle" "Processing the Initialized notification"
-- We're initialized! Lets send a showMessageRequest now
let params = J.ShowMessageRequestParams
J.MtWarning
... | 6,446 | false | true | 0 | 29 | 1,772 | 1,814 | 877 | 937 | null | null |
xldenis/bookclub | src/Query.hs | bsd-3-clause | query :: (MonadReader Connection m, MonadIO m, FromRow r1, ToRow q) => Query -> q -> m [r1]
query b c = ask >>= \conn -> liftIO $ P.query conn b c | 146 | query :: (MonadReader Connection m, MonadIO m, FromRow r1, ToRow q) => Query -> q -> m [r1]
query b c = ask >>= \conn -> liftIO $ P.query conn b c | 146 | query b c = ask >>= \conn -> liftIO $ P.query conn b c | 54 | false | true | 2 | 10 | 31 | 87 | 43 | 44 | null | null |
spechub/Hets | OWL2/StaticAnalysis.hs | gpl-2.0 | checkClassExpression :: Sign -> AS.ClassExpression -> Result AS.ClassExpression
checkClassExpression s desc =
let errMsg i = failMsg i desc
objErr i = errMsg $ AS.mkEntity AS.ObjectProperty i
datErr i = errMsg $ AS.mkEntity AS.DataProperty i
in case desc of
AS.Expression u -> if AS.isThing u... | 2,636 | checkClassExpression :: Sign -> AS.ClassExpression -> Result AS.ClassExpression
checkClassExpression s desc =
let errMsg i = failMsg i desc
objErr i = errMsg $ AS.mkEntity AS.ObjectProperty i
datErr i = errMsg $ AS.mkEntity AS.DataProperty i
in case desc of
AS.Expression u -> if AS.isThing u... | 2,636 | checkClassExpression s desc =
let errMsg i = failMsg i desc
objErr i = errMsg $ AS.mkEntity AS.ObjectProperty i
datErr i = errMsg $ AS.mkEntity AS.DataProperty i
in case desc of
AS.Expression u -> if AS.isThing u
then return $ AS.Expression $ AS.setReservedPrefix u
else check... | 2,556 | false | true | 0 | 22 | 890 | 828 | 384 | 444 | null | null |
GaloisInc/halvm-ghc | compiler/main/ErrUtils.hs | bsd-3-clause | fatalErrorMsg'' :: FatalMessager -> String -> IO ()
fatalErrorMsg'' fm msg = fm msg | 83 | fatalErrorMsg'' :: FatalMessager -> String -> IO ()
fatalErrorMsg'' fm msg = fm msg | 83 | fatalErrorMsg'' fm msg = fm msg | 31 | false | true | 0 | 8 | 13 | 32 | 15 | 17 | null | null |
ezyang/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | isInlinablePragma :: InlinePragma -> Bool
isInlinablePragma prag = case inl_inline prag of
Inlinable -> True
_ -> False | 181 | isInlinablePragma :: InlinePragma -> Bool
isInlinablePragma prag = case inl_inline prag of
Inlinable -> True
_ -> False | 181 | isInlinablePragma prag = case inl_inline prag of
Inlinable -> True
_ -> False | 139 | false | true | 0 | 7 | 79 | 37 | 18 | 19 | null | null |
haslab/SecreC | src/Language/SecreC/Prover/Expression.hs | gpl-3.0 | proverProcError str t e = do
lift $ do
ppe <- ppExprTy (fmap typed e)
ppt <- pp t
genTcError (locpos $ unTyped $ loc e) True $ text "failed to convert" <+> text str <+> text "expression" <+> ppe <+> text "to prover expression: unknown declaration type" <+> ppt | 288 | proverProcError str t e = do
lift $ do
ppe <- ppExprTy (fmap typed e)
ppt <- pp t
genTcError (locpos $ unTyped $ loc e) True $ text "failed to convert" <+> text str <+> text "expression" <+> ppe <+> text "to prover expression: unknown declaration type" <+> ppt | 288 | proverProcError str t e = do
lift $ do
ppe <- ppExprTy (fmap typed e)
ppt <- pp t
genTcError (locpos $ unTyped $ loc e) True $ text "failed to convert" <+> text str <+> text "expression" <+> ppe <+> text "to prover expression: unknown declaration type" <+> ppt | 288 | false | false | 0 | 19 | 77 | 106 | 47 | 59 | null | null |
li-zhirui/JSAnalyzer | JSParser.hs | mit | -- | parse a comma symbol
comma :: Parser String
comma = symbol "," | 80 | comma :: Parser String
comma = symbol "," | 54 | comma = symbol "," | 25 | true | true | 0 | 6 | 26 | 24 | 10 | 14 | null | null |
FPtje/GLuaParser | src/GLua/Parser.hs | lgpl-2.1 | -- | Parse operators of the same precedence in a chain
samePrioL :: [(Token, BinOp)] -> AParser MExpr -> AParser MExpr
samePrioL ops pr = pChainl (choice (map f ops)) pr
where
choice = foldr (<<|>) pFail
f :: (Token, BinOp) -> AParser (MExpr -> MExpr -> MExpr)
f (t, at) = (\p e1 e2 -> MExpr p (BinOpExpr a... | 349 | samePrioL :: [(Token, BinOp)] -> AParser MExpr -> AParser MExpr
samePrioL ops pr = pChainl (choice (map f ops)) pr
where
choice = foldr (<<|>) pFail
f :: (Token, BinOp) -> AParser (MExpr -> MExpr -> MExpr)
f (t, at) = (\p e1 e2 -> MExpr p (BinOpExpr at e1 e2)) <$> pPos <* pMTok t | 294 | samePrioL ops pr = pChainl (choice (map f ops)) pr
where
choice = foldr (<<|>) pFail
f :: (Token, BinOp) -> AParser (MExpr -> MExpr -> MExpr)
f (t, at) = (\p e1 e2 -> MExpr p (BinOpExpr at e1 e2)) <$> pPos <* pMTok t | 230 | true | true | 0 | 11 | 80 | 159 | 82 | 77 | null | null |
enolan/Idris-dev | src/Idris/Error.hs | bsd-3-clause | warnDisamb ist (PCoerced tm) = warnDisamb ist tm | 48 | warnDisamb ist (PCoerced tm) = warnDisamb ist tm | 48 | warnDisamb ist (PCoerced tm) = warnDisamb ist tm | 48 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
csabahruska/GFXDemo | ShaderParser.hs | bsd-3-clause | kw :: ByteString -> Parser ()
kw s = ((\w -> if B.map toLower w == s then return () else fail "") =<< word) <?> B.unpack s | 122 | kw :: ByteString -> Parser ()
kw s = ((\w -> if B.map toLower w == s then return () else fail "") =<< word) <?> B.unpack s | 122 | kw s = ((\w -> if B.map toLower w == s then return () else fail "") =<< word) <?> B.unpack s | 92 | false | true | 0 | 13 | 27 | 78 | 38 | 40 | null | null |
seereason/cabal | cabal-install/Distribution/Client/Setup.hs | bsd-3-clause | freezeCommand :: CommandUI FreezeFlags
freezeCommand = CommandUI {
commandName = "freeze",
commandSynopsis = "Freeze dependencies.",
commandDescription = Just $ \_ -> wrapText $
"Calculates a valid set of dependencies and their exact versions. "
++ "If successful, saves the resul... | 2,245 | freezeCommand :: CommandUI FreezeFlags
freezeCommand = CommandUI {
commandName = "freeze",
commandSynopsis = "Freeze dependencies.",
commandDescription = Just $ \_ -> wrapText $
"Calculates a valid set of dependencies and their exact versions. "
++ "If successful, saves the resul... | 2,245 | freezeCommand = CommandUI {
commandName = "freeze",
commandSynopsis = "Freeze dependencies.",
commandDescription = Just $ \_ -> wrapText $
"Calculates a valid set of dependencies and their exact versions. "
++ "If successful, saves the result to the file `cabal.config`.\n"
... | 2,206 | false | true | 0 | 16 | 810 | 431 | 242 | 189 | null | null |
green-haskell/ghc | libraries/base/Data/OldList.hs | bsd-3-clause | -- | The 'isSuffixOf' function takes two lists and returns 'True' iff
-- the first list is a suffix of the second. The second list must be
-- finite.
isSuffixOf :: (Eq a) => [a] -> [a] -> Bool
ns `isSuffixOf` hs = maybe False id $ do
delta <- dropLengthMaybe ns hs
return $ ns == dropLength... | 927 | isSuffixOf :: (Eq a) => [a] -> [a] -> Bool
ns `isSuffixOf` hs = maybe False id $ do
delta <- dropLengthMaybe ns hs
return $ ns == dropLength delta hs
-- Since dropLengthMaybe ns hs succeeded, we know that (if hs is finite)
-- length ns + length delta = length hs
-- so dro... | 777 | ns `isSuffixOf` hs = maybe False id $ do
delta <- dropLengthMaybe ns hs
return $ ns == dropLength delta hs
-- Since dropLengthMaybe ns hs succeeded, we know that (if hs is finite)
-- length ns + length delta = length hs
-- so dropping the length of delta from hs will yield a suffix ex... | 721 | true | true | 0 | 9 | 222 | 91 | 51 | 40 | null | null |
lowasser/TrieMap | Data/TrieMap/Utils.hs | bsd-3-clause | toVectorN :: Vector v a => (forall b . (a -> b -> b) -> b -> f -> b) -> (f -> Int) -> f -> v a
toVectorN fold size xs = create $ do
!mv <- unsafeNew (size xs)
fold (\ x m i# -> unsafeWrite mv (I# i#) x >> m (i# +# 1#)) (\ _ -> return mv) xs 0#
| 247 | toVectorN :: Vector v a => (forall b . (a -> b -> b) -> b -> f -> b) -> (f -> Int) -> f -> v a
toVectorN fold size xs = create $ do
!mv <- unsafeNew (size xs)
fold (\ x m i# -> unsafeWrite mv (I# i#) x >> m (i# +# 1#)) (\ _ -> return mv) xs 0#
| 247 | toVectorN fold size xs = create $ do
!mv <- unsafeNew (size xs)
fold (\ x m i# -> unsafeWrite mv (I# i#) x >> m (i# +# 1#)) (\ _ -> return mv) xs 0#
| 152 | false | true | 0 | 14 | 68 | 167 | 82 | 85 | null | null |
keithodulaigh/Hets | CASL/Freeness.hs | gpl-2.0 | free_formula (Relation f1 c f2 r) = Relation f1' c f2' r
where f1' = free_formula f1
f2' = free_formula f2 | 122 | free_formula (Relation f1 c f2 r) = Relation f1' c f2' r
where f1' = free_formula f1
f2' = free_formula f2 | 122 | free_formula (Relation f1 c f2 r) = Relation f1' c f2' r
where f1' = free_formula f1
f2' = free_formula f2 | 122 | false | false | 1 | 7 | 36 | 49 | 23 | 26 | null | null |
music-suite/music-pitch | src/Music/Pitch/Common/Harmony.hs | bsd-3-clause | - | Whether the given interval is a perfect (harmonic) consonance.
isPerfectConsonance :: Interval -> Bool
isPerfectConsonance x = case number (simple x) of
1 -> True
4 -> True
5 -> True
_ -> False
-- | Whether the given interval is an imperfect (harmonic) consonance.
| 278 | isPerfectConsonance :: Interval -> Bool
isPerfectConsonance x = case number (simple x) of
1 -> True
4 -> True
5 -> True
_ -> False
-- | Whether the given interval is an imperfect (harmonic) consonance. | 210 | isPerfectConsonance x = case number (simple x) of
1 -> True
4 -> True
5 -> True
_ -> False
-- | Whether the given interval is an imperfect (harmonic) consonance. | 170 | true | true | 1 | 8 | 56 | 89 | 43 | 46 | null | null |
rleshchinskiy/vector | Data/Vector.hs | bsd-3-clause | maxIndex = G.maxIndex | 21 | maxIndex = G.maxIndex | 21 | maxIndex = G.maxIndex | 21 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
rumblesan/haskell-experiments | src/Examples/Equations/Parser.hs | bsd-3-clause | table =
[ [Infix (m_reservedOp "^" >> return EExp) AssocLeft]
, [ Infix (m_reservedOp "" >> return EMult) AssocLeft
, Infix (m_reservedOp "*" >> return EMult) AssocLeft
, Infix (m_reservedOp "/" >> return EDiv) AssocLeft
]
, [ Infix (m_reservedOp "+" >> return EAdd) AssocLeft
, Infix (m_reservedOp... | 360 | table =
[ [Infix (m_reservedOp "^" >> return EExp) AssocLeft]
, [ Infix (m_reservedOp "" >> return EMult) AssocLeft
, Infix (m_reservedOp "*" >> return EMult) AssocLeft
, Infix (m_reservedOp "/" >> return EDiv) AssocLeft
]
, [ Infix (m_reservedOp "+" >> return EAdd) AssocLeft
, Infix (m_reservedOp... | 360 | table =
[ [Infix (m_reservedOp "^" >> return EExp) AssocLeft]
, [ Infix (m_reservedOp "" >> return EMult) AssocLeft
, Infix (m_reservedOp "*" >> return EMult) AssocLeft
, Infix (m_reservedOp "/" >> return EDiv) AssocLeft
]
, [ Infix (m_reservedOp "+" >> return EAdd) AssocLeft
, Infix (m_reservedOp... | 360 | false | false | 1 | 11 | 82 | 145 | 69 | 76 | null | null |
mydaum/cabal | cabal-install/tests/UnitTests/Distribution/Client/Tar.hs | bsd-3-clause | getFileEntry :: FilePath -> [Char] -> Entry
getFileEntry pth dta =
simpleEntry tp $ NormalFile dta' $ BS.length dta'
where tp = case toTarPath False pth of
Right tp' -> tp'
Left e -> error e
dta' = BS.Char8.pack dta | 251 | getFileEntry :: FilePath -> [Char] -> Entry
getFileEntry pth dta =
simpleEntry tp $ NormalFile dta' $ BS.length dta'
where tp = case toTarPath False pth of
Right tp' -> tp'
Left e -> error e
dta' = BS.Char8.pack dta | 251 | getFileEntry pth dta =
simpleEntry tp $ NormalFile dta' $ BS.length dta'
where tp = case toTarPath False pth of
Right tp' -> tp'
Left e -> error e
dta' = BS.Char8.pack dta | 207 | false | true | 1 | 9 | 75 | 96 | 45 | 51 | null | null |
rahulmutt/ghcvm | compiler/Eta/TypeCheck/TcEvidence.hs | bsd-3-clause | ppr_co p (TcNthCo n co) = pprPrefixApp p (ptext (sLit "Nth:") <+> int n) [pprParendTcCo co] | 97 | ppr_co p (TcNthCo n co) = pprPrefixApp p (ptext (sLit "Nth:") <+> int n) [pprParendTcCo co] | 97 | ppr_co p (TcNthCo n co) = pprPrefixApp p (ptext (sLit "Nth:") <+> int n) [pprParendTcCo co] | 97 | false | false | 0 | 10 | 21 | 51 | 24 | 27 | null | null |
brendanhay/gogol | gogol-classroom/gen/Network/Google/Classroom/Types/Product.hs | mpl-2.0 | -- | The user\'s full name formed by concatenating the first and last name
-- values. Read-only.
nFullName :: Lens' Name (Maybe Text)
nFullName
= lens _nFullName (\ s a -> s{_nFullName = a}) | 192 | nFullName :: Lens' Name (Maybe Text)
nFullName
= lens _nFullName (\ s a -> s{_nFullName = a}) | 95 | nFullName
= lens _nFullName (\ s a -> s{_nFullName = a}) | 58 | true | true | 2 | 9 | 35 | 56 | 26 | 30 | null | null |
deontologician/orbRPG | Game/OrbRPG/HAdventure/Builder.hs | gpl-3.0 | -- | Create a particular object at a particular location.
revealAt :: Object -- ^ The object to create.
-> Object -- ^ The location at which to create it.
-> Adv ()
revealAt = addObject | 207 | revealAt :: Object -- ^ The object to create.
-> Object -- ^ The location at which to create it.
-> Adv ()
revealAt = addObject | 149 | revealAt = addObject | 20 | true | true | 0 | 8 | 57 | 27 | 15 | 12 | null | null |
fmapfmapfmap/amazonka | amazonka-glacier/gen/Network/AWS/Glacier/ListTagsForVault.hs | mpl-2.0 | -- | The response status code.
ltfvrsResponseStatus :: Lens' ListTagsForVaultResponse Int
ltfvrsResponseStatus = lens _ltfvrsResponseStatus (\ s a -> s{_ltfvrsResponseStatus = a}) | 179 | ltfvrsResponseStatus :: Lens' ListTagsForVaultResponse Int
ltfvrsResponseStatus = lens _ltfvrsResponseStatus (\ s a -> s{_ltfvrsResponseStatus = a}) | 148 | ltfvrsResponseStatus = lens _ltfvrsResponseStatus (\ s a -> s{_ltfvrsResponseStatus = a}) | 89 | true | true | 1 | 9 | 21 | 43 | 22 | 21 | null | null |
hferreiro/replay | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprInstr (CVTTSS2SIQ sz from to) = pprSizeSizeOpReg (sLit "cvttss2si") FF32 sz from to | 86 | pprInstr (CVTTSS2SIQ sz from to) = pprSizeSizeOpReg (sLit "cvttss2si") FF32 sz from to | 86 | pprInstr (CVTTSS2SIQ sz from to) = pprSizeSizeOpReg (sLit "cvttss2si") FF32 sz from to | 86 | false | false | 0 | 7 | 12 | 36 | 17 | 19 | null | null |
bjornbm/astro | src/Astro/Coords.hs | bsd-3-clause | apply (CS f) = S . f . c | 24 | apply (CS f) = S . f . c | 24 | apply (CS f) = S . f . c | 24 | false | false | 0 | 7 | 8 | 23 | 11 | 12 | null | null |
ryantrinkle/ghcjs | src/Gen2/Prim.hs | mit | genPrim _ _ WriteByteArrayOp_WideChar [] [a,i,e] = PrimInline [j| `a`.i3[`i`] = `e`; |] | 87 | genPrim _ _ WriteByteArrayOp_WideChar [] [a,i,e] = PrimInline [j| `a`.i3[`i`] = `e`; |] | 87 | genPrim _ _ WriteByteArrayOp_WideChar [] [a,i,e] = PrimInline [j| `a`.i3[`i`] = `e`; |] | 87 | false | false | 3 | 6 | 12 | 36 | 20 | 16 | null | null |
Peaker/TraceUtils | src/Debug/TraceUtils/Dont.hs | bsd-3-clause | tracePutStrLn :: Monad m => String -> m ()
tracePutStrLn = const $ return () | 76 | tracePutStrLn :: Monad m => String -> m ()
tracePutStrLn = const $ return () | 76 | tracePutStrLn = const $ return () | 33 | false | true | 0 | 8 | 14 | 36 | 17 | 19 | null | null |
psibi/yesod | yesod-persistent/test/Yesod/PersistSpec.hs | mit | getHomeR :: Handler TypedContent
getHomeR = do
runDB $ do
runMigration migrateAll
deleteWhere ([] :: [Filter Person])
insert_ $ Person "Charlie"
insert_ $ Person "Alice"
insert_ $ Person "Bob"
respondSourceDB typePlain $ selectSource [] [Asc PersonName] .| awaitForever to... | 475 | getHomeR :: Handler TypedContent
getHomeR = do
runDB $ do
runMigration migrateAll
deleteWhere ([] :: [Filter Person])
insert_ $ Person "Charlie"
insert_ $ Person "Alice"
insert_ $ Person "Bob"
respondSourceDB typePlain $ selectSource [] [Asc PersonName] .| awaitForever to... | 475 | getHomeR = do
runDB $ do
runMigration migrateAll
deleteWhere ([] :: [Filter Person])
insert_ $ Person "Charlie"
insert_ $ Person "Alice"
insert_ $ Person "Bob"
respondSourceDB typePlain $ selectSource [] [Asc PersonName] .| awaitForever toBuilder
where
toBuilder (En... | 442 | false | true | 0 | 13 | 138 | 166 | 73 | 93 | null | null |
arybczak/haskell-dev-utils | cabal/CabalFreeze.hs | bsd-3-clause | main :: IO ()
main = do
config <- parseCabalConfig <$> T.readFile configFile
copyFile configFile oldConfigFile
system "cabal freeze" >>= \case
ExitFailure code -> putStrLn $ "cabal freeze failed with exit code " ++ show code
ExitSuccess -> do
newConfig <- parseCabalConfig <$> T.readFile configFile
... | 937 | main :: IO ()
main = do
config <- parseCabalConfig <$> T.readFile configFile
copyFile configFile oldConfigFile
system "cabal freeze" >>= \case
ExitFailure code -> putStrLn $ "cabal freeze failed with exit code " ++ show code
ExitSuccess -> do
newConfig <- parseCabalConfig <$> T.readFile configFile
... | 937 | main = do
config <- parseCabalConfig <$> T.readFile configFile
copyFile configFile oldConfigFile
system "cabal freeze" >>= \case
ExitFailure code -> putStrLn $ "cabal freeze failed with exit code " ++ show code
ExitSuccess -> do
newConfig <- parseCabalConfig <$> T.readFile configFile
let delta... | 923 | false | true | 1 | 16 | 220 | 251 | 111 | 140 | null | null |
GaloisInc/tower | tower/src/Ivory/Tower/AST/Graph.hs | bsd-3-clause | monitorChanHandlers :: Monitor -> Chan -> [Handler]
monitorChanHandlers m c = filter p (monitor_handlers m)
where p h = handler_chan h == c
-- For a given handler, the list of all channels it emits on. | 204 | monitorChanHandlers :: Monitor -> Chan -> [Handler]
monitorChanHandlers m c = filter p (monitor_handlers m)
where p h = handler_chan h == c
-- For a given handler, the list of all channels it emits on. | 204 | monitorChanHandlers m c = filter p (monitor_handlers m)
where p h = handler_chan h == c
-- For a given handler, the list of all channels it emits on. | 152 | false | true | 0 | 7 | 38 | 56 | 28 | 28 | null | null |
HalosGhost/hs | numbers/roman.hs | isc | -- | Convert an integral to a Roman Numeral of the specified format.
-- Because Lenient forms do not have single representation of all numbers
-- and because all Subtractive forms are valid Lenient forms,
-- `toRoman Lenient{,N}` will use the Subtractive forms.
toRoman :: Integral a => RomanFormat -> a -> String
toRoma... | 647 | toRoman :: Integral a => RomanFormat -> a -> String
toRoman f n = case f of
Additive -> toAdditiveRoman' n
AdditiveN -> toAdditiveRoman n
Subtractive -> toSubtractiveRoman' n
SubtractiveN -> toSubtractiveRoman n
Lenient -> toSubtractiveRoman' n
LenientN -> toSubtractiveRoman n
-- ... | 385 | toRoman f n = case f of
Additive -> toAdditiveRoman' n
AdditiveN -> toAdditiveRoman n
Subtractive -> toSubtractiveRoman' n
SubtractiveN -> toSubtractiveRoman n
Lenient -> toSubtractiveRoman' n
LenientN -> toSubtractiveRoman n
-- | Convert a Roman Numeral of the specified format to... | 333 | true | true | 0 | 9 | 135 | 99 | 47 | 52 | null | null |
dysinger/amazonka | amazonka-codedeploy/gen/Network/AWS/CodeDeploy/Types.hs | mpl-2.0 | -- | The number of instances that have failed in the deployment.
doFailed :: Lens' DeploymentOverview (Maybe Integer)
doFailed = lens _doFailed (\s a -> s { _doFailed = a }) | 173 | doFailed :: Lens' DeploymentOverview (Maybe Integer)
doFailed = lens _doFailed (\s a -> s { _doFailed = a }) | 108 | doFailed = lens _doFailed (\s a -> s { _doFailed = a }) | 55 | true | true | 1 | 9 | 30 | 52 | 25 | 27 | null | null |
bgamari/pandoc | src/Text/Pandoc/Writers/FB2.hs | gpl-2.0 | blockToXml (Header _ _ _) = -- should never happen, see renderSections
error "unexpected header in section text" | 138 | blockToXml (Header _ _ _) = -- should never happen, see renderSections
error "unexpected header in section text" | 138 | blockToXml (Header _ _ _) = -- should never happen, see renderSections
error "unexpected header in section text" | 138 | false | false | 0 | 7 | 43 | 23 | 11 | 12 | null | null |
lukexi/stack | src/Stack/Setup.hs | bsd-3-clause | withUnpackedTarball7z :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m)
=> String -- ^ Name of tool, used in error messages
-> SetupInfo
-> Path Abs File -- ^ Path to archive file
... | 1,819 | withUnpackedTarball7z :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m)
=> String -- ^ Name of tool, used in error messages
-> SetupInfo
-> Path Abs File -- ^ Path to archive file
... | 1,819 | withUnpackedTarball7z name si archiveFile archiveType srcDir destDir = do
suffix <-
case archiveType of
TarXz -> return ".xz"
TarBz2 -> return ".bz2"
TarGz -> return ".gz"
_ -> error $ name ++ " must be a tarball file"
tarFile <-
case T.stripSuffix... | 1,282 | false | true | 0 | 18 | 638 | 428 | 204 | 224 | null | null |
AlexeyRaga/eta | compiler/ETA/Interactive/ByteCodeAsm.hs | bsd-3-clause | return_ubx F = bci_RETURN_F | 29 | return_ubx F = bci_RETURN_F | 29 | return_ubx F = bci_RETURN_F | 29 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
ke00n/alabno | backend/complexity_analyser/testFiles/MP/student/MP.hs | mit | expandext input keys
= concat ( map (++"----- \n") [(expand input str1) | str1 <- v])
where
(sep3, v) = split "#" keys | 126 | expandext input keys
= concat ( map (++"----- \n") [(expand input str1) | str1 <- v])
where
(sep3, v) = split "#" keys | 126 | expandext input keys
= concat ( map (++"----- \n") [(expand input str1) | str1 <- v])
where
(sep3, v) = split "#" keys | 126 | false | false | 1 | 9 | 30 | 69 | 33 | 36 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/Writers/Man.hs | gpl-2.0 | orderedListItemToMan :: WriterOptions -- ^ options
-> String -- ^ order marker for list item
-> Int -- ^ number of spaces to indent
-> [Block] -- ^ list item (list of blocks)
-> State WriterState Doc
orderedL... | 356 | orderedListItemToMan :: WriterOptions -- ^ options
-> String -- ^ order marker for list item
-> Int -- ^ number of spaces to indent
-> [Block] -- ^ list item (list of blocks)
-> State WriterState Doc
orderedL... | 356 | orderedListItemToMan _ _ _ [] = return empty | 44 | false | true | 0 | 9 | 156 | 53 | 28 | 25 | null | null |
harendra-kumar/stack | src/Options/Applicative/Builder/Extra.hs | bsd-3-clause | -- | Enable/disable flags for a @('Maybe' 'Bool')@.
maybeBoolFlags :: String -- ^ Flag name
-> String -- ^ Help suffix
-> Mod FlagFields (Maybe Bool)
-> Parser (Maybe Bool)
maybeBoolFlags = enableDisableFlags Nothing (Just True) (J... | 330 | maybeBoolFlags :: String -- ^ Flag name
-> String -- ^ Help suffix
-> Mod FlagFields (Maybe Bool)
-> Parser (Maybe Bool)
maybeBoolFlags = enableDisableFlags Nothing (Just True) (Just False) | 278 | maybeBoolFlags = enableDisableFlags Nothing (Just True) (Just False) | 68 | true | true | 0 | 10 | 126 | 65 | 33 | 32 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcTypes.hs | lgpl-2.1 | withPointResult :: (Ptr CInt -> Ptr CInt -> IO ()) -> IO (Point2 Int)
withPointResult f
= alloca $ \px ->
alloca $ \py ->
do f px py
x <- peek px
y <- peek py
return (fromCPoint x y) | 213 | withPointResult :: (Ptr CInt -> Ptr CInt -> IO ()) -> IO (Point2 Int)
withPointResult f
= alloca $ \px ->
alloca $ \py ->
do f px py
x <- peek px
y <- peek py
return (fromCPoint x y) | 213 | withPointResult f
= alloca $ \px ->
alloca $ \py ->
do f px py
x <- peek px
y <- peek py
return (fromCPoint x y) | 143 | false | true | 0 | 13 | 71 | 109 | 50 | 59 | null | null |
mit-plv/riscv-semantics | src/Spec/ExecuteF.hs | bsd-3-clause | execute (Fmin_s rd rs1 rs2) = do
x <- getFPRegister rs1
y <- getFPRegister rs2
let Result z flags = f32LtQuiet (fromIntegral x :: Word32) (fromIntegral y :: Word32)
updateFFlags flags
-- Special cases and other sheNaNigans. Current behavior (v2.3-draft) differs
-- from v2.2 of spec.
let result | x == nega... | 532 | execute (Fmin_s rd rs1 rs2) = do
x <- getFPRegister rs1
y <- getFPRegister rs2
let Result z flags = f32LtQuiet (fromIntegral x :: Word32) (fromIntegral y :: Word32)
updateFFlags flags
-- Special cases and other sheNaNigans. Current behavior (v2.3-draft) differs
-- from v2.2 of spec.
let result | x == nega... | 532 | execute (Fmin_s rd rs1 rs2) = do
x <- getFPRegister rs1
y <- getFPRegister rs2
let Result z flags = f32LtQuiet (fromIntegral x :: Word32) (fromIntegral y :: Word32)
updateFFlags flags
-- Special cases and other sheNaNigans. Current behavior (v2.3-draft) differs
-- from v2.2 of spec.
let result | x == nega... | 532 | false | false | 0 | 15 | 167 | 182 | 80 | 102 | null | null |
brendanhay/gogol | gogol-shopping-content/gen/Network/Google/Resource/Content/FreeListingsprogram/Requestreview.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
flrUploadProtocol :: Lens' FreeListingsprogramRequestreview (Maybe Text)
flrUploadProtocol
= lens _flrUploadProtocol
(\ s a -> s{_flrUploadProtocol = a}) | 223 | flrUploadProtocol :: Lens' FreeListingsprogramRequestreview (Maybe Text)
flrUploadProtocol
= lens _flrUploadProtocol
(\ s a -> s{_flrUploadProtocol = a}) | 161 | flrUploadProtocol
= lens _flrUploadProtocol
(\ s a -> s{_flrUploadProtocol = a}) | 88 | true | true | 0 | 8 | 33 | 49 | 25 | 24 | null | null |
shayan-najd/HsParser | U/Pretty.hs | gpl-3.0 | sep1 _ NoDoc _ _ = NoDoc | 39 | sep1 _ NoDoc _ _ = NoDoc | 39 | sep1 _ NoDoc _ _ = NoDoc | 39 | false | false | 0 | 5 | 21 | 15 | 7 | 8 | null | null |
binarin/learnopengl | src/Lighting.hs | bsd-3-clause | mkWhiteCube :: IO WhiteCube
mkWhiteCube = do
vbo <- GL.genBuffer
vao <- GL.genVertexArray
GL.bindVertexArray vao
GL.bindBuffer GL.TargetArray vbo
GL.floatBufferData GL.TargetArray GL.UsageStaticDraw
[ -0.5, -0.5, -0.5,
0.5, -0.5, -0.5,
0.5, 0.5, -0.5,
0.5, 0.5, -0.5,
-0.5, 0.5, ... | 1,790 | mkWhiteCube :: IO WhiteCube
mkWhiteCube = do
vbo <- GL.genBuffer
vao <- GL.genVertexArray
GL.bindVertexArray vao
GL.bindBuffer GL.TargetArray vbo
GL.floatBufferData GL.TargetArray GL.UsageStaticDraw
[ -0.5, -0.5, -0.5,
0.5, -0.5, -0.5,
0.5, 0.5, -0.5,
0.5, 0.5, -0.5,
-0.5, 0.5, ... | 1,790 | mkWhiteCube = do
vbo <- GL.genBuffer
vao <- GL.genVertexArray
GL.bindVertexArray vao
GL.bindBuffer GL.TargetArray vbo
GL.floatBufferData GL.TargetArray GL.UsageStaticDraw
[ -0.5, -0.5, -0.5,
0.5, -0.5, -0.5,
0.5, 0.5, -0.5,
0.5, 0.5, -0.5,
-0.5, 0.5, -0.5,
-0.5, -0.5, -0.5,... | 1,762 | false | true | 0 | 9 | 591 | 631 | 365 | 266 | null | null |
tsiliakis/xmobar | src/Plugins/Monitors/Batt.hs | bsd-3-clause | readBattery sc files =
do a <- grab $ fFull files
b <- grab $ fNow files
d <- grab $ fCurrent files
return $ Battery (3600 * a / sc) -- wattseconds
(3600 * b / sc) -- wattseconds
(d / sc) -- watts
where grab f = handle onError $ withFile f Rea... | 417 | readBattery sc files =
do a <- grab $ fFull files
b <- grab $ fNow files
d <- grab $ fCurrent files
return $ Battery (3600 * a / sc) -- wattseconds
(3600 * b / sc) -- wattseconds
(d / sc) -- watts
where grab f = handle onError $ withFile f Rea... | 417 | readBattery sc files =
do a <- grab $ fFull files
b <- grab $ fNow files
d <- grab $ fCurrent files
return $ Battery (3600 * a / sc) -- wattseconds
(3600 * b / sc) -- wattseconds
(d / sc) -- watts
where grab f = handle onError $ withFile f Rea... | 417 | false | false | 1 | 11 | 155 | 170 | 80 | 90 | null | null |
Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Core/TypeInfo.hs | mit | typeInfoGetTypeName :: (Parent TypeInfo a, Pointer p a, MonadIO m)
=> p -- ^ Pointer to type info
-> m String
typeInfoGetTypeName p = liftIO $ do
let ptr = parentPointer p
loadConstUrhoString =<< [C.exp| const String* { &$(TypeInfo* ptr)->GetTypeName() } |]
-- | Return base type info. | 294 | typeInfoGetTypeName :: (Parent TypeInfo a, Pointer p a, MonadIO m)
=> p -- ^ Pointer to type info
-> m String
typeInfoGetTypeName p = liftIO $ do
let ptr = parentPointer p
loadConstUrhoString =<< [C.exp| const String* { &$(TypeInfo* ptr)->GetTypeName() } |]
-- | Return base type info. | 294 | typeInfoGetTypeName p = liftIO $ do
let ptr = parentPointer p
loadConstUrhoString =<< [C.exp| const String* { &$(TypeInfo* ptr)->GetTypeName() } |]
-- | Return base type info. | 180 | false | true | 0 | 11 | 56 | 82 | 41 | 41 | null | null |
danr/hipspec | examples/Russel.hs | gpl-3.0 | prop2 x = russel x =:= False | 28 | prop2 x = russel x =:= False | 28 | prop2 x = russel x =:= False | 28 | false | false | 0 | 6 | 6 | 16 | 7 | 9 | null | null |
urbanslug/ghc | testsuite/tests/indexed-types/should_run/T2985.hs | bsd-3-clause | main = print test1 | 18 | main = print test1 | 18 | main = print test1 | 18 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
chiro/tchhh | src/TL.hs | mit | showTL (SDelete d) = putStrLn $ T.concat ["Delete: ", showT (delUserId d), " " ,showT (delId d)] | 96 | showTL (SDelete d) = putStrLn $ T.concat ["Delete: ", showT (delUserId d), " " ,showT (delId d)] | 96 | showTL (SDelete d) = putStrLn $ T.concat ["Delete: ", showT (delUserId d), " " ,showT (delId d)] | 96 | false | false | 0 | 10 | 16 | 54 | 27 | 27 | null | null |
aaronc/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | constDocs (B8 w) = "The eight-bit value 0x" ++
showIntAtBase 16 intToDigit w "" | 150 | constDocs (B8 w) = "The eight-bit value 0x" ++
showIntAtBase 16 intToDigit w "" | 150 | constDocs (B8 w) = "The eight-bit value 0x" ++
showIntAtBase 16 intToDigit w "" | 150 | false | false | 0 | 6 | 84 | 29 | 13 | 16 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/S3BucketCorsRule.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-allowedmethods
sbcrAllowedMethods :: Lens' S3BucketCorsRule (ValList Text)
sbcrAllowedMethods = lens _s3BucketCorsRuleAllowedMethods (\s a -> s { _s3BucketCorsRuleAllowedMethods = a... | 323 | sbcrAllowedMethods :: Lens' S3BucketCorsRule (ValList Text)
sbcrAllowedMethods = lens _s3BucketCorsRuleAllowedMethods (\s a -> s { _s3BucketCorsRuleAllowedMethods = a }) | 169 | sbcrAllowedMethods = lens _s3BucketCorsRuleAllowedMethods (\s a -> s { _s3BucketCorsRuleAllowedMethods = a }) | 109 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
bitemyapp/ghc | libraries/base/GHC/IO/Handle/Internals.hs | bsd-3-clause | checkReadableHandle :: (Handle__ -> IO a) -> Handle__ -> IO a
checkReadableHandle act h_@Handle__{..} =
case haType of
ClosedHandle -> ioe_closedHandle
SemiClosedHandle -> ioe_closedHandle
AppendHandle -> ioe_notReadable
WriteHandle -> ioe_notReadable
ReadW... | 1,005 | checkReadableHandle :: (Handle__ -> IO a) -> Handle__ -> IO a
checkReadableHandle act h_@Handle__{..} =
case haType of
ClosedHandle -> ioe_closedHandle
SemiClosedHandle -> ioe_closedHandle
AppendHandle -> ioe_notReadable
WriteHandle -> ioe_notReadable
ReadW... | 1,005 | checkReadableHandle act h_@Handle__{..} =
case haType of
ClosedHandle -> ioe_closedHandle
SemiClosedHandle -> ioe_closedHandle
AppendHandle -> ioe_notReadable
WriteHandle -> ioe_notReadable
ReadWriteHandle -> do
-- a read/write handle and we ... | 943 | false | true | 0 | 18 | 308 | 202 | 96 | 106 | null | null |
bgamari/minir | MinIR/OrderedIndex.hs | bsd-3-clause | firsts :: V.Vector a -> [V.Vector a]
firsts xs | V.length xs < 2 = [xs]
| otherwise = map (\n->V.take n xs) [2..V.length xs] | 140 | firsts :: V.Vector a -> [V.Vector a]
firsts xs | V.length xs < 2 = [xs]
| otherwise = map (\n->V.take n xs) [2..V.length xs] | 140 | firsts xs | V.length xs < 2 = [xs]
| otherwise = map (\n->V.take n xs) [2..V.length xs] | 103 | false | true | 0 | 10 | 40 | 88 | 42 | 46 | null | null |
BlairArchibald/bones | lib/src/Bones/Skeletons/BranchAndBound/HdpH/GlobalRegistry.hs | bsd-3-clause | addGlobalSearchSpaceToRegistry :: IORef a -> IO ()
addGlobalSearchSpaceToRegistry = addRefToRegistry searchSpaceKey | 115 | addGlobalSearchSpaceToRegistry :: IORef a -> IO ()
addGlobalSearchSpaceToRegistry = addRefToRegistry searchSpaceKey | 115 | addGlobalSearchSpaceToRegistry = addRefToRegistry searchSpaceKey | 64 | false | true | 0 | 8 | 10 | 31 | 13 | 18 | null | null |
olorin/amazonka | gen/src/Gen/AST/Data/Syntax.hs | mpl-2.0 | str :: Text -> Exp
str = Exts.Lit . String . Text.unpack | 56 | str :: Text -> Exp
str = Exts.Lit . String . Text.unpack | 56 | str = Exts.Lit . String . Text.unpack | 37 | false | true | 0 | 7 | 11 | 34 | 15 | 19 | null | null |
gcampax/ghc | compiler/main/HscTypes.hs | bsd-3-clause | -- | Get annotations from modules "below" this one (in the dependency sense)
hptAnns :: HscEnv -> Maybe [(ModuleName, IsBootInterface)] -> [Annotation]
hptAnns hsc_env (Just deps) = hptSomeThingsBelowUs (md_anns . hm_details) False hsc_env deps | 244 | hptAnns :: HscEnv -> Maybe [(ModuleName, IsBootInterface)] -> [Annotation]
hptAnns hsc_env (Just deps) = hptSomeThingsBelowUs (md_anns . hm_details) False hsc_env deps | 167 | hptAnns hsc_env (Just deps) = hptSomeThingsBelowUs (md_anns . hm_details) False hsc_env deps | 92 | true | true | 0 | 9 | 33 | 66 | 34 | 32 | null | null |
yshklarov/hopty | Numeric/Optimization/Hopty.hs | unlicense | patternsearch :: RealFloat a =>
a -- ^ Initial step size
-> ([a] -> a) -- ^ Function to minimize
-> [a] -- ^ Starting point
-> [a] -- ^ Local minimum point
patternsearch stepsize f x
| stepsize < epsilon = x -- Success.
-- F... | 875 | patternsearch :: RealFloat a =>
a -- ^ Initial step size
-> ([a] -> a) -- ^ Function to minimize
-> [a] -- ^ Starting point
-> [a]
patternsearch stepsize f x
| stepsize < epsilon = x -- Success.
-- FIXME: the following takes too lon... | 842 | patternsearch stepsize f x
| stepsize < epsilon = x -- Success.
-- FIXME: the following takes too long, is there a better way to detect it?
| or (map isInfinite x) = x -- Failure: diverged to infinity.
| or (map isNaN x) = x
| x == nextx = patternsearch (stepsize/2) f nextx
| otherwis... | 633 | true | true | 3 | 11 | 322 | 258 | 128 | 130 | null | null |
5HT/n2o.hs | sample/server.hs | isc | sub pubSub channel id = modifyMVar_ pubSub $ return . I.insert (ChannelData channel id) | 87 | sub pubSub channel id = modifyMVar_ pubSub $ return . I.insert (ChannelData channel id) | 87 | sub pubSub channel id = modifyMVar_ pubSub $ return . I.insert (ChannelData channel id) | 87 | false | false | 0 | 8 | 13 | 39 | 17 | 22 | null | null |
ozgurakgun/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | annotationColour ist (AnnName n _ _ _) =
let ctxt = tt_ctxt ist
theme = idris_colourTheme ist
in case () of
_ | isDConName n ctxt -> Just $ dataColour theme
_ | isFnName n ctxt -> Just $ functionColour theme
_ | isTConName n ctxt -> Just $ typeColour theme
_ | isPostu... | 443 | annotationColour ist (AnnName n _ _ _) =
let ctxt = tt_ctxt ist
theme = idris_colourTheme ist
in case () of
_ | isDConName n ctxt -> Just $ dataColour theme
_ | isFnName n ctxt -> Just $ functionColour theme
_ | isTConName n ctxt -> Just $ typeColour theme
_ | isPostu... | 443 | annotationColour ist (AnnName n _ _ _) =
let ctxt = tt_ctxt ist
theme = idris_colourTheme ist
in case () of
_ | isDConName n ctxt -> Just $ dataColour theme
_ | isFnName n ctxt -> Just $ functionColour theme
_ | isTConName n ctxt -> Just $ typeColour theme
_ | isPostu... | 443 | false | false | 0 | 13 | 141 | 160 | 70 | 90 | null | null |
dflemstr/ship | Ship.hs | gpl-3.0 | shipBoost :: Lens Ship Bool
shipBoost = stateBoost . shipState | 62 | shipBoost :: Lens Ship Bool
shipBoost = stateBoost . shipState | 62 | shipBoost = stateBoost . shipState | 34 | false | true | 0 | 5 | 9 | 20 | 10 | 10 | null | null |
gbaz/cabal | cabal-install/Main.hs | bsd-3-clause | initAction :: InitFlags -> [String] -> Action
initAction initFlags extraArgs globalFlags = do
when (extraArgs /= []) $
die $ "'init' doesn't take any extra arguments: " ++ unwords extraArgs
let verbosity = fromFlag (initVerbosity initFlags)
(_useSandbox, config) <- loadConfigOrSandboxConfig verbosity
... | 766 | initAction :: InitFlags -> [String] -> Action
initAction initFlags extraArgs globalFlags = do
when (extraArgs /= []) $
die $ "'init' doesn't take any extra arguments: " ++ unwords extraArgs
let verbosity = fromFlag (initVerbosity initFlags)
(_useSandbox, config) <- loadConfigOrSandboxConfig verbosity
... | 766 | initAction initFlags extraArgs globalFlags = do
when (extraArgs /= []) $
die $ "'init' doesn't take any extra arguments: " ++ unwords extraArgs
let verbosity = fromFlag (initVerbosity initFlags)
(_useSandbox, config) <- loadConfigOrSandboxConfig verbosity
(globalFlags { globalRequir... | 720 | false | true | 0 | 13 | 192 | 194 | 95 | 99 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.