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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
nevrenato/Hets_Fork | Common/Lib/Pretty.hs | gpl-2.0 | p $+$ q = above_ p True q | 25 | p $+$ q = above_ p True q | 25 | p $+$ q = above_ p True q | 25 | false | false | 2 | 5 | 7 | 18 | 8 | 10 | null | null |
isomorphism/csound-expression | src/Csound/Air/Envelope.hs | bsd-3-clause | -- | It's like loopxseg but we can specify the phase of repetition (phase belongs to [0, 1]).
loopxsegBy :: D -> [Sig] -> Sig -> Sig
loopxsegBy phase as cps = smooth $ C.loopxseg cps 0 phase (fixEnd as) | 202 | loopxsegBy :: D -> [Sig] -> Sig -> Sig
loopxsegBy phase as cps = smooth $ C.loopxseg cps 0 phase (fixEnd as) | 108 | loopxsegBy phase as cps = smooth $ C.loopxseg cps 0 phase (fixEnd as) | 69 | true | true | 0 | 8 | 39 | 55 | 28 | 27 | null | null |
davidsundelius/JLC | src/PrintJasm.hs | mit | resetScope :: EnvState ()
resetScope = do
(Env cn _ _) <- get
put (Env cn 0 [empty]) | 88 | resetScope :: EnvState ()
resetScope = do
(Env cn _ _) <- get
put (Env cn 0 [empty]) | 88 | resetScope = do
(Env cn _ _) <- get
put (Env cn 0 [empty]) | 62 | false | true | 0 | 10 | 21 | 52 | 25 | 27 | null | null |
brendanhay/amqp-bark | bark/src/Bark/IO.hs | bsd-3-clause | conduitHandle :: MonadResource m
=> Handle
-> Conduit B.ByteString m B.ByteString
conduitHandle handle =
conduitIO (return handle) (\_ -> return ()) push (const $ return [])
where
push h input = do
liftIO $ B.hPut h input
return $ IOProducing [input] | 304 | conduitHandle :: MonadResource m
=> Handle
-> Conduit B.ByteString m B.ByteString
conduitHandle handle =
conduitIO (return handle) (\_ -> return ()) push (const $ return [])
where
push h input = do
liftIO $ B.hPut h input
return $ IOProducing [input] | 304 | conduitHandle handle =
conduitIO (return handle) (\_ -> return ()) push (const $ return [])
where
push h input = do
liftIO $ B.hPut h input
return $ IOProducing [input] | 194 | false | true | 0 | 9 | 94 | 116 | 55 | 61 | null | null |
rfranek/duckling | Duckling/Time/EN/Rules.hs | bsd-3-clause | ruleCycleOrdinalQuarterYear :: Rule
ruleCycleOrdinalQuarterYear = Rule
{ name = "<ordinal> quarter <year>"
, pattern =
[ dimension Ordinal
, Predicate $ isGrain TG.Quarter
, dimension Time
]
, prod = \tokens -> case tokens of
(token:_:Token Time td:_) -> do
n <- getIntValue token
tt $ cycleNthAfter False TG.Quarter (n - 1) td
_ -> Nothing
} | 394 | ruleCycleOrdinalQuarterYear :: Rule
ruleCycleOrdinalQuarterYear = Rule
{ name = "<ordinal> quarter <year>"
, pattern =
[ dimension Ordinal
, Predicate $ isGrain TG.Quarter
, dimension Time
]
, prod = \tokens -> case tokens of
(token:_:Token Time td:_) -> do
n <- getIntValue token
tt $ cycleNthAfter False TG.Quarter (n - 1) td
_ -> Nothing
} | 394 | ruleCycleOrdinalQuarterYear = Rule
{ name = "<ordinal> quarter <year>"
, pattern =
[ dimension Ordinal
, Predicate $ isGrain TG.Quarter
, dimension Time
]
, prod = \tokens -> case tokens of
(token:_:Token Time td:_) -> do
n <- getIntValue token
tt $ cycleNthAfter False TG.Quarter (n - 1) td
_ -> Nothing
} | 358 | false | true | 0 | 17 | 108 | 135 | 69 | 66 | null | null |
np/lens | src/Control/Lens/Setter.hs | bsd-3-clause | -- |
-- Replace the target of a 'Control.Lens.Type.Lens' or all of the targets of a 'Setter''
-- or 'Control.Lens.Traversal.Traversal'' with a constant value, without changing its type.
--
-- This is a type restricted version of 'set', which retains the type of the original.
--
-- >>> set' mapped x [a,b,c,d]
-- [x,x,x,x]
--
-- >>> set' _2 "hello" (1,"world")
-- (1,"hello")
--
-- >>> set' mapped 0 [1,2,3,4]
-- [0,0,0,0]
--
-- Note: Attempting to adjust 'set'' a 'Fold' or 'Getter' will fail at compile time with an
-- relatively nice error message.
--
-- @
-- 'set'' :: 'Setter'' s a -> a -> s -> s
-- 'set'' :: 'Control.Lens.Iso.Iso'' s a -> a -> s -> s
-- 'set'' :: 'Control.Lens.Type.Lens'' s a -> a -> s -> s
-- 'set'' :: 'Control.Lens.Traversal.Traversal'' s a -> a -> s -> s
-- @
set' :: Setting s s a a -> a -> s -> s
set' l b = runMutator #. l (\_ -> Mutator b) | 886 | set' :: Setting s s a a -> a -> s -> s
set' l b = runMutator #. l (\_ -> Mutator b) | 83 | set' l b = runMutator #. l (\_ -> Mutator b) | 44 | true | true | 0 | 9 | 185 | 84 | 52 | 32 | null | null |
rgllm/uminho | 02/CP/cp/Test.hs | mit | prop_union3 :: Ord v => Graph v -> Graph v -> Bool
prop_union3 g g' = isSubgraphOf g (Graph.union g g') && isSubgraphOf g' (Graph.union g g') | 141 | prop_union3 :: Ord v => Graph v -> Graph v -> Bool
prop_union3 g g' = isSubgraphOf g (Graph.union g g') && isSubgraphOf g' (Graph.union g g') | 141 | prop_union3 g g' = isSubgraphOf g (Graph.union g g') && isSubgraphOf g' (Graph.union g g') | 90 | false | true | 0 | 9 | 26 | 71 | 33 | 38 | null | null |
colah/ImplicitCAD | programs/parser-bench.hs | agpl-3.0 | fors :: Int -> String
fors n = concat ["for (i=[0:1:10]) {cube (i);}" | _ <- [1..n]] | 84 | fors :: Int -> String
fors n = concat ["for (i=[0:1:10]) {cube (i);}" | _ <- [1..n]] | 84 | fors n = concat ["for (i=[0:1:10]) {cube (i);}" | _ <- [1..n]] | 62 | false | true | 0 | 9 | 16 | 37 | 19 | 18 | null | null |
abakst/liquidhaskell | tests/pos/trans.hs | bsd-3-clause | transpose n m ((x:xs) : xss) = (x : map head xss) : transpose (n - 1) m (xs : map tail xss) | 91 | transpose n m ((x:xs) : xss) = (x : map head xss) : transpose (n - 1) m (xs : map tail xss) | 91 | transpose n m ((x:xs) : xss) = (x : map head xss) : transpose (n - 1) m (xs : map tail xss) | 91 | false | false | 0 | 9 | 22 | 72 | 35 | 37 | null | null |
bgold-cosmos/Tidal | src/Sound/Tidal/Core.hs | gpl-3.0 | in123 :: Pattern Double
in123 = cF 0 "123" | 42 | in123 :: Pattern Double
in123 = cF 0 "123" | 42 | in123 = cF 0 "123" | 18 | false | true | 0 | 6 | 8 | 26 | 10 | 16 | null | null |
vTurbine/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | metaTyVarTcLevel :: TcTyVar -> TcLevel
metaTyVarTcLevel tv
= case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tclvl } -> tclvl
_ -> pprPanic "metaTyVarTcLevel" (ppr tv) | 180 | metaTyVarTcLevel :: TcTyVar -> TcLevel
metaTyVarTcLevel tv
= case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tclvl } -> tclvl
_ -> pprPanic "metaTyVarTcLevel" (ppr tv) | 180 | metaTyVarTcLevel tv
= case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tclvl } -> tclvl
_ -> pprPanic "metaTyVarTcLevel" (ppr tv) | 141 | false | true | 2 | 7 | 39 | 58 | 28 | 30 | null | null |
exFalso/SimpleLog | src/System/Log/SLog/Format.hs | bsd-3-clause | -- | finaliseFormat finalises a format that represents datetime elements as a UNIX datetime format string and turns them into a formatting closure. This method also concatenates adjacent 'StringElem's
finaliseFormat :: FormatTH -> Format
finaliseFormat (StringElemTH s0 : StringElemTH s1 : rest) = finaliseFormat $ StringElemTH (T.append s0 s1) : rest | 351 | finaliseFormat :: FormatTH -> Format
finaliseFormat (StringElemTH s0 : StringElemTH s1 : rest) = finaliseFormat $ StringElemTH (T.append s0 s1) : rest | 150 | finaliseFormat (StringElemTH s0 : StringElemTH s1 : rest) = finaliseFormat $ StringElemTH (T.append s0 s1) : rest | 113 | true | true | 0 | 11 | 50 | 63 | 29 | 34 | null | null |
teuffy/interactive-brokers | executable/IB.hs | bsd-3-clause | reqContracts :: String -> String -> IB (Maybe IBContractDetails)
reqContracts sf s = req (requestContractData (ibContract sf s)) $ \rid -> untilRecv $ \case
IBResponse (ContractData rid c) -> if null s || s == _conLocalSymbol (_cdSummary c)
then return (AResult c)
else return AContinue
IBResponse (ContractDataEnd rid) -> return AStop
_ -> return AContinue | 371 | reqContracts :: String -> String -> IB (Maybe IBContractDetails)
reqContracts sf s = req (requestContractData (ibContract sf s)) $ \rid -> untilRecv $ \case
IBResponse (ContractData rid c) -> if null s || s == _conLocalSymbol (_cdSummary c)
then return (AResult c)
else return AContinue
IBResponse (ContractDataEnd rid) -> return AStop
_ -> return AContinue | 371 | reqContracts sf s = req (requestContractData (ibContract sf s)) $ \rid -> untilRecv $ \case
IBResponse (ContractData rid c) -> if null s || s == _conLocalSymbol (_cdSummary c)
then return (AResult c)
else return AContinue
IBResponse (ContractDataEnd rid) -> return AStop
_ -> return AContinue | 306 | false | true | 0 | 16 | 68 | 154 | 72 | 82 | null | null |
scrive/ntp-control | Network/NTP/Control/Packet.hs | bsd-3-clause | decodeOp 7 = return AsynchronousMessage | 40 | decodeOp 7 = return AsynchronousMessage | 40 | decodeOp 7 = return AsynchronousMessage | 40 | false | false | 1 | 5 | 5 | 16 | 5 | 11 | null | null |
ben-schulz/Idris-dev | src/Idris/IdrisDoc.hs | bsd-3-clause | extractPTermNames (PTactics tacts) = concatMap extractPTactic tacts | 69 | extractPTermNames (PTactics tacts) = concatMap extractPTactic tacts | 69 | extractPTermNames (PTactics tacts) = concatMap extractPTactic tacts | 69 | false | false | 0 | 7 | 8 | 20 | 9 | 11 | null | null |
cmahon/interactive-brokers | library/API/IB/Data.hs | bsd-3-clause | parseAccountUpdateTime :: Parser IBResponse
parseAccountUpdateTime = do
_ <- parseVersion
AccountUpdateTime <$>
parseField parseTimeOfDayHHMM | 149 | parseAccountUpdateTime :: Parser IBResponse
parseAccountUpdateTime = do
_ <- parseVersion
AccountUpdateTime <$>
parseField parseTimeOfDayHHMM | 149 | parseAccountUpdateTime = do
_ <- parseVersion
AccountUpdateTime <$>
parseField parseTimeOfDayHHMM | 105 | false | true | 0 | 8 | 21 | 31 | 14 | 17 | null | null |
jcristovao/units-attoparsec | Data/Units/SI/Prefixes/Attoparsec/Text.hs | bsd-3-clause | deciP :: Parser Deci
deciP = 'd' >~ Deci | 40 | deciP :: Parser Deci
deciP = 'd' >~ Deci | 40 | deciP = 'd' >~ Deci | 19 | false | true | 2 | 6 | 8 | 25 | 10 | 15 | null | null |
zeyuanxy/project-euler | vol4/194.hs | mit | choose :: (Integral a) => a -> a -> a
choose n r = (product [n - r + 1..n]) `div` (product [1..r]) | 98 | choose :: (Integral a) => a -> a -> a
choose n r = (product [n - r + 1..n]) `div` (product [1..r]) | 98 | choose n r = (product [n - r + 1..n]) `div` (product [1..r]) | 60 | false | true | 0 | 10 | 22 | 75 | 38 | 37 | null | null |
elieux/ghc | compiler/main/DynFlags.hs | bsd-3-clause | opt_lo :: DynFlags -> [String]
opt_lo dflags = sOpt_lo (settings dflags) | 87 | opt_lo :: DynFlags -> [String]
opt_lo dflags = sOpt_lo (settings dflags) | 87 | opt_lo dflags = sOpt_lo (settings dflags) | 41 | false | true | 0 | 7 | 25 | 30 | 15 | 15 | null | null |
lamdu/lamdu | src/Lamdu/Eval/JS/Compiler.hs | gpl-3.0 | replaceSpecialChars :: String -> String
replaceSpecialChars = concatMap replaceSpecial
where
replaceSpecial x
| Char.isAlphaNum x = [x]
| x == '_' = "__"
| otherwise = '_' : ((hex #) . Char.ord) x ++ "_" | 251 | replaceSpecialChars :: String -> String
replaceSpecialChars = concatMap replaceSpecial
where
replaceSpecial x
| Char.isAlphaNum x = [x]
| x == '_' = "__"
| otherwise = '_' : ((hex #) . Char.ord) x ++ "_" | 251 | replaceSpecialChars = concatMap replaceSpecial
where
replaceSpecial x
| Char.isAlphaNum x = [x]
| x == '_' = "__"
| otherwise = '_' : ((hex #) . Char.ord) x ++ "_" | 211 | false | true | 0 | 11 | 82 | 88 | 43 | 45 | null | null |
VictorDenisov/keystone | src/Keystone/Model/Service.hs | gpl-2.0 | collectionName :: M.Collection
collectionName = "service" | 57 | collectionName :: M.Collection
collectionName = "service" | 57 | collectionName = "service" | 26 | false | true | 0 | 7 | 5 | 20 | 8 | 12 | null | null |
charlesrosenbauer/Bzo-Compiler | backendTest/Backend.hs | gpl-3.0 | printExpr (LOr q is) = (printVar q) ++ " := " ++ (printInter " || " is) ++ "\n" | 81 | printExpr (LOr q is) = (printVar q) ++ " := " ++ (printInter " || " is) ++ "\n" | 81 | printExpr (LOr q is) = (printVar q) ++ " := " ++ (printInter " || " is) ++ "\n" | 81 | false | false | 0 | 9 | 20 | 43 | 21 | 22 | null | null |
Alxandr/Phidoc | src/Text/Phidoc/Walk.hs | bsd-3-clause | validImport _ = True | 26 | validImport _ = True | 26 | validImport _ = True | 26 | false | false | 0 | 5 | 9 | 9 | 4 | 5 | null | null |
sru-systems/protobuf-simple | src/Parser/ProtoParser.hs | mit | fieldOptions :: FieldDesc -> Parsec String u FieldDesc
fieldOptions s = option s (do
void $ symbol '['
s' <- fieldOption s
void $ symbol ']'
return s'
) | 176 | fieldOptions :: FieldDesc -> Parsec String u FieldDesc
fieldOptions s = option s (do
void $ symbol '['
s' <- fieldOption s
void $ symbol ']'
return s'
) | 176 | fieldOptions s = option s (do
void $ symbol '['
s' <- fieldOption s
void $ symbol ']'
return s'
) | 121 | false | true | 0 | 10 | 52 | 75 | 31 | 44 | null | null |
romanb/amazonka | amazonka-dynamodb/gen/Network/AWS/DynamoDB/Types.hs | mpl-2.0 | -- | The date and time of the last provisioned throughput decrease for this table.
ptdLastDecreaseDateTime :: Lens' ProvisionedThroughputDescription (Maybe UTCTime)
ptdLastDecreaseDateTime =
lens _ptdLastDecreaseDateTime (\s a -> s { _ptdLastDecreaseDateTime = a })
. mapping _Time | 293 | ptdLastDecreaseDateTime :: Lens' ProvisionedThroughputDescription (Maybe UTCTime)
ptdLastDecreaseDateTime =
lens _ptdLastDecreaseDateTime (\s a -> s { _ptdLastDecreaseDateTime = a })
. mapping _Time | 210 | ptdLastDecreaseDateTime =
lens _ptdLastDecreaseDateTime (\s a -> s { _ptdLastDecreaseDateTime = a })
. mapping _Time | 128 | true | true | 0 | 10 | 48 | 53 | 28 | 25 | null | null |
bitemyapp/lets-lens | src/Lets/StoreLens.hs | bsd-3-clause | -- |
--
-- >>> get (setL 3) (Set.fromList [1..5])
-- True
--
-- >>> get (setL 33) (Set.fromList [1..5])
-- False
--
-- >>> set (setL 3) (Set.fromList [1..5]) True
-- fromList [1,2,3,4,5]
--
-- >>> set (setL 3) (Set.fromList [1..5]) False
-- fromList [1,2,4,5]
--
-- >>> set (setL 33) (Set.fromList [1..5]) True
-- fromList [1,2,3,4,5,33]
--
-- >>> set (setL 33) (Set.fromList [1..5]) False
-- fromList [1,2,3,4,5]
setL ::
Ord k =>
k
-> Lens (Set k) Bool
setL =
error "todo: setL" | 487 | setL ::
Ord k =>
k
-> Lens (Set k) Bool
setL =
error "todo: setL" | 73 | setL =
error "todo: setL" | 27 | true | true | 0 | 10 | 93 | 57 | 36 | 21 | null | null |
urbanslug/ghc | compiler/main/DynFlags.hs | bsd-3-clause | -- | Parses the dynamically set flags for GHC. This is the most general form of
-- the dynamic flag parser that the other methods simply wrap. It allows
-- saying which flags are valid flags and indicating if we are parsing
-- arguments from the command line or from a file pragma.
parseDynamicFlagsFull :: MonadIO m
=> [Flag (CmdLineP DynFlags)] -- ^ valid flags to match against
-> Bool -- ^ are the arguments from the command line?
-> DynFlags -- ^ current dynamic flags
-> [Located String] -- ^ arguments to parse
-> m (DynFlags, [Located String], [Located String])
parseDynamicFlagsFull activeFlags cmdline dflags0 args = do
let ((leftover, errs, warns), dflags1)
= runCmdLine (processArgs activeFlags args) dflags0
-- See Note [Handling errors when parsing commandline flags]
unless (null errs) $ liftIO $ throwGhcExceptionIO $
errorsToGhcException . map (showPpr dflags0 . getLoc &&& unLoc) $ errs
-- check for disabled flags in safe haskell
let (dflags2, sh_warns) = safeFlagCheck cmdline dflags1
dflags3 = updateWays dflags2
theWays = ways dflags3
unless (allowed_combination theWays) $ liftIO $
throwGhcExceptionIO (CmdLineError ("combination not supported: " ++
intercalate "/" (map wayDesc theWays)))
let chooseOutput
| isJust (outputFile dflags3) -- Only iff user specified -o ...
, not (isJust (dynOutputFile dflags3)) -- but not -dyno
= return $ dflags3 { dynOutputFile = Just $ dynOut (fromJust $ outputFile dflags3) }
| otherwise
= return dflags3
where
dynOut = flip addExtension (dynObjectSuf dflags3) . dropExtension
dflags4 <- ifGeneratingDynamicToo dflags3 chooseOutput (return dflags3)
let (dflags5, consistency_warnings) = makeDynFlagsConsistent dflags4
dflags6 <- case dllSplitFile dflags5 of
Nothing -> return (dflags5 { dllSplit = Nothing })
Just f ->
case dllSplit dflags5 of
Just _ ->
-- If dllSplit is out of date then it would have
-- been set to Nothing. As it's a Just, it must be
-- up-to-date.
return dflags5
Nothing ->
do xs <- liftIO $ readFile f
let ss = map (Set.fromList . words) (lines xs)
return $ dflags5 { dllSplit = Just ss }
-- Set timer stats & heap size
when (enableTimeStats dflags6) $ liftIO enableTimingStats
case (ghcHeapSize dflags6) of
Just x -> liftIO (setHeapSize x)
_ -> return ()
liftIO $ setUnsafeGlobalDynFlags dflags6
return (dflags6, leftover, consistency_warnings ++ sh_warns ++ warns) | 2,913 | parseDynamicFlagsFull :: MonadIO m
=> [Flag (CmdLineP DynFlags)] -- ^ valid flags to match against
-> Bool -- ^ are the arguments from the command line?
-> DynFlags -- ^ current dynamic flags
-> [Located String] -- ^ arguments to parse
-> m (DynFlags, [Located String], [Located String])
parseDynamicFlagsFull activeFlags cmdline dflags0 args = do
let ((leftover, errs, warns), dflags1)
= runCmdLine (processArgs activeFlags args) dflags0
-- See Note [Handling errors when parsing commandline flags]
unless (null errs) $ liftIO $ throwGhcExceptionIO $
errorsToGhcException . map (showPpr dflags0 . getLoc &&& unLoc) $ errs
-- check for disabled flags in safe haskell
let (dflags2, sh_warns) = safeFlagCheck cmdline dflags1
dflags3 = updateWays dflags2
theWays = ways dflags3
unless (allowed_combination theWays) $ liftIO $
throwGhcExceptionIO (CmdLineError ("combination not supported: " ++
intercalate "/" (map wayDesc theWays)))
let chooseOutput
| isJust (outputFile dflags3) -- Only iff user specified -o ...
, not (isJust (dynOutputFile dflags3)) -- but not -dyno
= return $ dflags3 { dynOutputFile = Just $ dynOut (fromJust $ outputFile dflags3) }
| otherwise
= return dflags3
where
dynOut = flip addExtension (dynObjectSuf dflags3) . dropExtension
dflags4 <- ifGeneratingDynamicToo dflags3 chooseOutput (return dflags3)
let (dflags5, consistency_warnings) = makeDynFlagsConsistent dflags4
dflags6 <- case dllSplitFile dflags5 of
Nothing -> return (dflags5 { dllSplit = Nothing })
Just f ->
case dllSplit dflags5 of
Just _ ->
-- If dllSplit is out of date then it would have
-- been set to Nothing. As it's a Just, it must be
-- up-to-date.
return dflags5
Nothing ->
do xs <- liftIO $ readFile f
let ss = map (Set.fromList . words) (lines xs)
return $ dflags5 { dllSplit = Just ss }
-- Set timer stats & heap size
when (enableTimeStats dflags6) $ liftIO enableTimingStats
case (ghcHeapSize dflags6) of
Just x -> liftIO (setHeapSize x)
_ -> return ()
liftIO $ setUnsafeGlobalDynFlags dflags6
return (dflags6, leftover, consistency_warnings ++ sh_warns ++ warns) | 2,631 | parseDynamicFlagsFull activeFlags cmdline dflags0 args = do
let ((leftover, errs, warns), dflags1)
= runCmdLine (processArgs activeFlags args) dflags0
-- See Note [Handling errors when parsing commandline flags]
unless (null errs) $ liftIO $ throwGhcExceptionIO $
errorsToGhcException . map (showPpr dflags0 . getLoc &&& unLoc) $ errs
-- check for disabled flags in safe haskell
let (dflags2, sh_warns) = safeFlagCheck cmdline dflags1
dflags3 = updateWays dflags2
theWays = ways dflags3
unless (allowed_combination theWays) $ liftIO $
throwGhcExceptionIO (CmdLineError ("combination not supported: " ++
intercalate "/" (map wayDesc theWays)))
let chooseOutput
| isJust (outputFile dflags3) -- Only iff user specified -o ...
, not (isJust (dynOutputFile dflags3)) -- but not -dyno
= return $ dflags3 { dynOutputFile = Just $ dynOut (fromJust $ outputFile dflags3) }
| otherwise
= return dflags3
where
dynOut = flip addExtension (dynObjectSuf dflags3) . dropExtension
dflags4 <- ifGeneratingDynamicToo dflags3 chooseOutput (return dflags3)
let (dflags5, consistency_warnings) = makeDynFlagsConsistent dflags4
dflags6 <- case dllSplitFile dflags5 of
Nothing -> return (dflags5 { dllSplit = Nothing })
Just f ->
case dllSplit dflags5 of
Just _ ->
-- If dllSplit is out of date then it would have
-- been set to Nothing. As it's a Just, it must be
-- up-to-date.
return dflags5
Nothing ->
do xs <- liftIO $ readFile f
let ss = map (Set.fromList . words) (lines xs)
return $ dflags5 { dllSplit = Just ss }
-- Set timer stats & heap size
when (enableTimeStats dflags6) $ liftIO enableTimingStats
case (ghcHeapSize dflags6) of
Just x -> liftIO (setHeapSize x)
_ -> return ()
liftIO $ setUnsafeGlobalDynFlags dflags6
return (dflags6, leftover, consistency_warnings ++ sh_warns ++ warns) | 2,191 | true | true | 0 | 22 | 935 | 643 | 315 | 328 | null | null |
siddhanathan/ghc | testsuite/tests/parser/should_compile/read030.hs | bsd-3-clause | ps |- q:qs = undefined | 26 | ps |- q:qs = undefined | 26 | ps |- q:qs = undefined | 26 | false | false | 1 | 6 | 8 | 19 | 8 | 11 | null | null |
Rathcke/uni | ap/advanced programming/exam/src/subs/SubsInterpreter.hs | gpl-3.0 | arrayNew :: Primitive
arrayNew [IntVal n] | n > 0 = return $ ArrayVal(take n $ repeat UndefinedVal) | 99 | arrayNew :: Primitive
arrayNew [IntVal n] | n > 0 = return $ ArrayVal(take n $ repeat UndefinedVal) | 99 | arrayNew [IntVal n] | n > 0 = return $ ArrayVal(take n $ repeat UndefinedVal) | 77 | false | true | 0 | 10 | 17 | 50 | 23 | 27 | null | null |
ml9951/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | moduleName_RDR = varQual_RDR gHC_GENERICS (fsLit "moduleName") | 65 | moduleName_RDR = varQual_RDR gHC_GENERICS (fsLit "moduleName") | 65 | moduleName_RDR = varQual_RDR gHC_GENERICS (fsLit "moduleName") | 65 | false | false | 0 | 7 | 8 | 17 | 8 | 9 | null | null |
andorp/bead | src/Bead/Persistence/SQL/MySQL.hs | bsd-3-clause | -- If a field is created with longtext utf8mb4 modifier, the persist migrates
-- with alter table, it is probably an issue.
migrationCommandExceptions =
[ "ALTER TABLE `assessment` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assessment` CHANGE `eval_config` `eval_config` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assessment` CHANGE `title` `title` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assignment` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assignment` CHANGE `description` `description` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assignment` CHANGE `type` `type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assignment` CHANGE `eval_config` `eval_config` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `comment` CHANGE `text` `text` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `comment` CHANGE `author` `author` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `comment` CHANGE `type` `type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `course` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `course` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `course` CHANGE `test_script_type` `test_script_type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `evaluation` CHANGE `result` `result` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `evaluation` CHANGE `written` `written` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `feedback` CHANGE `info` `info` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `group` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `group` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `notification` CHANGE `message` `message` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `notification` CHANGE `event` `event` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `notification` CHANGE `type` `type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `score` CHANGE `score` `score` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `submission` CHANGE `simple` `simple` longtext character set utf8mb4 collate utf8mb4_unicode_ci NULL"
, "ALTER TABLE `test_case` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_case` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_case` CHANGE `simple_value` `simple_value` longtext character set utf8mb4 collate utf8mb4_unicode_ci NULL"
, "ALTER TABLE `test_case` CHANGE `info` `info` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `notes` `notes` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `script` `script` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `test_script_type` `test_script_type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `role` `role` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `email` `email` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `time_zone` `time_zone` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `language` `language` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `email_notifications` `email_notifications` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user_registration` CHANGE `username` `username` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user_registration` CHANGE `email` `email` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user_registration` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user_registration` CHANGE `token` `token` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
] | 5,257 | migrationCommandExceptions =
[ "ALTER TABLE `assessment` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assessment` CHANGE `eval_config` `eval_config` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assessment` CHANGE `title` `title` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assignment` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assignment` CHANGE `description` `description` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assignment` CHANGE `type` `type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assignment` CHANGE `eval_config` `eval_config` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `comment` CHANGE `text` `text` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `comment` CHANGE `author` `author` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `comment` CHANGE `type` `type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `course` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `course` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `course` CHANGE `test_script_type` `test_script_type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `evaluation` CHANGE `result` `result` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `evaluation` CHANGE `written` `written` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `feedback` CHANGE `info` `info` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `group` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `group` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `notification` CHANGE `message` `message` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `notification` CHANGE `event` `event` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `notification` CHANGE `type` `type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `score` CHANGE `score` `score` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `submission` CHANGE `simple` `simple` longtext character set utf8mb4 collate utf8mb4_unicode_ci NULL"
, "ALTER TABLE `test_case` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_case` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_case` CHANGE `simple_value` `simple_value` longtext character set utf8mb4 collate utf8mb4_unicode_ci NULL"
, "ALTER TABLE `test_case` CHANGE `info` `info` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `notes` `notes` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `script` `script` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `test_script_type` `test_script_type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `role` `role` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `email` `email` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `time_zone` `time_zone` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `language` `language` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `email_notifications` `email_notifications` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user_registration` CHANGE `username` `username` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user_registration` CHANGE `email` `email` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user_registration` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user_registration` CHANGE `token` `token` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
] | 5,133 | migrationCommandExceptions =
[ "ALTER TABLE `assessment` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assessment` CHANGE `eval_config` `eval_config` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assessment` CHANGE `title` `title` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assignment` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assignment` CHANGE `description` `description` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assignment` CHANGE `type` `type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `assignment` CHANGE `eval_config` `eval_config` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `comment` CHANGE `text` `text` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `comment` CHANGE `author` `author` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `comment` CHANGE `type` `type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `course` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `course` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `course` CHANGE `test_script_type` `test_script_type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `evaluation` CHANGE `result` `result` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `evaluation` CHANGE `written` `written` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `feedback` CHANGE `info` `info` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `group` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `group` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `notification` CHANGE `message` `message` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `notification` CHANGE `event` `event` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `notification` CHANGE `type` `type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `score` CHANGE `score` `score` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `submission` CHANGE `simple` `simple` longtext character set utf8mb4 collate utf8mb4_unicode_ci NULL"
, "ALTER TABLE `test_case` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_case` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_case` CHANGE `simple_value` `simple_value` longtext character set utf8mb4 collate utf8mb4_unicode_ci NULL"
, "ALTER TABLE `test_case` CHANGE `info` `info` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `description` `description` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `notes` `notes` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `script` `script` longtext character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `test_script` CHANGE `test_script_type` `test_script_type` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `role` `role` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `email` `email` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `time_zone` `time_zone` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `language` `language` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user` CHANGE `email_notifications` `email_notifications` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user_registration` CHANGE `username` `username` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user_registration` CHANGE `email` `email` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user_registration` CHANGE `name` `name` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
, "ALTER TABLE `user_registration` CHANGE `token` `token` text character set utf8mb4 collate utf8mb4_unicode_ci NOT NULL"
] | 5,133 | true | false | 0 | 5 | 738 | 134 | 89 | 45 | null | null |
mdorman/couch-simple | test/Functionality/Explicit/Database.hs | mit | databaseCreateDoc :: IO Context -> TestTree
databaseCreateDoc =
makeTests "Database create document"
[ withDb $ testAgainstSchema
"Create a document without _id, immediate mode"
(Database.createDoc False (object [("llamas", Bool True)]))
"post--db.json"
, withDb $ testAgainstSchema
"Create a document without _id, batch mode"
(Database.createDoc True (object [("llamas", Bool True)]))
"post--db.json"
, withDb $ testAgainstSchema
"Create a document with _id, immediate mode"
(Database.createDoc False (object [("_id", "foo"), ("llamas", Bool True)]))
"post--db.json"
, withDb $ testAgainstSchema
"Create a document with _id, batch mode"
(Database.createDoc True (object [("_id", "foo"), ("llamas", Bool True)]))
"post--db.json"
, withDb $ testAgainstFailure
"Try to create a document with an invalid name"
(Database.createDoc False (object [("_id", "_111111%%%"), ("llamas", Bool True)]))
(InvalidName "Only reserved document ids may start with underscore.")
, withDb $ testAgainstFailure
"Try to create a document twice"
(\c -> do
_ :: Result Value <- Database.createDoc False (object [("_id", "foo"), ("llamas", Bool True)]) c
Database.createDoc False (object [("_id", "foo"), ("llamas", Bool True)]) c)
Conflict
] | 1,593 | databaseCreateDoc :: IO Context -> TestTree
databaseCreateDoc =
makeTests "Database create document"
[ withDb $ testAgainstSchema
"Create a document without _id, immediate mode"
(Database.createDoc False (object [("llamas", Bool True)]))
"post--db.json"
, withDb $ testAgainstSchema
"Create a document without _id, batch mode"
(Database.createDoc True (object [("llamas", Bool True)]))
"post--db.json"
, withDb $ testAgainstSchema
"Create a document with _id, immediate mode"
(Database.createDoc False (object [("_id", "foo"), ("llamas", Bool True)]))
"post--db.json"
, withDb $ testAgainstSchema
"Create a document with _id, batch mode"
(Database.createDoc True (object [("_id", "foo"), ("llamas", Bool True)]))
"post--db.json"
, withDb $ testAgainstFailure
"Try to create a document with an invalid name"
(Database.createDoc False (object [("_id", "_111111%%%"), ("llamas", Bool True)]))
(InvalidName "Only reserved document ids may start with underscore.")
, withDb $ testAgainstFailure
"Try to create a document twice"
(\c -> do
_ :: Result Value <- Database.createDoc False (object [("_id", "foo"), ("llamas", Bool True)]) c
Database.createDoc False (object [("_id", "foo"), ("llamas", Bool True)]) c)
Conflict
] | 1,593 | databaseCreateDoc =
makeTests "Database create document"
[ withDb $ testAgainstSchema
"Create a document without _id, immediate mode"
(Database.createDoc False (object [("llamas", Bool True)]))
"post--db.json"
, withDb $ testAgainstSchema
"Create a document without _id, batch mode"
(Database.createDoc True (object [("llamas", Bool True)]))
"post--db.json"
, withDb $ testAgainstSchema
"Create a document with _id, immediate mode"
(Database.createDoc False (object [("_id", "foo"), ("llamas", Bool True)]))
"post--db.json"
, withDb $ testAgainstSchema
"Create a document with _id, batch mode"
(Database.createDoc True (object [("_id", "foo"), ("llamas", Bool True)]))
"post--db.json"
, withDb $ testAgainstFailure
"Try to create a document with an invalid name"
(Database.createDoc False (object [("_id", "_111111%%%"), ("llamas", Bool True)]))
(InvalidName "Only reserved document ids may start with underscore.")
, withDb $ testAgainstFailure
"Try to create a document twice"
(\c -> do
_ :: Result Value <- Database.createDoc False (object [("_id", "foo"), ("llamas", Bool True)]) c
Database.createDoc False (object [("_id", "foo"), ("llamas", Bool True)]) c)
Conflict
] | 1,549 | false | true | 0 | 18 | 531 | 378 | 201 | 177 | null | null |
dmitmel/goiteens-hw-in-haskell | Utils/Math/MoreMath/BigInt.hs | apache-2.0 | bitPlus1 :: BitArray -> BitArray
bitPlus1 [] = [b1] | 51 | bitPlus1 :: BitArray -> BitArray
bitPlus1 [] = [b1] | 51 | bitPlus1 [] = [b1] | 18 | false | true | 0 | 6 | 8 | 23 | 12 | 11 | null | null |
bjpop/blip | blipinterpreter/src/Blip/Interpreter/HashTable/CacheLine.hs | bsd-3-clause | deBruijnBitPositions :: U.Vector Int8
deBruijnBitPositions =
U.fromList [
0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
] | 235 | deBruijnBitPositions :: U.Vector Int8
deBruijnBitPositions =
U.fromList [
0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
] | 235 | deBruijnBitPositions =
U.fromList [
0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
] | 197 | false | true | 1 | 6 | 83 | 120 | 74 | 46 | null | null |
brendanhay/gogol | gogol-dlp/gen/Network/Google/DLP/Types/Product.hs | mpl-2.0 | -- | The type of content that might have been found. Provided if
-- \`excluded_types\` is false.
gpdvfInfoType :: Lens' GooglePrivacyDlpV2Finding (Maybe GooglePrivacyDlpV2InfoType)
gpdvfInfoType
= lens _gpdvfInfoType
(\ s a -> s{_gpdvfInfoType = a}) | 257 | gpdvfInfoType :: Lens' GooglePrivacyDlpV2Finding (Maybe GooglePrivacyDlpV2InfoType)
gpdvfInfoType
= lens _gpdvfInfoType
(\ s a -> s{_gpdvfInfoType = a}) | 160 | gpdvfInfoType
= lens _gpdvfInfoType
(\ s a -> s{_gpdvfInfoType = a}) | 76 | true | true | 0 | 9 | 41 | 49 | 26 | 23 | null | null |
konn/refresht | app/Main.hs | bsd-3-clause | conf :: RefreshSetting Int IO
conf = def & isRefreshingError .~ ((== Just RefreshNow) . fromException)
& shouldRefresh .~ const (return False)
& refresher .~ (return . succ)
& refreshDelay .~ (10 ^ 5) | 233 | conf :: RefreshSetting Int IO
conf = def & isRefreshingError .~ ((== Just RefreshNow) . fromException)
& shouldRefresh .~ const (return False)
& refresher .~ (return . succ)
& refreshDelay .~ (10 ^ 5) | 233 | conf = def & isRefreshingError .~ ((== Just RefreshNow) . fromException)
& shouldRefresh .~ const (return False)
& refresher .~ (return . succ)
& refreshDelay .~ (10 ^ 5) | 203 | false | true | 0 | 15 | 66 | 85 | 44 | 41 | null | null |
Philonous/pontarius-xmpp | source/Network/Xmpp/Stream.hs | bsd-3-clause | -- "Borrowed" from base-4.4 for compatibility with GHC 7.0.1.
tryIOError :: IO a -> IO (Either IOError a)
tryIOError f = Ex.catch (Right <$> f) (return . Left) | 159 | tryIOError :: IO a -> IO (Either IOError a)
tryIOError f = Ex.catch (Right <$> f) (return . Left) | 97 | tryIOError f = Ex.catch (Right <$> f) (return . Left) | 53 | true | true | 0 | 8 | 27 | 54 | 27 | 27 | null | null |
ezyang/ghc | libraries/base/Foreign/C/Error.hs | bsd-3-clause | eNOTSOCK = Errno (CONST_ENOTSOCK) | 40 | eNOTSOCK = Errno (CONST_ENOTSOCK) | 40 | eNOTSOCK = Errno (CONST_ENOTSOCK) | 40 | false | false | 0 | 6 | 10 | 12 | 6 | 6 | null | null |
ekmett/models | src/Model/Internal/Util.hs | bsd-2-clause | prefetchMutableByteArray2 (MutableByteArray m) (I# i) = primitive_ $ \s -> prefetchMutableByteArray2# m i s | 107 | prefetchMutableByteArray2 (MutableByteArray m) (I# i) = primitive_ $ \s -> prefetchMutableByteArray2# m i s | 107 | prefetchMutableByteArray2 (MutableByteArray m) (I# i) = primitive_ $ \s -> prefetchMutableByteArray2# m i s | 107 | false | false | 0 | 7 | 13 | 39 | 19 | 20 | null | null |
lally/xmonad-reenberg | XMonad/Operations.hs | bsd-3-clause | reveal :: Window -> X ()
reveal w = withDisplay $ \d -> do
setWMState w normalState
io $ mapWindow d w
whenX (isClient w) $ modify (\s -> s { mapped = S.insert w (mapped s) })
-- | The client events that xmonad is interested in | 240 | reveal :: Window -> X ()
reveal w = withDisplay $ \d -> do
setWMState w normalState
io $ mapWindow d w
whenX (isClient w) $ modify (\s -> s { mapped = S.insert w (mapped s) })
-- | The client events that xmonad is interested in | 240 | reveal w = withDisplay $ \d -> do
setWMState w normalState
io $ mapWindow d w
whenX (isClient w) $ modify (\s -> s { mapped = S.insert w (mapped s) })
-- | The client events that xmonad is interested in | 215 | false | true | 0 | 17 | 60 | 101 | 49 | 52 | null | null |
facebookincubator/duckling | Duckling/Volume/PT/Rules.hs | bsd-3-clause | rulesVolumes :: [Rule]
rulesVolumes = map go volumes
where
go :: (Text, String, TVolume.Unit) -> Rule
go (name, regexPattern, u) = Rule
{ name = name
, pattern =
[ regex regexPattern
]
, prod = \_ -> Just . Token Volume $ unitOnly u
} | 284 | rulesVolumes :: [Rule]
rulesVolumes = map go volumes
where
go :: (Text, String, TVolume.Unit) -> Rule
go (name, regexPattern, u) = Rule
{ name = name
, pattern =
[ regex regexPattern
]
, prod = \_ -> Just . Token Volume $ unitOnly u
} | 284 | rulesVolumes = map go volumes
where
go :: (Text, String, TVolume.Unit) -> Rule
go (name, regexPattern, u) = Rule
{ name = name
, pattern =
[ regex regexPattern
]
, prod = \_ -> Just . Token Volume $ unitOnly u
} | 261 | false | true | 0 | 11 | 95 | 118 | 61 | 57 | null | null |
urbanslug/ghc | compiler/basicTypes/Lexeme.hs | bsd-3-clause | okConSymOcc str = all okSymChar str &&
not (str `Set.member` reservedOps) | 91 | okConSymOcc str = all okSymChar str &&
not (str `Set.member` reservedOps) | 91 | okConSymOcc str = all okSymChar str &&
not (str `Set.member` reservedOps) | 91 | false | false | 0 | 8 | 28 | 32 | 16 | 16 | null | null |
icyfork/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | getAllFlags = getFlagsUntil (== "--") | 37 | getAllFlags = getFlagsUntil (== "--") | 37 | getAllFlags = getFlagsUntil (== "--") | 37 | false | false | 1 | 6 | 4 | 17 | 7 | 10 | null | null |
vikraman/ghc | compiler/basicTypes/Literal.hs | bsd-3-clause | hashLiteral (MachDouble r) = hashRational r | 48 | hashLiteral (MachDouble r) = hashRational r | 48 | hashLiteral (MachDouble r) = hashRational r | 48 | false | false | 0 | 6 | 10 | 19 | 8 | 11 | null | null |
svenssonjoel/Obsidian-Run-CUDA | Obsidian/Run/CUDA/Exec.hs | bsd-3-clause | ---------------------------------------------------------------------------
-- Get a fresh identifier
---------------------------------------------------------------------------
newIdent :: CUDA Int
newIdent =
do
i <- gets csIdent
modify (\s -> s {csIdent = i+1 })
return i
---------------------------------------------------------------------------
-- Context
--------------------------------------------------------------------------- | 452 | newIdent :: CUDA Int
newIdent =
do
i <- gets csIdent
modify (\s -> s {csIdent = i+1 })
return i
---------------------------------------------------------------------------
-- Context
--------------------------------------------------------------------------- | 274 | newIdent =
do
i <- gets csIdent
modify (\s -> s {csIdent = i+1 })
return i
---------------------------------------------------------------------------
-- Context
--------------------------------------------------------------------------- | 253 | true | true | 0 | 12 | 47 | 62 | 33 | 29 | null | null |
apyrgio/ganeti | src/Ganeti/HTools/Tags.hs | bsd-2-clause | autoRepairTagPending :: String
autoRepairTagPending = autoRepairTagPrefix ++ "pending:" | 87 | autoRepairTagPending :: String
autoRepairTagPending = autoRepairTagPrefix ++ "pending:" | 87 | autoRepairTagPending = autoRepairTagPrefix ++ "pending:" | 56 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
rueshyna/gogol | gogol-containerbuilder/gen/Network/Google/ContainerBuilder/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'BuildTrigger' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'btDisabled'
--
-- * 'btTriggerTemplate'
--
-- * 'btBuild'
--
-- * 'btId'
--
-- * 'btDescription'
--
-- * 'btFilename'
--
-- * 'btCreateTime'
buildTrigger
:: BuildTrigger
buildTrigger =
BuildTrigger'
{ _btDisabled = Nothing
, _btTriggerTemplate = Nothing
, _btBuild = Nothing
, _btId = Nothing
, _btDescription = Nothing
, _btFilename = Nothing
, _btCreateTime = Nothing
} | 584 | buildTrigger
:: BuildTrigger
buildTrigger =
BuildTrigger'
{ _btDisabled = Nothing
, _btTriggerTemplate = Nothing
, _btBuild = Nothing
, _btId = Nothing
, _btDescription = Nothing
, _btFilename = Nothing
, _btCreateTime = Nothing
} | 270 | buildTrigger =
BuildTrigger'
{ _btDisabled = Nothing
, _btTriggerTemplate = Nothing
, _btBuild = Nothing
, _btId = Nothing
, _btDescription = Nothing
, _btFilename = Nothing
, _btCreateTime = Nothing
} | 237 | true | true | 0 | 7 | 132 | 82 | 54 | 28 | null | null |
zxl20zxl/learnyouahaskell | Functors-Applicative-Functors-and-Monoids.hs | mit | fmap f (Pair (x,y)) = Pair (f x, y) | 35 | fmap f (Pair (x,y)) = Pair (f x, y) | 35 | fmap f (Pair (x,y)) = Pair (f x, y) | 35 | false | false | 0 | 7 | 8 | 37 | 18 | 19 | null | null |
mgold/Elm | src/Canonicalize/Type.hs | bsd-3-clause | tipe :: Env.Environment -> T.Raw -> Result T.Canonical
tipe env annType@(A.A _ typ) =
let
go =
tipe env
goSnd (name,t) =
(,) name <$> go t
in
case typ of
T.RVar x ->
Result.ok (T.Var x)
T.RType _ ->
canonicalizeApp env annType []
T.RApp t ts ->
canonicalizeApp env t ts
T.RLambda a b ->
T.Lambda <$> go a <*> go b
T.RRecord fields ext ->
T.Record <$> Trav.traverse goSnd fields <*> Trav.traverse go ext | 515 | tipe :: Env.Environment -> T.Raw -> Result T.Canonical
tipe env annType@(A.A _ typ) =
let
go =
tipe env
goSnd (name,t) =
(,) name <$> go t
in
case typ of
T.RVar x ->
Result.ok (T.Var x)
T.RType _ ->
canonicalizeApp env annType []
T.RApp t ts ->
canonicalizeApp env t ts
T.RLambda a b ->
T.Lambda <$> go a <*> go b
T.RRecord fields ext ->
T.Record <$> Trav.traverse goSnd fields <*> Trav.traverse go ext | 515 | tipe env annType@(A.A _ typ) =
let
go =
tipe env
goSnd (name,t) =
(,) name <$> go t
in
case typ of
T.RVar x ->
Result.ok (T.Var x)
T.RType _ ->
canonicalizeApp env annType []
T.RApp t ts ->
canonicalizeApp env t ts
T.RLambda a b ->
T.Lambda <$> go a <*> go b
T.RRecord fields ext ->
T.Record <$> Trav.traverse goSnd fields <*> Trav.traverse go ext | 460 | false | true | 1 | 13 | 188 | 230 | 105 | 125 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Yaml.hs | gpl-2.0 | -- | Highlight source code using this syntax definition.
highlight :: String -> [SourceLine]
highlight input = evalState (mapM parseSourceLine $ lines input) startingState | 171 | highlight :: String -> [SourceLine]
highlight input = evalState (mapM parseSourceLine $ lines input) startingState | 114 | highlight input = evalState (mapM parseSourceLine $ lines input) startingState | 78 | true | true | 0 | 8 | 23 | 45 | 21 | 24 | null | null |
zmthy/snaplet-rest | src/Snap/Snaplet/Rest/Serve.hs | mit | ------------------------------------------------------------------------------
-- | Routes to 'createResource' if there is no remaining path information,
-- otherwise indicates that POST is not allowed directly on a resource.
handlePost
:: MonadSnap m
=> Resource res m id diff -> ResourceConfig m -> (res -> m ()) -> m ()
handlePost res cfg create' =
ifTop (createResource res cfg create') <|> methodFailure res cfg | 428 | handlePost
:: MonadSnap m
=> Resource res m id diff -> ResourceConfig m -> (res -> m ()) -> m ()
handlePost res cfg create' =
ifTop (createResource res cfg create') <|> methodFailure res cfg | 202 | handlePost res cfg create' =
ifTop (createResource res cfg create') <|> methodFailure res cfg | 97 | true | true | 0 | 13 | 71 | 95 | 45 | 50 | null | null |
gridaphobe/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | isWantedCt :: Ct -> Bool
isWantedCt = isWanted . cc_ev | 54 | isWantedCt :: Ct -> Bool
isWantedCt = isWanted . cc_ev | 54 | isWantedCt = isWanted . cc_ev | 29 | false | true | 0 | 5 | 9 | 19 | 10 | 9 | null | null |
ierton/yteratee | src/Data/Yteratee/Base.hs | bsd-3-clause | -- | Same as @join@ but iteratee passed in in monadic way
joinI :: (Monad m) => Yteratee s m (Yteratee s m a) -> Yteratee s m a
joinI = (>>= join) | 146 | joinI :: (Monad m) => Yteratee s m (Yteratee s m a) -> Yteratee s m a
joinI = (>>= join) | 88 | joinI = (>>= join) | 18 | true | true | 0 | 9 | 32 | 53 | 28 | 25 | null | null |
Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Graphics/Geometry.hs | mit | geometrySetLodDistance :: (Parent Geometry a, Pointer p a, MonadIO m)
=> p -- ^ Pointer to Geometry or ascentor
-> Float -- ^ distance
-> m ()
geometrySetLodDistance p d = liftIO $ do
let ptr = parentPointer p
d' = realToFrac d
[C.exp| void {$(Geometry* ptr)->SetLodDistance($(float d'))} |]
-- void SetLodDistance(float distance);
-- | Override raw vertex data to be returned for CPU-side operations. | 418 | geometrySetLodDistance :: (Parent Geometry a, Pointer p a, MonadIO m)
=> p -- ^ Pointer to Geometry or ascentor
-> Float -- ^ distance
-> m ()
geometrySetLodDistance p d = liftIO $ do
let ptr = parentPointer p
d' = realToFrac d
[C.exp| void {$(Geometry* ptr)->SetLodDistance($(float d'))} |]
-- void SetLodDistance(float distance);
-- | Override raw vertex data to be returned for CPU-side operations. | 418 | geometrySetLodDistance p d = liftIO $ do
let ptr = parentPointer p
d' = realToFrac d
[C.exp| void {$(Geometry* ptr)->SetLodDistance($(float d'))} |]
-- void SetLodDistance(float distance);
-- | Override raw vertex data to be returned for CPU-side operations. | 269 | false | true | 0 | 11 | 81 | 92 | 48 | 44 | null | null |
poxu/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | cedilla 'h' = "ḩ" | 17 | cedilla 'h' = "ḩ" | 17 | cedilla 'h' = "ḩ" | 17 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
candidtim/euler | src/Problem17.hs | bsd-3-clause | spellNumber 50 = "fifty" | 24 | spellNumber 50 = "fifty" | 24 | spellNumber 50 = "fifty" | 24 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
haskell-distributed/network-transport-cci | src/Network/Transport/CCI.hs | bsd-3-clause | returnBuffer :: CCITransport -> EndPoint -> ByteString -> IO ()
returnBuffer t e bs = do
les <- readMVar (cciLocalEndpoints t)
case Map.lookup (address e) les of
Just ep -> do
mbuf <- unsafeUseAsCString bs $ flip Pool.lookupBuffer (cciPool ep)
case mbuf of
Just buf -> Pool.freeBuffer (cciPool ep) buf
Nothing -> return () -- The buffer was not in the pool.
Nothing -> error "returnBuffer: unknown endpoint"
-- | Converts an endpoint-pool-buffer into a normal buffer.
--
-- Buffers from the pool of buffers are more expensive than normal buffers
-- because they are registered for RMA operations. This means that the
-- buffer cannot be swapped to disk and is registered with the hardware for
-- DMA.
--
-- This calls unregisters the buffer therefore making the physical memory
-- and the network hardware resources available for some other purpose.
-- Aftewards, using this buffer for sending messages is as expensive as sending
-- any other buffer.
--
-- It does nothing if the buffer does not belong to the pool of the endpoint.
-- | 1,085 | returnBuffer :: CCITransport -> EndPoint -> ByteString -> IO ()
returnBuffer t e bs = do
les <- readMVar (cciLocalEndpoints t)
case Map.lookup (address e) les of
Just ep -> do
mbuf <- unsafeUseAsCString bs $ flip Pool.lookupBuffer (cciPool ep)
case mbuf of
Just buf -> Pool.freeBuffer (cciPool ep) buf
Nothing -> return () -- The buffer was not in the pool.
Nothing -> error "returnBuffer: unknown endpoint"
-- | Converts an endpoint-pool-buffer into a normal buffer.
--
-- Buffers from the pool of buffers are more expensive than normal buffers
-- because they are registered for RMA operations. This means that the
-- buffer cannot be swapped to disk and is registered with the hardware for
-- DMA.
--
-- This calls unregisters the buffer therefore making the physical memory
-- and the network hardware resources available for some other purpose.
-- Aftewards, using this buffer for sending messages is as expensive as sending
-- any other buffer.
--
-- It does nothing if the buffer does not belong to the pool of the endpoint.
-- | 1,085 | returnBuffer t e bs = do
les <- readMVar (cciLocalEndpoints t)
case Map.lookup (address e) les of
Just ep -> do
mbuf <- unsafeUseAsCString bs $ flip Pool.lookupBuffer (cciPool ep)
case mbuf of
Just buf -> Pool.freeBuffer (cciPool ep) buf
Nothing -> return () -- The buffer was not in the pool.
Nothing -> error "returnBuffer: unknown endpoint"
-- | Converts an endpoint-pool-buffer into a normal buffer.
--
-- Buffers from the pool of buffers are more expensive than normal buffers
-- because they are registered for RMA operations. This means that the
-- buffer cannot be swapped to disk and is registered with the hardware for
-- DMA.
--
-- This calls unregisters the buffer therefore making the physical memory
-- and the network hardware resources available for some other purpose.
-- Aftewards, using this buffer for sending messages is as expensive as sending
-- any other buffer.
--
-- It does nothing if the buffer does not belong to the pool of the endpoint.
-- | 1,021 | false | true | 0 | 17 | 227 | 171 | 86 | 85 | null | null |
noteed/mojito | Language/Mojito/Inference/Substitution.hs | bsd-3-clause | tv' :: Context -> [String]
tv' g = nub $ concatMap (tv . snd) (ctxAssoc g) | 74 | tv' :: Context -> [String]
tv' g = nub $ concatMap (tv . snd) (ctxAssoc g) | 74 | tv' g = nub $ concatMap (tv . snd) (ctxAssoc g) | 47 | false | true | 2 | 8 | 15 | 51 | 23 | 28 | null | null |
danr/genifunctors | Data/Generics/Genifunctors.hs | bsd-3-clause | traversePrimitive :: Exp -> Exp
traversePrimitive e = VarE 'pure `AppE` e | 73 | traversePrimitive :: Exp -> Exp
traversePrimitive e = VarE 'pure `AppE` e | 73 | traversePrimitive e = VarE 'pure `AppE` e | 41 | false | true | 0 | 6 | 11 | 28 | 15 | 13 | null | null |
laanwj/Purecoin | Purecoin/PSQueue.hs | mit | lbalanceLeft k p l m r
| size' (left r) < size' (right r) = lsingleLeft k p l m r
| otherwise = ldoubleLeft k p l m r | 145 | lbalanceLeft k p l m r
| size' (left r) < size' (right r) = lsingleLeft k p l m r
| otherwise = ldoubleLeft k p l m r | 145 | lbalanceLeft k p l m r
| size' (left r) < size' (right r) = lsingleLeft k p l m r
| otherwise = ldoubleLeft k p l m r | 145 | false | false | 1 | 11 | 57 | 74 | 34 | 40 | null | null |
sdiehl/repline | examples/Prefix.hs | mit | inits :: Repl ()
inits = return () | 34 | inits :: Repl ()
inits = return () | 34 | inits = return () | 17 | false | true | 0 | 6 | 7 | 21 | 10 | 11 | null | null |
Ming-Tang/FP15 | src/FP15/Evaluator/Error.hs | mit | markStackFrame s = (`catchError` rethrowWithExtendedStackTrace)
where rethrowWithExtendedStackTrace = throwError . pushStackTrace s | 133 | markStackFrame s = (`catchError` rethrowWithExtendedStackTrace)
where rethrowWithExtendedStackTrace = throwError . pushStackTrace s | 133 | markStackFrame s = (`catchError` rethrowWithExtendedStackTrace)
where rethrowWithExtendedStackTrace = throwError . pushStackTrace s | 133 | false | false | 0 | 6 | 13 | 30 | 16 | 14 | null | null |
databrary/databrary | src/Model/Tag/Types.hs | agpl-3.0 | validateTag :: BS.ByteString -> Maybe TagName
validateTag t = Regex.matchTest validTag tt `thenUse` TagName tt where
tt = BSC.map toLower $ BSC.unwords $ BSC.words t | 167 | validateTag :: BS.ByteString -> Maybe TagName
validateTag t = Regex.matchTest validTag tt `thenUse` TagName tt where
tt = BSC.map toLower $ BSC.unwords $ BSC.words t | 167 | validateTag t = Regex.matchTest validTag tt `thenUse` TagName tt where
tt = BSC.map toLower $ BSC.unwords $ BSC.words t | 121 | false | true | 0 | 10 | 26 | 70 | 33 | 37 | null | null |
jjwchoy/hotdb | src/HotDB/Core/Commit.hs | mit | serialize' :: Commit -> LB.ByteString
serialize' commit = A.encode commit | 73 | serialize' :: Commit -> LB.ByteString
serialize' commit = A.encode commit | 73 | serialize' commit = A.encode commit | 35 | false | true | 0 | 8 | 9 | 31 | 13 | 18 | null | null |
Melvar/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | eInfoNames :: ElabInfo -> [Name]
eInfoNames info = map fst (params info) ++ M.keys (inblock info) | 97 | eInfoNames :: ElabInfo -> [Name]
eInfoNames info = map fst (params info) ++ M.keys (inblock info) | 97 | eInfoNames info = map fst (params info) ++ M.keys (inblock info) | 64 | false | true | 0 | 8 | 15 | 53 | 24 | 29 | null | null |
Oblosys/webviews | src/lib/Xprez.hs | mit | testAlign = row [ letter 100, vAlign Top $ letter 10, vAlign Middle $ letter 10, vAlign Bottom $ letter 10 ] | 108 | testAlign = row [ letter 100, vAlign Top $ letter 10, vAlign Middle $ letter 10, vAlign Bottom $ letter 10 ] | 108 | testAlign = row [ letter 100, vAlign Top $ letter 10, vAlign Middle $ letter 10, vAlign Bottom $ letter 10 ] | 108 | false | false | 1 | 8 | 21 | 58 | 25 | 33 | null | null |
mettekou/ghc | compiler/cmm/CmmNode.hs | bsd-3-clause | foldExpDeep :: (CmmExpr -> z -> z) -> CmmNode e x -> z -> z
foldExpDeep f = foldExp (wrapRecExpf f) | 99 | foldExpDeep :: (CmmExpr -> z -> z) -> CmmNode e x -> z -> z
foldExpDeep f = foldExp (wrapRecExpf f) | 99 | foldExpDeep f = foldExp (wrapRecExpf f) | 39 | false | true | 0 | 9 | 20 | 57 | 26 | 31 | null | null |
binesiyu/ifl | examples/ch15/HandleIO.hs | mit | {-- /snippet actions --}
{-- snippet safeHello --}
safeHello :: FilePath -> HandleIO ()
safeHello path = do
h <- openFile path WriteMode
hPutStrLn h "hello world"
hClose h
{-- /snippet safeHello --}
{-- snippet tidyHello --} | 232 | safeHello :: FilePath -> HandleIO ()
safeHello path = do
h <- openFile path WriteMode
hPutStrLn h "hello world"
hClose h
{-- /snippet safeHello --}
{-- snippet tidyHello --} | 180 | safeHello path = do
h <- openFile path WriteMode
hPutStrLn h "hello world"
hClose h
{-- /snippet safeHello --}
{-- snippet tidyHello --} | 143 | true | true | 0 | 9 | 44 | 58 | 26 | 32 | null | null |
markborkum/json2rdf-hs | src/JSON2RDF/Parser/Text.hs | unlicense | expr' :: P.Parser Expression
expr' = do
void $ option mempty (P.string (T.pack "#!") *> manyTill P.anyChar (P.try P.endOfLine))
ws_
expr <- prelude_
ws_
exprs <- sepBy expr_ ws_
ws_
P.endOfInput
return (expr `mappend` mconcat exprs)
--------------------------------------------------------------------------------- | 331 | expr' :: P.Parser Expression
expr' = do
void $ option mempty (P.string (T.pack "#!") *> manyTill P.anyChar (P.try P.endOfLine))
ws_
expr <- prelude_
ws_
exprs <- sepBy expr_ ws_
ws_
P.endOfInput
return (expr `mappend` mconcat exprs)
--------------------------------------------------------------------------------- | 331 | expr' = do
void $ option mempty (P.string (T.pack "#!") *> manyTill P.anyChar (P.try P.endOfLine))
ws_
expr <- prelude_
ws_
exprs <- sepBy expr_ ws_
ws_
P.endOfInput
return (expr `mappend` mconcat exprs)
--------------------------------------------------------------------------------- | 302 | false | true | 0 | 14 | 53 | 117 | 54 | 63 | null | null |
hackern/network-transport-ivc | tests/Process/Node.hs | mit | main :: IO ()
main = do
xs <- initXenStore
Right t <- createTransport xs
node <- newLocalNode t initRemoteTable
runProcess node $ do
self <- getSelfPid
send self "hello, world"
hello <- expect :: Process String
liftIO $ writeDebugConsole (hello ++ "\n") | 278 | main :: IO ()
main = do
xs <- initXenStore
Right t <- createTransport xs
node <- newLocalNode t initRemoteTable
runProcess node $ do
self <- getSelfPid
send self "hello, world"
hello <- expect :: Process String
liftIO $ writeDebugConsole (hello ++ "\n") | 278 | main = do
xs <- initXenStore
Right t <- createTransport xs
node <- newLocalNode t initRemoteTable
runProcess node $ do
self <- getSelfPid
send self "hello, world"
hello <- expect :: Process String
liftIO $ writeDebugConsole (hello ++ "\n") | 264 | false | true | 0 | 14 | 67 | 109 | 46 | 63 | null | null |
frublox/aichanbot | src/Bot/Conduit.hs | bsd-3-clause | clientLogger :: MonadLogger m => ConduitT Text Text m ()
clientLogger = Conduit.awaitForever $ \msg -> do
unless (Text.take 4 msg == "PASS") $
logInfoN ("<-- " <> msg)
Conduit.yield msg | 201 | clientLogger :: MonadLogger m => ConduitT Text Text m ()
clientLogger = Conduit.awaitForever $ \msg -> do
unless (Text.take 4 msg == "PASS") $
logInfoN ("<-- " <> msg)
Conduit.yield msg | 201 | clientLogger = Conduit.awaitForever $ \msg -> do
unless (Text.take 4 msg == "PASS") $
logInfoN ("<-- " <> msg)
Conduit.yield msg | 144 | false | true | 2 | 14 | 46 | 89 | 40 | 49 | null | null |
caasi/spj-book-student-1992 | src/GmState.hs | bsd-3-clause | runProg :: String -> String
runProg = showResults . eval . compile . parse | 74 | runProg :: String -> String
runProg = showResults . eval . compile . parse | 74 | runProg = showResults . eval . compile . parse | 46 | false | true | 0 | 7 | 13 | 27 | 14 | 13 | null | null |
DaMSL/K3 | src/Language/K3/Parser/DataTypes.hs | apache-2.0 | modifyBuilderDeclsF_ :: ([K3 Declaration] -> Either String [K3 Declaration]) -> K3Parser ()
modifyBuilderDeclsF_ f = modifyBuilderDeclsF $ (>>= Right . (,())) . f | 162 | modifyBuilderDeclsF_ :: ([K3 Declaration] -> Either String [K3 Declaration]) -> K3Parser ()
modifyBuilderDeclsF_ f = modifyBuilderDeclsF $ (>>= Right . (,())) . f | 162 | modifyBuilderDeclsF_ f = modifyBuilderDeclsF $ (>>= Right . (,())) . f | 70 | false | true | 0 | 11 | 22 | 74 | 37 | 37 | null | null |
haskoin/hx | Utils.hs | gpl-3.0 | putLn :: (IsString s, Monoid s) => s -> s
putLn = (<> "\n") | 59 | putLn :: (IsString s, Monoid s) => s -> s
putLn = (<> "\n") | 59 | putLn = (<> "\n") | 17 | false | true | 0 | 8 | 13 | 41 | 20 | 21 | null | null |
eklavya/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | intTyWidth ITNative = 8 * sizeOf (0 :: Int) | 43 | intTyWidth ITNative = 8 * sizeOf (0 :: Int) | 43 | intTyWidth ITNative = 8 * sizeOf (0 :: Int) | 43 | false | false | 0 | 7 | 8 | 22 | 11 | 11 | null | null |
sinelaw/stack | src/Stack/Types/Config.hs | bsd-3-clause | ghcVariantName GHCIntegerSimple = "integersimple" | 49 | ghcVariantName GHCIntegerSimple = "integersimple" | 49 | ghcVariantName GHCIntegerSimple = "integersimple" | 49 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
kiripon/gh-pages | css/syntax.hs | bsd-3-clause | codeCss :: Css
codeCss = pre ? do
margin 0 10 0 $ px 10
padding 9 9 9 $ px 9
backgroundColor "#FDF6E3"
border solid (px 1) (rgba 0 0 0 128)
fontSize $ px 14
borderRadius 5 5 5 $ px 5
textRendering optimizeLegibility
whiteSpace preWrap
code ? do
borderStyle none
display block
boxShadow none none none none
fontFamily ["Hasklig", "Monaco", "Menlo"
, "Consolas", "Courier New"] [monospace]
-- overflowWrap :: Val a => Key a -> a -> Css
-- overflowWrap = CC.key | 508 | codeCss :: Css
codeCss = pre ? do
margin 0 10 0 $ px 10
padding 9 9 9 $ px 9
backgroundColor "#FDF6E3"
border solid (px 1) (rgba 0 0 0 128)
fontSize $ px 14
borderRadius 5 5 5 $ px 5
textRendering optimizeLegibility
whiteSpace preWrap
code ? do
borderStyle none
display block
boxShadow none none none none
fontFamily ["Hasklig", "Monaco", "Menlo"
, "Consolas", "Courier New"] [monospace]
-- overflowWrap :: Val a => Key a -> a -> Css
-- overflowWrap = CC.key | 508 | codeCss = pre ? do
margin 0 10 0 $ px 10
padding 9 9 9 $ px 9
backgroundColor "#FDF6E3"
border solid (px 1) (rgba 0 0 0 128)
fontSize $ px 14
borderRadius 5 5 5 $ px 5
textRendering optimizeLegibility
whiteSpace preWrap
code ? do
borderStyle none
display block
boxShadow none none none none
fontFamily ["Hasklig", "Monaco", "Menlo"
, "Consolas", "Courier New"] [monospace]
-- overflowWrap :: Val a => Key a -> a -> Css
-- overflowWrap = CC.key | 493 | false | true | 0 | 12 | 134 | 181 | 81 | 100 | null | null |
koengit/cyphy | src/Avoidance.hs | mit | prop_Avoidance (Plane anglea0 (xa0,ya0), Plane angleb0 (xb0,yb0)) =
whenFail (plot "airplane" n
[ ("A", (xa,ya))
, ("B", (xb,yb))
, ("C", (xc,yc))
]) $
for 100 (nt avoid) ==>
for n (nt collision)
where
n = 10000
(xa,ya) = airplane anglea0 (xa0,ya0) avoid
(xb,yb) = airplane angleb0 (xb0,yb0) avoid
distance = sqrt ((xa-xb)^2 + (ya-yb)^2)
avoid = val False |-> (distance <=? 150)
collision = distance <=? 5
xc = [ (xa+xb) / 2 | (c,(xa,xb)) <- take n collision `zip` (xa `zip` xb), c ]
yc = [ (ya+yb) / 2 | (c,(ya,yb)) <- take n collision `zip` (ya `zip` yb), c ] | 639 | prop_Avoidance (Plane anglea0 (xa0,ya0), Plane angleb0 (xb0,yb0)) =
whenFail (plot "airplane" n
[ ("A", (xa,ya))
, ("B", (xb,yb))
, ("C", (xc,yc))
]) $
for 100 (nt avoid) ==>
for n (nt collision)
where
n = 10000
(xa,ya) = airplane anglea0 (xa0,ya0) avoid
(xb,yb) = airplane angleb0 (xb0,yb0) avoid
distance = sqrt ((xa-xb)^2 + (ya-yb)^2)
avoid = val False |-> (distance <=? 150)
collision = distance <=? 5
xc = [ (xa+xb) / 2 | (c,(xa,xb)) <- take n collision `zip` (xa `zip` xb), c ]
yc = [ (ya+yb) / 2 | (c,(ya,yb)) <- take n collision `zip` (ya `zip` yb), c ] | 639 | prop_Avoidance (Plane anglea0 (xa0,ya0), Plane angleb0 (xb0,yb0)) =
whenFail (plot "airplane" n
[ ("A", (xa,ya))
, ("B", (xb,yb))
, ("C", (xc,yc))
]) $
for 100 (nt avoid) ==>
for n (nt collision)
where
n = 10000
(xa,ya) = airplane anglea0 (xa0,ya0) avoid
(xb,yb) = airplane angleb0 (xb0,yb0) avoid
distance = sqrt ((xa-xb)^2 + (ya-yb)^2)
avoid = val False |-> (distance <=? 150)
collision = distance <=? 5
xc = [ (xa+xb) / 2 | (c,(xa,xb)) <- take n collision `zip` (xa `zip` xb), c ]
yc = [ (ya+yb) / 2 | (c,(ya,yb)) <- take n collision `zip` (ya `zip` yb), c ] | 639 | false | false | 12 | 13 | 180 | 376 | 209 | 167 | null | null |
mbelicki/valdemar | src/TypeChecker.hs | gpl-3.0 | findInScope :: (Scope -> [(S.Name, a)]) -> Scope -> S.Name -> Maybe (S.Name, a)
findInScope getter scope name
= if Maybe.isJust maybeDecl then maybeDecl else maybeParentDecl
where
maybeParent = scopeParent scope
decls = getter scope
maybeDecl = List.find (\(n, _) -> n == name) decls
maybeParentDecl = maybeParent >>= (\s -> findInScope getter s name)
-- cheker state operations: | 441 | findInScope :: (Scope -> [(S.Name, a)]) -> Scope -> S.Name -> Maybe (S.Name, a)
findInScope getter scope name
= if Maybe.isJust maybeDecl then maybeDecl else maybeParentDecl
where
maybeParent = scopeParent scope
decls = getter scope
maybeDecl = List.find (\(n, _) -> n == name) decls
maybeParentDecl = maybeParent >>= (\s -> findInScope getter s name)
-- cheker state operations: | 441 | findInScope getter scope name
= if Maybe.isJust maybeDecl then maybeDecl else maybeParentDecl
where
maybeParent = scopeParent scope
decls = getter scope
maybeDecl = List.find (\(n, _) -> n == name) decls
maybeParentDecl = maybeParent >>= (\s -> findInScope getter s name)
-- cheker state operations: | 361 | false | true | 0 | 10 | 120 | 147 | 80 | 67 | null | null |
markus-git/imperative-edsl-vhdl | src/Language/Embedded/Hardware/Command/Frontend.hs | bsd-3-clause | --------------------------------------------------------------------------------
exactOutput :: (pred a, Integral a, PrimType a)
=> String
-> (Signal a -> Sig instr exp pred m b)
-> Sig instr exp pred m (Signal a -> b)
exactOutput n = SSig (Exact n) Out | 260 | exactOutput :: (pred a, Integral a, PrimType a)
=> String
-> (Signal a -> Sig instr exp pred m b)
-> Sig instr exp pred m (Signal a -> b)
exactOutput n = SSig (Exact n) Out | 178 | exactOutput n = SSig (Exact n) Out | 34 | true | true | 0 | 12 | 44 | 103 | 49 | 54 | null | null |
raptros/chatless-hs | src/Api/Ops/Topic/Ops.hs | bsd-3-clause | changeInfo :: (MonadChatless m, MonadBaseControl IO m) => Ur.User -> Tp.Topic -> StorableJson -> m TopicOpResult
changeInfo caller topic newInfo = tryTopicOp $ operateTopicIfChanged caller topic SetInfo Msg.MsgInfoChanged (Tp.topicInfo topic) newInfo go
where
go = Gh.update [Tp.TopicInfoField Gh.=. newInfo] $ Tp.TopicCoord Gh.==. Tp.getRefFromTopic topic | 364 | changeInfo :: (MonadChatless m, MonadBaseControl IO m) => Ur.User -> Tp.Topic -> StorableJson -> m TopicOpResult
changeInfo caller topic newInfo = tryTopicOp $ operateTopicIfChanged caller topic SetInfo Msg.MsgInfoChanged (Tp.topicInfo topic) newInfo go
where
go = Gh.update [Tp.TopicInfoField Gh.=. newInfo] $ Tp.TopicCoord Gh.==. Tp.getRefFromTopic topic | 364 | changeInfo caller topic newInfo = tryTopicOp $ operateTopicIfChanged caller topic SetInfo Msg.MsgInfoChanged (Tp.topicInfo topic) newInfo go
where
go = Gh.update [Tp.TopicInfoField Gh.=. newInfo] $ Tp.TopicCoord Gh.==. Tp.getRefFromTopic topic | 251 | false | true | 0 | 12 | 51 | 123 | 61 | 62 | null | null |
unisonweb/platform | parser-typechecker/src/Unison/Builtin.hs | mit | failure :: Var v => Type v
failure = DD.failureType () | 54 | failure :: Var v => Type v
failure = DD.failureType () | 54 | failure = DD.failureType () | 27 | false | true | 0 | 7 | 10 | 33 | 14 | 19 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/types/OptCoercion.hs | bsd-3-clause | opt_co4 env sym rep r (AppCo co1 co2) = mkAppCo (opt_co4 env sym rep r co1)
(opt_co4 env sym False Nominal co2) | 159 | opt_co4 env sym rep r (AppCo co1 co2) = mkAppCo (opt_co4 env sym rep r co1)
(opt_co4 env sym False Nominal co2) | 159 | opt_co4 env sym rep r (AppCo co1 co2) = mkAppCo (opt_co4 env sym rep r co1)
(opt_co4 env sym False Nominal co2) | 159 | false | false | 0 | 7 | 69 | 58 | 28 | 30 | null | null |
kaizhang/igraph | Data/IGraph.hs | bsd-3-clause | roundMaybe :: Double -> Maybe Int
roundMaybe d = if d == 1/0 then Nothing else Just (round d) | 93 | roundMaybe :: Double -> Maybe Int
roundMaybe d = if d == 1/0 then Nothing else Just (round d) | 93 | roundMaybe d = if d == 1/0 then Nothing else Just (round d) | 59 | false | true | 0 | 8 | 18 | 46 | 23 | 23 | null | null |
vdweegen/UvA-Software_Testing | Lab6/Jordan/Lecture6.hs | gpl-3.0 | coprimes :: [(Integer,Integer)]
coprimes = filter (uncurry coprime) pairs | 73 | coprimes :: [(Integer,Integer)]
coprimes = filter (uncurry coprime) pairs | 73 | coprimes = filter (uncurry coprime) pairs | 41 | false | true | 0 | 7 | 8 | 31 | 17 | 14 | null | null |
nevrenato/Hets_Fork | CASL/RunStaticAna.hs | gpl-2.0 | localAna :: GlobalAnnos -> BASIC_SPEC () () () -> Result (Sign () ())
localAna ga bs =
let Result ds ms =
basicCASLAnalysis (bs, emptySign () , ga)
es = filter ((<= Error) . diagKind) ds
in case ms of
Just (_newBs, ExtSign accSig _, _sents) -> Result es $ Just accSig
Nothing -> Result ds Nothing | 350 | localAna :: GlobalAnnos -> BASIC_SPEC () () () -> Result (Sign () ())
localAna ga bs =
let Result ds ms =
basicCASLAnalysis (bs, emptySign () , ga)
es = filter ((<= Error) . diagKind) ds
in case ms of
Just (_newBs, ExtSign accSig _, _sents) -> Result es $ Just accSig
Nothing -> Result ds Nothing | 350 | localAna ga bs =
let Result ds ms =
basicCASLAnalysis (bs, emptySign () , ga)
es = filter ((<= Error) . diagKind) ds
in case ms of
Just (_newBs, ExtSign accSig _, _sents) -> Result es $ Just accSig
Nothing -> Result ds Nothing | 280 | false | true | 0 | 12 | 110 | 155 | 76 | 79 | null | null |
z0isch/lambda-hive | src/LambdaHive/Types.hs | bsd-3-clause | getHivePieceFromCannonicalId :: GameState -> CannonicalId -> HivePiece
getHivePieceFromCannonicalId gs cId = bsCoords bs Map.! pieceCoord
where
bs = gsBoard gs
pieceCoord = bsCannonicalIdMap bs Bimap.! cId | 215 | getHivePieceFromCannonicalId :: GameState -> CannonicalId -> HivePiece
getHivePieceFromCannonicalId gs cId = bsCoords bs Map.! pieceCoord
where
bs = gsBoard gs
pieceCoord = bsCannonicalIdMap bs Bimap.! cId | 215 | getHivePieceFromCannonicalId gs cId = bsCoords bs Map.! pieceCoord
where
bs = gsBoard gs
pieceCoord = bsCannonicalIdMap bs Bimap.! cId | 144 | false | true | 0 | 6 | 35 | 58 | 28 | 30 | null | null |
sethfowler/pygmalion | src/Pygmalion/Index/Command.hs | bsd-3-clause | filterArgs ("-MF" : _ : as) = filterArgs as | 43 | filterArgs ("-MF" : _ : as) = filterArgs as | 43 | filterArgs ("-MF" : _ : as) = filterArgs as | 43 | false | false | 0 | 8 | 8 | 23 | 11 | 12 | null | null |
uuhan/Idris-dev | src/Idris/CaseSplit.hs | bsd-3-clause | splitOnLine :: Int -- ^ line number
-> Name -- ^ variable
-> FilePath -- ^ name of file
-> Idris (Bool, [[(Name, PTerm)]])
splitOnLine l n fn = do
cl <- getInternalApp fn l
logElab 3 ("Working with " ++ showTmImpls cl)
tms <- split n cl
return tms | 317 | splitOnLine :: Int -- ^ line number
-> Name -- ^ variable
-> FilePath -- ^ name of file
-> Idris (Bool, [[(Name, PTerm)]])
splitOnLine l n fn = do
cl <- getInternalApp fn l
logElab 3 ("Working with " ++ showTmImpls cl)
tms <- split n cl
return tms | 317 | splitOnLine l n fn = do
cl <- getInternalApp fn l
logElab 3 ("Working with " ++ showTmImpls cl)
tms <- split n cl
return tms | 140 | false | true | 0 | 13 | 119 | 107 | 52 | 55 | null | null |
glguy/linux-capabilities | System/Posix/Cap.hs | bsd-3-clause | withCapPtr :: Cap -> (CapPtr -> IO a) -> IO a
withCapPtr (Cap fp) = withForeignPtr fp | 85 | withCapPtr :: Cap -> (CapPtr -> IO a) -> IO a
withCapPtr (Cap fp) = withForeignPtr fp | 85 | withCapPtr (Cap fp) = withForeignPtr fp | 39 | false | true | 0 | 10 | 16 | 48 | 22 | 26 | null | null |
hesiod/OpenGL | src/Graphics/Rendering/OpenGL/GL/PixelRectangles/Minmax.hs | bsd-3-clause | setMinmax :: (PixelInternalFormat, Sink) -> IO ()
setMinmax (int, sink) =
glMinmax
(marshalMinmaxTarget Minmax)
(marshalPixelInternalFormat' int)
(marshalSink sink) | 185 | setMinmax :: (PixelInternalFormat, Sink) -> IO ()
setMinmax (int, sink) =
glMinmax
(marshalMinmaxTarget Minmax)
(marshalPixelInternalFormat' int)
(marshalSink sink) | 185 | setMinmax (int, sink) =
glMinmax
(marshalMinmaxTarget Minmax)
(marshalPixelInternalFormat' int)
(marshalSink sink) | 135 | false | true | 0 | 7 | 38 | 60 | 31 | 29 | null | null |
ice1000/OI-codes | codewars/1-100/pig-atinlay.hs | agpl-3.0 | pigLatin [a, b, c] = [a, b, c] | 30 | pigLatin [a, b, c] = [a, b, c] | 30 | pigLatin [a, b, c] = [a, b, c] | 30 | false | false | 0 | 6 | 7 | 27 | 16 | 11 | null | null |
ameingast/slisp | src/SLISP/Eval.hs | bsd-3-clause | listEval (t,(e:es)) = let (t',e') = eval (t,e) in (t',e') : listEval (t',es) | 76 | listEval (t,(e:es)) = let (t',e') = eval (t,e) in (t',e') : listEval (t',es) | 76 | listEval (t,(e:es)) = let (t',e') = eval (t,e) in (t',e') : listEval (t',es) | 76 | false | false | 0 | 10 | 12 | 68 | 37 | 31 | null | null |
lancelet/inner-change | src/Network/InnerChange/XML/Types.hs | bsd-3-clause | partialElementName :: XML.Name -> (PartialElement -> PartialElement)
partialElementName name initPe = initPe { peName = Just name } | 131 | partialElementName :: XML.Name -> (PartialElement -> PartialElement)
partialElementName name initPe = initPe { peName = Just name } | 131 | partialElementName name initPe = initPe { peName = Just name } | 62 | false | true | 0 | 7 | 17 | 40 | 21 | 19 | null | null |
gridaphobe/ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | hpcInitCode this_mod (HpcInfo tickCount hashNo)
= vcat
[ text "static void hpc_init_" <> ppr this_mod
<> text "(void) __attribute__((constructor));"
, text "static void hpc_init_" <> ppr this_mod <> text "(void)"
, braces (vcat [
text "extern StgWord64 " <> tickboxes <>
text "[]" <> semi,
text "hs_hpc_module" <>
parens (hcat (punctuate comma [
doubleQuotes full_name_str,
int tickCount, -- really StgWord32
int hashNo, -- really StgWord32
tickboxes
])) <> semi
])
]
where
tickboxes = ppr (mkHpcTicksLabel $ this_mod)
module_name = hcat (map (text.charToC) $
bytesFS (moduleNameFS (Module.moduleName this_mod)))
package_name = hcat (map (text.charToC) $
bytesFS (unitIdFS (moduleUnitId this_mod)))
full_name_str
| moduleUnitId this_mod == mainUnitId
= module_name
| otherwise
= package_name <> char '/' <> module_name | 1,062 | hpcInitCode this_mod (HpcInfo tickCount hashNo)
= vcat
[ text "static void hpc_init_" <> ppr this_mod
<> text "(void) __attribute__((constructor));"
, text "static void hpc_init_" <> ppr this_mod <> text "(void)"
, braces (vcat [
text "extern StgWord64 " <> tickboxes <>
text "[]" <> semi,
text "hs_hpc_module" <>
parens (hcat (punctuate comma [
doubleQuotes full_name_str,
int tickCount, -- really StgWord32
int hashNo, -- really StgWord32
tickboxes
])) <> semi
])
]
where
tickboxes = ppr (mkHpcTicksLabel $ this_mod)
module_name = hcat (map (text.charToC) $
bytesFS (moduleNameFS (Module.moduleName this_mod)))
package_name = hcat (map (text.charToC) $
bytesFS (unitIdFS (moduleUnitId this_mod)))
full_name_str
| moduleUnitId this_mod == mainUnitId
= module_name
| otherwise
= package_name <> char '/' <> module_name | 1,062 | hpcInitCode this_mod (HpcInfo tickCount hashNo)
= vcat
[ text "static void hpc_init_" <> ppr this_mod
<> text "(void) __attribute__((constructor));"
, text "static void hpc_init_" <> ppr this_mod <> text "(void)"
, braces (vcat [
text "extern StgWord64 " <> tickboxes <>
text "[]" <> semi,
text "hs_hpc_module" <>
parens (hcat (punctuate comma [
doubleQuotes full_name_str,
int tickCount, -- really StgWord32
int hashNo, -- really StgWord32
tickboxes
])) <> semi
])
]
where
tickboxes = ppr (mkHpcTicksLabel $ this_mod)
module_name = hcat (map (text.charToC) $
bytesFS (moduleNameFS (Module.moduleName this_mod)))
package_name = hcat (map (text.charToC) $
bytesFS (unitIdFS (moduleUnitId this_mod)))
full_name_str
| moduleUnitId this_mod == mainUnitId
= module_name
| otherwise
= package_name <> char '/' <> module_name | 1,062 | false | false | 6 | 19 | 358 | 282 | 137 | 145 | null | null |
peterokagey/haskellOEIS | test/PowerDivisibility/A254733Spec.hs | apache-2.0 | spec :: Spec
spec = describe "A254733" $
it "correctly computes the first 20 elements" $
take 20 (map a254733 [1..]) `shouldBe` expectedValue where
expectedValue = [2,4,6,6,10,12,14,10,12,20,22,18,26,28,30,20,34,24,38,30] | 233 | spec :: Spec
spec = describe "A254733" $
it "correctly computes the first 20 elements" $
take 20 (map a254733 [1..]) `shouldBe` expectedValue where
expectedValue = [2,4,6,6,10,12,14,10,12,20,22,18,26,28,30,20,34,24,38,30] | 233 | spec = describe "A254733" $
it "correctly computes the first 20 elements" $
take 20 (map a254733 [1..]) `shouldBe` expectedValue where
expectedValue = [2,4,6,6,10,12,14,10,12,20,22,18,26,28,30,20,34,24,38,30] | 220 | false | true | 5 | 7 | 38 | 130 | 70 | 60 | null | null |
Soostone/safecopy-hunit | src/Test/HUnit/SafeCopy.hs | bsd-3-clause | -------------------------------------------------------------------------------
testSafeCopy
:: forall a b. (SC.SafeCopy a, Eq a, Show a)
=> MissingFilesPolicy
-> P.Path b P.File
-- ^ Base filename, e.g. @test/data/MyType.golden@. Will be
-- postfixed with each version, e.g. @MyType.safecopy.1@,
-- @MyType.safecopy.2@, etc. If its a primitive value, versioning
-- is not supported and thus no extension will be added.
-> a
-- ^ The current value that all past versions of this file must upgrade to.
-> HU.Assertion
testSafeCopy missingFilesPolicy baseFile a = do
case SC.objectProfile :: SC.Profile a of
SC.PrimitiveProfile -> do
-- dump file, test
assertLatest baseFile
SC.InvalidProfile e -> HU.assertFailure e
SC.Profile currentVersion supportedVersions -> do
let versions = (SCI.Version <$> supportedVersions) :: [SC.Version a]
let currentFile = mkVersionPath (SCI.Version currentVersion) baseFile
dumpVersionUnlessExists currentFile a
files <- discoverSafeCopyFiles baseFile
let missingVersions = versions \\ (scfVersion <$> files)
--TODO: make this a warning or omit based on option
unless (null missingVersions) $ do
let msg = ("Missing files for the following versions: " ++ intercalate "," (show . SCI.unVersion <$> missingVersions))
case missingFilesPolicy of
IgnoreMissingFiles -> return ()
WarnMissingFiles -> SIO.hPutStrLn SIO.stderr msg
FailMissingFiles -> HU.assertFailure msg
-- TODO: check versions
mapM_ (\f -> assertFile (scfPath f) a) files
where
assertLatest f = do
dumpVersionUnlessExists f a
assertFile f a
------------------------------------------------------------------------------- | 1,849 | testSafeCopy
:: forall a b. (SC.SafeCopy a, Eq a, Show a)
=> MissingFilesPolicy
-> P.Path b P.File
-- ^ Base filename, e.g. @test/data/MyType.golden@. Will be
-- postfixed with each version, e.g. @MyType.safecopy.1@,
-- @MyType.safecopy.2@, etc. If its a primitive value, versioning
-- is not supported and thus no extension will be added.
-> a
-- ^ The current value that all past versions of this file must upgrade to.
-> HU.Assertion
testSafeCopy missingFilesPolicy baseFile a = do
case SC.objectProfile :: SC.Profile a of
SC.PrimitiveProfile -> do
-- dump file, test
assertLatest baseFile
SC.InvalidProfile e -> HU.assertFailure e
SC.Profile currentVersion supportedVersions -> do
let versions = (SCI.Version <$> supportedVersions) :: [SC.Version a]
let currentFile = mkVersionPath (SCI.Version currentVersion) baseFile
dumpVersionUnlessExists currentFile a
files <- discoverSafeCopyFiles baseFile
let missingVersions = versions \\ (scfVersion <$> files)
--TODO: make this a warning or omit based on option
unless (null missingVersions) $ do
let msg = ("Missing files for the following versions: " ++ intercalate "," (show . SCI.unVersion <$> missingVersions))
case missingFilesPolicy of
IgnoreMissingFiles -> return ()
WarnMissingFiles -> SIO.hPutStrLn SIO.stderr msg
FailMissingFiles -> HU.assertFailure msg
-- TODO: check versions
mapM_ (\f -> assertFile (scfPath f) a) files
where
assertLatest f = do
dumpVersionUnlessExists f a
assertFile f a
------------------------------------------------------------------------------- | 1,769 | testSafeCopy missingFilesPolicy baseFile a = do
case SC.objectProfile :: SC.Profile a of
SC.PrimitiveProfile -> do
-- dump file, test
assertLatest baseFile
SC.InvalidProfile e -> HU.assertFailure e
SC.Profile currentVersion supportedVersions -> do
let versions = (SCI.Version <$> supportedVersions) :: [SC.Version a]
let currentFile = mkVersionPath (SCI.Version currentVersion) baseFile
dumpVersionUnlessExists currentFile a
files <- discoverSafeCopyFiles baseFile
let missingVersions = versions \\ (scfVersion <$> files)
--TODO: make this a warning or omit based on option
unless (null missingVersions) $ do
let msg = ("Missing files for the following versions: " ++ intercalate "," (show . SCI.unVersion <$> missingVersions))
case missingFilesPolicy of
IgnoreMissingFiles -> return ()
WarnMissingFiles -> SIO.hPutStrLn SIO.stderr msg
FailMissingFiles -> HU.assertFailure msg
-- TODO: check versions
mapM_ (\f -> assertFile (scfPath f) a) files
where
assertLatest f = do
dumpVersionUnlessExists f a
assertFile f a
------------------------------------------------------------------------------- | 1,292 | true | true | 2 | 25 | 444 | 380 | 184 | 196 | null | null |
copumpkin/vector-static | Data/Vector/Static.hs | bsd-3-clause | empty = Vec G.empty | 19 | empty = Vec G.empty | 19 | empty = Vec G.empty | 19 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
MyForteIsTimeTravel/HaskellEngine | dist/build/autogen/Paths_HaskellEngine.hs | bsd-3-clause | version :: Version
version = Version [0,1,0,0] [] | 49 | version :: Version
version = Version [0,1,0,0] [] | 49 | version = Version [0,1,0,0] [] | 30 | false | true | 0 | 6 | 7 | 38 | 18 | 20 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/Distribution/Simple/Program.hs | bsd-3-clause | -- | Runs the given configured program and gets the output.
--
getProgramOutput :: Verbosity -- ^Verbosity
-> ConfiguredProgram -- ^The program to run
-> [ProgArg] -- ^Any /extra/ arguments to add
-> IO String
getProgramOutput verbosity prog args =
getProgramInvocationOutput verbosity (programInvocation prog args) | 387 | getProgramOutput :: Verbosity -- ^Verbosity
-> ConfiguredProgram -- ^The program to run
-> [ProgArg] -- ^Any /extra/ arguments to add
-> IO String
getProgramOutput verbosity prog args =
getProgramInvocationOutput verbosity (programInvocation prog args) | 324 | getProgramOutput verbosity prog args =
getProgramInvocationOutput verbosity (programInvocation prog args) | 107 | true | true | 0 | 8 | 116 | 54 | 29 | 25 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.