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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Zigazou/HaMinitel | src/Minitel/Generate/Generator.hs | gpl-3.0 | mReverse False = [C0.ESC, PSCFS.NPO] | 36 | mReverse False = [C0.ESC, PSCFS.NPO] | 36 | mReverse False = [C0.ESC, PSCFS.NPO] | 36 | false | false | 0 | 6 | 4 | 19 | 10 | 9 | null | null |
ihc/futhark | src/Futhark/Optimise/Simplifier/Engine.hs | isc | passNeed :: SimpleM lore (a, Need (Wise lore) -> Need (Wise lore)) -> SimpleM lore a
passNeed = pass | 100 | passNeed :: SimpleM lore (a, Need (Wise lore) -> Need (Wise lore)) -> SimpleM lore a
passNeed = pass | 100 | passNeed = pass | 15 | false | true | 0 | 11 | 18 | 53 | 26 | 27 | null | null |
gridaphobe/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | eqResult OrdGE = true_Expr | 31 | eqResult OrdGE = true_Expr | 31 | eqResult OrdGE = true_Expr | 31 | false | false | 0 | 5 | 8 | 9 | 4 | 5 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT46.hs | gpl-3.0 | half (S (S x)) = S (half x) | 27 | half (S (S x)) = S (half x) | 27 | half (S (S x)) = S (half x) | 27 | false | false | 0 | 8 | 7 | 31 | 14 | 17 | null | null |
substack/hsopenid | src/Text/XRDS.hs | bsd-3-clause | - Parsing ---------------------------------------------------------------------
parseXRDS :: String -> Maybe XRDS
parseXRDS str = do
doc <- parseXMLDoc str
let xrds = filterChildren (tag "XRD") doc
return $ map parseXRD xrds
| 233 | parseXRDS :: String -> Maybe XRDS
parseXRDS str = do
doc <- parseXMLDoc str
let xrds = filterChildren (tag "XRD") doc
return $ map parseXRD xrds | 150 | parseXRDS str = do
doc <- parseXMLDoc str
let xrds = filterChildren (tag "XRD") doc
return $ map parseXRD xrds | 116 | true | true | 0 | 12 | 37 | 69 | 31 | 38 | null | null |
typelead/epm | epm/Distribution/Client/Config.hs | bsd-3-clause | deprecatedFieldDescriptions :: [FieldDescr SavedConfig]
deprecatedFieldDescriptions =
[ liftGlobalFlag $
listField "repos"
(Disp.text . showRepo) parseRepo
(fromNubList . globalRemoteRepos)
(\rs cfg -> cfg { globalRemoteRepos = toNubList rs })
, liftGlobalFlag $
simpleField "cachedir"
... | 1,250 | deprecatedFieldDescriptions :: [FieldDescr SavedConfig]
deprecatedFieldDescriptions =
[ liftGlobalFlag $
listField "repos"
(Disp.text . showRepo) parseRepo
(fromNubList . globalRemoteRepos)
(\rs cfg -> cfg { globalRemoteRepos = toNubList rs })
, liftGlobalFlag $
simpleField "cachedir"
... | 1,250 | deprecatedFieldDescriptions =
[ liftGlobalFlag $
listField "repos"
(Disp.text . showRepo) parseRepo
(fromNubList . globalRemoteRepos)
(\rs cfg -> cfg { globalRemoteRepos = toNubList rs })
, liftGlobalFlag $
simpleField "cachedir"
(Disp.text . fromFlagOrDefault "") (optional parseFile... | 1,194 | false | true | 8 | 12 | 267 | 385 | 200 | 185 | null | null |
bitemyapp/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | isFFILabelTy :: Type -> Validity
-- The type of a foreign label must be Ptr, FunPtr, or a newtype of either.
isFFILabelTy ty = checkRepTyCon ok ty extra
where
ok tc = tc `hasKey` funPtrTyConKey || tc `hasKey` ptrTyConKey
extra = ptext (sLit "A foreign-imported address (via &foo) must have type (Ptr a) or (Fun... | 328 | isFFILabelTy :: Type -> Validity
isFFILabelTy ty = checkRepTyCon ok ty extra
where
ok tc = tc `hasKey` funPtrTyConKey || tc `hasKey` ptrTyConKey
extra = ptext (sLit "A foreign-imported address (via &foo) must have type (Ptr a) or (FunPtr a)") | 252 | isFFILabelTy ty = checkRepTyCon ok ty extra
where
ok tc = tc `hasKey` funPtrTyConKey || tc `hasKey` ptrTyConKey
extra = ptext (sLit "A foreign-imported address (via &foo) must have type (Ptr a) or (FunPtr a)") | 219 | true | true | 2 | 7 | 65 | 82 | 37 | 45 | null | null |
rolph-recto/liquidhaskell | src/Language/Haskell/Liquid/Parse.hs | bsd-3-clause | remParseError :: SourceName -> String -> String -> ParseError
---------------------------------------------------------------------------
remParseError f s r = newErrorMessage msg $ newPos f line col
where
msg = Message "Leftover while parsing"
(line, col) = remLineCol s r | 305 | remParseError :: SourceName -> String -> String -> ParseError
remParseError f s r = newErrorMessage msg $ newPos f line col
where
msg = Message "Leftover while parsing"
(line, col) = remLineCol s r | 229 | remParseError f s r = newErrorMessage msg $ newPos f line col
where
msg = Message "Leftover while parsing"
(line, col) = remLineCol s r | 161 | true | true | 0 | 7 | 66 | 73 | 36 | 37 | null | null |
hferreiro/replay | compiler/codeGen/StgCmmForeign.hs | bsd-3-clause | closeNursery :: DynFlags -> CmmAGraph
closeNursery dflags = mkStore (nursery_bdescr_free dflags) (cmmOffsetW dflags stgHp 1) | 124 | closeNursery :: DynFlags -> CmmAGraph
closeNursery dflags = mkStore (nursery_bdescr_free dflags) (cmmOffsetW dflags stgHp 1) | 124 | closeNursery dflags = mkStore (nursery_bdescr_free dflags) (cmmOffsetW dflags stgHp 1) | 86 | false | true | 0 | 7 | 14 | 39 | 19 | 20 | null | null |
nishiuramakoto/logiku | Handler/PrologProgram.hs | gpl-3.0 | readInt :: Text -> Maybe Int
readInt s = case reads (T.unpack s) of
[(i, s')] -> if s' == "" then Just i else Nothing
_ -> Nothing | 142 | readInt :: Text -> Maybe Int
readInt s = case reads (T.unpack s) of
[(i, s')] -> if s' == "" then Just i else Nothing
_ -> Nothing | 142 | readInt s = case reads (T.unpack s) of
[(i, s')] -> if s' == "" then Just i else Nothing
_ -> Nothing | 113 | false | true | 0 | 9 | 40 | 77 | 38 | 39 | null | null |
bermanjosh/bloodhound | tests/V1/tests.hs | bsd-3-clause | es14 :: Vers.Version
es14 = Vers.Version [1, 4, 0] [] | 53 | es14 :: Vers.Version
es14 = Vers.Version [1, 4, 0] [] | 53 | es14 = Vers.Version [1, 4, 0] [] | 32 | false | true | 0 | 6 | 9 | 31 | 17 | 14 | null | null |
RaphMad/ZMachine | src/lib/ZMachine/ZTypes.hs | mit | bit9 = BitNumber 9 | 18 | bit9 = BitNumber 9 | 18 | bit9 = BitNumber 9 | 18 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ComputationWithBoundedResources/tct-trs | src/Tct/Trs/Processor/Matrix/MI.hs | bsd-3-clause | budanConstraint :: Matrix IExpr -> SmtM (KindMatrices IExpr)
budanConstraint m =
let dim = Mat.nrows m
in case dim of
3 -> Smt.assert noRootsGreaterOne >> return (MMatrix m)
where p =
Smt.bigAdd
[ Mat.getEntry (1, 1) m
, Mat.getEntry (2, 2) m
... | 2,987 | budanConstraint :: Matrix IExpr -> SmtM (KindMatrices IExpr)
budanConstraint m =
let dim = Mat.nrows m
in case dim of
3 -> Smt.assert noRootsGreaterOne >> return (MMatrix m)
where p =
Smt.bigAdd
[ Mat.getEntry (1, 1) m
, Mat.getEntry (2, 2) m
... | 2,987 | budanConstraint m =
let dim = Mat.nrows m
in case dim of
3 -> Smt.assert noRootsGreaterOne >> return (MMatrix m)
where p =
Smt.bigAdd
[ Mat.getEntry (1, 1) m
, Mat.getEntry (2, 2) m
, Mat.getEntry (3, 3) m
]... | 2,926 | false | true | 0 | 20 | 1,627 | 935 | 498 | 437 | null | null |
mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Core31/Tokens.hs | bsd-3-clause | gl_FRAMEBUFFER_INCOMPLETE_READ_BUFFER :: GLenum
gl_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC | 94 | gl_FRAMEBUFFER_INCOMPLETE_READ_BUFFER :: GLenum
gl_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC | 94 | gl_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC | 46 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
koba-e964/hayashii-mcc | zekamashi/Emit.hs | bsd-3-clause | maybeRegOfString :: (Eq s, IsString s, Show s) => s -> Maybe Reg
maybeRegOfString s = case List.elemIndex s [fromString $ "$" ++ show i | i <- [0..31 :: Int]] of
Just r -> Just (Reg r)
Nothing -> Nothing | 208 | maybeRegOfString :: (Eq s, IsString s, Show s) => s -> Maybe Reg
maybeRegOfString s = case List.elemIndex s [fromString $ "$" ++ show i | i <- [0..31 :: Int]] of
Just r -> Just (Reg r)
Nothing -> Nothing | 208 | maybeRegOfString s = case List.elemIndex s [fromString $ "$" ++ show i | i <- [0..31 :: Int]] of
Just r -> Just (Reg r)
Nothing -> Nothing | 143 | false | true | 0 | 10 | 45 | 107 | 53 | 54 | null | null |
christiaanb/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | inRange_RDR = varQual_RDR gHC_ARR (fsLit "inRange") | 63 | inRange_RDR = varQual_RDR gHC_ARR (fsLit "inRange") | 63 | inRange_RDR = varQual_RDR gHC_ARR (fsLit "inRange") | 63 | false | false | 0 | 7 | 17 | 17 | 8 | 9 | null | null |
lih/Alpha | src/Format.hs | bsd-2-clause | raw entry = F ("raw:"++show entry) entry 0 (const $ return nullPtr) | 67 | raw entry = F ("raw:"++show entry) entry 0 (const $ return nullPtr) | 67 | raw entry = F ("raw:"++show entry) entry 0 (const $ return nullPtr) | 67 | false | false | 0 | 8 | 11 | 38 | 18 | 20 | null | null |
phischu/fragnix | builtins/base/GHC.Stable.hs | bsd-3-clause | -- |
-- Create a stable pointer referring to the given Haskell value.
--
newStablePtr :: a -> IO (StablePtr a)
newStablePtr a = IO $ \ s ->
case makeStablePtr# a s of (# s', sp #) -> (# s', StablePtr sp #)
-- |
-- Obtain the Haskell value referenced by a stable pointer, i.e., the
-- same value that was passed to... | 506 | newStablePtr :: a -> IO (StablePtr a)
newStablePtr a = IO $ \ s ->
case makeStablePtr# a s of (# s', sp #) -> (# s', StablePtr sp #)
-- |
-- Obtain the Haskell value referenced by a stable pointer, i.e., the
-- same value that was passed to the corresponding call to
-- 'makeStablePtr'. If the argument to 'deRef... | 433 | newStablePtr a = IO $ \ s ->
case makeStablePtr# a s of (# s', sp #) -> (# s', StablePtr sp #)
-- |
-- Obtain the Haskell value referenced by a stable pointer, i.e., the
-- same value that was passed to the corresponding call to
-- 'makeStablePtr'. If the argument to 'deRefStablePtr' has
-- already been freed usi... | 393 | true | true | 0 | 11 | 98 | 74 | 42 | 32 | null | null |
kazu-yamamoto/domain-auth | Network/DomainAuth/DK/Verify.hs | bsd-3-clause | canonDkField :: DkCanonAlgo -> Field -> ByteString
canonDkField DK_SIMPLE fld = fieldKey fld +++ ": " +++ fieldValueFolded fld | 126 | canonDkField :: DkCanonAlgo -> Field -> ByteString
canonDkField DK_SIMPLE fld = fieldKey fld +++ ": " +++ fieldValueFolded fld | 126 | canonDkField DK_SIMPLE fld = fieldKey fld +++ ": " +++ fieldValueFolded fld | 75 | false | true | 0 | 7 | 18 | 38 | 18 | 20 | null | null |
EXio4/zyflex | src/Pregu.hs | gpl-3.0 | preguntados :: [Sect]
preguntados =
[Sect
"GEOGRAFÍA"
[Preg
"1. ¿Cuantas sedes tiene la facu?"
[],
Preg
"2. ¿En qué ciudad está la Sede Central?"
[],
Preg
"3. ¿Podes estudiar en Victoria?"
[],
Preg
"4. ¿Cuál es la sede que se encuentra más al norte de ... | 1,993 | preguntados :: [Sect]
preguntados =
[Sect
"GEOGRAFÍA"
[Preg
"1. ¿Cuantas sedes tiene la facu?"
[],
Preg
"2. ¿En qué ciudad está la Sede Central?"
[],
Preg
"3. ¿Podes estudiar en Victoria?"
[],
Preg
"4. ¿Cuál es la sede que se encuentra más al norte de ... | 1,993 | preguntados =
[Sect
"GEOGRAFÍA"
[Preg
"1. ¿Cuantas sedes tiene la facu?"
[],
Preg
"2. ¿En qué ciudad está la Sede Central?"
[],
Preg
"3. ¿Podes estudiar en Victoria?"
[],
Preg
"4. ¿Cuál es la sede que se encuentra más al norte de la provincia?"
[... | 1,971 | false | true | 0 | 11 | 649 | 291 | 144 | 147 | null | null |
quchen/stg | src/Stg/Machine/GarbageCollection/TriStateTracing.hs | bsd-3-clause | garbageCollect :: StgState -> (Set MemAddr, StgState)
garbageCollect stgState@StgState
{ stgCode = code
, stgHeap = heap
, stgGlobals = globals
, stgStack = stack }
= let GcState {aliveHeap = alive, oldHeap = Heap dead}
= until everythingCollected gcStep start
start = GcSta... | 571 | garbageCollect :: StgState -> (Set MemAddr, StgState)
garbageCollect stgState@StgState
{ stgCode = code
, stgHeap = heap
, stgGlobals = globals
, stgStack = stack }
= let GcState {aliveHeap = alive, oldHeap = Heap dead}
= until everythingCollected gcStep start
start = GcSta... | 571 | garbageCollect stgState@StgState
{ stgCode = code
, stgHeap = heap
, stgGlobals = globals
, stgStack = stack }
= let GcState {aliveHeap = alive, oldHeap = Heap dead}
= until everythingCollected gcStep start
start = GcState
{ aliveHeap = mempty
, oldH... | 517 | false | true | 7 | 13 | 186 | 176 | 93 | 83 | null | null |
jff/TeLLer | src/Parser.hs | gpl-3.0 | construct :: Parser b -> (a -> a -> a) -> Parser (a -> a -> a)
construct p c = p >> return c | 92 | construct :: Parser b -> (a -> a -> a) -> Parser (a -> a -> a)
construct p c = p >> return c | 92 | construct p c = p >> return c | 29 | false | true | 0 | 10 | 24 | 59 | 29 | 30 | null | null |
andreashug/ninty-nine-problems | haskell/src/lists.hs | unlicense | lastButOne (_:ys) = lastButOne ys | 33 | lastButOne (_:ys) = lastButOne ys | 33 | lastButOne (_:ys) = lastButOne ys | 33 | false | false | 0 | 6 | 4 | 20 | 9 | 11 | null | null |
allonsy/mailServer | src/EncryptMail.hs | mit | decryptEmail :: EncryptedEmail -> Key -> Key -> (Mail, Bool)
decryptEmail m pub priv = (retMail, verfy) where
header = read $ decryptMessage (encHdr m) priv
cont = read $ decryptMessage (encContents m) priv
retMail = Mail (idEnc m) header cont (encSig m)
verfy = verifySig ((show (changeBCC header [])) +... | 565 | decryptEmail :: EncryptedEmail -> Key -> Key -> (Mail, Bool)
decryptEmail m pub priv = (retMail, verfy) where
header = read $ decryptMessage (encHdr m) priv
cont = read $ decryptMessage (encContents m) priv
retMail = Mail (idEnc m) header cont (encSig m)
verfy = verifySig ((show (changeBCC header [])) +... | 565 | decryptEmail m pub priv = (retMail, verfy) where
header = read $ decryptMessage (encHdr m) priv
cont = read $ decryptMessage (encContents m) priv
retMail = Mail (idEnc m) header cont (encSig m)
verfy = verifySig ((show (changeBCC header [])) ++ cont) (encSig m) pub
--given a message to send, AES key, ... | 504 | false | true | 0 | 12 | 110 | 154 | 82 | 72 | null | null |
mdsteele/pylos | src/Pylos/Draw.hs | gpl-3.0 | -- needed for unsafePerformIO
fontCache :: HT.HashTable (FilePath, Int) Font
fontCache = unsafePerformIO $ HT.new (==) hash
where hash (str, int) = HT.hashString str `xor` HT.hashInt int | 188 | fontCache :: HT.HashTable (FilePath, Int) Font
fontCache = unsafePerformIO $ HT.new (==) hash
where hash (str, int) = HT.hashString str `xor` HT.hashInt int | 158 | fontCache = unsafePerformIO $ HT.new (==) hash
where hash (str, int) = HT.hashString str `xor` HT.hashInt int | 111 | true | true | 1 | 7 | 28 | 75 | 38 | 37 | null | null |
acowley/ghc | compiler/utils/Outputable.hs | bsd-3-clause | angleBrackets d = char '<' <> d <> char '>' | 43 | angleBrackets d = char '<' <> d <> char '>' | 43 | angleBrackets d = char '<' <> d <> char '>' | 43 | false | false | 0 | 7 | 9 | 23 | 10 | 13 | null | null |
butchhoward/haskel_scheme | Main.hs | mit | parseList :: Parser LispVal
parseList = liftM List $ sepBy parseExpr spaces | 75 | parseList :: Parser LispVal
parseList = liftM List $ sepBy parseExpr spaces | 75 | parseList = liftM List $ sepBy parseExpr spaces | 47 | false | true | 1 | 6 | 11 | 29 | 12 | 17 | null | null |
dmbarbour/haskell-vcache | hsrc_lib/Database/VCache/VTx.hs | bsd-2-clause | -- Track which threads are waiting on a commit signal.
updateSync :: Bool -> MVar () -> [MVar ()] -> [MVar ()]
updateSync bSync v = if bSync then (v:) else id | 158 | updateSync :: Bool -> MVar () -> [MVar ()] -> [MVar ()]
updateSync bSync v = if bSync then (v:) else id | 103 | updateSync bSync v = if bSync then (v:) else id | 47 | true | true | 0 | 10 | 31 | 62 | 33 | 29 | null | null |
adunning/pandoc-citeproc | src/Text/CSL/Eval/Date.hs | bsd-3-clause | formatDate :: EvalMode -> String -> [CslTerm] -> [DatePart] -> [RefDate] -> [Output]
formatDate em k tm dp date
| [d] <- date = concatMap (formatDatePart d) dp
| (a:b:_) <- date = addODate . concat $ doRange a b
| otherwise = []
where
addODate [] = []
addODate xs = [ODate xs]
... | 4,143 | formatDate :: EvalMode -> String -> [CslTerm] -> [DatePart] -> [RefDate] -> [Output]
formatDate em k tm dp date
| [d] <- date = concatMap (formatDatePart d) dp
| (a:b:_) <- date = addODate . concat $ doRange a b
| otherwise = []
where
addODate [] = []
addODate xs = [ODate xs]
... | 4,143 | formatDate em k tm dp date
| [d] <- date = concatMap (formatDatePart d) dp
| (a:b:_) <- date = addODate . concat $ doRange a b
| otherwise = []
where
addODate [] = []
addODate xs = [ODate xs]
splitDate a b = case split (onSublist $ diff a b dp) dp of
[... | 4,058 | false | true | 0 | 18 | 1,933 | 1,534 | 751 | 783 | null | null |
typelead/epm | epm/Main.hs | bsd-3-clause | replAction :: (ReplFlags, BuildExFlags) -> [String] -> GlobalFlags -> IO ()
replAction (replFlags, buildExFlags) extraArgs globalFlags = do
cwd <- getCurrentDirectory
pkgDesc <- findPackageDesc cwd
either (const onNoPkgDesc) (const onPkgDesc) pkgDesc
where
verbosity = fromFlagOrDefault normal (replVerbo... | 3,794 | replAction :: (ReplFlags, BuildExFlags) -> [String] -> GlobalFlags -> IO ()
replAction (replFlags, buildExFlags) extraArgs globalFlags = do
cwd <- getCurrentDirectory
pkgDesc <- findPackageDesc cwd
either (const onNoPkgDesc) (const onPkgDesc) pkgDesc
where
verbosity = fromFlagOrDefault normal (replVerbo... | 3,794 | replAction (replFlags, buildExFlags) extraArgs globalFlags = do
cwd <- getCurrentDirectory
pkgDesc <- findPackageDesc cwd
either (const onNoPkgDesc) (const onPkgDesc) pkgDesc
where
verbosity = fromFlagOrDefault normal (replVerbosity replFlags)
-- There is a .cabal file in the current directory: sta... | 3,718 | false | true | 0 | 15 | 899 | 431 | 234 | 197 | null | null |
Philonous/pontarius-xmpp-e2e | source/Pontarius/E2E/Monad.hs | apache-2.0 | runRand :: g -> Rand g a -> (a, g)
runRand g = runIdentity . runRandT g | 71 | runRand :: g -> Rand g a -> (a, g)
runRand g = runIdentity . runRandT g | 71 | runRand g = runIdentity . runRandT g | 36 | false | true | 0 | 7 | 16 | 40 | 20 | 20 | null | null |
cdepillabout/highlight | src/Highlight/Common/Color.hs | bsd-3-clause | -----------------------
-- Dull Bold Colors --
-----------------------
colorDullBlackBold :: ByteString
colorDullBlackBold = colorBold `mappend` colorDullBlack | 160 | colorDullBlackBold :: ByteString
colorDullBlackBold = colorBold `mappend` colorDullBlack | 88 | colorDullBlackBold = colorBold `mappend` colorDullBlack | 55 | true | true | 0 | 6 | 15 | 29 | 15 | 14 | null | null |
uduki/hsQt | Qtc/Enums/Gui/QStackedLayout.hs | bsd-2-clause | eStackOne :: StackingMode
eStackOne
= ieStackingMode $ 0 | 58 | eStackOne :: StackingMode
eStackOne
= ieStackingMode $ 0 | 58 | eStackOne
= ieStackingMode $ 0 | 32 | false | true | 0 | 5 | 9 | 15 | 8 | 7 | null | null |
bitemyapp/ghc | libraries/base/GHC/Event/Manager.hs | bsd-3-clause | closeFd_ :: EventManager
-> IntTable [FdData]
-> Fd
-> IO (IO ())
closeFd_ mgr tbl fd = do
prev <- IT.delete (fromIntegral fd) tbl
case prev of
Nothing -> return (return ())
Just fds -> do
let oldEvs = eventsOf fds
when (oldEvs /= mempty) $ do
_ <- I.... | 630 | closeFd_ :: EventManager
-> IntTable [FdData]
-> Fd
-> IO (IO ())
closeFd_ mgr tbl fd = do
prev <- IT.delete (fromIntegral fd) tbl
case prev of
Nothing -> return (return ())
Just fds -> do
let oldEvs = eventsOf fds
when (oldEvs /= mempty) $ do
_ <- I.... | 630 | closeFd_ mgr tbl fd = do
prev <- IT.delete (fromIntegral fd) tbl
case prev of
Nothing -> return (return ())
Just fds -> do
let oldEvs = eventsOf fds
when (oldEvs /= mempty) $ do
_ <- I.modifyFd (emBackend mgr) fd oldEvs mempty
wakeManager mgr
return $
forM_ fds $ \... | 528 | false | true | 0 | 18 | 178 | 205 | 98 | 107 | null | null |
mfpi/hsys | src/Input/InputSodium.hs | mit | keyEvent :: GLFW.Key -> Event KeyEvent -> Event KeyEvent
keyEvent key = filterE (\(KeyEvent k _) -> k == key) | 109 | keyEvent :: GLFW.Key -> Event KeyEvent -> Event KeyEvent
keyEvent key = filterE (\(KeyEvent k _) -> k == key) | 109 | keyEvent key = filterE (\(KeyEvent k _) -> k == key) | 52 | false | true | 0 | 9 | 19 | 58 | 27 | 31 | null | null |
ganeti/ganeti | src/Ganeti/HTools/Backend/Luxi.hs | bsd-2-clause | -- | Wrapper over callMethod doing group query.
queryGroups :: L.Client -> IO (Result JSValue)
queryGroups = liftM errToResult . L.callMethod queryGroupsMsg | 156 | queryGroups :: L.Client -> IO (Result JSValue)
queryGroups = liftM errToResult . L.callMethod queryGroupsMsg | 108 | queryGroups = liftM errToResult . L.callMethod queryGroupsMsg | 61 | true | true | 1 | 9 | 21 | 45 | 20 | 25 | null | null |
snowleopard/shaking-up-ghc | src/Hadrian/Package.hs | bsd-3-clause | -- | Is this a library package?
isLibrary :: Package -> Bool
isLibrary (Package Library _ _) = True | 99 | isLibrary :: Package -> Bool
isLibrary (Package Library _ _) = True | 67 | isLibrary (Package Library _ _) = True | 38 | true | true | 0 | 7 | 18 | 29 | 15 | 14 | null | null |
petabricks/petabricks | scripts/oldtuner2/src/Petabricks.hs | mit | -- runs the given PetaBricks progrtam with the --name parameter and returns
-- the results if the run succeeds
programMainName :: Program -> IO (Either String String)
programMainName (Program root name) =
do (exitCode, stdout, stderr) <- readProcessWithExitCode (root ++ "/" ++ name) ["--name"] ""
case exitCo... | 427 | programMainName :: Program -> IO (Either String String)
programMainName (Program root name) =
do (exitCode, stdout, stderr) <- readProcessWithExitCode (root ++ "/" ++ name) ["--name"] ""
case exitCode of
ExitSuccess -> return $ Right $ init stdout
ExitFailure _ -> return $ Left stderr | 316 | programMainName (Program root name) =
do (exitCode, stdout, stderr) <- readProcessWithExitCode (root ++ "/" ++ name) ["--name"] ""
case exitCode of
ExitSuccess -> return $ Right $ init stdout
ExitFailure _ -> return $ Left stderr | 260 | true | true | 0 | 11 | 93 | 120 | 59 | 61 | null | null |
Reboare/Duchess | src/Identifiers/Infer/Parser.hs | bsd-3-clause | seperators :: String
seperators = ". _[]()" | 43 | seperators :: String
seperators = ". _[]()" | 43 | seperators = ". _[]()" | 22 | false | true | 0 | 4 | 6 | 11 | 6 | 5 | null | null |
romanb/amazonka | amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/Types.hs | mpl-2.0 | -- | The format of album art, if any. Valid formats are '.jpg' and '.png'.
aAlbumArtFormat :: Lens' Artwork (Maybe Text)
aAlbumArtFormat = lens _aAlbumArtFormat (\s a -> s { _aAlbumArtFormat = a }) | 197 | aAlbumArtFormat :: Lens' Artwork (Maybe Text)
aAlbumArtFormat = lens _aAlbumArtFormat (\s a -> s { _aAlbumArtFormat = a }) | 122 | aAlbumArtFormat = lens _aAlbumArtFormat (\s a -> s { _aAlbumArtFormat = a }) | 76 | true | true | 1 | 9 | 33 | 50 | 25 | 25 | null | null |
johnyhlee/baseball-sim | src/Baseball.hs | gpl-2.0 | pctForOutcomeBatter Batter{bPopPct=p} (Contact PopUp) = p | 57 | pctForOutcomeBatter Batter{bPopPct=p} (Contact PopUp) = p | 57 | pctForOutcomeBatter Batter{bPopPct=p} (Contact PopUp) = p | 57 | false | false | 0 | 8 | 5 | 26 | 13 | 13 | null | null |
Hara-Laboratory/subleq-mips | TestRFix2.hs | gpl-3.0 | prop_Srl :: SubleqUWord -> SubleqUWord -> SubleqUWord -> Bool
prop_Srl rd rt sa = [rt', s'] == [rt, s] && rd' == rt `shift` (-(fromIntegral s))
where
s = sa `mod` wordLength
[rd', rt', s'] = map fromIntegral $ executeSubroutine "srl" $ map fromIntegral [rd, rt, s] | 281 | prop_Srl :: SubleqUWord -> SubleqUWord -> SubleqUWord -> Bool
prop_Srl rd rt sa = [rt', s'] == [rt, s] && rd' == rt `shift` (-(fromIntegral s))
where
s = sa `mod` wordLength
[rd', rt', s'] = map fromIntegral $ executeSubroutine "srl" $ map fromIntegral [rd, rt, s] | 281 | prop_Srl rd rt sa = [rt', s'] == [rt, s] && rd' == rt `shift` (-(fromIntegral s))
where
s = sa `mod` wordLength
[rd', rt', s'] = map fromIntegral $ executeSubroutine "srl" $ map fromIntegral [rd, rt, s] | 219 | false | true | 0 | 9 | 63 | 127 | 70 | 57 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F32.hs | bsd-3-clause | ptr_glViewportIndexedfOES :: FunPtr (GLuint -> GLfloat -> GLfloat -> GLfloat -> GLfloat -> IO ())
ptr_glViewportIndexedfOES = unsafePerformIO $ getCommand "glViewportIndexedfOES" | 178 | ptr_glViewportIndexedfOES :: FunPtr (GLuint -> GLfloat -> GLfloat -> GLfloat -> GLfloat -> IO ())
ptr_glViewportIndexedfOES = unsafePerformIO $ getCommand "glViewportIndexedfOES" | 178 | ptr_glViewportIndexedfOES = unsafePerformIO $ getCommand "glViewportIndexedfOES" | 80 | false | true | 0 | 13 | 20 | 49 | 24 | 25 | null | null |
athanclark/sets | src/Data/Set/Unordered/Unique.hs | mit | -- | /O(n)/ - Guaranteed to be disjoint
partition :: (a -> Bool) -> UUSet a -> (UUSet a, UUSet a)
partition p (UUSet xs) = let (l,r) = List.partition p xs in (UUSet l, UUSet r) | 176 | partition :: (a -> Bool) -> UUSet a -> (UUSet a, UUSet a)
partition p (UUSet xs) = let (l,r) = List.partition p xs in (UUSet l, UUSet r) | 136 | partition p (UUSet xs) = let (l,r) = List.partition p xs in (UUSet l, UUSet r) | 78 | true | true | 0 | 10 | 36 | 90 | 45 | 45 | null | null |
jkarni/blog | src/site.hs | mit | -- | Change some of the default configuration variables. This makes our
-- project working directory a little cleaner.
hakyllConfig :: Configuration
hakyllConfig = def { providerDirectory = "preprocessed-site"
, storeDirectory = ".hakyll-cache"
, tmpDirectory = ".hakyll-cache/tmp"... | 402 | hakyllConfig :: Configuration
hakyllConfig = def { providerDirectory = "preprocessed-site"
, storeDirectory = ".hakyll-cache"
, tmpDirectory = ".hakyll-cache/tmp"
, destinationDirectory = "generated-site"
} | 282 | hakyllConfig = def { providerDirectory = "preprocessed-site"
, storeDirectory = ".hakyll-cache"
, tmpDirectory = ".hakyll-cache/tmp"
, destinationDirectory = "generated-site"
} | 252 | true | true | 0 | 7 | 118 | 49 | 27 | 22 | null | null |
iemxblog/hpcb | src/Hpcb/Data/Effects.hs | mit | -- | Modifies the size of a font.
-- This function is used by the 'Parameterized' typeclass.
fontSizeE :: (Float, Float) -- ^ New size
-> Effects
-> Effects
fontSizeE si (Effects (Font _ th st) d) = Effects (Font si th st) d | 248 | fontSizeE :: (Float, Float) -- ^ New size
-> Effects
-> Effects
fontSizeE si (Effects (Font _ th st) d) = Effects (Font si th st) d | 155 | fontSizeE si (Effects (Font _ th st) d) = Effects (Font si th st) d | 67 | true | true | 0 | 9 | 67 | 66 | 35 | 31 | null | null |
astynax/enhask | draft.hs | mit | -- [colOrVal val]
-- | sets the value of a form input (text,select,checkbox,etc...)
-- format (at node (setFormInput value))
setFormInput = undefined | 150 | setFormInput = undefined | 24 | setFormInput = undefined | 24 | true | false | 1 | 5 | 22 | 13 | 6 | 7 | null | null |
arcticmatt/happy-site | src/SqlTable.hs | bsd-3-clause | insertItemQ :: Query
insertItemQ = "INSERT INTO items VALUES (?, ?)" | 68 | insertItemQ :: Query
insertItemQ = "INSERT INTO items VALUES (?, ?)" | 68 | insertItemQ = "INSERT INTO items VALUES (?, ?)" | 47 | false | true | 0 | 4 | 10 | 11 | 6 | 5 | null | null |
klarh/hasdy | src/Hasdy/Vectors.hs | apache-2.0 | scale3' s v = pure3' s `times3'` v | 34 | scale3' s v = pure3' s `times3'` v | 34 | scale3' s v = pure3' s `times3'` v | 34 | false | false | 0 | 6 | 7 | 20 | 10 | 10 | null | null |
green-haskell/ghc | libraries/base/Data/OldList.hs | bsd-3-clause | zipWith5 _ _ _ _ _ _ = [] | 28 | zipWith5 _ _ _ _ _ _ = [] | 28 | zipWith5 _ _ _ _ _ _ = [] | 28 | false | false | 0 | 5 | 11 | 21 | 10 | 11 | null | null |
mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/NV/TextureShader.hs | bsd-3-clause | gl_DSDT8 :: GLenum
gl_DSDT8 = 0x8709 | 36 | gl_DSDT8 :: GLenum
gl_DSDT8 = 0x8709 | 36 | gl_DSDT8 = 0x8709 | 17 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
ekohl/ganeti | htools/Ganeti/HTools/Node.hs | gpl-2.0 | -- * Initialization functions
-- | Create a new node.
--
-- The index and the peers maps are empty, and will be need to be
-- update later via the 'setIdx' and 'buildPeers' functions.
create :: String -> Double -> Int -> Int -> Double
-> Int -> Double -> Bool -> T.Gdx -> Node
create name_init mem_t_init mem_n_i... | 1,323 | create :: String -> Double -> Int -> Int -> Double
-> Int -> Double -> Bool -> T.Gdx -> Node
create name_init mem_t_init mem_n_init mem_f_init
dsk_t_init dsk_f_init cpu_t_init offline_init group_init =
Node { name = name_init
, alias = name_init
, tMem = mem_t_init
, nMem = ... | 1,138 | create name_init mem_t_init mem_n_init mem_f_init
dsk_t_init dsk_f_init cpu_t_init offline_init group_init =
Node { name = name_init
, alias = name_init
, tMem = mem_t_init
, nMem = mem_n_init
, fMem = mem_f_init
, tDsk = dsk_t_init
, fDsk = dsk_f_init
... | 1,038 | true | true | 0 | 15 | 474 | 304 | 179 | 125 | null | null |
treeowl/machines | src/Data/Machine/Type.hs | bsd-3-clause | runT_ :: Monad m => MachineT m k b -> m ()
runT_ m = runMachineT m >>= \v -> case v of
Stop -> return ()
Yield _ k -> runT_ k
Await _ _ e -> runT_ e
-- | Stop feeding input into model and extract an answer | 221 | runT_ :: Monad m => MachineT m k b -> m ()
runT_ m = runMachineT m >>= \v -> case v of
Stop -> return ()
Yield _ k -> runT_ k
Await _ _ e -> runT_ e
-- | Stop feeding input into model and extract an answer | 221 | runT_ m = runMachineT m >>= \v -> case v of
Stop -> return ()
Yield _ k -> runT_ k
Await _ _ e -> runT_ e
-- | Stop feeding input into model and extract an answer | 178 | false | true | 0 | 11 | 66 | 95 | 44 | 51 | null | null |
fmthoma/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | tcSplitFunTysN
:: TcRhoType
-> Arity -- N: Number of desired args
-> ([TcSigmaType], -- Arg types (N or fewer)
TcSigmaType) -- The rest of the type
tcSplitFunTysN ty n_args
| n_args == 0
= ([], ty)
| Just (arg,res) <- tcSplitFunTy_maybe ty
= case t... | 419 | tcSplitFunTysN
:: TcRhoType
-> Arity -- N: Number of desired args
-> ([TcSigmaType], -- Arg types (N or fewer)
TcSigmaType)
tcSplitFunTysN ty n_args
| n_args == 0
= ([], ty)
| Just (arg,res) <- tcSplitFunTy_maybe ty
= case tcSplitFunTysN res (n_args - 1) o... | 387 | tcSplitFunTysN ty n_args
| n_args == 0
= ([], ty)
| Just (arg,res) <- tcSplitFunTy_maybe ty
= case tcSplitFunTysN res (n_args - 1) of
(args, res) -> (arg:args, res)
| otherwise
= ([], ty) | 207 | true | true | 0 | 10 | 143 | 145 | 75 | 70 | null | null |
rimmington/cabal | Cabal/Distribution/Simple/Utils.hs | bsd-3-clause | findAllFiles :: (a -> FilePath) -> [a] -> IO [a]
findAllFiles file = filterM (doesFileExist . file) | 99 | findAllFiles :: (a -> FilePath) -> [a] -> IO [a]
findAllFiles file = filterM (doesFileExist . file) | 99 | findAllFiles file = filterM (doesFileExist . file) | 50 | false | true | 0 | 8 | 16 | 48 | 25 | 23 | null | null |
gilith/hol | src/HOL/Const.hs | mit | bit0Name :: Name
bit0Name = Name naturalNamespace "bit0" | 56 | bit0Name :: Name
bit0Name = Name naturalNamespace "bit0" | 56 | bit0Name = Name naturalNamespace "bit0" | 39 | false | true | 0 | 5 | 7 | 16 | 8 | 8 | null | null |
ezrakilty/narc | Database/Narc/TypeInfer.hs | bsd-2-clause | tyCheck env (Singleton m, _) =
do (tySubst, m'@(_, (mTy))) <- tyCheck env m
return (tySubst,
(Singleton m', (TList mTy))) | 147 | tyCheck env (Singleton m, _) =
do (tySubst, m'@(_, (mTy))) <- tyCheck env m
return (tySubst,
(Singleton m', (TList mTy))) | 147 | tyCheck env (Singleton m, _) =
do (tySubst, m'@(_, (mTy))) <- tyCheck env m
return (tySubst,
(Singleton m', (TList mTy))) | 147 | false | false | 0 | 11 | 45 | 77 | 41 | 36 | null | null |
573/leksah | src/IDE/Package.hs | gpl-2.0 | executeDebugCommand :: Text -> (C.Sink ToolOutput IDEM ()) -> DebugAction
executeDebugCommand command handler = do
(_, ghci) <- ask
lift $ do
reifyIDE $ \ideR -> do
liftIO $ postGUIAsync $ reflectIDE (do
triggerEventIDE (StatusbarChanged [CompartmentState command, Compartment... | 699 | executeDebugCommand :: Text -> (C.Sink ToolOutput IDEM ()) -> DebugAction
executeDebugCommand command handler = do
(_, ghci) <- ask
lift $ do
reifyIDE $ \ideR -> do
liftIO $ postGUIAsync $ reflectIDE (do
triggerEventIDE (StatusbarChanged [CompartmentState command, Compartment... | 699 | executeDebugCommand command handler = do
(_, ghci) <- ask
lift $ do
reifyIDE $ \ideR -> do
liftIO $ postGUIAsync $ reflectIDE (do
triggerEventIDE (StatusbarChanged [CompartmentState command, CompartmentBuild True])
return ()) ideR
executeGhciComman... | 625 | false | true | 0 | 27 | 231 | 206 | 94 | 112 | null | null |
keithodulaigh/Hets | OWL2/XMLKeywords.hs | gpl-2.0 | objectAllValuesFromK :: String
objectAllValuesFromK = "ObjectAllValuesFrom" | 75 | objectAllValuesFromK :: String
objectAllValuesFromK = "ObjectAllValuesFrom" | 75 | objectAllValuesFromK = "ObjectAllValuesFrom" | 44 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
ulricha/dsh | src/Database/DSH/SL/Opt/Properties/VectorType.hs | bsd-3-clause | inferVectorTypeBinOp :: VectorProp VectorType -> VectorProp VectorType -> BinOp -> Either String (VectorProp VectorType)
inferVectorTypeBinOp s1 s2 op =
case op of
Fold _ -> return $ VProp $ VTDataVec 1
ReplicateNest -> do
VTDataVec w1 <- unpack s1
VTDataVec w2 <- unpack s2
return $ V... | 2,314 | inferVectorTypeBinOp :: VectorProp VectorType -> VectorProp VectorType -> BinOp -> Either String (VectorProp VectorType)
inferVectorTypeBinOp s1 s2 op =
case op of
Fold _ -> return $ VProp $ VTDataVec 1
ReplicateNest -> do
VTDataVec w1 <- unpack s1
VTDataVec w2 <- unpack s2
return $ V... | 2,314 | inferVectorTypeBinOp s1 s2 op =
case op of
Fold _ -> return $ VProp $ VTDataVec 1
ReplicateNest -> do
VTDataVec w1 <- unpack s1
VTDataVec w2 <- unpack s2
return $ VPropPair (VTDataVec $ w1 + w2) VTNA
ReplicateScalar -> do
VTDataVec w1 <- unpack s1
VTDataVec w2 <- u... | 2,193 | false | true | 27 | 14 | 633 | 907 | 437 | 470 | null | null |
input-output-hk/pos-haskell-prototype | chain/src/Pos/Chain/Ssc/Functions.hs | mit | ----------------------------------------------------------------------------
-- SscPayload Part
----------------------------------------------------------------------------
-- CHECK: @verifySscPayload
-- Verify payload using header containing this payload.
--
-- For each DS datum we check:
--
-- 1. Whether it's stor... | 3,405 | verifySscPayload
:: MonadError SscVerifyError m
=> Genesis.Config -> Either EpochIndex (Some IsMainHeader) -> SscPayload -> m ()
verifySscPayload genesisConfig eoh payload = case payload of
CommitmentsPayload comms certs -> do
whenHeader eoh isComm
commChecks comms
certsChecks certs
... | 2,835 | verifySscPayload genesisConfig eoh payload = case payload of
CommitmentsPayload comms certs -> do
whenHeader eoh isComm
commChecks comms
certsChecks certs
OpeningsPayload _ certs -> do
whenHeader eoh isOpen
certsChecks certs
SharesPayload _ certs -> do... | 2,698 | true | true | 1 | 13 | 875 | 544 | 271 | 273 | null | null |
eigengrau/stylish-haskell | src/Language/Haskell/Stylish/Config.hs | bsd-3-clause | --------------------------------------------------------------------------------
configFileName :: String
configFileName = ".stylish-haskell.yaml" | 146 | configFileName :: String
configFileName = ".stylish-haskell.yaml" | 65 | configFileName = ".stylish-haskell.yaml" | 40 | true | true | 0 | 6 | 6 | 19 | 8 | 11 | null | null |
ciderpunx/57-exercises-for-programmers | src/P19BMI.hs | gpl-3.0 | toPounds :: Weight -> Weight
toPounds (Kilograms k) = Pounds (k*2.205) | 70 | toPounds :: Weight -> Weight
toPounds (Kilograms k) = Pounds (k*2.205) | 70 | toPounds (Kilograms k) = Pounds (k*2.205) | 41 | false | true | 0 | 7 | 10 | 34 | 17 | 17 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/RegionCommitments/Insert.hs | mpl-2.0 | -- | Name of the region for this request.
rciRegion :: Lens' RegionCommitmentsInsert Text
rciRegion
= lens _rciRegion (\ s a -> s{_rciRegion = a}) | 148 | rciRegion :: Lens' RegionCommitmentsInsert Text
rciRegion
= lens _rciRegion (\ s a -> s{_rciRegion = a}) | 106 | rciRegion
= lens _rciRegion (\ s a -> s{_rciRegion = a}) | 58 | true | true | 1 | 9 | 26 | 46 | 22 | 24 | null | null |
haskellGardener/yusic | src/Yusic.hs | mit | toKeyGuide (C:D:G :[]) = Just KG_CSus2 | 58 | toKeyGuide (C:D:G :[]) = Just KG_CSus2 | 58 | toKeyGuide (C:D:G :[]) = Just KG_CSus2 | 58 | false | false | 0 | 10 | 25 | 29 | 14 | 15 | null | null |
AlexeyRaga/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | rightDataConKey = mkPreludeDataConUnique 26 | 67 | rightDataConKey = mkPreludeDataConUnique 26 | 67 | rightDataConKey = mkPreludeDataConUnique 26 | 67 | false | false | 0 | 5 | 27 | 9 | 4 | 5 | null | null |
mpitid/scheme48 | src/Scheme48/Interpreter.hs | mit | readProc [Port port] = (liftIO $ hGetLine port) >>= liftThrows . readExpr | 73 | readProc [Port port] = (liftIO $ hGetLine port) >>= liftThrows . readExpr | 73 | readProc [Port port] = (liftIO $ hGetLine port) >>= liftThrows . readExpr | 73 | false | false | 0 | 9 | 11 | 33 | 16 | 17 | null | null |
Callidon/toolkit | haskell/main.hs | mit | doubleUs x y = x*2 + y*2 | 24 | doubleUs x y = x*2 + y*2 | 24 | doubleUs x y = x*2 + y*2 | 24 | false | false | 0 | 7 | 6 | 23 | 11 | 12 | null | null |
mvr/at | src/Math/Topology/SGrp/Wbar.hs | bsd-3-clause | normalise g (s : ss) | isUnit g s = degen (normalise g ss) 0 | 60 | normalise g (s : ss) | isUnit g s = degen (normalise g ss) 0 | 60 | normalise g (s : ss) | isUnit g s = degen (normalise g ss) 0 | 60 | false | false | 0 | 8 | 14 | 44 | 19 | 25 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/general/wiki-haskell-org-99-questions/X99Questions.hs | unlicense | flatten (List xs) = flatten (head xs) ++ flatten (List (tail xs)) | 65 | flatten (List xs) = flatten (head xs) ++ flatten (List (tail xs)) | 65 | flatten (List xs) = flatten (head xs) ++ flatten (List (tail xs)) | 65 | false | false | 0 | 10 | 11 | 44 | 20 | 24 | null | null |
mariefarrell/Hets | GMP/GMP-CoLoSS/GMP/Logics/SysS.hs | gpl-2.0 | pretty_c :: (Feature SysS (a (b c))) => ([Int], [(Int, Int)], [Formula (SysS (a (b c)))]) -> String
pretty_c (worlds, rel, seq) = show worlds ++ show rel ++ pretty_list seq | 172 | pretty_c :: (Feature SysS (a (b c))) => ([Int], [(Int, Int)], [Formula (SysS (a (b c)))]) -> String
pretty_c (worlds, rel, seq) = show worlds ++ show rel ++ pretty_list seq | 172 | pretty_c (worlds, rel, seq) = show worlds ++ show rel ++ pretty_list seq | 72 | false | true | 0 | 15 | 30 | 112 | 60 | 52 | null | null |
oahziur/yige-pass | src/View.hs | bsd-3-clause | view :: [String] -> IO ()
view [fileName] = view [fileName, ""] | 63 | view :: [String] -> IO ()
view [fileName] = view [fileName, ""] | 63 | view [fileName] = view [fileName, ""] | 37 | false | true | 0 | 7 | 11 | 42 | 21 | 21 | null | null |
plaprade/haskoin | haskoin-node/test/Network/Haskoin/Node/Units.hs | unlicense | forkNodeSameChain :: App ()
forkNodeSameChain = mockBlockChain >> do
let l = chain3 !! 5
r = chain3 !! 3
height <- nodeBlockHeight <$> splitBlock l r
splitM <- getBlockByHeight r height
liftIO $ assertEqual "Fork node is correct" (Just $ chain3 !! 3) splitM | 281 | forkNodeSameChain :: App ()
forkNodeSameChain = mockBlockChain >> do
let l = chain3 !! 5
r = chain3 !! 3
height <- nodeBlockHeight <$> splitBlock l r
splitM <- getBlockByHeight r height
liftIO $ assertEqual "Fork node is correct" (Just $ chain3 !! 3) splitM | 281 | forkNodeSameChain = mockBlockChain >> do
let l = chain3 !! 5
r = chain3 !! 3
height <- nodeBlockHeight <$> splitBlock l r
splitM <- getBlockByHeight r height
liftIO $ assertEqual "Fork node is correct" (Just $ chain3 !! 3) splitM | 253 | false | true | 1 | 13 | 68 | 99 | 45 | 54 | null | null |
sergv/tags-server | tests/Haskell/Language/Server/Tags/AnalyzeHeaderTests.hs | bsd-3-clause | moduleWithExportsOfSpeciallyNamedOperatorsTest :: Test
moduleWithExportsOfSpeciallyNamedOperatorsTest = TestCase
{ testName = "Export of operators with special names"
, input =
"module ModuleWithExport ((.), (!), (~), (.+.), (Test..||.)) where"
, expectedResult = ModuleHeader
{ mhModNam... | 1,615 | moduleWithExportsOfSpeciallyNamedOperatorsTest :: Test
moduleWithExportsOfSpeciallyNamedOperatorsTest = TestCase
{ testName = "Export of operators with special names"
, input =
"module ModuleWithExport ((.), (!), (~), (.+.), (Test..||.)) where"
, expectedResult = ModuleHeader
{ mhModNam... | 1,615 | moduleWithExportsOfSpeciallyNamedOperatorsTest = TestCase
{ testName = "Export of operators with special names"
, input =
"module ModuleWithExport ((.), (!), (~), (.+.), (Test..||.)) where"
, expectedResult = ModuleHeader
{ mhModName = mkModuleName "ModuleWithExport"
, mh... | 1,560 | false | true | 0 | 18 | 700 | 247 | 144 | 103 | null | null |
Shimuuar/wai-middleware-static | Network/Wai/Middleware/Static.hs | bsd-3-clause | extensions :: FilePath -> [String]
extensions [] = [] | 53 | extensions :: FilePath -> [String]
extensions [] = [] | 53 | extensions [] = [] | 18 | false | true | 0 | 6 | 8 | 29 | 14 | 15 | null | null |
kawu/earley-facile | src/NLP/EarleyFacile/GrammarParser.hs | bsd-2-clause | -- | Parser a String-based representation of a SCFG grammar.
parseSCFG :: String -> SCFG
parseSCFG input = flip E.execState emptyCFG $ do
mapM_ parseLine (lines input)
-- | Parse a single line of the grammar. | 212 | parseSCFG :: String -> SCFG
parseSCFG input = flip E.execState emptyCFG $ do
mapM_ parseLine (lines input)
-- | Parse a single line of the grammar. | 151 | parseSCFG input = flip E.execState emptyCFG $ do
mapM_ parseLine (lines input)
-- | Parse a single line of the grammar. | 123 | true | true | 0 | 10 | 39 | 45 | 22 | 23 | null | null |
Javran/Project-Euler | src/ProjectEuler/Problem34.hs | mit | problem :: Problem
problem = pureProblem 34 Solved result | 57 | problem :: Problem
problem = pureProblem 34 Solved result | 57 | problem = pureProblem 34 Solved result | 38 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
ezyang/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | nlHsFunTy a b = noLoc (HsFunTy a b) | 45 | nlHsFunTy a b = noLoc (HsFunTy a b) | 45 | nlHsFunTy a b = noLoc (HsFunTy a b) | 45 | false | false | 0 | 7 | 17 | 22 | 10 | 12 | null | null |
kbiscanic/PUH | hw03/CSVUtils.hs | mit | csv = parseCSV ";" doc | 22 | csv = parseCSV ";" doc | 22 | csv = parseCSV ";" doc | 22 | false | false | 1 | 5 | 4 | 14 | 5 | 9 | null | null |
shlevy/ghc | compiler/typecheck/TcPluginM.hs | bsd-3-clause | -- | Create a fresh coercion hole.
newCoercionHole :: PredType -> TcPluginM CoercionHole
newCoercionHole = unsafeTcPluginTcM . TcM.newCoercionHole | 146 | newCoercionHole :: PredType -> TcPluginM CoercionHole
newCoercionHole = unsafeTcPluginTcM . TcM.newCoercionHole | 111 | newCoercionHole = unsafeTcPluginTcM . TcM.newCoercionHole | 57 | true | true | 0 | 7 | 17 | 31 | 14 | 17 | null | null |
bkoropoff/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | tldeclared (PTy _ _ _ _ _ n _ t) = [n] | 38 | tldeclared (PTy _ _ _ _ _ n _ t) = [n] | 38 | tldeclared (PTy _ _ _ _ _ n _ t) = [n] | 38 | false | false | 0 | 7 | 11 | 32 | 16 | 16 | null | null |
sdiehl/ghc | compiler/GHC/Stg/CSE.hs | bsd-3-clause | -- Top level bindings.
--
-- We do not CSE these, as top-level closures are allocated statically anyways.
-- Also, they might be exported.
-- But we still have to collect the set of in-scope variables, otherwise
-- uniqAway might shadow a top-level closure.
stgCseTopLvl :: InScopeSet -> InStgTopBinding -> (InScopeSet,... | 400 | stgCseTopLvl :: InScopeSet -> InStgTopBinding -> (InScopeSet, OutStgTopBinding)
stgCseTopLvl in_scope t@(StgTopStringLit _ _) = (in_scope, t) | 141 | stgCseTopLvl in_scope t@(StgTopStringLit _ _) = (in_scope, t) | 61 | true | true | 1 | 10 | 60 | 60 | 33 | 27 | null | null |
toddmohney/flipper | examples/enable-feature-for-a-specific-user/Main.hs | bsd-3-clause | myOtherUser :: User
myOtherUser = User 2 | 40 | myOtherUser :: User
myOtherUser = User 2 | 40 | myOtherUser = User 2 | 20 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
kearnh/HToyRayTracer | src/Ray.hs | bsd-3-clause | reflectAndTransmitDir :: Double -> Double -> Vector3 -> Vector3 -> (Vector3, Vector3)
reflectAndTransmitDir n1 n2 v norm = (rDir, tDir)
where
vdn' = vdot v norm
norm' = if vdn' > 0 then -norm else norm
n1' = if vdn' > 0 then n2 else n1
n2' = if vdn' > 0 then n1 else n2
... | 866 | reflectAndTransmitDir :: Double -> Double -> Vector3 -> Vector3 -> (Vector3, Vector3)
reflectAndTransmitDir n1 n2 v norm = (rDir, tDir)
where
vdn' = vdot v norm
norm' = if vdn' > 0 then -norm else norm
n1' = if vdn' > 0 then n2 else n1
n2' = if vdn' > 0 then n1 else n2
... | 866 | reflectAndTransmitDir n1 n2 v norm = (rDir, tDir)
where
vdn' = vdot v norm
norm' = if vdn' > 0 then -norm else norm
n1' = if vdn' > 0 then n2 else n1
n2' = if vdn' > 0 then n1 else n2
n1dn2 = n1' / n2'
cosT1 = -vdn'
cosT22 = 1 - (n1dn2**2) * (1 - cosT... | 779 | false | true | 10 | 19 | 378 | 308 | 162 | 146 | null | null |
dbp/snaplet-wordpress | spec/Main.hs | bsd-3-clause | cacheTests :: Spec
cacheTests = do
describe "should grab post from cache if it's there" $ do
it "should render the post even w/o json source" $ do
let (Object a2) = article2
ctxt <- liftIO initNoRequestWithCache
wpCacheSet' (view wordpress ctxt) (PostByPermalinkKey "2001" "10" "the-post"... | 4,460 | cacheTests :: Spec
cacheTests = do
describe "should grab post from cache if it's there" $ do
it "should render the post even w/o json source" $ do
let (Object a2) = article2
ctxt <- liftIO initNoRequestWithCache
wpCacheSet' (view wordpress ctxt) (PostByPermalinkKey "2001" "10" "the-post"... | 4,460 | cacheTests = do
describe "should grab post from cache if it's there" $ do
it "should render the post even w/o json source" $ do
let (Object a2) = article2
ctxt <- liftIO initNoRequestWithCache
wpCacheSet' (view wordpress ctxt) (PostByPermalinkKey "2001" "10" "the-post")
... | 4,441 | false | true | 0 | 20 | 1,218 | 1,269 | 588 | 681 | null | null |
urbit/urbit | pkg/hs/urbit-king/test/DeriveNounTests.hs | mit | barZazBaz :: BarZaz -> Bool
barZazBaz = nounEquiv $ \case BZQueenAlice x y -> QueenAlice x y
BZBob x -> Bob x
BZCharlie -> Charlie | 206 | barZazBaz :: BarZaz -> Bool
barZazBaz = nounEquiv $ \case BZQueenAlice x y -> QueenAlice x y
BZBob x -> Bob x
BZCharlie -> Charlie | 206 | barZazBaz = nounEquiv $ \case BZQueenAlice x y -> QueenAlice x y
BZBob x -> Bob x
BZCharlie -> Charlie | 178 | false | true | 0 | 9 | 100 | 55 | 26 | 29 | null | null |
plclub/cis670-16fa | projects/DynamicLang/src/Parser.hs | mit | mapBinOp :: String -> Maybe BinOp
mapBinOp "+" = Just Plus | 58 | mapBinOp :: String -> Maybe BinOp
mapBinOp "+" = Just Plus | 58 | mapBinOp "+" = Just Plus | 24 | false | true | 0 | 6 | 10 | 24 | 11 | 13 | null | null |
deontologician/orbRPG | Game/OrbRPG/Types.hs | gpl-3.0 | dirToStr SE = "southeast" | 25 | dirToStr SE = "southeast" | 25 | dirToStr SE = "southeast" | 25 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
tibbe/ghc | compiler/utils/Binary.hs | bsd-3-clause | getByteArray :: BinHandle -> Int -> IO ByteArray
getByteArray bh (I# sz) = do
(MBA arr) <- newByteArray sz
let loop n
| n ==# sz = return ()
| otherwise = do
w <- getByte bh
writeByteArray arr n w
loop (n +# 1#)
loop 0#
freezeByteArray arr | 317 | getByteArray :: BinHandle -> Int -> IO ByteArray
getByteArray bh (I# sz) = do
(MBA arr) <- newByteArray sz
let loop n
| n ==# sz = return ()
| otherwise = do
w <- getByte bh
writeByteArray arr n w
loop (n +# 1#)
loop 0#
freezeByteArray arr | 317 | getByteArray bh (I# sz) = do
(MBA arr) <- newByteArray sz
let loop n
| n ==# sz = return ()
| otherwise = do
w <- getByte bh
writeByteArray arr n w
loop (n +# 1#)
loop 0#
freezeByteArray arr | 268 | false | true | 0 | 16 | 126 | 135 | 57 | 78 | null | null |
mwahab1/pandoc | src/Text/Pandoc/Writers/Textile.hs | gpl-2.0 | blockToTextile opts (BlockQuote blocks) = do
contents <- blockListToTextile opts blocks
return $ "<blockquote>\n\n" ++ contents ++ "\n</blockquote>\n" | 154 | blockToTextile opts (BlockQuote blocks) = do
contents <- blockListToTextile opts blocks
return $ "<blockquote>\n\n" ++ contents ++ "\n</blockquote>\n" | 154 | blockToTextile opts (BlockQuote blocks) = do
contents <- blockListToTextile opts blocks
return $ "<blockquote>\n\n" ++ contents ++ "\n</blockquote>\n" | 154 | false | false | 0 | 9 | 21 | 46 | 20 | 26 | null | null |
fsestini/stlc-machine | src/Eval.hs | mit | substitution (NLAbstr t) j s = NLAbstr (substitution t (j+1) (shift 1 s)) | 73 | substitution (NLAbstr t) j s = NLAbstr (substitution t (j+1) (shift 1 s)) | 73 | substitution (NLAbstr t) j s = NLAbstr (substitution t (j+1) (shift 1 s)) | 73 | false | false | 0 | 9 | 12 | 47 | 23 | 24 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_TIMEOUT_IGNORED_APPLE :: GLuint64
gl_TIMEOUT_IGNORED_APPLE = 0xFFFFFFFFFFFFFFFF | 82 | gl_TIMEOUT_IGNORED_APPLE :: GLuint64
gl_TIMEOUT_IGNORED_APPLE = 0xFFFFFFFFFFFFFFFF | 82 | gl_TIMEOUT_IGNORED_APPLE = 0xFFFFFFFFFFFFFFFF | 45 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
urbanslug/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | doCopyMutableByteArrayToAddrOp :: CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr
-> FCode ()
doCopyMutableByteArrayToAddrOp = doCopyByteArrayToAddrOp | 174 | doCopyMutableByteArrayToAddrOp :: CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr
-> FCode ()
doCopyMutableByteArrayToAddrOp = doCopyByteArrayToAddrOp | 174 | doCopyMutableByteArrayToAddrOp = doCopyByteArrayToAddrOp | 56 | false | true | 0 | 10 | 45 | 32 | 16 | 16 | null | null |
toonn/haskell-casestt | koopa.hs | bsd-2-clause | p41 = Posy (Sy(Sy(Sy(Sy Zy)))) (Sy Zy) Gasy Lowy | 48 | p41 = Posy (Sy(Sy(Sy(Sy Zy)))) (Sy Zy) Gasy Lowy | 48 | p41 = Posy (Sy(Sy(Sy(Sy Zy)))) (Sy Zy) Gasy Lowy | 48 | false | false | 0 | 13 | 8 | 45 | 22 | 23 | null | null |
massudaw/mtk | Solver/RungeKutta.hs | bsd-3-clause | core1 cl al bl der_fn h old@(tn,yn) = (tn + h, yn |+| (k_sum h bl (gen_ks der_fn h old [] cl al))) | 98 | core1 cl al bl der_fn h old@(tn,yn) = (tn + h, yn |+| (k_sum h bl (gen_ks der_fn h old [] cl al))) | 98 | core1 cl al bl der_fn h old@(tn,yn) = (tn + h, yn |+| (k_sum h bl (gen_ks der_fn h old [] cl al))) | 98 | false | false | 0 | 11 | 22 | 70 | 37 | 33 | null | null |
marcinmrotek/repa-linear-algebra | src/Numeric/LinearAlgebra/Repa.hs | bsd-3-clause | luPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t)
luPIO m = do
(l,u,p,s) <- H.lu <$> repa2hmPIO m
return (hm2repa l, hm2repa u, hm2repa p, s) | 201 | luPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t)
luPIO m = do
(l,u,p,s) <- H.lu <$> repa2hmPIO m
return (hm2repa l, hm2repa u, hm2repa p, s) | 201 | luPIO m = do
(l,u,p,s) <- H.lu <$> repa2hmPIO m
return (hm2repa l, hm2repa u, hm2repa p, s) | 95 | false | true | 0 | 10 | 47 | 136 | 67 | 69 | null | null |
jstolarek/ghc | libraries/base/GHC/List.hs | bsd-3-clause | zip3 _ _ _ = [] | 30 | zip3 _ _ _ = [] | 30 | zip3 _ _ _ = [] | 30 | false | false | 1 | 6 | 20 | 16 | 6 | 10 | null | null |
yav/lang | src/AST.hs | mit | addTDecl :: TDecl -> Module -> Module
addTDecl d m = m { modTDecls = d : modTDecls m } | 86 | addTDecl :: TDecl -> Module -> Module
addTDecl d m = m { modTDecls = d : modTDecls m } | 86 | addTDecl d m = m { modTDecls = d : modTDecls m } | 48 | false | true | 0 | 8 | 19 | 39 | 20 | 19 | null | null |
bartfrenk/haskell-transaction | src/Transaction/Database.hs | bsd-3-clause | connectDB :: FilePath -> IO Connection
connectDB path = do
handle <- connectSqlite3 path
prepareDB handle
return handle | 125 | connectDB :: FilePath -> IO Connection
connectDB path = do
handle <- connectSqlite3 path
prepareDB handle
return handle | 125 | connectDB path = do
handle <- connectSqlite3 path
prepareDB handle
return handle | 86 | false | true | 0 | 8 | 23 | 43 | 18 | 25 | null | null |
ezyang/ghc | compiler/cmm/PprC.hs | bsd-3-clause | is_cishCC CApiConv = True | 29 | is_cishCC CApiConv = True | 29 | is_cishCC CApiConv = True | 29 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.