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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hungaikev/learning-haskell | cis194/week1/intro.hs | apache-2.0 | foo :: Int -> Int
foo 0 = 16 | 29 | foo :: Int -> Int
foo 0 = 16 | 28 | foo 0 = 16 | 10 | false | true | 0 | 7 | 9 | 24 | 10 | 14 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/ExtensionPredicates.hs | bsd-3-clause | -- | Is the <https://www.opengl.org/registry/specs/SGIX/subsample.txt SGIX_subsample> extension supported?
-- Note that in the presence of multiple contexts with different capabilities,
-- this might be wrong. Use 'glGetSGIXSubsample' in those cases instead.
gl_SGIX_subsample :: Bool
gl_SGIX_subsample = member "GL_SGIX_subsample" extensions | 342 | gl_SGIX_subsample :: Bool
gl_SGIX_subsample = member "GL_SGIX_subsample" extensions | 83 | gl_SGIX_subsample = member "GL_SGIX_subsample" extensions | 57 | true | true | 0 | 5 | 38 | 19 | 11 | 8 | null | null |
tyoko-dev/rcore-haskell | src/Main.hs | agpl-3.0 | parseAndRun :: String -> String -> IO ()
parseAndRun prog_file val_file =
do prog_str <- loadFile prog_file
val_str <- loadFile val_file
case parseProgram prog_str of
Left err -> print err >> exitWith (ExitFailure 1)
Right prog -> case parseVal val_str of
Left err -> print err >> exitWith (ExitFailure 1)
Right val -> print $ pretty $ execProgram prog val | 448 | parseAndRun :: String -> String -> IO ()
parseAndRun prog_file val_file =
do prog_str <- loadFile prog_file
val_str <- loadFile val_file
case parseProgram prog_str of
Left err -> print err >> exitWith (ExitFailure 1)
Right prog -> case parseVal val_str of
Left err -> print err >> exitWith (ExitFailure 1)
Right val -> print $ pretty $ execProgram prog val | 448 | parseAndRun prog_file val_file =
do prog_str <- loadFile prog_file
val_str <- loadFile val_file
case parseProgram prog_str of
Left err -> print err >> exitWith (ExitFailure 1)
Right prog -> case parseVal val_str of
Left err -> print err >> exitWith (ExitFailure 1)
Right val -> print $ pretty $ execProgram prog val | 407 | false | true | 0 | 16 | 151 | 147 | 65 | 82 | null | null |
ashutoshrishi/blogserver | src/Main.hs | bsd-3-clause | loginRequestA :: ActionM ()
loginRequestA = do
req <- request
basicAuth req | 84 | loginRequestA :: ActionM ()
loginRequestA = do
req <- request
basicAuth req | 84 | loginRequestA = do
req <- request
basicAuth req | 56 | false | true | 1 | 8 | 20 | 33 | 13 | 20 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Reports/Insert.hs | mpl-2.0 | -- | The Campaign Manager 360 user profile ID.
riProFileId :: Lens' ReportsInsert Int64
riProFileId
= lens _riProFileId (\ s a -> s{_riProFileId = a}) .
_Coerce | 168 | riProFileId :: Lens' ReportsInsert Int64
riProFileId
= lens _riProFileId (\ s a -> s{_riProFileId = a}) .
_Coerce | 121 | riProFileId
= lens _riProFileId (\ s a -> s{_riProFileId = a}) .
_Coerce | 80 | true | true | 1 | 9 | 34 | 50 | 24 | 26 | null | null |
amitai-hoze/htoml | src/Text/Toml/Parser.hs | bsd-3-clause | isSpc :: Char -> Bool
isSpc c = c == ' ' || c == '\t' | 53 | isSpc :: Char -> Bool
isSpc c = c == ' ' || c == '\t' | 53 | isSpc c = c == ' ' || c == '\t' | 31 | false | true | 0 | 7 | 15 | 30 | 15 | 15 | null | null |
rfranek/duckling | Duckling/Rules/HE.hs | bsd-3-clause | rules (This Ordinal) = Ordinal.rules | 36 | rules (This Ordinal) = Ordinal.rules | 36 | rules (This Ordinal) = Ordinal.rules | 36 | false | false | 0 | 7 | 4 | 17 | 8 | 9 | null | null |
np/hlatex | Language/LaTeX/Builder/Math.hs | bsd-3-clause | widehat :: MathItem -> MathItem
widehat = mathCmdMathArg "widehat" | 66 | widehat :: MathItem -> MathItem
widehat = mathCmdMathArg "widehat" | 66 | widehat = mathCmdMathArg "widehat" | 34 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
pacak/cuddly-bassoon | unordered-containers-0.2.8.0/tests/HashMapProperties.hs | bsd-3-clause | pAdjust :: Key -> [(Key, Int)] -> Bool
pAdjust k = M.adjust succ k `eq_` HM.adjust succ k | 89 | pAdjust :: Key -> [(Key, Int)] -> Bool
pAdjust k = M.adjust succ k `eq_` HM.adjust succ k | 89 | pAdjust k = M.adjust succ k `eq_` HM.adjust succ k | 50 | false | true | 0 | 9 | 17 | 57 | 28 | 29 | null | null |
dimara/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | htHvmValidNicTypes :: FrozenSet String
htHvmValidNicTypes =
ConstantUtils.mkSet [htNicE1000,
htNicNe2kIsa,
htNicNe2kPci,
htNicParavirtual,
htNicRtl8139] | 246 | htHvmValidNicTypes :: FrozenSet String
htHvmValidNicTypes =
ConstantUtils.mkSet [htNicE1000,
htNicNe2kIsa,
htNicNe2kPci,
htNicParavirtual,
htNicRtl8139] | 246 | htHvmValidNicTypes =
ConstantUtils.mkSet [htNicE1000,
htNicNe2kIsa,
htNicNe2kPci,
htNicParavirtual,
htNicRtl8139] | 207 | false | true | 1 | 5 | 105 | 37 | 19 | 18 | null | null |
JoeyEremondi/elm-pattern-effects | src/Type/Effect/Solve.hs | bsd-3-clause | makeAnnotsEqual r v1 v2 = do
constrs1 <- makeSubEffectConstrs r v1 v2
constrs2 <- makeSubEffectConstrs r v2 v1
return (constrs1 ++ constrs2 )
--makeWHelper :: EmittedConstr -> SolverM [WConstr] | 200 | makeAnnotsEqual r v1 v2 = do
constrs1 <- makeSubEffectConstrs r v1 v2
constrs2 <- makeSubEffectConstrs r v2 v1
return (constrs1 ++ constrs2 )
--makeWHelper :: EmittedConstr -> SolverM [WConstr] | 200 | makeAnnotsEqual r v1 v2 = do
constrs1 <- makeSubEffectConstrs r v1 v2
constrs2 <- makeSubEffectConstrs r v2 v1
return (constrs1 ++ constrs2 )
--makeWHelper :: EmittedConstr -> SolverM [WConstr] | 200 | false | false | 0 | 9 | 35 | 55 | 25 | 30 | null | null |
kmels/dart-haskell | examples/interpreter/RecursiveVdefg.hs | bsd-3-clause | even n = odd (n-1) | 18 | even n = odd (n-1) | 18 | even n = odd (n-1) | 18 | false | false | 1 | 7 | 4 | 23 | 9 | 14 | null | null |
philopon/pylon | Graphics/Pylon/Binding/Pango/Layout.hs | mit | setSpacing :: Int -> Layout -> IO ()
setSpacing i (Layout f) = withForeignPtr f $ \l ->
pango_layout_set_spacing l (fromIntegral i) | 135 | setSpacing :: Int -> Layout -> IO ()
setSpacing i (Layout f) = withForeignPtr f $ \l ->
pango_layout_set_spacing l (fromIntegral i) | 135 | setSpacing i (Layout f) = withForeignPtr f $ \l ->
pango_layout_set_spacing l (fromIntegral i) | 98 | false | true | 0 | 9 | 25 | 58 | 28 | 30 | null | null |
bitemyapp/ganeti | src/Ganeti/Query/Instance.hs | bsd-2-clause | getDiskSizes :: ConfigData -> Instance -> ResultEntry
getDiskSizes cfg =
rsErrorNoData . liftA (map $ MaybeForJSON . diskSize)
. getInstDisksFromObj cfg | 156 | getDiskSizes :: ConfigData -> Instance -> ResultEntry
getDiskSizes cfg =
rsErrorNoData . liftA (map $ MaybeForJSON . diskSize)
. getInstDisksFromObj cfg | 156 | getDiskSizes cfg =
rsErrorNoData . liftA (map $ MaybeForJSON . diskSize)
. getInstDisksFromObj cfg | 102 | false | true | 2 | 8 | 24 | 55 | 24 | 31 | null | null |
nevrenato/Hets_Fork | SoftFOL/tests/PrintTests.hs | gpl-2.0 | printTermTest = TestList [
-- empty term list not allowed!
TestLabel "quant_term1" (TestCase (assertEqual "" "forall([a], equal(a, a))" (showDoc (SPQuantTerm {quantSym= SPForall, variableList= [simpTerm (mkSPCustomSymbol "a")], qFormula= SPComplexTerm {symbol= SPEqual, arguments= [simpTerm (mkSPCustomSymbol "a"), simpTerm (mkSPCustomSymbol "a")]}}) ""))),
TestLabel "quant_term2" (TestCase (assertEqual "" "forall([a, a], equal(a, a))" (showDoc (SPQuantTerm {quantSym= SPForall, variableList= [simpTerm (mkSPCustomSymbol "a"), simpTerm (mkSPCustomSymbol "a")], qFormula= SPComplexTerm {symbol= SPEqual, arguments= [simpTerm (mkSPCustomSymbol "a"), simpTerm (mkSPCustomSymbol "a")]}}) ""))),
TestLabel "simple_term" (TestCase (assertEqual "" "testsymbol" (showDoc (simpTerm (mkSPCustomSymbol "testsymbol")) ""))),
-- empty arguments list not allowed!
TestLabel "complex_term1" (TestCase (assertEqual "" "test(a)" (showDoc (SPComplexTerm {symbol= mkSPCustomSymbol "test", arguments=[simpTerm (mkSPCustomSymbol "a")]}) ""))),
TestLabel "complex_term2" (TestCase (assertEqual "" "implies(a, b)" (showDoc (SPComplexTerm {symbol= SPImplies, arguments=[simpTerm (mkSPCustomSymbol "a"), simpTerm (mkSPCustomSymbol "b")]}) "")))] | 1,236 | printTermTest = TestList [
-- empty term list not allowed!
TestLabel "quant_term1" (TestCase (assertEqual "" "forall([a], equal(a, a))" (showDoc (SPQuantTerm {quantSym= SPForall, variableList= [simpTerm (mkSPCustomSymbol "a")], qFormula= SPComplexTerm {symbol= SPEqual, arguments= [simpTerm (mkSPCustomSymbol "a"), simpTerm (mkSPCustomSymbol "a")]}}) ""))),
TestLabel "quant_term2" (TestCase (assertEqual "" "forall([a, a], equal(a, a))" (showDoc (SPQuantTerm {quantSym= SPForall, variableList= [simpTerm (mkSPCustomSymbol "a"), simpTerm (mkSPCustomSymbol "a")], qFormula= SPComplexTerm {symbol= SPEqual, arguments= [simpTerm (mkSPCustomSymbol "a"), simpTerm (mkSPCustomSymbol "a")]}}) ""))),
TestLabel "simple_term" (TestCase (assertEqual "" "testsymbol" (showDoc (simpTerm (mkSPCustomSymbol "testsymbol")) ""))),
-- empty arguments list not allowed!
TestLabel "complex_term1" (TestCase (assertEqual "" "test(a)" (showDoc (SPComplexTerm {symbol= mkSPCustomSymbol "test", arguments=[simpTerm (mkSPCustomSymbol "a")]}) ""))),
TestLabel "complex_term2" (TestCase (assertEqual "" "implies(a, b)" (showDoc (SPComplexTerm {symbol= SPImplies, arguments=[simpTerm (mkSPCustomSymbol "a"), simpTerm (mkSPCustomSymbol "b")]}) "")))] | 1,236 | printTermTest = TestList [
-- empty term list not allowed!
TestLabel "quant_term1" (TestCase (assertEqual "" "forall([a], equal(a, a))" (showDoc (SPQuantTerm {quantSym= SPForall, variableList= [simpTerm (mkSPCustomSymbol "a")], qFormula= SPComplexTerm {symbol= SPEqual, arguments= [simpTerm (mkSPCustomSymbol "a"), simpTerm (mkSPCustomSymbol "a")]}}) ""))),
TestLabel "quant_term2" (TestCase (assertEqual "" "forall([a, a], equal(a, a))" (showDoc (SPQuantTerm {quantSym= SPForall, variableList= [simpTerm (mkSPCustomSymbol "a"), simpTerm (mkSPCustomSymbol "a")], qFormula= SPComplexTerm {symbol= SPEqual, arguments= [simpTerm (mkSPCustomSymbol "a"), simpTerm (mkSPCustomSymbol "a")]}}) ""))),
TestLabel "simple_term" (TestCase (assertEqual "" "testsymbol" (showDoc (simpTerm (mkSPCustomSymbol "testsymbol")) ""))),
-- empty arguments list not allowed!
TestLabel "complex_term1" (TestCase (assertEqual "" "test(a)" (showDoc (SPComplexTerm {symbol= mkSPCustomSymbol "test", arguments=[simpTerm (mkSPCustomSymbol "a")]}) ""))),
TestLabel "complex_term2" (TestCase (assertEqual "" "implies(a, b)" (showDoc (SPComplexTerm {symbol= SPImplies, arguments=[simpTerm (mkSPCustomSymbol "a"), simpTerm (mkSPCustomSymbol "b")]}) "")))] | 1,236 | false | false | 0 | 22 | 133 | 414 | 223 | 191 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-code/Language/Drasil/Code/Imperative/WriteInput.hs | bsd-2-clause | getMtxLists _ = error "makeInputFile encountered unexpected type, expected matrix" | 82 | getMtxLists _ = error "makeInputFile encountered unexpected type, expected matrix" | 82 | getMtxLists _ = error "makeInputFile encountered unexpected type, expected matrix" | 82 | false | false | 0 | 4 | 9 | 13 | 5 | 8 | null | null |
ddssff/pandoc | pandoc.hs | gpl-2.0 | defaultReaderName fallback (x:xs) =
case takeExtension (map toLower x) of
".xhtml" -> "html"
".html" -> "html"
".htm" -> "html"
".tex" -> "latex"
".latex" -> "latex"
".ltx" -> "latex"
".rst" -> "rst"
".org" -> "org"
".lhs" -> "markdown+lhs"
".db" -> "docbook"
".opml" -> "opml"
".wiki" -> "mediawiki"
".dokuwiki" -> "dokuwiki"
".textile" -> "textile"
".native" -> "native"
".json" -> "json"
".docx" -> "docx"
".t2t" -> "t2t"
".epub" -> "epub"
".odt" -> "odt"
".pdf" -> "pdf" -- so we get an "unknown reader" error
".doc" -> "doc" -- so we get an "unknown reader" error
_ -> defaultReaderName fallback xs
-- Returns True if extension of first source is .lhs | 852 | defaultReaderName fallback (x:xs) =
case takeExtension (map toLower x) of
".xhtml" -> "html"
".html" -> "html"
".htm" -> "html"
".tex" -> "latex"
".latex" -> "latex"
".ltx" -> "latex"
".rst" -> "rst"
".org" -> "org"
".lhs" -> "markdown+lhs"
".db" -> "docbook"
".opml" -> "opml"
".wiki" -> "mediawiki"
".dokuwiki" -> "dokuwiki"
".textile" -> "textile"
".native" -> "native"
".json" -> "json"
".docx" -> "docx"
".t2t" -> "t2t"
".epub" -> "epub"
".odt" -> "odt"
".pdf" -> "pdf" -- so we get an "unknown reader" error
".doc" -> "doc" -- so we get an "unknown reader" error
_ -> defaultReaderName fallback xs
-- Returns True if extension of first source is .lhs | 852 | defaultReaderName fallback (x:xs) =
case takeExtension (map toLower x) of
".xhtml" -> "html"
".html" -> "html"
".htm" -> "html"
".tex" -> "latex"
".latex" -> "latex"
".ltx" -> "latex"
".rst" -> "rst"
".org" -> "org"
".lhs" -> "markdown+lhs"
".db" -> "docbook"
".opml" -> "opml"
".wiki" -> "mediawiki"
".dokuwiki" -> "dokuwiki"
".textile" -> "textile"
".native" -> "native"
".json" -> "json"
".docx" -> "docx"
".t2t" -> "t2t"
".epub" -> "epub"
".odt" -> "odt"
".pdf" -> "pdf" -- so we get an "unknown reader" error
".doc" -> "doc" -- so we get an "unknown reader" error
_ -> defaultReaderName fallback xs
-- Returns True if extension of first source is .lhs | 852 | false | false | 0 | 8 | 302 | 179 | 90 | 89 | null | null |
HaskVan/tiempo | src/Tiempo.hs | mit | secondsPerMinute :: Int
secondsPerMinute = 60 | 45 | secondsPerMinute :: Int
secondsPerMinute = 60 | 45 | secondsPerMinute = 60 | 21 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
dmjio/CompactMap | src/Data/CompactMap/Index.hs | bsd-3-clause | ptrToInt (Ptr addr#) = I# (addr2Int# addr#) | 43 | ptrToInt (Ptr addr#) = I# (addr2Int# addr#) | 43 | ptrToInt (Ptr addr#) = I# (addr2Int# addr#) | 43 | false | false | 0 | 6 | 6 | 25 | 11 | 14 | null | null |
nushio3/ghc | compiler/types/Type.hs | bsd-3-clause | splitPiTy :: Type -> (TyBinder, Type)
splitPiTy ty
| Just answer <- splitPiTy_maybe ty = answer
| otherwise = pprPanic "splitPiTy" (ppr ty) | 167 | splitPiTy :: Type -> (TyBinder, Type)
splitPiTy ty
| Just answer <- splitPiTy_maybe ty = answer
| otherwise = pprPanic "splitPiTy" (ppr ty) | 167 | splitPiTy ty
| Just answer <- splitPiTy_maybe ty = answer
| otherwise = pprPanic "splitPiTy" (ppr ty) | 129 | false | true | 1 | 9 | 50 | 63 | 29 | 34 | null | null |
akaihola/palindromi-haskell | src/Storyfragment.hs | mit | fragment punctuation letter | isNotAlpha letter = nonLetterError letter
| hasAlpha punctuation = nonPunctuationError punctuation
| otherwise = Fragment punctuation letter | 226 | fragment punctuation letter | isNotAlpha letter = nonLetterError letter
| hasAlpha punctuation = nonPunctuationError punctuation
| otherwise = Fragment punctuation letter | 226 | fragment punctuation letter | isNotAlpha letter = nonLetterError letter
| hasAlpha punctuation = nonPunctuationError punctuation
| otherwise = Fragment punctuation letter | 226 | false | false | 0 | 8 | 76 | 52 | 21 | 31 | null | null |
andorp/hs-bluesnap | src/Bluesnap/API/Request.hs | gpl-3.0 | elementToXMLPassword :: Xsd.XsdString -> [Content ()]
elementToXMLPassword = schemaTypeToXML "password" | 103 | elementToXMLPassword :: Xsd.XsdString -> [Content ()]
elementToXMLPassword = schemaTypeToXML "password" | 103 | elementToXMLPassword = schemaTypeToXML "password" | 49 | false | true | 0 | 8 | 9 | 28 | 14 | 14 | null | null |
nickng/gong | StuffParams.hs | apache-2.0 | unfoldType (Null) = return Null | 31 | unfoldType (Null) = return Null | 31 | unfoldType (Null) = return Null | 31 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
alang9/unsmooth-opt | src/Numeric/Optimisation/GoldenSection.hs | bsd-3-clause | -- | Golden section search, given a bracket, a minimum tolerance to pass and
-- optionally a maximum number of iterations.
searchWithBracketUntil' :: (Floating a, Ord a, Ord b, Integral c) => a
-> Maybe c -> (a -> b) -> ((a, b), (a, b), (a, b))
-> ((a, b), c)
searchWithBracketUntil' tolerance m'itmax f start = (final, numIt)
where
(numIt, (_, final, _)) =
case takeWhile limit . zip [0..] $ stepsWithBracket f start of
[] -> (0, start)
xs -> second getBracket . maybe (last xs) id $ find small xs
limit (idx, _) = maybe True (idx <=) m'itmax
small (_, ((x1, _), (x2, _), (x3, _), (x4, _))) =
abs (x4 - x1) < tolerance * (abs x2 + abs x3)
| 742 | searchWithBracketUntil' :: (Floating a, Ord a, Ord b, Integral c) => a
-> Maybe c -> (a -> b) -> ((a, b), (a, b), (a, b))
-> ((a, b), c)
searchWithBracketUntil' tolerance m'itmax f start = (final, numIt)
where
(numIt, (_, final, _)) =
case takeWhile limit . zip [0..] $ stepsWithBracket f start of
[] -> (0, start)
xs -> second getBracket . maybe (last xs) id $ find small xs
limit (idx, _) = maybe True (idx <=) m'itmax
small (_, ((x1, _), (x2, _), (x3, _), (x4, _))) =
abs (x4 - x1) < tolerance * (abs x2 + abs x3)
| 619 | searchWithBracketUntil' tolerance m'itmax f start = (final, numIt)
where
(numIt, (_, final, _)) =
case takeWhile limit . zip [0..] $ stepsWithBracket f start of
[] -> (0, start)
xs -> second getBracket . maybe (last xs) id $ find small xs
limit (idx, _) = maybe True (idx <=) m'itmax
small (_, ((x1, _), (x2, _), (x3, _), (x4, _))) =
abs (x4 - x1) < tolerance * (abs x2 + abs x3)
| 434 | true | true | 0 | 12 | 227 | 325 | 179 | 146 | null | null |
osa1/rho-torrent | src/Rho/PeerComms/PeerConnection.hs | bsd-3-clause | handleMessage :: Session -> IORef PeerConn -> B.ByteString -> IO ()
handleMessage sess peer msg = do
case parsePeerMsg msg of
Left err -> warning . concat $
[ "Can't parse peer message: ", err,
" msg: ", show msg, " msg length: ", show (B.length msg) ]
Right msg' -> handleMessage' sess peer msg' | 330 | handleMessage :: Session -> IORef PeerConn -> B.ByteString -> IO ()
handleMessage sess peer msg = do
case parsePeerMsg msg of
Left err -> warning . concat $
[ "Can't parse peer message: ", err,
" msg: ", show msg, " msg length: ", show (B.length msg) ]
Right msg' -> handleMessage' sess peer msg' | 330 | handleMessage sess peer msg = do
case parsePeerMsg msg of
Left err -> warning . concat $
[ "Can't parse peer message: ", err,
" msg: ", show msg, " msg length: ", show (B.length msg) ]
Right msg' -> handleMessage' sess peer msg' | 262 | false | true | 0 | 16 | 88 | 121 | 57 | 64 | null | null |
sgillespie/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | genericWordAdd2Op :: GenericOp
genericWordAdd2Op [res_h, res_l] [arg_x, arg_y]
= do dflags <- getDynFlags
r1 <- newTemp (cmmExprType dflags arg_x)
r2 <- newTemp (cmmExprType dflags arg_x)
let topHalf x = CmmMachOp (MO_U_Shr (wordWidth dflags)) [x, hww]
toTopHalf x = CmmMachOp (MO_Shl (wordWidth dflags)) [x, hww]
bottomHalf x = CmmMachOp (MO_And (wordWidth dflags)) [x, hwm]
add x y = CmmMachOp (MO_Add (wordWidth dflags)) [x, y]
or x y = CmmMachOp (MO_Or (wordWidth dflags)) [x, y]
hww = CmmLit (CmmInt (fromIntegral (widthInBits (halfWordWidth dflags)))
(wordWidth dflags))
hwm = CmmLit (CmmInt (halfWordMask dflags) (wordWidth dflags))
emit $ catAGraphs
[mkAssign (CmmLocal r1)
(add (bottomHalf arg_x) (bottomHalf arg_y)),
mkAssign (CmmLocal r2)
(add (topHalf (CmmReg (CmmLocal r1)))
(add (topHalf arg_x) (topHalf arg_y))),
mkAssign (CmmLocal res_h)
(topHalf (CmmReg (CmmLocal r2))),
mkAssign (CmmLocal res_l)
(or (toTopHalf (CmmReg (CmmLocal r2)))
(bottomHalf (CmmReg (CmmLocal r1))))] | 1,260 | genericWordAdd2Op :: GenericOp
genericWordAdd2Op [res_h, res_l] [arg_x, arg_y]
= do dflags <- getDynFlags
r1 <- newTemp (cmmExprType dflags arg_x)
r2 <- newTemp (cmmExprType dflags arg_x)
let topHalf x = CmmMachOp (MO_U_Shr (wordWidth dflags)) [x, hww]
toTopHalf x = CmmMachOp (MO_Shl (wordWidth dflags)) [x, hww]
bottomHalf x = CmmMachOp (MO_And (wordWidth dflags)) [x, hwm]
add x y = CmmMachOp (MO_Add (wordWidth dflags)) [x, y]
or x y = CmmMachOp (MO_Or (wordWidth dflags)) [x, y]
hww = CmmLit (CmmInt (fromIntegral (widthInBits (halfWordWidth dflags)))
(wordWidth dflags))
hwm = CmmLit (CmmInt (halfWordMask dflags) (wordWidth dflags))
emit $ catAGraphs
[mkAssign (CmmLocal r1)
(add (bottomHalf arg_x) (bottomHalf arg_y)),
mkAssign (CmmLocal r2)
(add (topHalf (CmmReg (CmmLocal r1)))
(add (topHalf arg_x) (topHalf arg_y))),
mkAssign (CmmLocal res_h)
(topHalf (CmmReg (CmmLocal r2))),
mkAssign (CmmLocal res_l)
(or (toTopHalf (CmmReg (CmmLocal r2)))
(bottomHalf (CmmReg (CmmLocal r1))))] | 1,260 | genericWordAdd2Op [res_h, res_l] [arg_x, arg_y]
= do dflags <- getDynFlags
r1 <- newTemp (cmmExprType dflags arg_x)
r2 <- newTemp (cmmExprType dflags arg_x)
let topHalf x = CmmMachOp (MO_U_Shr (wordWidth dflags)) [x, hww]
toTopHalf x = CmmMachOp (MO_Shl (wordWidth dflags)) [x, hww]
bottomHalf x = CmmMachOp (MO_And (wordWidth dflags)) [x, hwm]
add x y = CmmMachOp (MO_Add (wordWidth dflags)) [x, y]
or x y = CmmMachOp (MO_Or (wordWidth dflags)) [x, y]
hww = CmmLit (CmmInt (fromIntegral (widthInBits (halfWordWidth dflags)))
(wordWidth dflags))
hwm = CmmLit (CmmInt (halfWordMask dflags) (wordWidth dflags))
emit $ catAGraphs
[mkAssign (CmmLocal r1)
(add (bottomHalf arg_x) (bottomHalf arg_y)),
mkAssign (CmmLocal r2)
(add (topHalf (CmmReg (CmmLocal r1)))
(add (topHalf arg_x) (topHalf arg_y))),
mkAssign (CmmLocal res_h)
(topHalf (CmmReg (CmmLocal r2))),
mkAssign (CmmLocal res_l)
(or (toTopHalf (CmmReg (CmmLocal r2)))
(bottomHalf (CmmReg (CmmLocal r1))))] | 1,229 | false | true | 0 | 18 | 403 | 496 | 248 | 248 | null | null |
MerelyAPseudonym/cmdtheline | src/System/Console/CmdTheLine/Manpage.hs | mit | printPlainPage :: Subst -> Handle -> Page -> IO ()
printPlainPage subst h ( _, blocks ) =
hPutStrLn h $ prepPlainBlocks subst blocks | 134 | printPlainPage :: Subst -> Handle -> Page -> IO ()
printPlainPage subst h ( _, blocks ) =
hPutStrLn h $ prepPlainBlocks subst blocks | 134 | printPlainPage subst h ( _, blocks ) =
hPutStrLn h $ prepPlainBlocks subst blocks | 83 | false | true | 2 | 10 | 25 | 60 | 27 | 33 | null | null |
Sokal21/GoblinBurner | src/Interface.hs | bsd-3-clause | skilatr_list :: Env -> Integer -> String
skilatr_list [] n = "\n" | 65 | skilatr_list :: Env -> Integer -> String
skilatr_list [] n = "\n" | 65 | skilatr_list [] n = "\n" | 24 | false | true | 0 | 9 | 11 | 32 | 14 | 18 | null | null |
utsav2601/cmpe295A | hake/HakeTypes.hs | mit | frArch (NoDep _ a _ ) = a | 25 | frArch (NoDep _ a _ ) = a | 25 | frArch (NoDep _ a _ ) = a | 25 | false | false | 0 | 7 | 7 | 19 | 9 | 10 | null | null |
kojiromike/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | isTypeConst :: Const -> Bool
isTypeConst (AType _) = True | 57 | isTypeConst :: Const -> Bool
isTypeConst (AType _) = True | 57 | isTypeConst (AType _) = True | 28 | false | true | 0 | 6 | 9 | 28 | 13 | 15 | null | null |
athanclark/lh-bug | deps/unordered-containers/Data/HashMap/Base.hs | bsd-3-clause | ------------------------------------------------------------------------
-- * Transformations
-- | /O(n)/ Transform this map by applying a function to every value.
mapWithKey :: (k -> v1 -> v2) -> HashMap k v1 -> HashMap k v2
mapWithKey f = go
where
go Empty = Empty
go (Leaf h (L k v)) = Leaf h $ L k (f k v)
go (BitmapIndexed b ary) = BitmapIndexed b $ A.map' go ary
go (Full ary) = Full $ A.map' go ary
go (Collision h ary) = Collision h $
A.map' (\ (L k v) -> L k (f k v)) ary
| 531 | mapWithKey :: (k -> v1 -> v2) -> HashMap k v1 -> HashMap k v2
mapWithKey f = go
where
go Empty = Empty
go (Leaf h (L k v)) = Leaf h $ L k (f k v)
go (BitmapIndexed b ary) = BitmapIndexed b $ A.map' go ary
go (Full ary) = Full $ A.map' go ary
go (Collision h ary) = Collision h $
A.map' (\ (L k v) -> L k (f k v)) ary
| 366 | mapWithKey f = go
where
go Empty = Empty
go (Leaf h (L k v)) = Leaf h $ L k (f k v)
go (BitmapIndexed b ary) = BitmapIndexed b $ A.map' go ary
go (Full ary) = Full $ A.map' go ary
go (Collision h ary) = Collision h $
A.map' (\ (L k v) -> L k (f k v)) ary
| 304 | true | true | 3 | 11 | 146 | 227 | 106 | 121 | null | null |
j-mueller/hldb | webapp/VirtualHom/Svg.hs | bsd-3-clause | -- | The @exponent@ attribute.
exponent :: AttrTag
exponent = makeAttribute "exponent" | 86 | exponent :: AttrTag
exponent = makeAttribute "exponent" | 55 | exponent = makeAttribute "exponent" | 35 | true | true | 0 | 5 | 11 | 15 | 8 | 7 | null | null |
tjakway/ghcjvm | compiler/types/Coercion.hs | bsd-3-clause | splitForAllCo_maybe :: Coercion -> Maybe (TyVar, Coercion, Coercion)
splitForAllCo_maybe (ForAllCo tv k_co co) = Just (tv, k_co, co) | 132 | splitForAllCo_maybe :: Coercion -> Maybe (TyVar, Coercion, Coercion)
splitForAllCo_maybe (ForAllCo tv k_co co) = Just (tv, k_co, co) | 132 | splitForAllCo_maybe (ForAllCo tv k_co co) = Just (tv, k_co, co) | 63 | false | true | 0 | 7 | 17 | 56 | 29 | 27 | null | null |
leshchevds/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | -- * Job status
jobStatusQueued :: String
jobStatusQueued = Types.jobStatusToRaw JOB_STATUS_QUEUED | 99 | jobStatusQueued :: String
jobStatusQueued = Types.jobStatusToRaw JOB_STATUS_QUEUED | 82 | jobStatusQueued = Types.jobStatusToRaw JOB_STATUS_QUEUED | 56 | true | true | 0 | 6 | 11 | 17 | 9 | 8 | null | null |
expipiplus1/orbit | test/Physics/Orbit/QuickCheck.hs | mit | ----------------------------------------------------------------
-- Constructing test trees
----------------------------------------------------------------
overAllClasses
:: (Random a, Arbitrary a, Num a, Ord a, Show a, Testable t)
=> (Orbit a -> t)
-> [TestTree]
overAllClasses t =
[ testProperty "circular" (\(CircularOrbit o) -> t o)
, testProperty "elliptic" (\(EllipticOrbit o) -> t o)
, testProperty "parabolic" (\(ParabolicOrbit o) -> t o)
, testProperty "hyperbolic" (\(HyperbolicOrbit o) -> t o)
] | 529 | overAllClasses
:: (Random a, Arbitrary a, Num a, Ord a, Show a, Testable t)
=> (Orbit a -> t)
-> [TestTree]
overAllClasses t =
[ testProperty "circular" (\(CircularOrbit o) -> t o)
, testProperty "elliptic" (\(EllipticOrbit o) -> t o)
, testProperty "parabolic" (\(ParabolicOrbit o) -> t o)
, testProperty "hyperbolic" (\(HyperbolicOrbit o) -> t o)
] | 371 | overAllClasses t =
[ testProperty "circular" (\(CircularOrbit o) -> t o)
, testProperty "elliptic" (\(EllipticOrbit o) -> t o)
, testProperty "parabolic" (\(ParabolicOrbit o) -> t o)
, testProperty "hyperbolic" (\(HyperbolicOrbit o) -> t o)
] | 257 | true | true | 0 | 11 | 84 | 179 | 92 | 87 | null | null |
CulpaBS/wbBach | src/Language/Futhark/Attributes.hs | bsd-3-clause | -- | @peelArray n t@ returns the type resulting from peeling the first
-- @n@ array dimensions from @t@. Returns @Nothing@ if @t@ has less
-- than @n@ dimensions.
peelArray :: ArrayShape (shape vn) =>
Int -> TypeBase shape as vn -> Maybe (TypeBase shape as vn)
peelArray 0 t = Just t | 297 | peelArray :: ArrayShape (shape vn) =>
Int -> TypeBase shape as vn -> Maybe (TypeBase shape as vn)
peelArray 0 t = Just t | 133 | peelArray 0 t = Just t | 22 | true | true | 0 | 10 | 66 | 63 | 31 | 32 | null | null |
sebfisch/incremental-sat-solver | Data/Boolean/SatSolver.hs | bsd-3-clause | simplify :: MonadPlus m => SatSolver -> m SatSolver
simplify solver = do
(cs,bs) <- runWriterT . simplifyClauses . clauses $ solver
updateSolver cs bs solver | 161 | simplify :: MonadPlus m => SatSolver -> m SatSolver
simplify solver = do
(cs,bs) <- runWriterT . simplifyClauses . clauses $ solver
updateSolver cs bs solver | 161 | simplify solver = do
(cs,bs) <- runWriterT . simplifyClauses . clauses $ solver
updateSolver cs bs solver | 109 | false | true | 0 | 10 | 29 | 63 | 30 | 33 | null | null |
myfreeweb/pcre-heavy | library/Text/Regex/PCRE/Heavy.hs | unlicense | -- | Same as =~.
(≈) = (=~) | 27 | (≈) = (=~) | 10 | (≈) = (=~) | 10 | true | false | 0 | 4 | 7 | 11 | 8 | 3 | null | null |
nukisman/elm-format-short | tests/Test/ElmSourceGenerators.hs | bsd-3-clause | moduleHeader :: Gen String
moduleHeader =
do
exports <- exportListing
withWhitespace wsRequired [ "module", "Main", "exposing", exports ] | 147 | moduleHeader :: Gen String
moduleHeader =
do
exports <- exportListing
withWhitespace wsRequired [ "module", "Main", "exposing", exports ] | 147 | moduleHeader =
do
exports <- exportListing
withWhitespace wsRequired [ "module", "Main", "exposing", exports ] | 120 | false | true | 0 | 8 | 27 | 41 | 21 | 20 | null | null |
KholdStare/stm-chunked-queues | src/Control/Concurrent/STM/TChunkedQueue.hs | bsd-3-clause | -- | @IO@ version of 'newTChunkedQueue'
newTChunkedQueueIO :: IO (TChunkedQueue a)
newTChunkedQueueIO = TChunkedQueue <$> newTVarIO (ChunkedQueue []) | 149 | newTChunkedQueueIO :: IO (TChunkedQueue a)
newTChunkedQueueIO = TChunkedQueue <$> newTVarIO (ChunkedQueue []) | 109 | newTChunkedQueueIO = TChunkedQueue <$> newTVarIO (ChunkedQueue []) | 66 | true | true | 0 | 9 | 17 | 36 | 18 | 18 | null | null |
Kinokkory/thorn | Data/Thorn/Functor.hs | bsd-3-clause | autovariance' _ _ (BasicTx _) = return () | 41 | autovariance' _ _ (BasicTx _) = return () | 41 | autovariance' _ _ (BasicTx _) = return () | 41 | false | false | 1 | 6 | 7 | 24 | 10 | 14 | null | null |
AlexeyRaga/eta | compiler/ETA/DeSugar/DsForeign.hs | bsd-3-clause | getClassCastId :: Bound -> DsM Id
getClassCastId bound
| bound == ExtendsBound = dsLookupGlobalId superCastName
| otherwise = dsLookupGlobalId unsafeCastName | 161 | getClassCastId :: Bound -> DsM Id
getClassCastId bound
| bound == ExtendsBound = dsLookupGlobalId superCastName
| otherwise = dsLookupGlobalId unsafeCastName | 161 | getClassCastId bound
| bound == ExtendsBound = dsLookupGlobalId superCastName
| otherwise = dsLookupGlobalId unsafeCastName | 127 | false | true | 0 | 8 | 23 | 52 | 22 | 30 | null | null |
brendanhay/gogol | gogol-iap/gen/Network/Google/Resource/IAP/Projects/Brands/IdentityAwareProxyClients/ResetSecret.hs | mpl-2.0 | -- | Required. Name of the Identity Aware Proxy client to that will have its
-- secret reset. In the following format:
-- projects\/{project_number\/id}\/brands\/{brand}\/identityAwareProxyClients\/{client_id}.
pbiapcrsName :: Lens' ProjectsBrandsIdentityAwareProxyClientsResetSecret Text
pbiapcrsName
= lens _pbiapcrsName (\ s a -> s{_pbiapcrsName = a}) | 356 | pbiapcrsName :: Lens' ProjectsBrandsIdentityAwareProxyClientsResetSecret Text
pbiapcrsName
= lens _pbiapcrsName (\ s a -> s{_pbiapcrsName = a}) | 145 | pbiapcrsName
= lens _pbiapcrsName (\ s a -> s{_pbiapcrsName = a}) | 67 | true | true | 1 | 9 | 41 | 48 | 24 | 24 | null | null |
neglectedvalue/xmobar-freebsd | Plugins/Monitors/Weather.hs | bsd-3-clause | formatWeather :: [WeatherInfo] -> Monitor String
formatWeather [(WI st ss y m d h w v sk tC tF dp r p)] =
do cel <- showWithColors show tC
far <- showWithColors show tF
parseTemplate [st, ss, y, m, d, h, w, v, sk, cel, far, dp, show r , show p ] | 263 | formatWeather :: [WeatherInfo] -> Monitor String
formatWeather [(WI st ss y m d h w v sk tC tF dp r p)] =
do cel <- showWithColors show tC
far <- showWithColors show tF
parseTemplate [st, ss, y, m, d, h, w, v, sk, cel, far, dp, show r , show p ] | 263 | formatWeather [(WI st ss y m d h w v sk tC tF dp r p)] =
do cel <- showWithColors show tC
far <- showWithColors show tF
parseTemplate [st, ss, y, m, d, h, w, v, sk, cel, far, dp, show r , show p ] | 214 | false | true | 0 | 9 | 70 | 137 | 72 | 65 | null | null |
tamarin-prover/tamarin-prover | lib/term/src/Term/Builtin/Convenience.hs | gpl-3.0 | li5 = LVar "i5" LSortNode 0 | 27 | li5 = LVar "i5" LSortNode 0 | 27 | li5 = LVar "i5" LSortNode 0 | 27 | false | false | 1 | 5 | 5 | 16 | 6 | 10 | null | null |
brendanhay/gogol | gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Rulesets/List.hs | mpl-2.0 | -- | Page size to load. Maximum of 100. Defaults to 10. Note: \`page_size\`
-- is just a hint and the service may choose to load less than
-- \`page_size\` due to the size of the output. To traverse all of the
-- releases, caller should iterate until the \`page_token\` is empty.
prlPageSize :: Lens' ProjectsRulesetsList (Maybe Int32)
prlPageSize
= lens _prlPageSize (\ s a -> s{_prlPageSize = a}) .
mapping _Coerce | 424 | prlPageSize :: Lens' ProjectsRulesetsList (Maybe Int32)
prlPageSize
= lens _prlPageSize (\ s a -> s{_prlPageSize = a}) .
mapping _Coerce | 144 | prlPageSize
= lens _prlPageSize (\ s a -> s{_prlPageSize = a}) .
mapping _Coerce | 88 | true | true | 1 | 9 | 79 | 62 | 31 | 31 | null | null |
amccausl/Swish | Swish/HaskellRDF/GraphTest.hs | lgpl-2.1 | v102 = LV "v102" | 17 | v102 = LV "v102" | 17 | v102 = LV "v102" | 17 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
GDCN/GDCN | GDCN_proj/dGDCN/jobs/Job1/code/Prime.hs | gpl-3.0 | squareRoot :: Integer -> Integer
squareRoot 0 = 0 | 49 | squareRoot :: Integer -> Integer
squareRoot 0 = 0 | 49 | squareRoot 0 = 0 | 16 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
ddssff/process-listlike-old | Tests/Test4.hs | mit | main =
do c <- getChar
hPutStrLn stderr ("Read one character: " ++ show c)
putChar c | 102 | main =
do c <- getChar
hPutStrLn stderr ("Read one character: " ++ show c)
putChar c | 102 | main =
do c <- getChar
hPutStrLn stderr ("Read one character: " ++ show c)
putChar c | 102 | false | false | 1 | 11 | 34 | 41 | 16 | 25 | null | null |
sdiehl/ghc | testsuite/tests/typecheck/should_compile/T2735.hs | bsd-3-clause | f s = s { s1 = (), s2 = s1 s } | 30 | f s = s { s1 = (), s2 = s1 s } | 30 | f s = s { s1 = (), s2 = s1 s } | 30 | false | false | 0 | 7 | 12 | 28 | 15 | 13 | null | null |
BurntSushi/fex | Development/Fex/Depend.hs | unlicense | mkFlagDir :: String -- ^ The long flag name.
-> String -- ^ The default directory.
-> String -- ^ The help message.
-> Experiment F.FlagSpec
mkFlagDir name def help = mkFlag name help $ F.FDir def | 226 | mkFlagDir :: String -- ^ The long flag name.
-> String -- ^ The default directory.
-> String -- ^ The help message.
-> Experiment F.FlagSpec
mkFlagDir name def help = mkFlag name help $ F.FDir def | 226 | mkFlagDir name def help = mkFlag name help $ F.FDir def | 55 | false | true | 0 | 9 | 66 | 52 | 26 | 26 | null | null |
sgillespie/ghc | compiler/basicTypes/Name.hs | bsd-3-clause | nameIsLocalOrFrom :: Module -> Name -> Bool
-- ^ Returns True if the name is
-- (a) Internal
-- (b) External but from the specified module
-- (c) External but from the 'interactive' package
--
-- The key idea is that
-- False means: the entity is defined in some other module
-- you can find the details (type, fixity, instances)
-- in some interface file
-- those details will be stored in the EPT or HPT
--
-- True means: the entity is defined in this module or earlier in
-- the GHCi session
-- you can find details (type, fixity, instances) in the
-- TcGblEnv or TcLclEnv
--
-- The isInteractiveModule part is because successive interactions of a GCHi session
-- each give rise to a fresh module (Ghci1, Ghci2, etc), but they all come
-- from the magic 'interactive' package; and all the details are kept in the
-- TcLclEnv, TcGblEnv, NOT in the HPT or EPT.
-- See Note [The interactive package] in HscTypes
nameIsLocalOrFrom from name
| Just mod <- nameModule_maybe name = from == mod || isInteractiveModule mod
| otherwise = True | 1,185 | nameIsLocalOrFrom :: Module -> Name -> Bool
nameIsLocalOrFrom from name
| Just mod <- nameModule_maybe name = from == mod || isInteractiveModule mod
| otherwise = True | 195 | nameIsLocalOrFrom from name
| Just mod <- nameModule_maybe name = from == mod || isInteractiveModule mod
| otherwise = True | 151 | true | true | 1 | 9 | 337 | 80 | 48 | 32 | null | null |
worksap-ate/aws-sdk | Cloud/AWS/Lib/Query.hs | bsd-3-clause | awsTimeFormat :: UTCTime -> ByteString
awsTimeFormat = BSC.pack . formatTime defaultTimeLocale (iso8601DateFormat $ Just "%XZ") | 127 | awsTimeFormat :: UTCTime -> ByteString
awsTimeFormat = BSC.pack . formatTime defaultTimeLocale (iso8601DateFormat $ Just "%XZ") | 127 | awsTimeFormat = BSC.pack . formatTime defaultTimeLocale (iso8601DateFormat $ Just "%XZ") | 88 | false | true | 0 | 9 | 14 | 36 | 18 | 18 | null | null |
UBMLtonGroup/timberc | src/Common.hs | bsd-3-clause | delete' ks xs = foldr delete xs ks | 52 | delete' ks xs = foldr delete xs ks | 52 | delete' ks xs = foldr delete xs ks | 52 | false | false | 0 | 5 | 25 | 18 | 8 | 10 | null | null |
sdiehl/ghc | compiler/utils/Pretty.hs | bsd-3-clause | mkNest _ NoDoc = NoDoc | 34 | mkNest _ NoDoc = NoDoc | 34 | mkNest _ NoDoc = NoDoc | 34 | false | false | 0 | 5 | 16 | 11 | 5 | 6 | null | null |
maciej-wichrowski/HsCharts | source/Graphics/HsCharts/Charts.hs | bsd-3-clause | boxPlot :: Float -- ^ Box plot width
-> Color -- ^ Box fill color
-> Axis -- ^ Vertical axis
-> [Float] -- ^ Plot data
-> Picture
boxPlot w c yAxis xs =
pictures [ line [((-0.25) * w, q0), (0.25 * w, q0)]
, line [((-0.25) * w, q4), (0.25 * w, q4)]
, line [(0, q0), (0, q1)]
, translate 0 (q1 + 0.5 * boxH) $ pictures [ color c $ rectangleSolid w boxH
, rectangleWire w boxH]
, line [(0, q3), (0, q4)]
, line [((-0.5) * w, q2), (0.5 * w, q2)] ]
where
scaledXs = sort $ map (axisScaleFn yAxis) xs
(q0, q1, q2, q3, q4) = fiveNum scaledXs
boxH = q3 - q1
-- | Renders vertical boxplots along the x-axis | 823 | boxPlot :: Float -- ^ Box plot width
-> Color -- ^ Box fill color
-> Axis -- ^ Vertical axis
-> [Float] -- ^ Plot data
-> Picture
boxPlot w c yAxis xs =
pictures [ line [((-0.25) * w, q0), (0.25 * w, q0)]
, line [((-0.25) * w, q4), (0.25 * w, q4)]
, line [(0, q0), (0, q1)]
, translate 0 (q1 + 0.5 * boxH) $ pictures [ color c $ rectangleSolid w boxH
, rectangleWire w boxH]
, line [(0, q3), (0, q4)]
, line [((-0.5) * w, q2), (0.5 * w, q2)] ]
where
scaledXs = sort $ map (axisScaleFn yAxis) xs
(q0, q1, q2, q3, q4) = fiveNum scaledXs
boxH = q3 - q1
-- | Renders vertical boxplots along the x-axis | 823 | boxPlot w c yAxis xs =
pictures [ line [((-0.25) * w, q0), (0.25 * w, q0)]
, line [((-0.25) * w, q4), (0.25 * w, q4)]
, line [(0, q0), (0, q1)]
, translate 0 (q1 + 0.5 * boxH) $ pictures [ color c $ rectangleSolid w boxH
, rectangleWire w boxH]
, line [(0, q3), (0, q4)]
, line [((-0.5) * w, q2), (0.5 * w, q2)] ]
where
scaledXs = sort $ map (axisScaleFn yAxis) xs
(q0, q1, q2, q3, q4) = fiveNum scaledXs
boxH = q3 - q1
-- | Renders vertical boxplots along the x-axis | 650 | false | true | 0 | 12 | 355 | 310 | 176 | 134 | null | null |
tweag/distributed-process | src/Control/Distributed/Process/Internal/Closure/TH.hs | bsd-3-clause | generateStatic :: Name -> [TyVarBndr] -> Type -> Q [Dec]
generateStatic n xs typ = do
staticTyp <- [t| Static |]
sequence
[ sigD (staticName n) $ do
txs <- sequence $ map typeable xs
return (ForallT xs
txs
(staticTyp `AppT` typ))
, sfnD (staticName n) [| staticLabel $(showFQN n) |]
]
where
typeable :: TyVarBndr -> Q Pred
typeable tv = classP (mkName "Typeable") [varT (tyVarBndrName tv)]
-- | Generate a serialization dictionary with name 'n' for type 'typ' | 552 | generateStatic :: Name -> [TyVarBndr] -> Type -> Q [Dec]
generateStatic n xs typ = do
staticTyp <- [t| Static |]
sequence
[ sigD (staticName n) $ do
txs <- sequence $ map typeable xs
return (ForallT xs
txs
(staticTyp `AppT` typ))
, sfnD (staticName n) [| staticLabel $(showFQN n) |]
]
where
typeable :: TyVarBndr -> Q Pred
typeable tv = classP (mkName "Typeable") [varT (tyVarBndrName tv)]
-- | Generate a serialization dictionary with name 'n' for type 'typ' | 552 | generateStatic n xs typ = do
staticTyp <- [t| Static |]
sequence
[ sigD (staticName n) $ do
txs <- sequence $ map typeable xs
return (ForallT xs
txs
(staticTyp `AppT` typ))
, sfnD (staticName n) [| staticLabel $(showFQN n) |]
]
where
typeable :: TyVarBndr -> Q Pred
typeable tv = classP (mkName "Typeable") [varT (tyVarBndrName tv)]
-- | Generate a serialization dictionary with name 'n' for type 'typ' | 495 | false | true | 0 | 16 | 172 | 177 | 90 | 87 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_SQL_OPERATOR :: Int
wxSTC_SQL_OPERATOR = 10 | 49 | wxSTC_SQL_OPERATOR :: Int
wxSTC_SQL_OPERATOR = 10 | 49 | wxSTC_SQL_OPERATOR = 10 | 23 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
siddhanathan/yi | yi-core/src/Yi/Buffer/Misc.hs | gpl-2.0 | moveToLineColB :: Int -> Int -> BufferM ()
moveToLineColB line col = gotoLn line >> moveToColB col | 98 | moveToLineColB :: Int -> Int -> BufferM ()
moveToLineColB line col = gotoLn line >> moveToColB col | 98 | moveToLineColB line col = gotoLn line >> moveToColB col | 55 | false | true | 0 | 8 | 16 | 39 | 18 | 21 | null | null |
batterseapower/core-haskell | Utilities.hs | bsd-3-clause | removeOnes :: [a] -> [[a]]
removeOnes [] = [] | 45 | removeOnes :: [a] -> [[a]]
removeOnes [] = [] | 45 | removeOnes [] = [] | 18 | false | true | 0 | 7 | 8 | 31 | 17 | 14 | null | null |
ysukhoverkhov/taplic4 | app/06_naive/Main.hs | mit | main :: IO ()
main = do
let parsed = parse example2
print parsed
let contextified = contextify <$> parsed
print contextified
let evaluated = contextified >>= eval
print evaluated | 190 | main :: IO ()
main = do
let parsed = parse example2
print parsed
let contextified = contextify <$> parsed
print contextified
let evaluated = contextified >>= eval
print evaluated | 190 | main = do
let parsed = parse example2
print parsed
let contextified = contextify <$> parsed
print contextified
let evaluated = contextified >>= eval
print evaluated | 176 | false | true | 0 | 11 | 41 | 78 | 32 | 46 | null | null |
romanb/amazonka | amazonka-cognito-sync/gen/Network/AWS/CognitoSync/ListIdentityPoolUsage.hs | mpl-2.0 | -- | The maximum number of results to be returned.
lipuMaxResults :: Lens' ListIdentityPoolUsage (Maybe Int)
lipuMaxResults = lens _lipuMaxResults (\s a -> s { _lipuMaxResults = a }) | 182 | lipuMaxResults :: Lens' ListIdentityPoolUsage (Maybe Int)
lipuMaxResults = lens _lipuMaxResults (\s a -> s { _lipuMaxResults = a }) | 131 | lipuMaxResults = lens _lipuMaxResults (\s a -> s { _lipuMaxResults = a }) | 73 | true | true | 0 | 9 | 28 | 46 | 25 | 21 | null | null |
lawrencelomax/ResultWorthy | ResultWorthy/Tests/SwiftParsers.hs | bsd-3-clause | assertDidParse :: Parser a -> String -> Assertion
assertDidParse p s = assertBool ("Did Not Parse " ++ s) (isRight (parseString p s)) | 133 | assertDidParse :: Parser a -> String -> Assertion
assertDidParse p s = assertBool ("Did Not Parse " ++ s) (isRight (parseString p s)) | 133 | assertDidParse p s = assertBool ("Did Not Parse " ++ s) (isRight (parseString p s)) | 83 | false | true | 0 | 9 | 22 | 53 | 26 | 27 | null | null |
dustinrohde/TicTacToe | src/Main.hs | lgpl-3.0 | takeTurn :: Mark -> PlayerName -> Game -> IO Game
takeTurn mark name game@(Game plays end) = do
drawGame game
cellInput@(Cell x y) <- promptForMove name
let cell = Cell (x-1) (y-1)
if isValidMove cell game then do
describeMove name cellInput
return (updateEndStatus mark cell (makeMove mark cell game))
else do
putStrLn "Invalid move. Try again."
takeTurn mark name game
-- |Draw a game on the screen. | 467 | takeTurn :: Mark -> PlayerName -> Game -> IO Game
takeTurn mark name game@(Game plays end) = do
drawGame game
cellInput@(Cell x y) <- promptForMove name
let cell = Cell (x-1) (y-1)
if isValidMove cell game then do
describeMove name cellInput
return (updateEndStatus mark cell (makeMove mark cell game))
else do
putStrLn "Invalid move. Try again."
takeTurn mark name game
-- |Draw a game on the screen. | 467 | takeTurn mark name game@(Game plays end) = do
drawGame game
cellInput@(Cell x y) <- promptForMove name
let cell = Cell (x-1) (y-1)
if isValidMove cell game then do
describeMove name cellInput
return (updateEndStatus mark cell (makeMove mark cell game))
else do
putStrLn "Invalid move. Try again."
takeTurn mark name game
-- |Draw a game on the screen. | 417 | false | true | 0 | 14 | 132 | 166 | 78 | 88 | null | null |
olorin/amazonka | amazonka-iam/gen/Network/AWS/IAM/Types.hs | mpl-2.0 | -- | The request was rejected because the provided password did not meet the
-- requirements imposed by the account password policy.
_PasswordPolicyViolationException :: AsError a => Getting (First ServiceError) a ServiceError
_PasswordPolicyViolationException =
_ServiceError . hasStatus 400 . hasCode "PasswordPolicyViolation" | 332 | _PasswordPolicyViolationException :: AsError a => Getting (First ServiceError) a ServiceError
_PasswordPolicyViolationException =
_ServiceError . hasStatus 400 . hasCode "PasswordPolicyViolation" | 199 | _PasswordPolicyViolationException =
_ServiceError . hasStatus 400 . hasCode "PasswordPolicyViolation" | 105 | true | true | 1 | 8 | 44 | 48 | 23 | 25 | null | null |
eMoflon/benchmarx | examples/familiestopersons/BenchmarxFamiliesToPersons/src/org/benchmarx/examples/familiestopersons/implementations/bigul/FamiliesToPersons.hs | gpl-3.0 | -- family name, first name, is male
extract :: (Ord a, Show a) => BiGUL (a, [a]) [a]
extract = Case
[ $(normal [| \(s, _) (v:_) -> v == s |] [| \(s, ss) -> null ss || head ss >= s |])
==> $(update [p| (x, xs) |] [p| x:xs |] [d| x = Replace; xs = Replace |])
, $(normal [| \(s, _:_) (v:_) -> v < s |] [| \(s, s':_) -> s' < s |])
==> $(rearrS [| \(s, s':ss) -> (s', (s, ss)) |])$
$(rearrV [| \(v:vs) -> (v, vs) |])$
Replace `Prod` extract
, $(adaptive [| \(s, []) (v:_) -> v < s |])
==> \(s, _) _ -> (s, [undefined])
] | 559 | extract :: (Ord a, Show a) => BiGUL (a, [a]) [a]
extract = Case
[ $(normal [| \(s, _) (v:_) -> v == s |] [| \(s, ss) -> null ss || head ss >= s |])
==> $(update [p| (x, xs) |] [p| x:xs |] [d| x = Replace; xs = Replace |])
, $(normal [| \(s, _:_) (v:_) -> v < s |] [| \(s, s':_) -> s' < s |])
==> $(rearrS [| \(s, s':ss) -> (s', (s, ss)) |])$
$(rearrV [| \(v:vs) -> (v, vs) |])$
Replace `Prod` extract
, $(adaptive [| \(s, []) (v:_) -> v < s |])
==> \(s, _) _ -> (s, [undefined])
] | 522 | extract = Case
[ $(normal [| \(s, _) (v:_) -> v == s |] [| \(s, ss) -> null ss || head ss >= s |])
==> $(update [p| (x, xs) |] [p| x:xs |] [d| x = Replace; xs = Replace |])
, $(normal [| \(s, _:_) (v:_) -> v < s |] [| \(s, s':_) -> s' < s |])
==> $(rearrS [| \(s, s':ss) -> (s', (s, ss)) |])$
$(rearrV [| \(v:vs) -> (v, vs) |])$
Replace `Prod` extract
, $(adaptive [| \(s, []) (v:_) -> v < s |])
==> \(s, _) _ -> (s, [undefined])
] | 473 | true | true | 0 | 12 | 161 | 187 | 115 | 72 | null | null |
grnet/snf-ganeti | src/Ganeti/Constants.hs | bsd-2-clause | instanceRebootFull :: String
instanceRebootFull = Types.rebootTypeToRaw RebootFull | 82 | instanceRebootFull :: String
instanceRebootFull = Types.rebootTypeToRaw RebootFull | 82 | instanceRebootFull = Types.rebootTypeToRaw RebootFull | 53 | false | true | 0 | 6 | 6 | 22 | 9 | 13 | null | null |
diogob/postgrest-ws | src/PostgresWebsockets/Middleware.hs | mit | -- | Given a secret, a function to fetch the system time, a Hasql Pool and a Multiplexer this will give you a WAI middleware.
postgresWsMiddleware :: Context -> Wai.Middleware
postgresWsMiddleware =
WS.websocketsOr WS.defaultConnectionOptions . wsApp | 252 | postgresWsMiddleware :: Context -> Wai.Middleware
postgresWsMiddleware =
WS.websocketsOr WS.defaultConnectionOptions . wsApp | 126 | postgresWsMiddleware =
WS.websocketsOr WS.defaultConnectionOptions . wsApp | 76 | true | true | 0 | 7 | 37 | 29 | 15 | 14 | null | null |
guibou/AdventOfCode2016 | src/Day9.hs | bsd-3-clause | -- SECOND problem
day' code = lengthContent code day' | 53 | day' code = lengthContent code day' | 35 | day' code = lengthContent code day' | 35 | true | false | 0 | 5 | 8 | 15 | 7 | 8 | null | null |
s9gf4ult/yesod | yesod-test/test/main.hs | mit | findBySelector_ :: HtmlLBS -> Query -> [String]
findBySelector_ x = either error id . findBySelector x | 102 | findBySelector_ :: HtmlLBS -> Query -> [String]
findBySelector_ x = either error id . findBySelector x | 102 | findBySelector_ x = either error id . findBySelector x | 54 | false | true | 0 | 7 | 15 | 37 | 18 | 19 | null | null |
grandpascorpion/canon | Math/NumberTheory/Canon.hs | gpl-3.0 | cNthDivisor n c | cNegative n || not (cIntegral n)
= Left "cNthDivisor: Both n must be integral and >= 0"
| not (canComputeDivs aC) = Left "cNthDivisor: Canon was zero, not integral or not completely factored. Can't compute"
| cHyperExpr c = nthHyper $ cToGCR aC
| otherwise = nth aC
where aC = abs c
nth Pc0 = Right n -- Zero has an infinite set of divisors. The nth divisor is just n as a Canon
nth cn = case f (cAbs n) (cToGCR cn) of
Right r -> Right $ gcrToC r
Left e -> Left e
where f Pc0 _ = Right gcr1
f _ Pg1 = Left "cNthDivisor: Bad dividend number requested."
f n' c' = case f (div n' (e + 1)) cs of -- First param is the next n
Right r -> Right $ if m == c0 then r else ((b,m):r)
e' -> e' -- Return error message
where (b,e):cs = c'
m = mod n' (e + 1)
nthHyper :: GCR_ -> Either String Canon
nthHyper x | n >= nd = Left "cNthDivisor: Bad dividend number requested of hyper expression."
| otherwise = Right $ compute n divL c1
where nd = product $ map snd divL -- Number of dividends
divL = map (\(p,e) -> (Bare p Simp, e + 1)) x
compute n' ((p,d):ds) wP | nq == 0 = newWp -- at 0, no need to continue
| otherwise = compute nq ds newWp
where (nq, m) | n' < d = (c0, n')
| cHyperExpr d && n' < 100 * d
= proc n' (0 :: Int)
| otherwise = (quotRem n' d) -- limited -- ToDo: make it smarter
newWp = if m == c0 then wP else (wP * p <^ m)
proc n2 rc | n2 < d = (makeCanon $ toInteger rc, n2)
| otherwise = proc (n2 - d) (rc + 1)
compute _ _ wP = wP
-- | Consider this to be the inverse of the cNthDivisor function. This function ignores signs
-- but both parameters must be integral. | 3,109 | cNthDivisor n c | cNegative n || not (cIntegral n)
= Left "cNthDivisor: Both n must be integral and >= 0"
| not (canComputeDivs aC) = Left "cNthDivisor: Canon was zero, not integral or not completely factored. Can't compute"
| cHyperExpr c = nthHyper $ cToGCR aC
| otherwise = nth aC
where aC = abs c
nth Pc0 = Right n -- Zero has an infinite set of divisors. The nth divisor is just n as a Canon
nth cn = case f (cAbs n) (cToGCR cn) of
Right r -> Right $ gcrToC r
Left e -> Left e
where f Pc0 _ = Right gcr1
f _ Pg1 = Left "cNthDivisor: Bad dividend number requested."
f n' c' = case f (div n' (e + 1)) cs of -- First param is the next n
Right r -> Right $ if m == c0 then r else ((b,m):r)
e' -> e' -- Return error message
where (b,e):cs = c'
m = mod n' (e + 1)
nthHyper :: GCR_ -> Either String Canon
nthHyper x | n >= nd = Left "cNthDivisor: Bad dividend number requested of hyper expression."
| otherwise = Right $ compute n divL c1
where nd = product $ map snd divL -- Number of dividends
divL = map (\(p,e) -> (Bare p Simp, e + 1)) x
compute n' ((p,d):ds) wP | nq == 0 = newWp -- at 0, no need to continue
| otherwise = compute nq ds newWp
where (nq, m) | n' < d = (c0, n')
| cHyperExpr d && n' < 100 * d
= proc n' (0 :: Int)
| otherwise = (quotRem n' d) -- limited -- ToDo: make it smarter
newWp = if m == c0 then wP else (wP * p <^ m)
proc n2 rc | n2 < d = (makeCanon $ toInteger rc, n2)
| otherwise = proc (n2 - d) (rc + 1)
compute _ _ wP = wP
-- | Consider this to be the inverse of the cNthDivisor function. This function ignores signs
-- but both parameters must be integral. | 3,109 | cNthDivisor n c | cNegative n || not (cIntegral n)
= Left "cNthDivisor: Both n must be integral and >= 0"
| not (canComputeDivs aC) = Left "cNthDivisor: Canon was zero, not integral or not completely factored. Can't compute"
| cHyperExpr c = nthHyper $ cToGCR aC
| otherwise = nth aC
where aC = abs c
nth Pc0 = Right n -- Zero has an infinite set of divisors. The nth divisor is just n as a Canon
nth cn = case f (cAbs n) (cToGCR cn) of
Right r -> Right $ gcrToC r
Left e -> Left e
where f Pc0 _ = Right gcr1
f _ Pg1 = Left "cNthDivisor: Bad dividend number requested."
f n' c' = case f (div n' (e + 1)) cs of -- First param is the next n
Right r -> Right $ if m == c0 then r else ((b,m):r)
e' -> e' -- Return error message
where (b,e):cs = c'
m = mod n' (e + 1)
nthHyper :: GCR_ -> Either String Canon
nthHyper x | n >= nd = Left "cNthDivisor: Bad dividend number requested of hyper expression."
| otherwise = Right $ compute n divL c1
where nd = product $ map snd divL -- Number of dividends
divL = map (\(p,e) -> (Bare p Simp, e + 1)) x
compute n' ((p,d):ds) wP | nq == 0 = newWp -- at 0, no need to continue
| otherwise = compute nq ds newWp
where (nq, m) | n' < d = (c0, n')
| cHyperExpr d && n' < 100 * d
= proc n' (0 :: Int)
| otherwise = (quotRem n' d) -- limited -- ToDo: make it smarter
newWp = if m == c0 then wP else (wP * p <^ m)
proc n2 rc | n2 < d = (makeCanon $ toInteger rc, n2)
| otherwise = proc (n2 - d) (rc + 1)
compute _ _ wP = wP
-- | Consider this to be the inverse of the cNthDivisor function. This function ignores signs
-- but both parameters must be integral. | 3,109 | false | false | 5 | 15 | 1,874 | 664 | 329 | 335 | null | null |
alexander-at-github/eta | compiler/ETA/Main/ErrUtils.hs | bsd-3-clause | mkPlainWarnMsg dflags locn msg = mk_err_msg dflags SevWarning locn alwaysQualify msg empty | 103 | mkPlainWarnMsg dflags locn msg = mk_err_msg dflags SevWarning locn alwaysQualify msg empty | 103 | mkPlainWarnMsg dflags locn msg = mk_err_msg dflags SevWarning locn alwaysQualify msg empty | 103 | false | false | 0 | 5 | 24 | 26 | 12 | 14 | null | null |
erochest/ribot | src/Database/Ribot.hs | bsd-3-clause | withResourceLogger :: LoggingT (ResourceT IO) a -> IO a
withResourceLogger = runResourceT . runStderrLoggingT | 109 | withResourceLogger :: LoggingT (ResourceT IO) a -> IO a
withResourceLogger = runResourceT . runStderrLoggingT | 109 | withResourceLogger = runResourceT . runStderrLoggingT | 53 | false | true | 0 | 9 | 13 | 39 | 17 | 22 | null | null |
pminten/xhaskell | sieve/example.hs | mit | primesUpTo :: Int -> [Int]
primesUpTo upperBound = V.ifoldr f [] $ V.create $ do
mv <- MV.replicate (1 + upperBound) (1 :: Int)
when (upperBound >= 0) $ MV.write mv 0 0
when (upperBound >= 1) $ MV.write mv 1 0
go mv 2
where
f n 1 acc = n:acc
f _ _ acc = acc
go mv n | n > upperBound = return mv
| otherwise = do
nPrime <- MV.read mv n
when (nPrime == 1) $
mapM_ (flip (MV.write mv) 0) [n+n, n+n+n .. upperBound]
go mv (n + 1) | 522 | primesUpTo :: Int -> [Int]
primesUpTo upperBound = V.ifoldr f [] $ V.create $ do
mv <- MV.replicate (1 + upperBound) (1 :: Int)
when (upperBound >= 0) $ MV.write mv 0 0
when (upperBound >= 1) $ MV.write mv 1 0
go mv 2
where
f n 1 acc = n:acc
f _ _ acc = acc
go mv n | n > upperBound = return mv
| otherwise = do
nPrime <- MV.read mv n
when (nPrime == 1) $
mapM_ (flip (MV.write mv) 0) [n+n, n+n+n .. upperBound]
go mv (n + 1) | 522 | primesUpTo upperBound = V.ifoldr f [] $ V.create $ do
mv <- MV.replicate (1 + upperBound) (1 :: Int)
when (upperBound >= 0) $ MV.write mv 0 0
when (upperBound >= 1) $ MV.write mv 1 0
go mv 2
where
f n 1 acc = n:acc
f _ _ acc = acc
go mv n | n > upperBound = return mv
| otherwise = do
nPrime <- MV.read mv n
when (nPrime == 1) $
mapM_ (flip (MV.write mv) 0) [n+n, n+n+n .. upperBound]
go mv (n + 1) | 495 | false | true | 4 | 15 | 192 | 296 | 135 | 161 | null | null |
blamario/grampa | grammatical-parsers/src/Text/Grampa/ContextFree/LeftRecursive.hs | bsd-2-clause | general, general' :: Alternative (p g s) => Fixed p g s a -> Fixed p g s a
general p = Parser{
complete= complete p,
direct = direct p',
direct0= direct0 p',
direct1= direct1 p',
indirect= indirect p',
isAmbiguous= case p
of Parser{isAmbiguous= a} -> a
_ -> Nothing,
cyclicDescendants= cyclicDescendants p'}
where p' = general' p | 389 | general, general' :: Alternative (p g s) => Fixed p g s a -> Fixed p g s a
general p = Parser{
complete= complete p,
direct = direct p',
direct0= direct0 p',
direct1= direct1 p',
indirect= indirect p',
isAmbiguous= case p
of Parser{isAmbiguous= a} -> a
_ -> Nothing,
cyclicDescendants= cyclicDescendants p'}
where p' = general' p | 388 | general p = Parser{
complete= complete p,
direct = direct p',
direct0= direct0 p',
direct1= direct1 p',
indirect= indirect p',
isAmbiguous= case p
of Parser{isAmbiguous= a} -> a
_ -> Nothing,
cyclicDescendants= cyclicDescendants p'}
where p' = general' p | 313 | false | true | 2 | 12 | 117 | 155 | 79 | 76 | null | null |
ekmett/ghc | compiler/main/DynFlags.hs | bsd-3-clause | wayExtras _ WayGran dflags = exposePackage' "concurrent" dflags | 67 | wayExtras _ WayGran dflags = exposePackage' "concurrent" dflags | 67 | wayExtras _ WayGran dflags = exposePackage' "concurrent" dflags | 67 | false | false | 1 | 5 | 11 | 18 | 7 | 11 | null | null |
UU-ComputerScience/uulib | src/UU/Parsing/Offside.hs | bsd-3-clause | pSeparator :: (OutputState o, InputState i s p, Position p, Symbol s, Ord s)
=> OffsideParser i o s p ()
pSeparator = OP (() <$ pCostSym 5# SemiColon SemiColon) | 172 | pSeparator :: (OutputState o, InputState i s p, Position p, Symbol s, Ord s)
=> OffsideParser i o s p ()
pSeparator = OP (() <$ pCostSym 5# SemiColon SemiColon) | 172 | pSeparator = OP (() <$ pCostSym 5# SemiColon SemiColon) | 55 | false | true | 0 | 8 | 41 | 80 | 40 | 40 | null | null |
qpliu/esolang | blo/hs/LLVMGen.hs | gpl-3.0 | writeLabelRef :: Gen g => Label -> g ()
writeLabelRef (Label l) = writeCode ("%l" ++ show l) | 92 | writeLabelRef :: Gen g => Label -> g ()
writeLabelRef (Label l) = writeCode ("%l" ++ show l) | 92 | writeLabelRef (Label l) = writeCode ("%l" ++ show l) | 52 | false | true | 0 | 10 | 17 | 53 | 24 | 29 | null | null |
elliottt/din | src/Watch.hs | bsd-3-clause | eventTypes :: [EventVariety]
eventTypes =
[ Create
, Delete
, MoveIn
, MoveOut
] | 91 | eventTypes :: [EventVariety]
eventTypes =
[ Create
, Delete
, MoveIn
, MoveOut
] | 91 | eventTypes =
[ Create
, Delete
, MoveIn
, MoveOut
] | 62 | false | true | 0 | 7 | 24 | 33 | 17 | 16 | null | null |
ti1024/hacq | examples/grover.hs | bsd-3-clause | uniqueSolutionOracle :: MonadQuantum w m => Seq Bool -> Seq (Bit w) -> m ()
uniqueSolutionOracle solution ws =
controls (Seq.zipWith (\w s -> if s then w else negateBit w) ws solution) negateGlobalPhase | 206 | uniqueSolutionOracle :: MonadQuantum w m => Seq Bool -> Seq (Bit w) -> m ()
uniqueSolutionOracle solution ws =
controls (Seq.zipWith (\w s -> if s then w else negateBit w) ws solution) negateGlobalPhase | 206 | uniqueSolutionOracle solution ws =
controls (Seq.zipWith (\w s -> if s then w else negateBit w) ws solution) negateGlobalPhase | 130 | false | true | 0 | 11 | 37 | 93 | 44 | 49 | null | null |
ocharles/hackage-server | Distribution/Server/Features/Upload/State.hs | bsd-3-clause | removeHackageUploader :: UserId -> Update HackageUploaders ()
removeHackageUploader uid = modifyHackageUploaders (Group.delete uid) | 131 | removeHackageUploader :: UserId -> Update HackageUploaders ()
removeHackageUploader uid = modifyHackageUploaders (Group.delete uid) | 131 | removeHackageUploader uid = modifyHackageUploaders (Group.delete uid) | 69 | false | true | 0 | 8 | 12 | 36 | 17 | 19 | null | null |
byorgey/Idris-dev | src/Core/TT.hs | bsd-3-clause | nsroot (NS n _) = n | 19 | nsroot (NS n _) = n | 19 | nsroot (NS n _) = n | 19 | false | false | 0 | 6 | 5 | 18 | 8 | 10 | null | null |
utky/lycopene | src/Lycopene/Lens.hs | apache-2.0 | set :: Lens a b -> b -> a -> a
set l b = over l (const b) | 57 | set :: Lens a b -> b -> a -> a
set l b = over l (const b) | 57 | set l b = over l (const b) | 26 | false | true | 0 | 9 | 18 | 49 | 22 | 27 | null | null |
hguenther/smtlib2 | Language/SMTLib2/Internals/Expression.hs | gpl-3.0 | mapFunction _ (Divisible x) = pure (Divisible x) | 48 | mapFunction _ (Divisible x) = pure (Divisible x) | 48 | mapFunction _ (Divisible x) = pure (Divisible x) | 48 | false | false | 1 | 7 | 7 | 28 | 12 | 16 | null | null |
HIPERFIT/futhark | src/Language/Futhark/TypeChecker/Types.hs | isc | evalTypeExp (TEArrow (Just v) t1 t2 loc) = do
(t1', svars1, RetType dims1 st1, _) <- evalTypeExp t1
bindSpaced [(Term, v)] $ do
v' <- checkName Term v loc
bindVal v' (BoundV [] st1) $ do
(t2', svars2, RetType dims2 st2, _) <- evalTypeExp t2
pure
( TEArrow (Just v') t1' t2' loc,
svars1 ++ dims1 ++ svars2,
RetType [] $ Scalar $ Arrow mempty (Named v') st1 (RetType dims2 st2),
Lifted
)
-- | 458 | evalTypeExp (TEArrow (Just v) t1 t2 loc) = do
(t1', svars1, RetType dims1 st1, _) <- evalTypeExp t1
bindSpaced [(Term, v)] $ do
v' <- checkName Term v loc
bindVal v' (BoundV [] st1) $ do
(t2', svars2, RetType dims2 st2, _) <- evalTypeExp t2
pure
( TEArrow (Just v') t1' t2' loc,
svars1 ++ dims1 ++ svars2,
RetType [] $ Scalar $ Arrow mempty (Named v') st1 (RetType dims2 st2),
Lifted
)
-- | 458 | evalTypeExp (TEArrow (Just v) t1 t2 loc) = do
(t1', svars1, RetType dims1 st1, _) <- evalTypeExp t1
bindSpaced [(Term, v)] $ do
v' <- checkName Term v loc
bindVal v' (BoundV [] st1) $ do
(t2', svars2, RetType dims2 st2, _) <- evalTypeExp t2
pure
( TEArrow (Just v') t1' t2' loc,
svars1 ++ dims1 ++ svars2,
RetType [] $ Scalar $ Arrow mempty (Named v') st1 (RetType dims2 st2),
Lifted
)
-- | 458 | false | false | 0 | 18 | 143 | 215 | 106 | 109 | null | null |
charlydagos/bonlang | src/Bonlang/Lexer.hs | mit | functionDef :: (String -> [String] -> BonlangParsec u a) -> BonlangParsec u a
functionDef f = Parsec.try $ do reserved "def"
funName <- lexeme identifier
funParams <- lexeme paramsList
_ <- lexeme $ Parsec.char '='
Parsec.try $ f funName funParams | 377 | functionDef :: (String -> [String] -> BonlangParsec u a) -> BonlangParsec u a
functionDef f = Parsec.try $ do reserved "def"
funName <- lexeme identifier
funParams <- lexeme paramsList
_ <- lexeme $ Parsec.char '='
Parsec.try $ f funName funParams | 377 | functionDef f = Parsec.try $ do reserved "def"
funName <- lexeme identifier
funParams <- lexeme paramsList
_ <- lexeme $ Parsec.char '='
Parsec.try $ f funName funParams | 299 | false | true | 2 | 11 | 169 | 110 | 48 | 62 | null | null |
rbtcollins/scratchpad | Auth.hs | apache-2.0 | tempOrAccessToken :: IO Token
tempOrAccessToken =
runSqlite serverFile $ do
maybeServer <- getBy $ UniqueServer "Launchpad"
case maybeServer of
Nothing -> do
temp_creds <- trace "requesting temporary credentials" (withManager $ \manager -> OA.getTemporaryCredential lpoauth manager)
-- TODO: have something report on pending tokens for users - e.g. in a web UI
let msg = "New token requested, authorise at " ++ show (OA.authorizeUrl lpoauth temp_creds)
_ <- insert $ trace msg (Server "Launchpad" (Temporary temp_creds))
return $ Temporary temp_creds
Just (Entity _ (Server _ temp_creds)) -> trace ("using cached credentials " ++ safeShowToken temp_creds) $ return temp_creds | 798 | tempOrAccessToken :: IO Token
tempOrAccessToken =
runSqlite serverFile $ do
maybeServer <- getBy $ UniqueServer "Launchpad"
case maybeServer of
Nothing -> do
temp_creds <- trace "requesting temporary credentials" (withManager $ \manager -> OA.getTemporaryCredential lpoauth manager)
-- TODO: have something report on pending tokens for users - e.g. in a web UI
let msg = "New token requested, authorise at " ++ show (OA.authorizeUrl lpoauth temp_creds)
_ <- insert $ trace msg (Server "Launchpad" (Temporary temp_creds))
return $ Temporary temp_creds
Just (Entity _ (Server _ temp_creds)) -> trace ("using cached credentials " ++ safeShowToken temp_creds) $ return temp_creds | 798 | tempOrAccessToken =
runSqlite serverFile $ do
maybeServer <- getBy $ UniqueServer "Launchpad"
case maybeServer of
Nothing -> do
temp_creds <- trace "requesting temporary credentials" (withManager $ \manager -> OA.getTemporaryCredential lpoauth manager)
-- TODO: have something report on pending tokens for users - e.g. in a web UI
let msg = "New token requested, authorise at " ++ show (OA.authorizeUrl lpoauth temp_creds)
_ <- insert $ trace msg (Server "Launchpad" (Temporary temp_creds))
return $ Temporary temp_creds
Just (Entity _ (Server _ temp_creds)) -> trace ("using cached credentials " ++ safeShowToken temp_creds) $ return temp_creds | 768 | false | true | 2 | 20 | 219 | 198 | 90 | 108 | null | null |
ben-schulz/Idris-dev | src/Idris/Error.hs | bsd-3-clause | warnDisamb ist (PPatvar _ _) = return () | 40 | warnDisamb ist (PPatvar _ _) = return () | 40 | warnDisamb ist (PPatvar _ _) = return () | 40 | false | false | 0 | 7 | 7 | 24 | 11 | 13 | null | null |
ocean0yohsuke/deepcontrol | test/unit_Monad-Level2.hs | bsd-3-clause | poland_calc :: [String] -> (Double, [Double])
poland_calc xs = (sinkmap poland xs >> pop) >- \x -> runState x [] | 112 | poland_calc :: [String] -> (Double, [Double])
poland_calc xs = (sinkmap poland xs >> pop) >- \x -> runState x [] | 112 | poland_calc xs = (sinkmap poland xs >> pop) >- \x -> runState x [] | 66 | false | true | 0 | 8 | 19 | 58 | 31 | 27 | null | null |
gleber/erlhask | src/Language/Erlang/Bif/Erlang.hs | apache-2.0 | erlang_is_integer _ = bif_badarg_num | 36 | erlang_is_integer _ = bif_badarg_num | 36 | erlang_is_integer _ = bif_badarg_num | 36 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
adarqui/Codex | src/Codex/Lib/Network/TCP/EchoServer.hs | bsd-3-clause | cb'echo :: Handle -> Int -> IO ()
cb'echo h id' = do
l <- hGetLine h
hPutStrLn h l
cb'echo h id' | 99 | cb'echo :: Handle -> Int -> IO ()
cb'echo h id' = do
l <- hGetLine h
hPutStrLn h l
cb'echo h id' | 99 | cb'echo h id' = do
l <- hGetLine h
hPutStrLn h l
cb'echo h id' | 65 | false | true | 0 | 8 | 25 | 55 | 24 | 31 | null | null |
mightymoose/liquidhaskell | tests/pos/LambdaEvalSuperTiny.hs | bsd-3-clause | {-@
data Expr [elen]
= Lam (x::Bndr) (e::Expr)
| Var (x::Bndr)
| App (e1::Expr) (e2::Expr)
@-}
{-@ measure elen :: Expr -> Int
elen(Var x) = 0
elen(Lam x e) = 1 + (elen e)
elen(App e1 e2) = 1 + (elen e1) + (elen e2)
@-}
{-@ invariant {v:Expr | (elen v) >= 0} @-}
{-@ measure isValue :: Expr -> Prop
isValue (Lam x e) = true
isValue (Var x) = false
isValue (App e1 e2) = false
@-}
{-@ type Value = {v: Expr | (isValue v) } @-}
{-@ type Store = LL (Pair Bndr Value) @-}
---------------------------------------------------------------------
-------------------------- The Evaluator ----------------------------
---------------------------------------------------------------------
{-@ evalVar :: Bndr -> Store -> Value @-}
evalVar :: Bndr -> LL (Pair Bndr Expr) -> Expr
evalVar = error "HIDEME" | 863 | evalVar :: Bndr -> LL (Pair Bndr Expr) -> Expr
evalVar = error "HIDEME" | 71 | evalVar = error "HIDEME" | 24 | true | true | 0 | 9 | 201 | 43 | 26 | 17 | null | null |
nyaxt/dmix | nkmd/as/Insn.hs | mit | show1 MNone = "-" | 17 | show1 MNone = "-" | 17 | show1 MNone = "-" | 17 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
mettekou/ghc | compiler/types/TyCoRep.hs | bsd-3-clause | tyCoVarsOfTypesSet :: TyVarEnv Type -> TyCoVarSet
-- See Note [Free variables of types]
tyCoVarsOfTypesSet tys = fvVarSet $ tyCoFVsOfTypes $ nonDetEltsUFM tys | 158 | tyCoVarsOfTypesSet :: TyVarEnv Type -> TyCoVarSet
tyCoVarsOfTypesSet tys = fvVarSet $ tyCoFVsOfTypes $ nonDetEltsUFM tys | 120 | tyCoVarsOfTypesSet tys = fvVarSet $ tyCoFVsOfTypes $ nonDetEltsUFM tys | 70 | true | true | 0 | 6 | 21 | 33 | 16 | 17 | null | null |
lpeterse/koka | src/Core/Pretty.hs | apache-2.0 | -- Extend an import map with nice aliases for a set of new imports
extendImportMap :: [Import] -> ImportMap -> ImportMap
extendImportMap imports impMap
= foldr extend impMap imports
where
extend imp impMap
= let fullName = importName imp in
case importsExtend fullName fullName impMap of
Just newMap -> newMap
Nothing -> impMap -- already imported ?
-- extract all qualifiers in synonyms: it can be the case that a type synonym
-- refers to a type defined in a non-imported module and we need to add it to the
-- imports of the .kki file. (no need to add it to the generated code since
-- javascript does not use types, while c-sharp does not use import declarations but fully
-- qualified names all the time) | 770 | extendImportMap :: [Import] -> ImportMap -> ImportMap
extendImportMap imports impMap
= foldr extend impMap imports
where
extend imp impMap
= let fullName = importName imp in
case importsExtend fullName fullName impMap of
Just newMap -> newMap
Nothing -> impMap -- already imported ?
-- extract all qualifiers in synonyms: it can be the case that a type synonym
-- refers to a type defined in a non-imported module and we need to add it to the
-- imports of the .kki file. (no need to add it to the generated code since
-- javascript does not use types, while c-sharp does not use import declarations but fully
-- qualified names all the time) | 701 | extendImportMap imports impMap
= foldr extend impMap imports
where
extend imp impMap
= let fullName = importName imp in
case importsExtend fullName fullName impMap of
Just newMap -> newMap
Nothing -> impMap -- already imported ?
-- extract all qualifiers in synonyms: it can be the case that a type synonym
-- refers to a type defined in a non-imported module and we need to add it to the
-- imports of the .kki file. (no need to add it to the generated code since
-- javascript does not use types, while c-sharp does not use import declarations but fully
-- qualified names all the time) | 647 | true | true | 0 | 10 | 187 | 94 | 48 | 46 | null | null |
kylcarte/wangtiles | src/Texture.hs | bsd-3-clause | dynamicImageSize :: Texture -> Size Int
dynamicImageSize img = mkSize (imageWidth img) (imageHeight img) | 104 | dynamicImageSize :: Texture -> Size Int
dynamicImageSize img = mkSize (imageWidth img) (imageHeight img) | 104 | dynamicImageSize img = mkSize (imageWidth img) (imageHeight img) | 64 | false | true | 0 | 7 | 13 | 38 | 18 | 20 | null | null |
nikki-and-the-robots/nikki | src/Base/Types.hs | lgpl-3.0 | isPassedScore Score_1_Passed{} = True | 37 | isPassedScore Score_1_Passed{} = True | 37 | isPassedScore Score_1_Passed{} = True | 37 | false | false | 0 | 6 | 3 | 13 | 6 | 7 | null | null |
nugarstu/projectX | shoot.hs | apache-2.0 | --drop' x [] = []
--drop' x : ()
or' [] = False | 48 | or' [] = False | 14 | or' [] = False | 14 | true | false | 0 | 6 | 13 | 13 | 7 | 6 | null | null |
GaloisInc/halvm-ghc | compiler/basicTypes/OccName.hs | bsd-3-clause | isDataOcc (OccName DataName _) = True | 37 | isDataOcc (OccName DataName _) = True | 37 | isDataOcc (OccName DataName _) = True | 37 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
dag/kibr | src/Text/Kibr/Html.hs | bsd-2-clause | dictionaryRouter :: Env.Reader (Dictionary -> Text)
dictionaryRouter =
do
lang <- asks Env.language
router <- asks Env.router
return $ \x -> router (Dictionary lang x) [] | 186 | dictionaryRouter :: Env.Reader (Dictionary -> Text)
dictionaryRouter =
do
lang <- asks Env.language
router <- asks Env.router
return $ \x -> router (Dictionary lang x) [] | 186 | dictionaryRouter =
do
lang <- asks Env.language
router <- asks Env.router
return $ \x -> router (Dictionary lang x) [] | 134 | false | true | 0 | 11 | 41 | 74 | 35 | 39 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.