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
vdweegen/UvA-Software_Testing
Lab2/Final/Exercises.hs
gpl-3.0
prop_MaintainsLength :: String -> Bool prop_MaintainsLength text = length text == length (maskString text)
108
prop_MaintainsLength :: String -> Bool prop_MaintainsLength text = length text == length (maskString text)
108
prop_MaintainsLength text = length text == length (maskString text)
69
false
true
0
8
15
34
16
18
null
null
apyrgio/snf-ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- | The set of disk templates that are supported by exclusive_storage dtsExclStorage :: FrozenSet String dtsExclStorage = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTPlain]
182
dtsExclStorage :: FrozenSet String dtsExclStorage = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTPlain]
111
dtsExclStorage = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTPlain]
76
true
true
0
7
22
31
16
15
null
null
AlexanderPankiv/ghc
compiler/hsSyn/HsTypes.hs
bsd-3-clause
hsLTyVarBndrsToTypes :: LHsTyVarBndrs name -> [LHsType name] hsLTyVarBndrsToTypes (HsQTvs { hsq_tvs = tvbs }) = map hsLTyVarBndrToType tvbs
139
hsLTyVarBndrsToTypes :: LHsTyVarBndrs name -> [LHsType name] hsLTyVarBndrsToTypes (HsQTvs { hsq_tvs = tvbs }) = map hsLTyVarBndrToType tvbs
139
hsLTyVarBndrsToTypes (HsQTvs { hsq_tvs = tvbs }) = map hsLTyVarBndrToType tvbs
78
false
true
0
9
17
44
22
22
null
null
damianfral/clay
src/Clay/Filter.hs
bsd-3-clause
blur :: Size Abs -> Filter blur i = Filter ("blur(" <> value i <> ")")
70
blur :: Size Abs -> Filter blur i = Filter ("blur(" <> value i <> ")")
70
blur i = Filter ("blur(" <> value i <> ")")
43
false
true
0
9
15
38
18
20
null
null
valderman/lambnyaa
Network/LambNyaa/Source/Nyaa.hs
bsd-3-clause
-- | Search for applications. apps :: Maybe NyaaCat apps = Just $ Software $ Just Games
87
apps :: Maybe NyaaCat apps = Just $ Software $ Just Games
57
apps = Just $ Software $ Just Games
35
true
true
2
6
16
32
14
18
null
null
kowey/antfarm
test/NLP/AntfarmTest.hs
bsd-3-clause
assertRefTests :: ([DiscourseUnit] -> RefStateT IO Text) -> [RefTest] -> IO () assertRefTests languageRx rts = evalStateT (mapM_ next rts) emptyHistory where next rt = case decodeRx (T.unpack (rtInp rt)) of Left err -> liftIO $ assertFailure (show err) Right rxs -> do res <- languageRx rxs let msg = T.unpack (rtOut rt) liftIO $ assertEqual msg (rtOut rt) res
440
assertRefTests :: ([DiscourseUnit] -> RefStateT IO Text) -> [RefTest] -> IO () assertRefTests languageRx rts = evalStateT (mapM_ next rts) emptyHistory where next rt = case decodeRx (T.unpack (rtInp rt)) of Left err -> liftIO $ assertFailure (show err) Right rxs -> do res <- languageRx rxs let msg = T.unpack (rtOut rt) liftIO $ assertEqual msg (rtOut rt) res
440
assertRefTests languageRx rts = evalStateT (mapM_ next rts) emptyHistory where next rt = case decodeRx (T.unpack (rtInp rt)) of Left err -> liftIO $ assertFailure (show err) Right rxs -> do res <- languageRx rxs let msg = T.unpack (rtOut rt) liftIO $ assertEqual msg (rtOut rt) res
361
false
true
0
15
139
173
81
92
null
null
christiaanb/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
updateNs :: [(Name, Name)] -> PTerm -> PTerm updateNs [] t = t
62
updateNs :: [(Name, Name)] -> PTerm -> PTerm updateNs [] t = t
62
updateNs [] t = t
17
false
true
0
7
12
35
19
16
null
null
phischu/fragnix
tests/packages/scotty/Web.Scotty.hs
bsd-3-clause
-- | Abort execution of this action and continue pattern matching routes. -- Like an exception, any code after 'next' is not executed. -- -- As an example, these two routes overlap. The only way the second one will -- ever run is if the first one calls 'next'. -- -- > get "/foo/:bar" $ do -- > w :: Text <- param "bar" -- > unless (w == "special") next -- > text "You made a request to /foo/special" -- > -- > get "/foo/:baz" $ do -- > w <- param "baz" -- > text $ "You made a request to: " <> w next :: ActionM a next = Trans.next
542
next :: ActionM a next = Trans.next
35
next = Trans.next
17
true
true
0
5
122
30
22
8
null
null
vimus/vimus
src/Vimus/Widget/ListWidget.hs
mit
noVisual :: Bool -> ListWidget f a -> ListWidget f a noVisual keepPosition l@ListWidget{..} | keepPosition = l {getVisualStart = Nothing} | otherwise = setPosition l {getVisualStart = Nothing} (fromMaybe getPosition getVisualStart)
238
noVisual :: Bool -> ListWidget f a -> ListWidget f a noVisual keepPosition l@ListWidget{..} | keepPosition = l {getVisualStart = Nothing} | otherwise = setPosition l {getVisualStart = Nothing} (fromMaybe getPosition getVisualStart)
238
noVisual keepPosition l@ListWidget{..} | keepPosition = l {getVisualStart = Nothing} | otherwise = setPosition l {getVisualStart = Nothing} (fromMaybe getPosition getVisualStart)
185
false
true
1
8
38
85
43
42
null
null
sgillespie/ghc
compiler/coreSyn/MkCore.hs
bsd-3-clause
-- | Bind a list of binding groups over an expression. The leftmost binding -- group becomes the outermost group in the resulting expression mkCoreLets :: [CoreBind] -> CoreExpr -> CoreExpr mkCoreLets binds body = foldr mkCoreLet body binds
240
mkCoreLets :: [CoreBind] -> CoreExpr -> CoreExpr mkCoreLets binds body = foldr mkCoreLet body binds
99
mkCoreLets binds body = foldr mkCoreLet body binds
50
true
true
0
6
38
36
19
17
null
null
GaloisInc/halvm-ghc
compiler/typecheck/TcType.hs
bsd-3-clause
toTcType :: Type -> TcType -- The constraint solver expects EvVars to have TcType, in which the -- free type variables are TcTyVars. So we convert from Type to TcType here -- A bit tiresome; but one day I expect the two types to be entirely separate -- in which case we'll definitely need to do this toTcType = runIdentity . to_tc_type emptyVarSet
347
toTcType :: Type -> TcType toTcType = runIdentity . to_tc_type emptyVarSet
74
toTcType = runIdentity . to_tc_type emptyVarSet
47
true
true
1
7
62
33
16
17
null
null
arnizamani/FOLP
Folpgenerator.hs
gpl-2.0
folpLatex (ENot e@(ENot p)) = "\\urcorner " ++ folpLatex e
58
folpLatex (ENot e@(ENot p)) = "\\urcorner " ++ folpLatex e
58
folpLatex (ENot e@(ENot p)) = "\\urcorner " ++ folpLatex e
58
false
false
2
9
9
33
15
18
null
null
dylex/range-set
src/Data/RangeSet/Map.hs
mit
-- | /O(log n)/. Find largest element smaller or equal to than the given one. lookupLE :: Ord a => a -> RSet a -> Maybe a lookupLE x (RSet xm) = min x . snd <$> Map.lookupLE x xm
178
lookupLE :: Ord a => a -> RSet a -> Maybe a lookupLE x (RSet xm) = min x . snd <$> Map.lookupLE x xm
100
lookupLE x (RSet xm) = min x . snd <$> Map.lookupLE x xm
56
true
true
0
8
39
62
29
33
null
null
nominolo/haddock2
tests/golden-tests/tests/Bug8.hs
bsd-2-clause
x --> y = Type("fun",[s,t])
27
x --> y = Type("fun",[s,t])
27
x --> y = Type("fun",[s,t])
27
false
false
2
6
4
31
15
16
null
null
bergmark/hakyll
src/Hakyll/Web/Html.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- | Get the relative url to the site root, for a given (absolute) url toSiteRoot :: String -> String toSiteRoot = emptyException . joinPath . map parent . filter relevant . splitPath . takeDirectory where parent = const ".." emptyException [] = "." emptyException x = x relevant "." = False relevant "/" = False relevant _ = True -------------------------------------------------------------------------------- -- | Check if an URL links to an external HTTP(S) source
617
toSiteRoot :: String -> String toSiteRoot = emptyException . joinPath . map parent . filter relevant . splitPath . takeDirectory where parent = const ".." emptyException [] = "." emptyException x = x relevant "." = False relevant "/" = False relevant _ = True -------------------------------------------------------------------------------- -- | Check if an URL links to an external HTTP(S) source
465
toSiteRoot = emptyException . joinPath . map parent . filter relevant . splitPath . takeDirectory where parent = const ".." emptyException [] = "." emptyException x = x relevant "." = False relevant "/" = False relevant _ = True -------------------------------------------------------------------------------- -- | Check if an URL links to an external HTTP(S) source
434
true
true
0
9
141
98
50
48
null
null
RobinKrom/interactive-brokers
library/API/IB/Util.hs
bsd-3-clause
bSep' :: Char -> [Builder] -> Builder bSep' sep els = bSep sep els <> charUtf8 sep
82
bSep' :: Char -> [Builder] -> Builder bSep' sep els = bSep sep els <> charUtf8 sep
82
bSep' sep els = bSep sep els <> charUtf8 sep
44
false
true
0
7
16
39
19
20
null
null
seereason/ansi-wl-pprint
Text/PrettyPrint/ANSI/Leijen.hs
bsd-2-clause
(white, dullwhite) = colorFunctions White
45
(white, dullwhite) = colorFunctions White
45
(white, dullwhite) = colorFunctions White
45
false
false
0
5
8
16
8
8
null
null
glguy/advent2016
Day04.hs
isc
parser :: Parser Entry parser = Entry <$> some letterChar `endBy` char '-' <*> number <*> bracketed (some letterChar)
123
parser :: Parser Entry parser = Entry <$> some letterChar `endBy` char '-' <*> number <*> bracketed (some letterChar)
123
parser = Entry <$> some letterChar `endBy` char '-' <*> number <*> bracketed (some letterChar)
100
false
true
9
7
24
57
27
30
null
null
thedobs/LTSmin
doc/code/regroup.hs
bsd-3-clause
rowunnub ( (c,x,[y]):l ) = (c,x,[y]) : rowunnub l
51
rowunnub ( (c,x,[y]):l ) = (c,x,[y]) : rowunnub l
51
rowunnub ( (c,x,[y]):l ) = (c,x,[y]) : rowunnub l
51
false
false
0
9
10
47
27
20
null
null
fmapfmapfmap/amazonka
amazonka-glacier/gen/Network/AWS/Glacier/InitiateJob.hs
mpl-2.0
-- | Provides options for specifying job information. ijJobParameters :: Lens' InitiateJob (Maybe JobParameters) ijJobParameters = lens _ijJobParameters (\ s a -> s{_ijJobParameters = a})
187
ijJobParameters :: Lens' InitiateJob (Maybe JobParameters) ijJobParameters = lens _ijJobParameters (\ s a -> s{_ijJobParameters = a})
133
ijJobParameters = lens _ijJobParameters (\ s a -> s{_ijJobParameters = a})
74
true
true
1
9
24
51
25
26
null
null
TikhonJelvis/array-forth
test/Language/ArrayForth/Test.hs
gpl-3.0
-- For now, we do not really support jumps in the Program type. prop_validNative = all isValid . toNative
105
prop_validNative = all isValid . toNative
41
prop_validNative = all isValid . toNative
41
true
false
0
6
18
14
7
7
null
null
thalerjonathan/phd
thesis/code/concurrent/sugarscape/SugarScapeSTMTVar/src/Discrete.hs
gpl-3.0
neighbourCells :: Discrete2dCoord -> Bool -> Discrete2d c -> [c] neighbourCells coord ic e = map snd (neighbours coord ic e)
124
neighbourCells :: Discrete2dCoord -> Bool -> Discrete2d c -> [c] neighbourCells coord ic e = map snd (neighbours coord ic e)
124
neighbourCells coord ic e = map snd (neighbours coord ic e)
59
false
true
0
8
20
51
25
26
null
null
onponomarev/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
opPrioNormal :: Int opPrioNormal = Types.opSubmitPriorityToRaw OpPrioNormal
75
opPrioNormal :: Int opPrioNormal = Types.opSubmitPriorityToRaw OpPrioNormal
75
opPrioNormal = Types.opSubmitPriorityToRaw OpPrioNormal
55
false
true
0
6
6
22
9
13
null
null
joehillen/aura
src/Shell.hs
gpl-3.0
ls'' :: FilePath -> IO [FilePath] ls'' p = map (p </>) `fmap` ls' p
67
ls'' :: FilePath -> IO [FilePath] ls'' p = map (p </>) `fmap` ls' p
67
ls'' p = map (p </>) `fmap` ls' p
33
false
true
0
7
14
40
21
19
null
null
hmemcpy/milewski-ctfp-pdf
src/content/2.5/code/haskell/snippet02.hs
gpl-3.0
fmap f h = f . h
16
fmap f h = f . h
16
fmap f h = f . h
16
false
false
0
5
6
16
7
9
null
null
rueshyna/gogol
gogol-apps-licensing/gen/Network/Google/Resource/Licensing/LicenseAssignments/ListForProduct.hs
mpl-2.0
-- | Token to fetch the next page.Optional. By default server will return -- first page lalfpPageToken :: Lens' LicenseAssignmentsListForProduct Text lalfpPageToken = lens _lalfpPageToken (\ s a -> s{_lalfpPageToken = a})
229
lalfpPageToken :: Lens' LicenseAssignmentsListForProduct Text lalfpPageToken = lens _lalfpPageToken (\ s a -> s{_lalfpPageToken = a})
141
lalfpPageToken = lens _lalfpPageToken (\ s a -> s{_lalfpPageToken = a})
79
true
true
1
9
39
47
23
24
null
null
jstolarek/primitive
Data/Primitive/MachDeps.hs
bsd-3-clause
aLIGNMENT_CHAR = ALIGNMENT_HSCHAR
33
aLIGNMENT_CHAR = ALIGNMENT_HSCHAR
33
aLIGNMENT_CHAR = ALIGNMENT_HSCHAR
33
false
false
0
4
2
6
3
3
null
null
jystic/river
src/River/Source/Concrete/Parser.hs
bsd-3-clause
pSimple :: RiverParser s m => m (Simple SourcePos) pSimple = (pAssignPost <?> "assignment or postfix operation") <|> (pDeclare <?> "declaration")
149
pSimple :: RiverParser s m => m (Simple SourcePos) pSimple = (pAssignPost <?> "assignment or postfix operation") <|> (pDeclare <?> "declaration")
149
pSimple = (pAssignPost <?> "assignment or postfix operation") <|> (pDeclare <?> "declaration")
98
false
true
0
9
24
53
25
28
null
null
rdnetto/persistent
persistent-mongoDB/Database/Persist/MongoDB.hs
mit
-- | convert a unique key into a MongoDB document toUniquesDoc :: forall record. (PersistEntity record) => Unique record -> [DB.Field] toUniquesDoc uniq = zipWith (DB.:=) (map (unDBName . snd) $ persistUniqueToFieldNames uniq) (map DB.val (persistUniqueToValues uniq))
272
toUniquesDoc :: forall record. (PersistEntity record) => Unique record -> [DB.Field] toUniquesDoc uniq = zipWith (DB.:=) (map (unDBName . snd) $ persistUniqueToFieldNames uniq) (map DB.val (persistUniqueToValues uniq))
222
toUniquesDoc uniq = zipWith (DB.:=) (map (unDBName . snd) $ persistUniqueToFieldNames uniq) (map DB.val (persistUniqueToValues uniq))
137
true
true
0
9
40
90
46
44
null
null
antoyo/recettesduquebec2tex
src/Cookbook.hs
gpl-3.0
-- |Generate a 'marinatetime' command. marinateTime :: LaTeXC l => Maybe l -> l -> l marinateTime = comm1Opt1 "macerationtime"
126
marinateTime :: LaTeXC l => Maybe l -> l -> l marinateTime = comm1Opt1 "macerationtime"
87
marinateTime = comm1Opt1 "macerationtime"
41
true
true
0
7
19
33
16
17
null
null
toish/Pico
src/Helpers.hs
gpl-3.0
-- | Finds the line number of the end of a function findEnd :: String -> [String] -> Int findEnd name c = (fromJust (elemIndex ('/':name) c))-1
143
findEnd :: String -> [String] -> Int findEnd name c = (fromJust (elemIndex ('/':name) c))-1
91
findEnd name c = (fromJust (elemIndex ('/':name) c))-1
54
true
true
0
11
26
53
28
25
null
null
bergmark/hlint
src/Settings.hs
bsd-3-clause
-- | Given a module containing HLint settings information return the 'Classify' rules and the 'HintRule' expressions. -- Any fixity declarations will be discarded, but any other unrecognised elements will result in an exception. readSettings :: Module SrcSpanInfo -> ([Classify], [HintRule]) readSettings m = ([x | SettingClassify x <- xs], [x | SettingMatchExp x <- xs]) where xs = moduleSettings_ m
406
readSettings :: Module SrcSpanInfo -> ([Classify], [HintRule]) readSettings m = ([x | SettingClassify x <- xs], [x | SettingMatchExp x <- xs]) where xs = moduleSettings_ m
175
readSettings m = ([x | SettingClassify x <- xs], [x | SettingMatchExp x <- xs]) where xs = moduleSettings_ m
112
true
true
1
9
66
88
44
44
null
null
bobismijnnaam/hywar
Transformations.hs
mit
fI = Idf "f"
18
fI = Idf "f"
18
fI = Idf "f"
18
false
false
0
5
9
9
4
5
null
null
anttisalonen/freekick
haskell/libfreekick/Freekick/Libmatch/MatchStatus.hs
agpl-3.0
allPlayers :: MatchStatus -> [PlayerInfo] allPlayers m = (Data.Map.elems (homeplayers m)) ++ (Data.Map.elems (awayplayers m))
125
allPlayers :: MatchStatus -> [PlayerInfo] allPlayers m = (Data.Map.elems (homeplayers m)) ++ (Data.Map.elems (awayplayers m))
125
allPlayers m = (Data.Map.elems (homeplayers m)) ++ (Data.Map.elems (awayplayers m))
83
false
true
0
10
14
61
30
31
null
null
amutake/psg-scheme
src/Util.hs
bsd-3-clause
cons x (DottedList xs x') = DottedList (x:xs) x'
48
cons x (DottedList xs x') = DottedList (x:xs) x'
48
cons x (DottedList xs x') = DottedList (x:xs) x'
48
false
false
0
7
8
33
15
18
null
null
nomeata/ghc
utils/ghc-cabal/Main.hs
bsd-3-clause
withCurrentDirectory :: FilePath -> IO a -> IO a withCurrentDirectory directory io = do curDirectory <- getCurrentDirectory setCurrentDirectory directory r <- io setCurrentDirectory curDirectory return r -- We need to use the autoconfUserHooks, as the packages that use -- configure can create a .buildinfo file, and we need any info that -- ends up in it.
382
withCurrentDirectory :: FilePath -> IO a -> IO a withCurrentDirectory directory io = do curDirectory <- getCurrentDirectory setCurrentDirectory directory r <- io setCurrentDirectory curDirectory return r -- We need to use the autoconfUserHooks, as the packages that use -- configure can create a .buildinfo file, and we need any info that -- ends up in it.
382
withCurrentDirectory directory io = do curDirectory <- getCurrentDirectory setCurrentDirectory directory r <- io setCurrentDirectory curDirectory return r -- We need to use the autoconfUserHooks, as the packages that use -- configure can create a .buildinfo file, and we need any info that -- ends up in it.
333
false
true
0
8
81
70
30
40
null
null
plumlife/cabal
Cabal/Distribution/Simple/Program/Db.hs
bsd-3-clause
addKnownPrograms :: [Program] -> ProgramDb -> ProgramDb addKnownPrograms progs conf = foldl' (flip addKnownProgram) conf progs
126
addKnownPrograms :: [Program] -> ProgramDb -> ProgramDb addKnownPrograms progs conf = foldl' (flip addKnownProgram) conf progs
126
addKnownPrograms progs conf = foldl' (flip addKnownProgram) conf progs
70
false
true
0
7
15
40
20
20
null
null
jwiegley/ghc-release
compiler/llvmGen/LlvmCodeGen/Data.hs
gpl-3.0
genStaticLit (CmmLabelDiffOff l1 l2 off) = do dflags <- getDynFlags var1 <- genStaticLit (CmmLabel l1) var2 <- genStaticLit (CmmLabel l2) let var = LMSub var1 var2 offset = LMStaticLit $ LMIntLit (toInteger off) (llvmWord dflags) return $ LMAdd var offset
283
genStaticLit (CmmLabelDiffOff l1 l2 off) = do dflags <- getDynFlags var1 <- genStaticLit (CmmLabel l1) var2 <- genStaticLit (CmmLabel l2) let var = LMSub var1 var2 offset = LMStaticLit $ LMIntLit (toInteger off) (llvmWord dflags) return $ LMAdd var offset
283
genStaticLit (CmmLabelDiffOff l1 l2 off) = do dflags <- getDynFlags var1 <- genStaticLit (CmmLabel l1) var2 <- genStaticLit (CmmLabel l2) let var = LMSub var1 var2 offset = LMStaticLit $ LMIntLit (toInteger off) (llvmWord dflags) return $ LMAdd var offset
283
false
false
0
13
67
110
50
60
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/book/2009-Real_World_Haskell/PrettyJSONPrettify.hs
unlicense
flatten other = other
30
flatten other = other
30
flatten other = other
30
false
false
0
5
12
9
4
5
null
null
gitfoxi/vcd-haskell
app/hus-x1-hub.hs
agpl-3.0
waveTable :: [(Char,Char)] waveTable = map (second chr) [('0',0) ,('1',1) ,('Z',2) ,('X',2) ,('L',3) ,('H',4) ,('z',2) ,('x',2) ,('l',3) ,('h',4) ]
193
waveTable :: [(Char,Char)] waveTable = map (second chr) [('0',0) ,('1',1) ,('Z',2) ,('X',2) ,('L',3) ,('H',4) ,('z',2) ,('x',2) ,('l',3) ,('h',4) ]
193
waveTable = map (second chr) [('0',0) ,('1',1) ,('Z',2) ,('X',2) ,('L',3) ,('H',4) ,('z',2) ,('x',2) ,('l',3) ,('h',4) ]
166
false
true
0
8
64
125
77
48
null
null
gibiansky/IHaskell
ipython-kernel/src/IHaskell/IPython/Message/Parser.hs
mit
parser CompleteRequestMessage = completeRequestParser
53
parser CompleteRequestMessage = completeRequestParser
53
parser CompleteRequestMessage = completeRequestParser
53
false
false
0
5
3
9
4
5
null
null
DominikDitoIvosevic/Uni
IRG/src/Irg/Lab1/Geometry/Matrix.hs
mit
set :: Int -> Int -> Number -> Matrix -> Matrix set i j val mat = V.set i (V.set j val (V.get i mat)) mat
105
set :: Int -> Int -> Number -> Matrix -> Matrix set i j val mat = V.set i (V.set j val (V.get i mat)) mat
105
set i j val mat = V.set i (V.set j val (V.get i mat)) mat
57
false
true
0
10
25
71
34
37
null
null
sapek/optparse-applicative
Options/Applicative/Builder.hs
bsd-3-clause
-- | Builder for an option taking a 'String' argument. strOption :: Mod OptionFields String -> Parser String strOption = option str
131
strOption :: Mod OptionFields String -> Parser String strOption = option str
76
strOption = option str
22
true
true
0
7
21
33
14
19
null
null
mchakravarty/lets-program
step7/Game.hs
bsd-3-clause
-- Check whether the character is on the playform. onThePlatform world = snd (spritePosition world) <= snd platformPosition + slimeHeight / 2 + platformHeight / 2 && fst (spritePosition world) + slimeWidth / 2 > fst platformPosition - platformWidth / 2 && fst (spritePosition world) - slimeWidth / 2 < fst platformPosition + platformWidth / 2
386
onThePlatform world = snd (spritePosition world) <= snd platformPosition + slimeHeight / 2 + platformHeight / 2 && fst (spritePosition world) + slimeWidth / 2 > fst platformPosition - platformWidth / 2 && fst (spritePosition world) - slimeWidth / 2 < fst platformPosition + platformWidth / 2
335
onThePlatform world = snd (spritePosition world) <= snd platformPosition + slimeHeight / 2 + platformHeight / 2 && fst (spritePosition world) + slimeWidth / 2 > fst platformPosition - platformWidth / 2 && fst (spritePosition world) - slimeWidth / 2 < fst platformPosition + platformWidth / 2
335
true
false
5
12
99
120
54
66
null
null
bmillwood/stepeval
src/Main.hs
bsd-3-clause
version = "stepeval v0.1"
25
version = "stepeval v0.1"
25
version = "stepeval v0.1"
25
false
false
1
5
3
10
3
7
null
null
traceguide/api-php
vendor/apache/thrift/lib/hs/src/Thrift/Protocol/Binary.hs
mit
buildBinaryValue (TI16 i) = int16BE i
37
buildBinaryValue (TI16 i) = int16BE i
37
buildBinaryValue (TI16 i) = int16BE i
37
false
false
0
7
5
18
8
10
null
null
facebook/fbthrift
thrift/compiler/test/fixtures/qualified/gen-hs/Module0_Types.hs
apache-2.0
to_Struct _ = error "not a struct"
34
to_Struct _ = error "not a struct"
34
to_Struct _ = error "not a struct"
34
false
false
0
5
6
12
5
7
null
null
apyrgio/ganeti
src/Ganeti/Path.hs
bsd-2-clause
-- | Path to the file representing the lock status. tempResStatusFile :: IO FilePath tempResStatusFile = dataDirP "tempres.data"
129
tempResStatusFile :: IO FilePath tempResStatusFile = dataDirP "tempres.data"
77
tempResStatusFile = dataDirP "tempres.data"
44
true
true
0
5
18
18
9
9
null
null
michaelgwelch/bacnet
src/BACnet/Writer/Core.hs
mit
-- | A function that writes a BS.ByteString bytestring :: BS.ByteString -> Writer bytestring = W . lazyByteString
113
bytestring :: BS.ByteString -> Writer bytestring = W . lazyByteString
69
bytestring = W . lazyByteString
31
true
true
1
7
17
30
13
17
null
null
abailly/subhask
src/SubHask/Category/Linear/Objects.hs
bsd-3-clause
x = mkSparseFreeVector $ words "this is a test" :: SparseFreeVector Double String
81
x = mkSparseFreeVector $ words "this is a test" :: SparseFreeVector Double String
81
x = mkSparseFreeVector $ words "this is a test" :: SparseFreeVector Double String
81
false
false
0
6
12
24
11
13
null
null
exbb2/BlastItWithPiss
src/GtkBlast/ROW_ROW_FIGHT_THE_POWER.hs
gpl-3.0
end :: a end = undefined
24
end :: a end = undefined
24
end = undefined
15
false
true
0
6
5
18
7
11
null
null
a143753/AOJ
0126.hs
apache-2.0
g n = [n, n+1, n+2,n+9,n+10,n+11,n+18,n+19,n+20]
48
g n = [n, n+1, n+2,n+9,n+10,n+11,n+18,n+19,n+20]
48
g n = [n, n+1, n+2,n+9,n+10,n+11,n+18,n+19,n+20]
48
false
false
1
7
5
72
38
34
null
null
eklavya/Idris-dev
src/Idris/Core/Evaluate.hs
bsd-3-clause
fnCount :: Int -> Name -> Eval () fnCount inc n = do ES ls num b <- get case lookup n ls of Just i -> do put $ ES ((n, (i - inc)) : filter (\ (n', _) -> n/=n') ls) num b _ -> return ()
286
fnCount :: Int -> Name -> Eval () fnCount inc n = do ES ls num b <- get case lookup n ls of Just i -> do put $ ES ((n, (i - inc)) : filter (\ (n', _) -> n/=n') ls) num b _ -> return ()
286
fnCount inc n = do ES ls num b <- get case lookup n ls of Just i -> do put $ ES ((n, (i - inc)) : filter (\ (n', _) -> n/=n') ls) num b _ -> return ()
252
false
true
0
20
150
137
66
71
null
null
tolysz/prepare-ghcjs
spec-lts8/cabal/cabal-install/Distribution/Client/Dependency/Modular/Preference.hs
bsd-3-clause
firstGoal :: Tree a -> Tree a firstGoal = trav go where go (GoalChoiceF xs) = GoalChoiceF (P.firstOnly xs) go x = x -- Note that we keep empty choice nodes, because they mean success. -- | Transformation that tries to make a decision on base as early as -- possible. In nearly all cases, there's a single choice for the base -- package. Also, fixing base early should lead to better error messages.
428
firstGoal :: Tree a -> Tree a firstGoal = trav go where go (GoalChoiceF xs) = GoalChoiceF (P.firstOnly xs) go x = x -- Note that we keep empty choice nodes, because they mean success. -- | Transformation that tries to make a decision on base as early as -- possible. In nearly all cases, there's a single choice for the base -- package. Also, fixing base early should lead to better error messages.
428
firstGoal = trav go where go (GoalChoiceF xs) = GoalChoiceF (P.firstOnly xs) go x = x -- Note that we keep empty choice nodes, because they mean success. -- | Transformation that tries to make a decision on base as early as -- possible. In nearly all cases, there's a single choice for the base -- package. Also, fixing base early should lead to better error messages.
398
false
true
0
8
103
65
32
33
null
null
wiryls/HomeworkCollectionOfMYLS
2018.ProjectV/src/IAFinance/Server/Data/Shuidi.hs
mit
dropLastApostrophe s = if last s == '\'' then init s else s
59
dropLastApostrophe s = if last s == '\'' then init s else s
59
dropLastApostrophe s = if last s == '\'' then init s else s
59
false
false
0
7
12
27
13
14
null
null
andgate/vish
src/Vish/Graphics/Texture.hs
bsd-3-clause
sendToGpu :: (JP.Pixel p) => FilePath -> JP.Image p -> GL.PixelInternalFormat -> GL.PixelFormat -> GL.DataType -> IO Texture sendToGpu texPath (JP.Image w h dat) pixelInternalFormat pixelFormat datatype = do [texObjName] <- GL.genObjectNames 1 GL.textureBinding GL.Texture2D $= Just texObjName GL.textureFilter GL.Texture2D $= ((GL.Nearest, Nothing), GL.Nearest) V.unsafeWith dat $ \ptr -> GL.texImage2D GL.Texture2D GL.NoProxy 0 pixelInternalFormat (GL.TextureSize2D (gsizei w) (gsizei h)) 0 (GL.PixelData pixelFormat datatype ptr) texObj <- newIORef $ Just texObjName return Texture { _path = texPath , _srcSize = fromIntegral <$> V2 w h , _position = Vec.zero , _size = V2 1 1 , _object = texObj }
804
sendToGpu :: (JP.Pixel p) => FilePath -> JP.Image p -> GL.PixelInternalFormat -> GL.PixelFormat -> GL.DataType -> IO Texture sendToGpu texPath (JP.Image w h dat) pixelInternalFormat pixelFormat datatype = do [texObjName] <- GL.genObjectNames 1 GL.textureBinding GL.Texture2D $= Just texObjName GL.textureFilter GL.Texture2D $= ((GL.Nearest, Nothing), GL.Nearest) V.unsafeWith dat $ \ptr -> GL.texImage2D GL.Texture2D GL.NoProxy 0 pixelInternalFormat (GL.TextureSize2D (gsizei w) (gsizei h)) 0 (GL.PixelData pixelFormat datatype ptr) texObj <- newIORef $ Just texObjName return Texture { _path = texPath , _srcSize = fromIntegral <$> V2 w h , _position = Vec.zero , _size = V2 1 1 , _object = texObj }
804
sendToGpu texPath (JP.Image w h dat) pixelInternalFormat pixelFormat datatype = do [texObjName] <- GL.genObjectNames 1 GL.textureBinding GL.Texture2D $= Just texObjName GL.textureFilter GL.Texture2D $= ((GL.Nearest, Nothing), GL.Nearest) V.unsafeWith dat $ \ptr -> GL.texImage2D GL.Texture2D GL.NoProxy 0 pixelInternalFormat (GL.TextureSize2D (gsizei w) (gsizei h)) 0 (GL.PixelData pixelFormat datatype ptr) texObj <- newIORef $ Just texObjName return Texture { _path = texPath , _srcSize = fromIntegral <$> V2 w h , _position = Vec.zero , _size = V2 1 1 , _object = texObj }
679
false
true
0
14
202
286
141
145
null
null
nevrenato/Hets_Fork
Maude/PreComorphism.hs
gpl-2.0
maudeType2caslSort :: MAS.Type -> IdMap -> CAS.SORT maudeType2caslSort (MAS.TypeSort q) _ = token2id $ getName q
112
maudeType2caslSort :: MAS.Type -> IdMap -> CAS.SORT maudeType2caslSort (MAS.TypeSort q) _ = token2id $ getName q
112
maudeType2caslSort (MAS.TypeSort q) _ = token2id $ getName q
60
false
true
0
11
15
48
22
26
null
null
lostbean/DeUni
src/DeUni/Dim3/Hull3D.hs
gpl-3.0
extractAllFaceEdges :: SetPoint Vec3 -> S1 Vec3 -> [ActiveSubUnit S1 Vec3] extractAllFaceEdges _ sigma = let (a,b,c) = face3DPoints sigma in [ ActiveUnit (Edge3D a b) c undefined , ActiveUnit (Edge3D b c) a undefined , ActiveUnit (Edge3D c a) b undefined ]
273
extractAllFaceEdges :: SetPoint Vec3 -> S1 Vec3 -> [ActiveSubUnit S1 Vec3] extractAllFaceEdges _ sigma = let (a,b,c) = face3DPoints sigma in [ ActiveUnit (Edge3D a b) c undefined , ActiveUnit (Edge3D b c) a undefined , ActiveUnit (Edge3D c a) b undefined ]
273
extractAllFaceEdges _ sigma = let (a,b,c) = face3DPoints sigma in [ ActiveUnit (Edge3D a b) c undefined , ActiveUnit (Edge3D b c) a undefined , ActiveUnit (Edge3D c a) b undefined ]
198
false
true
0
10
59
116
57
59
null
null
dsabel/stmshf
Control/Concurrent/SHFSTM/Internal.hs
bsd-3-clause
retryCGlobWithLog :: TLOG -- ^ the transaction log -> IO () retryCGlobWithLog (TLOG tlog) = do lg <- readIORef tlog -- access the Log-File mid <- myThreadId let t = Set.elems (readTVars lg) uninterruptibleMask_ $ do removeNotifyEntries mid t writeIORef tlog lg{readTVars = Set.empty}
341
retryCGlobWithLog :: TLOG -- ^ the transaction log -> IO () retryCGlobWithLog (TLOG tlog) = do lg <- readIORef tlog -- access the Log-File mid <- myThreadId let t = Set.elems (readTVars lg) uninterruptibleMask_ $ do removeNotifyEntries mid t writeIORef tlog lg{readTVars = Set.empty}
341
retryCGlobWithLog (TLOG tlog) = do lg <- readIORef tlog -- access the Log-File mid <- myThreadId let t = Set.elems (readTVars lg) uninterruptibleMask_ $ do removeNotifyEntries mid t writeIORef tlog lg{readTVars = Set.empty}
263
false
true
0
13
101
101
47
54
null
null
literate-unitb/literate-unitb
src/Document/Tests/TrainStationRefinement.hs
mit
-- parse :: FilePath -> IO String -- parse path = do -- r <- parse_machine path -- return $ case r of -- Right _ -> "ok" -- Left xs -> unlines $ map report xs path5 :: FilePath path5 = [path|Tests/train-station-ref-err2.tex|]
250
path5 :: FilePath path5 = [path|Tests/train-station-ref-err2.tex|]
66
path5 = [path|Tests/train-station-ref-err2.tex|]
48
true
true
0
6
67
28
17
11
null
null
markflorisson/hpack
testrepo/bytestring-0.10.4.1/Data/ByteString/Internal.hs
bsd-3-clause
-- | A way of creating ByteStrings outside the IO monad. The @Int@ -- argument gives the final size of the ByteString. unsafeCreate :: Int -> (Ptr Word8 -> IO ()) -> ByteString unsafeCreate l f = unsafeDupablePerformIO (create l f)
231
unsafeCreate :: Int -> (Ptr Word8 -> IO ()) -> ByteString unsafeCreate l f = unsafeDupablePerformIO (create l f)
112
unsafeCreate l f = unsafeDupablePerformIO (create l f)
54
true
true
0
10
40
52
26
26
null
null
mathhun/stack
src/Stack/Build/Execute.hs
bsd-3-clause
getSetupHs :: Path Abs Dir -- ^ project directory -> IO (Path Abs File) getSetupHs dir = do exists1 <- fileExists fp1 if exists1 then return fp1 else do exists2 <- fileExists fp2 if exists2 then return fp2 else throwM $ NoSetupHsFound dir where fp1 = dir </> $(mkRelFile "Setup.hs") fp2 = dir </> $(mkRelFile "Setup.lhs") -- Do not pass `-hpcdir` as GHC option if the coverage is not enabled. -- This helps running stack-compiled programs with dynamic interpreters like `hint`. -- Cfr: https://github.com/commercialhaskell/stack/issues/997
641
getSetupHs :: Path Abs Dir -- ^ project directory -> IO (Path Abs File) getSetupHs dir = do exists1 <- fileExists fp1 if exists1 then return fp1 else do exists2 <- fileExists fp2 if exists2 then return fp2 else throwM $ NoSetupHsFound dir where fp1 = dir </> $(mkRelFile "Setup.hs") fp2 = dir </> $(mkRelFile "Setup.lhs") -- Do not pass `-hpcdir` as GHC option if the coverage is not enabled. -- This helps running stack-compiled programs with dynamic interpreters like `hint`. -- Cfr: https://github.com/commercialhaskell/stack/issues/997
641
getSetupHs dir = do exists1 <- fileExists fp1 if exists1 then return fp1 else do exists2 <- fileExists fp2 if exists2 then return fp2 else throwM $ NoSetupHsFound dir where fp1 = dir </> $(mkRelFile "Setup.hs") fp2 = dir </> $(mkRelFile "Setup.lhs") -- Do not pass `-hpcdir` as GHC option if the coverage is not enabled. -- This helps running stack-compiled programs with dynamic interpreters like `hint`. -- Cfr: https://github.com/commercialhaskell/stack/issues/997
558
false
true
2
12
185
134
62
72
null
null
Copilot-Language/sbv-for-copilot
SBVUnitTest/TestSuite/Basics/ArithNoSolver.hs
bsd-3-clause
i16s :: [Int16] i16s = xsSigned
31
i16s :: [Int16] i16s = xsSigned
31
i16s = xsSigned
15
false
true
0
5
5
14
8
6
null
null
damoxc/ganeti
src/Ganeti/JSON.hs
gpl-2.0
fromJResult _ (J.Ok x) = return x
33
fromJResult _ (J.Ok x) = return x
33
fromJResult _ (J.Ok x) = return x
33
false
false
1
7
6
25
10
15
null
null
nevrenato/HetsAlloy
Syntax/Parse_AS_Structured.hs
gpl-2.0
specA :: LogicGraph -> AParser st (Annoted SPEC) specA l = do (sps, ps) <- annoParser2 (specB l) `separatedBy` asKey andS return $ case sps of [sp] -> sp _ -> emptyAnno (Union sps $ catRange ps)
206
specA :: LogicGraph -> AParser st (Annoted SPEC) specA l = do (sps, ps) <- annoParser2 (specB l) `separatedBy` asKey andS return $ case sps of [sp] -> sp _ -> emptyAnno (Union sps $ catRange ps)
206
specA l = do (sps, ps) <- annoParser2 (specB l) `separatedBy` asKey andS return $ case sps of [sp] -> sp _ -> emptyAnno (Union sps $ catRange ps)
157
false
true
0
14
48
102
50
52
null
null
chreekat/snowdrift
Handler/ProjectBlog.hs
agpl-3.0
postUnclaimBlogPostCommentR :: Text -> Text -> CommentId -> Handler Html postUnclaimBlogPostCommentR project_handle post_name comment_id = do (user, Entity project_id _, comment) <- checkCommentRequireAuth project_handle post_name comment_id checkBlogPostCommentActionPermission can_unclaim user project_handle (Entity comment_id comment) postUnclaimComment user comment_id comment (projectCommentHandlerInfo (Just user) project_id project_handle) >>= \case Nothing -> redirect $ BlogPostCommentR project_handle post_name comment_id Just (widget, form) -> defaultLayout $ previewWidget form "unclaim" $ projectBlogDiscussionPage project_handle post_name widget -------------------------------------------------------------------------------- -- /p/#Text/blog/#Text/c/#CommentId/watch
843
postUnclaimBlogPostCommentR :: Text -> Text -> CommentId -> Handler Html postUnclaimBlogPostCommentR project_handle post_name comment_id = do (user, Entity project_id _, comment) <- checkCommentRequireAuth project_handle post_name comment_id checkBlogPostCommentActionPermission can_unclaim user project_handle (Entity comment_id comment) postUnclaimComment user comment_id comment (projectCommentHandlerInfo (Just user) project_id project_handle) >>= \case Nothing -> redirect $ BlogPostCommentR project_handle post_name comment_id Just (widget, form) -> defaultLayout $ previewWidget form "unclaim" $ projectBlogDiscussionPage project_handle post_name widget -------------------------------------------------------------------------------- -- /p/#Text/blog/#Text/c/#CommentId/watch
843
postUnclaimBlogPostCommentR project_handle post_name comment_id = do (user, Entity project_id _, comment) <- checkCommentRequireAuth project_handle post_name comment_id checkBlogPostCommentActionPermission can_unclaim user project_handle (Entity comment_id comment) postUnclaimComment user comment_id comment (projectCommentHandlerInfo (Just user) project_id project_handle) >>= \case Nothing -> redirect $ BlogPostCommentR project_handle post_name comment_id Just (widget, form) -> defaultLayout $ previewWidget form "unclaim" $ projectBlogDiscussionPage project_handle post_name widget -------------------------------------------------------------------------------- -- /p/#Text/blog/#Text/c/#CommentId/watch
770
false
true
0
13
128
169
82
87
null
null
jwiegley/ghc-release
libraries/haskeline/System/Console/Haskeline/Completion.hs
gpl-3.0
isUnquoted :: Maybe Char -> String -> String -> Bool isUnquoted esc qs s = case splitAtQuote esc qs s of Just (_,s') -> not (isUnquoted esc qs s') _ -> True -- | List all of the files or folders beginning with this path.
230
isUnquoted :: Maybe Char -> String -> String -> Bool isUnquoted esc qs s = case splitAtQuote esc qs s of Just (_,s') -> not (isUnquoted esc qs s') _ -> True -- | List all of the files or folders beginning with this path.
230
isUnquoted esc qs s = case splitAtQuote esc qs s of Just (_,s') -> not (isUnquoted esc qs s') _ -> True -- | List all of the files or folders beginning with this path.
177
false
true
4
8
54
78
39
39
null
null
iostreamer-X/FuncShell
src/TableParser.hs
mit
--- PARSING isChar = (>' ')
28
isChar = (>' ')
15
isChar = (>' ')
15
true
false
0
5
6
11
7
4
null
null
Persi/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
getCommandSequences (T_WhileExpression _ _ cmds) = [cmds]
57
getCommandSequences (T_WhileExpression _ _ cmds) = [cmds]
57
getCommandSequences (T_WhileExpression _ _ cmds) = [cmds]
57
false
false
0
7
6
22
11
11
null
null
vicfryzel/haskell-twitter
Haq.hs
mit
-- |See http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0followers statusesFollowers username creds = getDecode (baseHN ++ "/statuses/followers/" ++ username ++ ".json") creds
198
statusesFollowers username creds = getDecode (baseHN ++ "/statuses/followers/" ++ username ++ ".json") creds
112
statusesFollowers username creds = getDecode (baseHN ++ "/statuses/followers/" ++ username ++ ".json") creds
112
true
false
0
9
19
32
16
16
null
null
md5/hs-zenfolio
Web/Zenfolio/Photos.hs
bsd-3-clause
searchPhotoByText :: SearchID -> SortOrder -> String -> Int -> Int -> ZM PhotoResult searchPhotoByText = zfRemote "SearchPhotoByText"
133
searchPhotoByText :: SearchID -> SortOrder -> String -> Int -> Int -> ZM PhotoResult searchPhotoByText = zfRemote "SearchPhotoByText"
133
searchPhotoByText = zfRemote "SearchPhotoByText"
48
false
true
0
10
17
37
18
19
null
null
alphaHeavy/cabal
Cabal/Distribution/Simple/PreProcess.hs
bsd-3-clause
runSimplePreProcessor :: PreProcessor -> FilePath -> FilePath -> Verbosity -> IO () runSimplePreProcessor pp inFile outFile verbosity = runPreProcessor pp (".", inFile) (".", outFile) verbosity
217
runSimplePreProcessor :: PreProcessor -> FilePath -> FilePath -> Verbosity -> IO () runSimplePreProcessor pp inFile outFile verbosity = runPreProcessor pp (".", inFile) (".", outFile) verbosity
217
runSimplePreProcessor pp inFile outFile verbosity = runPreProcessor pp (".", inFile) (".", outFile) verbosity
111
false
true
0
11
48
68
33
35
null
null
hvr/lens
src/Numeric/Lens.hs
bsd-3-clause
-- | Select digits that fall into the given base isDigit' :: Int -> Char -> Bool isDigit' b c = case digitToIntMay c of Just i -> i < b _ -> False -- | A simpler variant of 'Numeric.showSigned' that only prepends a dash and -- doesn't know about parentheses
262
isDigit' :: Int -> Char -> Bool isDigit' b c = case digitToIntMay c of Just i -> i < b _ -> False -- | A simpler variant of 'Numeric.showSigned' that only prepends a dash and -- doesn't know about parentheses
213
isDigit' b c = case digitToIntMay c of Just i -> i < b _ -> False -- | A simpler variant of 'Numeric.showSigned' that only prepends a dash and -- doesn't know about parentheses
181
true
true
3
6
56
50
26
24
null
null
romanb/amazonka
amazonka-s3/gen/Network/AWS/S3/Types.hs
mpl-2.0
-- | The class of storage used to store the object. tStorageClass :: Lens' Transition (Maybe TransitionStorageClass) tStorageClass = lens _tStorageClass (\s a -> s { _tStorageClass = a })
187
tStorageClass :: Lens' Transition (Maybe TransitionStorageClass) tStorageClass = lens _tStorageClass (\s a -> s { _tStorageClass = a })
135
tStorageClass = lens _tStorageClass (\s a -> s { _tStorageClass = a })
70
true
true
0
9
29
46
25
21
null
null
jbracker/supermonad-plugin
examples/monad/hmtc/supermonad/PPAST.hs
bsd-3-clause
ppExpression n (ExpVar {evVar = v}) = indent n . showString "ExpVar" . spc . ppName v . nl
94
ppExpression n (ExpVar {evVar = v}) = indent n . showString "ExpVar" . spc . ppName v . nl
94
ppExpression n (ExpVar {evVar = v}) = indent n . showString "ExpVar" . spc . ppName v . nl
94
false
false
0
9
22
48
23
25
null
null
forste/haReFork
refactorer/RefacGenFold.hs
bsd-3-clause
rewriteExpStmts pats (HsLast e1) (HsLast e2) | wildCardAllPNs e1 == wildCardAllPNs e2 = (True, pats)
101
rewriteExpStmts pats (HsLast e1) (HsLast e2) | wildCardAllPNs e1 == wildCardAllPNs e2 = (True, pats)
101
rewriteExpStmts pats (HsLast e1) (HsLast e2) | wildCardAllPNs e1 == wildCardAllPNs e2 = (True, pats)
101
false
false
0
9
15
47
22
25
null
null
termite2/tsl
Frontend/NS.hs
bsd-3-clause
showType :: (?spec::Spec) => Type -> String showType = render . ppType
70
showType :: (?spec::Spec) => Type -> String showType = render . ppType
70
showType = render . ppType
26
false
true
0
8
11
35
17
18
null
null
kawu/tagger
src/CRF/AlphabetTrie.hs
bsd-3-clause
readAlphabet :: String -> Alphabet readAlphabet = makeAlphabet . map readMap . commentSplit where commentSplit = let splitAt = groupBy (\_ line -> line /= "#OBSERVATIONS:" && line /= "#LAYER:") in map (unlines . tail) . splitAt . lines makeAlphabet (obvMap:tagMaps) = obvMap `seq` tagMaps `seqList` (obvMap, tagMaps)
387
readAlphabet :: String -> Alphabet readAlphabet = makeAlphabet . map readMap . commentSplit where commentSplit = let splitAt = groupBy (\_ line -> line /= "#OBSERVATIONS:" && line /= "#LAYER:") in map (unlines . tail) . splitAt . lines makeAlphabet (obvMap:tagMaps) = obvMap `seq` tagMaps `seqList` (obvMap, tagMaps)
387
readAlphabet = makeAlphabet . map readMap . commentSplit where commentSplit = let splitAt = groupBy (\_ line -> line /= "#OBSERVATIONS:" && line /= "#LAYER:") in map (unlines . tail) . splitAt . lines makeAlphabet (obvMap:tagMaps) = obvMap `seq` tagMaps `seqList` (obvMap, tagMaps)
352
false
true
0
16
118
127
65
62
null
null
maciej-bendkowski/boltzmann-brain
Data/Boltzmann/Internal/Logging.hs
bsd-3-clause
-- | Logs a WARNING message. warn :: String -> IO () warn s = report Log { lvl = Warning, msg = s }
99
warn :: String -> IO () warn s = report Log { lvl = Warning, msg = s }
70
warn s = report Log { lvl = Warning, msg = s }
46
true
true
0
7
24
41
22
19
null
null
jmct/IterativeCompiler
frontend/GMachine.hs
mit
showInstruction (Casejump as) = iConcat ([IStr "Casejump: ", INewline] ++ map showCasejump as)
137
showInstruction (Casejump as) = iConcat ([IStr "Casejump: ", INewline] ++ map showCasejump as)
137
showInstruction (Casejump as) = iConcat ([IStr "Casejump: ", INewline] ++ map showCasejump as)
137
false
false
0
9
55
39
19
20
null
null
bstamour/wordstream
src/Text/WordStream.hs
bsd-3-clause
loadFromFile :: (Ord a, Read a) => FilePath -> IO (Chain n a) loadFromFile = liftM fromList . liftM read . readFile
115
loadFromFile :: (Ord a, Read a) => FilePath -> IO (Chain n a) loadFromFile = liftM fromList . liftM read . readFile
115
loadFromFile = liftM fromList . liftM read . readFile
53
false
true
0
9
21
55
27
28
null
null
kapilash/ccs2cs
src/Language/CCS/Printer.hs
apache-2.0
mCodeBegin :: Doc mCodeBegin = text "--CCS2CS--Macro-Expansions--"
66
mCodeBegin :: Doc mCodeBegin = text "--CCS2CS--Macro-Expansions--"
66
mCodeBegin = text "--CCS2CS--Macro-Expansions--"
48
false
true
0
5
6
14
7
7
null
null
threetreeslight/learning-haskell
practice/patterns.hs
mit
maybe0 (Just x) = x
19
maybe0 (Just x) = x
19
maybe0 (Just x) = x
19
false
false
0
7
4
15
7
8
null
null
Soostone/cereal-io-streams
test/Main.hs
bsd-3-clause
------------------------------------------------------------------------------- prop_roundtrip_Foo = monadicIO $ do a <- (pick arbitrary :: PropertyM IO Foo) res <- run $ getFromStream get =<< putToStream (put a) assert $ a == res -------------------------------------------------------------------------------
332
prop_roundtrip_Foo = monadicIO $ do a <- (pick arbitrary :: PropertyM IO Foo) res <- run $ getFromStream get =<< putToStream (put a) assert $ a == res -------------------------------------------------------------------------------
252
prop_roundtrip_Foo = monadicIO $ do a <- (pick arbitrary :: PropertyM IO Foo) res <- run $ getFromStream get =<< putToStream (put a) assert $ a == res -------------------------------------------------------------------------------
252
true
false
0
12
51
71
34
37
null
null
peteg/TBC
Test/TBC/Core.hs
bsd-3-clause
------------------------------------------------------------------- -- Directory traversal. ------------------------------------------------------------------- -- | Visit all files in a directory tree. -- FIXME try to eliminate the "." with some refactoring. traverseDirectories :: Conventions s -> Driver -> RenderFns s -> [FilePath] -> s -> IO s traverseDirectories convs driver renderer paths s0 = snd `liftM` walk s0 "." paths where fold s path = case cDirectory convs path s of (Cont, s') -> getUsefulContents path >>= walk s' path (Skip, s') -> rSkip renderer path s >> return (Cont, s') as'@(Stop, _s') -> rStop renderer path s >> return as' walk s _ [] = return (Cont, s) walk s path (name:names) = do let path' = path </> name perms <- getPermissions path' as'@(a, s') <- if searchable perms then fold s path' -- It's a directory, Jim. else testFile convs driver renderer s path' -- It's a file. case a of Cont -> walk s' path names _ -> return as' getUsefulContents :: FilePath -> IO [String] getUsefulContents p = filter (`notElem` [".", ".."]) `liftM` getDirectoryContents p -- | Execute all tests in a given test file, if it passes the -- 'cTestFile' convention.
1,340
traverseDirectories :: Conventions s -> Driver -> RenderFns s -> [FilePath] -> s -> IO s traverseDirectories convs driver renderer paths s0 = snd `liftM` walk s0 "." paths where fold s path = case cDirectory convs path s of (Cont, s') -> getUsefulContents path >>= walk s' path (Skip, s') -> rSkip renderer path s >> return (Cont, s') as'@(Stop, _s') -> rStop renderer path s >> return as' walk s _ [] = return (Cont, s) walk s path (name:names) = do let path' = path </> name perms <- getPermissions path' as'@(a, s') <- if searchable perms then fold s path' -- It's a directory, Jim. else testFile convs driver renderer s path' -- It's a file. case a of Cont -> walk s' path names _ -> return as' getUsefulContents :: FilePath -> IO [String] getUsefulContents p = filter (`notElem` [".", ".."]) `liftM` getDirectoryContents p -- | Execute all tests in a given test file, if it passes the -- 'cTestFile' convention.
1,080
traverseDirectories convs driver renderer paths s0 = snd `liftM` walk s0 "." paths where fold s path = case cDirectory convs path s of (Cont, s') -> getUsefulContents path >>= walk s' path (Skip, s') -> rSkip renderer path s >> return (Cont, s') as'@(Stop, _s') -> rStop renderer path s >> return as' walk s _ [] = return (Cont, s) walk s path (name:names) = do let path' = path </> name perms <- getPermissions path' as'@(a, s') <- if searchable perms then fold s path' -- It's a directory, Jim. else testFile convs driver renderer s path' -- It's a file. case a of Cont -> walk s' path names _ -> return as' getUsefulContents :: FilePath -> IO [String] getUsefulContents p = filter (`notElem` [".", ".."]) `liftM` getDirectoryContents p -- | Execute all tests in a given test file, if it passes the -- 'cTestFile' convention.
991
true
true
0
10
354
369
191
178
null
null
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/TargetPools/AddHealthCheck.hs
mpl-2.0
-- | Creates a value of 'TargetPoolsAddHealthCheck' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'tpahcProject' -- -- * 'tpahcTargetPool' -- -- * 'tpahcPayload' -- -- * 'tpahcRegion' targetPoolsAddHealthCheck :: Text -- ^ 'tpahcProject' -> Text -- ^ 'tpahcTargetPool' -> TargetPoolsAddHealthCheckRequest -- ^ 'tpahcPayload' -> Text -- ^ 'tpahcRegion' -> TargetPoolsAddHealthCheck targetPoolsAddHealthCheck pTpahcProject_ pTpahcTargetPool_ pTpahcPayload_ pTpahcRegion_ = TargetPoolsAddHealthCheck' { _tpahcProject = pTpahcProject_ , _tpahcTargetPool = pTpahcTargetPool_ , _tpahcPayload = pTpahcPayload_ , _tpahcRegion = pTpahcRegion_ }
766
targetPoolsAddHealthCheck :: Text -- ^ 'tpahcProject' -> Text -- ^ 'tpahcTargetPool' -> TargetPoolsAddHealthCheckRequest -- ^ 'tpahcPayload' -> Text -- ^ 'tpahcRegion' -> TargetPoolsAddHealthCheck targetPoolsAddHealthCheck pTpahcProject_ pTpahcTargetPool_ pTpahcPayload_ pTpahcRegion_ = TargetPoolsAddHealthCheck' { _tpahcProject = pTpahcProject_ , _tpahcTargetPool = pTpahcTargetPool_ , _tpahcPayload = pTpahcPayload_ , _tpahcRegion = pTpahcRegion_ }
495
targetPoolsAddHealthCheck pTpahcProject_ pTpahcTargetPool_ pTpahcPayload_ pTpahcRegion_ = TargetPoolsAddHealthCheck' { _tpahcProject = pTpahcProject_ , _tpahcTargetPool = pTpahcTargetPool_ , _tpahcPayload = pTpahcPayload_ , _tpahcRegion = pTpahcRegion_ }
278
true
true
0
10
136
86
52
34
null
null
dmvianna/haskellbook
src/Ch15-Semigroups.hs
unlicense
testBDDisj :: BoolDisj -> BoolDisj -> Bool testBDDisj x x' = (\(BoolDisj a) -> a) (x <> x') == (\(BoolDisj a) (BoolDisj b) -> a || b) x x'
156
testBDDisj :: BoolDisj -> BoolDisj -> Bool testBDDisj x x' = (\(BoolDisj a) -> a) (x <> x') == (\(BoolDisj a) (BoolDisj b) -> a || b) x x'
156
testBDDisj x x' = (\(BoolDisj a) -> a) (x <> x') == (\(BoolDisj a) (BoolDisj b) -> a || b) x x'
113
false
true
0
10
46
88
44
44
null
null
ftomassetti/erd-web-server
src/ER.hs
mit
-- | Hard-coded default options for all graph titles. defaultTitleOpts :: Options defaultTitleOpts = M.fromList [ ("size", FontSize 30) ]
141
defaultTitleOpts :: Options defaultTitleOpts = M.fromList [ ("size", FontSize 30) ]
87
defaultTitleOpts = M.fromList [ ("size", FontSize 30) ]
59
true
true
0
7
23
29
16
13
null
null
leshchevds/ganeti
src/Ganeti/Hs2Py/OpDoc.hs
bsd-2-clause
opBackupRemove :: String opBackupRemove = "Remove an instance's export."
74
opBackupRemove :: String opBackupRemove = "Remove an instance's export."
74
opBackupRemove = "Remove an instance's export."
49
false
true
0
4
10
11
6
5
null
null
coinapi/coinapi-sdk
data-api/haskell-rest/Main.hs
mit
period_id = "1HRS"
18
period_id = "1HRS"
18
period_id = "1HRS"
18
false
false
0
4
2
6
3
3
null
null
forste/haReFork
tools/base/defs/UniqueNames.hs
bsd-3-clause
srcLoc = N . Just
17
srcLoc = N . Just
17
srcLoc = N . Just
17
false
false
2
5
4
15
5
10
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
2645 = 2644
11
2645 = 2644
11
2645 = 2644
11
false
false
1
5
2
10
3
7
null
null
shlevy/ghc
compiler/hsSyn/HsPat.hs
bsd-3-clause
hsPatNeedsParens (VarPat {}) = False
44
hsPatNeedsParens (VarPat {}) = False
44
hsPatNeedsParens (VarPat {}) = False
44
false
false
0
7
12
16
8
8
null
null
dysinger/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/ListLocalDisks.hs
mpl-2.0
lldGatewayARN :: Lens' ListLocalDisks Text lldGatewayARN = lens _lldGatewayARN (\s a -> s { _lldGatewayARN = a })
113
lldGatewayARN :: Lens' ListLocalDisks Text lldGatewayARN = lens _lldGatewayARN (\s a -> s { _lldGatewayARN = a })
113
lldGatewayARN = lens _lldGatewayARN (\s a -> s { _lldGatewayARN = a })
70
false
true
0
9
17
39
21
18
null
null
ajnsit/snap-routes
examples/subsites/Main.hs
mit
-- Like getHelloSubRoute, but uses a default greeting -- This shows an example of passing no route argument data to the subsite namasteHelloSubRoute :: MyRoute -> HelloSubRoute namasteHelloSubRoute mr = getHelloSubRoute mr "namaste"
232
namasteHelloSubRoute :: MyRoute -> HelloSubRoute namasteHelloSubRoute mr = getHelloSubRoute mr "namaste"
104
namasteHelloSubRoute mr = getHelloSubRoute mr "namaste"
55
true
true
0
5
32
25
13
12
null
null
JoeyEremondi/elm-pattern-effects
src/Generate/JavaScript/Expression.hs
bsd-3-clause
goto :: String -> [Statement ()] -> (Int, Opt.Expr) -> State Int [Statement ()] goto labelRoot deciderStmts (target, branch) = let labeledDeciderStmt = LabelledStmt () (toLabel labelRoot target) (DoWhileStmt () (BlockStmt () deciderStmts) (BoolLit () False)) in do code <- generateCode branch return (labeledDeciderStmt : toStatementList code)
386
goto :: String -> [Statement ()] -> (Int, Opt.Expr) -> State Int [Statement ()] goto labelRoot deciderStmts (target, branch) = let labeledDeciderStmt = LabelledStmt () (toLabel labelRoot target) (DoWhileStmt () (BlockStmt () deciderStmts) (BoolLit () False)) in do code <- generateCode branch return (labeledDeciderStmt : toStatementList code)
386
goto labelRoot deciderStmts (target, branch) = let labeledDeciderStmt = LabelledStmt () (toLabel labelRoot target) (DoWhileStmt () (BlockStmt () deciderStmts) (BoolLit () False)) in do code <- generateCode branch return (labeledDeciderStmt : toStatementList code)
306
false
true
0
14
89
151
74
77
null
null
jtojnar/hulk
src/Hulk/Client.hs
bsd-3-clause
fromRPL RPL_JOINS = StringCmd "JOIN"
44
fromRPL RPL_JOINS = StringCmd "JOIN"
44
fromRPL RPL_JOINS = StringCmd "JOIN"
44
false
false
0
5
12
13
5
8
null
null
ezyang/ghc
compiler/types/TyCoRep.hs
bsd-3-clause
pprForAll :: [TyVarBinder] -> SDoc pprForAll tvs = pprIfaceForAll (map toIfaceForAllBndr tvs)
93
pprForAll :: [TyVarBinder] -> SDoc pprForAll tvs = pprIfaceForAll (map toIfaceForAllBndr tvs)
93
pprForAll tvs = pprIfaceForAll (map toIfaceForAllBndr tvs)
58
false
true
0
7
11
38
17
21
null
null
phadej/psqueues
tests/Data/PSQ/Class/Tests.hs
bsd-3-clause
prop_insertDeleteView :: forall psq. (PSQ psq, TestKey (Key psq), Arbitrary (psq Int Char), Eq (psq Int Char), Show (psq Int Char)) => Tagged psq (psq Int Char -> Property) prop_insertDeleteView = Tagged $ \t -> forAll arbitraryTestKey $ \k -> forAll arbitraryPriority $ \p -> forAll arbitrary $ \c -> case deleteView k (insert k p c (t :: psq Int Char)) of Nothing -> False Just (p', c', t') | member k t -> p' == p && c' == c && size t' < size t | otherwise -> p' == p && c' == c && t' == t
656
prop_insertDeleteView :: forall psq. (PSQ psq, TestKey (Key psq), Arbitrary (psq Int Char), Eq (psq Int Char), Show (psq Int Char)) => Tagged psq (psq Int Char -> Property) prop_insertDeleteView = Tagged $ \t -> forAll arbitraryTestKey $ \k -> forAll arbitraryPriority $ \p -> forAll arbitrary $ \c -> case deleteView k (insert k p c (t :: psq Int Char)) of Nothing -> False Just (p', c', t') | member k t -> p' == p && c' == c && size t' < size t | otherwise -> p' == p && c' == c && t' == t
656
prop_insertDeleteView = Tagged $ \t -> forAll arbitraryTestKey $ \k -> forAll arbitraryPriority $ \p -> forAll arbitrary $ \c -> case deleteView k (insert k p c (t :: psq Int Char)) of Nothing -> False Just (p', c', t') | member k t -> p' == p && c' == c && size t' < size t | otherwise -> p' == p && c' == c && t' == t
415
false
true
0
15
265
269
132
137
null
null
Ferdinand-vW/collab
server/src/Server.hs
gpl-3.0
servePageIndex :: Server Raw servePageIndex = serveDirectoryFileServer "static/index"
85
servePageIndex :: Server Raw servePageIndex = serveDirectoryFileServer "static/index"
85
servePageIndex = serveDirectoryFileServer "static/index"
56
false
true
0
5
7
17
8
9
null
null