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
GaloisInc/galua
galua/src/Galua/Overloading.hs
mit
getTypeMetatable :: Metas t => t -> ValueType -> IO (Maybe (Reference Table)) getTypeMetatable tabs typ = do metatables <- metas tabs return $! Map.lookup typ metatables -- | Look up the metatable for a value
217
getTypeMetatable :: Metas t => t -> ValueType -> IO (Maybe (Reference Table)) getTypeMetatable tabs typ = do metatables <- metas tabs return $! Map.lookup typ metatables -- | Look up the metatable for a value
217
getTypeMetatable tabs typ = do metatables <- metas tabs return $! Map.lookup typ metatables -- | Look up the metatable for a value
139
false
true
0
12
44
71
33
38
null
null
kim/amazonka
amazonka-datapipeline/gen/Network/AWS/DataPipeline/Types.hs
mpl-2.0
-- | 'PipelineObject' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'po1Fields' @::@ ['Field'] -- -- * 'po1Id' @::@ 'Text' -- -- * 'po1Name' @::@ 'Text' -- pipelineObject :: Text -- ^ 'po1Id' -> Text -- ^ 'po1Name' -> PipelineObject pipelineObject p1 p2 = PipelineObject { _po1Id = p1 , _po1Name = p2 , _po1Fields = mempty }
413
pipelineObject :: Text -- ^ 'po1Id' -> Text -- ^ 'po1Name' -> PipelineObject pipelineObject p1 p2 = PipelineObject { _po1Id = p1 , _po1Name = p2 , _po1Fields = mempty }
220
pipelineObject p1 p2 = PipelineObject { _po1Id = p1 , _po1Name = p2 , _po1Fields = mempty }
113
true
true
0
7
114
60
38
22
null
null
bananu7/H99-solutions
ex-01-28-lists.hs
unlicense
--Ex 12 decode :: (Integral c) => [RleElem c a] -> [a] decode list = foldr (\x acc -> case x of Single elem -> elem:acc Multiple count elem -> (replicate (fromIntegral count) elem) ++ acc) [] list
244
decode :: (Integral c) => [RleElem c a] -> [a] decode list = foldr (\x acc -> case x of Single elem -> elem:acc Multiple count elem -> (replicate (fromIntegral count) elem) ++ acc) [] list
236
decode list = foldr (\x acc -> case x of Single elem -> elem:acc Multiple count elem -> (replicate (fromIntegral count) elem) ++ acc) [] list
189
true
true
0
15
85
110
54
56
null
null
ghc-android/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
integerTyConKey = mkPreludeTyConUnique 22
65
integerTyConKey = mkPreludeTyConUnique 22
65
integerTyConKey = mkPreludeTyConUnique 22
65
false
false
0
5
27
9
4
5
null
null
kaoskorobase/mescaline
resources/hugs/packages/base/Data/IntSet.hs
gpl-3.0
isSubsetOf (Bin p m l r) t = False
35
isSubsetOf (Bin p m l r) t = False
35
isSubsetOf (Bin p m l r) t = False
35
false
false
0
7
9
23
11
12
null
null
zhensydow/ptrader
examples/example03.hs
gpl-3.0
graphThread :: String -> IO ThreadId graphThread filename = do stocks <- fmap (fmap fst) $ runPortfolio ownedStocks filename refvals <- fmap (fmap $ readDef 0) $ getMulValue stocks PreviousClose :: IO [Double] let zeros = replicate (length indexes) 0 forkIO $ runGraph graphConfig (indexes ++ stocks) (zeros ++ refvals) (graphUpdate indexes stocks) -- -----------------------------------------------------------------------------
455
graphThread :: String -> IO ThreadId graphThread filename = do stocks <- fmap (fmap fst) $ runPortfolio ownedStocks filename refvals <- fmap (fmap $ readDef 0) $ getMulValue stocks PreviousClose :: IO [Double] let zeros = replicate (length indexes) 0 forkIO $ runGraph graphConfig (indexes ++ stocks) (zeros ++ refvals) (graphUpdate indexes stocks) -- -----------------------------------------------------------------------------
455
graphThread filename = do stocks <- fmap (fmap fst) $ runPortfolio ownedStocks filename refvals <- fmap (fmap $ readDef 0) $ getMulValue stocks PreviousClose :: IO [Double] let zeros = replicate (length indexes) 0 forkIO $ runGraph graphConfig (indexes ++ stocks) (zeros ++ refvals) (graphUpdate indexes stocks) -- -----------------------------------------------------------------------------
418
false
true
0
13
80
148
69
79
null
null
JacquesCarette/literate-scientific-software
code/drasil-printers/Language/Drasil/TeX/Print.hs
bsd-2-clause
makeDefTable sm ps l = mkEnvArgBr "tabular" (col rr colAwidth ++ col (rr ++ "\\arraybackslash") colBwidth) $ vcat [ command0 "toprule " <> bold (pure $ text "Refname") <> pure (text " & ") <> bold l, --shortname instead of refname? command0 "phantomsection ", label l, makeDRows sm ps, pure $ dbs <+> text "\\bottomrule" ] where col s x = ">" ++ brace s ++ "p" ++ brace (show x ++ tw) rr = "\\raggedright" tw = "\\textwidth"
448
makeDefTable sm ps l = mkEnvArgBr "tabular" (col rr colAwidth ++ col (rr ++ "\\arraybackslash") colBwidth) $ vcat [ command0 "toprule " <> bold (pure $ text "Refname") <> pure (text " & ") <> bold l, --shortname instead of refname? command0 "phantomsection ", label l, makeDRows sm ps, pure $ dbs <+> text "\\bottomrule" ] where col s x = ">" ++ brace s ++ "p" ++ brace (show x ++ tw) rr = "\\raggedright" tw = "\\textwidth"
448
makeDefTable sm ps l = mkEnvArgBr "tabular" (col rr colAwidth ++ col (rr ++ "\\arraybackslash") colBwidth) $ vcat [ command0 "toprule " <> bold (pure $ text "Refname") <> pure (text " & ") <> bold l, --shortname instead of refname? command0 "phantomsection ", label l, makeDRows sm ps, pure $ dbs <+> text "\\bottomrule" ] where col s x = ">" ++ brace s ++ "p" ++ brace (show x ++ tw) rr = "\\raggedright" tw = "\\textwidth"
448
false
false
6
14
102
195
86
109
null
null
drhodes/jade2hdl
rawr/src/Rawr/Note.hs
bsd-3-clause
isNote (Note _) = True
22
isNote (Note _) = True
22
isNote (Note _) = True
22
false
false
0
7
4
15
7
8
null
null
lloydmeta/ip-parsing-hs
src/Data/IpAddress/Internal.hs
mit
baseNToDec :: Num i => i -> (a -> i) -> [a] -> i baseNToDec base toInt = foldl' (\acc n -> base * acc + toInt n ) 0
115
baseNToDec :: Num i => i -> (a -> i) -> [a] -> i baseNToDec base toInt = foldl' (\acc n -> base * acc + toInt n ) 0
115
baseNToDec base toInt = foldl' (\acc n -> base * acc + toInt n ) 0
66
false
true
0
10
29
77
37
40
null
null
tom-lpsd/tokyocabinet-haskell
Database/TokyoCabinet/Internal.hs
bsd-3-clause
getHelper :: (Storable a, Storable b) => FunGet p -> UnLifter tcdb p -> tcdb -> a -> IO (Maybe b) getHelper c_get unlifter tcdb key = withForeignPtr (unlifter tcdb) $ \db -> withPtrLen key $ \(kbuf, ksiz) -> alloca $ \sizbuf -> do vbuf <- c_get db kbuf ksiz sizbuf flip maybePeek vbuf $ \vp -> do siz <- peek sizbuf peekPtrLen (vp, siz)
440
getHelper :: (Storable a, Storable b) => FunGet p -> UnLifter tcdb p -> tcdb -> a -> IO (Maybe b) getHelper c_get unlifter tcdb key = withForeignPtr (unlifter tcdb) $ \db -> withPtrLen key $ \(kbuf, ksiz) -> alloca $ \sizbuf -> do vbuf <- c_get db kbuf ksiz sizbuf flip maybePeek vbuf $ \vp -> do siz <- peek sizbuf peekPtrLen (vp, siz)
440
getHelper c_get unlifter tcdb key = withForeignPtr (unlifter tcdb) $ \db -> withPtrLen key $ \(kbuf, ksiz) -> alloca $ \sizbuf -> do vbuf <- c_get db kbuf ksiz sizbuf flip maybePeek vbuf $ \vp -> do siz <- peek sizbuf peekPtrLen (vp, siz)
329
false
true
0
19
168
173
83
90
null
null
fryguybob/NonEmptyList
Data/List/NonEmpty.hs
bsd-3-clause
-- | Prepends a value to a non-empty list. (.:) :: a -- ^ The value to prepend. -> NonEmpty a -- ^ The non-empty list to prepend to. -> NonEmpty a a .: NonEmpty h t = let !c = h:t in NonEmpty a c
211
(.:) :: a -- ^ The value to prepend. -> NonEmpty a -- ^ The non-empty list to prepend to. -> NonEmpty a a .: NonEmpty h t = let !c = h:t in NonEmpty a c
168
a .: NonEmpty h t = let !c = h:t in NonEmpty a c
48
true
true
0
9
61
63
30
33
null
null
ocharles/virtual-dom
src/VirtualDom/HTML.hs
bsd-3-clause
footer_ :: (Term arg result) => arg -> result footer_ = term "footer"
69
footer_ :: (Term arg result) => arg -> result footer_ = term "footer"
69
footer_ = term "footer"
23
false
true
0
8
12
36
16
20
null
null
harendra-kumar/asyncly
src/Streamly/Streams/StreamDK.hs
bsd-3-clause
unfoldr :: Monad m => (b -> Maybe (a, b)) -> b -> Stream m a unfoldr next s0 = build $ \yld stp -> let go s = case next s of Just (a, b) -> yld a (go b) Nothing -> stp in go s0
228
unfoldr :: Monad m => (b -> Maybe (a, b)) -> b -> Stream m a unfoldr next s0 = build $ \yld stp -> let go s = case next s of Just (a, b) -> yld a (go b) Nothing -> stp in go s0
228
unfoldr next s0 = build $ \yld stp -> let go s = case next s of Just (a, b) -> yld a (go b) Nothing -> stp in go s0
167
false
true
0
16
98
124
59
65
null
null
Crazycolorz5/Haskell-Code
schema.hs
unlicense
orderSchema_rec (sch:schr) acc = orderSchema_rec schr (acc+1)
61
orderSchema_rec (sch:schr) acc = orderSchema_rec schr (acc+1)
61
orderSchema_rec (sch:schr) acc = orderSchema_rec schr (acc+1)
61
false
false
0
7
6
30
15
15
null
null
sol/hspec-experimental
src/Test/Hspec/Experimental.hs
mit
it :: QC.Testable a => String -> a -> Spec it s p = fromSpecList [SpecItem s result] where result c = do -- copied from Test.Hspec.Core.Type r <- QC.quickCheckWithResult (paramsQuickCheckArgs c) p return $ case r of QC.Success {} -> Success QC.Failure {QC.output = e} -> if pendingMarker `isInfixOf` e then Pending Nothing else Fail e QC.GaveUp {QC.numTests = n} -> Fail ("Gave up after " ++ quantify n "test" ) QC.NoExpectedFailure {} -> Fail ("No expected failure")
558
it :: QC.Testable a => String -> a -> Spec it s p = fromSpecList [SpecItem s result] where result c = do -- copied from Test.Hspec.Core.Type r <- QC.quickCheckWithResult (paramsQuickCheckArgs c) p return $ case r of QC.Success {} -> Success QC.Failure {QC.output = e} -> if pendingMarker `isInfixOf` e then Pending Nothing else Fail e QC.GaveUp {QC.numTests = n} -> Fail ("Gave up after " ++ quantify n "test" ) QC.NoExpectedFailure {} -> Fail ("No expected failure")
558
it s p = fromSpecList [SpecItem s result] where result c = do -- copied from Test.Hspec.Core.Type r <- QC.quickCheckWithResult (paramsQuickCheckArgs c) p return $ case r of QC.Success {} -> Success QC.Failure {QC.output = e} -> if pendingMarker `isInfixOf` e then Pending Nothing else Fail e QC.GaveUp {QC.numTests = n} -> Fail ("Gave up after " ++ quantify n "test" ) QC.NoExpectedFailure {} -> Fail ("No expected failure")
515
false
true
1
15
169
199
95
104
null
null
kowey/conceptdiagram-examples
conceptdiagram-examples.hs
bsd-3-clause
subsumedCurve :: String -> Diagram B R2 subsumedCurve = namedCurve' subsumedCurveProps
86
subsumedCurve :: String -> Diagram B R2 subsumedCurve = namedCurve' subsumedCurveProps
86
subsumedCurve = namedCurve' subsumedCurveProps
46
false
true
0
6
10
23
11
12
null
null
Athas/Sindre
Sindre/Sindre.hs
mit
splitHoriz :: Rectangle -> [DimNeed] -> [Rectangle] splitHoriz (Rectangle x1 y1 w h) parts = snd $ mapAccumL mkRect y1 $ map fst $ zipper adjust $ zip (divide h nparts) parts where nparts = genericLength parts mkRect y h' = (y+h', Rectangle x1 y w h') grab d (v, Min mv) | d > 0 = let d' = max 0 $ min d (v-mv) in ((v-d', Min mv), d-d') | otherwise = ((v-d, Min mv), 0) grab d (v, Max mv) | d > 0 = let d' = min v d in ((v-d', Max mv), d-d') | otherwise = let d' = max (v-mv) d in ((v-d', Max mv), d-d') grab d (v, Unlimited) = let v' = max 0 $ v - d in ((v', Unlimited), v'-v+d) grab d (v, Exact ev) | v > ev = let d' = min v $ min d $ v-ev in ((v-d', Exact ev), d-d') | v < ev = let d' = min v $ min d $ ev-v in ((v-d', Exact ev), d-d') | otherwise = ((v, Exact ev), d) maybeGrab (d:ds) ((x, True):xs) = (case grab d x of (x',0) -> ((x',True),0) (x',d') -> ((x',False),d')) : maybeGrab ds xs maybeGrab ds ((x, False):xs) = ((x,False),0) : maybeGrab ds xs maybeGrab _ _ = [] obtain v bef aft = case (filter snd bef, filter snd aft) of ([],[]) -> (bef,aft,v) (bef',aft') -> let q = divide v $ genericLength $ bef'++aft' n = length bef' (bef'',x) = unzip $ maybeGrab q bef (aft'',y) = unzip $ maybeGrab (drop n q) aft r = sum x + sum y in if r /= 0 then obtain r bef'' aft'' else (bef'',aft'', r) adjust (bef, (v, Min mv), aft) | v < mv = adjust' Min bef v mv aft adjust (bef, (v, Max mv), aft) | v > mv = adjust' Max bef v mv aft adjust (bef, (v, Exact ev), aft) | v /= ev = adjust' Exact bef v ev aft adjust x = x adjust' f bef v mv aft = let (bef', aft', d) = obtain (mv-v) (map (,True) bef) (map (,True) aft) in (map fst bef', (v+(mv-v)-d, f mv), map fst aft') -- | As @splitHoriz@, but splits vertically instead of horizontally, -- so the rectangles will be next to each other.
2,607
splitHoriz :: Rectangle -> [DimNeed] -> [Rectangle] splitHoriz (Rectangle x1 y1 w h) parts = snd $ mapAccumL mkRect y1 $ map fst $ zipper adjust $ zip (divide h nparts) parts where nparts = genericLength parts mkRect y h' = (y+h', Rectangle x1 y w h') grab d (v, Min mv) | d > 0 = let d' = max 0 $ min d (v-mv) in ((v-d', Min mv), d-d') | otherwise = ((v-d, Min mv), 0) grab d (v, Max mv) | d > 0 = let d' = min v d in ((v-d', Max mv), d-d') | otherwise = let d' = max (v-mv) d in ((v-d', Max mv), d-d') grab d (v, Unlimited) = let v' = max 0 $ v - d in ((v', Unlimited), v'-v+d) grab d (v, Exact ev) | v > ev = let d' = min v $ min d $ v-ev in ((v-d', Exact ev), d-d') | v < ev = let d' = min v $ min d $ ev-v in ((v-d', Exact ev), d-d') | otherwise = ((v, Exact ev), d) maybeGrab (d:ds) ((x, True):xs) = (case grab d x of (x',0) -> ((x',True),0) (x',d') -> ((x',False),d')) : maybeGrab ds xs maybeGrab ds ((x, False):xs) = ((x,False),0) : maybeGrab ds xs maybeGrab _ _ = [] obtain v bef aft = case (filter snd bef, filter snd aft) of ([],[]) -> (bef,aft,v) (bef',aft') -> let q = divide v $ genericLength $ bef'++aft' n = length bef' (bef'',x) = unzip $ maybeGrab q bef (aft'',y) = unzip $ maybeGrab (drop n q) aft r = sum x + sum y in if r /= 0 then obtain r bef'' aft'' else (bef'',aft'', r) adjust (bef, (v, Min mv), aft) | v < mv = adjust' Min bef v mv aft adjust (bef, (v, Max mv), aft) | v > mv = adjust' Max bef v mv aft adjust (bef, (v, Exact ev), aft) | v /= ev = adjust' Exact bef v ev aft adjust x = x adjust' f bef v mv aft = let (bef', aft', d) = obtain (mv-v) (map (,True) bef) (map (,True) aft) in (map fst bef', (v+(mv-v)-d, f mv), map fst aft') -- | As @splitHoriz@, but splits vertically instead of horizontally, -- so the rectangles will be next to each other.
2,607
splitHoriz (Rectangle x1 y1 w h) parts = snd $ mapAccumL mkRect y1 $ map fst $ zipper adjust $ zip (divide h nparts) parts where nparts = genericLength parts mkRect y h' = (y+h', Rectangle x1 y w h') grab d (v, Min mv) | d > 0 = let d' = max 0 $ min d (v-mv) in ((v-d', Min mv), d-d') | otherwise = ((v-d, Min mv), 0) grab d (v, Max mv) | d > 0 = let d' = min v d in ((v-d', Max mv), d-d') | otherwise = let d' = max (v-mv) d in ((v-d', Max mv), d-d') grab d (v, Unlimited) = let v' = max 0 $ v - d in ((v', Unlimited), v'-v+d) grab d (v, Exact ev) | v > ev = let d' = min v $ min d $ v-ev in ((v-d', Exact ev), d-d') | v < ev = let d' = min v $ min d $ ev-v in ((v-d', Exact ev), d-d') | otherwise = ((v, Exact ev), d) maybeGrab (d:ds) ((x, True):xs) = (case grab d x of (x',0) -> ((x',True),0) (x',d') -> ((x',False),d')) : maybeGrab ds xs maybeGrab ds ((x, False):xs) = ((x,False),0) : maybeGrab ds xs maybeGrab _ _ = [] obtain v bef aft = case (filter snd bef, filter snd aft) of ([],[]) -> (bef,aft,v) (bef',aft') -> let q = divide v $ genericLength $ bef'++aft' n = length bef' (bef'',x) = unzip $ maybeGrab q bef (aft'',y) = unzip $ maybeGrab (drop n q) aft r = sum x + sum y in if r /= 0 then obtain r bef'' aft'' else (bef'',aft'', r) adjust (bef, (v, Min mv), aft) | v < mv = adjust' Min bef v mv aft adjust (bef, (v, Max mv), aft) | v > mv = adjust' Max bef v mv aft adjust (bef, (v, Exact ev), aft) | v /= ev = adjust' Exact bef v ev aft adjust x = x adjust' f bef v mv aft = let (bef', aft', d) = obtain (mv-v) (map (,True) bef) (map (,True) aft) in (map fst bef', (v+(mv-v)-d, f mv), map fst aft') -- | As @splitHoriz@, but splits vertically instead of horizontally, -- so the rectangles will be next to each other.
2,555
false
true
0
17
1,215
1,202
626
576
null
null
karamellpelle/grid
source/Game/LevelPuzzle/Helpers/PlayerPath.hs
gpl-3.0
savePlayerPathEmpty :: LevelPuzzleWorld -> MEnv' () savePlayerPathEmpty lvl = do path <- filePlayerPathEmpty $ takeFileName (levelpuzzleFile lvl) ++ show (levelpuzzleLevelIx lvl) ++ ".plp" writeBinary' (wPlayerPath player lvl) path
280
savePlayerPathEmpty :: LevelPuzzleWorld -> MEnv' () savePlayerPathEmpty lvl = do path <- filePlayerPathEmpty $ takeFileName (levelpuzzleFile lvl) ++ show (levelpuzzleLevelIx lvl) ++ ".plp" writeBinary' (wPlayerPath player lvl) path
280
savePlayerPathEmpty lvl = do path <- filePlayerPathEmpty $ takeFileName (levelpuzzleFile lvl) ++ show (levelpuzzleLevelIx lvl) ++ ".plp" writeBinary' (wPlayerPath player lvl) path
228
false
true
0
13
76
76
35
41
null
null
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/UI/UI.hs
mit
uiSetCustomSize :: (Pointer p a, Parent UI a, MonadIO m) => p -- ^ Pointer to UI object -> IntVector2 -- ^ size -> m () uiSetCustomSize p v = liftIO $ with v $ \v' -> do let ptr = parentPointer p [C.exp| void { $(UI* ptr)->SetCustomSize(*$(IntVector2* v')) } |] -- | Return root UI element. -- UIElement* GetRoot() const { return rootElement_; }
356
uiSetCustomSize :: (Pointer p a, Parent UI a, MonadIO m) => p -- ^ Pointer to UI object -> IntVector2 -- ^ size -> m () uiSetCustomSize p v = liftIO $ with v $ \v' -> do let ptr = parentPointer p [C.exp| void { $(UI* ptr)->SetCustomSize(*$(IntVector2* v')) } |] -- | Return root UI element. -- UIElement* GetRoot() const { return rootElement_; }
356
uiSetCustomSize p v = liftIO $ with v $ \v' -> do let ptr = parentPointer p [C.exp| void { $(UI* ptr)->SetCustomSize(*$(IntVector2* v')) } |] -- | Return root UI element. -- UIElement* GetRoot() const { return rootElement_; }
230
false
true
0
12
75
96
50
46
null
null
nomeata/gipeda
src/BenchmarkSettings.hs
mit
matches :: String -> String -> Bool matches [] [] = True
56
matches :: String -> String -> Bool matches [] [] = True
56
matches [] [] = True
20
false
true
0
9
11
34
15
19
null
null
np/lens
src/Data/ByteString/Strict/Lens.hs
bsd-3-clause
-- | Traverse the individual bytes in a 'ByteString' as characters. -- -- When writing back to the 'ByteString' it is assumed that every 'Char' -- lies between '\x00' and '\xff'. -- -- @'chars' = 'from' 'packedChars' . 'traverse'@ -- -- @'anyOf' 'chars' ('==' \'c\') :: 'ByteString' -> 'Bool'@ chars :: IndexedTraversal' Int ByteString Char chars = from packedChars . itraversed
378
chars :: IndexedTraversal' Int ByteString Char chars = from packedChars . itraversed
84
chars = from packedChars . itraversed
37
true
true
0
6
60
33
20
13
null
null
deggis/guesswork
src/Guesswork/Import/ReadFiles.hs
bsd-3-clause
loadENVI :: FilePath -> IO (ImageInWorld (Image GrayScale D32)) loadENVI (dropExtension->path) = do hdrS <- readFile (path++".hdr") let hdr = parseENVIHeader (undefined :: Image GrayScale D32) hdrS loadENVIImage hdr (path++".envi")
244
loadENVI :: FilePath -> IO (ImageInWorld (Image GrayScale D32)) loadENVI (dropExtension->path) = do hdrS <- readFile (path++".hdr") let hdr = parseENVIHeader (undefined :: Image GrayScale D32) hdrS loadENVIImage hdr (path++".envi")
244
loadENVI (dropExtension->path) = do hdrS <- readFile (path++".hdr") let hdr = parseENVIHeader (undefined :: Image GrayScale D32) hdrS loadENVIImage hdr (path++".envi")
180
false
true
0
12
42
99
48
51
null
null
lihlcnkr/codejam
src/QR/TidyNumbers.hs
apache-2.0
haveSamRow :: (Int,Int) -> (Int,Int) -> (Int, Int) -> (Int, Int) -> Bool haveSamRow (hx,hy) (ix,iy) (jx,jy) (kx,ky) = (hx == ix) && (ix == jx) && (jx == kx) && (hy == iy+1) && (iy == jy+1) && (jy == ky +1)
205
haveSamRow :: (Int,Int) -> (Int,Int) -> (Int, Int) -> (Int, Int) -> Bool haveSamRow (hx,hy) (ix,iy) (jx,jy) (kx,ky) = (hx == ix) && (ix == jx) && (jx == kx) && (hy == iy+1) && (iy == jy+1) && (jy == ky +1)
205
haveSamRow (hx,hy) (ix,iy) (jx,jy) (kx,ky) = (hx == ix) && (ix == jx) && (jx == kx) && (hy == iy+1) && (iy == jy+1) && (jy == ky +1)
132
false
true
0
11
42
164
91
73
null
null
ganeti/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
opPrioSubmitValid :: FrozenSet Int opPrioSubmitValid = ConstantUtils.mkSet [opPrioLow, opPrioNormal, opPrioHigh]
112
opPrioSubmitValid :: FrozenSet Int opPrioSubmitValid = ConstantUtils.mkSet [opPrioLow, opPrioNormal, opPrioHigh]
112
opPrioSubmitValid = ConstantUtils.mkSet [opPrioLow, opPrioNormal, opPrioHigh]
77
false
true
0
6
9
28
15
13
null
null
forste/haReFork
refactorer/RefacGenFold.hs
bsd-3-clause
expToPat (Exp (HsInfixApp e1 (HsVar i) e2)) = [Pat (HsPInfixApp (ghead "expToPat" $ expToPat e1) i (ghead "expToPat" $ expToPat e2))]
195
expToPat (Exp (HsInfixApp e1 (HsVar i) e2)) = [Pat (HsPInfixApp (ghead "expToPat" $ expToPat e1) i (ghead "expToPat" $ expToPat e2))]
195
expToPat (Exp (HsInfixApp e1 (HsVar i) e2)) = [Pat (HsPInfixApp (ghead "expToPat" $ expToPat e1) i (ghead "expToPat" $ expToPat e2))]
195
false
false
0
11
82
73
35
38
null
null
krisajenkins/elm-export
test/ExportSpec.hs
epl-1.0
initCap :: Text -> Text initCap t = case uncons t of Nothing -> t Just (c, cs) -> cons (Data.Char.toUpper c) cs
126
initCap :: Text -> Text initCap t = case uncons t of Nothing -> t Just (c, cs) -> cons (Data.Char.toUpper c) cs
126
initCap t = case uncons t of Nothing -> t Just (c, cs) -> cons (Data.Char.toUpper c) cs
102
false
true
0
11
37
60
30
30
null
null
jwiegley/ghc-release
libraries/containers/Data/Set/Base.hs
gpl-3.0
{-------------------------------------------------------------------- Minimal, Maximal --------------------------------------------------------------------} -- | /O(log n)/. The minimal element of a set. findMin :: Set a -> a findMin (Bin _ x Tip _) = x
255
findMin :: Set a -> a findMin (Bin _ x Tip _) = x
49
findMin (Bin _ x Tip _) = x
27
true
true
0
7
29
35
18
17
null
null
uduki/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qKeySequenceAddFinalizer :: QKeySequence a -> IO () qKeySequenceAddFinalizer (Object fp) = addForeignPtrFinalizer qtc_QKeySequence_getFinalizer fp
148
qKeySequenceAddFinalizer :: QKeySequence a -> IO () qKeySequenceAddFinalizer (Object fp) = addForeignPtrFinalizer qtc_QKeySequence_getFinalizer fp
148
qKeySequenceAddFinalizer (Object fp) = addForeignPtrFinalizer qtc_QKeySequence_getFinalizer fp
96
false
true
0
7
15
37
17
20
null
null
ethercrow/y
src/Y/Buffer.hs
bsd-3-clause
atSof _ = False
15
atSof _ = False
15
atSof _ = False
15
false
false
0
5
3
9
4
5
null
null
robeverest/accelerate
Data/Array/Accelerate/Interpreter.hs
bsd-3-clause
evalPrim (PrimLog ty) = evalLog ty
46
evalPrim (PrimLog ty) = evalLog ty
46
evalPrim (PrimLog ty) = evalLog ty
46
false
false
0
7
17
18
8
10
null
null
Twinside/pandoc
src/Text/Pandoc/ImageSize.hs
gpl-2.0
imageType :: ByteString -> Maybe ImageType imageType img = case B.take 4 img of "\xff\xd8\xff\xe0" -> return Jpeg -- JFIF "\xff\xd8\xff\xe1" -> return Jpeg -- Exif "%PDF" -> return Pdf "%!PS" | (B.take 4 $ B.drop 1 $ B.dropWhile (/=' ') img) == "EPSF" -> return Eps _ -> mzero
342
imageType :: ByteString -> Maybe ImageType imageType img = case B.take 4 img of "\xff\xd8\xff\xe0" -> return Jpeg -- JFIF "\xff\xd8\xff\xe1" -> return Jpeg -- Exif "%PDF" -> return Pdf "%!PS" | (B.take 4 $ B.drop 1 $ B.dropWhile (/=' ') img) == "EPSF" -> return Eps _ -> mzero
342
imageType img = case B.take 4 img of "\xff\xd8\xff\xe0" -> return Jpeg -- JFIF "\xff\xd8\xff\xe1" -> return Jpeg -- Exif "%PDF" -> return Pdf "%!PS" | (B.take 4 $ B.drop 1 $ B.dropWhile (/=' ') img) == "EPSF" -> return Eps _ -> mzero
299
false
true
0
16
115
123
57
66
null
null
triplepointfive/cereal
src/Data/Serialize/Get.hs
bsd-3-clause
-- | Run the Get monad applies a 'get'-based parser on the input ByteString runGet :: Get a -> B.ByteString -> Either String a runGet m str = case unGet m str Nothing Complete failK finalK of Fail i _ -> Left i Done a _ -> Right a Partial{} -> Left "Failed reading: Internal error: unexpected Partial."
319
runGet :: Get a -> B.ByteString -> Either String a runGet m str = case unGet m str Nothing Complete failK finalK of Fail i _ -> Left i Done a _ -> Right a Partial{} -> Left "Failed reading: Internal error: unexpected Partial."
243
runGet m str = case unGet m str Nothing Complete failK finalK of Fail i _ -> Left i Done a _ -> Right a Partial{} -> Left "Failed reading: Internal error: unexpected Partial."
192
true
true
0
8
74
93
43
50
null
null
ganeti/ganeti
test/hs/Test/Ganeti/TestCommon.hs
bsd-2-clause
genNonNegative :: Gen Int genNonNegative = fmap fromEnum (arbitrary::Gen (Test.QuickCheck.NonNegative Int))
109
genNonNegative :: Gen Int genNonNegative = fmap fromEnum (arbitrary::Gen (Test.QuickCheck.NonNegative Int))
109
genNonNegative = fmap fromEnum (arbitrary::Gen (Test.QuickCheck.NonNegative Int))
83
false
true
0
9
12
43
20
23
null
null
sonyandy/tnt
Control/Monad/Code/Internal.hs
bsd-3-clause
aaload = insn (-1) Opcode.aaload
32
aaload = insn (-1) Opcode.aaload
32
aaload = insn (-1) Opcode.aaload
32
false
false
0
7
4
18
9
9
null
null
rueshyna/gogol
gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/Aliases/Delete.hs
mpl-2.0
-- | Identifier of the course whose alias should be deleted. This identifier -- can be either the Classroom-assigned identifier or an alias. cadCourseId :: Lens' CoursesAliasesDelete Text cadCourseId = lens _cadCourseId (\ s a -> s{_cadCourseId = a})
252
cadCourseId :: Lens' CoursesAliasesDelete Text cadCourseId = lens _cadCourseId (\ s a -> s{_cadCourseId = a})
111
cadCourseId = lens _cadCourseId (\ s a -> s{_cadCourseId = a})
64
true
true
1
9
40
45
23
22
null
null
uduki/hsQt
Qtc/Gui/QPushButton.hs
bsd-2-clause
setDefault :: QPushButton a -> ((Bool)) -> IO () setDefault x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QPushButton_setDefault cobj_x0 (toCBool x1)
154
setDefault :: QPushButton a -> ((Bool)) -> IO () setDefault x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QPushButton_setDefault cobj_x0 (toCBool x1)
154
setDefault x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QPushButton_setDefault cobj_x0 (toCBool x1)
105
false
true
0
9
27
64
32
32
null
null
alios/bittorrent
Data/Bittorrent/Types.hs
bsd-3-clause
getDictList :: String -> (TT TDict) -> Maybe (TT TList) getDictList k (TD d) = let r = M.lookup (TS $ UTF8.encode k) d in case (r) of Nothing -> Nothing Just s -> fromTorrentType s
193
getDictList :: String -> (TT TDict) -> Maybe (TT TList) getDictList k (TD d) = let r = M.lookup (TS $ UTF8.encode k) d in case (r) of Nothing -> Nothing Just s -> fromTorrentType s
193
getDictList k (TD d) = let r = M.lookup (TS $ UTF8.encode k) d in case (r) of Nothing -> Nothing Just s -> fromTorrentType s
137
false
true
0
13
48
100
48
52
null
null
kyagrd/hs-nipkow-lics93
src/Syntax.hs
bsd-2-clause
stepWH (App (Lam b) t2) = do (x,t) <- unbind b; stepBN $ subst x t2 t
70
stepWH (App (Lam b) t2) = do (x,t) <- unbind b; stepBN $ subst x t2 t
70
stepWH (App (Lam b) t2) = do (x,t) <- unbind b; stepBN $ subst x t2 t
70
false
false
0
8
17
55
26
29
null
null
ku00/meow
src/Task.hs
bsd-3-clause
initialize :: IO () initialize = do getHomeDirectory >>= setCurrentDirectory createDirectoryIfMissing True ".meow/tasks"
124
initialize :: IO () initialize = do getHomeDirectory >>= setCurrentDirectory createDirectoryIfMissing True ".meow/tasks"
124
initialize = do getHomeDirectory >>= setCurrentDirectory createDirectoryIfMissing True ".meow/tasks"
104
false
true
0
7
16
31
14
17
null
null
carbolymer/blockchain
blockchain-ui/src/Blockchain/UI/Core.hs
apache-2.0
mineOnNode :: AppState -> Text -> IO StatusMessage mineOnNode app nodeId = do let filterNodeById = filter ((== nodeId) . id) maybeTargetNode <- listToMaybe <$> filterNodeById <$> (readIORef $ nodes app) case maybeTargetNode of Nothing -> return $ StatusMessage ERROR "Node does not exist" Just targetNode -> do let node = nodeDtoToNode targetNode result <- runRequests $ [NodeRequest node (mineBlock $ restClient app)] mapM_ (warnL . show) (lefts result) return $ case rights result of [] -> StatusMessage ERROR "No block was mined" [Nothing] -> StatusMessage ERROR "New block was mined, but could not be attached to the blockchain" [Just _] -> StatusMessage INFO "Block was mined successfully" impossibleCase -> StatusMessage ERROR $ pack $ "Impossible case: " ++ (show impossibleCase)
856
mineOnNode :: AppState -> Text -> IO StatusMessage mineOnNode app nodeId = do let filterNodeById = filter ((== nodeId) . id) maybeTargetNode <- listToMaybe <$> filterNodeById <$> (readIORef $ nodes app) case maybeTargetNode of Nothing -> return $ StatusMessage ERROR "Node does not exist" Just targetNode -> do let node = nodeDtoToNode targetNode result <- runRequests $ [NodeRequest node (mineBlock $ restClient app)] mapM_ (warnL . show) (lefts result) return $ case rights result of [] -> StatusMessage ERROR "No block was mined" [Nothing] -> StatusMessage ERROR "New block was mined, but could not be attached to the blockchain" [Just _] -> StatusMessage INFO "Block was mined successfully" impossibleCase -> StatusMessage ERROR $ pack $ "Impossible case: " ++ (show impossibleCase)
856
mineOnNode app nodeId = do let filterNodeById = filter ((== nodeId) . id) maybeTargetNode <- listToMaybe <$> filterNodeById <$> (readIORef $ nodes app) case maybeTargetNode of Nothing -> return $ StatusMessage ERROR "Node does not exist" Just targetNode -> do let node = nodeDtoToNode targetNode result <- runRequests $ [NodeRequest node (mineBlock $ restClient app)] mapM_ (warnL . show) (lefts result) return $ case rights result of [] -> StatusMessage ERROR "No block was mined" [Nothing] -> StatusMessage ERROR "New block was mined, but could not be attached to the blockchain" [Just _] -> StatusMessage INFO "Block was mined successfully" impossibleCase -> StatusMessage ERROR $ pack $ "Impossible case: " ++ (show impossibleCase)
805
false
true
0
19
190
253
120
133
null
null
farrellm/advent-2016
src/Day15.hs
mit
isOpen :: Disc -> Bool isOpen d = curPos d == 0
47
isOpen :: Disc -> Bool isOpen d = curPos d == 0
47
isOpen d = curPos d == 0
24
false
true
0
6
11
25
12
13
null
null
mapinguari/SC_HS_Proxy
src/Proxy/Query/Unit.hs
mit
isBuilding SpecialOvermindWithShell = False
43
isBuilding SpecialOvermindWithShell = False
43
isBuilding SpecialOvermindWithShell = False
43
false
false
0
5
3
9
4
5
null
null
silky/csound-expression
src/Csound/Air/Envelope.hs
bsd-3-clause
simpleSeq0 loopFun = seqGen0 loopFun $ \dt val -> [val, dt]
59
simpleSeq0 loopFun = seqGen0 loopFun $ \dt val -> [val, dt]
59
simpleSeq0 loopFun = seqGen0 loopFun $ \dt val -> [val, dt]
59
false
false
0
7
10
29
15
14
null
null
mettekou/ghc
compiler/prelude/TysWiredIn.hs
bsd-3-clause
mkTupleOcc ns Unboxed ar = mkOccName ns (mkUnboxedTupleStr ar)
62
mkTupleOcc ns Unboxed ar = mkOccName ns (mkUnboxedTupleStr ar)
62
mkTupleOcc ns Unboxed ar = mkOccName ns (mkUnboxedTupleStr ar)
62
false
false
0
7
8
24
11
13
null
null
mokus0/s-expression
src/Text/SExpr/Convert.hs
bsd-3-clause
readsSExpr :: (Atom a, List l) => ReadS (SExpr l a) readsSExpr str = case runParser parse () "<readSExpr>" str of Left _err -> [] Right x -> [x] where parse = do s <- sexpr parseAtom parseList optional (char '\NUL') rest <- many anyChar return (s, rest)
328
readsSExpr :: (Atom a, List l) => ReadS (SExpr l a) readsSExpr str = case runParser parse () "<readSExpr>" str of Left _err -> [] Right x -> [x] where parse = do s <- sexpr parseAtom parseList optional (char '\NUL') rest <- many anyChar return (s, rest)
328
readsSExpr str = case runParser parse () "<readSExpr>" str of Left _err -> [] Right x -> [x] where parse = do s <- sexpr parseAtom parseList optional (char '\NUL') rest <- many anyChar return (s, rest)
276
false
true
0
11
122
131
62
69
null
null
rolph-recto/liquidhaskell
src/Language/Haskell/Liquid/Bare/Measure.hs
bsd-3-clause
makeClassMeasureSpec (Ms.MSpec {..}) = tx <$> M.elems cmeasMap where tx (M n s _) = (n, CM n (mapReft ur_reft s) -- [(t,m) | (IM n' t m) <- imeas, n == n'] )
182
makeClassMeasureSpec (Ms.MSpec {..}) = tx <$> M.elems cmeasMap where tx (M n s _) = (n, CM n (mapReft ur_reft s) -- [(t,m) | (IM n' t m) <- imeas, n == n'] )
182
makeClassMeasureSpec (Ms.MSpec {..}) = tx <$> M.elems cmeasMap where tx (M n s _) = (n, CM n (mapReft ur_reft s) -- [(t,m) | (IM n' t m) <- imeas, n == n'] )
182
false
false
0
8
58
72
35
37
null
null
sdiehl/ghc
compiler/deSugar/Coverage.hs
bsd-3-clause
getCCIndexM :: FastString -> TM CostCentreIndex getCCIndexM n = TM $ \_ st -> let (idx, is') = getCCIndex n $ ccIndices st in (idx, noFVs, st { ccIndices = is' })
241
getCCIndexM :: FastString -> TM CostCentreIndex getCCIndexM n = TM $ \_ st -> let (idx, is') = getCCIndex n $ ccIndices st in (idx, noFVs, st { ccIndices = is' })
241
getCCIndexM n = TM $ \_ st -> let (idx, is') = getCCIndex n $ ccIndices st in (idx, noFVs, st { ccIndices = is' })
193
false
true
0
12
110
77
40
37
null
null
geophf/1HaskellADay
exercises/HAD/Y2021/M03/D23/Solution.hs
mit
repl' :: Stack -> IO () repl' stk = putStr "OK> " >> getLine >>= \str -> if str == "bye" then putStrLn "Thank you for FORTHing! :)" else cont str stk
161
repl' :: Stack -> IO () repl' stk = putStr "OK> " >> getLine >>= \str -> if str == "bye" then putStrLn "Thank you for FORTHing! :)" else cont str stk
161
repl' stk = putStr "OK> " >> getLine >>= \str -> if str == "bye" then putStrLn "Thank you for FORTHing! :)" else cont str stk
137
false
true
0
8
43
59
29
30
null
null
nkpart/score-writer
src/Score/Render.hs
bsd-3-clause
mark :: [L.Music] mark = [L.Set "Score.markFormatter" (L.toLiteralValue "#format-mark-box-numbers") ,L.Raw "\\mark \\default"]
130
mark :: [L.Music] mark = [L.Set "Score.markFormatter" (L.toLiteralValue "#format-mark-box-numbers") ,L.Raw "\\mark \\default"]
130
mark = [L.Set "Score.markFormatter" (L.toLiteralValue "#format-mark-box-numbers") ,L.Raw "\\mark \\default"]
112
false
true
0
9
15
42
22
20
null
null
olsner/ghc
utils/ghc-cabal/Main.hs
bsd-3-clause
updateInstallDirTemplates :: Bool -> FilePath -> FilePath -> FilePath -> InstallDirTemplates -> InstallDirTemplates updateInstallDirTemplates relocatableBuild myPrefix myLibdir myDocdir idts = idts { prefix = toPathTemplate $ if relocatableBuild then "$topdir" else myPrefix, libdir = toPathTemplate $ if relocatableBuild then "$topdir" else myLibdir, dynlibdir = toPathTemplate $ (if relocatableBuild then "$topdir" else myLibdir) </> "$libname", libsubdir = toPathTemplate "$libname", docdir = toPathTemplate $ if relocatableBuild then "$topdir/../doc/html/libraries/$pkgid" else (myDocdir </> "$pkgid"), htmldir = toPathTemplate "$docdir" }
1,088
updateInstallDirTemplates :: Bool -> FilePath -> FilePath -> FilePath -> InstallDirTemplates -> InstallDirTemplates updateInstallDirTemplates relocatableBuild myPrefix myLibdir myDocdir idts = idts { prefix = toPathTemplate $ if relocatableBuild then "$topdir" else myPrefix, libdir = toPathTemplate $ if relocatableBuild then "$topdir" else myLibdir, dynlibdir = toPathTemplate $ (if relocatableBuild then "$topdir" else myLibdir) </> "$libname", libsubdir = toPathTemplate "$libname", docdir = toPathTemplate $ if relocatableBuild then "$topdir/../doc/html/libraries/$pkgid" else (myDocdir </> "$pkgid"), htmldir = toPathTemplate "$docdir" }
1,088
updateInstallDirTemplates relocatableBuild myPrefix myLibdir myDocdir idts = idts { prefix = toPathTemplate $ if relocatableBuild then "$topdir" else myPrefix, libdir = toPathTemplate $ if relocatableBuild then "$topdir" else myLibdir, dynlibdir = toPathTemplate $ (if relocatableBuild then "$topdir" else myLibdir) </> "$libname", libsubdir = toPathTemplate "$libname", docdir = toPathTemplate $ if relocatableBuild then "$topdir/../doc/html/libraries/$pkgid" else (myDocdir </> "$pkgid"), htmldir = toPathTemplate "$docdir" }
920
false
true
0
11
519
152
85
67
null
null
juodaspaulius/clafer-old-customBNFC
src/Language/Clafer/Optimizer/Optimizer.hs
mit
expSuper :: MonadState GEnv m => ISuper -> m ISuper expSuper x = case x of ISuper False _ -> return x ISuper True pexps -> ISuper True `liftM` mapM expPExp pexps
165
expSuper :: MonadState GEnv m => ISuper -> m ISuper expSuper x = case x of ISuper False _ -> return x ISuper True pexps -> ISuper True `liftM` mapM expPExp pexps
165
expSuper x = case x of ISuper False _ -> return x ISuper True pexps -> ISuper True `liftM` mapM expPExp pexps
113
false
true
0
9
35
73
34
39
null
null
dan-t/cabal-bounds
lib/CabalBounds/Update.hs
bsd-3-clause
nextVersion :: VersionComp -> V.Version -> V.Version nextVersion comp version = (comp `compOf` version) & CL.versionBranchL %~ ensureMinimalVersionBranch comp & CL.versionBranchL . _last %~ (+ 1)
218
nextVersion :: VersionComp -> V.Version -> V.Version nextVersion comp version = (comp `compOf` version) & CL.versionBranchL %~ ensureMinimalVersionBranch comp & CL.versionBranchL . _last %~ (+ 1)
218
nextVersion comp version = (comp `compOf` version) & CL.versionBranchL %~ ensureMinimalVersionBranch comp & CL.versionBranchL . _last %~ (+ 1)
165
false
true
0
11
48
68
36
32
null
null
corajr/servant-state-graph
test/Servant/StateGraph/Graph/RichEndpointSpec.hs
bsd-3-clause
eCaptureAll' :: RichEndpoint eCaptureAll' = eGet' { _apiLink = ApiLink [":id"] [] }
83
eCaptureAll' :: RichEndpoint eCaptureAll' = eGet' { _apiLink = ApiLink [":id"] [] }
83
eCaptureAll' = eGet' { _apiLink = ApiLink [":id"] [] }
54
false
true
0
8
12
29
16
13
null
null
green-haskell/ghc
compiler/ghci/ByteCodeGen.hs
bsd-3-clause
mkConAppCode :: Word -> Sequel -> BCEnv -> DataCon -- The data constructor -> [AnnExpr' Id VarSet] -- Args, in *reverse* order -> BcM BCInstrList mkConAppCode _ _ _ con [] -- Nullary constructor = ASSERT( isNullaryRepDataCon con ) return (unitOL (PUSH_G (getName (dataConWorkId con))))
356
mkConAppCode :: Word -> Sequel -> BCEnv -> DataCon -- The data constructor -> [AnnExpr' Id VarSet] -- Args, in *reverse* order -> BcM BCInstrList mkConAppCode _ _ _ con [] -- Nullary constructor = ASSERT( isNullaryRepDataCon con ) return (unitOL (PUSH_G (getName (dataConWorkId con))))
355
mkConAppCode _ _ _ con [] -- Nullary constructor = ASSERT( isNullaryRepDataCon con ) return (unitOL (PUSH_G (getName (dataConWorkId con))))
151
false
true
0
13
115
97
48
49
null
null
runjak/projectEuler
src/Problem13.hs
mit
solution :: String solution = take 10 . show $ sum numbers
58
solution :: String solution = take 10 . show $ sum numbers
58
solution = take 10 . show $ sum numbers
39
false
true
0
7
11
25
12
13
null
null
ezyang/ghc
compiler/main/SysTools/Tasks.hs
bsd-3-clause
runClang :: DynFlags -> [Option] -> IO () runClang dflags args = do let (clang,_) = pgm_lcc dflags -- be careful what options we call clang with -- see #5903 and #7617 for bugs caused by this. (_,args0) = pgm_a dflags args1 = map Option (getOpts dflags opt_a) args2 = args0 ++ args1 ++ args mb_env <- getGccEnv args2 Exception.catch (do runSomethingFiltered dflags id "Clang (Assembler)" clang args2 Nothing mb_env ) (\(err :: SomeException) -> do errorMsg dflags $ text ("Error running clang! you need clang installed to use the" ++ " LLVM backend") $+$ text "(or GHC tried to execute clang incorrectly)" throwIO err ) -- | Figure out which version of LLVM we are running this session
800
runClang :: DynFlags -> [Option] -> IO () runClang dflags args = do let (clang,_) = pgm_lcc dflags -- be careful what options we call clang with -- see #5903 and #7617 for bugs caused by this. (_,args0) = pgm_a dflags args1 = map Option (getOpts dflags opt_a) args2 = args0 ++ args1 ++ args mb_env <- getGccEnv args2 Exception.catch (do runSomethingFiltered dflags id "Clang (Assembler)" clang args2 Nothing mb_env ) (\(err :: SomeException) -> do errorMsg dflags $ text ("Error running clang! you need clang installed to use the" ++ " LLVM backend") $+$ text "(or GHC tried to execute clang incorrectly)" throwIO err ) -- | Figure out which version of LLVM we are running this session
800
runClang dflags args = do let (clang,_) = pgm_lcc dflags -- be careful what options we call clang with -- see #5903 and #7617 for bugs caused by this. (_,args0) = pgm_a dflags args1 = map Option (getOpts dflags opt_a) args2 = args0 ++ args1 ++ args mb_env <- getGccEnv args2 Exception.catch (do runSomethingFiltered dflags id "Clang (Assembler)" clang args2 Nothing mb_env ) (\(err :: SomeException) -> do errorMsg dflags $ text ("Error running clang! you need clang installed to use the" ++ " LLVM backend") $+$ text "(or GHC tried to execute clang incorrectly)" throwIO err ) -- | Figure out which version of LLVM we are running this session
758
false
true
0
17
233
194
94
100
null
null
Javran/Project-Euler
src/ProjectEuler/Problem2.hs
mit
result :: Int result = sum . takeWhile (<= 4000000) $ fibEvens
68
result :: Int result = sum . takeWhile (<= 4000000) $ fibEvens
68
result = sum . takeWhile (<= 4000000) $ fibEvens
54
false
true
3
6
17
29
14
15
null
null
thsutton/cha
lib/Rules/Pi.hs
bsd-3-clause
piINTRO :: Universe -> PrlTactic piINTRO uni (Goal ctx t) = case t of Pi a b -> return $ Result { resultGoals = [ Goal ctx (Eq a a (Uni uni)) , Goal (a <:> ctx) b ] , resultEvidence = \d -> case d of [d1, d2] -> PI_INTRO uni d1 d2 _ -> error "Pi.INTRO: Invalid evidence!" } _ -> fail "Pi.INTRO does not apply." -- -- H >> C -- H(i) = Pi x : A. B -- H >> a = a in A -- H, [a/x]B >> C -- Uses: PI_ELIM
623
piINTRO :: Universe -> PrlTactic piINTRO uni (Goal ctx t) = case t of Pi a b -> return $ Result { resultGoals = [ Goal ctx (Eq a a (Uni uni)) , Goal (a <:> ctx) b ] , resultEvidence = \d -> case d of [d1, d2] -> PI_INTRO uni d1 d2 _ -> error "Pi.INTRO: Invalid evidence!" } _ -> fail "Pi.INTRO does not apply." -- -- H >> C -- H(i) = Pi x : A. B -- H >> a = a in A -- H, [a/x]B >> C -- Uses: PI_ELIM
623
piINTRO uni (Goal ctx t) = case t of Pi a b -> return $ Result { resultGoals = [ Goal ctx (Eq a a (Uni uni)) , Goal (a <:> ctx) b ] , resultEvidence = \d -> case d of [d1, d2] -> PI_INTRO uni d1 d2 _ -> error "Pi.INTRO: Invalid evidence!" } _ -> fail "Pi.INTRO does not apply." -- -- H >> C -- H(i) = Pi x : A. B -- H >> a = a in A -- H, [a/x]B >> C -- Uses: PI_ELIM
590
false
true
0
16
320
157
82
75
null
null
databrary/databrary
src/Model/Release/SQL.hs
agpl-3.0
releaseRow :: Selector -- ^ @'Release'@ releaseRow = selectColumn "slot_release" "release"
90
releaseRow :: Selector releaseRow = selectColumn "slot_release" "release"
73
releaseRow = selectColumn "slot_release" "release"
50
true
true
0
5
10
17
9
8
null
null
urbanslug/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
labelType _ = DataLabel
59
labelType _ = DataLabel
59
labelType _ = DataLabel
59
false
false
0
4
39
10
4
6
null
null
weirp/fpoc
haskellServer/Main.hs
mit
allUsers :: [User] allUsers = [bob, jenny, joe]
47
allUsers :: [User] allUsers = [bob, jenny, joe]
47
allUsers = [bob, jenny, joe]
28
false
true
0
7
7
30
15
15
null
null
ulricha/dsh
src/Database/DSH/SL/Opt/Rewrite/PruneEmpty.hs
bsd-3-clause
-- import Database.Algebra.Dag.Common -- import Database.DSH.SL.Lang pruneEmpty :: SLRewrite TExpr TExpr Bool pruneEmpty = applyToAll inferBottomUp emptyRules
179
pruneEmpty :: SLRewrite TExpr TExpr Bool pruneEmpty = applyToAll inferBottomUp emptyRules
89
pruneEmpty = applyToAll inferBottomUp emptyRules
48
true
true
0
5
37
25
13
12
null
null
wxwxwwxxx/ghc
compiler/types/TypeRep.hs
bsd-3-clause
tidyType env (FunTy fun arg) = (FunTy $! (tidyType env fun)) $! (tidyType env arg)
87
tidyType env (FunTy fun arg) = (FunTy $! (tidyType env fun)) $! (tidyType env arg)
87
tidyType env (FunTy fun arg) = (FunTy $! (tidyType env fun)) $! (tidyType env arg)
87
false
false
0
9
19
46
23
23
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/simplStg/UnariseStg.hs
bsd-3-clause
unariseSRT :: UnariseEnv -> SRT -> SRT unariseSRT _ NoSRT = NoSRT
78
unariseSRT :: UnariseEnv -> SRT -> SRT unariseSRT _ NoSRT = NoSRT
78
unariseSRT _ NoSRT = NoSRT
39
false
true
0
6
24
24
12
12
null
null
benkolera/phb
hs/Phb/Auth.hs
mit
db2Au :: WholeLogin -> AuthUser db2Au (Entity pk p,Entity _ pl) = AuthUser { userId = Just . UserId . keyToText $ pk , userLogin = pl^.personLoginLogin , userEmail = p^.personEmail.to Just , userPassword = Just . ClearText $ "" , userActivatedAt = pl^.personLoginActivatedAt , userRememberToken = pl^.personLoginRememberToken , userSuspendedAt = pl^.personLoginSuspendedAt , userLoginCount = pl^.personLoginLoginCount , userFailedLoginCount = pl^.personLoginFailedLoginCount , userLockedOutUntil = pl^.personLoginLockedOutUntil , userCurrentLoginAt = pl^.personLoginCurrentLoginAt , userLastLoginAt = pl^.personLoginLastLoginAt , userCurrentLoginIp = pl^?personLoginCurrentIp._Just.to T.encodeUtf8 , userLastLoginIp = pl^?personLoginLastIp._Just.to T.encodeUtf8 , userCreatedAt = pl^.personLoginCreatedAt.to Just , userUpdatedAt = pl^.personLoginUpdatedAt.to Just , userResetToken = pl^.personLoginResetToken , userResetRequestedAt = pl^.personLoginResetRequestedAt , userRoles = [] , userMeta = HM.empty }
1,170
db2Au :: WholeLogin -> AuthUser db2Au (Entity pk p,Entity _ pl) = AuthUser { userId = Just . UserId . keyToText $ pk , userLogin = pl^.personLoginLogin , userEmail = p^.personEmail.to Just , userPassword = Just . ClearText $ "" , userActivatedAt = pl^.personLoginActivatedAt , userRememberToken = pl^.personLoginRememberToken , userSuspendedAt = pl^.personLoginSuspendedAt , userLoginCount = pl^.personLoginLoginCount , userFailedLoginCount = pl^.personLoginFailedLoginCount , userLockedOutUntil = pl^.personLoginLockedOutUntil , userCurrentLoginAt = pl^.personLoginCurrentLoginAt , userLastLoginAt = pl^.personLoginLastLoginAt , userCurrentLoginIp = pl^?personLoginCurrentIp._Just.to T.encodeUtf8 , userLastLoginIp = pl^?personLoginLastIp._Just.to T.encodeUtf8 , userCreatedAt = pl^.personLoginCreatedAt.to Just , userUpdatedAt = pl^.personLoginUpdatedAt.to Just , userResetToken = pl^.personLoginResetToken , userResetRequestedAt = pl^.personLoginResetRequestedAt , userRoles = [] , userMeta = HM.empty }
1,170
db2Au (Entity pk p,Entity _ pl) = AuthUser { userId = Just . UserId . keyToText $ pk , userLogin = pl^.personLoginLogin , userEmail = p^.personEmail.to Just , userPassword = Just . ClearText $ "" , userActivatedAt = pl^.personLoginActivatedAt , userRememberToken = pl^.personLoginRememberToken , userSuspendedAt = pl^.personLoginSuspendedAt , userLoginCount = pl^.personLoginLoginCount , userFailedLoginCount = pl^.personLoginFailedLoginCount , userLockedOutUntil = pl^.personLoginLockedOutUntil , userCurrentLoginAt = pl^.personLoginCurrentLoginAt , userLastLoginAt = pl^.personLoginLastLoginAt , userCurrentLoginIp = pl^?personLoginCurrentIp._Just.to T.encodeUtf8 , userLastLoginIp = pl^?personLoginLastIp._Just.to T.encodeUtf8 , userCreatedAt = pl^.personLoginCreatedAt.to Just , userUpdatedAt = pl^.personLoginUpdatedAt.to Just , userResetToken = pl^.personLoginResetToken , userResetRequestedAt = pl^.personLoginResetRequestedAt , userRoles = [] , userMeta = HM.empty }
1,138
false
true
0
11
272
281
157
124
null
null
yliu120/K3
src/Language/K3/Core/Expression.hs
apache-2.0
tPipe :: Text tPipe = T.pack "|"
32
tPipe :: Text tPipe = T.pack "|"
32
tPipe = T.pack "|"
18
false
true
0
6
6
16
8
8
null
null
stefanjanjic90/DroidThatYouAreLookingFor
LivePicture.hs
bsd-3-clause
-- | 'isClicked' checks whether a given LivePicture was clicked based on the passed mouse position coordinates. isClicked :: LivePicture -> (Float, Float) -> Bool isClicked (LivePicture _ width height (posX, posY)) (mouseX, mouseY) = (mouseX > posX - fromIntegral (width `div` 2)) && (mouseX < posX + fromIntegral (width `div` 2 )) && (mouseY < posY + fromIntegral (height `div` 2)) && (mouseY > posY - fromIntegral (height `div` 2))
651
isClicked :: LivePicture -> (Float, Float) -> Bool isClicked (LivePicture _ width height (posX, posY)) (mouseX, mouseY) = (mouseX > posX - fromIntegral (width `div` 2)) && (mouseX < posX + fromIntegral (width `div` 2 )) && (mouseY < posY + fromIntegral (height `div` 2)) && (mouseY > posY - fromIntegral (height `div` 2))
539
isClicked (LivePicture _ width height (posX, posY)) (mouseX, mouseY) = (mouseX > posX - fromIntegral (width `div` 2)) && (mouseX < posX + fromIntegral (width `div` 2 )) && (mouseY < posY + fromIntegral (height `div` 2)) && (mouseY > posY - fromIntegral (height `div` 2))
488
true
true
0
12
288
159
89
70
null
null
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/typecheck/should_compile/T4498.hs
bsd-3-clause
f x = let !y = (\v -> v) :: a -> a in (y x, y 'T')
56
f x = let !y = (\v -> v) :: a -> a in (y x, y 'T')
56
f x = let !y = (\v -> v) :: a -> a in (y x, y 'T')
56
false
false
1
10
23
53
24
29
null
null
diogob/postgrest
src/PostgREST/Parsers.hs
mit
pJSPIdx :: Parser Int pJSPIdx = char '[' *> (read <$> many1 digit) <* char ']' <?> "array index [0..n]"
103
pJSPIdx :: Parser Int pJSPIdx = char '[' *> (read <$> many1 digit) <* char ']' <?> "array index [0..n]"
103
pJSPIdx = char '[' *> (read <$> many1 digit) <* char ']' <?> "array index [0..n]"
81
false
true
0
10
19
42
20
22
null
null
abakst/liquidhaskell
benchmarks/base-4.5.1.0/Data/HashTable.hs
bsd-3-clause
writeMutArray = writeIOArray
28
writeMutArray = writeIOArray
28
writeMutArray = writeIOArray
28
false
false
1
5
2
10
3
7
null
null
jessica-taylor/quipp2
src/Quipp/Parser.hs
mit
parensExpr ctx = tupled (expr ctx) (VarExpr "Unit") (\x y -> AppExpr (AppExpr (VarExpr "Pair") x) y)
100
parensExpr ctx = tupled (expr ctx) (VarExpr "Unit") (\x y -> AppExpr (AppExpr (VarExpr "Pair") x) y)
100
parensExpr ctx = tupled (expr ctx) (VarExpr "Unit") (\x y -> AppExpr (AppExpr (VarExpr "Pair") x) y)
100
false
false
1
12
16
61
28
33
null
null
da-x/buildsome-tst
src/Lib/Makefile/Parser.hs
bsd-3-clause
interpolateString :: Monad m => ParserG u m ByteString -> String -> ParserG u m ByteString -> ParserG u m ByteString interpolateString escapeParser stopChars dollarHandler = concatMany (interpolatedChar ('\'':'"':stopChars) <|> literalString '\'' <|> doubleQuotes) where concatMany x = BS8.concat <$> P.many x RELEASE_INLINE(doubleQuotes) doubleQuotes = doubleQuoted <$> P.char '"' <*> concatMany (interpolatedChar "\"\n") <*> P.char '"' doubleQuoted begin chars end = BS8.singleton begin <> chars <> BS8.singleton end RELEASE_INLINE(interpolatedChar) interpolatedChar stopChars' = P.choice [ BS8.singleton <$> P.noneOf ('\t' : '\\' : '$' :stopChars') , P.char '$' *> dollarHandler , escapeParser ] RELEASE_INLINE(literalString) literalString delimiter = do x <- P.char delimiter str <- BS8.concat <$> P.many p y <- P.char delimiter return $ BS8.singleton x <> str <> BS8.singleton y where p = escapeSequence <|> (BS8.singleton <$> P.satisfy (`notElem` ['\t', '\n', delimiter]))
1,078
interpolateString :: Monad m => ParserG u m ByteString -> String -> ParserG u m ByteString -> ParserG u m ByteString interpolateString escapeParser stopChars dollarHandler = concatMany (interpolatedChar ('\'':'"':stopChars) <|> literalString '\'' <|> doubleQuotes) where concatMany x = BS8.concat <$> P.many x RELEASE_INLINE(doubleQuotes) doubleQuotes = doubleQuoted <$> P.char '"' <*> concatMany (interpolatedChar "\"\n") <*> P.char '"' doubleQuoted begin chars end = BS8.singleton begin <> chars <> BS8.singleton end RELEASE_INLINE(interpolatedChar) interpolatedChar stopChars' = P.choice [ BS8.singleton <$> P.noneOf ('\t' : '\\' : '$' :stopChars') , P.char '$' *> dollarHandler , escapeParser ] RELEASE_INLINE(literalString) literalString delimiter = do x <- P.char delimiter str <- BS8.concat <$> P.many p y <- P.char delimiter return $ BS8.singleton x <> str <> BS8.singleton y where p = escapeSequence <|> (BS8.singleton <$> P.satisfy (`notElem` ['\t', '\n', delimiter]))
1,078
interpolateString escapeParser stopChars dollarHandler = concatMany (interpolatedChar ('\'':'"':stopChars) <|> literalString '\'' <|> doubleQuotes) where concatMany x = BS8.concat <$> P.many x RELEASE_INLINE(doubleQuotes) doubleQuotes = doubleQuoted <$> P.char '"' <*> concatMany (interpolatedChar "\"\n") <*> P.char '"' doubleQuoted begin chars end = BS8.singleton begin <> chars <> BS8.singleton end RELEASE_INLINE(interpolatedChar) interpolatedChar stopChars' = P.choice [ BS8.singleton <$> P.noneOf ('\t' : '\\' : '$' :stopChars') , P.char '$' *> dollarHandler , escapeParser ] RELEASE_INLINE(literalString) literalString delimiter = do x <- P.char delimiter str <- BS8.concat <$> P.many p y <- P.char delimiter return $ BS8.singleton x <> str <> BS8.singleton y where p = escapeSequence <|> (BS8.singleton <$> P.satisfy (`notElem` ['\t', '\n', delimiter]))
959
false
true
4
13
230
365
179
186
null
null
sdiehl/ghc
compiler/deSugar/DsArrows.hs
bsd-3-clause
mkHsEnvStackExpr :: [Id] -> Id -> LHsExpr GhcTc mkHsEnvStackExpr env_ids stack_id = mkLHsTupleExpr [mkLHsVarTuple env_ids, nlHsVar stack_id]
142
mkHsEnvStackExpr :: [Id] -> Id -> LHsExpr GhcTc mkHsEnvStackExpr env_ids stack_id = mkLHsTupleExpr [mkLHsVarTuple env_ids, nlHsVar stack_id]
142
mkHsEnvStackExpr env_ids stack_id = mkLHsTupleExpr [mkLHsVarTuple env_ids, nlHsVar stack_id]
94
false
true
0
8
18
50
23
27
null
null
kazu-yamamoto/cab
src/Main.hs
bsd-3-clause
illegalCommandAndExit :: String -> IO () illegalCommandAndExit x = do hPutStrLn stderr $ "Illegal command: " ++ x exitFailure ----------------------------------------------------------------
199
illegalCommandAndExit :: String -> IO () illegalCommandAndExit x = do hPutStrLn stderr $ "Illegal command: " ++ x exitFailure ----------------------------------------------------------------
199
illegalCommandAndExit x = do hPutStrLn stderr $ "Illegal command: " ++ x exitFailure ----------------------------------------------------------------
158
false
true
0
9
28
41
19
22
null
null
marcelombc/secd
secd.hs
mit
eval (v:A a:s, e, AP:c, d, m) = let Just (c', e') = Map.lookup a m in ([], v:e', c', (s, e, c):d, m)
108
eval (v:A a:s, e, AP:c, d, m) = let Just (c', e') = Map.lookup a m in ([], v:e', c', (s, e, c):d, m)
108
eval (v:A a:s, e, AP:c, d, m) = let Just (c', e') = Map.lookup a m in ([], v:e', c', (s, e, c):d, m)
108
false
false
0
10
31
101
55
46
null
null
phadej/semver-range
src/Data/SemVer/Range.hs
bsd-3-clause
-- | Infix version of 'LJoin' (\/) :: LatticeSyntax a -> LatticeSyntax a -> LatticeSyntax a (\/) = LJoin
104
(\/) :: LatticeSyntax a -> LatticeSyntax a -> LatticeSyntax a (\/) = LJoin
74
(\/) = LJoin
12
true
true
0
8
18
39
19
20
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F17.hs
bsd-3-clause
ptr_glMultiTexCoord1bOES :: FunPtr (GLenum -> GLbyte -> IO ()) ptr_glMultiTexCoord1bOES = unsafePerformIO $ getCommand "glMultiTexCoord1bOES"
141
ptr_glMultiTexCoord1bOES :: FunPtr (GLenum -> GLbyte -> IO ()) ptr_glMultiTexCoord1bOES = unsafePerformIO $ getCommand "glMultiTexCoord1bOES"
141
ptr_glMultiTexCoord1bOES = unsafePerformIO $ getCommand "glMultiTexCoord1bOES"
78
false
true
0
10
14
37
18
19
null
null
sol/reserve
test/ReserveSpec.hs
mit
literal :: String -> String literal = show
42
literal :: String -> String literal = show
42
literal = show
14
false
true
0
5
7
15
8
7
null
null
genos/online_problems
advent_of_code_2016/day10/src/Main.hs
mit
isGivesTo _ = False
19
isGivesTo _ = False
19
isGivesTo _ = False
19
false
false
0
4
3
10
4
6
null
null
DougBurke/swish
src/Swish/RDF/Vocabulary/FOAF.hs
lgpl-2.1
-- | @foaf:givenname@ from <http://xmlns.com/foaf/spec/#term_givenname>. foafgivenname :: ScopedName foafgivenname = toF "givenname"
133
foafgivenname :: ScopedName foafgivenname = toF "givenname"
59
foafgivenname = toF "givenname"
31
true
true
0
5
12
15
8
7
null
null
jmaessen/Data.FastSequence
src/Data/FastSequence.hs
bsd-3-clause
indexN :: (Sized a) => Size -> Node a -> (Size, a) indexN i0 !n = loop 0 i0 where loop position i | i < se = (i, e) | otherwise = loop (position + 1) (i - se) where e = n ! position se = size e
242
indexN :: (Sized a) => Size -> Node a -> (Size, a) indexN i0 !n = loop 0 i0 where loop position i | i < se = (i, e) | otherwise = loop (position + 1) (i - se) where e = n ! position se = size e
242
indexN i0 !n = loop 0 i0 where loop position i | i < se = (i, e) | otherwise = loop (position + 1) (i - se) where e = n ! position se = size e
190
false
true
1
8
98
129
63
66
null
null
EXio4/netza
src/IRC/Raw/Parser/Host.hs
mit
ldh_str :: Parser ByteString ldh_str = BS.pack <$> many1 let_dig_hyp
68
ldh_str :: Parser ByteString ldh_str = BS.pack <$> many1 let_dig_hyp
68
ldh_str = BS.pack <$> many1 let_dig_hyp
39
false
true
0
6
9
23
11
12
null
null
romanb/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/CreateStorediSCSIVolume.hs
mpl-2.0
-- | The size of the volume in bytes. csscsivrVolumeSizeInBytes :: Lens' CreateStorediSCSIVolumeResponse (Maybe Integer) csscsivrVolumeSizeInBytes = lens _csscsivrVolumeSizeInBytes (\s a -> s { _csscsivrVolumeSizeInBytes = a })
239
csscsivrVolumeSizeInBytes :: Lens' CreateStorediSCSIVolumeResponse (Maybe Integer) csscsivrVolumeSizeInBytes = lens _csscsivrVolumeSizeInBytes (\s a -> s { _csscsivrVolumeSizeInBytes = a })
201
csscsivrVolumeSizeInBytes = lens _csscsivrVolumeSizeInBytes (\s a -> s { _csscsivrVolumeSizeInBytes = a })
118
true
true
0
9
39
46
25
21
null
null
kaoskorobase/mescaline
resources/hugs/packages/base/Data/IntMap.hs
gpl-3.0
match i p m = (mask i m) == p
31
match i p m = (mask i m) == p
31
match i p m = (mask i m) == p
31
false
false
0
7
11
26
12
14
null
null
tibbe/cassava
Data/Csv/Incremental.hs
bsd-3-clause
------------------------------------------------------------------------ -- * Encoding -- | Efficiently serialize records in an incremental -- fashion. Equivalent to @'encodeWith' 'defaultEncodeOptions'@. encode :: ToRecord a => Builder a -> L.ByteString encode = encodeWith Encoding.defaultEncodeOptions
305
encode :: ToRecord a => Builder a -> L.ByteString encode = encodeWith Encoding.defaultEncodeOptions
99
encode = encodeWith Encoding.defaultEncodeOptions
49
true
true
0
9
31
43
20
23
null
null
pennetti/scheme-repl
dist/build/autogen/Paths_haskell_scheme.hs
gpl-2.0
getLibexecDir = catchIO (getEnv "haskell_scheme_libexecdir") (\_ -> return libexecdir)
86
getLibexecDir = catchIO (getEnv "haskell_scheme_libexecdir") (\_ -> return libexecdir)
86
getLibexecDir = catchIO (getEnv "haskell_scheme_libexecdir") (\_ -> return libexecdir)
86
false
false
0
8
8
28
14
14
null
null
ecaustin/haskhol-core
src/HaskHOL/Core/Parser/TermParser.hs
bsd-2-clause
mkPattern :: PreTerm -> [PreTerm] -> PreTerm -> MyParser PreTerm mkPattern pat guards res = do x <- pgenVar y <- pgenVar vs <- pfrees pat [] let bod = if null guards then PComb (PComb (PVar "_UNGUARDED_PATTERN" dpty) $ mkGEQ pat x) $ mkGEQ res y else PComb (PComb (PComb (PVar "_GUARDED_PATTERN" dpty) $ mkGEQ pat x) $ head guards) $ mkGEQ res y return . PAbs x . PAbs y $ foldr mkExists bod vs where mkGEQ :: PreTerm -> PreTerm -> PreTerm mkGEQ l = PComb (PComb (PVar "GEQ" dpty) l) mkExists :: PreTerm -> PreTerm -> PreTerm mkExists v ptm = PComb (PVar "?" dpty) $ PAbs v ptm -- build expression parser from infix operators in context
806
mkPattern :: PreTerm -> [PreTerm] -> PreTerm -> MyParser PreTerm mkPattern pat guards res = do x <- pgenVar y <- pgenVar vs <- pfrees pat [] let bod = if null guards then PComb (PComb (PVar "_UNGUARDED_PATTERN" dpty) $ mkGEQ pat x) $ mkGEQ res y else PComb (PComb (PComb (PVar "_GUARDED_PATTERN" dpty) $ mkGEQ pat x) $ head guards) $ mkGEQ res y return . PAbs x . PAbs y $ foldr mkExists bod vs where mkGEQ :: PreTerm -> PreTerm -> PreTerm mkGEQ l = PComb (PComb (PVar "GEQ" dpty) l) mkExists :: PreTerm -> PreTerm -> PreTerm mkExists v ptm = PComb (PVar "?" dpty) $ PAbs v ptm -- build expression parser from infix operators in context
806
mkPattern pat guards res = do x <- pgenVar y <- pgenVar vs <- pfrees pat [] let bod = if null guards then PComb (PComb (PVar "_UNGUARDED_PATTERN" dpty) $ mkGEQ pat x) $ mkGEQ res y else PComb (PComb (PComb (PVar "_GUARDED_PATTERN" dpty) $ mkGEQ pat x) $ head guards) $ mkGEQ res y return . PAbs x . PAbs y $ foldr mkExists bod vs where mkGEQ :: PreTerm -> PreTerm -> PreTerm mkGEQ l = PComb (PComb (PVar "GEQ" dpty) l) mkExists :: PreTerm -> PreTerm -> PreTerm mkExists v ptm = PComb (PVar "?" dpty) $ PAbs v ptm -- build expression parser from infix operators in context
741
false
true
7
20
291
281
133
148
null
null
gridaphobe/ghc
compiler/utils/Outputable.hs
bsd-3-clause
-- | Determines the form of to be appropriate for the length of a list: -- -- > isOrAre [] = text "are" -- > isOrAre ["Hello"] = text "is" -- > isOrAre ["Hello", "World"] = text "are" isOrAre :: [a] -> SDoc isOrAre [_] = text "is"
230
isOrAre :: [a] -> SDoc isOrAre [_] = text "is"
46
isOrAre [_] = text "is"
23
true
true
0
6
47
32
19
13
null
null
AlexanderPankiv/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
pprFormatOpReg :: LitString -> Format -> Operand -> Reg -> SDoc pprFormatOpReg name format op1 reg2 = sdocWithPlatform $ \platform -> hcat [ pprMnemonic name format, pprOperand format op1, comma, pprReg (archWordFormat (target32Bit platform)) reg2 ]
291
pprFormatOpReg :: LitString -> Format -> Operand -> Reg -> SDoc pprFormatOpReg name format op1 reg2 = sdocWithPlatform $ \platform -> hcat [ pprMnemonic name format, pprOperand format op1, comma, pprReg (archWordFormat (target32Bit platform)) reg2 ]
291
pprFormatOpReg name format op1 reg2 = sdocWithPlatform $ \platform -> hcat [ pprMnemonic name format, pprOperand format op1, comma, pprReg (archWordFormat (target32Bit platform)) reg2 ]
227
false
true
0
13
77
87
44
43
null
null
predee/heroes2
src/Heroes2/Kingdom.hs
mit
toHero :: Kingdom -> Hero -> HeroZipper toHero k h = (h, rest) where rest = k { heroes = restHeroes } restHeroes = filter (/= h) (heroes k)
153
toHero :: Kingdom -> Hero -> HeroZipper toHero k h = (h, rest) where rest = k { heroes = restHeroes } restHeroes = filter (/= h) (heroes k)
153
toHero k h = (h, rest) where rest = k { heroes = restHeroes } restHeroes = filter (/= h) (heroes k)
113
false
true
1
7
42
67
36
31
null
null
lukexi/game-pal
app/Cubes.hs
bsd-3-clause
render :: (MonadIO m) => Shape Uniforms -> [Cube] -> M44 GLfloat -> M44 GLfloat -> V4 GLfloat -> V4 GLfloat -> m () render cubeShape cubes projM44 viewM44 _projRaw _viewport = do glClear (GL_COLOR_BUFFER_BIT .|. GL_DEPTH_BUFFER_BIT) let Uniforms{..} = sUniforms cubeShape projView = projM44 !*! viewM44 -- We extract eyePos from the view matrix to get eye-to-head offsets baked in uniformV3 uCamera (inv44 viewM44 ^. translation) withVAO (sVAO cubeShape) $ forM_ cubes $ \cube -> do uniformV4 uDiffuse (cube ^. cubColor) draw (cube ^. cubMatrix) projView cubeShape
661
render :: (MonadIO m) => Shape Uniforms -> [Cube] -> M44 GLfloat -> M44 GLfloat -> V4 GLfloat -> V4 GLfloat -> m () render cubeShape cubes projM44 viewM44 _projRaw _viewport = do glClear (GL_COLOR_BUFFER_BIT .|. GL_DEPTH_BUFFER_BIT) let Uniforms{..} = sUniforms cubeShape projView = projM44 !*! viewM44 -- We extract eyePos from the view matrix to get eye-to-head offsets baked in uniformV3 uCamera (inv44 viewM44 ^. translation) withVAO (sVAO cubeShape) $ forM_ cubes $ \cube -> do uniformV4 uDiffuse (cube ^. cubColor) draw (cube ^. cubMatrix) projView cubeShape
661
render cubeShape cubes projM44 viewM44 _projRaw _viewport = do glClear (GL_COLOR_BUFFER_BIT .|. GL_DEPTH_BUFFER_BIT) let Uniforms{..} = sUniforms cubeShape projView = projM44 !*! viewM44 -- We extract eyePos from the view matrix to get eye-to-head offsets baked in uniformV3 uCamera (inv44 viewM44 ^. translation) withVAO (sVAO cubeShape) $ forM_ cubes $ \cube -> do uniformV4 uDiffuse (cube ^. cubColor) draw (cube ^. cubMatrix) projView cubeShape
496
false
true
0
13
184
200
94
106
null
null
faylang/snaplet-fay
example/src/Site.hs
bsd-3-clause
------------------------------------------------------------------------------ -- | The application initializer. app :: SnapletInit App App app = makeSnaplet "app" "An snaplet example application." Nothing $ do s <- nestSnaplet "sess" session $ initCookieSessionManager "site_key.txt" "sess" (Just 3600) h <- nestSnaplet "" heist $ heistInit "templates" f <- nestSnaplet "fay" fay $ initFay a <- nestSnaplet "auth" auth $ initJsonFileAuthManager defAuthSettings session "users.json" addAuthSplices h auth addRoutes routes return $ App h f s a
581
app :: SnapletInit App App app = makeSnaplet "app" "An snaplet example application." Nothing $ do s <- nestSnaplet "sess" session $ initCookieSessionManager "site_key.txt" "sess" (Just 3600) h <- nestSnaplet "" heist $ heistInit "templates" f <- nestSnaplet "fay" fay $ initFay a <- nestSnaplet "auth" auth $ initJsonFileAuthManager defAuthSettings session "users.json" addAuthSplices h auth addRoutes routes return $ App h f s a
468
app = makeSnaplet "app" "An snaplet example application." Nothing $ do s <- nestSnaplet "sess" session $ initCookieSessionManager "site_key.txt" "sess" (Just 3600) h <- nestSnaplet "" heist $ heistInit "templates" f <- nestSnaplet "fay" fay $ initFay a <- nestSnaplet "auth" auth $ initJsonFileAuthManager defAuthSettings session "users.json" addAuthSplices h auth addRoutes routes return $ App h f s a
441
true
true
1
13
108
150
65
85
null
null
GaloisInc/pads-haskell
Examples/First.hs
bsd-3-clause
expect_method_post = (POST,0,"")
32
expect_method_post = (POST,0,"")
32
expect_method_post = (POST,0,"")
32
false
false
0
5
2
15
9
6
null
null
nushio3/ghc
libraries/base/Foreign/C/Error.hs
bsd-3-clause
eTXTBSY = Errno (CONST_ETXTBSY)
39
eTXTBSY = Errno (CONST_ETXTBSY)
39
eTXTBSY = Errno (CONST_ETXTBSY)
39
false
false
0
6
11
12
6
6
null
null
eatobin/cis194
lesson1/src/LS01.hs
bsd-3-clause
-- 23 -- ex14 :: Int -- ex14 = (+) ex14 1 -- ex15 :: Bool ex15 = (^) 7 3
72
ex15 = (^) 7 3
14
ex15 = (^) 7 3
14
true
false
1
5
20
20
11
9
null
null
tomlokhorst/language-cil
src/Language/Cil/Build.hs
bsd-3-clause
ldarga :: Offset -> MethodDecl ldarga = OpCode . Ldarga
55
ldarga :: Offset -> MethodDecl ldarga = OpCode . Ldarga
55
ldarga = OpCode . Ldarga
24
false
true
1
7
9
27
11
16
null
null
chip2n/tin172-project
haskell/src/Shrdlite/AmbiguityResolver.hs
gpl-3.0
resolveAmbiguity :: State -> [[Goal]] -> Either ShrdliteError Goal resolveAmbiguity state goals = case validResults of [] -> case length results of 0 -> Left $ OtherError "No valid goals." 1 -> head results _ -> minimum results _ -> case length validResults of 0 -> Left $ OtherError "No valid goals." 1 -> Right $ head validResults _ -> Left $ AmbiguityError validResults "INSERT AMBIGUITY QUESTION HERE" -- TODO where results = map (resolveAmbiguity' state) goals :: [Either ShrdliteError Goal] validResults = rights results
619
resolveAmbiguity :: State -> [[Goal]] -> Either ShrdliteError Goal resolveAmbiguity state goals = case validResults of [] -> case length results of 0 -> Left $ OtherError "No valid goals." 1 -> head results _ -> minimum results _ -> case length validResults of 0 -> Left $ OtherError "No valid goals." 1 -> Right $ head validResults _ -> Left $ AmbiguityError validResults "INSERT AMBIGUITY QUESTION HERE" -- TODO where results = map (resolveAmbiguity' state) goals :: [Either ShrdliteError Goal] validResults = rights results
619
resolveAmbiguity state goals = case validResults of [] -> case length results of 0 -> Left $ OtherError "No valid goals." 1 -> head results _ -> minimum results _ -> case length validResults of 0 -> Left $ OtherError "No valid goals." 1 -> Right $ head validResults _ -> Left $ AmbiguityError validResults "INSERT AMBIGUITY QUESTION HERE" -- TODO where results = map (resolveAmbiguity' state) goals :: [Either ShrdliteError Goal] validResults = rights results
552
false
true
2
12
177
176
84
92
null
null
spechub/Hets
CASL/MixfixParser.hs
gpl-2.0
extendMixResolve :: Set.Set Token -> MixResolve f -> MixResolve f extendMixResolve ts f ga = f ga . extendRules ts
114
extendMixResolve :: Set.Set Token -> MixResolve f -> MixResolve f extendMixResolve ts f ga = f ga . extendRules ts
114
extendMixResolve ts f ga = f ga . extendRules ts
48
false
true
0
7
19
47
21
26
null
null
nh2/WashNGo
WASH/CGI/Images.hs
bsd-3-clause
rawQuestion = "GIF89a\DLE\NUL\DLE\NUL\128\NUL\NUL\NUL\NUL\NUL\255\NUL\NUL!\249\EOT\SOH\NUL\NUL\NUL\NUL,\NUL\NUL\NUL\NUL\DLE\NUL\DLE\NUL\NUL\STX#\132\GS\EM\199\167\191\SUBP\140\182$\177\204\250\194\238\129\155\181Ub9E\136\SUB~\229\199\162\242\140\146\178}\DC4\NUL;"
264
rawQuestion = "GIF89a\DLE\NUL\DLE\NUL\128\NUL\NUL\NUL\NUL\NUL\255\NUL\NUL!\249\EOT\SOH\NUL\NUL\NUL\NUL,\NUL\NUL\NUL\NUL\DLE\NUL\DLE\NUL\NUL\STX#\132\GS\EM\199\167\191\SUBP\140\182$\177\204\250\194\238\129\155\181Ub9E\136\SUB~\229\199\162\242\140\146\178}\DC4\NUL;"
264
rawQuestion = "GIF89a\DLE\NUL\DLE\NUL\128\NUL\NUL\NUL\NUL\NUL\255\NUL\NUL!\249\EOT\SOH\NUL\NUL\NUL\NUL,\NUL\NUL\NUL\NUL\DLE\NUL\DLE\NUL\NUL\STX#\132\GS\EM\199\167\191\SUBP\140\182$\177\204\250\194\238\129\155\181Ub9E\136\SUB~\229\199\162\242\140\146\178}\DC4\NUL;"
264
false
false
1
5
2
10
3
7
null
null
spinda/liquidhaskell
tests/gsoc15/unknown/pos/poslist.hs
bsd-3-clause
numAbsList = map numAbs
23
numAbsList = map numAbs
23
numAbsList = map numAbs
23
false
false
1
5
3
13
4
9
null
null