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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ambiata/highlighting-kate
|
Text/Highlighting/Kate/Syntax/D.hs
|
gpl-2.0
|
parseRules ("D","StartingLetter") =
(((pDetectSpaces >>= withAttribute NormalTok))
<|>
((lookAhead (pRegExpr regex_'5b'5ea'2dzA'2dZ'5f'5d) >> (popContext) >> currentContext >>= parseRules))
<|>
((pRegExpr regex_in'5cs'2a'28'3f'3d'5c'7b'29 >>= withAttribute KeywordTok))
<|>
((pRegExpr regex_out'5cs'2a'28'3f'3d'28'5c'28'28'5ba'2dzA'2dZ'5f'5d'5b'5cw'5f'5d'2a'29'3f'5c'29'5cs'2a'29'3f'5c'7b'29 >>= withAttribute KeywordTok))
<|>
((pRegExpr regex_scope'5cs'2a'28'3f'3d'5c'28'29 >>= withAttribute KeywordTok) >>~ pushContext ("D","Scope"))
<|>
((pRegExpr regex_import'5cs'2a'28'3f'3d'5c'28'29 >>= withAttribute KeywordTok))
<|>
((pRegExpr regex_function'5cs'2a'28'3f'3d'5c'28'29 >>= withAttribute KeywordTok))
<|>
((pRegExpr regex_delegate'5cs'2a'28'3f'3d'5c'28'29 >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_statements >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_attributes >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_expressions >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_declarators >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_templates >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_modules >>= withAttribute KeywordTok) >>~ pushContext ("D","ModuleName"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_types >>= withAttribute DataTypeTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_libsymbols >>= withAttribute DataTypeTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_linkage >>= withAttribute KeywordTok) >>~ pushContext ("D","Linkage"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_specialtokens >>= withAttribute NormalTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_tests >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_pragma >>= withAttribute KeywordTok) >>~ pushContext ("D","Pragma"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_version >>= withAttribute KeywordTok) >>~ pushContext ("D","Version"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_deprecated >>= withAttribute KeywordTok))
<|>
((pDetect2Chars False 'r' '"' >>= withAttribute StringTok) >>~ pushContext ("D","RawString"))
<|>
((pDetect2Chars False 'x' '"' >>= withAttribute StringTok) >>~ pushContext ("D","HexString"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_userkeywords >>= withAttribute DataTypeTok))
<|>
((pDetectIdentifier >>= withAttribute NormalTok))
<|>
(currentContext >>= \x -> guard (x == ("D","StartingLetter")) >> pDefault >>= withAttribute NormalTok))
| 2,862
|
parseRules ("D","StartingLetter") =
(((pDetectSpaces >>= withAttribute NormalTok))
<|>
((lookAhead (pRegExpr regex_'5b'5ea'2dzA'2dZ'5f'5d) >> (popContext) >> currentContext >>= parseRules))
<|>
((pRegExpr regex_in'5cs'2a'28'3f'3d'5c'7b'29 >>= withAttribute KeywordTok))
<|>
((pRegExpr regex_out'5cs'2a'28'3f'3d'28'5c'28'28'5ba'2dzA'2dZ'5f'5d'5b'5cw'5f'5d'2a'29'3f'5c'29'5cs'2a'29'3f'5c'7b'29 >>= withAttribute KeywordTok))
<|>
((pRegExpr regex_scope'5cs'2a'28'3f'3d'5c'28'29 >>= withAttribute KeywordTok) >>~ pushContext ("D","Scope"))
<|>
((pRegExpr regex_import'5cs'2a'28'3f'3d'5c'28'29 >>= withAttribute KeywordTok))
<|>
((pRegExpr regex_function'5cs'2a'28'3f'3d'5c'28'29 >>= withAttribute KeywordTok))
<|>
((pRegExpr regex_delegate'5cs'2a'28'3f'3d'5c'28'29 >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_statements >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_attributes >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_expressions >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_declarators >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_templates >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_modules >>= withAttribute KeywordTok) >>~ pushContext ("D","ModuleName"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_types >>= withAttribute DataTypeTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_libsymbols >>= withAttribute DataTypeTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_linkage >>= withAttribute KeywordTok) >>~ pushContext ("D","Linkage"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_specialtokens >>= withAttribute NormalTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_tests >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_pragma >>= withAttribute KeywordTok) >>~ pushContext ("D","Pragma"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_version >>= withAttribute KeywordTok) >>~ pushContext ("D","Version"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_deprecated >>= withAttribute KeywordTok))
<|>
((pDetect2Chars False 'r' '"' >>= withAttribute StringTok) >>~ pushContext ("D","RawString"))
<|>
((pDetect2Chars False 'x' '"' >>= withAttribute StringTok) >>~ pushContext ("D","HexString"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_userkeywords >>= withAttribute DataTypeTok))
<|>
((pDetectIdentifier >>= withAttribute NormalTok))
<|>
(currentContext >>= \x -> guard (x == ("D","StartingLetter")) >> pDefault >>= withAttribute NormalTok))
| 2,862
|
parseRules ("D","StartingLetter") =
(((pDetectSpaces >>= withAttribute NormalTok))
<|>
((lookAhead (pRegExpr regex_'5b'5ea'2dzA'2dZ'5f'5d) >> (popContext) >> currentContext >>= parseRules))
<|>
((pRegExpr regex_in'5cs'2a'28'3f'3d'5c'7b'29 >>= withAttribute KeywordTok))
<|>
((pRegExpr regex_out'5cs'2a'28'3f'3d'28'5c'28'28'5ba'2dzA'2dZ'5f'5d'5b'5cw'5f'5d'2a'29'3f'5c'29'5cs'2a'29'3f'5c'7b'29 >>= withAttribute KeywordTok))
<|>
((pRegExpr regex_scope'5cs'2a'28'3f'3d'5c'28'29 >>= withAttribute KeywordTok) >>~ pushContext ("D","Scope"))
<|>
((pRegExpr regex_import'5cs'2a'28'3f'3d'5c'28'29 >>= withAttribute KeywordTok))
<|>
((pRegExpr regex_function'5cs'2a'28'3f'3d'5c'28'29 >>= withAttribute KeywordTok))
<|>
((pRegExpr regex_delegate'5cs'2a'28'3f'3d'5c'28'29 >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_statements >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_attributes >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_expressions >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_declarators >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_templates >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_modules >>= withAttribute KeywordTok) >>~ pushContext ("D","ModuleName"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_types >>= withAttribute DataTypeTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_libsymbols >>= withAttribute DataTypeTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_linkage >>= withAttribute KeywordTok) >>~ pushContext ("D","Linkage"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_specialtokens >>= withAttribute NormalTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_tests >>= withAttribute KeywordTok))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_pragma >>= withAttribute KeywordTok) >>~ pushContext ("D","Pragma"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_version >>= withAttribute KeywordTok) >>~ pushContext ("D","Version"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_deprecated >>= withAttribute KeywordTok))
<|>
((pDetect2Chars False 'r' '"' >>= withAttribute StringTok) >>~ pushContext ("D","RawString"))
<|>
((pDetect2Chars False 'x' '"' >>= withAttribute StringTok) >>~ pushContext ("D","HexString"))
<|>
((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_userkeywords >>= withAttribute DataTypeTok))
<|>
((pDetectIdentifier >>= withAttribute NormalTok))
<|>
(currentContext >>= \x -> guard (x == ("D","StartingLetter")) >> pDefault >>= withAttribute NormalTok))
| 2,862
| false
| false
| 0
| 39
| 386
| 714
| 365
| 349
| null | null |
MauriceIsAG/HaskellScratch
|
.stack-work/intero/intero1846heo.hs
|
bsd-3-clause
|
dropEvery s n = foldr (++) [] (map (f n) (zip [1..] s))
where f n (m, x)
| m `mod` n == 0 = []
| otherwise = [x]
| 134
|
dropEvery s n = foldr (++) [] (map (f n) (zip [1..] s))
where f n (m, x)
| m `mod` n == 0 = []
| otherwise = [x]
| 134
|
dropEvery s n = foldr (++) [] (map (f n) (zip [1..] s))
where f n (m, x)
| m `mod` n == 0 = []
| otherwise = [x]
| 134
| false
| false
| 0
| 10
| 51
| 95
| 49
| 46
| null | null |
craigem/RealWorldHaskell
|
ch03/BookStore.hs
|
gpl-3.0
|
bookAuthors (Book id title authors) = authors
| 45
|
bookAuthors (Book id title authors) = authors
| 45
|
bookAuthors (Book id title authors) = authors
| 45
| false
| false
| 0
| 7
| 6
| 19
| 9
| 10
| null | null |
bmmoore/logic
|
Logic/Orders.hs
|
bsd-3-clause
|
-- assumes same length
lexico :: (Monoid c) => (a -> b -> c) -> ([a] -> [b] -> c)
lexico o l1 l2 = mconcat (zipWith o l1 l2)
| 124
|
lexico :: (Monoid c) => (a -> b -> c) -> ([a] -> [b] -> c)
lexico o l1 l2 = mconcat (zipWith o l1 l2)
| 101
|
lexico o l1 l2 = mconcat (zipWith o l1 l2)
| 42
| true
| true
| 0
| 10
| 29
| 73
| 39
| 34
| null | null |
tjakway/ghcjvm
|
compiler/utils/FastString.hs
|
bsd-3-clause
|
cmpFS :: FastString -> FastString -> Ordering
cmpFS f1@(FastString u1 _ _ _) f2@(FastString u2 _ _ _) =
if u1 == u2 then EQ else
compare (fastStringToByteString f1) (fastStringToByteString f2)
| 196
|
cmpFS :: FastString -> FastString -> Ordering
cmpFS f1@(FastString u1 _ _ _) f2@(FastString u2 _ _ _) =
if u1 == u2 then EQ else
compare (fastStringToByteString f1) (fastStringToByteString f2)
| 196
|
cmpFS f1@(FastString u1 _ _ _) f2@(FastString u2 _ _ _) =
if u1 == u2 then EQ else
compare (fastStringToByteString f1) (fastStringToByteString f2)
| 150
| false
| true
| 0
| 8
| 34
| 83
| 43
| 40
| null | null |
Ekleog/hasklate
|
src/Main.hs
|
mit
|
symbolName "/" = "symbol_divides"
| 33
|
symbolName "/" = "symbol_divides"
| 33
|
symbolName "/" = "symbol_divides"
| 33
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
brendanhay/gogol
|
gogol-script/gen/Network/Google/Resource/Script/Projects/Versions/List.hs
|
mpl-2.0
|
-- | The script project\'s Drive ID.
pvlScriptId :: Lens' ProjectsVersionsList Text
pvlScriptId
= lens _pvlScriptId (\ s a -> s{_pvlScriptId = a})
| 148
|
pvlScriptId :: Lens' ProjectsVersionsList Text
pvlScriptId
= lens _pvlScriptId (\ s a -> s{_pvlScriptId = a})
| 111
|
pvlScriptId
= lens _pvlScriptId (\ s a -> s{_pvlScriptId = a})
| 64
| true
| true
| 0
| 9
| 24
| 42
| 22
| 20
| null | null |
Munksgaard/SFOT
|
Asm/AST.hs
|
mit
|
cpyOpcode :: Cpy -> [Word8]
cpyOpcode (CpyI w8) = 0xC0 : encodeWord8 w8
| 76
|
cpyOpcode :: Cpy -> [Word8]
cpyOpcode (CpyI w8) = 0xC0 : encodeWord8 w8
| 76
|
cpyOpcode (CpyI w8) = 0xC0 : encodeWord8 w8
| 48
| false
| true
| 0
| 7
| 17
| 34
| 17
| 17
| null | null |
Noeda/adeonbot
|
terminal-emulator/src/Terminal/Emulator.hs
|
mit
|
-- Set Mode (SM)
handleEscapeSequence _ "h" = return ()
| 55
|
handleEscapeSequence _ "h" = return ()
| 38
|
handleEscapeSequence _ "h" = return ()
| 38
| true
| false
| 0
| 6
| 9
| 17
| 8
| 9
| null | null |
mikegehard/haskellBookExercises
|
chapter9/Zip.hs
|
mit
|
myZipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
myZipWith _ [] _ = []
| 73
|
myZipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
myZipWith _ [] _ = []
| 69
|
myZipWith _ [] _ = []
| 21
| false
| true
| 0
| 8
| 22
| 54
| 29
| 25
| null | null |
fmapfmapfmap/amazonka
|
amazonka-ml/gen/Network/AWS/MachineLearning/Types/Product.hs
|
mpl-2.0
|
-- | The Amazon S3 location for staging Amazon RDS data. The data retrieved
-- from Amazon RDS using 'SelectSqlQuery' is stored in this location.
rdsdsS3StagingLocation :: Lens' RDSDataSpec Text
rdsdsS3StagingLocation = lens _rdsdsS3StagingLocation (\ s a -> s{_rdsdsS3StagingLocation = a})
| 290
|
rdsdsS3StagingLocation :: Lens' RDSDataSpec Text
rdsdsS3StagingLocation = lens _rdsdsS3StagingLocation (\ s a -> s{_rdsdsS3StagingLocation = a})
| 144
|
rdsdsS3StagingLocation = lens _rdsdsS3StagingLocation (\ s a -> s{_rdsdsS3StagingLocation = a})
| 95
| true
| true
| 0
| 9
| 40
| 41
| 23
| 18
| null | null |
alephcloud/hs-aws-general
|
tests/SignatureV4.hs
|
mit
|
simpleIOTest :: String -> IO Bool -> TestTree
simpleIOTest = singleTest
| 71
|
simpleIOTest :: String -> IO Bool -> TestTree
simpleIOTest = singleTest
| 71
|
simpleIOTest = singleTest
| 25
| false
| true
| 0
| 8
| 10
| 29
| 12
| 17
| null | null |
christiaanb/ghc
|
libraries/ghc-prim/GHC/Classes.hs
|
bsd-3-clause
|
------------------------------------------------------------------------
-- These don't really belong here, but we don't have a better place to
-- put them
divInt# :: Int# -> Int# -> Int#
x# `divInt#` y#
-- Be careful NOT to overflow if we do any additional arithmetic
-- on the arguments... the following previous version of this
-- code has problems with overflow:
-- | (x# ># 0#) && (y# <# 0#) = ((x# -# y#) -# 1#) `quotInt#` y#
-- | (x# <# 0#) && (y# ># 0#) = ((x# -# y#) +# 1#) `quotInt#` y#
= if isTrue# (x# ># 0#) && isTrue# (y# <# 0#) then ((x# -# 1#) `quotInt#` y#) -# 1#
else if isTrue# (x# <# 0#) && isTrue# (y# ># 0#) then ((x# +# 1#) `quotInt#` y#) -# 1#
else x# `quotInt#` y#
| 743
|
divInt# :: Int# -> Int# -> Int#
x# `divInt#` y#
-- Be careful NOT to overflow if we do any additional arithmetic
-- on the arguments... the following previous version of this
-- code has problems with overflow:
-- | (x# ># 0#) && (y# <# 0#) = ((x# -# y#) -# 1#) `quotInt#` y#
-- | (x# <# 0#) && (y# ># 0#) = ((x# -# y#) +# 1#) `quotInt#` y#
= if isTrue# (x# ># 0#) && isTrue# (y# <# 0#) then ((x# -# 1#) `quotInt#` y#) -# 1#
else if isTrue# (x# <# 0#) && isTrue# (y# ># 0#) then ((x# +# 1#) `quotInt#` y#) -# 1#
else x# `quotInt#` y#
| 586
|
x# `divInt#` y#
-- Be careful NOT to overflow if we do any additional arithmetic
-- on the arguments... the following previous version of this
-- code has problems with overflow:
-- | (x# ># 0#) && (y# <# 0#) = ((x# -# y#) -# 1#) `quotInt#` y#
-- | (x# <# 0#) && (y# ># 0#) = ((x# -# y#) +# 1#) `quotInt#` y#
= if isTrue# (x# ># 0#) && isTrue# (y# <# 0#) then ((x# -# 1#) `quotInt#` y#) -# 1#
else if isTrue# (x# <# 0#) && isTrue# (y# ># 0#) then ((x# +# 1#) `quotInt#` y#) -# 1#
else x# `quotInt#` y#
| 554
| true
| true
| 1
| 11
| 185
| 151
| 85
| 66
| null | null |
kumasento/accelerate
|
Data/Array/Accelerate/Smart.hs
|
bsd-3-clause
|
mkSqrt :: (Elt t, IsFloating t) => Exp t -> Exp t
mkSqrt x = Exp $ PrimSqrt floatingType `PrimApp` x
| 100
|
mkSqrt :: (Elt t, IsFloating t) => Exp t -> Exp t
mkSqrt x = Exp $ PrimSqrt floatingType `PrimApp` x
| 100
|
mkSqrt x = Exp $ PrimSqrt floatingType `PrimApp` x
| 50
| false
| true
| 0
| 7
| 20
| 52
| 26
| 26
| null | null |
braidchat/greeterbot
|
app/Main.hs
|
epl-1.0
|
verifyHMAC (Just givenMac) macKey msgBody =
givenMac == encodeUtf8 (tshow (hmacGetDigest $ hmac macKey msgBody :: Digest SHA256))
| 131
|
verifyHMAC (Just givenMac) macKey msgBody =
givenMac == encodeUtf8 (tshow (hmacGetDigest $ hmac macKey msgBody :: Digest SHA256))
| 131
|
verifyHMAC (Just givenMac) macKey msgBody =
givenMac == encodeUtf8 (tshow (hmacGetDigest $ hmac macKey msgBody :: Digest SHA256))
| 131
| false
| false
| 0
| 11
| 19
| 50
| 24
| 26
| null | null |
ekmett/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxFILE_MUST_EXIST :: Int
wxFILE_MUST_EXIST = 16
| 47
|
wxFILE_MUST_EXIST :: Int
wxFILE_MUST_EXIST = 16
| 47
|
wxFILE_MUST_EXIST = 16
| 22
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
lehins/unm-hip
|
Data/Image/Boxed.hs
|
gpl-3.0
|
{-| Given a ColorImage, returns a GrayImage representing the Red color component
>>>let red = colorImageRed cacti
<https://raw.github.com/jcollard/unm-hip/master/examples/colorimagered.jpg>
-}
colorImageRed :: ColorImage -> GrayImage
colorImageRed = getRGB (\ (r, _, _) -> r)
| 290
|
colorImageRed :: ColorImage -> GrayImage
colorImageRed = getRGB (\ (r, _, _) -> r)
| 82
|
colorImageRed = getRGB (\ (r, _, _) -> r)
| 41
| true
| true
| 0
| 8
| 47
| 36
| 21
| 15
| null | null |
sol/aeson
|
Data/Aeson/Parser/Internal.hs
|
bsd-3-clause
|
-- | Parse a top-level JSON value followed by optional whitespace and
-- end-of-input. See also: 'json''.
jsonEOF' :: Parser Value
jsonEOF' = json' <* skipSpace <* endOfInput
| 175
|
jsonEOF' :: Parser Value
jsonEOF' = json' <* skipSpace <* endOfInput
| 68
|
jsonEOF' = json' <* skipSpace <* endOfInput
| 43
| true
| true
| 2
| 6
| 28
| 31
| 15
| 16
| null | null |
MichaelXavier/HTTPMock
|
test/Network/HTTPMock/SpecHelper.hs
|
bsd-2-clause
|
putReturningBody = requestReturningBody PUT
| 43
|
putReturningBody = requestReturningBody PUT
| 43
|
putReturningBody = requestReturningBody PUT
| 43
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
spechub/Hets
|
Modal/StatAna.hs
|
gpl-2.0
|
mapM_FORMULA :: M_FORMULA -> M_FORMULA
mapM_FORMULA (BoxOrDiamond b m f ps) =
BoxOrDiamond b (mapMODALITY m) (mapFormula mapM_FORMULA f) ps
| 143
|
mapM_FORMULA :: M_FORMULA -> M_FORMULA
mapM_FORMULA (BoxOrDiamond b m f ps) =
BoxOrDiamond b (mapMODALITY m) (mapFormula mapM_FORMULA f) ps
| 143
|
mapM_FORMULA (BoxOrDiamond b m f ps) =
BoxOrDiamond b (mapMODALITY m) (mapFormula mapM_FORMULA f) ps
| 104
| false
| true
| 0
| 7
| 23
| 53
| 26
| 27
| null | null |
romanb/aws
|
Aws/Aws.hs
|
bsd-3-clause
|
awsIteratedList
:: (IteratedTransaction r a, ListResponse a i)
=> Configuration
-> ServiceConfiguration r NormalQuery
-> HTTP.Manager
-> r
-> C.Producer (ResourceT IO) i
awsIteratedList cfg scfg manager req = awsIteratedList' run req
where
run r = readResponseIO =<< aws cfg scfg manager r
-------------------------------------------------------------------------------
-- | A more flexible version of 'awsIteratedSource' that uses a
-- user-supplied run function. Useful for embedding AWS functionality
-- within application specific monadic contexts.
| 584
|
awsIteratedList
:: (IteratedTransaction r a, ListResponse a i)
=> Configuration
-> ServiceConfiguration r NormalQuery
-> HTTP.Manager
-> r
-> C.Producer (ResourceT IO) i
awsIteratedList cfg scfg manager req = awsIteratedList' run req
where
run r = readResponseIO =<< aws cfg scfg manager r
-------------------------------------------------------------------------------
-- | A more flexible version of 'awsIteratedSource' that uses a
-- user-supplied run function. Useful for embedding AWS functionality
-- within application specific monadic contexts.
| 584
|
awsIteratedList cfg scfg manager req = awsIteratedList' run req
where
run r = readResponseIO =<< aws cfg scfg manager r
-------------------------------------------------------------------------------
-- | A more flexible version of 'awsIteratedSource' that uses a
-- user-supplied run function. Useful for embedding AWS functionality
-- within application specific monadic contexts.
| 390
| false
| true
| 1
| 13
| 101
| 115
| 55
| 60
| null | null |
prl-tokyo/bigul-configuration-adaptation
|
Transformations/src/Generics/BiGUL/Interpreter.hs
|
mit
|
putUPat (UIn upat) s v = liftM inn (putUPat upat (out s) v)
| 59
|
putUPat (UIn upat) s v = liftM inn (putUPat upat (out s) v)
| 59
|
putUPat (UIn upat) s v = liftM inn (putUPat upat (out s) v)
| 59
| false
| false
| 0
| 9
| 12
| 40
| 19
| 21
| null | null |
ulyssesp/oscillare
|
src/Visuals.hs
|
gpl-3.0
|
brightness = brightness' id
| 27
|
brightness = brightness' id
| 27
|
brightness = brightness' id
| 27
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
keithodulaigh/Hets
|
OWL2/MS2Ship.hs
|
gpl-2.0
|
emptyBox :: Box
emptyBox = Box [] [] []
| 39
|
emptyBox :: Box
emptyBox = Box [] [] []
| 39
|
emptyBox = Box [] [] []
| 23
| false
| true
| 0
| 6
| 8
| 24
| 12
| 12
| null | null |
mcmaniac/ghc
|
compiler/codeGen/CgUtils.hs
|
bsd-3-clause
|
anySrc p (CmmStore e1 e2) = p e1 || p e2
| 42
|
anySrc p (CmmStore e1 e2) = p e1 || p e2
| 42
|
anySrc p (CmmStore e1 e2) = p e1 || p e2
| 42
| false
| false
| 0
| 6
| 12
| 31
| 13
| 18
| null | null |
davdar/pretty-monadic-printer
|
Text/PrettyPrint/Final/Demos/STLCDemo.hs
|
mit
|
ppOp Div x1 x2 = infl 30 (annotate opr "/") (grouped x1) (grouped x2)
| 69
|
ppOp Div x1 x2 = infl 30 (annotate opr "/") (grouped x1) (grouped x2)
| 69
|
ppOp Div x1 x2 = infl 30 (annotate opr "/") (grouped x1) (grouped x2)
| 69
| false
| false
| 0
| 7
| 13
| 44
| 20
| 24
| null | null |
lordi/flowskell
|
src/Flowskell/TextureUtils.hs
|
gpl-2.0
|
makeImage :: TextureSize2D -> (GLsizei -> GLsizei -> Color3 GLubyte)
-> (PixelData (Color3 GLubyte) -> IO ()) -> IO ()
makeImage (TextureSize2D w h) f act =
withArray [ f i j |
i <- [ 0 .. w - 1 ],
j <- [ 0 .. h - 1 ] ] $
act . PixelData RGB UnsignedByte
| 305
|
makeImage :: TextureSize2D -> (GLsizei -> GLsizei -> Color3 GLubyte)
-> (PixelData (Color3 GLubyte) -> IO ()) -> IO ()
makeImage (TextureSize2D w h) f act =
withArray [ f i j |
i <- [ 0 .. w - 1 ],
j <- [ 0 .. h - 1 ] ] $
act . PixelData RGB UnsignedByte
| 305
|
makeImage (TextureSize2D w h) f act =
withArray [ f i j |
i <- [ 0 .. w - 1 ],
j <- [ 0 .. h - 1 ] ] $
act . PixelData RGB UnsignedByte
| 171
| false
| true
| 0
| 12
| 108
| 138
| 69
| 69
| null | null |
Deewiant/haschoo
|
Haschoo/Types.hs
|
bsd-3-clause
|
scmShow (ScmSyntax _ _) = return "<syntax rules>"
| 50
|
scmShow (ScmSyntax _ _) = return "<syntax rules>"
| 50
|
scmShow (ScmSyntax _ _) = return "<syntax rules>"
| 50
| false
| false
| 0
| 6
| 8
| 21
| 9
| 12
| null | null |
mbakke/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
nvLvlist :: String
nvLvlist = "lvlist"
| 38
|
nvLvlist :: String
nvLvlist = "lvlist"
| 38
|
nvLvlist = "lvlist"
| 19
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
mstksg/hledger
|
hledger-lib/Hledger/Read/CsvReader.hs
|
gpl-3.0
|
parseDateWithFormatOrDefaultFormats :: Maybe DateFormat -> String -> Maybe Day
parseDateWithFormatOrDefaultFormats mformat s = firstJust $ map parsewith formats
where
parsetime =
#if MIN_VERSION_time(1,5,0)
parseTimeM True
#else
parseTime
#endif
parsewith = flip (parsetime defaultTimeLocale) s
formats = maybe
["%Y/%-m/%-d"
,"%Y-%-m-%-d"
,"%Y.%-m.%-d"
-- ,"%-m/%-d/%Y"
-- ,parseTime defaultTimeLocale "%Y/%m/%e" (take 5 s ++ "0" ++ drop 5 s)
-- ,parseTime defaultTimeLocale "%Y-%m-%e" (take 5 s ++ "0" ++ drop 5 s)
-- ,parseTime defaultTimeLocale "%m/%e/%Y" ('0':s)
-- ,parseTime defaultTimeLocale "%m-%e-%Y" ('0':s)
]
(:[])
mformat
--------------------------------------------------------------------------------
-- tests
| 918
|
parseDateWithFormatOrDefaultFormats :: Maybe DateFormat -> String -> Maybe Day
parseDateWithFormatOrDefaultFormats mformat s = firstJust $ map parsewith formats
where
parsetime =
#if MIN_VERSION_time(1,5,0)
parseTimeM True
#else
parseTime
#endif
parsewith = flip (parsetime defaultTimeLocale) s
formats = maybe
["%Y/%-m/%-d"
,"%Y-%-m-%-d"
,"%Y.%-m.%-d"
-- ,"%-m/%-d/%Y"
-- ,parseTime defaultTimeLocale "%Y/%m/%e" (take 5 s ++ "0" ++ drop 5 s)
-- ,parseTime defaultTimeLocale "%Y-%m-%e" (take 5 s ++ "0" ++ drop 5 s)
-- ,parseTime defaultTimeLocale "%m/%e/%Y" ('0':s)
-- ,parseTime defaultTimeLocale "%m-%e-%Y" ('0':s)
]
(:[])
mformat
--------------------------------------------------------------------------------
-- tests
| 918
|
parseDateWithFormatOrDefaultFormats mformat s = firstJust $ map parsewith formats
where
parsetime =
#if MIN_VERSION_time(1,5,0)
parseTimeM True
#else
parseTime
#endif
parsewith = flip (parsetime defaultTimeLocale) s
formats = maybe
["%Y/%-m/%-d"
,"%Y-%-m-%-d"
,"%Y.%-m.%-d"
-- ,"%-m/%-d/%Y"
-- ,parseTime defaultTimeLocale "%Y/%m/%e" (take 5 s ++ "0" ++ drop 5 s)
-- ,parseTime defaultTimeLocale "%Y-%m-%e" (take 5 s ++ "0" ++ drop 5 s)
-- ,parseTime defaultTimeLocale "%m/%e/%Y" ('0':s)
-- ,parseTime defaultTimeLocale "%m-%e-%Y" ('0':s)
]
(:[])
mformat
--------------------------------------------------------------------------------
-- tests
| 839
| false
| true
| 3
| 7
| 278
| 116
| 57
| 59
| null | null |
keithodulaigh/Hets
|
HasCASL/Subst.hs
|
gpl-2.0
|
blockRule :: SRule a -> SRule a
blockRule (Ready x) = Blocked x
| 63
|
blockRule :: SRule a -> SRule a
blockRule (Ready x) = Blocked x
| 63
|
blockRule (Ready x) = Blocked x
| 31
| false
| true
| 0
| 9
| 12
| 38
| 16
| 22
| null | null |
lambda-llama/bresson
|
benchmarks/Benchmarks.hs
|
mit
|
main :: IO ()
main = do
stdGen <- getStdGen
defaultMain
[ bgroup "fromBson . toBson"
[ bench "Double" (whnf f (generate stdGen :: Double))
, bench "Text" (whnf f (generate stdGen :: Text))
, bench "Document" (whnf f (generate stdGen :: Document))
, bench "Bool" (whnf f (generate stdGen :: Bool))
, bench "UTCTime" (whnf f (generate stdGen :: UTCTime))
, bench "Int32" (whnf f (generate stdGen :: Int32))
, bench "Int64" (whnf f (generate stdGen :: Int64))
]
]
where
n :: Int
n = 2 ^ (12 :: Int)
seed :: Int
seed = 42
f :: (FromBson a, ToBson a) => a -> a
f x = case parseMaybe fromBson $ toBson x of
Nothing -> error "fromBson"
Just a -> a
generate :: (FromBson a, ToBson a, Arbitrary a) => StdGen -> a
generate stdGen = unGen (resize n arbitrary) stdGen seed
| 919
|
main :: IO ()
main = do
stdGen <- getStdGen
defaultMain
[ bgroup "fromBson . toBson"
[ bench "Double" (whnf f (generate stdGen :: Double))
, bench "Text" (whnf f (generate stdGen :: Text))
, bench "Document" (whnf f (generate stdGen :: Document))
, bench "Bool" (whnf f (generate stdGen :: Bool))
, bench "UTCTime" (whnf f (generate stdGen :: UTCTime))
, bench "Int32" (whnf f (generate stdGen :: Int32))
, bench "Int64" (whnf f (generate stdGen :: Int64))
]
]
where
n :: Int
n = 2 ^ (12 :: Int)
seed :: Int
seed = 42
f :: (FromBson a, ToBson a) => a -> a
f x = case parseMaybe fromBson $ toBson x of
Nothing -> error "fromBson"
Just a -> a
generate :: (FromBson a, ToBson a, Arbitrary a) => StdGen -> a
generate stdGen = unGen (resize n arbitrary) stdGen seed
| 919
|
main = do
stdGen <- getStdGen
defaultMain
[ bgroup "fromBson . toBson"
[ bench "Double" (whnf f (generate stdGen :: Double))
, bench "Text" (whnf f (generate stdGen :: Text))
, bench "Document" (whnf f (generate stdGen :: Document))
, bench "Bool" (whnf f (generate stdGen :: Bool))
, bench "UTCTime" (whnf f (generate stdGen :: UTCTime))
, bench "Int32" (whnf f (generate stdGen :: Int32))
, bench "Int64" (whnf f (generate stdGen :: Int64))
]
]
where
n :: Int
n = 2 ^ (12 :: Int)
seed :: Int
seed = 42
f :: (FromBson a, ToBson a) => a -> a
f x = case parseMaybe fromBson $ toBson x of
Nothing -> error "fromBson"
Just a -> a
generate :: (FromBson a, ToBson a, Arbitrary a) => StdGen -> a
generate stdGen = unGen (resize n arbitrary) stdGen seed
| 905
| false
| true
| 2
| 15
| 305
| 391
| 190
| 201
| null | null |
bovinespirit/enummapmap
|
test/EnumMapSetVsIntSet.hs
|
bsd-3-clause
|
runPropDuo2 :: Eq t =>
(IS.IntSet -> IS.IntSet -> t)
-> (TestSet2 -> TestSet2 -> t)
-> Int
-> [Int]
-> [Int]
-> Bool
runPropDuo2 f g k1 list1 list2
= f (IS.fromList list1) (IS.fromList list2)
== g (EMS.fromList $ list2l2 k1 list1)
(EMS.fromList $ list2l2 k1 list2)
| 356
|
runPropDuo2 :: Eq t =>
(IS.IntSet -> IS.IntSet -> t)
-> (TestSet2 -> TestSet2 -> t)
-> Int
-> [Int]
-> [Int]
-> Bool
runPropDuo2 f g k1 list1 list2
= f (IS.fromList list1) (IS.fromList list2)
== g (EMS.fromList $ list2l2 k1 list1)
(EMS.fromList $ list2l2 k1 list2)
| 356
|
runPropDuo2 f g k1 list1 list2
= f (IS.fromList list1) (IS.fromList list2)
== g (EMS.fromList $ list2l2 k1 list1)
(EMS.fromList $ list2l2 k1 list2)
| 170
| false
| true
| 3
| 12
| 139
| 147
| 72
| 75
| null | null |
mariefarrell/Hets
|
Comorphisms/THFP2THF0.hs
|
gpl-2.0
|
flattenTuples :: [THFUnitaryFormula] -> [THFUnitaryFormula]
flattenTuples = concatMap flattenTuple
| 98
|
flattenTuples :: [THFUnitaryFormula] -> [THFUnitaryFormula]
flattenTuples = concatMap flattenTuple
| 98
|
flattenTuples = concatMap flattenTuple
| 38
| false
| true
| 0
| 6
| 8
| 24
| 13
| 11
| null | null |
sdiehl/ghc
|
compiler/GHC/Stg/Stats.hs
|
bsd-3-clause
|
{-
************************************************************************
* *
\subsection{Expressions}
* *
************************************************************************
-}
statExpr :: StgExpr -> StatEnv
statExpr (StgApp _ _) = countOne Applications
| 405
|
statExpr :: StgExpr -> StatEnv
statExpr (StgApp _ _) = countOne Applications
| 80
|
statExpr (StgApp _ _) = countOne Applications
| 49
| true
| true
| 0
| 6
| 164
| 34
| 16
| 18
| null | null |
corajr/servant-state-graph
|
src/Servant/StateGraph/Graph/JSON.hs
|
bsd-3-clause
|
-- | Convert an 'ApiGraph' to 'CytoGraph'.
graphToCyto :: ApiGraph -> CytoGraph
graphToCyto gr = CytoGraph cNodes cEdges
where cNodes = map nodeToCyto (labNodes gr)
cEdges = map edgeToCyto (labEdges gr)
nodeColor NormalNode = "lightgrey"
nodeColor ErrorNode = "red"
nodeColor TargetNode = "green"
nodeToCyto (i, ApiNode name nodeType) = CytoData (NodeData ('n' : show i) name (nodeColor nodeType))
edgeToCyto (i, j, ApiEdge name color) = CytoData (EdgeData ('n' : show i) ('n' : show j) name color)
-- | Output an 'ApiGraph' as Cytoscape.js JSON.
| 597
|
graphToCyto :: ApiGraph -> CytoGraph
graphToCyto gr = CytoGraph cNodes cEdges
where cNodes = map nodeToCyto (labNodes gr)
cEdges = map edgeToCyto (labEdges gr)
nodeColor NormalNode = "lightgrey"
nodeColor ErrorNode = "red"
nodeColor TargetNode = "green"
nodeToCyto (i, ApiNode name nodeType) = CytoData (NodeData ('n' : show i) name (nodeColor nodeType))
edgeToCyto (i, j, ApiEdge name color) = CytoData (EdgeData ('n' : show i) ('n' : show j) name color)
-- | Output an 'ApiGraph' as Cytoscape.js JSON.
| 554
|
graphToCyto gr = CytoGraph cNodes cEdges
where cNodes = map nodeToCyto (labNodes gr)
cEdges = map edgeToCyto (labEdges gr)
nodeColor NormalNode = "lightgrey"
nodeColor ErrorNode = "red"
nodeColor TargetNode = "green"
nodeToCyto (i, ApiNode name nodeType) = CytoData (NodeData ('n' : show i) name (nodeColor nodeType))
edgeToCyto (i, j, ApiEdge name color) = CytoData (EdgeData ('n' : show i) ('n' : show j) name color)
-- | Output an 'ApiGraph' as Cytoscape.js JSON.
| 517
| true
| true
| 4
| 10
| 135
| 209
| 96
| 113
| null | null |
whittle/bounty
|
test/Tests/Parser.hs
|
mit
|
test_verbosity =
[ testCase "without noreply" $ "verbosity 0\r\n" @<?= Verbosity 0 True
, testCase "with noreply" $ "verbosity 3 noreply\r\n" @<?= Verbosity 3 False
]
| 172
|
test_verbosity =
[ testCase "without noreply" $ "verbosity 0\r\n" @<?= Verbosity 0 True
, testCase "with noreply" $ "verbosity 3 noreply\r\n" @<?= Verbosity 3 False
]
| 172
|
test_verbosity =
[ testCase "without noreply" $ "verbosity 0\r\n" @<?= Verbosity 0 True
, testCase "with noreply" $ "verbosity 3 noreply\r\n" @<?= Verbosity 3 False
]
| 172
| false
| false
| 0
| 8
| 31
| 44
| 21
| 23
| null | null |
dorchard/camfort
|
src/Camfort/Transformation/CommonBlockElim.hs
|
apache-2.0
|
cmpTConBNames (Just n, _) (Just n', _)
| n < n' = LT
| n > n' = GT
| otherwise = EQ
| 95
|
cmpTConBNames (Just n, _) (Just n', _)
| n < n' = LT
| n > n' = GT
| otherwise = EQ
| 95
|
cmpTConBNames (Just n, _) (Just n', _)
| n < n' = LT
| n > n' = GT
| otherwise = EQ
| 95
| false
| false
| 1
| 8
| 34
| 66
| 31
| 35
| null | null |
forste/haReFork
|
tools/interp/HaskellWorkshop/weirdness.hs
|
bsd-3-clause
|
n (N i) = 42
| 12
|
n (N i) = 42
| 12
|
n (N i) = 42
| 12
| false
| false
| 0
| 6
| 4
| 16
| 7
| 9
| null | null |
chrisdone/path
|
test/Common/Include.hs
|
bsd-3-clause
|
thRelFile :: FilePath
thRelFile = foo $(mkRelFile "foo")
| 56
|
thRelFile :: FilePath
thRelFile = foo $(mkRelFile "foo")
| 56
|
thRelFile = foo $(mkRelFile "foo")
| 34
| false
| true
| 0
| 8
| 7
| 21
| 10
| 11
| null | null |
urbanslug/ghc
|
compiler/cmm/CmmMachOp.hs
|
bsd-3-clause
|
pprCallishMachOp :: CallishMachOp -> SDoc
pprCallishMachOp mo = text (show mo)
| 78
|
pprCallishMachOp :: CallishMachOp -> SDoc
pprCallishMachOp mo = text (show mo)
| 78
|
pprCallishMachOp mo = text (show mo)
| 36
| false
| true
| 0
| 7
| 10
| 32
| 14
| 18
| null | null |
d0kt0r0/estuary
|
client/src/Estuary/Render/Renderer.hs
|
gpl-3.0
|
parseHydra :: ImmutableRenderContext -> Context -> Int -> Text -> Renderer
parseHydra irc c z t = do
s <- get
parseResult <- liftIO $ try $ return $! Hydra.parseHydra t
case parseResult of
Right (Right stmts) -> do
clearZoneError z
setBaseNotation z Hydra
-- setEvaluationTime z eTime ???
let x = IntMap.lookup z $ hydras s
hydra <- case x of
Just h -> return h
Nothing -> do
h <- liftIO $ Hydra.newHydra $ hydraCanvas s
modify' $ \x -> x { hydras = IntMap.insert z h (hydras x)}
return h
-- liftIO $ Hydra.setResolution hydra 1280 720
liftIO $ Hydra.evaluate hydra stmts
Right (Left parseErr) -> setZoneError z (T.pack $ show parseErr)
Left exception -> setZoneError z (T.pack $ show (exception :: SomeException))
| 802
|
parseHydra :: ImmutableRenderContext -> Context -> Int -> Text -> Renderer
parseHydra irc c z t = do
s <- get
parseResult <- liftIO $ try $ return $! Hydra.parseHydra t
case parseResult of
Right (Right stmts) -> do
clearZoneError z
setBaseNotation z Hydra
-- setEvaluationTime z eTime ???
let x = IntMap.lookup z $ hydras s
hydra <- case x of
Just h -> return h
Nothing -> do
h <- liftIO $ Hydra.newHydra $ hydraCanvas s
modify' $ \x -> x { hydras = IntMap.insert z h (hydras x)}
return h
-- liftIO $ Hydra.setResolution hydra 1280 720
liftIO $ Hydra.evaluate hydra stmts
Right (Left parseErr) -> setZoneError z (T.pack $ show parseErr)
Left exception -> setZoneError z (T.pack $ show (exception :: SomeException))
| 802
|
parseHydra irc c z t = do
s <- get
parseResult <- liftIO $ try $ return $! Hydra.parseHydra t
case parseResult of
Right (Right stmts) -> do
clearZoneError z
setBaseNotation z Hydra
-- setEvaluationTime z eTime ???
let x = IntMap.lookup z $ hydras s
hydra <- case x of
Just h -> return h
Nothing -> do
h <- liftIO $ Hydra.newHydra $ hydraCanvas s
modify' $ \x -> x { hydras = IntMap.insert z h (hydras x)}
return h
-- liftIO $ Hydra.setResolution hydra 1280 720
liftIO $ Hydra.evaluate hydra stmts
Right (Left parseErr) -> setZoneError z (T.pack $ show parseErr)
Left exception -> setZoneError z (T.pack $ show (exception :: SomeException))
| 727
| false
| true
| 0
| 24
| 213
| 294
| 137
| 157
| null | null |
DATx02-16-14/Hastings
|
src/ChineseCheckers/ChineseBitmaps.hs
|
bsd-3-clause
|
renderSquare2 can space size (Piece col) (x,y)
|col == blue = do
bitmap <- loadBitmap $ filepath ++ "/blue2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == green = do
bitmap <- loadBitmap $ filepath ++ "/green3.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == orange = do
bitmap <- loadBitmap $ filepath ++ "/orange2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == yellow = do
bitmap <- loadBitmap $ filepath ++ "/yellow2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == purple = do
bitmap <- loadBitmap $ filepath ++ "/purple2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == red = do
bitmap <- loadBitmap $ filepath ++ "/red2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
-- | Render a piece to the specified canvas, color and coordinate.
| 1,807
|
renderSquare2 can space size (Piece col) (x,y)
|col == blue = do
bitmap <- loadBitmap $ filepath ++ "/blue2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == green = do
bitmap <- loadBitmap $ filepath ++ "/green3.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == orange = do
bitmap <- loadBitmap $ filepath ++ "/orange2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == yellow = do
bitmap <- loadBitmap $ filepath ++ "/yellow2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == purple = do
bitmap <- loadBitmap $ filepath ++ "/purple2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == red = do
bitmap <- loadBitmap $ filepath ++ "/red2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
-- | Render a piece to the specified canvas, color and coordinate.
| 1,807
|
renderSquare2 can space size (Piece col) (x,y)
|col == blue = do
bitmap <- loadBitmap $ filepath ++ "/blue2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == green = do
bitmap <- loadBitmap $ filepath ++ "/green3.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == orange = do
bitmap <- loadBitmap $ filepath ++ "/orange2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == yellow = do
bitmap <- loadBitmap $ filepath ++ "/yellow2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == purple = do
bitmap <- loadBitmap $ filepath ++ "/purple2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
|col == red = do
bitmap <- loadBitmap $ filepath ++ "/red2.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
-- | Render a piece to the specified canvas, color and coordinate.
| 1,807
| false
| false
| 0
| 16
| 440
| 693
| 332
| 361
| null | null |
ezyang/ghc
|
compiler/deSugar/DsBinds.hs
|
bsd-3-clause
|
ds_ev_typeable ty (EvTypeableTyApp ev1 ev2)
| Just (t1,t2) <- splitAppTy_maybe ty
= do { e1 <- getRep ev1 t1
; e2 <- getRep ev2 t2
; mkTrApp <- dsLookupGlobalId mkTrAppName
-- mkTrApp :: forall k1 k2 (a :: k1 -> k2) (b :: k1).
-- TypeRep a -> TypeRep b -> TypeRep (a b)
; let (k1, k2) = splitFunTy (typeKind t1)
; return $ mkApps (mkTyApps (Var mkTrApp) [ k1, k2, t1, t2 ])
[ e1, e2 ] }
| 496
|
ds_ev_typeable ty (EvTypeableTyApp ev1 ev2)
| Just (t1,t2) <- splitAppTy_maybe ty
= do { e1 <- getRep ev1 t1
; e2 <- getRep ev2 t2
; mkTrApp <- dsLookupGlobalId mkTrAppName
-- mkTrApp :: forall k1 k2 (a :: k1 -> k2) (b :: k1).
-- TypeRep a -> TypeRep b -> TypeRep (a b)
; let (k1, k2) = splitFunTy (typeKind t1)
; return $ mkApps (mkTyApps (Var mkTrApp) [ k1, k2, t1, t2 ])
[ e1, e2 ] }
| 496
|
ds_ev_typeable ty (EvTypeableTyApp ev1 ev2)
| Just (t1,t2) <- splitAppTy_maybe ty
= do { e1 <- getRep ev1 t1
; e2 <- getRep ev2 t2
; mkTrApp <- dsLookupGlobalId mkTrAppName
-- mkTrApp :: forall k1 k2 (a :: k1 -> k2) (b :: k1).
-- TypeRep a -> TypeRep b -> TypeRep (a b)
; let (k1, k2) = splitFunTy (typeKind t1)
; return $ mkApps (mkTyApps (Var mkTrApp) [ k1, k2, t1, t2 ])
[ e1, e2 ] }
| 496
| false
| false
| 0
| 13
| 189
| 152
| 77
| 75
| null | null |
githubkleon/ConvenientHDL
|
src/Language/Verilog/PrettyPrint.hs
|
bsd-3-clause
|
lookupOp :: (Eq op, Show op) => op -> [(op, x)] -> x
lookupOp op table
= fromMaybe (error msg) (lookup op table)
where msg = "showOp: cannot find operator: " ++ show op
-- precedence tables, also for showing.
-- these tables could also be used for parsing operators.
| 271
|
lookupOp :: (Eq op, Show op) => op -> [(op, x)] -> x
lookupOp op table
= fromMaybe (error msg) (lookup op table)
where msg = "showOp: cannot find operator: " ++ show op
-- precedence tables, also for showing.
-- these tables could also be used for parsing operators.
| 271
|
lookupOp op table
= fromMaybe (error msg) (lookup op table)
where msg = "showOp: cannot find operator: " ++ show op
-- precedence tables, also for showing.
-- these tables could also be used for parsing operators.
| 218
| false
| true
| 0
| 9
| 54
| 84
| 44
| 40
| null | null |
bitemyapp/lets-lens
|
src/Lets/Lens.hs
|
bsd-3-clause
|
set ::
Set s t a b
-> s
-> b
-> t
set =
error "todo: set"
| 67
|
set ::
Set s t a b
-> s
-> b
-> t
set =
error "todo: set"
| 67
|
set =
error "todo: set"
| 25
| false
| true
| 0
| 9
| 27
| 42
| 18
| 24
| null | null |
rvion/ride
|
jetpack/src/Data/Map/AsLmap.hs
|
bsd-3-clause
|
-- lmap_difference :: forall k a b. Ord k => Map k a -> Map k b -> Map k a
lmap_difference = I.difference
| 105
|
lmap_difference = I.difference
| 30
|
lmap_difference = I.difference
| 30
| true
| false
| 1
| 6
| 23
| 13
| 5
| 8
| null | null |
rfranek/duckling
|
Duckling/Numeral/SV/Corpus.hs
|
bsd-3-clause
|
corpus :: Corpus
corpus = (testContext {lang = SV}, allExamples)
| 64
|
corpus :: Corpus
corpus = (testContext {lang = SV}, allExamples)
| 64
|
corpus = (testContext {lang = SV}, allExamples)
| 47
| false
| true
| 0
| 8
| 9
| 32
| 16
| 16
| null | null |
GaloisInc/halvm-ghc
|
compiler/coreSyn/CoreSyn.hs
|
bsd-3-clause
|
-- | Returns true if 'IsOrphan' is not an orphan.
notOrphan :: IsOrphan -> Bool
notOrphan NotOrphan{} = True
| 108
|
notOrphan :: IsOrphan -> Bool
notOrphan NotOrphan{} = True
| 58
|
notOrphan NotOrphan{} = True
| 28
| true
| true
| 2
| 4
| 18
| 23
| 13
| 10
| null | null |
ssaavedra/liquidhaskell
|
src/Language/Haskell/Liquid/Bare/Misc.hs
|
bsd-3-clause
|
mapTyRVar α a s@(MTVST αas err)
= case lookup α αas of
Just a' | a == a' -> return s
| otherwise -> throwError err
Nothing -> return $ MTVST ((α,a):αas) err
| 198
|
mapTyRVar α a s@(MTVST αas err)
= case lookup α αas of
Just a' | a == a' -> return s
| otherwise -> throwError err
Nothing -> return $ MTVST ((α,a):αas) err
| 198
|
mapTyRVar α a s@(MTVST αas err)
= case lookup α αas of
Just a' | a == a' -> return s
| otherwise -> throwError err
Nothing -> return $ MTVST ((α,a):αas) err
| 198
| false
| false
| 0
| 12
| 74
| 95
| 45
| 50
| null | null |
alexvong1995/pandoc
|
src/Text/Pandoc/Writers/Textile.hs
|
gpl-2.0
|
blockToTextile _ (CodeBlock (_,classes,_) str) | any (all isSpace) (lines str) =
return $ "<pre" ++ classes' ++ ">\n" ++ escapeStringForXML str ++
"\n</pre>\n"
where classes' = if null classes
then ""
else " class=\"" ++ unwords classes ++ "\""
| 310
|
blockToTextile _ (CodeBlock (_,classes,_) str) | any (all isSpace) (lines str) =
return $ "<pre" ++ classes' ++ ">\n" ++ escapeStringForXML str ++
"\n</pre>\n"
where classes' = if null classes
then ""
else " class=\"" ++ unwords classes ++ "\""
| 310
|
blockToTextile _ (CodeBlock (_,classes,_) str) | any (all isSpace) (lines str) =
return $ "<pre" ++ classes' ++ ">\n" ++ escapeStringForXML str ++
"\n</pre>\n"
where classes' = if null classes
then ""
else " class=\"" ++ unwords classes ++ "\""
| 310
| false
| false
| 0
| 10
| 105
| 103
| 51
| 52
| null | null |
mikeyhc/mircy
|
src/Network/Mircy.hs
|
bsd-3-clause
|
sendIRCCommand (IRCWho (Just (w, o))) = sendIRCCommand'
$ foldl1 B.append $ [ "WHO ", w ] ++ [ "o" | o ]
| 108
|
sendIRCCommand (IRCWho (Just (w, o))) = sendIRCCommand'
$ foldl1 B.append $ [ "WHO ", w ] ++ [ "o" | o ]
| 108
|
sendIRCCommand (IRCWho (Just (w, o))) = sendIRCCommand'
$ foldl1 B.append $ [ "WHO ", w ] ++ [ "o" | o ]
| 108
| false
| false
| 2
| 10
| 25
| 59
| 30
| 29
| null | null |
pbv/codex
|
src/Codex/Printout.hs
|
mit
|
checkText (Invalid msg) = "Invalid: " ++ T.unpack msg
| 53
|
checkText (Invalid msg) = "Invalid: " ++ T.unpack msg
| 53
|
checkText (Invalid msg) = "Invalid: " ++ T.unpack msg
| 53
| false
| false
| 0
| 7
| 8
| 24
| 11
| 13
| null | null |
lifengsun/haskell-exercise
|
scheme/06/replparser.hs
|
gpl-3.0
|
cdr [badArg] = throwError $ TypeMismatch "pair" badArg
| 54
|
cdr [badArg] = throwError $ TypeMismatch "pair" badArg
| 54
|
cdr [badArg] = throwError $ TypeMismatch "pair" badArg
| 54
| false
| false
| 0
| 6
| 7
| 22
| 10
| 12
| null | null |
hvr/vector
|
Data/Vector/Storable.hs
|
bsd-3-clause
|
dropWhile = G.dropWhile
| 23
|
dropWhile = G.dropWhile
| 23
|
dropWhile = G.dropWhile
| 23
| false
| false
| 0
| 5
| 2
| 8
| 4
| 4
| null | null |
Megaleo/Minehack
|
src/Tile/TileType.hs
|
bsd-3-clause
|
-- | Returns if a TileType is an Item
isOnlyItem :: TileType -> Bool
isOnlyItem (TItem _) = True
| 96
|
isOnlyItem :: TileType -> Bool
isOnlyItem (TItem _) = True
| 58
|
isOnlyItem (TItem _) = True
| 27
| true
| true
| 0
| 7
| 18
| 25
| 13
| 12
| null | null |
harendra-kumar/asyncly
|
benchmark/Array.hs
|
bsd-3-clause
|
benchPureSrc :: (NFData a, Storable a)
=> String -> (Int -> Ops.Stream a) -> Benchmark
benchPureSrc name src = benchPure name src id
| 136
|
benchPureSrc :: (NFData a, Storable a)
=> String -> (Int -> Ops.Stream a) -> Benchmark
benchPureSrc name src = benchPure name src id
| 136
|
benchPureSrc name src = benchPure name src id
| 45
| false
| true
| 0
| 11
| 26
| 58
| 29
| 29
| null | null |
Hara-Laboratory/subleq-mips
|
src/SubleqTestUtils.hs
|
gpl-3.0
|
idealSituationW = False
| 23
|
idealSituationW = False
| 23
|
idealSituationW = False
| 23
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
keithodulaigh/Hets
|
HasCASL/TypeDecl.hs
|
gpl-2.0
|
ana1TypeItem :: Annoted TypeItem -> State Env (Maybe TypeItem)
ana1TypeItem t = case item t of
Datatype d -> do
md <- ana1Datatype $ replaceAnnoted d t
return $ fmap Datatype md
i -> return $ Just i
| 222
|
ana1TypeItem :: Annoted TypeItem -> State Env (Maybe TypeItem)
ana1TypeItem t = case item t of
Datatype d -> do
md <- ana1Datatype $ replaceAnnoted d t
return $ fmap Datatype md
i -> return $ Just i
| 222
|
ana1TypeItem t = case item t of
Datatype d -> do
md <- ana1Datatype $ replaceAnnoted d t
return $ fmap Datatype md
i -> return $ Just i
| 159
| false
| true
| 0
| 12
| 61
| 93
| 41
| 52
| null | null |
li-zhirui/JSAnalyzer
|
JSParser.hs
|
mit
|
pJSBool :: Parser JSVal
pJSBool = JSBool <$>
((string "true" >> return True) <|> (string "false" >> return False))
| 117
|
pJSBool :: Parser JSVal
pJSBool = JSBool <$>
((string "true" >> return True) <|> (string "false" >> return False))
| 117
|
pJSBool = JSBool <$>
((string "true" >> return True) <|> (string "false" >> return False))
| 93
| false
| true
| 2
| 10
| 21
| 58
| 26
| 32
| null | null |
lukemaurer/sequent-core
|
examples/Strictness.hs
|
bsd-3-clause
|
-- Should be the same as lazyCall
lazyBotCall b x y z w = plusL b (error "oops" z w)
(let {-# NOINLINE a #-}
a = x + y in a * a)
| 203
|
lazyBotCall b x y z w = plusL b (error "oops" z w)
(let {-# NOINLINE a #-}
a = x + y in a * a)
| 169
|
lazyBotCall b x y z w = plusL b (error "oops" z w)
(let {-# NOINLINE a #-}
a = x + y in a * a)
| 169
| true
| false
| 0
| 11
| 108
| 58
| 29
| 29
| null | null |
FranklinChen/maam
|
src/FP/Parser.hs
|
bsd-3-clause
|
infr :: (Monad m) => (a -> b -> a -> a) -> m b -> Mix m a
infr f bM = InfR $ inf' f bM
| 86
|
infr :: (Monad m) => (a -> b -> a -> a) -> m b -> Mix m a
infr f bM = InfR $ inf' f bM
| 86
|
infr f bM = InfR $ inf' f bM
| 28
| false
| true
| 2
| 11
| 27
| 72
| 33
| 39
| null | null |
mgsloan/quasi-extras
|
src/Language/Quasi/Internal/Utils.hs
|
bsd-3-clause
|
parseType :: String -> Either String Type
parseType = mapRight Exts.toType . Exts.parseResultToEither
. Exts.parseTypeWithMode parseMode
| 146
|
parseType :: String -> Either String Type
parseType = mapRight Exts.toType . Exts.parseResultToEither
. Exts.parseTypeWithMode parseMode
| 146
|
parseType = mapRight Exts.toType . Exts.parseResultToEither
. Exts.parseTypeWithMode parseMode
| 104
| false
| true
| 0
| 8
| 25
| 40
| 19
| 21
| null | null |
pparkkin/eta
|
compiler/ETA/BasicTypes/Unique.hs
|
bsd-3-clause
|
cmpUnique :: Unique -> Unique -> Ordering
cmpUnique (MkUnique u1) (MkUnique u2)
= if u1 == u2 then EQ else if u1 < u2 then LT else GT
| 135
|
cmpUnique :: Unique -> Unique -> Ordering
cmpUnique (MkUnique u1) (MkUnique u2)
= if u1 == u2 then EQ else if u1 < u2 then LT else GT
| 135
|
cmpUnique (MkUnique u1) (MkUnique u2)
= if u1 == u2 then EQ else if u1 < u2 then LT else GT
| 93
| false
| true
| 0
| 7
| 29
| 60
| 32
| 28
| null | null |
Rembane/mrShoe
|
src/Main.hs
|
gpl-3.0
|
readConfig :: IO Config
readConfig = do
either (error . show) id <$> decodeFileEither "settings.yaml"
-- | Initialize global state, connect to the server
-- and return the initial bot state.
| 195
|
readConfig :: IO Config
readConfig = do
either (error . show) id <$> decodeFileEither "settings.yaml"
-- | Initialize global state, connect to the server
-- and return the initial bot state.
| 195
|
readConfig = do
either (error . show) id <$> decodeFileEither "settings.yaml"
-- | Initialize global state, connect to the server
-- and return the initial bot state.
| 171
| false
| true
| 0
| 10
| 35
| 38
| 19
| 19
| null | null |
23Skidoo/aeson
|
tests/DataFamilies/Encoders.hs
|
bsd-3-clause
|
thApproxToJSONDefault :: Approx String -> Value
thApproxToJSONDefault = $(mkToJSON defaultOptions 'Approx)
| 106
|
thApproxToJSONDefault :: Approx String -> Value
thApproxToJSONDefault = $(mkToJSON defaultOptions 'Approx)
| 106
|
thApproxToJSONDefault = $(mkToJSON defaultOptions 'Approx)
| 58
| false
| true
| 0
| 7
| 10
| 28
| 14
| 14
| null | null |
olorin/amazonka
|
amazonka-route53/gen/Network/AWS/Route53/UpdateHealthCheck.hs
|
mpl-2.0
|
-- | Optional. When you specify a health check version, Route 53 compares
-- this value with the current value in the health check, which prevents
-- you from updating the health check when the versions don\'t match. Using
-- 'HealthCheckVersion' lets you prevent overwriting another change to the
-- health check.
uhcHealthCheckVersion :: Lens' UpdateHealthCheck (Maybe Natural)
uhcHealthCheckVersion = lens _uhcHealthCheckVersion (\ s a -> s{_uhcHealthCheckVersion = a}) . mapping _Nat
| 487
|
uhcHealthCheckVersion :: Lens' UpdateHealthCheck (Maybe Natural)
uhcHealthCheckVersion = lens _uhcHealthCheckVersion (\ s a -> s{_uhcHealthCheckVersion = a}) . mapping _Nat
| 172
|
uhcHealthCheckVersion = lens _uhcHealthCheckVersion (\ s a -> s{_uhcHealthCheckVersion = a}) . mapping _Nat
| 107
| true
| true
| 0
| 10
| 71
| 57
| 32
| 25
| null | null |
siddhanathan/ghc
|
compiler/cmm/CmmNode.hs
|
bsd-3-clause
|
foldExp f (CmmCall {cml_target=tgt}) z = f tgt z
| 59
|
foldExp f (CmmCall {cml_target=tgt}) z = f tgt z
| 59
|
foldExp f (CmmCall {cml_target=tgt}) z = f tgt z
| 59
| false
| false
| 1
| 7
| 19
| 36
| 15
| 21
| null | null |
eggzilla/Taxonomy
|
Biobase/Taxonomy/Visualization.hs
|
gpl-3.0
|
-- | Colors from color list are selected according to in which of the compared trees the node is contained.
selectColors :: [Int] -> [GVA.Color] -> GVAC.ColorList
selectColors inTrees currentColorList = GVAC.toColorList (map (\i -> currentColorList !! i) inTrees)
| 263
|
selectColors :: [Int] -> [GVA.Color] -> GVAC.ColorList
selectColors inTrees currentColorList = GVAC.toColorList (map (\i -> currentColorList !! i) inTrees)
| 155
|
selectColors inTrees currentColorList = GVAC.toColorList (map (\i -> currentColorList !! i) inTrees)
| 100
| true
| true
| 0
| 10
| 38
| 60
| 32
| 28
| null | null |
bens/libmpd-haskell
|
tests/Network/MPD/Applicative/CurrentPlaylistSpec.hs
|
lgpl-2.1
|
spec :: Spec
spec = do
describe "addId" $ do
it "adds a song to the playlist (non-recursive) and returns the song id" $ do
addId "dir/Foo-Bar.ogg" Nothing
`with` [("addid \"dir/Foo-Bar.ogg\"", Right "Id: 20\nOK")]
`shouldBe` (Right $ Id 20)
it "takes and optional position" $ do
addId "dir/Foo-Bar.ogg" (Just 5)
`with` [("addid \"dir/Foo-Bar.ogg\" 5", Right "Id: 20\nOK")]
`shouldBe` (Right $ Id 20)
describe "add" $ do
it "adds a url to current playlist" $ do
add "foo"
`with` [("add \"foo\"", Right "OK")]
`shouldBe` Right ()
describe "clear" $ do
it "clears current play list" $ do
clear
`with` [("clear", Right "OK")]
`shouldBe` Right ()
describe "delete" $ do
it "deletes a song from the playlist" $ do
delete (10 :: Int)
`with` [("delete 10", Right "OK")]
`shouldBe` Right ()
describe "deleteRange" $ do
it "deletes a range of songs from the playlist" $ do
deleteRange (Range 10 20)
`with` [("delete 10:20", Right "OK")]
`shouldBe` Right ()
describe "deleteId" $ do
it "deletes song with given id from the playlist" $ do
deleteId (Id 23)
`with` [("deleteid 23", Right "OK")]
`shouldBe` Right ()
describe "move" $ do
it "moves a song to a given position in the playlist" $ do
move 23 42
`with` [("move 23 42", Right "OK")]
`shouldBe` Right ()
describe "moveRange" $ do
it "moves a range of songs to a given position in the playlist" $ do
moveRange (Range 10 20) 23
`with` [("move 10:20 23", Right "OK")]
`shouldBe` Right ()
describe "moveId" $ do
it "move song with given id within the playlist" $ do
moveId (Id 23) 10
`with` [("moveid 23 10", Right "OK")]
`shouldBe` Right ()
-- XXX: generalize to arbitrary SongS and Query
describe "playlistFind" $ do
it "searches for songs in the current playlist" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistFind (Artist =? "Foo")
`with` [("playlistfind Artist \"Foo\"", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
-- XXX: generalize to arbitrary SongS
describe "playlistInfo" $ do
it "retrieves metadata for all songs in the current playlist" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistInfo Nothing
`with` [("playlistinfo", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
it "can optionally return only metadata for a position" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj ++ "OK"
playlistInfo (Just 1)
`with` [("playlistinfo 1", Right resp)]
`shouldBe` Right [obj]
describe "playlistInfoRange" $ do
it "is like playlistInfo but can restrict to a range of songs" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj ++ "OK"
playlistInfoRange (Just $ Range 0 1)
`with` [("playlistinfo 0:1", Right resp)]
`shouldBe` Right [obj]
-- XXX: generlize to arbitrary SongS
describe "playlistId" $ do
it "retrieves metadata for all songs in the current playlist" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistId Nothing
`with` [("playlistid", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
it "can optionally return info only for a position" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistId (Just $ Id 0)
`with` [("playlistid 0", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
describe "playlistSearch" $ do
it "returns songs matching an inexact query" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistSearch (Title =? "Foo")
`with` [("playlistsearch Title \"Foo\"", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
describe "plChanges" $ do
it "returns songs that have changed since the given playlist version" $ do
let obj = defaultSong "foo.ogg"
plChanges 1
`with` [("plchanges 1"
, Right (unparse obj ++ "OK"))
]
`shouldBe` Right [obj]
describe "plChangesPosId" $ do
it "is like plChanges but only returns positions and ids" $ do
plChangesPosId 1
`with` [("plchangesposid 1"
, Right "cpos: 0\n\
\Id: 0\n\
\OK")]
`shouldBe` Right [(0, Id 0)]
{- XXX: doesn't work
it "fails on weird input" $ do
plChangesPosId 10
`with` [("plchangesposid 10", Right "cpos: foo\nId: bar\nOK")]
`shouldBe` Left (Unexpected "[(\"cpos\",\"foo\"),(\"Id\",\"bar\")]")
-}
describe "shuffle" $ do
it "shuffles the current playlist" $ do
shuffle Nothing
`with` [("shuffle", Right "OK")]
`shouldBe` Right ()
it "optionally shuffles a selection of the playlist" $ do
shuffle (Just $ Range 15 25)
`with` [("shuffle 15:25", Right "OK")]
`shouldBe` Right ()
describe "swap" $ do
it "swaps two playlist positions" $ do
swap 1 2
`with` [("swap 1 2", Right "OK")]
`shouldBe` Right ()
describe "swapId" $ do
it "swaps two playlist ids" $ do
swapId (Id 1) (Id 2)
`with` [("swapid 1 2", Right "OK")]
`shouldBe` Right ()
| 5,424
|
spec :: Spec
spec = do
describe "addId" $ do
it "adds a song to the playlist (non-recursive) and returns the song id" $ do
addId "dir/Foo-Bar.ogg" Nothing
`with` [("addid \"dir/Foo-Bar.ogg\"", Right "Id: 20\nOK")]
`shouldBe` (Right $ Id 20)
it "takes and optional position" $ do
addId "dir/Foo-Bar.ogg" (Just 5)
`with` [("addid \"dir/Foo-Bar.ogg\" 5", Right "Id: 20\nOK")]
`shouldBe` (Right $ Id 20)
describe "add" $ do
it "adds a url to current playlist" $ do
add "foo"
`with` [("add \"foo\"", Right "OK")]
`shouldBe` Right ()
describe "clear" $ do
it "clears current play list" $ do
clear
`with` [("clear", Right "OK")]
`shouldBe` Right ()
describe "delete" $ do
it "deletes a song from the playlist" $ do
delete (10 :: Int)
`with` [("delete 10", Right "OK")]
`shouldBe` Right ()
describe "deleteRange" $ do
it "deletes a range of songs from the playlist" $ do
deleteRange (Range 10 20)
`with` [("delete 10:20", Right "OK")]
`shouldBe` Right ()
describe "deleteId" $ do
it "deletes song with given id from the playlist" $ do
deleteId (Id 23)
`with` [("deleteid 23", Right "OK")]
`shouldBe` Right ()
describe "move" $ do
it "moves a song to a given position in the playlist" $ do
move 23 42
`with` [("move 23 42", Right "OK")]
`shouldBe` Right ()
describe "moveRange" $ do
it "moves a range of songs to a given position in the playlist" $ do
moveRange (Range 10 20) 23
`with` [("move 10:20 23", Right "OK")]
`shouldBe` Right ()
describe "moveId" $ do
it "move song with given id within the playlist" $ do
moveId (Id 23) 10
`with` [("moveid 23 10", Right "OK")]
`shouldBe` Right ()
-- XXX: generalize to arbitrary SongS and Query
describe "playlistFind" $ do
it "searches for songs in the current playlist" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistFind (Artist =? "Foo")
`with` [("playlistfind Artist \"Foo\"", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
-- XXX: generalize to arbitrary SongS
describe "playlistInfo" $ do
it "retrieves metadata for all songs in the current playlist" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistInfo Nothing
`with` [("playlistinfo", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
it "can optionally return only metadata for a position" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj ++ "OK"
playlistInfo (Just 1)
`with` [("playlistinfo 1", Right resp)]
`shouldBe` Right [obj]
describe "playlistInfoRange" $ do
it "is like playlistInfo but can restrict to a range of songs" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj ++ "OK"
playlistInfoRange (Just $ Range 0 1)
`with` [("playlistinfo 0:1", Right resp)]
`shouldBe` Right [obj]
-- XXX: generlize to arbitrary SongS
describe "playlistId" $ do
it "retrieves metadata for all songs in the current playlist" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistId Nothing
`with` [("playlistid", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
it "can optionally return info only for a position" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistId (Just $ Id 0)
`with` [("playlistid 0", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
describe "playlistSearch" $ do
it "returns songs matching an inexact query" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistSearch (Title =? "Foo")
`with` [("playlistsearch Title \"Foo\"", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
describe "plChanges" $ do
it "returns songs that have changed since the given playlist version" $ do
let obj = defaultSong "foo.ogg"
plChanges 1
`with` [("plchanges 1"
, Right (unparse obj ++ "OK"))
]
`shouldBe` Right [obj]
describe "plChangesPosId" $ do
it "is like plChanges but only returns positions and ids" $ do
plChangesPosId 1
`with` [("plchangesposid 1"
, Right "cpos: 0\n\
\Id: 0\n\
\OK")]
`shouldBe` Right [(0, Id 0)]
{- XXX: doesn't work
it "fails on weird input" $ do
plChangesPosId 10
`with` [("plchangesposid 10", Right "cpos: foo\nId: bar\nOK")]
`shouldBe` Left (Unexpected "[(\"cpos\",\"foo\"),(\"Id\",\"bar\")]")
-}
describe "shuffle" $ do
it "shuffles the current playlist" $ do
shuffle Nothing
`with` [("shuffle", Right "OK")]
`shouldBe` Right ()
it "optionally shuffles a selection of the playlist" $ do
shuffle (Just $ Range 15 25)
`with` [("shuffle 15:25", Right "OK")]
`shouldBe` Right ()
describe "swap" $ do
it "swaps two playlist positions" $ do
swap 1 2
`with` [("swap 1 2", Right "OK")]
`shouldBe` Right ()
describe "swapId" $ do
it "swaps two playlist ids" $ do
swapId (Id 1) (Id 2)
`with` [("swapid 1 2", Right "OK")]
`shouldBe` Right ()
| 5,424
|
spec = do
describe "addId" $ do
it "adds a song to the playlist (non-recursive) and returns the song id" $ do
addId "dir/Foo-Bar.ogg" Nothing
`with` [("addid \"dir/Foo-Bar.ogg\"", Right "Id: 20\nOK")]
`shouldBe` (Right $ Id 20)
it "takes and optional position" $ do
addId "dir/Foo-Bar.ogg" (Just 5)
`with` [("addid \"dir/Foo-Bar.ogg\" 5", Right "Id: 20\nOK")]
`shouldBe` (Right $ Id 20)
describe "add" $ do
it "adds a url to current playlist" $ do
add "foo"
`with` [("add \"foo\"", Right "OK")]
`shouldBe` Right ()
describe "clear" $ do
it "clears current play list" $ do
clear
`with` [("clear", Right "OK")]
`shouldBe` Right ()
describe "delete" $ do
it "deletes a song from the playlist" $ do
delete (10 :: Int)
`with` [("delete 10", Right "OK")]
`shouldBe` Right ()
describe "deleteRange" $ do
it "deletes a range of songs from the playlist" $ do
deleteRange (Range 10 20)
`with` [("delete 10:20", Right "OK")]
`shouldBe` Right ()
describe "deleteId" $ do
it "deletes song with given id from the playlist" $ do
deleteId (Id 23)
`with` [("deleteid 23", Right "OK")]
`shouldBe` Right ()
describe "move" $ do
it "moves a song to a given position in the playlist" $ do
move 23 42
`with` [("move 23 42", Right "OK")]
`shouldBe` Right ()
describe "moveRange" $ do
it "moves a range of songs to a given position in the playlist" $ do
moveRange (Range 10 20) 23
`with` [("move 10:20 23", Right "OK")]
`shouldBe` Right ()
describe "moveId" $ do
it "move song with given id within the playlist" $ do
moveId (Id 23) 10
`with` [("moveid 23 10", Right "OK")]
`shouldBe` Right ()
-- XXX: generalize to arbitrary SongS and Query
describe "playlistFind" $ do
it "searches for songs in the current playlist" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistFind (Artist =? "Foo")
`with` [("playlistfind Artist \"Foo\"", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
-- XXX: generalize to arbitrary SongS
describe "playlistInfo" $ do
it "retrieves metadata for all songs in the current playlist" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistInfo Nothing
`with` [("playlistinfo", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
it "can optionally return only metadata for a position" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj ++ "OK"
playlistInfo (Just 1)
`with` [("playlistinfo 1", Right resp)]
`shouldBe` Right [obj]
describe "playlistInfoRange" $ do
it "is like playlistInfo but can restrict to a range of songs" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj ++ "OK"
playlistInfoRange (Just $ Range 0 1)
`with` [("playlistinfo 0:1", Right resp)]
`shouldBe` Right [obj]
-- XXX: generlize to arbitrary SongS
describe "playlistId" $ do
it "retrieves metadata for all songs in the current playlist" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistId Nothing
`with` [("playlistid", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
it "can optionally return info only for a position" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistId (Just $ Id 0)
`with` [("playlistid 0", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
describe "playlistSearch" $ do
it "returns songs matching an inexact query" $ do
let obj = defaultSong "Foo.ogg"
resp = unparse obj
playlistSearch (Title =? "Foo")
`with` [("playlistsearch Title \"Foo\"", Right $ resp ++ "\nOK")]
`shouldBe` Right [obj]
describe "plChanges" $ do
it "returns songs that have changed since the given playlist version" $ do
let obj = defaultSong "foo.ogg"
plChanges 1
`with` [("plchanges 1"
, Right (unparse obj ++ "OK"))
]
`shouldBe` Right [obj]
describe "plChangesPosId" $ do
it "is like plChanges but only returns positions and ids" $ do
plChangesPosId 1
`with` [("plchangesposid 1"
, Right "cpos: 0\n\
\Id: 0\n\
\OK")]
`shouldBe` Right [(0, Id 0)]
{- XXX: doesn't work
it "fails on weird input" $ do
plChangesPosId 10
`with` [("plchangesposid 10", Right "cpos: foo\nId: bar\nOK")]
`shouldBe` Left (Unexpected "[(\"cpos\",\"foo\"),(\"Id\",\"bar\")]")
-}
describe "shuffle" $ do
it "shuffles the current playlist" $ do
shuffle Nothing
`with` [("shuffle", Right "OK")]
`shouldBe` Right ()
it "optionally shuffles a selection of the playlist" $ do
shuffle (Just $ Range 15 25)
`with` [("shuffle 15:25", Right "OK")]
`shouldBe` Right ()
describe "swap" $ do
it "swaps two playlist positions" $ do
swap 1 2
`with` [("swap 1 2", Right "OK")]
`shouldBe` Right ()
describe "swapId" $ do
it "swaps two playlist ids" $ do
swapId (Id 1) (Id 2)
`with` [("swapid 1 2", Right "OK")]
`shouldBe` Right ()
| 5,411
| false
| true
| 0
| 77
| 1,637
| 1,588
| 789
| 799
| null | null |
tjakway/ghcjvm
|
compiler/prelude/TysWiredIn.hs
|
bsd-3-clause
|
wordDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "W#") wordDataConKey wordDataCon
| 108
|
wordDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "W#") wordDataConKey wordDataCon
| 108
|
wordDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "W#") wordDataConKey wordDataCon
| 108
| false
| false
| 1
| 7
| 17
| 26
| 11
| 15
| null | null |
lukexi/text-gl
|
src/Graphics/GL/TextBuffer/TextBuffer.hs
|
bsd-2-clause
|
validateCursor :: Cursor -> TextBuffer -> Cursor
validateCursor cursor@(Cursor lineNum colNum) textBuffer@TextBuffer{..}
| lineNum >= maxLine = cursorToEndOfLine maxLine textBuffer
| colNum >= maxLineCol = cursorToEndOfLine lineNum textBuffer
| otherwise = cursor
where maxLine = length bufText - 1
maxLineCol = lineLength lineNum bufText
| 387
|
validateCursor :: Cursor -> TextBuffer -> Cursor
validateCursor cursor@(Cursor lineNum colNum) textBuffer@TextBuffer{..}
| lineNum >= maxLine = cursorToEndOfLine maxLine textBuffer
| colNum >= maxLineCol = cursorToEndOfLine lineNum textBuffer
| otherwise = cursor
where maxLine = length bufText - 1
maxLineCol = lineLength lineNum bufText
| 387
|
validateCursor cursor@(Cursor lineNum colNum) textBuffer@TextBuffer{..}
| lineNum >= maxLine = cursorToEndOfLine maxLine textBuffer
| colNum >= maxLineCol = cursorToEndOfLine lineNum textBuffer
| otherwise = cursor
where maxLine = length bufText - 1
maxLineCol = lineLength lineNum bufText
| 338
| false
| true
| 3
| 8
| 92
| 110
| 53
| 57
| null | null |
christiaanb/DepCore
|
Test2.hs
|
bsd-2-clause
|
force :: (MonadError String m, Eq n)
=> Env' n a
-> Value n a
-> m (Value n a)
force env (VBox (Boxed c)) = eval env c
| 136
|
force :: (MonadError String m, Eq n)
=> Env' n a
-> Value n a
-> m (Value n a)
force env (VBox (Boxed c)) = eval env c
| 136
|
force env (VBox (Boxed c)) = eval env c
| 39
| false
| true
| 0
| 10
| 46
| 79
| 38
| 41
| null | null |
forked-upstream-packages-for-ghcjs/ghc
|
compiler/deSugar/Check.hs
|
bsd-3-clause
|
process_literals :: [HsLit] -> [(EqnNo, EquationInfo)] -> ([ExhaustivePat],EqnSet)
process_literals used_lits qs
| null default_eqns = ASSERT( not (null qs) ) ([make_row_vars used_lits (head qs)] ++ pats,indexs)
| otherwise = (pats_default,indexs_default)
where
(pats,indexs) = process_explicit_literals used_lits qs
default_eqns = ASSERT2( okGroup qs, pprGroup qs )
[remove_var q | q <- qs, is_var (firstPatN q)]
(pats',indexs') = check' default_eqns
pats_default = [(nlWildPatName:ps,constraints) |
(ps,constraints) <- (pats')] ++ pats
indexs_default = unionUniqSets indexs' indexs
{-
Here we have selected the literal and we will select all the equations that
begins for that literal and create a new matrix.
-}
| 843
|
process_literals :: [HsLit] -> [(EqnNo, EquationInfo)] -> ([ExhaustivePat],EqnSet)
process_literals used_lits qs
| null default_eqns = ASSERT( not (null qs) ) ([make_row_vars used_lits (head qs)] ++ pats,indexs)
| otherwise = (pats_default,indexs_default)
where
(pats,indexs) = process_explicit_literals used_lits qs
default_eqns = ASSERT2( okGroup qs, pprGroup qs )
[remove_var q | q <- qs, is_var (firstPatN q)]
(pats',indexs') = check' default_eqns
pats_default = [(nlWildPatName:ps,constraints) |
(ps,constraints) <- (pats')] ++ pats
indexs_default = unionUniqSets indexs' indexs
{-
Here we have selected the literal and we will select all the equations that
begins for that literal and create a new matrix.
-}
| 843
|
process_literals used_lits qs
| null default_eqns = ASSERT( not (null qs) ) ([make_row_vars used_lits (head qs)] ++ pats,indexs)
| otherwise = (pats_default,indexs_default)
where
(pats,indexs) = process_explicit_literals used_lits qs
default_eqns = ASSERT2( okGroup qs, pprGroup qs )
[remove_var q | q <- qs, is_var (firstPatN q)]
(pats',indexs') = check' default_eqns
pats_default = [(nlWildPatName:ps,constraints) |
(ps,constraints) <- (pats')] ++ pats
indexs_default = unionUniqSets indexs' indexs
{-
Here we have selected the literal and we will select all the equations that
begins for that literal and create a new matrix.
-}
| 760
| false
| true
| 1
| 12
| 224
| 246
| 130
| 116
| null | null |
elitak/hs-datahand
|
stm32f10x/hs_src/Data/Accessor/Tuple.hs
|
gpl-3.0
|
{- | Access to the second value of a triple. -}
second3 :: Accessor.T (a,b,c) b
second3 = Accessor.fromLens $ \(x,yOld,z) -> (yOld, \yNew -> (x,yNew,z))
| 152
|
second3 :: Accessor.T (a,b,c) b
second3 = Accessor.fromLens $ \(x,yOld,z) -> (yOld, \yNew -> (x,yNew,z))
| 104
|
second3 = Accessor.fromLens $ \(x,yOld,z) -> (yOld, \yNew -> (x,yNew,z))
| 72
| true
| true
| 1
| 10
| 25
| 72
| 41
| 31
| null | null |
iu-parfunc/AutoObsidian
|
src/Auto/BitString.hs
|
bsd-3-clause
|
numToBits :: Int -> [Int]
numToBits 0 = []
| 42
|
numToBits :: Int -> [Int]
numToBits 0 = []
| 42
|
numToBits 0 = []
| 16
| false
| true
| 0
| 8
| 8
| 29
| 13
| 16
| null | null |
lymar/hastache
|
Text/Hastache.hs
|
bsd-3-clause
|
unquoteCTag = "}}}" :: Text
| 27
|
unquoteCTag = "}}}" :: Text
| 27
|
unquoteCTag = "}}}" :: Text
| 27
| false
| false
| 0
| 4
| 4
| 9
| 5
| 4
| null | null |
phischu/fragnix
|
tests/packages/scotty/Data.Attoparsec.Internal.hs
|
bsd-3-clause
|
-- | Concatenate a monoid after reversing its elements. Used to
-- glue together a series of textual chunks that have been accumulated
-- \"backwards\".
concatReverse :: Monoid m => [m] -> m
concatReverse [x] = x
| 213
|
concatReverse :: Monoid m => [m] -> m
concatReverse [x] = x
| 59
|
concatReverse [x] = x
| 21
| true
| true
| 0
| 7
| 37
| 34
| 19
| 15
| null | null |
carlohamalainen/ghc-mod
|
Language/Haskell/GhcMod/GhcPkg.hs
|
bsd-3-clause
|
-- | Get path to sandbox package db
getSandboxDb :: FilePath -- ^ Path to the cabal package root directory
-- (containing the @cabal.sandbox.config@ file)
-> IO FilePath
getSandboxDb cdir = getSandboxDbDir (cdir </> "cabal.sandbox.config")
| 277
|
getSandboxDb :: FilePath -- ^ Path to the cabal package root directory
-- (containing the @cabal.sandbox.config@ file)
-> IO FilePath
getSandboxDb cdir = getSandboxDbDir (cdir </> "cabal.sandbox.config")
| 241
|
getSandboxDb cdir = getSandboxDbDir (cdir </> "cabal.sandbox.config")
| 69
| true
| true
| 0
| 7
| 72
| 34
| 18
| 16
| null | null |
wilbowma/accelerate
|
Data/Array/Accelerate/CUDA/CodeGen.hs
|
bsd-3-clause
|
codeGenIntegralTex (TypeInt32 _) = [CTypeDef (internalIdent "TexInt32") internalNode]
| 89
|
codeGenIntegralTex (TypeInt32 _) = [CTypeDef (internalIdent "TexInt32") internalNode]
| 89
|
codeGenIntegralTex (TypeInt32 _) = [CTypeDef (internalIdent "TexInt32") internalNode]
| 89
| false
| false
| 0
| 8
| 11
| 29
| 14
| 15
| null | null |
JoeMShanahan/blizzard-haskell-api
|
test/Spec.hs
|
bsd-3-clause
|
main :: IO ()
main = putStrLn "Test suite not yet implemented"
| 62
|
main :: IO ()
main = putStrLn "Test suite not yet implemented"
| 62
|
main = putStrLn "Test suite not yet implemented"
| 48
| false
| true
| 0
| 6
| 11
| 19
| 9
| 10
| null | null |
rueshyna/gogol
|
gogol-admin-directory/gen/Network/Google/Directory/Types/Product.hs
|
mpl-2.0
|
-- | The type of the resource. This is always
-- admin#directory#verificationCodesList.
vKind :: Lens' VerificationCodes Text
vKind = lens _vKind (\ s a -> s{_vKind = a})
| 170
|
vKind :: Lens' VerificationCodes Text
vKind = lens _vKind (\ s a -> s{_vKind = a})
| 82
|
vKind = lens _vKind (\ s a -> s{_vKind = a})
| 44
| true
| true
| 0
| 9
| 27
| 41
| 23
| 18
| null | null |
spetz911/progames
|
nehe-tuts-master/lesson11.hs
|
mit
|
drawScene :: GLuint -> IORef GLfloat -> IORef GLfloat -> IORef GLfloat
-> Points -> IORef Int -> IORef Int -> GLFW.Window -> IO ()
drawScene tex xrot yrot zrot points wiggleRef offsetRef _ = do
glClear $ fromIntegral $ gl_COLOR_BUFFER_BIT
.|. gl_DEPTH_BUFFER_BIT
glLoadIdentity
glTranslatef 0 0 (-12)
xr <- readIORef xrot
yr <- readIORef yrot
zr <- readIORef zrot
offset <- readIORef offsetRef
wiggle <- readIORef wiggleRef
glRotatef xr 1 0 0
glRotatef yr 0 1 0
glRotatef zr 0 0 1
glBindTexture gl_TEXTURE_2D tex
glBegin gl_QUADS
forM_ [(x,y) | x <- [0..43], y<-[0..43]] $ \(x,y) -> do
let x' = (x+offset) `mod` 45
fx = fromIntegral x/44 :: GLfloat
fy = fromIntegral y/44 :: GLfloat
fxb = fromIntegral (x+1)/44 :: GLfloat
fyb = fromIntegral (y+1)/44 :: GLfloat
glTexCoord2f fx fy
join $ glVertex3f <$> (readArray points (x,y,0))
<*> (readArray points (x,y,1))
<*> (readArray points (x',y,2))
glTexCoord2f fx fyb
join $ glVertex3f <$> (readArray points (x,y+1,0))
<*> (readArray points (x,y+1,1))
<*> (readArray points (x',y+1,2))
glTexCoord2f fxb fyb
join $ glVertex3f <$> (readArray points (x+1,y+1,0))
<*> (readArray points (x+1,y+1,1))
<*> (readArray points ((x'+1)`mod`45,y+1,2))
glTexCoord2f fxb fy
join $ glVertex3f <$> (readArray points (x+1,y,0))
<*> (readArray points (x+1,y,1))
<*> (readArray points ((x'+1)`mod`45,y,2))
glEnd
writeIORef xrot $! xr + 0.3
writeIORef yrot $! yr + 0.2
writeIORef zrot $! zr + 0.4
when (wiggle == 2) $ do
writeIORef offsetRef $! offset + 1
writeIORef wiggleRef $! 0
w <- readIORef wiggleRef
writeIORef wiggleRef $! w + 1
glFlush
| 1,912
|
drawScene :: GLuint -> IORef GLfloat -> IORef GLfloat -> IORef GLfloat
-> Points -> IORef Int -> IORef Int -> GLFW.Window -> IO ()
drawScene tex xrot yrot zrot points wiggleRef offsetRef _ = do
glClear $ fromIntegral $ gl_COLOR_BUFFER_BIT
.|. gl_DEPTH_BUFFER_BIT
glLoadIdentity
glTranslatef 0 0 (-12)
xr <- readIORef xrot
yr <- readIORef yrot
zr <- readIORef zrot
offset <- readIORef offsetRef
wiggle <- readIORef wiggleRef
glRotatef xr 1 0 0
glRotatef yr 0 1 0
glRotatef zr 0 0 1
glBindTexture gl_TEXTURE_2D tex
glBegin gl_QUADS
forM_ [(x,y) | x <- [0..43], y<-[0..43]] $ \(x,y) -> do
let x' = (x+offset) `mod` 45
fx = fromIntegral x/44 :: GLfloat
fy = fromIntegral y/44 :: GLfloat
fxb = fromIntegral (x+1)/44 :: GLfloat
fyb = fromIntegral (y+1)/44 :: GLfloat
glTexCoord2f fx fy
join $ glVertex3f <$> (readArray points (x,y,0))
<*> (readArray points (x,y,1))
<*> (readArray points (x',y,2))
glTexCoord2f fx fyb
join $ glVertex3f <$> (readArray points (x,y+1,0))
<*> (readArray points (x,y+1,1))
<*> (readArray points (x',y+1,2))
glTexCoord2f fxb fyb
join $ glVertex3f <$> (readArray points (x+1,y+1,0))
<*> (readArray points (x+1,y+1,1))
<*> (readArray points ((x'+1)`mod`45,y+1,2))
glTexCoord2f fxb fy
join $ glVertex3f <$> (readArray points (x+1,y,0))
<*> (readArray points (x+1,y,1))
<*> (readArray points ((x'+1)`mod`45,y,2))
glEnd
writeIORef xrot $! xr + 0.3
writeIORef yrot $! yr + 0.2
writeIORef zrot $! zr + 0.4
when (wiggle == 2) $ do
writeIORef offsetRef $! offset + 1
writeIORef wiggleRef $! 0
w <- readIORef wiggleRef
writeIORef wiggleRef $! w + 1
glFlush
| 1,911
|
drawScene tex xrot yrot zrot points wiggleRef offsetRef _ = do
glClear $ fromIntegral $ gl_COLOR_BUFFER_BIT
.|. gl_DEPTH_BUFFER_BIT
glLoadIdentity
glTranslatef 0 0 (-12)
xr <- readIORef xrot
yr <- readIORef yrot
zr <- readIORef zrot
offset <- readIORef offsetRef
wiggle <- readIORef wiggleRef
glRotatef xr 1 0 0
glRotatef yr 0 1 0
glRotatef zr 0 0 1
glBindTexture gl_TEXTURE_2D tex
glBegin gl_QUADS
forM_ [(x,y) | x <- [0..43], y<-[0..43]] $ \(x,y) -> do
let x' = (x+offset) `mod` 45
fx = fromIntegral x/44 :: GLfloat
fy = fromIntegral y/44 :: GLfloat
fxb = fromIntegral (x+1)/44 :: GLfloat
fyb = fromIntegral (y+1)/44 :: GLfloat
glTexCoord2f fx fy
join $ glVertex3f <$> (readArray points (x,y,0))
<*> (readArray points (x,y,1))
<*> (readArray points (x',y,2))
glTexCoord2f fx fyb
join $ glVertex3f <$> (readArray points (x,y+1,0))
<*> (readArray points (x,y+1,1))
<*> (readArray points (x',y+1,2))
glTexCoord2f fxb fyb
join $ glVertex3f <$> (readArray points (x+1,y+1,0))
<*> (readArray points (x+1,y+1,1))
<*> (readArray points ((x'+1)`mod`45,y+1,2))
glTexCoord2f fxb fy
join $ glVertex3f <$> (readArray points (x+1,y,0))
<*> (readArray points (x+1,y,1))
<*> (readArray points ((x'+1)`mod`45,y,2))
glEnd
writeIORef xrot $! xr + 0.3
writeIORef yrot $! yr + 0.2
writeIORef zrot $! zr + 0.4
when (wiggle == 2) $ do
writeIORef offsetRef $! offset + 1
writeIORef wiggleRef $! 0
w <- readIORef wiggleRef
writeIORef wiggleRef $! w + 1
glFlush
| 1,770
| false
| true
| 0
| 17
| 590
| 858
| 428
| 430
| null | null |
sebmathguy/icfp-2015
|
library/Search.hs
|
mit
|
applyMoveAngle (Rotate r) = applyTurn r
| 39
|
applyMoveAngle (Rotate r) = applyTurn r
| 39
|
applyMoveAngle (Rotate r) = applyTurn r
| 39
| false
| false
| 0
| 7
| 5
| 18
| 8
| 10
| null | null |
beni55/bayes-stack
|
network-topic-models/BayesStack/Models/Topic/CitationInfluenceNoTopics.hs
|
bsd-3-clause
|
randomInitCitingUU :: NetData -> CitingNodeItem -> StateT ModelInit RVar ()
randomInitCitingUU d cni@(Citing ni) =
let (n,_) = d ^. dNodeItems . at' ni
in case d ^. dCitingNodes . at' (Citing n) of
a | S.null a -> do
modify' $ M.insert cni OwnSetting
citedNodes -> do
s <- lift $ randomElement [Shared, Own]
c <- lift $ randomElement $ toList citedNodes
modify' $ M.insert cni $
case s of Shared -> SharedSetting c
Own -> OwnSetting
| 574
|
randomInitCitingUU :: NetData -> CitingNodeItem -> StateT ModelInit RVar ()
randomInitCitingUU d cni@(Citing ni) =
let (n,_) = d ^. dNodeItems . at' ni
in case d ^. dCitingNodes . at' (Citing n) of
a | S.null a -> do
modify' $ M.insert cni OwnSetting
citedNodes -> do
s <- lift $ randomElement [Shared, Own]
c <- lift $ randomElement $ toList citedNodes
modify' $ M.insert cni $
case s of Shared -> SharedSetting c
Own -> OwnSetting
| 574
|
randomInitCitingUU d cni@(Citing ni) =
let (n,_) = d ^. dNodeItems . at' ni
in case d ^. dCitingNodes . at' (Citing n) of
a | S.null a -> do
modify' $ M.insert cni OwnSetting
citedNodes -> do
s <- lift $ randomElement [Shared, Own]
c <- lift $ randomElement $ toList citedNodes
modify' $ M.insert cni $
case s of Shared -> SharedSetting c
Own -> OwnSetting
| 498
| false
| true
| 0
| 16
| 219
| 202
| 95
| 107
| null | null |
shayan-najd/HsParser
|
U/Outputable.hs
|
gpl-3.0
|
quote d = SDoc $ U.Pretty.quote . runSDoc d
| 51
|
quote d = SDoc $ U.Pretty.quote . runSDoc d
| 51
|
quote d = SDoc $ U.Pretty.quote . runSDoc d
| 51
| false
| false
| 0
| 7
| 16
| 23
| 11
| 12
| null | null |
rahulmutt/ghcvm
|
compiler/Eta/BasicTypes/Id.hs
|
bsd-3-clause
|
-- | Create a template local for a series of types
mkTemplateLocals :: [Type] -> [Id]
mkTemplateLocals = mkTemplateLocalsNum 1
| 126
|
mkTemplateLocals :: [Type] -> [Id]
mkTemplateLocals = mkTemplateLocalsNum 1
| 75
|
mkTemplateLocals = mkTemplateLocalsNum 1
| 40
| true
| true
| 0
| 8
| 19
| 31
| 15
| 16
| null | null |
qwfy/fsquery
|
src/System/FSQuery/Parser.hs
|
mit
|
genGroupGuard = do
x <- genAtomGuards
return $ "(" ++ x ++ ")"
| 70
|
genGroupGuard = do
x <- genAtomGuards
return $ "(" ++ x ++ ")"
| 70
|
genGroupGuard = do
x <- genAtomGuards
return $ "(" ++ x ++ ")"
| 70
| false
| false
| 0
| 9
| 20
| 28
| 13
| 15
| null | null |
brendanhay/gogol
|
gogol-cloudprivatecatalogproducer/gen/Network/Google/Resource/CloudPrivateCatalogProducer/Operations/List.hs
|
mpl-2.0
|
-- | Creates a value of 'OperationsList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'olXgafv'
--
-- * 'olUploadProtocol'
--
-- * 'olAccessToken'
--
-- * 'olUploadType'
--
-- * 'olName'
--
-- * 'olFilter'
--
-- * 'olPageToken'
--
-- * 'olPageSize'
--
-- * 'olCallback'
operationsList
:: OperationsList
operationsList =
OperationsList'
{ _olXgafv = Nothing
, _olUploadProtocol = Nothing
, _olAccessToken = Nothing
, _olUploadType = Nothing
, _olName = Nothing
, _olFilter = Nothing
, _olPageToken = Nothing
, _olPageSize = Nothing
, _olCallback = Nothing
}
| 690
|
operationsList
:: OperationsList
operationsList =
OperationsList'
{ _olXgafv = Nothing
, _olUploadProtocol = Nothing
, _olAccessToken = Nothing
, _olUploadType = Nothing
, _olName = Nothing
, _olFilter = Nothing
, _olPageToken = Nothing
, _olPageSize = Nothing
, _olCallback = Nothing
}
| 332
|
operationsList =
OperationsList'
{ _olXgafv = Nothing
, _olUploadProtocol = Nothing
, _olAccessToken = Nothing
, _olUploadType = Nothing
, _olName = Nothing
, _olFilter = Nothing
, _olPageToken = Nothing
, _olPageSize = Nothing
, _olCallback = Nothing
}
| 295
| true
| true
| 0
| 7
| 154
| 98
| 66
| 32
| null | null |
unknownloner/aoc2016
|
src/Days/Day1.hs
|
mit
|
part1 :: [(Char, Int)] -> Int
part1 = travelDistance . view pos . last . stops
| 78
|
part1 :: [(Char, Int)] -> Int
part1 = travelDistance . view pos . last . stops
| 78
|
part1 = travelDistance . view pos . last . stops
| 48
| false
| true
| 0
| 8
| 15
| 46
| 22
| 24
| null | null |
j-mueller/hldb
|
webapp/VirtualHom/Svg.hs
|
bsd-3-clause
|
path_ :: Element
path_ = makeSvgElem "path"
| 43
|
path_ :: Element
path_ = makeSvgElem "path"
| 43
|
path_ = makeSvgElem "path"
| 26
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
bjornbm/aeq
|
tests/Tests.hs
|
bsd-3-clause
|
test_sameishSignificandBits_extreme_F1 =
sameishSignificandBits nan (nan :: F) @?= 0
| 88
|
test_sameishSignificandBits_extreme_F1 =
sameishSignificandBits nan (nan :: F) @?= 0
| 88
|
test_sameishSignificandBits_extreme_F1 =
sameishSignificandBits nan (nan :: F) @?= 0
| 88
| false
| false
| 0
| 7
| 12
| 21
| 11
| 10
| null | null |
brendanhay/gogol
|
gogol-bigtableadmin/gen/Network/Google/Resource/BigtableAdmin/Projects/Instances/Create.hs
|
mpl-2.0
|
-- | Required. The unique name of the project in which to create the new
-- instance. Values are of the form \`projects\/{project}\`.
picParent :: Lens' ProjectsInstancesCreate Text
picParent
= lens _picParent (\ s a -> s{_picParent = a})
| 240
|
picParent :: Lens' ProjectsInstancesCreate Text
picParent
= lens _picParent (\ s a -> s{_picParent = a})
| 106
|
picParent
= lens _picParent (\ s a -> s{_picParent = a})
| 58
| true
| true
| 0
| 9
| 40
| 43
| 23
| 20
| null | null |
dimara/ganeti
|
src/Ganeti/OpCodes.hs
|
bsd-2-clause
|
opSummaryVal OpNodeSetParams { opNodeName = s } = Just (fromNonEmpty s)
| 71
|
opSummaryVal OpNodeSetParams { opNodeName = s } = Just (fromNonEmpty s)
| 71
|
opSummaryVal OpNodeSetParams { opNodeName = s } = Just (fromNonEmpty s)
| 71
| false
| false
| 0
| 7
| 10
| 28
| 13
| 15
| null | null |
1yefuwang1/haskell99problems
|
src/H99/BinaryTrees.hs
|
bsd-3-clause
|
minNodes n = 1 + minNodes (n-1) + minNodes (n-2)
| 48
|
minNodes n = 1 + minNodes (n-1) + minNodes (n-2)
| 48
|
minNodes n = 1 + minNodes (n-1) + minNodes (n-2)
| 48
| false
| false
| 0
| 9
| 9
| 37
| 18
| 19
| null | null |
kolmodin/cabal
|
Cabal/Distribution/Compat/Graph.hs
|
bsd-3-clause
|
flattenForest :: Tree.Forest a -> [a]
flattenForest = concatMap Tree.flatten
| 76
|
flattenForest :: Tree.Forest a -> [a]
flattenForest = concatMap Tree.flatten
| 76
|
flattenForest = concatMap Tree.flatten
| 38
| false
| true
| 0
| 7
| 9
| 28
| 14
| 14
| null | null |
JoeyEremondi/utrecht-apa-p1
|
src/Transform/Canonicalize/Setup.hs
|
bsd-3-clause
|
addTypeAlias
:: Module.Name
-> Environment
-> Graph.SCC (String, [String], Type.RawType)
-> Canonicalizer [Doc] Environment
addTypeAlias moduleName env scc =
case Graph.flattenSCC scc of
[(name, tvars, alias)] ->
do alias' <- Env.onError throw (Canonicalize.tipe env alias)
let value = (Var.Canonical (Var.Module moduleName) name, tvars, alias')
return $ env { _aliases = insert name value (_aliases env) }
where
throw err =
let msg = "Problem with type alias '" ++ name ++ "':"
in P.vcat [ P.text msg, P.text err ]
aliases ->
throwError
[ P.vcat
[ P.text (eightyCharLines 0 mutuallyRecursiveMessage)
, indented (map typeAlias aliases)
, P.text (eightyCharLines 0 typeAliasErrorSegue)
, indented (map datatype aliases)
, P.text (eightyCharLines 0 typeAliasErrorExplanation)
]
]
| 998
|
addTypeAlias
:: Module.Name
-> Environment
-> Graph.SCC (String, [String], Type.RawType)
-> Canonicalizer [Doc] Environment
addTypeAlias moduleName env scc =
case Graph.flattenSCC scc of
[(name, tvars, alias)] ->
do alias' <- Env.onError throw (Canonicalize.tipe env alias)
let value = (Var.Canonical (Var.Module moduleName) name, tvars, alias')
return $ env { _aliases = insert name value (_aliases env) }
where
throw err =
let msg = "Problem with type alias '" ++ name ++ "':"
in P.vcat [ P.text msg, P.text err ]
aliases ->
throwError
[ P.vcat
[ P.text (eightyCharLines 0 mutuallyRecursiveMessage)
, indented (map typeAlias aliases)
, P.text (eightyCharLines 0 typeAliasErrorSegue)
, indented (map datatype aliases)
, P.text (eightyCharLines 0 typeAliasErrorExplanation)
]
]
| 998
|
addTypeAlias moduleName env scc =
case Graph.flattenSCC scc of
[(name, tvars, alias)] ->
do alias' <- Env.onError throw (Canonicalize.tipe env alias)
let value = (Var.Canonical (Var.Module moduleName) name, tvars, alias')
return $ env { _aliases = insert name value (_aliases env) }
where
throw err =
let msg = "Problem with type alias '" ++ name ++ "':"
in P.vcat [ P.text msg, P.text err ]
aliases ->
throwError
[ P.vcat
[ P.text (eightyCharLines 0 mutuallyRecursiveMessage)
, indented (map typeAlias aliases)
, P.text (eightyCharLines 0 typeAliasErrorSegue)
, indented (map datatype aliases)
, P.text (eightyCharLines 0 typeAliasErrorExplanation)
]
]
| 858
| false
| true
| 2
| 14
| 332
| 319
| 159
| 160
| null | null |
00tau/statistics
|
Statistics/Sample/KernelDensity.hs
|
bsd-2-clause
|
-- | Gaussian kernel density estimator for one-dimensional data, using
-- the method of Botev et al.
--
-- The result is a pair of vectors, containing:
--
-- * The coordinates of each mesh point. The mesh interval is chosen
-- to be 20% larger than the range of the sample. (To specify the
-- mesh interval, use 'kde_'.)
--
-- * Density estimates at each mesh point.
kde :: Int
-- ^ The number of mesh points to use in the uniform discretization
-- of the interval @(min,max)@. If this value is not a power of
-- two, then it is rounded up to the next power of two.
-> U.Vector Double -> (U.Vector Double, U.Vector Double)
kde n0 xs = kde_ n0 (lo - range / 10) (hi + range / 10) xs
where
(lo,hi) = minMax xs
range | U.length xs <= 1 = 1 -- Unreasonable guess
| otherwise = hi - lo
-- | Gaussian kernel density estimator for one-dimensional data, using
-- the method of Botev et al.
--
-- The result is a pair of vectors, containing:
--
-- * The coordinates of each mesh point.
--
-- * Density estimates at each mesh point.
| 1,083
|
kde :: Int
-- ^ The number of mesh points to use in the uniform discretization
-- of the interval @(min,max)@. If this value is not a power of
-- two, then it is rounded up to the next power of two.
-> U.Vector Double -> (U.Vector Double, U.Vector Double)
kde n0 xs = kde_ n0 (lo - range / 10) (hi + range / 10) xs
where
(lo,hi) = minMax xs
range | U.length xs <= 1 = 1 -- Unreasonable guess
| otherwise = hi - lo
-- | Gaussian kernel density estimator for one-dimensional data, using
-- the method of Botev et al.
--
-- The result is a pair of vectors, containing:
--
-- * The coordinates of each mesh point.
--
-- * Density estimates at each mesh point.
| 710
|
kde n0 xs = kde_ n0 (lo - range / 10) (hi + range / 10) xs
where
(lo,hi) = minMax xs
range | U.length xs <= 1 = 1 -- Unreasonable guess
| otherwise = hi - lo
-- | Gaussian kernel density estimator for one-dimensional data, using
-- the method of Botev et al.
--
-- The result is a pair of vectors, containing:
--
-- * The coordinates of each mesh point.
--
-- * Density estimates at each mesh point.
| 437
| true
| true
| 0
| 11
| 263
| 155
| 85
| 70
| null | null |
bgaster/blocks
|
Blocks.hs
|
mit
|
blockTexS = calcTex 4 :: [[UV]]
| 32
|
blockTexS = calcTex 4 :: [[UV]]
| 32
|
blockTexS = calcTex 4 :: [[UV]]
| 32
| false
| false
| 0
| 6
| 6
| 18
| 10
| 8
| null | null |
nicolashery/cis194
|
src/Homework/A/CreditCard.hs
|
bsd-3-clause
|
-- Double every other Integer in a list, beginning from the right
doubleEveryOther :: [Integer] -> [Integer]
doubleEveryOther = reverse . doubleEveryOtherLeft . reverse
| 168
|
doubleEveryOther :: [Integer] -> [Integer]
doubleEveryOther = reverse . doubleEveryOtherLeft . reverse
| 102
|
doubleEveryOther = reverse . doubleEveryOtherLeft . reverse
| 59
| true
| true
| 0
| 6
| 23
| 30
| 17
| 13
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.