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
bergmark/purescript
src/Language/PureScript/Pretty/JS.hs
mit
literals :: Pattern PrinterState JS String literals = mkPattern' match where match :: JS -> StateT PrinterState Maybe String match (JSNumericLiteral n) = return $ either show show n match (JSStringLiteral s) = return $ string s match (JSBooleanLiteral True) = return "true" match (JSBooleanLiteral False) = r...
2,864
literals :: Pattern PrinterState JS String literals = mkPattern' match where match :: JS -> StateT PrinterState Maybe String match (JSNumericLiteral n) = return $ either show show n match (JSStringLiteral s) = return $ string s match (JSBooleanLiteral True) = return "true" match (JSBooleanLiteral False) = r...
2,864
literals = mkPattern' match where match :: JS -> StateT PrinterState Maybe String match (JSNumericLiteral n) = return $ either show show n match (JSStringLiteral s) = return $ string s match (JSBooleanLiteral True) = return "true" match (JSBooleanLiteral False) = return "false" match (JSArrayLiteral xs) =...
2,821
false
true
1
18
802
1,053
499
554
null
null
jmikkola/Athena
src/Interpreter.hs
mit
interpretBlockScoped scope (s:stmts) = do result <- interpretStmt scope s case result of FellThrough -> interpretBlockScoped scope stmts Returned _ -> return result
175
interpretBlockScoped scope (s:stmts) = do result <- interpretStmt scope s case result of FellThrough -> interpretBlockScoped scope stmts Returned _ -> return result
175
interpretBlockScoped scope (s:stmts) = do result <- interpretStmt scope s case result of FellThrough -> interpretBlockScoped scope stmts Returned _ -> return result
175
false
false
0
10
33
60
27
33
null
null
jaiyalas/sdl2-cairo-image
src/SDL/Cairo/Image/Load.hs
mit
- defImageRGBA8 :: Image PixelRGBA8 defImageRGBA8 = Image { imageWidth = 5 , imageHeight = 5 , imageData = VecS.fromList [ 255,0,0,255, 0,0,0,255, 0,0,0,255, 0,0,0,255, 255,0,0,255 , 0,0,0,255, 255,0,0,255, 0,0,0,255, 255,0,0,255, 0,0,0,255 , 0,0,0,255, 0,0,0,255, 255,0,0,255...
502
defImageRGBA8 :: Image PixelRGBA8 defImageRGBA8 = Image { imageWidth = 5 , imageHeight = 5 , imageData = VecS.fromList [ 255,0,0,255, 0,0,0,255, 0,0,0,255, 0,0,0,255, 255,0,0,255 , 0,0,0,255, 255,0,0,255, 0,0,0,255, 255,0,0,255, 0,0,0,255 , 0,0,0,255, 0,0,0,255, 255,0,0,255, ...
499
defImageRGBA8 = Image { imageWidth = 5 , imageHeight = 5 , imageData = VecS.fromList [ 255,0,0,255, 0,0,0,255, 0,0,0,255, 0,0,0,255, 255,0,0,255 , 0,0,0,255, 255,0,0,255, 0,0,0,255, 255,0,0,255, 0,0,0,255 , 0,0,0,255, 0,0,0,255, 255,0,0,255, 0,0,0,255, 0,0,0,255 , 0,0...
465
true
true
0
8
131
346
224
122
null
null
paulbarbu/haskell-ground
todo.hs
apache-2.0
remove :: [String] -> IO () remove [file] = putStrLn "Please provide a task number to remove from the list!"
108
remove :: [String] -> IO () remove [file] = putStrLn "Please provide a task number to remove from the list!"
108
remove [file] = putStrLn "Please provide a task number to remove from the list!"
80
false
true
0
7
19
32
16
16
null
null
noughtmare/yi
yi-language/src/Yi/Utils.hs
gpl-2.0
makeLensesWithSuffix :: String -> THS.Name -> THS.Q [THS.Dec] makeLensesWithSuffix s = makeLensesWith (lensRules & lensField .~ (\_ _ n -> addSuffix n s))
156
makeLensesWithSuffix :: String -> THS.Name -> THS.Q [THS.Dec] makeLensesWithSuffix s = makeLensesWith (lensRules & lensField .~ (\_ _ n -> addSuffix n s))
156
makeLensesWithSuffix s = makeLensesWith (lensRules & lensField .~ (\_ _ n -> addSuffix n s))
94
false
true
0
10
24
70
34
36
null
null
aemoncannon/woof
compiler/woof_to_scheme.hs
mit
emitScheme func@(ASTFuncCall funcList) = do putStr $ "(woof-call-function \"" ++ (functionName func) ++ "\" (list " emitArgList funcList putStr "))" where emitArgList ((key,val):rest) = do emitScheme val ...
465
emitScheme func@(ASTFuncCall funcList) = do putStr $ "(woof-call-function \"" ++ (functionName func) ++ "\" (list " emitArgList funcList putStr "))" where emitArgList ((key,val):rest) = do emitScheme val ...
465
emitScheme func@(ASTFuncCall funcList) = do putStr $ "(woof-call-function \"" ++ (functionName func) ++ "\" (list " emitArgList funcList putStr "))" where emitArgList ((key,val):rest) = do emitScheme val ...
465
false
false
0
10
234
107
48
59
null
null
comraq/scheme-interpreter
src/PrimFunction.hs
bsd-3-clause
isLVector :: LFunction isLVector [LVector _] = return $ LBool True
66
isLVector :: LFunction isLVector [LVector _] = return $ LBool True
66
isLVector [LVector _] = return $ LBool True
43
false
true
0
7
10
27
13
14
null
null
phadej/scientific
test/test.hs
bsd-3-clause
floorDefault :: Scientific -> Integer floorDefault x = if r < 0 then n - 1 else n where (n,r) = properFraction x
129
floorDefault :: Scientific -> Integer floorDefault x = if r < 0 then n - 1 else n where (n,r) = properFraction x
129
floorDefault x = if r < 0 then n - 1 else n where (n,r) = properFraction x
91
false
true
0
7
39
51
27
24
null
null
mfine/ghc
compiler/main/DriverPhases.hs
bsd-3-clause
isStopLn :: Phase -> Bool isStopLn StopLn = True
48
isStopLn :: Phase -> Bool isStopLn StopLn = True
48
isStopLn StopLn = True
22
false
true
0
5
8
18
9
9
null
null
ehlemur/HLearn
examples/old/future-examples/tic-tac-toe.hs
bsd-3-clause
winner :: TTT -> Maybe Player winner (TTT board) = if didOwin then Just O else if didXwin then Just X else Nothing where didXwin = or $ map (all (==Taken X)) posL didOwin = or $ map (all (==Taken O)) posL posL = map (map (board A.!)) positionL position...
1,116
winner :: TTT -> Maybe Player winner (TTT board) = if didOwin then Just O else if didXwin then Just X else Nothing where didXwin = or $ map (all (==Taken X)) posL didOwin = or $ map (all (==Taken O)) posL posL = map (map (board A.!)) positionL position...
1,116
winner (TTT board) = if didOwin then Just O else if didXwin then Just X else Nothing where didXwin = or $ map (all (==Taken X)) posL didOwin = or $ map (all (==Taken O)) posL posL = map (map (board A.!)) positionL positionL = [ [(i,j) | i<-[0,1,2]] |...
1,086
false
true
3
14
294
319
187
132
null
null
sol/pandoc
src/Text/Pandoc/Writers/LaTeX.hs
gpl-2.0
blockToLaTeX (CodeBlock (_,classes,keyvalAttr) str) = do opts <- gets stOptions case () of _ | writerLiterateHaskell opts && "haskell" `elem` classes && "literate" `elem` classes -> lhsCodeBlock | writerListings opts -> listingsCodeBlock | ...
3,224
blockToLaTeX (CodeBlock (_,classes,keyvalAttr) str) = do opts <- gets stOptions case () of _ | writerLiterateHaskell opts && "haskell" `elem` classes && "literate" `elem` classes -> lhsCodeBlock | writerListings opts -> listingsCodeBlock | ...
3,224
blockToLaTeX (CodeBlock (_,classes,keyvalAttr) str) = do opts <- gets stOptions case () of _ | writerLiterateHaskell opts && "haskell" `elem` classes && "literate" `elem` classes -> lhsCodeBlock | writerListings opts -> listingsCodeBlock | ...
3,224
false
false
4
17
1,525
795
428
367
null
null
hjwylde/werewolf
app/Game/Werewolf/Command/Status.hs
bsd-3-clause
pingWerewolves :: (MonadState Game m, MonadWriter [Message] m) => m () pingWerewolves = do pendingVoterNames <- toListOf (pendingVoters . name) <$> get tell . (:[]) . pingWerewolvesMessage =<< get tell $ map pingPlayerMessage pendingVoterNames
256
pingWerewolves :: (MonadState Game m, MonadWriter [Message] m) => m () pingWerewolves = do pendingVoterNames <- toListOf (pendingVoters . name) <$> get tell . (:[]) . pingWerewolvesMessage =<< get tell $ map pingPlayerMessage pendingVoterNames
256
pingWerewolves = do pendingVoterNames <- toListOf (pendingVoters . name) <$> get tell . (:[]) . pingWerewolvesMessage =<< get tell $ map pingPlayerMessage pendingVoterNames
185
false
true
0
11
46
92
46
46
null
null
fedelebron/AVL
Data/Tree/AVL/Static/Internal.hs
bsd-3-clause
{- LLC -} insertUnbalancedAt (Leftie b g p) (LLC a d ctx) = zipUp (+1) z where z = Zipper (Balanced b g (Balanced a p d)) ctx
131
insertUnbalancedAt (Leftie b g p) (LLC a d ctx) = zipUp (+1) z where z = Zipper (Balanced b g (Balanced a p d)) ctx
121
insertUnbalancedAt (Leftie b g p) (LLC a d ctx) = zipUp (+1) z where z = Zipper (Balanced b g (Balanced a p d)) ctx
121
true
false
1
9
33
78
37
41
null
null
palf/haskellSDL2Examples
examples/lesson14/src/Lesson14.hs
gpl-2.0
centerWithin :: (Fractional a) => SDL.Rectangle a -> SDL.Rectangle a -> SDL.Rectangle a centerWithin (SDL.Rectangle _ iz) (SDL.Rectangle (SDL.P op) oz) = SDL.Rectangle p iz where p = SDL.P $ op + (oz - iz) / 2
218
centerWithin :: (Fractional a) => SDL.Rectangle a -> SDL.Rectangle a -> SDL.Rectangle a centerWithin (SDL.Rectangle _ iz) (SDL.Rectangle (SDL.P op) oz) = SDL.Rectangle p iz where p = SDL.P $ op + (oz - iz) / 2
218
centerWithin (SDL.Rectangle _ iz) (SDL.Rectangle (SDL.P op) oz) = SDL.Rectangle p iz where p = SDL.P $ op + (oz - iz) / 2
130
false
true
0
10
45
112
55
57
null
null
mkfifo/lambda_calculus
impl/arith/haskell/main.hs
mit
tokenizer_inner "" ssf osf = tokenizer_inner "" "" ((tokenize (reverse ssf)):osf)
113
tokenizer_inner "" ssf osf = tokenizer_inner "" "" ((tokenize (reverse ssf)):osf)
113
tokenizer_inner "" ssf osf = tokenizer_inner "" "" ((tokenize (reverse ssf)):osf)
113
false
false
0
11
42
39
19
20
null
null
ostapneko/sansible
src/AnsibleModules/Service.hs
mit
simpleService :: T.Text -> State -> CompiledModuleCall simpleService n s = compile $ defaultService n s
103
simpleService :: T.Text -> State -> CompiledModuleCall simpleService n s = compile $ defaultService n s
103
simpleService n s = compile $ defaultService n s
48
false
true
0
6
15
35
17
18
null
null
jacekszymanski/wxHaskell
wx/src/Graphics/UI/WX/Controls.hs
lgpl-2.1
-- | Create a minimially sized push button. -- -- -- * Instances: 'Commanding' -- 'Textual', 'Literate', 'Dimensions', 'Colored', 'Visible', 'Child', -- 'Able', 'Tipped', 'Identity', 'Styled', 'Reactive', 'Paint'. -- smallButton :: Window a -> [Prop (Button ())] -> IO (Button ()) smallButton parent props ...
357
smallButton :: Window a -> [Prop (Button ())] -> IO (Button ()) smallButton parent props = buttonEx parent wxBU_EXACTFIT props
128
smallButton parent props = buttonEx parent wxBU_EXACTFIT props
64
true
true
0
11
62
65
34
31
null
null
gibiansky/hlint
src/Hint/Match.hs
bsd-3-clause
fmapAn = fmap (const an)
24
fmapAn = fmap (const an)
24
fmapAn = fmap (const an)
24
false
false
1
7
4
19
7
12
null
null
aconbere/redis
Redis/Commands/SortedSet.hs
mit
range key start end = "ZRANGE"
30
range key start end = "ZRANGE"
30
range key start end = "ZRANGE"
30
false
false
0
5
5
14
6
8
null
null
menelaos/twitch
src/Twitch/Main.hs
mit
dropDoubleQuotes :: String -> String dropDoubleQuotes [] = []
61
dropDoubleQuotes :: String -> String dropDoubleQuotes [] = []
61
dropDoubleQuotes [] = []
24
false
true
0
6
8
22
11
11
null
null
begriffs/optparse-applicative
tests/Examples/Formatting.hs
bsd-3-clause
opts :: Parser Int opts = option auto $ mconcat [ long "test" , short 't' , value 0 , metavar "FOO_BAR_BAZ_LONG_METAVARIABLE" , help "This is an options with a very very long description. Hopefully, this will be nicely formatted by the help text generator." ]
270
opts :: Parser Int opts = option auto $ mconcat [ long "test" , short 't' , value 0 , metavar "FOO_BAR_BAZ_LONG_METAVARIABLE" , help "This is an options with a very very long description. Hopefully, this will be nicely formatted by the help text generator." ]
270
opts = option auto $ mconcat [ long "test" , short 't' , value 0 , metavar "FOO_BAR_BAZ_LONG_METAVARIABLE" , help "This is an options with a very very long description. Hopefully, this will be nicely formatted by the help text generator." ]
251
false
true
2
7
56
61
27
34
null
null
abailly/hs-word2vec
src/PCA.hs
bsd-3-clause
pcaNipals n dataSet = let (pc1, _ , residual) = firstPC dataSet in pc1 : pcaNipals (n - 1) residual
122
pcaNipals n dataSet = let (pc1, _ , residual) = firstPC dataSet in pc1 : pcaNipals (n - 1) residual
122
pcaNipals n dataSet = let (pc1, _ , residual) = firstPC dataSet in pc1 : pcaNipals (n - 1) residual
122
false
false
0
10
42
51
25
26
null
null
spaceships/circuit-synthesis
src/Circuit/Builder.hs
mit
-- swap elements based on a bit in the circuit swap :: (Gate g, Monad m) => Ref -> [Ref] -> [Ref] -> BuilderT g m [[Ref]] swap b xs ys | length xs /= length ys = error "[swap] unequal length inputs!" | otherwise = do not_b <- circNot b let n = length xs sel = replicate n b not_sel = replicate ...
558
swap :: (Gate g, Monad m) => Ref -> [Ref] -> [Ref] -> BuilderT g m [[Ref]] swap b xs ys | length xs /= length ys = error "[swap] unequal length inputs!" | otherwise = do not_b <- circNot b let n = length xs sel = replicate n b not_sel = replicate n not_b w0 <- zipWithM circMul not_sel xs ...
511
swap b xs ys | length xs /= length ys = error "[swap] unequal length inputs!" | otherwise = do not_b <- circNot b let n = length xs sel = replicate n b not_sel = replicate n not_b w0 <- zipWithM circMul not_sel xs w1 <- zipWithM circMul sel ys w2 <- zipWithM circAdd w0 w1 z0 <...
436
true
true
1
11
159
230
107
123
null
null
OpenXT/manager
xenmgr/XenMgr/Config.hs
gpl-2.0
appSetPlatformCryptoKeyDirs :: String -> Rpc () appSetPlatformCryptoKeyDirs paths = dbWrite "/xenmgr/platform-crypto-key-dirs" paths
132
appSetPlatformCryptoKeyDirs :: String -> Rpc () appSetPlatformCryptoKeyDirs paths = dbWrite "/xenmgr/platform-crypto-key-dirs" paths
132
appSetPlatformCryptoKeyDirs paths = dbWrite "/xenmgr/platform-crypto-key-dirs" paths
84
false
true
0
7
11
28
13
15
null
null
SimSaladin/hajong
hajong-server/src/Mahjong/Hand/Mentsu.hs
mit
-- Construct toMentsu :: MentsuKind -> Tile -> [Tile] -> Mentsu toMentsu mk t ts = Mentsu mk (sortOn TileEq $ t:ts) Nothing
124
toMentsu :: MentsuKind -> Tile -> [Tile] -> Mentsu toMentsu mk t ts = Mentsu mk (sortOn TileEq $ t:ts) Nothing
110
toMentsu mk t ts = Mentsu mk (sortOn TileEq $ t:ts) Nothing
59
true
true
0
9
23
55
28
27
null
null
spl/emgm
src/Generics/EMGM/Functions/Crush.hs
bsd-3-clause
-- | Compute the disjunction of all elements in a container. This is a -- generalization of the 'Prelude' function of the same name. or :: (FRep (Crush Bool) f) => f Bool -> Bool or = crushr (||) False
202
or :: (FRep (Crush Bool) f) => f Bool -> Bool or = crushr (||) False
68
or = crushr (||) False
22
true
true
0
8
40
44
24
20
null
null
gbaz/cabal
cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/Solver.hs
bsd-3-clause
mkTestExts :: [Extension] -> ExampleDb -> String -> [String] -> Maybe [(String, Int)] -> SolverTest mkTestExts exts = mkTestExtLangPC (Just exts) Nothing []
211
mkTestExts :: [Extension] -> ExampleDb -> String -> [String] -> Maybe [(String, Int)] -> SolverTest mkTestExts exts = mkTestExtLangPC (Just exts) Nothing []
211
mkTestExts exts = mkTestExtLangPC (Just exts) Nothing []
56
false
true
0
12
77
67
35
32
null
null
Fuuzetsu/yi-monokai
src/Yi/Style/Monokai.hs
bsd-3-clause
-- | Hex value: 0xFD5FF1 monokaiPurpleLight :: Color monokaiPurpleLight = rgb 0xFD5FF1
86
monokaiPurpleLight :: Color monokaiPurpleLight = rgb 0xFD5FF1
61
monokaiPurpleLight = rgb 0xFD5FF1
33
true
true
0
6
11
21
9
12
null
null
pcapriotti/pipes-extra
Control/Pipe/Binary.hs
bsd-3-clause
-- | Read data from an open handle. handleReader :: MonadIO m => Handle -> Pipe () B.ByteString m () handleReader h = go where go = do eof <- lift . liftIO $ hIsEOF h unless eof $ do chunk <- lift . liftIO $ B.hGetSome h 4096 yield chunk go -- | Write data to a file. -- -- The...
376
handleReader :: MonadIO m => Handle -> Pipe () B.ByteString m () handleReader h = go where go = do eof <- lift . liftIO $ hIsEOF h unless eof $ do chunk <- lift . liftIO $ B.hGetSome h 4096 yield chunk go -- | Write data to a file. -- -- The file is only opened if some data ar...
340
handleReader h = go where go = do eof <- lift . liftIO $ hIsEOF h unless eof $ do chunk <- lift . liftIO $ B.hGetSome h 4096 yield chunk go -- | Write data to a file. -- -- The file is only opened if some data arrives into the pipe.
275
true
true
0
13
115
111
52
59
null
null
brendanhay/gogol
gogol-billing/gen/Network/Google/Billing/Types/Product.hs
mpl-2.0
-- | An optional human readable summary of the pricing information, has a -- maximum length of 256 characters. piSummary :: Lens' PricingInfo (Maybe Text) piSummary = lens _piSummary (\ s a -> s{_piSummary = a})
213
piSummary :: Lens' PricingInfo (Maybe Text) piSummary = lens _piSummary (\ s a -> s{_piSummary = a})
102
piSummary = lens _piSummary (\ s a -> s{_piSummary = a})
58
true
true
2
9
37
56
26
30
null
null
uuhan/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
doOp v (LMinus (ATInt (ITFixed ty))) [x, y] = bitOp v "Minus" ty [x, y]
71
doOp v (LMinus (ATInt (ITFixed ty))) [x, y] = bitOp v "Minus" ty [x, y]
71
doOp v (LMinus (ATInt (ITFixed ty))) [x, y] = bitOp v "Minus" ty [x, y]
71
false
false
1
11
14
55
27
28
null
null
vTurbine/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
orderingTyConKey = mkPreludeTyConUnique 30
65
orderingTyConKey = mkPreludeTyConUnique 30
65
orderingTyConKey = mkPreludeTyConUnique 30
65
false
false
0
5
26
9
4
5
null
null
abailly/yate
src/Yate/Projects.hs
bsd-3-clause
-- | Compute a mapping from source template files to instantiated template files mapFiles :: FilePath -- ^Template source directory -> ProjectDescription -- ^Project variables -> IO (FilePath -> FilePath -> FilePath) mapFiles source project = do let mappings = source </> ".mapping" instan...
418
mapFiles :: FilePath -- ^Template source directory -> ProjectDescription -- ^Project variables -> IO (FilePath -> FilePath -> FilePath) mapFiles source project = do let mappings = source </> ".mapping" instantiated <- readFile mappings >>= return . doTemplate project return $ makeFileMa...
337
mapFiles source project = do let mappings = source </> ".mapping" instantiated <- readFile mappings >>= return . doTemplate project return $ makeFileMapper instantiated
175
true
true
0
11
88
90
42
48
null
null
pjrt/Dot-Linker
test/Test.hs
bsd-3-clause
commentedLineTest :: TestTree commentedLineTest = testCase "should not parse a commented line" $ let x = parseOnly fileMapParser $ "vimrc: /root/har/.vimrc, /root/har/.config/nvim/init.vim\n" <> "-- ctags: /root/har/.ctags\n" <> "zshrc: /root/har/.zshrc\n" ex...
530
commentedLineTest :: TestTree commentedLineTest = testCase "should not parse a commented line" $ let x = parseOnly fileMapParser $ "vimrc: /root/har/.vimrc, /root/har/.config/nvim/init.vim\n" <> "-- ctags: /root/har/.ctags\n" <> "zshrc: /root/har/.zshrc\n" ex...
530
commentedLineTest = testCase "should not parse a commented line" $ let x = parseOnly fileMapParser $ "vimrc: /root/har/.vimrc, /root/har/.config/nvim/init.vim\n" <> "-- ctags: /root/har/.ctags\n" <> "zshrc: /root/har/.zshrc\n" expected = Right ...
500
false
true
0
13
173
81
41
40
null
null
rgleichman/glance
app/SimplifySyntax.hs
gpl-3.0
simpDeclToHsDecl :: Show a => SimpDecl a -> Exts.Decl a simpDeclToHsDecl decl = case decl of SdPatBind l pat e -> Exts.PatBind l (simpPatToHsPat pat) (simpExpToRhs l e) Nothing SdTypeSig l names typeForNames -> Exts.TypeSig l names typeForNames SdCatchAll d -> d
272
simpDeclToHsDecl :: Show a => SimpDecl a -> Exts.Decl a simpDeclToHsDecl decl = case decl of SdPatBind l pat e -> Exts.PatBind l (simpPatToHsPat pat) (simpExpToRhs l e) Nothing SdTypeSig l names typeForNames -> Exts.TypeSig l names typeForNames SdCatchAll d -> d
272
simpDeclToHsDecl decl = case decl of SdPatBind l pat e -> Exts.PatBind l (simpPatToHsPat pat) (simpExpToRhs l e) Nothing SdTypeSig l names typeForNames -> Exts.TypeSig l names typeForNames SdCatchAll d -> d
216
false
true
0
10
51
111
50
61
null
null
noteed/mojito
Language/Mojito/Inference/SystemCT1999/LCG.hs
bsd-3-clause
lcgAccum :: [Simple] -> [Simple] -> [(String, (Simple, Simple))] -> Inf ([Simple], [(String, (Simple, Simple))]) lcgAccum [] [] s0 = return ([],s0)
149
lcgAccum :: [Simple] -> [Simple] -> [(String, (Simple, Simple))] -> Inf ([Simple], [(String, (Simple, Simple))]) lcgAccum [] [] s0 = return ([],s0)
149
lcgAccum [] [] s0 = return ([],s0)
34
false
true
0
13
23
94
54
40
null
null
spaceships/circuit-synthesis
src/Circuit/Builder.hs
mit
circProd :: (Gate g, Monad m) => [Ref] -> BuilderT g m Ref circProd = foldTreeM circMul
87
circProd :: (Gate g, Monad m) => [Ref] -> BuilderT g m Ref circProd = foldTreeM circMul
87
circProd = foldTreeM circMul
28
false
true
0
7
16
43
22
21
null
null
Numberartificial/workflow
snipets/src/Craft/Chapter17.hs
mit
-- and matrix product. matrixProduct :: Matrix -> Matrix -> Matrix matrixProduct m p = [ [scalarProduct r c | c <- columns p] | r <- m ]
139
matrixProduct :: Matrix -> Matrix -> Matrix matrixProduct m p = [ [scalarProduct r c | c <- columns p] | r <- m ]
115
matrixProduct m p = [ [scalarProduct r c | c <- columns p] | r <- m ]
71
true
true
0
10
31
61
29
32
null
null
brendanhay/gogol
gogol-dlp/gen/Network/Google/Resource/DLP/Organizations/DeidentifyTemplates/List.hs
mpl-2.0
-- | Size of the page, can be limited by server. If zero server returns a -- page of max size 100. odtlPageSize :: Lens' OrganizationsDeidentifyTemplatesList (Maybe Int32) odtlPageSize = lens _odtlPageSize (\ s a -> s{_odtlPageSize = a}) . mapping _Coerce
263
odtlPageSize :: Lens' OrganizationsDeidentifyTemplatesList (Maybe Int32) odtlPageSize = lens _odtlPageSize (\ s a -> s{_odtlPageSize = a}) . mapping _Coerce
164
odtlPageSize = lens _odtlPageSize (\ s a -> s{_odtlPageSize = a}) . mapping _Coerce
91
true
true
0
10
49
56
29
27
null
null
graninas/The-Amoeba-World
src/Amoeba/GameLogic/Data/Game.hs
gpl-3.0
updateGame :: Game -> Game updateGame _ = undefined
51
updateGame :: Game -> Game updateGame _ = undefined
51
updateGame _ = undefined
24
false
true
0
7
8
24
10
14
null
null
julienschmaltz/madl
src/Deadlock/Nuxmv.hs
mit
nuxmvValueT [_] _ _ (XChoice name _f) = pure $ nuxmv_color name
63
nuxmvValueT [_] _ _ (XChoice name _f) = pure $ nuxmv_color name
63
nuxmvValueT [_] _ _ (XChoice name _f) = pure $ nuxmv_color name
63
false
false
1
6
11
32
15
17
null
null
razvan9310/barrelfish
hake/RuleDefs.hs
mit
appGetOptionsForArch arch args = (options arch) { extraIncludes = [ NoDep SrcTree "src" a | a <- Args.addIncludes args] ++ [ NoDep BuildTree arch a | a <- Args.addGeneratedIncludes args], optIncludes = (optIncludes $ opt...
1,128
appGetOptionsForArch arch args = (options arch) { extraIncludes = [ NoDep SrcTree "src" a | a <- Args.addIncludes args] ++ [ NoDep BuildTree arch a | a <- Args.addGeneratedIncludes args], optIncludes = (optIncludes $ opt...
1,128
appGetOptionsForArch arch args = (options arch) { extraIncludes = [ NoDep SrcTree "src" a | a <- Args.addIncludes args] ++ [ NoDep BuildTree arch a | a <- Args.addGeneratedIncludes args], optIncludes = (optIncludes $ opt...
1,128
false
false
0
12
527
287
147
140
null
null
Sgoettschkes/learning
haskell/ProjectEuler/tests/Problems/Problem006Spec.hs
mit
main :: IO() main = hspec spec
30
main :: IO() main = hspec spec
30
main = hspec spec
17
false
true
0
7
6
25
10
15
null
null
epsilonhalbe/Sammelsurium
ConnectedComponent/Array/CC.hs
bsd-3-clause
nb2 :: Point -> (Int, Int) -> [Point] -- |0 0 0 nb2 (x,y) (imax,jmax)= let inRange (i,j) = 1 <= min i j && i <= imax && j <= jmax-- |0 X 1 in filter inRange [(x+1,y),(x-1,y+1),(x,y+1),(x+1,y+1)]
261
nb2 :: Point -> (Int, Int) -> [Point] nb2 (x,y) (imax,jmax)= let inRange (i,j) = 1 <= min i j && i <= imax && j <= jmax-- |0 X 1 in filter inRange [(x+1,y),(x-1,y+1),(x,y+1),(x+1,y+1)]
208
nb2 (x,y) (imax,jmax)= let inRange (i,j) = 1 <= min i j && i <= imax && j <= jmax-- |0 X 1 in filter inRange [(x+1,y),(x-1,y+1),(x,y+1),(x+1,y+1)]
170
true
true
0
14
105
157
88
69
null
null
sherwoodwang/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxPREVIEW_ZOOM :: Int wxPREVIEW_ZOOM = 8
40
wxPREVIEW_ZOOM :: Int wxPREVIEW_ZOOM = 8
40
wxPREVIEW_ZOOM = 8
18
false
true
0
6
5
18
7
11
null
null
oopsno/hrank
src/HackerRank/Utilities/Manager/Challenge.hs
unlicense
parseChallenge :: ByteString -> IO Challenge parseChallenge content = do let html = fetchField content "body_html" slug = fetchField content "slug" name = fetchField content "name" track = [ fetchField2 content ["track", "track_slug"], fetchField2 content ["track", "slug"] ] let doc = pa...
897
parseChallenge :: ByteString -> IO Challenge parseChallenge content = do let html = fetchField content "body_html" slug = fetchField content "slug" name = fetchField content "name" track = [ fetchField2 content ["track", "track_slug"], fetchField2 content ["track", "slug"] ] let doc = pa...
897
parseChallenge content = do let html = fetchField content "body_html" slug = fetchField content "slug" name = fetchField content "name" track = [ fetchField2 content ["track", "track_slug"], fetchField2 content ["track", "slug"] ] let doc = parseHtml html quizzes <- runX (doc >>> css...
852
false
true
3
14
238
310
158
152
null
null
Soares/Bookbuilder
src/Target/PDF.hs
mit
warn :: String -> IO () warn x = do progName <- getProgName hPutStrLn stderr $ progName ++ ": " ++ x
104
warn :: String -> IO () warn x = do progName <- getProgName hPutStrLn stderr $ progName ++ ": " ++ x
104
warn x = do progName <- getProgName hPutStrLn stderr $ progName ++ ": " ++ x
80
false
true
0
10
25
48
22
26
null
null
kgadek/novelist
qc-gen/Novelist/Arbitrary/QuickCheckF.hs
bsd-2-clause
isNotSuffixOf :: (Eq a) => [a] -> [a] -> Bool isNotSuffixOf needle haystack = not (needle `isSuffixOf` haystack)
112
isNotSuffixOf :: (Eq a) => [a] -> [a] -> Bool isNotSuffixOf needle haystack = not (needle `isSuffixOf` haystack)
112
isNotSuffixOf needle haystack = not (needle `isSuffixOf` haystack)
66
false
true
0
8
17
51
28
23
null
null
meiersi/bytestring
Data/ByteString.hs
bsd-3-clause
-- | Write a 'ByteString' to a file. writeFile :: FilePath -> ByteString -> IO () writeFile f txt = bracket (openBinaryFile f WriteMode) hClose (\h -> hPut h txt)
166
writeFile :: FilePath -> ByteString -> IO () writeFile f txt = bracket (openBinaryFile f WriteMode) hClose (\h -> hPut h txt)
129
writeFile f txt = bracket (openBinaryFile f WriteMode) hClose (\h -> hPut h txt)
84
true
true
0
9
33
64
30
34
null
null
osa1/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
doOp v (LSGt (ATInt (ITFixed ty))) [x, y] = bitOp v "SGt" ty [x, y]
67
doOp v (LSGt (ATInt (ITFixed ty))) [x, y] = bitOp v "SGt" ty [x, y]
67
doOp v (LSGt (ATInt (ITFixed ty))) [x, y] = bitOp v "SGt" ty [x, y]
67
false
false
0
11
14
52
27
25
null
null
ndmitchell/qed
src/Proof/Exp/HSE.hs
bsd-3-clause
deflateExp (InfixApp a (QVarOp b) c) = Var b `App` a `App` c
60
deflateExp (InfixApp a (QVarOp b) c) = Var b `App` a `App` c
60
deflateExp (InfixApp a (QVarOp b) c) = Var b `App` a `App` c
60
false
false
0
8
12
41
21
20
null
null
sebastiaanvisser/frp-js
src/Browser/Time.hs
bsd-3-clause
time :: Val Number time = Prim In "time" "time"
47
time :: Val Number time = Prim In "time" "time"
47
time = Prim In "time" "time"
28
false
true
1
5
9
24
10
14
null
null
spechub/Hets
HasCASL/ToItem.hs
gpl-2.0
attrToItem :: OpAttr -> Item attrToItem a = mkItem ("OpAttr", pretty a) (getRange a) []
87
attrToItem :: OpAttr -> Item attrToItem a = mkItem ("OpAttr", pretty a) (getRange a) []
87
attrToItem a = mkItem ("OpAttr", pretty a) (getRange a) []
58
false
true
0
7
14
42
21
21
null
null
ddccffvv/fun-with-haskell
avi.hs
mit
mappend = addTest
17
mappend = addTest
17
mappend = addTest
17
false
false
0
4
2
6
3
3
null
null
chemist/highlighter
src/Text/Highlighter/Lexers/Mxml.hs
bsd-3-clause
tag' :: TokenMatcher tag' = [ tok "\\s+" (Arbitrary "Text") , tokNext "[a-zA-Z0-9_.:-]+\\s*=" (Arbitrary "Name" :. Arbitrary "Attribute") (GoTo attr') , tokNext "/?\\s*>" (Arbitrary "Name" :. Arbitrary "Tag") Pop ]
230
tag' :: TokenMatcher tag' = [ tok "\\s+" (Arbitrary "Text") , tokNext "[a-zA-Z0-9_.:-]+\\s*=" (Arbitrary "Name" :. Arbitrary "Attribute") (GoTo attr') , tokNext "/?\\s*>" (Arbitrary "Name" :. Arbitrary "Tag") Pop ]
230
tag' = [ tok "\\s+" (Arbitrary "Text") , tokNext "[a-zA-Z0-9_.:-]+\\s*=" (Arbitrary "Name" :. Arbitrary "Attribute") (GoTo attr') , tokNext "/?\\s*>" (Arbitrary "Name" :. Arbitrary "Tag") Pop ]
209
false
true
0
9
45
77
38
39
null
null
ku00/aoj-haskell
src/ITP1_4_C.hs
bsd-3-clause
calculate :: Int -> String -> Int -> Int calculate a op b = interpret op where interpret "+" = a + b interpret "-" = a - b interpret "*" = a * b interpret "/" = a `div` b
204
calculate :: Int -> String -> Int -> Int calculate a op b = interpret op where interpret "+" = a + b interpret "-" = a - b interpret "*" = a * b interpret "/" = a `div` b
204
calculate a op b = interpret op where interpret "+" = a + b interpret "-" = a - b interpret "*" = a * b interpret "/" = a `div` b
163
false
true
3
9
74
88
43
45
null
null
berdario/jira2sheet
src/Jira2Sheet/Jira.hs
bsd-3-clause
prepareJQL (JQL projectName mTeamName) = encode $ maybe "" (\name -> "\"Assigned Team\" = \"" <> name <> "\" AND ") mTeamName <> "project = \"" <> projectName <> "\" AND issueType not in (Epic, Sub-task) AND status not in (Done, Resolved, Backlog, \"Selected for Development\")"
286
prepareJQL (JQL projectName mTeamName) = encode $ maybe "" (\name -> "\"Assigned Team\" = \"" <> name <> "\" AND ") mTeamName <> "project = \"" <> projectName <> "\" AND issueType not in (Epic, Sub-task) AND status not in (Done, Resolved, Backlog, \"Selected for Development\")"
286
prepareJQL (JQL projectName mTeamName) = encode $ maybe "" (\name -> "\"Assigned Team\" = \"" <> name <> "\" AND ") mTeamName <> "project = \"" <> projectName <> "\" AND issueType not in (Epic, Sub-task) AND status not in (Done, Resolved, Backlog, \"Selected for Development\")"
286
false
false
0
13
53
56
28
28
null
null
graninas/ICFPC2007
Endo/Middleware/Config/Config.hs
gpl-3.0
opt = Opt
9
opt = Opt
9
opt = Opt
9
false
false
1
5
2
10
3
7
null
null
fpco/schoolofhaskell
soh-scheduler/main/Main.hs
mit
packageVersion :: String packageVersion = $(packageVariable (pkgVersion . package))
85
packageVersion :: String packageVersion = $(packageVariable (pkgVersion . package))
85
packageVersion = $(packageVariable (pkgVersion . package))
60
false
true
0
9
10
25
13
12
null
null
gridaphobe/ghc
compiler/codeGen/StgCmmClosure.hs
bsd-3-clause
closureSingleEntry _ = False
28
closureSingleEntry _ = False
28
closureSingleEntry _ = False
28
false
false
0
4
3
10
4
6
null
null
energyflowanalysis/efa-2.1
sandbox/stateanalysis/1/Main.hs
bsd-3-clause
extend :: Edge -> [[DirEdge]] -> [[DirEdge]] extend (x, y) [] = [[x :-> y], [x :<- y], [x :-: y]]
97
extend :: Edge -> [[DirEdge]] -> [[DirEdge]] extend (x, y) [] = [[x :-> y], [x :<- y], [x :-: y]]
97
extend (x, y) [] = [[x :-> y], [x :<- y], [x :-: y]]
52
false
true
0
10
20
80
44
36
null
null
FranklinChen/hugs98-plus-Sep2006
packages/GLUT/Graphics/UI/GLUT/State.hs
bsd-3-clause
----------------------------------------------------------------------------- -- | (/freeglut only/) Contains the height of the header\/caption area of a -- window in pixels. windowHeaderHeight :: GettableStateVar Int windowHeaderHeight = makeGettableStateVar (simpleGet fromIntegral glut_WINDOW_HEADER_HEIGHT)
315
windowHeaderHeight :: GettableStateVar Int windowHeaderHeight = makeGettableStateVar (simpleGet fromIntegral glut_WINDOW_HEADER_HEIGHT)
138
windowHeaderHeight = makeGettableStateVar (simpleGet fromIntegral glut_WINDOW_HEADER_HEIGHT)
95
true
true
0
7
32
28
15
13
null
null
kapilash/dc
src/ccs2c/ccs2cs-lib/src/Language/CCS/Parser.hs
bsd-3-clause
csIdent :: (Monad m) => ParsecT String u m String csIdent = do f <- letter rst <- many (alphaNum <|> char '_') spaces return (f:rst)
140
csIdent :: (Monad m) => ParsecT String u m String csIdent = do f <- letter rst <- many (alphaNum <|> char '_') spaces return (f:rst)
140
csIdent = do f <- letter rst <- many (alphaNum <|> char '_') spaces return (f:rst)
90
false
true
0
11
33
72
34
38
null
null
snoyberg/ghc
compiler/prelude/TysWiredIn.hs
bsd-3-clause
nothingDataCon :: DataCon nothingDataCon = pcDataCon nothingDataConName alpha_tyvar [] maybeTyCon
97
nothingDataCon :: DataCon nothingDataCon = pcDataCon nothingDataConName alpha_tyvar [] maybeTyCon
97
nothingDataCon = pcDataCon nothingDataConName alpha_tyvar [] maybeTyCon
71
false
true
0
6
9
22
11
11
null
null
DavidAlphaFox/ghc
libraries/haskeline/System/Console/Haskeline/Backend/DumbTerm.hs
bsd-3-clause
evalDumb :: (MonadReader Layout m, CommandMonad m) => EvalTerm (PosixT m) evalDumb = EvalTerm (evalStateT' initWindow . unDumbTerm) (DumbTerm . lift)
149
evalDumb :: (MonadReader Layout m, CommandMonad m) => EvalTerm (PosixT m) evalDumb = EvalTerm (evalStateT' initWindow . unDumbTerm) (DumbTerm . lift)
149
evalDumb = EvalTerm (evalStateT' initWindow . unDumbTerm) (DumbTerm . lift)
75
false
true
0
9
20
64
31
33
null
null
martinvlk/cis194-homeworks
src/HW07/JoinList.hs
gpl-3.0
getOr :: Or -> Bool getOr (Or a) = a
36
getOr :: Or -> Bool getOr (Or a) = a
36
getOr (Or a) = a
16
false
true
0
6
9
28
13
15
null
null
snoyberg/ghc
compiler/basicTypes/Module.hs
bsd-3-clause
-- TODO: this indicates some latent bug... newUnitId cid insts = IndefiniteUnitId $ newIndefUnitId cid insts
108
newUnitId cid insts = IndefiniteUnitId $ newIndefUnitId cid insts
65
newUnitId cid insts = IndefiniteUnitId $ newIndefUnitId cid insts
65
true
false
0
6
15
21
10
11
null
null
mzero/plush
src/Plush/Run/BuiltIns/Text.hs
apache-2.0
trDelete _ _ = exitMsg 1 "tr -d takes exactly one argument"
59
trDelete _ _ = exitMsg 1 "tr -d takes exactly one argument"
59
trDelete _ _ = exitMsg 1 "tr -d takes exactly one argument"
59
false
false
0
5
11
16
7
9
null
null
isomorphism/csound-expression
src/Csound/Air/Misc.hs
bsd-3-clause
-- | Stereo reverb for small hall. smallHall2 :: Sig2 -> Sig2 smallHall2 = rever2 0.8
85
smallHall2 :: Sig2 -> Sig2 smallHall2 = rever2 0.8
50
smallHall2 = rever2 0.8
23
true
true
0
5
15
19
10
9
null
null
rjwright/js-typeomatic
LabelJSAST.hs
apache-2.0
abelValue (WSUndefined) n = (LabUndefined, n + 1)
50
labelValue (WSUndefined) n = (LabUndefined, n + 1)
50
labelValue (WSUndefined) n = (LabUndefined, n + 1)
50
false
false
0
6
8
24
13
11
null
null
nullref/torrent-diff
TorrentDiff.hs
bsd-2-clause
defOptions :: Options defOptions = Options ModeAdded mkSetDirectories
69
defOptions :: Options defOptions = Options ModeAdded mkSetDirectories
69
defOptions = Options ModeAdded mkSetDirectories
47
false
true
0
5
7
16
8
8
null
null
DavidAlphaFox/ghc
libraries/Cabal/cabal-install/Distribution/Client/Install.hs
bsd-3-clause
storeDetailedBuildReports :: Verbosity -> FilePath -> [(BuildReports.BuildReport, Maybe Repo)] -> IO () storeDetailedBuildReports verbosity logsDir reports = sequence_ [ do dotCabal <- defaultCabalDir let logFileName = display (BuildReports.package report) <.> "log" logFile...
1,450
storeDetailedBuildReports :: Verbosity -> FilePath -> [(BuildReports.BuildReport, Maybe Repo)] -> IO () storeDetailedBuildReports verbosity logsDir reports = sequence_ [ do dotCabal <- defaultCabalDir let logFileName = display (BuildReports.package report) <.> "log" logFile...
1,450
storeDetailedBuildReports verbosity logsDir reports = sequence_ [ do dotCabal <- defaultCabalDir let logFileName = display (BuildReports.package report) <.> "log" logFile = logsDir </> logFileName reportsDir = dotCabal </> "reports" </> remoteRepoName remoteRepo reportFile...
1,320
false
true
0
16
384
351
170
181
null
null
Drezil/FFF
Handler/Show.hs
apache-2.0
postShowR :: Handler Html postShowR = error "Not yet implemented: postShowR"
76
postShowR :: Handler Html postShowR = error "Not yet implemented: postShowR"
76
postShowR = error "Not yet implemented: postShowR"
50
false
true
0
6
10
23
9
14
null
null
brendanhay/gogol
gogol-composer/gen/Network/Google/Composer/Types/Product.hs
mpl-2.0
-- | Optional. The major version of Python used to run the Apache Airflow -- scheduler, worker, and webserver processes. Can be set to \'2\' or -- \'3\'. If not specified, the default is \'3\'. Cannot be updated. scPythonVersion :: Lens' SoftwareConfig (Maybe Text) scPythonVersion = lens _scPythonVersion (\ s a...
348
scPythonVersion :: Lens' SoftwareConfig (Maybe Text) scPythonVersion = lens _scPythonVersion (\ s a -> s{_scPythonVersion = a})
135
scPythonVersion = lens _scPythonVersion (\ s a -> s{_scPythonVersion = a})
82
true
true
1
9
62
54
27
27
null
null
tkasu/haskellbook-adventure
app/Chap7.hs
bsd-3-clause
nums x = case compare x 0 of LT -> -1 GT -> 1
55
nums x = case compare x 0 of LT -> -1 GT -> 1
55
nums x = case compare x 0 of LT -> -1 GT -> 1
55
false
false
1
8
23
36
15
21
null
null
juretta/haskell-jwt
src/Web/JWT.hs
mit
-- | Try to extract the value for the issue claim field 'iss' from the web token in JSON form tokenIssuer :: JSON -> Maybe StringOrURI tokenIssuer = decode >=> fmap pure claims >=> iss
184
tokenIssuer :: JSON -> Maybe StringOrURI tokenIssuer = decode >=> fmap pure claims >=> iss
90
tokenIssuer = decode >=> fmap pure claims >=> iss
49
true
true
0
7
34
32
16
16
null
null
tjunier/mlgsc
src/Classifier.hs
mit
classifySequence :: Classifier -> Int -> Sequence -> Trail classifySequence (PWMClassifier modTree scale) log10ERcutoff seq = chooseSubtree modTree scale log10ERcutoff seq
175
classifySequence :: Classifier -> Int -> Sequence -> Trail classifySequence (PWMClassifier modTree scale) log10ERcutoff seq = chooseSubtree modTree scale log10ERcutoff seq
175
classifySequence (PWMClassifier modTree scale) log10ERcutoff seq = chooseSubtree modTree scale log10ERcutoff seq
116
false
true
0
11
24
52
24
28
null
null
sdiehl/ghc
libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs
bsd-3-clause
lamCaseE :: Quote m => [m Match] -> m Exp lamCaseE ms = LamCaseE <$> sequenceA ms
81
lamCaseE :: Quote m => [m Match] -> m Exp lamCaseE ms = LamCaseE <$> sequenceA ms
81
lamCaseE ms = LamCaseE <$> sequenceA ms
39
false
true
0
9
16
45
20
25
null
null
frantisekfarka/ghc-dsi
compiler/cmm/CLabel.hs
bsd-3-clause
-- | Check whether a label is a local temporary for native code generation isAsmTemp :: CLabel -> Bool isAsmTemp (AsmTempLabel _) = True
150
isAsmTemp :: CLabel -> Bool isAsmTemp (AsmTempLabel _) = True
75
isAsmTemp (AsmTempLabel _) = True
46
true
true
0
7
37
25
13
12
null
null
abresas/ai
tests/test.hs
mit
testSigmoid = TestCase( do assertEqual "sigmoid( 0 ) should be 0.5 " 0.5 (sigmoid 0) assertBool "sigmoid of negative should be less than 0.5" (0.5 > (sigmoid (-10))) assertBool "sigmoid of negative should be more than 0" (0 < (sigmoid (-10))) assertBool "sigmoid of positive should be more than 0.5" (0....
666
testSigmoid = TestCase( do assertEqual "sigmoid( 0 ) should be 0.5 " 0.5 (sigmoid 0) assertBool "sigmoid of negative should be less than 0.5" (0.5 > (sigmoid (-10))) assertBool "sigmoid of negative should be more than 0" (0 < (sigmoid (-10))) assertBool "sigmoid of positive should be more than 0.5" (0....
666
testSigmoid = TestCase( do assertEqual "sigmoid( 0 ) should be 0.5 " 0.5 (sigmoid 0) assertBool "sigmoid of negative should be less than 0.5" (0.5 > (sigmoid (-10))) assertBool "sigmoid of negative should be more than 0" (0 < (sigmoid (-10))) assertBool "sigmoid of positive should be more than 0.5" (0....
666
false
false
0
15
140
159
76
83
null
null
psibi/persistent
persistent-test/src/Init.hs
mit
generateKey :: IO (BackendKey Context) generateKey = MongoKey `liftM` MongoDB.genObjectId
89
generateKey :: IO (BackendKey Context) generateKey = MongoKey `liftM` MongoDB.genObjectId
89
generateKey = MongoKey `liftM` MongoDB.genObjectId
50
false
true
0
7
9
28
15
13
null
null
raptros/wai-hmac-auth
tests/tests.hs
bsd-3-clause
testGetApiKey :: Spec testGetApiKey = describe "getApiKey" $ do context "when using query param spec" $ do let spec = QueryParamKey "apiKey" getKey = getApiKey spec it "fails when no key is added" $ do req <- mkRequest H.methodGet "/" [] $ S.singleton "chunk" get...
2,141
testGetApiKey :: Spec testGetApiKey = describe "getApiKey" $ do context "when using query param spec" $ do let spec = QueryParamKey "apiKey" getKey = getApiKey spec it "fails when no key is added" $ do req <- mkRequest H.methodGet "/" [] $ S.singleton "chunk" get...
2,141
testGetApiKey = describe "getApiKey" $ do context "when using query param spec" $ do let spec = QueryParamKey "apiKey" getKey = getApiKey spec it "fails when no key is added" $ do req <- mkRequest H.methodGet "/" [] $ S.singleton "chunk" getKey req `shouldBe` Not...
2,119
false
true
0
18
646
623
287
336
null
null
kumasento/accelerate
Data/Array/Accelerate/Pretty/Print.hs
bsd-3-clause
prettyPrim (PrimIDiv _) = (False, text "div")
55
prettyPrim (PrimIDiv _) = (False, text "div")
55
prettyPrim (PrimIDiv _) = (False, text "div")
55
false
false
0
7
16
24
12
12
null
null
alokpndy/haskell-learn
src/dataScience/Graph.hs
mit
topo = do ls <- lines <$> readFile "input.txt" let g = graph ls putStrLn $ showTopSort ls g -- | The nub function removes duplicate elements from a list. -- | In particular, it keeps only the first occurrence of each element. -- | (!) - Find the value at a key. Calls error when the element can not be fou...
371
topo = do ls <- lines <$> readFile "input.txt" let g = graph ls putStrLn $ showTopSort ls g -- | The nub function removes duplicate elements from a list. -- | In particular, it keeps only the first occurrence of each element. -- | (!) - Find the value at a key. Calls error when the element can not be fou...
371
topo = do ls <- lines <$> readFile "input.txt" let g = graph ls putStrLn $ showTopSort ls g -- | The nub function removes duplicate elements from a list. -- | In particular, it keeps only the first occurrence of each element. -- | (!) - Find the value at a key. Calls error when the element can not be fou...
371
false
false
0
10
86
48
23
25
null
null
mydaum/cabal
Cabal/Distribution/Simple/BuildPaths.hs
bsd-3-clause
-- | The directory to which generated haddock documentation should be written. haddockPref :: HaddockTarget -> FilePath -> PackageDescription -> FilePath haddockPref haddockTarget distPref pkg_descr = distPref </> "doc" </> "html" </> haddockDirName haddockTarget pkg_descr
277
haddockPref :: HaddockTarget -> FilePath -> PackageDescription -> FilePath haddockPref haddockTarget distPref pkg_descr = distPref </> "doc" </> "html" </> haddockDirName haddockTarget pkg_descr
198
haddockPref haddockTarget distPref pkg_descr = distPref </> "doc" </> "html" </> haddockDirName haddockTarget pkg_descr
123
true
true
0
7
38
48
24
24
null
null
jsnajder/genprog
src/GenProg.hs
bsd-3-clause
-- | Termination predicate: terminate if any individual satisfies the -- specified predicate. tSuccess :: (e -> Bool) -> Terminate e tSuccess c = any (c . unInd) . unPop . pop
175
tSuccess :: (e -> Bool) -> Terminate e tSuccess c = any (c . unInd) . unPop . pop
81
tSuccess c = any (c . unInd) . unPop . pop
42
true
true
0
9
31
48
25
23
null
null
zombiecalypse/RssMail
RssMail.hs
apache-2.0
-- | Run on configured feeds, send emails and update the database. main = do seen <- MVar.newEmptyMVar config <- MVar.newEmptyMVar forkIO $ configThread config readSeen seen -- TODO(zombiecalypse) make full blown daemon. readFeeds config seen
254
main = do seen <- MVar.newEmptyMVar config <- MVar.newEmptyMVar forkIO $ configThread config readSeen seen -- TODO(zombiecalypse) make full blown daemon. readFeeds config seen
187
main = do seen <- MVar.newEmptyMVar config <- MVar.newEmptyMVar forkIO $ configThread config readSeen seen -- TODO(zombiecalypse) make full blown daemon. readFeeds config seen
187
true
false
0
8
47
50
22
28
null
null
narrative/stack
src/Stack/Docker.hs
bsd-3-clause
-- | Convenience function constructing message for @$log*@. concatT :: [String] -> Text concatT = T.pack . concat
113
concatT :: [String] -> Text concatT = T.pack . concat
53
concatT = T.pack . concat
25
true
true
0
6
17
25
14
11
null
null
jozefg/hlf
src/Language/HLF/TC/Util.hs
mit
addNames :: (MonadReader TypeInfo m, Applicative m) => Term Fresh -> m (Term Name) addNames = traverse nameFor
122
addNames :: (MonadReader TypeInfo m, Applicative m) => Term Fresh -> m (Term Name) addNames = traverse nameFor
122
addNames = traverse nameFor
27
false
true
0
9
29
47
23
24
null
null
tjakway/ghcjvm
compiler/types/OptCoercion.hs
bsd-3-clause
opt_trans_rule is co1 co2 -- See Note [Why call checkAxInstCo during optimisation] -- TrPushSymAxR | Just (sym, con, ind, cos1) <- co1_is_axiom_maybe , True <- sym , Just cos2 <- matchAxiom sym con ind co2 , let newAxInst = AxiomInstCo con ind (opt_transList is (map mkSymCo cos2) cos1) , Nothing <- check...
2,206
opt_trans_rule is co1 co2 -- See Note [Why call checkAxInstCo during optimisation] -- TrPushSymAxR | Just (sym, con, ind, cos1) <- co1_is_axiom_maybe , True <- sym , Just cos2 <- matchAxiom sym con ind co2 , let newAxInst = AxiomInstCo con ind (opt_transList is (map mkSymCo cos2) cos1) , Nothing <- check...
2,206
opt_trans_rule is co1 co2 -- See Note [Why call checkAxInstCo during optimisation] -- TrPushSymAxR | Just (sym, con, ind, cos1) <- co1_is_axiom_maybe , True <- sym , Just cos2 <- matchAxiom sym con ind co2 , let newAxInst = AxiomInstCo con ind (opt_transList is (map mkSymCo cos2) cos1) , Nothing <- check...
2,206
false
false
2
15
479
737
368
369
null
null
noamz/linlam-gos
src/Lambek.hs
mit
countL (LImp a b) = 1 + countL a + countL b
43
countL (LImp a b) = 1 + countL a + countL b
43
countL (LImp a b) = 1 + countL a + countL b
43
false
false
0
7
11
32
14
18
null
null
noughtmare/yi
yi-keymap-vim/src/Yi/Keymap/Vim/Digraph.hs
gpl-2.0
-- BOPOMOFO LETTER B switch 'p' '4' = '\x3106'
46
switch 'p' '4' = '\x3106'
25
switch 'p' '4' = '\x3106'
25
true
false
0
5
8
12
6
6
null
null
olsner/ghc
compiler/main/StaticFlags.hs
bsd-3-clause
-- | Parse GHC's static flags as @parseStaticFlags@ does. However it also -- takes a list of available static flags, such that certain flags can be -- enabled or disabled through this argument. parseStaticFlagsFull :: [Flag IO] -> [Located String] -> IO ([Located String], [Located String]) parseSta...
983
parseStaticFlagsFull :: [Flag IO] -> [Located String] -> IO ([Located String], [Located String]) parseStaticFlagsFull flagsAvailable args = do ready <- readIORef v_opt_C_ready when ready $ throwGhcExceptionIO (ProgramError "Too late for parseStaticFlags: call it before runGhc or runGhcT") (l...
789
parseStaticFlagsFull flagsAvailable args = do ready <- readIORef v_opt_C_ready when ready $ throwGhcExceptionIO (ProgramError "Too late for parseStaticFlags: call it before runGhc or runGhcT") (leftover, errs, warns) <- processArgs flagsAvailable args -- See Note [Handling errors when parsing commandline flag...
671
true
true
0
13
184
177
90
87
null
null
haskellGardener/yusic
src/Yusic.hs
mit
toKeyGuide (D:Fs_Gb:A:C :[]) = Just KG_DDominant7
63
toKeyGuide (D:Fs_Gb:A:C :[]) = Just KG_DDominant7
63
toKeyGuide (D:Fs_Gb:A:C :[]) = Just KG_DDominant7
63
false
false
0
11
19
33
16
17
null
null
sherwoodwang/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/Types.hs
lgpl-2.1
pointSub :: (Num a) => Point2 a -> Point2 a -> Point2 a pointSub (Point x1 y1) (Point x2 y2) = Point (x1-x2) (y1-y2)
116
pointSub :: (Num a) => Point2 a -> Point2 a -> Point2 a pointSub (Point x1 y1) (Point x2 y2) = Point (x1-x2) (y1-y2)
116
pointSub (Point x1 y1) (Point x2 y2) = Point (x1-x2) (y1-y2)
60
false
true
0
8
23
77
38
39
null
null
YoshikuniJujo/funpaala
samples/39_learn_io/typingGame1.hs
bsd-3-clause
main :: IO () main = do fp : _ <- getArgs ls <- fileLines fp ps <- for ls $ \l -> do putStrLn l (s, sc) <- getLineWithTime let p = point l s sc print p return p let rslt = sum ps `div` genericLength ps print rslt ranking "practice/ranking.txt" rslt
264
main :: IO () main = do fp : _ <- getArgs ls <- fileLines fp ps <- for ls $ \l -> do putStrLn l (s, sc) <- getLineWithTime let p = point l s sc print p return p let rslt = sum ps `div` genericLength ps print rslt ranking "practice/ranking.txt" rslt
264
main = do fp : _ <- getArgs ls <- fileLines fp ps <- for ls $ \l -> do putStrLn l (s, sc) <- getLineWithTime let p = point l s sc print p return p let rslt = sum ps `div` genericLength ps print rslt ranking "practice/ranking.txt" rslt
250
false
true
0
15
69
138
61
77
null
null
fpco/fay
src/Fay/Compiler/Exp.hs
bsd-3-clause
compileEnumFromThen :: S.Exp -> S.Exp -> Compile JsExp compileEnumFromThen a b = do fr <- compileExp a th <- compileExp b return (JsApp (JsApp (JsName (JsNameVar (Qual () "Prelude" "enumFromThen"))) [fr]) [th]) -- | Compile [e1,e2..e3] arithmetic sequences.
264
compileEnumFromThen :: S.Exp -> S.Exp -> Compile JsExp compileEnumFromThen a b = do fr <- compileExp a th <- compileExp b return (JsApp (JsApp (JsName (JsNameVar (Qual () "Prelude" "enumFromThen"))) [fr]) [th]) -- | Compile [e1,e2..e3] arithmetic sequences.
264
compileEnumFromThen a b = do fr <- compileExp a th <- compileExp b return (JsApp (JsApp (JsName (JsNameVar (Qual () "Prelude" "enumFromThen"))) [fr]) [th]) -- | Compile [e1,e2..e3] arithmetic sequences.
209
false
true
0
18
44
104
50
54
null
null
brendanhay/gogol
gogol-analytics/gen/Network/Google/Analytics/Types/Product.hs
mpl-2.0
-- | Email ID of the authenticated user cdsUsername :: Lens' CustomDataSources (Maybe Text) cdsUsername = lens _cdsUsername (\ s a -> s{_cdsUsername = a})
156
cdsUsername :: Lens' CustomDataSources (Maybe Text) cdsUsername = lens _cdsUsername (\ s a -> s{_cdsUsername = a})
116
cdsUsername = lens _cdsUsername (\ s a -> s{_cdsUsername = a})
64
true
true
0
9
26
48
25
23
null
null
martinra/hflint
src/HFlint/NF/Base.hs
gpl-3.0
toVector :: ReifiesNFContext ctxProxy => NF ctxProxy -> Vector FMPQ toVector a = unsafePerformIO $ fmap snd $ withNF a $ \aptr ctxptr -> do deg <- fromIntegral <$> nf_degree ctxptr V.generateM (deg+1) $ \ix -> withNewFMPQ_ $ \bptr -> nf_elem_get_coeff_fmpq bptr aptr (fromIntegral ix) ctxptr
317
toVector :: ReifiesNFContext ctxProxy => NF ctxProxy -> Vector FMPQ toVector a = unsafePerformIO $ fmap snd $ withNF a $ \aptr ctxptr -> do deg <- fromIntegral <$> nf_degree ctxptr V.generateM (deg+1) $ \ix -> withNewFMPQ_ $ \bptr -> nf_elem_get_coeff_fmpq bptr aptr (fromIntegral ix) ctxptr
317
toVector a = unsafePerformIO $ fmap snd $ withNF a $ \aptr ctxptr -> do deg <- fromIntegral <$> nf_degree ctxptr V.generateM (deg+1) $ \ix -> withNewFMPQ_ $ \bptr -> nf_elem_get_coeff_fmpq bptr aptr (fromIntegral ix) ctxptr
245
false
true
0
16
71
122
57
65
null
null
ameingast/yawn
test/src/Yawn/Test/Common.hs
bsd-3-clause
-- FIXME: replace this with haskells internal HTTP implementation transmit :: String -> IO (String) transmit s = transmitLines s 1
130
transmit :: String -> IO (String) transmit s = transmitLines s 1
64
transmit s = transmitLines s 1
30
true
true
0
7
20
30
15
15
null
null