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
facebook/Haxl
Haxl/Core/Exception.hs
bsd-3-clause
internalErrorFromException :: (Exception e) => SomeException -> Maybe e internalErrorFromException x = do InternalError a <- fromException x cast a -- | For errors in Haxl client code.
191
internalErrorFromException :: (Exception e) => SomeException -> Maybe e internalErrorFromException x = do InternalError a <- fromException x cast a -- | For errors in Haxl client code.
191
internalErrorFromException x = do InternalError a <- fromException x cast a -- | For errors in Haxl client code.
117
false
true
0
9
34
55
24
31
null
null
Boreeas/advent-of-code
Day2/day2.hs
unlicense
problem_ribbon :: String -> Int problem_ribbon = ribbon . split_in
66
problem_ribbon :: String -> Int problem_ribbon = ribbon . split_in
66
problem_ribbon = ribbon . split_in
34
false
true
0
7
9
26
11
15
null
null
mapinguari/SC_HS_Proxy
src/Proxy/Query/Unit.hs
mit
groundDamage ProtossPhotonCannon = 20
37
groundDamage ProtossPhotonCannon = 20
37
groundDamage ProtossPhotonCannon = 20
37
false
false
0
5
3
9
4
5
null
null
ghorn/monadic-modeling-test
RocketDae.hs
bsd-3-clause
go :: IO () go = daeSummary rocketDae
37
go :: IO () go = daeSummary rocketDae
37
go = daeSummary rocketDae
25
false
true
0
7
7
25
10
15
null
null
romanb/amazonka
amazonka-s3/gen/Network/AWS/S3/UploadPartCopy.hs
mpl-2.0
-- | Copies the object if it hasn't been modified since the specified time. upcCopySourceIfUnmodifiedSince :: Lens' UploadPartCopy (Maybe UTCTime) upcCopySourceIfUnmodifiedSince = lens _upcCopySourceIfUnmodifiedSince (\s a -> s { _upcCopySourceIfUnmodifiedSince = a }) . mapping _Time
308
upcCopySourceIfUnmodifiedSince :: Lens' UploadPartCopy (Maybe UTCTime) upcCopySourceIfUnmodifiedSince = lens _upcCopySourceIfUnmodifiedSince (\s a -> s { _upcCopySourceIfUnmodifiedSince = a }) . mapping _Time
232
upcCopySourceIfUnmodifiedSince = lens _upcCopySourceIfUnmodifiedSince (\s a -> s { _upcCopySourceIfUnmodifiedSince = a }) . mapping _Time
161
true
true
1
8
59
55
28
27
null
null
bixuanzju/fcore
lib/typeCheck/TypeCheck.hs
bsd-2-clause
srcLitType (Bool _) = JClass "java.lang.Boolean"
50
srcLitType (Bool _) = JClass "java.lang.Boolean"
50
srcLitType (Bool _) = JClass "java.lang.Boolean"
50
false
false
0
7
7
18
8
10
null
null
rjwright/js-typeomatic
ParseJS.hs
apache-2.0
akeJSASTExpression (NS (JSExpressionParen expr) srcSpan) = EWSS (ParenExpression (jsnToListExp expr)) srcSpan
142
makeJSASTExpression (NS (JSExpressionParen expr) srcSpan) = EWSS (ParenExpression (jsnToListExp expr)) srcSpan
142
makeJSASTExpression (NS (JSExpressionParen expr) srcSpan) = EWSS (ParenExpression (jsnToListExp expr)) srcSpan
142
false
false
0
9
43
40
19
21
null
null
nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles
Algebraic_DataTypes/VigenereCipher.hs
gpl-3.0
apply :: CryptFunction -> Key -> String -> String apply _ [] _ = []
67
apply :: CryptFunction -> Key -> String -> String apply _ [] _ = []
67
apply _ [] _ = []
17
false
true
0
10
14
40
18
22
null
null
pparkkin/eta
compiler/ETA/CodeGen/ArgRep.hs
bsd-3-clause
slowCallPattern (N: _) = (1, [jint])
51
slowCallPattern (N: _) = (1, [jint])
51
slowCallPattern (N: _) = (1, [jint])
51
false
false
0
6
20
26
14
12
null
null
uduki/hsQt
Qtc/Enums/Gui/QGraphicsScene.hs
bsd-2-clause
ieSceneLayer :: Int -> SceneLayer ieSceneLayer x = QEnum (CSceneLayer x)
72
ieSceneLayer :: Int -> SceneLayer ieSceneLayer x = QEnum (CSceneLayer x)
72
ieSceneLayer x = QEnum (CSceneLayer x)
38
false
true
0
7
10
27
13
14
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_HJA_COMMENTLINE :: Int wxSTC_HJA_COMMENTLINE = 58
55
wxSTC_HJA_COMMENTLINE :: Int wxSTC_HJA_COMMENTLINE = 58
55
wxSTC_HJA_COMMENTLINE = 58
26
false
true
0
4
5
11
6
5
null
null
eb-gh-cr/XMonadContrib1
XMonad/Actions/WorkspaceNames.hs
bsd-3-clause
swapNames :: WorkspaceId -> WorkspaceId -> X () swapNames w1 w2 = do WorkspaceNames m <- XS.get let getname w = fromMaybe "" $ M.lookup w m set w name m' = if null name then M.delete w m' else M.insert w name m' XS.put $ WorkspaceNames $ set w1 (getname w2) $ set w2 (getname w1) $ m
303
swapNames :: WorkspaceId -> WorkspaceId -> X () swapNames w1 w2 = do WorkspaceNames m <- XS.get let getname w = fromMaybe "" $ M.lookup w m set w name m' = if null name then M.delete w m' else M.insert w name m' XS.put $ WorkspaceNames $ set w1 (getname w2) $ set w2 (getname w1) $ m
303
swapNames w1 w2 = do WorkspaceNames m <- XS.get let getname w = fromMaybe "" $ M.lookup w m set w name m' = if null name then M.delete w m' else M.insert w name m' XS.put $ WorkspaceNames $ set w1 (getname w2) $ set w2 (getname w1) $ m
255
false
true
0
12
78
149
69
80
null
null
kyagrd/micronax
src/Infer.hs
bsd-2-clause
tiAlt :: KCtx -> Ctx -> Maybe IxMap -> (TmName,Bind [TmName] Tm) -> TI Ty tiAlt kctx ctx mphi (x,b) = do xTy <- case lookup x ctx of Nothing -> throwError . strMsg $ show x ++ " undefined" Just xt -> freshTyInst xt u <- trace ("++++++++"++show x++"++++++++++++++\n"++show mphi++"\n xTy = "++show xTy) getSubstTy let xty = uapply u xTy let xtyUnfold = unfoldTArr xty let (xtyArgs, xtyRet) = (init xtyUnfold, last xtyUnfold) (u,is,bodyTy,mt) <- case trace (show(xty,xtyRet,mphi)) mphi of Nothing -> return (u,[],undefined,Nothing) Just phi -> do (is, bodyTy) <- unbind phi ps <- sequence $ [(,) x <$> (KVar <$> fresh "k_AltR_") | x<-is] modifyFreshBinds (ps++) t <- TVar <$> freshTyName' "t" unifyTy (foldl TApp t $ map TVar is) xtyRet u <- getSubstTy let bodyTy' = uapply u bodyTy return (u,is,bodyTy',Just t) let xty_ = uapply u xty let xty = case trace ("xty_ = "++show xty_) () of _ -> xty_ let xtyUnfold = unfoldTArr xty let (xtyArgs, xtyRet) = (init xtyUnfold, last xtyUnfold) let xTyVars = nub $ fv xty \\ (fv kctx ++ fv ctx) let eTyVars = xTyVars \\ fv xtyRet :: [TyName] () <- trace ("evars : "++show eTyVars) $ return () let fvTyPhi = case mt of Nothing -> [] Just _ -> nub $ (fv bodyTy \\ fv is) \\ fv kctx -- substitute existential vars as bogus TCon or Con to avoid unification -- TODO generalized existentials??? let xty' = foldr (.) id [LN.subst nm (TCon nm) | nm <- eTyVars] xty () <- trace ("TODO " ++ show(ty2Type xty')) $ return () let bodyTy' = foldr (.) id [LN.subst nm (TCon nm) | nm <- eTyVars] bodyTy let xtyArgs' = trace (show (xty',init (unfoldTArr xty'))) $ init (unfoldTArr xty') let kctx' = kctx -- -- adding existental TCon or Con to context seems unnecessary -- kctx' <- (++) <$> sequence [(,) nm <$> (Var <$> fresh "k") | nm <- eTyVars] -- <*> return kctx -- ictx' <- (++) <$> sequence [(,) nm <$> (monoTy . Var <$> fresh "c") -- | nm <- eTmVars] -- <*> return ictx (ns,t) <- unbind b let ctx' = trace (show ns ++", "++ show xtyArgs') $ zip ns (map monoTy xtyArgs') ++ ctx () <- trace "zzaaa" $ return () domty <- ti kctx' ctx' (foldl1 App (Con x : map Var ns)) `catchErrorThrowWithMsg` (++ "\n\t" ++ "when checking type of " ++ show (foldl1 App (Con x : map Var ns))) rngty <- ti kctx' ctx' t `catchErrorThrowWithMsg` (++ "\n\t" ++ "when checking type of " ++ show t) () <- trace ("zzaaa2\t"++show xtyRet++" =?= "++show domty) $ return () unifyTy xtyRet domty () <- trace "zzaaa3" $ return () case mt of Nothing -> return () Just _ -> do () <- trace ("zzaaa4\t"++ show bodyTy'++" =?= "++show rngty) $ return () unifyTy bodyTy' rngty u <- getSubstTy () <- trace "zzaaa5" $ return () let ty = uapply u (TArr domty rngty) let TArr domty rngty = ty let eRetVars = intersect eTyVars (fv ty) unless (trace (show(ty,eRetVars)) $ null eRetVars) (throwError . strMsg $ "rigid variables "++ show eRetVars ++ " in the return type "++ show rngty ++ " of "++ show t) u <- getSubstTy unless (null $ filter (\(x,t)-> elem x fvTyPhi && case t of {TVar _ -> False; _ -> True}) u) (throwError . strMsg $ "polymorphic vars in phi cannot be specialized " ++"\n\t" ++show(filter (\(x,t)-> elem x fvTyPhi && case t of {TVar _ -> False; _ -> True}) u)) case mphi of Nothing -> trace ("return type: "++show ty ++ "\n"++ show(eTyVars::[TyName] ,fv xtyRet::[TyName] ,(eTyVars)\\fv xtyRet::[TyName]) ++ "\n\t"++ show(eTyVars)++" of "++show xtyRet ++ show(fv xtyRet::[TyName])++" in "++show (x,b)) (return ty) Just phi -> do let Just t = trace ("return type: "++show ty ++ "\n"++ show(eTyVars::[TyName] ,fv xtyRet::[TyName] ,(eTyVars)\\fv xtyRet::[TyName]) ++ "\n\t"++ show(eTyVars)++" of "++show xtyRet ++ show(fv xtyRet::[TyName])++" in "++show (x,b)) mt let t' = uapply u t (is,bodyTy) <- unbind phi let bodyTy' = uapply u bodyTy return (foldl TApp t' (map TVar is) `TArr` bodyTy') -- catching error from do ... `catchErrorThrowWithMsg` (++ "\n\t" ++ "when checking case " ++ show x)
5,146
tiAlt :: KCtx -> Ctx -> Maybe IxMap -> (TmName,Bind [TmName] Tm) -> TI Ty tiAlt kctx ctx mphi (x,b) = do xTy <- case lookup x ctx of Nothing -> throwError . strMsg $ show x ++ " undefined" Just xt -> freshTyInst xt u <- trace ("++++++++"++show x++"++++++++++++++\n"++show mphi++"\n xTy = "++show xTy) getSubstTy let xty = uapply u xTy let xtyUnfold = unfoldTArr xty let (xtyArgs, xtyRet) = (init xtyUnfold, last xtyUnfold) (u,is,bodyTy,mt) <- case trace (show(xty,xtyRet,mphi)) mphi of Nothing -> return (u,[],undefined,Nothing) Just phi -> do (is, bodyTy) <- unbind phi ps <- sequence $ [(,) x <$> (KVar <$> fresh "k_AltR_") | x<-is] modifyFreshBinds (ps++) t <- TVar <$> freshTyName' "t" unifyTy (foldl TApp t $ map TVar is) xtyRet u <- getSubstTy let bodyTy' = uapply u bodyTy return (u,is,bodyTy',Just t) let xty_ = uapply u xty let xty = case trace ("xty_ = "++show xty_) () of _ -> xty_ let xtyUnfold = unfoldTArr xty let (xtyArgs, xtyRet) = (init xtyUnfold, last xtyUnfold) let xTyVars = nub $ fv xty \\ (fv kctx ++ fv ctx) let eTyVars = xTyVars \\ fv xtyRet :: [TyName] () <- trace ("evars : "++show eTyVars) $ return () let fvTyPhi = case mt of Nothing -> [] Just _ -> nub $ (fv bodyTy \\ fv is) \\ fv kctx -- substitute existential vars as bogus TCon or Con to avoid unification -- TODO generalized existentials??? let xty' = foldr (.) id [LN.subst nm (TCon nm) | nm <- eTyVars] xty () <- trace ("TODO " ++ show(ty2Type xty')) $ return () let bodyTy' = foldr (.) id [LN.subst nm (TCon nm) | nm <- eTyVars] bodyTy let xtyArgs' = trace (show (xty',init (unfoldTArr xty'))) $ init (unfoldTArr xty') let kctx' = kctx -- -- adding existental TCon or Con to context seems unnecessary -- kctx' <- (++) <$> sequence [(,) nm <$> (Var <$> fresh "k") | nm <- eTyVars] -- <*> return kctx -- ictx' <- (++) <$> sequence [(,) nm <$> (monoTy . Var <$> fresh "c") -- | nm <- eTmVars] -- <*> return ictx (ns,t) <- unbind b let ctx' = trace (show ns ++", "++ show xtyArgs') $ zip ns (map monoTy xtyArgs') ++ ctx () <- trace "zzaaa" $ return () domty <- ti kctx' ctx' (foldl1 App (Con x : map Var ns)) `catchErrorThrowWithMsg` (++ "\n\t" ++ "when checking type of " ++ show (foldl1 App (Con x : map Var ns))) rngty <- ti kctx' ctx' t `catchErrorThrowWithMsg` (++ "\n\t" ++ "when checking type of " ++ show t) () <- trace ("zzaaa2\t"++show xtyRet++" =?= "++show domty) $ return () unifyTy xtyRet domty () <- trace "zzaaa3" $ return () case mt of Nothing -> return () Just _ -> do () <- trace ("zzaaa4\t"++ show bodyTy'++" =?= "++show rngty) $ return () unifyTy bodyTy' rngty u <- getSubstTy () <- trace "zzaaa5" $ return () let ty = uapply u (TArr domty rngty) let TArr domty rngty = ty let eRetVars = intersect eTyVars (fv ty) unless (trace (show(ty,eRetVars)) $ null eRetVars) (throwError . strMsg $ "rigid variables "++ show eRetVars ++ " in the return type "++ show rngty ++ " of "++ show t) u <- getSubstTy unless (null $ filter (\(x,t)-> elem x fvTyPhi && case t of {TVar _ -> False; _ -> True}) u) (throwError . strMsg $ "polymorphic vars in phi cannot be specialized " ++"\n\t" ++show(filter (\(x,t)-> elem x fvTyPhi && case t of {TVar _ -> False; _ -> True}) u)) case mphi of Nothing -> trace ("return type: "++show ty ++ "\n"++ show(eTyVars::[TyName] ,fv xtyRet::[TyName] ,(eTyVars)\\fv xtyRet::[TyName]) ++ "\n\t"++ show(eTyVars)++" of "++show xtyRet ++ show(fv xtyRet::[TyName])++" in "++show (x,b)) (return ty) Just phi -> do let Just t = trace ("return type: "++show ty ++ "\n"++ show(eTyVars::[TyName] ,fv xtyRet::[TyName] ,(eTyVars)\\fv xtyRet::[TyName]) ++ "\n\t"++ show(eTyVars)++" of "++show xtyRet ++ show(fv xtyRet::[TyName])++" in "++show (x,b)) mt let t' = uapply u t (is,bodyTy) <- unbind phi let bodyTy' = uapply u bodyTy return (foldl TApp t' (map TVar is) `TArr` bodyTy') -- catching error from do ... `catchErrorThrowWithMsg` (++ "\n\t" ++ "when checking case " ++ show x)
5,146
tiAlt kctx ctx mphi (x,b) = do xTy <- case lookup x ctx of Nothing -> throwError . strMsg $ show x ++ " undefined" Just xt -> freshTyInst xt u <- trace ("++++++++"++show x++"++++++++++++++\n"++show mphi++"\n xTy = "++show xTy) getSubstTy let xty = uapply u xTy let xtyUnfold = unfoldTArr xty let (xtyArgs, xtyRet) = (init xtyUnfold, last xtyUnfold) (u,is,bodyTy,mt) <- case trace (show(xty,xtyRet,mphi)) mphi of Nothing -> return (u,[],undefined,Nothing) Just phi -> do (is, bodyTy) <- unbind phi ps <- sequence $ [(,) x <$> (KVar <$> fresh "k_AltR_") | x<-is] modifyFreshBinds (ps++) t <- TVar <$> freshTyName' "t" unifyTy (foldl TApp t $ map TVar is) xtyRet u <- getSubstTy let bodyTy' = uapply u bodyTy return (u,is,bodyTy',Just t) let xty_ = uapply u xty let xty = case trace ("xty_ = "++show xty_) () of _ -> xty_ let xtyUnfold = unfoldTArr xty let (xtyArgs, xtyRet) = (init xtyUnfold, last xtyUnfold) let xTyVars = nub $ fv xty \\ (fv kctx ++ fv ctx) let eTyVars = xTyVars \\ fv xtyRet :: [TyName] () <- trace ("evars : "++show eTyVars) $ return () let fvTyPhi = case mt of Nothing -> [] Just _ -> nub $ (fv bodyTy \\ fv is) \\ fv kctx -- substitute existential vars as bogus TCon or Con to avoid unification -- TODO generalized existentials??? let xty' = foldr (.) id [LN.subst nm (TCon nm) | nm <- eTyVars] xty () <- trace ("TODO " ++ show(ty2Type xty')) $ return () let bodyTy' = foldr (.) id [LN.subst nm (TCon nm) | nm <- eTyVars] bodyTy let xtyArgs' = trace (show (xty',init (unfoldTArr xty'))) $ init (unfoldTArr xty') let kctx' = kctx -- -- adding existental TCon or Con to context seems unnecessary -- kctx' <- (++) <$> sequence [(,) nm <$> (Var <$> fresh "k") | nm <- eTyVars] -- <*> return kctx -- ictx' <- (++) <$> sequence [(,) nm <$> (monoTy . Var <$> fresh "c") -- | nm <- eTmVars] -- <*> return ictx (ns,t) <- unbind b let ctx' = trace (show ns ++", "++ show xtyArgs') $ zip ns (map monoTy xtyArgs') ++ ctx () <- trace "zzaaa" $ return () domty <- ti kctx' ctx' (foldl1 App (Con x : map Var ns)) `catchErrorThrowWithMsg` (++ "\n\t" ++ "when checking type of " ++ show (foldl1 App (Con x : map Var ns))) rngty <- ti kctx' ctx' t `catchErrorThrowWithMsg` (++ "\n\t" ++ "when checking type of " ++ show t) () <- trace ("zzaaa2\t"++show xtyRet++" =?= "++show domty) $ return () unifyTy xtyRet domty () <- trace "zzaaa3" $ return () case mt of Nothing -> return () Just _ -> do () <- trace ("zzaaa4\t"++ show bodyTy'++" =?= "++show rngty) $ return () unifyTy bodyTy' rngty u <- getSubstTy () <- trace "zzaaa5" $ return () let ty = uapply u (TArr domty rngty) let TArr domty rngty = ty let eRetVars = intersect eTyVars (fv ty) unless (trace (show(ty,eRetVars)) $ null eRetVars) (throwError . strMsg $ "rigid variables "++ show eRetVars ++ " in the return type "++ show rngty ++ " of "++ show t) u <- getSubstTy unless (null $ filter (\(x,t)-> elem x fvTyPhi && case t of {TVar _ -> False; _ -> True}) u) (throwError . strMsg $ "polymorphic vars in phi cannot be specialized " ++"\n\t" ++show(filter (\(x,t)-> elem x fvTyPhi && case t of {TVar _ -> False; _ -> True}) u)) case mphi of Nothing -> trace ("return type: "++show ty ++ "\n"++ show(eTyVars::[TyName] ,fv xtyRet::[TyName] ,(eTyVars)\\fv xtyRet::[TyName]) ++ "\n\t"++ show(eTyVars)++" of "++show xtyRet ++ show(fv xtyRet::[TyName])++" in "++show (x,b)) (return ty) Just phi -> do let Just t = trace ("return type: "++show ty ++ "\n"++ show(eTyVars::[TyName] ,fv xtyRet::[TyName] ,(eTyVars)\\fv xtyRet::[TyName]) ++ "\n\t"++ show(eTyVars)++" of "++show xtyRet ++ show(fv xtyRet::[TyName])++" in "++show (x,b)) mt let t' = uapply u t (is,bodyTy) <- unbind phi let bodyTy' = uapply u bodyTy return (foldl TApp t' (map TVar is) `TArr` bodyTy') -- catching error from do ... `catchErrorThrowWithMsg` (++ "\n\t" ++ "when checking case " ++ show x)
5,072
false
true
23
27
1,955
1,799
911
888
null
null
jwiegley/ghc-release
libraries/containers/Data/Sequence.hs
gpl-3.0
adjustTree f i (Single x) = Single (f i x)
42
adjustTree f i (Single x) = Single (f i x)
42
adjustTree f i (Single x) = Single (f i x)
42
false
false
0
7
9
30
14
16
null
null
brownplt/strobe-old
src/BrownPLT/TypedJS/TypeTheory.hs
bsd-2-clause
lcType :: Type -> Type lcType ty = case ty of TAny -> TAny TApp c args -> TApp c (map lcType args) TArguments at -> TArguments (lcArgType at) TArrow this arg r ->TArrow (lcType this) (lcArgType arg) (lcType r) TUnion t1 t2 -> TUnion (lcType t1) (lcType t2) TIntersect t1 t2 -> TIntersect (lcType t1) (lcType t2) TObject brand tyArgs fields -> TObject brand (map lcType tyArgs) (map lcField fields) where lcField (x, ro, t) = (x, ro, lcType t) TId x -> TId x TIx x -> TIx x TExists u -> TExists (lcType u) TForall u -> TForall (lcType u) TConstr brand argTys initTy objTy -> TConstr brand (map lcType argTys) (lcType initTy) (lcType objTy) TNamedForall x u -> TForall (lcType (closeType x u)) -- |Canonizes types such as int U int to int. Orders fields lexicographically.
812
lcType :: Type -> Type lcType ty = case ty of TAny -> TAny TApp c args -> TApp c (map lcType args) TArguments at -> TArguments (lcArgType at) TArrow this arg r ->TArrow (lcType this) (lcArgType arg) (lcType r) TUnion t1 t2 -> TUnion (lcType t1) (lcType t2) TIntersect t1 t2 -> TIntersect (lcType t1) (lcType t2) TObject brand tyArgs fields -> TObject brand (map lcType tyArgs) (map lcField fields) where lcField (x, ro, t) = (x, ro, lcType t) TId x -> TId x TIx x -> TIx x TExists u -> TExists (lcType u) TForall u -> TForall (lcType u) TConstr brand argTys initTy objTy -> TConstr brand (map lcType argTys) (lcType initTy) (lcType objTy) TNamedForall x u -> TForall (lcType (closeType x u)) -- |Canonizes types such as int U int to int. Orders fields lexicographically.
812
lcType ty = case ty of TAny -> TAny TApp c args -> TApp c (map lcType args) TArguments at -> TArguments (lcArgType at) TArrow this arg r ->TArrow (lcType this) (lcArgType arg) (lcType r) TUnion t1 t2 -> TUnion (lcType t1) (lcType t2) TIntersect t1 t2 -> TIntersect (lcType t1) (lcType t2) TObject brand tyArgs fields -> TObject brand (map lcType tyArgs) (map lcField fields) where lcField (x, ro, t) = (x, ro, lcType t) TId x -> TId x TIx x -> TIx x TExists u -> TExists (lcType u) TForall u -> TForall (lcType u) TConstr brand argTys initTy objTy -> TConstr brand (map lcType argTys) (lcType initTy) (lcType objTy) TNamedForall x u -> TForall (lcType (closeType x u)) -- |Canonizes types such as int U int to int. Orders fields lexicographically.
789
false
true
9
8
181
348
173
175
null
null
DanielJanzon/CryptoLab
ElGamal.hs
bsd-3-clause
decrypt (CG.Group n) (c1, c2) priv = let pow = CG.pow (CG.Group n) op = CG.op (CG.Group n) inverse = CG.inverse (CG.Group n) in op c2 (pow (inverse c1) priv)
183
decrypt (CG.Group n) (c1, c2) priv = let pow = CG.pow (CG.Group n) op = CG.op (CG.Group n) inverse = CG.inverse (CG.Group n) in op c2 (pow (inverse c1) priv)
183
decrypt (CG.Group n) (c1, c2) priv = let pow = CG.pow (CG.Group n) op = CG.op (CG.Group n) inverse = CG.inverse (CG.Group n) in op c2 (pow (inverse c1) priv)
183
false
false
1
12
55
113
52
61
null
null
kik/ToyPr
src/Parser/PreTypedTerm.hs
apache-2.0
toKernelTerm e (PTAbs (PTBinder [] _:bs) body) = toKernelTerm e (PTAbs bs body)
81
toKernelTerm e (PTAbs (PTBinder [] _:bs) body) = toKernelTerm e (PTAbs bs body)
81
toKernelTerm e (PTAbs (PTBinder [] _:bs) body) = toKernelTerm e (PTAbs bs body)
81
false
false
0
11
14
46
22
24
null
null
audreyt/stringtable-atom
src/StringTable/AtomMap.hs
bsd-3-clause
insertLookupWithKey :: (Key -> a -> a -> a) -> Key -> a -> AtomMap a -> (Maybe a, AtomMap a) insertLookupWithKey x y z w = (\(x, y) -> (x, MkAtomMap y)) (IM.insertLookupWithKey ((. unsafeIntToAtom) x) (fromAtom y) ( z) (fromAtomMap w))
235
insertLookupWithKey :: (Key -> a -> a -> a) -> Key -> a -> AtomMap a -> (Maybe a, AtomMap a) insertLookupWithKey x y z w = (\(x, y) -> (x, MkAtomMap y)) (IM.insertLookupWithKey ((. unsafeIntToAtom) x) (fromAtom y) ( z) (fromAtomMap w))
235
insertLookupWithKey x y z w = (\(x, y) -> (x, MkAtomMap y)) (IM.insertLookupWithKey ((. unsafeIntToAtom) x) (fromAtom y) ( z) (fromAtomMap w))
142
false
true
0
10
42
131
69
62
null
null
ezyang/ghc
compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
bsd-3-clause
-- | Add two spill cost infos. plusSpillCostInfo :: SpillCostInfo -> SpillCostInfo -> SpillCostInfo plusSpillCostInfo sc1 sc2 = plusUFM_C plusSpillCostRecord sc1 sc2
173
plusSpillCostInfo :: SpillCostInfo -> SpillCostInfo -> SpillCostInfo plusSpillCostInfo sc1 sc2 = plusUFM_C plusSpillCostRecord sc1 sc2
142
plusSpillCostInfo sc1 sc2 = plusUFM_C plusSpillCostRecord sc1 sc2
73
true
true
0
6
29
32
16
16
null
null
akegalj/snowdrift
Foundation.hs
agpl-3.0
getSiteProject :: Handler (Entity Project) getSiteProject = fromMaybe (error "No project has been defined as the owner of this website.") <$> (getSiteProjectHandle >>= runYDB . getBy . UniqueProjectHandle)
209
getSiteProject :: Handler (Entity Project) getSiteProject = fromMaybe (error "No project has been defined as the owner of this website.") <$> (getSiteProjectHandle >>= runYDB . getBy . UniqueProjectHandle)
209
getSiteProject = fromMaybe (error "No project has been defined as the owner of this website.") <$> (getSiteProjectHandle >>= runYDB . getBy . UniqueProjectHandle)
166
false
true
0
9
31
48
24
24
null
null
bixuanzju/fcore
lib/PrettyUtils.hs
bsd-2-clause
bar = text "|"
20
bar = text "|"
20
bar = text "|"
20
false
false
0
5
9
9
4
5
null
null
polachok/hs-nginx
src/Nginx/Http/Ssl.hs
mit
sslDirective :: Parser (SslDirective a) sslDirective = sslCertificateKey <|> sslCertificate
91
sslDirective :: Parser (SslDirective a) sslDirective = sslCertificateKey <|> sslCertificate
91
sslDirective = sslCertificateKey <|> sslCertificate
51
false
true
1
7
9
28
12
16
null
null
candidtim/euler
test/Problem12Tests.hs
bsd-3-clause
testHighlyDivisibleTriangularNumber :: Test testHighlyDivisibleTriangularNumber = TestCase $ do assertEqual "triangular number divisble by 5+ divisors" 28 (divisibleTriangularNumber 5)
186
testHighlyDivisibleTriangularNumber :: Test testHighlyDivisibleTriangularNumber = TestCase $ do assertEqual "triangular number divisble by 5+ divisors" 28 (divisibleTriangularNumber 5)
186
testHighlyDivisibleTriangularNumber = TestCase $ do assertEqual "triangular number divisble by 5+ divisors" 28 (divisibleTriangularNumber 5)
142
false
true
0
10
19
31
15
16
null
null
FranklinChen/IHaskell
ipython-kernel/src/IHaskell/IPython/EasyKernel.hs
mit
-- the console | Attempt to install the IPython profile from the .tar file indicated by the -- 'profileSource' field of the configuration, if it is not already installed. installProfile :: MonadIO m => KernelConfig m output result -> m () installProfile config = do installed <- isInstalled unless installed $ do profSrc <- liftIO $ profileSource config case profSrc of Nothing -> liftIO (putStrLn "No IPython profile is installed or specified") Just tar -> do profExists <- liftIO $ doesFileExist tar profTgt <- profDir if profExists then do liftIO $ createDirectoryIfMissing True profTgt liftIO $ Tar.extract profTgt tar else liftIO . putStrLn $ "The supplied profile source '" ++ tar ++ "' does not exist" where profDir = do home <- liftIO getHomeDirectory return $ home </> ".ipython" </> ("profile_" ++ languageName config) isInstalled = do prof <- profDir dirThere <- liftIO $ doesDirectoryExist prof isProf <- liftIO . doesFileExist $ prof </> "ipython_config.py" return $ dirThere && isProf
1,149
installProfile :: MonadIO m => KernelConfig m output result -> m () installProfile config = do installed <- isInstalled unless installed $ do profSrc <- liftIO $ profileSource config case profSrc of Nothing -> liftIO (putStrLn "No IPython profile is installed or specified") Just tar -> do profExists <- liftIO $ doesFileExist tar profTgt <- profDir if profExists then do liftIO $ createDirectoryIfMissing True profTgt liftIO $ Tar.extract profTgt tar else liftIO . putStrLn $ "The supplied profile source '" ++ tar ++ "' does not exist" where profDir = do home <- liftIO getHomeDirectory return $ home </> ".ipython" </> ("profile_" ++ languageName config) isInstalled = do prof <- profDir dirThere <- liftIO $ doesDirectoryExist prof isProf <- liftIO . doesFileExist $ prof </> "ipython_config.py" return $ dirThere && isProf
978
installProfile config = do installed <- isInstalled unless installed $ do profSrc <- liftIO $ profileSource config case profSrc of Nothing -> liftIO (putStrLn "No IPython profile is installed or specified") Just tar -> do profExists <- liftIO $ doesFileExist tar profTgt <- profDir if profExists then do liftIO $ createDirectoryIfMissing True profTgt liftIO $ Tar.extract profTgt tar else liftIO . putStrLn $ "The supplied profile source '" ++ tar ++ "' does not exist" where profDir = do home <- liftIO getHomeDirectory return $ home </> ".ipython" </> ("profile_" ++ languageName config) isInstalled = do prof <- profDir dirThere <- liftIO $ doesDirectoryExist prof isProf <- liftIO . doesFileExist $ prof </> "ipython_config.py" return $ dirThere && isProf
910
true
true
2
20
310
285
127
158
null
null
nevrenato/Hets_Fork
CspCASLProver/TransProcesses.hs
gpl-2.0
-- | Translate a fully qualified CASL formula into an Isabelle Term using the -- exact translation as is done in the comorphism composition -- CASL2PCFOL;defaultCASL2SubCFOL;CFOL2IsabelleHOL except translate CASL terms -- using the CASL term translation for computation, where the terms will be -- translated such that they are of the underlying sort types and thus can be -- used as operands to the formula operators. transFormula :: CASL_Sign.Sign () () -> CASL_Sign.Sign () () -> VSM -> CASL_AS_Basic_CASL.FORMULA () -> Term transFormula pcfolSign cfolSign vsm formula = let -- Function to remove subsorting - from comorphism CAS2PCFOL rmSub = CASL2PCFOL.f2Formula -- Remove subsorting from the formula formulaNoSub = rmSub formula -- Function to remove partiality - from comorphism CAS2SubPCFOL -- This needs to match the translation CASL2SubCFOL.defaultCASL2SubCFOL b = True -- We want unique bottom elements per sort -- Calculate the bottom sorts for the formula and signature fbsrts = CASL2SubCFOL.botFormulaSorts formulaNoSub bsrts = CASL2SubCFOL.sortsWithBottom CASL2SubCFOL.FormulaDependent pcfolSign fbsrts rmPartial = CASL_Simplify.simplifyFormula id . CASL2SubCFOL.codeFormula b bsrts -- Function to tranalate to Isabelle - from comorphism CFOL2IsabelleHOL -- We need the CFOL signature to translate the formula properly tyToks = CFOL2IsabelleHOL.typeToks cfolSign trForm = CFOL2IsabelleHOL.formTrCASL strs = CFOL2IsabelleHOL.getAssumpsToks cfolSign toIsabelle = foldFormula $ cspCaslTransRecord cfolSign tyToks trForm strs vsm -- CFOL2IsabelleHOL.transFORMULA cfolSign tyToks trForm strs in toIsabelle $ rmPartial formulaNoSub
1,857
transFormula :: CASL_Sign.Sign () () -> CASL_Sign.Sign () () -> VSM -> CASL_AS_Basic_CASL.FORMULA () -> Term transFormula pcfolSign cfolSign vsm formula = let -- Function to remove subsorting - from comorphism CAS2PCFOL rmSub = CASL2PCFOL.f2Formula -- Remove subsorting from the formula formulaNoSub = rmSub formula -- Function to remove partiality - from comorphism CAS2SubPCFOL -- This needs to match the translation CASL2SubCFOL.defaultCASL2SubCFOL b = True -- We want unique bottom elements per sort -- Calculate the bottom sorts for the formula and signature fbsrts = CASL2SubCFOL.botFormulaSorts formulaNoSub bsrts = CASL2SubCFOL.sortsWithBottom CASL2SubCFOL.FormulaDependent pcfolSign fbsrts rmPartial = CASL_Simplify.simplifyFormula id . CASL2SubCFOL.codeFormula b bsrts -- Function to tranalate to Isabelle - from comorphism CFOL2IsabelleHOL -- We need the CFOL signature to translate the formula properly tyToks = CFOL2IsabelleHOL.typeToks cfolSign trForm = CFOL2IsabelleHOL.formTrCASL strs = CFOL2IsabelleHOL.getAssumpsToks cfolSign toIsabelle = foldFormula $ cspCaslTransRecord cfolSign tyToks trForm strs vsm -- CFOL2IsabelleHOL.transFORMULA cfolSign tyToks trForm strs in toIsabelle $ rmPartial formulaNoSub
1,438
transFormula pcfolSign cfolSign vsm formula = let -- Function to remove subsorting - from comorphism CAS2PCFOL rmSub = CASL2PCFOL.f2Formula -- Remove subsorting from the formula formulaNoSub = rmSub formula -- Function to remove partiality - from comorphism CAS2SubPCFOL -- This needs to match the translation CASL2SubCFOL.defaultCASL2SubCFOL b = True -- We want unique bottom elements per sort -- Calculate the bottom sorts for the formula and signature fbsrts = CASL2SubCFOL.botFormulaSorts formulaNoSub bsrts = CASL2SubCFOL.sortsWithBottom CASL2SubCFOL.FormulaDependent pcfolSign fbsrts rmPartial = CASL_Simplify.simplifyFormula id . CASL2SubCFOL.codeFormula b bsrts -- Function to tranalate to Isabelle - from comorphism CFOL2IsabelleHOL -- We need the CFOL signature to translate the formula properly tyToks = CFOL2IsabelleHOL.typeToks cfolSign trForm = CFOL2IsabelleHOL.formTrCASL strs = CFOL2IsabelleHOL.getAssumpsToks cfolSign toIsabelle = foldFormula $ cspCaslTransRecord cfolSign tyToks trForm strs vsm -- CFOL2IsabelleHOL.transFORMULA cfolSign tyToks trForm strs in toIsabelle $ rmPartial formulaNoSub
1,313
true
true
0
11
436
207
109
98
null
null
dsalisbury/xmobar
src/ColorCache.hs
bsd-3-clause
getCachedColor :: String -> IO (Maybe Color) getCachedColor color_name = lookup color_name `fmap` readIORef colorCache
118
getCachedColor :: String -> IO (Maybe Color) getCachedColor color_name = lookup color_name `fmap` readIORef colorCache
118
getCachedColor color_name = lookup color_name `fmap` readIORef colorCache
73
false
true
0
8
14
39
19
20
null
null
jimenezrick/unix
tests/libposix/posix004.hs
bsd-3-clause
main = do test1 test2 test3 test4 putStrLn "I'm happy."
95
main = do test1 test2 test3 test4 putStrLn "I'm happy."
95
main = do test1 test2 test3 test4 putStrLn "I'm happy."
95
false
false
1
8
49
28
9
19
null
null
ganeti/ganeti
src/Ganeti/OpParams.hs
bsd-2-clause
pDiskChgAbsolute :: Field pDiskChgAbsolute = withDoc "Whether the amount parameter is an absolute target or a relative one" . renameField "DiskChkAbsolute" $ defaultFalse "absolute"
189
pDiskChgAbsolute :: Field pDiskChgAbsolute = withDoc "Whether the amount parameter is an absolute target or a relative one" . renameField "DiskChkAbsolute" $ defaultFalse "absolute"
189
pDiskChgAbsolute = withDoc "Whether the amount parameter is an absolute target or a relative one" . renameField "DiskChkAbsolute" $ defaultFalse "absolute"
163
false
true
2
6
31
35
14
21
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
bsd-3-clause
genLlvmProc _ = panic "genLlvmProc: case that shouldn't reach here!"
68
genLlvmProc _ = panic "genLlvmProc: case that shouldn't reach here!"
68
genLlvmProc _ = panic "genLlvmProc: case that shouldn't reach here!"
68
false
false
0
5
9
12
5
7
null
null
Cahu/krpc-hs
src/KRPCHS/SpaceCenter.hs
gpl-3.0
getPartThermalInternalFluxStream :: KRPCHS.SpaceCenter.Part -> RPCContext (KRPCStream (Float)) getPartThermalInternalFluxStream thisArg = requestStream $ getPartThermalInternalFluxStreamReq thisArg
197
getPartThermalInternalFluxStream :: KRPCHS.SpaceCenter.Part -> RPCContext (KRPCStream (Float)) getPartThermalInternalFluxStream thisArg = requestStream $ getPartThermalInternalFluxStreamReq thisArg
197
getPartThermalInternalFluxStream thisArg = requestStream $ getPartThermalInternalFluxStreamReq thisArg
102
false
true
0
9
13
43
21
22
null
null
DevJac/haskell-project-euler
src/Problem12.hs
mit
divisors :: Int -> [Int] divisors = nub . map (product . (1:)) . subsequences . primeFactors
92
divisors :: Int -> [Int] divisors = nub . map (product . (1:)) . subsequences . primeFactors
92
divisors = nub . map (product . (1:)) . subsequences . primeFactors
67
false
true
0
11
16
44
24
20
null
null
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Prompt/Pass.hs
bsd-2-clause
-- | Generate a 30 characters password for a given entry. -- If the entry already exists, it is updated with a new password. -- generatePassword :: String -> X () generatePassword passLabel = spawn $ "pass generate --force " ++ passLabel ++ " 30"
246
generatePassword :: String -> X () generatePassword passLabel = spawn $ "pass generate --force " ++ passLabel ++ " 30"
118
generatePassword passLabel = spawn $ "pass generate --force " ++ passLabel ++ " 30"
83
true
true
0
7
44
38
20
18
null
null
CGenie/haskell-algorithms
src/Main.hs
gpl-2.0
mitchellBestCandidateAlgorithm = MitchellBestCandidate.MitchellBestCandidateAlgorithm $ MitchellBestCandidate.MitchellBestCandidateData { MitchellBestCandidate.board = Board2D 200 200, MitchellBestCandidate.numTotalSamples = 400, MitchellBestCandidate.numInitialSamples = 10, MitchellBestCandidate.numCandidates = 10 }
358
mitchellBestCandidateAlgorithm = MitchellBestCandidate.MitchellBestCandidateAlgorithm $ MitchellBestCandidate.MitchellBestCandidateData { MitchellBestCandidate.board = Board2D 200 200, MitchellBestCandidate.numTotalSamples = 400, MitchellBestCandidate.numInitialSamples = 10, MitchellBestCandidate.numCandidates = 10 }
358
mitchellBestCandidateAlgorithm = MitchellBestCandidate.MitchellBestCandidateAlgorithm $ MitchellBestCandidate.MitchellBestCandidateData { MitchellBestCandidate.board = Board2D 200 200, MitchellBestCandidate.numTotalSamples = 400, MitchellBestCandidate.numInitialSamples = 10, MitchellBestCandidate.numCandidates = 10 }
358
false
false
0
8
60
53
30
23
null
null
mathhun/stack
src/Stack/Types/Config.hs
bsd-3-clause
configMonoidLatestSnapshotUrlName :: Text configMonoidLatestSnapshotUrlName = "latest-snapshot-url"
99
configMonoidLatestSnapshotUrlName :: Text configMonoidLatestSnapshotUrlName = "latest-snapshot-url"
99
configMonoidLatestSnapshotUrlName = "latest-snapshot-url"
57
false
true
0
4
5
11
6
5
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_ERLANG_KEYWORD :: Int wxSTC_ERLANG_KEYWORD = 4
52
wxSTC_ERLANG_KEYWORD :: Int wxSTC_ERLANG_KEYWORD = 4
52
wxSTC_ERLANG_KEYWORD = 4
24
false
true
0
4
5
11
6
5
null
null
ZjMNZHgG5jMXw/smallcaps
src/smallcaps/Text/SmallCaps/TeX.hs
bsd-3-clause
content _ = empty
33
content _ = empty
33
content _ = empty
33
false
false
0
5
19
9
4
5
null
null
nevrenato/HetsAlloy
RDF/Parse.hs
gpl-2.0
parsePredicate :: CharParser st Predicate parsePredicate = fmap Predicate $ skips uriP
86
parsePredicate :: CharParser st Predicate parsePredicate = fmap Predicate $ skips uriP
86
parsePredicate = fmap Predicate $ skips uriP
44
false
true
0
6
11
26
12
14
null
null
yliu120/K3
src/Language/K3/Analysis/HMTypes/Inference.hs
apache-2.0
initializerPropagatedQPs :: QPType -> Maybe (K3 Expression) -> TInfM () initializerPropagatedQPs _ Nothing = return ()
118
initializerPropagatedQPs :: QPType -> Maybe (K3 Expression) -> TInfM () initializerPropagatedQPs _ Nothing = return ()
118
initializerPropagatedQPs _ Nothing = return ()
46
false
true
0
9
15
43
20
23
null
null
ecaustin/haskhol-deductive
src/HaskHOL/Lib/Trivia/Base.hs
bsd-2-clause
-- Stage 2 tyDef1 :: HOL cls thry HOLThm tyDef1 = unsafeCacheProof "tyDef1" $ getTypeDefinition "1"
99
tyDef1 :: HOL cls thry HOLThm tyDef1 = unsafeCacheProof "tyDef1" $ getTypeDefinition "1"
88
tyDef1 = unsafeCacheProof "tyDef1" $ getTypeDefinition "1"
58
true
true
1
6
15
32
14
18
null
null
Warbo/nix-eval
src/Language/Eval/Internal.hs
gpl-3.0
pkgsToName [] = "ghc-env"
25
pkgsToName [] = "ghc-env"
25
pkgsToName [] = "ghc-env"
25
false
false
0
6
3
11
5
6
null
null
kaoskorobase/mescaline
resources/hugs/packages/base/Data/IntSet.hs
gpl-3.0
splitMember :: Int -> IntSet -> (IntSet,Bool,IntSet) splitMember x t = case t of Bin p m l r | m < 0 -> if x >= 0 then let (lt,found,gt) = splitMember' x l in (union r lt, found, gt) else let (lt,found,gt) = splitMember' x r in (lt, found, union gt l) -- handle negative numbers. | otherwise -> splitMember' x t Tip y | x>y -> (t,False,Nil) | x<y -> (Nil,False,t) | otherwise -> (Nil,True,Nil) Nil -> (Nil,False,Nil)
567
splitMember :: Int -> IntSet -> (IntSet,Bool,IntSet) splitMember x t = case t of Bin p m l r | m < 0 -> if x >= 0 then let (lt,found,gt) = splitMember' x l in (union r lt, found, gt) else let (lt,found,gt) = splitMember' x r in (lt, found, union gt l) -- handle negative numbers. | otherwise -> splitMember' x t Tip y | x>y -> (t,False,Nil) | x<y -> (Nil,False,t) | otherwise -> (Nil,True,Nil) Nil -> (Nil,False,Nil)
567
splitMember x t = case t of Bin p m l r | m < 0 -> if x >= 0 then let (lt,found,gt) = splitMember' x l in (union r lt, found, gt) else let (lt,found,gt) = splitMember' x r in (lt, found, union gt l) -- handle negative numbers. | otherwise -> splitMember' x t Tip y | x>y -> (t,False,Nil) | x<y -> (Nil,False,t) | otherwise -> (Nil,True,Nil) Nil -> (Nil,False,Nil)
514
false
true
0
14
231
252
132
120
null
null
minikomi/Turing-Drawings-Haskell
Main.hs
bsd-3-clause
genWorld :: Int -> Int -> State -> Symbol -> IO World genWorld w h nst nsy = do tbl <- genTable nst nsy tp <- genTape w h return $ World tbl tp (0 :: State) nst nsy (w `div` 2, h `div` 2) (w, h) 3
204
genWorld :: Int -> Int -> State -> Symbol -> IO World genWorld w h nst nsy = do tbl <- genTable nst nsy tp <- genTape w h return $ World tbl tp (0 :: State) nst nsy (w `div` 2, h `div` 2) (w, h) 3
204
genWorld w h nst nsy = do tbl <- genTable nst nsy tp <- genTape w h return $ World tbl tp (0 :: State) nst nsy (w `div` 2, h `div` 2) (w, h) 3
150
false
true
0
10
55
117
60
57
null
null
bno1/adventofcode_2016
d11/main.hs
mit
-- returns the current floor items getFloorItems :: State -> ItemSet getFloorItems s@(State f _) = getFloorItems' s f
117
getFloorItems :: State -> ItemSet getFloorItems s@(State f _) = getFloorItems' s f
82
getFloorItems s@(State f _) = getFloorItems' s f
48
true
true
0
8
18
35
18
17
null
null
tjakway/ghcjvm
compiler/typecheck/TcTyDecls.hs
bsd-3-clause
addRoleInferenceVar :: TyVar -> RoleM a -> RoleM a addRoleInferenceVar tv thing = RM $ \m_name vps nvps state -> ASSERT( isJust m_name ) unRM thing m_name (extendVarEnv vps tv nvps) (nvps+1) state
206
addRoleInferenceVar :: TyVar -> RoleM a -> RoleM a addRoleInferenceVar tv thing = RM $ \m_name vps nvps state -> ASSERT( isJust m_name ) unRM thing m_name (extendVarEnv vps tv nvps) (nvps+1) state
206
addRoleInferenceVar tv thing = RM $ \m_name vps nvps state -> ASSERT( isJust m_name ) unRM thing m_name (extendVarEnv vps tv nvps) (nvps+1) state
155
false
true
2
7
42
87
41
46
null
null
CGenie/platform
shared/src/Unison/ABT.hs
mit
visit :: (Traversable f, Applicative g, Ord v) => (Term f v () -> Maybe (g (Term f v ()))) -> Term f v () -> g (Term f v ()) visit f t = case f t of Just gt -> gt Nothing -> case out t of Var _ -> pure t Cycle body -> cycle <$> visit f body Abs x e -> abs x <$> visit f e Tm body -> tm <$> traverse (visit f) body -- | Apply an effectful function to an ABT tree top down, sequencing the results.
434
visit :: (Traversable f, Applicative g, Ord v) => (Term f v () -> Maybe (g (Term f v ()))) -> Term f v () -> g (Term f v ()) visit f t = case f t of Just gt -> gt Nothing -> case out t of Var _ -> pure t Cycle body -> cycle <$> visit f body Abs x e -> abs x <$> visit f e Tm body -> tm <$> traverse (visit f) body -- | Apply an effectful function to an ABT tree top down, sequencing the results.
434
visit f t = case f t of Just gt -> gt Nothing -> case out t of Var _ -> pure t Cycle body -> cycle <$> visit f body Abs x e -> abs x <$> visit f e Tm body -> tm <$> traverse (visit f) body -- | Apply an effectful function to an ABT tree top down, sequencing the results.
291
false
true
9
14
134
168
86
82
null
null
ksaveljev/hake-2
src/Game/Monsters/MParasite.hs
bsd-3-clause
frameDeath107 :: Int frameDeath107 = 38
39
frameDeath107 :: Int frameDeath107 = 38
39
frameDeath107 = 38
18
false
true
0
4
5
11
6
5
null
null
siddhanathan/yi
yi-keymap-cua/src/Yi/Keymap/Cua.hs
gpl-2.0
deleteSel :: BufferM () -> YiM () deleteSel act = do haveSelection <- withCurrentBuffer $ use highlightSelectionA if haveSelection then withEditor del else withCurrentBuffer (adjBlock (-1) >> act)
208
deleteSel :: BufferM () -> YiM () deleteSel act = do haveSelection <- withCurrentBuffer $ use highlightSelectionA if haveSelection then withEditor del else withCurrentBuffer (adjBlock (-1) >> act)
208
deleteSel act = do haveSelection <- withCurrentBuffer $ use highlightSelectionA if haveSelection then withEditor del else withCurrentBuffer (adjBlock (-1) >> act)
174
false
true
0
14
39
79
36
43
null
null
archhaskell/cabal2arch
Cabal2Arch/Util.hs
bsd-3-clause
myReadProcess :: FilePath -- ^ command to run -> [String] -- ^ any arguments -> String -- ^ standard input -> IO (Either (ExitCode,String,String) String) -- ^ either the stdout, or an exitcode and any output myReadProcess cmd _args input = CE.handle (return . handler) $ do (inh,outh,errh,pid) <- runInteractiveProcess cmd _args Nothing Nothing output <- hGetContents outh outMVar <- newEmptyMVar _ <- forkIO $ (CE.evaluate (length output) >> putMVar outMVar ()) errput <- hGetContents errh errMVar <- newEmptyMVar _ <- forkIO $ (CE.evaluate (length errput) >> putMVar errMVar ()) when (not (null input)) $ hPutStr inh input takeMVar outMVar takeMVar errMVar ex <- CE.catch (waitForProcess pid) ((const :: a -> CE.SomeException -> a) $ return ExitSuccess) hClose outh hClose inh -- done with stdin hClose errh -- ignore stderr return $ case ex of ExitSuccess -> Right output ExitFailure _ -> Left (ex, errput, output) where handler (ExitFailure e) = Left (ExitFailure e,"","") handler e = Left (ExitFailure 1, show e, "")
1,284
myReadProcess :: FilePath -- ^ command to run -> [String] -- ^ any arguments -> String -- ^ standard input -> IO (Either (ExitCode,String,String) String) myReadProcess cmd _args input = CE.handle (return . handler) $ do (inh,outh,errh,pid) <- runInteractiveProcess cmd _args Nothing Nothing output <- hGetContents outh outMVar <- newEmptyMVar _ <- forkIO $ (CE.evaluate (length output) >> putMVar outMVar ()) errput <- hGetContents errh errMVar <- newEmptyMVar _ <- forkIO $ (CE.evaluate (length errput) >> putMVar errMVar ()) when (not (null input)) $ hPutStr inh input takeMVar outMVar takeMVar errMVar ex <- CE.catch (waitForProcess pid) ((const :: a -> CE.SomeException -> a) $ return ExitSuccess) hClose outh hClose inh -- done with stdin hClose errh -- ignore stderr return $ case ex of ExitSuccess -> Right output ExitFailure _ -> Left (ex, errput, output) where handler (ExitFailure e) = Left (ExitFailure e,"","") handler e = Left (ExitFailure 1, show e, "")
1,228
myReadProcess cmd _args input = CE.handle (return . handler) $ do (inh,outh,errh,pid) <- runInteractiveProcess cmd _args Nothing Nothing output <- hGetContents outh outMVar <- newEmptyMVar _ <- forkIO $ (CE.evaluate (length output) >> putMVar outMVar ()) errput <- hGetContents errh errMVar <- newEmptyMVar _ <- forkIO $ (CE.evaluate (length errput) >> putMVar errMVar ()) when (not (null input)) $ hPutStr inh input takeMVar outMVar takeMVar errMVar ex <- CE.catch (waitForProcess pid) ((const :: a -> CE.SomeException -> a) $ return ExitSuccess) hClose outh hClose inh -- done with stdin hClose errh -- ignore stderr return $ case ex of ExitSuccess -> Right output ExitFailure _ -> Left (ex, errput, output) where handler (ExitFailure e) = Left (ExitFailure e,"","") handler e = Left (ExitFailure 1, show e, "")
949
true
true
0
15
425
411
199
212
null
null
kaashif/muon
src/Post.hs
bsd-3-clause
generatePosts = getAllPosts >>= writePosts>> putStrLn "Generated posts"
71
generatePosts = getAllPosts >>= writePosts>> putStrLn "Generated posts"
71
generatePosts = getAllPosts >>= writePosts>> putStrLn "Generated posts"
71
false
false
0
6
7
17
8
9
null
null
ppelleti/lifx-table-scraper
Main.hs
bsd-3-clause
download :: String -> IOSArrow b XmlTree download src = readDocument [withParseHTML yes, withHTTP [], withWarnings no] src >>> getXPathTrees "//content[@class='content']//text()"
194
download :: String -> IOSArrow b XmlTree download src = readDocument [withParseHTML yes, withHTTP [], withWarnings no] src >>> getXPathTrees "//content[@class='content']//text()"
194
download src = readDocument [withParseHTML yes, withHTTP [], withWarnings no] src >>> getXPathTrees "//content[@class='content']//text()"
153
false
true
2
8
36
62
27
35
null
null
robstewart57/hdph-rs
src/Control/Parallel/HdpH/Internal/IVar.hs
bsd-3-clause
-- Globalise the given IVar; globIVar :: IVar m a -> IO (GIVar m a) globIVar v = do gv <- globalise v debug dbgGIVar $ "New global IVar " ++ show gv return gv
164
globIVar :: IVar m a -> IO (GIVar m a) globIVar v = do gv <- globalise v debug dbgGIVar $ "New global IVar " ++ show gv return gv
135
globIVar v = do gv <- globalise v debug dbgGIVar $ "New global IVar " ++ show gv return gv
96
true
true
0
9
40
68
30
38
null
null
SwiftsNamesake/Cartesian
src/Cartesian/Internal/Lenses.hs
mit
-- TODO: 'Of' -------------------------------------------------------------------------------------------------------------------------------------------- -- | -- pad :: (Getter v f) -> f -> f -> BoundingBox v -- pad axis by direction = _ -- | Like pinned, except it operates on a single axis and only focuses on the position (not size) -- -- TODO: Change the type to make it play more nicely with 'pinned' (?) -- TODO: - What's the proper way of 'lifting' lenses (such as 'pinnedAxis'), so they work on multiple fields. -- This is not mucher better than it used to be when we didn't have the 'pinnedAxis' helper... pinnedAxis :: Num n => n -> Simple Lens (Axis n) (Axis n) pinnedAxis to = lens get set where get (begin', len) = (begin' + to*len, len) set _ (begin', len) = (begin' - to*len, len) -- | Creates a lens where a pin is placed on a given point ('to'), so that -- the box can be placed or resized relative to the pin. It is also useful for -- retrieving points within the box (such as the centre). -- -- The pin is assumed to be normalised with respect to the corner and size of the box. -- -- @ -- let box = BoundingBox { cornerOf = V2 10 24, sizeOf = V2 6 18 } -- -- box^.pinned (V2 0.5 0.5) -- Anchored to the centre -- > V2 (13.0,6.0) (33.0,18.0) -- @ --
1,306
pinnedAxis :: Num n => n -> Simple Lens (Axis n) (Axis n) pinnedAxis to = lens get set where get (begin', len) = (begin' + to*len, len) set _ (begin', len) = (begin' - to*len, len) -- | Creates a lens where a pin is placed on a given point ('to'), so that -- the box can be placed or resized relative to the pin. It is also useful for -- retrieving points within the box (such as the centre). -- -- The pin is assumed to be normalised with respect to the corner and size of the box. -- -- @ -- let box = BoundingBox { cornerOf = V2 10 24, sizeOf = V2 6 18 } -- -- box^.pinned (V2 0.5 0.5) -- Anchored to the centre -- > V2 (13.0,6.0) (33.0,18.0) -- @ --
677
pinnedAxis to = lens get set where get (begin', len) = (begin' + to*len, len) set _ (begin', len) = (begin' - to*len, len) -- | Creates a lens where a pin is placed on a given point ('to'), so that -- the box can be placed or resized relative to the pin. It is also useful for -- retrieving points within the box (such as the centre). -- -- The pin is assumed to be normalised with respect to the corner and size of the box. -- -- @ -- let box = BoundingBox { cornerOf = V2 10 24, sizeOf = V2 6 18 } -- -- box^.pinned (V2 0.5 0.5) -- Anchored to the centre -- > V2 (13.0,6.0) (33.0,18.0) -- @ --
619
true
true
1
10
272
141
81
60
null
null
facebookincubator/duckling
Duckling/TimeGrain/DA/Rules.hs
bsd-3-clause
rules :: [Rule] rules = map go grains where go (name, regexPattern, grain) = Rule { name = name , pattern = [regex regexPattern] , prod = \_ -> Just $ Token TimeGrain grain }
204
rules :: [Rule] rules = map go grains where go (name, regexPattern, grain) = Rule { name = name , pattern = [regex regexPattern] , prod = \_ -> Just $ Token TimeGrain grain }
204
rules = map go grains where go (name, regexPattern, grain) = Rule { name = name , pattern = [regex regexPattern] , prod = \_ -> Just $ Token TimeGrain grain }
188
false
true
0
9
64
78
44
34
null
null
narurien/ganeti-ceph
src/Ganeti/OpParams.hs
gpl-2.0
-- | Whether to ignore recorded disk size. pIgnoreDiskSize :: Field pIgnoreDiskSize = defaultFalse "ignore_size"
112
pIgnoreDiskSize :: Field pIgnoreDiskSize = defaultFalse "ignore_size"
69
pIgnoreDiskSize = defaultFalse "ignore_size"
44
true
true
0
6
14
21
9
12
null
null
Teaspot-Studio/bmstu-commi-genetics-haste
Commi/Util.hs
bsd-3-clause
hasTimeout :: String -> IO Bool hasTimeout ids = elem ids <$> readIORef timeoutStore
84
hasTimeout :: String -> IO Bool hasTimeout ids = elem ids <$> readIORef timeoutStore
84
hasTimeout ids = elem ids <$> readIORef timeoutStore
52
false
true
0
6
13
31
14
17
null
null
bravit/Idris-dev
src/Idris/IdrisDoc.hs
bsd-3-clause
extractPTactic (Induction p) = extract p
45
extractPTactic (Induction p) = extract p
45
extractPTactic (Induction p) = extract p
45
false
false
0
7
10
18
8
10
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F31.hs
bsd-3-clause
ptr_glVertexAttribL3ui64NV :: FunPtr (GLuint -> GLuint64EXT -> GLuint64EXT -> GLuint64EXT -> IO ()) ptr_glVertexAttribL3ui64NV = unsafePerformIO $ getCommand "glVertexAttribL3ui64NV"
182
ptr_glVertexAttribL3ui64NV :: FunPtr (GLuint -> GLuint64EXT -> GLuint64EXT -> GLuint64EXT -> IO ()) ptr_glVertexAttribL3ui64NV = unsafePerformIO $ getCommand "glVertexAttribL3ui64NV"
182
ptr_glVertexAttribL3ui64NV = unsafePerformIO $ getCommand "glVertexAttribL3ui64NV"
82
false
true
0
12
18
45
22
23
null
null
DaMSL/K3
src/Language/K3/Utils/Logger.hs
apache-2.0
logAction :: (Functor m, Monad m) => Bool -> (Maybe a -> Maybe String) -> m a -> m a logAction asTrace msgF action = do doLog (msgF Nothing) result <- action doLog (msgF $ Just result) return result where doLog Nothing = return () doLog (Just s) = logVoid asTrace s
278
logAction :: (Functor m, Monad m) => Bool -> (Maybe a -> Maybe String) -> m a -> m a logAction asTrace msgF action = do doLog (msgF Nothing) result <- action doLog (msgF $ Just result) return result where doLog Nothing = return () doLog (Just s) = logVoid asTrace s
278
logAction asTrace msgF action = do doLog (msgF Nothing) result <- action doLog (msgF $ Just result) return result where doLog Nothing = return () doLog (Just s) = logVoid asTrace s
193
false
true
1
10
64
138
64
74
null
null
lpeterse/crprover
Datatypes.hs
gpl-2.0
isIff _ = False
25
isIff _ = False
25
isIff _ = False
25
false
false
0
4
13
10
4
6
null
null
tolysz/prepare-ghcjs
spec-lts8/base/Text/Printf.hs
bsd-3-clause
adjustSigned ufmt@(FieldFormat {fmtSign = Just SignSpace}) ("", str) = adjust ufmt (" ", str)
95
adjustSigned ufmt@(FieldFormat {fmtSign = Just SignSpace}) ("", str) = adjust ufmt (" ", str)
95
adjustSigned ufmt@(FieldFormat {fmtSign = Just SignSpace}) ("", str) = adjust ufmt (" ", str)
95
false
false
4
10
15
55
25
30
null
null
HIPERFIT/futhark
src/Futhark/Doc/Generator.hs
isc
fullRow :: Html -> Html fullRow = H.tr . (H.td ! A.colspan "3")
63
fullRow :: Html -> Html fullRow = H.tr . (H.td ! A.colspan "3")
63
fullRow = H.tr . (H.td ! A.colspan "3")
39
false
true
1
9
12
43
19
24
null
null
geophf/1HaskellADay
exercises/HAD/Data/Tree/Merkle.hs
mit
insertLrehash l (Right br) = Right . mkbb . insertL' l $ branch br
66
insertLrehash l (Right br) = Right . mkbb . insertL' l $ branch br
66
insertLrehash l (Right br) = Right . mkbb . insertL' l $ branch br
66
false
false
0
7
13
35
16
19
null
null
dysinger/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/DescribeSnapshotSchedule.hs
mpl-2.0
dssrDescription :: Lens' DescribeSnapshotScheduleResponse (Maybe Text) dssrDescription = lens _dssrDescription (\s a -> s { _dssrDescription = a })
147
dssrDescription :: Lens' DescribeSnapshotScheduleResponse (Maybe Text) dssrDescription = lens _dssrDescription (\s a -> s { _dssrDescription = a })
147
dssrDescription = lens _dssrDescription (\s a -> s { _dssrDescription = a })
76
false
true
0
9
18
45
24
21
null
null
abbradar/comps-rk1
src/Parser.hs
bsd-3-clause
noneOf :: [Char] -> Parser Char noneOf cs = satisfy (not . flip elem cs) anyChar
80
noneOf :: [Char] -> Parser Char noneOf cs = satisfy (not . flip elem cs) anyChar
80
noneOf cs = satisfy (not . flip elem cs) anyChar
48
false
true
0
8
15
46
21
25
null
null
Joss-Steward/Primality
primeTest.hs
mit
primesTo100 :: [Integer] primesTo100 = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]
111
primesTo100 :: [Integer] primesTo100 = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]
111
primesTo100 = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]
86
false
true
0
5
5
89
58
31
null
null
Cahu/krpc-hs
src/KRPCHS/SpaceCenter.hs
gpl-3.0
getFlightHeadingStreamReq :: KRPCHS.SpaceCenter.Flight -> KRPCStreamReq (Float) getFlightHeadingStreamReq thisArg = let req = makeRequest "SpaceCenter" "Flight_get_Heading" [makeArgument 0 thisArg] in makeStream req
224
getFlightHeadingStreamReq :: KRPCHS.SpaceCenter.Flight -> KRPCStreamReq (Float) getFlightHeadingStreamReq thisArg = let req = makeRequest "SpaceCenter" "Flight_get_Heading" [makeArgument 0 thisArg] in makeStream req
224
getFlightHeadingStreamReq thisArg = let req = makeRequest "SpaceCenter" "Flight_get_Heading" [makeArgument 0 thisArg] in makeStream req
144
false
true
0
11
29
60
28
32
null
null
christiannolte/tip-toi-reveng
src/GMEParser.hs
mit
jumpTo :: Offset -> SGet () jumpTo offset = SGet (put offset)
61
jumpTo :: Offset -> SGet () jumpTo offset = SGet (put offset)
61
jumpTo offset = SGet (put offset)
33
false
true
0
7
11
32
15
17
null
null
Feeniks/Agon
app/Agon/Server.hs
bsd-3-clause
removeFromTeam :: AuthToken -> ID -> ID -> AppM Team removeFromTeam tok tid uid = withAuth tok $ \executor -> do team <- get tid removed <- get uid let executorID = executor ^. userID let removedID = removed ^. userID let isTA = isTeamAdmin executor team let removeSelf = executorID == removedID case (isTA && not removeSelf) of True -> do let team' = team & teamMembers %~ (filter $ (/=removedID) . memberID) update team' False -> lift $ left err where err | not isTA = err403 | otherwise = err400 { errBody = "Cannot remove self" }
641
removeFromTeam :: AuthToken -> ID -> ID -> AppM Team removeFromTeam tok tid uid = withAuth tok $ \executor -> do team <- get tid removed <- get uid let executorID = executor ^. userID let removedID = removed ^. userID let isTA = isTeamAdmin executor team let removeSelf = executorID == removedID case (isTA && not removeSelf) of True -> do let team' = team & teamMembers %~ (filter $ (/=removedID) . memberID) update team' False -> lift $ left err where err | not isTA = err403 | otherwise = err400 { errBody = "Cannot remove self" }
641
removeFromTeam tok tid uid = withAuth tok $ \executor -> do team <- get tid removed <- get uid let executorID = executor ^. userID let removedID = removed ^. userID let isTA = isTeamAdmin executor team let removeSelf = executorID == removedID case (isTA && not removeSelf) of True -> do let team' = team & teamMembers %~ (filter $ (/=removedID) . memberID) update team' False -> lift $ left err where err | not isTA = err403 | otherwise = err400 { errBody = "Cannot remove self" }
588
false
true
0
21
207
225
106
119
null
null
ekmett/ghc
compiler/nativeGen/PPC/CodeGen.hs
bsd-3-clause
selExpr64 :: CmmExpr -> NatM ChildCode64 iselExpr64 (CmmLoad addrTree ty) | isWord64 ty = do (hi_addr, lo_addr, addr_code) <- getI64Amodes addrTree (rlo, rhi) <- getNewRegPairNat II32 let mov_hi = LD II32 rhi hi_addr mov_lo = LD II32 rlo lo_addr return $ ChildCode64 (addr_code `snocOL` mov_lo `snocOL` mov_hi) rlo
371
iselExpr64 :: CmmExpr -> NatM ChildCode64 iselExpr64 (CmmLoad addrTree ty) | isWord64 ty = do (hi_addr, lo_addr, addr_code) <- getI64Amodes addrTree (rlo, rhi) <- getNewRegPairNat II32 let mov_hi = LD II32 rhi hi_addr mov_lo = LD II32 rlo lo_addr return $ ChildCode64 (addr_code `snocOL` mov_lo `snocOL` mov_hi) rlo
371
iselExpr64 (CmmLoad addrTree ty) | isWord64 ty = do (hi_addr, lo_addr, addr_code) <- getI64Amodes addrTree (rlo, rhi) <- getNewRegPairNat II32 let mov_hi = LD II32 rhi hi_addr mov_lo = LD II32 rlo lo_addr return $ ChildCode64 (addr_code `snocOL` mov_lo `snocOL` mov_hi) rlo
322
false
true
0
12
104
128
63
65
null
null
tomberek/RETE
src/RETE/Lib4.hs
bsd-3-clause
-- ] {- ex :: Expr SIG a ex = student 2 "NOT matched" 2 rEnglish -} --student_rule3 :: _ => MetaId Int -> Rule (LHS' f) rhs student_rule x y= [student (meta x) __ (meta y) rEnglish ] .| meta x .> 0 .&& meta y .> meta x ===> student (meta x) "matched!" (meta x) rMath
418
student_rule x y= [student (meta x) __ (meta y) rEnglish ] .| meta x .> 0 .&& meta y .> meta x ===> student (meta x) "matched!" (meta x) rMath
292
student_rule x y= [student (meta x) __ (meta y) rEnglish ] .| meta x .> 0 .&& meta y .> meta x ===> student (meta x) "matched!" (meta x) rMath
292
true
false
3
12
209
86
41
45
null
null
kolmodin/cabal
cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs
bsd-3-clause
-- | Cycles through setup dependencies -- -- The first cycle is unsolvable: package A has a setup dependency on B, -- B has a regular dependency on A, and we only have a single version available -- for both. -- -- The second cycle can be broken by picking different versions: package C-2.0 -- has a setup dependency on D, and D has a regular dependency on C-*. However, -- version C-1.0 is already available (perhaps it didn't have this setup dep). -- Thus, we should be able to break this cycle even if we are installing package -- E, which explictly depends on C-2.0. db15 :: ExampleDb db15 = [ -- First example (real cycle, no solution) Right $ exAv "A" 1 [] `withSetupDeps` [ExAny "B"] , Right $ exAv "B" 1 [ExAny "A"] -- Second example (cycle can be broken by picking versions carefully) , Left $ exInst "C" 1 "C-1-inst" [] , Right $ exAv "C" 2 [] `withSetupDeps` [ExAny "D"] , Right $ exAv "D" 1 [ExAny "C" ] , Right $ exAv "E" 1 [ExFix "C" 2] ]
1,064
db15 :: ExampleDb db15 = [ -- First example (real cycle, no solution) Right $ exAv "A" 1 [] `withSetupDeps` [ExAny "B"] , Right $ exAv "B" 1 [ExAny "A"] -- Second example (cycle can be broken by picking versions carefully) , Left $ exInst "C" 1 "C-1-inst" [] , Right $ exAv "C" 2 [] `withSetupDeps` [ExAny "D"] , Right $ exAv "D" 1 [ExAny "C" ] , Right $ exAv "E" 1 [ExFix "C" 2] ]
494
db15 = [ -- First example (real cycle, no solution) Right $ exAv "A" 1 [] `withSetupDeps` [ExAny "B"] , Right $ exAv "B" 1 [ExAny "A"] -- Second example (cycle can be broken by picking versions carefully) , Left $ exInst "C" 1 "C-1-inst" [] , Right $ exAv "C" 2 [] `withSetupDeps` [ExAny "D"] , Right $ exAv "D" 1 [ExAny "C" ] , Right $ exAv "E" 1 [ExFix "C" 2] ]
476
true
true
0
10
296
167
90
77
null
null
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/Products/List.hs
mpl-2.0
-- | Upload protocol for media (e.g. \"raw\", \"multipart\"). ppUploadProtocol :: Lens' ProductsList (Maybe Text) ppUploadProtocol = lens _ppUploadProtocol (\ s a -> s{_ppUploadProtocol = a})
199
ppUploadProtocol :: Lens' ProductsList (Maybe Text) ppUploadProtocol = lens _ppUploadProtocol (\ s a -> s{_ppUploadProtocol = a})
137
ppUploadProtocol = lens _ppUploadProtocol (\ s a -> s{_ppUploadProtocol = a})
85
true
true
1
9
33
51
25
26
null
null
benarmston/hpastie
src/Views.hs
bsd-3-clause
pasteV :: Paste -> Template pasteV paste = layoutWithHeader "Paste" css $ div ! id uid $ do h2 $ pTitle paste p ! class_ "timestamp" $ toHtml $ "Uploaded at " ++ formattedTime maybeDisplaySyntax pre formattedCode where contents = filter (/='\r') $ pasteContents paste syntax = pasteSyntax paste formattedCode = case highlightAs syntax contents of Left _ -> pre $ toHtml contents Right c -> preEscapedString . show $ formatAsXHtml [OptNumberLines] syntax c timestamp = pasteTimestamp paste formattedTime = formatTime defaultTimeLocale "%F %R UTC" timestamp uid = toValue $ pId paste maybeDisplaySyntax = if syntax == "" then "" else p ! class_ "syntax" $ "Language " >> syntaxLink syntaxLink = a ! href (toValue $ "/language/" ++ syntax) $ toHtml syntax css = inlineCss defaultHighlightingCss
1,042
pasteV :: Paste -> Template pasteV paste = layoutWithHeader "Paste" css $ div ! id uid $ do h2 $ pTitle paste p ! class_ "timestamp" $ toHtml $ "Uploaded at " ++ formattedTime maybeDisplaySyntax pre formattedCode where contents = filter (/='\r') $ pasteContents paste syntax = pasteSyntax paste formattedCode = case highlightAs syntax contents of Left _ -> pre $ toHtml contents Right c -> preEscapedString . show $ formatAsXHtml [OptNumberLines] syntax c timestamp = pasteTimestamp paste formattedTime = formatTime defaultTimeLocale "%F %R UTC" timestamp uid = toValue $ pId paste maybeDisplaySyntax = if syntax == "" then "" else p ! class_ "syntax" $ "Language " >> syntaxLink syntaxLink = a ! href (toValue $ "/language/" ++ syntax) $ toHtml syntax css = inlineCss defaultHighlightingCss
1,042
pasteV paste = layoutWithHeader "Paste" css $ div ! id uid $ do h2 $ pTitle paste p ! class_ "timestamp" $ toHtml $ "Uploaded at " ++ formattedTime maybeDisplaySyntax pre formattedCode where contents = filter (/='\r') $ pasteContents paste syntax = pasteSyntax paste formattedCode = case highlightAs syntax contents of Left _ -> pre $ toHtml contents Right c -> preEscapedString . show $ formatAsXHtml [OptNumberLines] syntax c timestamp = pasteTimestamp paste formattedTime = formatTime defaultTimeLocale "%F %R UTC" timestamp uid = toValue $ pId paste maybeDisplaySyntax = if syntax == "" then "" else p ! class_ "syntax" $ "Language " >> syntaxLink syntaxLink = a ! href (toValue $ "/language/" ++ syntax) $ toHtml syntax css = inlineCss defaultHighlightingCss
1,013
false
true
4
13
377
242
117
125
null
null
ganeti/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
opcodeReasonSrcRlib2 :: String opcodeReasonSrcRlib2 = "gnt:library:rlib2"
73
opcodeReasonSrcRlib2 :: String opcodeReasonSrcRlib2 = "gnt:library:rlib2"
73
opcodeReasonSrcRlib2 = "gnt:library:rlib2"
42
false
true
0
4
5
11
6
5
null
null
brendanhay/gogol
gogol-games/gen/Network/Google/Games/Types/Product.hs
mpl-2.0
-- | The MIME type of the image. siMimeType :: Lens' SnapshotImage (Maybe Text) siMimeType = lens _siMimeType (\ s a -> s{_siMimeType = a})
141
siMimeType :: Lens' SnapshotImage (Maybe Text) siMimeType = lens _siMimeType (\ s a -> s{_siMimeType = a})
108
siMimeType = lens _siMimeType (\ s a -> s{_siMimeType = a})
61
true
true
0
9
26
48
25
23
null
null
zudov/purescript-inspection
app/DevelMain.hs
bsd-3-clause
develMain :: IO () develMain = do env <- newEnvironment appRef <- newIORef (app env) tid <- forkIO $ run 8080 (app env) writeStore (Store 1) appRef writeStore (Store 0) env
185
develMain :: IO () develMain = do env <- newEnvironment appRef <- newIORef (app env) tid <- forkIO $ run 8080 (app env) writeStore (Store 1) appRef writeStore (Store 0) env
185
develMain = do env <- newEnvironment appRef <- newIORef (app env) tid <- forkIO $ run 8080 (app env) writeStore (Store 1) appRef writeStore (Store 0) env
166
false
true
0
12
43
95
41
54
null
null
andorp/bead
test/Test/Property/EntityGen.hs
bsd-3-clause
evalConfigs = oneof [ return binaryConfig , percentageConfig <$> percentage ]
85
evalConfigs = oneof [ return binaryConfig , percentageConfig <$> percentage ]
85
evalConfigs = oneof [ return binaryConfig , percentageConfig <$> percentage ]
85
false
false
1
7
18
26
11
15
null
null
input-output-hk/pos-haskell-prototype
crypto/Pos/Crypto/Hashing.hs
mit
withHash :: Bi a => a -> WithHash a withHash a = WithHash a (force h) where h = hash a
92
withHash :: Bi a => a -> WithHash a withHash a = WithHash a (force h) where h = hash a
92
withHash a = WithHash a (force h) where h = hash a
56
false
true
1
8
26
59
24
35
null
null
zachsully/hakaru
haskell/Language/Hakaru/Evaluation/PEvalMonad.hs
bsd-3-clause
emitSuperpose [e] = emitMBind e
31
emitSuperpose [e] = emitMBind e
31
emitSuperpose [e] = emitMBind e
31
false
false
0
6
4
15
7
8
null
null
phischu/haxl-neo4j
src/Haxl/Neo4j.hs
bsd-3-clause
edgeId :: Edge -> Neo4j EdgeId edgeId = Neo4j . return . (:[]) . Internal.edgeId
80
edgeId :: Edge -> Neo4j EdgeId edgeId = Neo4j . return . (:[]) . Internal.edgeId
80
edgeId = Neo4j . return . (:[]) . Internal.edgeId
49
false
true
0
8
14
38
20
18
null
null
janrain/snap-server
src/Data/Concurrent/HashMap.hs
bsd-3-clause
hashInt :: Int -> Word hashInt = $(whichHash [| Murmur.asWord32 . Murmur.hash32 |] [| Murmur.asWord64 . Murmur.hash64 |])
143
hashInt :: Int -> Word hashInt = $(whichHash [| Murmur.asWord32 . Murmur.hash32 |] [| Murmur.asWord64 . Murmur.hash64 |])
143
hashInt = $(whichHash [| Murmur.asWord32 . Murmur.hash32 |] [| Murmur.asWord64 . Murmur.hash64 |])
120
false
true
0
8
39
37
19
18
null
null
abhinav/kafka-client
examples/consoleProducer.hs
mit
whileM_ :: Monad m => m Bool -> m a -> m () whileM_ cond action = loop where loop = do x <- cond when x (action >> loop)
142
whileM_ :: Monad m => m Bool -> m a -> m () whileM_ cond action = loop where loop = do x <- cond when x (action >> loop)
142
whileM_ cond action = loop where loop = do x <- cond when x (action >> loop)
98
false
true
0
9
51
72
33
39
null
null
paolino/marionetta
Math.hs
bsd-3-clause
pointOfOnlyRotation :: (Punto,Angolo) -> (Punto,Angolo) -> Punto pointOfOnlyRotation (p1,alpha1) (p2,alpha2) = let dp@(Punto (dpx,dpy)) = p2 - p1 s = modulus (p2 - p1) x = Punto (s/2 , 0) y = Punto (0, s / 2 / tan (alpha / 2)) alpha = alpha2 - alpha1 beta = atan2 dpy dpx in ruota beta (y - x) + p2
328
pointOfOnlyRotation :: (Punto,Angolo) -> (Punto,Angolo) -> Punto pointOfOnlyRotation (p1,alpha1) (p2,alpha2) = let dp@(Punto (dpx,dpy)) = p2 - p1 s = modulus (p2 - p1) x = Punto (s/2 , 0) y = Punto (0, s / 2 / tan (alpha / 2)) alpha = alpha2 - alpha1 beta = atan2 dpy dpx in ruota beta (y - x) + p2
328
pointOfOnlyRotation (p1,alpha1) (p2,alpha2) = let dp@(Punto (dpx,dpy)) = p2 - p1 s = modulus (p2 - p1) x = Punto (s/2 , 0) y = Punto (0, s / 2 / tan (alpha / 2)) alpha = alpha2 - alpha1 beta = atan2 dpy dpx in ruota beta (y - x) + p2
263
false
true
0
14
89
179
97
82
null
null
sphynx/hamisado
AI/Eval.hs
bsd-3-clause
playerCoeff White = -1
22
playerCoeff White = -1
22
playerCoeff White = -1
22
false
false
1
5
3
14
5
9
null
null
NCrashed/servant-auth-token
example/persistent/src/Main.hs
bsd-3-clause
-- | Execute server with given options runServer :: Options -> IO () runServer Options{..} = do cfg <- readConfig configPath runExampleServer cfg
149
runServer :: Options -> IO () runServer Options{..} = do cfg <- readConfig configPath runExampleServer cfg
110
runServer Options{..} = do cfg <- readConfig configPath runExampleServer cfg
80
true
true
3
6
26
41
22
19
null
null
luigy/stack
src/main/Main.hs
bsd-3-clause
withBuildConfigAndLock :: GlobalOpts -> (Maybe FileLock -> StackT EnvConfig IO ()) -> IO () withBuildConfigAndLock go inner = withBuildConfigExt go Nothing inner Nothing
207
withBuildConfigAndLock :: GlobalOpts -> (Maybe FileLock -> StackT EnvConfig IO ()) -> IO () withBuildConfigAndLock go inner = withBuildConfigExt go Nothing inner Nothing
207
withBuildConfigAndLock go inner = withBuildConfigExt go Nothing inner Nothing
81
false
true
0
11
60
65
28
37
null
null
rueshyna/gogol
gogol-gmail/gen/Network/Google/Gmail/Types/Product.hs
mpl-2.0
-- | The port of the SMTP service. Required. smPort :: Lens' SmtpMsa (Maybe Int32) smPort = lens _smPort (\ s a -> s{_smPort = a}) . mapping _Coerce
156
smPort :: Lens' SmtpMsa (Maybe Int32) smPort = lens _smPort (\ s a -> s{_smPort = a}) . mapping _Coerce
111
smPort = lens _smPort (\ s a -> s{_smPort = a}) . mapping _Coerce
73
true
true
0
10
36
55
28
27
null
null
anttisalonen/freekick
haskell/libfreekick/Freekick/Libmatch/SoccerPhysics.hs
agpl-3.0
lookaheadTimeCoefficient :: Float lookaheadTimeCoefficient = 0.2
64
lookaheadTimeCoefficient :: Float lookaheadTimeCoefficient = 0.2
64
lookaheadTimeCoefficient = 0.2
30
false
true
0
4
5
11
6
5
null
null
pushkinma/frag
src/BSP.hs
gpl-2.0
------------------------------------------------------------------------------ -- lump directory indices -- Stores texture information kTextures :: Int kTextures = 1
170
kTextures :: Int kTextures = 1
33
kTextures = 1
16
true
true
0
4
19
14
9
5
null
null
fpco/store
src/Data/Store/Version.hs
mit
displayVersionError :: StoreVersion -> StoreVersion -> String displayVersionError expectedVersion receivedVersion = "Mismatch detected by Data.Store.Version - expected " ++ T.unpack (decodeUtf8With lenientDecode (unStoreVersion expectedVersion)) ++ " but got " ++ T.unpack (decodeUtf8With lenientDecode (unStoreVersion receivedVersion))
348
displayVersionError :: StoreVersion -> StoreVersion -> String displayVersionError expectedVersion receivedVersion = "Mismatch detected by Data.Store.Version - expected " ++ T.unpack (decodeUtf8With lenientDecode (unStoreVersion expectedVersion)) ++ " but got " ++ T.unpack (decodeUtf8With lenientDecode (unStoreVersion receivedVersion))
348
displayVersionError expectedVersion receivedVersion = "Mismatch detected by Data.Store.Version - expected " ++ T.unpack (decodeUtf8With lenientDecode (unStoreVersion expectedVersion)) ++ " but got " ++ T.unpack (decodeUtf8With lenientDecode (unStoreVersion receivedVersion))
286
false
true
0
10
46
80
37
43
null
null
acowley/ghc
compiler/hsSyn/HsDecls.hs
bsd-3-clause
lvectDeclName :: NamedThing name => LVectDecl name -> Name lvectDeclName (L _ (HsVect _ (L _ name) _)) = getName name
126
lvectDeclName :: NamedThing name => LVectDecl name -> Name lvectDeclName (L _ (HsVect _ (L _ name) _)) = getName name
126
lvectDeclName (L _ (HsVect _ (L _ name) _)) = getName name
67
false
true
0
11
29
57
27
30
null
null
alphalambda/codeworld
codeworld-compiler/test/testcases/listTupleMismatch/source.hs
apache-2.0
{- Copyright 2019 The CodeWorld Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -} program = drawingOf(polyline[start, end])
651
program = drawingOf(polyline[start, end])
41
program = drawingOf(polyline[start, end])
41
true
false
0
8
118
22
12
10
null
null
nevrenato/HetsAlloy
Syntax/ToXml.hs
gpl-2.0
libItem :: LogicGraph -> GlobalAnnos -> LIB_ITEM -> Element libItem lg ga li = case li of Spec_defn n g as rg -> add_attrs (mkNameAttr (iriToStr n) : rgAttrs rg) $ unode "SpecDefn" $ genericity lg ga g ++ [annoted spec lg ga as] View_defn n g (View_type from to _) mapping rg -> add_attrs (mkNameAttr (iriToStr n) : rgAttrs rg) $ unode "ViewDefn" $ genericity lg ga g ++ [ unode "Source" $ annoted spec lg ga from , unode "Target" $ annoted spec lg ga to ] ++ concatMap (gmapping ga) mapping Download_items n mapping rg -> add_attrs (mkNameAttr (show $ getLibId n) : rgAttrs rg) $ unode "Import" $ downloadItems mapping Logic_decl n rg -> add_attrs (mkNameAttr (showDoc n "") : rgAttrs rg) $ unode "Logic" () _ -> unsupported lg ga li
811
libItem :: LogicGraph -> GlobalAnnos -> LIB_ITEM -> Element libItem lg ga li = case li of Spec_defn n g as rg -> add_attrs (mkNameAttr (iriToStr n) : rgAttrs rg) $ unode "SpecDefn" $ genericity lg ga g ++ [annoted spec lg ga as] View_defn n g (View_type from to _) mapping rg -> add_attrs (mkNameAttr (iriToStr n) : rgAttrs rg) $ unode "ViewDefn" $ genericity lg ga g ++ [ unode "Source" $ annoted spec lg ga from , unode "Target" $ annoted spec lg ga to ] ++ concatMap (gmapping ga) mapping Download_items n mapping rg -> add_attrs (mkNameAttr (show $ getLibId n) : rgAttrs rg) $ unode "Import" $ downloadItems mapping Logic_decl n rg -> add_attrs (mkNameAttr (showDoc n "") : rgAttrs rg) $ unode "Logic" () _ -> unsupported lg ga li
811
libItem lg ga li = case li of Spec_defn n g as rg -> add_attrs (mkNameAttr (iriToStr n) : rgAttrs rg) $ unode "SpecDefn" $ genericity lg ga g ++ [annoted spec lg ga as] View_defn n g (View_type from to _) mapping rg -> add_attrs (mkNameAttr (iriToStr n) : rgAttrs rg) $ unode "ViewDefn" $ genericity lg ga g ++ [ unode "Source" $ annoted spec lg ga from , unode "Target" $ annoted spec lg ga to ] ++ concatMap (gmapping ga) mapping Download_items n mapping rg -> add_attrs (mkNameAttr (show $ getLibId n) : rgAttrs rg) $ unode "Import" $ downloadItems mapping Logic_decl n rg -> add_attrs (mkNameAttr (showDoc n "") : rgAttrs rg) $ unode "Logic" () _ -> unsupported lg ga li
751
false
true
0
17
212
346
160
186
null
null
capitanbatata/apath-slfp
competent/gadts/src/GenericTraversalsWithoutPoly.hs
gpl-3.0
-- | And here is where you need the higher rank! -- -- In this case we have: -- -- > imap :: (Type t -> t -> t) -> (Type t -> t -> t) -- > f :: Type t -> t -> t -- > RList rt :: Type [a] -- > rt :: Type a -- -- This implies that @t ~ [a]@, since @RList rt@ is the first argument of the -- function @imap f@, @RList rt :: Type [a] ~ Type t@. -- -- This implies that f :: Type [a] -> [a] -> [a], so this means that we cannot -- apply @f rt @ to @x@, since @x :: a@. -- imap f (RList rt) (x:xs) = -- f rt x : f (RList rt) xs -- Note that this will work however: f (RList rt) xs
578
imap f (RList rt) (x:xs) = -- f rt x : f (RList rt) xs -- Note that this will work however: f (RList rt) xs
111
imap f (RList rt) (x:xs) = -- f rt x : f (RList rt) xs -- Note that this will work however: f (RList rt) xs
111
true
false
0
7
148
55
35
20
null
null
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/GPUShader5.hs
bsd-3-clause
gl_MAX_FRAGMENT_INTERPOLATION_OFFSET :: GLenum gl_MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C
92
gl_MAX_FRAGMENT_INTERPOLATION_OFFSET :: GLenum gl_MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C
92
gl_MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C
45
false
true
0
4
5
11
6
5
null
null
nikita-volkov/remotion
htf-test-suite/HTFTestSuite/CommunicationTests.hs
mit
logToConsole = traceIOWithTime . ("Server: " <>) . unpackText
61
logToConsole = traceIOWithTime . ("Server: " <>) . unpackText
61
logToConsole = traceIOWithTime . ("Server: " <>) . unpackText
61
false
false
0
7
8
18
10
8
null
null
necrobious/hS3
Network/AWS/Authentication.hs
bsd-3-clause
-- | Add an expiration date to a request. addExpirationToReq :: HTTP.HTTPRequest L.ByteString -> String -> HTTP.HTTPRequest L.ByteString addExpirationToReq r = addHeaderToReq r . HTTP.Header HTTP.HdrExpires
206
addExpirationToReq :: HTTP.HTTPRequest L.ByteString -> String -> HTTP.HTTPRequest L.ByteString addExpirationToReq r = addHeaderToReq r . HTTP.Header HTTP.HdrExpires
164
addExpirationToReq r = addHeaderToReq r . HTTP.Header HTTP.HdrExpires
69
true
true
0
8
25
51
24
27
null
null
msakai/icfpc2015
src/Play.hs
bsd-3-clause
initGameIO :: ProblemId -> SeedNo -> IO GameState initGameIO n sd = do { input <- readProblem ("problems/problem_"++show n++".json") ; case input of { Nothing -> error "not found the seed"; Just inp -> return (initGameStates inp phrases !! sd) } }
253
initGameIO :: ProblemId -> SeedNo -> IO GameState initGameIO n sd = do { input <- readProblem ("problems/problem_"++show n++".json") ; case input of { Nothing -> error "not found the seed"; Just inp -> return (initGameStates inp phrases !! sd) } }
253
initGameIO n sd = do { input <- readProblem ("problems/problem_"++show n++".json") ; case input of { Nothing -> error "not found the seed"; Just inp -> return (initGameStates inp phrases !! sd) } }
203
false
true
0
14
47
102
49
53
null
null
creadpag/twidge
Commands/Ls.hs
gpl-2.0
screenNameArgs args = case lookup "U" args of Nothing -> [] Just username -> [("screen_name", username)] -------------------------------------------------- -- lsrecent & friends --------------------------------------------------
239
screenNameArgs args = case lookup "U" args of Nothing -> [] Just username -> [("screen_name", username)] -------------------------------------------------- -- lsrecent & friends --------------------------------------------------
239
screenNameArgs args = case lookup "U" args of Nothing -> [] Just username -> [("screen_name", username)] -------------------------------------------------- -- lsrecent & friends --------------------------------------------------
239
false
false
3
7
32
49
25
24
null
null
ribag/ganeti-experiments
src/Ganeti/Constants.hs
gpl-2.0
opcodeReasonSrcPickup :: String opcodeReasonSrcPickup = _opcodeReasonSrcMasterd ++ ":pickup"
92
opcodeReasonSrcPickup :: String opcodeReasonSrcPickup = _opcodeReasonSrcMasterd ++ ":pickup"
92
opcodeReasonSrcPickup = _opcodeReasonSrcMasterd ++ ":pickup"
60
false
true
0
5
7
15
8
7
null
null