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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
syunta/PFDS | Chapter3.hs | mit | rlbalance :: R.Color -> R.RedBlackSet a -> a -> R.RedBlackSet a -> R.RedBlackSet a
rlbalance R.B a x (R.T R.R (R.T R.R b y c) z d) = R.T R.R (R.T R.B a x b) y (R.T R.B c z d) | 174 | rlbalance :: R.Color -> R.RedBlackSet a -> a -> R.RedBlackSet a -> R.RedBlackSet a
rlbalance R.B a x (R.T R.R (R.T R.R b y c) z d) = R.T R.R (R.T R.B a x b) y (R.T R.B c z d) | 174 | rlbalance R.B a x (R.T R.R (R.T R.R b y c) z d) = R.T R.R (R.T R.B a x b) y (R.T R.B c z d) | 91 | false | true | 0 | 10 | 40 | 132 | 64 | 68 | null | null |
brendanhay/gogol | gogol-monitoring/gen/Network/Google/Resource/Monitoring/Projects/Groups/Get.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
pggUploadType :: Lens' ProjectsGroupsGet (Maybe Text)
pggUploadType
= lens _pggUploadType
(\ s a -> s{_pggUploadType = a}) | 201 | pggUploadType :: Lens' ProjectsGroupsGet (Maybe Text)
pggUploadType
= lens _pggUploadType
(\ s a -> s{_pggUploadType = a}) | 130 | pggUploadType
= lens _pggUploadType
(\ s a -> s{_pggUploadType = a}) | 76 | true | true | 0 | 9 | 34 | 48 | 25 | 23 | null | null |
gcampax/ghc | compiler/types/FamInstEnv.hs | bsd-3-clause | normaliseType _env role ty@(LitTy {}) = (mkReflCo role ty, ty) | 62 | normaliseType _env role ty@(LitTy {}) = (mkReflCo role ty, ty) | 62 | normaliseType _env role ty@(LitTy {}) = (mkReflCo role ty, ty) | 62 | false | false | 0 | 8 | 9 | 34 | 18 | 16 | null | null |
ekarayel/HTF | tests/TestHTF.hs | lgpl-2.1 | pendingTests :: [T.Text]
pendingTests =
["pendingProp_PENDING"
,"pendingTest_PENDING"] | 94 | pendingTests :: [T.Text]
pendingTests =
["pendingProp_PENDING"
,"pendingTest_PENDING"] | 94 | pendingTests =
["pendingProp_PENDING"
,"pendingTest_PENDING"] | 69 | false | true | 0 | 6 | 14 | 22 | 13 | 9 | null | null |
waldheinz/ads | src/lib/Codec/Archive/Tar/Types.hs | gpl-3.0 | -- | An 'Entry' with all default values except for the file name and type. It
-- uses the portable USTAR/POSIX format (see 'UstarHeader').
--
-- You can use this as a basis and override specific fields, eg:
--
-- > (emptyEntry name HardLink) { linkTarget = target }
--
simpleEntry :: TarPath -> EntryContent -> Entry
simpleEntry tarpath content = Entry {
entryTarPath = tarpath,
entryContent = content,
entryPermissions = case content of
Directory -> directoryPermissions
_ -> ordinaryFilePermissions,
entryOwnership = Ownership "" "" 0 0,
entryTime = 0,
entryFormat = UstarFormat
} | 688 | simpleEntry :: TarPath -> EntryContent -> Entry
simpleEntry tarpath content = Entry {
entryTarPath = tarpath,
entryContent = content,
entryPermissions = case content of
Directory -> directoryPermissions
_ -> ordinaryFilePermissions,
entryOwnership = Ownership "" "" 0 0,
entryTime = 0,
entryFormat = UstarFormat
} | 419 | simpleEntry tarpath content = Entry {
entryTarPath = tarpath,
entryContent = content,
entryPermissions = case content of
Directory -> directoryPermissions
_ -> ordinaryFilePermissions,
entryOwnership = Ownership "" "" 0 0,
entryTime = 0,
entryFormat = UstarFormat
} | 371 | true | true | 0 | 9 | 199 | 94 | 56 | 38 | null | null |
urbanslug/ghc | testsuite/tests/deSugar/should_compile/ds046.hs | bsd-3-clause | h (A x (B y) z) = y + 2 | 23 | h (A x (B y) z) = y + 2 | 23 | h (A x (B y) z) = y + 2 | 23 | false | false | 0 | 8 | 9 | 30 | 14 | 16 | null | null |
ekmett/ghclive | prototypes/sharededitor/WsTest.hs | bsd-3-clause | applyOp e (Remove a) = liftIO $ modifyMVar_ (doc e) $ \(d,clients) -> do
time <- getTimestamp
let d' = removeAtom a time d
return (d', clients) | 265 | applyOp e (Remove a) = liftIO $ modifyMVar_ (doc e) $ \(d,clients) -> do
time <- getTimestamp
let d' = removeAtom a time d
return (d', clients) | 265 | applyOp e (Remove a) = liftIO $ modifyMVar_ (doc e) $ \(d,clients) -> do
time <- getTimestamp
let d' = removeAtom a time d
return (d', clients) | 265 | false | false | 0 | 12 | 148 | 80 | 39 | 41 | null | null |
shayan-najd/HsParser | U/Pretty.hs | gpl-3.0 | fits _ (Above {}) = error "fits Above" | 47 | fits _ (Above {}) = error "fits Above" | 47 | fits _ (Above {}) = error "fits Above" | 47 | false | false | 0 | 7 | 16 | 21 | 10 | 11 | null | null |
mmailhot/Dumblisp | Dumblisp/Types.hs | mit | showVal (Atom name) = name | 26 | showVal (Atom name) = name | 26 | showVal (Atom name) = name | 26 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
plaimi/blubber-server | src-exec/blubber-server.hs | agpl-3.0 | serve :: Int -> IO ()
-- | Very simple Web server with an info page and the source code of the game.
--
-- The info page is compiled from web/index.markdown.
--
-- The source is served from web/src.tar.gz.
serve = flip scotty $ do
get "/src.tar.gz" $ do
setHeader "Content-Disposition" "attachment"
setHeader "Content-Type" "application/x-gzip"
setHeader "filename" "src.tar.gz"
file =<< liftIO (getDataFileName "web/src.tar.gz")
get "/" $ do
setHeader "Content-Type" "text/html"
f <- liftIO $ readFile =<< getDataFileName "web/index.markdown"
case readMarkdown def f of
Left _ -> html "blubber-server"
Right m -> html . pack . writeHtmlString def $ m | 697 | serve :: Int -> IO ()
serve = flip scotty $ do
get "/src.tar.gz" $ do
setHeader "Content-Disposition" "attachment"
setHeader "Content-Type" "application/x-gzip"
setHeader "filename" "src.tar.gz"
file =<< liftIO (getDataFileName "web/src.tar.gz")
get "/" $ do
setHeader "Content-Type" "text/html"
f <- liftIO $ readFile =<< getDataFileName "web/index.markdown"
case readMarkdown def f of
Left _ -> html "blubber-server"
Right m -> html . pack . writeHtmlString def $ m | 513 | serve = flip scotty $ do
get "/src.tar.gz" $ do
setHeader "Content-Disposition" "attachment"
setHeader "Content-Type" "application/x-gzip"
setHeader "filename" "src.tar.gz"
file =<< liftIO (getDataFileName "web/src.tar.gz")
get "/" $ do
setHeader "Content-Type" "text/html"
f <- liftIO $ readFile =<< getDataFileName "web/index.markdown"
case readMarkdown def f of
Left _ -> html "blubber-server"
Right m -> html . pack . writeHtmlString def $ m | 491 | true | true | 2 | 16 | 145 | 174 | 75 | 99 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/Writers/Docx.hs | gpl-2.0 | blockToOpenXML opts (CodeBlock attrs str) =
withParaProp (pStyle "SourceCode") $ blockToOpenXML opts $ Para [Code attrs str] | 126 | blockToOpenXML opts (CodeBlock attrs str) =
withParaProp (pStyle "SourceCode") $ blockToOpenXML opts $ Para [Code attrs str] | 126 | blockToOpenXML opts (CodeBlock attrs str) =
withParaProp (pStyle "SourceCode") $ blockToOpenXML opts $ Para [Code attrs str] | 126 | false | false | 0 | 9 | 18 | 50 | 23 | 27 | null | null |
kojiromike/Idris-dev | src/IRTS/Lang.hs | bsd-3-clause | lift env (LCase up e alts) = do alts' <- mapM liftA alts
e' <- lift env e
return (LCase up e' alts')
where
liftA (LConCase i n args e) = do e' <- lift (env ++ args) e
return (LConCase i n args e')
liftA (LConstCase c e) = do e' <- lift env e
return (LConstCase c e')
liftA (LDefaultCase e) = do e' <- lift env e
return (LDefaultCase e') | 515 | lift env (LCase up e alts) = do alts' <- mapM liftA alts
e' <- lift env e
return (LCase up e' alts')
where
liftA (LConCase i n args e) = do e' <- lift (env ++ args) e
return (LConCase i n args e')
liftA (LConstCase c e) = do e' <- lift env e
return (LConstCase c e')
liftA (LDefaultCase e) = do e' <- lift env e
return (LDefaultCase e') | 515 | lift env (LCase up e alts) = do alts' <- mapM liftA alts
e' <- lift env e
return (LCase up e' alts')
where
liftA (LConCase i n args e) = do e' <- lift (env ++ args) e
return (LConCase i n args e')
liftA (LConstCase c e) = do e' <- lift env e
return (LConstCase c e')
liftA (LDefaultCase e) = do e' <- lift env e
return (LDefaultCase e') | 515 | false | false | 0 | 10 | 251 | 203 | 91 | 112 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/enumFrom_6.hs | mit | fsEsOrdering :: Ordering -> Ordering -> MyBool
fsEsOrdering x y = not (esEsOrdering x y) | 92 | fsEsOrdering :: Ordering -> Ordering -> MyBool
fsEsOrdering x y = not (esEsOrdering x y) | 92 | fsEsOrdering x y = not (esEsOrdering x y) | 41 | false | true | 0 | 8 | 18 | 41 | 18 | 23 | null | null |
duplode/zip-conduit | tests/Tests.hs | bsd-3-clause | assertConduitDeprecated :: Assertion
assertConduitDeprecated =
withSystemTempDirectory "zip-conduit" $ \dir -> do
let archivePath = dir </> archiveName
archiveD archivePath fileName content
result <- unarchiveD archivePath fileName
assertEqual "" content result
where
archiveName = "test.zip"
fileName = "test.txt"
content = "some not really long test text"
-- | Creates new archive at 'archivePath' and puts there file with
-- 'content'. | 499 | assertConduitDeprecated :: Assertion
assertConduitDeprecated =
withSystemTempDirectory "zip-conduit" $ \dir -> do
let archivePath = dir </> archiveName
archiveD archivePath fileName content
result <- unarchiveD archivePath fileName
assertEqual "" content result
where
archiveName = "test.zip"
fileName = "test.txt"
content = "some not really long test text"
-- | Creates new archive at 'archivePath' and puts there file with
-- 'content'. | 499 | assertConduitDeprecated =
withSystemTempDirectory "zip-conduit" $ \dir -> do
let archivePath = dir </> archiveName
archiveD archivePath fileName content
result <- unarchiveD archivePath fileName
assertEqual "" content result
where
archiveName = "test.zip"
fileName = "test.txt"
content = "some not really long test text"
-- | Creates new archive at 'archivePath' and puts there file with
-- 'content'. | 462 | false | true | 3 | 12 | 119 | 104 | 44 | 60 | null | null |
geraldus/yesod | yesod-auth/Yesod/Auth/GoogleEmail2.hs | mit | csrfKey :: Text
csrfKey = "_GOOGLE_CSRF_TOKEN" | 46 | csrfKey :: Text
csrfKey = "_GOOGLE_CSRF_TOKEN" | 46 | csrfKey = "_GOOGLE_CSRF_TOKEN" | 30 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
thalerjonathan/phd | coding/libraries/chimera/src/FRP/Chimera/Simulation/ParIteration.hs | gpl-3.0 | foldEnvironments :: Double
-> SimulationParams e
-> [e]
-> e
-> (e, SimulationParams e)
foldEnvironments dt params allEnvs defaultEnv
| isFoldingEnv = runEnv dt params foldedEnv
| otherwise = (defaultEnv, params)
where
isFoldingEnv = isJust mayEnvFoldFun
mayEnvFoldFun = simEnvFold params
envFoldFun = fromJust mayEnvFoldFun
foldedEnv = envFoldFun allEnvs | 469 | foldEnvironments :: Double
-> SimulationParams e
-> [e]
-> e
-> (e, SimulationParams e)
foldEnvironments dt params allEnvs defaultEnv
| isFoldingEnv = runEnv dt params foldedEnv
| otherwise = (defaultEnv, params)
where
isFoldingEnv = isJust mayEnvFoldFun
mayEnvFoldFun = simEnvFold params
envFoldFun = fromJust mayEnvFoldFun
foldedEnv = envFoldFun allEnvs | 469 | foldEnvironments dt params allEnvs defaultEnv
| isFoldingEnv = runEnv dt params foldedEnv
| otherwise = (defaultEnv, params)
where
isFoldingEnv = isJust mayEnvFoldFun
mayEnvFoldFun = simEnvFold params
envFoldFun = fromJust mayEnvFoldFun
foldedEnv = envFoldFun allEnvs | 297 | false | true | 4 | 12 | 161 | 135 | 58 | 77 | null | null |
KommuSoft/dep-software | Dep.Ui.Utils.hs | gpl-3.0 | linC 149 = '\x253d' | 19 | linC 149 = '\x253d' | 19 | linC 149 = '\x253d' | 19 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
lambd0x/Programming_Languages | Haskell/basis/lista2-e-extras.hs | gpl-3.0 | al a ((l, s):xs)= if a == s then l:(al a xs)
else [] | 70 | al a ((l, s):xs)= if a == s then l:(al a xs)
else [] | 70 | al a ((l, s):xs)= if a == s then l:(al a xs)
else [] | 70 | false | false | 0 | 8 | 31 | 51 | 27 | 24 | null | null |
brendanhay/gogol | gogol-logging/gen/Network/Google/Resource/Logging/Exclusions/Create.hs | mpl-2.0 | -- | Required. The parent resource in which to create the exclusion:
-- \"projects\/[PROJECT_ID]\" \"organizations\/[ORGANIZATION_ID]\"
-- \"billingAccounts\/[BILLING_ACCOUNT_ID]\" \"folders\/[FOLDER_ID]\"
-- Examples: \"projects\/my-logging-project\",
-- \"organizations\/123456789\".
eParent :: Lens' ExclusionsCreate Text
eParent = lens _eParent (\ s a -> s{_eParent = a}) | 375 | eParent :: Lens' ExclusionsCreate Text
eParent = lens _eParent (\ s a -> s{_eParent = a}) | 89 | eParent = lens _eParent (\ s a -> s{_eParent = a}) | 50 | true | true | 0 | 9 | 38 | 44 | 26 | 18 | null | null |
garrettpauls/dicetool | tests/TestMain.hs | mit | tests :: [Test]
tests = parserTests ++ interpreterTests | 55 | tests :: [Test]
tests = parserTests ++ interpreterTests | 55 | tests = parserTests ++ interpreterTests | 39 | false | true | 0 | 7 | 7 | 25 | 11 | 14 | null | null |
rueshyna/gogol | gogol-games/gen/Network/Google/Games/Types/Product.hs | mpl-2.0 | -- | The amount of time in milliseconds it took to send packets back and
-- forth on the unreliable channel with this peer.
rppsUnreliableRoundtripLatencyMillis :: Lens' RoomP2PStatus (Maybe Int32)
rppsUnreliableRoundtripLatencyMillis
= lens _rppsUnreliableRoundtripLatencyMillis
(\ s a ->
s{_rppsUnreliableRoundtripLatencyMillis = a})
. mapping _Coerce | 376 | rppsUnreliableRoundtripLatencyMillis :: Lens' RoomP2PStatus (Maybe Int32)
rppsUnreliableRoundtripLatencyMillis
= lens _rppsUnreliableRoundtripLatencyMillis
(\ s a ->
s{_rppsUnreliableRoundtripLatencyMillis = a})
. mapping _Coerce | 252 | rppsUnreliableRoundtripLatencyMillis
= lens _rppsUnreliableRoundtripLatencyMillis
(\ s a ->
s{_rppsUnreliableRoundtripLatencyMillis = a})
. mapping _Coerce | 178 | true | true | 0 | 10 | 66 | 56 | 29 | 27 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2018/M02/D08/OneLiner.hs | mit | {--
We have maybe :: b -> (a -> b) -> Maybe a -> b
But we don't have list? Or do we? Define list:
--}
list :: b -> ([a] -> b) -> [a] -> b
list nullanswer flist lst = undefined | 177 | list :: b -> ([a] -> b) -> [a] -> b
list nullanswer flist lst = undefined | 73 | list nullanswer flist lst = undefined | 37 | true | true | 0 | 9 | 44 | 49 | 25 | 24 | null | null |
mettekou/ghc | compiler/simplCore/CoreMonad.hs | bsd-3-clause | doSimplTick _ _ (VerySimplCount n) = VerySimplCount (n+1) | 57 | doSimplTick _ _ (VerySimplCount n) = VerySimplCount (n+1) | 57 | doSimplTick _ _ (VerySimplCount n) = VerySimplCount (n+1) | 57 | false | false | 0 | 7 | 7 | 29 | 14 | 15 | null | null |
jkr/pandoc-citeproc | src/Text/CSL/Proc/Disamb.hs | bsd-3-clause | rmExtras :: [Output] -> [Output]
rmExtras os
| Output x _ : xs <- os = case rmExtras x of
[] -> rmExtras xs
ys -> ys ++ rmExtras xs
| OContrib _ _ x _ _ : xs <- os = OContrib [] [] x [] [] : rmExtras xs
| OYear y _ f : xs <- os = OYear y [] f : rmExtras xs
| ODel _ : xs <- os = rmExtras xs
| OLoc _ _ : xs <- os = rmExtras xs
| x : xs <- os = x : rmExtras xs
| otherwise = [] | 564 | rmExtras :: [Output] -> [Output]
rmExtras os
| Output x _ : xs <- os = case rmExtras x of
[] -> rmExtras xs
ys -> ys ++ rmExtras xs
| OContrib _ _ x _ _ : xs <- os = OContrib [] [] x [] [] : rmExtras xs
| OYear y _ f : xs <- os = OYear y [] f : rmExtras xs
| ODel _ : xs <- os = rmExtras xs
| OLoc _ _ : xs <- os = rmExtras xs
| x : xs <- os = x : rmExtras xs
| otherwise = [] | 564 | rmExtras os
| Output x _ : xs <- os = case rmExtras x of
[] -> rmExtras xs
ys -> ys ++ rmExtras xs
| OContrib _ _ x _ _ : xs <- os = OContrib [] [] x [] [] : rmExtras xs
| OYear y _ f : xs <- os = OYear y [] f : rmExtras xs
| ODel _ : xs <- os = rmExtras xs
| OLoc _ _ : xs <- os = rmExtras xs
| x : xs <- os = x : rmExtras xs
| otherwise = [] | 531 | false | true | 1 | 10 | 291 | 262 | 120 | 142 | null | null |
mydaum/cabal | Cabal/Distribution/Simple/GHC.hs | bsd-3-clause | gbuildModDefFiles :: GBuildMode -> [FilePath]
gbuildModDefFiles (GBuildExe _) = [] | 86 | gbuildModDefFiles :: GBuildMode -> [FilePath]
gbuildModDefFiles (GBuildExe _) = [] | 86 | gbuildModDefFiles (GBuildExe _) = [] | 40 | false | true | 0 | 7 | 13 | 29 | 15 | 14 | null | null |
leshchevds/ganeti | src/Ganeti/HTools/Node.hs | bsd-2-clause | setCpuSpeed :: Node -> Double -> Node
setCpuSpeed n f = n { tCpuSpeed = f } | 75 | setCpuSpeed :: Node -> Double -> Node
setCpuSpeed n f = n { tCpuSpeed = f } | 75 | setCpuSpeed n f = n { tCpuSpeed = f } | 37 | false | true | 0 | 6 | 16 | 32 | 17 | 15 | null | null |
ublubu/shapes | shapes/src/Physics/Contact/GJK.hs | mit | extendSimplex2 :: Simplex2 -> Neighborhood -> Maybe Simplex3
extendSimplex2 simplex@(Simplex2 bb cc) aa
| bi == ai || ci == ai = Nothing -- it's a repeat
| otherwise = Just $ mkSimplex3 aa simplex
where ai = _neighborhoodIndex aa
bi = _neighborhoodIndex bb
ci = _neighborhoodIndex cc | 305 | extendSimplex2 :: Simplex2 -> Neighborhood -> Maybe Simplex3
extendSimplex2 simplex@(Simplex2 bb cc) aa
| bi == ai || ci == ai = Nothing -- it's a repeat
| otherwise = Just $ mkSimplex3 aa simplex
where ai = _neighborhoodIndex aa
bi = _neighborhoodIndex bb
ci = _neighborhoodIndex cc | 305 | extendSimplex2 simplex@(Simplex2 bb cc) aa
| bi == ai || ci == ai = Nothing -- it's a repeat
| otherwise = Just $ mkSimplex3 aa simplex
where ai = _neighborhoodIndex aa
bi = _neighborhoodIndex bb
ci = _neighborhoodIndex cc | 244 | false | true | 3 | 10 | 69 | 100 | 49 | 51 | null | null |
mcmaniac/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | pprCLabel platform lbl
= getPprStyle $ \ sty ->
if cGhcWithNativeCodeGen == "YES" && asmStyle sty
then maybe_underscore (pprAsmCLbl platform lbl)
else pprCLbl lbl | 180 | pprCLabel platform lbl
= getPprStyle $ \ sty ->
if cGhcWithNativeCodeGen == "YES" && asmStyle sty
then maybe_underscore (pprAsmCLbl platform lbl)
else pprCLbl lbl | 180 | pprCLabel platform lbl
= getPprStyle $ \ sty ->
if cGhcWithNativeCodeGen == "YES" && asmStyle sty
then maybe_underscore (pprAsmCLbl platform lbl)
else pprCLbl lbl | 180 | false | false | 3 | 9 | 41 | 59 | 26 | 33 | null | null |
antarestrader/sapphire | Eval/Parameters.hs | gpl-3.0 | checkArity _ _ = False | 22 | checkArity _ _ = False | 22 | checkArity _ _ = False | 22 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
urbanslug/ghc | testsuite/tests/cabal/cabal01/A.hs | bsd-3-clause | a = 42 :: Int | 13 | a = 42 :: Int | 13 | a = 42 :: Int | 13 | false | false | 0 | 4 | 4 | 12 | 6 | 6 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxPAPER_A3_EXTRA_TRANSVERSE :: Int
wxPAPER_A3_EXTRA_TRANSVERSE = 66 | 67 | wxPAPER_A3_EXTRA_TRANSVERSE :: Int
wxPAPER_A3_EXTRA_TRANSVERSE = 66 | 67 | wxPAPER_A3_EXTRA_TRANSVERSE = 66 | 32 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
forsyde/forsyde-shallow | src/ForSyDe/Shallow/MoC/Synchronous/Lib.hs | bsd-3-clause | filterSY p (x:-xs) = if (p x == True) then
Prst x :- filterSY p xs
else
Abst :- filterSY p xs | 160 | filterSY p (x:-xs) = if (p x == True) then
Prst x :- filterSY p xs
else
Abst :- filterSY p xs | 160 | filterSY p (x:-xs) = if (p x == True) then
Prst x :- filterSY p xs
else
Abst :- filterSY p xs | 160 | false | false | 0 | 8 | 88 | 57 | 28 | 29 | null | null |
AlexeyRaga/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | primOpInfo PopCnt8Op = mkMonadic (fsLit "popCnt8#") wordPrimTy | 62 | primOpInfo PopCnt8Op = mkMonadic (fsLit "popCnt8#") wordPrimTy | 62 | primOpInfo PopCnt8Op = mkMonadic (fsLit "popCnt8#") wordPrimTy | 62 | false | false | 1 | 7 | 6 | 23 | 9 | 14 | null | null |
UoYCS-plasma/LazySmallCheck2012 | suite/performance/Benchmarks/RedBlack.hs | bsd-3-clause | -- Mistake on 4th line, 3rd line is correct
balance B (T R (T R a x b) y c) z d = T R (T B a x b) y (T B c z d) | 111 | balance B (T R (T R a x b) y c) z d = T R (T B a x b) y (T B c z d) | 67 | balance B (T R (T R a x b) y c) z d = T R (T B a x b) y (T B c z d) | 67 | true | false | 0 | 9 | 35 | 73 | 36 | 37 | null | null |
thomaseding/cgs | src/Hoops/SegPath.hs | bsd-3-clause | parseAbsoluteType :: SegParser AbsoluteType
parseAbsoluteType = parseByRoot <|> parseByAlias <|> parseByKey | 107 | parseAbsoluteType :: SegParser AbsoluteType
parseAbsoluteType = parseByRoot <|> parseByAlias <|> parseByKey | 107 | parseAbsoluteType = parseByRoot <|> parseByAlias <|> parseByKey | 63 | false | true | 0 | 6 | 10 | 22 | 11 | 11 | null | null |
kyren/hstecs | library/Tecs/Definitions.hs | unlicense | destDesc DestAM = ("AM", 0x5) | 29 | destDesc DestAM = ("AM", 0x5) | 29 | destDesc DestAM = ("AM", 0x5) | 29 | false | false | 0 | 5 | 4 | 15 | 8 | 7 | null | null |
greyson/HasCraft | src/Database/Pocketmine.hs | gpl-2.0 | isUnknownType _ = False | 23 | isUnknownType _ = False | 23 | isUnknownType _ = False | 23 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
zuoqin/hackerrank | src/QueueUsingTwoStacks.hs | bsd-3-clause | buildenstack :: (Stack Int, Stack Int) -> (Stack Int, Stack Int)
buildenstack (stack1,stack2)
| isEmpty stack2 = (stack1, stack2)
| otherwise = buildenstack( (push (top stack2) stack1),(snd (pop stack2))) | 208 | buildenstack :: (Stack Int, Stack Int) -> (Stack Int, Stack Int)
buildenstack (stack1,stack2)
| isEmpty stack2 = (stack1, stack2)
| otherwise = buildenstack( (push (top stack2) stack1),(snd (pop stack2))) | 208 | buildenstack (stack1,stack2)
| isEmpty stack2 = (stack1, stack2)
| otherwise = buildenstack( (push (top stack2) stack1),(snd (pop stack2))) | 143 | false | true | 1 | 10 | 32 | 105 | 54 | 51 | null | null |
DougBurke/swish | src/Swish/RDF/Vocabulary/FOAF.hs | lgpl-2.1 | -- | @foaf:Document@ from <http://xmlns.com/foaf/spec/#term_Document>.
foafDocument :: ScopedName
foafDocument = toF "Document" | 127 | foafDocument :: ScopedName
foafDocument = toF "Document" | 56 | foafDocument = toF "Document" | 29 | true | true | 0 | 5 | 11 | 15 | 8 | 7 | null | null |
Arguggi/Frinfo | src/Frinfo/INotify.hs | mit | eventLength mvar (IN.MovedOut isDir _ _) = updateMVar mvar Remove isDir | 71 | eventLength mvar (IN.MovedOut isDir _ _) = updateMVar mvar Remove isDir | 71 | eventLength mvar (IN.MovedOut isDir _ _) = updateMVar mvar Remove isDir | 71 | false | false | 0 | 8 | 10 | 30 | 14 | 16 | null | null |
snoyberg/ghc | compiler/hsSyn/HsBinds.hs | bsd-3-clause | ppr_sig (IdSig id) = pprVarSig [id] (ppr (varType id)) | 64 | ppr_sig (IdSig id) = pprVarSig [id] (ppr (varType id)) | 64 | ppr_sig (IdSig id) = pprVarSig [id] (ppr (varType id)) | 64 | false | false | 0 | 9 | 18 | 36 | 17 | 19 | null | null |
Mattiemus/LaneWars | Game/Shared/Object.hs | mit | basicGameObject = GameObject {
goId = (-1),
goType = NotAnObject,
goStats = Nothing,
goTarget = (-1),
goTargetDirection = zeroVector,
goTeam = Neutral,
goClass = Mage,
goLane = Middle,
goPos = zeroVector,
goSize = zeroVector,
goIsDead = False
} | 336 | basicGameObject = GameObject {
goId = (-1),
goType = NotAnObject,
goStats = Nothing,
goTarget = (-1),
goTargetDirection = zeroVector,
goTeam = Neutral,
goClass = Mage,
goLane = Middle,
goPos = zeroVector,
goSize = zeroVector,
goIsDead = False
} | 336 | basicGameObject = GameObject {
goId = (-1),
goType = NotAnObject,
goStats = Nothing,
goTarget = (-1),
goTargetDirection = zeroVector,
goTeam = Neutral,
goClass = Mage,
goLane = Middle,
goPos = zeroVector,
goSize = zeroVector,
goIsDead = False
} | 336 | false | false | 0 | 8 | 129 | 84 | 54 | 30 | null | null |
bholst/blog | Handler/Feed.hs | mit | getFeed :: Route (HandlerSite Handler) -> [Entity Entry] -> Handler (Feed (Route (HandlerSite Handler)))
getFeed feed blogEntries = do
let entries = map entry2FeedEntry blogEntries
extra <- getExtra
let title = extraPagename extra
author = extraAuthor extra
language = "en"
updated <- case entries of
[] -> liftIO $ getCurrentTime
_ -> return $ foldl1 max (map (entryUpdated . entityVal) blogEntries)
return $ Feed title feed BlogR author (toHtml ("" :: Text)) language updated entries
where
entry2FeedEntry (Entity entryId entry) =
FeedEntry (EntryR entryId) (entryPosted entry) (entryTitle entry) (toHtml $ entryContent entry) | 709 | getFeed :: Route (HandlerSite Handler) -> [Entity Entry] -> Handler (Feed (Route (HandlerSite Handler)))
getFeed feed blogEntries = do
let entries = map entry2FeedEntry blogEntries
extra <- getExtra
let title = extraPagename extra
author = extraAuthor extra
language = "en"
updated <- case entries of
[] -> liftIO $ getCurrentTime
_ -> return $ foldl1 max (map (entryUpdated . entityVal) blogEntries)
return $ Feed title feed BlogR author (toHtml ("" :: Text)) language updated entries
where
entry2FeedEntry (Entity entryId entry) =
FeedEntry (EntryR entryId) (entryPosted entry) (entryTitle entry) (toHtml $ entryContent entry) | 709 | getFeed feed blogEntries = do
let entries = map entry2FeedEntry blogEntries
extra <- getExtra
let title = extraPagename extra
author = extraAuthor extra
language = "en"
updated <- case entries of
[] -> liftIO $ getCurrentTime
_ -> return $ foldl1 max (map (entryUpdated . entityVal) blogEntries)
return $ Feed title feed BlogR author (toHtml ("" :: Text)) language updated entries
where
entry2FeedEntry (Entity entryId entry) =
FeedEntry (EntryR entryId) (entryPosted entry) (entryTitle entry) (toHtml $ entryContent entry) | 604 | false | true | 0 | 16 | 172 | 256 | 122 | 134 | null | null |
maurer/15-411-Haskell-Base-Code | src/Text/Parsec/ByteString/Lazy.hs | bsd-3-clause | -- | @parseFromFile p filePath@ runs a lazy bytestring parser @p@ on the
-- input read from @filePath@ using 'ByteString.Lazy.Char8.readFile'. Returns either a 'ParseError'
-- ('Left') or a value of type @a@ ('Right').
--
-- > main = do{ result <- parseFromFile numbers "digits.txt"
-- > ; case result of
-- > Left err -> print err
-- > Right xs -> print (sum xs)
-- > }
parseFromFile :: Parser a -> String -> IO (Either ParseError a)
parseFromFile p fname
= do input <- C.readFile fname
return (runP p () fname input) | 597 | parseFromFile :: Parser a -> String -> IO (Either ParseError a)
parseFromFile p fname
= do input <- C.readFile fname
return (runP p () fname input) | 160 | parseFromFile p fname
= do input <- C.readFile fname
return (runP p () fname input) | 96 | true | true | 0 | 10 | 172 | 79 | 41 | 38 | null | null |
brendanhay/gogol | gogol-digitalassetlinks/gen/Network/Google/DigitalAssetLinks/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'WebAsset' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'waSite'
webAsset
:: WebAsset
webAsset = WebAsset' {_waSite = Nothing} | 242 | webAsset
:: WebAsset
webAsset = WebAsset' {_waSite = Nothing} | 65 | webAsset = WebAsset' {_waSite = Nothing} | 40 | true | true | 0 | 6 | 46 | 24 | 16 | 8 | null | null |
DavidAlphaFox/darcs | hashed-storage/Storage/Hashed/Plain.hs | gpl-2.0 | readPlainTree :: FilePath -> IO (Tree IO)
readPlainTree dir = do
items <- readPlainDir dir
let subs = catMaybes [
let name = Name (BS8.pack name')
in case status of
_ | isDirectory status -> Just (name, Stub (readPlainTree (dir </> name')) NoHash)
_ | isRegularFile status -> Just (name, File $ Blob (readBlob' name) NoHash)
_ -> Nothing
| (name', status) <- items ]
return $ makeTree subs
where readBlob' (Name name) = readSegment (dir </> BS8.unpack name, Nothing)
-- | Write out /full/ tree to a plain directory structure. If you instead want
-- to make incremental updates, refer to "Storage.Hashed.Monad". | 687 | readPlainTree :: FilePath -> IO (Tree IO)
readPlainTree dir = do
items <- readPlainDir dir
let subs = catMaybes [
let name = Name (BS8.pack name')
in case status of
_ | isDirectory status -> Just (name, Stub (readPlainTree (dir </> name')) NoHash)
_ | isRegularFile status -> Just (name, File $ Blob (readBlob' name) NoHash)
_ -> Nothing
| (name', status) <- items ]
return $ makeTree subs
where readBlob' (Name name) = readSegment (dir </> BS8.unpack name, Nothing)
-- | Write out /full/ tree to a plain directory structure. If you instead want
-- to make incremental updates, refer to "Storage.Hashed.Monad". | 687 | readPlainTree dir = do
items <- readPlainDir dir
let subs = catMaybes [
let name = Name (BS8.pack name')
in case status of
_ | isDirectory status -> Just (name, Stub (readPlainTree (dir </> name')) NoHash)
_ | isRegularFile status -> Just (name, File $ Blob (readBlob' name) NoHash)
_ -> Nothing
| (name', status) <- items ]
return $ makeTree subs
where readBlob' (Name name) = readSegment (dir </> BS8.unpack name, Nothing)
-- | Write out /full/ tree to a plain directory structure. If you instead want
-- to make incremental updates, refer to "Storage.Hashed.Monad". | 645 | false | true | 0 | 24 | 179 | 232 | 109 | 123 | null | null |
kwibus/myLang | src/Operator.hs | bsd-3-clause | plus :: Value
plus = BuildIn
{ prettyName = "+"
, vName = "plus"
, arrity = 2
, fixity = Infix 2 AssoLeft
, myType = tDouble ~> tDouble ~> tDouble
, evaluator = evalplus
, stack = []
} | 216 | plus :: Value
plus = BuildIn
{ prettyName = "+"
, vName = "plus"
, arrity = 2
, fixity = Infix 2 AssoLeft
, myType = tDouble ~> tDouble ~> tDouble
, evaluator = evalplus
, stack = []
} | 216 | plus = BuildIn
{ prettyName = "+"
, vName = "plus"
, arrity = 2
, fixity = Infix 2 AssoLeft
, myType = tDouble ~> tDouble ~> tDouble
, evaluator = evalplus
, stack = []
} | 202 | false | true | 0 | 9 | 72 | 80 | 44 | 36 | null | null |
obgs/utils | src/Obgs/Utils/Tuple.hs | mit | -- | Maps the given function over the third element of the given 3-uple.
third3 :: (c -> d) -> (a, b, c) -> (a, b, d)
third3 f (x, y, z) = (x, y, f z) | 150 | third3 :: (c -> d) -> (a, b, c) -> (a, b, d)
third3 f (x, y, z) = (x, y, f z) | 77 | third3 f (x, y, z) = (x, y, f z) | 32 | true | true | 0 | 9 | 36 | 77 | 43 | 34 | null | null |
TomMD/cryptol | src/Cryptol/Parser/ParserUtils.hs | bsd-3-clause | mkSchema :: [TParam] -> [Prop] -> Type -> Schema
mkSchema xs ps t = Forall xs ps t Nothing | 90 | mkSchema :: [TParam] -> [Prop] -> Type -> Schema
mkSchema xs ps t = Forall xs ps t Nothing | 90 | mkSchema xs ps t = Forall xs ps t Nothing | 41 | false | true | 0 | 9 | 18 | 50 | 24 | 26 | null | null |
diku-dk/futhark | src/Futhark/IR/Primitive.hs | isc | valueIntegral (Int16Value v) = fromIntegral v | 45 | valueIntegral (Int16Value v) = fromIntegral v | 45 | valueIntegral (Int16Value v) = fromIntegral v | 45 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
thalerjonathan/phd | coding/libraries/chimera/src/FRP/Chimera/Rendering/GlossSimulator.hs | gpl-3.0 | displayGlossWindow :: String -> (Int, Int) -> GLO.Display
displayGlossWindow title winSize = (GLO.InWindow title winSize (0, 0)) | 128 | displayGlossWindow :: String -> (Int, Int) -> GLO.Display
displayGlossWindow title winSize = (GLO.InWindow title winSize (0, 0)) | 128 | displayGlossWindow title winSize = (GLO.InWindow title winSize (0, 0)) | 70 | false | true | 0 | 7 | 16 | 50 | 27 | 23 | null | null |
anchor/ceilometer-common | tests/SampleData.hs | bsd-3-clause | ssdPD1 = PDSSD VolumeCreating VolumeCreate End 30 | 49 | ssdPD1 = PDSSD VolumeCreating VolumeCreate End 30 | 49 | ssdPD1 = PDSSD VolumeCreating VolumeCreate End 30 | 49 | false | false | 1 | 5 | 6 | 20 | 7 | 13 | null | null |
wochinge/CacheSimulator | src/Clock/Car2.hs | bsd-3-clause | to :: File -> Car -> Car
to file cache
| file `biggerAsMax` cache = cache
| not inGhostCache = preparedCache {t1 = file `Clock.to` t1 preparedCache}
| inB1 = fromB1toT2 file . incP $ preparedCache
| otherwise = fromB2toT2 file . decP $ preparedCache
where
inB1 = file `Lru.inCache` b1 cache
inB2 = not inB1 && file `Lru.inCache` b2 cache
inGhostCache = inB1 || inB2
preparedCache = replaceGhostCaches inGhostCache file $ replace file cache | 491 | to :: File -> Car -> Car
to file cache
| file `biggerAsMax` cache = cache
| not inGhostCache = preparedCache {t1 = file `Clock.to` t1 preparedCache}
| inB1 = fromB1toT2 file . incP $ preparedCache
| otherwise = fromB2toT2 file . decP $ preparedCache
where
inB1 = file `Lru.inCache` b1 cache
inB2 = not inB1 && file `Lru.inCache` b2 cache
inGhostCache = inB1 || inB2
preparedCache = replaceGhostCaches inGhostCache file $ replace file cache | 491 | to file cache
| file `biggerAsMax` cache = cache
| not inGhostCache = preparedCache {t1 = file `Clock.to` t1 preparedCache}
| inB1 = fromB1toT2 file . incP $ preparedCache
| otherwise = fromB2toT2 file . decP $ preparedCache
where
inB1 = file `Lru.inCache` b1 cache
inB2 = not inB1 && file `Lru.inCache` b2 cache
inGhostCache = inB1 || inB2
preparedCache = replaceGhostCaches inGhostCache file $ replace file cache | 466 | false | true | 0 | 9 | 126 | 176 | 88 | 88 | null | null |
mthom/abominable-klambda-compiler | Compiler/CodeGenerator.hs | bsd-3-clause | litToPat (LBoundF n _ _) = conP (mkName "ApplC")
[conP (mkName "Func")
[ litP (stringL (T.unpack n))
, wildP ]] | 222 | litToPat (LBoundF n _ _) = conP (mkName "ApplC")
[conP (mkName "Func")
[ litP (stringL (T.unpack n))
, wildP ]] | 222 | litToPat (LBoundF n _ _) = conP (mkName "ApplC")
[conP (mkName "Func")
[ litP (stringL (T.unpack n))
, wildP ]] | 222 | false | false | 0 | 14 | 130 | 67 | 33 | 34 | null | null |
tittoassini/typed | test/Test/Data/Values.hs | bsd-3-clause | pe1 :: PerfectF Maybe Bool
pe1 = ConsP True (ConsP (Just False) (ConsP (Just (Just True)) NilP)) | 96 | pe1 :: PerfectF Maybe Bool
pe1 = ConsP True (ConsP (Just False) (ConsP (Just (Just True)) NilP)) | 96 | pe1 = ConsP True (ConsP (Just False) (ConsP (Just (Just True)) NilP)) | 69 | false | true | 1 | 13 | 16 | 58 | 27 | 31 | null | null |
jhallard/WinterClasses16 | CS112/hw/hw2/hw2.hs | mit | -- | 8.)
onlyCapitals3 :: String -> String
onlyCapitals3 [] = [] | 64 | onlyCapitals3 :: String -> String
onlyCapitals3 [] = [] | 55 | onlyCapitals3 [] = [] | 21 | true | true | 0 | 6 | 11 | 23 | 12 | 11 | null | null |
worksap-ate/aws-sdk | Cloud/AWS/ELB/LoadBalancer.hs | bsd-3-clause | disableAvailabilityZonesForLoadBalancer
:: (MonadBaseControl IO m, MonadResource m)
=> [Text] -- ^ A list of Availability Zones to be removed from the LoadBalancer.
-> Text -- ^ The name associated with the LoadBalancer.
-> ELB m [Text] -- ^ A list of updated Availability Zones for the LoadBalancer.
disableAvailabilityZonesForLoadBalancer zones lb =
elbQuery "DisableAvailabilityZonesForLoadBalancer" params
$ members "AvailabilityZones" content
where
params =
[ "AvailabilityZones.member" |.#= zones
, "LoadBalancerName" |= lb
] | 585 | disableAvailabilityZonesForLoadBalancer
:: (MonadBaseControl IO m, MonadResource m)
=> [Text] -- ^ A list of Availability Zones to be removed from the LoadBalancer.
-> Text -- ^ The name associated with the LoadBalancer.
-> ELB m [Text]
disableAvailabilityZonesForLoadBalancer zones lb =
elbQuery "DisableAvailabilityZonesForLoadBalancer" params
$ members "AvailabilityZones" content
where
params =
[ "AvailabilityZones.member" |.#= zones
, "LoadBalancerName" |= lb
] | 521 | disableAvailabilityZonesForLoadBalancer zones lb =
elbQuery "DisableAvailabilityZonesForLoadBalancer" params
$ members "AvailabilityZones" content
where
params =
[ "AvailabilityZones.member" |.#= zones
, "LoadBalancerName" |= lb
] | 268 | true | true | 3 | 10 | 123 | 102 | 49 | 53 | null | null |
wavewave/lhc-analysis-collection | exe/2013-08-05-XQLD.hs | gpl-3.0 | p_squark :: DDecay
p_squark = d (squarks, [p_neut, t jets]) | 60 | p_squark :: DDecay
p_squark = d (squarks, [p_neut, t jets]) | 59 | p_squark = d (squarks, [p_neut, t jets]) | 40 | false | true | 0 | 8 | 10 | 36 | 17 | 19 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSQL_INTEGER :: Int
wxSQL_INTEGER = 4 | 38 | wxSQL_INTEGER :: Int
wxSQL_INTEGER = 4 | 38 | wxSQL_INTEGER = 4 | 17 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
andrey013/frore | src/Graphics/Rendering/Frore.hs | mit | distCalcD1 :: Array U DIM2 Word8 -> Array U DIM2 Word8
distCalcD1 arr = fromUnboxed e . calcdf index id id (+ (w+1)) (subtract (w+1)) . toUnboxed $ arr
where e@(Z :. h :. w) = extent arr
index :: U.Vector Word8 -> Int -> Word8
index v i = let t = fromIntegral $ fromMaybe 0 $ v U.!? (i - w)
b = fromIntegral $ fromMaybe 0 $ v U.!? (i + w)
l = fromIntegral $ fromMaybe 0 $ v U.!? (i - 1)
r = fromIntegral $ fromMaybe 0 $ v U.!? (i + 1)
c = fromIntegral $ fromMaybe 0 $ v U.!? i
in round $ 0.042893219 * (t + b + l + r) + 0.828427125 * c | 669 | distCalcD1 :: Array U DIM2 Word8 -> Array U DIM2 Word8
distCalcD1 arr = fromUnboxed e . calcdf index id id (+ (w+1)) (subtract (w+1)) . toUnboxed $ arr
where e@(Z :. h :. w) = extent arr
index :: U.Vector Word8 -> Int -> Word8
index v i = let t = fromIntegral $ fromMaybe 0 $ v U.!? (i - w)
b = fromIntegral $ fromMaybe 0 $ v U.!? (i + w)
l = fromIntegral $ fromMaybe 0 $ v U.!? (i - 1)
r = fromIntegral $ fromMaybe 0 $ v U.!? (i + 1)
c = fromIntegral $ fromMaybe 0 $ v U.!? i
in round $ 0.042893219 * (t + b + l + r) + 0.828427125 * c | 669 | distCalcD1 arr = fromUnboxed e . calcdf index id id (+ (w+1)) (subtract (w+1)) . toUnboxed $ arr
where e@(Z :. h :. w) = extent arr
index :: U.Vector Word8 -> Int -> Word8
index v i = let t = fromIntegral $ fromMaybe 0 $ v U.!? (i - w)
b = fromIntegral $ fromMaybe 0 $ v U.!? (i + w)
l = fromIntegral $ fromMaybe 0 $ v U.!? (i - 1)
r = fromIntegral $ fromMaybe 0 $ v U.!? (i + 1)
c = fromIntegral $ fromMaybe 0 $ v U.!? i
in round $ 0.042893219 * (t + b + l + r) + 0.828427125 * c | 614 | false | true | 41 | 12 | 258 | 301 | 157 | 144 | null | null |
themoritz/cabal | Cabal/Distribution/Simple/Haddock.hs | bsd-3-clause | getInterfaces :: Verbosity
-> LocalBuildInfo
-> ComponentLocalBuildInfo
-> Maybe PathTemplate -- ^ template for HTML location
-> IO HaddockArgs
getInterfaces verbosity lbi clbi htmlTemplate = do
(packageFlags, warnings) <- haddockPackageFlags verbosity lbi clbi htmlTemplate
traverse_ (warn (verboseUnmarkOutput verbosity)) warnings
return $ mempty {
argInterfaces = packageFlags
} | 481 | getInterfaces :: Verbosity
-> LocalBuildInfo
-> ComponentLocalBuildInfo
-> Maybe PathTemplate -- ^ template for HTML location
-> IO HaddockArgs
getInterfaces verbosity lbi clbi htmlTemplate = do
(packageFlags, warnings) <- haddockPackageFlags verbosity lbi clbi htmlTemplate
traverse_ (warn (verboseUnmarkOutput verbosity)) warnings
return $ mempty {
argInterfaces = packageFlags
} | 481 | getInterfaces verbosity lbi clbi htmlTemplate = do
(packageFlags, warnings) <- haddockPackageFlags verbosity lbi clbi htmlTemplate
traverse_ (warn (verboseUnmarkOutput verbosity)) warnings
return $ mempty {
argInterfaces = packageFlags
} | 281 | false | true | 0 | 11 | 146 | 100 | 49 | 51 | null | null |
lulf/wishsys | Handler/WishListLogin.hs | mit | getWishListLoginR :: Text -> AccessLevel -> Handler Html
getWishListLoginR urlName accessLevel = do
wishList <- getWishlist urlName
(formWidget, enctype) <- generateFormPost $ loginForm urlName accessLevel
defaultLayout $ do
setTitleI MsgHomeTitle
$(widgetFile "wishlist_login") | 306 | getWishListLoginR :: Text -> AccessLevel -> Handler Html
getWishListLoginR urlName accessLevel = do
wishList <- getWishlist urlName
(formWidget, enctype) <- generateFormPost $ loginForm urlName accessLevel
defaultLayout $ do
setTitleI MsgHomeTitle
$(widgetFile "wishlist_login") | 306 | getWishListLoginR urlName accessLevel = do
wishList <- getWishlist urlName
(formWidget, enctype) <- generateFormPost $ loginForm urlName accessLevel
defaultLayout $ do
setTitleI MsgHomeTitle
$(widgetFile "wishlist_login") | 249 | false | true | 0 | 12 | 59 | 82 | 37 | 45 | null | null |
wetneb/yanker | src/TypeHierarchy.hs | gpl-3.0 | renderLSparen (LSLeft b a) NoParen =
(renderLSparen a AlwaysParen) ++ "\\" ++ (renderLSparen b ParenRight) | 108 | renderLSparen (LSLeft b a) NoParen =
(renderLSparen a AlwaysParen) ++ "\\" ++ (renderLSparen b ParenRight) | 108 | renderLSparen (LSLeft b a) NoParen =
(renderLSparen a AlwaysParen) ++ "\\" ++ (renderLSparen b ParenRight) | 108 | false | false | 0 | 8 | 16 | 43 | 21 | 22 | null | null |
mettekou/ghc | compiler/deSugar/DsArrows.hs | bsd-3-clause | dsfixCmdStmts
:: DsCmdEnv -- arrow combinators
-> IdSet -- set of local vars available to this statement
-> [Id] -- output vars of these statements
-> [CmdLStmt Id] -- statements to desugar
-> DsM (CoreExpr, -- desugared expression
DIdSet, -- subset of local vars that occur free
[Id]) -- same local vars as a list
dsfixCmdStmts ids local_vars out_ids stmts
= trimInput (dsCmdStmts ids local_vars out_ids stmts) | 560 | dsfixCmdStmts
:: DsCmdEnv -- arrow combinators
-> IdSet -- set of local vars available to this statement
-> [Id] -- output vars of these statements
-> [CmdLStmt Id] -- statements to desugar
-> DsM (CoreExpr, -- desugared expression
DIdSet, -- subset of local vars that occur free
[Id])
dsfixCmdStmts ids local_vars out_ids stmts
= trimInput (dsCmdStmts ids local_vars out_ids stmts) | 520 | dsfixCmdStmts ids local_vars out_ids stmts
= trimInput (dsCmdStmts ids local_vars out_ids stmts) | 98 | true | true | 0 | 11 | 215 | 82 | 46 | 36 | null | null |
paulrzcz/takusen-oracle | Database/Oracle/Test/Enumerator.hs | bsd-3-clause | opFixtureMultiResultSet4 = "DROP PROCEDURE takusenTestProc"
| 61 | dropFixtureMultiResultSet4 = "DROP PROCEDURE takusenTestProc" | 61 | dropFixtureMultiResultSet4 = "DROP PROCEDURE takusenTestProc" | 61 | false | false | 0 | 4 | 6 | 6 | 3 | 3 | null | null |
teleshoes/taffybar | src/System/Taffybar/Information/Battery.hs | bsd-3-clause | batteryLog
:: MonadIO m
=> Priority -> String -> m ()
batteryLog priority = liftIO . logM batteryLogPath priority | 117 | batteryLog
:: MonadIO m
=> Priority -> String -> m ()
batteryLog priority = liftIO . logM batteryLogPath priority | 117 | batteryLog priority = liftIO . logM batteryLogPath priority | 59 | false | true | 0 | 9 | 22 | 46 | 21 | 25 | null | null |
Heather/Idris-dev | src/Idris/Elab/Quasiquote.hs | bsd-3-clause | extractTUnquotes n (LetTacTy name t1 t2) = extract2 n (LetTacTy name) t1 t2 | 75 | extractTUnquotes n (LetTacTy name t1 t2) = extract2 n (LetTacTy name) t1 t2 | 75 | extractTUnquotes n (LetTacTy name t1 t2) = extract2 n (LetTacTy name) t1 t2 | 75 | false | false | 0 | 7 | 12 | 36 | 17 | 19 | null | null |
mightymoose/liquidhaskell | src/Language/Haskell/Liquid/RefType.hs | bsd-3-clause | strengthenRefType_ f (RAllE x tx t1) (RAllE y ty t2) | x == y
= RAllE x (strengthenRefType_ f tx ty) $ strengthenRefType_ f t1 t2 | 131 | strengthenRefType_ f (RAllE x tx t1) (RAllE y ty t2) | x == y
= RAllE x (strengthenRefType_ f tx ty) $ strengthenRefType_ f t1 t2 | 131 | strengthenRefType_ f (RAllE x tx t1) (RAllE y ty t2) | x == y
= RAllE x (strengthenRefType_ f tx ty) $ strengthenRefType_ f t1 t2 | 131 | false | false | 0 | 9 | 27 | 69 | 32 | 37 | null | null |
clchiou/gwab | lib/Telnet/Internal/Utils.hs | gpl-3.0 | -- NOTE: readUntilIac is NOT lazy; it continues to read until it sees an IAC
-- that is not sent as data, i.e., start of next command. The non-laziness is
-- probably only useful when parsing subnegotiation where the suboption is not
-- complete until we see an SE command.
--
-- This function also unquotes IACs that are sent as data.
readUntilIac :: String -> String -> FilterResult String
readUntilIac prefix suffix
| null suffix =
if null prefix
then Left NeedMoreInput
else Right (prefix, suffix)
| otherwise =
if iacSentAsData == [rfc854_IAC, rfc854_IAC]
then readUntilIac (prefix ++ prefix' ++ [rfc854_IAC]) suffix''
else Right (prefix ++ prefix', suffix')
where (prefix', suffix') = span (/= rfc854_IAC) suffix
(iacSentAsData, suffix'') = splitAt 2 suffix' | 851 | readUntilIac :: String -> String -> FilterResult String
readUntilIac prefix suffix
| null suffix =
if null prefix
then Left NeedMoreInput
else Right (prefix, suffix)
| otherwise =
if iacSentAsData == [rfc854_IAC, rfc854_IAC]
then readUntilIac (prefix ++ prefix' ++ [rfc854_IAC]) suffix''
else Right (prefix ++ prefix', suffix')
where (prefix', suffix') = span (/= rfc854_IAC) suffix
(iacSentAsData, suffix'') = splitAt 2 suffix' | 514 | readUntilIac prefix suffix
| null suffix =
if null prefix
then Left NeedMoreInput
else Right (prefix, suffix)
| otherwise =
if iacSentAsData == [rfc854_IAC, rfc854_IAC]
then readUntilIac (prefix ++ prefix' ++ [rfc854_IAC]) suffix''
else Right (prefix ++ prefix', suffix')
where (prefix', suffix') = span (/= rfc854_IAC) suffix
(iacSentAsData, suffix'') = splitAt 2 suffix' | 458 | true | true | 0 | 10 | 209 | 171 | 90 | 81 | null | null |
LightAndLight/hindley-milner | src/Phil/Parser.hs | bsd-3-clause | parseExpr :: String -> Result Expr
parseExpr = runParser expr | 61 | parseExpr :: String -> Result Expr
parseExpr = runParser expr | 61 | parseExpr = runParser expr | 26 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
phischu/fragnix | tests/packages/scotty/Data.HashMap.Array.hs | bsd-3-clause | foldr :: (a -> b -> b) -> b -> Array a -> b
foldr f = \ z0 ary0 -> go ary0 (length ary0) 0 z0
where
go ary n i z
| i >= n = z
| otherwise = f (index ary i) (go ary n (i+1) z)
| 200 | foldr :: (a -> b -> b) -> b -> Array a -> b
foldr f = \ z0 ary0 -> go ary0 (length ary0) 0 z0
where
go ary n i z
| i >= n = z
| otherwise = f (index ary i) (go ary n (i+1) z)
| 200 | foldr f = \ z0 ary0 -> go ary0 (length ary0) 0 z0
where
go ary n i z
| i >= n = z
| otherwise = f (index ary i) (go ary n (i+1) z)
| 156 | false | true | 0 | 9 | 76 | 145 | 66 | 79 | null | null |
nzok/decimal | ScaledDecimalTest.hs | mit | siGen :: Gen Integer -- signed integer
siGen = choose (-49,49) | 73 | siGen :: Gen Integer
siGen = choose (-49,49) | 44 | siGen = choose (-49,49) | 23 | true | true | 0 | 7 | 21 | 26 | 14 | 12 | null | null |
spechub/Hets | OWL2/ParseMS.hs | gpl-2.0 | acetValuePair :: GA.PrefixMap -> CharParser st (ConstrainingFacet, RestrictionValue)
facetValuePair pm = do
df <- choice $ map (\ f -> pkeyword (showFacet f) >> return f)
[ LENGTH
, MINLENGTH
, MAXLENGTH
, PATTERN
, TOTALDIGITS
, FRACTIONDIGITS ] ++ map
(\ f -> keywordNotFollowedBy (showFacet f) (oneOf "<>=")
>> return f)
[ MININCLUSIVE
, MINEXCLUSIVE
, MAXINCLUSIVE
, MAXEXCLUSIVE ]
rv <- literal pm
return (expandIRI pm (facetToIRINoSign df), rv)
-- it returns DataType Datatype or DatatypeRestriction Datatype [facetValuePair]
| 619 | facetValuePair :: GA.PrefixMap -> CharParser st (ConstrainingFacet, RestrictionValue)
facetValuePair pm = do
df <- choice $ map (\ f -> pkeyword (showFacet f) >> return f)
[ LENGTH
, MINLENGTH
, MAXLENGTH
, PATTERN
, TOTALDIGITS
, FRACTIONDIGITS ] ++ map
(\ f -> keywordNotFollowedBy (showFacet f) (oneOf "<>=")
>> return f)
[ MININCLUSIVE
, MINEXCLUSIVE
, MAXINCLUSIVE
, MAXEXCLUSIVE ]
rv <- literal pm
return (expandIRI pm (facetToIRINoSign df), rv)
-- it returns DataType Datatype or DatatypeRestriction Datatype [facetValuePair] | 619 | facetValuePair pm = do
df <- choice $ map (\ f -> pkeyword (showFacet f) >> return f)
[ LENGTH
, MINLENGTH
, MAXLENGTH
, PATTERN
, TOTALDIGITS
, FRACTIONDIGITS ] ++ map
(\ f -> keywordNotFollowedBy (showFacet f) (oneOf "<>=")
>> return f)
[ MININCLUSIVE
, MINEXCLUSIVE
, MAXINCLUSIVE
, MAXEXCLUSIVE ]
rv <- literal pm
return (expandIRI pm (facetToIRINoSign df), rv)
-- it returns DataType Datatype or DatatypeRestriction Datatype [facetValuePair] | 533 | false | true | 0 | 16 | 167 | 176 | 91 | 85 | null | null |
jfischoff/hs-mitsuba | tests/Tests/Mitsuba/Types.hs | bsd-3-clause | actualStratified
= SStratified
$ Stratified
{ stratifiedSampleCount = Whole 1
, stratifiedDimension = Whole 2
} | 136 | actualStratified
= SStratified
$ Stratified
{ stratifiedSampleCount = Whole 1
, stratifiedDimension = Whole 2
} | 136 | actualStratified
= SStratified
$ Stratified
{ stratifiedSampleCount = Whole 1
, stratifiedDimension = Whole 2
} | 136 | false | false | 3 | 7 | 40 | 34 | 16 | 18 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/Distribution/Simple/BuildTarget.hs | bsd-3-clause | reportBuildTargetProblems :: [BuildTargetProblem] -> IO ()
reportBuildTargetProblems problems = do
case [ (t, e, g) | BuildTargetExpected t e g <- problems ] of
[] -> return ()
targets ->
die $ unlines
[ "Unrecognised build target '" ++ showUserBuildTarget target
++ "'.\n"
++ "Expected a " ++ intercalate " or " expected
++ ", rather than '" ++ got ++ "'."
| (target, expected, got) <- targets ]
case [ (t, e) | BuildTargetNoSuch t e <- problems ] of
[] -> return ()
targets ->
die $ unlines
[ "Unknown build target '" ++ showUserBuildTarget target
++ "'.\nThere is no "
++ intercalate " or " [ mungeThing thing ++ " '" ++ got ++ "'"
| (thing, got) <- nosuch ] ++ "."
| (target, nosuch) <- targets ]
where
mungeThing "file" = "file target"
mungeThing thing = thing
case [ (t, ts) | BuildTargetAmbiguous t ts <- problems ] of
[] -> return ()
targets ->
die $ unlines
[ "Ambiguous build target '" ++ showUserBuildTarget target
++ "'. It could be:\n "
++ unlines [ " "++ showUserBuildTarget ut ++
" (" ++ showBuildTargetKind bt ++ ")"
| (ut, bt) <- amb ]
| (target, amb) <- targets ]
where
showBuildTargetKind (BuildTargetComponent _ ) = "component"
showBuildTargetKind (BuildTargetModule _ _) = "module"
showBuildTargetKind (BuildTargetFile _ _) = "file"
----------------------------------
-- Top level BuildTarget matcher
-- | 1,706 | reportBuildTargetProblems :: [BuildTargetProblem] -> IO ()
reportBuildTargetProblems problems = do
case [ (t, e, g) | BuildTargetExpected t e g <- problems ] of
[] -> return ()
targets ->
die $ unlines
[ "Unrecognised build target '" ++ showUserBuildTarget target
++ "'.\n"
++ "Expected a " ++ intercalate " or " expected
++ ", rather than '" ++ got ++ "'."
| (target, expected, got) <- targets ]
case [ (t, e) | BuildTargetNoSuch t e <- problems ] of
[] -> return ()
targets ->
die $ unlines
[ "Unknown build target '" ++ showUserBuildTarget target
++ "'.\nThere is no "
++ intercalate " or " [ mungeThing thing ++ " '" ++ got ++ "'"
| (thing, got) <- nosuch ] ++ "."
| (target, nosuch) <- targets ]
where
mungeThing "file" = "file target"
mungeThing thing = thing
case [ (t, ts) | BuildTargetAmbiguous t ts <- problems ] of
[] -> return ()
targets ->
die $ unlines
[ "Ambiguous build target '" ++ showUserBuildTarget target
++ "'. It could be:\n "
++ unlines [ " "++ showUserBuildTarget ut ++
" (" ++ showBuildTargetKind bt ++ ")"
| (ut, bt) <- amb ]
| (target, amb) <- targets ]
where
showBuildTargetKind (BuildTargetComponent _ ) = "component"
showBuildTargetKind (BuildTargetModule _ _) = "module"
showBuildTargetKind (BuildTargetFile _ _) = "file"
----------------------------------
-- Top level BuildTarget matcher
-- | 1,706 | reportBuildTargetProblems problems = do
case [ (t, e, g) | BuildTargetExpected t e g <- problems ] of
[] -> return ()
targets ->
die $ unlines
[ "Unrecognised build target '" ++ showUserBuildTarget target
++ "'.\n"
++ "Expected a " ++ intercalate " or " expected
++ ", rather than '" ++ got ++ "'."
| (target, expected, got) <- targets ]
case [ (t, e) | BuildTargetNoSuch t e <- problems ] of
[] -> return ()
targets ->
die $ unlines
[ "Unknown build target '" ++ showUserBuildTarget target
++ "'.\nThere is no "
++ intercalate " or " [ mungeThing thing ++ " '" ++ got ++ "'"
| (thing, got) <- nosuch ] ++ "."
| (target, nosuch) <- targets ]
where
mungeThing "file" = "file target"
mungeThing thing = thing
case [ (t, ts) | BuildTargetAmbiguous t ts <- problems ] of
[] -> return ()
targets ->
die $ unlines
[ "Ambiguous build target '" ++ showUserBuildTarget target
++ "'. It could be:\n "
++ unlines [ " "++ showUserBuildTarget ut ++
" (" ++ showBuildTargetKind bt ++ ")"
| (ut, bt) <- amb ]
| (target, amb) <- targets ]
where
showBuildTargetKind (BuildTargetComponent _ ) = "component"
showBuildTargetKind (BuildTargetModule _ _) = "module"
showBuildTargetKind (BuildTargetFile _ _) = "file"
----------------------------------
-- Top level BuildTarget matcher
-- | 1,647 | false | true | 0 | 20 | 611 | 477 | 239 | 238 | null | null |
ghc-android/ghc | compiler/basicTypes/Name.hs | bsd-3-clause | pprInternal :: PprStyle -> Unique -> OccName -> SDoc
pprInternal sty uniq occ
| codeStyle sty = pprUnique uniq
| debugStyle sty = ppr_occ_name occ <> braces (hsep [pprNameSpaceBrief (occNameSpace occ),
pprUnique uniq])
| dumpStyle sty = ppr_occ_name occ <> ppr_underscore_unique uniq
-- For debug dumps, we're not necessarily dumping
-- tidied code, so we need to print the uniques.
| otherwise = ppr_occ_name occ | 531 | pprInternal :: PprStyle -> Unique -> OccName -> SDoc
pprInternal sty uniq occ
| codeStyle sty = pprUnique uniq
| debugStyle sty = ppr_occ_name occ <> braces (hsep [pprNameSpaceBrief (occNameSpace occ),
pprUnique uniq])
| dumpStyle sty = ppr_occ_name occ <> ppr_underscore_unique uniq
-- For debug dumps, we're not necessarily dumping
-- tidied code, so we need to print the uniques.
| otherwise = ppr_occ_name occ | 531 | pprInternal sty uniq occ
| codeStyle sty = pprUnique uniq
| debugStyle sty = ppr_occ_name occ <> braces (hsep [pprNameSpaceBrief (occNameSpace occ),
pprUnique uniq])
| dumpStyle sty = ppr_occ_name occ <> ppr_underscore_unique uniq
-- For debug dumps, we're not necessarily dumping
-- tidied code, so we need to print the uniques.
| otherwise = ppr_occ_name occ | 478 | false | true | 3 | 12 | 182 | 118 | 56 | 62 | null | null |
fugyk/cabal | Cabal/Distribution/Simple/Register.hs | bsd-3-clause | -- -----------------------------------------------------------------------------
-- Registration
register :: PackageDescription -> LocalBuildInfo
-> RegisterFlags -- ^Install in the user's database?; verbose
-> IO ()
register pkg@PackageDescription { library = Just lib } lbi regFlags
= do
let clbi = getComponentLocalBuildInfo lbi CLibName
absPackageDBs <- absolutePackageDBPaths packageDbs
installedPkgInfo <- generateRegistrationInfo
verbosity pkg lib lbi clbi inplace reloc distPref
(registrationPackageDB absPackageDBs)
when (fromFlag (regPrintId regFlags)) $ do
putStrLn (display (IPI.installedPackageId installedPkgInfo))
let installedPkgInfo' = if (fromFlagOrDefault False $ regHidden regFlags)
then installedPkgInfo {IPI.exposed = False}
else installedPkgInfo
-- Three different modes:
case () of
_ | modeGenerateRegFile -> writeRegistrationFile installedPkgInfo'
| modeGenerateRegScript -> writeRegisterScript installedPkgInfo'
| otherwise -> registerNow installedPkgInfo'
where
registerNow installedPkgInfo = do
registerPackage verbosity installedPkgInfo pkg lbi inplace packageDbs
when (not inplace) $ case regView regFlags of
Flag view -> addPackageToView verbosity (compiler lbi) (withPrograms lbi)
view (IPI.installedPackageId installedPkgInfo)
_ -> return ()
modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags))
regFile = fromMaybe (display (packageId pkg) <.> "conf")
(fromFlag (regGenPkgConf regFlags))
modeGenerateRegScript = fromFlag (regGenScript regFlags)
inplace = fromFlag (regInPlace regFlags)
reloc = relocatable lbi
-- FIXME: there's really no guarantee this will work.
-- registering into a totally different db stack can
-- fail if dependencies cannot be satisfied.
packageDbs = nub $ withPackageDB lbi
++ maybeToList (flagToMaybe (regPackageDB regFlags))
distPref = fromFlag (regDistPref regFlags)
verbosity = fromFlag (regVerbosity regFlags)
writeRegistrationFile installedPkgInfo = do
notice verbosity ("Creating package registration file: " ++ regFile)
writeUTF8File regFile (showInstalledPackageInfo installedPkgInfo)
writeRegisterScript installedPkgInfo =
case compilerFlavor (compiler lbi) of
JHC -> notice verbosity "Registration scripts not needed for jhc"
UHC -> notice verbosity "Registration scripts not needed for uhc"
_ -> withHcPkg
"Registration scripts are not implemented for this compiler"
(compiler lbi) (withPrograms lbi)
(writeHcPkgRegisterScript verbosity installedPkgInfo packageDbs) | 3,012 | register :: PackageDescription -> LocalBuildInfo
-> RegisterFlags -- ^Install in the user's database?; verbose
-> IO ()
register pkg@PackageDescription { library = Just lib } lbi regFlags
= do
let clbi = getComponentLocalBuildInfo lbi CLibName
absPackageDBs <- absolutePackageDBPaths packageDbs
installedPkgInfo <- generateRegistrationInfo
verbosity pkg lib lbi clbi inplace reloc distPref
(registrationPackageDB absPackageDBs)
when (fromFlag (regPrintId regFlags)) $ do
putStrLn (display (IPI.installedPackageId installedPkgInfo))
let installedPkgInfo' = if (fromFlagOrDefault False $ regHidden regFlags)
then installedPkgInfo {IPI.exposed = False}
else installedPkgInfo
-- Three different modes:
case () of
_ | modeGenerateRegFile -> writeRegistrationFile installedPkgInfo'
| modeGenerateRegScript -> writeRegisterScript installedPkgInfo'
| otherwise -> registerNow installedPkgInfo'
where
registerNow installedPkgInfo = do
registerPackage verbosity installedPkgInfo pkg lbi inplace packageDbs
when (not inplace) $ case regView regFlags of
Flag view -> addPackageToView verbosity (compiler lbi) (withPrograms lbi)
view (IPI.installedPackageId installedPkgInfo)
_ -> return ()
modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags))
regFile = fromMaybe (display (packageId pkg) <.> "conf")
(fromFlag (regGenPkgConf regFlags))
modeGenerateRegScript = fromFlag (regGenScript regFlags)
inplace = fromFlag (regInPlace regFlags)
reloc = relocatable lbi
-- FIXME: there's really no guarantee this will work.
-- registering into a totally different db stack can
-- fail if dependencies cannot be satisfied.
packageDbs = nub $ withPackageDB lbi
++ maybeToList (flagToMaybe (regPackageDB regFlags))
distPref = fromFlag (regDistPref regFlags)
verbosity = fromFlag (regVerbosity regFlags)
writeRegistrationFile installedPkgInfo = do
notice verbosity ("Creating package registration file: " ++ regFile)
writeUTF8File regFile (showInstalledPackageInfo installedPkgInfo)
writeRegisterScript installedPkgInfo =
case compilerFlavor (compiler lbi) of
JHC -> notice verbosity "Registration scripts not needed for jhc"
UHC -> notice verbosity "Registration scripts not needed for uhc"
_ -> withHcPkg
"Registration scripts are not implemented for this compiler"
(compiler lbi) (withPrograms lbi)
(writeHcPkgRegisterScript verbosity installedPkgInfo packageDbs) | 2,914 | register pkg@PackageDescription { library = Just lib } lbi regFlags
= do
let clbi = getComponentLocalBuildInfo lbi CLibName
absPackageDBs <- absolutePackageDBPaths packageDbs
installedPkgInfo <- generateRegistrationInfo
verbosity pkg lib lbi clbi inplace reloc distPref
(registrationPackageDB absPackageDBs)
when (fromFlag (regPrintId regFlags)) $ do
putStrLn (display (IPI.installedPackageId installedPkgInfo))
let installedPkgInfo' = if (fromFlagOrDefault False $ regHidden regFlags)
then installedPkgInfo {IPI.exposed = False}
else installedPkgInfo
-- Three different modes:
case () of
_ | modeGenerateRegFile -> writeRegistrationFile installedPkgInfo'
| modeGenerateRegScript -> writeRegisterScript installedPkgInfo'
| otherwise -> registerNow installedPkgInfo'
where
registerNow installedPkgInfo = do
registerPackage verbosity installedPkgInfo pkg lbi inplace packageDbs
when (not inplace) $ case regView regFlags of
Flag view -> addPackageToView verbosity (compiler lbi) (withPrograms lbi)
view (IPI.installedPackageId installedPkgInfo)
_ -> return ()
modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags))
regFile = fromMaybe (display (packageId pkg) <.> "conf")
(fromFlag (regGenPkgConf regFlags))
modeGenerateRegScript = fromFlag (regGenScript regFlags)
inplace = fromFlag (regInPlace regFlags)
reloc = relocatable lbi
-- FIXME: there's really no guarantee this will work.
-- registering into a totally different db stack can
-- fail if dependencies cannot be satisfied.
packageDbs = nub $ withPackageDB lbi
++ maybeToList (flagToMaybe (regPackageDB regFlags))
distPref = fromFlag (regDistPref regFlags)
verbosity = fromFlag (regVerbosity regFlags)
writeRegistrationFile installedPkgInfo = do
notice verbosity ("Creating package registration file: " ++ regFile)
writeUTF8File regFile (showInstalledPackageInfo installedPkgInfo)
writeRegisterScript installedPkgInfo =
case compilerFlavor (compiler lbi) of
JHC -> notice verbosity "Registration scripts not needed for jhc"
UHC -> notice verbosity "Registration scripts not needed for uhc"
_ -> withHcPkg
"Registration scripts are not implemented for this compiler"
(compiler lbi) (withPrograms lbi)
(writeHcPkgRegisterScript verbosity installedPkgInfo packageDbs) | 2,776 | true | true | 10 | 17 | 843 | 615 | 294 | 321 | null | null |
mightymoose/liquidhaskell | benchmarks/llrbtree-0.1.1/Data/Set/WBTree.hs | bsd-3-clause | singleL _ _ _ = error "singleL" | 47 | singleL _ _ _ = error "singleL" | 47 | singleL _ _ _ = error "singleL" | 47 | false | false | 0 | 5 | 22 | 16 | 7 | 9 | null | null |
nomeata/ghc | compiler/cmm/CmmType.hs | bsd-3-clause | narrowS :: Width -> Integer -> Integer
narrowS W8 x = fromIntegral (fromIntegral x :: Int8) | 92 | narrowS :: Width -> Integer -> Integer
narrowS W8 x = fromIntegral (fromIntegral x :: Int8) | 92 | narrowS W8 x = fromIntegral (fromIntegral x :: Int8) | 53 | false | true | 0 | 8 | 16 | 42 | 19 | 23 | null | null |
Altech/haScm | test/Scheme/Evaluator/IOPrimitivesSpec.hs | gpl-3.0 | spec = do
describe "" $ do
it "" $ pending | 49 | spec = do
describe "" $ do
it "" $ pending | 49 | spec = do
describe "" $ do
it "" $ pending | 49 | false | false | 1 | 11 | 17 | 30 | 11 | 19 | null | null |
Prillan/haskell-jsontools | app/jless/Program.hs | bsd-3-clause | zipperToList :: Zipper a -> [a]
zipperToList (Zipper l c r) = reverse l ++ [c] ++ r | 83 | zipperToList :: Zipper a -> [a]
zipperToList (Zipper l c r) = reverse l ++ [c] ++ r | 83 | zipperToList (Zipper l c r) = reverse l ++ [c] ++ r | 51 | false | true | 0 | 7 | 17 | 48 | 24 | 24 | null | null |
phischu/fragnix | builtins/ghc-prim/GHC.Prim.hs | bsd-3-clause | -- | Rounds towards zero element-wise.
quotWord8X32# :: Word8X32# -> Word8X32# -> Word8X32#
quotWord8X32# = quotWord8X32# | 123 | quotWord8X32# :: Word8X32# -> Word8X32# -> Word8X32#
quotWord8X32# = quotWord8X32# | 82 | quotWord8X32# = quotWord8X32# | 29 | true | true | 0 | 8 | 17 | 27 | 12 | 15 | null | null |
A1-Triard/solid | src/Solid/Solver.hs | apache-2.0 | advanceCore :: Double -> Bool -> (Int -> Vector Spring -> Vector TorqueForce) -> System -> System
advanceCore t n forces s =
let steps = ceiling $ (t - time s) / (timeDelta s) in
let s1 = fromMaybe s $ listToMaybe $ drop steps $ iterate (advanceStep n forces) s in
s1 { kineticEnergy = calcKineticEnergy (bodies s1), potentialEnergy = calcPotentialEnergy (springs s1) } | 375 | advanceCore :: Double -> Bool -> (Int -> Vector Spring -> Vector TorqueForce) -> System -> System
advanceCore t n forces s =
let steps = ceiling $ (t - time s) / (timeDelta s) in
let s1 = fromMaybe s $ listToMaybe $ drop steps $ iterate (advanceStep n forces) s in
s1 { kineticEnergy = calcKineticEnergy (bodies s1), potentialEnergy = calcPotentialEnergy (springs s1) } | 375 | advanceCore t n forces s =
let steps = ceiling $ (t - time s) / (timeDelta s) in
let s1 = fromMaybe s $ listToMaybe $ drop steps $ iterate (advanceStep n forces) s in
s1 { kineticEnergy = calcKineticEnergy (bodies s1), potentialEnergy = calcPotentialEnergy (springs s1) } | 277 | false | true | 0 | 14 | 71 | 166 | 80 | 86 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | rankly = id | 11 | rankly = id | 11 | rankly = id | 11 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
rueshyna/gogol | gogol-dataflow/gen/Network/Google/Resource/Dataflow/Projects/Locations/Jobs/Update.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
pljuUploadType :: Lens' ProjectsLocationsJobsUpdate (Maybe Text)
pljuUploadType
= lens _pljuUploadType
(\ s a -> s{_pljuUploadType = a}) | 215 | pljuUploadType :: Lens' ProjectsLocationsJobsUpdate (Maybe Text)
pljuUploadType
= lens _pljuUploadType
(\ s a -> s{_pljuUploadType = a}) | 144 | pljuUploadType
= lens _pljuUploadType
(\ s a -> s{_pljuUploadType = a}) | 79 | true | true | 0 | 9 | 34 | 48 | 25 | 23 | null | null |
mrakgr/futhark | src/Futhark/Representation/AST/Attributes/Ranges.hs | bsd-3-clause | subExpKnownRange :: SubExp -> (KnownBound, KnownBound)
subExpKnownRange (Var v) =
(VarBound v,
VarBound v) | 111 | subExpKnownRange :: SubExp -> (KnownBound, KnownBound)
subExpKnownRange (Var v) =
(VarBound v,
VarBound v) | 111 | subExpKnownRange (Var v) =
(VarBound v,
VarBound v) | 56 | false | true | 0 | 7 | 18 | 42 | 22 | 20 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | slobberingly = id | 17 | slobberingly = id | 17 | slobberingly = id | 17 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
glguy/irc-core | src/Client/Image.hs | isc | -- | Generate a 'Picture' for the current client state. The resulting
-- client state is updated for render specific information like scrolling.
clientPicture :: ClientState -> (Picture, ClientState)
clientPicture st = (pic, st')
where
(row, col, img, st') = clientImage st
pic = Picture
{ picCursor = AbsoluteCursor col (view clientHeight st - row)
, picBackground = ClearBackground
, picLayers = [img]
}
-- | Primary UI render logic | 515 | clientPicture :: ClientState -> (Picture, ClientState)
clientPicture st = (pic, st')
where
(row, col, img, st') = clientImage st
pic = Picture
{ picCursor = AbsoluteCursor col (view clientHeight st - row)
, picBackground = ClearBackground
, picLayers = [img]
}
-- | Primary UI render logic | 370 | clientPicture st = (pic, st')
where
(row, col, img, st') = clientImage st
pic = Picture
{ picCursor = AbsoluteCursor col (view clientHeight st - row)
, picBackground = ClearBackground
, picLayers = [img]
}
-- | Primary UI render logic | 315 | true | true | 1 | 11 | 150 | 102 | 59 | 43 | null | null |
arjunguha/haskell-couchdb | src/Database/CouchDB.hs | bsd-3-clause | getAndUpdateDoc :: (JSON a)
=> DB -- ^database
-> Doc -- ^document name
-> (a -> IO a) -- ^update function
-> CouchMonad (Maybe Rev) -- ^If the update succeeds,
-- return the revision number
-- of the result.
getAndUpdateDoc db docId fn = do
r <- U.getAndUpdateDoc (show db) (show docId) fn
case r of
Nothing -> return Nothing
Just rev -> return $ Just (Rev $ toJSString rev) | 535 | getAndUpdateDoc :: (JSON a)
=> DB -- ^database
-> Doc -- ^document name
-> (a -> IO a) -- ^update function
-> CouchMonad (Maybe Rev)
getAndUpdateDoc db docId fn = do
r <- U.getAndUpdateDoc (show db) (show docId) fn
case r of
Nothing -> return Nothing
Just rev -> return $ Just (Rev $ toJSString rev) | 375 | getAndUpdateDoc db docId fn = do
r <- U.getAndUpdateDoc (show db) (show docId) fn
case r of
Nothing -> return Nothing
Just rev -> return $ Just (Rev $ toJSString rev) | 178 | true | true | 0 | 14 | 229 | 134 | 67 | 67 | null | null |
tonyfloatersu/solution-haskell-craft-of-FP | Queue.hs | mit | isEmptyQ :: Queue a -> Bool
isEmptyQ (Queue [] []) = True | 60 | isEmptyQ :: Queue a -> Bool
isEmptyQ (Queue [] []) = True | 60 | isEmptyQ (Queue [] []) = True | 32 | false | true | 0 | 8 | 14 | 33 | 16 | 17 | null | null |
asivitz/Hickory | Hickory/Graphics/Wavefront.hs | mit | -- Assign a 'color' to each vert, so that no triangle has two of the same color
-- Not so useful in itself, but useful for making barycentric coords
colorObj :: WavefrontOBJ -> Map.HashMap FaceIndex ObjColor
colorObj WavefrontOBJ { objNormals = _, objFaces } = execState (V.mapM (foo . elValue) objFaces) Map.empty
where
foo :: Face -> State (Map.HashMap FaceIndex ObjColor) ()
foo (Face one two three _) = do
setColor one two three
setColor two one three
setColor three one two
setColor :: FaceIndex -> FaceIndex -> FaceIndex -> State (Map.HashMap FaceIndex ObjColor) ()
setColor fi other1 other2 = do
colorOfIndex fi >>= \case
Just _ -> pure ()
Nothing -> do
existing <- traverse colorOfIndex [other1, other2]
let new = head $ [Red, Green, Blue] \\ catMaybes existing
setColorOfIndex fi new
colorOfIndex :: FaceIndex -> State (Map.HashMap FaceIndex ObjColor) (Maybe ObjColor)
colorOfIndex = gets . Map.lookup
setColorOfIndex :: FaceIndex -> ObjColor -> State (Map.HashMap FaceIndex ObjColor) ()
setColorOfIndex k = modify . Map.insert k | 1,110 | colorObj :: WavefrontOBJ -> Map.HashMap FaceIndex ObjColor
colorObj WavefrontOBJ { objNormals = _, objFaces } = execState (V.mapM (foo . elValue) objFaces) Map.empty
where
foo :: Face -> State (Map.HashMap FaceIndex ObjColor) ()
foo (Face one two three _) = do
setColor one two three
setColor two one three
setColor three one two
setColor :: FaceIndex -> FaceIndex -> FaceIndex -> State (Map.HashMap FaceIndex ObjColor) ()
setColor fi other1 other2 = do
colorOfIndex fi >>= \case
Just _ -> pure ()
Nothing -> do
existing <- traverse colorOfIndex [other1, other2]
let new = head $ [Red, Green, Blue] \\ catMaybes existing
setColorOfIndex fi new
colorOfIndex :: FaceIndex -> State (Map.HashMap FaceIndex ObjColor) (Maybe ObjColor)
colorOfIndex = gets . Map.lookup
setColorOfIndex :: FaceIndex -> ObjColor -> State (Map.HashMap FaceIndex ObjColor) ()
setColorOfIndex k = modify . Map.insert k | 961 | colorObj WavefrontOBJ { objNormals = _, objFaces } = execState (V.mapM (foo . elValue) objFaces) Map.empty
where
foo :: Face -> State (Map.HashMap FaceIndex ObjColor) ()
foo (Face one two three _) = do
setColor one two three
setColor two one three
setColor three one two
setColor :: FaceIndex -> FaceIndex -> FaceIndex -> State (Map.HashMap FaceIndex ObjColor) ()
setColor fi other1 other2 = do
colorOfIndex fi >>= \case
Just _ -> pure ()
Nothing -> do
existing <- traverse colorOfIndex [other1, other2]
let new = head $ [Red, Green, Blue] \\ catMaybes existing
setColorOfIndex fi new
colorOfIndex :: FaceIndex -> State (Map.HashMap FaceIndex ObjColor) (Maybe ObjColor)
colorOfIndex = gets . Map.lookup
setColorOfIndex :: FaceIndex -> ObjColor -> State (Map.HashMap FaceIndex ObjColor) ()
setColorOfIndex k = modify . Map.insert k | 902 | true | true | 0 | 18 | 237 | 363 | 177 | 186 | null | null |
ryuichiueda/ProbabilisticRaspiMouse | value_iteration/offline_calculation/state_transition/gen_state_trans.hs | mit | stateId :: (Int,Int,Int) -> String
stateId (y,x,t) = show (t + x*72 + y*72*36) | 78 | stateId :: (Int,Int,Int) -> String
stateId (y,x,t) = show (t + x*72 + y*72*36) | 78 | stateId (y,x,t) = show (t + x*72 + y*72*36) | 43 | false | true | 0 | 11 | 13 | 66 | 35 | 31 | null | null |
johnjcamilleri/maltese-functional-morphology | lib-1.1/General.hs | lgpl-3.0 | -- class operations for parameters
-- THE ESSENTIAL OPERATION: form a table from a function
table :: (Param a) => (a -> Str) -> [(a,Str)]
table f = [(v, f v) | v <- values] | 173 | table :: (Param a) => (a -> Str) -> [(a,Str)]
table f = [(v, f v) | v <- values] | 80 | table f = [(v, f v) | v <- values] | 34 | true | true | 0 | 10 | 35 | 71 | 38 | 33 | null | null |
rwoll-hmc/project | src/Server.hs | mit | handleParsed p = either handleErrors handleCompiled (transpile p) | 65 | handleParsed p = either handleErrors handleCompiled (transpile p) | 65 | handleParsed p = either handleErrors handleCompiled (transpile p) | 65 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
dsalisbury/xmobar | src/Plugins/Monitors/Top.hs | bsd-3-clause | runTopMem :: [String] -> Monitor String
runTopMem _ = do
mis <- io meminfos
pstr <- showMemInfos (sortTop mis)
parseTemplate $ concat pstr | 144 | runTopMem :: [String] -> Monitor String
runTopMem _ = do
mis <- io meminfos
pstr <- showMemInfos (sortTop mis)
parseTemplate $ concat pstr | 144 | runTopMem _ = do
mis <- io meminfos
pstr <- showMemInfos (sortTop mis)
parseTemplate $ concat pstr | 104 | false | true | 0 | 10 | 28 | 60 | 27 | 33 | null | null |
supermario/stack | src/Stack/Types/Config.hs | bsd-3-clause | configMonoidInstallGHCName :: Text
configMonoidInstallGHCName = "install-ghc" | 77 | configMonoidInstallGHCName :: Text
configMonoidInstallGHCName = "install-ghc" | 77 | configMonoidInstallGHCName = "install-ghc" | 42 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
kindohm/Tidal | sync/Canute.hs | gpl-3.0 | onTick :: UDP -> Tempo -> Int -> IO ()
onTick myk current ticks =
do putStr $ "tickmyk " ++ (show ticks) ++ " " ++ (wave ticks) ++ "\r"
hFlush stdout
let m = Message "/sync" [int32 ticks, float ((bps current) * 60)]
forkIO $ do threadDelay $ floor $ 0.075 * 1000000
sendOSC myk m
return () | 329 | onTick :: UDP -> Tempo -> Int -> IO ()
onTick myk current ticks =
do putStr $ "tickmyk " ++ (show ticks) ++ " " ++ (wave ticks) ++ "\r"
hFlush stdout
let m = Message "/sync" [int32 ticks, float ((bps current) * 60)]
forkIO $ do threadDelay $ floor $ 0.075 * 1000000
sendOSC myk m
return () | 329 | onTick myk current ticks =
do putStr $ "tickmyk " ++ (show ticks) ++ " " ++ (wave ticks) ++ "\r"
hFlush stdout
let m = Message "/sync" [int32 ticks, float ((bps current) * 60)]
forkIO $ do threadDelay $ floor $ 0.075 * 1000000
sendOSC myk m
return () | 290 | false | true | 0 | 16 | 99 | 152 | 71 | 81 | null | null |
cshung/MiscLab | Haskell99/q01.hs | mit | myLast :: [a] -> a
myLast y = case myLastTest(y) of Just x -> x
Nothing -> error "Cannot obtain myLast of an empty list" | 154 | myLast :: [a] -> a
myLast y = case myLastTest(y) of Just x -> x
Nothing -> error "Cannot obtain myLast of an empty list" | 154 | myLast y = case myLastTest(y) of Just x -> x
Nothing -> error "Cannot obtain myLast of an empty list" | 135 | false | true | 0 | 8 | 58 | 52 | 25 | 27 | null | null |
tgdavies/codeworld | codeworld-api/src/CodeWorld/Picture.hs | apache-2.0 | -- | A thick sequence of line segments, with given line width and endpoints
thickPath :: HasCallStack => Double -> [Point] -> Picture
thickPath n ps = Path callStack ps n False False | 182 | thickPath :: HasCallStack => Double -> [Point] -> Picture
thickPath n ps = Path callStack ps n False False | 106 | thickPath n ps = Path callStack ps n False False | 48 | true | true | 0 | 8 | 32 | 48 | 23 | 25 | null | null |
adamse/haddock | haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-2-clause | ppr_mono_ty _ (HsNamedWildcardTy name) _ = ppDocName name | 57 | ppr_mono_ty _ (HsNamedWildcardTy name) _ = ppDocName name | 57 | ppr_mono_ty _ (HsNamedWildcardTy name) _ = ppDocName name | 57 | false | false | 2 | 7 | 7 | 25 | 10 | 15 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.