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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tokiwoousaka/draw-poker | src/Game/Poker/Cards.hs | bsd-3-clause | d2 = Card 2 Diamonds | 20 | d2 = Card 2 Diamonds | 20 | d2 = Card 2 Diamonds | 20 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
kosmoskatten/synthetic-web | src/SyntheticWeb/Client/Executor.hs | mit | executeActivity (PUT headers upload) = do
((_, byteCount), timeItTook) <- timedAction (put upload headers)
doUpdateByteCountAndLatencyTime byteCount timeItTook
-- | Perform a post (upload and download) with the specicied sizes. | 232 | executeActivity (PUT headers upload) = do
((_, byteCount), timeItTook) <- timedAction (put upload headers)
doUpdateByteCountAndLatencyTime byteCount timeItTook
-- | Perform a post (upload and download) with the specicied sizes. | 232 | executeActivity (PUT headers upload) = do
((_, byteCount), timeItTook) <- timedAction (put upload headers)
doUpdateByteCountAndLatencyTime byteCount timeItTook
-- | Perform a post (upload and download) with the specicied sizes. | 232 | false | false | 0 | 10 | 33 | 56 | 28 | 28 | null | null |
nevrenato/Hets_Fork | THF/ATC_THF.hs | gpl-2.0 | _tcTHFQuantifiedFormulaTc :: TyCon
_tcTHFQuantifiedFormulaTc = mkTyCon "THF.As.THFQuantifiedFormula" | 100 | _tcTHFQuantifiedFormulaTc :: TyCon
_tcTHFQuantifiedFormulaTc = mkTyCon "THF.As.THFQuantifiedFormula" | 100 | _tcTHFQuantifiedFormulaTc = mkTyCon "THF.As.THFQuantifiedFormula" | 65 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
hguenther/gtl | lib/Language/GTL/Translation.hs | bsd-3-clause | getSteps _ (TimeSteps s) = s | 28 | getSteps _ (TimeSteps s) = s | 28 | getSteps _ (TimeSteps s) = s | 28 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
fmapfmapfmap/amazonka | amazonka-iam/test/Test/AWS/Gen/IAM.hs | mpl-2.0 | testGetAccountAuthorizationDetailsResponse :: GetAccountAuthorizationDetailsResponse -> TestTree
testGetAccountAuthorizationDetailsResponse = res
"GetAccountAuthorizationDetailsResponse"
"fixture/GetAccountAuthorizationDetailsResponse.proto"
iAM
(Proxy :: Proxy GetAccountAuthorizationDetails) | 309 | testGetAccountAuthorizationDetailsResponse :: GetAccountAuthorizationDetailsResponse -> TestTree
testGetAccountAuthorizationDetailsResponse = res
"GetAccountAuthorizationDetailsResponse"
"fixture/GetAccountAuthorizationDetailsResponse.proto"
iAM
(Proxy :: Proxy GetAccountAuthorizationDetails) | 309 | testGetAccountAuthorizationDetailsResponse = res
"GetAccountAuthorizationDetailsResponse"
"fixture/GetAccountAuthorizationDetailsResponse.proto"
iAM
(Proxy :: Proxy GetAccountAuthorizationDetails) | 212 | false | true | 0 | 7 | 30 | 33 | 17 | 16 | null | null |
enolan/pdxfunc-cis194 | test/Main.hs | bsd-3-clause | -- Here be spoilers!
week2Tests :: TestTree
week2Tests = testGroup "Week 2"
[testGroup "QuickCheck"
[testParseMessage,
testParse,
testInsert,
testBuild,
testInOrder,
testWhatWentWrong],
testGroup "HUnit"
[testSampleDotLog]] | 254 | week2Tests :: TestTree
week2Tests = testGroup "Week 2"
[testGroup "QuickCheck"
[testParseMessage,
testParse,
testInsert,
testBuild,
testInOrder,
testWhatWentWrong],
testGroup "HUnit"
[testSampleDotLog]] | 233 | week2Tests = testGroup "Week 2"
[testGroup "QuickCheck"
[testParseMessage,
testParse,
testInsert,
testBuild,
testInOrder,
testWhatWentWrong],
testGroup "HUnit"
[testSampleDotLog]] | 210 | true | true | 0 | 8 | 53 | 62 | 32 | 30 | null | null |
abrim/yesod-dsl | YesodDsl/Generator/Models.hs | bsd-2-clause | enum :: EnumType -> String
enum e = T.unpack $(codegenFile "codegen/enum.cg")
where fromPathPieces = concatMap fromPathPiece (enumValues e)
toPathPieces = concatMap toPathPiece (enumValues e)
parseJSONs = concatMap parseJSON (enumValues e)
toJSONs = concatMap toJSON (enumValues e)
fromPathPiece v = T.unpack $(codegenFile "codegen/enum-frompathpiece.cg")
toPathPiece v = T.unpack $(codegenFile "codegen/enum-topathpiece.cg")
parseJSON v = T.unpack $(codegenFile "codegen/enum-parsejson.cg")
toJSON v = T.unpack $(codegenFile "codegen/enum-tojson.cg")
readsPrecs = concatMap readsPrec' (enumValues e)
showsPrecs = concatMap showsPrec' (enumValues e)
readsPrec' v = T.unpack $(codegenFile "codegen/enum-readsprec.cg")
showsPrec' v = T.unpack $(codegenFile "codegen/enum-showsprec.cg")
toCharList s = "'" ++ (intercalate "':'" (map (:[]) s)) ++ "'"
prefixedValues = intercalate " | " $ map ((enumName e) ++) $ enumValues e | 1,055 | enum :: EnumType -> String
enum e = T.unpack $(codegenFile "codegen/enum.cg")
where fromPathPieces = concatMap fromPathPiece (enumValues e)
toPathPieces = concatMap toPathPiece (enumValues e)
parseJSONs = concatMap parseJSON (enumValues e)
toJSONs = concatMap toJSON (enumValues e)
fromPathPiece v = T.unpack $(codegenFile "codegen/enum-frompathpiece.cg")
toPathPiece v = T.unpack $(codegenFile "codegen/enum-topathpiece.cg")
parseJSON v = T.unpack $(codegenFile "codegen/enum-parsejson.cg")
toJSON v = T.unpack $(codegenFile "codegen/enum-tojson.cg")
readsPrecs = concatMap readsPrec' (enumValues e)
showsPrecs = concatMap showsPrec' (enumValues e)
readsPrec' v = T.unpack $(codegenFile "codegen/enum-readsprec.cg")
showsPrec' v = T.unpack $(codegenFile "codegen/enum-showsprec.cg")
toCharList s = "'" ++ (intercalate "':'" (map (:[]) s)) ++ "'"
prefixedValues = intercalate " | " $ map ((enumName e) ++) $ enumValues e | 1,055 | enum e = T.unpack $(codegenFile "codegen/enum.cg")
where fromPathPieces = concatMap fromPathPiece (enumValues e)
toPathPieces = concatMap toPathPiece (enumValues e)
parseJSONs = concatMap parseJSON (enumValues e)
toJSONs = concatMap toJSON (enumValues e)
fromPathPiece v = T.unpack $(codegenFile "codegen/enum-frompathpiece.cg")
toPathPiece v = T.unpack $(codegenFile "codegen/enum-topathpiece.cg")
parseJSON v = T.unpack $(codegenFile "codegen/enum-parsejson.cg")
toJSON v = T.unpack $(codegenFile "codegen/enum-tojson.cg")
readsPrecs = concatMap readsPrec' (enumValues e)
showsPrecs = concatMap showsPrec' (enumValues e)
readsPrec' v = T.unpack $(codegenFile "codegen/enum-readsprec.cg")
showsPrec' v = T.unpack $(codegenFile "codegen/enum-showsprec.cg")
toCharList s = "'" ++ (intercalate "':'" (map (:[]) s)) ++ "'"
prefixedValues = intercalate " | " $ map ((enumName e) ++) $ enumValues e | 1,028 | false | true | 13 | 14 | 244 | 314 | 153 | 161 | null | null |
tekul/cryptonite | Crypto/ECC/Simple/Types.hs | bsd-3-clause | typeSEC_p521r1 = CurvePrime $ CurvePrimeParam 0x01ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff | 180 | typeSEC_p521r1 = CurvePrime $ CurvePrimeParam 0x01ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff | 180 | typeSEC_p521r1 = CurvePrime $ CurvePrimeParam 0x01ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff | 180 | false | false | 1 | 6 | 5 | 16 | 6 | 10 | null | null |
kindohm/Tidal | Sound/Tidal/Stream.hs | gpl-3.0 | required :: OscShape -> [Param]
required = filter (not . hasDefault) . params | 77 | required :: OscShape -> [Param]
required = filter (not . hasDefault) . params | 77 | required = filter (not . hasDefault) . params | 45 | false | true | 0 | 8 | 12 | 32 | 17 | 15 | null | null |
peterspackman/hsqc | src/Geometry.hs | gpl-3.0 | atomicNumber :: Atom -> Int
atomicNumber Atom {element = e} = E.atomicNumber e | 78 | atomicNumber :: Atom -> Int
atomicNumber Atom {element = e} = E.atomicNumber e | 78 | atomicNumber Atom {element = e} = E.atomicNumber e | 50 | false | true | 0 | 8 | 12 | 32 | 16 | 16 | null | null |
pbl64k/HackerRank-Contests | 2014-10-10-FP/ExpressionsV2/ev2.adt.hs | bsd-2-clause | xx p x =
if p `mod` 2 == 0
then xx (p `div` 2) ((x * x) `mod` mmm)
else (x * xx (pred p) x) `mod` mmm | 121 | xx p x =
if p `mod` 2 == 0
then xx (p `div` 2) ((x * x) `mod` mmm)
else (x * xx (pred p) x) `mod` mmm | 121 | xx p x =
if p `mod` 2 == 0
then xx (p `div` 2) ((x * x) `mod` mmm)
else (x * xx (pred p) x) `mod` mmm | 121 | false | false | 0 | 11 | 48 | 84 | 47 | 37 | null | null |
michalkonecny/aern | aern-ivp/demos/simple-ode.hs | bsd-3-clause | _ = trace | 9 | _ = trace | 9 | _ = trace | 9 | false | false | 0 | 4 | 2 | 7 | 3 | 4 | null | null |
ChaosCabbage/my-haskell-flailing | src/CPU/Interrupts.hs | bsd-3-clause | setMemoryBit address bit = modifyMemory address (`setBit` bit) | 64 | setMemoryBit address bit = modifyMemory address (`setBit` bit) | 64 | setMemoryBit address bit = modifyMemory address (`setBit` bit) | 64 | false | false | 0 | 6 | 9 | 23 | 12 | 11 | null | null |
isturdy/permGen | src/Map.hs | unlicense | newSteps :: Steps
newSteps = Steps 1 | 36 | newSteps :: Steps
newSteps = Steps 1 | 36 | newSteps = Steps 1 | 18 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
scott-fleischman/greek-grammar | haskell/unicode-script/unicode-script.hs | mit | makeDecomposeSingleStep _ = Nothing | 40 | makeDecomposeSingleStep _ = Nothing | 40 | makeDecomposeSingleStep _ = Nothing | 40 | false | false | 0 | 5 | 8 | 9 | 4 | 5 | null | null |
hanshoglund/makeci | Utils.hs | mit | tshow :: Show a => a -> TL.Text
tshow = TL.pack . show | 54 | tshow :: Show a => a -> TL.Text
tshow = TL.pack . show | 54 | tshow = TL.pack . show | 22 | false | true | 1 | 9 | 12 | 38 | 16 | 22 | null | null |
AlexanderPankiv/ghc | compiler/cmm/PprC.hs | bsd-3-clause | signedOp (MO_S_Ge _) = True | 32 | signedOp (MO_S_Ge _) = True | 32 | signedOp (MO_S_Ge _) = True | 32 | false | false | 0 | 6 | 9 | 16 | 7 | 9 | null | null |
brendanhay/gogol | gogol-containerbuilder/gen/Network/Google/Resource/Cloudbuild/Projects/Locations/WorkerPools/Create.hs | mpl-2.0 | -- | V1 error format.
plwpcXgafv :: Lens' ProjectsLocationsWorkerPoolsCreate (Maybe Xgafv)
plwpcXgafv
= lens _plwpcXgafv (\ s a -> s{_plwpcXgafv = a}) | 152 | plwpcXgafv :: Lens' ProjectsLocationsWorkerPoolsCreate (Maybe Xgafv)
plwpcXgafv
= lens _plwpcXgafv (\ s a -> s{_plwpcXgafv = a}) | 130 | plwpcXgafv
= lens _plwpcXgafv (\ s a -> s{_plwpcXgafv = a}) | 61 | true | true | 0 | 9 | 23 | 48 | 25 | 23 | null | null |
bananu7/Turnip | src/Turnip/Eval/Eval.hs | mit | opLE a b = binaryMetaOperator "__le" a b | 40 | opLE a b = binaryMetaOperator "__le" a b | 40 | opLE a b = binaryMetaOperator "__le" a b | 40 | false | false | 0 | 5 | 7 | 18 | 8 | 10 | null | null |
alphalambda/codeworld | funblocks-client/src/Blocks/Types.hs | apache-2.0 | colorProgram = Color 0 | 22 | colorProgram = Color 0 | 22 | colorProgram = Color 0 | 22 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
olsner/ghc | compiler/vectorise/Vectorise/Monad/Naming.hs | bsd-3-clause | -- Naming ---------------------------------------------------------------------
-- |Create a localised variant of a name, using the provided function to transform its `OccName`.
--
-- If the name external, encode the original name's module into the new 'OccName'. The result is
-- always an internal system name.
--
mkLocalisedName :: (Maybe String -> OccName -> OccName) -> Name -> VM Name
mkLocalisedName mk_occ name
= do { mod <- liftDs getModule
; u <- liftDs newUnique
; let occ_name = mkLocalisedOccName mod mk_occ name
new_name | isExternalName name = mkExternalName u mod occ_name (nameSrcSpan name)
| otherwise = mkSystemName u occ_name
; return new_name } | 745 | mkLocalisedName :: (Maybe String -> OccName -> OccName) -> Name -> VM Name
mkLocalisedName mk_occ name
= do { mod <- liftDs getModule
; u <- liftDs newUnique
; let occ_name = mkLocalisedOccName mod mk_occ name
new_name | isExternalName name = mkExternalName u mod occ_name (nameSrcSpan name)
| otherwise = mkSystemName u occ_name
; return new_name } | 427 | mkLocalisedName mk_occ name
= do { mod <- liftDs getModule
; u <- liftDs newUnique
; let occ_name = mkLocalisedOccName mod mk_occ name
new_name | isExternalName name = mkExternalName u mod occ_name (nameSrcSpan name)
| otherwise = mkSystemName u occ_name
; return new_name } | 352 | true | true | 0 | 13 | 180 | 137 | 67 | 70 | null | null |
bitemyapp/ganeti | src/Ganeti/WConfd/Core.hs | bsd-2-clause | -- | Write the configuration, checking that an exclusive lock is held.
-- If not, the call fails.
writeConfig :: ClientId -> ConfigData -> WConfdMonad ()
writeConfig ident cdata = do
checkConfigLock ident L.OwnExclusive
-- V.verifyConfigErr cdata
CW.writeConfig cdata
-- | Explicitly run verification of the configuration.
-- The caller doesn't need to hold the configuration lock. | 388 | writeConfig :: ClientId -> ConfigData -> WConfdMonad ()
writeConfig ident cdata = do
checkConfigLock ident L.OwnExclusive
-- V.verifyConfigErr cdata
CW.writeConfig cdata
-- | Explicitly run verification of the configuration.
-- The caller doesn't need to hold the configuration lock. | 290 | writeConfig ident cdata = do
checkConfigLock ident L.OwnExclusive
-- V.verifyConfigErr cdata
CW.writeConfig cdata
-- | Explicitly run verification of the configuration.
-- The caller doesn't need to hold the configuration lock. | 234 | true | true | 0 | 8 | 63 | 52 | 26 | 26 | null | null |
wincent/docvim | Setup.hs | mit | -- Hacking this to work based on:
--
-- https://stackoverflow.com/a/39019781
--
-- Relies on `happy` existing at /usr/bin/happy; eg. on Arch Linux:
--
-- sudo pacman -S stack happy
main = do
args <- getArgs
let args' = if elem "configure" args
then args ++ [ "--with-happy=/usr/bin/happy" ]
else args
defaultMainWithArgs args' | 347 | main = do
args <- getArgs
let args' = if elem "configure" args
then args ++ [ "--with-happy=/usr/bin/happy" ]
else args
defaultMainWithArgs args' | 159 | main = do
args <- getArgs
let args' = if elem "configure" args
then args ++ [ "--with-happy=/usr/bin/happy" ]
else args
defaultMainWithArgs args' | 159 | true | false | 0 | 12 | 72 | 55 | 30 | 25 | null | null |
nh2/WashNGo | WASH/HTML/HTMLPrelude.hs | bsd-3-clause | legend f elt = elt `add` f (make LEGEND) | 40 | legend f elt = elt `add` f (make LEGEND) | 40 | legend f elt = elt `add` f (make LEGEND) | 40 | false | false | 0 | 8 | 8 | 26 | 13 | 13 | null | null |
kazu-yamamoto/http2 | util/client.hs | bsd-3-clause | main :: IO ()
main = do
args <- getArgs
when (length args /= 2) $ do
putStrLn "client <addr> <port>"
exitFailure
let [host,port] = args
runTCPClient host port $ runHTTP2Client host
where
cliconf host = ClientConfig "http" (C8.pack host) 20
runHTTP2Client host s = E.bracket (allocSimpleConfig s 4096)
freeSimpleConfig
(\conf -> run (cliconf host) conf client)
client sendRequest = do
let req = requestNoBody methodGet "/" []
_ <- forkIO $ sendRequest req $ \rsp -> do
print rsp
getResponseBodyChunk rsp >>= C8.putStrLn
sendRequest req $ \rsp -> do
threadDelay 100000
print rsp
getResponseBodyChunk rsp >>= C8.putStrLn | 823 | main :: IO ()
main = do
args <- getArgs
when (length args /= 2) $ do
putStrLn "client <addr> <port>"
exitFailure
let [host,port] = args
runTCPClient host port $ runHTTP2Client host
where
cliconf host = ClientConfig "http" (C8.pack host) 20
runHTTP2Client host s = E.bracket (allocSimpleConfig s 4096)
freeSimpleConfig
(\conf -> run (cliconf host) conf client)
client sendRequest = do
let req = requestNoBody methodGet "/" []
_ <- forkIO $ sendRequest req $ \rsp -> do
print rsp
getResponseBodyChunk rsp >>= C8.putStrLn
sendRequest req $ \rsp -> do
threadDelay 100000
print rsp
getResponseBodyChunk rsp >>= C8.putStrLn | 823 | main = do
args <- getArgs
when (length args /= 2) $ do
putStrLn "client <addr> <port>"
exitFailure
let [host,port] = args
runTCPClient host port $ runHTTP2Client host
where
cliconf host = ClientConfig "http" (C8.pack host) 20
runHTTP2Client host s = E.bracket (allocSimpleConfig s 4096)
freeSimpleConfig
(\conf -> run (cliconf host) conf client)
client sendRequest = do
let req = requestNoBody methodGet "/" []
_ <- forkIO $ sendRequest req $ \rsp -> do
print rsp
getResponseBodyChunk rsp >>= C8.putStrLn
sendRequest req $ \rsp -> do
threadDelay 100000
print rsp
getResponseBodyChunk rsp >>= C8.putStrLn | 809 | false | true | 1 | 13 | 303 | 273 | 120 | 153 | null | null |
ryantm/ghc | compiler/utils/Encoding.hs | bsd-3-clause | encode_ch '+' = "zp" | 21 | encode_ch '+' = "zp" | 21 | encode_ch '+' = "zp" | 21 | false | false | 1 | 5 | 4 | 13 | 4 | 9 | null | null |
MaxOw/awesomium | src/Graphics/UI/Awesomium/WebView/Callbacks.hs | lgpl-3.0 | setCallbackRequestDownload :: WebView -> RequestDownloadCallbackHandler -> IO (FunPtr RequestDownloadCallback)
setCallbackRequestDownload wv ah =
mkRequestDownloadCallback (defRequestDownloadCallback ah) >>=>
awe_webview_set_callback_request_download wv | 262 | setCallbackRequestDownload :: WebView -> RequestDownloadCallbackHandler -> IO (FunPtr RequestDownloadCallback)
setCallbackRequestDownload wv ah =
mkRequestDownloadCallback (defRequestDownloadCallback ah) >>=>
awe_webview_set_callback_request_download wv | 262 | setCallbackRequestDownload wv ah =
mkRequestDownloadCallback (defRequestDownloadCallback ah) >>=>
awe_webview_set_callback_request_download wv | 151 | false | true | 0 | 9 | 27 | 49 | 23 | 26 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Hooks/DebugEvents.hs | bsd-2-clause | dumpProp _ "_XMONAD_DECORATION_FOR" = dumpWindow | 67 | dumpProp _ "_XMONAD_DECORATION_FOR" = dumpWindow | 67 | dumpProp _ "_XMONAD_DECORATION_FOR" = dumpWindow | 67 | false | false | 1 | 5 | 23 | 14 | 5 | 9 | null | null |
5outh/Bang | src/Bang/Interface/Base.hs | mit | m6 :: Monoid a => a -> a -> a -> a -> a -> a -> a
m6 a b c d e f = mconcat [a, b, c, d, e, f] | 93 | m6 :: Monoid a => a -> a -> a -> a -> a -> a -> a
m6 a b c d e f = mconcat [a, b, c, d, e, f] | 93 | m6 a b c d e f = mconcat [a, b, c, d, e, f] | 43 | false | true | 0 | 13 | 32 | 81 | 41 | 40 | null | null |
xenog/json-rpc | src/Network/JSONRPC/Data.hs | unlicense | parseVerIdResultError :: Object
-> Parser (Ver, Maybe Id, Either ErrorObj Value)
parseVerIdResultError o = do
v <- parseVer o
i <- o .:? "id"
r <- o .:? "result" .!= Null
p <- case v of
V1 -> if r == Null then Left <$> o .: "error" else return $ Right r
V2 -> maybe (Right r) Left <$> o .:? "error"
return (v, i, p)
-- | Create a response from a request. Use in servers. | 433 | parseVerIdResultError :: Object
-> Parser (Ver, Maybe Id, Either ErrorObj Value)
parseVerIdResultError o = do
v <- parseVer o
i <- o .:? "id"
r <- o .:? "result" .!= Null
p <- case v of
V1 -> if r == Null then Left <$> o .: "error" else return $ Right r
V2 -> maybe (Right r) Left <$> o .:? "error"
return (v, i, p)
-- | Create a response from a request. Use in servers. | 433 | parseVerIdResultError o = do
v <- parseVer o
i <- o .:? "id"
r <- o .:? "result" .!= Null
p <- case v of
V1 -> if r == Null then Left <$> o .: "error" else return $ Right r
V2 -> maybe (Right r) Left <$> o .:? "error"
return (v, i, p)
-- | Create a response from a request. Use in servers. | 330 | false | true | 0 | 15 | 140 | 159 | 78 | 81 | null | null |
ricardopenyamari/ir2haskell | clir-parser-haskell-master/app/Main.hs | gpl-2.0 | altPattern :: CaseAltPattern -> D.Doc
altPattern (CConstant v clirType) = constValue v | 88 | altPattern :: CaseAltPattern -> D.Doc
altPattern (CConstant v clirType) = constValue v | 88 | altPattern (CConstant v clirType) = constValue v | 49 | false | true | 0 | 6 | 13 | 35 | 16 | 19 | null | null |
rueshyna/gogol | gogol-gmail/gen/Network/Google/Resource/Gmail/Users/Messages/Attachments/Get.hs | mpl-2.0 | -- | Creates a value of 'UsersMessagesAttachmentsGet' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'umagUserId'
--
-- * 'umagId'
--
-- * 'umagMessageId'
usersMessagesAttachmentsGet
:: Text -- ^ 'umagId'
-> Text -- ^ 'umagMessageId'
-> UsersMessagesAttachmentsGet
usersMessagesAttachmentsGet pUmagId_ pUmagMessageId_ =
UsersMessagesAttachmentsGet'
{ _umagUserId = "me"
, _umagId = pUmagId_
, _umagMessageId = pUmagMessageId_
} | 545 | usersMessagesAttachmentsGet
:: Text -- ^ 'umagId'
-> Text -- ^ 'umagMessageId'
-> UsersMessagesAttachmentsGet
usersMessagesAttachmentsGet pUmagId_ pUmagMessageId_ =
UsersMessagesAttachmentsGet'
{ _umagUserId = "me"
, _umagId = pUmagId_
, _umagMessageId = pUmagMessageId_
} | 304 | usersMessagesAttachmentsGet pUmagId_ pUmagMessageId_ =
UsersMessagesAttachmentsGet'
{ _umagUserId = "me"
, _umagId = pUmagId_
, _umagMessageId = pUmagMessageId_
} | 182 | true | true | 0 | 8 | 104 | 64 | 38 | 26 | null | null |
carlohamalainen/imagetrove-uploader | src/Network/MyTardis/API.hs | bsd-2-clause | getSchemas :: ReaderT MyTardisConfig IO (Result [RestSchema])
getSchemas = getList "/schema" | 92 | getSchemas :: ReaderT MyTardisConfig IO (Result [RestSchema])
getSchemas = getList "/schema" | 92 | getSchemas = getList "/schema" | 30 | false | true | 1 | 8 | 10 | 35 | 15 | 20 | null | null |
Fermat/higher-rank | test/test.hs | bsd-3-clause | len (NCons x xs) = 1 + len xs | 29 | len (NCons x xs) = 1 + len xs | 29 | len (NCons x xs) = 1 + len xs | 29 | false | false | 0 | 6 | 8 | 25 | 11 | 14 | null | null |
prl-tokyo/bigul-configuration-adaptation | Transformations/src/BiFlux/DTD/TypeDef.hs | mit | ppRepStructGeneric :: String -> StructType -> Doc
ppRepStructGeneric modname (Defaultable st _) = ppRepStructGeneric modname st | 131 | ppRepStructGeneric :: String -> StructType -> Doc
ppRepStructGeneric modname (Defaultable st _) = ppRepStructGeneric modname st | 131 | ppRepStructGeneric modname (Defaultable st _) = ppRepStructGeneric modname st | 81 | false | true | 0 | 7 | 19 | 37 | 18 | 19 | null | null |
kylcarte/wangtiles | src/Tile/Load.hs | bsd-3-clause | buildTileMaps :: (CoordType c) => [(Text,IO (TileMap c))] -> IO (TileMaps c)
buildTileMaps ms = tmsFromList <$> mapM loadOne ms
where
loadOne = sequenceA | 157 | buildTileMaps :: (CoordType c) => [(Text,IO (TileMap c))] -> IO (TileMaps c)
buildTileMaps ms = tmsFromList <$> mapM loadOne ms
where
loadOne = sequenceA | 157 | buildTileMaps ms = tmsFromList <$> mapM loadOne ms
where
loadOne = sequenceA | 80 | false | true | 0 | 11 | 27 | 71 | 36 | 35 | null | null |
Palmik/data-store | src/Data/Store/Internal/Function.hs | bsd-3-clause | mergeKeys (I.KN (I.KeyDimensionO d) s) (I.KN _ is) = I.KN (I.IKeyDimensionO d) $ mergeKeys s is | 95 | mergeKeys (I.KN (I.KeyDimensionO d) s) (I.KN _ is) = I.KN (I.IKeyDimensionO d) $ mergeKeys s is | 95 | mergeKeys (I.KN (I.KeyDimensionO d) s) (I.KN _ is) = I.KN (I.IKeyDimensionO d) $ mergeKeys s is | 95 | false | false | 0 | 10 | 15 | 61 | 29 | 32 | null | null |
thomasjm/IHaskell | ipython-kernel/src/IHaskell/IPython/Message/Parser.hs | mit | commOpenParser :: LByteString -> Message
commOpenParser = requestParser $ \obj -> do
uuid <- obj .: "comm_id"
targetName <- obj .: "target_name"
targetModule <- obj .:? "target_module" .!= ""
value <- obj .: "data"
return $ CommOpen noHeader targetName targetModule uuid value | 286 | commOpenParser :: LByteString -> Message
commOpenParser = requestParser $ \obj -> do
uuid <- obj .: "comm_id"
targetName <- obj .: "target_name"
targetModule <- obj .:? "target_module" .!= ""
value <- obj .: "data"
return $ CommOpen noHeader targetName targetModule uuid value | 286 | commOpenParser = requestParser $ \obj -> do
uuid <- obj .: "comm_id"
targetName <- obj .: "target_name"
targetModule <- obj .:? "target_module" .!= ""
value <- obj .: "data"
return $ CommOpen noHeader targetName targetModule uuid value | 245 | false | true | 0 | 11 | 51 | 90 | 43 | 47 | null | null |
etarasov/iptadmin | src/Main.hs | bsd-3-clause | control :: IptAdmin Response
control = msum [ commitChange
, nullDir >> redir "/show"
, dir "logout" logout
, dir "show" ShowPage.pageHandlers
, dir "add" AddPage.pageHandlers
, dir "insert" InsertPage.pageHandlers
, dir "edit" EditPage.pageHandlers
, dir "del" DelPage.pageHandlers
, dir "addchain" AddChainPage.pageHandlers
, dir "editchain" EditChainPage.pageHandlers
, dir "delchain" DelChainPage.pageHandlers
, dir "editpolicy" EditPolicyPage.pageHandlers
, dir "editipforw" EditIpForwPage.pageHandlers
] | 704 | control :: IptAdmin Response
control = msum [ commitChange
, nullDir >> redir "/show"
, dir "logout" logout
, dir "show" ShowPage.pageHandlers
, dir "add" AddPage.pageHandlers
, dir "insert" InsertPage.pageHandlers
, dir "edit" EditPage.pageHandlers
, dir "del" DelPage.pageHandlers
, dir "addchain" AddChainPage.pageHandlers
, dir "editchain" EditChainPage.pageHandlers
, dir "delchain" DelChainPage.pageHandlers
, dir "editpolicy" EditPolicyPage.pageHandlers
, dir "editipforw" EditIpForwPage.pageHandlers
] | 704 | control = msum [ commitChange
, nullDir >> redir "/show"
, dir "logout" logout
, dir "show" ShowPage.pageHandlers
, dir "add" AddPage.pageHandlers
, dir "insert" InsertPage.pageHandlers
, dir "edit" EditPage.pageHandlers
, dir "del" DelPage.pageHandlers
, dir "addchain" AddChainPage.pageHandlers
, dir "editchain" EditChainPage.pageHandlers
, dir "delchain" DelChainPage.pageHandlers
, dir "editpolicy" EditPolicyPage.pageHandlers
, dir "editipforw" EditIpForwPage.pageHandlers
] | 675 | false | true | 1 | 8 | 253 | 142 | 69 | 73 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/Readers/Markdown.hs | gpl-2.0 | pipeTable :: MarkdownParser ([Alignment], [Double], F [Blocks], F [[Blocks]])
pipeTable = try $ do
(heads,aligns) <- try ( pipeBreak >>= \als ->
return (return $ replicate (length als) mempty, als))
<|> ( pipeTableRow >>= \row -> pipeBreak >>= \als ->
return (row, als) )
lines' <- sequence <$> many1 pipeTableRow
let widths = replicate (length aligns) 0.0
return $ (aligns, widths, heads, lines') | 471 | pipeTable :: MarkdownParser ([Alignment], [Double], F [Blocks], F [[Blocks]])
pipeTable = try $ do
(heads,aligns) <- try ( pipeBreak >>= \als ->
return (return $ replicate (length als) mempty, als))
<|> ( pipeTableRow >>= \row -> pipeBreak >>= \als ->
return (row, als) )
lines' <- sequence <$> many1 pipeTableRow
let widths = replicate (length aligns) 0.0
return $ (aligns, widths, heads, lines') | 471 | pipeTable = try $ do
(heads,aligns) <- try ( pipeBreak >>= \als ->
return (return $ replicate (length als) mempty, als))
<|> ( pipeTableRow >>= \row -> pipeBreak >>= \als ->
return (row, als) )
lines' <- sequence <$> many1 pipeTableRow
let widths = replicate (length aligns) 0.0
return $ (aligns, widths, heads, lines') | 393 | false | true | 0 | 19 | 136 | 190 | 101 | 89 | null | null |
spinda/liquidhaskell | src/Language/Haskell/Liquid/Desugar710/Check.hs | bsd-3-clause | -- reconstruct parallel array pattern
--
-- * don't check for the type only; we need to make sure that we are really
-- dealing with one of the fake constructors and not with the real
-- representation
make_whole_con :: DataCon -> WarningPat
make_whole_con con | isInfixCon con = nlInfixConPat name
nlWildPatName nlWildPatName
| otherwise = nlConPatName name pats
where
name = getName con
pats = [nlWildPatName | _ <- dataConOrigArgTys con]
{-
------------------------------------------------------------------------
Tidying equations
------------------------------------------------------------------------
tidy_eqn does more or less the same thing as @tidy@ in @Match.lhs@;
that is, it removes syntactic sugar, reducing the number of cases that
must be handled by the main checking algorithm. One difference is
that here we can do *all* the tidying at once (recursively), rather
than doing it incrementally.
-} | 1,063 | make_whole_con :: DataCon -> WarningPat
make_whole_con con | isInfixCon con = nlInfixConPat name
nlWildPatName nlWildPatName
| otherwise = nlConPatName name pats
where
name = getName con
pats = [nlWildPatName | _ <- dataConOrigArgTys con]
{-
------------------------------------------------------------------------
Tidying equations
------------------------------------------------------------------------
tidy_eqn does more or less the same thing as @tidy@ in @Match.lhs@;
that is, it removes syntactic sugar, reducing the number of cases that
must be handled by the main checking algorithm. One difference is
that here we can do *all* the tidying at once (recursively), rather
than doing it incrementally.
-} | 855 | make_whole_con con | isInfixCon con = nlInfixConPat name
nlWildPatName nlWildPatName
| otherwise = nlConPatName name pats
where
name = getName con
pats = [nlWildPatName | _ <- dataConOrigArgTys con]
{-
------------------------------------------------------------------------
Tidying equations
------------------------------------------------------------------------
tidy_eqn does more or less the same thing as @tidy@ in @Match.lhs@;
that is, it removes syntactic sugar, reducing the number of cases that
must be handled by the main checking algorithm. One difference is
that here we can do *all* the tidying at once (recursively), rather
than doing it incrementally.
-} | 815 | true | true | 0 | 10 | 279 | 83 | 42 | 41 | null | null |
dec9ue/jhc_copygc | src/Cmm/Op.hs | gpl-2.0 | unopFloat _ _ = Nothing | 23 | unopFloat _ _ = Nothing | 23 | unopFloat _ _ = Nothing | 23 | false | false | 1 | 5 | 4 | 12 | 5 | 7 | null | null |
beni55/hscurses | UI/HSCurses/CursesHelper.hs | lgpl-2.1 | -- do this
--
-- | Converts a list of human-readable styles into the corresponding
-- curses representation.
--
-- This function should be called exactly once at application startup
-- for all styles of the application.
convertStyles :: [Style] -> IO [CursesStyle]
convertStyles styleList =
do let (attrs, cs) = unzip $ map convertStyle styleList
cursesAttrs = map convertAttributes attrs
cursesPairs <- colorsToPairs' cs
let res = zipWith toCursesStyle cursesAttrs cursesPairs
trace ("convertStyles: " ++ show (zip styleList res)) (return res)
where convertStyle (Style fg bg) = convertStyle (AttributeStyle [] fg bg)
convertStyle (AttributeStyle attrs fg bg) =
let (afg, cfg) = convertFg fg
(abg, cbg) = convertBg bg
in (afg ++ abg ++ attrs, Just (cfg, cbg))
convertStyle (ColorlessStyle attrs) = (attrs, Nothing)
colorsToPairs' cs =
do pairs <- colorsToPairs (catMaybes cs)
return $ mergeNothing cs pairs
mergeNothing (Just _:crest) (p:prest) = Just p
: mergeNothing crest prest
mergeNothing (Nothing:crest) ps = Nothing : mergeNothing crest ps
mergeNothing [] [] = []
toCursesStyle cursesAttrs Nothing =
ColorlessCursesStyle cursesAttrs
toCursesStyle cursesAttrs (Just cursesPair) =
CursesStyle cursesAttrs cursesPair
------------------------------------------------------------------------
--
-- | Converting keys to humand-readable strings
-- | 1,631 | convertStyles :: [Style] -> IO [CursesStyle]
convertStyles styleList =
do let (attrs, cs) = unzip $ map convertStyle styleList
cursesAttrs = map convertAttributes attrs
cursesPairs <- colorsToPairs' cs
let res = zipWith toCursesStyle cursesAttrs cursesPairs
trace ("convertStyles: " ++ show (zip styleList res)) (return res)
where convertStyle (Style fg bg) = convertStyle (AttributeStyle [] fg bg)
convertStyle (AttributeStyle attrs fg bg) =
let (afg, cfg) = convertFg fg
(abg, cbg) = convertBg bg
in (afg ++ abg ++ attrs, Just (cfg, cbg))
convertStyle (ColorlessStyle attrs) = (attrs, Nothing)
colorsToPairs' cs =
do pairs <- colorsToPairs (catMaybes cs)
return $ mergeNothing cs pairs
mergeNothing (Just _:crest) (p:prest) = Just p
: mergeNothing crest prest
mergeNothing (Nothing:crest) ps = Nothing : mergeNothing crest ps
mergeNothing [] [] = []
toCursesStyle cursesAttrs Nothing =
ColorlessCursesStyle cursesAttrs
toCursesStyle cursesAttrs (Just cursesPair) =
CursesStyle cursesAttrs cursesPair
------------------------------------------------------------------------
--
-- | Converting keys to humand-readable strings
-- | 1,404 | convertStyles styleList =
do let (attrs, cs) = unzip $ map convertStyle styleList
cursesAttrs = map convertAttributes attrs
cursesPairs <- colorsToPairs' cs
let res = zipWith toCursesStyle cursesAttrs cursesPairs
trace ("convertStyles: " ++ show (zip styleList res)) (return res)
where convertStyle (Style fg bg) = convertStyle (AttributeStyle [] fg bg)
convertStyle (AttributeStyle attrs fg bg) =
let (afg, cfg) = convertFg fg
(abg, cbg) = convertBg bg
in (afg ++ abg ++ attrs, Just (cfg, cbg))
convertStyle (ColorlessStyle attrs) = (attrs, Nothing)
colorsToPairs' cs =
do pairs <- colorsToPairs (catMaybes cs)
return $ mergeNothing cs pairs
mergeNothing (Just _:crest) (p:prest) = Just p
: mergeNothing crest prest
mergeNothing (Nothing:crest) ps = Nothing : mergeNothing crest ps
mergeNothing [] [] = []
toCursesStyle cursesAttrs Nothing =
ColorlessCursesStyle cursesAttrs
toCursesStyle cursesAttrs (Just cursesPair) =
CursesStyle cursesAttrs cursesPair
------------------------------------------------------------------------
--
-- | Converting keys to humand-readable strings
-- | 1,359 | true | true | 8 | 16 | 470 | 410 | 207 | 203 | null | null |
snoyberg/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | -- There can't be repeated symbols because only data instances have binders
-------------------
-- the SrcLoc returned are for the whole declarations, not just the names
hsDataDefnBinders :: HsDataDefn name -> ([Located name], [LFieldOcc name])
hsDataDefnBinders (HsDataDefn { dd_cons = cons })
= hsConDeclsBinders cons | 322 | hsDataDefnBinders :: HsDataDefn name -> ([Located name], [LFieldOcc name])
hsDataDefnBinders (HsDataDefn { dd_cons = cons })
= hsConDeclsBinders cons | 151 | hsDataDefnBinders (HsDataDefn { dd_cons = cons })
= hsConDeclsBinders cons | 76 | true | true | 0 | 8 | 47 | 62 | 32 | 30 | null | null |
ford-prefect/haskell-gi | lib/Data/GI/CodeGen/Code.hs | lgpl-2.1 | modulePrelude name exports reexportedModules =
"module " <> name <> "\n ( "
<> formatExportList (map (Export ExportModule) reexportedModules)
<> "\n"
<> formatExportList exports
<> " ) where\n\n"
<> T.unlines (map ("import " <>) reexportedModules) | 277 | modulePrelude name exports reexportedModules =
"module " <> name <> "\n ( "
<> formatExportList (map (Export ExportModule) reexportedModules)
<> "\n"
<> formatExportList exports
<> " ) where\n\n"
<> T.unlines (map ("import " <>) reexportedModules) | 277 | modulePrelude name exports reexportedModules =
"module " <> name <> "\n ( "
<> formatExportList (map (Export ExportModule) reexportedModules)
<> "\n"
<> formatExportList exports
<> " ) where\n\n"
<> T.unlines (map ("import " <>) reexportedModules) | 277 | false | false | 0 | 14 | 64 | 78 | 38 | 40 | null | null |
spechub/Hets | OWL2/PrintAS.hs | gpl-2.0 | printInverseObjectProperties :: GA.PrefixMap -> AxiomAnnotations
-> ObjectPropertyExpression -> ObjectPropertyExpression -> Doc
printInverseObjectProperties pds axAnns objPropExpr1 objPropExpr2 =
keyword inverseObjectPropertiesS
<> sParens (hsep . concat $
[docAxAnns, [docObjPropExpr1, docObjPropExpr2]])
where
docAxAnns = map (printAnnotation pds) axAnns
docObjPropExpr1 = printObjectPropertyExpression pds objPropExpr1
docObjPropExpr2 = printObjectPropertyExpression pds objPropExpr2 | 535 | printInverseObjectProperties :: GA.PrefixMap -> AxiomAnnotations
-> ObjectPropertyExpression -> ObjectPropertyExpression -> Doc
printInverseObjectProperties pds axAnns objPropExpr1 objPropExpr2 =
keyword inverseObjectPropertiesS
<> sParens (hsep . concat $
[docAxAnns, [docObjPropExpr1, docObjPropExpr2]])
where
docAxAnns = map (printAnnotation pds) axAnns
docObjPropExpr1 = printObjectPropertyExpression pds objPropExpr1
docObjPropExpr2 = printObjectPropertyExpression pds objPropExpr2 | 535 | printInverseObjectProperties pds axAnns objPropExpr1 objPropExpr2 =
keyword inverseObjectPropertiesS
<> sParens (hsep . concat $
[docAxAnns, [docObjPropExpr1, docObjPropExpr2]])
where
docAxAnns = map (printAnnotation pds) axAnns
docObjPropExpr1 = printObjectPropertyExpression pds objPropExpr1
docObjPropExpr2 = printObjectPropertyExpression pds objPropExpr2 | 403 | false | true | 4 | 10 | 93 | 113 | 56 | 57 | null | null |
thalerjonathan/phd | thesis/code/taglessfinal/src/MainEvent.hs | gpl-3.0 | -- use 1 / 0 for unrestricted time
maxTime :: Double
maxTime = 150.0 | 68 | maxTime :: Double
maxTime = 150.0 | 33 | maxTime = 150.0 | 15 | true | true | 0 | 4 | 13 | 12 | 7 | 5 | null | null |
wtanaka/haskell | NinetyNine.hs | gpl-3.0 | flatten :: NestedList a -> [a]
flatten (Elem x) = [x] | 53 | flatten :: NestedList a -> [a]
flatten (Elem x) = [x] | 53 | flatten (Elem x) = [x] | 22 | false | true | 0 | 7 | 10 | 33 | 17 | 16 | null | null |
mrakgr/futhark | src/Futhark/Pass/ExtractKernels/ISRWIM.hs | bsd-3-clause | irwim :: (MonadBinder m, Lore m ~ SOACS, LocalScope SOACS m) =>
Pattern
-> Certificates
-> SubExp
-> Commutativity -> Lambda
-> [(SubExp, VName)]
-> Maybe (m ())
irwim res_pat cs w comm red_fun red_input
| Just (map_pat, map_cs, map_w, map_fun) <- rwimPossible red_fun = Just $ do
let (accs, arrs) = unzip red_input
arrs' <- transposedArrays arrs
-- FIXME? Can we reasonably assume that the accumulator is a
-- replicate? We also assume that it is non-empty.
let indexAcc (Var v) = letSubExp "acc" $ PrimOp $ Index [] v [intConst Int32 0]
indexAcc Constant{} = fail "irwim: array accumulator is a constant."
accs' <- mapM indexAcc accs
let (_red_acc_params, red_elem_params) =
splitAt (length arrs) $ lambdaParams red_fun
map_rettype = map rowType $ lambdaReturnType red_fun
map_params = map (setParamOuterDimTo w) red_elem_params
red_params = lambdaParams map_fun
red_body = lambdaBody map_fun
red_rettype = lambdaReturnType map_fun
red_fun' = Lambda red_params red_body red_rettype
red_input' = zip accs' $ map paramName map_params
red_pat = stripPatternOuterDim map_pat
map_body <-
case irwim red_pat cs w comm red_fun' red_input' of
Nothing ->
return $ mkBody [Let red_pat () $ Op $ Reduce cs w comm red_fun' red_input'] $
map Var $ patternNames map_pat
Just m -> localScope (scopeOfLParams map_params) $ do
map_body_bnds <- collectBindings_ m
return $ mkBody map_body_bnds $ map Var $ patternNames map_pat
let map_fun' = Lambda map_params map_body map_rettype
addBinding $ Let res_pat () $ Op $ Map map_cs map_w map_fun' arrs'
| otherwise = Nothing | 1,841 | irwim :: (MonadBinder m, Lore m ~ SOACS, LocalScope SOACS m) =>
Pattern
-> Certificates
-> SubExp
-> Commutativity -> Lambda
-> [(SubExp, VName)]
-> Maybe (m ())
irwim res_pat cs w comm red_fun red_input
| Just (map_pat, map_cs, map_w, map_fun) <- rwimPossible red_fun = Just $ do
let (accs, arrs) = unzip red_input
arrs' <- transposedArrays arrs
-- FIXME? Can we reasonably assume that the accumulator is a
-- replicate? We also assume that it is non-empty.
let indexAcc (Var v) = letSubExp "acc" $ PrimOp $ Index [] v [intConst Int32 0]
indexAcc Constant{} = fail "irwim: array accumulator is a constant."
accs' <- mapM indexAcc accs
let (_red_acc_params, red_elem_params) =
splitAt (length arrs) $ lambdaParams red_fun
map_rettype = map rowType $ lambdaReturnType red_fun
map_params = map (setParamOuterDimTo w) red_elem_params
red_params = lambdaParams map_fun
red_body = lambdaBody map_fun
red_rettype = lambdaReturnType map_fun
red_fun' = Lambda red_params red_body red_rettype
red_input' = zip accs' $ map paramName map_params
red_pat = stripPatternOuterDim map_pat
map_body <-
case irwim red_pat cs w comm red_fun' red_input' of
Nothing ->
return $ mkBody [Let red_pat () $ Op $ Reduce cs w comm red_fun' red_input'] $
map Var $ patternNames map_pat
Just m -> localScope (scopeOfLParams map_params) $ do
map_body_bnds <- collectBindings_ m
return $ mkBody map_body_bnds $ map Var $ patternNames map_pat
let map_fun' = Lambda map_params map_body map_rettype
addBinding $ Let res_pat () $ Op $ Map map_cs map_w map_fun' arrs'
| otherwise = Nothing | 1,841 | irwim res_pat cs w comm red_fun red_input
| Just (map_pat, map_cs, map_w, map_fun) <- rwimPossible red_fun = Just $ do
let (accs, arrs) = unzip red_input
arrs' <- transposedArrays arrs
-- FIXME? Can we reasonably assume that the accumulator is a
-- replicate? We also assume that it is non-empty.
let indexAcc (Var v) = letSubExp "acc" $ PrimOp $ Index [] v [intConst Int32 0]
indexAcc Constant{} = fail "irwim: array accumulator is a constant."
accs' <- mapM indexAcc accs
let (_red_acc_params, red_elem_params) =
splitAt (length arrs) $ lambdaParams red_fun
map_rettype = map rowType $ lambdaReturnType red_fun
map_params = map (setParamOuterDimTo w) red_elem_params
red_params = lambdaParams map_fun
red_body = lambdaBody map_fun
red_rettype = lambdaReturnType map_fun
red_fun' = Lambda red_params red_body red_rettype
red_input' = zip accs' $ map paramName map_params
red_pat = stripPatternOuterDim map_pat
map_body <-
case irwim red_pat cs w comm red_fun' red_input' of
Nothing ->
return $ mkBody [Let red_pat () $ Op $ Reduce cs w comm red_fun' red_input'] $
map Var $ patternNames map_pat
Just m -> localScope (scopeOfLParams map_params) $ do
map_body_bnds <- collectBindings_ m
return $ mkBody map_body_bnds $ map Var $ patternNames map_pat
let map_fun' = Lambda map_params map_body map_rettype
addBinding $ Let res_pat () $ Op $ Map map_cs map_w map_fun' arrs'
| otherwise = Nothing | 1,640 | false | true | 0 | 22 | 529 | 556 | 261 | 295 | null | null |
meiersi-11ce/stack | src/Stack/Types/Config.hs | bsd-3-clause | indexNameText :: IndexName -> Text
indexNameText = decodeUtf8 . unIndexName | 75 | indexNameText :: IndexName -> Text
indexNameText = decodeUtf8 . unIndexName | 75 | indexNameText = decodeUtf8 . unIndexName | 40 | false | true | 0 | 5 | 9 | 19 | 10 | 9 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/RegionHealthCheckServices/List.hs | mpl-2.0 | -- | Project ID for this request.
rhcslProject :: Lens' RegionHealthCheckServicesList Text
rhcslProject
= lens _rhcslProject (\ s a -> s{_rhcslProject = a}) | 158 | rhcslProject :: Lens' RegionHealthCheckServicesList Text
rhcslProject
= lens _rhcslProject (\ s a -> s{_rhcslProject = a}) | 124 | rhcslProject
= lens _rhcslProject (\ s a -> s{_rhcslProject = a}) | 67 | true | true | 1 | 9 | 24 | 44 | 22 | 22 | null | null |
ezyang/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | weakPrimTyConKey = mkPreludeTyConUnique 27 | 65 | weakPrimTyConKey = mkPreludeTyConUnique 27 | 65 | weakPrimTyConKey = mkPreludeTyConUnique 27 | 65 | false | false | 0 | 5 | 26 | 9 | 4 | 5 | null | null |
ExpHP/haskell-memory-halp | app/Attempt4.hs | bsd-3-clause | -- error "TODO: limitSequence" -- (I think)
limitMapping = id | 67 | limitMapping = id | 18 | limitMapping = id | 18 | true | false | 1 | 5 | 15 | 11 | 4 | 7 | null | null |
anton-k/sharc-timbre | tools/Parse.hs | bsd-3-clause | ppInstrRange :: Element -> Maybe InstrRange
ppInstrRange a
= InstrRange <$> (pHarmonicFreq =<< elemIs "harmonicFreq" a)
<*> (pPitch =<< elemIs "pitch" a)
<*> (pAmplitude =<< elemIs "amplitude" a)
where
pHarmonicFreq x =
HarmonicFreq <$> (fmap read $ attrIs "harmNum" x)
<*> pHarmonicFreqPitch x
where
pHarmonicFreqPitch x =
Pitch <$> (pure $ read $ strContent x)
<*> (fmap read $ attrIs "keyNum" x)
<*> (pPitchName =<< attrIs "pitch" x)
pPitch x =
Pitch <$> (fmap read $ attrIs "fundHz" x)
<*> (fmap read $ attrIs "keyNum" x)
<*> (pPitchName $ strContent x)
pAmplitude x =
Amplitude <$> (fmap read $ attrIs "freqHz" x)
<*> pAmplitudeHarmonicFreq x
<*> (pure $ read $ strContent x)
where
pAmplitudeHarmonicFreq x =
HarmonicFreq <$> (fmap read $ attrIs "harmNum" x)
<*> pAmplitudeHarmonicFreqPitch x
pAmplitudeHarmonicFreqPitch x =
Pitch <$> (fmap read $ attrIs "fundHz" x)
<*> (fmap read $ attrIs "keyNum" x)
<*> (pPitchName =<< attrIs "pitch" x) | 1,438 | ppInstrRange :: Element -> Maybe InstrRange
ppInstrRange a
= InstrRange <$> (pHarmonicFreq =<< elemIs "harmonicFreq" a)
<*> (pPitch =<< elemIs "pitch" a)
<*> (pAmplitude =<< elemIs "amplitude" a)
where
pHarmonicFreq x =
HarmonicFreq <$> (fmap read $ attrIs "harmNum" x)
<*> pHarmonicFreqPitch x
where
pHarmonicFreqPitch x =
Pitch <$> (pure $ read $ strContent x)
<*> (fmap read $ attrIs "keyNum" x)
<*> (pPitchName =<< attrIs "pitch" x)
pPitch x =
Pitch <$> (fmap read $ attrIs "fundHz" x)
<*> (fmap read $ attrIs "keyNum" x)
<*> (pPitchName $ strContent x)
pAmplitude x =
Amplitude <$> (fmap read $ attrIs "freqHz" x)
<*> pAmplitudeHarmonicFreq x
<*> (pure $ read $ strContent x)
where
pAmplitudeHarmonicFreq x =
HarmonicFreq <$> (fmap read $ attrIs "harmNum" x)
<*> pAmplitudeHarmonicFreqPitch x
pAmplitudeHarmonicFreqPitch x =
Pitch <$> (fmap read $ attrIs "fundHz" x)
<*> (fmap read $ attrIs "keyNum" x)
<*> (pPitchName =<< attrIs "pitch" x) | 1,438 | ppInstrRange a
= InstrRange <$> (pHarmonicFreq =<< elemIs "harmonicFreq" a)
<*> (pPitch =<< elemIs "pitch" a)
<*> (pAmplitude =<< elemIs "amplitude" a)
where
pHarmonicFreq x =
HarmonicFreq <$> (fmap read $ attrIs "harmNum" x)
<*> pHarmonicFreqPitch x
where
pHarmonicFreqPitch x =
Pitch <$> (pure $ read $ strContent x)
<*> (fmap read $ attrIs "keyNum" x)
<*> (pPitchName =<< attrIs "pitch" x)
pPitch x =
Pitch <$> (fmap read $ attrIs "fundHz" x)
<*> (fmap read $ attrIs "keyNum" x)
<*> (pPitchName $ strContent x)
pAmplitude x =
Amplitude <$> (fmap read $ attrIs "freqHz" x)
<*> pAmplitudeHarmonicFreq x
<*> (pure $ read $ strContent x)
where
pAmplitudeHarmonicFreq x =
HarmonicFreq <$> (fmap read $ attrIs "harmNum" x)
<*> pAmplitudeHarmonicFreqPitch x
pAmplitudeHarmonicFreqPitch x =
Pitch <$> (fmap read $ attrIs "fundHz" x)
<*> (fmap read $ attrIs "keyNum" x)
<*> (pPitchName =<< attrIs "pitch" x) | 1,394 | false | true | 2 | 13 | 643 | 382 | 183 | 199 | null | null |
kseistrup/timestamp | contrib/timestamp.hs | gpl-3.0 | main :: IO ()
main = do contents <- getContents
mapM_ timestampLn (lines contents) | 92 | main :: IO ()
main = do contents <- getContents
mapM_ timestampLn (lines contents) | 92 | main = do contents <- getContents
mapM_ timestampLn (lines contents) | 78 | false | true | 0 | 9 | 23 | 37 | 17 | 20 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT07.hs | gpl-3.0 | -- Theorem
prop_T07 :: [a] -> [a] -> Prop
prop_T07 x y = prove (length (qrev x y) :=: length x + length y) | 107 | prop_T07 :: [a] -> [a] -> Prop
prop_T07 x y = prove (length (qrev x y) :=: length x + length y) | 95 | prop_T07 x y = prove (length (qrev x y) :=: length x + length y) | 64 | true | true | 0 | 11 | 24 | 68 | 32 | 36 | null | null |
UCSD-PL/RefScript | src/Language/Rsc/Typecheck/Types.hs | bsd-3-clause | isMU = isNamed "Mutable" | 26 | isMU = isNamed "Mutable" | 26 | isMU = isNamed "Mutable" | 26 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
deweyvm/pone | src/Pone/Parser/Expr.hs | gpl-3.0 | parseString :: Parser Value
parseString = PoneString <$> stringLiteral | 70 | parseString :: Parser Value
parseString = PoneString <$> stringLiteral | 70 | parseString = PoneString <$> stringLiteral | 42 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
bvdelft/parac2 | src/Language/Java/Paragon/NameResolution.hs | bsd-3-clause | rnModifier :: Resolve Modifier
rnModifier md =
case md of
Reads pos pol -> Reads pos <$> rnExp pol
Writes pos pol -> Writes pos <$> rnExp pol
Opens pos ls -> Opens pos <$> mapM rnLock ls
Closes pos ls -> Closes pos <$> mapM rnLock ls
Expects pos ls -> Expects pos <$> mapM rnLock ls
_ -> return md | 348 | rnModifier :: Resolve Modifier
rnModifier md =
case md of
Reads pos pol -> Reads pos <$> rnExp pol
Writes pos pol -> Writes pos <$> rnExp pol
Opens pos ls -> Opens pos <$> mapM rnLock ls
Closes pos ls -> Closes pos <$> mapM rnLock ls
Expects pos ls -> Expects pos <$> mapM rnLock ls
_ -> return md | 348 | rnModifier md =
case md of
Reads pos pol -> Reads pos <$> rnExp pol
Writes pos pol -> Writes pos <$> rnExp pol
Opens pos ls -> Opens pos <$> mapM rnLock ls
Closes pos ls -> Closes pos <$> mapM rnLock ls
Expects pos ls -> Expects pos <$> mapM rnLock ls
_ -> return md | 317 | false | true | 0 | 9 | 112 | 141 | 62 | 79 | null | null |
brendanhay/gogol | gogol-container/gen/Network/Google/Container/Types/Product.hs | mpl-2.0 | -- | The name (project, location, cluster id) of the cluster to set
-- maintenance policy. Specified in the format
-- \`projects\/*\/locations\/*\/clusters\/*\`.
smprName :: Lens' SetMaintenancePolicyRequest (Maybe Text)
smprName = lens _smprName (\ s a -> s{_smprName = a}) | 274 | smprName :: Lens' SetMaintenancePolicyRequest (Maybe Text)
smprName = lens _smprName (\ s a -> s{_smprName = a}) | 112 | smprName = lens _smprName (\ s a -> s{_smprName = a}) | 53 | true | true | 1 | 9 | 38 | 54 | 27 | 27 | null | null |
ennocramer/hindent | src/HIndent/Styles/Cramer.hs | bsd-3-clause | extConDecl :: Extend ConDecl
-- No extra space after empty constructor
extConDecl (ConDecl _ name []) = pretty name | 115 | extConDecl :: Extend ConDecl
extConDecl (ConDecl _ name []) = pretty name | 73 | extConDecl (ConDecl _ name []) = pretty name | 44 | true | true | 0 | 8 | 18 | 33 | 16 | 17 | null | null |
snapframework/heist | test/suite/Heist/Interpreted/Tests.hs | bsd-3-clause | xmlNotHtmlTest :: H.Assertion
xmlNotHtmlTest = renderTest "rss" expected where
expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rss><channel><link>http://www.devalot.com/</link></channel></rss>"
------------------------------------------------------------------------------ | 282 | xmlNotHtmlTest :: H.Assertion
xmlNotHtmlTest = renderTest "rss" expected where
expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rss><channel><link>http://www.devalot.com/</link></channel></rss>"
------------------------------------------------------------------------------ | 282 | xmlNotHtmlTest = renderTest "rss" expected where
expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rss><channel><link>http://www.devalot.com/</link></channel></rss>"
------------------------------------------------------------------------------ | 252 | false | true | 0 | 7 | 17 | 34 | 15 | 19 | null | null |
swift-nav/plover | src/Language/Plover/Simplify.hs | mit | term1 :: Num n => Term atom n
term1 = Term 1 M.empty | 52 | term1 :: Num n => Term atom n
term1 = Term 1 M.empty | 52 | term1 = Term 1 M.empty | 22 | false | true | 0 | 7 | 12 | 36 | 15 | 21 | null | null |
alexbaluta/courseography | dependencies/HaXml-1.25.3/src/Text/XML/HaXml/XmlContent/Parser.hs | gpl-3.0 | -- | Generate a single attribute.
mkAttr :: String -> String -> Attribute
mkAttr n v = (N n, AttValue [Left v]) | 111 | mkAttr :: String -> String -> Attribute
mkAttr n v = (N n, AttValue [Left v]) | 77 | mkAttr n v = (N n, AttValue [Left v]) | 37 | true | true | 0 | 8 | 21 | 43 | 22 | 21 | null | null |
utwente-fmt/scoop | src/StepPA.hs | bsd-3-clause | updateMapping ((key,value):mapping) v newVal | key == v = ((v,newVal):mapping)
| otherwise = ((key,value):(updateMapping mapping v newVal)) | 190 | updateMapping ((key,value):mapping) v newVal | key == v = ((v,newVal):mapping)
| otherwise = ((key,value):(updateMapping mapping v newVal)) | 190 | updateMapping ((key,value):mapping) v newVal | key == v = ((v,newVal):mapping)
| otherwise = ((key,value):(updateMapping mapping v newVal)) | 190 | false | false | 0 | 9 | 67 | 83 | 43 | 40 | null | null |
alphaHeavy/influxdb-haskell | src/Database/InfluxDB/Decode.hs | bsd-3-clause | fromSeriesData :: FromSeriesData a => SeriesData -> Either String [a]
fromSeriesData SeriesData {..} = mapM
(runParser . parseSeriesData seriesDataColumns)
seriesDataPoints | 176 | fromSeriesData :: FromSeriesData a => SeriesData -> Either String [a]
fromSeriesData SeriesData {..} = mapM
(runParser . parseSeriesData seriesDataColumns)
seriesDataPoints | 176 | fromSeriesData SeriesData {..} = mapM
(runParser . parseSeriesData seriesDataColumns)
seriesDataPoints | 106 | false | true | 0 | 8 | 23 | 55 | 26 | 29 | null | null |
liyang/thyme | src/Data/Thyme/Clock/Internal.hs | bsd-3-clause | fromSecondsRealFrac :: (RealFrac n, TimeDiff t) => n -> n -> t
fromSecondsRealFrac _ = review microseconds . round . (*) 1000000 | 128 | fromSecondsRealFrac :: (RealFrac n, TimeDiff t) => n -> n -> t
fromSecondsRealFrac _ = review microseconds . round . (*) 1000000 | 128 | fromSecondsRealFrac _ = review microseconds . round . (*) 1000000 | 65 | false | true | 0 | 7 | 21 | 57 | 28 | 29 | null | null |
termite2/debug | Debug/MultiSetExplorer.hs | bsd-3-clause | projectSect :: (D.Rel c v a s, ?m::c) => MultiSetExplorer c a -> a -> Int -> a
projectSect MultiSetExplorer{..} rel sect = project ids rel
where ids = concatMap D.mvarIdx $ sel3 $ mseSections !! sect | 203 | projectSect :: (D.Rel c v a s, ?m::c) => MultiSetExplorer c a -> a -> Int -> a
projectSect MultiSetExplorer{..} rel sect = project ids rel
where ids = concatMap D.mvarIdx $ sel3 $ mseSections !! sect | 203 | projectSect MultiSetExplorer{..} rel sect = project ids rel
where ids = concatMap D.mvarIdx $ sel3 $ mseSections !! sect | 124 | false | true | 0 | 9 | 40 | 94 | 47 | 47 | null | null |
andygill/er-systemf | Language/SystemF/Pretty.hs | bsd-3-clause | pprintExp (Case e alts def) = vcat [ keyword "case" <+> pprintExp e <+> keyword "of"
, nest 2 $ vcat ( all_alts ++ [ symbol "}" ])
]
where
all_alts = [ symbol [start] <+> text cons <+> (sep (map ppBind binders)) <+> symbol "->" <+> pprintExp e
| (start,(Pat cons binders,e)) <- zip ('{' : repeat ';') alts
] ++
[ symbol ";" <+> text "_" <+> symbol "->" <+> pprintExp d
| d <- maybeToList def
]
ppBind (n,e) = parens $ text n <> symbol "::" <> pprintType e | 612 | pprintExp (Case e alts def) = vcat [ keyword "case" <+> pprintExp e <+> keyword "of"
, nest 2 $ vcat ( all_alts ++ [ symbol "}" ])
]
where
all_alts = [ symbol [start] <+> text cons <+> (sep (map ppBind binders)) <+> symbol "->" <+> pprintExp e
| (start,(Pat cons binders,e)) <- zip ('{' : repeat ';') alts
] ++
[ symbol ";" <+> text "_" <+> symbol "->" <+> pprintExp d
| d <- maybeToList def
]
ppBind (n,e) = parens $ text n <> symbol "::" <> pprintType e | 612 | pprintExp (Case e alts def) = vcat [ keyword "case" <+> pprintExp e <+> keyword "of"
, nest 2 $ vcat ( all_alts ++ [ symbol "}" ])
]
where
all_alts = [ symbol [start] <+> text cons <+> (sep (map ppBind binders)) <+> symbol "->" <+> pprintExp e
| (start,(Pat cons binders,e)) <- zip ('{' : repeat ';') alts
] ++
[ symbol ";" <+> text "_" <+> symbol "->" <+> pprintExp d
| d <- maybeToList def
]
ppBind (n,e) = parens $ text n <> symbol "::" <> pprintType e | 612 | false | false | 3 | 12 | 249 | 247 | 116 | 131 | null | null |
capital-match/bake | src/Development/Bake/Server/Database.hs | bsd-3-clause | rnClient = column rnTable "client" :: Column Client | 51 | rnClient = column rnTable "client" :: Column Client | 51 | rnClient = column rnTable "client" :: Column Client | 51 | false | false | 0 | 5 | 7 | 20 | 9 | 11 | null | null |
ocramz/petsc-hs | src/Numerical/PETSc/Internal/InlineC.hs | gpl-3.0 | matCreateAIJ0DecideVarNZPR' :: Comm -> PetscInt_ -> PetscInt_
-> VS.Vector PetscInt_
-> VS.Vector PetscInt_
-> IO (Mat, CInt)
matCreateAIJ0DecideVarNZPR' cc mm nn dnnz onnz = withPtr ( \mat ->
VS.unsafeWith dnnz $ \dnnzp ->
VS.unsafeWith onnz $ \onnzp ->
[C.exp|int{MatCreateAIJ($(int c),
PETSC_DECIDE, PETSC_DECIDE,
$(PetscInt mm), $(PetscInt nn),
NULL, $(const PetscInt* dnnzp),
NULL, $(const PetscInt* onnzp),
$(Mat* mat))}|] ) where c = unComm cc
-- PetscErrorCode MatCreateMPIAIJWithArrays(MPI_Comm comm,PetscInt m,PetscInt n,PetscInt M,PetscInt N,const PetscInt i[],const PetscInt j[],const PetscScalar a[],Mat *mat) -- Collective on MPI_Comm
-- Input Parameters :
-- comm - MPI communicator
-- m - number of local rows (Cannot be PETSC_DECIDE)
-- n - This value should be the same as the local size used in creating the x vector for the matrix-vector product y = Ax. (or PETSC_DECIDE to have calculated if N is given) For square matrices n is almost always m.
-- M - number of global rows (or PETSC_DETERMINE to have calculated if m is given)
-- N - number of global columns (or PETSC_DETERMINE to have calculated if n is given)
-- i - row indices
-- j - column indices
-- a - matrix values
-- Output Parameter :
-- mat -the matrix | 1,521 | matCreateAIJ0DecideVarNZPR' :: Comm -> PetscInt_ -> PetscInt_
-> VS.Vector PetscInt_
-> VS.Vector PetscInt_
-> IO (Mat, CInt)
matCreateAIJ0DecideVarNZPR' cc mm nn dnnz onnz = withPtr ( \mat ->
VS.unsafeWith dnnz $ \dnnzp ->
VS.unsafeWith onnz $ \onnzp ->
[C.exp|int{MatCreateAIJ($(int c),
PETSC_DECIDE, PETSC_DECIDE,
$(PetscInt mm), $(PetscInt nn),
NULL, $(const PetscInt* dnnzp),
NULL, $(const PetscInt* onnzp),
$(Mat* mat))}|] ) where c = unComm cc
-- PetscErrorCode MatCreateMPIAIJWithArrays(MPI_Comm comm,PetscInt m,PetscInt n,PetscInt M,PetscInt N,const PetscInt i[],const PetscInt j[],const PetscScalar a[],Mat *mat) -- Collective on MPI_Comm
-- Input Parameters :
-- comm - MPI communicator
-- m - number of local rows (Cannot be PETSC_DECIDE)
-- n - This value should be the same as the local size used in creating the x vector for the matrix-vector product y = Ax. (or PETSC_DECIDE to have calculated if N is given) For square matrices n is almost always m.
-- M - number of global rows (or PETSC_DETERMINE to have calculated if m is given)
-- N - number of global columns (or PETSC_DETERMINE to have calculated if n is given)
-- i - row indices
-- j - column indices
-- a - matrix values
-- Output Parameter :
-- mat -the matrix | 1,521 | matCreateAIJ0DecideVarNZPR' cc mm nn dnnz onnz = withPtr ( \mat ->
VS.unsafeWith dnnz $ \dnnzp ->
VS.unsafeWith onnz $ \onnzp ->
[C.exp|int{MatCreateAIJ($(int c),
PETSC_DECIDE, PETSC_DECIDE,
$(PetscInt mm), $(PetscInt nn),
NULL, $(const PetscInt* dnnzp),
NULL, $(const PetscInt* onnzp),
$(Mat* mat))}|] ) where c = unComm cc
-- PetscErrorCode MatCreateMPIAIJWithArrays(MPI_Comm comm,PetscInt m,PetscInt n,PetscInt M,PetscInt N,const PetscInt i[],const PetscInt j[],const PetscScalar a[],Mat *mat) -- Collective on MPI_Comm
-- Input Parameters :
-- comm - MPI communicator
-- m - number of local rows (Cannot be PETSC_DECIDE)
-- n - This value should be the same as the local size used in creating the x vector for the matrix-vector product y = Ax. (or PETSC_DECIDE to have calculated if N is given) For square matrices n is almost always m.
-- M - number of global rows (or PETSC_DETERMINE to have calculated if m is given)
-- N - number of global columns (or PETSC_DETERMINE to have calculated if n is given)
-- i - row indices
-- j - column indices
-- a - matrix values
-- Output Parameter :
-- mat -the matrix | 1,323 | false | true | 0 | 12 | 480 | 128 | 72 | 56 | null | null |
AndreasVoellmy/openflow | src/Network/Data/OF13/Message.hs | bsd-3-clause | toField hasMask 12 =
(\x y -> IPv4Dst (x // maskToPrefixLength y)) <$>
getIPAddress <*> if hasMask then getIPAddress else return (IPAddress 0xffffffff) | 154 | toField hasMask 12 =
(\x y -> IPv4Dst (x // maskToPrefixLength y)) <$>
getIPAddress <*> if hasMask then getIPAddress else return (IPAddress 0xffffffff) | 154 | toField hasMask 12 =
(\x y -> IPv4Dst (x // maskToPrefixLength y)) <$>
getIPAddress <*> if hasMask then getIPAddress else return (IPAddress 0xffffffff) | 154 | false | false | 0 | 12 | 25 | 59 | 30 | 29 | null | null |
gallais/potpourri | haskell/cyclic/CyclicListBinder.hs | gpl-3.0 | append :: List a -> List a -> List a
append xs ys = cfold Cons ys (\ _ -> CVar) CRec xs | 87 | append :: List a -> List a -> List a
append xs ys = cfold Cons ys (\ _ -> CVar) CRec xs | 87 | append xs ys = cfold Cons ys (\ _ -> CVar) CRec xs | 50 | false | true | 0 | 7 | 22 | 52 | 25 | 27 | null | null |
opqdonut/riot | Riot/KeyMap.hs | gpl-2.0 | key2str KeyRight = "<Right>" | 28 | key2str KeyRight = "<Right>" | 28 | key2str KeyRight = "<Right>" | 28 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
Heather/cabal | cabal-install/tests/IntegrationTests2.hs | bsd-3-clause | testExceptionInFindingPackage2 :: Assertion
testExceptionInFindingPackage2 = do
BadPackageLocations locs <- expectException "BadPackageLocations" $
void $ planProject testdir config
case locs of
[BadLocGlobBadMatches "./" [BadLocDirNoCabalFile "."]] -> return ()
_ -> assertFailure $ "expected BadLocGlobBadMatches, got " ++ show locs
cleanProject testdir
where
testdir = "exception/no-pkg2"
config = mempty | 448 | testExceptionInFindingPackage2 :: Assertion
testExceptionInFindingPackage2 = do
BadPackageLocations locs <- expectException "BadPackageLocations" $
void $ planProject testdir config
case locs of
[BadLocGlobBadMatches "./" [BadLocDirNoCabalFile "."]] -> return ()
_ -> assertFailure $ "expected BadLocGlobBadMatches, got " ++ show locs
cleanProject testdir
where
testdir = "exception/no-pkg2"
config = mempty | 448 | testExceptionInFindingPackage2 = do
BadPackageLocations locs <- expectException "BadPackageLocations" $
void $ planProject testdir config
case locs of
[BadLocGlobBadMatches "./" [BadLocDirNoCabalFile "."]] -> return ()
_ -> assertFailure $ "expected BadLocGlobBadMatches, got " ++ show locs
cleanProject testdir
where
testdir = "exception/no-pkg2"
config = mempty | 404 | false | true | 0 | 13 | 87 | 105 | 49 | 56 | null | null |
enolan/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reflectConstant c@(Ch _) = reflCall "Ch" [RConstant c] | 54 | reflectConstant c@(Ch _) = reflCall "Ch" [RConstant c] | 54 | reflectConstant c@(Ch _) = reflCall "Ch" [RConstant c] | 54 | false | false | 1 | 8 | 7 | 33 | 14 | 19 | null | null |
lefant/kurt | src/Data/Goban/Incremental.hs | gpl-3.0 | isSuicide :: GobanMap -> ChainMap -> Stone -> Bool
isSuicide cg cm (Stone p color) =
null adjFrees &&
all (S.null . S.delete p . chainLiberties . getChain cm) ourIds' &&
all (not . S.null . S.delete p . chainLiberties . getChain cm) neighIds'
where
adjPs = filter (/= borderChainId) $ map (vertexId cg) $ adjacentVertices p
-- partition out free vertices
(adjFrees, adjIds) = partition (== noChainId) adjPs
-- partition friend and foe
(ourIds, neighIds) = partition ((color ==) . chainColor . getChain cm) adjIds
-- list of adjacent same color chain ids
ourIds' = nub ourIds
-- ChainNeighbour type neighbour id - vertex map
neighIds' = nub neighIds | 715 | isSuicide :: GobanMap -> ChainMap -> Stone -> Bool
isSuicide cg cm (Stone p color) =
null adjFrees &&
all (S.null . S.delete p . chainLiberties . getChain cm) ourIds' &&
all (not . S.null . S.delete p . chainLiberties . getChain cm) neighIds'
where
adjPs = filter (/= borderChainId) $ map (vertexId cg) $ adjacentVertices p
-- partition out free vertices
(adjFrees, adjIds) = partition (== noChainId) adjPs
-- partition friend and foe
(ourIds, neighIds) = partition ((color ==) . chainColor . getChain cm) adjIds
-- list of adjacent same color chain ids
ourIds' = nub ourIds
-- ChainNeighbour type neighbour id - vertex map
neighIds' = nub neighIds | 715 | isSuicide cg cm (Stone p color) =
null adjFrees &&
all (S.null . S.delete p . chainLiberties . getChain cm) ourIds' &&
all (not . S.null . S.delete p . chainLiberties . getChain cm) neighIds'
where
adjPs = filter (/= borderChainId) $ map (vertexId cg) $ adjacentVertices p
-- partition out free vertices
(adjFrees, adjIds) = partition (== noChainId) adjPs
-- partition friend and foe
(ourIds, neighIds) = partition ((color ==) . chainColor . getChain cm) adjIds
-- list of adjacent same color chain ids
ourIds' = nub ourIds
-- ChainNeighbour type neighbour id - vertex map
neighIds' = nub neighIds | 664 | false | true | 0 | 13 | 176 | 224 | 114 | 110 | null | null |
keithodulaigh/Hets | SoftFOL/DFGParser.hs | gpl-2.0 | getLabel :: Parser SPSettingLabel
getLabel = mapTokensToData $ map ( \ z -> (showSettingLabel z, z))
[KIV, LEM, OTTER, PROTEIN, SATURATE, ThreeTAP, SETHEO, SPASS] | 166 | getLabel :: Parser SPSettingLabel
getLabel = mapTokensToData $ map ( \ z -> (showSettingLabel z, z))
[KIV, LEM, OTTER, PROTEIN, SATURATE, ThreeTAP, SETHEO, SPASS] | 166 | getLabel = mapTokensToData $ map ( \ z -> (showSettingLabel z, z))
[KIV, LEM, OTTER, PROTEIN, SATURATE, ThreeTAP, SETHEO, SPASS] | 132 | false | true | 0 | 10 | 27 | 65 | 37 | 28 | null | null |
piyush-kurur/shakespeare | hamlet/Text/Hamlet/RT.hs | bsd-2-clause | showName :: [String] -> String
showName = intercalate "." . reverse | 67 | showName :: [String] -> String
showName = intercalate "." . reverse | 67 | showName = intercalate "." . reverse | 36 | false | true | 0 | 6 | 10 | 25 | 13 | 12 | null | null |
jtobin/okasaki | working/Dequeue.hs | mit | init deq = deq | 14 | init deq = deq | 14 | init deq = deq | 14 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
shockkolate/containers | tests/set-properties.hs | bsd-3-clause | prop_UnionInsert :: Int -> Set Int -> Bool
prop_UnionInsert x t = union t (singleton x) == insert x t | 101 | prop_UnionInsert :: Int -> Set Int -> Bool
prop_UnionInsert x t = union t (singleton x) == insert x t | 101 | prop_UnionInsert x t = union t (singleton x) == insert x t | 58 | false | true | 0 | 8 | 19 | 47 | 22 | 25 | null | null |
ssaavedra/liquidhaskell | src/Language/Haskell/Liquid/Bare/Lookup.hs | bsd-3-clause | tryPropTyCon s e
| sx == propConName = return propTyCon
| sx == hpropConName = return hpropTyCon
| otherwise = throwError e
where
sx = symbol s | 181 | tryPropTyCon s e
| sx == propConName = return propTyCon
| sx == hpropConName = return hpropTyCon
| otherwise = throwError e
where
sx = symbol s | 181 | tryPropTyCon s e
| sx == propConName = return propTyCon
| sx == hpropConName = return hpropTyCon
| otherwise = throwError e
where
sx = symbol s | 181 | false | false | 1 | 8 | 64 | 63 | 28 | 35 | null | null |
fmapfmapfmap/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/Types/Product.hs | mpl-2.0 | -- | An 'InstancesCount' object with the number of instances in each status.
ssInstancesCount :: Lens' StackSummary (Maybe InstancesCount)
ssInstancesCount = lens _ssInstancesCount (\ s a -> s{_ssInstancesCount = a}) | 216 | ssInstancesCount :: Lens' StackSummary (Maybe InstancesCount)
ssInstancesCount = lens _ssInstancesCount (\ s a -> s{_ssInstancesCount = a}) | 139 | ssInstancesCount = lens _ssInstancesCount (\ s a -> s{_ssInstancesCount = a}) | 77 | true | true | 0 | 9 | 29 | 46 | 25 | 21 | null | null |
robstewart57/hdph-rs | src/Control/Parallel/HdpH/Internal/Sparkpool.hs | bsd-3-clause | getFishSentCtr :: SparkM m (IORef Int)
getFishSentCtr = s_fishSent <$> ask | 74 | getFishSentCtr :: SparkM m (IORef Int)
getFishSentCtr = s_fishSent <$> ask | 74 | getFishSentCtr = s_fishSent <$> ask | 35 | false | true | 0 | 7 | 10 | 26 | 13 | 13 | null | null |
sheyll/haskell-kurs-audio-demo | src/Music.hs | bsd-3-clause | f o t = Play t $ noteToMidiNote 5 o | 35 | f o t = Play t $ noteToMidiNote 5 o | 35 | f o t = Play t $ noteToMidiNote 5 o | 35 | false | false | 0 | 6 | 9 | 24 | 10 | 14 | null | null |
rrnewton/accelerate | Data/Array/Accelerate/Trafo/Substitution.hs | bsd-3-clause | rebuildOpenAcc
:: (Applicative f, SyntacticAcc fa)
=> (forall t'. Arrays t' => Idx aenv t' -> f (fa OpenAcc aenv' t'))
-> OpenAcc aenv t
-> f (OpenAcc aenv' t)
rebuildOpenAcc av (OpenAcc acc) = OpenAcc <$> rebuildPreOpenAcc rebuildOpenAcc av acc | 262 | rebuildOpenAcc
:: (Applicative f, SyntacticAcc fa)
=> (forall t'. Arrays t' => Idx aenv t' -> f (fa OpenAcc aenv' t'))
-> OpenAcc aenv t
-> f (OpenAcc aenv' t)
rebuildOpenAcc av (OpenAcc acc) = OpenAcc <$> rebuildPreOpenAcc rebuildOpenAcc av acc | 262 | rebuildOpenAcc av (OpenAcc acc) = OpenAcc <$> rebuildPreOpenAcc rebuildOpenAcc av acc | 85 | false | true | 0 | 13 | 57 | 109 | 53 | 56 | null | null |
deontologician/orbRPG | Game/OrbRPG/Combinations.hs | gpl-3.0 | P Red @>> G Hypnos = P Green | 28 | P Red @>> G Hypnos = P Green | 28 | P Red @>> G Hypnos = P Green | 28 | false | false | 3 | 6 | 7 | 23 | 9 | 14 | null | null |
Brightgalrs/con-lang-gen | src/Morph/Phonology.hs | mit | executeRuleOnOnset i rule@(Rule a b p f) ys (x:xs) s -- this looks at inter-onset phonemes
| and [ comparePhonemeR p (lastMay ys)
, comparePhonemeR (Just a) (Just x)
, comparePhonemeR f (headMay xs)
, not $ impConsonants (applyRule b x)
] = executeRuleOnOnset (i+1) (Rule a b p f) (ys++[applyRule b x]) xs s
| otherwise = executeRuleOnOnset i (Rule a b p f) (ys++[x]) xs s | 408 | executeRuleOnOnset i rule@(Rule a b p f) ys (x:xs) s -- this looks at inter-onset phonemes
| and [ comparePhonemeR p (lastMay ys)
, comparePhonemeR (Just a) (Just x)
, comparePhonemeR f (headMay xs)
, not $ impConsonants (applyRule b x)
] = executeRuleOnOnset (i+1) (Rule a b p f) (ys++[applyRule b x]) xs s
| otherwise = executeRuleOnOnset i (Rule a b p f) (ys++[x]) xs s | 408 | executeRuleOnOnset i rule@(Rule a b p f) ys (x:xs) s -- this looks at inter-onset phonemes
| and [ comparePhonemeR p (lastMay ys)
, comparePhonemeR (Just a) (Just x)
, comparePhonemeR f (headMay xs)
, not $ impConsonants (applyRule b x)
] = executeRuleOnOnset (i+1) (Rule a b p f) (ys++[applyRule b x]) xs s
| otherwise = executeRuleOnOnset i (Rule a b p f) (ys++[x]) xs s | 408 | false | false | 1 | 13 | 103 | 200 | 101 | 99 | null | null |
danse/haskell-opaleye | src/Opaleye/Internal/Sql.hs | bsd-3-clause | limit_ :: PQ.LimitOp -> Select -> Select
limit_ lo s = SelectFrom $ newSelect { tables = [s]
, limit = limit'
, offset = offset' }
where (limit', offset') = case lo of
PQ.LimitOp n -> (Just n, Nothing)
PQ.OffsetOp n -> (Nothing, Just n)
PQ.LimitOffsetOp l o -> (Just l, Just o) | 398 | limit_ :: PQ.LimitOp -> Select -> Select
limit_ lo s = SelectFrom $ newSelect { tables = [s]
, limit = limit'
, offset = offset' }
where (limit', offset') = case lo of
PQ.LimitOp n -> (Just n, Nothing)
PQ.OffsetOp n -> (Nothing, Just n)
PQ.LimitOffsetOp l o -> (Just l, Just o) | 398 | limit_ lo s = SelectFrom $ newSelect { tables = [s]
, limit = limit'
, offset = offset' }
where (limit', offset') = case lo of
PQ.LimitOp n -> (Just n, Nothing)
PQ.OffsetOp n -> (Nothing, Just n)
PQ.LimitOffsetOp l o -> (Just l, Just o) | 357 | false | true | 0 | 9 | 174 | 136 | 72 | 64 | null | null |
rgllm/uminho | 02/CP/cp/Test.hs | mit | test_isPathOf4= isPathOf (toList(edges sub_g2)) g2 ~?= True | 59 | test_isPathOf4= isPathOf (toList(edges sub_g2)) g2 ~?= True | 59 | test_isPathOf4= isPathOf (toList(edges sub_g2)) g2 ~?= True | 59 | false | false | 0 | 10 | 6 | 27 | 13 | 14 | null | null |
erikd/hs-tls | core/Network/TLS/Context/Internal.hs | bsd-3-clause | throwCore :: (MonadIO m, Exception e) => e -> m a
throwCore = liftIO . throwIO | 78 | throwCore :: (MonadIO m, Exception e) => e -> m a
throwCore = liftIO . throwIO | 78 | throwCore = liftIO . throwIO | 28 | false | true | 0 | 7 | 15 | 37 | 19 | 18 | null | null |
nushio3/ghc | compiler/simplCore/CoreMonad.hs | bsd-3-clause | liftIOWithCount :: IO (SimplCount, a) -> CoreM a
liftIOWithCount what = liftIO what >>= (\(count, x) -> addSimplCount count >> return x) | 136 | liftIOWithCount :: IO (SimplCount, a) -> CoreM a
liftIOWithCount what = liftIO what >>= (\(count, x) -> addSimplCount count >> return x) | 136 | liftIOWithCount what = liftIO what >>= (\(count, x) -> addSimplCount count >> return x) | 87 | false | true | 0 | 10 | 21 | 65 | 32 | 33 | null | null |
wolverian/scheme48 | Main.hs | mit | eval env (List [Atom "load", String fileName]) = do
program <- load fileName
last <$> mapM (eval env) program | 125 | eval env (List [Atom "load", String fileName]) = do
program <- load fileName
last <$> mapM (eval env) program | 125 | eval env (List [Atom "load", String fileName]) = do
program <- load fileName
last <$> mapM (eval env) program | 125 | false | false | 0 | 10 | 34 | 58 | 26 | 32 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxMUTEX_DEAD_LOCK :: Int
wxMUTEX_DEAD_LOCK = 1 | 46 | wxMUTEX_DEAD_LOCK :: Int
wxMUTEX_DEAD_LOCK = 1 | 46 | wxMUTEX_DEAD_LOCK = 1 | 21 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
Cahu/krpc-hs | src/KRPCHS/Drawing.hs | gpl-3.0 | setTextColor :: KRPCHS.Drawing.Text -> (Double, Double, Double) -> RPCContext ()
setTextColor thisArg valueArg = do
let r = makeRequest "Drawing" "Text_set_Color" [makeArgument 0 thisArg, makeArgument 1 valueArg]
res <- sendRequest r
processResponse res
{-
- The text string
-} | 293 | setTextColor :: KRPCHS.Drawing.Text -> (Double, Double, Double) -> RPCContext ()
setTextColor thisArg valueArg = do
let r = makeRequest "Drawing" "Text_set_Color" [makeArgument 0 thisArg, makeArgument 1 valueArg]
res <- sendRequest r
processResponse res
{-
- The text string
-} | 293 | setTextColor thisArg valueArg = do
let r = makeRequest "Drawing" "Text_set_Color" [makeArgument 0 thisArg, makeArgument 1 valueArg]
res <- sendRequest r
processResponse res
{-
- The text string
-} | 212 | false | true | 0 | 13 | 54 | 95 | 45 | 50 | null | null |
ezyang/ghc | compiler/codeGen/StgCmmMonad.hs | bsd-3-clause | maxHpHw :: HeapUsage -> VirtualHpOffset -> HeapUsage
hp_usg `maxHpHw` hw = hp_usg { virtHp = virtHp hp_usg `max` hw } | 117 | maxHpHw :: HeapUsage -> VirtualHpOffset -> HeapUsage
hp_usg `maxHpHw` hw = hp_usg { virtHp = virtHp hp_usg `max` hw } | 117 | hp_usg `maxHpHw` hw = hp_usg { virtHp = virtHp hp_usg `max` hw } | 64 | false | true | 0 | 8 | 19 | 44 | 24 | 20 | null | null |
gbataille/pandoc | src/Text/Pandoc/Writers/Shared.hs | gpl-2.0 | metaValueToJSON blockWriter inlineWriter (MetaList xs) = liftM toJSON $
Traversable.mapM (metaValueToJSON blockWriter inlineWriter) xs | 136 | metaValueToJSON blockWriter inlineWriter (MetaList xs) = liftM toJSON $
Traversable.mapM (metaValueToJSON blockWriter inlineWriter) xs | 136 | metaValueToJSON blockWriter inlineWriter (MetaList xs) = liftM toJSON $
Traversable.mapM (metaValueToJSON blockWriter inlineWriter) xs | 136 | false | false | 0 | 7 | 15 | 43 | 19 | 24 | null | null |
slpopejoy/fadno-xml | src/Fadno/MusicXml/MusicXml20.hs | bsd-2-clause | parseMetronomeNote :: P.XParse MetronomeNote
parseMetronomeNote =
MetronomeNote
<$> (P.xchild (P.name "metronome-type") (P.xtext >>= parseNoteTypeValue))
<*> P.many (P.xchild (P.name "metronome-dot") (parseEmpty))
<*> P.many (P.xchild (P.name "metronome-beam") (parseMetronomeBeam))
<*> P.optional (P.xchild (P.name "metronome-tuplet") (parseMetronomeTuplet)) | 398 | parseMetronomeNote :: P.XParse MetronomeNote
parseMetronomeNote =
MetronomeNote
<$> (P.xchild (P.name "metronome-type") (P.xtext >>= parseNoteTypeValue))
<*> P.many (P.xchild (P.name "metronome-dot") (parseEmpty))
<*> P.many (P.xchild (P.name "metronome-beam") (parseMetronomeBeam))
<*> P.optional (P.xchild (P.name "metronome-tuplet") (parseMetronomeTuplet)) | 398 | parseMetronomeNote =
MetronomeNote
<$> (P.xchild (P.name "metronome-type") (P.xtext >>= parseNoteTypeValue))
<*> P.many (P.xchild (P.name "metronome-dot") (parseEmpty))
<*> P.many (P.xchild (P.name "metronome-beam") (parseMetronomeBeam))
<*> P.optional (P.xchild (P.name "metronome-tuplet") (parseMetronomeTuplet)) | 353 | false | true | 11 | 10 | 70 | 153 | 76 | 77 | null | null |
beni55/cryptol | src/Cryptol/Symbolic/Prims.hs | bsd-3-clause | dropV :: Integer -> Value -> Value
dropV 0 xs = xs | 50 | dropV :: Integer -> Value -> Value
dropV 0 xs = xs | 50 | dropV 0 xs = xs | 15 | false | true | 0 | 6 | 11 | 29 | 13 | 16 | null | null |
gafiatulin/codewars | src/5 kyu/Peano.hs | mit | even, odd :: Peano -> Bool
even Zero = True | 43 | even, odd :: Peano -> Bool
even Zero = True | 43 | even Zero = True | 16 | false | true | 2 | 7 | 9 | 30 | 12 | 18 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.