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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
andyarvanitis/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | runIdeSlaveCommand h id orig fn modes (IdeSlave.ErrString e) =
do ist <- getIState
let out = displayS . renderPretty 1.0 60 $ pprintErr ist e
msg = (IdeSlave.SymbolAtom "ok", IdeSlave.StringAtom $ out "")
runIO . hPutStrLn h $ IdeSlave.convSExp "return" msg id | 281 | runIdeSlaveCommand h id orig fn modes (IdeSlave.ErrString e) =
do ist <- getIState
let out = displayS . renderPretty 1.0 60 $ pprintErr ist e
msg = (IdeSlave.SymbolAtom "ok", IdeSlave.StringAtom $ out "")
runIO . hPutStrLn h $ IdeSlave.convSExp "return" msg id | 281 | runIdeSlaveCommand h id orig fn modes (IdeSlave.ErrString e) =
do ist <- getIState
let out = displayS . renderPretty 1.0 60 $ pprintErr ist e
msg = (IdeSlave.SymbolAtom "ok", IdeSlave.StringAtom $ out "")
runIO . hPutStrLn h $ IdeSlave.convSExp "return" msg id | 281 | false | false | 0 | 12 | 62 | 115 | 51 | 64 | null | null |
aninhumer/mantle | src/Data/Vector/Bit.hs | bsd-3-clause | zipPad :: BitVector -> BitVector -> V.Vector (Bool, Bool)
zipPad xs ys = uncurry V.zip (padMax xs ys) | 101 | zipPad :: BitVector -> BitVector -> V.Vector (Bool, Bool)
zipPad xs ys = uncurry V.zip (padMax xs ys) | 101 | zipPad xs ys = uncurry V.zip (padMax xs ys) | 43 | false | true | 0 | 8 | 17 | 50 | 25 | 25 | null | null |
ony/exherbo-cabal | src/doctests.hs | gpl-2.0 | optarg x ys = x : intersperse x ys | 34 | optarg x ys = x : intersperse x ys | 34 | optarg x ys = x : intersperse x ys | 34 | false | false | 3 | 5 | 8 | 25 | 9 | 16 | null | null |
Cahu/krpc-hs | src/KRPCHS/SpaceCenter.hs | gpl-3.0 | getPartDryMassStreamReq :: KRPCHS.SpaceCenter.Part -> KRPCStreamReq (Double)
getPartDryMassStreamReq thisArg =
let req = makeRequest "SpaceCenter" "Part_get_DryMass" [makeArgument 0 thisArg]
in makeStream req | 217 | getPartDryMassStreamReq :: KRPCHS.SpaceCenter.Part -> KRPCStreamReq (Double)
getPartDryMassStreamReq thisArg =
let req = makeRequest "SpaceCenter" "Part_get_DryMass" [makeArgument 0 thisArg]
in makeStream req | 217 | getPartDryMassStreamReq thisArg =
let req = makeRequest "SpaceCenter" "Part_get_DryMass" [makeArgument 0 thisArg]
in makeStream req | 140 | false | true | 0 | 11 | 29 | 61 | 28 | 33 | null | null |
joshcough/Scrabble | test/Scrabble/Move/WordPutTests.hs | mit | case_use_two_blanks_H = quickPut_H "HE_L_" [L, O] @?= (at (7,7) horz [l H, l E, b L, l L, b O]) | 96 | case_use_two_blanks_H = quickPut_H "HE_L_" [L, O] @?= (at (7,7) horz [l H, l E, b L, l L, b O]) | 96 | case_use_two_blanks_H = quickPut_H "HE_L_" [L, O] @?= (at (7,7) horz [l H, l E, b L, l L, b O]) | 96 | false | false | 0 | 9 | 20 | 67 | 35 | 32 | null | null |
exFalso/lambda | src/lib/Pretty/Pretty.hs | bsd-3-clause | prettySimpleLambdaBody :: SimpleLambdaBody -> String
prettySimpleLambdaBody (SimpleApp a b) = "(" <> prettySimpleLambdaBody a <> " " <> prettySimpleLambdaBody b <> ")" | 167 | prettySimpleLambdaBody :: SimpleLambdaBody -> String
prettySimpleLambdaBody (SimpleApp a b) = "(" <> prettySimpleLambdaBody a <> " " <> prettySimpleLambdaBody b <> ")" | 167 | prettySimpleLambdaBody (SimpleApp a b) = "(" <> prettySimpleLambdaBody a <> " " <> prettySimpleLambdaBody b <> ")" | 114 | false | true | 0 | 9 | 21 | 48 | 23 | 25 | null | null |
folivetti/BIGDATA | 03 - VetoresMatrizes/Test.hs | mit | m = [u,v] | 9 | m = [u,v] | 9 | m = [u,v] | 9 | false | false | 1 | 5 | 2 | 15 | 7 | 8 | null | null |
jameshfisher/heredoc | src/Text/Heredoc.hs | unlicense | toUnix :: String -> String
toUnix cs = case cs of
'\r':'\n' : cs -> '\n' : toUnix cs
'\r' : cs -> '\n' : toUnix cs
c : cs -> c : toUnix cs
[] -> []
{-| Create a string-literal expression from the string being quoted.
Newline literals are normalized to UNIX newlines (one '\n' ch... | 332 | toUnix :: String -> String
toUnix cs = case cs of
'\r':'\n' : cs -> '\n' : toUnix cs
'\r' : cs -> '\n' : toUnix cs
c : cs -> c : toUnix cs
[] -> []
{-| Create a string-literal expression from the string being quoted.
Newline literals are normalized to UNIX newlines (one '\n' ch... | 332 | toUnix cs = case cs of
'\r':'\n' : cs -> '\n' : toUnix cs
'\r' : cs -> '\n' : toUnix cs
c : cs -> c : toUnix cs
[] -> []
{-| Create a string-literal expression from the string being quoted.
Newline literals are normalized to UNIX newlines (one '\n' character).
-} | 305 | false | true | 0 | 9 | 100 | 88 | 42 | 46 | null | null |
kelnage/tamarin-prover | lib/theory/src/Theory/Model/Rule.hs | gpl-3.0 | prettyProtoRuleE :: HighlightDocument d => ProtoRuleE -> d
prettyProtoRuleE = prettyNamedRule (kwRuleModulo "E") (const emptyDoc) | 129 | prettyProtoRuleE :: HighlightDocument d => ProtoRuleE -> d
prettyProtoRuleE = prettyNamedRule (kwRuleModulo "E") (const emptyDoc) | 129 | prettyProtoRuleE = prettyNamedRule (kwRuleModulo "E") (const emptyDoc) | 70 | false | true | 0 | 7 | 14 | 39 | 19 | 20 | null | null |
aztecrex/haskell-scotty-spike | app/Resources.hs | bsd-3-clause | resources :: ScottyM()
resources = do
get "/hello" $ action hello
get "/answer" $ action $ fmap show answer | 111 | resources :: ScottyM()
resources = do
get "/hello" $ action hello
get "/answer" $ action $ fmap show answer | 111 | resources = do
get "/hello" $ action hello
get "/answer" $ action $ fmap show answer | 88 | false | true | 0 | 10 | 22 | 54 | 22 | 32 | null | null |
TOSPIO/yi | src/library/Yi/MiniBuffer.hs | gpl-2.0 | anyModeName :: AnyMode -> T.Text
anyModeName (AnyMode m) = modeName m | 69 | anyModeName :: AnyMode -> T.Text
anyModeName (AnyMode m) = modeName m | 69 | anyModeName (AnyMode m) = modeName m | 36 | false | true | 0 | 7 | 10 | 29 | 14 | 15 | null | null |
mettekou/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | -- | Create a machine single precision literal expression of type @Float#@ from a @Float@.
-- If you want an expression of type @Float@ use 'MkCore.mkFloatExpr'
mkFloatLitFloat :: Float -> Expr b
mkFloatLit f = Lit (mkMachFloat f) | 236 | mkFloatLitFloat :: Float -> Expr b
mkFloatLit f = Lit (mkMachFloat f) | 74 | mkFloatLit f = Lit (mkMachFloat f) | 39 | true | true | 0 | 7 | 43 | 37 | 17 | 20 | null | null |
geekingfrog/project-euler | Problem011.hs | gpl-3.0 | diagonalWindows1 = [map (\x -> i + x*side+x) [0..3] | i <- [0..S.length grid - 3*side - 4]] | 91 | diagonalWindows1 = [map (\x -> i + x*side+x) [0..3] | i <- [0..S.length grid - 3*side - 4]] | 91 | diagonalWindows1 = [map (\x -> i + x*side+x) [0..3] | i <- [0..S.length grid - 3*side - 4]] | 91 | false | false | 0 | 13 | 17 | 69 | 36 | 33 | null | null |
klangner/radium | src/Radium/Formats/Smiles.hs | bsd-2-clause | -- | Set of all aromatic symbols
aromatics :: Set.Set Char
aromatics = Set.fromList "bcnosp" | 92 | aromatics :: Set.Set Char
aromatics = Set.fromList "bcnosp" | 59 | aromatics = Set.fromList "bcnosp" | 33 | true | true | 1 | 6 | 14 | 25 | 11 | 14 | null | null |
SnipyJulmy/mcs_notes_and_resume | fun-and-log-prog/exercices/s03/s03_Julmy_Sylvain/s03.hs | lgpl-3.0 | -- Ex1.b
partitions :: [a] -> [[a]]
partitions [] = [[]] | 56 | partitions :: [a] -> [[a]]
partitions [] = [[]] | 47 | partitions [] = [[]] | 20 | true | true | 0 | 7 | 10 | 35 | 20 | 15 | null | null |
arekfu/project_euler | p0080/p0080.hs | mit | toDecimalExpansion :: Rational -> [Integer]
toDecimalExpansion r = let num = numerator r
den = denominator r
ratio = num `div` den
rest = num `mod` den
in ratio : toDecimalExpansion ((10 * rest) % den) | 305 | toDecimalExpansion :: Rational -> [Integer]
toDecimalExpansion r = let num = numerator r
den = denominator r
ratio = num `div` den
rest = num `mod` den
in ratio : toDecimalExpansion ((10 * rest) % den) | 305 | toDecimalExpansion r = let num = numerator r
den = denominator r
ratio = num `div` den
rest = num `mod` den
in ratio : toDecimalExpansion ((10 * rest) % den) | 261 | false | true | 0 | 12 | 139 | 86 | 46 | 40 | null | null |
keithodulaigh/Hets | utils/DtdToHaskell-src/pre-1.22/Instance.hs | gpl-2.0 | nameSupply :: [b] -> [Doc]
nameSupply ss = take (length ss) (map char ['a' .. 'z']
++ map text [ [a, n] | n <- ['0' .. '9']
, a <- ['a' .. 'z'] ]) | 235 | nameSupply :: [b] -> [Doc]
nameSupply ss = take (length ss) (map char ['a' .. 'z']
++ map text [ [a, n] | n <- ['0' .. '9']
, a <- ['a' .. 'z'] ]) | 235 | nameSupply ss = take (length ss) (map char ['a' .. 'z']
++ map text [ [a, n] | n <- ['0' .. '9']
, a <- ['a' .. 'z'] ]) | 208 | false | true | 0 | 12 | 123 | 95 | 52 | 43 | null | null |
trygvis/hledger | hledger-lib/Hledger/Read/JournalReader.hs | gpl-3.0 | ledgerInclude :: GenParser Char JournalContext JournalUpdate
ledgerInclude = do
many1 spacenonewline
filename <- restofline
outerState <- getState
outerPos <- getPosition
return $ do filepath <- expandPath outerPos filename
txt <- readFileOrError outerPos filepath
let inIncluded = ... | 842 | ledgerInclude :: GenParser Char JournalContext JournalUpdate
ledgerInclude = do
many1 spacenonewline
filename <- restofline
outerState <- getState
outerPos <- getPosition
return $ do filepath <- expandPath outerPos filename
txt <- readFileOrError outerPos filepath
let inIncluded = ... | 842 | ledgerInclude = do
many1 spacenonewline
filename <- restofline
outerState <- getState
outerPos <- getPosition
return $ do filepath <- expandPath outerPos filename
txt <- readFileOrError outerPos filepath
let inIncluded = show outerPos ++ " in included file " ++ show filename ++ ":\... | 781 | false | true | 2 | 20 | 233 | 263 | 126 | 137 | null | null |
meiersi/blaze-builder | benchmarks/Throughput/BinaryBuilder.hs | bsd-3-clause | writeWord32N4Little = loop 0
where loop s n | s `seq` n `seq` False = undefined
loop _ 0 = mempty
loop s n = (
putWord32le (s+0) `mappend`
putWord32le (s+1) `mappend`
putWord32le (s+2) `mappend`
putWord32le (s+3)) `mappend`
loop (s+4) (n-4) | 308 | writeWord32N4Little = loop 0
where loop s n | s `seq` n `seq` False = undefined
loop _ 0 = mempty
loop s n = (
putWord32le (s+0) `mappend`
putWord32le (s+1) `mappend`
putWord32le (s+2) `mappend`
putWord32le (s+3)) `mappend`
loop (s+4) (n-4) | 308 | writeWord32N4Little = loop 0
where loop s n | s `seq` n `seq` False = undefined
loop _ 0 = mempty
loop s n = (
putWord32le (s+0) `mappend`
putWord32le (s+1) `mappend`
putWord32le (s+2) `mappend`
putWord32le (s+3)) `mappend`
loop (s+4) (n-4) | 308 | false | false | 2 | 14 | 108 | 146 | 78 | 68 | null | null |
awgn/ass | src/Ass/Cpp/Token.hs | gpl-2.0 | isIdentifier _ = False | 22 | isIdentifier _ = False | 22 | isIdentifier _ = False | 22 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
Helkafen/haddock | haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-2-clause | decltt :: LaTeX -> LaTeX
decltt ltx = text "\\haddockdecltt" <> braces ltx | 74 | decltt :: LaTeX -> LaTeX
decltt ltx = text "\\haddockdecltt" <> braces ltx | 74 | decltt ltx = text "\\haddockdecltt" <> braces ltx | 49 | false | true | 0 | 6 | 12 | 28 | 13 | 15 | null | null |
sdiehl/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | iselExpr64 (CmmReg (CmmLocal (LocalReg vu ty))) | isWord64 ty
= return (ChildCode64 nilOL (RegVirtual $ mkVirtualReg vu II32)) | 129 | iselExpr64 (CmmReg (CmmLocal (LocalReg vu ty))) | isWord64 ty
= return (ChildCode64 nilOL (RegVirtual $ mkVirtualReg vu II32)) | 129 | iselExpr64 (CmmReg (CmmLocal (LocalReg vu ty))) | isWord64 ty
= return (ChildCode64 nilOL (RegVirtual $ mkVirtualReg vu II32)) | 129 | false | false | 0 | 11 | 20 | 61 | 28 | 33 | null | null |
beni55/haste-compiler | libraries/ghc-7.10/ghc-prim/GHC/Prim.hs | bsd-3-clause | writeInt64OffAddr# :: Addr# -> Int# -> Int64# -> State# s -> State# s
writeInt64OffAddr# = let x = x in x | 105 | writeInt64OffAddr# :: Addr# -> Int# -> Int64# -> State# s -> State# s
writeInt64OffAddr# = let x = x in x | 105 | writeInt64OffAddr# = let x = x in x | 35 | false | true | 0 | 10 | 20 | 50 | 22 | 28 | null | null |
lynnard/reflex-cocos2d | src/Reflex/Extra.hs | mit | -- | Convert Dynamic to an Event that carries the first value in postBuild
postponeCurrent :: (Reflex t, PostBuild t m) => Dynamic t a -> m (Event t a)
postponeCurrent d = do
pe <- getPostBuild
return $ leftmost [ pushAlways (const $ sample (current d)) pe
, updated d ] | 300 | postponeCurrent :: (Reflex t, PostBuild t m) => Dynamic t a -> m (Event t a)
postponeCurrent d = do
pe <- getPostBuild
return $ leftmost [ pushAlways (const $ sample (current d)) pe
, updated d ] | 225 | postponeCurrent d = do
pe <- getPostBuild
return $ leftmost [ pushAlways (const $ sample (current d)) pe
, updated d ] | 148 | true | true | 0 | 15 | 81 | 99 | 48 | 51 | null | null |
coolhacks/scripts-hacks | examples/shellcheck-master/ShellCheck/Parser.hs | mit | readIfPart = do
pos <- getPosition
g_If
allspacing
condition <- readTerm
ifNextToken (g_Fi <|> g_Elif <|> g_Else) $
parseProblemAt pos ErrorC 1049 "Did you forget the 'then' for this 'if'?"
called "then clause" $ do
g_Then `orFail` do
parseProblem ErrorC 1050 "Expec... | 564 | readIfPart = do
pos <- getPosition
g_If
allspacing
condition <- readTerm
ifNextToken (g_Fi <|> g_Elif <|> g_Else) $
parseProblemAt pos ErrorC 1049 "Did you forget the 'then' for this 'if'?"
called "then clause" $ do
g_Then `orFail` do
parseProblem ErrorC 1050 "Expec... | 564 | readIfPart = do
pos <- getPosition
g_If
allspacing
condition <- readTerm
ifNextToken (g_Fi <|> g_Elif <|> g_Else) $
parseProblemAt pos ErrorC 1049 "Did you forget the 'then' for this 'if'?"
called "then clause" $ do
g_Then `orFail` do
parseProblem ErrorC 1050 "Expec... | 564 | false | false | 0 | 13 | 171 | 131 | 57 | 74 | null | null |
NotBrianZach/postgrest | src/PostgREST/QueryBuilder.hs | mit | whiteList :: Text -> SqlFragment
whiteList val = fromMaybe
(toS (pgFmtLit val) <> "::unknown ")
(find ((==) . toLower $ val) ["null","true","false"]) | 153 | whiteList :: Text -> SqlFragment
whiteList val = fromMaybe
(toS (pgFmtLit val) <> "::unknown ")
(find ((==) . toLower $ val) ["null","true","false"]) | 153 | whiteList val = fromMaybe
(toS (pgFmtLit val) <> "::unknown ")
(find ((==) . toLower $ val) ["null","true","false"]) | 120 | false | true | 0 | 9 | 25 | 70 | 37 | 33 | null | null |
vladfi1/hs-misc | ExpressionHList.hs | mit | toDB (Lam _ b) = DB.Lam (toDB b) | 32 | toDB (Lam _ b) = DB.Lam (toDB b) | 32 | toDB (Lam _ b) = DB.Lam (toDB b) | 32 | false | false | 0 | 7 | 7 | 28 | 13 | 15 | null | null |
DaMSL/K3 | src/Language/K3/Codegen/Common.hs | apache-2.0 | signature _ = error "unexpected" | 32 | signature _ = error "unexpected" | 32 | signature _ = error "unexpected" | 32 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
lzlarryli/advent_of_code_2016 | day13/part2.hs | mit | main :: IO ()
main = print . breadthFirstSearch $ 50 | 52 | main :: IO ()
main = print . breadthFirstSearch $ 50 | 52 | main = print . breadthFirstSearch $ 50 | 38 | false | true | 0 | 7 | 10 | 30 | 13 | 17 | null | null |
chainone/HSub | src/ShooterFileHash.hs | bsd-3-clause | sampleHash :: Handle -> Integer -> IO MD5Digest
sampleHash h offset = do
hSeek h AbsoluteSeek offset
md5 <$> L.hGet h sampleLen | 139 | sampleHash :: Handle -> Integer -> IO MD5Digest
sampleHash h offset = do
hSeek h AbsoluteSeek offset
md5 <$> L.hGet h sampleLen | 139 | sampleHash h offset = do
hSeek h AbsoluteSeek offset
md5 <$> L.hGet h sampleLen | 91 | false | true | 0 | 10 | 33 | 56 | 24 | 32 | null | null |
isomorphism/csound-expression | src/Csound/Air/Fx.hs | bsd-3-clause | -- | Stereo reverb for small room.
smallRoom2 :: Sig2 -> Sig2
smallRoom2 = rever2 0.6 | 85 | smallRoom2 :: Sig2 -> Sig2
smallRoom2 = rever2 0.6 | 50 | smallRoom2 = rever2 0.6 | 23 | true | true | 0 | 5 | 15 | 19 | 10 | 9 | null | null |
bitc/hs-watchman | src/System/Directory/Watchman/Query.hs | mit | parseQueryResult :: [FileFieldLabel] -> BSERValue -> Parser QueryResult
parseQueryResult fileFieldLabels (BSERObject o) = do
clockId <- o .: "clock"
unless ("c:" `BC8.isPrefixOf` clockId) $
fail $ "Invalid clock id: " ++ BC8.unpack clockId
isFreshInstance <- o .: "is_fresh_instance"
files <- o .... | 561 | parseQueryResult :: [FileFieldLabel] -> BSERValue -> Parser QueryResult
parseQueryResult fileFieldLabels (BSERObject o) = do
clockId <- o .: "clock"
unless ("c:" `BC8.isPrefixOf` clockId) $
fail $ "Invalid clock id: " ++ BC8.unpack clockId
isFreshInstance <- o .: "is_fresh_instance"
files <- o .... | 561 | parseQueryResult fileFieldLabels (BSERObject o) = do
clockId <- o .: "clock"
unless ("c:" `BC8.isPrefixOf` clockId) $
fail $ "Invalid clock id: " ++ BC8.unpack clockId
isFreshInstance <- o .: "is_fresh_instance"
files <- o .: "files"
files' <- mapM (parseFileFields fileFieldLabels) files
... | 489 | false | true | 0 | 13 | 128 | 155 | 75 | 80 | null | null |
kawamuray/ganeti | src/Ganeti/Constants.hs | gpl-2.0 | ssHypervisorList :: String
ssHypervisorList = "hypervisor_list" | 63 | ssHypervisorList :: String
ssHypervisorList = "hypervisor_list" | 63 | ssHypervisorList = "hypervisor_list" | 36 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
ameingast/yawn | src/Yawn/Util/IO.hs | bsd-3-clause | safeGetModTime :: Context -> FilePath -> IO (Maybe (TimeString))
safeGetModTime ctx path =
tryIO ctx (clockTimeToAscDate =<< getModificationTime path) | 153 | safeGetModTime :: Context -> FilePath -> IO (Maybe (TimeString))
safeGetModTime ctx path =
tryIO ctx (clockTimeToAscDate =<< getModificationTime path) | 153 | safeGetModTime ctx path =
tryIO ctx (clockTimeToAscDate =<< getModificationTime path) | 88 | false | true | 0 | 10 | 21 | 52 | 25 | 27 | null | null |
LudvikGalois/USBGame | src/HackySDL/Monad.hs | mit | windowSurf :: Lens' SDLState (Ptr Surface)
windowSurf = lens _windowSurf (\s b -> s { _windowSurf = b}) | 103 | windowSurf :: Lens' SDLState (Ptr Surface)
windowSurf = lens _windowSurf (\s b -> s { _windowSurf = b}) | 103 | windowSurf = lens _windowSurf (\s b -> s { _windowSurf = b}) | 60 | false | true | 0 | 9 | 17 | 45 | 24 | 21 | null | null |
supermitch/learn-haskell | real-world-haskell/ch04/FirstWords.hs | mit | interactWith function inputFile outputFile = do
input <- readFile inputFile
writeFile outputFile (function input) | 121 | interactWith function inputFile outputFile = do
input <- readFile inputFile
writeFile outputFile (function input) | 121 | interactWith function inputFile outputFile = do
input <- readFile inputFile
writeFile outputFile (function input) | 121 | false | false | 0 | 9 | 21 | 39 | 16 | 23 | null | null |
pikajude/haxparse | src/HaxParse/Parser.hs | mit | str :: Parser C.ByteString
str = do len <- int16
C.pack <$> count (fromIntegral len) anyChar | 101 | str :: Parser C.ByteString
str = do len <- int16
C.pack <$> count (fromIntegral len) anyChar | 101 | str = do len <- int16
C.pack <$> count (fromIntegral len) anyChar | 74 | false | true | 0 | 11 | 24 | 49 | 21 | 28 | null | null |
kawu/factorized-tag-parser | src/NLP/Partage/Earley/Chart.hs | bsd-2-clause | saveActive
:: (Ord t, Ord n)
=> M.Map ID (NotFoot n) -- ^ See `lhsNonTerm` from `Auto`
-> Active
-> S.Set (Trav n t)
-> Chart n t
-> Chart n t
saveActive lhsMap p ts chart =
chart
{ doneActive = newDone
, doneActiveByRoot = newDoneByRoot
}
where
newDone =
M.insertWith
... | 904 | saveActive
:: (Ord t, Ord n)
=> M.Map ID (NotFoot n) -- ^ See `lhsNonTerm` from `Auto`
-> Active
-> S.Set (Trav n t)
-> Chart n t
-> Chart n t
saveActive lhsMap p ts chart =
chart
{ doneActive = newDone
, doneActiveByRoot = newDoneByRoot
}
where
newDone =
M.insertWith
... | 904 | saveActive lhsMap p ts chart =
chart
{ doneActive = newDone
, doneActiveByRoot = newDoneByRoot
}
where
newDone =
M.insertWith
( M.unionWith
( M.unionWith S.union ) )
( p ^. spanA ^. end )
( M.singleton (p ^. state)
( M.singleton p... | 737 | false | true | 4 | 12 | 324 | 304 | 146 | 158 | null | null |
Gabriel439/fficxx | lib/FFICXX/Generate/Type/Class.hs | bsd-2-clause | cstar_ :: CTypes -> Types
cstar_ t = CT (CPointer t) Const | 59 | cstar_ :: CTypes -> Types
cstar_ t = CT (CPointer t) Const | 58 | cstar_ t = CT (CPointer t) Const | 32 | false | true | 0 | 7 | 12 | 29 | 14 | 15 | null | null |
jchmrt/btjchm | Calc.hs | mit | -- |Look up a Function
lookupFunc :: String -> ([Double] -> Double)
lookupFunc "sin" = unFunc sin | 98 | lookupFunc :: String -> ([Double] -> Double)
lookupFunc "sin" = unFunc sin | 75 | lookupFunc "sin" = unFunc sin | 30 | true | true | 0 | 8 | 17 | 32 | 17 | 15 | null | null |
aburnett88/HSat | tests-src/Test/Make/Instances/Common/Literal.hs | mit | getTrueLiteralTest1 :: TestTree
getTrueLiteralTest1 =
testProperty "getTrueLiteral has correct effects" $ monadicIO $ do
literalSet <- pick arbitrary
stop =<< run (
catch (
do
(literal,literalSet') <- runMake getTrueLiteral literalSet
return $ checkTrue literal literalSet ... | 517 | getTrueLiteralTest1 :: TestTree
getTrueLiteralTest1 =
testProperty "getTrueLiteral has correct effects" $ monadicIO $ do
literalSet <- pick arbitrary
stop =<< run (
catch (
do
(literal,literalSet') <- runMake getTrueLiteral literalSet
return $ checkTrue literal literalSet ... | 517 | getTrueLiteralTest1 =
testProperty "getTrueLiteral has correct effects" $ monadicIO $ do
literalSet <- pick arbitrary
stop =<< run (
catch (
do
(literal,literalSet') <- runMake getTrueLiteral literalSet
return $ checkTrue literal literalSet literalSet'
)
(... | 485 | false | true | 0 | 20 | 150 | 127 | 61 | 66 | null | null |
lostbean/sledge | src/Texture/HyperSphere.hs | gpl-3.0 | renderSO2VTK :: (SO2 -> Double) -> VTK Vec3D
renderSO2VTK feval = let
(grid, vtk) = mkSO2 60 60
func i _ = feval $ grid U.! i
attr = mkPointValueAttr "Intensity" func
in addPointValueAttr vtk attr | 214 | renderSO2VTK :: (SO2 -> Double) -> VTK Vec3D
renderSO2VTK feval = let
(grid, vtk) = mkSO2 60 60
func i _ = feval $ grid U.! i
attr = mkPointValueAttr "Intensity" func
in addPointValueAttr vtk attr | 214 | renderSO2VTK feval = let
(grid, vtk) = mkSO2 60 60
func i _ = feval $ grid U.! i
attr = mkPointValueAttr "Intensity" func
in addPointValueAttr vtk attr | 169 | false | true | 0 | 10 | 53 | 90 | 43 | 47 | null | null |
ekmett/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_PS_TEXT :: Int
wxSTC_PS_TEXT = 12 | 39 | wxSTC_PS_TEXT :: Int
wxSTC_PS_TEXT = 12 | 39 | wxSTC_PS_TEXT = 12 | 18 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/Navigator.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/Navigator.vibrate Mozilla Navigator.vibrate documentation>
vibrate :: (MonadDOM m) => Navigator -> Word -> m Bool
vibrate self time
= liftDOM ((self ^. jsf "vibrate" [toJSVal time]) >>= valToBool) | 254 | vibrate :: (MonadDOM m) => Navigator -> Word -> m Bool
vibrate self time
= liftDOM ((self ^. jsf "vibrate" [toJSVal time]) >>= valToBool) | 139 | vibrate self time
= liftDOM ((self ^. jsf "vibrate" [toJSVal time]) >>= valToBool) | 84 | true | true | 0 | 12 | 32 | 65 | 33 | 32 | null | null |
ruicc/structured-concurrent | src/Control/Concurrent/Structured/STM.hs | mit | modifyTVar :: TVar a -> (a -> a) -> CSTM r ()
modifyTVar tv v = liftSTM $ S.modifyTVar tv v | 92 | modifyTVar :: TVar a -> (a -> a) -> CSTM r ()
modifyTVar tv v = liftSTM $ S.modifyTVar tv v | 92 | modifyTVar tv v = liftSTM $ S.modifyTVar tv v | 46 | false | true | 0 | 8 | 21 | 52 | 25 | 27 | null | null |
dinnu93/CIS194 | Lecture-04/Single.hs | cc0-1.0 | heightOfTree (Node h _ _ _) = h | 31 | heightOfTree (Node h _ _ _) = h | 31 | heightOfTree (Node h _ _ _) = h | 31 | false | false | 0 | 6 | 7 | 22 | 10 | 12 | null | null |
peterokagey/haskellOEIS | src/Sandbox/OEIS/A341308.hs | apache-2.0 | -- 1,1,2,2,2,3,3,3,3,4,4,4,4,4
a237048_rows = map (\(i,l) -> map (a237048 i) [1..l]) $ zip [1..] rowLengths where
rowLengths = concatMap (\i -> replicate (i + 1) i) [1..] | 173 | a237048_rows = map (\(i,l) -> map (a237048 i) [1..l]) $ zip [1..] rowLengths where
rowLengths = concatMap (\i -> replicate (i + 1) i) [1..] | 141 | a237048_rows = map (\(i,l) -> map (a237048 i) [1..l]) $ zip [1..] rowLengths where
rowLengths = concatMap (\i -> replicate (i + 1) i) [1..] | 141 | true | false | 0 | 11 | 29 | 86 | 47 | 39 | null | null |
asr/apia | src/Apia/Monad/Base.hs | mit | - | Pop a variable from the translation monad state.
popTVar ∷ T ()
popTVar = do
state ← get
case tVars state of
[] → __IMPOSSIBLE__
(_ : xs) → put state { tVars = xs }
-- | Push a variable in the translation monad state.
| 241 | popTVar ∷ T ()
popTVar = do
state ← get
case tVars state of
[] → __IMPOSSIBLE__
(_ : xs) → put state { tVars = xs }
-- | Push a variable in the translation monad state. | 187 | popTVar = do
state ← get
case tVars state of
[] → __IMPOSSIBLE__
(_ : xs) → put state { tVars = xs }
-- | Push a variable in the translation monad state. | 172 | true | true | 2 | 13 | 67 | 94 | 44 | 50 | null | null |
HIPERFIT/futhark | src/Language/Futhark/Interpreter.hs | isc | evalModExp env (ModDecs ds _) = do
Env terms types _ <- foldM evalDec env ds
-- Remove everything that was present in the original Env.
return $
Module $
Env
(terms `M.difference` envTerm env)
(types `M.difference` envType env)
mempty | 274 | evalModExp env (ModDecs ds _) = do
Env terms types _ <- foldM evalDec env ds
-- Remove everything that was present in the original Env.
return $
Module $
Env
(terms `M.difference` envTerm env)
(types `M.difference` envType env)
mempty | 274 | evalModExp env (ModDecs ds _) = do
Env terms types _ <- foldM evalDec env ds
-- Remove everything that was present in the original Env.
return $
Module $
Env
(terms `M.difference` envTerm env)
(types `M.difference` envType env)
mempty | 274 | false | false | 0 | 11 | 79 | 87 | 43 | 44 | null | null |
ckaestne/CIDE | other/CaseStudies/fgl/CIDEfgl/Data/Graph/Inductive/Graphviz.hs | gpl-3.0 | graphviz g t (w, h) p@(pw', ph') o
= let { n = labNodes g;
e = labEdges g;
ns = concatMap sn n;
es = concatMap se e;
sz w' h'
= if o == Portrait then show w' ++ "," ++ show h' else
show h' ++ "," ++ show w';
ps = show w ++ "... | 979 | graphviz g t (w, h) p@(pw', ph') o
= let { n = labNodes g;
e = labEdges g;
ns = concatMap sn n;
es = concatMap se e;
sz w' h'
= if o == Portrait then show w' ++ "," ++ show h' else
show h' ++ "," ++ show w';
ps = show w ++ "... | 979 | graphviz g t (w, h) p@(pw', ph') o
= let { n = labNodes g;
e = labEdges g;
ns = concatMap sn n;
es = concatMap se e;
sz w' h'
= if o == Portrait then show w' ++ "," ++ show h' else
show h' ++ "," ++ show w';
ps = show w ++ "... | 979 | false | false | 5 | 20 | 482 | 399 | 208 | 191 | null | null |
vincenthz/cryptonite | Crypto/Cipher/ChaChaPoly1305.hs | bsd-3-clause | -- | Increment a nonce
incrementNonce :: Nonce -> Nonce
incrementNonce (Nonce8 n) = Nonce8 $ incrementNonce' n 4 | 114 | incrementNonce :: Nonce -> Nonce
incrementNonce (Nonce8 n) = Nonce8 $ incrementNonce' n 4 | 91 | incrementNonce (Nonce8 n) = Nonce8 $ incrementNonce' n 4 | 58 | true | true | 0 | 7 | 20 | 34 | 17 | 17 | null | null |
matt-noonan/justified-containers | src/Data/Map/Justified.hs | bsd-2-clause | -- | /O(log n)/. Find the largest key smaller than the given one
-- and return the corresponding (key,value) pair, with evidence for the key.
--
-- > withMap (M.fromList [(3,'a'), (5,'b')]) $ \table -> lookupLT 3 table == Nothing
-- > withMap (M.fromList [(3,'a'), (5,'b')]) $ \table -> lookupLT 4 table == Just (Key 3, ... | 455 | lookupLT :: Ord k => k -> Map ph k v -> Maybe (Key ph k, v)
lookupLT k (Map m) = fmap (\(key, v) -> (Key key, v)) (M.lookupLT k m) | 130 | lookupLT k (Map m) = fmap (\(key, v) -> (Key key, v)) (M.lookupLT k m) | 70 | true | true | 0 | 10 | 88 | 101 | 54 | 47 | null | null |
geekingfrog/advent-of-code | src/Y2018/Day11.hs | bsd-3-clause | answer1, answer2 :: IO ()
answer1 = print $ solve1 5535 | 55 | answer1, answer2 :: IO ()
answer1 = print $ solve1 5535 | 55 | answer1 = print $ solve1 5535 | 29 | false | true | 0 | 6 | 10 | 25 | 13 | 12 | null | null |
rueshyna/gogol | gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs | mpl-2.0 | -- | Quantity that is returned.
orQuantity :: Lens' OrderReturn (Maybe Word32)
orQuantity
= lens _orQuantity (\ s a -> s{_orQuantity = a}) .
mapping _Coerce | 164 | orQuantity :: Lens' OrderReturn (Maybe Word32)
orQuantity
= lens _orQuantity (\ s a -> s{_orQuantity = a}) .
mapping _Coerce | 132 | orQuantity
= lens _orQuantity (\ s a -> s{_orQuantity = a}) .
mapping _Coerce | 85 | true | true | 0 | 10 | 33 | 55 | 28 | 27 | null | null |
oswynb/Crossword-Helper | src/Rep.hs | bsd-3-clause | hasBoth :: Position -> Crossword -> Bool
hasBoth p c = hasDown p c && hasAcross p c | 83 | hasBoth :: Position -> Crossword -> Bool
hasBoth p c = hasDown p c && hasAcross p c | 83 | hasBoth p c = hasDown p c && hasAcross p c | 42 | false | true | 0 | 8 | 17 | 44 | 19 | 25 | null | null |
apyrgio/ganeti | src/Ganeti/HTools/Cluster.hs | bsd-2-clause | -- | Shows statistics for a given node list.
printStats :: String -> Node.List -> String
printStats lp nl =
let dcvs = compDetailedCV $ Container.elems nl
(weights, names) = unzip detailedCVInfo
hd = zip3 (weights ++ repeat 1) (names ++ repeat "unknown") dcvs
header = [ "Field", "Value", "Weight" ]
... | 563 | printStats :: String -> Node.List -> String
printStats lp nl =
let dcvs = compDetailedCV $ Container.elems nl
(weights, names) = unzip detailedCVInfo
hd = zip3 (weights ++ repeat 1) (names ++ repeat "unknown") dcvs
header = [ "Field", "Value", "Weight" ]
formatted = map (\(w, h, val) ->
... | 518 | printStats lp nl =
let dcvs = compDetailedCV $ Container.elems nl
(weights, names) = unzip detailedCVInfo
hd = zip3 (weights ++ repeat 1) (names ++ repeat "unknown") dcvs
header = [ "Field", "Value", "Weight" ]
formatted = map (\(w, h, val) ->
[ h
... | 474 | true | true | 0 | 13 | 205 | 179 | 91 | 88 | null | null |
nukisman/elm-format-short | src/ElmFormat/Render/Markdown.hs | bsd-3-clause | mapWithPrev f (first:rest) =
f Nothing first : zipWith (\prev next -> f (Just prev) next) (first:rest) rest | 111 | mapWithPrev f (first:rest) =
f Nothing first : zipWith (\prev next -> f (Just prev) next) (first:rest) rest | 111 | mapWithPrev f (first:rest) =
f Nothing first : zipWith (\prev next -> f (Just prev) next) (first:rest) rest | 111 | false | false | 0 | 11 | 21 | 63 | 31 | 32 | null | null |
ghc-android/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | isCIrredEvCan :: Ct -> Bool
isCIrredEvCan (CIrredEvCan {}) = True | 65 | isCIrredEvCan :: Ct -> Bool
isCIrredEvCan (CIrredEvCan {}) = True | 65 | isCIrredEvCan (CIrredEvCan {}) = True | 37 | false | true | 1 | 8 | 9 | 30 | 14 | 16 | null | null |
beni55/egison | hs-src/Language/Egison/Desugar.hs | mit | desugar (CollectionExpr ((ElementExpr elm):inners)) = do
elm' <- desugar elm
(CollectionExpr inners') <- desugar (CollectionExpr inners)
return $ CollectionExpr (ElementExpr elm':inners') | 205 | desugar (CollectionExpr ((ElementExpr elm):inners)) = do
elm' <- desugar elm
(CollectionExpr inners') <- desugar (CollectionExpr inners)
return $ CollectionExpr (ElementExpr elm':inners') | 205 | desugar (CollectionExpr ((ElementExpr elm):inners)) = do
elm' <- desugar elm
(CollectionExpr inners') <- desugar (CollectionExpr inners)
return $ CollectionExpr (ElementExpr elm':inners') | 205 | false | false | 0 | 11 | 38 | 81 | 37 | 44 | null | null |
nevrenato/Hets_Fork | Static/DGNavigation.hs | gpl-2.0 | directInn :: DevGraphNavigator a => a -> [LEdge DGLinkLab]
directInn dgnav = concatMap (incoming dgnav . fst) $ getCurrent dgnav | 128 | directInn :: DevGraphNavigator a => a -> [LEdge DGLinkLab]
directInn dgnav = concatMap (incoming dgnav . fst) $ getCurrent dgnav | 128 | directInn dgnav = concatMap (incoming dgnav . fst) $ getCurrent dgnav | 69 | false | true | 0 | 10 | 19 | 56 | 25 | 31 | null | null |
lukasepple/grav1ty | lib/Grav2ty/Simulation.hs | gpl-3.0 | -- | Implementation of
-- [Cramer's rule](https://en.wikipedia.org/wiki/Cramer%27s_rule) for solving
-- a system of two linear equations.
cramer2 :: (Eq a, Fractional a) => M22 a -> V2 a -> Maybe (a, a)
cramer2 coeff res = if detA == 0
then Nothing
else Just (det22 a1 / d... | 496 | cramer2 :: (Eq a, Fractional a) => M22 a -> V2 a -> Maybe (a, a)
cramer2 coeff res = if detA == 0
then Nothing
else Just (det22 a1 / detA, det22 a2 / detA)
where detA = det22 coeff
a1 = set (column _x) res coeff
a2 = set (column _y) res coeff
-- | Wether a ... | 354 | cramer2 coeff res = if detA == 0
then Nothing
else Just (det22 a1 / detA, det22 a2 / detA)
where detA = det22 coeff
a1 = set (column _x) res coeff
a2 = set (column _y) res coeff
-- | Wether a value is between two other values. | 289 | true | true | 3 | 10 | 147 | 155 | 73 | 82 | null | null |
DanielG/stack | src/Stack/Setup.hs | bsd-3-clause | checkDependency :: String -> CheckDependency String
checkDependency tool = CheckDependency $ \menv -> do
exists <- doesExecutableExist menv tool
return $ if exists then Right tool else Left [tool] | 204 | checkDependency :: String -> CheckDependency String
checkDependency tool = CheckDependency $ \menv -> do
exists <- doesExecutableExist menv tool
return $ if exists then Right tool else Left [tool] | 204 | checkDependency tool = CheckDependency $ \menv -> do
exists <- doesExecutableExist menv tool
return $ if exists then Right tool else Left [tool] | 152 | false | true | 0 | 12 | 36 | 66 | 32 | 34 | null | null |
lukexi/ghc | compiler/main/DynFlags.hs | bsd-3-clause | wayOptP :: Platform -> Way -> [String]
wayOptP _ (WayCustom {}) = [] | 68 | wayOptP :: Platform -> Way -> [String]
wayOptP _ (WayCustom {}) = [] | 68 | wayOptP _ (WayCustom {}) = [] | 29 | false | true | 0 | 7 | 12 | 36 | 19 | 17 | null | null |
ghc/packages-filepath | System/FilePath/Internal.hs | bsd-3-clause | ---------------------------------------------------------------------
-- File name manipulators
-- | Equality of two 'FilePath's.
-- If you call @System.Directory.canonicalizePath@
-- first this has a much better chance of working.
-- Note that this doesn't follow symlinks or DOSNAM~1s.
--
-- > x == y =... | 2,391 | equalFilePath :: FilePath -> FilePath -> Bool
equalFilePath a b = f a == f b
where
f x | isWindows = dropTrailingPathSeparator $ map toLower $ normalise x
| otherwise = dropTrailingPathSeparator $ normalise x
-- | Contract a filename, based on a relative path. Note that the resulting path
-- ... | 1,768 | equalFilePath a b = f a == f b
where
f x | isWindows = dropTrailingPathSeparator $ map toLower $ normalise x
| otherwise = dropTrailingPathSeparator $ normalise x
-- | Contract a filename, based on a relative path. Note that the resulting path
-- will never introduce @..@ paths, as the prese... | 1,722 | true | true | 0 | 8 | 460 | 118 | 74 | 44 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/type-level/2018-09-alex-peitsinis-writing-and-using-proofs/src/Lib.hs | unlicense | plusAssocX a b (SS c) = gcastWith (plusAssoc a b c) Refl | 56 | plusAssocX a b (SS c) = gcastWith (plusAssoc a b c) Refl | 56 | plusAssocX a b (SS c) = gcastWith (plusAssoc a b c) Refl | 56 | false | false | 0 | 7 | 11 | 34 | 16 | 18 | null | null |
hankaiwen/libsbp | haskell/src/SwiftNav/SBP/Navigation.hs | lgpl-3.0 | msgVelNed :: Word16
msgVelNed = 0x0205 | 38 | msgVelNed :: Word16
msgVelNed = 0x0205 | 38 | msgVelNed = 0x0205 | 18 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
mikeplus64/Level-0 | src/Stage.hs | gpl-3.0 | stageToFile :: Stage -> FilePath -> IO ()
stageToFile stage' path =
let stageString = unlines $ stageToString stage'
in writeFile path stageString | 155 | stageToFile :: Stage -> FilePath -> IO ()
stageToFile stage' path =
let stageString = unlines $ stageToString stage'
in writeFile path stageString | 155 | stageToFile stage' path =
let stageString = unlines $ stageToString stage'
in writeFile path stageString | 113 | false | true | 0 | 10 | 31 | 52 | 24 | 28 | null | null |
Acidburn0zzz/haddock | haddock-api/src/Haddock/Backends/Xhtml/Utils.hs | bsd-2-clause | -- | generate an anchor identifier for a group
groupId :: String -> String
groupId g = makeAnchorId ("g:" ++ g) | 111 | groupId :: String -> String
groupId g = makeAnchorId ("g:" ++ g) | 64 | groupId g = makeAnchorId ("g:" ++ g) | 36 | true | true | 0 | 7 | 20 | 29 | 15 | 14 | null | null |
abakst/liquidhaskell | src/Language/Haskell/Liquid/Desugar710/Coverage.hs | bsd-3-clause | -- Others should never happen in a command context.
addTickCmdStmt stmt = pprPanic "addTickHsCmd" (ppr stmt) | 109 | addTickCmdStmt stmt = pprPanic "addTickHsCmd" (ppr stmt) | 57 | addTickCmdStmt stmt = pprPanic "addTickHsCmd" (ppr stmt) | 57 | true | false | 0 | 7 | 16 | 21 | 10 | 11 | null | null |
micknelso/language-c | test-framework/Language/C/Test/Environment.hs | bsd-3-clause | mungeArgs :: [String] -> [String] -> [String] -> MungeResult
mungeArgs _accum [] [] = Unknown "No .c / .hc / .i source file given" | 133 | mungeArgs :: [String] -> [String] -> [String] -> MungeResult
mungeArgs _accum [] [] = Unknown "No .c / .hc / .i source file given" | 133 | mungeArgs _accum [] [] = Unknown "No .c / .hc / .i source file given" | 72 | false | true | 0 | 8 | 26 | 46 | 24 | 22 | null | null |
carlosavieira/self-study | programming/Haskell/99 problems/solutions/02.hs | gpl-3.0 | myButLast :: [a] -> a
myButLast [] = error "Empty List" | 55 | myButLast :: [a] -> a
myButLast [] = error "Empty List" | 55 | myButLast [] = error "Empty List" | 33 | false | true | 0 | 6 | 10 | 26 | 13 | 13 | null | null |
kdkeyser/kvstore-batch | src/TransactionBuilder.hs | lgpl-3.0 | transactionBuilderPut :: TransactionBuilder -> String -> String -> IO ()
transactionBuilderPut (TransactionBuilder tVarCache _ tVarPuts _) key value =
atomically $
mapM_ (\tVar -> modifyTVar tVar $ Data.Map.insert key value) [tVarCache, tVarPuts] | 259 | transactionBuilderPut :: TransactionBuilder -> String -> String -> IO ()
transactionBuilderPut (TransactionBuilder tVarCache _ tVarPuts _) key value =
atomically $
mapM_ (\tVar -> modifyTVar tVar $ Data.Map.insert key value) [tVarCache, tVarPuts] | 259 | transactionBuilderPut (TransactionBuilder tVarCache _ tVarPuts _) key value =
atomically $
mapM_ (\tVar -> modifyTVar tVar $ Data.Map.insert key value) [tVarCache, tVarPuts] | 186 | false | true | 0 | 11 | 44 | 85 | 43 | 42 | null | null |
jrclogic/SMCDEL | src/SMCDEL/Examples/Prisoners.hs | gpl-2.0 | light :: Form
light = PrpF (P 0) | 32 | light :: Form
light = PrpF (P 0) | 32 | light = PrpF (P 0) | 18 | false | true | 0 | 7 | 7 | 26 | 11 | 15 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2021/M01/D22/Solution.hs | mit | {--
Okay, same, but different, because now we pulled countries from wikidata into
the mix with the following SPARQL query:
SELECT ?item ?itemLabel ?country ?countryLabel ?location
WHERE
{
?item wdt:P31 wd:Q156362.
?item wdt:P625 ?location.
?item wdt:P17 ?country.
SERVICE wikibase:label { bd:serviceParam wikib... | 479 | wineriesDir, wineriesJSON :: FilePath
wineriesDir = "Y2021/M01/D22/" | 68 | wineriesDir = "Y2021/M01/D22/" | 30 | true | true | 0 | 4 | 72 | 14 | 9 | 5 | null | null |
nbloomf/notebooks | src/geo/gfx/cover/cover.hs | gpl-3.0 | fig :: Fig (PoincareDisc ConReal) ()
fig = do
let c t = path (CirclePath (0,0) (2/3) (1/4) 1) t
p0 <- coords $ c (0/7)
p1 <- coords $ c (1/7)
p2 <- coords $ c (2/7)
p3 <- coords $ c (3/7)
p4 <- coords $ c (4/7)
p5 <- coords $ c (5/7)
p6 <- coords $ c (6/7)
let
ps =
[ (p0,p1), (p0,p2), (p0,p3... | 606 | fig :: Fig (PoincareDisc ConReal) ()
fig = do
let c t = path (CirclePath (0,0) (2/3) (1/4) 1) t
p0 <- coords $ c (0/7)
p1 <- coords $ c (1/7)
p2 <- coords $ c (2/7)
p3 <- coords $ c (3/7)
p4 <- coords $ c (4/7)
p5 <- coords $ c (5/7)
p6 <- coords $ c (6/7)
let
ps =
[ (p0,p1), (p0,p2), (p0,p3... | 606 | fig = do
let c t = path (CirclePath (0,0) (2/3) (1/4) 1) t
p0 <- coords $ c (0/7)
p1 <- coords $ c (1/7)
p2 <- coords $ c (2/7)
p3 <- coords $ c (3/7)
p4 <- coords $ c (4/7)
p5 <- coords $ c (5/7)
p6 <- coords $ c (6/7)
let
ps =
[ (p0,p1), (p0,p2), (p0,p3), (p0,p4), (p0,p5), (p0,p6)
, ... | 569 | false | true | 1 | 15 | 180 | 468 | 258 | 210 | null | null |
relrod/ba | src/Bio/Algorithm/Types.hs | bsd-2-clause | isRNAChar :: Char -> Bool
isRNAChar 'A' = True | 46 | isRNAChar :: Char -> Bool
isRNAChar 'A' = True | 46 | isRNAChar 'A' = True | 20 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
pmiddend/tic | lib/Tic/CoordTransform.hs | gpl-3.0 | --viewportCoordToImageCoord imageOrigin = from (imageCoordToViewportCoord imageOrigin)
viewportCoordToImageCoord :: (Ord a,Num a) => Rectangle a -> Getter (ViewportCoord a) (Maybe (ImageCoord a))
viewportCoordToImageCoord imageRectangle = to helper
where helper vc | pointInRectangle (vc ^. viewportToVector) imageRect... | 455 | viewportCoordToImageCoord :: (Ord a,Num a) => Rectangle a -> Getter (ViewportCoord a) (Maybe (ImageCoord a))
viewportCoordToImageCoord imageRectangle = to helper
where helper vc | pointInRectangle (vc ^. viewportToVector) imageRectangle = Just ((vc ^. viewportToVector - (imageRectangle ^. rectLeftTop)) ^. from imageT... | 368 | viewportCoordToImageCoord imageRectangle = to helper
where helper vc | pointInRectangle (vc ^. viewportToVector) imageRectangle = Just ((vc ^. viewportToVector - (imageRectangle ^. rectLeftTop)) ^. from imageToVector)
| otherwise = Nothing | 259 | true | true | 0 | 12 | 70 | 141 | 67 | 74 | null | null |
JPMoresmau/haskell-ide-engine | hie-plugin-api/Haskell/Ide/Engine/PluginDescriptor.hs | bsd-3-clause | -- | Build a command, ensuring the command response type name and the command
-- function match
buildCommand :: forall a s cxts tags. (ValidResponse a, KnownSymbol s)
=> CommandFunc a
-> Proxy s
-> T.Text
-> [T.Text]
-> Rec SAcceptedContext cxts
-> Rec SParamDescription tags
-> NamedCommand ( 'CommandType... | 795 | buildCommand :: forall a s cxts tags. (ValidResponse a, KnownSymbol s)
=> CommandFunc a
-> Proxy s
-> T.Text
-> [T.Text]
-> Rec SAcceptedContext cxts
-> Rec SParamDescription tags
-> NamedCommand ( 'CommandType s cxts tags )
buildCommand fun n d exts ctxs parm =
NamedCommand n $
Command {cmdDesc =
... | 699 | buildCommand fun n d exts ctxs parm =
NamedCommand n $
Command {cmdDesc =
CommandDesc {cmdName = T.pack $ symbolVal n
,cmdUiDescription = d
,cmdFileExtensions = exts
,cmdContexts = ctxs
,cmdAdditionalParams =... | 460 | true | true | 2 | 17 | 286 | 207 | 110 | 97 | null | null |
green-haskell/ghc | libraries/base/System/Posix/Internals.hs | bsd-3-clause | fileType :: FilePath -> IO IODeviceType
fileType file =
allocaBytes sizeof_stat $ \ p_stat -> do
withFilePath file $ \p_file -> do
throwErrnoIfMinus1Retry_ "fileType" $
c_stat p_file p_stat
statGetType p_stat
-- NOTE: On Win32 platforms, this will only work with file descriptors
-- referring to file ... | 361 | fileType :: FilePath -> IO IODeviceType
fileType file =
allocaBytes sizeof_stat $ \ p_stat -> do
withFilePath file $ \p_file -> do
throwErrnoIfMinus1Retry_ "fileType" $
c_stat p_file p_stat
statGetType p_stat
-- NOTE: On Win32 platforms, this will only work with file descriptors
-- referring to file ... | 361 | fileType file =
allocaBytes sizeof_stat $ \ p_stat -> do
withFilePath file $ \p_file -> do
throwErrnoIfMinus1Retry_ "fileType" $
c_stat p_file p_stat
statGetType p_stat
-- NOTE: On Win32 platforms, this will only work with file descriptors
-- referring to file handles. i.e., it'll fail for socket FDs... | 321 | false | true | 0 | 14 | 71 | 71 | 33 | 38 | null | null |
brendanhay/gogol | gogol-cloudtasks/gen/Network/Google/Resource/CloudTasks/Projects/Locations/Queues/Get.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
plqgUploadProtocol :: Lens' ProjectsLocationsQueuesGet (Maybe Text)
plqgUploadProtocol
= lens _plqgUploadProtocol
(\ s a -> s{_plqgUploadProtocol = a}) | 221 | plqgUploadProtocol :: Lens' ProjectsLocationsQueuesGet (Maybe Text)
plqgUploadProtocol
= lens _plqgUploadProtocol
(\ s a -> s{_plqgUploadProtocol = a}) | 159 | plqgUploadProtocol
= lens _plqgUploadProtocol
(\ s a -> s{_plqgUploadProtocol = a}) | 91 | true | true | 1 | 9 | 33 | 51 | 25 | 26 | null | null |
ocramz/petsc-hs | src/Numerical/PETSc/Test.hs | gpl-3.0 | -- --
-- -- | block matrix assembly
-- asdf = idxV ne i where
-- i = 1
-- ne = 4
-- t12' =
-- withMatCreateSetup1 cw mm mm MatAij -- MatMPIBaij
-- (`matSetBlockSize` ne)
-- (\mat -> do
-- -- matSeqAIJSetPreallocation mat nzpr (replicate ne ne)
-- matMPIAIJSetPreallocationConstNZPR mat nzpr... | 4,811 | t18d3' =
-- withVecMPIPipeline (VecInfo commWorld n n)
withVec (vecCreateMPIFromVectorDecideLocalSize cw w) $ \x ->
withVecClone x $ \xtemp ->
withMatCreateSetup cw n n MatAij $ \jac ->
withSnesCreateSetup cw (\snes -> do
snesSetFunction snes xtemp f
s... | 842 | t18d3' =
-- withVecMPIPipeline (VecInfo commWorld n n)
withVec (vecCreateMPIFromVectorDecideLocalSize cw w) $ \x ->
withVecClone x $ \xtemp ->
withMatCreateSetup cw n n MatAij $ \jac ->
withSnesCreateSetup cw (\snes -> do
snesSetFunction snes xtemp f
s... | 842 | true | false | 4 | 19 | 1,347 | 323 | 224 | 99 | null | null |
Deewiant/haschoo | Haschoo/Evaluator/Standard/Equivalence.hs | bsd-3-clause | scmEqv a b =
if isNumeric a && isNumeric b
then return$ isExact a == isExact b && numEq a b
else ptrEq a b | 121 | scmEqv a b =
if isNumeric a && isNumeric b
then return$ isExact a == isExact b && numEq a b
else ptrEq a b | 121 | scmEqv a b =
if isNumeric a && isNumeric b
then return$ isExact a == isExact b && numEq a b
else ptrEq a b | 121 | false | false | 1 | 9 | 39 | 63 | 26 | 37 | null | null |
recursion-ninja/megaparsec | Text/Megaparsec/Error/Builder.hs | bsd-2-clause | -- | Lift an expected item into 'ET'.
expe :: ErrorItem t -> ET t
expe p = ET Nothing (E.singleton p) | 102 | expe :: ErrorItem t -> ET t
expe p = ET Nothing (E.singleton p) | 63 | expe p = ET Nothing (E.singleton p) | 35 | true | true | 0 | 8 | 22 | 38 | 18 | 20 | null | null |
trskop/cabal | Cabal/Distribution/Simple/GHCJS.hs | bsd-3-clause | guessC2hsFromGhcjsPath :: ConfiguredProgram -> Verbosity
-> ProgramSearchPath -> IO (Maybe FilePath)
guessC2hsFromGhcjsPath = guessToolFromGhcjsPath c2hsProgram | 183 | guessC2hsFromGhcjsPath :: ConfiguredProgram -> Verbosity
-> ProgramSearchPath -> IO (Maybe FilePath)
guessC2hsFromGhcjsPath = guessToolFromGhcjsPath c2hsProgram | 183 | guessC2hsFromGhcjsPath = guessToolFromGhcjsPath c2hsProgram | 59 | false | true | 0 | 10 | 37 | 35 | 17 | 18 | null | null |
gridaphobe/liquid-fixpoint | src/Language/Fixpoint/Types/Names.hs | bsd-3-clause | bitVecName = "BitVec" | 23 | bitVecName = "BitVec" | 23 | bitVecName = "BitVec" | 23 | false | false | 0 | 4 | 4 | 6 | 3 | 3 | null | null |
dgvncsz0f/nws | src/Jerimum/Storage/LMDB/Segment.hs | bsd-3-clause | bounds (RTx (env, txn)) =
bracket
(mdb_dbi_open txn Nothing [])
(mdb_dbi_close env)
(\dbi -> bracket (mdb_cursor_open txn dbi) mdb_cursor_close readBounds)
where
readBounds cursor =
alloca $ \minPtr ->
alloca $ \maxPtr -> do
minOk <- mdb_cursor_get MDB_FIRST cursor minPtr nul... | 789 | bounds (RTx (env, txn)) =
bracket
(mdb_dbi_open txn Nothing [])
(mdb_dbi_close env)
(\dbi -> bracket (mdb_cursor_open txn dbi) mdb_cursor_close readBounds)
where
readBounds cursor =
alloca $ \minPtr ->
alloca $ \maxPtr -> do
minOk <- mdb_cursor_get MDB_FIRST cursor minPtr nul... | 789 | bounds (RTx (env, txn)) =
bracket
(mdb_dbi_open txn Nothing [])
(mdb_dbi_close env)
(\dbi -> bracket (mdb_cursor_open txn dbi) mdb_cursor_close readBounds)
where
readBounds cursor =
alloca $ \minPtr ->
alloca $ \maxPtr -> do
minOk <- mdb_cursor_get MDB_FIRST cursor minPtr nul... | 789 | false | false | 0 | 17 | 244 | 202 | 98 | 104 | null | null |
BartoszMilewski/ThreeDee | src/Diagram.hs | mit | transformDiagram :: Vector2 -> Diagram -> Diagram
transformDiagram d diag = zSort $ diag { points = map (transformPoint a b) (points diag) }
where -- convert delta to two angles (somewhat arbitrarily)
a = atan2 (-(vx d)) eyeZ
b = atan2 (-(vy d)) eyeZ | 265 | transformDiagram :: Vector2 -> Diagram -> Diagram
transformDiagram d diag = zSort $ diag { points = map (transformPoint a b) (points diag) }
where -- convert delta to two angles (somewhat arbitrarily)
a = atan2 (-(vx d)) eyeZ
b = atan2 (-(vy d)) eyeZ | 265 | transformDiagram d diag = zSort $ diag { points = map (transformPoint a b) (points diag) }
where -- convert delta to two angles (somewhat arbitrarily)
a = atan2 (-(vx d)) eyeZ
b = atan2 (-(vy d)) eyeZ | 215 | false | true | 1 | 10 | 59 | 101 | 52 | 49 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/GlobalOperations/List.hs | mpl-2.0 | -- | Project ID for this request.
golProject :: Lens' GlobalOperationsList Text
golProject
= lens _golProject (\ s a -> s{_golProject = a}) | 141 | golProject :: Lens' GlobalOperationsList Text
golProject
= lens _golProject (\ s a -> s{_golProject = a}) | 107 | golProject
= lens _golProject (\ s a -> s{_golProject = a}) | 61 | true | true | 0 | 9 | 24 | 42 | 22 | 20 | null | null |
ismailmustafa/NJDOT-FuelUp-API | src/Database.hs | bsd-3-clause | -- Create tables and insert CSV data into database
initializeDB :: IO ()
initializeDB = do
conn <- open "njdot-fuelup.db"
execute_ conn "CREATE TABLE IF NOT EXISTS bridges ( \n\
\ bridgeId INTEGER PRIMARY KEY,\n\
\ bridgeOwner TEXT, \n\
... | 1,976 | initializeDB :: IO ()
initializeDB = do
conn <- open "njdot-fuelup.db"
execute_ conn "CREATE TABLE IF NOT EXISTS bridges ( \n\
\ bridgeId INTEGER PRIMARY KEY,\n\
\ bridgeOwner TEXT, \n\
\ bridgeRoute TEXT, ... | 1,925 | initializeDB = do
conn <- open "njdot-fuelup.db"
execute_ conn "CREATE TABLE IF NOT EXISTS bridges ( \n\
\ bridgeId INTEGER PRIMARY KEY,\n\
\ bridgeOwner TEXT, \n\
\ bridgeRoute TEXT, \n\
... | 1,903 | true | true | 0 | 10 | 1,058 | 107 | 44 | 63 | null | null |
benekastah/ebitor | src/Ebitor/Events/JSON.hs | bsd-3-clause | keyToString KDel = "Del" | 24 | keyToString KDel = "Del" | 24 | keyToString KDel = "Del" | 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
hvr/vector | Data/Vector/Generic.hs | bsd-3-clause | foldM m z = Bundle.foldM m z . stream | 37 | foldM m z = Bundle.foldM m z . stream | 37 | foldM m z = Bundle.foldM m z . stream | 37 | false | false | 0 | 7 | 8 | 22 | 10 | 12 | null | null |
knupfer/ninety-nine | test/Main.hs | gpl-2.0 | p57' :: [Int] -> Tree Int
p57' = foldl add Empty
where add Empty x = leaf x
add (Branch a l r) x | a < x = Branch a (add l x) r
| a > x = Branch a l (add r x)
| otherwise = Branch a l r | 261 | p57' :: [Int] -> Tree Int
p57' = foldl add Empty
where add Empty x = leaf x
add (Branch a l r) x | a < x = Branch a (add l x) r
| a > x = Branch a l (add r x)
| otherwise = Branch a l r | 261 | p57' = foldl add Empty
where add Empty x = leaf x
add (Branch a l r) x | a < x = Branch a (add l x) r
| a > x = Branch a l (add r x)
| otherwise = Branch a l r | 235 | false | true | 1 | 8 | 128 | 152 | 65 | 87 | null | null |
dagit/helisp | src/X86_32Regs.hs | bsd-3-clause | esp :: Reg32
esp = Esp | 22 | esp :: Reg32
esp = Esp | 22 | esp = Esp | 9 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
kazu-yamamoto/word8 | Data/Word8.hs | bsd-3-clause | _hyphen = 0x2d | 19 | _hyphen = 0x2d | 19 | _hyphen = 0x2d | 19 | false | false | 1 | 5 | 7 | 10 | 3 | 7 | null | null |
jacekszymanski/wxHaskell | samples/wx/TimeFlows.hs | lgpl-2.1 | -- Translate time/word pairs to position/word pairs given the mouse position history.
wordPositionsAt :: History -> [(Time,String)] -> [(Point,String)]
wordPositionsAt history timedWords
= [(posAtTime t history, word) | (t,word) <- timedWords] | 245 | wordPositionsAt :: History -> [(Time,String)] -> [(Point,String)]
wordPositionsAt history timedWords
= [(posAtTime t history, word) | (t,word) <- timedWords] | 159 | wordPositionsAt history timedWords
= [(posAtTime t history, word) | (t,word) <- timedWords] | 93 | true | true | 0 | 10 | 32 | 77 | 42 | 35 | null | null |
keithodulaigh/Hets | QBF/Analysis.hs | gpl-2.0 | propsOfFormula (AS_BASIC.Equivalence form1 form2 _) = Sign.unite
(propsOfFormula form1)
(propsOfFormula form2) | 196 | propsOfFormula (AS_BASIC.Equivalence form1 form2 _) = Sign.unite
(propsOfFormula form1)
(propsOfFormula form2) | 196 | propsOfFormula (AS_BASIC.Equivalence form1 form2 _) = Sign.unite
(propsOfFormula form1)
(propsOfFormula form2) | 196 | false | false | 0 | 8 | 96 | 40 | 19 | 21 | null | null |
grwlf/vsim | src/VSim.hs | gpl-3.0 | shortName :: WLHierNameWPath -> String
shortName (WithLoc _ (_,(n:_))) = BS.unpack n | 85 | shortName :: WLHierNameWPath -> String
shortName (WithLoc _ (_,(n:_))) = BS.unpack n | 84 | shortName (WithLoc _ (_,(n:_))) = BS.unpack n | 45 | false | true | 0 | 10 | 12 | 44 | 23 | 21 | null | null |
input-output-hk/pos-haskell-prototype | chain/test/Test/Pos/Chain/Txp/CoreSpec.hs | mit | -- | Produces acyclic oriented graph of transactions. It's
-- connected. Signatures are faked and thus fail to
-- verify. Transaction balance is bad too (input can be less than
-- output). These properties are not needed for topsort test. It also
-- returns reachability map as the second argument (for every key
-- elem... | 452 | txAcyclicGen :: Bool -> Int -> Gen ([Tx], HM.HashMap Tx [Tx])
txAcyclicGen _ 0 = pure ([], HM.empty) | 100 | txAcyclicGen _ 0 = pure ([], HM.empty) | 38 | true | true | 0 | 11 | 78 | 70 | 38 | 32 | null | null |
lukexi/ghc | compiler/main/DynFlags.hs | bsd-3-clause | flagsAll :: [Flag (CmdLineP DynFlags)]
flagsAll = package_flags ++ dynamic_flags | 84 | flagsAll :: [Flag (CmdLineP DynFlags)]
flagsAll = package_flags ++ dynamic_flags | 84 | flagsAll = package_flags ++ dynamic_flags | 45 | false | true | 1 | 8 | 13 | 31 | 14 | 17 | null | null |
fredun/compiler | src/Core/Typing.hs | mit | typeOfConstant :: Term.Constant -> Type.Primitive
typeOfConstant constant =
case constant of
Term.NumericConstant numeric ->
Type.NumericPrimitive (typeOfNumeric numeric)
Term.BooleanConstant _ ->
Type.BooleanPrimitive
Term.StringConstant _ ->
Type.StringPrimitive
Term.CharConsta... | 352 | typeOfConstant :: Term.Constant -> Type.Primitive
typeOfConstant constant =
case constant of
Term.NumericConstant numeric ->
Type.NumericPrimitive (typeOfNumeric numeric)
Term.BooleanConstant _ ->
Type.BooleanPrimitive
Term.StringConstant _ ->
Type.StringPrimitive
Term.CharConsta... | 352 | typeOfConstant constant =
case constant of
Term.NumericConstant numeric ->
Type.NumericPrimitive (typeOfNumeric numeric)
Term.BooleanConstant _ ->
Type.BooleanPrimitive
Term.StringConstant _ ->
Type.StringPrimitive
Term.CharConstant _ ->
Type.CharPrimitive | 302 | false | true | 6 | 8 | 74 | 83 | 41 | 42 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.