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
davidbrowning/4700
cs4700/projects/haskell/from_functional_works.hs
mit
fuse t E = t
12
fuse t E = t
12
fuse t E = t
12
false
false
0
5
4
11
5
6
null
null
balez/ag-a-la-carte
Language/Grammars/AGalacarte/Examples/Repmin.hs
gpl-3.0
right_tree = n1
15
right_tree = n1
15
right_tree = n1
15
false
false
1
5
2
10
3
7
null
null
nevrenato/Hets_Fork
CASL/CCC/TermFormula.hs
gpl-2.0
opSymbOfTerm :: TERM f -> OP_SYMB opSymbOfTerm t = case term t of Application os _ _ -> os Sorted_term t' _ _ -> opSymbOfTerm t' Conditional t' _ _ _ -> opSymbOfTerm t' _ -> error "CASL.CCC.TermFormula.<opSymbOfTerm>" -- | extract all var...
336
opSymbOfTerm :: TERM f -> OP_SYMB opSymbOfTerm t = case term t of Application os _ _ -> os Sorted_term t' _ _ -> opSymbOfTerm t' Conditional t' _ _ _ -> opSymbOfTerm t' _ -> error "CASL.CCC.TermFormula.<opSymbOfTerm>" -- | extract all var...
336
opSymbOfTerm t = case term t of Application os _ _ -> os Sorted_term t' _ _ -> opSymbOfTerm t' Conditional t' _ _ _ -> opSymbOfTerm t' _ -> error "CASL.CCC.TermFormula.<opSymbOfTerm>" -- | extract all variables of a term
302
false
true
0
8
127
88
40
48
null
null
emwap/feldspar-compiler
lib/Feldspar/Compiler/Backend/C/Tic64x.hs
bsd-3-clause
-- | Adapts functions that should be adapted Identity function on others. adaptTic64xFun :: Type -> Int -> Function -> Function adaptTic64xFun argtype args f@(Function _ t) | isComplex argtype , args == 1 -- TODO: This transformation looks dangerous. = Function (extend tic64x "creal" argtype) t | otherwise ...
345
adaptTic64xFun :: Type -> Int -> Function -> Function adaptTic64xFun argtype args f@(Function _ t) | isComplex argtype , args == 1 -- TODO: This transformation looks dangerous. = Function (extend tic64x "creal" argtype) t | otherwise = f
271
adaptTic64xFun argtype args f@(Function _ t) | isComplex argtype , args == 1 -- TODO: This transformation looks dangerous. = Function (extend tic64x "creal" argtype) t | otherwise = f
217
true
true
1
8
84
83
41
42
null
null
brendanhay/gogol
gogol-vision/gen/Network/Google/Vision/Types/Product.hs
mpl-2.0
-- | List of paragraphs in this block (if this blocks is of type text). gcvvbParagraphs :: Lens' GoogleCloudVisionV1p1beta1Block [GoogleCloudVisionV1p1beta1Paragraph] gcvvbParagraphs = lens _gcvvbParagraphs (\ s a -> s{_gcvvbParagraphs = a}) . _Default . _Coerce
282
gcvvbParagraphs :: Lens' GoogleCloudVisionV1p1beta1Block [GoogleCloudVisionV1p1beta1Paragraph] gcvvbParagraphs = lens _gcvvbParagraphs (\ s a -> s{_gcvvbParagraphs = a}) . _Default . _Coerce
210
gcvvbParagraphs = lens _gcvvbParagraphs (\ s a -> s{_gcvvbParagraphs = a}) . _Default . _Coerce
115
true
true
3
8
54
58
28
30
null
null
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribeSpotFleetRequests.hs
mpl-2.0
-- | 'DescribeSpotFleetRequestsResponse' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'dsfrrNextToken' @::@ 'Maybe' 'Text' -- -- * 'dsfrrSpotFleetRequestConfigs' @::@ ['SpotFleetRequestConfig'] -- describeSpotFleetRequestsResponse :: DescribeSpotFleetRequestsResponse describeSpotFl...
472
describeSpotFleetRequestsResponse :: DescribeSpotFleetRequestsResponse describeSpotFleetRequestsResponse = DescribeSpotFleetRequestsResponse { _dsfrrSpotFleetRequestConfigs = mempty , _dsfrrNextToken = Nothing }
237
describeSpotFleetRequestsResponse = DescribeSpotFleetRequestsResponse { _dsfrrSpotFleetRequestConfigs = mempty , _dsfrrNextToken = Nothing }
166
true
true
0
7
67
37
24
13
null
null
headprogrammingczar/cabal
cabal-install/Distribution/Client/Sandbox/Timestamp.hs
bsd-3-clause
-- | Read the timestamp file. Exits with error if the timestamp file is -- corrupted. Returns an empty list if the file doesn't exist. readTimestampFile :: FilePath -> IO [TimestampFileRecord] readTimestampFile timestampFile = do timestampString <- readFile timestampFile `catchIO` \_ -> return "[]" case reads times...
1,464
readTimestampFile :: FilePath -> IO [TimestampFileRecord] readTimestampFile timestampFile = do timestampString <- readFile timestampFile `catchIO` \_ -> return "[]" case reads timestampString of [(version, s)] | version == (2::Int) -> case reads s of [(timestamps, s')] | all isSpace s' -...
1,329
readTimestampFile timestampFile = do timestampString <- readFile timestampFile `catchIO` \_ -> return "[]" case reads timestampString of [(version, s)] | version == (2::Int) -> case reads s of [(timestamps, s')] | all isSpace s' -> return timestamps _ ...
1,271
true
true
4
27
475
323
163
160
null
null
jgm/haddock
src/Haddock/Doc.hs
bsd-2-clause
docCodeBlock d = d
18
docCodeBlock d = d
18
docCodeBlock d = d
18
false
false
0
5
3
9
4
5
null
null
olsner/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
emitPrimOp _ [] WriteArrayArrayOp_MutableArrayArray [obj,ix,v] = doWritePtrArrayOp obj ix v
97
emitPrimOp _ [] WriteArrayArrayOp_MutableArrayArray [obj,ix,v] = doWritePtrArrayOp obj ix v
97
emitPrimOp _ [] WriteArrayArrayOp_MutableArrayArray [obj,ix,v] = doWritePtrArrayOp obj ix v
97
false
false
1
6
15
37
17
20
null
null
jonathankochems/hs-crypto-cipher
src/Crypto/Blowfish.hs
bsd-3-clause
encrypt, decrypt :: BlowfishContext -> [Int] -> [Int] encrypt = cipher . selectEncrypt
86
encrypt, decrypt :: BlowfishContext -> [Int] -> [Int] encrypt = cipher . selectEncrypt
86
encrypt = cipher . selectEncrypt
32
false
true
0
7
12
31
18
13
null
null
corajr/cataskell
src/Cataskell/Game.hs
bsd-3-clause
playersExistFor' :: GameAction -> Game -> Bool playersExistFor' = playersExist'' . playersReferenced
100
playersExistFor' :: GameAction -> Game -> Bool playersExistFor' = playersExist'' . playersReferenced
100
playersExistFor' = playersExist'' . playersReferenced
53
false
true
0
6
11
23
12
11
null
null
junjihashimoto/persistent
persistent-mongoDB/Database/Persist/MongoDB.hs
mit
applyDockerEnv :: MongoConf -> IO MongoConf applyDockerEnv mconf = do mHost <- lookupEnv "MONGODB_PORT_27017_TCP_ADDR" return $ case mHost of Nothing -> mconf Just h -> mconf { mgHost = T.pack h } -- --------------------------- -- * MongoDB specific Filters -- $filters -- -- You can find exam...
554
applyDockerEnv :: MongoConf -> IO MongoConf applyDockerEnv mconf = do mHost <- lookupEnv "MONGODB_PORT_27017_TCP_ADDR" return $ case mHost of Nothing -> mconf Just h -> mconf { mgHost = T.pack h } -- --------------------------- -- * MongoDB specific Filters -- $filters -- -- You can find exam...
554
applyDockerEnv mconf = do mHost <- lookupEnv "MONGODB_PORT_27017_TCP_ADDR" return $ case mHost of Nothing -> mconf Just h -> mconf { mgHost = T.pack h } -- --------------------------- -- * MongoDB specific Filters -- $filters -- -- You can find example usage for all of Persistent in our test ...
510
false
true
0
16
101
84
43
41
null
null
ComputationWithBoundedResources/slogic
src/SLogic/Logic/Matrix.hs
bsd-3-clause
setEntry :: a -> (Int,Int) -> Matrix a -> Matrix a setEntry a ij mx@M{ncols=m, mvect=as} = mx{mvect=as'} where as' = V.modify (\v -> MV.write v (encode m ij) a) as
165
setEntry :: a -> (Int,Int) -> Matrix a -> Matrix a setEntry a ij mx@M{ncols=m, mvect=as} = mx{mvect=as'} where as' = V.modify (\v -> MV.write v (encode m ij) a) as
165
setEntry a ij mx@M{ncols=m, mvect=as} = mx{mvect=as'} where as' = V.modify (\v -> MV.write v (encode m ij) a) as
114
false
true
0
10
32
106
57
49
null
null
jamesdarcy/DicomH
src/Data/Dicom.hs
bsd-3-clause
getDicomSSList :: Int -> Get [Int16] getDicomSSList length | length == 0 = return [] | otherwise = do ss <- liftM fromIntegral getWord16le -- Fix!!! Assumes LE rest <- getDicomSSList (length-2) return (ss:rest)
228
getDicomSSList :: Int -> Get [Int16] getDicomSSList length | length == 0 = return [] | otherwise = do ss <- liftM fromIntegral getWord16le -- Fix!!! Assumes LE rest <- getDicomSSList (length-2) return (ss:rest)
228
getDicomSSList length | length == 0 = return [] | otherwise = do ss <- liftM fromIntegral getWord16le -- Fix!!! Assumes LE rest <- getDicomSSList (length-2) return (ss:rest)
191
false
true
1
11
51
90
42
48
null
null
nilekurt/hs-panelmethod
VectorUtils.hs
gpl-2.0
furthestLines :: FV2 -> [(Int,Line)] -> [Int] furthestLines dir ls = hasPoint (furthestPoint . pointDistances dir $ ls) ls where hasPoint p = foldr (\(i,Line v1 v2) acc-> if v1 == p || v2 == p then i : acc else acc) [] furthestPoint = fst . foldr (\p@(_,d1) acc@(_,d2)-> if d1 > d2 then p else acc) (V2 0 0, ...
479
furthestLines :: FV2 -> [(Int,Line)] -> [Int] furthestLines dir ls = hasPoint (furthestPoint . pointDistances dir $ ls) ls where hasPoint p = foldr (\(i,Line v1 v2) acc-> if v1 == p || v2 == p then i : acc else acc) [] furthestPoint = fst . foldr (\p@(_,d1) acc@(_,d2)-> if d1 > d2 then p else acc) (V2 0 0, ...
479
furthestLines dir ls = hasPoint (furthestPoint . pointDistances dir $ ls) ls where hasPoint p = foldr (\(i,Line v1 v2) acc-> if v1 == p || v2 == p then i : acc else acc) [] furthestPoint = fst . foldr (\p@(_,d1) acc@(_,d2)-> if d1 > d2 then p else acc) (V2 0 0, 0) pointDistances x = map (\(_,Line v1 v2)...
433
false
true
3
12
142
277
144
133
null
null
ekr/tamarin-prover
lib/theory/src/Theory/Constraint/Solver/Simplify.hs
gpl-3.0
-- | Apply CR-rules that don't result in case splitting until the constraint -- system does not change anymore. simplifySystem :: Reduction () simplifySystem = do isdiff <- getM sDiffSystem -- Start simplification, indicating that some change happened go (0 :: Int) [Changed] -- Add all ordering constrai...
4,302
simplifySystem :: Reduction () simplifySystem = do isdiff <- getM sDiffSystem -- Start simplification, indicating that some change happened go (0 :: Int) [Changed] -- Add all ordering constraint implied by CR-rule *N6*. if isdiff then do removeSolvedSplitGoals else do e...
4,190
simplifySystem = do isdiff <- getM sDiffSystem -- Start simplification, indicating that some change happened go (0 :: Int) [Changed] -- Add all ordering constraint implied by CR-rule *N6*. if isdiff then do removeSolvedSplitGoals else do exploitUniqueMsgOrder --...
4,159
true
true
0
24
1,873
724
378
346
null
null
cocreature/stack
src/Stack/Setup.hs
bsd-3-clause
downloadPair :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m) => DownloadPair -> PackageIdentifier -> m (Path Abs File, ArchiveType) downloadPair (DownloadPair _ url) ident = do config <- asks getConfig ...
989
downloadPair :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m) => DownloadPair -> PackageIdentifier -> m (Path Abs File, ArchiveType) downloadPair (DownloadPair _ url) ident = do config <- asks getConfig ...
989
downloadPair (DownloadPair _ url) ident = do config <- asks getConfig at <- case extension of ".tar.xz" -> return TarXz ".tar.bz2" -> return TarBz2 ".7z.exe" -> return SevenZ _ -> error $ "Unknown extension: " ++ extension relfile <- parseRelFile $ pac...
746
false
true
0
12
313
308
150
158
null
null
Saulzar/reflex
test/Reflex/Bench/Focused.hs
bsd-3-clause
joinDynChain :: (Reflex t, MonadHold t m) => Word -> Dynamic t Word -> m (Dynamic t Word) joinDynChain = iterM (\d -> return $ join $ fmap (const d) d)
151
joinDynChain :: (Reflex t, MonadHold t m) => Word -> Dynamic t Word -> m (Dynamic t Word) joinDynChain = iterM (\d -> return $ join $ fmap (const d) d)
151
joinDynChain = iterM (\d -> return $ join $ fmap (const d) d)
61
false
true
0
11
30
82
41
41
null
null
maxking/cs583-project
src/Bot.hs
gpl-3.0
excepHandler :: SomeException -> IO (Either ArgError a) excepHandler _ = return (Left InvalidType)
98
excepHandler :: SomeException -> IO (Either ArgError a) excepHandler _ = return (Left InvalidType)
98
excepHandler _ = return (Left InvalidType)
42
false
true
0
8
13
42
19
23
null
null
mariefarrell/Hets
HasCASL/DataAna.hs
gpl-2.0
mkPremise :: Map.Map Type DataPat -> DataPat -> AltDefn -> [Term] mkPremise m dp (Construct mc ts p sels) = case mc of Nothing -> [] Just c -> let vars = map (map snd) $ genSelVars 1 sels findHypo vd@(VarDecl _ ty _ _) = fmap (`mkPredToVarAppl` vd) $ Map.lookup ty m flatVars = conc...
650
mkPremise :: Map.Map Type DataPat -> DataPat -> AltDefn -> [Term] mkPremise m dp (Construct mc ts p sels) = case mc of Nothing -> [] Just c -> let vars = map (map snd) $ genSelVars 1 sels findHypo vd@(VarDecl _ ty _ _) = fmap (`mkPredToVarAppl` vd) $ Map.lookup ty m flatVars = conc...
650
mkPremise m dp (Construct mc ts p sels) = case mc of Nothing -> [] Just c -> let vars = map (map snd) $ genSelVars 1 sels findHypo vd@(VarDecl _ ty _ _) = fmap (`mkPredToVarAppl` vd) $ Map.lookup ty m flatVars = concat vars indHypos = mapMaybe findHypo flatVars indConcl...
584
false
true
0
17
188
252
122
130
null
null
reuleaux/pire
src/Pire/Wrap.hs
bsd-3-clause
(ErasedApp x y) = ErasedApp (wrap' x) (wrap' y) w
53
wrap' (ErasedApp x y) = ErasedApp (wrap' x) (wrap' y)
53
wrap' (ErasedApp x y) = ErasedApp (wrap' x) (wrap' y)
53
false
false
0
7
12
35
16
19
null
null
karamellpelle/grid
source/OpenGL/ES2/Values.hs
gpl-3.0
gl_FRONT_AND_BACK :: GLenum gl_FRONT_AND_BACK = 0x0408
68
gl_FRONT_AND_BACK :: GLenum gl_FRONT_AND_BACK = 0x0408
68
gl_FRONT_AND_BACK = 0x0408
40
false
true
0
4
19
11
6
5
null
null
mariefarrell/Hets
Adl/Sign.hs
gpl-2.0
symOf :: Sign -> Set.Set Symbol symOf = Set.unions . map (\ (i, l) -> Set.fromList . concatMap (\ y -> let s = relSrc y t = relTrg y in [Con s, Con t, Rel $ Sgn (idToSimpleId i) y]) $ Set.toList l) . Map.toL...
330
symOf :: Sign -> Set.Set Symbol symOf = Set.unions . map (\ (i, l) -> Set.fromList . concatMap (\ y -> let s = relSrc y t = relTrg y in [Con s, Con t, Rel $ Sgn (idToSimpleId i) y]) $ Set.toList l) . Map.toL...
330
symOf = Set.unions . map (\ (i, l) -> Set.fromList . concatMap (\ y -> let s = relSrc y t = relTrg y in [Con s, Con t, Rel $ Sgn (idToSimpleId i) y]) $ Set.toList l) . Map.toList . rels
298
false
true
0
22
160
131
66
65
null
null
bredelings/BAli-Phy
haskell/SModel.hs
gpl-2.0
m7 mu gamma n_bins model_func = parameter_mixture_unit (m7_omega_dist mu gamma n_bins) model_func
98
m7 mu gamma n_bins model_func = parameter_mixture_unit (m7_omega_dist mu gamma n_bins) model_func
98
m7 mu gamma n_bins model_func = parameter_mixture_unit (m7_omega_dist mu gamma n_bins) model_func
98
false
false
0
7
12
33
14
19
null
null
spechub/Hets
CspCASLProver/Utils.hs
gpl-2.0
{- | Add a single compare_with function for a given sort to an Isabelle theory. We need to know about the casl signature (data part of a CspCASL spec) to work out the RHS of the equations. -} addCompareWithFun :: CASLSign.CASLSign -> IsaTheory -> SORT -> IsaTheory addCompareWithFun caslSign isaTh sort = let sortLi...
2,475
addCompareWithFun :: CASLSign.CASLSign -> IsaTheory -> SORT -> IsaTheory addCompareWithFun caslSign isaTh sort = let sortList = Set.toList (CASLSign.sortSet caslSign) sortType = Type {typeId = convertSort2String sort, typeSort = [], typeArgs = []} funName = mkCompar...
2,282
addCompareWithFun caslSign isaTh sort = let sortList = Set.toList (CASLSign.sortSet caslSign) sortType = Type {typeId = convertSort2String sort, typeSort = [], typeArgs = []} funName = mkCompareWithFunName sort funType = mkFunType sortType $ mkFunType preAlp...
2,209
true
true
0
16
976
445
223
222
null
null
cmahon/interactive-brokers
library/API/IB/Enum.hs
bsd-3-clause
parseIBComboLegOpenClose :: Parser IBComboLegOpenClose parseIBComboLegOpenClose = return ComboLegParent <* string "0" <|> return ComboLegOpen <* string "1" <|> return ComboLegClose <* string "2" <|> return ComboLegUnknown <* string "3"
244
parseIBComboLegOpenClose :: Parser IBComboLegOpenClose parseIBComboLegOpenClose = return ComboLegParent <* string "0" <|> return ComboLegOpen <* string "1" <|> return ComboLegClose <* string "2" <|> return ComboLegUnknown <* string "3"
244
parseIBComboLegOpenClose = return ComboLegParent <* string "0" <|> return ComboLegOpen <* string "1" <|> return ComboLegClose <* string "2" <|> return ComboLegUnknown <* string "3"
189
false
true
0
12
37
66
29
37
null
null
uduki/hsQt
Qtc/Gui/QSizePolicy.hs
bsd-2-clause
qSizePolicy_delete :: QSizePolicy a -> IO () qSizePolicy_delete x0 = withObjectPtr x0 $ \cobj_x0 -> qtc_QSizePolicy_delete cobj_x0
136
qSizePolicy_delete :: QSizePolicy a -> IO () qSizePolicy_delete x0 = withObjectPtr x0 $ \cobj_x0 -> qtc_QSizePolicy_delete cobj_x0
136
qSizePolicy_delete x0 = withObjectPtr x0 $ \cobj_x0 -> qtc_QSizePolicy_delete cobj_x0
91
false
true
2
8
22
46
20
26
null
null
urbanslug/ghc
compiler/coreSyn/CoreUnfold.hs
bsd-3-clause
-- Ditto (augment t (\cn -> e) ys) should cost only the cost of -- e plus ys. The -2 accounts for the \cn -- When we return a lambda, give a discount if it's used (applied) lamScrutDiscount :: DynFlags -> ExprSize -> ExprSize lamScrutDiscount dflags (SizeIs n vs _) = SizeIs n vs (iUnbox (ufFunAppDiscount dflag...
323
lamScrutDiscount :: DynFlags -> ExprSize -> ExprSize lamScrutDiscount dflags (SizeIs n vs _) = SizeIs n vs (iUnbox (ufFunAppDiscount dflags))
141
lamScrutDiscount dflags (SizeIs n vs _) = SizeIs n vs (iUnbox (ufFunAppDiscount dflags))
88
true
true
0
9
65
60
30
30
null
null
ahavrylyuk/hackerrank
haskell/eval-ex.hs
mit
solve x = 1 + sum (map (\t -> x ** fromIntegral t / fac t) [1..9])
66
solve x = 1 + sum (map (\t -> x ** fromIntegral t / fac t) [1..9])
66
solve x = 1 + sum (map (\t -> x ** fromIntegral t / fac t) [1..9])
66
false
false
0
13
16
51
25
26
null
null
ku-fpg/kansas-amber
System/Hardware/Haskino/ShallowDeepPlugin/Utils.hs
bsd-3-clause
fmapAbsExpr :: PassCoreM m => Type -> Type -> CoreExpr -> m CoreExpr fmapAbsExpr tyConTy ty e = do absId <- thNameToId absNameTH exprTyConApp <- thNameTyToTyConApp exprTyConTH ty fmapId <- thNameToId fmapNameTH functDict <- thNameTyToDict functTyConTH tyConTy let absApp = mkCoreApps (Var absId) [...
468
fmapAbsExpr :: PassCoreM m => Type -> Type -> CoreExpr -> m CoreExpr fmapAbsExpr tyConTy ty e = do absId <- thNameToId absNameTH exprTyConApp <- thNameTyToTyConApp exprTyConTH ty fmapId <- thNameToId fmapNameTH functDict <- thNameTyToDict functTyConTH tyConTy let absApp = mkCoreApps (Var absId) [...
468
fmapAbsExpr tyConTy ty e = do absId <- thNameToId absNameTH exprTyConApp <- thNameTyToTyConApp exprTyConTH ty fmapId <- thNameToId fmapNameTH functDict <- thNameTyToDict functTyConTH tyConTy let absApp = mkCoreApps (Var absId) [Type ty] return $ mkCoreApps (Var fmapId) [Type tyConTy, Type exp...
399
false
true
0
13
123
161
73
88
null
null
vikraman/ghc
libraries/base/System/Posix/Internals.hs
bsd-3-clause
s_isfifo :: CMode -> Bool s_isfifo cm = c_s_isfifo cm /= 0
58
s_isfifo :: CMode -> Bool s_isfifo cm = c_s_isfifo cm /= 0
58
s_isfifo cm = c_s_isfifo cm /= 0
32
false
true
0
6
11
25
12
13
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/stgSyn/StgLint.hs
bsd-3-clause
checkInScope :: Id -> LintM () checkInScope id = LintM $ \loc scope errs -> if isLocalId id && not (id `elemVarSet` scope) then ((), addErr errs (hsep [ppr id, ptext (sLit "is out of scope")]) loc) else ((), errs)
234
checkInScope :: Id -> LintM () checkInScope id = LintM $ \loc scope errs -> if isLocalId id && not (id `elemVarSet` scope) then ((), addErr errs (hsep [ppr id, ptext (sLit "is out of scope")]) loc) else ((), errs)
234
checkInScope id = LintM $ \loc scope errs -> if isLocalId id && not (id `elemVarSet` scope) then ((), addErr errs (hsep [ppr id, ptext (sLit "is out of scope")]) loc) else ((), errs)
203
false
true
0
15
60
110
58
52
null
null
brendanhay/gogol
gogol-bigquery/gen/Network/Google/Resource/BigQuery/Jobs/Query.hs
mpl-2.0
-- | Project ID of the project billed for the query jqProjectId :: Lens' JobsQuery Text jqProjectId = lens _jqProjectId (\ s a -> s{_jqProjectId = a})
152
jqProjectId :: Lens' JobsQuery Text jqProjectId = lens _jqProjectId (\ s a -> s{_jqProjectId = a})
100
jqProjectId = lens _jqProjectId (\ s a -> s{_jqProjectId = a})
64
true
true
1
9
28
44
22
22
null
null
mmwtsn/write-yourself-a-scheme
04-error-checking-and-exceptions/01-error-checking.hs
mit
numericBinop op singleVal@[_] = throwError $ NumArgs 2 singleVal
64
numericBinop op singleVal@[_] = throwError $ NumArgs 2 singleVal
64
numericBinop op singleVal@[_] = throwError $ NumArgs 2 singleVal
64
false
false
1
8
8
32
13
19
null
null
spechub/Hets
Modal/StatAna.hs
gpl-2.0
ana_M_BASIC_ITEM :: Ana M_BASIC_ITEM M_BASIC_ITEM M_SIG_ITEM M_FORMULA ModalSign ana_M_BASIC_ITEM mix bi = case bi of Simple_mod_decl al fs ps -> do mapM_ ((updateExtInfo . preAddModId) . item) al newFs <- mapAnM (ana_FORMULA mix) fs resFs <- mapAnM (return . fst) newFs ...
860
ana_M_BASIC_ITEM :: Ana M_BASIC_ITEM M_BASIC_ITEM M_SIG_ITEM M_FORMULA ModalSign ana_M_BASIC_ITEM mix bi = case bi of Simple_mod_decl al fs ps -> do mapM_ ((updateExtInfo . preAddModId) . item) al newFs <- mapAnM (ana_FORMULA mix) fs resFs <- mapAnM (return . fst) newFs ...
860
ana_M_BASIC_ITEM mix bi = case bi of Simple_mod_decl al fs ps -> do mapM_ ((updateExtInfo . preAddModId) . item) al newFs <- mapAnM (ana_FORMULA mix) fs resFs <- mapAnM (return . fst) newFs anaFs <- mapAnM (return . snd) newFs mapM_ ((updateExtInfo . a...
775
false
true
1
16
288
305
141
164
null
null
hamishmack/haskell-gi
lib/Data/GI/CodeGen/CodeGen.hs
lgpl-2.1
genBoxedObject :: Name -> Text -> CodeGen () genBoxedObject n typeInit = do let name' = upperName n group $ do line $ "foreign import ccall \"" <> typeInit <> "\" c_" <> typeInit <> " :: " indent $ line "IO GType" group $ do line $ "instance BoxedObject " <> name' <> " where" in...
428
genBoxedObject :: Name -> Text -> CodeGen () genBoxedObject n typeInit = do let name' = upperName n group $ do line $ "foreign import ccall \"" <> typeInit <> "\" c_" <> typeInit <> " :: " indent $ line "IO GType" group $ do line $ "instance BoxedObject " <> name' <> " where" in...
428
genBoxedObject n typeInit = do let name' = upperName n group $ do line $ "foreign import ccall \"" <> typeInit <> "\" c_" <> typeInit <> " :: " indent $ line "IO GType" group $ do line $ "instance BoxedObject " <> name' <> " where" indent $ line $ "boxedType _ = c_" <> typeInit ...
383
false
true
0
12
121
138
63
75
null
null
BartAdv/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
reflectRawQuote unq (RUType u) = reflCall "RUType" [reflectUniverse u]
72
reflectRawQuote unq (RUType u) = reflCall "RUType" [reflectUniverse u]
72
reflectRawQuote unq (RUType u) = reflCall "RUType" [reflectUniverse u]
72
false
false
0
7
10
28
13
15
null
null
hsyl20/ViperVM
haskus-system/src/lib/Haskus/System/Sys.hs
bsd-3-clause
sysAssertQuiet :: Text -> Bool -> Sys () sysAssertQuiet text b = unless b $ do let msg = textFormat (stext % " (assertion failed)") text sysError msg -- | Fail in Sys
173
sysAssertQuiet :: Text -> Bool -> Sys () sysAssertQuiet text b = unless b $ do let msg = textFormat (stext % " (assertion failed)") text sysError msg -- | Fail in Sys
173
sysAssertQuiet text b = unless b $ do let msg = textFormat (stext % " (assertion failed)") text sysError msg -- | Fail in Sys
132
false
true
0
14
39
69
31
38
null
null
rubenmoor/skull
skull-server/src/Game/Bot.hs
mit
numStack :: Player -> Int numStack player = length $ player ^. plAgent . aStack . stCards
93
numStack :: Player -> Int numStack player = length $ player ^. plAgent . aStack . stCards
93
numStack player = length $ player ^. plAgent . aStack . stCards
63
false
true
0
8
20
40
18
22
null
null
unsw-comp4181/accelerate-c-stub
Data/Array/Accelerate/C/Exp.hs
bsd-3-clause
minToC (NonNumScalarType _) a b = let ty = scalarType :: ScalarType Int32 in minToC ty (ccast ty a) (ccast ty b)
135
minToC (NonNumScalarType _) a b = let ty = scalarType :: ScalarType Int32 in minToC ty (ccast ty a) (ccast ty b)
135
minToC (NonNumScalarType _) a b = let ty = scalarType :: ScalarType Int32 in minToC ty (ccast ty a) (ccast ty b)
135
false
false
1
9
44
57
27
30
null
null
zepto-lang/zepto-js
src/Zepto/Primitives.hs
gpl-2.0
load :: String -> IOThrowsError [LispVal] load filename = do res <- liftIO $ doesFileExist filename if res then liftIO (readFile filename) >>= liftThrows . readExprList else throwError $ Default $ "File does not exist: " ++ filename
256
load :: String -> IOThrowsError [LispVal] load filename = do res <- liftIO $ doesFileExist filename if res then liftIO (readFile filename) >>= liftThrows . readExprList else throwError $ Default $ "File does not exist: " ++ filename
256
load filename = do res <- liftIO $ doesFileExist filename if res then liftIO (readFile filename) >>= liftThrows . readExprList else throwError $ Default $ "File does not exist: " ++ filename
214
false
true
0
12
61
78
38
40
null
null
moonKimura/hashable-1.2.1.0
Data/Hashable/SipHash.hs
bsd-3-clause
initState :: (Sip -> r) -> Word64 -> Word64 -> r initState k k0 k1 = k (Sip s0 s1 s2 s3) where !s0 = (k0 `xor` 0x736f6d6570736575) !s1 = (k1 `xor` 0x646f72616e646f6d) !s2 = (k0 `xor` 0x6c7967656e657261) !s3 = (k1 `xor` 0x7465646279746573)
272
initState :: (Sip -> r) -> Word64 -> Word64 -> r initState k k0 k1 = k (Sip s0 s1 s2 s3) where !s0 = (k0 `xor` 0x736f6d6570736575) !s1 = (k1 `xor` 0x646f72616e646f6d) !s2 = (k0 `xor` 0x6c7967656e657261) !s3 = (k1 `xor` 0x7465646279746573)
272
initState k k0 k1 = k (Sip s0 s1 s2 s3) where !s0 = (k0 `xor` 0x736f6d6570736575) !s1 = (k1 `xor` 0x646f72616e646f6d) !s2 = (k0 `xor` 0x6c7967656e657261) !s3 = (k1 `xor` 0x7465646279746573)
223
false
true
0
7
76
125
64
61
null
null
lisphacker/codewars
Roman.hs
bsd-2-clause
val 'X' = 10
12
val 'X' = 10
12
val 'X' = 10
12
false
false
0
5
3
9
4
5
null
null
robeverest/ast-decoration
Rewrite.hs
bsd-3-clause
test4 :: OpenSTLC ((Float -> Float) ': env) ((Float -> Float -> Float) -> Float) test4 = lam $ neg (constant 0.0 `plus` neg (constant 1.0) `plus` constant 2.0 `plus` neg (neg (constant 3.0))) where neg = app var1 plus a b = app (app var0 a) b
256
test4 :: OpenSTLC ((Float -> Float) ': env) ((Float -> Float -> Float) -> Float) test4 = lam $ neg (constant 0.0 `plus` neg (constant 1.0) `plus` constant 2.0 `plus` neg (neg (constant 3.0))) where neg = app var1 plus a b = app (app var0 a) b
255
test4 = lam $ neg (constant 0.0 `plus` neg (constant 1.0) `plus` constant 2.0 `plus` neg (neg (constant 3.0))) where neg = app var1 plus a b = app (app var0 a) b
173
false
true
3
12
61
149
74
75
null
null
jgraydus/circuits
src/Circuits/Alu.hs
gpl-3.0
checkSize :: Int -> Int -> IO () checkSize n m = if n /= m then error "buses are different sizes" else return ()
112
checkSize :: Int -> Int -> IO () checkSize n m = if n /= m then error "buses are different sizes" else return ()
112
checkSize n m = if n /= m then error "buses are different sizes" else return ()
79
false
true
0
9
24
53
25
28
null
null
albertov/hs-mapnik
bindings/src/Mapnik/Bindings/Symbolizer.hs
bsd-3-clause
keyIndex Premultiplied = [C.pure|keys{keys::premultiplied}|]
60
keyIndex Premultiplied = [C.pure|keys{keys::premultiplied}|]
60
keyIndex Premultiplied = [C.pure|keys{keys::premultiplied}|]
60
false
false
0
5
3
16
9
7
null
null
Ekleog/hasklate
examples/PatternMatching.hs
mit
mysum MyNil = 0
15
mysum MyNil = 0
15
mysum MyNil = 0
15
false
false
0
5
3
9
4
5
null
null
thomie/vector
Data/Vector.hs
bsd-3-clause
prescanl' = G.prescanl'
23
prescanl' = G.prescanl'
23
prescanl' = G.prescanl'
23
false
false
0
5
2
8
4
4
null
null
patperry/hs-linear-algebra
lib/Numeric/LinearAlgebra/Matrix/Base.hs
bsd-3-clause
-- | @slice (i,j) (m,n) a@ creates a submatrix view of @a@ starting at -- element @(i,j)@ and having dimensions @(m,n)@. slice :: (Storable e) => (Int,Int) -> (Int,Int) -> Matrix e -> Matrix e slice (i,j) (m',n') a | (i < 0 || m' < 0 || i + m' > m || j < 0 || n' < 0 || j + n' > n) = ...
610
slice :: (Storable e) => (Int,Int) -> (Int,Int) -> Matrix e -> Matrix e slice (i,j) (m',n') a | (i < 0 || m' < 0 || i + m' > m || j < 0 || n' < 0 || j + n' > n) = error $ printf ( "slice" ++ " (%d,%d)" ++ " (%d,%d)" ++ " <matrix wi...
489
slice (i,j) (m',n') a | (i < 0 || m' < 0 || i + m' > m || j < 0 || n' < 0 || j + n' > n) = error $ printf ( "slice" ++ " (%d,%d)" ++ " (%d,%d)" ++ " <matrix with dim (%d,%d)>" ++ ": index out of range" ) i j m' n' m n | o...
393
true
true
1
21
247
218
114
104
null
null
ojw/admin-and-dev
src/Util/HasAcidState.hs
bsd-3-clause
query :: forall event m. ( Functor m , MonadIO m , QueryEvent event , HasAcidState m (EventState event) ) => event -> m (EventResult event) query event = do as <- getAcidState query' (as :: AcidState (EventState event)) event
296
query :: forall event m. ( Functor m , MonadIO m , QueryEvent event , HasAcidState m (EventState event) ) => event -> m (EventResult event) query event = do as <- getAcidState query' (as :: AcidState (EventState event)) event
296
query event = do as <- getAcidState query' (as :: AcidState (EventState event)) event
96
false
true
0
11
110
98
49
49
null
null
mpickering/hackage-server
Distribution/Server/Features/PackageCandidates/State.hs
bsd-3-clause
addCandidate :: CandPkgInfo -> Update CandidatePackages () addCandidate pkg = State.modify $ \candidates -> candidates { candidateList = addVersion (candidateList candidates) } where addVersion = PackageIndex.insert pkg
223
addCandidate :: CandPkgInfo -> Update CandidatePackages () addCandidate pkg = State.modify $ \candidates -> candidates { candidateList = addVersion (candidateList candidates) } where addVersion = PackageIndex.insert pkg
223
addCandidate pkg = State.modify $ \candidates -> candidates { candidateList = addVersion (candidateList candidates) } where addVersion = PackageIndex.insert pkg
164
false
true
0
11
30
66
33
33
null
null
dysinger/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/AddCache.hs
mpl-2.0
acGatewayARN :: Lens' AddCache Text acGatewayARN = lens _acGatewayARN (\s a -> s { _acGatewayARN = a })
103
acGatewayARN :: Lens' AddCache Text acGatewayARN = lens _acGatewayARN (\s a -> s { _acGatewayARN = a })
103
acGatewayARN = lens _acGatewayARN (\s a -> s { _acGatewayARN = a })
67
false
true
0
9
17
39
21
18
null
null
idris-hackers/idris-java
src/IRTS/CodegenJava.hs
bsd-3-clause
ignoreOuter :: BlockPostprocessor -> BlockPostprocessor ignoreOuter pp = pp { ppOuterBlock = return }
101
ignoreOuter :: BlockPostprocessor -> BlockPostprocessor ignoreOuter pp = pp { ppOuterBlock = return }
101
ignoreOuter pp = pp { ppOuterBlock = return }
45
false
true
0
6
13
26
14
12
null
null
music-suite/music-pitch
src/Music/Pitch/Clef.hs
bsd-3-clause
- | Standard baritone clef. baritoneClef :: Clef trebleClef = Clef (GClef, -1 :: ClefOctave, -1 :: ClefLine)
116
baritoneClef :: Clef trebleClef = Clef (GClef, -1 :: ClefOctave, -1 :: ClefLine)
87
trebleClef = Clef (GClef, -1 :: ClefOctave, -1 :: ClefLine)
66
true
true
1
9
25
49
25
24
null
null
liwanwei/pandoc
src/Text/Pandoc/Parsing.hs
gpl-2.0
citeKey :: (Stream s m Char, HasLastStrPosition st) => ParserT s st m (Bool, String) citeKey = try $ do guard =<< notAfterString suppress_author <- option False (char '-' *> return True) char '@' firstChar <- alphaNum <|> char '_' <|> char '*' -- @* for wildcard in nocite let regchar = satisfy (\c -> ...
514
citeKey :: (Stream s m Char, HasLastStrPosition st) => ParserT s st m (Bool, String) citeKey = try $ do guard =<< notAfterString suppress_author <- option False (char '-' *> return True) char '@' firstChar <- alphaNum <|> char '_' <|> char '*' -- @* for wildcard in nocite let regchar = satisfy (\c -> ...
514
citeKey = try $ do guard =<< notAfterString suppress_author <- option False (char '-' *> return True) char '@' firstChar <- alphaNum <|> char '_' <|> char '*' -- @* for wildcard in nocite let regchar = satisfy (\c -> isAlphaNum c || c == '_') let internal p = try $ p <* lookAhead regchar rest <- many $ re...
421
false
true
0
17
112
218
101
117
null
null
green-haskell/ghc
compiler/typecheck/FunDeps.hs
bsd-3-clause
badFunDeps :: [ClsInst] -> Class -> TyVarSet -> [Type] -- Proposed new instance type -> [ClsInst] badFunDeps cls_insts clas ins_tv_set ins_tys = nubBy eq_inst $ [ ispec | fd <- fds, -- fds is often empty, so do this first! let trimmed_tcs = trimRoughMatchTcs clas_...
954
badFunDeps :: [ClsInst] -> Class -> TyVarSet -> [Type] -- Proposed new instance type -> [ClsInst] badFunDeps cls_insts clas ins_tv_set ins_tys = nubBy eq_inst $ [ ispec | fd <- fds, -- fds is often empty, so do this first! let trimmed_tcs = trimRoughMatchTcs clas_...
954
badFunDeps cls_insts clas ins_tv_set ins_tys = nubBy eq_inst $ [ ispec | fd <- fds, -- fds is often empty, so do this first! let trimmed_tcs = trimRoughMatchTcs clas_tvs fd rough_tcs, ispec <- cls_insts, notNull (checkClsFD fd clas_tvs ispec ins_tv_set ins_tys trim...
827
false
true
4
11
302
178
87
91
null
null
tjakway/ghcjvm
compiler/prelude/THNames.hs
bsd-3-clause
-- data Exp = ... varEIdKey, conEIdKey, litEIdKey, appEIdKey, infixEIdKey, infixAppIdKey, sectionLIdKey, sectionRIdKey, lamEIdKey, lamCaseEIdKey, tupEIdKey, unboxedTupEIdKey, condEIdKey, multiIfEIdKey, letEIdKey, caseEIdKey, doEIdKey, compEIdKey, fromEIdKey, fromThenEIdKey, fromToEIdKey, fromThenToEIdKe...
468
varEIdKey, conEIdKey, litEIdKey, appEIdKey, infixEIdKey, infixAppIdKey, sectionLIdKey, sectionRIdKey, lamEIdKey, lamCaseEIdKey, tupEIdKey, unboxedTupEIdKey, condEIdKey, multiIfEIdKey, letEIdKey, caseEIdKey, doEIdKey, compEIdKey, fromEIdKey, fromThenEIdKey, fromToEIdKey, fromThenToEIdKey, listEIdKey,...
450
varEIdKey = mkPreludeMiscIdUnique 270
45
true
true
2
5
70
73
62
11
null
null
moonKimura/vector-0.10.9.1
Data/Vector/Generic.hs
bsd-3-clause
singleton x = elemseq (undefined :: v a) x $ unstream (Stream.singleton x)
86
singleton x = elemseq (undefined :: v a) x $ unstream (Stream.singleton x)
86
singleton x = elemseq (undefined :: v a) x $ unstream (Stream.singleton x)
86
false
false
0
9
24
38
18
20
null
null
meteogrid/sigym4-geometry
src/Sigym4/Geometry/Json.hs
bsd-3-clause
parseLineString :: VectorSpace v => [[Double]] -> Parser (LineString v crs) parseLineString ps = do ps' <- mapM parsePoint ps maybe (fail "parseLineString: Invalid linestring") return (mkLineString ps')
220
parseLineString :: VectorSpace v => [[Double]] -> Parser (LineString v crs) parseLineString ps = do ps' <- mapM parsePoint ps maybe (fail "parseLineString: Invalid linestring") return (mkLineString ps')
220
parseLineString ps = do ps' <- mapM parsePoint ps maybe (fail "parseLineString: Invalid linestring") return (mkLineString ps')
144
false
true
0
10
45
80
37
43
null
null
lukasepple/grav1ty
lib/Grav2ty/Core.hs
gpl-3.0
-- | Generates a 'Hitbox' with a given radius centered around (0,0). centeredCircle :: Num a => a -> Hitbox a centeredCircle = HCircle (V2 0 0)
143
centeredCircle :: Num a => a -> Hitbox a centeredCircle = HCircle (V2 0 0)
74
centeredCircle = HCircle (V2 0 0)
33
true
true
0
7
26
37
18
19
null
null
garrettoreilly/doompiler
src/Parser.hs
mit
getIntOp (Token IntOp _ _ _ : xs) = xs
38
getIntOp (Token IntOp _ _ _ : xs) = xs
38
getIntOp (Token IntOp _ _ _ : xs) = xs
38
false
false
0
7
9
26
12
14
null
null
kolmodin/cabal
cabal-install/Distribution/Client/ProjectPlanning.hs
bsd-3-clause
packageSetupScriptStyle :: PD.PackageDescription -> SetupScriptStyle packageSetupScriptStyle pkg | buildType == PD.Custom , Just setupbi <- PD.setupBuildInfo pkg -- does have a custom-setup stanza , not (PD.defaultSetupDepends setupbi) -- but not one we added internally = SetupCustomExplicitDeps | buildType...
1,723
packageSetupScriptStyle :: PD.PackageDescription -> SetupScriptStyle packageSetupScriptStyle pkg | buildType == PD.Custom , Just setupbi <- PD.setupBuildInfo pkg -- does have a custom-setup stanza , not (PD.defaultSetupDepends setupbi) -- but not one we added internally = SetupCustomExplicitDeps | buildType...
1,723
packageSetupScriptStyle pkg | buildType == PD.Custom , Just setupbi <- PD.setupBuildInfo pkg -- does have a custom-setup stanza , not (PD.defaultSetupDepends setupbi) -- but not one we added internally = SetupCustomExplicitDeps | buildType == PD.Custom , Just setupbi <- PD.setupBuildInfo pkg -- we get thi...
1,654
false
true
0
11
305
210
108
102
null
null
uduki/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qCastList_QLCDNumber x = qcl_QLCDNumber [] x
44
qCastList_QLCDNumber x = qcl_QLCDNumber [] x
44
qCastList_QLCDNumber x = qcl_QLCDNumber [] x
44
false
false
0
6
5
16
7
9
null
null
bartoszw/yelca
Handler/Loan.hs
gpl-2.0
-- The POST handler processes the form. If it is successful, it displays the -- parsed person. Otherwise, it displays the form again with error messages. postLoanR :: Handler Html postLoanR = do ((result, widget), enctype) <- runFormPost $ loanForm (initLoan) initErrors case result of FormSuccess loan -...
1,626
postLoanR :: Handler Html postLoanR = do ((result, widget), enctype) <- runFormPost $ loanForm (initLoan) initErrors case result of FormSuccess loan -> do let ip = presentLoan loan ipWF = presentLoanWithoutFee loan cl = calc $ newAbsLoan loan setLo...
1,472
postLoanR = do ((result, widget), enctype) <- runFormPost $ loanForm (initLoan) initErrors case result of FormSuccess loan -> do let ip = presentLoan loan ipWF = presentLoanWithoutFee loan cl = calc $ newAbsLoan loan setLoanToSession loan ...
1,446
true
true
0
29
563
384
182
202
null
null
5outh/BeFun
src/FunctionProcesses.hs
mit
getOp bs@(BefungeState is (y:x:xs) loc dir m r) = Right $ BefungeState is (op:xs) loc dir m r where moved = moveTo' bs (x, y) op = ord $ opToChar (getFocus' moved)
176
getOp bs@(BefungeState is (y:x:xs) loc dir m r) = Right $ BefungeState is (op:xs) loc dir m r where moved = moveTo' bs (x, y) op = ord $ opToChar (getFocus' moved)
176
getOp bs@(BefungeState is (y:x:xs) loc dir m r) = Right $ BefungeState is (op:xs) loc dir m r where moved = moveTo' bs (x, y) op = ord $ opToChar (getFocus' moved)
176
false
false
1
11
44
101
51
50
null
null
ezyang/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
setMetaTyVarTcLevel :: TcTyVar -> TcLevel -> TcTyVar setMetaTyVarTcLevel tv tclvl = case tcTyVarDetails tv of details@(MetaTv {}) -> setTcTyVarDetails tv (details { mtv_tclvl = tclvl }) _ -> pprPanic "metaTyVarTcLevel" (ppr tv)
241
setMetaTyVarTcLevel :: TcTyVar -> TcLevel -> TcTyVar setMetaTyVarTcLevel tv tclvl = case tcTyVarDetails tv of details@(MetaTv {}) -> setTcTyVarDetails tv (details { mtv_tclvl = tclvl }) _ -> pprPanic "metaTyVarTcLevel" (ppr tv)
241
setMetaTyVarTcLevel tv tclvl = case tcTyVarDetails tv of details@(MetaTv {}) -> setTcTyVarDetails tv (details { mtv_tclvl = tclvl }) _ -> pprPanic "metaTyVarTcLevel" (ppr tv)
188
false
true
0
11
45
85
42
43
null
null
antalsz/hs-to-coq
examples/graph/graph/Data/Graph/Inductive/Query/ArtPoint.hs
mit
------------------------------------------------------------------------------ -- Finds the articulation points of a graph starting at a given node. ------------------------------------------------------------------------------ artpoints :: (Graph gr) => gr a b -> Node -> [Node] artpoints g v = arp (getLowTree g v)
316
artpoints :: (Graph gr) => gr a b -> Node -> [Node] artpoints g v = arp (getLowTree g v)
88
artpoints g v = arp (getLowTree g v)
36
true
true
0
8
34
55
29
26
null
null
lux01/synacor
grid-src/Main.hs
mit
getOperator (2, 3) = (-)
24
getOperator (2, 3) = (-)
24
getOperator (2, 3) = (-)
24
false
false
0
6
4
17
10
7
null
null
j4/collecteur
src/Collecteur/WordPress.hs
bsd-3-clause
collectResult :: String -> IO [Article] collectResult url = extractWP url
73
collectResult :: String -> IO [Article] collectResult url = extractWP url
73
collectResult url = extractWP url
33
false
true
0
7
10
27
13
14
null
null
rumblesan/improviz
src/Language/Interpreter.hs
bsd-3-clause
interpretFunc :: Func -> InterpreterProcess Value interpretFunc f@(Func name args lBlock) = do scope <- use variables setVariable name (LambdaRef $ Lambda args (Just scope) lBlock)
184
interpretFunc :: Func -> InterpreterProcess Value interpretFunc f@(Func name args lBlock) = do scope <- use variables setVariable name (LambdaRef $ Lambda args (Just scope) lBlock)
184
interpretFunc f@(Func name args lBlock) = do scope <- use variables setVariable name (LambdaRef $ Lambda args (Just scope) lBlock)
134
false
true
0
12
29
72
34
38
null
null
frontrowed/stratosphere
library-gen/Stratosphere/Resources/Route53RecordSet.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset.html#cfn-route53-recordset-healthcheckid rrsHealthCheckId :: Lens' Route53RecordSet (Maybe (Val Text)) rrsHealthCheckId = lens _route53RecordSetHealthCheckId (\s a -> s { _route53RecordSetHealthCheckId = a })
308
rrsHealthCheckId :: Lens' Route53RecordSet (Maybe (Val Text)) rrsHealthCheckId = lens _route53RecordSetHealthCheckId (\s a -> s { _route53RecordSetHealthCheckId = a })
167
rrsHealthCheckId = lens _route53RecordSetHealthCheckId (\s a -> s { _route53RecordSetHealthCheckId = a })
105
true
true
0
9
22
52
28
24
null
null
themoritz/cabal
cabal-install/Distribution/Client/ProjectOrchestration.hs
bsd-3-clause
filterTargetsKindWith :: (ComponentKind -> Bool) -> [AvailableTarget k] -> [AvailableTarget k] filterTargetsKindWith p ts = [ t | t@(AvailableTarget _ cname _ _) <- ts , p (componentKind cname) ]
228
filterTargetsKindWith :: (ComponentKind -> Bool) -> [AvailableTarget k] -> [AvailableTarget k] filterTargetsKindWith p ts = [ t | t@(AvailableTarget _ cname _ _) <- ts , p (componentKind cname) ]
228
filterTargetsKindWith p ts = [ t | t@(AvailableTarget _ cname _ _) <- ts , p (componentKind cname) ]
112
false
true
0
10
62
82
42
40
null
null
brendanhay/gogol
gogol-androidmanagement/gen/Network/Google/AndroidManagement/Types.hs
mpl-2.0
-- | Manage Android devices and apps for your customers androidManagementScope :: Proxy '["https://www.googleapis.com/auth/androidmanagement"] androidManagementScope = Proxy
173
androidManagementScope :: Proxy '["https://www.googleapis.com/auth/androidmanagement"] androidManagementScope = Proxy
117
androidManagementScope = Proxy
30
true
true
0
7
16
20
11
9
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
mpl-2.0
-- | Pricing schedule of this placement group. This field is required on -- insertion. plalPricingSchedule :: Lens' PlacementGroup (Maybe PricingSchedule) plalPricingSchedule = lens _plalPricingSchedule (\ s a -> s{_plalPricingSchedule = a})
249
plalPricingSchedule :: Lens' PlacementGroup (Maybe PricingSchedule) plalPricingSchedule = lens _plalPricingSchedule (\ s a -> s{_plalPricingSchedule = a})
162
plalPricingSchedule = lens _plalPricingSchedule (\ s a -> s{_plalPricingSchedule = a})
94
true
true
0
9
39
47
26
21
null
null
kyren/hsgb
lib/Gameboy/Instructions.hs
unlicense
encodeInstruction (ADD_A_R DRegister) = [0x82]
46
encodeInstruction (ADD_A_R DRegister) = [0x82]
46
encodeInstruction (ADD_A_R DRegister) = [0x82]
46
false
false
0
6
4
19
9
10
null
null
synsem/texhs
src/Text/TeX/Lexer/TokenParser/Expansion.hs
gpl-3.0
-- | Expand a call of a user-defined macro -- and return the expansion. expansion :: Monad m => MacroCmd -> LexerT m [Token] expansion m = do guard $ isMacroCmdUser m args <- parseArgspec (macroCmdContext m) return $ applyMacro (macroCmdBody m) args -------------------- Environment expansion -- | Expand a user-...
412
expansion :: Monad m => MacroCmd -> LexerT m [Token] expansion m = do guard $ isMacroCmdUser m args <- parseArgspec (macroCmdContext m) return $ applyMacro (macroCmdBody m) args -------------------- Environment expansion -- | Expand a user-defined environment -- and return the expansion as a pair of -- @start c...
340
expansion m = do guard $ isMacroCmdUser m args <- parseArgspec (macroCmdContext m) return $ applyMacro (macroCmdBody m) args -------------------- Environment expansion -- | Expand a user-defined environment -- and return the expansion as a pair of -- @start code@ and @end code@.
287
true
true
0
10
74
83
41
42
null
null
urbanslug/ghc
compiler/utils/ExtsCompat46.hs
bsd-3-clause
(<=##) :: Double# -> Double# -> Bool (<=##) a b = isTrue# (a E.<=## b)
70
(<=##) :: Double# -> Double# -> Bool (<=##) a b = isTrue# (a E.<=## b)
70
(<=##) a b = isTrue# (a E.<=## b)
33
false
true
0
7
14
40
22
18
null
null
JacquesCarette/literate-scientific-software
code/drasil-docLang/Drasil/DocumentLanguage.hs
bsd-2-clause
mkOffShelfSolnSec :: OffShelfSolnsSec -> Section mkOffShelfSolnSec (OffShelfSolnsProg cs) = SRS.offShelfSol cs []
113
mkOffShelfSolnSec :: OffShelfSolnsSec -> Section mkOffShelfSolnSec (OffShelfSolnsProg cs) = SRS.offShelfSol cs []
113
mkOffShelfSolnSec (OffShelfSolnsProg cs) = SRS.offShelfSol cs []
64
false
true
0
6
11
37
17
20
null
null
bgamari/linear-opengl
src/Linear/OpenGL/MatrixUniforms.hs
bsd-3-clause
maxUniformBufferSize :: Int maxUniformBufferSize = maxComponentSize * maxNumComponents
86
maxUniformBufferSize :: Int maxUniformBufferSize = maxComponentSize * maxNumComponents
86
maxUniformBufferSize = maxComponentSize * maxNumComponents
58
false
true
0
5
7
15
8
7
null
null
scslab/iterIO
Data/IterIO/Trans.hs
bsd-3-clause
adaptIterM :: (ChunkData t, Monad m1, Monad m2) => (m1 (Iter t m1 a) -> m2 (Iter t m1 a)) -- ^ Conversion function -> Iter t m1 a -- ^ 'Iter' of input monad -> Iter t m2 a -- ^ Returns 'Iter' of output monad adaptIterM f = adapt where adapt = adaptIter id $ lift . f >...
437
adaptIterM :: (ChunkData t, Monad m1, Monad m2) => (m1 (Iter t m1 a) -> m2 (Iter t m1 a)) -- ^ Conversion function -> Iter t m1 a -- ^ 'Iter' of input monad -> Iter t m2 a adaptIterM f = adapt where adapt = adaptIter id $ lift . f >=> adapt -- | Run an @'Iter' s m@ computa...
395
adaptIterM f = adapt where adapt = adaptIter id $ lift . f >=> adapt -- | Run an @'Iter' s m@ computation from witin the @'Iter' s (t m)@ -- monad, where @t@ is a 'MonadTrans'.
181
true
true
1
12
136
126
61
65
null
null
Gathros/algorithm-archive
contents/huffman_encoding/code/haskell/huffman.hs
mit
freq :: Tree a -> Int freq (Leaf i _) = i
43
freq :: Tree a -> Int freq (Leaf i _) = i
43
freq (Leaf i _) = i
21
false
true
0
9
13
35
15
20
null
null
kazu-yamamoto/http2
Network/HTTP2/Arch/Context.hs
bsd-3-clause
halfClosedLocal :: Context -> Stream -> ClosedCode -> IO () halfClosedLocal ctx stream@Stream{streamState} cc = do shouldFinalize <- atomicModifyIORef streamState closeHalf when shouldFinalize $ closed ctx stream cc where closeHalf :: StreamState -> (StreamState, Bool) closeHalf x@(Closed _) ...
447
halfClosedLocal :: Context -> Stream -> ClosedCode -> IO () halfClosedLocal ctx stream@Stream{streamState} cc = do shouldFinalize <- atomicModifyIORef streamState closeHalf when shouldFinalize $ closed ctx stream cc where closeHalf :: StreamState -> (StreamState, Bool) closeHalf x@(Closed _) ...
447
halfClosedLocal ctx stream@Stream{streamState} cc = do shouldFinalize <- atomicModifyIORef streamState closeHalf when shouldFinalize $ closed ctx stream cc where closeHalf :: StreamState -> (StreamState, Bool) closeHalf x@(Closed _) = (x, False) closeHalf HalfClosedRemote = (Closed cc,...
387
false
true
4
9
105
149
75
74
null
null
vito/atomo
src/Atomo/Parser/Expand.hs
bsd-3-clause
doPragmas (EList { eContents = es }) = do mapM_ doPragmas es
64
doPragmas (EList { eContents = es }) = do mapM_ doPragmas es
64
doPragmas (EList { eContents = es }) = do mapM_ doPragmas es
64
false
false
0
9
15
29
14
15
null
null
blamario/monoid-subclasses
src/Data/Monoid/Instances/Positioned.hs
bsd-3-clause
linesColumns :: TextualMonoid m => m -> (Int, Int) linesColumns t = Textual.foldl (const . fmap succ) fc (0, 1) t where fc (l, _) '\n' = (succ l, 1) fc (l, _) '\f' = (succ l, 1) fc (l, _) '\r' = (l, 1) fc (l, c) '\t' = (l, c + 9 - c `mod` 8) fc (l, c) ch | isZeroWidth ch = (l, c) ...
354
linesColumns :: TextualMonoid m => m -> (Int, Int) linesColumns t = Textual.foldl (const . fmap succ) fc (0, 1) t where fc (l, _) '\n' = (succ l, 1) fc (l, _) '\f' = (succ l, 1) fc (l, _) '\r' = (l, 1) fc (l, c) '\t' = (l, c + 9 - c `mod` 8) fc (l, c) ch | isZeroWidth ch = (l, c) ...
354
linesColumns t = Textual.foldl (const . fmap succ) fc (0, 1) t where fc (l, _) '\n' = (succ l, 1) fc (l, _) '\f' = (succ l, 1) fc (l, _) '\r' = (l, 1) fc (l, c) '\t' = (l, c + 9 - c `mod` 8) fc (l, c) ch | isZeroWidth ch = (l, c) fc (l, c) _ = (l, succ c)
303
false
true
4
9
123
254
125
129
null
null
JohnLato/splaytree
src/Data/SplayTree/BQueue.hs
bsd-3-clause
-- find does a linear-like search, so we really don't want to splay the -- tree find :: (a -> Bool) -> BQueue a -> Maybe (Int, a) find p (BQueue tree) = go 0 tree where go _ Tip = Nothing go pre (Branch m l (Elem a) r) = case go pre l of Nothing | p a -> Just (pre+getSum (measure l), a) ...
467
find :: (a -> Bool) -> BQueue a -> Maybe (Int, a) find p (BQueue tree) = go 0 tree where go _ Tip = Nothing go pre (Branch m l (Elem a) r) = case go pre l of Nothing | p a -> Just (pre+getSum (measure l), a) | otherwise -> let sum' = pre + 1 + getSum (measure l) ...
387
find p (BQueue tree) = go 0 tree where go _ Tip = Nothing go pre (Branch m l (Elem a) r) = case go pre l of Nothing | p a -> Just (pre+getSum (measure l), a) | otherwise -> let sum' = pre + 1 + getSum (measure l) in sum' `seq` go sum' r J...
337
true
true
0
16
171
203
98
105
null
null
eriksvedang/Carp
src/Obj.hs
mpl-2.0
xobjToTy (XObj (Lst [XObj Ref i t, innerTy]) _ _) = -- This enables parsing of '&' do okInnerTy <- xobjToTy innerTy return (RefTy okInnerTy)
147
xobjToTy (XObj (Lst [XObj Ref i t, innerTy]) _ _) = -- This enables parsing of '&' do okInnerTy <- xobjToTy innerTy return (RefTy okInnerTy)
147
xobjToTy (XObj (Lst [XObj Ref i t, innerTy]) _ _) = -- This enables parsing of '&' do okInnerTy <- xobjToTy innerTy return (RefTy okInnerTy)
147
false
false
0
10
31
62
29
33
null
null
forste/haReFork
tools/hs2alfa/tests/Fields.hs
bsd-3-clause
dist1 p = sq (x p) + sq (y p)
29
dist1 p = sq (x p) + sq (y p)
29
dist1 p = sq (x p) + sq (y p)
29
false
false
0
8
9
31
14
17
null
null
mpickering/pandoc-lit
src/Text/Pandoc/Lit.hs
bsd-3-clause
processHyperref x = x
23
processHyperref x = x
23
processHyperref x = x
23
false
false
1
5
5
13
4
9
null
null
aelve/ilist
src/Data/List/Index.hs
bsd-3-clause
iselect :: (Int -> a -> Bool) -> Int -> a -> ([a], [a]) -> ([a], [a]) iselect p i x ~(ts,fs) | p i x = (x:ts,fs) | otherwise = (ts, x:fs)
164
iselect :: (Int -> a -> Bool) -> Int -> a -> ([a], [a]) -> ([a], [a]) iselect p i x ~(ts,fs) | p i x = (x:ts,fs) | otherwise = (ts, x:fs)
164
iselect p i x ~(ts,fs) | p i x = (x:ts,fs) | otherwise = (ts, x:fs)
94
false
true
0
10
59
118
64
54
null
null
mmarx/jebediah
cli/spaceplane-hangar/Main.hs
gpl-3.0
toLead4 t = toLead Contrabass t . up 1
38
toLead4 t = toLead Contrabass t . up 1
38
toLead4 t = toLead Contrabass t . up 1
38
false
false
0
6
8
21
9
12
null
null
ducis/haAni
hs/common/Graphics/Rendering/OpenGL/GL/Points.hs
gpl-2.0
-------------------------------------------------------------------------------- -- | 'pointSize' contains the rasterized diameter of both aliased and -- antialiased points. The initial value is 1. Using a point size other than 1 -- has different effects, depending on whether point antialiasing is enabled -- (see 'poi...
4,505
pointSize :: StateVar GLfloat pointSize = makeStateVar (getFloat1 id GetPointSize) glPointSize
94
pointSize = makeStateVar (getFloat1 id GetPointSize) glPointSize
64
true
true
0
7
725
110
96
14
null
null
fmapfmapfmap/amazonka
gen/src/Gen/Tree.hs
mpl-2.0
fold :: MonadError Error m => (Path -> m ()) -- ^ Directories -> (Path -> a -> m b) -- ^ Files -> AnchoredDirTree a -> m (AnchoredDirTree b) fold g f (p :/ t) = (p :/) <$> go (decodeString p) t where go x = \case Failed n e -> failure shown e >> return (Failed n e) File ...
545
fold :: MonadError Error m => (Path -> m ()) -- ^ Directories -> (Path -> a -> m b) -- ^ Files -> AnchoredDirTree a -> m (AnchoredDirTree b) fold g f (p :/ t) = (p :/) <$> go (decodeString p) t where go x = \case Failed n e -> failure shown e >> return (Failed n e) File ...
545
fold g f (p :/ t) = (p :/) <$> go (decodeString p) t where go x = \case Failed n e -> failure shown e >> return (Failed n e) File n a -> File n <$> f (x </> decodeString n) a Dir n cs -> g d >> Dir n <$> mapM (go d) cs where d = x </> decodeString n -- If Noth...
380
false
true
0
12
190
232
112
120
null
null
unsw-comp4181/accelerate-c-stub
Data/Array/Accelerate/C/Exp.hs
bsd-3-clause
scalarToC (NonNumScalarType ty) = nonNumScalarToC ty
52
scalarToC (NonNumScalarType ty) = nonNumScalarToC ty
52
scalarToC (NonNumScalarType ty) = nonNumScalarToC ty
52
false
false
0
6
5
19
8
11
null
null
hansbugge/cubicaltt
TypeChecker.hs
mit
checks _ _ = throwError "checks"
50
checks _ _ = throwError "checks"
50
checks _ _ = throwError "checks"
50
false
false
0
5
23
14
6
8
null
null
grandpascorpion/canon
Math/NumberTheory/Canon.hs
gpl-3.0
-- | QuotRem Function cQuotRem :: Canon -> Canon -> CycloMap -> ((Canon, Canon), CycloMap) cQuotRem x y m | cHyperExprAny x || cHyperExprAny y = ((hQ, c0), mR) -- ToDo: Handle non-zero modulus, say if x is a sum. | cIntegral x && cIntegral y = ((gcrToC q', md'), m'') | otherwise ...
1,060
cQuotRem :: Canon -> Canon -> CycloMap -> ((Canon, Canon), CycloMap) cQuotRem x y m | cHyperExprAny x || cHyperExprAny y = ((hQ, c0), mR) -- ToDo: Handle non-zero modulus, say if x is a sum. | cIntegral x && cIntegral y = ((gcrToC q', md'), m'') | otherwise ...
1,038
cQuotRem x y m | cHyperExprAny x || cHyperExprAny y = ((hQ, c0), mR) -- ToDo: Handle non-zero modulus, say if x is a sum. | cIntegral x && cIntegral y = ((gcrToC q', md'), m'') | otherwise = error "cQuotRem: Must both parameters must be integral." ...
969
true
true
0
11
517
262
138
124
null
null
Fuuzetsu/haddock
haddock-api/src/Haddock/GhcUtils.hs
bsd-2-clause
isClassD :: HsDecl a -> Bool isClassD (TyClD d) = isClassDecl d
63
isClassD :: HsDecl a -> Bool isClassD (TyClD d) = isClassDecl d
63
isClassD (TyClD d) = isClassDecl d
34
false
true
0
7
11
30
14
16
null
null
kawu/crf-chain1
src/Data/CRF/Chain1/Dataset/Internal.hs
bsd-2-clause
-- | Y constructor. mkY :: [(Lb, Double)] -> Y mkY = Y . U.fromList
67
mkY :: [(Lb, Double)] -> Y mkY = Y . U.fromList
47
mkY = Y . U.fromList
20
true
true
0
8
14
38
19
19
null
null
gcampax/ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
seqExpr (Case e b t as) = seqExpr e `seq` seqBndr b `seq` seqType t `seq` seqAlts as
84
seqExpr (Case e b t as) = seqExpr e `seq` seqBndr b `seq` seqType t `seq` seqAlts as
84
seqExpr (Case e b t as) = seqExpr e `seq` seqBndr b `seq` seqType t `seq` seqAlts as
84
false
false
0
8
17
51
26
25
null
null
frozencemetery/hdata
HData/Heap/Binary.hs
gpl-3.0
-- turns a heap into a reverse-sorted list -- see note at toList -- will be faster than toList because it does not reverse toRlist :: (Ord a) => Heap a -> [a] toRlist E = []
173
toRlist :: (Ord a) => Heap a -> [a] toRlist E = []
50
toRlist E = []
14
true
true
0
7
36
38
21
17
null
null
wavewave/madgraph-auto-model
src/HEP/Automation/MadGraph/Process.hs
bsd-2-clause
preDefProcess TTBarSemiTau0or1J = [verbatim|generate P P > t t~ QED=99, (t > b w+, w+ > J J) , (t~ > b~ w-, w- > ta- vt~) QED=99 @1 add process P P > t t~ QED=99, ( t > b w+, w+ > ta+ vt ), ( t~ > b~ w-, w- > J J ) QED=99 @2 add process P P > t t~ J QED=99, (t > b w+, w+ > J J) , (t~ > b~ w-, w- > ta- vt~) QED=99 @3 ...
419
preDefProcess TTBarSemiTau0or1J = [verbatim|generate P P > t t~ QED=99, (t > b w+, w+ > J J) , (t~ > b~ w-, w- > ta- vt~) QED=99 @1 add process P P > t t~ QED=99, ( t > b w+, w+ > ta+ vt ), ( t~ > b~ w-, w- > J J ) QED=99 @2 add process P P > t t~ J QED=99, (t > b w+, w+ > J J) , (t~ > b~ w-, w- > ta- vt~) QED=99 @3 ...
419
preDefProcess TTBarSemiTau0or1J = [verbatim|generate P P > t t~ QED=99, (t > b w+, w+ > J J) , (t~ > b~ w-, w- > ta- vt~) QED=99 @1 add process P P > t t~ QED=99, ( t > b w+, w+ > ta+ vt ), ( t~ > b~ w-, w- > J J ) QED=99 @2 add process P P > t t~ J QED=99, (t > b w+, w+ > J J) , (t~ > b~ w-, w- > ta- vt~) QED=99 @3 ...
419
false
false
0
4
122
14
8
6
null
null