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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tjakway/ghcjvm | compiler/utils/Util.hs | bsd-3-clause | isIn msg x ys
= elem100 0 x ys
where
elem100 :: Eq a => Int -> a -> [a] -> Bool
elem100 _ _ [] = False
elem100 i x (y:ys)
| i > 100 = trace ("Over-long elem in " ++ msg) (x `elem` (y:ys))
| otherwise = x == y || elem100 (i + 1) x ys | 260 | isIn msg x ys
= elem100 0 x ys
where
elem100 :: Eq a => Int -> a -> [a] -> Bool
elem100 _ _ [] = False
elem100 i x (y:ys)
| i > 100 = trace ("Over-long elem in " ++ msg) (x `elem` (y:ys))
| otherwise = x == y || elem100 (i + 1) x ys | 260 | isIn msg x ys
= elem100 0 x ys
where
elem100 :: Eq a => Int -> a -> [a] -> Bool
elem100 _ _ [] = False
elem100 i x (y:ys)
| i > 100 = trace ("Over-long elem in " ++ msg) (x `elem` (y:ys))
| otherwise = x == y || elem100 (i + 1) x ys | 260 | false | false | 3 | 11 | 87 | 177 | 80 | 97 | null | null |
mjoldfield/plotfont | src/Graphics/PlotFont.hs | gpl-2.0 | -- this is like T.sequence but gives all the Lefts if any exist
leftsOrRights :: [Either a b] -> Either [a] [b]
leftsOrRights = pick . E.partitionEithers
where pick ([],bs) = Right bs
pick (as,_) = Left as | 225 | leftsOrRights :: [Either a b] -> Either [a] [b]
leftsOrRights = pick . E.partitionEithers
where pick ([],bs) = Right bs
pick (as,_) = Left as | 161 | leftsOrRights = pick . E.partitionEithers
where pick ([],bs) = Right bs
pick (as,_) = Left as | 113 | true | true | 0 | 9 | 57 | 79 | 42 | 37 | null | null |
DavidAlphaFox/ghc | compiler/coreSyn/TrieMap.hs | bsd-3-clause | xtE :: CmEnv -> CoreExpr -> XT a -> CoreMap a -> CoreMap a
xtE env e f EmptyCM = xtE env e f wrapEmptyCM | 117 | xtE :: CmEnv -> CoreExpr -> XT a -> CoreMap a -> CoreMap a
xtE env e f EmptyCM = xtE env e f wrapEmptyCM | 117 | xtE env e f EmptyCM = xtE env e f wrapEmptyCM | 58 | false | true | 0 | 10 | 37 | 58 | 26 | 32 | null | null |
beni55/haste-compiler | libraries/ghc-7.8/base/System/Console/GetOpt.hs | bsd-3-clause | getNext ('-':'-':xs) rest optDescr = longOpt xs rest optDescr | 61 | getNext ('-':'-':xs) rest optDescr = longOpt xs rest optDescr | 61 | getNext ('-':'-':xs) rest optDescr = longOpt xs rest optDescr | 61 | false | false | 0 | 8 | 8 | 31 | 15 | 16 | null | null |
xelxebar/xmppcat | src/Main.hs | gpl-3.0 | defaultMsgSpec :: MsgSpec
defaultMsgSpec = MsgSpec { host = ""
, user = ""
, pass = ""
, rxId = ""
, text = "" } | 212 | defaultMsgSpec :: MsgSpec
defaultMsgSpec = MsgSpec { host = ""
, user = ""
, pass = ""
, rxId = ""
, text = "" } | 212 | defaultMsgSpec = MsgSpec { host = ""
, user = ""
, pass = ""
, rxId = ""
, text = "" } | 186 | false | true | 0 | 6 | 126 | 43 | 27 | 16 | null | null |
kevintvh/sodium | denotational/Reactive/Sodium/Denotational.hs | bsd-3-clause | occs (MapS f s) = map (\(t, a) -> (t, f a)) (occs s) | 52 | occs (MapS f s) = map (\(t, a) -> (t, f a)) (occs s) | 52 | occs (MapS f s) = map (\(t, a) -> (t, f a)) (occs s) | 52 | false | false | 0 | 9 | 13 | 53 | 27 | 26 | null | null |
sopvop/cabal | Cabal/Distribution/Simple.hs | bsd-3-clause | hscolourAction :: UserHooks -> HscolourFlags -> Args -> IO ()
hscolourAction hooks flags args = do
distPref <- findDistPrefOrDefault (hscolourDistPref flags)
let verbosity = fromFlag $ hscolourVerbosity flags
flags' = flags { hscolourDistPref = toFlag distPref }
hookedAction preHscolour hscolourHook... | 427 | hscolourAction :: UserHooks -> HscolourFlags -> Args -> IO ()
hscolourAction hooks flags args = do
distPref <- findDistPrefOrDefault (hscolourDistPref flags)
let verbosity = fromFlag $ hscolourVerbosity flags
flags' = flags { hscolourDistPref = toFlag distPref }
hookedAction preHscolour hscolourHook... | 427 | hscolourAction hooks flags args = do
distPref <- findDistPrefOrDefault (hscolourDistPref flags)
let verbosity = fromFlag $ hscolourVerbosity flags
flags' = flags { hscolourDistPref = toFlag distPref }
hookedAction preHscolour hscolourHook postHscolour
(getBuildConfig hooks verbosity... | 365 | false | true | 0 | 12 | 101 | 111 | 53 | 58 | null | null |
FranklinChen/Idris-dev | src/Idris/IBC.hs | bsd-3-clause | processParsedSpan :: Archive -> Idris ()
processParsedSpan ar = do
fc <- getEntry Nothing "ibc_parsedSpan" ar
updateIState (\i -> i { idris_parsedSpan = fc }) | 166 | processParsedSpan :: Archive -> Idris ()
processParsedSpan ar = do
fc <- getEntry Nothing "ibc_parsedSpan" ar
updateIState (\i -> i { idris_parsedSpan = fc }) | 166 | processParsedSpan ar = do
fc <- getEntry Nothing "ibc_parsedSpan" ar
updateIState (\i -> i { idris_parsedSpan = fc }) | 125 | false | true | 0 | 12 | 32 | 64 | 30 | 34 | null | null |
Numberartificial/workflow | snipets/src/Craft/Chapter15/MakeTree.hs | mit | insTree t (t1:ts)
| (value t <= value t1) = t:t1:ts
| otherwise = t1 : insTree t ts | 106 | insTree t (t1:ts)
| (value t <= value t1) = t:t1:ts
| otherwise = t1 : insTree t ts | 106 | insTree t (t1:ts)
| (value t <= value t1) = t:t1:ts
| otherwise = t1 : insTree t ts | 106 | false | false | 6 | 10 | 41 | 72 | 30 | 42 | null | null |
liamoc/geordi | Geordi/UrlPattern/Internal.hs | bsd-3-clause | linkWitness (x :/ xs)
= let f = case x of
Param {} -> ConsW
Query {} -> ConsW
Posted {} -> id
Cookie {} -> id
QueryOpt {} -> ConsW
PostedOpt {} -> id
CookieOpt {} -> id
File {} -> id
FileOpt {} -> id
... | 513 | linkWitness (x :/ xs)
= let f = case x of
Param {} -> ConsW
Query {} -> ConsW
Posted {} -> id
Cookie {} -> id
QueryOpt {} -> ConsW
PostedOpt {} -> id
CookieOpt {} -> id
File {} -> id
FileOpt {} -> id
... | 513 | linkWitness (x :/ xs)
= let f = case x of
Param {} -> ConsW
Query {} -> ConsW
Posted {} -> id
Cookie {} -> id
QueryOpt {} -> ConsW
PostedOpt {} -> id
CookieOpt {} -> id
File {} -> id
FileOpt {} -> id
... | 513 | false | false | 2 | 12 | 274 | 191 | 93 | 98 | null | null |
KrzyStar/binary-low-level | src/Data/Binary/Strict/IncrementalGet.hs | bsd-3-clause | strictToLazy :: B.ByteString -> BL.ByteString
strictToLazy x
| B.null x = BL.Empty
| otherwise = BL.Chunk x BL.Empty | 120 | strictToLazy :: B.ByteString -> BL.ByteString
strictToLazy x
| B.null x = BL.Empty
| otherwise = BL.Chunk x BL.Empty | 120 | strictToLazy x
| B.null x = BL.Empty
| otherwise = BL.Chunk x BL.Empty | 74 | false | true | 1 | 9 | 21 | 51 | 24 | 27 | null | null |
KirillTim/raft-haskell | test/Spec.hs | bsd-3-clause | testLogT42Len2 :: [LogEntry]
testLogT42Len2 = [LogEntry 0 1 (Put "k" "v"), LogEntry 1 42 (Put "k1" "v1")] | 105 | testLogT42Len2 :: [LogEntry]
testLogT42Len2 = [LogEntry 0 1 (Put "k" "v"), LogEntry 1 42 (Put "k1" "v1")] | 105 | testLogT42Len2 = [LogEntry 0 1 (Put "k" "v"), LogEntry 1 42 (Put "k1" "v1")] | 76 | false | true | 0 | 8 | 16 | 50 | 26 | 24 | null | null |
RefactoringTools/HaRe | test/DeleteDefSpec.hs | bsd-3-clause | main :: IO ()
main = do
hspec spec | 36 | main :: IO ()
main = do
hspec spec | 36 | main = do
hspec spec | 22 | false | true | 0 | 8 | 10 | 28 | 11 | 17 | null | null |
GaloisInc/pads-haskell | Examples/Regression.hs | bsd-3-clause | result46 = t46 == ppt46 | 23 | result46 = t46 == ppt46 | 23 | result46 = t46 == ppt46 | 23 | false | false | 0 | 5 | 4 | 10 | 5 | 5 | null | null |
ditto/ditto | src/Ditto/Parse.hs | gpl-3.0 | parseParams :: Parser Tel
parseParams = try $ do
_As <- parseTel
symKind
return _As | 89 | parseParams :: Parser Tel
parseParams = try $ do
_As <- parseTel
symKind
return _As | 89 | parseParams = try $ do
_As <- parseTel
symKind
return _As | 63 | false | true | 1 | 9 | 20 | 38 | 15 | 23 | null | null |
ganeti/htools | Ganeti/HTools/Instance.hs | gpl-2.0 | shrinkByType inst T.FailDisk = let v = dsk inst - T.unitDsk
in if v < T.unitDsk
then T.Bad "out of disk"
else T.Ok inst { dsk = v } | 230 | shrinkByType inst T.FailDisk = let v = dsk inst - T.unitDsk
in if v < T.unitDsk
then T.Bad "out of disk"
else T.Ok inst { dsk = v } | 230 | shrinkByType inst T.FailDisk = let v = dsk inst - T.unitDsk
in if v < T.unitDsk
then T.Bad "out of disk"
else T.Ok inst { dsk = v } | 230 | false | false | 0 | 10 | 127 | 67 | 32 | 35 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/Window.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/Window.matchMedia Mozilla Window.matchMedia documentation>
matchMedia ::
(MonadDOM m, ToJSString query) =>
Window -> query -> m MediaQueryList
matchMedia self query
= liftDOM
((self ^. jsf "matchMedia" [toJSVal query]) >>= fromJSVal... | 330 | matchMedia ::
(MonadDOM m, ToJSString query) =>
Window -> query -> m MediaQueryList
matchMedia self query
= liftDOM
((self ^. jsf "matchMedia" [toJSVal query]) >>= fromJSValUnchecked) | 215 | matchMedia self query
= liftDOM
((self ^. jsf "matchMedia" [toJSVal query]) >>= fromJSValUnchecked) | 107 | true | true | 0 | 12 | 64 | 71 | 36 | 35 | null | null |
jaanos/TPJ-2015-16 | lmh/examples_lmh.hs | mit | ieve l = cons (hd l) (sieve (fltr (notdivides (hd l)) (tl l))) | 63 | sieve l = cons (hd l) (sieve (fltr (notdivides (hd l)) (tl l))) | 63 | sieve l = cons (hd l) (sieve (fltr (notdivides (hd l)) (tl l))) | 63 | false | false | 0 | 13 | 13 | 52 | 25 | 27 | null | null |
plneappl/HasKlax | src/BlockDrawing.hs | bsd-3-clause | drawBlock h (B BOrange) = color (dim orange) $ rectangleSolid blockWidth h | 81 | drawBlock h (B BOrange) = color (dim orange) $ rectangleSolid blockWidth h | 81 | drawBlock h (B BOrange) = color (dim orange) $ rectangleSolid blockWidth h | 81 | false | false | 0 | 7 | 18 | 37 | 16 | 21 | null | null |
Numberartificial/workflow | snipets/src/Demo/LenseDemo.hs | mit | main = print (location.x +~ 10 $ player1) | 41 | main = print (location.x +~ 10 $ player1) | 41 | main = print (location.x +~ 10 $ player1) | 41 | false | false | 1 | 9 | 7 | 26 | 11 | 15 | null | null |
orchid-hybrid/WHILE | EllaBased/Language.hs | gpl-2.0 | eop Sub = (-) | 13 | eop Sub = (-) | 13 | eop Sub = (-) | 13 | false | false | 0 | 4 | 3 | 12 | 6 | 6 | null | null |
ibabushkin/morgue-server | src/Util.hs | gpl-3.0 | -- | patch a file using the common UNIX utility
patchFile :: File -> Text -> IO File
patchFile file patch = do
(path, handle) <- openTempFile (unpack . getFName $ fileName file) ""
hPutStr handle (fileContents file)
hClose handle
output <- readProcess "patch" [path] (unpack patch)
newFile <- TIO.rea... | 482 | patchFile :: File -> Text -> IO File
patchFile file patch = do
(path, handle) <- openTempFile (unpack . getFName $ fileName file) ""
hPutStr handle (fileContents file)
hClose handle
output <- readProcess "patch" [path] (unpack patch)
newFile <- TIO.readFile path
removeFile path
return file {... | 434 | patchFile file patch = do
(path, handle) <- openTempFile (unpack . getFName $ fileName file) ""
hPutStr handle (fileContents file)
hClose handle
output <- readProcess "patch" [path] (unpack patch)
newFile <- TIO.readFile path
removeFile path
return file { fileContents = newFile }
-- | get a... | 397 | true | true | 0 | 11 | 107 | 137 | 65 | 72 | null | null |
alexander-at-github/eta | compiler/ETA/Main/Packages.hs | bsd-3-clause | getPackageLibJars :: DynFlags -> [PackageKey] -> IO [String]
getPackageLibJars dflags pkgs = do
packages <- getPreloadPackagesAnd dflags pkgs
-- TODO: Include extra libraries too
jarPaths <- forM packages $ \pc -> do
let hsLibs = packageHsLibJars dflags pc
libDirs = nub $ libraryDirs pc
filterM do... | 406 | getPackageLibJars :: DynFlags -> [PackageKey] -> IO [String]
getPackageLibJars dflags pkgs = do
packages <- getPreloadPackagesAnd dflags pkgs
-- TODO: Include extra libraries too
jarPaths <- forM packages $ \pc -> do
let hsLibs = packageHsLibJars dflags pc
libDirs = nub $ libraryDirs pc
filterM do... | 406 | getPackageLibJars dflags pkgs = do
packages <- getPreloadPackagesAnd dflags pkgs
-- TODO: Include extra libraries too
jarPaths <- forM packages $ \pc -> do
let hsLibs = packageHsLibJars dflags pc
libDirs = nub $ libraryDirs pc
filterM doesFileExist [ dir </> jar | jar <- hsLibs, dir <- libDirs ]
... | 345 | false | true | 0 | 16 | 85 | 132 | 63 | 69 | null | null |
dimara/ganeti | src/Ganeti/WConfd/ConfigModifications.hs | bsd-2-clause | -- * RPC checks
-- | Verifications done before adding an instance.
-- Currently confirms that the instance's macs are not
-- in use, and that the instance's UUID being
-- present (or not present) in the config based on
-- weather the instance is being replaced (or not).
--
-- TODO: add more verifications to this call;... | 1,546 | addInstanceChecks :: Instance
-> Bool
-> ConfigState
-> GenericResult GanetiException ()
addInstanceChecks inst replace cs = do
let macsInUse = S.fromList (map nicMac (instNics inst))
`S.intersection` getAllMACs cs
unless (S.null macsInUse) . B... | 1,163 | addInstanceChecks inst replace cs = do
let macsInUse = S.fromList (map nicMac (instNics inst))
`S.intersection` getAllMACs cs
unless (S.null macsInUse) . Bad . ConfigurationError $ printf
"Cannot add instance %s; MAC addresses %s already in use"
(show $ instName inst) (show macsInUse)
if... | 1,020 | true | true | 0 | 15 | 404 | 265 | 131 | 134 | null | null |
lynnard/reflex-cocos2d | src/Reflex/Cocos2d/Attributes/Node.hs | mit | skewY :: (MonadIO m, NodePtr n) => Attrib' n m Float
skewY = hoistA liftIO $ Attrib node_getSkewY node_setSkewY | 111 | skewY :: (MonadIO m, NodePtr n) => Attrib' n m Float
skewY = hoistA liftIO $ Attrib node_getSkewY node_setSkewY | 111 | skewY = hoistA liftIO $ Attrib node_getSkewY node_setSkewY | 58 | false | true | 0 | 7 | 18 | 50 | 23 | 27 | null | null |
afcondon/cluedoHS | cluedo.hs | mit | evalSuggestion :: Suggestion -> [Hand] -> [Bool]
evalSuggestion _ [] = [] | 73 | evalSuggestion :: Suggestion -> [Hand] -> [Bool]
evalSuggestion _ [] = [] | 73 | evalSuggestion _ [] = [] | 24 | false | true | 0 | 7 | 11 | 34 | 18 | 16 | null | null |
vTurbine/ghc | compiler/hsSyn/HsDecls.hs | bsd-3-clause | isClosedTypeFamilyInfo _ = False | 52 | isClosedTypeFamilyInfo _ = False | 52 | isClosedTypeFamilyInfo _ = False | 52 | false | false | 0 | 5 | 23 | 9 | 4 | 5 | null | null |
ivan-m/servant-auth-token | src/Servant/Server/Auth/Token.hs | bsd-3-clause | authUserPatch :: AuthHandler m
=> UserId -- ^ User id
-> PatchUser -- ^ JSON with fields for patching
-> MToken' '["auth-update"] -- ^ Authorisation header with token
-> m Unit
authUserPatch uid' body token = do
guardAuthToken token
whenJust (patchUserPassword body) guardPassword
let uid = toKey uid'
us... | 534 | authUserPatch :: AuthHandler m
=> UserId -- ^ User id
-> PatchUser -- ^ JSON with fields for patching
-> MToken' '["auth-update"] -- ^ Authorisation header with token
-> m Unit
authUserPatch uid' body token = do
guardAuthToken token
whenJust (patchUserPassword body) guardPassword
let uid = toKey uid'
us... | 534 | authUserPatch uid' body token = do
guardAuthToken token
whenJust (patchUserPassword body) guardPassword
let uid = toKey uid'
user <- guardUser uid
strength <- getsConfig passwordsStrength
WithField _ user' <- patchUser strength body $ WithField uid user
replaceUserImpl uid user'
return Unit
-- | Implem... | 349 | false | true | 0 | 12 | 103 | 149 | 65 | 84 | null | null |
graninas/Haskell-Algorithms | Tests/TextRatio3.hs | gpl-3.0 | ape symbol | symbol == C.singleton '\n' = C.pack "<br />"
| otherwise = symbol
r | 95 | escape symbol | symbol == C.singleton '\n' = C.pack "<br />"
| otherwise = symbol | 95 | escape symbol | symbol == C.singleton '\n' = C.pack "<br />"
| otherwise = symbol | 95 | false | false | 0 | 10 | 30 | 41 | 17 | 24 | null | null |
mlite/hLLVM | src/Llvm/Asm/Simplification.hs | bsd-3-clause | rnToplevel2 m (ToplevelDefine (TlDefine fp@(FunctionPrototype _ _ _ _ _ _ fhName _ _ _ _ _ _ _ _ _) bs)) =
let (fp2, bs2) = R.runReader (do { fp' <- rnDefFunctionPrototype2 fp
; bs' <- S.mapM rnBlock2 bs
; return (fp', bs')
... | 391 | rnToplevel2 m (ToplevelDefine (TlDefine fp@(FunctionPrototype _ _ _ _ _ _ fhName _ _ _ _ _ _ _ _ _) bs)) =
let (fp2, bs2) = R.runReader (do { fp' <- rnDefFunctionPrototype2 fp
; bs' <- S.mapM rnBlock2 bs
; return (fp', bs')
... | 391 | rnToplevel2 m (ToplevelDefine (TlDefine fp@(FunctionPrototype _ _ _ _ _ _ fhName _ _ _ _ _ _ _ _ _) bs)) =
let (fp2, bs2) = R.runReader (do { fp' <- rnDefFunctionPrototype2 fp
; bs' <- S.mapM rnBlock2 bs
; return (fp', bs')
... | 391 | false | false | 0 | 15 | 163 | 153 | 78 | 75 | null | null |
ivan-m/unordered-graphs | src/Data/Graph/Unordered.hs | mit | hasEdge :: Graph et n nl el -> Edge -> Bool
hasEdge g e = HM.member e (edgeMap g) | 81 | hasEdge :: Graph et n nl el -> Edge -> Bool
hasEdge g e = HM.member e (edgeMap g) | 81 | hasEdge g e = HM.member e (edgeMap g) | 37 | false | true | 0 | 7 | 18 | 46 | 22 | 24 | null | null |
Gabriel439/Haskell-Dhall-Library | dhall/src/Dhall/Parser/Token.hs | bsd-3-clause | subDelims :: Char -> Bool
subDelims c = c `elem` ("!$&'*+;=" :: String) | 71 | subDelims :: Char -> Bool
subDelims c = c `elem` ("!$&'*+;=" :: String) | 71 | subDelims c = c `elem` ("!$&'*+;=" :: String) | 45 | false | true | 0 | 7 | 12 | 38 | 19 | 19 | null | null |
pbv/codex | src/Codex/Submission.hs | mit | patternSplices :: Patterns -> ISplices
patternSplices patts
= sequence_ [ field ## I.textSplice (fromMaybe "" pat) | (field, pat) <- patts] | 141 | patternSplices :: Patterns -> ISplices
patternSplices patts
= sequence_ [ field ## I.textSplice (fromMaybe "" pat) | (field, pat) <- patts] | 141 | patternSplices patts
= sequence_ [ field ## I.textSplice (fromMaybe "" pat) | (field, pat) <- patts] | 102 | false | true | 0 | 10 | 22 | 55 | 28 | 27 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F06.hs | bsd-3-clause | ptr_glDisableIndexedEXT :: FunPtr (GLenum -> GLuint -> IO ())
ptr_glDisableIndexedEXT = unsafePerformIO $ getCommand "glDisableIndexedEXT" | 138 | ptr_glDisableIndexedEXT :: FunPtr (GLenum -> GLuint -> IO ())
ptr_glDisableIndexedEXT = unsafePerformIO $ getCommand "glDisableIndexedEXT" | 138 | ptr_glDisableIndexedEXT = unsafePerformIO $ getCommand "glDisableIndexedEXT" | 76 | false | true | 0 | 10 | 14 | 37 | 18 | 19 | null | null |
brendanhay/gogol | gogol-play-moviespartner/gen/Network/Google/PlayMoviesPartner/Types/Product.hs | mpl-2.0 | -- | See \'List methods rules\' for info about this field.
lsirNextPageToken :: Lens' ListStoreInfosResponse (Maybe Text)
lsirNextPageToken
= lens _lsirNextPageToken
(\ s a -> s{_lsirNextPageToken = a}) | 210 | lsirNextPageToken :: Lens' ListStoreInfosResponse (Maybe Text)
lsirNextPageToken
= lens _lsirNextPageToken
(\ s a -> s{_lsirNextPageToken = a}) | 151 | lsirNextPageToken
= lens _lsirNextPageToken
(\ s a -> s{_lsirNextPageToken = a}) | 88 | true | true | 0 | 9 | 35 | 48 | 25 | 23 | null | null |
cdepillabout/ssh | src/SSH/Numbers.hs | bsd-3-clause | sshMsgServiceAccept :: SSHMsgNumber
sshMsgServiceAccept = SSHMsgNumber 6 | 72 | sshMsgServiceAccept :: SSHMsgNumber
sshMsgServiceAccept = SSHMsgNumber 6 | 72 | sshMsgServiceAccept = SSHMsgNumber 6 | 36 | false | true | 0 | 6 | 6 | 20 | 8 | 12 | null | null |
brendanhay/gogol | gogol-dlp/gen/Network/Google/Resource/DLP/Projects/DlpJobs/Create.hs | mpl-2.0 | -- | V1 error format.
pXgafv :: Lens' ProjectsDlpJobsCreate (Maybe Xgafv)
pXgafv = lens _pXgafv (\ s a -> s{_pXgafv = a}) | 121 | pXgafv :: Lens' ProjectsDlpJobsCreate (Maybe Xgafv)
pXgafv = lens _pXgafv (\ s a -> s{_pXgafv = a}) | 99 | pXgafv = lens _pXgafv (\ s a -> s{_pXgafv = a}) | 47 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
shayan-najd/QFeldspar | QFeldspar/TraversalGenerator.hs | gpl-3.0 | recAppMQ :: Name -> Name -> (Name -> Q Exp) -> [Name] -> Q Exp -> Q Exp ->
Q Exp -> (Type -> Q Exp) -> Q Exp
recAppMQ e dn g ns o0 o1 o2 fn = recAppM e dn (unQ . g) ns
(unQ o0) (unQ o1) (unQ o2)
(\ _ -> unQ . return) (unQ . fn) | 305 | recAppMQ :: Name -> Name -> (Name -> Q Exp) -> [Name] -> Q Exp -> Q Exp ->
Q Exp -> (Type -> Q Exp) -> Q Exp
recAppMQ e dn g ns o0 o1 o2 fn = recAppM e dn (unQ . g) ns
(unQ o0) (unQ o1) (unQ o2)
(\ _ -> unQ . return) (unQ . fn) | 305 | recAppMQ e dn g ns o0 o1 o2 fn = recAppM e dn (unQ . g) ns
(unQ o0) (unQ o1) (unQ o2)
(\ _ -> unQ . return) (unQ . fn) | 184 | false | true | 0 | 15 | 138 | 158 | 79 | 79 | null | null |
Andrey-Sisoyev/PCLT-DB | Data/MyHelpers_.hs | lgpl-2.1 | unionWithKey_2 :: Ord k => (k -> (a, a) -> (a, b)) -> (b -> c -> c) -> c -> Map k a -> Map k a -> (Map k a, c)
unionWithKey_2 unifier side_result_accum_f accum_start m1 m2 =
foldr (\ (k, a1) (m_accum, side_result_accum) ->
case takeFromMap k m_accum of
(Nothin... | 719 | unionWithKey_2 :: Ord k => (k -> (a, a) -> (a, b)) -> (b -> c -> c) -> c -> Map k a -> Map k a -> (Map k a, c)
unionWithKey_2 unifier side_result_accum_f accum_start m1 m2 =
foldr (\ (k, a1) (m_accum, side_result_accum) ->
case takeFromMap k m_accum of
(Nothin... | 719 | unionWithKey_2 unifier side_result_accum_f accum_start m1 m2 =
foldr (\ (k, a1) (m_accum, side_result_accum) ->
case takeFromMap k m_accum of
(Nothing, _) -> (M.insert k a1 m_accum, side_result_accum)
(Just a2, rest_of_accum_map) ->... | 608 | false | true | 0 | 15 | 287 | 255 | 132 | 123 | null | null |
arnizamani/occam | Haskell.hs | mit | isCharLit _ = False | 19 | isCharLit _ = False | 19 | isCharLit _ = False | 19 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
bkirwi/ethereum-haskell | src/Ethereum/Prelude.hs | mit | decodeInt :: Integral n => ByteString -> Maybe n
decodeInt bs
| not (BS.null bs) && BS.head bs == 0 = Nothing
| otherwise = Just $ BS.foldl addByte 0 bs
where
addByte n b = (n * 256) + fromIntegral b | 210 | decodeInt :: Integral n => ByteString -> Maybe n
decodeInt bs
| not (BS.null bs) && BS.head bs == 0 = Nothing
| otherwise = Just $ BS.foldl addByte 0 bs
where
addByte n b = (n * 256) + fromIntegral b | 210 | decodeInt bs
| not (BS.null bs) && BS.head bs == 0 = Nothing
| otherwise = Just $ BS.foldl addByte 0 bs
where
addByte n b = (n * 256) + fromIntegral b | 161 | false | true | 1 | 13 | 52 | 105 | 49 | 56 | null | null |
neosam/esge | src/Esge/Run.hs | bsd-3-clause | ingameFromReplInit :: ReplInit -> IngameInit
ingameFromReplInit (ReplInit _ ingameInit) = ingameInit | 100 | ingameFromReplInit :: ReplInit -> IngameInit
ingameFromReplInit (ReplInit _ ingameInit) = ingameInit | 100 | ingameFromReplInit (ReplInit _ ingameInit) = ingameInit | 55 | false | true | 0 | 7 | 10 | 26 | 13 | 13 | null | null |
xkollar/my-xmonad | src/My/XMonad/Config/Mods/XMMS2.hs | gpl-3.0 | xmms2Keys :: KeyConfig
xmms2Keys = xmms2KeysBase <+> xmms2KeysExtra | 67 | xmms2Keys :: KeyConfig
xmms2Keys = xmms2KeysBase <+> xmms2KeysExtra | 67 | xmms2Keys = xmms2KeysBase <+> xmms2KeysExtra | 44 | false | true | 0 | 6 | 7 | 22 | 9 | 13 | null | null |
kairne/repa-lts | Data/Array/Repa/Repr/Unboxed.hs | bsd-3-clause | -- | O(1). Zip some unboxed arrays.
-- The shapes must be identical else `error`.
zip3 :: (Shape sh, U.Unbox a, U.Unbox b, U.Unbox c)
=> Array U sh a -> Array U sh b -> Array U sh c
-> Array U sh (a, b, c)
zip3 (AUnboxed sh1 vec1) (AUnboxed sh2 vec2) (AUnboxed sh3 vec3)
| sh1 /= sh2 || sh1 /... | 428 | zip3 :: (Shape sh, U.Unbox a, U.Unbox b, U.Unbox c)
=> Array U sh a -> Array U sh b -> Array U sh c
-> Array U sh (a, b, c)
zip3 (AUnboxed sh1 vec1) (AUnboxed sh2 vec2) (AUnboxed sh3 vec3)
| sh1 /= sh2 || sh1 /= sh3
= error "Repa: zip array shapes not identical"
| otherwise = AUnboxed sh1 (U.zi... | 338 | zip3 (AUnboxed sh1 vec1) (AUnboxed sh2 vec2) (AUnboxed sh3 vec3)
| sh1 /= sh2 || sh1 /= sh3
= error "Repa: zip array shapes not identical"
| otherwise = AUnboxed sh1 (U.zip3 vec1 vec2 vec3) | 195 | true | true | 1 | 10 | 114 | 171 | 85 | 86 | null | null |
forked-upstream-packages-for-ghcjs/ghcjs | ghcjs/src/Gen2/Sinker.hs | mit | foldArgsE f (StgCase e l1 l2 b s a alts) =
StgCase <$> foldArgsE f e <*> pure l1 <*> pure l2
<*> pure b <*> pure s <*> pure a
<*> sequenceA (map (\(ac,bs,us,e) -> (,,,) ac bs us <$> foldArgsE f e) alts) | 224 | foldArgsE f (StgCase e l1 l2 b s a alts) =
StgCase <$> foldArgsE f e <*> pure l1 <*> pure l2
<*> pure b <*> pure s <*> pure a
<*> sequenceA (map (\(ac,bs,us,e) -> (,,,) ac bs us <$> foldArgsE f e) alts) | 224 | foldArgsE f (StgCase e l1 l2 b s a alts) =
StgCase <$> foldArgsE f e <*> pure l1 <*> pure l2
<*> pure b <*> pure s <*> pure a
<*> sequenceA (map (\(ac,bs,us,e) -> (,,,) ac bs us <$> foldArgsE f e) alts) | 224 | false | false | 14 | 12 | 66 | 146 | 72 | 74 | null | null |
danielqo/PiAlgorithms | haskell/PiEstimator.hs | mit | batchSize = radius `div` 2 | 26 | batchSize = radius `div` 2 | 26 | batchSize = radius `div` 2 | 26 | false | false | 0 | 5 | 4 | 12 | 7 | 5 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/enumFromTo_2.hs | mit | primCmpNat (Succ x) Zero = GT | 29 | primCmpNat (Succ x) Zero = GT | 29 | primCmpNat (Succ x) Zero = GT | 29 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
snapframework/snap-core | test/Snap/Internal/Routing/Tests.hs | bsd-3-clause | testRouteUrlDecode :: Test
testRouteUrlDecode = testCase "route/urlDecode" $ do
r1 <- go routes "herp/%7Bderp%7D/"
assertEqual "rqPathInfo on urldecode" "" r1
r2 <- go routes "foo/%7Bderp%7D/"
assertEqual "urldecoded capture" "{derp}" r2
r3 <- go routes "nerp/%7Bderp%7D/"
assertEqual "rqContextP... | 441 | testRouteUrlDecode :: Test
testRouteUrlDecode = testCase "route/urlDecode" $ do
r1 <- go routes "herp/%7Bderp%7D/"
assertEqual "rqPathInfo on urldecode" "" r1
r2 <- go routes "foo/%7Bderp%7D/"
assertEqual "urldecoded capture" "{derp}" r2
r3 <- go routes "nerp/%7Bderp%7D/"
assertEqual "rqContextP... | 441 | testRouteUrlDecode = testCase "route/urlDecode" $ do
r1 <- go routes "herp/%7Bderp%7D/"
assertEqual "rqPathInfo on urldecode" "" r1
r2 <- go routes "foo/%7Bderp%7D/"
assertEqual "urldecoded capture" "{derp}" r2
r3 <- go routes "nerp/%7Bderp%7D/"
assertEqual "rqContextPath on urldecode" "/nerp/%7... | 414 | false | true | 0 | 9 | 67 | 85 | 37 | 48 | null | null |
juhp/stack | test/integration/tests/4270-files-order/files/src/Lib.hs | bsd-3-clause | greeting :: String
greeting = unsafePerformIO $ peekCString c_greeting | 70 | greeting :: String
greeting = unsafePerformIO $ peekCString c_greeting | 70 | greeting = unsafePerformIO $ peekCString c_greeting | 51 | false | true | 2 | 6 | 8 | 25 | 10 | 15 | null | null |
tylerjl/adventofcode | src/Y2015/D18.hs | mit | animate :: Lights Int -> Lights Int
animate grid = R.computeS $ R.zipWith step grid adjacent
where adjacent = mapStencil2 (BoundConst 0) stencil grid | 153 | animate :: Lights Int -> Lights Int
animate grid = R.computeS $ R.zipWith step grid adjacent
where adjacent = mapStencil2 (BoundConst 0) stencil grid | 153 | animate grid = R.computeS $ R.zipWith step grid adjacent
where adjacent = mapStencil2 (BoundConst 0) stencil grid | 117 | false | true | 0 | 9 | 27 | 59 | 28 | 31 | null | null |
nomeata/gipeda | src/Development/Shake/Fancy.hs | mit | (~>) :: String -> Action () -> Rules ()
target ~> act = target S.~> wrapAction act target | 89 | (~>) :: String -> Action () -> Rules ()
target ~> act = target S.~> wrapAction act target | 89 | target ~> act = target S.~> wrapAction act target | 49 | false | true | 0 | 10 | 17 | 51 | 24 | 27 | null | null |
CindyLinz/Haskell-HVG | src/HVG/SVGState.hs | bsd-3-clause | appTr :: Trans -> Builder info SVGState draw ()
appTr trans = modifyStructState $ \ctx -> ctx{svgTrans = appTrans (svgTrans ctx) trans} | 135 | appTr :: Trans -> Builder info SVGState draw ()
appTr trans = modifyStructState $ \ctx -> ctx{svgTrans = appTrans (svgTrans ctx) trans} | 135 | appTr trans = modifyStructState $ \ctx -> ctx{svgTrans = appTrans (svgTrans ctx) trans} | 87 | false | true | 0 | 11 | 21 | 57 | 29 | 28 | null | null |
GaloisInc/halvm-ghc | compiler/specialise/Rules.hs | bsd-3-clause | noBlackList :: Activation -> Bool
noBlackList _ = False | 55 | noBlackList :: Activation -> Bool
noBlackList _ = False | 55 | noBlackList _ = False | 21 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
ublubu/shapes | shapes-demo/src/Physics/Draw.hs | mit | drawPolygon :: R.Renderer -> Polygon -> IO ()
drawPolygon r vertices = sequence_ (fmap f segments)
where f (v1, v2) = drawLine r v1 v2
segments = zip vertices (tail vertices ++ [head vertices]) | 203 | drawPolygon :: R.Renderer -> Polygon -> IO ()
drawPolygon r vertices = sequence_ (fmap f segments)
where f (v1, v2) = drawLine r v1 v2
segments = zip vertices (tail vertices ++ [head vertices]) | 203 | drawPolygon r vertices = sequence_ (fmap f segments)
where f (v1, v2) = drawLine r v1 v2
segments = zip vertices (tail vertices ++ [head vertices]) | 157 | false | true | 1 | 9 | 43 | 100 | 46 | 54 | null | null |
rimmington/cabal | Cabal/Distribution/Simple/PreProcess.hs | bsd-3-clause | ppHsc2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppHsc2hs bi lbi =
PreProcessor {
platformIndependent = False,
runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity -> do
(gccProg, _) <- requireProgram verbosity gccProgram (withPrograms lbi)
rawSystemProgramConf verbosity hsc2h... | 3,688 | ppHsc2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppHsc2hs bi lbi =
PreProcessor {
platformIndependent = False,
runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity -> do
(gccProg, _) <- requireProgram verbosity gccProgram (withPrograms lbi)
rawSystemProgramConf verbosity hsc2h... | 3,688 | ppHsc2hs bi lbi =
PreProcessor {
platformIndependent = False,
runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity -> do
(gccProg, _) <- requireProgram verbosity gccProgram (withPrograms lbi)
rawSystemProgramConf verbosity hsc2hsProgram (withPrograms lbi) $
[ "--cc=" ++ pro... | 3,632 | false | true | 0 | 30 | 1,265 | 898 | 464 | 434 | null | null |
gsdlab/clafer | src/Language/Clafer/Intermediate/Intclafer.hs | mit | isMutable :: IClafer -> Bool
isMutable = not . _final . _modifiers | 66 | isMutable :: IClafer -> Bool
isMutable = not . _final . _modifiers | 66 | isMutable = not . _final . _modifiers | 37 | false | true | 0 | 6 | 11 | 23 | 12 | 11 | null | null |
nhenezi/csvtt | csvtt.hs | mit | -- apply f to elements in matrix
mmap :: (a -> b) -> [[a]] -> [[b]]
mmap f = map (map f) | 88 | mmap :: (a -> b) -> [[a]] -> [[b]]
mmap f = map (map f) | 55 | mmap f = map (map f) | 20 | true | true | 0 | 10 | 21 | 57 | 29 | 28 | null | null |
juodaspaulius/clafer | src/Language/Clafer/Intermediate/Desugarer.hs | mit | desugarInit id' (InitSome s inithow exp') = [ IEConstraint (desugarInitHow inithow) (pExpDefPid s implIExp) ]
where
cId :: PExp
cId = mkPLClaferId (getSpan id') (snd $ getIdent id') False Nothing
-- <id> = <exp'>
assignIExp :: IExp
assignIExp = (IFunExp "=" [cId, desugarExp exp'])
-- some <id>... | 484 | desugarInit id' (InitSome s inithow exp') = [ IEConstraint (desugarInitHow inithow) (pExpDefPid s implIExp) ]
where
cId :: PExp
cId = mkPLClaferId (getSpan id') (snd $ getIdent id') False Nothing
-- <id> = <exp'>
assignIExp :: IExp
assignIExp = (IFunExp "=" [cId, desugarExp exp'])
-- some <id>... | 484 | desugarInit id' (InitSome s inithow exp') = [ IEConstraint (desugarInitHow inithow) (pExpDefPid s implIExp) ]
where
cId :: PExp
cId = mkPLClaferId (getSpan id') (snd $ getIdent id') False Nothing
-- <id> = <exp'>
assignIExp :: IExp
assignIExp = (IFunExp "=" [cId, desugarExp exp'])
-- some <id>... | 484 | false | false | 0 | 10 | 110 | 192 | 90 | 102 | null | null |
loadimpact/http2-test | hs-src/Rede/SpdyProtocol/Framing/Frame.hs | bsd-3-clause | cfType :: ControlFrame vf -> ControlFrameType
cfType (ControlFrame cftype _ _) = cftype | 88 | cfType :: ControlFrame vf -> ControlFrameType
cfType (ControlFrame cftype _ _) = cftype | 87 | cfType (ControlFrame cftype _ _) = cftype | 41 | false | true | 0 | 7 | 13 | 31 | 15 | 16 | null | null |
laszlopandy/elm-compiler | src/Type/Unify.hs | bsd-3-clause | reorient :: Context -> Context
reorient (Context orientation var1 desc1 var2 desc2) =
let
otherOrientation =
case orientation of
ExpectedActual -> ActualExpected
ActualExpected -> ExpectedActual
in
Context otherOrientation var2 desc2 var1 desc1 | 278 | reorient :: Context -> Context
reorient (Context orientation var1 desc1 var2 desc2) =
let
otherOrientation =
case orientation of
ExpectedActual -> ActualExpected
ActualExpected -> ExpectedActual
in
Context otherOrientation var2 desc2 var1 desc1 | 278 | reorient (Context orientation var1 desc1 var2 desc2) =
let
otherOrientation =
case orientation of
ExpectedActual -> ActualExpected
ActualExpected -> ExpectedActual
in
Context otherOrientation var2 desc2 var1 desc1 | 247 | false | true | 0 | 11 | 65 | 70 | 34 | 36 | null | null |
mrehayden1/lji | src/LJI/Args.hs | bsd-3-clause | usage :: String
usage = "Usage: LJI --help\n"
++ " LJI --version\n"
++ " LJI [COMMAND...] [OPTS...] [INPUT] [OUTPUT]\n"
++ "\n"
++ "Commands include:\n"
++ " melody Use the melody\n"
++ " root Derive the root progression\n"
++ " fifth... | 601 | usage :: String
usage = "Usage: LJI --help\n"
++ " LJI --version\n"
++ " LJI [COMMAND...] [OPTS...] [INPUT] [OUTPUT]\n"
++ "\n"
++ "Commands include:\n"
++ " melody Use the melody\n"
++ " root Derive the root progression\n"
++ " fifth... | 601 | usage = "Usage: LJI --help\n"
++ " LJI --version\n"
++ " LJI [COMMAND...] [OPTS...] [INPUT] [OUTPUT]\n"
++ "\n"
++ "Commands include:\n"
++ " melody Use the melody\n"
++ " root Derive the root progression\n"
++ " fifth Derive the fi... | 585 | false | true | 32 | 6 | 250 | 98 | 39 | 59 | null | null |
DimaSamoz/mezzo | src/Mezzo/Compose/Chords.hs | mit | -- ** Inversion mutators
inv :: ChorM c (InvertChord c)
inv = constConv Cho | 75 | inv :: ChorM c (InvertChord c)
inv = constConv Cho | 50 | inv = constConv Cho | 19 | true | true | 1 | 7 | 13 | 29 | 13 | 16 | null | null |
olsner/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | mkFunBind :: Located RdrName -> [LMatch RdrName (LHsExpr RdrName)]
-> HsBind RdrName
-- Not infix, with place holders for coercion and free vars
mkFunBind fn ms = FunBind { fun_id = fn
, fun_matches = mkMatchGroup Generated ms
, fun_co_fn = idHsWrapper
... | 414 | mkFunBind :: Located RdrName -> [LMatch RdrName (LHsExpr RdrName)]
-> HsBind RdrName
mkFunBind fn ms = FunBind { fun_id = fn
, fun_matches = mkMatchGroup Generated ms
, fun_co_fn = idHsWrapper
, bind_fvs = placeHolderNames
... | 354 | mkFunBind fn ms = FunBind { fun_id = fn
, fun_matches = mkMatchGroup Generated ms
, fun_co_fn = idHsWrapper
, bind_fvs = placeHolderNames
, fun_tick = [] } | 259 | true | true | 0 | 10 | 164 | 84 | 46 | 38 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | pompously = id | 14 | pompously = id | 14 | pompously = id | 14 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
rblaze/haskell-dbus | tests/DBusTests/Client.hs | apache-2.0 | suite_Connect :: TestTree
suite_Connect = testGroup "connect"
[ test_ConnectSystem
, test_ConnectSystem_NoAddress
, test_ConnectSession
, test_ConnectSession_NoAddress
, test_ConnectStarter
, test_ConnectStarter_NoAddress
] | 251 | suite_Connect :: TestTree
suite_Connect = testGroup "connect"
[ test_ConnectSystem
, test_ConnectSystem_NoAddress
, test_ConnectSession
, test_ConnectSession_NoAddress
, test_ConnectStarter
, test_ConnectStarter_NoAddress
] | 251 | suite_Connect = testGroup "connect"
[ test_ConnectSystem
, test_ConnectSystem_NoAddress
, test_ConnectSession
, test_ConnectSession_NoAddress
, test_ConnectStarter
, test_ConnectStarter_NoAddress
] | 225 | false | true | 0 | 5 | 47 | 35 | 20 | 15 | null | null |
keithodulaigh/Hets | utils/DtdToHaskell-src/current/Instance.hs | gpl-2.0 | mkInstance :: TypeDef -> Doc
-- no constructors - represents an element with empty content but attributes.
mkInstance (DataDef _ n fs []) =
let (_, frattr, topat, toattr) = attrpats fs
frretval = if null fs then ppHName n else frattr
topatval = if null fs then ppHName n else topat
in
text "... | 1,285 | mkInstance :: TypeDef -> Doc
mkInstance (DataDef _ n fs []) =
let (_, frattr, topat, toattr) = attrpats fs
frretval = if null fs then ppHName n else frattr
topatval = if null fs then ppHName n else topat
in
text "instance HTypeable" <+> ppHName n <+> text "where" $$
nest 4 ( text "toHTyp... | 1,206 | mkInstance (DataDef _ n fs []) =
let (_, frattr, topat, toattr) = attrpats fs
frretval = if null fs then ppHName n else frattr
topatval = if null fs then ppHName n else topat
in
text "instance HTypeable" <+> ppHName n <+> text "where" $$
nest 4 ( text "toHType _ = Defined \"" <> ppXName ... | 1,177 | true | true | 4 | 23 | 543 | 332 | 156 | 176 | null | null |
kojiromike/Idris-dev | src/Idris/Core/CaseTree.hs | bsd-3-clause | argsToAlt :: [Int] -> [([Pat], Clause)] -> CaseBuilder ([Name], [Name], [Name], [Clause])
argsToAlt _ [] = return ([], [], [], []) | 130 | argsToAlt :: [Int] -> [([Pat], Clause)] -> CaseBuilder ([Name], [Name], [Name], [Clause])
argsToAlt _ [] = return ([], [], [], []) | 130 | argsToAlt _ [] = return ([], [], [], []) | 40 | false | true | 0 | 10 | 20 | 95 | 54 | 41 | null | null |
agocorona/control-monad-supervisor | Control/Monad/Supervisor/Trace.hs | bsd-3-clause | runTrace :: Supervise [String] m => Sup [String] m a -> m (Control a)
runTrace f= runSup f1
where
f1= printBackTrace >> f
printBackTrace= do
s <- get
case s of
[] -> breturn()
tr -> error (disp tr)
where
disp tr= "TRACE (error in the last line):\n\n" ++(concat $ intersperse "\... | 563 | runTrace :: Supervise [String] m => Sup [String] m a -> m (Control a)
runTrace f= runSup f1
where
f1= printBackTrace >> f
printBackTrace= do
s <- get
case s of
[] -> breturn()
tr -> error (disp tr)
where
disp tr= "TRACE (error in the last line):\n\n" ++(concat $ intersperse "\... | 563 | runTrace f= runSup f1
where
f1= printBackTrace >> f
printBackTrace= do
s <- get
case s of
[] -> breturn()
tr -> error (disp tr)
where
disp tr= "TRACE (error in the last line):\n\n" ++(concat $ intersperse "\n" tr)
---- A less polimorphic version of runTrace. It assumes a stat... | 493 | false | true | 3 | 12 | 137 | 159 | 71 | 88 | null | null |
hjwylde/werewolf | app/Game/Werewolf/Variant/Standard/Command.hs | bsd-3-clause | deadPlayersText :: Game -> Text
deadPlayersText game = [iFile|variant/standard/command/status/dead-players.txt|] | 112 | deadPlayersText :: Game -> Text
deadPlayersText game = [iFile|variant/standard/command/status/dead-players.txt|] | 112 | deadPlayersText game = [iFile|variant/standard/command/status/dead-players.txt|] | 80 | false | true | 0 | 7 | 8 | 28 | 14 | 14 | null | null |
brendanhay/gogol | gogol-jobs/gen/Network/Google/Resource/Jobs/Projects/Companies/List.hs | mpl-2.0 | -- | Optional. The starting indicator from which to return results.
pclPageToken :: Lens' ProjectsCompaniesList (Maybe Text)
pclPageToken
= lens _pclPageToken (\ s a -> s{_pclPageToken = a}) | 192 | pclPageToken :: Lens' ProjectsCompaniesList (Maybe Text)
pclPageToken
= lens _pclPageToken (\ s a -> s{_pclPageToken = a}) | 124 | pclPageToken
= lens _pclPageToken (\ s a -> s{_pclPageToken = a}) | 67 | true | true | 0 | 9 | 29 | 48 | 25 | 23 | null | null |
norm2782/uuagc | tools/loopbreaker/LoopBreaker.hs | bsd-3-clause | runSearch :: Monad m => Test t m -> StdGen -> Int -> Config t -> m (Config t)
runSearch test gen maxFailures initCfg
= do final <- execStateT it initial
return (configuration final)
where
initial = TestState { configuration = initCfg
, generator = randoms gen
... | 1,133 | runSearch :: Monad m => Test t m -> StdGen -> Int -> Config t -> m (Config t)
runSearch test gen maxFailures initCfg
= do final <- execStateT it initial
return (configuration final)
where
initial = TestState { configuration = initCfg
, generator = randoms gen
... | 1,133 | runSearch test gen maxFailures initCfg
= do final <- execStateT it initial
return (configuration final)
where
initial = TestState { configuration = initCfg
, generator = randoms gen
, nfailures = 0
}
it = do cfg <- gets ... | 1,055 | false | true | 1 | 23 | 554 | 367 | 178 | 189 | null | null |
gust/feature-creature | legacy/lib/Messaging/Exchanges.hs | mit | featureCreatureExchange :: Config.RabbitMQConfig -> MB.WithConn ()
featureCreatureExchange cfg =
let exch = MB.Exchange (Config.getExchangeName cfg) "topic" True
in MB.createExchange exch | 191 | featureCreatureExchange :: Config.RabbitMQConfig -> MB.WithConn ()
featureCreatureExchange cfg =
let exch = MB.Exchange (Config.getExchangeName cfg) "topic" True
in MB.createExchange exch | 191 | featureCreatureExchange cfg =
let exch = MB.Exchange (Config.getExchangeName cfg) "topic" True
in MB.createExchange exch | 124 | false | true | 0 | 12 | 23 | 65 | 29 | 36 | null | null |
csabahruska/GFXDemo | GLBackend.hs | bsd-3-clause | finalizeAttribute :: GLAttribute -> IO ()
finalizeAttribute a = with (glaObject a) (glDeleteBuffers 1) | 102 | finalizeAttribute :: GLAttribute -> IO ()
finalizeAttribute a = with (glaObject a) (glDeleteBuffers 1) | 102 | finalizeAttribute a = with (glaObject a) (glDeleteBuffers 1) | 60 | false | true | 0 | 7 | 13 | 40 | 19 | 21 | null | null |
kojiromike/Idris-dev | src/IRTS/Lang.hs | bsd-3-clause | usedIn :: [Name] -> LExp -> [Name]
usedIn env (LV n) = usedArg env n | 68 | usedIn :: [Name] -> LExp -> [Name]
usedIn env (LV n) = usedArg env n | 68 | usedIn env (LV n) = usedArg env n | 33 | false | true | 0 | 7 | 14 | 45 | 22 | 23 | null | null |
ihc/futhark | src/Language/Futhark/TypeChecker.hs | isc | substituteTypesInEnv :: TypeSubs -> Env -> Env
substituteTypesInEnv substs env =
env { envVtable = M.map (substituteTypesInValBinding substs) $ envVtable env
, envTypeTable = M.mapWithKey subT $ envTypeTable env
, envModTable = M.map (substituteTypesInMod substs) $ envModTable env
}
where subT... | 482 | substituteTypesInEnv :: TypeSubs -> Env -> Env
substituteTypesInEnv substs env =
env { envVtable = M.map (substituteTypesInValBinding substs) $ envVtable env
, envTypeTable = M.mapWithKey subT $ envTypeTable env
, envModTable = M.map (substituteTypesInMod substs) $ envModTable env
}
where subT... | 482 | substituteTypesInEnv substs env =
env { envVtable = M.map (substituteTypesInValBinding substs) $ envVtable env
, envTypeTable = M.mapWithKey subT $ envTypeTable env
, envModTable = M.map (substituteTypesInMod substs) $ envModTable env
}
where subT name _
| Just (TypeSub (TypeAbbr ps ... | 435 | false | true | 0 | 13 | 112 | 177 | 84 | 93 | null | null |
ckaestne/CIDE | CIDE_Language_Haskell/test/WSP/Webserver/AccessLogger.hs | gpl-3.0 | expand info ip_addr host arg c
= case c of
{ 'b' -> show (contentLength resp_body);
'f' -> getFileName resp_body;
'h'
-> case host of
{ Just ent -> hostName ent;
Nothing -> ip_addr};
'a' -> ip_addr;
'... | 947 | expand info ip_addr host arg c
= case c of
{ 'b' -> show (contentLength resp_body);
'f' -> getFileName resp_body;
'h'
-> case host of
{ Just ent -> hostName ent;
Nothing -> ip_addr};
'a' -> ip_addr;
'... | 947 | expand info ip_addr host arg c
= case c of
{ 'b' -> show (contentLength resp_body);
'f' -> getFileName resp_body;
'h'
-> case host of
{ Just ent -> hostName ent;
Nothing -> ip_addr};
'a' -> ip_addr;
'... | 947 | false | false | 3 | 12 | 376 | 272 | 143 | 129 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/GlobalEventHandlers.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.onseeked Mozilla GlobalEventHandlers.onseeked documentation>
seeked ::
(IsGlobalEventHandlers self, IsEventTarget self) =>
EventName self Event
seeked = unsafeEventName (toJSString "seeked") | 282 | seeked ::
(IsGlobalEventHandlers self, IsEventTarget self) =>
EventName self Event
seeked = unsafeEventName (toJSString "seeked") | 145 | seeked = unsafeEventName (toJSString "seeked") | 46 | true | true | 0 | 7 | 37 | 47 | 22 | 25 | null | null |
dmalikov/multiset | Data/MultiSet.hs | bsd-3-clause | showTree :: Show a => MultiSet a -> String
showTree = showTreeWith True False | 77 | showTree :: Show a => MultiSet a -> String
showTree = showTreeWith True False | 77 | showTree = showTreeWith True False | 34 | false | true | 0 | 8 | 13 | 36 | 15 | 21 | null | null |
cblp/haskell-telegram-api | test/JsonSpec.hs | bsd-3-clause | spec :: Spec
spec = do
let getType q = jPath (T.unpack "type") (toString (encode q))
describe "type of serialized inline query result" $ do
it "should be article" $
getType iq_article `shouldBe` ["\"article\""]
it "should be photo" $
getType iq_photo `shouldBe` ["\"photo\""]
it "should be gi... | 1,631 | spec :: Spec
spec = do
let getType q = jPath (T.unpack "type") (toString (encode q))
describe "type of serialized inline query result" $ do
it "should be article" $
getType iq_article `shouldBe` ["\"article\""]
it "should be photo" $
getType iq_photo `shouldBe` ["\"photo\""]
it "should be gi... | 1,631 | spec = do
let getType q = jPath (T.unpack "type") (toString (encode q))
describe "type of serialized inline query result" $ do
it "should be article" $
getType iq_article `shouldBe` ["\"article\""]
it "should be photo" $
getType iq_photo `shouldBe` ["\"photo\""]
it "should be gif" $
ge... | 1,618 | false | true | 0 | 14 | 382 | 471 | 230 | 241 | null | null |
markflorisson/packages | Pkgs/Parser.hs | bsd-3-clause | parseLam = Lam <$> (charWS '\\' *> charWS '(' *> parseVarName)
<*> (charWS ':' *> parseType <* charWS ')')
<*> (charWS '.' *> parseExpr) | 169 | parseLam = Lam <$> (charWS '\\' *> charWS '(' *> parseVarName)
<*> (charWS ':' *> parseType <* charWS ')')
<*> (charWS '.' *> parseExpr) | 169 | parseLam = Lam <$> (charWS '\\' *> charWS '(' *> parseVarName)
<*> (charWS ':' *> parseType <* charWS ')')
<*> (charWS '.' *> parseExpr) | 169 | false | false | 9 | 8 | 56 | 73 | 34 | 39 | null | null |
infotroph/pandoc | src/Text/Pandoc/Writers/Docx.hs | gpl-2.0 | replaceAttr :: (QName -> Bool) -> String -> [XML.Attr] -> [XML.Attr]
replaceAttr _ _ [] = [] | 92 | replaceAttr :: (QName -> Bool) -> String -> [XML.Attr] -> [XML.Attr]
replaceAttr _ _ [] = [] | 92 | replaceAttr _ _ [] = [] | 23 | false | true | 0 | 9 | 16 | 51 | 27 | 24 | null | null |
flipstone/orville | orville-postgresql-libpq/src/Orville/PostgreSQL/Internal/FieldDefinition.hs | mit | {- |
Builds a 'FieldDefinition' that stores an 'Int64' value as the "BIGSERIAL"
type. This can be used to create auto-incrementing columns.
-}
bigSerialField ::
-- | Name of the field in the database
String ->
FieldDefinition NotNull Int64
bigSerialField = fieldOfType SqlType.bigSerial | 296 | bigSerialField ::
-- | Name of the field in the database
String ->
FieldDefinition NotNull Int64
bigSerialField = fieldOfType SqlType.bigSerial | 149 | bigSerialField = fieldOfType SqlType.bigSerial | 46 | true | true | 0 | 6 | 52 | 27 | 14 | 13 | null | null |
ezaroukian/sortaPn | GoCoWiToTex.hs | bsd-3-clause | bullets :: Parser Node
bullets = P.sepEndBy1 (P.try (bulletp '*')) (myChar '\n' >> P.option '\n' (myChar '\n')) >>= (return . Node . Bullets) | 141 | bullets :: Parser Node
bullets = P.sepEndBy1 (P.try (bulletp '*')) (myChar '\n' >> P.option '\n' (myChar '\n')) >>= (return . Node . Bullets) | 141 | bullets = P.sepEndBy1 (P.try (bulletp '*')) (myChar '\n' >> P.option '\n' (myChar '\n')) >>= (return . Node . Bullets) | 118 | false | true | 0 | 11 | 22 | 73 | 36 | 37 | null | null |
TomMD/cryptol | cryptol/REPL/Haskeline.hs | bsd-3-clause | -- | Haskeline-specific repl implementation.
--
-- XXX this needs to handle Ctrl-C, which at the moment will just cause
-- haskeline to exit. See the function 'withInterrupt' for more info on how to
-- handle this.
repl :: Maybe FilePath -> REPL () -> IO ()
repl mbBatch begin =
do settings <- setHistoryFile replSett... | 1,386 | repl :: Maybe FilePath -> REPL () -> IO ()
repl mbBatch begin =
do settings <- setHistoryFile replSettings
runREPL isBatch (runInputTBehavior style settings body)
where
body = withInterrupt $ do
MTL.lift begin
loop
(isBatch,style) = case mbBatch of
Nothing -> (False,defaultBehavior)
Just... | 1,170 | repl mbBatch begin =
do settings <- setHistoryFile replSettings
runREPL isBatch (runInputTBehavior style settings body)
where
body = withInterrupt $ do
MTL.lift begin
loop
(isBatch,style) = case mbBatch of
Nothing -> (False,defaultBehavior)
Just path -> (True,useFile path)
loop = do
... | 1,127 | true | true | 2 | 19 | 425 | 432 | 197 | 235 | null | null |
higgsd/euler | hs/60.hs | bsd-2-clause | nn = 5 | 6 | nn = 5 | 6 | nn = 5 | 6 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
HairyDude/pdxparse | src/EU4/Decisions.hs | mit | decisionAddSection dec [pdx| allow = @scr |] = return dec { dec_allow = scr } | 88 | decisionAddSection dec [pdx| allow = @scr |] = return dec { dec_allow = scr } | 88 | decisionAddSection dec [pdx| allow = @scr |] = return dec { dec_allow = scr } | 88 | false | false | 0 | 7 | 25 | 27 | 15 | 12 | null | null |
yupferris/fsade | src/Solution.hs | bsd-2-clause | serializeSolutionFile filePath = writeFile filePath . serializeSolution | 71 | serializeSolutionFile filePath = writeFile filePath . serializeSolution | 71 | serializeSolutionFile filePath = writeFile filePath . serializeSolution | 71 | false | false | 0 | 6 | 6 | 16 | 7 | 9 | null | null |
ideas-edu/ideas | src/Ideas/Common/Traversal/Iterator.hs | apache-2.0 | searchBackward :: Iterator a => (a -> Bool) -> a -> Maybe a
searchBackward = searchWith previous | 97 | searchBackward :: Iterator a => (a -> Bool) -> a -> Maybe a
searchBackward = searchWith previous | 96 | searchBackward = searchWith previous | 36 | false | true | 0 | 9 | 17 | 45 | 20 | 25 | null | null |
peti/funcmp | FMP/Matrix.hs | gpl-3.0 | matrix :: IsPicture a => [[a]] -> Picture
matrix m = matrixSepBy 16 16 m | 117 | matrix :: IsPicture a => [[a]] -> Picture
matrix m = matrixSepBy 16 16 m | 117 | matrix m = matrixSepBy 16 16 m | 52 | false | true | 0 | 8 | 59 | 38 | 19 | 19 | null | null |
egison/egison | hs-src/Language/Egison/Desugar.hs | mit | desugarTopExpr (Execute expr) = Just . IExecute <$> desugar expr | 65 | desugarTopExpr (Execute expr) = Just . IExecute <$> desugar expr | 65 | desugarTopExpr (Execute expr) = Just . IExecute <$> desugar expr | 65 | false | false | 0 | 7 | 10 | 26 | 12 | 14 | null | null |
shlevy/ghc | compiler/typecheck/TcSigs.hs | bsd-3-clause | ---------------
mkPragEnv :: [LSig GhcRn] -> LHsBinds GhcRn -> TcPragEnv
mkPragEnv sigs binds
= foldl extendPragEnv emptyNameEnv prs
where
prs = mapMaybe get_sig sigs
get_sig :: LSig GhcRn -> Maybe (Name, LSig GhcRn)
get_sig (L l (SpecSig lnm@(L _ nm) ty inl)) = Just (nm, L l $ SpecSig lnm ty (add_ar... | 1,223 | mkPragEnv :: [LSig GhcRn] -> LHsBinds GhcRn -> TcPragEnv
mkPragEnv sigs binds
= foldl extendPragEnv emptyNameEnv prs
where
prs = mapMaybe get_sig sigs
get_sig :: LSig GhcRn -> Maybe (Name, LSig GhcRn)
get_sig (L l (SpecSig lnm@(L _ nm) ty inl)) = Just (nm, L l $ SpecSig lnm ty (add_arity nm inl))
... | 1,207 | mkPragEnv sigs binds
= foldl extendPragEnv emptyNameEnv prs
where
prs = mapMaybe get_sig sigs
get_sig :: LSig GhcRn -> Maybe (Name, LSig GhcRn)
get_sig (L l (SpecSig lnm@(L _ nm) ty inl)) = Just (nm, L l $ SpecSig lnm ty (add_arity nm inl))
get_sig (L l (InlineSig lnm@(L _ nm) inl)) = Just (nm, ... | 1,150 | true | true | 19 | 8 | 372 | 371 | 193 | 178 | null | null |
rumblesan/improviz | src/Gfx/VertexBuffers.hs | bsd-3-clause | setAttribPointer :: AttribLocation -> Int32 -> Int32 -> Int32 -> IO ()
setAttribPointer location numComponents stride idx = do
vertexAttribPointer location
$= ( ToFloat
, VertexArrayDescriptor numComponents Float stride (bufferOffset idx)
)
vertexAttribArray location $= Enabled | 300 | setAttribPointer :: AttribLocation -> Int32 -> Int32 -> Int32 -> IO ()
setAttribPointer location numComponents stride idx = do
vertexAttribPointer location
$= ( ToFloat
, VertexArrayDescriptor numComponents Float stride (bufferOffset idx)
)
vertexAttribArray location $= Enabled | 300 | setAttribPointer location numComponents stride idx = do
vertexAttribPointer location
$= ( ToFloat
, VertexArrayDescriptor numComponents Float stride (bufferOffset idx)
)
vertexAttribArray location $= Enabled | 229 | false | true | 0 | 11 | 57 | 87 | 40 | 47 | null | null |
antalsz/hs-to-coq | examples/ghc/gen-files/Lexer.hs | mit | nested_comment :: P (RealLocated Token) -> Action
nested_comment cont span buf len = do
input <- getInput
go (reverse $ lexemeToString buf len) (1::Int) input
where
go commentAcc 0 input = do
setInput input
b <- extension rawTokenStreamEnabled
if b
then docCommentEnd input commentAcc... | 968 | nested_comment :: P (RealLocated Token) -> Action
nested_comment cont span buf len = do
input <- getInput
go (reverse $ lexemeToString buf len) (1::Int) input
where
go commentAcc 0 input = do
setInput input
b <- extension rawTokenStreamEnabled
if b
then docCommentEnd input commentAcc... | 968 | nested_comment cont span buf len = do
input <- getInput
go (reverse $ lexemeToString buf len) (1::Int) input
where
go commentAcc 0 input = do
setInput input
b <- extension rawTokenStreamEnabled
if b
then docCommentEnd input commentAcc ITblockComment buf span
else cont
go ... | 918 | false | true | 5 | 14 | 264 | 397 | 190 | 207 | null | null |
lpeterse/koka | src/Kind/InferMonad.hs | apache-2.0 | getSynonyms :: KInfer Synonyms
getSynonyms
= do env <- getKindEnv
return (synonyms env) | 99 | getSynonyms :: KInfer Synonyms
getSynonyms
= do env <- getKindEnv
return (synonyms env) | 98 | getSynonyms
= do env <- getKindEnv
return (synonyms env) | 67 | false | true | 0 | 9 | 24 | 35 | 15 | 20 | null | null |
matterhorn-chat/matterhorn | src/Matterhorn/Events/EditNotifyPrefs.hs | bsd-3-clause | editNotifyPrefsKeyHandlers :: [KeyEventHandler]
editNotifyPrefsKeyHandlers =
[ mkKb CancelEvent "Close channel notification preferences" exitEditNotifyPrefsMode
, mkKb FormSubmitEvent "Save channel notification preferences" $ do
st <- use id
let form = fromJust $ st^.csCurrentTeam.tsNotifyPrefs
... | 574 | editNotifyPrefsKeyHandlers :: [KeyEventHandler]
editNotifyPrefsKeyHandlers =
[ mkKb CancelEvent "Close channel notification preferences" exitEditNotifyPrefsMode
, mkKb FormSubmitEvent "Save channel notification preferences" $ do
st <- use id
let form = fromJust $ st^.csCurrentTeam.tsNotifyPrefs
... | 574 | editNotifyPrefsKeyHandlers =
[ mkKb CancelEvent "Close channel notification preferences" exitEditNotifyPrefsMode
, mkKb FormSubmitEvent "Save channel notification preferences" $ do
st <- use id
let form = fromJust $ st^.csCurrentTeam.tsNotifyPrefs
cId = st^.csCurrentChannelId(st^.csC... | 526 | false | true | 0 | 16 | 130 | 149 | 72 | 77 | null | null |
angerman/data-bitcode-edsl | src/EDSL/Monad/Instructions/Binary.hs | bsd-3-clause | udiv lhs rhs = mkBinOp UDIV lhs rhs | 35 | udiv lhs rhs = mkBinOp UDIV lhs rhs | 35 | udiv lhs rhs = mkBinOp UDIV lhs rhs | 35 | false | false | 0 | 5 | 7 | 18 | 8 | 10 | null | null |
PierreR/basic-prelude | test-is-a-prelude.hs | mit | elem = P.elem | 13 | elem = P.elem | 13 | elem = P.elem | 13 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
svenpanne/Vulkan | RegistryProcessor/src/MangledRegistry.hs | bsd-3-clause | splitBy :: (a -> Bool) -> [a] -> [[a]]
splitBy _ [] = [] | 56 | splitBy :: (a -> Bool) -> [a] -> [[a]]
splitBy _ [] = [] | 56 | splitBy _ [] = [] | 17 | false | true | 0 | 8 | 13 | 44 | 24 | 20 | null | null |
GaloisInc/cryfsm | Convert/Misc/String.hs | bsd-3-clause | showValue :: Value -> String
showValue = pretty . WithBase defaultPPOpts { useAscii = True } | 92 | showValue :: Value -> String
showValue = pretty . WithBase defaultPPOpts { useAscii = True } | 92 | showValue = pretty . WithBase defaultPPOpts { useAscii = True } | 63 | false | true | 1 | 7 | 15 | 37 | 17 | 20 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/elem_7.hs | mit | esEsOrdering :: Ordering -> Ordering -> MyBool
esEsOrdering LT LT = MyTrue | 78 | esEsOrdering :: Ordering -> Ordering -> MyBool
esEsOrdering LT LT = MyTrue | 78 | esEsOrdering LT LT = MyTrue | 27 | false | true | 0 | 6 | 15 | 24 | 12 | 12 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.