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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mcmaniac/ssdp-upnp
|
src/Network/UPnP/Render.hs
|
mit
|
el :: QName -> [Attr] -> [Content] -> Content
el q a c = Elem $ Element q a c Nothing
| 86
|
el :: QName -> [Attr] -> [Content] -> Content
el q a c = Elem $ Element q a c Nothing
| 85
|
el q a c = Elem $ Element q a c Nothing
| 39
| false
| true
| 2
| 9
| 21
| 56
| 26
| 30
| null | null |
andregr/bot
|
lib/Bot/Action/Maven.hs
|
bsd-3-clause
|
parentVersion :: Project -> Action
parentVersion project = do
pom <- readPOM project
name <- readSingleValue pom ["project", "parent", "artifactId"]
version <- readSingleValue pom ["project", "parent", "version"]
liftIO $ printf "{}: {}" (name, version)
| 281
|
parentVersion :: Project -> Action
parentVersion project = do
pom <- readPOM project
name <- readSingleValue pom ["project", "parent", "artifactId"]
version <- readSingleValue pom ["project", "parent", "version"]
liftIO $ printf "{}: {}" (name, version)
| 281
|
parentVersion project = do
pom <- readPOM project
name <- readSingleValue pom ["project", "parent", "artifactId"]
version <- readSingleValue pom ["project", "parent", "version"]
liftIO $ printf "{}: {}" (name, version)
| 246
| false
| true
| 0
| 9
| 61
| 88
| 44
| 44
| null | null |
yairchu/ad
|
src/Numeric/AD/Internal/Sparse.hs
|
bsd-3-clause
|
apply :: (Traversable f, Num a) => (f (AD Sparse a) -> b) -> f a -> b
apply f = f . vars
| 88
|
apply :: (Traversable f, Num a) => (f (AD Sparse a) -> b) -> f a -> b
apply f = f . vars
| 88
|
apply f = f . vars
| 18
| false
| true
| 0
| 12
| 23
| 68
| 32
| 36
| null | null |
beni55/haste-compiler
|
libraries/ghc-7.8/base/GHC/Event/PSQ.hs
|
bsd-3-clause
|
-- | Take two pennants and returns a new pennant that is the union of
-- the two with the precondition that the keys in the first tree are
-- strictly smaller than the keys in the second tree.
play :: PSQ a -> PSQ a -> PSQ a
Void `play` t' = t'
| 243
|
play :: PSQ a -> PSQ a -> PSQ a
Void `play` t' = t'
| 51
|
Void `play` t' = t'
| 19
| true
| true
| 1
| 8
| 53
| 40
| 19
| 21
| null | null |
ckaestne/CIDE
|
CIDE_Language_Haskell/test/WSP/Webserver/AccessLogger.hs
|
gpl-3.0
|
access_log_chan = unsafePerformIO (newChan)
| 43
|
access_log_chan = unsafePerformIO (newChan)
| 43
|
access_log_chan = unsafePerformIO (newChan)
| 43
| false
| false
| 0
| 6
| 3
| 12
| 6
| 6
| null | null |
uduki/hsQt
|
Qtc/ClassTypes/Gui.hs
|
bsd-2-clause
|
qCast_QStyleOption :: Object a -> IO (QStyleOption ())
qCast_QStyleOption _qobj
= return (objectCast _qobj)
| 109
|
qCast_QStyleOption :: Object a -> IO (QStyleOption ())
qCast_QStyleOption _qobj
= return (objectCast _qobj)
| 109
|
qCast_QStyleOption _qobj
= return (objectCast _qobj)
| 54
| false
| true
| 0
| 10
| 15
| 46
| 20
| 26
| null | null |
spechub/Hets
|
CASL/Sign.hs
|
gpl-2.0
|
addSubsort :: SORT -> SORT -> State.State (Sign f e) ()
addSubsort = addSubsortOrIso True
| 89
|
addSubsort :: SORT -> SORT -> State.State (Sign f e) ()
addSubsort = addSubsortOrIso True
| 89
|
addSubsort = addSubsortOrIso True
| 33
| false
| true
| 0
| 9
| 14
| 39
| 19
| 20
| null | null |
fmapfmapfmap/amazonka
|
amazonka-iam/test/Test/AWS/Gen/IAM.hs
|
mpl-2.0
|
testUpdateSigningCertificateResponse :: UpdateSigningCertificateResponse -> TestTree
testUpdateSigningCertificateResponse = res
"UpdateSigningCertificateResponse"
"fixture/UpdateSigningCertificateResponse.proto"
iAM
(Proxy :: Proxy UpdateSigningCertificate)
| 273
|
testUpdateSigningCertificateResponse :: UpdateSigningCertificateResponse -> TestTree
testUpdateSigningCertificateResponse = res
"UpdateSigningCertificateResponse"
"fixture/UpdateSigningCertificateResponse.proto"
iAM
(Proxy :: Proxy UpdateSigningCertificate)
| 273
|
testUpdateSigningCertificateResponse = res
"UpdateSigningCertificateResponse"
"fixture/UpdateSigningCertificateResponse.proto"
iAM
(Proxy :: Proxy UpdateSigningCertificate)
| 188
| false
| true
| 0
| 7
| 30
| 33
| 17
| 16
| null | null |
bsl/GLFW-b
|
Test.hs
|
bsd-2-clause
|
test_getWindowClientAPI :: GLFW.Window -> IO ()
test_getWindowClientAPI win = do
a <- GLFW.getWindowClientAPI win
a @?= GLFW.ClientAPI'OpenGL
| 149
|
test_getWindowClientAPI :: GLFW.Window -> IO ()
test_getWindowClientAPI win = do
a <- GLFW.getWindowClientAPI win
a @?= GLFW.ClientAPI'OpenGL
| 149
|
test_getWindowClientAPI win = do
a <- GLFW.getWindowClientAPI win
a @?= GLFW.ClientAPI'OpenGL
| 101
| false
| true
| 0
| 9
| 24
| 46
| 21
| 25
| null | null |
Vlix/facebookmessenger
|
test/UnitTest/CallbackParse/PostbackCallback.hs
|
mit
|
postbackReferralVal :: Value
postbackReferralVal = $$(decodeFile "test/json/callback/postback_callback_referral.json")
| 118
|
postbackReferralVal :: Value
postbackReferralVal = $$(decodeFile "test/json/callback/postback_callback_referral.json")
| 118
|
postbackReferralVal = $$(decodeFile "test/json/callback/postback_callback_referral.json")
| 89
| false
| true
| 0
| 7
| 6
| 18
| 9
| 9
| null | null |
andrewMacmurray/haskell-book-solutions
|
src/ch12/eitherLib.hs
|
mit
|
eitherMaybe' f (Right x) = Just (f x)
| 37
|
eitherMaybe' f (Right x) = Just (f x)
| 37
|
eitherMaybe' f (Right x) = Just (f x)
| 37
| false
| false
| 0
| 7
| 7
| 28
| 12
| 16
| null | null |
individkid/sidegeo
|
src/AffTopo/Naive.hs
|
gpl-3.0
|
subsets _ [] = []
| 17
|
subsets _ [] = []
| 17
|
subsets _ [] = []
| 17
| false
| false
| 0
| 6
| 4
| 15
| 7
| 8
| null | null |
mightymoose/liquidhaskell
|
tests/pos/tup0.hs
|
bsd-3-clause
|
{-@ plusOnes :: Maybe PlusOne @-}
plusOnes :: Maybe (Int, Int)
plusOnes = Just plusOne
| 87
|
plusOnes :: Maybe (Int, Int)
plusOnes = Just plusOne
| 52
|
plusOnes = Just plusOne
| 23
| true
| true
| 0
| 6
| 15
| 24
| 13
| 11
| null | null |
michalkonecny/aern
|
aern-poly/demos/minimal.hs
|
bsd-3-clause
|
varDomsNoX :: [(Var Poly, CF)]
varDomsNoX = drop 1 varDoms
| 58
|
varDomsNoX :: [(Var Poly, CF)]
varDomsNoX = drop 1 varDoms
| 58
|
varDomsNoX = drop 1 varDoms
| 27
| false
| true
| 0
| 7
| 9
| 28
| 15
| 13
| null | null |
thoughtpolice/binary-serialise-cbor
|
Data/Binary/Serialise/CBOR/Read.hs
|
bsd-3-clause
|
readBytes32 bs
| n <= BS.length bs - hdrsz
= DecodedToken (n+hdrsz) $ Fits $
BS.unsafeTake n (BS.unsafeDrop hdrsz bs)
-- if n > bound then slow path, multi-chunk
| otherwise
= DecodedToken hdrsz $ TooLong n
where
hdrsz = 5
--FIXME: int overflow
n = fromIntegral $ withBsPtr grabWord32 (BS.unsafeTail bs)
| 334
|
readBytes32 bs
| n <= BS.length bs - hdrsz
= DecodedToken (n+hdrsz) $ Fits $
BS.unsafeTake n (BS.unsafeDrop hdrsz bs)
-- if n > bound then slow path, multi-chunk
| otherwise
= DecodedToken hdrsz $ TooLong n
where
hdrsz = 5
--FIXME: int overflow
n = fromIntegral $ withBsPtr grabWord32 (BS.unsafeTail bs)
| 334
|
readBytes32 bs
| n <= BS.length bs - hdrsz
= DecodedToken (n+hdrsz) $ Fits $
BS.unsafeTake n (BS.unsafeDrop hdrsz bs)
-- if n > bound then slow path, multi-chunk
| otherwise
= DecodedToken hdrsz $ TooLong n
where
hdrsz = 5
--FIXME: int overflow
n = fromIntegral $ withBsPtr grabWord32 (BS.unsafeTail bs)
| 334
| false
| false
| 1
| 11
| 82
| 118
| 55
| 63
| null | null |
robstewart57/Gps2HtmlReport
|
Data/GPS/Gps2HtmlReport/DrawOsm.hs
|
bsd-3-clause
|
maxTile :: [(Int,Int)] -> (Int,Int)
maxTile [] = error "There is no max tile of an empty list"
| 94
|
maxTile :: [(Int,Int)] -> (Int,Int)
maxTile [] = error "There is no max tile of an empty list"
| 94
|
maxTile [] = error "There is no max tile of an empty list"
| 58
| false
| true
| 0
| 7
| 17
| 38
| 21
| 17
| null | null |
andir/ganeti
|
src/Ganeti/WConfd/TempRes.hs
|
bsd-2-clause
|
-- | Commit all reserved/released IP address to an IP pool.
-- The IP addresses are taken from the network's IP pool and marked as
-- reserved/free for instances.
--
-- Note that the reservations are kept, they are supposed to be cleaned
-- when a job finishes.
commitReservedIps
:: (MonadError GanetiException m, Functor m, MonadLog m)
=> ClientId -> TempResState -> ConfigData -> m ConfigData
commitReservedIps jobId tr cd = do
let res = reservedFor jobId (trsIPv4s tr)
logDebug $ "Commiting reservations: " ++ show res
F.foldrM commitIp cd res
| 556
|
commitReservedIps
:: (MonadError GanetiException m, Functor m, MonadLog m)
=> ClientId -> TempResState -> ConfigData -> m ConfigData
commitReservedIps jobId tr cd = do
let res = reservedFor jobId (trsIPv4s tr)
logDebug $ "Commiting reservations: " ++ show res
F.foldrM commitIp cd res
| 294
|
commitReservedIps jobId tr cd = do
let res = reservedFor jobId (trsIPv4s tr)
logDebug $ "Commiting reservations: " ++ show res
F.foldrM commitIp cd res
| 157
| true
| true
| 0
| 13
| 100
| 112
| 55
| 57
| null | null |
kazu-yamamoto/word8
|
Data/Word8.hs
|
bsd-3-clause
|
_S = 0x53
| 9
|
_S = 0x53
| 9
|
_S = 0x53
| 9
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
emwap/feldspar-language
|
src/Feldspar/Range.hs
|
bsd-3-clause
|
minAndUnsigned :: BoundedInt a => a -> a -> a -> a -> a
minAndUnsigned a b c d =
complement $ maxOrUnsigned (complement b) (complement a)
(complement d) (complement c)
| 198
|
minAndUnsigned :: BoundedInt a => a -> a -> a -> a -> a
minAndUnsigned a b c d =
complement $ maxOrUnsigned (complement b) (complement a)
(complement d) (complement c)
| 198
|
minAndUnsigned a b c d =
complement $ maxOrUnsigned (complement b) (complement a)
(complement d) (complement c)
| 142
| false
| true
| 0
| 9
| 61
| 80
| 39
| 41
| null | null |
chrisdone/path
|
src/Path/Include.hs
|
bsd-3-clause
|
-- | Extract the file part of a path.
--
-- The following properties hold:
--
-- @filename (p \<\/> a) == filename a@
--
filename :: Path b File -> Path Rel File
filename (Path l) =
Path (FilePath.takeFileName l)
| 214
|
filename :: Path b File -> Path Rel File
filename (Path l) =
Path (FilePath.takeFileName l)
| 93
|
filename (Path l) =
Path (FilePath.takeFileName l)
| 52
| true
| true
| 0
| 8
| 42
| 51
| 27
| 24
| null | null |
aelve/ilist
|
src/Data/List/Index.hs
|
bsd-3-clause
|
ifindIndex :: (Int -> a -> Bool) -> [a] -> Maybe Int
ifindIndex p = listToMaybe . ifindIndices p
| 96
|
ifindIndex :: (Int -> a -> Bool) -> [a] -> Maybe Int
ifindIndex p = listToMaybe . ifindIndices p
| 96
|
ifindIndex p = listToMaybe . ifindIndices p
| 43
| false
| true
| 0
| 8
| 18
| 46
| 23
| 23
| null | null |
brendanhay/gogol
|
gogol-remotebuildexecution/gen/Network/Google/RemoteBuildExecution/Types/Product.hs
|
mpl-2.0
|
-- | Output only. Instance resource name formatted as:
-- \`projects\/[PROJECT_ID]\/instances\/[INSTANCE_ID]\`. Name should not be
-- populated when creating an instance since it is provided in the
-- \`instance_id\` field.
gdraviName :: Lens' GoogleDevtoolsRemotebuildexecutionAdminV1alphaInstance (Maybe Text)
gdraviName
= lens _gdraviName (\ s a -> s{_gdraviName = a})
| 373
|
gdraviName :: Lens' GoogleDevtoolsRemotebuildexecutionAdminV1alphaInstance (Maybe Text)
gdraviName
= lens _gdraviName (\ s a -> s{_gdraviName = a})
| 149
|
gdraviName
= lens _gdraviName (\ s a -> s{_gdraviName = a})
| 61
| true
| true
| 0
| 9
| 48
| 51
| 28
| 23
| null | null |
keithodulaigh/Hets
|
CommonLogic/ModuleElimination.hs
|
gpl-2.0
|
-- Table 2 R4: makes a Predicate out of the module name
modNameToPredicate :: NAME -> NAME -> SENTENCE
modNameToPredicate n m =
Atom_sent (Atom (Name_term m) [Term_seq (Name_term n)]) nullRange
| 197
|
modNameToPredicate :: NAME -> NAME -> SENTENCE
modNameToPredicate n m =
Atom_sent (Atom (Name_term m) [Term_seq (Name_term n)]) nullRange
| 141
|
modNameToPredicate n m =
Atom_sent (Atom (Name_term m) [Term_seq (Name_term n)]) nullRange
| 94
| true
| true
| 0
| 11
| 34
| 56
| 28
| 28
| null | null |
wkoiking/my-parser
|
src/MyParser/Numeral.hs
|
bsd-3-clause
|
showBin :: (Integral a,Show a) => a -> String
showBin x = showIntAtBase 2 intToDigit x ""
| 89
|
showBin :: (Integral a,Show a) => a -> String
showBin x = showIntAtBase 2 intToDigit x ""
| 89
|
showBin x = showIntAtBase 2 intToDigit x ""
| 43
| false
| true
| 0
| 6
| 16
| 42
| 21
| 21
| null | null |
maoe/disruptor
|
benchmarks/ping-pong-latency.hs
|
bsd-3-clause
|
main :: IO ()
main = defaultMain
[ env setupChan $ \ ~(pingQ, pongQ) ->
bench "Chan" $ whnfIO $ benchmarkChan pingQ pongQ
, env setupTChan $ \ ~(pingQ, pongQ) ->
bench "TChan" $ whnfIO $ benchmarkTChan pingQ pongQ
, env setupTQueue $ \ ~(pingQ, pongQ) ->
bench "TQueue" $ whnfIO $ benchmarkTQueue pingQ pongQ
, env setupTBQueue $ \ ~(pingQ, pongQ) ->
bench "TBQueue" $ whnfIO $ benchmarkTBQueue pingQ pongQ
, env setupUnagi $ \ ~(pingQ, pongQ) ->
bench "Unagi" $ whnfIO $ benchmarkUnagi pingQ pongQ
, env setupUnagiUnboxed $ \ ~(pingQ, pongQ) ->
bench "Unagi Unboxed" $ whnfIO $ benchmarkUnagiUnboxed pingQ pongQ
]
| 664
|
main :: IO ()
main = defaultMain
[ env setupChan $ \ ~(pingQ, pongQ) ->
bench "Chan" $ whnfIO $ benchmarkChan pingQ pongQ
, env setupTChan $ \ ~(pingQ, pongQ) ->
bench "TChan" $ whnfIO $ benchmarkTChan pingQ pongQ
, env setupTQueue $ \ ~(pingQ, pongQ) ->
bench "TQueue" $ whnfIO $ benchmarkTQueue pingQ pongQ
, env setupTBQueue $ \ ~(pingQ, pongQ) ->
bench "TBQueue" $ whnfIO $ benchmarkTBQueue pingQ pongQ
, env setupUnagi $ \ ~(pingQ, pongQ) ->
bench "Unagi" $ whnfIO $ benchmarkUnagi pingQ pongQ
, env setupUnagiUnboxed $ \ ~(pingQ, pongQ) ->
bench "Unagi Unboxed" $ whnfIO $ benchmarkUnagiUnboxed pingQ pongQ
]
| 664
|
main = defaultMain
[ env setupChan $ \ ~(pingQ, pongQ) ->
bench "Chan" $ whnfIO $ benchmarkChan pingQ pongQ
, env setupTChan $ \ ~(pingQ, pongQ) ->
bench "TChan" $ whnfIO $ benchmarkTChan pingQ pongQ
, env setupTQueue $ \ ~(pingQ, pongQ) ->
bench "TQueue" $ whnfIO $ benchmarkTQueue pingQ pongQ
, env setupTBQueue $ \ ~(pingQ, pongQ) ->
bench "TBQueue" $ whnfIO $ benchmarkTBQueue pingQ pongQ
, env setupUnagi $ \ ~(pingQ, pongQ) ->
bench "Unagi" $ whnfIO $ benchmarkUnagi pingQ pongQ
, env setupUnagiUnboxed $ \ ~(pingQ, pongQ) ->
bench "Unagi Unboxed" $ whnfIO $ benchmarkUnagiUnboxed pingQ pongQ
]
| 650
| false
| true
| 0
| 10
| 154
| 247
| 123
| 124
| null | null |
nevrenato/HetsAlloy
|
CommonLogic/Parse_CLIF.hs
|
gpl-2.0
|
comment_txt :: CharParser st (TEXT, [PrefixMapping])
comment_txt = try text <|> return (Text [] nullRange, [])
| 110
|
comment_txt :: CharParser st (TEXT, [PrefixMapping])
comment_txt = try text <|> return (Text [] nullRange, [])
| 110
|
comment_txt = try text <|> return (Text [] nullRange, [])
| 57
| false
| true
| 0
| 9
| 15
| 50
| 26
| 24
| null | null |
cirquit/Personal-Repository
|
Haskell/RosettaCode/Multiline-Strings/MultiLineStrings.hs
|
mit
|
main :: IO ()
main = do
-- multiline String
putStrLn "Hello\
\ World!\n"
-- more haskell-ish way
putStrLn $ unwords ["This", "is", "an", "example", "text!\n"]
-- now with multiple lines
putStrLn $ unlines [
unwords ["This", "is", "the", "first" , "line."]
, unwords ["This", "is", "the", "second", "line."]
, unwords ["This", "is", "the", "third" , "line."]
]
| 426
|
main :: IO ()
main = do
-- multiline String
putStrLn "Hello\
\ World!\n"
-- more haskell-ish way
putStrLn $ unwords ["This", "is", "an", "example", "text!\n"]
-- now with multiple lines
putStrLn $ unlines [
unwords ["This", "is", "the", "first" , "line."]
, unwords ["This", "is", "the", "second", "line."]
, unwords ["This", "is", "the", "third" , "line."]
]
| 426
|
main = do
-- multiline String
putStrLn "Hello\
\ World!\n"
-- more haskell-ish way
putStrLn $ unwords ["This", "is", "an", "example", "text!\n"]
-- now with multiple lines
putStrLn $ unlines [
unwords ["This", "is", "the", "first" , "line."]
, unwords ["This", "is", "the", "second", "line."]
, unwords ["This", "is", "the", "third" , "line."]
]
| 412
| false
| true
| 0
| 11
| 124
| 123
| 70
| 53
| null | null |
CindyLinz/GCryptDrive
|
src/My/Uploader.hs
|
mit
|
report :: Uploader -> IO ()
report uploader@Uploader{..} = go where
reportPath = workDir </> "stats"
--tryCreatePipe =
-- catch (createNamedPipe reportPath 0o644) (\(e :: SomeException) -> return ())
go = do
bracket
(openFd reportPath WriteOnly (Just 0o644) defaultFileFlags {append = True, trunc = True})
closeFd
$ \fd -> do
uploadHint <- stats uploader
_ <- fdWrite fd uploadHint
return ()
threadDelay 1000000
go
| 479
|
report :: Uploader -> IO ()
report uploader@Uploader{..} = go where
reportPath = workDir </> "stats"
--tryCreatePipe =
-- catch (createNamedPipe reportPath 0o644) (\(e :: SomeException) -> return ())
go = do
bracket
(openFd reportPath WriteOnly (Just 0o644) defaultFileFlags {append = True, trunc = True})
closeFd
$ \fd -> do
uploadHint <- stats uploader
_ <- fdWrite fd uploadHint
return ()
threadDelay 1000000
go
| 479
|
report uploader@Uploader{..} = go where
reportPath = workDir </> "stats"
--tryCreatePipe =
-- catch (createNamedPipe reportPath 0o644) (\(e :: SomeException) -> return ())
go = do
bracket
(openFd reportPath WriteOnly (Just 0o644) defaultFileFlags {append = True, trunc = True})
closeFd
$ \fd -> do
uploadHint <- stats uploader
_ <- fdWrite fd uploadHint
return ()
threadDelay 1000000
go
| 451
| false
| true
| 0
| 14
| 128
| 138
| 68
| 70
| null | null |
gspia/reflex-dom-htmlea
|
lib/src/Reflex/Dom/HTML5/Attrs/Attrs.hs
|
bsd-3-clause
|
coordsRectangle cp1 cp2 = attrSetCoords (CoordsRectangle cp1 cp2)
| 65
|
coordsRectangle cp1 cp2 = attrSetCoords (CoordsRectangle cp1 cp2)
| 65
|
coordsRectangle cp1 cp2 = attrSetCoords (CoordsRectangle cp1 cp2)
| 65
| false
| false
| 0
| 7
| 7
| 23
| 10
| 13
| null | null |
sheganinans/plugins
|
src/System/Plugins/Utils.hs
|
lgpl-2.1
|
decode_upper ch = error $ "decode_upper can't handle this char `"++[ch]++"'"
| 77
|
decode_upper ch = error $ "decode_upper can't handle this char `"++[ch]++"'"
| 77
|
decode_upper ch = error $ "decode_upper can't handle this char `"++[ch]++"'"
| 77
| false
| false
| 0
| 7
| 11
| 24
| 12
| 12
| null | null |
holmisen/hrunner
|
src/Subst.hs
|
gpl-3.0
|
html '>' = ">"
| 17
|
html '>' = ">"
| 17
|
html '>' = ">"
| 17
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
jystic/language-csharp
|
src/Language/CSharp/Pretty.hs
|
bsd-3-clause
|
dot :: Doc
dot = char '.'
| 25
|
dot :: Doc
dot = char '.'
| 25
|
dot = char '.'
| 14
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
xnning/fcore
|
lib/simplify/SimplifyImpl.hs
|
bsd-2-clause
|
dedeBruE i as j xs (TApp f a) = TApp
(dedeBruE i as j xs f)
(dedeBruT i as a)
| 207
|
dedeBruE i as j xs (TApp f a) = TApp
(dedeBruE i as j xs f)
(dedeBruT i as a)
| 207
|
dedeBruE i as j xs (TApp f a) = TApp
(dedeBruE i as j xs f)
(dedeBruT i as a)
| 207
| false
| false
| 0
| 7
| 149
| 54
| 26
| 28
| null | null |
rvion/h9puzzle-solver
|
src/Tool/Puzzle/Solver/Internal.hs
|
bsd-3-clause
|
somme :: Carte -> Int
somme (a1, a2, a3, a4) = a1+ a2+ a3+ a4
| 61
|
somme :: Carte -> Int
somme (a1, a2, a3, a4) = a1+ a2+ a3+ a4
| 61
|
somme (a1, a2, a3, a4) = a1+ a2+ a3+ a4
| 39
| false
| true
| 0
| 7
| 14
| 42
| 23
| 19
| null | null |
J2RGEZ/haskell-do
|
src/common/HaskellDo/Toolbar/View.hs
|
apache-2.0
|
cancelPackageEditorButton :: State -> Widget Action
cancelPackageEditorButton _ = Ulmus.newWidget "cancelPackageEditorButton" $ wlink ClosePackageModal $
a ! atr "class" "modal-action modal-close waves-effect btn-flat waves-purple" $
i ! atr "class" "material-icons" $ ("clear" :: String)
| 300
|
cancelPackageEditorButton :: State -> Widget Action
cancelPackageEditorButton _ = Ulmus.newWidget "cancelPackageEditorButton" $ wlink ClosePackageModal $
a ! atr "class" "modal-action modal-close waves-effect btn-flat waves-purple" $
i ! atr "class" "material-icons" $ ("clear" :: String)
| 300
|
cancelPackageEditorButton _ = Ulmus.newWidget "cancelPackageEditorButton" $ wlink ClosePackageModal $
a ! atr "class" "modal-action modal-close waves-effect btn-flat waves-purple" $
i ! atr "class" "material-icons" $ ("clear" :: String)
| 248
| false
| true
| 0
| 12
| 45
| 69
| 33
| 36
| null | null |
WraithM/haskell-opaleye
|
src/Opaleye/Manipulation.hs
|
bsd-3-clause
|
arrangeInsertManyReturningSql :: U.Unpackspec columnsReturned ignored
-> T.Table columnsW columnsR
-> NEL.NonEmpty columnsW
-> (columnsR -> columnsReturned)
-> String
arrangeInsertManyReturningSql u t c r =
MI.arrangeInsertManyReturningSql u t c r Nothing
| 377
|
arrangeInsertManyReturningSql :: U.Unpackspec columnsReturned ignored
-> T.Table columnsW columnsR
-> NEL.NonEmpty columnsW
-> (columnsR -> columnsReturned)
-> String
arrangeInsertManyReturningSql u t c r =
MI.arrangeInsertManyReturningSql u t c r Nothing
| 377
|
arrangeInsertManyReturningSql u t c r =
MI.arrangeInsertManyReturningSql u t c r Nothing
| 90
| false
| true
| 0
| 11
| 151
| 80
| 37
| 43
| null | null |
phischu/fragnix
|
benchmarks/containers/Data.IntSet.Base.hs
|
bsd-3-clause
|
{--------------------------------------------------------------------
Fold
--------------------------------------------------------------------}
-- | /O(n)/. Fold the elements in the set using the given right-associative
-- binary operator. This function is an equivalent of 'foldr' and is present
-- for compatibility only.
--
-- /Please note that fold will be deprecated in the future and removed./
fold :: (Key -> b -> b) -> b -> IntSet -> b
fold = foldr
| 459
|
fold :: (Key -> b -> b) -> b -> IntSet -> b
fold = foldr
| 56
|
fold = foldr
| 12
| true
| true
| 0
| 8
| 64
| 40
| 24
| 16
| null | null |
kRITZCREEK/dickminer
|
src/Dickmine/Query.hs
|
bsd-3-clause
|
pluckCity :: (Monad m) => Pipe Pagehit String m ()
pluckCity = P.map city
| 73
|
pluckCity :: (Monad m) => Pipe Pagehit String m ()
pluckCity = P.map city
| 73
|
pluckCity = P.map city
| 22
| false
| true
| 0
| 8
| 13
| 42
| 19
| 23
| null | null |
lukexi/text-gl
|
src/Graphics/GL/TextBuffer/Input.hs
|
bsd-2-clause
|
renameTextRendererFile :: (MonadIO m)
=> FilePath -> TextRenderer -> m TextRenderer
renameTextRendererFile newFileName textRenderer = do
forM_ (textRenderer ^. txrFileEventListener) killFileEventListener
fileEventListener <- eventListenerForFile newFileName ReadFileOnEvents
return $ textRenderer &~ do
txrFileEventListener ?= fileEventListener
txrTextBuffer %= \textBuf -> textBuf { bufPath = Just newFileName }
-- | Must pass WatchFile to textRendererFromFile to use this
| 526
|
renameTextRendererFile :: (MonadIO m)
=> FilePath -> TextRenderer -> m TextRenderer
renameTextRendererFile newFileName textRenderer = do
forM_ (textRenderer ^. txrFileEventListener) killFileEventListener
fileEventListener <- eventListenerForFile newFileName ReadFileOnEvents
return $ textRenderer &~ do
txrFileEventListener ?= fileEventListener
txrTextBuffer %= \textBuf -> textBuf { bufPath = Just newFileName }
-- | Must pass WatchFile to textRendererFromFile to use this
| 526
|
renameTextRendererFile newFileName textRenderer = do
forM_ (textRenderer ^. txrFileEventListener) killFileEventListener
fileEventListener <- eventListenerForFile newFileName ReadFileOnEvents
return $ textRenderer &~ do
txrFileEventListener ?= fileEventListener
txrTextBuffer %= \textBuf -> textBuf { bufPath = Just newFileName }
-- | Must pass WatchFile to textRendererFromFile to use this
| 419
| false
| true
| 0
| 14
| 107
| 105
| 51
| 54
| null | null |
ulricha/dsh
|
src/Database/DSH/Tests/CombinatorTests.hs
|
bsd-3-clause
|
prop_add_integer_sums :: (BackendVector b, VectorLang v) => ([Integer], [Integer]) -> DSHProperty (v TExpr TExpr) b
prop_add_integer_sums = makePropEq (\p -> Q.sum (Q.fst p) + Q.sum (Q.snd p))
(\p -> sum (fst p) + sum (snd p))
| 261
|
prop_add_integer_sums :: (BackendVector b, VectorLang v) => ([Integer], [Integer]) -> DSHProperty (v TExpr TExpr) b
prop_add_integer_sums = makePropEq (\p -> Q.sum (Q.fst p) + Q.sum (Q.snd p))
(\p -> sum (fst p) + sum (snd p))
| 261
|
prop_add_integer_sums = makePropEq (\p -> Q.sum (Q.fst p) + Q.sum (Q.snd p))
(\p -> sum (fst p) + sum (snd p))
| 145
| false
| true
| 0
| 12
| 70
| 128
| 66
| 62
| null | null |
bgold-cosmos/Tidal
|
tidal-parse/src/Sound/Tidal/Parse.hs
|
gpl-3.0
|
pDouble_tupleADouble_p :: Parse a => H (Pattern Double -> [(a,Double)] -> Pattern a)
pDouble_tupleADouble_p = $(fromTidal "wchooseBy")
| 134
|
pDouble_tupleADouble_p :: Parse a => H (Pattern Double -> [(a,Double)] -> Pattern a)
pDouble_tupleADouble_p = $(fromTidal "wchooseBy")
| 134
|
pDouble_tupleADouble_p = $(fromTidal "wchooseBy")
| 49
| false
| true
| 0
| 12
| 16
| 60
| 28
| 32
| null | null |
JustusAdam/ja-base-extra
|
src/Data/Function/JAExtra.hs
|
bsd-3-clause
|
-- | Alias for the 'const' function from prelude in the const function family
-- naming scheme.
const1 ∷ α → β → α
const1 = const
| 129
|
const1 ∷ α → β → α
const1 = const
| 33
|
const1 = const
| 14
| true
| true
| 0
| 6
| 26
| 21
| 12
| 9
| null | null |
Shimuuar/numeric-tools
|
Numeric/Tools/Interpolation.hs
|
bsd-3-clause
|
tabulate mesh tbl
| size mesh /= G.length tbl = error "Numeric.Tools.Interpolation.tabulate: size of vector and mesh do not match"
| otherwise = unsafeTabulate mesh tbl
| 188
|
tabulate mesh tbl
| size mesh /= G.length tbl = error "Numeric.Tools.Interpolation.tabulate: size of vector and mesh do not match"
| otherwise = unsafeTabulate mesh tbl
| 188
|
tabulate mesh tbl
| size mesh /= G.length tbl = error "Numeric.Tools.Interpolation.tabulate: size of vector and mesh do not match"
| otherwise = unsafeTabulate mesh tbl
| 188
| false
| false
| 1
| 10
| 45
| 44
| 19
| 25
| null | null |
edofic/core.js
|
src/Immediate/GenerateJs.hs
|
mit
|
genExpr (Force expr) = forceExp $ genExpr expr
| 46
|
genExpr (Force expr) = forceExp $ genExpr expr
| 46
|
genExpr (Force expr) = forceExp $ genExpr expr
| 46
| false
| false
| 2
| 6
| 7
| 24
| 10
| 14
| null | null |
magicant/flesh
|
src/Flesh/Language/Syntax/Print.hs
|
gpl-2.0
|
-- | Runs the PrintS state with 'initPrintState'.
runPrint :: PrintS a -> ShowS
runPrint = flip evalState initPrintState . execPrintT
| 133
|
runPrint :: PrintS a -> ShowS
runPrint = flip evalState initPrintState . execPrintT
| 83
|
runPrint = flip evalState initPrintState . execPrintT
| 53
| true
| true
| 0
| 6
| 20
| 28
| 14
| 14
| null | null |
monky-hs/monky
|
Monky/Disk/Device.hs
|
lgpl-3.0
|
getBlockHandle :: String -> IO (Maybe (BlockHandle, Dev))
getBlockHandle = getBlockHandleTag "UUID"
| 99
|
getBlockHandle :: String -> IO (Maybe (BlockHandle, Dev))
getBlockHandle = getBlockHandleTag "UUID"
| 99
|
getBlockHandle = getBlockHandleTag "UUID"
| 41
| false
| true
| 0
| 9
| 11
| 33
| 17
| 16
| null | null |
olsner/ghc
|
compiler/hsSyn/HsExpr.hs
|
bsd-3-clause
|
pprMatchContextNoun ProcExpr = text "arrow abstraction"
| 62
|
pprMatchContextNoun ProcExpr = text "arrow abstraction"
| 62
|
pprMatchContextNoun ProcExpr = text "arrow abstraction"
| 62
| false
| false
| 0
| 5
| 12
| 12
| 5
| 7
| null | null |
graninas/Andromeda
|
src/Andromeda/Types/UI/GraphTransition.hs
|
bsd-3-clause
|
runLang' :: forall m a. Monad m =>
GraphRuntime m -> Lang a -> m (LangResult Event a)
runLang' (GraphRuntime runLang isBackEvent) flow = do
(e, i) <- runLang flow
if isBackEvent e
then pure Backward
else pure $ Forward e i
| 236
|
runLang' :: forall m a. Monad m =>
GraphRuntime m -> Lang a -> m (LangResult Event a)
runLang' (GraphRuntime runLang isBackEvent) flow = do
(e, i) <- runLang flow
if isBackEvent e
then pure Backward
else pure $ Forward e i
| 236
|
runLang' (GraphRuntime runLang isBackEvent) flow = do
(e, i) <- runLang flow
if isBackEvent e
then pure Backward
else pure $ Forward e i
| 148
| false
| true
| 0
| 11
| 55
| 104
| 50
| 54
| null | null |
tolysz/prepare-ghcjs
|
spec-lts8/cabal/cabal-install/Distribution/Client/HttpUtils.hs
|
bsd-3-clause
|
remoteRepoCheckHttps :: HttpTransport -> RemoteRepo -> IO ()
remoteRepoCheckHttps transport repo
| uriScheme (remoteRepoURI repo) == "https:"
, not (transportSupportsHttps transport)
= die $ "The remote repository '" ++ remoteRepoName repo
++ "' specifies a URL that " ++ requiresHttpsErrorMessage
| otherwise = return ()
| 360
|
remoteRepoCheckHttps :: HttpTransport -> RemoteRepo -> IO ()
remoteRepoCheckHttps transport repo
| uriScheme (remoteRepoURI repo) == "https:"
, not (transportSupportsHttps transport)
= die $ "The remote repository '" ++ remoteRepoName repo
++ "' specifies a URL that " ++ requiresHttpsErrorMessage
| otherwise = return ()
| 360
|
remoteRepoCheckHttps transport repo
| uriScheme (remoteRepoURI repo) == "https:"
, not (transportSupportsHttps transport)
= die $ "The remote repository '" ++ remoteRepoName repo
++ "' specifies a URL that " ++ requiresHttpsErrorMessage
| otherwise = return ()
| 299
| false
| true
| 1
| 11
| 83
| 92
| 43
| 49
| null | null |
akc/gfscript
|
HOPS/GF/Const.hs
|
bsd-3-clause
|
simplifyLit (App2 _ _ (Lit DZ)) = Lit DZ
| 40
|
simplifyLit (App2 _ _ (Lit DZ)) = Lit DZ
| 40
|
simplifyLit (App2 _ _ (Lit DZ)) = Lit DZ
| 40
| false
| false
| 0
| 9
| 8
| 28
| 13
| 15
| null | null |
Shimuuar/protobuf
|
protobuf-grammar/driver.hs
|
bsd-3-clause
|
main :: IO ()
main = do
pars <- parseArgs
let cxt = PbContext { includePaths = "." : includes pars
}
res <- runPbMonad cxt $ do
-- Read protobuf files
ast <- readProtobuf (fileList pars)
when (dumpAST pars) $
liftIO $ dumpBundle ast
-- Check AST
applyBundleM_ checkLabels ast
-- Name mangling etc...
let ast1 = applyBundle mangleNames
$ applyBundle sortLabels ast
ast2 <- applyBundleM removePackage ast1
ast3 <- applyBundleM buildNamespace ast2
pb1 <- resolveImports ast3
pb2 <- mapM resolveTypeNames pb1
-- Convert to haskell
DataTree hask <- toHaskellTree pb2
-- Pretty print haskell code
liftIO $ do
setCurrentDirectory (outputDir pars)
mapM_ dump (Map.toList hask)
-- Check for errors
case res of
Right _ -> return ()
Left err -> putStrLn err >> exitFailure
| 903
|
main :: IO ()
main = do
pars <- parseArgs
let cxt = PbContext { includePaths = "." : includes pars
}
res <- runPbMonad cxt $ do
-- Read protobuf files
ast <- readProtobuf (fileList pars)
when (dumpAST pars) $
liftIO $ dumpBundle ast
-- Check AST
applyBundleM_ checkLabels ast
-- Name mangling etc...
let ast1 = applyBundle mangleNames
$ applyBundle sortLabels ast
ast2 <- applyBundleM removePackage ast1
ast3 <- applyBundleM buildNamespace ast2
pb1 <- resolveImports ast3
pb2 <- mapM resolveTypeNames pb1
-- Convert to haskell
DataTree hask <- toHaskellTree pb2
-- Pretty print haskell code
liftIO $ do
setCurrentDirectory (outputDir pars)
mapM_ dump (Map.toList hask)
-- Check for errors
case res of
Right _ -> return ()
Left err -> putStrLn err >> exitFailure
| 903
|
main = do
pars <- parseArgs
let cxt = PbContext { includePaths = "." : includes pars
}
res <- runPbMonad cxt $ do
-- Read protobuf files
ast <- readProtobuf (fileList pars)
when (dumpAST pars) $
liftIO $ dumpBundle ast
-- Check AST
applyBundleM_ checkLabels ast
-- Name mangling etc...
let ast1 = applyBundle mangleNames
$ applyBundle sortLabels ast
ast2 <- applyBundleM removePackage ast1
ast3 <- applyBundleM buildNamespace ast2
pb1 <- resolveImports ast3
pb2 <- mapM resolveTypeNames pb1
-- Convert to haskell
DataTree hask <- toHaskellTree pb2
-- Pretty print haskell code
liftIO $ do
setCurrentDirectory (outputDir pars)
mapM_ dump (Map.toList hask)
-- Check for errors
case res of
Right _ -> return ()
Left err -> putStrLn err >> exitFailure
| 889
| false
| true
| 0
| 18
| 267
| 273
| 120
| 153
| null | null |
vluukkal/aspreify
|
testaspparse.hs
|
mit
|
truleorfact1 = TestCase $ assertEqual "ruleorfact 1" (Fact [Card (Sym (Const "k")) (Sym (Const "any")) [Typed [Plain (Const "in") [Sym (Var "X")] True,Plain (Const "vtx") [Sym (Var "X")] True]] True]) (wrapparser ruleorfact "" "k { in(X) : vtx(X) }.\n")
| 253
|
truleorfact1 = TestCase $ assertEqual "ruleorfact 1" (Fact [Card (Sym (Const "k")) (Sym (Const "any")) [Typed [Plain (Const "in") [Sym (Var "X")] True,Plain (Const "vtx") [Sym (Var "X")] True]] True]) (wrapparser ruleorfact "" "k { in(X) : vtx(X) }.\n")
| 253
|
truleorfact1 = TestCase $ assertEqual "ruleorfact 1" (Fact [Card (Sym (Const "k")) (Sym (Const "any")) [Typed [Plain (Const "in") [Sym (Var "X")] True,Plain (Const "vtx") [Sym (Var "X")] True]] True]) (wrapparser ruleorfact "" "k { in(X) : vtx(X) }.\n")
| 253
| false
| false
| 0
| 18
| 38
| 131
| 65
| 66
| null | null |
sdiehl/ghc
|
testsuite/tests/deriving/should_fail/drvfail012.hs
|
bsd-3-clause
|
f :: Ord a => Ego a -> Ego a -> Bool
f e1 e2 = e1 < e2
| 54
|
f :: Ord a => Ego a -> Ego a -> Bool
f e1 e2 = e1 < e2
| 54
|
f e1 e2 = e1 < e2
| 17
| false
| true
| 0
| 8
| 18
| 46
| 20
| 26
| null | null |
AlexanderPankiv/ghc
|
compiler/prelude/TysPrim.hs
|
bsd-3-clause
|
eqPrimTyCon :: TyCon -- The representation type for equality predicates
-- See Note [The ~# TyCon]
eqPrimTyCon = mkPrimTyCon eqPrimTyConName kind [Nominal, Nominal, Nominal] VoidRep
where kind = ForAllTy kv $ mkArrowKinds [k, k] unliftedTypeKind
kv = kKiVar
k = mkTyVarTy kv
-- like eqPrimTyCon, but the type for *Representational* coercions
-- this should only ever appear as the type of a covar. Its role is
-- interpreted in coercionRole
| 483
|
eqPrimTyCon :: TyCon
eqPrimTyCon = mkPrimTyCon eqPrimTyConName kind [Nominal, Nominal, Nominal] VoidRep
where kind = ForAllTy kv $ mkArrowKinds [k, k] unliftedTypeKind
kv = kKiVar
k = mkTyVarTy kv
-- like eqPrimTyCon, but the type for *Representational* coercions
-- this should only ever appear as the type of a covar. Its role is
-- interpreted in coercionRole
| 382
|
eqPrimTyCon = mkPrimTyCon eqPrimTyConName kind [Nominal, Nominal, Nominal] VoidRep
where kind = ForAllTy kv $ mkArrowKinds [k, k] unliftedTypeKind
kv = kKiVar
k = mkTyVarTy kv
-- like eqPrimTyCon, but the type for *Representational* coercions
-- this should only ever appear as the type of a covar. Its role is
-- interpreted in coercionRole
| 361
| true
| true
| 3
| 7
| 112
| 88
| 42
| 46
| null | null |
sherwoodwang/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxSTC_SN_REGEXTAG :: Int
wxSTC_SN_REGEXTAG = 13
| 47
|
wxSTC_SN_REGEXTAG :: Int
wxSTC_SN_REGEXTAG = 13
| 47
|
wxSTC_SN_REGEXTAG = 13
| 22
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
prowdsponsor/mangopay
|
yesod-mangopay/app/Application.hs
|
bsd-3-clause
|
makeFoundation :: AppConfig DefaultEnv Extra -> IO App
makeFoundation conf = do
manager <- newManager conduitManagerSettings
s <- staticSite
loggerSet' <- newStdoutLoggerSet defaultBufSize
(getter, updater) <- clockDateCacher
iorToken<-newIORef Nothing
iorEvents<-newIORef []
-- If the Yesod logger (as opposed to the request logger middleware) is
-- used less than once a second on average, you may prefer to omit this
-- thread and use "(updater >> getter)" in place of "getter" below. That
-- would update the cache every time it is used, instead of every second.
let updateLoop = do
threadDelay 1000000
updater
updateLoop
_ <- forkIO updateLoop
let logger = Yesod.Core.Types.Logger loggerSet' getter
foundation = App conf s manager logger iorToken iorEvents
return foundation
-- for yesod devel
| 902
|
makeFoundation :: AppConfig DefaultEnv Extra -> IO App
makeFoundation conf = do
manager <- newManager conduitManagerSettings
s <- staticSite
loggerSet' <- newStdoutLoggerSet defaultBufSize
(getter, updater) <- clockDateCacher
iorToken<-newIORef Nothing
iorEvents<-newIORef []
-- If the Yesod logger (as opposed to the request logger middleware) is
-- used less than once a second on average, you may prefer to omit this
-- thread and use "(updater >> getter)" in place of "getter" below. That
-- would update the cache every time it is used, instead of every second.
let updateLoop = do
threadDelay 1000000
updater
updateLoop
_ <- forkIO updateLoop
let logger = Yesod.Core.Types.Logger loggerSet' getter
foundation = App conf s manager logger iorToken iorEvents
return foundation
-- for yesod devel
| 902
|
makeFoundation conf = do
manager <- newManager conduitManagerSettings
s <- staticSite
loggerSet' <- newStdoutLoggerSet defaultBufSize
(getter, updater) <- clockDateCacher
iorToken<-newIORef Nothing
iorEvents<-newIORef []
-- If the Yesod logger (as opposed to the request logger middleware) is
-- used less than once a second on average, you may prefer to omit this
-- thread and use "(updater >> getter)" in place of "getter" below. That
-- would update the cache every time it is used, instead of every second.
let updateLoop = do
threadDelay 1000000
updater
updateLoop
_ <- forkIO updateLoop
let logger = Yesod.Core.Types.Logger loggerSet' getter
foundation = App conf s manager logger iorToken iorEvents
return foundation
-- for yesod devel
| 847
| false
| true
| 0
| 16
| 222
| 167
| 76
| 91
| null | null |
lukexi/ghc
|
libraries/base/Data/Typeable/Internal.hs
|
bsd-3-clause
|
-- | Applies a type to a function type. Returns: @'Just' u@ if the
-- first argument represents a function of type @t -> u@ and the
-- second argument represents a function of type @t@. Otherwise,
-- returns 'Nothing'.
funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep
funResultTy trFun trArg
= case splitTyConApp trFun of
(tc, [t1,t2]) | tc == funTc && t1 == trArg -> Just t2
_ -> Nothing
-- | Adds a TypeRep argument to a TypeRep.
| 450
|
funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep
funResultTy trFun trArg
= case splitTyConApp trFun of
(tc, [t1,t2]) | tc == funTc && t1 == trArg -> Just t2
_ -> Nothing
-- | Adds a TypeRep argument to a TypeRep.
| 229
|
funResultTy trFun trArg
= case splitTyConApp trFun of
(tc, [t1,t2]) | tc == funTc && t1 == trArg -> Just t2
_ -> Nothing
-- | Adds a TypeRep argument to a TypeRep.
| 178
| true
| true
| 0
| 13
| 97
| 84
| 44
| 40
| null | null |
Heather/io-ref-tests
|
test/test.hs
|
bsd-3-clause
|
main = do
test1 =<< int 1
test1 =<< float 1.0
x <- int 1
x += 4
x -= 2
print x
| 121
|
main = do
test1 =<< int 1
test1 =<< float 1.0
x <- int 1
x += 4
x -= 2
print x
| 121
|
main = do
test1 =<< int 1
test1 =<< float 1.0
x <- int 1
x += 4
x -= 2
print x
| 121
| false
| false
| 0
| 8
| 65
| 56
| 23
| 33
| null | null |
dolio/vector
|
Data/Vector/Fusion/Util.hs
|
bsd-3-clause
|
delay_inline f = f
| 18
|
delay_inline f = f
| 18
|
delay_inline f = f
| 18
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
dillonhuff/Folly
|
src/Folly/Lexer.hs
|
bsd-3-clause
|
testOp s = Sep s (newPos "DUMMY" 0 0)
| 37
|
testOp s = Sep s (newPos "DUMMY" 0 0)
| 37
|
testOp s = Sep s (newPos "DUMMY" 0 0)
| 37
| false
| false
| 1
| 7
| 8
| 29
| 11
| 18
| null | null |
urbanslug/ghc
|
testsuite/tests/codeGen/should_run/CopySmallArray.hs
|
bsd-3-clause
|
indexArray :: Array a -> Int -> a
indexArray arr i@(I# i#)
| i < 0 || i >= len =
error $ "bounds error, offset " ++ show i ++ ", length " ++ show len
| otherwise = case indexSmallArray# (unArray arr) i# of
(# a #) -> a
where len = lengthArray arr
| 264
|
indexArray :: Array a -> Int -> a
indexArray arr i@(I# i#)
| i < 0 || i >= len =
error $ "bounds error, offset " ++ show i ++ ", length " ++ show len
| otherwise = case indexSmallArray# (unArray arr) i# of
(# a #) -> a
where len = lengthArray arr
| 264
|
indexArray arr i@(I# i#)
| i < 0 || i >= len =
error $ "bounds error, offset " ++ show i ++ ", length " ++ show len
| otherwise = case indexSmallArray# (unArray arr) i# of
(# a #) -> a
where len = lengthArray arr
| 230
| false
| true
| 1
| 10
| 73
| 117
| 56
| 61
| null | null |
li-zhirui/EoplLangs
|
src/LetLang/Parser.hs
|
bsd-3-clause
|
expression :: Parser Expression
expression = try constExpr
<|> try binOpExpr
<|> try unaryOpExpr
<|> try ifExpr
<|> try condExpr
<|> try varExpr
<|> try letStarExpr
<|> try letExpr
<|> try emptyListExpr
<|> try listExpr
| 300
|
expression :: Parser Expression
expression = try constExpr
<|> try binOpExpr
<|> try unaryOpExpr
<|> try ifExpr
<|> try condExpr
<|> try varExpr
<|> try letStarExpr
<|> try letExpr
<|> try emptyListExpr
<|> try listExpr
| 300
|
expression = try constExpr
<|> try binOpExpr
<|> try unaryOpExpr
<|> try ifExpr
<|> try condExpr
<|> try varExpr
<|> try letStarExpr
<|> try letExpr
<|> try emptyListExpr
<|> try listExpr
| 268
| false
| true
| 27
| 6
| 115
| 113
| 54
| 59
| null | null |
aj-michael/persistent
|
src/LeftistHeap.hs
|
mit
|
rank (T r _ _ _) = r
| 20
|
rank (T r _ _ _) = r
| 20
|
rank (T r _ _ _) = r
| 20
| false
| false
| 0
| 6
| 7
| 22
| 10
| 12
| null | null |
nh2/WashNGo
|
WASH/HTML/HTMLPrelude.hs
|
bsd-3-clause
|
isindex f elt = elt `add` f (make ISINDEX)
| 42
|
isindex f elt = elt `add` f (make ISINDEX)
| 42
|
isindex f elt = elt `add` f (make ISINDEX)
| 42
| false
| false
| 0
| 8
| 8
| 26
| 13
| 13
| null | null |
LightAndLight/hindley-milner
|
src/Phil/Parser.hs
|
bsd-3-clause
|
definition :: (TokenParsing m, IndentationParsing m, Monad m) => m Definition
definition =
(dataDefinition <?> "data definition") <|>
(classDefinition <?> "class definition") <|>
(instanceDefinition <?> "instance definition") <|>
(try typeSignature <?> "type signature") <|>
(functionDefinition <?> "function definition")
| 331
|
definition :: (TokenParsing m, IndentationParsing m, Monad m) => m Definition
definition =
(dataDefinition <?> "data definition") <|>
(classDefinition <?> "class definition") <|>
(instanceDefinition <?> "instance definition") <|>
(try typeSignature <?> "type signature") <|>
(functionDefinition <?> "function definition")
| 331
|
definition =
(dataDefinition <?> "data definition") <|>
(classDefinition <?> "class definition") <|>
(instanceDefinition <?> "instance definition") <|>
(try typeSignature <?> "type signature") <|>
(functionDefinition <?> "function definition")
| 253
| false
| true
| 0
| 10
| 47
| 89
| 47
| 42
| null | null |
tolysz/prepare-ghcjs
|
spec-lts8/base/Text/Printf.hs
|
bsd-3-clause
|
-- | Formatter for 'String' values.
--
-- @since 4.7.0.0
formatString :: IsChar a => [a] -> FieldFormatter
formatString x ufmt =
case fmtChar $ vFmt 's' ufmt of
's' -> map toChar . (adjust ufmt ("", ts) ++)
where
ts = map toChar $ trunc $ fmtPrecision ufmt
where
trunc Nothing = x
trunc (Just n) = take n x
c -> errorBadFormat c
-- Possibly apply the int modifiers to get a new
-- int width for conversion.
| 492
|
formatString :: IsChar a => [a] -> FieldFormatter
formatString x ufmt =
case fmtChar $ vFmt 's' ufmt of
's' -> map toChar . (adjust ufmt ("", ts) ++)
where
ts = map toChar $ trunc $ fmtPrecision ufmt
where
trunc Nothing = x
trunc (Just n) = take n x
c -> errorBadFormat c
-- Possibly apply the int modifiers to get a new
-- int width for conversion.
| 435
|
formatString x ufmt =
case fmtChar $ vFmt 's' ufmt of
's' -> map toChar . (adjust ufmt ("", ts) ++)
where
ts = map toChar $ trunc $ fmtPrecision ufmt
where
trunc Nothing = x
trunc (Just n) = take n x
c -> errorBadFormat c
-- Possibly apply the int modifiers to get a new
-- int width for conversion.
| 385
| true
| true
| 0
| 14
| 165
| 140
| 70
| 70
| null | null |
jsavatgy/dit-doo
|
code/look-accum-01.hs
|
gpl-2.0
|
rootmap str =
Map.fromListWith (Map.unionWith (+)) t
where
t = [(init s, Map.singleton (last s) 1) | s <- chks str]
chks str = concat [chunks x str | x <- ns]
| 172
|
rootmap str =
Map.fromListWith (Map.unionWith (+)) t
where
t = [(init s, Map.singleton (last s) 1) | s <- chks str]
chks str = concat [chunks x str | x <- ns]
| 172
|
rootmap str =
Map.fromListWith (Map.unionWith (+)) t
where
t = [(init s, Map.singleton (last s) 1) | s <- chks str]
chks str = concat [chunks x str | x <- ns]
| 172
| false
| false
| 1
| 9
| 45
| 100
| 48
| 52
| null | null |
misgeatgit/opencog
|
opencog/nlp/lojban/HaskellLib/src/OpenCog/Lojban/Syntax/Util.hs
|
agpl-3.0
|
setFlagValueIso :: Flag -> SynIso String ()
setFlagValueIso flag = inverse (getFlagValueIso flag)
| 97
|
setFlagValueIso :: Flag -> SynIso String ()
setFlagValueIso flag = inverse (getFlagValueIso flag)
| 97
|
setFlagValueIso flag = inverse (getFlagValueIso flag)
| 53
| false
| true
| 0
| 8
| 12
| 38
| 17
| 21
| null | null |
rudyl313/factual-haskell-driver
|
Network/Factual/API.hs
|
bsd-3-clause
|
formMultiQueryString :: (Query query) => [(String, query)] -> String
formMultiQueryString ps = "/multi?queries=" ++ (urlEncode $ "{" ++ (join "," $ map queryPair ps) ++ "}")
where queryPair (n,q) = "\"" ++ n ++ "\":\"" ++ (formQueryString (path q) (params q)) ++ "\""
| 269
|
formMultiQueryString :: (Query query) => [(String, query)] -> String
formMultiQueryString ps = "/multi?queries=" ++ (urlEncode $ "{" ++ (join "," $ map queryPair ps) ++ "}")
where queryPair (n,q) = "\"" ++ n ++ "\":\"" ++ (formQueryString (path q) (params q)) ++ "\""
| 269
|
formMultiQueryString ps = "/multi?queries=" ++ (urlEncode $ "{" ++ (join "," $ map queryPair ps) ++ "}")
where queryPair (n,q) = "\"" ++ n ++ "\":\"" ++ (formQueryString (path q) (params q)) ++ "\""
| 200
| false
| true
| 4
| 11
| 44
| 132
| 65
| 67
| null | null |
PeterPiggyDevelopment/TitaniumCloud
|
src/HttpSend.hs
|
gpl-3.0
|
httpSendBinary :: StatusCode -> ByteString -> Response String
httpSendBinary s v = insertHeader HdrConnection "close"
$ insertHeader HdrContentLength (show (Bin.length v))
(respond s :: Response String) { rspBody = C.unpack v }
| 271
|
httpSendBinary :: StatusCode -> ByteString -> Response String
httpSendBinary s v = insertHeader HdrConnection "close"
$ insertHeader HdrContentLength (show (Bin.length v))
(respond s :: Response String) { rspBody = C.unpack v }
| 271
|
httpSendBinary s v = insertHeader HdrConnection "close"
$ insertHeader HdrContentLength (show (Bin.length v))
(respond s :: Response String) { rspBody = C.unpack v }
| 203
| false
| true
| 0
| 11
| 75
| 82
| 40
| 42
| null | null |
chreekat/snowdrift
|
View/Comment.hs
|
agpl-3.0
|
disabledCommentForm :: Form Markdown
disabledCommentForm = renderBootstrap3 BootstrapBasicForm $ areq snowdriftMarkdownField ("Reply" { fsAttrs = [("disabled",""), ("class","form-control")] }) Nothing
| 200
|
disabledCommentForm :: Form Markdown
disabledCommentForm = renderBootstrap3 BootstrapBasicForm $ areq snowdriftMarkdownField ("Reply" { fsAttrs = [("disabled",""), ("class","form-control")] }) Nothing
| 200
|
disabledCommentForm = renderBootstrap3 BootstrapBasicForm $ areq snowdriftMarkdownField ("Reply" { fsAttrs = [("disabled",""), ("class","form-control")] }) Nothing
| 163
| false
| true
| 0
| 11
| 18
| 57
| 32
| 25
| null | null |
juhp/stack
|
src/Stack/SourceMap.hs
|
bsd-3-clause
|
-- | Create a 'ProjectPackage' from a directory containing a package.
mkProjectPackage ::
forall env. (HasPantryConfig env, HasLogFunc env, HasProcessContext env)
=> PrintWarnings
-> ResolvedPath Dir
-> Bool
-> RIO env ProjectPackage
mkProjectPackage printWarnings dir buildHaddocks = do
(gpd, name, cabalfp) <- loadCabalFilePath (resolvedAbsolute dir)
return ProjectPackage
{ ppCabalFP = cabalfp
, ppResolvedDir = dir
, ppCommon = CommonPackage
{ cpGPD = gpd printWarnings
, cpName = name
, cpFlags = mempty
, cpGhcOptions = mempty
, cpCabalConfigOpts = mempty
, cpHaddocks = buildHaddocks
}
}
-- | Create a 'DepPackage' from a 'PackageLocation', from some additional
-- to a snapshot setting (extra-deps or command line)
| 898
|
mkProjectPackage ::
forall env. (HasPantryConfig env, HasLogFunc env, HasProcessContext env)
=> PrintWarnings
-> ResolvedPath Dir
-> Bool
-> RIO env ProjectPackage
mkProjectPackage printWarnings dir buildHaddocks = do
(gpd, name, cabalfp) <- loadCabalFilePath (resolvedAbsolute dir)
return ProjectPackage
{ ppCabalFP = cabalfp
, ppResolvedDir = dir
, ppCommon = CommonPackage
{ cpGPD = gpd printWarnings
, cpName = name
, cpFlags = mempty
, cpGhcOptions = mempty
, cpCabalConfigOpts = mempty
, cpHaddocks = buildHaddocks
}
}
-- | Create a 'DepPackage' from a 'PackageLocation', from some additional
-- to a snapshot setting (extra-deps or command line)
| 828
|
mkProjectPackage printWarnings dir buildHaddocks = do
(gpd, name, cabalfp) <- loadCabalFilePath (resolvedAbsolute dir)
return ProjectPackage
{ ppCabalFP = cabalfp
, ppResolvedDir = dir
, ppCommon = CommonPackage
{ cpGPD = gpd printWarnings
, cpName = name
, cpFlags = mempty
, cpGhcOptions = mempty
, cpCabalConfigOpts = mempty
, cpHaddocks = buildHaddocks
}
}
-- | Create a 'DepPackage' from a 'PackageLocation', from some additional
-- to a snapshot setting (extra-deps or command line)
| 641
| true
| true
| 0
| 12
| 281
| 160
| 89
| 71
| null | null |
YoEight/spellcheck
|
tests/HUnit.hs
|
mit
|
case_load_corpus = do
c <- loadHolbrook "data/holbrook-tagged-dev.dat"
c `seq` return ()
| 96
|
case_load_corpus = do
c <- loadHolbrook "data/holbrook-tagged-dev.dat"
c `seq` return ()
| 96
|
case_load_corpus = do
c <- loadHolbrook "data/holbrook-tagged-dev.dat"
c `seq` return ()
| 96
| false
| false
| 1
| 10
| 18
| 34
| 14
| 20
| null | null |
Fuuzetsu/rtorrent-state
|
src/Data/Rtorrent/StateFile.hs
|
gpl-3.0
|
-- | Like 'parseFile'' but throws away the 'FilePath': useful if we
-- only play with single files.
parseFile ∷ FilePath → IO (Result StateFile)
parseFile = parseFile' >=> return . snd
| 184
|
parseFile ∷ FilePath → IO (Result StateFile)
parseFile = parseFile' >=> return . snd
| 84
|
parseFile = parseFile' >=> return . snd
| 39
| true
| true
| 0
| 8
| 31
| 34
| 18
| 16
| null | null |
brendanhay/gogol
|
gogol-deploymentmanager/gen/Network/Google/Resource/DeploymentManager/Deployments/Delete.hs
|
mpl-2.0
|
-- | Creates a value of 'DeploymentsDelete' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ddXgafv'
--
-- * 'ddUploadProtocol'
--
-- * 'ddProject'
--
-- * 'ddAccessToken'
--
-- * 'ddUploadType'
--
-- * 'ddDeletePolicy'
--
-- * 'ddCallback'
--
-- * 'ddDeployment'
deploymentsDelete
:: Text -- ^ 'ddProject'
-> Text -- ^ 'ddDeployment'
-> DeploymentsDelete
deploymentsDelete pDdProject_ pDdDeployment_ =
DeploymentsDelete'
{ _ddXgafv = Nothing
, _ddUploadProtocol = Nothing
, _ddProject = pDdProject_
, _ddAccessToken = Nothing
, _ddUploadType = Nothing
, _ddDeletePolicy = Delete'
, _ddCallback = Nothing
, _ddDeployment = pDdDeployment_
}
| 775
|
deploymentsDelete
:: Text -- ^ 'ddProject'
-> Text -- ^ 'ddDeployment'
-> DeploymentsDelete
deploymentsDelete pDdProject_ pDdDeployment_ =
DeploymentsDelete'
{ _ddXgafv = Nothing
, _ddUploadProtocol = Nothing
, _ddProject = pDdProject_
, _ddAccessToken = Nothing
, _ddUploadType = Nothing
, _ddDeletePolicy = Delete'
, _ddCallback = Nothing
, _ddDeployment = pDdDeployment_
}
| 425
|
deploymentsDelete pDdProject_ pDdDeployment_ =
DeploymentsDelete'
{ _ddXgafv = Nothing
, _ddUploadProtocol = Nothing
, _ddProject = pDdProject_
, _ddAccessToken = Nothing
, _ddUploadType = Nothing
, _ddDeletePolicy = Delete'
, _ddCallback = Nothing
, _ddDeployment = pDdDeployment_
}
| 321
| true
| true
| 0
| 6
| 162
| 95
| 66
| 29
| null | null |
pranaysashank/poi
|
poi-bin/src/Poi/Migrations/Utils.hs
|
mit
|
readConfigWithDefault :: String -> IO Config
readConfigWithDefault ename = do
result <- try $ getEnv "APP_ENV" :: IO (Either SomeException String)
either (\_ -> readConfigForEnv ename)
(\en -> readConfigForEnv en)
result
| 242
|
readConfigWithDefault :: String -> IO Config
readConfigWithDefault ename = do
result <- try $ getEnv "APP_ENV" :: IO (Either SomeException String)
either (\_ -> readConfigForEnv ename)
(\en -> readConfigForEnv en)
result
| 242
|
readConfigWithDefault ename = do
result <- try $ getEnv "APP_ENV" :: IO (Either SomeException String)
either (\_ -> readConfigForEnv ename)
(\en -> readConfigForEnv en)
result
| 197
| false
| true
| 0
| 10
| 52
| 81
| 39
| 42
| null | null |
kumasento/accelerate
|
Data/Array/Accelerate/Smart.hs
|
bsd-3-clause
|
untup5 :: (Elt a, Elt b, Elt c, Elt d, Elt e)
=> Exp (a, b, c, d, e) -> (Exp a, Exp b, Exp c, Exp d, Exp e)
untup5 e = (Exp $ SuccTupIdx (SuccTupIdx (SuccTupIdx (SuccTupIdx ZeroTupIdx))) `Prj` e,
Exp $ SuccTupIdx (SuccTupIdx (SuccTupIdx ZeroTupIdx)) `Prj` e,
Exp $ SuccTupIdx (SuccTupIdx ZeroTupIdx) `Prj` e,
Exp $ SuccTupIdx ZeroTupIdx `Prj` e,
Exp $ ZeroTupIdx `Prj` e)
| 426
|
untup5 :: (Elt a, Elt b, Elt c, Elt d, Elt e)
=> Exp (a, b, c, d, e) -> (Exp a, Exp b, Exp c, Exp d, Exp e)
untup5 e = (Exp $ SuccTupIdx (SuccTupIdx (SuccTupIdx (SuccTupIdx ZeroTupIdx))) `Prj` e,
Exp $ SuccTupIdx (SuccTupIdx (SuccTupIdx ZeroTupIdx)) `Prj` e,
Exp $ SuccTupIdx (SuccTupIdx ZeroTupIdx) `Prj` e,
Exp $ SuccTupIdx ZeroTupIdx `Prj` e,
Exp $ ZeroTupIdx `Prj` e)
| 426
|
untup5 e = (Exp $ SuccTupIdx (SuccTupIdx (SuccTupIdx (SuccTupIdx ZeroTupIdx))) `Prj` e,
Exp $ SuccTupIdx (SuccTupIdx (SuccTupIdx ZeroTupIdx)) `Prj` e,
Exp $ SuccTupIdx (SuccTupIdx ZeroTupIdx) `Prj` e,
Exp $ SuccTupIdx ZeroTupIdx `Prj` e,
Exp $ ZeroTupIdx `Prj` e)
| 311
| false
| true
| 0
| 14
| 122
| 212
| 114
| 98
| null | null |
GaloisInc/mistral
|
src/Mistral/TypeCheck/AST.hs
|
bsd-3-clause
|
appC :: Expr -> [Expr] -> Expr
appC f xs
| null xs = f
| otherwise = ECApp f xs
| 85
|
appC :: Expr -> [Expr] -> Expr
appC f xs
| null xs = f
| otherwise = ECApp f xs
| 85
|
appC f xs
| null xs = f
| otherwise = ECApp f xs
| 54
| false
| true
| 1
| 8
| 26
| 48
| 23
| 25
| null | null |
qnikst/network-transport
|
src/Network/Transport/Internal.hs
|
bsd-3-clause
|
-- | Deserialize 16-bit from network byte order
-- Throws an IO exception if this is not a valid integer
decodeInt16 :: Num a => ByteString -> a
decodeInt16 bs
| BS.length bs /= 2 = throw $ userError "decodeInt16: Invalid length"
| otherwise = BSI.inlinePerformIO $ do
let (fp, offset, _) = BSI.toForeignPtr bs
withForeignPtr fp $ \p -> do
w16 <- peekByteOff p offset
return (fromIntegral . ntohs $ w16)
-- | Prepend a list of bytestrings with their total length
| 503
|
decodeInt16 :: Num a => ByteString -> a
decodeInt16 bs
| BS.length bs /= 2 = throw $ userError "decodeInt16: Invalid length"
| otherwise = BSI.inlinePerformIO $ do
let (fp, offset, _) = BSI.toForeignPtr bs
withForeignPtr fp $ \p -> do
w16 <- peekByteOff p offset
return (fromIntegral . ntohs $ w16)
-- | Prepend a list of bytestrings with their total length
| 398
|
decodeInt16 bs
| BS.length bs /= 2 = throw $ userError "decodeInt16: Invalid length"
| otherwise = BSI.inlinePerformIO $ do
let (fp, offset, _) = BSI.toForeignPtr bs
withForeignPtr fp $ \p -> do
w16 <- peekByteOff p offset
return (fromIntegral . ntohs $ w16)
-- | Prepend a list of bytestrings with their total length
| 358
| true
| true
| 1
| 16
| 123
| 132
| 63
| 69
| null | null |
GaloisInc/halvm-ghc
|
compiler/typecheck/TcType.hs
|
bsd-3-clause
|
isTauTy (AppTy a b) = isTauTy a && isTauTy b
| 54
|
isTauTy (AppTy a b) = isTauTy a && isTauTy b
| 54
|
isTauTy (AppTy a b) = isTauTy a && isTauTy b
| 54
| false
| false
| 0
| 6
| 19
| 28
| 12
| 16
| null | null |
IanConnolly/aws-sdk-fork
|
AWS/EC2/Instance.hs
|
bsd-3-clause
|
------------------------------------------------------------
-- GetPasswordData
------------------------------------------------------------
getPasswordData
:: (MonadResource m, MonadBaseControl IO m)
=> Text -- ^ InstanceId
-> EC2 m PasswordData
getPasswordData iid =
ec2Query "GetPasswordData" ["InstanceId" |= iid] $
PasswordData
<$> getT "instanceId"
<*> getT "timestamp"
<*> getT "passwordData"
| 447
|
getPasswordData
:: (MonadResource m, MonadBaseControl IO m)
=> Text -- ^ InstanceId
-> EC2 m PasswordData
getPasswordData iid =
ec2Query "GetPasswordData" ["InstanceId" |= iid] $
PasswordData
<$> getT "instanceId"
<*> getT "timestamp"
<*> getT "passwordData"
| 306
|
getPasswordData iid =
ec2Query "GetPasswordData" ["InstanceId" |= iid] $
PasswordData
<$> getT "instanceId"
<*> getT "timestamp"
<*> getT "passwordData"
| 188
| true
| true
| 8
| 8
| 86
| 94
| 46
| 48
| null | null |
haskell-streaming/streaming
|
src/Streaming/Prelude.hs
|
bsd-3-clause
|
elem :: (Monad m, Eq a) => a -> Stream (Of a) m r -> m (Of Bool r)
elem a' = loop False where
loop True str = fmap (True :>) (effects str)
loop False str = case str of
Return r -> return (False :> r)
Effect m -> m >>= loop False
Step (a:> rest) ->
if a == a'
then fmap (True :>) (effects rest)
else loop False rest
| 353
|
elem :: (Monad m, Eq a) => a -> Stream (Of a) m r -> m (Of Bool r)
elem a' = loop False where
loop True str = fmap (True :>) (effects str)
loop False str = case str of
Return r -> return (False :> r)
Effect m -> m >>= loop False
Step (a:> rest) ->
if a == a'
then fmap (True :>) (effects rest)
else loop False rest
| 353
|
elem a' = loop False where
loop True str = fmap (True :>) (effects str)
loop False str = case str of
Return r -> return (False :> r)
Effect m -> m >>= loop False
Step (a:> rest) ->
if a == a'
then fmap (True :>) (effects rest)
else loop False rest
| 286
| false
| true
| 0
| 13
| 111
| 188
| 93
| 95
| null | null |
hvr/xcabal
|
src/Main.hs
|
bsd-3-clause
|
mainWorker :: [String] -> IO ()
mainWorker args = topHandler $
case commandsRun (globalCommand commands) commands args of
CommandHelp help -> printGlobalHelp help
CommandList opts -> printOptionsList opts
CommandErrors errs -> printErrors errs
CommandReadyToGo (globalFlags, commandParse) ->
case commandParse of
_ | fromFlagOrDefault False (globalVersion globalFlags)
-> printVersion
| fromFlagOrDefault False (globalNumericVersion globalFlags)
-> printNumericVersion
CommandHelp help -> printCommandHelp help
CommandList opts -> printOptionsList opts
CommandErrors errs -> printErrors errs
CommandReadyToGo action -> do
globalFlags' <- updateSandboxConfigFileFlag globalFlags
action globalFlags'
where
printCommandHelp help = do
pname <- getProgName
putStr (help pname)
printGlobalHelp help = do
pname <- getProgName
configFile <- defaultConfigFile
putStr (help pname)
putStr $ "\nYou can edit the cabal configuration file to set defaults:\n"
++ " " ++ configFile ++ "\n"
exists <- doesFileExist configFile
when (not exists) $
putStrLn $ "This file will be generated with sensible "
++ "defaults if you run 'cabal update'."
printOptionsList = putStr . unlines
printErrors errs = die $ intercalate "\n" errs
printNumericVersion = putStrLn $ display Paths_cabal_install.version
printVersion = putStrLn $ "cabal-install version "
++ display Paths_cabal_install.version
++ "\nusing version "
++ display cabalVersion
++ " of the Cabal library "
commands =
[ xlistCommand `commandAddAction` xlistAction
, installCommand `commandAddAction` installAction
]
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
| 2,290
|
mainWorker :: [String] -> IO ()
mainWorker args = topHandler $
case commandsRun (globalCommand commands) commands args of
CommandHelp help -> printGlobalHelp help
CommandList opts -> printOptionsList opts
CommandErrors errs -> printErrors errs
CommandReadyToGo (globalFlags, commandParse) ->
case commandParse of
_ | fromFlagOrDefault False (globalVersion globalFlags)
-> printVersion
| fromFlagOrDefault False (globalNumericVersion globalFlags)
-> printNumericVersion
CommandHelp help -> printCommandHelp help
CommandList opts -> printOptionsList opts
CommandErrors errs -> printErrors errs
CommandReadyToGo action -> do
globalFlags' <- updateSandboxConfigFileFlag globalFlags
action globalFlags'
where
printCommandHelp help = do
pname <- getProgName
putStr (help pname)
printGlobalHelp help = do
pname <- getProgName
configFile <- defaultConfigFile
putStr (help pname)
putStr $ "\nYou can edit the cabal configuration file to set defaults:\n"
++ " " ++ configFile ++ "\n"
exists <- doesFileExist configFile
when (not exists) $
putStrLn $ "This file will be generated with sensible "
++ "defaults if you run 'cabal update'."
printOptionsList = putStr . unlines
printErrors errs = die $ intercalate "\n" errs
printNumericVersion = putStrLn $ display Paths_cabal_install.version
printVersion = putStrLn $ "cabal-install version "
++ display Paths_cabal_install.version
++ "\nusing version "
++ display cabalVersion
++ " of the Cabal library "
commands =
[ xlistCommand `commandAddAction` xlistAction
, installCommand `commandAddAction` installAction
]
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
| 2,290
|
mainWorker args = topHandler $
case commandsRun (globalCommand commands) commands args of
CommandHelp help -> printGlobalHelp help
CommandList opts -> printOptionsList opts
CommandErrors errs -> printErrors errs
CommandReadyToGo (globalFlags, commandParse) ->
case commandParse of
_ | fromFlagOrDefault False (globalVersion globalFlags)
-> printVersion
| fromFlagOrDefault False (globalNumericVersion globalFlags)
-> printNumericVersion
CommandHelp help -> printCommandHelp help
CommandList opts -> printOptionsList opts
CommandErrors errs -> printErrors errs
CommandReadyToGo action -> do
globalFlags' <- updateSandboxConfigFileFlag globalFlags
action globalFlags'
where
printCommandHelp help = do
pname <- getProgName
putStr (help pname)
printGlobalHelp help = do
pname <- getProgName
configFile <- defaultConfigFile
putStr (help pname)
putStr $ "\nYou can edit the cabal configuration file to set defaults:\n"
++ " " ++ configFile ++ "\n"
exists <- doesFileExist configFile
when (not exists) $
putStrLn $ "This file will be generated with sensible "
++ "defaults if you run 'cabal update'."
printOptionsList = putStr . unlines
printErrors errs = die $ intercalate "\n" errs
printNumericVersion = putStrLn $ display Paths_cabal_install.version
printVersion = putStrLn $ "cabal-install version "
++ display Paths_cabal_install.version
++ "\nusing version "
++ display cabalVersion
++ " of the Cabal library "
commands =
[ xlistCommand `commandAddAction` xlistAction
, installCommand `commandAddAction` installAction
]
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
| 2,258
| false
| true
| 11
| 16
| 713
| 447
| 199
| 248
| null | null |
michel-steuwer/haskell-patterns
|
src/Patterns.hs
|
mit
|
vectorScale4 :: forall a. Num a => [a] -> [a]
vectorScale4 xs = join . mapWorkgroup (
asScalar . mapLocal (vectorize 4 mult3) . asVector 4
) . split (s `div` 2) $ xs
where s = length xs
-- reduction
| 218
|
vectorScale4 :: forall a. Num a => [a] -> [a]
vectorScale4 xs = join . mapWorkgroup (
asScalar . mapLocal (vectorize 4 mult3) . asVector 4
) . split (s `div` 2) $ xs
where s = length xs
-- reduction
| 218
|
vectorScale4 xs = join . mapWorkgroup (
asScalar . mapLocal (vectorize 4 mult3) . asVector 4
) . split (s `div` 2) $ xs
where s = length xs
-- reduction
| 172
| false
| true
| 0
| 14
| 60
| 100
| 51
| 49
| null | null |
tomymehdi/ai-haskell
|
final/Experiments.hs
|
mit
|
gui :: IO ()
gui = do
f <- frame [ text := "Neural Network" ]
lEpocs <- staticText f [ text := "Epocs"]
lMiddleLayers <- staticText f [ text := "Middle & output layers"]
lLearningRate <- staticText f [ text := "Learning rate"]
iEpocs <- textCtrlRich f [ text := "1000" ]
iMiddleLayers <- textCtrlRich f [ text := "2,2,1"]
iLearningRate <- textCtrlRich f [ text := "0.8"]
bStart <- button f [ text := "Start" ]
bQuit <- button f [ text := "Quit" ]
set bStart [ on command := parseInputAndTrain f iEpocs iMiddleLayers iLearningRate]
set bQuit [ on command := close f]
set f [ layout := column 25 [ widget lEpocs, widget iEpocs,
widget lMiddleLayers, widget iMiddleLayers,
widget lLearningRate, widget iLearningRate,
widget bStart, widget bQuit ] ]
| 959
|
gui :: IO ()
gui = do
f <- frame [ text := "Neural Network" ]
lEpocs <- staticText f [ text := "Epocs"]
lMiddleLayers <- staticText f [ text := "Middle & output layers"]
lLearningRate <- staticText f [ text := "Learning rate"]
iEpocs <- textCtrlRich f [ text := "1000" ]
iMiddleLayers <- textCtrlRich f [ text := "2,2,1"]
iLearningRate <- textCtrlRich f [ text := "0.8"]
bStart <- button f [ text := "Start" ]
bQuit <- button f [ text := "Quit" ]
set bStart [ on command := parseInputAndTrain f iEpocs iMiddleLayers iLearningRate]
set bQuit [ on command := close f]
set f [ layout := column 25 [ widget lEpocs, widget iEpocs,
widget lMiddleLayers, widget iMiddleLayers,
widget lLearningRate, widget iLearningRate,
widget bStart, widget bQuit ] ]
| 959
|
gui = do
f <- frame [ text := "Neural Network" ]
lEpocs <- staticText f [ text := "Epocs"]
lMiddleLayers <- staticText f [ text := "Middle & output layers"]
lLearningRate <- staticText f [ text := "Learning rate"]
iEpocs <- textCtrlRich f [ text := "1000" ]
iMiddleLayers <- textCtrlRich f [ text := "2,2,1"]
iLearningRate <- textCtrlRich f [ text := "0.8"]
bStart <- button f [ text := "Start" ]
bQuit <- button f [ text := "Quit" ]
set bStart [ on command := parseInputAndTrain f iEpocs iMiddleLayers iLearningRate]
set bQuit [ on command := close f]
set f [ layout := column 25 [ widget lEpocs, widget iEpocs,
widget lMiddleLayers, widget iMiddleLayers,
widget lLearningRate, widget iLearningRate,
widget bStart, widget bQuit ] ]
| 946
| false
| true
| 1
| 13
| 345
| 305
| 142
| 163
| null | null |
wellposed/hblas
|
src/Numerical/HBLAS/BLAS/Level1.hs
|
bsd-3-clause
|
zdotc :: PrimMonad m => ComplexDotFun (Complex Double) (PrimState m) m
zdotc = complexDotAbstraction "zdotc" cblas_zdotc_safe cblas_zdotc_unsafe
| 144
|
zdotc :: PrimMonad m => ComplexDotFun (Complex Double) (PrimState m) m
zdotc = complexDotAbstraction "zdotc" cblas_zdotc_safe cblas_zdotc_unsafe
| 144
|
zdotc = complexDotAbstraction "zdotc" cblas_zdotc_safe cblas_zdotc_unsafe
| 73
| false
| true
| 0
| 9
| 16
| 49
| 22
| 27
| null | null |
badp/ganeti
|
src/Ganeti/HTools/Backend/Luxi.hs
|
gpl-2.0
|
-- | Prepare resulting output as parsers expect it.
extractArray :: (Monad m) => JSValue -> m [[(JSValue, JSValue)]]
extractArray v =
getData v >>= parseQueryResult
| 166
|
extractArray :: (Monad m) => JSValue -> m [[(JSValue, JSValue)]]
extractArray v =
getData v >>= parseQueryResult
| 114
|
extractArray v =
getData v >>= parseQueryResult
| 49
| true
| true
| 2
| 11
| 27
| 57
| 29
| 28
| null | null |
urbanslug/ghc
|
compiler/prelude/THNames.hs
|
bsd-3-clause
|
tyVarBndrTyConName= thTc (fsLit "TyVarBndr") tyVarBndrTyConKey
| 65
|
tyVarBndrTyConName= thTc (fsLit "TyVarBndr") tyVarBndrTyConKey
| 65
|
tyVarBndrTyConName= thTc (fsLit "TyVarBndr") tyVarBndrTyConKey
| 65
| false
| false
| 1
| 7
| 7
| 22
| 8
| 14
| null | null |
keithodulaigh/Hets
|
HolLight/HolLight2DG.hs
|
gpl-2.0
|
prettifyTypeVarsTp (TyApp s ts) m =
let (ts', m') = foldl (\ (ts'', m'') t ->
let (t', m''') = prettifyTypeVarsTp t m''
in (t' : ts'', m''')) ([], m) ts
in (TyApp s ts', m')
| 187
|
prettifyTypeVarsTp (TyApp s ts) m =
let (ts', m') = foldl (\ (ts'', m'') t ->
let (t', m''') = prettifyTypeVarsTp t m''
in (t' : ts'', m''')) ([], m) ts
in (TyApp s ts', m')
| 187
|
prettifyTypeVarsTp (TyApp s ts) m =
let (ts', m') = foldl (\ (ts'', m'') t ->
let (t', m''') = prettifyTypeVarsTp t m''
in (t' : ts'', m''')) ([], m) ts
in (TyApp s ts', m')
| 187
| false
| false
| 0
| 16
| 49
| 112
| 59
| 53
| null | null |
Bodigrim/katas
|
src/haskell/B-Greatest-common-divisor.hs
|
bsd-2-clause
|
gcd :: Integral n => n -> n -> n
gcd = curry (fst . head . dropWhile ((/=0) . snd) . iterate (\(a, b) -> (b, a `mod` b)))
| 121
|
gcd :: Integral n => n -> n -> n
gcd = curry (fst . head . dropWhile ((/=0) . snd) . iterate (\(a, b) -> (b, a `mod` b)))
| 121
|
gcd = curry (fst . head . dropWhile ((/=0) . snd) . iterate (\(a, b) -> (b, a `mod` b)))
| 88
| false
| true
| 0
| 12
| 29
| 93
| 49
| 44
| null | null |
rodsol/atomspace
|
tests/haskell/insertTest/src/OpenCog/Test/TemplateData.hs
|
agpl-3.0
|
replace :: String -> String -> String -> String
replace a b [] = []
| 67
|
replace :: String -> String -> String -> String
replace a b [] = []
| 67
|
replace a b [] = []
| 19
| false
| true
| 0
| 7
| 14
| 34
| 17
| 17
| null | null |
sdiehl/ghc
|
compiler/utils/Util.hs
|
bsd-3-clause
|
equalLength _ _ = False
| 33
|
equalLength _ _ = False
| 33
|
equalLength _ _ = False
| 33
| false
| false
| 0
| 5
| 14
| 11
| 5
| 6
| null | null |
vikraman/ghc
|
compiler/prelude/THNames.hs
|
bsd-3-clause
|
floatPrimLName = libFun (fsLit "floatPrimL") floatPrimLIdKey
| 62
|
floatPrimLName = libFun (fsLit "floatPrimL") floatPrimLIdKey
| 62
|
floatPrimLName = libFun (fsLit "floatPrimL") floatPrimLIdKey
| 62
| false
| false
| 0
| 7
| 7
| 17
| 8
| 9
| null | null |
suhailshergill/liboleg
|
Control/ExtensibleDS.hs
|
bsd-3-clause
|
ext_env env x v y | x == y = v
| 30
|
ext_env env x v y | x == y = v
| 30
|
ext_env env x v y | x == y = v
| 30
| false
| false
| 0
| 8
| 10
| 25
| 11
| 14
| null | null |
jlturner/adm
|
src/Main.hs
|
mit
|
samples BassDrum = ["bass_drum_0.mp3"]
| 38
|
samples BassDrum = ["bass_drum_0.mp3"]
| 38
|
samples BassDrum = ["bass_drum_0.mp3"]
| 38
| false
| false
| 1
| 5
| 3
| 15
| 6
| 9
| null | null |
ejlilley/AbstractMusic
|
Tuning.hs
|
gpl-3.0
|
wuerschmidt = pureoctave (8 *^ _M3, rat $ 6)
| 44
|
wuerschmidt = pureoctave (8 *^ _M3, rat $ 6)
| 44
|
wuerschmidt = pureoctave (8 *^ _M3, rat $ 6)
| 44
| false
| false
| 0
| 7
| 8
| 23
| 12
| 11
| null | null |
hemio-ev/libghc-acme
|
src/Network/ACME/HTTPS/Internal.hs
|
lgpl-3.0
|
https' ::
Request
-> CragConfig
-> Manager
-> CragLogger
-> ExceptT AcmeErr IO ResponseLbs
https' request config manager logger = perform (cragConfigHttpsRetries config)
where
perform :: Int -> ExceptT AcmeErr IO ResponseLbs
perform i = do
result <- liftIO $ try $ httpLbs request manager
case result of
Left e
| i < 0 -> throwError $ AcmeErrHTTPS e
| otherwise -> do
liftIO $ cragLog' logger $ show e
liftIO $
threadDelay
(secondsToMicroseconds (cragConfigHttpsRetryInterval config))
perform (i - 1)
Right r -> return r
-- | Perform POST query
| 682
|
https' ::
Request
-> CragConfig
-> Manager
-> CragLogger
-> ExceptT AcmeErr IO ResponseLbs
https' request config manager logger = perform (cragConfigHttpsRetries config)
where
perform :: Int -> ExceptT AcmeErr IO ResponseLbs
perform i = do
result <- liftIO $ try $ httpLbs request manager
case result of
Left e
| i < 0 -> throwError $ AcmeErrHTTPS e
| otherwise -> do
liftIO $ cragLog' logger $ show e
liftIO $
threadDelay
(secondsToMicroseconds (cragConfigHttpsRetryInterval config))
perform (i - 1)
Right r -> return r
-- | Perform POST query
| 682
|
https' request config manager logger = perform (cragConfigHttpsRetries config)
where
perform :: Int -> ExceptT AcmeErr IO ResponseLbs
perform i = do
result <- liftIO $ try $ httpLbs request manager
case result of
Left e
| i < 0 -> throwError $ AcmeErrHTTPS e
| otherwise -> do
liftIO $ cragLog' logger $ show e
liftIO $
threadDelay
(secondsToMicroseconds (cragConfigHttpsRetryInterval config))
perform (i - 1)
Right r -> return r
-- | Perform POST query
| 578
| false
| true
| 2
| 19
| 227
| 207
| 94
| 113
| null | null |
janherich/learning-haskell
|
helloworld.hs
|
epl-1.0
|
main = interact shortLinesOnly
| 30
|
main = interact shortLinesOnly
| 30
|
main = interact shortLinesOnly
| 30
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
senavi/haskell
|
chp6.hs
|
gpl-3.0
|
-- 6.4
euclid :: Int -> Int -> Int
euclid a b | a == b = a
| a < 0 = a
| b < 0 = b
| a > b = euclid (a-b) b
| a < b = euclid a (b-a)
| 176
|
euclid :: Int -> Int -> Int
euclid a b | a == b = a
| a < 0 = a
| b < 0 = b
| a > b = euclid (a-b) b
| a < b = euclid a (b-a)
| 169
|
euclid a b | a == b = a
| a < 0 = a
| b < 0 = b
| a > b = euclid (a-b) b
| a < b = euclid a (b-a)
| 141
| true
| true
| 0
| 8
| 89
| 111
| 53
| 58
| null | null |
vigoos/Farrago-OS
|
aura-master/aura-master/src/Aura/Flags.hs
|
gpl-2.0
|
ignoredAuraPkgs :: [Flag] -> [String]
ignoredAuraPkgs [] = []
| 61
|
ignoredAuraPkgs :: [Flag] -> [String]
ignoredAuraPkgs [] = []
| 61
|
ignoredAuraPkgs [] = []
| 23
| false
| true
| 0
| 6
| 8
| 28
| 15
| 13
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.