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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
markus-git/signal | src/Signal/Compiler/Cycles.hs | bsd-3-clause | -- | Gets the status of a tagged node
status :: Name a -> M i Status
status r = do
s <- get
return $ case M.lookup r s of
Nothing -> error $ "Sorter.status: lookup failed"
++ "\n\t i: " ++ show (hashStableName r)
Just (Tagged s _ _) -> s
-- | Gets the predecessor of a tagged node | 337 | status :: Name a -> M i Status
status r = do
s <- get
return $ case M.lookup r s of
Nothing -> error $ "Sorter.status: lookup failed"
++ "\n\t i: " ++ show (hashStableName r)
Just (Tagged s _ _) -> s
-- | Gets the predecessor of a tagged node | 299 | status r = do
s <- get
return $ case M.lookup r s of
Nothing -> error $ "Sorter.status: lookup failed"
++ "\n\t i: " ++ show (hashStableName r)
Just (Tagged s _ _) -> s
-- | Gets the predecessor of a tagged node | 268 | true | true | 0 | 14 | 118 | 99 | 47 | 52 | null | null |
bjornbm/astro | src/Astro/Time.hs | bsd-3-clause | -- ** Modified Julian Date (MJD)
-- --------------------------
{- $mjd
A Modified Julian Date (MJD) is analogous with a Julian Date but with
an initial epoch of 1858-11-17 00:00.
-}
-- | The epoch of MJD 0.0 as an AbsoluteTime.
mjdEpoch :: Num a => E t a
mjdEpoch = E _0 | 274 | mjdEpoch :: Num a => E t a
mjdEpoch = E _0 | 42 | mjdEpoch = E _0 | 15 | true | true | 0 | 6 | 55 | 30 | 16 | 14 | null | null |
florianpilz/autotool | server/gen/JData.hs | gpl-2.0 | package :: String
package = base ++ ".types" | 44 | package :: String
package = base ++ ".types" | 44 | package = base ++ ".types" | 26 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
BitFunctor/bitfunctor-theory | src/Network/BitFunctor/Theory/Coq/Extraction/FileExtraction.hs | mit | -- after generation new files, original lib name should be changed to the filenames generated
changeTermLib :: Map.Map CoqStatementName FilePath -> CoqTerm -> CoqTerm
changeTermLib m (k,t) = let filen = Map.lookup t m in
case filen of
Nothing -> (k,t)
Just fn -> (k, CoqStatementName (DT.pack fn) "" (t^.sname))
-- rename this, removes only constructors for the first stage of user file processing! | 500 | changeTermLib :: Map.Map CoqStatementName FilePath -> CoqTerm -> CoqTerm
changeTermLib m (k,t) = let filen = Map.lookup t m in
case filen of
Nothing -> (k,t)
Just fn -> (k, CoqStatementName (DT.pack fn) "" (t^.sname))
-- rename this, removes only constructors for the first stage of user file processing! | 405 | changeTermLib m (k,t) = let filen = Map.lookup t m in
case filen of
Nothing -> (k,t)
Just fn -> (k, CoqStatementName (DT.pack fn) "" (t^.sname))
-- rename this, removes only constructors for the first stage of user file processing! | 332 | true | true | 0 | 14 | 165 | 110 | 57 | 53 | null | null |
rueshyna/gogol | gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/Reviews/List.hs | mpl-2.0 | rlToken :: Lens' ReviewsList (Maybe Text)
rlToken = lens _rlToken (\ s a -> s{_rlToken = a}) | 92 | rlToken :: Lens' ReviewsList (Maybe Text)
rlToken = lens _rlToken (\ s a -> s{_rlToken = a}) | 92 | rlToken = lens _rlToken (\ s a -> s{_rlToken = a}) | 50 | false | true | 0 | 9 | 16 | 45 | 24 | 21 | null | null |
JoeyEremondi/elm-type-effect | src/Type/Annotate.hs | bsd-3-clause | showVar t = show $ pretty App t | 31 | showVar t = show $ pretty App t | 31 | showVar t = show $ pretty App t | 31 | false | false | 0 | 6 | 7 | 18 | 8 | 10 | null | null |
DanielWaterworth/Idris-dev | src/Idris/ElabTerm.hs | bsd-3-clause | reify _ (P _ n _) | n == reflm "Instance" = return TCInstance | 61 | reify _ (P _ n _) | n == reflm "Instance" = return TCInstance | 61 | reify _ (P _ n _) | n == reflm "Instance" = return TCInstance | 61 | false | false | 1 | 9 | 13 | 39 | 16 | 23 | null | null |
HJvT/com | System/Win32/Com/Automation.hs | bsd-3-clause | defaultMaybe :: Variant a => Maybe a
defaultMaybe = Nothing | 59 | defaultMaybe :: Variant a => Maybe a
defaultMaybe = Nothing | 59 | defaultMaybe = Nothing | 22 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
fatho/kos-c | src/KOSC/Compiler/TypeChecker.hs | bsd-3-clause | -- | @hasAccess a b@ checks whether @b@ can be accessed as required by @a@.
hasAccess :: AST.Accessibility -> AST.Accessibility -> Bool
hasAccess required actual = case required of
AST.Get -> actual /= AST.Set
AST.Set -> actual /= AST.Get
AST.GetOrSet -> actual == AST.GetOrSet
-- | Checks inheritance hierarchies for circular definitions. | 356 | hasAccess :: AST.Accessibility -> AST.Accessibility -> Bool
hasAccess required actual = case required of
AST.Get -> actual /= AST.Set
AST.Set -> actual /= AST.Get
AST.GetOrSet -> actual == AST.GetOrSet
-- | Checks inheritance hierarchies for circular definitions. | 280 | hasAccess required actual = case required of
AST.Get -> actual /= AST.Set
AST.Set -> actual /= AST.Get
AST.GetOrSet -> actual == AST.GetOrSet
-- | Checks inheritance hierarchies for circular definitions. | 220 | true | true | 0 | 9 | 68 | 76 | 39 | 37 | null | null |
brendanhay/gogol | gogol-adexchangebuyer2/gen/Network/Google/Resource/AdExchangeBuyer2/Accounts/Clients/Invitations/List.hs | mpl-2.0 | -- | V1 error format.
acilXgafv :: Lens' AccountsClientsInvitationsList (Maybe Xgafv)
acilXgafv
= lens _acilXgafv (\ s a -> s{_acilXgafv = a}) | 144 | acilXgafv :: Lens' AccountsClientsInvitationsList (Maybe Xgafv)
acilXgafv
= lens _acilXgafv (\ s a -> s{_acilXgafv = a}) | 122 | acilXgafv
= lens _acilXgafv (\ s a -> s{_acilXgafv = a}) | 58 | true | true | 1 | 9 | 23 | 50 | 25 | 25 | null | null |
mcschroeder/ghc | compiler/main/DynFlags.hs | bsd-3-clause | supportedLanguages :: [String]
supportedLanguages = map (flagSpecName . snd) languageFlagsDeps | 94 | supportedLanguages :: [String]
supportedLanguages = map (flagSpecName . snd) languageFlagsDeps | 94 | supportedLanguages = map (flagSpecName . snd) languageFlagsDeps | 63 | false | true | 0 | 7 | 9 | 26 | 14 | 12 | null | null |
keera-studios/hsQt | Qtc/Enums/Network/QAbstractSocket.hs | bsd-2-clause | eUdpSocket :: SocketType
eUdpSocket
= ieSocketType $ 1 | 56 | eUdpSocket :: SocketType
eUdpSocket
= ieSocketType $ 1 | 56 | eUdpSocket
= ieSocketType $ 1 | 31 | false | true | 0 | 6 | 9 | 18 | 8 | 10 | null | null |
kim/amazonka | amazonka-codedeploy/gen/Network/AWS/CodeDeploy/Types.hs | mpl-2.0 | -- | The time range's start time.
--
-- Specify null to leave the time range's start time open-ended.
trStart :: Lens' TimeRange (Maybe UTCTime)
trStart = lens _trStart (\s a -> s { _trStart = a }) . mapping _Time | 213 | trStart :: Lens' TimeRange (Maybe UTCTime)
trStart = lens _trStart (\s a -> s { _trStart = a }) . mapping _Time | 111 | trStart = lens _trStart (\s a -> s { _trStart = a }) . mapping _Time | 68 | true | true | 0 | 10 | 40 | 55 | 30 | 25 | null | null |
keithodulaigh/Hets | utils/DtdToHaskell-src/current/TypeDef.hs | gpl-2.0 | -- | Ensure a generated name does not conflict with a standard haskell one.
notPrelude :: String -> String
notPrelude "Bool" = "ABool" | 134 | notPrelude :: String -> String
notPrelude "Bool" = "ABool" | 58 | notPrelude "Bool" = "ABool" | 27 | true | true | 0 | 5 | 22 | 19 | 10 | 9 | null | null |
xu-hao/QueryArrow | QueryArrow-db-sql-common/src/QueryArrow/SQL/SQL.hs | bsd-3-clause | -- set property
generateUpdateSQLForPred (pred1, _, _) = error "unsupported number of pos and neg literals" | 108 | generateUpdateSQLForPred (pred1, _, _) = error "unsupported number of pos and neg literals" | 91 | generateUpdateSQLForPred (pred1, _, _) = error "unsupported number of pos and neg literals" | 91 | true | false | 0 | 6 | 16 | 22 | 12 | 10 | null | null |
piccolo-lang/piccolo | src/Backend/CBackend.hs | gpl-3.0 | emitType SchedulerType = emitStr "PICC_SchedPool*" | 54 | emitType SchedulerType = emitStr "PICC_SchedPool*" | 54 | emitType SchedulerType = emitStr "PICC_SchedPool*" | 54 | false | false | 0 | 5 | 8 | 12 | 5 | 7 | null | null |
oden-lang/oden | src/Oden/Infer/Subsumption.hs | mit | collectSubstitutions (TCon _ n1) (TCon _ n2)
| n1 == n2 = return () | 69 | collectSubstitutions (TCon _ n1) (TCon _ n2)
| n1 == n2 = return () | 69 | collectSubstitutions (TCon _ n1) (TCon _ n2)
| n1 == n2 = return () | 69 | false | false | 0 | 8 | 15 | 42 | 19 | 23 | null | null |
fhsjaagshs/niagra | src/Data/Niagra/Selector.hs | mit | (<||>) s (AttrEquality i a b) = AttrEquality (s <||> i) a b | 59 | (<||>) s (AttrEquality i a b) = AttrEquality (s <||> i) a b | 59 | (<||>) s (AttrEquality i a b) = AttrEquality (s <||> i) a b | 59 | false | false | 0 | 7 | 12 | 39 | 19 | 20 | null | null |
nobsun/hs-bcopl | src/Language/BCoPL/TypeLevel/Exp.hs | bsd-3-clause | parens :: ReadP a -> ReadP a
parens p = do { skipSpaces
; char '('
; skipSpaces
; c <- p
; skipSpaces
; char ')'
; return c
} | 232 | parens :: ReadP a -> ReadP a
parens p = do { skipSpaces
; char '('
; skipSpaces
; c <- p
; skipSpaces
; char ')'
; return c
} | 232 | parens p = do { skipSpaces
; char '('
; skipSpaces
; c <- p
; skipSpaces
; char ')'
; return c
} | 203 | false | true | 0 | 7 | 137 | 66 | 31 | 35 | null | null |
wimdu/alonzo | src/Util.hs | mit | containsAny :: String -> [String] -> Bool
containsAny msg ys = map toLower msg =~ ("(\\W|^)(" ++ intercalate "|" ys ++ ")(\\W|$)") | 130 | containsAny :: String -> [String] -> Bool
containsAny msg ys = map toLower msg =~ ("(\\W|^)(" ++ intercalate "|" ys ++ ")(\\W|$)") | 130 | containsAny msg ys = map toLower msg =~ ("(\\W|^)(" ++ intercalate "|" ys ++ ")(\\W|$)") | 88 | false | true | 0 | 9 | 21 | 52 | 26 | 26 | null | null |
cgo/hsimage | src/Graphics/Webcam/Linux/Internal.hs | lgpl-3.0 | maybeMedian :: [a] -> Maybe a
maybeMedian [] = Nothing | 54 | maybeMedian :: [a] -> Maybe a
maybeMedian [] = Nothing | 54 | maybeMedian [] = Nothing | 24 | false | true | 0 | 6 | 9 | 26 | 13 | 13 | null | null |
rvion/chrome-reloader | src/Chrome.hs | bsd-3-clause | -- Helpers
parseUri :: String -> (String, Int, String)
parseUri uri = fromMaybe (error "parseUri: Invalid URI") $ do
u <- Uri.parseURI uri
auth <- Uri.uriAuthority u
let port = case Uri.uriPort auth of (':' : str) -> read str; _ -> 80
return (Uri.uriRegName auth, port, Uri.uriPath u) | 303 | parseUri :: String -> (String, Int, String)
parseUri uri = fromMaybe (error "parseUri: Invalid URI") $ do
u <- Uri.parseURI uri
auth <- Uri.uriAuthority u
let port = case Uri.uriPort auth of (':' : str) -> read str; _ -> 80
return (Uri.uriRegName auth, port, Uri.uriPath u) | 292 | parseUri uri = fromMaybe (error "parseUri: Invalid URI") $ do
u <- Uri.parseURI uri
auth <- Uri.uriAuthority u
let port = case Uri.uriPort auth of (':' : str) -> read str; _ -> 80
return (Uri.uriRegName auth, port, Uri.uriPath u) | 248 | true | true | 0 | 15 | 67 | 131 | 64 | 67 | null | null |
brendanhay/gogol | gogol-monitoring/gen/Network/Google/Resource/Monitoring/Services/Delete.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
sdUploadType :: Lens' ServicesDelete (Maybe Text)
sdUploadType
= lens _sdUploadType (\ s a -> s{_sdUploadType = a}) | 188 | sdUploadType :: Lens' ServicesDelete (Maybe Text)
sdUploadType
= lens _sdUploadType (\ s a -> s{_sdUploadType = a}) | 117 | sdUploadType
= lens _sdUploadType (\ s a -> s{_sdUploadType = a}) | 67 | true | true | 0 | 9 | 28 | 48 | 25 | 23 | null | null |
KommuSoft/dep-software | Dep.Ui.Schematics.hs | gpl-3.0 | schematicsWidget :: [Int] -- ^ The given schematics that must be rendered.
-> IO (Widget (ScrollSt (Decorator [Int] UiDecorator))) -- ^ The returning widget: a Scrollable with the widget renderer internally.
schematicsWidget ct = do
wid <- newWidget (Decorator ct [CursorX 0 3 0,CursorY 0 3 0]) $ \x -> x {
growHorizontal_ = const $ return True,
growVertical_ = const $ return True,
render_ = displaySchematics,
keyEventHandler = handleKeyWidget,
getCursorPosition_ = const $ return Nothing
}
autoScrollable wid | 567 | schematicsWidget :: [Int] -- ^ The given schematics that must be rendered.
-> IO (Widget (ScrollSt (Decorator [Int] UiDecorator)))
schematicsWidget ct = do
wid <- newWidget (Decorator ct [CursorX 0 3 0,CursorY 0 3 0]) $ \x -> x {
growHorizontal_ = const $ return True,
growVertical_ = const $ return True,
render_ = displaySchematics,
keyEventHandler = handleKeyWidget,
getCursorPosition_ = const $ return Nothing
}
autoScrollable wid | 490 | schematicsWidget ct = do
wid <- newWidget (Decorator ct [CursorX 0 3 0,CursorY 0 3 0]) $ \x -> x {
growHorizontal_ = const $ return True,
growVertical_ = const $ return True,
render_ = displaySchematics,
keyEventHandler = handleKeyWidget,
getCursorPosition_ = const $ return Nothing
}
autoScrollable wid | 355 | true | true | 0 | 14 | 134 | 156 | 81 | 75 | null | null |
ribag/ganeti-experiments | test/hs/Test/Ganeti/Utils.hs | gpl-2.0 | -- | Split and join should always be idempotent.
prop_commaSplitJoin :: String -> Property
prop_commaSplitJoin s =
commaJoin (sepSplit ',' s) ==? s | 149 | prop_commaSplitJoin :: String -> Property
prop_commaSplitJoin s =
commaJoin (sepSplit ',' s) ==? s | 100 | prop_commaSplitJoin s =
commaJoin (sepSplit ',' s) ==? s | 58 | true | true | 0 | 7 | 24 | 40 | 18 | 22 | null | null |
ony/hledger | hledger/Hledger/Cli/CliOptions.hs | gpl-3.0 | defaultOutputFormat = "txt" | 27 | defaultOutputFormat = "txt" | 27 | defaultOutputFormat = "txt" | 27 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
ndmitchell/nsis | src/Development/NSIS/Plugins/WinMessages.hs | bsd-3-clause | wm_MDIGETACTIVE = 0x0229 | 40 | wm_MDIGETACTIVE = 0x0229 | 40 | wm_MDIGETACTIVE = 0x0229 | 40 | false | false | 0 | 4 | 18 | 6 | 3 | 3 | null | null |
seereason/stringsearch | Data/ByteString/Lazy/Search/DFA.hs | bsd-3-clause | breakFindAfter :: S.ByteString -- ^ Strict pattern to search for
-> L.ByteString -- ^ Lazy string to search in
-> ((L.ByteString, L.ByteString), Bool)
-- ^ Head and tail of string broken after substring
-- and presence of pattern
breakFindAfter pat
| S.null pat = \str -> ((L.empty, str), True) | 387 | breakFindAfter :: S.ByteString -- ^ Strict pattern to search for
-> L.ByteString -- ^ Lazy string to search in
-> ((L.ByteString, L.ByteString), Bool)
breakFindAfter pat
| S.null pat = \str -> ((L.empty, str), True) | 250 | breakFindAfter pat
| S.null pat = \str -> ((L.empty, str), True) | 67 | true | true | 0 | 11 | 141 | 82 | 44 | 38 | null | null |
lostbean/Hammer | src/Hammer/VoxBox.hs | gpl-3.0 | (#+#) :: VoxelPos -> VoxelPos -> VoxelPos
(VoxelPos x1 y1 z1) #+# (VoxelPos x2 y2 z2) = VoxelPos (x1+x2) (y1+y2) (z1+z2) | 120 | (#+#) :: VoxelPos -> VoxelPos -> VoxelPos
(VoxelPos x1 y1 z1) #+# (VoxelPos x2 y2 z2) = VoxelPos (x1+x2) (y1+y2) (z1+z2) | 120 | (VoxelPos x1 y1 z1) #+# (VoxelPos x2 y2 z2) = VoxelPos (x1+x2) (y1+y2) (z1+z2) | 78 | false | true | 0 | 11 | 20 | 79 | 40 | 39 | null | null |
miguelpagano/equ | Equ/PreExpr/Zipper.hs | gpl-3.0 | goDown (App pe0 pe1, path) = Just (pe0, AppL path pe1) | 54 | goDown (App pe0 pe1, path) = Just (pe0, AppL path pe1) | 54 | goDown (App pe0 pe1, path) = Just (pe0, AppL path pe1) | 54 | false | false | 0 | 7 | 10 | 34 | 17 | 17 | null | null |
d12frosted/hakyll | src/Hakyll/Core/Provider/Metadata.hs | bsd-3-clause | inlineSpace :: Parser Char
inlineSpace = P.oneOf ['\t', ' '] <?> "space" | 72 | inlineSpace :: Parser Char
inlineSpace = P.oneOf ['\t', ' '] <?> "space" | 72 | inlineSpace = P.oneOf ['\t', ' '] <?> "space" | 45 | false | true | 0 | 6 | 11 | 34 | 16 | 18 | null | null |
DaMSL/K3 | src/Language/K3/Interpreter/Evaluation.hs | apache-2.0 | logic :: (Bool -> Bool -> Bool) -> K3 Expression -> K3 Expression -> Interpretation Value
logic op a b = do
a' <- expression a
b' <- expression b
case (a', b') of
(VBool x, VBool y) -> return $ VBool $ op x y
_ -> throwE $ RunTimeTypeError "Invalid Boolean Operation"
-- | Common comparison operation handling. | 330 | logic :: (Bool -> Bool -> Bool) -> K3 Expression -> K3 Expression -> Interpretation Value
logic op a b = do
a' <- expression a
b' <- expression b
case (a', b') of
(VBool x, VBool y) -> return $ VBool $ op x y
_ -> throwE $ RunTimeTypeError "Invalid Boolean Operation"
-- | Common comparison operation handling. | 330 | logic op a b = do
a' <- expression a
b' <- expression b
case (a', b') of
(VBool x, VBool y) -> return $ VBool $ op x y
_ -> throwE $ RunTimeTypeError "Invalid Boolean Operation"
-- | Common comparison operation handling. | 240 | false | true | 0 | 11 | 79 | 128 | 61 | 67 | null | null |
jgm/pandoc-types | src/Text/Pandoc/Builder.hs | bsd-3-clause | setTitle :: Inlines -> Pandoc -> Pandoc
setTitle = setMeta "title" | 66 | setTitle :: Inlines -> Pandoc -> Pandoc
setTitle = setMeta "title" | 66 | setTitle = setMeta "title" | 26 | false | true | 0 | 8 | 10 | 29 | 12 | 17 | null | null |
Crazycolorz5/Haskell-Code | Factorial.hs | unlicense | main = getLine >>= print . factorial . read | 43 | main = getLine >>= print . factorial . read | 43 | main = getLine >>= print . factorial . read | 43 | false | false | 0 | 7 | 8 | 18 | 9 | 9 | null | null |
BerndSchwarzenbacher/cis194-solutions | 12-monads/Risk.hs | mit | compareDice (a:as, d:ds) (attL, defL)
| a > d = compareDice (as, ds) (attL, defL+1)
| otherwise = compareDice (as, ds) (attL+1, defL) | 141 | compareDice (a:as, d:ds) (attL, defL)
| a > d = compareDice (as, ds) (attL, defL+1)
| otherwise = compareDice (as, ds) (attL+1, defL) | 141 | compareDice (a:as, d:ds) (attL, defL)
| a > d = compareDice (as, ds) (attL, defL+1)
| otherwise = compareDice (as, ds) (attL+1, defL) | 141 | false | false | 1 | 8 | 30 | 90 | 49 | 41 | null | null |
MaximilianAlgehed/Boids | src/Boids.hs | bsd-3-clause | norm :: Vec -> Vec
norm (V (0, 0)) = V (0, 0) | 45 | norm :: Vec -> Vec
norm (V (0, 0)) = V (0, 0) | 45 | norm (V (0, 0)) = V (0, 0) | 26 | false | true | 0 | 8 | 12 | 39 | 21 | 18 | null | null |
jeannekamikaze/calc | Calc/Main.hs | bsd-3-clause | fibProg :: Int -> Prog
fibProg n = Compute (fib !! n) | 53 | fibProg :: Int -> Prog
fibProg n = Compute (fib !! n) | 53 | fibProg n = Compute (fib !! n) | 30 | false | true | 0 | 7 | 11 | 28 | 14 | 14 | null | null |
yesodweb/yesod | yesod-auth/Yesod/Auth.hs | mit | getLoginR :: AuthHandler master Html
getLoginR = setUltDestReferer' >> loginHandler | 83 | getLoginR :: AuthHandler master Html
getLoginR = setUltDestReferer' >> loginHandler | 83 | getLoginR = setUltDestReferer' >> loginHandler | 46 | false | true | 0 | 5 | 9 | 20 | 10 | 10 | null | null |
janschulz/pandoc | src/Text/Pandoc/Readers/CommonMark.hs | gpl-2.0 | addBlock (Node _ (CODE_BLOCK info t) _) =
(CodeBlock ("", take 1 (words (unpack info)), []) (unpack t) :) | 107 | addBlock (Node _ (CODE_BLOCK info t) _) =
(CodeBlock ("", take 1 (words (unpack info)), []) (unpack t) :) | 107 | addBlock (Node _ (CODE_BLOCK info t) _) =
(CodeBlock ("", take 1 (words (unpack info)), []) (unpack t) :) | 107 | false | false | 0 | 12 | 20 | 70 | 36 | 34 | null | null |
fredefox/anagrams | src/TrieBuilder.hs | gpl-3.0 | addToForest (x:xs) (t:ts)
| x == (fst . rootLabel) t = t':ts
| otherwise = t : addToForest (x:xs) ts
where
t' = t
{ subForest = addToForest xs . subForest $ t
, rootLabel = fmap (|| null xs) . rootLabel $ t
} | 263 | addToForest (x:xs) (t:ts)
| x == (fst . rootLabel) t = t':ts
| otherwise = t : addToForest (x:xs) ts
where
t' = t
{ subForest = addToForest xs . subForest $ t
, rootLabel = fmap (|| null xs) . rootLabel $ t
} | 263 | addToForest (x:xs) (t:ts)
| x == (fst . rootLabel) t = t':ts
| otherwise = t : addToForest (x:xs) ts
where
t' = t
{ subForest = addToForest xs . subForest $ t
, rootLabel = fmap (|| null xs) . rootLabel $ t
} | 263 | false | false | 1 | 12 | 99 | 124 | 63 | 61 | null | null |
brendanhay/gogol | gogol-shopping-content/gen/Network/Google/Resource/Content/Settlementreports/List.hs | mpl-2.0 | -- | V1 error format.
setXgafv :: Lens' SettlementreportsList (Maybe Xgafv)
setXgafv = lens _setXgafv (\ s a -> s{_setXgafv = a}) | 129 | setXgafv :: Lens' SettlementreportsList (Maybe Xgafv)
setXgafv = lens _setXgafv (\ s a -> s{_setXgafv = a}) | 107 | setXgafv = lens _setXgafv (\ s a -> s{_setXgafv = a}) | 53 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
achirkin/ghcjs-webgl | src/JavaScript/WebGL/Const.hs | mit | gl_ALIASED_LINE_WIDTH_RANGE :: GLenum
gl_ALIASED_LINE_WIDTH_RANGE = 0x846E | 74 | gl_ALIASED_LINE_WIDTH_RANGE :: GLenum
gl_ALIASED_LINE_WIDTH_RANGE = 0x846E | 74 | gl_ALIASED_LINE_WIDTH_RANGE = 0x846E | 36 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
StarvingMarvin/cashflow | src/Cashflow/Entry.hs | gpl-3.0 | fromAsset a = Entries [] [] [] [] [a] [] | 52 | fromAsset a = Entries [] [] [] [] [a] [] | 52 | fromAsset a = Entries [] [] [] [] [a] [] | 52 | false | false | 0 | 6 | 21 | 35 | 17 | 18 | null | null |
kernelim/leveldb-haskell | src/Database/LevelDB/Types.hs | bsd-3-clause | defaultOptions :: Options
defaultOptions = Options
{ blockRestartInterval = 16
, blockSize = 4096
, cacheSize = 0
, comparator = Nothing
, compression = Snappy
, createIfMissing = False
, errorIfExists = False
, maxOpenFiles = 1000
, paranoidChecks = False
, writeBufferSize = 4 `shift` 20
, filterPolicy = Nothing
} | 444 | defaultOptions :: Options
defaultOptions = Options
{ blockRestartInterval = 16
, blockSize = 4096
, cacheSize = 0
, comparator = Nothing
, compression = Snappy
, createIfMissing = False
, errorIfExists = False
, maxOpenFiles = 1000
, paranoidChecks = False
, writeBufferSize = 4 `shift` 20
, filterPolicy = Nothing
} | 444 | defaultOptions = Options
{ blockRestartInterval = 16
, blockSize = 4096
, cacheSize = 0
, comparator = Nothing
, compression = Snappy
, createIfMissing = False
, errorIfExists = False
, maxOpenFiles = 1000
, paranoidChecks = False
, writeBufferSize = 4 `shift` 20
, filterPolicy = Nothing
} | 418 | false | true | 0 | 7 | 180 | 85 | 55 | 30 | null | null |
ben-schulz/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | debug TRACE = "#define IDRIS_TRACE\n\n" | 39 | debug TRACE = "#define IDRIS_TRACE\n\n" | 39 | debug TRACE = "#define IDRIS_TRACE\n\n" | 39 | false | false | 1 | 5 | 4 | 13 | 4 | 9 | null | null |
vincenthz/cryptonite | Crypto/PubKey/RSA/Types.hs | bsd-3-clause | -- | get e from a private key
private_e :: PrivateKey -> Integer
private_e = public_e . private_pub | 99 | private_e :: PrivateKey -> Integer
private_e = public_e . private_pub | 69 | private_e = public_e . private_pub | 34 | true | true | 0 | 5 | 17 | 20 | 11 | 9 | null | null |
jozefg/hasquito | src/Language/Hasquito/TypeCheck.hs | mit | typeOf (IfZ num l r) = do
[numTy, lTy, rTy] <- mapM typeOf [num, l , r]
tell [numTy :~: TNum, lTy :~: rTy]
return lTy | 123 | typeOf (IfZ num l r) = do
[numTy, lTy, rTy] <- mapM typeOf [num, l , r]
tell [numTy :~: TNum, lTy :~: rTy]
return lTy | 123 | typeOf (IfZ num l r) = do
[numTy, lTy, rTy] <- mapM typeOf [num, l , r]
tell [numTy :~: TNum, lTy :~: rTy]
return lTy | 123 | false | false | 0 | 9 | 31 | 75 | 38 | 37 | null | null |
Catchouli/tyke | src/Game/Simulation/Input.hs | bsd-3-clause | mouseMotionEvents :: InputEvent -> Event SDL.MouseMotionEventData
mouseMotionEvents eInput = let mbEvents = filterE isMouseMotionEvent eInput
getMbEventData = (\x ->
let SDL.MouseMotionEvent d = SDL.eventPayload x in d)
eventData = getMbEventData <$> mbEvents
in eventData | 394 | mouseMotionEvents :: InputEvent -> Event SDL.MouseMotionEventData
mouseMotionEvents eInput = let mbEvents = filterE isMouseMotionEvent eInput
getMbEventData = (\x ->
let SDL.MouseMotionEvent d = SDL.eventPayload x in d)
eventData = getMbEventData <$> mbEvents
in eventData | 394 | mouseMotionEvents eInput = let mbEvents = filterE isMouseMotionEvent eInput
getMbEventData = (\x ->
let SDL.MouseMotionEvent d = SDL.eventPayload x in d)
eventData = getMbEventData <$> mbEvents
in eventData | 328 | false | true | 0 | 16 | 155 | 83 | 40 | 43 | null | null |
snowleopard/shaking-up-ghc | src/Rules/Nofib.hs | bsd-3-clause | nofibLogFile :: FilePath
nofibLogFile = "nofib-log" | 51 | nofibLogFile :: FilePath
nofibLogFile = "nofib-log" | 51 | nofibLogFile = "nofib-log" | 26 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
black0range/BufferedSocket | Network/BufferedSocket/Core.hs | mit | readLazy :: BufferedSocket -> Int -> IO BL.ByteString
readLazy _ 0 = return "" | 78 | readLazy :: BufferedSocket -> Int -> IO BL.ByteString
readLazy _ 0 = return "" | 78 | readLazy _ 0 = return "" | 24 | false | true | 0 | 8 | 13 | 32 | 15 | 17 | null | null |
Kyly/liquidhaskell | src/Language/Haskell/Liquid/RefType.hs | bsd-3-clause | nlzP ps (RAppTy t1 t2 r)
= (RAppTy t1' t2' r, ps ++ ps1 ++ ps2)
where (t1', ps1) = nlzP [] t1
(t2', ps2) = nlzP [] t2 | 128 | nlzP ps (RAppTy t1 t2 r)
= (RAppTy t1' t2' r, ps ++ ps1 ++ ps2)
where (t1', ps1) = nlzP [] t1
(t2', ps2) = nlzP [] t2 | 128 | nlzP ps (RAppTy t1 t2 r)
= (RAppTy t1' t2' r, ps ++ ps1 ++ ps2)
where (t1', ps1) = nlzP [] t1
(t2', ps2) = nlzP [] t2 | 128 | false | false | 0 | 7 | 39 | 85 | 42 | 43 | null | null |
bitemyapp/ghc | libraries/base/GHC/Arr.hs | bsd-3-clause | eqArray :: (Ix i, Eq e) => Array i e -> Array i e -> Bool
eqArray arr1@(Array l1 u1 n1 _) arr2@(Array l2 u2 n2 _) =
if n1 == 0 then n2 == 0 else
l1 == l2 && u1 == u2 &&
and [unsafeAt arr1 i == unsafeAt arr2 i | i <- [0 .. n1 - 1]] | 242 | eqArray :: (Ix i, Eq e) => Array i e -> Array i e -> Bool
eqArray arr1@(Array l1 u1 n1 _) arr2@(Array l2 u2 n2 _) =
if n1 == 0 then n2 == 0 else
l1 == l2 && u1 == u2 &&
and [unsafeAt arr1 i == unsafeAt arr2 i | i <- [0 .. n1 - 1]] | 242 | eqArray arr1@(Array l1 u1 n1 _) arr2@(Array l2 u2 n2 _) =
if n1 == 0 then n2 == 0 else
l1 == l2 && u1 == u2 &&
and [unsafeAt arr1 i == unsafeAt arr2 i | i <- [0 .. n1 - 1]] | 184 | false | true | 4 | 10 | 72 | 160 | 78 | 82 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_285 (47#) = happyGoto action_190 | 39 | action_285 (47#) = happyGoto action_190 | 39 | action_285 (47#) = happyGoto action_190 | 39 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
acharal/wam | src/WAM/Compile.hs | gpl-2.0 | wamCompileClause cl@(h,b) =
let
-- n registers are reserved for arguments of first literal in body (?)
n = if isFact
then 0
else length (args (head b))
isFact = length b < 1
notSingleton = length b > 1
headArgs = args h
permans = perms cl
unsafes = unsafe cl
in do
local (\r -> r{ perms' = permans }) $ do
modify (\st -> st { symbolTbl = []
, unsafe' = unsafes
})
g <- wamCompileHeadLit headArgs n
let g'= if notSingleton then (Allocate (length permans), []):g else g
gb <- wamCompileBody b notSingleton
return $ g' ++ gb
-- wamCompileGoal
-- | Compiles the many alternative clauses of a predicate | 833 | wamCompileClause cl@(h,b) =
let
-- n registers are reserved for arguments of first literal in body (?)
n = if isFact
then 0
else length (args (head b))
isFact = length b < 1
notSingleton = length b > 1
headArgs = args h
permans = perms cl
unsafes = unsafe cl
in do
local (\r -> r{ perms' = permans }) $ do
modify (\st -> st { symbolTbl = []
, unsafe' = unsafes
})
g <- wamCompileHeadLit headArgs n
let g'= if notSingleton then (Allocate (length permans), []):g else g
gb <- wamCompileBody b notSingleton
return $ g' ++ gb
-- wamCompileGoal
-- | Compiles the many alternative clauses of a predicate | 833 | wamCompileClause cl@(h,b) =
let
-- n registers are reserved for arguments of first literal in body (?)
n = if isFact
then 0
else length (args (head b))
isFact = length b < 1
notSingleton = length b > 1
headArgs = args h
permans = perms cl
unsafes = unsafe cl
in do
local (\r -> r{ perms' = permans }) $ do
modify (\st -> st { symbolTbl = []
, unsafe' = unsafes
})
g <- wamCompileHeadLit headArgs n
let g'= if notSingleton then (Allocate (length permans), []):g else g
gb <- wamCompileBody b notSingleton
return $ g' ++ gb
-- wamCompileGoal
-- | Compiles the many alternative clauses of a predicate | 833 | false | false | 1 | 20 | 350 | 238 | 120 | 118 | null | null |
tomtitchener/Drift | src/WorkSheet.hs | cc0-1.0 | pitchesFromRandomSnippets :: Int -> Int -> Scale -> IndexedPitch -> [[Interval]] -> [Pitch]
pitchesFromRandomSnippets seed cnt scale pitch snips = concatMap (pitchesFromIntervals scale pitch) $ takeRandomValues seed cnt snips | 225 | pitchesFromRandomSnippets :: Int -> Int -> Scale -> IndexedPitch -> [[Interval]] -> [Pitch]
pitchesFromRandomSnippets seed cnt scale pitch snips = concatMap (pitchesFromIntervals scale pitch) $ takeRandomValues seed cnt snips | 225 | pitchesFromRandomSnippets seed cnt scale pitch snips = concatMap (pitchesFromIntervals scale pitch) $ takeRandomValues seed cnt snips | 133 | false | true | 0 | 11 | 28 | 73 | 37 | 36 | null | null |
wmhilton/lambda-calculator | LambdaParser.hs | mit | -- Note: by using union we guarantee no duplicates
freeVars(Application term1 term2) = (freeVars term1) `union` (freeVars term2) | 128 | freeVars(Application term1 term2) = (freeVars term1) `union` (freeVars term2) | 77 | freeVars(Application term1 term2) = (freeVars term1) `union` (freeVars term2) | 77 | true | false | 0 | 7 | 17 | 36 | 19 | 17 | null | null |
Bodigrim/arithmoi | Math/NumberTheory/Primes/IntSet.hs | mit | -- | Check whether the given prime is a member of the set.
member :: Prime Int -> PrimeIntSet -> Bool
member = coerce IS.member | 127 | member :: Prime Int -> PrimeIntSet -> Bool
member = coerce IS.member | 68 | member = coerce IS.member | 25 | true | true | 0 | 6 | 24 | 28 | 14 | 14 | null | null |
tjakway/ghcjvm | compiler/codeGen/StgCmmForeign.hs | bsd-3-clause | closureField :: DynFlags -> ByteOff -> ByteOff
closureField dflags off = off + fixedHdrSize dflags | 98 | closureField :: DynFlags -> ByteOff -> ByteOff
closureField dflags off = off + fixedHdrSize dflags | 98 | closureField dflags off = off + fixedHdrSize dflags | 51 | false | true | 0 | 6 | 14 | 31 | 15 | 16 | null | null |
rawlep/EQS | sourceCode/FileIO.hs | mit | eDir = "./Extracted/" | 21 | eDir = "./Extracted/" | 21 | eDir = "./Extracted/" | 21 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
aztecrex/haskell-experiments-tdd | app/Main.hs | bsd-3-clause | main :: IO ()
main = putStrLn "Howdy!" | 38 | main :: IO ()
main = putStrLn "Howdy!" | 38 | main = putStrLn "Howdy!" | 24 | false | true | 1 | 6 | 7 | 22 | 9 | 13 | null | null |
kemitchell/example-wai-server | test/Test.hs | mit | main :: IO ()
main = hspec spec | 31 | main :: IO ()
main = hspec spec | 31 | main = hspec spec | 17 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
FunctionalThinking/ninety-nine | src/Exercises.hs | mit | tableN :: Int -> ([Bool] -> Bool) -> IO()
tableN n f = putStrLn $ unlines $ map format $ tableN' n f
where format (input,result) = unwords $ map show $ input ++ [result]
-- 49 | 189 | tableN :: Int -> ([Bool] -> Bool) -> IO()
tableN n f = putStrLn $ unlines $ map format $ tableN' n f
where format (input,result) = unwords $ map show $ input ++ [result]
-- 49 | 189 | tableN n f = putStrLn $ unlines $ map format $ tableN' n f
where format (input,result) = unwords $ map show $ input ++ [result]
-- 49 | 147 | false | true | 2 | 10 | 50 | 102 | 49 | 53 | null | null |
mettekou/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | -- | Access the 'EvBindsVar' carried by the 'TcPluginM' during
-- constraint solving. Returns 'Nothing' if invoked during
-- 'tcPluginInit' or 'tcPluginStop'.
getEvBindsTcPluginM :: TcPluginM EvBindsVar
getEvBindsTcPluginM = TcPluginM return | 242 | getEvBindsTcPluginM :: TcPluginM EvBindsVar
getEvBindsTcPluginM = TcPluginM return | 82 | getEvBindsTcPluginM = TcPluginM return | 38 | true | true | 1 | 5 | 30 | 23 | 11 | 12 | null | null |
hjwylde/werewolf | src/Game/Werewolf/Game.hs | bsd-3-clause | -- | Queries whether the 'Villagers' have won. The 'Villagers' win if they are the only players
-- surviving.
--
-- N.B., the Dullahan and Fallen Angel are not considered when determining whether the 'Villagers'
-- have won.
hasVillagersWon :: Game -> Bool
hasVillagersWon game =
not (hasEveryoneLost game)
&& allOf (players . traverse . alive)
(\player -> any ($ player) [is villager, is dullahan, is fallenAngel]) game | 442 | hasVillagersWon :: Game -> Bool
hasVillagersWon game =
not (hasEveryoneLost game)
&& allOf (players . traverse . alive)
(\player -> any ($ player) [is villager, is dullahan, is fallenAngel]) game | 211 | hasVillagersWon game =
not (hasEveryoneLost game)
&& allOf (players . traverse . alive)
(\player -> any ($ player) [is villager, is dullahan, is fallenAngel]) game | 179 | true | true | 0 | 11 | 89 | 89 | 48 | 41 | null | null |
kim/amazonka | amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/UpdatePipeline.hs | mpl-2.0 | -- | The Amazon S3 bucket in which you saved the media files that you want to
-- transcode and the graphics that you want to use as watermarks.
upInputBucket :: Lens' UpdatePipeline (Maybe Text)
upInputBucket = lens _upInputBucket (\s a -> s { _upInputBucket = a }) | 265 | upInputBucket :: Lens' UpdatePipeline (Maybe Text)
upInputBucket = lens _upInputBucket (\s a -> s { _upInputBucket = a }) | 121 | upInputBucket = lens _upInputBucket (\s a -> s { _upInputBucket = a }) | 70 | true | true | 2 | 9 | 47 | 56 | 26 | 30 | null | null |
arirahikkala/straylight-divergence | src/CommonTypes.hs | gpl-3.0 | gsGlobal f = do s <- gGlobal
return $ f s | 57 | gsGlobal f = do s <- gGlobal
return $ f s | 57 | gsGlobal f = do s <- gGlobal
return $ f s | 57 | false | false | 0 | 8 | 26 | 26 | 11 | 15 | null | null |
olorin/amazonka | amazonka-iam/test/Test/AWS/Gen/IAM.hs | mpl-2.0 | testAttachGroupPolicy :: AttachGroupPolicy -> TestTree
testAttachGroupPolicy = req
"AttachGroupPolicy"
"fixture/AttachGroupPolicy.yaml" | 143 | testAttachGroupPolicy :: AttachGroupPolicy -> TestTree
testAttachGroupPolicy = req
"AttachGroupPolicy"
"fixture/AttachGroupPolicy.yaml" | 143 | testAttachGroupPolicy = req
"AttachGroupPolicy"
"fixture/AttachGroupPolicy.yaml" | 88 | false | true | 0 | 5 | 17 | 21 | 10 | 11 | null | null |
juhp/stack | test/integration/lib/StackTest.hs | bsd-3-clause | stackCleanFull :: HasCallStack => IO ()
stackCleanFull = stackIgnoreException ["clean", "--full"] | 97 | stackCleanFull :: HasCallStack => IO ()
stackCleanFull = stackIgnoreException ["clean", "--full"] | 97 | stackCleanFull = stackIgnoreException ["clean", "--full"] | 57 | false | true | 0 | 7 | 10 | 30 | 15 | 15 | null | null |
wujf/yesod | yesod-core/Yesod/Core/Handler.hs | mit | modSession :: (SessionMap -> SessionMap) -> GHState -> GHState
modSession f x = x { ghsSession = f $ ghsSession x } | 115 | modSession :: (SessionMap -> SessionMap) -> GHState -> GHState
modSession f x = x { ghsSession = f $ ghsSession x } | 115 | modSession f x = x { ghsSession = f $ ghsSession x } | 52 | false | true | 0 | 9 | 21 | 55 | 26 | 29 | null | null |
input-output-hk/pos-haskell-prototype | auxx/src/Lang/Lexer.hs | mit | pToken :: Lexer (Span, Token)
pToken = withPosition (try pToken' <|> pUnknown) <* pSkip
where
posToLoc :: SourcePos -> Loc
posToLoc (SourcePos _ sourceLine sourceColumn) = uncurry loc
( fromIntegral . unPos $ sourceLine
, fromIntegral . unPos $ sourceColumn)
withPosition p = do
pos1 <- posToLoc <$> getSourcePos
t <- p
pos2 <- posToLoc <$> getSourcePos
return (spanFromTo pos1 pos2, t) | 448 | pToken :: Lexer (Span, Token)
pToken = withPosition (try pToken' <|> pUnknown) <* pSkip
where
posToLoc :: SourcePos -> Loc
posToLoc (SourcePos _ sourceLine sourceColumn) = uncurry loc
( fromIntegral . unPos $ sourceLine
, fromIntegral . unPos $ sourceColumn)
withPosition p = do
pos1 <- posToLoc <$> getSourcePos
t <- p
pos2 <- posToLoc <$> getSourcePos
return (spanFromTo pos1 pos2, t) | 448 | pToken = withPosition (try pToken' <|> pUnknown) <* pSkip
where
posToLoc :: SourcePos -> Loc
posToLoc (SourcePos _ sourceLine sourceColumn) = uncurry loc
( fromIntegral . unPos $ sourceLine
, fromIntegral . unPos $ sourceColumn)
withPosition p = do
pos1 <- posToLoc <$> getSourcePos
t <- p
pos2 <- posToLoc <$> getSourcePos
return (spanFromTo pos1 pos2, t) | 418 | false | true | 1 | 10 | 123 | 163 | 75 | 88 | null | null |
agocorona/Workflow | Control/Workflow.hs | bsd-3-clause | killWF :: (Indexable a,MonadIO m) => String -> a -> m ()
killWF name1 x= do
let name= keyWF name1 x
killWF1 name | 126 | killWF :: (Indexable a,MonadIO m) => String -> a -> m ()
killWF name1 x= do
let name= keyWF name1 x
killWF1 name | 126 | killWF name1 x= do
let name= keyWF name1 x
killWF1 name | 69 | false | true | 0 | 10 | 36 | 64 | 30 | 34 | null | null |
DavidAlphaFox/yesod | yesod-core/Yesod/Core/Handler.hs | mit | -- | Set the Expires header to some date in 2037. In other words, this content
-- is never (realistically) expired.
neverExpires :: MonadHandler m => m ()
neverExpires = do
askHandlerEnv >>= liftIO . rheGetMaxExpires >>= setHeader "Expires"
cacheSeconds oneYear
where
oneYear :: Int
oneYear = 60 * 60 * 24 * 365
-- | Set an Expires header in the past, meaning this content should not be
-- cached. | 416 | neverExpires :: MonadHandler m => m ()
neverExpires = do
askHandlerEnv >>= liftIO . rheGetMaxExpires >>= setHeader "Expires"
cacheSeconds oneYear
where
oneYear :: Int
oneYear = 60 * 60 * 24 * 365
-- | Set an Expires header in the past, meaning this content should not be
-- cached. | 300 | neverExpires = do
askHandlerEnv >>= liftIO . rheGetMaxExpires >>= setHeader "Expires"
cacheSeconds oneYear
where
oneYear :: Int
oneYear = 60 * 60 * 24 * 365
-- | Set an Expires header in the past, meaning this content should not be
-- cached. | 261 | true | true | 0 | 9 | 89 | 76 | 38 | 38 | null | null |
NorfairKing/the-notes | src/Probability/RandomVariable/Terms.hs | gpl-2.0 | xyRvs :: Note -> Note -> Note
xyRvs x y = m (tuple x y) <> "-" <> randomVariables | 81 | xyRvs :: Note -> Note -> Note
xyRvs x y = m (tuple x y) <> "-" <> randomVariables | 81 | xyRvs x y = m (tuple x y) <> "-" <> randomVariables | 51 | false | true | 0 | 9 | 18 | 43 | 21 | 22 | null | null |
TOSPIO/yi | src/library/Yi/Buffer/HighLevel.hs | gpl-2.0 | leftOnEol :: BufferM ()
-- @savingPrefCol@ is needed, because deep down @leftB@ contains @forgetPrefCol@
-- which messes up vertical cursor motion in Vim normal mode
leftOnEol = savingPrefCol $ do
eol <- atEol
sol <- atSol
when (eol && not sol) leftB
-- | Move @x@ chars back, or to the sol, whichever is less | 334 | leftOnEol :: BufferM ()
leftOnEol = savingPrefCol $ do
eol <- atEol
sol <- atSol
when (eol && not sol) leftB
-- | Move @x@ chars back, or to the sol, whichever is less | 192 | leftOnEol = savingPrefCol $ do
eol <- atEol
sol <- atSol
when (eol && not sol) leftB
-- | Move @x@ chars back, or to the sol, whichever is less | 168 | true | true | 0 | 11 | 79 | 55 | 27 | 28 | null | null |
brendanhay/gogol | gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Environments/Experiments/Stop.hs | mpl-2.0 | -- | JSONP
plaeesCallback :: Lens' ProjectsLocationsAgentsEnvironmentsExperimentsStop (Maybe Text)
plaeesCallback
= lens _plaeesCallback
(\ s a -> s{_plaeesCallback = a}) | 178 | plaeesCallback :: Lens' ProjectsLocationsAgentsEnvironmentsExperimentsStop (Maybe Text)
plaeesCallback
= lens _plaeesCallback
(\ s a -> s{_plaeesCallback = a}) | 167 | plaeesCallback
= lens _plaeesCallback
(\ s a -> s{_plaeesCallback = a}) | 79 | true | true | 1 | 9 | 27 | 52 | 25 | 27 | null | null |
PavelClaudiuStefan/FMI | An_3_Semestru_1/ProgramareDeclarativa/Laboratoare/Laborator2/PicturesSVG.hs | cc0-1.0 | -- flip one of the flags for transforms / filter
flipFH (Basic img (x,y) f@(Filter {fH=boo})) = Basic img (x,y) f{fH = not boo} | 130 | flipFH (Basic img (x,y) f@(Filter {fH=boo})) = Basic img (x,y) f{fH = not boo} | 80 | flipFH (Basic img (x,y) f@(Filter {fH=boo})) = Basic img (x,y) f{fH = not boo} | 80 | true | false | 0 | 11 | 26 | 66 | 36 | 30 | null | null |
MasseR/xmonadcontrib | XMonad/Layout/ZoomRow.hs | bsd-3-clause | setFocus :: Zipper a -> a -> Zipper a
setFocus Nothing a = Just $ W.Stack a [] [] | 81 | setFocus :: Zipper a -> a -> Zipper a
setFocus Nothing a = Just $ W.Stack a [] [] | 81 | setFocus Nothing a = Just $ W.Stack a [] [] | 43 | false | true | 0 | 7 | 18 | 47 | 22 | 25 | null | null |
fmapfmapfmap/amazonka | amazonka-storagegateway/gen/Network/AWS/StorageGateway/DeleteSnapshotSchedule.hs | mpl-2.0 | -- | Creates a value of 'DeleteSnapshotSchedule' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dVolumeARN'
deleteSnapshotSchedule
:: Text -- ^ 'dVolumeARN'
-> DeleteSnapshotSchedule
deleteSnapshotSchedule pVolumeARN_ =
DeleteSnapshotSchedule'
{ _dVolumeARN = pVolumeARN_
} | 380 | deleteSnapshotSchedule
:: Text -- ^ 'dVolumeARN'
-> DeleteSnapshotSchedule
deleteSnapshotSchedule pVolumeARN_ =
DeleteSnapshotSchedule'
{ _dVolumeARN = pVolumeARN_
} | 185 | deleteSnapshotSchedule pVolumeARN_ =
DeleteSnapshotSchedule'
{ _dVolumeARN = pVolumeARN_
} | 102 | true | true | 0 | 6 | 70 | 32 | 20 | 12 | null | null |
jean-edouard/xclibs | xchwebsocket/Network/WebSocket.hs | lgpl-2.1 | isControlOp Ping = True | 24 | isControlOp Ping = True | 24 | isControlOp Ping = True | 24 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
bgamari/pandoc | src/Text/Pandoc/Writers/OpenDocument.hs | gpl-2.0 | defaultWriterState :: WriterState
defaultWriterState =
WriterState { stNotes = []
, stTableStyles = []
, stParaStyles = []
, stListStyles = []
, stTextStyles = []
, stTextStyleAttr = Map.empty
, stIndentPara = 0
, stInDefinition = False
, stTight = False
, stFirstPara = False
, stImageId = 1
} | 515 | defaultWriterState :: WriterState
defaultWriterState =
WriterState { stNotes = []
, stTableStyles = []
, stParaStyles = []
, stListStyles = []
, stTextStyles = []
, stTextStyleAttr = Map.empty
, stIndentPara = 0
, stInDefinition = False
, stTight = False
, stFirstPara = False
, stImageId = 1
} | 515 | defaultWriterState =
WriterState { stNotes = []
, stTableStyles = []
, stParaStyles = []
, stListStyles = []
, stTextStyles = []
, stTextStyleAttr = Map.empty
, stIndentPara = 0
, stInDefinition = False
, stTight = False
, stFirstPara = False
, stImageId = 1
} | 481 | false | true | 0 | 7 | 271 | 91 | 57 | 34 | null | null |
remyoudompheng/hs-language-go | Language/Go/Parser/Tokens.hs | gpl-3.0 | goTokLBrace = token $ GoTokLBrace | 35 | goTokLBrace = token $ GoTokLBrace | 35 | goTokLBrace = token $ GoTokLBrace | 35 | false | false | 3 | 5 | 6 | 15 | 5 | 10 | null | null |
raichoo/Idris-dev | src/IRTS/JavaScript/AST.hs | bsd-3-clause | compileJS' indent (JSSeq seq) =
T.intercalate ";\n" (
map (
(T.replicate indent " " `T.append`) . (compileJS' indent)
) $ filter (/= JSNoop) seq
) `T.append` ";" | 179 | compileJS' indent (JSSeq seq) =
T.intercalate ";\n" (
map (
(T.replicate indent " " `T.append`) . (compileJS' indent)
) $ filter (/= JSNoop) seq
) `T.append` ";" | 179 | compileJS' indent (JSSeq seq) =
T.intercalate ";\n" (
map (
(T.replicate indent " " `T.append`) . (compileJS' indent)
) $ filter (/= JSNoop) seq
) `T.append` ";" | 179 | false | false | 0 | 13 | 44 | 86 | 43 | 43 | null | null |
shayan-najd/HsParser | U/Outputable.hs | gpl-3.0 | fcat :: [SDoc] -> SDoc
-- ^ This behaves like 'fsep', but it uses '<>' for horizontal conposition rather than '<+>'
hcat ds = SDoc $ \sty -> U.Pretty.hcat [runSDoc d sty | d <- ds] | 182 | fcat :: [SDoc] -> SDoc
hcat ds = SDoc $ \sty -> U.Pretty.hcat [runSDoc d sty | d <- ds] | 87 | hcat ds = SDoc $ \sty -> U.Pretty.hcat [runSDoc d sty | d <- ds] | 64 | true | true | 0 | 10 | 37 | 58 | 29 | 29 | null | null |
Rizary/hackage-matrix-builder | src-lib/IndexHelper.hs | gpl-3.0 | readIndexTuples :: FilePath -> IO [PkgIdxTuple]
readIndexTuples idxtar = do
es <- Tar.read <$> BSL.readFile idxtar
-- return $! Map.fromListWith (flip mappend) [ (k1,Map.singleton k2 v) | (k1,(k2,v)) <- golst es ]
return (internPkgIds $ mapMaybe decode $ asLst es)
where
asLst (Tar.Next e es) = e : asLst es
asLst Tar.Done = []
asLst (Tar.Fail e) = throw e
decode :: Tar.Entry -> Maybe IdxTuple
decode (Tar.Entry{..}) = do
(pkgn,mpkgv) <- decodeEntry (Tar.Entry{..})
pure (pkgn,mpkgv, 0, PkgIdxTs (fromIntegral entryTime), owner, owner_id)
where
!owner = T.pack $ Tar.ownerName entryOwnership
!owner_id = Tar.ownerId entryOwnership
internPkgIds :: [IdxTuple] -> [PkgIdxTuple]
internPkgIds = go2 mempty mempty mempty mempty
where
go2 _ _ _ _ [] = []
go2 !nc !vc !rc !oc ((n,mv,_,t,o,oi):es) = (PkgIdxTuple n' mv' r' t o' oi) : go2 nc' vc' rc' oc' es
where
(o',oc') = mapIntern o oc
(n',nc') = mapIntern n nc
(mv',vc') = case mv of
Just (Ver v) -> first (Just . Ver) (mapIntern v vc)
Nothing -> (Nothing, vc)
(r',rc') = lookupRev (n',mv') rc
lookupRev :: (PkgN,Maybe Ver) -> Map (PkgN,Maybe Ver) Word -> (Word,Map (PkgN,Maybe Ver) Word)
lookupRev nv m = (rev,m')
where
!m' = Map.alter upd nv m
!rev = Map.findWithDefault undefined nv m'
upd :: Maybe Word -> Maybe Word
upd Nothing = Just 0
upd (Just j) = Just $! (j+1)
---------------------------------------------------------------------------- | 1,722 | readIndexTuples :: FilePath -> IO [PkgIdxTuple]
readIndexTuples idxtar = do
es <- Tar.read <$> BSL.readFile idxtar
-- return $! Map.fromListWith (flip mappend) [ (k1,Map.singleton k2 v) | (k1,(k2,v)) <- golst es ]
return (internPkgIds $ mapMaybe decode $ asLst es)
where
asLst (Tar.Next e es) = e : asLst es
asLst Tar.Done = []
asLst (Tar.Fail e) = throw e
decode :: Tar.Entry -> Maybe IdxTuple
decode (Tar.Entry{..}) = do
(pkgn,mpkgv) <- decodeEntry (Tar.Entry{..})
pure (pkgn,mpkgv, 0, PkgIdxTs (fromIntegral entryTime), owner, owner_id)
where
!owner = T.pack $ Tar.ownerName entryOwnership
!owner_id = Tar.ownerId entryOwnership
internPkgIds :: [IdxTuple] -> [PkgIdxTuple]
internPkgIds = go2 mempty mempty mempty mempty
where
go2 _ _ _ _ [] = []
go2 !nc !vc !rc !oc ((n,mv,_,t,o,oi):es) = (PkgIdxTuple n' mv' r' t o' oi) : go2 nc' vc' rc' oc' es
where
(o',oc') = mapIntern o oc
(n',nc') = mapIntern n nc
(mv',vc') = case mv of
Just (Ver v) -> first (Just . Ver) (mapIntern v vc)
Nothing -> (Nothing, vc)
(r',rc') = lookupRev (n',mv') rc
lookupRev :: (PkgN,Maybe Ver) -> Map (PkgN,Maybe Ver) Word -> (Word,Map (PkgN,Maybe Ver) Word)
lookupRev nv m = (rev,m')
where
!m' = Map.alter upd nv m
!rev = Map.findWithDefault undefined nv m'
upd :: Maybe Word -> Maybe Word
upd Nothing = Just 0
upd (Just j) = Just $! (j+1)
---------------------------------------------------------------------------- | 1,722 | readIndexTuples idxtar = do
es <- Tar.read <$> BSL.readFile idxtar
-- return $! Map.fromListWith (flip mappend) [ (k1,Map.singleton k2 v) | (k1,(k2,v)) <- golst es ]
return (internPkgIds $ mapMaybe decode $ asLst es)
where
asLst (Tar.Next e es) = e : asLst es
asLst Tar.Done = []
asLst (Tar.Fail e) = throw e
decode :: Tar.Entry -> Maybe IdxTuple
decode (Tar.Entry{..}) = do
(pkgn,mpkgv) <- decodeEntry (Tar.Entry{..})
pure (pkgn,mpkgv, 0, PkgIdxTs (fromIntegral entryTime), owner, owner_id)
where
!owner = T.pack $ Tar.ownerName entryOwnership
!owner_id = Tar.ownerId entryOwnership
internPkgIds :: [IdxTuple] -> [PkgIdxTuple]
internPkgIds = go2 mempty mempty mempty mempty
where
go2 _ _ _ _ [] = []
go2 !nc !vc !rc !oc ((n,mv,_,t,o,oi):es) = (PkgIdxTuple n' mv' r' t o' oi) : go2 nc' vc' rc' oc' es
where
(o',oc') = mapIntern o oc
(n',nc') = mapIntern n nc
(mv',vc') = case mv of
Just (Ver v) -> first (Just . Ver) (mapIntern v vc)
Nothing -> (Nothing, vc)
(r',rc') = lookupRev (n',mv') rc
lookupRev :: (PkgN,Maybe Ver) -> Map (PkgN,Maybe Ver) Word -> (Word,Map (PkgN,Maybe Ver) Word)
lookupRev nv m = (rev,m')
where
!m' = Map.alter upd nv m
!rev = Map.findWithDefault undefined nv m'
upd :: Maybe Word -> Maybe Word
upd Nothing = Just 0
upd (Just j) = Just $! (j+1)
---------------------------------------------------------------------------- | 1,674 | false | true | 52 | 11 | 551 | 625 | 336 | 289 | null | null |
truls/almique | src/Almique/Analyzer.hs | gpl-3.0 | stringifyParamList :: [Parameter SrcSpan] -> AnM [String]
stringifyParamList = mapM unParam
where
unParam :: Parameter SrcSpan -> AnM String
unParam Param { param_name = PIdent i } = return i
unParam par = throwError ("Unsupported parameter" ++ show par)
-- TODO: Only remove quotation marks at start or end of string | 333 | stringifyParamList :: [Parameter SrcSpan] -> AnM [String]
stringifyParamList = mapM unParam
where
unParam :: Parameter SrcSpan -> AnM String
unParam Param { param_name = PIdent i } = return i
unParam par = throwError ("Unsupported parameter" ++ show par)
-- TODO: Only remove quotation marks at start or end of string | 333 | stringifyParamList = mapM unParam
where
unParam :: Parameter SrcSpan -> AnM String
unParam Param { param_name = PIdent i } = return i
unParam par = throwError ("Unsupported parameter" ++ show par)
-- TODO: Only remove quotation marks at start or end of string | 275 | false | true | 3 | 8 | 66 | 101 | 47 | 54 | null | null |
keithodulaigh/Hets | Common/InjMap.hs | gpl-2.0 | -- | check membership of an injective pair
member :: (Ord a, Ord b) => a -> b -> InjMap a b -> Bool
member a b (InjMap m n) = case (Map.lookup a m, Map.lookup b n) of
(Just x, Just y) | x == b && y == a -> True
_ -> False
-- | transpose to avoid duplicate code | 267 | member :: (Ord a, Ord b) => a -> b -> InjMap a b -> Bool
member a b (InjMap m n) = case (Map.lookup a m, Map.lookup b n) of
(Just x, Just y) | x == b && y == a -> True
_ -> False
-- | transpose to avoid duplicate code | 224 | member a b (InjMap m n) = case (Map.lookup a m, Map.lookup b n) of
(Just x, Just y) | x == b && y == a -> True
_ -> False
-- | transpose to avoid duplicate code | 167 | true | true | 0 | 13 | 69 | 126 | 63 | 63 | null | null |
alephcloud/hs-aws-general | src/Aws/SignatureV4.hs | mit | newCredentials
:: (Functor m, MonadIO m)
=> B.ByteString -- ^ Access Key ID
-> B.ByteString -- ^ Secret Access Key
-> Maybe B.ByteString -- ^ Security Token
-> m SignatureV4Credentials
newCredentials accessKeyId secretAccessKey securityToken = do
signingKeysRef <- liftIO $ newIORef []
return $ SignatureV4Credentials accessKeyId secretAccessKey signingKeysRef securityToken
-- -------------------------------------------------------------------------- --
-- Canonical URI | 501 | newCredentials
:: (Functor m, MonadIO m)
=> B.ByteString -- ^ Access Key ID
-> B.ByteString -- ^ Secret Access Key
-> Maybe B.ByteString -- ^ Security Token
-> m SignatureV4Credentials
newCredentials accessKeyId secretAccessKey securityToken = do
signingKeysRef <- liftIO $ newIORef []
return $ SignatureV4Credentials accessKeyId secretAccessKey signingKeysRef securityToken
-- -------------------------------------------------------------------------- --
-- Canonical URI | 501 | newCredentials accessKeyId secretAccessKey securityToken = do
signingKeysRef <- liftIO $ newIORef []
return $ SignatureV4Credentials accessKeyId secretAccessKey signingKeysRef securityToken
-- -------------------------------------------------------------------------- --
-- Canonical URI | 296 | false | true | 0 | 10 | 83 | 94 | 47 | 47 | null | null |
Mahdi89/eTeak | src/Plot.hs | bsd-3-clause | compUsePortNames (TeakComp { nwTeakType = TeakX {} }) 1 = False | 63 | compUsePortNames (TeakComp { nwTeakType = TeakX {} }) 1 = False | 63 | compUsePortNames (TeakComp { nwTeakType = TeakX {} }) 1 = False | 63 | false | false | 0 | 10 | 10 | 27 | 14 | 13 | null | null |
HMPerson1/soiie | src/Language/Soiie/AST.hs | gpl-3.0 | eTimes e1 e2 = Fix $ Times e1 e2 | 34 | eTimes e1 e2 = Fix $ Times e1 e2 | 34 | eTimes e1 e2 = Fix $ Times e1 e2 | 34 | false | false | 0 | 6 | 10 | 20 | 9 | 11 | null | null |
lpenz/realworldhaskell-exercises | ch05/Prettify.hs | mit | w `fits` (c:cs) = (w - 1) `fits` cs | 38 | w `fits` (c:cs) = (w - 1) `fits` cs | 38 | w `fits` (c:cs) = (w - 1) `fits` cs | 38 | false | false | 0 | 7 | 11 | 38 | 20 | 18 | null | null |
gustavoramos00/tecnicas-topdown | S8_1.hs | mit | msort xs = divideAndConquer ind id divide combine xs
where ind xs = length xs <= 1
divide xs = let n = length xs `div` 2
in [take n xs , drop n xs]
combine _ [l1,l2] = merge l1 l2 | 254 | msort xs = divideAndConquer ind id divide combine xs
where ind xs = length xs <= 1
divide xs = let n = length xs `div` 2
in [take n xs , drop n xs]
combine _ [l1,l2] = merge l1 l2 | 254 | msort xs = divideAndConquer ind id divide combine xs
where ind xs = length xs <= 1
divide xs = let n = length xs `div` 2
in [take n xs , drop n xs]
combine _ [l1,l2] = merge l1 l2 | 254 | false | false | 0 | 12 | 116 | 102 | 50 | 52 | null | null |
chaosim/peasy | coffee/samples/latex.hs | mit | breve 'E' = "Ĕ" | 15 | breve 'E' = "Ĕ" | 15 | breve 'E' = "Ĕ" | 15 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
kojiromike/Idris-dev | src/Idris/Error.hs | bsd-3-clause | warnDisamb ist (PResolveTC _) = return () | 41 | warnDisamb ist (PResolveTC _) = return () | 41 | warnDisamb ist (PResolveTC _) = return () | 41 | false | false | 0 | 7 | 6 | 23 | 10 | 13 | null | null |
ethercrow/yi | yi-keymap-vim/src/Yi/Keymap/Vim.hs | gpl-2.0 | convertEvent ReplaceSingleChar _ e = e | 38 | convertEvent ReplaceSingleChar _ e = e | 38 | convertEvent ReplaceSingleChar _ e = e | 38 | false | false | 1 | 5 | 5 | 15 | 6 | 9 | null | null |
fehu/h-logic-einstein | src/LogicProblem/Solver/Env.hs | mit | setEntry :: (Entry e) => e -> ETable e -> ETable e
setEntry e (ETable mp) = ETable $ M.adjust (const e) (getId e) mp | 116 | setEntry :: (Entry e) => e -> ETable e -> ETable e
setEntry e (ETable mp) = ETable $ M.adjust (const e) (getId e) mp | 116 | setEntry e (ETable mp) = ETable $ M.adjust (const e) (getId e) mp | 65 | false | true | 0 | 8 | 24 | 75 | 35 | 40 | null | null |
urbanslug/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | leftAssocDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "LeftAssociative") | 75 | leftAssocDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "LeftAssociative") | 75 | leftAssocDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "LeftAssociative") | 75 | false | false | 0 | 7 | 6 | 17 | 8 | 9 | null | null |
Kotolegokot/Underlisp | src/Interpreter.hs | gpl-3.0 | -- | Collect imports in the scope
collectImports :: IORef Scope -> [SExpr] -> EvalM [SExpr]
collectImports scopeRef = foldM (\acc exp -> do
import' <- parseImport exp
case import' of
Just filename -> do moduleScope <- interpreteModule True filename
liftIO $ modifyIORef scopeRef $ modifyImports (moduleScope:)
return acc
Nothing -> return $ acc ++ [exp])
[] | 653 | collectImports :: IORef Scope -> [SExpr] -> EvalM [SExpr]
collectImports scopeRef = foldM (\acc exp -> do
import' <- parseImport exp
case import' of
Just filename -> do moduleScope <- interpreteModule True filename
liftIO $ modifyIORef scopeRef $ modifyImports (moduleScope:)
return acc
Nothing -> return $ acc ++ [exp])
[] | 619 | collectImports scopeRef = foldM (\acc exp -> do
import' <- parseImport exp
case import' of
Just filename -> do moduleScope <- interpreteModule True filename
liftIO $ modifyIORef scopeRef $ modifyImports (moduleScope:)
return acc
Nothing -> return $ acc ++ [exp])
[] | 561 | true | true | 0 | 17 | 352 | 134 | 64 | 70 | null | null |
lettier/gifcurry | src/gui/GuiKeyboard.hs | bsd-3-clause | handleSeekKeys _ _ = return () | 30 | handleSeekKeys _ _ = return () | 30 | handleSeekKeys _ _ = return () | 30 | false | false | 1 | 6 | 5 | 16 | 7 | 9 | null | null |
nevrenato/Hets_Fork | Interfaces/Command.hs | gpl-2.0 | describeGlobCmd :: GlobCmd -> String
describeGlobCmd c =
let mt = menuTextGlobCmd c
t = map toLower mt in
case c of
Automatic -> "Apply automatic tactic"
CompositionProveEdges -> t
CompositionCreateEdges -> t
QualifyNames -> "Qualify and disambiguate all signature names"
NormalForm -> "Compute normal forms for nodes with incoming hiding links"
Importing -> "Flatten all theories and delete all importing links"
DisjointUnion -> "Create intersection nodes and ensure only disjoint unions"
Hiding -> "Delete all hiding links"
ProveCurrent -> "Applies selected prover to selected goals"
DropTranslation -> "Drops any selected comorphism"
_ | isDgRule c -> "Apply rule " ++ t
| isFlatteningCmd c -> "Flatten out " ++ t
| isUndoOrRedo c -> mt ++ " last change"
_ -> t | 806 | describeGlobCmd :: GlobCmd -> String
describeGlobCmd c =
let mt = menuTextGlobCmd c
t = map toLower mt in
case c of
Automatic -> "Apply automatic tactic"
CompositionProveEdges -> t
CompositionCreateEdges -> t
QualifyNames -> "Qualify and disambiguate all signature names"
NormalForm -> "Compute normal forms for nodes with incoming hiding links"
Importing -> "Flatten all theories and delete all importing links"
DisjointUnion -> "Create intersection nodes and ensure only disjoint unions"
Hiding -> "Delete all hiding links"
ProveCurrent -> "Applies selected prover to selected goals"
DropTranslation -> "Drops any selected comorphism"
_ | isDgRule c -> "Apply rule " ++ t
| isFlatteningCmd c -> "Flatten out " ++ t
| isUndoOrRedo c -> mt ++ " last change"
_ -> t | 806 | describeGlobCmd c =
let mt = menuTextGlobCmd c
t = map toLower mt in
case c of
Automatic -> "Apply automatic tactic"
CompositionProveEdges -> t
CompositionCreateEdges -> t
QualifyNames -> "Qualify and disambiguate all signature names"
NormalForm -> "Compute normal forms for nodes with incoming hiding links"
Importing -> "Flatten all theories and delete all importing links"
DisjointUnion -> "Create intersection nodes and ensure only disjoint unions"
Hiding -> "Delete all hiding links"
ProveCurrent -> "Applies selected prover to selected goals"
DropTranslation -> "Drops any selected comorphism"
_ | isDgRule c -> "Apply rule " ++ t
| isFlatteningCmd c -> "Flatten out " ++ t
| isUndoOrRedo c -> mt ++ " last change"
_ -> t | 769 | false | true | 0 | 13 | 164 | 167 | 78 | 89 | null | null |
mpickering/hlint-refactor | src/Refact/Utils.hs | bsd-3-clause | -- | Replaces an old expression with a new expression
--
-- Note that usually, new, inp and parent are all the same.
replace :: AnnKey -- The thing we are replacing
-> AnnKey -- The thing which has the annotations we need for the new thing
-> AnnKey -- The thing which is going to be inserted
-> AnnKey -- The "parent", the largest thing which has he same SrcSpan
-- Usually the same as inp and new
-> Anns -> Maybe Anns
replace old new inp parent anns = do
oldan <- Map.lookup old anns
newan <- Map.lookup new anns
oldDelta <- annEntryDelta <$> Map.lookup parent anns
return $ Map.insert inp (combine oldDelta new oldan newan) anns | 696 | replace :: AnnKey -- The thing we are replacing
-> AnnKey -- The thing which has the annotations we need for the new thing
-> AnnKey -- The thing which is going to be inserted
-> AnnKey -- The "parent", the largest thing which has he same SrcSpan
-- Usually the same as inp and new
-> Anns -> Maybe Anns
replace old new inp parent anns = do
oldan <- Map.lookup old anns
newan <- Map.lookup new anns
oldDelta <- annEntryDelta <$> Map.lookup parent anns
return $ Map.insert inp (combine oldDelta new oldan newan) anns | 579 | replace old new inp parent anns = do
oldan <- Map.lookup old anns
newan <- Map.lookup new anns
oldDelta <- annEntryDelta <$> Map.lookup parent anns
return $ Map.insert inp (combine oldDelta new oldan newan) anns | 220 | true | true | 0 | 10 | 182 | 127 | 63 | 64 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.