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
fibsifan/pandoc
src/Text/Pandoc/Readers/Docx/Parse.hs
gpl-2.0
filePathToRelType _ = Nothing
29
filePathToRelType _ = Nothing
29
filePathToRelType _ = Nothing
29
false
false
0
5
3
9
4
5
null
null
plow-technologies/persistent
persistent-redis/Database/Persist/Redis/Store.hs
mit
desugar :: R.TxResult a -> Either String a desugar (R.TxSuccess x) = Right x
77
desugar :: R.TxResult a -> Either String a desugar (R.TxSuccess x) = Right x
77
desugar (R.TxSuccess x) = Right x
34
false
true
0
10
14
44
19
25
null
null
svenssonjoel/EmbArBB
Samples/Bench/matrix_mult.hs
bsd-3-clause
diffms :: TimeDiff -> Float diffms diff | tdYear diff == 0 && tdMonth diff == 0 && tdDay diff == 0 && tdMin diff == 0 && tdHour diff == 0 = (fromIntegral ps) * 1E-9 + (fromIntegral sec) * 1000 where ps = tdPicosec diff sec = tdSec diff
396
diffms :: TimeDiff -> Float diffms diff | tdYear diff == 0 && tdMonth diff == 0 && tdDay diff == 0 && tdMin diff == 0 && tdHour diff == 0 = (fromIntegral ps) * 1E-9 + (fromIntegral sec) * 1000 where ps = tdPicosec diff sec = tdSec diff
396
diffms diff | tdYear diff == 0 && tdMonth diff == 0 && tdDay diff == 0 && tdMin diff == 0 && tdHour diff == 0 = (fromIntegral ps) * 1E-9 + (fromIntegral sec) * 1000 where ps = tdPicosec diff sec = tdSec diff
368
false
true
0
17
211
120
56
64
null
null
nevrenato/Hets_Fork
THF/ParseTHF.hs
gpl-2.0
term :: CharParser st Term term = fmap T_Function_Term functionTerm <|> fmap T_Variable variable
98
term :: CharParser st Term term = fmap T_Function_Term functionTerm <|> fmap T_Variable variable
98
term = fmap T_Function_Term functionTerm <|> fmap T_Variable variable
71
false
true
3
5
15
33
16
17
null
null
syucream/hastodon
Web/Hastodon/Option.hs
mit
sinceId :: IsRangeOption a => StatusId -> a sinceId i = mkOption "since_id" $ Just $ show i
91
sinceId :: IsRangeOption a => StatusId -> a sinceId i = mkOption "since_id" $ Just $ show i
91
sinceId i = mkOption "since_id" $ Just $ show i
47
false
true
0
7
17
39
18
21
null
null
damoxc/ganeti
src/Ganeti/Objects.hs
gpl-2.0
lidDiskType (LIDFile {}) = LD_FILE
35
lidDiskType (LIDFile {}) = LD_FILE
35
lidDiskType (LIDFile {}) = LD_FILE
35
false
false
0
7
5
16
8
8
null
null
clarkcb/xsearch
haskell/hssearch/src/HsSearch/Searcher.hs
mit
searchTextFileLines :: SearchSettings -> FilePath -> IO [SearchResult] searchTextFileLines settings f = do fileLinesEither <- getFileLines f case fileLinesEither of (Left _) -> return [] -- todo: figure out to relay error (Right fileLines) -> return $ addFilePath (searchLines settings fileLines) where addFilePath = map (\r -> r {filePath=f})
357
searchTextFileLines :: SearchSettings -> FilePath -> IO [SearchResult] searchTextFileLines settings f = do fileLinesEither <- getFileLines f case fileLinesEither of (Left _) -> return [] -- todo: figure out to relay error (Right fileLines) -> return $ addFilePath (searchLines settings fileLines) where addFilePath = map (\r -> r {filePath=f})
357
searchTextFileLines settings f = do fileLinesEither <- getFileLines f case fileLinesEither of (Left _) -> return [] -- todo: figure out to relay error (Right fileLines) -> return $ addFilePath (searchLines settings fileLines) where addFilePath = map (\r -> r {filePath=f})
286
false
true
0
13
62
119
59
60
null
null
mjansen/tcp-stream
src/TCPDumpParser1.hs
gpl-3.0
rebase x0 rs = map (\(Interval x1 x2) -> Interval (x1 - x0) (x2 - x0)) rs
73
rebase x0 rs = map (\(Interval x1 x2) -> Interval (x1 - x0) (x2 - x0)) rs
73
rebase x0 rs = map (\(Interval x1 x2) -> Interval (x1 - x0) (x2 - x0)) rs
73
false
false
0
10
16
51
26
25
null
null
solatis/haskell-base58string
src/Data/Base58String.hs
mit
-- | Smart constructor which validates that all the text are actually -- base-58 characters. b58String :: BS.ByteString -- ^ Our Base58 mapping table -> BS.ByteString -- ^ Our Base58 string -> Base58String b58String table bs = if BS.all (isValidBase58 table) bs then Base58String bs else error ("Not a valid base58 string: " ++ show bs)
366
b58String :: BS.ByteString -- ^ Our Base58 mapping table -> BS.ByteString -- ^ Our Base58 string -> Base58String b58String table bs = if BS.all (isValidBase58 table) bs then Base58String bs else error ("Not a valid base58 string: " ++ show bs)
271
b58String table bs = if BS.all (isValidBase58 table) bs then Base58String bs else error ("Not a valid base58 string: " ++ show bs)
138
true
true
0
9
85
69
36
33
null
null
pseudonom/persistent
persistent-mongoDB/Database/Persist/MongoDB.hs
mit
defaultConnectionIdleTime :: NominalDiffTime defaultConnectionIdleTime = 20
75
defaultConnectionIdleTime :: NominalDiffTime defaultConnectionIdleTime = 20
75
defaultConnectionIdleTime = 20
30
false
true
0
6
5
18
7
11
null
null
MaxDaten/yage
src/Yage/Rendering/Mesh.hs
mit
makeComponent :: MeshId -> VS.Vector Int -> MeshComponent makeComponent ident indices = MeshComponent ident indices
115
makeComponent :: MeshId -> VS.Vector Int -> MeshComponent makeComponent ident indices = MeshComponent ident indices
115
makeComponent ident indices = MeshComponent ident indices
57
false
true
0
8
14
34
16
18
null
null
ezyang/ghc
compiler/backpack/RnModIface.hs
bsd-3-clause
rnIfaceConAlt alt = pure alt
28
rnIfaceConAlt alt = pure alt
28
rnIfaceConAlt alt = pure alt
28
false
false
0
5
4
12
5
7
null
null
sgillespie/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
failIOIdKey = mkPreludeMiscIdUnique 38
56
failIOIdKey = mkPreludeMiscIdUnique 38
56
failIOIdKey = mkPreludeMiscIdUnique 38
56
false
false
0
5
21
9
4
5
null
null
owainlewis/seven
src/Language/Ava/Internal/ResultIO.hs
bsd-3-clause
liftSuccessIO :: a -> ResultIO e a liftSuccessIO = ResultIO . return . Success
78
liftSuccessIO :: a -> ResultIO e a liftSuccessIO = ResultIO . return . Success
78
liftSuccessIO = ResultIO . return . Success
43
false
true
0
6
13
28
14
14
null
null
cdornan/keystore
src/Data/KeyStore/KS.hs
bsd-3-clause
secureKeyKS :: Name -> Safeguard -> KS () secureKeyKS nm sg = withKey nm $ secure_key nm sg
91
secureKeyKS :: Name -> Safeguard -> KS () secureKeyKS nm sg = withKey nm $ secure_key nm sg
91
secureKeyKS nm sg = withKey nm $ secure_key nm sg
49
false
true
0
8
17
41
19
22
null
null
brendanhay/gogol
gogol-tracing/gen/Network/Google/Resource/Tracing/Projects/Traces/Spans/Create.hs
mpl-2.0
-- | OAuth bearer token. ptscBearerToken :: Lens' ProjectsTracesSpansCreate (Maybe Text) ptscBearerToken = lens _ptscBearerToken (\ s a -> s{_ptscBearerToken = a})
171
ptscBearerToken :: Lens' ProjectsTracesSpansCreate (Maybe Text) ptscBearerToken = lens _ptscBearerToken (\ s a -> s{_ptscBearerToken = a})
146
ptscBearerToken = lens _ptscBearerToken (\ s a -> s{_ptscBearerToken = a})
82
true
true
1
9
29
52
25
27
null
null
rednum/hmlk
Hmlk/Validation.hs
bsd-3-clause
crossValidate1 :: (Classifier c, Decision d) => Label -> Metric d -> DataSet -> Double -> c d -> IO Double crossValidate1 dname me ds percents cl = do (dsa, dsb) <- evalRandIO $ percentageSplit percents ds let dsa' = map fromAttribute $ dsa ^.. rows . traversed . attr dname dsb' = dsb `dropCols` (== dname) tcl <- trainClassifier cl dsa dname return $ me dsa' (tcl dsb')
399
crossValidate1 :: (Classifier c, Decision d) => Label -> Metric d -> DataSet -> Double -> c d -> IO Double crossValidate1 dname me ds percents cl = do (dsa, dsb) <- evalRandIO $ percentageSplit percents ds let dsa' = map fromAttribute $ dsa ^.. rows . traversed . attr dname dsb' = dsb `dropCols` (== dname) tcl <- trainClassifier cl dsa dname return $ me dsa' (tcl dsb')
399
crossValidate1 dname me ds percents cl = do (dsa, dsb) <- evalRandIO $ percentageSplit percents ds let dsa' = map fromAttribute $ dsa ^.. rows . traversed . attr dname dsb' = dsb `dropCols` (== dname) tcl <- trainClassifier cl dsa dname return $ me dsa' (tcl dsb')
292
false
true
0
14
96
166
81
85
null
null
GaloisInc/galua
galua-dbg/src/Galua/Debugger/Console.hs
mit
consoleBufferSize :: Int consoleBufferSize = 10
47
consoleBufferSize :: Int consoleBufferSize = 10
47
consoleBufferSize = 10
22
false
true
0
4
5
11
6
5
null
null
GaloisInc/halvm-ghc
compiler/basicTypes/Literal.hs
bsd-3-clause
cmpLit (MachInt a) (MachInt b) = a `compare` b
63
cmpLit (MachInt a) (MachInt b) = a `compare` b
63
cmpLit (MachInt a) (MachInt b) = a `compare` b
63
false
false
1
8
25
33
15
18
null
null
JacquesCarette/literate-scientific-software
code/drasil-example/Drasil/SSP/DataDefs.hs
bsd-2-clause
sliceHghtRightQD :: QDefinition sliceHghtRightQD = ec sliceHghtRight (inxi slopeHght - inxi slipHght)
101
sliceHghtRightQD :: QDefinition sliceHghtRightQD = ec sliceHghtRight (inxi slopeHght - inxi slipHght)
101
sliceHghtRightQD = ec sliceHghtRight (inxi slopeHght - inxi slipHght)
69
false
true
0
8
11
36
15
21
null
null
Concomitant/LambdaHack
Game/LambdaHack/Server/Fov/Digital.hs
bsd-3-clause
intersect (Line (B x y) (B xf yf)) d = #ifdef WITH_EXPENSIVE_ASSERTIONS assert (allB (>= 0) [y, yf]) #endif ((d - y)*(xf - x) + x*(yf - y), yf - y)
153
intersect (Line (B x y) (B xf yf)) d = #ifdef WITH_EXPENSIVE_ASSERTIONS assert (allB (>= 0) [y, yf]) #endif ((d - y)*(xf - x) + x*(yf - y), yf - y)
153
intersect (Line (B x y) (B xf yf)) d = #ifdef WITH_EXPENSIVE_ASSERTIONS assert (allB (>= 0) [y, yf]) #endif ((d - y)*(xf - x) + x*(yf - y), yf - y)
153
false
false
0
11
36
103
56
47
null
null
pbiggar/rash
src/Rash/Util.hs
bsd-3-clause
isTruthy (VInt _) = True
24
isTruthy (VInt _) = True
24
isTruthy (VInt _) = True
24
false
false
0
7
4
15
7
8
null
null
pparkkin/eta
compiler/ETA/Prelude/TysPrim.hs
bsd-3-clause
word64PrimTy :: Type word64PrimTy = mkTyConTy word64PrimTyCon
64
word64PrimTy :: Type word64PrimTy = mkTyConTy word64PrimTyCon
64
word64PrimTy = mkTyConTy word64PrimTyCon
43
false
true
0
6
9
20
8
12
null
null
EJahren/haskell-sdl2
Tests/Interactive/DrawLine.hs
gpl-3.0
mkWindowAndRenderer = withWindowAndRenderer "Test: drawLine" WinPosCentered WinPosCentered windowWidth windowHeight [WindowShown] (-1) [RendererAccelerated]
190
mkWindowAndRenderer = withWindowAndRenderer "Test: drawLine" WinPosCentered WinPosCentered windowWidth windowHeight [WindowShown] (-1) [RendererAccelerated]
190
mkWindowAndRenderer = withWindowAndRenderer "Test: drawLine" WinPosCentered WinPosCentered windowWidth windowHeight [WindowShown] (-1) [RendererAccelerated]
190
false
false
0
6
45
41
18
23
null
null
martin-kolinek/some-board-game-rules
test/Generators.hs
mit
generateMakeStartPlayer :: Gen WorkplaceData generateMakeStartPlayer = WorkplaceData MakeStartPlayer . food <$> choose (0, 1000)
128
generateMakeStartPlayer :: Gen WorkplaceData generateMakeStartPlayer = WorkplaceData MakeStartPlayer . food <$> choose (0, 1000)
128
generateMakeStartPlayer = WorkplaceData MakeStartPlayer . food <$> choose (0, 1000)
83
false
true
0
7
13
34
17
17
null
null
ezyang/ghc
compiler/types/TyCoRep.hs
bsd-3-clause
-- | Does this binder bind an invisible argument? isInvisibleBinder :: TyBinder -> Bool isInvisibleBinder (Named (TvBndr _ vis)) = isInvisibleArgFlag vis
153
isInvisibleBinder :: TyBinder -> Bool isInvisibleBinder (Named (TvBndr _ vis)) = isInvisibleArgFlag vis
103
isInvisibleBinder (Named (TvBndr _ vis)) = isInvisibleArgFlag vis
65
true
true
0
11
21
41
19
22
null
null
Gabriel439/Haskell-Dhall-Library
dhall-yaml/src/Dhall/YamlToDhall.hs
bsd-3-clause
showYaml :: Value -> String showYaml value = BS8.unpack (Data.YAML.Aeson.encode1Strict value)
93
showYaml :: Value -> String showYaml value = BS8.unpack (Data.YAML.Aeson.encode1Strict value)
93
showYaml value = BS8.unpack (Data.YAML.Aeson.encode1Strict value)
65
false
true
0
8
10
33
17
16
null
null
JacksonGariety/euler.hs
063.hs
bsd-3-clause
main :: IO () main = print $ powerfulDigitCounts 21
51
main :: IO () main = print $ powerfulDigitCounts 21
51
main = print $ powerfulDigitCounts 21
37
false
true
0
6
9
23
11
12
null
null
alsonkemp/turbinado
Turbinado/PreProcessor/Parser/XHTML.hs
bsd-3-clause
isInline p = do p2 <- getPosition case (sourceLine p ) == (sourceLine p2) of True -> return [] False -> pzero
181
isInline p = do p2 <- getPosition case (sourceLine p ) == (sourceLine p2) of True -> return [] False -> pzero
181
isInline p = do p2 <- getPosition case (sourceLine p ) == (sourceLine p2) of True -> return [] False -> pzero
181
false
false
1
12
93
61
26
35
null
null
CovenantEyes/libget-hs
src/Main.hs
mit
main :: IO () main = execParser opts >>= main' where opts = info (helper <*> addVersion <*> cmdOptions) ( fullDesc <> progDesc "Install dependencies for a project in a sandbox" )
200
main :: IO () main = execParser opts >>= main' where opts = info (helper <*> addVersion <*> cmdOptions) ( fullDesc <> progDesc "Install dependencies for a project in a sandbox" )
199
main = execParser opts >>= main' where opts = info (helper <*> addVersion <*> cmdOptions) ( fullDesc <> progDesc "Install dependencies for a project in a sandbox" )
185
false
true
0
8
53
57
28
29
null
null
snoyberg/ghc
compiler/basicTypes/Unique.hs
bsd-3-clause
-- ditto (*may* be used in C labels) mkTupleDataConUnique Unboxed a = mkUnique '8' (3*a)
95
mkTupleDataConUnique Unboxed a = mkUnique '8' (3*a)
58
mkTupleDataConUnique Unboxed a = mkUnique '8' (3*a)
58
true
false
0
7
21
26
12
14
null
null
junjihashimoto/persistent
persistent-mongoDB/Database/Persist/MongoDB.hs
mit
mongoFilterToDoc (RegExpFilter fn (reg, opts)) = [ fieldName fn DB.:= DB.RegEx (DB.Regex reg opts)]
100
mongoFilterToDoc (RegExpFilter fn (reg, opts)) = [ fieldName fn DB.:= DB.RegEx (DB.Regex reg opts)]
100
mongoFilterToDoc (RegExpFilter fn (reg, opts)) = [ fieldName fn DB.:= DB.RegEx (DB.Regex reg opts)]
100
false
false
0
10
14
51
25
26
null
null
gbataille/pandoc
src/Text/Pandoc/Readers/Org.hs
gpl-2.0
exampleCode :: String -> Blocks exampleCode = B.codeBlockWith ("", ["example"], [])
83
exampleCode :: String -> Blocks exampleCode = B.codeBlockWith ("", ["example"], [])
83
exampleCode = B.codeBlockWith ("", ["example"], [])
51
false
true
0
7
10
34
19
15
null
null
NickAger/LearningHaskell
thinkingfunctionallywithHaskell/chapter1.hs
mit
teens = ["ten", "elevan", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"]
118
teens = ["ten", "elevan", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"]
118
teens = ["ten", "elevan", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"]
118
false
false
1
5
11
39
23
16
null
null
uduki/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qCast_QStyleOptionComboBox :: Object a -> IO (QStyleOptionComboBox ()) qCast_QStyleOptionComboBox _qobj = return (objectCast _qobj)
133
qCast_QStyleOptionComboBox :: Object a -> IO (QStyleOptionComboBox ()) qCast_QStyleOptionComboBox _qobj = return (objectCast _qobj)
133
qCast_QStyleOptionComboBox _qobj = return (objectCast _qobj)
62
false
true
0
9
15
41
19
22
null
null
snoyberg/ghc
compiler/utils/UniqSet.hs
bsd-3-clause
filterUniqSet = filterUFM
25
filterUniqSet = filterUFM
25
filterUniqSet = filterUFM
25
false
false
1
5
2
10
3
7
null
null
lotz84/deep-learning-from-scratch
src/MNIST.hs
bsd-3-clause
imagesParser :: forall image. HasImageParser image => Parser (Images (Image image)) imagesParser = do P.string $ BS.pack [0,0,8,3] len <- words2Int <$> P.count 4 P.anyWord8 width <- words2Int <$> P.count 4 P.anyWord8 height <- words2Int <$> P.count 4 P.anyWord8 images <- P.count len (imageParser @image width height) pure (Images len width height images)
371
imagesParser :: forall image. HasImageParser image => Parser (Images (Image image)) imagesParser = do P.string $ BS.pack [0,0,8,3] len <- words2Int <$> P.count 4 P.anyWord8 width <- words2Int <$> P.count 4 P.anyWord8 height <- words2Int <$> P.count 4 P.anyWord8 images <- P.count len (imageParser @image width height) pure (Images len width height images)
371
imagesParser = do P.string $ BS.pack [0,0,8,3] len <- words2Int <$> P.count 4 P.anyWord8 width <- words2Int <$> P.count 4 P.anyWord8 height <- words2Int <$> P.count 4 P.anyWord8 images <- P.count len (imageParser @image width height) pure (Images len width height images)
287
false
true
0
11
68
168
80
88
null
null
pxqr/algorithm-wm
src/TC.hs
mit
bindKinds :: Scheme Ty -> (Ty -> Context t a) -> Context t a bindKinds sc a = go sc where go (Mono t) = a t go (Poly n t) = do k <- freshVar local ((n, HasKind k) :) (go t)
194
bindKinds :: Scheme Ty -> (Ty -> Context t a) -> Context t a bindKinds sc a = go sc where go (Mono t) = a t go (Poly n t) = do k <- freshVar local ((n, HasKind k) :) (go t)
194
bindKinds sc a = go sc where go (Mono t) = a t go (Poly n t) = do k <- freshVar local ((n, HasKind k) :) (go t)
133
false
true
1
11
64
116
56
60
null
null
andrewthad/yesod
yesod-core/Yesod/Core.hs
mit
defaultLayoutSub :: Yesod parent => WidgetT child IO () -> HandlerT child (HandlerT parent IO) Html defaultLayoutSub cwidget = widgetToParentWidget cwidget >>= lift . defaultLayout
214
defaultLayoutSub :: Yesod parent => WidgetT child IO () -> HandlerT child (HandlerT parent IO) Html defaultLayoutSub cwidget = widgetToParentWidget cwidget >>= lift . defaultLayout
214
defaultLayoutSub cwidget = widgetToParentWidget cwidget >>= lift . defaultLayout
80
false
true
0
10
58
65
29
36
null
null
Zoetermeer/latro
src/Latro/Interp.hs
mit
freshId :: Eval UniqId freshId = do alphaEnv <- gets alphaEnv let index = AlphaConvert.nextIdIndex alphaEnv let (uniqId, alphaEnv') = AlphaConvert.freshId (UserId (printf "%s%i" "x" index)) alphaEnv modify (\cEnv -> cEnv { alphaEnv = alphaEnv' }) return uniqId
270
freshId :: Eval UniqId freshId = do alphaEnv <- gets alphaEnv let index = AlphaConvert.nextIdIndex alphaEnv let (uniqId, alphaEnv') = AlphaConvert.freshId (UserId (printf "%s%i" "x" index)) alphaEnv modify (\cEnv -> cEnv { alphaEnv = alphaEnv' }) return uniqId
270
freshId = do alphaEnv <- gets alphaEnv let index = AlphaConvert.nextIdIndex alphaEnv let (uniqId, alphaEnv') = AlphaConvert.freshId (UserId (printf "%s%i" "x" index)) alphaEnv modify (\cEnv -> cEnv { alphaEnv = alphaEnv' }) return uniqId
247
false
true
2
11
47
99
50
49
null
null
kmate/HaRe
old/testing/introNewDef/FunIn2.hs
bsd-3-clause
main=foo 10
11
main=foo 10
11
main=foo 10
11
false
false
0
5
1
9
4
5
null
null
shlevy/ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
mkVarApps f vars = foldl (\ e a -> App e (varToCoreExpr a)) f vars
66
mkVarApps f vars = foldl (\ e a -> App e (varToCoreExpr a)) f vars
66
mkVarApps f vars = foldl (\ e a -> App e (varToCoreExpr a)) f vars
66
false
false
0
10
14
39
19
20
null
null
AlexanderPankiv/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
ppr_expr (HsLam matches) = pprMatches (LambdaExpr :: HsMatchContext id) matches
81
ppr_expr (HsLam matches) = pprMatches (LambdaExpr :: HsMatchContext id) matches
81
ppr_expr (HsLam matches) = pprMatches (LambdaExpr :: HsMatchContext id) matches
81
false
false
0
7
11
31
14
17
null
null
zerobuzz/hs-webdriver
test/etc/QuickCheck.hs
bsd-3-clause
cutArray (CutArray i a b) = f i a b where f i a Nothing = f i a (Just a) f i a (Just b) = if a >= 0 then take a i ++ drop (b + 1) i else reverse (f (reverse i) (-b - 1) (Just (-a - 1))) -- | data type with input for cutArray
282
cutArray (CutArray i a b) = f i a b where f i a Nothing = f i a (Just a) f i a (Just b) = if a >= 0 then take a i ++ drop (b + 1) i else reverse (f (reverse i) (-b - 1) (Just (-a - 1))) -- | data type with input for cutArray
282
cutArray (CutArray i a b) = f i a b where f i a Nothing = f i a (Just a) f i a (Just b) = if a >= 0 then take a i ++ drop (b + 1) i else reverse (f (reverse i) (-b - 1) (Just (-a - 1))) -- | data type with input for cutArray
282
false
false
1
14
118
148
74
74
null
null
rueshyna/gogol
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
mpl-2.0
-- | Creates a value of 'AccountshippingListResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'alr1NextPageToken' -- -- * 'alr1Kind' -- -- * 'alr1Resources' accountshippingListResponse :: AccountshippingListResponse accountshippingListResponse = AccountshippingListResponse' { _alr1NextPageToken = Nothing , _alr1Kind = "content#accountshippingListResponse" , _alr1Resources = Nothing }
503
accountshippingListResponse :: AccountshippingListResponse accountshippingListResponse = AccountshippingListResponse' { _alr1NextPageToken = Nothing , _alr1Kind = "content#accountshippingListResponse" , _alr1Resources = Nothing }
253
accountshippingListResponse = AccountshippingListResponse' { _alr1NextPageToken = Nothing , _alr1Kind = "content#accountshippingListResponse" , _alr1Resources = Nothing }
190
true
true
1
7
84
47
29
18
null
null
gcross/AbortT-transformers
Control/Monad/Trans/Abort.hs
bsd-2-clause
runAbortT :: Monad m => AbortT r m r -- ^ the monadic computation to run -> m r -- ^ the (monadic) result of the computation runAbortT (AbortT m) = m >>= either return return
203
runAbortT :: Monad m => AbortT r m r -- ^ the monadic computation to run -> m r runAbortT (AbortT m) = m >>= either return return
149
runAbortT (AbortT m) = m >>= either return return
49
true
true
0
7
64
52
25
27
null
null
DeeLaiD/project_megadeal
global.hs
bsd-3-clause
{- updateTitle String Int Int Purpose: Updates the title of the Command Prompt window. Pre: True Post: True Side-effect: Updates the title of the Command Prompt window. -} updateTitle :: String -> Int -> Int -> IO () updateTitle s i b = setTitle ("Haskino - " ++ s ++ " - Status: $" ++ (show i) ++ " - Bet: $" ++ (show b))
335
updateTitle :: String -> Int -> Int -> IO () updateTitle s i b = setTitle ("Haskino - " ++ s ++ " - Status: $" ++ (show i) ++ " - Bet: $" ++ (show b))
150
updateTitle s i b = setTitle ("Haskino - " ++ s ++ " - Status: $" ++ (show i) ++ " - Bet: $" ++ (show b))
105
true
true
0
11
77
78
38
40
null
null
conal/hermit
src/HERMIT/Shell/ShellEffect.hs
bsd-2-clause
performShellEffect Continue = announceUnprovens >> get >>= continue
67
performShellEffect Continue = announceUnprovens >> get >>= continue
67
performShellEffect Continue = announceUnprovens >> get >>= continue
67
false
false
0
6
7
18
8
10
null
null
olorin/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs
mpl-2.0
-- | The specific group that is to be added or removed from a volume\'s list -- of create volume permissions. cvpGroup :: Lens' CreateVolumePermission (Maybe PermissionGroup) cvpGroup = lens _cvpGroup (\ s a -> s{_cvpGroup = a})
228
cvpGroup :: Lens' CreateVolumePermission (Maybe PermissionGroup) cvpGroup = lens _cvpGroup (\ s a -> s{_cvpGroup = a})
118
cvpGroup = lens _cvpGroup (\ s a -> s{_cvpGroup = a})
53
true
true
0
9
37
47
26
21
null
null
olsner/ghc
compiler/iface/IfaceType.hs
bsd-3-clause
ppr_co _ (IfaceUnivCo _ _ ty1 ty2) = angleBrackets ( ppr ty1 <> comma <+> ppr ty2 )
93
ppr_co _ (IfaceUnivCo _ _ ty1 ty2) = angleBrackets ( ppr ty1 <> comma <+> ppr ty2 )
93
ppr_co _ (IfaceUnivCo _ _ ty1 ty2) = angleBrackets ( ppr ty1 <> comma <+> ppr ty2 )
93
false
false
1
9
27
45
20
25
null
null
paulp/unison
parser-typechecker/src/Unison/ABT.hs
mit
freshes :: Var v => Term f v a -> [v] -> [v] freshes t = Var.freshes (freeVars t)
81
freshes :: Var v => Term f v a -> [v] -> [v] freshes t = Var.freshes (freeVars t)
81
freshes t = Var.freshes (freeVars t)
36
false
true
0
8
18
53
26
27
null
null
yanatan16/haskell-competition
Code/Competition/Parsers.hs
mit
andSpace :: GenParser Char st a -> GenParser Char st a andSpace ap = do a <- ap space return a
100
andSpace :: GenParser Char st a -> GenParser Char st a andSpace ap = do a <- ap space return a
100
andSpace ap = do a <- ap space return a
45
false
true
0
7
26
48
21
27
null
null
palf/haskellSDL2Examples
examples/lesson15/src/Lesson15.hs
gpl-2.0
flipWorld :: FlipDirection -> World -> World flipWorld Horizontal w = w { flipped = (h', v') } where h' = not ( fst (flipped w) ) v' = snd (flipped w)
160
flipWorld :: FlipDirection -> World -> World flipWorld Horizontal w = w { flipped = (h', v') } where h' = not ( fst (flipped w) ) v' = snd (flipped w)
160
flipWorld Horizontal w = w { flipped = (h', v') } where h' = not ( fst (flipped w) ) v' = snd (flipped w)
115
false
true
1
9
41
75
39
36
null
null
brendanhay/gogol
gogol-cloudasset/gen/Network/Google/CloudAsset/Types/Product.hs
mpl-2.0
-- | Creates a value of 'Expr' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'eLocation' -- -- * 'eExpression' -- -- * 'eTitle' -- -- * 'eDescription' expr :: Expr expr = Expr' { _eLocation = Nothing , _eExpression = Nothing , _eTitle = Nothing , _eDescription = Nothing }
385
expr :: Expr expr = Expr' { _eLocation = Nothing , _eExpression = Nothing , _eTitle = Nothing , _eDescription = Nothing }
147
expr = Expr' { _eLocation = Nothing , _eExpression = Nothing , _eTitle = Nothing , _eDescription = Nothing }
130
true
true
0
7
94
58
36
22
null
null
Fresheyeball/fbatch
src/Fbatch.hs
mit
rename (RenameFile x y) = renameFile x y
50
rename (RenameFile x y) = renameFile x y
50
rename (RenameFile x y) = renameFile x y
50
false
false
0
6
17
23
10
13
null
null
andreasabel/helf
src/Test.hs
mit
ezero = abs "A" $ abs "zero" $ abs "suc" $ var' "zero"
55
ezero = abs "A" $ abs "zero" $ abs "suc" $ var' "zero"
55
ezero = abs "A" $ abs "zero" $ abs "suc" $ var' "zero"
55
false
false
0
8
13
30
13
17
null
null
anton-k/language-css
src/Language/Css/Build/Idents.hs
bsd-3-clause
-- | upper-latin upperLatin :: Idents a => a upperLatin = ident "upper-latin"
77
upperLatin :: Idents a => a upperLatin = ident "upper-latin"
60
upperLatin = ident "upper-latin"
32
true
true
0
6
12
22
11
11
null
null
c0deaddict/project-euler
src/Part1/Problem19.hs
bsd-3-clause
daysInMonth _ 10 = 31
23
daysInMonth _ 10 = 31
23
daysInMonth _ 10 = 31
23
false
false
1
5
6
12
5
7
null
null
nshaheed/flipbook
src/Main.hs
bsd-3-clause
combine' (x:xs) = x >> combine' xs
34
combine' (x:xs) = x >> combine' xs
34
combine' (x:xs) = x >> combine' xs
34
false
false
2
6
6
25
11
14
null
null
oldmanmike/ghc
compiler/hsSyn/HsBinds.hs
bsd-3-clause
isEmptyLocalBinds EmptyLocalBinds = True
40
isEmptyLocalBinds EmptyLocalBinds = True
40
isEmptyLocalBinds EmptyLocalBinds = True
40
false
false
0
4
3
10
4
6
null
null
da-x/lamdu
Lamdu/Sugar/Convert/Binder/Params.hs
gpl-3.0
mkStoredLam :: V.Lam (Val (Input.Payload m a)) -> Input.Payload m a -> StoredLam m mkStoredLam lam pl = StoredLam (lam & Lens.mapped . Lens.mapped %~ (^. Input.stored)) (pl ^. Input.stored)
209
mkStoredLam :: V.Lam (Val (Input.Payload m a)) -> Input.Payload m a -> StoredLam m mkStoredLam lam pl = StoredLam (lam & Lens.mapped . Lens.mapped %~ (^. Input.stored)) (pl ^. Input.stored)
209
mkStoredLam lam pl = StoredLam (lam & Lens.mapped . Lens.mapped %~ (^. Input.stored)) (pl ^. Input.stored)
118
false
true
3
9
49
77
39
38
null
null
ksaveljev/hake-2
src/Game/Monsters/MFloat.hs
bsd-3-clause
frameAttack301 :: Int frameAttack301 = 70
41
frameAttack301 :: Int frameAttack301 = 70
41
frameAttack301 = 70
19
false
true
0
4
5
11
6
5
null
null
ScrambledEggsOnToast/kdt
app-src/Tests/StaticTest.hs
mit
inRadiusLinear :: Real a => KDM.PointAsListFn a p -> [(p, v)] -> p -> a -> [(p, v)] inRadiusLinear pointAsList xs query radius = filter ((<= radius * radius) . defaultSqrDist pointAsList query . fst) xs
204
inRadiusLinear :: Real a => KDM.PointAsListFn a p -> [(p, v)] -> p -> a -> [(p, v)] inRadiusLinear pointAsList xs query radius = filter ((<= radius * radius) . defaultSqrDist pointAsList query . fst) xs
204
inRadiusLinear pointAsList xs query radius = filter ((<= radius * radius) . defaultSqrDist pointAsList query . fst) xs
120
false
true
0
11
37
97
51
46
null
null
danr/hipspec
testsuite/prod/zeno_version/PropT47.hs
gpl-3.0
(*) :: Nat -> Nat -> Nat Z * _ = Z
34
(*) :: Nat -> Nat -> Nat Z * _ = Z
34
Z * _ = Z
9
false
true
0
8
11
28
14
14
null
null
bergey/panther
src/Ray/Types.hs
bsd-3-clause
r2f :: (Real a, Fractional b) => a -> b r2f = realToFrac
56
r2f :: (Real a, Fractional b) => a -> b r2f = realToFrac
56
r2f = realToFrac
16
false
true
0
8
12
37
17
20
null
null
nushio3/ghc
compiler/basicTypes/VarSet.hs
bsd-3-clause
sizeDVarSet :: DVarSet -> Int sizeDVarSet = sizeUniqDSet
56
sizeDVarSet :: DVarSet -> Int sizeDVarSet = sizeUniqDSet
56
sizeDVarSet = sizeUniqDSet
26
false
true
0
5
7
15
8
7
null
null
dmbarbour/awelon
hsrc/ABC/Imperative/Prelude.hs
bsd-3-clause
- | extract a block together with relevance and affine attributes exBKF :: V cx -> (Block cx, Bool, Bool) exBKF val = let b = exBlock val in (b, b_rel b, b_aff b)
163
exBKF :: V cx -> (Block cx, Bool, Bool) exBKF val = let b = exBlock val in (b, b_rel b, b_aff b)
96
exBKF val = let b = exBlock val in (b, b_rel b, b_aff b)
56
true
true
3
10
34
74
39
35
null
null
deontologician/orbRPG
Game/OrbRPG/Combinations.hs
gpl-3.0
-- Demon + Letter D Mammon @>> L Lambda = P Red
47
D Mammon @>> L Lambda = P Red
29
D Mammon @>> L Lambda = P Red
29
true
false
0
6
11
22
9
13
null
null
bitemyapp/ekg
System/Remote/Snap.hs
bsd-3-clause
parseHttpAccept :: S.ByteString -> [S.ByteString] parseHttpAccept = List.map fst . List.sortBy (rcompare `on` snd) . List.map grabQ . S.split 44 -- comma where rcompare :: Double -> Double -> Ordering rcompare = flip compare grabQ s = let (s', q) = breakDiscard 59 s -- semicolon (_, q') = breakDiscard 61 q -- equals sign in (trimWhite s', readQ $ trimWhite q') readQ s = case reads $ S8.unpack s of (x, _):_ -> x _ -> 1.0 trimWhite = S.dropWhile (== 32) -- space
595
parseHttpAccept :: S.ByteString -> [S.ByteString] parseHttpAccept = List.map fst . List.sortBy (rcompare `on` snd) . List.map grabQ . S.split 44 -- comma where rcompare :: Double -> Double -> Ordering rcompare = flip compare grabQ s = let (s', q) = breakDiscard 59 s -- semicolon (_, q') = breakDiscard 61 q -- equals sign in (trimWhite s', readQ $ trimWhite q') readQ s = case reads $ S8.unpack s of (x, _):_ -> x _ -> 1.0 trimWhite = S.dropWhile (== 32) -- space
595
parseHttpAccept = List.map fst . List.sortBy (rcompare `on` snd) . List.map grabQ . S.split 44 -- comma where rcompare :: Double -> Double -> Ordering rcompare = flip compare grabQ s = let (s', q) = breakDiscard 59 s -- semicolon (_, q') = breakDiscard 61 q -- equals sign in (trimWhite s', readQ $ trimWhite q') readQ s = case reads $ S8.unpack s of (x, _):_ -> x _ -> 1.0 trimWhite = S.dropWhile (== 32) -- space
545
false
true
6
9
215
236
112
124
null
null
brendanhay/gogol
gogol-apps-calendar/gen/Network/Google/AppsCalendar/Types/Product.hs
mpl-2.0
-- | The access code to access the conference. The maximum length is 128 -- characters. When creating new conference data, populate only the subset -- of {meetingCode, accessCode, passcode, password, pin} fields that match -- the terminology that the conference provider uses. Only the populated -- fields should be displayed. Optional. epAccessCode :: Lens' EntryPoint (Maybe Text) epAccessCode = lens _epAccessCode (\ s a -> s{_epAccessCode = a})
450
epAccessCode :: Lens' EntryPoint (Maybe Text) epAccessCode = lens _epAccessCode (\ s a -> s{_epAccessCode = a})
113
epAccessCode = lens _epAccessCode (\ s a -> s{_epAccessCode = a})
67
true
true
1
9
70
54
29
25
null
null
nomeata/cryptonite
Crypto/PubKey/ECC/ECDSA.hs
bsd-3-clause
verify hashAlg pk@(PublicKey curve q) (Signature r s) msg | r < 1 || r >= n || s < 1 || s >= n = False | otherwise = maybe False (r ==) $ do w <- inverse s n let z = tHash hashAlg msg n u1 = z * w `mod` n u2 = r * w `mod` n -- TODO: Use Shamir's trick g' = pointMul curve u1 g q' = pointMul curve u2 q x = pointAdd curve g' q' case x of PointO -> Nothing Point x1 _ -> return $ x1 `mod` n where n = ecc_n cc g = ecc_g cc cc = common_curve $ public_curve pk -- | Truncate and hash.
635
verify hashAlg pk@(PublicKey curve q) (Signature r s) msg | r < 1 || r >= n || s < 1 || s >= n = False | otherwise = maybe False (r ==) $ do w <- inverse s n let z = tHash hashAlg msg n u1 = z * w `mod` n u2 = r * w `mod` n -- TODO: Use Shamir's trick g' = pointMul curve u1 g q' = pointMul curve u2 q x = pointAdd curve g' q' case x of PointO -> Nothing Point x1 _ -> return $ x1 `mod` n where n = ecc_n cc g = ecc_g cc cc = common_curve $ public_curve pk -- | Truncate and hash.
635
verify hashAlg pk@(PublicKey curve q) (Signature r s) msg | r < 1 || r >= n || s < 1 || s >= n = False | otherwise = maybe False (r ==) $ do w <- inverse s n let z = tHash hashAlg msg n u1 = z * w `mod` n u2 = r * w `mod` n -- TODO: Use Shamir's trick g' = pointMul curve u1 g q' = pointMul curve u2 q x = pointAdd curve g' q' case x of PointO -> Nothing Point x1 _ -> return $ x1 `mod` n where n = ecc_n cc g = ecc_g cc cc = common_curve $ public_curve pk -- | Truncate and hash.
635
false
false
1
14
274
250
126
124
null
null
geocurnoff/nikki
src/Sorts/Nikki/State.hs
lgpl-3.0
grips :: CM.Position -> [NikkiCollision] -> Maybe HorizontalDirection grips nikkiPos = filter isHeadCollision >>> filter isGripCollision >>> toGripCollision where -- if a given head collision should be treated as nikki grabbing something isGripCollision c = abs (nikkiCollisionAngle c) < gripAngleLimit toGripCollision [] = Nothing toGripCollision gripCollisions = Just $ if any isLeftCollision gripCollisions then HLeft else HRight isLeftCollision collision = let collisionPosition = nikkiCollisionPosition collision -~ nikkiPos in vectorX collisionPosition < 0
621
grips :: CM.Position -> [NikkiCollision] -> Maybe HorizontalDirection grips nikkiPos = filter isHeadCollision >>> filter isGripCollision >>> toGripCollision where -- if a given head collision should be treated as nikki grabbing something isGripCollision c = abs (nikkiCollisionAngle c) < gripAngleLimit toGripCollision [] = Nothing toGripCollision gripCollisions = Just $ if any isLeftCollision gripCollisions then HLeft else HRight isLeftCollision collision = let collisionPosition = nikkiCollisionPosition collision -~ nikkiPos in vectorX collisionPosition < 0
621
grips nikkiPos = filter isHeadCollision >>> filter isGripCollision >>> toGripCollision where -- if a given head collision should be treated as nikki grabbing something isGripCollision c = abs (nikkiCollisionAngle c) < gripAngleLimit toGripCollision [] = Nothing toGripCollision gripCollisions = Just $ if any isLeftCollision gripCollisions then HLeft else HRight isLeftCollision collision = let collisionPosition = nikkiCollisionPosition collision -~ nikkiPos in vectorX collisionPosition < 0
551
false
true
0
10
130
137
66
71
null
null
sgillespie/ghc
compiler/codeGen/StgCmmUtils.hs
bsd-3-clause
baseRegOffset dflags (LongReg 1) = oFFSET_StgRegTable_rL1 dflags
67
baseRegOffset dflags (LongReg 1) = oFFSET_StgRegTable_rL1 dflags
67
baseRegOffset dflags (LongReg 1) = oFFSET_StgRegTable_rL1 dflags
67
false
false
0
6
9
22
9
13
null
null
nishiuramakoto/logiku
app/Authentication.hs
gpl-3.0
maybeDisplayNameGoogle :: YesodAuth master => HandlerT master IO (Maybe Text) maybeDisplayNameGoogle = do maybeToken <- getUserAccessToken case maybeToken of Just token -> do app <-getYesod maybePerson <- getPerson (authHttpManager app) token return $ join $ fmap personDisplayName maybePerson Nothing -> return Nothing
350
maybeDisplayNameGoogle :: YesodAuth master => HandlerT master IO (Maybe Text) maybeDisplayNameGoogle = do maybeToken <- getUserAccessToken case maybeToken of Just token -> do app <-getYesod maybePerson <- getPerson (authHttpManager app) token return $ join $ fmap personDisplayName maybePerson Nothing -> return Nothing
350
maybeDisplayNameGoogle = do maybeToken <- getUserAccessToken case maybeToken of Just token -> do app <-getYesod maybePerson <- getPerson (authHttpManager app) token return $ join $ fmap personDisplayName maybePerson Nothing -> return Nothing
272
false
true
0
16
72
110
48
62
null
null
ghcjs/ghcjs
src/Gen2/Profiling.hs
mit
profiling :: G Bool profiling = buildingProf <$> use gsDynFlags
63
profiling :: G Bool profiling = buildingProf <$> use gsDynFlags
63
profiling = buildingProf <$> use gsDynFlags
43
false
true
0
6
9
21
10
11
null
null
koba-e964/tigress
src/Codegen.hs
bsd-3-clause
emptyBlock :: Int -> BlockState emptyBlock i = BlockState i [] Nothing
70
emptyBlock :: Int -> BlockState emptyBlock i = BlockState i [] Nothing
70
emptyBlock i = BlockState i [] Nothing
38
false
true
0
6
11
27
13
14
null
null
5outh/textlunky
src/TextlunkyParser.hs
mit
parseWalls = parseUnary showWall Walls
45
parseWalls = parseUnary showWall Walls
45
parseWalls = parseUnary showWall Walls
45
false
false
1
5
11
15
5
10
null
null
bb010g/aura
aura/lib/Aura/Languages.hs
gpl-3.0
cleanStates_6 :: Int -> Language -> Doc AnsiStyle cleanStates_6 n = \case Spanish -> pretty n <+> "de estos están anclados y no se eliminarán." Italian -> pretty n <+> "di questi sono stati fissati, perciò non saranno rimossi." Dutch -> pretty n <+> "hiervan zijn vastgezet, en worden niet verwijderd." _ -> pretty n <+> "of these are pinned, and won't be removed."
389
cleanStates_6 :: Int -> Language -> Doc AnsiStyle cleanStates_6 n = \case Spanish -> pretty n <+> "de estos están anclados y no se eliminarán." Italian -> pretty n <+> "di questi sono stati fissati, perciò non saranno rimossi." Dutch -> pretty n <+> "hiervan zijn vastgezet, en worden niet verwijderd." _ -> pretty n <+> "of these are pinned, and won't be removed."
389
cleanStates_6 n = \case Spanish -> pretty n <+> "de estos están anclados y no se eliminarán." Italian -> pretty n <+> "di questi sono stati fissati, perciò non saranno rimossi." Dutch -> pretty n <+> "hiervan zijn vastgezet, en worden niet verwijderd." _ -> pretty n <+> "of these are pinned, and won't be removed."
339
false
true
4
7
87
83
37
46
null
null
mcmaniac/ghc
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
bsd-3-clause
-- | Convert a list of CmmStmt's to LlvmStatement's stmtsToInstrs :: LlvmEnv -> [CmmStmt] -> (LlvmStatements, [LlvmCmmDecl]) -> UniqSM StmtData stmtsToInstrs env [] (llvm, top) = return (env, llvm, top)
218
stmtsToInstrs :: LlvmEnv -> [CmmStmt] -> (LlvmStatements, [LlvmCmmDecl]) -> UniqSM StmtData stmtsToInstrs env [] (llvm, top) = return (env, llvm, top)
166
stmtsToInstrs env [] (llvm, top) = return (env, llvm, top)
60
true
true
0
9
45
66
37
29
null
null
qnikst/2pc-haskell
Control/Concurrent/STM/Split/TVar.hs
bsd-3-clause
readSpTVar :: SpTVar Out a -> STM a readSpTVar (SpTVar x) = readTVar x
70
readSpTVar :: SpTVar Out a -> STM a readSpTVar (SpTVar x) = readTVar x
70
readSpTVar (SpTVar x) = readTVar x
34
false
true
0
7
13
35
16
19
null
null
sherwoodwang/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxAUI_DOCKART_GRIPPER_COLOUR :: Int wxAUI_DOCKART_GRIPPER_COLOUR = 14
69
wxAUI_DOCKART_GRIPPER_COLOUR :: Int wxAUI_DOCKART_GRIPPER_COLOUR = 14
69
wxAUI_DOCKART_GRIPPER_COLOUR = 14
33
false
true
0
6
5
18
7
11
null
null
sdiehl/ghc
ghc/GHCi/Leak.hs
bsd-3-clause
-- | Grab weak references to some of the data structures representing -- the currently loaded modules. getLeakIndicators :: HscEnv -> IO LeakIndicators getLeakIndicators HscEnv{..} = fmap LeakIndicators $ forM (eltsUDFM hsc_HPT) $ \hmi@HomeModInfo{..} -> do leakMod <- mkWeakPtr hmi Nothing leakIface <- mkWeakPtr hm_iface Nothing leakDetails <- mkWeakPtr hm_details Nothing leakLinkable <- mapM (`mkWeakPtr` Nothing) hm_linkable return $ LeakModIndicators{..} -- | Look at the LeakIndicators collected by an earlier call to -- `getLeakIndicators`, and print messasges if any of them are still -- alive.
640
getLeakIndicators :: HscEnv -> IO LeakIndicators getLeakIndicators HscEnv{..} = fmap LeakIndicators $ forM (eltsUDFM hsc_HPT) $ \hmi@HomeModInfo{..} -> do leakMod <- mkWeakPtr hmi Nothing leakIface <- mkWeakPtr hm_iface Nothing leakDetails <- mkWeakPtr hm_details Nothing leakLinkable <- mapM (`mkWeakPtr` Nothing) hm_linkable return $ LeakModIndicators{..} -- | Look at the LeakIndicators collected by an earlier call to -- `getLeakIndicators`, and print messasges if any of them are still -- alive.
537
getLeakIndicators HscEnv{..} = fmap LeakIndicators $ forM (eltsUDFM hsc_HPT) $ \hmi@HomeModInfo{..} -> do leakMod <- mkWeakPtr hmi Nothing leakIface <- mkWeakPtr hm_iface Nothing leakDetails <- mkWeakPtr hm_details Nothing leakLinkable <- mapM (`mkWeakPtr` Nothing) hm_linkable return $ LeakModIndicators{..} -- | Look at the LeakIndicators collected by an earlier call to -- `getLeakIndicators`, and print messasges if any of them are still -- alive.
488
true
true
0
11
121
132
66
66
null
null
holzensp/ghc
utils/ghc-cabal/Main.hs
bsd-3-clause
doSdist :: FilePath -> FilePath -> IO () doSdist directory distDir = withCurrentDirectory directory $ withArgs (["sdist", "--builddir", distDir]) runDefaultMain
174
doSdist :: FilePath -> FilePath -> IO () doSdist directory distDir = withCurrentDirectory directory $ withArgs (["sdist", "--builddir", distDir]) runDefaultMain
174
doSdist directory distDir = withCurrentDirectory directory $ withArgs (["sdist", "--builddir", distDir]) runDefaultMain
133
false
true
2
9
33
60
28
32
null
null
knuton/lox
Text/Lox.hs
gpl-3.0
formulaToHTML :: String -> Either ParseError String formulaToHTML fml = asHTML <$> parse statement "" fml
105
formulaToHTML :: String -> Either ParseError String formulaToHTML fml = asHTML <$> parse statement "" fml
105
formulaToHTML fml = asHTML <$> parse statement "" fml
53
false
true
0
6
15
34
16
18
null
null
keithodulaigh/Hets
FreeCAD/Translator.hs
gpl-2.0
getObject _ = error "undefined object"
38
getObject _ = error "undefined object"
38
getObject _ = error "undefined object"
38
false
false
0
5
5
12
5
7
null
null
kumasento/accelerate
Data/Array/Accelerate/Interpreter.hs
bsd-3-clause
evalTan :: FloatingType a -> (a -> a) evalTan ty | FloatingDict <- floatingDict ty = tan
88
evalTan :: FloatingType a -> (a -> a) evalTan ty | FloatingDict <- floatingDict ty = tan
88
evalTan ty | FloatingDict <- floatingDict ty = tan
50
false
true
0
9
16
41
19
22
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/SpeechSynthesisUtterance.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance.voice Mozilla SpeechSynthesisUtterance.voice documentation> getVoiceUnsafe :: (MonadDOM m, HasCallStack) => SpeechSynthesisUtterance -> m SpeechSynthesisVoice getVoiceUnsafe self = liftDOM (((self ^. js "voice") >>= fromJSVal) >>= maybe (Prelude.error "Nothing to return") return)
410
getVoiceUnsafe :: (MonadDOM m, HasCallStack) => SpeechSynthesisUtterance -> m SpeechSynthesisVoice getVoiceUnsafe self = liftDOM (((self ^. js "voice") >>= fromJSVal) >>= maybe (Prelude.error "Nothing to return") return)
269
getVoiceUnsafe self = liftDOM (((self ^. js "voice") >>= fromJSVal) >>= maybe (Prelude.error "Nothing to return") return)
138
true
true
0
12
82
75
38
37
null
null
GaloisInc/gidl
src/Gidl/Types/Base.hs
bsd-3-clause
uint64_t :: Type uint64_t = PrimType (AtomType (AtomWord Bits64))
65
uint64_t :: Type uint64_t = PrimType (AtomType (AtomWord Bits64))
65
uint64_t = PrimType (AtomType (AtomWord Bits64))
48
false
true
0
9
8
26
13
13
null
null
ben-schulz/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
trun :: FC -> TC a -> TC a trun fc (OK a) = OK a
51
trun :: FC -> TC a -> TC a trun fc (OK a) = OK a
51
trun fc (OK a) = OK a
24
false
true
0
10
18
43
19
24
null
null
mrd/haskell-quaternion
Data/Quaternion.hs
bsd-3-clause
eulerAngles :: (RealFloat t) => Quat t -> Vector t eulerAngles q = ( r2d (atan2 (2*s*a + 2*b*c) (1 - 2*(a*a + b*b))) , r2d (asin (2*(s*b - c*a))) , r2d (atan2 (2*s*c+2*a*b) (1 - 2*(b*b + c*c))) ) where s = real q (a, b, c) = imag q -- |Use the SLERP method of interpolating a partial rotation between -- two quaternions.
371
eulerAngles :: (RealFloat t) => Quat t -> Vector t eulerAngles q = ( r2d (atan2 (2*s*a + 2*b*c) (1 - 2*(a*a + b*b))) , r2d (asin (2*(s*b - c*a))) , r2d (atan2 (2*s*c+2*a*b) (1 - 2*(b*b + c*c))) ) where s = real q (a, b, c) = imag q -- |Use the SLERP method of interpolating a partial rotation between -- two quaternions.
371
eulerAngles q = ( r2d (atan2 (2*s*a + 2*b*c) (1 - 2*(a*a + b*b))) , r2d (asin (2*(s*b - c*a))) , r2d (atan2 (2*s*c+2*a*b) (1 - 2*(b*b + c*c))) ) where s = real q (a, b, c) = imag q -- |Use the SLERP method of interpolating a partial rotation between -- two quaternions.
320
false
true
0
14
115
224
117
107
null
null
binesiyu/ifl
book/utils.hs
mit
mapAccuml :: (a -> b -> (a, c)) -- Function of accumulator and element -- input list, returning new -- accumulator and element of result list -> a -- Initial accumulator -> [b] -- Input list -> (a, [c]) -- Final accumulator and result list mapAccuml f acc [] = (acc, [])
415
mapAccuml :: (a -> b -> (a, c)) -- Function of accumulator and element -- input list, returning new -- accumulator and element of result list -> a -- Initial accumulator -> [b] -- Input list -> (a, [c]) mapAccuml f acc [] = (acc, [])
370
mapAccuml f acc [] = (acc, [])
34
true
true
0
9
196
75
45
30
null
null
ganeti/htools
hspace.hs
gpl-2.0
ensureQuoted :: String -> String ensureQuoted v = if not (all (\c -> (isAlphaNum c || c == '.')) v) then '\'':v ++ "'" else v
159
ensureQuoted :: String -> String ensureQuoted v = if not (all (\c -> (isAlphaNum c || c == '.')) v) then '\'':v ++ "'" else v
159
ensureQuoted v = if not (all (\c -> (isAlphaNum c || c == '.')) v) then '\'':v ++ "'" else v
126
false
true
0
14
59
67
35
32
null
null
mcschroeder/ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
-- | Only returns False if there is no unfolding information available at all hasSomeUnfolding :: Unfolding -> Bool hasSomeUnfolding NoUnfolding = False
152
hasSomeUnfolding :: Unfolding -> Bool hasSomeUnfolding NoUnfolding = False
74
hasSomeUnfolding NoUnfolding = False
36
true
true
0
5
22
19
10
9
null
null
ice1000/OI-codes
codewars/301-400/string-average.hs
agpl-3.0
rechange 9 = "nine"
22
rechange 9 = "nine"
22
rechange 9 = "nine"
22
false
false
0
5
6
9
4
5
null
null
janrain/riak-haskell-client
tests/Properties.hs
apache-2.0
pool = unsafePerformIO $ create defaultClient 1 1 1
58
pool = unsafePerformIO $ create defaultClient 1 1 1
58
pool = unsafePerformIO $ create defaultClient 1 1 1
58
false
false
0
6
15
19
9
10
null
null
haskell-infra/hackage-server
tests/HackageClientUtils.hs
bsd-3-clause
getETag :: RelativeURL -> IO String getETag url = Http.responseHeader HdrETag (mkGetReq url)
92
getETag :: RelativeURL -> IO String getETag url = Http.responseHeader HdrETag (mkGetReq url)
92
getETag url = Http.responseHeader HdrETag (mkGetReq url)
56
false
true
0
7
12
34
16
18
null
null
TOSPIO/yi
example-configs/yi-vim.hs
gpl-2.0
main :: IO () main = yi $ defaultVimConfig { modeTable = myModes ++ modeTable defaultVimConfig, defaultKm = myKeymapSet, configCheckExternalChangesObsessively = False }
180
main :: IO () main = yi $ defaultVimConfig { modeTable = myModes ++ modeTable defaultVimConfig, defaultKm = myKeymapSet, configCheckExternalChangesObsessively = False }
180
main = yi $ defaultVimConfig { modeTable = myModes ++ modeTable defaultVimConfig, defaultKm = myKeymapSet, configCheckExternalChangesObsessively = False }
166
false
true
0
9
34
47
26
21
null
null
dschalk/JS-monads-stable
Main.hs
mit
get4 _ = [-1,-1,-1,-1]
22
get4 _ = [-1,-1,-1,-1]
22
get4 _ = [-1,-1,-1,-1]
22
false
false
0
6
3
29
16
13
null
null
rblaze/haskell-dbus
lib/DBus/Internal/Wire.hs
apache-2.0
marshalWord16 :: Word16 -> Marshal () marshalWord16 = marshalBuilder 2 Builder.word16BE Builder.word16LE
112
marshalWord16 :: Word16 -> Marshal () marshalWord16 = marshalBuilder 2 Builder.word16BE Builder.word16LE
112
marshalWord16 = marshalBuilder 2 Builder.word16BE Builder.word16LE
74
false
true
0
7
19
33
15
18
null
null
phischu/fragnix
tests/packages/scotty/Network.HTTP2.Encode.hs
bsd-3-clause
buildFramePayload einfo (GoAwayFrame sid e debug) = buildFramePayloadGoAway einfo sid e debug
97
buildFramePayload einfo (GoAwayFrame sid e debug) = buildFramePayloadGoAway einfo sid e debug
97
buildFramePayload einfo (GoAwayFrame sid e debug) = buildFramePayloadGoAway einfo sid e debug
97
false
false
0
7
15
30
14
16
null
null