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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
christiaanb/ghc | compiler/main/DriverPipeline.hs | bsd-3-clause | runPipeline'
:: PhasePlus -- ^ When to start
-> HscEnv -- ^ Compilation environment
-> PipeEnv
-> FilePath -- ^ Input filename
-> Maybe ModLocation -- ^ A ModLocation, if this is a Haskell module
-> Maybe FilePath -- ^ stub object, if we have one
-> IO (DynFlags, FilePath) -- ^ (final flags, output filename)
runPipeline' start_phase hsc_env env input_fn
maybe_loc maybe_stub_o
= do
-- Execute the pipeline...
let state = PipeState{ hsc_env, maybe_loc, maybe_stub_o = maybe_stub_o }
evalP (pipeLoop start_phase input_fn) env state
-- ---------------------------------------------------------------------------
-- outer pipeline loop
-- | pipeLoop runs phases until we reach the stop phase | 806 | runPipeline'
:: PhasePlus -- ^ When to start
-> HscEnv -- ^ Compilation environment
-> PipeEnv
-> FilePath -- ^ Input filename
-> Maybe ModLocation -- ^ A ModLocation, if this is a Haskell module
-> Maybe FilePath -- ^ stub object, if we have one
-> IO (DynFlags, FilePath)
runPipeline' start_phase hsc_env env input_fn
maybe_loc maybe_stub_o
= do
-- Execute the pipeline...
let state = PipeState{ hsc_env, maybe_loc, maybe_stub_o = maybe_stub_o }
evalP (pipeLoop start_phase input_fn) env state
-- ---------------------------------------------------------------------------
-- outer pipeline loop
-- | pipeLoop runs phases until we reach the stop phase | 767 | runPipeline' start_phase hsc_env env input_fn
maybe_loc maybe_stub_o
= do
-- Execute the pipeline...
let state = PipeState{ hsc_env, maybe_loc, maybe_stub_o = maybe_stub_o }
evalP (pipeLoop start_phase input_fn) env state
-- ---------------------------------------------------------------------------
-- outer pipeline loop
-- | pipeLoop runs phases until we reach the stop phase | 403 | true | true | 0 | 13 | 218 | 119 | 63 | 56 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/SESReceiptRuleS3Action.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-s3action.html#cfn-ses-receiptrule-s3action-kmskeyarn
sesrrsaKmsKeyArn :: Lens' SESReceiptRuleS3Action (Maybe (Val Text))
sesrrsaKmsKeyArn = lens _sESReceiptRuleS3ActionKmsKeyArn (\s a -> s { _sESReceiptRuleS3ActionKmsKeyArn = a }) | 328 | sesrrsaKmsKeyArn :: Lens' SESReceiptRuleS3Action (Maybe (Val Text))
sesrrsaKmsKeyArn = lens _sESReceiptRuleS3ActionKmsKeyArn (\s a -> s { _sESReceiptRuleS3ActionKmsKeyArn = a }) | 177 | sesrrsaKmsKeyArn = lens _sESReceiptRuleS3ActionKmsKeyArn (\s a -> s { _sESReceiptRuleS3ActionKmsKeyArn = a }) | 109 | true | true | 1 | 9 | 22 | 55 | 28 | 27 | null | null |
mjansen/network-db-parsers | Data/NetworkDB/HostsEntry.hs | gpl-3.0 | hfLookup :: B.ByteString -> [HostEntry] -> B.ByteString
hfLookup name rs =
let xs = filter ((name `elem`) . names) rs
in case xs of
[] -> name
(r:_) -> B.pack . ipAddressToString . ipAddress $ r | 209 | hfLookup :: B.ByteString -> [HostEntry] -> B.ByteString
hfLookup name rs =
let xs = filter ((name `elem`) . names) rs
in case xs of
[] -> name
(r:_) -> B.pack . ipAddressToString . ipAddress $ r | 209 | hfLookup name rs =
let xs = filter ((name `elem`) . names) rs
in case xs of
[] -> name
(r:_) -> B.pack . ipAddressToString . ipAddress $ r | 153 | false | true | 3 | 12 | 50 | 102 | 52 | 50 | null | null |
swift-nav/plover | src/Language/Plover/ModuleUtils.hs | mit | fromRight (Right x) = x | 23 | fromRight (Right x) = x | 23 | fromRight (Right x) = x | 23 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
siddhanathan/ghc | compiler/utils/Binary.hs | bsd-3-clause | lazyGet :: Binary a => BinHandle -> IO a
lazyGet bh = do
p <- get bh -- a BinPtr
p_a <- tellBin bh
a <- unsafeInterleaveIO $ do
-- NB: Use a fresh off_r variable in the child thread, for thread
-- safety.
off_r <- newFastMutInt
getAt bh { _off_r = off_r } p_a
seekBin bh p -- skip over the object for now
return a
-- -----------------------------------------------------------------------------
-- UserData
-- ----------------------------------------------------------------------------- | 540 | lazyGet :: Binary a => BinHandle -> IO a
lazyGet bh = do
p <- get bh -- a BinPtr
p_a <- tellBin bh
a <- unsafeInterleaveIO $ do
-- NB: Use a fresh off_r variable in the child thread, for thread
-- safety.
off_r <- newFastMutInt
getAt bh { _off_r = off_r } p_a
seekBin bh p -- skip over the object for now
return a
-- -----------------------------------------------------------------------------
-- UserData
-- ----------------------------------------------------------------------------- | 540 | lazyGet bh = do
p <- get bh -- a BinPtr
p_a <- tellBin bh
a <- unsafeInterleaveIO $ do
-- NB: Use a fresh off_r variable in the child thread, for thread
-- safety.
off_r <- newFastMutInt
getAt bh { _off_r = off_r } p_a
seekBin bh p -- skip over the object for now
return a
-- -----------------------------------------------------------------------------
-- UserData
-- ----------------------------------------------------------------------------- | 499 | false | true | 0 | 14 | 125 | 108 | 50 | 58 | null | null |
sopvop/cabal | Cabal/Distribution/Types/PackageDescription.hs | bsd-3-clause | -- | Perform an action on each buildable 'TestSuite' in a package.
-- You probably want 'withTestLBI' if you have a 'LocalBuildInfo', see the note in
-- "Distribution.Types.ComponentEnabledSpec#buildable_vs_enabled_components"
-- for more information.
withTest :: PackageDescription -> (TestSuite -> IO ()) -> IO ()
withTest pkg_descr f =
sequence_ [ f test | test <- testSuites pkg_descr, buildable (testBuildInfo test) ] | 427 | withTest :: PackageDescription -> (TestSuite -> IO ()) -> IO ()
withTest pkg_descr f =
sequence_ [ f test | test <- testSuites pkg_descr, buildable (testBuildInfo test) ] | 174 | withTest pkg_descr f =
sequence_ [ f test | test <- testSuites pkg_descr, buildable (testBuildInfo test) ] | 110 | true | true | 0 | 10 | 64 | 78 | 39 | 39 | null | null |
egison/egison | hs-src/Language/Egison/Desugar.hs | mit | desugar (SectionExpr op (Just expr1) Nothing) = do
y <- fresh
ILambdaExpr Nothing [stringToVar y] <$> desugar (InfixExpr op expr1 (VarExpr y)) | 146 | desugar (SectionExpr op (Just expr1) Nothing) = do
y <- fresh
ILambdaExpr Nothing [stringToVar y] <$> desugar (InfixExpr op expr1 (VarExpr y)) | 146 | desugar (SectionExpr op (Just expr1) Nothing) = do
y <- fresh
ILambdaExpr Nothing [stringToVar y] <$> desugar (InfixExpr op expr1 (VarExpr y)) | 146 | false | false | 0 | 12 | 25 | 69 | 32 | 37 | null | null |
alphalambda/codeworld | codeworld-base/src/Internal/Prelude.hs | apache-2.0 | idxErrorNonInt :: HasCallStack => Number -> a
idxErrorNonInt idx = P.error "Non-integer list index is not allowed." | 115 | idxErrorNonInt :: HasCallStack => Number -> a
idxErrorNonInt idx = P.error "Non-integer list index is not allowed." | 115 | idxErrorNonInt idx = P.error "Non-integer list index is not allowed." | 69 | false | true | 0 | 6 | 16 | 31 | 14 | 17 | null | null |
23Skidoo/text | Data/Text/Lazy.hs | bsd-2-clause | -- | /O(n)/ Splits a 'Text' into components delimited by separators,
-- where the predicate returns True for a separator element. The
-- resulting components do not contain the separators. Two adjacent
-- separators result in an empty component in the output. eg.
--
-- > split (=='a') "aabbaca" == ["","","bb","c",""]
-- > split (=='a') [] == [""]
split :: (Char -> Bool) -> Text -> [Text]
split _ Empty = [Empty] | 424 | split :: (Char -> Bool) -> Text -> [Text]
split _ Empty = [Empty] | 65 | split _ Empty = [Empty] | 23 | true | true | 0 | 7 | 81 | 44 | 27 | 17 | null | null |
SkyA1ex/tetris | src/Drawing.hs | bsd-3-clause | textColor = makeColorI 197 200 198 255 | 38 | textColor = makeColorI 197 200 198 255 | 38 | textColor = makeColorI 197 200 198 255 | 38 | false | false | 1 | 5 | 6 | 18 | 7 | 11 | null | null |
kosmoskatten/traffic-analysis | src/Network/Traffic/Object/Enumerator.hs | mit | enumerateBy TerminalType = enumerateByField terminalType | 56 | enumerateBy TerminalType = enumerateByField terminalType | 56 | enumerateBy TerminalType = enumerateByField terminalType | 56 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
keizo042/quic-prototype | Network/QUIC/Types.hs | bsd-3-clause | ver2int Q035 = 35 | 23 | ver2int Q035 = 35 | 23 | ver2int Q035 = 35 | 23 | false | false | 0 | 5 | 9 | 9 | 4 | 5 | null | null |
urbanslug/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | defaultFixity :: Fixity
defaultFixity = Fixity maxPrecedence InfixL | 67 | defaultFixity :: Fixity
defaultFixity = Fixity maxPrecedence InfixL | 67 | defaultFixity = Fixity maxPrecedence InfixL | 43 | false | true | 0 | 5 | 7 | 16 | 8 | 8 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/signum_1.hs | mit | esEsOrdering :: Ordering -> Ordering -> MyBool
esEsOrdering LT LT = MyTrue | 78 | esEsOrdering :: Ordering -> Ordering -> MyBool
esEsOrdering LT LT = MyTrue | 78 | esEsOrdering LT LT = MyTrue | 27 | false | true | 0 | 8 | 15 | 30 | 13 | 17 | null | null |
UCSD-PL/RefScript | src/Language/Rsc/SSA/SSA.hs | bsd-3-clause | unaryBinOp PrefixInc = OpAdd | 32 | unaryBinOp PrefixInc = OpAdd | 32 | unaryBinOp PrefixInc = OpAdd | 32 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
gilith/hol | src/HOL/TermData.hs | mit | destGivenConst :: Const -> TermData -> Maybe Type
destGivenConst c d =
case destConst d of
Just (c',ty) -> if c' == c then Just ty else Nothing
Nothing -> Nothing | 178 | destGivenConst :: Const -> TermData -> Maybe Type
destGivenConst c d =
case destConst d of
Just (c',ty) -> if c' == c then Just ty else Nothing
Nothing -> Nothing | 178 | destGivenConst c d =
case destConst d of
Just (c',ty) -> if c' == c then Just ty else Nothing
Nothing -> Nothing | 128 | false | true | 0 | 9 | 46 | 75 | 36 | 39 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_218 (176#) = happyShift action_57 | 40 | action_218 (176#) = happyShift action_57 | 40 | action_218 (176#) = happyShift action_57 | 40 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
jBugman/repetitions | Repetitions/Frontend.hs | mit | index' :: Html
index' = layout $
form ! A.action "/result" ! A.method "post" $ do
div ! class_ "form-group" $ do
label ! A.for "text" $ "Текст"
textarea ! name "text" ! class_ "form-control" ! A.rows "10" ! id "text" $ ""
button ! A.type_ "submit" ! class_ "btn btn-default" $ "Проверить" | 310 | index' :: Html
index' = layout $
form ! A.action "/result" ! A.method "post" $ do
div ! class_ "form-group" $ do
label ! A.for "text" $ "Текст"
textarea ! name "text" ! class_ "form-control" ! A.rows "10" ! id "text" $ ""
button ! A.type_ "submit" ! class_ "btn btn-default" $ "Проверить" | 310 | index' = layout $
form ! A.action "/result" ! A.method "post" $ do
div ! class_ "form-group" $ do
label ! A.for "text" $ "Текст"
textarea ! name "text" ! class_ "form-control" ! A.rows "10" ! id "text" $ ""
button ! A.type_ "submit" ! class_ "btn btn-default" $ "Проверить" | 295 | false | true | 0 | 16 | 74 | 127 | 57 | 70 | null | null |
alphaHeavy/shake-install | Development/Shake/Install/BuildDictionary.hs | bsd-3-clause | findSourceDirectory
:: FilePath
-> Action FilePath
findSourceDirectory filePath =
fmap takeDirectory $ findCabalFile filePath | 131 | findSourceDirectory
:: FilePath
-> Action FilePath
findSourceDirectory filePath =
fmap takeDirectory $ findCabalFile filePath | 131 | findSourceDirectory filePath =
fmap takeDirectory $ findCabalFile filePath | 76 | false | true | 0 | 7 | 19 | 35 | 15 | 20 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Unit.hs | mit | gasCost ResourceMineralPatch1 = 1 | 33 | gasCost ResourceMineralPatch1 = 1 | 33 | gasCost ResourceMineralPatch1 = 1 | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
triplepointfive/cereal | src/Data/Serialize/Get.hs | bsd-3-clause | -- | Isolate an action to operating within a fixed block of bytes. The action
-- is required to consume all the bytes that it is isolated to.
isolate :: Int -> Get a -> Get a
isolate n m = do
M.when (n < 0) (fail "Attempted to isolate a negative number of bytes")
s <- ensure n
let (s',rest) = B.splitAt n s
put s'
a <- m
used <- get
unless (B.null used) (fail "not all bytes parsed in isolate")
put rest
return a
-- | Immediately demand more input via a 'Partial' continuation
-- result. | 515 | isolate :: Int -> Get a -> Get a
isolate n m = do
M.when (n < 0) (fail "Attempted to isolate a negative number of bytes")
s <- ensure n
let (s',rest) = B.splitAt n s
put s'
a <- m
used <- get
unless (B.null used) (fail "not all bytes parsed in isolate")
put rest
return a
-- | Immediately demand more input via a 'Partial' continuation
-- result. | 370 | isolate n m = do
M.when (n < 0) (fail "Attempted to isolate a negative number of bytes")
s <- ensure n
let (s',rest) = B.splitAt n s
put s'
a <- m
used <- get
unless (B.null used) (fail "not all bytes parsed in isolate")
put rest
return a
-- | Immediately demand more input via a 'Partial' continuation
-- result. | 337 | true | true | 0 | 11 | 125 | 144 | 66 | 78 | null | null |
WraithM/CoreCompiler | src/Core/LambdaLift.hs | bsd-3-clause | freeVarsE lv (Lam args body) = (freeVarsOf body' \\ setArgs, ALam args body')
where
body' = freeVarsE lv' body
lv' = lv `S.union` setArgs
setArgs = S.fromList args | 177 | freeVarsE lv (Lam args body) = (freeVarsOf body' \\ setArgs, ALam args body')
where
body' = freeVarsE lv' body
lv' = lv `S.union` setArgs
setArgs = S.fromList args | 177 | freeVarsE lv (Lam args body) = (freeVarsOf body' \\ setArgs, ALam args body')
where
body' = freeVarsE lv' body
lv' = lv `S.union` setArgs
setArgs = S.fromList args | 177 | false | false | 2 | 7 | 41 | 75 | 37 | 38 | null | null |
rgoulter/expenses-csv-utils | src/Data/Expenses/Query.hs | mit | attr :: String -> Maybe QueryAttribute
attr "earliest" = Just Earliest | 70 | attr :: String -> Maybe QueryAttribute
attr "earliest" = Just Earliest | 70 | attr "earliest" = Just Earliest | 31 | false | true | 0 | 6 | 10 | 24 | 11 | 13 | null | null |
jamshidh/ethereum-data-sql | src/Blockchain/Data/BlockDB.hs | bsd-3-clause | putBlock::Block->DBM (Key BlockDataRef)
putBlock b = do
blkDataId <- putBlockSql b
let bytes = rlpSerialize $ rlpEncode b
blockDBPut (BL.toStrict $ encode $ blockHash b) bytes
return blkDataId | 200 | putBlock::Block->DBM (Key BlockDataRef)
putBlock b = do
blkDataId <- putBlockSql b
let bytes = rlpSerialize $ rlpEncode b
blockDBPut (BL.toStrict $ encode $ blockHash b) bytes
return blkDataId | 200 | putBlock b = do
blkDataId <- putBlockSql b
let bytes = rlpSerialize $ rlpEncode b
blockDBPut (BL.toStrict $ encode $ blockHash b) bytes
return blkDataId | 160 | false | true | 0 | 11 | 35 | 83 | 37 | 46 | null | null |
kellino/TypeSystems | fullSub/PrettyPrint.hs | mit | cleverDisp :: (Display d) => d -> Doc
cleverDisp d = runReaderDispInfo (display d) initDI | 89 | cleverDisp :: (Display d) => d -> Doc
cleverDisp d = runReaderDispInfo (display d) initDI | 89 | cleverDisp d = runReaderDispInfo (display d) initDI | 51 | false | true | 0 | 7 | 14 | 38 | 19 | 19 | null | null |
luisgepeto/HaskellLearning | 08 Own Types/01_algebraic.hs | mit | demo6 = surface' (Circle' (Point 0 0) 24) | 41 | demo6 = surface' (Circle' (Point 0 0) 24) | 41 | demo6 = surface' (Circle' (Point 0 0) 24) | 41 | false | false | 0 | 9 | 7 | 25 | 12 | 13 | null | null |
shlevy/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | isCFunEqCan :: Ct -> Bool
isCFunEqCan (CFunEqCan {}) = True | 59 | isCFunEqCan :: Ct -> Bool
isCFunEqCan (CFunEqCan {}) = True | 59 | isCFunEqCan (CFunEqCan {}) = True | 33 | false | true | 1 | 8 | 9 | 30 | 14 | 16 | null | null |
GaloisInc/halvm-ghc | libraries/template-haskell/Language/Haskell/TH/Ppr.hs | bsd-3-clause | isSymOcc :: Name -> Bool
isSymOcc n
= case nameBase n of
[] -> True -- Empty name; weird
(c:_) -> isSymbolASCII c || (ord c > 0x7f && isSymbol c)
-- c.f. OccName.startsVarSym in GHC itself | 225 | isSymOcc :: Name -> Bool
isSymOcc n
= case nameBase n of
[] -> True -- Empty name; weird
(c:_) -> isSymbolASCII c || (ord c > 0x7f && isSymbol c)
-- c.f. OccName.startsVarSym in GHC itself | 225 | isSymOcc n
= case nameBase n of
[] -> True -- Empty name; weird
(c:_) -> isSymbolASCII c || (ord c > 0x7f && isSymbol c)
-- c.f. OccName.startsVarSym in GHC itself | 200 | false | true | 0 | 13 | 73 | 78 | 37 | 41 | null | null |
wdanilo/haskell-language-c | src/Language/C/Syntax/Ops.hs | bsd-3-clause | assignBinop CAddAssOp = CAddOp | 30 | assignBinop CAddAssOp = CAddOp | 30 | assignBinop CAddAssOp = CAddOp | 30 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
centromere/cacophony | src/Crypto/Noise/Hash/BLAKE2b.hs | unlicense | toBytes :: Digest BLAKE2b
-> ScrubbedBytes
toBytes (HDB2b d) = convert d | 80 | toBytes :: Digest BLAKE2b
-> ScrubbedBytes
toBytes (HDB2b d) = convert d | 80 | toBytes (HDB2b d) = convert d | 29 | false | true | 0 | 7 | 19 | 30 | 14 | 16 | null | null |
hengchu/tiger-haskell | src/tigercodegen.hs | mit | recordmagicnumber :: Word32
recordmagicnumber = 0xDEAFCACA | 58 | recordmagicnumber :: Word32
recordmagicnumber = 0xDEAFCACA | 58 | recordmagicnumber = 0xDEAFCACA | 30 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
juanbono/tapl-haskell | untyped/src/Language/Untyped/Church.hs | gpl-3.0 | iszro :: NamelessTerm
iszro = NmAbs "m" (NmApp (NmApp (NmVar 0) (NmAbs "x" fls)) tru) | 85 | iszro :: NamelessTerm
iszro = NmAbs "m" (NmApp (NmApp (NmVar 0) (NmAbs "x" fls)) tru) | 85 | iszro = NmAbs "m" (NmApp (NmApp (NmVar 0) (NmAbs "x" fls)) tru) | 63 | false | true | 0 | 10 | 14 | 53 | 24 | 29 | null | null |
jfdm/hUML | src/ClassDiagram/Keywords.hs | bsd-3-clause | hUmlOperatorRealisation = "<--" | 34 | hUmlOperatorRealisation = "<--" | 34 | hUmlOperatorRealisation = "<--" | 34 | false | false | 0 | 4 | 5 | 6 | 3 | 3 | null | null |
jtojnar/haste-compiler | libraries/ghc-7.10/base/GHC/Conc/Sync.hs | bsd-3-clause | childHandler :: SomeException -> IO ()
childHandler err = catchException (real_handler err) childHandler | 104 | childHandler :: SomeException -> IO ()
childHandler err = catchException (real_handler err) childHandler | 104 | childHandler err = catchException (real_handler err) childHandler | 65 | false | true | 0 | 7 | 12 | 34 | 16 | 18 | null | null |
jberryman/wai | wai-extra/Network/Wai/Parse.hs | mit | parseContentType :: S.ByteString -> (S.ByteString, [(S.ByteString, S.ByteString)])
parseContentType a = do
let (ctype, b) = S.break (== semicolon) a
attrs = goAttrs id $ S.drop 1 b
in (ctype, attrs)
where
semicolon = 59
equals = 61
space = 32
goAttrs front bs
| S.null bs = front []
| otherwise =
let (x, rest) = S.break (== semicolon) bs
in goAttrs (front . (goAttr x:)) $ S.drop 1 rest
goAttr bs =
let (k, v') = S.break (== equals) bs
v = S.drop 1 v'
in (strip k, strip v)
strip = S.dropWhile (== space) . fst . S.breakEnd (/= space) | 648 | parseContentType :: S.ByteString -> (S.ByteString, [(S.ByteString, S.ByteString)])
parseContentType a = do
let (ctype, b) = S.break (== semicolon) a
attrs = goAttrs id $ S.drop 1 b
in (ctype, attrs)
where
semicolon = 59
equals = 61
space = 32
goAttrs front bs
| S.null bs = front []
| otherwise =
let (x, rest) = S.break (== semicolon) bs
in goAttrs (front . (goAttr x:)) $ S.drop 1 rest
goAttr bs =
let (k, v') = S.break (== equals) bs
v = S.drop 1 v'
in (strip k, strip v)
strip = S.dropWhile (== space) . fst . S.breakEnd (/= space) | 648 | parseContentType a = do
let (ctype, b) = S.break (== semicolon) a
attrs = goAttrs id $ S.drop 1 b
in (ctype, attrs)
where
semicolon = 59
equals = 61
space = 32
goAttrs front bs
| S.null bs = front []
| otherwise =
let (x, rest) = S.break (== semicolon) bs
in goAttrs (front . (goAttr x:)) $ S.drop 1 rest
goAttr bs =
let (k, v') = S.break (== equals) bs
v = S.drop 1 v'
in (strip k, strip v)
strip = S.dropWhile (== space) . fst . S.breakEnd (/= space) | 565 | false | true | 5 | 13 | 214 | 326 | 157 | 169 | null | null |
ku-fpg/ldpc-blob | src/Haskell/Decode.hs | bsd-2-clause | updateArray :: (MArray a e m,Ix i) => a i e -> i -> (e -> m e) -> m ()
updateArray a i f = readArray a i >>= f >>= writeArray a i | 129 | updateArray :: (MArray a e m,Ix i) => a i e -> i -> (e -> m e) -> m ()
updateArray a i f = readArray a i >>= f >>= writeArray a i | 129 | updateArray a i f = readArray a i >>= f >>= writeArray a i | 58 | false | true | 4 | 12 | 34 | 96 | 45 | 51 | null | null |
rsachtl/lc_haskell | src/LC_DB.hs | mit | box (L e) d = SL $ box e (d+1) | 30 | box (L e) d = SL $ box e (d+1) | 30 | box (L e) d = SL $ box e (d+1) | 30 | false | false | 0 | 8 | 9 | 33 | 16 | 17 | null | null |
ony/hledger | hledger-lib/Hledger/Data/Journal.hs | gpl-3.0 | addAmountAndCheckBalance fallback p = fallback p | 48 | addAmountAndCheckBalance fallback p = fallback p | 48 | addAmountAndCheckBalance fallback p = fallback p | 48 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
tinkerthaler/basic-invoice-rest | example-api/Api/Invoice.hs | bsd-3-clause | toInvoice :: Int -> Customer -> CreateInvoice -> IO Invoice
toInvoice i u p = do
t <- getCurrentTime
return Invoice
{ Invoice.id = i
, Invoice.author = Customer.name u
, Invoice.createdTime = t
, Invoice.title = CreateInvoice.title p
, Invoice.content = CreateInvoice.content p
}
-- | A Invoice's title must be unique and non-empty. | 385 | toInvoice :: Int -> Customer -> CreateInvoice -> IO Invoice
toInvoice i u p = do
t <- getCurrentTime
return Invoice
{ Invoice.id = i
, Invoice.author = Customer.name u
, Invoice.createdTime = t
, Invoice.title = CreateInvoice.title p
, Invoice.content = CreateInvoice.content p
}
-- | A Invoice's title must be unique and non-empty. | 385 | toInvoice i u p = do
t <- getCurrentTime
return Invoice
{ Invoice.id = i
, Invoice.author = Customer.name u
, Invoice.createdTime = t
, Invoice.title = CreateInvoice.title p
, Invoice.content = CreateInvoice.content p
}
-- | A Invoice's title must be unique and non-empty. | 325 | false | true | 0 | 11 | 107 | 104 | 54 | 50 | null | null |
ml9951/ghc | compiler/nativeGen/AsmCodeGen.hs | bsd-3-clause | -- the first block is the entry point ==> it must remain at the start.
sccBlocks
:: Instruction instr
=> [NatBasicBlock instr]
-> [SCC ( NatBasicBlock instr
, BlockId
, [BlockId])]
sccBlocks blocks = stronglyConnCompFromEdgedVerticesR (map mkNode blocks) | 313 | sccBlocks
:: Instruction instr
=> [NatBasicBlock instr]
-> [SCC ( NatBasicBlock instr
, BlockId
, [BlockId])]
sccBlocks blocks = stronglyConnCompFromEdgedVerticesR (map mkNode blocks) | 239 | sccBlocks blocks = stronglyConnCompFromEdgedVerticesR (map mkNode blocks) | 73 | true | true | 0 | 10 | 96 | 64 | 33 | 31 | null | null |
mariefarrell/Hets | mini/Parser.hs | gpl-2.0 | hetParse :: LogicGraph -> String -> SPEC
hetParse (logics@((_, defaultLogic) : _), translations) input =
case runParser spec defaultLogic "" input of
Left err -> error ("parse error at " ++ show err)
Right x -> x
where
spec :: CharParser AnyLogic SPEC
spec = buildExpressionParser table basic
<?> "SPEC"
basic = do { G_logic id <- getState;
b <- parse_basic_spec id;
return (Basic_spec (G_basic_spec id b))}
table = [[Prefix (do {string "logic"; spaces;
name <- many1 alphaNum;
setState
(fromMaybe (error ("logic " ++ name ++ " unknown"))
(lookup name logics));
spaces; return id } )],
[Postfix (do
string "with"; spaces;
do string "logic"; spaces
name <- many1 alphaNum
G_logic (id :: src) <- getState
case lookup name translations of
Nothing -> error ("translation " ++ name ++ " unknown")
Just (G_LTR tr) ->
case coerce (source tr) :: Maybe src of
Nothing -> error "translation type mismatch"
Just _ -> do
setState (G_logic (target tr))
return (\ sp -> Inter_Translation sp (G_LTR tr))
<|> do G_logic id <- getState
sy <- parse_symbol_mapping id
spaces
return (\ sp -> Intra_Translation sp (G_symbol_mapping_list id sy))
)],
[Infix (do {string "then"; spaces; return Extension}) AssocLeft]
] | 1,754 | hetParse :: LogicGraph -> String -> SPEC
hetParse (logics@((_, defaultLogic) : _), translations) input =
case runParser spec defaultLogic "" input of
Left err -> error ("parse error at " ++ show err)
Right x -> x
where
spec :: CharParser AnyLogic SPEC
spec = buildExpressionParser table basic
<?> "SPEC"
basic = do { G_logic id <- getState;
b <- parse_basic_spec id;
return (Basic_spec (G_basic_spec id b))}
table = [[Prefix (do {string "logic"; spaces;
name <- many1 alphaNum;
setState
(fromMaybe (error ("logic " ++ name ++ " unknown"))
(lookup name logics));
spaces; return id } )],
[Postfix (do
string "with"; spaces;
do string "logic"; spaces
name <- many1 alphaNum
G_logic (id :: src) <- getState
case lookup name translations of
Nothing -> error ("translation " ++ name ++ " unknown")
Just (G_LTR tr) ->
case coerce (source tr) :: Maybe src of
Nothing -> error "translation type mismatch"
Just _ -> do
setState (G_logic (target tr))
return (\ sp -> Inter_Translation sp (G_LTR tr))
<|> do G_logic id <- getState
sy <- parse_symbol_mapping id
spaces
return (\ sp -> Intra_Translation sp (G_symbol_mapping_list id sy))
)],
[Infix (do {string "then"; spaces; return Extension}) AssocLeft]
] | 1,754 | hetParse (logics@((_, defaultLogic) : _), translations) input =
case runParser spec defaultLogic "" input of
Left err -> error ("parse error at " ++ show err)
Right x -> x
where
spec :: CharParser AnyLogic SPEC
spec = buildExpressionParser table basic
<?> "SPEC"
basic = do { G_logic id <- getState;
b <- parse_basic_spec id;
return (Basic_spec (G_basic_spec id b))}
table = [[Prefix (do {string "logic"; spaces;
name <- many1 alphaNum;
setState
(fromMaybe (error ("logic " ++ name ++ " unknown"))
(lookup name logics));
spaces; return id } )],
[Postfix (do
string "with"; spaces;
do string "logic"; spaces
name <- many1 alphaNum
G_logic (id :: src) <- getState
case lookup name translations of
Nothing -> error ("translation " ++ name ++ " unknown")
Just (G_LTR tr) ->
case coerce (source tr) :: Maybe src of
Nothing -> error "translation type mismatch"
Just _ -> do
setState (G_logic (target tr))
return (\ sp -> Inter_Translation sp (G_LTR tr))
<|> do G_logic id <- getState
sy <- parse_symbol_mapping id
spaces
return (\ sp -> Intra_Translation sp (G_symbol_mapping_list id sy))
)],
[Infix (do {string "then"; spaces; return Extension}) AssocLeft]
] | 1,713 | false | true | 0 | 27 | 753 | 534 | 258 | 276 | null | null |
michaelt/streaming-bytestring | Data/ByteString/Streaming.hs | bsd-3-clause | {-| /O(n\/c)/ 'drop' @n xs@ returns the suffix of @xs@ after the first @n@
elements, or @[]@ if @n > 'length' xs@.
>>> Q.putStrLn $ Q.drop 6 "Wisconsin"
sin
>>> Q.putStrLn $ Q.drop 16 "Wisconsin"
>>>
-}
drop :: Monad m => Int64 -> ByteString m r -> ByteString m r
drop i p | i <= 0 = p | 292 | drop :: Monad m => Int64 -> ByteString m r -> ByteString m r
drop i p | i <= 0 = p | 83 | drop i p | i <= 0 = p | 21 | true | true | 0 | 9 | 66 | 57 | 25 | 32 | null | null |
fmapfmapfmap/amazonka | amazonka-swf/gen/Network/AWS/SWF/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'ChildWorkflowExecutionTimedOutEventAttributes' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cwetoeaWorkflowExecution'
--
-- * 'cwetoeaWorkflowType'
--
-- * 'cwetoeaTimeoutType'
--
-- * 'cwetoeaInitiatedEventId'
--
-- * 'cwetoeaStartedEventId'
childWorkflowExecutionTimedOutEventAttributes
:: WorkflowExecution -- ^ 'cwetoeaWorkflowExecution'
-> WorkflowType -- ^ 'cwetoeaWorkflowType'
-> WorkflowExecutionTimeoutType -- ^ 'cwetoeaTimeoutType'
-> Integer -- ^ 'cwetoeaInitiatedEventId'
-> Integer -- ^ 'cwetoeaStartedEventId'
-> ChildWorkflowExecutionTimedOutEventAttributes
childWorkflowExecutionTimedOutEventAttributes pWorkflowExecution_ pWorkflowType_ pTimeoutType_ pInitiatedEventId_ pStartedEventId_ =
ChildWorkflowExecutionTimedOutEventAttributes'
{ _cwetoeaWorkflowExecution = pWorkflowExecution_
, _cwetoeaWorkflowType = pWorkflowType_
, _cwetoeaTimeoutType = pTimeoutType_
, _cwetoeaInitiatedEventId = pInitiatedEventId_
, _cwetoeaStartedEventId = pStartedEventId_
} | 1,141 | childWorkflowExecutionTimedOutEventAttributes
:: WorkflowExecution -- ^ 'cwetoeaWorkflowExecution'
-> WorkflowType -- ^ 'cwetoeaWorkflowType'
-> WorkflowExecutionTimeoutType -- ^ 'cwetoeaTimeoutType'
-> Integer -- ^ 'cwetoeaInitiatedEventId'
-> Integer -- ^ 'cwetoeaStartedEventId'
-> ChildWorkflowExecutionTimedOutEventAttributes
childWorkflowExecutionTimedOutEventAttributes pWorkflowExecution_ pWorkflowType_ pTimeoutType_ pInitiatedEventId_ pStartedEventId_ =
ChildWorkflowExecutionTimedOutEventAttributes'
{ _cwetoeaWorkflowExecution = pWorkflowExecution_
, _cwetoeaWorkflowType = pWorkflowType_
, _cwetoeaTimeoutType = pTimeoutType_
, _cwetoeaInitiatedEventId = pInitiatedEventId_
, _cwetoeaStartedEventId = pStartedEventId_
} | 784 | childWorkflowExecutionTimedOutEventAttributes pWorkflowExecution_ pWorkflowType_ pTimeoutType_ pInitiatedEventId_ pStartedEventId_ =
ChildWorkflowExecutionTimedOutEventAttributes'
{ _cwetoeaWorkflowExecution = pWorkflowExecution_
, _cwetoeaWorkflowType = pWorkflowType_
, _cwetoeaTimeoutType = pTimeoutType_
, _cwetoeaInitiatedEventId = pInitiatedEventId_
, _cwetoeaStartedEventId = pStartedEventId_
} | 429 | true | true | 0 | 9 | 158 | 92 | 60 | 32 | null | null |
kajigor/uKanren_transformations | test/resources/Program/Bottles.hs | bsd-3-clause | true = C "true" [] | 18 | true = C "true" [] | 18 | true = C "true" [] | 18 | false | false | 0 | 6 | 4 | 13 | 6 | 7 | null | null |
lukemaurer/sequent-core | src/Language/SequentCore/LiftLambdas.hs | bsd-3-clause | doLiftsJ :: Join DecVar -> LiftM SeqCoreJoin
doLiftsJ (Join bndrs body) = underLamBndrs bndrs $ \bndrs' ->
Join bndrs' <$> doLiftsC body | 167 | doLiftsJ :: Join DecVar -> LiftM SeqCoreJoin
doLiftsJ (Join bndrs body) = underLamBndrs bndrs $ \bndrs' ->
Join bndrs' <$> doLiftsC body | 167 | doLiftsJ (Join bndrs body) = underLamBndrs bndrs $ \bndrs' ->
Join bndrs' <$> doLiftsC body | 122 | false | true | 0 | 8 | 52 | 54 | 25 | 29 | null | null |
sordina/wai | wai-extra/test/Network/Wai/Middleware/ForceSSLSpec.hs | bsd-2-clause | runApp :: ByteString -> Middleware -> Request -> IO SResponse
runApp host mw req = runSession
(request req { requestHeaderHost = Just host }) $ mw app
where
app _ respond = respond $ responseLBS status200 [] "" | 220 | runApp :: ByteString -> Middleware -> Request -> IO SResponse
runApp host mw req = runSession
(request req { requestHeaderHost = Just host }) $ mw app
where
app _ respond = respond $ responseLBS status200 [] "" | 220 | runApp host mw req = runSession
(request req { requestHeaderHost = Just host }) $ mw app
where
app _ respond = respond $ responseLBS status200 [] "" | 158 | false | true | 0 | 10 | 47 | 86 | 41 | 45 | null | null |
ladinu/cs457 | src/Test.hs | mit | -- addup xs returns the sum of the numbers in
-- the list xs. For example:
-- addup [1,2,3] = 6
addup :: [Int] -> Int
addup [] = 0 | 154 | addup :: [Int] -> Int
addup [] = 0 | 54 | addup [] = 0 | 21 | true | true | 0 | 8 | 53 | 32 | 16 | 16 | null | null |
koba-e964/tigress | src/Typing.hs | bsd-3-clause | intType :: Type
stringType = TId (TypeId "string") | 51 | intType :: Type
stringType = TId (TypeId "string") | 50 | stringType = TId (TypeId "string") | 34 | false | true | 0 | 7 | 8 | 20 | 10 | 10 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/SLASH_1.hs | mit | primMulNat :: Nat -> Nat -> Nat;
primMulNat Zero Zero = Zero | 64 | primMulNat :: Nat -> Nat -> Nat
primMulNat Zero Zero = Zero | 63 | primMulNat Zero Zero = Zero | 27 | false | true | 1 | 8 | 15 | 32 | 14 | 18 | null | null |
markwithers/mancala | src/House.hs | bsd-3-clause | sowRight :: Int -> [Stone] -> Board -> Board
sowRight position board = sow (position + 1) (board !! position) | 109 | sowRight :: Int -> [Stone] -> Board -> Board
sowRight position board = sow (position + 1) (board !! position) | 109 | sowRight position board = sow (position + 1) (board !! position) | 64 | false | true | 0 | 7 | 19 | 50 | 26 | 24 | null | null |
patrickboe/artery | Test/Box.Test.hs | mit | prop_EqualBoxesContainEachOther b = b `contains` b
where types = [b :: Box] | 77 | prop_EqualBoxesContainEachOther b = b `contains` b
where types = [b :: Box] | 77 | prop_EqualBoxesContainEachOther b = b `contains` b
where types = [b :: Box] | 77 | false | false | 1 | 5 | 13 | 32 | 16 | 16 | null | null |
Noeda/caramia | src/Graphics/Caramia/Internal/OpenGLCApi.hs | mit | mglFlushMappedNamedBufferRange :: GLuint -> GLintptr -> GLsizeiptr -> IO ()
mglFlushMappedNamedBufferRange buffer offset length =
if gl_ARB_direct_state_access && we_have_map_buffer_range
then dsaWay
else when we_have_map_buffer_range $ nonDsaWay
where
dsaWay = glFlushMappedNamedBufferRange buffer offset length
nonDsaWay = withBoundBuffer buffer $
glFlushMappedBufferRange GL_ARRAY_BUFFER offset (fromIntegral length)
we_have_map_buffer_range = openGLVersion >= OpenGLVersion 3 0 ||
gl_ARB_map_buffer_range | 579 | mglFlushMappedNamedBufferRange :: GLuint -> GLintptr -> GLsizeiptr -> IO ()
mglFlushMappedNamedBufferRange buffer offset length =
if gl_ARB_direct_state_access && we_have_map_buffer_range
then dsaWay
else when we_have_map_buffer_range $ nonDsaWay
where
dsaWay = glFlushMappedNamedBufferRange buffer offset length
nonDsaWay = withBoundBuffer buffer $
glFlushMappedBufferRange GL_ARRAY_BUFFER offset (fromIntegral length)
we_have_map_buffer_range = openGLVersion >= OpenGLVersion 3 0 ||
gl_ARB_map_buffer_range | 579 | mglFlushMappedNamedBufferRange buffer offset length =
if gl_ARB_direct_state_access && we_have_map_buffer_range
then dsaWay
else when we_have_map_buffer_range $ nonDsaWay
where
dsaWay = glFlushMappedNamedBufferRange buffer offset length
nonDsaWay = withBoundBuffer buffer $
glFlushMappedBufferRange GL_ARRAY_BUFFER offset (fromIntegral length)
we_have_map_buffer_range = openGLVersion >= OpenGLVersion 3 0 ||
gl_ARB_map_buffer_range | 503 | false | true | 0 | 9 | 122 | 112 | 55 | 57 | null | null |
wochinge/CacheSimulator | test/Clock/CartSpec.hs | bsd-3-clause | requestsWithRemove = [ (Write, "1", 500)
, (Read, "1", 500)
, (Read, "2", 500)
, (Remove, "1", 500)
, (Read, "1", 500)
] | 225 | requestsWithRemove = [ (Write, "1", 500)
, (Read, "1", 500)
, (Read, "2", 500)
, (Remove, "1", 500)
, (Read, "1", 500)
] | 225 | requestsWithRemove = [ (Write, "1", 500)
, (Read, "1", 500)
, (Read, "2", 500)
, (Remove, "1", 500)
, (Read, "1", 500)
] | 225 | false | false | 0 | 6 | 127 | 66 | 43 | 23 | null | null |
ben-schulz/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | annotationColour ist AnnKeyword = Just $ keywordColour (idris_colourTheme ist) | 90 | annotationColour ist AnnKeyword = Just $ keywordColour (idris_colourTheme ist) | 90 | annotationColour ist AnnKeyword = Just $ keywordColour (idris_colourTheme ist) | 90 | false | false | 0 | 8 | 20 | 25 | 11 | 14 | null | null |
lueck/standoff-tools | src/StandOff/AnnotationTypeDefs.hs | gpl-3.0 | rangeType :: Annotation -> String
rangeType (MarkupRange _ _ typ _ _ _ _) = typ | 79 | rangeType :: Annotation -> String
rangeType (MarkupRange _ _ typ _ _ _ _) = typ | 79 | rangeType (MarkupRange _ _ typ _ _ _ _) = typ | 45 | false | true | 0 | 6 | 15 | 40 | 19 | 21 | null | null |
ant1441/haskell-statsd | src/Statsd/Parser.hs | bsd-3-clause | isNewline :: Char -> Bool
isNewline w = w == '\r' || w == '\n' | 62 | isNewline :: Char -> Bool
isNewline w = w == '\r' || w == '\n' | 62 | isNewline w = w == '\r' || w == '\n' | 36 | false | true | 2 | 7 | 14 | 42 | 18 | 24 | null | null |
petabricks/petabricks | scripts/oldtuner2/src/GP/MathGP.hs | mit | applyBinFunc :: [MathValue] -> MathValue
applyBinFunc values = let (BinaryFunc f) = values !! 1
arg1 = values !! 0
arg2 = values !! 2
in
f arg1 arg2 | 246 | applyBinFunc :: [MathValue] -> MathValue
applyBinFunc values = let (BinaryFunc f) = values !! 1
arg1 = values !! 0
arg2 = values !! 2
in
f arg1 arg2 | 246 | applyBinFunc values = let (BinaryFunc f) = values !! 1
arg1 = values !! 0
arg2 = values !! 2
in
f arg1 arg2 | 205 | false | true | 0 | 10 | 126 | 69 | 34 | 35 | null | null |
bravit/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | ptacimp n s t = PTacImplicit 2 [] n s t | 39 | ptacimp n s t = PTacImplicit 2 [] n s t | 39 | ptacimp n s t = PTacImplicit 2 [] n s t | 39 | false | false | 1 | 6 | 10 | 31 | 12 | 19 | null | null |
nevrenato/Hets_Fork | Common/Lib/MapSet.hs | gpl-2.0 | -- | the image of a map
imageList :: Ord k => Map.Map k a -> Set.Set k -> [a]
imageList m = Map.elems . restrict m | 114 | imageList :: Ord k => Map.Map k a -> Set.Set k -> [a]
imageList m = Map.elems . restrict m | 90 | imageList m = Map.elems . restrict m | 36 | true | true | 1 | 10 | 26 | 61 | 27 | 34 | null | null |
spechub/Hets | CspCASL/Parse_CspCASL_Process.hs | gpl-2.0 | formula :: AParser st (FORMULA ())
formula = CASL.formula cspKeywords | 69 | formula :: AParser st (FORMULA ())
formula = CASL.formula cspKeywords | 69 | formula = CASL.formula cspKeywords | 34 | false | true | 0 | 8 | 9 | 29 | 14 | 15 | null | null |
k0001/network-simple | src/Network/Simple/TCP.hs | bsd-3-clause | -- | Accept a single incoming connection and use it in a different thread.
--
-- The connection socket is shut down and closed when done or in case of
-- exceptions.
acceptFork
:: MonadIO m
=> NS.Socket -- ^ Listening and bound socket.
-> ((NS.Socket, NS.SockAddr) -> IO ())
-- ^ Computation to run in a different thread once an incoming connection is
-- accepted. Takes the connection socket and remote end address.
-> m ThreadId
acceptFork lsock k = liftIO $ Ex.mask $ \restore -> do
(csock, addr) <- restore (NS.accept lsock)
Ex.onException
(forkIO (Ex.finally (restore (k (csock, ipv4mapped_to_ipv4 addr)))
(closeSock csock)))
(closeSock csock)
| 700 | acceptFork
:: MonadIO m
=> NS.Socket -- ^ Listening and bound socket.
-> ((NS.Socket, NS.SockAddr) -> IO ())
-- ^ Computation to run in a different thread once an incoming connection is
-- accepted. Takes the connection socket and remote end address.
-> m ThreadId
acceptFork lsock k = liftIO $ Ex.mask $ \restore -> do
(csock, addr) <- restore (NS.accept lsock)
Ex.onException
(forkIO (Ex.finally (restore (k (csock, ipv4mapped_to_ipv4 addr)))
(closeSock csock)))
(closeSock csock)
| 534 | acceptFork lsock k = liftIO $ Ex.mask $ \restore -> do
(csock, addr) <- restore (NS.accept lsock)
Ex.onException
(forkIO (Ex.finally (restore (k (csock, ipv4mapped_to_ipv4 addr)))
(closeSock csock)))
(closeSock csock)
| 257 | true | true | 0 | 19 | 157 | 167 | 86 | 81 | null | null |
neongreen/megaparsec | Text/Megaparsec/Combinator.hs | bsd-2-clause | -- | @sepBy p sep@ parses /zero/ or more occurrences of @p@, separated
-- by @sep@. Returns a list of values returned by @p@.
--
-- > commaSep p = p `sepBy` comma
sepBy :: Alternative m => m a -> m sep -> m [a]
sepBy p sep = sepBy1 p sep <|> pure [] | 250 | sepBy :: Alternative m => m a -> m sep -> m [a]
sepBy p sep = sepBy1 p sep <|> pure [] | 86 | sepBy p sep = sepBy1 p sep <|> pure [] | 38 | true | true | 0 | 9 | 56 | 61 | 30 | 31 | null | null |
ricardopenyamari/ir2haskell | clir-parser-haskell-master/lib/sexp-grammar/src/Data/InvertibleGrammar/Monad.hs | gpl-2.0 | renderMismatch :: String -> Mismatch -> String
renderMismatch pos mismatch =
show $ vsep
[ pretty pos `mappend` ":" <+> "mismatch:"
, indent 2 $ pretty mismatch
] | 176 | renderMismatch :: String -> Mismatch -> String
renderMismatch pos mismatch =
show $ vsep
[ pretty pos `mappend` ":" <+> "mismatch:"
, indent 2 $ pretty mismatch
] | 176 | renderMismatch pos mismatch =
show $ vsep
[ pretty pos `mappend` ":" <+> "mismatch:"
, indent 2 $ pretty mismatch
] | 129 | false | true | 0 | 8 | 41 | 60 | 30 | 30 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/HTMLTableElement.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement.createTFoot Mozilla HTMLTableElement.createTFoot documentation>
createTFoot :: (MonadDOM m) => HTMLTableElement -> m HTMLElement
createTFoot self
= liftDOM ((self ^. jsf "createTFoot" ()) >>= fromJSValUnchecked) | 286 | createTFoot :: (MonadDOM m) => HTMLTableElement -> m HTMLElement
createTFoot self
= liftDOM ((self ^. jsf "createTFoot" ()) >>= fromJSValUnchecked) | 149 | createTFoot self
= liftDOM ((self ^. jsf "createTFoot" ()) >>= fromJSValUnchecked) | 84 | true | true | 0 | 11 | 28 | 55 | 28 | 27 | null | null |
atsukotakahashi/wi | src/library/Yi/Buffer/HighLevel.hs | gpl-2.0 | -- | Delete forward whitespace or non-whitespace depending on
-- the character under point.
killWordB :: BufferM ()
killWordB = deleteB unitWord Forward | 152 | killWordB :: BufferM ()
killWordB = deleteB unitWord Forward | 60 | killWordB = deleteB unitWord Forward | 36 | true | true | 0 | 6 | 22 | 23 | 12 | 11 | null | null |
abailly/hs-word2vec | src/Crawl.hs | bsd-3-clause | -- |Follow all `Prev` links till beginning of search and collect paper links.
previousPages :: ([ String ], (Maybe String,Maybe String)) -> IO [ String ]
previousPages (uris, (Nothing, _)) = return uris | 202 | previousPages :: ([ String ], (Maybe String,Maybe String)) -> IO [ String ]
previousPages (uris, (Nothing, _)) = return uris | 124 | previousPages (uris, (Nothing, _)) = return uris | 48 | true | true | 2 | 7 | 32 | 63 | 34 | 29 | null | null |
codemac/yi-editor | src/Yi/Snippets.hs | gpl-2.0 | isDependentMark (DependentMarkInfo _ _ _) = True | 48 | isDependentMark (DependentMarkInfo _ _ _) = True | 48 | isDependentMark (DependentMarkInfo _ _ _) = True | 48 | false | false | 0 | 7 | 6 | 19 | 9 | 10 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Concrete/FingerTree.hs | mit | -- | /O(1)/. A singleton sequence.
singleton :: Measured v a => a -> FingerTree v a
singleton = Single | 102 | singleton :: Measured v a => a -> FingerTree v a
singleton = Single | 67 | singleton = Single | 18 | true | true | 0 | 8 | 19 | 36 | 16 | 20 | null | null |
mkrauskopf/doh | test/DOH/Knapsack/BaBSolverSpec.hs | bsd-3-clause | spec :: Spec
spec = do
describe "BaB, simple problems, using" $ do
it "zero items" $
(0, []) @=? debugSolve 10 []
it "one item unused" $ do
let items = [ (1, 20) ]
(1, [False]) @=? debugSolve 10 items
it "one item used" $ do
let items = [ (1, 2) ]
(2, [True]) @=? debugSolve 10 items
it "two items" $ do
let items = [(1, 2), (3, 1)]
(5, [False, True]) @=? debugSolve 2 items
it "three items 1" $ do
let items = [ (5, 4), (6, 5), (3, 2) ]
(7, [True, True, False]) @=? debugSolve 9 items
it "three items 2" $ do
let items = [ (45, 5), (48, 8), (35, 3) ]
(7, [True, False, True]) @=? debugSolve 10 items
describe "BaB, harder problems, using" $ do
-- TODO: far from optimal
it "19 items" $ assertValue "test/data/ks_19_0" 11555 -- optimal: 12248
it "30 items" $ assertValue "test/data/ks_30_0" 90000 -- optimal: 99798 | 926 | spec :: Spec
spec = do
describe "BaB, simple problems, using" $ do
it "zero items" $
(0, []) @=? debugSolve 10 []
it "one item unused" $ do
let items = [ (1, 20) ]
(1, [False]) @=? debugSolve 10 items
it "one item used" $ do
let items = [ (1, 2) ]
(2, [True]) @=? debugSolve 10 items
it "two items" $ do
let items = [(1, 2), (3, 1)]
(5, [False, True]) @=? debugSolve 2 items
it "three items 1" $ do
let items = [ (5, 4), (6, 5), (3, 2) ]
(7, [True, True, False]) @=? debugSolve 9 items
it "three items 2" $ do
let items = [ (45, 5), (48, 8), (35, 3) ]
(7, [True, False, True]) @=? debugSolve 10 items
describe "BaB, harder problems, using" $ do
-- TODO: far from optimal
it "19 items" $ assertValue "test/data/ks_19_0" 11555 -- optimal: 12248
it "30 items" $ assertValue "test/data/ks_30_0" 90000 -- optimal: 99798 | 926 | spec = do
describe "BaB, simple problems, using" $ do
it "zero items" $
(0, []) @=? debugSolve 10 []
it "one item unused" $ do
let items = [ (1, 20) ]
(1, [False]) @=? debugSolve 10 items
it "one item used" $ do
let items = [ (1, 2) ]
(2, [True]) @=? debugSolve 10 items
it "two items" $ do
let items = [(1, 2), (3, 1)]
(5, [False, True]) @=? debugSolve 2 items
it "three items 1" $ do
let items = [ (5, 4), (6, 5), (3, 2) ]
(7, [True, True, False]) @=? debugSolve 9 items
it "three items 2" $ do
let items = [ (45, 5), (48, 8), (35, 3) ]
(7, [True, False, True]) @=? debugSolve 10 items
describe "BaB, harder problems, using" $ do
-- TODO: far from optimal
it "19 items" $ assertValue "test/data/ks_19_0" 11555 -- optimal: 12248
it "30 items" $ assertValue "test/data/ks_30_0" 90000 -- optimal: 99798 | 913 | false | true | 0 | 17 | 273 | 398 | 208 | 190 | null | null |
Axure/elm-compiler | src/Generate/JavaScript.hs | bsd-3-clause | generateFunction :: [String] -> Opt.Expr -> State Int Code
generateFunction args body =
do code <- generateCode body
jsExpr (generateFunctionWithArity args code) | 170 | generateFunction :: [String] -> Opt.Expr -> State Int Code
generateFunction args body =
do code <- generateCode body
jsExpr (generateFunctionWithArity args code) | 170 | generateFunction args body =
do code <- generateCode body
jsExpr (generateFunctionWithArity args code) | 111 | false | true | 0 | 9 | 30 | 58 | 27 | 31 | null | null |
kisp/ksquant2 | Main.hs | gpl-3.0 | mkTrans :: O.Options -> SF2.Score -> T.Err (SF2.Score -> A.Score (T.Err M.Ms))
mkTrans opts sf2 = do
let O.Options { O.optMaxDiv = maxdiv
, O.optForbiddenDivs = forbid
, O.optTimeSignatures = ts
, O.optMetronomes = ms }
= opts
let sf2end = SF2.scoreEnd sf2
let tsmetro = (ts, ms)
measures <- measuresUntilTime sf2end (measureStream' tsmetro)
let divs = zipWith (\m f -> [1..m] \\ f)
(U.stickToLast maxdiv)
(U.stickToLast forbid)
let beatDivs = U.repeatList divs (map M.measureNumLeaf measures)
let trans = quantifyVoiceOrErr measures beatDivs
return $ fmap trans | 654 | mkTrans :: O.Options -> SF2.Score -> T.Err (SF2.Score -> A.Score (T.Err M.Ms))
mkTrans opts sf2 = do
let O.Options { O.optMaxDiv = maxdiv
, O.optForbiddenDivs = forbid
, O.optTimeSignatures = ts
, O.optMetronomes = ms }
= opts
let sf2end = SF2.scoreEnd sf2
let tsmetro = (ts, ms)
measures <- measuresUntilTime sf2end (measureStream' tsmetro)
let divs = zipWith (\m f -> [1..m] \\ f)
(U.stickToLast maxdiv)
(U.stickToLast forbid)
let beatDivs = U.repeatList divs (map M.measureNumLeaf measures)
let trans = quantifyVoiceOrErr measures beatDivs
return $ fmap trans | 654 | mkTrans opts sf2 = do
let O.Options { O.optMaxDiv = maxdiv
, O.optForbiddenDivs = forbid
, O.optTimeSignatures = ts
, O.optMetronomes = ms }
= opts
let sf2end = SF2.scoreEnd sf2
let tsmetro = (ts, ms)
measures <- measuresUntilTime sf2end (measureStream' tsmetro)
let divs = zipWith (\m f -> [1..m] \\ f)
(U.stickToLast maxdiv)
(U.stickToLast forbid)
let beatDivs = U.repeatList divs (map M.measureNumLeaf measures)
let trans = quantifyVoiceOrErr measures beatDivs
return $ fmap trans | 575 | false | true | 3 | 13 | 177 | 241 | 123 | 118 | null | null |
adamschoenemann/simple-frp | src/FRP/TypeInference.hs | mit | stableCtx :: Context t -> Context t
stableCtx (Ctx c1) =
Ctx $ M.map (maybe (error "laterCtx") (id)) $ M.filter isJust $ M.map mapper c1 where
mapper (t,q) = case q of
QNow -> Nothing
QStable -> Just (t, QStable)
QLater -> Nothing
-- |Runs an inference action in a context with a schema bound to the given name | 339 | stableCtx :: Context t -> Context t
stableCtx (Ctx c1) =
Ctx $ M.map (maybe (error "laterCtx") (id)) $ M.filter isJust $ M.map mapper c1 where
mapper (t,q) = case q of
QNow -> Nothing
QStable -> Just (t, QStable)
QLater -> Nothing
-- |Runs an inference action in a context with a schema bound to the given name | 339 | stableCtx (Ctx c1) =
Ctx $ M.map (maybe (error "laterCtx") (id)) $ M.filter isJust $ M.map mapper c1 where
mapper (t,q) = case q of
QNow -> Nothing
QStable -> Just (t, QStable)
QLater -> Nothing
-- |Runs an inference action in a context with a schema bound to the given name | 303 | false | true | 2 | 10 | 87 | 131 | 63 | 68 | null | null |
ksaveljev/yampa-2048 | src/Main.hs | mit | drawGame :: SF GameState Picture
drawGame = arr drawBoard | 57 | drawGame :: SF GameState Picture
drawGame = arr drawBoard | 57 | drawGame = arr drawBoard | 24 | false | true | 0 | 6 | 8 | 25 | 10 | 15 | null | null |
input-output-hk/pos-haskell-prototype | crypto/Pos/Crypto/SecretSharing.hs | mit | -- | Transform a Secret into a usable random value.
secretToDhSecret :: Secret -> Scrape.DhSecret
secretToDhSecret = Scrape.secretToDhSecret . getSecret | 152 | secretToDhSecret :: Secret -> Scrape.DhSecret
secretToDhSecret = Scrape.secretToDhSecret . getSecret | 100 | secretToDhSecret = Scrape.secretToDhSecret . getSecret | 54 | true | true | 0 | 8 | 19 | 31 | 14 | 17 | null | null |
zombiecalypse/DynamicTimeWarp | src/Benchmark.hs | lgpl-3.0 | main = defaultMain [
env setupEnv $ \ ~l ->
bgroup "dtw" [
bench (printf "dtw(%03d, %03d)" l r) $ nf dist (ll,rr) | ((l, ll), (r, rr)) <- l
]
] | 161 | main = defaultMain [
env setupEnv $ \ ~l ->
bgroup "dtw" [
bench (printf "dtw(%03d, %03d)" l r) $ nf dist (ll,rr) | ((l, ll), (r, rr)) <- l
]
] | 161 | main = defaultMain [
env setupEnv $ \ ~l ->
bgroup "dtw" [
bench (printf "dtw(%03d, %03d)" l r) $ nf dist (ll,rr) | ((l, ll), (r, rr)) <- l
]
] | 161 | false | false | 1 | 14 | 49 | 90 | 46 | 44 | null | null |
tjakway/ghcjvm | compiler/coreSyn/CoreSeq.hs | bsd-3-clause | seqBind :: Bind CoreBndr -> ()
seqBind (NonRec b e) = seqBndr b `seq` seqExpr e | 79 | seqBind :: Bind CoreBndr -> ()
seqBind (NonRec b e) = seqBndr b `seq` seqExpr e | 79 | seqBind (NonRec b e) = seqBndr b `seq` seqExpr e | 48 | false | true | 0 | 6 | 15 | 47 | 22 | 25 | null | null |
shlevy/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | nopOp _ = False | 28 | nopOp _ = False | 28 | nopOp _ = False | 28 | false | false | 0 | 4 | 16 | 10 | 4 | 6 | null | null |
creichert/http-client-auth | src/Network/HTTP/Client/Auth.hs | bsd-3-clause | parseDigestFields :: MaybeT (State String) MDigestChallenge
parseDigestFields = do
param <- token
case param of
"realm" ->
do equal
str <- quotedStr
return $ mempty {mDigestRealm = Once str}
"domain" ->
do equal
str <- quotedStr
return $ mempty {mDomain = Once str}
"nonce" ->
do equal
str <- quotedStr
return $ mempty {mNonce = Once str}
"opaque" ->
do equal
str <- quotedStr
return $ mempty {mOpaque = Once str}
"stale" ->
do equal
str <- token
return $ mempty {mStale = Once $ str == "true"}
"algorithm" ->
do equal
str <- token
case str of
"MD5" -> return $ mempty {mAlgorithm = Once MD5}
"MD5-sess" -> return $ mempty {mAlgorithm = Once MD5Sess}
_ -> mzero
"qop" ->
do equal
singleQuote
qops <- commaSep token
singleQuote
let qopsData =
flip fmap qops $ \t ->
case t of
"auth" -> Just Auth
"auth-int" -> Just AuthInt
_ -> mempty
return $ mempty {mQop = mconcat qopsData}
_ -> do
equal
_ <- token `orElse` quotedStr
return mempty | 1,615 | parseDigestFields :: MaybeT (State String) MDigestChallenge
parseDigestFields = do
param <- token
case param of
"realm" ->
do equal
str <- quotedStr
return $ mempty {mDigestRealm = Once str}
"domain" ->
do equal
str <- quotedStr
return $ mempty {mDomain = Once str}
"nonce" ->
do equal
str <- quotedStr
return $ mempty {mNonce = Once str}
"opaque" ->
do equal
str <- quotedStr
return $ mempty {mOpaque = Once str}
"stale" ->
do equal
str <- token
return $ mempty {mStale = Once $ str == "true"}
"algorithm" ->
do equal
str <- token
case str of
"MD5" -> return $ mempty {mAlgorithm = Once MD5}
"MD5-sess" -> return $ mempty {mAlgorithm = Once MD5Sess}
_ -> mzero
"qop" ->
do equal
singleQuote
qops <- commaSep token
singleQuote
let qopsData =
flip fmap qops $ \t ->
case t of
"auth" -> Just Auth
"auth-int" -> Just AuthInt
_ -> mempty
return $ mempty {mQop = mconcat qopsData}
_ -> do
equal
_ <- token `orElse` quotedStr
return mempty | 1,615 | parseDigestFields = do
param <- token
case param of
"realm" ->
do equal
str <- quotedStr
return $ mempty {mDigestRealm = Once str}
"domain" ->
do equal
str <- quotedStr
return $ mempty {mDomain = Once str}
"nonce" ->
do equal
str <- quotedStr
return $ mempty {mNonce = Once str}
"opaque" ->
do equal
str <- quotedStr
return $ mempty {mOpaque = Once str}
"stale" ->
do equal
str <- token
return $ mempty {mStale = Once $ str == "true"}
"algorithm" ->
do equal
str <- token
case str of
"MD5" -> return $ mempty {mAlgorithm = Once MD5}
"MD5-sess" -> return $ mempty {mAlgorithm = Once MD5Sess}
_ -> mzero
"qop" ->
do equal
singleQuote
qops <- commaSep token
singleQuote
let qopsData =
flip fmap qops $ \t ->
case t of
"auth" -> Just Auth
"auth-int" -> Just AuthInt
_ -> mempty
return $ mempty {mQop = mconcat qopsData}
_ -> do
equal
_ <- token `orElse` quotedStr
return mempty | 1,555 | false | true | 0 | 20 | 851 | 404 | 191 | 213 | null | null |
tomphp/haskell-tictactoe | test/TicTacToe/ResultSpec.hs | mit | spec :: Spec
spec =
describe "TicTacToe.Result" $ do
context "for in play board" $ do
let board = Fixtures.inPlayBoard
let result = Result.fromBoard board
describe "show" $
it "returns a string" $
show result `shouldBe` "TerminalGame is in play"
describe "getBoard" $
it "returns the board" $
Result.board result `shouldBe` board
context "for cross won board" $ do
let board = Fixtures.xWonBoard
let result = Result.fromBoard board
describe "show" $
it "returns a string" $
show result `shouldBe` "Crosses win"
describe "getBoard" $
it "returns the board" $
Result.board result `shouldBe` board
context "for naught won board" $ do
let board = Fixtures.oWonBoard
let result = Result.fromBoard board
describe "show" $
it "returns a string" $
show result `shouldBe` "Naughts win"
describe "getBoard" $
it "returns the board" $
Result.board result `shouldBe` board
context "for drawn oard" $ do
let board = Fixtures.drawnBoard
let result = Result.fromBoard board
describe "show" $
it "returns a string" $
show result `shouldBe` "Draw"
describe "getBoard" $
it "returns the board" $
Result.board result `shouldBe` board
-- context "fromBoard" $ do
-- it "is in play if there are empty cells and no winning lines" $ do
-- let board = Board [ Naught, Cross, Empty
-- , Naught, Cross, Cross
-- , Cross, Naught, Naught
-- ]
-- GameLogic.getGameState board `shouldBe` InPlay
-- it "is a draw if all cells are taken and there are no winning lines" $ do
-- let board = Board [ Naught, Cross, Naught
-- , Naught, Cross, Cross
-- , Cross, Naught, Naught
-- ]
-- GameLogic.getGameState board `shouldBe` Draw
-- it "has been won be crosses if the there is a winning line of crosses" $ do
-- let board = Board [ Naught, Cross, Naught
-- , Cross, Cross, Cross
-- , Empty, Naught, Naught
-- ]
-- GameLogic.getGameState board `shouldBe` Winner Crosses
-- it "has been won be naughts if the there is a winning line of naughts" $ do
-- let board = Board [ Naught, Cross, Naught
-- , Cross, Naught, Cross
-- , Empty, Naught, Naught
-- ]
-- GameLogic.getGameState board `shouldBe` Winner Naughts | 2,762 | spec :: Spec
spec =
describe "TicTacToe.Result" $ do
context "for in play board" $ do
let board = Fixtures.inPlayBoard
let result = Result.fromBoard board
describe "show" $
it "returns a string" $
show result `shouldBe` "TerminalGame is in play"
describe "getBoard" $
it "returns the board" $
Result.board result `shouldBe` board
context "for cross won board" $ do
let board = Fixtures.xWonBoard
let result = Result.fromBoard board
describe "show" $
it "returns a string" $
show result `shouldBe` "Crosses win"
describe "getBoard" $
it "returns the board" $
Result.board result `shouldBe` board
context "for naught won board" $ do
let board = Fixtures.oWonBoard
let result = Result.fromBoard board
describe "show" $
it "returns a string" $
show result `shouldBe` "Naughts win"
describe "getBoard" $
it "returns the board" $
Result.board result `shouldBe` board
context "for drawn oard" $ do
let board = Fixtures.drawnBoard
let result = Result.fromBoard board
describe "show" $
it "returns a string" $
show result `shouldBe` "Draw"
describe "getBoard" $
it "returns the board" $
Result.board result `shouldBe` board
-- context "fromBoard" $ do
-- it "is in play if there are empty cells and no winning lines" $ do
-- let board = Board [ Naught, Cross, Empty
-- , Naught, Cross, Cross
-- , Cross, Naught, Naught
-- ]
-- GameLogic.getGameState board `shouldBe` InPlay
-- it "is a draw if all cells are taken and there are no winning lines" $ do
-- let board = Board [ Naught, Cross, Naught
-- , Naught, Cross, Cross
-- , Cross, Naught, Naught
-- ]
-- GameLogic.getGameState board `shouldBe` Draw
-- it "has been won be crosses if the there is a winning line of crosses" $ do
-- let board = Board [ Naught, Cross, Naught
-- , Cross, Cross, Cross
-- , Empty, Naught, Naught
-- ]
-- GameLogic.getGameState board `shouldBe` Winner Crosses
-- it "has been won be naughts if the there is a winning line of naughts" $ do
-- let board = Board [ Naught, Cross, Naught
-- , Cross, Naught, Cross
-- , Empty, Naught, Naught
-- ]
-- GameLogic.getGameState board `shouldBe` Winner Naughts | 2,762 | spec =
describe "TicTacToe.Result" $ do
context "for in play board" $ do
let board = Fixtures.inPlayBoard
let result = Result.fromBoard board
describe "show" $
it "returns a string" $
show result `shouldBe` "TerminalGame is in play"
describe "getBoard" $
it "returns the board" $
Result.board result `shouldBe` board
context "for cross won board" $ do
let board = Fixtures.xWonBoard
let result = Result.fromBoard board
describe "show" $
it "returns a string" $
show result `shouldBe` "Crosses win"
describe "getBoard" $
it "returns the board" $
Result.board result `shouldBe` board
context "for naught won board" $ do
let board = Fixtures.oWonBoard
let result = Result.fromBoard board
describe "show" $
it "returns a string" $
show result `shouldBe` "Naughts win"
describe "getBoard" $
it "returns the board" $
Result.board result `shouldBe` board
context "for drawn oard" $ do
let board = Fixtures.drawnBoard
let result = Result.fromBoard board
describe "show" $
it "returns a string" $
show result `shouldBe` "Draw"
describe "getBoard" $
it "returns the board" $
Result.board result `shouldBe` board
-- context "fromBoard" $ do
-- it "is in play if there are empty cells and no winning lines" $ do
-- let board = Board [ Naught, Cross, Empty
-- , Naught, Cross, Cross
-- , Cross, Naught, Naught
-- ]
-- GameLogic.getGameState board `shouldBe` InPlay
-- it "is a draw if all cells are taken and there are no winning lines" $ do
-- let board = Board [ Naught, Cross, Naught
-- , Naught, Cross, Cross
-- , Cross, Naught, Naught
-- ]
-- GameLogic.getGameState board `shouldBe` Draw
-- it "has been won be crosses if the there is a winning line of crosses" $ do
-- let board = Board [ Naught, Cross, Naught
-- , Cross, Cross, Cross
-- , Empty, Naught, Naught
-- ]
-- GameLogic.getGameState board `shouldBe` Winner Crosses
-- it "has been won be naughts if the there is a winning line of naughts" $ do
-- let board = Board [ Naught, Cross, Naught
-- , Cross, Naught, Cross
-- , Empty, Naught, Naught
-- ]
-- GameLogic.getGameState board `shouldBe` Winner Naughts | 2,749 | false | true | 51 | 7 | 1,044 | 332 | 183 | 149 | null | null |
helino/wham | src/Wham/PrettyPrinter.hs | bsd-3-clause | pprintA (Mul a1 a2) = (pprintA a1) ++ " * " ++ (pprintA a2) | 59 | pprintA (Mul a1 a2) = (pprintA a1) ++ " * " ++ (pprintA a2) | 59 | pprintA (Mul a1 a2) = (pprintA a1) ++ " * " ++ (pprintA a2) | 59 | false | false | 0 | 8 | 13 | 38 | 18 | 20 | null | null |
pikajude/th-printf | src/Language/Haskell/PrintfArg.hs | mit | spaced = P.spaced . flagSet | 27 | spaced = P.spaced . flagSet | 27 | spaced = P.spaced . flagSet | 27 | false | false | 0 | 6 | 4 | 12 | 6 | 6 | null | null |
Mokosha/Lambency | lib/Lambency/Shader/Program.hs | mit | addCustomOVar :: String -> ShaderVar a -> ShaderOutput -> ShaderOutput
addCustomOVar name (ShaderVar v) (ShaderOutput vs) = ShaderOutput ((CustomOutput name v):vs) | 163 | addCustomOVar :: String -> ShaderVar a -> ShaderOutput -> ShaderOutput
addCustomOVar name (ShaderVar v) (ShaderOutput vs) = ShaderOutput ((CustomOutput name v):vs) | 163 | addCustomOVar name (ShaderVar v) (ShaderOutput vs) = ShaderOutput ((CustomOutput name v):vs) | 92 | false | true | 0 | 9 | 20 | 63 | 31 | 32 | null | null |
asmyczek/hreviewboard | ReviewBoard/Response.hs | bsd-3-clause | -- Attributes of http response
head = (mkrb "head") :: JSValue -> [JSValue] | 100 | head = (mkrb "head") :: JSValue -> [JSValue] | 67 | head = (mkrb "head") :: JSValue -> [JSValue] | 67 | true | false | 0 | 6 | 37 | 23 | 13 | 10 | null | null |
dorchard/gram_lang | frontend/src/Language/Granule/Checker/Checker.hs | bsd-3-clause | checkDataCon tName kind tyVars d@DataConstrNonIndexed{}
= checkDataCon tName kind tyVars
$ nonIndexedToIndexedDataConstr tName tyVars d | 141 | checkDataCon tName kind tyVars d@DataConstrNonIndexed{}
= checkDataCon tName kind tyVars
$ nonIndexedToIndexedDataConstr tName tyVars d | 141 | checkDataCon tName kind tyVars d@DataConstrNonIndexed{}
= checkDataCon tName kind tyVars
$ nonIndexedToIndexedDataConstr tName tyVars d | 141 | false | false | 2 | 7 | 20 | 41 | 19 | 22 | null | null |
wavewave/hoodle-core | src/Hoodle/Type/Canvas.hs | gpl-3.0 | {-
bothXform :: (forall a. CanvasInfo a -> CanvasInfo a)
-> ((CanvasInfo SinglePage -> f (CanvasInfo SinglePage))
-> (CanvasInfo ContinuousPage -> f (CanvasInfo ContinuousPage))
-> (CanvasInfoBox -> CanvasInfoBox))
-> CanvasInfoBox -> CanvasInfoBox
bothXform f m = m f f
-}
-- | single page action and continuous page act
unboxBiXform :: (Functor f) =>
(CanvasInfo SinglePage -> f (CanvasInfo SinglePage))
-> (CanvasInfo ContinuousPage -> f (CanvasInfo ContinuousPage))
-> CanvasInfoBox -> f CanvasInfoBox
unboxBiXform fsingle _fcont (CanvasSinglePage cinfo) = fmap CanvasSinglePage (fsingle cinfo) | 701 | unboxBiXform :: (Functor f) =>
(CanvasInfo SinglePage -> f (CanvasInfo SinglePage))
-> (CanvasInfo ContinuousPage -> f (CanvasInfo ContinuousPage))
-> CanvasInfoBox -> f CanvasInfoBox
unboxBiXform fsingle _fcont (CanvasSinglePage cinfo) = fmap CanvasSinglePage (fsingle cinfo) | 321 | unboxBiXform fsingle _fcont (CanvasSinglePage cinfo) = fmap CanvasSinglePage (fsingle cinfo) | 92 | true | true | 0 | 13 | 184 | 103 | 50 | 53 | null | null |
awbraunstein/you-ate-my-fractal | src/Fractals.hs | mit | -- Pixel -> Pixel -> MaxIteration -> Iteration(color)
mandel :: ItFractal
mandel mi x y = colorFromValue $ f (C x y) 0 mi where
f :: Complex -> Complex -> Int -> Int
f _ _ 0 = 0
f c z i
| magnitude z > 2 = i
| otherwise = f c ((z * z) + c) (i - 1) | 261 | mandel :: ItFractal
mandel mi x y = colorFromValue $ f (C x y) 0 mi where
f :: Complex -> Complex -> Int -> Int
f _ _ 0 = 0
f c z i
| magnitude z > 2 = i
| otherwise = f c ((z * z) + c) (i - 1) | 207 | mandel mi x y = colorFromValue $ f (C x y) 0 mi where
f :: Complex -> Complex -> Int -> Int
f _ _ 0 = 0
f c z i
| magnitude z > 2 = i
| otherwise = f c ((z * z) + c) (i - 1) | 187 | true | true | 1 | 12 | 77 | 135 | 65 | 70 | null | null |
rahulmutt/ghcvm | compiler/Eta/Types/CoAxiom.hs | bsd-3-clause | brListMap f (NextBranch h t) = f h : (brListMap f t) | 52 | brListMap f (NextBranch h t) = f h : (brListMap f t) | 52 | brListMap f (NextBranch h t) = f h : (brListMap f t) | 52 | false | false | 0 | 7 | 11 | 34 | 16 | 18 | null | null |
xpika/boolean-list | Data/BooleanList.hs | gpl-3.0 | integersToBooleanLists = map integerToBooleanList | 49 | integersToBooleanLists = map integerToBooleanList | 49 | integersToBooleanLists = map integerToBooleanList | 49 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
abhinav/kafka-client | src/Kafka/Internal/Request.hs | mit | -- | @Put@s the given @MultiProduce@ request.
putMultiProduceRequest :: [Produce] -> C.Put
putMultiProduceRequest reqs =
encodeRequest MultiProduceRequestType $
putWithCountPrefix reqs encodeProduce | 210 | putMultiProduceRequest :: [Produce] -> C.Put
putMultiProduceRequest reqs =
encodeRequest MultiProduceRequestType $
putWithCountPrefix reqs encodeProduce | 164 | putMultiProduceRequest reqs =
encodeRequest MultiProduceRequestType $
putWithCountPrefix reqs encodeProduce | 119 | true | true | 0 | 8 | 32 | 42 | 19 | 23 | null | null |
jtobin/deprecated-observable | src/Observable/MCMC/MetropolisHastings.hs | bsd-3-clause | getStandardDeviation :: Maybe Double -> OptionalStore -> Double
getStandardDeviation (Just sd) _ = sd | 103 | getStandardDeviation :: Maybe Double -> OptionalStore -> Double
getStandardDeviation (Just sd) _ = sd | 103 | getStandardDeviation (Just sd) _ = sd | 39 | false | true | 0 | 7 | 15 | 33 | 16 | 17 | null | null |
scott-fleischman/greek-grammar | haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs | mit | decomposeChar '\x1FB0' = "\x03B1\x0306" | 39 | decomposeChar '\x1FB0' = "\x03B1\x0306" | 39 | decomposeChar '\x1FB0' = "\x03B1\x0306" | 39 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
TomMD/ghc | compiler/main/GhcMake.hs | bsd-3-clause | cyclicModuleErr :: [ModSummary] -> SDoc
-- From a strongly connected component we find
-- a single cycle to report
cyclicModuleErr mss
= ASSERT( not (null mss) )
case findCycle graph of
Nothing -> ptext (sLit "Unexpected non-cycle") <+> ppr mss
Just path -> vcat [ ptext (sLit "Module imports form a cycle:")
, nest 2 (show_path path) ]
where
graph :: [Node NodeKey ModSummary]
graph = [(ms, msKey ms, get_deps ms) | ms <- mss]
get_deps :: ModSummary -> [NodeKey]
get_deps ms = ([ (unLoc m, IsBoot) | m <- ms_home_srcimps ms ] ++
[ (unLoc m, NotBoot) | m <- ms_home_imps ms ])
show_path [] = panic "show_path"
show_path [m] = ptext (sLit "module") <+> ppr_ms m
<+> ptext (sLit "imports itself")
show_path (m1:m2:ms) = vcat ( nest 7 (ptext (sLit "module") <+> ppr_ms m1)
: nest 6 (ptext (sLit "imports") <+> ppr_ms m2)
: go ms )
where
go [] = [ptext (sLit "which imports") <+> ppr_ms m1]
go (m:ms) = (ptext (sLit "which imports") <+> ppr_ms m) : go ms
ppr_ms :: ModSummary -> SDoc
ppr_ms ms = quotes (ppr (moduleName (ms_mod ms))) <+>
(parens (text (msHsFilePath ms))) | 1,330 | cyclicModuleErr :: [ModSummary] -> SDoc
cyclicModuleErr mss
= ASSERT( not (null mss) )
case findCycle graph of
Nothing -> ptext (sLit "Unexpected non-cycle") <+> ppr mss
Just path -> vcat [ ptext (sLit "Module imports form a cycle:")
, nest 2 (show_path path) ]
where
graph :: [Node NodeKey ModSummary]
graph = [(ms, msKey ms, get_deps ms) | ms <- mss]
get_deps :: ModSummary -> [NodeKey]
get_deps ms = ([ (unLoc m, IsBoot) | m <- ms_home_srcimps ms ] ++
[ (unLoc m, NotBoot) | m <- ms_home_imps ms ])
show_path [] = panic "show_path"
show_path [m] = ptext (sLit "module") <+> ppr_ms m
<+> ptext (sLit "imports itself")
show_path (m1:m2:ms) = vcat ( nest 7 (ptext (sLit "module") <+> ppr_ms m1)
: nest 6 (ptext (sLit "imports") <+> ppr_ms m2)
: go ms )
where
go [] = [ptext (sLit "which imports") <+> ppr_ms m1]
go (m:ms) = (ptext (sLit "which imports") <+> ppr_ms m) : go ms
ppr_ms :: ModSummary -> SDoc
ppr_ms ms = quotes (ppr (moduleName (ms_mod ms))) <+>
(parens (text (msHsFilePath ms))) | 1,255 | cyclicModuleErr mss
= ASSERT( not (null mss) )
case findCycle graph of
Nothing -> ptext (sLit "Unexpected non-cycle") <+> ppr mss
Just path -> vcat [ ptext (sLit "Module imports form a cycle:")
, nest 2 (show_path path) ]
where
graph :: [Node NodeKey ModSummary]
graph = [(ms, msKey ms, get_deps ms) | ms <- mss]
get_deps :: ModSummary -> [NodeKey]
get_deps ms = ([ (unLoc m, IsBoot) | m <- ms_home_srcimps ms ] ++
[ (unLoc m, NotBoot) | m <- ms_home_imps ms ])
show_path [] = panic "show_path"
show_path [m] = ptext (sLit "module") <+> ppr_ms m
<+> ptext (sLit "imports itself")
show_path (m1:m2:ms) = vcat ( nest 7 (ptext (sLit "module") <+> ppr_ms m1)
: nest 6 (ptext (sLit "imports") <+> ppr_ms m2)
: go ms )
where
go [] = [ptext (sLit "which imports") <+> ppr_ms m1]
go (m:ms) = (ptext (sLit "which imports") <+> ppr_ms m) : go ms
ppr_ms :: ModSummary -> SDoc
ppr_ms ms = quotes (ppr (moduleName (ms_mod ms))) <+>
(parens (text (msHsFilePath ms))) | 1,215 | true | true | 0 | 14 | 453 | 497 | 246 | 251 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT47.hs | gpl-3.0 | x /= y = not (x == y) | 21 | x /= y = not (x == y) | 21 | x /= y = not (x == y) | 21 | false | false | 2 | 7 | 7 | 22 | 11 | 11 | null | null |
mfpi/OpenGL | Graphics/Rendering/OpenGL/GL/PixelRectangles/Histogram.hs | bsd-3-clause | marshalGetHistogramParameterPName :: GetHistogramParameterPName -> GLenum
marshalGetHistogramParameterPName x = case x of
HistogramWidth -> gl_HISTOGRAM_WIDTH
HistogramFormat -> gl_HISTOGRAM_FORMAT
HistogramRedSize -> gl_HISTOGRAM_RED_SIZE
HistogramGreenSize -> gl_HISTOGRAM_GREEN_SIZE
HistogramBlueSize -> gl_HISTOGRAM_BLUE_SIZE
HistogramAlphaSize -> gl_HISTOGRAM_ALPHA_SIZE
HistogramLuminanceSize -> gl_HISTOGRAM_LUMINANCE_SIZE
HistogramSink -> gl_HISTOGRAM_SINK
-------------------------------------------------------------------------------- | 570 | marshalGetHistogramParameterPName :: GetHistogramParameterPName -> GLenum
marshalGetHistogramParameterPName x = case x of
HistogramWidth -> gl_HISTOGRAM_WIDTH
HistogramFormat -> gl_HISTOGRAM_FORMAT
HistogramRedSize -> gl_HISTOGRAM_RED_SIZE
HistogramGreenSize -> gl_HISTOGRAM_GREEN_SIZE
HistogramBlueSize -> gl_HISTOGRAM_BLUE_SIZE
HistogramAlphaSize -> gl_HISTOGRAM_ALPHA_SIZE
HistogramLuminanceSize -> gl_HISTOGRAM_LUMINANCE_SIZE
HistogramSink -> gl_HISTOGRAM_SINK
-------------------------------------------------------------------------------- | 570 | marshalGetHistogramParameterPName x = case x of
HistogramWidth -> gl_HISTOGRAM_WIDTH
HistogramFormat -> gl_HISTOGRAM_FORMAT
HistogramRedSize -> gl_HISTOGRAM_RED_SIZE
HistogramGreenSize -> gl_HISTOGRAM_GREEN_SIZE
HistogramBlueSize -> gl_HISTOGRAM_BLUE_SIZE
HistogramAlphaSize -> gl_HISTOGRAM_ALPHA_SIZE
HistogramLuminanceSize -> gl_HISTOGRAM_LUMINANCE_SIZE
HistogramSink -> gl_HISTOGRAM_SINK
-------------------------------------------------------------------------------- | 496 | false | true | 0 | 7 | 60 | 71 | 36 | 35 | null | null |
brendanhay/gogol | gogol-alertcenter/gen/Network/Google/AlertCenter/Types/Product.hs | mpl-2.0 | -- | The entity whose actions triggered a Gmail phishing alert.
bwlMaliciousEntity :: Lens' BadWhiteList (Maybe MaliciousEntity)
bwlMaliciousEntity
= lens _bwlMaliciousEntity
(\ s a -> s{_bwlMaliciousEntity = a}) | 220 | bwlMaliciousEntity :: Lens' BadWhiteList (Maybe MaliciousEntity)
bwlMaliciousEntity
= lens _bwlMaliciousEntity
(\ s a -> s{_bwlMaliciousEntity = a}) | 156 | bwlMaliciousEntity
= lens _bwlMaliciousEntity
(\ s a -> s{_bwlMaliciousEntity = a}) | 91 | true | true | 0 | 9 | 35 | 48 | 25 | 23 | null | null |
brendanhay/gogol | gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs | mpl-2.0 | -- | Whether the tab to browse the videos should be displayed.
cShowBrowseView :: Lens' ChannelSettings (Maybe Bool)
cShowBrowseView
= lens _cShowBrowseView
(\ s a -> s{_cShowBrowseView = a}) | 199 | cShowBrowseView :: Lens' ChannelSettings (Maybe Bool)
cShowBrowseView
= lens _cShowBrowseView
(\ s a -> s{_cShowBrowseView = a}) | 136 | cShowBrowseView
= lens _cShowBrowseView
(\ s a -> s{_cShowBrowseView = a}) | 82 | true | true | 0 | 9 | 36 | 48 | 25 | 23 | null | null |
massudaw/mtk | Solver/RungeKutta.hs | bsd-3-clause | diffs (x:xs) (y:ys) = (x - y) : diffs xs ys | 43 | diffs (x:xs) (y:ys) = (x - y) : diffs xs ys | 43 | diffs (x:xs) (y:ys) = (x - y) : diffs xs ys | 43 | false | false | 0 | 7 | 10 | 41 | 21 | 20 | null | null |
Gabriel439/Haskell-Dhall-Library | dhall/src/Dhall/Core.hs | bsd-3-clause | throws :: (Exception e, MonadIO io) => Either e a -> io a
throws (Left e) = liftIO (Control.Exception.throwIO e) | 113 | throws :: (Exception e, MonadIO io) => Either e a -> io a
throws (Left e) = liftIO (Control.Exception.throwIO e) | 113 | throws (Left e) = liftIO (Control.Exception.throwIO e) | 55 | false | true | 0 | 8 | 20 | 64 | 30 | 34 | null | null |
sdiehl/ghc | testsuite/tests/pmcheck/should_compile/TooManyDeltas.hs | bsd-3-clause | -- (this one is not about exhaustivity)
-- | Fails to report that the second clause is redundant.
h :: T -> T -> ()
h A A = () | 127 | h :: T -> T -> ()
h A A = () | 28 | h A A = () | 10 | true | true | 0 | 7 | 30 | 35 | 17 | 18 | null | null |
diku-dk/futhark | src/Futhark/CodeGen/Backends/MulticoreC.hs | isc | addBenchmarkFields name Nothing = do
GC.contextField (functionRuntime name) [C.cty|typename int64_t|] $ Just [C.cexp|0|]
GC.contextField (functionRuns name) [C.cty|int|] $ Just [C.cexp|0|]
GC.contextField (functionIter name) [C.cty|typename int64_t|] $ Just [C.cexp|0|] | 275 | addBenchmarkFields name Nothing = do
GC.contextField (functionRuntime name) [C.cty|typename int64_t|] $ Just [C.cexp|0|]
GC.contextField (functionRuns name) [C.cty|int|] $ Just [C.cexp|0|]
GC.contextField (functionIter name) [C.cty|typename int64_t|] $ Just [C.cexp|0|] | 275 | addBenchmarkFields name Nothing = do
GC.contextField (functionRuntime name) [C.cty|typename int64_t|] $ Just [C.cexp|0|]
GC.contextField (functionRuns name) [C.cty|int|] $ Just [C.cexp|0|]
GC.contextField (functionIter name) [C.cty|typename int64_t|] $ Just [C.cexp|0|] | 275 | false | false | 0 | 10 | 33 | 118 | 65 | 53 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.