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
jgraydus/circuits
src/Circuits/Util.hs
gpl-3.0
format :: [Bool] -> [Bool] -> String format ins outs = intercalate " " $ map (\b -> if b then "1" else "0") (ins ++ outs)
122
format :: [Bool] -> [Bool] -> String format ins outs = intercalate " " $ map (\b -> if b then "1" else "0") (ins ++ outs)
122
format ins outs = intercalate " " $ map (\b -> if b then "1" else "0") (ins ++ outs)
85
false
true
0
9
27
70
36
34
null
null
YoshikuniJujo/xturtle_haskell
tests/randomTurtle.hs
bsd-3-clause
randomTurtle :: Turtle -> IO () randomTurtle t = do penup t shape t "turtle" shapesize t 2 2 (x0, y0) <- position t forward t 100 pendown t left t 90 circle t 100 penup t goto t x0 y0 -- home t pendown t position t >>= print sequence_ $ repeat $ do d <- randomRIO (- 180, 180) r <- randomWord8 g <- ra...
467
randomTurtle :: Turtle -> IO () randomTurtle t = do penup t shape t "turtle" shapesize t 2 2 (x0, y0) <- position t forward t 100 pendown t left t 90 circle t 100 penup t goto t x0 y0 -- home t pendown t position t >>= print sequence_ $ repeat $ do d <- randomRIO (- 180, 180) r <- randomWord8 g <- ra...
467
randomTurtle t = do penup t shape t "turtle" shapesize t 2 2 (x0, y0) <- position t forward t 100 pendown t left t 90 circle t 100 penup t goto t x0 y0 -- home t pendown t position t >>= print sequence_ $ repeat $ do d <- randomRIO (- 180, 180) r <- randomWord8 g <- randomWord8 b <- randomWord8 p...
435
false
true
0
14
128
254
108
146
null
null
michaxm/haskell-hdfs-thrift-client
src-gen-thrift/ThriftHadoopFileSystem.hs
bsd-3-clause
to_Rename_result _ = P.error "not a struct"
43
to_Rename_result _ = P.error "not a struct"
43
to_Rename_result _ = P.error "not a struct"
43
false
false
0
6
6
14
6
8
null
null
tibbe/ghc
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
isVecExpr (CmmMachOp (MO_V_Sub {}) _) = True
49
isVecExpr (CmmMachOp (MO_V_Sub {}) _) = True
49
isVecExpr (CmmMachOp (MO_V_Sub {}) _) = True
49
false
false
0
9
11
24
12
12
null
null
sdiehl/ghc
compiler/GHC/StgToCmm/Heap.hs
bsd-3-clause
do_checks :: Maybe CmmExpr -- Should we check the stack? -- See Note [Stack usage] -> Bool -- Should we check for preemption? -> Maybe CmmExpr -- Heap headroom (bytes) -> CmmAGraph -- What to do on failure -> FCode () do_chec...
3,987
do_checks :: Maybe CmmExpr -- Should we check the stack? -- See Note [Stack usage] -> Bool -- Should we check for preemption? -> Maybe CmmExpr -- Heap headroom (bytes) -> CmmAGraph -- What to do on failure -> FCode () do_chec...
3,987
do_checks mb_stk_hwm checkYield mb_alloc_lit do_gc = do dflags <- getDynFlags gc_id <- newBlockId let Just alloc_lit = mb_alloc_lit bump_hp = cmmOffsetExprB dflags hpExpr alloc_lit -- Sp overflow if ((old + 0) - CmmHighStack < SpLim) -- At the beginning of a function old + 0 = Sp -- See N...
3,674
false
true
0
21
1,121
513
265
248
null
null
levex/adventofcode-2016
day01/NoTimeForATaxiCab.hs
gpl-3.0
turn South Right90 = West
25
turn South Right90 = West
25
turn South Right90 = West
25
false
false
0
5
4
13
5
8
null
null
nh2/WashNGo
WASH/Utility/QuotedPrintable.hs
bsd-3-clause
encode_quoted' (x:xs) | quoted_printable x = x : encode_quoted' xs
66
encode_quoted' (x:xs) | quoted_printable x = x : encode_quoted' xs
66
encode_quoted' (x:xs) | quoted_printable x = x : encode_quoted' xs
66
false
false
0
8
9
33
14
19
null
null
denisshevchenko/breadu.info
src/lib/BreadU/Pages/Content/Errors/Messages.hs
mit
carbIncorrectNumberErrorMessage En minCarbs maxCarbs = "Please enter carbohydrates value as an integer (or decimal) value between " <> showt minCarbs <> " and " <> showt maxCarbs <> "."
240
carbIncorrectNumberErrorMessage En minCarbs maxCarbs = "Please enter carbohydrates value as an integer (or decimal) value between " <> showt minCarbs <> " and " <> showt maxCarbs <> "."
240
carbIncorrectNumberErrorMessage En minCarbs maxCarbs = "Please enter carbohydrates value as an integer (or decimal) value between " <> showt minCarbs <> " and " <> showt maxCarbs <> "."
240
false
false
0
9
83
35
16
19
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F01.hs
bsd-3-clause
-- glArrayElementEXT ----------------------------------------------------------- -- | This command is an alias for 'glArrayElement'. glArrayElementEXT :: MonadIO m => GLint -- ^ @i@. -> m () glArrayElementEXT v1 = liftIO $ dyn13 ptr_glArrayElementEXT v1
260
glArrayElementEXT :: MonadIO m => GLint -- ^ @i@. -> m () glArrayElementEXT v1 = liftIO $ dyn13 ptr_glArrayElementEXT v1
126
glArrayElementEXT v1 = liftIO $ dyn13 ptr_glArrayElementEXT v1
62
true
true
2
9
38
47
22
25
null
null
jstolarek/ghc
libraries/base/Data/Foldable.hs
bsd-3-clause
traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f () traverse_ f = foldr ((*>) . f) (pure ())
110
traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f () traverse_ f = foldr ((*>) . f) (pure ())
110
traverse_ f = foldr ((*>) . f) (pure ())
40
false
true
0
9
25
77
39
38
null
null
fmapfmapfmap/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs
mpl-2.0
-- | The value is 'Windows' for Windows AMIs; otherwise blank. iPlatform :: Lens' Image (Maybe PlatformValues) iPlatform = lens _iPlatform (\ s a -> s{_iPlatform = a})
167
iPlatform :: Lens' Image (Maybe PlatformValues) iPlatform = lens _iPlatform (\ s a -> s{_iPlatform = a})
104
iPlatform = lens _iPlatform (\ s a -> s{_iPlatform = a})
56
true
true
0
9
27
46
25
21
null
null
tonyfloatersu/solution-haskell-craft-of-FP
PicturesSVG.hs
mit
width (FlipH pic) = width pic
39
width (FlipH pic) = width pic
39
width (FlipH pic) = width pic
39
false
false
0
6
15
19
8
11
null
null
l0b0/Project-Euler
2 - Sum of even Fibonacci numbers up to N.hs
gpl-3.0
fibonaccisUntil :: (Num numord, Ord numord) => numord -> [numord] fibonaccisUntil number = takeWhile (<= number) fibs
117
fibonaccisUntil :: (Num numord, Ord numord) => numord -> [numord] fibonaccisUntil number = takeWhile (<= number) fibs
117
fibonaccisUntil number = takeWhile (<= number) fibs
51
false
true
0
7
16
45
24
21
null
null
bkil-syslogng/haskell-scuttlebutt
snippets/SsbSignatureCheck.hs
bsd-3-clause
signature = "28GiO52GFjJnrwpKo359FamEes7JB9gTiiZaidKLL1C1NRueqGq2IAYQ1V+T2AnBgUJLRZUIyNtLTlBcx4RGAA=="
102
signature = "28GiO52GFjJnrwpKo359FamEes7JB9gTiiZaidKLL1C1NRueqGq2IAYQ1V+T2AnBgUJLRZUIyNtLTlBcx4RGAA=="
102
signature = "28GiO52GFjJnrwpKo359FamEes7JB9gTiiZaidKLL1C1NRueqGq2IAYQ1V+T2AnBgUJLRZUIyNtLTlBcx4RGAA=="
102
false
false
0
4
2
6
3
3
null
null
ki11men0w/delphi-lint
src/Dfm.hs
bsd-3-clause
-- | Parse DFM file. Now we can parse only DFM-files in Text format. parseDfmFile :: FilePath -> ParseDfmOpts -> IO (Either String (Maybe Object)) parseDfmFile file opts = do input <- readFile file return $ if not $ isTextDfm input then if ignoreBinaryDfm opts then Right Nothing el...
466
parseDfmFile :: FilePath -> ParseDfmOpts -> IO (Either String (Maybe Object)) parseDfmFile file opts = do input <- readFile file return $ if not $ isTextDfm input then if ignoreBinaryDfm opts then Right Nothing else Left "not text DFM" else case parse parseObject file inp...
395
parseDfmFile file opts = do input <- readFile file return $ if not $ isTextDfm input then if ignoreBinaryDfm opts then Right Nothing else Left "not text DFM" else case parse parseObject file input of Left e -> (Left . show) e Right x -> Right $ Just x
317
true
true
0
14
141
137
65
72
null
null
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/Compatibility/Tokens.hs
bsd-3-clause
gl_MAP2_COLOR_4 :: GLenum gl_MAP2_COLOR_4 = 0x0DB0
50
gl_MAP2_COLOR_4 :: GLenum gl_MAP2_COLOR_4 = 0x0DB0
50
gl_MAP2_COLOR_4 = 0x0DB0
24
false
true
0
4
5
11
6
5
null
null
goalieca/haskelling
034.hs
gpl-3.0
main = do let filtered = filter valid [3..maxNum] print $ sum filtered
78
main = do let filtered = filter valid [3..maxNum] print $ sum filtered
78
main = do let filtered = filter valid [3..maxNum] print $ sum filtered
78
false
false
1
12
20
39
16
23
null
null
nushio3/ghc
compiler/iface/IfaceType.hs
bsd-3-clause
ppr_co :: TyPrec -> IfaceCoercion -> SDoc ppr_co _ (IfaceReflCo r ty) = angleBrackets (ppr ty) <> ppr_role r
116
ppr_co :: TyPrec -> IfaceCoercion -> SDoc ppr_co _ (IfaceReflCo r ty) = angleBrackets (ppr ty) <> ppr_role r
116
ppr_co _ (IfaceReflCo r ty) = angleBrackets (ppr ty) <> ppr_role r
74
false
true
0
10
26
53
24
29
null
null
wouwouwou/2017_module_8
src/haskell/PP-project-2016/Sprockell.hs
apache-2.0
-- ============================ decode :: Instruction -> MachCode decode instr = case instr of Compute c rx ry toReg -> nullcode {ldCode=LdAlu, aluCode=c, regX=rx, regY=ry, loadReg=toReg} ComputeI c rx vy toReg -> nullcode {ldCode=LdAluI, aluCode=c, regX=rx, regY=vy, immValue=vy, loadReg=toReg} ...
6,041
decode :: Instruction -> MachCode decode instr = case instr of Compute c rx ry toReg -> nullcode {ldCode=LdAlu, aluCode=c, regX=rx, regY=ry, loadReg=toReg} ComputeI c rx vy toReg -> nullcode {ldCode=LdAluI, aluCode=c, regX=rx, regY=vy, immValue=vy, loadReg=toReg} -- PP2...
6,008
decode instr = case instr of Compute c rx ry toReg -> nullcode {ldCode=LdAlu, aluCode=c, regX=rx, regY=ry, loadReg=toReg} ComputeI c rx vy toReg -> nullcode {ldCode=LdAluI, aluCode=c, regX=rx, regY=vy, immValue=vy, loadReg=toReg} -- PP26: Added computing with immediate ...
5,974
true
true
38
8
2,774
1,055
618
437
null
null
higgsd/euler
hs/113.hs
bsd-2-clause
totalNonBouncy n = sum $ map countNonBouncy [1..n]
50
totalNonBouncy n = sum $ map countNonBouncy [1..n]
50
totalNonBouncy n = sum $ map countNonBouncy [1..n]
50
false
false
0
7
7
23
11
12
null
null
DavidAlphaFox/ghc
compiler/basicTypes/Id.hs
bsd-3-clause
isDictId :: Id -> Bool isDictId id = isDictTy (idType id)
57
isDictId :: Id -> Bool isDictId id = isDictTy (idType id)
57
isDictId id = isDictTy (idType id)
34
false
true
0
7
10
27
13
14
null
null
ducis/haAni
hs/common/Graphics/UI/GLUT/Raw/Tokens.hs
gpl-2.0
glut_VERSION :: GLenum glut_VERSION = 0x01FC
44
glut_VERSION :: GLenum glut_VERSION = 0x01FC
44
glut_VERSION = 0x01FC
21
false
true
0
4
5
11
6
5
null
null
alphaHeavy/cassandra-cql
tests/example-autocreate-keyspace.hs
bsd-3-clause
insertSong :: Query Write (UUID, ByteString, Text, Bool, Int, Maybe Text) () insertSong = "insert into songs (id, title, artist, femaleSinger, timesPlayed, comment) values (?, ?, ?, ?, ?, ?)"
191
insertSong :: Query Write (UUID, ByteString, Text, Bool, Int, Maybe Text) () insertSong = "insert into songs (id, title, artist, femaleSinger, timesPlayed, comment) values (?, ?, ?, ?, ?, ?)"
191
insertSong = "insert into songs (id, title, artist, femaleSinger, timesPlayed, comment) values (?, ?, ?, ?, ?, ?)"
114
false
true
0
7
29
41
23
18
null
null
diku-dk/futhark
src/Futhark/Version.hs
isc
commitIdFromFile :: Maybe String commitIdFromFile = trim . BS.unpack <$> $(embedFileIfExists "./commit-id")
107
commitIdFromFile :: Maybe String commitIdFromFile = trim . BS.unpack <$> $(embedFileIfExists "./commit-id")
107
commitIdFromFile = trim . BS.unpack <$> $(embedFileIfExists "./commit-id")
74
false
true
0
8
11
31
15
16
null
null
jqpeterson/roc-translator
src/Protocol/ROC/PointTypes/PointType121.hs
bsd-3-clause
pointType121Parser :: Get PointType121 pointType121Parser = do tagID <- getByteString 10 slaveAddress1 <- getWord8 functionCode1 <- getWord8 slaveRegister1 <- getWord16le masterRegister1 <- getWord16le numOfRegisters1 <- getWord8 ...
7,915
pointType121Parser :: Get PointType121 pointType121Parser = do tagID <- getByteString 10 slaveAddress1 <- getWord8 functionCode1 <- getWord8 slaveRegister1 <- getWord16le masterRegister1 <- getWord16le numOfRegisters1 <- getWord8 ...
7,915
pointType121Parser = do tagID <- getByteString 10 slaveAddress1 <- getWord8 functionCode1 <- getWord8 slaveRegister1 <- getWord16le masterRegister1 <- getWord16le numOfRegisters1 <- getWord8 commStatus1 <- getWord8 ...
7,876
false
true
0
9
1,921
1,390
616
774
null
null
bkoropoff/Idris-dev
src/Idris/Docs.hs
bsd-3-clause
docClass :: Name -> ClassInfo -> Idris Docs docClass n ci = do i <- getIState let docStrings = listToMaybe $ lookupCtxt n $ idris_docstrings i docstr = maybe emptyDocstring fst docStrings params = map (\pn -> (pn, docStrings >>= (lookup pn . snd))) (class_params ci...
1,790
docClass :: Name -> ClassInfo -> Idris Docs docClass n ci = do i <- getIState let docStrings = listToMaybe $ lookupCtxt n $ idris_docstrings i docstr = maybe emptyDocstring fst docStrings params = map (\pn -> (pn, docStrings >>= (lookup pn . snd))) (class_params ci...
1,790
docClass n ci = do i <- getIState let docStrings = listToMaybe $ lookupCtxt n $ idris_docstrings i docstr = maybe emptyDocstring fst docStrings params = map (\pn -> (pn, docStrings >>= (lookup pn . snd))) (class_params ci) docsForInstance inst = fromMayb...
1,746
false
true
0
17
720
622
309
313
null
null
danstiner/transpiler
src/CSharp/Printer.hs
mit
printFile :: File -> IO () printFile (File name defs) = putStr "File " >> putStrLn name >> mapM_ printDefinition defs
117
printFile :: File -> IO () printFile (File name defs) = putStr "File " >> putStrLn name >> mapM_ printDefinition defs
117
printFile (File name defs) = putStr "File " >> putStrLn name >> mapM_ printDefinition defs
90
false
true
0
9
20
54
24
30
null
null
dorafmon/mdcat
src/Mdcat.hs
mit
renderInline :: Inline -> IO () renderInline i = case i of Str i -> putStr i Space -> putStr " " Emph i -> do setSGR [SetItalicized True, SetConsoleIntensity BoldIntensity] renderInlines i setSGR [SetItalicized False, SetConsoleIntensity NormalIntensity] Link is t -> alterColor (Set...
587
renderInline :: Inline -> IO () renderInline i = case i of Str i -> putStr i Space -> putStr " " Emph i -> do setSGR [SetItalicized True, SetConsoleIntensity BoldIntensity] renderInlines i setSGR [SetItalicized False, SetConsoleIntensity NormalIntensity] Link is t -> alterColor (SetCo...
585
renderInline i = case i of Str i -> putStr i Space -> putStr " " Emph i -> do setSGR [SetItalicized True, SetConsoleIntensity BoldIntensity] renderInlines i setSGR [SetItalicized False, SetConsoleIntensity NormalIntensity] Link is t -> alterColor (SetColor Foreground Dull Green) ((\()...
553
false
true
6
11
169
219
105
114
null
null
Peaker/chess
MapManyToOne.hs
bsd-3-clause
lookup :: (Ord k1, Ord k2) => k1 -> MapManyToOne k1 k2 -> Maybe k2 k `lookup` m = k `Map.lookup` forward m
106
lookup :: (Ord k1, Ord k2) => k1 -> MapManyToOne k1 k2 -> Maybe k2 k `lookup` m = k `Map.lookup` forward m
106
k `lookup` m = k `Map.lookup` forward m
39
false
true
0
8
22
67
33
34
null
null
avh4/elm-format
src/ElmFormat/CliFlags.hs
bsd-3-clause
json :: Opt.Parser (Maybe JsonMode) json = (Opt.flag Nothing (Just ElmToJson) $ mconcat [ Opt.long "json" , Opt.help "Instead of formatting, write the AST to stdout." , Opt.internal ] ) <|> (Opt.flag' (Just JsonToElm) $ mconcat ...
451
json :: Opt.Parser (Maybe JsonMode) json = (Opt.flag Nothing (Just ElmToJson) $ mconcat [ Opt.long "json" , Opt.help "Instead of formatting, write the AST to stdout." , Opt.internal ] ) <|> (Opt.flag' (Just JsonToElm) $ mconcat ...
451
json = (Opt.flag Nothing (Just ElmToJson) $ mconcat [ Opt.long "json" , Opt.help "Instead of formatting, write the AST to stdout." , Opt.internal ] ) <|> (Opt.flag' (Just JsonToElm) $ mconcat [ Opt.long "from-json" ,...
415
false
true
4
11
183
119
58
61
null
null
wskplho/stack
src/Stack/Setup.hs
bsd-3-clause
listInstalled :: (MonadIO m, MonadReader env m, HasConfig env, MonadThrow m) => m [PackageIdentifier] listInstalled = do dir <- asks $ configLocalPrograms . getConfig createTree dir (_, files) <- listDirectory dir return $ mapMaybe toIdent files where toIdent fp = do x <- T.s...
433
listInstalled :: (MonadIO m, MonadReader env m, HasConfig env, MonadThrow m) => m [PackageIdentifier] listInstalled = do dir <- asks $ configLocalPrograms . getConfig createTree dir (_, files) <- listDirectory dir return $ mapMaybe toIdent files where toIdent fp = do x <- T.s...
433
listInstalled = do dir <- asks $ configLocalPrograms . getConfig createTree dir (_, files) <- listDirectory dir return $ mapMaybe toIdent files where toIdent fp = do x <- T.stripSuffix ".installed" $ T.pack $ toFilePath $ filename fp parsePackageIdentifierFromString $ T.unpack x
317
false
true
0
12
107
147
69
78
null
null
cgo/jalla
Numeric/Jalla/Matrix.hs
gpl-3.0
matrixBinMap :: (Storable e1, Storable e2, Storable e3, CMatrix mat1 e1, CMatrix mat2 e2, CMatrix mat3 e3) => (e1 -> e2 -> e3) -- ^ Function /f/ to map. -> mat1 e1 -- ^ First input matrix A. -> mat2 e2 -- ^ Second input matrix B. -> mat3 e3 ...
690
matrixBinMap :: (Storable e1, Storable e2, Storable e3, CMatrix mat1 e1, CMatrix mat2 e2, CMatrix mat3 e3) => (e1 -> e2 -> e3) -- ^ Function /f/ to map. -> mat1 e1 -- ^ First input matrix A. -> mat2 e2 -- ^ Second input matrix B. -> mat3 e3 matr...
641
matrixBinMap f mat1 mat2 = unsafePerformIO $ do let (m1,n1) = shape mat1 (m2,n2) = shape mat2 m <- matrixAlloc (min m1 m2, min n1 n2) unsafeMatrixBinMap f mat1 mat2 m ret...
325
true
true
0
12
322
186
90
96
null
null
lookunder/RedmineHs
testsuite/testGet.hs
mit
testCustomFieldWithValue = TestCase $ assertEqual "Parse CustomField with value failed" refCustomField (decode customFieldWithValue)
132
testCustomFieldWithValue = TestCase $ assertEqual "Parse CustomField with value failed" refCustomField (decode customFieldWithValue)
132
testCustomFieldWithValue = TestCase $ assertEqual "Parse CustomField with value failed" refCustomField (decode customFieldWithValue)
132
false
false
0
8
12
23
11
12
null
null
spechub/Hets
Propositional/Sublogic.hs
gpl-2.0
isLiteral (AS_BASIC.Negation (AS_BASIC.Predication _) _ ) = True
64
isLiteral (AS_BASIC.Negation (AS_BASIC.Predication _) _ ) = True
64
isLiteral (AS_BASIC.Negation (AS_BASIC.Predication _) _ ) = True
64
false
false
0
10
7
27
13
14
null
null
sherwoodwang/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/Types.hs
lgpl-2.1
vecBetween :: (Num a) => Point2 a -> Point2 a -> Vector2 a vecBetween (Point x1 y1) (Point x2 y2) = Vector (x2-x1) (y2-y1)
122
vecBetween :: (Num a) => Point2 a -> Point2 a -> Vector2 a vecBetween (Point x1 y1) (Point x2 y2) = Vector (x2-x1) (y2-y1)
122
vecBetween (Point x1 y1) (Point x2 y2) = Vector (x2-x1) (y2-y1)
63
false
true
0
8
23
77
38
39
null
null
bos/base16-bytestring
Data/ByteString/Base16.hs
bsd-3-clause
decode :: ByteString -> Either String ByteString decode bs = withBS bs go where go !sptr !slen | slen == 0 = return $ Right empty | r /= 0 = return $ Left "invalid bytestring size" | otherwise = do dfp <- mallocPlainForeignPtrBytes q withForeignPtr dfp $ \dptr -> decode...
764
decode :: ByteString -> Either String ByteString decode bs = withBS bs go where go !sptr !slen | slen == 0 = return $ Right empty | r /= 0 = return $ Left "invalid bytestring size" | otherwise = do dfp <- mallocPlainForeignPtrBytes q withForeignPtr dfp $ \dptr -> decode...
764
decode bs = withBS bs go where go !sptr !slen | slen == 0 = return $ Right empty | r /= 0 = return $ Left "invalid bytestring size" | otherwise = do dfp <- mallocPlainForeignPtrBytes q withForeignPtr dfp $ \dptr -> decodeLoop dfp dptr sptr (plusPtr sptr slen) wher...
715
false
true
0
12
198
172
87
85
null
null
johnpmayer/elm-compiler
src/Parse/Helpers.hs
bsd-3-clause
withSource :: IParser a -> IParser (String, a) withSource p = do start <- getParserState result <- p endPos <- getPosition setParserState start raw <- anyUntilPos endPos return (raw, result)
224
withSource :: IParser a -> IParser (String, a) withSource p = do start <- getParserState result <- p endPos <- getPosition setParserState start raw <- anyUntilPos endPos return (raw, result)
224
withSource p = do start <- getParserState result <- p endPos <- getPosition setParserState start raw <- anyUntilPos endPos return (raw, result)
177
false
true
0
8
63
79
36
43
null
null
KommuSoft/vty-ui
src/Graphics/Vty/Widgets/Edit.hs
bsd-3-clause
-- |Compute the physical cursor position (column) for the cursor in a -- given edit widget state. The physical position is relative to the -- beginning of the current line (i.e., zero, as opposed to the -- displayStart and related state). physCursorCol :: Edit -> Phys physCursorCol s = let curLine = T.unpack $ Z.c...
440
physCursorCol :: Edit -> Phys physCursorCol s = let curLine = T.unpack $ Z.currentLine $ contents s (_, cursorColumn) = Z.cursorPosition $ contents s in toPhysical cursorColumn curLine
200
physCursorCol s = let curLine = T.unpack $ Z.currentLine $ contents s (_, cursorColumn) = Z.cursorPosition $ contents s in toPhysical cursorColumn curLine
170
true
true
0
11
85
74
38
36
null
null
octopuscabbage/genetic-sudoku
src/BackTracker/BackTracker.hs
bsd-3-clause
runBackTrackerCords:: [(Int,Int,Int)] -> Maybe (M.Matrix CellType) runBackTrackerCords inputData= evaluate starting getAllCoordinates where starting::M.Matrix CellType starting = fillInKnowns inputData -- | Same as evaluate, but prints out data as it runs
268
runBackTrackerCords:: [(Int,Int,Int)] -> Maybe (M.Matrix CellType) runBackTrackerCords inputData= evaluate starting getAllCoordinates where starting::M.Matrix CellType starting = fillInKnowns inputData -- | Same as evaluate, but prints out data as it runs
268
runBackTrackerCords inputData= evaluate starting getAllCoordinates where starting::M.Matrix CellType starting = fillInKnowns inputData -- | Same as evaluate, but prints out data as it runs
201
false
true
1
9
42
68
35
33
null
null
fpco/store
src/Data/Store/Version.hs
mit
hashedVersionConfig :: String -> VersionConfig a hashedVersionConfig hash = VersionConfig { vcExpectedHash = Just hash , vcManualName = Nothing , vcIgnore = S.empty , vcRenames = M.empty }
208
hashedVersionConfig :: String -> VersionConfig a hashedVersionConfig hash = VersionConfig { vcExpectedHash = Just hash , vcManualName = Nothing , vcIgnore = S.empty , vcRenames = M.empty }
208
hashedVersionConfig hash = VersionConfig { vcExpectedHash = Just hash , vcManualName = Nothing , vcIgnore = S.empty , vcRenames = M.empty }
159
false
true
0
8
47
62
32
30
null
null
ezyang/ghc
compiler/nativeGen/Dwarf/Constants.hs
bsd-3-clause
dW_TAG_file_type = 41
27
dW_TAG_file_type = 41
27
dW_TAG_file_type = 41
27
false
false
1
5
8
10
3
7
null
null
ianthehenry/basilica
Main.hs
mit
execute (CreatePost idParent token content) = maybe (pure BadToken) makePost =<< getUserByToken token where makePost user = do maybePost <- createPost user content idParent pure $ case (idParent, maybePost) of (_, Just post) -> NewPost post (Just idParent, Nothing) -> Pos...
423
execute (CreatePost idParent token content) = maybe (pure BadToken) makePost =<< getUserByToken token where makePost user = do maybePost <- createPost user content idParent pure $ case (idParent, maybePost) of (_, Just post) -> NewPost post (Just idParent, Nothing) -> Pos...
423
execute (CreatePost idParent token content) = maybe (pure BadToken) makePost =<< getUserByToken token where makePost user = do maybePost <- createPost user content idParent pure $ case (idParent, maybePost) of (_, Just post) -> NewPost post (Just idParent, Nothing) -> Pos...
423
false
false
0
12
111
129
63
66
null
null
CarstenKoenig/MyWebSite
src/Models/BlogPost.hs
mit
getBlogPostId :: BlogId -> SiteAction ctx (SqlResult (Maybe BlogPost)) getBlogPostId = runSqlAction . queryBlogPostId
117
getBlogPostId :: BlogId -> SiteAction ctx (SqlResult (Maybe BlogPost)) getBlogPostId = runSqlAction . queryBlogPostId
117
getBlogPostId = runSqlAction . queryBlogPostId
46
false
true
0
10
13
36
18
18
null
null
input-output-hk/pos-haskell-prototype
core/src/Pos/Core/JsonLog/Event.hs
mit
handleEvent :: (JLTimed Value -> a) -- ^ Handles events for which no handler is specified. -> [Handler a] -- ^ A list of handlers for various event types. -> JLTimedEvent -- ^ The untyped event to handle. -> a handleEvent def hs e = go hs where go [] ...
446
handleEvent :: (JLTimed Value -> a) -- ^ Handles events for which no handler is specified. -> [Handler a] -- ^ A list of handlers for various event types. -> JLTimedEvent -- ^ The untyped event to handle. -> a handleEvent def hs e = go hs where go [] ...
446
handleEvent def hs e = go hs where go [] = def $ runJLTimedEvent e go (Handler h : hs') = case fromEvent e of Right x -> h x _ -> go hs'
183
false
true
0
9
173
125
58
67
null
null
Paow/encore
src/back/CCode/PrettyCCode.hs
bsd-3-clause
pp' (IfDefine str ccode) = "#ifdef" <+> text str $+$ pp' ccode $+$ "#endif /* ifdef" <+> text str <+> "*/"
110
pp' (IfDefine str ccode) = "#ifdef" <+> text str $+$ pp' ccode $+$ "#endif /* ifdef" <+> text str <+> "*/"
110
pp' (IfDefine str ccode) = "#ifdef" <+> text str $+$ pp' ccode $+$ "#endif /* ifdef" <+> text str <+> "*/"
110
false
false
0
10
24
46
21
25
null
null
hausdorff/pyli
src/Parser.hs
mit
elseClause :: Parser String elseClause = noElseClause <|> elseKeyword <~> colon <~> block ==> emitElseClause where noElseClause = eps "" elseKeyword = ter "else" colon = ter ":" block = suite
242
elseClause :: Parser String elseClause = noElseClause <|> elseKeyword <~> colon <~> block ==> emitElseClause where noElseClause = eps "" elseKeyword = ter "else" colon = ter ":" block = suite
242
elseClause = noElseClause <|> elseKeyword <~> colon <~> block ==> emitElseClause where noElseClause = eps "" elseKeyword = ter "else" colon = ter ":" block = suite
214
false
true
5
7
81
75
34
41
null
null
gallais/potpourri
haskell/cyclic/CyclicList.hs
gpl-3.0
unsafeTail :: List a -> List a unsafeTail = fromJust . tail
59
unsafeTail :: List a -> List a unsafeTail = fromJust . tail
59
unsafeTail = fromJust . tail
28
false
true
0
6
11
25
12
13
null
null
KommuSoft/vty-ui
test/src/Tests/Util.hs
bsd-3-clause
count f (a:as) = count f as + if f a then 1 else 0
50
count f (a:as) = count f as + if f a then 1 else 0
50
count f (a:as) = count f as + if f a then 1 else 0
50
false
false
0
7
14
38
19
19
null
null
urbanslug/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
typeable5ClassKey = mkPreludeClassUnique 25
49
typeable5ClassKey = mkPreludeClassUnique 25
49
typeable5ClassKey = mkPreludeClassUnique 25
49
false
false
0
5
9
9
4
5
null
null
green-haskell/ghc
compiler/hsSyn/HsBinds.hs
bsd-3-clause
isDefaultMethod (SpecPrags {}) = False
39
isDefaultMethod (SpecPrags {}) = False
39
isDefaultMethod (SpecPrags {}) = False
39
false
false
0
7
5
16
8
8
null
null
tjakway/ghcjvm
compiler/basicTypes/Module.hs
bsd-3-clause
dphParUnitId = fsToUnitId (fsLit "dph-par")
48
dphParUnitId = fsToUnitId (fsLit "dph-par")
48
dphParUnitId = fsToUnitId (fsLit "dph-par")
48
false
false
0
7
9
15
7
8
null
null
Thell/pandoc
src/Text/Pandoc/Writers/ConTeXt.hs
gpl-2.0
inlineToConTeXt (Code _ str) = do opts <- gets stOptions return $ "\\mono" <> braces (text $ stringToConTeXt opts str)
122
inlineToConTeXt (Code _ str) = do opts <- gets stOptions return $ "\\mono" <> braces (text $ stringToConTeXt opts str)
122
inlineToConTeXt (Code _ str) = do opts <- gets stOptions return $ "\\mono" <> braces (text $ stringToConTeXt opts str)
122
false
false
0
11
23
53
24
29
null
null
shayan-najd/QHaskell
QHaskell/Environment/Typed.hs
gpl-3.0
foldl :: (forall t. b -> tfa t -> b) -> b -> Env tfa r -> b foldl _ z Emp = z
84
foldl :: (forall t. b -> tfa t -> b) -> b -> Env tfa r -> b foldl _ z Emp = z
84
foldl _ z Emp = z
24
false
true
0
10
30
54
27
27
null
null
benjaminjkraft/nmines
Draw.hs
mit
drawQuestion :: Double -> [Double] -> Render () drawQuestion s [x,y] = do setSourceRGB 0 0 1 setFontSize (2*s/3) extents <- textExtents "?" moveTo (x - textExtentsXbearing extents - (textExtentsWidth extents)/2) (y + (textExtentsHeight extents)/2) showText "?"
270
drawQuestion :: Double -> [Double] -> Render () drawQuestion s [x,y] = do setSourceRGB 0 0 1 setFontSize (2*s/3) extents <- textExtents "?" moveTo (x - textExtentsXbearing extents - (textExtentsWidth extents)/2) (y + (textExtentsHeight extents)/2) showText "?"
270
drawQuestion s [x,y] = do setSourceRGB 0 0 1 setFontSize (2*s/3) extents <- textExtents "?" moveTo (x - textExtentsXbearing extents - (textExtentsWidth extents)/2) (y + (textExtentsHeight extents)/2) showText "?"
222
false
true
0
12
46
130
62
68
null
null
themattchan/tandoori
input/let-monoenv.hs
bsd-3-clause
undefined = undefined
21
undefined = undefined
21
undefined = undefined
21
false
false
1
5
2
10
3
7
null
null
romanb/amazonka
amazonka-lambda/gen/Network/AWS/Lambda/UpdateFunctionCode.hs
mpl-2.0
-- | The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it -- executes your function to access any other Amazon Web Services (AWS) -- resources. ufcrRole :: Lens' UpdateFunctionCodeResponse (Maybe Text) ufcrRole = lens _ufcrRole (\s a -> s { _ufcrRole = a })
279
ufcrRole :: Lens' UpdateFunctionCodeResponse (Maybe Text) ufcrRole = lens _ufcrRole (\s a -> s { _ufcrRole = a })
113
ufcrRole = lens _ufcrRole (\s a -> s { _ufcrRole = a })
55
true
true
0
9
48
48
27
21
null
null
frantisekfarka/ghc-dsi
libraries/base/Data/List.hs
bsd-3-clause
findIndices p xs = [ i | (x,i) <- zip xs [0..], p x]
52
findIndices p xs = [ i | (x,i) <- zip xs [0..], p x]
52
findIndices p xs = [ i | (x,i) <- zip xs [0..], p x]
52
false
false
0
9
13
43
22
21
null
null
mydaum/cabal
cabal-install/Distribution/Client/ProjectPlanning/Types.hs
bsd-3-clause
elabOrderLibDependencies :: ElaboratedConfiguredPackage -> [UnitId] elabOrderLibDependencies elab = case elabPkgOrComp elab of ElabPackage pkg -> map (newSimpleUnitId . confInstId) $ ordNub $ CD.flatDeps (pkgLibDependencies pkg) ElabComponent comp -> compOrderLibDepe...
536
elabOrderLibDependencies :: ElaboratedConfiguredPackage -> [UnitId] elabOrderLibDependencies elab = case elabPkgOrComp elab of ElabPackage pkg -> map (newSimpleUnitId . confInstId) $ ordNub $ CD.flatDeps (pkgLibDependencies pkg) ElabComponent comp -> compOrderLibDepe...
536
elabOrderLibDependencies elab = case elabPkgOrComp elab of ElabPackage pkg -> map (newSimpleUnitId . confInstId) $ ordNub $ CD.flatDeps (pkgLibDependencies pkg) ElabComponent comp -> compOrderLibDependencies comp -- | The library dependencies (i.e., the libraries we...
468
false
true
7
10
115
67
35
32
null
null
CarstenKoenig/DOS2015
CountdownGame/src/web/CountdownGame/State/Rounds.hs
unlicense
warteBis :: UTCTime -> IO () warteBis zeit = do now <- getCurrentTime if now < zeit then do threadDelay 250000 warteBis zeit else return ()
153
warteBis :: UTCTime -> IO () warteBis zeit = do now <- getCurrentTime if now < zeit then do threadDelay 250000 warteBis zeit else return ()
153
warteBis zeit = do now <- getCurrentTime if now < zeit then do threadDelay 250000 warteBis zeit else return ()
124
false
true
0
10
39
62
28
34
null
null
eijian/raytracer
src/Ray/Physics.hs
bsd-3-clause
minColor :: Color minColor = Color (1/10000) (1/10000) (1/10000)
64
minColor :: Color minColor = Color (1/10000) (1/10000) (1/10000)
64
minColor = Color (1/10000) (1/10000) (1/10000)
46
false
true
0
7
8
39
21
18
null
null
sergsr/algos-and-data-structs
haskell/misc/PairingHeap.hs
mit
-- | Construct from a list fromList :: (Ord k) => [k] -> PairingHeap k fromList = mconcat . fmap single
103
fromList :: (Ord k) => [k] -> PairingHeap k fromList = mconcat . fmap single
76
fromList = mconcat . fmap single
32
true
true
0
7
20
38
20
18
null
null
rpereira/servant-blog
src/DB.hs
bsd-3-clause
migrations = [ migrateArticle , migrateComment , migrateFavorite , migrateUser , migrateUserFollower , migrateTag , migrateTagging ]
164
migrations = [ migrateArticle , migrateComment , migrateFavorite , migrateUser , migrateUserFollower , migrateTag , migrateTagging ]
164
migrations = [ migrateArticle , migrateComment , migrateFavorite , migrateUser , migrateUserFollower , migrateTag , migrateTagging ]
164
false
false
1
5
48
30
17
13
null
null
parsonsmatt/cis194
hw3/Golf.hs
apache-2.0
-- Remove all-space strings: removeSpaces :: [String] -> [String] removeSpaces = filter (any (/=' '))
101
removeSpaces :: [String] -> [String] removeSpaces = filter (any (/=' '))
72
removeSpaces = filter (any (/=' '))
35
true
true
0
8
14
42
21
21
null
null
imeckler/mote
Mote/GhcUtil.hs
bsd-3-clause
discardConstraints :: TcRn a -> TcRn a discardConstraints = fmap fst . captureConstraints
89
discardConstraints :: TcRn a -> TcRn a discardConstraints = fmap fst . captureConstraints
89
discardConstraints = fmap fst . captureConstraints
50
false
true
0
6
12
28
13
15
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Campaigns/List.hs
mpl-2.0
-- | Select only campaigns with these IDs. clIds :: Lens' CampaignsList [Int64] clIds = lens _clIds (\ s a -> s{_clIds = a}) . _Default . _Coerce
153
clIds :: Lens' CampaignsList [Int64] clIds = lens _clIds (\ s a -> s{_clIds = a}) . _Default . _Coerce
110
clIds = lens _clIds (\ s a -> s{_clIds = a}) . _Default . _Coerce
73
true
true
0
11
35
53
28
25
null
null
jwiegley/script-template
Main.hs
bsd-3-clause
doMain :: IO () doMain = shelly $ silently $ do criticalL "The real work of foo goes here" ------------------------------------------------------------------------------- -- matchText :: Text -> Text -> Bool -- matchText = flip ((=~) `on` T.unpack)
254
doMain :: IO () doMain = shelly $ silently $ do criticalL "The real work of foo goes here" ------------------------------------------------------------------------------- -- matchText :: Text -> Text -> Bool -- matchText = flip ((=~) `on` T.unpack)
254
doMain = shelly $ silently $ do criticalL "The real work of foo goes here" ------------------------------------------------------------------------------- -- matchText :: Text -> Text -> Bool -- matchText = flip ((=~) `on` T.unpack)
238
false
true
0
8
40
33
17
16
null
null
shlomobauer/BuildIT
src/OutBuild.hs
apache-2.0
obuildloadbalancebl h (BlockList a b) = do obuildloadbalancebl h a obuildloadbalanceb h b -- KBlock String CnstrList LBlockList IRoute
137
obuildloadbalancebl h (BlockList a b) = do obuildloadbalancebl h a obuildloadbalanceb h b -- KBlock String CnstrList LBlockList IRoute
137
obuildloadbalancebl h (BlockList a b) = do obuildloadbalancebl h a obuildloadbalanceb h b -- KBlock String CnstrList LBlockList IRoute
137
false
false
0
7
21
36
16
20
null
null
gridaphobe/ghc
compiler/typecheck/TcEvidence.hs
bsd-3-clause
evVarsOfTerm (EvTypeable _ ev) = evVarsOfTypeable ev
55
evVarsOfTerm (EvTypeable _ ev) = evVarsOfTypeable ev
55
evVarsOfTerm (EvTypeable _ ev) = evVarsOfTypeable ev
55
false
false
0
7
9
20
9
11
null
null
HJvT/com
System/Win32/Com/HDirect/HDirect.hs
bsd-3-clause
unmarshallByte :: Byte -> IO Byte unmarshallByte = unmarshallWord8
66
unmarshallByte :: Byte -> IO Byte unmarshallByte = unmarshallWord8
66
unmarshallByte = unmarshallWord8
32
false
true
0
6
8
18
9
9
null
null
spechub/Hets
Common/Doc.hs
gpl-2.0
textToHtml :: Label -> Set.Set Id -> TextKind -> String -> Pretty.Doc textToHtml lbl@(MkLabel mkLbl) dis k s = let e = escapeHtml s "" h = Pretty.text e zeroText = Pretty.sizedText 0 tagB t = '<' : t ++ ">" tagE t = tagB $ '/' : t tag t d = Pretty.hcat [zeroText (tagB t), d, zeroText (tagE t) ] tagBold = ...
926
textToHtml :: Label -> Set.Set Id -> TextKind -> String -> Pretty.Doc textToHtml lbl@(MkLabel mkLbl) dis k s = let e = escapeHtml s "" h = Pretty.text e zeroText = Pretty.sizedText 0 tagB t = '<' : t ++ ">" tagE t = tagB $ '/' : t tag t d = Pretty.hcat [zeroText (tagB t), d, zeroText (tagE t) ] tagBold = ...
926
textToHtml lbl@(MkLabel mkLbl) dis k s = let e = escapeHtml s "" h = Pretty.text e zeroText = Pretty.sizedText 0 tagB t = '<' : t ++ ">" tagE t = tagB $ '/' : t tag t d = Pretty.hcat [zeroText (tagB t), d, zeroText (tagE t) ] tagBold = tag "strong" hi = tag "em" h in case k of Native -> Pretty.text...
856
false
true
0
20
279
412
202
210
null
null
cobbpg/elerea
FRP/Elerea/Simple.hs
bsd-3-clause
effectful4 :: (t1 -> t2 -> t3 -> t4 -> IO a) -- ^ the action to be executed repeatedly -> Signal t1 -- ^ parameter signal 1 -> Signal t2 -- ^ parameter signal 2 -> Signal t3 -- ^ parameter signal 3 -> Signal t4 ...
680
effectful4 :: (t1 -> t2 -> t3 -> t4 -> IO a) -- ^ the action to be executed repeatedly -> Signal t1 -- ^ parameter signal 1 -> Signal t2 -- ^ parameter signal 2 -> Signal t3 -- ^ parameter signal 3 -> Signal t4 ...
680
effectful4 act (S s1) (S s2) (S s3) (S s4) = SG $ \pool -> do ref <- newIORef (Ready undefined) let sample = join (liftM4 act s1 s2 s3 s4) >>= memoise ref addSignal (const sample) (const (() <$ sample)) ref pool -- | The Show instance is only defined for the sake of Num...
282
false
true
0
15
259
206
101
105
null
null
bitemyapp/ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
pprPat i (BangP p) = parensIf (i > noPrec) $ char '!' <> pprPat appPrec p
76
pprPat i (BangP p) = parensIf (i > noPrec) $ char '!' <> pprPat appPrec p
76
pprPat i (BangP p) = parensIf (i > noPrec) $ char '!' <> pprPat appPrec p
76
false
false
0
8
18
45
20
25
null
null
klpn/highlighting-kate
Text/Highlighting/Kate/Common.hs
gpl-2.0
normalizeHighlighting ((_,""):xs) = normalizeHighlighting xs
60
normalizeHighlighting ((_,""):xs) = normalizeHighlighting xs
60
normalizeHighlighting ((_,""):xs) = normalizeHighlighting xs
60
false
false
0
7
4
26
13
13
null
null
portnov/simple-pascal-compiler
spc-jvm/Language/Pascal/JVM/CodeGen.hs
lgpl-3.0
getProcedureSig :: Throws (Located GeneratorError) e => Id -> SymbolTable -> GenerateJvm e MethodSignature getProcedureSig name table = do t <- getSymbolType name table case t of TFunction argTypes TVoid -> return $ MethodSignature (map getJvmType argTypes) ReturnsVoid _ -> failCheck GeneratorError ...
358
getProcedureSig :: Throws (Located GeneratorError) e => Id -> SymbolTable -> GenerateJvm e MethodSignature getProcedureSig name table = do t <- getSymbolType name table case t of TFunction argTypes TVoid -> return $ MethodSignature (map getJvmType argTypes) ReturnsVoid _ -> failCheck GeneratorError ...
358
getProcedureSig name table = do t <- getSymbolType name table case t of TFunction argTypes TVoid -> return $ MethodSignature (map getJvmType argTypes) ReturnsVoid _ -> failCheck GeneratorError $ "Invalid procedure type: " ++ show t
251
false
true
0
13
69
111
51
60
null
null
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Input/InputConstants.hs
mit
hatUp :: Int hatUp = fromIntegral $ [C.pure| int {HAT_UP} |]
60
hatUp :: Int hatUp = fromIntegral $ [C.pure| int {HAT_UP} |]
60
hatUp = fromIntegral $ [C.pure| int {HAT_UP} |]
47
false
true
0
6
10
21
13
8
null
null
triplepointfive/wmexchanger
src/API/WebMoney/Internal/Parser.hs
mit
parseDate :: String -> Maybe UTCTime parseDate = parseTime defaultTimeLocale "%Y-%m-%dT%H:%M:%Z" . takeWhile (/='.')
116
parseDate :: String -> Maybe UTCTime parseDate = parseTime defaultTimeLocale "%Y-%m-%dT%H:%M:%Z" . takeWhile (/='.')
116
parseDate = parseTime defaultTimeLocale "%Y-%m-%dT%H:%M:%Z" . takeWhile (/='.')
79
false
true
0
7
13
39
18
21
null
null
badp/ganeti
src/Ganeti/Confd/Server.hs
gpl-2.0
-- | Unknown entry standard response. queryUnknownEntry :: StatusAnswer queryUnknownEntry = (ReplyStatusError, J.showJSON ConfdErrorUnknownEntry)
145
queryUnknownEntry :: StatusAnswer queryUnknownEntry = (ReplyStatusError, J.showJSON ConfdErrorUnknownEntry)
107
queryUnknownEntry = (ReplyStatusError, J.showJSON ConfdErrorUnknownEntry)
73
true
true
0
7
13
23
13
10
null
null
thoughtpolice/hs-noise
src/Crypto/Network/Noise.hs
mit
-- -- Client -- {- $client-side Here's an example of a Noise client: @ 'connect' \"www.example.org\" \"80\" 'defaultPipeConfig' $ \\(ctx, remoteAddr) -> do putStrLn $ \"Connection established to \" ++ show remoteAddr -- Now you can use connSock as you see fit with 'send' and 'recv'. -- The socket handle will a...
1,734
connect :: (MonadIO m, C.MonadCatch m) => NS.HostName -- ^ Server hostname -> NS.ServiceName -- ^ Server port -> PipeConfig -- ^ Client configuration -> ((Context, NS.SockAddr) -> m r) -- ^ Connection handler -> m r connect hostPref serviceName conf k = NS.connect hostPref s...
1,181
connect hostPref serviceName conf k = NS.connect hostPref serviceName $ \(socket, sockAddr) -> do streams <- liftIO $ (S.socketToStreams >=> pipeClientStream conf) socket k ((Context socket streams), sockAddr) -- -- Server -- {- $server-side Here's an example of a Noise server: @ 'serve' ('NS.Host' \"127....
922
true
true
0
14
343
171
99
72
null
null
beni55/text
tests/Tests/Properties.hs
bsd-2-clause
tl_foldr f z = unsquare $ L.foldr f z `eqP` TL.foldr f z where _types = f :: Char -> Char -> Char
128
tl_foldr f z = unsquare $ L.foldr f z `eqP` TL.foldr f z where _types = f :: Char -> Char -> Char
128
tl_foldr f z = unsquare $ L.foldr f z `eqP` TL.foldr f z where _types = f :: Char -> Char -> Char
128
false
false
0
8
53
53
27
26
null
null
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/CreateVolume.hs
mpl-2.0
-- | The ID of the volume. cvrVolumeId :: Lens' CreateVolumeResponse Text cvrVolumeId = lens _cvrVolumeId (\s a -> s { _cvrVolumeId = a })
138
cvrVolumeId :: Lens' CreateVolumeResponse Text cvrVolumeId = lens _cvrVolumeId (\s a -> s { _cvrVolumeId = a })
111
cvrVolumeId = lens _cvrVolumeId (\s a -> s { _cvrVolumeId = a })
64
true
true
0
9
24
40
22
18
null
null
lukexi/ghc-7.8-arm64
testsuite/tests/mdo/should_compile/mdo002.hs
bsd-3-clause
z :: X [Int] z = mdo x <- return (1:x) return (take 4 x)
57
z :: X [Int] z = mdo x <- return (1:x) return (take 4 x)
57
z = mdo x <- return (1:x) return (take 4 x)
44
false
true
1
10
15
51
23
28
null
null
esengie/fpl-exploration-tool
src/langGenerator/CodeGen/RightSide/Exprs.hs
bsd-3-clause
buildEq (Reduct{}) = throwError $ "Reduct in infer is an implem error"
70
buildEq (Reduct{}) = throwError $ "Reduct in infer is an implem error"
70
buildEq (Reduct{}) = throwError $ "Reduct in infer is an implem error"
70
false
false
0
7
11
20
10
10
null
null
jfranklin9000/urbit
pkg/hs/urbit-king/lib/Urbit/Noun/Core.hs
mit
genAtom :: Gen Atom genAtom = do arbitrary >>= \case False -> genNatural True -> (`mod` 16) <$> genNatural --------------------------------------------------------------------------------
201
genAtom :: Gen Atom genAtom = do arbitrary >>= \case False -> genNatural True -> (`mod` 16) <$> genNatural --------------------------------------------------------------------------------
201
genAtom = do arbitrary >>= \case False -> genNatural True -> (`mod` 16) <$> genNatural --------------------------------------------------------------------------------
181
false
true
0
12
33
46
25
21
null
null
jystic/language-scala
src/Language/Scala/Context.hs
bsd-3-clause
(??>) :: (HasContext a, HasContext b) => a -> Maybe b -> a x ??> (Nothing) = x
78
(??>) :: (HasContext a, HasContext b) => a -> Maybe b -> a x ??> (Nothing) = x
78
x ??> (Nothing) = x
19
false
true
0
10
17
53
26
27
null
null
foreverbell/project-euler-solutions
lib/Common/MapReduce.hs
bsd-3-clause
mapReduce' :: (NFData b) => Int -> Int -> (a -> b) -> ([b] -> b) -> [a] -> b mapReduce' block chunk mapFunc reduceFunc xs = fstReduce `pseq` sndReduce where fstReduce = map (mapReduce chunk mapFunc reduceFunc) (divide block xs) sndReduce = reduceFunc fstReduce `using` rdeepseq
287
mapReduce' :: (NFData b) => Int -> Int -> (a -> b) -> ([b] -> b) -> [a] -> b mapReduce' block chunk mapFunc reduceFunc xs = fstReduce `pseq` sndReduce where fstReduce = map (mapReduce chunk mapFunc reduceFunc) (divide block xs) sndReduce = reduceFunc fstReduce `using` rdeepseq
287
mapReduce' block chunk mapFunc reduceFunc xs = fstReduce `pseq` sndReduce where fstReduce = map (mapReduce chunk mapFunc reduceFunc) (divide block xs) sndReduce = reduceFunc fstReduce `using` rdeepseq
210
false
true
2
12
56
133
66
67
null
null
Copilot-Language/sbv-for-copilot
Data/SBV/SMT/SMTLib2.hs
bsd-3-clause
-- NB. We perform no check to as to whether the axiom is meaningful in any way. declAx :: (String, [String]) -> String declAx (nm, ls) = (";; -- user given axiom: " ++ nm ++ "\n") ++ intercalate "\n" ls
202
declAx :: (String, [String]) -> String declAx (nm, ls) = (";; -- user given axiom: " ++ nm ++ "\n") ++ intercalate "\n" ls
122
declAx (nm, ls) = (";; -- user given axiom: " ++ nm ++ "\n") ++ intercalate "\n" ls
83
true
true
0
8
40
54
30
24
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/HTMLImageElement.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement.x Mozilla HTMLImageElement.x documentation> getX :: (MonadDOM m) => HTMLImageElement -> m Int getX self = liftDOM (round <$> ((self ^. js "x") >>= valToNumber))
233
getX :: (MonadDOM m) => HTMLImageElement -> m Int getX self = liftDOM (round <$> ((self ^. js "x") >>= valToNumber))
116
getX self = liftDOM (round <$> ((self ^. js "x") >>= valToNumber))
66
true
true
0
12
27
58
30
28
null
null
Happy0/snowdrift
Handler/Wiki/Comment.hs
agpl-3.0
postUnclaimWikiCommentR :: Text -> Text -> CommentId -> Handler Html postUnclaimWikiCommentR project_handle target comment_id = do (user, (Entity project_id _), _, comment) <- checkCommentPageRequireAuth project_handle target comment_id checkProjectCommentActionPermission can_unclaim user project_handle (Entity...
923
postUnclaimWikiCommentR :: Text -> Text -> CommentId -> Handler Html postUnclaimWikiCommentR project_handle target comment_id = do (user, (Entity project_id _), _, comment) <- checkCommentPageRequireAuth project_handle target comment_id checkProjectCommentActionPermission can_unclaim user project_handle (Entity...
923
postUnclaimWikiCommentR project_handle target comment_id = do (user, (Entity project_id _), _, comment) <- checkCommentPageRequireAuth project_handle target comment_id checkProjectCommentActionPermission can_unclaim user project_handle (Entity comment_id comment) postUnclaimComment user comment...
854
false
true
0
14
151
182
91
91
null
null
bionikspoon/playing-with-haskell---oreilly
ch05/PrettyJSON.hs
mit
smallHex :: Int -> Doc smallHex x = text "\\u" <> text (replicate (4 - length h) '0') <> text h where h = showHex x ""
148
smallHex :: Int -> Doc smallHex x = text "\\u" <> text (replicate (4 - length h) '0') <> text h where h = showHex x ""
148
smallHex x = text "\\u" <> text (replicate (4 - length h) '0') <> text h where h = showHex x ""
125
false
true
5
9
56
76
32
44
null
null
kosmoskatten/nats-client
tests/Network/Nats/MessageProps.hs
mit
perhaps :: Gen a -> Gen (Maybe a) perhaps gen = oneof [ return Nothing, Just <$> gen ]
86
perhaps :: Gen a -> Gen (Maybe a) perhaps gen = oneof [ return Nothing, Just <$> gen ]
86
perhaps gen = oneof [ return Nothing, Just <$> gen ]
52
false
true
0
8
18
46
22
24
null
null
JohanPauli/Hunger
src/IO/Parse/Util.hs
gpl-3.0
-- | Parse a string encased in parseString :: Parser String parseString = do _ <- char '"' str <- takeTill (=='"') _ <- char '"' return (unpack str) -- | Parse a complex number as a double.
198
parseString :: Parser String parseString = do _ <- char '"' str <- takeTill (=='"') _ <- char '"' return (unpack str) -- | Parse a complex number as a double.
167
parseString = do _ <- char '"' str <- takeTill (=='"') _ <- char '"' return (unpack str) -- | Parse a complex number as a double.
138
true
true
0
9
46
62
29
33
null
null
5outh/Elm
src/Generate/JavaScript.hs
bsd-3-clause
-- DEFINITIONS definitions :: [Optimized.Def] -> [Statement ()] definitions defs = let setup = Var.define "_op" (ObjectLit () []) in setup : State.evalState (mapM JS.generateDef defs) 0
205
definitions :: [Optimized.Def] -> [Statement ()] definitions defs = let setup = Var.define "_op" (ObjectLit () []) in setup : State.evalState (mapM JS.generateDef defs) 0
188
definitions defs = let setup = Var.define "_op" (ObjectLit () []) in setup : State.evalState (mapM JS.generateDef defs) 0
139
true
true
0
12
46
83
41
42
null
null
Denommus/stack
scripts/release/release.hs
bsd-3-clause
-- | Name of the 'stack' program. stackProgName :: FilePath stackProgName = "stack"
83
stackProgName :: FilePath stackProgName = "stack"
49
stackProgName = "stack"
23
true
true
0
4
12
12
7
5
null
null
bitemyapp/github
samples/Issues/Milestones/ShowMilestones.hs
bsd-3-clause
formatDueOn Nothing = ""
24
formatDueOn Nothing = ""
24
formatDueOn Nothing = ""
24
false
false
0
5
3
9
4
5
null
null
pbl64k/HackerRank-Contests
2014-10-10-FP/Infer/i.nlp2.hs
bsd-2-clause
disp c m (Pair t1 t2) = ("pair[" ++ str1 ++ ", " ++ str2 ++ "]", c'', m'') where (str1, c', m') = disp c m t1 (str2, c'', m'') = disp c' m' t2
162
disp c m (Pair t1 t2) = ("pair[" ++ str1 ++ ", " ++ str2 ++ "]", c'', m'') where (str1, c', m') = disp c m t1 (str2, c'', m'') = disp c' m' t2
162
disp c m (Pair t1 t2) = ("pair[" ++ str1 ++ ", " ++ str2 ++ "]", c'', m'') where (str1, c', m') = disp c m t1 (str2, c'', m'') = disp c' m' t2
162
false
false
0
9
55
92
49
43
null
null
xenog/haskoin
src/Network/Haskoin/Crypto/Keys.hs
unlicense
-- | Tweak a compressed public key tweakPubKeyC :: PubKeyC -> Hash256 -> Maybe PubKeyC tweakPubKeyC pub h = makePubKeyC <$> (EC.tweakAddPubKey point =<< tweak) where point = pubKeyPoint pub tweak = EC.tweak (encode h) {- Private Keys -} -- | Elliptic curve private key type. Two constructors are provided...
569
tweakPubKeyC :: PubKeyC -> Hash256 -> Maybe PubKeyC tweakPubKeyC pub h = makePubKeyC <$> (EC.tweakAddPubKey point =<< tweak) where point = pubKeyPoint pub tweak = EC.tweak (encode h) {- Private Keys -} -- | Elliptic curve private key type. Two constructors are provided for creating -- compressed or unco...
534
tweakPubKeyC pub h = makePubKeyC <$> (EC.tweakAddPubKey point =<< tweak) where point = pubKeyPoint pub tweak = EC.tweak (encode h) {- Private Keys -} -- | Elliptic curve private key type. Two constructors are provided for creating -- compressed or uncompressed private keys. Compression information is st...
482
true
true
1
9
105
77
41
36
null
null
ptol/oczor
src/Oczor/Parser/Expr.hs
mit
anonFuncRaw :: Parser Expr anonFuncRaw = liftA2 (uncurry Function) (try anonFuncParamGuard) record
98
anonFuncRaw :: Parser Expr anonFuncRaw = liftA2 (uncurry Function) (try anonFuncParamGuard) record
98
anonFuncRaw = liftA2 (uncurry Function) (try anonFuncParamGuard) record
71
false
true
0
7
11
33
16
17
null
null
intolerable/naive-bayes
src/Data/Classifier.hs
bsd-3-clause
totalInClass :: Ord b => Classifier a b -> Counter a totalInClass = Counter.fromMap . fmap Counter.total . countInClass
119
totalInClass :: Ord b => Classifier a b -> Counter a totalInClass = Counter.fromMap . fmap Counter.total . countInClass
119
totalInClass = Counter.fromMap . fmap Counter.total . countInClass
66
false
true
0
8
18
45
21
24
null
null
crclark/functional-pearls
src/Weave/Section2.hs
bsd-3-clause
reassemble t = reassemble $ up t
32
reassemble t = reassemble $ up t
32
reassemble t = reassemble $ up t
32
false
false
0
6
6
16
7
9
null
null
bitemyapp/Haskell-Turtle-Library
src/Turtle/Prelude.hs
bsd-3-clause
{-| Create a directory tree (equivalent to @mkdir -p@) Does not fail if the directory is present -} mktree :: MonadIO io => FilePath -> io () mktree path = liftIO (Filesystem.createTree path)
196
mktree :: MonadIO io => FilePath -> io () mktree path = liftIO (Filesystem.createTree path)
91
mktree path = liftIO (Filesystem.createTree path)
49
true
true
0
8
37
42
20
22
null
null