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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
atemerev/icfpc2013 | src/solver-lib/Types.hs | apache-2.0 | isConstExpr (Xor a b) = isConstExprC a && isConstExprC b | 56 | isConstExpr (Xor a b) = isConstExprC a && isConstExprC b | 56 | isConstExpr (Xor a b) = isConstExprC a && isConstExprC b | 56 | false | false | 0 | 7 | 9 | 27 | 12 | 15 | null | null |
ChrisKuklewicz/SafeSemaphore | src/Control/Concurrent/MSemN2.hs | bsd-3-clause | new initial = do
newMS <- newMVar $! (MS { avail = initial -- this forces 'initial'
, headWants = Nothing })
newQueueWait <- newMVar ()
newHeadWait <- newEmptyMVar
return (MSemN { quantityStore = newMS
, queueWait = newQueueWait
, headWait = newHeadWait... | 592 | new initial = do
newMS <- newMVar $! (MS { avail = initial -- this forces 'initial'
, headWants = Nothing })
newQueueWait <- newMVar ()
newHeadWait <- newEmptyMVar
return (MSemN { quantityStore = newMS
, queueWait = newQueueWait
, headWait = newHeadWait... | 592 | new initial = do
newMS <- newMVar $! (MS { avail = initial -- this forces 'initial'
, headWants = Nothing })
newQueueWait <- newMVar ()
newHeadWait <- newEmptyMVar
return (MSemN { quantityStore = newMS
, queueWait = newQueueWait
, headWait = newHeadWait... | 592 | false | false | 1 | 12 | 157 | 93 | 49 | 44 | null | null |
kelecorix/api-hasoffers | src/HasOffers/API/Brand/Offer.hs | bsd-3-clause | getThumbnail params =
Call "Offer"
"getThumbnail"
"GET"
[ Param "id" True $ getParam params 0
] | 125 | getThumbnail params =
Call "Offer"
"getThumbnail"
"GET"
[ Param "id" True $ getParam params 0
] | 125 | getThumbnail params =
Call "Offer"
"getThumbnail"
"GET"
[ Param "id" True $ getParam params 0
] | 125 | false | false | 0 | 8 | 45 | 35 | 16 | 19 | null | null |
egaburov/funstuff | Haskell/parsec/JSONParsec.hs | apache-2.0 | p_escape = choice (zipWith decode "bnfrt\\\"/" "\b\n\f\r\t\\\"/")
where decode c r = r <$ char c
{-- /snippet p_escape --}
{-- snippet p_unicode --} | 157 | p_escape = choice (zipWith decode "bnfrt\\\"/" "\b\n\f\r\t\\\"/")
where decode c r = r <$ char c
{-- /snippet p_escape --}
{-- snippet p_unicode --} | 157 | p_escape = choice (zipWith decode "bnfrt\\\"/" "\b\n\f\r\t\\\"/")
where decode c r = r <$ char c
{-- /snippet p_escape --}
{-- snippet p_unicode --} | 157 | false | false | 0 | 8 | 32 | 40 | 20 | 20 | null | null |
keithodulaigh/Hets | Propositional/Prop2CASLHelpers.hs | gpl-2.0 | -- | Which is the target sublogic?
mapSub :: PSL.PropSL -> CSL.CASL_Sublogics
mapSub sl = CSL.bottom
{ CSL.cons_features = CSL.NoSortGen
, CSL.sub_features = CSL.NoSub
, CSL.has_pred = True
, CSL.has_eq = False
, CSL.which_logic = if PSL.isHC sl then CSL.Horn else CSL.FOL } | 284 | mapSub :: PSL.PropSL -> CSL.CASL_Sublogics
mapSub sl = CSL.bottom
{ CSL.cons_features = CSL.NoSortGen
, CSL.sub_features = CSL.NoSub
, CSL.has_pred = True
, CSL.has_eq = False
, CSL.which_logic = if PSL.isHC sl then CSL.Horn else CSL.FOL } | 249 | mapSub sl = CSL.bottom
{ CSL.cons_features = CSL.NoSortGen
, CSL.sub_features = CSL.NoSub
, CSL.has_pred = True
, CSL.has_eq = False
, CSL.which_logic = if PSL.isHC sl then CSL.Horn else CSL.FOL } | 206 | true | true | 0 | 10 | 52 | 92 | 51 | 41 | null | null |
yiannist/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | hvMigrationPort :: String
hvMigrationPort = "migration_port" | 60 | hvMigrationPort :: String
hvMigrationPort = "migration_port" | 60 | hvMigrationPort = "migration_port" | 34 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
bravit/Idris-dev | src/Idris/Delaborate.hs | bsd-3-clause | -- | Add extra metadata to an output annotation, optionally marking metavariables.
fancifyAnnots :: IState -> Bool -> OutputAnnotation -> OutputAnnotation
fancifyAnnots ist meta annot@(AnnName n nt _ _) =
do let ctxt = tt_ctxt ist
docs = docOverview ist n
ty = Just (getTy ist n)
case () of
... | 2,042 | fancifyAnnots :: IState -> Bool -> OutputAnnotation -> OutputAnnotation
fancifyAnnots ist meta annot@(AnnName n nt _ _) =
do let ctxt = tt_ctxt ist
docs = docOverview ist n
ty = Just (getTy ist n)
case () of
_ | isDConName n ctxt -> AnnName n (nt <|> Just DataOutput) docs ty
... | 1,959 | fancifyAnnots ist meta annot@(AnnName n nt _ _) =
do let ctxt = tt_ctxt ist
docs = docOverview ist n
ty = Just (getTy ist n)
case () of
_ | isDConName n ctxt -> AnnName n (nt <|> Just DataOutput) docs ty
_ | isFnName n ctxt -> AnnName n (nt <|> Just FunOutput) docs ... | 1,887 | true | true | 0 | 15 | 873 | 543 | 257 | 286 | null | null |
ml9951/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | bitIntegerIdKey :: Unique
bitIntegerIdKey = mkPreludeMiscIdUnique 509 | 75 | bitIntegerIdKey :: Unique
bitIntegerIdKey = mkPreludeMiscIdUnique 509 | 75 | bitIntegerIdKey = mkPreludeMiscIdUnique 509 | 49 | false | true | 0 | 5 | 12 | 14 | 7 | 7 | null | null |
feliposz/learning-stuff | haskell/h4c.hs | mit | showLen :: [a] -> String
showLen lst = (show (theLen)) ++ (if theLen == 1 then " item" else " itens")
where theLen = length lst
-- 4.5 Lambda
-- map (\x -> "the " ++ show x) [1, 2, 3, 4, 5]
-- 4.6 Type constructors
-- main = putStrLn (show 4)
-- main = return () | 270 | showLen :: [a] -> String
showLen lst = (show (theLen)) ++ (if theLen == 1 then " item" else " itens")
where theLen = length lst
-- 4.5 Lambda
-- map (\x -> "the " ++ show x) [1, 2, 3, 4, 5]
-- 4.6 Type constructors
-- main = putStrLn (show 4)
-- main = return () | 270 | showLen lst = (show (theLen)) ++ (if theLen == 1 then " item" else " itens")
where theLen = length lst
-- 4.5 Lambda
-- map (\x -> "the " ++ show x) [1, 2, 3, 4, 5]
-- 4.6 Type constructors
-- main = putStrLn (show 4)
-- main = return () | 245 | false | true | 0 | 8 | 65 | 65 | 37 | 28 | null | null |
elliottt/dang | src/Dang/Syntax/Signatures.hs | bsd-3-clause | resolveMatch m@MFail{} =
return m | 38 | resolveMatch m@MFail{} =
return m | 38 | resolveMatch m@MFail{} =
return m | 38 | false | false | 0 | 7 | 9 | 19 | 9 | 10 | null | null |
ennocramer/hindent | src/HIndent/Styles/JohanTibell.hs | bsd-3-clause | -- | rhs on field update on the same line as lhs.
fieldupdate :: FieldUpdate NodeInfo -> Printer s ()
fieldupdate e =
case e of
FieldUpdate _ n e' -> do pretty n
write " = "
pretty e'
_ -> prettyNoExt e | 270 | fieldupdate :: FieldUpdate NodeInfo -> Printer s ()
fieldupdate e =
case e of
FieldUpdate _ n e' -> do pretty n
write " = "
pretty e'
_ -> prettyNoExt e | 220 | fieldupdate e =
case e of
FieldUpdate _ n e' -> do pretty n
write " = "
pretty e'
_ -> prettyNoExt e | 168 | true | true | 0 | 10 | 111 | 73 | 32 | 41 | null | null |
DavidAlphaFox/darcs | src/Darcs/Util/URL.hs | gpl-2.0 | isSshNopath :: String -> Bool
isSshNopath s = case reverse s of
':':x@(_:_:_) -> ':' `notElem` x
_ -> False
-- | Gives the (user, host, dir) out of an ssh url | 195 | isSshNopath :: String -> Bool
isSshNopath s = case reverse s of
':':x@(_:_:_) -> ':' `notElem` x
_ -> False
-- | Gives the (user, host, dir) out of an ssh url | 195 | isSshNopath s = case reverse s of
':':x@(_:_:_) -> ':' `notElem` x
_ -> False
-- | Gives the (user, host, dir) out of an ssh url | 165 | false | true | 0 | 12 | 68 | 62 | 33 | 29 | null | null |
snoyberg/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | mkLHsPar :: LHsExpr name -> LHsExpr name
-- Wrap in parens if hsExprNeedsParens says it needs them
-- So 'f x' becomes '(f x)', but '3' stays as '3'
mkLHsPar le@(L loc e) | hsExprNeedsParens e = L loc (HsPar le)
| otherwise = le | 263 | mkLHsPar :: LHsExpr name -> LHsExpr name
mkLHsPar le@(L loc e) | hsExprNeedsParens e = L loc (HsPar le)
| otherwise = le | 152 | mkLHsPar le@(L loc e) | hsExprNeedsParens e = L loc (HsPar le)
| otherwise = le | 111 | true | true | 6 | 7 | 79 | 65 | 32 | 33 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/ExtensionPredicates.hs | bsd-3-clause | -- | Is the <https://www.opengl.org/registry/specs/KHR/texture_compression_astc_hdr.txt KHR_texture_compression_astc_hdr> extension supported?
-- Note that in the presence of multiple contexts with different capabilities,
-- this might be wrong. Use 'glGetKHRTextureCompressionASTCHDR' in those cases instead.
gl_KHR_tex... | 447 | gl_KHR_texture_compression_astc_hdr :: Bool
gl_KHR_texture_compression_astc_hdr = member "GL_KHR_texture_compression_astc_hdr" extensions | 137 | gl_KHR_texture_compression_astc_hdr = member "GL_KHR_texture_compression_astc_hdr" extensions | 93 | true | true | 0 | 5 | 38 | 19 | 11 | 8 | null | null |
spechub/Hets | Isabelle/IsaConsts.hs | gpl-2.0 | conC :: VName -> Term
conC s = mkConst s noTypeC | 48 | conC :: VName -> Term
conC s = mkConst s noTypeC | 48 | conC s = mkConst s noTypeC | 26 | false | true | 0 | 5 | 10 | 23 | 11 | 12 | null | null |
RyanGlScott/bluetooth | src/Network/Bluetooth/UUID.hs | bsd-3-clause | baseUUIDWord4 = 0x5F9B34FB | 26 | baseUUIDWord4 = 0x5F9B34FB | 26 | baseUUIDWord4 = 0x5F9B34FB | 26 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
harendra-kumar/asyncly | src/Streamly/Streams/StreamK/Type.hs | bsd-3-clause | mkStreamFromStream :: IsStream t
=> (forall r. State Stream m a
-> (a -> Stream m a -> m r)
-> (a -> m r)
-> m r
-> m r)
-> t m a
mkStreamFromStream k = fromStream $ MkStream k | 216 | mkStreamFromStream :: IsStream t
=> (forall r. State Stream m a
-> (a -> Stream m a -> m r)
-> (a -> m r)
-> m r
-> m r)
-> t m a
mkStreamFromStream k = fromStream $ MkStream k | 216 | mkStreamFromStream k = fromStream $ MkStream k | 46 | false | true | 0 | 15 | 81 | 107 | 50 | 57 | null | null |
deadfoxygrandpa/Elm | compiler/Generate/JavaScript/Helpers.hs | bsd-3-clause | split :: String -> [String]
split = go []
where
go vars str =
case break (=='.') str of
(x,_:rest) | Help.isOp x -> vars ++ [x ++ '.' : rest]
| otherwise -> go (vars ++ [x]) rest
(x,[]) -> vars ++ [x] | 255 | split :: String -> [String]
split = go []
where
go vars str =
case break (=='.') str of
(x,_:rest) | Help.isOp x -> vars ++ [x ++ '.' : rest]
| otherwise -> go (vars ++ [x]) rest
(x,[]) -> vars ++ [x] | 255 | split = go []
where
go vars str =
case break (=='.') str of
(x,_:rest) | Help.isOp x -> vars ++ [x ++ '.' : rest]
| otherwise -> go (vars ++ [x]) rest
(x,[]) -> vars ++ [x] | 227 | false | true | 0 | 12 | 98 | 136 | 70 | 66 | null | null |
hvr/text | Data/Text.hs | bsd-2-clause | -- | /O(n)/ 'takeWhile', applied to a predicate @p@ and a 'Text',
-- returns the longest prefix (possibly empty) of elements that
-- satisfy @p@. Subject to fusion.
takeWhile :: (Char -> Bool) -> Text -> Text
takeWhile p t@(Text arr off len) = loop 0
where loop !i | i >= len = t
| p c = lo... | 417 | takeWhile :: (Char -> Bool) -> Text -> Text
takeWhile p t@(Text arr off len) = loop 0
where loop !i | i >= len = t
| p c = loop (i+d)
| otherwise = text arr off i
where Iter c d = iter t i
| 251 | takeWhile p t@(Text arr off len) = loop 0
where loop !i | i >= len = t
| p c = loop (i+d)
| otherwise = text arr off i
where Iter c d = iter t i
| 207 | true | true | 0 | 8 | 139 | 127 | 61 | 66 | null | null |
leshchevds/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | htKvmSpiceLossyImgComprNever :: String
htKvmSpiceLossyImgComprNever = "never" | 77 | htKvmSpiceLossyImgComprNever :: String
htKvmSpiceLossyImgComprNever = "never" | 77 | htKvmSpiceLossyImgComprNever = "never" | 38 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
byorgey/Idris-dev | src/IRTS/Compiler.hs | bsd-3-clause | mkLDecl n (CaseOp _ inl _ _ pats _ _ args sc) = do e <- ir (args, sc)
return (declArgs [] inl n e) | 149 | mkLDecl n (CaseOp _ inl _ _ pats _ _ args sc) = do e <- ir (args, sc)
return (declArgs [] inl n e) | 149 | mkLDecl n (CaseOp _ inl _ _ pats _ _ args sc) = do e <- ir (args, sc)
return (declArgs [] inl n e) | 149 | false | false | 0 | 10 | 75 | 71 | 33 | 38 | null | null |
maciej-wichrowski/HsCharts | source/Graphics/HsCharts/Charts.hs | bsd-3-clause | scalePoints :: Axis -> Axis -> [Point2] -> [Point2]
scalePoints xAxis yAxis pts = zip (map (axisScaleFn xAxis) xs)
(map (axisScaleFn yAxis) ys)
where (xs, ys) = unzip pts
-----------------------------------------------------------------------------
-- | Renders the bac... | 344 | scalePoints :: Axis -> Axis -> [Point2] -> [Point2]
scalePoints xAxis yAxis pts = zip (map (axisScaleFn xAxis) xs)
(map (axisScaleFn yAxis) ys)
where (xs, ys) = unzip pts
-----------------------------------------------------------------------------
-- | Renders the bac... | 344 | scalePoints xAxis yAxis pts = zip (map (axisScaleFn xAxis) xs)
(map (axisScaleFn yAxis) ys)
where (xs, ys) = unzip pts
-----------------------------------------------------------------------------
-- | Renders the background area of a chart. | 292 | false | true | 0 | 9 | 89 | 88 | 46 | 42 | null | null |
DaMSL/K3 | src/Language/K3/TypeSystem/Monad/Utils.hs | apache-2.0 | pEnvRequire :: (Applicative m, Monad m, TypeErrorI m)
=> TEnvId -> TParamEnv -> m UVar
pEnvRequire i p = do
envRequire (InternalError $ MissingTypeParameter p i) i p | 179 | pEnvRequire :: (Applicative m, Monad m, TypeErrorI m)
=> TEnvId -> TParamEnv -> m UVar
pEnvRequire i p = do
envRequire (InternalError $ MissingTypeParameter p i) i p | 179 | pEnvRequire i p = do
envRequire (InternalError $ MissingTypeParameter p i) i p | 80 | false | true | 0 | 10 | 41 | 70 | 34 | 36 | null | null |
lynnard/cocos2d-hs | src/Graphics/UI/Cocos2d/Director.hs | bsd-3-clause | castDirectorToConst (DirectorGc fptr' ptr') = DirectorConstGc fptr' $ HoppyF.castPtr ptr' | 89 | castDirectorToConst (DirectorGc fptr' ptr') = DirectorConstGc fptr' $ HoppyF.castPtr ptr' | 89 | castDirectorToConst (DirectorGc fptr' ptr') = DirectorConstGc fptr' $ HoppyF.castPtr ptr' | 89 | false | false | 0 | 7 | 9 | 29 | 13 | 16 | null | null |
silkapp/xmlhtml | test/suite/Text/XmlHtml/Tests.hs | bsd-3-clause | emptyAttr2 :: Bool
emptyAttr2 = parseHTML "" "<div itemscope itemtype=\"type\"></div>"
== Right (HtmlDocument UTF8 Nothing [Element "div" [("itemscope", ""), ("itemtype", "type")] []]) | 192 | emptyAttr2 :: Bool
emptyAttr2 = parseHTML "" "<div itemscope itemtype=\"type\"></div>"
== Right (HtmlDocument UTF8 Nothing [Element "div" [("itemscope", ""), ("itemtype", "type")] []]) | 192 | emptyAttr2 = parseHTML "" "<div itemscope itemtype=\"type\"></div>"
== Right (HtmlDocument UTF8 Nothing [Element "div" [("itemscope", ""), ("itemtype", "type")] []]) | 173 | false | true | 1 | 12 | 29 | 74 | 36 | 38 | null | null |
brendanhay/gogol | gogol-customsearch/gen/Network/Google/CustomSearch/Types/Product.hs | mpl-2.0 | -- | Specifies that all results should contain a link to a specific URL.
sqppiLinkSite :: Lens' SearchQueriesPreviousPageItem (Maybe Text)
sqppiLinkSite
= lens _sqppiLinkSite
(\ s a -> s{_sqppiLinkSite = a}) | 215 | sqppiLinkSite :: Lens' SearchQueriesPreviousPageItem (Maybe Text)
sqppiLinkSite
= lens _sqppiLinkSite
(\ s a -> s{_sqppiLinkSite = a}) | 142 | sqppiLinkSite
= lens _sqppiLinkSite
(\ s a -> s{_sqppiLinkSite = a}) | 76 | true | true | 1 | 9 | 38 | 52 | 25 | 27 | null | null |
urbanslug/ghc | compiler/basicTypes/NameSet.hs | bsd-3-clause | foldNameSet = foldUniqSet | 31 | foldNameSet = foldUniqSet | 31 | foldNameSet = foldUniqSet | 31 | false | false | 0 | 4 | 8 | 6 | 3 | 3 | null | null |
mietek/stack | src/Stack/Docker.hs | bsd-3-clause | checkVersions :: (MonadIO m,MonadThrow m) => m ()
checkVersions =
do inContainer <- getInContainer
when inContainer
(do checkHostStackVersion requireHostVersion
maybeReqVer <- liftIO (lookupEnv requireVersionEnvVar)
case parseVersionFromString =<< maybeReqVer of
Just req... | 540 | checkVersions :: (MonadIO m,MonadThrow m) => m ()
checkVersions =
do inContainer <- getInContainer
when inContainer
(do checkHostStackVersion requireHostVersion
maybeReqVer <- liftIO (lookupEnv requireVersionEnvVar)
case parseVersionFromString =<< maybeReqVer of
Just req... | 540 | checkVersions =
do inContainer <- getInContainer
when inContainer
(do checkHostStackVersion requireHostVersion
maybeReqVer <- liftIO (lookupEnv requireVersionEnvVar)
case parseVersionFromString =<< maybeReqVer of
Just reqVer
| stackVersion < reqVer -> thro... | 490 | false | true | 0 | 17 | 148 | 138 | 63 | 75 | null | null |
CulpaBS/wbBach | src/Futhark/Test.hs | bsd-3-clause | -- | Read the test specification from the given Futhark program.
-- Note: will call 'error' on parse errors.
testSpecFromFile :: FilePath -> IO ProgramTest
testSpecFromFile path = do
s <- T.unlines .
map (T.drop 2) .
takeWhile (commentPrefix `T.isPrefixOf`) .
T.lines <$>
T.readFile path
... | 542 | testSpecFromFile :: FilePath -> IO ProgramTest
testSpecFromFile path = do
s <- T.unlines .
map (T.drop 2) .
takeWhile (commentPrefix `T.isPrefixOf`) .
T.lines <$>
T.readFile path
case readTestSpec path s of
Left err -> error $ show $ fixPosition err
Right v -> return v
-- | Try... | 433 | testSpecFromFile path = do
s <- T.unlines .
map (T.drop 2) .
takeWhile (commentPrefix `T.isPrefixOf`) .
T.lines <$>
T.readFile path
case readTestSpec path s of
Left err -> error $ show $ fixPosition err
Right v -> return v
-- | Try to parse a several core Futhark values from a ... | 386 | true | true | 0 | 15 | 128 | 123 | 60 | 63 | null | null |
brendanhay/gogol | gogol-ml/gen/Network/Google/MachineLearning/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'GoogleCloudMlV1__AutoScaling' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcmvasMetrics'
--
-- * 'gcmvasMinNodes'
--
-- * 'gcmvasMaxNodes'
googleCloudMlV1__AutoScaling
:: GoogleCloudMlV1__AutoScaling
g... | 482 | googleCloudMlV1__AutoScaling
:: GoogleCloudMlV1__AutoScaling
googleCloudMlV1__AutoScaling =
GoogleCloudMlV1__AutoScaling'
{ _gcmvasMetrics = Nothing
, _gcmvasMinNodes = Nothing
, _gcmvasMaxNodes = Nothing
} | 228 | googleCloudMlV1__AutoScaling =
GoogleCloudMlV1__AutoScaling'
{ _gcmvasMetrics = Nothing
, _gcmvasMinNodes = Nothing
, _gcmvasMaxNodes = Nothing
} | 163 | true | true | 0 | 6 | 82 | 40 | 28 | 12 | null | null |
kapilash/dc | src/ccs2c/ccs2cs-lib/src/Language/CCS/Printer.hs | bsd-3-clause | enumValToDoc nm (EnumSize s) = extractNMap (StructSize s) nm | 64 | enumValToDoc nm (EnumSize s) = extractNMap (StructSize s) nm | 64 | enumValToDoc nm (EnumSize s) = extractNMap (StructSize s) nm | 64 | false | false | 0 | 7 | 12 | 30 | 13 | 17 | null | null |
jystic/QuickSpec | qs1/TinyWMProperties.hs | bsd-3-clause | prop_delete_push i x = not (member i x) ==> delete i (push i x) == x
where _ = x :: T
-- deletion is idempotent | 116 | prop_delete_push i x = not (member i x) ==> delete i (push i x) == x
where _ = x :: T
-- deletion is idempotent | 116 | prop_delete_push i x = not (member i x) ==> delete i (push i x) == x
where _ = x :: T
-- deletion is idempotent | 116 | false | false | 2 | 9 | 30 | 63 | 27 | 36 | null | null |
bergmannf/gitit | src/Network/Gitit/ContentTransformer.hs | gpl-2.0 | applyTransform :: a -> (a -> PluginM a) -> ContentTransformer a
applyTransform inp transform = do
context <- get
conf <- lift getConfig
user <- lift getLoggedInUser
fs <- lift getFileStore
req <- lift askRq
let pluginData = PluginData{ pluginConfig = conf
, pluginUser = user
... | 600 | applyTransform :: a -> (a -> PluginM a) -> ContentTransformer a
applyTransform inp transform = do
context <- get
conf <- lift getConfig
user <- lift getLoggedInUser
fs <- lift getFileStore
req <- lift askRq
let pluginData = PluginData{ pluginConfig = conf
, pluginUser = user
... | 600 | applyTransform inp transform = do
context <- get
conf <- lift getConfig
user <- lift getLoggedInUser
fs <- lift getFileStore
req <- lift askRq
let pluginData = PluginData{ pluginConfig = conf
, pluginUser = user
, pluginRequest = req
... | 536 | false | true | 0 | 11 | 186 | 162 | 78 | 84 | null | null |
susu/haskell-problems | ProjectEuler/problem7.hs | gpl-3.0 | solution = (filter (is_prime) [1..]) !! (10001 - 1) | 51 | solution = (filter (is_prime) [1..]) !! (10001 - 1) | 51 | solution = (filter (is_prime) [1..]) !! (10001 - 1) | 51 | false | false | 1 | 8 | 8 | 35 | 17 | 18 | null | null |
seereason/cabal | cabal-install/Distribution/Client/InstallPlan.hs | bsd-3-clause | showPlanProblem (PackageMissingDeps pkg missingDeps) =
"Package " ++ display (packageId pkg)
++ " depends on the following packages which are missing from the plan: "
++ intercalate ", " (map display missingDeps) | 221 | showPlanProblem (PackageMissingDeps pkg missingDeps) =
"Package " ++ display (packageId pkg)
++ " depends on the following packages which are missing from the plan: "
++ intercalate ", " (map display missingDeps) | 221 | showPlanProblem (PackageMissingDeps pkg missingDeps) =
"Package " ++ display (packageId pkg)
++ " depends on the following packages which are missing from the plan: "
++ intercalate ", " (map display missingDeps) | 221 | false | false | 4 | 8 | 40 | 53 | 24 | 29 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | falteringly = id | 16 | falteringly = id | 16 | falteringly = id | 16 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
cbaatz/hamu8080 | src/Hamu8080/Compute.hs | mit | -- RM
doOp 0xFA = getF Sign >>= \s -> when s jmp | 48 | doOp 0xFA = getF Sign >>= \s -> when s jmp | 42 | doOp 0xFA = getF Sign >>= \s -> when s jmp | 42 | true | false | 0 | 7 | 12 | 27 | 13 | 14 | null | null |
ambiata/tatooine-cli | src/Ambiata/Cli/Env.hs | apache-2.0 | tsrpKeyId :: Reader KeyId
tsrpKeyId =
nonempty >=>
(maybeToRight "Provided key ID is invalid." . lazyMaybe' . Z.parseKeyId . T.encodeUtf8) | 144 | tsrpKeyId :: Reader KeyId
tsrpKeyId =
nonempty >=>
(maybeToRight "Provided key ID is invalid." . lazyMaybe' . Z.parseKeyId . T.encodeUtf8) | 144 | tsrpKeyId =
nonempty >=>
(maybeToRight "Provided key ID is invalid." . lazyMaybe' . Z.parseKeyId . T.encodeUtf8) | 118 | false | true | 0 | 10 | 25 | 40 | 20 | 20 | null | null |
jfischoff/meta-format | src/Data/Archive/Meta/Classes.hs | bsd-3-clause | encode :: ToTar a => a -> Either String ByteString
encode = fmap write . toTar | 79 | encode :: ToTar a => a -> Either String ByteString
encode = fmap write . toTar | 78 | encode = fmap write . toTar | 27 | false | true | 0 | 7 | 16 | 34 | 16 | 18 | null | null |
Kerl13/AsciiMath | src/lib/AsciiMath.hs | mit | run :: String -> String
run s = case compile s of
Right txt -> txt
Left e -> throw $ ErrorAndSource e s | 107 | run :: String -> String
run s = case compile s of
Right txt -> txt
Left e -> throw $ ErrorAndSource e s | 107 | run s = case compile s of
Right txt -> txt
Left e -> throw $ ErrorAndSource e s | 83 | false | true | 0 | 9 | 27 | 55 | 25 | 30 | null | null |
bdkoepke/pearls | src/ch01/MinFree.hs | bsd-3-clause | search :: Array Integer Bool -> Int
search = length . takeWhile id . elems | 74 | search :: Array Integer Bool -> Int
search = length . takeWhile id . elems | 74 | search = length . takeWhile id . elems | 38 | false | true | 0 | 7 | 14 | 31 | 15 | 16 | null | null |
Delapouite/dotfiles | link/.xmonad/xmonad.lafayette.hs | mit | rowsFirst = smartBorders $ rowsLayout ||| columnsLayout ||| gridFull | 68 | rowsFirst = smartBorders $ rowsLayout ||| columnsLayout ||| gridFull | 68 | rowsFirst = smartBorders $ rowsLayout ||| columnsLayout ||| gridFull | 68 | false | false | 0 | 7 | 8 | 18 | 9 | 9 | null | null |
kumasento/accelerate | Data/Array/Accelerate/Analysis/Match.hs | bsd-3-clause | matchPrimFun' (PrimTruncate s _) (PrimTruncate t _) = matchFloatingType s t | 83 | matchPrimFun' (PrimTruncate s _) (PrimTruncate t _) = matchFloatingType s t | 83 | matchPrimFun' (PrimTruncate s _) (PrimTruncate t _) = matchFloatingType s t | 83 | false | false | 0 | 7 | 18 | 32 | 15 | 17 | null | null |
sergv/vector | Data/Vector/Unboxed/Mutable.hs | bsd-3-clause | tail = G.tail | 13 | tail = G.tail | 13 | tail = G.tail | 13 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
guillep19/uulib | src/UU/Parsing/Derived.hs | bsd-3-clause | pList1Sep_ng :: (IsParser p s) => p a1 -> p a -> p [a]
pList1Sep_ng s p = pFoldr1Sep_ng list_alg s p | 102 | pList1Sep_ng :: (IsParser p s) => p a1 -> p a -> p [a]
pList1Sep_ng s p = pFoldr1Sep_ng list_alg s p | 102 | pList1Sep_ng s p = pFoldr1Sep_ng list_alg s p | 46 | false | true | 0 | 10 | 23 | 58 | 27 | 31 | null | null |
bitemyapp/ganeti | src/Ganeti/OpParams.hs | bsd-2-clause | pIgnoreSecondaries :: Field
pIgnoreSecondaries =
withDoc "Whether to start the instance even if secondary disks are failing" $
defaultFalse "ignore_secondaries" | 164 | pIgnoreSecondaries :: Field
pIgnoreSecondaries =
withDoc "Whether to start the instance even if secondary disks are failing" $
defaultFalse "ignore_secondaries" | 164 | pIgnoreSecondaries =
withDoc "Whether to start the instance even if secondary disks are failing" $
defaultFalse "ignore_secondaries" | 136 | false | true | 0 | 6 | 23 | 21 | 10 | 11 | null | null |
jyp/ling | Ling/Term/Checker.hs | bsd-3-clause | emptyTCEnv :: TCEnv
emptyTCEnv = TCEnv False Map.empty Map.empty Map.empty Map.empty Map.empty | 94 | emptyTCEnv :: TCEnv
emptyTCEnv = TCEnv False Map.empty Map.empty Map.empty Map.empty Map.empty | 94 | emptyTCEnv = TCEnv False Map.empty Map.empty Map.empty Map.empty Map.empty | 74 | false | true | 0 | 6 | 11 | 34 | 17 | 17 | null | null |
dmuneras/LambdaMethods | src/Interpolacion.hs | gpl-2.0 | x4 :: [Double]
x4 = [1,3,4,5] | 29 | x4 :: [Double]
x4 = [1,3,4,5] | 29 | x4 = [1,3,4,5] | 14 | false | true | 0 | 7 | 5 | 33 | 17 | 16 | null | null |
kajigor/uKanren_transformations | test/PrintingTest.hs | bsd-3-clause | showConjStack :: [[G S]] -> String
showConjStack gss = unlines $ map (\gs -> '\n' : '\n' : (unlines $ map (\g -> '\n' : (unwords $ map show $ unconj g)) gs) ) gss where
unconj (g1 :/\: g2) = unconj g1 ++ unconj g2
unconj g@(Invoke _ _) = [g]
unconj _ = error "Here could only be conjunctions" | 298 | showConjStack :: [[G S]] -> String
showConjStack gss = unlines $ map (\gs -> '\n' : '\n' : (unlines $ map (\g -> '\n' : (unwords $ map show $ unconj g)) gs) ) gss where
unconj (g1 :/\: g2) = unconj g1 ++ unconj g2
unconj g@(Invoke _ _) = [g]
unconj _ = error "Here could only be conjunctions" | 298 | showConjStack gss = unlines $ map (\gs -> '\n' : '\n' : (unlines $ map (\g -> '\n' : (unwords $ map show $ unconj g)) gs) ) gss where
unconj (g1 :/\: g2) = unconj g1 ++ unconj g2
unconj g@(Invoke _ _) = [g]
unconj _ = error "Here could only be conjunctions" | 263 | false | true | 0 | 19 | 66 | 153 | 78 | 75 | null | null |
forste/haReFork | tools/base/TC/InferenceMonad.hs | bsd-3-clause | writeVar ref value = Ck f
where f n = do { z <- writeSTRef ref value
; return (Good z, "", n)
} | 138 | writeVar ref value = Ck f
where f n = do { z <- writeSTRef ref value
; return (Good z, "", n)
} | 138 | writeVar ref value = Ck f
where f n = do { z <- writeSTRef ref value
; return (Good z, "", n)
} | 138 | false | false | 0 | 9 | 66 | 57 | 28 | 29 | null | null |
rueshyna/gogol | gogol-analytics/gen/Network/Google/Resource/Analytics/Management/WebPropertyUserLinks/List.hs | mpl-2.0 | -- | The maximum number of webProperty-user Links to include in this
-- response.
mwpullMaxResults :: Lens' ManagementWebPropertyUserLinksList (Maybe Int32)
mwpullMaxResults
= lens _mwpullMaxResults
(\ s a -> s{_mwpullMaxResults = a})
. mapping _Coerce | 266 | mwpullMaxResults :: Lens' ManagementWebPropertyUserLinksList (Maybe Int32)
mwpullMaxResults
= lens _mwpullMaxResults
(\ s a -> s{_mwpullMaxResults = a})
. mapping _Coerce | 184 | mwpullMaxResults
= lens _mwpullMaxResults
(\ s a -> s{_mwpullMaxResults = a})
. mapping _Coerce | 109 | true | true | 2 | 8 | 47 | 61 | 29 | 32 | null | null |
Peaker/lamdu | src/Lamdu/Builtins/Anchors.hs | gpl-3.0 | treeTid :: T.NominalId
treeTid = bi "tree" | 42 | treeTid :: T.NominalId
treeTid = bi "tree" | 42 | treeTid = bi "tree" | 19 | false | true | 0 | 7 | 6 | 23 | 9 | 14 | null | null |
clinty/Juicy.Pixels | src/Codec/Picture/Gif/LZW.hs | bsd-3-clause | decodeLzwTiff :: B.ByteString -> M.STVector s Word8 -> Int
-> BoolReader s()
decodeLzwTiff str outVec initialWriteIdx = do
setDecodedString str
let variant | isOldTiffLZW str = OldTiffVariant
| otherwise = TiffVariant
lzw variant 12 9 initialWriteIdx outVec | 299 | decodeLzwTiff :: B.ByteString -> M.STVector s Word8 -> Int
-> BoolReader s()
decodeLzwTiff str outVec initialWriteIdx = do
setDecodedString str
let variant | isOldTiffLZW str = OldTiffVariant
| otherwise = TiffVariant
lzw variant 12 9 initialWriteIdx outVec | 299 | decodeLzwTiff str outVec initialWriteIdx = do
setDecodedString str
let variant | isOldTiffLZW str = OldTiffVariant
| otherwise = TiffVariant
lzw variant 12 9 initialWriteIdx outVec | 208 | false | true | 0 | 13 | 78 | 93 | 41 | 52 | null | null |
flyingfisch/haskell-fischbot | App/Commands.hs | gpl-2.0 | showVars _ _ vars = do
privmsg $ show vars
return $ junkVar vars | 72 | showVars _ _ vars = do
privmsg $ show vars
return $ junkVar vars | 72 | showVars _ _ vars = do
privmsg $ show vars
return $ junkVar vars | 72 | false | false | 0 | 8 | 21 | 33 | 14 | 19 | null | null |
raventid/coursera_learning | haskell/will_kurt/10.2_fighting_robots.hs | mit | giant1 = fight killerRobot giantRobot | 37 | giant1 = fight killerRobot giantRobot | 37 | giant1 = fight killerRobot giantRobot | 37 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
cornell-pl/HsAdapton | src/Control/Concurrent/Transactional/TMVar.hs | bsd-3-clause | {- ^
A 'STxMVar' is a synchronising variable, used
for communication between concurrent threads. It can be thought of
as a box, which may be empty or full.
-}
-- |Create a 'STxMVar' which contains the supplied value.
newSTxMVar :: STxMVarK mod inc a => a -> STxM inc (STxMVar mod inc a)
newSTxMVar a = do
t <- ref (J... | 397 | newSTxMVar :: STxMVarK mod inc a => a -> STxM inc (STxMVar mod inc a)
newSTxMVar a = do
t <- ref (Just a)
return (STxMVar t)
-- |Create a 'STxMVar' which is initially empty. | 178 | newSTxMVar a = do
t <- ref (Just a)
return (STxMVar t)
-- |Create a 'STxMVar' which is initially empty. | 108 | true | true | 0 | 10 | 79 | 75 | 36 | 39 | null | null |
a143753/AOJ | 2406.hs | apache-2.0 | main = do
c <- getContents
let i = map (map read) $ map words $ lines c :: [[Int]]
o = ans i
print o | 112 | main = do
c <- getContents
let i = map (map read) $ map words $ lines c :: [[Int]]
o = ans i
print o | 112 | main = do
c <- getContents
let i = map (map read) $ map words $ lines c :: [[Int]]
o = ans i
print o | 112 | false | false | 0 | 14 | 37 | 68 | 32 | 36 | null | null |
blanu/arbre-go | Arbre/NewNative.hs | gpl-2.0 | -- FIXME
string_eq :: Native
string_eq params@(a:b:[]) = do
let x = unbox a :: Maybe String
let y = unbox b :: Maybe String
case (x,y) of
(Nothing,_) -> stringError params
(_,Nothing) -> stringError params
(Just i, Just j) -> box (i==j) | 273 | string_eq :: Native
string_eq params@(a:b:[]) = do
let x = unbox a :: Maybe String
let y = unbox b :: Maybe String
case (x,y) of
(Nothing,_) -> stringError params
(_,Nothing) -> stringError params
(Just i, Just j) -> box (i==j) | 263 | string_eq params@(a:b:[]) = do
let x = unbox a :: Maybe String
let y = unbox b :: Maybe String
case (x,y) of
(Nothing,_) -> stringError params
(_,Nothing) -> stringError params
(Just i, Just j) -> box (i==j) | 243 | true | true | 0 | 12 | 79 | 138 | 70 | 68 | null | null |
syanidar/Sophy | src/Foundation/BasicConstant.hs | bsd-3-clause | edge = 0xff818181818181ff | 44 | edge = 0xff818181818181ff | 44 | edge = 0xff818181818181ff | 44 | false | false | 1 | 5 | 21 | 10 | 3 | 7 | null | null |
diku-dk/futhark | src/Futhark/IR/Primitive.hs | isc | convOpType (SIToFP from to) = (IntType from, FloatType to) | 58 | convOpType (SIToFP from to) = (IntType from, FloatType to) | 58 | convOpType (SIToFP from to) = (IntType from, FloatType to) | 58 | false | false | 0 | 7 | 8 | 29 | 14 | 15 | null | null |
s9gf4ult/yesod | yesod-bin/Options.hs | mit | getEnvValue :: M.Map [String] String -> [String] -> OptName -> Maybe String
getEnvValue env path (OptLong l) = M.lookup (path ++ [normalizeName l]) env | 151 | getEnvValue :: M.Map [String] String -> [String] -> OptName -> Maybe String
getEnvValue env path (OptLong l) = M.lookup (path ++ [normalizeName l]) env | 151 | getEnvValue env path (OptLong l) = M.lookup (path ++ [normalizeName l]) env | 75 | false | true | 0 | 9 | 23 | 72 | 36 | 36 | null | null |
danipozodg/dependency | IntState.hs | gpl-3.0 | deps :: IntState a -> [Int]
deps (IntState _ _ ds) = ds | 55 | deps :: IntState a -> [Int]
deps (IntState _ _ ds) = ds | 55 | deps (IntState _ _ ds) = ds | 27 | false | true | 0 | 7 | 12 | 34 | 17 | 17 | null | null |
spockwangs/scheme.in.haskell | list10.hs | unlicense | unwordsList :: [LispVal] -> String
unwordsList = unwords . map show | 67 | unwordsList :: [LispVal] -> String
unwordsList = unwords . map show | 67 | unwordsList = unwords . map show | 32 | false | true | 0 | 7 | 10 | 31 | 14 | 17 | null | null |
ra1u/lambdaya-bus | src/System/RedPitaya/Bus/ClientBind.hs | lgpl-3.0 | --------------
writeCoreNice :: forall n rp . ( KnownNat n, FpgaSetGet rp)
=> SNat n -> Offset -> Vec (n * 32) Bit -> rp ()
writeCoreNice n offset d = fpgaSetArray offset (u2reg <$> vec2split n d) | 212 | writeCoreNice :: forall n rp . ( KnownNat n, FpgaSetGet rp)
=> SNat n -> Offset -> Vec (n * 32) Bit -> rp ()
writeCoreNice n offset d = fpgaSetArray offset (u2reg <$> vec2split n d) | 197 | writeCoreNice n offset d = fpgaSetArray offset (u2reg <$> vec2split n d) | 72 | true | true | 0 | 12 | 53 | 90 | 45 | 45 | null | null |
elieux/ghc | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprInstr :: Instr -> SDoc
pprInstr (COMMENT _) = empty | 55 | pprInstr :: Instr -> SDoc
pprInstr (COMMENT _) = empty | 54 | pprInstr (COMMENT _) = empty | 28 | false | true | 0 | 7 | 10 | 24 | 12 | 12 | null | null |
MoixaEnergy/blaze-react | src/Text/Blaze/Internal.hs | mit | -- | Take only the text content of an HTML tree.
--
-- > contents $ do
-- > p ! $ "Hello "
-- > p ! $ "Word!"
--
-- Result:
--
-- > Hello World!
--
contents :: MarkupM ev a -> MarkupM ev' b
contents (MapActions _ c) = contents c | 246 | contents :: MarkupM ev a -> MarkupM ev' b
contents (MapActions _ c) = contents c | 90 | contents (MapActions _ c) = contents c | 48 | true | true | 0 | 7 | 72 | 49 | 28 | 21 | null | null |
zohl/postgresql-simple-bind | src/Database/PostgreSQL/Simple/Bind/Utils.hs | bsd-3-clause | -- | Bind functions from specified text.
bindFunctionsFromText :: PostgresBindOptions -> Text -> Q [Dec]
bindFunctionsFromText opt s = either
(\err -> throwM . ParserFailed . concat $ ["In declaration `", T.unpack s, "`: ", err])
(return)
(parseOnly (pgDeclarations <* endOfInput) s)
>>= fmap concat . sequence .... | 343 | bindFunctionsFromText :: PostgresBindOptions -> Text -> Q [Dec]
bindFunctionsFromText opt s = either
(\err -> throwM . ParserFailed . concat $ ["In declaration `", T.unpack s, "`: ", err])
(return)
(parseOnly (pgDeclarations <* endOfInput) s)
>>= fmap concat . sequence . map (bindFunction opt) | 302 | bindFunctionsFromText opt s = either
(\err -> throwM . ParserFailed . concat $ ["In declaration `", T.unpack s, "`: ", err])
(return)
(parseOnly (pgDeclarations <* endOfInput) s)
>>= fmap concat . sequence . map (bindFunction opt) | 238 | true | true | 2 | 10 | 58 | 121 | 62 | 59 | null | null |
nikita-volkov/hasql | library/Hasql/Private/PTI.hs | mit | box = mkPTI LibPQ.Binary 603 (Just 1020) | 53 | box = mkPTI LibPQ.Binary 603 (Just 1020) | 53 | box = mkPTI LibPQ.Binary 603 (Just 1020) | 53 | false | false | 1 | 7 | 19 | 26 | 10 | 16 | null | null |
thinkpad20/easyjson | src/Text/EasyJson/Parser.hs | mit | pNumber :: Parser Double
pNumber = lexeme $ fmap read $ do
first <- many1 digit
option first $ do
dot <- char '.'
rest <- many1 digit
return $ first <> [dot] <> rest | 181 | pNumber :: Parser Double
pNumber = lexeme $ fmap read $ do
first <- many1 digit
option first $ do
dot <- char '.'
rest <- many1 digit
return $ first <> [dot] <> rest | 181 | pNumber = lexeme $ fmap read $ do
first <- many1 digit
option first $ do
dot <- char '.'
rest <- many1 digit
return $ first <> [dot] <> rest | 156 | false | true | 1 | 13 | 50 | 87 | 37 | 50 | null | null |
abhishekkr/tutorials_as_code | talks-articles/languages-n-runtimes/haskell/misc/prajitr.github.io--quick-haskell-syntax.hs | mit | -- | anonymous functions
-- | (\x -> x + x)
-- | (\x y -> x + y)
-- | leading with '\' then arguments delimited by space and then computation past '->
tenPlusFnPassed5 = (\x -> 10 + x) 5 | 186 | tenPlusFnPassed5 = (\x -> 10 + x) 5 | 35 | tenPlusFnPassed5 = (\x -> 10 + x) 5 | 35 | true | false | 1 | 7 | 41 | 29 | 15 | 14 | null | null |
sdiehl/ghc | compiler/coreSyn/CoreUtils.hs | bsd-3-clause | exprIsBig (Var _) = False | 30 | exprIsBig (Var _) = False | 30 | exprIsBig (Var _) = False | 30 | false | false | 0 | 7 | 9 | 15 | 7 | 8 | null | null |
TomMD/cryptol | src/Cryptol/Transform/MonoValues.hs | bsd-3-clause | notFun :: Expr -> Bool
notFun (EAbs {}) = False | 53 | notFun :: Expr -> Bool
notFun (EAbs {}) = False | 53 | notFun (EAbs {}) = False | 30 | false | true | 0 | 7 | 15 | 25 | 13 | 12 | null | null |
Erdwolf/autotool-bonn | src/Inter/IntegerServer.hs | gpl-2.0 | copy :: Integer -> IO Integer
copy x = return x | 47 | copy :: Integer -> IO Integer
copy x = return x | 47 | copy x = return x | 17 | false | true | 0 | 6 | 10 | 24 | 11 | 13 | null | null |
tippenein/hasken | executable/Main.hs | bsd-3-clause | addNew remoteDocs database = update database (HardUpdate docs')
where
docs' = fmap fromDatabaseDoc remoteDocs | 115 | addNew remoteDocs database = update database (HardUpdate docs')
where
docs' = fmap fromDatabaseDoc remoteDocs | 115 | addNew remoteDocs database = update database (HardUpdate docs')
where
docs' = fmap fromDatabaseDoc remoteDocs | 115 | false | false | 1 | 7 | 19 | 39 | 16 | 23 | null | null |
vkomenda/CoALP | lib/CoALP/Derivation.hs | lgpl-3.0 | runDerivation :: (Eq n, Hashable n) => n -> (n -> [(e, n)]) ->
(Context n e -> Gr n e -> Observ v) ->
(Maybe [Halt v], Derivation n e v)
runDerivation t f h = runState (observ0 $ h ([], 0, t, []) $ derivation d) d
where
observ0 (ObservHalt v) = return $ Just [HaltConditionMet v]
... | 483 | runDerivation :: (Eq n, Hashable n) => n -> (n -> [(e, n)]) ->
(Context n e -> Gr n e -> Observ v) ->
(Maybe [Halt v], Derivation n e v)
runDerivation t f h = runState (observ0 $ h ([], 0, t, []) $ derivation d) d
where
observ0 (ObservHalt v) = return $ Just [HaltConditionMet v]
... | 483 | runDerivation t f h = runState (observ0 $ h ([], 0, t, []) $ derivation d) d
where
observ0 (ObservHalt v) = return $ Just [HaltConditionMet v]
observ0 ObservCut = return Nothing
observ0 ObservContinue = derive
observ0 ObservBreak = return $ Just [HaltBreak]
d = initDerivation t f h | 312 | false | true | 1 | 12 | 144 | 227 | 113 | 114 | null | null |
bokesan/skred | tools/CombGen.hs | mit | genCombs :: (String, [Var], Expr) -> IO ()
genCombs s@(c, a, e@(EVar _)) = do genComb s False
genComb s True | 115 | genCombs :: (String, [Var], Expr) -> IO ()
genCombs s@(c, a, e@(EVar _)) = do genComb s False
genComb s True | 115 | genCombs s@(c, a, e@(EVar _)) = do genComb s False
genComb s True | 72 | false | true | 0 | 10 | 27 | 71 | 38 | 33 | null | null |
amosr/limp | tests/Convert.hs | mit | prop_constraints_converted :: ProgramAss -> Bool
prop_constraints_converted (ProgramAss p a)
= P.checkProgram a p
== C.checkProgram a (C.program p) | 151 | prop_constraints_converted :: ProgramAss -> Bool
prop_constraints_converted (ProgramAss p a)
= P.checkProgram a p
== C.checkProgram a (C.program p) | 151 | prop_constraints_converted (ProgramAss p a)
= P.checkProgram a p
== C.checkProgram a (C.program p) | 102 | false | true | 1 | 7 | 21 | 55 | 27 | 28 | null | null |
kustomzone/plush | src/Plush/Run/Posix/IO.hs | apache-2.0 | ignoreUnsupportedOperation :: IO a -> IO ()
ignoreUnsupportedOperation act =
catchIf ((== GHC.UnsupportedOperation) . IO.ioeGetErrorType)
(act >> return ())
(const $ return ()) | 196 | ignoreUnsupportedOperation :: IO a -> IO ()
ignoreUnsupportedOperation act =
catchIf ((== GHC.UnsupportedOperation) . IO.ioeGetErrorType)
(act >> return ())
(const $ return ()) | 196 | ignoreUnsupportedOperation act =
catchIf ((== GHC.UnsupportedOperation) . IO.ioeGetErrorType)
(act >> return ())
(const $ return ()) | 152 | false | true | 0 | 9 | 42 | 72 | 36 | 36 | null | null |
christiaanb/Idris-dev | src/IRTS/CLaSH/Show.hs | bsd-3-clause | showAType (ATInt ITChar) = "(ATInt ITChar)" | 48 | showAType (ATInt ITChar) = "(ATInt ITChar)" | 48 | showAType (ATInt ITChar) = "(ATInt ITChar)" | 48 | false | false | 0 | 7 | 10 | 15 | 7 | 8 | null | null |
hvr/hackage-mirror-tool | src/SimpleS3.hs | gpl-3.0 | s3ListObjects1 :: S3Cfg -> Connection -> ObjKey -> Maybe ObjKey -> Bool -> IO (Bool,[ObjMetaInfo])
s3ListObjects1 (s3cfg@S3Cfg {..}) c pfx marker recurse = do
now <- formatRFC1123 <$> getCurrentTime
let q = buildRequest1 $
setAWSHeaders s3cfg GET ("",qry) ("","",now) []
sendRequest c q empty... | 1,555 | s3ListObjects1 :: S3Cfg -> Connection -> ObjKey -> Maybe ObjKey -> Bool -> IO (Bool,[ObjMetaInfo])
s3ListObjects1 (s3cfg@S3Cfg {..}) c pfx marker recurse = do
now <- formatRFC1123 <$> getCurrentTime
let q = buildRequest1 $
setAWSHeaders s3cfg GET ("",qry) ("","",now) []
sendRequest c q empty... | 1,555 | s3ListObjects1 (s3cfg@S3Cfg {..}) c pfx marker recurse = do
now <- formatRFC1123 <$> getCurrentTime
let q = buildRequest1 $
setAWSHeaders s3cfg GET ("",qry) ("","",now) []
sendRequest c q emptyBody
tmp <- receiveResponse c concatHandler'
-- BC8.writeFile "debug.get.xml" tmp
lbre... | 1,456 | false | true | 50 | 10 | 445 | 393 | 213 | 180 | null | null |
reiddraper/cauterize | src/Cauterize/Specification/Types.hs | bsd-3-clause | typeName (Record { unRecord = (TRecord n _)}) = n | 49 | typeName (Record { unRecord = (TRecord n _)}) = n | 49 | typeName (Record { unRecord = (TRecord n _)}) = n | 49 | false | false | 0 | 11 | 9 | 29 | 15 | 14 | null | null |
bonnefoa/Shaker | testsuite/tests/Shaker/RegexTest.hs | isc | prop_fileListenInfoIncludeAll :: [String] -> Bool
prop_fileListenInfoIncludeAll list = processListWithRegexp list [] [".*"] == nub list | 135 | prop_fileListenInfoIncludeAll :: [String] -> Bool
prop_fileListenInfoIncludeAll list = processListWithRegexp list [] [".*"] == nub list | 135 | prop_fileListenInfoIncludeAll list = processListWithRegexp list [] [".*"] == nub list | 85 | false | true | 0 | 7 | 14 | 40 | 20 | 20 | null | null |
bgamari/text | src/Data/Text/Lazy.hs | bsd-2-clause | -- | /O(1)/ Returns the first character of a 'Text', which must be
-- non-empty. Subject to fusion.
head :: Text -> Char
head t = S.head (stream t) | 148 | head :: Text -> Char
head t = S.head (stream t) | 47 | head t = S.head (stream t) | 26 | true | true | 0 | 7 | 29 | 31 | 16 | 15 | null | null |
konn/pandoc-japanese-filters | japanese-filter.hs | gpl-2.0 | renderJapanese _ _ = error "Japanese format not supported!" | 59 | renderJapanese _ _ = error "Japanese format not supported!" | 59 | renderJapanese _ _ = error "Japanese format not supported!" | 59 | false | false | 0 | 5 | 8 | 14 | 6 | 8 | null | null |
geocurnoff/nikki | src/Game/Scene/OptimizeRenderPixmaps.hs | lgpl-3.0 | inView _ _ = True | 17 | inView _ _ = True | 17 | inView _ _ = True | 17 | false | false | 1 | 5 | 4 | 12 | 5 | 7 | null | null |
bitemyapp/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | trueDataConId = dataConWorkId trueDataCon | 42 | trueDataConId = dataConWorkId trueDataCon | 42 | trueDataConId = dataConWorkId trueDataCon | 42 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
begriffs/optparse-applicative | tests/Examples/Hello.hs | bsd-3-clause | greet :: Sample -> IO ()
greet (Sample h False) = putStrLn $ "Hello, " ++ h | 75 | greet :: Sample -> IO ()
greet (Sample h False) = putStrLn $ "Hello, " ++ h | 75 | greet (Sample h False) = putStrLn $ "Hello, " ++ h | 50 | false | true | 0 | 7 | 16 | 39 | 19 | 20 | null | null |
sdteffen/epanet-haskell | Epanet.hs | gpl-3.0 | -- See FlowUnitsType
en_MGD :: Int
en_MGD = 2 | 45 | en_MGD :: Int
en_MGD = 2 | 24 | en_MGD = 2 | 10 | true | true | 0 | 4 | 8 | 12 | 7 | 5 | null | null |
albertov/behave-hs | src/Behave.hs | bsd-3-clause | partMoisture :: Particle -> SpreadEnv -> Double
partMoisture p = (/~one) . go
where
go = case partType p of
ParticleHerb -> _seHerb
ParticleWood -> _seWood
ParticleDead ->
case partSizeClass p of
SC0 -> _seD1hr
SC1 -> _seD1hr
... | 443 | partMoisture :: Particle -> SpreadEnv -> Double
partMoisture p = (/~one) . go
where
go = case partType p of
ParticleHerb -> _seHerb
ParticleWood -> _seWood
ParticleDead ->
case partSizeClass p of
SC0 -> _seD1hr
SC1 -> _seD1hr
... | 443 | partMoisture p = (/~one) . go
where
go = case partType p of
ParticleHerb -> _seHerb
ParticleWood -> _seWood
ParticleDead ->
case partSizeClass p of
SC0 -> _seD1hr
SC1 -> _seD1hr
SC2 -> _seD10hr
SC3 ->... | 395 | false | true | 1 | 11 | 201 | 115 | 54 | 61 | null | null |
JanAhrens/yesod-oauth-demo | Settings.hs | bsd-2-clause | -- | Settings for 'widgetFile', such as which template languages to support and
-- default Hamlet settings.
widgetFileSettings :: WidgetFileSettings
widgetFileSettings = def
{ wfsHamletSettings = defaultHamletSettings
{ hamletNewlines = AlwaysNewlines
}
} | 279 | widgetFileSettings :: WidgetFileSettings
widgetFileSettings = def
{ wfsHamletSettings = defaultHamletSettings
{ hamletNewlines = AlwaysNewlines
}
} | 171 | widgetFileSettings = def
{ wfsHamletSettings = defaultHamletSettings
{ hamletNewlines = AlwaysNewlines
}
} | 130 | true | true | 0 | 8 | 56 | 29 | 18 | 11 | null | null |
Xandaros/abnf | src/Text/ABNF/Document/Parser.hs | bsd-2-clause | parseElem :: Element -> Parser [Document T.Text]
parseElem (RuleElement rule) = toList <$> parseRule rule <?> "Rule element" | 124 | parseElem :: Element -> Parser [Document T.Text]
parseElem (RuleElement rule) = toList <$> parseRule rule <?> "Rule element" | 124 | parseElem (RuleElement rule) = toList <$> parseRule rule <?> "Rule element" | 75 | false | true | 0 | 9 | 17 | 46 | 22 | 24 | null | null |
tolysz/prepare-ghcjs | spec-lts8/base/GHC/Real.hs | bsd-3-clause | fromIntegral :: (Integral a, Num b) => a -> b
fromIntegral = fromInteger . toInteger | 84 | fromIntegral :: (Integral a, Num b) => a -> b
fromIntegral = fromInteger . toInteger | 84 | fromIntegral = fromInteger . toInteger | 38 | false | true | 1 | 8 | 14 | 42 | 19 | 23 | null | null |
icyfork/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | reluctantlyTill1 p end = do
notFollowedBy2 end
x <- p
more <- reluctantlyTill p end
return $ x:more | 115 | reluctantlyTill1 p end = do
notFollowedBy2 end
x <- p
more <- reluctantlyTill p end
return $ x:more | 115 | reluctantlyTill1 p end = do
notFollowedBy2 end
x <- p
more <- reluctantlyTill p end
return $ x:more | 115 | false | false | 1 | 8 | 33 | 52 | 20 | 32 | null | null |
Concomitant/LambdaHack | GameDefinition/Content/ItemKind.hs | bsd-3-clause | scroll4 = scroll
{ ieffects = [OneOf [ Teleport 5, RefillCalm 5, RefillCalm (-5)
, InsertMove 5, Paralyze 10 ]]
} | 139 | scroll4 = scroll
{ ieffects = [OneOf [ Teleport 5, RefillCalm 5, RefillCalm (-5)
, InsertMove 5, Paralyze 10 ]]
} | 139 | scroll4 = scroll
{ ieffects = [OneOf [ Teleport 5, RefillCalm 5, RefillCalm (-5)
, InsertMove 5, Paralyze 10 ]]
} | 139 | false | false | 0 | 12 | 46 | 58 | 30 | 28 | null | null |
zchn/ethereum-analyzer | ethereum-analyzer-deps/src/Blockchain/Data/RLP.hs | apache-2.0 | int2Bytes val
| val < 0x10000000000 = map (fromIntegral . (val `shiftR`)) [32,24 .. 0] | 88 | int2Bytes val
| val < 0x10000000000 = map (fromIntegral . (val `shiftR`)) [32,24 .. 0] | 88 | int2Bytes val
| val < 0x10000000000 = map (fromIntegral . (val `shiftR`)) [32,24 .. 0] | 88 | false | false | 0 | 9 | 16 | 49 | 26 | 23 | null | null |
alphaHeavy/cabal | Cabal/Distribution/Simple/UHC.hs | bsd-3-clause | -- -----------------------------------------------------------------------------
-- Configuring
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath
-> ProgramConfiguration -> IO (Compiler, ProgramConfiguration)
configure verbosity hcPath _hcPkgPath conf = do
(_uhcProg, uhcVersion, conf') <-
req... | 686 | configure :: Verbosity -> Maybe FilePath -> Maybe FilePath
-> ProgramConfiguration -> IO (Compiler, ProgramConfiguration)
configure verbosity hcPath _hcPkgPath conf = do
(_uhcProg, uhcVersion, conf') <-
requireProgramVersion verbosity uhcProgram
(orLaterVersion (Version [1,0,2] []))
(userMaybeS... | 589 | configure verbosity hcPath _hcPkgPath conf = do
(_uhcProg, uhcVersion, conf') <-
requireProgramVersion verbosity uhcProgram
(orLaterVersion (Version [1,0,2] []))
(userMaybeSpecifyPath "uhc" hcPath conf)
let comp = Compiler {
compilerId = CompilerId UHC uhcVersion,
... | 457 | true | true | 0 | 13 | 164 | 159 | 84 | 75 | null | null |
haslab/SecreC | src/Language/SecreC/Transformation/Simplify.hs | gpl-3.0 | simplifyVariadicExpressions :: Bool -> SimplifyCont loc m [(Expression GIdentifier (Typed loc),IsVariadic)]
simplifyVariadicExpressions isExpr es = do
(ss,es') <- Utils.mapAndUnzipM (simplifyVariadicExpression isExpr) es
returnS (concat ss,concat es') | 259 | simplifyVariadicExpressions :: Bool -> SimplifyCont loc m [(Expression GIdentifier (Typed loc),IsVariadic)]
simplifyVariadicExpressions isExpr es = do
(ss,es') <- Utils.mapAndUnzipM (simplifyVariadicExpression isExpr) es
returnS (concat ss,concat es') | 259 | simplifyVariadicExpressions isExpr es = do
(ss,es') <- Utils.mapAndUnzipM (simplifyVariadicExpression isExpr) es
returnS (concat ss,concat es') | 151 | false | true | 0 | 11 | 33 | 91 | 45 | 46 | null | null |
mattias-lundell/timber-llvm | src/Env.hs | bsd-3-clause | flattenWG wg = wg { arcs = [] } | 58 | flattenWG wg = wg { arcs = [] } | 58 | flattenWG wg = wg { arcs = [] } | 58 | false | false | 0 | 7 | 35 | 19 | 10 | 9 | null | null |
yamadapc/hpack-convert | src/Hpack/Convert.hs | mit | -- * Private helpers
-- | Builds a 'Package' 'Section' from a data entity and a 'BuildInfo' entity
sectionWithBuildInfo :: a -> Cabal.BuildInfo -> Section a
sectionWithBuildInfo d Cabal.BuildInfo{..} =
Section { sectionData = d
, sectionSourceDirs = processDirs hsSourceDirs
, sectionDepende... | 1,643 | sectionWithBuildInfo :: a -> Cabal.BuildInfo -> Section a
sectionWithBuildInfo d Cabal.BuildInfo{..} =
Section { sectionData = d
, sectionSourceDirs = processDirs hsSourceDirs
, sectionDependencies = map fromDependency targetBuildDepends
, sectionDefaultExtensions = map (show . C... | 1,543 | sectionWithBuildInfo d Cabal.BuildInfo{..} =
Section { sectionData = d
, sectionSourceDirs = processDirs hsSourceDirs
, sectionDependencies = map fromDependency targetBuildDepends
, sectionDefaultExtensions = map (show . Cabal.disp)
de... | 1,485 | true | true | 0 | 15 | 670 | 283 | 156 | 127 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_PIXEL_PACK_BUFFER_ARB :: GLenum
gl_PIXEL_PACK_BUFFER_ARB = 0x88EB | 68 | gl_PIXEL_PACK_BUFFER_ARB :: GLenum
gl_PIXEL_PACK_BUFFER_ARB = 0x88EB | 68 | gl_PIXEL_PACK_BUFFER_ARB = 0x88EB | 33 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.