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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rueshyna/gogol | gogol-apps-calendar/gen/Network/Google/AppsCalendar/Types/Product.hs | mpl-2.0 | -- | The creator of the event. Read-only.
eCreator :: Lens' Event (Maybe EventCreator)
eCreator = lens _eCreator (\ s a -> s{_eCreator = a}) | 140 | eCreator :: Lens' Event (Maybe EventCreator)
eCreator = lens _eCreator (\ s a -> s{_eCreator = a}) | 98 | eCreator = lens _eCreator (\ s a -> s{_eCreator = a}) | 53 | true | true | 0 | 9 | 24 | 46 | 25 | 21 | null | null |
dpac-vlsi/Sigil-Trace-Visualizer | haskell/stgraph/app/Main.hs | bsd-2-clause | -- Use Megaparsec
-- These definitions are required because we are working with Word8's.
-- If there was an implicit conversion from Char to Word8,
-- we could just use e.g. ':' instead of 58 :: Word8.
zero = 48 | 212 | zero = 48 | 9 | zero = 48 | 9 | true | false | 0 | 4 | 40 | 10 | 7 | 3 | null | null |
jgm/citeproc | src/Citeproc/Types.hs | bsd-2-clause | variableType "collection-title" = StringVariable | 48 | variableType "collection-title" = StringVariable | 48 | variableType "collection-title" = StringVariable | 48 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
diminishedprime/.org | reading-list/haskell_programming_from_first_principles/15_12.hs | mit | monoidRightIdentity :: (Eq m, Monoid m) => m -> Bool
monoidRightIdentity a = (a <> mempty) == a | 95 | monoidRightIdentity :: (Eq m, Monoid m) => m -> Bool
monoidRightIdentity a = (a <> mempty) == a | 95 | monoidRightIdentity a = (a <> mempty) == a | 42 | false | true | 0 | 8 | 17 | 50 | 24 | 26 | null | null |
apyrgio/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | opStatusSuccess :: String
opStatusSuccess = "success" | 53 | opStatusSuccess :: String
opStatusSuccess = "success" | 53 | opStatusSuccess = "success" | 27 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
kim/amazonka | amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/UpdateApplication.hs | mpl-2.0 | -- | A new description for the application.
--
-- Default: If not specified, AWS Elastic Beanstalk does not update the
-- description.
uaDescription :: Lens' UpdateApplication (Maybe Text)
uaDescription = lens _uaDescription (\s a -> s { _uaDescription = a }) | 259 | uaDescription :: Lens' UpdateApplication (Maybe Text)
uaDescription = lens _uaDescription (\s a -> s { _uaDescription = a }) | 124 | uaDescription = lens _uaDescription (\s a -> s { _uaDescription = a }) | 70 | true | true | 1 | 9 | 41 | 54 | 28 | 26 | null | null |
k-bx/wreq | Network/Wreq.hs | bsd-3-clause | asValue = asJSON | 16 | asValue = asJSON | 16 | asValue = asJSON | 16 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
nsmryan/Misc | src/PipeOperators.hs | bsd-3-clause | reconstitute' piece = do
chunk <- await
case chunk of
Piece piece' -> do
reconstitute' $ piece S.>< piece'
Location a -> do
reconstitute' $ piece S.|> a
Flush -> do
yield piece
reconstitute' S.empty | 240 | reconstitute' piece = do
chunk <- await
case chunk of
Piece piece' -> do
reconstitute' $ piece S.>< piece'
Location a -> do
reconstitute' $ piece S.|> a
Flush -> do
yield piece
reconstitute' S.empty | 240 | reconstitute' piece = do
chunk <- await
case chunk of
Piece piece' -> do
reconstitute' $ piece S.>< piece'
Location a -> do
reconstitute' $ piece S.|> a
Flush -> do
yield piece
reconstitute' S.empty | 240 | false | false | 0 | 13 | 76 | 87 | 38 | 49 | null | null |
frantisekfarka/ghc-dsi | libraries/base/Data/Data.hs | bsd-3-clause | tuple7Constr :: Constr
tuple7Constr = mkConstr tuple7DataType "(,,,,,,)" [] Infix | 81 | tuple7Constr :: Constr
tuple7Constr = mkConstr tuple7DataType "(,,,,,,)" [] Infix | 81 | tuple7Constr = mkConstr tuple7DataType "(,,,,,,)" [] Infix | 58 | false | true | 0 | 6 | 9 | 29 | 12 | 17 | null | null |
kim/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types.hs | mpl-2.0 | -- | The MAC address.
niMacAddress :: Lens' NetworkInterface (Maybe Text)
niMacAddress = lens _niMacAddress (\s a -> s { _niMacAddress = a }) | 141 | niMacAddress :: Lens' NetworkInterface (Maybe Text)
niMacAddress = lens _niMacAddress (\s a -> s { _niMacAddress = a }) | 119 | niMacAddress = lens _niMacAddress (\s a -> s { _niMacAddress = a }) | 67 | true | true | 2 | 9 | 23 | 55 | 25 | 30 | null | null |
kimsnj/writeAscheme | src/Types.hs | mit | showListVal :: [LispVal] -> String
showListVal = unwords . map showVal | 70 | showListVal :: [LispVal] -> String
showListVal = unwords . map showVal | 70 | showListVal = unwords . map showVal | 35 | false | true | 0 | 6 | 10 | 25 | 13 | 12 | null | null |
EFulmer/haskell-scheme-wikibook | src/Exercises/Ch2/Pt1/Ex2.hs | bsd-3-clause | parseExpr :: Parser LispVal
parseExpr = parseAtom
<|> parseString'
<|> parseNumber' | 101 | parseExpr :: Parser LispVal
parseExpr = parseAtom
<|> parseString'
<|> parseNumber' | 101 | parseExpr = parseAtom
<|> parseString'
<|> parseNumber' | 73 | false | true | 0 | 6 | 28 | 22 | 11 | 11 | null | null |
ggreif/clash-compiler | examples/i2c/I2C/Slave.hs | bsd-2-clause | pca9552 :: Signal ((Bit, Bool), (Bit, Bool)) -- SDA, SCL + flanks
-> Signal Bit -- SDA-out
pca9552 i = o
where (read, conds, o) = unbundle $ bitSlave i write ack
(ack, write) = mealyB step (0, CLaSH.Prelude.repeat 0b01010101) (read, conds)
step :: StateX -> (Unsigned 8, ... | 428 | pca9552 :: Signal ((Bit, Bool), (Bit, Bool)) -- SDA, SCL + flanks
-> Signal Bit
pca9552 i = o
where (read, conds, o) = unbundle $ bitSlave i write ack
(ack, write) = mealyB step (0, CLaSH.Prelude.repeat 0b01010101) (read, conds)
step :: StateX -> (Unsigned 8, (Bool, Bool, Bool, Bool)) -> (Stat... | 394 | pca9552 i = o
where (read, conds, o) = unbundle $ bitSlave i write ack
(ack, write) = mealyB step (0, CLaSH.Prelude.repeat 0b01010101) (read, conds)
step :: StateX -> (Unsigned 8, (Bool, Bool, Bool, Bool)) -> (StateX, (Bool, Maybe ToSend))
step s i = (s, (True, Nothing)) -- FIXME | 306 | true | true | 2 | 11 | 122 | 181 | 104 | 77 | null | null |
cgaebel/system-random-effect | bench/Bench.hs | bsd-3-clause | main :: IO ()
main =
defaultMainWith config (return ()) [
bcompare [
bench "fastIntDist" (fastIntDist 1 1000 :: Eff (State Random :> ()) Int)
, bench "uniformIntDist" (uniformIntDist 1 1000 :: Eff (State Random :> ()) Integer)
, bench "uniformIntegralDist" (uniformI... | 1,680 | main :: IO ()
main =
defaultMainWith config (return ()) [
bcompare [
bench "fastIntDist" (fastIntDist 1 1000 :: Eff (State Random :> ()) Int)
, bench "uniformIntDist" (uniformIntDist 1 1000 :: Eff (State Random :> ()) Integer)
, bench "uniformIntegralDist" (uniformI... | 1,680 | main =
defaultMainWith config (return ()) [
bcompare [
bench "fastIntDist" (fastIntDist 1 1000 :: Eff (State Random :> ()) Int)
, bench "uniformIntDist" (uniformIntDist 1 1000 :: Eff (State Random :> ()) Integer)
, bench "uniformIntegralDist" (uniformIntegralDist 1 ... | 1,666 | false | true | 1 | 14 | 528 | 601 | 301 | 300 | null | null |
msakai/icfpc2015 | src/Tactics/RandomWalk2.hs | bsd-3-clause | applyCommand :: Command -> Unit.Unit -> Unit.Unit
applyCommand (Move dir) = Unit.move dir | 89 | applyCommand :: Command -> Unit.Unit -> Unit.Unit
applyCommand (Move dir) = Unit.move dir | 89 | applyCommand (Move dir) = Unit.move dir | 39 | false | true | 0 | 10 | 12 | 42 | 19 | 23 | null | null |
xmonad/xmonad-contrib | XMonad/Layout/Groups.hs | bsd-3-clause | -- | Swap the focused window with the previous one.
swapUp :: ModifySpec
swapUp = onFocused swapUpZ | 99 | swapUp :: ModifySpec
swapUp = onFocused swapUpZ | 47 | swapUp = onFocused swapUpZ | 26 | true | true | 0 | 5 | 16 | 15 | 8 | 7 | null | null |
kyren/hsgb | lib/Gameboy/Instructions.hs | unlicense | encodeInstruction (SET_B_R Bit7 ERegister) = [0xcb, 0xfb] | 57 | encodeInstruction (SET_B_R Bit7 ERegister) = [0xcb, 0xfb] | 57 | encodeInstruction (SET_B_R Bit7 ERegister) = [0xcb, 0xfb] | 57 | false | false | 0 | 6 | 6 | 24 | 12 | 12 | null | null |
enolan/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | -- | Pretty-printer helper for the binding site of a name
bindingOf :: Name -- ^^ the bound name
-> Bool -- ^^ whether the name is implicit
-> Doc OutputAnnotation
bindingOf n imp = annotate (AnnBoundName n imp) (text (show n)) | 247 | bindingOf :: Name -- ^^ the bound name
-> Bool -- ^^ whether the name is implicit
-> Doc OutputAnnotation
bindingOf n imp = annotate (AnnBoundName n imp) (text (show n)) | 189 | bindingOf n imp = annotate (AnnBoundName n imp) (text (show n)) | 63 | true | true | 0 | 9 | 61 | 59 | 29 | 30 | null | null |
ctford/Idris-Elba-dev | src/IRTS/CodegenLLVM.hs | bsd-3-clause | nameAlt _ (SConstCase const _) = getName (show const) | 53 | nameAlt _ (SConstCase const _) = getName (show const) | 53 | nameAlt _ (SConstCase const _) = getName (show const) | 53 | false | false | 0 | 7 | 8 | 28 | 13 | 15 | null | null |
ghorn/cs240h-class | Lab2/Rect.hs | bsd-3-clause | -- find the minimum bounding box of a list of rectangles
getMbrs :: [Rect] -> Rect
getMbrs [] = error "can't getMbrs on empty list" | 131 | getMbrs :: [Rect] -> Rect
getMbrs [] = error "can't getMbrs on empty list" | 74 | getMbrs [] = error "can't getMbrs on empty list" | 48 | true | true | 0 | 6 | 24 | 31 | 15 | 16 | null | null |
jd823592/puppeteer | src/Puppet/Master/Colour.hs | mit | tokencls String = "hs-str" | 30 | tokencls String = "hs-str" | 30 | tokencls String = "hs-str" | 30 | false | false | 0 | 4 | 7 | 10 | 4 | 6 | null | null |
geocurnoff/nikki | src/Base/Prose.hs | lgpl-3.0 | nullProse :: Prose -> Bool
nullProse (Prose snippets) =
all Text.null $ fmap snd snippets | 93 | nullProse :: Prose -> Bool
nullProse (Prose snippets) =
all Text.null $ fmap snd snippets | 93 | nullProse (Prose snippets) =
all Text.null $ fmap snd snippets | 66 | false | true | 2 | 9 | 18 | 44 | 19 | 25 | null | null |
suhailshergill/liboleg | Language/TEval/TInfTEnv.hs | bsd-3-clause | -- is typechecking really decidable?
-- Can termY be typechecked?
delta = L "y" (vy `A` vy) | 92 | delta = L "y" (vy `A` vy) | 25 | delta = L "y" (vy `A` vy) | 25 | true | false | 0 | 7 | 17 | 22 | 13 | 9 | null | null |
GU-CLASP/TypedFlow | TypedFlow/Layers/RNN/Attention.hs | lgpl-3.0 | attentiveWithFeedback ::forall attSize cellSize inputSize w ss. KnownNat inputSize => KnownNat attSize => KnownLen ss =>
KnownTyp w =>
AttentionFunction w cellSize attSize ->
RnnCell w ss (T '[inputSize+attSize] w) (T '[cellSize] w) ->
RnnCell w ('[attSize] ': ss) (T '[inputSize ] w) ... | 430 | attentiveWithFeedback ::forall attSize cellSize inputSize w ss. KnownNat inputSize => KnownNat attSize => KnownLen ss =>
KnownTyp w =>
AttentionFunction w cellSize attSize ->
RnnCell w ss (T '[inputSize+attSize] w) (T '[cellSize] w) ->
RnnCell w ('[attSize] ': ss) (T '[inputSize ] w) ... | 430 | attentiveWithFeedback attn cell = appRUnit @ss #> withFeedback (cell .-. timeDistribute attn) | 93 | false | true | 0 | 17 | 92 | 178 | 90 | 88 | null | null |
dmbarbour/Sirea | src/Sirea/Internal/Tuning.hs | bsd-3-clause | - heartbeat and periodic increase of stability
dtGrace = dtHeartbeat | 73 | dtGrace = dtHeartbeat | 25 | dtGrace = dtHeartbeat | 25 | true | false | 0 | 5 | 14 | 22 | 10 | 12 | null | null |
printedheart/Dao | src/Dao/Logic.hs | agpl-3.0 | -- | Return many possible results.
possibly :: MonadLogic st m => [a] -> LogicT st m a
possibly o = superState $ \st -> fmap (\o -> (o, st)) o | 142 | possibly :: MonadLogic st m => [a] -> LogicT st m a
possibly o = superState $ \st -> fmap (\o -> (o, st)) o | 107 | possibly o = superState $ \st -> fmap (\o -> (o, st)) o | 55 | true | true | 0 | 10 | 30 | 66 | 35 | 31 | null | null |
glguy/irc-core | src/ContextFilter.hs | isc | selectList (Skip x) (_ : ys) = selectList x ys | 50 | selectList (Skip x) (_ : ys) = selectList x ys | 50 | selectList (Skip x) (_ : ys) = selectList x ys | 50 | false | false | 0 | 7 | 13 | 29 | 14 | 15 | null | null |
rkaippully/real-world-haskell | RWH/Chapter4.hs | gpl-3.0 | {- |
Using the command framework from the earlier section “A Simple Command-Line
Framework” on page 71, write a program that prints the first word of each line of
its input.
-}
interactWith :: (String -> String) -> FilePath -> FilePath -> IO ()
interactWith function inputFile outputFile = do
input <- read... | 374 | interactWith :: (String -> String) -> FilePath -> FilePath -> IO ()
interactWith function inputFile outputFile = do
input <- readFile inputFile
writeFile outputFile (function input) | 185 | interactWith function inputFile outputFile = do
input <- readFile inputFile
writeFile outputFile (function input) | 117 | true | true | 0 | 10 | 73 | 73 | 33 | 40 | null | null |
kellino/TypeSystems | gradualSecurity/src/StaticCheck.hs | mit | runOverFile env (binding@(nm, _):xs) = do
let new = runStatic env binding
case new of
Left err -> Left err
Right gty -> runOverFile (extendGamma env (nm, gty)) xs | 188 | runOverFile env (binding@(nm, _):xs) = do
let new = runStatic env binding
case new of
Left err -> Left err
Right gty -> runOverFile (extendGamma env (nm, gty)) xs | 188 | runOverFile env (binding@(nm, _):xs) = do
let new = runStatic env binding
case new of
Left err -> Left err
Right gty -> runOverFile (extendGamma env (nm, gty)) xs | 188 | false | false | 0 | 13 | 54 | 88 | 43 | 45 | null | null |
enolan/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | pprintTT :: [Name] -- ^ The bound names (for highlighting and de Bruijn indices)
-> TT Name -- ^ The term to be printed
-> Doc OutputAnnotation
pprintTT bound tm = pp startPrec bound tm
where
startPrec = 0
appPrec = 10
pp p bound (P Bound n ty) = annotate (AnnBoundName n False) (tex... | 3,771 | pprintTT :: [Name] -- ^ The bound names (for highlighting and de Bruijn indices)
-> TT Name -- ^ The term to be printed
-> Doc OutputAnnotation
pprintTT bound tm = pp startPrec bound tm
where
startPrec = 0
appPrec = 10
pp p bound (P Bound n ty) = annotate (AnnBoundName n False) (tex... | 3,771 | pprintTT bound tm = pp startPrec bound tm
where
startPrec = 0
appPrec = 10
pp p bound (P Bound n ty) = annotate (AnnBoundName n False) (text $ show n)
pp p bound (P nt n ty) = annotate (AnnName n Nothing Nothing Nothing)
(text $ show n)
pp p bound (V i... | 3,608 | false | true | 37 | 18 | 1,376 | 1,683 | 740 | 943 | null | null |
jwiegley/ghc-release | libraries/containers/Data/Sequence.hs | gpl-3.0 | -- | /O(i)/ where /i/ is the breakpoint index. 'breakl', applied to a
-- predicate @p@ and a sequence @xs@, returns a pair whose first element
-- is the longest prefix (possibly empty) of @xs@ of elements that
-- /do not satisfy/ @p@ and the second element is the remainder of
-- the sequence.
--
-- @'breakl' p@ is equ... | 476 | breakl :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
breakl p xs = foldr (\ i _ -> splitAt i xs) (xs, empty) (findIndicesL p xs) | 124 | breakl p xs = foldr (\ i _ -> splitAt i xs) (xs, empty) (findIndicesL p xs) | 75 | true | true | 0 | 8 | 95 | 89 | 49 | 40 | null | null |
anchor/vaultaire-collector-ceilometer | test/Main.hs | mit | expectedNetworkRxTimestamp :: TimeStamp
expectedNetworkRxTimestamp = TimeStamp 1412295907000000000 | 98 | expectedNetworkRxTimestamp :: TimeStamp
expectedNetworkRxTimestamp = TimeStamp 1412295907000000000 | 98 | expectedNetworkRxTimestamp = TimeStamp 1412295907000000000 | 58 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 147175 = 2905 | 33 | getValueFromProduct 147175 = 2905 | 33 | getValueFromProduct 147175 = 2905 | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
gsdlab/clafer | src/Language/Clafer/SplitJoin.hs | mit | -- | Given a sequence of arguments, join them together in a manner that could be used on
-- | the command line, giving preference to the Windows @cmd@ shell quoting conventions.
-- | For an alternative version, intended for actual running the result in a shell, see "System.Process.showCommandForUser"
joinArgs :: [Stri... | 726 | joinArgs :: [String] -> String
joinArgs = unwords . map f
where
f x = q ++ g x ++ q
where
hasSpace = any isSpace x
q = ['\"' | hasSpace || null x]
g ('\\':'\"':xs') = '\\':'\\':'\\':'\"': g xs'
g "\\" | hasSpace = "\\\\"
... | 423 | joinArgs = unwords . map f
where
f x = q ++ g x ++ q
where
hasSpace = any isSpace x
q = ['\"' | hasSpace || null x]
g ('\\':'\"':xs') = '\\':'\\':'\\':'\"': g xs'
g "\\" | hasSpace = "\\\\"
g ('\"':xs') = '\\':'\"':... | 392 | true | true | 0 | 12 | 250 | 164 | 83 | 81 | null | null |
teuffy/interactive-brokers | library/API/IB/Enum.hs | bsd-3-clause | parseIBOrderWhyHeld :: Parser IBOrderWhyHeld
parseIBOrderWhyHeld =
option NoReason (return Locate <* string "locate") | 120 | parseIBOrderWhyHeld :: Parser IBOrderWhyHeld
parseIBOrderWhyHeld =
option NoReason (return Locate <* string "locate") | 120 | parseIBOrderWhyHeld =
option NoReason (return Locate <* string "locate") | 75 | false | true | 0 | 8 | 15 | 33 | 15 | 18 | null | null |
fboyer/craft3e | UsePictures.hs | mit | h1 :: Picture
h1 = horsesLine `above` invertedHorsesLine | 56 | h1 :: Picture
h1 = horsesLine `above` invertedHorsesLine | 56 | h1 = horsesLine `above` invertedHorsesLine | 42 | false | true | 0 | 6 | 7 | 26 | 12 | 14 | null | null |
sol/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | orderedList :: GenParser Char ParserState Block
orderedList = try $ do
string "\\begin"
spaces
string "{enumerate}"
spaces
(_, style, delim) <- option (1, DefaultStyle, DefaultDelim) $
try $ do failIfStrict
char '['
... | 1,110 | orderedList :: GenParser Char ParserState Block
orderedList = try $ do
string "\\begin"
spaces
string "{enumerate}"
spaces
(_, style, delim) <- option (1, DefaultStyle, DefaultDelim) $
try $ do failIfStrict
char '['
... | 1,110 | orderedList = try $ do
string "\\begin"
spaces
string "{enumerate}"
spaces
(_, style, delim) <- option (1, DefaultStyle, DefaultDelim) $
try $ do failIfStrict
char '['
res <- anyOrderedListMarker
... | 1,062 | false | true | 0 | 15 | 576 | 278 | 119 | 159 | null | null |
lostbean/sledge | src/File/ANGWriter.hs | gpl-3.0 | comment :: Builder
comment = render ("\n#" :: Text) | 51 | comment :: Builder
comment = render ("\n#" :: Text) | 51 | comment = render ("\n#" :: Text) | 32 | false | true | 0 | 6 | 8 | 20 | 11 | 9 | null | null |
jsavatgy/xroads-game | code/blue-angles-text.hs | gpl-2.0 | dirVecs = concat dirVecs2 | 25 | dirVecs = concat dirVecs2 | 25 | dirVecs = concat dirVecs2 | 25 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
argent0/haskell-ml-benchmark | src/MainGADT.hs | mit | sNFeatures :: SNat NFeatures
sNFeatures = SS (SS SZ) | 52 | sNFeatures :: SNat NFeatures
sNFeatures = SS (SS SZ) | 52 | sNFeatures = SS (SS SZ) | 23 | false | true | 0 | 7 | 8 | 23 | 11 | 12 | null | null |
pbv/codex | src/Codex/Tester/Utils.hs | mit | readable :: FileMode -> FileMode
readable mode =
mode .|. ownerReadMode .|. groupReadMode .|. otherReadMode | 109 | readable :: FileMode -> FileMode
readable mode =
mode .|. ownerReadMode .|. groupReadMode .|. otherReadMode | 109 | readable mode =
mode .|. ownerReadMode .|. groupReadMode .|. otherReadMode | 76 | false | true | 0 | 7 | 16 | 30 | 15 | 15 | null | null |
nikivazou/hscolour | Language/Haskell/HsColour/LaTeX.hs | gpl-2.0 | -- | Generic LaTeX document preamble.
latexPrefix title = unlines
["\\documentclass[a4paper, 12pt]{article}"
,"\\usepackage[usenames]{color}"
,"\\usepackage{hyperref}"
,"\\newsavebox{\\spaceb}"
,"\\newsavebox{\\tabb}"
,"\\savebox{\\spaceb}[1ex]{~}"
,"\\savebox{\\tabb}[4ex]{~}"
,"\\newcom... | 567 | latexPrefix title = unlines
["\\documentclass[a4paper, 12pt]{article}"
,"\\usepackage[usenames]{color}"
,"\\usepackage{hyperref}"
,"\\newsavebox{\\spaceb}"
,"\\newsavebox{\\tabb}"
,"\\savebox{\\spaceb}[1ex]{~}"
,"\\savebox{\\tabb}[4ex]{~}"
,"\\newcommand{\\hsspace}{\\usebox{\\spaceb}}"
... | 529 | latexPrefix title = unlines
["\\documentclass[a4paper, 12pt]{article}"
,"\\usepackage[usenames]{color}"
,"\\usepackage{hyperref}"
,"\\newsavebox{\\spaceb}"
,"\\newsavebox{\\tabb}"
,"\\savebox{\\spaceb}[1ex]{~}"
,"\\savebox{\\tabb}[4ex]{~}"
,"\\newcommand{\\hsspace}{\\usebox{\\spaceb}}"
... | 529 | true | false | 0 | 7 | 93 | 66 | 40 | 26 | null | null |
lenary/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | intTyName :: IntTy -> String
intTyName ITNative = "Int" | 55 | intTyName :: IntTy -> String
intTyName ITNative = "Int" | 55 | intTyName ITNative = "Int" | 26 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
jml/haverer | lib/Haverer/Internal/Ring.hs | apache-2.0 | dropItem :: (Eq a) => Ring a -> a -> Maybe (Ring a)
dropItem ring item =
case span (/=item) (_items ring) of
(_, []) -> Just ring
([], [_]) -> Nothing
(pre, _:xs) ->
let newLength = _length ring - 1
current = _current ring
in
Just $ ring {
_items = pre ++ xs,
_length = n... | 460 | dropItem :: (Eq a) => Ring a -> a -> Maybe (Ring a)
dropItem ring item =
case span (/=item) (_items ring) of
(_, []) -> Just ring
([], [_]) -> Nothing
(pre, _:xs) ->
let newLength = _length ring - 1
current = _current ring
in
Just $ ring {
_items = pre ++ xs,
_length = n... | 460 | dropItem ring item =
case span (/=item) (_items ring) of
(_, []) -> Just ring
([], [_]) -> Nothing
(pre, _:xs) ->
let newLength = _length ring - 1
current = _current ring
in
Just $ ring {
_items = pre ++ xs,
_length = newLength,
_current =
if current == n... | 408 | false | true | 0 | 17 | 165 | 203 | 107 | 96 | null | null |
nominolo/cake | src/Development/Cake/Core.hs | bsd-3-clause | newWaitHandle :: [CanonicalFilePath]
-> IO (Either CakeException [ModTime] -> IO (),
[WaitHandle])
newWaitHandle goals = do
mvar <- newEmptyMVar
let ngoals = length goals
return (\modtimes ->
case modtimes of
Left exc -> putMVar mvar (replicate ngoals (... | 513 | newWaitHandle :: [CanonicalFilePath]
-> IO (Either CakeException [ModTime] -> IO (),
[WaitHandle])
newWaitHandle goals = do
mvar <- newEmptyMVar
let ngoals = length goals
return (\modtimes ->
case modtimes of
Left exc -> putMVar mvar (replicate ngoals (... | 513 | newWaitHandle goals = do
mvar <- newEmptyMVar
let ngoals = length goals
return (\modtimes ->
case modtimes of
Left exc -> putMVar mvar (replicate ngoals (Left exc))
Right mtimes -> putMVar mvar (map Right mtimes),
map (WaitHandle mvar) (take (length goals) selecto... | 379 | false | true | 0 | 17 | 154 | 166 | 81 | 85 | null | null |
skogsbaer/roundtrip | src-progs/Test.hs | bsd-3-clause | xpIDocMeta :: (Show' r, RefPickler r, XmlSyntax d) => d (IDocMeta r)
xpIDocMeta = iDocMeta <$>
elemIDoc "meta" (elemIDoc "title" xmlString <*>
optional (elemIDoc "description" xmlString) <*>
optional (elemIDoc "icon" xpObjLink) <*>
optional (elemIDoc "t... | 341 | xpIDocMeta :: (Show' r, RefPickler r, XmlSyntax d) => d (IDocMeta r)
xpIDocMeta = iDocMeta <$>
elemIDoc "meta" (elemIDoc "title" xmlString <*>
optional (elemIDoc "description" xmlString) <*>
optional (elemIDoc "icon" xpObjLink) <*>
optional (elemIDoc "t... | 341 | xpIDocMeta = iDocMeta <$>
elemIDoc "meta" (elemIDoc "title" xmlString <*>
optional (elemIDoc "description" xmlString) <*>
optional (elemIDoc "icon" xpObjLink) <*>
optional (elemIDoc "thumbnail" xpObjLink)) | 272 | false | true | 2 | 12 | 102 | 111 | 51 | 60 | null | null |
lucasdicioccio/distributed-process-monitoring | examples/counters.hs | apache-2.0 | pong :: Process ()
pong = getSelfPid >>= register "pong" | 56 | pong :: Process ()
pong = getSelfPid >>= register "pong" | 56 | pong = getSelfPid >>= register "pong" | 37 | false | true | 0 | 6 | 9 | 23 | 11 | 12 | null | null |
parsonsmatt/QuickLift | src/Models.hs | mit | db :: (MonadIO m, MonadBaseControl IO m) => SqlPersistM a -> m a
db query =
runStderrLoggingT .
withPostgresqlPool (connStr Development) 1 $
liftIO . runSqlPersistMPool query | 198 | db :: (MonadIO m, MonadBaseControl IO m) => SqlPersistM a -> m a
db query =
runStderrLoggingT .
withPostgresqlPool (connStr Development) 1 $
liftIO . runSqlPersistMPool query | 198 | db query =
runStderrLoggingT .
withPostgresqlPool (connStr Development) 1 $
liftIO . runSqlPersistMPool query | 133 | false | true | 0 | 10 | 50 | 70 | 33 | 37 | null | null |
tomlokhorst/language-cil | src/Language/Cil/Pretty.hs | bsd-3-clause | sp = (" " ++) | 16 | sp = (" " ++) | 16 | sp = (" " ++) | 16 | false | false | 1 | 6 | 7 | 14 | 6 | 8 | null | null |
keera-studios/hsQt | Qtc/Enums/Gui/QFileDialog.hs | bsd-2-clause | eAccept :: DialogLabel
eAccept
= ieDialogLabel $ 3 | 52 | eAccept :: DialogLabel
eAccept
= ieDialogLabel $ 3 | 52 | eAccept
= ieDialogLabel $ 3 | 29 | false | true | 0 | 6 | 9 | 18 | 8 | 10 | null | null |
banacorn/mini-pascal | src/Compiler/Codegen.hs | mit | genStatement (AST.Loop cond body) = void $ do
whileBody <- addBlock "while.body"
whileTest <- addBlock "while.test"
whileExit <- addBlock "while.exit"
-- entry
------------------
br whileTest
-- test
------------------
setBlock whileTest
condResult <- genExpression cond
tes... | 547 | genStatement (AST.Loop cond body) = void $ do
whileBody <- addBlock "while.body"
whileTest <- addBlock "while.test"
whileExit <- addBlock "while.exit"
-- entry
------------------
br whileTest
-- test
------------------
setBlock whileTest
condResult <- genExpression cond
tes... | 547 | genStatement (AST.Loop cond body) = void $ do
whileBody <- addBlock "while.body"
whileTest <- addBlock "while.test"
whileExit <- addBlock "while.exit"
-- entry
------------------
br whileTest
-- test
------------------
setBlock whileTest
condResult <- genExpression cond
tes... | 547 | false | false | 0 | 11 | 142 | 139 | 61 | 78 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2020/M11/D17/Solution.hs | mit | -- and
citer :: (CountryInfo -> a) -> CountryInfoMap -> Set Country -> [a]
citer f cim = mapMaybe (cprimer f cim) . Set.toList | 127 | citer :: (CountryInfo -> a) -> CountryInfoMap -> Set Country -> [a]
citer f cim = mapMaybe (cprimer f cim) . Set.toList | 119 | citer f cim = mapMaybe (cprimer f cim) . Set.toList | 51 | true | true | 0 | 8 | 24 | 59 | 30 | 29 | null | null |
vikraman/ghc | compiler/prelude/THNames.hs | bsd-3-clause | varTName = libFun (fsLit "varT") varTIdKey | 63 | varTName = libFun (fsLit "varT") varTIdKey | 63 | varTName = libFun (fsLit "varT") varTIdKey | 63 | false | false | 0 | 7 | 26 | 17 | 8 | 9 | null | null |
ucla-pls/wiretap-tools | src/Wiretap/Graph.hs | gpl-3.0 | cycles
:: forall a b. (Ord a , Ord b, Show b, Show a)
=> [a]
-> (a -> a -> Maybe b)
-> [Cycle a b]
cycles elems f =
map fromEdge . reverse <$> cycles' graph
where
fromEdge (n, l, n') = (fromNode n, l, fromNode n')
nodes = byIndex elems
uniquemap = fromUniques nodes
edges =
catMaybes... | 687 | cycles
:: forall a b. (Ord a , Ord b, Show b, Show a)
=> [a]
-> (a -> a -> Maybe b)
-> [Cycle a b]
cycles elems f =
map fromEdge . reverse <$> cycles' graph
where
fromEdge (n, l, n') = (fromNode n, l, fromNode n')
nodes = byIndex elems
uniquemap = fromUniques nodes
edges =
catMaybes... | 687 | cycles elems f =
map fromEdge . reverse <$> cycles' graph
where
fromEdge (n, l, n') = (fromNode n, l, fromNode n')
nodes = byIndex elems
uniquemap = fromUniques nodes
edges =
catMaybes . map toEdge $ crossproduct nodes nodes
graph :: GP.Gr () b
graph =
G.mkGraph (fmap (\n -> ... | 580 | false | true | 0 | 13 | 229 | 321 | 161 | 160 | null | null |
brendanhay/gogol | gogol-cloudkms/gen/Network/Google/Resource/CloudKMS/Projects/Locations/KeyRings/GetIAMPolicy.hs | mpl-2.0 | -- | Creates a value of 'ProjectsLocationsKeyRingsGetIAMPolicy' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'plkrgipOptionsRequestedPolicyVersion'
--
-- * 'plkrgipXgafv'
--
-- * 'plkrgipUploadProtocol'
--
-- * 'plkrgipAccessToken'
... | 892 | projectsLocationsKeyRingsGetIAMPolicy
:: Text -- ^ 'plkrgipResource'
-> ProjectsLocationsKeyRingsGetIAMPolicy
projectsLocationsKeyRingsGetIAMPolicy pPlkrgipResource_ =
ProjectsLocationsKeyRingsGetIAMPolicy'
{ _plkrgipOptionsRequestedPolicyVersion = Nothing
, _plkrgipXgafv = Nothing
, _plkrgipUploa... | 492 | projectsLocationsKeyRingsGetIAMPolicy pPlkrgipResource_ =
ProjectsLocationsKeyRingsGetIAMPolicy'
{ _plkrgipOptionsRequestedPolicyVersion = Nothing
, _plkrgipXgafv = Nothing
, _plkrgipUploadProtocol = Nothing
, _plkrgipAccessToken = Nothing
, _plkrgipUploadType = Nothing
, _plkrgipResource = pP... | 374 | true | true | 0 | 7 | 140 | 89 | 58 | 31 | null | null |
meoblast001/paypal-client | src/Network/Payments/PayPal/Payments.hs | mit | -- |Use this function to parse GET parameters passed from PayPal to the return
-- URL. Takes a map of query parameters (name to value) and returns a structure
-- containing these parameters if possible. Otherwise PayPal didn't give you
-- required data.
returnLinkParams :: M.Map BS.ByteString BS.ByteString -> Maybe Ret... | 623 | returnLinkParams :: M.Map BS.ByteString BS.ByteString -> Maybe ReturnLinkParams
returnLinkParams query = do
paymentId <- BS8.unpack <$> M.lookup "paymentId" query
token <- BS8.unpack <$> M.lookup "token" query
payerId <- BS8.unpack <$> M.lookup "PayerID" query
return $ ReturnLinkParams paymentId token payerId
... | 369 | returnLinkParams query = do
paymentId <- BS8.unpack <$> M.lookup "paymentId" query
token <- BS8.unpack <$> M.lookup "token" query
payerId <- BS8.unpack <$> M.lookup "PayerID" query
return $ ReturnLinkParams paymentId token payerId
-- Parses a time in ISO 8106 format to a UTCTime. | 289 | true | true | 0 | 10 | 101 | 111 | 53 | 58 | null | null |
suhailshergill/liboleg | Language/TTFdB.hs | bsd-3-clause | -- td1 :: (Symantics repr) => repr h Int
td2 = lam (add z z) | 61 | td2 = lam (add z z) | 19 | td2 = lam (add z z) | 19 | true | false | 0 | 7 | 15 | 18 | 9 | 9 | null | null |
brendanhay/gogol | gogol-servicecontrol/gen/Network/Google/ServiceControl/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'AuditLogResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'alrAddtional'
auditLogResponse
:: HashMap Text JSONValue -- ^ 'alrAddtional'
-> AuditLogResponse
auditLogResponse pAlrAddtional_ =
Au... | 378 | auditLogResponse
:: HashMap Text JSONValue -- ^ 'alrAddtional'
-> AuditLogResponse
auditLogResponse pAlrAddtional_ =
AuditLogResponse' {_alrAddtional = _Coerce # pAlrAddtional_} | 187 | auditLogResponse pAlrAddtional_ =
AuditLogResponse' {_alrAddtional = _Coerce # pAlrAddtional_} | 96 | true | true | 0 | 7 | 62 | 41 | 24 | 17 | null | null |
lhoghu/intranet | Web/Notebook/Handlers.hs | mit | getNotebookBlogR :: (Yesod master, RenderMessage master FormMessage, YesodNic master) =>
YesodPersist master =>
YesodPersistBackend master ~ SqlBackend =>
HandlerT Notebook (HandlerT master IO) Html
getNotebookBlogR = do
toParent <- getRouteToParent
... | 720 | getNotebookBlogR :: (Yesod master, RenderMessage master FormMessage, YesodNic master) =>
YesodPersist master =>
YesodPersistBackend master ~ SqlBackend =>
HandlerT Notebook (HandlerT master IO) Html
getNotebookBlogR = do
toParent <- getRouteToParent
... | 720 | getNotebookBlogR = do
toParent <- getRouteToParent
-- retrieve notes, most recent first
notes <- lift $ runDB $ selectList [] [Desc NotePosted]
(note, enctype) <- lift $ generateFormPost noteForm
pc <- lift $ widgetToPageContent note
let noteWidget = pageBody pc
lift $ defaultLayo... | 460 | false | true | 0 | 13 | 198 | 181 | 84 | 97 | null | null |
trskop/cabal | Cabal/Distribution/Simple/Command.hs | bsd-3-clause | commandsRun :: CommandUI a
-> [Command action]
-> [String]
-> CommandParse (a, CommandParse action)
commandsRun globalCommand commands args =
case commandParseArgs globalCommand True args of
CommandHelp help -> CommandHelp help
CommandList opts -... | 2,401 | commandsRun :: CommandUI a
-> [Command action]
-> [String]
-> CommandParse (a, CommandParse action)
commandsRun globalCommand commands args =
case commandParseArgs globalCommand True args of
CommandHelp help -> CommandHelp help
CommandList opts -... | 2,401 | commandsRun globalCommand commands args =
case commandParseArgs globalCommand True args of
CommandHelp help -> CommandHelp help
CommandList opts -> CommandList (opts ++ commandNames)
CommandErrors errs -> CommandErrors errs
CommandReadyToGo (mkflags, args') -> c... | 2,265 | false | true | 11 | 15 | 755 | 562 | 283 | 279 | null | null |
hengchu/tiger-haskell | src/tigergensymlabtmp.hs | mit | getRetLabelState :: (Monad m) => GenSymLabTmp m Int
getRetLabelState = do st <- get
return $ rlcount st | 125 | getRetLabelState :: (Monad m) => GenSymLabTmp m Int
getRetLabelState = do st <- get
return $ rlcount st | 125 | getRetLabelState = do st <- get
return $ rlcount st | 73 | false | true | 0 | 8 | 39 | 42 | 20 | 22 | null | null |
ghcjs/ghcjs | src/Gen2/GHC/DsForeign.hs | mit | -- No rec/nonrec structure;
-- the occurrence analyser will sort it all out
dsForeigns :: [LForeignDecl GhcTc]
-> DsM (ForeignStubs, OrdList Binding)
dsForeigns fos = getHooked dsForeignsHook dsForeigns' >>= ($ fos) | 257 | dsForeigns :: [LForeignDecl GhcTc]
-> DsM (ForeignStubs, OrdList Binding)
dsForeigns fos = getHooked dsForeignsHook dsForeigns' >>= ($ fos) | 150 | dsForeigns fos = getHooked dsForeignsHook dsForeigns' >>= ($ fos) | 65 | true | true | 0 | 9 | 72 | 56 | 28 | 28 | null | null |
frantisekfarka/ghc-dsi | compiler/main/DynFlags.hs | bsd-3-clause | turnOff :: TurnOnFlag; turnOff = False | 38 | turnOff :: TurnOnFlag
turnOff = False | 37 | turnOff = False | 15 | false | true | 1 | 5 | 5 | 16 | 7 | 9 | null | null |
pbrisbin/yesod-comments | Yesod/Comments/View.hs | bsd-3-clause | commentControls _ _ _ _ = mempty | 32 | commentControls _ _ _ _ = mempty | 32 | commentControls _ _ _ _ = mempty | 32 | false | false | 0 | 5 | 6 | 15 | 7 | 8 | null | null |
omefire/lens | src/Control/Lens/Fold.hs | bsd-3-clause | -- | Fold over the elements of a structure with an index, associating to the left, but /strictly/.
--
-- When you don't need access to the index then 'foldlOf'' is more flexible in what it accepts.
--
-- @
-- 'foldlOf'' l ≡ 'ifoldlOf'' l '.' 'const'
-- @
--
-- @
-- 'ifoldlOf'' :: 'IndexedGetter' i s a -> (i -> r ... | 766 | ifoldlOf' :: IndexedGetting i (Endo (r -> r)) s a -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf' l f z0 xs = ifoldrOf l f' id xs z0
where f' i x k z = k $! f i z x
| 166 | ifoldlOf' l f z0 xs = ifoldrOf l f' id xs z0
where f' i x k z = k $! f i z x
| 79 | true | true | 0 | 10 | 213 | 126 | 69 | 57 | null | null |
spechub/Hets | CspCASL/Parse_CspCASL_Process.hs | gpl-2.0 | prefixChoice :: AParser st EVENT
prefixChoice = do
constr <- fmap (const InternalPrefixChoice) (asKeySign internal_choiceS)
<|> fmap (const ExternalPrefixChoice) (asKeySign external_choiceS)
v <- var
svarKey
s <- cspSortId
return $ constr v s $ getRange s | 281 | prefixChoice :: AParser st EVENT
prefixChoice = do
constr <- fmap (const InternalPrefixChoice) (asKeySign internal_choiceS)
<|> fmap (const ExternalPrefixChoice) (asKeySign external_choiceS)
v <- var
svarKey
s <- cspSortId
return $ constr v s $ getRange s | 281 | prefixChoice = do
constr <- fmap (const InternalPrefixChoice) (asKeySign internal_choiceS)
<|> fmap (const ExternalPrefixChoice) (asKeySign external_choiceS)
v <- var
svarKey
s <- cspSortId
return $ constr v s $ getRange s | 248 | false | true | 0 | 11 | 61 | 97 | 44 | 53 | null | null |
IgorRodic/fp16-Pongout | src/Constants.hs | mit | windowOffset :: Int
windowOffset = 10 | 37 | windowOffset :: Int
windowOffset = 10 | 37 | windowOffset = 10 | 17 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
ryanoneill/yorgey-haskell | Week02/LogAnalysis.hs | mit | inOrder :: MessageTree -> [LogMessage]
inOrder Leaf = [] | 56 | inOrder :: MessageTree -> [LogMessage]
inOrder Leaf = [] | 56 | inOrder Leaf = [] | 17 | false | true | 0 | 6 | 8 | 23 | 12 | 11 | null | null |
justinethier/husk-scheme | hs-src/Language/Scheme/Core.hs | mit | showLispError err = return $ show err | 37 | showLispError err = return $ show err | 37 | showLispError err = return $ show err | 37 | false | false | 0 | 6 | 6 | 16 | 7 | 9 | null | null |
erantapaa/parse-cabal | src/TestTar.hs | bsd-3-clause | firstParse :: ReadP a -> String -> Maybe a
firstParse readp str =
case (readP_to_S readp) str of
[] -> Nothing
((v,_):_) -> Just v | 147 | firstParse :: ReadP a -> String -> Maybe a
firstParse readp str =
case (readP_to_S readp) str of
[] -> Nothing
((v,_):_) -> Just v | 147 | firstParse readp str =
case (readP_to_S readp) str of
[] -> Nothing
((v,_):_) -> Just v | 104 | false | true | 0 | 10 | 41 | 73 | 36 | 37 | null | null |
ekmett/ixset | src/Data/IxSet.hs | bsd-3-clause | -- | Returns the number of unique items in the IxSet
size :: Ord a => IxSet a -> Int
size = Set.size . toSet | 108 | size :: Ord a => IxSet a -> Int
size = Set.size . toSet | 55 | size = Set.size . toSet | 23 | true | true | 0 | 7 | 24 | 32 | 16 | 16 | null | null |
f1u77y/xmonad-contrib | XMonad/Prompt/Window.hs | bsd-3-clause | -- | Pops open a prompt with window titles belonging to
-- winmap. Choose one, and an action is applied on the
-- selected window, according to WindowPrompt.
windowPrompt :: XPConfig -> WindowPrompt -> XWindowMap -> X ()
windowPrompt c t winmap = do
wm <- winmap
let mode = WindowModePrompt t wm (searchPredicate... | 961 | windowPrompt :: XPConfig -> WindowPrompt -> XWindowMap -> X ()
windowPrompt c t winmap = do
wm <- winmap
let mode = WindowModePrompt t wm (searchPredicate c)
action = modeAction mode
compList = completionFunction mode
mkXPrompt t c compList (\s -> action s s)
-- | Like 'windowPrompt', but uses ... | 803 | windowPrompt c t winmap = do
wm <- winmap
let mode = WindowModePrompt t wm (searchPredicate c)
action = modeAction mode
compList = completionFunction mode
mkXPrompt t c compList (\s -> action s s)
-- | Like 'windowPrompt', but uses the multiple modes feature of
-- @Prompt@ (via 'mkXPromptWithMo... | 740 | true | true | 0 | 12 | 183 | 120 | 65 | 55 | null | null |
mlitchard/primenator | src/Error.hs | isc | formatError :: PrimeError -> OutputFormat
formatError prime_error = ErrorFormat (primeErrorToText prime_error) | 110 | formatError :: PrimeError -> OutputFormat
formatError prime_error = ErrorFormat (primeErrorToText prime_error) | 110 | formatError prime_error = ErrorFormat (primeErrorToText prime_error) | 68 | false | true | 0 | 7 | 10 | 30 | 14 | 16 | null | null |
bnordbo/keiretsu | src/Keiretsu/Log.hs | mpl-2.0 | colourise :: Color -> Text -> ByteString -> ByteString
colourise c x y = prefix
<> Text.encodeUtf8 x
<> suffix
<> ": "
<> y
<> clear
where
prefix = BS.pack $ setSGRCode
[ SetColor Foreground Vivid c
, SetConsoleIntensity BoldIntensity
]
suffix = BS.pack $ setSGRCod... | 452 | colourise :: Color -> Text -> ByteString -> ByteString
colourise c x y = prefix
<> Text.encodeUtf8 x
<> suffix
<> ": "
<> y
<> clear
where
prefix = BS.pack $ setSGRCode
[ SetColor Foreground Vivid c
, SetConsoleIntensity BoldIntensity
]
suffix = BS.pack $ setSGRCod... | 452 | colourise c x y = prefix
<> Text.encodeUtf8 x
<> suffix
<> ": "
<> y
<> clear
where
prefix = BS.pack $ setSGRCode
[ SetColor Foreground Vivid c
, SetConsoleIntensity BoldIntensity
]
suffix = BS.pack $ setSGRCode
[ SetColor Foreground Vivid c
, SetCo... | 397 | false | true | 10 | 8 | 145 | 139 | 66 | 73 | null | null |
alexander-at-github/eta | compiler/ETA/BasicTypes/RdrName.hs | bsd-3-clause | lookupGlobalRdrEnv :: GlobalRdrEnv -> OccName -> [GlobalRdrElt]
lookupGlobalRdrEnv env occ_name = case lookupOccEnv env occ_name of
Nothing -> []
Just gres -> gres | 233 | lookupGlobalRdrEnv :: GlobalRdrEnv -> OccName -> [GlobalRdrElt]
lookupGlobalRdrEnv env occ_name = case lookupOccEnv env occ_name of
Nothing -> []
Just gres -> gres | 233 | lookupGlobalRdrEnv env occ_name = case lookupOccEnv env occ_name of
Nothing -> []
Just gres -> gres | 169 | false | true | 0 | 8 | 92 | 53 | 26 | 27 | null | null |
wjzz/GoStat | src/Transformations.hs | bsd-3-clause | -- |Performs a 90 degrees rotation (counter clock-wise)
rotate90 :: Move -> Move
rotate90 (x,y) = (10-y, x) | 107 | rotate90 :: Move -> Move
rotate90 (x,y) = (10-y, x) | 51 | rotate90 (x,y) = (10-y, x) | 26 | true | true | 0 | 6 | 17 | 35 | 20 | 15 | null | null |
itchyny/sjsp | src/Injector.hs | mit | jscommas :: [JSNode] -> [JSNode]
jscommas = intersperse $ jsliteral "," | 71 | jscommas :: [JSNode] -> [JSNode]
jscommas = intersperse $ jsliteral "," | 71 | jscommas = intersperse $ jsliteral "," | 38 | false | true | 2 | 8 | 10 | 35 | 16 | 19 | null | null |
AndrewSinclair/aoc-haskell | src/Day5.hs | mit | containsTwoPair (x:y:xs) = (x:y:[]) `isInfixOf` xs || (containsTwoPair (y:xs)) | 78 | containsTwoPair (x:y:xs) = (x:y:[]) `isInfixOf` xs || (containsTwoPair (y:xs)) | 78 | containsTwoPair (x:y:xs) = (x:y:[]) `isInfixOf` xs || (containsTwoPair (y:xs)) | 78 | false | false | 0 | 9 | 8 | 56 | 30 | 26 | null | null |
hbrouwer/pdrt-sandbox | src/Data/PDRS/Show.hs | apache-2.0 | ---------------------------------------------------------------------------
-- | Shows a projective merge between 'PDRS' @p1@ and 'PDRS' @p@.
---------------------------------------------------------------------------
showPMerge :: PDRS -> PDRS -> String
showPMerge p1 p2 = showConcat b1 (showModifier opPMerge 2 (showCo... | 682 | showPMerge :: PDRS -> PDRS -> String
showPMerge p1 p2 = showConcat b1 (showModifier opPMerge 2 (showConcat b2 (showModifier "=" 2 mb)))
where b1 = showPDRS (Boxes p1)
b2 = showPDRS (Boxes p2)
mb = showPDRS (Boxes (p1 <<*>> p2))
-------------------------------------------------------------------------... | 464 | showPMerge p1 p2 = showConcat b1 (showModifier opPMerge 2 (showConcat b2 (showModifier "=" 2 mb)))
where b1 = showPDRS (Boxes p1)
b2 = showPDRS (Boxes p2)
mb = showPDRS (Boxes (p1 <<*>> p2))
---------------------------------------------------------------------------
-- | Print a projective merge betw... | 427 | true | true | 2 | 11 | 86 | 115 | 60 | 55 | null | null |
TomMD/ghc | compiler/prelude/THNames.hs | bsd-3-clause | standaloneDerivDIdKey = mkPreludeMiscIdUnique 356 | 56 | standaloneDerivDIdKey = mkPreludeMiscIdUnique 356 | 56 | standaloneDerivDIdKey = mkPreludeMiscIdUnique 356 | 56 | false | false | 0 | 5 | 10 | 9 | 4 | 5 | null | null |
xcv-/LCC | lib/Language/LCC/Simplifier/RemoveUnused.hs | gpl-3.0 | findCalls :: (Err.ErrorM m, ScopedAbs Type m)
=> AnalyzedAST
-> AbsExpr
-> m [AnalyzedSignature]
findCalls ast = \case
Array arr -> liftM concat $ mapM (findCalls ast) arr
SConcat s -> liftM concat $ mapM (findCalls ast) s
Cond c t f -> liftM concat $ mapM (findCalls ast) ... | 503 | findCalls :: (Err.ErrorM m, ScopedAbs Type m)
=> AnalyzedAST
-> AbsExpr
-> m [AnalyzedSignature]
findCalls ast = \case
Array arr -> liftM concat $ mapM (findCalls ast) arr
SConcat s -> liftM concat $ mapM (findCalls ast) s
Cond c t f -> liftM concat $ mapM (findCalls ast) ... | 503 | findCalls ast = \case
Array arr -> liftM concat $ mapM (findCalls ast) arr
SConcat s -> liftM concat $ mapM (findCalls ast) s
Cond c t f -> liftM concat $ mapM (findCalls ast) [c,t,f]
Funcall (Fn (VAbsolutePath path)) args ->
let absPath = path^.from absolute
in findFunction ast absPath a... | 373 | false | true | 4 | 11 | 143 | 213 | 106 | 107 | null | null |
ihc/futhark | src/Futhark/CodeGen/Backends/GenericPython.hs | isc | compileCode (Imp.Copy dest (Imp.Count destoffset) DefaultSpace src (Imp.Count srcoffset) DefaultSpace (Imp.Count size)) = do
destoffset' <- compileExp destoffset
srcoffset' <- compileExp srcoffset
let dest' = Var (compileName dest)
let src' = Var (compileName src)
size' <- compileExp size
let offset_call1 =... | 543 | compileCode (Imp.Copy dest (Imp.Count destoffset) DefaultSpace src (Imp.Count srcoffset) DefaultSpace (Imp.Count size)) = do
destoffset' <- compileExp destoffset
srcoffset' <- compileExp srcoffset
let dest' = Var (compileName dest)
let src' = Var (compileName src)
size' <- compileExp size
let offset_call1 =... | 543 | compileCode (Imp.Copy dest (Imp.Count destoffset) DefaultSpace src (Imp.Count srcoffset) DefaultSpace (Imp.Count size)) = do
destoffset' <- compileExp destoffset
srcoffset' <- compileExp srcoffset
let dest' = Var (compileName dest)
let src' = Var (compileName src)
size' <- compileExp size
let offset_call1 =... | 543 | false | false | 0 | 12 | 80 | 196 | 93 | 103 | null | null |
ku-fpg/aframe-server | src/Text/AFrame/Geometry.hs | bsd-3-clause | eps :: Fractional a => a
eps = 0.00001 | 38 | eps :: Fractional a => a
eps = 0.00001 | 38 | eps = 0.00001 | 13 | false | true | 0 | 6 | 8 | 18 | 9 | 9 | null | null |
danfran/feed | src/Text/Atom/Feed.hs | bsd-3-clause | nullFeed :: String -- ^feedId
-> TextContent -- ^feedTitle
-> Date -- ^feedUpdated
-> Feed
nullFeed i t u = Feed
{ feedId = i
, feedTitle = t
, feedUpdated = u
, feedAuthors = []
, feedCategories = []
, feedContributors = []
... | 620 | nullFeed :: String -- ^feedId
-> TextContent -- ^feedTitle
-> Date -- ^feedUpdated
-> Feed
nullFeed i t u = Feed
{ feedId = i
, feedTitle = t
, feedUpdated = u
, feedAuthors = []
, feedCategories = []
, feedContributors = []
... | 620 | nullFeed i t u = Feed
{ feedId = i
, feedTitle = t
, feedUpdated = u
, feedAuthors = []
, feedCategories = []
, feedContributors = []
, feedGenerator = Nothing
, feedIcon = Nothing
, feedLinks = []
, feedLogo ... | 501 | false | true | 0 | 8 | 289 | 143 | 87 | 56 | null | null |
vTurbine/ghc | compiler/simplCore/CallArity.hs | bsd-3-clause | callArityAnal arity int (App e (Type t))
= second (\e -> App e (Type t)) $ callArityAnal arity int e | 104 | callArityAnal arity int (App e (Type t))
= second (\e -> App e (Type t)) $ callArityAnal arity int e | 104 | callArityAnal arity int (App e (Type t))
= second (\e -> App e (Type t)) $ callArityAnal arity int e | 104 | false | false | 0 | 11 | 23 | 60 | 29 | 31 | null | null |
termite2/debug | Debug/CodeWin.hs | bsd-3-clause | isMBICurrent _ = False | 43 | isMBICurrent _ = False | 43 | isMBICurrent _ = False | 43 | false | false | 0 | 5 | 24 | 9 | 4 | 5 | null | null |
arirahikkala/yaml-with-class | src/Data/YamlObject.hs | bsd-3-clause | mapAnnotations f (Reference ann a) = Reference (f ann) a | 56 | mapAnnotations f (Reference ann a) = Reference (f ann) a | 56 | mapAnnotations f (Reference ann a) = Reference (f ann) a | 56 | false | false | 0 | 7 | 9 | 32 | 14 | 18 | null | null |
philopon/apiary-benchmark | src/wai-routes.hs | mit | handleNum23R :: Handler App; handleNum23R = returnT "deep" | 58 | handleNum23R :: Handler App
handleNum23R = returnT "deep" | 57 | handleNum23R = returnT "deep" | 29 | false | true | 0 | 5 | 7 | 18 | 9 | 9 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/THNames.hs | bsd-3-clause | lamCaseEIdKey = mkPreludeMiscIdUnique 280 | 45 | lamCaseEIdKey = mkPreludeMiscIdUnique 280 | 45 | lamCaseEIdKey = mkPreludeMiscIdUnique 280 | 45 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
Tanchey/snakebird-solver | src/Main.hs | mit | parseLevel :: String -> Maybe Level
parseLevel s = do
level <- Level <$> traverse parseLine (V.fromList (lines s))
Just (padEmpty level) | 144 | parseLevel :: String -> Maybe Level
parseLevel s = do
level <- Level <$> traverse parseLine (V.fromList (lines s))
Just (padEmpty level) | 144 | parseLevel s = do
level <- Level <$> traverse parseLine (V.fromList (lines s))
Just (padEmpty level) | 108 | false | true | 0 | 13 | 29 | 63 | 29 | 34 | null | null |
nandor/hcasm | HCasm.hs | bsd-3-clause | splitWord :: Int -> [ Word8 ]
splitWord x
= [ fromIntegral $ (x `shiftR` y) .&. 0xFF | y <- [0,8..24] ] | 105 | splitWord :: Int -> [ Word8 ]
splitWord x
= [ fromIntegral $ (x `shiftR` y) .&. 0xFF | y <- [0,8..24] ] | 105 | splitWord x
= [ fromIntegral $ (x `shiftR` y) .&. 0xFF | y <- [0,8..24] ] | 75 | false | true | 0 | 9 | 24 | 57 | 32 | 25 | null | null |
jozefg/ds-kanren | test/Unify.hs | mit | neqcomm :: TestTree
neqcomm = testProperty "Commutative"
. forTerm2
$ \ l r ->
hasSolution (l =/= r)
==> hasSolution (r =/= l) | 172 | neqcomm :: TestTree
neqcomm = testProperty "Commutative"
. forTerm2
$ \ l r ->
hasSolution (l =/= r)
==> hasSolution (r =/= l) | 172 | neqcomm = testProperty "Commutative"
. forTerm2
$ \ l r ->
hasSolution (l =/= r)
==> hasSolution (r =/= l) | 152 | false | true | 4 | 6 | 68 | 63 | 30 | 33 | null | null |
pepeiborra/narradar | src/Narradar/Constraints/SAT/YicesCircuit.hs | bsd-3-clause | runYices :: (Hashable id, Ord id, Ord var, Show var) => YicesSource id var -> [CmdY]
runYices y = let (me,stY) = runYices' emptyYMaps y
in generateDeclarations stY ++ [ASSERT me] | 191 | runYices :: (Hashable id, Ord id, Ord var, Show var) => YicesSource id var -> [CmdY]
runYices y = let (me,stY) = runYices' emptyYMaps y
in generateDeclarations stY ++ [ASSERT me] | 191 | runYices y = let (me,stY) = runYices' emptyYMaps y
in generateDeclarations stY ++ [ASSERT me] | 106 | false | true | 0 | 10 | 43 | 95 | 45 | 50 | null | null |
forsyde/forsyde-shallow | src/ForSyDe/Shallow/MoC/SADF.hs | bsd-3-clause | outputFSM3 g (s:-ss)
| length y1 /= p1
|| length y2 /= p2
|| length y3 /= p3 = error "outputFSM3: Incorrect number of produced tokens."
| otherwise = (signal y1 +-+ yr1, signal y2 +-+ yr2, signal y3 +-+ yr3)
where ((p1, p2, p3), (y1, y2, y3)) = g s
(yr1, yr2, yr3) = outputFSM3 g ss | 304 | outputFSM3 g (s:-ss)
| length y1 /= p1
|| length y2 /= p2
|| length y3 /= p3 = error "outputFSM3: Incorrect number of produced tokens."
| otherwise = (signal y1 +-+ yr1, signal y2 +-+ yr2, signal y3 +-+ yr3)
where ((p1, p2, p3), (y1, y2, y3)) = g s
(yr1, yr2, yr3) = outputFSM3 g ss | 304 | outputFSM3 g (s:-ss)
| length y1 /= p1
|| length y2 /= p2
|| length y3 /= p3 = error "outputFSM3: Incorrect number of produced tokens."
| otherwise = (signal y1 +-+ yr1, signal y2 +-+ yr2, signal y3 +-+ yr3)
where ((p1, p2, p3), (y1, y2, y3)) = g s
(yr1, yr2, yr3) = outputFSM3 g ss | 304 | false | false | 0 | 13 | 79 | 155 | 77 | 78 | null | null |
NorfairKing/super-user-spark | src/SuperUserSpark/Parser/Internal.hs | mit | sparkOff :: Parser Declaration
sparkOff =
do void $ string keywordSpark
linespace
ref <- cardReference
return $ SparkOff ref
<?> "sparkoff" | 171 | sparkOff :: Parser Declaration
sparkOff =
do void $ string keywordSpark
linespace
ref <- cardReference
return $ SparkOff ref
<?> "sparkoff" | 171 | sparkOff =
do void $ string keywordSpark
linespace
ref <- cardReference
return $ SparkOff ref
<?> "sparkoff" | 140 | false | true | 0 | 9 | 52 | 48 | 21 | 27 | null | null |
nazrhom/vcs-clojure | src/VCS/Disjoint.hs | bsd-3-clause | disjAtAl :: (forall a . (At AlmuH) a -> (At AlmuH) a -> Bool)
-> All (At AlmuH) s -> Al (At AlmuH) s d -> Bool
disjAtAl _ An _
= True | 154 | disjAtAl :: (forall a . (At AlmuH) a -> (At AlmuH) a -> Bool)
-> All (At AlmuH) s -> Al (At AlmuH) s d -> Bool
disjAtAl _ An _
= True | 154 | disjAtAl _ An _
= True | 34 | false | true | 0 | 12 | 53 | 88 | 43 | 45 | null | null |
mbakke/ganeti | src/Ganeti/Storage/Drbd/Parser.hs | bsd-2-clause | -- | The parser for recognizing data size units (only the ones
-- actually found in DRBD files are implemented).
sizeUnitParser :: Parser SizeUnit
sizeUnitParser =
kilobyte
<|> megabyte
where kilobyte = A.string "K" *> pure KiloByte
megabyte = A.string "M" *> pure MegaByte
-- | The parser for recogni... | 341 | sizeUnitParser :: Parser SizeUnit
sizeUnitParser =
kilobyte
<|> megabyte
where kilobyte = A.string "K" *> pure KiloByte
megabyte = A.string "M" *> pure MegaByte
-- | The parser for recognizing time (hh:mm:ss). | 228 | sizeUnitParser =
kilobyte
<|> megabyte
where kilobyte = A.string "K" *> pure KiloByte
megabyte = A.string "M" *> pure MegaByte
-- | The parser for recognizing time (hh:mm:ss). | 194 | true | true | 5 | 6 | 70 | 72 | 32 | 40 | null | null |
green-haskell/ghc | compiler/llvmGen/Llvm/Types.hs | bsd-3-clause | getStatType (LMStaticStruc _ t) = t | 35 | getStatType (LMStaticStruc _ t) = t | 35 | getStatType (LMStaticStruc _ t) = t | 35 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
nshimaza/cisco-spark-api | webex-teams-api/src/Network/WebexTeams/Types.hs | mit | defaultTeamMembershipFilter :: TeamId -> TeamMembershipFilter
defaultTeamMembershipFilter = TeamMembershipFilter | 112 | defaultTeamMembershipFilter :: TeamId -> TeamMembershipFilter
defaultTeamMembershipFilter = TeamMembershipFilter | 112 | defaultTeamMembershipFilter = TeamMembershipFilter | 50 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
sternenseemann/likely-music | backend/Main.hs | agpl-3.0 | midiString :: ToMusic1 a => Music a -> ByteString
midiString = toLazyByteString . buildMidi . toMidi . perform | 110 | midiString :: ToMusic1 a => Music a -> ByteString
midiString = toLazyByteString . buildMidi . toMidi . perform | 110 | midiString = toLazyByteString . buildMidi . toMidi . perform | 60 | false | true | 1 | 8 | 17 | 45 | 19 | 26 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.