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
damoxc/ganeti
test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs
gpl-2.0
-- | Function to serialize LispConfigs in such a way that they can be rebuilt -- again by the lispConfigParser. serializeConf :: LispConfig -> String serializeConf (LCList c) = "(" ++ unwords (map serializeConf c) ++ ")"
220
serializeConf :: LispConfig -> String serializeConf (LCList c) = "(" ++ unwords (map serializeConf c) ++ ")"
108
serializeConf (LCList c) = "(" ++ unwords (map serializeConf c) ++ ")"
70
true
true
0
9
36
49
24
25
null
null
rudymatela/leancheck
test/types.hs
bsd-3-clause
(x:xs) `permutation` ys = x `elem` ys && xs `permutation` delete x ys
74
(x:xs) `permutation` ys = x `elem` ys && xs `permutation` delete x ys
74
(x:xs) `permutation` ys = x `elem` ys && xs `permutation` delete x ys
74
false
false
0
7
17
42
23
19
null
null
anttisalonen/freekick2
src/Match/State/MatchState.hs
gpl-3.0
getRestartPoint (GoalKick r) = r
32
getRestartPoint (GoalKick r) = r
32
getRestartPoint (GoalKick r) = r
32
false
false
0
7
4
15
7
8
null
null
chpatrick/codec
src/Control/Monad/Codec.hs
bsd-3-clause
-- | Modify a serializer function so that it also returns the serialized value, -- Useful for implementing codecs. fmapArg :: Functor f => (a -> f ()) -> a -> f a fmapArg f x = x <$ f x
185
fmapArg :: Functor f => (a -> f ()) -> a -> f a fmapArg f x = x <$ f x
70
fmapArg f x = x <$ f x
22
true
true
2
11
40
61
28
33
null
null
jhance/gba-hs
src/Game/GBA/Memory.hs
mit
-- | Write to a virtual address. (in 8-bit mode) writeVirtual8 :: VirtualAddress -> Word8 -> GBA s () writeVirtual8 addr = case M.lookup addr writeMap of Nothing -> writeReal8 $ virtual addr Just k -> case writeAction8 k of Nothing -> const $ error $ "memory fault: illegal 8-bit write at 0x" ++ showHex addr "" Just f -> f -- | Write to a virtual address. (in 16-bit mode)
410
writeVirtual8 :: VirtualAddress -> Word8 -> GBA s () writeVirtual8 addr = case M.lookup addr writeMap of Nothing -> writeReal8 $ virtual addr Just k -> case writeAction8 k of Nothing -> const $ error $ "memory fault: illegal 8-bit write at 0x" ++ showHex addr "" Just f -> f -- | Write to a virtual address. (in 16-bit mode)
361
writeVirtual8 addr = case M.lookup addr writeMap of Nothing -> writeReal8 $ virtual addr Just k -> case writeAction8 k of Nothing -> const $ error $ "memory fault: illegal 8-bit write at 0x" ++ showHex addr "" Just f -> f -- | Write to a virtual address. (in 16-bit mode)
308
true
true
0
13
107
103
49
54
null
null
aufheben/lambda-arduino
packages/hArduino-0.9/System/Hardware/Arduino/Parts/LCD.hs
mit
getController :: LCD -> Arduino LCDController getController lcd = do bs <- gets boardState err <- gets bailOut liftIO $ withMVar bs $ \bst -> case lcd `M.lookup` lcds bst of Nothing -> err ("hArduino: Cannot locate " ++ show lcd) [] Just ld -> return $ lcdController ld -- | Send a command to the LCD controller
389
getController :: LCD -> Arduino LCDController getController lcd = do bs <- gets boardState err <- gets bailOut liftIO $ withMVar bs $ \bst -> case lcd `M.lookup` lcds bst of Nothing -> err ("hArduino: Cannot locate " ++ show lcd) [] Just ld -> return $ lcdController ld -- | Send a command to the LCD controller
389
getController lcd = do bs <- gets boardState err <- gets bailOut liftIO $ withMVar bs $ \bst -> case lcd `M.lookup` lcds bst of Nothing -> err ("hArduino: Cannot locate " ++ show lcd) [] Just ld -> return $ lcdController ld -- | Send a command to the LCD controller
343
false
true
0
16
135
120
55
65
null
null
kojiromike/Idris-dev
src/Idris/Imports.hs
bsd-3-clause
-- | Get the index file name for a package name pkgIndex :: PkgName -> FilePath pkgIndex s = "00" ++ unPkgName s ++ "-idx.ibc"
126
pkgIndex :: PkgName -> FilePath pkgIndex s = "00" ++ unPkgName s ++ "-idx.ibc"
78
pkgIndex s = "00" ++ unPkgName s ++ "-idx.ibc"
46
true
true
4
7
24
38
16
22
null
null
utwente-fmt/scoop
src/StepPA.hs
bsd-3-clause
unfoldSummation :: Bool -> PSpecification -> ConfluentSummands -> DataSpec -> State -> Mapping -> (Variable,Type) -> [Constant] -> PSummand -> [Transition] unfoldSummation followConfluent spec confluent dataspec sourceState mapping (var,sort) [] summand = []
258
unfoldSummation :: Bool -> PSpecification -> ConfluentSummands -> DataSpec -> State -> Mapping -> (Variable,Type) -> [Constant] -> PSummand -> [Transition] unfoldSummation followConfluent spec confluent dataspec sourceState mapping (var,sort) [] summand = []
258
unfoldSummation followConfluent spec confluent dataspec sourceState mapping (var,sort) [] summand = []
102
false
true
0
16
32
94
48
46
null
null
GaloisInc/halvm-ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
pprParendExpr :: OutputableBndr id => HsExpr id -> SDoc pprParendExpr expr | hsExprNeedsParens expr = parens (pprExpr expr) | otherwise = pprExpr expr
167
pprParendExpr :: OutputableBndr id => HsExpr id -> SDoc pprParendExpr expr | hsExprNeedsParens expr = parens (pprExpr expr) | otherwise = pprExpr expr
167
pprParendExpr expr | hsExprNeedsParens expr = parens (pprExpr expr) | otherwise = pprExpr expr
111
false
true
1
8
39
56
25
31
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_MAX_SHININESS_NV :: GLenum gl_MAX_SHININESS_NV = 0x8504
58
gl_MAX_SHININESS_NV :: GLenum gl_MAX_SHININESS_NV = 0x8504
58
gl_MAX_SHININESS_NV = 0x8504
28
false
true
0
4
5
11
6
5
null
null
ahmadsalim/p3-tool
p3-tool/TVL/Pretty.hs
gpl-3.0
prettyAttributeValue (AvIs e) = text "is" <+> prettyExpr e
58
prettyAttributeValue (AvIs e) = text "is" <+> prettyExpr e
58
prettyAttributeValue (AvIs e) = text "is" <+> prettyExpr e
58
false
false
0
7
8
25
11
14
null
null
FranklinChen/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
intTyName (ITFixed sized) = "B" ++ show (nativeTyWidth sized)
61
intTyName (ITFixed sized) = "B" ++ show (nativeTyWidth sized)
61
intTyName (ITFixed sized) = "B" ++ show (nativeTyWidth sized)
61
false
false
0
8
8
29
13
16
null
null
kim/amazonka
amazonka-cloudsearch/gen/Network/AWS/CloudSearch/Types.hs
mpl-2.0
loSourceField :: Lens' LiteralOptions (Maybe Text) loSourceField = lens _loSourceField (\s a -> s { _loSourceField = a })
121
loSourceField :: Lens' LiteralOptions (Maybe Text) loSourceField = lens _loSourceField (\s a -> s { _loSourceField = a })
121
loSourceField = lens _loSourceField (\s a -> s { _loSourceField = a })
70
false
true
0
9
18
45
24
21
null
null
chrisdone/corebot
src/Main.hs
bsd-3-clause
ppalt :: Alt CoreBndr -> String ppalt (con,vars,exp) = ppcon con ++ concat (map (" "++) (map showppr vars)) ++ "→" ++ ppexp exp
127
ppalt :: Alt CoreBndr -> String ppalt (con,vars,exp) = ppcon con ++ concat (map (" "++) (map showppr vars)) ++ "→" ++ ppexp exp
127
ppalt (con,vars,exp) = ppcon con ++ concat (map (" "++) (map showppr vars)) ++ "→" ++ ppexp exp
95
false
true
0
12
23
71
36
35
null
null
acharal/parsec-prolog
src/Language/Prolog/Parser.hs
lgpl-3.0
opDirective1 _ = return ()
26
opDirective1 _ = return ()
26
opDirective1 _ = return ()
26
false
false
0
6
4
14
6
8
null
null
sinelaw/lamdu
Lamdu/Data/Expression/Infer/Conflicts.hs
gpl-3.0
inferWithConflicts :: Ord def => Infer.Loaded def a -> Infer.Node def -> State (Infer.Context def) ( Bool , Expr.Expression def (InferredWithConflicts def, a) ) inferWithConflicts loaded node = do (exprInferred, conflictsMap) <- mapStateT (toRes . runWriter) $ Infer.inferLoaded (Infer.InferActions reportConflict) loaded node let conflicts getRef x = getConflicts ((getRef . Infer.nRefs . Infer.iNode) x) conflictsMap toIWC x = InferredWithConflicts { iwcInferred = x , iwcValueConflicts = conflicts Infer.tvVal x , iwcTypeConflicts = conflicts Infer.tvType x } return ( Map.null $ unConflictMap conflictsMap , Lens.mapped . Lens._1 %~ toIWC $ exprInferred ) where toRes ((a, s), w) = Identity ((a, w), s)
798
inferWithConflicts :: Ord def => Infer.Loaded def a -> Infer.Node def -> State (Infer.Context def) ( Bool , Expr.Expression def (InferredWithConflicts def, a) ) inferWithConflicts loaded node = do (exprInferred, conflictsMap) <- mapStateT (toRes . runWriter) $ Infer.inferLoaded (Infer.InferActions reportConflict) loaded node let conflicts getRef x = getConflicts ((getRef . Infer.nRefs . Infer.iNode) x) conflictsMap toIWC x = InferredWithConflicts { iwcInferred = x , iwcValueConflicts = conflicts Infer.tvVal x , iwcTypeConflicts = conflicts Infer.tvType x } return ( Map.null $ unConflictMap conflictsMap , Lens.mapped . Lens._1 %~ toIWC $ exprInferred ) where toRes ((a, s), w) = Identity ((a, w), s)
798
inferWithConflicts loaded node = do (exprInferred, conflictsMap) <- mapStateT (toRes . runWriter) $ Infer.inferLoaded (Infer.InferActions reportConflict) loaded node let conflicts getRef x = getConflicts ((getRef . Infer.nRefs . Infer.iNode) x) conflictsMap toIWC x = InferredWithConflicts { iwcInferred = x , iwcValueConflicts = conflicts Infer.tvVal x , iwcTypeConflicts = conflicts Infer.tvType x } return ( Map.null $ unConflictMap conflictsMap , Lens.mapped . Lens._1 %~ toIWC $ exprInferred ) where toRes ((a, s), w) = Identity ((a, w), s)
627
false
true
0
16
192
280
142
138
null
null
kajigor/uKanren_transformations
src/Util/ToProlog.hs
bsd-3-clause
sepRules (x@((n,_),_):xs) = let (g,r) = partition ((n==) . fst . fst) xs in (x:g) : sepRules r
122
sepRules (x@((n,_),_):xs) = let (g,r) = partition ((n==) . fst . fst) xs in (x:g) : sepRules r
122
sepRules (x@((n,_),_):xs) = let (g,r) = partition ((n==) . fst . fst) xs in (x:g) : sepRules r
122
false
false
0
13
45
83
45
38
null
null
cartazio/omega
src/PrimParser.hs
bsd-3-clause
backwards :: V -> (V -> V) backwards fun v = help ((getf fun) v) where help (FIO w) = case unsafePerformIO w of Ok (v@(Vlazy _ _)) -> help(analyzeWith return v) Ok v -> v Fail loc _ _ mess -> error("Near "++show loc++"\n"++mess) getf (Vf f _ _) = f getf (Vprimfun _ f) = f getf v = error ("Not function in backwards: "++ show v) {- instance Encoding (Operator V) where to (Infix p x) = Vcon (Global "Infix",Ox) [to p,to x] to (Prefix p) = Vcon (Global "Prefix",Ox) [to p] to (Postfix p) = Vcon (Global "Postfix",Ox) [to p] from (Vcon (Global "Infix",_) [p,x]) = Infix (from p) (from x) from (Vcon (Global "Prefix",_) [p]) = Prefix (from p) from (Vcon (Global "Postfix",_) [p]) = Postfix (from p) from v = error ("Not an Operator: "++(show v)) -}
854
backwards :: V -> (V -> V) backwards fun v = help ((getf fun) v) where help (FIO w) = case unsafePerformIO w of Ok (v@(Vlazy _ _)) -> help(analyzeWith return v) Ok v -> v Fail loc _ _ mess -> error("Near "++show loc++"\n"++mess) getf (Vf f _ _) = f getf (Vprimfun _ f) = f getf v = error ("Not function in backwards: "++ show v) {- instance Encoding (Operator V) where to (Infix p x) = Vcon (Global "Infix",Ox) [to p,to x] to (Prefix p) = Vcon (Global "Prefix",Ox) [to p] to (Postfix p) = Vcon (Global "Postfix",Ox) [to p] from (Vcon (Global "Infix",_) [p,x]) = Infix (from p) (from x) from (Vcon (Global "Prefix",_) [p]) = Prefix (from p) from (Vcon (Global "Postfix",_) [p]) = Postfix (from p) from v = error ("Not an Operator: "++(show v)) -}
854
backwards fun v = help ((getf fun) v) where help (FIO w) = case unsafePerformIO w of Ok (v@(Vlazy _ _)) -> help(analyzeWith return v) Ok v -> v Fail loc _ _ mess -> error("Near "++show loc++"\n"++mess) getf (Vf f _ _) = f getf (Vprimfun _ f) = f getf v = error ("Not function in backwards: "++ show v) {- instance Encoding (Operator V) where to (Infix p x) = Vcon (Global "Infix",Ox) [to p,to x] to (Prefix p) = Vcon (Global "Prefix",Ox) [to p] to (Postfix p) = Vcon (Global "Postfix",Ox) [to p] from (Vcon (Global "Infix",_) [p,x]) = Infix (from p) (from x) from (Vcon (Global "Prefix",_) [p]) = Prefix (from p) from (Vcon (Global "Postfix",_) [p]) = Postfix (from p) from v = error ("Not an Operator: "++(show v)) -}
827
false
true
3
14
251
202
99
103
null
null
dec9ue/jhc_copygc
src/Interactive.hs
gpl-2.0
nameTag _ = '?'
15
nameTag _ = '?'
15
nameTag _ = '?'
15
false
false
0
4
3
10
4
6
null
null
GaloisInc/ivory
ivory/src/Ivory/Language/Syntax/Concrete/QQ/ExprQQ.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- Expressions -- | Top-level constant definition. fromConstDef :: ConstDef -> Q [Dec] fromConstDef def = case def of #if __GLASGOW_HASKELL__ >= 709 ConstDef sym e mtype srcloc -> do n <- newName sym let def' = ValD (VarP n) (NormalB $ toExp [] e) [] case mtype of Nothing -> return [def'] Just ty -> do tyQ <- runToQ (fromType ty) -- Ignore possible type variables---should be any for a -- top-level constant. ln <- lnPragma srcloc return (ln ++ [SigD n (fst tyQ), def']) #else ConstDef sym e mtype _srcloc -> do n <- newName sym let d = ValD (VarP n) (NormalB $ toExp [] e) [] case mtype of Nothing -> return [d] Just ty -> do tyQ <- runToQ (fromType ty) -- Ignore possible type variables---should be any for a -- top-level constant. return [SigD n (fst tyQ), d] #endif
1,045
fromConstDef :: ConstDef -> Q [Dec] fromConstDef def = case def of #if __GLASGOW_HASKELL__ >= 709 ConstDef sym e mtype srcloc -> do n <- newName sym let def' = ValD (VarP n) (NormalB $ toExp [] e) [] case mtype of Nothing -> return [def'] Just ty -> do tyQ <- runToQ (fromType ty) -- Ignore possible type variables---should be any for a -- top-level constant. ln <- lnPragma srcloc return (ln ++ [SigD n (fst tyQ), def']) #else ConstDef sym e mtype _srcloc -> do n <- newName sym let d = ValD (VarP n) (NormalB $ toExp [] e) [] case mtype of Nothing -> return [d] Just ty -> do tyQ <- runToQ (fromType ty) -- Ignore possible type variables---should be any for a -- top-level constant. return [SigD n (fst tyQ), d] #endif
912
fromConstDef def = case def of #if __GLASGOW_HASKELL__ >= 709 ConstDef sym e mtype srcloc -> do n <- newName sym let def' = ValD (VarP n) (NormalB $ toExp [] e) [] case mtype of Nothing -> return [def'] Just ty -> do tyQ <- runToQ (fromType ty) -- Ignore possible type variables---should be any for a -- top-level constant. ln <- lnPragma srcloc return (ln ++ [SigD n (fst tyQ), def']) #else ConstDef sym e mtype _srcloc -> do n <- newName sym let d = ValD (VarP n) (NormalB $ toExp [] e) [] case mtype of Nothing -> return [d] Just ty -> do tyQ <- runToQ (fromType ty) -- Ignore possible type variables---should be any for a -- top-level constant. return [SigD n (fst tyQ), d] #endif
876
true
true
0
21
338
182
89
93
null
null
kylcarte/wangtiles
src/Data/Points.hs
bsd-3-clause
zipWithV2 :: (Additive f) => (a -> b -> c) -> f a -> f b -> f c zipWithV2 = liftI2
82
zipWithV2 :: (Additive f) => (a -> b -> c) -> f a -> f b -> f c zipWithV2 = liftI2
82
zipWithV2 = liftI2
18
false
true
0
10
21
58
27
31
null
null
rahulmutt/ghcvm
libraries/base/GHC/Foreign.hs
bsd-3-clause
-- exported functions -- ------------------ -- | Marshal a NUL terminated C string into a Haskell string. -- peekCString :: TextEncoding -> CString -> IO String peekCString enc cp = do sz <- lengthArray0 nUL cp peekEncodedCString enc (cp, sz * cCharSize) -- | Marshal a C string with explicit length into a Haskell string. --
338
peekCString :: TextEncoding -> CString -> IO String peekCString enc cp = do sz <- lengthArray0 nUL cp peekEncodedCString enc (cp, sz * cCharSize) -- | Marshal a C string with explicit length into a Haskell string. --
228
peekCString enc cp = do sz <- lengthArray0 nUL cp peekEncodedCString enc (cp, sz * cCharSize) -- | Marshal a C string with explicit length into a Haskell string. --
173
true
true
0
9
68
63
33
30
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/fromDouble_1.hs
mit
primMulInt :: MyInt -> MyInt -> MyInt; primMulInt (Pos x) (Pos y) = Pos (primMulNat x y)
92
primMulInt :: MyInt -> MyInt -> MyInt primMulInt (Pos x) (Pos y) = Pos (primMulNat x y)
91
primMulInt (Pos x) (Pos y) = Pos (primMulNat x y)
49
false
true
1
10
20
54
25
29
null
null
kmate/HaRe
old/testing/simplifyExpr/GuardsIn2.hs
bsd-3-clause
p x@(y:ys) = case x of [] -> error "Error!" (x:xs) -> x
83
p x@(y:ys) = case x of [] -> error "Error!" (x:xs) -> x
83
p x@(y:ys) = case x of [] -> error "Error!" (x:xs) -> x
83
false
false
1
9
40
53
24
29
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/ContentCategories/Delete.hs
mpl-2.0
-- | JSONP ccdCallback :: Lens' ContentCategoriesDelete (Maybe Text) ccdCallback = lens _ccdCallback (\ s a -> s{_ccdCallback = a})
133
ccdCallback :: Lens' ContentCategoriesDelete (Maybe Text) ccdCallback = lens _ccdCallback (\ s a -> s{_ccdCallback = a})
122
ccdCallback = lens _ccdCallback (\ s a -> s{_ccdCallback = a})
64
true
true
0
9
21
48
25
23
null
null
keera-studios/hsQt
Qtc/Core/QCoreApplication.hs
bsd-2-clause
qCoreApplicationClosingDown :: (()) -> IO (Bool) qCoreApplicationClosingDown () = withBoolResult $ qtc_QCoreApplication_closingDown
137
qCoreApplicationClosingDown :: (()) -> IO (Bool) qCoreApplicationClosingDown () = withBoolResult $ qtc_QCoreApplication_closingDown
137
qCoreApplicationClosingDown () = withBoolResult $ qtc_QCoreApplication_closingDown
88
false
true
0
7
17
35
18
17
null
null
vrom911/Compiler
src/Compiler/Rum/Compiler/Emitter.hs
mit
cgenExpr Rum.LogicOper{..} = case Map.lookup lop logicOps of Just f -> cgenExpr l >>= \x -> cgenExpr r >>= \y -> f x y Nothing -> error "No such logic operator"
171
cgenExpr Rum.LogicOper{..} = case Map.lookup lop logicOps of Just f -> cgenExpr l >>= \x -> cgenExpr r >>= \y -> f x y Nothing -> error "No such logic operator"
171
cgenExpr Rum.LogicOper{..} = case Map.lookup lop logicOps of Just f -> cgenExpr l >>= \x -> cgenExpr r >>= \y -> f x y Nothing -> error "No such logic operator"
171
false
false
0
12
41
75
35
40
null
null
edsko/JsonGrammar2
src/Language/JsonGrammar/TypeScript.hs
bsd-3-clause
toType :: GrammarMap -> Grammar Val t1 t2 -> Maybe Type toType gm = go where go :: Grammar Val t1 t2 -> Maybe Type go = \case Id -> Nothing g1 :. g2 -> -- Produce the leftmost grammar case go g1 of Just ty -> Just ty Nothing -> go g2 Empty -> Nothing g1 :<> g2 -> unify <$> go g1 <*> go g2 Pure _ _ -> Nothing Many g -> go g Literal v -> Just (valueType v) Label n _ -> Just (TypeReference (TypeRef (TypeName Nothing (T.unpack n)) Nothing)) Object g -> let toSig (n, (opt, ty)) = (emptyComment, PropertySignature (T.unpack n) opt (Just ty)) in Just (ObjectType (TypeBody (map toSig (H.toList (toProperties gm g))))) Array g -> ArrayType <$> toElementType gm g Coerce ty _ -> Just ty
831
toType :: GrammarMap -> Grammar Val t1 t2 -> Maybe Type toType gm = go where go :: Grammar Val t1 t2 -> Maybe Type go = \case Id -> Nothing g1 :. g2 -> -- Produce the leftmost grammar case go g1 of Just ty -> Just ty Nothing -> go g2 Empty -> Nothing g1 :<> g2 -> unify <$> go g1 <*> go g2 Pure _ _ -> Nothing Many g -> go g Literal v -> Just (valueType v) Label n _ -> Just (TypeReference (TypeRef (TypeName Nothing (T.unpack n)) Nothing)) Object g -> let toSig (n, (opt, ty)) = (emptyComment, PropertySignature (T.unpack n) opt (Just ty)) in Just (ObjectType (TypeBody (map toSig (H.toList (toProperties gm g))))) Array g -> ArrayType <$> toElementType gm g Coerce ty _ -> Just ty
831
toType gm = go where go :: Grammar Val t1 t2 -> Maybe Type go = \case Id -> Nothing g1 :. g2 -> -- Produce the leftmost grammar case go g1 of Just ty -> Just ty Nothing -> go g2 Empty -> Nothing g1 :<> g2 -> unify <$> go g1 <*> go g2 Pure _ _ -> Nothing Many g -> go g Literal v -> Just (valueType v) Label n _ -> Just (TypeReference (TypeRef (TypeName Nothing (T.unpack n)) Nothing)) Object g -> let toSig (n, (opt, ty)) = (emptyComment, PropertySignature (T.unpack n) opt (Just ty)) in Just (ObjectType (TypeBody (map toSig (H.toList (toProperties gm g))))) Array g -> ArrayType <$> toElementType gm g Coerce ty _ -> Just ty
775
false
true
2
20
283
353
168
185
null
null
chriseidhof/Basil
src/Basil/Data/TBoolean.hs
bsd-3-clause
tOr :: TBool x -> TBool y -> TBool (Or x y) tOr = undefined
59
tOr :: TBool x -> TBool y -> TBool (Or x y) tOr = undefined
59
tOr = undefined
15
false
true
0
10
14
42
18
24
null
null
ingemaradahl/bilder
src/TypeChecker/Renamer.hs
lgpl-3.0
renameExp (EIndexDouble cid e1 e2) = setCIdentAssigned cid >> EIndexDouble <$> renameCIdent cid <*> renameExp e1 <*> renameExp e2
129
renameExp (EIndexDouble cid e1 e2) = setCIdentAssigned cid >> EIndexDouble <$> renameCIdent cid <*> renameExp e1 <*> renameExp e2
129
renameExp (EIndexDouble cid e1 e2) = setCIdentAssigned cid >> EIndexDouble <$> renameCIdent cid <*> renameExp e1 <*> renameExp e2
129
false
false
0
9
18
47
21
26
null
null
damianfral/clay
src/Clay/Geometry.hs
bsd-3-clause
marginRight = key "margin-right"
34
marginRight = key "margin-right"
34
marginRight = key "margin-right"
34
false
false
0
5
5
9
4
5
null
null
vTurbine/ghc
compiler/basicTypes/RdrName.hs
bsd-3-clause
lookupGRE_RdrName :: RdrName -> GlobalRdrEnv -> [GlobalRdrElt] lookupGRE_RdrName rdr_name env = case lookupOccEnv env (rdrNameOcc rdr_name) of Nothing -> [] Just gres -> pickGREs rdr_name gres
204
lookupGRE_RdrName :: RdrName -> GlobalRdrEnv -> [GlobalRdrElt] lookupGRE_RdrName rdr_name env = case lookupOccEnv env (rdrNameOcc rdr_name) of Nothing -> [] Just gres -> pickGREs rdr_name gres
204
lookupGRE_RdrName rdr_name env = case lookupOccEnv env (rdrNameOcc rdr_name) of Nothing -> [] Just gres -> pickGREs rdr_name gres
141
false
true
0
9
37
69
32
37
null
null
ku-fpg/remote-monad-examples
classic-examples/Applicative/Main.hs
bsd-3-clause
isCommand (Procedure _) = False
31
isCommand (Procedure _) = False
31
isCommand (Procedure _) = False
31
false
false
0
7
4
15
7
8
null
null
apyrgio/snf-ganeti
test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs
bsd-2-clause
isAlmostEqual (LCDouble d1) (LCDouble d2) = printTestCase msg $ rel <= 1e-12 where rel = relativeError d1 d2 msg = "Relative error " ++ show rel ++ " not smaller than 1e-12\n" ++ "expected: " ++ show d2 ++ "\n but got: " ++ show d1
261
isAlmostEqual (LCDouble d1) (LCDouble d2) = printTestCase msg $ rel <= 1e-12 where rel = relativeError d1 d2 msg = "Relative error " ++ show rel ++ " not smaller than 1e-12\n" ++ "expected: " ++ show d2 ++ "\n but got: " ++ show d1
261
isAlmostEqual (LCDouble d1) (LCDouble d2) = printTestCase msg $ rel <= 1e-12 where rel = relativeError d1 d2 msg = "Relative error " ++ show rel ++ " not smaller than 1e-12\n" ++ "expected: " ++ show d2 ++ "\n but got: " ++ show d1
261
false
false
2
11
75
89
40
49
null
null
typelead/epm
Cabal/Distribution/Version.hs
bsd-3-clause
isVersion0 :: Version -> Bool isVersion0 (Version [0] _) = True
63
isVersion0 :: Version -> Bool isVersion0 (Version [0] _) = True
63
isVersion0 (Version [0] _) = True
33
false
true
0
10
10
35
16
19
null
null
Javran/misc
gaussian-elim/src/Solver.hs
mit
solveMat :: Integral i => i -> [[i]] -> Either (Err i) [i] solveMat = solveMat' (\_ _ -> Left Underdetermined)
110
solveMat :: Integral i => i -> [[i]] -> Either (Err i) [i] solveMat = solveMat' (\_ _ -> Left Underdetermined)
110
solveMat = solveMat' (\_ _ -> Left Underdetermined)
51
false
true
0
11
20
68
33
35
null
null
benekastah/tj
lib/TJ/CodeGen.hs
mit
functionBlock (EStatement (SBlock exprs)) = SBlock $ returnLast exprs
69
functionBlock (EStatement (SBlock exprs)) = SBlock $ returnLast exprs
69
functionBlock (EStatement (SBlock exprs)) = SBlock $ returnLast exprs
69
false
false
0
8
8
29
13
16
null
null
d0kt0r0/estuary
client/src/Estuary/Help/MiniTidal.hs
gpl-3.0
referenceText "vowel"= "turns a Text pattern into a control pattern that creates a formant filter to produce vowel sounds on samples. Use values a, e, i, o, and u to add the effect."
182
referenceText "vowel"= "turns a Text pattern into a control pattern that creates a formant filter to produce vowel sounds on samples. Use values a, e, i, o, and u to add the effect."
182
referenceText "vowel"= "turns a Text pattern into a control pattern that creates a formant filter to produce vowel sounds on samples. Use values a, e, i, o, and u to add the effect."
182
false
false
0
5
32
9
4
5
null
null
GaloisInc/halvm-ghc
compiler/utils/Outputable.hs
bsd-3-clause
-- | @doublePrec p n@ shows a floating point number @n@ with @p@ -- digits of precision after the decimal point. doublePrec :: Int -> Double -> SDoc doublePrec p n = text (showFFloat (Just p) n "")
197
doublePrec :: Int -> Double -> SDoc doublePrec p n = text (showFFloat (Just p) n "")
84
doublePrec p n = text (showFFloat (Just p) n "")
48
true
true
0
9
37
45
23
22
null
null
NCrashed/sinister
src/client/Graphics/Render/Quad.hs
mit
quadWithNormal :: Camera2D -- ^ Camera -- | Diffuse texture -> Texture2D RGBAFormat -- | Normal texture -> Texture2D RGBAFormat -- | Ambient color, alpha is entensity -> Vec4 Float -- | Color modifier, alpha is intensity -> Vec4 Float -- | Lights that is used for enlighting -> [Light Float] -- | Translation in world -> Vec2 Float -- | Rotation in world -> Float -- | Depth (Z coordinate) -> Float -- | Size of viewport -> Vec2 Int -- | Fragments -> FragmentStream (Color RGBAFormat (Fragment Float), FragmentDepth) quadWithNormal cam2d@(Camera2D cam) tex ntex ambient clr lights trans2d rot2d depth size = storeDepth . texturise <$> rasterizeFront (transform <$> screenQuad depth) where storeDepth = (, fragDepth) vpMat = vpMatrix cam size vpMatInv = fromMaybe Vec.identity . Vec.invert $ vpMat transform = cameraTransform2D cam2d trans2d rot2d size texturise = enlightNormal size tex ntex ambient clr lights vpMatInv
987
quadWithNormal :: Camera2D -- ^ Camera -- | Diffuse texture -> Texture2D RGBAFormat -- | Normal texture -> Texture2D RGBAFormat -- | Ambient color, alpha is entensity -> Vec4 Float -- | Color modifier, alpha is intensity -> Vec4 Float -- | Lights that is used for enlighting -> [Light Float] -- | Translation in world -> Vec2 Float -- | Rotation in world -> Float -- | Depth (Z coordinate) -> Float -- | Size of viewport -> Vec2 Int -- | Fragments -> FragmentStream (Color RGBAFormat (Fragment Float), FragmentDepth) quadWithNormal cam2d@(Camera2D cam) tex ntex ambient clr lights trans2d rot2d depth size = storeDepth . texturise <$> rasterizeFront (transform <$> screenQuad depth) where storeDepth = (, fragDepth) vpMat = vpMatrix cam size vpMatInv = fromMaybe Vec.identity . Vec.invert $ vpMat transform = cameraTransform2D cam2d trans2d rot2d size texturise = enlightNormal size tex ntex ambient clr lights vpMatInv
987
quadWithNormal cam2d@(Camera2D cam) tex ntex ambient clr lights trans2d rot2d depth size = storeDepth . texturise <$> rasterizeFront (transform <$> screenQuad depth) where storeDepth = (, fragDepth) vpMat = vpMatrix cam size vpMatInv = fromMaybe Vec.identity . Vec.invert $ vpMat transform = cameraTransform2D cam2d trans2d rot2d size texturise = enlightNormal size tex ntex ambient clr lights vpMatInv
428
false
true
12
16
215
214
111
103
null
null
plclub/cis670-16fa
projects/DynamicLang/src/StaticEval.hs
mit
staticEval env (UniSnd e) = snd (staticEval env e)
50
staticEval env (UniSnd e) = snd (staticEval env e)
50
staticEval env (UniSnd e) = snd (staticEval env e)
50
false
false
0
7
8
28
13
15
null
null
lally/libmet
src/Ppt/Generate/CpPrim.hs
bsd-3-clause
-- |Make member declarations out of a single literal (layed out) input member. makeMember :: OutputCfg -> LayoutMember -> MemberData makeMember cfg mem | has (lKind . _LKSeqno) mem || has (lKind . _LKTypeDescrim) mem = let (LMember (PIntegral ty _) _ _ _ _ nm) = mem declType = case ty of PPInt -> "int" in PrivateMem (dataMember declType nm) [] [] | has (lKind . _LKPadding) mem = let (LMember (PIntegral PPByte _) _ _ _ (LKPadding n) nm) = mem in PrivateMem (dataMember "uint8_t" (nm ++ "[" ++ show n ++ "]")) ["cstdint"] [] | has (lKind . _LKMember) mem = let mt = mem ^. memPrim nm = mem ^. lName in case mt of PTime _ -> let timety = timeType cfg timeheaders = [timeHeader cfg] in MB [blockdecl cfg (PP.text $ "void snapshot_" ++ (mem ^. lName) ++ "()") PP.semi [ timeSave cfg nm]] (dataMember timety nm) timeheaders [] PCounter _ _ -> let maxCounterIdx = (counterCount cfg) - 1 indices = [0 .. maxCounterIdx] (LKMember frmem side) = mem ^. lKind baseName = fmName frmem bname = bufName cfg memSfx = if defaultInit cfg then "= 0" else "" elideDecls = case side of Nothing -> False Just (IntBegin 0 _) -> False Just (IntEnd 0 _) -> False _ -> True counterFor n = (case side of Nothing -> baseName ++ "_" ++ show n Just (IntBegin a b) -> baseName ++ (if b > 1 then "_" ++ show n else "") ++ "_start" Just (IntEnd a b) -> baseName ++ (if b > 1 then "_" ++ show n else "") ++ "_end") functionsBaseName = case side of Nothing -> baseName Just (IntBegin _ _) -> baseName ++ "_start" Just (IntEnd _ _) -> baseName ++ "_end" saveFn = let args = L.intercalate ", " $ map (\i -> "&" ++ (counterFor i)) $ indices static_savectrs = blockdecl cfg (PP.text $ "void snapshot_" ++ functionsBaseName ++ "()") PP.empty [ stmt $ "save_counters(" ++ args ++ ")"] in if nativeCounters cfg then let labelFor n = "__ppt_" ++ bname ++ "_" ++ nm ++ "_Load_" ++ show (n+1) ++ "_counters" pfxConds = [blockdecl cfg ( PP.text $ "if (_ppt_ctrl == nullptr || data_" ++ bname ++ "::ppt_counter_fd[0] < 1)") PP.empty [ stmt "return"], blockdecl cfg ( PP.text "if ((_ppt_ctrl->client_flags & PERF_CTR_NATIVE_ENABLED) == 0)") PP.empty [ stmt $ "save_counters(" ++ args ++ ")"] ] condFor n = blockdecl cfg (PP.text $ "if (data_" ++ bname ++ "::ppt_counter_fd[" ++ show n ++ "] > 0)") PP.empty [ stmt $ "goto " ++ labelFor n ] sfxCond = blockdecl cfg (PP.text "else") PP.empty [ stmt $ "goto " ++ labelFor 0 ] condCat conds = PP.vcat (head conds : (map (\c -> PP.text "else " <> c) $ tail conds)) loadFor n = [PP.text (labelFor n) <> ":", stmt $ "__asm__ volatile(\"rdpmc\" : \"=a\" (a), \"=d\" (d) : \"c\" (data_" ++ bname ++ "::ppt_counter_rcx[" ++ show n ++ "]))", stmt $ counterFor n ++ " = a | (static_cast<uint64_t>(d) << 32ULL)" ] revIndices = reverse indices in blockdecl cfg (PP.text $ "void snapshot_" ++ functionsBaseName ++ "()") PP.empty ( pfxConds ++ ( condCat (map condFor $ init revIndices) : sfxCond : stmt "uint32_t a,d":concatMap loadFor revIndices)) else static_savectrs headers = [ "sys/mman.h" | nativeCounters cfg ] in MB [saveFn | not elideDecls] (dataMember "uint64_t" (nm ++ memSfx)) headers [GMCounters] PRational ty _ -> let declType = case ty of PPDouble -> "double" PPFloat -> "float" memSfx = if defaultInit cfg then " = 0" else "" in MB [] (dataMember declType (nm ++ memSfx)) [] [] PIntegral ty _ -> let declType = case ty of PPByte -> "uint8_t" PPInt -> "int32_t" memSfx = if defaultInit cfg then " = 0" else "" in MB [] (dataMember declType (nm ++ memSfx)) [] []
5,165
makeMember :: OutputCfg -> LayoutMember -> MemberData makeMember cfg mem | has (lKind . _LKSeqno) mem || has (lKind . _LKTypeDescrim) mem = let (LMember (PIntegral ty _) _ _ _ _ nm) = mem declType = case ty of PPInt -> "int" in PrivateMem (dataMember declType nm) [] [] | has (lKind . _LKPadding) mem = let (LMember (PIntegral PPByte _) _ _ _ (LKPadding n) nm) = mem in PrivateMem (dataMember "uint8_t" (nm ++ "[" ++ show n ++ "]")) ["cstdint"] [] | has (lKind . _LKMember) mem = let mt = mem ^. memPrim nm = mem ^. lName in case mt of PTime _ -> let timety = timeType cfg timeheaders = [timeHeader cfg] in MB [blockdecl cfg (PP.text $ "void snapshot_" ++ (mem ^. lName) ++ "()") PP.semi [ timeSave cfg nm]] (dataMember timety nm) timeheaders [] PCounter _ _ -> let maxCounterIdx = (counterCount cfg) - 1 indices = [0 .. maxCounterIdx] (LKMember frmem side) = mem ^. lKind baseName = fmName frmem bname = bufName cfg memSfx = if defaultInit cfg then "= 0" else "" elideDecls = case side of Nothing -> False Just (IntBegin 0 _) -> False Just (IntEnd 0 _) -> False _ -> True counterFor n = (case side of Nothing -> baseName ++ "_" ++ show n Just (IntBegin a b) -> baseName ++ (if b > 1 then "_" ++ show n else "") ++ "_start" Just (IntEnd a b) -> baseName ++ (if b > 1 then "_" ++ show n else "") ++ "_end") functionsBaseName = case side of Nothing -> baseName Just (IntBegin _ _) -> baseName ++ "_start" Just (IntEnd _ _) -> baseName ++ "_end" saveFn = let args = L.intercalate ", " $ map (\i -> "&" ++ (counterFor i)) $ indices static_savectrs = blockdecl cfg (PP.text $ "void snapshot_" ++ functionsBaseName ++ "()") PP.empty [ stmt $ "save_counters(" ++ args ++ ")"] in if nativeCounters cfg then let labelFor n = "__ppt_" ++ bname ++ "_" ++ nm ++ "_Load_" ++ show (n+1) ++ "_counters" pfxConds = [blockdecl cfg ( PP.text $ "if (_ppt_ctrl == nullptr || data_" ++ bname ++ "::ppt_counter_fd[0] < 1)") PP.empty [ stmt "return"], blockdecl cfg ( PP.text "if ((_ppt_ctrl->client_flags & PERF_CTR_NATIVE_ENABLED) == 0)") PP.empty [ stmt $ "save_counters(" ++ args ++ ")"] ] condFor n = blockdecl cfg (PP.text $ "if (data_" ++ bname ++ "::ppt_counter_fd[" ++ show n ++ "] > 0)") PP.empty [ stmt $ "goto " ++ labelFor n ] sfxCond = blockdecl cfg (PP.text "else") PP.empty [ stmt $ "goto " ++ labelFor 0 ] condCat conds = PP.vcat (head conds : (map (\c -> PP.text "else " <> c) $ tail conds)) loadFor n = [PP.text (labelFor n) <> ":", stmt $ "__asm__ volatile(\"rdpmc\" : \"=a\" (a), \"=d\" (d) : \"c\" (data_" ++ bname ++ "::ppt_counter_rcx[" ++ show n ++ "]))", stmt $ counterFor n ++ " = a | (static_cast<uint64_t>(d) << 32ULL)" ] revIndices = reverse indices in blockdecl cfg (PP.text $ "void snapshot_" ++ functionsBaseName ++ "()") PP.empty ( pfxConds ++ ( condCat (map condFor $ init revIndices) : sfxCond : stmt "uint32_t a,d":concatMap loadFor revIndices)) else static_savectrs headers = [ "sys/mman.h" | nativeCounters cfg ] in MB [saveFn | not elideDecls] (dataMember "uint64_t" (nm ++ memSfx)) headers [GMCounters] PRational ty _ -> let declType = case ty of PPDouble -> "double" PPFloat -> "float" memSfx = if defaultInit cfg then " = 0" else "" in MB [] (dataMember declType (nm ++ memSfx)) [] [] PIntegral ty _ -> let declType = case ty of PPByte -> "uint8_t" PPInt -> "int32_t" memSfx = if defaultInit cfg then " = 0" else "" in MB [] (dataMember declType (nm ++ memSfx)) [] []
5,086
makeMember cfg mem | has (lKind . _LKSeqno) mem || has (lKind . _LKTypeDescrim) mem = let (LMember (PIntegral ty _) _ _ _ _ nm) = mem declType = case ty of PPInt -> "int" in PrivateMem (dataMember declType nm) [] [] | has (lKind . _LKPadding) mem = let (LMember (PIntegral PPByte _) _ _ _ (LKPadding n) nm) = mem in PrivateMem (dataMember "uint8_t" (nm ++ "[" ++ show n ++ "]")) ["cstdint"] [] | has (lKind . _LKMember) mem = let mt = mem ^. memPrim nm = mem ^. lName in case mt of PTime _ -> let timety = timeType cfg timeheaders = [timeHeader cfg] in MB [blockdecl cfg (PP.text $ "void snapshot_" ++ (mem ^. lName) ++ "()") PP.semi [ timeSave cfg nm]] (dataMember timety nm) timeheaders [] PCounter _ _ -> let maxCounterIdx = (counterCount cfg) - 1 indices = [0 .. maxCounterIdx] (LKMember frmem side) = mem ^. lKind baseName = fmName frmem bname = bufName cfg memSfx = if defaultInit cfg then "= 0" else "" elideDecls = case side of Nothing -> False Just (IntBegin 0 _) -> False Just (IntEnd 0 _) -> False _ -> True counterFor n = (case side of Nothing -> baseName ++ "_" ++ show n Just (IntBegin a b) -> baseName ++ (if b > 1 then "_" ++ show n else "") ++ "_start" Just (IntEnd a b) -> baseName ++ (if b > 1 then "_" ++ show n else "") ++ "_end") functionsBaseName = case side of Nothing -> baseName Just (IntBegin _ _) -> baseName ++ "_start" Just (IntEnd _ _) -> baseName ++ "_end" saveFn = let args = L.intercalate ", " $ map (\i -> "&" ++ (counterFor i)) $ indices static_savectrs = blockdecl cfg (PP.text $ "void snapshot_" ++ functionsBaseName ++ "()") PP.empty [ stmt $ "save_counters(" ++ args ++ ")"] in if nativeCounters cfg then let labelFor n = "__ppt_" ++ bname ++ "_" ++ nm ++ "_Load_" ++ show (n+1) ++ "_counters" pfxConds = [blockdecl cfg ( PP.text $ "if (_ppt_ctrl == nullptr || data_" ++ bname ++ "::ppt_counter_fd[0] < 1)") PP.empty [ stmt "return"], blockdecl cfg ( PP.text "if ((_ppt_ctrl->client_flags & PERF_CTR_NATIVE_ENABLED) == 0)") PP.empty [ stmt $ "save_counters(" ++ args ++ ")"] ] condFor n = blockdecl cfg (PP.text $ "if (data_" ++ bname ++ "::ppt_counter_fd[" ++ show n ++ "] > 0)") PP.empty [ stmt $ "goto " ++ labelFor n ] sfxCond = blockdecl cfg (PP.text "else") PP.empty [ stmt $ "goto " ++ labelFor 0 ] condCat conds = PP.vcat (head conds : (map (\c -> PP.text "else " <> c) $ tail conds)) loadFor n = [PP.text (labelFor n) <> ":", stmt $ "__asm__ volatile(\"rdpmc\" : \"=a\" (a), \"=d\" (d) : \"c\" (data_" ++ bname ++ "::ppt_counter_rcx[" ++ show n ++ "]))", stmt $ counterFor n ++ " = a | (static_cast<uint64_t>(d) << 32ULL)" ] revIndices = reverse indices in blockdecl cfg (PP.text $ "void snapshot_" ++ functionsBaseName ++ "()") PP.empty ( pfxConds ++ ( condCat (map condFor $ init revIndices) : sfxCond : stmt "uint32_t a,d":concatMap loadFor revIndices)) else static_savectrs headers = [ "sys/mman.h" | nativeCounters cfg ] in MB [saveFn | not elideDecls] (dataMember "uint64_t" (nm ++ memSfx)) headers [GMCounters] PRational ty _ -> let declType = case ty of PPDouble -> "double" PPFloat -> "float" memSfx = if defaultInit cfg then " = 0" else "" in MB [] (dataMember declType (nm ++ memSfx)) [] [] PIntegral ty _ -> let declType = case ty of PPByte -> "uint8_t" PPInt -> "int32_t" memSfx = if defaultInit cfg then " = 0" else "" in MB [] (dataMember declType (nm ++ memSfx)) [] []
5,032
true
true
6
28
2,337
1,467
732
735
null
null
nevrenato/Hets_Fork
RelationalScheme/ParseRS.hs
gpl-2.0
parseRSColumn :: AParser st [RSColumn] parseRSColumn = do iid <- sepBy1 parseEntry commaT colonT dt <- parseRSDatatypes return $ map (\(x, y) -> RSColumn (simpleIdToId x) dt y) iid
216
parseRSColumn :: AParser st [RSColumn] parseRSColumn = do iid <- sepBy1 parseEntry commaT colonT dt <- parseRSDatatypes return $ map (\(x, y) -> RSColumn (simpleIdToId x) dt y) iid
216
parseRSColumn = do iid <- sepBy1 parseEntry commaT colonT dt <- parseRSDatatypes return $ map (\(x, y) -> RSColumn (simpleIdToId x) dt y) iid
177
false
true
0
13
64
80
39
41
null
null
svenssonjoel/ObsidianGFX
Obsidian/Mutable.hs
bsd-3-clause
atomicExch :: forall mloc a s. AtomicExch a => EWord32 -> Exp a -> Mutable mloc s (Exp a) -> TProgram () atomicExch ix v (Mutable n (Single nom)) = f nom where f nom = atomicOp nom ix (AtomicExch v) {- --------------------------------------------------------------------------- atomicExch() int atomicExch(int* address, int val); unsigned int atomicExch(unsigned int* address, unsigned int val); unsigned long long int atomicExch(unsigned long long int* address, unsigned long long int val); float atomicExch(float* address, float val); --------------------------------------------------------------------------- atomicMin() int atomicMin(int* address, int val); unsigned int atomicMin(unsigned int* address, unsigned int val); unsigned long long int atomicMin(unsigned long long int* address, unsigned long long int val); --------------------------------------------------------------------------- atomicMax() int atomicMax(int* address, int val); unsigned int atomicMax(unsigned int* address, unsigned int val); unsigned long long int atomicMax(unsigned long long int* address, unsigned long long int val); --------------------------------------------------------------------------- atomicInc() unsigned int atomicInc(unsigned int* address, unsigned int val); --------------------------------------------------------------------------- atomicDec() unsigned int atomicDec(unsigned int* address, unsigned int val); --------------------------------------------------------------------------- atomicCAS() int atomicCAS(int* address, int compare, int val); unsigned int atomicCAS(unsigned int* address, unsigned int compare, unsigned int val); unsigned long long int atomicCAS(unsigned long long int* address, unsigned long long int compare, unsigned long long int val); --------------------------------------------------------------------------- atomicAnd() int atomicAnd(int* address, int val); unsigned int atomicAnd(unsigned int* address, unsigned int val); unsigned long long int atomicAnd(unsigned long long int* address, unsigned long long int val); --------------------------------------------------------------------------- atomicOr() int atomicOr(int* address, int val); unsigned int atomicOr(unsigned int* address, unsigned int val); unsigned long long int atomicOr(unsigned long long int* address, unsigned long long int val); --------------------------------------------------------------------------- atomicXor() int atomicXor(int* address, int val); unsigned int atomicXor(unsigned int* address, unsigned int val); unsigned long long int atomicXor(unsigned long long int* address, unsigned long long int val); -}
3,231
atomicExch :: forall mloc a s. AtomicExch a => EWord32 -> Exp a -> Mutable mloc s (Exp a) -> TProgram () atomicExch ix v (Mutable n (Single nom)) = f nom where f nom = atomicOp nom ix (AtomicExch v) {- --------------------------------------------------------------------------- atomicExch() int atomicExch(int* address, int val); unsigned int atomicExch(unsigned int* address, unsigned int val); unsigned long long int atomicExch(unsigned long long int* address, unsigned long long int val); float atomicExch(float* address, float val); --------------------------------------------------------------------------- atomicMin() int atomicMin(int* address, int val); unsigned int atomicMin(unsigned int* address, unsigned int val); unsigned long long int atomicMin(unsigned long long int* address, unsigned long long int val); --------------------------------------------------------------------------- atomicMax() int atomicMax(int* address, int val); unsigned int atomicMax(unsigned int* address, unsigned int val); unsigned long long int atomicMax(unsigned long long int* address, unsigned long long int val); --------------------------------------------------------------------------- atomicInc() unsigned int atomicInc(unsigned int* address, unsigned int val); --------------------------------------------------------------------------- atomicDec() unsigned int atomicDec(unsigned int* address, unsigned int val); --------------------------------------------------------------------------- atomicCAS() int atomicCAS(int* address, int compare, int val); unsigned int atomicCAS(unsigned int* address, unsigned int compare, unsigned int val); unsigned long long int atomicCAS(unsigned long long int* address, unsigned long long int compare, unsigned long long int val); --------------------------------------------------------------------------- atomicAnd() int atomicAnd(int* address, int val); unsigned int atomicAnd(unsigned int* address, unsigned int val); unsigned long long int atomicAnd(unsigned long long int* address, unsigned long long int val); --------------------------------------------------------------------------- atomicOr() int atomicOr(int* address, int val); unsigned int atomicOr(unsigned int* address, unsigned int val); unsigned long long int atomicOr(unsigned long long int* address, unsigned long long int val); --------------------------------------------------------------------------- atomicXor() int atomicXor(int* address, int val); unsigned int atomicXor(unsigned int* address, unsigned int val); unsigned long long int atomicXor(unsigned long long int* address, unsigned long long int val); -}
3,231
atomicExch ix v (Mutable n (Single nom)) = f nom where f nom = atomicOp nom ix (AtomicExch v) {- --------------------------------------------------------------------------- atomicExch() int atomicExch(int* address, int val); unsigned int atomicExch(unsigned int* address, unsigned int val); unsigned long long int atomicExch(unsigned long long int* address, unsigned long long int val); float atomicExch(float* address, float val); --------------------------------------------------------------------------- atomicMin() int atomicMin(int* address, int val); unsigned int atomicMin(unsigned int* address, unsigned int val); unsigned long long int atomicMin(unsigned long long int* address, unsigned long long int val); --------------------------------------------------------------------------- atomicMax() int atomicMax(int* address, int val); unsigned int atomicMax(unsigned int* address, unsigned int val); unsigned long long int atomicMax(unsigned long long int* address, unsigned long long int val); --------------------------------------------------------------------------- atomicInc() unsigned int atomicInc(unsigned int* address, unsigned int val); --------------------------------------------------------------------------- atomicDec() unsigned int atomicDec(unsigned int* address, unsigned int val); --------------------------------------------------------------------------- atomicCAS() int atomicCAS(int* address, int compare, int val); unsigned int atomicCAS(unsigned int* address, unsigned int compare, unsigned int val); unsigned long long int atomicCAS(unsigned long long int* address, unsigned long long int compare, unsigned long long int val); --------------------------------------------------------------------------- atomicAnd() int atomicAnd(int* address, int val); unsigned int atomicAnd(unsigned int* address, unsigned int val); unsigned long long int atomicAnd(unsigned long long int* address, unsigned long long int val); --------------------------------------------------------------------------- atomicOr() int atomicOr(int* address, int val); unsigned int atomicOr(unsigned int* address, unsigned int val); unsigned long long int atomicOr(unsigned long long int* address, unsigned long long int val); --------------------------------------------------------------------------- atomicXor() int atomicXor(int* address, int val); unsigned int atomicXor(unsigned int* address, unsigned int val); unsigned long long int atomicXor(unsigned long long int* address, unsigned long long int val); -}
3,070
false
true
0
12
887
107
52
55
null
null
msakai/ptq
src/PDict.hs
lgpl-2.1
a, every :: P Det a = B cat_Det "a"
39
a, every :: P Det a = B cat_Det "a"
39
a = B cat_Det "a"
21
false
true
2
6
13
32
12
20
null
null
ArturB/Multilinear
test/all/ConstructorsTests.hs
gpl-3.0
-- | Test generic NForm constructor indices error nFormConstructorError :: forall a t . ( NFData a, NFData (t a), Multilinear t a, Num a ) => Char -> Char -> Positive (Small Int) -> Positive (Small Int) -> t a -> Property nFormConstructorError c1 c2 s1 s2 _ = let size1 = getSmall $ getPositive s1 size2 = getSmall $ getPositive s2 v = NForm.fromIndices [c1,c2,'a'] [size1,size2] (\[x,y] -> fromIntegral x + fromIntegral y) :: t a in expectFailure (total v)
508
nFormConstructorError :: forall a t . ( NFData a, NFData (t a), Multilinear t a, Num a ) => Char -> Char -> Positive (Small Int) -> Positive (Small Int) -> t a -> Property nFormConstructorError c1 c2 s1 s2 _ = let size1 = getSmall $ getPositive s1 size2 = getSmall $ getPositive s2 v = NForm.fromIndices [c1,c2,'a'] [size1,size2] (\[x,y] -> fromIntegral x + fromIntegral y) :: t a in expectFailure (total v)
458
nFormConstructorError c1 c2 s1 s2 _ = let size1 = getSmall $ getPositive s1 size2 = getSmall $ getPositive s2 v = NForm.fromIndices [c1,c2,'a'] [size1,size2] (\[x,y] -> fromIntegral x + fromIntegral y) :: t a in expectFailure (total v)
261
true
true
0
14
132
205
104
101
null
null
juretta/haskell-jwt
tests/src/Web/JWTTests.hs
mit
case_encodeJWTNoMac = do let cs = def { iss = stringOrURI "Foo" , unregisteredClaims = Map.fromList [("http://example.com/is_root", Bool True)] } jwt = encodeUnsigned cs -- Verify the shape of the JWT, ensure the shape of the triple of -- <header>.<claims>.<signature> let (h:c:s:_) = T.splitOn "." jwt False @=? T.null h False @=? T.null c True @=? T.null s
413
case_encodeJWTNoMac = do let cs = def { iss = stringOrURI "Foo" , unregisteredClaims = Map.fromList [("http://example.com/is_root", Bool True)] } jwt = encodeUnsigned cs -- Verify the shape of the JWT, ensure the shape of the triple of -- <header>.<claims>.<signature> let (h:c:s:_) = T.splitOn "." jwt False @=? T.null h False @=? T.null c True @=? T.null s
413
case_encodeJWTNoMac = do let cs = def { iss = stringOrURI "Foo" , unregisteredClaims = Map.fromList [("http://example.com/is_root", Bool True)] } jwt = encodeUnsigned cs -- Verify the shape of the JWT, ensure the shape of the triple of -- <header>.<claims>.<signature> let (h:c:s:_) = T.splitOn "." jwt False @=? T.null h False @=? T.null c True @=? T.null s
413
false
false
0
15
112
127
62
65
null
null
AndrewRademacher/acumen
src/Data/Neural/FeedForward.hs
mit
notLast [x] = ([], [x])
26
notLast [x] = ([], [x])
26
notLast [x] = ([], [x])
26
false
false
0
6
7
23
13
10
null
null
guibou/AdventOfCode2016
src/Day11.hs
bsd-3-clause
reduceProblem (Status n l) = let allnames = getGenS (mconcat l) allnames2 = sortOn bli allnames bli s = (blu Map.! (Generator s), blu Map.! (Chip s), s) blu = Map.fromList (mconcat (fmap (\(item, idx) -> fmap (,idx) item) (zip l [0..]))) sortedNames = sort allnames replaces = Map.fromList (zip allnames2 sortedNames) rep aList = sort (fmap rep' aList) rep' (Generator x) = Generator (replaces Map.! x) rep' (Chip x) = Chip (replaces Map.! x) in Status n (fmap rep l)
767
reduceProblem (Status n l) = let allnames = getGenS (mconcat l) allnames2 = sortOn bli allnames bli s = (blu Map.! (Generator s), blu Map.! (Chip s), s) blu = Map.fromList (mconcat (fmap (\(item, idx) -> fmap (,idx) item) (zip l [0..]))) sortedNames = sort allnames replaces = Map.fromList (zip allnames2 sortedNames) rep aList = sort (fmap rep' aList) rep' (Generator x) = Generator (replaces Map.! x) rep' (Chip x) = Chip (replaces Map.! x) in Status n (fmap rep l)
767
reduceProblem (Status n l) = let allnames = getGenS (mconcat l) allnames2 = sortOn bli allnames bli s = (blu Map.! (Generator s), blu Map.! (Chip s), s) blu = Map.fromList (mconcat (fmap (\(item, idx) -> fmap (,idx) item) (zip l [0..]))) sortedNames = sort allnames replaces = Map.fromList (zip allnames2 sortedNames) rep aList = sort (fmap rep' aList) rep' (Generator x) = Generator (replaces Map.! x) rep' (Chip x) = Chip (replaces Map.! x) in Status n (fmap rep l)
767
false
false
0
17
380
256
130
126
null
null
kishoredbn/barrelfish
tools/flounder/GHBackend.hs
mit
intf_vtbl_param :: String -> MessageDef -> Direction -> C.Param intf_vtbl_param ifn m d = C.Param (C.Ptr $ C.TypeName $ msg_sig_type ifn m d) (msg_name m)
155
intf_vtbl_param :: String -> MessageDef -> Direction -> C.Param intf_vtbl_param ifn m d = C.Param (C.Ptr $ C.TypeName $ msg_sig_type ifn m d) (msg_name m)
155
intf_vtbl_param ifn m d = C.Param (C.Ptr $ C.TypeName $ msg_sig_type ifn m d) (msg_name m)
90
false
true
0
9
25
67
33
34
null
null
tehgeekmeister/apters-web
Controller.hs
agpl-3.0
-- our code starts here echo :: ToJSON a => a -> GHandler sub master RepJson echo = jsonToRepJson . toJSON
107
echo :: ToJSON a => a -> GHandler sub master RepJson echo = jsonToRepJson . toJSON
82
echo = jsonToRepJson . toJSON
29
true
true
1
8
21
41
18
23
null
null
ancientlanguage/haskell-analysis
prepare/src/Prepare/Decompose.hs
mit
decomposeChar '\x2F94D' = "\x2541D"
35
decomposeChar '\x2F94D' = "\x2541D"
35
decomposeChar '\x2F94D' = "\x2541D"
35
false
false
1
5
3
13
4
9
null
null
rvion/ride
jetpack/src/Data/Map/Strict/AsMap.hs
bsd-3-clause
-- map_elems :: forall k a. Map k a -> [a] map_elems = I.elems
62
map_elems = I.elems
19
map_elems = I.elems
19
true
false
1
6
13
13
5
8
null
null
daniel-ziegler/provability
src/Modal/Formulas.hs
bsd-3-clause
generalGLEvalSeq :: (Show v, Ord v) => Map v (ModalFormula v)-> [Map v Bool] generalGLEvalSeq formulaMap = map level [0..] where level n = M.map (!!n) result result = generalFixpointGLEval formulaMap
209
generalGLEvalSeq :: (Show v, Ord v) => Map v (ModalFormula v)-> [Map v Bool] generalGLEvalSeq formulaMap = map level [0..] where level n = M.map (!!n) result result = generalFixpointGLEval formulaMap
209
generalGLEvalSeq formulaMap = map level [0..] where level n = M.map (!!n) result result = generalFixpointGLEval formulaMap
132
false
true
0
9
40
90
45
45
null
null
aslatter/parsec
src/Text/Parsec/Char.hs
bsd-2-clause
-- | Parses an ASCII digit. Returns the parsed character. digit :: (Stream s m Char) => ParsecT s u m Char digit = satisfy isDigit <?> "digit"
163
digit :: (Stream s m Char) => ParsecT s u m Char digit = satisfy isDigit <?> "digit"
104
digit = satisfy isDigit <?> "digit"
55
true
true
0
6
48
41
21
20
null
null
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/InstanceGroupManagers/Delete.hs
mpl-2.0
-- | An optional request ID to identify requests. Specify a unique request ID -- so that if you must retry your request, the server will know to ignore -- the request if it has already been completed. For example, consider a -- situation where you make an initial request and the request times out. -- If you make the request again with the same request ID, the server can -- check if original operation with the same request ID was received, and -- if so, will ignore the second request. This prevents clients from -- accidentally creating duplicate commitments. The request ID must be a -- valid UUID with the exception that zero UUID is not supported -- (00000000-0000-0000-0000-000000000000). igmdRequestId :: Lens' InstanceGroupManagersDelete (Maybe Text) igmdRequestId = lens _igmdRequestId (\ s a -> s{_igmdRequestId = a})
837
igmdRequestId :: Lens' InstanceGroupManagersDelete (Maybe Text) igmdRequestId = lens _igmdRequestId (\ s a -> s{_igmdRequestId = a})
140
igmdRequestId = lens _igmdRequestId (\ s a -> s{_igmdRequestId = a})
76
true
true
0
9
144
57
34
23
null
null
themoritz/cabal
Cabal/Distribution/Simple/PreProcess.hs
bsd-3-clause
runSimplePreProcessor :: PreProcessor -> FilePath -> FilePath -> Verbosity -> IO () runSimplePreProcessor pp inFile outFile verbosity = runPreProcessor pp (".", inFile) (".", outFile) verbosity
217
runSimplePreProcessor :: PreProcessor -> FilePath -> FilePath -> Verbosity -> IO () runSimplePreProcessor pp inFile outFile verbosity = runPreProcessor pp (".", inFile) (".", outFile) verbosity
217
runSimplePreProcessor pp inFile outFile verbosity = runPreProcessor pp (".", inFile) (".", outFile) verbosity
111
false
true
0
11
48
69
33
36
null
null
samscott89/tamarin-prover
lib/theory/src/Theory/Model/Fact.hs
gpl-3.0
-- Constructing facts --------------------- -- | A fact denoting a message sent by the protocol to the intruder. outFact :: t -> Fact t outFact = Fact OutFact . return
168
outFact :: t -> Fact t outFact = Fact OutFact . return
54
outFact = Fact OutFact . return
31
true
true
0
6
30
28
15
13
null
null
beloglazov/haskell-course
hw2.hs
apache-2.0
-- testWhatWentWrong parse whatWentWrong "sample.log" whatWentWrong :: [LogMessage] -> [String] whatWentWrong = map getMessage . inOrder . build . filter isErrorSeverity50
171
whatWentWrong :: [LogMessage] -> [String] whatWentWrong = map getMessage . inOrder . build . filter isErrorSeverity50
117
whatWentWrong = map getMessage . inOrder . build . filter isErrorSeverity50
75
true
true
0
8
20
46
22
24
null
null
dmbarbour/awelon
hsrc_util/ShowEnv.hs
bsd-3-clause
showNamedStacks (P (P (valToText -> Just name) stack) ns') = showString name . showString ": " . shows (stackCount stack) . showChar '\n' . showNamedStacks ns'
173
showNamedStacks (P (P (valToText -> Just name) stack) ns') = showString name . showString ": " . shows (stackCount stack) . showChar '\n' . showNamedStacks ns'
173
showNamedStacks (P (P (valToText -> Just name) stack) ns') = showString name . showString ": " . shows (stackCount stack) . showChar '\n' . showNamedStacks ns'
173
false
false
3
11
39
76
33
43
null
null
anttisalonen/freekick
haskell/addutil/Libaddutil/ListUtils.hs
agpl-3.0
findList :: Ord k => [k] -> Data.Map.Map k a -> [a] findList [] _ = []
74
findList :: Ord k => [k] -> Data.Map.Map k a -> [a] findList [] _ = []
74
findList [] _ = []
22
false
true
0
9
20
49
25
24
null
null
dysinger/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/CreateUserProfile.hs
mpl-2.0
-- | 'CreateUserProfileResponse' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'cuprIamUserArn' @::@ 'Maybe' 'Text' -- createUserProfileResponse :: CreateUserProfileResponse createUserProfileResponse = CreateUserProfileResponse { _cuprIamUserArn = Nothing }
302
createUserProfileResponse :: CreateUserProfileResponse createUserProfileResponse = CreateUserProfileResponse { _cuprIamUserArn = Nothing }
146
createUserProfileResponse = CreateUserProfileResponse { _cuprIamUserArn = Nothing }
91
true
true
0
7
39
35
19
16
null
null
expipiplus1/vulkan
src/Vulkan/Core10/Event.hs
bsd-3-clause
-- | vkResetEvent - Reset an event to non-signaled state -- -- = Description -- -- When 'resetEvent' is executed on the host, it defines an /event unsignal -- operation/ which resets the event to the unsignaled state. -- -- If @event@ is already in the unsignaled state when 'resetEvent' is -- executed, then 'resetEvent' has no effect, and no event unsignal -- operation occurs. -- -- == Valid Usage -- -- - #VUID-vkResetEvent-event-03821# There /must/ be an execution -- dependency between 'resetEvent' and the execution of any -- 'Vulkan.Core10.CommandBufferBuilding.cmdWaitEvents' that includes -- @event@ in its @pEvents@ parameter -- -- - #VUID-vkResetEvent-event-03822# There /must/ be an execution -- dependency between 'resetEvent' and the execution of any -- 'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.cmdWaitEvents2' -- that includes @event@ in its @pEvents@ parameter -- -- - #VUID-vkResetEvent-event-03823# @event@ /must/ not have been created -- with -- 'Vulkan.Core10.Enums.EventCreateFlagBits.EVENT_CREATE_DEVICE_ONLY_BIT' -- -- == Valid Usage (Implicit) -- -- - #VUID-vkResetEvent-device-parameter# @device@ /must/ be a valid -- 'Vulkan.Core10.Handles.Device' handle -- -- - #VUID-vkResetEvent-event-parameter# @event@ /must/ be a valid -- 'Vulkan.Core10.Handles.Event' handle -- -- - #VUID-vkResetEvent-event-parent# @event@ /must/ have been created, -- allocated, or retrieved from @device@ -- -- == Host Synchronization -- -- - Host access to @event@ /must/ be externally synchronized -- -- == Return Codes -- -- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>] -- -- - 'Vulkan.Core10.Enums.Result.SUCCESS' -- -- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>] -- -- - 'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY' -- -- = See Also -- -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_0 VK_VERSION_1_0>, -- 'Vulkan.Core10.Handles.Device', 'Vulkan.Core10.Handles.Event' resetEvent :: forall io . (MonadIO io) => -- | @device@ is the logical device that owns the event. Device -> -- | @event@ is the event to reset. Event -> io () resetEvent device event = liftIO $ do let vkResetEventPtr = pVkResetEvent (case device of Device{deviceCmds} -> deviceCmds) unless (vkResetEventPtr /= nullFunPtr) $ throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkResetEvent is null" Nothing Nothing let vkResetEvent' = mkVkResetEvent vkResetEventPtr r <- traceAroundEvent "vkResetEvent" (vkResetEvent' (deviceHandle (device)) (event)) when (r < SUCCESS) (throwIO (VulkanException r)) -- | VkEventCreateInfo - Structure specifying parameters of a newly created -- event -- -- == Valid Usage (Implicit) -- -- = See Also -- -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_0 VK_VERSION_1_0>, -- 'Vulkan.Core10.Enums.EventCreateFlagBits.EventCreateFlags', -- 'Vulkan.Core10.Enums.StructureType.StructureType', 'createEvent'
3,246
resetEvent :: forall io . (MonadIO io) => -- | @device@ is the logical device that owns the event. Device -> -- | @event@ is the event to reset. Event -> io () resetEvent device event = liftIO $ do let vkResetEventPtr = pVkResetEvent (case device of Device{deviceCmds} -> deviceCmds) unless (vkResetEventPtr /= nullFunPtr) $ throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkResetEvent is null" Nothing Nothing let vkResetEvent' = mkVkResetEvent vkResetEventPtr r <- traceAroundEvent "vkResetEvent" (vkResetEvent' (deviceHandle (device)) (event)) when (r < SUCCESS) (throwIO (VulkanException r)) -- | VkEventCreateInfo - Structure specifying parameters of a newly created -- event -- -- == Valid Usage (Implicit) -- -- = See Also -- -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_0 VK_VERSION_1_0>, -- 'Vulkan.Core10.Enums.EventCreateFlagBits.EventCreateFlags', -- 'Vulkan.Core10.Enums.StructureType.StructureType', 'createEvent'
1,089
resetEvent device event = liftIO $ do let vkResetEventPtr = pVkResetEvent (case device of Device{deviceCmds} -> deviceCmds) unless (vkResetEventPtr /= nullFunPtr) $ throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkResetEvent is null" Nothing Nothing let vkResetEvent' = mkVkResetEvent vkResetEventPtr r <- traceAroundEvent "vkResetEvent" (vkResetEvent' (deviceHandle (device)) (event)) when (r < SUCCESS) (throwIO (VulkanException r)) -- | VkEventCreateInfo - Structure specifying parameters of a newly created -- event -- -- == Valid Usage (Implicit) -- -- = See Also -- -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_0 VK_VERSION_1_0>, -- 'Vulkan.Core10.Enums.EventCreateFlagBits.EventCreateFlags', -- 'Vulkan.Core10.Enums.StructureType.StructureType', 'createEvent'
856
true
true
0
17
515
251
157
94
null
null
fmapfmapfmap/amazonka
amazonka-ses/gen/Network/AWS/SES/GetIdentityPolicies.hs
mpl-2.0
-- | Creates a value of 'GetIdentityPolicies' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'gipIdentity' -- -- * 'gipPolicyNames' getIdentityPolicies :: Text -- ^ 'gipIdentity' -> GetIdentityPolicies getIdentityPolicies pIdentity_ = GetIdentityPolicies' { _gipIdentity = pIdentity_ , _gipPolicyNames = mempty }
422
getIdentityPolicies :: Text -- ^ 'gipIdentity' -> GetIdentityPolicies getIdentityPolicies pIdentity_ = GetIdentityPolicies' { _gipIdentity = pIdentity_ , _gipPolicyNames = mempty }
204
getIdentityPolicies pIdentity_ = GetIdentityPolicies' { _gipIdentity = pIdentity_ , _gipPolicyNames = mempty }
126
true
true
0
7
82
49
28
21
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/succ_2.hs
mit
toEnumRatio :: MyInt -> Ratio MyInt toEnumRatio = fromIntRatio
64
toEnumRatio :: MyInt -> Ratio MyInt toEnumRatio = fromIntRatio
64
toEnumRatio = fromIntRatio
26
false
true
0
6
10
18
9
9
null
null
tippenein/scrape_the_truth
src/Server.hs
mit
app :: Application app = middlewares $ serve Api.truthApi server
64
app :: Application app = middlewares $ serve Api.truthApi server
64
app = middlewares $ serve Api.truthApi server
45
false
true
0
7
9
22
11
11
null
null
marcellussiegburg/autotool
collection/src/Rewriting/Termination.hs
gpl-2.0
signature sys = S.unions $ do u <- rules sys ; [ syms $ lhs u, syms $ rhs u ]
81
signature sys = S.unions $ do u <- rules sys ; [ syms $ lhs u, syms $ rhs u ]
81
signature sys = S.unions $ do u <- rules sys ; [ syms $ lhs u, syms $ rhs u ]
81
false
false
0
10
24
49
23
26
null
null
peterokagey/haskellOEIS
src/Helpers/ChessSequences.hs
apache-2.0
queenNW n k = map (\m -> (n-m, k-m)) [1..min n k - 1]
53
queenNW n k = map (\m -> (n-m, k-m)) [1..min n k - 1]
53
queenNW n k = map (\m -> (n-m, k-m)) [1..min n k - 1]
53
false
false
1
9
13
57
27
30
null
null
shlevy/ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
-- | Returns @True@ for value arguments, false for type args -- NB: coercions are value arguments (zero width, to be sure, -- like State#, but still value args). isValArg :: Expr b -> Bool isValArg e = not (isTypeArg e)
219
isValArg :: Expr b -> Bool isValArg e = not (isTypeArg e)
57
isValArg e = not (isTypeArg e)
30
true
true
0
7
40
33
17
16
null
null
joom/Guguk
tests/Main.hs
mit
runTests :: IO () runTests = do _ <- mapM runTestTT tests return ()
72
runTests :: IO () runTests = do _ <- mapM runTestTT tests return ()
72
runTests = do _ <- mapM runTestTT tests return ()
53
false
true
0
8
18
36
16
20
null
null
stefan-hoeck/labeled-graph
Data/Graph/Simple/Query/Dfs.hs
bsd-3-clause
---------------------------------------------------------------------- -- Algorithms runDfs ∷ Graph → [Vertex] → [[Vertex]] runDfs g vs = filter (not . null) $ runM (order g) False $ runAll vs where runAll = mapM runSingle runSingle v = run [v] run [] = return [] run (v:t) = let t' = neighbors g v ++ t nvis = visit v >> fmap (v:) (run t') in ifM (visited v) (run t) nvis
432
runDfs ∷ Graph → [Vertex] → [[Vertex]] runDfs g vs = filter (not . null) $ runM (order g) False $ runAll vs where runAll = mapM runSingle runSingle v = run [v] run [] = return [] run (v:t) = let t' = neighbors g v ++ t nvis = visit v >> fmap (v:) (run t') in ifM (visited v) (run t) nvis
346
runDfs g vs = filter (not . null) $ runM (order g) False $ runAll vs where runAll = mapM runSingle runSingle v = run [v] run [] = return [] run (v:t) = let t' = neighbors g v ++ t nvis = visit v >> fmap (v:) (run t') in ifM (visited v) (run t) nvis
307
true
true
3
12
127
202
95
107
null
null
mettekou/ghc
compiler/basicTypes/RdrName.hs
bsd-3-clause
isQual_maybe _ = Nothing
33
isQual_maybe _ = Nothing
33
isQual_maybe _ = Nothing
33
false
false
0
5
12
9
4
5
null
null
Sgoettschkes/learning
haskell/ProjectEuler/tests/Problems/Problem004Spec.hs
mit
main :: IO() main = hspec spec
30
main :: IO() main = hspec spec
30
main = hspec spec
17
false
true
1
6
6
22
9
13
null
null
BartAdv/Idris-dev
src/Idris/IBC.hs
bsd-3-clause
ibc i (IBCFunctionErrorHandler fn a n) f = return f { ibc_function_errorhandlers = (fn, a, n) : ibc_function_errorhandlers f }
128
ibc i (IBCFunctionErrorHandler fn a n) f = return f { ibc_function_errorhandlers = (fn, a, n) : ibc_function_errorhandlers f }
128
ibc i (IBCFunctionErrorHandler fn a n) f = return f { ibc_function_errorhandlers = (fn, a, n) : ibc_function_errorhandlers f }
128
false
false
1
9
21
59
27
32
null
null
danr/tfp1
Lang/PrettyRich.hs
gpl-3.0
ppPat :: Kit a -> Pattern a -> Doc ppPat (p,q) pat = case pat of Default -> "_" ConPat c ts bs -> hang (p c) 2 (sep ([ "@" <+> ppType 1 p t | t <- ts ] ++ map q bs)) LitPat i _ -> integer i
212
ppPat :: Kit a -> Pattern a -> Doc ppPat (p,q) pat = case pat of Default -> "_" ConPat c ts bs -> hang (p c) 2 (sep ([ "@" <+> ppType 1 p t | t <- ts ] ++ map q bs)) LitPat i _ -> integer i
212
ppPat (p,q) pat = case pat of Default -> "_" ConPat c ts bs -> hang (p c) 2 (sep ([ "@" <+> ppType 1 p t | t <- ts ] ++ map q bs)) LitPat i _ -> integer i
177
false
true
6
14
73
129
61
68
null
null
Fuuzetsu/yi-agda
src/Yi/Mode/Agda.hs
gpl-3.0
parser ∷ Agda → IO () parser ag = forever $ do l ← hGetContents (_stdOut ag) mapM_ (parseCommand . Tx.pack >=> print) (lines l)
131
parser ∷ Agda → IO () parser ag = forever $ do l ← hGetContents (_stdOut ag) mapM_ (parseCommand . Tx.pack >=> print) (lines l)
131
parser ag = forever $ do l ← hGetContents (_stdOut ag) mapM_ (parseCommand . Tx.pack >=> print) (lines l)
109
false
true
0
13
28
75
34
41
null
null
dstruthers/Agate
VM.hs
mit
exec (Test consequence alternative) = do vm <- get if isTrue (accumulator vm) then exec consequence else exec alternative
133
exec (Test consequence alternative) = do vm <- get if isTrue (accumulator vm) then exec consequence else exec alternative
133
exec (Test consequence alternative) = do vm <- get if isTrue (accumulator vm) then exec consequence else exec alternative
133
false
false
0
10
30
50
23
27
null
null
fredokun/piexplorer
src/Parser.hs
gpl-3.0
identifier :: Parser String identifier = Tok.identifier lexer
61
identifier :: Parser String identifier = Tok.identifier lexer
61
identifier = Tok.identifier lexer
33
false
true
0
6
7
25
10
15
null
null
atsukotakahashi/wi
sketches/IncrementalParser.hs
gpl-2.0
delete at len (Err s x p) = Err (deleteStr at len s) x p
56
delete at len (Err s x p) = Err (deleteStr at len s) x p
56
delete at len (Err s x p) = Err (deleteStr at len s) x p
56
false
false
0
7
14
44
19
25
null
null
nomeata/ghc
compiler/nativeGen/RegAlloc/Linear/X86/FreeRegs.hs
bsd-3-clause
oFreeRegs :: FreeRegs noFreeRegs = 0
37
noFreeRegs :: FreeRegs noFreeRegs = 0
37
noFreeRegs = 0
14
false
true
0
4
6
11
6
5
null
null
bitemyapp/mustache
src/bin/Main.hs
bsd-3-clause
commandArgs ∷ Arguments commandArgs = Arguments { template = def &= argPos 0 &= typ "TEMPLATE" , dataFile = def &= argPos 1 &= typ "DATAFILE" , outputFile = Nothing &= help "Name of the resulting file" &= typFile , templateDirs = ["."] &= help "The directories in which to search for the templates" &= typ "DIRECTORIES" , dataFormat = Nothing &= help "Format for input data" } &= summary "Simple mustache template subtitution"
494
commandArgs ∷ Arguments commandArgs = Arguments { template = def &= argPos 0 &= typ "TEMPLATE" , dataFile = def &= argPos 1 &= typ "DATAFILE" , outputFile = Nothing &= help "Name of the resulting file" &= typFile , templateDirs = ["."] &= help "The directories in which to search for the templates" &= typ "DIRECTORIES" , dataFormat = Nothing &= help "Format for input data" } &= summary "Simple mustache template subtitution"
494
commandArgs = Arguments { template = def &= argPos 0 &= typ "TEMPLATE" , dataFile = def &= argPos 1 &= typ "DATAFILE" , outputFile = Nothing &= help "Name of the resulting file" &= typFile , templateDirs = ["."] &= help "The directories in which to search for the templates" &= typ "DIRECTORIES" , dataFormat = Nothing &= help "Format for input data" } &= summary "Simple mustache template subtitution"
470
false
true
2
9
141
118
60
58
null
null
dicomgrid/dicom-haskell-library
src/Data/DICOM/Object.hs
gpl-3.0
writeSequence :: VL -> Sequence -> Put writeSequence _vl s = do traverse_ put (runSequence s) case _vl of UndefinedValueLength -> do put SequenceDelimitationItem putWord32le 0 _ -> return ()
214
writeSequence :: VL -> Sequence -> Put writeSequence _vl s = do traverse_ put (runSequence s) case _vl of UndefinedValueLength -> do put SequenceDelimitationItem putWord32le 0 _ -> return ()
214
writeSequence _vl s = do traverse_ put (runSequence s) case _vl of UndefinedValueLength -> do put SequenceDelimitationItem putWord32le 0 _ -> return ()
175
false
true
0
13
53
75
33
42
null
null
julienschmaltz/madl
test/app/Parser/TypeCheckerTest.hs
mit
showSource :: String -> String showSource text = "--- network ---\n" ++ text ++ "\n---------------"
99
showSource :: String -> String showSource text = "--- network ---\n" ++ text ++ "\n---------------"
99
showSource text = "--- network ---\n" ++ text ++ "\n---------------"
68
false
true
0
7
14
32
14
18
null
null
jwiegley/ghc-release
libraries/terminfo/System/Console/Terminfo/Base.hs
gpl-3.0
-- | An operator version of 'mappend'. (<#>) :: Monoid m => m -> m -> m (<#>) = mappend
87
(<#>) :: Monoid m => m -> m -> m (<#>) = mappend
48
(<#>) = mappend
15
true
true
0
7
19
31
18
13
null
null
da-x/lamdu
Lamdu/GUI/ParamEdit.hs
gpl-3.0
chooseAddResultEntityId (Sugar.ParamAddResultNewVar entityId _) = eventResultFromEntityId entityId
102
chooseAddResultEntityId (Sugar.ParamAddResultNewVar entityId _) = eventResultFromEntityId entityId
102
chooseAddResultEntityId (Sugar.ParamAddResultNewVar entityId _) = eventResultFromEntityId entityId
102
false
false
0
7
10
23
10
13
null
null
blippy/sifi
src/Browser.hs
gpl-3.0
-- url is of form: "file:///C:/Users/mcarter/AppData/Local/MarkCarter/sifi/sifi.htm" rawUrl = do url1 <- outFile "sifi.htm" return ("file:///" ++ url1)
156
rawUrl = do url1 <- outFile "sifi.htm" return ("file:///" ++ url1)
71
rawUrl = do url1 <- outFile "sifi.htm" return ("file:///" ++ url1)
71
true
false
0
9
21
30
14
16
null
null
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/Instances/Get.hs
mpl-2.0
-- | Creates a value of 'InstancesGet' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'igProject' -- -- * 'igZone' -- -- * 'igInstance' instancesGet :: Text -- ^ 'igProject' -> Text -- ^ 'igZone' -> Text -- ^ 'igInstance' -> InstancesGet instancesGet pIgProject_ pIgZone_ pIgInstance_ = InstancesGet' { _igProject = pIgProject_ , _igZone = pIgZone_ , _igInstance = pIgInstance_ }
501
instancesGet :: Text -- ^ 'igProject' -> Text -- ^ 'igZone' -> Text -- ^ 'igInstance' -> InstancesGet instancesGet pIgProject_ pIgZone_ pIgInstance_ = InstancesGet' { _igProject = pIgProject_ , _igZone = pIgZone_ , _igInstance = pIgInstance_ }
279
instancesGet pIgProject_ pIgZone_ pIgInstance_ = InstancesGet' { _igProject = pIgProject_ , _igZone = pIgZone_ , _igInstance = pIgInstance_ }
161
true
true
0
7
114
62
40
22
null
null
damianfral/clay
src/Clay/Media.hs
bsd-3-clause
braille = MediaType "braille"
32
braille = MediaType "braille"
32
braille = MediaType "braille"
32
false
false
0
5
6
9
4
5
null
null
sdiehl/ghc
testsuite/tests/driver/T16511/C.hs
bsd-3-clause
name :: String name = "Samantha"
32
name :: String name = "Samantha"
32
name = "Samantha"
17
false
true
0
4
5
11
6
5
null
null
phillc/agentvsagent
cards-agents-in-a-box/hearts/haskell/MyAgent.hs
mit
noPointsInFirstTrick :: Round -> [Card] -> [Card] noPointsInFirstTrick round cards = if (length (tricks round)) == 1 then noPoints cards else cards
149
noPointsInFirstTrick :: Round -> [Card] -> [Card] noPointsInFirstTrick round cards = if (length (tricks round)) == 1 then noPoints cards else cards
149
noPointsInFirstTrick round cards = if (length (tricks round)) == 1 then noPoints cards else cards
99
false
true
0
10
23
62
31
31
null
null
bacchanalia/KitchenSink
KitchenSink/Qualified.hs
gpl-3.0
-- |'V.sequence_' v_sequence_ = V.sequence_
43
v_sequence_ = V.sequence_
25
v_sequence_ = V.sequence_
25
true
false
0
5
4
9
5
4
null
null
dimara/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- * Node daemon setup ndsClusterName :: String ndsClusterName = "cluster_name"
80
ndsClusterName :: String ndsClusterName = "cluster_name"
56
ndsClusterName = "cluster_name"
31
true
true
0
6
11
19
8
11
null
null
adz/real_world_haskell
ch04/FixLines.hs
mit
main = mainWith myFunction where mainWith f = do args <- getArgs case args of [input, output] -> interactWith f input output _ -> putStrLn "error: exactly 2 args needed" myFunction = fixLines
246
main = mainWith myFunction where mainWith f = do args <- getArgs case args of [input, output] -> interactWith f input output _ -> putStrLn "error: exactly 2 args needed" myFunction = fixLines
246
main = mainWith myFunction where mainWith f = do args <- getArgs case args of [input, output] -> interactWith f input output _ -> putStrLn "error: exactly 2 args needed" myFunction = fixLines
246
false
false
1
11
87
68
32
36
null
null
spechub/Hets
OWL2/ParseAS.hs
gpl-2.0
parseSameIndividual :: GA.PrefixMap -> CharParser st Assertion parseSameIndividual pm = parseEnclosedWithKeyword "SameIndividual" $ SameIndividual <$> (parseAnnotations pm) <*> manyN 2 (parseIndividual pm)
217
parseSameIndividual :: GA.PrefixMap -> CharParser st Assertion parseSameIndividual pm = parseEnclosedWithKeyword "SameIndividual" $ SameIndividual <$> (parseAnnotations pm) <*> manyN 2 (parseIndividual pm)
217
parseSameIndividual pm = parseEnclosedWithKeyword "SameIndividual" $ SameIndividual <$> (parseAnnotations pm) <*> manyN 2 (parseIndividual pm)
154
false
true
0
8
33
57
27
30
null
null
genos/online_problems
advent_of_code_2016/day5/src/Main.hs
mit
main :: IO () main = do print test1 print test2 BC.putStrLn part1 BC.putStrLn part2
91
main :: IO () main = do print test1 print test2 BC.putStrLn part1 BC.putStrLn part2
91
main = do print test1 print test2 BC.putStrLn part1 BC.putStrLn part2
77
false
true
1
9
22
48
18
30
null
null
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/Distribution/Simple/BuildTarget.hs
bsd-3-clause
matchPlus a@(ExactMatch _ _ ) (InexactMatch _ _ ) = a
60
matchPlus a@(ExactMatch _ _ ) (InexactMatch _ _ ) = a
60
matchPlus a@(ExactMatch _ _ ) (InexactMatch _ _ ) = a
60
false
false
0
7
17
34
15
19
null
null
jmtd/rdifffs
RDiffFS.hs
bsd-3-clause
rdiffRead :: RdiffContext -> FilePath -> HT -> ByteCount -> FileOffset -> IO (Either Errno B.ByteString) rdiffRead repo fpath ht byteCount offset = do which <- whichBackup repo path case which of CurrentBackup -> rdiffCurrentRead repo path ht byteCount offset IncrementBackup -> rdiffIncrementRead repo path ht byteCount offset Neither -> return $ Left eNOENT where (_:path) = fpath -- Lazy, whole-file version, for internal use
485
rdiffRead :: RdiffContext -> FilePath -> HT -> ByteCount -> FileOffset -> IO (Either Errno B.ByteString) rdiffRead repo fpath ht byteCount offset = do which <- whichBackup repo path case which of CurrentBackup -> rdiffCurrentRead repo path ht byteCount offset IncrementBackup -> rdiffIncrementRead repo path ht byteCount offset Neither -> return $ Left eNOENT where (_:path) = fpath -- Lazy, whole-file version, for internal use
485
rdiffRead repo fpath ht byteCount offset = do which <- whichBackup repo path case which of CurrentBackup -> rdiffCurrentRead repo path ht byteCount offset IncrementBackup -> rdiffIncrementRead repo path ht byteCount offset Neither -> return $ Left eNOENT where (_:path) = fpath -- Lazy, whole-file version, for internal use
380
false
true
0
13
121
137
66
71
null
null
andyfriesen/buffer-builder-aeson
test/Main.hs
bsd-3-clause
case_serialize_simple_things :: IO () case_serialize_simple_things = do ae "false" (encodeJson $ Aeson.Bool False) ae "true" (encodeJson $ Aeson.Bool True) ae "null" (encodeJson $ Aeson.Null) ae "9" (encodeJson $ Aeson.Number 9) ae "-9" (encodeJson $ Aeson.Number (-9))
289
case_serialize_simple_things :: IO () case_serialize_simple_things = do ae "false" (encodeJson $ Aeson.Bool False) ae "true" (encodeJson $ Aeson.Bool True) ae "null" (encodeJson $ Aeson.Null) ae "9" (encodeJson $ Aeson.Number 9) ae "-9" (encodeJson $ Aeson.Number (-9))
289
case_serialize_simple_things = do ae "false" (encodeJson $ Aeson.Bool False) ae "true" (encodeJson $ Aeson.Bool True) ae "null" (encodeJson $ Aeson.Null) ae "9" (encodeJson $ Aeson.Number 9) ae "-9" (encodeJson $ Aeson.Number (-9))
251
false
true
0
12
55
118
55
63
null
null
frantisekfarka/ghc-dsi
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
emitPrimOp _ [res] IndexSmallArrayOp [obj,ix] = doReadSmallPtrArrayOp res obj ix
85
emitPrimOp _ [res] IndexSmallArrayOp [obj,ix] = doReadSmallPtrArrayOp res obj ix
85
emitPrimOp _ [res] IndexSmallArrayOp [obj,ix] = doReadSmallPtrArrayOp res obj ix
85
false
false
1
6
14
35
16
19
null
null
bbangert/hermes-hs
hermes-cn/Hermes/ConnectionNode/Types.hs
mpl-2.0
-- | Count all the clients currently being tracked. numClients :: ServerState -> STM Int numClients state = M.size <$> readClientMap state
138
numClients :: ServerState -> STM Int numClients state = M.size <$> readClientMap state
86
numClients state = M.size <$> readClientMap state
49
true
true
0
6
21
34
16
18
null
null