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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mietek/map-cutter | src/Geometry/LineClipping.hs | mit | _p1LeftTop_p2NotLeftTop' :: (RealFrac a) => Rect a -> Line a -> Point a -> a -> Maybe (Line a)
_p1LeftTop_p2NotLeftTop' r@(R _ _ _ bottom) l@(L _ (P _ p2y)) d leftP
| p2y < bottom = _p1LeftTop_p2Bottom r l d leftP
| otherwise = Just (L (clipLeft r l d leftP) (_p1LeftTop_p2Middle r l d)) | 294 | _p1LeftTop_p2NotLeftTop' :: (RealFrac a) => Rect a -> Line a -> Point a -> a -> Maybe (Line a)
_p1LeftTop_p2NotLeftTop' r@(R _ _ _ bottom) l@(L _ (P _ p2y)) d leftP
| p2y < bottom = _p1LeftTop_p2Bottom r l d leftP
| otherwise = Just (L (clipLeft r l d leftP) (_p1LeftTop_p2Middle r l d)) | 294 | _p1LeftTop_p2NotLeftTop' r@(R _ _ _ bottom) l@(L _ (P _ p2y)) d leftP
| p2y < bottom = _p1LeftTop_p2Bottom r l d leftP
| otherwise = Just (L (clipLeft r l d leftP) (_p1LeftTop_p2Middle r l d)) | 199 | false | true | 1 | 12 | 62 | 156 | 76 | 80 | null | null |
am-/biri-lang | src/Biri/Language/Lexer.hs | mit | constructorToken :: Parser Constructor
constructorToken = (Constructor .) . T.cons <$> satisfy isUpper <*> takeWhile isAlphaNum | 127 | constructorToken :: Parser Constructor
constructorToken = (Constructor .) . T.cons <$> satisfy isUpper <*> takeWhile isAlphaNum | 127 | constructorToken = (Constructor .) . T.cons <$> satisfy isUpper <*> takeWhile isAlphaNum | 88 | false | true | 0 | 8 | 15 | 38 | 19 | 19 | null | null |
matt-keibler/svg-playground | app/Main.hs | bsd-3-clause | dynamicSVGPart :: AnimationConfig -> [Element]
dynamicSVGPart config = animationsToElelemnts (numFrames config) (animatedShapes config) | 135 | dynamicSVGPart :: AnimationConfig -> [Element]
dynamicSVGPart config = animationsToElelemnts (numFrames config) (animatedShapes config) | 135 | dynamicSVGPart config = animationsToElelemnts (numFrames config) (animatedShapes config) | 88 | false | true | 0 | 7 | 12 | 38 | 19 | 19 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Coll/EnumSet.hs | mit | toSeq :: (Eq a, Enum a, S.Sequence s) => Set a -> s a
toSeq (Set w) = foldrBits f S.empty w
where f i z = S.lcons (toEnum i) z | 128 | toSeq :: (Eq a, Enum a, S.Sequence s) => Set a -> s a
toSeq (Set w) = foldrBits f S.empty w
where f i z = S.lcons (toEnum i) z | 128 | toSeq (Set w) = foldrBits f S.empty w
where f i z = S.lcons (toEnum i) z | 74 | false | true | 0 | 7 | 32 | 87 | 42 | 45 | null | null |
daleooo/barrelfish | hake/RuleDefs.hs | mit | --
-- Assemble an assembly language file
--
assemble :: Options -> String -> [ RuleToken ]
assemble opts src =
assembler opts src (objectFilePath opts src) | 159 | assemble :: Options -> String -> [ RuleToken ]
assemble opts src =
assembler opts src (objectFilePath opts src) | 115 | assemble opts src =
assembler opts src (objectFilePath opts src) | 68 | true | true | 0 | 7 | 30 | 45 | 24 | 21 | null | null |
tpsinnem/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | mapCtxt :: (a -> b) -> Ctxt a -> Ctxt b
mapCtxt = fmap . fmap | 61 | mapCtxt :: (a -> b) -> Ctxt a -> Ctxt b
mapCtxt = fmap . fmap | 61 | mapCtxt = fmap . fmap | 21 | false | true | 0 | 7 | 15 | 36 | 18 | 18 | null | null |
sebschrader/programmierung-ss2015 | E02/A4.hs | mit | display (Var a) = [a] | 24 | display (Var a) = [a] | 24 | display (Var a) = [a] | 24 | false | false | 0 | 7 | 7 | 18 | 9 | 9 | null | null |
fpco/ghcjs-from-typescript | src/Main.hs | bsd-3-clause | startModule :: Config -> ModuleName -> M ()
startModule config mn = do
let path = modulePath config mn
exists <- liftIO $ doesFileExist path
unless exists $
appendOutput config mn $ unlines $
[ "module " ++ renderModuleName mn ++ " where"
, "import qualified GHCJS.Types as GHCJS"
, "import qualified GHCJS.Marshal as GHCJS"
, "import qualified Data.Typeable"
, "import GHCJS.FFI.TypeScript"
] ++ extraImports config
modify (over outputModules $ S.insert mn) | 506 | startModule :: Config -> ModuleName -> M ()
startModule config mn = do
let path = modulePath config mn
exists <- liftIO $ doesFileExist path
unless exists $
appendOutput config mn $ unlines $
[ "module " ++ renderModuleName mn ++ " where"
, "import qualified GHCJS.Types as GHCJS"
, "import qualified GHCJS.Marshal as GHCJS"
, "import qualified Data.Typeable"
, "import GHCJS.FFI.TypeScript"
] ++ extraImports config
modify (over outputModules $ S.insert mn) | 506 | startModule config mn = do
let path = modulePath config mn
exists <- liftIO $ doesFileExist path
unless exists $
appendOutput config mn $ unlines $
[ "module " ++ renderModuleName mn ++ " where"
, "import qualified GHCJS.Types as GHCJS"
, "import qualified GHCJS.Marshal as GHCJS"
, "import qualified Data.Typeable"
, "import GHCJS.FFI.TypeScript"
] ++ extraImports config
modify (over outputModules $ S.insert mn) | 462 | false | true | 0 | 13 | 119 | 139 | 64 | 75 | null | null |
jhoxray/muon | src/Quark/Base/Storage.hs | bsd-3-clause | saveCTable :: CTable -- ^ CTable to save
-> FilePath -- ^ System Directory path
-> IO ()
saveCTable table sysDir =
do let meta = createTableMetadata table sysDir
BL.writeFile (sysDir ++ "/metadata") (encode meta) -- saving metadata first
mapM_ proc (rawColumnsMeta meta) -- processing columns
where proc (n, fp) =
do let col = Map.lookup n table
case col of
Just c -> saveGenColumn fp c
Nothing -> return ()
-- | load a CTable previously saved with saveCTable | 621 | saveCTable :: CTable -- ^ CTable to save
-> FilePath -- ^ System Directory path
-> IO ()
saveCTable table sysDir =
do let meta = createTableMetadata table sysDir
BL.writeFile (sysDir ++ "/metadata") (encode meta) -- saving metadata first
mapM_ proc (rawColumnsMeta meta) -- processing columns
where proc (n, fp) =
do let col = Map.lookup n table
case col of
Just c -> saveGenColumn fp c
Nothing -> return ()
-- | load a CTable previously saved with saveCTable | 616 | saveCTable table sysDir =
do let meta = createTableMetadata table sysDir
BL.writeFile (sysDir ++ "/metadata") (encode meta) -- saving metadata first
mapM_ proc (rawColumnsMeta meta) -- processing columns
where proc (n, fp) =
do let col = Map.lookup n table
case col of
Just c -> saveGenColumn fp c
Nothing -> return ()
-- | load a CTable previously saved with saveCTable | 493 | false | true | 0 | 13 | 241 | 149 | 72 | 77 | null | null |
Jefffrey/Kopia | src/Kopia/Filesystem.hs | gpl-3.0 | listDirs :: FilePath -> IO [String]
listDirs p = do
c <- listAll p
filterM (doesDirectoryExist . (p </>)) c | 115 | listDirs :: FilePath -> IO [String]
listDirs p = do
c <- listAll p
filterM (doesDirectoryExist . (p </>)) c | 115 | listDirs p = do
c <- listAll p
filterM (doesDirectoryExist . (p </>)) c | 79 | false | true | 0 | 10 | 27 | 53 | 26 | 27 | null | null |
agrafix/superbuffer | bench/Bench.hs | bsd-3-clause | buildBufChunks :: Int -> Int -> IO BS.ByteString
buildBufChunks steps chunkSize =
BSL.toStrict . BSL.fromChunks <$> (
forM [0..steps] $ \step ->
pure (mkChunk step chunkSize)) | 195 | buildBufChunks :: Int -> Int -> IO BS.ByteString
buildBufChunks steps chunkSize =
BSL.toStrict . BSL.fromChunks <$> (
forM [0..steps] $ \step ->
pure (mkChunk step chunkSize)) | 195 | buildBufChunks steps chunkSize =
BSL.toStrict . BSL.fromChunks <$> (
forM [0..steps] $ \step ->
pure (mkChunk step chunkSize)) | 146 | false | true | 1 | 12 | 45 | 78 | 37 | 41 | null | null |
lukexi/cabal | Cabal/tests/PackageTests/PackageTester.hs | bsd-3-clause | runExe' :: String -> [String] -> TestM Result
runExe' exe_name args = do
dist_dir <- distDir
let exe = dist_dir </> "build" </> exe_name </> exe_name
run Nothing exe args | 182 | runExe' :: String -> [String] -> TestM Result
runExe' exe_name args = do
dist_dir <- distDir
let exe = dist_dir </> "build" </> exe_name </> exe_name
run Nothing exe args | 182 | runExe' exe_name args = do
dist_dir <- distDir
let exe = dist_dir </> "build" </> exe_name </> exe_name
run Nothing exe args | 136 | false | true | 0 | 12 | 41 | 68 | 32 | 36 | null | null |
vikraman/ghc | compiler/coreSyn/TrieMap.hs | bsd-3-clause | fdG k (MultiMap m) = foldTM k m | 31 | fdG k (MultiMap m) = foldTM k m | 31 | fdG k (MultiMap m) = foldTM k m | 31 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
felixsch/moonbase-ng | src/Moonbase/Util/Widget/Chart.hs | lgpl-2.1 | defaultChartConfig :: ChartConfig
defaultChartConfig = ChartConfig
{ chartShowLabels = True
, chartDrawFrame = False
, chartMin = Nothing
, chartMax = Nothing } | 183 | defaultChartConfig :: ChartConfig
defaultChartConfig = ChartConfig
{ chartShowLabels = True
, chartDrawFrame = False
, chartMin = Nothing
, chartMax = Nothing } | 183 | defaultChartConfig = ChartConfig
{ chartShowLabels = True
, chartDrawFrame = False
, chartMin = Nothing
, chartMax = Nothing } | 149 | false | true | 0 | 7 | 45 | 47 | 25 | 22 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_TEXTURE_BINDING_CUBE_MAP_ARRAY :: GLenum
gl_TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A | 86 | gl_TEXTURE_BINDING_CUBE_MAP_ARRAY :: GLenum
gl_TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A | 86 | gl_TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A | 42 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
ComputationWithBoundedResources/tct-core | src/Tct/Core/Main.hs | bsd-3-clause | writeProofFormat :: ProofFormat -> String
writeProofFormat SilentProofFormat = "s" | 83 | writeProofFormat :: ProofFormat -> String
writeProofFormat SilentProofFormat = "s" | 83 | writeProofFormat SilentProofFormat = "s" | 41 | false | true | 0 | 5 | 9 | 18 | 9 | 9 | null | null |
ku-fpg/sunroof-compiler | Language/Sunroof/JS/Canvas.hs | bsd-3-clause | -- | Selects the line join style to use.
-- Possible values are: "bevel", "round", "meter";
lineJoin :: JSSelector JSString
lineJoin = attr "lineJoin" | 152 | lineJoin :: JSSelector JSString
lineJoin = attr "lineJoin" | 58 | lineJoin = attr "lineJoin" | 26 | true | true | 0 | 6 | 25 | 25 | 11 | 14 | null | null |
keera-studios/hsQt | Qtc/Gui/QStyleOptionToolBar.hs | bsd-2-clause | setPositionOfLine :: QStyleOptionToolBar a -> ((ToolBarPosition)) -> IO ()
setPositionOfLine x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QStyleOptionToolBar_setPositionOfLine cobj_x0 (toCLong $ qEnum_toInt x1) | 216 | setPositionOfLine :: QStyleOptionToolBar a -> ((ToolBarPosition)) -> IO ()
setPositionOfLine x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QStyleOptionToolBar_setPositionOfLine cobj_x0 (toCLong $ qEnum_toInt x1) | 216 | setPositionOfLine x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QStyleOptionToolBar_setPositionOfLine cobj_x0 (toCLong $ qEnum_toInt x1) | 141 | false | true | 0 | 10 | 29 | 68 | 34 | 34 | null | null |
jpvillaisaza/slack-web | tests/Web/Slack/PagerSpec.hs | mit | stubbedSendRequest :: FakeStream (Response HistoryRsp) -> a -> IO (Response HistoryRsp)
stubbedSendRequest stream _request = fromJust <$> pull stream | 149 | stubbedSendRequest :: FakeStream (Response HistoryRsp) -> a -> IO (Response HistoryRsp)
stubbedSendRequest stream _request = fromJust <$> pull stream | 149 | stubbedSendRequest stream _request = fromJust <$> pull stream | 61 | false | true | 0 | 9 | 18 | 53 | 24 | 29 | null | null |
eigengrau/hlint | src/Hint/List.hs | bsd-3-clause | usePString _ = Nothing | 22 | usePString _ = Nothing | 22 | usePString _ = Nothing | 22 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
dorchard/camfort | tests/Camfort/Specification/Units/Analysis/ConsistentSpec.hs | apache-2.0 | inconsist3LitMixedReport :: String
inconsist3LitMixedReport = inconsist3LitPolyReport | 85 | inconsist3LitMixedReport :: String
inconsist3LitMixedReport = inconsist3LitPolyReport | 85 | inconsist3LitMixedReport = inconsist3LitPolyReport | 50 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
dmbarbour/awelon | hsrc/AO/AOFile.hs | bsd-3-clause | initAO_PATH :: (MonadIO m) => LoadAO m ()
initAO_PATH =
liftIO getAO_PATH >>= \ p ->
let setP ld = ld { ld_path = p } in
modify setP >>
let eNoPath = "Bad environment variable AO_PATH" in
when (null p) (emitWarning eNoPath) | 244 | initAO_PATH :: (MonadIO m) => LoadAO m ()
initAO_PATH =
liftIO getAO_PATH >>= \ p ->
let setP ld = ld { ld_path = p } in
modify setP >>
let eNoPath = "Bad environment variable AO_PATH" in
when (null p) (emitWarning eNoPath) | 244 | initAO_PATH =
liftIO getAO_PATH >>= \ p ->
let setP ld = ld { ld_path = p } in
modify setP >>
let eNoPath = "Bad environment variable AO_PATH" in
when (null p) (emitWarning eNoPath) | 202 | false | true | 0 | 14 | 63 | 96 | 47 | 49 | null | null |
seanparsons/watcher | src/Main.hs | mpl-2.0 | doorbellSound :: BS.ByteString
doorbellSound = $(FE.embedFile "doorbell.mp3") | 77 | doorbellSound :: BS.ByteString
doorbellSound = $(FE.embedFile "doorbell.mp3") | 77 | doorbellSound = $(FE.embedFile "doorbell.mp3") | 46 | false | true | 0 | 8 | 6 | 22 | 11 | 11 | null | null |
sgillespie/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | pprUserTypeCtxt TypeAppCtxt = text "a type argument" | 58 | pprUserTypeCtxt TypeAppCtxt = text "a type argument" | 58 | pprUserTypeCtxt TypeAppCtxt = text "a type argument" | 58 | false | false | 0 | 5 | 12 | 12 | 5 | 7 | null | null |
JeffHeard/Hieroglyph | Graphics/Rendering/Hieroglyph/Stylesheets.hs | bsd-2-clause | bin p@(Path{}) = binHelper p IsPath | 35 | bin p@(Path{}) = binHelper p IsPath | 35 | bin p@(Path{}) = binHelper p IsPath | 35 | false | false | 0 | 8 | 5 | 24 | 12 | 12 | null | null |
DavidAlphaFox/darcs | src/Darcs/Patch/Annotate.hs | gpl-2.0 | annotate' :: (Apply p, ApplyState p ~ Tree)
=> FL (PatchInfoAnd p) wX wY
-> Annotated
-> Annotated
annotate' NilFL ann = ann | 154 | annotate' :: (Apply p, ApplyState p ~ Tree)
=> FL (PatchInfoAnd p) wX wY
-> Annotated
-> Annotated
annotate' NilFL ann = ann | 154 | annotate' NilFL ann = ann | 25 | false | true | 0 | 10 | 52 | 63 | 29 | 34 | null | null |
brendanhay/gogol | gogol-logging/gen/Network/Google/Resource/Logging/Exclusions/Patch.hs | mpl-2.0 | -- | V1 error format.
epXgafv :: Lens' ExclusionsPatch (Maybe Xgafv)
epXgafv = lens _epXgafv (\ s a -> s{_epXgafv = a}) | 119 | epXgafv :: Lens' ExclusionsPatch (Maybe Xgafv)
epXgafv = lens _epXgafv (\ s a -> s{_epXgafv = a}) | 97 | epXgafv = lens _epXgafv (\ s a -> s{_epXgafv = a}) | 50 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
epsilonhalbe/Sammelsurium | Codingame/ChuckNorris/ChuckNorris.hs | bsd-3-clause | main :: IO ()
main = do input <- group . concatMap (reverse . bitsTo7Bit . ord) <$> getLine ::IO [[Bit]]
let output = concatMap (\x-> [show $ head x, replicate (length x) '0']) input
putStrLn $ unwords output
return () | 248 | main :: IO ()
main = do input <- group . concatMap (reverse . bitsTo7Bit . ord) <$> getLine ::IO [[Bit]]
let output = concatMap (\x-> [show $ head x, replicate (length x) '0']) input
putStrLn $ unwords output
return () | 248 | main = do input <- group . concatMap (reverse . bitsTo7Bit . ord) <$> getLine ::IO [[Bit]]
let output = concatMap (\x-> [show $ head x, replicate (length x) '0']) input
putStrLn $ unwords output
return () | 234 | false | true | 0 | 16 | 70 | 121 | 59 | 62 | null | null |
kojiromike/Idris-dev | src/IRTS/JavaScript/AST.hs | bsd-3-clause | jsStmt2Text (JsError t) = T.concat ["$JSRTS.die(", jsAst2Text t, ");\n"] | 72 | jsStmt2Text (JsError t) = T.concat ["$JSRTS.die(", jsAst2Text t, ");\n"] | 72 | jsStmt2Text (JsError t) = T.concat ["$JSRTS.die(", jsAst2Text t, ");\n"] | 72 | false | false | 0 | 7 | 8 | 32 | 16 | 16 | null | null |
alexander-at-github/eta | compiler/ETA/BasicTypes/PatSyn.hs | bsd-3-clause | patSynType :: PatSyn -> Type
-- The full pattern type, used only in error messages
patSynType (MkPatSyn { psUnivTyVars = univ_tvs, psReqTheta = req_theta
, psExTyVars = ex_tvs, psProvTheta = prov_theta
, psArgs = orig_args, psOrigResTy = orig_res_ty })
= mkSigmaTy univ_tvs req_theta $
mkSigmaTy ex_tvs prov_theta $
mkFunTys orig_args orig_res_ty | 402 | patSynType :: PatSyn -> Type
patSynType (MkPatSyn { psUnivTyVars = univ_tvs, psReqTheta = req_theta
, psExTyVars = ex_tvs, psProvTheta = prov_theta
, psArgs = orig_args, psOrigResTy = orig_res_ty })
= mkSigmaTy univ_tvs req_theta $
mkSigmaTy ex_tvs prov_theta $
mkFunTys orig_args orig_res_ty | 348 | patSynType (MkPatSyn { psUnivTyVars = univ_tvs, psReqTheta = req_theta
, psExTyVars = ex_tvs, psProvTheta = prov_theta
, psArgs = orig_args, psOrigResTy = orig_res_ty })
= mkSigmaTy univ_tvs req_theta $
mkSigmaTy ex_tvs prov_theta $
mkFunTys orig_args orig_res_ty | 319 | true | true | 0 | 9 | 106 | 84 | 47 | 37 | null | null |
ckw/matasano | src/Crypto/Common.hs | mit | hexToAscii' (x:xs) = let h1 = shiftR (x .&. 0xf0) 4
h2 = x .&. 0x0f
in conv h1 : conv h2 : hexToAscii' xs
where conv :: Word8 -> Word8
conv w = case w of
0x0 -> 0x30
0x1 -> 0x31
0x2 -> 0x32
0x3 -> 0x33
0x4 -> 0x34
0x5 -> 0x35
0x6 -> 0x36
0x7 -> 0x37
0x8 -> 0x38
0x9 -> 0x39
0xa -> 0x61
0xb -> 0x62
0xc -> 0x63
0xd -> 0x64
0xe -> 0x65
0xf -> 0x66
_ -> error "impossible1" | 615 | hexToAscii' (x:xs) = let h1 = shiftR (x .&. 0xf0) 4
h2 = x .&. 0x0f
in conv h1 : conv h2 : hexToAscii' xs
where conv :: Word8 -> Word8
conv w = case w of
0x0 -> 0x30
0x1 -> 0x31
0x2 -> 0x32
0x3 -> 0x33
0x4 -> 0x34
0x5 -> 0x35
0x6 -> 0x36
0x7 -> 0x37
0x8 -> 0x38
0x9 -> 0x39
0xa -> 0x61
0xb -> 0x62
0xc -> 0x63
0xd -> 0x64
0xe -> 0x65
0xf -> 0x66
_ -> error "impossible1" | 615 | hexToAscii' (x:xs) = let h1 = shiftR (x .&. 0xf0) 4
h2 = x .&. 0x0f
in conv h1 : conv h2 : hexToAscii' xs
where conv :: Word8 -> Word8
conv w = case w of
0x0 -> 0x30
0x1 -> 0x31
0x2 -> 0x32
0x3 -> 0x33
0x4 -> 0x34
0x5 -> 0x35
0x6 -> 0x36
0x7 -> 0x37
0x8 -> 0x38
0x9 -> 0x39
0xa -> 0x61
0xb -> 0x62
0xc -> 0x63
0xd -> 0x64
0xe -> 0x65
0xf -> 0x66
_ -> error "impossible1" | 615 | false | false | 0 | 11 | 333 | 200 | 96 | 104 | null | null |
codemac/yi-editor | src/Yi/UI/Vty.hs | gpl-2.0 | mkUI :: UI -> Common.UI
mkUI ui = Common.dummyUI
{
Common.main = main ui,
Common.end = end ui,
Common.suspend = raiseSignal sigTSTP,
Common.refresh = refresh ui,
Common.layout = layout ui,
Common.userForceRefresh = userForceRefresh ui
} | 302 | mkUI :: UI -> Common.UI
mkUI ui = Common.dummyUI
{
Common.main = main ui,
Common.end = end ui,
Common.suspend = raiseSignal sigTSTP,
Common.refresh = refresh ui,
Common.layout = layout ui,
Common.userForceRefresh = userForceRefresh ui
} | 302 | mkUI ui = Common.dummyUI
{
Common.main = main ui,
Common.end = end ui,
Common.suspend = raiseSignal sigTSTP,
Common.refresh = refresh ui,
Common.layout = layout ui,
Common.userForceRefresh = userForceRefresh ui
} | 278 | false | true | 0 | 8 | 100 | 99 | 50 | 49 | null | null |
girving/duck | duck/InferMonad.hs | bsd-3-clause | typeError :: (Pretty s, MonadError TypeError m) => SrcLoc -> s -> m a
typeError l m = throwError $ StackMsg [] $ locMsg l m | 123 | typeError :: (Pretty s, MonadError TypeError m) => SrcLoc -> s -> m a
typeError l m = throwError $ StackMsg [] $ locMsg l m | 123 | typeError l m = throwError $ StackMsg [] $ locMsg l m | 53 | false | true | 0 | 8 | 25 | 62 | 30 | 32 | null | null |
shockkolate/containers | tests/map-strictness.hs | bsd-3-clause | pFindWithDefaultKeyStrict :: Int -> Map Int Int -> Bool
pFindWithDefaultKeyStrict def m = isBottom $ M.findWithDefault def bottom m | 131 | pFindWithDefaultKeyStrict :: Int -> Map Int Int -> Bool
pFindWithDefaultKeyStrict def m = isBottom $ M.findWithDefault def bottom m | 131 | pFindWithDefaultKeyStrict def m = isBottom $ M.findWithDefault def bottom m | 75 | false | true | 0 | 8 | 18 | 47 | 21 | 26 | null | null |
adarqui/ToyBox | haskell/haskell/language-extensions/src/TB/Language/Extensions/ViewPatterns.hs | gpl-3.0 | factorial :: Int -> Int
factorial (viewFactorial -> Just n) = n * factorial (n-1) | 81 | factorial :: Int -> Int
factorial (viewFactorial -> Just n) = n * factorial (n-1) | 81 | factorial (viewFactorial -> Just n) = n * factorial (n-1) | 57 | false | true | 0 | 8 | 14 | 42 | 21 | 21 | null | null |
ocramz/petsc-hs | src/Numerical/PETSc/Internal/InlineC.hs | gpl-3.0 | -- PetscErrorCode TaoLineSearchSetInitialStepLength(TaoLineSearch ls,PetscReal s)
taoLineSearchSetInitialStepLength' :: TaoLineSearch -> PetscReal_ -> IO CInt
taoLineSearchSetInitialStepLength' ls s =
[C.exp|int{TaoLineSearchSetInitialStepLength($(TaoLineSearch ls), $(PetscReal s))}|] | 287 | taoLineSearchSetInitialStepLength' :: TaoLineSearch -> PetscReal_ -> IO CInt
taoLineSearchSetInitialStepLength' ls s =
[C.exp|int{TaoLineSearchSetInitialStepLength($(TaoLineSearch ls), $(PetscReal s))}|] | 205 | taoLineSearchSetInitialStepLength' ls s =
[C.exp|int{TaoLineSearchSetInitialStepLength($(TaoLineSearch ls), $(PetscReal s))}|] | 128 | true | true | 0 | 7 | 22 | 34 | 19 | 15 | null | null |
tobiasreinhardt/show | Show/src/Main.hs | apache-2.0 | exitIf :: Bool -> IO a -> IO ()
exitIf b x = when b $ do _ <- x; exitSuccess | 76 | exitIf :: Bool -> IO a -> IO ()
exitIf b x = when b $ do _ <- x; exitSuccess | 76 | exitIf b x = when b $ do _ <- x; exitSuccess | 44 | false | true | 2 | 9 | 20 | 56 | 24 | 32 | null | null |
alexbiehl/hoop | hadoop-protos/src/Hadoop/Protos/ClientNamenodeProtocolProtos/SafeModeActionProto.hs | mit | toMaybe'Enum 3 = Prelude'.Just SAFEMODE_GET | 43 | toMaybe'Enum 3 = Prelude'.Just SAFEMODE_GET | 43 | toMaybe'Enum 3 = Prelude'.Just SAFEMODE_GET | 43 | false | false | 0 | 6 | 4 | 14 | 6 | 8 | null | null |
benkolera/haskell-hubbub | test/Network/Hubbub/Http/Test.hs | mit | runDistributeResource ::
Maybe Secret ->
ContentType ->
ResourceBody ->
IO ()
runDistributeResource sec ct rb = do
e <- runEitherT (distributeResource (distributionEvent sec ct rb) localHub)
assertRight e | 217 | runDistributeResource ::
Maybe Secret ->
ContentType ->
ResourceBody ->
IO ()
runDistributeResource sec ct rb = do
e <- runEitherT (distributeResource (distributionEvent sec ct rb) localHub)
assertRight e | 217 | runDistributeResource sec ct rb = do
e <- runEitherT (distributeResource (distributionEvent sec ct rb) localHub)
assertRight e | 130 | false | true | 0 | 12 | 40 | 72 | 33 | 39 | null | null |
expipiplus1/vulkan | src/Vulkan/Extensions/VK_KHR_bind_memory2.hs | bsd-3-clause | -- No documentation found for TopLevel "vkBindBufferMemory2KHR"
bindBufferMemory2KHR = bindBufferMemory2 | 104 | bindBufferMemory2KHR = bindBufferMemory2 | 40 | bindBufferMemory2KHR = bindBufferMemory2 | 40 | true | false | 0 | 4 | 9 | 7 | 4 | 3 | null | null |
mlite/hLLVM | src/Llvm/Asm/Simplification.hs | bsd-3-clause | getFp :: MS String
getFp = do { MyState{..} <- S.get
; return _renaming
} | 95 | getFp :: MS String
getFp = do { MyState{..} <- S.get
; return _renaming
} | 95 | getFp = do { MyState{..} <- S.get
; return _renaming
} | 76 | false | true | 0 | 10 | 36 | 44 | 20 | 24 | null | null |
rueshyna/gogol | gogol-maps-engine/gen/Network/Google/Resource/MapsEngine/Maps/List.hs | mpl-2.0 | -- | An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
-- Returned assets will have been modified at or before this time.
mlModifiedBefore :: Lens' MapsList (Maybe UTCTime)
mlModifiedBefore
= lens _mlModifiedBefore
(\ s a -> s{_mlModifiedBefore = a})
. mapping _DateTime | 301 | mlModifiedBefore :: Lens' MapsList (Maybe UTCTime)
mlModifiedBefore
= lens _mlModifiedBefore
(\ s a -> s{_mlModifiedBefore = a})
. mapping _DateTime | 162 | mlModifiedBefore
= lens _mlModifiedBefore
(\ s a -> s{_mlModifiedBefore = a})
. mapping _DateTime | 111 | true | true | 2 | 8 | 55 | 60 | 29 | 31 | null | null |
cartazio/arithmoi | Math/NumberTheory/Primes/Factorisation/Montgomery.hs | mit | factorise n' = map (first fromIntegral) sfs <> map (first fromInteger) rest
where
n = abs n'
(sfs, mb) = smallFactors (fromIntegral n)
sg = mkStdGen (fromIntegral n `xor` 0xdeadbeef)
rest = case mb of
Nothing -> []
Just m -> stdGenFactorisation (Just $ 65536 * 65536) sg Nothing (toInteger m)
----------------------------------------------------------------------------------------------------
-- Factorisation wrappers --
----------------------------------------------------------------------------------------------------
-- | A wrapper around 'curveFactorisation' providing a few default arguments.
-- The primality test is 'bailliePSW', the @prng@ function - naturally -
-- 'randomR'. This function also requires small prime factors to have been
-- stripped before. | 880 | factorise n' = map (first fromIntegral) sfs <> map (first fromInteger) rest
where
n = abs n'
(sfs, mb) = smallFactors (fromIntegral n)
sg = mkStdGen (fromIntegral n `xor` 0xdeadbeef)
rest = case mb of
Nothing -> []
Just m -> stdGenFactorisation (Just $ 65536 * 65536) sg Nothing (toInteger m)
----------------------------------------------------------------------------------------------------
-- Factorisation wrappers --
----------------------------------------------------------------------------------------------------
-- | A wrapper around 'curveFactorisation' providing a few default arguments.
-- The primality test is 'bailliePSW', the @prng@ function - naturally -
-- 'randomR'. This function also requires small prime factors to have been
-- stripped before. | 880 | factorise n' = map (first fromIntegral) sfs <> map (first fromInteger) rest
where
n = abs n'
(sfs, mb) = smallFactors (fromIntegral n)
sg = mkStdGen (fromIntegral n `xor` 0xdeadbeef)
rest = case mb of
Nothing -> []
Just m -> stdGenFactorisation (Just $ 65536 * 65536) sg Nothing (toInteger m)
----------------------------------------------------------------------------------------------------
-- Factorisation wrappers --
----------------------------------------------------------------------------------------------------
-- | A wrapper around 'curveFactorisation' providing a few default arguments.
-- The primality test is 'bailliePSW', the @prng@ function - naturally -
-- 'randomR'. This function also requires small prime factors to have been
-- stripped before. | 880 | false | false | 4 | 11 | 205 | 159 | 76 | 83 | null | null |
rcdickerson/bk-tree | BKTree.hs | mit | mkBkTree :: (Metric a) -> (BKTree a)
mkBkTree metric = BKTree metric Empty | 75 | mkBkTree :: (Metric a) -> (BKTree a)
mkBkTree metric = BKTree metric Empty | 74 | mkBkTree metric = BKTree metric Empty | 37 | false | true | 0 | 9 | 13 | 40 | 18 | 22 | null | null |
chreekat/snowdrift | Model/Notification/Internal.hs | agpl-3.0 | showProjectNotificationType NotifBlogPost = "New blog post" | 68 | showProjectNotificationType NotifBlogPost = "New blog post" | 68 | showProjectNotificationType NotifBlogPost = "New blog post" | 68 | false | false | 0 | 5 | 14 | 9 | 4 | 5 | null | null |
tpsinnem/Idris-dev | src/IRTS/Lang.hs | bsd-3-clause | usedIn env _ = [] | 17 | usedIn env _ = [] | 17 | usedIn env _ = [] | 17 | false | false | 0 | 5 | 4 | 13 | 6 | 7 | null | null |
markflorisson/hpack | testrepo/bytestring-0.10.2.0/tests/builder/Data/ByteString/Builder/Prim/Tests.hs | bsd-3-clause | unZigZagInt8 :: Int8 -> Int8
unZigZagInt8 = (fromIntegral :: Word8 -> Int8) . unZigZag . fromIntegral | 101 | unZigZagInt8 :: Int8 -> Int8
unZigZagInt8 = (fromIntegral :: Word8 -> Int8) . unZigZag . fromIntegral | 101 | unZigZagInt8 = (fromIntegral :: Word8 -> Int8) . unZigZag . fromIntegral | 72 | false | true | 0 | 8 | 15 | 40 | 19 | 21 | null | null |
mohsen3/csv-conduit | src/Data/CSV/Conduit/Parser/ByteString.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- | Try to parse given string as CSV
parseCSV :: CSVSettings -> ByteString -> Either String [Row ByteString]
parseCSV s = parseOnly $ csv s | 219 | parseCSV :: CSVSettings -> ByteString -> Either String [Row ByteString]
parseCSV s = parseOnly $ csv s | 102 | parseCSV s = parseOnly $ csv s | 30 | true | true | 0 | 9 | 26 | 42 | 21 | 21 | null | null |
gentoo-haskell/hackport | Portage/EBuild.hs | gpl-3.0 | toHttps :: String -> String
toHttps x =
case parseURI x of
Just uri -> if uriScheme uri == "http:" &&
(uriRegName <$> uriAuthority uri)
`notElem`
httpOnlyHomepages
then replace "http" "https" x
else x
Nothing -> x
where
replace old new = L.intercalate new . LS.splitOn old
-- add to this list with any non https-aware websites
httpOnlyHomepages = Just <$> [ "leksah.org"
, "darcs.net"
, "khumba.net"
]
-- | Sort IUSE alphabetically
--
-- >>> sort_iuse ["+a","b"]
-- ["+a","b"] | 689 | toHttps :: String -> String
toHttps x =
case parseURI x of
Just uri -> if uriScheme uri == "http:" &&
(uriRegName <$> uriAuthority uri)
`notElem`
httpOnlyHomepages
then replace "http" "https" x
else x
Nothing -> x
where
replace old new = L.intercalate new . LS.splitOn old
-- add to this list with any non https-aware websites
httpOnlyHomepages = Just <$> [ "leksah.org"
, "darcs.net"
, "khumba.net"
]
-- | Sort IUSE alphabetically
--
-- >>> sort_iuse ["+a","b"]
-- ["+a","b"] | 689 | toHttps x =
case parseURI x of
Just uri -> if uriScheme uri == "http:" &&
(uriRegName <$> uriAuthority uri)
`notElem`
httpOnlyHomepages
then replace "http" "https" x
else x
Nothing -> x
where
replace old new = L.intercalate new . LS.splitOn old
-- add to this list with any non https-aware websites
httpOnlyHomepages = Just <$> [ "leksah.org"
, "darcs.net"
, "khumba.net"
]
-- | Sort IUSE alphabetically
--
-- >>> sort_iuse ["+a","b"]
-- ["+a","b"] | 661 | false | true | 2 | 13 | 292 | 144 | 70 | 74 | null | null |
massysett/prednote | tests/Prednote/Core/Properties.hs | bsd-3-clause | prop_true = testInt true | 24 | prop_true = testInt true | 24 | prop_true = testInt true | 24 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
suhailshergill/liboleg | Language/TEval/TInfLetP.hs | bsd-3-clause | -- TypS [4] (TV 4 :> TInt), polymorhic
testl77 = teval env0 $ Let ("x",(L "y" (I 10)))
(Let ("y",vx) ((vy `A` (I 1)) :+
(vy `A` (L "x" vx)))) | 210 | testl77 = teval env0 $ Let ("x",(L "y" (I 10)))
(Let ("y",vx) ((vy `A` (I 1)) :+
(vy `A` (L "x" vx)))) | 171 | testl77 = teval env0 $ Let ("x",(L "y" (I 10)))
(Let ("y",vx) ((vy `A` (I 1)) :+
(vy `A` (L "x" vx)))) | 171 | true | false | 0 | 14 | 98 | 92 | 51 | 41 | null | null |
thomie/vector | Data/Vector/Mutable.hs | bsd-3-clause | moveForwardsLargeOverlap :: PrimMonad m => MutableArray (PrimState m) a -> Int -> Int -> Int -> m ()
moveForwardsLargeOverlap !arr !dstOff !srcOff !len =
INTERNAL_CHECK(check) "moveForwardsLargeOverlap" "not a forward move" (dstOff > srcOff)
$ do
queue <- newArray nonOverlap uninitialised
loopM nonOverlap $ \ i -> readArray arr (srcOff + i) >>= writeArray queue i
let mov !i !qTop = when (i < dstOff + len) $ do
x <- readArray arr i
y <- readArray queue qTop
writeArray arr i y
writeArray queue qTop x
mov (i+1) (if qTop + 1 >= nonOverlap then 0 else qTop + 1)
mov dstOff 0
where nonOverlap = dstOff - srcOff
| 702 | moveForwardsLargeOverlap :: PrimMonad m => MutableArray (PrimState m) a -> Int -> Int -> Int -> m ()
moveForwardsLargeOverlap !arr !dstOff !srcOff !len =
INTERNAL_CHECK(check) "moveForwardsLargeOverlap" "not a forward move" (dstOff > srcOff)
$ do
queue <- newArray nonOverlap uninitialised
loopM nonOverlap $ \ i -> readArray arr (srcOff + i) >>= writeArray queue i
let mov !i !qTop = when (i < dstOff + len) $ do
x <- readArray arr i
y <- readArray queue qTop
writeArray arr i y
writeArray queue qTop x
mov (i+1) (if qTop + 1 >= nonOverlap then 0 else qTop + 1)
mov dstOff 0
where nonOverlap = dstOff - srcOff
| 702 | moveForwardsLargeOverlap !arr !dstOff !srcOff !len =
INTERNAL_CHECK(check) "moveForwardsLargeOverlap" "not a forward move" (dstOff > srcOff)
$ do
queue <- newArray nonOverlap uninitialised
loopM nonOverlap $ \ i -> readArray arr (srcOff + i) >>= writeArray queue i
let mov !i !qTop = when (i < dstOff + len) $ do
x <- readArray arr i
y <- readArray queue qTop
writeArray arr i y
writeArray queue qTop x
mov (i+1) (if qTop + 1 >= nonOverlap then 0 else qTop + 1)
mov dstOff 0
where nonOverlap = dstOff - srcOff
| 601 | false | true | 2 | 17 | 200 | 271 | 124 | 147 | null | null |
rueshyna/gogol | gogol-storage-transfer/gen/Network/Google/Resource/StorageTransfer/TransferOperations/Resume.hs | mpl-2.0 | -- | The name of the transfer operation. Required.
torName :: Lens' TransferOperationsResume Text
torName = lens _torName (\ s a -> s{_torName = a}) | 148 | torName :: Lens' TransferOperationsResume Text
torName = lens _torName (\ s a -> s{_torName = a}) | 97 | torName = lens _torName (\ s a -> s{_torName = a}) | 50 | true | true | 0 | 9 | 24 | 40 | 22 | 18 | null | null |
Noeda/dfterm3 | src/Dfterm3/AdminPanel.hs | isc | -- | Runs an administrator panel. It runs until the Haskell process ends. In
-- other words, this does not return.
runAdminPanel :: Word16 -- ^ Port where to run.
-> Storage -- ^ Handle to persistent storage.
-> IO ()
runAdminPanel port storage = do
-- We need to create the socket ourselves to listen on 127.0.0.1
s <- H.bindIPv4 "127.0.0.1" $ fromIntegral port
H.simpleHTTPWithSocket s
H.nullConf { H.port = fromIntegral port }
(adminPart storage) | 556 | runAdminPanel :: Word16 -- ^ Port where to run.
-> Storage -- ^ Handle to persistent storage.
-> IO ()
runAdminPanel port storage = do
-- We need to create the socket ourselves to listen on 127.0.0.1
s <- H.bindIPv4 "127.0.0.1" $ fromIntegral port
H.simpleHTTPWithSocket s
H.nullConf { H.port = fromIntegral port }
(adminPart storage) | 441 | runAdminPanel port storage = do
-- We need to create the socket ourselves to listen on 127.0.0.1
s <- H.bindIPv4 "127.0.0.1" $ fromIntegral port
H.simpleHTTPWithSocket s
H.nullConf { H.port = fromIntegral port }
(adminPart storage) | 297 | true | true | 0 | 11 | 182 | 91 | 44 | 47 | null | null |
MaxGabriel/elm-compiler | src/Reporting/Error/Type.hs | bsd-3-clause | -- TO REPORT
toReport :: P.Dealiaser -> Error -> Report.Report
toReport dealiaser err =
case err of
Mismatch (MismatchInfo hint leftType rightType note) ->
let
(subRegion, preHint, maybePostHint) = hintToString hint
postHint =
maybe "" (++"\n\n") note
++ maybe "" (++"\n\n") maybePostHint
++ "As I infer the types of values flowing through your program, I see a conflict\n"
++ "between these two types:\n\n"
++ P.render (P.nest 4 (P.pretty dealiaser False leftType))
++ "\n\n"
++ P.render (P.nest 4 (P.pretty dealiaser False rightType))
in
Report.Report "TYPE MISMATCH" subRegion preHint postHint
InfiniteType (InfiniteTypeInfo name var tipe) ->
let
prettyVar =
P.pretty dealiaser False var
prettyType =
P.pretty dealiaser False tipe
in
Report.simple "INFINITE TYPE"
( "I am inferring weird self-referential type for `" ++ name ++ "`"
)
( "The bit of the type that is self-referential looks like this:\n\n"
++ P.render (P.nest 4 (prettyVar <+> P.equals <+> prettyType))
++ "\n\nThe cause is often that the usage of `" ++ name ++ "` is flipped around.\n\n"
++ "Maybe you are inserting a data structure into an element? Maybe you are giving\n"
++ "a function to an argument? Either way, something is probably backwards!\n\n"
++ "Try breaking the code related to `" ++ name ++ "` into smaller pieces.\n"
++ "Give each piece a name and try to write down its type."
)
BadMain tipe ->
Report.simple "BAD MAIN TYPE" "The 'main' value has an unsupported type." $
"I need an Element, Html, (Signal Element), or (Signal Html) so I can render it\n"
++ "on screen, but you gave me:\n\n"
++ P.render (P.nest 4 (P.pretty dealiaser False tipe)) | 1,996 | toReport :: P.Dealiaser -> Error -> Report.Report
toReport dealiaser err =
case err of
Mismatch (MismatchInfo hint leftType rightType note) ->
let
(subRegion, preHint, maybePostHint) = hintToString hint
postHint =
maybe "" (++"\n\n") note
++ maybe "" (++"\n\n") maybePostHint
++ "As I infer the types of values flowing through your program, I see a conflict\n"
++ "between these two types:\n\n"
++ P.render (P.nest 4 (P.pretty dealiaser False leftType))
++ "\n\n"
++ P.render (P.nest 4 (P.pretty dealiaser False rightType))
in
Report.Report "TYPE MISMATCH" subRegion preHint postHint
InfiniteType (InfiniteTypeInfo name var tipe) ->
let
prettyVar =
P.pretty dealiaser False var
prettyType =
P.pretty dealiaser False tipe
in
Report.simple "INFINITE TYPE"
( "I am inferring weird self-referential type for `" ++ name ++ "`"
)
( "The bit of the type that is self-referential looks like this:\n\n"
++ P.render (P.nest 4 (prettyVar <+> P.equals <+> prettyType))
++ "\n\nThe cause is often that the usage of `" ++ name ++ "` is flipped around.\n\n"
++ "Maybe you are inserting a data structure into an element? Maybe you are giving\n"
++ "a function to an argument? Either way, something is probably backwards!\n\n"
++ "Try breaking the code related to `" ++ name ++ "` into smaller pieces.\n"
++ "Give each piece a name and try to write down its type."
)
BadMain tipe ->
Report.simple "BAD MAIN TYPE" "The 'main' value has an unsupported type." $
"I need an Element, Html, (Signal Element), or (Signal Html) so I can render it\n"
++ "on screen, but you gave me:\n\n"
++ P.render (P.nest 4 (P.pretty dealiaser False tipe)) | 1,982 | toReport dealiaser err =
case err of
Mismatch (MismatchInfo hint leftType rightType note) ->
let
(subRegion, preHint, maybePostHint) = hintToString hint
postHint =
maybe "" (++"\n\n") note
++ maybe "" (++"\n\n") maybePostHint
++ "As I infer the types of values flowing through your program, I see a conflict\n"
++ "between these two types:\n\n"
++ P.render (P.nest 4 (P.pretty dealiaser False leftType))
++ "\n\n"
++ P.render (P.nest 4 (P.pretty dealiaser False rightType))
in
Report.Report "TYPE MISMATCH" subRegion preHint postHint
InfiniteType (InfiniteTypeInfo name var tipe) ->
let
prettyVar =
P.pretty dealiaser False var
prettyType =
P.pretty dealiaser False tipe
in
Report.simple "INFINITE TYPE"
( "I am inferring weird self-referential type for `" ++ name ++ "`"
)
( "The bit of the type that is self-referential looks like this:\n\n"
++ P.render (P.nest 4 (prettyVar <+> P.equals <+> prettyType))
++ "\n\nThe cause is often that the usage of `" ++ name ++ "` is flipped around.\n\n"
++ "Maybe you are inserting a data structure into an element? Maybe you are giving\n"
++ "a function to an argument? Either way, something is probably backwards!\n\n"
++ "Try breaking the code related to `" ++ name ++ "` into smaller pieces.\n"
++ "Give each piece a name and try to write down its type."
)
BadMain tipe ->
Report.simple "BAD MAIN TYPE" "The 'main' value has an unsupported type." $
"I need an Element, Html, (Signal Element), or (Signal Html) so I can render it\n"
++ "on screen, but you gave me:\n\n"
++ P.render (P.nest 4 (P.pretty dealiaser False tipe)) | 1,932 | true | true | 0 | 28 | 630 | 393 | 194 | 199 | null | null |
zohl/servant-auth-cookie | tests/Main.hs | bsd-3-clause | sessionSpec :: Spec
sessionSpec = modifyMaxSuccess (const 10) $ do
context "when session is encrypted and decrypted"
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyId 'checkEquals)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when base64 encoding is erroneous"
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyBase64 'checkSessionDeserializationFailed)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when cereal encoding is erroneous (cookie)" $
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyCookie 'checkSessionDeserializationFailed)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when cereal encoding is erroneous (payload)" $
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyPayload 'checkSessionDeserializationFailed)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when MAC is erroneous" $
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyMAC 'checkIncorrectMAC)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when cookie has expired" $
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyExpiration 'checkCookieExpired)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
]) | 2,265 | sessionSpec :: Spec
sessionSpec = modifyMaxSuccess (const 10) $ do
context "when session is encrypted and decrypted"
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyId 'checkEquals)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when base64 encoding is erroneous"
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyBase64 'checkSessionDeserializationFailed)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when cereal encoding is erroneous (cookie)" $
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyCookie 'checkSessionDeserializationFailed)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when cereal encoding is erroneous (payload)" $
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyPayload 'checkSessionDeserializationFailed)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when MAC is erroneous" $
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyMAC 'checkIncorrectMAC)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when cookie has expired" $
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyExpiration 'checkCookieExpired)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
]) | 2,265 | sessionSpec = modifyMaxSuccess (const 10) $ do
context "when session is encrypted and decrypted"
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyId 'checkEquals)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when base64 encoding is erroneous"
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyBase64 'checkSessionDeserializationFailed)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when cereal encoding is erroneous (cookie)" $
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyCookie 'checkSessionDeserializationFailed)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when cereal encoding is erroneous (payload)" $
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyPayload 'checkSessionDeserializationFailed)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when MAC is erroneous" $
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyMAC 'checkIncorrectMAC)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
])
context "when cookie has expired" $
$(groupRoundTrip $ map (\(h, c, m, a) -> genPropRoundTrip h c m a 'modifyExpiration 'checkCookieExpired)
[(h, c, m, a) |
h <- [''SHA256, ''SHA384, ''SHA512]
, c <- [''AES128, ''AES192, ''AES256]
, m <- [''CBCMode, ''CFBMode, ''CTRMode]
, a <- [''Int, ''String]
]) | 2,245 | false | true | 0 | 17 | 637 | 980 | 550 | 430 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/Protocol.hs | bsd-3-clause | parseQueryResult (IfThenElseW8Unit _ _ _) (IfThenElseUnitReply r) = Just $ ExprRight $ lit r | 92 | parseQueryResult (IfThenElseW8Unit _ _ _) (IfThenElseUnitReply r) = Just $ ExprRight $ lit r | 92 | parseQueryResult (IfThenElseW8Unit _ _ _) (IfThenElseUnitReply r) = Just $ ExprRight $ lit r | 92 | false | false | 0 | 7 | 13 | 38 | 18 | 20 | null | null |
gridaphobe/ghc | compiler/ghci/ByteCodeGen.hs | bsd-3-clause | runBc :: HscEnv -> UniqSupply -> Module -> Maybe ModBreaks -> BcM r
-> IO (BcM_State, r)
runBc hsc_env us this_mod modBreaks (BcM m)
= m (BcM_State hsc_env us this_mod 0 [] modBreaks IntMap.empty) | 205 | runBc :: HscEnv -> UniqSupply -> Module -> Maybe ModBreaks -> BcM r
-> IO (BcM_State, r)
runBc hsc_env us this_mod modBreaks (BcM m)
= m (BcM_State hsc_env us this_mod 0 [] modBreaks IntMap.empty) | 205 | runBc hsc_env us this_mod modBreaks (BcM m)
= m (BcM_State hsc_env us this_mod 0 [] modBreaks IntMap.empty) | 110 | false | true | 0 | 11 | 42 | 88 | 43 | 45 | null | null |
dschalk/score3 | Main.hs | mit | changeGroup :: Text -> Text -> ServerState -> ServerState
changeGroup name group = map (newGroup name group) | 108 | changeGroup :: Text -> Text -> ServerState -> ServerState
changeGroup name group = map (newGroup name group) | 108 | changeGroup name group = map (newGroup name group) | 50 | false | true | 0 | 7 | 16 | 39 | 19 | 20 | null | null |
aminb/blog | src/Post.hs | gpl-3.0 | url :: (IsPieceType p) => Piece p -> String
url p = urlPrefix (p^.specific) ++ slug p | 85 | url :: (IsPieceType p) => Piece p -> String
url p = urlPrefix (p^.specific) ++ slug p | 85 | url p = urlPrefix (p^.specific) ++ slug p | 41 | false | true | 0 | 8 | 16 | 50 | 24 | 26 | null | null |
iu-parfunc/containers | Data/Sequence.hs | bsd-3-clause | -- | 'foldlWithIndex' is a version of 'foldl' that also provides access
-- to the index of each element.
foldlWithIndex :: (b -> Int -> a -> b) -> b -> Seq a -> b
foldlWithIndex f z xs = foldl (\ g x i -> i `seq` f (g (i - 1)) i x) (const z) xs (length xs - 1) | 260 | foldlWithIndex :: (b -> Int -> a -> b) -> b -> Seq a -> b
foldlWithIndex f z xs = foldl (\ g x i -> i `seq` f (g (i - 1)) i x) (const z) xs (length xs - 1) | 155 | foldlWithIndex f z xs = foldl (\ g x i -> i `seq` f (g (i - 1)) i x) (const z) xs (length xs - 1) | 97 | true | true | 0 | 13 | 61 | 119 | 60 | 59 | null | null |
sdynerow/Semirings-Library | haskell/Examples/Paths.hs | apache-2.0 | psExamples 6 = M (toArray 4 [ zero, zero, zero, zero
, PS(fromList([P [1]])), zero, PS(fromList([P [3]])), zero
, PS(fromList([P [1]])), zero, zero, PS(fromList([P [4]]))
, PS(fromList([P [1]])), PS(fromList([P [2]])), zero, zero]) | 315 | psExamples 6 = M (toArray 4 [ zero, zero, zero, zero
, PS(fromList([P [1]])), zero, PS(fromList([P [3]])), zero
, PS(fromList([P [1]])), zero, zero, PS(fromList([P [4]]))
, PS(fromList([P [1]])), PS(fromList([P [2]])), zero, zero]) | 315 | psExamples 6 = M (toArray 4 [ zero, zero, zero, zero
, PS(fromList([P [1]])), zero, PS(fromList([P [3]])), zero
, PS(fromList([P [1]])), zero, zero, PS(fromList([P [4]]))
, PS(fromList([P [1]])), PS(fromList([P [2]])), zero, zero]) | 315 | false | false | 0 | 15 | 115 | 194 | 107 | 87 | null | null |
cullina/Extractor | src/StrictLists.hs | bsd-3-clause | mergeMultisets :: (Ord a) => SL (SP a Int) -> SL (SP a Int) -> SL (SP a Int)
mergeMultisets xx@(SCons (SP x fx) xs) yy@(SCons (SP y fy) ys) =
case compare x y of
EQ -> SCons (SP x (fx + fy)) (mergeMultisets xs ys)
LT -> SCons (SP x fx) (mergeMultisets xs yy)
GT -> SCons (SP y fy) (mergeMultisets xx ys) | 333 | mergeMultisets :: (Ord a) => SL (SP a Int) -> SL (SP a Int) -> SL (SP a Int)
mergeMultisets xx@(SCons (SP x fx) xs) yy@(SCons (SP y fy) ys) =
case compare x y of
EQ -> SCons (SP x (fx + fy)) (mergeMultisets xs ys)
LT -> SCons (SP x fx) (mergeMultisets xs yy)
GT -> SCons (SP y fy) (mergeMultisets xx ys) | 333 | mergeMultisets xx@(SCons (SP x fx) xs) yy@(SCons (SP y fy) ys) =
case compare x y of
EQ -> SCons (SP x (fx + fy)) (mergeMultisets xs ys)
LT -> SCons (SP x fx) (mergeMultisets xs yy)
GT -> SCons (SP y fy) (mergeMultisets xx ys) | 256 | false | true | 3 | 10 | 94 | 203 | 99 | 104 | null | null |
ml9951/ThreadScope | papers/haskell_symposium_2009/bsort/BSort.hs | bsd-3-clause | -------------------------------------------------------------------------------
pair :: [a] -> [[a]]
pair [] = [] | 117 | pair :: [a] -> [[a]]
pair [] = [] | 33 | pair [] = [] | 12 | true | true | 0 | 7 | 13 | 32 | 18 | 14 | null | null |
schernichkin/yarn-client | gen/YARN/Client/Gen/Parser.hs | bsd-3-clause | fancyList :: Stream s m (Tag String) => ParsecT s u m [String]
fancyList = fullTag "<div>" $ fullTag "<div>" $ fullTag "<pre>" $ try emptyList <|> itemsList
where
emptyList = do
text <- dropWhile (not . isAlphaNum) <$> textTag
guard ("None" `isPrefixOf` text)
return []
itemsList = map (dropWhile (not . isAlphaNum) . dropWhile (/= '*')) . lines <$> textTag | 379 | fancyList :: Stream s m (Tag String) => ParsecT s u m [String]
fancyList = fullTag "<div>" $ fullTag "<div>" $ fullTag "<pre>" $ try emptyList <|> itemsList
where
emptyList = do
text <- dropWhile (not . isAlphaNum) <$> textTag
guard ("None" `isPrefixOf` text)
return []
itemsList = map (dropWhile (not . isAlphaNum) . dropWhile (/= '*')) . lines <$> textTag | 379 | fancyList = fullTag "<div>" $ fullTag "<div>" $ fullTag "<pre>" $ try emptyList <|> itemsList
where
emptyList = do
text <- dropWhile (not . isAlphaNum) <$> textTag
guard ("None" `isPrefixOf` text)
return []
itemsList = map (dropWhile (not . isAlphaNum) . dropWhile (/= '*')) . lines <$> textTag | 316 | false | true | 7 | 11 | 82 | 172 | 78 | 94 | null | null |
tanakh/tanakh.jp | tools/logo-gen.hs | bsd-3-clause | line :: Double -> Double -> Double -> Double -> Context -> Fay ()
line = ffi "(function(){%5.shadowColor='rgb(255,255,255)';%5.shadowBlur=6;%5.lineWidth=Math.max(1,(%3-%2)/170);%5.beginPath();%5.moveTo(%1,%2);%5.lineTo(%3,%4);%5.stroke();})()" | 244 | line :: Double -> Double -> Double -> Double -> Context -> Fay ()
line = ffi "(function(){%5.shadowColor='rgb(255,255,255)';%5.shadowBlur=6;%5.lineWidth=Math.max(1,(%3-%2)/170);%5.beginPath();%5.moveTo(%1,%2);%5.lineTo(%3,%4);%5.stroke();})()" | 243 | line = ffi "(function(){%5.shadowColor='rgb(255,255,255)';%5.shadowBlur=6;%5.lineWidth=Math.max(1,(%3-%2)/170);%5.beginPath();%5.moveTo(%1,%2);%5.lineTo(%3,%4);%5.stroke();})()" | 177 | false | true | 0 | 11 | 18 | 39 | 19 | 20 | null | null |
angerman/data-bitcode-edsl | src/EDSL.hs | bsd-3-clause | -- * Update Instructions.
updateInst :: HasCallStack => (Val.Symbol -> Val.Symbol) -> Inst.Inst -> Inst.Inst
updateInst fixFunction = \case
i@(Inst.Call {..}) -> i { Inst.cSym = fixFunction cSym }
x -> x | 217 | updateInst :: HasCallStack => (Val.Symbol -> Val.Symbol) -> Inst.Inst -> Inst.Inst
updateInst fixFunction = \case
i@(Inst.Call {..}) -> i { Inst.cSym = fixFunction cSym }
x -> x | 191 | updateInst fixFunction = \case
i@(Inst.Call {..}) -> i { Inst.cSym = fixFunction cSym }
x -> x | 108 | true | true | 0 | 11 | 45 | 90 | 45 | 45 | null | null |
arnihermann/timedreb2erl | src/Language/Rebeca/Fold/Erlang/Refinement.hs | mit | params = tupleE [varE "StateVars", varE "LocalVars"] | 52 | params = tupleE [varE "StateVars", varE "LocalVars"] | 52 | params = tupleE [varE "StateVars", varE "LocalVars"] | 52 | false | false | 1 | 7 | 6 | 25 | 10 | 15 | null | null |
vikraman/ghc | compiler/utils/UniqFM.hs | bsd-3-clause | ufmToList (UFM m) = map (\(k, v) -> (getUnique k, v)) $ M.toList m | 66 | ufmToList (UFM m) = map (\(k, v) -> (getUnique k, v)) $ M.toList m | 66 | ufmToList (UFM m) = map (\(k, v) -> (getUnique k, v)) $ M.toList m | 66 | false | false | 0 | 10 | 13 | 50 | 26 | 24 | null | null |
yangacer/learn-haskell | list.hs | bsd-2-clause | -- duplicate
dupl :: [a] -> [a]
dupl input = foldl (\accu x -> accu ++ [x] ++ [x]) [] input | 91 | dupl :: [a] -> [a]
dupl input = foldl (\accu x -> accu ++ [x] ++ [x]) [] input | 78 | dupl input = foldl (\accu x -> accu ++ [x] ++ [x]) [] input | 59 | true | true | 0 | 10 | 20 | 58 | 32 | 26 | null | null |
oldmanmike/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | toInfoLbl (IdLabel n c ConEntry) = IdLabel n c ConInfoTable | 65 | toInfoLbl (IdLabel n c ConEntry) = IdLabel n c ConInfoTable | 65 | toInfoLbl (IdLabel n c ConEntry) = IdLabel n c ConInfoTable | 65 | false | false | 0 | 7 | 15 | 26 | 12 | 14 | null | null |
phadej/stack | src/Stack/New.hs | bsd-3-clause | defaultTemplateName :: TemplateName
defaultTemplateName = $(mkTemplateName "new-template") | 90 | defaultTemplateName :: TemplateName
defaultTemplateName = $(mkTemplateName "new-template") | 90 | defaultTemplateName = $(mkTemplateName "new-template") | 54 | false | true | 0 | 7 | 6 | 18 | 9 | 9 | null | null |
martin-kolinek/stack | src/Stack/BuildPlan.hs | bsd-3-clause | removeSrcPkgDefaultFlags :: [C.GenericPackageDescription]
-> Map PackageName (Map FlagName Bool)
-> Map PackageName (Map FlagName Bool)
removeSrcPkgDefaultFlags gpds flags =
let defaults = Map.unions (map gpdDefaultFlags gpds)
flags' = Map.differenceWith removeSame flags defaults
in Map.filter (not . Map.null) flags'
where
removeSame f1 f2 =
let diff v v' = if v == v' then Nothing else Just v
in Just $ Map.differenceWith diff f1 f2
gpdDefaultFlags gpd =
let tuples = map getDefault (C.genPackageFlags gpd)
in Map.singleton (gpdPackageName gpd) (Map.fromList tuples)
flagName' = fromCabalFlagName . C.flagName
getDefault f
| C.flagDefault f = (flagName' f, True)
| otherwise = (flagName' f, False)
-- | Find the set of @FlagName@s necessary to get the given
-- @GenericPackageDescription@ to compile against the given @BuildPlan@. Will
-- only modify non-manual flags, and will prefer default values for flags.
-- Returns the plan which produces least number of dep errors | 1,161 | removeSrcPkgDefaultFlags :: [C.GenericPackageDescription]
-> Map PackageName (Map FlagName Bool)
-> Map PackageName (Map FlagName Bool)
removeSrcPkgDefaultFlags gpds flags =
let defaults = Map.unions (map gpdDefaultFlags gpds)
flags' = Map.differenceWith removeSame flags defaults
in Map.filter (not . Map.null) flags'
where
removeSame f1 f2 =
let diff v v' = if v == v' then Nothing else Just v
in Just $ Map.differenceWith diff f1 f2
gpdDefaultFlags gpd =
let tuples = map getDefault (C.genPackageFlags gpd)
in Map.singleton (gpdPackageName gpd) (Map.fromList tuples)
flagName' = fromCabalFlagName . C.flagName
getDefault f
| C.flagDefault f = (flagName' f, True)
| otherwise = (flagName' f, False)
-- | Find the set of @FlagName@s necessary to get the given
-- @GenericPackageDescription@ to compile against the given @BuildPlan@. Will
-- only modify non-manual flags, and will prefer default values for flags.
-- Returns the plan which produces least number of dep errors | 1,161 | removeSrcPkgDefaultFlags gpds flags =
let defaults = Map.unions (map gpdDefaultFlags gpds)
flags' = Map.differenceWith removeSame flags defaults
in Map.filter (not . Map.null) flags'
where
removeSame f1 f2 =
let diff v v' = if v == v' then Nothing else Just v
in Just $ Map.differenceWith diff f1 f2
gpdDefaultFlags gpd =
let tuples = map getDefault (C.genPackageFlags gpd)
in Map.singleton (gpdPackageName gpd) (Map.fromList tuples)
flagName' = fromCabalFlagName . C.flagName
getDefault f
| C.flagDefault f = (flagName' f, True)
| otherwise = (flagName' f, False)
-- | Find the set of @FlagName@s necessary to get the given
-- @GenericPackageDescription@ to compile against the given @BuildPlan@. Will
-- only modify non-manual flags, and will prefer default values for flags.
-- Returns the plan which produces least number of dep errors | 975 | false | true | 5 | 12 | 329 | 295 | 139 | 156 | null | null |
shmuga/99-haskell-problems | src/Utils/Helpers.hs | gpl-3.0 | myButLast x = last $ init x | 27 | myButLast x = last $ init x | 27 | myButLast x = last $ init x | 27 | false | false | 3 | 5 | 6 | 20 | 7 | 13 | null | null |
olsner/ghc | compiler/types/Coercion.hs | bsd-3-clause | coercionKinds :: [Coercion] -> Pair [Type]
coercionKinds tys = sequenceA $ map coercionKind tys | 95 | coercionKinds :: [Coercion] -> Pair [Type]
coercionKinds tys = sequenceA $ map coercionKind tys | 95 | coercionKinds tys = sequenceA $ map coercionKind tys | 52 | false | true | 0 | 7 | 13 | 39 | 19 | 20 | null | null |
lisphacker/codewars | Sudoku.hs | bsd-2-clause | rows board = elements board | 27 | rows board = elements board | 27 | rows board = elements board | 27 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
balangs/eTeak | src/TeakScript.hs | bsd-3-clause | fromTSVBool :: TSVRecordClass record => TSValue record -> Bool
fromTSVBool (TSVBool bool) = bool | 100 | fromTSVBool :: TSVRecordClass record => TSValue record -> Bool
fromTSVBool (TSVBool bool) = bool | 96 | fromTSVBool (TSVBool bool) = bool | 33 | false | true | 0 | 10 | 17 | 36 | 16 | 20 | null | null |
amccausl/Swish | Swish/HaskellRDF/GraphTest.hs | lgpl-2.1 | t11006 = toStatement v110 p115 v106 | 35 | t11006 = toStatement v110 p115 v106 | 35 | t11006 = toStatement v110 p115 v106 | 35 | false | false | 0 | 5 | 5 | 13 | 6 | 7 | null | null |
forsyde/forsyde-atom | src/ForSyDe/Atom/Utility/Tuple.hs | bsd-3-clause | at99 (_,_,_,_,_,_,_,_,x) = x | 28 | at99 (_,_,_,_,_,_,_,_,x) = x | 28 | at99 (_,_,_,_,_,_,_,_,x) = x | 28 | false | false | 0 | 6 | 3 | 36 | 22 | 14 | null | null |
chpatrick/codec | src/Data/Binary/Bits/Codec.hs | bsd-3-clause | word16be :: Int -> BitCodec Word16
word16be = bitCodec G.word16be putWord16be | 77 | word16be :: Int -> BitCodec Word16
word16be = bitCodec G.word16be putWord16be | 77 | word16be = bitCodec G.word16be putWord16be | 42 | false | true | 0 | 7 | 10 | 32 | 13 | 19 | null | null |
jaredloomis/GLMatrix | GLMatrix.hs | gpl-3.0 | -- | Inverts a 4x4 orthonormal matrix with the special case trick.
invertMatrix4x4ON :: Matrix4x4 -> Matrix4x4
invertMatrix4x4ON m = -- orthonormal matrix inverse
let [a,b,c] = transpose $ matrix4x4To3x3 m
[_,_,_,t4] = m
t = vec4To3 t4
in [
vec3To4 a 0, vec3To4 b 0, vec3To4 c 0,
[dotVec a t, dotVec b t, dotVec c t, t4 !! 3]
] | 374 | invertMatrix4x4ON :: Matrix4x4 -> Matrix4x4
invertMatrix4x4ON m = -- orthonormal matrix inverse
let [a,b,c] = transpose $ matrix4x4To3x3 m
[_,_,_,t4] = m
t = vec4To3 t4
in [
vec3To4 a 0, vec3To4 b 0, vec3To4 c 0,
[dotVec a t, dotVec b t, dotVec c t, t4 !! 3]
] | 307 | invertMatrix4x4ON m = -- orthonormal matrix inverse
let [a,b,c] = transpose $ matrix4x4To3x3 m
[_,_,_,t4] = m
t = vec4To3 t4
in [
vec3To4 a 0, vec3To4 b 0, vec3To4 c 0,
[dotVec a t, dotVec b t, dotVec c t, t4 !! 3]
] | 263 | true | true | 0 | 10 | 108 | 132 | 70 | 62 | null | null |
ariep/psqueues | benchmarks/BenchmarkTypes.hs | bsd-3-clause | runBenchmark :: [BenchmarkSet] -> [Benchmark]
runBenchmark bset =
[ bgroup "minView" $ map (bench' bMinView) bset
, bgroup "lookup" $ map (bench' bLookup) bset
, bgroup "insertEmpty" $ map (bench' bInsertEmpty) bset
, bgroup "insertNew" $ map (bench' bInsertNew) bset
, bgroup "insertDuplicates" $ map (bench' bInsertDuplicates) bset
, bgroup "delete" $ map (bench' bDelete) bset
]
where
bench' f x = bench (bGroupName x) (f x) | 542 | runBenchmark :: [BenchmarkSet] -> [Benchmark]
runBenchmark bset =
[ bgroup "minView" $ map (bench' bMinView) bset
, bgroup "lookup" $ map (bench' bLookup) bset
, bgroup "insertEmpty" $ map (bench' bInsertEmpty) bset
, bgroup "insertNew" $ map (bench' bInsertNew) bset
, bgroup "insertDuplicates" $ map (bench' bInsertDuplicates) bset
, bgroup "delete" $ map (bench' bDelete) bset
]
where
bench' f x = bench (bGroupName x) (f x) | 542 | runBenchmark bset =
[ bgroup "minView" $ map (bench' bMinView) bset
, bgroup "lookup" $ map (bench' bLookup) bset
, bgroup "insertEmpty" $ map (bench' bInsertEmpty) bset
, bgroup "insertNew" $ map (bench' bInsertNew) bset
, bgroup "insertDuplicates" $ map (bench' bInsertDuplicates) bset
, bgroup "delete" $ map (bench' bDelete) bset
]
where
bench' f x = bench (bGroupName x) (f x) | 496 | false | true | 0 | 9 | 181 | 180 | 87 | 93 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | -- -- dotnet interop
-- objectTyConKey :: Unique
-- objectTyConKey = mkPreludeTyConUnique 83
eitherTyConKey :: Unique
eitherTyConKey = mkPreludeTyConUnique 84 | 209 | eitherTyConKey :: Unique
eitherTyConKey = mkPreludeTyConUnique 84 | 90 | eitherTyConKey = mkPreludeTyConUnique 84 | 65 | true | true | 0 | 5 | 70 | 17 | 10 | 7 | null | null |
bergmark/time | lib/Data/Time/LocalTime/TimeZone.hs | bsd-3-clause | posixToCTime :: POSIXTime -> CTime
posixToCTime = fromInteger . floor | 70 | posixToCTime :: POSIXTime -> CTime
posixToCTime = fromInteger . floor | 70 | posixToCTime = fromInteger . floor | 35 | false | true | 0 | 7 | 10 | 26 | 11 | 15 | null | null |
mariefarrell/Hets | Common/Utils.hs | gpl-2.0 | -- | /O(1)/ test if the set's size is one
isSingleton :: Set.Set a -> Bool
isSingleton s = Set.size s == 1 | 106 | isSingleton :: Set.Set a -> Bool
isSingleton s = Set.size s == 1 | 64 | isSingleton s = Set.size s == 1 | 31 | true | true | 0 | 7 | 22 | 33 | 16 | 17 | null | null |
emwap/feldspar-language | tests/Feldspar/Mutable/Test.hs | bsd-3-clause | hash :: Num a => [a] -> a
hash = Prelude.foldr (\a b -> 3*a-b) 0 | 64 | hash :: Num a => [a] -> a
hash = Prelude.foldr (\a b -> 3*a-b) 0 | 64 | hash = Prelude.foldr (\a b -> 3*a-b) 0 | 38 | false | true | 0 | 9 | 15 | 50 | 26 | 24 | null | null |
ckw/matasano | set2/challenge11.hs | mit | parseOpts :: [String] -> IO (Options, [String])
parseOpts argv = case getOpt Permute options argv of
(o,n,[] ) -> return (foldr ($) defaultOptions o, n)
(_,_,errs) -> ioError (userError (concat errs ++ usageInfo header options))
where header = "Usage: " | 264 | parseOpts :: [String] -> IO (Options, [String])
parseOpts argv = case getOpt Permute options argv of
(o,n,[] ) -> return (foldr ($) defaultOptions o, n)
(_,_,errs) -> ioError (userError (concat errs ++ usageInfo header options))
where header = "Usage: " | 264 | parseOpts argv = case getOpt Permute options argv of
(o,n,[] ) -> return (foldr ($) defaultOptions o, n)
(_,_,errs) -> ioError (userError (concat errs ++ usageInfo header options))
where header = "Usage: " | 216 | false | true | 1 | 13 | 50 | 134 | 68 | 66 | null | null |
Oblosys/webviews | src/lib/BlazeHtml.hs | mit | cellpadding = A4.cellpadding . fromString | 41 | cellpadding = A4.cellpadding . fromString | 41 | cellpadding = A4.cellpadding . fromString | 41 | false | false | 1 | 6 | 4 | 16 | 6 | 10 | null | null |
ekmett/containers | tests/map-properties.hs | bsd-3-clause | test_updateMinWithKey :: Assertion
test_updateMinWithKey = do
updateMinWithKey (\ k a -> Just ((show k) ++ ":" ++ a)) (fromList [(5,"a"), (3,"b")]) @?= fromList [(3,"3:b"), (5,"a")]
updateMinWithKey (\ _ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) @?= singleton 5 "a" | 295 | test_updateMinWithKey :: Assertion
test_updateMinWithKey = do
updateMinWithKey (\ k a -> Just ((show k) ++ ":" ++ a)) (fromList [(5,"a"), (3,"b")]) @?= fromList [(3,"3:b"), (5,"a")]
updateMinWithKey (\ _ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) @?= singleton 5 "a" | 295 | test_updateMinWithKey = do
updateMinWithKey (\ k a -> Just ((show k) ++ ":" ++ a)) (fromList [(5,"a"), (3,"b")]) @?= fromList [(3,"3:b"), (5,"a")]
updateMinWithKey (\ _ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) @?= singleton 5 "a" | 260 | false | true | 0 | 17 | 65 | 156 | 84 | 72 | null | null |
EdisonAlgorithms/HackerRank | practice/fp/recursion/convex-hull-fp/convex-hull-fp.hs | mit | lower_hull :: [(Int, Int)] -> [(Int, Int)] -> [(Int, Int)]
lower_hull points [] = points | 88 | lower_hull :: [(Int, Int)] -> [(Int, Int)] -> [(Int, Int)]
lower_hull points [] = points | 88 | lower_hull points [] = points | 29 | false | true | 0 | 8 | 14 | 53 | 31 | 22 | null | null |
azadbolour/boardgame | haskell-server/src/BoardGame/Server/Service/GameJsonSqlPersister.hs | agpl-3.0 | findGameById :: ConnectionProvider -> GameId -> Result (Maybe JsonEncoded)
findGameById provider gameUid = do
maybeEntity <- liftIO $ PersistRunner.runQuery provider (findGameByIdReader gameUid)
let extractJson entity = case entityVal entity of
GameRow _ _ json _ -> json
return $ extractJson <$> maybeEntity | 343 | findGameById :: ConnectionProvider -> GameId -> Result (Maybe JsonEncoded)
findGameById provider gameUid = do
maybeEntity <- liftIO $ PersistRunner.runQuery provider (findGameByIdReader gameUid)
let extractJson entity = case entityVal entity of
GameRow _ _ json _ -> json
return $ extractJson <$> maybeEntity | 343 | findGameById provider gameUid = do
maybeEntity <- liftIO $ PersistRunner.runQuery provider (findGameByIdReader gameUid)
let extractJson entity = case entityVal entity of
GameRow _ _ json _ -> json
return $ extractJson <$> maybeEntity | 268 | false | true | 0 | 13 | 76 | 102 | 47 | 55 | null | null |
oden-lang/oden | test/Oden/InferSpec.hs | mit | untypedInt n = Literal missing (Int n) Untyped | 46 | untypedInt n = Literal missing (Int n) Untyped | 46 | untypedInt n = Literal missing (Int n) Untyped | 46 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
rueshyna/gogol | gogol-customsearch/gen/Network/Google/CustomSearch/Types/Product.hs | mpl-2.0 | ssCorrectedQuery :: Lens' SearchSpelling (Maybe Text)
ssCorrectedQuery
= lens _ssCorrectedQuery
(\ s a -> s{_ssCorrectedQuery = a}) | 139 | ssCorrectedQuery :: Lens' SearchSpelling (Maybe Text)
ssCorrectedQuery
= lens _ssCorrectedQuery
(\ s a -> s{_ssCorrectedQuery = a}) | 139 | ssCorrectedQuery
= lens _ssCorrectedQuery
(\ s a -> s{_ssCorrectedQuery = a}) | 85 | false | true | 0 | 9 | 24 | 47 | 24 | 23 | null | null |
davidzhulijun/TAM | TuringMachine/Models/TM3.hs | bsd-3-clause | finalState :: ListMem CState
finalState = fillMem [HALT] | 56 | finalState :: ListMem CState
finalState = fillMem [HALT] | 56 | finalState = fillMem [HALT] | 27 | false | true | 0 | 6 | 7 | 20 | 10 | 10 | null | null |
ihc/futhark | src/Language/Futhark/TypeChecker/Monad.hs | isc | anyIntType :: [TypeBase () ()]
anyIntType = anySignedType ++ anyUnsignedType | 76 | anyIntType :: [TypeBase () ()]
anyIntType = anySignedType ++ anyUnsignedType | 76 | anyIntType = anySignedType ++ anyUnsignedType | 45 | false | true | 0 | 7 | 9 | 27 | 14 | 13 | null | null |
jamesdarcy/DicomH | src/Data/Dicom/Accessor.hs | bsd-3-clause | getSeriesInstanceUid :: DicomObject -> Maybe String
getSeriesInstanceUid = getString sERIES_INSTANCE_UID | 104 | getSeriesInstanceUid :: DicomObject -> Maybe String
getSeriesInstanceUid = getString sERIES_INSTANCE_UID | 104 | getSeriesInstanceUid = getString sERIES_INSTANCE_UID | 52 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
mankyKitty/TypePlay | src/TypePlay/Infer/HM.hs | mit | mgu (TCon tc1) (TCon tc2)
| tc1 == tc2 = return nullSubst | 59 | mgu (TCon tc1) (TCon tc2)
| tc1 == tc2 = return nullSubst | 59 | mgu (TCon tc1) (TCon tc2)
| tc1 == tc2 = return nullSubst | 59 | false | false | 1 | 7 | 13 | 38 | 16 | 22 | null | null |
google/hs-portray | portray-prettyprinter/src/Data/Portray/Prettyprinter.hs | apache-2.0 | -- | Convenience function for rendering a 'Portrayal' to a 'Text'.
basicShowPortrayal :: Portrayal -> Text
basicShowPortrayal = styleShowPortrayal defaultConfig (const mempty) | 175 | basicShowPortrayal :: Portrayal -> Text
basicShowPortrayal = styleShowPortrayal defaultConfig (const mempty) | 108 | basicShowPortrayal = styleShowPortrayal defaultConfig (const mempty) | 68 | true | true | 0 | 7 | 21 | 33 | 15 | 18 | null | null |
oldmanmike/ghc | compiler/cmm/PprC.hs | bsd-3-clause | is_cishCC JavaScriptCallConv = False | 36 | is_cishCC JavaScriptCallConv = False | 36 | is_cishCC JavaScriptCallConv = False | 36 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
zalora/Angel | src/Angel/Process.hs | bsd-3-clause | getProcessHandleStatus :: ProcessHandle -> IO (Maybe ProcessStatus)
getProcessHandleStatus ph = catchJust exPred getStatus handleDNE
where shouldBlock = False
includeStopped = True
getStatus = fmap join $ withPid (getProcessStatus shouldBlock includeStopped) ph
exPred e
| isDoesNotExistError e = Just ()
| otherwise = Nothing
handleDNE = const $ return Nothing -- ehhhhhhhhhhhhh, Nothing means not available? | 478 | getProcessHandleStatus :: ProcessHandle -> IO (Maybe ProcessStatus)
getProcessHandleStatus ph = catchJust exPred getStatus handleDNE
where shouldBlock = False
includeStopped = True
getStatus = fmap join $ withPid (getProcessStatus shouldBlock includeStopped) ph
exPred e
| isDoesNotExistError e = Just ()
| otherwise = Nothing
handleDNE = const $ return Nothing -- ehhhhhhhhhhhhh, Nothing means not available? | 478 | getProcessHandleStatus ph = catchJust exPred getStatus handleDNE
where shouldBlock = False
includeStopped = True
getStatus = fmap join $ withPid (getProcessStatus shouldBlock includeStopped) ph
exPred e
| isDoesNotExistError e = Just ()
| otherwise = Nothing
handleDNE = const $ return Nothing -- ehhhhhhhhhhhhh, Nothing means not available? | 410 | false | true | 7 | 9 | 123 | 114 | 55 | 59 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.