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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Thell/pandoc
|
src/Text/Pandoc/Writers/ICML.hs
|
gpl-2.0
|
inlineToICML opts style (Subscript lst) = inlinesToICML opts (subscriptName:style) lst
| 86 |
inlineToICML opts style (Subscript lst) = inlinesToICML opts (subscriptName:style) lst
| 86 |
inlineToICML opts style (Subscript lst) = inlinesToICML opts (subscriptName:style) lst
| 86 | false | false | 0 | 7 | 9 | 33 | 16 | 17 | null | null |
LTI2000/hinterface
|
src/Util/Binary.hs
|
bsd-3-clause
|
putWithLength32be :: Put -> Put
putWithLength32be putA = do
let bl = runPut putA
len = LBS.length bl
putWord32be (fromIntegral len)
putLazyByteString bl
--------------------------------------------------------------------------------
| 254 |
putWithLength32be :: Put -> Put
putWithLength32be putA = do
let bl = runPut putA
len = LBS.length bl
putWord32be (fromIntegral len)
putLazyByteString bl
--------------------------------------------------------------------------------
| 254 |
putWithLength32be putA = do
let bl = runPut putA
len = LBS.length bl
putWord32be (fromIntegral len)
putLazyByteString bl
--------------------------------------------------------------------------------
| 222 | false | true | 0 | 12 | 44 | 65 | 28 | 37 | null | null |
kyagrd/micronax
|
src/Parser.hs
|
bsd-2-clause
|
tm2Term (S.Con nm) = Con (UIdent $ show nm)
| 43 |
tm2Term (S.Con nm) = Con (UIdent $ show nm)
| 43 |
tm2Term (S.Con nm) = Con (UIdent $ show nm)
| 43 | false | false | 0 | 8 | 8 | 30 | 14 | 16 | null | null |
felixsch/moonbase-ng
|
src/Moonbase/Preferred.hs
|
lgpl-2.1
|
mime :: String -> Mimetypes
mime t = Mimetypes [t]
| 50 |
mime :: String -> Mimetypes
mime t = Mimetypes [t]
| 50 |
mime t = Mimetypes [t]
| 22 | false | true | 0 | 7 | 9 | 29 | 13 | 16 | null | null |
f1u77y/xmonad-contrib
|
XMonad/Config/Desktop.hs
|
bsd-3-clause
|
-- $usage
-- While this document describes how to configure xmonad, you also need
-- to set up your Desktop Environment (DE) and display manager to use
-- xmonad as its window manager. For DE and distro specific tips on
-- how to do so, see the xmonad wiki:
--
-- <http://haskell.org/haskellwiki/Xmonad>
--
-- To configure xmonad for use with a DE or with DE tools like panels
-- and pagers, in place of @def@ in your @~\/.xmonad/xmonad.hs@,
-- use @desktopConfig@ or one of the other desktop configs from the
-- @XMonad.Config@ namespace. The following setup and customization examples
-- work the same way for the other desktop configs as for @desktopConfig@.
-- If you are using a specific DE config, import its module instead, and
-- use its config in place of @desktopConfig@ in the following examples.
--
-- > import XMonad
-- > import XMonad.Config.Desktop
-- >
-- > main = xmonad desktopConfig
--
-- @desktopConfig@ is an 'XConfig' that configures xmonad to
-- ignore and leave room for dock type windows like panels and trays, adds
-- the default key binding to toggle panel visibility, and activates basic
-- EWMH support. It also sets a prettier root window mouse pointer.
-- $customizing
-- To customize a desktop config, modify its fields as is illustrated with
-- the default configuration @def@ in "XMonad.Doc.Extending#Extending xmonad".
-- $layouts
-- See also "XMonad.Util.EZConfig" for more options for modifying key bindings.
-- To add to layouts, manageHook or key bindings use something like the following
-- to combine your modifications with the desktop config settings:
--
-- > import XMonad
-- > import XMonad.Config.Desktop
-- > import XMonad.Layout.Tabbed
-- > import XMonad.Util.EZConfig (additionalKeys)
-- >
-- > main =
-- > xmonad $ desktopConfig {
-- > -- add manage hooks while still ignoring panels and using default manageHooks
-- > manageHook = myManageHook <+> manageHook desktopConfig
-- >
-- > -- add a fullscreen tabbed layout that does not avoid covering
-- > -- up desktop panels before the desktop layouts
-- > , layoutHook = simpleTabbed ||| layoutHook desktopConfig
-- > }
-- > -- add a screenshot key to the default desktop bindings
-- > `additionalKeys` [ ((mod4Mask, xK_F8), spawn "scrot") ]
--
-- To replace the desktop layouts with your own choices, but still
-- allow toggling panel visibility, use 'desktopLayoutModifiers' to
-- modify your layouts:
--
-- > , layoutHook = desktopLayoutModifiers $ simpleTabbed ||| Tall 1 0.03 0.5
--
-- @desktopLayoutModifiers@ modifies a layout to avoid covering docks, panels,
-- etc. that set the @_NET_WM_STRUT_PARTIAL@ property.
-- See also "XMonad.Hooks.ManageDocks".
-- $logHook
-- To add to the logHook while still sending workspace and window information
-- to DE apps use something like:
--
-- > , logHook = myLogHook <+> logHook desktopConfig
--
-- Or for more elaborate logHooks you can use @do@:
--
-- > , logHook = do
-- > dynamicLogWithPP xmobarPP
-- > updatePointer (Relative 0.9 0.9)
-- > logHook desktopConfig
--
-- $eventHook
-- To customize xmonad's event handling while still having it respond
-- to EWMH events from pagers, task bars:
--
-- > , handleEventHook = myEventHooks <+> handleEventHook desktopConfig
--
-- or 'mconcat' if you write a list event of event hooks
--
-- > , handleEventHook = mconcat
-- > [ myMouseHandler
-- > , myMessageHandler
-- > , handleEventHook desktopConfig ]
--
-- Note that the event hooks are run left to right (in contrast to
-- 'ManageHook'S which are right to left)
-- $startupHook
-- To run the desktop startupHook, plus add further actions to be run each
-- time xmonad starts or restarts, use '<+>' to combine actions as in the
-- logHook example, or something like:
--
-- > , startupHook = do
-- > startupHook desktopConfig
-- > spawn "xmonad-restart.sh"
-- > adjustEventInput
--
desktopConfig = docks $ ewmh def
{ startupHook = setDefaultCursor xC_left_ptr <+> startupHook def
, layoutHook = desktopLayoutModifiers $ layoutHook def
, keys = desktopKeys <+> keys def }
| 4,161 |
desktopConfig = docks $ ewmh def
{ startupHook = setDefaultCursor xC_left_ptr <+> startupHook def
, layoutHook = desktopLayoutModifiers $ layoutHook def
, keys = desktopKeys <+> keys def }
| 220 |
desktopConfig = docks $ ewmh def
{ startupHook = setDefaultCursor xC_left_ptr <+> startupHook def
, layoutHook = desktopLayoutModifiers $ layoutHook def
, keys = desktopKeys <+> keys def }
| 220 | true | false | 0 | 10 | 812 | 154 | 126 | 28 | null | null |
ganeti-github-testing/ganeti-test-1
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
-- | The configuration is supposed to remain stable across
-- revisions. Therefore, the revision number is cleared to '0'.
configRevision :: Int
configRevision = 0
| 163 |
configRevision :: Int
configRevision = 0
| 40 |
configRevision = 0
| 18 | true | true | 0 | 4 | 25 | 13 | 8 | 5 | null | null |
modeswitch/barrelfish
|
tools/flounder/BackendCommon.hs
|
mit
|
errvar = C.Variable "err"
| 25 |
errvar = C.Variable "err"
| 25 |
errvar = C.Variable "err"
| 25 | false | false | 1 | 6 | 3 | 14 | 5 | 9 | null | null |
tjhunter/karps
|
haskell/src/Spark/Core/InternalStd/Dataset.hs
|
apache-2.0
|
cacheBuilder :: NodeBuilder
cacheBuilder = buildOpD opnameCache $ \dt ->
pure $ cniStandardOp' Distributed opnameCache dt
| 123 |
cacheBuilder :: NodeBuilder
cacheBuilder = buildOpD opnameCache $ \dt ->
pure $ cniStandardOp' Distributed opnameCache dt
| 123 |
cacheBuilder = buildOpD opnameCache $ \dt ->
pure $ cniStandardOp' Distributed opnameCache dt
| 95 | false | true | 0 | 8 | 17 | 34 | 17 | 17 | null | null |
thoferon/eventsafe
|
src/Database/EventSafe/HTTP.hs
|
mit
|
-- | See 'mkResourceApps'.
mkResourceApp :: ResourceEndpoint -> Q (Guard, Exp)
mkResourceApp endpoint = do
andE <- [| and |]
eqE <- [| (==) |]
methodGetE <- [| methodGet |]
byteStringT <- [t| BS.ByteString |]
resourceAppE <- mkResourceAppExp endpoint
let endpointE = SigE (LitE (StringL (queryPath endpoint))) byteStringT
getMethodTest = AppE (AppE eqE methodE) methodGetE
endpointTest = AppE (AppE eqE pathE) endpointE
guard = NormalG $ AppE andE $ ListE [getMethodTest, endpointTest]
expression = resourceAppE
return (guard, expression)
-- | Build the expression to handle requests for resources.
--
-- This expression has access to the variables "req", "storage", "method" and "path".
--
-- > do
-- > let mRefParam = (>>= id) . lookup "ref" . queryString $ req
-- > case mRefParam of
-- > Nothing -> show400Error "{\"error\":\"no_ref_passed\",\"detail\":\"No GET parameter 'ref' has been passed.\"}"
-- > Just refParam -> do
-- > let eRef = yourToResourceRef refParam
-- > case eRef :: Either String YourResourceRef of
-- > Left err -> show400Error $ "{\"error\":\"ref_error\",\"detail\":\"" ++ BSL.pack err ++ "\"}"
-- > Right ref -> do
-- > mRes <- getResourceM storage ref
-- > case mRes :: Maybe YourResource of
-- > Nothing -> show404Error
-- > Just res -> return . responseLBS ok200 [] . J.encode $ res
| 1,480 |
mkResourceApp :: ResourceEndpoint -> Q (Guard, Exp)
mkResourceApp endpoint = do
andE <- [| and |]
eqE <- [| (==) |]
methodGetE <- [| methodGet |]
byteStringT <- [t| BS.ByteString |]
resourceAppE <- mkResourceAppExp endpoint
let endpointE = SigE (LitE (StringL (queryPath endpoint))) byteStringT
getMethodTest = AppE (AppE eqE methodE) methodGetE
endpointTest = AppE (AppE eqE pathE) endpointE
guard = NormalG $ AppE andE $ ListE [getMethodTest, endpointTest]
expression = resourceAppE
return (guard, expression)
-- | Build the expression to handle requests for resources.
--
-- This expression has access to the variables "req", "storage", "method" and "path".
--
-- > do
-- > let mRefParam = (>>= id) . lookup "ref" . queryString $ req
-- > case mRefParam of
-- > Nothing -> show400Error "{\"error\":\"no_ref_passed\",\"detail\":\"No GET parameter 'ref' has been passed.\"}"
-- > Just refParam -> do
-- > let eRef = yourToResourceRef refParam
-- > case eRef :: Either String YourResourceRef of
-- > Left err -> show400Error $ "{\"error\":\"ref_error\",\"detail\":\"" ++ BSL.pack err ++ "\"}"
-- > Right ref -> do
-- > mRes <- getResourceM storage ref
-- > case mRes :: Maybe YourResource of
-- > Nothing -> show404Error
-- > Just res -> return . responseLBS ok200 [] . J.encode $ res
| 1,453 |
mkResourceApp endpoint = do
andE <- [| and |]
eqE <- [| (==) |]
methodGetE <- [| methodGet |]
byteStringT <- [t| BS.ByteString |]
resourceAppE <- mkResourceAppExp endpoint
let endpointE = SigE (LitE (StringL (queryPath endpoint))) byteStringT
getMethodTest = AppE (AppE eqE methodE) methodGetE
endpointTest = AppE (AppE eqE pathE) endpointE
guard = NormalG $ AppE andE $ ListE [getMethodTest, endpointTest]
expression = resourceAppE
return (guard, expression)
-- | Build the expression to handle requests for resources.
--
-- This expression has access to the variables "req", "storage", "method" and "path".
--
-- > do
-- > let mRefParam = (>>= id) . lookup "ref" . queryString $ req
-- > case mRefParam of
-- > Nothing -> show400Error "{\"error\":\"no_ref_passed\",\"detail\":\"No GET parameter 'ref' has been passed.\"}"
-- > Just refParam -> do
-- > let eRef = yourToResourceRef refParam
-- > case eRef :: Either String YourResourceRef of
-- > Left err -> show400Error $ "{\"error\":\"ref_error\",\"detail\":\"" ++ BSL.pack err ++ "\"}"
-- > Right ref -> do
-- > mRes <- getResourceM storage ref
-- > case mRes :: Maybe YourResource of
-- > Nothing -> show404Error
-- > Just res -> return . responseLBS ok200 [] . J.encode $ res
| 1,401 | true | true | 0 | 16 | 380 | 206 | 116 | 90 | null | null |
jtdubs/Light
|
testsuite/Light/Geometry/VectorTest.hs
|
mit
|
prop_DoubleNegation :: Vector -> Bool
prop_DoubleNegation v = negateV (negateV v) == v
| 86 |
prop_DoubleNegation :: Vector -> Bool
prop_DoubleNegation v = negateV (negateV v) == v
| 86 |
prop_DoubleNegation v = negateV (negateV v) == v
| 48 | false | true | 0 | 7 | 12 | 37 | 16 | 21 | null | null |
UCSD-PL/RefScript
|
src/Language/Rsc/Errors.hs
|
bsd-3-clause
|
---------------------------------------------------------------------------
-- | SSA
---------------------------------------------------------------------------
errorReadOnlyUninit l x = mkErr l $ text $ printf "Cannot declare uninitialized readonly variable `%s`." (ppshow x)
| 282 |
errorReadOnlyUninit l x = mkErr l $ text $ printf "Cannot declare uninitialized readonly variable `%s`." (ppshow x)
| 121 |
errorReadOnlyUninit l x = mkErr l $ text $ printf "Cannot declare uninitialized readonly variable `%s`." (ppshow x)
| 121 | true | false | 0 | 8 | 28 | 36 | 18 | 18 | null | null |
BhallaLab/benchmarks
|
moose_nrn_equivalence_testing/comparision_with_simple_HH_model_additional_mechanism/Text/CSV.hs
|
gpl-2.0
|
pack = DBC.pack
| 15 |
pack = DBC.pack
| 15 |
pack = DBC.pack
| 15 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
badp/ganeti
|
src/Ganeti/Constants.hs
|
gpl-2.0
|
qftOther :: String
qftOther = "other"
| 37 |
qftOther :: String
qftOther = "other"
| 37 |
qftOther = "other"
| 18 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
siddhanathan/yi
|
yi-core/src/Yi/Keymap/Keys.hs
|
gpl-2.0
|
ctrlCh :: Char -> Event
ctrlCh = ctrl . char
| 44 |
ctrlCh :: Char -> Event
ctrlCh = ctrl . char
| 44 |
ctrlCh = ctrl . char
| 20 | false | true | 0 | 5 | 9 | 19 | 10 | 9 | null | null |
joehillen/acme-sip
|
Acme/Types.hs
|
bsd-3-clause
|
-- | render, field = value
field :: String -- ^ field name
-> Doc -- ^ field value
-> Doc
field name doc = text name $$ nest 15 (char '=' <+> doc)
| 161 |
field :: String -- ^ field name
-> Doc -- ^ field value
-> Doc
field name doc = text name $$ nest 15 (char '=' <+> doc)
| 134 |
field name doc = text name $$ nest 15 (char '=' <+> doc)
| 56 | true | true | 0 | 9 | 48 | 54 | 26 | 28 | null | null |
ulricha/dsh
|
src/Database/DSH/CL/Lang.hs
|
bsd-3-clause
|
fromListSafe :: a -> [a] -> NL a
fromListSafe a [a1] = a :* S a1
| 69 |
fromListSafe :: a -> [a] -> NL a
fromListSafe a [a1] = a :* S a1
| 69 |
fromListSafe a [a1] = a :* S a1
| 36 | false | true | 0 | 7 | 20 | 40 | 20 | 20 | null | null |
elbrujohalcon/hPage
|
src/HPage/Test/Server.hs
|
bsd-3-clause
|
shouldFail :: (MonadError e m) => m a -> m Bool
shouldFail a = (a >> return False) `catchError` (\_ -> return True)
| 115 |
shouldFail :: (MonadError e m) => m a -> m Bool
shouldFail a = (a >> return False) `catchError` (\_ -> return True)
| 115 |
shouldFail a = (a >> return False) `catchError` (\_ -> return True)
| 67 | false | true | 0 | 8 | 22 | 62 | 32 | 30 | null | null |
brendanhay/gogol
|
gogol-chat/gen/Network/Google/Chat/Types/Product.hs
|
mpl-2.0
|
mName :: Lens' Membership (Maybe Text)
mName = lens _mName (\ s a -> s{_mName = a})
| 83 |
mName :: Lens' Membership (Maybe Text)
mName = lens _mName (\ s a -> s{_mName = a})
| 83 |
mName = lens _mName (\ s a -> s{_mName = a})
| 44 | false | true | 1 | 9 | 16 | 51 | 24 | 27 | null | null |
nomeata/ghc
|
compiler/cmm/CmmSink.hs
|
bsd-3-clause
|
exprMem _ = NoMem
| 33 |
exprMem _ = NoMem
| 33 |
exprMem _ = NoMem
| 33 | false | false | 0 | 4 | 19 | 10 | 4 | 6 | null | null |
raptros/respond
|
src/Web/Respond/Types/Errors.hs
|
bsd-3-clause
|
reportAsErrorReport :: (a -> ErrorReport) -> Status -> a -> BS.ByteString -> ResponseBody
reportAsErrorReport f status = reportError status . f
| 143 |
reportAsErrorReport :: (a -> ErrorReport) -> Status -> a -> BS.ByteString -> ResponseBody
reportAsErrorReport f status = reportError status . f
| 143 |
reportAsErrorReport f status = reportError status . f
| 53 | false | true | 0 | 9 | 20 | 53 | 25 | 28 | null | null |
bspaans/EditTimeReport
|
src/ASTtoQuery.hs
|
gpl-3.0
|
fromQSubQuery _ q@(QSubQuery _ Path _ _ _ _) = makeQuery q fileName
| 68 |
fromQSubQuery _ q@(QSubQuery _ Path _ _ _ _) = makeQuery q fileName
| 68 |
fromQSubQuery _ q@(QSubQuery _ Path _ _ _ _) = makeQuery q fileName
| 68 | false | false | 0 | 8 | 13 | 35 | 17 | 18 | null | null |
jaccokrijnen/leksah
|
src/IDE/Session.hs
|
gpl-2.0
|
recover pp (HLintSt p) = void (recoverState pp p)
| 60 |
recover pp (HLintSt p) = void (recoverState pp p)
| 60 |
recover pp (HLintSt p) = void (recoverState pp p)
| 60 | false | false | 0 | 7 | 19 | 28 | 13 | 15 | null | null |
tcrayford/hitcask
|
Database/Hitcask/Specs/QuickCheck.hs
|
bsd-3-clause
|
runActionInMemory m (Delete k) = M.insert k (KeyIsEmpty k) m
| 60 |
runActionInMemory m (Delete k) = M.insert k (KeyIsEmpty k) m
| 60 |
runActionInMemory m (Delete k) = M.insert k (KeyIsEmpty k) m
| 60 | false | false | 0 | 7 | 9 | 32 | 15 | 17 | null | null |
forked-upstream-packages-for-ghcjs/ghc
|
compiler/coreSyn/CoreUtils.hs
|
bsd-3-clause
|
exprStats (Coercion c) = coStats c
| 37 |
exprStats (Coercion c) = coStats c
| 37 |
exprStats (Coercion c) = coStats c
| 37 | false | false | 0 | 7 | 8 | 18 | 8 | 10 | null | null |
lpsmith/modern-syslog
|
src/Data/Syslog/RFC5424.hs
|
bsd-3-clause
|
msgAny :: ByteString -> Maybe Msg
msgAny s
| B.length s >= 3
&& B.index s 0 == 0xEF
&& B.index s 1 == 0xBB
&& B.index s 2 == 0xBF
= Nothing
| otherwise
= Just (Msg (Bu.byteString s))
| 232 |
msgAny :: ByteString -> Maybe Msg
msgAny s
| B.length s >= 3
&& B.index s 0 == 0xEF
&& B.index s 1 == 0xBB
&& B.index s 2 == 0xBF
= Nothing
| otherwise
= Just (Msg (Bu.byteString s))
| 232 |
msgAny s
| B.length s >= 3
&& B.index s 0 == 0xEF
&& B.index s 1 == 0xBB
&& B.index s 2 == 0xBF
= Nothing
| otherwise
= Just (Msg (Bu.byteString s))
| 198 | false | true | 0 | 16 | 89 | 114 | 51 | 63 | null | null |
alexandersgreen/alex-haskell
|
MonteCarloPi/MonteCarloPi.hs
|
apache-2.0
|
approxPiR' :: (Int,Double) -> Double -> IO ()
approxPiR' (n,pi) d = do (n',pi') <- approxPi' (n,pi) d
putStrLn (show (4.0*pi'))
approxPiR' (n',pi') d
--repeats the montecarlo method the given number of times using a square of the given dimension
| 296 |
approxPiR' :: (Int,Double) -> Double -> IO ()
approxPiR' (n,pi) d = do (n',pi') <- approxPi' (n,pi) d
putStrLn (show (4.0*pi'))
approxPiR' (n',pi') d
--repeats the montecarlo method the given number of times using a square of the given dimension
| 296 |
approxPiR' (n,pi) d = do (n',pi') <- approxPi' (n,pi) d
putStrLn (show (4.0*pi'))
approxPiR' (n',pi') d
--repeats the montecarlo method the given number of times using a square of the given dimension
| 250 | false | true | 0 | 11 | 90 | 99 | 52 | 47 | null | null |
JacquesCarette/literate-scientific-software
|
code/drasil-lang/Language/Drasil/NounPhrase.hs
|
bsd-2-clause
|
-- | Plural form adds "es" (ex. Bush -> Bushes)
pn''' n = ProperNoun n AddES
| 76 |
pn''' n = ProperNoun n AddES
| 28 |
pn''' n = ProperNoun n AddES
| 28 | true | false | 0 | 5 | 15 | 15 | 7 | 8 | null | null |
mightymoose/liquidhaskell
|
benchmarks/llrbtree-0.1.1/Data/Set/LLRBTree.hs
|
bsd-3-clause
|
delete' :: Ord a => a -> RBTree a -> RBTree a
delete' _ Leaf = Leaf
| 67 |
delete' :: Ord a => a -> RBTree a -> RBTree a
delete' _ Leaf = Leaf
| 67 |
delete' _ Leaf = Leaf
| 21 | false | true | 0 | 8 | 16 | 37 | 17 | 20 | null | null |
spechub/Hets
|
CommonLogic/ModuleElimination.hs
|
gpl-2.0
|
me_text :: NAME -> [NAME] -> TEXT -> SENTENCE
me_text newName modules txt =
case txt of
Text phrs _ -> me_phrases newName modules $ filter nonImportation phrs
Named_text _ t _ -> me_text newName modules t
where nonImportation p = case p of
Importation _ -> False
_ -> True
-- Table 2: R5a - R5b, ignoring importations and comments
| 373 |
me_text :: NAME -> [NAME] -> TEXT -> SENTENCE
me_text newName modules txt =
case txt of
Text phrs _ -> me_phrases newName modules $ filter nonImportation phrs
Named_text _ t _ -> me_text newName modules t
where nonImportation p = case p of
Importation _ -> False
_ -> True
-- Table 2: R5a - R5b, ignoring importations and comments
| 373 |
me_text newName modules txt =
case txt of
Text phrs _ -> me_phrases newName modules $ filter nonImportation phrs
Named_text _ t _ -> me_text newName modules t
where nonImportation p = case p of
Importation _ -> False
_ -> True
-- Table 2: R5a - R5b, ignoring importations and comments
| 327 | false | true | 0 | 9 | 103 | 112 | 54 | 58 | null | null |
DavidAlphaFox/ghc
|
libraries/Cabal/Cabal/Distribution/Simple/LHC.hs
|
bsd-3-clause
|
--FIXME: does lhc support -XHaskell98 flag? from what version?
getExtensions :: Verbosity -> ConfiguredProgram -> IO [(Extension, Flag)]
getExtensions verbosity lhcProg = do
exts <- rawSystemStdout verbosity (programPath lhcProg)
["--supported-languages"]
-- GHC has the annoying habit of inverting some of the extensions
-- so we have to try parsing ("No" ++ ghcExtensionName) first
let readExtension str = do
ext <- simpleParse ("No" ++ str)
case ext of
UnknownExtension _ -> simpleParse str
_ -> return ext
return $ [ (ext, "-X" ++ display ext)
| Just ext <- map readExtension (lines exts) ]
| 703 |
getExtensions :: Verbosity -> ConfiguredProgram -> IO [(Extension, Flag)]
getExtensions verbosity lhcProg = do
exts <- rawSystemStdout verbosity (programPath lhcProg)
["--supported-languages"]
-- GHC has the annoying habit of inverting some of the extensions
-- so we have to try parsing ("No" ++ ghcExtensionName) first
let readExtension str = do
ext <- simpleParse ("No" ++ str)
case ext of
UnknownExtension _ -> simpleParse str
_ -> return ext
return $ [ (ext, "-X" ++ display ext)
| Just ext <- map readExtension (lines exts) ]
| 639 |
getExtensions verbosity lhcProg = do
exts <- rawSystemStdout verbosity (programPath lhcProg)
["--supported-languages"]
-- GHC has the annoying habit of inverting some of the extensions
-- so we have to try parsing ("No" ++ ghcExtensionName) first
let readExtension str = do
ext <- simpleParse ("No" ++ str)
case ext of
UnknownExtension _ -> simpleParse str
_ -> return ext
return $ [ (ext, "-X" ++ display ext)
| Just ext <- map readExtension (lines exts) ]
| 565 | true | true | 0 | 15 | 201 | 164 | 80 | 84 | null | null |
rahulmutt/ghcvm
|
compiler/Eta/Core/CoreSyn.hs
|
bsd-3-clause
|
isTypeArg _ = False
| 27 |
isTypeArg _ = False
| 27 |
isTypeArg _ = False
| 27 | false | false | 0 | 5 | 11 | 9 | 4 | 5 | null | null |
grammarware/slps
|
topics/implementation/nb/folding/ParseNB.hs
|
bsd-3-clause
|
prednb =
do
token (string "pred")
token (string "(")
x <- nb
token (string ")")
return (PredN x)
| 118 |
prednb =
do
token (string "pred")
token (string "(")
x <- nb
token (string ")")
return (PredN x)
| 118 |
prednb =
do
token (string "pred")
token (string "(")
x <- nb
token (string ")")
return (PredN x)
| 118 | false | false | 1 | 10 | 39 | 65 | 26 | 39 | null | null |
olsner/ghc
|
compiler/utils/OrdList.hs
|
bsd-3-clause
|
foldlOL :: (b->a->b) -> b -> OrdList a -> b
foldlOL _ z None = z
| 71 |
foldlOL :: (b->a->b) -> b -> OrdList a -> b
foldlOL _ z None = z
| 71 |
foldlOL _ z None = z
| 27 | false | true | 0 | 8 | 22 | 44 | 22 | 22 | null | null |
olsner/ghc
|
testsuite/tests/parser/should_run/T1344.hs
|
bsd-3-clause
|
c = "♯\00\&00\0"
| 16 |
c = "♯\00\&00\0"
| 16 |
c = "♯\00\&00\0"
| 16 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
mainland/nikola
|
src/Data/Array/Nikola/Backend/C/Codegen.hs
|
bsd-3-clause
|
compileExp UnitE = return VoidCE
| 37 |
compileExp UnitE = return VoidCE
| 37 |
compileExp UnitE = return VoidCE
| 37 | false | false | 0 | 5 | 9 | 12 | 5 | 7 | null | null |
swoertz/pia
|
src/Parser/Polynomial.hs
|
gpl-3.0
|
negativeMonomial :: Parser Monomial
negativeMonomial = do
spaces
_ <- char '-'
spaces
m <- monomial
let (Monomial c vs) = m
return (Monomial (c * (-1)) vs)
| 251 |
negativeMonomial :: Parser Monomial
negativeMonomial = do
spaces
_ <- char '-'
spaces
m <- monomial
let (Monomial c vs) = m
return (Monomial (c * (-1)) vs)
| 251 |
negativeMonomial = do
spaces
_ <- char '-'
spaces
m <- monomial
let (Monomial c vs) = m
return (Monomial (c * (-1)) vs)
| 215 | false | true | 0 | 14 | 123 | 87 | 38 | 49 | null | null |
kim/amazonka
|
amazonka-ec2/gen/Network/AWS/EC2/ResetInstanceAttribute.hs
|
mpl-2.0
|
-- | 'ResetInstanceAttributeResponse' constructor.
resetInstanceAttributeResponse :: ResetInstanceAttributeResponse
resetInstanceAttributeResponse = ResetInstanceAttributeResponse
| 179 |
resetInstanceAttributeResponse :: ResetInstanceAttributeResponse
resetInstanceAttributeResponse = ResetInstanceAttributeResponse
| 128 |
resetInstanceAttributeResponse = ResetInstanceAttributeResponse
| 63 | true | true | 0 | 4 | 9 | 12 | 7 | 5 | null | null |
vTurbine/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
staticPtrTyConName :: Name
staticPtrTyConName =
tcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrTyConKey
| 110 |
staticPtrTyConName :: Name
staticPtrTyConName =
tcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrTyConKey
| 110 |
staticPtrTyConName =
tcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrTyConKey
| 83 | false | true | 0 | 7 | 13 | 24 | 12 | 12 | null | null |
christiaanb/ghc
|
compiler/deSugar/Check.hs
|
bsd-3-clause
|
get_lit (NPat (L _ (OverLit { ol_val = HsFractional f })) mb _)
= Just (HsFloatPrim (mb_neg negateFractionalLit mb f))
| 142 |
get_lit (NPat (L _ (OverLit { ol_val = HsFractional f })) mb _)
= Just (HsFloatPrim (mb_neg negateFractionalLit mb f))
| 142 |
get_lit (NPat (L _ (OverLit { ol_val = HsFractional f })) mb _)
= Just (HsFloatPrim (mb_neg negateFractionalLit mb f))
| 142 | false | false | 0 | 14 | 43 | 61 | 30 | 31 | null | null |
cabrera/hkv
|
src/Server.hs
|
mit
|
parseCommand :: B.ByteString -> Maybe PartialCommand
parseCommand msg =
case A.parse action msg of
A.Done rest "get" -> Just $ Get rest
A.Done rest "set" -> Just $ Set rest
A.Done rest "delete" -> Just $ Delete rest
A.Fail{} -> Nothing
| 263 |
parseCommand :: B.ByteString -> Maybe PartialCommand
parseCommand msg =
case A.parse action msg of
A.Done rest "get" -> Just $ Get rest
A.Done rest "set" -> Just $ Set rest
A.Done rest "delete" -> Just $ Delete rest
A.Fail{} -> Nothing
| 263 |
parseCommand msg =
case A.parse action msg of
A.Done rest "get" -> Just $ Get rest
A.Done rest "set" -> Just $ Set rest
A.Done rest "delete" -> Just $ Delete rest
A.Fail{} -> Nothing
| 210 | false | true | 0 | 9 | 68 | 111 | 50 | 61 | null | null |
jwiegley/simple-conduit
|
Conduit/Simple.hs
|
mit
|
sumCE :: (Monad m, MonoFoldable mono, Num (Element mono))
=> Sink mono m (Element mono)
sumCE = undefined
| 111 |
sumCE :: (Monad m, MonoFoldable mono, Num (Element mono))
=> Sink mono m (Element mono)
sumCE = undefined
| 111 |
sumCE = undefined
| 17 | false | true | 0 | 8 | 23 | 51 | 26 | 25 | null | null |
shapr/adventofcode2016
|
src/TwentyTwo/Main.hs
|
bsd-3-clause
|
parseNode :: Parser Node
parseNode =
N <$ wholestring "/dev/grid/node-x" <*> number <* string "-y" <*> number <* space <*> number <* char 'T' <* number <* char 'T' <*> number <* some anyChar <* eof
| 199 |
parseNode :: Parser Node
parseNode =
N <$ wholestring "/dev/grid/node-x" <*> number <* string "-y" <*> number <* space <*> number <* char 'T' <* number <* char 'T' <*> number <* some anyChar <* eof
| 199 |
parseNode =
N <$ wholestring "/dev/grid/node-x" <*> number <* string "-y" <*> number <* space <*> number <* char 'T' <* number <* char 'T' <*> number <* some anyChar <* eof
| 174 | false | true | 2 | 15 | 37 | 84 | 37 | 47 | null | null |
qpliu/esolang
|
01_/hs/compiler/Compiler.hs
|
gpl-3.0
|
compileExpr :: Int -> String -> Expr -> [String]
compileExpr arity result (ExprLiteral bits) =
[" %" ++ result
++ " = call fastcc %.val* @.literalval([0 x i1]* bitcast (["
++ show (length bits) ++ " x i1]* " ++ constantName bits
++ " to [0 x i1]*), i32 " ++ show (length bits) ++ ", i32 0)"]
| 325 |
compileExpr :: Int -> String -> Expr -> [String]
compileExpr arity result (ExprLiteral bits) =
[" %" ++ result
++ " = call fastcc %.val* @.literalval([0 x i1]* bitcast (["
++ show (length bits) ++ " x i1]* " ++ constantName bits
++ " to [0 x i1]*), i32 " ++ show (length bits) ++ ", i32 0)"]
| 325 |
compileExpr arity result (ExprLiteral bits) =
[" %" ++ result
++ " = call fastcc %.val* @.literalval([0 x i1]* bitcast (["
++ show (length bits) ++ " x i1]* " ++ constantName bits
++ " to [0 x i1]*), i32 " ++ show (length bits) ++ ", i32 0)"]
| 276 | false | true | 0 | 14 | 91 | 95 | 47 | 48 | null | null |
romildo/gsynt
|
src/LRconstruction.hs
|
isc
|
g_3_1 :: Grammar
g_3_1 =
[ [N "P", N "S", T "$"]
, [N "S", N "S", T ";", N "S"]
, [N "S", T "id", T ":=", N "E"]
, [N "S", T "print", T "(", N "L", T ")"]
, [N "E", T "id"]
, [N "E", T "num"]
, [N "E", N "E", T "+", N "E"]
, [N "E", T "(", N "S", T ",", N "E", T ")"]
, [N "L", N "E"]
, [N "L", N "L", T ",", N "E"]
]
| 339 |
g_3_1 :: Grammar
g_3_1 =
[ [N "P", N "S", T "$"]
, [N "S", N "S", T ";", N "S"]
, [N "S", T "id", T ":=", N "E"]
, [N "S", T "print", T "(", N "L", T ")"]
, [N "E", T "id"]
, [N "E", T "num"]
, [N "E", N "E", T "+", N "E"]
, [N "E", T "(", N "S", T ",", N "E", T ")"]
, [N "L", N "E"]
, [N "L", N "L", T ",", N "E"]
]
| 339 |
g_3_1 =
[ [N "P", N "S", T "$"]
, [N "S", N "S", T ";", N "S"]
, [N "S", T "id", T ":=", N "E"]
, [N "S", T "print", T "(", N "L", T ")"]
, [N "E", T "id"]
, [N "E", T "num"]
, [N "E", N "E", T "+", N "E"]
, [N "E", T "(", N "S", T ",", N "E", T ")"]
, [N "L", N "E"]
, [N "L", N "L", T ",", N "E"]
]
| 322 | false | true | 0 | 7 | 109 | 257 | 134 | 123 | null | null |
rueshyna/gogol
|
gogol-games/gen/Network/Google/Games/Types/Product.hs
|
mpl-2.0
|
-- | The ID of the participant that modified the room.
rmParticipantId :: Lens' RoomModification (Maybe Text)
rmParticipantId
= lens _rmParticipantId
(\ s a -> s{_rmParticipantId = a})
| 192 |
rmParticipantId :: Lens' RoomModification (Maybe Text)
rmParticipantId
= lens _rmParticipantId
(\ s a -> s{_rmParticipantId = a})
| 137 |
rmParticipantId
= lens _rmParticipantId
(\ s a -> s{_rmParticipantId = a})
| 82 | true | true | 0 | 9 | 35 | 48 | 25 | 23 | null | null |
ezyang/ghc
|
compiler/coreSyn/CoreSeq.hs
|
bsd-3-clause
|
seqAlts :: [CoreAlt] -> ()
seqAlts [] = ()
| 42 |
seqAlts :: [CoreAlt] -> ()
seqAlts [] = ()
| 42 |
seqAlts [] = ()
| 15 | false | true | 0 | 6 | 8 | 27 | 14 | 13 | null | null |
andyarvanitis/Idris-dev
|
src/Idris/Output.hs
|
bsd-3-clause
|
iRenderResult :: Doc OutputAnnotation -> Idris ()
iRenderResult d = do ist <- getIState
case idris_outputmode ist of
RawOutput h -> consoleDisplayAnnotated h d
IdeSlave n h -> ideSlaveReturnAnnotated n h d
| 273 |
iRenderResult :: Doc OutputAnnotation -> Idris ()
iRenderResult d = do ist <- getIState
case idris_outputmode ist of
RawOutput h -> consoleDisplayAnnotated h d
IdeSlave n h -> ideSlaveReturnAnnotated n h d
| 273 |
iRenderResult d = do ist <- getIState
case idris_outputmode ist of
RawOutput h -> consoleDisplayAnnotated h d
IdeSlave n h -> ideSlaveReturnAnnotated n h d
| 223 | false | true | 0 | 11 | 99 | 80 | 34 | 46 | null | null |
alexander-at-github/eta
|
compiler/ETA/DeSugar/DsGRHSs.hs
|
bsd-3-clause
|
matchGuards (RecStmt {} : _) _ _ _ = panic "matchGuards RecStmt"
| 66 |
matchGuards (RecStmt {} : _) _ _ _ = panic "matchGuards RecStmt"
| 66 |
matchGuards (RecStmt {} : _) _ _ _ = panic "matchGuards RecStmt"
| 66 | false | false | 0 | 8 | 13 | 29 | 14 | 15 | null | null |
rodrigo-machado/verigraph
|
src/CLI/CriticalPairAnalysis.hs
|
gpl-3.0
|
pairwiseCompareIntoList :: (a -> a -> b) -> [(String, a)] -> [(String, String, b)]
pairwiseCompareIntoList compare namedItems =
parallelMap (uncurry compare') [ (x, y) | x <- namedItems, y <- namedItems ]
where compare' (nameX, x) (nameY, y) = (nameX, nameY, compare x y)
| 275 |
pairwiseCompareIntoList :: (a -> a -> b) -> [(String, a)] -> [(String, String, b)]
pairwiseCompareIntoList compare namedItems =
parallelMap (uncurry compare') [ (x, y) | x <- namedItems, y <- namedItems ]
where compare' (nameX, x) (nameY, y) = (nameX, nameY, compare x y)
| 275 |
pairwiseCompareIntoList compare namedItems =
parallelMap (uncurry compare') [ (x, y) | x <- namedItems, y <- namedItems ]
where compare' (nameX, x) (nameY, y) = (nameX, nameY, compare x y)
| 192 | false | true | 0 | 8 | 47 | 130 | 73 | 57 | null | null |
mvr/cf
|
src/Math/ContinuedFraction/Interval.hs
|
mit
|
(Finite x) `elementOf` (Interval (Finite i) (Finite s) True) = i <= x && x <= s
| 79 |
(Finite x) `elementOf` (Interval (Finite i) (Finite s) True) = i <= x && x <= s
| 79 |
(Finite x) `elementOf` (Interval (Finite i) (Finite s) True) = i <= x && x <= s
| 79 | false | false | 0 | 9 | 16 | 54 | 27 | 27 | null | null |
gcampax/ghc
|
compiler/utils/Outputable.hs
|
bsd-3-clause
|
neverQualifyPackages :: QueryQualifyPackage
neverQualifyPackages _ = False
| 74 |
neverQualifyPackages :: QueryQualifyPackage
neverQualifyPackages _ = False
| 74 |
neverQualifyPackages _ = False
| 30 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
gennady-em/haskel
|
src/PF_Probability.hs
|
gpl-2.0
|
pick :: Dist a -> R a
-- pick d = do {p <- Random.randomRIO (0,1); return (selectP p d)}
pick d = Random.randomRIO (0,1) >>= return . selectP d
| 143 |
pick :: Dist a -> R a
pick d = Random.randomRIO (0,1) >>= return . selectP d
| 76 |
pick d = Random.randomRIO (0,1) >>= return . selectP d
| 54 | true | true | 0 | 7 | 29 | 51 | 24 | 27 | null | null |
vincenthz/hs-crypto-random
|
Crypto/Random/Entropy.hs
|
bsd-3-clause
|
createEntropyPool :: IO EntropyPool
createEntropyPool = do
backends <- catMaybes `fmap` sequence supportedBackends
createEntropyPoolWith defaultPoolSize backends
-- | Create a dummy entropy pool that is deterministic, and
-- dependant on the input bytestring only.
--
-- This is stricly reserved for testing purpose when a deterministic seed need
-- to be generated with deterministic RNGs.
--
-- Do not use in production code.
| 436 |
createEntropyPool :: IO EntropyPool
createEntropyPool = do
backends <- catMaybes `fmap` sequence supportedBackends
createEntropyPoolWith defaultPoolSize backends
-- | Create a dummy entropy pool that is deterministic, and
-- dependant on the input bytestring only.
--
-- This is stricly reserved for testing purpose when a deterministic seed need
-- to be generated with deterministic RNGs.
--
-- Do not use in production code.
| 436 |
createEntropyPool = do
backends <- catMaybes `fmap` sequence supportedBackends
createEntropyPoolWith defaultPoolSize backends
-- | Create a dummy entropy pool that is deterministic, and
-- dependant on the input bytestring only.
--
-- This is stricly reserved for testing purpose when a deterministic seed need
-- to be generated with deterministic RNGs.
--
-- Do not use in production code.
| 400 | false | true | 0 | 9 | 71 | 45 | 25 | 20 | null | null |
ryantm/ghc
|
compiler/utils/Encoding.hs
|
bsd-3-clause
|
-- Encoded form
zEncodeString :: UserString -> EncodedString
zEncodeString cs = case maybe_tuple cs of
Just n -> n -- Tuples go to Z2T etc
Nothing -> go cs
where
go [] = []
go (c:cs) = encode_digit_ch c ++ go' cs
go' [] = []
go' (c:cs) = encode_ch c ++ go' cs
| 387 |
zEncodeString :: UserString -> EncodedString
zEncodeString cs = case maybe_tuple cs of
Just n -> n -- Tuples go to Z2T etc
Nothing -> go cs
where
go [] = []
go (c:cs) = encode_digit_ch c ++ go' cs
go' [] = []
go' (c:cs) = encode_ch c ++ go' cs
| 369 |
zEncodeString cs = case maybe_tuple cs of
Just n -> n -- Tuples go to Z2T etc
Nothing -> go cs
where
go [] = []
go (c:cs) = encode_digit_ch c ++ go' cs
go' [] = []
go' (c:cs) = encode_ch c ++ go' cs
| 324 | true | true | 4 | 8 | 181 | 136 | 60 | 76 | null | null |
facebookincubator/duckling
|
Duckling/Numeral/SK/Rules.hs
|
bsd-3-clause
|
ruleIntegerCompositeTens :: Rule
ruleIntegerCompositeTens = Rule
{ name = "integer 21..99"
, pattern =
[ oneOf [20, 30..90]
, numberBetween 1 10
]
, prod = \case
(Token Numeral NumeralData{TNumeral.value = tens}:
Token Numeral NumeralData{TNumeral.value = units}:
_) -> double $ tens + units
_ -> Nothing
}
| 352 |
ruleIntegerCompositeTens :: Rule
ruleIntegerCompositeTens = Rule
{ name = "integer 21..99"
, pattern =
[ oneOf [20, 30..90]
, numberBetween 1 10
]
, prod = \case
(Token Numeral NumeralData{TNumeral.value = tens}:
Token Numeral NumeralData{TNumeral.value = units}:
_) -> double $ tens + units
_ -> Nothing
}
| 352 |
ruleIntegerCompositeTens = Rule
{ name = "integer 21..99"
, pattern =
[ oneOf [20, 30..90]
, numberBetween 1 10
]
, prod = \case
(Token Numeral NumeralData{TNumeral.value = tens}:
Token Numeral NumeralData{TNumeral.value = units}:
_) -> double $ tens + units
_ -> Nothing
}
| 319 | false | true | 0 | 17 | 93 | 122 | 65 | 57 | null | null |
andorp/bead
|
src/Bead/Persistence/NoSQLDir.hs
|
bsd-3-clause
|
submissionOfComment :: CommentKey -> Persist SubmissionKey
submissionOfComment =
objectOrError "No submission was found for " "submission" SubmissionKey isSubmissionDir
| 170 |
submissionOfComment :: CommentKey -> Persist SubmissionKey
submissionOfComment =
objectOrError "No submission was found for " "submission" SubmissionKey isSubmissionDir
| 170 |
submissionOfComment =
objectOrError "No submission was found for " "submission" SubmissionKey isSubmissionDir
| 111 | false | true | 0 | 6 | 19 | 27 | 13 | 14 | null | null |
ezyang/ghc
|
libraries/base/GHC/Enum.hs
|
bsd-3-clause
|
-- Requires x2 >= x1
efdtIntUp :: Int# -> Int# -> Int# -> [Int]
efdtIntUp x1 x2 y -- Be careful about overflow!
| isTrue# (y <# x2) = if isTrue# (y <# x1) then [] else [I# x1]
| otherwise = -- Common case: x1 <= x2 <= y
let !delta = x2 -# x1 -- >= 0
!y' = y -# delta -- x1 <= y' <= y; hence y' is representable
-- Invariant: x <= y
-- Note that: z <= y' => z + delta won't overflow
-- so we are guaranteed not to overflow if/when we recurse
go_up x | isTrue# (x ># y') = [I# x]
| otherwise = I# x : go_up (x +# delta)
in I# x1 : go_up x2
| 704 |
efdtIntUp :: Int# -> Int# -> Int# -> [Int]
efdtIntUp x1 x2 y -- Be careful about overflow!
| isTrue# (y <# x2) = if isTrue# (y <# x1) then [] else [I# x1]
| otherwise = -- Common case: x1 <= x2 <= y
let !delta = x2 -# x1 -- >= 0
!y' = y -# delta -- x1 <= y' <= y; hence y' is representable
-- Invariant: x <= y
-- Note that: z <= y' => z + delta won't overflow
-- so we are guaranteed not to overflow if/when we recurse
go_up x | isTrue# (x ># y') = [I# x]
| otherwise = I# x : go_up (x +# delta)
in I# x1 : go_up x2
| 683 |
efdtIntUp x1 x2 y -- Be careful about overflow!
| isTrue# (y <# x2) = if isTrue# (y <# x1) then [] else [I# x1]
| otherwise = -- Common case: x1 <= x2 <= y
let !delta = x2 -# x1 -- >= 0
!y' = y -# delta -- x1 <= y' <= y; hence y' is representable
-- Invariant: x <= y
-- Note that: z <= y' => z + delta won't overflow
-- so we are guaranteed not to overflow if/when we recurse
go_up x | isTrue# (x ># y') = [I# x]
| otherwise = I# x : go_up (x +# delta)
in I# x1 : go_up x2
| 640 | true | true | 1 | 14 | 294 | 184 | 92 | 92 | null | null |
kawamuray/ganeti
|
src/Ganeti/OpParams.hs
|
gpl-2.0
|
pErrorCodes :: Field
pErrorCodes =
withDoc "Error codes" $
defaultFalse "error_codes"
| 89 |
pErrorCodes :: Field
pErrorCodes =
withDoc "Error codes" $
defaultFalse "error_codes"
| 89 |
pErrorCodes =
withDoc "Error codes" $
defaultFalse "error_codes"
| 68 | false | true | 0 | 6 | 14 | 21 | 10 | 11 | null | null |
siddhanathan/ghc
|
compiler/hsSyn/HsExpr.hs
|
bsd-3-clause
|
pprQuals :: (OutputableBndr id, Outputable body)
=> [LStmt id body] -> SDoc
-- Show list comprehension qualifiers separated by commas
pprQuals quals = interpp'SP quals
| 175 |
pprQuals :: (OutputableBndr id, Outputable body)
=> [LStmt id body] -> SDoc
pprQuals quals = interpp'SP quals
| 117 |
pprQuals quals = interpp'SP quals
| 33 | true | true | 0 | 8 | 32 | 45 | 23 | 22 | null | null |
quchen/prettyprinter
|
prettyprinter/src/Prettyprinter/Internal.hs
|
bsd-2-clause
|
-- | The remaining width on the current line.
remainingWidth :: Int -> Double -> Int -> Int -> Int
remainingWidth lineLength ribbonFraction lineIndent currentColumn =
min columnsLeftInLine columnsLeftInRibbon
where
columnsLeftInLine = lineLength - currentColumn
columnsLeftInRibbon = lineIndent + ribbonWidth - currentColumn
ribbonWidth =
(max 0 . min lineLength . floor)
(fromIntegral lineLength * ribbonFraction)
-- $ Test to avoid surprising behaviour
-- >>> Unbounded > AvailablePerLine maxBound 1
-- True
-- | Options to influence the layout algorithms.
| 598 |
remainingWidth :: Int -> Double -> Int -> Int -> Int
remainingWidth lineLength ribbonFraction lineIndent currentColumn =
min columnsLeftInLine columnsLeftInRibbon
where
columnsLeftInLine = lineLength - currentColumn
columnsLeftInRibbon = lineIndent + ribbonWidth - currentColumn
ribbonWidth =
(max 0 . min lineLength . floor)
(fromIntegral lineLength * ribbonFraction)
-- $ Test to avoid surprising behaviour
-- >>> Unbounded > AvailablePerLine maxBound 1
-- True
-- | Options to influence the layout algorithms.
| 552 |
remainingWidth lineLength ribbonFraction lineIndent currentColumn =
min columnsLeftInLine columnsLeftInRibbon
where
columnsLeftInLine = lineLength - currentColumn
columnsLeftInRibbon = lineIndent + ribbonWidth - currentColumn
ribbonWidth =
(max 0 . min lineLength . floor)
(fromIntegral lineLength * ribbonFraction)
-- $ Test to avoid surprising behaviour
-- >>> Unbounded > AvailablePerLine maxBound 1
-- True
-- | Options to influence the layout algorithms.
| 499 | true | true | 3 | 10 | 118 | 122 | 56 | 66 | null | null |
joecrayne/openpgp-util
|
Data/OpenPGP/Util/Verify.hs
|
isc
|
verifyOne :: OpenPGP.Message -> OpenPGP.Packet -> BS.ByteString -> Maybe OpenPGP.Packet
verifyOne keys sig over = fmap (const sig) $ maybeKey >>= verification >>= guard
where
verification = case OpenPGP.key_algorithm sig of
OpenPGP.DSA -> dsaVerify
OpenPGP.ECDSA -> ecdsaVerify
alg | alg `elem` [OpenPGP.RSA,OpenPGP.RSA_S] -> rsaVerify
| otherwise -> const Nothing
dsaVerify k = let k' = dsaKey k in
Just $ Vincent.DSA.verify (dsaTruncate k' . bhash) k' dsaSig over
ecdsaVerify k = let k' = ecdsaKey k
r = Just $ Vincent.ECDSA.verify bhash k' ecdsaSig over
in r -- trace ("ecdsaVerify: "++show r) r
rsaVerify k = Just $ Vincent.RSA.verify desc (rsaKey k) over rsaSig
[rsaSig] = map (toStrictBS . LZ.drop 2 . encode) (OpenPGP.signature sig)
dsaSig = let [OpenPGP.MPI r, OpenPGP.MPI s] = OpenPGP.signature sig in
Vincent.DSA.Signature r s
ecdsaSig = let [OpenPGP.MPI r, OpenPGP.MPI s] = OpenPGP.signature sig in
Vincent.ECDSA.Signature r s
dsaTruncate (Vincent.DSA.PublicKey (Vincent.DSA.Params _ _ q) _) = BS.take (integerBytesize q)
{-
ecdsaTruncate (Vincent.ECDSA.PublicKey _ (Vincent.ECDSA.Point x y)) = BS.take (integerBytesize x
+ integerBytesize y )
-}
bhash = hashBySymbol hash_algo . toLazyBS
desc = hashAlgoDesc hash_algo
hash_algo = OpenPGP.hash_algorithm sig
maybeKey = OpenPGP.signature_issuer sig >>= find_key keys
-- in trace ("maybeKey="++show (fmap OpenPGP.key_algorithm r)) r
| 1,657 |
verifyOne :: OpenPGP.Message -> OpenPGP.Packet -> BS.ByteString -> Maybe OpenPGP.Packet
verifyOne keys sig over = fmap (const sig) $ maybeKey >>= verification >>= guard
where
verification = case OpenPGP.key_algorithm sig of
OpenPGP.DSA -> dsaVerify
OpenPGP.ECDSA -> ecdsaVerify
alg | alg `elem` [OpenPGP.RSA,OpenPGP.RSA_S] -> rsaVerify
| otherwise -> const Nothing
dsaVerify k = let k' = dsaKey k in
Just $ Vincent.DSA.verify (dsaTruncate k' . bhash) k' dsaSig over
ecdsaVerify k = let k' = ecdsaKey k
r = Just $ Vincent.ECDSA.verify bhash k' ecdsaSig over
in r -- trace ("ecdsaVerify: "++show r) r
rsaVerify k = Just $ Vincent.RSA.verify desc (rsaKey k) over rsaSig
[rsaSig] = map (toStrictBS . LZ.drop 2 . encode) (OpenPGP.signature sig)
dsaSig = let [OpenPGP.MPI r, OpenPGP.MPI s] = OpenPGP.signature sig in
Vincent.DSA.Signature r s
ecdsaSig = let [OpenPGP.MPI r, OpenPGP.MPI s] = OpenPGP.signature sig in
Vincent.ECDSA.Signature r s
dsaTruncate (Vincent.DSA.PublicKey (Vincent.DSA.Params _ _ q) _) = BS.take (integerBytesize q)
{-
ecdsaTruncate (Vincent.ECDSA.PublicKey _ (Vincent.ECDSA.Point x y)) = BS.take (integerBytesize x
+ integerBytesize y )
-}
bhash = hashBySymbol hash_algo . toLazyBS
desc = hashAlgoDesc hash_algo
hash_algo = OpenPGP.hash_algorithm sig
maybeKey = OpenPGP.signature_issuer sig >>= find_key keys
-- in trace ("maybeKey="++show (fmap OpenPGP.key_algorithm r)) r
| 1,657 |
verifyOne keys sig over = fmap (const sig) $ maybeKey >>= verification >>= guard
where
verification = case OpenPGP.key_algorithm sig of
OpenPGP.DSA -> dsaVerify
OpenPGP.ECDSA -> ecdsaVerify
alg | alg `elem` [OpenPGP.RSA,OpenPGP.RSA_S] -> rsaVerify
| otherwise -> const Nothing
dsaVerify k = let k' = dsaKey k in
Just $ Vincent.DSA.verify (dsaTruncate k' . bhash) k' dsaSig over
ecdsaVerify k = let k' = ecdsaKey k
r = Just $ Vincent.ECDSA.verify bhash k' ecdsaSig over
in r -- trace ("ecdsaVerify: "++show r) r
rsaVerify k = Just $ Vincent.RSA.verify desc (rsaKey k) over rsaSig
[rsaSig] = map (toStrictBS . LZ.drop 2 . encode) (OpenPGP.signature sig)
dsaSig = let [OpenPGP.MPI r, OpenPGP.MPI s] = OpenPGP.signature sig in
Vincent.DSA.Signature r s
ecdsaSig = let [OpenPGP.MPI r, OpenPGP.MPI s] = OpenPGP.signature sig in
Vincent.ECDSA.Signature r s
dsaTruncate (Vincent.DSA.PublicKey (Vincent.DSA.Params _ _ q) _) = BS.take (integerBytesize q)
{-
ecdsaTruncate (Vincent.ECDSA.PublicKey _ (Vincent.ECDSA.Point x y)) = BS.take (integerBytesize x
+ integerBytesize y )
-}
bhash = hashBySymbol hash_algo . toLazyBS
desc = hashAlgoDesc hash_algo
hash_algo = OpenPGP.hash_algorithm sig
maybeKey = OpenPGP.signature_issuer sig >>= find_key keys
-- in trace ("maybeKey="++show (fmap OpenPGP.key_algorithm r)) r
| 1,569 | false | true | 15 | 13 | 464 | 521 | 237 | 284 | null | null |
Tener/deeplearning-thesis
|
lib/TournamentGeneric.hs
|
bsd-3-clause
|
tournament :: (Eq a, Agent2 a) => [a] -> IO [(Score,a)]
tournament agents = do
scored <- mapM (\ (i,ag) -> do
score <- playVersusRandom ag
putStrLn (printf "[%d/%d] tournament-pctWon: %f" (i::Int) (length agents) score)
return (score, ag)
) (zip [1..] agents)
return scored
-- | play a game versus AgentRandom a number of times. receive score based on a number of games won.
| 428 |
tournament :: (Eq a, Agent2 a) => [a] -> IO [(Score,a)]
tournament agents = do
scored <- mapM (\ (i,ag) -> do
score <- playVersusRandom ag
putStrLn (printf "[%d/%d] tournament-pctWon: %f" (i::Int) (length agents) score)
return (score, ag)
) (zip [1..] agents)
return scored
-- | play a game versus AgentRandom a number of times. receive score based on a number of games won.
| 428 |
tournament agents = do
scored <- mapM (\ (i,ag) -> do
score <- playVersusRandom ag
putStrLn (printf "[%d/%d] tournament-pctWon: %f" (i::Int) (length agents) score)
return (score, ag)
) (zip [1..] agents)
return scored
-- | play a game versus AgentRandom a number of times. receive score based on a number of games won.
| 372 | false | true | 0 | 18 | 117 | 149 | 75 | 74 | null | null |
runjak/snippets
|
daniel/Main.hs
|
gpl-2.0
|
walk Up Edge = [Left, Right, Back, Front]
| 47 |
walk Up Edge = [Left, Right, Back, Front]
| 47 |
walk Up Edge = [Left, Right, Back, Front]
| 47 | false | false | 1 | 5 | 13 | 27 | 13 | 14 | null | null |
proegssilb/beholder-observer
|
test/WebSpec.hs
|
apache-2.0
|
main :: IO ()
main = hspec spec
| 33 |
main :: IO ()
main = hspec spec
| 31 |
main = hspec spec
| 17 | false | true | 0 | 7 | 9 | 25 | 10 | 15 | null | null |
ajnsit/SimpleServer
|
src/SimpleServer.hs
|
mit
|
---------------------
-- WAI Application --
---------------------
runHandlers :: Handlers -> IO ()
runHandlers handlers = do
settings <- cmdArgs simpleServerCmdArgs
if paths settings
then do
(_,_,p,_,_) <- getPaths simpleServerDyreParams
putStrLn p
else do
v <- getVerbosity
let p = port settings
logVerbose v $ "SimpleServer running on port " ++ show p
run p $ waiApp $ application settings v handlers
| 451 |
runHandlers :: Handlers -> IO ()
runHandlers handlers = do
settings <- cmdArgs simpleServerCmdArgs
if paths settings
then do
(_,_,p,_,_) <- getPaths simpleServerDyreParams
putStrLn p
else do
v <- getVerbosity
let p = port settings
logVerbose v $ "SimpleServer running on port " ++ show p
run p $ waiApp $ application settings v handlers
| 384 |
runHandlers handlers = do
settings <- cmdArgs simpleServerCmdArgs
if paths settings
then do
(_,_,p,_,_) <- getPaths simpleServerDyreParams
putStrLn p
else do
v <- getVerbosity
let p = port settings
logVerbose v $ "SimpleServer running on port " ++ show p
run p $ waiApp $ application settings v handlers
| 351 | true | true | 0 | 13 | 109 | 138 | 65 | 73 | null | null |
jkramarz/hashids-haskell
|
Tests.hs
|
mit
|
enc :: String -> ByteString
enc = encodeList hashids . read
| 59 |
enc :: String -> ByteString
enc = encodeList hashids . read
| 59 |
enc = encodeList hashids . read
| 31 | false | true | 0 | 7 | 10 | 29 | 12 | 17 | null | null |
brendanhay/gogol
|
gogol-run/gen/Network/Google/Run/Types/Product.hs
|
mpl-2.0
|
-- | Standard list metadata. More info:
-- https:\/\/git.k8s.io\/community\/contributors\/devel\/sig-architecture\/api-conventions.md#types-kinds
-- +optional
sMetadata :: Lens' Status (Maybe ListMeta)
sMetadata
= lens _sMetadata (\ s a -> s{_sMetadata = a})
| 260 |
sMetadata :: Lens' Status (Maybe ListMeta)
sMetadata
= lens _sMetadata (\ s a -> s{_sMetadata = a})
| 101 |
sMetadata
= lens _sMetadata (\ s a -> s{_sMetadata = a})
| 58 | true | true | 0 | 9 | 29 | 50 | 27 | 23 | null | null |
wmarvel/haskellrogue
|
src/Level.hs
|
mit
|
levelCoords :: Level -> [Coord]
levelCoords = M.keys . lTiles
| 61 |
levelCoords :: Level -> [Coord]
levelCoords = M.keys . lTiles
| 61 |
levelCoords = M.keys . lTiles
| 29 | false | true | 1 | 8 | 9 | 32 | 14 | 18 | null | null |
dolio/vector
|
old-testsuite/Testsuite/Vector/AsList.hs
|
bsd-3-clause
|
prop_snoc = arg_ty [A] $ V.snoc ==? (\xs x -> xs ++ [x])
| 56 |
prop_snoc = arg_ty [A] $ V.snoc ==? (\xs x -> xs ++ [x])
| 56 |
prop_snoc = arg_ty [A] $ V.snoc ==? (\xs x -> xs ++ [x])
| 56 | false | false | 0 | 9 | 12 | 39 | 21 | 18 | null | null |
Sventimir/game-of-life
|
UI/Board.hs
|
apache-2.0
|
drawCell :: Color -> Cell -> Cairo.Render ()
drawCell (r, g, b) cell = do
Cairo.setSourceRGB 0 0 0
Cairo.setLineWidth 2
squarePath cell
Cairo.strokePreserve
Cairo.setSourceRGB r g b
Cairo.fill
Cairo.stroke
| 261 |
drawCell :: Color -> Cell -> Cairo.Render ()
drawCell (r, g, b) cell = do
Cairo.setSourceRGB 0 0 0
Cairo.setLineWidth 2
squarePath cell
Cairo.strokePreserve
Cairo.setSourceRGB r g b
Cairo.fill
Cairo.stroke
| 261 |
drawCell (r, g, b) cell = do
Cairo.setSourceRGB 0 0 0
Cairo.setLineWidth 2
squarePath cell
Cairo.strokePreserve
Cairo.setSourceRGB r g b
Cairo.fill
Cairo.stroke
| 216 | false | true | 0 | 9 | 85 | 98 | 43 | 55 | null | null |
anton-dessiatov/ghc
|
compiler/nativeGen/Dwarf/Types.hs
|
bsd-3-clause
|
pprDwarfInfoOpen _ (DwarfBlock _ label marker) = sdocWithDynFlags $ \df ->
pprAbbrev DwAbbrBlock
$$ pprString (renderWithStyle df (ppr label) (mkCodeStyle CStyle))
$$ pprWord (ppr marker)
$$ pprWord (ppr $ mkAsmTempEndLabel marker)
| 239 |
pprDwarfInfoOpen _ (DwarfBlock _ label marker) = sdocWithDynFlags $ \df ->
pprAbbrev DwAbbrBlock
$$ pprString (renderWithStyle df (ppr label) (mkCodeStyle CStyle))
$$ pprWord (ppr marker)
$$ pprWord (ppr $ mkAsmTempEndLabel marker)
| 239 |
pprDwarfInfoOpen _ (DwarfBlock _ label marker) = sdocWithDynFlags $ \df ->
pprAbbrev DwAbbrBlock
$$ pprString (renderWithStyle df (ppr label) (mkCodeStyle CStyle))
$$ pprWord (ppr marker)
$$ pprWord (ppr $ mkAsmTempEndLabel marker)
| 239 | false | false | 6 | 9 | 38 | 95 | 44 | 51 | null | null |
shayan-najd/Haskell-Desugar-Generic
|
Language/Haskell/Exts/Desugar/Generic/Type.hs
|
bsd-3-clause
|
desugarKindParen e = noDesugaring e
| 47 |
desugarKindParen e = noDesugaring e
| 47 |
desugarKindParen e = noDesugaring e
| 47 | false | false | 0 | 5 | 16 | 12 | 5 | 7 | null | null |
aminb/blog
|
src/Main.hs
|
gpl-3.0
|
-- Compresses the given file to a new file with .gz appended to the filename.
gzipFile :: FilePath -> IO ()
gzipFile fname = System.Process.callProcess "zopfli" [fname]
| 168 |
gzipFile :: FilePath -> IO ()
gzipFile fname = System.Process.callProcess "zopfli" [fname]
| 90 |
gzipFile fname = System.Process.callProcess "zopfli" [fname]
| 60 | true | true | 0 | 7 | 26 | 35 | 18 | 17 | null | null |
termite2/code-widget
|
cwtest.hs
|
bsd-3-clause
|
magicPos1 = newPos fnm 10 4
| 29 |
magicPos1 = newPos fnm 10 4
| 29 |
magicPos1 = newPos fnm 10 4
| 29 | false | false | 0 | 5 | 7 | 13 | 6 | 7 | null | null |
wilbowma/accelerate
|
accelerate-examples/tests/primitives/Stencil.hs
|
bsd-3-clause
|
run2D "3x3-pair" = test_stencil2Dpair
| 38 |
run2D "3x3-pair" = test_stencil2Dpair
| 38 |
run2D "3x3-pair" = test_stencil2Dpair
| 38 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
brendanhay/gogol
|
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
|
mpl-2.0
|
-- | Business days cutoff time definition. If not configured the cutoff time
-- will be defaulted to 8AM PST.
dtCutoffTime :: Lens' DeliveryTime (Maybe CutoffTime)
dtCutoffTime
= lens _dtCutoffTime (\ s a -> s{_dtCutoffTime = a})
| 231 |
dtCutoffTime :: Lens' DeliveryTime (Maybe CutoffTime)
dtCutoffTime
= lens _dtCutoffTime (\ s a -> s{_dtCutoffTime = a})
| 121 |
dtCutoffTime
= lens _dtCutoffTime (\ s a -> s{_dtCutoffTime = a})
| 67 | true | true | 0 | 9 | 38 | 49 | 26 | 23 | null | null |
mruegenberg/HOpenVGRaw
|
src/Graphics/Rendering/ShivaVG/Raw/Params.hs
|
bsd-3-clause
|
fvParam :: (Enum p) => p -> (a -> [Float]) -> ([Float] -> a) -> Param a
fvParam p tofv fromfv = Param getter (\v -> setfv p (tofv v))
where
getter = do
s <- getVectorSize p
vs <- getfv p s
return (fromfv vs)
| 231 |
fvParam :: (Enum p) => p -> (a -> [Float]) -> ([Float] -> a) -> Param a
fvParam p tofv fromfv = Param getter (\v -> setfv p (tofv v))
where
getter = do
s <- getVectorSize p
vs <- getfv p s
return (fromfv vs)
| 231 |
fvParam p tofv fromfv = Param getter (\v -> setfv p (tofv v))
where
getter = do
s <- getVectorSize p
vs <- getfv p s
return (fromfv vs)
| 159 | false | true | 0 | 11 | 69 | 128 | 63 | 65 | null | null |
thomkoehler/SrcGen
|
src/StmtResolver.hs
|
gpl-2.0
|
strToLower = $(liftVarFct1 "strToLower'")
where
strToLower' :: String -> String
strToLower' = map toLower
| 124 |
strToLower = $(liftVarFct1 "strToLower'")
where
strToLower' :: String -> String
strToLower' = map toLower
| 124 |
strToLower = $(liftVarFct1 "strToLower'")
where
strToLower' :: String -> String
strToLower' = map toLower
| 124 | false | false | 2 | 7 | 32 | 34 | 16 | 18 | null | null |
bergmark/haskell-opaleye
|
opaleye-sqlite/src/Opaleye/SQLite/Operators.hs
|
bsd-3-clause
|
ors :: F.Foldable f => f (Column T.PGBool) -> Column T.PGBool
ors = F.foldl' (.||) (T.pgBool False)
| 99 |
ors :: F.Foldable f => f (Column T.PGBool) -> Column T.PGBool
ors = F.foldl' (.||) (T.pgBool False)
| 99 |
ors = F.foldl' (.||) (T.pgBool False)
| 37 | false | true | 0 | 11 | 16 | 62 | 29 | 33 | null | null |
haskell-opengl/OpenGLRaw
|
src/Graphics/GL/Functions/F14.hs
|
bsd-3-clause
|
-- glGetnUniformfv -------------------------------------------------------------
-- | Manual page for <https://www.opengl.org/sdk/docs/man4/html/glGetUniform.xhtml OpenGL 4.x>.
glGetnUniformfv
:: MonadIO m
=> GLuint -- ^ @program@.
-> GLint -- ^ @location@.
-> GLsizei -- ^ @bufSize@.
-> Ptr GLfloat -- ^ @params@ pointing to @bufSize@ elements of type @GLfloat@.
-> m ()
glGetnUniformfv v1 v2 v3 v4 = liftIO $ dyn479 ptr_glGetnUniformfv v1 v2 v3 v4
| 462 |
glGetnUniformfv
:: MonadIO m
=> GLuint -- ^ @program@.
-> GLint -- ^ @location@.
-> GLsizei -- ^ @bufSize@.
-> Ptr GLfloat -- ^ @params@ pointing to @bufSize@ elements of type @GLfloat@.
-> m ()
glGetnUniformfv v1 v2 v3 v4 = liftIO $ dyn479 ptr_glGetnUniformfv v1 v2 v3 v4
| 284 |
glGetnUniformfv v1 v2 v3 v4 = liftIO $ dyn479 ptr_glGetnUniformfv v1 v2 v3 v4
| 77 | true | true | 0 | 12 | 72 | 76 | 38 | 38 | null | null |
llllllllll/h16cc
|
Assembler/Core.hs
|
gpl-2.0
|
suffixToWord SuffixLitMemaddr = 0x00
| 36 |
suffixToWord SuffixLitMemaddr = 0x00
| 36 |
suffixToWord SuffixLitMemaddr = 0x00
| 36 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
rueshyna/gogol
|
gogol-ml/gen/Network/Google/Resource/Ml/Projects/Predict.hs
|
mpl-2.0
|
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
ppUploadProtocol :: Lens' ProjectsPredict (Maybe Text)
ppUploadProtocol
= lens _ppUploadProtocol
(\ s a -> s{_ppUploadProtocol = a})
| 202 |
ppUploadProtocol :: Lens' ProjectsPredict (Maybe Text)
ppUploadProtocol
= lens _ppUploadProtocol
(\ s a -> s{_ppUploadProtocol = a})
| 140 |
ppUploadProtocol
= lens _ppUploadProtocol
(\ s a -> s{_ppUploadProtocol = a})
| 85 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
meiersi/blaze-builder
|
benchmarks/Compression.hs
|
bsd-3-clause
|
benchCompressDirectly :: L.ByteString -> Int64
benchCompressDirectly = L.length . compress
| 90 |
benchCompressDirectly :: L.ByteString -> Int64
benchCompressDirectly = L.length . compress
| 90 |
benchCompressDirectly = L.length . compress
| 43 | false | true | 0 | 7 | 9 | 30 | 13 | 17 | null | null |
ImsungChoi/haskell-test
|
src/HW05.hs
|
bsd-3-clause
|
getCriminal :: Map String Integer -> String
getCriminal m = fst $ maximumBy (comparing $ snd) (Map.toList m)
| 108 |
getCriminal :: Map String Integer -> String
getCriminal m = fst $ maximumBy (comparing $ snd) (Map.toList m)
| 108 |
getCriminal m = fst $ maximumBy (comparing $ snd) (Map.toList m)
| 64 | false | true | 0 | 9 | 17 | 47 | 23 | 24 | null | null |
kfish/scope
|
Scope/Layer.hs
|
bsd-3-clause
|
----------------------------------------------------------------------
-- Random, similar colors
genColor :: RGB -> Double -> MWC.GenIO -> IO RGB
genColor (r, g, b) a gen = do
let a' = 1.0 - a
r' <- MWC.uniformR (0.0, a') gen
g' <- MWC.uniformR (0.0, a') gen
b' <- MWC.uniformR (0.0, a') gen
return (r*a + r', g*a + g', b*a * b')
| 350 |
genColor :: RGB -> Double -> MWC.GenIO -> IO RGB
genColor (r, g, b) a gen = do
let a' = 1.0 - a
r' <- MWC.uniformR (0.0, a') gen
g' <- MWC.uniformR (0.0, a') gen
b' <- MWC.uniformR (0.0, a') gen
return (r*a + r', g*a + g', b*a * b')
| 252 |
genColor (r, g, b) a gen = do
let a' = 1.0 - a
r' <- MWC.uniformR (0.0, a') gen
g' <- MWC.uniformR (0.0, a') gen
b' <- MWC.uniformR (0.0, a') gen
return (r*a + r', g*a + g', b*a * b')
| 203 | true | true | 0 | 10 | 77 | 158 | 81 | 77 | null | null |
mapinguari/SC_HS_Proxy
|
src/Proxy/Query/Unit.hs
|
mit
|
mineralsCost CritterUrsadon = 1
| 31 |
mineralsCost CritterUrsadon = 1
| 31 |
mineralsCost CritterUrsadon = 1
| 31 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
lfairy/robot
|
Test/Robot/Internal.hs
|
apache-2.0
|
-- | Run the robot, connecting to the display automatically.
runRobot :: Robot a -> IO a
runRobot m = do
c <- connect
runRobotWith c m
-- | Run the robot using an existing connection.
| 192 |
runRobot :: Robot a -> IO a
runRobot m = do
c <- connect
runRobotWith c m
-- | Run the robot using an existing connection.
| 131 |
runRobot m = do
c <- connect
runRobotWith c m
-- | Run the robot using an existing connection.
| 103 | true | true | 0 | 7 | 44 | 41 | 19 | 22 | null | null |
TomMD/ghc
|
compiler/hsSyn/HsExpr.hs
|
bsd-3-clause
|
pprDo MDoExpr stmts = ptext (sLit "mdo") <+> ppr_do_stmts stmts
| 69 |
pprDo MDoExpr stmts = ptext (sLit "mdo") <+> ppr_do_stmts stmts
| 69 |
pprDo MDoExpr stmts = ptext (sLit "mdo") <+> ppr_do_stmts stmts
| 69 | false | false | 1 | 7 | 15 | 31 | 12 | 19 | null | null |
Kyly/liquidhaskell
|
src/Language/Haskell/Liquid/RefType.hs
|
bsd-3-clause
|
freeTyVars (RFun _ t t' _) = freeTyVars t `L.union` freeTyVars t'
| 65 |
freeTyVars (RFun _ t t' _) = freeTyVars t `L.union` freeTyVars t'
| 65 |
freeTyVars (RFun _ t t' _) = freeTyVars t `L.union` freeTyVars t'
| 65 | false | false | 0 | 7 | 11 | 35 | 17 | 18 | null | null |
ackao/APRICoT
|
web/conference-management-system/test/Handler/SearchSpec.hs
|
gpl-3.0
|
spec :: Spec
spec = withApp $ do
describe "getSearchR" $ do
error "Spec not implemented: getSearchR"
| 113 |
spec :: Spec
spec = withApp $ do
describe "getSearchR" $ do
error "Spec not implemented: getSearchR"
| 113 |
spec = withApp $ do
describe "getSearchR" $ do
error "Spec not implemented: getSearchR"
| 100 | false | true | 2 | 11 | 29 | 39 | 15 | 24 | null | null |
opensuse-haskell/cabal-rpm
|
src/Dependencies.hs
|
gpl-3.0
|
dependencies :: PackageDescription -- ^pkg description
-> ([String], [String], [String], [String], Bool)
-- ^depends, tools, c-libs, pkgcfg, selfdep
dependencies pkgDesc = (deps, tools, nub clibs, pkgcfgs, selfdep)
where
self = packageName $ package pkgDesc
(deps, selfdep) = buildDependencies pkgDesc self
buildinfo = allBuildInfo pkgDesc
tools = nub $ map depName (concatMap buildTools buildinfo)
pkgcfgs = nub $ map depName $ concatMap pkgconfigDepends buildinfo
clibs = concatMap extraLibs buildinfo
| 563 |
dependencies :: PackageDescription -- ^pkg description
-> ([String], [String], [String], [String], Bool)
dependencies pkgDesc = (deps, tools, nub clibs, pkgcfgs, selfdep)
where
self = packageName $ package pkgDesc
(deps, selfdep) = buildDependencies pkgDesc self
buildinfo = allBuildInfo pkgDesc
tools = nub $ map depName (concatMap buildTools buildinfo)
pkgcfgs = nub $ map depName $ concatMap pkgconfigDepends buildinfo
clibs = concatMap extraLibs buildinfo
| 503 |
dependencies pkgDesc = (deps, tools, nub clibs, pkgcfgs, selfdep)
where
self = packageName $ package pkgDesc
(deps, selfdep) = buildDependencies pkgDesc self
buildinfo = allBuildInfo pkgDesc
tools = nub $ map depName (concatMap buildTools buildinfo)
pkgcfgs = nub $ map depName $ concatMap pkgconfigDepends buildinfo
clibs = concatMap extraLibs buildinfo
| 381 | true | true | 10 | 9 | 127 | 179 | 87 | 92 | null | null |
mettekou/ghc
|
compiler/coreSyn/PprCore.hs
|
bsd-3-clause
|
pprCoreExpr expr = ppr_expr noParens expr
| 43 |
pprCoreExpr expr = ppr_expr noParens expr
| 43 |
pprCoreExpr expr = ppr_expr noParens expr
| 43 | false | false | 0 | 5 | 7 | 14 | 6 | 8 | null | null |
ocramz/petsc-hs
|
src/Numerical/PETSc/Internal/InlineC.hs
|
gpl-3.0
|
-- PetscErrorCode PetscViewerDestroy(PetscViewer *viewer)
petscViewerDestroy' :: PetscViewer -> IO CInt
petscViewerDestroy' v =
with v $ \vp -> [C.exp|int{PetscViewerDestroy($(PetscViewer* vp))}|]
| 199 |
petscViewerDestroy' :: PetscViewer -> IO CInt
petscViewerDestroy' v =
with v $ \vp -> [C.exp|int{PetscViewerDestroy($(PetscViewer* vp))}|]
| 140 |
petscViewerDestroy' v =
with v $ \vp -> [C.exp|int{PetscViewerDestroy($(PetscViewer* vp))}|]
| 94 | true | true | 2 | 7 | 22 | 42 | 22 | 20 | null | null |
emmanueltouzery/cigale-timesheet
|
src/EventProviders/Util.hs
|
mit
|
eol :: T.GenParser st ()
eol = void $ optional (char '\r') *> char '\n'
| 71 |
eol :: T.GenParser st ()
eol = void $ optional (char '\r') *> char '\n'
| 71 |
eol = void $ optional (char '\r') *> char '\n'
| 46 | false | true | 3 | 8 | 14 | 44 | 19 | 25 | null | null |
rueshyna/gogol
|
gogol-genomics/gen/Network/Google/Genomics/Types/Product.hs
|
mpl-2.0
|
-- | The maximum number of results to return in a single page. If
-- unspecified, defaults to 1024. The maximum value is 4096.
srsrPageSize :: Lens' SearchReferenceSetsRequest (Maybe Int32)
srsrPageSize
= lens _srsrPageSize (\ s a -> s{_srsrPageSize = a})
. mapping _Coerce
| 281 |
srsrPageSize :: Lens' SearchReferenceSetsRequest (Maybe Int32)
srsrPageSize
= lens _srsrPageSize (\ s a -> s{_srsrPageSize = a})
. mapping _Coerce
| 154 |
srsrPageSize
= lens _srsrPageSize (\ s a -> s{_srsrPageSize = a})
. mapping _Coerce
| 91 | true | true | 0 | 10 | 51 | 56 | 29 | 27 | null | null |
romanb/amazonka
|
amazonka-opsworks/gen/Network/AWS/OpsWorks/DescribeRdsDbInstances.hs
|
mpl-2.0
|
-- | 'DescribeRdsDbInstances' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'drdiRdsDbInstanceArns' @::@ ['Text']
--
-- * 'drdiStackId' @::@ 'Text'
--
describeRdsDbInstances :: Text -- ^ 'drdiStackId'
-> DescribeRdsDbInstances
describeRdsDbInstances p1 = DescribeRdsDbInstances
{ _drdiStackId = p1
, _drdiRdsDbInstanceArns = mempty
}
| 415 |
describeRdsDbInstances :: Text -- ^ 'drdiStackId'
-> DescribeRdsDbInstances
describeRdsDbInstances p1 = DescribeRdsDbInstances
{ _drdiStackId = p1
, _drdiRdsDbInstanceArns = mempty
}
| 227 |
describeRdsDbInstances p1 = DescribeRdsDbInstances
{ _drdiStackId = p1
, _drdiRdsDbInstanceArns = mempty
}
| 128 | true | true | 0 | 7 | 91 | 45 | 28 | 17 | null | null |
ComputationWithBoundedResources/ara-inference
|
doc/tpdb_trs/Haskell/basic_haskell/GTEQ_3.hs
|
mit
|
esEsOrdering GT LT = MyFalse
| 28 |
esEsOrdering GT LT = MyFalse
| 28 |
esEsOrdering GT LT = MyFalse
| 28 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
palf/free-driver
|
packages/drive-browser/lib/Drive/Browser/Configuration.hs
|
bsd-3-clause
|
runInBrowser :: Text -> W.WD a -> IO a
runInBrowser b = W.runSession conf . W.finallyClose
where
conf = W.Conf.useBrowser (W.Browser b) W.Conf.defaultConfig
| 162 |
runInBrowser :: Text -> W.WD a -> IO a
runInBrowser b = W.runSession conf . W.finallyClose
where
conf = W.Conf.useBrowser (W.Browser b) W.Conf.defaultConfig
| 162 |
runInBrowser b = W.runSession conf . W.finallyClose
where
conf = W.Conf.useBrowser (W.Browser b) W.Conf.defaultConfig
| 123 | false | true | 0 | 8 | 28 | 68 | 33 | 35 | null | null |
Heather/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
expandNS :: SyntaxInfo -> Name -> Name
expandNS syn n@(NS _ _) = n
| 66 |
expandNS :: SyntaxInfo -> Name -> Name
expandNS syn n@(NS _ _) = n
| 66 |
expandNS syn n@(NS _ _) = n
| 27 | false | true | 0 | 8 | 13 | 35 | 18 | 17 | null | null |
dmbarbour/awelon
|
hsrc_util/ABCGraph.hs
|
bsd-3-clause
|
tydesc (Block _) = "block"
| 26 |
tydesc (Block _) = "block"
| 26 |
tydesc (Block _) = "block"
| 26 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.