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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
shayan-najd/HsParser
|
Language/Haskell/Utility/FastString.hs
|
gpl-3.0
|
nilFS :: FastString
nilFS = mkFastString ""
| 43
|
nilFS :: FastString
nilFS = mkFastString ""
| 43
|
nilFS = mkFastString ""
| 23
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
input-output-hk/pos-haskell-prototype
|
lib/test/Test/Pos/Diffusion/BlockSpec.hs
|
mit
|
protocolConstants :: ProtocolConstants
protocolConstants = ProtocolConstants
{ pcK = 2
, pcVssMinTTL = minBound
, pcVssMaxTTL = maxBound
}
| 154
|
protocolConstants :: ProtocolConstants
protocolConstants = ProtocolConstants
{ pcK = 2
, pcVssMinTTL = minBound
, pcVssMaxTTL = maxBound
}
| 154
|
protocolConstants = ProtocolConstants
{ pcK = 2
, pcVssMinTTL = minBound
, pcVssMaxTTL = maxBound
}
| 115
| false
| true
| 0
| 6
| 34
| 31
| 19
| 12
| null | null |
arianvp/binary-serialise-cbor
|
Data/Binary/Serialise/CBOR/FlatTerm.hs
|
bsd-3-clause
|
validateMapN :: Loc -> Int -> Int -> [TermToken] -> Either String [TermToken]
validateMapN _ i len ts | i == len = return ts
| 128
|
validateMapN :: Loc -> Int -> Int -> [TermToken] -> Either String [TermToken]
validateMapN _ i len ts | i == len = return ts
| 128
|
validateMapN _ i len ts | i == len = return ts
| 50
| false
| true
| 0
| 10
| 28
| 60
| 29
| 31
| null | null |
alang9/deque
|
Data/Deque/NonCat.hs
|
bsd-3-clause
|
fixup2' (BigR (XR (B3 a b c) (B0)) N (TinyL (B3 (P s t) (P u v) (P w x)))) = go9 a b c s t u v w x
| 122
|
fixup2' (BigR (XR (B3 a b c) (B0)) N (TinyL (B3 (P s t) (P u v) (P w x)))) = go9 a b c s t u v w x
| 122
|
fixup2' (BigR (XR (B3 a b c) (B0)) N (TinyL (B3 (P s t) (P u v) (P w x)))) = go9 a b c s t u v w x
| 122
| false
| false
| 0
| 12
| 54
| 100
| 49
| 51
| null | null |
patrickboe/wheel
|
src/test/hs/AuthSpec.hs
|
gpl-3.0
|
jwt :: JSON
jwt = encodeSigned HS256 key claimset
where key = secret "my-secret-key"
claimset = def { iss = stringOrURI "wheel"
, aud = singleAud "wheel"
, sub = stringOrURI "me" }
| 236
|
jwt :: JSON
jwt = encodeSigned HS256 key claimset
where key = secret "my-secret-key"
claimset = def { iss = stringOrURI "wheel"
, aud = singleAud "wheel"
, sub = stringOrURI "me" }
| 236
|
jwt = encodeSigned HS256 key claimset
where key = secret "my-secret-key"
claimset = def { iss = stringOrURI "wheel"
, aud = singleAud "wheel"
, sub = stringOrURI "me" }
| 224
| false
| true
| 1
| 8
| 88
| 64
| 33
| 31
| null | null |
ambiata/highlighting-kate
|
Text/Highlighting/Kate/Syntax/Xml.hs
|
gpl-2.0
|
parseRules ("XML","Doctype Markupdecl SQ") =
(((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))
<|>
((parseRules ("XML","FindPEntityRefs")))
<|>
(currentContext >>= \x -> guard (x == ("XML","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute StringTok))
| 293
|
parseRules ("XML","Doctype Markupdecl SQ") =
(((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))
<|>
((parseRules ("XML","FindPEntityRefs")))
<|>
(currentContext >>= \x -> guard (x == ("XML","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute StringTok))
| 293
|
parseRules ("XML","Doctype Markupdecl SQ") =
(((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))
<|>
((parseRules ("XML","FindPEntityRefs")))
<|>
(currentContext >>= \x -> guard (x == ("XML","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute StringTok))
| 293
| false
| false
| 0
| 15
| 45
| 105
| 57
| 48
| null | null |
luite/selinux
|
src/System/Linux/SELinux.hs
|
bsd-3-clause
|
lsetFileConRaw = withPathCon "lsetfileConRaw" c_lsetfilecon_raw
| 68
|
lsetFileConRaw = withPathCon "lsetfileConRaw" c_lsetfilecon_raw
| 68
|
lsetFileConRaw = withPathCon "lsetfileConRaw" c_lsetfilecon_raw
| 68
| false
| false
| 1
| 5
| 9
| 15
| 5
| 10
| null | null |
kishoredbn/barrelfish
|
tools/mackerel/Attr.hs
|
mit
|
attr_can_init_from_reg RWL = True
| 33
|
attr_can_init_from_reg RWL = True
| 33
|
attr_can_init_from_reg RWL = True
| 33
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
mfpi/hnars
|
src/FingerTree.hs
|
mit
|
a |> (Deep v lf m sf) = Deep (measure a <> v) lf m (sf ++ [a])
| 62
|
a |> (Deep v lf m sf) = Deep (measure a <> v) lf m (sf ++ [a])
| 62
|
a |> (Deep v lf m sf) = Deep (measure a <> v) lf m (sf ++ [a])
| 62
| false
| false
| 0
| 8
| 17
| 56
| 27
| 29
| null | null |
liqlvnvn/zodiac-graphs-from-MongoDB-1
|
src/ToFile.hs
|
mit
|
convert2 :: [StatsInfSign] -> String
convert2 list = foldr1 (++) $ map toString
(mvNothingToTheEnd $ sortOn fst list)
where
toString :: StatsInfSign -> String
toString tpl = maybe "Nothing" show (fst tpl) ++ " "
++ (show . snd) tpl ++ "\n"
mvNothingToTheEnd :: [StatsInfSign] -> [StatsInfSign]
mvNothingToTheEnd (x:xs) = xs ++ [x]
mvNothingToTheEnd [] = []
-- | query3
| 448
|
convert2 :: [StatsInfSign] -> String
convert2 list = foldr1 (++) $ map toString
(mvNothingToTheEnd $ sortOn fst list)
where
toString :: StatsInfSign -> String
toString tpl = maybe "Nothing" show (fst tpl) ++ " "
++ (show . snd) tpl ++ "\n"
mvNothingToTheEnd :: [StatsInfSign] -> [StatsInfSign]
mvNothingToTheEnd (x:xs) = xs ++ [x]
mvNothingToTheEnd [] = []
-- | query3
| 448
|
convert2 list = foldr1 (++) $ map toString
(mvNothingToTheEnd $ sortOn fst list)
where
toString :: StatsInfSign -> String
toString tpl = maybe "Nothing" show (fst tpl) ++ " "
++ (show . snd) tpl ++ "\n"
mvNothingToTheEnd :: [StatsInfSign] -> [StatsInfSign]
mvNothingToTheEnd (x:xs) = xs ++ [x]
mvNothingToTheEnd [] = []
-- | query3
| 411
| false
| true
| 3
| 11
| 139
| 154
| 79
| 75
| null | null |
jyp/MarXup
|
MarXup/Latex.hs
|
gpl-2.0
|
newline :: TeX
newline = backslash <> backslash
| 47
|
newline :: TeX
newline = backslash <> backslash
| 47
|
newline = backslash <> backslash
| 32
| false
| true
| 0
| 5
| 7
| 15
| 8
| 7
| null | null |
ahmadsalim/micro-dsl-properties
|
src/FJ.hs
|
gpl-3.0
|
prettyExpr (Cast _ c e) = parens (text (unName c)) <> prettyExpr e
| 66
|
prettyExpr (Cast _ c e) = parens (text (unName c)) <> prettyExpr e
| 66
|
prettyExpr (Cast _ c e) = parens (text (unName c)) <> prettyExpr e
| 66
| false
| false
| 0
| 10
| 12
| 41
| 19
| 22
| null | null |
toonn/wyah
|
src/STLCPretty.hs
|
bsd-2-clause
|
parensIf :: Bool -> Doc -> Doc
parensIf True = parens
| 53
|
parensIf :: Bool -> Doc -> Doc
parensIf True = parens
| 53
|
parensIf True = parens
| 22
| false
| true
| 0
| 6
| 10
| 22
| 11
| 11
| null | null |
ocean0yohsuke/deepcontrol
|
DeepControl/Applicative.hs
|
bsd-3-clause
|
(|*----) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4, Applicative f5) => f1 (f2 (f3 (f4 (f5 (a -> b))))) -> f2 (f3 (f4 (f5 a))) -> f1 (f2 (f3 (f4 (f5 b))))
f |*---- x = f |*>>>>> (.*) x
| 208
|
(|*----) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4, Applicative f5) => f1 (f2 (f3 (f4 (f5 (a -> b))))) -> f2 (f3 (f4 (f5 a))) -> f1 (f2 (f3 (f4 (f5 b))))
f |*---- x = f |*>>>>> (.*) x
| 208
|
f |*---- x = f |*>>>>> (.*) x
| 29
| false
| true
| 0
| 18
| 41
| 151
| 76
| 75
| null | null |
facebook/Haxl
|
Haxl/Core/RequestStore.hs
|
bsd-3-clause
|
subFromCountMap
:: forall (r :: * -> *). (DataSourceName r, Typeable r)
=> Proxy r
-> Int -- type and number of requests
-> ReqCountMap
-> ReqCountMap
subFromCountMap = updateCountMap (-)
| 197
|
subFromCountMap
:: forall (r :: * -> *). (DataSourceName r, Typeable r)
=> Proxy r
-> Int -- type and number of requests
-> ReqCountMap
-> ReqCountMap
subFromCountMap = updateCountMap (-)
| 197
|
subFromCountMap = updateCountMap (-)
| 36
| false
| true
| 0
| 11
| 40
| 68
| 35
| 33
| null | null |
mettekou/ghc
|
utils/deriveConstants/Main.hs
|
bsd-3-clause
|
haskellise "" = ""
| 18
|
haskellise "" = ""
| 18
|
haskellise "" = ""
| 18
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
ocean0yohsuke/deepcontrol
|
DeepControl/Applicative.hs
|
bsd-3-clause
|
(***-->) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4, Applicative f5) => f4 (f5 a) -> f1 (f2 (f3 (f4 (f5 b)))) -> f1 (f2 (f3 (f4 (f5 b))))
a ***--> x = (.***) a *>>>>> x
| 192
|
(***-->) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4, Applicative f5) => f4 (f5 a) -> f1 (f2 (f3 (f4 (f5 b)))) -> f1 (f2 (f3 (f4 (f5 b))))
a ***--> x = (.***) a *>>>>> x
| 192
|
a ***--> x = (.***) a *>>>>> x
| 30
| false
| true
| 0
| 18
| 37
| 132
| 66
| 66
| null | null |
tamasgal/haskell_exercises
|
CIS-194/homework-01/creditcard.hs
|
mit
|
-- Add the digits of an Int
digitSum :: Integer -> Integer
digitSum x
| x < 10 = x
| otherwise = (x `mod` 10) + digitSum (x `div` 10)
| 140
|
digitSum :: Integer -> Integer
digitSum x
| x < 10 = x
| otherwise = (x `mod` 10) + digitSum (x `div` 10)
| 112
|
digitSum x
| x < 10 = x
| otherwise = (x `mod` 10) + digitSum (x `div` 10)
| 81
| true
| true
| 2
| 8
| 37
| 71
| 35
| 36
| null | null |
brendanhay/gogol
|
gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Agent/Sessions/Contexts/Patch.hs
|
mpl-2.0
|
-- | Creates a value of 'ProjectsAgentSessionsContextsPatch' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pascpXgafv'
--
-- * 'pascpUploadProtocol'
--
-- * 'pascpUpdateMask'
--
-- * 'pascpAccessToken'
--
-- * 'pascpUploadType'
--
-- * 'pascpPayload'
--
-- * 'pascpName'
--
-- * 'pascpCallback'
projectsAgentSessionsContextsPatch
:: GoogleCloudDialogflowV2Context -- ^ 'pascpPayload'
-> Text -- ^ 'pascpName'
-> ProjectsAgentSessionsContextsPatch
projectsAgentSessionsContextsPatch pPascpPayload_ pPascpName_ =
ProjectsAgentSessionsContextsPatch'
{ _pascpXgafv = Nothing
, _pascpUploadProtocol = Nothing
, _pascpUpdateMask = Nothing
, _pascpAccessToken = Nothing
, _pascpUploadType = Nothing
, _pascpPayload = pPascpPayload_
, _pascpName = pPascpName_
, _pascpCallback = Nothing
}
| 918
|
projectsAgentSessionsContextsPatch
:: GoogleCloudDialogflowV2Context -- ^ 'pascpPayload'
-> Text -- ^ 'pascpName'
-> ProjectsAgentSessionsContextsPatch
projectsAgentSessionsContextsPatch pPascpPayload_ pPascpName_ =
ProjectsAgentSessionsContextsPatch'
{ _pascpXgafv = Nothing
, _pascpUploadProtocol = Nothing
, _pascpUpdateMask = Nothing
, _pascpAccessToken = Nothing
, _pascpUploadType = Nothing
, _pascpPayload = pPascpPayload_
, _pascpName = pPascpName_
, _pascpCallback = Nothing
}
| 535
|
projectsAgentSessionsContextsPatch pPascpPayload_ pPascpName_ =
ProjectsAgentSessionsContextsPatch'
{ _pascpXgafv = Nothing
, _pascpUploadProtocol = Nothing
, _pascpUpdateMask = Nothing
, _pascpAccessToken = Nothing
, _pascpUploadType = Nothing
, _pascpPayload = pPascpPayload_
, _pascpName = pPascpName_
, _pascpCallback = Nothing
}
| 371
| true
| true
| 0
| 8
| 162
| 104
| 68
| 36
| null | null |
gridaphobe/liquid-fixpoint
|
src/Language/Fixpoint/SortCheck.hs
|
bsd-3-clause
|
generalize t
= return t
| 25
|
generalize t
= return t
| 25
|
generalize t
= return t
| 25
| false
| false
| 1
| 5
| 6
| 16
| 5
| 11
| null | null |
beni55/ghcjs
|
src/Gen2/Prim.hs
|
mit
|
genPrim _ _ MaskStatus [r] [] = PrimInline [j| `r` = h$maskStatus(); |]
| 71
|
genPrim _ _ MaskStatus [r] [] = PrimInline [j| `r` = h$maskStatus(); |]
| 71
|
genPrim _ _ MaskStatus [r] [] = PrimInline [j| `r` = h$maskStatus(); |]
| 71
| false
| false
| 0
| 6
| 12
| 29
| 16
| 13
| null | null |
forste/haReFork
|
tools/base/lib/OpTypes.hs
|
bsd-3-clause
|
cmpBy :: Ord a => (b -> a) -> CmpOp b
cmpBy f x y = f x `compare` f y
| 74
|
cmpBy :: Ord a => (b -> a) -> CmpOp b
cmpBy f x y = f x `compare` f y
| 74
|
cmpBy f x y = f x `compare` f y
| 36
| false
| true
| 0
| 8
| 25
| 55
| 26
| 29
| null | null |
wavewave/xournal-render
|
src/Graphics/Xournal/Render/BBox.hs
|
bsd-2-clause
|
cairoDrawLayerBBox :: Maybe BBox -> TLayerBBox -> Render ()
cairoDrawLayerBBox mbbox layer = do
clipBBox mbbox
let hittestbbox = case mbbox of
Nothing -> NotHitted []
:- Hitted (gstrokes layer)
:- Empty
Just bbox -> mkHitTestBBoxBBox bbox (gstrokes layer)
mapM_ drawOneStroke . map gToStroke . concatMap unHitted . getB $ hittestbbox
resetClip
| 474
|
cairoDrawLayerBBox :: Maybe BBox -> TLayerBBox -> Render ()
cairoDrawLayerBBox mbbox layer = do
clipBBox mbbox
let hittestbbox = case mbbox of
Nothing -> NotHitted []
:- Hitted (gstrokes layer)
:- Empty
Just bbox -> mkHitTestBBoxBBox bbox (gstrokes layer)
mapM_ drawOneStroke . map gToStroke . concatMap unHitted . getB $ hittestbbox
resetClip
| 473
|
cairoDrawLayerBBox mbbox layer = do
clipBBox mbbox
let hittestbbox = case mbbox of
Nothing -> NotHitted []
:- Hitted (gstrokes layer)
:- Empty
Just bbox -> mkHitTestBBoxBBox bbox (gstrokes layer)
mapM_ drawOneStroke . map gToStroke . concatMap unHitted . getB $ hittestbbox
resetClip
| 413
| false
| true
| 0
| 17
| 182
| 130
| 58
| 72
| null | null |
faylang/fay-jquery
|
src/JQuery.hs
|
bsd-3-clause
|
setTextWith :: (Double -> Text -> Fay JQuery) -> JQuery -> Fay JQuery
setTextWith = ffi "%2['text'](%1)"
| 104
|
setTextWith :: (Double -> Text -> Fay JQuery) -> JQuery -> Fay JQuery
setTextWith = ffi "%2['text'](%1)"
| 104
|
setTextWith = ffi "%2['text'](%1)"
| 34
| false
| true
| 0
| 10
| 16
| 45
| 20
| 25
| null | null |
OpenGenus/cosmos
|
code/string_algorithms/src/palindrome_checker/palindrome.hs
|
gpl-3.0
|
main = do
if palindrome "Tacocat" then
putStrLn "tacocat is a palindrome"
else
putStrLn "tacocat is not a palindrome"
if palindrome "HelLo" then
putStrLn "hello is a palindrome"
else
putStrLn "hello is not a palindrome"
| 243
|
main = do
if palindrome "Tacocat" then
putStrLn "tacocat is a palindrome"
else
putStrLn "tacocat is not a palindrome"
if palindrome "HelLo" then
putStrLn "hello is a palindrome"
else
putStrLn "hello is not a palindrome"
| 243
|
main = do
if palindrome "Tacocat" then
putStrLn "tacocat is a palindrome"
else
putStrLn "tacocat is not a palindrome"
if palindrome "HelLo" then
putStrLn "hello is a palindrome"
else
putStrLn "hello is not a palindrome"
| 243
| false
| false
| 0
| 8
| 58
| 46
| 21
| 25
| null | null |
owickstrom/GigSpider
|
src/GigSpider/Eniro.hs
|
mit
|
defaultSearchWord :: String
defaultSearchWord = "restaurang"
| 60
|
defaultSearchWord :: String
defaultSearchWord = "restaurang"
| 60
|
defaultSearchWord = "restaurang"
| 32
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
rahulmutt/ghcvm
|
libraries/base/Foreign/C/String.hs
|
bsd-3-clause
|
-- exported functions
-- ------------------
--
-- * the following routines apply the default conversion when converting the
-- C-land character encoding into the Haskell-land character encoding
-- | Marshal a NUL terminated C string into a Haskell string.
--
peekCString :: CString -> IO String
peekCString s = getForeignEncoding >>= flip GHC.peekCString s
| 362
|
peekCString :: CString -> IO String
peekCString s = getForeignEncoding >>= flip GHC.peekCString s
| 100
|
peekCString s = getForeignEncoding >>= flip GHC.peekCString s
| 61
| true
| true
| 0
| 7
| 59
| 43
| 23
| 20
| null | null |
GaloisInc/halvm-ghc
|
compiler/main/HscTypes.hs
|
bsd-3-clause
|
numToTrustInfo 1 = setSafeMode Sf_Unsafe
| 40
|
numToTrustInfo 1 = setSafeMode Sf_Unsafe
| 40
|
numToTrustInfo 1 = setSafeMode Sf_Unsafe
| 40
| false
| false
| 1
| 5
| 4
| 15
| 5
| 10
| null | null |
KuroAku/lambda
|
src/Lambda/Reducer.hs
|
gpl-3.0
|
freeVars (Abstraction x m) = filter (/= x) (freeVars m)
| 55
|
freeVars (Abstraction x m) = filter (/= x) (freeVars m)
| 55
|
freeVars (Abstraction x m) = filter (/= x) (freeVars m)
| 55
| false
| false
| 0
| 7
| 9
| 33
| 16
| 17
| null | null |
FlashKorten/recogs
|
src/Recogs.hs
|
mit
|
drawSegment :: Surface -> Dimension -> Dimension -> Coord -> IO ()
drawSegment screen blockDimension (xOffset, yOffset) (row, col) = do
let (width, height) = blockDimension
x = (col * width) + xOffset
y = (row * height) + yOffset
_ <- fillRect screen (Just (Rect x y width height)) (Pixel 0x000000)
return ()
| 365
|
drawSegment :: Surface -> Dimension -> Dimension -> Coord -> IO ()
drawSegment screen blockDimension (xOffset, yOffset) (row, col) = do
let (width, height) = blockDimension
x = (col * width) + xOffset
y = (row * height) + yOffset
_ <- fillRect screen (Just (Rect x y width height)) (Pixel 0x000000)
return ()
| 365
|
drawSegment screen blockDimension (xOffset, yOffset) (row, col) = do
let (width, height) = blockDimension
x = (col * width) + xOffset
y = (row * height) + yOffset
_ <- fillRect screen (Just (Rect x y width height)) (Pixel 0x000000)
return ()
| 298
| false
| true
| 0
| 12
| 110
| 147
| 75
| 72
| null | null |
yu-i9/HaSC
|
src/HaSC/Prim/ASTtoIntermed.hs
|
mit
|
convDecl (A_Func _ var parms body)
= do resetVars
(_, stmts) <- convStmt body
return $ IFunDecl var parms stmts
| 133
|
convDecl (A_Func _ var parms body)
= do resetVars
(_, stmts) <- convStmt body
return $ IFunDecl var parms stmts
| 133
|
convDecl (A_Func _ var parms body)
= do resetVars
(_, stmts) <- convStmt body
return $ IFunDecl var parms stmts
| 133
| false
| false
| 0
| 8
| 41
| 54
| 25
| 29
| null | null |
Javran/misc
|
vlq/src/Vlq.hs
|
mit
|
decodes :: [Word8] -> Either DecodeError [Word32]
decodes =
evalState
(runExceptT $
fix $ \next ->
mayDecodeNext >>= \case
Nothing -> pure []
Just x -> (x :) <$> next)
| 211
|
decodes :: [Word8] -> Either DecodeError [Word32]
decodes =
evalState
(runExceptT $
fix $ \next ->
mayDecodeNext >>= \case
Nothing -> pure []
Just x -> (x :) <$> next)
| 211
|
decodes =
evalState
(runExceptT $
fix $ \next ->
mayDecodeNext >>= \case
Nothing -> pure []
Just x -> (x :) <$> next)
| 161
| false
| true
| 0
| 13
| 73
| 79
| 41
| 38
| null | null |
gcampax/ghc
|
compiler/deSugar/Check.hs
|
bsd-3-clause
|
get_lit (NPat (L _ (OverLit { ol_val = HsIntegral src i})) mb _)
= Just (HsIntPrim src (mb_neg negate mb i))
| 148
|
get_lit (NPat (L _ (OverLit { ol_val = HsIntegral src i})) mb _)
= Just (HsIntPrim src (mb_neg negate mb i))
| 148
|
get_lit (NPat (L _ (OverLit { ol_val = HsIntegral src i})) mb _)
= Just (HsIntPrim src (mb_neg negate mb i))
| 148
| false
| false
| 0
| 14
| 60
| 65
| 32
| 33
| null | null |
kim/snappy-framing
|
src/Codec/Compression/Snappy/Framing.hs
|
mpl-2.0
|
decV (Done r n c) = case verify c of
Just c' -> (Right c', leftover r)
Nothing -> decV (Fail r n "verification failure")
| 169
|
decV (Done r n c) = case verify c of
Just c' -> (Right c', leftover r)
Nothing -> decV (Fail r n "verification failure")
| 169
|
decV (Done r n c) = case verify c of
Just c' -> (Right c', leftover r)
Nothing -> decV (Fail r n "verification failure")
| 169
| false
| false
| 0
| 10
| 73
| 67
| 31
| 36
| null | null |
Xophmeister/tapestry
|
Image.hs
|
mit
|
toRGB (ImageRGBA8 img) = return $ pixelMap dropTransparency img
| 64
|
toRGB (ImageRGBA8 img) = return $ pixelMap dropTransparency img
| 64
|
toRGB (ImageRGBA8 img) = return $ pixelMap dropTransparency img
| 64
| false
| false
| 0
| 6
| 9
| 25
| 11
| 14
| null | null |
rahulmutt/ghcvm
|
tests/suite/codegen/run/RecursiveFib1.hs
|
bsd-3-clause
|
fibrecursive n sum presum = fibrecursive (n-1) (sum+presum) sum
| 64
|
fibrecursive n sum presum = fibrecursive (n-1) (sum+presum) sum
| 64
|
fibrecursive n sum presum = fibrecursive (n-1) (sum+presum) sum
| 64
| false
| false
| 0
| 7
| 9
| 34
| 17
| 17
| null | null |
sighingnow/mxnet-haskell
|
mxnet/src/MXNet/Core/Base/HMap.hs
|
mit
|
nil :: HMap '[]
nil = HMap Nil
| 30
|
nil :: HMap '[]
nil = HMap Nil
| 30
|
nil = HMap Nil
| 14
| false
| true
| 0
| 8
| 7
| 26
| 11
| 15
| null | null |
gridaphobe/ghc
|
compiler/basicTypes/DataCon.hs
|
bsd-3-clause
|
-- | Should the 'DataCon' be presented infix?
dataConIsInfix :: DataCon -> Bool
dataConIsInfix = dcInfix
| 104
|
dataConIsInfix :: DataCon -> Bool
dataConIsInfix = dcInfix
| 58
|
dataConIsInfix = dcInfix
| 24
| true
| true
| 0
| 7
| 15
| 23
| 10
| 13
| null | null |
alexkyllo/xtwelve
|
src/X12/Parser.hs
|
bsd-3-clause
|
parseInterchange :: Either String ([SegmentToken], Separators) -> Either String InterchangeVal
parseInterchange (Right (segments, seps)) = case iDef of
(Just def) -> Right $ InterchangeVal def [] seps
Nothing -> Left $ "Interchange definition not found for version" ++ unpack version
where iDef = lookup version interchangeDict
version = case (elementTokens (head segments) !! 12) of (SimpleElementToken txt) -> txt
_ -> error "ISA12 must be a Simple Element"
| 621
|
parseInterchange :: Either String ([SegmentToken], Separators) -> Either String InterchangeVal
parseInterchange (Right (segments, seps)) = case iDef of
(Just def) -> Right $ InterchangeVal def [] seps
Nothing -> Left $ "Interchange definition not found for version" ++ unpack version
where iDef = lookup version interchangeDict
version = case (elementTokens (head segments) !! 12) of (SimpleElementToken txt) -> txt
_ -> error "ISA12 must be a Simple Element"
| 621
|
parseInterchange (Right (segments, seps)) = case iDef of
(Just def) -> Right $ InterchangeVal def [] seps
Nothing -> Left $ "Interchange definition not found for version" ++ unpack version
where iDef = lookup version interchangeDict
version = case (elementTokens (head segments) !! 12) of (SimpleElementToken txt) -> txt
_ -> error "ISA12 must be a Simple Element"
| 526
| false
| true
| 1
| 11
| 229
| 155
| 77
| 78
| null | null |
vTurbine/ghc
|
compiler/basicTypes/Name.hs
|
bsd-3-clause
|
isValName :: Name -> Bool
isValName name = isValOcc (nameOccName name)
| 70
|
isValName :: Name -> Bool
isValName name = isValOcc (nameOccName name)
| 70
|
isValName name = isValOcc (nameOccName name)
| 44
| false
| true
| 0
| 7
| 10
| 27
| 13
| 14
| null | null |
alphaHeavy/cabal
|
cabal-install/Distribution/Client/Dependency/Modular/Flag.hs
|
bsd-3-clause
|
showQSNBool :: QSN -> Bool -> String
showQSNBool qsn@(SN pi _f) b = showPI pi ++ ":" ++ showSBool qsn b
| 103
|
showQSNBool :: QSN -> Bool -> String
showQSNBool qsn@(SN pi _f) b = showPI pi ++ ":" ++ showSBool qsn b
| 103
|
showQSNBool qsn@(SN pi _f) b = showPI pi ++ ":" ++ showSBool qsn b
| 66
| false
| true
| 0
| 8
| 20
| 51
| 25
| 26
| null | null |
sdiehl/ghc
|
compiler/deSugar/DsUtils.hs
|
bsd-3-clause
|
mkCoreAppDs s fun arg = mkCoreApp s fun arg
| 43
|
mkCoreAppDs s fun arg = mkCoreApp s fun arg
| 43
|
mkCoreAppDs s fun arg = mkCoreApp s fun arg
| 43
| false
| false
| 1
| 5
| 8
| 27
| 9
| 18
| null | null |
bertdouglas/euler-haskell
|
001-050/27a.hs
|
mit
|
longer :: [a] -> [a] -> [a]
longer a b =
if (length a) >= (length b)
then a
else b
| 93
|
longer :: [a] -> [a] -> [a]
longer a b =
if (length a) >= (length b)
then a
else b
| 93
|
longer a b =
if (length a) >= (length b)
then a
else b
| 65
| false
| true
| 0
| 9
| 31
| 63
| 32
| 31
| null | null |
begriffs/postgrest
|
src/PostgREST/App.hs
|
mit
|
findProc :: QualifiedIdentifier -> S.Set Text -> Bool -> M.HashMap Text [ProcDescription] -> Maybe ProcDescription
findProc qi payloadKeys paramsAsSingleObject allProcs =
let procs = M.lookup (qiName qi) allProcs in
-- Handle overloaded functions case
join $ (case length <$> procs of
Just 1 -> headMay -- if it's not an overloaded function then immediatly get the ProcDescription
_ -> find (\x ->
if paramsAsSingleObject
then length (pdArgs x) == 1 -- if the arg is not of json type let the db give the err
else payloadKeys `S.isSubsetOf` S.fromList (pgaName <$> pdArgs x))
) <$> procs
| 638
|
findProc :: QualifiedIdentifier -> S.Set Text -> Bool -> M.HashMap Text [ProcDescription] -> Maybe ProcDescription
findProc qi payloadKeys paramsAsSingleObject allProcs =
let procs = M.lookup (qiName qi) allProcs in
-- Handle overloaded functions case
join $ (case length <$> procs of
Just 1 -> headMay -- if it's not an overloaded function then immediatly get the ProcDescription
_ -> find (\x ->
if paramsAsSingleObject
then length (pdArgs x) == 1 -- if the arg is not of json type let the db give the err
else payloadKeys `S.isSubsetOf` S.fromList (pgaName <$> pdArgs x))
) <$> procs
| 638
|
findProc qi payloadKeys paramsAsSingleObject allProcs =
let procs = M.lookup (qiName qi) allProcs in
-- Handle overloaded functions case
join $ (case length <$> procs of
Just 1 -> headMay -- if it's not an overloaded function then immediatly get the ProcDescription
_ -> find (\x ->
if paramsAsSingleObject
then length (pdArgs x) == 1 -- if the arg is not of json type let the db give the err
else payloadKeys `S.isSubsetOf` S.fromList (pgaName <$> pdArgs x))
) <$> procs
| 523
| false
| true
| 4
| 17
| 147
| 178
| 87
| 91
| null | null |
bartfrenk/haskell-transaction
|
src/Transaction/Types.hs
|
bsd-3-clause
|
trMonth :: Transaction -> (Integer, Int)
trMonth tr = case trDate tr of
Date day -> case toGregorian day of
(y, m, _) -> (y, m)
| 133
|
trMonth :: Transaction -> (Integer, Int)
trMonth tr = case trDate tr of
Date day -> case toGregorian day of
(y, m, _) -> (y, m)
| 133
|
trMonth tr = case trDate tr of
Date day -> case toGregorian day of
(y, m, _) -> (y, m)
| 92
| false
| true
| 1
| 9
| 31
| 69
| 36
| 33
| null | null |
seereason/cabal
|
cabal-install/Distribution/Client/InstallPlan.hs
|
bsd-3-clause
|
stateDependencyRelation (Failed _ _) (Failed _ _) = True
| 62
|
stateDependencyRelation (Failed _ _) (Failed _ _) = True
| 62
|
stateDependencyRelation (Failed _ _) (Failed _ _) = True
| 62
| false
| false
| 0
| 7
| 14
| 27
| 13
| 14
| null | null |
ghcjs/jsaddle-dom
|
src/JSDOM/Generated/Enums.hs
|
mit
|
js_WebGPUMultisampleDepthResolveFilterMin = "min"
| 49
|
js_WebGPUMultisampleDepthResolveFilterMin = "min"
| 49
|
js_WebGPUMultisampleDepthResolveFilterMin = "min"
| 49
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
reiddraper/cauterize
|
src/Cauterize/Dynamic/Pretty.hs
|
bsd-3-clause
|
prettyDetails s n (CDArray elems) =
parens ("array" <+> text n <$> indent 2 (parens $ "elems" <$> indent 2 vs))
where
vs = fillSep $ map (prettyDetails s elemsName) elems
Array { unArray = TArray { arrayRef = elemsName } } = n `lu` s
| 245
|
prettyDetails s n (CDArray elems) =
parens ("array" <+> text n <$> indent 2 (parens $ "elems" <$> indent 2 vs))
where
vs = fillSep $ map (prettyDetails s elemsName) elems
Array { unArray = TArray { arrayRef = elemsName } } = n `lu` s
| 245
|
prettyDetails s n (CDArray elems) =
parens ("array" <+> text n <$> indent 2 (parens $ "elems" <$> indent 2 vs))
where
vs = fillSep $ map (prettyDetails s elemsName) elems
Array { unArray = TArray { arrayRef = elemsName } } = n `lu` s
| 245
| false
| false
| 0
| 11
| 57
| 112
| 56
| 56
| null | null |
WraithM/haskell-opaleye
|
src/Opaleye/Internal/HaskellDB/Sql/Default.hs
|
bsd-3-clause
|
showAggrOp AggrStdDevP = "StdDevP"
| 41
|
showAggrOp AggrStdDevP = "StdDevP"
| 41
|
showAggrOp AggrStdDevP = "StdDevP"
| 41
| false
| false
| 0
| 5
| 10
| 9
| 4
| 5
| null | null |
onponomarev/ganeti
|
src/Ganeti/JQueue/LockDecls.hs
|
bsd-2-clause
|
computeLocks AllShared AllExclusive = C.staticLockSureBlockWeight
| 65
|
computeLocks AllShared AllExclusive = C.staticLockSureBlockWeight
| 65
|
computeLocks AllShared AllExclusive = C.staticLockSureBlockWeight
| 65
| false
| false
| 0
| 5
| 4
| 15
| 6
| 9
| null | null |
nevrenato/Hets_Fork
|
CommonLogic/Analysis.hs
|
gpl-2.0
|
retrieveFormulaItem :: [DIAG_FORM] -> AS_Anno.Annoted AS.BASIC_ITEMS
-> Sign.Sign -> [DIAG_FORM]
retrieveFormulaItem axs x sig =
case AS_Anno.item x of
AS.Axiom_items ax ->
List.foldl (\ xs bs -> addFormula xs bs sig) axs $ numberFormulae ax 0
| 285
|
retrieveFormulaItem :: [DIAG_FORM] -> AS_Anno.Annoted AS.BASIC_ITEMS
-> Sign.Sign -> [DIAG_FORM]
retrieveFormulaItem axs x sig =
case AS_Anno.item x of
AS.Axiom_items ax ->
List.foldl (\ xs bs -> addFormula xs bs sig) axs $ numberFormulae ax 0
| 285
|
retrieveFormulaItem axs x sig =
case AS_Anno.item x of
AS.Axiom_items ax ->
List.foldl (\ xs bs -> addFormula xs bs sig) axs $ numberFormulae ax 0
| 165
| false
| true
| 0
| 12
| 77
| 98
| 48
| 50
| null | null |
jacekszymanski/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxHL_DEFAULT_STYLE :: Int
wxHL_DEFAULT_STYLE = wxHL_CONTEXTMENU.|.wxNO_BORDER.|.wxHL_ALIGN_CENTRE
| 97
|
wxHL_DEFAULT_STYLE :: Int
wxHL_DEFAULT_STYLE = wxHL_CONTEXTMENU.|.wxNO_BORDER.|.wxHL_ALIGN_CENTRE
| 97
|
wxHL_DEFAULT_STYLE = wxHL_CONTEXTMENU.|.wxNO_BORDER.|.wxHL_ALIGN_CENTRE
| 71
| false
| true
| 0
| 6
| 5
| 19
| 10
| 9
| null | null |
kawu/lexeme-clustering
|
src/NLP/LexemeClustering.hs
|
bsd-2-clause
|
-- | Run the CM monad w.r.t. the base distribution and the Kappa parameter.
runCM :: Monad m => CMEnv -> CM m a -> m a
runCM env cm = R.runReaderT (ST.evalStateT cm M.empty) env
| 177
|
runCM :: Monad m => CMEnv -> CM m a -> m a
runCM env cm = R.runReaderT (ST.evalStateT cm M.empty) env
| 101
|
runCM env cm = R.runReaderT (ST.evalStateT cm M.empty) env
| 58
| true
| true
| 0
| 8
| 35
| 59
| 28
| 31
| null | null |
maruks/haskell-book
|
src/Chapter12_maybe.hs
|
gpl-3.0
|
integerToNat' :: Integer -> Nat
integerToNat' 0 = Zero
| 54
|
integerToNat' :: Integer -> Nat
integerToNat' 0 = Zero
| 54
|
integerToNat' 0 = Zero
| 22
| false
| true
| 0
| 5
| 8
| 18
| 9
| 9
| null | null |
pauloborba/plc
|
src/Prova2016.hs
|
cc0-1.0
|
nth 1 (x:xs) = x
| 16
|
nth 1 (x:xs) = x
| 16
|
nth 1 (x:xs) = x
| 16
| false
| false
| 0
| 7
| 4
| 18
| 9
| 9
| null | null |
Saulzar/pong
|
src/Pong3.hs
|
bsd-3-clause
|
main = playSceneGraph display background frequency $
pong (fromIntegral width, fromIntegral height)
where
display = InWindow "Pong3" (width, height) (0, 0)
background = white
frequency = 30
width = 600
height = 600
| 252
|
main = playSceneGraph display background frequency $
pong (fromIntegral width, fromIntegral height)
where
display = InWindow "Pong3" (width, height) (0, 0)
background = white
frequency = 30
width = 600
height = 600
| 252
|
main = playSceneGraph display background frequency $
pong (fromIntegral width, fromIntegral height)
where
display = InWindow "Pong3" (width, height) (0, 0)
background = white
frequency = 30
width = 600
height = 600
| 252
| false
| false
| 4
| 8
| 70
| 83
| 42
| 41
| null | null |
Botje/crystal
|
Crystal.hs
|
gpl-2.0
|
runPipeline :: Pipeline -> Expr Label -> Config -> IO (DeclExpr, [StepResult])
runPipeline pipe ast cfg = runReaderT (runWriterT (pipe ast)) cfg
| 144
|
runPipeline :: Pipeline -> Expr Label -> Config -> IO (DeclExpr, [StepResult])
runPipeline pipe ast cfg = runReaderT (runWriterT (pipe ast)) cfg
| 144
|
runPipeline pipe ast cfg = runReaderT (runWriterT (pipe ast)) cfg
| 65
| false
| true
| 0
| 11
| 21
| 67
| 32
| 35
| null | null |
Motions/motions
|
src/Bio/Motions/Common.hs
|
apache-2.0
|
position :: Lens' (Located a) Vec3
position = wrappedPosition . _Wrapping Identity
| 82
|
position :: Lens' (Located a) Vec3
position = wrappedPosition . _Wrapping Identity
| 82
|
position = wrappedPosition . _Wrapping Identity
| 47
| false
| true
| 0
| 7
| 11
| 29
| 14
| 15
| null | null |
fuchsto/drool
|
src/Drool/Utils/Conversions.hs
|
mit
|
msToFreq :: Int -> Int
msToFreq ms = round(1000.0 / fromIntegral ms)
| 68
|
msToFreq :: Int -> Int
msToFreq ms = round(1000.0 / fromIntegral ms)
| 68
|
msToFreq ms = round(1000.0 / fromIntegral ms)
| 45
| false
| true
| 0
| 8
| 11
| 31
| 15
| 16
| null | null |
haroldcarr/learn-haskell-coq-ml-etc
|
agda/course/2017-conor_mcbride_cs410/CS410-17-master/lectures/ANSIEscapes.hs
|
unlicense
|
onGrey str = onGreyEsc ++ str ++ onWhiteEsc
| 50
|
onGrey str = onGreyEsc ++ str ++ onWhiteEsc
| 50
|
onGrey str = onGreyEsc ++ str ++ onWhiteEsc
| 50
| false
| false
| 1
| 6
| 14
| 21
| 8
| 13
| null | null |
markflorisson/hpack
|
src/HPack/Monads.hs
|
bsd-3-clause
|
get :: Monad m => HPackT e s m s
get = HPackT (M.lift M.get)
| 60
|
get :: Monad m => HPackT e s m s
get = HPackT (M.lift M.get)
| 60
|
get = HPackT (M.lift M.get)
| 27
| false
| true
| 0
| 8
| 14
| 45
| 20
| 25
| null | null |
ihc/futhark
|
src/Language/Futhark/TypeChecker/Terms.hs
|
isc
|
consumption :: Names VName -> SrcLoc -> Occurence
consumption = Occurence S.empty
| 81
|
consumption :: Names VName -> SrcLoc -> Occurence
consumption = Occurence S.empty
| 81
|
consumption = Occurence S.empty
| 31
| false
| true
| 0
| 8
| 11
| 34
| 14
| 20
| null | null |
FranklinChen/monadiccp
|
Control/CP/FD/Interface.hs
|
bsd-3-clause
|
treeToModel (Try a b) = (Sugar.@||) (treeToModel a) (treeToModel b)
| 67
|
treeToModel (Try a b) = (Sugar.@||) (treeToModel a) (treeToModel b)
| 67
|
treeToModel (Try a b) = (Sugar.@||) (treeToModel a) (treeToModel b)
| 67
| false
| false
| 0
| 7
| 9
| 39
| 19
| 20
| null | null |
jtapolczai/wumpus
|
Agent/Intelligent/Affect.hs
|
apache-2.0
|
psbcEmotion :: [AgentMessage]
-> EmotionName
-> AgentState
-> AgentState
psbcEmotion ms emo as = logF trace ("[psbcEmotion: " ++ show emo ++ "] new_lvl: " ++ show new_lvl) $ as & psbc . ix emo .~ (new_lvl , filt)
where
(lvl, filt) = as ^. psbc . at emo . to (fromMaybe $ error "[psbcEmotion.lvl/fil]: Nothing")
val = {- trace ("calling with EV " ++ show emo) $ -} emotionValue ms filt
new_lvl = avg [lvl, val]
-- |Runs a stimulus through a filter and gets the resultant emotional response.
| 548
|
psbcEmotion :: [AgentMessage]
-> EmotionName
-> AgentState
-> AgentState
psbcEmotion ms emo as = logF trace ("[psbcEmotion: " ++ show emo ++ "] new_lvl: " ++ show new_lvl) $ as & psbc . ix emo .~ (new_lvl , filt)
where
(lvl, filt) = as ^. psbc . at emo . to (fromMaybe $ error "[psbcEmotion.lvl/fil]: Nothing")
val = {- trace ("calling with EV " ++ show emo) $ -} emotionValue ms filt
new_lvl = avg [lvl, val]
-- |Runs a stimulus through a filter and gets the resultant emotional response.
| 548
|
psbcEmotion ms emo as = logF trace ("[psbcEmotion: " ++ show emo ++ "] new_lvl: " ++ show new_lvl) $ as & psbc . ix emo .~ (new_lvl , filt)
where
(lvl, filt) = as ^. psbc . at emo . to (fromMaybe $ error "[psbcEmotion.lvl/fil]: Nothing")
val = {- trace ("calling with EV " ++ show emo) $ -} emotionValue ms filt
new_lvl = avg [lvl, val]
-- |Runs a stimulus through a filter and gets the resultant emotional response.
| 439
| false
| true
| 0
| 14
| 148
| 153
| 78
| 75
| null | null |
danr/hipspec
|
testsuite/prod/zeno_version/PropT39.hs
|
gpl-3.0
|
one, zero :: Nat
zero = Z
| 25
|
one, zero :: Nat
zero = Z
| 25
|
zero = Z
| 8
| false
| true
| 0
| 4
| 6
| 13
| 8
| 5
| null | null |
purcell/icfpc2015
|
src/GamePlay.hs
|
gpl-3.0
|
unitRotateAntiClockwise :: Unit -> Unit
unitRotateAntiClockwise (Unit cells pivot) = Unit (rotateAntiClockwiseAround pivot cells) pivot
| 135
|
unitRotateAntiClockwise :: Unit -> Unit
unitRotateAntiClockwise (Unit cells pivot) = Unit (rotateAntiClockwiseAround pivot cells) pivot
| 135
|
unitRotateAntiClockwise (Unit cells pivot) = Unit (rotateAntiClockwiseAround pivot cells) pivot
| 95
| false
| true
| 0
| 7
| 14
| 39
| 19
| 20
| null | null |
sdiehl/ghc
|
libraries/ghc-boot/GHC/Serialized.hs
|
bsd-3-clause
|
serializeConstr (CharConstr c) = serializeWord8 4 . serializeChar c
| 69
|
serializeConstr (CharConstr c) = serializeWord8 4 . serializeChar c
| 69
|
serializeConstr (CharConstr c) = serializeWord8 4 . serializeChar c
| 69
| false
| false
| 0
| 6
| 10
| 26
| 11
| 15
| null | null |
nikki-and-the-robots/nikki
|
src/Data/SelectTree.hs
|
lgpl-3.0
|
getLabel :: SelectTree a -> String
getLabel (Node l _ _) = l
| 60
|
getLabel :: SelectTree a -> String
getLabel (Node l _ _) = l
| 60
|
getLabel (Node l _ _) = l
| 25
| false
| true
| 0
| 6
| 12
| 35
| 16
| 19
| null | null |
goldfirere/glambda
|
src/Language/Glambda/Type.hs
|
bsd-3-clause
|
eqSTy SBoolTy SBoolTy = Just Refl
| 33
|
eqSTy SBoolTy SBoolTy = Just Refl
| 33
|
eqSTy SBoolTy SBoolTy = Just Refl
| 33
| false
| false
| 0
| 5
| 5
| 16
| 6
| 10
| null | null |
spechub/Hets
|
GUI/GtkAutomaticProofs.hs
|
gpl-2.0
|
performAutoProof :: GInfo
-- include proven Theorems in subsequent proofs
-> Bool
-- Timeout (sec)
-> Int
-- Progress bar
-> (Double -> String -> IO ())
-- selcted Prover and Comorphism
-> Finder
-- Display function for node selection box
-> ListStore FNode
-- selected nodes
-> [(Int, FNode)]
{- no return value, since results are stored by changing
FNode data -}
-> IO ()
performAutoProof gi inclThms timeout update (Finder _ pr cs i) listNodes nodes =
let count' = fromIntegral $ length nodes
c = cs !! i
in foldM_ (\ count (row, fn) -> do
postGUISync $ update (count / count') $ name fn
res <- maybe (return Nothing) (\ g_th -> do
Result ds ms <- runResultT
(do
(a, b) <- autoProofAtNode inclThms timeout [] [] g_th
(pr, c)
liftIO $ addCommandHistoryToState (intState gi)
(fst b) (Just (pr, c)) (snd b) (name fn)
(True, timeout)
return a)
maybe (fail $ showRelDiags 1 ds) (return . Just . fst) ms)
$ globalTheory $ snd $ node fn
case res of
Just gt -> postGUISync $ listStoreSetValue listNodes row
fn { results = propagateProofs (results fn) gt }
Nothing -> return ()
return $ count + 1) 0 nodes
| 1,724
|
performAutoProof :: GInfo
-- include proven Theorems in subsequent proofs
-> Bool
-- Timeout (sec)
-> Int
-- Progress bar
-> (Double -> String -> IO ())
-- selcted Prover and Comorphism
-> Finder
-- Display function for node selection box
-> ListStore FNode
-- selected nodes
-> [(Int, FNode)]
{- no return value, since results are stored by changing
FNode data -}
-> IO ()
performAutoProof gi inclThms timeout update (Finder _ pr cs i) listNodes nodes =
let count' = fromIntegral $ length nodes
c = cs !! i
in foldM_ (\ count (row, fn) -> do
postGUISync $ update (count / count') $ name fn
res <- maybe (return Nothing) (\ g_th -> do
Result ds ms <- runResultT
(do
(a, b) <- autoProofAtNode inclThms timeout [] [] g_th
(pr, c)
liftIO $ addCommandHistoryToState (intState gi)
(fst b) (Just (pr, c)) (snd b) (name fn)
(True, timeout)
return a)
maybe (fail $ showRelDiags 1 ds) (return . Just . fst) ms)
$ globalTheory $ snd $ node fn
case res of
Just gt -> postGUISync $ listStoreSetValue listNodes row
fn { results = propagateProofs (results fn) gt }
Nothing -> return ()
return $ count + 1) 0 nodes
| 1,724
|
performAutoProof gi inclThms timeout update (Finder _ pr cs i) listNodes nodes =
let count' = fromIntegral $ length nodes
c = cs !! i
in foldM_ (\ count (row, fn) -> do
postGUISync $ update (count / count') $ name fn
res <- maybe (return Nothing) (\ g_th -> do
Result ds ms <- runResultT
(do
(a, b) <- autoProofAtNode inclThms timeout [] [] g_th
(pr, c)
liftIO $ addCommandHistoryToState (intState gi)
(fst b) (Just (pr, c)) (snd b) (name fn)
(True, timeout)
return a)
maybe (fail $ showRelDiags 1 ds) (return . Just . fst) ms)
$ globalTheory $ snd $ node fn
case res of
Just gt -> postGUISync $ listStoreSetValue listNodes row
fn { results = propagateProofs (results fn) gt }
Nothing -> return ()
return $ count + 1) 0 nodes
| 1,064
| false
| true
| 0
| 27
| 826
| 451
| 224
| 227
| null | null |
timsears/species
|
Math/Combinatorics/Species/Simplify.hs
|
bsd-3-clause
|
simplSum One (One :+ g) = simplSum (N 2) g
| 61
|
simplSum One (One :+ g) = simplSum (N 2) g
| 61
|
simplSum One (One :+ g) = simplSum (N 2) g
| 61
| false
| false
| 0
| 7
| 28
| 29
| 14
| 15
| null | null |
GaloisInc/HaNS
|
src/Hans/Dns/Packet.hs
|
bsd-3-clause
|
-- Parsing ---------------------------------------------------------------------
getDNSPacket :: C.Get DNSPacket
getDNSPacket = unGet $ label "DNSPacket" $
do dnsHeader <- getDNSHeader
qdCount <- getWord16be
anCount <- getWord16be
nsCount <- getWord16be
arCount <- getWord16be
let blockOf c l m = label l (replicateM (fromIntegral c) m)
dnsQuestions <- blockOf qdCount "Questions" getQuery
dnsAnswers <- blockOf anCount "Answers" getRR
dnsAuthorityRecords <- blockOf nsCount "Authority Records" getRR
dnsAdditionalRecords <- blockOf arCount "Additional Records" getRR
return DNSPacket { .. }
-- 1 1 1 1 1 1
-- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | ID |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- |QR| Opcode |AA|TC|RD|RA| Z | RCODE |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | QDCOUNT |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | ANCOUNT |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | NSCOUNT |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | ARCOUNT |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| 1,504
|
getDNSPacket :: C.Get DNSPacket
getDNSPacket = unGet $ label "DNSPacket" $
do dnsHeader <- getDNSHeader
qdCount <- getWord16be
anCount <- getWord16be
nsCount <- getWord16be
arCount <- getWord16be
let blockOf c l m = label l (replicateM (fromIntegral c) m)
dnsQuestions <- blockOf qdCount "Questions" getQuery
dnsAnswers <- blockOf anCount "Answers" getRR
dnsAuthorityRecords <- blockOf nsCount "Authority Records" getRR
dnsAdditionalRecords <- blockOf arCount "Additional Records" getRR
return DNSPacket { .. }
-- 1 1 1 1 1 1
-- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | ID |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- |QR| Opcode |AA|TC|RD|RA| Z | RCODE |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | QDCOUNT |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | ANCOUNT |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | NSCOUNT |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | ARCOUNT |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| 1,422
|
getDNSPacket = unGet $ label "DNSPacket" $
do dnsHeader <- getDNSHeader
qdCount <- getWord16be
anCount <- getWord16be
nsCount <- getWord16be
arCount <- getWord16be
let blockOf c l m = label l (replicateM (fromIntegral c) m)
dnsQuestions <- blockOf qdCount "Questions" getQuery
dnsAnswers <- blockOf anCount "Answers" getRR
dnsAuthorityRecords <- blockOf nsCount "Authority Records" getRR
dnsAdditionalRecords <- blockOf arCount "Additional Records" getRR
return DNSPacket { .. }
-- 1 1 1 1 1 1
-- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | ID |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- |QR| Opcode |AA|TC|RD|RA| Z | RCODE |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | QDCOUNT |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | ANCOUNT |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | NSCOUNT |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-- | ARCOUNT |
-- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| 1,390
| true
| true
| 0
| 15
| 519
| 180
| 89
| 91
| null | null |
jml/graphql-api
|
src/GraphQL/Internal/Syntax/Encoder.hs
|
bsd-3-clause
|
variableDefinitions :: [AST.VariableDefinition] -> Text
variableDefinitions = parensCommas variableDefinition
| 109
|
variableDefinitions :: [AST.VariableDefinition] -> Text
variableDefinitions = parensCommas variableDefinition
| 109
|
variableDefinitions = parensCommas variableDefinition
| 53
| false
| true
| 0
| 7
| 8
| 23
| 12
| 11
| null | null |
vikraman/ghc
|
compiler/basicTypes/Id.hs
|
bsd-3-clause
|
zapIdUsedOnceInfo :: Id -> Id
zapIdUsedOnceInfo = zapInfo zapUsedOnceInfo
| 73
|
zapIdUsedOnceInfo :: Id -> Id
zapIdUsedOnceInfo = zapInfo zapUsedOnceInfo
| 73
|
zapIdUsedOnceInfo = zapInfo zapUsedOnceInfo
| 43
| false
| true
| 0
| 7
| 8
| 25
| 10
| 15
| null | null |
ribag/ganeti-experiments
|
src/Ganeti/Constants.hs
|
gpl-2.0
|
ldpNoMetaFlush :: String
ldpNoMetaFlush = "disable-meta-flush"
| 62
|
ldpNoMetaFlush :: String
ldpNoMetaFlush = "disable-meta-flush"
| 62
|
ldpNoMetaFlush = "disable-meta-flush"
| 37
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
DavidAlphaFox/yesod
|
yesod-auth/Yesod/Auth/Email.hs
|
mit
|
getForgotPasswordR :: YesodAuthEmail master => HandlerT Auth (HandlerT master IO) Html
getForgotPasswordR = forgotPasswordHandler
| 129
|
getForgotPasswordR :: YesodAuthEmail master => HandlerT Auth (HandlerT master IO) Html
getForgotPasswordR = forgotPasswordHandler
| 129
|
getForgotPasswordR = forgotPasswordHandler
| 42
| false
| true
| 0
| 8
| 13
| 33
| 16
| 17
| null | null |
AlphaMarc/WYAH
|
src/LambdaCalc/Pretty.hs
|
bsd-3-clause
|
ppexpr :: Expr -> String
ppexpr = render . ppr 0
| 48
|
ppexpr :: Expr -> String
ppexpr = render . ppr 0
| 48
|
ppexpr = render . ppr 0
| 23
| false
| true
| 0
| 7
| 10
| 28
| 12
| 16
| null | null |
dan-t/hsimport
|
tests/Main.hs
|
bsd-3-clause
|
importPosBeforeFirst :: HI.ImportDecl -> [HI.ImportDecl] -> Maybe HI.ImportPos
importPosBeforeFirst _ [] = Nothing
| 119
|
importPosBeforeFirst :: HI.ImportDecl -> [HI.ImportDecl] -> Maybe HI.ImportPos
importPosBeforeFirst _ [] = Nothing
| 119
|
importPosBeforeFirst _ [] = Nothing
| 40
| false
| true
| 0
| 9
| 17
| 43
| 20
| 23
| null | null |
ExNexu/Idris-dev
|
src/Idris/Core/TT.hs
|
bsd-3-clause
|
tnull :: T.Text -> Bool
tnull = T.null
| 38
|
tnull :: T.Text -> Bool
tnull = T.null
| 38
|
tnull = T.null
| 14
| false
| true
| 0
| 7
| 7
| 26
| 11
| 15
| null | null |
thomie/vector
|
Data/Vector/Unboxed.hs
|
bsd-3-clause
|
generate = G.generate
| 21
|
generate = G.generate
| 21
|
generate = G.generate
| 21
| false
| false
| 1
| 6
| 2
| 12
| 4
| 8
| null | null |
ktvoelker/airline
|
src/CrossMap.hs
|
gpl-3.0
|
sortPair :: (Ord a) => a -> a -> (a, a)
sortPair a b = case a > b of
True -> (b, a)
False -> (a, b)
| 104
|
sortPair :: (Ord a) => a -> a -> (a, a)
sortPair a b = case a > b of
True -> (b, a)
False -> (a, b)
| 104
|
sortPair a b = case a > b of
True -> (b, a)
False -> (a, b)
| 64
| false
| true
| 0
| 10
| 32
| 77
| 40
| 37
| null | null |
NCrashed/hjass
|
src/library/Language/Jass/CAPI/JassType.hs
|
mit
|
cVoid :: CJITModule -> Ptr CJassType -> IO CInt
cVoid _ retptr = poke retptr 0 >> return 1
| 91
|
cVoid :: CJITModule -> Ptr CJassType -> IO CInt
cVoid _ retptr = poke retptr 0 >> return 1
| 90
|
cVoid _ retptr = poke retptr 0 >> return 1
| 42
| false
| true
| 0
| 7
| 19
| 42
| 19
| 23
| null | null |
blambo/accelerate-examples
|
tests/primitives/Stencil.hs
|
bsd-3-clause
|
run2D :: String -> Int -> IO (() -> IArray.Array (Int,Int) Float, () -> Acc (Array DIM2 Float))
run2D "2D" = test_stencil2D
| 130
|
run2D :: String -> Int -> IO (() -> IArray.Array (Int,Int) Float, () -> Acc (Array DIM2 Float))
run2D "2D" = test_stencil2D
| 130
|
run2D "2D" = test_stencil2D
| 34
| false
| true
| 0
| 13
| 28
| 72
| 35
| 37
| null | null |
eltongo/unicorn
|
bindings/haskell/src/Unicorn.hs
|
gpl-2.0
|
regRead :: Reg r
=> Engine -- ^ 'Unicorn' engine handle
-> r -- ^ Register ID to read from
-> Emulator Int64 -- ^ The value read from the register on success,
-- or an 'Error' on failure
regRead uc regId = do
(err, val) <- lift $ ucRegRead uc regId
if err == ErrOk then
right val
else
left err
-------------------------------------------------------------------------------
-- Memory operations
-------------------------------------------------------------------------------
-- | Write to memory.
| 605
|
regRead :: Reg r
=> Engine -- ^ 'Unicorn' engine handle
-> r -- ^ Register ID to read from
-> Emulator Int64
regRead uc regId = do
(err, val) <- lift $ ucRegRead uc regId
if err == ErrOk then
right val
else
left err
-------------------------------------------------------------------------------
-- Memory operations
-------------------------------------------------------------------------------
-- | Write to memory.
| 497
|
regRead uc regId = do
(err, val) <- lift $ ucRegRead uc regId
if err == ErrOk then
right val
else
left err
-------------------------------------------------------------------------------
-- Memory operations
-------------------------------------------------------------------------------
-- | Write to memory.
| 339
| true
| true
| 0
| 9
| 180
| 85
| 45
| 40
| null | null |
divipp/lensref
|
src/LensRef.hs
|
bsd-3-clause
|
unitRef :: Monad' m => Ref m ()
unitRef = Ref (return (), \() -> return ())
| 75
|
unitRef :: Monad' m => Ref m ()
unitRef = Ref (return (), \() -> return ())
| 75
|
unitRef = Ref (return (), \() -> return ())
| 43
| false
| true
| 0
| 9
| 16
| 51
| 25
| 26
| null | null |
nevrenato/HetsAlloy
|
QBF/Sublogic.hs
|
gpl-2.0
|
-- Conversion functions to String
sublogicsName :: QBFSL -> String
sublogicsName f = case format f of
HornClause -> "HornClause"
PlainFormula -> "Prop"
-- Projections to sublogics
| 193
|
sublogicsName :: QBFSL -> String
sublogicsName f = case format f of
HornClause -> "HornClause"
PlainFormula -> "Prop"
-- Projections to sublogics
| 158
|
sublogicsName f = case format f of
HornClause -> "HornClause"
PlainFormula -> "Prop"
-- Projections to sublogics
| 125
| true
| true
| 0
| 7
| 40
| 39
| 20
| 19
| null | null |
holzensp/ghc
|
compiler/nativeGen/X86/Instr.hs
|
bsd-3-clause
|
getJumpDestBlockId _ = Nothing
| 46
|
getJumpDestBlockId _ = Nothing
| 46
|
getJumpDestBlockId _ = Nothing
| 46
| false
| false
| 0
| 5
| 19
| 9
| 4
| 5
| null | null |
chrisdone/haskelldb-demo
|
lib/haskelldb/test/TestCases.hs
|
bsd-3-clause
|
-- | Tests which cover generated SQL and do not require a database.
queryTests _ _ = TestList . map (\f -> f undefined undefined) $ [ testUnique1,
testUnique2,
testUnique3,
testUnique4,
testUnique5,
testUnique6,
testUnique7,
testUnique8,
testUnique9,
testUnique10,
testUnique11,
testAggr1,
testAggr2,
testAggrOrder,
testCorrectGroupBy,
testCorrectGroupByNoProjection,
testConcat,
testSubstring,
testFakeSelect,
testCopyAll,
testConcatAggr1,
testConcatAggr2,
testConcatAggr3
]
| 1,003
|
queryTests _ _ = TestList . map (\f -> f undefined undefined) $ [ testUnique1,
testUnique2,
testUnique3,
testUnique4,
testUnique5,
testUnique6,
testUnique7,
testUnique8,
testUnique9,
testUnique10,
testUnique11,
testAggr1,
testAggr2,
testAggrOrder,
testCorrectGroupBy,
testCorrectGroupByNoProjection,
testConcat,
testSubstring,
testFakeSelect,
testCopyAll,
testConcatAggr1,
testConcatAggr2,
testConcatAggr3
]
| 935
|
queryTests _ _ = TestList . map (\f -> f undefined undefined) $ [ testUnique1,
testUnique2,
testUnique3,
testUnique4,
testUnique5,
testUnique6,
testUnique7,
testUnique8,
testUnique9,
testUnique10,
testUnique11,
testAggr1,
testAggr2,
testAggrOrder,
testCorrectGroupBy,
testCorrectGroupByNoProjection,
testConcat,
testSubstring,
testFakeSelect,
testCopyAll,
testConcatAggr1,
testConcatAggr2,
testConcatAggr3
]
| 935
| true
| false
| 0
| 10
| 578
| 105
| 64
| 41
| null | null |
adunning/pandoc-citeproc
|
src/Text/CSL/Output/Pandoc.hs
|
bsd-3-clause
|
flipFlop' st (Strikeout ils) =
Strikeout $ map (flipFlop' st) ils
| 67
|
flipFlop' st (Strikeout ils) =
Strikeout $ map (flipFlop' st) ils
| 67
|
flipFlop' st (Strikeout ils) =
Strikeout $ map (flipFlop' st) ils
| 67
| false
| false
| 2
| 7
| 12
| 36
| 15
| 21
| null | null |
romanb/amazonka
|
amazonka-config/gen/Network/AWS/Config/Types.hs
|
mpl-2.0
|
-- | The 12 digit AWS account ID associated with the resource.
ciAccountId :: Lens' ConfigurationItem (Maybe Text)
ciAccountId = lens _ciAccountId (\s a -> s { _ciAccountId = a })
| 179
|
ciAccountId :: Lens' ConfigurationItem (Maybe Text)
ciAccountId = lens _ciAccountId (\s a -> s { _ciAccountId = a })
| 116
|
ciAccountId = lens _ciAccountId (\s a -> s { _ciAccountId = a })
| 64
| true
| true
| 1
| 9
| 30
| 49
| 25
| 24
| null | null |
tokiwoousaka/ttask
|
src/Data/TTask/File/Compatibility.hs
|
bsd-3-clause
|
tryFromMaybe :: String -> Maybe Project -> TryConvert ()
tryFromMaybe msg (Just x) = do
liftIO $ putStrLn msg
left x
| 120
|
tryFromMaybe :: String -> Maybe Project -> TryConvert ()
tryFromMaybe msg (Just x) = do
liftIO $ putStrLn msg
left x
| 120
|
tryFromMaybe msg (Just x) = do
liftIO $ putStrLn msg
left x
| 63
| false
| true
| 0
| 8
| 24
| 54
| 24
| 30
| null | null |
NicolasDP/hs-smtp
|
Network/SMTP/Parser.hs
|
bsd-3-clause
|
parseResponseInterLine :: Parser ByteString
parseResponseInterLine = do
_ <- parseResponseCode
_ <- char '-'
bs <- parserTakeWhile ((/=) '\r')
parseCRLF
return bs
| 184
|
parseResponseInterLine :: Parser ByteString
parseResponseInterLine = do
_ <- parseResponseCode
_ <- char '-'
bs <- parserTakeWhile ((/=) '\r')
parseCRLF
return bs
| 184
|
parseResponseInterLine = do
_ <- parseResponseCode
_ <- char '-'
bs <- parserTakeWhile ((/=) '\r')
parseCRLF
return bs
| 140
| false
| true
| 0
| 10
| 43
| 58
| 26
| 32
| null | null |
danr/hipspec
|
testsuite/prod/zeno_version/PropT22.hs
|
gpl-3.0
|
subset :: [Nat] -> [Nat] -> Bool
subset [] ys = True
| 52
|
subset :: [Nat] -> [Nat] -> Bool
subset [] ys = True
| 52
|
subset [] ys = True
| 19
| false
| true
| 0
| 7
| 11
| 32
| 17
| 15
| null | null |
ecaustin/haskhol-math
|
src/HaskHOL/Lib/Nums.hs
|
bsd-2-clause
|
defIND_SUC :: NumsCtxt thry => HOL cls thry HOLThm
defIND_SUC = Base.defIND_SUC
| 79
|
defIND_SUC :: NumsCtxt thry => HOL cls thry HOLThm
defIND_SUC = Base.defIND_SUC
| 79
|
defIND_SUC = Base.defIND_SUC
| 28
| false
| true
| 0
| 7
| 11
| 33
| 14
| 19
| null | null |
nomeata/ghc
|
compiler/cmm/OldCmmUtils.hs
|
bsd-3-clause
|
oneStmt :: CmmStmt -> CmmStmts
oneStmt = unitOL
| 47
|
oneStmt :: CmmStmt -> CmmStmts
oneStmt = unitOL
| 47
|
oneStmt = unitOL
| 16
| false
| true
| 0
| 5
| 7
| 15
| 8
| 7
| null | null |
romanb/amazonka
|
amazonka-ec2/gen/Network/AWS/EC2/DescribeVolumeStatus.hs
|
mpl-2.0
|
-- | 'DescribeVolumeStatusResponse' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'dvsrNextToken' @::@ 'Maybe' 'Text'
--
-- * 'dvsrVolumeStatuses' @::@ ['VolumeStatusItem']
--
describeVolumeStatusResponse :: DescribeVolumeStatusResponse
describeVolumeStatusResponse = DescribeVolumeStatusResponse
{ _dvsrVolumeStatuses = mempty
, _dvsrNextToken = Nothing
}
| 410
|
describeVolumeStatusResponse :: DescribeVolumeStatusResponse
describeVolumeStatusResponse = DescribeVolumeStatusResponse
{ _dvsrVolumeStatuses = mempty
, _dvsrNextToken = Nothing
}
| 197
|
describeVolumeStatusResponse = DescribeVolumeStatusResponse
{ _dvsrVolumeStatuses = mempty
, _dvsrNextToken = Nothing
}
| 136
| true
| true
| 0
| 7
| 58
| 37
| 24
| 13
| null | null |
mcmaniac/ghc
|
compiler/cmm/CmmNode.hs
|
bsd-3-clause
|
wrapRecExpf f e@(CmmLoad addr _) z = wrapRecExpf f addr (f e z)
| 63
|
wrapRecExpf f e@(CmmLoad addr _) z = wrapRecExpf f addr (f e z)
| 63
|
wrapRecExpf f e@(CmmLoad addr _) z = wrapRecExpf f addr (f e z)
| 63
| false
| false
| 1
| 8
| 12
| 44
| 19
| 25
| null | null |
Heather/stack
|
src/Stack/Ghci.hs
|
bsd-3-clause
|
ghciSetup
:: (HasHttpManager r, HasBuildConfig r, MonadMask m, HasTerminal r, HasLogLevel r, HasEnvConfig r, MonadReader r m, MonadIO m, MonadLogger m, MonadBaseUnlift IO m)
=> GhciOpts
-> m (Map PackageName SimpleTarget, Maybe (Map PackageName SimpleTarget), [GhciPkgInfo])
ghciSetup GhciOpts{..} = do
(_,_,targets) <- parseTargetsFromBuildOpts AllowNoTargets ghciBuildOptsCLI
mainIsTargets <-
case ghciMainIs of
Nothing -> return Nothing
Just target -> do
(_,_,targets') <- parseTargetsFromBuildOpts AllowNoTargets ghciBuildOptsCLI { boptsCLITargets = [target] }
return (Just targets')
addPkgs <- forM ghciAdditionalPackages $ \name -> do
let mres = (packageIdentifierName <$> parsePackageIdentifierFromString name)
<|> parsePackageNameFromString name
maybe (throwM $ InvalidPackageOption name) return mres
let boptsCli = ghciBuildOptsCLI
{ boptsCLITargets = boptsCLITargets ghciBuildOptsCLI ++ map T.pack ghciAdditionalPackages
}
(realTargets,_,_,_,sourceMap) <- loadSourceMap AllowNoTargets boptsCli
-- Try to build, but optimistically launch GHCi anyway if it fails (#1065)
when (not ghciNoBuild && not (M.null realTargets)) $ do
eres <- tryAny $ build (const (return ())) Nothing boptsCli
case eres of
Right () -> return ()
Left err -> do
$logError $ T.pack (show err)
$logWarn "Warning: build failed, but optimistically launching GHCi anyway"
menv <- getMinimalEnvOverride
(installedMap, _, _, _) <- getInstalled
menv
GetInstalledOpts
{ getInstalledProfiling = False
, getInstalledHaddock = False
}
sourceMap
econfig <- asks getEnvConfig
directlyWanted <-
forMaybeM (M.toList (envConfigPackages econfig)) $
\(dir,treatLikeExtraDep) ->
do cabalfp <- findOrGenerateCabalFile dir
name <- parsePackageNameFromFilePath cabalfp
if treatLikeExtraDep
then return Nothing
else case M.lookup name targets of
Just simpleTargets ->
return (Just (name, (cabalfp, simpleTargets)))
Nothing -> return Nothing
let extraLoadDeps = getExtraLoadDeps ghciLoadLocalDeps sourceMap directlyWanted
wanted <-
if (ghciSkipIntermediate && not ghciLoadLocalDeps) || null extraLoadDeps
then return directlyWanted
else do
let extraList = T.intercalate ", " (map (packageNameText . fst) extraLoadDeps)
if ghciLoadLocalDeps
then $logInfo $ T.concat
[ "The following libraries will also be loaded into GHCi because "
, "they are local dependencies of your targets, and you specified --load-local-deps:\n "
, extraList
]
else $logInfo $ T.concat
[ "The following libraries will also be loaded into GHCi because "
, "they are intermediate dependencies of your targets:\n "
, extraList
, "\n(Use --skip-intermediate-deps to omit these)"
]
return (directlyWanted ++ extraLoadDeps)
-- Load the list of modules _after_ building, to catch changes in unlisted dependencies (#1180)
let localLibs = [name | (name, (_, target)) <- wanted, hasLocalComp isCLib target]
infos <-
forM wanted $
\(name,(cabalfp,target)) ->
makeGhciPkgInfo boptsCli sourceMap installedMap localLibs addPkgs name cabalfp target
checkForIssues infos
return (realTargets, mainIsTargets, infos)
where
hasLocalComp p t =
case t of
STLocalComps s -> any p (S.toList s)
STLocalAll -> True
_ -> False
-- | Make information necessary to load the given package in GHCi.
| 4,150
|
ghciSetup
:: (HasHttpManager r, HasBuildConfig r, MonadMask m, HasTerminal r, HasLogLevel r, HasEnvConfig r, MonadReader r m, MonadIO m, MonadLogger m, MonadBaseUnlift IO m)
=> GhciOpts
-> m (Map PackageName SimpleTarget, Maybe (Map PackageName SimpleTarget), [GhciPkgInfo])
ghciSetup GhciOpts{..} = do
(_,_,targets) <- parseTargetsFromBuildOpts AllowNoTargets ghciBuildOptsCLI
mainIsTargets <-
case ghciMainIs of
Nothing -> return Nothing
Just target -> do
(_,_,targets') <- parseTargetsFromBuildOpts AllowNoTargets ghciBuildOptsCLI { boptsCLITargets = [target] }
return (Just targets')
addPkgs <- forM ghciAdditionalPackages $ \name -> do
let mres = (packageIdentifierName <$> parsePackageIdentifierFromString name)
<|> parsePackageNameFromString name
maybe (throwM $ InvalidPackageOption name) return mres
let boptsCli = ghciBuildOptsCLI
{ boptsCLITargets = boptsCLITargets ghciBuildOptsCLI ++ map T.pack ghciAdditionalPackages
}
(realTargets,_,_,_,sourceMap) <- loadSourceMap AllowNoTargets boptsCli
-- Try to build, but optimistically launch GHCi anyway if it fails (#1065)
when (not ghciNoBuild && not (M.null realTargets)) $ do
eres <- tryAny $ build (const (return ())) Nothing boptsCli
case eres of
Right () -> return ()
Left err -> do
$logError $ T.pack (show err)
$logWarn "Warning: build failed, but optimistically launching GHCi anyway"
menv <- getMinimalEnvOverride
(installedMap, _, _, _) <- getInstalled
menv
GetInstalledOpts
{ getInstalledProfiling = False
, getInstalledHaddock = False
}
sourceMap
econfig <- asks getEnvConfig
directlyWanted <-
forMaybeM (M.toList (envConfigPackages econfig)) $
\(dir,treatLikeExtraDep) ->
do cabalfp <- findOrGenerateCabalFile dir
name <- parsePackageNameFromFilePath cabalfp
if treatLikeExtraDep
then return Nothing
else case M.lookup name targets of
Just simpleTargets ->
return (Just (name, (cabalfp, simpleTargets)))
Nothing -> return Nothing
let extraLoadDeps = getExtraLoadDeps ghciLoadLocalDeps sourceMap directlyWanted
wanted <-
if (ghciSkipIntermediate && not ghciLoadLocalDeps) || null extraLoadDeps
then return directlyWanted
else do
let extraList = T.intercalate ", " (map (packageNameText . fst) extraLoadDeps)
if ghciLoadLocalDeps
then $logInfo $ T.concat
[ "The following libraries will also be loaded into GHCi because "
, "they are local dependencies of your targets, and you specified --load-local-deps:\n "
, extraList
]
else $logInfo $ T.concat
[ "The following libraries will also be loaded into GHCi because "
, "they are intermediate dependencies of your targets:\n "
, extraList
, "\n(Use --skip-intermediate-deps to omit these)"
]
return (directlyWanted ++ extraLoadDeps)
-- Load the list of modules _after_ building, to catch changes in unlisted dependencies (#1180)
let localLibs = [name | (name, (_, target)) <- wanted, hasLocalComp isCLib target]
infos <-
forM wanted $
\(name,(cabalfp,target)) ->
makeGhciPkgInfo boptsCli sourceMap installedMap localLibs addPkgs name cabalfp target
checkForIssues infos
return (realTargets, mainIsTargets, infos)
where
hasLocalComp p t =
case t of
STLocalComps s -> any p (S.toList s)
STLocalAll -> True
_ -> False
-- | Make information necessary to load the given package in GHCi.
| 4,150
|
ghciSetup GhciOpts{..} = do
(_,_,targets) <- parseTargetsFromBuildOpts AllowNoTargets ghciBuildOptsCLI
mainIsTargets <-
case ghciMainIs of
Nothing -> return Nothing
Just target -> do
(_,_,targets') <- parseTargetsFromBuildOpts AllowNoTargets ghciBuildOptsCLI { boptsCLITargets = [target] }
return (Just targets')
addPkgs <- forM ghciAdditionalPackages $ \name -> do
let mres = (packageIdentifierName <$> parsePackageIdentifierFromString name)
<|> parsePackageNameFromString name
maybe (throwM $ InvalidPackageOption name) return mres
let boptsCli = ghciBuildOptsCLI
{ boptsCLITargets = boptsCLITargets ghciBuildOptsCLI ++ map T.pack ghciAdditionalPackages
}
(realTargets,_,_,_,sourceMap) <- loadSourceMap AllowNoTargets boptsCli
-- Try to build, but optimistically launch GHCi anyway if it fails (#1065)
when (not ghciNoBuild && not (M.null realTargets)) $ do
eres <- tryAny $ build (const (return ())) Nothing boptsCli
case eres of
Right () -> return ()
Left err -> do
$logError $ T.pack (show err)
$logWarn "Warning: build failed, but optimistically launching GHCi anyway"
menv <- getMinimalEnvOverride
(installedMap, _, _, _) <- getInstalled
menv
GetInstalledOpts
{ getInstalledProfiling = False
, getInstalledHaddock = False
}
sourceMap
econfig <- asks getEnvConfig
directlyWanted <-
forMaybeM (M.toList (envConfigPackages econfig)) $
\(dir,treatLikeExtraDep) ->
do cabalfp <- findOrGenerateCabalFile dir
name <- parsePackageNameFromFilePath cabalfp
if treatLikeExtraDep
then return Nothing
else case M.lookup name targets of
Just simpleTargets ->
return (Just (name, (cabalfp, simpleTargets)))
Nothing -> return Nothing
let extraLoadDeps = getExtraLoadDeps ghciLoadLocalDeps sourceMap directlyWanted
wanted <-
if (ghciSkipIntermediate && not ghciLoadLocalDeps) || null extraLoadDeps
then return directlyWanted
else do
let extraList = T.intercalate ", " (map (packageNameText . fst) extraLoadDeps)
if ghciLoadLocalDeps
then $logInfo $ T.concat
[ "The following libraries will also be loaded into GHCi because "
, "they are local dependencies of your targets, and you specified --load-local-deps:\n "
, extraList
]
else $logInfo $ T.concat
[ "The following libraries will also be loaded into GHCi because "
, "they are intermediate dependencies of your targets:\n "
, extraList
, "\n(Use --skip-intermediate-deps to omit these)"
]
return (directlyWanted ++ extraLoadDeps)
-- Load the list of modules _after_ building, to catch changes in unlisted dependencies (#1180)
let localLibs = [name | (name, (_, target)) <- wanted, hasLocalComp isCLib target]
infos <-
forM wanted $
\(name,(cabalfp,target)) ->
makeGhciPkgInfo boptsCli sourceMap installedMap localLibs addPkgs name cabalfp target
checkForIssues infos
return (realTargets, mainIsTargets, infos)
where
hasLocalComp p t =
case t of
STLocalComps s -> any p (S.toList s)
STLocalAll -> True
_ -> False
-- | Make information necessary to load the given package in GHCi.
| 3,863
| false
| true
| 26
| 15
| 1,378
| 896
| 467
| 429
| null | null |
dbp/snaplet-wordpress
|
spec/Main.hs
|
bsd-3-clause
|
mockedTests :: Spec
mockedTests = do
Misc.tests
larcenyFillTests
wpPostsAggregateTests
wpCustomAggregateTests
cacheTests
queryTests
feedTests
| 155
|
mockedTests :: Spec
mockedTests = do
Misc.tests
larcenyFillTests
wpPostsAggregateTests
wpCustomAggregateTests
cacheTests
queryTests
feedTests
| 155
|
mockedTests = do
Misc.tests
larcenyFillTests
wpPostsAggregateTests
wpCustomAggregateTests
cacheTests
queryTests
feedTests
| 135
| false
| true
| 0
| 7
| 26
| 34
| 14
| 20
| null | null |
japaric/eulermark
|
problems/0/1/7/017.hs
|
mit
|
wordify 6 = length "six"
| 24
|
wordify 6 = length "six"
| 24
|
wordify 6 = length "six"
| 24
| false
| false
| 1
| 5
| 4
| 15
| 5
| 10
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.