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
iljakuklic/eel-proto
src/Sema/Infer.hs
bsd-3-clause
inferVal t@(TComp _ _ _) = inferTerm t
39
inferVal t@(TComp _ _ _) = inferTerm t
39
inferVal t@(TComp _ _ _) = inferTerm t
39
false
false
0
8
8
25
12
13
null
null
gafiatulin/codewars
src/6 kyu/Ackermann.hs
mit
ackermann m 0 = ackermann (m-1) 1
33
ackermann m 0 = ackermann (m-1) 1
33
ackermann m 0 = ackermann (m-1) 1
33
false
false
0
7
6
23
11
12
null
null
y-kamiya/ai-samples
app/BlockWorldStrips.hs
bsd-3-clause
main :: IO () main = do let startCondition = [HandEmpty, IsTop A True, IsTop B False, IsTop C True, On A (Object B), On B Table, On C Table] let goalCondition = [HandEmpty, IsTop A False, IsTop B False, IsTop C True, On C (Object B), On B (Object A), On A Table] print "------------- domain ----------------" mapM_ print buildDomain print "------------- target ----------------" print $ "start: " ++ show startCondition print $ "goal: " ++ show goalCondition print "------------- plan ----------------" let nodeInfo = strips buildDomain startCondition goalCondition mapM_ print $ extractPlan nodeInfo print $ "score: " ++ show (score nodeInfo) return ()
679
main :: IO () main = do let startCondition = [HandEmpty, IsTop A True, IsTop B False, IsTop C True, On A (Object B), On B Table, On C Table] let goalCondition = [HandEmpty, IsTop A False, IsTop B False, IsTop C True, On C (Object B), On B (Object A), On A Table] print "------------- domain ----------------" mapM_ print buildDomain print "------------- target ----------------" print $ "start: " ++ show startCondition print $ "goal: " ++ show goalCondition print "------------- plan ----------------" let nodeInfo = strips buildDomain startCondition goalCondition mapM_ print $ extractPlan nodeInfo print $ "score: " ++ show (score nodeInfo) return ()
679
main = do let startCondition = [HandEmpty, IsTop A True, IsTop B False, IsTop C True, On A (Object B), On B Table, On C Table] let goalCondition = [HandEmpty, IsTop A False, IsTop B False, IsTop C True, On C (Object B), On B (Object A), On A Table] print "------------- domain ----------------" mapM_ print buildDomain print "------------- target ----------------" print $ "start: " ++ show startCondition print $ "goal: " ++ show goalCondition print "------------- plan ----------------" let nodeInfo = strips buildDomain startCondition goalCondition mapM_ print $ extractPlan nodeInfo print $ "score: " ++ show (score nodeInfo) return ()
665
false
true
0
13
130
265
122
143
null
null
adept/hledger
hledger-lib/Hledger/Utils/Debug.hs
gpl-3.0
-- | Pretty-print a label and the showable value to the console when the global debug level is >= 1, then return it. -- Uses unsafePerformIO. dbg1 :: Show a => String -> a -> a dbg1 = ptraceAt 1
194
dbg1 :: Show a => String -> a -> a dbg1 = ptraceAt 1
52
dbg1 = ptraceAt 1
17
true
true
0
7
39
31
16
15
null
null
travitch/foreign-inference
src/Foreign/Inference/Interface/Diff.hs
bsd-3-clause
checkInBoth :: (Ord a) => Set a -> a -> Set a -> Set a checkInBoth s fname inBoth = case fname `S.member` s of True -> S.insert fname inBoth False -> inBoth
166
checkInBoth :: (Ord a) => Set a -> a -> Set a -> Set a checkInBoth s fname inBoth = case fname `S.member` s of True -> S.insert fname inBoth False -> inBoth
166
checkInBoth s fname inBoth = case fname `S.member` s of True -> S.insert fname inBoth False -> inBoth
111
false
true
0
9
42
85
40
45
null
null
ctford/Idris-Elba-dev
src/IRTS/Java/JTypes.hs
bsd-3-clause
sourceTypes (LZExt from _) = [intTyToJType from]
48
sourceTypes (LZExt from _) = [intTyToJType from]
48
sourceTypes (LZExt from _) = [intTyToJType from]
48
false
false
0
7
6
23
11
12
null
null
ntc2/cryptol
src/Cryptol/Parser/AST.hs
bsd-3-clause
isEApp (EApp e1 e2) = Just (e1,e2)
40
isEApp (EApp e1 e2) = Just (e1,e2)
40
isEApp (EApp e1 e2) = Just (e1,e2)
40
false
false
0
7
12
26
13
13
null
null
notogawa/VideoCore4
src/VideoCore4/QPU/Instruction/SmallImmediate.hs
bsd-3-clause
small_immed_M7 :: SmallImmediate small_immed_M7 = SmallImmediate 25
67
small_immed_M7 :: SmallImmediate small_immed_M7 = SmallImmediate 25
67
small_immed_M7 = SmallImmediate 25
34
false
true
0
5
6
14
7
7
null
null
forsyde/forsyde-shallow
src/ForSyDe/Shallow/MoC/Synchronous/Lib.hs
bsd-3-clause
unzipxSY (NullV :- vss) = unzipxSY vss
40
unzipxSY (NullV :- vss) = unzipxSY vss
40
unzipxSY (NullV :- vss) = unzipxSY vss
40
false
false
0
7
8
19
9
10
null
null
tphyahoo/haskoin
haskoin-wallet/Network/Haskoin/Wallet/Transaction.hs
unlicense
getInCoins :: MonadIO m => Tx -> Maybe KeyRingAccountId -> SqlPersistT m [InCoinData] getInCoins tx aiM = do res <- splitSelect ops $ \os -> from $ \(c `InnerJoin` t `InnerJoin` x) -> do on $ x ^. KeyRingAddrId ==. c ^. KeyRingCoinAddr on $ t ^. KeyRingTxId ==. c ^. KeyRingCoinTx where_ $ case aiM of Just ai -> c ^. KeyRingCoinAccount ==. val ai &&. limitOutPoints c os _ -> limitOutPoints c os return (c, t, x) return $ map (\(c, t, x) -> InCoinData c (entityVal t) (entityVal x)) res where ops = map prevOutput $ txIn tx limitOutPoints c os = join2 $ map (f c) os f c (OutPoint h i) = c ^. KeyRingCoinHash ==. val h &&. c ^. KeyRingCoinPos ==. val i -- Find all the transactions that are spending the same coins as the given -- transaction. You can optionally provide an account to limit the returned -- transactions to that account only.
989
getInCoins :: MonadIO m => Tx -> Maybe KeyRingAccountId -> SqlPersistT m [InCoinData] getInCoins tx aiM = do res <- splitSelect ops $ \os -> from $ \(c `InnerJoin` t `InnerJoin` x) -> do on $ x ^. KeyRingAddrId ==. c ^. KeyRingCoinAddr on $ t ^. KeyRingTxId ==. c ^. KeyRingCoinTx where_ $ case aiM of Just ai -> c ^. KeyRingCoinAccount ==. val ai &&. limitOutPoints c os _ -> limitOutPoints c os return (c, t, x) return $ map (\(c, t, x) -> InCoinData c (entityVal t) (entityVal x)) res where ops = map prevOutput $ txIn tx limitOutPoints c os = join2 $ map (f c) os f c (OutPoint h i) = c ^. KeyRingCoinHash ==. val h &&. c ^. KeyRingCoinPos ==. val i -- Find all the transactions that are spending the same coins as the given -- transaction. You can optionally provide an account to limit the returned -- transactions to that account only.
989
getInCoins tx aiM = do res <- splitSelect ops $ \os -> from $ \(c `InnerJoin` t `InnerJoin` x) -> do on $ x ^. KeyRingAddrId ==. c ^. KeyRingCoinAddr on $ t ^. KeyRingTxId ==. c ^. KeyRingCoinTx where_ $ case aiM of Just ai -> c ^. KeyRingCoinAccount ==. val ai &&. limitOutPoints c os _ -> limitOutPoints c os return (c, t, x) return $ map (\(c, t, x) -> InCoinData c (entityVal t) (entityVal x)) res where ops = map prevOutput $ txIn tx limitOutPoints c os = join2 $ map (f c) os f c (OutPoint h i) = c ^. KeyRingCoinHash ==. val h &&. c ^. KeyRingCoinPos ==. val i -- Find all the transactions that are spending the same coins as the given -- transaction. You can optionally provide an account to limit the returned -- transactions to that account only.
870
false
true
9
20
308
335
164
171
null
null
mfine/ghc
compiler/main/DriverPhases.hs
bsd-3-clause
startPhase "C" = Cc
26
startPhase "C" = Cc
26
startPhase "C" = Cc
26
false
false
0
5
10
9
4
5
null
null
adarqui/ghcjs-jquery
JavaScript/JQuery.hs
mit
insertBeforeElem :: IsElement e => e -> JQuery -> IO JQuery insertBeforeElem e jq = jq_insertBefore (castRef . unElement $ toElement e) jq
138
insertBeforeElem :: IsElement e => e -> JQuery -> IO JQuery insertBeforeElem e jq = jq_insertBefore (castRef . unElement $ toElement e) jq
138
insertBeforeElem e jq = jq_insertBefore (castRef . unElement $ toElement e) jq
78
false
true
0
8
22
53
25
28
null
null
fcharlie/hgit
src/Git/Pack/Packfile.hs
bsd-3-clause
-- ============================================================================== -- parsePackFile :: It.Iteratee ByteString IO Packfile parsePackFile = do magic <- endianRead4 MSB -- 4 bytes, big-endian version' <- endianRead4 MSB numObjects' <- endianRead4 MSB if packMagic == magic then parseObjects version' numObjects' else return InvalidPackfile where packMagic = fromOctets $ map (fromIntegral . ord) "PACK"
474
parsePackFile :: It.Iteratee ByteString IO Packfile parsePackFile = do magic <- endianRead4 MSB -- 4 bytes, big-endian version' <- endianRead4 MSB numObjects' <- endianRead4 MSB if packMagic == magic then parseObjects version' numObjects' else return InvalidPackfile where packMagic = fromOctets $ map (fromIntegral . ord) "PACK"
388
parsePackFile = do magic <- endianRead4 MSB -- 4 bytes, big-endian version' <- endianRead4 MSB numObjects' <- endianRead4 MSB if packMagic == magic then parseObjects version' numObjects' else return InvalidPackfile where packMagic = fromOctets $ map (fromIntegral . ord) "PACK"
336
true
true
2
8
108
105
47
58
null
null
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Resource/Healthcare/Projects/Locations/DataSets/ConsentStores/AttributeDefinitions/Get.hs
mpl-2.0
-- | Required. The resource name of the Attribute definition to get. pldscsadgName :: Lens' ProjectsLocationsDataSetsConsentStoresAttributeDefinitionsGet Text pldscsadgName = lens _pldscsadgName (\ s a -> s{_pldscsadgName = a})
235
pldscsadgName :: Lens' ProjectsLocationsDataSetsConsentStoresAttributeDefinitionsGet Text pldscsadgName = lens _pldscsadgName (\ s a -> s{_pldscsadgName = a})
166
pldscsadgName = lens _pldscsadgName (\ s a -> s{_pldscsadgName = a})
76
true
true
1
9
35
46
22
24
null
null
kazu-yamamoto/wai
warp/Network/Wai/Handler/Warp/Request.hs
mit
recvRequest :: Bool -- ^ first request on this connection? -> Settings -> Connection -> InternalInfo -> Timeout.Handle -> SockAddr -- ^ Peer's address. -> Source -- ^ Where HTTP request comes from. -> Transport -> IO (Request ,Maybe (I.IORef Int) ,IndexedHeader ,IO ByteString) -- ^ -- 'Request' passed to 'Application', -- how many bytes remain to be consumed, if known -- 'IndexedHeader' of HTTP request for internal use, -- Body producing action used for flushing the request body recvRequest firstRequest settings conn ii th addr src transport = do hdrlines <- headerLines (settingsMaxTotalHeaderLength settings) firstRequest src (method, unparsedPath, path, query, httpversion, hdr) <- parseHeaderLines hdrlines let idxhdr = indexRequestHeader hdr expect = idxhdr ! fromEnum ReqExpect cl = idxhdr ! fromEnum ReqContentLength te = idxhdr ! fromEnum ReqTransferEncoding handle100Continue = handleExpect conn httpversion expect rawPath = if settingsNoParsePath settings then unparsedPath else path vaultValue = Vault.insert pauseTimeoutKey (Timeout.pause th) $ Vault.insert getFileInfoKey (getFileInfo ii) $ Vault.insert getClientCertificateKey (getTransportClientCertificate transport) Vault.empty (rbody, remainingRef, bodyLength) <- bodyAndSource src cl te -- body producing function which will produce '100-continue', if needed rbody' <- timeoutBody remainingRef th rbody handle100Continue -- body producing function which will never produce 100-continue rbodyFlush <- timeoutBody remainingRef th rbody (return ()) let req = Request { requestMethod = method , httpVersion = httpversion , pathInfo = H.decodePathSegments path , rawPathInfo = rawPath , rawQueryString = query , queryString = H.parseQuery query , requestHeaders = hdr , isSecure = isTransportSecure transport , remoteHost = addr , requestBody = rbody' , vault = vaultValue , requestBodyLength = bodyLength , requestHeaderHost = idxhdr ! fromEnum ReqHost , requestHeaderRange = idxhdr ! fromEnum ReqRange , requestHeaderReferer = idxhdr ! fromEnum ReqReferer , requestHeaderUserAgent = idxhdr ! fromEnum ReqUserAgent } return (req, remainingRef, idxhdr, rbodyFlush) ----------------------------------------------------------------
2,800
recvRequest :: Bool -- ^ first request on this connection? -> Settings -> Connection -> InternalInfo -> Timeout.Handle -> SockAddr -- ^ Peer's address. -> Source -- ^ Where HTTP request comes from. -> Transport -> IO (Request ,Maybe (I.IORef Int) ,IndexedHeader ,IO ByteString) recvRequest firstRequest settings conn ii th addr src transport = do hdrlines <- headerLines (settingsMaxTotalHeaderLength settings) firstRequest src (method, unparsedPath, path, query, httpversion, hdr) <- parseHeaderLines hdrlines let idxhdr = indexRequestHeader hdr expect = idxhdr ! fromEnum ReqExpect cl = idxhdr ! fromEnum ReqContentLength te = idxhdr ! fromEnum ReqTransferEncoding handle100Continue = handleExpect conn httpversion expect rawPath = if settingsNoParsePath settings then unparsedPath else path vaultValue = Vault.insert pauseTimeoutKey (Timeout.pause th) $ Vault.insert getFileInfoKey (getFileInfo ii) $ Vault.insert getClientCertificateKey (getTransportClientCertificate transport) Vault.empty (rbody, remainingRef, bodyLength) <- bodyAndSource src cl te -- body producing function which will produce '100-continue', if needed rbody' <- timeoutBody remainingRef th rbody handle100Continue -- body producing function which will never produce 100-continue rbodyFlush <- timeoutBody remainingRef th rbody (return ()) let req = Request { requestMethod = method , httpVersion = httpversion , pathInfo = H.decodePathSegments path , rawPathInfo = rawPath , rawQueryString = query , queryString = H.parseQuery query , requestHeaders = hdr , isSecure = isTransportSecure transport , remoteHost = addr , requestBody = rbody' , vault = vaultValue , requestBodyLength = bodyLength , requestHeaderHost = idxhdr ! fromEnum ReqHost , requestHeaderRange = idxhdr ! fromEnum ReqRange , requestHeaderReferer = idxhdr ! fromEnum ReqReferer , requestHeaderUserAgent = idxhdr ! fromEnum ReqUserAgent } return (req, remainingRef, idxhdr, rbodyFlush) ----------------------------------------------------------------
2,545
recvRequest firstRequest settings conn ii th addr src transport = do hdrlines <- headerLines (settingsMaxTotalHeaderLength settings) firstRequest src (method, unparsedPath, path, query, httpversion, hdr) <- parseHeaderLines hdrlines let idxhdr = indexRequestHeader hdr expect = idxhdr ! fromEnum ReqExpect cl = idxhdr ! fromEnum ReqContentLength te = idxhdr ! fromEnum ReqTransferEncoding handle100Continue = handleExpect conn httpversion expect rawPath = if settingsNoParsePath settings then unparsedPath else path vaultValue = Vault.insert pauseTimeoutKey (Timeout.pause th) $ Vault.insert getFileInfoKey (getFileInfo ii) $ Vault.insert getClientCertificateKey (getTransportClientCertificate transport) Vault.empty (rbody, remainingRef, bodyLength) <- bodyAndSource src cl te -- body producing function which will produce '100-continue', if needed rbody' <- timeoutBody remainingRef th rbody handle100Continue -- body producing function which will never produce 100-continue rbodyFlush <- timeoutBody remainingRef th rbody (return ()) let req = Request { requestMethod = method , httpVersion = httpversion , pathInfo = H.decodePathSegments path , rawPathInfo = rawPath , rawQueryString = query , queryString = H.parseQuery query , requestHeaders = hdr , isSecure = isTransportSecure transport , remoteHost = addr , requestBody = rbody' , vault = vaultValue , requestBodyLength = bodyLength , requestHeaderHost = idxhdr ! fromEnum ReqHost , requestHeaderRange = idxhdr ! fromEnum ReqRange , requestHeaderReferer = idxhdr ! fromEnum ReqReferer , requestHeaderUserAgent = idxhdr ! fromEnum ReqUserAgent } return (req, remainingRef, idxhdr, rbodyFlush) ----------------------------------------------------------------
2,117
true
true
0
18
893
513
274
239
null
null
Mr-Click/PFQ
user/Haskell/Network/PFq/Default.hs
gpl-2.0
-- | Unit operation implements left- and right-identity for Action monad. unit = MFunction "unit" () () () () () () () () :: NetFunction
136
unit = MFunction "unit" () () () () () () () () :: NetFunction
62
unit = MFunction "unit" () () () () () () () () :: NetFunction
62
true
false
0
6
24
48
24
24
null
null
Helkafen/haddock
haddock-api/src/Haddock/Backends/Hoogle.hs
bsd-2-clause
unwordsWrap :: Int -> [String] -> [String] unwordsWrap n = f n [] where f _ s [] = [g s | s /= []] f i s (x:xs) | nx > i = g s : f (n - nx - 1) [x] xs | otherwise = f (i - nx - 1) (x:s) xs where nx = length x g = unwords . reverse
292
unwordsWrap :: Int -> [String] -> [String] unwordsWrap n = f n [] where f _ s [] = [g s | s /= []] f i s (x:xs) | nx > i = g s : f (n - nx - 1) [x] xs | otherwise = f (i - nx - 1) (x:s) xs where nx = length x g = unwords . reverse
292
unwordsWrap n = f n [] where f _ s [] = [g s | s /= []] f i s (x:xs) | nx > i = g s : f (n - nx - 1) [x] xs | otherwise = f (i - nx - 1) (x:s) xs where nx = length x g = unwords . reverse
249
false
true
4
12
127
171
86
85
null
null
LinuxMercedes/CRC
crc.hs
mit
neg I = O
9
neg I = O
9
neg I = O
9
false
false
1
5
3
13
4
9
null
null
MerelyAPseudonym/cmdtheline
src/System/Console/CmdTheLine/Arg.hs
mit
posList :: ArgVal a => PosKind -> [a] -> PosInfo -> Arg [a] posList kind vs oi = Arg $ Term [ai'] yield where ai = fromPosInfo oi ai' = ai { posKind = kind } yield _ cl = case posArg cl ai' of [] -> return vs xs -> mapM (parsePosValue ai') xs -- | 'posAny' @vs ai@ yields a list of all positional arguments or @vs@ if none -- are present.
368
posList :: ArgVal a => PosKind -> [a] -> PosInfo -> Arg [a] posList kind vs oi = Arg $ Term [ai'] yield where ai = fromPosInfo oi ai' = ai { posKind = kind } yield _ cl = case posArg cl ai' of [] -> return vs xs -> mapM (parsePosValue ai') xs -- | 'posAny' @vs ai@ yields a list of all positional arguments or @vs@ if none -- are present.
368
posList kind vs oi = Arg $ Term [ai'] yield where ai = fromPosInfo oi ai' = ai { posKind = kind } yield _ cl = case posArg cl ai' of [] -> return vs xs -> mapM (parsePosValue ai') xs -- | 'posAny' @vs ai@ yields a list of all positional arguments or @vs@ if none -- are present.
308
false
true
4
11
103
141
68
73
null
null
MgaMPKAy/language-sh
Language/Sh/Parser.hs
bsd-3-clause
injectAlias :: String -> String -> [(String,String)] -> Bool -> P () injectAlias a s as ip = do i <- getInput let (h,t) = splitAt 1 i aOn = if isBlank $ last s then (Ctl (AliasOn True):) else id -- don't turn /off/ setInput $ map Chr s ++ Ctl (IncPos ip):h ++ Ctl (Aliases as): -- These next two may be gratuitous aOn t setAliasInfo (True,as\\[(a,s)],False) unless True $ do l <- getInput setInput l -- $ trace ("input: "++show l) l spaces
900
injectAlias :: String -> String -> [(String,String)] -> Bool -> P () injectAlias a s as ip = do i <- getInput let (h,t) = splitAt 1 i aOn = if isBlank $ last s then (Ctl (AliasOn True):) else id -- don't turn /off/ setInput $ map Chr s ++ Ctl (IncPos ip):h ++ Ctl (Aliases as): -- These next two may be gratuitous aOn t setAliasInfo (True,as\\[(a,s)],False) unless True $ do l <- getInput setInput l -- $ trace ("input: "++show l) l spaces
900
injectAlias a s as ip = do i <- getInput let (h,t) = splitAt 1 i aOn = if isBlank $ last s then (Ctl (AliasOn True):) else id -- don't turn /off/ setInput $ map Chr s ++ Ctl (IncPos ip):h ++ Ctl (Aliases as): -- These next two may be gratuitous aOn t setAliasInfo (True,as\\[(a,s)],False) unless True $ do l <- getInput setInput l -- $ trace ("input: "++show l) l spaces
831
false
true
0
14
546
224
109
115
null
null
uduki/hsQt
Qtc/Enums/Gui/QKeySequence.hs
bsd-2-clause
eAddTab :: StandardKey eAddTab = ieStandardKey $ 19
53
eAddTab :: StandardKey eAddTab = ieStandardKey $ 19
53
eAddTab = ieStandardKey $ 19
30
false
true
0
6
9
18
8
10
null
null
brendanhay/gogol
gogol-appengine/gen/Network/Google/AppEngine/Types/Product.hs
mpl-2.0
-- | The normal response of the operation in case of success. If the original -- method returns no data on success, such as Delete, the response is -- google.protobuf.Empty. If the original method is standard -- Get\/Create\/Update, the response should be the resource. For other -- methods, the response should have the type XxxResponse, where Xxx is the -- original method name. For example, if the original method name is -- TakeSnapshot(), the inferred response type is TakeSnapshotResponse. oResponse :: Lens' Operation (Maybe OperationResponse) oResponse = lens _oResponse (\ s a -> s{_oResponse = a})
609
oResponse :: Lens' Operation (Maybe OperationResponse) oResponse = lens _oResponse (\ s a -> s{_oResponse = a})
113
oResponse = lens _oResponse (\ s a -> s{_oResponse = a})
58
true
true
1
9
97
58
31
27
null
null
glguy/irc-core
src/Client/Commands/Interpolation.hs
isc
parseChunk :: Parser ExpansionChunk parseChunk = choice [ LiteralChunk <$> P.takeWhile1 (/= '$') , LiteralChunk "$" <$ P.string "$$" , string "${" *> parseDefaulted <* char '}' , char '$' *> parseVariable ]
233
parseChunk :: Parser ExpansionChunk parseChunk = choice [ LiteralChunk <$> P.takeWhile1 (/= '$') , LiteralChunk "$" <$ P.string "$$" , string "${" *> parseDefaulted <* char '}' , char '$' *> parseVariable ]
233
parseChunk = choice [ LiteralChunk <$> P.takeWhile1 (/= '$') , LiteralChunk "$" <$ P.string "$$" , string "${" *> parseDefaulted <* char '}' , char '$' *> parseVariable ]
197
false
true
0
8
59
75
37
38
null
null
Mathnerd314/lamdu
src/Lamdu/Main.hs
gpl-3.0
whenApply :: Bool -> (a -> a) -> a -> a whenApply False _ = id
62
whenApply :: Bool -> (a -> a) -> a -> a whenApply False _ = id
62
whenApply False _ = id
22
false
true
0
8
15
35
18
17
null
null
unisonweb/platform
parser-typechecker/src/Unison/PrettyPrintEnv.hs
mit
fromSuffixNames :: Int -> Names -> PrettyPrintEnv fromSuffixNames len names = PrettyPrintEnv terms' types' where terms' r = safeHead $ Names.suffixedTermName len r names types' r = safeHead $ Names.suffixedTypeName len r names
230
fromSuffixNames :: Int -> Names -> PrettyPrintEnv fromSuffixNames len names = PrettyPrintEnv terms' types' where terms' r = safeHead $ Names.suffixedTermName len r names types' r = safeHead $ Names.suffixedTypeName len r names
230
fromSuffixNames len names = PrettyPrintEnv terms' types' where terms' r = safeHead $ Names.suffixedTermName len r names types' r = safeHead $ Names.suffixedTypeName len r names
180
false
true
0
9
36
78
36
42
null
null
olsner/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
isListCompExpr MonadComp = True
39
isListCompExpr MonadComp = True
39
isListCompExpr MonadComp = True
39
false
false
0
5
11
9
4
5
null
null
fmthoma/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
isDerived :: CtEvidence -> Bool isDerived (CtDerived {}) = True
63
isDerived :: CtEvidence -> Bool isDerived (CtDerived {}) = True
63
isDerived (CtDerived {}) = True
31
false
true
1
8
9
30
14
16
null
null
aristidb/filefind
Filefind.hs
bsd-3-clause
intersection :: Test -> Test -> Test intersection a b Positive = \fi -> let TestResult{trAction=a1,trDescend=d1} = a Positive fi TestResult{trAction=a2,trDescend=d2} = b Positive fi in TestResult{trAction=a1&&a2, trDescend=liftM2 intersection d1 d2}
323
intersection :: Test -> Test -> Test intersection a b Positive = \fi -> let TestResult{trAction=a1,trDescend=d1} = a Positive fi TestResult{trAction=a2,trDescend=d2} = b Positive fi in TestResult{trAction=a1&&a2, trDescend=liftM2 intersection d1 d2}
323
intersection a b Positive = \fi -> let TestResult{trAction=a1,trDescend=d1} = a Positive fi TestResult{trAction=a2,trDescend=d2} = b Positive fi in TestResult{trAction=a1&&a2, trDescend=liftM2 intersection d1 d2}
286
false
true
0
12
104
120
61
59
null
null
DougBurke/swish
tests/RDFProofTest.hs
lgpl-2.1
-- misc helpers testIn :: (Eq a, Show a) => String -> a -> [a] -> Test testIn = testElem
90
testIn :: (Eq a, Show a) => String -> a -> [a] -> Test testIn = testElem
72
testIn = testElem
17
true
true
0
9
21
42
23
19
null
null
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/RegionDisks/SetLabels.hs
mpl-2.0
-- | The region for this request. rdslRegion :: Lens' RegionDisksSetLabels Text rdslRegion = lens _rdslRegion (\ s a -> s{_rdslRegion = a})
141
rdslRegion :: Lens' RegionDisksSetLabels Text rdslRegion = lens _rdslRegion (\ s a -> s{_rdslRegion = a})
107
rdslRegion = lens _rdslRegion (\ s a -> s{_rdslRegion = a})
61
true
true
0
9
24
42
22
20
null
null
facebookincubator/duckling
Duckling/Time/PT/Rules.hs
bsd-3-clause
ruleHourofdayAndRelativeMinutes :: Rule ruleHourofdayAndRelativeMinutes = Rule { name = "<hour-of-day> and <relative minutes>" , pattern = [ Predicate isAnHourOfDay , regex "e" , Predicate $ isIntegerBetween 1 59 ] , prod = \tokens -> case tokens of (Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}: _: token: _) -> do n <- getIntValue token tt $ hourMinute is12H hours n _ -> Nothing }
488
ruleHourofdayAndRelativeMinutes :: Rule ruleHourofdayAndRelativeMinutes = Rule { name = "<hour-of-day> and <relative minutes>" , pattern = [ Predicate isAnHourOfDay , regex "e" , Predicate $ isIntegerBetween 1 59 ] , prod = \tokens -> case tokens of (Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}: _: token: _) -> do n <- getIntValue token tt $ hourMinute is12H hours n _ -> Nothing }
488
ruleHourofdayAndRelativeMinutes = Rule { name = "<hour-of-day> and <relative minutes>" , pattern = [ Predicate isAnHourOfDay , regex "e" , Predicate $ isIntegerBetween 1 59 ] , prod = \tokens -> case tokens of (Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}: _: token: _) -> do n <- getIntValue token tt $ hourMinute is12H hours n _ -> Nothing }
448
false
true
0
22
138
154
78
76
null
null
vincenthz/cryptonite
tests/KAT_Twofish.hs
bsd-3-clause
tests = testGroup "Twofish" [ testBlockCipher kats128 (undefined :: Twofish128) , testBlockCipher kats192 (undefined :: Twofish192) , testBlockCipher kats256 (undefined :: Twofish256) ]
221
tests = testGroup "Twofish" [ testBlockCipher kats128 (undefined :: Twofish128) , testBlockCipher kats192 (undefined :: Twofish192) , testBlockCipher kats256 (undefined :: Twofish256) ]
221
tests = testGroup "Twofish" [ testBlockCipher kats128 (undefined :: Twofish128) , testBlockCipher kats192 (undefined :: Twofish192) , testBlockCipher kats256 (undefined :: Twofish256) ]
221
false
false
0
8
58
53
29
24
null
null
ssaavedra/liquidhaskell
benchmarks/containers-0.5.0.0/Data/Map/Base.hs
bsd-3-clause
submap' _ _ Tip = False
23
submap' _ _ Tip = False
23
submap' _ _ Tip = False
23
false
false
1
5
5
13
5
8
null
null
kishoredbn/barrelfish
hake/K1om.hs
mit
archive = ArchDefaults.archive arch
35
archive = ArchDefaults.archive arch
35
archive = ArchDefaults.archive arch
35
false
false
0
6
3
11
5
6
null
null
vladfi1/hs-misc
VisTest.hs
mit
cam = makeCamera (Camera0 0 0 0)
32
cam = makeCamera (Camera0 0 0 0)
32
cam = makeCamera (Camera0 0 0 0)
32
false
false
1
7
6
22
9
13
null
null
beni55/egison
hs-src/Language/Egison.hs
mit
initialEnvNoIO :: IO Env initialEnvNoIO = do env <- primitiveEnvNoIO ret <- evalEgisonTopExprs env $ map Load coreLibraries case ret of Left err -> do print . show $ err return env Right env' -> return env'
233
initialEnvNoIO :: IO Env initialEnvNoIO = do env <- primitiveEnvNoIO ret <- evalEgisonTopExprs env $ map Load coreLibraries case ret of Left err -> do print . show $ err return env Right env' -> return env'
233
initialEnvNoIO = do env <- primitiveEnvNoIO ret <- evalEgisonTopExprs env $ map Load coreLibraries case ret of Left err -> do print . show $ err return env Right env' -> return env'
208
false
true
0
13
63
85
37
48
null
null
JacquesCarette/literate-scientific-software
code/drasil-docLang/Drasil/Sections/SpecificSystemDescription.hs
bsd-2-clause
physSystDesc :: Idea a => a -> [Sentence] -> LabelledContent -> [Contents] -> Section physSystDesc progName parts fg other = SRS.physSyst (intro : bullets : LlC fg : other) [] where intro = mkParagraph $ foldlSentCol [S "The", phrase physicalSystem `sOf` short progName `sC` S "as shown in", makeRef2S fg `sC` S "includes the following", plural element] bullets = enumSimpleU 1 (short physSyst) parts --List all the given inputs. Might be possible to use ofThe combinator from utils.hs
512
physSystDesc :: Idea a => a -> [Sentence] -> LabelledContent -> [Contents] -> Section physSystDesc progName parts fg other = SRS.physSyst (intro : bullets : LlC fg : other) [] where intro = mkParagraph $ foldlSentCol [S "The", phrase physicalSystem `sOf` short progName `sC` S "as shown in", makeRef2S fg `sC` S "includes the following", plural element] bullets = enumSimpleU 1 (short physSyst) parts --List all the given inputs. Might be possible to use ofThe combinator from utils.hs
512
physSystDesc progName parts fg other = SRS.physSyst (intro : bullets : LlC fg : other) [] where intro = mkParagraph $ foldlSentCol [S "The", phrase physicalSystem `sOf` short progName `sC` S "as shown in", makeRef2S fg `sC` S "includes the following", plural element] bullets = enumSimpleU 1 (short physSyst) parts --List all the given inputs. Might be possible to use ofThe combinator from utils.hs
426
false
true
1
10
104
161
82
79
null
null
kim/amazonka
amazonka-directconnect/gen/Network/AWS/DirectConnect/Types.hs
mpl-2.0
viVirtualInterfaceType :: Lens' VirtualInterface (Maybe Text) viVirtualInterfaceType = lens _viVirtualInterfaceType (\s a -> s { _viVirtualInterfaceType = a })
163
viVirtualInterfaceType :: Lens' VirtualInterface (Maybe Text) viVirtualInterfaceType = lens _viVirtualInterfaceType (\s a -> s { _viVirtualInterfaceType = a })
163
viVirtualInterfaceType = lens _viVirtualInterfaceType (\s a -> s { _viVirtualInterfaceType = a })
101
false
true
1
9
22
49
24
25
null
null
shlevy/ghc
compiler/prelude/THNames.hs
bsd-3-clause
letEIdKey = mkPreludeMiscIdUnique 286
45
letEIdKey = mkPreludeMiscIdUnique 286
45
letEIdKey = mkPreludeMiscIdUnique 286
45
false
false
0
5
11
9
4
5
null
null
lynnard/reflex-cocos2d
src/Reflex/Cocos2d/Misc/Chipmunk.hs
mit
fanCollisionsByBody :: Reflex t => Event t (ShapeAttributes a, ShapeAttributes a) -> EventSelector t (Const2 (Body a) (ShapeAttributes a)) fanCollisionsByBody = fanMap . fmap trans where trans (sa, sb) = M.fromList [ (s1^.shapeBody, s2) | (s1, s2) <- [(sa, sb), (sb, sa)] ]
305
fanCollisionsByBody :: Reflex t => Event t (ShapeAttributes a, ShapeAttributes a) -> EventSelector t (Const2 (Body a) (ShapeAttributes a)) fanCollisionsByBody = fanMap . fmap trans where trans (sa, sb) = M.fromList [ (s1^.shapeBody, s2) | (s1, s2) <- [(sa, sb), (sb, sa)] ]
305
fanCollisionsByBody = fanMap . fmap trans where trans (sa, sb) = M.fromList [ (s1^.shapeBody, s2) | (s1, s2) <- [(sa, sb), (sb, sa)] ]
166
false
true
0
11
74
137
73
64
null
null
scslab/iterIO
Data/IterIO/HttpRoute.hs
bsd-3-clause
mimeTypesI :: (Monad m) => String -> Iter S8.ByteString m (String -> S8.ByteString) mimeTypesI deftype = do mmap <- Map.fromList <$> concatI ((mimeLine <|> nil) <* eol) return $ \suffix -> maybe (S8.pack deftype) id $ Map.lookup suffix mmap where mimeLine = do typ <- word many $ do space; ext <- word; return (S8.unpack ext, typ) word = while1I $ \c -> c > eord ' ' && c <= eord '~' space = skipWhile1I $ \c -> c == eord ' ' || c == eord '\t' comment = char '#' >> skipWhileI (/= eord '\n') eol = do optionalI space optionalI comment optionalI (char '\r'); char '\n' -- | An abstract representation of file system calls returning an -- opaque handle type @h@ in an 'Iter' parameterized by an arbitrary -- 'Monad' @m@. This representation allows one to use -- 'routeGenFileSys' in a monad that is not an instance of 'MonadIO'.
931
mimeTypesI :: (Monad m) => String -> Iter S8.ByteString m (String -> S8.ByteString) mimeTypesI deftype = do mmap <- Map.fromList <$> concatI ((mimeLine <|> nil) <* eol) return $ \suffix -> maybe (S8.pack deftype) id $ Map.lookup suffix mmap where mimeLine = do typ <- word many $ do space; ext <- word; return (S8.unpack ext, typ) word = while1I $ \c -> c > eord ' ' && c <= eord '~' space = skipWhile1I $ \c -> c == eord ' ' || c == eord '\t' comment = char '#' >> skipWhileI (/= eord '\n') eol = do optionalI space optionalI comment optionalI (char '\r'); char '\n' -- | An abstract representation of file system calls returning an -- opaque handle type @h@ in an 'Iter' parameterized by an arbitrary -- 'Monad' @m@. This representation allows one to use -- 'routeGenFileSys' in a monad that is not an instance of 'MonadIO'.
931
mimeTypesI deftype = do mmap <- Map.fromList <$> concatI ((mimeLine <|> nil) <* eol) return $ \suffix -> maybe (S8.pack deftype) id $ Map.lookup suffix mmap where mimeLine = do typ <- word many $ do space; ext <- word; return (S8.unpack ext, typ) word = while1I $ \c -> c > eord ' ' && c <= eord '~' space = skipWhile1I $ \c -> c == eord ' ' || c == eord '\t' comment = char '#' >> skipWhileI (/= eord '\n') eol = do optionalI space optionalI comment optionalI (char '\r'); char '\n' -- | An abstract representation of file system calls returning an -- opaque handle type @h@ in an 'Iter' parameterized by an arbitrary -- 'Monad' @m@. This representation allows one to use -- 'routeGenFileSys' in a monad that is not an instance of 'MonadIO'.
822
false
true
13
13
258
315
144
171
null
null
fmapfmapfmap/amazonka
amazonka-devicefarm/gen/Network/AWS/DeviceFarm/ListProjects.hs
mpl-2.0
-- | If the number of items that are returned is significantly large, this is -- an identifier that is also returned, which can be used in a subsequent -- call to this operation to return the next set of items in the list. lprsNextToken :: Lens' ListProjectsResponse (Maybe Text) lprsNextToken = lens _lprsNextToken (\ s a -> s{_lprsNextToken = a})
348
lprsNextToken :: Lens' ListProjectsResponse (Maybe Text) lprsNextToken = lens _lprsNextToken (\ s a -> s{_lprsNextToken = a})
125
lprsNextToken = lens _lprsNextToken (\ s a -> s{_lprsNextToken = a})
68
true
true
0
9
60
48
27
21
null
null
carlostome/wlp-engine
src/Expr.hs
bsd-3-clause
interpret :: Expr t -> SBV.Symbolic (Interpret t) interpret = interpret' M.empty M.empty M.empty M.empty
104
interpret :: Expr t -> SBV.Symbolic (Interpret t) interpret = interpret' M.empty M.empty M.empty M.empty
104
interpret = interpret' M.empty M.empty M.empty M.empty
54
false
true
0
9
14
52
23
29
null
null
arthur-yip/2048h
src/ConsoleUI.hs
mit
drawBoard :: [Int] -> IO () drawBoard game = do erase let seq = [ drawCell x y (game !! (y * 4 + x)) | x <- [0..3], y <- [0..3] ] sequence_ seq refresh
159
drawBoard :: [Int] -> IO () drawBoard game = do erase let seq = [ drawCell x y (game !! (y * 4 + x)) | x <- [0..3], y <- [0..3] ] sequence_ seq refresh
159
drawBoard game = do erase let seq = [ drawCell x y (game !! (y * 4 + x)) | x <- [0..3], y <- [0..3] ] sequence_ seq refresh
131
false
true
0
16
43
106
51
55
null
null
Javran/Project-Euler
src/ProjectEuler/Problem45.hs
mit
-- it actually takes longer using inductive way -- maybe the normal way allows some parallelization. -- T(n) = n(n+1)/2 -- T(n) = T(n-1) + n -- T(1) = 1 tSeq :: [Int] tSeq = 1 : zipWith (+) tSeq [2..]
203
tSeq :: [Int] tSeq = 1 : zipWith (+) tSeq [2..]
47
tSeq = 1 : zipWith (+) tSeq [2..]
33
true
true
0
7
43
35
22
13
null
null
mariefarrell/Hets
CASL/QuickCheck.hs
gpl-2.0
match2 t1 (Sorted_term t2 _ _) = match2 t1 t2
45
match2 t1 (Sorted_term t2 _ _) = match2 t1 t2
45
match2 t1 (Sorted_term t2 _ _) = match2 t1 t2
45
false
false
0
7
9
26
12
14
null
null
vikraman/ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
pprMaybeExp :: Precedence -> Maybe Exp -> Doc pprMaybeExp _ Nothing = empty
75
pprMaybeExp :: Precedence -> Maybe Exp -> Doc pprMaybeExp _ Nothing = empty
75
pprMaybeExp _ Nothing = empty
29
false
true
0
7
12
27
13
14
null
null
bitemyapp/checkers
src/Test/QuickCheck/Checkers.hs
bsd-3-clause
eqModels :: (Model a b, EqProp b) => a -> a -> Property eqModels = (=-=) `on` model
83
eqModels :: (Model a b, EqProp b) => a -> a -> Property eqModels = (=-=) `on` model
83
eqModels = (=-=) `on` model
27
false
true
0
7
17
44
25
19
null
null
rabipelais/cloudpoint
src/Sampling.hs
mit
-- | Get an infinite list of unique random elements in bound @bnds@ randomUniques :: (Random a, Eq a) => (a, a) -> StdGen -> [a] randomUniques bnds = nub . randomRs bnds
169
randomUniques :: (Random a, Eq a) => (a, a) -> StdGen -> [a] randomUniques bnds = nub . randomRs bnds
101
randomUniques bnds = nub . randomRs bnds
40
true
true
0
8
32
54
29
25
null
null
keent/stack
src/Stack/Types/Build.hs
bsd-3-clause
defaultTestOpts :: TestOpts defaultTestOpts = TestOpts { toRerunTests = True , toAdditionalArgs = [] , toCoverage = False , toDisableRun = False }
166
defaultTestOpts :: TestOpts defaultTestOpts = TestOpts { toRerunTests = True , toAdditionalArgs = [] , toCoverage = False , toDisableRun = False }
166
defaultTestOpts = TestOpts { toRerunTests = True , toAdditionalArgs = [] , toCoverage = False , toDisableRun = False }
138
false
true
0
8
42
43
25
18
null
null
talanis85/rechord
haScales/src/Data/Music/Scales.hs
gpl-3.0
sharp = Accidental 1
20
sharp = Accidental 1
20
sharp = Accidental 1
20
false
false
1
5
3
13
4
9
null
null
markwright/antlrc-examples
src/tapl/fulluntyped/Semantic.hs
bsd-3-clause
tmInfo (TmTimesFloat fi _ _) = fi
33
tmInfo (TmTimesFloat fi _ _) = fi
33
tmInfo (TmTimesFloat fi _ _) = fi
33
false
false
0
7
6
19
9
10
null
null
atsukotakahashi/wi
src/library/Yi/Buffer/HighLevel.hs
gpl-2.0
-- | switch the case of the letter under the cursor switchCaseCharB :: BufferM () switchCaseCharB = transformB (R.withText $ T.map switchCaseChar) Character Forward
166
switchCaseCharB :: BufferM () switchCaseCharB = transformB (R.withText $ T.map switchCaseChar) Character Forward
114
switchCaseCharB = transformB (R.withText $ T.map switchCaseChar) Character Forward
84
true
true
0
9
25
38
19
19
null
null
gbwey/persistentold
persistent-template/Database/Persist/TH.hs
mit
ftToType (FTTypeCon (Just m) t) = ConT $ mkName $ unpack $ concat [m, ".", t]
77
ftToType (FTTypeCon (Just m) t) = ConT $ mkName $ unpack $ concat [m, ".", t]
77
ftToType (FTTypeCon (Just m) t) = ConT $ mkName $ unpack $ concat [m, ".", t]
77
false
false
0
9
15
47
24
23
null
null
tomlokhorst/FunVM
src/FunVM/Core/Syntax.hs
bsd-3-clause
fv (Let ps e1 e2) = (fv e2 \\ map bindId ps) `union` fv e1
64
fv (Let ps e1 e2) = (fv e2 \\ map bindId ps) `union` fv e1
64
fv (Let ps e1 e2) = (fv e2 \\ map bindId ps) `union` fv e1
64
false
false
0
8
20
43
21
22
null
null
nh2/flippi
src/DeWikify.hs
bsd-3-clause
wikiParser sn = do l <- many (prependedUnderscore <|> try (wikiLink sn) <|> try (scriptLink sn) <|> try newParagraph <|> aCharacter ) case l of (_:_) -> return (foldl1 (+++) l) [] -> return (stringToHtml "")
416
wikiParser sn = do l <- many (prependedUnderscore <|> try (wikiLink sn) <|> try (scriptLink sn) <|> try newParagraph <|> aCharacter ) case l of (_:_) -> return (foldl1 (+++) l) [] -> return (stringToHtml "")
416
wikiParser sn = do l <- many (prependedUnderscore <|> try (wikiLink sn) <|> try (scriptLink sn) <|> try newParagraph <|> aCharacter ) case l of (_:_) -> return (foldl1 (+++) l) [] -> return (stringToHtml "")
416
false
false
1
17
244
113
52
61
null
null
ublubu/shapes
shapes/src/Utils/Utils.hs
mit
overWith :: Lens' s a -> ((a, a) -> (a, a)) -> (s, s) -> (s, s) overWith l f (x, y) = (x & l .~ a, y & l .~ b) where (a, b) = f (x ^. l, y ^. l)
147
overWith :: Lens' s a -> ((a, a) -> (a, a)) -> (s, s) -> (s, s) overWith l f (x, y) = (x & l .~ a, y & l .~ b) where (a, b) = f (x ^. l, y ^. l)
147
overWith l f (x, y) = (x & l .~ a, y & l .~ b) where (a, b) = f (x ^. l, y ^. l)
83
false
true
0
9
46
125
70
55
null
null
jwiegley/ghc-release
libraries/Cabal/cabal/tests/PackageTests/PackageTester.hs
gpl-3.0
assertInstallSucceeded :: Result -> Assertion assertInstallSucceeded result = unless (successful result) $ assertFailure $ "expected: \'setup install\' should succeed\n" ++ " output: " ++ outputText result
218
assertInstallSucceeded :: Result -> Assertion assertInstallSucceeded result = unless (successful result) $ assertFailure $ "expected: \'setup install\' should succeed\n" ++ " output: " ++ outputText result
218
assertInstallSucceeded result = unless (successful result) $ assertFailure $ "expected: \'setup install\' should succeed\n" ++ " output: " ++ outputText result
172
false
true
4
8
38
54
23
31
null
null
rueshyna/gogol
gogol-doubleclick-search/gen/Network/Google/DoubleClickSearch/Types/Product.hs
mpl-2.0
-- | Synchronous report only. A list of columns and directions defining -- sorting to be performed on the report rows. rrOrderBy :: Lens' ReportRequest [ReportRequestOrderByItem] rrOrderBy = lens _rrOrderBy (\ s a -> s{_rrOrderBy = a}) . _Default . _Coerce
270
rrOrderBy :: Lens' ReportRequest [ReportRequestOrderByItem] rrOrderBy = lens _rrOrderBy (\ s a -> s{_rrOrderBy = a}) . _Default . _Coerce
151
rrOrderBy = lens _rrOrderBy (\ s a -> s{_rrOrderBy = a}) . _Default . _Coerce
91
true
true
2
9
54
59
29
30
null
null
pgavin/tfp
Data/SizedInt.hs
bsd-3-clause
mask :: forall nT . NaturalT nT => nT -> Integer mask _ = bit (fromIntegerT (undefined :: nT)) - 1
108
mask :: forall nT . NaturalT nT => nT -> Integer mask _ = bit (fromIntegerT (undefined :: nT)) - 1
108
mask _ = bit (fromIntegerT (undefined :: nT)) - 1
49
false
true
0
9
30
49
25
24
null
null
samscott89/tamarin-prover
src/Web/Theory.hs
gpl-3.0
htmlCaseDistinctionDiff :: HtmlDocument d => RenderUrl -> TheoryIdx -> Side -> CaseDistKind -> Bool -> (Int, CaseDistinction) -> d htmlCaseDistinctionDiff renderUrl tidx s kind d (j, th) = if null cases then withTag "h2" [] ppHeader $-$ withTag "h3" [] (text "No cases.") else vcat $ withTag "h2" [] ppHeader : cases where cases = concatMap ppCase $ zip [1..] $ getDisj $ get cdCases th wrapP = withTag "p" [("class","monospace cases")] nCases = int $ length $ getDisj $ get cdCases th ppPrem = nest 2 $ doubleQuotes $ prettyGoal $ get cdGoal th ppHeader = hsep [ text "Sources of" <-> ppPrem , parens $ nCases <-> text "cases" ] ppCase (i, (names, se)) = [ withTag "h3" [] $ fsep [ text "Source", int i, text "of", nCases , text " / named ", doubleQuotes (text name) ] , refDotDiffPath renderUrl tidx (DiffTheoryCaseDist s kind d j i) , withTag "p" [] $ ppPrem , wrapP $ prettyNonGraphSystem se ] where name = intercalate "_" names -- | Build the Html document showing the source cases distinctions.
1,175
htmlCaseDistinctionDiff :: HtmlDocument d => RenderUrl -> TheoryIdx -> Side -> CaseDistKind -> Bool -> (Int, CaseDistinction) -> d htmlCaseDistinctionDiff renderUrl tidx s kind d (j, th) = if null cases then withTag "h2" [] ppHeader $-$ withTag "h3" [] (text "No cases.") else vcat $ withTag "h2" [] ppHeader : cases where cases = concatMap ppCase $ zip [1..] $ getDisj $ get cdCases th wrapP = withTag "p" [("class","monospace cases")] nCases = int $ length $ getDisj $ get cdCases th ppPrem = nest 2 $ doubleQuotes $ prettyGoal $ get cdGoal th ppHeader = hsep [ text "Sources of" <-> ppPrem , parens $ nCases <-> text "cases" ] ppCase (i, (names, se)) = [ withTag "h3" [] $ fsep [ text "Source", int i, text "of", nCases , text " / named ", doubleQuotes (text name) ] , refDotDiffPath renderUrl tidx (DiffTheoryCaseDist s kind d j i) , withTag "p" [] $ ppPrem , wrapP $ prettyNonGraphSystem se ] where name = intercalate "_" names -- | Build the Html document showing the source cases distinctions.
1,175
htmlCaseDistinctionDiff renderUrl tidx s kind d (j, th) = if null cases then withTag "h2" [] ppHeader $-$ withTag "h3" [] (text "No cases.") else vcat $ withTag "h2" [] ppHeader : cases where cases = concatMap ppCase $ zip [1..] $ getDisj $ get cdCases th wrapP = withTag "p" [("class","monospace cases")] nCases = int $ length $ getDisj $ get cdCases th ppPrem = nest 2 $ doubleQuotes $ prettyGoal $ get cdGoal th ppHeader = hsep [ text "Sources of" <-> ppPrem , parens $ nCases <-> text "cases" ] ppCase (i, (names, se)) = [ withTag "h3" [] $ fsep [ text "Source", int i, text "of", nCases , text " / named ", doubleQuotes (text name) ] , refDotDiffPath renderUrl tidx (DiffTheoryCaseDist s kind d j i) , withTag "p" [] $ ppPrem , wrapP $ prettyNonGraphSystem se ] where name = intercalate "_" names -- | Build the Html document showing the source cases distinctions.
1,024
false
true
16
12
354
426
200
226
null
null
wxwxwwxxx/ghc
compiler/vectorise/Vectorise/Var.hs
bsd-3-clause
vectBndrNew :: Var -> FastString -> VM VVar vectBndrNew v fs = do vty <- vectType (idType v) vv <- newLocalVVar fs vty updLEnv (upd vv) return vv where upd vv env = env { local_vars = extendVarEnv (local_vars env) v vv } -- |Vectorise a binder then run a computation with that binder in scope. --
323
vectBndrNew :: Var -> FastString -> VM VVar vectBndrNew v fs = do vty <- vectType (idType v) vv <- newLocalVVar fs vty updLEnv (upd vv) return vv where upd vv env = env { local_vars = extendVarEnv (local_vars env) v vv } -- |Vectorise a binder then run a computation with that binder in scope. --
323
vectBndrNew v fs = do vty <- vectType (idType v) vv <- newLocalVVar fs vty updLEnv (upd vv) return vv where upd vv env = env { local_vars = extendVarEnv (local_vars env) v vv } -- |Vectorise a binder then run a computation with that binder in scope. --
279
false
true
0
10
83
109
51
58
null
null
andreyLevushkin/LambdaWars
src/Arena.hs
mit
cmdDecelerate :: Double -> Bot () cmdDecelerate = yield . Decelerate
68
cmdDecelerate :: Double -> Bot () cmdDecelerate = yield . Decelerate
68
cmdDecelerate = yield . Decelerate
34
false
true
0
7
10
24
12
12
null
null
nebasuke/CarneadesIntoDung
src/Main.hs
bsd-3-clause
exec :: MyOptions -> CAES -> IO () exec opts@MyOptions{..} caes@(CAES (argSet, (assumptions, _), _)) = do let args = getAllArgs argSet let transCaes = translate caes putStrLn $ "Argument set: " ++ show args when xSemantics $ putStrLn "Evaluation under original semantics:" >> putStrLn "Applicable arguments:" >> print (filter (`applicable` caes) args) >> putStrLn "Acceptable propositions:" >> print (filter (\ p -> p `acceptable` caes || p `elem` assumptions) (getProps argSet)) when extension $ putStrLn "Extension after translation: " >> print (groundedExt transCaes) when correspondence $ putStrLn ("Correspondence of applicability is: " ++ show (corApp caes)) >> putStrLn ("Correspondence of acceptability is: " ++ show (corAcc caes)) unless (null outputFile) $ if cegartix then writeFile outputFile (toStrictCegartix transCaes) >> putStrLn "File outputted." else writeFile outputFile (toCegartix transCaes) >> putStrLn "File outputted."
1,090
exec :: MyOptions -> CAES -> IO () exec opts@MyOptions{..} caes@(CAES (argSet, (assumptions, _), _)) = do let args = getAllArgs argSet let transCaes = translate caes putStrLn $ "Argument set: " ++ show args when xSemantics $ putStrLn "Evaluation under original semantics:" >> putStrLn "Applicable arguments:" >> print (filter (`applicable` caes) args) >> putStrLn "Acceptable propositions:" >> print (filter (\ p -> p `acceptable` caes || p `elem` assumptions) (getProps argSet)) when extension $ putStrLn "Extension after translation: " >> print (groundedExt transCaes) when correspondence $ putStrLn ("Correspondence of applicability is: " ++ show (corApp caes)) >> putStrLn ("Correspondence of acceptability is: " ++ show (corAcc caes)) unless (null outputFile) $ if cegartix then writeFile outputFile (toStrictCegartix transCaes) >> putStrLn "File outputted." else writeFile outputFile (toCegartix transCaes) >> putStrLn "File outputted."
1,090
exec opts@MyOptions{..} caes@(CAES (argSet, (assumptions, _), _)) = do let args = getAllArgs argSet let transCaes = translate caes putStrLn $ "Argument set: " ++ show args when xSemantics $ putStrLn "Evaluation under original semantics:" >> putStrLn "Applicable arguments:" >> print (filter (`applicable` caes) args) >> putStrLn "Acceptable propositions:" >> print (filter (\ p -> p `acceptable` caes || p `elem` assumptions) (getProps argSet)) when extension $ putStrLn "Extension after translation: " >> print (groundedExt transCaes) when correspondence $ putStrLn ("Correspondence of applicability is: " ++ show (corApp caes)) >> putStrLn ("Correspondence of acceptability is: " ++ show (corAcc caes)) unless (null outputFile) $ if cegartix then writeFile outputFile (toStrictCegartix transCaes) >> putStrLn "File outputted." else writeFile outputFile (toCegartix transCaes) >> putStrLn "File outputted."
1,055
false
true
0
16
279
338
163
175
null
null
DavidAlphaFox/ghc
libraries/bytestring/Data/ByteString/Lazy.hs
bsd-3-clause
split w (Chunk c0 cs0) = comb [] (S.split w c0) cs0 where comb :: [P.ByteString] -> [P.ByteString] -> ByteString -> [ByteString] comb acc (s:[]) Empty = revChunks (s:acc) : [] comb acc (s:[]) (Chunk c cs) = comb (s:acc) (S.split w c) cs comb acc (s:ss) cs = revChunks (s:acc) : comb [] ss cs
336
split w (Chunk c0 cs0) = comb [] (S.split w c0) cs0 where comb :: [P.ByteString] -> [P.ByteString] -> ByteString -> [ByteString] comb acc (s:[]) Empty = revChunks (s:acc) : [] comb acc (s:[]) (Chunk c cs) = comb (s:acc) (S.split w c) cs comb acc (s:ss) cs = revChunks (s:acc) : comb [] ss cs
336
split w (Chunk c0 cs0) = comb [] (S.split w c0) cs0 where comb :: [P.ByteString] -> [P.ByteString] -> ByteString -> [ByteString] comb acc (s:[]) Empty = revChunks (s:acc) : [] comb acc (s:[]) (Chunk c cs) = comb (s:acc) (S.split w c) cs comb acc (s:ss) cs = revChunks (s:acc) : comb [] ss cs
336
false
false
6
10
100
202
103
99
null
null
leepike/SmartCheck
regression/Heap/Heap_Program.hs
bsd-3-clause
toSortedList (Node x h1 h2) = x : toList (h1 `merge` h2)
56
toSortedList (Node x h1 h2) = x : toList (h1 `merge` h2)
56
toSortedList (Node x h1 h2) = x : toList (h1 `merge` h2)
56
false
false
0
8
11
35
18
17
null
null
sherwoodwang/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/Draw.hs
lgpl-2.1
-- | Default 10pt sans-serif font. fontSwiss :: FontStyle fontSwiss = fontDefault{ _fontFamily = FontSwiss }
110
fontSwiss :: FontStyle fontSwiss = fontDefault{ _fontFamily = FontSwiss }
75
fontSwiss = fontDefault{ _fontFamily = FontSwiss }
52
true
true
0
7
17
31
14
17
null
null
sdiehl/ghc
compiler/ghci/ByteCodeAsm.hs
bsd-3-clause
runAsm :: DynFlags -> Bool -> LabelEnv -> Assembler a -> StateT AsmState IO a runAsm dflags long_jumps e = go where go (NullAsm x) = return x go (AllocPtr p_io k) = do p <- lift p_io w <- state $ \(st_i0,st_l0,st_p0) -> let st_p1 = addToSS st_p0 p in (sizeSS st_p0, (st_i0,st_l0,st_p1)) go $ k w go (AllocLit lits k) = do w <- state $ \(st_i0,st_l0,st_p0) -> let st_l1 = addListToSS st_l0 lits in (sizeSS st_l0, (st_i0,st_l1,st_p0)) go $ k w go (AllocLabel _ k) = go k go (Emit w ops k) = do let largeOps = any (largeOp long_jumps) ops opcode | largeOps = largeArgInstr w | otherwise = w words = concatMap expand ops expand (SmallOp w) = [w] expand (LabelOp w) = expand (Op (e w)) expand (Op w) = if largeOps then largeArg dflags w else [fromIntegral w] -- expand (LargeOp w) = largeArg dflags w state $ \(st_i0,st_l0,st_p0) -> let st_i1 = addListToSS st_i0 (opcode : words) in ((), (st_i1,st_l0,st_p0)) go k
1,107
runAsm :: DynFlags -> Bool -> LabelEnv -> Assembler a -> StateT AsmState IO a runAsm dflags long_jumps e = go where go (NullAsm x) = return x go (AllocPtr p_io k) = do p <- lift p_io w <- state $ \(st_i0,st_l0,st_p0) -> let st_p1 = addToSS st_p0 p in (sizeSS st_p0, (st_i0,st_l0,st_p1)) go $ k w go (AllocLit lits k) = do w <- state $ \(st_i0,st_l0,st_p0) -> let st_l1 = addListToSS st_l0 lits in (sizeSS st_l0, (st_i0,st_l1,st_p0)) go $ k w go (AllocLabel _ k) = go k go (Emit w ops k) = do let largeOps = any (largeOp long_jumps) ops opcode | largeOps = largeArgInstr w | otherwise = w words = concatMap expand ops expand (SmallOp w) = [w] expand (LabelOp w) = expand (Op (e w)) expand (Op w) = if largeOps then largeArg dflags w else [fromIntegral w] -- expand (LargeOp w) = largeArg dflags w state $ \(st_i0,st_l0,st_p0) -> let st_i1 = addListToSS st_i0 (opcode : words) in ((), (st_i1,st_l0,st_p0)) go k
1,107
runAsm dflags long_jumps e = go where go (NullAsm x) = return x go (AllocPtr p_io k) = do p <- lift p_io w <- state $ \(st_i0,st_l0,st_p0) -> let st_p1 = addToSS st_p0 p in (sizeSS st_p0, (st_i0,st_l0,st_p1)) go $ k w go (AllocLit lits k) = do w <- state $ \(st_i0,st_l0,st_p0) -> let st_l1 = addListToSS st_l0 lits in (sizeSS st_l0, (st_i0,st_l1,st_p0)) go $ k w go (AllocLabel _ k) = go k go (Emit w ops k) = do let largeOps = any (largeOp long_jumps) ops opcode | largeOps = largeArgInstr w | otherwise = w words = concatMap expand ops expand (SmallOp w) = [w] expand (LabelOp w) = expand (Op (e w)) expand (Op w) = if largeOps then largeArg dflags w else [fromIntegral w] -- expand (LargeOp w) = largeArg dflags w state $ \(st_i0,st_l0,st_p0) -> let st_i1 = addListToSS st_i0 (opcode : words) in ((), (st_i1,st_l0,st_p0)) go k
1,029
false
true
4
16
369
479
241
238
null
null
gspindles/rftg-cards
src/Game/RftG/Cards/TGS.hs
mit
spaceMercenaries :: Card spaceMercenaries = Card Development "SPACE MERCENARIES" (Cost 1) (VP 0) Nothing [] [Settle]
130
spaceMercenaries :: Card spaceMercenaries = Card Development "SPACE MERCENARIES" (Cost 1) (VP 0) Nothing [] [Settle]
130
spaceMercenaries = Card Development "SPACE MERCENARIES" (Cost 1) (VP 0) Nothing [] [Settle]
105
false
true
0
6
29
49
22
27
null
null
conal/GtkTV
src/Interface/TV/Gtk2.hs
bsd-3-clause
primMkI :: MkI' a -> In a primMkI = iPrim . MkI
47
primMkI :: MkI' a -> In a primMkI = iPrim . MkI
47
primMkI = iPrim . MkI
21
false
true
0
6
11
25
12
13
null
null
emmanueltouzery/cigale-timesheet
tests/EmailSpec.hs
mit
testMimeB64 :: Spec testMimeB64 = it "parses base64 email subject" $ assertEqual "doesn't match" "Prevent Foreclosure & Save Your Home " (decodeMimeHeader"=?iso-8859-1?B?UHJldmVudCBGb3JlY2xvc3VyZSAmIFNhdmUgWW91ciBIb21lIA=?=")
229
testMimeB64 :: Spec testMimeB64 = it "parses base64 email subject" $ assertEqual "doesn't match" "Prevent Foreclosure & Save Your Home " (decodeMimeHeader"=?iso-8859-1?B?UHJldmVudCBGb3JlY2xvc3VyZSAmIFNhdmUgWW91ciBIb21lIA=?=")
229
testMimeB64 = it "parses base64 email subject" $ assertEqual "doesn't match" "Prevent Foreclosure & Save Your Home " (decodeMimeHeader"=?iso-8859-1?B?UHJldmVudCBGb3JlY2xvc3VyZSAmIFNhdmUgWW91ciBIb21lIA=?=")
209
false
true
0
7
25
38
16
22
null
null
robdockins/canonical-lf
toyml/CPS.hs
bsd-3-clause
tailcps_ml (termView -> VConst "ml_inr" [e]) k_top = cps_ml e =<< (λ "z" v $ \z -> "letval" @@ ("inr" @@ var z) @@ (λ "x" v $ \x -> "enter" @@ (return $ weak $ weak k_top) @@ var x))
223
tailcps_ml (termView -> VConst "ml_inr" [e]) k_top = cps_ml e =<< (λ "z" v $ \z -> "letval" @@ ("inr" @@ var z) @@ (λ "x" v $ \x -> "enter" @@ (return $ weak $ weak k_top) @@ var x))
223
tailcps_ml (termView -> VConst "ml_inr" [e]) k_top = cps_ml e =<< (λ "z" v $ \z -> "letval" @@ ("inr" @@ var z) @@ (λ "x" v $ \x -> "enter" @@ (return $ weak $ weak k_top) @@ var x))
223
false
false
0
17
81
110
55
55
null
null
jwiegley/ghc-release
utils/haddock/src/Haddock/Backends/Xhtml/Decl.hs
gpl-3.0
ppCtxType unicode qual ty = ppr_mono_ty pREC_CTX ty unicode qual
67
ppCtxType unicode qual ty = ppr_mono_ty pREC_CTX ty unicode qual
67
ppCtxType unicode qual ty = ppr_mono_ty pREC_CTX ty unicode qual
67
false
false
0
5
12
22
10
12
null
null
AlephAlpha/Samau
OldSamau/Eval.hs
gpl-2.0
-- SmOperator '.' smJoin (SmList xs1:SmList xs2:s) = SmList (xs2 ++ xs1):s
78
smJoin (SmList xs1:SmList xs2:s) = SmList (xs2 ++ xs1):s
60
smJoin (SmList xs1:SmList xs2:s) = SmList (xs2 ++ xs1):s
60
true
false
0
9
15
41
20
21
null
null
Philonous/pontarius-service
source/Transactions.hs
agpl-3.0
handleRemoteRosterAvailable :: (MonadIO m, Ex.MonadCatch m, MonadMethodError m) => PSM m () handleRemoteRosterAvailable = do addMarkedPeers removeMarkedPeers
196
handleRemoteRosterAvailable :: (MonadIO m, Ex.MonadCatch m, MonadMethodError m) => PSM m () handleRemoteRosterAvailable = do addMarkedPeers removeMarkedPeers
196
handleRemoteRosterAvailable = do addMarkedPeers removeMarkedPeers
73
false
true
0
7
55
47
23
24
null
null
AndreasVoellmy/openflow
src/Network/Data/OF13/Message.hs
bsd-3-clause
oxmHasMask' :: OXM -> Bool oxmHasMask' (InPort {}) = False
58
oxmHasMask' :: OXM -> Bool oxmHasMask' (InPort {}) = False
58
oxmHasMask' (InPort {}) = False
31
false
true
0
7
9
25
13
12
null
null
irreverent-pixel-feats/bitbucket
bitbucket-json/test/Test/Irreverent/Bitbucket/Json.hs
bsd-3-clause
prop_newRepository :: Property prop_newRepository = forAll newRepositories $ roundTripProp (BSL.toStrict . encode . NewRepositoryJsonV2) (fmap newRepoFromJson . eitherDecodeStrict')
191
prop_newRepository :: Property prop_newRepository = forAll newRepositories $ roundTripProp (BSL.toStrict . encode . NewRepositoryJsonV2) (fmap newRepoFromJson . eitherDecodeStrict')
191
prop_newRepository = forAll newRepositories $ roundTripProp (BSL.toStrict . encode . NewRepositoryJsonV2) (fmap newRepoFromJson . eitherDecodeStrict')
160
false
true
0
10
27
46
23
23
null
null
alanz/Alex
src/Output.hs
bsd-3-clause
mkTables :: DFA SNum Code -> ( [Int], -- base [Int], -- table [Int], -- check [Int], -- default [[Accept Code]] -- accept ) mkTables dfa = -- trace (show (defaults)) $ -- trace (show (fmap (length . snd) dfa_no_defaults)) $ ( elems base_offs, take max_off (elems table), take max_off (elems check), elems defaults, accept ) where accept = [ as | State as _ <- elems dfa_arr ] state_assocs = Map.toAscList (dfa_states dfa) n_states = length state_assocs top_state = n_states - 1 dfa_arr :: Array SNum (State SNum Code) dfa_arr = array (0,top_state) state_assocs -- fill in all the error productions expand_states = [ expand (dfa_arr!state) | state <- [0..top_state] ] expand (State _ out) = [(i, lookup' out i) | i <- [0..0xff]] where lookup' out' i = case IntMap.lookup i out' of Nothing -> -1 Just s -> s defaults :: UArray SNum SNum defaults = listArray (0,top_state) (map best_default expand_states) -- find the most common destination state in a given state, and -- make it the default. best_default :: [(Int,SNum)] -> SNum best_default prod_list | null sorted = -1 | otherwise = snd (head (maximumBy lengths eq)) where sorted = sortBy compareSnds prod_list compareSnds (_,a) (_,b) = compare a b eq = groupBy (\(_,a) (_,b) -> a == b) sorted lengths a b = length a `compare` length b -- remove all the default productions from the DFA dfa_no_defaults = [ (s, prods_without_defaults s out) | (s, out) <- zip [0..] expand_states ] prods_without_defaults s out = [ (fromIntegral c, dest) | (c,dest) <- out, dest /= defaults!s ] (base_offs, table, check, max_off) = runST (genTables n_states 255 dfa_no_defaults)
2,205
mkTables :: DFA SNum Code -> ( [Int], -- base [Int], -- table [Int], -- check [Int], -- default [[Accept Code]] -- accept ) mkTables dfa = -- trace (show (defaults)) $ -- trace (show (fmap (length . snd) dfa_no_defaults)) $ ( elems base_offs, take max_off (elems table), take max_off (elems check), elems defaults, accept ) where accept = [ as | State as _ <- elems dfa_arr ] state_assocs = Map.toAscList (dfa_states dfa) n_states = length state_assocs top_state = n_states - 1 dfa_arr :: Array SNum (State SNum Code) dfa_arr = array (0,top_state) state_assocs -- fill in all the error productions expand_states = [ expand (dfa_arr!state) | state <- [0..top_state] ] expand (State _ out) = [(i, lookup' out i) | i <- [0..0xff]] where lookup' out' i = case IntMap.lookup i out' of Nothing -> -1 Just s -> s defaults :: UArray SNum SNum defaults = listArray (0,top_state) (map best_default expand_states) -- find the most common destination state in a given state, and -- make it the default. best_default :: [(Int,SNum)] -> SNum best_default prod_list | null sorted = -1 | otherwise = snd (head (maximumBy lengths eq)) where sorted = sortBy compareSnds prod_list compareSnds (_,a) (_,b) = compare a b eq = groupBy (\(_,a) (_,b) -> a == b) sorted lengths a b = length a `compare` length b -- remove all the default productions from the DFA dfa_no_defaults = [ (s, prods_without_defaults s out) | (s, out) <- zip [0..] expand_states ] prods_without_defaults s out = [ (fromIntegral c, dest) | (c,dest) <- out, dest /= defaults!s ] (base_offs, table, check, max_off) = runST (genTables n_states 255 dfa_no_defaults)
2,205
mkTables dfa = -- trace (show (defaults)) $ -- trace (show (fmap (length . snd) dfa_no_defaults)) $ ( elems base_offs, take max_off (elems table), take max_off (elems check), elems defaults, accept ) where accept = [ as | State as _ <- elems dfa_arr ] state_assocs = Map.toAscList (dfa_states dfa) n_states = length state_assocs top_state = n_states - 1 dfa_arr :: Array SNum (State SNum Code) dfa_arr = array (0,top_state) state_assocs -- fill in all the error productions expand_states = [ expand (dfa_arr!state) | state <- [0..top_state] ] expand (State _ out) = [(i, lookup' out i) | i <- [0..0xff]] where lookup' out' i = case IntMap.lookup i out' of Nothing -> -1 Just s -> s defaults :: UArray SNum SNum defaults = listArray (0,top_state) (map best_default expand_states) -- find the most common destination state in a given state, and -- make it the default. best_default :: [(Int,SNum)] -> SNum best_default prod_list | null sorted = -1 | otherwise = snd (head (maximumBy lengths eq)) where sorted = sortBy compareSnds prod_list compareSnds (_,a) (_,b) = compare a b eq = groupBy (\(_,a) (_,b) -> a == b) sorted lengths a b = length a `compare` length b -- remove all the default productions from the DFA dfa_no_defaults = [ (s, prods_without_defaults s out) | (s, out) <- zip [0..] expand_states ] prods_without_defaults s out = [ (fromIntegral c, dest) | (c,dest) <- out, dest /= defaults!s ] (base_offs, table, check, max_off) = runST (genTables n_states 255 dfa_no_defaults)
1,944
false
true
13
11
866
705
347
358
null
null
Schpin/schpin-chassis
schpin_robot_lib/src/Data/Walker.hs
gpl-3.0
getJointName = getLinkName
26
getJointName = getLinkName
26
getJointName = getLinkName
26
false
false
0
4
2
6
3
3
null
null
junjihashimoto/fay-d3-graph
Graph.hs
bsd-3-clause
alert :: a -> Fay () alert = ffi "alert(%1)"
44
alert :: a -> Fay () alert = ffi "alert(%1)"
44
alert = ffi "alert(%1)"
23
false
true
0
7
9
23
11
12
null
null
pyr/himpy
System/Himpy/Output/Riemann.hs
mit
apply_threshold :: Maybe Threshold -> Metric -> Metric apply_threshold Nothing metric= metric
93
apply_threshold :: Maybe Threshold -> Metric -> Metric apply_threshold Nothing metric= metric
93
apply_threshold Nothing metric= metric
38
false
true
0
6
11
27
13
14
null
null
jean-edouard/manager
xenmgr/XenMgr/CdLock.hs
gpl-2.0
getCdDeviceStickyVm :: BSGDevice -> Rpc (Maybe Uuid) getCdDeviceStickyVm dev = do vm' <- dbRead (cdDeviceStickyNode dev) case vm' of "" -> return Nothing uuidStr -> return $ Just (fromString uuidStr)
211
getCdDeviceStickyVm :: BSGDevice -> Rpc (Maybe Uuid) getCdDeviceStickyVm dev = do vm' <- dbRead (cdDeviceStickyNode dev) case vm' of "" -> return Nothing uuidStr -> return $ Just (fromString uuidStr)
211
getCdDeviceStickyVm dev = do vm' <- dbRead (cdDeviceStickyNode dev) case vm' of "" -> return Nothing uuidStr -> return $ Just (fromString uuidStr)
158
false
true
0
13
41
78
36
42
null
null
Happy0/snowdrift
Handler/About.hs
agpl-3.0
addChart route = do ident <- lift newIdent app <- lift getYesod addScriptEither $ urlJqueryJs app addStylesheetEither $ urlJqueryUiCss app addScript $ StaticR js_jquery_jqplot_min_js addScript $ StaticR js_plugins_jqplot_logAxisRenderer_min_js addStylesheet $ StaticR css_jquery_jqplot_min_css toWidget [hamlet| <div .chart_container> <div ##{ident}> <noscript> <img .chart src="@{route}"> |] return ident
495
addChart route = do ident <- lift newIdent app <- lift getYesod addScriptEither $ urlJqueryJs app addStylesheetEither $ urlJqueryUiCss app addScript $ StaticR js_jquery_jqplot_min_js addScript $ StaticR js_plugins_jqplot_logAxisRenderer_min_js addStylesheet $ StaticR css_jquery_jqplot_min_css toWidget [hamlet| <div .chart_container> <div ##{ident}> <noscript> <img .chart src="@{route}"> |] return ident
495
addChart route = do ident <- lift newIdent app <- lift getYesod addScriptEither $ urlJqueryJs app addStylesheetEither $ urlJqueryUiCss app addScript $ StaticR js_jquery_jqplot_min_js addScript $ StaticR js_plugins_jqplot_logAxisRenderer_min_js addStylesheet $ StaticR css_jquery_jqplot_min_css toWidget [hamlet| <div .chart_container> <div ##{ident}> <noscript> <img .chart src="@{route}"> |] return ident
495
false
false
0
8
134
95
40
55
null
null
mightymoose/liquidhaskell
benchmarks/vector-0.10.0.1/Data/Vector/Storable.hs
bsd-3-clause
-- NOTE: eta-expanded due to http://hackage.haskell.org/trac/ghc/ticket/4120 create p = G.create p
98
create p = G.create p
21
create p = G.create p
21
true
false
1
6
10
18
7
11
null
null
ethercrow/ai-challenger
src/AIChallenger/StateVar.hs
mit
subscribeToStateUpdates :: StateVar -> IO (ServerState, OutChan ServerStateUpdate) subscribeToStateUpdates (StateVar stateVar chan) = withMVar stateVar $ \state -> do outChan <- Chan.dupChan chan return (state, OutChan outChan)
247
subscribeToStateUpdates :: StateVar -> IO (ServerState, OutChan ServerStateUpdate) subscribeToStateUpdates (StateVar stateVar chan) = withMVar stateVar $ \state -> do outChan <- Chan.dupChan chan return (state, OutChan outChan)
247
subscribeToStateUpdates (StateVar stateVar chan) = withMVar stateVar $ \state -> do outChan <- Chan.dupChan chan return (state, OutChan outChan)
164
false
true
0
11
46
77
37
40
null
null
flipstone/orville
orville-postgresql-libpq/src/Orville/PostgreSQL/Internal/DefaultValue.hs
mit
{- | Builds a default value that will default to the current date (i.e. the date at which the database populates the default value on a given row). For use with date fields. -} currentDateDefault :: DefaultValue Time.Day currentDateDefault = DefaultValue . RawSql.unsafeFromRawSql . RawSql.fromString $ "('now'::text)::date"
345
currentDateDefault :: DefaultValue Time.Day currentDateDefault = DefaultValue . RawSql.unsafeFromRawSql . RawSql.fromString $ "('now'::text)::date"
161
currentDateDefault = DefaultValue . RawSql.unsafeFromRawSql . RawSql.fromString $ "('now'::text)::date"
117
true
true
0
8
67
33
17
16
null
null
Fermat/Gottlob
Language/Program.hs
bsd-3-clause
dePattern (TSTApp f1 f2) = do c1 <- dePattern f1 c2 <- dePattern f2 return $ TSTApp c1 c2 -- it is a little ad hoc
122
dePattern (TSTApp f1 f2) = do c1 <- dePattern f1 c2 <- dePattern f2 return $ TSTApp c1 c2 -- it is a little ad hoc
122
dePattern (TSTApp f1 f2) = do c1 <- dePattern f1 c2 <- dePattern f2 return $ TSTApp c1 c2 -- it is a little ad hoc
122
false
false
0
8
33
50
22
28
null
null
jeroennoels/exact-real
src/Ternary/Sampling/Calculation.hs
mit
outputList :: Ref -> Refined -> [T2] outputList ref = outDigits . output ref
76
outputList :: Ref -> Refined -> [T2] outputList ref = outDigits . output ref
76
outputList ref = outDigits . output ref
39
false
true
0
7
13
32
16
16
null
null
djoyner/hap-probe-collector
src/collector/Message.hs
bsd-3-clause
toPair (RelHumidityData x) = "rel_humidity" .= x
61
toPair (RelHumidityData x) = "rel_humidity" .= x
61
toPair (RelHumidityData x) = "rel_humidity" .= x
61
false
false
0
7
19
19
9
10
null
null
mvr/abyme
haskell-model/src/Abyme/Shapey/Chunk.hs
bsd-3-clause
pushChunkWithResult :: Universe -> Direction -> Chunk -> (Universe, Chunk) pushChunkWithResult u d c = (u', shapeChunk u' s') where u' = pushChunk u d c anId = c ^. chunkTopShapes . to head . shapeId s' = lookupShape u' anId -- -------------------------------------------------------------------------------- -- -- Zooming -- There must be a cleverer way to do this...
388
pushChunkWithResult :: Universe -> Direction -> Chunk -> (Universe, Chunk) pushChunkWithResult u d c = (u', shapeChunk u' s') where u' = pushChunk u d c anId = c ^. chunkTopShapes . to head . shapeId s' = lookupShape u' anId -- -------------------------------------------------------------------------------- -- -- Zooming -- There must be a cleverer way to do this...
388
pushChunkWithResult u d c = (u', shapeChunk u' s') where u' = pushChunk u d c anId = c ^. chunkTopShapes . to head . shapeId s' = lookupShape u' anId -- -------------------------------------------------------------------------------- -- -- Zooming -- There must be a cleverer way to do this...
313
false
true
2
8
75
97
50
47
null
null
ctford/Idris-Elba-dev
src/IRTS/CodegenC.hs
bsd-3-clause
doOp v LReadStr [x] = v ++ "idris_readStr(vm, GETPTR(" ++ creg x ++ "))"
72
doOp v LReadStr [x] = v ++ "idris_readStr(vm, GETPTR(" ++ creg x ++ "))"
72
doOp v LReadStr [x] = v ++ "idris_readStr(vm, GETPTR(" ++ creg x ++ "))"
72
false
false
0
7
13
31
15
16
null
null
brendanhay/gogol
gogol-genomics/gen/Network/Google/Resource/Genomics/Projects/Operations/Get.hs
mpl-2.0
-- | OAuth access token. pogAccessToken :: Lens' ProjectsOperationsGet (Maybe Text) pogAccessToken = lens _pogAccessToken (\ s a -> s{_pogAccessToken = a})
163
pogAccessToken :: Lens' ProjectsOperationsGet (Maybe Text) pogAccessToken = lens _pogAccessToken (\ s a -> s{_pogAccessToken = a})
138
pogAccessToken = lens _pogAccessToken (\ s a -> s{_pogAccessToken = a})
79
true
true
1
9
29
52
25
27
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/distributed/static-config/StaticConfig.hs
unlicense
usage :: String -> IO () usage prog = putStrLn $ "usage: " ++ prog ++ " (master | remote) host port"
100
usage :: String -> IO () usage prog = putStrLn $ "usage: " ++ prog ++ " (master | remote) host port"
100
usage prog = putStrLn $ "usage: " ++ prog ++ " (master | remote) host port"
75
false
true
2
8
21
41
18
23
null
null
leshchevds/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- * HTools tag prefixes exTagsPrefix :: String exTagsPrefix = Tags.exTagsPrefix
81
exTagsPrefix :: String exTagsPrefix = Tags.exTagsPrefix
55
exTagsPrefix = Tags.exTagsPrefix
32
true
true
0
5
11
14
8
6
null
null
martin-kolinek/stack
src/Stack/Types/Config.hs
bsd-3-clause
packageDatabaseDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) packageDatabaseDeps = do root <- installationRootDeps return $ root </> $(mkRelDir "pkgdb") -- | Package database for installing local packages into
252
packageDatabaseDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) packageDatabaseDeps = do root <- installationRootDeps return $ root </> $(mkRelDir "pkgdb") -- | Package database for installing local packages into
252
packageDatabaseDeps = do root <- installationRootDeps return $ root </> $(mkRelDir "pkgdb") -- | Package database for installing local packages into
157
false
true
0
10
43
71
35
36
null
null
mightymoose/liquidhaskell
src/Language/Haskell/Liquid/Parse.hs
bsd-3-clause
simpleComment open close = open >> manyTill anyChar (try close)
63
simpleComment open close = open >> manyTill anyChar (try close)
63
simpleComment open close = open >> manyTill anyChar (try close)
63
false
false
0
8
9
26
12
14
null
null
d0kt0r0/InnerEar
src/InnerEar/Exercises/FrequencyEnvelope.hs
gpl-3.0
generateQ :: Config -> [ExerciseDatum] -> IO ([Answer],Answer) generateQ _ _ = randomMultipleChoiceQuestion answers
115
generateQ :: Config -> [ExerciseDatum] -> IO ([Answer],Answer) generateQ _ _ = randomMultipleChoiceQuestion answers
115
generateQ _ _ = randomMultipleChoiceQuestion answers
52
false
true
0
9
13
42
22
20
null
null
michaelficarra/purescript
psc-bundle/Main.hs
mit
options :: Parser Options options = Options <$> some inputFile <*> optional outputFile <*> many entryPoint <*> optional mainModule <*> namespace <*> optional requirePath where inputFile :: Parser FilePath inputFile = strArgument $ metavar "FILE" <> help "The input .js file(s)" outputFile :: Parser FilePath outputFile = strOption $ short 'o' <> long "output" <> help "The output .js file" entryPoint :: Parser String entryPoint = strOption $ short 'm' <> long "module" <> help "Entry point module name(s). All code which is not a transitive dependency of an entry point module will be removed." mainModule :: Parser String mainModule = strOption $ long "main" <> help "Generate code to run the main method in the specified module." namespace :: Parser String namespace = strOption $ short 'n' <> long "namespace" <> Opts.value "PS" <> showDefault <> help "Specify the namespace that PureScript modules will be exported to when running in the browser." requirePath :: Parser FilePath requirePath = strOption $ short 'r' <> long "require-path" <> Opts.value "" <> help "The path prefix used in require() calls in the generated JavaScript" -- | Make it go.
1,370
options :: Parser Options options = Options <$> some inputFile <*> optional outputFile <*> many entryPoint <*> optional mainModule <*> namespace <*> optional requirePath where inputFile :: Parser FilePath inputFile = strArgument $ metavar "FILE" <> help "The input .js file(s)" outputFile :: Parser FilePath outputFile = strOption $ short 'o' <> long "output" <> help "The output .js file" entryPoint :: Parser String entryPoint = strOption $ short 'm' <> long "module" <> help "Entry point module name(s). All code which is not a transitive dependency of an entry point module will be removed." mainModule :: Parser String mainModule = strOption $ long "main" <> help "Generate code to run the main method in the specified module." namespace :: Parser String namespace = strOption $ short 'n' <> long "namespace" <> Opts.value "PS" <> showDefault <> help "Specify the namespace that PureScript modules will be exported to when running in the browser." requirePath :: Parser FilePath requirePath = strOption $ short 'r' <> long "require-path" <> Opts.value "" <> help "The path prefix used in require() calls in the generated JavaScript" -- | Make it go.
1,370
options = Options <$> some inputFile <*> optional outputFile <*> many entryPoint <*> optional mainModule <*> namespace <*> optional requirePath where inputFile :: Parser FilePath inputFile = strArgument $ metavar "FILE" <> help "The input .js file(s)" outputFile :: Parser FilePath outputFile = strOption $ short 'o' <> long "output" <> help "The output .js file" entryPoint :: Parser String entryPoint = strOption $ short 'm' <> long "module" <> help "Entry point module name(s). All code which is not a transitive dependency of an entry point module will be removed." mainModule :: Parser String mainModule = strOption $ long "main" <> help "Generate code to run the main method in the specified module." namespace :: Parser String namespace = strOption $ short 'n' <> long "namespace" <> Opts.value "PS" <> showDefault <> help "Specify the namespace that PureScript modules will be exported to when running in the browser." requirePath :: Parser FilePath requirePath = strOption $ short 'r' <> long "require-path" <> Opts.value "" <> help "The path prefix used in require() calls in the generated JavaScript" -- | Make it go.
1,344
false
true
0
11
402
269
126
143
null
null
csrhodes/pandoc
src/Text/Pandoc/Writers/DokuWiki.hs
gpl-2.0
inlineToDokuWiki opts (Strikeout lst) = do contents <- inlineListToDokuWiki opts lst return $ "<del>" ++ contents ++ "</del>"
129
inlineToDokuWiki opts (Strikeout lst) = do contents <- inlineListToDokuWiki opts lst return $ "<del>" ++ contents ++ "</del>"
129
inlineToDokuWiki opts (Strikeout lst) = do contents <- inlineListToDokuWiki opts lst return $ "<del>" ++ contents ++ "</del>"
129
false
false
0
9
21
44
20
24
null
null
sdiehl/ghc
compiler/utils/Pretty.hs
bsd-3-clause
mkNest k p = nest_ k p
38
mkNest k p = nest_ k p
38
mkNest k p = nest_ k p
38
false
false
0
5
22
16
7
9
null
null