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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Dockerfile.hs | gpl-2.0 | parseSourceLine :: String -> State SyntaxState SourceLine
parseSourceLine = mkParseSourceLine (parseExpression Nothing) | 119 | parseSourceLine :: String -> State SyntaxState SourceLine
parseSourceLine = mkParseSourceLine (parseExpression Nothing) | 119 | parseSourceLine = mkParseSourceLine (parseExpression Nothing) | 61 | false | true | 0 | 7 | 11 | 34 | 15 | 19 | null | null |
nevrenato/Hets_Fork | Comorphisms/CASL2SubCFOL.hs | gpl-2.0 | codeTerm :: Bool -> Set.Set SORT -> TERM () -> TERM ()
codeTerm b bsorts = foldTerm (codeRecord b bsorts $ error "CASL2SubCFol") | 128 | codeTerm :: Bool -> Set.Set SORT -> TERM () -> TERM ()
codeTerm b bsorts = foldTerm (codeRecord b bsorts $ error "CASL2SubCFol") | 128 | codeTerm b bsorts = foldTerm (codeRecord b bsorts $ error "CASL2SubCFol") | 73 | false | true | 0 | 9 | 22 | 61 | 28 | 33 | null | null |
WraithM/haskell-opaleye | src/Opaleye/PGTypes.hs | bsd-3-clause | -- No CI String instance since postgresql-simple doesn't define FromField (CI String)
-- The json data type was introduced in PostgreSQL version 9.2
-- JSON values must be SQL string quoted
pgJSON :: String -> Column PGJson
pgJSON = IPT.castToType "json" . HSD.quote | 267 | pgJSON :: String -> Column PGJson
pgJSON = IPT.castToType "json" . HSD.quote | 76 | pgJSON = IPT.castToType "json" . HSD.quote | 42 | true | true | 0 | 7 | 43 | 38 | 18 | 20 | null | null |
GaloisInc/saw-script | src/SAWScript/AutoMatch/Util.hs | bsd-3-clause | -- | Calculate the symmetric difference between two sets
symmetricDifference :: (Ord a) => Set a -> Set a -> Set a
symmetricDifference s t =
Set.difference (Set.union s t) (Set.intersection s t) | 197 | symmetricDifference :: (Ord a) => Set a -> Set a -> Set a
symmetricDifference s t =
Set.difference (Set.union s t) (Set.intersection s t) | 140 | symmetricDifference s t =
Set.difference (Set.union s t) (Set.intersection s t) | 82 | true | true | 0 | 8 | 35 | 70 | 34 | 36 | null | null |
psibi/yesod | yesod-core/Yesod/Core/Handler.hs | mit | getMessages :: MonadHandler m => m [(Text, Html)]
getMessages = do
bs <- lookupSessionBS msgKey
let ms = maybe [] enlist bs
deleteSession msgKey
return ms
where
enlist = pairup . S.split W8._nul
pairup [] = []
pairup [_] = []
pairup (s:v:xs) = (decode s, preEscapedToHtml (decode v)) : pairup xs
decode = decodeUtf8With lenientDecode
-- | Calls 'addMessage' with an empty status | 417 | getMessages :: MonadHandler m => m [(Text, Html)]
getMessages = do
bs <- lookupSessionBS msgKey
let ms = maybe [] enlist bs
deleteSession msgKey
return ms
where
enlist = pairup . S.split W8._nul
pairup [] = []
pairup [_] = []
pairup (s:v:xs) = (decode s, preEscapedToHtml (decode v)) : pairup xs
decode = decodeUtf8With lenientDecode
-- | Calls 'addMessage' with an empty status | 417 | getMessages = do
bs <- lookupSessionBS msgKey
let ms = maybe [] enlist bs
deleteSession msgKey
return ms
where
enlist = pairup . S.split W8._nul
pairup [] = []
pairup [_] = []
pairup (s:v:xs) = (decode s, preEscapedToHtml (decode v)) : pairup xs
decode = decodeUtf8With lenientDecode
-- | Calls 'addMessage' with an empty status | 367 | false | true | 0 | 11 | 102 | 167 | 81 | 86 | null | null |
random-j-farmer/hs-little-helper | Settings.hs | mit | -- The rest of this file contains settings which rarely need changing by a
-- user.
widgetFile :: String -> Q Exp
widgetFile = (if appReloadTemplates compileTimeAppSettings
then widgetFileReload
else widgetFileNoReload)
widgetFileSettings | 285 | widgetFile :: String -> Q Exp
widgetFile = (if appReloadTemplates compileTimeAppSettings
then widgetFileReload
else widgetFileNoReload)
widgetFileSettings | 200 | widgetFile = (if appReloadTemplates compileTimeAppSettings
then widgetFileReload
else widgetFileNoReload)
widgetFileSettings | 170 | true | true | 0 | 8 | 78 | 37 | 20 | 17 | null | null |
elieux/ghc | compiler/basicTypes/RdrName.hs | bsd-3-clause | greUsedRdrName :: GlobalRdrElt -> RdrName
-- For imported things, return a RdrName to add to the used-RdrName
-- set, which is used to generate unused-import-decl warnings.
-- Return a Qual RdrName if poss, so that identifies the most
-- specific ImportSpec. See Trac #10890 for some good examples.
greUsedRdrName gre@GRE{ gre_name = name, gre_lcl = lcl, gre_imp = iss }
| lcl, Just mod <- nameModule_maybe name = Qual (moduleName mod) occ
| not (null iss), is <- bestImport iss = Qual (is_as (is_decl is)) occ
| otherwise = pprTrace "greUsedRdrName" (ppr gre) (Unqual occ)
where
occ = greOccName gre | 648 | greUsedRdrName :: GlobalRdrElt -> RdrName
greUsedRdrName gre@GRE{ gre_name = name, gre_lcl = lcl, gre_imp = iss }
| lcl, Just mod <- nameModule_maybe name = Qual (moduleName mod) occ
| not (null iss), is <- bestImport iss = Qual (is_as (is_decl is)) occ
| otherwise = pprTrace "greUsedRdrName" (ppr gre) (Unqual occ)
where
occ = greOccName gre | 390 | greUsedRdrName gre@GRE{ gre_name = name, gre_lcl = lcl, gre_imp = iss }
| lcl, Just mod <- nameModule_maybe name = Qual (moduleName mod) occ
| not (null iss), is <- bestImport iss = Qual (is_as (is_decl is)) occ
| otherwise = pprTrace "greUsedRdrName" (ppr gre) (Unqual occ)
where
occ = greOccName gre | 348 | true | true | 1 | 10 | 147 | 162 | 81 | 81 | null | null |
xicesky/sky-haskell-playground | src/Sky/Isomorphism/Simple.hs | bsd-3-clause | iso :: forall i m a b. (SemiIsomorphism i, Monad m) => (a -> m b) -> (b -> m a) -> i m a b
iso = toSemiIsomorphism | 114 | iso :: forall i m a b. (SemiIsomorphism i, Monad m) => (a -> m b) -> (b -> m a) -> i m a b
iso = toSemiIsomorphism | 114 | iso = toSemiIsomorphism | 23 | false | true | 0 | 12 | 28 | 75 | 38 | 37 | null | null |
antonlogvinenko/javelin | src/Javelin/Lib/ByteCode/Attribute.hs | mit | codeAttr pool len = do
maxStack <- Get.getWord16be
maxLocals <- Get.getWord16be
codeLength <- Get.getWord32be
code <- Get.isolate (fromIntegral codeLength) parseInstructions
exceptionTable <- several getExceptionTable
attributes <- several (getAttr pool)
return $ CodeAttr maxStack maxLocals code exceptionTable attributes | 336 | codeAttr pool len = do
maxStack <- Get.getWord16be
maxLocals <- Get.getWord16be
codeLength <- Get.getWord32be
code <- Get.isolate (fromIntegral codeLength) parseInstructions
exceptionTable <- several getExceptionTable
attributes <- several (getAttr pool)
return $ CodeAttr maxStack maxLocals code exceptionTable attributes | 336 | codeAttr pool len = do
maxStack <- Get.getWord16be
maxLocals <- Get.getWord16be
codeLength <- Get.getWord32be
code <- Get.isolate (fromIntegral codeLength) parseInstructions
exceptionTable <- several getExceptionTable
attributes <- several (getAttr pool)
return $ CodeAttr maxStack maxLocals code exceptionTable attributes | 336 | false | false | 0 | 10 | 50 | 102 | 45 | 57 | null | null |
zhiyuanshi/fcore | frontend/typecheck/TypeCheck.hs | bsd-2-clause | checkFieldAccess :: JReceiver ClassName -> FieldName -> Checker ClassName
checkFieldAccess receiver f
= do conn <- getTypeServer
res <- liftIO (JvmTypeQuery.findFieldType conn c (is_static, f))
case res of
Nothing -> throwError (L NoLoc (NoSuchField receiver f)) -- FIXME: Should be the location of the field name
Just return_class -> return return_class
where
(is_static, c) = unwrapJReceiver receiver | 457 | checkFieldAccess :: JReceiver ClassName -> FieldName -> Checker ClassName
checkFieldAccess receiver f
= do conn <- getTypeServer
res <- liftIO (JvmTypeQuery.findFieldType conn c (is_static, f))
case res of
Nothing -> throwError (L NoLoc (NoSuchField receiver f)) -- FIXME: Should be the location of the field name
Just return_class -> return return_class
where
(is_static, c) = unwrapJReceiver receiver | 457 | checkFieldAccess receiver f
= do conn <- getTypeServer
res <- liftIO (JvmTypeQuery.findFieldType conn c (is_static, f))
case res of
Nothing -> throwError (L NoLoc (NoSuchField receiver f)) -- FIXME: Should be the location of the field name
Just return_class -> return return_class
where
(is_static, c) = unwrapJReceiver receiver | 383 | false | true | 0 | 14 | 111 | 128 | 61 | 67 | null | null |
SimSaladin/hajong | hajong-server/src/Mahjong/Hand/Yaku/Standard.hs | mit | sanAnkou :: YakuCheck Yaku
sanAnkou = do
replicateM_ 3 $ anyKoutsuKantsu concealed
return (Yaku 2 "San ankou") | 118 | sanAnkou :: YakuCheck Yaku
sanAnkou = do
replicateM_ 3 $ anyKoutsuKantsu concealed
return (Yaku 2 "San ankou") | 118 | sanAnkou = do
replicateM_ 3 $ anyKoutsuKantsu concealed
return (Yaku 2 "San ankou") | 91 | false | true | 0 | 9 | 24 | 41 | 18 | 23 | null | null |
princemaple/SPLEE | logic.hs | mit | fromOr (x@(_ :| _) :| y@(Atom _)) xs =
fromOr x (addTerm y xs) | 66 | fromOr (x@(_ :| _) :| y@(Atom _)) xs =
fromOr x (addTerm y xs) | 66 | fromOr (x@(_ :| _) :| y@(Atom _)) xs =
fromOr x (addTerm y xs) | 66 | false | false | 0 | 10 | 17 | 50 | 26 | 24 | null | null |
phischu/fragnix | tests/packages/scotty/Control.Applicative.Lift.hs | bsd-3-clause | runErrors (Pure x) = Right x | 28 | runErrors (Pure x) = Right x | 28 | runErrors (Pure x) = Right x | 28 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
runebak/wcc | Source/Parse.hs | bsd-3-clause | isComment :: ByteString -> Bool
isComment (B.uncons -> Just(x,_)) | isCommentStart x = True | 91 | isComment :: ByteString -> Bool
isComment (B.uncons -> Just(x,_)) | isCommentStart x = True | 91 | isComment (B.uncons -> Just(x,_)) | isCommentStart x = True | 59 | false | true | 0 | 11 | 13 | 54 | 24 | 30 | null | null |
Lainepress/hub-src | Hub/Parse.hs | bsd-3-clause | check _ _ _ _ _ _ = NOPE $ err loc0 "expected simple <hub>...</hub>" | 73 | check _ _ _ _ _ _ = NOPE $ err loc0 "expected simple <hub>...</hub>" | 73 | check _ _ _ _ _ _ = NOPE $ err loc0 "expected simple <hub>...</hub>" | 73 | false | false | 3 | 5 | 19 | 28 | 12 | 16 | null | null |
brendanhay/gogol | gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'SourceSplitRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ssrSource'
--
-- * 'ssrOptions'
sourceSplitRequest
:: SourceSplitRequest
sourceSplitRequest =
SourceSplitRequest' {_ssrSource = Nothing, _ssrOptions = Nothing} | 344 | sourceSplitRequest
:: SourceSplitRequest
sourceSplitRequest =
SourceSplitRequest' {_ssrSource = Nothing, _ssrOptions = Nothing} | 133 | sourceSplitRequest =
SourceSplitRequest' {_ssrSource = Nothing, _ssrOptions = Nothing} | 88 | true | true | 0 | 6 | 55 | 32 | 22 | 10 | null | null |
itsbruce/hackerrank | func/memo/differentWays.hs | unlicense | runTest :: IO Integer
runTest = do
s <- getLine
let [n, k] = map read . take 2 $ words s
return $ mod (teams n k) 100000007 | 135 | runTest :: IO Integer
runTest = do
s <- getLine
let [n, k] = map read . take 2 $ words s
return $ mod (teams n k) 100000007 | 135 | runTest = do
s <- getLine
let [n, k] = map read . take 2 $ words s
return $ mod (teams n k) 100000007 | 113 | false | true | 0 | 13 | 40 | 80 | 35 | 45 | null | null |
shockkolate/containers | Data/IntMap/Base.hs | bsd-3-clause | isSubmapOfBy predicate (Tip k x) t = case lookup k t of
Just y -> predicate x y
Nothing -> False | 183 | isSubmapOfBy predicate (Tip k x) t = case lookup k t of
Just y -> predicate x y
Nothing -> False | 183 | isSubmapOfBy predicate (Tip k x) t = case lookup k t of
Just y -> predicate x y
Nothing -> False | 183 | false | false | 1 | 9 | 107 | 55 | 23 | 32 | null | null |
suhailshergill/extensible-effects | src/Control/Eff/Extend/Tutorial.hs | mit | runArith :: Eff (Arith ': r) Integer -> Eff r Integer
runArith = fix (handle_relay pure) | 88 | runArith :: Eff (Arith ': r) Integer -> Eff r Integer
runArith = fix (handle_relay pure) | 88 | runArith = fix (handle_relay pure) | 34 | false | true | 0 | 8 | 15 | 43 | 21 | 22 | null | null |
databrary/databrary | src/View/Ingest.hs | agpl-3.0 | htmlIngestStatus (IngestCompleted cl) js = do
void "Previous ingest completed:"
H.ul $ forM_ cl $ \c ->
H.li $ H.a H.! actionLink viewContainer (HTML, (Nothing, Id c)) js $ H.toMarkup c | 193 | htmlIngestStatus (IngestCompleted cl) js = do
void "Previous ingest completed:"
H.ul $ forM_ cl $ \c ->
H.li $ H.a H.! actionLink viewContainer (HTML, (Nothing, Id c)) js $ H.toMarkup c | 193 | htmlIngestStatus (IngestCompleted cl) js = do
void "Previous ingest completed:"
H.ul $ forM_ cl $ \c ->
H.li $ H.a H.! actionLink viewContainer (HTML, (Nothing, Id c)) js $ H.toMarkup c | 193 | false | false | 0 | 14 | 38 | 89 | 43 | 46 | null | null |
rvion/ride | jetpack/src/Data/ByteString/AsBs.hs | bsd-3-clause | -- bs_maximum :: ByteString -> Word8
bs_maximum = I.maximum | 59 | bs_maximum = I.maximum | 22 | bs_maximum = I.maximum | 22 | true | false | 0 | 5 | 8 | 9 | 5 | 4 | null | null |
cdepillabout/testing-code-that-accesses-db-in-haskell | with-db/in-memory-db/src/Lib.hs | apache-2.0 | ---------
----------
-- main --
----------
----------
-- This is the main function. It basically does three things.
--
-- 1. Open up a connection to the sqlite database "production.sqlite". In
-- production this would probably be something like Postgres, MongoDB,
-- AWS's DynamoDB, etc.
-- 2. Perform migration. This creates the "blog_post" table in the
-- database if it doesn't exist.
-- 3. Run our 'server' function, which effectively runs the api.
defaultMain :: IO ()
defaultMain =
runStderrLoggingT $ withSqliteConn "production.sqlite" $ \conn -> do
liftIO $ runSqlConn (runMigration migrateAll) conn
liftIO $ putStrLn "\napi running on port 8080..."
liftIO . run 8080 . serve blogPostApiProxy $ server conn
-----------------
-----------------
-- other stuff --
-----------------
-----------------
--- | XXX: Hack.
--
-- Read the comment at the bottom of Lib.hs in the free-monad
-- implementation to find out more about this.
| 974 | defaultMain :: IO ()
defaultMain =
runStderrLoggingT $ withSqliteConn "production.sqlite" $ \conn -> do
liftIO $ runSqlConn (runMigration migrateAll) conn
liftIO $ putStrLn "\napi running on port 8080..."
liftIO . run 8080 . serve blogPostApiProxy $ server conn
-----------------
-----------------
-- other stuff --
-----------------
-----------------
--- | XXX: Hack.
--
-- Read the comment at the bottom of Lib.hs in the free-monad
-- implementation to find out more about this. | 510 | defaultMain =
runStderrLoggingT $ withSqliteConn "production.sqlite" $ \conn -> do
liftIO $ runSqlConn (runMigration migrateAll) conn
liftIO $ putStrLn "\napi running on port 8080..."
liftIO . run 8080 . serve blogPostApiProxy $ server conn
-----------------
-----------------
-- other stuff --
-----------------
-----------------
--- | XXX: Hack.
--
-- Read the comment at the bottom of Lib.hs in the free-monad
-- implementation to find out more about this. | 489 | true | true | 0 | 12 | 184 | 111 | 61 | 50 | null | null |
da-x/lamdu | Lamdu/GUI/ExpressionEdit/HoleEdit/ValTerms.hs | gpl-3.0 | ofName :: Name m -> String
ofName (Name _ NoCollision _ varName) = varName | 74 | ofName :: Name m -> String
ofName (Name _ NoCollision _ varName) = varName | 74 | ofName (Name _ NoCollision _ varName) = varName | 47 | false | true | 0 | 6 | 13 | 37 | 17 | 20 | null | null |
GregorySchwartz/modify-fasta | src/TransformFastaList.hs | gpl-3.0 | trim :: GeneticUnit -> Maybe FrameType -> Maybe Frame -> T.Text -> T.Text
trim Nucleotide Nothing Nothing x = T.dropEnd
(T.length x `mod` 3)
x | 253 | trim :: GeneticUnit -> Maybe FrameType -> Maybe Frame -> T.Text -> T.Text
trim Nucleotide Nothing Nothing x = T.dropEnd
(T.length x `mod` 3)
x | 253 | trim Nucleotide Nothing Nothing x = T.dropEnd
(T.length x `mod` 3)
x | 179 | false | true | 0 | 9 | 135 | 72 | 34 | 38 | null | null |
bergmark/fclabels | test/TestSuite.hs | bsd-3-clause | embed_fD :: Failing.Lens Integer (Record -> Record) (Bool -> Bool)
embed_fD = Failing.embed fD | 94 | embed_fD :: Failing.Lens Integer (Record -> Record) (Bool -> Bool)
embed_fD = Failing.embed fD | 94 | embed_fD = Failing.embed fD | 27 | false | true | 0 | 7 | 13 | 39 | 20 | 19 | null | null |
werbitt/ip-to-file | src/Iptf/Hosts/Internal.hs | mit | fromList (Record i hs:xs) = new i hs `union` fromList xs | 56 | fromList (Record i hs:xs) = new i hs `union` fromList xs | 56 | fromList (Record i hs:xs) = new i hs `union` fromList xs | 56 | false | false | 0 | 8 | 10 | 35 | 17 | 18 | null | null |
cirquit/Personal-Repository | Haskell/Playground/Criterion/ThiscrashesGHC.hs | mit | treeSum :: Num a => Tree a -> a
treeSum t = treeFold (\x l r -> x+l+r) 0 t | 74 | treeSum :: Num a => Tree a -> a
treeSum t = treeFold (\x l r -> x+l+r) 0 t | 74 | treeSum t = treeFold (\x l r -> x+l+r) 0 t | 42 | false | true | 0 | 9 | 19 | 55 | 27 | 28 | null | null |
keithodulaigh/Hets | Adl/Parse.hs | gpl-2.0 | choiceP :: (a -> CharParser st ()) -> [a] -> CharParser st a
choiceP p = choice . map (\ a -> p a >> return a) | 110 | choiceP :: (a -> CharParser st ()) -> [a] -> CharParser st a
choiceP p = choice . map (\ a -> p a >> return a) | 110 | choiceP p = choice . map (\ a -> p a >> return a) | 49 | false | true | 1 | 10 | 26 | 75 | 35 | 40 | null | null |
andrewMacmurray/haskell-book-solutions | src/ch17/Lookups.hs | mit | added :: Maybe Integer
added = (+3) <$> (lookup 3 $ zip xs ys) | 62 | added :: Maybe Integer
added = (+3) <$> (lookup 3 $ zip xs ys) | 62 | added = (+3) <$> (lookup 3 $ zip xs ys) | 39 | false | true | 0 | 8 | 13 | 37 | 19 | 18 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 217906 = 4799 | 33 | getValueFromProduct 217906 = 4799 | 33 | getValueFromProduct 217906 = 4799 | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
adnelson/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reflectBinderQuotePattern q ty unq (GHole _ _ t)
= do t' <- claimTy (sMN 0 "ty") ty; movelast t'
fill $ reflCall "GHole" [ty, Var t']
solve
focus t'; q unq t | 184 | reflectBinderQuotePattern q ty unq (GHole _ _ t)
= do t' <- claimTy (sMN 0 "ty") ty; movelast t'
fill $ reflCall "GHole" [ty, Var t']
solve
focus t'; q unq t | 184 | reflectBinderQuotePattern q ty unq (GHole _ _ t)
= do t' <- claimTy (sMN 0 "ty") ty; movelast t'
fill $ reflCall "GHole" [ty, Var t']
solve
focus t'; q unq t | 184 | false | false | 0 | 10 | 58 | 91 | 41 | 50 | null | null |
mbernat/aoc16-haskell | src/Day16.hs | bsd-3-clause | len1 :: Int
len1 = 272 | 22 | len1 :: Int
len1 = 272 | 22 | len1 = 272 | 10 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
muhbaasu/pfennig-server | src/Pfennig/Auth.hs | mit | authAPI :: Proxy AuthAPI
authAPI = Proxy | 40 | authAPI :: Proxy AuthAPI
authAPI = Proxy | 40 | authAPI = Proxy | 15 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
keithodulaigh/Hets | utils/itcor/GenItCorrections.hs | gpl-2.0 | tableEntry :: Parser Double
tableEntry = do
str <- parseDouble
string "pt"
spaces
try (manyTill anyChar $ try $ string "wl: ") <|> manyTill anyChar eof
return (read str) | 189 | tableEntry :: Parser Double
tableEntry = do
str <- parseDouble
string "pt"
spaces
try (manyTill anyChar $ try $ string "wl: ") <|> manyTill anyChar eof
return (read str) | 189 | tableEntry = do
str <- parseDouble
string "pt"
spaces
try (manyTill anyChar $ try $ string "wl: ") <|> manyTill anyChar eof
return (read str) | 161 | false | true | 0 | 12 | 48 | 74 | 32 | 42 | null | null |
MichaelMackus/hsrl | RL/UI/Sprite.hs | mit | toMessage e (GameUpdate (BandageApplied m)) | isPlayer m = Just $ "You apply the bandage." | 102 | toMessage e (GameUpdate (BandageApplied m)) | isPlayer m = Just $ "You apply the bandage." | 102 | toMessage e (GameUpdate (BandageApplied m)) | isPlayer m = Just $ "You apply the bandage." | 102 | false | false | 0 | 9 | 26 | 36 | 16 | 20 | null | null |
trenttobler/hs-asteroids | src/Asteroids/UILogic/TextScreen.hs | bsd-3-clause | newScreen :: TextPos -> LetterScale -> TextScreen
newScreen sizeS sizeC = TextScreen
{ textCursor = (0,0)
, cursorColor = whitePixel
, textContent = H.empty
, textScreenSize = sizeS
, textScreenLetters = toDrawableLetters letterShapes sizeS sizeC } | 264 | newScreen :: TextPos -> LetterScale -> TextScreen
newScreen sizeS sizeC = TextScreen
{ textCursor = (0,0)
, cursorColor = whitePixel
, textContent = H.empty
, textScreenSize = sizeS
, textScreenLetters = toDrawableLetters letterShapes sizeS sizeC } | 263 | newScreen sizeS sizeC = TextScreen
{ textCursor = (0,0)
, cursorColor = whitePixel
, textContent = H.empty
, textScreenSize = sizeS
, textScreenLetters = toDrawableLetters letterShapes sizeS sizeC } | 213 | false | true | 0 | 8 | 51 | 75 | 42 | 33 | null | null |
kahless/report-comparator | src/Utils/GTK.hs | mit | -- padding горизонтальный/вертикальный
-- Удаляет содержимое контейнера
destroyChildren container =
containerGetChildren container >>= mapM_ widgetDestroy | 159 | destroyChildren container =
containerGetChildren container >>= mapM_ widgetDestroy | 85 | destroyChildren container =
containerGetChildren container >>= mapM_ widgetDestroy | 85 | true | false | 3 | 5 | 19 | 27 | 11 | 16 | null | null |
bitemyapp/scotty | test/Web/ScottySpec.hs | bsd-3-clause | main :: IO ()
main = hspec spec | 31 | main :: IO ()
main = hspec spec | 31 | main = hspec spec | 17 | false | true | 0 | 7 | 7 | 25 | 10 | 15 | null | null |
vdweegen/UvA-Software_Testing | Lab1/Final/Exercises.hs | gpl-3.0 | sumDoubleDigits :: [Integer] -> Integer
sumDoubleDigits = sum . doubleDigits | 76 | sumDoubleDigits :: [Integer] -> Integer
sumDoubleDigits = sum . doubleDigits | 76 | sumDoubleDigits = sum . doubleDigits | 36 | false | true | 0 | 6 | 9 | 22 | 12 | 10 | null | null |
termite2/debug | Debug/CodeWin.hs | bsd-3-clause | codeWinMBAtCursor :: RCodeWin -> IO (Maybe (MBID, SourcePos))
codeWinMBAtCursor ref = do
cw@CodeWin{..} <- readIORef ref
mreg <- regionUnderCursor cwAPI
case mreg of
Nothing -> return Nothing
Just (reg, p) -> return $ Just $ ((regionMap cw) M.! reg, p) | 288 | codeWinMBAtCursor :: RCodeWin -> IO (Maybe (MBID, SourcePos))
codeWinMBAtCursor ref = do
cw@CodeWin{..} <- readIORef ref
mreg <- regionUnderCursor cwAPI
case mreg of
Nothing -> return Nothing
Just (reg, p) -> return $ Just $ ((regionMap cw) M.! reg, p) | 288 | codeWinMBAtCursor ref = do
cw@CodeWin{..} <- readIORef ref
mreg <- regionUnderCursor cwAPI
case mreg of
Nothing -> return Nothing
Just (reg, p) -> return $ Just $ ((regionMap cw) M.! reg, p) | 226 | false | true | 0 | 14 | 75 | 119 | 59 | 60 | null | null |
ehlemur/HMeans | Test/MNIST/testHMeansHierachical2.hs | gpl-3.0 | runHungarian :: [Int] -> [Int] -> ([(Int, Int)], Double)
runHungarian x y = hungarian m 10 10
where
m = foldr' ($) (take 100 $ repeat 0) $ fmap addAllExcept $ zip x y | 175 | runHungarian :: [Int] -> [Int] -> ([(Int, Int)], Double)
runHungarian x y = hungarian m 10 10
where
m = foldr' ($) (take 100 $ repeat 0) $ fmap addAllExcept $ zip x y | 174 | runHungarian x y = hungarian m 10 10
where
m = foldr' ($) (take 100 $ repeat 0) $ fmap addAllExcept $ zip x y | 117 | false | true | 1 | 11 | 42 | 105 | 51 | 54 | null | null |
sgillespie/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | nlHsPar e = noLoc (HsPar e) | 40 | nlHsPar e = noLoc (HsPar e) | 40 | nlHsPar e = noLoc (HsPar e) | 40 | false | false | 0 | 7 | 18 | 18 | 8 | 10 | null | null |
olsner/ghc | compiler/basicTypes/DataCon.hs | bsd-3-clause | mkDataCon :: Name
-> Bool -- ^ Is the constructor declared infix?
-> TyConRepName -- ^ TyConRepName for the promoted TyCon
-> [HsSrcBang] -- ^ Strictness/unpack annotations, from user
-> [FieldLabel] -- ^ Field labels for the constructor,
-- if it is a record, otherwise empty
-> [TyVarBinder] -- ^ Universals. See Note [TyVarBinders in DataCons]
-> [TyVarBinder] -- ^ Existentials.
-- (These last two must be Named and Inferred/Specified)
-> [EqSpec] -- ^ GADT equalities
-> ThetaType -- ^ Theta-type occuring before the arguments proper
-> [Type] -- ^ Original argument types
-> Type -- ^ Original result type
-> RuntimeRepInfo -- ^ See comments on 'TyCon.RuntimeRepInfo'
-> TyCon -- ^ Representation type constructor
-> ThetaType -- ^ The "stupid theta", context of the data
-- declaration e.g. @data Eq a => T a ...@
-> Id -- ^ Worker Id
-> DataConRep -- ^ Representation
-> DataCon
-- Can get the tag from the TyCon
mkDataCon name declared_infix prom_info
arg_stricts -- Must match orig_arg_tys 1-1
fields
univ_tvs ex_tvs
eq_spec theta
orig_arg_tys orig_res_ty rep_info rep_tycon
stupid_theta work_id rep
-- Warning: mkDataCon is not a good place to check invariants.
-- If the programmer writes the wrong result type in the decl, thus:
-- data T a where { MkT :: S }
-- then it's possible that the univ_tvs may hit an assertion failure
-- if you pull on univ_tvs. This case is checked by checkValidDataCon,
-- so the error is detected properly... it's just that asaertions here
-- are a little dodgy.
= con
where
is_vanilla = null ex_tvs && null eq_spec && null theta
con = MkData {dcName = name, dcUnique = nameUnique name,
dcVanilla = is_vanilla, dcInfix = declared_infix,
dcUnivTyVars = univ_tvs,
dcExTyVars = ex_tvs,
dcEqSpec = eq_spec,
dcOtherTheta = theta,
dcStupidTheta = stupid_theta,
dcOrigArgTys = orig_arg_tys, dcOrigResTy = orig_res_ty,
dcRepTyCon = rep_tycon,
dcSrcBangs = arg_stricts,
dcFields = fields, dcTag = tag, dcRepType = rep_ty,
dcWorkId = work_id,
dcRep = rep,
dcSourceArity = length orig_arg_tys,
dcRepArity = length rep_arg_tys,
dcPromoted = promoted }
-- The 'arg_stricts' passed to mkDataCon are simply those for the
-- source-language arguments. We add extra ones for the
-- dictionary arguments right here.
tag = assoc "mkDataCon" (tyConDataCons rep_tycon `zip` [fIRST_TAG..]) con
rep_arg_tys = dataConRepArgTys con
rep_ty = mkForAllTys univ_tvs $ mkForAllTys ex_tvs $
mkFunTys rep_arg_tys $
mkTyConApp rep_tycon (mkTyVarTys (binderVars univ_tvs))
-- See Note [Promoted data constructors] in TyCon
prom_tv_bndrs = [ mkNamedTyConBinder vis tv
| TvBndr tv vis <- filterEqSpec eq_spec univ_tvs ++ ex_tvs ]
prom_arg_bndrs = mkCleanAnonTyConBinders prom_tv_bndrs (theta ++ orig_arg_tys)
prom_res_kind = orig_res_ty
promoted = mkPromotedDataCon con name prom_info
(prom_tv_bndrs ++ prom_arg_bndrs)
prom_res_kind roles rep_info
roles = map (const Nominal) (univ_tvs ++ ex_tvs) ++
map (const Representational) orig_arg_tys | 3,838 | mkDataCon :: Name
-> Bool -- ^ Is the constructor declared infix?
-> TyConRepName -- ^ TyConRepName for the promoted TyCon
-> [HsSrcBang] -- ^ Strictness/unpack annotations, from user
-> [FieldLabel] -- ^ Field labels for the constructor,
-- if it is a record, otherwise empty
-> [TyVarBinder] -- ^ Universals. See Note [TyVarBinders in DataCons]
-> [TyVarBinder] -- ^ Existentials.
-- (These last two must be Named and Inferred/Specified)
-> [EqSpec] -- ^ GADT equalities
-> ThetaType -- ^ Theta-type occuring before the arguments proper
-> [Type] -- ^ Original argument types
-> Type -- ^ Original result type
-> RuntimeRepInfo -- ^ See comments on 'TyCon.RuntimeRepInfo'
-> TyCon -- ^ Representation type constructor
-> ThetaType -- ^ The "stupid theta", context of the data
-- declaration e.g. @data Eq a => T a ...@
-> Id -- ^ Worker Id
-> DataConRep -- ^ Representation
-> DataCon
mkDataCon name declared_infix prom_info
arg_stricts -- Must match orig_arg_tys 1-1
fields
univ_tvs ex_tvs
eq_spec theta
orig_arg_tys orig_res_ty rep_info rep_tycon
stupid_theta work_id rep
-- Warning: mkDataCon is not a good place to check invariants.
-- If the programmer writes the wrong result type in the decl, thus:
-- data T a where { MkT :: S }
-- then it's possible that the univ_tvs may hit an assertion failure
-- if you pull on univ_tvs. This case is checked by checkValidDataCon,
-- so the error is detected properly... it's just that asaertions here
-- are a little dodgy.
= con
where
is_vanilla = null ex_tvs && null eq_spec && null theta
con = MkData {dcName = name, dcUnique = nameUnique name,
dcVanilla = is_vanilla, dcInfix = declared_infix,
dcUnivTyVars = univ_tvs,
dcExTyVars = ex_tvs,
dcEqSpec = eq_spec,
dcOtherTheta = theta,
dcStupidTheta = stupid_theta,
dcOrigArgTys = orig_arg_tys, dcOrigResTy = orig_res_ty,
dcRepTyCon = rep_tycon,
dcSrcBangs = arg_stricts,
dcFields = fields, dcTag = tag, dcRepType = rep_ty,
dcWorkId = work_id,
dcRep = rep,
dcSourceArity = length orig_arg_tys,
dcRepArity = length rep_arg_tys,
dcPromoted = promoted }
-- The 'arg_stricts' passed to mkDataCon are simply those for the
-- source-language arguments. We add extra ones for the
-- dictionary arguments right here.
tag = assoc "mkDataCon" (tyConDataCons rep_tycon `zip` [fIRST_TAG..]) con
rep_arg_tys = dataConRepArgTys con
rep_ty = mkForAllTys univ_tvs $ mkForAllTys ex_tvs $
mkFunTys rep_arg_tys $
mkTyConApp rep_tycon (mkTyVarTys (binderVars univ_tvs))
-- See Note [Promoted data constructors] in TyCon
prom_tv_bndrs = [ mkNamedTyConBinder vis tv
| TvBndr tv vis <- filterEqSpec eq_spec univ_tvs ++ ex_tvs ]
prom_arg_bndrs = mkCleanAnonTyConBinders prom_tv_bndrs (theta ++ orig_arg_tys)
prom_res_kind = orig_res_ty
promoted = mkPromotedDataCon con name prom_info
(prom_tv_bndrs ++ prom_arg_bndrs)
prom_res_kind roles rep_info
roles = map (const Nominal) (univ_tvs ++ ex_tvs) ++
map (const Representational) orig_arg_tys | 3,801 | mkDataCon name declared_infix prom_info
arg_stricts -- Must match orig_arg_tys 1-1
fields
univ_tvs ex_tvs
eq_spec theta
orig_arg_tys orig_res_ty rep_info rep_tycon
stupid_theta work_id rep
-- Warning: mkDataCon is not a good place to check invariants.
-- If the programmer writes the wrong result type in the decl, thus:
-- data T a where { MkT :: S }
-- then it's possible that the univ_tvs may hit an assertion failure
-- if you pull on univ_tvs. This case is checked by checkValidDataCon,
-- so the error is detected properly... it's just that asaertions here
-- are a little dodgy.
= con
where
is_vanilla = null ex_tvs && null eq_spec && null theta
con = MkData {dcName = name, dcUnique = nameUnique name,
dcVanilla = is_vanilla, dcInfix = declared_infix,
dcUnivTyVars = univ_tvs,
dcExTyVars = ex_tvs,
dcEqSpec = eq_spec,
dcOtherTheta = theta,
dcStupidTheta = stupid_theta,
dcOrigArgTys = orig_arg_tys, dcOrigResTy = orig_res_ty,
dcRepTyCon = rep_tycon,
dcSrcBangs = arg_stricts,
dcFields = fields, dcTag = tag, dcRepType = rep_ty,
dcWorkId = work_id,
dcRep = rep,
dcSourceArity = length orig_arg_tys,
dcRepArity = length rep_arg_tys,
dcPromoted = promoted }
-- The 'arg_stricts' passed to mkDataCon are simply those for the
-- source-language arguments. We add extra ones for the
-- dictionary arguments right here.
tag = assoc "mkDataCon" (tyConDataCons rep_tycon `zip` [fIRST_TAG..]) con
rep_arg_tys = dataConRepArgTys con
rep_ty = mkForAllTys univ_tvs $ mkForAllTys ex_tvs $
mkFunTys rep_arg_tys $
mkTyConApp rep_tycon (mkTyVarTys (binderVars univ_tvs))
-- See Note [Promoted data constructors] in TyCon
prom_tv_bndrs = [ mkNamedTyConBinder vis tv
| TvBndr tv vis <- filterEqSpec eq_spec univ_tvs ++ ex_tvs ]
prom_arg_bndrs = mkCleanAnonTyConBinders prom_tv_bndrs (theta ++ orig_arg_tys)
prom_res_kind = orig_res_ty
promoted = mkPromotedDataCon con name prom_info
(prom_tv_bndrs ++ prom_arg_bndrs)
prom_res_kind roles rep_info
roles = map (const Nominal) (univ_tvs ++ ex_tvs) ++
map (const Representational) orig_arg_tys | 2,591 | true | true | 0 | 20 | 1,339 | 524 | 300 | 224 | null | null |
kim/data-ringbuffer | perf/Main.hs | apache-2.0 | iterations :: Int
iterations = 1000000 | 38 | iterations :: Int
iterations = 1000000 | 38 | iterations = 1000000 | 20 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
probcomp/haxcat | Models.hs | apache-2.0 | counts_to_asc_list :: (Ord a) => Counts a Int -> [a]
counts_to_asc_list Counts {..} = concatMap group $ M.toAscList counts_map
where group (k, v) = take v $ repeat k | 169 | counts_to_asc_list :: (Ord a) => Counts a Int -> [a]
counts_to_asc_list Counts {..} = concatMap group $ M.toAscList counts_map
where group (k, v) = take v $ repeat k | 169 | counts_to_asc_list Counts {..} = concatMap group $ M.toAscList counts_map
where group (k, v) = take v $ repeat k | 116 | false | true | 3 | 7 | 32 | 90 | 41 | 49 | null | null |
alphalambda/hsmath | src/Learn/Geometry/Drawing.hs | gpl-2.0 | drawArc (a,o,b) = translate_ o $ P.arc pstart pstop r
where a_ = Geo.translate_axes o a
b_ = Geo.translate_axes o b
(pstart,pstop) = Geo.dphase a_ b_
r = Geo.dist a o | 200 | drawArc (a,o,b) = translate_ o $ P.arc pstart pstop r
where a_ = Geo.translate_axes o a
b_ = Geo.translate_axes o b
(pstart,pstop) = Geo.dphase a_ b_
r = Geo.dist a o | 200 | drawArc (a,o,b) = translate_ o $ P.arc pstart pstop r
where a_ = Geo.translate_axes o a
b_ = Geo.translate_axes o b
(pstart,pstop) = Geo.dphase a_ b_
r = Geo.dist a o | 200 | false | false | 3 | 7 | 64 | 103 | 46 | 57 | null | null |
snoyberg/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | mkImplicWC :: Bag Implication -> WantedConstraints
mkImplicWC implic
= WC { wc_simple = emptyBag, wc_impl = implic, wc_insol = emptyBag } | 139 | mkImplicWC :: Bag Implication -> WantedConstraints
mkImplicWC implic
= WC { wc_simple = emptyBag, wc_impl = implic, wc_insol = emptyBag } | 139 | mkImplicWC implic
= WC { wc_simple = emptyBag, wc_impl = implic, wc_insol = emptyBag } | 88 | false | true | 0 | 7 | 22 | 50 | 25 | 25 | null | null |
thalerjonathan/phd | public/ArtIterating/code/haskell/PureAgentsPar/src/SpacialGameMsg/SGModelMsg.hs | gpl-3.0 | randomAgentState :: StdGen -> Double -> (SGAgentState, StdGen)
randomAgentState g p = (SIRSAgentState{ sgCurrState = s,
sgPrevState = s,
sgLocalPayoff = 0.0,
sgBestPayoff = (s, 0.0),
sgNeighbourFlag = 0}, g')
where
(isDefector, g') = randomThresh g p
s = if isDefector then
Defector
else
Cooperator | 622 | randomAgentState :: StdGen -> Double -> (SGAgentState, StdGen)
randomAgentState g p = (SIRSAgentState{ sgCurrState = s,
sgPrevState = s,
sgLocalPayoff = 0.0,
sgBestPayoff = (s, 0.0),
sgNeighbourFlag = 0}, g')
where
(isDefector, g') = randomThresh g p
s = if isDefector then
Defector
else
Cooperator | 622 | randomAgentState g p = (SIRSAgentState{ sgCurrState = s,
sgPrevState = s,
sgLocalPayoff = 0.0,
sgBestPayoff = (s, 0.0),
sgNeighbourFlag = 0}, g')
where
(isDefector, g') = randomThresh g p
s = if isDefector then
Defector
else
Cooperator | 559 | false | true | 1 | 8 | 368 | 107 | 63 | 44 | null | null |
UCSD-PL/RefScript | src/Language/Rsc/Program.hs | bsd-3-clause | keysStr = "_KEYS_" | 21 | keysStr = "_KEYS_" | 21 | keysStr = "_KEYS_" | 21 | false | false | 0 | 4 | 5 | 6 | 3 | 3 | null | null |
acowley/PointCloudViewer | src/Camera.hs | bsd-3-clause | toMatrix :: Camera -> M44 Float
toMatrix (Camera r t _ _) = mkTransformation r (rotate r (negate t)) | 100 | toMatrix :: Camera -> M44 Float
toMatrix (Camera r t _ _) = mkTransformation r (rotate r (negate t)) | 100 | toMatrix (Camera r t _ _) = mkTransformation r (rotate r (negate t)) | 68 | false | true | 0 | 9 | 18 | 52 | 25 | 27 | null | null |
bobatkey/Forvie | src/Data/FiniteStateMachine/ThompsonAbstractMachine.hs | bsd-3-clause | mkQueue :: IS.IntSet -> ThreadQueue
mkQueue threads = TQ threads (IS.elems threads) | 83 | mkQueue :: IS.IntSet -> ThreadQueue
mkQueue threads = TQ threads (IS.elems threads) | 83 | mkQueue threads = TQ threads (IS.elems threads) | 47 | false | true | 0 | 8 | 11 | 33 | 16 | 17 | null | null |
christiaanb/ghc | compiler/main/DriverPipeline.hs | bsd-3-clause | mk_pvm_wrapper_script :: String -> String -> String -> String
mk_pvm_wrapper_script pvm_executable pvm_executable_base sysMan = unlines $
[
"eval 'exec perl -S $0 ${1+\"$@\"}'",
" if $running_under_some_shell;",
"# =!=!=!=!=!=!=!=!=!=!=!",
"# This script is automatically generated: DO NOT EDIT!!!",
"# Generated by Glasgow Haskell Compiler",
"# ngoqvam choHbogh vaj' vIHoHnISbej !!!!",
"#",
"$pvm_executable = '" ++ pvm_executable ++ "';",
"$pvm_executable_base = '" ++ pvm_executable_base ++ "';",
"$SysMan = '" ++ sysMan ++ "';",
"",
{- ToDo: add the magical shortcuts again iff we actually use them -- HWL
"# first, some magical shortcuts to run "commands" on the binary",
"# (which is hidden)",
"if ($#ARGV == 1 && $ARGV[0] eq '+RTS' && $ARGV[1] =~ /^--((size|file|strip|rm|nm).*)/ ) {",
" local($cmd) = $1;",
" system("$cmd $pvm_executable");",
" exit(0); # all done",
"}", -}
"",
"# Now, run the real binary; process the args first",
"$ENV{'PE'} = $pvm_executable_base;", -- ++ pvm_executable_base,
"$debug = '';",
"$nprocessors = 0; # the default: as many PEs as machines in PVM config",
"@nonPVM_args = ();",
"$in_RTS_args = 0;",
"",
"args: while ($a = shift(@ARGV)) {",
" if ( $a eq '+RTS' ) {",
" $in_RTS_args = 1;",
" } elsif ( $a eq '-RTS' ) {",
" $in_RTS_args = 0;",
" }",
" if ( $a eq '-d' && $in_RTS_args ) {",
" $debug = '-';",
" } elsif ( $a =~ /^-qN(\\d+)/ && $in_RTS_args ) {",
" $nprocessors = $1;",
" } elsif ( $a =~ /^-qp(\\d+)/ && $in_RTS_args ) {",
" $nprocessors = $1;",
" } else {",
" push(@nonPVM_args, $a);",
" }",
"}",
"",
"local($return_val) = 0;",
"# Start the parallel execution by calling SysMan",
"system(\"$SysMan $debug $pvm_executable $nprocessors @nonPVM_args\");",
"$return_val = $?;",
"# ToDo: fix race condition moving files and flushing them!!",
"system(\"cp $ENV{'HOME'}/$pvm_executable_base.???.gr .\") if -f \"$ENV{'HOME'}/$pvm_executable_base.002.gr\";",
"exit($return_val);"
] | 2,110 | mk_pvm_wrapper_script :: String -> String -> String -> String
mk_pvm_wrapper_script pvm_executable pvm_executable_base sysMan = unlines $
[
"eval 'exec perl -S $0 ${1+\"$@\"}'",
" if $running_under_some_shell;",
"# =!=!=!=!=!=!=!=!=!=!=!",
"# This script is automatically generated: DO NOT EDIT!!!",
"# Generated by Glasgow Haskell Compiler",
"# ngoqvam choHbogh vaj' vIHoHnISbej !!!!",
"#",
"$pvm_executable = '" ++ pvm_executable ++ "';",
"$pvm_executable_base = '" ++ pvm_executable_base ++ "';",
"$SysMan = '" ++ sysMan ++ "';",
"",
{- ToDo: add the magical shortcuts again iff we actually use them -- HWL
"# first, some magical shortcuts to run "commands" on the binary",
"# (which is hidden)",
"if ($#ARGV == 1 && $ARGV[0] eq '+RTS' && $ARGV[1] =~ /^--((size|file|strip|rm|nm).*)/ ) {",
" local($cmd) = $1;",
" system("$cmd $pvm_executable");",
" exit(0); # all done",
"}", -}
"",
"# Now, run the real binary; process the args first",
"$ENV{'PE'} = $pvm_executable_base;", -- ++ pvm_executable_base,
"$debug = '';",
"$nprocessors = 0; # the default: as many PEs as machines in PVM config",
"@nonPVM_args = ();",
"$in_RTS_args = 0;",
"",
"args: while ($a = shift(@ARGV)) {",
" if ( $a eq '+RTS' ) {",
" $in_RTS_args = 1;",
" } elsif ( $a eq '-RTS' ) {",
" $in_RTS_args = 0;",
" }",
" if ( $a eq '-d' && $in_RTS_args ) {",
" $debug = '-';",
" } elsif ( $a =~ /^-qN(\\d+)/ && $in_RTS_args ) {",
" $nprocessors = $1;",
" } elsif ( $a =~ /^-qp(\\d+)/ && $in_RTS_args ) {",
" $nprocessors = $1;",
" } else {",
" push(@nonPVM_args, $a);",
" }",
"}",
"",
"local($return_val) = 0;",
"# Start the parallel execution by calling SysMan",
"system(\"$SysMan $debug $pvm_executable $nprocessors @nonPVM_args\");",
"$return_val = $?;",
"# ToDo: fix race condition moving files and flushing them!!",
"system(\"cp $ENV{'HOME'}/$pvm_executable_base.???.gr .\") if -f \"$ENV{'HOME'}/$pvm_executable_base.002.gr\";",
"exit($return_val);"
] | 2,110 | mk_pvm_wrapper_script pvm_executable pvm_executable_base sysMan = unlines $
[
"eval 'exec perl -S $0 ${1+\"$@\"}'",
" if $running_under_some_shell;",
"# =!=!=!=!=!=!=!=!=!=!=!",
"# This script is automatically generated: DO NOT EDIT!!!",
"# Generated by Glasgow Haskell Compiler",
"# ngoqvam choHbogh vaj' vIHoHnISbej !!!!",
"#",
"$pvm_executable = '" ++ pvm_executable ++ "';",
"$pvm_executable_base = '" ++ pvm_executable_base ++ "';",
"$SysMan = '" ++ sysMan ++ "';",
"",
{- ToDo: add the magical shortcuts again iff we actually use them -- HWL
"# first, some magical shortcuts to run "commands" on the binary",
"# (which is hidden)",
"if ($#ARGV == 1 && $ARGV[0] eq '+RTS' && $ARGV[1] =~ /^--((size|file|strip|rm|nm).*)/ ) {",
" local($cmd) = $1;",
" system("$cmd $pvm_executable");",
" exit(0); # all done",
"}", -}
"",
"# Now, run the real binary; process the args first",
"$ENV{'PE'} = $pvm_executable_base;", -- ++ pvm_executable_base,
"$debug = '';",
"$nprocessors = 0; # the default: as many PEs as machines in PVM config",
"@nonPVM_args = ();",
"$in_RTS_args = 0;",
"",
"args: while ($a = shift(@ARGV)) {",
" if ( $a eq '+RTS' ) {",
" $in_RTS_args = 1;",
" } elsif ( $a eq '-RTS' ) {",
" $in_RTS_args = 0;",
" }",
" if ( $a eq '-d' && $in_RTS_args ) {",
" $debug = '-';",
" } elsif ( $a =~ /^-qN(\\d+)/ && $in_RTS_args ) {",
" $nprocessors = $1;",
" } elsif ( $a =~ /^-qp(\\d+)/ && $in_RTS_args ) {",
" $nprocessors = $1;",
" } else {",
" push(@nonPVM_args, $a);",
" }",
"}",
"",
"local($return_val) = 0;",
"# Start the parallel execution by calling SysMan",
"system(\"$SysMan $debug $pvm_executable $nprocessors @nonPVM_args\");",
"$return_val = $?;",
"# ToDo: fix race condition moving files and flushing them!!",
"system(\"cp $ENV{'HOME'}/$pvm_executable_base.???.gr .\") if -f \"$ENV{'HOME'}/$pvm_executable_base.002.gr\";",
"exit($return_val);"
] | 2,048 | false | true | 0 | 8 | 480 | 189 | 117 | 72 | null | null |
ndmitchell/shake | src/Development/Shake/Internal/Core/Run.hs | bsd-3-clause | open :: Cleanup -> ShakeOptions -> Rules () -> IO RunState
open cleanup opts rs = withInit opts $ \opts@ShakeOptions{..} diagnostic _ -> do
diagnostic $ pure "Starting run"
SRules{actions, builtinRules, userRules} <- runRules opts rs
diagnostic $ pure $ "Number of actions = " ++ show (length actions)
diagnostic $ pure $ "Number of builtin rules = " ++ show (Map.size builtinRules) ++ " " ++ show (Map.keys builtinRules)
diagnostic $ pure $ "Number of user rule types = " ++ show (TMap.size userRules)
diagnostic $ pure $ "Number of user rules = " ++ show (sum (TMap.toList (userRuleSize . userRuleContents) userRules))
checkShakeExtra shakeExtra
curdir <- getCurrentDirectory
database <- usingDatabase cleanup opts diagnostic builtinRules
(shared, cloud) <- loadSharedCloud database opts builtinRules
pure RunState{..}
-- Prepare for a fresh run by changing Result to Loaded | 925 | open :: Cleanup -> ShakeOptions -> Rules () -> IO RunState
open cleanup opts rs = withInit opts $ \opts@ShakeOptions{..} diagnostic _ -> do
diagnostic $ pure "Starting run"
SRules{actions, builtinRules, userRules} <- runRules opts rs
diagnostic $ pure $ "Number of actions = " ++ show (length actions)
diagnostic $ pure $ "Number of builtin rules = " ++ show (Map.size builtinRules) ++ " " ++ show (Map.keys builtinRules)
diagnostic $ pure $ "Number of user rule types = " ++ show (TMap.size userRules)
diagnostic $ pure $ "Number of user rules = " ++ show (sum (TMap.toList (userRuleSize . userRuleContents) userRules))
checkShakeExtra shakeExtra
curdir <- getCurrentDirectory
database <- usingDatabase cleanup opts diagnostic builtinRules
(shared, cloud) <- loadSharedCloud database opts builtinRules
pure RunState{..}
-- Prepare for a fresh run by changing Result to Loaded | 925 | open cleanup opts rs = withInit opts $ \opts@ShakeOptions{..} diagnostic _ -> do
diagnostic $ pure "Starting run"
SRules{actions, builtinRules, userRules} <- runRules opts rs
diagnostic $ pure $ "Number of actions = " ++ show (length actions)
diagnostic $ pure $ "Number of builtin rules = " ++ show (Map.size builtinRules) ++ " " ++ show (Map.keys builtinRules)
diagnostic $ pure $ "Number of user rule types = " ++ show (TMap.size userRules)
diagnostic $ pure $ "Number of user rules = " ++ show (sum (TMap.toList (userRuleSize . userRuleContents) userRules))
checkShakeExtra shakeExtra
curdir <- getCurrentDirectory
database <- usingDatabase cleanup opts diagnostic builtinRules
(shared, cloud) <- loadSharedCloud database opts builtinRules
pure RunState{..}
-- Prepare for a fresh run by changing Result to Loaded | 866 | false | true | 0 | 16 | 183 | 294 | 139 | 155 | null | null |
ppenzin/taxes | src/Main.hs | bsd-3-clause | getAllWages :: FormW2 -> IO FormW2
getAllWages initW2 = putStrLn "Enter your W-2 data:"
>> promptW2
>>= \w2 -> yesno "Add one more W2 form?"
>>= \yes -> if yes then getAllWages(aggregateW2 initW2 w2) else return(aggregateW2 initW2 w2) | 291 | getAllWages :: FormW2 -> IO FormW2
getAllWages initW2 = putStrLn "Enter your W-2 data:"
>> promptW2
>>= \w2 -> yesno "Add one more W2 form?"
>>= \yes -> if yes then getAllWages(aggregateW2 initW2 w2) else return(aggregateW2 initW2 w2) | 291 | getAllWages initW2 = putStrLn "Enter your W-2 data:"
>> promptW2
>>= \w2 -> yesno "Add one more W2 form?"
>>= \yes -> if yes then getAllWages(aggregateW2 initW2 w2) else return(aggregateW2 initW2 w2) | 256 | false | true | 0 | 12 | 94 | 79 | 39 | 40 | null | null |
graninas/The-Amoeba-World | src/Amoeba/GameLogic/Language/Scheme.hs | gpl-3.0 | plasma = "Plasma" | 17 | plasma = "Plasma" | 17 | plasma = "Plasma" | 17 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
raichoo/Idris-dev | src/Idris/Elab/Record.hs | bsd-3-clause | projectInType :: [(Name, Name)] -> PTerm -> PTerm
projectInType xs = mapPT st
where
st :: PTerm -> PTerm
st (PRef fc hls n)
| Just pn <- lookup n xs = PApp fc (PRef fc hls pn) [pexp recRef]
st t = t
-- | Creates an PArg from a plicity and a name where the term is a PRef. | 292 | projectInType :: [(Name, Name)] -> PTerm -> PTerm
projectInType xs = mapPT st
where
st :: PTerm -> PTerm
st (PRef fc hls n)
| Just pn <- lookup n xs = PApp fc (PRef fc hls pn) [pexp recRef]
st t = t
-- | Creates an PArg from a plicity and a name where the term is a PRef. | 292 | projectInType xs = mapPT st
where
st :: PTerm -> PTerm
st (PRef fc hls n)
| Just pn <- lookup n xs = PApp fc (PRef fc hls pn) [pexp recRef]
st t = t
-- | Creates an PArg from a plicity and a name where the term is a PRef. | 242 | false | true | 1 | 9 | 81 | 128 | 58 | 70 | null | null |
rfw/castor | Std/Io.hs | mit | exports :: Exports
exports = Exports $ M.fromList [ (Sym "puts", puts)
] | 103 | exports :: Exports
exports = Exports $ M.fromList [ (Sym "puts", puts)
] | 103 | exports = Exports $ M.fromList [ (Sym "puts", puts)
] | 84 | false | true | 2 | 8 | 43 | 39 | 18 | 21 | null | null |
gbenison/fasta-utils | fastaorf.hs | gpl-3.0 | chunkString width str = (take width str):(chunkString width (drop width str)) | 77 | chunkString width str = (take width str):(chunkString width (drop width str)) | 77 | chunkString width str = (take width str):(chunkString width (drop width str)) | 77 | false | false | 0 | 9 | 10 | 39 | 19 | 20 | null | null |
green-haskell/ghc | compiler/utils/Util.hs | bsd-3-clause | nubSort :: Ord a => [a] -> [a]
nubSort = Set.toAscList . Set.fromList | 69 | nubSort :: Ord a => [a] -> [a]
nubSort = Set.toAscList . Set.fromList | 69 | nubSort = Set.toAscList . Set.fromList | 38 | false | true | 0 | 7 | 12 | 36 | 19 | 17 | null | null |
rlpowell/hblog | lib/HBlog/Spec.hs | mit | rm_rf :: FilePath -> IO ()
rm_rf dir = do
exists <- doesDirectoryExist dir
if exists then
removeDirectoryRecursive dir
else
return () | 147 | rm_rf :: FilePath -> IO ()
rm_rf dir = do
exists <- doesDirectoryExist dir
if exists then
removeDirectoryRecursive dir
else
return () | 147 | rm_rf dir = do
exists <- doesDirectoryExist dir
if exists then
removeDirectoryRecursive dir
else
return () | 120 | false | true | 0 | 10 | 35 | 57 | 25 | 32 | null | null |
tibbe/ghc | compiler/cmm/PprC.hs | bsd-3-clause | -- ToDo: correct?
machRep_F_CType W64 = ptext (sLit "StgDouble") | 64 | machRep_F_CType W64 = ptext (sLit "StgDouble") | 46 | machRep_F_CType W64 = ptext (sLit "StgDouble") | 46 | true | false | 0 | 7 | 8 | 19 | 9 | 10 | null | null |
tdietert/nanocoin | src/Key.hs | apache-2.0 | encodePrivateKey :: ECDSA.PrivateKey -> ByteString
encodePrivateKey = S.runPut . putPrivateKey | 94 | encodePrivateKey :: ECDSA.PrivateKey -> ByteString
encodePrivateKey = S.runPut . putPrivateKey | 94 | encodePrivateKey = S.runPut . putPrivateKey | 43 | false | true | 0 | 6 | 9 | 23 | 12 | 11 | null | null |
olsner/ghc | compiler/codeGen/StgCmmMonad.hs | bsd-3-clause | getVirtHp :: FCode VirtualHpOffset
getVirtHp
= do { hp_usage <- getHpUsage
; return (virtHp hp_usage) } | 114 | getVirtHp :: FCode VirtualHpOffset
getVirtHp
= do { hp_usage <- getHpUsage
; return (virtHp hp_usage) } | 114 | getVirtHp
= do { hp_usage <- getHpUsage
; return (virtHp hp_usage) } | 79 | false | true | 0 | 10 | 26 | 42 | 19 | 23 | null | null |
CindyLinz/Haskell.js | trans/src/Desugar/LambdaCase.hs | mit | deLambdaCaseNamespace (PatternNamespace l) = PatternNamespace (id l) | 68 | deLambdaCaseNamespace (PatternNamespace l) = PatternNamespace (id l) | 68 | deLambdaCaseNamespace (PatternNamespace l) = PatternNamespace (id l) | 68 | false | false | 0 | 7 | 6 | 24 | 11 | 13 | null | null |
locaweb/leela | src/warpdrive/src/Leela/Network/Protocol.hs | apache-2.0 | readTime :: B.ByteString -> Either Reply Time
readTime = fmap (fromSeconds . fromInt) . readDecimal
where
fromInt :: Int -> Double
fromInt = fromIntegral | 169 | readTime :: B.ByteString -> Either Reply Time
readTime = fmap (fromSeconds . fromInt) . readDecimal
where
fromInt :: Int -> Double
fromInt = fromIntegral | 169 | readTime = fmap (fromSeconds . fromInt) . readDecimal
where
fromInt :: Int -> Double
fromInt = fromIntegral | 123 | false | true | 0 | 8 | 39 | 52 | 27 | 25 | null | null |
mithrandi/advent2016 | Day16.hs | mit | encoded :: Iso' String (Seq Bool)
encoded = iso from' to'
where
to' = toList . fmap (bool '0' '1')
from' = fromList . map (== '1') | 140 | encoded :: Iso' String (Seq Bool)
encoded = iso from' to'
where
to' = toList . fmap (bool '0' '1')
from' = fromList . map (== '1') | 140 | encoded = iso from' to'
where
to' = toList . fmap (bool '0' '1')
from' = fromList . map (== '1') | 106 | false | true | 3 | 7 | 36 | 73 | 33 | 40 | null | null |
li-zhirui/EoplLangs | src/InferredLang/Evaluator.hs | bsd-3-clause | valueOf (BinOpExpr op expr1 expr2) env = evalBinOpExpr op expr1 expr2 env | 73 | valueOf (BinOpExpr op expr1 expr2) env = evalBinOpExpr op expr1 expr2 env | 73 | valueOf (BinOpExpr op expr1 expr2) env = evalBinOpExpr op expr1 expr2 env | 73 | false | false | 0 | 7 | 11 | 30 | 14 | 16 | null | null |
asr/apia | src/Apia/Translation.hs | mit | xiomsToAFors ∷ T [AF]
axiomsToAFors = do
axDefs ∷ Definitions ← getATPAxioms <$> getTDefs
zipWithM (toAFor TPTPAxiom) (HashMap.keys axDefs) (HashMap.elems axDefs)
| 168 | axiomsToAFors ∷ T [AF]
axiomsToAFors = do
axDefs ∷ Definitions ← getATPAxioms <$> getTDefs
zipWithM (toAFor TPTPAxiom) (HashMap.keys axDefs) (HashMap.elems axDefs) | 168 | axiomsToAFors = do
axDefs ∷ Definitions ← getATPAxioms <$> getTDefs
zipWithM (toAFor TPTPAxiom) (HashMap.keys axDefs) (HashMap.elems axDefs) | 145 | false | true | 0 | 10 | 26 | 64 | 31 | 33 | null | null |
girving/duck | duck/TypeSet.hs | bsd-3-clause | subset'' (TyStatic (Any x _)) y = subset'' x y | 46 | subset'' (TyStatic (Any x _)) y = subset'' x y | 46 | subset'' (TyStatic (Any x _)) y = subset'' x y | 46 | false | false | 1 | 9 | 9 | 32 | 14 | 18 | null | null |
gibiansky/hlint | data/Default.hs | bsd-3-clause | warn "Use map once" = map f (map g x) ==> map (f . g) x | 55 | warn "Use map once" = map f (map g x) ==> map (f . g) x | 55 | warn "Use map once" = map f (map g x) ==> map (f . g) x | 55 | false | false | 0 | 8 | 15 | 39 | 18 | 21 | null | null |
ThermalSpan/haskell-euler | src/ProjectEuler/Problem001.hs | bsd-3-clause | sumf :: Int -> Int
sumf n = sum [ x | x <- [1..(n-1)], (x `mod` 3 == 0) || (x `mod` 5 == 0)] | 92 | sumf :: Int -> Int
sumf n = sum [ x | x <- [1..(n-1)], (x `mod` 3 == 0) || (x `mod` 5 == 0)] | 92 | sumf n = sum [ x | x <- [1..(n-1)], (x `mod` 3 == 0) || (x `mod` 5 == 0)] | 73 | false | true | 0 | 11 | 25 | 78 | 43 | 35 | null | null |
cem3394/haskell | tensorflow-ops/src/TensorFlow/Gradient.hs | apache-2.0 | opGrad "LabelWeights" _ _ _ = [Nothing] | 39 | opGrad "LabelWeights" _ _ _ = [Nothing] | 39 | opGrad "LabelWeights" _ _ _ = [Nothing] | 39 | false | false | 0 | 5 | 6 | 18 | 9 | 9 | null | null |
BartAdv/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | gccDbg DEBUG = "-g" | 19 | gccDbg DEBUG = "-g" | 19 | gccDbg DEBUG = "-g" | 19 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
mstksg/ghc-typelits-natnormalise | tests/Tests.hs | bsd-2-clause | (x :> xs) ++ ys = x :> xs ++ ys | 31 | (x :> xs) ++ ys = x :> xs ++ ys | 31 | (x :> xs) ++ ys = x :> xs ++ ys | 31 | false | false | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
tpsinnem/Idris-dev | codegen/idris-codegen-c/Main.hs | bsd-3-clause | main :: IO ()
main = do opts <- getOpts
if (null (inputs opts))
then showUsage
else runMain (c_main opts) | 142 | main :: IO ()
main = do opts <- getOpts
if (null (inputs opts))
then showUsage
else runMain (c_main opts) | 142 | main = do opts <- getOpts
if (null (inputs opts))
then showUsage
else runMain (c_main opts) | 128 | false | true | 0 | 12 | 56 | 61 | 28 | 33 | null | null |
haslab/SecreC | src/Language/SecreC/Prover/Expression.hs | gpl-3.0 | corecall2Prover l "leq" [e1,e2] = return $ IBinOp ILeq e1 e2 | 63 | corecall2Prover l "leq" [e1,e2] = return $ IBinOp ILeq e1 e2 | 63 | corecall2Prover l "leq" [e1,e2] = return $ IBinOp ILeq e1 e2 | 63 | false | false | 0 | 6 | 13 | 30 | 15 | 15 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxRESET :: Int
wxRESET = 16384 | 30 | wxRESET :: Int
wxRESET = 16384 | 30 | wxRESET = 16384 | 15 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/cabal-install/Distribution/Client/Setup.hs | bsd-3-clause | --TODO: do we want to allow per-package flags?
parsePackageArgs :: [String] -> Either String [Dependency]
parsePackageArgs = parsePkgArgs []
where
parsePkgArgs ds [] = Right (reverse ds)
parsePkgArgs ds (arg:args) =
case readPToMaybe parseDependencyOrPackageId arg of
Just dep -> parsePkgArgs (dep:ds) args
Nothing -> Left $
show arg ++ " is not valid syntax for a package name or"
++ " package dependency." | 467 | parsePackageArgs :: [String] -> Either String [Dependency]
parsePackageArgs = parsePkgArgs []
where
parsePkgArgs ds [] = Right (reverse ds)
parsePkgArgs ds (arg:args) =
case readPToMaybe parseDependencyOrPackageId arg of
Just dep -> parsePkgArgs (dep:ds) args
Nothing -> Left $
show arg ++ " is not valid syntax for a package name or"
++ " package dependency." | 420 | parsePackageArgs = parsePkgArgs []
where
parsePkgArgs ds [] = Right (reverse ds)
parsePkgArgs ds (arg:args) =
case readPToMaybe parseDependencyOrPackageId arg of
Just dep -> parsePkgArgs (dep:ds) args
Nothing -> Left $
show arg ++ " is not valid syntax for a package name or"
++ " package dependency." | 361 | true | true | 1 | 11 | 122 | 136 | 62 | 74 | null | null |
ndmitchell/tagsoup | src/Text/HTML/TagSoup/Implementation.hs | bsd-3-clause | isEntityNum _ = False | 21 | isEntityNum _ = False | 21 | isEntityNum _ = False | 21 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
bitemyapp/roshask | src/executable/Types.hs | bsd-3-clause | msgName n@(x:xs) = MsgName n (toUpper x : xs) | 45 | msgName n@(x:xs) = MsgName n (toUpper x : xs) | 45 | msgName n@(x:xs) = MsgName n (toUpper x : xs) | 45 | false | false | 1 | 8 | 8 | 41 | 17 | 24 | null | null |
anchor/haskell-netsuite | lib/Netsuite/Connect.hs | bsd-3-clause | -- | Updates an object's sublist in Netsuite.
updateSublistNS
:: (IsNsRestletConfig cfg, IsNsSubtype st, IsNsId a, IsNsData d)
=> cfg -- ^ Restlet configuration
-> st -- ^ NetSuite entity subtype
-> a -- ^ Entity ID
-> [d] -- ^ List of sublist items to update sublist with
-> IO (Either RestletError Value)
updateSublistNS cfg st i d =
doNS (toNsRestletConfig cfg) $
NsActUpdateSublist (toNsSubtype st) (toNsId i) (map toNsData d) | 466 | updateSublistNS
:: (IsNsRestletConfig cfg, IsNsSubtype st, IsNsId a, IsNsData d)
=> cfg -- ^ Restlet configuration
-> st -- ^ NetSuite entity subtype
-> a -- ^ Entity ID
-> [d] -- ^ List of sublist items to update sublist with
-> IO (Either RestletError Value)
updateSublistNS cfg st i d =
doNS (toNsRestletConfig cfg) $
NsActUpdateSublist (toNsSubtype st) (toNsId i) (map toNsData d) | 420 | updateSublistNS cfg st i d =
doNS (toNsRestletConfig cfg) $
NsActUpdateSublist (toNsSubtype st) (toNsId i) (map toNsData d) | 135 | true | true | 0 | 13 | 107 | 126 | 64 | 62 | null | null |
fmapfmapfmap/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/Types/Product.hs | mpl-2.0 | -- | An 'AutoScalingThresholds' object that describes the upscaling
-- configuration, which defines how and when AWS OpsWorks increases the
-- number of instances.
lbascUpScaling :: Lens' LoadBasedAutoScalingConfiguration (Maybe AutoScalingThresholds)
lbascUpScaling = lens _lbascUpScaling (\ s a -> s{_lbascUpScaling = a}) | 323 | lbascUpScaling :: Lens' LoadBasedAutoScalingConfiguration (Maybe AutoScalingThresholds)
lbascUpScaling = lens _lbascUpScaling (\ s a -> s{_lbascUpScaling = a}) | 159 | lbascUpScaling = lens _lbascUpScaling (\ s a -> s{_lbascUpScaling = a}) | 71 | true | true | 0 | 9 | 40 | 48 | 27 | 21 | null | null |
rsasse/tamarin-prover | lib/utils/src/Text/Dot.hs | gpl-3.0 | -- | Concatenate records vertically.
vcat :: [Record a] -> Record a
vcat = VCat | 79 | vcat :: [Record a] -> Record a
vcat = VCat | 42 | vcat = VCat | 11 | true | true | 0 | 7 | 14 | 25 | 13 | 12 | null | null |
jtojnar/haste-compiler | libraries/ghc-7.10/ghc-prim/GHC/PrimopWrappers.hs | bsd-3-clause | clz8# :: Word# -> Word#
clz8# a1 = (GHC.Prim.clz8#) a1 | 54 | clz8# :: Word# -> Word#
clz8# a1 = (GHC.Prim.clz8#) a1 | 54 | clz8# a1 = (GHC.Prim.clz8#) a1 | 30 | false | true | 0 | 7 | 9 | 32 | 15 | 17 | null | null |
albertov/reflex-openlayers | src/Reflex/OpenLayers/Source.hs | bsd-3-clause | tileXYZ
:: String -> Double -> WithSomeCrs (Source Raster Tile t)
tileXYZ url scaleFactor = tileXYZ' def url scaleFactor (256, 256) | 133 | tileXYZ
:: String -> Double -> WithSomeCrs (Source Raster Tile t)
tileXYZ url scaleFactor = tileXYZ' def url scaleFactor (256, 256) | 133 | tileXYZ url scaleFactor = tileXYZ' def url scaleFactor (256, 256) | 65 | false | true | 0 | 10 | 22 | 56 | 27 | 29 | null | null |
flipstone/kioku | src/Database/Kioku/Memorizable.hs | mit | memorizeInt16 :: Int16 -> BS.ByteString
memorizeInt16 = memorizeWord16 . fromIntegral | 85 | memorizeInt16 :: Int16 -> BS.ByteString
memorizeInt16 = memorizeWord16 . fromIntegral | 85 | memorizeInt16 = memorizeWord16 . fromIntegral | 45 | false | true | 0 | 6 | 9 | 21 | 11 | 10 | null | null |
brendanhay/gogol | gogol-docs/gen/Network/Google/Docs/Types/Product.hs | mpl-2.0 | -- | The result of creating a footnote.
rCreateFootNote :: Lens' Response (Maybe CreateFootNoteResponse)
rCreateFootNote
= lens _rCreateFootNote
(\ s a -> s{_rCreateFootNote = a}) | 187 | rCreateFootNote :: Lens' Response (Maybe CreateFootNoteResponse)
rCreateFootNote
= lens _rCreateFootNote
(\ s a -> s{_rCreateFootNote = a}) | 147 | rCreateFootNote
= lens _rCreateFootNote
(\ s a -> s{_rCreateFootNote = a}) | 82 | true | true | 0 | 9 | 32 | 48 | 25 | 23 | null | null |
mainland/dph | dph-prim-interface/Data/Array/Parallel/Unlifted.hs | bsd-3-clause | ------------------------------------------------------------------------------
notImplemented :: P.String -> a
notImplemented fnName
= P.error $ P.unlines
[ "dph-prim-interface:Data.Array.Parallel.Unlifted." P.++ fnName
, "This module is an abstract interface and does not contain real code."
, "Use dph-prim-seq or dph-prim-par instead." ] | 344 | notImplemented :: P.String -> a
notImplemented fnName
= P.error $ P.unlines
[ "dph-prim-interface:Data.Array.Parallel.Unlifted." P.++ fnName
, "This module is an abstract interface and does not contain real code."
, "Use dph-prim-seq or dph-prim-par instead." ] | 265 | notImplemented fnName
= P.error $ P.unlines
[ "dph-prim-interface:Data.Array.Parallel.Unlifted." P.++ fnName
, "This module is an abstract interface and does not contain real code."
, "Use dph-prim-seq or dph-prim-par instead." ] | 233 | true | true | 0 | 6 | 39 | 47 | 25 | 22 | null | null |
pparkkin/eta | compiler/ETA/BasicTypes/OccName.hs | bsd-3-clause | mkVectIsoOcc = mk_simple_deriv_with varName "$vi" | 56 | mkVectIsoOcc = mk_simple_deriv_with varName "$vi" | 56 | mkVectIsoOcc = mk_simple_deriv_with varName "$vi" | 56 | false | false | 0 | 5 | 11 | 11 | 5 | 6 | null | null |
phadej/lens-aeson | src/Data/Aeson/Lens.hs | mit | lazyTextUtf8 :: Iso' LazyText.Text Lazy.ByteString
lazyTextUtf8 = iso LazyText.encodeUtf8 LazyText.decodeUtf8 | 109 | lazyTextUtf8 :: Iso' LazyText.Text Lazy.ByteString
lazyTextUtf8 = iso LazyText.encodeUtf8 LazyText.decodeUtf8 | 109 | lazyTextUtf8 = iso LazyText.encodeUtf8 LazyText.decodeUtf8 | 58 | false | true | 0 | 6 | 9 | 29 | 14 | 15 | null | null |
inq/agitpunkt | src/Core/Response.hs | agpl-3.0 | error :: Int -> Text -> Response
-- ^ Error page
error code = Response defaultVersion code [] | 93 | error :: Int -> Text -> Response
error code = Response defaultVersion code [] | 77 | error code = Response defaultVersion code [] | 44 | true | true | 0 | 6 | 17 | 32 | 16 | 16 | null | null |
prt2121/haskell-practice | okasaki/src/Main.hs | apache-2.0 | merge xs@(x:xs') ys@(y:ys') =
if x <= y then x : merge xs' ys else y : merge xs ys' | 85 | merge xs@(x:xs') ys@(y:ys') =
if x <= y then x : merge xs' ys else y : merge xs ys' | 85 | merge xs@(x:xs') ys@(y:ys') =
if x <= y then x : merge xs' ys else y : merge xs ys' | 85 | false | false | 0 | 8 | 21 | 61 | 32 | 29 | null | null |
kdungs/adventofcode2016 | 08.hs | mit | offRow = makeRow Off | 20 | offRow = makeRow Off | 20 | offRow = makeRow Off | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
yesodweb/yesod | yesod/Yesod/Default/Config2.hs | mit | -- | Load the settings from the following three sources:
--
-- * Run time config files
--
-- * Run time environment variables
--
-- * The default compile time config file
loadAppSettings
:: FromJSON settings
=> [FilePath] -- ^ run time config files to use, earlier files have precedence
-> [Value] -- ^ any other values to use, usually from compile time config. overridden by files
-> EnvUsage
-> IO settings
loadAppSettings = loadYamlSettings | 463 | loadAppSettings
:: FromJSON settings
=> [FilePath] -- ^ run time config files to use, earlier files have precedence
-> [Value] -- ^ any other values to use, usually from compile time config. overridden by files
-> EnvUsage
-> IO settings
loadAppSettings = loadYamlSettings | 292 | loadAppSettings = loadYamlSettings | 34 | true | true | 0 | 9 | 95 | 48 | 29 | 19 | null | null |
jwiegley/ghc-release | libraries/binary/benchmarks/Builder.hs | gpl-3.0 | from4Word8s :: [Word8] -> Builder
from4Word8s [] = mempty | 57 | from4Word8s :: [Word8] -> Builder
from4Word8s [] = mempty | 57 | from4Word8s [] = mempty | 23 | false | true | 0 | 6 | 8 | 23 | 12 | 11 | null | null |
alexbiehl/hoop | hadoop-protos/src/Hadoop/Protos/YarnProtos/YarnApplicationStateProto.hs | mit | toMaybe'Enum 2 = Prelude'.Just NEW_SAVING | 41 | toMaybe'Enum 2 = Prelude'.Just NEW_SAVING | 41 | toMaybe'Enum 2 = Prelude'.Just NEW_SAVING | 41 | false | false | 1 | 6 | 4 | 17 | 6 | 11 | null | null |
MateVM/hs-java | JVM/Builder/Instructions.hs | lgpl-3.0 | lushr :: Generator e g => g e ()
lushr = i0 LUSHR | 51 | lushr :: Generator e g => g e ()
lushr = i0 LUSHR | 51 | lushr = i0 LUSHR | 18 | false | true | 0 | 7 | 14 | 30 | 14 | 16 | null | null |
philopon/atomos | Text/Atomos/Atom/Export.hs | mit | linkContSummary :: Either Content NoContent -> (DList (Tag S.ByteString), DList (Tag S.ByteString), DList (Tag S.ByteString))
linkContSummary = either ((\(c, s) -> (mempty, c, s)) . contentSummary) ((\(l, s) -> (l, mempty, s)) . noContSummary) | 243 | linkContSummary :: Either Content NoContent -> (DList (Tag S.ByteString), DList (Tag S.ByteString), DList (Tag S.ByteString))
linkContSummary = either ((\(c, s) -> (mempty, c, s)) . contentSummary) ((\(l, s) -> (l, mempty, s)) . noContSummary) | 243 | linkContSummary = either ((\(c, s) -> (mempty, c, s)) . contentSummary) ((\(l, s) -> (l, mempty, s)) . noContSummary) | 117 | false | true | 0 | 12 | 33 | 133 | 72 | 61 | null | null |
ancientlanguage/haskell-analysis | grammar/src/Grammar/Common/Decompose.hs | mit | decomposeChar '\xFA35' = "\x5351" | 33 | decomposeChar '\xFA35' = "\x5351" | 33 | decomposeChar '\xFA35' = "\x5351" | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
siddhanathan/yi | yi-core/src/Yi/Layout.hs | gpl-2.0 | layoutToRectangles nb bounds (Stack o ts) = handleStack o bounds ts'
where ts' = if o == Vertical then setNbs nb ts
else case ts of
(l, s) : xs -> (l, s, nb) : setNbs True xs
[] -> []
setNbs val = map (\(l, s) -> (l, s, val)) | 310 | layoutToRectangles nb bounds (Stack o ts) = handleStack o bounds ts'
where ts' = if o == Vertical then setNbs nb ts
else case ts of
(l, s) : xs -> (l, s, nb) : setNbs True xs
[] -> []
setNbs val = map (\(l, s) -> (l, s, val)) | 310 | layoutToRectangles nb bounds (Stack o ts) = handleStack o bounds ts'
where ts' = if o == Vertical then setNbs nb ts
else case ts of
(l, s) : xs -> (l, s, nb) : setNbs True xs
[] -> []
setNbs val = map (\(l, s) -> (l, s, val)) | 310 | false | false | 2 | 10 | 135 | 145 | 72 | 73 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.