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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jrclogic/SMCDEL | src/SMCDEL/Symbolic/S5.hs | gpl-2.0 | bddOf kns (Disj forms) = disSet $ map (bddOf kns) forms | 56 | bddOf kns (Disj forms) = disSet $ map (bddOf kns) forms | 56 | bddOf kns (Disj forms) = disSet $ map (bddOf kns) forms | 56 | false | false | 0 | 8 | 11 | 33 | 15 | 18 | null | null |
ezyang/ghc | compiler/main/HscTypes.hs | bsd-3-clause | appendStubC (ForeignStubs h c) c_code = ForeignStubs h (c $$ c_code) | 68 | appendStubC (ForeignStubs h c) c_code = ForeignStubs h (c $$ c_code) | 68 | appendStubC (ForeignStubs h c) c_code = ForeignStubs h (c $$ c_code) | 68 | false | false | 0 | 7 | 10 | 31 | 15 | 16 | null | null |
glguy/vty-hangman-helper | GameDrawing.hs | bsd-3-clause | divisions n xs = a : divisions (n-1) b
where
(a,b) = splitAt ((len + n - 1) `div` n) xs
len = length xs | 109 | divisions n xs = a : divisions (n-1) b
where
(a,b) = splitAt ((len + n - 1) `div` n) xs
len = length xs | 109 | divisions n xs = a : divisions (n-1) b
where
(a,b) = splitAt ((len + n - 1) `div` n) xs
len = length xs | 109 | false | false | 0 | 10 | 30 | 75 | 39 | 36 | null | null |
lukexi/udp-pal | exec/Main.hs | bsd-3-clause | main :: IO ()
main = do
putStrLn "*** Launching Server..."
echoServer serverName serverPort 4096
threadDelaySec 1
putStrLn "*** Launching client 1..."
_client1 <- launchClient
putStrLn "*** Waiting a second..."
threadDelaySec 1
-- putStrLn "*** Killing Client..."
-- killThread _client1
threadDela... | 435 | main :: IO ()
main = do
putStrLn "*** Launching Server..."
echoServer serverName serverPort 4096
threadDelaySec 1
putStrLn "*** Launching client 1..."
_client1 <- launchClient
putStrLn "*** Waiting a second..."
threadDelaySec 1
-- putStrLn "*** Killing Client..."
-- killThread _client1
threadDela... | 435 | main = do
putStrLn "*** Launching Server..."
echoServer serverName serverPort 4096
threadDelaySec 1
putStrLn "*** Launching client 1..."
_client1 <- launchClient
putStrLn "*** Waiting a second..."
threadDelaySec 1
-- putStrLn "*** Killing Client..."
-- killThread _client1
threadDelaySec 1
putSt... | 421 | false | true | 0 | 8 | 86 | 102 | 39 | 63 | null | null |
cikusa/Eleco | Eleco/Slave/Backend/Repa.hs | bsd-3-clause | vecLen2 :: Vec2D -> Double
vecLen2 (!vx, !vy) = vx * vx + vy * vy | 65 | vecLen2 :: Vec2D -> Double
vecLen2 (!vx, !vy) = vx * vx + vy * vy | 65 | vecLen2 (!vx, !vy) = vx * vx + vy * vy | 38 | false | true | 0 | 7 | 15 | 43 | 20 | 23 | null | null |
iljakuklic/eel-proto | src/Backend/CodeGen.hs | bsd-3-clause | llTypesDoc = P.hsep . P.punctuate P.comma . fmap llTypeDoc | 58 | llTypesDoc = P.hsep . P.punctuate P.comma . fmap llTypeDoc | 58 | llTypesDoc = P.hsep . P.punctuate P.comma . fmap llTypeDoc | 58 | false | false | 0 | 8 | 8 | 26 | 12 | 14 | null | null |
kojiromike/Idris-dev | src/Idris/IdrisDoc.hs | bsd-3-clause | -- | Returns a list of namespaces already documented in a IdrisDoc directory
existingNamespaces :: FilePath -- ^ The base directory containing the
-- 'docs' directory with existing
-- namespace pages
-> IO (S.Set NsName)
existingNamesp... | 1,097 | existingNamespaces :: FilePath -- ^ The base directory containing the
-- 'docs' directory with existing
-- namespace pages
-> IO (S.Set NsName)
existingNamespaces out = do
let docs = out ++ "/" ++ "docs"
str2Ns s | s == roo... | 1,020 | existingNamespaces out = do
let docs = out ++ "/" ++ "docs"
str2Ns s | s == rootNsStr = []
str2Ns s = reverse $ T.splitOn (T.singleton '.') (txt s)
toNs fp = do isFile <- doesFileExist $ docs </> fp
let isHtml = ".html" == takeExtension fp
name =... | 791 | true | true | 0 | 16 | 398 | 262 | 125 | 137 | null | null |
jgoerzen/dtmconv | HaXml-1.12/src/Text/PrettyPrint/HughesPJ.hs | gpl-2.0 | equals = char '=' | 17 | equals = char '=' | 17 | equals = char '=' | 17 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
dolio/vector | Data/Vector/Fusion/Bundle/Size.hs | bsd-3-clause | toMax (Max n) = Max n | 23 | toMax (Max n) = Max n | 23 | toMax (Max n) = Max n | 23 | false | false | 0 | 7 | 7 | 18 | 8 | 10 | null | null |
silkapp/tagsoup | Text/HTML/TagSoup/Implementation.hs | bsd-3-clause | tagTextMerge (x:xs) = x : tagTextMerge xs | 41 | tagTextMerge (x:xs) = x : tagTextMerge xs | 41 | tagTextMerge (x:xs) = x : tagTextMerge xs | 41 | false | false | 0 | 7 | 6 | 23 | 11 | 12 | null | null |
Copilot-Language/sbv-for-copilot | Data/SBV/BitVectors/Symbolic.hs | bsd-3-clause | -- | how many arguments does the type take?
typeArity :: SBVType -> Int
typeArity (SBVType xs) = length xs - 1 | 110 | typeArity :: SBVType -> Int
typeArity (SBVType xs) = length xs - 1 | 66 | typeArity (SBVType xs) = length xs - 1 | 38 | true | true | 0 | 7 | 21 | 32 | 16 | 16 | null | null |
rolph-recto/liquidhaskell | FaultLocal.hs | bsd-3-clause | powerset :: [a] -> [[a]]
powerset [] = [[]] | 47 | powerset :: [a] -> [[a]]
powerset [] = [[]] | 47 | powerset [] = [[]] | 22 | false | true | 0 | 9 | 12 | 40 | 20 | 20 | null | null |
alexander-at-github/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | tagOf_PrimOp ReadJByteArrayOp = _ILIT(1096) | 43 | tagOf_PrimOp ReadJByteArrayOp = _ILIT(1096) | 43 | tagOf_PrimOp ReadJByteArrayOp = _ILIT(1096) | 43 | false | false | 0 | 6 | 3 | 15 | 7 | 8 | null | null |
athanclark/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | highestFC (PPi _ _ _ _ _) = Nothing | 35 | highestFC (PPi _ _ _ _ _) = Nothing | 35 | highestFC (PPi _ _ _ _ _) = Nothing | 35 | false | false | 0 | 6 | 8 | 24 | 11 | 13 | null | null |
shlevy/ghc | compiler/basicTypes/RdrName.hs | bsd-3-clause | demoteRdrName (Exact _) = panic "demoteRdrName" | 47 | demoteRdrName (Exact _) = panic "demoteRdrName" | 47 | demoteRdrName (Exact _) = panic "demoteRdrName" | 47 | false | false | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
kwangkim/pigment | src-web/hs/Cochon/OldView.hs | mit | -- div_ [ class_ "entry"
-- , onClick (handleEntryGoTo (entryName entry))
-- -- ] $ fromString $ showRelName $ christenREF bsc ref
-- ] $
-- div_ [ class_ "entity" ] $
-- flatButton
-- [ label_ (entryReasonableName entry)
-- , onClick (handl... | 712 | paramEntryView mod = div_ $ do
text_ $ fromString $ showName $ entryName mod
" (module)" -- TODO(joel) I don't know what to show
let entries = Foldable.toList (devEntries (dev mod))
ol_ [ class_ "dev-entries" ] $
forReact entries collapsedEntry
-- TODO(joel) think about how to guarantee an ol_... | 341 | paramEntryView mod = div_ $ do
text_ $ fromString $ showName $ entryName mod
" (module)" -- TODO(joel) I don't know what to show
let entries = Foldable.toList (devEntries (dev mod))
ol_ [ class_ "dev-entries" ] $
forReact entries collapsedEntry
-- TODO(joel) think about how to guarantee an ol_... | 341 | true | false | 0 | 15 | 219 | 92 | 47 | 45 | null | null |
travitch/language-python-builder | src/Language/Python/Common/Builder.hs | bsd-3-clause | setE :: (Monoid annot) => [ExprQ annot] -> ExprQ annot
setE = setAE mempty | 74 | setE :: (Monoid annot) => [ExprQ annot] -> ExprQ annot
setE = setAE mempty | 74 | setE = setAE mempty | 19 | false | true | 0 | 8 | 13 | 36 | 18 | 18 | null | null |
rueshyna/gogol | gogol-dns/gen/Network/Google/DNS/Types/Product.hs | mpl-2.0 | -- | The time that this resource was created on the server. This is in
-- RFC3339 text format. Output only.
mzCreationTime :: Lens' ManagedZone (Maybe Text)
mzCreationTime
= lens _mzCreationTime
(\ s a -> s{_mzCreationTime = a}) | 236 | mzCreationTime :: Lens' ManagedZone (Maybe Text)
mzCreationTime
= lens _mzCreationTime
(\ s a -> s{_mzCreationTime = a}) | 128 | mzCreationTime
= lens _mzCreationTime
(\ s a -> s{_mzCreationTime = a}) | 79 | true | true | 1 | 9 | 45 | 53 | 26 | 27 | null | null |
keera-studios/hsQt | Qtc/Core/QSettings.hs | bsd-2-clause | beginGroup :: QSettings a -> String -> IO ()
beginGroup x0 x1
= withObjectPtr x0 $ \cobj_x0 ->
withCWString x1 $ \cstr_x1 ->
qtc_QSettings_beginGroup cobj_x0 cstr_x1 | 175 | beginGroup :: QSettings a -> String -> IO ()
beginGroup x0 x1
= withObjectPtr x0 $ \cobj_x0 ->
withCWString x1 $ \cstr_x1 ->
qtc_QSettings_beginGroup cobj_x0 cstr_x1 | 175 | beginGroup x0 x1
= withObjectPtr x0 $ \cobj_x0 ->
withCWString x1 $ \cstr_x1 ->
qtc_QSettings_beginGroup cobj_x0 cstr_x1 | 130 | false | true | 4 | 9 | 35 | 67 | 30 | 37 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Coll/EnumSet.hs | mit | unionr :: Set a -> Set a -> Set a
unionr = union | 48 | unionr :: Set a -> Set a -> Set a
unionr = union | 48 | unionr = union | 14 | false | true | 0 | 7 | 12 | 28 | 13 | 15 | null | null |
Bogdanp/haskell-coreutils | src/cat/Main.hs | mit | -- | Sets the buffering mode of stdout to BlockBuffering.
useBlockBuffering :: IO ()
useBlockBuffering = hSetBuffering stdout (BlockBuffering Nothing) | 150 | useBlockBuffering :: IO ()
useBlockBuffering = hSetBuffering stdout (BlockBuffering Nothing) | 92 | useBlockBuffering = hSetBuffering stdout (BlockBuffering Nothing) | 65 | true | true | 0 | 7 | 19 | 28 | 14 | 14 | null | null |
ezyang/ghc | testsuite/tests/typecheck/should_compile/tc095.hs | bsd-3-clause | action_4 _ = happyFail | 22 | action_4 _ = happyFail | 22 | action_4 _ = happyFail | 22 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
acowley/ghc | libraries/template-haskell/Language/Haskell/TH/Ppr.hs | bsd-3-clause | pprStrictType :: (Strict, Type) -> Doc
-- Prints with parens if not already atomic
pprStrictType (IsStrict, t) = char '!' <> pprParendType t | 140 | pprStrictType :: (Strict, Type) -> Doc
pprStrictType (IsStrict, t) = char '!' <> pprParendType t | 96 | pprStrictType (IsStrict, t) = char '!' <> pprParendType t | 57 | true | true | 0 | 6 | 22 | 41 | 22 | 19 | null | null |
brendanhay/gogol | gogol-iap/gen/Network/Google/Resource/IAP/SetIAMPolicy.hs | mpl-2.0 | -- | V1 error format.
sipXgafv :: Lens' SetIAMPolicy (Maybe Xgafv)
sipXgafv = lens _sipXgafv (\ s a -> s{_sipXgafv = a}) | 120 | sipXgafv :: Lens' SetIAMPolicy (Maybe Xgafv)
sipXgafv = lens _sipXgafv (\ s a -> s{_sipXgafv = a}) | 98 | sipXgafv = lens _sipXgafv (\ s a -> s{_sipXgafv = a}) | 53 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
Helkafen/haskell-linode | src/Network/Linode/Types.hs | bsd-3-clause | linodeErrorFromCode 31 = CreditCardIsExpired | 44 | linodeErrorFromCode 31 = CreditCardIsExpired | 44 | linodeErrorFromCode 31 = CreditCardIsExpired | 44 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
shayan-najd/QFeldspar | Experiment/CSV.hs | gpl-3.0 | (</>) :: String -> String -> String
d </> f = d ++ "/" ++ f | 59 | (</>) :: String -> String -> String
d </> f = d ++ "/" ++ f | 59 | d </> f = d ++ "/" ++ f | 23 | false | true | 0 | 9 | 15 | 40 | 19 | 21 | null | null |
rueshyna/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/ContentCategories/List.hs | mpl-2.0 | -- | Select only content categories with these IDs.
cclIds :: Lens' ContentCategoriesList [Int64]
cclIds
= lens _cclIds (\ s a -> s{_cclIds = a}) . _Default .
_Coerce | 174 | cclIds :: Lens' ContentCategoriesList [Int64]
cclIds
= lens _cclIds (\ s a -> s{_cclIds = a}) . _Default .
_Coerce | 122 | cclIds
= lens _cclIds (\ s a -> s{_cclIds = a}) . _Default .
_Coerce | 76 | true | true | 1 | 11 | 36 | 56 | 28 | 28 | null | null |
twittner/tinylog | src/System/Logger.hs | mpl-2.0 | clone (Just n) g =
let s = settings g
l = fromMaybe (logLevel s) $ logLevelOf n s
in g { settings = setName (Just n) . setLogLevel l $ s } | 154 | clone (Just n) g =
let s = settings g
l = fromMaybe (logLevel s) $ logLevelOf n s
in g { settings = setName (Just n) . setLogLevel l $ s } | 154 | clone (Just n) g =
let s = settings g
l = fromMaybe (logLevel s) $ logLevelOf n s
in g { settings = setName (Just n) . setLogLevel l $ s } | 154 | false | false | 0 | 13 | 48 | 82 | 39 | 43 | null | null |
RTS2013/RTS | server/dist/build/autogen/Paths_rts_server.hs | mit | version :: Version
version = Version {versionBranch = [0,1,0,0], versionTags = []} | 82 | version :: Version
version = Version {versionBranch = [0,1,0,0], versionTags = []} | 82 | version = Version {versionBranch = [0,1,0,0], versionTags = []} | 63 | false | true | 0 | 8 | 11 | 49 | 26 | 23 | null | null |
eric-stanley/cabal | Cabal/Distribution/Simple/Utils.hs | bsd-3-clause | copyFilesWith :: (Verbosity -> FilePath -> FilePath -> IO ())
-> Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()
copyFilesWith doCopy verbosity targetDir srcFiles = do
-- Create parent directories for everything
let dirs = map (targetDir </>) . nub . map (takeDirectory . snd) $ srcFiles
ma... | 1,451 | copyFilesWith :: (Verbosity -> FilePath -> FilePath -> IO ())
-> Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()
copyFilesWith doCopy verbosity targetDir srcFiles = do
-- Create parent directories for everything
let dirs = map (targetDir </>) . nub . map (takeDirectory . snd) $ srcFiles
ma... | 1,451 | copyFilesWith doCopy verbosity targetDir srcFiles = do
-- Create parent directories for everything
let dirs = map (targetDir </>) . nub . map (takeDirectory . snd) $ srcFiles
mapM_ (createDirectoryIfMissingVerbose verbosity True) dirs
-- Copy all the files
sequence_ [ let src = srcBase </> srcFile
... | 1,315 | false | true | 0 | 14 | 305 | 201 | 112 | 89 | null | null |
deech/stack | test/integration/lib/StackTest.hs | bsd-3-clause | stack :: [String] -> IO ()
stack args = do
ec <- stack' args
unless (ec == ExitSuccess) $ error $ "Exited with exit code: " ++ show ec | 142 | stack :: [String] -> IO ()
stack args = do
ec <- stack' args
unless (ec == ExitSuccess) $ error $ "Exited with exit code: " ++ show ec | 142 | stack args = do
ec <- stack' args
unless (ec == ExitSuccess) $ error $ "Exited with exit code: " ++ show ec | 115 | false | true | 0 | 12 | 36 | 64 | 30 | 34 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | emitPrimOp dflags res ReadOffAddrOp_Int16 args = doIndexOffAddrOp (Just (mo_s_16ToWord dflags)) b16 res args | 121 | emitPrimOp dflags res ReadOffAddrOp_Int16 args = doIndexOffAddrOp (Just (mo_s_16ToWord dflags)) b16 res args | 121 | emitPrimOp dflags res ReadOffAddrOp_Int16 args = doIndexOffAddrOp (Just (mo_s_16ToWord dflags)) b16 res args | 121 | false | false | 0 | 9 | 25 | 36 | 17 | 19 | null | null |
scslab/hails | hails.hs | mit | optsToEnvStr :: Options -> String
optsToEnvStr opts = unlines $ map (\(k,v) -> k++"="++v) $ optsToEnv opts | 106 | optsToEnvStr :: Options -> String
optsToEnvStr opts = unlines $ map (\(k,v) -> k++"="++v) $ optsToEnv opts | 106 | optsToEnvStr opts = unlines $ map (\(k,v) -> k++"="++v) $ optsToEnv opts | 72 | false | true | 0 | 11 | 16 | 59 | 29 | 30 | null | null |
expipiplus1/vulkan | examples/sdl-triangle/Main.hs | bsd-3-clause | isQuitEvent :: SDL.Event -> Bool
isQuitEvent = \case
(SDL.Event _ SDL.QuitEvent) -> True
SDL.Event _ (SDL.KeyboardEvent (SDL.KeyboardEventData _ SDL.Released False (SDL.Keysym _ code _)))
| code == SDL.KeycodeQ || code == SDL.KeycodeEscape
-> True
_ -> False
-- | Get the Vulkan surface for an SDL window | 319 | isQuitEvent :: SDL.Event -> Bool
isQuitEvent = \case
(SDL.Event _ SDL.QuitEvent) -> True
SDL.Event _ (SDL.KeyboardEvent (SDL.KeyboardEventData _ SDL.Released False (SDL.Keysym _ code _)))
| code == SDL.KeycodeQ || code == SDL.KeycodeEscape
-> True
_ -> False
-- | Get the Vulkan surface for an SDL window | 319 | isQuitEvent = \case
(SDL.Event _ SDL.QuitEvent) -> True
SDL.Event _ (SDL.KeyboardEvent (SDL.KeyboardEventData _ SDL.Released False (SDL.Keysym _ code _)))
| code == SDL.KeycodeQ || code == SDL.KeycodeEscape
-> True
_ -> False
-- | Get the Vulkan surface for an SDL window | 286 | false | true | 3 | 10 | 61 | 78 | 46 | 32 | null | null |
bitemyapp/ghc | compiler/prelude/ForeignCall.hs | bsd-3-clause | ccallConvToInt JavaScriptCallConv = panic "ccallConvToInt JavaScriptCallConv" | 77 | ccallConvToInt JavaScriptCallConv = panic "ccallConvToInt JavaScriptCallConv" | 77 | ccallConvToInt JavaScriptCallConv = panic "ccallConvToInt JavaScriptCallConv" | 77 | false | false | 0 | 5 | 5 | 12 | 5 | 7 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/SVGPathElement.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathElement.createSVGPathSegCurvetoCubicSmoothRel Mozilla SVGPathElement.createSVGPathSegCurvetoCubicSmoothRel documentation>
createSVGPathSegCurvetoCubicSmoothRel_ ::
(MonadDOM m) =>
... | 694 | createSVGPathSegCurvetoCubicSmoothRel_ ::
(MonadDOM m) =>
SVGPathElement ->
Maybe Float ->
Maybe Float -> Maybe Float -> Maybe Float -> m ()
createSVGPa... | 509 | createSVGPathSegCurvetoCubicSmoothRel_ self x y x2 y2
= liftDOM
(void
(self ^. jsf "createSVGPathSegCurvetoCubicSmoothRel"
[toJSVal x, toJSVal y, toJSVal x2, toJSVal y2])) | 200 | true | true | 0 | 12 | 245 | 114 | 55 | 59 | null | null |
bhamrick/htwitch | Twitch/Datatypes.hs | mit | boolResult :: Result Bool -> Result Bool
boolResult (Ok x) = Ok x | 65 | boolResult :: Result Bool -> Result Bool
boolResult (Ok x) = Ok x | 65 | boolResult (Ok x) = Ok x | 24 | false | true | 0 | 7 | 12 | 33 | 15 | 18 | null | null |
pshendry/project-euler-solutions | 0022/solution.hs | mit | nameScore :: Int64 -> String -> Int64
nameScore i n = i * (sum $ map charScore n) | 81 | nameScore :: Int64 -> String -> Int64
nameScore i n = i * (sum $ map charScore n) | 81 | nameScore i n = i * (sum $ map charScore n) | 43 | false | true | 0 | 8 | 17 | 40 | 20 | 20 | null | null |
dahlia/nirum | src/Nirum/Package/Metadata.hs | gpl-3.0 | fieldType (VString s) = [qq|string ($s)|] | 41 | fieldType (VString s) = [qq|string ($s)|] | 41 | fieldType (VString s) = [qq|string ($s)|] | 41 | false | false | 0 | 7 | 5 | 19 | 11 | 8 | null | null |
dmbarbour/Sirea | src/Sirea/BDeep.hs | bsd-3-clause | bonrlll = bonr . bonlll | 23 | bonrlll = bonr . bonlll | 23 | bonrlll = bonr . bonlll | 23 | false | false | 0 | 5 | 4 | 10 | 5 | 5 | null | null |
bgold-cosmos/Tidal | src/Sound/Tidal/Params.hs | gpl-3.0 | lfointCountTo :: String -> Pattern Double -> Pattern ValueMap
lfointCountTo name ipat = innerJoin $ (\i -> pStateF "lfoint" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat | 168 | lfointCountTo :: String -> Pattern Double -> Pattern ValueMap
lfointCountTo name ipat = innerJoin $ (\i -> pStateF "lfoint" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat | 168 | lfointCountTo name ipat = innerJoin $ (\i -> pStateF "lfoint" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat | 106 | false | true | 2 | 13 | 27 | 84 | 43 | 41 | null | null |
bitemyapp/ganeti | src/Ganeti/JQScheduler.hs | bsd-2-clause | scheduleSomeJobs :: JQStatus -> IO ()
scheduleSomeJobs qstate = do
cfgR <- readIORef (jqConfig qstate)
case cfgR of
Bad err -> do
let msg = "Configuration unavailable: " ++ err
logError msg
Ok cfg -> do
let filters = S.fromList . Map.elems . fromContainer $ configFilters cfg
-- Chec... | 1,199 | scheduleSomeJobs :: JQStatus -> IO ()
scheduleSomeJobs qstate = do
cfgR <- readIORef (jqConfig qstate)
case cfgR of
Bad err -> do
let msg = "Configuration unavailable: " ++ err
logError msg
Ok cfg -> do
let filters = S.fromList . Map.elems . fromContainer $ configFilters cfg
-- Chec... | 1,199 | scheduleSomeJobs qstate = do
cfgR <- readIORef (jqConfig qstate)
case cfgR of
Bad err -> do
let msg = "Configuration unavailable: " ++ err
logError msg
Ok cfg -> do
let filters = S.fromList . Map.elems . fromContainer $ configFilters cfg
-- Check if jobs are rejected by a REJECT fil... | 1,161 | false | true | 0 | 18 | 350 | 349 | 162 | 187 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/HTMLImageElement.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement.alt Mozilla HTMLImageElement.alt documentation>
setAlt ::
(MonadDOM m, ToJSString val) => HTMLImageElement -> val -> m ()
setAlt self val = liftDOM (self ^. jss "alt" (toJSVal val)) | 261 | setAlt ::
(MonadDOM m, ToJSString val) => HTMLImageElement -> val -> m ()
setAlt self val = liftDOM (self ^. jss "alt" (toJSVal val)) | 140 | setAlt self val = liftDOM (self ^. jss "alt" (toJSVal val)) | 59 | true | true | 0 | 10 | 37 | 66 | 33 | 33 | null | null |
AlexanderPankiv/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | falseDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "False") falseDataConKey falseDataCon | 106 | falseDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "False") falseDataConKey falseDataCon | 106 | falseDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "False") falseDataConKey falseDataCon | 106 | false | false | 1 | 7 | 9 | 26 | 11 | 15 | null | null |
apyrgio/snf-ganeti | src/Ganeti/Constants.hs | bsd-2-clause | defaultConfdPort :: Int
defaultConfdPort = 1814 | 47 | defaultConfdPort :: Int
defaultConfdPort = 1814 | 47 | defaultConfdPort = 1814 | 23 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
lukexi/text-gl | src/Graphics/GL/TextBuffer/TextBuffer.hs | bsd-2-clause | selectDown :: TextBuffer -> TextBuffer
selectDown buffer = setSelectionVertical (start, cursorDown end buffer) buffer
where
(start, end) = getSelection buffer | 164 | selectDown :: TextBuffer -> TextBuffer
selectDown buffer = setSelectionVertical (start, cursorDown end buffer) buffer
where
(start, end) = getSelection buffer | 164 | selectDown buffer = setSelectionVertical (start, cursorDown end buffer) buffer
where
(start, end) = getSelection buffer | 125 | false | true | 0 | 7 | 25 | 52 | 26 | 26 | null | null |
OS2World/DEV-UTIL-HUGS | oldlib/SplayHeap.hs | bsd-3-clause | maxElem E = error "SplayHeap.minElem: empty heap" | 49 | maxElem E = error "SplayHeap.minElem: empty heap" | 49 | maxElem E = error "SplayHeap.minElem: empty heap" | 49 | false | false | 0 | 5 | 6 | 12 | 5 | 7 | null | null |
rubik/stack | src/Stack/Build/Source.hs | bsd-3-clause | getPackageFilesSimple
:: (MonadIO m, MonadReader env m, MonadCatch m, MonadLogger m, HasEnvConfig env)
=> Package -> Path Abs File -> m (Set (Path Abs File), [PackageWarning])
getPackageFilesSimple pkg cabalFP = do
(_,compFiles,cabalFiles,warnings) <-
getPackageFiles (packageFiles pkg) cabalFP
r... | 471 | getPackageFilesSimple
:: (MonadIO m, MonadReader env m, MonadCatch m, MonadLogger m, HasEnvConfig env)
=> Package -> Path Abs File -> m (Set (Path Abs File), [PackageWarning])
getPackageFilesSimple pkg cabalFP = do
(_,compFiles,cabalFiles,warnings) <-
getPackageFiles (packageFiles pkg) cabalFP
r... | 471 | getPackageFilesSimple pkg cabalFP = do
(_,compFiles,cabalFiles,warnings) <-
getPackageFiles (packageFiles pkg) cabalFP
return
( Set.map dotCabalGetPath (mconcat (M.elems compFiles)) <> cabalFiles
, warnings)
-- | Get file modification time, if it exists. | 287 | false | true | 0 | 16 | 97 | 159 | 80 | 79 | null | null |
erochest/popvox-scrape | src/PopVox/Ranks.hs | apache-2.0 | assembleRanks :: PositionScoreIndex -> [BillSponsors (LegislatorInfo ICPSR)]
-> [BillRankData]
assembleRanks psIndex =
map (toData . (billSponsorInfo &&& getScore psIndex &&& getPartyCounts))
where
toData (bill, ((count, score), (d, r))) = BillRankData bill count d r score | 303 | assembleRanks :: PositionScoreIndex -> [BillSponsors (LegislatorInfo ICPSR)]
-> [BillRankData]
assembleRanks psIndex =
map (toData . (billSponsorInfo &&& getScore psIndex &&& getPartyCounts))
where
toData (bill, ((count, score), (d, r))) = BillRankData bill count d r score | 303 | assembleRanks psIndex =
map (toData . (billSponsorInfo &&& getScore psIndex &&& getPartyCounts))
where
toData (bill, ((count, score), (d, r))) = BillRankData bill count d r score | 194 | false | true | 0 | 11 | 64 | 106 | 57 | 49 | null | null |
pranjaltale16/codeworld | funblocks-client/src/Blocks/Types.hs | apache-2.0 | cwViolet = standardFunction "cwViolet" "violet" Nothing [typeColor] [] colorColor "The color violet" | 100 | cwViolet = standardFunction "cwViolet" "violet" Nothing [typeColor] [] colorColor "The color violet" | 100 | cwViolet = standardFunction "cwViolet" "violet" Nothing [typeColor] [] colorColor "The color violet" | 100 | false | false | 0 | 6 | 11 | 26 | 13 | 13 | null | null |
hguenther/smtlib2 | Language/SMTLib2/Internals/Type/Struct.hs | gpl-3.0 | mapM :: Monad m => (forall x. e x -> m (e' x)) -> Struct e tps -> m (Struct e' tps)
mapM f (Singleton x) = do
nx <- f x
return (Singleton nx) | 145 | mapM :: Monad m => (forall x. e x -> m (e' x)) -> Struct e tps -> m (Struct e' tps)
mapM f (Singleton x) = do
nx <- f x
return (Singleton nx) | 145 | mapM f (Singleton x) = do
nx <- f x
return (Singleton nx) | 61 | false | true | 0 | 12 | 38 | 99 | 46 | 53 | null | null |
TomMD/crypto-api | Crypto/HMAC.hs | bsd-3-clause | hmac' :: (Hash c d) => MacKey c d -> B.ByteString -> d
hmac' k = hmac k . L.fromChunks . return | 95 | hmac' :: (Hash c d) => MacKey c d -> B.ByteString -> d
hmac' k = hmac k . L.fromChunks . return | 95 | hmac' k = hmac k . L.fromChunks . return | 40 | false | true | 1 | 9 | 21 | 60 | 27 | 33 | null | null |
lspitzner/brittany | data/Test305.hs | agpl-3.0 | -- brittany { lconfig_indentPolicy: IndentPolicyLeft }
runBrittany tabSize text = do
let
config' = staticDefaultConfig
config = config'
{ _conf_layout = (_conf_layout config')
{ _lconfig_indentAmount = coerce tabSize
}
, _conf_forward = forwardOptionsSyntaxExtsEnabled
}
p... | 347 | runBrittany tabSize text = do
let
config' = staticDefaultConfig
config = config'
{ _conf_layout = (_conf_layout config')
{ _lconfig_indentAmount = coerce tabSize
}
, _conf_forward = forwardOptionsSyntaxExtsEnabled
}
parsePrintModule config text | 292 | runBrittany tabSize text = do
let
config' = staticDefaultConfig
config = config'
{ _conf_layout = (_conf_layout config')
{ _lconfig_indentAmount = coerce tabSize
}
, _conf_forward = forwardOptionsSyntaxExtsEnabled
}
parsePrintModule config text | 292 | true | false | 0 | 14 | 84 | 65 | 34 | 31 | null | null |
robstewart57/stack | src/main/Main.hs | bsd-3-clause | -- | Enforce mutual exclusion of every action running via this
-- function, on this path, on this users account.
--
-- A lock file is created inside the given directory. Currently,
-- stack uses locks per-snapshot. In the future, stack may refine
-- this to an even more fine-grain locking approach.
--
withUserFileLoc... | 1,828 | withUserFileLock :: (MonadBaseControl IO m, MonadIO m)
=> Path Abs Dir
-> (Maybe FileLock -> m a)
-> m a
withUserFileLock dir act = do
env <- liftIO getEnvironment
let toLock = lookup "STACK_LOCK" env == Just "true"
if toLock
then do
let... | 1,523 | withUserFileLock dir act = do
env <- liftIO getEnvironment
let toLock = lookup "STACK_LOCK" env == Just "true"
if toLock
then do
let lockfile = $(mkRelFile "lockfile")
let pth = dir </> lockfile
liftIO $ createDirectoryIfMissing True (toFilePath dir)
-... | 1,367 | true | true | 4 | 17 | 766 | 353 | 177 | 176 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/stranal/DmdAnal.hs | bsd-3-clause | annotateBndr :: AnalEnv -> DmdType -> Var -> (DmdType, Var)
-- The returned env has the var deleted
-- The returned var is annotated with demand info
-- according to the result demand of the provided demand type
-- No effect on the argument demands
annotateBndr env dmd_ty var
| isId var = (dmd_ty', setIdDemandInfo v... | 419 | annotateBndr :: AnalEnv -> DmdType -> Var -> (DmdType, Var)
annotateBndr env dmd_ty var
| isId var = (dmd_ty', setIdDemandInfo var dmd)
| otherwise = (dmd_ty, var)
where
(dmd_ty', dmd) = findBndrDmd env False dmd_ty var | 230 | annotateBndr env dmd_ty var
| isId var = (dmd_ty', setIdDemandInfo var dmd)
| otherwise = (dmd_ty, var)
where
(dmd_ty', dmd) = findBndrDmd env False dmd_ty var | 170 | true | true | 1 | 8 | 81 | 96 | 52 | 44 | null | null |
BartAdv/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | highestFC (PDPair fc _ _ _ _) = Just fc | 39 | highestFC (PDPair fc _ _ _ _) = Just fc | 39 | highestFC (PDPair fc _ _ _ _) = Just fc | 39 | false | false | 0 | 7 | 9 | 26 | 12 | 14 | null | null |
hpacheco/HAAP | examples/plab/oracle/OracleT1.hs | mit | invOrientacao Este = Oeste | 26 | invOrientacao Este = Oeste | 26 | invOrientacao Este = Oeste | 26 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
pparkkin/eta | compiler/ETA/BasicTypes/Id.hs | bsd-3-clause | {-
Note [Exported LocalIds]
~~~~~~~~~~~~~~~~~~~~~~~~
We use mkExportedLocalId for things like
- Dictionary functions (DFunId)
- Wrapper and matcher Ids for pattern synonyms
- Default methods for classes
- Pattern-synonym matcher and builder Ids
- etc
They marked as "exported" in the sense that they should be kept... | 2,226 | recordSelectorFieldLabel :: Id -> (TyCon, FieldLabel)
recordSelectorFieldLabel id
= case Var.idDetails id of
RecSelId { sel_tycon = tycon } -> (tycon, idName id)
_ -> panic "recordSelectorFieldLabel" | 217 | recordSelectorFieldLabel id
= case Var.idDetails id of
RecSelId { sel_tycon = tycon } -> (tycon, idName id)
_ -> panic "recordSelectorFieldLabel" | 163 | true | true | 0 | 10 | 504 | 68 | 36 | 32 | null | null |
geocurnoff/nikki | src/Base/Application/Sound.hs | lgpl-3.0 | kSoundVolume :: Configuration -> Maybe Float
mkSoundVolume config = Just (globalSoundVolume * config ^. sound_volume)
| 118 | mkSoundVolume :: Configuration -> Maybe Float
mkSoundVolume config = Just (globalSoundVolume * config ^. sound_volume) | 118 | mkSoundVolume config = Just (globalSoundVolume * config ^. sound_volume) | 72 | false | true | 0 | 8 | 15 | 39 | 18 | 21 | null | null |
DavidAlphaFox/darcs | src/Darcs/UI/Commands/Clone.hs | gpl-2.0 | clone :: DarcsCommand [DarcsFlag]
clone = DarcsCommand
{ commandProgramName = "darcs"
, commandName = "clone"
, commandHelp = cloneHelp
, commandDescription = cloneDescription
, commandExtraArgs = -1
, commandExtraArgHelp = ["<REPOSITORY>", "[<DIRECTORY>]"]
, commandCommand = cloneCmd
, ... | 686 | clone :: DarcsCommand [DarcsFlag]
clone = DarcsCommand
{ commandProgramName = "darcs"
, commandName = "clone"
, commandHelp = cloneHelp
, commandDescription = cloneDescription
, commandExtraArgs = -1
, commandExtraArgHelp = ["<REPOSITORY>", "[<DIRECTORY>]"]
, commandCommand = cloneCmd
, ... | 686 | clone = DarcsCommand
{ commandProgramName = "darcs"
, commandName = "clone"
, commandHelp = cloneHelp
, commandDescription = cloneDescription
, commandExtraArgs = -1
, commandExtraArgHelp = ["<REPOSITORY>", "[<DIRECTORY>]"]
, commandCommand = cloneCmd
, commandPrereq = validContextFile
... | 652 | false | true | 0 | 8 | 138 | 137 | 82 | 55 | null | null |
MaximilianAlgehed/VisPar | examples/Reduce.hs | bsd-3-clause | reduce :: NFData a => (a -> a -> a) -> [a] -> Par a
reduce f [x] = return x | 75 | reduce :: NFData a => (a -> a -> a) -> [a] -> Par a
reduce f [x] = return x | 75 | reduce f [x] = return x | 23 | false | true | 0 | 9 | 20 | 54 | 27 | 27 | null | null |
patrickt/bracer | Language/Bracer/Backends/C/Scribe.hs | mit | sample :: Scribe ()
sample = block $ do
def int "retval" (lit 0)
ret (iIdent "retval") | 90 | sample :: Scribe ()
sample = block $ do
def int "retval" (lit 0)
ret (iIdent "retval") | 90 | sample = block $ do
def int "retval" (lit 0)
ret (iIdent "retval") | 70 | false | true | 2 | 10 | 20 | 55 | 23 | 32 | null | null |
athanclark/deconfigured | src/Blog/Types.hs | bsd-3-clause | sortMetaMap :: [(Meta, FilePath)] -> [(Meta, FilePath)]
sortMetaMap zs = map twos $ foldl go [] zs
where
go :: [(CalendarTime, Meta, FilePath)]
-> (Meta, FilePath)
-> [(CalendarTime, Meta, FilePath)]
go [] (m,f) = [(parseDate m, m, f)]
go xss@((n,m',f'):xs) (m,f) | n == parseDate m = (p... | 751 | sortMetaMap :: [(Meta, FilePath)] -> [(Meta, FilePath)]
sortMetaMap zs = map twos $ foldl go [] zs
where
go :: [(CalendarTime, Meta, FilePath)]
-> (Meta, FilePath)
-> [(CalendarTime, Meta, FilePath)]
go [] (m,f) = [(parseDate m, m, f)]
go xss@((n,m',f'):xs) (m,f) | n == parseDate m = (p... | 751 | sortMetaMap zs = map twos $ foldl go [] zs
where
go :: [(CalendarTime, Meta, FilePath)]
-> (Meta, FilePath)
-> [(CalendarTime, Meta, FilePath)]
go [] (m,f) = [(parseDate m, m, f)]
go xss@((n,m',f'):xs) (m,f) | n == parseDate m = (parseDate m, m, f) : xss
| ... | 695 | false | true | 5 | 10 | 267 | 353 | 184 | 169 | null | null |
TomMD/ghc | compiler/main/DynFlags.hs | bsd-3-clause | opt_F :: DynFlags -> [String]
opt_F dflags = sOpt_F (settings dflags) | 85 | opt_F :: DynFlags -> [String]
opt_F dflags = sOpt_F (settings dflags) | 85 | opt_F dflags = sOpt_F (settings dflags) | 39 | false | true | 0 | 8 | 26 | 36 | 16 | 20 | null | null |
wavewave/diagdrawer | lib/Application/DiagramDrawer/GUI.hs | bsd-2-clause | startGUI :: IO ()
startGUI = do
initGUI
window <- windowNew
ui <- uiManagerNew
uiManagerAddUiFromString ui uiDecl
fma <- actionNew "FMA" "File" Nothing Nothing
-- selecta <- actionNew "SELECTA" "Select A" Nothing Nothing
-- selectb <- actionNew "SELECTB" "Select B" Nothing Nothing
agr <- actionGr... | 2,335 | startGUI :: IO ()
startGUI = do
initGUI
window <- windowNew
ui <- uiManagerNew
uiManagerAddUiFromString ui uiDecl
fma <- actionNew "FMA" "File" Nothing Nothing
-- selecta <- actionNew "SELECTA" "Select A" Nothing Nothing
-- selectb <- actionNew "SELECTB" "Select B" Nothing Nothing
agr <- actionGro... | 2,334 | startGUI = do
initGUI
window <- windowNew
ui <- uiManagerNew
uiManagerAddUiFromString ui uiDecl
fma <- actionNew "FMA" "File" Nothing Nothing
-- selecta <- actionNew "SELECTA" "Select A" Nothing Nothing
-- selectb <- actionNew "SELECTB" "Select B" Nothing Nothing
agr <- actionGroupNew "AGR"
mapM... | 2,316 | false | true | 0 | 14 | 560 | 613 | 277 | 336 | null | null |
yiannist/ganeti | src/Ganeti/Confd/ClientFunctions.hs | bsd-2-clause | -- | Get the list of instances the given node is ([primary], [secondary]) for.
-- The server address and the server port parameters are mainly intended
-- for testing purposes. If they are Nothing, the default values will be used.
getInstances
:: String
-> Maybe String
-> Maybe Int
-> BT.ResultT String IO ([Gan... | 928 | getInstances
:: String
-> Maybe String
-> Maybe Int
-> BT.ResultT String IO ([Ganeti.Objects.Instance], [Ganeti.Objects.Instance])
getInstances node srvAddr srvPort = do
client <- liftIO $ getConfdClient srvAddr srvPort
reply <- liftIO . query client ReqNodeInstances $ PlainQuery node
case fmap (J.readJSO... | 697 | getInstances node srvAddr srvPort = do
client <- liftIO $ getConfdClient srvAddr srvPort
reply <- liftIO . query client ReqNodeInstances $ PlainQuery node
case fmap (J.readJSON . confdReplyAnswer) reply of
Just (J.Ok instances) -> return instances
Just (J.Error msg) -> fail msg
Nothing -> fail "No ans... | 558 | true | true | 0 | 14 | 171 | 183 | 89 | 94 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/GLUT/Graphics/UI/GLUT/Constants.hs | bsd-3-clause | -----------------------------------------------------------------------------
-- * @glutSetCursor@ parameters
glut_CURSOR_RIGHT_ARROW, glut_CURSOR_LEFT_ARROW, glut_CURSOR_INFO,
glut_CURSOR_DESTROY, glut_CURSOR_HELP, glut_CURSOR_CYCLE,
glut_CURSOR_SPRAY, glut_CURSOR_WAIT, glut_CURSOR_TEXT,
glut_CURSOR_CROSSHAIR... | 716 | glut_CURSOR_RIGHT_ARROW, glut_CURSOR_LEFT_ARROW, glut_CURSOR_INFO,
glut_CURSOR_DESTROY, glut_CURSOR_HELP, glut_CURSOR_CYCLE,
glut_CURSOR_SPRAY, glut_CURSOR_WAIT, glut_CURSOR_TEXT,
glut_CURSOR_CROSSHAIR, glut_CURSOR_UP_DOWN, glut_CURSOR_LEFT_RIGHT,
glut_CURSOR_TOP_SIDE, glut_CURSOR_BOTTOM_SIDE, glut_CURSOR_L... | 606 | glut_CURSOR_RIGHT_ARROW = 0 | 42 | true | true | 0 | 4 | 71 | 57 | 52 | 5 | null | null |
joeyinbox/space-invaders-haskell | src/Bunker.hs | gpl-2.0 | -- This list stores the identifier of all bunker parts
bunkerIdList = [1..48] | 77 | bunkerIdList = [1..48] | 22 | bunkerIdList = [1..48] | 22 | true | false | 0 | 5 | 12 | 12 | 7 | 5 | null | null |
gdetrez/rgl-stats | Predictability.hs | gpl-3.0 | -- | Extract a lexicon from the given gfo file for the given category
getLexicon :: FilePath -> FilePath -> String -> Int -> Sh Lexicon
getLexicon gf file cat n = do
debug $ "gf> " ++ gfcmd
setStdin $ T.pack gfcmd
output <- cmd gf "-run" file "+RTS" "-K32M" "-RTS"
return $ filter (not.null) (map (take n... | 669 | getLexicon :: FilePath -> FilePath -> String -> Int -> Sh Lexicon
getLexicon gf file cat n = do
debug $ "gf> " ++ gfcmd
setStdin $ T.pack gfcmd
output <- cmd gf "-run" file "+RTS" "-K32M" "-RTS"
return $ filter (not.null) (map (take n . readLine) (T.lines output))
where readLine line | T.null line = [... | 599 | getLexicon gf file cat n = do
debug $ "gf> " ++ gfcmd
setStdin $ T.pack gfcmd
output <- cmd gf "-run" file "+RTS" "-K32M" "-RTS"
return $ filter (not.null) (map (take n . readLine) (T.lines output))
where readLine line | T.null line = []
| otherwise = T.splitOn ", " line
... | 533 | true | true | 1 | 13 | 170 | 182 | 87 | 95 | null | null |
plow-technologies/ircbrowse | src/Ircbrowse/View/Browse.hs | bsd-3-clause | searchForm :: Maybe Text -> Html
searchForm q' =
form ! method "get" $
fieldset $ do
inputAppend $ do
input ! name "q" !. "span2" !# "appendedInputButton" ! type_ "text" ! value (maybe "" toValue q') ! placeholder "(the search index is updated once daily)" ! A.style "width:27em"
input !. "bt... | 353 | searchForm :: Maybe Text -> Html
searchForm q' =
form ! method "get" $
fieldset $ do
inputAppend $ do
input ! name "q" !. "span2" !# "appendedInputButton" ! type_ "text" ! value (maybe "" toValue q') ! placeholder "(the search index is updated once daily)" ! A.style "width:27em"
input !. "bt... | 353 | searchForm q' =
form ! method "get" $
fieldset $ do
inputAppend $ do
input ! name "q" !. "span2" !# "appendedInputButton" ! type_ "text" ! value (maybe "" toValue q') ! placeholder "(the search index is updated once daily)" ! A.style "width:27em"
input !. "btn" ! type_ "submit" ! value "Go!" | 320 | false | true | 4 | 18 | 85 | 130 | 56 | 74 | null | null |
bordaigorl/jamesbound | src/Language/PiCalc/Pretty.hs | gpl-2.0 | -- non parseable:
cspStyle opt = hoareStyle opt{
prefixSym = text "->"
, restrSyn = (\ns p -> p <+> char '\\' <+> (braces $ sep $ punctuate comma ns))
} | 166 | cspStyle opt = hoareStyle opt{
prefixSym = text "->"
, restrSyn = (\ns p -> p <+> char '\\' <+> (braces $ sep $ punctuate comma ns))
} | 148 | cspStyle opt = hoareStyle opt{
prefixSym = text "->"
, restrSyn = (\ns p -> p <+> char '\\' <+> (braces $ sep $ punctuate comma ns))
} | 148 | true | false | 0 | 13 | 44 | 67 | 35 | 32 | null | null |
Frefreak/hnem | src/Player.hs | bsd-3-clause | pauseMplayer :: MVar MpObject -> IO ()
pauseMplayer = sendCommand "pause" | 73 | pauseMplayer :: MVar MpObject -> IO ()
pauseMplayer = sendCommand "pause" | 73 | pauseMplayer = sendCommand "pause" | 34 | false | true | 0 | 8 | 10 | 31 | 13 | 18 | null | null |
keithodulaigh/Hets | OMDoc/OMDocInterface.hs | gpl-2.0 | mkADTEx :: Maybe XmlId -> [SortDef] -> ADT
mkADTEx = ADT | 56 | mkADTEx :: Maybe XmlId -> [SortDef] -> ADT
mkADTEx = ADT | 56 | mkADTEx = ADT | 13 | false | true | 0 | 8 | 10 | 32 | 14 | 18 | null | null |
garethrowlands/marsrover | test/ParserTests.hs | bsd-3-clause | -- |Run the given parser against the given 'String', returning
-- 'Either' the successfully parsed value or the 'String' part of the error message.
-- Trims any trailing newlines off the error.
parseStr :: CharParser () a -> String -> Either String a
parseStr p input = case parse p "" input of
Left pars... | 459 | parseStr :: CharParser () a -> String -> Either String a
parseStr p input = case parse p "" input of
Left parseError -> Left . trimNewlines . show $ parseError
Right parsedValue -> Right parsedValue
-- |Removes any trailing newlines | 265 | parseStr p input = case parse p "" input of
Left parseError -> Left . trimNewlines . show $ parseError
Right parsedValue -> Right parsedValue
-- |Removes any trailing newlines | 208 | true | true | 0 | 10 | 105 | 84 | 41 | 43 | null | null |
wangwangwar/cis194 | src/ch5/Calc.hs | bsd-3-clause | -- Exercise 2
evalStr :: String -> Maybe Integer
evalStr s = fmap eval (parseExp Lit Add Mul s) | 96 | evalStr :: String -> Maybe Integer
evalStr s = fmap eval (parseExp Lit Add Mul s) | 81 | evalStr s = fmap eval (parseExp Lit Add Mul s) | 46 | true | true | 0 | 7 | 19 | 39 | 19 | 20 | null | null |
dahlia/nirum | test/Nirum/DocsSpec.hs | gpl-3.0 | sampleDocument :: Block
sampleDocument =
Document
[ Heading H1 ["Hello"]
, Paragraph ["Tight list:"]
, List BulletList $ TightItemList [ ["List test"]
, ["test2"]
]
, Paragraph ["Loose list:"]
... | 670 | sampleDocument :: Block
sampleDocument =
Document
[ Heading H1 ["Hello"]
, Paragraph ["Tight list:"]
, List BulletList $ TightItemList [ ["List test"]
, ["test2"]
]
, Paragraph ["Loose list:"]
... | 670 | sampleDocument =
Document
[ Heading H1 ["Hello"]
, Paragraph ["Tight list:"]
, List BulletList $ TightItemList [ ["List test"]
, ["test2"]
]
, Paragraph ["Loose list:"]
, List (OrderedList 1 P... | 646 | false | true | 0 | 12 | 353 | 154 | 81 | 73 | null | null |
asayers/kafkalite | src/Database/Kafkalite/Types.hs | bsd-2-clause | timestamp = \case MV0 _ -> Nothing ; MV1 x -> Just (mv1Timestamp x) | 76 | timestamp = \case MV0 _ -> Nothing ; MV1 x -> Just (mv1Timestamp x) | 76 | timestamp = \case MV0 _ -> Nothing ; MV1 x -> Just (mv1Timestamp x) | 76 | false | false | 1 | 11 | 22 | 40 | 17 | 23 | null | null |
bartolkaruza/software-testing-2014-group-W1 | week1/week_1_group_w1/TAMO.hs | apache-2.0 | solveQdr :: (Float,Float,Float) -> (Float,Float)
solveQdr = \ (a,b,c) -> if a == 0 then error "not quadratic"
else let d = b^2 - 4*a*c in
if d < 0 then error "no real solutions"
else
((- b + sqrt d) / 2*a,
... | 361 | solveQdr :: (Float,Float,Float) -> (Float,Float)
solveQdr = \ (a,b,c) -> if a == 0 then error "not quadratic"
else let d = b^2 - 4*a*c in
if d < 0 then error "no real solutions"
else
((- b + sqrt d) / 2*a,
... | 360 | solveQdr = \ (a,b,c) -> if a == 0 then error "not quadratic"
else let d = b^2 - 4*a*c in
if d < 0 then error "no real solutions"
else
((- b + sqrt d) / 2*a,
(- b - sqrt d) / 2*a) | 311 | false | true | 0 | 15 | 183 | 147 | 80 | 67 | null | null |
phischu/cabal-analysis | src/Instances.hs | bsd-3-clause | targetPackageName :: (Monad m) => TargetNode -> PG m String
targetPackageName =
previousLabeled "TARGET" >=>
previousLabeled "VARIANT" >=>
previousLabeled "VERSION" >=>
nodeProperty "packagename" | 211 | targetPackageName :: (Monad m) => TargetNode -> PG m String
targetPackageName =
previousLabeled "TARGET" >=>
previousLabeled "VARIANT" >=>
previousLabeled "VERSION" >=>
nodeProperty "packagename" | 211 | targetPackageName =
previousLabeled "TARGET" >=>
previousLabeled "VARIANT" >=>
previousLabeled "VERSION" >=>
nodeProperty "packagename" | 151 | false | true | 0 | 8 | 38 | 53 | 25 | 28 | null | null |
themoritz/cabal | cabal-install/Distribution/Client/Setup.hs | bsd-3-clause | defaultFreezeFlags :: FreezeFlags
defaultFreezeFlags = FreezeFlags {
freezeDryRun = toFlag False,
freezeTests = toFlag False,
freezeBenchmarks = toFlag False,
freezeSolver = Flag defaultSolver,
freezeMaxBackjumps = Flag defaultMaxBackjumps,
freezeReorderG... | 699 | defaultFreezeFlags :: FreezeFlags
defaultFreezeFlags = FreezeFlags {
freezeDryRun = toFlag False,
freezeTests = toFlag False,
freezeBenchmarks = toFlag False,
freezeSolver = Flag defaultSolver,
freezeMaxBackjumps = Flag defaultMaxBackjumps,
freezeReorderG... | 699 | defaultFreezeFlags = FreezeFlags {
freezeDryRun = toFlag False,
freezeTests = toFlag False,
freezeBenchmarks = toFlag False,
freezeSolver = Flag defaultSolver,
freezeMaxBackjumps = Flag defaultMaxBackjumps,
freezeReorderGoals = Flag (ReorderGoals Fals... | 665 | false | true | 0 | 9 | 177 | 157 | 85 | 72 | null | null |
michalkonecny/aern2 | aern2-mfun/src/AERN2/BoxFunMinMax/Expressions/Parsers/Lisp/DataTypes.hs | bsd-3-clause | showPairList (Pair first second) = (show first) ++ " " ++ (showPairList second) | 79 | showPairList (Pair first second) = (show first) ++ " " ++ (showPairList second) | 79 | showPairList (Pair first second) = (show first) ++ " " ++ (showPairList second) | 79 | false | false | 0 | 8 | 12 | 37 | 18 | 19 | null | null |
bkoropoff/Idris-dev | src/Idris/Delaborate.hs | bsd-3-clause | showPart ist (SubReport rs) = indented . hsep . map (showPart ist) $ rs | 71 | showPart ist (SubReport rs) = indented . hsep . map (showPart ist) $ rs | 71 | showPart ist (SubReport rs) = indented . hsep . map (showPart ist) $ rs | 71 | false | false | 0 | 9 | 13 | 40 | 18 | 22 | null | null |
brendanhay/gogol | gogol-cloudkms/gen/Network/Google/CloudKMS/Types/Product.hs | mpl-2.0 | -- | Required. The name of the ImportJob that was used to wrap this key
-- material.
ickvrImportJob :: Lens' ImportCryptoKeyVersionRequest (Maybe Text)
ickvrImportJob
= lens _ickvrImportJob
(\ s a -> s{_ickvrImportJob = a}) | 231 | ickvrImportJob :: Lens' ImportCryptoKeyVersionRequest (Maybe Text)
ickvrImportJob
= lens _ickvrImportJob
(\ s a -> s{_ickvrImportJob = a}) | 146 | ickvrImportJob
= lens _ickvrImportJob
(\ s a -> s{_ickvrImportJob = a}) | 79 | true | true | 0 | 9 | 41 | 49 | 26 | 23 | null | null |
treeowl/hstats | src/Math/Statistics.hs | bsd-3-clause | -- |Sample variance
var xs = (var' 0 0 0 xs) / (fromIntegral $ length xs - 1)
where
var' _ _ s [] = s
var' m n s (x:xs) = var' nm (n + 1) (s + delta * (x - nm)) xs
where
delta = x - m
nm = m + delta/(fromIntegral $ n + 1)
-- |Interquartile range | 293 | var xs = (var' 0 0 0 xs) / (fromIntegral $ length xs - 1)
where
var' _ _ s [] = s
var' m n s (x:xs) = var' nm (n + 1) (s + delta * (x - nm)) xs
where
delta = x - m
nm = m + delta/(fromIntegral $ n + 1)
-- |Interquartile range | 273 | var xs = (var' 0 0 0 xs) / (fromIntegral $ length xs - 1)
where
var' _ _ s [] = s
var' m n s (x:xs) = var' nm (n + 1) (s + delta * (x - nm)) xs
where
delta = x - m
nm = m + delta/(fromIntegral $ n + 1)
-- |Interquartile range | 273 | true | false | 1 | 11 | 110 | 150 | 78 | 72 | null | null |
ti1024/hacq | src/Control/Monad/Quantum/Class.hs | bsd-3-clause | rawComputeParityList :: MonadQuantum w m => Bool -> w -> [w] -> m ()
rawComputeParityList False _ [] =
return () | 116 | rawComputeParityList :: MonadQuantum w m => Bool -> w -> [w] -> m ()
rawComputeParityList False _ [] =
return () | 116 | rawComputeParityList False _ [] =
return () | 47 | false | true | 0 | 10 | 24 | 60 | 27 | 33 | null | null |
GaloisInc/halvm-ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprPECategory :: PromotionErr -> SDoc
pprPECategory ClassPE = text "Class" | 81 | pprPECategory :: PromotionErr -> SDoc
pprPECategory ClassPE = text "Class" | 81 | pprPECategory ClassPE = text "Class" | 43 | false | true | 0 | 7 | 16 | 26 | 11 | 15 | null | null |
whence/powerlife | haskell/Powercards/GamePlay.hs | mit | moveCards :: BoxAccess [Card] -> BoxAccess [Card] -> [Int] -> Game -> ([Card], Game)
moveCards ba1 ba2 indexes game =
let v1 = get ba1 game
(selected, unselected) = U.divide v1 indexes
withdraw = set ba1 unselected
deposit = update ba2 (++selected)
pack g = (selected, g)
in pack... | 348 | moveCards :: BoxAccess [Card] -> BoxAccess [Card] -> [Int] -> Game -> ([Card], Game)
moveCards ba1 ba2 indexes game =
let v1 = get ba1 game
(selected, unselected) = U.divide v1 indexes
withdraw = set ba1 unselected
deposit = update ba2 (++selected)
pack g = (selected, g)
in pack... | 348 | moveCards ba1 ba2 indexes game =
let v1 = get ba1 game
(selected, unselected) = U.divide v1 indexes
withdraw = set ba1 unselected
deposit = update ba2 (++selected)
pack g = (selected, g)
in pack . deposit . withdraw $ game | 263 | false | true | 2 | 12 | 95 | 152 | 77 | 75 | null | null |
abailly/hevents | src/Hevents/Eff/Store/FileOps.hs | mit | openHandleStorage :: Handle -> IO FileStorage
openHandleStorage hdl = do
tidvar <- atomically newEmptyTMVar
tq <- newTBQueueIO 100
hSetBuffering hdl NoBuffering
let s@FileStorage{..} = FileStorage "<handle>" (Version 1) (Just hdl) tidvar tq
tid <- async (runStorage s)
atomically $ putTMVar storeTid ti... | 332 | openHandleStorage :: Handle -> IO FileStorage
openHandleStorage hdl = do
tidvar <- atomically newEmptyTMVar
tq <- newTBQueueIO 100
hSetBuffering hdl NoBuffering
let s@FileStorage{..} = FileStorage "<handle>" (Version 1) (Just hdl) tidvar tq
tid <- async (runStorage s)
atomically $ putTMVar storeTid ti... | 332 | openHandleStorage hdl = do
tidvar <- atomically newEmptyTMVar
tq <- newTBQueueIO 100
hSetBuffering hdl NoBuffering
let s@FileStorage{..} = FileStorage "<handle>" (Version 1) (Just hdl) tidvar tq
tid <- async (runStorage s)
atomically $ putTMVar storeTid tid
return s | 286 | false | true | 0 | 12 | 63 | 125 | 55 | 70 | null | null |
narrative/stack | src/Stack/Build/Haddock.hs | bsd-3-clause | generateSnapHaddockIndex
:: (MonadIO m, MonadCatch m, MonadThrow m, MonadLogger m, MonadBaseControl IO m)
=> EnvOverride
-> WhichCompiler
-> BaseConfigOpts
-> Map GhcPkgId (DumpPackage () ()) -- ^ Global package dump
-> Map GhcPkgId (DumpPackage () ()) -- ^ Snapshot package dump
-> m ()
ge... | 581 | generateSnapHaddockIndex
:: (MonadIO m, MonadCatch m, MonadThrow m, MonadLogger m, MonadBaseControl IO m)
=> EnvOverride
-> WhichCompiler
-> BaseConfigOpts
-> Map GhcPkgId (DumpPackage () ()) -- ^ Global package dump
-> Map GhcPkgId (DumpPackage () ()) -- ^ Snapshot package dump
-> m ()
ge... | 581 | generateSnapHaddockIndex envOverride wc bco globalDumpPkgs snapshotDumpPkgs =
generateHaddockIndex
"snapshot packages"
envOverride
wc
(Map.elems snapshotDumpPkgs ++ Map.elems globalDumpPkgs)
"."
(snapDocDir bco) | 263 | false | true | 0 | 15 | 145 | 164 | 77 | 87 | null | null |
dmeysman/tiny-compiler | src/Language/Tiny/Analysis/ConstantFolding.hs | mit | foldConstantsStatement (Output expression) = Output (foldConstantsExpression expression) | 88 | foldConstantsStatement (Output expression) = Output (foldConstantsExpression expression) | 88 | foldConstantsStatement (Output expression) = Output (foldConstantsExpression expression) | 88 | false | false | 0 | 7 | 6 | 25 | 11 | 14 | null | null |
dorchard/gram_lang | frontend/src/Language/Granule/Checker/Constraints/SymbolicGrades.hs | bsd-3-clause | symGradeMinus SPoint SPoint = return $ SPoint | 45 | symGradeMinus SPoint SPoint = return $ SPoint | 45 | symGradeMinus SPoint SPoint = return $ SPoint | 45 | false | false | 0 | 5 | 6 | 15 | 7 | 8 | null | null |
greyson/HasCraft | src/Data/Pocketmine/Entity.hs | gpl-2.0 | readFightable nbt = do
_att <- NBT.asIntegral <$> nbt </> "AttackTime"
_dea <- NBT.asIntegral <$> nbt </> "DeathTime"
_hur <- NBT.asIntegral <$> nbt </> "HurtTime"
return $ Fightable { attackTime = _att
, deathTime = _dea
, hurtTime = _hur } | 291 | readFightable nbt = do
_att <- NBT.asIntegral <$> nbt </> "AttackTime"
_dea <- NBT.asIntegral <$> nbt </> "DeathTime"
_hur <- NBT.asIntegral <$> nbt </> "HurtTime"
return $ Fightable { attackTime = _att
, deathTime = _dea
, hurtTime = _hur } | 291 | readFightable nbt = do
_att <- NBT.asIntegral <$> nbt </> "AttackTime"
_dea <- NBT.asIntegral <$> nbt </> "DeathTime"
_hur <- NBT.asIntegral <$> nbt </> "HurtTime"
return $ Fightable { attackTime = _att
, deathTime = _dea
, hurtTime = _hur } | 291 | false | false | 1 | 10 | 90 | 91 | 44 | 47 | null | null |
mbakke/ganeti | src/Ganeti/WConfd/TempRes.hs | bsd-2-clause | reserveMAC
:: (MonadError GanetiException m, MonadState TempResState m, Functor m)
=> ClientId -> MAC -> ConfigData -> m ()
reserveMAC jobId mac cd = do
let existing = S.fromList $ getAllMACs cd
when (S.member mac existing)
$ resError "MAC already in use"
modifyM $ traverseOf trsMACsL (reserve jobId mac)
... | 339 | reserveMAC
:: (MonadError GanetiException m, MonadState TempResState m, Functor m)
=> ClientId -> MAC -> ConfigData -> m ()
reserveMAC jobId mac cd = do
let existing = S.fromList $ getAllMACs cd
when (S.member mac existing)
$ resError "MAC already in use"
modifyM $ traverseOf trsMACsL (reserve jobId mac)
... | 339 | reserveMAC jobId mac cd = do
let existing = S.fromList $ getAllMACs cd
when (S.member mac existing)
$ resError "MAC already in use"
modifyM $ traverseOf trsMACsL (reserve jobId mac)
-- ** DRBD secrets | 211 | false | true | 0 | 12 | 67 | 126 | 59 | 67 | null | null |
johan1a/haskell-go | src/Eval.hs | gpl-2.0 | evalCond2 f l r state = do
left <- eval l state
right <- eval r state
return $ (O1 boolType (BoolVal (f left right))) | 129 | evalCond2 f l r state = do
left <- eval l state
right <- eval r state
return $ (O1 boolType (BoolVal (f left right))) | 129 | evalCond2 f l r state = do
left <- eval l state
right <- eval r state
return $ (O1 boolType (BoolVal (f left right))) | 129 | false | false | 0 | 13 | 36 | 71 | 31 | 40 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-build/Build/Drasil/Make/MakeString.hs | bsd-2-clause | mkWindowsVar :: VarName -> VarVal -> VarVal -> MakeString
mkWindowsVar n w e = Mv $ Os n w e e | 94 | mkWindowsVar :: VarName -> VarVal -> VarVal -> MakeString
mkWindowsVar n w e = Mv $ Os n w e e | 94 | mkWindowsVar n w e = Mv $ Os n w e e | 36 | false | true | 0 | 7 | 20 | 43 | 21 | 22 | null | null |
pparkkin/eta | compiler/ETA/TypeCheck/TcRnTypes.hs | bsd-3-clause | pprEvVarTheta :: [EvVar] -> SDoc
pprEvVarTheta ev_vars = pprTheta (map evVarPred ev_vars) | 89 | pprEvVarTheta :: [EvVar] -> SDoc
pprEvVarTheta ev_vars = pprTheta (map evVarPred ev_vars) | 89 | pprEvVarTheta ev_vars = pprTheta (map evVarPred ev_vars) | 56 | false | true | 0 | 7 | 11 | 32 | 16 | 16 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/xhtml/Text/XHtml/Table.hs | bsd-3-clause | -- We give both infix and nonfix, take your pick.
-- Notice that there is no concept of a row/column
-- of zero items.
(</>),above,(<->),beside :: (HTMLTABLE ht1,HTMLTABLE ht2)
=> ht1 -> ht2 -> HtmlTable
above a b = combine BT.above (cell a) (cell b) | 276 | (</>),above,(<->),beside :: (HTMLTABLE ht1,HTMLTABLE ht2)
=> ht1 -> ht2 -> HtmlTable
above a b = combine BT.above (cell a) (cell b) | 156 | above a b = combine BT.above (cell a) (cell b) | 48 | true | true | 6 | 9 | 70 | 92 | 44 | 48 | null | null |
d0kt0r0/estuary | client/src/Estuary/Help/MiniTidal.hs | gpl-3.0 | exampleText "trunc" = "trunc 0.75 $ sound \"bd sn*2 cp hh*4 arpy bd*2 cp bd*2\"" | 80 | exampleText "trunc" = "trunc 0.75 $ sound \"bd sn*2 cp hh*4 arpy bd*2 cp bd*2\"" | 80 | exampleText "trunc" = "trunc 0.75 $ sound \"bd sn*2 cp hh*4 arpy bd*2 cp bd*2\"" | 80 | false | false | 0 | 5 | 14 | 9 | 4 | 5 | null | null |
beni55/haste-compiler | src/Data/JSTarget/Print.hs | bsd-3-clause | norm (BinOp Eq a (Lit (LBool True))) = norm a | 47 | norm (BinOp Eq a (Lit (LBool True))) = norm a | 47 | norm (BinOp Eq a (Lit (LBool True))) = norm a | 47 | false | false | 0 | 10 | 11 | 35 | 16 | 19 | null | null |
spechub/Hets | Syntax/Parse_AS_Structured.hs | gpl-2.0 | relationRefWithLookAhead :: LogicGraph -> AParser st RELATION_REF
relationRefWithLookAhead lG = do
r <- relationRef lG
lookAhead (confidenceBegin >> return nullIRI)
<|> lookAhead (try $ hetIRI lG)
return r | 223 | relationRefWithLookAhead :: LogicGraph -> AParser st RELATION_REF
relationRefWithLookAhead lG = do
r <- relationRef lG
lookAhead (confidenceBegin >> return nullIRI)
<|> lookAhead (try $ hetIRI lG)
return r | 223 | relationRefWithLookAhead lG = do
r <- relationRef lG
lookAhead (confidenceBegin >> return nullIRI)
<|> lookAhead (try $ hetIRI lG)
return r | 157 | false | true | 0 | 11 | 45 | 72 | 32 | 40 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.