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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
smurphy8/onping-permissions | test/Permissions/Onping/GraphSpec.hs | bsd-3-clause | main :: IO ()
main = hspec spec | 31 | main :: IO ()
main = hspec spec | 31 | main = hspec spec | 17 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
johanneshilden/trombone | Trombone/Parse.hs | bsd-3-clause | -- | An optional list of field names used for db routes.
hints :: Parser [Text]
hints = char '(' *> elements <* char ')' | 120 | hints :: Parser [Text]
hints = char '(' *> elements <* char ')' | 63 | hints = char '(' *> elements <* char ')' | 40 | true | true | 4 | 7 | 24 | 41 | 19 | 22 | null | null |
jthornber/language-c-ejt | src/Language/C/Analysis/TravMonad.hs | bsd-3-clause | put :: TravState s -> Trav s ()
put s = Trav (\_ -> Right ((),s)) | 68 | put :: TravState s -> Trav s ()
put s = Trav (\_ -> Right ((),s)) | 68 | put s = Trav (\_ -> Right ((),s)) | 36 | false | true | 0 | 10 | 18 | 53 | 26 | 27 | null | null |
karamellpelle/grid | designer/source/LevelTools/Do/Input.hs | gpl-3.0 | mySucc n =
n + 1 | 20 | mySucc n =
n + 1 | 20 | mySucc n =
n + 1 | 20 | false | false | 0 | 5 | 9 | 13 | 6 | 7 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Resource/Compute/URLMaps/List.hs | mpl-2.0 | -- | Sets a filter expression for filtering listed resources, in the form
-- filter={expression}. Your {expression} must be in the format: field_name
-- comparison_string literal_string. The field_name is the name of the
-- field you want to compare. Only atomic field types are supported
-- (string, number, boolean). The comparison_string must be either eq
-- (equals) or ne (not equals). The literal_string is the string value to
-- filter to. The literal value must be valid for the type of field you are
-- filtering by (string, number, boolean). For string fields, the literal
-- value is interpreted as a regular expression using RE2 syntax. The
-- literal value must match the entire field. For example, to filter for
-- instances that do not have a name of example-instance, you would use
-- filter=name ne example-instance. You can filter on nested fields. For
-- example, you could filter on instances that have set the
-- scheduling.automaticRestart field to true. Use filtering on nested
-- fields to take advantage of labels to organize and search for results
-- based on label values. To filter on multiple expressions, provide each
-- separate expression within parentheses. For example,
-- (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple
-- expressions are treated as AND expressions, meaning that resources must
-- match all expressions to pass the filters.
umlFilter :: Lens' URLMapsList (Maybe Text)
umlFilter
= lens _umlFilter (\ s a -> s{_umlFilter = a}) | 1,502 | umlFilter :: Lens' URLMapsList (Maybe Text)
umlFilter
= lens _umlFilter (\ s a -> s{_umlFilter = a}) | 102 | umlFilter
= lens _umlFilter (\ s a -> s{_umlFilter = a}) | 58 | true | true | 0 | 9 | 241 | 67 | 44 | 23 | null | null |
mrgaaron/dcpu-16 | src/haskell/Assembler.hs | bsd-2-clause | genRegisterHex (Register "Z") = 0x05 :: Word16 | 46 | genRegisterHex (Register "Z") = 0x05 :: Word16 | 46 | genRegisterHex (Register "Z") = 0x05 :: Word16 | 46 | false | false | 0 | 7 | 6 | 18 | 9 | 9 | null | null |
micknelso/language-c | src/Language/CFamily/C/Analysis/TypeUtils.hs | bsd-3-clause | getFloatType LitFloatLongDouble = TyLDouble | 43 | getFloatType LitFloatLongDouble = TyLDouble | 43 | getFloatType LitFloatLongDouble = TyLDouble | 43 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
jwiegley/ghc-release | libraries/transformers/Control/Monad/Trans/RWS/Strict.hs | gpl-3.0 | -- ---------------------------------------------------------------------------
-- Writer operations
-- | Construct a writer computation from a (result, output) pair.
writer :: Monad m => (a, w) -> RWST r w s m a
writer (a, w) = RWST $ \_ s -> return (a, s, w) | 260 | writer :: Monad m => (a, w) -> RWST r w s m a
writer (a, w) = RWST $ \_ s -> return (a, s, w) | 93 | writer (a, w) = RWST $ \_ s -> return (a, s, w) | 47 | true | true | 2 | 9 | 43 | 79 | 42 | 37 | null | null |
ekmett/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | -- CF_HDROP
wxDF_LOCALE :: Int
wxDF_LOCALE = 16 | 53 | wxDF_LOCALE :: Int
wxDF_LOCALE = 16 | 40 | wxDF_LOCALE = 16 | 21 | true | true | 0 | 6 | 13 | 19 | 8 | 11 | null | null |
gleachkr/Carnap | Carnap/src/Carnap/Languages/Util/GenericParsers.hs | gpl-3.0 | parseSchematicConstant ::
( IndexedSchemeConstantLanguage (FixLang lex ret)
, Typeable ret
, Monad m
) => ParsecT String u m (FixLang lex ret)
parseSchematicConstant = parse <?> "a constant"
where parse = do c <- oneOf "τπμ"
midx <- optionMaybe (char '_' >> posnumber)
let Just n = elemIndex c "τπμ"
m = maybe 0 id midx
return $ taun (n + (m * 3))
--------------------------------------------------------
--Structural Elements
-------------------------------------------------------- | 595 | parseSchematicConstant ::
( IndexedSchemeConstantLanguage (FixLang lex ret)
, Typeable ret
, Monad m
) => ParsecT String u m (FixLang lex ret)
parseSchematicConstant = parse <?> "a constant"
where parse = do c <- oneOf "τπμ"
midx <- optionMaybe (char '_' >> posnumber)
let Just n = elemIndex c "τπμ"
m = maybe 0 id midx
return $ taun (n + (m * 3))
--------------------------------------------------------
--Structural Elements
-------------------------------------------------------- | 595 | parseSchematicConstant = parse <?> "a constant"
where parse = do c <- oneOf "τπμ"
midx <- optionMaybe (char '_' >> posnumber)
let Just n = elemIndex c "τπμ"
m = maybe 0 id midx
return $ taun (n + (m * 3))
--------------------------------------------------------
--Structural Elements
-------------------------------------------------------- | 435 | false | true | 1 | 13 | 179 | 164 | 77 | 87 | null | null |
brendanhay/gogol | gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs | mpl-2.0 | -- | The ID of the Merchant Center account.
lsgagarAccountId :: Lens' LiaSettingsGetAccessibleGmbAccountsResponse (Maybe Word64)
lsgagarAccountId
= lens _lsgagarAccountId
(\ s a -> s{_lsgagarAccountId = a})
. mapping _Coerce | 238 | lsgagarAccountId :: Lens' LiaSettingsGetAccessibleGmbAccountsResponse (Maybe Word64)
lsgagarAccountId
= lens _lsgagarAccountId
(\ s a -> s{_lsgagarAccountId = a})
. mapping _Coerce | 194 | lsgagarAccountId
= lens _lsgagarAccountId
(\ s a -> s{_lsgagarAccountId = a})
. mapping _Coerce | 109 | true | true | 0 | 10 | 42 | 55 | 28 | 27 | null | null |
gamelost/pcgen-rules | src/Restrictions.hs | apache-2.0 | parsePreProfWithShield :: PParser PreProficiency
parsePreProfWithShield = parsePreProficency "PREPROFWITHSHIELD" | 112 | parsePreProfWithShield :: PParser PreProficiency
parsePreProfWithShield = parsePreProficency "PREPROFWITHSHIELD" | 112 | parsePreProfWithShield = parsePreProficency "PREPROFWITHSHIELD" | 63 | false | true | 0 | 5 | 7 | 17 | 8 | 9 | null | null |
SAdams601/HaRe | old/refactorer/RefacDupTrans.hs | bsd-3-clause | itemIsImportedByDefault serverModName (HsModule _ _ _ imps _)
= any (isImportedByDefault' serverModName) imps
where
isImportedByDefault' serverModName ((HsImportDecl _ (SN modName _) _ _ h)::HsImportDeclP)
= serverModName == modName && ( isNothing h || (isJust h && fst(fromJust h))) | 300 | itemIsImportedByDefault serverModName (HsModule _ _ _ imps _)
= any (isImportedByDefault' serverModName) imps
where
isImportedByDefault' serverModName ((HsImportDecl _ (SN modName _) _ _ h)::HsImportDeclP)
= serverModName == modName && ( isNothing h || (isJust h && fst(fromJust h))) | 300 | itemIsImportedByDefault serverModName (HsModule _ _ _ imps _)
= any (isImportedByDefault' serverModName) imps
where
isImportedByDefault' serverModName ((HsImportDecl _ (SN modName _) _ _ h)::HsImportDeclP)
= serverModName == modName && ( isNothing h || (isJust h && fst(fromJust h))) | 300 | false | false | 3 | 11 | 54 | 119 | 57 | 62 | null | null |
rueshyna/gogol | gogol-debugger/gen/Network/Google/Resource/CloudDebugger/Controller/Debuggees/Breakpoints/List.hs | mpl-2.0 | -- | If set to \`true\`, returns \`google.rpc.Code.OK\` status and sets the
-- \`wait_expired\` response field to \`true\` when the server-selected
-- timeout has expired (recommended). If set to \`false\`, returns
-- \`google.rpc.Code.ABORTED\` status when the server-selected timeout has
-- expired (deprecated).
cdblSuccessOnTimeout :: Lens' ControllerDebuggeesBreakpointsList (Maybe Bool)
cdblSuccessOnTimeout
= lens _cdblSuccessOnTimeout
(\ s a -> s{_cdblSuccessOnTimeout = a}) | 490 | cdblSuccessOnTimeout :: Lens' ControllerDebuggeesBreakpointsList (Maybe Bool)
cdblSuccessOnTimeout
= lens _cdblSuccessOnTimeout
(\ s a -> s{_cdblSuccessOnTimeout = a}) | 175 | cdblSuccessOnTimeout
= lens _cdblSuccessOnTimeout
(\ s a -> s{_cdblSuccessOnTimeout = a}) | 97 | true | true | 0 | 9 | 66 | 52 | 29 | 23 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/Writers/Docx.hs | gpl-2.0 | inlineToOpenXML opts (Span (_,classes,_) ils) = do
let off x = withTextProp (mknode x [("w:val","0")] ())
((if "csl-no-emph" `elem` classes then off "w:i" else id) .
(if "csl-no-strong" `elem` classes then off "w:b" else id) .
(if "csl-no-smallcaps" `elem` classes then off "w:smallCaps" else id))
$ inlinesToOpenXML opts ils | 338 | inlineToOpenXML opts (Span (_,classes,_) ils) = do
let off x = withTextProp (mknode x [("w:val","0")] ())
((if "csl-no-emph" `elem` classes then off "w:i" else id) .
(if "csl-no-strong" `elem` classes then off "w:b" else id) .
(if "csl-no-smallcaps" `elem` classes then off "w:smallCaps" else id))
$ inlinesToOpenXML opts ils | 338 | inlineToOpenXML opts (Span (_,classes,_) ils) = do
let off x = withTextProp (mknode x [("w:val","0")] ())
((if "csl-no-emph" `elem` classes then off "w:i" else id) .
(if "csl-no-strong" `elem` classes then off "w:b" else id) .
(if "csl-no-smallcaps" `elem` classes then off "w:smallCaps" else id))
$ inlinesToOpenXML opts ils | 338 | false | false | 0 | 14 | 61 | 147 | 80 | 67 | null | null |
petertseng/adventofcode-hs | bin/09_hamiltonian.hs | apache-2.0 | places :: [Distance] -> [String]
-- Assumption about input ordering:
-- a to b
-- a to c
-- a to d
-- ...
-- b to c
-- given this ordering, just looks at all the a's and extracts their paired location.
places [] = [] | 216 | places :: [Distance] -> [String]
places [] = [] | 47 | places [] = [] | 14 | true | true | 0 | 6 | 46 | 35 | 22 | 13 | null | null |
keera-studios/hsQt | Qtc/Enums/Gui/QCompleter.hs | bsd-2-clause | eCaseInsensitivelySortedModel :: ModelSorting
eCaseInsensitivelySortedModel
= ieModelSorting $ 2 | 98 | eCaseInsensitivelySortedModel :: ModelSorting
eCaseInsensitivelySortedModel
= ieModelSorting $ 2 | 98 | eCaseInsensitivelySortedModel
= ieModelSorting $ 2 | 52 | false | true | 0 | 6 | 9 | 18 | 8 | 10 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F08.hs | bsd-3-clause | ptr_glFramebufferRenderbufferEXT :: FunPtr (GLenum -> GLenum -> GLenum -> GLuint -> IO ())
ptr_glFramebufferRenderbufferEXT = unsafePerformIO $ getCommand "glFramebufferRenderbufferEXT" | 185 | ptr_glFramebufferRenderbufferEXT :: FunPtr (GLenum -> GLenum -> GLenum -> GLuint -> IO ())
ptr_glFramebufferRenderbufferEXT = unsafePerformIO $ getCommand "glFramebufferRenderbufferEXT" | 185 | ptr_glFramebufferRenderbufferEXT = unsafePerformIO $ getCommand "glFramebufferRenderbufferEXT" | 94 | false | true | 1 | 12 | 18 | 48 | 22 | 26 | null | null |
facebookincubator/duckling | Duckling/Quantity/NL/Rules.hs | bsd-3-clause | ruleQuantityOfProduct :: Rule
ruleQuantityOfProduct = Rule
{ name = "<quantity> product"
, pattern =
[ dimension Quantity
, regex "(\\w+)"
]
, prod = \case
(Token Quantity qd:Token RegexMatch (GroupMatch (product:_)):_) ->
Just . Token Quantity $ withProduct (Text.toLower product) qd
_ -> Nothing
} | 333 | ruleQuantityOfProduct :: Rule
ruleQuantityOfProduct = Rule
{ name = "<quantity> product"
, pattern =
[ dimension Quantity
, regex "(\\w+)"
]
, prod = \case
(Token Quantity qd:Token RegexMatch (GroupMatch (product:_)):_) ->
Just . Token Quantity $ withProduct (Text.toLower product) qd
_ -> Nothing
} | 333 | ruleQuantityOfProduct = Rule
{ name = "<quantity> product"
, pattern =
[ dimension Quantity
, regex "(\\w+)"
]
, prod = \case
(Token Quantity qd:Token RegexMatch (GroupMatch (product:_)):_) ->
Just . Token Quantity $ withProduct (Text.toLower product) qd
_ -> Nothing
} | 303 | false | true | 0 | 18 | 78 | 125 | 62 | 63 | null | null |
sdiehl/pretty-latex | Text/Latex.hs | mit | wrap :: Doc -> Doc -> Doc -> Doc
wrap l r body = left l <+> body <+> right r | 76 | wrap :: Doc -> Doc -> Doc -> Doc
wrap l r body = left l <+> body <+> right r | 76 | wrap l r body = left l <+> body <+> right r | 43 | false | true | 0 | 7 | 20 | 44 | 21 | 23 | null | null |
xenog/haskoin | src/Network/Haskoin/Script/Evaluator.hs | unlicense | eval OP_IFDUP = tStack1 $ \a -> if decodeBool a then [a, a] else [a] | 70 | eval OP_IFDUP = tStack1 $ \a -> if decodeBool a then [a, a] else [a] | 70 | eval OP_IFDUP = tStack1 $ \a -> if decodeBool a then [a, a] else [a] | 70 | false | false | 3 | 8 | 16 | 43 | 21 | 22 | null | null |
lessrest/koko | src/Koko/Types.hs | gpl-3.0 | mapAnns :: (Ann -> Ann) -> UxprR v -> UxprR v
mapAnns f (U a expr) = U (f a) u'
where
u' = case expr of
EVar v -> EVar v
EApp u us -> EApp (mapAnns f u) (map (mapAnns f) us)
EAbs s -> EAbs (toScope (mapAnns f (fromScope s)))
ESeq us -> ESeq (map (mapAnns f) us)
EArr us -> EArr (map (mapAnns f) us)
ESym s -> ESym s
EFun s -> EFun s
ENil -> ENil | 439 | mapAnns :: (Ann -> Ann) -> UxprR v -> UxprR v
mapAnns f (U a expr) = U (f a) u'
where
u' = case expr of
EVar v -> EVar v
EApp u us -> EApp (mapAnns f u) (map (mapAnns f) us)
EAbs s -> EAbs (toScope (mapAnns f (fromScope s)))
ESeq us -> ESeq (map (mapAnns f) us)
EArr us -> EArr (map (mapAnns f) us)
ESym s -> ESym s
EFun s -> EFun s
ENil -> ENil | 439 | mapAnns f (U a expr) = U (f a) u'
where
u' = case expr of
EVar v -> EVar v
EApp u us -> EApp (mapAnns f u) (map (mapAnns f) us)
EAbs s -> EAbs (toScope (mapAnns f (fromScope s)))
ESeq us -> ESeq (map (mapAnns f) us)
EArr us -> EArr (map (mapAnns f) us)
ESym s -> ESym s
EFun s -> EFun s
ENil -> ENil | 393 | false | true | 0 | 14 | 175 | 232 | 108 | 124 | null | null |
kazu-yamamoto/http2 | Network/HPACK/Table/Dynamic.hs | bsd-3-clause | shouldRenew :: DynamicTable -> Size -> IO Bool
shouldRenew DynamicTable{..} maxsiz = do
maxdsize <- readIORef maxDynamicTableSize
return $ maxdsize /= maxsiz
----------------------------------------------------------------
-- | Creating 'DynamicTable' for encoding,
-- performing the action and
-- clearing the 'DynamicTable'. | 340 | shouldRenew :: DynamicTable -> Size -> IO Bool
shouldRenew DynamicTable{..} maxsiz = do
maxdsize <- readIORef maxDynamicTableSize
return $ maxdsize /= maxsiz
----------------------------------------------------------------
-- | Creating 'DynamicTable' for encoding,
-- performing the action and
-- clearing the 'DynamicTable'. | 340 | shouldRenew DynamicTable{..} maxsiz = do
maxdsize <- readIORef maxDynamicTableSize
return $ maxdsize /= maxsiz
----------------------------------------------------------------
-- | Creating 'DynamicTable' for encoding,
-- performing the action and
-- clearing the 'DynamicTable'. | 293 | false | true | 0 | 8 | 51 | 58 | 29 | 29 | null | null |
Min-/BioParsers | src/MergeFastq.hs | bsd-3-clause | example = do
f1 <- T.readFile "../data/s1.1000.fastq"
return $ parseFq f1 | 77 | example = do
f1 <- T.readFile "../data/s1.1000.fastq"
return $ parseFq f1 | 77 | example = do
f1 <- T.readFile "../data/s1.1000.fastq"
return $ parseFq f1 | 77 | false | false | 0 | 9 | 14 | 28 | 12 | 16 | null | null |
dec9ue/jhc_copygc | src/FrontEnd/Warning.hs | gpl-2.0 | processIOErrors :: IO ()
processIOErrors = do
ws <- readIORef ioWarnings
processErrors' True ws
writeIORef ioWarnings []
-- | just show IO errors and return whether it would have died | 196 | processIOErrors :: IO ()
processIOErrors = do
ws <- readIORef ioWarnings
processErrors' True ws
writeIORef ioWarnings []
-- | just show IO errors and return whether it would have died | 196 | processIOErrors = do
ws <- readIORef ioWarnings
processErrors' True ws
writeIORef ioWarnings []
-- | just show IO errors and return whether it would have died | 171 | false | true | 0 | 9 | 42 | 51 | 21 | 30 | null | null |
elitak/hs-datahand | stm32f10x/hs_src/Data/Accessor/Example.hs | gpl-3.0 | array :: Array.Array Int Char
array =
Container.array 7 ^: toUpper $
Container.array 2 ^= 'z' $
Array.listArray (0,9) ['a'..] | 134 | array :: Array.Array Int Char
array =
Container.array 7 ^: toUpper $
Container.array 2 ^= 'z' $
Array.listArray (0,9) ['a'..] | 134 | array =
Container.array 7 ^: toUpper $
Container.array 2 ^= 'z' $
Array.listArray (0,9) ['a'..] | 104 | false | true | 1 | 10 | 28 | 63 | 30 | 33 | null | null |
rudymatela/leancheck | src/Test/LeanCheck/Stats.hs | bsd-3-clause | countsTOn :: Eq b => (a -> b) -> [[a]] -> [(b,Int,[Int])]
countsTOn f = countsT . mapT f | 90 | countsTOn :: Eq b => (a -> b) -> [[a]] -> [(b,Int,[Int])]
countsTOn f = countsT . mapT f | 90 | countsTOn f = countsT . mapT f | 32 | false | true | 0 | 10 | 20 | 64 | 35 | 29 | null | null |
AmkG/merchants-race | Merch/Race/Data/TMap.hs | gpl-3.0 | settlementAtTMap :: Monad m =>
TMap -> HexCoord -> m (Settlement, SettlementType)
settlementAtTMap tmap h = do
let v = Map.lookup h $ settlemapTMap tmap
case v of
Just v -> return v
Nothing -> fail "No settlement." | 247 | settlementAtTMap :: Monad m =>
TMap -> HexCoord -> m (Settlement, SettlementType)
settlementAtTMap tmap h = do
let v = Map.lookup h $ settlemapTMap tmap
case v of
Just v -> return v
Nothing -> fail "No settlement." | 247 | settlementAtTMap tmap h = do
let v = Map.lookup h $ settlemapTMap tmap
case v of
Just v -> return v
Nothing -> fail "No settlement." | 145 | false | true | 0 | 12 | 70 | 89 | 41 | 48 | null | null |
dboulytchev/generic-transformers | papers/EPTCS/sybdemo/app/Length.hs | lgpl-2.1 | add :: Length -> Length -> Length
add (Length (Foo _ x)) (Length (Foo _ y)) | (x<0) || (y<0) = undefined | 104 | add :: Length -> Length -> Length
add (Length (Foo _ x)) (Length (Foo _ y)) | (x<0) || (y<0) = undefined | 104 | add (Length (Foo _ x)) (Length (Foo _ y)) | (x<0) || (y<0) = undefined | 70 | false | true | 0 | 12 | 21 | 82 | 39 | 43 | null | null |
joranvar/GoogleCodeJam | Y2010/Q/B.hs | gpl-3.0 | parse [] = [] | 13 | parse [] = [] | 13 | parse [] = [] | 13 | false | false | 0 | 6 | 3 | 13 | 6 | 7 | null | null |
thielema/gitit | Network/Gitit/Framework.hs | gpl-2.0 | -- | Returns the filestore path of the file containing the page's source.
pathForPage :: String -> FilePath
pathForPage page = page <.> "page" | 142 | pathForPage :: String -> FilePath
pathForPage page = page <.> "page" | 68 | pathForPage page = page <.> "page" | 34 | true | true | 3 | 7 | 23 | 31 | 14 | 17 | null | null |
eborden/redeux | src/Redeux/DOM.hs | bsd-3-clause | strong_ = el_ "strong" | 24 | strong_ = el_ "strong" | 24 | strong_ = el_ "strong" | 24 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
webhooq/webhooq-client-haskell-HTTP | src/Network/HTTP/Webhooq.hs | bsd-3-clause | header_exchange = HdrCustom "x-wq-exchange" | 47 | header_exchange = HdrCustom "x-wq-exchange" | 47 | header_exchange = HdrCustom "x-wq-exchange" | 47 | false | false | 1 | 5 | 7 | 13 | 4 | 9 | null | null |
projectorhq/haskell-liquid | test/Text/Liquid/ParserTests.hs | bsd-3-clause | case_ifLogic4 = parseOnly ifLogic "{% if 1 == a %}{{abc}} ok{% endif %}" @?=
Right (IfLogic (IfClause (Equal (Num $ sc 1) (Variable $ ObjectIndex "a" :| [])))
(TrueStatements [(Output $ Variable $ ObjectIndex "abc" :| []), (RawText " ok")])) | 260 | case_ifLogic4 = parseOnly ifLogic "{% if 1 == a %}{{abc}} ok{% endif %}" @?=
Right (IfLogic (IfClause (Equal (Num $ sc 1) (Variable $ ObjectIndex "a" :| [])))
(TrueStatements [(Output $ Variable $ ObjectIndex "abc" :| []), (RawText " ok")])) | 260 | case_ifLogic4 = parseOnly ifLogic "{% if 1 == a %}{{abc}} ok{% endif %}" @?=
Right (IfLogic (IfClause (Equal (Num $ sc 1) (Variable $ ObjectIndex "a" :| [])))
(TrueStatements [(Output $ Variable $ ObjectIndex "abc" :| []), (RawText " ok")])) | 260 | false | false | 1 | 15 | 58 | 109 | 52 | 57 | null | null |
fydio/HigherLower | src/Main.hs | bsd-3-clause | createGame :: IO Game
createGame = do
low <- retryPrompt "Not a number" (promptInt "Give a lower bound")
high <- retryPrompt "Not a number" (promptInt "Give an upper bound")
turns <- retryPrompt "Not a number" (promptInt "How many tries do you get?")
secret <- getStdRandom (randomR (low, high))
return (Game (low, high) secret (Active turns)) | 353 | createGame :: IO Game
createGame = do
low <- retryPrompt "Not a number" (promptInt "Give a lower bound")
high <- retryPrompt "Not a number" (promptInt "Give an upper bound")
turns <- retryPrompt "Not a number" (promptInt "How many tries do you get?")
secret <- getStdRandom (randomR (low, high))
return (Game (low, high) secret (Active turns)) | 353 | createGame = do
low <- retryPrompt "Not a number" (promptInt "Give a lower bound")
high <- retryPrompt "Not a number" (promptInt "Give an upper bound")
turns <- retryPrompt "Not a number" (promptInt "How many tries do you get?")
secret <- getStdRandom (randomR (low, high))
return (Game (low, high) secret (Active turns)) | 331 | false | true | 0 | 11 | 64 | 118 | 56 | 62 | null | null |
brendanhay/gogol | gogol-dataproc/gen/Network/Google/Dataproc/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'ClusterMetricsHdfsMetrics' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cmhmAddtional'
clusterMetricsHdfsMetrics
:: HashMap Text Int64 -- ^ 'cmhmAddtional'
-> ClusterMetricsHdfsMetrics
clusterMetricsHdfsMetrics pCmhmAddtional_ =
ClusterMetricsHdfsMetrics' {_cmhmAddtional = _Coerce # pCmhmAddtional_} | 424 | clusterMetricsHdfsMetrics
:: HashMap Text Int64 -- ^ 'cmhmAddtional'
-> ClusterMetricsHdfsMetrics
clusterMetricsHdfsMetrics pCmhmAddtional_ =
ClusterMetricsHdfsMetrics' {_cmhmAddtional = _Coerce # pCmhmAddtional_} | 223 | clusterMetricsHdfsMetrics pCmhmAddtional_ =
ClusterMetricsHdfsMetrics' {_cmhmAddtional = _Coerce # pCmhmAddtional_} | 117 | true | true | 0 | 7 | 62 | 41 | 24 | 17 | null | null |
purefn/hiplambda | src/HipBot/HipLambda/Hoogle.hs | bsd-3-clause | toNotification :: [Result] -> Notification
toNotification =
let
linkModule rurl (murl, m) =
let url' = if murl == takeWhile (/= '#') rurl then rurl else murl
in mconcat
[ "<a href=\""
, T.pack url'
, "\">"
, T.pack m
, "</a>"
]
modules (rurl, ms) = T.unwords . fmap (linkModule rurl) $ ms
format r = mconcat
[ "<p>"
, "<a href=\""
, T.pack . fst . head . Hoogle.locations $ r
, "\">"
, T.pack . showTagHTML . Hoogle.self $ r
, "</a> in "
, T.intercalate ", " . fmap modules . Hoogle.locations $ r
, "</p>"
]
msg = mconcat . take 3 . fmap format
in
htmlNotification . msg | 708 | toNotification :: [Result] -> Notification
toNotification =
let
linkModule rurl (murl, m) =
let url' = if murl == takeWhile (/= '#') rurl then rurl else murl
in mconcat
[ "<a href=\""
, T.pack url'
, "\">"
, T.pack m
, "</a>"
]
modules (rurl, ms) = T.unwords . fmap (linkModule rurl) $ ms
format r = mconcat
[ "<p>"
, "<a href=\""
, T.pack . fst . head . Hoogle.locations $ r
, "\">"
, T.pack . showTagHTML . Hoogle.self $ r
, "</a> in "
, T.intercalate ", " . fmap modules . Hoogle.locations $ r
, "</p>"
]
msg = mconcat . take 3 . fmap format
in
htmlNotification . msg | 708 | toNotification =
let
linkModule rurl (murl, m) =
let url' = if murl == takeWhile (/= '#') rurl then rurl else murl
in mconcat
[ "<a href=\""
, T.pack url'
, "\">"
, T.pack m
, "</a>"
]
modules (rurl, ms) = T.unwords . fmap (linkModule rurl) $ ms
format r = mconcat
[ "<p>"
, "<a href=\""
, T.pack . fst . head . Hoogle.locations $ r
, "\">"
, T.pack . showTagHTML . Hoogle.self $ r
, "</a> in "
, T.intercalate ", " . fmap modules . Hoogle.locations $ r
, "</p>"
]
msg = mconcat . take 3 . fmap format
in
htmlNotification . msg | 665 | false | true | 0 | 16 | 251 | 249 | 130 | 119 | null | null |
fmapfmapfmap/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs | mpl-2.0 | -- | A description of the import snapshot task.
istDescription :: Lens' ImportSnapshotTask (Maybe Text)
istDescription = lens _istDescription (\ s a -> s{_istDescription = a}) | 175 | istDescription :: Lens' ImportSnapshotTask (Maybe Text)
istDescription = lens _istDescription (\ s a -> s{_istDescription = a}) | 127 | istDescription = lens _istDescription (\ s a -> s{_istDescription = a}) | 71 | true | true | 0 | 9 | 25 | 46 | 25 | 21 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F30.hs | bsd-3-clause | -- glVertexAttrib2svNV ---------------------------------------------------------
-- | This command is an alias for 'glVertexAttrib2sv'.
glVertexAttrib2svNV
:: MonadIO m
=> GLuint -- ^ @index@.
-> Ptr GLshort -- ^ @v@ pointing to @2@ elements of type @GLshort@.
-> m ()
glVertexAttrib2svNV v1 v2 = liftIO $ dyn883 ptr_glVertexAttrib2svNV v1 v2 | 351 | glVertexAttrib2svNV
:: MonadIO m
=> GLuint -- ^ @index@.
-> Ptr GLshort -- ^ @v@ pointing to @2@ elements of type @GLshort@.
-> m ()
glVertexAttrib2svNV v1 v2 = liftIO $ dyn883 ptr_glVertexAttrib2svNV v1 v2 | 214 | glVertexAttrib2svNV v1 v2 = liftIO $ dyn883 ptr_glVertexAttrib2svNV v1 v2 | 73 | true | true | 0 | 10 | 55 | 58 | 28 | 30 | null | null |
bravit/Idris-dev | src/Idris/Coverage.hs | bsd-3-clause | validCoverageCase ctxt (Elaborating _ _ _ e) = validCoverageCase ctxt e | 71 | validCoverageCase ctxt (Elaborating _ _ _ e) = validCoverageCase ctxt e | 71 | validCoverageCase ctxt (Elaborating _ _ _ e) = validCoverageCase ctxt e | 71 | false | false | 0 | 7 | 10 | 28 | 13 | 15 | null | null |
kmate/raw-feldspar-mcs | src/Feldspar/Multicore/Compile/Parallella/Channel.hs | bsd-3-clause | compNewCoreChan :: forall a. CoreChanAllocCMD (Param3 RunGen Prim PrimType) (CoreChan a) -> RunGen (CoreChan a)
compNewCoreChan cmd@(NewChan f t sz)
| isCoreToCore = do
let (r, c) = groupCoord t
bty = cType (Proxy :: Proxy Bool)
arg = proxyArg cmd
cty = compType (proxyPred cmd) arg
(isOpen :: DLArr Bool, _) <- allocLocal bty t 1
(isFull :: DLArr Bool, _) <- allocLocal bty t 1
(buf :: LArr (Data a), _) <- allocLocal cty t sz
groupAddr <- gets group
lift $ do
addInclude "<feldspar-parallella.h>"
callProc "init_core_chan"
[ groupAddr
, valArg $ value r
, valArg $ value c
, arrArg $ unwrapArr isOpen
, arrArg $ unwrapArr isFull
]
return $ CoreChanComp $ CoreChanRep
[ arrArg $ unwrapArr buf, arrArg $ unwrapArr isOpen, arrArg $ unwrapArr isFull ]
| otherwise = do
let cid = if f == hostId then t else f
(r, c) = groupCoord cid
bty = cType (Proxy :: Proxy Bool)
arg = proxyArg cmd
cty = compType (proxyPred cmd) arg
(isOpen :: DLArr Bool, _) <- allocLocal bty cid 1
(isFull :: DLArr Bool, _) <- allocLocal bty cid 1
(buf :: SArr (Data a), shmRef) <- allocShared cty sz
groupAddr <- gets group
hostChan <- lift $ do
addInclude "<feldspar-parallella.h>"
chan <- objArg <$> newNamedObject "chan" "host_chan_t" False
callProc "init_host_chan"
[ addr chan
, groupAddr
, valArg $ value r
, valArg $ value c
, shmRef
, arrArg $ unwrapArr isOpen
, arrArg $ unwrapArr isFull
]
return chan
return $ CoreChanComp $ HostChanRep hostChan
[ arrArg $ unwrapArr buf, arrArg $ unwrapArr isOpen, arrArg $ unwrapArr isFull ]
where
isCoreToCore = f Prelude./= hostId Prelude.&& t Prelude./= hostId | 2,113 | compNewCoreChan :: forall a. CoreChanAllocCMD (Param3 RunGen Prim PrimType) (CoreChan a) -> RunGen (CoreChan a)
compNewCoreChan cmd@(NewChan f t sz)
| isCoreToCore = do
let (r, c) = groupCoord t
bty = cType (Proxy :: Proxy Bool)
arg = proxyArg cmd
cty = compType (proxyPred cmd) arg
(isOpen :: DLArr Bool, _) <- allocLocal bty t 1
(isFull :: DLArr Bool, _) <- allocLocal bty t 1
(buf :: LArr (Data a), _) <- allocLocal cty t sz
groupAddr <- gets group
lift $ do
addInclude "<feldspar-parallella.h>"
callProc "init_core_chan"
[ groupAddr
, valArg $ value r
, valArg $ value c
, arrArg $ unwrapArr isOpen
, arrArg $ unwrapArr isFull
]
return $ CoreChanComp $ CoreChanRep
[ arrArg $ unwrapArr buf, arrArg $ unwrapArr isOpen, arrArg $ unwrapArr isFull ]
| otherwise = do
let cid = if f == hostId then t else f
(r, c) = groupCoord cid
bty = cType (Proxy :: Proxy Bool)
arg = proxyArg cmd
cty = compType (proxyPred cmd) arg
(isOpen :: DLArr Bool, _) <- allocLocal bty cid 1
(isFull :: DLArr Bool, _) <- allocLocal bty cid 1
(buf :: SArr (Data a), shmRef) <- allocShared cty sz
groupAddr <- gets group
hostChan <- lift $ do
addInclude "<feldspar-parallella.h>"
chan <- objArg <$> newNamedObject "chan" "host_chan_t" False
callProc "init_host_chan"
[ addr chan
, groupAddr
, valArg $ value r
, valArg $ value c
, shmRef
, arrArg $ unwrapArr isOpen
, arrArg $ unwrapArr isFull
]
return chan
return $ CoreChanComp $ HostChanRep hostChan
[ arrArg $ unwrapArr buf, arrArg $ unwrapArr isOpen, arrArg $ unwrapArr isFull ]
where
isCoreToCore = f Prelude./= hostId Prelude.&& t Prelude./= hostId | 2,113 | compNewCoreChan cmd@(NewChan f t sz)
| isCoreToCore = do
let (r, c) = groupCoord t
bty = cType (Proxy :: Proxy Bool)
arg = proxyArg cmd
cty = compType (proxyPred cmd) arg
(isOpen :: DLArr Bool, _) <- allocLocal bty t 1
(isFull :: DLArr Bool, _) <- allocLocal bty t 1
(buf :: LArr (Data a), _) <- allocLocal cty t sz
groupAddr <- gets group
lift $ do
addInclude "<feldspar-parallella.h>"
callProc "init_core_chan"
[ groupAddr
, valArg $ value r
, valArg $ value c
, arrArg $ unwrapArr isOpen
, arrArg $ unwrapArr isFull
]
return $ CoreChanComp $ CoreChanRep
[ arrArg $ unwrapArr buf, arrArg $ unwrapArr isOpen, arrArg $ unwrapArr isFull ]
| otherwise = do
let cid = if f == hostId then t else f
(r, c) = groupCoord cid
bty = cType (Proxy :: Proxy Bool)
arg = proxyArg cmd
cty = compType (proxyPred cmd) arg
(isOpen :: DLArr Bool, _) <- allocLocal bty cid 1
(isFull :: DLArr Bool, _) <- allocLocal bty cid 1
(buf :: SArr (Data a), shmRef) <- allocShared cty sz
groupAddr <- gets group
hostChan <- lift $ do
addInclude "<feldspar-parallella.h>"
chan <- objArg <$> newNamedObject "chan" "host_chan_t" False
callProc "init_host_chan"
[ addr chan
, groupAddr
, valArg $ value r
, valArg $ value c
, shmRef
, arrArg $ unwrapArr isOpen
, arrArg $ unwrapArr isFull
]
return chan
return $ CoreChanComp $ HostChanRep hostChan
[ arrArg $ unwrapArr buf, arrArg $ unwrapArr isOpen, arrArg $ unwrapArr isFull ]
where
isCoreToCore = f Prelude./= hostId Prelude.&& t Prelude./= hostId | 2,001 | false | true | 0 | 15 | 812 | 690 | 333 | 357 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/HTMLCollection.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection.item Mozilla HTMLCollection.item documentation>
item_ ::
(MonadDOM m, IsHTMLCollection self) => self -> Word -> m ()
item_ self index
= liftDOM
(void ((toHTMLCollection self) ^. jsf "item" [toJSVal index])) | 291 | item_ ::
(MonadDOM m, IsHTMLCollection self) => self -> Word -> m ()
item_ self index
= liftDOM
(void ((toHTMLCollection self) ^. jsf "item" [toJSVal index])) | 172 | item_ self index
= liftDOM
(void ((toHTMLCollection self) ^. jsf "item" [toJSVal index])) | 97 | true | true | 0 | 12 | 46 | 78 | 39 | 39 | null | null |
jbalint/banshee-sympatico | meera/dl2.hs | mit | subsumedBy :: Concept -> Concept -> Bool
subsumedBy (And subsumedCs) (And subsumerCs) = (foldl . flip) ((&&) . isJust) True $ map (`findSubsumed` subsumedCs) subsumerCs | 168 | subsumedBy :: Concept -> Concept -> Bool
subsumedBy (And subsumedCs) (And subsumerCs) = (foldl . flip) ((&&) . isJust) True $ map (`findSubsumed` subsumedCs) subsumerCs | 168 | subsumedBy (And subsumedCs) (And subsumerCs) = (foldl . flip) ((&&) . isJust) True $ map (`findSubsumed` subsumedCs) subsumerCs | 127 | false | true | 0 | 8 | 24 | 72 | 39 | 33 | null | null |
honux77/dailyCode | 20180826/hyunuk.hs | mit | main = do
[n, k] <- (map read . words) `fmap` getLine
t <- getLine
let o = overlap t
putStrLn (concat (replicate k (take o t)) ++ drop o t) | 155 | main = do
[n, k] <- (map read . words) `fmap` getLine
t <- getLine
let o = overlap t
putStrLn (concat (replicate k (take o t)) ++ drop o t) | 155 | main = do
[n, k] <- (map read . words) `fmap` getLine
t <- getLine
let o = overlap t
putStrLn (concat (replicate k (take o t)) ++ drop o t) | 155 | false | false | 1 | 15 | 46 | 95 | 44 | 51 | null | null |
bananu7/Hate | samples/arkanoid.hs | mit | x :: Functor f => (GL.GLfloat -> f GL.GLfloat) -> GL.Vertex2 GL.GLfloat -> f (GL.Vertex2 GL.GLfloat)
x f (GL.Vertex2 vx vy) = fmap (\x' -> GL.Vertex2 x' vy) (f vx) | 163 | x :: Functor f => (GL.GLfloat -> f GL.GLfloat) -> GL.Vertex2 GL.GLfloat -> f (GL.Vertex2 GL.GLfloat)
x f (GL.Vertex2 vx vy) = fmap (\x' -> GL.Vertex2 x' vy) (f vx) | 163 | x f (GL.Vertex2 vx vy) = fmap (\x' -> GL.Vertex2 x' vy) (f vx) | 62 | false | true | 0 | 11 | 29 | 106 | 50 | 56 | null | null |
RaphaelJ/getwebb.org | Handler/Download.hs | gpl-3.0 | streamRawUploadObject :: Bool -> ObjectType -> ContentType -> Hmac
-> Handler TypedContent
streamRawUploadObject commitView objType mime hmac = do
(Entity uploadId _, _, h) <- openUpload hmac objType
streamFileHandle commitView uploadId mime h
-- | Streams a card or a displayable image if it has been generated. | 343 | streamRawUploadObject :: Bool -> ObjectType -> ContentType -> Hmac
-> Handler TypedContent
streamRawUploadObject commitView objType mime hmac = do
(Entity uploadId _, _, h) <- openUpload hmac objType
streamFileHandle commitView uploadId mime h
-- | Streams a card or a displayable image if it has been generated. | 343 | streamRawUploadObject commitView objType mime hmac = do
(Entity uploadId _, _, h) <- openUpload hmac objType
streamFileHandle commitView uploadId mime h
-- | Streams a card or a displayable image if it has been generated. | 230 | false | true | 0 | 9 | 77 | 78 | 38 | 40 | null | null |
bibaijin/cis194 | src/Spring13/Week6/Fibonacci.hs | bsd-3-clause | fib :: Integer -> Integer
fib 0 = 0 | 35 | fib :: Integer -> Integer
fib 0 = 0 | 35 | fib 0 = 0 | 9 | false | true | 0 | 5 | 8 | 22 | 10 | 12 | null | null |
kojiromike/Idris-dev | src/Idris/IBC.hs | bsd-3-clause | processMetaVars :: Archive -> Idris ()
processMetaVars ar = do
ns <- getEntry [] "ibc_metavars" ar
updateIState (\i -> i { idris_metavars = L.reverse ns ++ idris_metavars i })
-- We only want the language extensions when reading the top level thing | 257 | processMetaVars :: Archive -> Idris ()
processMetaVars ar = do
ns <- getEntry [] "ibc_metavars" ar
updateIState (\i -> i { idris_metavars = L.reverse ns ++ idris_metavars i })
-- We only want the language extensions when reading the top level thing | 257 | processMetaVars ar = do
ns <- getEntry [] "ibc_metavars" ar
updateIState (\i -> i { idris_metavars = L.reverse ns ++ idris_metavars i })
-- We only want the language extensions when reading the top level thing | 218 | false | true | 0 | 15 | 50 | 79 | 37 | 42 | null | null |
pcapriotti/pipes-extra | examples/decompress.hs | bsd-3-clause | main :: IO ()
main = runPipe $
handleReader stdin >+> gunzip >+> handleWriter stdout | 86 | main :: IO ()
main = runPipe $
handleReader stdin >+> gunzip >+> handleWriter stdout | 86 | main = runPipe $
handleReader stdin >+> gunzip >+> handleWriter stdout | 72 | false | true | 0 | 8 | 16 | 34 | 16 | 18 | null | null |
gspia/reflex-dom-htmlea | lib/src/Reflex/Dom/HTML5/Elements/Elements.hs | bsd-3-clause | -- | A short-hand notion for @ elDynAttr \"del\" ... @
delD ∷ forall t m a. (DomBuilder t m, PostBuild t m) ⇒ Dynamic t Del → m a → m a
delD bm children = snd <$> delD' bm children | 180 | delD ∷ forall t m a. (DomBuilder t m, PostBuild t m) ⇒ Dynamic t Del → m a → m a
delD bm children = snd <$> delD' bm children | 125 | delD bm children = snd <$> delD' bm children | 44 | true | true | 0 | 9 | 41 | 75 | 37 | 38 | null | null |
nushio3/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | justDataConKey = mkPreludeDataConUnique 9 | 67 | justDataConKey = mkPreludeDataConUnique 9 | 67 | justDataConKey = mkPreludeDataConUnique 9 | 67 | false | false | 0 | 5 | 29 | 9 | 4 | 5 | null | null |
Airtnp/Freshman_Simple_Haskell_Lib | Intro/TAPL/UTLC.hs | mit | getVarName :: Int -> Context -> String
getVarName n ctx
| length ctx > n = ctx !! n
| otherwise = undefined | 120 | getVarName :: Int -> Context -> String
getVarName n ctx
| length ctx > n = ctx !! n
| otherwise = undefined | 120 | getVarName n ctx
| length ctx > n = ctx !! n
| otherwise = undefined | 81 | false | true | 1 | 9 | 35 | 54 | 24 | 30 | null | null |
jystic/mothership | src/Mothership/Site.hs | bsd-3-clause | ------------------------------------------------------------------------
site :: Application ()
site = routes <|> serveDirectory "resources/static"
where
routes = withSplices $ route
[ ("/", home)
, ("/login", method GET newLogin)
, ("/login", method POST login)
, ("/logout", method GET logout)
, ("/signup", method GET newSignup)
, ("/signup", method POST signup)
, ("/repositories/new", method GET newRepo)
, ("/repositories", method POST createRepo)
, ("/:repo", git)
]
------------------------------------------------------------------------ | 628 | site :: Application ()
site = routes <|> serveDirectory "resources/static"
where
routes = withSplices $ route
[ ("/", home)
, ("/login", method GET newLogin)
, ("/login", method POST login)
, ("/logout", method GET logout)
, ("/signup", method GET newSignup)
, ("/signup", method POST signup)
, ("/repositories/new", method GET newRepo)
, ("/repositories", method POST createRepo)
, ("/:repo", git)
]
------------------------------------------------------------------------ | 554 | site = routes <|> serveDirectory "resources/static"
where
routes = withSplices $ route
[ ("/", home)
, ("/login", method GET newLogin)
, ("/login", method POST login)
, ("/logout", method GET logout)
, ("/signup", method GET newSignup)
, ("/signup", method POST signup)
, ("/repositories/new", method GET newRepo)
, ("/repositories", method POST createRepo)
, ("/:repo", git)
]
------------------------------------------------------------------------ | 531 | true | true | 3 | 8 | 141 | 163 | 91 | 72 | null | null |
fmapfmapfmap/amazonka | amazonka-route53/gen/Network/AWS/Route53/Types/Product.hs | mpl-2.0 | -- | The code for a country geo location. The default location uses \'*\' for
-- the country code and will match all locations that are not matched by a
-- geo location.
--
-- The default geo location uses a '*' for the country code. All other
-- country codes follow the ISO 3166 two-character code.
gldCountryCode :: Lens' GeoLocationDetails (Maybe Text)
gldCountryCode = lens _gldCountryCode (\ s a -> s{_gldCountryCode = a}) | 428 | gldCountryCode :: Lens' GeoLocationDetails (Maybe Text)
gldCountryCode = lens _gldCountryCode (\ s a -> s{_gldCountryCode = a}) | 127 | gldCountryCode = lens _gldCountryCode (\ s a -> s{_gldCountryCode = a}) | 71 | true | true | 0 | 9 | 73 | 51 | 30 | 21 | null | null |
rCEx/feldspar-lang-small | examples/Examples/Simple/Basics.hs | bsd-3-clause | -- A constant core vector
example3 :: Data [Int32]
example3 = value [42,1,2,3] | 78 | example3 :: Data [Int32]
example3 = value [42,1,2,3] | 52 | example3 = value [42,1,2,3] | 27 | true | true | 0 | 6 | 12 | 33 | 19 | 14 | null | null |
brendanhay/gogol | gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Flows/Export.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
plafeUploadType :: Lens' ProjectsLocationsAgentsFlowsExport (Maybe Text)
plafeUploadType
= lens _plafeUploadType
(\ s a -> s{_plafeUploadType = a}) | 226 | plafeUploadType :: Lens' ProjectsLocationsAgentsFlowsExport (Maybe Text)
plafeUploadType
= lens _plafeUploadType
(\ s a -> s{_plafeUploadType = a}) | 155 | plafeUploadType
= lens _plafeUploadType
(\ s a -> s{_plafeUploadType = a}) | 82 | true | true | 0 | 8 | 34 | 49 | 25 | 24 | null | null |
ekmett/ghc | compiler/codeGen/StgCmmClosure.hs | bsd-3-clause | mkLFBlackHole :: LambdaFormInfo
mkLFBlackHole = LFBlackHole | 59 | mkLFBlackHole :: LambdaFormInfo
mkLFBlackHole = LFBlackHole | 59 | mkLFBlackHole = LFBlackHole | 27 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
kaoskorobase/mescaline | resources/hugs/packages/base/Data/Set.hs | gpl-3.0 | hedgeUnion cmplo cmphi Tip (Bin _ x l r)
= join x (filterGt cmplo l) (filterLt cmphi r) | 89 | hedgeUnion cmplo cmphi Tip (Bin _ x l r)
= join x (filterGt cmplo l) (filterLt cmphi r) | 89 | hedgeUnion cmplo cmphi Tip (Bin _ x l r)
= join x (filterGt cmplo l) (filterLt cmphi r) | 89 | false | false | 0 | 7 | 19 | 50 | 24 | 26 | null | null |
adarqui/99problems-hs | Experimentation/P04.hs | gpl-3.0 | length_rec :: [a] -> Int
length_rec [] = 0 | 42 | length_rec :: [a] -> Int
length_rec [] = 0 | 42 | length_rec [] = 0 | 17 | false | true | 0 | 6 | 8 | 23 | 12 | 11 | null | null |
noinia/hsync-server | src/HSync/Server/User.hs | bsd-3-clause | updateUser :: User -> Update UserIndex ()
updateUser u = modify (&userIxSet %~ I.updateIx (u^.userId) u) | 106 | updateUser :: User -> Update UserIndex ()
updateUser u = modify (&userIxSet %~ I.updateIx (u^.userId) u) | 106 | updateUser u = modify (&userIxSet %~ I.updateIx (u^.userId) u) | 62 | false | true | 0 | 10 | 17 | 50 | 25 | 25 | null | null |
iljakuklic/eel-proto | src/Builtins/Types.hs | bsd-3-clause | -- | Phase-polymorphic function helper
z ~~> y = fun (TyVar . genTyVar . mkRow $ z ++ y) z y | 92 | z ~~> y = fun (TyVar . genTyVar . mkRow $ z ++ y) z y | 53 | z ~~> y = fun (TyVar . genTyVar . mkRow $ z ++ y) z y | 53 | true | false | 3 | 10 | 20 | 42 | 19 | 23 | null | null |
dmjio/miso | examples/router/Main.hs | bsd-3-clause | -- | Type-safe links used in `onClick` event handlers to route the application
goAbout, goHome :: Action
(goHome, goAbout) = (goto api home, goto api about)
where
#if MIN_VERSION_servant(0,10,0)
goto a b = ChangeURI (linkURI (safeLink a b))
#else
goto a b = ChangeURI (safeLink a b)
#endif
home = Proxy :: Proxy Home
about = Proxy :: Proxy About
api = Proxy :: Proxy API | 395 | goAbout, goHome :: Action
(goHome, goAbout) = (goto api home, goto api about)
where
#if MIN_VERSION_servant(0,10,0)
goto a b = ChangeURI (linkURI (safeLink a b))
#else
goto a b = ChangeURI (safeLink a b)
#endif
home = Proxy :: Proxy Home
about = Proxy :: Proxy About
api = Proxy :: Proxy API | 316 | (goHome, goAbout) = (goto api home, goto api about)
where
#if MIN_VERSION_servant(0,10,0)
goto a b = ChangeURI (linkURI (safeLink a b))
#else
goto a b = ChangeURI (safeLink a b)
#endif
home = Proxy :: Proxy Home
about = Proxy :: Proxy About
api = Proxy :: Proxy API | 290 | true | true | 6 | 9 | 90 | 104 | 56 | 48 | null | null |
Philonous/hs-jingle | source/Network/Xmpp/Xep/Jingle/Picklers.hs | mit | reasonSelector GeneralError = 8 | 43 | reasonSelector GeneralError = 8 | 43 | reasonSelector GeneralError = 8 | 43 | false | false | 0 | 5 | 15 | 9 | 4 | 5 | null | null |
icyfork/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkInexplicablyUnquoted2 = verifyNot checkInexplicablyUnquoted "'foo'*" | 78 | prop_checkInexplicablyUnquoted2 = verifyNot checkInexplicablyUnquoted "'foo'*" | 78 | prop_checkInexplicablyUnquoted2 = verifyNot checkInexplicablyUnquoted "'foo'*" | 78 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
aavogt/DimMat | DimMat/Internal.hs | bsd-3-clause | arctan2 :: (bs ~ MapMapConst DOne as) => D '(a,as) e -> D '(a,as) e -> D '(b,bs) e
arctan2 (DMat a) (DMat b) = DMat (H.arctan2 a b) | 131 | arctan2 :: (bs ~ MapMapConst DOne as) => D '(a,as) e -> D '(a,as) e -> D '(b,bs) e
arctan2 (DMat a) (DMat b) = DMat (H.arctan2 a b) | 131 | arctan2 (DMat a) (DMat b) = DMat (H.arctan2 a b) | 48 | false | true | 0 | 10 | 28 | 104 | 53 | 51 | null | null |
zaxtax/naive_bayes | News.hs | bsd-3-clause | getNews :: Maybe Int -> [Int] -> IO (Vector Int, Vector Int, Vector Int)
getNews maxDocs topics = fmap (asArrays . removeSingletons) $ run enc
where
enc = case maxDocs of
Nothing -> fmap (!!! topics) $ encodeDirs path
Just d -> fmap (map (take d) . (!!! topics)) $ encodeDirs path | 293 | getNews :: Maybe Int -> [Int] -> IO (Vector Int, Vector Int, Vector Int)
getNews maxDocs topics = fmap (asArrays . removeSingletons) $ run enc
where
enc = case maxDocs of
Nothing -> fmap (!!! topics) $ encodeDirs path
Just d -> fmap (map (take d) . (!!! topics)) $ encodeDirs path | 293 | getNews maxDocs topics = fmap (asArrays . removeSingletons) $ run enc
where
enc = case maxDocs of
Nothing -> fmap (!!! topics) $ encodeDirs path
Just d -> fmap (map (take d) . (!!! topics)) $ encodeDirs path | 220 | false | true | 1 | 14 | 64 | 146 | 69 | 77 | null | null |
Kheldar/hw-koans | test/Check/Either.hs | bsd-3-clause | toK (P.Right b) = K.Right b | 27 | toK (P.Right b) = K.Right b | 27 | toK (P.Right b) = K.Right b | 27 | false | false | 0 | 8 | 5 | 22 | 10 | 12 | null | null |
motiz88/postgrest | src/PostgREST/DbStructure.hs | mit | decodeTables :: HD.Result [Table]
decodeTables =
HD.rowsList tblRow
where
tblRow = Table <$> HD.value HD.text <*> HD.value HD.text
<*> HD.value HD.bool | 173 | decodeTables :: HD.Result [Table]
decodeTables =
HD.rowsList tblRow
where
tblRow = Table <$> HD.value HD.text <*> HD.value HD.text
<*> HD.value HD.bool | 173 | decodeTables =
HD.rowsList tblRow
where
tblRow = Table <$> HD.value HD.text <*> HD.value HD.text
<*> HD.value HD.bool | 139 | false | true | 0 | 9 | 42 | 65 | 31 | 34 | null | null |
databrary/databrary | src/Model/Measure.hs | agpl-3.0 | measuresJSON :: JSON.ToObject o => Bool -> Measures -> o
measuresJSON publicRestricted = foldMap (measureJSONPair publicRestricted) | 131 | measuresJSON :: JSON.ToObject o => Bool -> Measures -> o
measuresJSON publicRestricted = foldMap (measureJSONPair publicRestricted) | 131 | measuresJSON publicRestricted = foldMap (measureJSONPair publicRestricted) | 74 | false | true | 0 | 7 | 15 | 40 | 19 | 21 | null | null |
XinhuaZhang/PetaVisionHaskell | PetaVision/Data/Pooling.hs | gpl-3.0 | gridNum :: Int -> Int -> Int -> Int -> Int
gridNum poolSize stride nx' ny' =
L.length (startPointList nx') * L.length (startPointList ny')
where
startPointList len =
L.filter (\i -> i + poolSize <= len) [0,stride .. len - 1] | 238 | gridNum :: Int -> Int -> Int -> Int -> Int
gridNum poolSize stride nx' ny' =
L.length (startPointList nx') * L.length (startPointList ny')
where
startPointList len =
L.filter (\i -> i + poolSize <= len) [0,stride .. len - 1] | 238 | gridNum poolSize stride nx' ny' =
L.length (startPointList nx') * L.length (startPointList ny')
where
startPointList len =
L.filter (\i -> i + poolSize <= len) [0,stride .. len - 1] | 195 | false | true | 2 | 10 | 54 | 119 | 56 | 63 | null | null |
dysinger/amazonka | amazonka-storagegateway/gen/Network/AWS/StorageGateway/ListVolumeRecoveryPoints.hs | mpl-2.0 | -- | 'ListVolumeRecoveryPoints' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'lvrpGatewayARN' @::@ 'Text'
--
listVolumeRecoveryPoints :: Text -- ^ 'lvrpGatewayARN'
-> ListVolumeRecoveryPoints
listVolumeRecoveryPoints p1 = ListVolumeRecoveryPoints
{ _lvrpGatewayARN = p1
} | 342 | listVolumeRecoveryPoints :: Text -- ^ 'lvrpGatewayARN'
-> ListVolumeRecoveryPoints
listVolumeRecoveryPoints p1 = ListVolumeRecoveryPoints
{ _lvrpGatewayARN = p1
} | 195 | listVolumeRecoveryPoints p1 = ListVolumeRecoveryPoints
{ _lvrpGatewayARN = p1
} | 87 | true | true | 0 | 7 | 69 | 37 | 22 | 15 | null | null |
alexstachnik/High-Level-C | src/Language/HLC/Quasi/QuasiC.hs | gpl-2.0 | matchExpression :: Data b => b -> Maybe TH.ExpQ
matchExpression x =
let y = cast x :: (Maybe (CExpression NodeInfo)) in
case y of
Just (CVar (Ident str hash _) info) ->
case take 2 str of
"$$" -> error "Type variable occured in expression context"
('$' : _) -> Just $ do
let infoTH = dataToExpQ (const Nothing) info
TH.appE (TH.varE (TH.mkName $ drop 1 str)) infoTH
_ -> Nothing
_ -> Nothing | 453 | matchExpression :: Data b => b -> Maybe TH.ExpQ
matchExpression x =
let y = cast x :: (Maybe (CExpression NodeInfo)) in
case y of
Just (CVar (Ident str hash _) info) ->
case take 2 str of
"$$" -> error "Type variable occured in expression context"
('$' : _) -> Just $ do
let infoTH = dataToExpQ (const Nothing) info
TH.appE (TH.varE (TH.mkName $ drop 1 str)) infoTH
_ -> Nothing
_ -> Nothing | 453 | matchExpression x =
let y = cast x :: (Maybe (CExpression NodeInfo)) in
case y of
Just (CVar (Ident str hash _) info) ->
case take 2 str of
"$$" -> error "Type variable occured in expression context"
('$' : _) -> Just $ do
let infoTH = dataToExpQ (const Nothing) info
TH.appE (TH.varE (TH.mkName $ drop 1 str)) infoTH
_ -> Nothing
_ -> Nothing | 405 | false | true | 0 | 21 | 136 | 189 | 90 | 99 | null | null |
paldepind/dffptch-haskell | Dffptch/Internal.hs | mit | getKeys :: Object -> V.Vector Text
getKeys = V.fromList . sort . H.keys | 71 | getKeys :: Object -> V.Vector Text
getKeys = V.fromList . sort . H.keys | 71 | getKeys = V.fromList . sort . H.keys | 36 | false | true | 0 | 8 | 12 | 38 | 17 | 21 | null | null |
urv/fixhs | src/Data/FIX/Spec/FIX42.hs | lgpl-2.1 | tUnderlyingSecurityType :: FIXTag
tUnderlyingSecurityType = FIXTag
{ tName = "UnderlyingSecurityType"
, tnum = 310
, tparser = toFIXString
, arbitraryValue = FIXString <$> arbitrary } | 196 | tUnderlyingSecurityType :: FIXTag
tUnderlyingSecurityType = FIXTag
{ tName = "UnderlyingSecurityType"
, tnum = 310
, tparser = toFIXString
, arbitraryValue = FIXString <$> arbitrary } | 196 | tUnderlyingSecurityType = FIXTag
{ tName = "UnderlyingSecurityType"
, tnum = 310
, tparser = toFIXString
, arbitraryValue = FIXString <$> arbitrary } | 162 | false | true | 0 | 8 | 37 | 45 | 26 | 19 | null | null |
brendanhay/gogol | gogol-datastore/gen/Network/Google/Datastore/Types/Product.hs | mpl-2.0 | -- | A value parameter.
gqpValue :: Lens' GqlQueryParameter (Maybe Value)
gqpValue = lens _gqpValue (\ s a -> s{_gqpValue = a}) | 127 | gqpValue :: Lens' GqlQueryParameter (Maybe Value)
gqpValue = lens _gqpValue (\ s a -> s{_gqpValue = a}) | 103 | gqpValue = lens _gqpValue (\ s a -> s{_gqpValue = a}) | 53 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
vTurbine/ghc | compiler/prelude/TysPrim.hs | bsd-3-clause | word64PrimTyCon :: TyCon
word64PrimTyCon = pcPrimTyCon0 word64PrimTyConName Word64Rep | 85 | word64PrimTyCon :: TyCon
word64PrimTyCon = pcPrimTyCon0 word64PrimTyConName Word64Rep | 85 | word64PrimTyCon = pcPrimTyCon0 word64PrimTyConName Word64Rep | 60 | false | true | 0 | 5 | 7 | 16 | 8 | 8 | null | null |
rblaze/private-cloud | src/PrivateCloud/Cloud/Sync.hs | apache-2.0 | getAllFileChanges :: LocalFileList -> DbFileList -> CloudFileList -> PrivateCloud p [FileAction]
getAllFileChanges local db cloud = do
root <- rootDir
patterns <- exclusions
let dropExclusions = filterGlob patterns
getFileChanges False root (dropExclusions local) (dropExclusions db) (dropExclusions cloud) | 322 | getAllFileChanges :: LocalFileList -> DbFileList -> CloudFileList -> PrivateCloud p [FileAction]
getAllFileChanges local db cloud = do
root <- rootDir
patterns <- exclusions
let dropExclusions = filterGlob patterns
getFileChanges False root (dropExclusions local) (dropExclusions db) (dropExclusions cloud) | 322 | getAllFileChanges local db cloud = do
root <- rootDir
patterns <- exclusions
let dropExclusions = filterGlob patterns
getFileChanges False root (dropExclusions local) (dropExclusions db) (dropExclusions cloud) | 225 | false | true | 0 | 11 | 52 | 102 | 46 | 56 | null | null |
patrickboe/artery | Box.hs | mit | bound (Point x1 y1) (Point x2 y2) =
Box (Point (min x1 x2) (min y1 y2)) (Point (max x1 x2) (max y1 y2)) | 105 | bound (Point x1 y1) (Point x2 y2) =
Box (Point (min x1 x2) (min y1 y2)) (Point (max x1 x2) (max y1 y2)) | 105 | bound (Point x1 y1) (Point x2 y2) =
Box (Point (min x1 x2) (min y1 y2)) (Point (max x1 x2) (max y1 y2)) | 105 | false | false | 0 | 9 | 24 | 80 | 39 | 41 | null | null |
eiji-a/aya | src/Aya/Geometry.hs | bsd-3-clause | frontObjects :: Double -> Shape -> Ray -> [PreDistance]
frontObjects err shp ray = [x | x <- (distance shp ray), isFront err x] | 127 | frontObjects :: Double -> Shape -> Ray -> [PreDistance]
frontObjects err shp ray = [x | x <- (distance shp ray), isFront err x] | 127 | frontObjects err shp ray = [x | x <- (distance shp ray), isFront err x] | 71 | false | true | 0 | 9 | 23 | 61 | 31 | 30 | null | null |
robertmassaioli/htee | Main.hs | bsd-3-clause | main :: IO ()
main = do
args <- getArgs
case getOpt Permute options args of
(flags, nonOpts, []) -> handleFlags flags nonOpts
(_, _, msgs) -> error $ concat msgs ++ usageInfo header options | 221 | main :: IO ()
main = do
args <- getArgs
case getOpt Permute options args of
(flags, nonOpts, []) -> handleFlags flags nonOpts
(_, _, msgs) -> error $ concat msgs ++ usageInfo header options | 221 | main = do
args <- getArgs
case getOpt Permute options args of
(flags, nonOpts, []) -> handleFlags flags nonOpts
(_, _, msgs) -> error $ concat msgs ++ usageInfo header options | 207 | false | true | 0 | 12 | 66 | 90 | 45 | 45 | null | null |
alang9/deque | Data/Deque/NonCat/LessTyped.hs | bsd-3-clause | fixup2' (BigR (XR (B2 a b) (B0)) N (TinyL (B3 (P s t) (P u v) (P w x)))) = go8 a b s t u v w x | 120 | fixup2' (BigR (XR (B2 a b) (B0)) N (TinyL (B3 (P s t) (P u v) (P w x)))) = go8 a b s t u v w x | 120 | fixup2' (BigR (XR (B2 a b) (B0)) N (TinyL (B3 (P s t) (P u v) (P w x)))) = go8 a b s t u v w x | 120 | false | false | 0 | 12 | 54 | 96 | 47 | 49 | null | null |
rodrigogribeiro/mptc | src/Iface/ClassInstCollector.hs | bsd-3-clause | unInst x = unsupportedDeclMsg x | 31 | unInst x = unsupportedDeclMsg x | 31 | unInst x = unsupportedDeclMsg x | 31 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
brendanhay/gogol | gogol-adsense-host/gen/Network/Google/AdSenseHost/Types/Product.hs | mpl-2.0 | -- | Continuation token used to page through ad units. To retrieve the next
-- page of results, set the next request\'s \"pageToken\" value to this.
auNextPageToken :: Lens' AdUnits (Maybe Text)
auNextPageToken
= lens _auNextPageToken
(\ s a -> s{_auNextPageToken = a}) | 277 | auNextPageToken :: Lens' AdUnits (Maybe Text)
auNextPageToken
= lens _auNextPageToken
(\ s a -> s{_auNextPageToken = a}) | 128 | auNextPageToken
= lens _auNextPageToken
(\ s a -> s{_auNextPageToken = a}) | 82 | true | true | 0 | 9 | 50 | 49 | 26 | 23 | null | null |
ababkin/railoscopy | src/Haste/Perch.hs | mit | h1 cont = nelem "h1" `child` cont | 34 | h1 cont = nelem "h1" `child` cont | 34 | h1 cont = nelem "h1" `child` cont | 34 | false | false | 0 | 6 | 7 | 18 | 9 | 9 | null | null |
peti/funcmp | FMP/File.hs | gpl-3.0 | getParameters :: IO Parameters
getParameters = fileExists "fmp.ini"
(readFile "fmp.ini"
>>= \p-> let tok = tokens p
in
return (scanParameters tok stdParameters))
(\_ -> return stdParameters) | 434 | getParameters :: IO Parameters
getParameters = fileExists "fmp.ini"
(readFile "fmp.ini"
>>= \p-> let tok = tokens p
in
return (scanParameters tok stdParameters))
(\_ -> return stdParameters) | 434 | getParameters = fileExists "fmp.ini"
(readFile "fmp.ini"
>>= \p-> let tok = tokens p
in
return (scanParameters tok stdParameters))
(\_ -> return stdParameters) | 387 | false | true | 0 | 12 | 269 | 80 | 36 | 44 | null | null |
iemxblog/ulci | src/Evaluation.hs | gpl-2.0 | eval :: LExpr -> LExpr
eval e = case end e of
True -> e
False -> eval (evalStep e) | 106 | eval :: LExpr -> LExpr
eval e = case end e of
True -> e
False -> eval (evalStep e) | 106 | eval e = case end e of
True -> e
False -> eval (evalStep e) | 83 | false | true | 0 | 10 | 43 | 51 | 23 | 28 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/Resources/ElasticLoadBalancingLoadBalancer.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-elbname
elblbLoadBalancerName :: Lens' ElasticLoadBalancingLoadBalancer (Maybe (Val Text))
elblbLoadBalancerName = lens _elasticLoadBalancingLoadBalancerLoadBalancerName (\s a -> s { _elasticLoadBalancingLoadBalancerLoadBalancerName = a }) | 346 | elblbLoadBalancerName :: Lens' ElasticLoadBalancingLoadBalancer (Maybe (Val Text))
elblbLoadBalancerName = lens _elasticLoadBalancingLoadBalancerLoadBalancerName (\s a -> s { _elasticLoadBalancingLoadBalancerLoadBalancerName = a }) | 231 | elblbLoadBalancerName = lens _elasticLoadBalancingLoadBalancerLoadBalancerName (\s a -> s { _elasticLoadBalancingLoadBalancerLoadBalancerName = a }) | 148 | true | true | 0 | 9 | 22 | 52 | 28 | 24 | null | null |
kawu/ltag | src/NLP/LTAG/Earley5.hs | bsd-2-clause | tryScan
:: (VOrd t, VOrd n, VOrd a, VOrd f)
=> StateE n t f a
-> Earley n t f a ()
tryScan (StateE p) = void $ runMaybeT $ do
-- check that the state expects a terminal on the right
(Term t, right') <- expects p
-- read the word immediately following the ending position of
-- the state
c <- readInput $ end p
-- make sure that what the rule expects is consistent with
-- the input
guard $ c == t
-- construct the resultant state
let p' = p
{ end = end p + 1
, left = Term t : left p
, right = right' }
-- print logging information
lift . lift $ do
putStr "[S] " >> printState p
putStr " : " >> printState p'
-- push the resulting state into the waiting queue
lift $ pushState $ StateE p'
--------------------------------------------------
-- SUBST
--------------------------------------------------
-- | Try to use the state (only if fully parsed) to complement
-- (=> substitution) other rules. | 1,023 | tryScan
:: (VOrd t, VOrd n, VOrd a, VOrd f)
=> StateE n t f a
-> Earley n t f a ()
tryScan (StateE p) = void $ runMaybeT $ do
-- check that the state expects a terminal on the right
(Term t, right') <- expects p
-- read the word immediately following the ending position of
-- the state
c <- readInput $ end p
-- make sure that what the rule expects is consistent with
-- the input
guard $ c == t
-- construct the resultant state
let p' = p
{ end = end p + 1
, left = Term t : left p
, right = right' }
-- print logging information
lift . lift $ do
putStr "[S] " >> printState p
putStr " : " >> printState p'
-- push the resulting state into the waiting queue
lift $ pushState $ StateE p'
--------------------------------------------------
-- SUBST
--------------------------------------------------
-- | Try to use the state (only if fully parsed) to complement
-- (=> substitution) other rules. | 1,023 | tryScan (StateE p) = void $ runMaybeT $ do
-- check that the state expects a terminal on the right
(Term t, right') <- expects p
-- read the word immediately following the ending position of
-- the state
c <- readInput $ end p
-- make sure that what the rule expects is consistent with
-- the input
guard $ c == t
-- construct the resultant state
let p' = p
{ end = end p + 1
, left = Term t : left p
, right = right' }
-- print logging information
lift . lift $ do
putStr "[S] " >> printState p
putStr " : " >> printState p'
-- push the resulting state into the waiting queue
lift $ pushState $ StateE p'
--------------------------------------------------
-- SUBST
--------------------------------------------------
-- | Try to use the state (only if fully parsed) to complement
-- (=> substitution) other rules. | 928 | false | true | 0 | 14 | 301 | 235 | 118 | 117 | null | null |
SKA-ScienceDataProcessor/RC | MS4/dna-programs/imaging.hs | apache-2.0 | -- | The main program actor. Estimates the cost for all "DataSet"s using the
-- "estimateActor", followed by optimally scheduling "workerActor"s on
-- all available nodes as determined by the "balancer".
mainActor :: Actor (Config, [DataSet]) (FileChan Image)
mainActor = actor $ \(cfg, dataSets) -> do
-- Check that we actually have enough nodes. The local node counts.
let setCount = length dataSets
avail <- availableNodes
when (setCount > avail + 1) $
fail $ "Not enough nodes: Require " ++ show setCount ++ " to run data sets!"
-- Allocate estimation nodes
--
-- DSL: This construct tells to spawn actor for every item in a
-- list. Essentially it's distributed map.
estimateWorkers <- startGroup (N (setCount-1)) (NNodes 1) $ do
useLocal
return $(mkStaticClosure 'estimateActor)
distributeWork dataSets (const (map ((,) cfg))) estimateWorkers
-- Run estimation, collect weighted data sets
grp <- delayGroup estimateWorkers
weightedDataSets <- gather grp (flip (:)) []
logMessage "Weight Table:"
forM_ weightedDataSets $ \(ds, w) ->
logMessage $ show (fromRational w :: Float) ++ " - " ++ show (dsName ds)
-- Schedule work
let fullTime (ds, weight) = fromRational weight * fromIntegral (dsRepeats ds)
schedule = balancer (avail+1) (map fullTime weightedDataSets)
splitData low high dataSet =
let atRatio r = floor $ r * fromIntegral (dsRepeats dataSet)
in dataSet { dsRepeats = atRatio high - atRatio low }
dist = distributer splitData schedule (map fst weightedDataSets)
logMessage ("Schedule: " ++ show schedule)
forM_ (zip [1..] dist) $ \(i,ds) ->
logMessage (show (i :: Int) ++ ": " ++ show (dsRepeats ds) ++ " x " ++ show (dsName ds))
-- Now start worker actors
waitForResources estimateWorkers
workers <- startGroup (N avail) (NNodes 1) $ do
useLocal
return $(mkStaticClosure 'workerActor)
distributeWork
(map fst weightedDataSets)
(\_ _ -> map ((,) cfg) dist)
workers
-- Spawn tree collector
leaves <- startCollectorTreeGroup (N 0) $ do
useLocal
return $(mkStaticClosure 'imageCollector)
-- Top level collector
topLevel <- startCollectorTree $ do
useLocal
return $(mkStaticClosure 'imageCollector)
connect workers leaves
connect leaves topLevel
fmap snd . await =<< delay Local topLevel
-- | Program entry point. Reads in configuration files and checks "Oskar" data. | 2,568 | mainActor :: Actor (Config, [DataSet]) (FileChan Image)
mainActor = actor $ \(cfg, dataSets) -> do
-- Check that we actually have enough nodes. The local node counts.
let setCount = length dataSets
avail <- availableNodes
when (setCount > avail + 1) $
fail $ "Not enough nodes: Require " ++ show setCount ++ " to run data sets!"
-- Allocate estimation nodes
--
-- DSL: This construct tells to spawn actor for every item in a
-- list. Essentially it's distributed map.
estimateWorkers <- startGroup (N (setCount-1)) (NNodes 1) $ do
useLocal
return $(mkStaticClosure 'estimateActor)
distributeWork dataSets (const (map ((,) cfg))) estimateWorkers
-- Run estimation, collect weighted data sets
grp <- delayGroup estimateWorkers
weightedDataSets <- gather grp (flip (:)) []
logMessage "Weight Table:"
forM_ weightedDataSets $ \(ds, w) ->
logMessage $ show (fromRational w :: Float) ++ " - " ++ show (dsName ds)
-- Schedule work
let fullTime (ds, weight) = fromRational weight * fromIntegral (dsRepeats ds)
schedule = balancer (avail+1) (map fullTime weightedDataSets)
splitData low high dataSet =
let atRatio r = floor $ r * fromIntegral (dsRepeats dataSet)
in dataSet { dsRepeats = atRatio high - atRatio low }
dist = distributer splitData schedule (map fst weightedDataSets)
logMessage ("Schedule: " ++ show schedule)
forM_ (zip [1..] dist) $ \(i,ds) ->
logMessage (show (i :: Int) ++ ": " ++ show (dsRepeats ds) ++ " x " ++ show (dsName ds))
-- Now start worker actors
waitForResources estimateWorkers
workers <- startGroup (N avail) (NNodes 1) $ do
useLocal
return $(mkStaticClosure 'workerActor)
distributeWork
(map fst weightedDataSets)
(\_ _ -> map ((,) cfg) dist)
workers
-- Spawn tree collector
leaves <- startCollectorTreeGroup (N 0) $ do
useLocal
return $(mkStaticClosure 'imageCollector)
-- Top level collector
topLevel <- startCollectorTree $ do
useLocal
return $(mkStaticClosure 'imageCollector)
connect workers leaves
connect leaves topLevel
fmap snd . await =<< delay Local topLevel
-- | Program entry point. Reads in configuration files and checks "Oskar" data. | 2,364 | mainActor = actor $ \(cfg, dataSets) -> do
-- Check that we actually have enough nodes. The local node counts.
let setCount = length dataSets
avail <- availableNodes
when (setCount > avail + 1) $
fail $ "Not enough nodes: Require " ++ show setCount ++ " to run data sets!"
-- Allocate estimation nodes
--
-- DSL: This construct tells to spawn actor for every item in a
-- list. Essentially it's distributed map.
estimateWorkers <- startGroup (N (setCount-1)) (NNodes 1) $ do
useLocal
return $(mkStaticClosure 'estimateActor)
distributeWork dataSets (const (map ((,) cfg))) estimateWorkers
-- Run estimation, collect weighted data sets
grp <- delayGroup estimateWorkers
weightedDataSets <- gather grp (flip (:)) []
logMessage "Weight Table:"
forM_ weightedDataSets $ \(ds, w) ->
logMessage $ show (fromRational w :: Float) ++ " - " ++ show (dsName ds)
-- Schedule work
let fullTime (ds, weight) = fromRational weight * fromIntegral (dsRepeats ds)
schedule = balancer (avail+1) (map fullTime weightedDataSets)
splitData low high dataSet =
let atRatio r = floor $ r * fromIntegral (dsRepeats dataSet)
in dataSet { dsRepeats = atRatio high - atRatio low }
dist = distributer splitData schedule (map fst weightedDataSets)
logMessage ("Schedule: " ++ show schedule)
forM_ (zip [1..] dist) $ \(i,ds) ->
logMessage (show (i :: Int) ++ ": " ++ show (dsRepeats ds) ++ " x " ++ show (dsName ds))
-- Now start worker actors
waitForResources estimateWorkers
workers <- startGroup (N avail) (NNodes 1) $ do
useLocal
return $(mkStaticClosure 'workerActor)
distributeWork
(map fst weightedDataSets)
(\_ _ -> map ((,) cfg) dist)
workers
-- Spawn tree collector
leaves <- startCollectorTreeGroup (N 0) $ do
useLocal
return $(mkStaticClosure 'imageCollector)
-- Top level collector
topLevel <- startCollectorTree $ do
useLocal
return $(mkStaticClosure 'imageCollector)
connect workers leaves
connect leaves topLevel
fmap snd . await =<< delay Local topLevel
-- | Program entry point. Reads in configuration files and checks "Oskar" data. | 2,308 | true | true | 0 | 19 | 640 | 722 | 350 | 372 | null | null |
pascal-knodel/haskell-craft | Examples/· Recursion/· Primitive Recursion/Lists/Length/Length.hs | mit | length :: [t] -> Integer
length [] = 0 | 39 | length :: [t] -> Integer
length [] = 0 | 39 | length [] = 0 | 14 | false | true | 0 | 6 | 9 | 23 | 12 | 11 | null | null |
diku-dk/futhark | src/Futhark/IR/Prop/Aliases.hs | isc | basicOpAliases Manifest {} = [mempty] | 37 | basicOpAliases Manifest {} = [mempty] | 37 | basicOpAliases Manifest {} = [mempty] | 37 | false | false | 0 | 5 | 4 | 17 | 8 | 9 | null | null |
nomeata/ghc | compiler/codeGen/StgCmmUtils.hs | bsd-3-clause | mkSimpleLit (MachWord i) = CmmInt i wordWidth | 50 | mkSimpleLit (MachWord i) = CmmInt i wordWidth | 50 | mkSimpleLit (MachWord i) = CmmInt i wordWidth | 50 | false | false | 0 | 7 | 11 | 20 | 9 | 11 | null | null |
AndrewRademacher/stack | src/Stack/Options.hs | bsd-3-clause | compilerOptsParser :: Bool -> Parser CompilerVersion
compilerOptsParser hide =
option readCompilerVersion
(long "compiler" <>
metavar "COMPILER" <>
help "Use the specified compiler" <>
hideMods hide) | 238 | compilerOptsParser :: Bool -> Parser CompilerVersion
compilerOptsParser hide =
option readCompilerVersion
(long "compiler" <>
metavar "COMPILER" <>
help "Use the specified compiler" <>
hideMods hide) | 238 | compilerOptsParser hide =
option readCompilerVersion
(long "compiler" <>
metavar "COMPILER" <>
help "Use the specified compiler" <>
hideMods hide) | 185 | false | true | 0 | 10 | 63 | 58 | 25 | 33 | null | null |
guoy34/ampersand | src/Database/Design/Ampersand/ADL1/P2A_Converters.hs | gpl-3.0 | mjoin,mIsc :: a -> a -> FreeLattice a
mjoin a b = Join (Atom a) (Atom b) | 72 | mjoin,mIsc :: a -> a -> FreeLattice a
mjoin a b = Join (Atom a) (Atom b) | 72 | mjoin a b = Join (Atom a) (Atom b) | 34 | false | true | 0 | 7 | 16 | 46 | 23 | 23 | null | null |
tjhunter/karps | haskell/src/Spark/Core/Internal/OpFunctions.hs | apache-2.0 | _isSym :: T.Text -> Bool
_isSym txt = all isSymbol (T.unpack txt) | 65 | _isSym :: T.Text -> Bool
_isSym txt = all isSymbol (T.unpack txt) | 65 | _isSym txt = all isSymbol (T.unpack txt) | 40 | false | true | 0 | 8 | 11 | 39 | 17 | 22 | null | null |
ihc/futhark | src/Futhark/Optimise/Simplifier/Rules.hs | isc | removeDeadBranchResult _ _ = cannotSimplify | 43 | removeDeadBranchResult _ _ = cannotSimplify | 43 | removeDeadBranchResult _ _ = cannotSimplify | 43 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
apyrgio/snf-ganeti | src/Ganeti/Monitoring/Server.hs | bsd-2-clause | monitoringApi :: MVar CollectorMap -> Snap ()
monitoringApi mvar =
ifTop versionQ <|>
dir "1" (version1Api mvar) <|>
error404 | 131 | monitoringApi :: MVar CollectorMap -> Snap ()
monitoringApi mvar =
ifTop versionQ <|>
dir "1" (version1Api mvar) <|>
error404 | 131 | monitoringApi mvar =
ifTop versionQ <|>
dir "1" (version1Api mvar) <|>
error404 | 85 | false | true | 3 | 7 | 24 | 56 | 25 | 31 | null | null |
david-christiansen/final-pretty-printer | Text/PrettyPrint/Final/Rendering/PlainText.hs | mit | -- | Send pretty printer output to a 'Handle'
hPutDoc :: MonadIO m => Handle -> POut Int ann -> m ()
hPutDoc h out = render' out
where
render' pout = case pout of
PNull -> return ()
PAtom a -> hRenderAtom h a
PSeq o1 o2 -> render' o1 >> render' o2
PAnn a o -> render' o
-- | Save pretty printer output to a named file | 378 | hPutDoc :: MonadIO m => Handle -> POut Int ann -> m ()
hPutDoc h out = render' out
where
render' pout = case pout of
PNull -> return ()
PAtom a -> hRenderAtom h a
PSeq o1 o2 -> render' o1 >> render' o2
PAnn a o -> render' o
-- | Save pretty printer output to a named file | 332 | hPutDoc h out = render' out
where
render' pout = case pout of
PNull -> return ()
PAtom a -> hRenderAtom h a
PSeq o1 o2 -> render' o1 >> render' o2
PAnn a o -> render' o
-- | Save pretty printer output to a named file | 277 | true | true | 0 | 9 | 130 | 120 | 55 | 65 | null | null |
juliankopkalarsen/FpStats | GMM/src/Math/Test.hs | mit | testMean :: [Vector Double] -> Vector Double -> Assertion
testMean points expected = expected @=? meanv points | 110 | testMean :: [Vector Double] -> Vector Double -> Assertion
testMean points expected = expected @=? meanv points | 110 | testMean points expected = expected @=? meanv points | 52 | false | true | 0 | 7 | 16 | 40 | 19 | 21 | null | null |
lrassaby/harmlang | src/HarmLang/Parser.hs | mit | parseNumericInterval :: GenParser Char st Interval
parseNumericInterval =
do
a <- parseInteger
return $ Interval a
--Parse a named interval, using an initial basis function. | 186 | parseNumericInterval :: GenParser Char st Interval
parseNumericInterval =
do
a <- parseInteger
return $ Interval a
--Parse a named interval, using an initial basis function. | 186 | parseNumericInterval =
do
a <- parseInteger
return $ Interval a
--Parse a named interval, using an initial basis function. | 135 | false | true | 0 | 8 | 37 | 36 | 17 | 19 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.