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
peterokagey/haskellOEIS
test/External/A132439Spec.hs
apache-2.0
main :: IO () main = hspec spec
31
main :: IO () main = hspec spec
31
main = hspec spec
17
false
true
0
7
7
25
10
15
null
null
facebookincubator/duckling
Duckling/Temperature/KO/Rules.hs
bsd-3-clause
ruleTemp2 :: Rule ruleTemp2 = Rule { name = "ํ™”์”จ <temp>" , pattern = [ regex "ํ™”์”จ" , Predicate $ isValueOnly True ] , prod = \tokens -> case tokens of (_:Token Temperature td:_) -> Just . Token Temperature $ withUnit TTemperature.Fahrenheit td _ -> Nothing }
296
ruleTemp2 :: Rule ruleTemp2 = Rule { name = "ํ™”์”จ <temp>" , pattern = [ regex "ํ™”์”จ" , Predicate $ isValueOnly True ] , prod = \tokens -> case tokens of (_:Token Temperature td:_) -> Just . Token Temperature $ withUnit TTemperature.Fahrenheit td _ -> Nothing }
296
ruleTemp2 = Rule { name = "ํ™”์”จ <temp>" , pattern = [ regex "ํ™”์”จ" , Predicate $ isValueOnly True ] , prod = \tokens -> case tokens of (_:Token Temperature td:_) -> Just . Token Temperature $ withUnit TTemperature.Fahrenheit td _ -> Nothing }
278
false
true
0
15
86
106
55
51
null
null
Helium4Haskell/helium
test/exports/Export8.hs
gpl-3.0
main :: Int main = f
20
main :: Int main = f
20
main = f
8
false
true
0
6
5
18
7
11
null
null
brendanhay/gogol
gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/UserPermissions/Create.hs
mpl-2.0
-- | GTM Account\'s API relative path. Example: accounts\/{account_id} aupcParent :: Lens' AccountsUserPermissionsCreate Text aupcParent = lens _aupcParent (\ s a -> s{_aupcParent = a})
187
aupcParent :: Lens' AccountsUserPermissionsCreate Text aupcParent = lens _aupcParent (\ s a -> s{_aupcParent = a})
116
aupcParent = lens _aupcParent (\ s a -> s{_aupcParent = a})
61
true
true
1
9
26
46
22
24
null
null
julitopower/HaskellLearning
tree.hs
mit
insert :: Int -> Tree -> Tree insert x Leaf = Node Leaf x Leaf
62
insert :: Int -> Tree -> Tree insert x Leaf = Node Leaf x Leaf
62
insert x Leaf = Node Leaf x Leaf
32
false
true
0
8
14
38
16
22
null
null
beni55/haste-compiler
libraries/ghc-7.10/base/GHC/Event/PSQ.hs
bsd-3-clause
-- | /O(1)/ Build a queue with one element. singleton :: Key -> Prio -> a -> PSQ a singleton k p v = Winner (E k p v) Start k
125
singleton :: Key -> Prio -> a -> PSQ a singleton k p v = Winner (E k p v) Start k
81
singleton k p v = Winner (E k p v) Start k
42
true
true
0
9
30
55
26
29
null
null
shak-mar/botstrats
server/Game.hs
mit
spawnRobot :: Robot -> GameState -> GameState spawnRobot robot state = state { robots = robot : robots state }
110
spawnRobot :: Robot -> GameState -> GameState spawnRobot robot state = state { robots = robot : robots state }
110
spawnRobot robot state = state { robots = robot : robots state }
64
false
true
0
8
19
39
20
19
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\x1EE6' = "\x0055\x0309"
39
decomposeChar '\x1EE6' = "\x0055\x0309"
39
decomposeChar '\x1EE6' = "\x0055\x0309"
39
false
false
0
4
3
10
4
6
null
null
kazu-yamamoto/concurrent-dns-cache
Network/DNS/Cache.hs
bsd-3-clause
insertPositive :: DNSCache -> Key -> [(HostAddress, TTL)] -> IO (Either DNSError Result) insertPositive _ _ [] = error "insertPositive"
174
insertPositive :: DNSCache -> Key -> [(HostAddress, TTL)] -> IO (Either DNSError Result) insertPositive _ _ [] = error "insertPositive"
174
insertPositive _ _ [] = error "insertPositive"
70
false
true
0
10
58
55
28
27
null
null
sdiehl/ghc
compiler/utils/Dominators.hs
bsd-3-clause
tip :: Tree a -> (a, [Tree a]) tip (Node a ts) = (a, ts)
57
tip :: Tree a -> (a, [Tree a]) tip (Node a ts) = (a, ts)
56
tip (Node a ts) = (a, ts)
25
false
true
0
10
15
53
26
27
null
null
raichoo/Idris-dev
src/IRTS/CodegenJavaScript.hs
bsd-3-clause
splitFunction :: JS -> RWS () [(Int,JS)] Int JS splitFunction (JSAlloc name (Just (JSFunction args body@(JSSeq _)))) = do body' <- splitSequence body return $ JSAlloc name (Just (JSFunction args body')) where splitCondition :: JS -> RWS () [(Int,JS)] Int JS splitCondition js | JSCond branches <- js = JSCond <$> processBranches branches | JSSwitch cond branches def <- js = JSSwitch cond <$> (processBranches branches) <*> (traverse splitSequence def) | otherwise = return js where processBranches :: [(JS,JS)] -> RWS () [(Int,JS)] Int [(JS,JS)] processBranches = traverse (runKleisli (arr id *** Kleisli splitSequence)) splitSequence :: JS -> RWS () [(Int, JS)] Int JS splitSequence js@(JSSeq seq) = let (pre,post) = break isBranch seq in case post of [_] -> JSSeq <$> traverse splitCondition seq [call@(JSCond _),rest@(JSApp _ _)] -> do rest' <- splitCondition rest call' <- splitCondition call return $ JSSeq (pre ++ [rest', call']) [call@(JSSwitch _ _ _),rest@(JSApp _ _)] -> do rest' <- splitCondition rest call' <- splitCondition call return $ JSSeq (pre ++ [rest', call']) (call:rest) -> do depth <- get put (depth + 1) new <- splitFunction (newFun rest) tell [(depth, new)] call' <- splitCondition call return $ JSSeq (pre ++ (newCall depth : [call'])) _ -> JSSeq <$> traverse splitCondition seq splitSequence js = return js isBranch :: JS -> Bool isBranch (JSApp (JSIdent "i$CALL") _) = True isBranch (JSCond _) = True isBranch (JSSwitch _ _ _) = True isBranch _ = False newCall :: Int -> JS newCall depth = JSApp (JSIdent "i$CALL") [ JSIdent $ name ++ "$" ++ show depth , JSArray [jsOLDBASE, jsMYOLDBASE] ] newFun :: [JS] -> JS newFun seq = JSAlloc name (Just $ JSFunction ["oldbase", "myoldbase"] (JSSeq seq))
2,382
splitFunction :: JS -> RWS () [(Int,JS)] Int JS splitFunction (JSAlloc name (Just (JSFunction args body@(JSSeq _)))) = do body' <- splitSequence body return $ JSAlloc name (Just (JSFunction args body')) where splitCondition :: JS -> RWS () [(Int,JS)] Int JS splitCondition js | JSCond branches <- js = JSCond <$> processBranches branches | JSSwitch cond branches def <- js = JSSwitch cond <$> (processBranches branches) <*> (traverse splitSequence def) | otherwise = return js where processBranches :: [(JS,JS)] -> RWS () [(Int,JS)] Int [(JS,JS)] processBranches = traverse (runKleisli (arr id *** Kleisli splitSequence)) splitSequence :: JS -> RWS () [(Int, JS)] Int JS splitSequence js@(JSSeq seq) = let (pre,post) = break isBranch seq in case post of [_] -> JSSeq <$> traverse splitCondition seq [call@(JSCond _),rest@(JSApp _ _)] -> do rest' <- splitCondition rest call' <- splitCondition call return $ JSSeq (pre ++ [rest', call']) [call@(JSSwitch _ _ _),rest@(JSApp _ _)] -> do rest' <- splitCondition rest call' <- splitCondition call return $ JSSeq (pre ++ [rest', call']) (call:rest) -> do depth <- get put (depth + 1) new <- splitFunction (newFun rest) tell [(depth, new)] call' <- splitCondition call return $ JSSeq (pre ++ (newCall depth : [call'])) _ -> JSSeq <$> traverse splitCondition seq splitSequence js = return js isBranch :: JS -> Bool isBranch (JSApp (JSIdent "i$CALL") _) = True isBranch (JSCond _) = True isBranch (JSSwitch _ _ _) = True isBranch _ = False newCall :: Int -> JS newCall depth = JSApp (JSIdent "i$CALL") [ JSIdent $ name ++ "$" ++ show depth , JSArray [jsOLDBASE, jsMYOLDBASE] ] newFun :: [JS] -> JS newFun seq = JSAlloc name (Just $ JSFunction ["oldbase", "myoldbase"] (JSSeq seq))
2,382
splitFunction (JSAlloc name (Just (JSFunction args body@(JSSeq _)))) = do body' <- splitSequence body return $ JSAlloc name (Just (JSFunction args body')) where splitCondition :: JS -> RWS () [(Int,JS)] Int JS splitCondition js | JSCond branches <- js = JSCond <$> processBranches branches | JSSwitch cond branches def <- js = JSSwitch cond <$> (processBranches branches) <*> (traverse splitSequence def) | otherwise = return js where processBranches :: [(JS,JS)] -> RWS () [(Int,JS)] Int [(JS,JS)] processBranches = traverse (runKleisli (arr id *** Kleisli splitSequence)) splitSequence :: JS -> RWS () [(Int, JS)] Int JS splitSequence js@(JSSeq seq) = let (pre,post) = break isBranch seq in case post of [_] -> JSSeq <$> traverse splitCondition seq [call@(JSCond _),rest@(JSApp _ _)] -> do rest' <- splitCondition rest call' <- splitCondition call return $ JSSeq (pre ++ [rest', call']) [call@(JSSwitch _ _ _),rest@(JSApp _ _)] -> do rest' <- splitCondition rest call' <- splitCondition call return $ JSSeq (pre ++ [rest', call']) (call:rest) -> do depth <- get put (depth + 1) new <- splitFunction (newFun rest) tell [(depth, new)] call' <- splitCondition call return $ JSSeq (pre ++ (newCall depth : [call'])) _ -> JSSeq <$> traverse splitCondition seq splitSequence js = return js isBranch :: JS -> Bool isBranch (JSApp (JSIdent "i$CALL") _) = True isBranch (JSCond _) = True isBranch (JSSwitch _ _ _) = True isBranch _ = False newCall :: Int -> JS newCall depth = JSApp (JSIdent "i$CALL") [ JSIdent $ name ++ "$" ++ show depth , JSArray [jsOLDBASE, jsMYOLDBASE] ] newFun :: [JS] -> JS newFun seq = JSAlloc name (Just $ JSFunction ["oldbase", "myoldbase"] (JSSeq seq))
2,334
false
true
0
20
942
850
428
422
null
null
brodyberg/LearnHaskell
CaesarCypher.hsproj/TautologyChecker.hs
mit
vars :: Prop -> [Char] vars (Const _) = []
42
vars :: Prop -> [Char] vars (Const _) = []
42
vars (Const _) = []
19
false
true
0
7
9
29
15
14
null
null
masaedw/Yiki
main.hs
bsd-2-clause
environments :: [String] environments = map ((map toLower) . show) ([minBound..maxBound] :: [AppEnvironment])
109
environments :: [String] environments = map ((map toLower) . show) ([minBound..maxBound] :: [AppEnvironment])
109
environments = map ((map toLower) . show) ([minBound..maxBound] :: [AppEnvironment])
84
false
true
0
9
12
46
26
20
null
null
GaloisInc/sk-dev-platform
libs/lviz/GUI.hs
bsd-3-clause
showHotSpots :: Bool showHotSpots = False
41
showHotSpots :: Bool showHotSpots = False
41
showHotSpots = False
20
false
true
0
4
5
11
6
5
null
null
twittner/zeromq-haskell
src/System/ZMQ4/Internal/Error.hs
mit
throwIfMinus1Retry_ :: (Eq a, Num a) => String -> IO a -> IO () throwIfMinus1Retry_ = throwIfRetry_ (== -1)
107
throwIfMinus1Retry_ :: (Eq a, Num a) => String -> IO a -> IO () throwIfMinus1Retry_ = throwIfRetry_ (== -1)
107
throwIfMinus1Retry_ = throwIfRetry_ (== -1)
43
false
true
0
9
18
51
26
25
null
null
abbradar/netwire
Control/Wire/Event.hs
bsd-3-clause
filterE :: (EventLike ev) => (a -> Bool) -> Wire s e m (ev a) (ev a) filterE p = mkSF_ $ \mev -> case toEvent mev of Event x | p x -> mev _ -> fromEvent NoEvent -- | On each occurrence, apply the function the event carries. -- -- * Depends: now.
279
filterE :: (EventLike ev) => (a -> Bool) -> Wire s e m (ev a) (ev a) filterE p = mkSF_ $ \mev -> case toEvent mev of Event x | p x -> mev _ -> fromEvent NoEvent -- | On each occurrence, apply the function the event carries. -- -- * Depends: now.
279
filterE p = mkSF_ $ \mev -> case toEvent mev of Event x | p x -> mev _ -> fromEvent NoEvent -- | On each occurrence, apply the function the event carries. -- -- * Depends: now.
210
false
true
0
13
88
103
51
52
null
null
sardonicpresence/glucose
test/Glucose/LexerSpec.hs
mit
itParsesFractionalLiterals :: SpecWith () itParsesFractionalLiterals = describe "correctly parses fractional literals" $ do it "correctly parses zero" $ tokens "0.000" `shouldBe` Right [FloatLiteral 0] it "correctly parses a simple positive fractional literal" $ tokens "12.34" `shouldBe` Right [FloatLiteral 12.34] it "correctly parses a simple negative fractional literal" $ tokens "-54.321" `shouldBe` Right [Operator (CustomOperator "-"), FloatLiteral 54.321] it "correctly parses a fractional literal with exponent" $ tokens "12.3e03" `shouldBe` Right [FloatLiteral 12300] it "correctly parses a fractional literal with large exponent" $ tokens "20.01e013" `shouldBe` Right [FloatLiteral 200100000000000] it "correctly parses a fractional literal with negative exponent" $ tokens "9876543.21e-08" `shouldBe` Right [FloatLiteral 0.0987654321] it "errors on fractional literal with blank exponent" $ tokens "12.3e" `shouldErrorWith` compileError "1:6@5" (SyntaxError "missing exponent" "numeric literal") it "errors on unexpected char immediately following fractional literal" $ tokens "123.4f" `shouldErrorWith` unexpectedChar "1:6@5" 'f' "in numeric literal" it "errors on unexpected char within fractional literal" $ tokens "12._3" `shouldErrorWith` unexpectedChar "1:4@3" '_' "in numeric literal" -- * Argument test-cases
1,404
itParsesFractionalLiterals :: SpecWith () itParsesFractionalLiterals = describe "correctly parses fractional literals" $ do it "correctly parses zero" $ tokens "0.000" `shouldBe` Right [FloatLiteral 0] it "correctly parses a simple positive fractional literal" $ tokens "12.34" `shouldBe` Right [FloatLiteral 12.34] it "correctly parses a simple negative fractional literal" $ tokens "-54.321" `shouldBe` Right [Operator (CustomOperator "-"), FloatLiteral 54.321] it "correctly parses a fractional literal with exponent" $ tokens "12.3e03" `shouldBe` Right [FloatLiteral 12300] it "correctly parses a fractional literal with large exponent" $ tokens "20.01e013" `shouldBe` Right [FloatLiteral 200100000000000] it "correctly parses a fractional literal with negative exponent" $ tokens "9876543.21e-08" `shouldBe` Right [FloatLiteral 0.0987654321] it "errors on fractional literal with blank exponent" $ tokens "12.3e" `shouldErrorWith` compileError "1:6@5" (SyntaxError "missing exponent" "numeric literal") it "errors on unexpected char immediately following fractional literal" $ tokens "123.4f" `shouldErrorWith` unexpectedChar "1:6@5" 'f' "in numeric literal" it "errors on unexpected char within fractional literal" $ tokens "12._3" `shouldErrorWith` unexpectedChar "1:4@3" '_' "in numeric literal" -- * Argument test-cases
1,403
itParsesFractionalLiterals = describe "correctly parses fractional literals" $ do it "correctly parses zero" $ tokens "0.000" `shouldBe` Right [FloatLiteral 0] it "correctly parses a simple positive fractional literal" $ tokens "12.34" `shouldBe` Right [FloatLiteral 12.34] it "correctly parses a simple negative fractional literal" $ tokens "-54.321" `shouldBe` Right [Operator (CustomOperator "-"), FloatLiteral 54.321] it "correctly parses a fractional literal with exponent" $ tokens "12.3e03" `shouldBe` Right [FloatLiteral 12300] it "correctly parses a fractional literal with large exponent" $ tokens "20.01e013" `shouldBe` Right [FloatLiteral 200100000000000] it "correctly parses a fractional literal with negative exponent" $ tokens "9876543.21e-08" `shouldBe` Right [FloatLiteral 0.0987654321] it "errors on fractional literal with blank exponent" $ tokens "12.3e" `shouldErrorWith` compileError "1:6@5" (SyntaxError "missing exponent" "numeric literal") it "errors on unexpected char immediately following fractional literal" $ tokens "123.4f" `shouldErrorWith` unexpectedChar "1:6@5" 'f' "in numeric literal" it "errors on unexpected char within fractional literal" $ tokens "12._3" `shouldErrorWith` unexpectedChar "1:4@3" '_' "in numeric literal" -- * Argument test-cases
1,361
false
true
1
14
239
292
135
157
null
null
vasily-kartashov/playground
99-problems/problem-19.hs
apache-2.0
rotate as n = ys ++ xs where n' = if n < 0 then (length as + n) else n (xs, ys) = split as n'
103
rotate as n = ys ++ xs where n' = if n < 0 then (length as + n) else n (xs, ys) = split as n'
103
rotate as n = ys ++ xs where n' = if n < 0 then (length as + n) else n (xs, ys) = split as n'
103
false
false
4
8
36
71
32
39
null
null
Tener/personal-library-yesod
Handler/Rent.hs
bsd-2-clause
assetRentFormWidgetR :: AssetId -> Handler Widget assetRentFormWidgetR aid = do uid'ent <- requireAuth let uid = (entityKey uid'ent) assetRentFormWidget aid uid
167
assetRentFormWidgetR :: AssetId -> Handler Widget assetRentFormWidgetR aid = do uid'ent <- requireAuth let uid = (entityKey uid'ent) assetRentFormWidget aid uid
167
assetRentFormWidgetR aid = do uid'ent <- requireAuth let uid = (entityKey uid'ent) assetRentFormWidget aid uid
117
false
true
0
11
27
51
23
28
null
null
laughedelic/sparse-lin-alg
Math/LinearAlgebra/Sparse/Vector.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- FILTER -- ------------ -- | Splits vector using predicate and returns a pair with filtered values and -- re-enumereted second part (that doesn't satisfy predicate). For example: -- -- >>> partitionVec (>0) (sparseList [0,1,-1,2,3,0,-4,5,-6,0,7]) -- ( sparseList [0,1,0,2,3,0,0,5,0,0,7], sparseList [-1,-4,-6] ) -- partitionVec :: (Num ฮฑ) => (ฮฑ -> Bool) -> SparseVector ฮฑ -> (SparseVector ฮฑ, SparseVector ฮฑ) partitionVec p (SV d v) = (SV st t, SV (d-st) f) where (t,f) = partitionMap p v st = size t -------------------------------------------------------------------------------- -- LOOKUP/UPDATE -- ------------------- -- | Looks up an element in the vector (if not found, zero is returned)
794
partitionVec :: (Num ฮฑ) => (ฮฑ -> Bool) -> SparseVector ฮฑ -> (SparseVector ฮฑ, SparseVector ฮฑ) partitionVec p (SV d v) = (SV st t, SV (d-st) f) where (t,f) = partitionMap p v st = size t -------------------------------------------------------------------------------- -- LOOKUP/UPDATE -- ------------------- -- | Looks up an element in the vector (if not found, zero is returned)
393
partitionVec p (SV d v) = (SV st t, SV (d-st) f) where (t,f) = partitionMap p v st = size t -------------------------------------------------------------------------------- -- LOOKUP/UPDATE -- ------------------- -- | Looks up an element in the vector (if not found, zero is returned)
300
true
true
1
9
120
136
72
64
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/AccountPermissions/List.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). aplUploadType :: Lens' AccountPermissionsList (Maybe Text) aplUploadType = lens _aplUploadType (\ s a -> s{_aplUploadType = a})
206
aplUploadType :: Lens' AccountPermissionsList (Maybe Text) aplUploadType = lens _aplUploadType (\ s a -> s{_aplUploadType = a})
135
aplUploadType = lens _aplUploadType (\ s a -> s{_aplUploadType = a})
76
true
true
0
9
34
48
25
23
null
null
ssaavedra/liquidhaskell
benchmarks/containers-0.5.0.0/Data/Map/Base1.hs
bsd-3-clause
join kx x l Tip = insertMax kx x l
35
join kx x l Tip = insertMax kx x l
35
join kx x l Tip = insertMax kx x l
35
false
false
0
5
10
22
10
12
null
null
rueshyna/gogol
gogol-kgsearch/gen/Network/Google/Resource/Kgsearch/Entities/Search.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). esUploadType :: Lens' EntitiesSearch (Maybe Text) esUploadType = lens _esUploadType (\ s a -> s{_esUploadType = a})
188
esUploadType :: Lens' EntitiesSearch (Maybe Text) esUploadType = lens _esUploadType (\ s a -> s{_esUploadType = a})
117
esUploadType = lens _esUploadType (\ s a -> s{_esUploadType = a})
67
true
true
0
9
28
48
25
23
null
null
brendanhay/gogol
gogol-analytics/gen/Network/Google/Resource/Analytics/Management/RemarketingAudience/Patch.hs
mpl-2.0
-- | Multipart request metadata. mrapPayload :: Lens' ManagementRemarketingAudiencePatch RemarketingAudience mrapPayload = lens _mrapPayload (\ s a -> s{_mrapPayload = a})
173
mrapPayload :: Lens' ManagementRemarketingAudiencePatch RemarketingAudience mrapPayload = lens _mrapPayload (\ s a -> s{_mrapPayload = a})
140
mrapPayload = lens _mrapPayload (\ s a -> s{_mrapPayload = a})
64
true
true
0
9
22
47
23
24
null
null
vTurbine/ghc
compiler/utils/Util.hs
bsd-3-clause
liftFst :: (a -> b) -> (a, c) -> (b, c) liftFst f (a,c) = (f a, c)
66
liftFst :: (a -> b) -> (a, c) -> (b, c) liftFst f (a,c) = (f a, c)
66
liftFst f (a,c) = (f a, c)
26
false
true
0
7
17
58
33
25
null
null
mmn80/bibline
src/Text/Bibline.hs
mit
trickle :: Options -> BibItem -> Bool trickle Options {..} BibEntry {..} = (null optType || fromJust optType == entryType) && (null optKey || match (pack optKey) (stripParens entryKey)) && (null optAuthor || any (match $ pack optAuthor) (pack . show <$> bibAuthor)) && (null optTitle || match (pack optTitle) (stripParens bibTitle)) && (null optYear || match (pack optYear) (stripParens bibYear)) && (null optTag || any (match $ pack optTag) bibKeywords)
480
trickle :: Options -> BibItem -> Bool trickle Options {..} BibEntry {..} = (null optType || fromJust optType == entryType) && (null optKey || match (pack optKey) (stripParens entryKey)) && (null optAuthor || any (match $ pack optAuthor) (pack . show <$> bibAuthor)) && (null optTitle || match (pack optTitle) (stripParens bibTitle)) && (null optYear || match (pack optYear) (stripParens bibYear)) && (null optTag || any (match $ pack optTag) bibKeywords)
480
trickle Options {..} BibEntry {..} = (null optType || fromJust optType == entryType) && (null optKey || match (pack optKey) (stripParens entryKey)) && (null optAuthor || any (match $ pack optAuthor) (pack . show <$> bibAuthor)) && (null optTitle || match (pack optTitle) (stripParens bibTitle)) && (null optYear || match (pack optYear) (stripParens bibYear)) && (null optTag || any (match $ pack optTag) bibKeywords)
442
false
true
10
11
96
221
105
116
null
null
foreverbell/project-euler-solutions
src/132.hs
bsd-3-clause
check n p = powMod 10 (gcd n (p-1)) p == 1 && ((sum0 xs) * q `rem` p + sum0 (take r xs)) `rem` p == 0 where get xs = 1 : takeWhile (/= 1) (tail xs) xs = get $ iterate (\x -> x * 10 `rem` p) 1 (q, r) = n `quotRem` length xs sum0 = foldr (\x y -> (x+y) `rem` p) 0
279
check n p = powMod 10 (gcd n (p-1)) p == 1 && ((sum0 xs) * q `rem` p + sum0 (take r xs)) `rem` p == 0 where get xs = 1 : takeWhile (/= 1) (tail xs) xs = get $ iterate (\x -> x * 10 `rem` p) 1 (q, r) = n `quotRem` length xs sum0 = foldr (\x y -> (x+y) `rem` p) 0
279
check n p = powMod 10 (gcd n (p-1)) p == 1 && ((sum0 xs) * q `rem` p + sum0 (take r xs)) `rem` p == 0 where get xs = 1 : takeWhile (/= 1) (tail xs) xs = get $ iterate (\x -> x * 10 `rem` p) 1 (q, r) = n `quotRem` length xs sum0 = foldr (\x y -> (x+y) `rem` p) 0
279
false
false
3
13
86
201
108
93
null
null
karamellpelle/grid
designer/source/MEnv/Keys/GLFW.hs
gpl-3.0
keysTouchHandleButtonA :: a -> (Position -> a) -> MEnv res a keysTouchHandleButtonA a f = getKeysObject >>= \obj -> case keysobjButtonA obj of False -> return a True -> return $ f (keysobjTouchedPos obj) -- | finger touched and hold with time greater or equal to 'ticksButtonB'. cancelled by Circle (fixme).
335
keysTouchHandleButtonA :: a -> (Position -> a) -> MEnv res a keysTouchHandleButtonA a f = getKeysObject >>= \obj -> case keysobjButtonA obj of False -> return a True -> return $ f (keysobjTouchedPos obj) -- | finger touched and hold with time greater or equal to 'ticksButtonB'. cancelled by Circle (fixme).
335
keysTouchHandleButtonA a f = getKeysObject >>= \obj -> case keysobjButtonA obj of False -> return a True -> return $ f (keysobjTouchedPos obj) -- | finger touched and hold with time greater or equal to 'ticksButtonB'. cancelled by Circle (fixme).
274
false
true
0
13
78
81
40
41
null
null
snoyberg/doctest-haskell
test/extract/declaration/Foo.hs
mit
-- | Some documentation foo :: Int foo = 23
43
foo :: Int foo = 23
19
foo = 23
8
true
true
0
6
9
19
8
11
null
null
sol/alex
src/Data/Ranged/RangedSet.hs
bsd-3-clause
-- | The intersection of a set with its negation is empty. -- -- > prop_empty_intersection rs = -- > rSetIsEmpty (rs -/\- rSetNegation rs) prop_empty_intersection :: (DiscreteOrdered a) => RSet a -> Bool prop_empty_intersection rs = rSetIsEmpty (rs -/\- rSetNegation rs)
276
prop_empty_intersection :: (DiscreteOrdered a) => RSet a -> Bool prop_empty_intersection rs = rSetIsEmpty (rs -/\- rSetNegation rs)
134
prop_empty_intersection rs = rSetIsEmpty (rs -/\- rSetNegation rs)
69
true
true
0
8
47
47
25
22
null
null
ckkashyap/Chitra
Utilities/ParseByteString.hs
bsd-3-clause
action _ = A1 getWord8
22
action _ = A1 getWord8
22
action _ = A1 getWord8
22
false
false
0
5
4
12
5
7
null
null
benkolera/phb
hs/Phb/Dates.hs
mit
parseDay :: String -> Maybe Day parseDay = parseTime defaultTimeLocale "%F"
75
parseDay :: String -> Maybe Day parseDay = parseTime defaultTimeLocale "%F"
75
parseDay = parseTime defaultTimeLocale "%F"
43
false
true
0
7
10
29
12
17
null
null
fizruk/path-pieces
Web/PathPieces.hs
bsd-2-clause
readFromPathPiece :: Read s => S.Text -> Maybe s readFromPathPiece = readMaybe . S.unpack
89
readFromPathPiece :: Read s => S.Text -> Maybe s readFromPathPiece = readMaybe . S.unpack
89
readFromPathPiece = readMaybe . S.unpack
40
false
true
0
7
13
33
16
17
null
null
beni55/binary
src/Data/Binary/Get.hs
bsd-3-clause
getWord32be :: Get Word32 getWord32be = do s <- readN 4 id return $! (fromIntegral (s `B.index` 0) `shiftl_w32` 24) .|. (fromIntegral (s `B.index` 1) `shiftl_w32` 16) .|. (fromIntegral (s `B.index` 2) `shiftl_w32` 8) .|. (fromIntegral (s `B.index` 3) ) {- INLINE getWord32be -} -- | Read a Word32 in little endian format
372
getWord32be :: Get Word32 getWord32be = do s <- readN 4 id return $! (fromIntegral (s `B.index` 0) `shiftl_w32` 24) .|. (fromIntegral (s `B.index` 1) `shiftl_w32` 16) .|. (fromIntegral (s `B.index` 2) `shiftl_w32` 8) .|. (fromIntegral (s `B.index` 3) ) {- INLINE getWord32be -} -- | Read a Word32 in little endian format
372
getWord32be = do s <- readN 4 id return $! (fromIntegral (s `B.index` 0) `shiftl_w32` 24) .|. (fromIntegral (s `B.index` 1) `shiftl_w32` 16) .|. (fromIntegral (s `B.index` 2) `shiftl_w32` 8) .|. (fromIntegral (s `B.index` 3) ) {- INLINE getWord32be -} -- | Read a Word32 in little endian format
346
false
true
0
15
104
133
75
58
null
null
tomberek/rulestesting
Auto.hs
bsd-3-clause
testAutoM :: Monad m => AutoX m a b -> [a] -> m ([Maybe b], AutoX m a b) testAutoM a [] = return ([], a)
109
testAutoM :: Monad m => AutoX m a b -> [a] -> m ([Maybe b], AutoX m a b) testAutoM a [] = return ([], a)
109
testAutoM a [] = return ([], a)
36
false
true
0
11
30
76
38
38
null
null
amccausl/Swish
Swish/HaskellRDF/Datatype.hs
lgpl-2.1
makeVmod_2_1 _ _ _ = error "makeVmod_2_1: requires 2 functions and 3 labels"
81
makeVmod_2_1 _ _ _ = error "makeVmod_2_1: requires 2 functions and 3 labels"
81
makeVmod_2_1 _ _ _ = error "makeVmod_2_1: requires 2 functions and 3 labels"
81
false
false
0
5
17
16
7
9
null
null
fffej/HS-Poker
LookupPatternMatch.hs
bsd-3-clause
getValueFromProduct 726869 = 5036
33
getValueFromProduct 726869 = 5036
33
getValueFromProduct 726869 = 5036
33
false
false
0
5
3
9
4
5
null
null
pnutus/slask
app/Main.hs
bsd-3-clause
frontPage :: Manager -> Text -> ActionM () frontPage manager query = do tables <- mapM (queryTable manager) frontPageQueries blaze . template . mconcat $ searchBox query : tables
182
frontPage :: Manager -> Text -> ActionM () frontPage manager query = do tables <- mapM (queryTable manager) frontPageQueries blaze . template . mconcat $ searchBox query : tables
182
frontPage manager query = do tables <- mapM (queryTable manager) frontPageQueries blaze . template . mconcat $ searchBox query : tables
139
false
true
0
10
32
69
32
37
null
null
aartifact/aartifact-verifier
src/MapUsingList.hs
mit
def :: Eq a => a -> b -> (a -> b -> b) -> Map a b -> Map a b def x' y' f (M m) = M $ df m where df ((x,y):xys) = if x/=x' then (x,y):df xys else (x,f x y):xys df [] = [(x',y')]
186
def :: Eq a => a -> b -> (a -> b -> b) -> Map a b -> Map a b def x' y' f (M m) = M $ df m where df ((x,y):xys) = if x/=x' then (x,y):df xys else (x,f x y):xys df [] = [(x',y')]
186
def x' y' f (M m) = M $ df m where df ((x,y):xys) = if x/=x' then (x,y):df xys else (x,f x y):xys df [] = [(x',y')]
125
false
true
1
11
59
160
83
77
null
null
mightybyte/snaplet-acid-state
src/Snap/Snaplet/AcidState.hs
bsd-3-clause
query :: (HasAcid s (A.MethodState event), MonadSnaplet m, MonadState s (m b b), QueryEvent event, MonadIO (m b v)) => event -> m b v (EventResult event) query event = do st <- getAcidState liftIO $ A.query st event ------------------------------------------------------------------------------ -- | Wrapper for acid-state's createCheckpoint function that works for -- arbitrary instances of HasAcid.
456
query :: (HasAcid s (A.MethodState event), MonadSnaplet m, MonadState s (m b b), QueryEvent event, MonadIO (m b v)) => event -> m b v (EventResult event) query event = do st <- getAcidState liftIO $ A.query st event ------------------------------------------------------------------------------ -- | Wrapper for acid-state's createCheckpoint function that works for -- arbitrary instances of HasAcid.
456
query event = do st <- getAcidState liftIO $ A.query st event ------------------------------------------------------------------------------ -- | Wrapper for acid-state's createCheckpoint function that works for -- arbitrary instances of HasAcid.
256
false
true
0
9
110
116
58
58
null
null
osa1/sequent-core
src/Language/SequentCore/Simpl/ExprSize.hs
bsd-3-clause
lamScrutDiscount :: DynFlags -> BodySize -> BodySize lamScrutDiscount _ TooBig = TooBig
92
lamScrutDiscount :: DynFlags -> BodySize -> BodySize lamScrutDiscount _ TooBig = TooBig
92
lamScrutDiscount _ TooBig = TooBig
39
false
true
0
8
16
30
13
17
null
null
nevrenato/Hets_Fork
HasCASL/Builtin.hs
gpl-2.0
botType :: TypeScheme botType = let a = aTypeArgK cppoCl in bindVarA a $ mkLazyType $ typeArgToType a
101
botType :: TypeScheme botType = let a = aTypeArgK cppoCl in bindVarA a $ mkLazyType $ typeArgToType a
101
botType = let a = aTypeArgK cppoCl in bindVarA a $ mkLazyType $ typeArgToType a
79
false
true
0
9
17
45
19
26
null
null
kite-lang/kite
tests/Kite/Test/Inference.hs
mit
bool = PBoolType
17
bool = PBoolType
17
bool = PBoolType
17
false
false
1
5
3
10
3
7
null
null
AlexeyRaga/eta
compiler/ETA/Main/DynFlags.hs
bsd-3-clause
setHiDir f d = d{ hiDir = Just f}
43
setHiDir f d = d{ hiDir = Just f}
43
setHiDir f d = d{ hiDir = Just f}
43
false
false
0
7
18
23
11
12
null
null
shlevy/ghc
compiler/prelude/THNames.hs
bsd-3-clause
quotePatKey = mkPreludeMiscIdUnique 471
40
quotePatKey = mkPreludeMiscIdUnique 471
40
quotePatKey = mkPreludeMiscIdUnique 471
40
false
false
0
5
4
9
4
5
null
null
pparkkin/eta
compiler/ETA/DeSugar/Check.hs
bsd-3-clause
is_con :: Pat Id -> Bool is_con (ConPatOut {}) = True
53
is_con :: Pat Id -> Bool is_con (ConPatOut {}) = True
53
is_con (ConPatOut {}) = True
28
false
true
0
7
10
28
14
14
null
null
spacekitteh/smcghc
compiler/cmm/CLabel.hs
bsd-3-clause
pprCLbl (RtsLabel (RtsSelectorInfoTable upd_reqd offset)) = hcat [ptext (sLit "stg_sel_"), text (show offset), ptext (if upd_reqd then (sLit "_upd_info") else (sLit "_noupd_info")) ]
236
pprCLbl (RtsLabel (RtsSelectorInfoTable upd_reqd offset)) = hcat [ptext (sLit "stg_sel_"), text (show offset), ptext (if upd_reqd then (sLit "_upd_info") else (sLit "_noupd_info")) ]
236
pprCLbl (RtsLabel (RtsSelectorInfoTable upd_reqd offset)) = hcat [ptext (sLit "stg_sel_"), text (show offset), ptext (if upd_reqd then (sLit "_upd_info") else (sLit "_noupd_info")) ]
236
false
false
0
10
76
80
40
40
null
null
dsaenztagarro/haskellbook
src/chapter10/DatabaseProcessing.hs
bsd-3-clause
theDatabase :: [DatabaseItem] theDatabase = [ DbDate (UTCTime (fromGregorian 1911 5 1) (secondsToDiffTime 34123)) , DbNumber 9001 , DbNumber 10 , DbString "Hello, world!" , DbDate (UTCTime (fromGregorian 1911 5 1) (secondsToDiffTime 34123)) ]
254
theDatabase :: [DatabaseItem] theDatabase = [ DbDate (UTCTime (fromGregorian 1911 5 1) (secondsToDiffTime 34123)) , DbNumber 9001 , DbNumber 10 , DbString "Hello, world!" , DbDate (UTCTime (fromGregorian 1911 5 1) (secondsToDiffTime 34123)) ]
254
theDatabase = [ DbDate (UTCTime (fromGregorian 1911 5 1) (secondsToDiffTime 34123)) , DbNumber 9001 , DbNumber 10 , DbString "Hello, world!" , DbDate (UTCTime (fromGregorian 1911 5 1) (secondsToDiffTime 34123)) ]
224
false
true
0
10
45
92
47
45
null
null
HIPERFIT/futhark
src/Futhark/Internalise/Exps.hs
isc
internaliseArg :: String -> (E.Exp, Maybe VName) -> InternaliseM [SubExp] internaliseArg desc (arg, argdim) = do exists <- askScope case argdim of Just d | d `M.member` exists -> pure [I.Var d] _ -> do arg' <- internaliseExp desc arg case (arg', argdim) of ([se], Just d) -> do letBindNames [d] $ BasicOp $ SubExp se _ -> return () pure arg'
397
internaliseArg :: String -> (E.Exp, Maybe VName) -> InternaliseM [SubExp] internaliseArg desc (arg, argdim) = do exists <- askScope case argdim of Just d | d `M.member` exists -> pure [I.Var d] _ -> do arg' <- internaliseExp desc arg case (arg', argdim) of ([se], Just d) -> do letBindNames [d] $ BasicOp $ SubExp se _ -> return () pure arg'
397
internaliseArg desc (arg, argdim) = do exists <- askScope case argdim of Just d | d `M.member` exists -> pure [I.Var d] _ -> do arg' <- internaliseExp desc arg case (arg', argdim) of ([se], Just d) -> do letBindNames [d] $ BasicOp $ SubExp se _ -> return () pure arg'
323
false
true
0
20
117
181
88
93
null
null
agrafix/hackage-server
Distribution/Server/Features/Security/Layout.hs
bsd-3-clause
{------------------------------------------------------------------------------- On-disk layout -------------------------------------------------------------------------------} -- | The root info -- -- We just serve this file, we don't actually need the info. onDiskRoot :: ServerEnv -> Sec.Path Sec.Absolute onDiskRoot = onDisk "root.json"
343
onDiskRoot :: ServerEnv -> Sec.Path Sec.Absolute onDiskRoot = onDisk "root.json"
80
onDiskRoot = onDisk "root.json"
31
true
true
0
8
34
35
17
18
null
null
randen/cabal
cabal-install/Distribution/Client/Tar.hs
bsd-3-clause
pack :: FilePath -- ^ Base directory -> [FilePath] -- ^ Files and directories to pack, relative to the base dir -> IO [Entry] pack baseDir paths0 = preparePaths baseDir paths0 >>= packPaths baseDir
209
pack :: FilePath -- ^ Base directory -> [FilePath] -- ^ Files and directories to pack, relative to the base dir -> IO [Entry] pack baseDir paths0 = preparePaths baseDir paths0 >>= packPaths baseDir
209
pack baseDir paths0 = preparePaths baseDir paths0 >>= packPaths baseDir
71
false
true
0
8
45
47
24
23
null
null
jasonbaker/lang
Lang/Parser.hs
bsd-3-clause
stringExpr :: Parser LangExpr stringExpr = do{ s <- stringLiteral; return $ StrExpr s}
86
stringExpr :: Parser LangExpr stringExpr = do{ s <- stringLiteral; return $ StrExpr s}
86
stringExpr = do{ s <- stringLiteral; return $ StrExpr s}
56
false
true
0
8
13
34
17
17
null
null
forked-upstream-packages-for-ghcjs/ghcjs
ghcjs/src/Gen2/Optimizer.hs
mit
doubleInfixOp LtOp (SaneDouble d1) (SaneDouble d2) = eBool (d1 < d2)
69
doubleInfixOp LtOp (SaneDouble d1) (SaneDouble d2) = eBool (d1 < d2)
69
doubleInfixOp LtOp (SaneDouble d1) (SaneDouble d2) = eBool (d1 < d2)
69
false
false
0
7
11
35
17
18
null
null
greydot/dns
Network/DNS/Encode.hs
bsd-3-clause
putPointer :: Int -> SPut putPointer pos = putInt16 (pos .|. 0xc000)
68
putPointer :: Int -> SPut putPointer pos = putInt16 (pos .|. 0xc000)
68
putPointer pos = putInt16 (pos .|. 0xc000)
42
false
true
0
7
11
28
14
14
null
null
minoki/LambdaQuest
src/LambdaQuest/Simple/Parse.hs
bsd-3-clause
symbol = PT.symbol tokenParser :: String -> Parser String
57
symbol = PT.symbol tokenParser :: String -> Parser String
57
symbol = PT.symbol tokenParser :: String -> Parser String
57
false
false
0
6
8
24
11
13
null
null
bitc/omegagb
src/Cpu.hs
gpl-2.0
mctiCB 0xCB = (SET Bit1 E, 8)
29
mctiCB 0xCB = (SET Bit1 E, 8)
29
mctiCB 0xCB = (SET Bit1 E, 8)
29
false
false
1
6
6
23
10
13
null
null
rueshyna/gogol
gogol-genomics/gen/Network/Google/Genomics/Types/Product.hs
mpl-2.0
-- | Creates a value of 'SearchVariantsRequest' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'svrStart' -- -- * 'svrCallSetIds' -- -- * 'svrReferenceName' -- -- * 'svrEnd' -- -- * 'svrMaxCalls' -- -- * 'svrPageToken' -- -- * 'svrVariantName' -- -- * 'svrVariantSetIds' -- -- * 'svrPageSize' searchVariantsRequest :: SearchVariantsRequest searchVariantsRequest = SearchVariantsRequest' { _svrStart = Nothing , _svrCallSetIds = Nothing , _svrReferenceName = Nothing , _svrEnd = Nothing , _svrMaxCalls = Nothing , _svrPageToken = Nothing , _svrVariantName = Nothing , _svrVariantSetIds = Nothing , _svrPageSize = Nothing }
755
searchVariantsRequest :: SearchVariantsRequest searchVariantsRequest = SearchVariantsRequest' { _svrStart = Nothing , _svrCallSetIds = Nothing , _svrReferenceName = Nothing , _svrEnd = Nothing , _svrMaxCalls = Nothing , _svrPageToken = Nothing , _svrVariantName = Nothing , _svrVariantSetIds = Nothing , _svrPageSize = Nothing }
376
searchVariantsRequest = SearchVariantsRequest' { _svrStart = Nothing , _svrCallSetIds = Nothing , _svrReferenceName = Nothing , _svrEnd = Nothing , _svrMaxCalls = Nothing , _svrPageToken = Nothing , _svrVariantName = Nothing , _svrVariantSetIds = Nothing , _svrPageSize = Nothing }
325
true
true
1
7
156
95
65
30
null
null
nevrenato/HetsAlloy
Comorphisms/CASL2SubCFOL.hs
gpl-2.0
-- | Add projections to the signature encodeSig :: Set.Set SORT -> Sign f e -> Sign f e encodeSig bsorts sig = if Set.null bsorts then sig else sig { opMap = projOpMap, predMap = newpredMap } where newTotalMap = MapSet.map mkTotal $ opMap sig botOpMap = Set.fold (\ bt -> addOpTo (uniqueBotName $ toOP_TYPE bt) bt) newTotalMap $ Set.map botType bsorts defType x = PredType {predArgs = [x]} defTypes = Set.map defType bsorts newpredMap = MapSet.update (const defTypes) defPred $ predMap sig rel = sortRel sig total (s, s') = mkTotOpType [s'] s setprojOptype = Set.map total $ Set.filter ( \ (s, _) -> Set.member s bsorts) $ Rel.toSet rel projOpMap = Set.fold (\ t -> addOpTo (uniqueProjName $ toOP_TYPE t) t) botOpMap setprojOptype -- | Make the name for the non empty axiom from s to s' to s''
846
encodeSig :: Set.Set SORT -> Sign f e -> Sign f e encodeSig bsorts sig = if Set.null bsorts then sig else sig { opMap = projOpMap, predMap = newpredMap } where newTotalMap = MapSet.map mkTotal $ opMap sig botOpMap = Set.fold (\ bt -> addOpTo (uniqueBotName $ toOP_TYPE bt) bt) newTotalMap $ Set.map botType bsorts defType x = PredType {predArgs = [x]} defTypes = Set.map defType bsorts newpredMap = MapSet.update (const defTypes) defPred $ predMap sig rel = sortRel sig total (s, s') = mkTotOpType [s'] s setprojOptype = Set.map total $ Set.filter ( \ (s, _) -> Set.member s bsorts) $ Rel.toSet rel projOpMap = Set.fold (\ t -> addOpTo (uniqueProjName $ toOP_TYPE t) t) botOpMap setprojOptype -- | Make the name for the non empty axiom from s to s' to s''
808
encodeSig bsorts sig = if Set.null bsorts then sig else sig { opMap = projOpMap, predMap = newpredMap } where newTotalMap = MapSet.map mkTotal $ opMap sig botOpMap = Set.fold (\ bt -> addOpTo (uniqueBotName $ toOP_TYPE bt) bt) newTotalMap $ Set.map botType bsorts defType x = PredType {predArgs = [x]} defTypes = Set.map defType bsorts newpredMap = MapSet.update (const defTypes) defPred $ predMap sig rel = sortRel sig total (s, s') = mkTotOpType [s'] s setprojOptype = Set.map total $ Set.filter ( \ (s, _) -> Set.member s bsorts) $ Rel.toSet rel projOpMap = Set.fold (\ t -> addOpTo (uniqueProjName $ toOP_TYPE t) t) botOpMap setprojOptype -- | Make the name for the non empty axiom from s to s' to s''
758
true
true
0
14
194
305
157
148
null
null
brendanhay/gogol
gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs
mpl-2.0
-- | Creates a value of 'SpannerIODetails' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'siodInstanceId' -- -- * 'siodDatabaseId' -- -- * 'siodProjectId' spannerIODetails :: SpannerIODetails spannerIODetails = SpannerIODetails' { _siodInstanceId = Nothing , _siodDatabaseId = Nothing , _siodProjectId = Nothing }
422
spannerIODetails :: SpannerIODetails spannerIODetails = SpannerIODetails' { _siodInstanceId = Nothing , _siodDatabaseId = Nothing , _siodProjectId = Nothing }
180
spannerIODetails = SpannerIODetails' { _siodInstanceId = Nothing , _siodDatabaseId = Nothing , _siodProjectId = Nothing }
139
true
true
0
6
82
40
28
12
null
null
jprider63/LMonad
src/LMonad/Label/DisjunctionCategory.hs
mit
-- O(n) exists :: (a -> Bool) -> Set a -> Bool exists pred = Set.foldl' (\acc el -> acc || (pred el)) False
107
exists :: (a -> Bool) -> Set a -> Bool exists pred = Set.foldl' (\acc el -> acc || (pred el)) False
99
exists pred = Set.foldl' (\acc el -> acc || (pred el)) False
60
true
true
0
10
23
65
32
33
null
null
nikki-and-the-robots/nikki
src/Physics/Chipmunk/Types.hs
lgpl-3.0
-- | same as componentUpAngle, but angle == 0 means east (chipmunk standard) component :: Angle -> Vector -> Vector component = componentWithToAngle (toAngle, fromAngle)
169
component :: Angle -> Vector -> Vector component = componentWithToAngle (toAngle, fromAngle)
92
component = componentWithToAngle (toAngle, fromAngle)
53
true
true
0
6
24
29
16
13
null
null
keithodulaigh/Hets
Common/ATerm/ConvInstances.hs
gpl-2.0
ordFromInt :: Int -> Ordering ordFromInt 0 = LT
47
ordFromInt :: Int -> Ordering ordFromInt 0 = LT
47
ordFromInt 0 = LT
17
false
true
0
7
8
24
10
14
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Text/Greek/IO/Stage.hs
mit
dupApply' :: ((d -> Functor.Identity (d, b)) -> a -> Functor.Identity c) -> (d -> b) -> a -> c dupApply' a b = Functor.runIdentity . dupApply a (Functor.Identity . b)
166
dupApply' :: ((d -> Functor.Identity (d, b)) -> a -> Functor.Identity c) -> (d -> b) -> a -> c dupApply' a b = Functor.runIdentity . dupApply a (Functor.Identity . b)
166
dupApply' a b = Functor.runIdentity . dupApply a (Functor.Identity . b)
71
false
true
0
11
30
89
46
43
null
null
rueshyna/gogol
gogol-books/gen/Network/Google/Books/Types/Product.hs
mpl-2.0
-- | Whether or not this book is public domain in the country listed above. vaiPublicDomain :: Lens' VolumeAccessInfo (Maybe Bool) vaiPublicDomain = lens _vaiPublicDomain (\ s a -> s{_vaiPublicDomain = a})
213
vaiPublicDomain :: Lens' VolumeAccessInfo (Maybe Bool) vaiPublicDomain = lens _vaiPublicDomain (\ s a -> s{_vaiPublicDomain = a})
137
vaiPublicDomain = lens _vaiPublicDomain (\ s a -> s{_vaiPublicDomain = a})
82
true
true
1
9
39
51
25
26
null
null
ouanixi/hs2ast
tests/Impure.hs
gpl-3.0
main = defaultMain $ withOptions $ testGroup "Impure tests" [ H.impureTests , S.impureTests ]
101
main = defaultMain $ withOptions $ testGroup "Impure tests" [ H.impureTests , S.impureTests ]
101
main = defaultMain $ withOptions $ testGroup "Impure tests" [ H.impureTests , S.impureTests ]
101
false
false
1
8
21
32
15
17
null
null
egaburov/funstuff
Haskell/monads/readm.hs
apache-2.0
asks :: (Monad m, MonadReader e m) => (e -> a) -> m a asks sel = ask >>= return . sel
86
asks :: (Monad m, MonadReader e m) => (e -> a) -> m a asks sel = ask >>= return . sel
85
asks sel = ask >>= return . sel
31
false
true
0
8
22
53
27
26
null
null
kawu/ltag
src/NLP/LTAG/Early3.hs
bsd-2-clause
-- | Show the label. viewLab :: (View n, View t) => Lab n t -> String viewLab (NonT s) = "N" ++ viewSym s
105
viewLab :: (View n, View t) => Lab n t -> String viewLab (NonT s) = "N" ++ viewSym s
84
viewLab (NonT s) = "N" ++ viewSym s
35
true
true
0
7
24
52
26
26
null
null
nushio3/unittyped
src/UnitTyped/SI/Constants.hs
lgpl-2.1
-- |ฯ€ as a rational value. Which it isn't. But we can pretend it is. pi :: (Fractional f) => Value '[] '[] f pi = mkVal 3.1415926535897932384626433832795028841971
162
pi :: (Fractional f) => Value '[] '[] f pi = mkVal 3.1415926535897932384626433832795028841971
93
pi = mkVal 3.1415926535897932384626433832795028841971
53
true
true
0
9
27
44
21
23
null
null
sinelaw/language-ecmascript
src/Language/ECMAScript3/PrettyPrint.hs
bsd-3-clause
maybe (Just a) f = f a
22
maybe (Just a) f = f a
22
maybe (Just a) f = f a
22
false
false
0
7
6
20
9
11
null
null
raichoo/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
reflectSpecialName (InstanceCtorN n) = reflCall "InstanceCtorN" [reflectName n]
81
reflectSpecialName (InstanceCtorN n) = reflCall "InstanceCtorN" [reflectName n]
81
reflectSpecialName (InstanceCtorN n) = reflCall "InstanceCtorN" [reflectName n]
81
false
false
0
7
9
26
12
14
null
null
phadej/range-set-list
tests/Map.hs
mit
-- All QuickCheck properties mapProps :: TestTree mapProps = testGroup "QuickCheck Map properties" [ QC.testProperty "element operations are similar" elementsProp , QC.testProperty "size is consistent" sizeProp , QC.testProperty "null operation is similar" nullProp , QC.testProperty "member operation is similar" memberProp , QC.testProperty "notMember operation is similar" notMemberProp , QC.testProperty "lookupLT operation is similar" lookupLTProp , QC.testProperty "lookupGT operation is similar" lookupGTProp , QC.testProperty "lookupLE operation is similar" lookupLEProp , QC.testProperty "lookupGE operation is similar" lookupGEProp , QC.testProperty "isSubset operation is similar" isSubsetProp , QC.testProperty "split operation is similar" splitProp , QC.testProperty "range operations is similar" rangeProp , QC.testProperty "ranges remain is ordered" orderedProp , QC.testProperty "fromAscList . toAscList === id" ascListProp , complementProps , minMaxProps , monoidLaws , QC.testProperty "item sets valid" validProp , QC.testProperty "range sets valid" validRProp , QC.testProperty "fromNormalizedRangeList invalid" invalidProp ]
1,186
mapProps :: TestTree mapProps = testGroup "QuickCheck Map properties" [ QC.testProperty "element operations are similar" elementsProp , QC.testProperty "size is consistent" sizeProp , QC.testProperty "null operation is similar" nullProp , QC.testProperty "member operation is similar" memberProp , QC.testProperty "notMember operation is similar" notMemberProp , QC.testProperty "lookupLT operation is similar" lookupLTProp , QC.testProperty "lookupGT operation is similar" lookupGTProp , QC.testProperty "lookupLE operation is similar" lookupLEProp , QC.testProperty "lookupGE operation is similar" lookupGEProp , QC.testProperty "isSubset operation is similar" isSubsetProp , QC.testProperty "split operation is similar" splitProp , QC.testProperty "range operations is similar" rangeProp , QC.testProperty "ranges remain is ordered" orderedProp , QC.testProperty "fromAscList . toAscList === id" ascListProp , complementProps , minMaxProps , monoidLaws , QC.testProperty "item sets valid" validProp , QC.testProperty "range sets valid" validRProp , QC.testProperty "fromNormalizedRangeList invalid" invalidProp ]
1,157
mapProps = testGroup "QuickCheck Map properties" [ QC.testProperty "element operations are similar" elementsProp , QC.testProperty "size is consistent" sizeProp , QC.testProperty "null operation is similar" nullProp , QC.testProperty "member operation is similar" memberProp , QC.testProperty "notMember operation is similar" notMemberProp , QC.testProperty "lookupLT operation is similar" lookupLTProp , QC.testProperty "lookupGT operation is similar" lookupGTProp , QC.testProperty "lookupLE operation is similar" lookupLEProp , QC.testProperty "lookupGE operation is similar" lookupGEProp , QC.testProperty "isSubset operation is similar" isSubsetProp , QC.testProperty "split operation is similar" splitProp , QC.testProperty "range operations is similar" rangeProp , QC.testProperty "ranges remain is ordered" orderedProp , QC.testProperty "fromAscList . toAscList === id" ascListProp , complementProps , minMaxProps , monoidLaws , QC.testProperty "item sets valid" validProp , QC.testProperty "range sets valid" validRProp , QC.testProperty "fromNormalizedRangeList invalid" invalidProp ]
1,136
true
true
0
8
176
204
101
103
null
null
ezyang/ghc
compiler/types/Type.hs
bsd-3-clause
isNamedTyBinder (Anon {}) = False
34
isNamedTyBinder (Anon {}) = False
34
isNamedTyBinder (Anon {}) = False
34
false
false
0
6
5
17
8
9
null
null
robdockins/orlin
src/Orlin/PureTypeSys.hs
bsd-2-clause
displayExpr nms (Let (NonRecDecl nm x ty _) y) = do let nm' = nm -- FIXME disambiguate shadowing ty' <- displayExpr nms ty x' <- displayExpr nms x y' <- displayExpr (nms Seq.|> nm') y return $ "(let " ++ nm' ++ ":" ++ ty' ++ " = " ++ x' ++ "; in " ++ y' ++")"
286
displayExpr nms (Let (NonRecDecl nm x ty _) y) = do let nm' = nm -- FIXME disambiguate shadowing ty' <- displayExpr nms ty x' <- displayExpr nms x y' <- displayExpr (nms Seq.|> nm') y return $ "(let " ++ nm' ++ ":" ++ ty' ++ " = " ++ x' ++ "; in " ++ y' ++")"
286
displayExpr nms (Let (NonRecDecl nm x ty _) y) = do let nm' = nm -- FIXME disambiguate shadowing ty' <- displayExpr nms ty x' <- displayExpr nms x y' <- displayExpr (nms Seq.|> nm') y return $ "(let " ++ nm' ++ ":" ++ ty' ++ " = " ++ x' ++ "; in " ++ y' ++")"
286
false
false
0
15
85
125
59
66
null
null
imuli/gitit
Network/Gitit/Export.hs
gpl-2.0
respondS :: String -> String -> String -> (WriterOptions -> Pandoc -> String) -> WriterOptions -> String -> Pandoc -> Handler respondS templ mimetype ext fn = respondX templ mimetype ext (\o d -> return $ fromString $ fn o d)
237
respondS :: String -> String -> String -> (WriterOptions -> Pandoc -> String) -> WriterOptions -> String -> Pandoc -> Handler respondS templ mimetype ext fn = respondX templ mimetype ext (\o d -> return $ fromString $ fn o d)
237
respondS templ mimetype ext fn = respondX templ mimetype ext (\o d -> return $ fromString $ fn o d)
101
false
true
0
11
52
91
46
45
null
null
klpn/highlighting-kate
tests/test-highlighting-kate.hs
gpl-2.0
formatHtml toks = renderHtml $ H.head (metadata >> css) >> H.body (toHtml fragment) where css = H.style ! A.type_ "text/css" $ toHtml $ styleToCss pygments fragment = formatHtmlBlock opts toks metadata = H.meta ! A.httpEquiv "Content-Type" ! A.content "text/html; charset=UTF-8" opts = defaultFormatOpts{ titleAttributes = True }
387
formatHtml toks = renderHtml $ H.head (metadata >> css) >> H.body (toHtml fragment) where css = H.style ! A.type_ "text/css" $ toHtml $ styleToCss pygments fragment = formatHtmlBlock opts toks metadata = H.meta ! A.httpEquiv "Content-Type" ! A.content "text/html; charset=UTF-8" opts = defaultFormatOpts{ titleAttributes = True }
387
formatHtml toks = renderHtml $ H.head (metadata >> css) >> H.body (toHtml fragment) where css = H.style ! A.type_ "text/css" $ toHtml $ styleToCss pygments fragment = formatHtmlBlock opts toks metadata = H.meta ! A.httpEquiv "Content-Type" ! A.content "text/html; charset=UTF-8" opts = defaultFormatOpts{ titleAttributes = True }
387
false
false
3
11
104
120
58
62
null
null
akegalj/snowdrift
Foundation.hs
agpl-3.0
snowdriftTitle :: MonadWidget m => Text -> m () snowdriftTitle t = setTitle $ (toHtml $ titlecase $ toLower $ t) <> (toHtml (" | Snowdrift.coop" :: Text))
162
snowdriftTitle :: MonadWidget m => Text -> m () snowdriftTitle t = setTitle $ (toHtml $ titlecase $ toLower $ t) <> (toHtml (" | Snowdrift.coop" :: Text))
162
snowdriftTitle t = setTitle $ (toHtml $ titlecase $ toLower $ t) <> (toHtml (" | Snowdrift.coop" :: Text))
114
false
true
0
10
35
65
33
32
null
null
fferreira/hnh
ProgramUtils.hs
gpl-3.0
procK (FunK f params body k) = putId f >> mapM putId params >> procK body >> procK k
115
procK (FunK f params body k) = putId f >> mapM putId params >> procK body >> procK k
115
procK (FunK f params body k) = putId f >> mapM putId params >> procK body >> procK k
115
false
false
0
8
49
48
21
27
null
null
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types.hs
mpl-2.0
-- | The format of the disk image from which the snapshot is created. sdFormat :: Lens' SnapshotDetail (Maybe Text) sdFormat = lens _sdFormat (\s a -> s { _sdFormat = a })
171
sdFormat :: Lens' SnapshotDetail (Maybe Text) sdFormat = lens _sdFormat (\s a -> s { _sdFormat = a })
101
sdFormat = lens _sdFormat (\s a -> s { _sdFormat = a })
55
true
true
1
9
32
52
25
27
null
null
elitak/frag
src/Collision.hs
gpl-2.0
epsilon :: Double epsilon = 0.03125
36
epsilon :: Double epsilon = 0.03125
35
epsilon = 0.03125
17
false
true
0
6
6
18
7
11
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
3259 = 3258
11
3259 = 3258
11
3259 = 3258
11
false
false
1
5
2
10
3
7
null
null
trezona-lecomte/surveyor
server/src/Lib.hs
mit
-- SERVER runServer :: Int -> IO () runServer port = do stateMVar <- Concurrent.newMVar initialState Warp.run port $ WS.websocketsOr WS.defaultConnectionOptions (wsApp stateMVar) httpApp -- WS.runServer ip port $ application serverState
252
runServer :: Int -> IO () runServer port = do stateMVar <- Concurrent.newMVar initialState Warp.run port $ WS.websocketsOr WS.defaultConnectionOptions (wsApp stateMVar) httpApp -- WS.runServer ip port $ application serverState
241
runServer port = do stateMVar <- Concurrent.newMVar initialState Warp.run port $ WS.websocketsOr WS.defaultConnectionOptions (wsApp stateMVar) httpApp -- WS.runServer ip port $ application serverState
215
true
true
0
11
46
71
32
39
null
null
mfolnovic/puh-hash
Parsing/HashParser.hs
gpl-2.0
outDirP :: Parser (Expr, Bool) outDirP = do t <- lexeme $ (try $ string ">>") <|> string ">" e <- lexeme expr let append = t == ">>" return (e, append) -- Parses in redirection.
186
outDirP :: Parser (Expr, Bool) outDirP = do t <- lexeme $ (try $ string ">>") <|> string ">" e <- lexeme expr let append = t == ">>" return (e, append) -- Parses in redirection.
186
outDirP = do t <- lexeme $ (try $ string ">>") <|> string ">" e <- lexeme expr let append = t == ">>" return (e, append) -- Parses in redirection.
155
false
true
0
13
44
90
42
48
null
null
konn/hint-forked
src/Hint/Context.hs
bsd-3-clause
removePhantomModule :: MonadInterpreter m => PhantomModule -> m () removePhantomModule pm = do -- We don't want to actually unload this module, because that -- would mean that all the real modules might get reloaded and the -- user didn't require that (they may be in a non-compiling state!). -- However, this means that we can't actually delete the file, because -- it is an active target. Therefore, we simply take it out of scope -- and mark it as "delete me when possible" (i.e., next time the -- @loadModules@ function is called). -- isLoaded <- moduleIsLoaded $ pm_name pm safeToRemove <- if isLoaded then do -- take it out of scope mod <- findModule (pm_name pm) (mods, imps) <- runGhc Compat.getContext let mods' = filter (mod /=) mods runGhc2 Compat.setContext mods' imps -- let isNotPhantom = isPhantomModule . moduleToString >=> return . not null `liftM` filterM isNotPhantom mods' else return True -- let file_name = pm_file pm runGhc1 GHC.removeTarget (Compat.targetId $ Compat.fileTarget file_name) -- onState (\s -> s{active_phantoms = filter (pm /=) $ active_phantoms s}) -- if safeToRemove then do mayFail $ do res <- runGhc1 GHC.load GHC.LoadAllTargets return $ guard (isSucceeded res) >> Just () liftIO $ removeFile (pm_file pm) else do onState (\s -> s{zombie_phantoms = pm:zombie_phantoms s}) return () -- Returns a tuple with the active and zombie phantom modules respectively
1,824
removePhantomModule :: MonadInterpreter m => PhantomModule -> m () removePhantomModule pm = do -- We don't want to actually unload this module, because that -- would mean that all the real modules might get reloaded and the -- user didn't require that (they may be in a non-compiling state!). -- However, this means that we can't actually delete the file, because -- it is an active target. Therefore, we simply take it out of scope -- and mark it as "delete me when possible" (i.e., next time the -- @loadModules@ function is called). -- isLoaded <- moduleIsLoaded $ pm_name pm safeToRemove <- if isLoaded then do -- take it out of scope mod <- findModule (pm_name pm) (mods, imps) <- runGhc Compat.getContext let mods' = filter (mod /=) mods runGhc2 Compat.setContext mods' imps -- let isNotPhantom = isPhantomModule . moduleToString >=> return . not null `liftM` filterM isNotPhantom mods' else return True -- let file_name = pm_file pm runGhc1 GHC.removeTarget (Compat.targetId $ Compat.fileTarget file_name) -- onState (\s -> s{active_phantoms = filter (pm /=) $ active_phantoms s}) -- if safeToRemove then do mayFail $ do res <- runGhc1 GHC.load GHC.LoadAllTargets return $ guard (isSucceeded res) >> Just () liftIO $ removeFile (pm_file pm) else do onState (\s -> s{zombie_phantoms = pm:zombie_phantoms s}) return () -- Returns a tuple with the active and zombie phantom modules respectively
1,824
removePhantomModule pm = do -- We don't want to actually unload this module, because that -- would mean that all the real modules might get reloaded and the -- user didn't require that (they may be in a non-compiling state!). -- However, this means that we can't actually delete the file, because -- it is an active target. Therefore, we simply take it out of scope -- and mark it as "delete me when possible" (i.e., next time the -- @loadModules@ function is called). -- isLoaded <- moduleIsLoaded $ pm_name pm safeToRemove <- if isLoaded then do -- take it out of scope mod <- findModule (pm_name pm) (mods, imps) <- runGhc Compat.getContext let mods' = filter (mod /=) mods runGhc2 Compat.setContext mods' imps -- let isNotPhantom = isPhantomModule . moduleToString >=> return . not null `liftM` filterM isNotPhantom mods' else return True -- let file_name = pm_file pm runGhc1 GHC.removeTarget (Compat.targetId $ Compat.fileTarget file_name) -- onState (\s -> s{active_phantoms = filter (pm /=) $ active_phantoms s}) -- if safeToRemove then do mayFail $ do res <- runGhc1 GHC.load GHC.LoadAllTargets return $ guard (isSucceeded res) >> Just () liftIO $ removeFile (pm_file pm) else do onState (\s -> s{zombie_phantoms = pm:zombie_phantoms s}) return () -- Returns a tuple with the active and zombie phantom modules respectively
1,757
false
true
0
17
650
364
178
186
null
null
capsjac/pack
Data/Pack/Primitives.hs
bsd-3-clause
-- | A 'Int64' 'Packet' in the host endianness. i64host :: Packer Int64 i64host = simple 8 id id
96
i64host :: Packer Int64 i64host = simple 8 id id
48
i64host = simple 8 id id
24
true
true
0
6
18
30
12
18
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F06.hs
bsd-3-clause
ptr_glDepthRangeIndexed :: FunPtr (GLuint -> GLdouble -> GLdouble -> IO ()) ptr_glDepthRangeIndexed = unsafePerformIO $ getCommand "glDepthRangeIndexed"
152
ptr_glDepthRangeIndexed :: FunPtr (GLuint -> GLdouble -> GLdouble -> IO ()) ptr_glDepthRangeIndexed = unsafePerformIO $ getCommand "glDepthRangeIndexed"
152
ptr_glDepthRangeIndexed = unsafePerformIO $ getCommand "glDepthRangeIndexed"
76
false
true
0
11
16
41
20
21
null
null
selectel/mongoDB-haskell
Database/MongoDB/Internal/Protocol.hs
apache-2.0
nOpcode Insert{} = 2002
23
nOpcode Insert{} = 2002
23
nOpcode Insert{} = 2002
23
false
false
0
5
3
14
6
8
null
null
c-brenn/kronos
src/Interpreter.hs
bsd-3-clause
prompt :: Interpreter String prompt = liftIO $ putStr "kronos> " *> hFlush stdout *> getLine
92
prompt :: Interpreter String prompt = liftIO $ putStr "kronos> " *> hFlush stdout *> getLine
92
prompt = liftIO $ putStr "kronos> " *> hFlush stdout *> getLine
63
false
true
0
8
15
32
15
17
null
null
hanshoglund/hamid
src/System/Win32/MIDI.hs
bsd-3-clause
im 0x3C3 = MIM_DATA
20
mim 0x3C3 = MIM_DATA
20
mim 0x3C3 = MIM_DATA
20
false
false
0
4
4
10
4
6
null
null
pgavin/secdh
lib/Language/Slambda/Util.hs
bsd-3-clause
primName EvenPP = "even?"
28
primName EvenPP = "even?"
28
primName EvenPP = "even?"
28
false
false
1
5
6
13
4
9
null
null
rueshyna/gogol
gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/CourseWork/StudentSubmissions/TurnIn.hs
mpl-2.0
-- | Identifier of the student submission. ccwsstiId :: Lens' CoursesCourseWorkStudentSubmissionsTurnIn Text ccwsstiId = lens _ccwsstiId (\ s a -> s{_ccwsstiId = a})
167
ccwsstiId :: Lens' CoursesCourseWorkStudentSubmissionsTurnIn Text ccwsstiId = lens _ccwsstiId (\ s a -> s{_ccwsstiId = a})
124
ccwsstiId = lens _ccwsstiId (\ s a -> s{_ccwsstiId = a})
58
true
true
0
9
24
42
22
20
null
null
JAnthelme/relation-tool
src/Relvar/LSet.hs
bsd-3-clause
errDupLbl :: String errDupLbl = "Duplicate label names are not allowed."
72
errDupLbl :: String errDupLbl = "Duplicate label names are not allowed."
72
errDupLbl = "Duplicate label names are not allowed."
52
false
true
0
4
10
11
6
5
null
null
brendanhay/gogol
gogol-safebrowsing/gen/Network/Google/SafeBrowsing/Types/Product.hs
mpl-2.0
-- | Sets the maximum number of entries that the client is willing to have in -- the local database for the specified list. This should be a power of 2 -- between 2**10 and 2**20. If zero, no database size limit is set. gssvftlurlurcMaxDatabaseEntries :: Lens' GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints (Maybe Int32) gssvftlurlurcMaxDatabaseEntries = lens _gssvftlurlurcMaxDatabaseEntries (\ s a -> s{_gssvftlurlurcMaxDatabaseEntries = a}) . mapping _Coerce
515
gssvftlurlurcMaxDatabaseEntries :: Lens' GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints (Maybe Int32) gssvftlurlurcMaxDatabaseEntries = lens _gssvftlurlurcMaxDatabaseEntries (\ s a -> s{_gssvftlurlurcMaxDatabaseEntries = a}) . mapping _Coerce
295
gssvftlurlurcMaxDatabaseEntries = lens _gssvftlurlurcMaxDatabaseEntries (\ s a -> s{_gssvftlurlurcMaxDatabaseEntries = a}) . mapping _Coerce
154
true
true
1
8
77
59
30
29
null
null
danidiaz/foldl-transduce
examples/Timestamps.hs
bsd-3-clause
timestamp :: IO [T.Text] timestamp = liftM (return . T.pack . formatTime defaultTimeLocale "%M m %S s | ") getCurrentTime
121
timestamp :: IO [T.Text] timestamp = liftM (return . T.pack . formatTime defaultTimeLocale "%M m %S s | ") getCurrentTime
121
timestamp = liftM (return . T.pack . formatTime defaultTimeLocale "%M m %S s | ") getCurrentTime
96
false
true
0
9
19
42
21
21
null
null
judah/haskeline
System/Console/Haskeline/Command.hs
bsd-3-clause
change :: (LineState t, Monad m) => (s -> t) -> Command m s t change = (setState .)
83
change :: (LineState t, Monad m) => (s -> t) -> Command m s t change = (setState .)
83
change = (setState .)
21
false
true
0
8
18
48
26
22
null
null
ipuustin/propositional-planning
tests/Test-main.hs
bsd-3-clause
compoundExpr 0 = oneof [ return $ Variable "A", return $ Variable "B", return $ Variable "C", return $ Variable "D" ]
204
compoundExpr 0 = oneof [ return $ Variable "A", return $ Variable "B", return $ Variable "C", return $ Variable "D" ]
204
compoundExpr 0 = oneof [ return $ Variable "A", return $ Variable "B", return $ Variable "C", return $ Variable "D" ]
204
false
false
0
8
108
52
25
27
null
null
Xophmeister/tapestry
Quantise.hs
mit
-- Nearest-neighbour quantisation -- TODO Make this look less like line noise :P -- TODO Probabilistic nearest-neighbour... nearestNeighbour :: (Metric a) => [a] -> [a] -> [a] nearestNeighbour palette = map (\c -> snd (c, fst $ minimumBy (comparing snd) $ map (\x -> (x, d c x)) palette))
291
nearestNeighbour :: (Metric a) => [a] -> [a] -> [a] nearestNeighbour palette = map (\c -> snd (c, fst $ minimumBy (comparing snd) $ map (\x -> (x, d c x)) palette))
167
nearestNeighbour palette = map (\c -> snd (c, fst $ minimumBy (comparing snd) $ map (\x -> (x, d c x)) palette))
115
true
true
0
15
51
110
58
52
null
null
michaelt/streaming
src/Streaming/Prelude.hs
bsd-3-clause
{-| Fold a 'Stream' of numbers into their product with the return value > maps' product' :: Stream (Stream (Of Int)) m r -> Stream (Of Int) m r -} product :: (Monad m, Num a) => Stream (Of a) m r -> m (Of a r) product = fold (*) 1 id
235
product :: (Monad m, Num a) => Stream (Of a) m r -> m (Of a r) product = fold (*) 1 id
86
product = fold (*) 1 id
23
true
true
0
9
54
64
33
31
null
null
DaMSL/K3
src/Language/K3/Metaprogram/Evaluation.hs
apache-2.0
defaultMetaAnalysis :: K3 Declaration -> GeneratorM (K3 Declaration) defaultMetaAnalysis p = do strippedP <- mapExpression removeTypes p liftError (liftError return . translateProgramTypes . fst) $! inferProgramTypes strippedP where -- | Match any type annotation except pattern types which are user-defined in patterns. removeTypes e = return $! stripExprAnnotations (\a -> isETypeOrBound a || isEQType a) (const False) e liftError = either throwG
471
defaultMetaAnalysis :: K3 Declaration -> GeneratorM (K3 Declaration) defaultMetaAnalysis p = do strippedP <- mapExpression removeTypes p liftError (liftError return . translateProgramTypes . fst) $! inferProgramTypes strippedP where -- | Match any type annotation except pattern types which are user-defined in patterns. removeTypes e = return $! stripExprAnnotations (\a -> isETypeOrBound a || isEQType a) (const False) e liftError = either throwG
471
defaultMetaAnalysis p = do strippedP <- mapExpression removeTypes p liftError (liftError return . translateProgramTypes . fst) $! inferProgramTypes strippedP where -- | Match any type annotation except pattern types which are user-defined in patterns. removeTypes e = return $! stripExprAnnotations (\a -> isETypeOrBound a || isEQType a) (const False) e liftError = either throwG
402
false
true
0
12
84
124
58
66
null
null
jean-edouard/manager
dbd2/Perms.hs
gpl-2.0
rmPerm :: Path -> Perm -> PermTree -> PermTree rmPerm path perm pt@(PermTree other root) | origPerm == patchedPerm = pt | otherwise = case pathFindLongest other path of Nothing -> let newTree = M.alter doRemove path root in PermTree other newTree Just (prefix, tree) -> let subpath = prefix `substractPrefix` path newTree = M.alter doRemove subpath tree in PermTree (M.insert prefix newTree other) root where doRemove _ = if null patchedPerm then Nothing else Just patchedPerm origPerm = getPerms path pt patchedPerm = filter (/= perm) origPerm
758
rmPerm :: Path -> Perm -> PermTree -> PermTree rmPerm path perm pt@(PermTree other root) | origPerm == patchedPerm = pt | otherwise = case pathFindLongest other path of Nothing -> let newTree = M.alter doRemove path root in PermTree other newTree Just (prefix, tree) -> let subpath = prefix `substractPrefix` path newTree = M.alter doRemove subpath tree in PermTree (M.insert prefix newTree other) root where doRemove _ = if null patchedPerm then Nothing else Just patchedPerm origPerm = getPerms path pt patchedPerm = filter (/= perm) origPerm
758
rmPerm path perm pt@(PermTree other root) | origPerm == patchedPerm = pt | otherwise = case pathFindLongest other path of Nothing -> let newTree = M.alter doRemove path root in PermTree other newTree Just (prefix, tree) -> let subpath = prefix `substractPrefix` path newTree = M.alter doRemove subpath tree in PermTree (M.insert prefix newTree other) root where doRemove _ = if null patchedPerm then Nothing else Just patchedPerm origPerm = getPerms path pt patchedPerm = filter (/= perm) origPerm
711
false
true
3
13
301
213
105
108
null
null
poxu/pandoc
src/Text/Pandoc/Readers/HTML.hs
gpl-2.0
pStr :: InlinesParser Inlines pStr = do result <- many1 $ satisfy $ \c -> not (isSpace c) && not (isSpecial c) && not (isBad c) updateLastStrPos return $ B.str result
193
pStr :: InlinesParser Inlines pStr = do result <- many1 $ satisfy $ \c -> not (isSpace c) && not (isSpecial c) && not (isBad c) updateLastStrPos return $ B.str result
193
pStr = do result <- many1 $ satisfy $ \c -> not (isSpace c) && not (isSpecial c) && not (isBad c) updateLastStrPos return $ B.str result
163
false
true
0
14
57
84
39
45
null
null