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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channable/icepeak
|
server/src/Persistence.hs
|
bsd-3-clause
|
syncToBackend :: StorageBackend -> PersistentValue -> IO ()
syncToBackend File pv = syncFile pv
| 95
|
syncToBackend :: StorageBackend -> PersistentValue -> IO ()
syncToBackend File pv = syncFile pv
| 95
|
syncToBackend File pv = syncFile pv
| 35
| false
| true
| 0
| 9
| 13
| 37
| 16
| 21
| null | null |
kisom/plc
|
src/Data/Logic/Propositional/Parser.hs
|
mit
|
parseLemma :: String -> ProofError Theorem
parseLemma s = case P.parse expr "theorem-parser" s of
Left err -> throwError $ Syntax $ show err
Right val -> return $ Theorem val
| 183
|
parseLemma :: String -> ProofError Theorem
parseLemma s = case P.parse expr "theorem-parser" s of
Left err -> throwError $ Syntax $ show err
Right val -> return $ Theorem val
| 183
|
parseLemma s = case P.parse expr "theorem-parser" s of
Left err -> throwError $ Syntax $ show err
Right val -> return $ Theorem val
| 140
| false
| true
| 0
| 9
| 39
| 70
| 32
| 38
| null | null |
benjaminselfridge/logix
|
src/Calculi.hs
|
bsd-3-clause
|
gamma = SetPat "Γ"
| 19
|
gamma = SetPat "Γ"
| 19
|
gamma = SetPat "Γ"
| 19
| false
| false
| 1
| 5
| 4
| 13
| 4
| 9
| null | null |
fizruk/tubes
|
src/Tubes/Model/Action.hs
|
bsd-3-clause
|
startAction :: Point -> Tube -> Maybe IncompleteAction
startAction from tube
= case pointToStation from tube of
Just s -> Just (StartNewLine s Missing)
Nothing -> case pointToTubeLineEnd from tube of
((s, tubeLineId, dir):_) -> Just (ContinueLine tubeLineId dir s Missing)
_ -> Nothing
| 316
|
startAction :: Point -> Tube -> Maybe IncompleteAction
startAction from tube
= case pointToStation from tube of
Just s -> Just (StartNewLine s Missing)
Nothing -> case pointToTubeLineEnd from tube of
((s, tubeLineId, dir):_) -> Just (ContinueLine tubeLineId dir s Missing)
_ -> Nothing
| 316
|
startAction from tube
= case pointToStation from tube of
Just s -> Just (StartNewLine s Missing)
Nothing -> case pointToTubeLineEnd from tube of
((s, tubeLineId, dir):_) -> Just (ContinueLine tubeLineId dir s Missing)
_ -> Nothing
| 261
| false
| true
| 0
| 13
| 74
| 119
| 57
| 62
| null | null |
shlevy/ghc
|
compiler/basicTypes/Name.hs
|
bsd-3-clause
|
pprInternal :: PprStyle -> Unique -> OccName -> SDoc
pprInternal sty uniq occ
| codeStyle sty = pprUniqueAlways uniq
| debugStyle sty = ppr_occ_name occ <> braces (hsep [pprNameSpaceBrief (occNameSpace occ),
pprUnique uniq])
| dumpStyle sty = ppr_occ_name occ <> ppr_underscore_unique uniq
-- For debug dumps, we're not necessarily dumping
-- tidied code, so we need to print the uniques.
| otherwise = ppr_occ_name occ
| 537
|
pprInternal :: PprStyle -> Unique -> OccName -> SDoc
pprInternal sty uniq occ
| codeStyle sty = pprUniqueAlways uniq
| debugStyle sty = ppr_occ_name occ <> braces (hsep [pprNameSpaceBrief (occNameSpace occ),
pprUnique uniq])
| dumpStyle sty = ppr_occ_name occ <> ppr_underscore_unique uniq
-- For debug dumps, we're not necessarily dumping
-- tidied code, so we need to print the uniques.
| otherwise = ppr_occ_name occ
| 537
|
pprInternal sty uniq occ
| codeStyle sty = pprUniqueAlways uniq
| debugStyle sty = ppr_occ_name occ <> braces (hsep [pprNameSpaceBrief (occNameSpace occ),
pprUnique uniq])
| dumpStyle sty = ppr_occ_name occ <> ppr_underscore_unique uniq
-- For debug dumps, we're not necessarily dumping
-- tidied code, so we need to print the uniques.
| otherwise = ppr_occ_name occ
| 484
| false
| true
| 3
| 12
| 182
| 118
| 56
| 62
| null | null |
rashack/scheme-in-48h
|
src/LispEval.hs
|
bsd-3-clause
|
car :: [LispVal] -> ThrowsError LispVal
car [List (x : xs)] = return x
| 78
|
car :: [LispVal] -> ThrowsError LispVal
car [List (x : xs)] = return x
| 78
|
car [List (x : xs)] = return x
| 38
| false
| true
| 0
| 11
| 21
| 44
| 21
| 23
| null | null |
philipturnbull/quenelle
|
src/Quenelle/Rule.hs
|
gpl-2.0
|
pUnicodeStrings :: [String] -> ExprPred
pUnicodeStrings ss' (UnicodeStrings ss _) = ss == ss'
| 93
|
pUnicodeStrings :: [String] -> ExprPred
pUnicodeStrings ss' (UnicodeStrings ss _) = ss == ss'
| 93
|
pUnicodeStrings ss' (UnicodeStrings ss _) = ss == ss'
| 53
| false
| true
| 0
| 7
| 13
| 35
| 18
| 17
| null | null |
julmue/UntypedLambda
|
src/Language/Lambda/Syntax/Named/Testdata.hs
|
bsd-3-clause
|
n8_ :: Exp String
n8_ = scc_ # n7_
| 34
|
n8_ :: Exp String
n8_ = scc_ # n7_
| 34
|
n8_ = scc_ # n7_
| 16
| false
| true
| 0
| 5
| 8
| 18
| 9
| 9
| null | null |
rahulmutt/ghcvm
|
libraries/base/Data/Bifoldable.hs
|
bsd-3-clause
|
-- | Does the element occur in the structure?
--
-- @since 4.10.0.0
bielem :: (Bifoldable t, Eq a) => a -> t a a -> Bool
bielem x = biany (== x) (== x)
| 151
|
bielem :: (Bifoldable t, Eq a) => a -> t a a -> Bool
bielem x = biany (== x) (== x)
| 83
|
bielem x = biany (== x) (== x)
| 30
| true
| true
| 0
| 9
| 34
| 65
| 33
| 32
| null | null |
pdmurray/haskell-book-ex
|
src/ch11/Exercises11.14.hs
|
bsd-3-clause
|
convert3 :: Quantum -> Bool
convert3 Yes = True
| 48
|
convert3 :: Quantum -> Bool
convert3 Yes = True
| 47
|
convert3 Yes = True
| 19
| false
| true
| 0
| 7
| 9
| 24
| 10
| 14
| null | null |
sethfowler/pygmalion
|
indexers/Pygmalion/Index/Source.hs
|
bsd-3-clause
|
toSourceKind C.Cursor_ObjCDynamicDecl = ObjCDynamicDecl
| 74
|
toSourceKind C.Cursor_ObjCDynamicDecl = ObjCDynamicDecl
| 74
|
toSourceKind C.Cursor_ObjCDynamicDecl = ObjCDynamicDecl
| 74
| false
| false
| 0
| 6
| 22
| 11
| 5
| 6
| null | null |
zenhack/haskell-capnp
|
cmd/capnpc-haskell/IR/Common.hs
|
mit
|
fieldType (PtrField _ ty) = PtrType ty
| 39
|
fieldType (PtrField _ ty) = PtrType ty
| 39
|
fieldType (PtrField _ ty) = PtrType ty
| 39
| false
| false
| 0
| 6
| 7
| 21
| 9
| 12
| null | null |
bhickey/catamad
|
src/Player.hs
|
gpl-3.0
|
processKey :: IO Action
processKey = do
keypress <- getCh
case keypress of
KeyChar x -> return $ getAction defaultKeymap x
_ -> processKey
| 150
|
processKey :: IO Action
processKey = do
keypress <- getCh
case keypress of
KeyChar x -> return $ getAction defaultKeymap x
_ -> processKey
| 150
|
processKey = do
keypress <- getCh
case keypress of
KeyChar x -> return $ getAction defaultKeymap x
_ -> processKey
| 126
| false
| true
| 1
| 12
| 35
| 57
| 24
| 33
| null | null |
jwiegley/ghc-release
|
libraries/containers/Data/Map/Strict.hs
|
gpl-3.0
|
fromList [(kx, x)] = x `seq` Bin 1 kx x Tip Tip
| 47
|
fromList [(kx, x)] = x `seq` Bin 1 kx x Tip Tip
| 47
|
fromList [(kx, x)] = x `seq` Bin 1 kx x Tip Tip
| 47
| false
| false
| 0
| 6
| 11
| 43
| 20
| 23
| null | null |
quyse/flaw
|
flaw-itch-webapi/Flaw/Itch/WebApi.hs
|
mit
|
itchWebApiRequest :: H.Manager -> ItchWebApiKey -> B.ByteString -> [(B.ByteString, Maybe B.ByteString)] -> IO A.Value
itchWebApiRequest httpManager (ItchWebApiKey apiKey isKey) path params =
either fail return . A.eitherDecode' . H.responseBody =<< H.httpLbs (H.setQueryString params H.defaultRequest
{ H.method = "GET"
, H.secure = True
, H.host = "itch.io"
, H.port = 443
, H.path = "/api/1/" <> (if isKey then "key" else "jwt") <> path
, H.requestHeaders = [("Authorization", "Bearer " <> T.encodeUtf8 apiKey)]
}) httpManager
| 558
|
itchWebApiRequest :: H.Manager -> ItchWebApiKey -> B.ByteString -> [(B.ByteString, Maybe B.ByteString)] -> IO A.Value
itchWebApiRequest httpManager (ItchWebApiKey apiKey isKey) path params =
either fail return . A.eitherDecode' . H.responseBody =<< H.httpLbs (H.setQueryString params H.defaultRequest
{ H.method = "GET"
, H.secure = True
, H.host = "itch.io"
, H.port = 443
, H.path = "/api/1/" <> (if isKey then "key" else "jwt") <> path
, H.requestHeaders = [("Authorization", "Bearer " <> T.encodeUtf8 apiKey)]
}) httpManager
| 558
|
itchWebApiRequest httpManager (ItchWebApiKey apiKey isKey) path params =
either fail return . A.eitherDecode' . H.responseBody =<< H.httpLbs (H.setQueryString params H.defaultRequest
{ H.method = "GET"
, H.secure = True
, H.host = "itch.io"
, H.port = 443
, H.path = "/api/1/" <> (if isKey then "key" else "jwt") <> path
, H.requestHeaders = [("Authorization", "Bearer " <> T.encodeUtf8 apiKey)]
}) httpManager
| 440
| false
| true
| 1
| 15
| 103
| 204
| 107
| 97
| null | null |
cdornan/keystore
|
src/Data/KeyStore/PasswordManager.hs
|
bsd-3-clause
|
pi_delete_all_plus_passwords :: ParserInfo (PMCommand p)
pi_delete_all_plus_passwords =
h_info
(helper <*> pure (PMCD_delete_password_plus Nothing))
(progDesc "delete all dynamic (plus) passwords forom the store")
| 234
|
pi_delete_all_plus_passwords :: ParserInfo (PMCommand p)
pi_delete_all_plus_passwords =
h_info
(helper <*> pure (PMCD_delete_password_plus Nothing))
(progDesc "delete all dynamic (plus) passwords forom the store")
| 234
|
pi_delete_all_plus_passwords =
h_info
(helper <*> pure (PMCD_delete_password_plus Nothing))
(progDesc "delete all dynamic (plus) passwords forom the store")
| 177
| false
| true
| 0
| 10
| 42
| 47
| 23
| 24
| null | null |
tsbattman/havro
|
src/Data/Avro/Generic.hs
|
apache-2.0
|
getAvroPrimitive BoolSchema = fmap AvroBool get
| 47
|
getAvroPrimitive BoolSchema = fmap AvroBool get
| 47
|
getAvroPrimitive BoolSchema = fmap AvroBool get
| 47
| false
| false
| 0
| 5
| 5
| 15
| 6
| 9
| null | null |
siddhanathan/ghc
|
compiler/utils/Outputable.hs
|
bsd-3-clause
|
initSDocContext :: DynFlags -> PprStyle -> SDocContext
initSDocContext dflags sty = SDC
{ sdocStyle = sty
, sdocLastColour = colReset
, sdocDynFlags = dflags
}
| 167
|
initSDocContext :: DynFlags -> PprStyle -> SDocContext
initSDocContext dflags sty = SDC
{ sdocStyle = sty
, sdocLastColour = colReset
, sdocDynFlags = dflags
}
| 167
|
initSDocContext dflags sty = SDC
{ sdocStyle = sty
, sdocLastColour = colReset
, sdocDynFlags = dflags
}
| 112
| false
| true
| 0
| 7
| 32
| 48
| 26
| 22
| null | null |
seanhess/serials
|
server/Serials/Link/TOC.hs
|
mit
|
htmlToContent _ (HTMLTitle title) = cleanTitle title
| 52
|
htmlToContent _ (HTMLTitle title) = cleanTitle title
| 52
|
htmlToContent _ (HTMLTitle title) = cleanTitle title
| 52
| false
| false
| 0
| 7
| 6
| 20
| 9
| 11
| null | null |
rueshyna/gogol
|
gogol-analytics/gen/Network/Google/Analytics/Types/Product.hs
|
mpl-2.0
|
-- | The total number of results for the query, regardless of the number of
-- results in the response.
eulTotalResults :: Lens' EntityUserLinks (Maybe Int32)
eulTotalResults
= lens _eulTotalResults
(\ s a -> s{_eulTotalResults = a})
. mapping _Coerce
| 265
|
eulTotalResults :: Lens' EntityUserLinks (Maybe Int32)
eulTotalResults
= lens _eulTotalResults
(\ s a -> s{_eulTotalResults = a})
. mapping _Coerce
| 161
|
eulTotalResults
= lens _eulTotalResults
(\ s a -> s{_eulTotalResults = a})
. mapping _Coerce
| 106
| true
| true
| 0
| 10
| 53
| 56
| 29
| 27
| null | null |
sgraf812/lowgl
|
Graphics/GL/Low/Shader.hs
|
bsd-2-clause
|
setUniform2f :: (MonadIO m) => String -> [V2 Float] -> m ()
setUniform2f = setUniform
(\loc cnt val -> glUniform2fv loc cnt (castPtr val))
| 140
|
setUniform2f :: (MonadIO m) => String -> [V2 Float] -> m ()
setUniform2f = setUniform
(\loc cnt val -> glUniform2fv loc cnt (castPtr val))
| 140
|
setUniform2f = setUniform
(\loc cnt val -> glUniform2fv loc cnt (castPtr val))
| 80
| false
| true
| 0
| 10
| 25
| 73
| 35
| 38
| null | null |
bos/text
|
benchmarks/haskell/Benchmarks/Search.hs
|
bsd-2-clause
|
byteString :: B.ByteString -> B.ByteString -> Int
byteString needle = length . B.indices needle
| 95
|
byteString :: B.ByteString -> B.ByteString -> Int
byteString needle = length . B.indices needle
| 95
|
byteString needle = length . B.indices needle
| 45
| false
| true
| 0
| 7
| 13
| 35
| 17
| 18
| null | null |
agentm/project-m36
|
src/lib/ProjectM36/Client.hs
|
unlicense
|
convertRPCErrors :: RPC.ConnectionError -> IO a
convertRPCErrors err =
case err of
RPC.TimeoutError -> throw RequestTimeoutException
RPC.CodecError msg -> error $ "decoding message failed on server: " <> msg
RPC.ExceptionError msg -> error $ "server threw exception: " <> msg
| 289
|
convertRPCErrors :: RPC.ConnectionError -> IO a
convertRPCErrors err =
case err of
RPC.TimeoutError -> throw RequestTimeoutException
RPC.CodecError msg -> error $ "decoding message failed on server: " <> msg
RPC.ExceptionError msg -> error $ "server threw exception: " <> msg
| 289
|
convertRPCErrors err =
case err of
RPC.TimeoutError -> throw RequestTimeoutException
RPC.CodecError msg -> error $ "decoding message failed on server: " <> msg
RPC.ExceptionError msg -> error $ "server threw exception: " <> msg
| 241
| false
| true
| 0
| 9
| 53
| 81
| 37
| 44
| null | null |
vaibhavsagar/duffer.hs
|
duffer-json/src/Duffer/JSON.hs
|
bsd-3-clause
|
encodeBS :: T.Text -> B.ByteString
encodeBS = E.encodeUtf8
| 59
|
encodeBS :: T.Text -> B.ByteString
encodeBS = E.encodeUtf8
| 59
|
encodeBS = E.encodeUtf8
| 24
| false
| true
| 0
| 6
| 8
| 21
| 11
| 10
| null | null |
binesiyu/ifl
|
examples/ch25/Fragment.hs
|
mit
|
{-- snippet fragment --}
mean :: [Double] -> Double
mean xs = sum xs / fromIntegral (length xs)
| 95
|
mean :: [Double] -> Double
mean xs = sum xs / fromIntegral (length xs)
| 70
|
mean xs = sum xs / fromIntegral (length xs)
| 43
| true
| true
| 0
| 8
| 17
| 41
| 20
| 21
| null | null |
quintype/ringo
|
src/Ringo/Extractor/Internal.hs
|
mit
|
idColTypeToFKIdColType :: Text -> Text
idColTypeToFKIdColType typ = case Text.toLower typ of
"serial" -> "integer"
"smallserial" -> "smallint"
"bigserial" -> "bigint"
_ -> typ
| 202
|
idColTypeToFKIdColType :: Text -> Text
idColTypeToFKIdColType typ = case Text.toLower typ of
"serial" -> "integer"
"smallserial" -> "smallint"
"bigserial" -> "bigint"
_ -> typ
| 202
|
idColTypeToFKIdColType typ = case Text.toLower typ of
"serial" -> "integer"
"smallserial" -> "smallint"
"bigserial" -> "bigint"
_ -> typ
| 163
| false
| true
| 0
| 7
| 50
| 51
| 25
| 26
| null | null |
bgamari/pandoc
|
src/Text/Pandoc/Readers/LaTeX.hs
|
gpl-2.0
|
acute 'z' = "ź"
| 15
|
acute 'z' = "ź"
| 15
|
acute 'z' = "ź"
| 15
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
markflorisson/hpack
|
testrepo/bytestring-0.10.4.1/Data/ByteString/Builder/Prim/Internal/UncheckedShifts.hs
|
bsd-3-clause
|
shiftr_w32 (W32# w) (I# i) = W32# (w `uncheckedShiftRL#` i)
| 61
|
shiftr_w32 (W32# w) (I# i) = W32# (w `uncheckedShiftRL#` i)
| 61
|
shiftr_w32 (W32# w) (I# i) = W32# (w `uncheckedShiftRL#` i)
| 61
| false
| false
| 0
| 7
| 11
| 35
| 18
| 17
| null | null |
vasily-kirichenko/haskell-book
|
src/Ini.hs
|
bsd-3-clause
|
commenctEx' = "; blah\n; woot\n \n;hah" :: ByteString
| 53
|
commenctEx' = "; blah\n; woot\n \n;hah" :: ByteString
| 53
|
commenctEx' = "; blah\n; woot\n \n;hah" :: ByteString
| 53
| false
| false
| 0
| 4
| 7
| 9
| 5
| 4
| null | null |
habbler/GridFlowCover
|
test/GridTest.hs
|
bsd-3-clause
|
-- import Debug.Trace
checkDistance :: MaxCoords -> OCCG s -> DistG s -> Coord -> Coord
-> ST s (Maybe (Coord, Distance, Distance))
checkDistance maxCoords occG distG sink loc =
do locDist <- readArray distG loc
filled <- readArray occG loc
if filled then
return $! if locDist == infDist then Nothing
else if loc == sink && locDist == 0 then Nothing
else Just (loc, infDist, locDist)
else do
minN_dist <- minNeighbours maxCoords distG loc
let expected_dist = if minN_dist == infDist then infDist else minN_dist + 1
return $! if expected_dist == locDist then Nothing
else Just (loc, expected_dist, locDist)
| 760
|
checkDistance :: MaxCoords -> OCCG s -> DistG s -> Coord -> Coord
-> ST s (Maybe (Coord, Distance, Distance))
checkDistance maxCoords occG distG sink loc =
do locDist <- readArray distG loc
filled <- readArray occG loc
if filled then
return $! if locDist == infDist then Nothing
else if loc == sink && locDist == 0 then Nothing
else Just (loc, infDist, locDist)
else do
minN_dist <- minNeighbours maxCoords distG loc
let expected_dist = if minN_dist == infDist then infDist else minN_dist + 1
return $! if expected_dist == locDist then Nothing
else Just (loc, expected_dist, locDist)
| 724
|
checkDistance maxCoords occG distG sink loc =
do locDist <- readArray distG loc
filled <- readArray occG loc
if filled then
return $! if locDist == infDist then Nothing
else if loc == sink && locDist == 0 then Nothing
else Just (loc, infDist, locDist)
else do
minN_dist <- minNeighbours maxCoords distG loc
let expected_dist = if minN_dist == infDist then infDist else minN_dist + 1
return $! if expected_dist == locDist then Nothing
else Just (loc, expected_dist, locDist)
| 595
| true
| true
| 0
| 14
| 256
| 222
| 114
| 108
| null | null |
cem3394/haskell
|
tensorflow/src/TensorFlow/Build.hs
|
apache-2.0
|
-- | Produce a GraphDef proto representation of the nodes that are rendered in
-- the given 'Build' action.
asGraphDef :: Build a -> GraphDef
asGraphDef b = def & node .~ gs ^. nodeBuffer
where
gs = snd $ runIdentity $ runBuildT b
-- TODO: check against existing nodes for conflicts?
| 290
|
asGraphDef :: Build a -> GraphDef
asGraphDef b = def & node .~ gs ^. nodeBuffer
where
gs = snd $ runIdentity $ runBuildT b
-- TODO: check against existing nodes for conflicts?
| 182
|
asGraphDef b = def & node .~ gs ^. nodeBuffer
where
gs = snd $ runIdentity $ runBuildT b
-- TODO: check against existing nodes for conflicts?
| 148
| true
| true
| 5
| 7
| 58
| 65
| 29
| 36
| null | null |
olorin/amazonka
|
amazonka-redshift/gen/Network/AWS/Redshift/Types/Product.hs
|
mpl-2.0
|
-- | The size of the complete set of backup data that would be used to
-- restore the cluster.
sTotalBackupSizeInMegaBytes :: Lens' Snapshot (Maybe Double)
sTotalBackupSizeInMegaBytes = lens _sTotalBackupSizeInMegaBytes (\ s a -> s{_sTotalBackupSizeInMegaBytes = a})
| 266
|
sTotalBackupSizeInMegaBytes :: Lens' Snapshot (Maybe Double)
sTotalBackupSizeInMegaBytes = lens _sTotalBackupSizeInMegaBytes (\ s a -> s{_sTotalBackupSizeInMegaBytes = a})
| 171
|
sTotalBackupSizeInMegaBytes = lens _sTotalBackupSizeInMegaBytes (\ s a -> s{_sTotalBackupSizeInMegaBytes = a})
| 110
| true
| true
| 0
| 9
| 36
| 47
| 26
| 21
| null | null |
ulikoehler/ProjectEuler
|
Euler63.hs
|
apache-2.0
|
expSpace = [1..1000] :: [Integer]
| 33
|
expSpace = [1..1000] :: [Integer]
| 33
|
expSpace = [1..1000] :: [Integer]
| 33
| false
| false
| 0
| 5
| 4
| 17
| 10
| 7
| null | null |
juodaspaulius/clafer-old-customBNFC
|
src/Language/Clafer/Intermediate/ResolverName.hs
|
mit
|
checkListDuplicates :: [(String, Span)] -> Maybe (String,Span)
checkListDuplicates list = checkListDuplicates' $ sortBy (compare `on` fst) list
| 143
|
checkListDuplicates :: [(String, Span)] -> Maybe (String,Span)
checkListDuplicates list = checkListDuplicates' $ sortBy (compare `on` fst) list
| 143
|
checkListDuplicates list = checkListDuplicates' $ sortBy (compare `on` fst) list
| 80
| false
| true
| 0
| 8
| 16
| 58
| 31
| 27
| null | null |
lunaris/hindent
|
src/HIndent/Styles/Cramer.hs
|
bsd-3-clause
|
-- | Extract the names of a ModulePragma
pragmaNames :: ModulePragma a -> [String]
pragmaNames (LanguagePragma _ names) = map nameStr names
| 139
|
pragmaNames :: ModulePragma a -> [String]
pragmaNames (LanguagePragma _ names) = map nameStr names
| 98
|
pragmaNames (LanguagePragma _ names) = map nameStr names
| 56
| true
| true
| 0
| 7
| 21
| 38
| 19
| 19
| null | null |
purebred-mua/purebred
|
src/Purebred/Types.hs
|
agpl-3.0
|
stNumber :: Lens' ScrollStep Int
stNumber = _1
| 46
|
stNumber :: Lens' ScrollStep Int
stNumber = _1
| 46
|
stNumber = _1
| 13
| false
| true
| 0
| 5
| 7
| 16
| 8
| 8
| null | null |
headprogrammingczar/Data
|
data-eval/IRC/Data/L.hs
|
bsd-3-clause
|
morse = unwords . map morseChar . map toLower
| 45
|
morse = unwords . map morseChar . map toLower
| 45
|
morse = unwords . map morseChar . map toLower
| 45
| false
| false
| 2
| 6
| 8
| 24
| 9
| 15
| null | null |
davmre/matrizer
|
src/Matrizer/Analysis.hs
|
gpl-2.0
|
fakeSymbols :: SymbolTable
fakeSymbols = Map.fromList [("A", (Matrix 1000 1000 [], Nothing)), ("B", (Matrix 1000 1000 [], Nothing)), ("x", (Matrix 1000 1 [], Nothing))]
| 168
|
fakeSymbols :: SymbolTable
fakeSymbols = Map.fromList [("A", (Matrix 1000 1000 [], Nothing)), ("B", (Matrix 1000 1000 [], Nothing)), ("x", (Matrix 1000 1 [], Nothing))]
| 168
|
fakeSymbols = Map.fromList [("A", (Matrix 1000 1000 [], Nothing)), ("B", (Matrix 1000 1000 [], Nothing)), ("x", (Matrix 1000 1 [], Nothing))]
| 141
| false
| true
| 0
| 10
| 23
| 88
| 50
| 38
| null | null |
brendanhay/gogol
|
gogol-people/gen/Network/Google/People/Types/Product.hs
|
mpl-2.0
|
-- | The contact people resource names that cannot be removed from their last
-- contact group.
mcgmrCanNotRemoveLastContactGroupResourceNames :: Lens' ModifyContactGroupMembersResponse [Text]
mcgmrCanNotRemoveLastContactGroupResourceNames
= lens
_mcgmrCanNotRemoveLastContactGroupResourceNames
(\ s a ->
s{_mcgmrCanNotRemoveLastContactGroupResourceNames =
a})
. _Default
. _Coerce
| 429
|
mcgmrCanNotRemoveLastContactGroupResourceNames :: Lens' ModifyContactGroupMembersResponse [Text]
mcgmrCanNotRemoveLastContactGroupResourceNames
= lens
_mcgmrCanNotRemoveLastContactGroupResourceNames
(\ s a ->
s{_mcgmrCanNotRemoveLastContactGroupResourceNames =
a})
. _Default
. _Coerce
| 333
|
mcgmrCanNotRemoveLastContactGroupResourceNames
= lens
_mcgmrCanNotRemoveLastContactGroupResourceNames
(\ s a ->
s{_mcgmrCanNotRemoveLastContactGroupResourceNames =
a})
. _Default
. _Coerce
| 236
| true
| true
| 0
| 11
| 84
| 54
| 29
| 25
| null | null |
RAFIRAF/HASKELL
|
warcaby06.hs
|
mit
|
addColNumbers :: [[Char]] -> [[Char]]
addColNumbers board = [" 0 1 2 3 4 5 6 7"] ++ board
| 90
|
addColNumbers :: [[Char]] -> [[Char]]
addColNumbers board = [" 0 1 2 3 4 5 6 7"] ++ board
| 90
|
addColNumbers board = [" 0 1 2 3 4 5 6 7"] ++ board
| 52
| false
| true
| 0
| 7
| 19
| 37
| 21
| 16
| null | null |
aisamanra/matterhorn
|
test/test_messages.hs
|
bsd-3-clause
|
moveUpTestSingle :: TestTree
moveUpTestSingle = testProperty "Move down from single message" $
\x -> let msgs = addMessage x noMessages
in Nothing == (getPrevPostId (messagePostId x) msgs)
| 234
|
moveUpTestSingle :: TestTree
moveUpTestSingle = testProperty "Move down from single message" $
\x -> let msgs = addMessage x noMessages
in Nothing == (getPrevPostId (messagePostId x) msgs)
| 234
|
moveUpTestSingle = testProperty "Move down from single message" $
\x -> let msgs = addMessage x noMessages
in Nothing == (getPrevPostId (messagePostId x) msgs)
| 205
| false
| true
| 0
| 14
| 72
| 64
| 29
| 35
| null | null |
gregorias/pixelosolver
|
src/PixeloSolver/Data/Array/Extra.hs
|
bsd-3-clause
|
getColumn :: (IArray a e, Ix i) => i -> a (i, i) e -> a i e
getColumn column arr = ixmap
(firstColumnIdx, lastColumnIdx)
(\i -> (i, column))
arr
where
firstColumnIdx = fst . fst . bounds $ arr
lastColumnIdx = fst . snd . bounds $ arr
| 249
|
getColumn :: (IArray a e, Ix i) => i -> a (i, i) e -> a i e
getColumn column arr = ixmap
(firstColumnIdx, lastColumnIdx)
(\i -> (i, column))
arr
where
firstColumnIdx = fst . fst . bounds $ arr
lastColumnIdx = fst . snd . bounds $ arr
| 249
|
getColumn column arr = ixmap
(firstColumnIdx, lastColumnIdx)
(\i -> (i, column))
arr
where
firstColumnIdx = fst . fst . bounds $ arr
lastColumnIdx = fst . snd . bounds $ arr
| 189
| false
| true
| 3
| 10
| 64
| 135
| 65
| 70
| null | null |
ekmett/ixset
|
src/Data/IxSet.hs
|
bsd-3-clause
|
-- | If the IxSet is a singleton it will return the one item stored, else Nothing.
getOne :: Ord a => IxSet a -> Maybe a
getOne ixset = case toList ixset of
[x] -> Just x
_ -> Nothing
-- | getOne with a user provided default
| 265
|
getOne :: Ord a => IxSet a -> Maybe a
getOne ixset = case toList ixset of
[x] -> Just x
_ -> Nothing
-- | getOne with a user provided default
| 182
|
getOne ixset = case toList ixset of
[x] -> Just x
_ -> Nothing
-- | getOne with a user provided default
| 144
| true
| true
| 0
| 8
| 89
| 58
| 28
| 30
| null | null |
nevrenato/Hets_Fork
|
CspCASL/ATC_CspCASL.hs
|
gpl-2.0
|
_tcCspRawSymbolTc :: TyCon
_tcCspRawSymbolTc = mkTyCon "CspCASL.Symbol.CspRawSymbol"
| 84
|
_tcCspRawSymbolTc :: TyCon
_tcCspRawSymbolTc = mkTyCon "CspCASL.Symbol.CspRawSymbol"
| 84
|
_tcCspRawSymbolTc = mkTyCon "CspCASL.Symbol.CspRawSymbol"
| 57
| false
| true
| 0
| 6
| 6
| 20
| 8
| 12
| null | null |
denumerate/raven
|
src/Raven/Data/Prob.hs
|
bsd-3-clause
|
-- |Calculates the probability that the first event will happen if the second
-- event has happened, both events being subsets of the ProbSet, using Bayes' rule.
-- Assumes a valid ProbSet
-- (to avoid the possibility of rounding errors in the predicate).
bayes :: (Ord a,Fractional b) => ProbSet a b -> [a] -> [a] -> b
bayes _ _ [] = 0
| 336
|
bayes :: (Ord a,Fractional b) => ProbSet a b -> [a] -> [a] -> b
bayes _ _ [] = 0
| 80
|
bayes _ _ [] = 0
| 16
| true
| true
| 0
| 9
| 63
| 62
| 34
| 28
| null | null |
Saeron/haskell
|
AGO-Rel2-1-40.hs
|
apache-2.0
|
--b--
drop' :: Int -> [a] -> [a]
drop' n xs = [x | (p,x) <-zip [0..(length xs)-1] xs, p >=n]
| 92
|
drop' :: Int -> [a] -> [a]
drop' n xs = [x | (p,x) <-zip [0..(length xs)-1] xs, p >=n]
| 86
|
drop' n xs = [x | (p,x) <-zip [0..(length xs)-1] xs, p >=n]
| 59
| true
| true
| 0
| 12
| 20
| 76
| 41
| 35
| null | null |
ltfschoen/HelloHaskell
|
src/Chapter2/Section2/Recursion.hs
|
mit
|
merge xs [] = xs
| 16
|
merge xs [] = xs
| 16
|
merge xs [] = xs
| 16
| false
| false
| 1
| 5
| 4
| 18
| 6
| 12
| null | null |
brendanhay/gogol
|
gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Versions/Get.hs
|
mpl-2.0
|
-- | Creates a value of 'AccountsContainersVersionsGet' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'acvgXgafv'
--
-- * 'acvgUploadProtocol'
--
-- * 'acvgPath'
--
-- * 'acvgAccessToken'
--
-- * 'acvgContainerVersionId'
--
-- * 'acvgUploadType'
--
-- * 'acvgCallback'
accountsContainersVersionsGet
:: Text -- ^ 'acvgPath'
-> AccountsContainersVersionsGet
accountsContainersVersionsGet pAcvgPath_ =
AccountsContainersVersionsGet'
{ _acvgXgafv = Nothing
, _acvgUploadProtocol = Nothing
, _acvgPath = pAcvgPath_
, _acvgAccessToken = Nothing
, _acvgContainerVersionId = Nothing
, _acvgUploadType = Nothing
, _acvgCallback = Nothing
}
| 759
|
accountsContainersVersionsGet
:: Text -- ^ 'acvgPath'
-> AccountsContainersVersionsGet
accountsContainersVersionsGet pAcvgPath_ =
AccountsContainersVersionsGet'
{ _acvgXgafv = Nothing
, _acvgUploadProtocol = Nothing
, _acvgPath = pAcvgPath_
, _acvgAccessToken = Nothing
, _acvgContainerVersionId = Nothing
, _acvgUploadType = Nothing
, _acvgCallback = Nothing
}
| 403
|
accountsContainersVersionsGet pAcvgPath_ =
AccountsContainersVersionsGet'
{ _acvgXgafv = Nothing
, _acvgUploadProtocol = Nothing
, _acvgPath = pAcvgPath_
, _acvgAccessToken = Nothing
, _acvgContainerVersionId = Nothing
, _acvgUploadType = Nothing
, _acvgCallback = Nothing
}
| 308
| true
| true
| 0
| 7
| 140
| 89
| 58
| 31
| null | null |
thalerjonathan/phd
|
coding/libraries/chimera/src/FRP/Chimera/Random/Pure.hs
|
gpl-3.0
|
-- Taken from https://wiki.haskell.org/Random_shuffle
-- | Randomly shuffle a list without the IO Monad
-- /O(N)/
fisherYatesShuffle :: RandomGen g => g -> [a] -> ([a], g)
fisherYatesShuffle gen [] = ([], gen)
| 211
|
fisherYatesShuffle :: RandomGen g => g -> [a] -> ([a], g)
fisherYatesShuffle gen [] = ([], gen)
| 95
|
fisherYatesShuffle gen [] = ([], gen)
| 37
| true
| true
| 0
| 9
| 34
| 56
| 32
| 24
| null | null |
misgeatgit/opencog
|
opencog/nlp/lojban/HaskellLib/src/OpenCog/Lojban/Syntax/Util.hs
|
agpl-3.0
|
setJai :: SynMonad t State => JJCTTS -> (t ME) ()
setJai a = modify (\s -> s {sJAI = Just a})
| 93
|
setJai :: SynMonad t State => JJCTTS -> (t ME) ()
setJai a = modify (\s -> s {sJAI = Just a})
| 93
|
setJai a = modify (\s -> s {sJAI = Just a})
| 43
| false
| true
| 0
| 10
| 21
| 65
| 31
| 34
| null | null |
fffej/HS-Poker
|
LookupPatternMatch.hs
|
bsd-3-clause
|
getValueFromProduct 6820 = 6097
| 31
|
getValueFromProduct 6820 = 6097
| 31
|
getValueFromProduct 6820 = 6097
| 31
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
Feeniks/wreq
|
tests/UnitTests.hs
|
bsd-3-clause
|
getHeaders Verb{..} site = do
let opts = defaults & header "X-Wibble" .~ ["bar"]
r <- getWith opts (site "/get")
assertEqual "extra header set correctly"
(Just "bar")
(r ^. responseBody ^? key "headers" . key "X-Wibble")
| 234
|
getHeaders Verb{..} site = do
let opts = defaults & header "X-Wibble" .~ ["bar"]
r <- getWith opts (site "/get")
assertEqual "extra header set correctly"
(Just "bar")
(r ^. responseBody ^? key "headers" . key "X-Wibble")
| 234
|
getHeaders Verb{..} site = do
let opts = defaults & header "X-Wibble" .~ ["bar"]
r <- getWith opts (site "/get")
assertEqual "extra header set correctly"
(Just "bar")
(r ^. responseBody ^? key "headers" . key "X-Wibble")
| 234
| false
| false
| 0
| 12
| 49
| 95
| 44
| 51
| null | null |
uduki/hsQt
|
Qtc/Gui/QStyleOptionMenuItem.hs
|
bsd-2-clause
|
qsetMenuRect :: QStyleOptionMenuItem a -> ((QRect t1)) -> IO ()
qsetMenuRect x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QStyleOptionMenuItem_setMenuRect cobj_x0 cobj_x1
| 211
|
qsetMenuRect :: QStyleOptionMenuItem a -> ((QRect t1)) -> IO ()
qsetMenuRect x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QStyleOptionMenuItem_setMenuRect cobj_x0 cobj_x1
| 211
|
qsetMenuRect x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QStyleOptionMenuItem_setMenuRect cobj_x0 cobj_x1
| 147
| false
| true
| 0
| 9
| 36
| 73
| 36
| 37
| null | null |
urbit/urbit
|
pkg/hs/urbit-noun-core/lib/Urbit/Noun/TH.hs
|
mit
|
unexpectedTag :: [String] -> Exp -> Exp
unexpectedTag expected got =
applyE (VarE 'mappend) [LitE (StringL prefix), AppE (VarE 'unpack) got]
where
possible = intercalate " " (('%':) <$> expected)
prefix = "Expected one of: " <> possible <> " but got %"
| 270
|
unexpectedTag :: [String] -> Exp -> Exp
unexpectedTag expected got =
applyE (VarE 'mappend) [LitE (StringL prefix), AppE (VarE 'unpack) got]
where
possible = intercalate " " (('%':) <$> expected)
prefix = "Expected one of: " <> possible <> " but got %"
| 270
|
unexpectedTag expected got =
applyE (VarE 'mappend) [LitE (StringL prefix), AppE (VarE 'unpack) got]
where
possible = intercalate " " (('%':) <$> expected)
prefix = "Expected one of: " <> possible <> " but got %"
| 230
| false
| true
| 0
| 9
| 60
| 103
| 54
| 49
| null | null |
dat2/488-compiler-haskell
|
Parser.hs
|
mit
|
identDecl :: LangType -> GenParser Char st Decl
identDecl lang = do
i <- ident
return ScalarDecl { declType = lang, declIdent = i }
| 136
|
identDecl :: LangType -> GenParser Char st Decl
identDecl lang = do
i <- ident
return ScalarDecl { declType = lang, declIdent = i }
| 136
|
identDecl lang = do
i <- ident
return ScalarDecl { declType = lang, declIdent = i }
| 88
| false
| true
| 0
| 9
| 29
| 52
| 26
| 26
| null | null |
tamarin-prover/tamarin-prover
|
lib/term/src/Term/Positions.hs
|
gpl-3.0
|
findPos _ (viewTerm -> Lit _) = Nothing
| 43
|
findPos _ (viewTerm -> Lit _) = Nothing
| 43
|
findPos _ (viewTerm -> Lit _) = Nothing
| 43
| false
| false
| 1
| 7
| 11
| 24
| 10
| 14
| null | null |
nominolo/haddock2
|
src/Haddock/Interface/Create.hs
|
bsd-2-clause
|
finishedDoc :: Decl -> MaybeDocStringsFast -> [(Decl, MaybeDocStrings)] -> [(Decl, MaybeDocStrings)]
finishedDoc d doc rest = (d, docStringToList doc) : rest
| 157
|
finishedDoc :: Decl -> MaybeDocStringsFast -> [(Decl, MaybeDocStrings)] -> [(Decl, MaybeDocStrings)]
finishedDoc d doc rest = (d, docStringToList doc) : rest
| 157
|
finishedDoc d doc rest = (d, docStringToList doc) : rest
| 56
| false
| true
| 0
| 9
| 20
| 61
| 34
| 27
| null | null |
bjornbm/dimensional-vectors
|
Numeric/Units/Dimensional/LinearAlgebra/Vector.hs
|
bsd-3-clause
|
elemMul :: (HZipWith MulD ds1 ds2 ds3, Num a)
=> Vec ds1 a -> Vec ds2 a -> Vec ds3 a
elemMul = vZipWith (P.*)
| 117
|
elemMul :: (HZipWith MulD ds1 ds2 ds3, Num a)
=> Vec ds1 a -> Vec ds2 a -> Vec ds3 a
elemMul = vZipWith (P.*)
| 117
|
elemMul = vZipWith (P.*)
| 24
| false
| true
| 0
| 9
| 32
| 68
| 32
| 36
| null | null |
bitemyapp/ghc
|
compiler/deSugar/DsArrows.hs
|
bsd-3-clause
|
dsCmd :: DsCmdEnv -- arrow combinators
-> IdSet -- set of local vars available to this command
-> Type -- type of the stack (right-nested tuple)
-> Type -- return type of the command
-> HsCmd Id -- command to desugar
-> [Id] -- list of vars in the input to this command
-- This is typically fed back,
-- so don't pull on it too early
-> DsM (CoreExpr, -- desugared expression
IdSet) -- subset of local vars that occur free
-- D |- fun :: a t1 t2
-- D, xs |- arg :: t1
-- -----------------------------
-- D; xs |-a fun -< arg : stk --> t2
--
-- ---> premap (\ ((xs), _stk) -> arg) fun
dsCmd ids local_vars stack_ty res_ty
(HsCmdArrApp arrow arg arrow_ty HsFirstOrderApp _)
env_ids = do
let
(a_arg_ty, _res_ty') = tcSplitAppTy arrow_ty
(_a_ty, arg_ty) = tcSplitAppTy a_arg_ty
core_arrow <- dsLExpr arrow
core_arg <- dsLExpr arg
stack_id <- newSysLocalDs stack_ty
core_make_arg <- matchEnvStack env_ids stack_id core_arg
return (do_premap ids
(envStackType env_ids stack_ty)
arg_ty
res_ty
core_make_arg
core_arrow,
exprFreeIds core_arg `intersectVarSet` local_vars)
-- D, xs |- fun :: a t1 t2
-- D, xs |- arg :: t1
-- ------------------------------
-- D; xs |-a fun -<< arg : stk --> t2
--
-- ---> premap (\ ((xs), _stk) -> (fun, arg)) app
| 1,639
|
dsCmd :: DsCmdEnv -- arrow combinators
-> IdSet -- set of local vars available to this command
-> Type -- type of the stack (right-nested tuple)
-> Type -- return type of the command
-> HsCmd Id -- command to desugar
-> [Id] -- list of vars in the input to this command
-- This is typically fed back,
-- so don't pull on it too early
-> DsM (CoreExpr, -- desugared expression
IdSet)
dsCmd ids local_vars stack_ty res_ty
(HsCmdArrApp arrow arg arrow_ty HsFirstOrderApp _)
env_ids = do
let
(a_arg_ty, _res_ty') = tcSplitAppTy arrow_ty
(_a_ty, arg_ty) = tcSplitAppTy a_arg_ty
core_arrow <- dsLExpr arrow
core_arg <- dsLExpr arg
stack_id <- newSysLocalDs stack_ty
core_make_arg <- matchEnvStack env_ids stack_id core_arg
return (do_premap ids
(envStackType env_ids stack_ty)
arg_ty
res_ty
core_make_arg
core_arrow,
exprFreeIds core_arg `intersectVarSet` local_vars)
-- D, xs |- fun :: a t1 t2
-- D, xs |- arg :: t1
-- ------------------------------
-- D; xs |-a fun -<< arg : stk --> t2
--
-- ---> premap (\ ((xs), _stk) -> (fun, arg)) app
| 1,414
|
dsCmd ids local_vars stack_ty res_ty
(HsCmdArrApp arrow arg arrow_ty HsFirstOrderApp _)
env_ids = do
let
(a_arg_ty, _res_ty') = tcSplitAppTy arrow_ty
(_a_ty, arg_ty) = tcSplitAppTy a_arg_ty
core_arrow <- dsLExpr arrow
core_arg <- dsLExpr arg
stack_id <- newSysLocalDs stack_ty
core_make_arg <- matchEnvStack env_ids stack_id core_arg
return (do_premap ids
(envStackType env_ids stack_ty)
arg_ty
res_ty
core_make_arg
core_arrow,
exprFreeIds core_arg `intersectVarSet` local_vars)
-- D, xs |- fun :: a t1 t2
-- D, xs |- arg :: t1
-- ------------------------------
-- D; xs |-a fun -<< arg : stk --> t2
--
-- ---> premap (\ ((xs), _stk) -> (fun, arg)) app
| 808
| true
| true
| 0
| 14
| 619
| 224
| 118
| 106
| null | null |
dylex/wai
|
warp/Network/Wai/Handler/Warp/Settings.hs
|
mit
|
-- | Apply the logic provided by 'defaultOnException' to determine if an
-- exception should be shown or not. The goal is to hide exceptions which occur
-- under the normal course of the web server running.
--
-- Since 2.1.3
defaultShouldDisplayException :: SomeException -> Bool
defaultShouldDisplayException se
| Just ThreadKilled <- fromException se = False
| Just (_ :: InvalidRequest) <- fromException se = False
| Just (ioeGetErrorType -> et) <- fromException se
, et == ResourceVanished || et == InvalidArgument = False
| Just TimeoutThread <- fromException se = False
| otherwise = True
| 622
|
defaultShouldDisplayException :: SomeException -> Bool
defaultShouldDisplayException se
| Just ThreadKilled <- fromException se = False
| Just (_ :: InvalidRequest) <- fromException se = False
| Just (ioeGetErrorType -> et) <- fromException se
, et == ResourceVanished || et == InvalidArgument = False
| Just TimeoutThread <- fromException se = False
| otherwise = True
| 397
|
defaultShouldDisplayException se
| Just ThreadKilled <- fromException se = False
| Just (_ :: InvalidRequest) <- fromException se = False
| Just (ioeGetErrorType -> et) <- fromException se
, et == ResourceVanished || et == InvalidArgument = False
| Just TimeoutThread <- fromException se = False
| otherwise = True
| 342
| true
| true
| 1
| 11
| 123
| 140
| 67
| 73
| null | null |
kapilash/dc
|
src/ccs2c/ccs2cs-lib/runner/Main.hs
|
bsd-3-clause
|
ccsOpt2XArg ::CCSOption -> (CompArgs, CPPArgs) -> (CompArgs, CPPArgs)
ccsOpt2XArg (InclDir s) (CompArgs l1, CPPArgs l2) = (CompArgs $ ("-I " ++ s) : l1, CPPArgs $ ("-I " ++ s) : l2)
| 183
|
ccsOpt2XArg ::CCSOption -> (CompArgs, CPPArgs) -> (CompArgs, CPPArgs)
ccsOpt2XArg (InclDir s) (CompArgs l1, CPPArgs l2) = (CompArgs $ ("-I " ++ s) : l1, CPPArgs $ ("-I " ++ s) : l2)
| 183
|
ccsOpt2XArg (InclDir s) (CompArgs l1, CPPArgs l2) = (CompArgs $ ("-I " ++ s) : l1, CPPArgs $ ("-I " ++ s) : l2)
| 112
| false
| true
| 0
| 10
| 33
| 96
| 50
| 46
| null | null |
DavidAlphaFox/ghc
|
libraries/bytestring/Data/ByteString/Char8.hs
|
bsd-3-clause
|
unlines ss = (concat $ List.intersperse nl ss) `append` nl -- half as much space
where nl = singleton '\n'
-- | 'words' breaks a ByteString up into a list of words, which
-- were delimited by Chars representing white space.
| 228
|
unlines ss = (concat $ List.intersperse nl ss) `append` nl -- half as much space
where nl = singleton '\n'
-- | 'words' breaks a ByteString up into a list of words, which
-- were delimited by Chars representing white space.
| 228
|
unlines ss = (concat $ List.intersperse nl ss) `append` nl -- half as much space
where nl = singleton '\n'
-- | 'words' breaks a ByteString up into a list of words, which
-- were delimited by Chars representing white space.
| 228
| false
| false
| 0
| 9
| 45
| 43
| 23
| 20
| null | null |
diku-dk/futhark
|
src/Language/Futhark/Query.hs
|
isc
|
patternDefs Wildcard {} = mempty
| 32
|
patternDefs Wildcard {} = mempty
| 32
|
patternDefs Wildcard {} = mempty
| 32
| false
| false
| 0
| 6
| 4
| 13
| 6
| 7
| null | null |
nobrakal/TheBlackCurse
|
src/Keyboard.hs
|
gpl-3.0
|
getEvents cp (x:xs) = [| getC $(return cp) "KEYBOARD" x |] : getEvents cp xs
| 76
|
getEvents cp (x:xs) = [| getC $(return cp) "KEYBOARD" x |] : getEvents cp xs
| 76
|
getEvents cp (x:xs) = [| getC $(return cp) "KEYBOARD" x |] : getEvents cp xs
| 76
| false
| false
| 0
| 7
| 14
| 30
| 16
| 14
| null | null |
phonohawk/HsOpenSSL
|
Test/OpenSSL/EVP/Base64.hs
|
cc0-1.0
|
tests :: Test
tests = TestList
[ encodeTests
, lazyEncodeTests
, decodeTests
]
| 110
|
tests :: Test
tests = TestList
[ encodeTests
, lazyEncodeTests
, decodeTests
]
| 110
|
tests = TestList
[ encodeTests
, lazyEncodeTests
, decodeTests
]
| 96
| false
| true
| 0
| 6
| 44
| 23
| 13
| 10
| null | null |
positiondev/orged
|
src/Web/Trello/Sync.hs
|
isc
|
archiveCard :: Creds -> CardId -> IO ()
archiveCard creds card = do put' creds (cardEndpoint card) [("closed", "true")]
return ()
| 157
|
archiveCard :: Creds -> CardId -> IO ()
archiveCard creds card = do put' creds (cardEndpoint card) [("closed", "true")]
return ()
| 157
|
archiveCard creds card = do put' creds (cardEndpoint card) [("closed", "true")]
return ()
| 117
| false
| true
| 0
| 10
| 48
| 67
| 31
| 36
| null | null |
gwright83/Wheeler
|
src/Math/Symbolic/Wheeler/IO.hs
|
bsd-3-clause
|
float :: Parser Double
float = P.float lexer
| 45
|
float :: Parser Double
float = P.float lexer
| 45
|
float = P.float lexer
| 22
| false
| true
| 0
| 6
| 8
| 19
| 9
| 10
| null | null |
spell-music/temporal-music-notation
|
src/Temporal/Music/Score.hs
|
bsd-3-clause
|
hn = str $ 1/2
| 14
|
hn = str $ 1/2
| 14
|
hn = str $ 1/2
| 14
| false
| false
| 0
| 6
| 4
| 14
| 7
| 7
| null | null |
thomie/cabal
|
cabal-install/tests/UnitTests/Distribution/Client/FileMonitor.hs
|
bsd-3-clause
|
testCorruptMonitorCache :: Assertion
testCorruptMonitorCache =
withFileMonitor $ \root monitor -> do
IO.writeFile (fileMonitorCacheFile monitor) "broken"
reason <- expectMonitorChanged root monitor ()
reason @?= MonitorCorruptCache
updateMonitor root monitor [] () ()
(res, files) <- expectMonitorUnchanged root monitor ()
res @?= ()
files @?= []
IO.writeFile (fileMonitorCacheFile monitor) "broken"
reason2 <- expectMonitorChanged root monitor ()
reason2 @?= MonitorCorruptCache
-- no files to monitor
| 549
|
testCorruptMonitorCache :: Assertion
testCorruptMonitorCache =
withFileMonitor $ \root monitor -> do
IO.writeFile (fileMonitorCacheFile monitor) "broken"
reason <- expectMonitorChanged root monitor ()
reason @?= MonitorCorruptCache
updateMonitor root monitor [] () ()
(res, files) <- expectMonitorUnchanged root monitor ()
res @?= ()
files @?= []
IO.writeFile (fileMonitorCacheFile monitor) "broken"
reason2 <- expectMonitorChanged root monitor ()
reason2 @?= MonitorCorruptCache
-- no files to monitor
| 549
|
testCorruptMonitorCache =
withFileMonitor $ \root monitor -> do
IO.writeFile (fileMonitorCacheFile monitor) "broken"
reason <- expectMonitorChanged root monitor ()
reason @?= MonitorCorruptCache
updateMonitor root monitor [] () ()
(res, files) <- expectMonitorUnchanged root monitor ()
res @?= ()
files @?= []
IO.writeFile (fileMonitorCacheFile monitor) "broken"
reason2 <- expectMonitorChanged root monitor ()
reason2 @?= MonitorCorruptCache
-- no files to monitor
| 512
| false
| true
| 0
| 11
| 107
| 161
| 75
| 86
| null | null |
vikraman/ghc
|
compiler/specialise/Rules.hs
|
bsd-3-clause
|
match _ subst (Lit lit1) (Lit lit2)
| lit1 == lit2
= Just subst
| 67
|
match _ subst (Lit lit1) (Lit lit2)
| lit1 == lit2
= Just subst
| 67
|
match _ subst (Lit lit1) (Lit lit2)
| lit1 == lit2
= Just subst
| 67
| false
| false
| 1
| 8
| 17
| 42
| 18
| 24
| null | null |
jotix/verificadorCuitCuil
|
src/VerificadorCuitCuil.hs
|
bsd-3-clause
|
verificarCuil :: Int -> Bool
verificarCuil = verificarCuit
| 58
|
verificarCuil :: Int -> Bool
verificarCuil = verificarCuit
| 58
|
verificarCuil = verificarCuit
| 29
| false
| true
| 0
| 7
| 7
| 22
| 9
| 13
| null | null |
mumuki/mulang
|
src/Language/Mulang/Signature.hs
|
gpl-3.0
|
name (TypedSignature n _ _) = n
| 31
|
name (TypedSignature n _ _) = n
| 31
|
name (TypedSignature n _ _) = n
| 31
| false
| false
| 0
| 6
| 6
| 20
| 9
| 11
| null | null |
ben-schulz/Idris-dev
|
src/IRTS/Lang.hs
|
bsd-3-clause
|
-- Lifting happens before these can exist...
lift env (LApp tc (LV (Glob n)) args) = do args' <- mapM (lift env) args
return (LApp tc (LV (Glob n)) args')
| 197
|
lift env (LApp tc (LV (Glob n)) args) = do args' <- mapM (lift env) args
return (LApp tc (LV (Glob n)) args')
| 152
|
lift env (LApp tc (LV (Glob n)) args) = do args' <- mapM (lift env) args
return (LApp tc (LV (Glob n)) args')
| 152
| true
| false
| 0
| 13
| 72
| 82
| 38
| 44
| null | null |
fugyk/cabal
|
Cabal/Distribution/Simple/Setup.hs
|
bsd-3-clause
|
emptyBenchmarkFlags :: BenchmarkFlags
emptyBenchmarkFlags = mempty
| 66
|
emptyBenchmarkFlags :: BenchmarkFlags
emptyBenchmarkFlags = mempty
| 66
|
emptyBenchmarkFlags = mempty
| 28
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
plow-technologies/ghcjs-dom
|
src/GHCJS/DOM/EventM.hs
|
mit
|
mouseFromElement :: IsMouseEvent e => EventM t e (Maybe Node)
mouseFromElement = event >>= MouseEvent.getFromElement
| 116
|
mouseFromElement :: IsMouseEvent e => EventM t e (Maybe Node)
mouseFromElement = event >>= MouseEvent.getFromElement
| 116
|
mouseFromElement = event >>= MouseEvent.getFromElement
| 54
| false
| true
| 0
| 8
| 14
| 37
| 18
| 19
| null | null |
biinui/mapper
|
src/JSON.hs
|
apache-2.0
|
getFileSize :: FilePath -> IO (Maybe Integer)
getFileSize path = handle handler
$ bracket (openFile path ReadMode) (hClose) (\h -> do size <- hFileSize h
return $ Just size)
where
handler :: SomeException -> IO (Maybe Integer)
handler _ = return Nothing
| 371
|
getFileSize :: FilePath -> IO (Maybe Integer)
getFileSize path = handle handler
$ bracket (openFile path ReadMode) (hClose) (\h -> do size <- hFileSize h
return $ Just size)
where
handler :: SomeException -> IO (Maybe Integer)
handler _ = return Nothing
| 370
|
getFileSize path = handle handler
$ bracket (openFile path ReadMode) (hClose) (\h -> do size <- hFileSize h
return $ Just size)
where
handler :: SomeException -> IO (Maybe Integer)
handler _ = return Nothing
| 324
| false
| true
| 2
| 11
| 159
| 121
| 55
| 66
| null | null |
charlesrosenbauer/Bzo-Compiler
|
src/TypeChecker.hs
|
gpl-3.0
|
checkType' k d (h0, ArryType p 0 _ ) (h1, ArryType _ _ _) = ([TypeErr p $ pack $ "Cannot constrain array size."], [])
| 118
|
checkType' k d (h0, ArryType p 0 _ ) (h1, ArryType _ _ _) = ([TypeErr p $ pack $ "Cannot constrain array size."], [])
| 118
|
checkType' k d (h0, ArryType p 0 _ ) (h1, ArryType _ _ _) = ([TypeErr p $ pack $ "Cannot constrain array size."], [])
| 118
| false
| false
| 0
| 9
| 25
| 63
| 33
| 30
| null | null |
anttisalonen/freekick2
|
src/Match/DrawPitch.hs
|
gpl-3.0
|
draw2DArcAngled' :: (Float, Float) -> Float -> Float -> Float -> (Maybe (Float, Float)) -> IO ()
draw2DArcAngled' (xp', yp') r' w' d' an = preservingMatrix $ do
let (xp, yp) = (realToFrac xp', realToFrac yp')
r = realToFrac r'
w = realToFrac w'
d = realToFrac d'
translate $ Vector3 xp yp (d :: GLfloat)
case an of
Nothing -> renderQuadric (QuadricStyle Nothing NoTextureCoordinates Inside FillStyle) (Disk r (r + w) 64 1)
Just (a1, a2) -> renderQuadric (QuadricStyle Nothing NoTextureCoordinates Inside FillStyle) (PartialDisk r (r + w) 64 1 (realToFrac a1) (realToFrac a2))
| 613
|
draw2DArcAngled' :: (Float, Float) -> Float -> Float -> Float -> (Maybe (Float, Float)) -> IO ()
draw2DArcAngled' (xp', yp') r' w' d' an = preservingMatrix $ do
let (xp, yp) = (realToFrac xp', realToFrac yp')
r = realToFrac r'
w = realToFrac w'
d = realToFrac d'
translate $ Vector3 xp yp (d :: GLfloat)
case an of
Nothing -> renderQuadric (QuadricStyle Nothing NoTextureCoordinates Inside FillStyle) (Disk r (r + w) 64 1)
Just (a1, a2) -> renderQuadric (QuadricStyle Nothing NoTextureCoordinates Inside FillStyle) (PartialDisk r (r + w) 64 1 (realToFrac a1) (realToFrac a2))
| 613
|
draw2DArcAngled' (xp', yp') r' w' d' an = preservingMatrix $ do
let (xp, yp) = (realToFrac xp', realToFrac yp')
r = realToFrac r'
w = realToFrac w'
d = realToFrac d'
translate $ Vector3 xp yp (d :: GLfloat)
case an of
Nothing -> renderQuadric (QuadricStyle Nothing NoTextureCoordinates Inside FillStyle) (Disk r (r + w) 64 1)
Just (a1, a2) -> renderQuadric (QuadricStyle Nothing NoTextureCoordinates Inside FillStyle) (PartialDisk r (r + w) 64 1 (realToFrac a1) (realToFrac a2))
| 516
| false
| true
| 0
| 16
| 132
| 268
| 135
| 133
| null | null |
kawu/partage
|
src/NLP/Partage/AStar.hs
|
bsd-2-clause
|
omega
:: DID -- ^ Dependent
-> DID -- ^ Head
-> EarleyPipe n t (Maybe Weight)
omega depDid hedDid = do
auto <- RWS.gets automat
let anchorMap = anchorPos auto
-- headMap = headPos auto
-- dag = gramDAG auto
omegaPos depDid (M.lookup hedDid anchorMap)
-- let cost = do
-- -- determine the position of the dependent tree
-- depPos <- M.lookup depDid anchorMap
-- -- determine the position of the head tree
-- hedPos <- M.lookup hedDid anchorMap
-- -- determine the accepted positions of the dependent tree
-- posMap <- M.lookup depPos headMap
-- -- return the corresponding weight
-- return $ M.lookup hedPos posMap
-- -- we additionally add the dependent node weight (which should be non-zero
-- -- only if `depDid` is a root)
-- let treeWeight =
-- case DAG.value depDid dag of
-- Nothing -> 0
-- Just x -> x
-- -- combine and return
-- return . fmap (+treeWeight) $
-- case cost of
-- Just Nothing -> Nothing
-- Nothing -> Just 0
-- Just (Just x) -> Just x
-- | Weight of the given node becoming a dependent of another node.
-- Returns `Nothing` if the operation is not allowed.
| 1,233
|
omega
:: DID -- ^ Dependent
-> DID -- ^ Head
-> EarleyPipe n t (Maybe Weight)
omega depDid hedDid = do
auto <- RWS.gets automat
let anchorMap = anchorPos auto
-- headMap = headPos auto
-- dag = gramDAG auto
omegaPos depDid (M.lookup hedDid anchorMap)
-- let cost = do
-- -- determine the position of the dependent tree
-- depPos <- M.lookup depDid anchorMap
-- -- determine the position of the head tree
-- hedPos <- M.lookup hedDid anchorMap
-- -- determine the accepted positions of the dependent tree
-- posMap <- M.lookup depPos headMap
-- -- return the corresponding weight
-- return $ M.lookup hedPos posMap
-- -- we additionally add the dependent node weight (which should be non-zero
-- -- only if `depDid` is a root)
-- let treeWeight =
-- case DAG.value depDid dag of
-- Nothing -> 0
-- Just x -> x
-- -- combine and return
-- return . fmap (+treeWeight) $
-- case cost of
-- Just Nothing -> Nothing
-- Nothing -> Just 0
-- Just (Just x) -> Just x
-- | Weight of the given node becoming a dependent of another node.
-- Returns `Nothing` if the operation is not allowed.
| 1,233
|
omega depDid hedDid = do
auto <- RWS.gets automat
let anchorMap = anchorPos auto
-- headMap = headPos auto
-- dag = gramDAG auto
omegaPos depDid (M.lookup hedDid anchorMap)
-- let cost = do
-- -- determine the position of the dependent tree
-- depPos <- M.lookup depDid anchorMap
-- -- determine the position of the head tree
-- hedPos <- M.lookup hedDid anchorMap
-- -- determine the accepted positions of the dependent tree
-- posMap <- M.lookup depPos headMap
-- -- return the corresponding weight
-- return $ M.lookup hedPos posMap
-- -- we additionally add the dependent node weight (which should be non-zero
-- -- only if `depDid` is a root)
-- let treeWeight =
-- case DAG.value depDid dag of
-- Nothing -> 0
-- Just x -> x
-- -- combine and return
-- return . fmap (+treeWeight) $
-- case cost of
-- Just Nothing -> Nothing
-- Nothing -> Just 0
-- Just (Just x) -> Just x
-- | Weight of the given node becoming a dependent of another node.
-- Returns `Nothing` if the operation is not allowed.
| 1,147
| false
| true
| 0
| 11
| 356
| 111
| 64
| 47
| null | null |
thalerjonathan/phd
|
public/towards/SugarScape/experimental/chapter2_environment/src/SugarScape/Renderer.hs
|
gpl-3.0
|
renderEnvCell Polution r@(rw, rh) w _t (coord, cell) = polLvlSquare
where
(x, y) = transformToWindow r w coord
polLvl = sugEnvCellPolutionLevel cell
polRatio = 1.0 - min 1.0 (realToFrac (polLvl / polBlackCap))
polColor = if polLvl == 0 then GLO.white else GLO.makeColor 0 polRatio 0 1
polLvlSquare = GLO.color polColor $ GLO.translate x y $ GLO.rectangleSolid rw rh
| 408
|
renderEnvCell Polution r@(rw, rh) w _t (coord, cell) = polLvlSquare
where
(x, y) = transformToWindow r w coord
polLvl = sugEnvCellPolutionLevel cell
polRatio = 1.0 - min 1.0 (realToFrac (polLvl / polBlackCap))
polColor = if polLvl == 0 then GLO.white else GLO.makeColor 0 polRatio 0 1
polLvlSquare = GLO.color polColor $ GLO.translate x y $ GLO.rectangleSolid rw rh
| 408
|
renderEnvCell Polution r@(rw, rh) w _t (coord, cell) = polLvlSquare
where
(x, y) = transformToWindow r w coord
polLvl = sugEnvCellPolutionLevel cell
polRatio = 1.0 - min 1.0 (realToFrac (polLvl / polBlackCap))
polColor = if polLvl == 0 then GLO.white else GLO.makeColor 0 polRatio 0 1
polLvlSquare = GLO.color polColor $ GLO.translate x y $ GLO.rectangleSolid rw rh
| 408
| false
| false
| 4
| 11
| 100
| 152
| 78
| 74
| null | null |
kaoskorobase/mescaline
|
lib/mescaline-patterns/src/Mescaline/Quant.hs
|
gpl-3.0
|
beatsUntilQuantized :: Meter -> Quant -> Beats -> Beats
beatsUntilQuantized m (Quant q p) b
| q == 0 = p
| otherwise =
let qx = if q < 0
then fromIntegral (beatsPerBar m) * negate q
else q
px = wrap p qx
rx = mod' b qx
bx = if rx == 0
then 0
else qx - rx
in bx + px
| 371
|
beatsUntilQuantized :: Meter -> Quant -> Beats -> Beats
beatsUntilQuantized m (Quant q p) b
| q == 0 = p
| otherwise =
let qx = if q < 0
then fromIntegral (beatsPerBar m) * negate q
else q
px = wrap p qx
rx = mod' b qx
bx = if rx == 0
then 0
else qx - rx
in bx + px
| 371
|
beatsUntilQuantized m (Quant q p) b
| q == 0 = p
| otherwise =
let qx = if q < 0
then fromIntegral (beatsPerBar m) * negate q
else q
px = wrap p qx
rx = mod' b qx
bx = if rx == 0
then 0
else qx - rx
in bx + px
| 315
| false
| true
| 1
| 13
| 171
| 140
| 70
| 70
| null | null |
mathhun/stack
|
src/Stack/Types/Image.hs
|
bsd-3-clause
|
imgDockerBaseArgName :: Text
imgDockerBaseArgName = "base"
| 58
|
imgDockerBaseArgName :: Text
imgDockerBaseArgName = "base"
| 58
|
imgDockerBaseArgName = "base"
| 29
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
aslatter/blobstore
|
test/Main.hs
|
bsd-3-clause
|
insertRetrieveNonEmpty :: Assertion
insertRetrieveNonEmpty =
withTempStore $ \store -> do
addAndCheck (L.pack "The quick brown fox jumped over the lazy dog.") store
addAndCheck (L.pack "Haskell fun with HUnit!") store
| 233
|
insertRetrieveNonEmpty :: Assertion
insertRetrieveNonEmpty =
withTempStore $ \store -> do
addAndCheck (L.pack "The quick brown fox jumped over the lazy dog.") store
addAndCheck (L.pack "Haskell fun with HUnit!") store
| 233
|
insertRetrieveNonEmpty =
withTempStore $ \store -> do
addAndCheck (L.pack "The quick brown fox jumped over the lazy dog.") store
addAndCheck (L.pack "Haskell fun with HUnit!") store
| 197
| false
| true
| 0
| 12
| 44
| 52
| 25
| 27
| null | null |
jberthold/rts-serialisation
|
PackToMemIFL10.hs
|
bsd-3-clause
|
digit = satisfy isDigit
| 23
|
digit = satisfy isDigit
| 23
|
digit = satisfy isDigit
| 23
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
soenkehahn/quickcheck
|
Test/QuickCheck/Test.hs
|
bsd-3-clause
|
labelPercentage :: String -> State -> Int
labelPercentage l st =
-- XXX in case of a disjunction, a label can occur several times,
-- need to think what to do there
(100 * occur) `div` maxSuccessTests st
where
occur = length [ l' | l' <- concat (map Set.toList (collected st)), l == l' ]
| 299
|
labelPercentage :: String -> State -> Int
labelPercentage l st =
-- XXX in case of a disjunction, a label can occur several times,
-- need to think what to do there
(100 * occur) `div` maxSuccessTests st
where
occur = length [ l' | l' <- concat (map Set.toList (collected st)), l == l' ]
| 299
|
labelPercentage l st =
-- XXX in case of a disjunction, a label can occur several times,
-- need to think what to do there
(100 * occur) `div` maxSuccessTests st
where
occur = length [ l' | l' <- concat (map Set.toList (collected st)), l == l' ]
| 257
| false
| true
| 0
| 13
| 67
| 91
| 47
| 44
| null | null |
rueshyna/gogol
|
gogol-blogger/gen/Network/Google/Blogger/Types/Product.hs
|
mpl-2.0
|
-- | The list of Pages for a Blog.
pllItems :: Lens' PageList [Page]
pllItems
= lens _pllItems (\ s a -> s{_pllItems = a}) .
_Default
. _Coerce
| 157
|
pllItems :: Lens' PageList [Page]
pllItems
= lens _pllItems (\ s a -> s{_pllItems = a}) .
_Default
. _Coerce
| 122
|
pllItems
= lens _pllItems (\ s a -> s{_pllItems = a}) .
_Default
. _Coerce
| 88
| true
| true
| 2
| 9
| 42
| 58
| 28
| 30
| null | null |
rahulmutt/ghcvm
|
compiler/Eta/SimplCore/SimplMonad.hs
|
bsd-3-clause
|
thenSmpl_ :: SimplM a -> SimplM b -> SimplM b
thenSmpl m k
= SM $ \st_env us0 sc0 -> do
(m_result, us1, sc1) <- unSM m st_env us0 sc0
unSM (k m_result) st_env us1 sc1
| 181
|
thenSmpl_ :: SimplM a -> SimplM b -> SimplM b
thenSmpl m k
= SM $ \st_env us0 sc0 -> do
(m_result, us1, sc1) <- unSM m st_env us0 sc0
unSM (k m_result) st_env us1 sc1
| 180
|
thenSmpl m k
= SM $ \st_env us0 sc0 -> do
(m_result, us1, sc1) <- unSM m st_env us0 sc0
unSM (k m_result) st_env us1 sc1
| 134
| false
| true
| 2
| 11
| 50
| 95
| 44
| 51
| null | null |
goshakkk/lisley
|
src/Lisley/Types.hs
|
mit
|
showError (BadSpecialForm msg f) = msg ++ ": " ++ show f
| 56
|
showError (BadSpecialForm msg f) = msg ++ ": " ++ show f
| 56
|
showError (BadSpecialForm msg f) = msg ++ ": " ++ show f
| 56
| false
| false
| 0
| 7
| 11
| 28
| 13
| 15
| null | null |
pascal-knodel/haskell-craft
|
_/links/E'12''3.hs
|
mit
|
-- TEMFIN NONFIN: higher order function definition.
-- Other solutions for "makePicture":
makePicture' :: Int -> Int -> [(Int, Int)] -> Picture
makePicture' gw gh gps -- "gw"; given width, "gh"; given height, "gps"; given points
= [ [ if ( (h , w) `elem` gps ) then ('#') else ('.') | w <- [0 .. gw - 1] ] | h <- [0 .. gh - 1] ]
| 340
|
makePicture' :: Int -> Int -> [(Int, Int)] -> Picture
makePicture' gw gh gps -- "gw"; given width, "gh"; given height, "gps"; given points
= [ [ if ( (h , w) `elem` gps ) then ('#') else ('.') | w <- [0 .. gw - 1] ] | h <- [0 .. gh - 1] ]
| 243
|
makePicture' gw gh gps -- "gw"; given width, "gh"; given height, "gps"; given points
= [ [ if ( (h , w) `elem` gps ) then ('#') else ('.') | w <- [0 .. gw - 1] ] | h <- [0 .. gh - 1] ]
| 189
| true
| true
| 0
| 10
| 80
| 113
| 67
| 46
| null | null |
dsj36/dropray
|
src/BabyRays/Material.hs
|
gpl-3.0
|
cornellRed = const ((0.63, 0.06, 0.04), 0, 1)
| 47
|
cornellRed = const ((0.63, 0.06, 0.04), 0, 1)
| 47
|
cornellRed = const ((0.63, 0.06, 0.04), 0, 1)
| 47
| false
| false
| 1
| 6
| 9
| 30
| 16
| 14
| null | null |
feuerbach/music
|
Melody/GameOfThrones.hs
|
mit
|
stave1 = do
chord ["g3", "c4", "g4"] 3
chord ["g3", "c4"] 3
chord ["g3", "e4b"] 0.5
chord ["g3", "f4"] 0.5
chord ["g3", "g4"] 2
chord ["g3", "c4"] 2
chord ["g3", "e4b"] 0.5
chord ["g3", "f4"] 0.5
| 243
|
stave1 = do
chord ["g3", "c4", "g4"] 3
chord ["g3", "c4"] 3
chord ["g3", "e4b"] 0.5
chord ["g3", "f4"] 0.5
chord ["g3", "g4"] 2
chord ["g3", "c4"] 2
chord ["g3", "e4b"] 0.5
chord ["g3", "f4"] 0.5
| 243
|
stave1 = do
chord ["g3", "c4", "g4"] 3
chord ["g3", "c4"] 3
chord ["g3", "e4b"] 0.5
chord ["g3", "f4"] 0.5
chord ["g3", "g4"] 2
chord ["g3", "c4"] 2
chord ["g3", "e4b"] 0.5
chord ["g3", "f4"] 0.5
| 243
| false
| false
| 0
| 8
| 83
| 121
| 61
| 60
| null | null |
beni55/texmath
|
src/Text/TeXMath/Readers/TeX.hs
|
gpl-2.0
|
texSymbol :: TP Exp
texSymbol = do
negated <- (try (ctrlseq "not") >> return True) <|> return False
sym <- operator <|> tSymbol
if negated then neg sym else return sym
| 173
|
texSymbol :: TP Exp
texSymbol = do
negated <- (try (ctrlseq "not") >> return True) <|> return False
sym <- operator <|> tSymbol
if negated then neg sym else return sym
| 173
|
texSymbol = do
negated <- (try (ctrlseq "not") >> return True) <|> return False
sym <- operator <|> tSymbol
if negated then neg sym else return sym
| 153
| false
| true
| 0
| 14
| 36
| 81
| 36
| 45
| null | null |
haskoin/haskoin
|
src/Haskoin/Util/Arbitrary/Network.hs
|
unlicense
|
-- | Arbitrary 'NetworkAddress'.
arbitraryNetworkAddress :: Gen NetworkAddress
arbitraryNetworkAddress = do
s <- arbitrary
a <- arbitrary
p <- arbitrary
d <- oneof
[ do
b <- arbitrary
c <- arbitrary
d <- arbitrary
return $ SockAddrInet6 (fromIntegral p) 0 (a,b,c,d) 0
, return $ SockAddrInet (fromIntegral (p :: Word16)) a
]
let n = sockToHostAddress d
return $ NetworkAddress s n
-- | Arbitrary 'NetworkAddressTime'.
| 514
|
arbitraryNetworkAddress :: Gen NetworkAddress
arbitraryNetworkAddress = do
s <- arbitrary
a <- arbitrary
p <- arbitrary
d <- oneof
[ do
b <- arbitrary
c <- arbitrary
d <- arbitrary
return $ SockAddrInet6 (fromIntegral p) 0 (a,b,c,d) 0
, return $ SockAddrInet (fromIntegral (p :: Word16)) a
]
let n = sockToHostAddress d
return $ NetworkAddress s n
-- | Arbitrary 'NetworkAddressTime'.
| 481
|
arbitraryNetworkAddress = do
s <- arbitrary
a <- arbitrary
p <- arbitrary
d <- oneof
[ do
b <- arbitrary
c <- arbitrary
d <- arbitrary
return $ SockAddrInet6 (fromIntegral p) 0 (a,b,c,d) 0
, return $ SockAddrInet (fromIntegral (p :: Word16)) a
]
let n = sockToHostAddress d
return $ NetworkAddress s n
-- | Arbitrary 'NetworkAddressTime'.
| 435
| true
| true
| 0
| 15
| 162
| 153
| 74
| 79
| null | null |
chrisdone/hl
|
src/HL/V/Wiki.hs
|
bsd-3-clause
|
decodeEntities :: Text -> Text
decodeEntities t =
runIdentity (fmap (toStrict . toLazyText . mconcat)
(CL.sourceList [t]
$= tokenStream
$= CL.map (showToken (\x ->x))
$$ CL.consume))
| 267
|
decodeEntities :: Text -> Text
decodeEntities t =
runIdentity (fmap (toStrict . toLazyText . mconcat)
(CL.sourceList [t]
$= tokenStream
$= CL.map (showToken (\x ->x))
$$ CL.consume))
| 267
|
decodeEntities t =
runIdentity (fmap (toStrict . toLazyText . mconcat)
(CL.sourceList [t]
$= tokenStream
$= CL.map (showToken (\x ->x))
$$ CL.consume))
| 236
| false
| true
| 0
| 15
| 110
| 88
| 44
| 44
| null | null |
dorchard/camfort
|
src/Camfort/Transformation/CommonBlockElim.hs
|
apache-2.0
|
commonNameFromAST _ = Nothing
| 29
|
commonNameFromAST _ = Nothing
| 29
|
commonNameFromAST _ = Nothing
| 29
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
foreverbell/unlimited-plt-toys
|
extra/re/src/Main.hs
|
bsd-3-clause
|
usage :: IO ()
usage = printf "usage: %s <infile>\n" =<< getProgName
| 68
|
usage :: IO ()
usage = printf "usage: %s <infile>\n" =<< getProgName
| 68
|
usage = printf "usage: %s <infile>\n" =<< getProgName
| 53
| false
| true
| 0
| 7
| 11
| 28
| 12
| 16
| null | null |
alpmestan/servant-ede
|
src/Servant/EDE.hs
|
bsd-3-clause
|
-- | This function initializes a global
-- template store (i.e a 'Templates' value) and fills it with
-- the resulting compiled templates if all of them are compiled
-- successfully. If that's not the case, the global template store
-- (under an 'MVar') is left empty.
--
-- /IMPORTANT/: Must /always/ be called before starting your /servant/ application. Example:
--
-- > type API = Get '[HTML "home.tpl"] HomeData
-- >
-- > api :: Proxy API
-- > api = Proxy
-- >
-- > main :: IO ()
-- > main = loadTemplates api "path/to/templates" >>= print
--
-- This would try to load @home.tpl@, printing any error or
-- registering the compiled template in a global (but safe)
-- compiled template store, if successfully compiled.
loadTemplates :: (Reify (TemplateFiles api), Applicative m, MonadIO m)
=> Proxy api
-> [Filter] -- ^ list of (Text,Term) pairs. Pass [] to use just the standard library
-> FilePath -- ^ root directory for the templates
-> m Errors
loadTemplates proxy fpairs dir = do
let flts = fromList fpairs
res <- loadTemplates' proxy dir
case res of
Left errs -> return errs
Right tpls -> do
let tplfs = TemplatesAndFilters tpls flts
liftIO $ putMVar __template_store tplfs
return []
| 1,291
|
loadTemplates :: (Reify (TemplateFiles api), Applicative m, MonadIO m)
=> Proxy api
-> [Filter] -- ^ list of (Text,Term) pairs. Pass [] to use just the standard library
-> FilePath -- ^ root directory for the templates
-> m Errors
loadTemplates proxy fpairs dir = do
let flts = fromList fpairs
res <- loadTemplates' proxy dir
case res of
Left errs -> return errs
Right tpls -> do
let tplfs = TemplatesAndFilters tpls flts
liftIO $ putMVar __template_store tplfs
return []
| 560
|
loadTemplates proxy fpairs dir = do
let flts = fromList fpairs
res <- loadTemplates' proxy dir
case res of
Left errs -> return errs
Right tpls -> do
let tplfs = TemplatesAndFilters tpls flts
liftIO $ putMVar __template_store tplfs
return []
| 273
| true
| true
| 0
| 17
| 308
| 179
| 91
| 88
| null | null |
tjakway/ghcjvm
|
compiler/utils/BooleanFormula.hs
|
bsd-3-clause
|
pprBooleanFormulaNice :: Outputable a => BooleanFormula a -> SDoc
pprBooleanFormulaNice = pprBooleanFormula' pprVar pprAnd pprOr 0
where
pprVar _ = quotes . ppr
pprAnd p = cparen (p > 1) . pprAnd'
pprAnd' [] = empty
pprAnd' [x,y] = x <+> text "and" <+> y
pprAnd' xs@(_:_) = fsep (punctuate comma (init xs)) <> text ", and" <+> last xs
pprOr p xs = cparen (p > 1) $ text "either" <+> sep (intersperse (text "or") xs)
| 429
|
pprBooleanFormulaNice :: Outputable a => BooleanFormula a -> SDoc
pprBooleanFormulaNice = pprBooleanFormula' pprVar pprAnd pprOr 0
where
pprVar _ = quotes . ppr
pprAnd p = cparen (p > 1) . pprAnd'
pprAnd' [] = empty
pprAnd' [x,y] = x <+> text "and" <+> y
pprAnd' xs@(_:_) = fsep (punctuate comma (init xs)) <> text ", and" <+> last xs
pprOr p xs = cparen (p > 1) $ text "either" <+> sep (intersperse (text "or") xs)
| 429
|
pprBooleanFormulaNice = pprBooleanFormula' pprVar pprAnd pprOr 0
where
pprVar _ = quotes . ppr
pprAnd p = cparen (p > 1) . pprAnd'
pprAnd' [] = empty
pprAnd' [x,y] = x <+> text "and" <+> y
pprAnd' xs@(_:_) = fsep (punctuate comma (init xs)) <> text ", and" <+> last xs
pprOr p xs = cparen (p > 1) $ text "either" <+> sep (intersperse (text "or") xs)
| 363
| false
| true
| 0
| 11
| 90
| 203
| 99
| 104
| null | null |
facebookincubator/duckling
|
Duckling/Dimensions/ID.hs
|
bsd-3-clause
|
allDimensions :: [Seal Dimension]
allDimensions =
[ Seal Numeral
, Seal Ordinal
]
| 87
|
allDimensions :: [Seal Dimension]
allDimensions =
[ Seal Numeral
, Seal Ordinal
]
| 87
|
allDimensions =
[ Seal Numeral
, Seal Ordinal
]
| 53
| false
| true
| 0
| 8
| 18
| 36
| 16
| 20
| null | null |
gsdlab/clafer
|
src/Language/Clafer/Generator/Graph.hs
|
mit
|
graphCVLExp (EDifference _ set1 set2) parent' irMap = graphCVLExp set1 parent' irMap ++ graphCVLExp set2 parent' irMap
| 118
|
graphCVLExp (EDifference _ set1 set2) parent' irMap = graphCVLExp set1 parent' irMap ++ graphCVLExp set2 parent' irMap
| 118
|
graphCVLExp (EDifference _ set1 set2) parent' irMap = graphCVLExp set1 parent' irMap ++ graphCVLExp set2 parent' irMap
| 118
| false
| false
| 0
| 7
| 16
| 41
| 19
| 22
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.