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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sethfowler/hsbugzilla | src/Web/Bugzilla/Internal/Types.hs | bsd-3-clause | searchFieldName AttachmentIsPrivateField = "attachments.isprivate" | 71 | searchFieldName AttachmentIsPrivateField = "attachments.isprivate" | 71 | searchFieldName AttachmentIsPrivateField = "attachments.isprivate" | 71 | false | false | 0 | 5 | 8 | 9 | 4 | 5 | null | null |
kolmodin/cabal | cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL.hs | bsd-3-clause | -- | Constructs an example installed package given:
--
-- 1. The name of the package 'ExamplePkgName', i.e., 'String'
-- 2. The version of the package 'ExamplePkgVersion', i.e., 'Int'
-- 3. The IPID for the package 'ExamplePkgHash', i.e., 'String'
-- (just some unique identifier for the package.)... | 595 | exInst :: ExamplePkgName -> ExamplePkgVersion -> ExamplePkgHash
-> [ExampleInstalled] -> ExampleInstalled
exInst pn v hash deps = ExInst pn v hash (map exInstHash deps) | 175 | exInst pn v hash deps = ExInst pn v hash (map exInstHash deps) | 62 | true | true | 0 | 10 | 126 | 70 | 38 | 32 | null | null |
kim/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types.hs | mpl-2.0 | -- | 'NewDhcpConfiguration' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'ndcKey' @::@ 'Maybe' 'Text'
--
-- * 'ndcValues' @::@ ['Text']
--
newDhcpConfiguration :: NewDhcpConfiguration
newDhcpConfiguration = NewDhcpConfiguration
{ _ndcKey = Nothing
, _ndcValues = mempty
... | 324 | newDhcpConfiguration :: NewDhcpConfiguration
newDhcpConfiguration = NewDhcpConfiguration
{ _ndcKey = Nothing
, _ndcValues = mempty
} | 147 | newDhcpConfiguration = NewDhcpConfiguration
{ _ndcKey = Nothing
, _ndcValues = mempty
} | 102 | true | true | 0 | 7 | 56 | 43 | 25 | 18 | null | null |
ChrisLane/leksah | src/IDE/Pane/Modules.hs | gpl-2.0 | addModule :: [Text] -> PackageAction
addModule modulePrefix = do
liftIO $ debugM "leksah" "selectIdentifier"
mbPD <- liftIDE getPackageDescriptionAndPath
case mbPD of
Nothing -> liftIDE $ ideMessage Normal (__ "No package description")
Just (pd,cabalPath) -> let srcPaths = nub $ ... | 2,521 | addModule :: [Text] -> PackageAction
addModule modulePrefix = do
liftIO $ debugM "leksah" "selectIdentifier"
mbPD <- liftIDE getPackageDescriptionAndPath
case mbPD of
Nothing -> liftIDE $ ideMessage Normal (__ "No package description")
Just (pd,cabalPath) -> let srcPaths = nub $ ... | 2,521 | addModule modulePrefix = do
liftIO $ debugM "leksah" "selectIdentifier"
mbPD <- liftIDE getPackageDescriptionAndPath
case mbPD of
Nothing -> liftIDE $ ideMessage Normal (__ "No package description")
Just (pd,cabalPath) -> let srcPaths = nub $ concatMap hsSourceDirs $ allBuildInfo... | 2,484 | false | true | 0 | 31 | 1,136 | 552 | 258 | 294 | null | null |
pxqr/intset | tests/Main.hs | bsd-3-clause | prop_splitPivot :: IntSet -> Key -> Bool
prop_splitPivot s k = all (< k) (toList lt) && all (k <) (toList gt)
where
(lt, gt) = split k s | 142 | prop_splitPivot :: IntSet -> Key -> Bool
prop_splitPivot s k = all (< k) (toList lt) && all (k <) (toList gt)
where
(lt, gt) = split k s | 142 | prop_splitPivot s k = all (< k) (toList lt) && all (k <) (toList gt)
where
(lt, gt) = split k s | 101 | false | true | 0 | 8 | 34 | 78 | 40 | 38 | null | null |
phischu/fragnix | tests/packages/scotty/Control.Monad.Trans.RWS.Lazy.hs | bsd-3-clause | -- | Uniform lifting of a @callCC@ operation to the new monad.
-- This version rolls back to the original state on entering the
-- continuation.
liftCallCC :: (Monoid w) =>
CallCC m (a,s,w) (b,s,w) -> CallCC (RWST r w s m) a b
liftCallCC callCC f = RWST $ \ r s ->
callCC $ \ c ->
runRWST (f (\ a -> RWST $ \... | 350 | liftCallCC :: (Monoid w) =>
CallCC m (a,s,w) (b,s,w) -> CallCC (RWST r w s m) a b
liftCallCC callCC f = RWST $ \ r s ->
callCC $ \ c ->
runRWST (f (\ a -> RWST $ \ _ _ -> c (a, s, mempty))) r s | 205 | liftCallCC callCC f = RWST $ \ r s ->
callCC $ \ c ->
runRWST (f (\ a -> RWST $ \ _ _ -> c (a, s, mempty))) r s | 119 | true | true | 0 | 17 | 87 | 140 | 77 | 63 | null | null |
icyfork/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | readCompoundCommand = do
id <- getNextId
cmd <- choice [ readBraceGroup, readArithmeticExpression, readSubshell, readCondition, readWhileClause, readUntilClause, readIfClause, readForClause, readSelectClause, readCaseClause, readFunctionDefinition]
optional spacing
redirs <- many readIoRedirect
unle... | 656 | readCompoundCommand = do
id <- getNextId
cmd <- choice [ readBraceGroup, readArithmeticExpression, readSubshell, readCondition, readWhileClause, readUntilClause, readIfClause, readForClause, readSelectClause, readCaseClause, readFunctionDefinition]
optional spacing
redirs <- many readIoRedirect
unle... | 656 | readCompoundCommand = do
id <- getNextId
cmd <- choice [ readBraceGroup, readArithmeticExpression, readSubshell, readCondition, readWhileClause, readUntilClause, readIfClause, readForClause, readSelectClause, readCaseClause, readFunctionDefinition]
optional spacing
redirs <- many readIoRedirect
unle... | 656 | false | false | 0 | 13 | 119 | 168 | 86 | 82 | null | null |
ghorn/euler | Euler/E096.hs | bsd-3-clause | allCombos :: [[Int]]
allCombos = rows ++ cols ++ blocks
where
rows :: [[Int]]
rows = map row [0..8]
where
row r = map (9*r +) [0..8]
cols :: [[Int]]
cols = transpose rows
blocks :: [[Int]]
blocks = [getBlock rows kr kc | kr <- [0..2], kc <- [0..2]]
where
g... | 756 | allCombos :: [[Int]]
allCombos = rows ++ cols ++ blocks
where
rows :: [[Int]]
rows = map row [0..8]
where
row r = map (9*r +) [0..8]
cols :: [[Int]]
cols = transpose rows
blocks :: [[Int]]
blocks = [getBlock rows kr kc | kr <- [0..2], kc <- [0..2]]
where
g... | 756 | allCombos = rows ++ cols ++ blocks
where
rows :: [[Int]]
rows = map row [0..8]
where
row r = map (9*r +) [0..8]
cols :: [[Int]]
cols = transpose rows
blocks :: [[Int]]
blocks = [getBlock rows kr kc | kr <- [0..2], kc <- [0..2]]
where
getBlock :: [[Int]] ->... | 735 | false | true | 3 | 11 | 297 | 323 | 176 | 147 | null | null |
itsuart/fdc_archivist | src/RedirectFeature.hs | mit | doWork :: AppGlobalState -> Wai.Request -> IO (Maybe Wai.Response)
doWork all_the_data request = do
maybeThreadURL <- DB.getLatestThreadURL (sqlConnection all_the_data)
case maybeThreadURL of
Just url -> return $ Just $ renderRedirect url
Nothing -> wrapInJust $ renderHTMLResponse "no-thread-to-redirect" =<... | 353 | doWork :: AppGlobalState -> Wai.Request -> IO (Maybe Wai.Response)
doWork all_the_data request = do
maybeThreadURL <- DB.getLatestThreadURL (sqlConnection all_the_data)
case maybeThreadURL of
Just url -> return $ Just $ renderRedirect url
Nothing -> wrapInJust $ renderHTMLResponse "no-thread-to-redirect" =<... | 353 | doWork all_the_data request = do
maybeThreadURL <- DB.getLatestThreadURL (sqlConnection all_the_data)
case maybeThreadURL of
Just url -> return $ Just $ renderRedirect url
Nothing -> wrapInJust $ renderHTMLResponse "no-thread-to-redirect" =<< makeBaseVM all_the_data request | 286 | false | true | 0 | 12 | 52 | 104 | 48 | 56 | null | null |
duplode/stack | src/Stack/Docker.hs | bsd-3-clause | preventInContainer :: (MonadIO m,MonadThrow m) => m () -> m ()
preventInContainer inner =
do inContainer <- getInContainer
if inContainer
then throwM OnlyOnHostException
else inner
-- | 'True' if we are currently running inside a Docker container. | 271 | preventInContainer :: (MonadIO m,MonadThrow m) => m () -> m ()
preventInContainer inner =
do inContainer <- getInContainer
if inContainer
then throwM OnlyOnHostException
else inner
-- | 'True' if we are currently running inside a Docker container. | 271 | preventInContainer inner =
do inContainer <- getInContainer
if inContainer
then throwM OnlyOnHostException
else inner
-- | 'True' if we are currently running inside a Docker container. | 208 | false | true | 0 | 8 | 60 | 65 | 32 | 33 | null | null |
davnils/avr-asm-dsl | avr-lib/Language/AVR/Verification.hs | bsd-3-clause | or :: Register -> Register -> AVR
or r1 r2 = do
v1 <- lift $ readRegister r1
v2 <- lift $ readRegister r2
let result = v1 .|. v2
lift $ writeRegister r1 result
updateLogicFlags result | 193 | or :: Register -> Register -> AVR
or r1 r2 = do
v1 <- lift $ readRegister r1
v2 <- lift $ readRegister r2
let result = v1 .|. v2
lift $ writeRegister r1 result
updateLogicFlags result | 193 | or r1 r2 = do
v1 <- lift $ readRegister r1
v2 <- lift $ readRegister r2
let result = v1 .|. v2
lift $ writeRegister r1 result
updateLogicFlags result | 159 | false | true | 0 | 10 | 46 | 83 | 37 | 46 | null | null |
jtdaugherty/vty | src/Graphics/Vty/Debug/Image.hs | bsd-3-clause | reverseTransform (ImageOp _ r) = r | 34 | reverseTransform (ImageOp _ r) = r | 34 | reverseTransform (ImageOp _ r) = r | 34 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
brendanhay/gogol | gogol-run/gen/Network/Google/Run/Types/Product.hs | mpl-2.0 | -- | (Optional) Specify whether the ConfigMap or its key must be defined
cmksOptional :: Lens' ConfigMapKeySelector (Maybe Bool)
cmksOptional
= lens _cmksOptional (\ s a -> s{_cmksOptional = a}) | 196 | cmksOptional :: Lens' ConfigMapKeySelector (Maybe Bool)
cmksOptional
= lens _cmksOptional (\ s a -> s{_cmksOptional = a}) | 123 | cmksOptional
= lens _cmksOptional (\ s a -> s{_cmksOptional = a}) | 67 | true | true | 0 | 9 | 31 | 48 | 25 | 23 | null | null |
markus-git/imperative-edsl-vhdl | src/Language/Embedded/Hardware/Expression/Represent/Bit.hs | bsd-3-clause | bitShowHex :: KnownNat n => Bits n -> String
bitShowHex b@(B i) = zeros (N.showHex i "")
where zeros n = replicate (len - length n) '0' ++ n
len = div (fromInteger (ni b) + 3) 4
-------------------------------------------------------------------------------- | 273 | bitShowHex :: KnownNat n => Bits n -> String
bitShowHex b@(B i) = zeros (N.showHex i "")
where zeros n = replicate (len - length n) '0' ++ n
len = div (fromInteger (ni b) + 3) 4
-------------------------------------------------------------------------------- | 273 | bitShowHex b@(B i) = zeros (N.showHex i "")
where zeros n = replicate (len - length n) '0' ++ n
len = div (fromInteger (ni b) + 3) 4
-------------------------------------------------------------------------------- | 228 | false | true | 1 | 11 | 53 | 107 | 52 | 55 | null | null |
Xandaros/abnf | test/Main.hs | bsd-2-clause | main :: IO ()
main = defaultMain tests | 38 | main :: IO ()
main = defaultMain tests | 38 | main = defaultMain tests | 24 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
HIPERFIT/futhark | src/Futhark/IR/Primitive.hs | isc | -- | Integer multiplication.
doMul :: IntValue -> IntValue -> IntValue
doMul v1 v2 = intValue (intValueType v1) $ intToInt64 v1 * intToInt64 v2 | 143 | doMul :: IntValue -> IntValue -> IntValue
doMul v1 v2 = intValue (intValueType v1) $ intToInt64 v1 * intToInt64 v2 | 114 | doMul v1 v2 = intValue (intValueType v1) $ intToInt64 v1 * intToInt64 v2 | 72 | true | true | 0 | 8 | 23 | 53 | 24 | 29 | null | null |
tjakway/ghcjvm | utils/hpc/HpcMarkup.hs | bsd-3-clause | openTick (TopLevelDecl True 0)
= "<span class=\"funcount\">-- never entered</span>" ++
openTopDecl | 118 | openTick (TopLevelDecl True 0)
= "<span class=\"funcount\">-- never entered</span>" ++
openTopDecl | 118 | openTick (TopLevelDecl True 0)
= "<span class=\"funcount\">-- never entered</span>" ++
openTopDecl | 118 | false | false | 0 | 7 | 30 | 21 | 10 | 11 | null | null |
NCrashed/bitmap | Data/Bitmap/IO.hs | bsd-3-clause | i :: Int -> CInt
ci = fromIntegral
| 35 | ci :: Int -> CInt
ci = fromIntegral | 35 | ci = fromIntegral | 17 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
green-haskell/ghc | compiler/nativeGen/NCGMonad.hs | bsd-3-clause | getUniqueNat :: NatM Unique
getUniqueNat = NatM $ \ st ->
case takeUniqFromSupply $ natm_us st of
(uniq, us') -> (uniq, st {natm_us = us'}) | 147 | getUniqueNat :: NatM Unique
getUniqueNat = NatM $ \ st ->
case takeUniqFromSupply $ natm_us st of
(uniq, us') -> (uniq, st {natm_us = us'}) | 147 | getUniqueNat = NatM $ \ st ->
case takeUniqFromSupply $ natm_us st of
(uniq, us') -> (uniq, st {natm_us = us'}) | 119 | false | true | 0 | 12 | 32 | 60 | 33 | 27 | null | null |
adinapoli/api-tools | src/Data/API/Changes.hs | bsd-3-clause | applyChangeToData :: APIChange -> CustomMigrationsTagged
-> JS.Value -> Position -> Either (ValueError, Position) JS.Value
applyChangeToData (ChAddField tname fname ftype mb_defval) _ =
case mb_defval <|> defaultValueForType ftype of
Just defval -> let newFieldValue = defaultValueAsJsValue defv... | 496 | applyChangeToData :: APIChange -> CustomMigrationsTagged
-> JS.Value -> Position -> Either (ValueError, Position) JS.Value
applyChangeToData (ChAddField tname fname ftype mb_defval) _ =
case mb_defval <|> defaultValueForType ftype of
Just defval -> let newFieldValue = defaultValueAsJsValue defva... | 495 | applyChangeToData (ChAddField tname fname ftype mb_defval) _ =
case mb_defval <|> defaultValueForType ftype of
Just defval -> let newFieldValue = defaultValueAsJsValue defval
in withObject (\ v _ -> pure $ HMap.insert (fieldKey fname) newFieldValue v)
Nothing -> \ _ p -> Left (InvalidAP... | 354 | false | true | 0 | 16 | 112 | 162 | 79 | 83 | null | null |
CulpaBS/wbBach | src/Futhark/Binder/Class.hs | bsd-3-clause | letBindNames' :: MonadBinder m =>
[VName] -> Exp (Lore m) -> m [Ident]
letBindNames' = letBindNames . map addBindVar
where addBindVar name = (name, BindVar) | 175 | letBindNames' :: MonadBinder m =>
[VName] -> Exp (Lore m) -> m [Ident]
letBindNames' = letBindNames . map addBindVar
where addBindVar name = (name, BindVar) | 175 | letBindNames' = letBindNames . map addBindVar
where addBindVar name = (name, BindVar) | 87 | false | true | 1 | 11 | 43 | 76 | 35 | 41 | null | null |
ryantm/ghc | testsuite/tests/deriving/should_fail/T7148a.hs | bsd-3-clause | --segfault (with high probability)
crash :: segfault
crash = unsafeCoerce . tail . tail . tail . unsafeCoerce $ True | 117 | crash :: segfault
crash = unsafeCoerce . tail . tail . tail . unsafeCoerce $ True | 81 | crash = unsafeCoerce . tail . tail . tail . unsafeCoerce $ True | 63 | true | true | 1 | 8 | 20 | 40 | 18 | 22 | null | null |
wuzzeb/hs-webdriver | src/Test/WebDriver/Chrome/Extension.hs | bsd-3-clause | -- |Load a .crx file as a 'ChromeExtension'.
loadExtension :: MonadBase IO m => FilePath -> m ChromeExtension
loadExtension path = liftBase $ loadRawExtension <$> LBS.readFile path | 180 | loadExtension :: MonadBase IO m => FilePath -> m ChromeExtension
loadExtension path = liftBase $ loadRawExtension <$> LBS.readFile path | 135 | loadExtension path = liftBase $ loadRawExtension <$> LBS.readFile path | 70 | true | true | 0 | 7 | 26 | 44 | 21 | 23 | null | null |
Lemmih/haskell-tc | src/Language/Haskell/TypeCheck/Monad.hs | mit | isBinding _ = False | 33 | isBinding _ = False | 33 | isBinding _ = False | 33 | false | false | 0 | 5 | 17 | 9 | 4 | 5 | null | null |
abakst/liquidhaskell | benchmarks/vector-0.10.0.1/Data/Vector/Generic.hs | bsd-3-clause | unstablePartition f = unstablePartition_stream f . stream | 57 | unstablePartition f = unstablePartition_stream f . stream | 57 | unstablePartition f = unstablePartition_stream f . stream | 57 | false | false | 1 | 6 | 6 | 20 | 7 | 13 | null | null |
DavidAlphaFox/darcs | containers-0.5.2.1/Darcs/Data/Map/Base.hs | gpl-2.0 | {--------------------------------------------------------------------
Split
--------------------------------------------------------------------}
-- | /O(log n)/. The expression (@'split' k map@) is a pair @(map1,map2)@ where
-- the keys in @map1@ are smaller than @k@ and the keys in @map2@ larger than @k@.
-- Any ke... | 1,173 | split :: Ord k => k -> Map k a -> (Map k a,Map k a)
split k0 t0 = k0 `seq` toPair $ go k0 t0
where
go k t =
case t of
Tip -> (Tip :*: Tip)
Bin _ kx x l r -> case compare k kx of
LT -> let (lt :*: gt) = go k l in lt :*: join kx x gt r
GT -> let (lt :*: gt) = go ... | 406 | split k0 t0 = k0 `seq` toPair $ go k0 t0
where
go k t =
case t of
Tip -> (Tip :*: Tip)
Bin _ kx x l r -> case compare k kx of
LT -> let (lt :*: gt) = go k l in lt :*: join kx x gt r
GT -> let (lt :*: gt) = go k r in join kx x l lt :*: gt
EQ -> (l :*: ... | 354 | true | true | 3 | 16 | 279 | 247 | 120 | 127 | null | null |
fpco/cabal | Cabal/Distribution/PackageDescription/Configuration.hs | bsd-3-clause | constrainBy :: DependencyMap -- ^ Input map
-> DependencyMap -- ^ Extra constraints
-> DependencyMap
constrainBy left extra =
DependencyMap $
Map.foldWithKey tightenConstraint (unDependencyMap left)
(unDependencyMap extra)
where tightenConstr... | 565 | constrainBy :: DependencyMap -- ^ Input map
-> DependencyMap -- ^ Extra constraints
-> DependencyMap
constrainBy left extra =
DependencyMap $
Map.foldWithKey tightenConstraint (unDependencyMap left)
(unDependencyMap extra)
where tightenConstr... | 565 | constrainBy left extra =
DependencyMap $
Map.foldWithKey tightenConstraint (unDependencyMap left)
(unDependencyMap extra)
where tightenConstraint n c l =
case Map.lookup n l of
Nothing -> l
Just vr -> Map.insert n (intersectVers... | 438 | false | true | 2 | 10 | 187 | 120 | 56 | 64 | null | null |
ammanvedi/haskell-nim-game | nim_game.hs | mit | nim [0,0,0] = return [] | 23 | nim [0,0,0] = return [] | 23 | nim [0,0,0] = return [] | 23 | false | false | 0 | 5 | 4 | 24 | 12 | 12 | null | null |
urbanslug/ghc | compiler/main/DynFlags.hs | bsd-3-clause | defaultDynFlags :: Settings -> DynFlags
defaultDynFlags mySettings =
-- See Note [Updating flag description in the User's Guide]
DynFlags {
ghcMode = CompManager,
ghcLink = LinkBinary,
hscTarget = defaultHscTarget (sTargetPlatform mySettings),
... | 6,238 | defaultDynFlags :: Settings -> DynFlags
defaultDynFlags mySettings =
-- See Note [Updating flag description in the User's Guide]
DynFlags {
ghcMode = CompManager,
ghcLink = LinkBinary,
hscTarget = defaultHscTarget (sTargetPlatform mySettings),
... | 6,238 | defaultDynFlags mySettings =
-- See Note [Updating flag description in the User's Guide]
DynFlags {
ghcMode = CompManager,
ghcLink = LinkBinary,
hscTarget = defaultHscTarget (sTargetPlatform mySettings),
sigOf = Map.emp... | 6,198 | false | true | 0 | 12 | 2,549 | 976 | 608 | 368 | null | null |
lukasmartinelli/hadolint | src/Hadolint/Rule.hs | gpl-3.0 | -- | A simple rule that can be implemented in terms of returning True or False for each instruction
-- If you need to calculate some state to decide upon past information, use 'customRule'
simpleRule ::
-- | rule code
RuleCode ->
-- | severity for the rule
DLSeverity ->
-- | failure message for the rule
Tex... | 1,007 | simpleRule ::
-- | rule code
RuleCode ->
-- | severity for the rule
DLSeverity ->
-- | failure message for the rule
Text.Text ->
-- | step calculation for the rule. Returns True or False for each line in the dockerfile depending on its validity.
(Instruction args -> Bool) ->
Rule args
simpleRule code ... | 818 | simpleRule code severity message checker = customRule step simpleState
where
step line s instr
| checker instr = s
| otherwise = s |> addFail (CheckFailure code severity message line)
-- | A rule that accumulates a State a. The state contains the collection of failed lines and a custom data
-- type t... | 514 | true | true | 2 | 12 | 209 | 131 | 63 | 68 | null | null |
FranklinChen/reddit | src/Reddit/Actions/Post.hs | bsd-2-clause | -- | Removes a post (as a moderator action). Note that this is different
-- from deleting a post.
removePost :: Monad m => PostID -> RedditT m ()
removePost = nothing . runRoute . Route.removePost False | 204 | removePost :: Monad m => PostID -> RedditT m ()
removePost = nothing . runRoute . Route.removePost False | 104 | removePost = nothing . runRoute . Route.removePost False | 56 | true | true | 1 | 9 | 38 | 50 | 23 | 27 | null | null |
craynafinal/cs557_functional_languages | hw3/q4.hs | mit | merge :: Ord a => [a] -> [a] -> [a]
merge [] [] = [] | 52 | merge :: Ord a => [a] -> [a] -> [a]
merge [] [] = [] | 52 | merge [] [] = [] | 16 | false | true | 0 | 8 | 14 | 46 | 24 | 22 | null | null |
jdeisenberg/rwh_commentary | chapter03_files/prerequisites.hs | mit | pChem001B = Single chem001a | 27 | pChem001B = Single chem001a | 27 | pChem001B = Single chem001a | 27 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
yesodweb/persistent | persistent-sqlite/Database/Sqlite.hs | mit | column :: Statement -> Int -> IO PersistValue
column statement columnIndex = do
theType <- columnType statement columnIndex
case theType of
IntegerColumn -> do
int64 <- columnInt64 statement columnIndex
return $ PersistInt64 int64
FloatColumn -> do
double <... | 702 | column :: Statement -> Int -> IO PersistValue
column statement columnIndex = do
theType <- columnType statement columnIndex
case theType of
IntegerColumn -> do
int64 <- columnInt64 statement columnIndex
return $ PersistInt64 int64
FloatColumn -> do
double <... | 702 | column statement columnIndex = do
theType <- columnType statement columnIndex
case theType of
IntegerColumn -> do
int64 <- columnInt64 statement columnIndex
return $ PersistInt64 int64
FloatColumn -> do
double <- columnDouble statement columnIndex
... | 656 | false | true | 0 | 14 | 232 | 168 | 73 | 95 | null | null |
spechub/Hets | CSL/ReduceInterpreter.hs | gpl-2.0 | evalRedcString :: String -> RedcIO [EXPRESSION]
evalRedcString s = do
-- 0.09 seconds is a critical value for the accepted response time of Reduce
res <- lift $ wrapCommand $ PC.call 0.5 s
r <- get
let bm = getBMap r
trans = revtranslateExpr bm
{- don't need to skip the reducelinenr here, because the Co... | 542 | evalRedcString :: String -> RedcIO [EXPRESSION]
evalRedcString s = do
-- 0.09 seconds is a critical value for the accepted response time of Reduce
res <- lift $ wrapCommand $ PC.call 0.5 s
r <- get
let bm = getBMap r
trans = revtranslateExpr bm
{- don't need to skip the reducelinenr here, because the Co... | 542 | evalRedcString s = do
-- 0.09 seconds is a critical value for the accepted response time of Reduce
res <- lift $ wrapCommand $ PC.call 0.5 s
r <- get
let bm = getBMap r
trans = revtranslateExpr bm
{- don't need to skip the reducelinenr here, because the Command-Interface
cleans the outpipe before send... | 494 | false | true | 0 | 11 | 119 | 104 | 49 | 55 | null | null |
ardumont/haskell-lab | test/Main.hs | gpl-2.0 | main :: IO ()
main = let tts = concat [AnagramTests.tests
,HuffmanTests.tests
,LoadAndUpdateIniTests.tests
,BSTTests.tests
,RBTTests.tests]
in runTestTT (TestList tts) >>= print | 275 | main :: IO ()
main = let tts = concat [AnagramTests.tests
,HuffmanTests.tests
,LoadAndUpdateIniTests.tests
,BSTTests.tests
,RBTTests.tests]
in runTestTT (TestList tts) >>= print | 275 | main = let tts = concat [AnagramTests.tests
,HuffmanTests.tests
,LoadAndUpdateIniTests.tests
,BSTTests.tests
,RBTTests.tests]
in runTestTT (TestList tts) >>= print | 261 | false | true | 0 | 11 | 118 | 73 | 36 | 37 | null | null |
Numberartificial/workflow | snipets/src/Craft/Chapter13.hs | mit | -- Erroneous expression
-- error1 = allEqual suc suc suc
suc = (+1) | 69 | suc = (+1) | 10 | suc = (+1) | 10 | true | false | 1 | 6 | 14 | 16 | 8 | 8 | null | null |
dec9ue/jhc_copygc | src/GenUtil.hs | gpl-2.0 | sortGroupUnder :: Ord a => (b -> a) -> [b] -> [[b]]
sortGroupUnder f = groupUnder f . sortUnder f | 97 | sortGroupUnder :: Ord a => (b -> a) -> [b] -> [[b]]
sortGroupUnder f = groupUnder f . sortUnder f | 97 | sortGroupUnder f = groupUnder f . sortUnder f | 45 | false | true | 0 | 11 | 19 | 60 | 29 | 31 | null | null |
upwawet/vision | src/Properties/Manager.hs | gpl-3.0 | initPropertyManager :: (WithEnvironment, WithRegistry, WithModel) => IO ()
initPropertyManager = do
manager <- unsafeInterleaveIO $ makeEditorDialog
[(stockApply, ResponseApply)]
makePropertyManager $ \m -> do
let outerw = outer m
windowSetTitle outerw "Manage properties"
windowS... | 555 | initPropertyManager :: (WithEnvironment, WithRegistry, WithModel) => IO ()
initPropertyManager = do
manager <- unsafeInterleaveIO $ makeEditorDialog
[(stockApply, ResponseApply)]
makePropertyManager $ \m -> do
let outerw = outer m
windowSetTitle outerw "Manage properties"
windowS... | 555 | initPropertyManager = do
manager <- unsafeInterleaveIO $ makeEditorDialog
[(stockApply, ResponseApply)]
makePropertyManager $ \m -> do
let outerw = outer m
windowSetTitle outerw "Manage properties"
windowSetDefaultSize outerw 500 400
addEnv Ix Manager { _showPropertyManager =
... | 480 | false | true | 0 | 15 | 185 | 122 | 59 | 63 | null | null |
PeterHajdu/hs | app/Main.hs | bsd-3-clause | setColour :: Colour -> String
setColour c =
let code = case c of
Black -> "30"
Red -> "31"
Green -> "32"
Yellow -> "33"
Blue -> "34"
Magenta -> "35"
Cyan -> "36"
White -> "37"
BrightB... | 604 | setColour :: Colour -> String
setColour c =
let code = case c of
Black -> "30"
Red -> "31"
Green -> "32"
Yellow -> "33"
Blue -> "34"
Magenta -> "35"
Cyan -> "36"
White -> "37"
BrightB... | 604 | setColour c =
let code = case c of
Black -> "30"
Red -> "31"
Green -> "32"
Yellow -> "33"
Blue -> "34"
Magenta -> "35"
Cyan -> "36"
White -> "37"
BrightBlack -> "90"
Br... | 574 | false | true | 4 | 11 | 311 | 145 | 69 | 76 | null | null |
kowey/GenI | geni-gui/src/NLP/GenI/Gui.hs | gpl-2.0 | inputInfoGui :: Window a -- ^ parent window
-> [Flag]
-> CustomSem sem
-> TestCase sem
-> IO Layout
inputInfoGui f flags_ wrangler tc = messageGui f . T.unlines $
[ csemStr, "" ] ++ semBlock ++
[ "Options"
, "-------"
, "Root feature: " <> maybe "" pr... | 1,890 | inputInfoGui :: Window a -- ^ parent window
-> [Flag]
-> CustomSem sem
-> TestCase sem
-> IO Layout
inputInfoGui f flags_ wrangler tc = messageGui f . T.unlines $
[ csemStr, "" ] ++ semBlock ++
[ "Options"
, "-------"
, "Root feature: " <> maybe "" pr... | 1,890 | inputInfoGui f flags_ wrangler tc = messageGui f . T.unlines $
[ csemStr, "" ] ++ semBlock ++
[ "Options"
, "-------"
, "Root feature: " <> maybe "" pretty (getFlag RootFeatureFlg flags_)
, ""
, "Optimisations"
, "-------------"
] ++ map optStatus optBios ++ polStuff
where
csemStr = ... | 1,737 | false | true | 0 | 13 | 777 | 398 | 204 | 194 | null | null |
sjakobi/stack | src/Stack/PackageDump.hs | bsd-3-clause | eachPair :: Monad m
=> (Text -> Sink Line m a)
-> Conduit Line m a
eachPair inner =
start
where
start = await >>= maybe (return ()) start'
start' bs1 =
toConsumer (valSrc =$= inner key) >>= yield >> start
where
(key, bs2) = T.break (== ':') bs1
(spaces, bs3... | 1,209 | eachPair :: Monad m
=> (Text -> Sink Line m a)
-> Conduit Line m a
eachPair inner =
start
where
start = await >>= maybe (return ()) start'
start' bs1 =
toConsumer (valSrc =$= inner key) >>= yield >> start
where
(key, bs2) = T.break (== ':') bs1
(spaces, bs3... | 1,209 | eachPair inner =
start
where
start = await >>= maybe (return ()) start'
start' bs1 =
toConsumer (valSrc =$= inner key) >>= yield >> start
where
(key, bs2) = T.break (== ':') bs1
(spaces, bs3) = T.span (== ' ') $ T.drop 1 bs2
indent = T.length key + 1 + T.length space... | 1,124 | false | true | 3 | 19 | 539 | 437 | 210 | 227 | null | null |
svenssonjoel/ArrowObsidian | Obsidian/ArrowObsidian/Examples/DotProd.hs | bsd-3-clause | educe' n f = pure halve ->- zipWith (uncurry f) ->- sync ->- reduce' (n-1) f | 77 | reduce' n f = pure halve ->- zipWith (uncurry f) ->- sync ->- reduce' (n-1) f | 77 | reduce' n f = pure halve ->- zipWith (uncurry f) ->- sync ->- reduce' (n-1) f | 77 | false | false | 0 | 10 | 16 | 48 | 22 | 26 | null | null |
ryantm/ghc | compiler/cmm/CmmUtils.hs | bsd-3-clause | cmmLoadIndexW :: DynFlags -> CmmExpr -> Int -> CmmType -> CmmExpr
cmmLoadIndexW dflags base off ty = CmmLoad (cmmOffsetW dflags base off) ty | 140 | cmmLoadIndexW :: DynFlags -> CmmExpr -> Int -> CmmType -> CmmExpr
cmmLoadIndexW dflags base off ty = CmmLoad (cmmOffsetW dflags base off) ty | 140 | cmmLoadIndexW dflags base off ty = CmmLoad (cmmOffsetW dflags base off) ty | 74 | false | true | 0 | 8 | 22 | 55 | 26 | 29 | null | null |
ribag/ganeti-experiments | src/Ganeti/Constants.hs | gpl-2.0 | confdReqInstanceDisks :: Int
confdReqInstanceDisks = Types.confdRequestTypeToRaw ReqInstanceDisks | 97 | confdReqInstanceDisks :: Int
confdReqInstanceDisks = Types.confdRequestTypeToRaw ReqInstanceDisks | 97 | confdReqInstanceDisks = Types.confdRequestTypeToRaw ReqInstanceDisks | 68 | false | true | 0 | 6 | 6 | 16 | 8 | 8 | null | null |
tauli/LambdaLudo | examples/sokokban/Main.hs | bsd-3-clause | main :: IO ()
main = runGame conf | 33 | main :: IO ()
main = runGame conf | 33 | main = runGame conf | 19 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
olsner/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | ppr_cmd (HsCmdArrForm (L _ (HsVar (L _ v))) Infix _ [arg1, arg2])
= hang (pprCmdArg (unLoc arg1)) 4 (sep [ pprInfixOcc v
, pprCmdArg (unLoc arg2)]) | 193 | ppr_cmd (HsCmdArrForm (L _ (HsVar (L _ v))) Infix _ [arg1, arg2])
= hang (pprCmdArg (unLoc arg1)) 4 (sep [ pprInfixOcc v
, pprCmdArg (unLoc arg2)]) | 193 | ppr_cmd (HsCmdArrForm (L _ (HsVar (L _ v))) Infix _ [arg1, arg2])
= hang (pprCmdArg (unLoc arg1)) 4 (sep [ pprInfixOcc v
, pprCmdArg (unLoc arg2)]) | 193 | false | false | 0 | 12 | 71 | 93 | 46 | 47 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F14.hs | bsd-3-clause | ptr_glGlobalAlphaFactorubSUN :: FunPtr (GLubyte -> IO ())
ptr_glGlobalAlphaFactorubSUN = unsafePerformIO $ getCommand "glGlobalAlphaFactorubSUN" | 144 | ptr_glGlobalAlphaFactorubSUN :: FunPtr (GLubyte -> IO ())
ptr_glGlobalAlphaFactorubSUN = unsafePerformIO $ getCommand "glGlobalAlphaFactorubSUN" | 144 | ptr_glGlobalAlphaFactorubSUN = unsafePerformIO $ getCommand "glGlobalAlphaFactorubSUN" | 86 | false | true | 0 | 9 | 12 | 33 | 16 | 17 | null | null |
brendanhay/gogol | gogol-games/gen/Network/Google/Games/Types/Product.hs | mpl-2.0 | -- | The category of the application.
aCategory :: Lens' Application (Maybe ApplicationCategory)
aCategory
= lens _aCategory (\ s a -> s{_aCategory = a}) | 155 | aCategory :: Lens' Application (Maybe ApplicationCategory)
aCategory
= lens _aCategory (\ s a -> s{_aCategory = a}) | 117 | aCategory
= lens _aCategory (\ s a -> s{_aCategory = a}) | 58 | true | true | 0 | 9 | 25 | 48 | 25 | 23 | null | null |
spockwangs/scheme.in.haskell | list6.4.hs | unlicense | cons [x, List xs] = return $ List $ [x] ++ xs | 45 | cons [x, List xs] = return $ List $ [x] ++ xs | 45 | cons [x, List xs] = return $ List $ [x] ++ xs | 45 | false | false | 0 | 7 | 11 | 34 | 17 | 17 | null | null |
mrkkrp/alga | src/Alga/Language/Eval.hs | gpl-3.0 | resolve xs = concat <$> mapM f xs
where f (Val x) = addHistory x >> return [x]
f (Sec x) = resolve x
f (Mul x) = choice x >>= maybe (return []) f
f (CMul x) = listToMaybe <$> filterM (matchHistory . fst) (NE.toList x) >>=
maybe (f . toMul $ x) (f . Mul . snd)
-- | Run lazy state ... | 346 | resolve xs = concat <$> mapM f xs
where f (Val x) = addHistory x >> return [x]
f (Sec x) = resolve x
f (Mul x) = choice x >>= maybe (return []) f
f (CMul x) = listToMaybe <$> filterM (matchHistory . fst) (NE.toList x) >>=
maybe (f . toMul $ x) (f . Mul . snd)
-- | Run lazy state ... | 346 | resolve xs = concat <$> mapM f xs
where f (Val x) = addHistory x >> return [x]
f (Sec x) = resolve x
f (Mul x) = choice x >>= maybe (return []) f
f (CMul x) = listToMaybe <$> filterM (matchHistory . fst) (NE.toList x) >>=
maybe (f . toMul $ x) (f . Mul . snd)
-- | Run lazy state ... | 346 | false | false | 3 | 11 | 107 | 166 | 82 | 84 | null | null |
mattias-lundell/timber-llvm | src/Desugar2.hs | bsd-3-clause | dsEqns ((LPat p,RExp (EVar v)):eqns)
= do p' <- dsPat p -- Checks validity
sels <- mapM (sel (EVar v)) vs
dsEqns (sels ++ eqns)
where vs = pvars p
sel e0 v = do vs... | 524 | dsEqns ((LPat p,RExp (EVar v)):eqns)
= do p' <- dsPat p -- Checks validity
sels <- mapM (sel (EVar v)) vs
dsEqns (sels ++ eqns)
where vs = pvars p
sel e0 v = do vs... | 524 | dsEqns ((LPat p,RExp (EVar v)):eqns)
= do p' <- dsPat p -- Checks validity
sels <- mapM (sel (EVar v)) vs
dsEqns (sels ++ eqns)
where vs = pvars p
sel e0 v = do vs... | 524 | false | false | 1 | 16 | 288 | 189 | 90 | 99 | null | null |
Ginto8/Lambda | src/Repl.hs | bsd-3-clause | repl :: Monad m => String -- Prompt
-> (String -> Bool) -- Quit?
-> (String -> Bool) -- Line is ready to be evaled
-> (String -> m String) -- Interpret, generate effect
-> (m String -> String) -- Write output
-> m () ... | 782 | repl :: Monad m => String -- Prompt
-> (String -> Bool) -- Quit?
-> (String -> Bool) -- Line is ready to be evaled
-> (String -> m String) -- Interpret, generate effect
-> (m String -> String) -- Write output
-> m () ... | 782 | repl prompt shouldQuit isReady eval printOut state = do
putStr prompt
hFlush stdout
line <- foldUntilM isReady (\x y -> x++" "++y) getLine
if shouldQuit line then
return state
else do
let state' = state >> eval line
let output = printOut state'
putStrLn output
... | 401 | false | true | 0 | 15 | 314 | 234 | 113 | 121 | null | null |
phischu/fragnix | tests/packages/scotty/Data.OrdPSQ.Internal.hs | bsd-3-clause | maxKey (Winner _ _ m) = m | 25 | maxKey (Winner _ _ m) = m | 25 | maxKey (Winner _ _ m) = m | 25 | false | false | 0 | 6 | 6 | 20 | 9 | 11 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/SVGSVGElement.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGSVGElement.animationsPaused Mozilla SVGSVGElement.animationsPaused documentation>
animationsPaused :: (MonadDOM m) => SVGSVGElement -> m Bool
animationsPaused self
= liftDOM ((self ^. jsf "animationsPaused" ()) >>= valToBool) | 286 | animationsPaused :: (MonadDOM m) => SVGSVGElement -> m Bool
animationsPaused self
= liftDOM ((self ^. jsf "animationsPaused" ()) >>= valToBool) | 145 | animationsPaused self
= liftDOM ((self ^. jsf "animationsPaused" ()) >>= valToBool) | 85 | true | true | 0 | 11 | 28 | 55 | 28 | 27 | null | null |
alexbiehl/hoop | hadoop-protos/src/Hadoop/Protos/ClientNamenodeProtocolProtos/ClientNamenodeProtocol.hs | mit | addBlock :: AddBlock
addBlock = P'.Method | 41 | addBlock :: AddBlock
addBlock = P'.Method | 41 | addBlock = P'.Method | 20 | false | true | 0 | 5 | 5 | 13 | 7 | 6 | null | null |
prowdsponsor/country-codes | src/Data/CountryCodes/ISO31661.hs | bsd-3-clause | toText NO = "NO" | 16 | toText NO = "NO" | 16 | toText NO = "NO" | 16 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
takano-akio/ordrea | FRP/Ordrea/Base.hs | cc0-1.0 | weakToLike :: Weak a -> WeakLike a
weakToLike = WeakLike . deRefWeak | 68 | weakToLike :: Weak a -> WeakLike a
weakToLike = WeakLike . deRefWeak | 68 | weakToLike = WeakLike . deRefWeak | 33 | false | true | 0 | 6 | 11 | 25 | 12 | 13 | null | null |
wdanilo/haskell-logger | src/System/Log.hs | apache-2.0 | test = do
addHandler $ addFilter (lvlFilter Warning) $ printHandler Nothing
debug "a debug"
warning "a warning" | 123 | test = do
addHandler $ addFilter (lvlFilter Warning) $ printHandler Nothing
debug "a debug"
warning "a warning" | 123 | test = do
addHandler $ addFilter (lvlFilter Warning) $ printHandler Nothing
debug "a debug"
warning "a warning" | 123 | false | false | 0 | 11 | 28 | 41 | 17 | 24 | null | null |
yesodweb/yesod | yesod-form/Yesod/Form/I18n/Korean.hs | mit | koreanFormMessage (MsgInvalidBool t) = "잘못된 불(boolean)입니다: " `mappend` t | 72 | koreanFormMessage (MsgInvalidBool t) = "잘못된 불(boolean)입니다: " `mappend` t | 72 | koreanFormMessage (MsgInvalidBool t) = "잘못된 불(boolean)입니다: " `mappend` t | 72 | false | false | 0 | 6 | 8 | 22 | 11 | 11 | null | null |
ml9951/ghc | compiler/main/DynFlags.hs | bsd-3-clause | wayTag WayProf = "p" | 24 | wayTag WayProf = "p" | 24 | wayTag WayProf = "p" | 24 | false | false | 0 | 4 | 7 | 10 | 4 | 6 | null | null |
gridaphobe/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | nlHsFunTy :: LHsType name -> LHsType name -> LHsType name
nlHsAppTy f t = noLoc (HsAppTy f t) | 104 | nlHsFunTy :: LHsType name -> LHsType name -> LHsType name
nlHsAppTy f t = noLoc (HsAppTy f t) | 103 | nlHsAppTy f t = noLoc (HsAppTy f t) | 45 | false | true | 0 | 7 | 28 | 44 | 20 | 24 | null | null |
Mathnerd314/lamdu | src/Lamdu/Layers.hs | gpl-3.0 | collapsedCompactBG = 28 | 23 | collapsedCompactBG = 28 | 23 | collapsedCompactBG = 28 | 23 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
BeautifulDestinations/dnngraph | NN/Visualize.hs | bsd-3-clause | dimensions :: LayerParameter -> L.Text
dimensions lp = params ty'
where
ty' = layerTy lp
-- Conv 128x3x3 s2
params Conv = L.unlines ["Conv",
format (int % "x" % int % "x" % int % " s" % int) o sz sz st]
where
cp f = lp ^?! _convolution_param._Ju... | 1,138 | dimensions :: LayerParameter -> L.Text
dimensions lp = params ty'
where
ty' = layerTy lp
-- Conv 128x3x3 s2
params Conv = L.unlines ["Conv",
format (int % "x" % int % "x" % int % " s" % int) o sz sz st]
where
cp f = lp ^?! _convolution_param._Ju... | 1,138 | dimensions lp = params ty'
where
ty' = layerTy lp
-- Conv 128x3x3 s2
params Conv = L.unlines ["Conv",
format (int % "x" % int % "x" % int % " s" % int) o sz sz st]
where
cp f = lp ^?! _convolution_param._Just ^?! f._Just
sz = cp CP._... | 1,099 | false | true | 0 | 14 | 444 | 368 | 186 | 182 | null | null |
Fuuzetsu/haddock | haddock-api/src/Haddock/Backends/Xhtml.hs | bsd-2-clause | indexButton :: Maybe String -> Maybe Html
indexButton maybe_index_url
= Just (anchor ! [href url] << "Index")
where url = fromMaybe indexHtmlFile maybe_index_url | 165 | indexButton :: Maybe String -> Maybe Html
indexButton maybe_index_url
= Just (anchor ! [href url] << "Index")
where url = fromMaybe indexHtmlFile maybe_index_url | 165 | indexButton maybe_index_url
= Just (anchor ! [href url] << "Index")
where url = fromMaybe indexHtmlFile maybe_index_url | 123 | false | true | 0 | 10 | 26 | 57 | 27 | 30 | null | null |
kawamuray/ganeti | src/Ganeti/HTools/Program/Hspace.hs | gpl-2.0 | main :: Options -> [String] -> IO ()
main opts args = do
exitUnless (null args) "This program doesn't take any arguments."
let verbose = optVerbose opts
machine_r = optMachineReadable opts
orig_cdata@(ClusterData gl fixed_nl il _ ipol) <- loadExternalData opts
nl <- setNodeStatus opts fixed_nl
cluste... | 2,975 | main :: Options -> [String] -> IO ()
main opts args = do
exitUnless (null args) "This program doesn't take any arguments."
let verbose = optVerbose opts
machine_r = optMachineReadable opts
orig_cdata@(ClusterData gl fixed_nl il _ ipol) <- loadExternalData opts
nl <- setNodeStatus opts fixed_nl
cluste... | 2,975 | main opts args = do
exitUnless (null args) "This program doesn't take any arguments."
let verbose = optVerbose opts
machine_r = optMachineReadable opts
orig_cdata@(ClusterData gl fixed_nl il _ ipol) <- loadExternalData opts
nl <- setNodeStatus opts fixed_nl
cluster_disk_template <-
case iPolicyDi... | 2,938 | false | true | 0 | 16 | 792 | 835 | 411 | 424 | null | null |
rueshyna/gogol | gogol-apps-calendar/gen/Network/Google/AppsCalendar/Types/Product.hs | mpl-2.0 | -- | Whether the attendee is a resource. Read-only. The default is False.
eaResource :: Lens' EventAttendee Bool
eaResource
= lens _eaResource (\ s a -> s{_eaResource = a}) | 174 | eaResource :: Lens' EventAttendee Bool
eaResource
= lens _eaResource (\ s a -> s{_eaResource = a}) | 100 | eaResource
= lens _eaResource (\ s a -> s{_eaResource = a}) | 61 | true | true | 0 | 9 | 30 | 42 | 22 | 20 | null | null |
ganeti/ganeti | src/Ganeti/Query/Server.hs | bsd-2-clause | -- | Like `handleClassicQuery`, but filters only by UUID.
handleUuidQuery :: ConfigData -- ^ Cluster config
-> Qlang.ItemType -- ^ Query type
-> [Either String Integer] -- ^ Requested names
-- (empty means all)
-> [String] ... | 526 | handleUuidQuery :: ConfigData -- ^ Cluster config
-> Qlang.ItemType -- ^ Query type
-> [Either String Integer] -- ^ Requested names
-- (empty means all)
-> [String] -- ^ Requested fields
-> Bool ... | 468 | handleUuidQuery = handleQuery [uuidField] | 41 | true | true | 0 | 12 | 206 | 68 | 38 | 30 | null | null |
OpenXT/manager | xenmgr/Vm/Queries.hs | gpl-2.0 | getVmTrackDependencies :: Uuid -> Rpc Bool
getVmTrackDependencies uuid = readConfigPropertyDef uuid vmTrackDependencies False | 125 | getVmTrackDependencies :: Uuid -> Rpc Bool
getVmTrackDependencies uuid = readConfigPropertyDef uuid vmTrackDependencies False | 125 | getVmTrackDependencies uuid = readConfigPropertyDef uuid vmTrackDependencies False | 82 | false | true | 0 | 6 | 12 | 28 | 13 | 15 | null | null |
hspec/hspec | hspec-discover/test/Test/Hspec/Discover/SortSpec.hs | mit | shuffleAndSort :: [String] -> IO [String]
shuffleAndSort xs = sortNaturally <$> generate (shuffle xs) | 101 | shuffleAndSort :: [String] -> IO [String]
shuffleAndSort xs = sortNaturally <$> generate (shuffle xs) | 101 | shuffleAndSort xs = sortNaturally <$> generate (shuffle xs) | 59 | false | true | 0 | 8 | 13 | 40 | 20 | 20 | null | null |
jrclogic/SMCDEL | src/SMCDEL/Examples/SimpleK.hs | gpl-2.0 | myEvent :: Event
myEvent = publicMakeFalseTrf (agentsOf exampleStart) (P 0) | 75 | myEvent :: Event
myEvent = publicMakeFalseTrf (agentsOf exampleStart) (P 0) | 75 | myEvent = publicMakeFalseTrf (agentsOf exampleStart) (P 0) | 58 | false | true | 0 | 7 | 9 | 34 | 15 | 19 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/Readers/Markdown.hs | gpl-2.0 | noteBlock :: MarkdownParser (F Blocks)
noteBlock = try $ do
pos <- getPosition
skipNonindentSpaces
ref <- noteMarker
char ':'
optional blankline
optional indentSpaces
first <- rawLines
rest <- many $ try $ blanklines >> indentSpaces >> rawLines
let raw = unlines (first:rest) ++ "\n"
optional blankli... | 675 | noteBlock :: MarkdownParser (F Blocks)
noteBlock = try $ do
pos <- getPosition
skipNonindentSpaces
ref <- noteMarker
char ':'
optional blankline
optional indentSpaces
first <- rawLines
rest <- many $ try $ blanklines >> indentSpaces >> rawLines
let raw = unlines (first:rest) ++ "\n"
optional blankli... | 675 | noteBlock = try $ do
pos <- getPosition
skipNonindentSpaces
ref <- noteMarker
char ':'
optional blankline
optional indentSpaces
first <- rawLines
rest <- many $ try $ blanklines >> indentSpaces >> rawLines
let raw = unlines (first:rest) ++ "\n"
optional blanklines
parsed <- parseFromString parseBl... | 636 | false | true | 0 | 16 | 145 | 242 | 112 | 130 | null | null |
brendanhay/gogol | gogol-games-configuration/gen/Network/Google/Resource/GamesConfiguration/LeaderboardConfigurations/List.hs | mpl-2.0 | -- | The application ID from the Google Play developer console.
lclApplicationId :: Lens' LeaderboardConfigurationsList Text
lclApplicationId
= lens _lclApplicationId
(\ s a -> s{_lclApplicationId = a}) | 210 | lclApplicationId :: Lens' LeaderboardConfigurationsList Text
lclApplicationId
= lens _lclApplicationId
(\ s a -> s{_lclApplicationId = a}) | 146 | lclApplicationId
= lens _lclApplicationId
(\ s a -> s{_lclApplicationId = a}) | 85 | true | true | 1 | 9 | 34 | 46 | 22 | 24 | null | null |
ezyang/ghc | testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail08.hs | bsd-3-clause | e = e { x = 3, y = True } | 25 | e = e { x = 3, y = True } | 25 | e = e { x = 3, y = True } | 25 | false | false | 1 | 7 | 10 | 27 | 13 | 14 | null | null |
craffit/flexdb | src/Data/Zippable1.hs | bsd-3-clause | mkPair1 :: f a -> g a -> Pair1 f g a
mkPair1 f g = Pair1 (f, g) | 63 | mkPair1 :: f a -> g a -> Pair1 f g a
mkPair1 f g = Pair1 (f, g) | 63 | mkPair1 f g = Pair1 (f, g) | 26 | false | true | 0 | 7 | 18 | 46 | 22 | 24 | null | null |
mstksg/hledger | hledger-lib/Hledger/Data/StringFormat.hs | gpl-3.0 | ----------------------------------------------------------------------
testFormat :: StringFormatComponent -> String -> String -> Assertion
testFormat fs value expected = assertEqual name expected actual
where
(name, actual) = case fs of
FormatLiteral l -> ("literal", formatString False Nothing... | 430 | testFormat :: StringFormatComponent -> String -> String -> Assertion
testFormat fs value expected = assertEqual name expected actual
where
(name, actual) = case fs of
FormatLiteral l -> ("literal", formatString False Nothing Nothing l)
FormatField leftJustify min max _ -> ("field", f... | 358 | testFormat fs value expected = assertEqual name expected actual
where
(name, actual) = case fs of
FormatLiteral l -> ("literal", formatString False Nothing Nothing l)
FormatField leftJustify min max _ -> ("field", formatString leftJustify min max value) | 289 | true | true | 0 | 9 | 83 | 110 | 56 | 54 | null | null |
limaner2002/EPC-tools | src/Types.hs | bsd-3-clause | fromBatchOpts :: BatchOpts a -> [JMeterOpts]
fromBatchOpts (BatchOpts opts) = opts | 82 | fromBatchOpts :: BatchOpts a -> [JMeterOpts]
fromBatchOpts (BatchOpts opts) = opts | 82 | fromBatchOpts (BatchOpts opts) = opts | 37 | false | true | 0 | 7 | 10 | 30 | 15 | 15 | null | null |
jkpl/tagenerator | src/TaGenerator/GameEngine.hs | mit | lookAtInventory :: GameData -> (GameState, String)
lookAtInventory gd@(GameData inventory _ _) =
(GameState gd, showInventory inventory) | 140 | lookAtInventory :: GameData -> (GameState, String)
lookAtInventory gd@(GameData inventory _ _) =
(GameState gd, showInventory inventory) | 140 | lookAtInventory gd@(GameData inventory _ _) =
(GameState gd, showInventory inventory) | 89 | false | true | 0 | 8 | 19 | 49 | 26 | 23 | null | null |
alexander-at-github/eta | libraries/base/GHC/Word.hs | bsd-3-clause | byteSwap16 :: Word16 -> Word16
byteSwap16 (W16# w#) = W16# (narrow16Word# (byteSwap16# w#)) | 91 | byteSwap16 :: Word16 -> Word16
byteSwap16 (W16# w#) = W16# (narrow16Word# (byteSwap16# w#)) | 91 | byteSwap16 (W16# w#) = W16# (narrow16Word# (byteSwap16# w#)) | 60 | false | true | 0 | 9 | 12 | 39 | 19 | 20 | null | null |
v0lkan/learning-haskell | session-005/001.back-to-the-future.hs | mit | functionTest = print (f 3 17 8) | 31 | functionTest = print (f 3 17 8) | 31 | functionTest = print (f 3 17 8) | 31 | false | false | 0 | 7 | 6 | 19 | 9 | 10 | null | null |
alang9/deque | Data/Deque/NonCat/LessTyped.hs | bsd-3-clause | toFringe a@B2{} b@B5{} = XR a b | 31 | toFringe a@B2{} b@B5{} = XR a b | 31 | toFringe a@B2{} b@B5{} = XR a b | 31 | false | false | 2 | 6 | 6 | 39 | 15 | 24 | null | null |
kazu-yamamoto/http2 | bench-priority/BinaryHeapSTM.hs | bsd-3-clause | newEntry :: a -> Weight -> STM (Entry a)
newEntry x w = Entry w <$> newTVar x <*> newTVar magicDeficit <*> newTVar (-1) | 119 | newEntry :: a -> Weight -> STM (Entry a)
newEntry x w = Entry w <$> newTVar x <*> newTVar magicDeficit <*> newTVar (-1) | 119 | newEntry x w = Entry w <$> newTVar x <*> newTVar magicDeficit <*> newTVar (-1) | 78 | false | true | 0 | 9 | 23 | 62 | 29 | 33 | null | null |
sbditto85/parsedsltest | src/Lib.hs | apache-2.0 | isSymbolIdent :: Char -> Bool
isSymbolIdent c =
(c == '-' || c == '_') | 72 | isSymbolIdent :: Char -> Bool
isSymbolIdent c =
(c == '-' || c == '_') | 72 | isSymbolIdent c =
(c == '-' || c == '_') | 42 | false | true | 0 | 8 | 16 | 33 | 17 | 16 | null | null |
miguelpagano/equ | Equ/PreExpr.hs | gpl-3.0 | isPreExprParent :: Focus -> Bool
isPreExprParent (Paren _,_) = True | 67 | isPreExprParent :: Focus -> Bool
isPreExprParent (Paren _,_) = True | 67 | isPreExprParent (Paren _,_) = True | 34 | false | true | 0 | 7 | 9 | 27 | 14 | 13 | null | null |
Tehnix/campaigns | Handler/Dashboard.hs | mit | getDashboardIR :: Language -> Text -> Handler Html
getDashboardIR lang dashboardToken = do
render <- getUrlRender
messageRender <- getMessageRender
master <- getYesod
maybeDashboard <- runDB . getBy $ UniqueDashboardToken dashboardToken
case maybeDashboard of
Nothing -> do
setMessageI MsgNotAValidDa... | 1,885 | getDashboardIR :: Language -> Text -> Handler Html
getDashboardIR lang dashboardToken = do
render <- getUrlRender
messageRender <- getMessageRender
master <- getYesod
maybeDashboard <- runDB . getBy $ UniqueDashboardToken dashboardToken
case maybeDashboard of
Nothing -> do
setMessageI MsgNotAValidDa... | 1,885 | getDashboardIR lang dashboardToken = do
render <- getUrlRender
messageRender <- getMessageRender
master <- getYesod
maybeDashboard <- runDB . getBy $ UniqueDashboardToken dashboardToken
case maybeDashboard of
Nothing -> do
setMessageI MsgNotAValidDashboardKey
redirect $ SignupIR lang
Just ... | 1,834 | false | true | 8 | 23 | 482 | 448 | 210 | 238 | null | null |
creswick/Newt | src/Newt/Newt.hs | bsd-3-clause | -- | Retrieves the set of @key@s found in a text file.
getTagsFile :: Tag a => a -> FilePath -> IO (Set String)
getTagsFile tag file = do content <- readFile file
return $ getTags tag content
-- | Collect the key names for every tag in the contents of the
-- specified directory. This does cu... | 498 | getTagsFile :: Tag a => a -> FilePath -> IO (Set String)
getTagsFile tag file = do content <- readFile file
return $ getTags tag content
-- | Collect the key names for every tag in the contents of the
-- specified directory. This does currently return tags in the
-- directory name itself. T... | 443 | getTagsFile tag file = do content <- readFile file
return $ getTags tag content
-- | Collect the key names for every tag in the contents of the
-- specified directory. This does currently return tags in the
-- directory name itself. That could be confusing, but I think it's a
-- corner case... | 386 | true | true | 0 | 11 | 120 | 74 | 36 | 38 | null | null |
ChrisLane/leksah | src/IDE/Pane/ClassHierarchy.hs | gpl-2.0 | selectClass _ = return () | 67 | selectClass _ = return () | 67 | selectClass _ = return () | 67 | false | false | 0 | 6 | 46 | 15 | 6 | 9 | null | null |
brendanhay/gogol | gogol-containeranalysis/gen/Network/Google/ContainerAnalysis/Types/Product.hs | mpl-2.0 | bcnrnAddtional :: Lens' BatchCreateNotesRequestNotes (HashMap Text Note)
bcnrnAddtional
= lens _bcnrnAddtional
(\ s a -> s{_bcnrnAddtional = a})
. _Coerce | 168 | bcnrnAddtional :: Lens' BatchCreateNotesRequestNotes (HashMap Text Note)
bcnrnAddtional
= lens _bcnrnAddtional
(\ s a -> s{_bcnrnAddtional = a})
. _Coerce | 168 | bcnrnAddtional
= lens _bcnrnAddtional
(\ s a -> s{_bcnrnAddtional = a})
. _Coerce | 95 | false | true | 1 | 8 | 33 | 56 | 27 | 29 | null | null |
lfairy/nationstates | NationStates/Nation.hs | apache-2.0 | -- | National animal.
--
-- > "sea-snake"
animal :: Nation String
animal = Nation $ makeNS "animal" "ANIMAL" | 108 | animal :: Nation String
animal = Nation $ makeNS "animal" "ANIMAL" | 66 | animal = Nation $ makeNS "animal" "ANIMAL" | 42 | true | true | 0 | 6 | 18 | 26 | 14 | 12 | null | null |
Sword-Smith/hfasto | src/MipsRegAlloc.hs | mit | regAllocInst spillingRewrite vtable (Mips.DIV rd rs rt) = do
rdRes <- mapReg vtable rd
rsRes <- mapReg vtable rs
rtRes <- mapReg vtable rt
let (pre1, pre2, post1) = spillWrap spillingRewrite vtable rd rs rt rdRes rsRes rtRes
incr
return $ pre1 ++ pre2 ++ [Mips.DIV rdRes rsRes rtRes] ++ post1 | 306 | regAllocInst spillingRewrite vtable (Mips.DIV rd rs rt) = do
rdRes <- mapReg vtable rd
rsRes <- mapReg vtable rs
rtRes <- mapReg vtable rt
let (pre1, pre2, post1) = spillWrap spillingRewrite vtable rd rs rt rdRes rsRes rtRes
incr
return $ pre1 ++ pre2 ++ [Mips.DIV rdRes rsRes rtRes] ++ post1 | 306 | regAllocInst spillingRewrite vtable (Mips.DIV rd rs rt) = do
rdRes <- mapReg vtable rd
rsRes <- mapReg vtable rs
rtRes <- mapReg vtable rt
let (pre1, pre2, post1) = spillWrap spillingRewrite vtable rd rs rt rdRes rsRes rtRes
incr
return $ pre1 ++ pre2 ++ [Mips.DIV rdRes rsRes rtRes] ++ post1 | 306 | false | false | 0 | 11 | 64 | 131 | 61 | 70 | null | null |
erikd/yesod | yesod-core/Yesod/Core/Dispatch.hs | mit | serverValue :: S8.ByteString
serverValue = S8.pack $ concat
[ "Warp/"
, Network.Wai.Handler.Warp.warpVersion
, " + Yesod/"
, showVersion Paths_yesod_core.version
, " (core)"
] | 199 | serverValue :: S8.ByteString
serverValue = S8.pack $ concat
[ "Warp/"
, Network.Wai.Handler.Warp.warpVersion
, " + Yesod/"
, showVersion Paths_yesod_core.version
, " (core)"
] | 199 | serverValue = S8.pack $ concat
[ "Warp/"
, Network.Wai.Handler.Warp.warpVersion
, " + Yesod/"
, showVersion Paths_yesod_core.version
, " (core)"
] | 170 | false | true | 2 | 8 | 46 | 55 | 28 | 27 | null | null |
bitemyapp/Lenses | src/Data/Lenses.hs | bsd-3-clause | {- |
Modifies the state in a state monad and returns the original value.
'getAndModify' and 'modifyAndGet' should really be in 'Control.Monad.State.Class'
-}
getAndModify :: (MonadState s m) => (s -> s) -> m s
getAndModify f = do
a <- get
modify f
return a
{- |
Modifies the state in a state monad and returns t... | 337 | getAndModify :: (MonadState s m) => (s -> s) -> m s
getAndModify f = do
a <- get
modify f
return a
{- |
Modifies the state in a state monad and returns the new value.
-} | 177 | getAndModify f = do
a <- get
modify f
return a
{- |
Modifies the state in a state monad and returns the new value.
-} | 125 | true | true | 0 | 9 | 70 | 65 | 30 | 35 | null | null |
palas/detparaminf | src/DetParamInf/DFSMVisualise.hs | bsd-2-clause | translateTran :: Transition -> (Int, DNode)
translateTran tr = ((-1) - fromIntegral (transitionId tr), DFun (funName tr) (genericLength (params tr))) | 149 | translateTran :: Transition -> (Int, DNode)
translateTran tr = ((-1) - fromIntegral (transitionId tr), DFun (funName tr) (genericLength (params tr))) | 149 | translateTran tr = ((-1) - fromIntegral (transitionId tr), DFun (funName tr) (genericLength (params tr))) | 105 | false | true | 0 | 10 | 19 | 71 | 37 | 34 | null | null |
spatial-reasoning/zeno | src/Interface/Sparq.hs | bsd-2-clause | algebraicClosure :: ( Relation (a b) b
, Sparqifiable (Network [String] (a b))
, Calculus b )
=> Network [String] (a b)
-> (Maybe Bool, Bool, Network [String] (GRel b))
algebraicClosure net =
if Map.null $ nCons net then
(Just True, F... | 1,724 | algebraicClosure :: ( Relation (a b) b
, Sparqifiable (Network [String] (a b))
, Calculus b )
=> Network [String] (a b)
-> (Maybe Bool, Bool, Network [String] (GRel b))
algebraicClosure net =
if Map.null $ nCons net then
(Just True, F... | 1,724 | algebraicClosure net =
if Map.null $ nCons net then
(Just True, False, makeNonAtomic net)
else case modified of
False -> (consistent, modified, makeNonAtomic net)
True -> (consistent, modified, net {nCons = nCons newNet})
where
sparqNet = sparqify True net
sparqModified:rest =... | 1,481 | false | true | 0 | 18 | 643 | 445 | 230 | 215 | null | null |
zachsully/hkc-test | tests/haskell/bucketTests.hs | bsd-3-clause | bucketAdd :: TrivialABT Term '[] ('HNat ':-> 'HNat)
bucketAdd = triv $
lam $ \x -> bucket (nat_ 0) x (r_add (const (nat_ 1))) | 127 | bucketAdd :: TrivialABT Term '[] ('HNat ':-> 'HNat)
bucketAdd = triv $
lam $ \x -> bucket (nat_ 0) x (r_add (const (nat_ 1))) | 127 | bucketAdd = triv $
lam $ \x -> bucket (nat_ 0) x (r_add (const (nat_ 1))) | 75 | false | true | 0 | 13 | 25 | 79 | 40 | 39 | null | null |
spechub/Hets | Comorphisms/LogicGraph.hs | gpl-2.0 | addUnionNames :: (AnyComorphism, AnyComorphism)
-> ((String, String), (AnyComorphism, AnyComorphism))
addUnionNames (c1@(Comorphism cid1), c2@(Comorphism cid2)) =
( (language_name $ sourceLogic cid1, language_name $ sourceLogic cid2)
, (c1, c2)) | 263 | addUnionNames :: (AnyComorphism, AnyComorphism)
-> ((String, String), (AnyComorphism, AnyComorphism))
addUnionNames (c1@(Comorphism cid1), c2@(Comorphism cid2)) =
( (language_name $ sourceLogic cid1, language_name $ sourceLogic cid2)
, (c1, c2)) | 263 | addUnionNames (c1@(Comorphism cid1), c2@(Comorphism cid2)) =
( (language_name $ sourceLogic cid1, language_name $ sourceLogic cid2)
, (c1, c2)) | 147 | false | true | 2 | 11 | 44 | 108 | 58 | 50 | null | null |
benekastah/ebitor | src/Ebitor/Rope/Regex.hs | bsd-3-clause | replace :: Regex
-> Rope
-> Rope
-> Rope
replace = replaceCount (-1) | 92 | replace :: Regex
-> Rope
-> Rope
-> Rope
replace = replaceCount (-1) | 92 | replace = replaceCount (-1) | 27 | false | true | 0 | 7 | 36 | 31 | 16 | 15 | null | null |
YoEight/deiko-feed | Text/RSS1/Export.hs | bsd-3-clause | xmlItemURIs :: [URIString] -> [XML.Element]
xmlItemURIs [] = [] | 63 | xmlItemURIs :: [URIString] -> [XML.Element]
xmlItemURIs [] = [] | 63 | xmlItemURIs [] = [] | 19 | false | true | 0 | 7 | 8 | 30 | 16 | 14 | null | null |
kmate/HaRe | old/refactorer/RefacInstantiate.hs | bsd-3-clause | convertt (HsLitLit x ) = x | 26 | convertt (HsLitLit x ) = x | 26 | convertt (HsLitLit x ) = x | 26 | false | false | 0 | 6 | 5 | 16 | 7 | 9 | null | null |
mettekou/ghc | compiler/prelude/THNames.hs | bsd-3-clause | {- *********************************************************************
* *
Id keys
* *
********************************************************************* -}... | 694 | returnQIdKey, bindQIdKey, sequenceQIdKey, liftIdKey, newNameIdKey,
mkNameIdKey, mkNameG_vIdKey, mkNameG_dIdKey, mkNameG_tcIdKey,
mkNameLIdKey, mkNameSIdKey, unTypeIdKey, unTypeQIdKey,
unsafeTExpCoerceIdKey :: Unique
returnQIdKey = mkPreludeMiscIdUnique 200 | 275 | returnQIdKey = mkPreludeMiscIdUnique 200 | 47 | true | true | 0 | 5 | 226 | 43 | 36 | 7 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.