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
facebookincubator/duckling
Duckling/Numeral/FI/Corpus.hs
bsd-3-clause
corpus :: Corpus corpus = (context, testOptions, allExamples)
61
corpus :: Corpus corpus = (context, testOptions, allExamples)
61
corpus = (context, testOptions, allExamples)
44
false
true
0
5
7
20
12
8
null
null
JacquesCarette/literate-scientific-software
People/Dan/Presentations/CommitteeMeeting4/BodyNew.hs
bsd-2-clause
trace_t1_DD6 = ["IM3", "DD2", "DD5"]
36
trace_t1_DD6 = ["IM3", "DD2", "DD5"]
36
trace_t1_DD6 = ["IM3", "DD2", "DD5"]
36
false
false
0
5
4
15
9
6
null
null
oldmanmike/ghc
compiler/hsSyn/HsUtils.hs
bsd-3-clause
nlList :: [LHsExpr RdrName] -> LHsExpr RdrName nlHsLam match = noLoc (HsLam (mkMatchGroup Generated [match]))
121
nlList :: [LHsExpr RdrName] -> LHsExpr RdrName nlHsLam match = noLoc (HsLam (mkMatchGroup Generated [match]))
120
nlHsLam match = noLoc (HsLam (mkMatchGroup Generated [match]))
71
false
true
0
10
26
50
24
26
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_MAX_SAMPLES_ANGLE :: GLenum gl_MAX_SAMPLES_ANGLE = 0x8D57
60
gl_MAX_SAMPLES_ANGLE :: GLenum gl_MAX_SAMPLES_ANGLE = 0x8D57
60
gl_MAX_SAMPLES_ANGLE = 0x8D57
29
false
true
0
4
5
11
6
5
null
null
cmc-haskell-2016/checkers
src/GraphicsProcessing.hs
bsd-3-clause
-- window offset -- just a constant bgColor :: Color bgColor = makeColor 0.7 0.7 0.8 1
87
bgColor :: Color bgColor = makeColor 0.7 0.7 0.8 1
50
bgColor = makeColor 0.7 0.7 0.8 1
33
true
true
0
5
17
22
12
10
null
null
kRITZCREEK/psc-ide
src/PureScript/Ide/Internal/Sandbox.hs
mit
runHalogen = runWithExternsFile "../conway-purescript/output/Halogen.Query.StateF/externs.json"
96
runHalogen = runWithExternsFile "../conway-purescript/output/Halogen.Query.StateF/externs.json"
96
runHalogen = runWithExternsFile "../conway-purescript/output/Halogen.Query.StateF/externs.json"
96
false
false
0
5
4
9
4
5
null
null
DrSLDR/logoff
test/TestsFocus.hs
mit
{------------------------------------------------------------------------------} -- Defocus R-1 - Simple defocusing action -- x+ |- [x+] => x+ |- x+ defocusR_1 :: Test defocusR_1 = ((==) (defocusR (Sequent (IStruct (P (Positive "x"))) (FOStruct (P (Positive "x"))))) (Sequent (IStruct (P (Positive "x"))) (OStruct (P (Positive "x")))), True, "Defocus R-1" )
429
defocusR_1 :: Test defocusR_1 = ((==) (defocusR (Sequent (IStruct (P (Positive "x"))) (FOStruct (P (Positive "x"))))) (Sequent (IStruct (P (Positive "x"))) (OStruct (P (Positive "x")))), True, "Defocus R-1" )
280
defocusR_1 = ((==) (defocusR (Sequent (IStruct (P (Positive "x"))) (FOStruct (P (Positive "x"))))) (Sequent (IStruct (P (Positive "x"))) (OStruct (P (Positive "x")))), True, "Defocus R-1" )
261
true
true
0
16
116
124
66
58
null
null
ezyang/ghc
compiler/cmm/CmmMachOp.hs
bsd-3-clause
mo_wordOr dflags = MO_Or (wordWidth dflags)
50
mo_wordOr dflags = MO_Or (wordWidth dflags)
50
mo_wordOr dflags = MO_Or (wordWidth dflags)
50
false
false
0
7
12
18
8
10
null
null
romanb/amazonka
amazonka-cloudwatch-logs/gen/Network/AWS/CloudWatchLogs/Types.hs
mpl-2.0
mfFilterPattern :: Lens' MetricFilter (Maybe Text) mfFilterPattern = lens _mfFilterPattern (\s a -> s { _mfFilterPattern = a })
127
mfFilterPattern :: Lens' MetricFilter (Maybe Text) mfFilterPattern = lens _mfFilterPattern (\s a -> s { _mfFilterPattern = a })
127
mfFilterPattern = lens _mfFilterPattern (\s a -> s { _mfFilterPattern = a })
76
false
true
1
9
18
50
24
26
null
null
bb010g/yapp
src/YAPP.hs
gpl-3.0
(=<<) :: Bind f => (a -> f b) -> f a -> f b (=<<) = (Data.Functor.Bind.-<<)
75
(=<<) :: Bind f => (a -> f b) -> f a -> f b (=<<) = (Data.Functor.Bind.-<<)
75
(=<<) = (Data.Functor.Bind.-<<)
31
false
true
0
9
17
52
29
23
null
null
elginer/Delve
src/DCodeTest.hs
gpl-3.0
assignlocal = do s <- arbitrary f <- loc_gen AssignLocal return $ f s
79
assignlocal = do s <- arbitrary f <- loc_gen AssignLocal return $ f s
79
assignlocal = do s <- arbitrary f <- loc_gen AssignLocal return $ f s
79
false
false
0
8
23
33
14
19
null
null
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Scene/Node.hs
mit
nodeGetComponents :: (Parent Node a, Pointer p a, MonadIO m, ForeignVectorRepresent v, ForeignElemConstr v (SharedPtr Component)) => p -- ^ Node pointer or pointer to ascentor -> m (v (SharedPtr Component)) nodeGetComponents p = liftIO $ do let ptr = parentPointer p peekForeignVectorAs =<< [C.exp| const VectorSharedComponentPtr* { &$(Node* ptr)->GetComponents()} |] -- | Return all components of type. Optionally recursive.
434
nodeGetComponents :: (Parent Node a, Pointer p a, MonadIO m, ForeignVectorRepresent v, ForeignElemConstr v (SharedPtr Component)) => p -- ^ Node pointer or pointer to ascentor -> m (v (SharedPtr Component)) nodeGetComponents p = liftIO $ do let ptr = parentPointer p peekForeignVectorAs =<< [C.exp| const VectorSharedComponentPtr* { &$(Node* ptr)->GetComponents()} |] -- | Return all components of type. Optionally recursive.
434
nodeGetComponents p = liftIO $ do let ptr = parentPointer p peekForeignVectorAs =<< [C.exp| const VectorSharedComponentPtr* { &$(Node* ptr)->GetComponents()} |] -- | Return all components of type. Optionally recursive.
223
false
true
2
12
68
115
57
58
null
null
ekmett/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxPREVIEW_PREVIOUS :: Int wxPREVIEW_PREVIOUS = 2
48
wxPREVIEW_PREVIOUS :: Int wxPREVIEW_PREVIOUS = 2
48
wxPREVIEW_PREVIOUS = 2
22
false
true
0
6
5
18
7
11
null
null
basvandijk/usb-safe
System/USB/Safe.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- *** Standard Device Requests -------------------------------------------------------------------------------- {- TODO: Think about which of these to export: setHalt ∷ DeviceHandle → EndpointAddress → Timeout → IO () clearRemoteWakeup ∷ DeviceHandle → Timeout → IO () setRemoteWakeup ∷ DeviceHandle → Timeout → IO () setStandardTestMode ∷ DeviceHandle → TestMode → Timeout → IO () getInterfaceAltSetting ∷ DeviceHandle → InterfaceNumber → Timeout → IO InterfaceAltSetting getDeviceStatus ∷ DeviceHandle → Timeout → IO DeviceStatus getEndpointStatus ∷ DeviceHandle → EndpointAddress → Timeout → IO Bool setDeviceAddress ∷ DeviceHandle → Word16 → Timeout → IO () synchFrame ∷ DeviceHandle → EndpointAddress → Timeout → IO Int -} -------------------------------------------------------------------------------- -- * String descriptors -------------------------------------------------------------------------------- {-| Retrieve a list of supported languages. This function may throw 'USB.USBException's. -} getLanguages ∷ (pr `AncestorRegion` cr, MonadIO cr) ⇒ RegionalDeviceHandle pr → cr [USB.LangId] getLanguages devHndl = liftIO $ USB.getLanguages (getInternalDevHndl devHndl)
1,414
getLanguages ∷ (pr `AncestorRegion` cr, MonadIO cr) ⇒ RegionalDeviceHandle pr → cr [USB.LangId] getLanguages devHndl = liftIO $ USB.getLanguages (getInternalDevHndl devHndl)
190
getLanguages devHndl = liftIO $ USB.getLanguages (getInternalDevHndl devHndl)
81
true
true
2
10
293
78
41
37
null
null
ghc-android/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
-- Char# ops translateOp dflags CharEqOp = Just (MO_Eq (wordWidth dflags))
81
translateOp dflags CharEqOp = Just (MO_Eq (wordWidth dflags))
67
translateOp dflags CharEqOp = Just (MO_Eq (wordWidth dflags))
67
true
false
0
9
17
27
13
14
null
null
goldfirere/th-desugar
Language/Haskell/TH/Desugar/Match.hs
bsd-3-clause
tidy1 _ DWildP = return (id, DWildP)
36
tidy1 _ DWildP = return (id, DWildP)
36
tidy1 _ DWildP = return (id, DWildP)
36
false
false
1
6
6
21
10
11
null
null
CharlesRandles/cryptoChallenge
aes.hs
gpl-3.0
vector = pack $ toString $ replicate aesBlocksize 0
52
vector = pack $ toString $ replicate aesBlocksize 0
52
vector = pack $ toString $ replicate aesBlocksize 0
52
false
false
1
6
9
22
9
13
null
null
robrix/derivative-parsing
src/Derivative/Lexer.hs
bsd-3-clause
compact :: Lexer t a -> Lexer t a compact = Fix . compactF . unFix
66
compact :: Lexer t a -> Lexer t a compact = Fix . compactF . unFix
66
compact = Fix . compactF . unFix
32
false
true
0
6
15
33
16
17
null
null
ssaavedra/liquidhaskell
tests/todo/ImportBound.hs
bsd-3-clause
{-@ by :: forall <p :: Proof -> Prop, q :: Proof -> Prop, r :: Proof -> Prop>. (Chain p q r) => Proof<p> -> Proof<q> -> Proof<r> @-} by :: Proof -> Proof -> Proof by _ r = r
191
by :: Proof -> Proof -> Proof by _ r = r
40
by _ r = r
10
true
true
0
8
59
31
14
17
null
null
harendra-kumar/unicode-transforms
Data/Unicode/Internal/NormalizeStream.hs
bsd-3-clause
writeRegBuf :: A.MArray s -> Int -> RegBuf -> ST s Int writeRegBuf arr i = \case RegOne c -> do n <- unsafeWrite arr i c return (i + n) RegMany st c [] -> case C.composePair st c of Just x -> do n <- unsafeWrite arr i x return (i + n) Nothing -> do n <- unsafeWrite arr i st m <- unsafeWrite arr (i + n) c return (i + n + m) RegMany st0 c0 cs0 -> go [] st0 (c0 : cs0) where -- arguments: uncombined chars, starter, unprocessed str go uncs st [] = writeStr arr i (st : uncs) go uncs st (c : cs) = case C.composePair st c of Nothing -> go (uncs ++ (c : same)) st bigger Just x -> go uncs x cs where cc = CC.getCombiningClass c (same, bigger) = span ((== cc) . CC.getCombiningClass) cs
891
writeRegBuf :: A.MArray s -> Int -> RegBuf -> ST s Int writeRegBuf arr i = \case RegOne c -> do n <- unsafeWrite arr i c return (i + n) RegMany st c [] -> case C.composePair st c of Just x -> do n <- unsafeWrite arr i x return (i + n) Nothing -> do n <- unsafeWrite arr i st m <- unsafeWrite arr (i + n) c return (i + n + m) RegMany st0 c0 cs0 -> go [] st0 (c0 : cs0) where -- arguments: uncombined chars, starter, unprocessed str go uncs st [] = writeStr arr i (st : uncs) go uncs st (c : cs) = case C.composePair st c of Nothing -> go (uncs ++ (c : same)) st bigger Just x -> go uncs x cs where cc = CC.getCombiningClass c (same, bigger) = span ((== cc) . CC.getCombiningClass) cs
891
writeRegBuf arr i = \case RegOne c -> do n <- unsafeWrite arr i c return (i + n) RegMany st c [] -> case C.composePair st c of Just x -> do n <- unsafeWrite arr i x return (i + n) Nothing -> do n <- unsafeWrite arr i st m <- unsafeWrite arr (i + n) c return (i + n + m) RegMany st0 c0 cs0 -> go [] st0 (c0 : cs0) where -- arguments: uncombined chars, starter, unprocessed str go uncs st [] = writeStr arr i (st : uncs) go uncs st (c : cs) = case C.composePair st c of Nothing -> go (uncs ++ (c : same)) st bigger Just x -> go uncs x cs where cc = CC.getCombiningClass c (same, bigger) = span ((== cc) . CC.getCombiningClass) cs
836
false
true
3
13
359
371
179
192
null
null
HIPERFIT/hopencl
tests/unit/HOpenCL/Device_Test.hs
bsd-3-clause
test_deviceExecutionCapabilities = void . deviceExecutionCapabilities
69
test_deviceExecutionCapabilities = void . deviceExecutionCapabilities
69
test_deviceExecutionCapabilities = void . deviceExecutionCapabilities
69
false
false
0
5
4
10
5
5
null
null
lukexi/ghc-7.8-arm64
compiler/codeGen/StgCmmEnv.hs
bsd-3-clause
getCgIdInfo :: Id -> FCode CgIdInfo getCgIdInfo id = do { dflags <- getDynFlags ; local_binds <- getBinds -- Try local bindings first ; case lookupVarEnv local_binds id of { Just info -> return info ; Nothing -> do { -- Should be imported; make up a CgIdInfo for it let name = idName id ; if isExternalName name then let ext_lbl = CmmLabel (mkClosureLabel name $ idCafInfo id) in return (litIdInfo dflags id (mkLFImported id) ext_lbl) else cgLookupPanic id -- Bug }}}
607
getCgIdInfo :: Id -> FCode CgIdInfo getCgIdInfo id = do { dflags <- getDynFlags ; local_binds <- getBinds -- Try local bindings first ; case lookupVarEnv local_binds id of { Just info -> return info ; Nothing -> do { -- Should be imported; make up a CgIdInfo for it let name = idName id ; if isExternalName name then let ext_lbl = CmmLabel (mkClosureLabel name $ idCafInfo id) in return (litIdInfo dflags id (mkLFImported id) ext_lbl) else cgLookupPanic id -- Bug }}}
607
getCgIdInfo id = do { dflags <- getDynFlags ; local_binds <- getBinds -- Try local bindings first ; case lookupVarEnv local_binds id of { Just info -> return info ; Nothing -> do { -- Should be imported; make up a CgIdInfo for it let name = idName id ; if isExternalName name then let ext_lbl = CmmLabel (mkClosureLabel name $ idCafInfo id) in return (litIdInfo dflags id (mkLFImported id) ext_lbl) else cgLookupPanic id -- Bug }}}
571
false
true
0
21
222
160
78
82
null
null
alexander-at-github/eta
compiler/ETA/HsSyn/HsTypes.hs
bsd-3-clause
-- Even if tvs is empty, we still make a HsForAll! -- In the Implicit case, this signals the place to do implicit quantification -- In the Explicit case, it prevents implicit quantification -- (see the sigtype production in Parser.y) -- so that (forall. ty) isn't implicitly quantified plus :: HsExplicitFlag -> HsExplicitFlag -> HsExplicitFlag Qualified `plus` Qualified = Qualified
426
plus :: HsExplicitFlag -> HsExplicitFlag -> HsExplicitFlag Qualified `plus` Qualified = Qualified
97
Qualified `plus` Qualified = Qualified
38
true
true
0
6
102
39
21
18
null
null
goldfirere/glambda
src/Language/Glambda/Eval.hs
bsd-3-clause
eval (IntE n) = IntVal n
32
eval (IntE n) = IntVal n
32
eval (IntE n) = IntVal n
32
false
false
0
7
13
18
8
10
null
null
begriffs/postgrest
src/PostgREST/QueryBuilder.hs
mit
requestToQuery :: Schema -> Bool -> DbRequest -> SqlQuery requestToQuery schema isParent (DbRead (Node (Select colSelects tbl tblAlias implJoins logicForest joinConditions_ ordts range, _) forest)) = unwords [ "SELECT " <> intercalate ", " (map (pgFmtSelectItem qi) colSelects ++ selects), "FROM " <> intercalate ", " (tabl : implJs), unwords joins, ("WHERE " <> intercalate " AND " (map (pgFmtLogicTree qi) logicForest ++ map pgFmtJoinCondition joinConditions_)) `emptyOnFalse` (null logicForest && null joinConditions_), ("ORDER BY " <> intercalate ", " (map (pgFmtOrderTerm qi) ordts)) `emptyOnFalse` null ordts, ("LIMIT " <> maybe "ALL" show (rangeLimit range) <> " OFFSET " <> show (rangeOffset range)) `emptyOnFalse` (isParent || range == allRange) ] where implJs = fromQi . QualifiedIdentifier schema <$> implJoins mainQi = removeSourceCTESchema schema tbl tabl = fromQi mainQi <> maybe mempty (\a -> " AS " <> pgFmtIdent a) tblAlias qi = maybe mainQi (QualifiedIdentifier mempty) tblAlias (joins, selects) = foldr getQueryParts ([],[]) forest getQueryParts :: Tree ReadNode -> ([SqlFragment], [SqlFragment]) -> ([SqlFragment], [SqlFragment]) getQueryParts (Node n@(_, (name, Just Relation{relType=Child,relTable=Table{tableName=table}}, alias, _, _)) forst) (j,s) = (j,sel:s) where sel = "COALESCE((" <> "SELECT json_agg(" <> pgFmtIdent table <> ".*) " <> "FROM (" <> subquery <> ") " <> pgFmtIdent table <> "), '[]') AS " <> pgFmtIdent (fromMaybe name alias) where subquery = requestToQuery schema False (DbRead (Node n forst)) getQueryParts (Node n@(_, (name, Just Relation{relType=Parent,relTable=Table{tableName=table}}, alias, _, _)) forst) (j,s) = (joi:j,sel:s) where aliasOrName = fromMaybe name alias localTableName = pgFmtIdent $ table <> "_" <> aliasOrName sel = "row_to_json(" <> localTableName <> ".*) AS " <> pgFmtIdent aliasOrName joi = " LEFT JOIN LATERAL( " <> subquery <> " ) AS " <> localTableName <> " ON TRUE " where subquery = requestToQuery schema True (DbRead (Node n forst)) getQueryParts (Node n@(_, (name, Just Relation{relType=Many,relTable=Table{tableName=table}}, alias, _, _)) forst) (j,s) = (j,sel:s) where sel = "COALESCE ((" <> "SELECT json_agg(" <> pgFmtIdent table <> ".*) " <> "FROM (" <> subquery <> ") " <> pgFmtIdent table <> "), '[]') AS " <> pgFmtIdent (fromMaybe name alias) where subquery = requestToQuery schema False (DbRead (Node n forst)) --the following is just to remove the warning --getQueryParts is not total but requestToQuery is called only after addJoinConditions which ensures the only --posible relations are Child Parent Many getQueryParts _ _ = witness
2,872
requestToQuery :: Schema -> Bool -> DbRequest -> SqlQuery requestToQuery schema isParent (DbRead (Node (Select colSelects tbl tblAlias implJoins logicForest joinConditions_ ordts range, _) forest)) = unwords [ "SELECT " <> intercalate ", " (map (pgFmtSelectItem qi) colSelects ++ selects), "FROM " <> intercalate ", " (tabl : implJs), unwords joins, ("WHERE " <> intercalate " AND " (map (pgFmtLogicTree qi) logicForest ++ map pgFmtJoinCondition joinConditions_)) `emptyOnFalse` (null logicForest && null joinConditions_), ("ORDER BY " <> intercalate ", " (map (pgFmtOrderTerm qi) ordts)) `emptyOnFalse` null ordts, ("LIMIT " <> maybe "ALL" show (rangeLimit range) <> " OFFSET " <> show (rangeOffset range)) `emptyOnFalse` (isParent || range == allRange) ] where implJs = fromQi . QualifiedIdentifier schema <$> implJoins mainQi = removeSourceCTESchema schema tbl tabl = fromQi mainQi <> maybe mempty (\a -> " AS " <> pgFmtIdent a) tblAlias qi = maybe mainQi (QualifiedIdentifier mempty) tblAlias (joins, selects) = foldr getQueryParts ([],[]) forest getQueryParts :: Tree ReadNode -> ([SqlFragment], [SqlFragment]) -> ([SqlFragment], [SqlFragment]) getQueryParts (Node n@(_, (name, Just Relation{relType=Child,relTable=Table{tableName=table}}, alias, _, _)) forst) (j,s) = (j,sel:s) where sel = "COALESCE((" <> "SELECT json_agg(" <> pgFmtIdent table <> ".*) " <> "FROM (" <> subquery <> ") " <> pgFmtIdent table <> "), '[]') AS " <> pgFmtIdent (fromMaybe name alias) where subquery = requestToQuery schema False (DbRead (Node n forst)) getQueryParts (Node n@(_, (name, Just Relation{relType=Parent,relTable=Table{tableName=table}}, alias, _, _)) forst) (j,s) = (joi:j,sel:s) where aliasOrName = fromMaybe name alias localTableName = pgFmtIdent $ table <> "_" <> aliasOrName sel = "row_to_json(" <> localTableName <> ".*) AS " <> pgFmtIdent aliasOrName joi = " LEFT JOIN LATERAL( " <> subquery <> " ) AS " <> localTableName <> " ON TRUE " where subquery = requestToQuery schema True (DbRead (Node n forst)) getQueryParts (Node n@(_, (name, Just Relation{relType=Many,relTable=Table{tableName=table}}, alias, _, _)) forst) (j,s) = (j,sel:s) where sel = "COALESCE ((" <> "SELECT json_agg(" <> pgFmtIdent table <> ".*) " <> "FROM (" <> subquery <> ") " <> pgFmtIdent table <> "), '[]') AS " <> pgFmtIdent (fromMaybe name alias) where subquery = requestToQuery schema False (DbRead (Node n forst)) --the following is just to remove the warning --getQueryParts is not total but requestToQuery is called only after addJoinConditions which ensures the only --posible relations are Child Parent Many getQueryParts _ _ = witness
2,872
requestToQuery schema isParent (DbRead (Node (Select colSelects tbl tblAlias implJoins logicForest joinConditions_ ordts range, _) forest)) = unwords [ "SELECT " <> intercalate ", " (map (pgFmtSelectItem qi) colSelects ++ selects), "FROM " <> intercalate ", " (tabl : implJs), unwords joins, ("WHERE " <> intercalate " AND " (map (pgFmtLogicTree qi) logicForest ++ map pgFmtJoinCondition joinConditions_)) `emptyOnFalse` (null logicForest && null joinConditions_), ("ORDER BY " <> intercalate ", " (map (pgFmtOrderTerm qi) ordts)) `emptyOnFalse` null ordts, ("LIMIT " <> maybe "ALL" show (rangeLimit range) <> " OFFSET " <> show (rangeOffset range)) `emptyOnFalse` (isParent || range == allRange) ] where implJs = fromQi . QualifiedIdentifier schema <$> implJoins mainQi = removeSourceCTESchema schema tbl tabl = fromQi mainQi <> maybe mempty (\a -> " AS " <> pgFmtIdent a) tblAlias qi = maybe mainQi (QualifiedIdentifier mempty) tblAlias (joins, selects) = foldr getQueryParts ([],[]) forest getQueryParts :: Tree ReadNode -> ([SqlFragment], [SqlFragment]) -> ([SqlFragment], [SqlFragment]) getQueryParts (Node n@(_, (name, Just Relation{relType=Child,relTable=Table{tableName=table}}, alias, _, _)) forst) (j,s) = (j,sel:s) where sel = "COALESCE((" <> "SELECT json_agg(" <> pgFmtIdent table <> ".*) " <> "FROM (" <> subquery <> ") " <> pgFmtIdent table <> "), '[]') AS " <> pgFmtIdent (fromMaybe name alias) where subquery = requestToQuery schema False (DbRead (Node n forst)) getQueryParts (Node n@(_, (name, Just Relation{relType=Parent,relTable=Table{tableName=table}}, alias, _, _)) forst) (j,s) = (joi:j,sel:s) where aliasOrName = fromMaybe name alias localTableName = pgFmtIdent $ table <> "_" <> aliasOrName sel = "row_to_json(" <> localTableName <> ".*) AS " <> pgFmtIdent aliasOrName joi = " LEFT JOIN LATERAL( " <> subquery <> " ) AS " <> localTableName <> " ON TRUE " where subquery = requestToQuery schema True (DbRead (Node n forst)) getQueryParts (Node n@(_, (name, Just Relation{relType=Many,relTable=Table{tableName=table}}, alias, _, _)) forst) (j,s) = (j,sel:s) where sel = "COALESCE ((" <> "SELECT json_agg(" <> pgFmtIdent table <> ".*) " <> "FROM (" <> subquery <> ") " <> pgFmtIdent table <> "), '[]') AS " <> pgFmtIdent (fromMaybe name alias) where subquery = requestToQuery schema False (DbRead (Node n forst)) --the following is just to remove the warning --getQueryParts is not total but requestToQuery is called only after addJoinConditions which ensures the only --posible relations are Child Parent Many getQueryParts _ _ = witness
2,814
false
true
0
17
635
973
518
455
null
null
FranklinChen/hugs98-plus-Sep2006
packages/HaXml/src/Text/XML/HaXml/Combinators.hs
bsd-3-clause
-- RECURSIVE SEARCH -- $recursive -- Recursive search has three variants: @deep@ does a breadth-first -- search of the tree, @deepest@ does a depth-first search, @multi@ returns -- content at all tree-levels, even those strictly contained within results -- that have already been returned. deep, deepest, multi :: CFilter i -> CFilter i deep f = f |>| (deep f `o` children)
377
deep, deepest, multi :: CFilter i -> CFilter i deep f = f |>| (deep f `o` children)
87
deep f = f |>| (deep f `o` children)
40
true
true
5
7
65
64
32
32
null
null
eddywestbrook/hobbits
src/Data/Binding/Hobbits/Internal/Name.hs
bsd-3-clause
-- | Apply a 'NameRefresher' to a 'Name' refreshName :: NameRefresher -> Name a -> Name a refreshName (NameRefresher nmap) (MkName i) = MkName $ IntMap.findWithDefault i i nmap
178
refreshName :: NameRefresher -> Name a -> Name a refreshName (NameRefresher nmap) (MkName i) = MkName $ IntMap.findWithDefault i i nmap
137
refreshName (NameRefresher nmap) (MkName i) = MkName $ IntMap.findWithDefault i i nmap
88
true
true
0
7
30
56
27
29
null
null
DanielWaterworth/Idris-dev
src/Idris/REPL.hs
bsd-3-clause
parseCodegen :: String -> Codegen parseCodegen "C" = ViaC
57
parseCodegen :: String -> Codegen parseCodegen "C" = ViaC
57
parseCodegen "C" = ViaC
23
false
true
0
5
8
18
9
9
null
null
thiry/DComp
src/Trans.hs
gpl-2.0
-- renaming db3 = trans [] [("michel","workfor","ensise")] db
61
db3 = trans [] [("michel","workfor","ensise")] db
49
db3 = trans [] [("michel","workfor","ensise")] db
49
true
false
1
7
7
33
16
17
null
null
vikraman/ghc
compiler/coreSyn/CoreUtils.hs
bsd-3-clause
coreAltsType :: [CoreAlt] -> Type -- ^ Returns the type of the first alternative, which should be the same as for all alternatives coreAltsType (alt:_) = coreAltType alt
169
coreAltsType :: [CoreAlt] -> Type coreAltsType (alt:_) = coreAltType alt
72
coreAltsType (alt:_) = coreAltType alt
38
true
true
0
7
27
32
17
15
null
null
randen/haddock
haddock-api/src/Haddock/Interface/Rename.hs
bsd-2-clause
renameInstHead :: InstHead Name -> RnM (InstHead DocName) renameInstHead InstHead {..} = do cname <- rename ihdClsName kinds <- mapM renameType ihdKinds types <- mapM renameType ihdTypes itype <- case ihdInstType of ClassInst { .. } -> ClassInst <$> mapM renameType clsiCtx <*> renameLHsQTyVars clsiTyVars <*> mapM renameSig clsiSigs <*> mapM renamePseudoFamilyDecl clsiAssocTys TypeInst ts -> TypeInst <$> traverse renameType ts DataInst dd -> DataInst <$> renameTyClD dd return InstHead { ihdClsName = cname , ihdKinds = kinds , ihdTypes = types , ihdInstType = itype }
649
renameInstHead :: InstHead Name -> RnM (InstHead DocName) renameInstHead InstHead {..} = do cname <- rename ihdClsName kinds <- mapM renameType ihdKinds types <- mapM renameType ihdTypes itype <- case ihdInstType of ClassInst { .. } -> ClassInst <$> mapM renameType clsiCtx <*> renameLHsQTyVars clsiTyVars <*> mapM renameSig clsiSigs <*> mapM renamePseudoFamilyDecl clsiAssocTys TypeInst ts -> TypeInst <$> traverse renameType ts DataInst dd -> DataInst <$> renameTyClD dd return InstHead { ihdClsName = cname , ihdKinds = kinds , ihdTypes = types , ihdInstType = itype }
649
renameInstHead InstHead {..} = do cname <- rename ihdClsName kinds <- mapM renameType ihdKinds types <- mapM renameType ihdTypes itype <- case ihdInstType of ClassInst { .. } -> ClassInst <$> mapM renameType clsiCtx <*> renameLHsQTyVars clsiTyVars <*> mapM renameSig clsiSigs <*> mapM renamePseudoFamilyDecl clsiAssocTys TypeInst ts -> TypeInst <$> traverse renameType ts DataInst dd -> DataInst <$> renameTyClD dd return InstHead { ihdClsName = cname , ihdKinds = kinds , ihdTypes = types , ihdInstType = itype }
591
false
true
38
7
164
190
98
92
null
null
ozgurakgun/cmdargs
System/Console/CmdArgs/Test/Implicit/Tests.hs
bsd-3-clause
mode11 = cmdArgsMode $ modes [test11A, test11B]
47
mode11 = cmdArgsMode $ modes [test11A, test11B]
47
mode11 = cmdArgsMode $ modes [test11A, test11B]
47
false
false
0
7
6
19
10
9
null
null
np/hlatex
Language/LaTeX/Printer.hs
bsd-3-clause
sp = text " "
13
sp = text " "
13
sp = text " "
13
false
false
1
5
4
13
4
9
null
null
johan--/twitter-conduit
Web/Twitter/Conduit/Request.hs
bsd-2-clause
paramValueBS :: PV -> ByteString paramValueBS (PVInteger i) = S8.pack . show $ i
80
paramValueBS :: PV -> ByteString paramValueBS (PVInteger i) = S8.pack . show $ i
80
paramValueBS (PVInteger i) = S8.pack . show $ i
47
false
true
0
7
13
34
17
17
null
null
akru/haste-compiler
src/Data/JSTarget/Optimize.hs
bsd-3-clause
getTailcallInfo _ = Nothing
58
getTailcallInfo _ = Nothing
58
getTailcallInfo _ = Nothing
58
false
false
0
5
34
9
4
5
null
null
chetant/rbm
AI/Data/MNIST.hs
bsd-3-clause
getTrainingImgs :: FilePath -> IO [Image] getTrainingImgs = getImgs openTrainingImgs
84
getTrainingImgs :: FilePath -> IO [Image] getTrainingImgs = getImgs openTrainingImgs
84
getTrainingImgs = getImgs openTrainingImgs
42
false
true
0
8
9
29
13
16
null
null
facebookincubator/duckling
Duckling/Dimensions.hs
bsd-3-clause
langDimensions DA = DADimensions.allDimensions
46
langDimensions DA = DADimensions.allDimensions
46
langDimensions DA = DADimensions.allDimensions
46
false
false
0
5
3
11
5
6
null
null
djudd/blokus
Offset.hs
gpl-3.0
toOffsets = map (uncurry Offsets)
33
toOffsets = map (uncurry Offsets)
33
toOffsets = map (uncurry Offsets)
33
false
false
0
7
4
15
7
8
null
null
shayan-najd/QFeldspar
Tests/CompareExamples.hs
gpl-3.0
qIPGray :: C.Dp (C.Ary C.Word32) -> C.Dp (C.Ary C.Word32) qIPGray = C.simplifyF (C.normaliseF True (Q.translateF IPGrayQ.ipgray))
129
qIPGray :: C.Dp (C.Ary C.Word32) -> C.Dp (C.Ary C.Word32) qIPGray = C.simplifyF (C.normaliseF True (Q.translateF IPGrayQ.ipgray))
129
qIPGray = C.simplifyF (C.normaliseF True (Q.translateF IPGrayQ.ipgray))
71
false
true
0
10
15
70
34
36
null
null
rodrigo-machado/verigraph
src/library/GrLang/Compiler.hs
gpl-3.0
getJoinableElems :: MonadGrLang m => [Annotated (Maybe Location) Text] -> GraphT m (Either ([GrNode], NodeType) ([GrEdge], NodeId, NodeId, EdgeType)) getJoinableElems [] = error "compileJoin: join expression with empty list of joined nodes"
284
getJoinableElems :: MonadGrLang m => [Annotated (Maybe Location) Text] -> GraphT m (Either ([GrNode], NodeType) ([GrEdge], NodeId, NodeId, EdgeType)) getJoinableElems [] = error "compileJoin: join expression with empty list of joined nodes"
284
getJoinableElems [] = error "compileJoin: join expression with empty list of joined nodes"
90
false
true
0
12
75
86
44
42
null
null
brentonashworth/sitecheck
src/Network/SiteCheck/Data.hs
bsd-3-clause
-- | Is the 'StatusCode' in a Link 301 or 302? isRedirect :: Link -> Bool isRedirect (Link _ _ (Code 301) _) = True
115
isRedirect :: Link -> Bool isRedirect (Link _ _ (Code 301) _) = True
68
isRedirect (Link _ _ (Code 301) _) = True
41
true
true
0
11
24
43
20
23
null
null
phischu/fragnix
tests/packages/scotty/Control.Monad.Trans.Writer.Lazy.hs
bsd-3-clause
-- | Construct a writer computation from a (result, output) pair. -- (The inverse of 'runWriter'.) writer :: (Monad m) => (a, w) -> WriterT w m a writer = WriterT . return
171
writer :: (Monad m) => (a, w) -> WriterT w m a writer = WriterT . return
72
writer = WriterT . return
25
true
true
0
7
32
43
24
19
null
null
semaj/jameslarisch.com-elm
server/Editor.hs
mit
-- | Create an HTML document that allows you to edit and submit Elm code -- for compilation. editor :: FilePath -> String -> Html editor filePath code = H.html $ do H.head $ do H.title . toHtml $ "Elm Editor: " ++ FP.takeBaseName filePath H.link ! A.rel "stylesheet" ! A.href "/codemirror-3.x/lib/codemirror.css" H.script ! A.src "/codemirror-3.x/lib/codemirror.js" $ mempty H.script ! A.src "/codemirror-3.x/mode/elm/elm.js" $ mempty mapM_ (\theme -> H.link ! A.rel "stylesheet" ! A.href (toValue ("/codemirror-3.x/theme/" ++ theme ++ ".css" :: String))) themes H.link ! A.rel "stylesheet" ! A.type_ "text/css" ! A.href "/misc/editor.css" H.script ! A.type_ "text/javascript" ! A.src "/misc/showdown.js" $ mempty H.script ! A.type_ "text/javascript" ! A.src "/misc/editor.js?0.11" $ mempty H.body $ do H.form ! A.id "inputForm" ! A.action "/compile" ! A.method "post" ! A.target "output" $ do H.div ! A.id "editor_box" $ H.textarea ! A.name "input" ! A.id "input" $ toHtml ('\n':code) H.div ! A.id "options" $ do bar "documentation" docs bar "editor_options" editorOptions bar "always_on" (buttons >> options) H.script ! A.type_ "text/javascript" $ "initEditor();"
1,337
editor :: FilePath -> String -> Html editor filePath code = H.html $ do H.head $ do H.title . toHtml $ "Elm Editor: " ++ FP.takeBaseName filePath H.link ! A.rel "stylesheet" ! A.href "/codemirror-3.x/lib/codemirror.css" H.script ! A.src "/codemirror-3.x/lib/codemirror.js" $ mempty H.script ! A.src "/codemirror-3.x/mode/elm/elm.js" $ mempty mapM_ (\theme -> H.link ! A.rel "stylesheet" ! A.href (toValue ("/codemirror-3.x/theme/" ++ theme ++ ".css" :: String))) themes H.link ! A.rel "stylesheet" ! A.type_ "text/css" ! A.href "/misc/editor.css" H.script ! A.type_ "text/javascript" ! A.src "/misc/showdown.js" $ mempty H.script ! A.type_ "text/javascript" ! A.src "/misc/editor.js?0.11" $ mempty H.body $ do H.form ! A.id "inputForm" ! A.action "/compile" ! A.method "post" ! A.target "output" $ do H.div ! A.id "editor_box" $ H.textarea ! A.name "input" ! A.id "input" $ toHtml ('\n':code) H.div ! A.id "options" $ do bar "documentation" docs bar "editor_options" editorOptions bar "always_on" (buttons >> options) H.script ! A.type_ "text/javascript" $ "initEditor();"
1,242
editor filePath code = H.html $ do H.head $ do H.title . toHtml $ "Elm Editor: " ++ FP.takeBaseName filePath H.link ! A.rel "stylesheet" ! A.href "/codemirror-3.x/lib/codemirror.css" H.script ! A.src "/codemirror-3.x/lib/codemirror.js" $ mempty H.script ! A.src "/codemirror-3.x/mode/elm/elm.js" $ mempty mapM_ (\theme -> H.link ! A.rel "stylesheet" ! A.href (toValue ("/codemirror-3.x/theme/" ++ theme ++ ".css" :: String))) themes H.link ! A.rel "stylesheet" ! A.type_ "text/css" ! A.href "/misc/editor.css" H.script ! A.type_ "text/javascript" ! A.src "/misc/showdown.js" $ mempty H.script ! A.type_ "text/javascript" ! A.src "/misc/editor.js?0.11" $ mempty H.body $ do H.form ! A.id "inputForm" ! A.action "/compile" ! A.method "post" ! A.target "output" $ do H.div ! A.id "editor_box" $ H.textarea ! A.name "input" ! A.id "input" $ toHtml ('\n':code) H.div ! A.id "options" $ do bar "documentation" docs bar "editor_options" editorOptions bar "always_on" (buttons >> options) H.script ! A.type_ "text/javascript" $ "initEditor();"
1,205
true
true
0
20
337
438
200
238
null
null
dimara/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- | The set of lvm-based disk templates dtsHaveAccess :: FrozenSet String dtsHaveAccess = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTRbd, DTGluster, DTExt]
168
dtsHaveAccess :: FrozenSet String dtsHaveAccess = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTRbd, DTGluster, DTExt]
127
dtsHaveAccess = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTRbd, DTGluster, DTExt]
93
true
true
1
6
22
41
20
21
null
null
andorp/bead
src/Bead/Persistence/SQL/MySQLTestRunner.hs
bsd-3-clause
createInterpreter :: IO () createInterpreter = do interp <- createPersistInterpreter defaultConfig writeIORef persistRef interp
131
createInterpreter :: IO () createInterpreter = do interp <- createPersistInterpreter defaultConfig writeIORef persistRef interp
131
createInterpreter = do interp <- createPersistInterpreter defaultConfig writeIORef persistRef interp
104
false
true
0
9
17
40
16
24
null
null
urbanslug/ghc
libraries/base/GHC/List.hs
bsd-3-clause
cycle xs = xs' where xs' = xs ++ xs' -- | 'takeWhile', applied to a predicate @p@ and a list @xs@, returns the -- longest prefix (possibly empty) of @xs@ of elements that satisfy @p@: -- -- > takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2] -- > takeWhile (< 9) [1,2,3] == [1,2,3] -- > takeWhile (< 0) [1,2,3] == [] --
330
cycle xs = xs' where xs' = xs ++ xs' -- | 'takeWhile', applied to a predicate @p@ and a list @xs@, returns the -- longest prefix (possibly empty) of @xs@ of elements that satisfy @p@: -- -- > takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2] -- > takeWhile (< 9) [1,2,3] == [1,2,3] -- > takeWhile (< 0) [1,2,3] == [] --
330
cycle xs = xs' where xs' = xs ++ xs' -- | 'takeWhile', applied to a predicate @p@ and a list @xs@, returns the -- longest prefix (possibly empty) of @xs@ of elements that satisfy @p@: -- -- > takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2] -- > takeWhile (< 9) [1,2,3] == [1,2,3] -- > takeWhile (< 0) [1,2,3] == [] --
330
false
false
2
5
79
34
17
17
null
null
nevrenato/Hets_Fork
Static/ArchDiagram.hs
gpl-2.0
insInclusionEdgesRev :: LogicGraph -> Diag -- ^ the diagram to insert edges to -> DiagNodeSig -- ^ the source node -> [DiagNodeSig] -- ^ the target nodes -> Result Diag -- ^ the diagram with edges inserted insInclusionEdgesRev lgraph diag0 (Diag_node_sig sn snsig) targetNodes = do let inslink diag dns = do d1 <- diag let d = diagGraph d1 case dns of Diag_node_sig n nsig -> do incl <- ginclusion lgraph (getSig snsig) (getSig nsig) return $ Diagram {diagGraph = insEdge (sn, n, DiagLink { dl_morphism = incl, dl_number = numberOfEdges d1 + 1 }) d, numberOfEdges = numberOfEdges d1 + 1} diag' <- foldl inslink (return diag0) targetNodes return diag' {- | Build a diagram that extends given diagram with a node containing given signature and with edges from given set of nodes to the new node. The new edges are labelled with sigature inclusions. -}
1,136
insInclusionEdgesRev :: LogicGraph -> Diag -- ^ the diagram to insert edges to -> DiagNodeSig -- ^ the source node -> [DiagNodeSig] -- ^ the target nodes -> Result Diag insInclusionEdgesRev lgraph diag0 (Diag_node_sig sn snsig) targetNodes = do let inslink diag dns = do d1 <- diag let d = diagGraph d1 case dns of Diag_node_sig n nsig -> do incl <- ginclusion lgraph (getSig snsig) (getSig nsig) return $ Diagram {diagGraph = insEdge (sn, n, DiagLink { dl_morphism = incl, dl_number = numberOfEdges d1 + 1 }) d, numberOfEdges = numberOfEdges d1 + 1} diag' <- foldl inslink (return diag0) targetNodes return diag' {- | Build a diagram that extends given diagram with a node containing given signature and with edges from given set of nodes to the new node. The new edges are labelled with sigature inclusions. -}
1,099
insInclusionEdgesRev lgraph diag0 (Diag_node_sig sn snsig) targetNodes = do let inslink diag dns = do d1 <- diag let d = diagGraph d1 case dns of Diag_node_sig n nsig -> do incl <- ginclusion lgraph (getSig snsig) (getSig nsig) return $ Diagram {diagGraph = insEdge (sn, n, DiagLink { dl_morphism = incl, dl_number = numberOfEdges d1 + 1 }) d, numberOfEdges = numberOfEdges d1 + 1} diag' <- foldl inslink (return diag0) targetNodes return diag' {- | Build a diagram that extends given diagram with a node containing given signature and with edges from given set of nodes to the new node. The new edges are labelled with sigature inclusions. -}
844
true
true
0
25
434
221
110
111
null
null
mbrock/HBEAM
src/Language/Erlang/BEAM/Opcodes.hs
gpl-3.0
opcodeInfo 4 = ("call", 2)
26
opcodeInfo 4 = ("call", 2)
26
opcodeInfo 4 = ("call", 2)
26
false
false
0
5
4
15
8
7
null
null
alekar/hugs
cpphs/Language/Preprocessor/Cpphs/SymTab.hs
bsd-3-clause
lookupST s ss = let vs = filter ((==s).fst) ((itind (hash s)) ss) in if null vs then Nothing else (Just . snd . head) vs
167
lookupST s ss = let vs = filter ((==s).fst) ((itind (hash s)) ss) in if null vs then Nothing else (Just . snd . head) vs
167
lookupST s ss = let vs = filter ((==s).fst) ((itind (hash s)) ss) in if null vs then Nothing else (Just . snd . head) vs
167
false
false
0
15
72
79
40
39
null
null
DavidAlphaFox/ghc
libraries/Cabal/Cabal/Distribution/Simple/GHC.hs
bsd-3-clause
supportsDynamicToo :: Compiler -> Bool supportsDynamicToo = Internal.ghcLookupProperty "Support dynamic-too"
108
supportsDynamicToo :: Compiler -> Bool supportsDynamicToo = Internal.ghcLookupProperty "Support dynamic-too"
108
supportsDynamicToo = Internal.ghcLookupProperty "Support dynamic-too"
69
false
true
0
6
9
20
10
10
null
null
centromere/cacophony
src/Crypto/Noise/Internal/Handshake/Pattern.hs
unlicense
-- | Constructs a 'HandshakePattern' given a protocol name (such as @XXpsk3@) -- and raw pattern. Please see the README for information about creating your -- own custom patterns. handshakePattern :: ByteString -> MessageSequence () -> HandshakePattern handshakePattern protoName ms = HandshakePattern protoName hasPSK ms where hasPSK = unPSK $ runAp_ scanS ms scanS (PreInitiator _ _) = mempty scanS (PreResponder _ _) = mempty scanS (Initiator mp _) = runAp_ scanP mp scanS (Responder mp _) = runAp_ scanP mp scanP (Psk _) = HasPSK True scanP _ = mempty
635
handshakePattern :: ByteString -> MessageSequence () -> HandshakePattern handshakePattern protoName ms = HandshakePattern protoName hasPSK ms where hasPSK = unPSK $ runAp_ scanS ms scanS (PreInitiator _ _) = mempty scanS (PreResponder _ _) = mempty scanS (Initiator mp _) = runAp_ scanP mp scanS (Responder mp _) = runAp_ scanP mp scanP (Psk _) = HasPSK True scanP _ = mempty
451
handshakePattern protoName ms = HandshakePattern protoName hasPSK ms where hasPSK = unPSK $ runAp_ scanS ms scanS (PreInitiator _ _) = mempty scanS (PreResponder _ _) = mempty scanS (Initiator mp _) = runAp_ scanP mp scanS (Responder mp _) = runAp_ scanP mp scanP (Psk _) = HasPSK True scanP _ = mempty
344
true
true
1
8
170
165
76
89
null
null
dougmvieira/MTSParser
MTS/LOB.hs
apache-2.0
proposalMatchingShortErrorLog :: AugmentedEventBook -> String proposalMatchingShortErrorLog (_, _, Just p, _, _) = unwords [unpack $ bondCode p, show $ date p, show $ time p] ++ ". Proposal matching error."
383
proposalMatchingShortErrorLog :: AugmentedEventBook -> String proposalMatchingShortErrorLog (_, _, Just p, _, _) = unwords [unpack $ bondCode p, show $ date p, show $ time p] ++ ". Proposal matching error."
383
proposalMatchingShortErrorLog (_, _, Just p, _, _) = unwords [unpack $ bondCode p, show $ date p, show $ time p] ++ ". Proposal matching error."
321
false
true
0
9
207
73
38
35
null
null
urv/fixhs
src/Data/FIX/Spec/FIX42.hs
lgpl-2.1
tSideValue1 :: FIXTag tSideValue1 = FIXTag { tName = "SideValue1" , tnum = 396 , tparser = toFIXDouble , arbitraryValue = FIXDouble <$> (return (-2.112 :: Double)) }
178
tSideValue1 :: FIXTag tSideValue1 = FIXTag { tName = "SideValue1" , tnum = 396 , tparser = toFIXDouble , arbitraryValue = FIXDouble <$> (return (-2.112 :: Double)) }
178
tSideValue1 = FIXTag { tName = "SideValue1" , tnum = 396 , tparser = toFIXDouble , arbitraryValue = FIXDouble <$> (return (-2.112 :: Double)) }
156
false
true
0
12
40
59
34
25
null
null
sol/depends
src/Config.hs
mit
load :: FilePath -> IO Config load path = do yaml <- Yaml.load path dir <- listToMaybe . reverse . splitDirectories <$> getCurrentDirectory let name = fromMaybe "dependencies" $ Yaml.lookup "name" yaml <|> dir deps sec = fromMaybe [] (Yaml.lookup sec yaml) mainDeps = deps "main" testDeps = deps "test" return (name, mainDeps, testDeps)
362
load :: FilePath -> IO Config load path = do yaml <- Yaml.load path dir <- listToMaybe . reverse . splitDirectories <$> getCurrentDirectory let name = fromMaybe "dependencies" $ Yaml.lookup "name" yaml <|> dir deps sec = fromMaybe [] (Yaml.lookup sec yaml) mainDeps = deps "main" testDeps = deps "test" return (name, mainDeps, testDeps)
362
load path = do yaml <- Yaml.load path dir <- listToMaybe . reverse . splitDirectories <$> getCurrentDirectory let name = fromMaybe "dependencies" $ Yaml.lookup "name" yaml <|> dir deps sec = fromMaybe [] (Yaml.lookup sec yaml) mainDeps = deps "main" testDeps = deps "test" return (name, mainDeps, testDeps)
332
false
true
0
13
79
135
64
71
null
null
shayan-najd/HsParser
U/UniqFM.hs
gpl-3.0
listToUFM_Directly = foldl (\m (u, v) -> addToUFM_Directly m u v) emptyUFM
74
listToUFM_Directly = foldl (\m (u, v) -> addToUFM_Directly m u v) emptyUFM
74
listToUFM_Directly = foldl (\m (u, v) -> addToUFM_Directly m u v) emptyUFM
74
false
false
0
8
11
34
18
16
null
null
beala/twitter-bot
src/OAuth.hs
bsd-3-clause
makeNonStreamingRequest :: (MonadIO m) => Request -> m (Response BL.ByteString) makeNonStreamingRequest req = do manager <- liftIO $ newManager tlsManagerSettings liftIO $ httpLbs req manager
202
makeNonStreamingRequest :: (MonadIO m) => Request -> m (Response BL.ByteString) makeNonStreamingRequest req = do manager <- liftIO $ newManager tlsManagerSettings liftIO $ httpLbs req manager
201
makeNonStreamingRequest req = do manager <- liftIO $ newManager tlsManagerSettings liftIO $ httpLbs req manager
115
false
true
0
9
35
64
30
34
null
null
Zankoku-Okuno/templar
src/Text/Templar/Parser.hs
gpl-3.0
--FIXME not just standard tag boilerblate, but allow anything after the slash parseEmpty :: Parse Template parseEmpty = tagBoilerplate (pure $ Literal "")
155
parseEmpty :: Parse Template parseEmpty = tagBoilerplate (pure $ Literal "")
76
parseEmpty = tagBoilerplate (pure $ Literal "")
47
true
true
0
8
23
34
15
19
null
null
vikraman/ghc
compiler/types/Coercion.hs
bsd-3-clause
-- | Make a representational reflexive coercion mkRepReflCo :: Type -> Coercion mkRepReflCo = mkReflCo Representational
119
mkRepReflCo :: Type -> Coercion mkRepReflCo = mkReflCo Representational
71
mkRepReflCo = mkReflCo Representational
39
true
true
0
5
15
19
10
9
null
null
tensorflow/haskell
tensorflow-opgen/src/TensorFlow/OpGen/ParsedOp.hs
apache-2.0
reservedKeywords :: Set.Set Text reservedKeywords = Set.fromList $ -- Haskell2010 keywords: -- https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-180002.4 -- We don't include keywords that are allowed to be variable names, -- in particular: "as", "forall", and "hiding". [ "case" , "class" , "data" , "default" , "deriving" , "do" , "else" , "foreign" , "if" , "import" , "in" , "infix" , "infixl" , "infixr" , "instance" , "let" , "module" , "newtype" , "of" , "then" , "type" , "where" ] ++ -- Nonstandard extensions [ "mdo" -- RecursiveDo , "rec" -- Arrows, RecursiveDo , "proc" -- Arrows ]
744
reservedKeywords :: Set.Set Text reservedKeywords = Set.fromList $ -- Haskell2010 keywords: -- https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-180002.4 -- We don't include keywords that are allowed to be variable names, -- in particular: "as", "forall", and "hiding". [ "case" , "class" , "data" , "default" , "deriving" , "do" , "else" , "foreign" , "if" , "import" , "in" , "infix" , "infixl" , "infixr" , "instance" , "let" , "module" , "newtype" , "of" , "then" , "type" , "where" ] ++ -- Nonstandard extensions [ "mdo" -- RecursiveDo , "rec" -- Arrows, RecursiveDo , "proc" -- Arrows ]
744
reservedKeywords = Set.fromList $ -- Haskell2010 keywords: -- https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-180002.4 -- We don't include keywords that are allowed to be variable names, -- in particular: "as", "forall", and "hiding". [ "case" , "class" , "data" , "default" , "deriving" , "do" , "else" , "foreign" , "if" , "import" , "in" , "infix" , "infixl" , "infixr" , "instance" , "let" , "module" , "newtype" , "of" , "then" , "type" , "where" ] ++ -- Nonstandard extensions [ "mdo" -- RecursiveDo , "rec" -- Arrows, RecursiveDo , "proc" -- Arrows ]
711
false
true
2
6
228
110
71
39
null
null
nstott/GradeLevel
src/NLP/Syllables.hs
bsd-3-clause
atEnd _ = False
15
atEnd _ = False
15
atEnd _ = False
15
false
false
0
4
3
10
4
6
null
null
kevinjardine/gruzeSnaplet
src/Snap/Snaplet/Gruze/Query.hs
gpl-2.0
queryRowToAggByObjCount :: GrzObjClass o => (GrzObj -> o) -- ^ type wrapper -> Map.Map Int GrzAtomBox -- ^ metadata -> [SqlValue] -- row from database -> (o,Int) -- resulting (obj,count) pair queryRowToAggByObjCount w m r = (obj, count) where count = (fromSql (r !! 8)) :: Int obj = w $ populateObj m (take 8 r)
400
queryRowToAggByObjCount :: GrzObjClass o => (GrzObj -> o) -- ^ type wrapper -> Map.Map Int GrzAtomBox -- ^ metadata -> [SqlValue] -- row from database -> (o,Int) queryRowToAggByObjCount w m r = (obj, count) where count = (fromSql (r !! 8)) :: Int obj = w $ populateObj m (take 8 r)
353
queryRowToAggByObjCount w m r = (obj, count) where count = (fromSql (r !! 8)) :: Int obj = w $ populateObj m (take 8 r)
144
true
true
4
11
144
119
63
56
null
null
hjwylde/werewolf
app/Game/Werewolf/Variant/Standard/Error.hs
bsd-3-clause
roleDoesNotExistText :: Text -> Text roleDoesNotExistText roleName = [iFile|variant/standard/error/command/start/role-does-not-exist.txt|]
138
roleDoesNotExistText :: Text -> Text roleDoesNotExistText roleName = [iFile|variant/standard/error/command/start/role-does-not-exist.txt|]
138
roleDoesNotExistText roleName = [iFile|variant/standard/error/command/start/role-does-not-exist.txt|]
101
false
true
0
5
8
22
13
9
null
null
wilbowma/accelerate
Data/Array/Accelerate/Language.hs
bsd-3-clause
-- |Variant of 'fold' that requires the reduced array to be non-empty and doesn't need an default -- value. -- fold1 :: (Shape ix, Elt a) => (Exp a -> Exp a -> Exp a) -> Acc (Array (ix:.Int) a) -> Acc (Array ix a) fold1 = Acc $$ Fold1
254
fold1 :: (Shape ix, Elt a) => (Exp a -> Exp a -> Exp a) -> Acc (Array (ix:.Int) a) -> Acc (Array ix a) fold1 = Acc $$ Fold1
142
fold1 = Acc $$ Fold1
20
true
true
0
12
69
90
46
44
null
null
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/DynamoDBTableGlobalSecondaryIndex.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-gsi.html#cfn-dynamodb-gsi-provisionedthroughput ddbtgsiProvisionedThroughput :: Lens' DynamoDBTableGlobalSecondaryIndex (Maybe DynamoDBTableProvisionedThroughput) ddbtgsiProvisionedThroughput = lens _dynamoDBTableGlobalSecondaryIndexProvisionedThroughput (\s a -> s { _dynamoDBTableGlobalSecondaryIndexProvisionedThroughput = a })
421
ddbtgsiProvisionedThroughput :: Lens' DynamoDBTableGlobalSecondaryIndex (Maybe DynamoDBTableProvisionedThroughput) ddbtgsiProvisionedThroughput = lens _dynamoDBTableGlobalSecondaryIndexProvisionedThroughput (\s a -> s { _dynamoDBTableGlobalSecondaryIndexProvisionedThroughput = a })
282
ddbtgsiProvisionedThroughput = lens _dynamoDBTableGlobalSecondaryIndexProvisionedThroughput (\s a -> s { _dynamoDBTableGlobalSecondaryIndexProvisionedThroughput = a })
167
true
true
0
9
21
46
25
21
null
null
Concomitant/LambdaHack
Game/LambdaHack/Common/File.hs
bsd-3-clause
-- | Serialize, compress and save data. -- Note that LBS.writeFile opens the file in binary mode. encodeData :: Binary a => FilePath -> a -> IO () encodeData f a = do let tmpPath = f <.> "tmp" Ex.bracketOnError (openBinaryFile tmpPath WriteMode) (\h -> hClose h >> removeFile tmpPath) (\h -> do LBS.hPut h . Z.compress . encode $ a hClose h renameFile tmpPath f ) -- | Serialize, compress and save data with an EOF marker. -- The @OK@ is used as an EOF marker to ensure any apparent problems with -- corrupted files are reported to the user ASAP.
588
encodeData :: Binary a => FilePath -> a -> IO () encodeData f a = do let tmpPath = f <.> "tmp" Ex.bracketOnError (openBinaryFile tmpPath WriteMode) (\h -> hClose h >> removeFile tmpPath) (\h -> do LBS.hPut h . Z.compress . encode $ a hClose h renameFile tmpPath f ) -- | Serialize, compress and save data with an EOF marker. -- The @OK@ is used as an EOF marker to ensure any apparent problems with -- corrupted files are reported to the user ASAP.
490
encodeData f a = do let tmpPath = f <.> "tmp" Ex.bracketOnError (openBinaryFile tmpPath WriteMode) (\h -> hClose h >> removeFile tmpPath) (\h -> do LBS.hPut h . Z.compress . encode $ a hClose h renameFile tmpPath f ) -- | Serialize, compress and save data with an EOF marker. -- The @OK@ is used as an EOF marker to ensure any apparent problems with -- corrupted files are reported to the user ASAP.
441
true
true
0
16
143
136
66
70
null
null
michaelsproul/tpg-analyser
src/Data/TPG.hs
gpl-3.0
isLandlineCall (chargeInfo -> Call Landline _ _) = True
55
isLandlineCall (chargeInfo -> Call Landline _ _) = True
55
isLandlineCall (chargeInfo -> Call Landline _ _) = True
55
false
false
0
8
8
23
11
12
null
null
wereHamster/yag
Git/Ref.hs
unlicense
-- | Expand a string into a full ref, according to the rules set by git. -- For example: "master"" -> "refs/heads/master" fullNameRef :: Repository -> String -> IO (Maybe String) fullNameRef repo name = firstTrue $ map testPath sympaths where testPath path = do found <- testRef path if found then return $ Just path else return Nothing testRef :: String -> IO Bool testRef path = do found <- doesFileExist ((gitDir repo) </> path) if found then return True else return False -- List of paths to search from "git help rev-parse". prefixes = ["", "refs", "refs/tags", "refs/heads", "refs/remotes"] sympaths = map (</> name) prefixes ++ ["refs/remotes" </> name </> "HEAD"] -- First expand the string then recursively resolve the ref into a hash.
828
fullNameRef :: Repository -> String -> IO (Maybe String) fullNameRef repo name = firstTrue $ map testPath sympaths where testPath path = do found <- testRef path if found then return $ Just path else return Nothing testRef :: String -> IO Bool testRef path = do found <- doesFileExist ((gitDir repo) </> path) if found then return True else return False -- List of paths to search from "git help rev-parse". prefixes = ["", "refs", "refs/tags", "refs/heads", "refs/remotes"] sympaths = map (</> name) prefixes ++ ["refs/remotes" </> name </> "HEAD"] -- First expand the string then recursively resolve the ref into a hash.
706
fullNameRef repo name = firstTrue $ map testPath sympaths where testPath path = do found <- testRef path if found then return $ Just path else return Nothing testRef :: String -> IO Bool testRef path = do found <- doesFileExist ((gitDir repo) </> path) if found then return True else return False -- List of paths to search from "git help rev-parse". prefixes = ["", "refs", "refs/tags", "refs/heads", "refs/remotes"] sympaths = map (</> name) prefixes ++ ["refs/remotes" </> name </> "HEAD"] -- First expand the string then recursively resolve the ref into a hash.
649
true
true
0
14
209
196
101
95
null
null
spetz911/progames
_src/lab3.hs
mit
newState :: Ball -> [[Bool]] -> (Ball, [[Bool]]) newState (p,st) field = let update a = a && not $ near 0.1 p (coords a) field1 = map (map update) field0 brokenBoxes = map near 0.1 p $ map coords $ foldl (++) [] field in (p, st)
244
newState :: Ball -> [[Bool]] -> (Ball, [[Bool]]) newState (p,st) field = let update a = a && not $ near 0.1 p (coords a) field1 = map (map update) field0 brokenBoxes = map near 0.1 p $ map coords $ foldl (++) [] field in (p, st)
244
newState (p,st) field = let update a = a && not $ near 0.1 p (coords a) field1 = map (map update) field0 brokenBoxes = map near 0.1 p $ map coords $ foldl (++) [] field in (p, st)
195
false
true
0
12
63
139
73
66
null
null
walck/learn-physics
src/Physics/Learn/BlochSphere.hs
bsd-3-clause
-- | A static 'VisObj' for the state of a qubit. staticBlochSphere :: Position -> VisObj staticBlochSphere r = RotEulerDeg (Euler 270 0 0) $ RotEulerDeg (Euler 0 180 0) $ VisObjects [ Sphere 1 Wireframe blue , Trans (v3FromPos r) (Sphere 0.05 Solid red) ]
299
staticBlochSphere :: Position -> VisObj staticBlochSphere r = RotEulerDeg (Euler 270 0 0) $ RotEulerDeg (Euler 0 180 0) $ VisObjects [ Sphere 1 Wireframe blue , Trans (v3FromPos r) (Sphere 0.05 Solid red) ]
250
staticBlochSphere r = RotEulerDeg (Euler 270 0 0) $ RotEulerDeg (Euler 0 180 0) $ VisObjects [ Sphere 1 Wireframe blue , Trans (v3FromPos r) (Sphere 0.05 Solid red) ]
210
true
true
0
9
89
96
45
51
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_MAX_GEOMETRY_VARYING_COMPONENTS_ARB :: GLenum gl_MAX_GEOMETRY_VARYING_COMPONENTS_ARB = 0x8DDD
96
gl_MAX_GEOMETRY_VARYING_COMPONENTS_ARB :: GLenum gl_MAX_GEOMETRY_VARYING_COMPONENTS_ARB = 0x8DDD
96
gl_MAX_GEOMETRY_VARYING_COMPONENTS_ARB = 0x8DDD
47
false
true
0
4
5
11
6
5
null
null
redneb/HsOpenSSL-x509-system
OpenSSL/X509/SystemStore.hs
bsd-3-clause
-- | Add the certificates from the system-wide certificate store to the -- given @openssl@ context. Note that in __older versions of OpenSSL__ -- (namely <1.1.0), this does not automatically enable peer certificate -- verification. In that case, -- you also need to call 'OpenSSL.Session.contextSetVerificationMode' and -- check manually if the hostname matches the one specified in the -- certificate. You can find information about how to do the latter -- <https://github.com/iSECPartners/ssl-conservatory/blob/master/openssl/everything-you-wanted-to-know-about-openssl.pdf here>. contextLoadSystemCerts :: SSLContext -> IO () contextLoadSystemCerts = S.contextLoadSystemCerts
679
contextLoadSystemCerts :: SSLContext -> IO () contextLoadSystemCerts = S.contextLoadSystemCerts
95
contextLoadSystemCerts = S.contextLoadSystemCerts
49
true
true
0
7
82
30
19
11
null
null
Lythimus/lptv
sites/all/modules/jgm-pandoc-8be6cc2/src/Text/Pandoc/Writers/Textile.hs
gpl-2.0
blockToTextile opts (Header level inlines) = do contents <- inlineListToTextile opts inlines let prefix = 'h' : (show level ++ ". ") return $ prefix ++ contents ++ "\n"
174
blockToTextile opts (Header level inlines) = do contents <- inlineListToTextile opts inlines let prefix = 'h' : (show level ++ ". ") return $ prefix ++ contents ++ "\n"
174
blockToTextile opts (Header level inlines) = do contents <- inlineListToTextile opts inlines let prefix = 'h' : (show level ++ ". ") return $ prefix ++ contents ++ "\n"
174
false
false
0
13
34
69
32
37
null
null
nevrenato/Hets_Fork
GUI/HTkGenericATP.hs
gpl-2.0
{- | Generates a ('ProofStatusColour', 'String') tuple representing a Running proof status. -} statusRunning :: (ProofStatusColour, String) statusRunning = (Blue, "Running")
177
statusRunning :: (ProofStatusColour, String) statusRunning = (Blue, "Running")
78
statusRunning = (Blue, "Running")
33
true
true
0
5
24
24
15
9
null
null
pbl64k/HackerRank-Contests
2014-12-19-FP/StockPrediction/sp.rt.hs
bsd-2-clause
rtcons 0 [] = (RtEmpty, (0, []), Nothing)
41
rtcons 0 [] = (RtEmpty, (0, []), Nothing)
41
rtcons 0 [] = (RtEmpty, (0, []), Nothing)
41
false
false
0
7
7
30
17
13
null
null
haslab/SecreC
src/Language/SecreC/TypeChecker/Statement.hs
gpl-3.0
tcStmt :: (ProverK loc m) => Type -- ^ return type -> Statement Identifier loc -- ^ input statement -> TcM m (Statement GIdentifier (Typed loc),Type) tcStmt ret (CompoundStatement l s) = tcStmtBlock l "compound statement" $ do (ss',t) <- tcLocal l "tcStmt compound" $ tcStmts ret s return (CompoundStatement (Typed l t) ss',t)
342
tcStmt :: (ProverK loc m) => Type -- ^ return type -> Statement Identifier loc -- ^ input statement -> TcM m (Statement GIdentifier (Typed loc),Type) tcStmt ret (CompoundStatement l s) = tcStmtBlock l "compound statement" $ do (ss',t) <- tcLocal l "tcStmt compound" $ tcStmts ret s return (CompoundStatement (Typed l t) ss',t)
342
tcStmt ret (CompoundStatement l s) = tcStmtBlock l "compound statement" $ do (ss',t) <- tcLocal l "tcStmt compound" $ tcStmts ret s return (CompoundStatement (Typed l t) ss',t)
184
false
true
0
13
69
134
66
68
null
null
beni55/fay
tests/PrefixOpPat.hs
bsd-3-clause
main :: Fay () main = do print $ f [1,2]
42
main :: Fay () main = do print $ f [1,2]
42
main = do print $ f [1,2]
27
false
true
0
9
12
32
16
16
null
null
kajigor/uKanren_transformations
app/console/CPDApp.hs
bsd-3-clause
run :: IO () run = do runMaxlen runMaxMin runPropEval -- runWithParser :: FilePath -> FilePath -> IO ()
110
run :: IO () run = do runMaxlen runMaxMin runPropEval -- runWithParser :: FilePath -> FilePath -> IO ()
110
run = do runMaxlen runMaxMin runPropEval -- runWithParser :: FilePath -> FilePath -> IO ()
97
false
true
0
7
25
32
13
19
null
null
vwwv/easy-bitcoin
Network/EasyBitcoin/Internal/CurveConstants.hs
bsd-3-clause
-- SECP256k1 curve parameters pairG :: (Integer, Integer) pairG = ( 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 , 0X483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 )
234
pairG :: (Integer, Integer) pairG = ( 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 , 0X483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 )
203
pairG = ( 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 , 0X483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 )
172
true
true
0
7
43
31
16
15
null
null
hmb-ba/protocol
src/Kafka/Protocol/Decode.hs
mit
rsMdPartitionMdParser :: Get RsMdPartitionMetadata rsMdPartitionMdParser = do errorcode <- getWord16be partition <- getWord32be leader <- getWord32be numreplicas <- getWord32be replicas <- parseList (fromIntegral numreplicas) getWord32be numIsr <- getWord32be isrs <- parseList (fromIntegral numIsr) getWord32be return $! RsMdPartitionMetadata errorcode partition leader numreplicas replicas numIsr isrs
457
rsMdPartitionMdParser :: Get RsMdPartitionMetadata rsMdPartitionMdParser = do errorcode <- getWord16be partition <- getWord32be leader <- getWord32be numreplicas <- getWord32be replicas <- parseList (fromIntegral numreplicas) getWord32be numIsr <- getWord32be isrs <- parseList (fromIntegral numIsr) getWord32be return $! RsMdPartitionMetadata errorcode partition leader numreplicas replicas numIsr isrs
457
rsMdPartitionMdParser = do errorcode <- getWord16be partition <- getWord32be leader <- getWord32be numreplicas <- getWord32be replicas <- parseList (fromIntegral numreplicas) getWord32be numIsr <- getWord32be isrs <- parseList (fromIntegral numIsr) getWord32be return $! RsMdPartitionMetadata errorcode partition leader numreplicas replicas numIsr isrs
406
false
true
0
11
97
113
49
64
null
null
Numberartificial/workflow
snipets/src/Craft/Chapter13.hs
mit
-- To insert an element at the right place into a sorted list. ins :: Ord a => a -> [a] -> [a] ins x [] = [x]
114
ins :: Ord a => a -> [a] -> [a] ins x [] = [x]
49
ins x [] = [x]
17
true
true
0
8
32
48
24
24
null
null
haskell-distributed/distributed-process
src/Control/Distributed/Process/Management.hs
bsd-3-clause
-- | Continue exeucting, prioritising inputs from the management event bus -- over the process' own /mailbox/. -- mxReceiveChan :: forall s. MxAgent s MxAction mxReceiveChan = return $ MxAgentPrioritise InputChan
212
mxReceiveChan :: forall s. MxAgent s MxAction mxReceiveChan = return $ MxAgentPrioritise InputChan
98
mxReceiveChan = return $ MxAgentPrioritise InputChan
52
true
true
0
6
30
31
17
14
null
null
fmapfmapfmap/amazonka
amazonka-route53/test/Test/AWS/Gen/Route53.hs
mpl-2.0
testListHealthChecksResponse :: ListHealthChecksResponse -> TestTree testListHealthChecksResponse = res "ListHealthChecksResponse" "fixture/ListHealthChecksResponse.proto" route53 (Proxy :: Proxy ListHealthChecks)
229
testListHealthChecksResponse :: ListHealthChecksResponse -> TestTree testListHealthChecksResponse = res "ListHealthChecksResponse" "fixture/ListHealthChecksResponse.proto" route53 (Proxy :: Proxy ListHealthChecks)
229
testListHealthChecksResponse = res "ListHealthChecksResponse" "fixture/ListHealthChecksResponse.proto" route53 (Proxy :: Proxy ListHealthChecks)
160
false
true
0
6
30
36
17
19
null
null
ivanperez-keera/Yampa
yampa/src/FRP/Yampa/Simulation.hs
bsd-3-clause
-- | 'deltaEncode' parameterized by the equality test. deltaEncodeBy :: (a -> a -> Bool) -> DTime -> [a] -> (a, [(DTime, Maybe a)]) deltaEncodeBy _ _ [] = usrErr "AFRP" "deltaEncodeBy" "Empty input list."
211
deltaEncodeBy :: (a -> a -> Bool) -> DTime -> [a] -> (a, [(DTime, Maybe a)]) deltaEncodeBy _ _ [] = usrErr "AFRP" "deltaEncodeBy" "Empty input list."
156
deltaEncodeBy _ _ [] = usrErr "AFRP" "deltaEncodeBy" "Empty input list."
79
true
true
0
11
41
72
39
33
null
null
igraves/flow-arrow
Control/Arrow/Flow.hs
bsd-3-clause
parchoice :: Monad m => [(a -> Bool, Flow m a b)] -> Flow m a b -> Flow m a b parchoice flows dflt = let totaled = (map (\(a,b) -> gate a b) flows) ++ [(gate (\_ -> True) dflt)] in (evalall totaled) </> match_just where --This function should be hidden because the totality of the choice is ensured --by its wrapper using the "default" function as the second argument --This is tacked onto the end of the list and is picked last if all other --choices fail match_just :: Monad m => Flow m [Maybe a] a match_just = Flow $ \i -> return (finished $ fromJust $ fromJust $ find (isJust) i, match_just) --Predicate Flow filters {-| Constructs a Flow by a given predicate. Stalls whenever input fails predicate test. -}
791
parchoice :: Monad m => [(a -> Bool, Flow m a b)] -> Flow m a b -> Flow m a b parchoice flows dflt = let totaled = (map (\(a,b) -> gate a b) flows) ++ [(gate (\_ -> True) dflt)] in (evalall totaled) </> match_just where --This function should be hidden because the totality of the choice is ensured --by its wrapper using the "default" function as the second argument --This is tacked onto the end of the list and is picked last if all other --choices fail match_just :: Monad m => Flow m [Maybe a] a match_just = Flow $ \i -> return (finished $ fromJust $ fromJust $ find (isJust) i, match_just) --Predicate Flow filters {-| Constructs a Flow by a given predicate. Stalls whenever input fails predicate test. -}
791
parchoice flows dflt = let totaled = (map (\(a,b) -> gate a b) flows) ++ [(gate (\_ -> True) dflt)] in (evalall totaled) </> match_just where --This function should be hidden because the totality of the choice is ensured --by its wrapper using the "default" function as the second argument --This is tacked onto the end of the list and is picked last if all other --choices fail match_just :: Monad m => Flow m [Maybe a] a match_just = Flow $ \i -> return (finished $ fromJust $ fromJust $ find (isJust) i, match_just) --Predicate Flow filters {-| Constructs a Flow by a given predicate. Stalls whenever input fails predicate test. -}
713
false
true
2
14
213
223
114
109
null
null
Tomoaki-Hashizaki/pesca
src/Sequent.hs
gpl-2.0
substVar :: [(Ident,Term)] -> Term -> Term substVar subst term = case term of Apply f terms -> Apply f (map (substVar subst) terms) Var x -> case lookup x subst of Just t -> t _ -> term _ -> term
279
substVar :: [(Ident,Term)] -> Term -> Term substVar subst term = case term of Apply f terms -> Apply f (map (substVar subst) terms) Var x -> case lookup x subst of Just t -> t _ -> term _ -> term
279
substVar subst term = case term of Apply f terms -> Apply f (map (substVar subst) terms) Var x -> case lookup x subst of Just t -> t _ -> term _ -> term
236
false
true
0
12
125
112
53
59
null
null
Yuras/mongodb
Database/MongoDB/Internal/Util.hs
apache-2.0
loop :: Monad m => m (Maybe a) -> m [a] -- ^ Repeatedy execute action, collecting results, until it returns Nothing loop act = act >>= maybe (return []) (\a -> (a :) `liftM` loop act)
183
loop :: Monad m => m (Maybe a) -> m [a] loop act = act >>= maybe (return []) (\a -> (a :) `liftM` loop act)
107
loop act = act >>= maybe (return []) (\a -> (a :) `liftM` loop act)
67
true
true
0
10
36
79
41
38
null
null
tom-szczarkowski/matasano-crypto-puzzles-solutions
set4/CryptoRandom.hs
mit
cryptoRandomChoice lst = cryptoRandomInteger (0, length lst - 1) >>= return . (lst !!)
93
cryptoRandomChoice lst = cryptoRandomInteger (0, length lst - 1) >>= return . (lst !!)
93
cryptoRandomChoice lst = cryptoRandomInteger (0, length lst - 1) >>= return . (lst !!)
93
false
false
1
9
20
41
19
22
null
null
peter-fogg/pardoc
tests/Tests/Old.hs
gpl-2.0
readFileUTF8 :: FilePath -> IO String readFileUTF8 f = B.readFile f >>= return . toStringLazy
93
readFileUTF8 :: FilePath -> IO String readFileUTF8 f = B.readFile f >>= return . toStringLazy
93
readFileUTF8 f = B.readFile f >>= return . toStringLazy
55
false
true
0
8
14
34
16
18
null
null
uuhan/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
doOp v (LTrunc ITBig (ITFixed to)) [x] = v ++ "idris_b" ++ show (nativeTyWidth to) ++ "const(vm, ISINT(" ++ creg x ++ ") ? GETINT(" ++ creg x ++ ") : mpz_get_ui(GETMPZ(" ++ creg x ++ ")))"
192
doOp v (LTrunc ITBig (ITFixed to)) [x] = v ++ "idris_b" ++ show (nativeTyWidth to) ++ "const(vm, ISINT(" ++ creg x ++ ") ? GETINT(" ++ creg x ++ ") : mpz_get_ui(GETMPZ(" ++ creg x ++ ")))"
192
doOp v (LTrunc ITBig (ITFixed to)) [x] = v ++ "idris_b" ++ show (nativeTyWidth to) ++ "const(vm, ISINT(" ++ creg x ++ ") ? GETINT(" ++ creg x ++ ") : mpz_get_ui(GETMPZ(" ++ creg x ++ ")))"
192
false
false
3
15
40
91
40
51
null
null
AlexeyRaga/eta
libraries/base/GHC/IO/Handle/Internals.hs
bsd-3-clause
-- ---------------------------------------------------------------------------- -- Text input/output -- Read characters into the provided buffer. Return when any -- characters are available; raise an exception if the end of -- file is reached. -- -- In uses of readTextDevice within base, the input buffer is either: -- * empty -- * or contains a single \r (when doing newline translation) -- -- The input character buffer must have a capacity at least 1 greater -- than the number of elements it currently contains. -- -- Users of this function expect that the buffer returned contains -- at least 1 more character than the input buffer. readTextDevice :: Handle__ -> CharBuffer -> IO CharBuffer readTextDevice h_@Handle__{..} cbuf = do -- bbuf0 <- readIORef haByteBuffer debugIO ("readTextDevice: cbuf=" ++ summaryBuffer cbuf ++ " bbuf=" ++ summaryBuffer bbuf0) bbuf1 <- if not (isEmptyBuffer bbuf0) then return bbuf0 else do (r,bbuf1) <- Buffered.fillReadBuffer haDevice bbuf0 if r == 0 then ioe_EOF else do -- raise EOF return bbuf1 debugIO ("readTextDevice after reading: bbuf=" ++ summaryBuffer bbuf1) (bbuf2,cbuf') <- case haDecoder of Nothing -> do writeIORef haLastDecode (error "codec_state", bbuf1) latin1_decode bbuf1 cbuf Just decoder -> do state <- getState decoder writeIORef haLastDecode (state, bbuf1) (streamEncode decoder) bbuf1 cbuf debugIO ("readTextDevice after decoding: cbuf=" ++ summaryBuffer cbuf' ++ " bbuf=" ++ summaryBuffer bbuf2) -- We can't return from readTextDevice without reading at least a single extra character, -- so check that we have managed to achieve that writeIORef haByteBuffer bbuf2 if bufR cbuf' == bufR cbuf -- we need more bytes to make a Char. NB: bbuf2 may be empty (even though bbuf1 wasn't) when we -- are using an encoding that can skip bytes without outputting characters, such as UTF8//IGNORE then readTextDevice' h_ bbuf2 cbuf else return cbuf' -- we have an incomplete byte sequence at the end of the buffer: try to -- read more bytes.
2,256
readTextDevice :: Handle__ -> CharBuffer -> IO CharBuffer readTextDevice h_@Handle__{..} cbuf = do -- bbuf0 <- readIORef haByteBuffer debugIO ("readTextDevice: cbuf=" ++ summaryBuffer cbuf ++ " bbuf=" ++ summaryBuffer bbuf0) bbuf1 <- if not (isEmptyBuffer bbuf0) then return bbuf0 else do (r,bbuf1) <- Buffered.fillReadBuffer haDevice bbuf0 if r == 0 then ioe_EOF else do -- raise EOF return bbuf1 debugIO ("readTextDevice after reading: bbuf=" ++ summaryBuffer bbuf1) (bbuf2,cbuf') <- case haDecoder of Nothing -> do writeIORef haLastDecode (error "codec_state", bbuf1) latin1_decode bbuf1 cbuf Just decoder -> do state <- getState decoder writeIORef haLastDecode (state, bbuf1) (streamEncode decoder) bbuf1 cbuf debugIO ("readTextDevice after decoding: cbuf=" ++ summaryBuffer cbuf' ++ " bbuf=" ++ summaryBuffer bbuf2) -- We can't return from readTextDevice without reading at least a single extra character, -- so check that we have managed to achieve that writeIORef haByteBuffer bbuf2 if bufR cbuf' == bufR cbuf -- we need more bytes to make a Char. NB: bbuf2 may be empty (even though bbuf1 wasn't) when we -- are using an encoding that can skip bytes without outputting characters, such as UTF8//IGNORE then readTextDevice' h_ bbuf2 cbuf else return cbuf' -- we have an incomplete byte sequence at the end of the buffer: try to -- read more bytes.
1,611
readTextDevice h_@Handle__{..} cbuf = do -- bbuf0 <- readIORef haByteBuffer debugIO ("readTextDevice: cbuf=" ++ summaryBuffer cbuf ++ " bbuf=" ++ summaryBuffer bbuf0) bbuf1 <- if not (isEmptyBuffer bbuf0) then return bbuf0 else do (r,bbuf1) <- Buffered.fillReadBuffer haDevice bbuf0 if r == 0 then ioe_EOF else do -- raise EOF return bbuf1 debugIO ("readTextDevice after reading: bbuf=" ++ summaryBuffer bbuf1) (bbuf2,cbuf') <- case haDecoder of Nothing -> do writeIORef haLastDecode (error "codec_state", bbuf1) latin1_decode bbuf1 cbuf Just decoder -> do state <- getState decoder writeIORef haLastDecode (state, bbuf1) (streamEncode decoder) bbuf1 cbuf debugIO ("readTextDevice after decoding: cbuf=" ++ summaryBuffer cbuf' ++ " bbuf=" ++ summaryBuffer bbuf2) -- We can't return from readTextDevice without reading at least a single extra character, -- so check that we have managed to achieve that writeIORef haByteBuffer bbuf2 if bufR cbuf' == bufR cbuf -- we need more bytes to make a Char. NB: bbuf2 may be empty (even though bbuf1 wasn't) when we -- are using an encoding that can skip bytes without outputting characters, such as UTF8//IGNORE then readTextDevice' h_ bbuf2 cbuf else return cbuf' -- we have an incomplete byte sequence at the end of the buffer: try to -- read more bytes.
1,553
true
true
1
16
572
348
171
177
null
null
emwap/syntactic
benchmarks/Normal.hs
bsd-3-clause
gadtExprIf n = (If (gadtExprIf (n-1) :== (LitI 0)) (gadtExprIf (n-1)) (gadtExprIf (n-1)))
89
gadtExprIf n = (If (gadtExprIf (n-1) :== (LitI 0)) (gadtExprIf (n-1)) (gadtExprIf (n-1)))
89
gadtExprIf n = (If (gadtExprIf (n-1) :== (LitI 0)) (gadtExprIf (n-1)) (gadtExprIf (n-1)))
89
false
false
0
11
12
68
35
33
null
null
robdockins/edison
edison-core/src/Data/Edison/Seq/SimpleQueue.hs
mit
foldrWithIndex = foldrWithIndexUsingLists
42
foldrWithIndex = foldrWithIndexUsingLists
42
foldrWithIndex = foldrWithIndexUsingLists
42
false
false
0
4
3
6
3
3
null
null
alexander-at-github/eta
compiler/ETA/Types/Type.hs
bsd-3-clause
mkPiKinds (tv:tvs) res | isKindVar tv = ForAllTy tv (mkPiKinds tvs res) | otherwise = FunTy (tyVarKind tv) (mkPiKinds tvs res)
142
mkPiKinds (tv:tvs) res | isKindVar tv = ForAllTy tv (mkPiKinds tvs res) | otherwise = FunTy (tyVarKind tv) (mkPiKinds tvs res)
142
mkPiKinds (tv:tvs) res | isKindVar tv = ForAllTy tv (mkPiKinds tvs res) | otherwise = FunTy (tyVarKind tv) (mkPiKinds tvs res)
142
false
false
1
8
36
66
31
35
null
null
lynnard/cocos2d-hs
src/Graphics/UI/Cocos2d/Director.hs
bsd-3-clause
director_getInstance :: HoppyP.IO Director director_getInstance = HoppyP.fmap Director (director_getInstance')
115
director_getInstance :: HoppyP.IO Director director_getInstance = HoppyP.fmap Director (director_getInstance')
115
director_getInstance = HoppyP.fmap Director (director_getInstance')
71
false
true
0
6
13
27
13
14
null
null
Schpin/schpin-chassis
schpin_robot_lib/src/Data/Shared.hs
gpl-3.0
toQuat :: Axis -> Angle -> Quaternion Double toQuat (V3 x y z) angle = axisAngle caxis cangle where caxis = V3 (x /~ mm) (y /~ mm) (z /~ mm) cangle = angle /~ U.radian
187
toQuat :: Axis -> Angle -> Quaternion Double toQuat (V3 x y z) angle = axisAngle caxis cangle where caxis = V3 (x /~ mm) (y /~ mm) (z /~ mm) cangle = angle /~ U.radian
187
toQuat (V3 x y z) angle = axisAngle caxis cangle where caxis = V3 (x /~ mm) (y /~ mm) (z /~ mm) cangle = angle /~ U.radian
142
false
true
0
9
55
88
45
43
null
null
ben-schulz/Idris-dev
src/Idris/Core/Typecheck.hs
bsd-3-clause
-- To check conversion, normalise each term wrt the current environment. -- Since we haven't converted everything to de Bruijn indices yet, we'll have to -- deal with alpha conversion - we do this by making each inner term de Bruijn -- indexed with 'finalise' convertsC :: Context -> Env -> Term -> Term -> StateT UCs TC () convertsC ctxt env x y = do let hs = map fst (filter isHole env) c1 <- convEq ctxt hs x y if c1 then return () else do c2 <- convEq ctxt hs (finalise (normalise ctxt env x)) (finalise (normalise ctxt env y)) if c2 then return () else lift $ tfail (CantConvert (finalise (normalise ctxt env x)) (finalise (normalise ctxt env y)) (errEnv env))
820
convertsC :: Context -> Env -> Term -> Term -> StateT UCs TC () convertsC ctxt env x y = do let hs = map fst (filter isHole env) c1 <- convEq ctxt hs x y if c1 then return () else do c2 <- convEq ctxt hs (finalise (normalise ctxt env x)) (finalise (normalise ctxt env y)) if c2 then return () else lift $ tfail (CantConvert (finalise (normalise ctxt env x)) (finalise (normalise ctxt env y)) (errEnv env))
559
convertsC ctxt env x y = do let hs = map fst (filter isHole env) c1 <- convEq ctxt hs x y if c1 then return () else do c2 <- convEq ctxt hs (finalise (normalise ctxt env x)) (finalise (normalise ctxt env y)) if c2 then return () else lift $ tfail (CantConvert (finalise (normalise ctxt env x)) (finalise (normalise ctxt env y)) (errEnv env))
495
true
true
0
18
279
222
109
113
null
null
ulricha/dsh
src/Database/DSH/CL/Primitives.hs
bsd-3-clause
gte :: Expr -> Expr -> Expr gte = scalarBinOp (L.SBRelOp L.GtE)
63
gte :: Expr -> Expr -> Expr gte = scalarBinOp (L.SBRelOp L.GtE)
63
gte = scalarBinOp (L.SBRelOp L.GtE)
35
false
true
0
8
11
38
17
21
null
null
deweyvm/labyrinth
src/Labyrinth/Util.hs
mit
-- | Compose a 3-argument function with a 1-argument function. (.::) :: (d -> e) -> (a -> b -> c -> d) -> (a -> b -> c -> e) (.::) = (.:) . (.)
143
(.::) :: (d -> e) -> (a -> b -> c -> d) -> (a -> b -> c -> e) (.::) = (.:) . (.)
80
(.::) = (.:) . (.)
18
true
true
0
10
35
69
41
28
null
null
yav/haskell-zipper
Data/Tree/Zipper.hs
mit
-- | Siblings before this position, closest first. before :: PosType t => TreePos t a -> Forest a before = _before
131
before :: PosType t => TreePos t a -> Forest a before = _before
80
before = _before
25
true
true
0
7
38
31
15
16
null
null
ulyssesp/AoC
src/day11.hs
bsd-3-clause
doMove :: State -> (Int, Move) -> State doMove s (i, (Move m)) = State i (fc & ix e -~ m & ix i +~ m) (p + 1) where (State e fc p) = s
143
doMove :: State -> (Int, Move) -> State doMove s (i, (Move m)) = State i (fc & ix e -~ m & ix i +~ m) (p + 1) where (State e fc p) = s
142
doMove s (i, (Move m)) = State i (fc & ix e -~ m & ix i +~ m) (p + 1) where (State e fc p) = s
102
false
true
0
11
45
105
52
53
null
null