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
hsyl20/ViperVM
haskus-system/src/lib/Haskus/Format/Elf/GHC.hs
bsd-3-clause
decode_lower 'q' = Just '\''
28
decode_lower 'q' = Just '\''
28
decode_lower 'q' = Just '\''
28
false
false
0
5
4
12
5
7
null
null
apyrgio/snf-ganeti
src/Ganeti/BasicTypes.hs
bsd-2-clause
-- | Iterate while Ok. iterateOk :: (a -> GenericResult b a) -> a -> [a] iterateOk f a = genericResult (const []) ((:) a . iterateOk f) (f a)
141
iterateOk :: (a -> GenericResult b a) -> a -> [a] iterateOk f a = genericResult (const []) ((:) a . iterateOk f) (f a)
118
iterateOk f a = genericResult (const []) ((:) a . iterateOk f) (f a)
68
true
true
0
8
29
76
39
37
null
null
snoyberg/orangeroster
Settings.hs
bsd-2-clause
withConnectionPool :: MonadPeelIO m => (ConnectionPool -> m a) -> m a withConnectionPool = withSqlitePool connStr connectionCount
129
withConnectionPool :: MonadPeelIO m => (ConnectionPool -> m a) -> m a withConnectionPool = withSqlitePool connStr connectionCount
129
withConnectionPool = withSqlitePool connStr connectionCount
59
false
true
0
9
16
40
19
21
null
null
rdnetto/H2V
H2V/DfdDef.hs
gpl-2.0
--resolve a token, which could be a variable or a function resolve :: String -> NodeGen DNode resolve name = do nodeCase <- resolveNode_ name funcCase <- resolveDFD_ name case (nodeCase, funcCase) of (Right n, _) -> return n (_, Right f) -> newId >>= \i -> return $ DFunction i f (Left (ResolutionException _ n1 n2), _) -> throw $ ResolutionException "node or DFD" n1 n2
407
resolve :: String -> NodeGen DNode resolve name = do nodeCase <- resolveNode_ name funcCase <- resolveDFD_ name case (nodeCase, funcCase) of (Right n, _) -> return n (_, Right f) -> newId >>= \i -> return $ DFunction i f (Left (ResolutionException _ n1 n2), _) -> throw $ ResolutionException "node or DFD" n1 n2
348
resolve name = do nodeCase <- resolveNode_ name funcCase <- resolveDFD_ name case (nodeCase, funcCase) of (Right n, _) -> return n (_, Right f) -> newId >>= \i -> return $ DFunction i f (Left (ResolutionException _ n1 n2), _) -> throw $ ResolutionException "node or DFD" n1 n2
313
true
true
0
13
103
142
70
72
null
null
actframework/FrameworkBenchmarks
frameworks/Haskell/yesod/yesod-mysql-mongo/src/yesod.hs
bsd-3-clause
documentToJson :: [Field] -> Value documentToJson = object . map toAssoc where toAssoc :: Field -> (Text, Value) toAssoc ("_id" := v) = ("id", toJSON v) toAssoc (l := v) = (l, toJSON v)
199
documentToJson :: [Field] -> Value documentToJson = object . map toAssoc where toAssoc :: Field -> (Text, Value) toAssoc ("_id" := v) = ("id", toJSON v) toAssoc (l := v) = (l, toJSON v)
199
documentToJson = object . map toAssoc where toAssoc :: Field -> (Text, Value) toAssoc ("_id" := v) = ("id", toJSON v) toAssoc (l := v) = (l, toJSON v)
164
false
true
0
7
47
91
49
42
null
null
urbanslug/ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
isStableSource :: UnfoldingSource -> Bool -- Keep the unfolding template isStableSource InlineCompulsory = True
113
isStableSource :: UnfoldingSource -> Bool isStableSource InlineCompulsory = True
82
isStableSource InlineCompulsory = True
40
true
true
0
7
15
25
11
14
null
null
Mattiemus/LaneWars
Game/Client/Resources.hs
mit
turretImage Red = loadImageKeyed "Assets/Sprites/turret_red.bmp"
64
turretImage Red = loadImageKeyed "Assets/Sprites/turret_red.bmp"
64
turretImage Red = loadImageKeyed "Assets/Sprites/turret_red.bmp"
64
false
false
0
5
4
12
5
7
null
null
uduki/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
withQListQColorDialogResult :: (Ptr (Ptr (TQColorDialog a)) -> IO CInt) -> IO [QColorDialog a] withQListQColorDialogResult f = withQListObjectResult qtc_QColorDialog_getFinalizer f
182
withQListQColorDialogResult :: (Ptr (Ptr (TQColorDialog a)) -> IO CInt) -> IO [QColorDialog a] withQListQColorDialogResult f = withQListObjectResult qtc_QColorDialog_getFinalizer f
182
withQListQColorDialogResult f = withQListObjectResult qtc_QColorDialog_getFinalizer f
87
false
true
0
12
20
57
27
30
null
null
ekmett/rope
Data/Rope/Annotated/Unsafe.hs
bsd-3-clause
uncons :: (BreakableA f, Unpackable t) => Ann a f -> Maybe (t, U f) uncons (A r a) = case Rope.uncons r of Just (c,cs) -> Just (c, A cs (dropA (Rope.length r - Rope.length cs) r a)) Nothing -> Nothing
208
uncons :: (BreakableA f, Unpackable t) => Ann a f -> Maybe (t, U f) uncons (A r a) = case Rope.uncons r of Just (c,cs) -> Just (c, A cs (dropA (Rope.length r - Rope.length cs) r a)) Nothing -> Nothing
208
uncons (A r a) = case Rope.uncons r of Just (c,cs) -> Just (c, A cs (dropA (Rope.length r - Rope.length cs) r a)) Nothing -> Nothing
140
false
true
3
11
49
123
63
60
null
null
Tuplanolla/eigenlanguage
haskell/Parser.hs
gpl-3.0
warnHere :: ParseWarning -> StatefulParser () warnHere w = getPosition >>= warn . f where f p = LLocation (sourceName p) (sourceLine p) (sourceColumn p) (WParse w)
164
warnHere :: ParseWarning -> StatefulParser () warnHere w = getPosition >>= warn . f where f p = LLocation (sourceName p) (sourceLine p) (sourceColumn p) (WParse w)
164
warnHere w = getPosition >>= warn . f where f p = LLocation (sourceName p) (sourceLine p) (sourceColumn p) (WParse w)
118
false
true
0
7
27
74
36
38
null
null
blacktaxi/inversion
src/Interval.hs
bsd-3-clause
tritone = dim5
14
tritone = dim5
14
tritone = dim5
14
false
false
0
4
2
6
3
3
null
null
dvolk/hoodie
Main.hs
gpl-3.0
moveEntityTo :: Entity -> Vector2 -> Game () moveEntityTo e newp = modifyEntity e ( modifyEntityPos newp . addEntityTime (itemUseCost e (equArmor (inv e))) )
193
moveEntityTo :: Entity -> Vector2 -> Game () moveEntityTo e newp = modifyEntity e ( modifyEntityPos newp . addEntityTime (itemUseCost e (equArmor (inv e))) )
193
moveEntityTo e newp = modifyEntity e ( modifyEntityPos newp . addEntityTime (itemUseCost e (equArmor (inv e))) )
148
false
true
0
14
60
67
32
35
null
null
pasberth/LeatherScript-prototype
Language/LeatherScript/LeatherShield.hs
mit
leatherShield (AST.Mul x y) = do xt <- leatherShield x yt <- leatherShield y if xt == SimpleTy "string" then return $ SimpleTy "string" else if yt == SimpleTy "string" then return $ SimpleTy "string" else if xt == yt then return xt else typeError $ TypeError xt yt
348
leatherShield (AST.Mul x y) = do xt <- leatherShield x yt <- leatherShield y if xt == SimpleTy "string" then return $ SimpleTy "string" else if yt == SimpleTy "string" then return $ SimpleTy "string" else if xt == yt then return xt else typeError $ TypeError xt yt
348
leatherShield (AST.Mul x y) = do xt <- leatherShield x yt <- leatherShield y if xt == SimpleTy "string" then return $ SimpleTy "string" else if yt == SimpleTy "string" then return $ SimpleTy "string" else if xt == yt then return xt else typeError $ TypeError xt yt
348
false
false
0
11
132
110
52
58
null
null
markus1189/xmonad-contrib-710
XMonad/Hooks/FadeInactive.hs
bsd-3-clause
-- | Fades a window by the specified amount if it satisfies the first query, otherwise -- makes it opaque. fadeIf :: Query Bool -> Rational -> Query Rational fadeIf qry amt = qry >>= \b -> return $ if b then amt else 1
218
fadeIf :: Query Bool -> Rational -> Query Rational fadeIf qry amt = qry >>= \b -> return $ if b then amt else 1
111
fadeIf qry amt = qry >>= \b -> return $ if b then amt else 1
60
true
true
0
8
44
53
28
25
null
null
cheme/nanomsg-hs
System/NanoMsg.hs
mit
-- | Please refer to nn_setsockopt(3) Manual Page -- Throws NanoError setIPV4ONLY :: Socket s -> Bool -> IO () setIPV4ONLY s v = setIntOption s NN_SOL_SOCKET NN_IPV4ONLY $ fromEnum v
182
setIPV4ONLY :: Socket s -> Bool -> IO () setIPV4ONLY s v = setIntOption s NN_SOL_SOCKET NN_IPV4ONLY $ fromEnum v
112
setIPV4ONLY s v = setIntOption s NN_SOL_SOCKET NN_IPV4ONLY $ fromEnum v
71
true
true
0
8
30
48
23
25
null
null
matterhorn-chat/matterhorn
src/Matterhorn/Draw/RichText.hs
bsd-3-clause
renderFlattenedValue :: Show a => Text -> FlattenedValue a -> Widget a renderFlattenedValue curUser (NonBreaking rs) = let renderLine = hBox . F.toList . fmap (renderFlattenedValue curUser) in vBox (F.toList $ renderLine <$> F.toList rs)
245
renderFlattenedValue :: Show a => Text -> FlattenedValue a -> Widget a renderFlattenedValue curUser (NonBreaking rs) = let renderLine = hBox . F.toList . fmap (renderFlattenedValue curUser) in vBox (F.toList $ renderLine <$> F.toList rs)
245
renderFlattenedValue curUser (NonBreaking rs) = let renderLine = hBox . F.toList . fmap (renderFlattenedValue curUser) in vBox (F.toList $ renderLine <$> F.toList rs)
174
false
true
0
12
42
94
44
50
null
null
sboosali/workflow-osx
workflow-osx/sources/Workflow/OSX/Bindings.hs
mit
setCursorPosition :: (MonadIO m) => CGPoint -> m () setCursorPosition (CGPoint x y) = liftIO $ do c_setCursorPosition x y -------------------------------------------------------------------------------- -- pressKey :: (MonadIO m) => CGKeyCode -> m () -- pressKey key = liftIO $ do -- pressKeyDown key -- pressKeyUp key
326
setCursorPosition :: (MonadIO m) => CGPoint -> m () setCursorPosition (CGPoint x y) = liftIO $ do c_setCursorPosition x y -------------------------------------------------------------------------------- -- pressKey :: (MonadIO m) => CGKeyCode -> m () -- pressKey key = liftIO $ do -- pressKeyDown key -- pressKeyUp key
326
setCursorPosition (CGPoint x y) = liftIO $ do c_setCursorPosition x y -------------------------------------------------------------------------------- -- pressKey :: (MonadIO m) => CGKeyCode -> m () -- pressKey key = liftIO $ do -- pressKeyDown key -- pressKeyUp key
274
false
true
0
8
51
57
30
27
null
null
a143753/AOJ
0357.hs
apache-2.0
ans (a:b:_) = (a + b) `div` 2
29
ans (a:b:_) = (a + b) `div` 2
29
ans (a:b:_) = (a + b) `div` 2
29
false
false
0
7
7
34
18
16
null
null
snoyberg/ghc
compiler/coreSyn/MkCore.hs
bsd-3-clause
castBottomExpr :: CoreExpr -> Type -> CoreExpr -- (castBottomExpr e ty), assuming that 'e' diverges, -- return an expression of type 'ty' -- See Note [Empty case alternatives] in CoreSyn castBottomExpr e res_ty | e_ty `eqType` res_ty = e | otherwise = Case e (mkWildValBinder e_ty) res_ty [] where e_ty = exprType e {- The functions from this point don't really do anything cleverer than their counterparts in CoreSyn, but they are here for consistency -} -- | Create a lambda where the given expression has a number of variables -- bound over it. The leftmost binder is that bound by the outermost -- lambda in the result
645
castBottomExpr :: CoreExpr -> Type -> CoreExpr castBottomExpr e res_ty | e_ty `eqType` res_ty = e | otherwise = Case e (mkWildValBinder e_ty) res_ty [] where e_ty = exprType e {- The functions from this point don't really do anything cleverer than their counterparts in CoreSyn, but they are here for consistency -} -- | Create a lambda where the given expression has a number of variables -- bound over it. The leftmost binder is that bound by the outermost -- lambda in the result
505
castBottomExpr e res_ty | e_ty `eqType` res_ty = e | otherwise = Case e (mkWildValBinder e_ty) res_ty [] where e_ty = exprType e {- The functions from this point don't really do anything cleverer than their counterparts in CoreSyn, but they are here for consistency -} -- | Create a lambda where the given expression has a number of variables -- bound over it. The leftmost binder is that bound by the outermost -- lambda in the result
458
true
true
1
8
130
78
42
36
null
null
BartAdv/hoogle
src/General/Conduit.hs
bsd-3-clause
mapMaybeC = C.mapMaybe
22
mapMaybeC = C.mapMaybe
22
mapMaybeC = C.mapMaybe
22
false
false
1
6
2
12
4
8
null
null
oldmanmike/ghc
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
amodeCouldBeClobbered :: Platform -> AddrMode -> Bool amodeCouldBeClobbered platform amode = any (regClobbered platform) (addrModeRegs amode)
141
amodeCouldBeClobbered :: Platform -> AddrMode -> Bool amodeCouldBeClobbered platform amode = any (regClobbered platform) (addrModeRegs amode)
141
amodeCouldBeClobbered platform amode = any (regClobbered platform) (addrModeRegs amode)
87
false
true
0
7
15
45
21
24
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
2558 = 2557
11
2558 = 2557
11
2558 = 2557
11
false
false
1
5
2
10
3
7
null
null
sdzivanovich/cs1699_deliverable5
Main.hs
bsd-3-clause
-- and of a singleton [Bool] is the Bool itself. prop_andOfSingleValueIsItself :: Bool -> Bool prop_andOfSingleValueIsItself b = My.and [b] == b
144
prop_andOfSingleValueIsItself :: Bool -> Bool prop_andOfSingleValueIsItself b = My.and [b] == b
95
prop_andOfSingleValueIsItself b = My.and [b] == b
49
true
true
0
7
21
37
17
20
null
null
Pancia/loki-lang
src/Parser.hs
mit
parseTuple :: Parser LokiVal parseTuple = inLitExpr "^{" "}" $ do vals <- many (parseLiteralExpr1 <* spaces) s <- getState return $ Tuple (newMeta s) vals
166
parseTuple :: Parser LokiVal parseTuple = inLitExpr "^{" "}" $ do vals <- many (parseLiteralExpr1 <* spaces) s <- getState return $ Tuple (newMeta s) vals
166
parseTuple = inLitExpr "^{" "}" $ do vals <- many (parseLiteralExpr1 <* spaces) s <- getState return $ Tuple (newMeta s) vals
137
false
true
0
12
37
71
31
40
null
null
ihc/futhark
src/Futhark/CodeGen/Backends/SimpleRepresentation.hs
isc
uintTypeToCType Int16 = [C.cty|typename uint16_t|]
50
uintTypeToCType Int16 = [C.cty|typename uint16_t|]
50
uintTypeToCType Int16 = [C.cty|typename uint16_t|]
50
false
false
0
5
4
15
9
6
null
null
nick0x01/Win32-services
examples/official.hs
bsd-3-clause
svcCtrlHandler _ _ _ INTERROGATE = return True
46
svcCtrlHandler _ _ _ INTERROGATE = return True
46
svcCtrlHandler _ _ _ INTERROGATE = return True
46
false
false
1
5
7
16
7
9
null
null
diku-dk/futhark
src/Language/Futhark/Parser/Monad.hs
isc
parseError (L loc tok, expected) = parseErrorAt loc . Just . unlines $ [ "unexpected " ++ show tok, "Expected one of the following: " ++ unwords expected ]
171
parseError (L loc tok, expected) = parseErrorAt loc . Just . unlines $ [ "unexpected " ++ show tok, "Expected one of the following: " ++ unwords expected ]
171
parseError (L loc tok, expected) = parseErrorAt loc . Just . unlines $ [ "unexpected " ++ show tok, "Expected one of the following: " ++ unwords expected ]
171
false
false
0
8
44
55
27
28
null
null
theor/zorkell
src/Header.hs
bsd-3-clause
-- getWord8 :: StoryReader a -- getWord8 = lift BS.getWord8 isAt :: StoryReader Int isAt = do x <- get return $ snd x -- lift $ return 1
147
isAt :: StoryReader Int isAt = do x <- get return $ snd x -- lift $ return 1
86
isAt = do x <- get return $ snd x -- lift $ return 1
62
true
true
0
8
39
34
17
17
null
null
spacekitteh/compdata
examples/Examples/Multi/Eval.hs
bsd-3-clause
projC :: (Value :<: v) => Term v Int -> Int projC v = case project v of Just (Const n) -> n
91
projC :: (Value :<: v) => Term v Int -> Int projC v = case project v of Just (Const n) -> n
91
projC v = case project v of Just (Const n) -> n
47
false
true
0
10
22
56
27
29
null
null
kmilner/tamarin-prover
lib/theory/src/Theory/Model/Fact.hs
gpl-3.0
-- | The multiplicity of a 'FactTag'. factTagMultiplicity :: FactTag -> Multiplicity factTagMultiplicity tag = case tag of ProtoFact multi _ _ -> multi KUFact -> Persistent KDFact -> Persistent _ -> Linear -- | The arity of a 'FactTag'.
297
factTagMultiplicity :: FactTag -> Multiplicity factTagMultiplicity tag = case tag of ProtoFact multi _ _ -> multi KUFact -> Persistent KDFact -> Persistent _ -> Linear -- | The arity of a 'FactTag'.
259
factTagMultiplicity tag = case tag of ProtoFact multi _ _ -> multi KUFact -> Persistent KDFact -> Persistent _ -> Linear -- | The arity of a 'FactTag'.
212
true
true
0
8
100
55
28
27
null
null
siddhanathan/ghc
compiler/hsSyn/HsUtils.hs
bsd-3-clause
coToHsWrapperR :: TcCoercion -> HsWrapper -- A Representational coercion coToHsWrapperR co | isTcReflCo co = idHsWrapper | otherwise = mkWpCast co
170
coToHsWrapperR :: TcCoercion -> HsWrapper coToHsWrapperR co | isTcReflCo co = idHsWrapper | otherwise = mkWpCast co
137
coToHsWrapperR co | isTcReflCo co = idHsWrapper | otherwise = mkWpCast co
95
true
true
0
8
44
40
18
22
null
null
aBhallo/AoC2016
Day 19/day19part1.hs
mit
main = do let input = 3018458 result = compute input print result
96
main = do let input = 3018458 result = compute input print result
96
main = do let input = 3018458 result = compute input print result
96
false
false
1
11
43
33
13
20
null
null
ducis/cassandra-minimalist
cassandra-cql-0.3.0.1/tests/test-list.hs
apache-2.0
selectT :: Query Rows () [Text] selectT = "select items from listst"
68
selectT :: Query Rows () [Text] selectT = "select items from listst"
68
selectT = "select items from listst"
36
false
true
0
7
11
29
13
16
null
null
siddhanathan/ghc
testsuite/tests/layout/layout007.hs
bsd-3-clause
-- The paren here closes the open-splice - it doesn't match an -- opening paren f :: IO () f = do print $( [| 'a' |] )
119
f :: IO () f = do print $( [| 'a' |] )
38
f = do print $( [| 'a' |] )
27
true
true
1
10
28
35
17
18
null
null
norm2782/uuagc
tools/Haskell2Ag.hs
bsd-3-clause
showType (UnBangedTy (TyParen ty)) = showType (UnBangedTy ty)
61
showType (UnBangedTy (TyParen ty)) = showType (UnBangedTy ty)
61
showType (UnBangedTy (TyParen ty)) = showType (UnBangedTy ty)
61
false
false
0
8
7
31
14
17
null
null
futtetennista/IntroductionToFunctionalProgramming
PiH/src/Chapter8.hs
mit
evalp s (And p1 p2) = evalp s p1 && evalp s p2
48
evalp s (And p1 p2) = evalp s p1 && evalp s p2
48
evalp s (And p1 p2) = evalp s p1 && evalp s p2
48
false
false
0
7
14
33
15
18
null
null
dbp/mealstrat
src/Lib.hs
isc
ingredientParser original = do n <- many1 digit d <- option 0 $ do char '.' n' <- many1 digit return (read ("0." ++ n')) let quantity = read n + d spaces unit <- option Single (choice [unitParser ["grams", "gram"] Grams ,unitParser ["ounces","oz","ounce"] Ounces ,unitParser ["lb", "lbs", "pounds"] Pounds ,unitParser ["cups", "cup"] Cups ,unitParser ["tablespoons", "tablespoon", "tbsp", "Tbsp"] Tablespoons ,unitParser ["teaspoons", "teaspoon", "tsp"] Teaspoons ,unitParser ["ccs", "cc", "cubic centimeters"] CCs]) spaces desc <- many1 (choice [alphaNum, space]) return (Ingredient 0 (T.strip $ T.pack desc) Nothing, RecipeIngredient 0 0 unit quantity original)
958
ingredientParser original = do n <- many1 digit d <- option 0 $ do char '.' n' <- many1 digit return (read ("0." ++ n')) let quantity = read n + d spaces unit <- option Single (choice [unitParser ["grams", "gram"] Grams ,unitParser ["ounces","oz","ounce"] Ounces ,unitParser ["lb", "lbs", "pounds"] Pounds ,unitParser ["cups", "cup"] Cups ,unitParser ["tablespoons", "tablespoon", "tbsp", "Tbsp"] Tablespoons ,unitParser ["teaspoons", "teaspoon", "tsp"] Teaspoons ,unitParser ["ccs", "cc", "cubic centimeters"] CCs]) spaces desc <- many1 (choice [alphaNum, space]) return (Ingredient 0 (T.strip $ T.pack desc) Nothing, RecipeIngredient 0 0 unit quantity original)
958
ingredientParser original = do n <- many1 digit d <- option 0 $ do char '.' n' <- many1 digit return (read ("0." ++ n')) let quantity = read n + d spaces unit <- option Single (choice [unitParser ["grams", "gram"] Grams ,unitParser ["ounces","oz","ounce"] Ounces ,unitParser ["lb", "lbs", "pounds"] Pounds ,unitParser ["cups", "cup"] Cups ,unitParser ["tablespoons", "tablespoon", "tbsp", "Tbsp"] Tablespoons ,unitParser ["teaspoons", "teaspoon", "tsp"] Teaspoons ,unitParser ["ccs", "cc", "cubic centimeters"] CCs]) spaces desc <- many1 (choice [alphaNum, space]) return (Ingredient 0 (T.strip $ T.pack desc) Nothing, RecipeIngredient 0 0 unit quantity original)
958
false
false
0
15
386
290
146
144
null
null
plumlife/cabal
Cabal/Distribution/PackageDescription/Configuration.hs
bsd-3-clause
biFillInDefaults :: BuildInfo -> BuildInfo biFillInDefaults bi = if null (hsSourceDirs bi) then bi { hsSourceDirs = [currentDir] } else bi
150
biFillInDefaults :: BuildInfo -> BuildInfo biFillInDefaults bi = if null (hsSourceDirs bi) then bi { hsSourceDirs = [currentDir] } else bi
150
biFillInDefaults bi = if null (hsSourceDirs bi) then bi { hsSourceDirs = [currentDir] } else bi
107
false
true
0
8
32
52
26
26
null
null
input-output-hk/pos-haskell-prototype
x509/test/Main.hs
mit
getValidServiceID :: TLSConfiguration -> ServiceID getValidServiceID tlsConf = (NonEmpty.head $ serverAltNames $ tlsServer tlsConf, "")
147
getValidServiceID :: TLSConfiguration -> ServiceID getValidServiceID tlsConf = (NonEmpty.head $ serverAltNames $ tlsServer tlsConf, "")
147
getValidServiceID tlsConf = (NonEmpty.head $ serverAltNames $ tlsServer tlsConf, "")
88
false
true
0
9
26
43
20
23
null
null
nikai3d/ce-challenges
moderate/number_pairs.hs
bsd-3-clause
numpairs (x:xs) y | x + z < y = numpairs xs y | x + z > y = numpairs (x : init xs) y | otherwise = (show x ++ "," ++ show z) : numpairs (init xs) y where z = last xs
219
numpairs (x:xs) y | x + z < y = numpairs xs y | x + z > y = numpairs (x : init xs) y | otherwise = (show x ++ "," ++ show z) : numpairs (init xs) y where z = last xs
219
numpairs (x:xs) y | x + z < y = numpairs xs y | x + z > y = numpairs (x : init xs) y | otherwise = (show x ++ "," ++ show z) : numpairs (init xs) y where z = last xs
219
false
false
1
10
99
135
59
76
null
null
wereHamster/github-webhook-handler
src/GitHub/WebHook/Handler.hs
mit
-- ^ A signature was included in the request but it did not match the -- secret key which was providid to the handler. Usually points to -- a configuration error on either end. toParseError :: String -> Either Error Payload toParseError = Left . ParseError . T.pack
279
toParseError :: String -> Either Error Payload toParseError = Left . ParseError . T.pack
88
toParseError = Left . ParseError . T.pack
41
true
true
0
6
61
33
18
15
null
null
Lainepress/hledger
hledger-web/Hledger/Web/Options.hs
gpl-3.0
defbaseurlexample = (reverse $ drop 4 $ reverse $ defbaseurl defport) ++ "PORT"
79
defbaseurlexample = (reverse $ drop 4 $ reverse $ defbaseurl defport) ++ "PORT"
79
defbaseurlexample = (reverse $ drop 4 $ reverse $ defbaseurl defport) ++ "PORT"
79
false
false
0
10
12
31
15
16
null
null
ml9951/ghc
compiler/rename/RnBinds.hs
bsd-3-clause
rnMatch :: Outputable (body RdrName) => HsMatchContext Name -> (Located (body RdrName) -> RnM (Located (body Name), FreeVars)) -> LMatch RdrName (Located (body RdrName)) -> RnM (LMatch Name (Located (body Name)), FreeVars) rnMatch ctxt rnBody = wrapLocFstM (rnMatch' ctxt rnBody)
303
rnMatch :: Outputable (body RdrName) => HsMatchContext Name -> (Located (body RdrName) -> RnM (Located (body Name), FreeVars)) -> LMatch RdrName (Located (body RdrName)) -> RnM (LMatch Name (Located (body Name)), FreeVars) rnMatch ctxt rnBody = wrapLocFstM (rnMatch' ctxt rnBody)
303
rnMatch ctxt rnBody = wrapLocFstM (rnMatch' ctxt rnBody)
56
false
true
0
15
63
132
64
68
null
null
chriseidhof/objc-value-objects
PPObjCSyntax.hs
mit
interface :: Interface -> Doc interface v@(Interface name properties methods) = vcat [ "@interface " <> text name , "" , vcat $ map property properties , "" , vcat $ map (s . methodDecl) methods , "" , "@end" ]
261
interface :: Interface -> Doc interface v@(Interface name properties methods) = vcat [ "@interface " <> text name , "" , vcat $ map property properties , "" , vcat $ map (s . methodDecl) methods , "" , "@end" ]
261
interface v@(Interface name properties methods) = vcat [ "@interface " <> text name , "" , vcat $ map property properties , "" , vcat $ map (s . methodDecl) methods , "" , "@end" ]
231
false
true
0
10
91
87
46
41
null
null
svenssonjoel/EmbArBB
Samples/Bench/dotprod.hs
bsd-3-clause
dotprod :: Exp (DVector Dim1 Double) -> Exp (DVector Dim1 Double) -> Exp Double dotprod v1 v2 = index0$ addReduce rows (v1 * v2)
129
dotprod :: Exp (DVector Dim1 Double) -> Exp (DVector Dim1 Double) -> Exp Double dotprod v1 v2 = index0$ addReduce rows (v1 * v2)
128
dotprod v1 v2 = index0$ addReduce rows (v1 * v2)
48
false
true
0
9
24
65
31
34
null
null
lukexi/ghc-7.8-arm64
utils/ghctags/Main.hs
bsd-3-clause
targetsAtOneGo :: [FileName] -> (Maybe Handle, Maybe Handle) -> Ghc () -- load a list of targets targetsAtOneGo hsfiles handles = do targets <- mapM (\f -> guessTarget f Nothing) hsfiles setTargets targets modgraph <- depanal [] False let mods = flattenSCCs $ topSortModuleGraph False modgraph Nothing graphData mods handles
334
targetsAtOneGo :: [FileName] -> (Maybe Handle, Maybe Handle) -> Ghc () targetsAtOneGo hsfiles handles = do targets <- mapM (\f -> guessTarget f Nothing) hsfiles setTargets targets modgraph <- depanal [] False let mods = flattenSCCs $ topSortModuleGraph False modgraph Nothing graphData mods handles
308
targetsAtOneGo hsfiles handles = do targets <- mapM (\f -> guessTarget f Nothing) hsfiles setTargets targets modgraph <- depanal [] False let mods = flattenSCCs $ topSortModuleGraph False modgraph Nothing graphData mods handles
237
true
true
0
12
59
123
56
67
null
null
gregorias/rummikubsolver
src/Interface/GUI.hs
gpl-3.0
groupList size ss = take size ss : groupList size (drop size ss)
64
groupList size ss = take size ss : groupList size (drop size ss)
64
groupList size ss = take size ss : groupList size (drop size ss)
64
false
false
1
8
12
37
15
22
null
null
ucsd-progsys/nanomaly
src/NanoML/Classify.hs
bsd-3-clause
typeBind :: MonadEval m => (Pat, Expr) -> m ([(Var, Type)], (Pat, TExpr)) typeBind (p, e) = do (tp, bnds) <- typePat p te <- typeExpr e -- t <- substM (getType te) -- traceShowM (pretty p, pretty t) -- tryUnify tp (getType te) emitCt tp (getType te) return (bnds, (p, te))
286
typeBind :: MonadEval m => (Pat, Expr) -> m ([(Var, Type)], (Pat, TExpr)) typeBind (p, e) = do (tp, bnds) <- typePat p te <- typeExpr e -- t <- substM (getType te) -- traceShowM (pretty p, pretty t) -- tryUnify tp (getType te) emitCt tp (getType te) return (bnds, (p, te))
286
typeBind (p, e) = do (tp, bnds) <- typePat p te <- typeExpr e -- t <- substM (getType te) -- traceShowM (pretty p, pretty t) -- tryUnify tp (getType te) emitCt tp (getType te) return (bnds, (p, te))
212
false
true
0
10
65
122
66
56
null
null
8c6794b6/tokyodystopia-haskell
Database/TokyoDystopia/IDB.hs
bsd-3-clause
-- -- Advanced features -- -- | Set file descriptor for debugging output. setdbgfd :: IDB -> Int -> IO () setdbgfd db dbg = FI.c_setdbgfd (unIDB db) (fromIntegral dbg)
168
setdbgfd :: IDB -> Int -> IO () setdbgfd db dbg = FI.c_setdbgfd (unIDB db) (fromIntegral dbg)
93
setdbgfd db dbg = FI.c_setdbgfd (unIDB db) (fromIntegral dbg)
61
true
true
0
8
30
52
27
25
null
null
kajigor/uKanren_transformations
test/cpd/Main.hs
bsd-3-clause
checkEmbed4 = embed [add [V 509, inc 31 (V 459), inc 17 zero]] [add [V 517, inc 24 (V 1044), V 516]] where zero = C "o" [] add args = Invoke "add" args inc 0 x = x inc n x = C "s" [inc (n-1) x]
231
checkEmbed4 = embed [add [V 509, inc 31 (V 459), inc 17 zero]] [add [V 517, inc 24 (V 1044), V 516]] where zero = C "o" [] add args = Invoke "add" args inc 0 x = x inc n x = C "s" [inc (n-1) x]
231
checkEmbed4 = embed [add [V 509, inc 31 (V 459), inc 17 zero]] [add [V 517, inc 24 (V 1044), V 516]] where zero = C "o" [] add args = Invoke "add" args inc 0 x = x inc n x = C "s" [inc (n-1) x]
231
false
false
5
10
85
167
71
96
null
null
bgamari/pandoc
src/Text/Pandoc/Readers/Markdown.hs
gpl-2.0
isHruleChar :: Char -> Bool isHruleChar '*' = True
50
isHruleChar :: Char -> Bool isHruleChar '*' = True
50
isHruleChar '*' = True
22
false
true
0
5
8
18
9
9
null
null
philipturnbull/quenelle
src/Quenelle/Match.hs
gpl-2.0
childExprs path e@(Paren pe _) = (path, e) : childExprs (path.paren_exprL) pe
81
childExprs path e@(Paren pe _) = (path, e) : childExprs (path.paren_exprL) pe
81
childExprs path e@(Paren pe _) = (path, e) : childExprs (path.paren_exprL) pe
81
false
false
2
7
15
49
22
27
null
null
neilh23/dotfiles
xmonad/xmonad.hs
mit
main = xmonad =<< xmobar myConfig
33
main = xmonad =<< xmobar myConfig
33
main = xmonad =<< xmobar myConfig
33
false
false
1
6
5
16
6
10
null
null
tjakway/ghcjvm
compiler/basicTypes/Literal.hs
bsd-3-clause
{- Note [Printing of literals in Core] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The function `add_par` is used to wrap parenthesis around negative integers (`LitInteger`) and labels (`MachLabel`), if they occur in a context requiring an atomic thing (for example function application). Although not all Core literals would be valid Haskell, we are trying to stay as close as possible to Haskell syntax in the printing of Core, to make it easier for a Haskell user to read Core. To that end: * We do print parenthesis around negative `LitInteger`, because we print `LitInteger` using plain number literals (no prefix or suffix), and plain number literals in Haskell require parenthesis in contexts like function application (i.e. `1 - -1` is not valid Haskell). * We don't print parenthesis around other (negative) literals, because they aren't needed in GHC/Haskell either (i.e. `1# -# -1#` is accepted by GHC's parser). Literal Output Output if context requires an atom (if different) ------- ------- ---------------------- MachChar 'a'# MachStr "aaa"# MachNullAddr "__NULL" MachInt -1# MachInt64 -1L# MachWord 1## MachWord64 1L## MachFloat -1.0# MachDouble -1.0## LitInteger -1 (-1) MachLabel "__label" ... ("__label" ...) -} {- ************************************************************************ * * \subsection{Hashing} * * ************************************************************************ Hash values should be zero or a positive integer. No negatives please. (They mess up the UniqFM for some reason.) -} hashLiteral :: Literal -> Int hashLiteral (MachChar c) = ord c + 1000
1,917
hashLiteral :: Literal -> Int hashLiteral (MachChar c) = ord c + 1000
76
hashLiteral (MachChar c) = ord c + 1000
46
true
true
0
7
554
33
17
16
null
null
GaloisInc/pads-haskell
Examples/First.hs
bsd-3-clause
checkVersion :: Method -> Version -> Bool checkVersion method version = case method of LINK -> major version == 1 && minor version == 0 UNLINK -> major version == 1 && minor version == 0 _ -> True
213
checkVersion :: Method -> Version -> Bool checkVersion method version = case method of LINK -> major version == 1 && minor version == 0 UNLINK -> major version == 1 && minor version == 0 _ -> True
213
checkVersion method version = case method of LINK -> major version == 1 && minor version == 0 UNLINK -> major version == 1 && minor version == 0 _ -> True
171
false
true
0
11
55
82
39
43
null
null
naushadh/persistent
persistent-mysql/Database/Persist/MySQL.hs
mit
showAlter table (n, Update' s) = concat [ "UPDATE " , escapeDBName table , " SET " , escapeDBName n , "=" , s , " WHERE " , escapeDBName n , " IS NULL" ]
197
showAlter table (n, Update' s) = concat [ "UPDATE " , escapeDBName table , " SET " , escapeDBName n , "=" , s , " WHERE " , escapeDBName n , " IS NULL" ]
197
showAlter table (n, Update' s) = concat [ "UPDATE " , escapeDBName table , " SET " , escapeDBName n , "=" , s , " WHERE " , escapeDBName n , " IS NULL" ]
197
false
false
0
7
79
59
32
27
null
null
kmate/imperative-edsl
src/Language/Embedded/CExp.hs
bsd-3-clause
-- | Cast integer to 'Bool' i2b :: Integral a => CExp a -> CExp Bool i2b a = constFold $ sugarSym (T $ Cast (/=0)) a
116
i2b :: Integral a => CExp a -> CExp Bool i2b a = constFold $ sugarSym (T $ Cast (/=0)) a
88
i2b a = constFold $ sugarSym (T $ Cast (/=0)) a
47
true
true
0
10
26
59
28
31
null
null
ForestPhoenix/FPSurvey
Forms/TakeSurvey.hs
mit
freeInputForm FreeText = Just $ mopt textField "This is no used" Nothing
76
freeInputForm FreeText = Just $ mopt textField "This is no used" Nothing
76
freeInputForm FreeText = Just $ mopt textField "This is no used" Nothing
76
false
false
0
6
15
20
9
11
null
null
wouwouwou/2017_module_8
src/haskell/series2/series2.hs
apache-2.0
firstNPrimes :: Int -> [Int] firstNPrimes x = take x (sieve [2..])
68
firstNPrimes :: Int -> [Int] firstNPrimes x = take x (sieve [2..])
68
firstNPrimes x = take x (sieve [2..])
39
false
true
0
8
13
35
18
17
null
null
conal/TV
src/Examples.hs
bsd-3-clause
perWord f = onWords (map f)
27
perWord f = onWords (map f)
27
perWord f = onWords (map f)
27
false
false
1
7
5
21
8
13
null
null
et4te/zero
server/src/Zero/SessionToken/Handlers.hs
bsd-3-clause
sessionNew :: SessionId -> Connection -> AuthTokenState -> Handler SessionBundle sessionNew sid conn (AuthTokenState (Left err)) = throwError $ err403 { errBody = L8.pack err }
178
sessionNew :: SessionId -> Connection -> AuthTokenState -> Handler SessionBundle sessionNew sid conn (AuthTokenState (Left err)) = throwError $ err403 { errBody = L8.pack err }
178
sessionNew sid conn (AuthTokenState (Left err)) = throwError $ err403 { errBody = L8.pack err }
97
false
true
2
9
27
69
32
37
null
null
brendanhay/gogol
gogol-run/gen/Network/Google/Resource/Run/Namespaces/Configurations/List.hs
mpl-2.0
-- | Optional. Encoded string to continue paging. nclContinue :: Lens' NamespacesConfigurationsList (Maybe Text) nclContinue = lens _nclContinue (\ s a -> s{_nclContinue = a})
177
nclContinue :: Lens' NamespacesConfigurationsList (Maybe Text) nclContinue = lens _nclContinue (\ s a -> s{_nclContinue = a})
127
nclContinue = lens _nclContinue (\ s a -> s{_nclContinue = a})
64
true
true
0
9
26
48
25
23
null
null
karamellpelle/MEnv
source/OpenGL/IOS/Values.hs
bsd-2-clause
gl_STENCIL_BACK_PASS_DEPTH_PASS :: GLenum gl_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803
82
gl_STENCIL_BACK_PASS_DEPTH_PASS :: GLenum gl_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803
82
gl_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803
40
false
true
0
4
5
11
6
5
null
null
haskell/haddock
hypsrc-test/src/Constructors.hs
bsd-2-clause
bar, baz, quux :: Foo bar = Bar
31
bar, baz, quux :: Foo bar = Bar
31
bar = Bar
9
false
true
4
6
7
30
11
19
null
null
frontrowed/stratosphere
library-gen/Stratosphere/Resources/NeptuneDBInstance.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbinstance.html#cfn-neptune-dbinstance-tags ndbiTags :: Lens' NeptuneDBInstance (Maybe [Tag]) ndbiTags = lens _neptuneDBInstanceTags (\s a -> s { _neptuneDBInstanceTags = a })
263
ndbiTags :: Lens' NeptuneDBInstance (Maybe [Tag]) ndbiTags = lens _neptuneDBInstanceTags (\s a -> s { _neptuneDBInstanceTags = a })
131
ndbiTags = lens _neptuneDBInstanceTags (\s a -> s { _neptuneDBInstanceTags = a })
81
true
true
0
9
21
49
27
22
null
null
zakharvoit/discrete-math-labs
Season2/LinearDataStructures/Brackets/Brackets.hs
gpl-3.0
main :: IO() main = interactFiles (unlines . (map (showBool . check)) . lines)
78
main :: IO() main = interactFiles (unlines . (map (showBool . check)) . lines)
78
main = interactFiles (unlines . (map (showBool . check)) . lines)
65
false
true
0
12
13
48
23
25
null
null
brendanhay/gogol
gogol-securitycenter/gen/Network/Google/SecurityCenter/Types/Product.hs
mpl-2.0
-- | Creates a value of 'GroupResultProperties' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'grpAddtional' groupResultProperties :: HashMap Text JSONValue -- ^ 'grpAddtional' -> GroupResultProperties groupResultProperties pGrpAddtional_ = GroupResultProperties' {_grpAddtional = _Coerce # pGrpAddtional_}
403
groupResultProperties :: HashMap Text JSONValue -- ^ 'grpAddtional' -> GroupResultProperties groupResultProperties pGrpAddtional_ = GroupResultProperties' {_grpAddtional = _Coerce # pGrpAddtional_}
207
groupResultProperties pGrpAddtional_ = GroupResultProperties' {_grpAddtional = _Coerce # pGrpAddtional_}
106
true
true
0
7
62
41
24
17
null
null
gitfoxi/vcd-haskell
app/avc-transpose.hs
agpl-3.0
dropComments :: [ByteString] -> [ByteString] dropComments = filter (not . B.isPrefixOf "#" ) . map ( B.dropWhile isSpace )
122
dropComments :: [ByteString] -> [ByteString] dropComments = filter (not . B.isPrefixOf "#" ) . map ( B.dropWhile isSpace )
122
dropComments = filter (not . B.isPrefixOf "#" ) . map ( B.dropWhile isSpace )
77
false
true
0
10
18
51
26
25
null
null
jwiegley/ghc-release
libraries/containers/Data/Sequence.hs
gpl-3.0
addDigits2 m1 (Two a b) c d (Two e f) m2 = appendTree2 m1 (node3 a b c) (node3 d e f) m2
92
addDigits2 m1 (Two a b) c d (Two e f) m2 = appendTree2 m1 (node3 a b c) (node3 d e f) m2
92
addDigits2 m1 (Two a b) c d (Two e f) m2 = appendTree2 m1 (node3 a b c) (node3 d e f) m2
92
false
false
0
7
26
64
31
33
null
null
ezyang/ghc
testsuite/tests/th/T11680.hs
bsd-3-clause
baz :: Bool baz = True
22
baz :: Bool baz = True
22
baz = True
10
false
true
0
6
5
18
7
11
null
null
nevrenato/Hets_Fork
HasCASL/hacapa.hs
gpl-2.0
toHStringParser :: Pretty a => (GlobalAnnos -> AParser () a) -> StringParser toHStringParser p ga = let newGa = addBuiltins ga in fmap (\ a -> showGlobalDoc newGa a "") $ p newGa
197
toHStringParser :: Pretty a => (GlobalAnnos -> AParser () a) -> StringParser toHStringParser p ga = let newGa = addBuiltins ga in fmap (\ a -> showGlobalDoc newGa a "") $ p newGa
197
toHStringParser p ga = let newGa = addBuiltins ga in fmap (\ a -> showGlobalDoc newGa a "") $ p newGa
105
false
true
0
11
51
80
38
42
null
null
rleshchinskiy/vector
Data/Vector/Generic.hs
bsd-3-clause
foldM_ m z = discard . Bundle.foldM m z . stream
48
foldM_ m z = discard . Bundle.foldM m z . stream
48
foldM_ m z = discard . Bundle.foldM m z . stream
48
false
false
0
8
10
26
12
14
null
null
phischu/fragnix
tests/packages/scotty/Data.Vector.Fusion.Bundle.Size.hs
bsd-3-clause
larger (Exact m) (Max n) | m >= n = Exact m | otherwise = Max n
97
larger (Exact m) (Max n) | m >= n = Exact m | otherwise = Max n
97
larger (Exact m) (Max n) | m >= n = Exact m | otherwise = Max n
97
false
false
0
8
50
48
21
27
null
null
rvion/lamdu
Lamdu/GUI/ExpressionEdit/HoleEdit/ResultGroups.hs
gpl-3.0
searchTermOfName :: Name m -> String searchTermOfName (Name _ NoCollision _ varName) = varName
94
searchTermOfName :: Name m -> String searchTermOfName (Name _ NoCollision _ varName) = varName
94
searchTermOfName (Name _ NoCollision _ varName) = varName
57
false
true
0
7
13
33
16
17
null
null
Cahu/krpc-hs
src/KRPCHS/SpaceCenter.hs
gpl-3.0
{- - The amount of thrust, in Newtons, that would be produced by the engine - when activated and fueled, with its throttle and throttle limiter set to 100%. -} getEngineMaxThrust :: KRPCHS.SpaceCenter.Engine -> RPCContext (Float) getEngineMaxThrust thisArg = do let r = makeRequest "SpaceCenter" "Engine_get_MaxThrust" [makeArgument 0 thisArg] res <- sendRequest r processResponse res
399
getEngineMaxThrust :: KRPCHS.SpaceCenter.Engine -> RPCContext (Float) getEngineMaxThrust thisArg = do let r = makeRequest "SpaceCenter" "Engine_get_MaxThrust" [makeArgument 0 thisArg] res <- sendRequest r processResponse res
236
getEngineMaxThrust thisArg = do let r = makeRequest "SpaceCenter" "Engine_get_MaxThrust" [makeArgument 0 thisArg] res <- sendRequest r processResponse res
166
true
true
0
13
69
73
33
40
null
null
josefs/sbv
Data/SBV/Examples/Crypto/RC4.hs
bsd-3-clause
decrypt :: String -> [SWord8] -> String decrypt key ct = map cvt $ zipWith xor (keyScheduleString key) ct where cvt = chr . fromIntegral . fromJust . unliteral ----------------------------------------------------------------------------- -- * Verification ----------------------------------------------------------------------------- -- | Prove that round-trip encryption/decryption leaves the plain-text unchanged. -- The theorem is stated parametrically over key and plain-text sizes. The expression -- performs the proof for a 40-bit key (5 bytes) and 40-bit plaintext (again 5 bytes). -- -- Note that this theorem is trivial to prove, since it is essentially establishing -- xor'in the same value twice leaves a word unchanged (i.e., @x `xor` y `xor` y = x@). -- However, the proof takes quite a while to complete, as it gives rise to a fairly -- large symbolic trace.
876
decrypt :: String -> [SWord8] -> String decrypt key ct = map cvt $ zipWith xor (keyScheduleString key) ct where cvt = chr . fromIntegral . fromJust . unliteral ----------------------------------------------------------------------------- -- * Verification ----------------------------------------------------------------------------- -- | Prove that round-trip encryption/decryption leaves the plain-text unchanged. -- The theorem is stated parametrically over key and plain-text sizes. The expression -- performs the proof for a 40-bit key (5 bytes) and 40-bit plaintext (again 5 bytes). -- -- Note that this theorem is trivial to prove, since it is essentially establishing -- xor'in the same value twice leaves a word unchanged (i.e., @x `xor` y `xor` y = x@). -- However, the proof takes quite a while to complete, as it gives rise to a fairly -- large symbolic trace.
876
decrypt key ct = map cvt $ zipWith xor (keyScheduleString key) ct where cvt = chr . fromIntegral . fromJust . unliteral ----------------------------------------------------------------------------- -- * Verification ----------------------------------------------------------------------------- -- | Prove that round-trip encryption/decryption leaves the plain-text unchanged. -- The theorem is stated parametrically over key and plain-text sizes. The expression -- performs the proof for a 40-bit key (5 bytes) and 40-bit plaintext (again 5 bytes). -- -- Note that this theorem is trivial to prove, since it is essentially establishing -- xor'in the same value twice leaves a word unchanged (i.e., @x `xor` y `xor` y = x@). -- However, the proof takes quite a while to complete, as it gives rise to a fairly -- large symbolic trace.
836
false
true
0
8
130
78
44
34
null
null
ecaustin/haskhol-math
src/HaskHOL/Lib/WF/PQ.hs
bsd-2-clause
-- Lift Parse Context and define quasi-quoter pcWF :: ParseContext pcWF = $(liftParseContext ctxtWF)
100
pcWF :: ParseContext pcWF = $(liftParseContext ctxtWF)
54
pcWF = $(liftParseContext ctxtWF)
33
true
true
0
8
13
26
11
15
null
null
prb/perpubplat
src/Blog/BackEnd/HttpPoller.hs
bsd-3-clause
handle_exception hnd (E.AsyncException E.ThreadKilled) = do { L.errorM hnd $ "Kill received; exiting gracefully." ; return False }
141
handle_exception hnd (E.AsyncException E.ThreadKilled) = do { L.errorM hnd $ "Kill received; exiting gracefully." ; return False }
141
handle_exception hnd (E.AsyncException E.ThreadKilled) = do { L.errorM hnd $ "Kill received; exiting gracefully." ; return False }
141
false
false
0
9
28
42
20
22
null
null
holoed/Junior
src/Ast.hs
apache-2.0
ifThenElse :: Exp -> Exp -> Exp -> Exp ifThenElse p e1 e2 = In (IfThenElse p e1 e2)
83
ifThenElse :: Exp -> Exp -> Exp -> Exp ifThenElse p e1 e2 = In (IfThenElse p e1 e2)
83
ifThenElse p e1 e2 = In (IfThenElse p e1 e2)
44
false
true
0
7
18
43
21
22
null
null
telser/numerals
src-test/Text/Numeral/Language/GIL/TestData.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- Test data -------------------------------------------------------------------------------- {- Sources: http://www.languagesandnumbers.com/how-to-count-in-gilbertese/en/gil/ -} cardinals ∷ (Num i) ⇒ TestData i cardinals = [ ( "default" , defaultInflection , [ (0, "akea") , (1, "teuana") , (2, "uoua") , (3, "tenua") , (4, "aua") , (5, "nimaua") , (6, "onoua") , (7, "itua") , (8, "wanua") , (9, "ruaiwa") , (10, "tebwina") , (11, "tebwi ma teuana") , (12, "tebwi ma uoua") , (13, "tebwi ma tenua") , (14, "tebwi ma aua") , (15, "tebwi ma nimaua") , (16, "tebwi ma onoua") , (17, "tebwi ma itua") , (18, "tebwi ma wanua") , (19, "tebwi ma ruaiwa") , (20, "uabwi") , (21, "uabwi ma teuana") , (22, "uabwi ma uoua") , (23, "uabwi ma tenua") , (24, "uabwi ma aua") , (25, "uabwi ma nimaua") , (26, "uabwi ma onoua") , (27, "uabwi ma itua") , (28, "uabwi ma wanua") , (29, "uabwi ma ruaiwa") , (30, "tenibwi") , (31, "tenibwi ma teuana") , (32, "tenibwi ma uoua") , (33, "tenibwi ma tenua") , (34, "tenibwi ma aua") , (35, "tenibwi ma nimaua") , (36, "tenibwi ma onoua") , (37, "tenibwi ma itua") , (38, "tenibwi ma wanua") , (39, "tenibwi ma ruaiwa") , (40, "abwi") , (41, "abwi ma teuana") , (42, "abwi ma uoua") , (43, "abwi ma tenua") , (44, "abwi ma aua") , (45, "abwi ma nimaua") , (46, "abwi ma onoua") , (47, "abwi ma itua") , (48, "abwi ma wanua") , (49, "abwi ma ruaiwa") , (50, "nimabwi") , (51, "nimabwi ma teuana") , (52, "nimabwi ma uoua") , (53, "nimabwi ma tenua") , (54, "nimabwi ma aua") , (55, "nimabwi ma nimaua") , (56, "nimabwi ma onoua") , (57, "nimabwi ma itua") , (58, "nimabwi ma wanua") , (59, "nimabwi ma ruaiwa") , (60, "onobwi") , (61, "onobwi ma teuana") , (62, "onobwi ma uoua") , (63, "onobwi ma tenua") , (64, "onobwi ma aua") , (65, "onobwi ma nimaua") , (66, "onobwi ma onoua") , (67, "onobwi ma itua") , (68, "onobwi ma wanua") , (69, "onobwi ma ruaiwa") , (70, "itibwi") , (71, "itibwi ma teuana") , (72, "itibwi ma uoua") , (73, "itibwi ma tenua") , (74, "itibwi ma aua") , (75, "itibwi ma nimaua") , (76, "itibwi ma onoua") , (77, "itibwi ma itua") , (78, "itibwi ma wanua") , (79, "itibwi ma ruaiwa") , (80, "wanibwi") , (81, "wanibwi ma teuana") , (82, "wanibwi ma uoua") , (83, "wanibwi ma tenua") , (84, "wanibwi ma aua") , (85, "wanibwi ma nimaua") , (86, "wanibwi ma onoua") , (87, "wanibwi ma itua") , (88, "wanibwi ma wanua") , (89, "wanibwi ma ruaiwa") , (90, "ruabwi") , (91, "ruabwi ma teuana") , (92, "ruabwi ma uoua") , (93, "ruabwi ma tenua") , (94, "ruabwi ma aua") , (95, "ruabwi ma nimaua") , (96, "ruabwi ma onoua") , (97, "ruabwi ma itua") , (98, "ruabwi ma wanua") , (99, "ruabwi ma ruaiwa") , (100, "tebubua") , (101, "tebubua ao teuana") , (102, "tebubua ao uoua") , (103, "tebubua ao tenua") , (104, "tebubua ao aua") , (105, "tebubua ao nimaua") , (106, "tebubua ao onoua") , (107, "tebubua ao itua") , (108, "tebubua ao wanua") , (109, "tebubua ao ruaiwa") , (110, "tebubua tebwina") , (123, "tebubua uabwi ma tenua") , (200, "uabubua") , (300, "tenibubua") , (321, "tenibubua uabwi ma teuana") , (400, "abubua") , (500, "nimabubua") , (600, "onobubua") , (700, "itibubua") , (800, "wanibubua") , (900, "ruabubua") , (909, "ruabubua ao ruaiwa") , (990, "ruabubua ruabwi") , (999, "ruabubua ruabwi ma ruaiwa") , (1000, "tengaa") , (1001, "tengaa ao teuana") , (1008, "tengaa ao wanua") , (1234, "tengaa uabubua tenibwi ma aua") , (2000, "uangaa") , (3000, "teningaa") , (4000, "angaa") , (4321, "angaa tenibubua uabwi ma teuana") , (5000, "nimangaa") , (6000, "onongaa") , (7000, "itingaa") , (8000, "waniengaa") , (9000, "ruangaa") , (10000, "tebwina tengaa") , (12345, "tebwi ma uoua tengaa tenibubua abwi ma nimaua") , (20000, "uabwi tengaa") , (30000, "tenibwi tengaa") , (40000, "abwi tengaa") , (50000, "nimabwi tengaa") , (54321, "nimabwi ma aua tengaa tenibubua uabwi ma teuana") , (60000, "onobwi tengaa") , (70000, "itibwi tengaa") , (80000, "wanibwi tengaa") , (90000, "ruabwi tengaa") , (100000, "tebubua tengaa") , (123456, "tebubua uabwi ma tenua tengaa abubua nimabwi ma onoua") , (200000, "uabubua tengaa") , (300000, "tenibubua tengaa") , (400000, "abubua tengaa") , (500000, "nimabubua tengaa") , (600000, "onobubua tengaa") , (654321, "onobubua nimabwi ma aua tengaa tenibubua uabwi ma teuana") , (700000, "itibubua tengaa") , (800000, "wanibubua tengaa") , (900000, "ruabubua tengaa") , (1000000, "te mirion") , (1000001, "te mirion, teuana") , (1234567, "te mirion, uabubua tenibwi ma aua tengaa nimabubua onobwi ma itua") , (2000000, "uoua te mirion") , (3000000, "tenua te mirion") , (4000000, "aua te mirion") , (5000000, "nimaua te mirion") , (6000000, "onoua te mirion") , (7000000, "itua te mirion") , (7654321, "itua te mirion, onobubua nimabwi ma aua tengaa tenibubua uabwi ma teuana") , (8000000, "wanua te mirion") , (9000000, "ruaiwa te mirion") , (1000000000, "te birian") , (1000000001, "te birian, teuana") , (2000000000, "uoua te birian") , (3000000000, "tenua te birian") , (4000000000, "aua te birian") , (5000000000, "nimaua te birian") , (6000000000, "onoua te birian") , (7000000000, "itua te birian") , (8000000000, "wanua te birian") , (9000000000, "ruaiwa te birian") ] ) ]
6,366
cardinals ∷ (Num i) ⇒ TestData i cardinals = [ ( "default" , defaultInflection , [ (0, "akea") , (1, "teuana") , (2, "uoua") , (3, "tenua") , (4, "aua") , (5, "nimaua") , (6, "onoua") , (7, "itua") , (8, "wanua") , (9, "ruaiwa") , (10, "tebwina") , (11, "tebwi ma teuana") , (12, "tebwi ma uoua") , (13, "tebwi ma tenua") , (14, "tebwi ma aua") , (15, "tebwi ma nimaua") , (16, "tebwi ma onoua") , (17, "tebwi ma itua") , (18, "tebwi ma wanua") , (19, "tebwi ma ruaiwa") , (20, "uabwi") , (21, "uabwi ma teuana") , (22, "uabwi ma uoua") , (23, "uabwi ma tenua") , (24, "uabwi ma aua") , (25, "uabwi ma nimaua") , (26, "uabwi ma onoua") , (27, "uabwi ma itua") , (28, "uabwi ma wanua") , (29, "uabwi ma ruaiwa") , (30, "tenibwi") , (31, "tenibwi ma teuana") , (32, "tenibwi ma uoua") , (33, "tenibwi ma tenua") , (34, "tenibwi ma aua") , (35, "tenibwi ma nimaua") , (36, "tenibwi ma onoua") , (37, "tenibwi ma itua") , (38, "tenibwi ma wanua") , (39, "tenibwi ma ruaiwa") , (40, "abwi") , (41, "abwi ma teuana") , (42, "abwi ma uoua") , (43, "abwi ma tenua") , (44, "abwi ma aua") , (45, "abwi ma nimaua") , (46, "abwi ma onoua") , (47, "abwi ma itua") , (48, "abwi ma wanua") , (49, "abwi ma ruaiwa") , (50, "nimabwi") , (51, "nimabwi ma teuana") , (52, "nimabwi ma uoua") , (53, "nimabwi ma tenua") , (54, "nimabwi ma aua") , (55, "nimabwi ma nimaua") , (56, "nimabwi ma onoua") , (57, "nimabwi ma itua") , (58, "nimabwi ma wanua") , (59, "nimabwi ma ruaiwa") , (60, "onobwi") , (61, "onobwi ma teuana") , (62, "onobwi ma uoua") , (63, "onobwi ma tenua") , (64, "onobwi ma aua") , (65, "onobwi ma nimaua") , (66, "onobwi ma onoua") , (67, "onobwi ma itua") , (68, "onobwi ma wanua") , (69, "onobwi ma ruaiwa") , (70, "itibwi") , (71, "itibwi ma teuana") , (72, "itibwi ma uoua") , (73, "itibwi ma tenua") , (74, "itibwi ma aua") , (75, "itibwi ma nimaua") , (76, "itibwi ma onoua") , (77, "itibwi ma itua") , (78, "itibwi ma wanua") , (79, "itibwi ma ruaiwa") , (80, "wanibwi") , (81, "wanibwi ma teuana") , (82, "wanibwi ma uoua") , (83, "wanibwi ma tenua") , (84, "wanibwi ma aua") , (85, "wanibwi ma nimaua") , (86, "wanibwi ma onoua") , (87, "wanibwi ma itua") , (88, "wanibwi ma wanua") , (89, "wanibwi ma ruaiwa") , (90, "ruabwi") , (91, "ruabwi ma teuana") , (92, "ruabwi ma uoua") , (93, "ruabwi ma tenua") , (94, "ruabwi ma aua") , (95, "ruabwi ma nimaua") , (96, "ruabwi ma onoua") , (97, "ruabwi ma itua") , (98, "ruabwi ma wanua") , (99, "ruabwi ma ruaiwa") , (100, "tebubua") , (101, "tebubua ao teuana") , (102, "tebubua ao uoua") , (103, "tebubua ao tenua") , (104, "tebubua ao aua") , (105, "tebubua ao nimaua") , (106, "tebubua ao onoua") , (107, "tebubua ao itua") , (108, "tebubua ao wanua") , (109, "tebubua ao ruaiwa") , (110, "tebubua tebwina") , (123, "tebubua uabwi ma tenua") , (200, "uabubua") , (300, "tenibubua") , (321, "tenibubua uabwi ma teuana") , (400, "abubua") , (500, "nimabubua") , (600, "onobubua") , (700, "itibubua") , (800, "wanibubua") , (900, "ruabubua") , (909, "ruabubua ao ruaiwa") , (990, "ruabubua ruabwi") , (999, "ruabubua ruabwi ma ruaiwa") , (1000, "tengaa") , (1001, "tengaa ao teuana") , (1008, "tengaa ao wanua") , (1234, "tengaa uabubua tenibwi ma aua") , (2000, "uangaa") , (3000, "teningaa") , (4000, "angaa") , (4321, "angaa tenibubua uabwi ma teuana") , (5000, "nimangaa") , (6000, "onongaa") , (7000, "itingaa") , (8000, "waniengaa") , (9000, "ruangaa") , (10000, "tebwina tengaa") , (12345, "tebwi ma uoua tengaa tenibubua abwi ma nimaua") , (20000, "uabwi tengaa") , (30000, "tenibwi tengaa") , (40000, "abwi tengaa") , (50000, "nimabwi tengaa") , (54321, "nimabwi ma aua tengaa tenibubua uabwi ma teuana") , (60000, "onobwi tengaa") , (70000, "itibwi tengaa") , (80000, "wanibwi tengaa") , (90000, "ruabwi tengaa") , (100000, "tebubua tengaa") , (123456, "tebubua uabwi ma tenua tengaa abubua nimabwi ma onoua") , (200000, "uabubua tengaa") , (300000, "tenibubua tengaa") , (400000, "abubua tengaa") , (500000, "nimabubua tengaa") , (600000, "onobubua tengaa") , (654321, "onobubua nimabwi ma aua tengaa tenibubua uabwi ma teuana") , (700000, "itibubua tengaa") , (800000, "wanibubua tengaa") , (900000, "ruabubua tengaa") , (1000000, "te mirion") , (1000001, "te mirion, teuana") , (1234567, "te mirion, uabubua tenibwi ma aua tengaa nimabubua onobwi ma itua") , (2000000, "uoua te mirion") , (3000000, "tenua te mirion") , (4000000, "aua te mirion") , (5000000, "nimaua te mirion") , (6000000, "onoua te mirion") , (7000000, "itua te mirion") , (7654321, "itua te mirion, onobubua nimabwi ma aua tengaa tenibubua uabwi ma teuana") , (8000000, "wanua te mirion") , (9000000, "ruaiwa te mirion") , (1000000000, "te birian") , (1000000001, "te birian, teuana") , (2000000000, "uoua te birian") , (3000000000, "tenua te birian") , (4000000000, "aua te birian") , (5000000000, "nimaua te birian") , (6000000000, "onoua te birian") , (7000000000, "itua te birian") , (8000000000, "wanua te birian") , (9000000000, "ruaiwa te birian") ] ) ]
6,102
cardinals = [ ( "default" , defaultInflection , [ (0, "akea") , (1, "teuana") , (2, "uoua") , (3, "tenua") , (4, "aua") , (5, "nimaua") , (6, "onoua") , (7, "itua") , (8, "wanua") , (9, "ruaiwa") , (10, "tebwina") , (11, "tebwi ma teuana") , (12, "tebwi ma uoua") , (13, "tebwi ma tenua") , (14, "tebwi ma aua") , (15, "tebwi ma nimaua") , (16, "tebwi ma onoua") , (17, "tebwi ma itua") , (18, "tebwi ma wanua") , (19, "tebwi ma ruaiwa") , (20, "uabwi") , (21, "uabwi ma teuana") , (22, "uabwi ma uoua") , (23, "uabwi ma tenua") , (24, "uabwi ma aua") , (25, "uabwi ma nimaua") , (26, "uabwi ma onoua") , (27, "uabwi ma itua") , (28, "uabwi ma wanua") , (29, "uabwi ma ruaiwa") , (30, "tenibwi") , (31, "tenibwi ma teuana") , (32, "tenibwi ma uoua") , (33, "tenibwi ma tenua") , (34, "tenibwi ma aua") , (35, "tenibwi ma nimaua") , (36, "tenibwi ma onoua") , (37, "tenibwi ma itua") , (38, "tenibwi ma wanua") , (39, "tenibwi ma ruaiwa") , (40, "abwi") , (41, "abwi ma teuana") , (42, "abwi ma uoua") , (43, "abwi ma tenua") , (44, "abwi ma aua") , (45, "abwi ma nimaua") , (46, "abwi ma onoua") , (47, "abwi ma itua") , (48, "abwi ma wanua") , (49, "abwi ma ruaiwa") , (50, "nimabwi") , (51, "nimabwi ma teuana") , (52, "nimabwi ma uoua") , (53, "nimabwi ma tenua") , (54, "nimabwi ma aua") , (55, "nimabwi ma nimaua") , (56, "nimabwi ma onoua") , (57, "nimabwi ma itua") , (58, "nimabwi ma wanua") , (59, "nimabwi ma ruaiwa") , (60, "onobwi") , (61, "onobwi ma teuana") , (62, "onobwi ma uoua") , (63, "onobwi ma tenua") , (64, "onobwi ma aua") , (65, "onobwi ma nimaua") , (66, "onobwi ma onoua") , (67, "onobwi ma itua") , (68, "onobwi ma wanua") , (69, "onobwi ma ruaiwa") , (70, "itibwi") , (71, "itibwi ma teuana") , (72, "itibwi ma uoua") , (73, "itibwi ma tenua") , (74, "itibwi ma aua") , (75, "itibwi ma nimaua") , (76, "itibwi ma onoua") , (77, "itibwi ma itua") , (78, "itibwi ma wanua") , (79, "itibwi ma ruaiwa") , (80, "wanibwi") , (81, "wanibwi ma teuana") , (82, "wanibwi ma uoua") , (83, "wanibwi ma tenua") , (84, "wanibwi ma aua") , (85, "wanibwi ma nimaua") , (86, "wanibwi ma onoua") , (87, "wanibwi ma itua") , (88, "wanibwi ma wanua") , (89, "wanibwi ma ruaiwa") , (90, "ruabwi") , (91, "ruabwi ma teuana") , (92, "ruabwi ma uoua") , (93, "ruabwi ma tenua") , (94, "ruabwi ma aua") , (95, "ruabwi ma nimaua") , (96, "ruabwi ma onoua") , (97, "ruabwi ma itua") , (98, "ruabwi ma wanua") , (99, "ruabwi ma ruaiwa") , (100, "tebubua") , (101, "tebubua ao teuana") , (102, "tebubua ao uoua") , (103, "tebubua ao tenua") , (104, "tebubua ao aua") , (105, "tebubua ao nimaua") , (106, "tebubua ao onoua") , (107, "tebubua ao itua") , (108, "tebubua ao wanua") , (109, "tebubua ao ruaiwa") , (110, "tebubua tebwina") , (123, "tebubua uabwi ma tenua") , (200, "uabubua") , (300, "tenibubua") , (321, "tenibubua uabwi ma teuana") , (400, "abubua") , (500, "nimabubua") , (600, "onobubua") , (700, "itibubua") , (800, "wanibubua") , (900, "ruabubua") , (909, "ruabubua ao ruaiwa") , (990, "ruabubua ruabwi") , (999, "ruabubua ruabwi ma ruaiwa") , (1000, "tengaa") , (1001, "tengaa ao teuana") , (1008, "tengaa ao wanua") , (1234, "tengaa uabubua tenibwi ma aua") , (2000, "uangaa") , (3000, "teningaa") , (4000, "angaa") , (4321, "angaa tenibubua uabwi ma teuana") , (5000, "nimangaa") , (6000, "onongaa") , (7000, "itingaa") , (8000, "waniengaa") , (9000, "ruangaa") , (10000, "tebwina tengaa") , (12345, "tebwi ma uoua tengaa tenibubua abwi ma nimaua") , (20000, "uabwi tengaa") , (30000, "tenibwi tengaa") , (40000, "abwi tengaa") , (50000, "nimabwi tengaa") , (54321, "nimabwi ma aua tengaa tenibubua uabwi ma teuana") , (60000, "onobwi tengaa") , (70000, "itibwi tengaa") , (80000, "wanibwi tengaa") , (90000, "ruabwi tengaa") , (100000, "tebubua tengaa") , (123456, "tebubua uabwi ma tenua tengaa abubua nimabwi ma onoua") , (200000, "uabubua tengaa") , (300000, "tenibubua tengaa") , (400000, "abubua tengaa") , (500000, "nimabubua tengaa") , (600000, "onobubua tengaa") , (654321, "onobubua nimabwi ma aua tengaa tenibubua uabwi ma teuana") , (700000, "itibubua tengaa") , (800000, "wanibubua tengaa") , (900000, "ruabubua tengaa") , (1000000, "te mirion") , (1000001, "te mirion, teuana") , (1234567, "te mirion, uabubua tenibwi ma aua tengaa nimabubua onobwi ma itua") , (2000000, "uoua te mirion") , (3000000, "tenua te mirion") , (4000000, "aua te mirion") , (5000000, "nimaua te mirion") , (6000000, "onoua te mirion") , (7000000, "itua te mirion") , (7654321, "itua te mirion, onobubua nimabwi ma aua tengaa tenibubua uabwi ma teuana") , (8000000, "wanua te mirion") , (9000000, "ruaiwa te mirion") , (1000000000, "te birian") , (1000000001, "te birian, teuana") , (2000000000, "uoua te birian") , (3000000000, "tenua te birian") , (4000000000, "aua te birian") , (5000000000, "nimaua te birian") , (6000000000, "onoua te birian") , (7000000000, "itua te birian") , (8000000000, "wanua te birian") , (9000000000, "ruaiwa te birian") ] ) ]
6,069
true
true
0
9
1,987
1,674
1,111
563
null
null
gridaphobe/ghc
compiler/types/Type.hs
bsd-3-clause
mkPrimEqPredRole :: Role -> Type -> Type -> PredType mkPrimEqPredRole Nominal = mkPrimEqPred
101
mkPrimEqPredRole :: Role -> Type -> Type -> PredType mkPrimEqPredRole Nominal = mkPrimEqPred
101
mkPrimEqPredRole Nominal = mkPrimEqPred
48
false
true
0
7
21
26
13
13
null
null
portnov/xtt
XMonad/TimeTracker/Parser.hs
bsd-3-clause
integerLiteral :: Parser Int integerLiteral = fromIntegral <$> lexeme number
76
integerLiteral :: Parser Int integerLiteral = fromIntegral <$> lexeme number
76
integerLiteral = fromIntegral <$> lexeme number
47
false
true
2
6
9
27
11
16
null
null
mpickering/hlint
src/HSE/Util.hs
bsd-3-clause
isInfixApp InfixApp{} = True
28
isInfixApp InfixApp{} = True
28
isInfixApp InfixApp{} = True
28
false
false
0
5
3
14
6
8
null
null
MichielDerhaeg/stack
src/Stack/Sig/GPG.hs
bsd-3-clause
gpgVerify :: (MonadIO m, MonadThrow m) => Signature -> Path Abs File -> m Fingerprint gpgVerify (Signature signature) path = do (hIn,hOut,hErr,process) <- gpg ["--verify", "--with-fingerprint", "-", toFilePath path] (_in,out,err,code) <- liftIO ((,,,) <$> hPutStrLn hIn (C.unpack signature) <*> hGetContents hOut <*> hGetContents hErr <*> waitForProcess process) if code /= ExitSuccess then throwM (GPGVerifyException (out ++ "\n" ++ err)) else maybe (throwM (GPGFingerprintException ("unable to extract fingerprint from output\n: " <> out))) return (mkFingerprint . T.pack . concat . drop 3 <$> find ((==) ["Primary", "key", "fingerprint:"] . take 3) (map words (lines err))) -- | Try to execute `gpg2` but fallback to `gpg` (as a backup)
1,046
gpgVerify :: (MonadIO m, MonadThrow m) => Signature -> Path Abs File -> m Fingerprint gpgVerify (Signature signature) path = do (hIn,hOut,hErr,process) <- gpg ["--verify", "--with-fingerprint", "-", toFilePath path] (_in,out,err,code) <- liftIO ((,,,) <$> hPutStrLn hIn (C.unpack signature) <*> hGetContents hOut <*> hGetContents hErr <*> waitForProcess process) if code /= ExitSuccess then throwM (GPGVerifyException (out ++ "\n" ++ err)) else maybe (throwM (GPGFingerprintException ("unable to extract fingerprint from output\n: " <> out))) return (mkFingerprint . T.pack . concat . drop 3 <$> find ((==) ["Primary", "key", "fingerprint:"] . take 3) (map words (lines err))) -- | Try to execute `gpg2` but fallback to `gpg` (as a backup)
1,046
gpgVerify (Signature signature) path = do (hIn,hOut,hErr,process) <- gpg ["--verify", "--with-fingerprint", "-", toFilePath path] (_in,out,err,code) <- liftIO ((,,,) <$> hPutStrLn hIn (C.unpack signature) <*> hGetContents hOut <*> hGetContents hErr <*> waitForProcess process) if code /= ExitSuccess then throwM (GPGVerifyException (out ++ "\n" ++ err)) else maybe (throwM (GPGFingerprintException ("unable to extract fingerprint from output\n: " <> out))) return (mkFingerprint . T.pack . concat . drop 3 <$> find ((==) ["Primary", "key", "fingerprint:"] . take 3) (map words (lines err))) -- | Try to execute `gpg2` but fallback to `gpg` (as a backup)
952
false
true
0
18
413
291
150
141
null
null
arirahikkala/yaml-with-class
src/Text/YamlPickle.hs
bsd-3-clause
parseScalar v t s = do return $ YamlScalar v t s
50
parseScalar v t s = do return $ YamlScalar v t s
50
parseScalar v t s = do return $ YamlScalar v t s
50
false
false
0
8
13
27
12
15
null
null
roman/Haskell-projectile
src/Projectile.hs
isc
-- | A list of files considered to mark the root of a project. This -- file must be in all sub-directories of a project. projectRecurringMarkFiles :: Vector FilePath projectRecurringMarkFiles = V.fromList [ ".svn" -- Svn VCS root dir , "CVS" -- Csv VCS root dir , "Makefile" ]
301
projectRecurringMarkFiles :: Vector FilePath projectRecurringMarkFiles = V.fromList [ ".svn" -- Svn VCS root dir , "CVS" -- Csv VCS root dir , "Makefile" ]
180
projectRecurringMarkFiles = V.fromList [ ".svn" -- Svn VCS root dir , "CVS" -- Csv VCS root dir , "Makefile" ]
135
true
true
0
5
73
32
19
13
null
null
silkapp/heist
src/Heist/Common.hs
bsd-3-clause
getDoc :: String -> IO (Either String DocumentFile) getDoc = getDocWith X.parseHTML
83
getDoc :: String -> IO (Either String DocumentFile) getDoc = getDocWith X.parseHTML
83
getDoc = getDocWith X.parseHTML
31
false
true
0
9
11
36
16
20
null
null
elginer/snm
Manual/Easy.hs
gpl-3.0
text_format :: (Manual -> String, String) text_format = (emit_text, "txt")
74
text_format :: (Manual -> String, String) text_format = (emit_text, "txt")
74
text_format = (emit_text, "txt")
32
false
true
0
8
9
34
17
17
null
null
maxigit/sql-fragment
src/Database/SQLFragment/Internal.hs
bsd-3-clause
setSection :: Section -> [String] -> SQLFragment e p -> SQLFragment e p setSection section values q = SQLFragment clauses' where clauses' = Map.update (toMaybe values) section (clauses q) toMaybe [] _ = Nothing toMaybe values _ = Just values
254
setSection :: Section -> [String] -> SQLFragment e p -> SQLFragment e p setSection section values q = SQLFragment clauses' where clauses' = Map.update (toMaybe values) section (clauses q) toMaybe [] _ = Nothing toMaybe values _ = Just values
253
setSection section values q = SQLFragment clauses' where clauses' = Map.update (toMaybe values) section (clauses q) toMaybe [] _ = Nothing toMaybe values _ = Just values
181
false
true
0
8
52
98
48
50
null
null
xmonad/xmonad-contrib
XMonad/Util/Stack.hs
bsd-3-clause
focusUpZ (Just (W.Stack f _ down)) = Just $ W.Stack (last down) (tail (reverse down) ++ [f]) []
95
focusUpZ (Just (W.Stack f _ down)) = Just $ W.Stack (last down) (tail (reverse down) ++ [f]) []
95
focusUpZ (Just (W.Stack f _ down)) = Just $ W.Stack (last down) (tail (reverse down) ++ [f]) []
95
false
false
0
11
17
67
33
34
null
null
mfine/hs-talks
src/Libv2.hs
bsd-3-clause
main' :: IO () main' = undefined
32
main' :: IO () main' = undefined
32
main' = undefined
17
false
true
0
7
6
22
9
13
null
null
motiz88/postgrest
src/PostgREST/Parsers.hs
mit
pJsonPath :: Parser [Text] pJsonPath = (++) <$> many pJsonPathStep <*> ( (:[]) <$> (string "->>" *> pFieldName) )
113
pJsonPath :: Parser [Text] pJsonPath = (++) <$> many pJsonPathStep <*> ( (:[]) <$> (string "->>" *> pFieldName) )
113
pJsonPath = (++) <$> many pJsonPathStep <*> ( (:[]) <$> (string "->>" *> pFieldName) )
86
false
true
0
10
18
53
29
24
null
null
ambiata/mafia
src/Mafia/Script.hs
bsd-3-clause
cabalText :: [Package] -> Text cabalText deps = T.unlines $ [ "name: script" , "version: 0.0.1" , "license: AllRightsReserved" , "author: script" , "maintainer: script" , "synopsis: script" , "category: Tools" , "cabal-version: >= 1.8" , "build-type: Simple" , "description: script" , "" , "executable script" , " main-is:" , " script.hs" , "" , " ghc-options:" , " -fno-warn-unrecognised-pragmas" , "" , " build-depends:" , " base" ] <> fmap ((" , " <>) . unPackage) deps
623
cabalText :: [Package] -> Text cabalText deps = T.unlines $ [ "name: script" , "version: 0.0.1" , "license: AllRightsReserved" , "author: script" , "maintainer: script" , "synopsis: script" , "category: Tools" , "cabal-version: >= 1.8" , "build-type: Simple" , "description: script" , "" , "executable script" , " main-is:" , " script.hs" , "" , " ghc-options:" , " -fno-warn-unrecognised-pragmas" , "" , " build-depends:" , " base" ] <> fmap ((" , " <>) . unPackage) deps
623
cabalText deps = T.unlines $ [ "name: script" , "version: 0.0.1" , "license: AllRightsReserved" , "author: script" , "maintainer: script" , "synopsis: script" , "category: Tools" , "cabal-version: >= 1.8" , "build-type: Simple" , "description: script" , "" , "executable script" , " main-is:" , " script.hs" , "" , " ghc-options:" , " -fno-warn-unrecognised-pragmas" , "" , " build-depends:" , " base" ] <> fmap ((" , " <>) . unPackage) deps
592
false
true
3
7
228
108
65
43
null
null
iblumenfeld/saw-core
src/Verifier/SAW/Simulator/Prims.hs
bsd-3-clause
toBool x = error $ unwords ["Verifier.SAW.Simulator.toBool", show x]
68
toBool x = error $ unwords ["Verifier.SAW.Simulator.toBool", show x]
68
toBool x = error $ unwords ["Verifier.SAW.Simulator.toBool", show x]
68
false
false
0
8
8
25
12
13
null
null
pparkkin/Hagl
Hagl/Examples/Prisoner.hs
bsd-3-clause
-- | Defects randomly with a probability of 1/6. rr :: Player Dilemma rr = "Russian Roulette" ::: mixed [(5,C), (1,D)]
118
rr :: Player Dilemma rr = "Russian Roulette" ::: mixed [(5,C), (1,D)]
69
rr = "Russian Roulette" ::: mixed [(5,C), (1,D)]
48
true
true
0
8
20
40
23
17
null
null
supki/libstackexchange
src/Network/StackExchange/API.hs
mit
-- $linkedQuestions -- >>> checkLengthM $ askSE (linkedQuestions [394601] <> s <> k <> q) -- True -- | <https://api.stackexchange.com/docs/linked-questions> linkedQuestions ∷ [Int] → Request a "linkedQuestions" [SE Question] linkedQuestions (T.intercalate ";" . map (toLazyText . decimal) → is) = path ("questions/" <> is <> "/linked") <> parse (attoparsec items ".questions/{ids}/linked: ")
396
linkedQuestions ∷ [Int] → Request a "linkedQuestions" [SE Question] linkedQuestions (T.intercalate ";" . map (toLazyText . decimal) → is) = path ("questions/" <> is <> "/linked") <> parse (attoparsec items ".questions/{ids}/linked: ")
238
linkedQuestions (T.intercalate ";" . map (toLazyText . decimal) → is) = path ("questions/" <> is <> "/linked") <> parse (attoparsec items ".questions/{ids}/linked: ")
170
true
true
0
11
56
93
48
45
null
null
jabolopes/fmark
src/Parser.hs
bsd-3-clause
reconstructLine :: String -> [Text] reconstructLine str = loop str where loop [] = [] loop ('[':str) = case span (/= ']') str of (hd, []) -> [Plain hd] (hd, _:tl) -> Footnote hd:loop tl loop ('\'':str) = case span (/= '\'') str of (hd, []) -> [Plain hd] (hd, _:tl) -> Emphasis hd:loop tl loop str = Plain hd:loop tl where (hd, tl) = span (\c -> not $ elem c "['") str -- | 'reconstructLines' @str@ produces the 'List' of 'Text' elements -- for each line in @str@.
619
reconstructLine :: String -> [Text] reconstructLine str = loop str where loop [] = [] loop ('[':str) = case span (/= ']') str of (hd, []) -> [Plain hd] (hd, _:tl) -> Footnote hd:loop tl loop ('\'':str) = case span (/= '\'') str of (hd, []) -> [Plain hd] (hd, _:tl) -> Emphasis hd:loop tl loop str = Plain hd:loop tl where (hd, tl) = span (\c -> not $ elem c "['") str -- | 'reconstructLines' @str@ produces the 'List' of 'Text' elements -- for each line in @str@.
619
reconstructLine str = loop str where loop [] = [] loop ('[':str) = case span (/= ']') str of (hd, []) -> [Plain hd] (hd, _:tl) -> Footnote hd:loop tl loop ('\'':str) = case span (/= '\'') str of (hd, []) -> [Plain hd] (hd, _:tl) -> Emphasis hd:loop tl loop str = Plain hd:loop tl where (hd, tl) = span (\c -> not $ elem c "['") str -- | 'reconstructLines' @str@ produces the 'List' of 'Text' elements -- for each line in @str@.
583
false
true
4
12
245
241
125
116
null
null
onponomarev/ganeti
test/hs/Test/Ganeti/Utils.hs
bsd-2-clause
-- | Test 'chompPrefix' returns Nothing when the prefix doesn't match. prop_chompPrefix_nothing :: Property prop_chompPrefix_nothing = forAll (choose (1, 20)) $ \len -> forAll (vectorOf len arbitrary) $ \pfx -> forAll (arbitrary `suchThat` (\s -> not (pfx `isPrefixOf` s) && s /= init pfx)) $ \str -> chompPrefix pfx str ==? Nothing
350
prop_chompPrefix_nothing :: Property prop_chompPrefix_nothing = forAll (choose (1, 20)) $ \len -> forAll (vectorOf len arbitrary) $ \pfx -> forAll (arbitrary `suchThat` (\s -> not (pfx `isPrefixOf` s) && s /= init pfx)) $ \str -> chompPrefix pfx str ==? Nothing
279
prop_chompPrefix_nothing = forAll (choose (1, 20)) $ \len -> forAll (vectorOf len arbitrary) $ \pfx -> forAll (arbitrary `suchThat` (\s -> not (pfx `isPrefixOf` s) && s /= init pfx)) $ \str -> chompPrefix pfx str ==? Nothing
242
true
true
0
19
69
117
63
54
null
null
edsko/hackage-server
Distribution/Client/ParseApacheLogs.hs
bsd-3-clause
plainValue :: Parser SBS.ByteString plainValue = Att.takeWhile1 (\c -> c /= ' ' && c /= '\n')
93
plainValue :: Parser SBS.ByteString plainValue = Att.takeWhile1 (\c -> c /= ' ' && c /= '\n')
93
plainValue = Att.takeWhile1 (\c -> c /= ' ' && c /= '\n')
57
false
true
0
10
16
41
21
20
null
null
kojiromike/Idris-dev
src/IRTS/JavaScript/Codegen.hs
bsd-3-clause
cgConst (B8 x) = pure $ JsForeign (T.pack $ show x ++ " & 0xFF") []
67
cgConst (B8 x) = pure $ JsForeign (T.pack $ show x ++ " & 0xFF") []
67
cgConst (B8 x) = pure $ JsForeign (T.pack $ show x ++ " & 0xFF") []
67
false
false
0
10
15
42
20
22
null
null