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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
brendanhay/gogol | gogol-bigtableadmin/gen/Network/Google/Resource/BigtableAdmin/Projects/Locations/Get.hs | mpl-2.0 | -- | OAuth access token.
plgAccessToken :: Lens' ProjectsLocationsGet (Maybe Text)
plgAccessToken
= lens _plgAccessToken
(\ s a -> s{_plgAccessToken = a}) | 162 | plgAccessToken :: Lens' ProjectsLocationsGet (Maybe Text)
plgAccessToken
= lens _plgAccessToken
(\ s a -> s{_plgAccessToken = a}) | 137 | plgAccessToken
= lens _plgAccessToken
(\ s a -> s{_plgAccessToken = a}) | 79 | true | true | 0 | 9 | 29 | 48 | 25 | 23 | null | null |
tadeuzagallo/verve-lang | app/Env.hs | mit | -- Public Helpers
runPipeline :: Pipeline a -> Options -> IO ()
runPipeline p options = do
_ <- runPipeline_ (p >> flush >>= printResults True) (initState options)
return () | 178 | runPipeline :: Pipeline a -> Options -> IO ()
runPipeline p options = do
_ <- runPipeline_ (p >> flush >>= printResults True) (initState options)
return () | 159 | runPipeline p options = do
_ <- runPipeline_ (p >> flush >>= printResults True) (initState options)
return () | 113 | true | true | 0 | 11 | 34 | 73 | 34 | 39 | null | null |
lucasfcosta/haskell-experiences | Chapter 5/recursiveness.hs | mit | zip' _ [] = [] | 14 | zip' _ [] = [] | 14 | zip' _ [] = [] | 14 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
silky/csound-expression | src/Csound/Air/Wave.hs | bsd-3-clause | usqr' = unipolar' sqr' | 22 | usqr' = unipolar' sqr' | 22 | usqr' = unipolar' sqr' | 22 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
forked-upstream-packages-for-ghcjs/ghcjs | ghcjs/src/Gen2/Prim.hs | mit | genPrim _ _ MkWeakNoFinalizerOp [r] [o,b] = PrimInline [j| `r` = h$makeWeakNoFinalizer(`o`,`b`); |] | 99 | genPrim _ _ MkWeakNoFinalizerOp [r] [o,b] = PrimInline [j| `r` = h$makeWeakNoFinalizer(`o`,`b`); |] | 99 | genPrim _ _ MkWeakNoFinalizerOp [r] [o,b] = PrimInline [j| `r` = h$makeWeakNoFinalizer(`o`,`b`); |] | 99 | false | false | 0 | 6 | 12 | 33 | 19 | 14 | null | null |
rahulmutt/ghcvm | compiler/Eta/BasicTypes/Name.hs | bsd-3-clause | isVarName :: Name -> Bool
isVarName = isVarOcc . nameOccName | 60 | isVarName :: Name -> Bool
isVarName = isVarOcc . nameOccName | 60 | isVarName = isVarOcc . nameOccName | 34 | false | true | 1 | 7 | 9 | 27 | 11 | 16 | null | null |
forsyde/forsyde-atom | src/ForSyDe/Atom/MoC/DE/React/Lib.hs | bsd-3-clause | comb34 f s1 s2 s3 =
(detect s1 -?- s2 -?- s3 -? (\t -> ctxt34 (fromList3 t) ((),(),(),()) f)
-*- s1 -*- s2 -*- s3 -*<<<) | 126 | comb34 f s1 s2 s3 =
(detect s1 -?- s2 -?- s3 -? (\t -> ctxt34 (fromList3 t) ((),(),(),()) f)
-*- s1 -*- s2 -*- s3 -*<<<) | 126 | comb34 f s1 s2 s3 =
(detect s1 -?- s2 -?- s3 -? (\t -> ctxt34 (fromList3 t) ((),(),(),()) f)
-*- s1 -*- s2 -*- s3 -*<<<) | 126 | false | false | 0 | 14 | 32 | 87 | 46 | 41 | null | null |
lukexi/ghc | testsuite/tests/simplCore/should_compile/spec001.hs | bsd-3-clause | -- | The 'splitWith' function splits a 'PackedString' at a given index.
splitAt :: Int -> PackedString -> (PackedString, PackedString)
splitAt n ps = (take n ps, drop n ps) | 174 | splitAt :: Int -> PackedString -> (PackedString, PackedString)
splitAt n ps = (take n ps, drop n ps) | 102 | splitAt n ps = (take n ps, drop n ps) | 39 | true | true | 0 | 7 | 31 | 47 | 25 | 22 | null | null |
tejon/diagrams-contrib | src/Diagrams/TwoD/Path/Metafont/Internal.hs | bsd-3-clause | copyDirsLoop p = p | 18 | copyDirsLoop p = p | 18 | copyDirsLoop p = p | 18 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
Persi/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | readAnnotationPrefix = do
char '#'
many linewhitespace
string "shellcheck" | 86 | readAnnotationPrefix = do
char '#'
many linewhitespace
string "shellcheck" | 86 | readAnnotationPrefix = do
char '#'
many linewhitespace
string "shellcheck" | 86 | false | false | 0 | 7 | 20 | 24 | 9 | 15 | null | null |
mpkh/Idris-dev | src/IRTS/Bytecode.hs | bsd-3-clause | isConst (SConCase _ _ _ _ _ : xs) = False | 41 | isConst (SConCase _ _ _ _ _ : xs) = False | 41 | isConst (SConCase _ _ _ _ _ : xs) = False | 41 | false | false | 0 | 8 | 10 | 27 | 13 | 14 | null | null |
ExNexu/Idris-dev | src/Idris/ParseHelpers.hs | bsd-3-clause | fixErrorMsg :: String -> [String] -> String
fixErrorMsg msg fixes = msg ++ ", possible fixes:\n" ++ (concat $ intersperse "\n\nor\n\n" fixes) | 141 | fixErrorMsg :: String -> [String] -> String
fixErrorMsg msg fixes = msg ++ ", possible fixes:\n" ++ (concat $ intersperse "\n\nor\n\n" fixes) | 141 | fixErrorMsg msg fixes = msg ++ ", possible fixes:\n" ++ (concat $ intersperse "\n\nor\n\n" fixes) | 97 | false | true | 0 | 9 | 21 | 53 | 25 | 28 | null | null |
JohnLato/iterx | src/IterX/Parser.hs | bsd-3-clause | matchElem :: (MonoFoldableMonoid s, IsSequence s, Monad m, Eq (Element s))
=> Element s -> IterX s m (Element s)
matchElem = pElem . (==) | 142 | matchElem :: (MonoFoldableMonoid s, IsSequence s, Monad m, Eq (Element s))
=> Element s -> IterX s m (Element s)
matchElem = pElem . (==) | 142 | matchElem = pElem . (==) | 24 | false | true | 0 | 9 | 29 | 70 | 36 | 34 | null | null |
Ketouem/learn-you-a-haskell | src/chapter-2-believe-the-type/types.hs | unlicense | circumference' :: Double -> Double
circumference' r = 2 * pi * r | 66 | circumference' :: Double -> Double
circumference' r = 2 * pi * r | 64 | circumference' r = 2 * pi * r | 29 | false | true | 0 | 6 | 14 | 26 | 13 | 13 | null | null |
michaeljklein/HCy2C | Cycles/Reap.hs | mit | onlyJust Nothing = error "Input a ByteString without a proper number result into Cycles.Reap.processResult." | 108 | onlyJust Nothing = error "Input a ByteString without a proper number result into Cycles.Reap.processResult." | 108 | onlyJust Nothing = error "Input a ByteString without a proper number result into Cycles.Reap.processResult." | 108 | false | false | 1 | 5 | 13 | 16 | 5 | 11 | null | null |
forsyde/forsyde-shallow | src/ForSyDe/Shallow/MoC/SADF.hs | bsd-3-clause | outputFSM4 g (s:-ss)
| length y1 /= p1
|| length y2 /= p2
|| length y3 /= p3
|| length y4 /= p4 = error "outputFSM4: Incorrect number of produced tokens."
| otherwise = (signal y1 +-+ yr1, signal y2 +-+ yr2, signal y3 +-+ yr3, signal y4 +-+ yr4)
where ((p1, p2, p3, p4), (y1, y2, y3, y4)) = g s
... | 359 | outputFSM4 g (s:-ss)
| length y1 /= p1
|| length y2 /= p2
|| length y3 /= p3
|| length y4 /= p4 = error "outputFSM4: Incorrect number of produced tokens."
| otherwise = (signal y1 +-+ yr1, signal y2 +-+ yr2, signal y3 +-+ yr3, signal y4 +-+ yr4)
where ((p1, p2, p3, p4), (y1, y2, y3, y4)) = g s
... | 359 | outputFSM4 g (s:-ss)
| length y1 /= p1
|| length y2 /= p2
|| length y3 /= p3
|| length y4 /= p4 = error "outputFSM4: Incorrect number of produced tokens."
| otherwise = (signal y1 +-+ yr1, signal y2 +-+ yr2, signal y3 +-+ yr3, signal y4 +-+ yr4)
where ((p1, p2, p3, p4), (y1, y2, y3, y4)) = g s
... | 359 | false | false | 0 | 15 | 95 | 185 | 93 | 92 | null | null |
scslab/appdeploy | src/appcontroller.hs | bsd-3-clause | foreverOrEOF :: Handle -> Controller () -> Controller ()
foreverOrEOF h act = do
eof <- liftIO $ hIsEOF h
if eof then
return ()
else do
act
foreverOrEOF h act
-- return a hashtable with deployerId's and deployers from the backup file | 270 | foreverOrEOF :: Handle -> Controller () -> Controller ()
foreverOrEOF h act = do
eof <- liftIO $ hIsEOF h
if eof then
return ()
else do
act
foreverOrEOF h act
-- return a hashtable with deployerId's and deployers from the backup file | 270 | foreverOrEOF h act = do
eof <- liftIO $ hIsEOF h
if eof then
return ()
else do
act
foreverOrEOF h act
-- return a hashtable with deployerId's and deployers from the backup file | 213 | false | true | 0 | 11 | 79 | 81 | 36 | 45 | null | null |
gspia/reflex-dom-htmlea | lib/src/Reflex/Dom/HTML5/Attrs/Attrs.hs | bsd-3-clause | mediaPrint = attrSetMedia (Media MQprint) | 46 | mediaPrint = attrSetMedia (Media MQprint) | 46 | mediaPrint = attrSetMedia (Media MQprint) | 46 | false | false | 1 | 7 | 9 | 18 | 7 | 11 | null | null |
mightymoose/liquidhaskell | include/KMeansHelper.hs | bsd-3-clause | groupBy eq (x:xs) = (x:ys) : groupBy eq zs
where (ys,zs) = span (eq x) xs
------------------------------------------------------------------
-- | Partitioning By a Size --------------------------------------
------------------------------------------------------------------
{-@ type PosInt = {v: Int | v > 0 } @-... | 390 | groupBy eq (x:xs) = (x:ys) : groupBy eq zs
where (ys,zs) = span (eq x) xs
------------------------------------------------------------------
-- | Partitioning By a Size --------------------------------------
------------------------------------------------------------------
{-@ type PosInt = {v: Int | v > 0 } @-... | 390 | groupBy eq (x:xs) = (x:ys) : groupBy eq zs
where (ys,zs) = span (eq x) xs
------------------------------------------------------------------
-- | Partitioning By a Size --------------------------------------
------------------------------------------------------------------
{-@ type PosInt = {v: Int | v > 0 } @-... | 390 | false | false | 0 | 7 | 64 | 68 | 35 | 33 | null | null |
simonmar/alex | src/Sort.hs | bsd-3-clause | runs :: (a->a->Bool) -> [a] -> [[a]]
runs (<=) xs0 = foldr op [] xs0
where
op z xss@(xs@(x:_):xss') | z<=x = (z:xs):xss'
| otherwise = [z]:xss
op z xss = [z]:xss | 249 | runs :: (a->a->Bool) -> [a] -> [[a]]
runs (<=) xs0 = foldr op [] xs0
where
op z xss@(xs@(x:_):xss') | z<=x = (z:xs):xss'
| otherwise = [z]:xss
op z xss = [z]:xss | 249 | runs (<=) xs0 = foldr op [] xs0
where
op z xss@(xs@(x:_):xss') | z<=x = (z:xs):xss'
| otherwise = [z]:xss
op z xss = [z]:xss | 212 | false | true | 5 | 14 | 119 | 156 | 76 | 80 | null | null |
dzeban/haskell-exercism | simple-linked-list/LinkedList.hs | mit | datum (Cons a next) = a | 23 | datum (Cons a next) = a | 23 | datum (Cons a next) = a | 23 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
premium-minds/h-queries | HQueries/Queries.hs | lgpl-3.0 | qmapValues :: (QKey k, QType a, QType b) => (Query a -> Query b) -> Query (Map k a) -> Query (Map k b)
qmapValues f m = qListToMap $ qmap (\x -> over _2 f x) $ qMapToList m | 172 | qmapValues :: (QKey k, QType a, QType b) => (Query a -> Query b) -> Query (Map k a) -> Query (Map k b)
qmapValues f m = qListToMap $ qmap (\x -> over _2 f x) $ qMapToList m | 172 | qmapValues f m = qListToMap $ qmap (\x -> over _2 f x) $ qMapToList m | 69 | false | true | 0 | 10 | 39 | 109 | 53 | 56 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/cmm/PprC.hs | bsd-3-clause | pprStatics dflags (CmmStaticLit (CmmInt i W64) : rest)
| wordWidth dflags == W32
= if wORDS_BIGENDIAN dflags
then pprStatics dflags (CmmStaticLit (CmmInt q W32) :
CmmStaticLit (CmmInt r W32) : rest)
else pprStatics dflags (CmmStaticLit (CmmInt r W32) :
... | 411 | pprStatics dflags (CmmStaticLit (CmmInt i W64) : rest)
| wordWidth dflags == W32
= if wORDS_BIGENDIAN dflags
then pprStatics dflags (CmmStaticLit (CmmInt q W32) :
CmmStaticLit (CmmInt r W32) : rest)
else pprStatics dflags (CmmStaticLit (CmmInt r W32) :
... | 411 | pprStatics dflags (CmmStaticLit (CmmInt i W64) : rest)
| wordWidth dflags == W32
= if wORDS_BIGENDIAN dflags
then pprStatics dflags (CmmStaticLit (CmmInt q W32) :
CmmStaticLit (CmmInt r W32) : rest)
else pprStatics dflags (CmmStaticLit (CmmInt r W32) :
... | 411 | false | false | 1 | 13 | 133 | 155 | 74 | 81 | null | null |
felixsch/moonbase-ng | src/Moonbase/Theme.hs | lgpl-2.1 | -- | get the foreground
fg :: Style -> Color
fg (Style c _ _) = c | 65 | fg :: Style -> Color
fg (Style c _ _) = c | 41 | fg (Style c _ _) = c | 20 | true | true | 0 | 7 | 16 | 29 | 15 | 14 | null | null |
michaeljklein/git-details | src/Data/List/Utils.hs | bsd-3-clause | -- | `select` extended to allow not only partitioning, but also keeping some
-- values. See `keepPartition`
keepSelect :: (a -> Bool) -> (a -> Bool) -> a -> ([a], [a], [a]) -> ([a], [a], [a])
keepSelect k p x ~(ks, ts, fs) = if k x
then if p x
... | 599 | keepSelect :: (a -> Bool) -> (a -> Bool) -> a -> ([a], [a], [a]) -> ([a], [a], [a])
keepSelect k p x ~(ks, ts, fs) = if k x
then if p x
then (x:ks, x:ts, fs)
else (x:ks, ts, x:fs)
... | 491 | keepSelect k p x ~(ks, ts, fs) = if k x
then if p x
then (x:ks, x:ts, fs)
else (x:ks, ts, x:fs)
else if p x
then... | 407 | true | true | 0 | 13 | 330 | 198 | 114 | 84 | null | null |
DaMSL/K3 | src/Language/K3/Codegen/Haskell.hs | apache-2.0 | genNotifier :: Identifier -> String -> CodeGeneration HaskellEmbedding
genNotifier n evt = mkTypedDecl n
[ty| Identifier -> (Trigger a, Address) -> E.EngineM String () |]
[hs| \cid (trig, addr) ->
(liftIO $ ishow ()) >>= E.attachNotifier_ cid $(HB.strE evt) . (addr, handle trig,) |] | 297 | genNotifier :: Identifier -> String -> CodeGeneration HaskellEmbedding
genNotifier n evt = mkTypedDecl n
[ty| Identifier -> (Trigger a, Address) -> E.EngineM String () |]
[hs| \cid (trig, addr) ->
(liftIO $ ishow ()) >>= E.attachNotifier_ cid $(HB.strE evt) . (addr, handle trig,) |] | 297 | genNotifier n evt = mkTypedDecl n
[ty| Identifier -> (Trigger a, Address) -> E.EngineM String () |]
[hs| \cid (trig, addr) ->
(liftIO $ ishow ()) >>= E.attachNotifier_ cid $(HB.strE evt) . (addr, handle trig,) |] | 226 | false | true | 0 | 7 | 57 | 44 | 24 | 20 | null | null |
brendanhay/gogol | gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/TestCases/Patch.hs | mpl-2.0 | -- | Multipart request metadata.
platcpPayload :: Lens' ProjectsLocationsAgentsTestCasesPatch GoogleCloudDialogflowCxV3TestCase
platcpPayload
= lens _platcpPayload
(\ s a -> s{_platcpPayload = a}) | 204 | platcpPayload :: Lens' ProjectsLocationsAgentsTestCasesPatch GoogleCloudDialogflowCxV3TestCase
platcpPayload
= lens _platcpPayload
(\ s a -> s{_platcpPayload = a}) | 171 | platcpPayload
= lens _platcpPayload
(\ s a -> s{_platcpPayload = a}) | 76 | true | true | 0 | 9 | 28 | 42 | 22 | 20 | null | null |
graninas/Haskell-Algorithms | Tests/TextRatio.hs | gpl-3.0 | main = do
--let testText = "ABC2@#%#$^#$&f"
fileCont <- readFile "text.txt"
let (letters, total) = lettersCount fileCont
putStrLn $ "Letters count: " ++ show letters
putStrLn $ "Total count: " ++ show total
putStrLn $ "Ratio = " ++ (show $ divide letters total)
putStrLn "Ok." | 304 | main = do
--let testText = "ABC2@#%#$^#$&f"
fileCont <- readFile "text.txt"
let (letters, total) = lettersCount fileCont
putStrLn $ "Letters count: " ++ show letters
putStrLn $ "Total count: " ++ show total
putStrLn $ "Ratio = " ++ (show $ divide letters total)
putStrLn "Ok." | 304 | main = do
--let testText = "ABC2@#%#$^#$&f"
fileCont <- readFile "text.txt"
let (letters, total) = lettersCount fileCont
putStrLn $ "Letters count: " ++ show letters
putStrLn $ "Total count: " ++ show total
putStrLn $ "Ratio = " ++ (show $ divide letters total)
putStrLn "Ok." | 304 | false | false | 0 | 10 | 73 | 93 | 42 | 51 | null | null |
haskoin/haskoin | test/Haskoin/AddressSpec.hs | unlicense | testBase58ChkInvalidVector :: (Text, Maybe Text) -> Assertion
testBase58ChkInvalidVector (a, resM) =
assertEqual
"decodeBase58Check invalid match"
resM
(encodeHex <$> decodeBase58Check a) | 215 | testBase58ChkInvalidVector :: (Text, Maybe Text) -> Assertion
testBase58ChkInvalidVector (a, resM) =
assertEqual
"decodeBase58Check invalid match"
resM
(encodeHex <$> decodeBase58Check a) | 215 | testBase58ChkInvalidVector (a, resM) =
assertEqual
"decodeBase58Check invalid match"
resM
(encodeHex <$> decodeBase58Check a) | 153 | false | true | 0 | 8 | 47 | 50 | 26 | 24 | null | null |
uduki/hsQt | Qtc/Gui/QPainterPath.hs | bsd-2-clause | currentPosition :: QPainterPath a -> (()) -> IO (PointF)
currentPosition x0 ()
= withPointFResult $ \cpointf_ret_x cpointf_ret_y ->
withObjectPtr x0 $ \cobj_x0 ->
qtc_QPainterPath_currentPosition_qth cobj_x0 cpointf_ret_x cpointf_ret_y | 245 | currentPosition :: QPainterPath a -> (()) -> IO (PointF)
currentPosition x0 ()
= withPointFResult $ \cpointf_ret_x cpointf_ret_y ->
withObjectPtr x0 $ \cobj_x0 ->
qtc_QPainterPath_currentPosition_qth cobj_x0 cpointf_ret_x cpointf_ret_y | 245 | currentPosition x0 ()
= withPointFResult $ \cpointf_ret_x cpointf_ret_y ->
withObjectPtr x0 $ \cobj_x0 ->
qtc_QPainterPath_currentPosition_qth cobj_x0 cpointf_ret_x cpointf_ret_y | 188 | false | true | 0 | 9 | 36 | 70 | 35 | 35 | null | null |
ulricha/dsh | src/Database/DSH/CL/Opt/LetFloating.hs | bsd-3-clause | letElem [] _ _ = Nothing | 51 | letElem [] _ _ = Nothing | 51 | letElem [] _ _ = Nothing | 51 | false | false | 1 | 6 | 32 | 18 | 7 | 11 | null | null |
arnizamani/OccamStar | ArithmeticAgentOld.hs | gpl-2.0 | 1 + 9 = 10 | 10 | 1 + 9 = 10 | 10 | 1 + 9 = 10 | 10 | false | false | 2 | 5 | 4 | 13 | 5 | 8 | null | null |
bwhmather/sudoku-solver | src/Sudoku.hs | bsd-3-clause | -- | Get the value of the grid cell at c
cell :: Grid c -> Coord -> c
cell (Grid a) = (!) a | 91 | cell :: Grid c -> Coord -> c
cell (Grid a) = (!) a | 50 | cell (Grid a) = (!) a | 21 | true | true | 0 | 10 | 24 | 43 | 20 | 23 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/coreSyn/CoreUtils.hs | bsd-3-clause | exprIsCheap' _ (Var _) = True | 41 | exprIsCheap' _ (Var _) = True | 41 | exprIsCheap' _ (Var _) = True | 41 | false | false | 0 | 7 | 17 | 17 | 8 | 9 | null | null |
GaloisInc/ivory | ivory/src/Ivory/Language/Syntax/Concrete/QQ/Common.hs | bsd-3-clause | runToQ :: QStM a b -> Q (b, [a])
runToQ m = do
(r, st) <- M.runStateT mempty (unQStM m)
return (r, D.toList st) | 115 | runToQ :: QStM a b -> Q (b, [a])
runToQ m = do
(r, st) <- M.runStateT mempty (unQStM m)
return (r, D.toList st) | 115 | runToQ m = do
(r, st) <- M.runStateT mempty (unQStM m)
return (r, D.toList st) | 82 | false | true | 0 | 11 | 27 | 83 | 40 | 43 | null | null |
keithodulaigh/Hets | Comorphisms/HolLight2Isabelle.hs | gpl-2.0 | makeForAll :: IsaSign.Term -> [IsaSign.Term] -> IsaSign.Term -> IsaSign.Term
makeForAll _ [] t = t | 98 | makeForAll :: IsaSign.Term -> [IsaSign.Term] -> IsaSign.Term -> IsaSign.Term
makeForAll _ [] t = t | 98 | makeForAll _ [] t = t | 21 | false | true | 0 | 10 | 14 | 49 | 23 | 26 | null | null |
ben-schulz/Idris-dev | src/Idris/Primitives.hs | bsd-3-clause | bsrem (ITFixed IT16) [B16 x, B16 y]
= Just $ B16 (fromIntegral (fromIntegral x `rem` fromIntegral y :: Int16)) | 114 | bsrem (ITFixed IT16) [B16 x, B16 y]
= Just $ B16 (fromIntegral (fromIntegral x `rem` fromIntegral y :: Int16)) | 114 | bsrem (ITFixed IT16) [B16 x, B16 y]
= Just $ B16 (fromIntegral (fromIntegral x `rem` fromIntegral y :: Int16)) | 114 | false | false | 0 | 11 | 22 | 60 | 30 | 30 | null | null |
olsner/ghc | compiler/ghci/ByteCodeAsm.hs | bsd-3-clause | emit :: Word16 -> [Operand] -> Assembler ()
emit w ops = Emit w ops (return ()) | 79 | emit :: Word16 -> [Operand] -> Assembler ()
emit w ops = Emit w ops (return ()) | 79 | emit w ops = Emit w ops (return ()) | 35 | false | true | 0 | 8 | 16 | 47 | 23 | 24 | null | null |
burz/Feval | FVL/EF.hs | mit | alg Empty = Fx FAST.Empty | 25 | alg Empty = Fx FAST.Empty | 25 | alg Empty = Fx FAST.Empty | 25 | false | false | 0 | 6 | 4 | 15 | 6 | 9 | null | null |
rueshyna/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/RemarketingLists/Get.hs | mpl-2.0 | -- | User profile ID associated with this request.
rlgProFileId :: Lens' RemarketingListsGet Int64
rlgProFileId
= lens _rlgProFileId (\ s a -> s{_rlgProFileId = a})
. _Coerce | 182 | rlgProFileId :: Lens' RemarketingListsGet Int64
rlgProFileId
= lens _rlgProFileId (\ s a -> s{_rlgProFileId = a})
. _Coerce | 131 | rlgProFileId
= lens _rlgProFileId (\ s a -> s{_rlgProFileId = a})
. _Coerce | 83 | true | true | 0 | 10 | 34 | 46 | 24 | 22 | null | null |
wangbj/leet | q4.hs | bsd-2-clause | medianHelperEven r k n xxs@(x:xs) yys@(y:ys)
| k == n = if x <= y then medianHelperEven x (1+k) n xs yys
else medianHelperEven y (1+k) n xxs ys
| k == 1 + n = fromIntegral (r + min x y) / 2
| x <= y = medianHelperEven r (1+k) n xs yys
| x > y = medianHelperEven r (1+k) n xxs ys | 316 | medianHelperEven r k n xxs@(x:xs) yys@(y:ys)
| k == n = if x <= y then medianHelperEven x (1+k) n xs yys
else medianHelperEven y (1+k) n xxs ys
| k == 1 + n = fromIntegral (r + min x y) / 2
| x <= y = medianHelperEven r (1+k) n xs yys
| x > y = medianHelperEven r (1+k) n xxs ys | 316 | medianHelperEven r k n xxs@(x:xs) yys@(y:ys)
| k == n = if x <= y then medianHelperEven x (1+k) n xs yys
else medianHelperEven y (1+k) n xxs ys
| k == 1 + n = fromIntegral (r + min x y) / 2
| x <= y = medianHelperEven r (1+k) n xs yys
| x > y = medianHelperEven r (1+k) n xxs ys | 316 | false | false | 0 | 10 | 103 | 199 | 99 | 100 | null | null |
adbrowne/dynamodb-eventstore | dynamodb-eventstore-web/web/Main.hs | mit | printEvent
:: (MonadIO m)
=> EventStoreAction -> m EventStoreAction
printEvent a = do
liftIO $ print . tshow $ a
return a | 137 | printEvent
:: (MonadIO m)
=> EventStoreAction -> m EventStoreAction
printEvent a = do
liftIO $ print . tshow $ a
return a | 137 | printEvent a = do
liftIO $ print . tshow $ a
return a | 61 | false | true | 0 | 10 | 37 | 55 | 25 | 30 | null | null |
WSCU/JSEuterpea | Euterpea Examples/Basics.hs | gpl-3.0 | a1 = arp (pitches bmajI) [0,1,2,1,2,3,4,5] [s c0]
| 50 | da1 = arp (pitches bmajI) [0,1,2,1,2,3,4,5] [s c0] | 50 | da1 = arp (pitches bmajI) [0,1,2,1,2,3,4,5] [s c0] | 50 | false | false | 1 | 7 | 8 | 53 | 28 | 25 | null | null |
adizere/nifty-tree | playground/par.hs | mit | ack 0 n = n+1 | 13 | ack 0 n = n+1 | 13 | ack 0 n = n+1 | 13 | false | false | 1 | 6 | 4 | 19 | 7 | 12 | null | null |
shlevy/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | gen_Bounded_binds :: SrcSpan -> TyCon -> (LHsBinds GhcPs, BagDerivStuff)
gen_Bounded_binds loc tycon
| isEnumerationTyCon tycon
= (listToBag [ min_bound_enum, max_bound_enum ], emptyBag)
| otherwise
= ASSERT(isSingleton data_cons)
(listToBag [ min_bound_1con, max_bound_1con ], emptyBag)
where
data_con... | 2,873 | gen_Bounded_binds :: SrcSpan -> TyCon -> (LHsBinds GhcPs, BagDerivStuff)
gen_Bounded_binds loc tycon
| isEnumerationTyCon tycon
= (listToBag [ min_bound_enum, max_bound_enum ], emptyBag)
| otherwise
= ASSERT(isSingleton data_cons)
(listToBag [ min_bound_1con, max_bound_1con ], emptyBag)
where
data_con... | 2,873 | gen_Bounded_binds loc tycon
| isEnumerationTyCon tycon
= (listToBag [ min_bound_enum, max_bound_enum ], emptyBag)
| otherwise
= ASSERT(isSingleton data_cons)
(listToBag [ min_bound_1con, max_bound_1con ], emptyBag)
where
data_cons = tyConDataCons tycon
----- enum-flavored: -----------------------... | 2,800 | false | true | 0 | 8 | 821 | 239 | 120 | 119 | null | null |
nevrenato/HetsAlloy | Maude/PreComorphism.hs | gpl-2.0 | qualifyExVarsTerm t = t | 23 | qualifyExVarsTerm t = t | 23 | qualifyExVarsTerm t = t | 23 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
Yuras/tide | src/TokenBuffer.hs | bsd-3-clause | toList :: Token t => TokenBuffer t -> [Either Int t]
toList = concatMap toL . toChunks
where
toL (Parsed tokens) = map Right . Vector.toList $ tokens
toL (Dirty l) = [Left l] | 180 | toList :: Token t => TokenBuffer t -> [Either Int t]
toList = concatMap toL . toChunks
where
toL (Parsed tokens) = map Right . Vector.toList $ tokens
toL (Dirty l) = [Left l] | 180 | toList = concatMap toL . toChunks
where
toL (Parsed tokens) = map Right . Vector.toList $ tokens
toL (Dirty l) = [Left l] | 127 | false | true | 0 | 8 | 39 | 90 | 43 | 47 | null | null |
urbanslug/ghc | libraries/base/Control/Exception/Base.hs | bsd-3-clause | -----------------------------------------------------------------------------
-- Catching exceptions
-- |This is the simplest of the exception-catching functions. It
-- takes a single argument, runs it, and if an exception is raised
-- the \"handler\" is executed, with the value of the exception passed as an
-- argum... | 1,938 | catch :: Exception e
=> IO a -- ^ The computation to run
-> (e -> IO a) -- ^ Handler to invoke if an exception is raised
-> IO a
catch = catchException | 186 | catch = catchException | 22 | true | true | 0 | 10 | 409 | 79 | 57 | 22 | null | null |
ghcjs/ghcjs | src/Gen2/RtsApply.hs | mit | specApply :: Bool -> Int -> Int -> Maybe JExpr
specApply fast n r
| (r,n) == (0,0) = Just (toJExpr . TxtI . T.pack $ ("h$ap_0_0" ++ fastSuff))
| (r,n) == (0,1) = Just (toJExpr . TxtI . T.pack $ ("h$ap_1_0" ++ fastSuff))
| (r,n) `elem` applySpec =
Just (toJExpr . TxtI . T.pack $ ("h$ap_" ++... | 720 | specApply :: Bool -> Int -> Int -> Maybe JExpr
specApply fast n r
| (r,n) == (0,0) = Just (toJExpr . TxtI . T.pack $ ("h$ap_0_0" ++ fastSuff))
| (r,n) == (0,1) = Just (toJExpr . TxtI . T.pack $ ("h$ap_1_0" ++ fastSuff))
| (r,n) `elem` applySpec =
Just (toJExpr . TxtI . T.pack $ ("h$ap_" ++... | 720 | specApply fast n r
| (r,n) == (0,0) = Just (toJExpr . TxtI . T.pack $ ("h$ap_0_0" ++ fastSuff))
| (r,n) == (0,1) = Just (toJExpr . TxtI . T.pack $ ("h$ap_1_0" ++ fastSuff))
| (r,n) `elem` applySpec =
Just (toJExpr . TxtI . T.pack $ ("h$ap_" ++ show n ++ "_" ++ show r ++ fastSuff))
| othe... | 673 | false | true | 2 | 12 | 204 | 245 | 123 | 122 | null | null |
jrraymond/ray-tracer | src/RayTracer.hs | gpl-3.0 | {- ray dir, normal, refraction index, maybe refracted dir
- assumes everything is in air
-}
refract :: Vec3 -> Vec3 -> Float -> Maybe Vec3
refract dir normal nt
| x < 0 = Nothing
| otherwise = Just t
where
n = 1 -- TODO everything is in air
dn = dot dir normal
x = 1 - n * n * (1 - dn * dn) / nt / n... | 434 | refract :: Vec3 -> Vec3 -> Float -> Maybe Vec3
refract dir normal nt
| x < 0 = Nothing
| otherwise = Just t
where
n = 1 -- TODO everything is in air
dn = dot dir normal
x = 1 - n * n * (1 - dn * dn) / nt / nt
y = multiply (subt dir (multiply normal dn)) (n / nt)
t = normalize $ subt y (multipl... | 339 | refract dir normal nt
| x < 0 = Nothing
| otherwise = Just t
where
n = 1 -- TODO everything is in air
dn = dot dir normal
x = 1 - n * n * (1 - dn * dn) / nt / nt
y = multiply (subt dir (multiply normal dn)) (n / nt)
t = normalize $ subt y (multiply normal (sqrt x))
| 292 | true | true | 9 | 9 | 123 | 199 | 88 | 111 | null | null |
pbrandwijk/chronorder | Main.hs | gpl-3.0 | -- The options that are loaded if no option is specified on the command line
defaultOptions :: Options
defaultOptions = Options {
optVersion = False, -- Without a version option specified, display version is False
optHelp = False, -- Without the help option specified, do not print help message
optExtension... | 913 | defaultOptions :: Options
defaultOptions = Options {
optVersion = False, -- Without a version option specified, display version is False
optHelp = False, -- Without the help option specified, do not print help message
optExtension = (\x -> True), -- Without an extension specified any file can be processed
... | 836 | defaultOptions = Options {
optVersion = False, -- Without a version option specified, display version is False
optHelp = False, -- Without the help option specified, do not print help message
optExtension = (\x -> True), -- Without an extension specified any file can be processed
optPath = getCurrentDi... | 810 | true | true | 0 | 8 | 196 | 99 | 68 | 31 | null | null |
kmate/HaRe | old/testing/asPatterns/E2AST.hs | bsd-3-clause | main :: BTree Int
main = buildtree [3, 1, 2] | 46 | main :: BTree Int
main = buildtree [3, 1, 2] | 44 | main = buildtree [3, 1, 2] | 26 | false | true | 0 | 6 | 11 | 26 | 14 | 12 | null | null |
DanielSchuessler/tuple-th | TupleTH.hs | bsd-3-clause | -- | Takes the folding function (but not the seed element) as a quoted expression. See 'mapTuple'' for how this can be useful.
foldrTuple' :: Int -> ExpQ -> ExpQ
foldrTuple' n c = do
z <- newName "_z"
withxs n (\xsp xes -> lamE [varP z, xsp] (foldr (appE2 c) (varE z) xes))
-- | Type of the generated expression... | 359 | foldrTuple' :: Int -> ExpQ -> ExpQ
foldrTuple' n c = do
z <- newName "_z"
withxs n (\xsp xes -> lamE [varP z, xsp] (foldr (appE2 c) (varE z) xes))
-- | Type of the generated expression:
--
-- > (a -> a -> a) -> (a, ..) -> a | 232 | foldrTuple' n c = do
z <- newName "_z"
withxs n (\xsp xes -> lamE [varP z, xsp] (foldr (appE2 c) (varE z) xes))
-- | Type of the generated expression:
--
-- > (a -> a -> a) -> (a, ..) -> a | 197 | true | true | 0 | 15 | 82 | 98 | 48 | 50 | null | null |
marcellussiegburg/autotool | collection/src/Geo/Program/Run.hs | gpl-2.0 | concrete
:: ( RandomGen g, ToDoc g )
=> g
-> Exp Identifier
-> Reporter ( Value Rational g , Trace Rational )
concrete g p = do
evalStateT ( runWriterT (eval std p) ) g | 189 | concrete
:: ( RandomGen g, ToDoc g )
=> g
-> Exp Identifier
-> Reporter ( Value Rational g , Trace Rational )
concrete g p = do
evalStateT ( runWriterT (eval std p) ) g | 189 | concrete g p = do
evalStateT ( runWriterT (eval std p) ) g | 61 | false | true | 0 | 12 | 56 | 86 | 40 | 46 | null | null |
DavidAlphaFox/darcs | src/Darcs/Repository/ApplyPatches.hs | gpl-2.0 | -- | Apply patches, emitting warnings if there are any IO errors
runTolerantly :: TolerantWrapper TolerantIO a -> IO a
runTolerantly = runTIO . runTolerantWrapper | 162 | runTolerantly :: TolerantWrapper TolerantIO a -> IO a
runTolerantly = runTIO . runTolerantWrapper | 97 | runTolerantly = runTIO . runTolerantWrapper | 43 | true | true | 0 | 6 | 24 | 28 | 14 | 14 | null | null |
badp/ganeti | src/Ganeti/OpParams.hs | gpl-2.0 | -- | Cluster-wide default directory for storing shared-file-backed disks.
pClusterSharedFileStorageDir :: Field
pClusterSharedFileStorageDir =
renameField "ClusterSharedFileStorageDir" $
optionalStringField "shared_file_storage_dir" | 236 | pClusterSharedFileStorageDir :: Field
pClusterSharedFileStorageDir =
renameField "ClusterSharedFileStorageDir" $
optionalStringField "shared_file_storage_dir" | 162 | pClusterSharedFileStorageDir =
renameField "ClusterSharedFileStorageDir" $
optionalStringField "shared_file_storage_dir" | 124 | true | true | 0 | 6 | 22 | 22 | 11 | 11 | null | null |
castaway/pandoc | src/Text/Pandoc/Writers/ConTeXt.hs | gpl-2.0 | -- autolink
inlineToConTeXt (Link [Code _ str] (src, tit)) = inlineToConTeXt (Link
[RawInline "context" "\\hyphenatedurl{", Str str, RawInline "context" "}"]
(src, tit)) | 177 | inlineToConTeXt (Link [Code _ str] (src, tit)) = inlineToConTeXt (Link
[RawInline "context" "\\hyphenatedurl{", Str str, RawInline "context" "}"]
(src, tit)) | 165 | inlineToConTeXt (Link [Code _ str] (src, tit)) = inlineToConTeXt (Link
[RawInline "context" "\\hyphenatedurl{", Str str, RawInline "context" "}"]
(src, tit)) | 165 | true | false | 0 | 9 | 29 | 71 | 37 | 34 | null | null |
diku-kmc/repg | src/KMC/Frontend/Commands.hs | mit | simulateBacktrack :: SimulateOptions -> TransducerUnit -> Frontend ExitCode
simulateBacktrack _simOpts tu = do
input <- liftIO $ L.getContents
liftIO . L.putStr =<< foldl1 (>=>) (map runFST (tuTransducers tu)) input
return ExitSuccess
where
runFST t inp =
case runP' (FST.runBacktracking (Mon.mconcat .... | 576 | simulateBacktrack :: SimulateOptions -> TransducerUnit -> Frontend ExitCode
simulateBacktrack _simOpts tu = do
input <- liftIO $ L.getContents
liftIO . L.putStr =<< foldl1 (>=>) (map runFST (tuTransducers tu)) input
return ExitSuccess
where
runFST t inp =
case runP' (FST.runBacktracking (Mon.mconcat .... | 576 | simulateBacktrack _simOpts tu = do
input <- liftIO $ L.getContents
liftIO . L.putStr =<< foldl1 (>=>) (map runFST (tuTransducers tu)) input
return ExitSuccess
where
runFST t inp =
case runP' (FST.runBacktracking (Mon.mconcat . map adjActionSem) t) (0::Int, inp) of
Nothing -> fatal "Reject"
... | 500 | false | true | 0 | 13 | 129 | 198 | 98 | 100 | null | null |
guoy34/ampersand | src/Database/Design/Ampersand/Basics/Auxiliaries.hs | gpl-3.0 | -- first convert each Set to a list, and then the whole Map to a list of tuples
commaEng :: String -> [String] -> String
commaEng str [a,b,c] = a++", "++b++", "++str++" "++c | 174 | commaEng :: String -> [String] -> String
commaEng str [a,b,c] = a++", "++b++", "++str++" "++c | 93 | commaEng str [a,b,c] = a++", "++b++", "++str++" "++c | 52 | true | true | 0 | 10 | 33 | 61 | 33 | 28 | null | null |
egaburov/funstuff | Haskell/sharing/observable1.hs | apache-2.0 | inputer (Var v) = error $ "Var not supported" | 45 | inputer (Var v) = error $ "Var not supported" | 45 | inputer (Var v) = error $ "Var not supported" | 45 | false | false | 0 | 7 | 8 | 19 | 9 | 10 | null | null |
DavidAlphaFox/ghc | libraries/containers/Data/Sequence.hs | bsd-3-clause | initsTree f (Single x) = Single (f (Single x)) | 46 | initsTree f (Single x) = Single (f (Single x)) | 46 | initsTree f (Single x) = Single (f (Single x)) | 46 | false | false | 0 | 8 | 8 | 34 | 15 | 19 | null | null |
Erdwolf/autotool-bonn | src/PL/Roll/Syntax.hs | gpl-2.0 | distributions :: Int -> Int -> [[Int]]
distributions 0 0 = return [] | 68 | distributions :: Int -> Int -> [[Int]]
distributions 0 0 = return [] | 68 | distributions 0 0 = return [] | 29 | false | true | 0 | 8 | 12 | 35 | 18 | 17 | null | null |
keithodulaigh/Hets | DFOL/AS_DFOL.hs | gpl-2.0 | typePrec :: TYPE -> Int
typePrec Sort = sortPrec | 48 | typePrec :: TYPE -> Int
typePrec Sort = sortPrec | 48 | typePrec Sort = sortPrec | 24 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
iblumenfeld/cryptol | src/Cryptol/Parser/NoInclude.hs | bsd-3-clause | includeFailed :: Located FilePath -> NoIncM a
includeFailed path = M (raise [IncludeFailed path]) | 97 | includeFailed :: Located FilePath -> NoIncM a
includeFailed path = M (raise [IncludeFailed path]) | 97 | includeFailed path = M (raise [IncludeFailed path]) | 51 | false | true | 0 | 9 | 13 | 39 | 18 | 21 | null | null |
green-haskell/ghc | compiler/coreSyn/TrieMap.hs | bsd-3-clause | foldTypeMap :: (a -> b -> b) -> b -> TypeMap a -> b
foldTypeMap k z m = foldTM k m z | 84 | foldTypeMap :: (a -> b -> b) -> b -> TypeMap a -> b
foldTypeMap k z m = foldTM k m z | 84 | foldTypeMap k z m = foldTM k m z | 32 | false | true | 0 | 8 | 22 | 51 | 25 | 26 | null | null |
brendanhay/gogol | gogol-bigtableadmin/gen/Network/Google/BigtableAdmin/Types/Product.hs | mpl-2.0 | -- | Output only. \`end_time\` is the time that the backup was finished. The
-- row data in the backup will be no newer than this timestamp.
bEndTime :: Lens' Backup (Maybe UTCTime)
bEndTime
= lens _bEndTime (\ s a -> s{_bEndTime = a}) .
mapping _DateTime | 263 | bEndTime :: Lens' Backup (Maybe UTCTime)
bEndTime
= lens _bEndTime (\ s a -> s{_bEndTime = a}) .
mapping _DateTime | 122 | bEndTime
= lens _bEndTime (\ s a -> s{_bEndTime = a}) .
mapping _DateTime | 81 | true | true | 0 | 10 | 54 | 56 | 29 | 27 | null | null |
mboes/hs-asn1 | data/Data/ASN1/BinaryEncoding/Parse.hs | bsd-3-clause | isEOC :: ASN1Header -> Bool
isEOC (ASN1Header cl t _ _) = cl == Universal && t == 0 | 83 | isEOC :: ASN1Header -> Bool
isEOC (ASN1Header cl t _ _) = cl == Universal && t == 0 | 83 | isEOC (ASN1Header cl t _ _) = cl == Universal && t == 0 | 55 | false | true | 0 | 7 | 18 | 42 | 21 | 21 | null | null |
uduki/hsQt | Qtc/Enums/Opengl/QGL.hs | bsd-2-clause | fNoStereoBuffers :: FormatOptions
fNoStereoBuffers
= ifFormatOptions $ 4194304 | 80 | fNoStereoBuffers :: FormatOptions
fNoStereoBuffers
= ifFormatOptions $ 4194304 | 80 | fNoStereoBuffers
= ifFormatOptions $ 4194304 | 46 | false | true | 0 | 6 | 9 | 18 | 8 | 10 | null | null |
pgj/bead | src/Bead/Persistence/NoSQLDirFile.hs | bsd-3-clause | groupDataDir = joinPath [dataDir, groupDir] | 46 | groupDataDir = joinPath [dataDir, groupDir] | 46 | groupDataDir = joinPath [dataDir, groupDir] | 46 | false | false | 1 | 5 | 7 | 18 | 8 | 10 | null | null |
karamellpelle/grid | designer/source/Game/Values/Fancy.hs | gpl-3.0 | valueRunPathColor :: Color
valueRunPathColor =
Color 0.0 0.04 0.8 1.0 | 74 | valueRunPathColor :: Color
valueRunPathColor =
Color 0.0 0.04 0.8 1.0 | 74 | valueRunPathColor =
Color 0.0 0.04 0.8 1.0 | 47 | false | true | 0 | 5 | 14 | 20 | 10 | 10 | null | null |
urbit/urbit | pkg/hs/urbit-king/lib/Urbit/Vere/Eyre/Serv.hs | mit | retry :: HasLogFunc e => RIO e (Either IOError a) -> RIO e a
retry act = act >>= \case
Right res -> pure res
Left exn -> do
logDbg ctx ("Failed to open ports. Waiting 5s, then trying again.", exn)
threadDelay 5_000_000
retry act
where
ctx = ["EYRE", "SERV", "retry"] | 286 | retry :: HasLogFunc e => RIO e (Either IOError a) -> RIO e a
retry act = act >>= \case
Right res -> pure res
Left exn -> do
logDbg ctx ("Failed to open ports. Waiting 5s, then trying again.", exn)
threadDelay 5_000_000
retry act
where
ctx = ["EYRE", "SERV", "retry"] | 286 | retry act = act >>= \case
Right res -> pure res
Left exn -> do
logDbg ctx ("Failed to open ports. Waiting 5s, then trying again.", exn)
threadDelay 5_000_000
retry act
where
ctx = ["EYRE", "SERV", "retry"] | 225 | false | true | 2 | 9 | 70 | 103 | 53 | 50 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Layout/Decoration.hs | bsd-2-clause | updateDecos :: Shrinker s => s -> Theme -> XMonadFont -> [(OrigWin,DecoWin)] -> X ()
updateDecos s t f = mapM_ $ updateDeco s t f | 129 | updateDecos :: Shrinker s => s -> Theme -> XMonadFont -> [(OrigWin,DecoWin)] -> X ()
updateDecos s t f = mapM_ $ updateDeco s t f | 129 | updateDecos s t f = mapM_ $ updateDeco s t f | 44 | false | true | 2 | 12 | 25 | 71 | 34 | 37 | null | null |
runjak/projectEuler | src/Problem47.hs | mit | explode :: N -> [N]
explode n
| isPrime n = [n]
| otherwise = do
p <- takeWhile (<= root n) primes
let (d, m) = divMod n p
guard $ m == 0
p:explode d | 169 | explode :: N -> [N]
explode n
| isPrime n = [n]
| otherwise = do
p <- takeWhile (<= root n) primes
let (d, m) = divMod n p
guard $ m == 0
p:explode d | 169 | explode n
| isPrime n = [n]
| otherwise = do
p <- takeWhile (<= root n) primes
let (d, m) = divMod n p
guard $ m == 0
p:explode d | 149 | false | true | 1 | 11 | 56 | 102 | 48 | 54 | null | null |
yxm4109/pandoc | src/Text/Pandoc/Readers/HTML.hs | gpl-2.0 | "a" `closes` "a" = True | 23 | "a" `closes` "a" = True | 23 | "a" `closes` "a" = True | 23 | false | false | 0 | 5 | 4 | 18 | 8 | 10 | null | null |
garetht/jsons-to-schema | test/JSONSchema/Draft4/BasicTypeTests.hs | mit | testBasicTypesSingleNumberInstance :: Spec
testBasicTypesSingleNumberInstance =
it "can handle a single instance of a number" $
let j1 = [text| 2.1 |]
expected =
[text|
{"type": "number"}
|]
in testJsonsToSchema [j1] expected | 265 | testBasicTypesSingleNumberInstance :: Spec
testBasicTypesSingleNumberInstance =
it "can handle a single instance of a number" $
let j1 = [text| 2.1 |]
expected =
[text|
{"type": "number"}
|]
in testJsonsToSchema [j1] expected | 265 | testBasicTypesSingleNumberInstance =
it "can handle a single instance of a number" $
let j1 = [text| 2.1 |]
expected =
[text|
{"type": "number"}
|]
in testJsonsToSchema [j1] expected | 222 | false | true | 0 | 9 | 70 | 50 | 29 | 21 | null | null |
NickAger/LearningHaskell | CIS194/HW03.hs | mit | evalE _ (Val intVal) = intVal | 29 | evalE _ (Val intVal) = intVal | 29 | evalE _ (Val intVal) = intVal | 29 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
haroldcarr/juno | z-no-longer-used/src/Hop/Apps/Juno/Repl.hs | bsd-3-clause | main :: IO ()
main = runREPL | 28 | main :: IO ()
main = runREPL | 28 | main = runREPL | 14 | false | true | 0 | 6 | 6 | 16 | 8 | 8 | null | null |
Shimuuar/protobuf | protobuf-grammar/driver.hs | bsd-3-clause | dumpPB :: Show a => ProtobufFile a -> IO ()
dumpPB pb = do
putStrLn (groom pb) | 80 | dumpPB :: Show a => ProtobufFile a -> IO ()
dumpPB pb = do
putStrLn (groom pb) | 80 | dumpPB pb = do
putStrLn (groom pb) | 36 | false | true | 0 | 10 | 18 | 50 | 21 | 29 | null | null |
gleachkr/Carnap | Carnap/src/Carnap/Languages/PurePropositional/Logic/IchikawaJenkins.hs | gpl-3.0 | parseIchikawaJenkinsSLTableaux :: Parsec String u [IchikawaJenkinsSLTableaux]
parseIchikawaJenkinsSLTableaux = do r <- choice (map (try . string) ["&","¬&","~&","-&"
,"/\\","¬/\\","~/\\","-/\\"
... | 2,708 | parseIchikawaJenkinsSLTableaux :: Parsec String u [IchikawaJenkinsSLTableaux]
parseIchikawaJenkinsSLTableaux = do r <- choice (map (try . string) ["&","¬&","~&","-&"
,"/\\","¬/\\","~/\\","-/\\"
... | 2,708 | parseIchikawaJenkinsSLTableaux = do r <- choice (map (try . string) ["&","¬&","~&","-&"
,"/\\","¬/\\","~/\\","-/\\"
,"∨","¬∨","~∨","-∨"
... | 2,630 | false | true | 0 | 15 | 1,703 | 634 | 387 | 247 | null | null |
damoxc/ganeti | src/Ganeti/OpParams.hs | gpl-2.0 | -- | Source directory for import.
pSrcPath :: Field
pSrcPath = optionalNEStringField "src_path" | 95 | pSrcPath :: Field
pSrcPath = optionalNEStringField "src_path" | 61 | pSrcPath = optionalNEStringField "src_path" | 43 | true | true | 0 | 5 | 12 | 15 | 8 | 7 | null | null |
shayan-najd/Haskell-Desugar-Generic | Examples/XMonad/SS_noListComp.hs | bsd-3-clause | renameTag ::
(Eq i) => i -> i -> StackSet i l a s sd -> StackSet i l a s sd
renameTag o n = mapWorkspace rename
where rename w = if tag w == o then w{tag = n} else w | 179 | renameTag ::
(Eq i) => i -> i -> StackSet i l a s sd -> StackSet i l a s sd
renameTag o n = mapWorkspace rename
where rename w = if tag w == o then w{tag = n} else w | 179 | renameTag o n = mapWorkspace rename
where rename w = if tag w == o then w{tag = n} else w | 91 | false | true | 0 | 9 | 56 | 95 | 48 | 47 | null | null |
pairyo/elm-compiler | src/Generate/JavaScript.hs | bsd-3-clause | isBlock :: Code -> Bool
isBlock code =
case code of
JsBlock _ -> True
JsExpr _ -> False | 97 | isBlock :: Code -> Bool
isBlock code =
case code of
JsBlock _ -> True
JsExpr _ -> False | 97 | isBlock code =
case code of
JsBlock _ -> True
JsExpr _ -> False | 73 | false | true | 0 | 8 | 28 | 40 | 19 | 21 | null | null |
psibi/persistent | persistent-sqlite/Database/Sqlite.hs | mit | bindInt :: Statement -> Int -> Int -> IO ()
bindInt statement parameterIndex datum = do
error <- bindIntError statement parameterIndex datum
case error of
ErrorOK -> return ()
_ -> sqlError Nothing "bind int" error | 226 | bindInt :: Statement -> Int -> Int -> IO ()
bindInt statement parameterIndex datum = do
error <- bindIntError statement parameterIndex datum
case error of
ErrorOK -> return ()
_ -> sqlError Nothing "bind int" error | 226 | bindInt statement parameterIndex datum = do
error <- bindIntError statement parameterIndex datum
case error of
ErrorOK -> return ()
_ -> sqlError Nothing "bind int" error | 182 | false | true | 0 | 12 | 47 | 85 | 38 | 47 | null | null |
hpacheco/HAAP | examples/gameworker/li1g147/Bomberman/Engine.hs | mit | --import Debug.Trace
--instance NFData Bomb where
-- rnf = genericRnf
--instance NFData Board where
-- rnf = genericRnf
--instance NFData PStat where
-- rnf = genericRnf
--instance NFData Pos where
-- rnf = genericRnf
--instance NFData PowerUp where
-- rnf = genericRnf
--instance NFData Mapa where
-- ... | 564 | equalsTabs :: String -> String -> Bool
equalsTabs x y = tabx == taby && map words xs == map words ys
where
(tabx,xs) = span (isPrefixOf "#") (mylines x)
(taby,ys) = span (isPrefixOf "#") (mylines y) | 210 | equalsTabs x y = tabx == taby && map words xs == map words ys
where
(tabx,xs) = span (isPrefixOf "#") (mylines x)
(taby,ys) = span (isPrefixOf "#") (mylines y) | 171 | true | true | 0 | 7 | 123 | 125 | 68 | 57 | null | null |
sdiehl/ghc | hadrian/src/Settings/Default.hs | bsd-3-clause | defaultPackages Stage1 = stage1Packages | 39 | defaultPackages Stage1 = stage1Packages | 39 | defaultPackages Stage1 = stage1Packages | 39 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
vedgar/mlr | Haskell/2017K1rj/Z3rj.hs | unlicense | f1 = Application (FuncS 'f' (Just 1)) | 37 | f1 = Application (FuncS 'f' (Just 1)) | 37 | f1 = Application (FuncS 'f' (Just 1)) | 37 | false | false | 1 | 9 | 6 | 26 | 11 | 15 | null | null |
Lykos/Sara | src/lib/Sara/Ast/AstUtils.hs | gpl-3.0 | -- | Powerful internal function to transform a program that is used to build up all the exported functions.
transformProgramInternal :: Monad m => AstTransformer a b c d a' b' c' d' m -> Program a b c d -> m (Program a' b' c' d')
transformProgramInternal transformer (Program decls meta) =
Program
<$> mapM (transf... | 407 | transformProgramInternal :: Monad m => AstTransformer a b c d a' b' c' d' m -> Program a b c d -> m (Program a' b' c' d')
transformProgramInternal transformer (Program decls meta) =
Program
<$> mapM (transformDeclarationInternal transformer) decls
<*> pure (nodeMetaTrans transformer meta) | 299 | transformProgramInternal transformer (Program decls meta) =
Program
<$> mapM (transformDeclarationInternal transformer) decls
<*> pure (nodeMetaTrans transformer meta) | 177 | true | true | 5 | 10 | 73 | 117 | 56 | 61 | null | null |
anammari/pandoc | src/Text/Pandoc/Readers/RST.hs | gpl-2.0 | gridTableFooter :: GenParser Char ParserState [Char]
gridTableFooter = blanklines | 81 | gridTableFooter :: GenParser Char ParserState [Char]
gridTableFooter = blanklines | 81 | gridTableFooter = blanklines | 28 | false | true | 0 | 6 | 8 | 21 | 11 | 10 | null | null |
pjrt/Dot-Linker | test/Test.hs | bsd-3-clause | lineparserTest :: TestTree
lineparserTest =
testCase "should parse a line fine" $
let x = parseOnly lineMapParser "vim_rc: /root/har/.vimrc, /root/har/.config/nvim/init.vim"
expected = Right $ entry "vim_rc" ["/root/har/.vimrc", "/root/har/.config/nvim/init.vim"]
in x @?= expected | 300 | lineparserTest :: TestTree
lineparserTest =
testCase "should parse a line fine" $
let x = parseOnly lineMapParser "vim_rc: /root/har/.vimrc, /root/har/.config/nvim/init.vim"
expected = Right $ entry "vim_rc" ["/root/har/.vimrc", "/root/har/.config/nvim/init.vim"]
in x @?= expected | 300 | lineparserTest =
testCase "should parse a line fine" $
let x = parseOnly lineMapParser "vim_rc: /root/har/.vimrc, /root/har/.config/nvim/init.vim"
expected = Right $ entry "vim_rc" ["/root/har/.vimrc", "/root/har/.config/nvim/init.vim"]
in x @?= expected | 273 | false | true | 0 | 12 | 50 | 58 | 29 | 29 | null | null |
keithodulaigh/Hets | ExtModal/Keywords.hs | gpl-2.0 | tmTransClosS :: String
tmTransClosS = "*" | 41 | tmTransClosS :: String
tmTransClosS = "*" | 41 | tmTransClosS = "*" | 18 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
DanielG/kvm-in-a-box | src/Dnsmasq.hs | agpl-3.0 | unhost [mac, ip, vmn, ttl] = (vmn, readMAC mac, readIP ip) | 58 | unhost [mac, ip, vmn, ttl] = (vmn, readMAC mac, readIP ip) | 58 | unhost [mac, ip, vmn, ttl] = (vmn, readMAC mac, readIP ip) | 58 | false | false | 0 | 6 | 10 | 36 | 20 | 16 | null | null |
christiaanb/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | mzipName = varQual mONAD_ZIP (fsLit "mzip") mzipIdKey | 63 | mzipName = varQual mONAD_ZIP (fsLit "mzip") mzipIdKey | 63 | mzipName = varQual mONAD_ZIP (fsLit "mzip") mzipIdKey | 63 | false | false | 0 | 7 | 16 | 19 | 9 | 10 | null | null |
agentm/project-m36 | src/lib/ProjectM36/Arbitrary.hs | unlicense | -- don't bother with arbitrary relational expressions
arbitrary' constructedAtomType@(ConstructedAtomType tcName tvMap)
--special-casing for Interval type
| isIntervalAtomType constructedAtomType = createArbitraryInterval (intervalSubType constructedAtomType)
| otherwise = do
tcMap <- ask
let maybeTCons = f... | 1,166 | arbitrary' constructedAtomType@(ConstructedAtomType tcName tvMap)
--special-casing for Interval type
| isIntervalAtomType constructedAtomType = createArbitraryInterval (intervalSubType constructedAtomType)
| otherwise = do
tcMap <- ask
let maybeTCons = findTypeConstructor tcName tcMap
let eitherTCons = may... | 1,111 | arbitrary' constructedAtomType@(ConstructedAtomType tcName tvMap)
--special-casing for Interval type
| isIntervalAtomType constructedAtomType = createArbitraryInterval (intervalSubType constructedAtomType)
| otherwise = do
tcMap <- ask
let maybeTCons = findTypeConstructor tcName tcMap
let eitherTCons = may... | 1,111 | true | false | 1 | 27 | 249 | 307 | 138 | 169 | null | null |
ejlilley/AbstractMusic | LilyParse.hs | gpl-3.0 | parseNotes = collapse <$> (many (sorc *> ( (try (singlet <$> parseNoteFrac))
<|> (try parseNoteMult)
<|> (singlet <$> parseNote)) <* sorc)) | 226 | parseNotes = collapse <$> (many (sorc *> ( (try (singlet <$> parseNoteFrac))
<|> (try parseNoteMult)
<|> (singlet <$> parseNote)) <* sorc)) | 226 | parseNotes = collapse <$> (many (sorc *> ( (try (singlet <$> parseNoteFrac))
<|> (try parseNoteMult)
<|> (singlet <$> parseNote)) <* sorc)) | 226 | false | false | 0 | 17 | 107 | 64 | 34 | 30 | null | null |
adzeitor/http-debug | src/Main.hs | mit | mimicApp :: App -> Application
mimicApp app rq respond = do
l <- logEvent app rq
respond $ responseLBS
status200
[("Content-Type", "text/plain")]
(BL.fromStrict (rawBody l)) | 201 | mimicApp :: App -> Application
mimicApp app rq respond = do
l <- logEvent app rq
respond $ responseLBS
status200
[("Content-Type", "text/plain")]
(BL.fromStrict (rawBody l)) | 201 | mimicApp app rq respond = do
l <- logEvent app rq
respond $ responseLBS
status200
[("Content-Type", "text/plain")]
(BL.fromStrict (rawBody l)) | 170 | false | true | 0 | 12 | 52 | 71 | 35 | 36 | null | null |
lynnard/cocos2d-hs | src/Graphics/UI/Cocos2d/Audio.hs | bsd-3-clause | audioEngine_lazyInit :: HoppyP.IO HoppyP.Bool
audioEngine_lazyInit =
HoppyP.fmap (/= 0)
(audioEngine_lazyInit') | 116 | audioEngine_lazyInit :: HoppyP.IO HoppyP.Bool
audioEngine_lazyInit =
HoppyP.fmap (/= 0)
(audioEngine_lazyInit') | 116 | audioEngine_lazyInit =
HoppyP.fmap (/= 0)
(audioEngine_lazyInit') | 69 | false | true | 0 | 6 | 14 | 33 | 17 | 16 | null | null |
topliceanu/learn | haskell/ShortestPath.hs | mit | -- builds new optimal paths given a pair of optimal paths and the next section in the road.
roadStep :: (Path, Path) -> Section -> (Path, Path)
roadStep (pathA, pathB) (Section a b c) = let
priceA = sum $ map snd pathA
priceB = sum $ map snd pathB
forwardPriceToA = priceA + a
crossPriceT... | 629 | roadStep :: (Path, Path) -> Section -> (Path, Path)
roadStep (pathA, pathB) (Section a b c) = let
priceA = sum $ map snd pathA
priceB = sum $ map snd pathB
forwardPriceToA = priceA + a
crossPriceToA = priceA + c + b
forwardPriceToB = priceB + b
crossPriceToB = priceB + c ... | 537 | roadStep (pathA, pathB) (Section a b c) = let
priceA = sum $ map snd pathA
priceB = sum $ map snd pathB
forwardPriceToA = priceA + a
crossPriceToA = priceA + c + b
forwardPriceToB = priceB + b
crossPriceToB = priceB + c + a
pathA' = if forwardPriceToA < crossPrice... | 485 | true | true | 0 | 12 | 170 | 237 | 131 | 106 | null | null |
alexander-at-github/eta | compiler/ETA/Core/TrieMap.hs | bsd-3-clause | xtC env (InstCo c t) f m = m { km_inst = km_inst m |> xtC env c |>> xtT env t f } | 98 | xtC env (InstCo c t) f m = m { km_inst = km_inst m |> xtC env c |>> xtT env t f } | 98 | xtC env (InstCo c t) f m = m { km_inst = km_inst m |> xtC env c |>> xtT env t f } | 98 | false | false | 1 | 10 | 40 | 58 | 26 | 32 | null | null |
music-suite/music-score | src/Music/Time/Split.hs | bsd-3-clause | chunks :: (Transformable a, Splittable a) => Duration -> a -> [a]
chunks d xs = chunks' d xs
where
chunks' d (split d -> (x, xs)) = [x] ++ chunks d xs | 156 | chunks :: (Transformable a, Splittable a) => Duration -> a -> [a]
chunks d xs = chunks' d xs
where
chunks' d (split d -> (x, xs)) = [x] ++ chunks d xs | 156 | chunks d xs = chunks' d xs
where
chunks' d (split d -> (x, xs)) = [x] ++ chunks d xs | 90 | false | true | 0 | 8 | 38 | 87 | 45 | 42 | null | null |
bgamari/dtree | src/Data/DIntMap.hs | bsd-3-clause | getRoot :: (Binary v) => DIntMap v -> IO (MemTree v)
getRoot (DIntMap store) = maybe (error "DIntMap: Empty root") id <$> DS.getRoot store | 138 | getRoot :: (Binary v) => DIntMap v -> IO (MemTree v)
getRoot (DIntMap store) = maybe (error "DIntMap: Empty root") id <$> DS.getRoot store | 138 | getRoot (DIntMap store) = maybe (error "DIntMap: Empty root") id <$> DS.getRoot store | 85 | false | true | 0 | 9 | 23 | 65 | 31 | 34 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.