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
juhp/network-uri
tests/uri001.hs
bsd-3-clause
testURIRef032 = testURIRef RelRf "../aaa"
41
testURIRef032 = testURIRef RelRf "../aaa"
41
testURIRef032 = testURIRef RelRf "../aaa"
41
false
false
0
5
4
11
5
6
null
null
sampou-org/pfad
Code/Code30.hs
bsd-3-clause
coxall :: [[a]] -> [a] coxall = foldr cox []
49
coxall :: [[a]] -> [a] coxall = foldr cox []
49
coxall = foldr cox []
24
false
true
0
8
14
39
18
21
null
null
FranklinChen/hugs98-plus-Sep2006
packages/HaXml/src/Text/XML/HaXml/Html/Parse.hs
bsd-3-clause
prolog :: HParser Prolog prolog = do x <- maybe xmldecl m1 <- many misc dtd <- maybe doctypedecl m2 <- many misc return (Prolog x m1 dtd m2)
160
prolog :: HParser Prolog prolog = do x <- maybe xmldecl m1 <- many misc dtd <- maybe doctypedecl m2 <- many misc return (Prolog x m1 dtd m2)
160
prolog = do x <- maybe xmldecl m1 <- many misc dtd <- maybe doctypedecl m2 <- many misc return (Prolog x m1 dtd m2)
135
false
true
0
9
48
72
31
41
null
null
AlexeyRaga/eta
compiler/ETA/Main/Constants.hs
bsd-3-clause
-- Trac #5395 reports at least one library that needs depth 37 here mAX_TYPE_FUNCTION_REDUCTION_DEPTH :: Int mAX_TYPE_FUNCTION_REDUCTION_DEPTH = 200
149
mAX_TYPE_FUNCTION_REDUCTION_DEPTH :: Int mAX_TYPE_FUNCTION_REDUCTION_DEPTH = 200
80
mAX_TYPE_FUNCTION_REDUCTION_DEPTH = 200
39
true
true
0
4
19
12
7
5
null
null
DiegoNolan/Asciify
Asciify.hs
mit
charToNovem 'u' = Novemant Bnk Bnk Bnk Lgt Bnk Lgt Lgt Drk Drk
64
charToNovem 'u' = Novemant Bnk Bnk Bnk Lgt Bnk Lgt Lgt Drk Drk
64
charToNovem 'u' = Novemant Bnk Bnk Bnk Lgt Bnk Lgt Lgt Drk Drk
64
false
false
0
5
14
29
13
16
null
null
janschulz/pandoc
src/Text/Pandoc/Readers/Docx/Parse.hs
gpl-2.0
elemToRun :: NameSpaces -> Element -> D Run elemToRun ns element | isElem ns "w" "r" element , Just altCont <- findChild (elemName ns "mc" "AlternateContent") element = do let choices = findChildren (elemName ns "mc" "Choice") altCont choiceChildren = map head $ filter (not . null) $ map elChildren choices outputs <- mapD (childElemToRun ns) choiceChildren case outputs of r : _ -> return r [] -> throwError WrongElem
473
elemToRun :: NameSpaces -> Element -> D Run elemToRun ns element | isElem ns "w" "r" element , Just altCont <- findChild (elemName ns "mc" "AlternateContent") element = do let choices = findChildren (elemName ns "mc" "Choice") altCont choiceChildren = map head $ filter (not . null) $ map elChildren choices outputs <- mapD (childElemToRun ns) choiceChildren case outputs of r : _ -> return r [] -> throwError WrongElem
473
elemToRun ns element | isElem ns "w" "r" element , Just altCont <- findChild (elemName ns "mc" "AlternateContent") element = do let choices = findChildren (elemName ns "mc" "Choice") altCont choiceChildren = map head $ filter (not . null) $ map elChildren choices outputs <- mapD (childElemToRun ns) choiceChildren case outputs of r : _ -> return r [] -> throwError WrongElem
429
false
true
0
15
123
172
79
93
null
null
spechub/Hets
Driver/Options.hs
gpl-2.0
getExtensions :: HetcatsOpts -> [String] getExtensions opts = case intype opts of GuessIn | defLogicIsDMU opts -> [".xml"] | isDefLogic "Framework" opts -> [".elf", ".thy", ".maude", ".het", ".dol"] GuessIn -> downloadExtensions e@(ATermIn _) -> ['.' : show e, '.' : treeS ++ show e] e -> ['.' : show e] ++ [envSuffix]
384
getExtensions :: HetcatsOpts -> [String] getExtensions opts = case intype opts of GuessIn | defLogicIsDMU opts -> [".xml"] | isDefLogic "Framework" opts -> [".elf", ".thy", ".maude", ".het", ".dol"] GuessIn -> downloadExtensions e@(ATermIn _) -> ['.' : show e, '.' : treeS ++ show e] e -> ['.' : show e] ++ [envSuffix]
384
getExtensions opts = case intype opts of GuessIn | defLogicIsDMU opts -> [".xml"] | isDefLogic "Framework" opts -> [".elf", ".thy", ".maude", ".het", ".dol"] GuessIn -> downloadExtensions e@(ATermIn _) -> ['.' : show e, '.' : treeS ++ show e] e -> ['.' : show e] ++ [envSuffix]
343
false
true
2
11
117
144
73
71
null
null
phadej/stack
src/Stack/Types/Config.hs
bsd-3-clause
configMonoidDefaultTemplateName :: Text configMonoidDefaultTemplateName = "default-template"
92
configMonoidDefaultTemplateName :: Text configMonoidDefaultTemplateName = "default-template"
92
configMonoidDefaultTemplateName = "default-template"
52
false
true
0
4
5
11
6
5
null
null
zachsully/hakaru
haskell/Language/Hakaru/Syntax/IClasses.hs
bsd-3-clause
dsingleton1 :: a x -> DList1 a '[ x ] dsingleton1 x = DList1 (Cons1 x)
70
dsingleton1 :: a x -> DList1 a '[ x ] dsingleton1 x = DList1 (Cons1 x)
70
dsingleton1 x = DList1 (Cons1 x)
32
false
true
0
8
15
40
19
21
null
null
write-you-a-scheme-v2/scheme
archive/Parse2.hs
mit
def = emptyDef { commentStart = "{-" , commentEnd = "-}" , identStart = letter , identLetter = alphaNum , opStart = oneOf "~&=:" , opLetter = oneOf "~&=:" , reservedOpNames = ["~", "&", "=", ":=", "'", "\""] , reservedNames = ["true", "false", -- "let", "quote", "lambda", "Nil", "if", "then", "else", "fi", "while", "do", "od"] }
575
def = emptyDef { commentStart = "{-" , commentEnd = "-}" , identStart = letter , identLetter = alphaNum , opStart = oneOf "~&=:" , opLetter = oneOf "~&=:" , reservedOpNames = ["~", "&", "=", ":=", "'", "\""] , reservedNames = ["true", "false", -- "let", "quote", "lambda", "Nil", "if", "then", "else", "fi", "while", "do", "od"] }
575
def = emptyDef { commentStart = "{-" , commentEnd = "-}" , identStart = letter , identLetter = alphaNum , opStart = oneOf "~&=:" , opLetter = oneOf "~&=:" , reservedOpNames = ["~", "&", "=", ":=", "'", "\""] , reservedNames = ["true", "false", -- "let", "quote", "lambda", "Nil", "if", "then", "else", "fi", "while", "do", "od"] }
575
false
false
1
8
300
115
71
44
null
null
Thell/pandoc
src/Text/Pandoc/Writers/Custom.hs
gpl-2.0
inlineToCustom lua Space = callfunc lua "Space"
47
inlineToCustom lua Space = callfunc lua "Space"
47
inlineToCustom lua Space = callfunc lua "Space"
47
false
false
1
5
6
20
7
13
null
null
gscalzo/HaskellTheHardWay
gloss-try/gloss-master/gloss-examples/raster/Fluid/src-repa/Stage/Boundary.hs
mit
-- | Map a position in the edges array to what they were in the original -- array. edgeCases :: Int -> DIM2 -> DIM2 edgeCases width (Z:.j:.i) | j == 0 = (Z:.0 :.i) | j == 1 = (Z:.(width-1) :.i) | j == 2 = (Z:.i :.0) | j == 3 = (Z:.i :.(width-1)) | otherwise = error "Incorrect coordinate given in setBoundary"
387
edgeCases :: Int -> DIM2 -> DIM2 edgeCases width (Z:.j:.i) | j == 0 = (Z:.0 :.i) | j == 1 = (Z:.(width-1) :.i) | j == 2 = (Z:.i :.0) | j == 3 = (Z:.i :.(width-1)) | otherwise = error "Incorrect coordinate given in setBoundary"
302
edgeCases width (Z:.j:.i) | j == 0 = (Z:.0 :.i) | j == 1 = (Z:.(width-1) :.i) | j == 2 = (Z:.i :.0) | j == 3 = (Z:.i :.(width-1)) | otherwise = error "Incorrect coordinate given in setBoundary"
269
true
true
1
10
142
164
83
81
null
null
green-haskell/ghc
compiler/nativeGen/PPC/Regs.hs
bsd-3-clause
allArgRegs :: [Reg] allArgRegs = map regSingle [3..10]
54
allArgRegs :: [Reg] allArgRegs = map regSingle [3..10]
54
allArgRegs = map regSingle [3..10]
34
false
true
0
6
7
24
13
11
null
null
TakeLab/gpkex
kex.hs
bsd-3-clause
eval First c = Just (cFirst c)
32
eval First c = Just (cFirst c)
32
eval First c = Just (cFirst c)
32
false
false
0
7
8
20
9
11
null
null
robarago/vizhaskell
hs/AVLTree.hs
gpl-2.0
insert x n@(Node l y r _) | x < y = join (insert x l) y r | x > y = join l y (insert x r) | x == y = n
110
insert x n@(Node l y r _) | x < y = join (insert x l) y r | x > y = join l y (insert x r) | x == y = n
110
insert x n@(Node l y r _) | x < y = join (insert x l) y r | x > y = join l y (insert x r) | x == y = n
110
false
false
2
8
42
93
43
50
null
null
maoe/fop
12-Fun-with-Phantom-Types/Type.hs
bsd-3-clause
uncompress' RPerson = undefined
37
uncompress' RPerson = undefined
37
uncompress' RPerson = undefined
37
false
false
0
5
9
9
4
5
null
null
AKST/jo
source/lib/JoScript/Pass/Block.hs
mit
-------------------------------------------------------------- -- Lens -- -------------------------------------------------------------- position' :: Functor f => (Position -> f Position) -> State -> f State position' f (PS branch position m) = fmap (\position'' -> PS branch position'' m) (f position)
355
position' :: Functor f => (Position -> f Position) -> State -> f State position' f (PS branch position m) = fmap (\position'' -> PS branch position'' m) (f position)
165
position' f (PS branch position m) = fmap (\position'' -> PS branch position'' m) (f position)
94
true
true
0
9
87
83
42
41
null
null
rueshyna/gogol
gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer/Types/Product.hs
mpl-2.0
-- | The base URL used in cookie match requests. aCookieMatchingURL :: Lens' Account (Maybe Text) aCookieMatchingURL = lens _aCookieMatchingURL (\ s a -> s{_aCookieMatchingURL = a})
189
aCookieMatchingURL :: Lens' Account (Maybe Text) aCookieMatchingURL = lens _aCookieMatchingURL (\ s a -> s{_aCookieMatchingURL = a})
140
aCookieMatchingURL = lens _aCookieMatchingURL (\ s a -> s{_aCookieMatchingURL = a})
91
true
true
0
8
34
49
25
24
null
null
mattias-lundell/timber-llvm
src/Env.hs
bsd-3-clause
insertClassPred pre n@(w,p) post env = env { classEnv = insert c wg' (classEnv env) } where c = headsym p ws = repeat w wg = findClass env c wg' = WG { nodes = insertBefore n post (nodes wg), arcs = pre `zip` ws ++ ws `zip` post ++ arcs wg }
434
insertClassPred pre n@(w,p) post env = env { classEnv = insert c wg' (classEnv env) } where c = headsym p ws = repeat w wg = findClass env c wg' = WG { nodes = insertBefore n post (nodes wg), arcs = pre `zip` ws ++ ws `zip` post ++ arcs wg }
434
insertClassPred pre n@(w,p) post env = env { classEnv = insert c wg' (classEnv env) } where c = headsym p ws = repeat w wg = findClass env c wg' = WG { nodes = insertBefore n post (nodes wg), arcs = pre `zip` ws ++ ws `zip` post ++ arcs wg }
434
false
false
3
11
246
130
69
61
null
null
tolysz/prepare-ghcjs
spec-lts8/aeson/tests/DataFamilies/Encoders.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- Generic encoders/decoders -------------------------------------------------------------------------------- -- Nullary gNullaryToJSONString :: Nullary Int -> Value gNullaryToJSONString = genericToJSON defaultOptions
300
gNullaryToJSONString :: Nullary Int -> Value gNullaryToJSONString = genericToJSON defaultOptions
96
gNullaryToJSONString = genericToJSON defaultOptions
51
true
true
0
6
18
25
14
11
null
null
kindohm/Tidal
Sound/Tidal/Tempo.hs
gpl-3.0
serverApp :: MVar Tempo -> MVar ClientState -> WS.ServerApp serverApp tempoState clientState pending = do conn <- WS.acceptRequest pending tempo <- liftIO $ readMVar tempoState liftIO $ WS.sendTextData conn $ T.pack $ show tempo clients <- liftIO $ readMVar clientState liftIO $ modifyMVar_ clientState $ \s -> return $ addClient conn s serverLoop conn tempoState clientState
399
serverApp :: MVar Tempo -> MVar ClientState -> WS.ServerApp serverApp tempoState clientState pending = do conn <- WS.acceptRequest pending tempo <- liftIO $ readMVar tempoState liftIO $ WS.sendTextData conn $ T.pack $ show tempo clients <- liftIO $ readMVar clientState liftIO $ modifyMVar_ clientState $ \s -> return $ addClient conn s serverLoop conn tempoState clientState
399
serverApp tempoState clientState pending = do conn <- WS.acceptRequest pending tempo <- liftIO $ readMVar tempoState liftIO $ WS.sendTextData conn $ T.pack $ show tempo clients <- liftIO $ readMVar clientState liftIO $ modifyMVar_ clientState $ \s -> return $ addClient conn s serverLoop conn tempoState clientState
339
false
true
0
12
79
142
62
80
null
null
shlevy/ghc
compiler/types/TyCoRep.hs
bsd-3-clause
tidyType env (TyVarTy tv) = TyVarTy (tidyTyVarOcc env tv)
65
tidyType env (TyVarTy tv) = TyVarTy (tidyTyVarOcc env tv)
65
tidyType env (TyVarTy tv) = TyVarTy (tidyTyVarOcc env tv)
65
false
false
0
7
16
30
13
17
null
null
sgillespie/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
translateOp _ FloatSubOp = Just (MO_F_Sub W32)
55
translateOp _ FloatSubOp = Just (MO_F_Sub W32)
55
translateOp _ FloatSubOp = Just (MO_F_Sub W32)
55
false
false
0
7
15
20
9
11
null
null
SKA-ScienceDataProcessor/RC
MS6/dna/core/DNA/Channel/File.hs
apache-2.0
exportFromFileChan :: FileChan a -- ^ Source file channel -> String -- ^ Name of the file to transfer -> FilePath -- ^ Destination file name -> IO () exportFromFileChan ch p to = copyFile (fhPath ch </> p) to
255
exportFromFileChan :: FileChan a -- ^ Source file channel -> String -- ^ Name of the file to transfer -> FilePath -- ^ Destination file name -> IO () exportFromFileChan ch p to = copyFile (fhPath ch </> p) to
255
exportFromFileChan ch p to = copyFile (fhPath ch </> p) to
60
false
true
0
9
86
56
28
28
null
null
ddssff/pretty-listlike
src/Text/PrettyPrint/HughesPJ.hs
bsd-3-clause
lbrack = char '['
17
lbrack = char '['
17
lbrack = char '['
17
false
false
0
5
3
9
4
5
null
null
brownplt/webbits
src/BrownPLT/JavaScript/PrettyPrint.hs
bsd-3-clause
prop :: Prop a -> Doc prop p = case p of PropId _ id -> pp id PropString _ str -> doubleQuotes (text (jsEscape str)) PropNum _ n -> text (show n)
151
prop :: Prop a -> Doc prop p = case p of PropId _ id -> pp id PropString _ str -> doubleQuotes (text (jsEscape str)) PropNum _ n -> text (show n)
151
prop p = case p of PropId _ id -> pp id PropString _ str -> doubleQuotes (text (jsEscape str)) PropNum _ n -> text (show n)
129
false
true
6
11
38
84
39
45
null
null
cartazio/omega
mosaic/LambdaBuilder.hs
bsd-3-clause
t5' = close (EmptyRoot t5) t5
29
t5' = close (EmptyRoot t5) t5
29
t5' = close (EmptyRoot t5) t5
29
false
false
1
6
5
22
8
14
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/ghci/ByteCodeItbls.hs
bsd-3-clause
funPtrToInt :: FunPtr a -> Int funPtrToInt (FunPtr a#) = I# (addr2Int# a#)
74
funPtrToInt :: FunPtr a -> Int funPtrToInt (FunPtr a#) = I# (addr2Int# a#)
74
funPtrToInt (FunPtr a#) = I# (addr2Int# a#)
43
false
true
0
7
12
36
17
19
null
null
imalsogreg/orgmode-parse
test/Document.hs
bsd-3-clause
sampleParagraph :: Text sampleParagraph = "This is some sample text in a paragraph which may contain * , : , and other special characters.\n\n"
143
sampleParagraph :: Text sampleParagraph = "This is some sample text in a paragraph which may contain * , : , and other special characters.\n\n"
143
sampleParagraph = "This is some sample text in a paragraph which may contain * , : , and other special characters.\n\n"
119
false
true
0
4
23
11
6
5
null
null
jasonzoladz/persistent
persistent-redis/Database/Persist/Redis/Update.hs
mit
apply Divide _ _ = throw $ IncorrectUpdate "Unable to apply subtraction to this field"
86
apply Divide _ _ = throw $ IncorrectUpdate "Unable to apply subtraction to this field"
86
apply Divide _ _ = throw $ IncorrectUpdate "Unable to apply subtraction to this field"
86
false
false
0
6
14
22
9
13
null
null
Fuuzetsu/aeson-schema
src/Data/Aeson/Schema/Choice/TH.hs
mit
generateChoice :: Int -> Q [Dec] generateChoice n | n < 2 = return []
69
generateChoice :: Int -> Q [Dec] generateChoice n | n < 2 = return []
69
generateChoice n | n < 2 = return []
36
false
true
0
8
14
42
19
23
null
null
HaskellForCats/HaskellForCats
stockBuy.hs
mit
-- [200.0,500.0,400.0,150.0,300.0] buyTime = map fst dollarBuyTime
67
buyTime = map fst dollarBuyTime
32
buyTime = map fst dollarBuyTime
32
true
false
1
5
7
17
6
11
null
null
konn/Yablog
Foundation.hs
bsd-2-clause
getReCAPTCHA :: ((T.Text, T.Text) -> b) -> GHandler sub Yablog b getReCAPTCHA f = do mRe <- extraReCAPTCHA . appExtra . settings <$> getYesod case mRe of Nothing -> fail "ReCAPTCHA is not enabled." Just re -> return $ f re -- This instance is required to use forms. You can modify renderMessage to -- achieve customized and internationalized form validation messages.
380
getReCAPTCHA :: ((T.Text, T.Text) -> b) -> GHandler sub Yablog b getReCAPTCHA f = do mRe <- extraReCAPTCHA . appExtra . settings <$> getYesod case mRe of Nothing -> fail "ReCAPTCHA is not enabled." Just re -> return $ f re -- This instance is required to use forms. You can modify renderMessage to -- achieve customized and internationalized form validation messages.
380
getReCAPTCHA f = do mRe <- extraReCAPTCHA . appExtra . settings <$> getYesod case mRe of Nothing -> fail "ReCAPTCHA is not enabled." Just re -> return $ f re -- This instance is required to use forms. You can modify renderMessage to -- achieve customized and internationalized form validation messages.
315
false
true
0
11
74
95
47
48
null
null
cshung/MiscLab
Haskell99/q11.test.hs
mit
test6 = TestCase (assertEqualEntryList "encodeModified [1,2,2] should be [(Single 1),(Multiple 2 2)] ." ([(Single 1),(Multiple 2 2)] ) (encodeModified [1,2,2]))
172
test6 = TestCase (assertEqualEntryList "encodeModified [1,2,2] should be [(Single 1),(Multiple 2 2)] ." ([(Single 1),(Multiple 2 2)] ) (encodeModified [1,2,2]))
172
test6 = TestCase (assertEqualEntryList "encodeModified [1,2,2] should be [(Single 1),(Multiple 2 2)] ." ([(Single 1),(Multiple 2 2)] ) (encodeModified [1,2,2]))
172
false
false
1
11
31
60
31
29
null
null
tamarin-prover/tamarin-prover
src/Web/Types.hs
gpl-3.0
prefixWithUnderscore cs = cs
36
prefixWithUnderscore cs = cs
36
prefixWithUnderscore cs = cs
36
false
false
0
5
11
9
4
5
null
null
DavidAlphaFox/ghc
libraries/containers/Data/Map/Strict.hs
bsd-3-clause
{-------------------------------------------------------------------- Deletion --------------------------------------------------------------------} -- | /O(log n)/. Update a value at a specific key with the result of the provided function. -- When the key is not -- a member of the map, the original map is returned. -- -- > adjust ("new " ++) 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "new a")] -- > adjust ("new " ++) 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")] -- > adjust ("new " ++) 7 empty == empty adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a adjust f = adjustWithKey (\_ x -> f x)
665
adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a adjust f = adjustWithKey (\_ x -> f x)
93
adjust f = adjustWithKey (\_ x -> f x)
38
true
true
0
10
136
78
41
37
null
null
dmvianna/strict
src/text.hs
bsd-3-clause
dictWordsTL :: IO TL.Text dictWordsTL = TLIO.readFile "/usr/share/dict/words"
77
dictWordsTL :: IO TL.Text dictWordsTL = TLIO.readFile "/usr/share/dict/words"
77
dictWordsTL = TLIO.readFile "/usr/share/dict/words"
51
false
true
0
7
7
27
11
16
null
null
dsj36/dropray
src/BabyRays/Material.hs
gpl-3.0
checked_matt :: Point -> Material checked_matt (Point x y z) = let xeven = even (truncate (x / 20.0)) yeven = even (truncate (y / 20.0)) zeven = even (truncate (z / 20.0)) in if (xeven `xor` yeven `xor` zeven) then (white, 0.0, 1.0) else (black, 0.0, 1.0)
414
checked_matt :: Point -> Material checked_matt (Point x y z) = let xeven = even (truncate (x / 20.0)) yeven = even (truncate (y / 20.0)) zeven = even (truncate (z / 20.0)) in if (xeven `xor` yeven `xor` zeven) then (white, 0.0, 1.0) else (black, 0.0, 1.0)
414
checked_matt (Point x y z) = let xeven = even (truncate (x / 20.0)) yeven = even (truncate (y / 20.0)) zeven = even (truncate (z / 20.0)) in if (xeven `xor` yeven `xor` zeven) then (white, 0.0, 1.0) else (black, 0.0, 1.0)
380
false
true
0
13
206
144
77
67
null
null
alephcloud/hs-aws-sns
src/Aws/Sns/Internal.hs
mit
fmapL :: (a -> b) -> Either a c -> Either b c fmapL f (Left e) = Left (f e)
75
fmapL :: (a -> b) -> Either a c -> Either b c fmapL f (Left e) = Left (f e)
75
fmapL f (Left e) = Left (f e)
29
false
true
0
10
20
61
28
33
null
null
bobgru/conifer
examples/ellipse.hs
bsd-3-clause
-- circleDots -- :: (Semigroup a, TrailLike a, Transformable a, HasStyle a, -- HasOrigin a, Monoid a, V a ~ R2) => -- a circleDots = position $ zip (origin : circlePoints) (repeat dot) where dot = circle 0.03 # lw none
232
circleDots = position $ zip (origin : circlePoints) (repeat dot) where dot = circle 0.03 # lw none
102
circleDots = position $ zip (origin : circlePoints) (repeat dot) where dot = circle 0.03 # lw none
102
true
false
6
7
55
60
26
34
null
null
JoeyEremondi/elm-summer-opt
src/Validate.hs
bsd-3-clause
portHelp :: Maybe String -> R.Region -> D.SourcePort -> [D.SourceDecl] -> Result.Result wrn Error.Error [D.ValidDecl] portHelp comment region port decls = let addRest port' rest = (:) (A.A (region,comment) (D.Port port')) <$> validateDecls Nothing rest in case port of D.PortDefinition name _ -> Result.throw region (Error.PortWithoutAnnotation name) D.PortAnnotation name tipe -> case decls of D.Decl (A.A _ (D.Port (D.PortDefinition name' expr))) : rest | name == name' -> do expr' <- Validate.expression expr let port' = D.Out name expr' tipe addRest port' rest _ -> addRest (D.In name tipe) decls -- VALIDATE DEFINITIONS
807
portHelp :: Maybe String -> R.Region -> D.SourcePort -> [D.SourceDecl] -> Result.Result wrn Error.Error [D.ValidDecl] portHelp comment region port decls = let addRest port' rest = (:) (A.A (region,comment) (D.Port port')) <$> validateDecls Nothing rest in case port of D.PortDefinition name _ -> Result.throw region (Error.PortWithoutAnnotation name) D.PortAnnotation name tipe -> case decls of D.Decl (A.A _ (D.Port (D.PortDefinition name' expr))) : rest | name == name' -> do expr' <- Validate.expression expr let port' = D.Out name expr' tipe addRest port' rest _ -> addRest (D.In name tipe) decls -- VALIDATE DEFINITIONS
807
portHelp comment region port decls = let addRest port' rest = (:) (A.A (region,comment) (D.Port port')) <$> validateDecls Nothing rest in case port of D.PortDefinition name _ -> Result.throw region (Error.PortWithoutAnnotation name) D.PortAnnotation name tipe -> case decls of D.Decl (A.A _ (D.Port (D.PortDefinition name' expr))) : rest | name == name' -> do expr' <- Validate.expression expr let port' = D.Out name expr' tipe addRest port' rest _ -> addRest (D.In name tipe) decls -- VALIDATE DEFINITIONS
669
false
true
0
21
275
284
135
149
null
null
transtone/transconfig
xmonad.hs
mit
myNormalBorderColor = "#729fcf"
32
myNormalBorderColor = "#729fcf"
32
myNormalBorderColor = "#729fcf"
32
false
false
1
5
3
10
3
7
null
null
liamoc/geordi
Tests/Geordi/UrlPattern.hs
bsd-3-clause
seglists :: Gen (Exists (SegList f)) seglists = sized $ go where go 0 = return $ ExI Nil go n = do ExI x <- segtypes ExI xs <- go $ n - 1 return $ ExI (Cons x xs)
218
seglists :: Gen (Exists (SegList f)) seglists = sized $ go where go 0 = return $ ExI Nil go n = do ExI x <- segtypes ExI xs <- go $ n - 1 return $ ExI (Cons x xs)
218
seglists = sized $ go where go 0 = return $ ExI Nil go n = do ExI x <- segtypes ExI xs <- go $ n - 1 return $ ExI (Cons x xs)
181
false
true
1
11
96
107
47
60
null
null
nevrenato/Hets_Fork
Isabelle/IsaParse.hs
gpl-2.0
constdecl :: Parser [Const] constdecl = do n <- nameP do t <- typeSuffix << optional mixfix return [Const n t] <|> (lexS "where" >> return []) <|> (mixfix >> return [])
190
constdecl :: Parser [Const] constdecl = do n <- nameP do t <- typeSuffix << optional mixfix return [Const n t] <|> (lexS "where" >> return []) <|> (mixfix >> return [])
190
constdecl = do n <- nameP do t <- typeSuffix << optional mixfix return [Const n t] <|> (lexS "where" >> return []) <|> (mixfix >> return [])
162
false
true
3
12
53
94
44
50
null
null
peterokagey/haskellOEIS
src/Sandbox/MonotonicSubsequence.hs
apache-2.0
longestMonotonicIncreasing (x:xs) = recurse xs [(x, 1)] where recurse [] known = maximum $ map snd known recurse (y:ys) known | y < x = recurse ys known | otherwise = recurse ys ((y, 1 + newValue) : known) where newValue = maximum $ map snd $ filter (\(a, b) -> y >= a) known -- Length of the longest monotonic decreasing subsequence of (a_1,a_2,...) -- that starts with a_1.
399
longestMonotonicIncreasing (x:xs) = recurse xs [(x, 1)] where recurse [] known = maximum $ map snd known recurse (y:ys) known | y < x = recurse ys known | otherwise = recurse ys ((y, 1 + newValue) : known) where newValue = maximum $ map snd $ filter (\(a, b) -> y >= a) known -- Length of the longest monotonic decreasing subsequence of (a_1,a_2,...) -- that starts with a_1.
399
longestMonotonicIncreasing (x:xs) = recurse xs [(x, 1)] where recurse [] known = maximum $ map snd known recurse (y:ys) known | y < x = recurse ys known | otherwise = recurse ys ((y, 1 + newValue) : known) where newValue = maximum $ map snd $ filter (\(a, b) -> y >= a) known -- Length of the longest monotonic decreasing subsequence of (a_1,a_2,...) -- that starts with a_1.
399
false
false
0
13
93
159
82
77
null
null
snoyberg/ghc
compiler/stgSyn/StgLint.hs
bsd-3-clause
lintStgExpr (StgTick _ expr) = lintStgExpr expr
47
lintStgExpr (StgTick _ expr) = lintStgExpr expr
47
lintStgExpr (StgTick _ expr) = lintStgExpr expr
47
false
false
0
6
6
21
9
12
null
null
piyush-kurur/shakespeare
shakespeare-css/Text/Cassius.hs
bsd-2-clause
renderCssUrl :: (url -> [(TS.Text, TS.Text)] -> TS.Text) -> CssUrl url -> TL.Text renderCssUrl r s = renderCss $ s r
116
renderCssUrl :: (url -> [(TS.Text, TS.Text)] -> TS.Text) -> CssUrl url -> TL.Text renderCssUrl r s = renderCss $ s r
116
renderCssUrl r s = renderCss $ s r
34
false
true
0
12
20
67
33
34
null
null
PhDP/Sphinx-AI
Faun/Parser/Core.hs
mit
reservedOp :: String -> Parser () --reserved = Tok.reserved lexer reservedOp = Tok.reservedOp lexer
99
reservedOp :: String -> Parser () reservedOp = Tok.reservedOp lexer
67
reservedOp = Tok.reservedOp lexer
33
true
true
0
8
13
31
14
17
null
null
mgold/Elm
src/Elm/Package.hs
bsd-3-clause
-- FILTERING filterLatest :: (Ord a) => (Version -> a) -> [Version] -> [Version] filterLatest characteristic versions = map last (List.groupBy ((==) `on` characteristic) (List.sort versions))
196
filterLatest :: (Ord a) => (Version -> a) -> [Version] -> [Version] filterLatest characteristic versions = map last (List.groupBy ((==) `on` characteristic) (List.sort versions))
182
filterLatest characteristic versions = map last (List.groupBy ((==) `on` characteristic) (List.sort versions))
114
true
true
0
10
30
81
45
36
null
null
nikai3d/ce-challenges
easy/capitalize_words.hs
bsd-3-clause
capitalize (x : xs) = toUpper x : xs
36
capitalize (x : xs) = toUpper x : xs
36
capitalize (x : xs) = toUpper x : xs
36
false
false
2
6
8
26
11
15
null
null
ptek/zurihac-machines
TrafficPaolino.hs
bsd-3-clause
----------------------------- library ---------------------------- -- | step a moore machine feeding the input stepMoore :: a -> Moore a t -> Moore a t stepMoore x (Moore _ f) = f x
182
stepMoore :: a -> Moore a t -> Moore a t stepMoore x (Moore _ f) = f x
70
stepMoore x (Moore _ f) = f x
29
true
true
0
10
31
51
24
27
null
null
spechub/Hets
Comorphisms/CSMOF2CASL.hs
gpl-2.0
generateExEqualList :: [VAR] -> SORT -> [CASLFORMULA] generateExEqualList vars sor = case vars of [] -> [] v : rest -> generateExEqualVar rest sor v ++ generateExEqualList rest sor
190
generateExEqualList :: [VAR] -> SORT -> [CASLFORMULA] generateExEqualList vars sor = case vars of [] -> [] v : rest -> generateExEqualVar rest sor v ++ generateExEqualList rest sor
190
generateExEqualList vars sor = case vars of [] -> [] v : rest -> generateExEqualVar rest sor v ++ generateExEqualList rest sor
136
false
true
3
7
38
60
30
30
null
null
uduki/hsQt
Qtc/Enums/Gui/QLayout.hs
bsd-2-clause
eSetMinAndMaxSize :: SizeConstraint eSetMinAndMaxSize = ieSizeConstraint $ 5
78
eSetMinAndMaxSize :: SizeConstraint eSetMinAndMaxSize = ieSizeConstraint $ 5
78
eSetMinAndMaxSize = ieSizeConstraint $ 5
42
false
true
0
6
9
18
8
10
null
null
Alex-Diez/haskell-tdd-kata
old-katas/src/CalculatorKata/Day2.hs
bsd-3-clause
parseTerm :: String -> Double parseTerm term = 0
52
parseTerm :: String -> Double parseTerm term = 0
48
parseTerm term = 0
18
false
true
0
7
12
20
9
11
null
null
ezyang/ghc
compiler/basicTypes/Name.hs
bsd-3-clause
isExternalName _ = False
54
isExternalName _ = False
54
isExternalName _ = False
54
false
false
0
4
33
10
4
6
null
null
muhbaasu/pfennig-server
src/Pfennig/Authentication.hs
mit
insertNewUser :: UserEmail -> BS.ByteString -> H.Tx HP.Postgres s (Maybe User) insertNewUser (UserEmail email) password = do newUser <- H.maybeEx $ [H.stmt|insert into users (email, password) values (?, ?) returning * |] email password return $ rowToUser <$> newUser
325
insertNewUser :: UserEmail -> BS.ByteString -> H.Tx HP.Postgres s (Maybe User) insertNewUser (UserEmail email) password = do newUser <- H.maybeEx $ [H.stmt|insert into users (email, password) values (?, ?) returning * |] email password return $ rowToUser <$> newUser
325
insertNewUser (UserEmail email) password = do newUser <- H.maybeEx $ [H.stmt|insert into users (email, password) values (?, ?) returning * |] email password return $ rowToUser <$> newUser
246
false
true
0
10
97
89
43
46
null
null
mydaum/cabal
Cabal/Distribution/Simple.hs
bsd-3-clause
sanityCheckHookedBuildInfo pkg_descr (_, hookExes) | not (null nonExistant) = die $ "The buildinfo contains info for an executable called '" ++ display (head nonExistant) ++ "' but the package does not have a " ++ "executable with that name." where pkgExeNames = nub (map exeName (executables pkg_descr)) hookExeNames = nub (map fst hookExes) nonExistant = hookExeNames \\ pkgExeNames
426
sanityCheckHookedBuildInfo pkg_descr (_, hookExes) | not (null nonExistant) = die $ "The buildinfo contains info for an executable called '" ++ display (head nonExistant) ++ "' but the package does not have a " ++ "executable with that name." where pkgExeNames = nub (map exeName (executables pkg_descr)) hookExeNames = nub (map fst hookExes) nonExistant = hookExeNames \\ pkgExeNames
426
sanityCheckHookedBuildInfo pkg_descr (_, hookExes) | not (null nonExistant) = die $ "The buildinfo contains info for an executable called '" ++ display (head nonExistant) ++ "' but the package does not have a " ++ "executable with that name." where pkgExeNames = nub (map exeName (executables pkg_descr)) hookExeNames = nub (map fst hookExes) nonExistant = hookExeNames \\ pkgExeNames
426
false
false
0
11
99
107
52
55
null
null
olsner/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
gpush :: Reg -> RegNo -> SDoc gpush reg offset = hcat [text "fld ", greg reg offset]
87
gpush :: Reg -> RegNo -> SDoc gpush reg offset = hcat [text "fld ", greg reg offset]
87
gpush reg offset = hcat [text "fld ", greg reg offset]
57
false
true
0
7
20
41
20
21
null
null
AndreasPK/yalvm
src/LuaObjects.hs
bsd-3-clause
-- | getTableElement table key -> value getTableElement :: LTable -> LuaObject -> LuaObject getTableElement (LTable m) k | k == LONil = LONil | Map.member k m = m Map.! k | otherwise = LONil
196
getTableElement :: LTable -> LuaObject -> LuaObject getTableElement (LTable m) k | k == LONil = LONil | Map.member k m = m Map.! k | otherwise = LONil
156
getTableElement (LTable m) k | k == LONil = LONil | Map.member k m = m Map.! k | otherwise = LONil
104
true
true
1
9
41
73
35
38
null
null
gridaphobe/ghc
compiler/typecheck/TcBinds.hs
bsd-3-clause
mk_impedence_match_msg :: MonoBindInfo -> TcType -> TcType -> TidyEnv -> TcM (TidyEnv, SDoc) -- This is a rare but rather awkward error messages mk_impedence_match_msg (MBI { mbi_poly_name = name, mbi_sig = mb_sig }) inf_ty sig_ty tidy_env = do { (tidy_env1, inf_ty) <- zonkTidyTcType tidy_env inf_ty ; (tidy_env2, sig_ty) <- zonkTidyTcType tidy_env1 sig_ty ; let msg = vcat [ text "When checking that the inferred type" , nest 2 $ ppr name <+> dcolon <+> ppr inf_ty , text "is as general as its" <+> what <+> text "signature" , nest 2 $ ppr name <+> dcolon <+> ppr sig_ty ] ; return (tidy_env2, msg) } where what = case mb_sig of Nothing -> text "inferred" Just sig | isPartialSig sig -> text "(partial)" | otherwise -> empty
965
mk_impedence_match_msg :: MonoBindInfo -> TcType -> TcType -> TidyEnv -> TcM (TidyEnv, SDoc) mk_impedence_match_msg (MBI { mbi_poly_name = name, mbi_sig = mb_sig }) inf_ty sig_ty tidy_env = do { (tidy_env1, inf_ty) <- zonkTidyTcType tidy_env inf_ty ; (tidy_env2, sig_ty) <- zonkTidyTcType tidy_env1 sig_ty ; let msg = vcat [ text "When checking that the inferred type" , nest 2 $ ppr name <+> dcolon <+> ppr inf_ty , text "is as general as its" <+> what <+> text "signature" , nest 2 $ ppr name <+> dcolon <+> ppr sig_ty ] ; return (tidy_env2, msg) } where what = case mb_sig of Nothing -> text "inferred" Just sig | isPartialSig sig -> text "(partial)" | otherwise -> empty
913
mk_impedence_match_msg (MBI { mbi_poly_name = name, mbi_sig = mb_sig }) inf_ty sig_ty tidy_env = do { (tidy_env1, inf_ty) <- zonkTidyTcType tidy_env inf_ty ; (tidy_env2, sig_ty) <- zonkTidyTcType tidy_env1 sig_ty ; let msg = vcat [ text "When checking that the inferred type" , nest 2 $ ppr name <+> dcolon <+> ppr inf_ty , text "is as general as its" <+> what <+> text "signature" , nest 2 $ ppr name <+> dcolon <+> ppr sig_ty ] ; return (tidy_env2, msg) } where what = case mb_sig of Nothing -> text "inferred" Just sig | isPartialSig sig -> text "(partial)" | otherwise -> empty
774
true
true
3
15
365
253
124
129
null
null
haasn/colour
Tests.hs
mit
prop_disolveId :: RAlphaColour -> Bool prop_disolveId c = dissolve 1 c == c
75
prop_disolveId :: RAlphaColour -> Bool prop_disolveId c = dissolve 1 c == c
75
prop_disolveId c = dissolve 1 c == c
36
false
true
0
7
12
33
14
19
null
null
facebookincubator/duckling
Duckling/Ordinal/KA/Rules.hs
bsd-3-clause
ordinalsMap :: HashMap Text Int ordinalsMap = HashMap.fromList [ ("პირველი", 1) , ("პირველ", 1) , ("მეერთე", 1) , ("მეორე", 2) , ("მესამე", 3) , ("მეოთხე", 4) , ("მეხუთე", 5) , ("მეექვსე", 6) , ("მეშვიდე", 7) , ("მერვე", 8) , ("მეცხრე", 9) , ("მეათე", 10) , ("მეთერთმეტე", 11) , ("მეთორმეტე", 12) , ("მეცამეტე", 13) , ("მეთოთხმეტე", 14) , ("მეთხუთმეტე", 15) , ("მეთქვსმეტე", 16) , ("მეჩვიდმეტე", 17) , ("მეთვრამეტე", 18) , ("მეცხრამეტე", 19) , ("მეოცე", 20) , ("ოცდამეათე", 30) , ("მეორმოცე", 40) , ("ორმოცდამეათე", 50) , ("მესამოცე", 60) , ("სამოცდამეათე", 70) , ("მეოთხმოცე", 80) , ("ოთხმოცდამეათე", 90) ]
667
ordinalsMap :: HashMap Text Int ordinalsMap = HashMap.fromList [ ("პირველი", 1) , ("პირველ", 1) , ("მეერთე", 1) , ("მეორე", 2) , ("მესამე", 3) , ("მეოთხე", 4) , ("მეხუთე", 5) , ("მეექვსე", 6) , ("მეშვიდე", 7) , ("მერვე", 8) , ("მეცხრე", 9) , ("მეათე", 10) , ("მეთერთმეტე", 11) , ("მეთორმეტე", 12) , ("მეცამეტე", 13) , ("მეთოთხმეტე", 14) , ("მეთხუთმეტე", 15) , ("მეთქვსმეტე", 16) , ("მეჩვიდმეტე", 17) , ("მეთვრამეტე", 18) , ("მეცხრამეტე", 19) , ("მეოცე", 20) , ("ოცდამეათე", 30) , ("მეორმოცე", 40) , ("ორმოცდამეათე", 50) , ("მესამოცე", 60) , ("სამოცდამეათე", 70) , ("მეოთხმოცე", 80) , ("ოთხმოცდამეათე", 90) ]
667
ordinalsMap = HashMap.fromList [ ("პირველი", 1) , ("პირველ", 1) , ("მეერთე", 1) , ("მეორე", 2) , ("მესამე", 3) , ("მეოთხე", 4) , ("მეხუთე", 5) , ("მეექვსე", 6) , ("მეშვიდე", 7) , ("მერვე", 8) , ("მეცხრე", 9) , ("მეათე", 10) , ("მეთერთმეტე", 11) , ("მეთორმეტე", 12) , ("მეცამეტე", 13) , ("მეთოთხმეტე", 14) , ("მეთხუთმეტე", 15) , ("მეთქვსმეტე", 16) , ("მეჩვიდმეტე", 17) , ("მეთვრამეტე", 18) , ("მეცხრამეტე", 19) , ("მეოცე", 20) , ("ოცდამეათე", 30) , ("მეორმოცე", 40) , ("ორმოცდამეათე", 50) , ("მესამოცე", 60) , ("სამოცდამეათე", 70) , ("მეოთხმოცე", 80) , ("ოთხმოცდამეათე", 90) ]
635
false
true
1
6
155
285
184
101
null
null
tjakway/ghcjvm
compiler/main/HscMain.hs
bsd-3-clause
logWarnings :: WarningMessages -> Hsc () logWarnings w = Hsc $ \_ w0 -> return ((), w0 `unionBags` w)
101
logWarnings :: WarningMessages -> Hsc () logWarnings w = Hsc $ \_ w0 -> return ((), w0 `unionBags` w)
101
logWarnings w = Hsc $ \_ w0 -> return ((), w0 `unionBags` w)
60
false
true
0
9
18
51
27
24
null
null
RobinKrom/BtcExchanges
src/Data/BtcExchanges.hs
bsd-3-clause
base BTCHKD = BTC
17
base BTCHKD = BTC
17
base BTCHKD = BTC
17
false
false
0
4
3
10
4
6
null
null
batterseapower/chsc
Evaluator/Deeds.hs
bsd-3-clause
-- NB: it is OK if the number of deeds to claim is negative -- that just causes some deeds to be released claimDeeds :: Deeds -> Int -> Maybe Deeds claimDeeds deeds want = guard (not dEEDS || deeds >= want) >> return (deeds - want)
231
claimDeeds :: Deeds -> Int -> Maybe Deeds claimDeeds deeds want = guard (not dEEDS || deeds >= want) >> return (deeds - want)
125
claimDeeds deeds want = guard (not dEEDS || deeds >= want) >> return (deeds - want)
83
true
true
0
10
46
63
30
33
null
null
zaxtax/hakaru
haskell/Tests/RoundTrip.hs
bsd-3-clause
t20 :: (ABT Term abt) => abt '[] ('HProb ':-> 'HMeasure HUnit) t20 = lam $ \y -> uniform_0_1 >>= \x -> weight (unsafeProb x * y)
128
t20 :: (ABT Term abt) => abt '[] ('HProb ':-> 'HMeasure HUnit) t20 = lam $ \y -> uniform_0_1 >>= \x -> weight (unsafeProb x * y)
128
t20 = lam $ \y -> uniform_0_1 >>= \x -> weight (unsafeProb x * y)
65
false
true
4
11
26
86
42
44
null
null
dysinger/amazonka
amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/Types.hs
mpl-2.0
-- | The Amazon SNS topic that you want to notify when Elastic Transcoder -- encounters a warning condition. nWarning :: Lens' Notifications (Maybe Text) nWarning = lens _nWarning (\s a -> s { _nWarning = a })
209
nWarning :: Lens' Notifications (Maybe Text) nWarning = lens _nWarning (\s a -> s { _nWarning = a })
100
nWarning = lens _nWarning (\s a -> s { _nWarning = a })
55
true
true
0
9
37
47
26
21
null
null
R-Morgan/NGramCrackers
src/NGramCrackers/Quant/Counts.hs
agpl-3.0
wcMap :: DocCol T.Text -> CrackerMap wcMap doc = wcMap' stream where wcMap' = foldl countElem M.empty stream = concatMap concat doc
159
wcMap :: DocCol T.Text -> CrackerMap wcMap doc = wcMap' stream where wcMap' = foldl countElem M.empty stream = concatMap concat doc
159
wcMap doc = wcMap' stream where wcMap' = foldl countElem M.empty stream = concatMap concat doc
122
false
true
0
8
49
53
25
28
null
null
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Healthcare/Types/Product.hs
mpl-2.0
-- | Token to retrieve the next page of results or empty if there are no more -- results in the list. lfsrNextPageToken :: Lens' ListFhirStoresResponse (Maybe Text) lfsrNextPageToken = lens _lfsrNextPageToken (\ s a -> s{_lfsrNextPageToken = a})
253
lfsrNextPageToken :: Lens' ListFhirStoresResponse (Maybe Text) lfsrNextPageToken = lens _lfsrNextPageToken (\ s a -> s{_lfsrNextPageToken = a})
151
lfsrNextPageToken = lens _lfsrNextPageToken (\ s a -> s{_lfsrNextPageToken = a})
88
true
true
1
9
46
53
26
27
null
null
facebookincubator/duckling
Duckling/Numeral/Helpers.hs
bsd-3-clause
diffIntegerDigits :: Double -> Double -> Int diffIntegerDigits a b = digitsOf a - digitsOf b where digitsOf :: Double -> Int digitsOf = digitsOfInt . floor . abs digitsOfInt :: Int -> Int digitsOfInt 0 = 0 digitsOfInt a = 1 + digitsOfInt (a `div` 10) -- ----------------------------------------------------------------- -- Patterns
355
diffIntegerDigits :: Double -> Double -> Int diffIntegerDigits a b = digitsOf a - digitsOf b where digitsOf :: Double -> Int digitsOf = digitsOfInt . floor . abs digitsOfInt :: Int -> Int digitsOfInt 0 = 0 digitsOfInt a = 1 + digitsOfInt (a `div` 10) -- ----------------------------------------------------------------- -- Patterns
355
diffIntegerDigits a b = digitsOf a - digitsOf b where digitsOf :: Double -> Int digitsOf = digitsOfInt . floor . abs digitsOfInt :: Int -> Int digitsOfInt 0 = 0 digitsOfInt a = 1 + digitsOfInt (a `div` 10) -- ----------------------------------------------------------------- -- Patterns
310
false
true
0
8
74
102
53
49
null
null
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
mpl-2.0
-- | The date the disbursement was initiated, in ISO 8601 format. ordDisbursementDate :: Lens' OrderReportDisbursement (Maybe Text) ordDisbursementDate = lens _ordDisbursementDate (\ s a -> s{_ordDisbursementDate = a})
226
ordDisbursementDate :: Lens' OrderReportDisbursement (Maybe Text) ordDisbursementDate = lens _ordDisbursementDate (\ s a -> s{_ordDisbursementDate = a})
160
ordDisbursementDate = lens _ordDisbursementDate (\ s a -> s{_ordDisbursementDate = a})
94
true
true
0
9
36
48
25
23
null
null
ledyba/java.js
lib/Java2js/JVM/Assembler.hs
gpl-3.0
byte2atype 7 = return T_DOUBLE
31
byte2atype 7 = return T_DOUBLE
31
byte2atype 7 = return T_DOUBLE
31
false
false
0
5
5
12
5
7
null
null
dgvncsz0f/hoauth
src/test/haskell/Test/Network/OAuth/Consumer.hs
bsd-3-clause
ftest13 = T.TestCase $ do let modulus = 0x00ce3fe6af65b85d7744a287268f0aea4fd783005b6306f353e9e49a9583f7d4ebc7870a65fc30ccdd5ce7a84b8d5a9356f06ae3d00599e5c8bda3b543f4331ccf04fd931e108d75e4abea9c120f46fe735138c31344e4b74a1788edf161d9c2ac6f8cc993927fcab4ef956b7150278daed0d2d630413a5ad56658026a3bcb3ced expoent = 0x17e54d6bdae42e68081ab07fe628c496f58826fd6f8eb9986a4be321198618342d0cd746939e6fcde1dab123f7bf9bbc81e4507aa47b7d24f1dbcabf91c66e3ad490605bcc36a8568bce27dc9d1584dc3e443499f819dc0a9d2b0233f5ae6d8ab8435121c811ffc7a5491718479d246d52f27172e5903f66814431186ec607e1 numbytes = 128 key = R.PrivateKey numbytes modulus expoent 0 0 0 0 0 Just req0 = parseURL "http://foo.bar:80/foobar?foo=bar&bar=foo" Just req1 = parseURL "https://foo.bar:443/foobar?foo=bar&bar=foo" app = Application "<<dummy>>" "<<dummy>>" OOB T.assertEqual "test sign_request (RSA-SHA1) ignores default port (http,80)" ("wspZGQBp1Gv0guYxVYTVllAtasGa9AaSAGcraB15Chgv0MXs4lSt/PPY41WGdQzT3K3D8l2veBeJEqEka63vSJNnDyMPb38oTJrRyn1TvaZzXq4Oyp2y6lgmxL9x4xOrLLGBIMQ8T2gWL+eQJ7FeqTL83MdMqUulyJfxc9PeObA=") -- msg:PUT&http%3A%2F%2Ffoo.bar%2Ffoobar&bar%3Dfoo%26foo%3Dbar (signature (RSASHA1 key) (fromApplication app) (req0 { method = PUT })) T.assertEqual "test sign_request (RSA-SHA1) ignores default port (https,443)" ("AjwVGN2wkvDjb/bGDqMtAzwn9hhx3nCH2GIR+puXim4qMk1Qy7aJCDrDyBNPgzET/4lr3bwPSK0UaBO4iyp5e4Zv5BGp0VWkP7clQZaqR56/zKpcgvKav9Ge7tM02dR0XoODfSBk94ckyotTp1F4cmF4bEe1mHlsabWbJXQq29k=") -- msg:DELETE&https%3A%2F%2Ffoo.bar%2Ffoobar&bar%3Dfoo%26foo%3Dbar (signature (RSASHA1 key) (fromApplication app) (req1 { method = DELETE }))
1,683
ftest13 = T.TestCase $ do let modulus = 0x00ce3fe6af65b85d7744a287268f0aea4fd783005b6306f353e9e49a9583f7d4ebc7870a65fc30ccdd5ce7a84b8d5a9356f06ae3d00599e5c8bda3b543f4331ccf04fd931e108d75e4abea9c120f46fe735138c31344e4b74a1788edf161d9c2ac6f8cc993927fcab4ef956b7150278daed0d2d630413a5ad56658026a3bcb3ced expoent = 0x17e54d6bdae42e68081ab07fe628c496f58826fd6f8eb9986a4be321198618342d0cd746939e6fcde1dab123f7bf9bbc81e4507aa47b7d24f1dbcabf91c66e3ad490605bcc36a8568bce27dc9d1584dc3e443499f819dc0a9d2b0233f5ae6d8ab8435121c811ffc7a5491718479d246d52f27172e5903f66814431186ec607e1 numbytes = 128 key = R.PrivateKey numbytes modulus expoent 0 0 0 0 0 Just req0 = parseURL "http://foo.bar:80/foobar?foo=bar&bar=foo" Just req1 = parseURL "https://foo.bar:443/foobar?foo=bar&bar=foo" app = Application "<<dummy>>" "<<dummy>>" OOB T.assertEqual "test sign_request (RSA-SHA1) ignores default port (http,80)" ("wspZGQBp1Gv0guYxVYTVllAtasGa9AaSAGcraB15Chgv0MXs4lSt/PPY41WGdQzT3K3D8l2veBeJEqEka63vSJNnDyMPb38oTJrRyn1TvaZzXq4Oyp2y6lgmxL9x4xOrLLGBIMQ8T2gWL+eQJ7FeqTL83MdMqUulyJfxc9PeObA=") -- msg:PUT&http%3A%2F%2Ffoo.bar%2Ffoobar&bar%3Dfoo%26foo%3Dbar (signature (RSASHA1 key) (fromApplication app) (req0 { method = PUT })) T.assertEqual "test sign_request (RSA-SHA1) ignores default port (https,443)" ("AjwVGN2wkvDjb/bGDqMtAzwn9hhx3nCH2GIR+puXim4qMk1Qy7aJCDrDyBNPgzET/4lr3bwPSK0UaBO4iyp5e4Zv5BGp0VWkP7clQZaqR56/zKpcgvKav9Ge7tM02dR0XoODfSBk94ckyotTp1F4cmF4bEe1mHlsabWbJXQq29k=") -- msg:DELETE&https%3A%2F%2Ffoo.bar%2Ffoobar&bar%3Dfoo%26foo%3Dbar (signature (RSASHA1 key) (fromApplication app) (req1 { method = DELETE }))
1,683
ftest13 = T.TestCase $ do let modulus = 0x00ce3fe6af65b85d7744a287268f0aea4fd783005b6306f353e9e49a9583f7d4ebc7870a65fc30ccdd5ce7a84b8d5a9356f06ae3d00599e5c8bda3b543f4331ccf04fd931e108d75e4abea9c120f46fe735138c31344e4b74a1788edf161d9c2ac6f8cc993927fcab4ef956b7150278daed0d2d630413a5ad56658026a3bcb3ced expoent = 0x17e54d6bdae42e68081ab07fe628c496f58826fd6f8eb9986a4be321198618342d0cd746939e6fcde1dab123f7bf9bbc81e4507aa47b7d24f1dbcabf91c66e3ad490605bcc36a8568bce27dc9d1584dc3e443499f819dc0a9d2b0233f5ae6d8ab8435121c811ffc7a5491718479d246d52f27172e5903f66814431186ec607e1 numbytes = 128 key = R.PrivateKey numbytes modulus expoent 0 0 0 0 0 Just req0 = parseURL "http://foo.bar:80/foobar?foo=bar&bar=foo" Just req1 = parseURL "https://foo.bar:443/foobar?foo=bar&bar=foo" app = Application "<<dummy>>" "<<dummy>>" OOB T.assertEqual "test sign_request (RSA-SHA1) ignores default port (http,80)" ("wspZGQBp1Gv0guYxVYTVllAtasGa9AaSAGcraB15Chgv0MXs4lSt/PPY41WGdQzT3K3D8l2veBeJEqEka63vSJNnDyMPb38oTJrRyn1TvaZzXq4Oyp2y6lgmxL9x4xOrLLGBIMQ8T2gWL+eQJ7FeqTL83MdMqUulyJfxc9PeObA=") -- msg:PUT&http%3A%2F%2Ffoo.bar%2Ffoobar&bar%3Dfoo%26foo%3Dbar (signature (RSASHA1 key) (fromApplication app) (req0 { method = PUT })) T.assertEqual "test sign_request (RSA-SHA1) ignores default port (https,443)" ("AjwVGN2wkvDjb/bGDqMtAzwn9hhx3nCH2GIR+puXim4qMk1Qy7aJCDrDyBNPgzET/4lr3bwPSK0UaBO4iyp5e4Zv5BGp0VWkP7clQZaqR56/zKpcgvKav9Ge7tM02dR0XoODfSBk94ckyotTp1F4cmF4bEe1mHlsabWbJXQq29k=") -- msg:DELETE&https%3A%2F%2Ffoo.bar%2Ffoobar&bar%3Dfoo%26foo%3Dbar (signature (RSASHA1 key) (fromApplication app) (req1 { method = DELETE }))
1,683
false
false
1
14
169
193
96
97
null
null
DavidAlphaFox/ghc
utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
bsd-3-clause
renameCon :: ConDecl Name -> RnM (ConDecl DocName) renameCon decl@(ConDecl { con_names = lnames, con_qvars = ltyvars , con_cxt = lcontext, con_details = details , con_res = restype, con_doc = mbldoc }) = do lnames' <- mapM renameL lnames ltyvars' <- renameLTyVarBndrs ltyvars lcontext' <- renameLContext lcontext details' <- renameDetails details restype' <- renameResType restype mbldoc' <- mapM renameLDocHsSyn mbldoc return (decl { con_names = lnames', con_qvars = ltyvars', con_cxt = lcontext' , con_details = details', con_res = restype', con_doc = mbldoc' }) where renameDetails (RecCon (L l fields)) = do fields' <- mapM renameConDeclFieldField fields return (RecCon (L l fields')) renameDetails (PrefixCon ps) = return . PrefixCon =<< mapM renameLType ps renameDetails (InfixCon a b) = do a' <- renameLType a b' <- renameLType b return (InfixCon a' b') renameResType (ResTyH98) = return ResTyH98 renameResType (ResTyGADT l t) = return . ResTyGADT l =<< renameLType t
1,144
renameCon :: ConDecl Name -> RnM (ConDecl DocName) renameCon decl@(ConDecl { con_names = lnames, con_qvars = ltyvars , con_cxt = lcontext, con_details = details , con_res = restype, con_doc = mbldoc }) = do lnames' <- mapM renameL lnames ltyvars' <- renameLTyVarBndrs ltyvars lcontext' <- renameLContext lcontext details' <- renameDetails details restype' <- renameResType restype mbldoc' <- mapM renameLDocHsSyn mbldoc return (decl { con_names = lnames', con_qvars = ltyvars', con_cxt = lcontext' , con_details = details', con_res = restype', con_doc = mbldoc' }) where renameDetails (RecCon (L l fields)) = do fields' <- mapM renameConDeclFieldField fields return (RecCon (L l fields')) renameDetails (PrefixCon ps) = return . PrefixCon =<< mapM renameLType ps renameDetails (InfixCon a b) = do a' <- renameLType a b' <- renameLType b return (InfixCon a' b') renameResType (ResTyH98) = return ResTyH98 renameResType (ResTyGADT l t) = return . ResTyGADT l =<< renameLType t
1,144
renameCon decl@(ConDecl { con_names = lnames, con_qvars = ltyvars , con_cxt = lcontext, con_details = details , con_res = restype, con_doc = mbldoc }) = do lnames' <- mapM renameL lnames ltyvars' <- renameLTyVarBndrs ltyvars lcontext' <- renameLContext lcontext details' <- renameDetails details restype' <- renameResType restype mbldoc' <- mapM renameLDocHsSyn mbldoc return (decl { con_names = lnames', con_qvars = ltyvars', con_cxt = lcontext' , con_details = details', con_res = restype', con_doc = mbldoc' }) where renameDetails (RecCon (L l fields)) = do fields' <- mapM renameConDeclFieldField fields return (RecCon (L l fields')) renameDetails (PrefixCon ps) = return . PrefixCon =<< mapM renameLType ps renameDetails (InfixCon a b) = do a' <- renameLType a b' <- renameLType b return (InfixCon a' b') renameResType (ResTyH98) = return ResTyH98 renameResType (ResTyGADT l t) = return . ResTyGADT l =<< renameLType t
1,093
false
true
4
16
316
363
180
183
null
null
imuli/gitit
Network/Gitit/Export.hs
gpl-2.0
respondICML :: String -> Pandoc -> Handler respondICML = respondS "icml" "application/xml; charset=utf-8" "" writeICML defaultRespOptions
139
respondICML :: String -> Pandoc -> Handler respondICML = respondS "icml" "application/xml; charset=utf-8" "" writeICML defaultRespOptions
139
respondICML = respondS "icml" "application/xml; charset=utf-8" "" writeICML defaultRespOptions
96
false
true
0
6
17
32
15
17
null
null
brendanhay/gogol
gogol-books/gen/Network/Google/Resource/Books/PromoOffer/Dismiss.hs
mpl-2.0
-- | device serial podSerial :: Lens' PromoOfferDismiss (Maybe Text) podSerial = lens _podSerial (\ s a -> s{_podSerial = a})
127
podSerial :: Lens' PromoOfferDismiss (Maybe Text) podSerial = lens _podSerial (\ s a -> s{_podSerial = a})
108
podSerial = lens _podSerial (\ s a -> s{_podSerial = a})
58
true
true
0
9
22
48
25
23
null
null
triplepointfive/cereal
src/Data/Serialize/Builder.hs
bsd-3-clause
unsafeLiftIO :: (Buffer -> IO Buffer) -> Builder unsafeLiftIO f = Builder $ \ k buf -> S.inlinePerformIO $ do buf' <- f buf return (k buf')
149
unsafeLiftIO :: (Buffer -> IO Buffer) -> Builder unsafeLiftIO f = Builder $ \ k buf -> S.inlinePerformIO $ do buf' <- f buf return (k buf')
149
unsafeLiftIO f = Builder $ \ k buf -> S.inlinePerformIO $ do buf' <- f buf return (k buf')
100
false
true
0
12
36
67
32
35
null
null
meoblast001/lexical-analyser-generator
src/StartEndTable.hs
mit
lastRx rx@(RxClass _ _) = [rx]
30
lastRx rx@(RxClass _ _) = [rx]
30
lastRx rx@(RxClass _ _) = [rx]
30
false
false
0
8
5
23
12
11
null
null
michalkonecny/aern2
aern2-fun-plot/server/src/AERN2/RealFun/PlotService/App.hs
bsd-3-clause
app :: Functions -> IO Application app fns = serve withAssets <$> server fns
80
app :: Functions -> IO Application app fns = serve withAssets <$> server fns
80
app fns = serve withAssets <$> server fns
43
false
true
2
7
17
36
15
21
null
null
frantisekfarka/ghc-dsi
compiler/cmm/CmmSink.hs
bsd-3-clause
walk :: DynFlags -> [(LocalRegSet, CmmNode O O)] -- nodes of the block, annotated with -- the set of registers live *after* -- this node. -> Assignments -- The current list of -- assignments we are sinking. -- Earlier assignments may refer -- to later ones. -> ( Block CmmNode O O -- The new block , Assignments -- Assignments to sink further ) walk dflags nodes assigs = go nodes emptyBlock assigs where go [] block as = (block, as) go ((live,node):ns) block as | shouldDiscard node live = go ns block as -- discard dead assignment | Just a <- shouldSink dflags node2 = go ns block (a : as1) | otherwise = go ns block' as' where node1 = constantFoldNode dflags node (node2, as1) = tryToInline dflags live node1 as (dropped, as') = dropAssignmentsSimple dflags (\a -> conflicts dflags a node2) as1 block' = foldl blockSnoc block dropped `blockSnoc` node2 -- -- Heuristic to decide whether to pick up and sink an assignment -- Currently we pick up all assignments to local registers. It might -- be profitable to sink assignments to global regs too, but the -- liveness analysis doesn't track those (yet) so we can't. --
1,540
walk :: DynFlags -> [(LocalRegSet, CmmNode O O)] -- nodes of the block, annotated with -- the set of registers live *after* -- this node. -> Assignments -- The current list of -- assignments we are sinking. -- Earlier assignments may refer -- to later ones. -> ( Block CmmNode O O -- The new block , Assignments -- Assignments to sink further ) walk dflags nodes assigs = go nodes emptyBlock assigs where go [] block as = (block, as) go ((live,node):ns) block as | shouldDiscard node live = go ns block as -- discard dead assignment | Just a <- shouldSink dflags node2 = go ns block (a : as1) | otherwise = go ns block' as' where node1 = constantFoldNode dflags node (node2, as1) = tryToInline dflags live node1 as (dropped, as') = dropAssignmentsSimple dflags (\a -> conflicts dflags a node2) as1 block' = foldl blockSnoc block dropped `blockSnoc` node2 -- -- Heuristic to decide whether to pick up and sink an assignment -- Currently we pick up all assignments to local registers. It might -- be profitable to sink assignments to global regs too, but the -- liveness analysis doesn't track those (yet) so we can't. --
1,539
walk dflags nodes assigs = go nodes emptyBlock assigs where go [] block as = (block, as) go ((live,node):ns) block as | shouldDiscard node live = go ns block as -- discard dead assignment | Just a <- shouldSink dflags node2 = go ns block (a : as1) | otherwise = go ns block' as' where node1 = constantFoldNode dflags node (node2, as1) = tryToInline dflags live node1 as (dropped, as') = dropAssignmentsSimple dflags (\a -> conflicts dflags a node2) as1 block' = foldl blockSnoc block dropped `blockSnoc` node2 -- -- Heuristic to decide whether to pick up and sink an assignment -- Currently we pick up all assignments to local registers. It might -- be profitable to sink assignments to global regs too, but the -- liveness analysis doesn't track those (yet) so we can't. --
908
false
true
4
11
621
287
152
135
null
null
spacekitteh/smcghc
compiler/nativeGen/SPARC/Ppr.hs
bsd-3-clause
pprInstr (ORN b reg1 ri reg2) = pprRegRIReg (sLit "orn") b reg1 ri reg2
72
pprInstr (ORN b reg1 ri reg2) = pprRegRIReg (sLit "orn") b reg1 ri reg2
72
pprInstr (ORN b reg1 ri reg2) = pprRegRIReg (sLit "orn") b reg1 ri reg2
72
false
false
0
7
14
38
18
20
null
null
lzlarryli/advent_of_code_2016
day19/part2.hs
mit
party [x] = x
13
party [x] = x
13
party [x] = x
13
false
false
0
5
3
13
6
7
null
null
PhDP/Manticore
Akarui/Utils.hs
apache-2.0
-- | Builds a set of tuple from a map. mapToSet :: (Ord k, Ord v) => Map k v -> Set (k, v) mapToSet = Map.foldrWithKey (\k v acc -> Set.insert (k, v) acc) Set.empty
164
mapToSet :: (Ord k, Ord v) => Map k v -> Set (k, v) mapToSet = Map.foldrWithKey (\k v acc -> Set.insert (k, v) acc) Set.empty
125
mapToSet = Map.foldrWithKey (\k v acc -> Set.insert (k, v) acc) Set.empty
73
true
true
0
9
35
79
42
37
null
null
antalsz/hs-to-coq
src/lib/HsToCoq/ConvertHaskell/Declarations/DataType.hs
mit
addAdditionalConstructorScope ctor@(name, bs, Just resTy) = view (edits.additionalScopes.at (SPConstructor,name)) <&> \case Just scope -> (name, bs, Just $ resTy `InScope` scope) Nothing -> ctor --------------------------------------------------------------------------------
289
addAdditionalConstructorScope ctor@(name, bs, Just resTy) = view (edits.additionalScopes.at (SPConstructor,name)) <&> \case Just scope -> (name, bs, Just $ resTy `InScope` scope) Nothing -> ctor --------------------------------------------------------------------------------
289
addAdditionalConstructorScope ctor@(name, bs, Just resTy) = view (edits.additionalScopes.at (SPConstructor,name)) <&> \case Just scope -> (name, bs, Just $ resTy `InScope` scope) Nothing -> ctor --------------------------------------------------------------------------------
289
false
false
0
11
38
85
46
39
null
null
nushio3/Paraiso
attic/Optimization/DiffusionMain.hs
bsd-3-clause
buildInit :: B () buildInit = do -- create the current coordinate vector. coord <- sequenceA $ compose (\axis -> bind $ loadIndex (0::Int) axis) -- if the current coordinate equals one of the elements in r5mino, you are alive. alive <- bind $ foldl1 (||) [agree coord point | point <- r5mino ] -- create the initial cell state based on the judgement. cell <- bind $ select alive (10000::BuilderOf Rlm.TLocal Real) 0 -- store the initial states. store (mkName "pink") $ cell store (mkName "black") $ cell store (mkName "sum") $ reduce Reduce.Sum cell store (mkName "generation") $ (0::BuilderOf Rlm.TGlobal Int) where agree coord point = foldl1 (&&) $ compose (\i -> coord!i `eq` imm (point!i)) -- compose the machine.
769
buildInit :: B () buildInit = do -- create the current coordinate vector. coord <- sequenceA $ compose (\axis -> bind $ loadIndex (0::Int) axis) -- if the current coordinate equals one of the elements in r5mino, you are alive. alive <- bind $ foldl1 (||) [agree coord point | point <- r5mino ] -- create the initial cell state based on the judgement. cell <- bind $ select alive (10000::BuilderOf Rlm.TLocal Real) 0 -- store the initial states. store (mkName "pink") $ cell store (mkName "black") $ cell store (mkName "sum") $ reduce Reduce.Sum cell store (mkName "generation") $ (0::BuilderOf Rlm.TGlobal Int) where agree coord point = foldl1 (&&) $ compose (\i -> coord!i `eq` imm (point!i)) -- compose the machine.
769
buildInit = do -- create the current coordinate vector. coord <- sequenceA $ compose (\axis -> bind $ loadIndex (0::Int) axis) -- if the current coordinate equals one of the elements in r5mino, you are alive. alive <- bind $ foldl1 (||) [agree coord point | point <- r5mino ] -- create the initial cell state based on the judgement. cell <- bind $ select alive (10000::BuilderOf Rlm.TLocal Real) 0 -- store the initial states. store (mkName "pink") $ cell store (mkName "black") $ cell store (mkName "sum") $ reduce Reduce.Sum cell store (mkName "generation") $ (0::BuilderOf Rlm.TGlobal Int) where agree coord point = foldl1 (&&) $ compose (\i -> coord!i `eq` imm (point!i)) -- compose the machine.
751
false
true
0
14
173
260
130
130
null
null
brenov/set
interpreter/Types.hs
mit
cast (Real _ _) (Nat i p) = let x = integerToFloat(i) in Real x p
66
cast (Real _ _) (Nat i p) = let x = integerToFloat(i) in Real x p
66
cast (Real _ _) (Nat i p) = let x = integerToFloat(i) in Real x p
66
false
false
0
10
16
49
23
26
null
null
redfish64/IrcScanner
src/IrcScanner/Util.hs
bsd-3-clause
sliceSeq :: Int -> Int -> S.Seq x -> S.Seq x sliceSeq from cnt xs = S.take cnt (S.drop from xs)
95
sliceSeq :: Int -> Int -> S.Seq x -> S.Seq x sliceSeq from cnt xs = S.take cnt (S.drop from xs)
95
sliceSeq from cnt xs = S.take cnt (S.drop from xs)
50
false
true
0
9
20
57
27
30
null
null
thalerjonathan/phd
public/towards/SugarScape/experimental/concurrent/src/SugarScape/Core/Utils.hs
gpl-3.0
notM :: Monad m => m Bool -> m Bool notM = liftM not
62
notM :: Monad m => m Bool -> m Bool notM = liftM not
62
notM = liftM not
16
false
true
0
8
23
36
15
21
null
null
teleshoes/taffybar
example/xmonad.hs
bsd-3-clause
main = xmonad $ -- docks allows xmonad to handle taffybar docks $ -- ewmh allows taffybar access to the state of xmonad/x11 ewmh $ -- pagerHints supplies additional state that is not supplied by ewmh pagerHints defaultConfig
273
main = xmonad $ -- docks allows xmonad to handle taffybar docks $ -- ewmh allows taffybar access to the state of xmonad/x11 ewmh $ -- pagerHints supplies additional state that is not supplied by ewmh pagerHints defaultConfig
273
main = xmonad $ -- docks allows xmonad to handle taffybar docks $ -- ewmh allows taffybar access to the state of xmonad/x11 ewmh $ -- pagerHints supplies additional state that is not supplied by ewmh pagerHints defaultConfig
273
false
false
0
7
86
24
13
11
null
null
binarin/learnopengl
src/GLWrap/LowLevel.hs
bsd-3-clause
serializeClearBufferMask = foldr (.|.) 0 . map serializeClearBufferBit
70
serializeClearBufferMask = foldr (.|.) 0 . map serializeClearBufferBit
70
serializeClearBufferMask = foldr (.|.) 0 . map serializeClearBufferBit
70
false
false
1
6
7
24
10
14
null
null
bonnefoa/Shaker
src/Shaker/GhcInterface.hs
isc
mergeMdatas :: [ModuleData] -> [ModuleData] mergeMdatas lstMdatas = map (\mdata -> filter (==mdata) >>> mconcat $ lstMdatas) uniqueMdata where uniqueMdata = nub lstMdatas -- | Collect module name and tests name for the given module
234
mergeMdatas :: [ModuleData] -> [ModuleData] mergeMdatas lstMdatas = map (\mdata -> filter (==mdata) >>> mconcat $ lstMdatas) uniqueMdata where uniqueMdata = nub lstMdatas -- | Collect module name and tests name for the given module
234
mergeMdatas lstMdatas = map (\mdata -> filter (==mdata) >>> mconcat $ lstMdatas) uniqueMdata where uniqueMdata = nub lstMdatas -- | Collect module name and tests name for the given module
190
false
true
0
11
37
64
34
30
null
null
acamino/state-codes
src/Data/StateCodes/ISO31662US.hs
mit
toText GA = "GA"
16
toText GA = "GA"
16
toText GA = "GA"
16
false
false
0
5
3
9
4
5
null
null
gcampax/ghc
compiler/prelude/TysPrim.hs
bsd-3-clause
voidPrimTy :: Type voidPrimTy = TyConApp voidPrimTyCon []
57
voidPrimTy :: Type voidPrimTy = TyConApp voidPrimTyCon []
57
voidPrimTy = TyConApp voidPrimTyCon []
38
false
true
0
6
7
24
10
14
null
null
dan-t/cabal-lenses
lib/CabalLenses/Package.hs
bsd-3-clause
packageName :: Lens' Dependency PackageName packageName = lens getPkgName setPkgName where getPkgName (Dependency pkgName _ _) = pkgName setPkgName (Dependency _ range libNames) newPkgName = Dependency newPkgName range libNames
258
packageName :: Lens' Dependency PackageName packageName = lens getPkgName setPkgName where getPkgName (Dependency pkgName _ _) = pkgName setPkgName (Dependency _ range libNames) newPkgName = Dependency newPkgName range libNames
258
packageName = lens getPkgName setPkgName where getPkgName (Dependency pkgName _ _) = pkgName setPkgName (Dependency _ range libNames) newPkgName = Dependency newPkgName range libNames
214
false
true
0
9
59
68
33
35
null
null
mzizzi/aenea
server/windows/aenea-windows-server/src/Main.hs
lgpl-3.0
safeLast xs = Just $ last xs
28
safeLast xs = Just $ last xs
28
safeLast xs = Just $ last xs
28
false
false
0
6
6
16
7
9
null
null
frenetic-lang/nettle-openflow
src/Nettle/OpenFlow/MessagesBinary.hs
bsd-3-clause
getActionForType VendorActionType action_len = do vendorid <- getWord32be bytes <- getWord8s (fromIntegral action_len - 2 - 2 - 4) return (VendorAction vendorid bytes) #endif
188
getActionForType VendorActionType action_len = do vendorid <- getWord32be bytes <- getWord8s (fromIntegral action_len - 2 - 2 - 4) return (VendorAction vendorid bytes) #endif
188
getActionForType VendorActionType action_len = do vendorid <- getWord32be bytes <- getWord8s (fromIntegral action_len - 2 - 2 - 4) return (VendorAction vendorid bytes) #endif
188
false
false
0
13
37
61
28
33
null
null
axhav/AFPLAB3
World.hs
bsd-3-clause
-- | Function to convert a color of type Double to Word8 convertColtoFCol :: Color -> FinalColor convertColtoFCol (r,g,b) = (colRound r, colRound g, colRound b)
161
convertColtoFCol :: Color -> FinalColor convertColtoFCol (r,g,b) = (colRound r, colRound g, colRound b)
103
convertColtoFCol (r,g,b) = (colRound r, colRound g, colRound b)
63
true
true
0
6
26
46
25
21
null
null
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
mpl-2.0
-- | CLDR country code (e.g. \"US\"). raaCountry :: Lens' ReturnAddressAddress (Maybe Text) raaCountry = lens _raaCountry (\ s a -> s{_raaCountry = a})
153
raaCountry :: Lens' ReturnAddressAddress (Maybe Text) raaCountry = lens _raaCountry (\ s a -> s{_raaCountry = a})
115
raaCountry = lens _raaCountry (\ s a -> s{_raaCountry = a})
61
true
true
0
9
25
48
25
23
null
null
bitemyapp/ghc
compiler/typecheck/TcArrows.hs
bsd-3-clause
{- Note [Arrow overivew] ~~~~~~~~~~~~~~~~~~~~~ Here's a summary of arrows and how they typecheck. First, here's a cut-down syntax: expr ::= .... | proc pat cmd cmd ::= cmd exp -- Arrow application | \pat -> cmd -- Arrow abstraction | (| exp cmd1 ... cmdn |) -- Arrow form, n>=0 | ... -- If, case in the usual way cmd_type ::= carg_type --> type carg_type ::= () | (type, carg_type) Note that * The 'exp' in an arrow form can mention only "arrow-local" variables * An "arrow-local" variable is bound by an enclosing cmd binding form (eg arrow abstraction) * A cmd_type is here written with a funny arrow "-->", The bit on the left is a carg_type (command argument type) which itself is a nested tuple, finishing with () * The arrow-tail operator (e1 -< e2) means (| e1 <<< arr snd |) e2 ************************************************************************ * * Proc * * ************************************************************************ -} tcProc :: InPat Name -> LHsCmdTop Name -- proc pat -> expr -> TcRhoType -- Expected type of whole proc expression -> TcM (OutPat TcId, LHsCmdTop TcId, TcCoercion) tcProc pat cmd exp_ty = newArrowScope $ do { (co, (exp_ty1, res_ty)) <- matchExpectedAppTy exp_ty ; (co1, (arr_ty, arg_ty)) <- matchExpectedAppTy exp_ty1 ; let cmd_env = CmdEnv { cmd_arr = arr_ty } ; (pat', cmd') <- tcPat ProcExpr pat arg_ty $ tcCmdTop cmd_env cmd (unitTy, res_ty) ; let res_co = mkTcTransCo co (mkTcAppCo co1 (mkTcNomReflCo res_ty)) ; return (pat', cmd', res_co) }
1,899
tcProc :: InPat Name -> LHsCmdTop Name -- proc pat -> expr -> TcRhoType -- Expected type of whole proc expression -> TcM (OutPat TcId, LHsCmdTop TcId, TcCoercion) tcProc pat cmd exp_ty = newArrowScope $ do { (co, (exp_ty1, res_ty)) <- matchExpectedAppTy exp_ty ; (co1, (arr_ty, arg_ty)) <- matchExpectedAppTy exp_ty1 ; let cmd_env = CmdEnv { cmd_arr = arr_ty } ; (pat', cmd') <- tcPat ProcExpr pat arg_ty $ tcCmdTop cmd_env cmd (unitTy, res_ty) ; let res_co = mkTcTransCo co (mkTcAppCo co1 (mkTcNomReflCo res_ty)) ; return (pat', cmd', res_co) }
669
tcProc pat cmd exp_ty = newArrowScope $ do { (co, (exp_ty1, res_ty)) <- matchExpectedAppTy exp_ty ; (co1, (arr_ty, arg_ty)) <- matchExpectedAppTy exp_ty1 ; let cmd_env = CmdEnv { cmd_arr = arr_ty } ; (pat', cmd') <- tcPat ProcExpr pat arg_ty $ tcCmdTop cmd_env cmd (unitTy, res_ty) ; let res_co = mkTcTransCo co (mkTcAppCo co1 (mkTcNomReflCo res_ty)) ; return (pat', cmd', res_co) }
455
true
true
2
15
649
215
112
103
null
null
donatello/haskakafka
src/Haskakafka/InternalSetup.hs
mit
dumpKafkaConf :: KafkaConf -> IO (Map String String) dumpKafkaConf (KafkaConf kptr) = do parseDump (\sizeptr -> rdKafkaConfDump kptr sizeptr)
145
dumpKafkaConf :: KafkaConf -> IO (Map String String) dumpKafkaConf (KafkaConf kptr) = do parseDump (\sizeptr -> rdKafkaConfDump kptr sizeptr)
145
dumpKafkaConf (KafkaConf kptr) = do parseDump (\sizeptr -> rdKafkaConfDump kptr sizeptr)
92
false
true
0
10
22
58
27
31
null
null