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
sjakobi/brick
src/Brick/Widgets/FileBrowser.hs
bsd-3-clause
renderFileInfo :: Bool -> Int -> Set.Set String -> n -> Bool -> FileInfo -> Widget n renderFileInfo foc maxLen selFiles n listSel info = (if foc then (if listSel then forceAttr listSelectedFocusedAttr else if sel then forceAttr fileBrowserSelectedAttr else id) else (if listSel then forceAttr listSelectedAttr else if sel then forceAttr fileBrowserSelectedAttr else id)) $ padRight Max body where sel = fileInfoFilename info `Set.member` selFiles addAttr = maybe id (withDefAttr . attrForFileType) (fileInfoFileType info) body = addAttr (hLimit (maxLen + 1) $ padRight Max $ (if foc && listSel then putCursor n (Location (0,0)) else id) $ str $ fileInfoSanitizedFilename info <> suffix) suffix = (if fileInfoFileType info == Just Directory then "/" else "") <> (if sel then "*" else "") -- | Sanitize a filename for terminal display, replacing non-printable -- characters with '?'.
1,028
renderFileInfo :: Bool -> Int -> Set.Set String -> n -> Bool -> FileInfo -> Widget n renderFileInfo foc maxLen selFiles n listSel info = (if foc then (if listSel then forceAttr listSelectedFocusedAttr else if sel then forceAttr fileBrowserSelectedAttr else id) else (if listSel then forceAttr listSelectedAttr else if sel then forceAttr fileBrowserSelectedAttr else id)) $ padRight Max body where sel = fileInfoFilename info `Set.member` selFiles addAttr = maybe id (withDefAttr . attrForFileType) (fileInfoFileType info) body = addAttr (hLimit (maxLen + 1) $ padRight Max $ (if foc && listSel then putCursor n (Location (0,0)) else id) $ str $ fileInfoSanitizedFilename info <> suffix) suffix = (if fileInfoFileType info == Just Directory then "/" else "") <> (if sel then "*" else "") -- | Sanitize a filename for terminal display, replacing non-printable -- characters with '?'.
1,028
renderFileInfo foc maxLen selFiles n listSel info = (if foc then (if listSel then forceAttr listSelectedFocusedAttr else if sel then forceAttr fileBrowserSelectedAttr else id) else (if listSel then forceAttr listSelectedAttr else if sel then forceAttr fileBrowserSelectedAttr else id)) $ padRight Max body where sel = fileInfoFilename info `Set.member` selFiles addAttr = maybe id (withDefAttr . attrForFileType) (fileInfoFileType info) body = addAttr (hLimit (maxLen + 1) $ padRight Max $ (if foc && listSel then putCursor n (Location (0,0)) else id) $ str $ fileInfoSanitizedFilename info <> suffix) suffix = (if fileInfoFileType info == Just Directory then "/" else "") <> (if sel then "*" else "") -- | Sanitize a filename for terminal display, replacing non-printable -- characters with '?'.
943
false
true
3
18
283
294
155
139
null
null
tonyfloatersu/solution-haskell-craft-of-FP
Deque.hs
mit
emptyDQ :: Deque a emptyDQ = Deque []
40
emptyDQ :: Deque a emptyDQ = Deque []
40
emptyDQ = Deque []
21
false
true
0
6
10
19
9
10
null
null
gnn/Hets
Static/ToXml.hs
gpl-2.0
showSymbolsTh :: HetcatsOpts -> [String] -> String -> GlobalAnnos -> G_theory -> Element showSymbolsTh opts ins name ga th = case th of G_theory lid _ (ExtSign sig _) _ sens _ -> add_attrs [ mkAttr "logic" $ language_name lid , mkNameAttr name ] . unode "Ontology" $ [ unode "Symbols" . map (showSym lid) $ symlist_of lid sig , unode "Axioms" . map (showSen opts lid ga Nothing sig) $ toNamedList sens ] ++ map (unode "Import") ins
465
showSymbolsTh :: HetcatsOpts -> [String] -> String -> GlobalAnnos -> G_theory -> Element showSymbolsTh opts ins name ga th = case th of G_theory lid _ (ExtSign sig _) _ sens _ -> add_attrs [ mkAttr "logic" $ language_name lid , mkNameAttr name ] . unode "Ontology" $ [ unode "Symbols" . map (showSym lid) $ symlist_of lid sig , unode "Axioms" . map (showSen opts lid ga Nothing sig) $ toNamedList sens ] ++ map (unode "Import") ins
465
showSymbolsTh opts ins name ga th = case th of G_theory lid _ (ExtSign sig _) _ sens _ -> add_attrs [ mkAttr "logic" $ language_name lid , mkNameAttr name ] . unode "Ontology" $ [ unode "Symbols" . map (showSym lid) $ symlist_of lid sig , unode "Axioms" . map (showSen opts lid ga Nothing sig) $ toNamedList sens ] ++ map (unode "Import") ins
376
false
true
11
12
112
183
89
94
null
null
romanb/amazonka
amazonka-cognito-sync/gen/Network/AWS/CognitoSync/ListIdentityPoolUsage.hs
mpl-2.0
-- | Usage information for the identity pools. lipurIdentityPoolUsages :: Lens' ListIdentityPoolUsageResponse [IdentityPoolUsage] lipurIdentityPoolUsages = lens _lipurIdentityPoolUsages (\s a -> s { _lipurIdentityPoolUsages = a }) . _List
250
lipurIdentityPoolUsages :: Lens' ListIdentityPoolUsageResponse [IdentityPoolUsage] lipurIdentityPoolUsages = lens _lipurIdentityPoolUsages (\s a -> s { _lipurIdentityPoolUsages = a }) . _List
203
lipurIdentityPoolUsages = lens _lipurIdentityPoolUsages (\s a -> s { _lipurIdentityPoolUsages = a }) . _List
120
true
true
0
10
39
47
26
21
null
null
sherwoodwang/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcTypes.hs
lgpl-2.1
toCIntRectH (Rect _x _y _w h) = toCInt h
41
toCIntRectH (Rect _x _y _w h) = toCInt h
41
toCIntRectH (Rect _x _y _w h) = toCInt h
41
false
false
0
7
9
24
11
13
null
null
nshaheed/EarTraining
earTrainer.hs
bsd-3-clause
buttonPress :: [(Float, Float)] -> (Float, Float) -> Maybe Int buttonPress x y = let z = buttonPressWorker x y in if z >= fromIntegral (length x) then Nothing else Just z
245
buttonPress :: [(Float, Float)] -> (Float, Float) -> Maybe Int buttonPress x y = let z = buttonPressWorker x y in if z >= fromIntegral (length x) then Nothing else Just z
245
buttonPress x y = let z = buttonPressWorker x y in if z >= fromIntegral (length x) then Nothing else Just z
178
false
true
0
11
106
82
42
40
null
null
gcampax/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
-- pprType prints forall's regardless of -fprint-explict-foralls -- which is what we want here, since we might be saying -- type variable 't' is bound by ... pprPatSkolInfo (PatSynCon ps) = sep [ ptext (sLit "a pattern with pattern synonym:") , nest 2 $ ppr ps <+> dcolon <+> pprType (patSynType ps) <> comma ]
360
pprPatSkolInfo (PatSynCon ps) = sep [ ptext (sLit "a pattern with pattern synonym:") , nest 2 $ ppr ps <+> dcolon <+> pprType (patSynType ps) <> comma ]
181
pprPatSkolInfo (PatSynCon ps) = sep [ ptext (sLit "a pattern with pattern synonym:") , nest 2 $ ppr ps <+> dcolon <+> pprType (patSynType ps) <> comma ]
181
true
false
0
11
104
67
33
34
null
null
futtetennista/IntroductionToFunctionalProgramming
RWH/src/ch19/ParseInt.hs
mit
satisfy :: (Char -> Bool) -> Parser Char satisfy p = do s <- liftP S.get case B.uncons s of Nothing -> E.throwError EndOfInput Just (c, s') | p c -> liftP (S.put s') >> return c | otherwise -> E.throwError (Chatty $ "invalid character: '" ++ B.unpack s ++ "'")
307
satisfy :: (Char -> Bool) -> Parser Char satisfy p = do s <- liftP S.get case B.uncons s of Nothing -> E.throwError EndOfInput Just (c, s') | p c -> liftP (S.put s') >> return c | otherwise -> E.throwError (Chatty $ "invalid character: '" ++ B.unpack s ++ "'")
307
satisfy p = do s <- liftP S.get case B.uncons s of Nothing -> E.throwError EndOfInput Just (c, s') | p c -> liftP (S.put s') >> return c | otherwise -> E.throwError (Chatty $ "invalid character: '" ++ B.unpack s ++ "'")
266
false
true
0
16
97
139
64
75
null
null
nushio3/ghc
compiler/types/Type.hs
bsd-3-clause
typeRepArity n ty = case repType ty of UnaryRep (ForAllTy bndr ty) -> length (flattenRepType (repType (binderType bndr))) + typeRepArity (n - 1) ty _ -> pprPanic "typeRepArity: arity greater than type can handle" (ppr (n, ty, repType ty))
268
typeRepArity n ty = case repType ty of UnaryRep (ForAllTy bndr ty) -> length (flattenRepType (repType (binderType bndr))) + typeRepArity (n - 1) ty _ -> pprPanic "typeRepArity: arity greater than type can handle" (ppr (n, ty, repType ty))
268
typeRepArity n ty = case repType ty of UnaryRep (ForAllTy bndr ty) -> length (flattenRepType (repType (binderType bndr))) + typeRepArity (n - 1) ty _ -> pprPanic "typeRepArity: arity greater than type can handle" (ppr (n, ty, repType ty))
268
false
false
1
15
68
105
49
56
null
null
jcristovao/data-easy
src/Data/Easy.hs
bsd-3-clause
-- | Extracts the right value of an either to a singleton list, or an -- empty list if the Either value is a Left -- -- /Note/: A Left value is lost in the convertion. eitherToList :: Either a b -> [b] eitherToList = either (const []) singleton
244
eitherToList :: Either a b -> [b] eitherToList = either (const []) singleton
76
eitherToList = either (const []) singleton
42
true
true
0
8
48
40
22
18
null
null
Cognimeta/perdure
exe-src/Database/Perdure/TestPersistent.hs
apache-2.0
propPersister :: forall a. (Show a, Eq a) => Persister a -> a -> Property propPersister p a = morallyDubiousIOProperty $ return $ (== a) $ deserializeFromFullArray (unsafeSeqDeserializer p) $ fullArrayRange $ (id :: Id (PrimArray Pinned Word64)) $ serializeToArray p a
291
propPersister :: forall a. (Show a, Eq a) => Persister a -> a -> Property propPersister p a = morallyDubiousIOProperty $ return $ (== a) $ deserializeFromFullArray (unsafeSeqDeserializer p) $ fullArrayRange $ (id :: Id (PrimArray Pinned Word64)) $ serializeToArray p a
290
propPersister p a = morallyDubiousIOProperty $ return $ (== a) $ deserializeFromFullArray (unsafeSeqDeserializer p) $ fullArrayRange $ (id :: Id (PrimArray Pinned Word64)) $ serializeToArray p a
216
false
true
0
11
64
106
54
52
null
null
GaloisInc/halvm-ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
toListClassOpKey = mkPreludeMiscIdUnique 501
44
toListClassOpKey = mkPreludeMiscIdUnique 501
44
toListClassOpKey = mkPreludeMiscIdUnique 501
44
false
false
1
5
3
12
4
8
null
null
brendanhay/gogol
gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs
mpl-2.0
-- | A list of valid abuse reasons that are used with \`video.ReportAbuse\`. varrlrItems :: Lens' VideoAbuseReportReasonListResponse [VideoAbuseReportReason] varrlrItems = lens _varrlrItems (\ s a -> s{_varrlrItems = a}) . _Default . _Coerce
255
varrlrItems :: Lens' VideoAbuseReportReasonListResponse [VideoAbuseReportReason] varrlrItems = lens _varrlrItems (\ s a -> s{_varrlrItems = a}) . _Default . _Coerce
178
varrlrItems = lens _varrlrItems (\ s a -> s{_varrlrItems = a}) . _Default . _Coerce
97
true
true
0
11
46
53
28
25
null
null
merijn/lambda-except
AST.hs
bsd-3-clause
instantiateNamed :: Monad f => (b -> a) -> Scope (Named b) f (Named a) -> f (Named a) instantiateNamed f = Bound.instantiate (pure . fmap f)
144
instantiateNamed :: Monad f => (b -> a) -> Scope (Named b) f (Named a) -> f (Named a) instantiateNamed f = Bound.instantiate (pure . fmap f)
144
instantiateNamed f = Bound.instantiate (pure . fmap f)
54
false
true
0
10
30
79
38
41
null
null
spinda/liquidhaskell
src/Language/Haskell/Liquid/Desugar710/DsArrows.hs
bsd-3-clause
dsCmdDo :: DsCmdEnv -- arrow combinators -> IdSet -- set of local vars available to this statement -> Type -- return type of the statement -> [CmdLStmt Id] -- statements to desugar -> [Id] -- list of vars in the input to this statement -- This is typically fed back, -- so don't pull on it too early -> DsM (CoreExpr, -- desugared expression IdSet) -- subset of local vars that occur free dsCmdDo _ _ _ [] _ = panic "dsCmdDo"
627
dsCmdDo :: DsCmdEnv -- arrow combinators -> IdSet -- set of local vars available to this statement -> Type -- return type of the statement -> [CmdLStmt Id] -- statements to desugar -> [Id] -- list of vars in the input to this statement -- This is typically fed back, -- so don't pull on it too early -> DsM (CoreExpr, -- desugared expression IdSet) dsCmdDo _ _ _ [] _ = panic "dsCmdDo"
577
dsCmdDo _ _ _ [] _ = panic "dsCmdDo"
36
true
true
0
12
283
78
43
35
null
null
yeyan/xtag
src/Main.hs
lgpl-3.0
runScotty :: AppData -> XTagScottyM () -> IO () runScotty appData = do scottyT (appData ^. appConfig . port) initApp runM where runM :: ReaderT AppData IO a -> IO a runM m = runReaderT m appData initApp m = runM $ do appData <- ask let conn = appData ^. connection repos = appData ^. appConfig . repositories result <- liftIO $ runRedis conn $ mapM doScan repos liftIO $ print result m doScan path = do liftIO $ putStrLn $ "Scanning repository " ++ path scanBooks path
611
runScotty :: AppData -> XTagScottyM () -> IO () runScotty appData = do scottyT (appData ^. appConfig . port) initApp runM where runM :: ReaderT AppData IO a -> IO a runM m = runReaderT m appData initApp m = runM $ do appData <- ask let conn = appData ^. connection repos = appData ^. appConfig . repositories result <- liftIO $ runRedis conn $ mapM doScan repos liftIO $ print result m doScan path = do liftIO $ putStrLn $ "Scanning repository " ++ path scanBooks path
611
runScotty appData = do scottyT (appData ^. appConfig . port) initApp runM where runM :: ReaderT AppData IO a -> IO a runM m = runReaderT m appData initApp m = runM $ do appData <- ask let conn = appData ^. connection repos = appData ^. appConfig . repositories result <- liftIO $ runRedis conn $ mapM doScan repos liftIO $ print result m doScan path = do liftIO $ putStrLn $ "Scanning repository " ++ path scanBooks path
563
false
true
4
11
231
215
93
122
null
null
olsner/ghc
compiler/utils/Platform.hs
bsd-3-clause
sElfTarget OSAndroid = True
30
osElfTarget OSAndroid = True
30
osElfTarget OSAndroid = True
30
false
false
0
5
6
9
4
5
null
null
burz/Feval
FVL/F.hs
mit
run :: Fix Expr -> Result run e = case run_typecheck e of Nothing -> InconsistentTypes Just t -> case run_eval e of Nothing -> TypeMismatch Just v -> Result (v, t)
187
run :: Fix Expr -> Result run e = case run_typecheck e of Nothing -> InconsistentTypes Just t -> case run_eval e of Nothing -> TypeMismatch Just v -> Result (v, t)
187
run e = case run_typecheck e of Nothing -> InconsistentTypes Just t -> case run_eval e of Nothing -> TypeMismatch Just v -> Result (v, t)
161
false
true
2
9
55
79
36
43
null
null
iatorm/grime
Matcher.hs
mit
-- Modify context anchors, increase logging depth withAnchors :: ([Rect] -> [Rect]) -> Matcher a -> Matcher a withAnchors f = local $ \con -> con{anchors = f $ anchors con, depth = depth con + 1}
195
withAnchors :: ([Rect] -> [Rect]) -> Matcher a -> Matcher a withAnchors f = local $ \con -> con{anchors = f $ anchors con, depth = depth con + 1}
145
withAnchors f = local $ \con -> con{anchors = f $ anchors con, depth = depth con + 1}
85
true
true
0
10
36
79
42
37
null
null
jstolarek/slicer
lib/Language/Slicer/Parser.hs
gpl-3.0
strWith = "with"
25
strWith = "with"
25
strWith = "with"
25
false
false
1
5
11
10
3
7
null
null
brendanhay/gogol
gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/GuardianInvitations/List.hs
mpl-2.0
-- | If specified, only results with the specified \`state\` values are -- returned. Otherwise, results with a \`state\` of \`PENDING\` are -- returned. upfgilStates :: Lens' UserProFilesGuardianInvitationsList [UserProFilesGuardianInvitationsListStates] upfgilStates = lens _upfgilStates (\ s a -> s{_upfgilStates = a}) . _Default . _Coerce
355
upfgilStates :: Lens' UserProFilesGuardianInvitationsList [UserProFilesGuardianInvitationsListStates] upfgilStates = lens _upfgilStates (\ s a -> s{_upfgilStates = a}) . _Default . _Coerce
202
upfgilStates = lens _upfgilStates (\ s a -> s{_upfgilStates = a}) . _Default . _Coerce
100
true
true
3
8
57
61
30
31
null
null
snapframework/snap-templates
project_template/default/src/Site.hs
bsd-3-clause
handleLoginSubmit :: Handler App (AuthManager App) () handleLoginSubmit = loginUser "login" "password" Nothing (\_ -> handleLogin err) (redirect "/") where err = Just "Unknown user or password" ------------------------------------------------------------------------------ -- | Logs out and redirects the user to the site index.
354
handleLoginSubmit :: Handler App (AuthManager App) () handleLoginSubmit = loginUser "login" "password" Nothing (\_ -> handleLogin err) (redirect "/") where err = Just "Unknown user or password" ------------------------------------------------------------------------------ -- | Logs out and redirects the user to the site index.
354
handleLoginSubmit = loginUser "login" "password" Nothing (\_ -> handleLogin err) (redirect "/") where err = Just "Unknown user or password" ------------------------------------------------------------------------------ -- | Logs out and redirects the user to the site index.
300
false
true
0
8
65
67
34
33
null
null
charles-l/comp
build_me_a_scheme/scheme.hs
mit
writeProc [obj, Port port] = liftIO $ hPrint port obj >> (return $ Bool True)
77
writeProc [obj, Port port] = liftIO $ hPrint port obj >> (return $ Bool True)
77
writeProc [obj, Port port] = liftIO $ hPrint port obj >> (return $ Bool True)
77
false
false
0
8
14
42
20
22
null
null
Shou/Tombot
Tombot/Discord.hs
gpl-2.0
runDiscord :: TVar Tombot.Config -> IO () runDiscord configt = do setLocaleEncoding utf8 config <- atomically $ do putTMVar stateConfigt configt readTVar configt let apiPath = Tombot._confDirectory config </> "api" apiKeys <- Tombot.readConfig @_ @(Map Text String) apiPath let mayToken = join $ Map.lookup "discord-token" <$> apiKeys case mayToken of Just token -> do atomically $ putTMVar stateToken token forever $ do Except.catch @SomeException websockInit print threadDelay $ 10^6 Nothing -> putStrLn $ "No Discord token in " <> apiPath --r <- getWith opts gatewayURL --let responseText = r ^. responseBody -- murl = join $ Map.lookup "url" <$> (decode responseText :: Maybe (Map String String)) --maybe (return()) websockInit murl
857
runDiscord :: TVar Tombot.Config -> IO () runDiscord configt = do setLocaleEncoding utf8 config <- atomically $ do putTMVar stateConfigt configt readTVar configt let apiPath = Tombot._confDirectory config </> "api" apiKeys <- Tombot.readConfig @_ @(Map Text String) apiPath let mayToken = join $ Map.lookup "discord-token" <$> apiKeys case mayToken of Just token -> do atomically $ putTMVar stateToken token forever $ do Except.catch @SomeException websockInit print threadDelay $ 10^6 Nothing -> putStrLn $ "No Discord token in " <> apiPath --r <- getWith opts gatewayURL --let responseText = r ^. responseBody -- murl = join $ Map.lookup "url" <$> (decode responseText :: Maybe (Map String String)) --maybe (return()) websockInit murl
857
runDiscord configt = do setLocaleEncoding utf8 config <- atomically $ do putTMVar stateConfigt configt readTVar configt let apiPath = Tombot._confDirectory config </> "api" apiKeys <- Tombot.readConfig @_ @(Map Text String) apiPath let mayToken = join $ Map.lookup "discord-token" <$> apiKeys case mayToken of Just token -> do atomically $ putTMVar stateToken token forever $ do Except.catch @SomeException websockInit print threadDelay $ 10^6 Nothing -> putStrLn $ "No Discord token in " <> apiPath --r <- getWith opts gatewayURL --let responseText = r ^. responseBody -- murl = join $ Map.lookup "url" <$> (decode responseText :: Maybe (Map String String)) --maybe (return()) websockInit murl
815
false
true
0
16
230
205
93
112
null
null
sherwoodwang/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_FOLDLEVELCONTRACTED :: Int wxSTC_FOLDLEVELCONTRACTED = 65536
66
wxSTC_FOLDLEVELCONTRACTED :: Int wxSTC_FOLDLEVELCONTRACTED = 65536
66
wxSTC_FOLDLEVELCONTRACTED = 65536
33
false
true
0
6
5
18
7
11
null
null
j-rock/strat
src/Game/Lib/Units/Instances.hs
mit
pacifist :: Attacks pacifist = Attack (const Nothing) Nothing
61
pacifist :: Attacks pacifist = Attack (const Nothing) Nothing
61
pacifist = Attack (const Nothing) Nothing
41
false
true
0
7
8
22
11
11
null
null
jprider63/yesod
yesod-core/Yesod/Core/Handler.hs
mit
-- | Type-specialized version of 'sendChunk' for strict @ByteString@s. -- -- @since 1.2.0 sendChunkBS :: Monad m => S.ByteString -> ConduitT i (Flush Builder) m () sendChunkBS = sendChunk
187
sendChunkBS :: Monad m => S.ByteString -> ConduitT i (Flush Builder) m () sendChunkBS = sendChunk
97
sendChunkBS = sendChunk
23
true
true
0
9
28
44
23
21
null
null
Melvar/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
getExps :: [PArg] -> [PTerm] getExps [] = []
44
getExps :: [PArg] -> [PTerm] getExps [] = []
44
getExps [] = []
15
false
true
0
8
8
34
16
18
null
null
ben-schulz/Idris-dev
src/IRTS/Simplified.hs
bsd-3-clause
simplify tl (DChkCase e alts) = do v <- sVar e alts' <- mapM (sAlt tl) alts case v of (x, Nothing) -> return (SChkCase x alts') (Glob x, Just e) -> return (SLet (Glob x) e (SChkCase (Glob x) alts'))
401
simplify tl (DChkCase e alts) = do v <- sVar e alts' <- mapM (sAlt tl) alts case v of (x, Nothing) -> return (SChkCase x alts') (Glob x, Just e) -> return (SLet (Glob x) e (SChkCase (Glob x) alts'))
401
simplify tl (DChkCase e alts) = do v <- sVar e alts' <- mapM (sAlt tl) alts case v of (x, Nothing) -> return (SChkCase x alts') (Glob x, Just e) -> return (SLet (Glob x) e (SChkCase (Glob x) alts'))
401
false
false
0
16
243
128
61
67
null
null
ghc-android/ghc
testsuite/tests/ghci.debugger/scripts/break014.hs
bsd-3-clause
g i = let a = False b = True c = (a,b) in c
63
g i = let a = False b = True c = (a,b) in c
63
g i = let a = False b = True c = (a,b) in c
63
false
false
1
9
34
40
19
21
null
null
brodyberg/LearnHaskell
Web/sqlitetest/Rosalind/2_DNAtoRNA/DnaToRna.hs
mit
swapT :: Char -> Char swapT 'T' = 'U'
37
swapT :: Char -> Char swapT 'T' = 'U'
37
swapT 'T' = 'U'
15
false
true
0
5
8
22
10
12
null
null
tlaitinen/receipts
backend/Handler/DB/Internal.hs
gpl-3.0
selectRestricted :: forall (m :: * -> *). (MonadLogger m, MonadIO m, MonadThrow m, MonadBaseControl IO m) => SqlPersistT m [RestrictedInstance] selectRestricted = do result_File <- select $ from $ \e -> do let _ = e ^. FileId return e result_UserGroup <- select $ from $ \e -> do let _ = e ^. UserGroupId return e result_User <- select $ from $ \e -> do let _ = e ^. UserId return e result_Receipt <- select $ from $ \e -> do let _ = e ^. ReceiptId return e result_ProcessPeriod <- select $ from $ \e -> do let _ = e ^. ProcessPeriodId return e return $ concat [ map RestrictedInstanceFile result_File , map RestrictedInstanceUserGroup result_UserGroup , map RestrictedInstanceUser result_User , map RestrictedInstanceReceipt result_Receipt , map RestrictedInstanceProcessPeriod result_ProcessPeriod ]
992
selectRestricted :: forall (m :: * -> *). (MonadLogger m, MonadIO m, MonadThrow m, MonadBaseControl IO m) => SqlPersistT m [RestrictedInstance] selectRestricted = do result_File <- select $ from $ \e -> do let _ = e ^. FileId return e result_UserGroup <- select $ from $ \e -> do let _ = e ^. UserGroupId return e result_User <- select $ from $ \e -> do let _ = e ^. UserId return e result_Receipt <- select $ from $ \e -> do let _ = e ^. ReceiptId return e result_ProcessPeriod <- select $ from $ \e -> do let _ = e ^. ProcessPeriodId return e return $ concat [ map RestrictedInstanceFile result_File , map RestrictedInstanceUserGroup result_UserGroup , map RestrictedInstanceUser result_User , map RestrictedInstanceReceipt result_Receipt , map RestrictedInstanceProcessPeriod result_ProcessPeriod ]
992
selectRestricted = do result_File <- select $ from $ \e -> do let _ = e ^. FileId return e result_UserGroup <- select $ from $ \e -> do let _ = e ^. UserGroupId return e result_User <- select $ from $ \e -> do let _ = e ^. UserId return e result_Receipt <- select $ from $ \e -> do let _ = e ^. ReceiptId return e result_ProcessPeriod <- select $ from $ \e -> do let _ = e ^. ProcessPeriodId return e return $ concat [ map RestrictedInstanceFile result_File , map RestrictedInstanceUserGroup result_UserGroup , map RestrictedInstanceUser result_User , map RestrictedInstanceReceipt result_Receipt , map RestrictedInstanceProcessPeriod result_ProcessPeriod ]
837
false
true
0
15
323
313
148
165
null
null
codemiller/pirate-gold
src/Transform.hs
apache-2.0
translateWord x = x
19
translateWord x = x
19
translateWord x = x
19
false
false
0
5
3
9
4
5
null
null
DougBurke/swish
tests/N3FormatterTest.hs
lgpl-2.1
tx111 = arc b1 p1 o1
20
tx111 = arc b1 p1 o1
20
tx111 = arc b1 p1 o1
20
false
false
1
5
5
16
6
10
null
null
rodrigogribeiro/mptc
src/Iface/IfaceReader.hs
bsd-3-clause
operator = P.operator lexer
27
operator = P.operator lexer
27
operator = P.operator lexer
27
false
false
0
6
3
11
5
6
null
null
mcmaniac/ghc
compiler/llvmGen/Llvm/Types.hs
bsd-3-clause
getStatType (LMStaticArray _ t) = t
35
getStatType (LMStaticArray _ t) = t
35
getStatType (LMStaticArray _ t) = t
35
false
false
0
7
5
17
8
9
null
null
Fuuzetsu/stack
src/Stack/Fetch.hs
bsd-3-clause
lookupPackageIdentifierExact :: (StackMiniM env m, HasConfig env) => PackageIdentifier -> env -> PackageCaches -> m (Maybe ByteString) lookupPackageIdentifierExact ident env caches = case Map.lookup ident caches of Nothing -> return Nothing Just (index, cache) -> do [bs] <- flip runReaderT env $ withCabalFiles (indexName index) [(ResolvedPackage { rpIdent = ident , rpCache = cache , rpIndex = index }, ())] $ \_ _ bs -> return bs return $ Just bs -- | Given package identifier and package caches, return list of packages -- with the same name and the same two first version number components found -- in the caches.
845
lookupPackageIdentifierExact :: (StackMiniM env m, HasConfig env) => PackageIdentifier -> env -> PackageCaches -> m (Maybe ByteString) lookupPackageIdentifierExact ident env caches = case Map.lookup ident caches of Nothing -> return Nothing Just (index, cache) -> do [bs] <- flip runReaderT env $ withCabalFiles (indexName index) [(ResolvedPackage { rpIdent = ident , rpCache = cache , rpIndex = index }, ())] $ \_ _ bs -> return bs return $ Just bs -- | Given package identifier and package caches, return list of packages -- with the same name and the same two first version number components found -- in the caches.
845
lookupPackageIdentifierExact ident env caches = case Map.lookup ident caches of Nothing -> return Nothing Just (index, cache) -> do [bs] <- flip runReaderT env $ withCabalFiles (indexName index) [(ResolvedPackage { rpIdent = ident , rpCache = cache , rpIndex = index }, ())] $ \_ _ bs -> return bs return $ Just bs -- | Given package identifier and package caches, return list of packages -- with the same name and the same two first version number components found -- in the caches.
700
false
true
0
18
327
186
95
91
null
null
bergmark/hlint
src/Hint/Match.hs
bsd-3-clause
dotVersion (fromApps -> xs) | length xs > 1 = first (apps (init xs) :) <$> dotVersion (fromParen $ last xs)
107
dotVersion (fromApps -> xs) | length xs > 1 = first (apps (init xs) :) <$> dotVersion (fromParen $ last xs)
107
dotVersion (fromApps -> xs) | length xs > 1 = first (apps (init xs) :) <$> dotVersion (fromParen $ last xs)
107
false
false
0
11
20
62
29
33
null
null
ezyang/ghc
compiler/coreSyn/PprCore.hs
bsd-3-clause
pprOptCo :: Coercion -> SDoc -- Print a coercion optionally; i.e. honouring -dsuppress-coercions pprOptCo co = sdocWithDynFlags $ \dflags -> if gopt Opt_SuppressCoercions dflags then angleBrackets (text "Co:" <> int (coercionSize co)) else parens (sep [ppr co, dcolon <+> ppr (coercionType co)])
337
pprOptCo :: Coercion -> SDoc pprOptCo co = sdocWithDynFlags $ \dflags -> if gopt Opt_SuppressCoercions dflags then angleBrackets (text "Co:" <> int (coercionSize co)) else parens (sep [ppr co, dcolon <+> ppr (coercionType co)])
269
pprOptCo co = sdocWithDynFlags $ \dflags -> if gopt Opt_SuppressCoercions dflags then angleBrackets (text "Co:" <> int (coercionSize co)) else parens (sep [ppr co, dcolon <+> ppr (coercionType co)])
240
true
true
0
15
83
94
47
47
null
null
nevrenato/Hets_Fork
GMP/versioning/coloss-0.0.4/examples.coalition.hs
gpl-2.0
phi4 = (cbox [0, 1, 2] (cbox [3, 4, 5] p0)) --> (cbox [0 .. 5] p0)
66
phi4 = (cbox [0, 1, 2] (cbox [3, 4, 5] p0)) --> (cbox [0 .. 5] p0)
66
phi4 = (cbox [0, 1, 2] (cbox [3, 4, 5] p0)) --> (cbox [0 .. 5] p0)
66
false
false
0
10
16
58
33
25
null
null
Soostone/hs-d3
bench/Bench.hs
bsd-3-clause
phantomjs x = do let uri = fromMaybe undefined $ parseURI "http://127.0.0.1:1337" args = [ mkHeader HdrContentLength (show$ length x) , mkHeader HdrContentType "application/x-www-form-urlencoded" ] result <- E.try $ simpleHTTP (Request uri POST args x) >>= getResponseBody case result of Right z -> return () Left (err :: SomeException) -> do evalServer phantomjs x
439
phantomjs x = do let uri = fromMaybe undefined $ parseURI "http://127.0.0.1:1337" args = [ mkHeader HdrContentLength (show$ length x) , mkHeader HdrContentType "application/x-www-form-urlencoded" ] result <- E.try $ simpleHTTP (Request uri POST args x) >>= getResponseBody case result of Right z -> return () Left (err :: SomeException) -> do evalServer phantomjs x
439
phantomjs x = do let uri = fromMaybe undefined $ parseURI "http://127.0.0.1:1337" args = [ mkHeader HdrContentLength (show$ length x) , mkHeader HdrContentType "application/x-www-form-urlencoded" ] result <- E.try $ simpleHTTP (Request uri POST args x) >>= getResponseBody case result of Right z -> return () Left (err :: SomeException) -> do evalServer phantomjs x
439
false
false
1
15
127
142
63
79
null
null
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/Distribution/Simple/Build.hs
bsd-3-clause
initialBuildSteps :: FilePath -- ^"dist" prefix -> PackageDescription -- ^mostly information from the .cabal file -> LocalBuildInfo -- ^Configuration information -> Verbosity -- ^The verbosity to use -> IO () initialBuildSteps _distPref pkg_descr lbi verbosity = do -- check that there's something to build unless (not . null $ allBuildInfo pkg_descr) $ do let name = display (packageId pkg_descr) die $ "No libraries, executables, tests, or benchmarks " ++ "are enabled for package " ++ name ++ "." createDirectoryIfMissingVerbose verbosity True (buildDir lbi) writeAutogenFiles verbosity pkg_descr lbi -- | Generate and write out the Paths_<pkg>.hs and cabal_macros.h files --
777
initialBuildSteps :: FilePath -- ^"dist" prefix -> PackageDescription -- ^mostly information from the .cabal file -> LocalBuildInfo -- ^Configuration information -> Verbosity -- ^The verbosity to use -> IO () initialBuildSteps _distPref pkg_descr lbi verbosity = do -- check that there's something to build unless (not . null $ allBuildInfo pkg_descr) $ do let name = display (packageId pkg_descr) die $ "No libraries, executables, tests, or benchmarks " ++ "are enabled for package " ++ name ++ "." createDirectoryIfMissingVerbose verbosity True (buildDir lbi) writeAutogenFiles verbosity pkg_descr lbi -- | Generate and write out the Paths_<pkg>.hs and cabal_macros.h files --
777
initialBuildSteps _distPref pkg_descr lbi verbosity = do -- check that there's something to build unless (not . null $ allBuildInfo pkg_descr) $ do let name = display (packageId pkg_descr) die $ "No libraries, executables, tests, or benchmarks " ++ "are enabled for package " ++ name ++ "." createDirectoryIfMissingVerbose verbosity True (buildDir lbi) writeAutogenFiles verbosity pkg_descr lbi -- | Generate and write out the Paths_<pkg>.hs and cabal_macros.h files --
495
false
true
0
15
197
136
66
70
null
null
szehk/Haskell-Carbonara-Library
src/Data/Carbonara/Writer.hs
bsd-3-clause
appendListToTuple :: FilePath -> IO () appendListToTuple path = mapM_ (\i -> appendFile path (composeListToTuple i)) [2..62]
124
appendListToTuple :: FilePath -> IO () appendListToTuple path = mapM_ (\i -> appendFile path (composeListToTuple i)) [2..62]
124
appendListToTuple path = mapM_ (\i -> appendFile path (composeListToTuple i)) [2..62]
85
false
true
0
10
16
52
26
26
null
null
wavewave/regstat
exe/regstat.hs
bsd-2-clause
main :: IO () main = do putStrLn "regstat" param <- cmdArgs mode commandLineProcess param
98
main :: IO () main = do putStrLn "regstat" param <- cmdArgs mode commandLineProcess param
97
main = do putStrLn "regstat" param <- cmdArgs mode commandLineProcess param
83
false
true
0
8
23
38
16
22
null
null
SavinaRoja/SavinaRoja.github.io
assets/centraldogma.hs
mit
-- Tyrosine geneticCode "UCA" = 'S'
35
geneticCode "UCA" = 'S'
23
geneticCode "UCA" = 'S'
23
true
false
0
5
5
10
5
5
null
null
haskell-tinc/hpack
src/Hpack/Render.hs
mit
renderPackage :: [String] -> Package -> String renderPackage oldCabalFile = renderPackageWith settings alignment formattingHintsFieldOrder formattingHintsSectionsFieldOrder where FormattingHints{..} = sniffFormattingHints oldCabalFile alignment = fromMaybe 16 formattingHintsAlignment settings = formattingHintsRenderSettings
339
renderPackage :: [String] -> Package -> String renderPackage oldCabalFile = renderPackageWith settings alignment formattingHintsFieldOrder formattingHintsSectionsFieldOrder where FormattingHints{..} = sniffFormattingHints oldCabalFile alignment = fromMaybe 16 formattingHintsAlignment settings = formattingHintsRenderSettings
339
renderPackage oldCabalFile = renderPackageWith settings alignment formattingHintsFieldOrder formattingHintsSectionsFieldOrder where FormattingHints{..} = sniffFormattingHints oldCabalFile alignment = fromMaybe 16 formattingHintsAlignment settings = formattingHintsRenderSettings
292
false
true
2
7
41
67
33
34
null
null
Pancia/loki-lang
src/Parser.hs
mit
parseArray :: Parser LokiVal parseArray = do s <- getState Array (newMeta s) <$> between (char '[' >> spacesInLiteral) (char ']') (manyTill (parseExpr1 <* spacesInLiteral) (lookAhead (char ']')))
337
parseArray :: Parser LokiVal parseArray = do s <- getState Array (newMeta s) <$> between (char '[' >> spacesInLiteral) (char ']') (manyTill (parseExpr1 <* spacesInLiteral) (lookAhead (char ']')))
337
parseArray = do s <- getState Array (newMeta s) <$> between (char '[' >> spacesInLiteral) (char ']') (manyTill (parseExpr1 <* spacesInLiteral) (lookAhead (char ']')))
308
false
true
0
15
169
93
43
50
null
null
randallalexander/LYAH
src/Ch7.hs
bsd-3-clause
chr1 = Char.chr 97
18
chr1 = Char.chr 97
18
chr1 = Char.chr 97
18
false
false
0
6
3
11
5
6
null
null
adbrowne/dynamodb-eventstore
dynamodb-eventstore-web/web/Main.hs
mit
runDynamoCloud' :: RuntimeEnvironment -> EventStore a -> IO (Either EventStoreError a) runDynamoCloud' runtimeEnvironment x = runResourceT $ runAWST runtimeEnvironment $ runExceptT $ x
219
runDynamoCloud' :: RuntimeEnvironment -> EventStore a -> IO (Either EventStoreError a) runDynamoCloud' runtimeEnvironment x = runResourceT $ runAWST runtimeEnvironment $ runExceptT $ x
219
runDynamoCloud' runtimeEnvironment x = runResourceT $ runAWST runtimeEnvironment $ runExceptT $ x
102
false
true
0
9
57
53
25
28
null
null
NICTA/sk-config
src/XMLWrapper.hs
bsd-2-clause
getElements :: Element -> String -> [Element] getElements root name = findElements (qname name) root
100
getElements :: Element -> String -> [Element] getElements root name = findElements (qname name) root
100
getElements root name = findElements (qname name) root
54
false
true
0
7
14
38
19
19
null
null
romanb/amazonka
amazonka-swf/gen/Network/AWS/SWF/Types.hs
mpl-2.0
-- | If the event is of type 'StartTimerFailed' then this member is set and provides -- detailed information about the event. It is not set for other event types. heStartTimerFailedEventAttributes :: Lens' HistoryEvent (Maybe StartTimerFailedEventAttributes) heStartTimerFailedEventAttributes = lens _heStartTimerFailedEventAttributes (\s a -> s { _heStartTimerFailedEventAttributes = a })
401
heStartTimerFailedEventAttributes :: Lens' HistoryEvent (Maybe StartTimerFailedEventAttributes) heStartTimerFailedEventAttributes = lens _heStartTimerFailedEventAttributes (\s a -> s { _heStartTimerFailedEventAttributes = a })
238
heStartTimerFailedEventAttributes = lens _heStartTimerFailedEventAttributes (\s a -> s { _heStartTimerFailedEventAttributes = a })
142
true
true
0
9
60
47
26
21
null
null
sdiehl/ghc
ghc/Main.hs
bsd-3-clause
dumpFinalStats :: DynFlags -> IO () dumpFinalStats dflags = when (gopt Opt_D_faststring_stats dflags) $ dumpFastStringStats dflags
132
dumpFinalStats :: DynFlags -> IO () dumpFinalStats dflags = when (gopt Opt_D_faststring_stats dflags) $ dumpFastStringStats dflags
132
dumpFinalStats dflags = when (gopt Opt_D_faststring_stats dflags) $ dumpFastStringStats dflags
96
false
true
0
8
17
41
19
22
null
null
andywhardy/haskell-gae
src/Main.hs
bsd-3-clause
first :: TodoItem first = TodoItem { id = 1, description = "Do this first", done = True }
89
first :: TodoItem first = TodoItem { id = 1, description = "Do this first", done = True }
89
first = TodoItem { id = 1, description = "Do this first", done = True }
71
false
true
0
6
18
31
19
12
null
null
silky/Tidal
Sound/Tidal/Parse.hs
gpl-3.0
pDensity :: Parser (Rational) pDensity = angles (pRatio <?> "ratio") <|> return (1 % 1)
109
pDensity :: Parser (Rational) pDensity = angles (pRatio <?> "ratio") <|> return (1 % 1)
109
pDensity = angles (pRatio <?> "ratio") <|> return (1 % 1)
79
false
true
4
7
36
47
23
24
null
null
wuzzeb/yesod
yesod-core/Yesod/Core/Internal/Run.hs
mit
-- | Function used internally by Yesod in the process of converting a -- 'HandlerT' into an 'Application'. Should not be needed by users. runHandler :: ToTypedContent c => RunHandlerEnv site -> HandlerT site IO c -> YesodApp runHandler rhe@RunHandlerEnv {..} handler yreq = withInternalState $ \resState -> do let toErrorHandler e = case fromException e of Just (HCError x) -> x _ -> InternalError $ T.pack $ show e istate <- liftIO $ I.newIORef GHState { ghsSession = reqSession yreq , ghsRBC = Nothing , ghsIdent = 1 , ghsCache = mempty , ghsCacheBy = mempty , ghsHeaders = mempty } let hd = HandlerData { handlerRequest = yreq , handlerEnv = rhe , handlerState = istate , handlerToParent = const () , handlerResource = resState } contents' <- catch (fmap Right $ unHandlerT handler hd) (\e -> return $ Left $ maybe (HCError $ toErrorHandler e) id $ fromException e) state <- liftIO $ I.readIORef istate (finalSession, mcontents1) <- (do finalSession <- returnDeepSessionMap (ghsSession state) return (finalSession, Nothing)) `E.catch` \e -> return (Map.empty, Just $! HCError $! InternalError $! T.pack $! show (e :: E.SomeException)) (headers, mcontents2) <- (do headers <- return $!! appEndo (ghsHeaders state) [] return (headers, Nothing)) `E.catch` \e -> return ([], Just $! HCError $! InternalError $! T.pack $! show (e :: E.SomeException)) let contents = case mcontents1 `mplus` mcontents2 of Just x -> x Nothing -> either id (HCContent defaultStatus . toTypedContent) contents' let handleError e = flip runInternalState resState $ do yar <- rheOnError e yreq { reqSession = finalSession } case yar of YRPlain status' hs ct c sess -> let hs' = headers ++ hs status | status' == defaultStatus = getStatus e | otherwise = status' in return $ YRPlain status hs' ct c sess YRWai _ -> return yar YRWaiApp _ -> return yar let sendFile' ct fp p = return $ YRPlain H.status200 headers ct (ContentFile fp p) finalSession contents1 <- evaluate contents `E.catch` \e -> return (HCError $! InternalError $! T.pack $! show (e :: E.SomeException)) case contents1 of HCContent status (TypedContent ct c) -> do ec' <- liftIO $ evaluateContent c case ec' of Left e -> handleError e Right c' -> return $ YRPlain status headers ct c' finalSession HCError e -> handleError e HCRedirect status loc -> do let disable_caching x = Header "Cache-Control" "no-cache, must-revalidate" : Header "Expires" "Thu, 01 Jan 1970 05:05:05 GMT" : x hs = (if status /= H.movedPermanently301 then disable_caching else id) $ Header "Location" (encodeUtf8 loc) : headers return $ YRPlain status hs typePlain emptyContent finalSession HCSendFile ct fp p -> catch (sendFile' ct fp p) (handleError . toErrorHandler) HCCreated loc -> do let hs = Header "Location" (encodeUtf8 loc) : headers return $ YRPlain H.status201 hs typePlain emptyContent finalSession HCWai r -> return $ YRWai r HCWaiApp a -> return $ YRWaiApp a
3,918
runHandler :: ToTypedContent c => RunHandlerEnv site -> HandlerT site IO c -> YesodApp runHandler rhe@RunHandlerEnv {..} handler yreq = withInternalState $ \resState -> do let toErrorHandler e = case fromException e of Just (HCError x) -> x _ -> InternalError $ T.pack $ show e istate <- liftIO $ I.newIORef GHState { ghsSession = reqSession yreq , ghsRBC = Nothing , ghsIdent = 1 , ghsCache = mempty , ghsCacheBy = mempty , ghsHeaders = mempty } let hd = HandlerData { handlerRequest = yreq , handlerEnv = rhe , handlerState = istate , handlerToParent = const () , handlerResource = resState } contents' <- catch (fmap Right $ unHandlerT handler hd) (\e -> return $ Left $ maybe (HCError $ toErrorHandler e) id $ fromException e) state <- liftIO $ I.readIORef istate (finalSession, mcontents1) <- (do finalSession <- returnDeepSessionMap (ghsSession state) return (finalSession, Nothing)) `E.catch` \e -> return (Map.empty, Just $! HCError $! InternalError $! T.pack $! show (e :: E.SomeException)) (headers, mcontents2) <- (do headers <- return $!! appEndo (ghsHeaders state) [] return (headers, Nothing)) `E.catch` \e -> return ([], Just $! HCError $! InternalError $! T.pack $! show (e :: E.SomeException)) let contents = case mcontents1 `mplus` mcontents2 of Just x -> x Nothing -> either id (HCContent defaultStatus . toTypedContent) contents' let handleError e = flip runInternalState resState $ do yar <- rheOnError e yreq { reqSession = finalSession } case yar of YRPlain status' hs ct c sess -> let hs' = headers ++ hs status | status' == defaultStatus = getStatus e | otherwise = status' in return $ YRPlain status hs' ct c sess YRWai _ -> return yar YRWaiApp _ -> return yar let sendFile' ct fp p = return $ YRPlain H.status200 headers ct (ContentFile fp p) finalSession contents1 <- evaluate contents `E.catch` \e -> return (HCError $! InternalError $! T.pack $! show (e :: E.SomeException)) case contents1 of HCContent status (TypedContent ct c) -> do ec' <- liftIO $ evaluateContent c case ec' of Left e -> handleError e Right c' -> return $ YRPlain status headers ct c' finalSession HCError e -> handleError e HCRedirect status loc -> do let disable_caching x = Header "Cache-Control" "no-cache, must-revalidate" : Header "Expires" "Thu, 01 Jan 1970 05:05:05 GMT" : x hs = (if status /= H.movedPermanently301 then disable_caching else id) $ Header "Location" (encodeUtf8 loc) : headers return $ YRPlain status hs typePlain emptyContent finalSession HCSendFile ct fp p -> catch (sendFile' ct fp p) (handleError . toErrorHandler) HCCreated loc -> do let hs = Header "Location" (encodeUtf8 loc) : headers return $ YRPlain H.status201 hs typePlain emptyContent finalSession HCWai r -> return $ YRWai r HCWaiApp a -> return $ YRWaiApp a
3,780
runHandler rhe@RunHandlerEnv {..} handler yreq = withInternalState $ \resState -> do let toErrorHandler e = case fromException e of Just (HCError x) -> x _ -> InternalError $ T.pack $ show e istate <- liftIO $ I.newIORef GHState { ghsSession = reqSession yreq , ghsRBC = Nothing , ghsIdent = 1 , ghsCache = mempty , ghsCacheBy = mempty , ghsHeaders = mempty } let hd = HandlerData { handlerRequest = yreq , handlerEnv = rhe , handlerState = istate , handlerToParent = const () , handlerResource = resState } contents' <- catch (fmap Right $ unHandlerT handler hd) (\e -> return $ Left $ maybe (HCError $ toErrorHandler e) id $ fromException e) state <- liftIO $ I.readIORef istate (finalSession, mcontents1) <- (do finalSession <- returnDeepSessionMap (ghsSession state) return (finalSession, Nothing)) `E.catch` \e -> return (Map.empty, Just $! HCError $! InternalError $! T.pack $! show (e :: E.SomeException)) (headers, mcontents2) <- (do headers <- return $!! appEndo (ghsHeaders state) [] return (headers, Nothing)) `E.catch` \e -> return ([], Just $! HCError $! InternalError $! T.pack $! show (e :: E.SomeException)) let contents = case mcontents1 `mplus` mcontents2 of Just x -> x Nothing -> either id (HCContent defaultStatus . toTypedContent) contents' let handleError e = flip runInternalState resState $ do yar <- rheOnError e yreq { reqSession = finalSession } case yar of YRPlain status' hs ct c sess -> let hs' = headers ++ hs status | status' == defaultStatus = getStatus e | otherwise = status' in return $ YRPlain status hs' ct c sess YRWai _ -> return yar YRWaiApp _ -> return yar let sendFile' ct fp p = return $ YRPlain H.status200 headers ct (ContentFile fp p) finalSession contents1 <- evaluate contents `E.catch` \e -> return (HCError $! InternalError $! T.pack $! show (e :: E.SomeException)) case contents1 of HCContent status (TypedContent ct c) -> do ec' <- liftIO $ evaluateContent c case ec' of Left e -> handleError e Right c' -> return $ YRPlain status headers ct c' finalSession HCError e -> handleError e HCRedirect status loc -> do let disable_caching x = Header "Cache-Control" "no-cache, must-revalidate" : Header "Expires" "Thu, 01 Jan 1970 05:05:05 GMT" : x hs = (if status /= H.movedPermanently301 then disable_caching else id) $ Header "Location" (encodeUtf8 loc) : headers return $ YRPlain status hs typePlain emptyContent finalSession HCSendFile ct fp p -> catch (sendFile' ct fp p) (handleError . toErrorHandler) HCCreated loc -> do let hs = Header "Location" (encodeUtf8 loc) : headers return $ YRPlain H.status201 hs typePlain emptyContent finalSession HCWai r -> return $ YRWai r HCWaiApp a -> return $ YRWaiApp a
3,660
true
true
0
25
1,509
1,109
543
566
null
null
tweag/distributed-process
src/Control/Distributed/Process/Internal/Types.hs
bsd-3-clause
localProcesses :: Accessor ValidLocalNodeState (Map LocalProcessId LocalProcess) localProcesses = accessor _localProcesses (\procs st -> st { _localProcesses = procs })
168
localProcesses :: Accessor ValidLocalNodeState (Map LocalProcessId LocalProcess) localProcesses = accessor _localProcesses (\procs st -> st { _localProcesses = procs })
168
localProcesses = accessor _localProcesses (\procs st -> st { _localProcesses = procs })
87
false
true
0
9
19
47
25
22
null
null
ankhers/haskell-ide-engine
test/ExtensibleStateSpec.hs
bsd-3-clause
mkCmdWithContext ::(ValidResponse a) => CommandFunc a -> CommandName -> [AcceptedContext] -> [ParamDescription] -> UntaggedCommand mkCmdWithContext cmd n cts pds = Command { cmdDesc = CommandDesc { cmdName = n , cmdUiDescription = "description" , cmdFileExtensions = [] , cmdContexts = cts , cmdAdditionalParams = pds , cmdReturnType = "Text" , cmdSave = SaveNone } , cmdFunc = cmd }
630
mkCmdWithContext ::(ValidResponse a) => CommandFunc a -> CommandName -> [AcceptedContext] -> [ParamDescription] -> UntaggedCommand mkCmdWithContext cmd n cts pds = Command { cmdDesc = CommandDesc { cmdName = n , cmdUiDescription = "description" , cmdFileExtensions = [] , cmdContexts = cts , cmdAdditionalParams = pds , cmdReturnType = "Text" , cmdSave = SaveNone } , cmdFunc = cmd }
630
mkCmdWithContext cmd n cts pds = Command { cmdDesc = CommandDesc { cmdName = n , cmdUiDescription = "description" , cmdFileExtensions = [] , cmdContexts = cts , cmdAdditionalParams = pds , cmdReturnType = "Text" , cmdSave = SaveNone } , cmdFunc = cmd }
482
false
true
0
10
305
114
67
47
null
null
Gabriel439/succinct
src/Succinct/Internal/Level.hs
bsd-2-clause
s16 :: Delta -> (Int16,Int16,Int16) s16 (Delta e m n) = (fromIntegral e, fromIntegral m, fromIntegral n)
104
s16 :: Delta -> (Int16,Int16,Int16) s16 (Delta e m n) = (fromIntegral e, fromIntegral m, fromIntegral n)
104
s16 (Delta e m n) = (fromIntegral e, fromIntegral m, fromIntegral n)
68
false
true
0
9
16
61
30
31
null
null
FranklinChen/Hugs
tests/misc/gc.hs
bsd-3-clause
-- All these tests should be run in a freshly started system -- and with the specified heap size/ heap configuration. -- -- (Of course, they should run successfully in a non-fresh system, -- with different heap sizes, etc. - but they've been known to fail -- with the specified size.) -- build Hugs with all gc tests turned on and run with a small heap. -- 27/11/95: This test works fine - but fails when entered on the -- command line. The difference must be that the top level -- thunk isn't being treated as a root by the GC system. -- 3/6/96: Requires 210kbyte heap to run - which is double the size of -- the string it generates. This has to get stored since -- test1 is a CAF and the 2-space GC doubles the requirement. -- If evaluated on the command line, it runs in 16kbytes -- which is about the smallest possible heap given the -- setting of minRecovery (1000), the size of a cell (8 bytes) -- and the GC's need for two equally size semispaces. test1 = show [1..1500]
1,035
test1 = show [1..1500]
22
test1 = show [1..1500]
22
true
false
1
6
243
35
24
11
null
null
angelworm/Kikka
Config.example.hs
bsd-3-clause
serv2 = { host = "irc.ircnet.ne.jp" , port = PortNumber 6667 , nick = "kikka" , user = User { username = "kikka" , hostname = "irc.ircnet.ne.jp" , servername = "localhost" , realname = "Nakajima Kikka" } , pass = "xxx" }
363
serv2 = { host = "irc.ircnet.ne.jp" , port = PortNumber 6667 , nick = "kikka" , user = User { username = "kikka" , hostname = "irc.ircnet.ne.jp" , servername = "localhost" , realname = "Nakajima Kikka" } , pass = "xxx" }
363
serv2 = { host = "irc.ircnet.ne.jp" , port = PortNumber 6667 , nick = "kikka" , user = User { username = "kikka" , hostname = "irc.ircnet.ne.jp" , servername = "localhost" , realname = "Nakajima Kikka" } , pass = "xxx" }
363
false
false
15
6
184
89
42
47
null
null
Concomitant/LambdaHack
Game/LambdaHack/Common/Actor.hs
bsd-3-clause
verbCStore :: CStore -> Text verbCStore CGround = "drop"
56
verbCStore :: CStore -> Text verbCStore CGround = "drop"
56
verbCStore CGround = "drop"
27
false
true
0
7
8
24
10
14
null
null
soenkehahn/edith
Edith/Core.hs
agpl-3.0
resetCursor :: Integer -> Edith () resetCursor bufferHeight = do position <- scrolledCursorPosition . buffer_ <$> get when (fst position > bufferHeight) $ error (show position) lift $ do def <- defaultWindow updateWindow def $ do uncurry moveCursor (secondA ^: (+ 8) $ position)
326
resetCursor :: Integer -> Edith () resetCursor bufferHeight = do position <- scrolledCursorPosition . buffer_ <$> get when (fst position > bufferHeight) $ error (show position) lift $ do def <- defaultWindow updateWindow def $ do uncurry moveCursor (secondA ^: (+ 8) $ position)
326
resetCursor bufferHeight = do position <- scrolledCursorPosition . buffer_ <$> get when (fst position > bufferHeight) $ error (show position) lift $ do def <- defaultWindow updateWindow def $ do uncurry moveCursor (secondA ^: (+ 8) $ position)
291
false
true
0
17
91
114
53
61
null
null
anton-k/sharc-timbre
src/Sharc/Instruments/ViolinMuted.hs
bsd-3-clause
note6 :: Note note6 = Note (Pitch 277.183 49 "c#4") 7 (Range (NoteRange (NoteRangeAmplitude 9147.03 33 0.38) (NoteRangeHarmonicFreq 1 277.18)) (NoteRange (NoteRangeAmplitude 277.18 1 5857.0) (NoteRangeHarmonicFreq 36 9978.58))) [Harmonic 1 1.432 5857.0 ,Harmonic 2 (-0.113) 1673.49 ,Harmonic 3 2.708 1623.19 ,Harmonic 4 3.022 345.33 ,Harmonic 5 2.391 382.01 ,Harmonic 6 1.912 138.94 ,Harmonic 7 0.963 243.36 ,Harmonic 8 0.771 51.16 ,Harmonic 9 0.305 39.41 ,Harmonic 10 1.559 87.89 ,Harmonic 11 0.164 49.29 ,Harmonic 12 0.416 42.41 ,Harmonic 13 0.475 24.88 ,Harmonic 14 (-2.06) 9.87 ,Harmonic 15 1.375 11.16 ,Harmonic 16 0.633 11.67 ,Harmonic 17 0.899 17.95 ,Harmonic 18 2.71 7.79 ,Harmonic 19 (-1.63) 5.05 ,Harmonic 20 (-2.345) 3.93 ,Harmonic 21 2.127 3.92 ,Harmonic 22 (-2.258) 3.66 ,Harmonic 23 (-0.261) 4.77 ,Harmonic 24 (-2.604) 3.59 ,Harmonic 25 (-0.595) 2.15 ,Harmonic 26 (-2.331) 4.04 ,Harmonic 27 7.1e-2 3.41 ,Harmonic 28 3.062 5.17 ,Harmonic 29 (-0.269) 9.35 ,Harmonic 30 2.569 6.12 ,Harmonic 31 (-0.441) 0.79 ,Harmonic 32 (-2.749) 4.39 ,Harmonic 33 0.412 0.38 ,Harmonic 34 (-2.834) 2.23 ,Harmonic 35 (-3.069) 0.72 ,Harmonic 36 1.844 0.63]
1,368
note6 :: Note note6 = Note (Pitch 277.183 49 "c#4") 7 (Range (NoteRange (NoteRangeAmplitude 9147.03 33 0.38) (NoteRangeHarmonicFreq 1 277.18)) (NoteRange (NoteRangeAmplitude 277.18 1 5857.0) (NoteRangeHarmonicFreq 36 9978.58))) [Harmonic 1 1.432 5857.0 ,Harmonic 2 (-0.113) 1673.49 ,Harmonic 3 2.708 1623.19 ,Harmonic 4 3.022 345.33 ,Harmonic 5 2.391 382.01 ,Harmonic 6 1.912 138.94 ,Harmonic 7 0.963 243.36 ,Harmonic 8 0.771 51.16 ,Harmonic 9 0.305 39.41 ,Harmonic 10 1.559 87.89 ,Harmonic 11 0.164 49.29 ,Harmonic 12 0.416 42.41 ,Harmonic 13 0.475 24.88 ,Harmonic 14 (-2.06) 9.87 ,Harmonic 15 1.375 11.16 ,Harmonic 16 0.633 11.67 ,Harmonic 17 0.899 17.95 ,Harmonic 18 2.71 7.79 ,Harmonic 19 (-1.63) 5.05 ,Harmonic 20 (-2.345) 3.93 ,Harmonic 21 2.127 3.92 ,Harmonic 22 (-2.258) 3.66 ,Harmonic 23 (-0.261) 4.77 ,Harmonic 24 (-2.604) 3.59 ,Harmonic 25 (-0.595) 2.15 ,Harmonic 26 (-2.331) 4.04 ,Harmonic 27 7.1e-2 3.41 ,Harmonic 28 3.062 5.17 ,Harmonic 29 (-0.269) 9.35 ,Harmonic 30 2.569 6.12 ,Harmonic 31 (-0.441) 0.79 ,Harmonic 32 (-2.749) 4.39 ,Harmonic 33 0.412 0.38 ,Harmonic 34 (-2.834) 2.23 ,Harmonic 35 (-3.069) 0.72 ,Harmonic 36 1.844 0.63]
1,368
note6 = Note (Pitch 277.183 49 "c#4") 7 (Range (NoteRange (NoteRangeAmplitude 9147.03 33 0.38) (NoteRangeHarmonicFreq 1 277.18)) (NoteRange (NoteRangeAmplitude 277.18 1 5857.0) (NoteRangeHarmonicFreq 36 9978.58))) [Harmonic 1 1.432 5857.0 ,Harmonic 2 (-0.113) 1673.49 ,Harmonic 3 2.708 1623.19 ,Harmonic 4 3.022 345.33 ,Harmonic 5 2.391 382.01 ,Harmonic 6 1.912 138.94 ,Harmonic 7 0.963 243.36 ,Harmonic 8 0.771 51.16 ,Harmonic 9 0.305 39.41 ,Harmonic 10 1.559 87.89 ,Harmonic 11 0.164 49.29 ,Harmonic 12 0.416 42.41 ,Harmonic 13 0.475 24.88 ,Harmonic 14 (-2.06) 9.87 ,Harmonic 15 1.375 11.16 ,Harmonic 16 0.633 11.67 ,Harmonic 17 0.899 17.95 ,Harmonic 18 2.71 7.79 ,Harmonic 19 (-1.63) 5.05 ,Harmonic 20 (-2.345) 3.93 ,Harmonic 21 2.127 3.92 ,Harmonic 22 (-2.258) 3.66 ,Harmonic 23 (-0.261) 4.77 ,Harmonic 24 (-2.604) 3.59 ,Harmonic 25 (-0.595) 2.15 ,Harmonic 26 (-2.331) 4.04 ,Harmonic 27 7.1e-2 3.41 ,Harmonic 28 3.062 5.17 ,Harmonic 29 (-0.269) 9.35 ,Harmonic 30 2.569 6.12 ,Harmonic 31 (-0.441) 0.79 ,Harmonic 32 (-2.749) 4.39 ,Harmonic 33 0.412 0.38 ,Harmonic 34 (-2.834) 2.23 ,Harmonic 35 (-3.069) 0.72 ,Harmonic 36 1.844 0.63]
1,354
false
true
0
10
391
523
267
256
null
null
sdiehl/ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
-- Argument of a function application opPrec = 3
50
opPrec = 3
12
opPrec = 3
12
true
false
1
5
10
11
4
7
null
null
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/PublicDelegatedPrefixes/AggregatedList.hs
mpl-2.0
-- | Creates a value of 'PublicDelegatedPrefixesAggregatedList' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'pdpalIncludeAllScopes' -- -- * 'pdpalReturnPartialSuccess' -- -- * 'pdpalOrderBy' -- -- * 'pdpalProject' -- -- * 'pdpalFilter' -- -- * 'pdpalPageToken' -- -- * 'pdpalMaxResults' publicDelegatedPrefixesAggregatedList :: Text -- ^ 'pdpalProject' -> PublicDelegatedPrefixesAggregatedList publicDelegatedPrefixesAggregatedList pPdpalProject_ = PublicDelegatedPrefixesAggregatedList' { _pdpalIncludeAllScopes = Nothing , _pdpalReturnPartialSuccess = Nothing , _pdpalOrderBy = Nothing , _pdpalProject = pPdpalProject_ , _pdpalFilter = Nothing , _pdpalPageToken = Nothing , _pdpalMaxResults = 500 }
831
publicDelegatedPrefixesAggregatedList :: Text -- ^ 'pdpalProject' -> PublicDelegatedPrefixesAggregatedList publicDelegatedPrefixesAggregatedList pPdpalProject_ = PublicDelegatedPrefixesAggregatedList' { _pdpalIncludeAllScopes = Nothing , _pdpalReturnPartialSuccess = Nothing , _pdpalOrderBy = Nothing , _pdpalProject = pPdpalProject_ , _pdpalFilter = Nothing , _pdpalPageToken = Nothing , _pdpalMaxResults = 500 }
455
publicDelegatedPrefixesAggregatedList pPdpalProject_ = PublicDelegatedPrefixesAggregatedList' { _pdpalIncludeAllScopes = Nothing , _pdpalReturnPartialSuccess = Nothing , _pdpalOrderBy = Nothing , _pdpalProject = pPdpalProject_ , _pdpalFilter = Nothing , _pdpalPageToken = Nothing , _pdpalMaxResults = 500 }
340
true
true
0
7
140
89
58
31
null
null
terrelln/air-types
src/AirType/Helpers.hs
mit
fromInput L3 = ['c', 'd', 'e']
30
fromInput L3 = ['c', 'd', 'e']
30
fromInput L3 = ['c', 'd', 'e']
30
false
false
0
5
5
18
10
8
null
null
creichert/persistent
persistent/Database/Persist/Sql/Migration.hs
mit
-- | Add a 'CautiousMigration' (aka a @[('Bool', 'Text')]@) to the -- migration plan. -- -- @since 2.9.2 addMigrations :: CautiousMigration -> Migration addMigrations = lift . tell
188
addMigrations :: CautiousMigration -> Migration addMigrations = lift . tell
83
addMigrations = lift . tell
27
true
true
0
5
35
23
14
9
null
null
Icelandjack/lens
src/Language/Haskell/TH/Lens.hs
bsd-3-clause
conNamedFields f (ForallC a b fs) = ForallC a b <$> conNamedFields f fs
71
conNamedFields f (ForallC a b fs) = ForallC a b <$> conNamedFields f fs
71
conNamedFields f (ForallC a b fs) = ForallC a b <$> conNamedFields f fs
71
false
false
0
7
13
35
16
19
null
null
Peaker/lamdu
src/Lamdu/Sugar/Internal.hs
gpl-3.0
nameWithoutContext :: T.Tag -> InternalName nameWithoutContext tag = InternalName { _inContext = Nothing , _inTag = tag , _inIsAutoName = False }
165
nameWithoutContext :: T.Tag -> InternalName nameWithoutContext tag = InternalName { _inContext = Nothing , _inTag = tag , _inIsAutoName = False }
165
nameWithoutContext tag = InternalName { _inContext = Nothing , _inTag = tag , _inIsAutoName = False }
121
false
true
0
6
41
40
23
17
null
null
fehu/itesm-ga
src/Parcial2/Examples/ChromosomeExample.hs
mit
prepareRoutes (srp:t) accFst accSnd = uncurry (prepareRoutes t) next where next = case srp of SubRoutes _ _ (Left donor) _ -> (donor:accFst, accSnd) SubRoutes _ _ (Right donor) _ -> (accFst, donor:accSnd)
232
prepareRoutes (srp:t) accFst accSnd = uncurry (prepareRoutes t) next where next = case srp of SubRoutes _ _ (Left donor) _ -> (donor:accFst, accSnd) SubRoutes _ _ (Right donor) _ -> (accFst, donor:accSnd)
232
prepareRoutes (srp:t) accFst accSnd = uncurry (prepareRoutes t) next where next = case srp of SubRoutes _ _ (Left donor) _ -> (donor:accFst, accSnd) SubRoutes _ _ (Right donor) _ -> (accFst, donor:accSnd)
232
false
false
0
12
60
104
53
51
null
null
ku-fpg/diagrams-canvas
examples/Geom.hs
bsd-3-clause
aHead :: Diagram B R2 aHead = aLabel <> rsinaLabel <> rLabel <> rcosaLabel <> lengthLabel <> back # lc red <> chord <> r1 <> rTheta <> rMid <> thetaArc <> dot <> sircle <> hd
185
aHead :: Diagram B R2 aHead = aLabel <> rsinaLabel <> rLabel <> rcosaLabel <> lengthLabel <> back # lc red <> chord <> r1 <> rTheta <> rMid <> thetaArc <> dot <> sircle <> hd
185
aHead = aLabel <> rsinaLabel <> rLabel <> rcosaLabel <> lengthLabel <> back # lc red <> chord <> r1 <> rTheta <> rMid <> thetaArc <> dot <> sircle <> hd
163
false
true
10
8
47
81
37
44
null
null
tolysz/rawstring-qm
src/Data/String/QM.hs
bsd-3-clause
unQM a ('}':xs) = AntiQuote (reverse a) : parseQM [] xs
58
unQM a ('}':xs) = AntiQuote (reverse a) : parseQM [] xs
58
unQM a ('}':xs) = AntiQuote (reverse a) : parseQM [] xs
58
false
false
0
8
13
38
18
20
null
null
google/codeworld
codeworld-compiler/src/CodeWorld/Compile/Requirements/Eval.hs
apache-2.0
checkRule (OnFailure msg rule) = do result <- checkRule rule case result of Just (_ : _) -> failure msg other -> return other
137
checkRule (OnFailure msg rule) = do result <- checkRule rule case result of Just (_ : _) -> failure msg other -> return other
137
checkRule (OnFailure msg rule) = do result <- checkRule rule case result of Just (_ : _) -> failure msg other -> return other
137
false
false
0
12
35
62
28
34
null
null
seckcoder/lang-learn
haskell/lambda-calculus/src/Demo/ReaderT.hs
unlicense
interp (Var n) = ask >>= \r -> case (lookup n r) of Just x -> return x Nothing -> error ("unbound variable: " ++ n)
139
interp (Var n) = ask >>= \r -> case (lookup n r) of Just x -> return x Nothing -> error ("unbound variable: " ++ n)
139
interp (Var n) = ask >>= \r -> case (lookup n r) of Just x -> return x Nothing -> error ("unbound variable: " ++ n)
139
false
false
2
11
49
67
32
35
null
null
brendanhay/gogol
gogol-commentanalyzer/gen/Network/Google/CommentAnalyzer/Types/Product.hs
mpl-2.0
-- | Creates a value of 'SuggestCommentScoreResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'scsrDetectedLanguages' -- -- * 'scsrClientToken' -- -- * 'scsrRequestedLanguages' suggestCommentScoreResponse :: SuggestCommentScoreResponse suggestCommentScoreResponse = SuggestCommentScoreResponse' { _scsrDetectedLanguages = Nothing , _scsrClientToken = Nothing , _scsrRequestedLanguages = Nothing }
511
suggestCommentScoreResponse :: SuggestCommentScoreResponse suggestCommentScoreResponse = SuggestCommentScoreResponse' { _scsrDetectedLanguages = Nothing , _scsrClientToken = Nothing , _scsrRequestedLanguages = Nothing }
241
suggestCommentScoreResponse = SuggestCommentScoreResponse' { _scsrDetectedLanguages = Nothing , _scsrClientToken = Nothing , _scsrRequestedLanguages = Nothing }
178
true
true
1
7
82
47
29
18
null
null
lnunno/blaze-bootstrap3
Bootstrap3/Utils.hs
mit
{- Wrap all outmost tags with a <li></li>. -} toHtmlLs :: [Html] -> [Html] toHtmlLs ls = map (\h -> li h) ls
128
toHtmlLs :: [Html] -> [Html] toHtmlLs ls = map (\h -> li h) ls
62
toHtmlLs ls = map (\h -> li h) ls
33
true
true
0
8
42
41
22
19
null
null
brendanhay/gogol
gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/Clusters/SetIAMPolicy.hs
mpl-2.0
-- | V1 error format. prcsipXgafv :: Lens' ProjectsRegionsClustersSetIAMPolicy (Maybe Xgafv) prcsipXgafv = lens _prcsipXgafv (\ s a -> s{_prcsipXgafv = a})
157
prcsipXgafv :: Lens' ProjectsRegionsClustersSetIAMPolicy (Maybe Xgafv) prcsipXgafv = lens _prcsipXgafv (\ s a -> s{_prcsipXgafv = a})
135
prcsipXgafv = lens _prcsipXgafv (\ s a -> s{_prcsipXgafv = a})
64
true
true
0
9
23
48
25
23
null
null
eugenkiss/loopgotowhile
src/Language/LoopGotoWhile/While/Strict.hs
bsd-3-clause
eval' env (Assign i j Minus c) = do xj <- getVar env j setVar env i $! (max (xj - c) 0)
95
eval' env (Assign i j Minus c) = do xj <- getVar env j setVar env i $! (max (xj - c) 0)
95
eval' env (Assign i j Minus c) = do xj <- getVar env j setVar env i $! (max (xj - c) 0)
95
false
false
0
11
30
64
29
35
null
null
Shaac/chartleston
src/note.hs
gpl-3.0
-- Get the velocity (i.e. the strength) of a note. velocity :: Note -> Velocity velocity (Note (_, v)) | v == 127 = Accent
127
velocity :: Note -> Velocity velocity (Note (_, v)) | v == 127 = Accent
76
velocity (Note (_, v)) | v == 127 = Accent
47
true
true
0
10
29
47
22
25
null
null
beni55/hermit
src/HERMIT/Dictionary/Common.hs
bsd-2-clause
-- | List all variables bound by a case expression (in the alternatives and the case binder). caseVarsT :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, Monad m) => Transform c m CoreExpr [Var] caseVarsT = caseT mempty idR mempty (\ _ -> arr altVars) (\ () v () vss -> v : nub (concat vss))
298
caseVarsT :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, Monad m) => Transform c m CoreExpr [Var] caseVarsT = caseT mempty idR mempty (\ _ -> arr altVars) (\ () v () vss -> v : nub (concat vss))
204
caseVarsT = caseT mempty idR mempty (\ _ -> arr altVars) (\ () v () vss -> v : nub (concat vss))
96
true
true
0
11
56
114
57
57
null
null
Skyfold/postgrest
src/PostgREST/OpenAPI.hs
mit
isAuthorityValid :: URI -> Bool isAuthorityValid URI {uriAuthority = a} | isJust a = fAnd [isUserInfoValid, isHostValid, isPortValid] $ fromJust a | otherwise = False
170
isAuthorityValid :: URI -> Bool isAuthorityValid URI {uriAuthority = a} | isJust a = fAnd [isUserInfoValid, isHostValid, isPortValid] $ fromJust a | otherwise = False
170
isAuthorityValid URI {uriAuthority = a} | isJust a = fAnd [isUserInfoValid, isHostValid, isPortValid] $ fromJust a | otherwise = False
138
false
true
0
8
28
64
31
33
null
null
dmjio/stripe
stripe-core/src/Web/Stripe/Types/Util.hs
mit
------------------------------------------------------------------------------ -- | Helper for retrieving `AccountId` getAccountId :: AccountId -> Text getAccountId (AccountId x) = x
182
getAccountId :: AccountId -> Text getAccountId (AccountId x) = x
64
getAccountId (AccountId x) = x
30
true
true
0
7
16
26
14
12
null
null
kRITZCREEK/clippy-api
clippy-lib/Clippy/ES.hs
gpl-3.0
withBH' :: BH IO a -> IO a withBH' = withBH defaultManagerSettings testServer
77
withBH' :: BH IO a -> IO a withBH' = withBH defaultManagerSettings testServer
77
withBH' = withBH defaultManagerSettings testServer
50
false
true
0
7
12
34
14
20
null
null
jkozlowski/kdb-haskell
src/Database/Kdb/Internal/Types/KdbTypes.hs
mit
-- | Kdb @Word8@ value for Minute vector. minuteVT :: Word8 minuteVT = negate minuteT
85
minuteVT :: Word8 minuteVT = negate minuteT
43
minuteVT = negate minuteT
25
true
true
0
5
14
15
8
7
null
null
ezyang/ghc
testsuite/tests/codeGen/should_run/CmmSwitchTest64.hs
bsd-3-clause
ah -11# = 36#
13
ah -11# = 36#
13
ah -11# = 36#
13
false
false
0
5
3
12
5
7
null
null
dylanmc/cryptol
sbv/Data/SBV/SMT/SMTLib1.hs
bsd-3-clause
cvtExp (SBVApp (Rol i) [a]) = rot "rotate_left" i a
54
cvtExp (SBVApp (Rol i) [a]) = rot "rotate_left" i a
54
cvtExp (SBVApp (Rol i) [a]) = rot "rotate_left" i a
54
false
false
0
8
12
34
16
18
null
null
kernelim/leveldb-haskell
src/Database/LevelDB/MonadResource.hs
bsd-3-clause
-- | Position at the last key in the source. The iterator is /valid/ after this -- call iff the source is not empty. iterLast :: MonadResource m => Iterator -> m () iterLast = Base.iterLast
189
iterLast :: MonadResource m => Iterator -> m () iterLast = Base.iterLast
72
iterLast = Base.iterLast
24
true
true
0
8
35
31
16
15
null
null
phischu/fragnix
benchmarks/containers/Data.Set.Base.hs
bsd-3-clause
merge :: Set a -> Set a -> Set a merge Tip r = r
50
merge :: Set a -> Set a -> Set a merge Tip r = r
50
merge Tip r = r
17
false
true
0
7
16
33
15
18
null
null
agentm/project-m36
src/lib/ProjectM36/TransactionGraph/Persist.hs
unlicense
writeGraphTransactionIdFile :: DiskSync -> FilePath -> TransactionGraph -> IO LockFileHash writeGraphTransactionIdFile sync destDirectory (TransactionGraph _ transSet) = writeFileSync sync graphFile uuidInfo >> pure digest where graphFile = transactionLogPath destDirectory uuidInfo = T.intercalate "\n" graphLines digest = SHA256.hash (encodeUtf8 uuidInfo) graphLines = S.toList $ S.map graphLine transSet epochTime = realToFrac . utcTimeToPOSIXSeconds . timestamp :: Transaction -> Double graphLine trans = U.toText (transactionId trans) <> " " <> T.pack (show (epochTime trans)) <> " " <> T.intercalate " " (S.toList (S.map U.toText $ parentIds trans))
772
writeGraphTransactionIdFile :: DiskSync -> FilePath -> TransactionGraph -> IO LockFileHash writeGraphTransactionIdFile sync destDirectory (TransactionGraph _ transSet) = writeFileSync sync graphFile uuidInfo >> pure digest where graphFile = transactionLogPath destDirectory uuidInfo = T.intercalate "\n" graphLines digest = SHA256.hash (encodeUtf8 uuidInfo) graphLines = S.toList $ S.map graphLine transSet epochTime = realToFrac . utcTimeToPOSIXSeconds . timestamp :: Transaction -> Double graphLine trans = U.toText (transactionId trans) <> " " <> T.pack (show (epochTime trans)) <> " " <> T.intercalate " " (S.toList (S.map U.toText $ parentIds trans))
772
writeGraphTransactionIdFile sync destDirectory (TransactionGraph _ transSet) = writeFileSync sync graphFile uuidInfo >> pure digest where graphFile = transactionLogPath destDirectory uuidInfo = T.intercalate "\n" graphLines digest = SHA256.hash (encodeUtf8 uuidInfo) graphLines = S.toList $ S.map graphLine transSet epochTime = realToFrac . utcTimeToPOSIXSeconds . timestamp :: Transaction -> Double graphLine trans = U.toText (transactionId trans) <> " " <> T.pack (show (epochTime trans)) <> " " <> T.intercalate " " (S.toList (S.map U.toText $ parentIds trans))
681
false
true
0
12
200
216
105
111
null
null
christiaanb/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
pprUserTypeCtxt DefaultDeclCtxt = ptext (sLit "a type in a `default' declaration")
84
pprUserTypeCtxt DefaultDeclCtxt = ptext (sLit "a type in a `default' declaration")
84
pprUserTypeCtxt DefaultDeclCtxt = ptext (sLit "a type in a `default' declaration")
84
false
false
0
7
12
18
8
10
null
null
spechub/Hets
THF/StaticAnalysisTHF.hs
gpl-2.0
makeType :: THFFormula -> Either (Type, Constant) Diagnosis makeType t = maybe (Right $ mkDiag Error "Error while parsing the type of:" t) Left (thfFormulaToType t)
180
makeType :: THFFormula -> Either (Type, Constant) Diagnosis makeType t = maybe (Right $ mkDiag Error "Error while parsing the type of:" t) Left (thfFormulaToType t)
180
makeType t = maybe (Right $ mkDiag Error "Error while parsing the type of:" t) Left (thfFormulaToType t)
120
false
true
0
8
41
56
28
28
null
null
cliffano/swaggy-jenkins
clients/haskell-http-client/generated/lib/SwaggyJenkins/ModelLens.hs
mit
-- | 'queueLeftItemId' Lens queueLeftItemIdL :: Lens_' QueueLeftItem (Maybe Int) queueLeftItemIdL f QueueLeftItem{..} = (\queueLeftItemId -> QueueLeftItem { queueLeftItemId, ..} ) <$> f queueLeftItemId
201
queueLeftItemIdL :: Lens_' QueueLeftItem (Maybe Int) queueLeftItemIdL f QueueLeftItem{..} = (\queueLeftItemId -> QueueLeftItem { queueLeftItemId, ..} ) <$> f queueLeftItemId
173
queueLeftItemIdL f QueueLeftItem{..} = (\queueLeftItemId -> QueueLeftItem { queueLeftItemId, ..} ) <$> f queueLeftItemId
120
true
true
1
8
23
62
30
32
null
null
ekmett/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_CMD_HOMEEXTEND :: Int wxSTC_CMD_HOMEEXTEND = 2313
55
wxSTC_CMD_HOMEEXTEND :: Int wxSTC_CMD_HOMEEXTEND = 2313
55
wxSTC_CMD_HOMEEXTEND = 2313
27
false
true
0
6
5
18
7
11
null
null
ekarayel/HTF
Test/Framework/TestManager.hs
lgpl-2.1
flattenTestSuite (AnonTestSuite ts) = let fts = concatMap flattenTest ts in map (\ft -> ft { ft_path = TestPathCompound Nothing (ft_path ft) }) fts
155
flattenTestSuite (AnonTestSuite ts) = let fts = concatMap flattenTest ts in map (\ft -> ft { ft_path = TestPathCompound Nothing (ft_path ft) }) fts
155
flattenTestSuite (AnonTestSuite ts) = let fts = concatMap flattenTest ts in map (\ft -> ft { ft_path = TestPathCompound Nothing (ft_path ft) }) fts
155
false
false
0
14
31
63
31
32
null
null
cchalmers/geometry
src/Geometry/TwoD/Size.hs
bsd-3-clause
-- | Compute the height of an enveloped object. height :: (InSpace V2 n a, Enveloped a) => a -> n height = diameter unitY
121
height :: (InSpace V2 n a, Enveloped a) => a -> n height = diameter unitY
73
height = diameter unitY
23
true
true
0
6
24
38
20
18
null
null
Th30n/hasgel
src/Hasgel/Game/Movement.hs
mit
-- | Returns the new position and the index of the colliding object when moving -- for the given velocity. tryMove :: [Transform] -> Transform -> L.V3 Float -> (Transform, Maybe Int) tryMove [] mobj speed = (translate mobj speed, Nothing)
238
tryMove :: [Transform] -> Transform -> L.V3 Float -> (Transform, Maybe Int) tryMove [] mobj speed = (translate mobj speed, Nothing)
131
tryMove [] mobj speed = (translate mobj speed, Nothing)
55
true
true
0
11
40
68
34
34
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F18.hs
bsd-3-clause
-- glMultiTexCoord4xOES -------------------------------------------------------- glMultiTexCoord4xOES :: MonadIO m => GLenum -- ^ @texture@ of type [TextureUnit](Graphics-GL-Groups.html#TextureUnit). -> GLfixed -- ^ @s@. -> GLfixed -- ^ @t@. -> GLfixed -- ^ @r@. -> GLfixed -- ^ @q@. -> m () glMultiTexCoord4xOES v1 v2 v3 v4 v5 = liftIO $ dyn588 ptr_glMultiTexCoord4xOES v1 v2 v3 v4 v5
400
glMultiTexCoord4xOES :: MonadIO m => GLenum -- ^ @texture@ of type [TextureUnit](Graphics-GL-Groups.html#TextureUnit). -> GLfixed -- ^ @s@. -> GLfixed -- ^ @t@. -> GLfixed -- ^ @r@. -> GLfixed -- ^ @q@. -> m () glMultiTexCoord4xOES v1 v2 v3 v4 v5 = liftIO $ dyn588 ptr_glMultiTexCoord4xOES v1 v2 v3 v4 v5
318
glMultiTexCoord4xOES v1 v2 v3 v4 v5 = liftIO $ dyn588 ptr_glMultiTexCoord4xOES v1 v2 v3 v4 v5
93
true
true
0
13
68
81
41
40
null
null
shayan-najd/HsParser
Language/Haskell/Syntax/SrcLoc.hs
gpl-3.0
srcSpanEndLine RealSrcSpan'{ srcSpanELine=l } = l
49
srcSpanEndLine RealSrcSpan'{ srcSpanELine=l } = l
49
srcSpanEndLine RealSrcSpan'{ srcSpanELine=l } = l
49
false
false
0
8
5
18
9
9
null
null
toddmohney/branch-deleter
app/Main.hs
mit
confirmPlan :: [(Bool, Branch)] -> IO () confirmPlan plans = showPlan plans >> confirmPlan' where confirmPlan' = do printNorm "Do you approve of this plan? (y/n)\n" answer <- getLine case answer of "y" -> mapM_ (deleteBranch . snd) (filter fst plans) _ -> printNorm "Exiting...\n"
322
confirmPlan :: [(Bool, Branch)] -> IO () confirmPlan plans = showPlan plans >> confirmPlan' where confirmPlan' = do printNorm "Do you approve of this plan? (y/n)\n" answer <- getLine case answer of "y" -> mapM_ (deleteBranch . snd) (filter fst plans) _ -> printNorm "Exiting...\n"
322
confirmPlan plans = showPlan plans >> confirmPlan' where confirmPlan' = do printNorm "Do you approve of this plan? (y/n)\n" answer <- getLine case answer of "y" -> mapM_ (deleteBranch . snd) (filter fst plans) _ -> printNorm "Exiting...\n"
281
false
true
3
13
86
111
50
61
null
null
SAdams601/HaRe
old/testing/introPattern/MultiParamIn4_TokOut.hs
bsd-3-clause
f Nothing y (Left a) = (hd y) + a
33
f Nothing y (Left a) = (hd y) + a
33
f Nothing y (Left a) = (hd y) + a
33
false
false
0
7
9
31
14
17
null
null