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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sydow/ireal | Data/Number/IReal/FoldB.hs | bsd-3-clause | isumN' _ [x] = x | 23 | isumN' _ [x] = x | 23 | isumN' _ [x] = x | 23 | false | false | 0 | 6 | 11 | 14 | 7 | 7 | null | null |
TorosFanny/kaleidoscope | src/chapter4/Lexer.hs | mit | parens = Tok.parens lexer | 29 | parens = Tok.parens lexer | 29 | parens = Tok.parens lexer | 29 | false | false | 0 | 6 | 7 | 11 | 5 | 6 | null | null |
gilith/hol | src/HOL/Name.hs | mit | -- Natural numbers
naturalNamespace :: Namespace
naturalNamespace = Namespace ["Number","Natural"] | 99 | naturalNamespace :: Namespace
naturalNamespace = Namespace ["Number","Natural"] | 79 | naturalNamespace = Namespace ["Number","Natural"] | 49 | true | true | 0 | 6 | 10 | 21 | 12 | 9 | null | null |
DanielSchuessler/hstri | QuickCheckUtil.hs | gpl-3.0 | conjoin' ((V.fromList . fmap property) -> ps) =
(ps V.!) =<< choose (0,V.length ps-1) | 91 | conjoin' ((V.fromList . fmap property) -> ps) =
(ps V.!) =<< choose (0,V.length ps-1) | 91 | conjoin' ((V.fromList . fmap property) -> ps) =
(ps V.!) =<< choose (0,V.length ps-1) | 91 | false | false | 0 | 10 | 19 | 56 | 29 | 27 | null | null |
rudymatela/llcheck | src/Test/LeanCheck/Core.hs | bsd-3-clause | -- | Lazily interleaves two lists, switching between elements of the two.
-- Union/sum of the elements in the lists.
--
-- > [x,y,z,...] +| [a,b,c,...] = [x,a,y,b,z,c,...]
(+|) :: [a] -> [a] -> [a]
[] +| ys = ys | 221 | (+|) :: [a] -> [a] -> [a]
[] +| ys = ys | 45 | [] +| ys = ys | 19 | true | true | 0 | 10 | 49 | 47 | 26 | 21 | null | null |
av-ast/hello-scotty | src/DB.hs | mit | dbRun :: IO ()
dbRun = runSqlite ":memory:" $ do
runMigration migrateAll | 74 | dbRun :: IO ()
dbRun = runSqlite ":memory:" $ do
runMigration migrateAll | 74 | dbRun = runSqlite ":memory:" $ do
runMigration migrateAll | 59 | false | true | 2 | 8 | 13 | 36 | 14 | 22 | null | null |
geocurnoff/nikki | src/Sorts/LowerLimit.hs | lgpl-3.0 | isLowerLimit _ = False | 22 | isLowerLimit _ = False | 22 | isLowerLimit _ = False | 22 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
wellposed/hblas | tests/HBLAS/BLAS/Level2Spec.hs | bsd-3-clause | gerSpec :: Spec
gerSpec =
context "?GER" $ do
describe "SGER" $ do
it "2x2 all 1's" $ do
matmatTest1SGER
describe "DGER" $ do
it "2x2 all 1's" $ do
matmatTest1DGER | 201 | gerSpec :: Spec
gerSpec =
context "?GER" $ do
describe "SGER" $ do
it "2x2 all 1's" $ do
matmatTest1SGER
describe "DGER" $ do
it "2x2 all 1's" $ do
matmatTest1DGER | 201 | gerSpec =
context "?GER" $ do
describe "SGER" $ do
it "2x2 all 1's" $ do
matmatTest1SGER
describe "DGER" $ do
it "2x2 all 1's" $ do
matmatTest1DGER | 185 | false | true | 0 | 13 | 68 | 64 | 27 | 37 | null | null |
Cahu/krpc-hs | src/KRPCHS/SpaceCenter.hs | gpl-3.0 | referenceFrameCreateRelativeStreamReq :: KRPCHS.SpaceCenter.ReferenceFrame -> (Double, Double, Double) -> (Double, Double, Double, Double) -> (Double, Double, Double) -> (Double, Double, Double) -> KRPCStreamReq (KRPCHS.SpaceCenter.ReferenceFrame)
referenceFrameCreateRelativeStreamReq referenceFrameArg positionArg rotationArg velocityArg angularVelocityArg =
let req = makeRequest "SpaceCenter" "ReferenceFrame_CreateRelative" [makeArgument 0 referenceFrameArg, makeArgument 1 positionArg, makeArgument 2 rotationArg, makeArgument 3 velocityArg, makeArgument 4 angularVelocityArg]
in makeStream req | 609 | referenceFrameCreateRelativeStreamReq :: KRPCHS.SpaceCenter.ReferenceFrame -> (Double, Double, Double) -> (Double, Double, Double, Double) -> (Double, Double, Double) -> (Double, Double, Double) -> KRPCStreamReq (KRPCHS.SpaceCenter.ReferenceFrame)
referenceFrameCreateRelativeStreamReq referenceFrameArg positionArg rotationArg velocityArg angularVelocityArg =
let req = makeRequest "SpaceCenter" "ReferenceFrame_CreateRelative" [makeArgument 0 referenceFrameArg, makeArgument 1 positionArg, makeArgument 2 rotationArg, makeArgument 3 velocityArg, makeArgument 4 angularVelocityArg]
in makeStream req | 609 | referenceFrameCreateRelativeStreamReq referenceFrameArg positionArg rotationArg velocityArg angularVelocityArg =
let req = makeRequest "SpaceCenter" "ReferenceFrame_CreateRelative" [makeArgument 0 referenceFrameArg, makeArgument 1 positionArg, makeArgument 2 rotationArg, makeArgument 3 velocityArg, makeArgument 4 angularVelocityArg]
in makeStream req | 361 | false | true | 0 | 12 | 62 | 154 | 83 | 71 | null | null |
zenzike/hdbc-performance | src/Main.hs | bsd-3-clause | --------------------
setupInsert :: IConnection conn => conn -> IO ()
setupInsert conn = do
run conn
"CREATE TABLE testInsert (v1 INTEGER, v2 FLOAT, v3 CHAR(4))" []
commit conn | 185 | setupInsert :: IConnection conn => conn -> IO ()
setupInsert conn = do
run conn
"CREATE TABLE testInsert (v1 INTEGER, v2 FLOAT, v3 CHAR(4))" []
commit conn | 164 | setupInsert conn = do
run conn
"CREATE TABLE testInsert (v1 INTEGER, v2 FLOAT, v3 CHAR(4))" []
commit conn | 115 | true | true | 0 | 9 | 36 | 54 | 23 | 31 | null | null |
dylanmann/CurriersOfCatan | src/ActionParsing.hs | gpl-3.0 | roadP :: P.Parser PlayerAction
roadP = P.string "road" *> (BuildRoad <$> cornerP <*> cornerP) | 94 | roadP :: P.Parser PlayerAction
roadP = P.string "road" *> (BuildRoad <$> cornerP <*> cornerP) | 93 | roadP = P.string "road" *> (BuildRoad <$> cornerP <*> cornerP) | 62 | false | true | 2 | 8 | 14 | 44 | 20 | 24 | null | null |
urbanslug/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | needsCDecl (PlainModuleInitLabel _) = True | 46 | needsCDecl (PlainModuleInitLabel _) = True | 46 | needsCDecl (PlainModuleInitLabel _) = True | 46 | false | false | 0 | 7 | 8 | 15 | 7 | 8 | null | null |
dolio/irc-core | src/Client/State/Extensions.hs | isc | -- | Run the next available timer event on a particular extension.
clientExtTimer ::
Int {- ^ extension ID -} ->
ClientState {- ^ client state -} ->
IO ClientState
clientExtTimer i st =
do let ae = st ^?! clientExtensions . esActive . ix i
case popTimer ae of
Nothing -> return st
Just (_, timerId, fun, dat, ae') ->
do let st1 = set (clientExtensions . esActive . ix i) ae' st
(st2,_) <- clientPark i st1 (runTimerCallback fun dat timerId)
return st2
-- | Run the thread join action on a given extension. | 574 | clientExtTimer ::
Int {- ^ extension ID -} ->
ClientState {- ^ client state -} ->
IO ClientState
clientExtTimer i st =
do let ae = st ^?! clientExtensions . esActive . ix i
case popTimer ae of
Nothing -> return st
Just (_, timerId, fun, dat, ae') ->
do let st1 = set (clientExtensions . esActive . ix i) ae' st
(st2,_) <- clientPark i st1 (runTimerCallback fun dat timerId)
return st2
-- | Run the thread join action on a given extension. | 507 | clientExtTimer i st =
do let ae = st ^?! clientExtensions . esActive . ix i
case popTimer ae of
Nothing -> return st
Just (_, timerId, fun, dat, ae') ->
do let st1 = set (clientExtensions . esActive . ix i) ae' st
(st2,_) <- clientPark i st1 (runTimerCallback fun dat timerId)
return st2
-- | Run the thread join action on a given extension. | 396 | true | true | 0 | 18 | 164 | 164 | 81 | 83 | null | null |
bitc/omegagb | src/Cpu.hs | gpl-2.0 | mcti 0xF9 _ = (LDSP2, 8, 0) | 62 | mcti 0xF9 _ = (LDSP2, 8, 0) | 62 | mcti 0xF9 _ = (LDSP2, 8, 0) | 62 | false | false | 0 | 5 | 41 | 22 | 11 | 11 | null | null |
vikraman/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprHsBracket (TExpBr e) = thTyBrackets (ppr e) | 47 | pprHsBracket (TExpBr e) = thTyBrackets (ppr e) | 47 | pprHsBracket (TExpBr e) = thTyBrackets (ppr e) | 47 | false | false | 0 | 7 | 7 | 24 | 11 | 13 | null | null |
ryantm/ghc | testsuite/tests/typecheck/should_compile/tc006.hs | bsd-3-clause | h = 1:h | 7 | h = 1:h | 7 | h = 1:h | 7 | false | false | 1 | 5 | 2 | 13 | 5 | 8 | null | null |
mrakgr/futhark | src/Language/Futhark/TypeChecker.hs | bsd-3-clause | checkExp (DoLoop mergepat mergeexp form loopbody letbody loc) = do
-- First we do a basic check of the loop body to figure out which of
-- the merge parameters are being consumed. For this, we first need
-- to check the merge pattern, which requires the (initial) merge
-- expression.
((mergeexp', bindExtra), mergeflow) <-
collectOccurences $ do
mergeexp' <- checkExp mergeexp
return $
case form of
For _ _ (Ident loopvar _ _) _ ->
let iparam = Ident loopvar (Info $ Prim $ Signed Int32) loc
in (mergeexp', [iparam])
While _ ->
(mergeexp', [])
-- Check the loop body.
(firstscope, mergepat') <- checkBinding mergepat (typeOf mergeexp') mempty
((form', loopbody'), bodyflow) <-
noUnique $ firstscope $ binding bindExtra $ collectOccurences $
case form of
For dir lboundexp (Ident loopvar _ loopvarloc) uboundexp -> do
lboundexp' <- require [Prim $ Signed Int32] =<< checkExp lboundexp
uboundexp' <- require [Prim $ Signed Int32] =<< checkExp uboundexp
loopbody' <- checkExp loopbody
return (For dir lboundexp' (Ident loopvar (Info $ Prim $ Signed Int32) loopvarloc) uboundexp',
loopbody')
While condexp -> do
(condexp', condflow) <-
collectOccurences $ require [Prim Bool] =<< checkExp condexp
(loopbody', bodyflow) <-
collectOccurences $ checkExp loopbody
occur $ condflow `seqOccurences` bodyflow
return (While condexp',
loopbody')
let consumed_merge = patNameSet mergepat' `HS.intersection`
allConsumed bodyflow
uniquePat (Wildcard (Info t) wloc) =
Wildcard (Info $ t `setUniqueness` Nonunique) wloc
uniquePat (Id (Ident name (Info t) iloc))
| name `HS.member` consumed_merge =
Id $ Ident name (Info $ t `setUniqueness` Unique `setAliases` mempty) iloc
| otherwise =
let t' = case t of Tuple{} -> t
_ -> t `setUniqueness` Nonunique
in Id $ Ident name (Info t') iloc
uniquePat (TuplePattern pats ploc) =
TuplePattern (map uniquePat pats) ploc
-- Make the pattern unique where needed.
mergepat'' = uniquePat mergepat'
-- Now check that the loop returned the right type.
unless (typeOf loopbody' `subtypeOf` patternType mergepat'') $
bad $ UnexpectedType (srclocOf loopbody')
(toStructural $ typeOf loopbody')
[toStructural $ patternType mergepat'']
-- Check that the new values of consumed merge parameters do not
-- alias something bound outside the loop, AND that anything
-- returned for a unique merge parameter does not alias anything
-- else returned.
bound_outside <- asks $ HS.fromList . HM.keys . envVtable
let checkMergeReturn (Id ident) t
| unique $ unInfo $ identType ident,
v:_ <- HS.toList $ aliases t `HS.intersection` bound_outside =
lift $ bad $ TypeError loc $ "Loop return value corresponding to merge parameter " ++
pretty (identName ident) ++ " aliases " ++ pretty v ++ "."
| otherwise = do
(cons,obs) <- get
unless (HS.null $ aliases t `HS.intersection` cons) $
lift $ bad $ TypeError loc $ "Loop return value for merge parameter " ++
pretty (identName ident) ++ " aliases other consumed merge parameter."
when (unique (unInfo $ identType ident) &&
not (HS.null (aliases t `HS.intersection` (cons<>obs)))) $
lift $ bad $ TypeError loc $ "Loop return value for consuming merge parameter " ++
pretty (identName ident) ++ " aliases previously returned value." ++ show (aliases t, cons, obs)
if unique (unInfo $ identType ident)
then put (cons<>aliases t, obs)
else put (cons, obs<>aliases t)
checkMergeReturn (TuplePattern pats _) (Tuple ts) =
zipWithM_ checkMergeReturn pats ts
checkMergeReturn _ _ =
return ()
evalStateT (checkMergeReturn mergepat'' $ typeOf loopbody') (mempty, mempty)
let consumeMerge (Id (Ident _ (Info pt) ploc)) mt
| unique pt = consume ploc $ aliases mt
consumeMerge (TuplePattern pats _) (Tuple ts) =
zipWithM_ consumeMerge pats ts
consumeMerge _ _ =
return ()
((), merge_consume) <-
collectOccurences $ consumeMerge mergepat'' $ typeOf mergeexp'
occur $ mergeflow `seqOccurences` merge_consume
binding (patIdents mergepat'') $ do
letbody' <- checkExp letbody
return $ DoLoop mergepat'' mergeexp'
form'
loopbody' letbody' loc | 4,726 | checkExp (DoLoop mergepat mergeexp form loopbody letbody loc) = do
-- First we do a basic check of the loop body to figure out which of
-- the merge parameters are being consumed. For this, we first need
-- to check the merge pattern, which requires the (initial) merge
-- expression.
((mergeexp', bindExtra), mergeflow) <-
collectOccurences $ do
mergeexp' <- checkExp mergeexp
return $
case form of
For _ _ (Ident loopvar _ _) _ ->
let iparam = Ident loopvar (Info $ Prim $ Signed Int32) loc
in (mergeexp', [iparam])
While _ ->
(mergeexp', [])
-- Check the loop body.
(firstscope, mergepat') <- checkBinding mergepat (typeOf mergeexp') mempty
((form', loopbody'), bodyflow) <-
noUnique $ firstscope $ binding bindExtra $ collectOccurences $
case form of
For dir lboundexp (Ident loopvar _ loopvarloc) uboundexp -> do
lboundexp' <- require [Prim $ Signed Int32] =<< checkExp lboundexp
uboundexp' <- require [Prim $ Signed Int32] =<< checkExp uboundexp
loopbody' <- checkExp loopbody
return (For dir lboundexp' (Ident loopvar (Info $ Prim $ Signed Int32) loopvarloc) uboundexp',
loopbody')
While condexp -> do
(condexp', condflow) <-
collectOccurences $ require [Prim Bool] =<< checkExp condexp
(loopbody', bodyflow) <-
collectOccurences $ checkExp loopbody
occur $ condflow `seqOccurences` bodyflow
return (While condexp',
loopbody')
let consumed_merge = patNameSet mergepat' `HS.intersection`
allConsumed bodyflow
uniquePat (Wildcard (Info t) wloc) =
Wildcard (Info $ t `setUniqueness` Nonunique) wloc
uniquePat (Id (Ident name (Info t) iloc))
| name `HS.member` consumed_merge =
Id $ Ident name (Info $ t `setUniqueness` Unique `setAliases` mempty) iloc
| otherwise =
let t' = case t of Tuple{} -> t
_ -> t `setUniqueness` Nonunique
in Id $ Ident name (Info t') iloc
uniquePat (TuplePattern pats ploc) =
TuplePattern (map uniquePat pats) ploc
-- Make the pattern unique where needed.
mergepat'' = uniquePat mergepat'
-- Now check that the loop returned the right type.
unless (typeOf loopbody' `subtypeOf` patternType mergepat'') $
bad $ UnexpectedType (srclocOf loopbody')
(toStructural $ typeOf loopbody')
[toStructural $ patternType mergepat'']
-- Check that the new values of consumed merge parameters do not
-- alias something bound outside the loop, AND that anything
-- returned for a unique merge parameter does not alias anything
-- else returned.
bound_outside <- asks $ HS.fromList . HM.keys . envVtable
let checkMergeReturn (Id ident) t
| unique $ unInfo $ identType ident,
v:_ <- HS.toList $ aliases t `HS.intersection` bound_outside =
lift $ bad $ TypeError loc $ "Loop return value corresponding to merge parameter " ++
pretty (identName ident) ++ " aliases " ++ pretty v ++ "."
| otherwise = do
(cons,obs) <- get
unless (HS.null $ aliases t `HS.intersection` cons) $
lift $ bad $ TypeError loc $ "Loop return value for merge parameter " ++
pretty (identName ident) ++ " aliases other consumed merge parameter."
when (unique (unInfo $ identType ident) &&
not (HS.null (aliases t `HS.intersection` (cons<>obs)))) $
lift $ bad $ TypeError loc $ "Loop return value for consuming merge parameter " ++
pretty (identName ident) ++ " aliases previously returned value." ++ show (aliases t, cons, obs)
if unique (unInfo $ identType ident)
then put (cons<>aliases t, obs)
else put (cons, obs<>aliases t)
checkMergeReturn (TuplePattern pats _) (Tuple ts) =
zipWithM_ checkMergeReturn pats ts
checkMergeReturn _ _ =
return ()
evalStateT (checkMergeReturn mergepat'' $ typeOf loopbody') (mempty, mempty)
let consumeMerge (Id (Ident _ (Info pt) ploc)) mt
| unique pt = consume ploc $ aliases mt
consumeMerge (TuplePattern pats _) (Tuple ts) =
zipWithM_ consumeMerge pats ts
consumeMerge _ _ =
return ()
((), merge_consume) <-
collectOccurences $ consumeMerge mergepat'' $ typeOf mergeexp'
occur $ mergeflow `seqOccurences` merge_consume
binding (patIdents mergepat'') $ do
letbody' <- checkExp letbody
return $ DoLoop mergepat'' mergeexp'
form'
loopbody' letbody' loc | 4,726 | checkExp (DoLoop mergepat mergeexp form loopbody letbody loc) = do
-- First we do a basic check of the loop body to figure out which of
-- the merge parameters are being consumed. For this, we first need
-- to check the merge pattern, which requires the (initial) merge
-- expression.
((mergeexp', bindExtra), mergeflow) <-
collectOccurences $ do
mergeexp' <- checkExp mergeexp
return $
case form of
For _ _ (Ident loopvar _ _) _ ->
let iparam = Ident loopvar (Info $ Prim $ Signed Int32) loc
in (mergeexp', [iparam])
While _ ->
(mergeexp', [])
-- Check the loop body.
(firstscope, mergepat') <- checkBinding mergepat (typeOf mergeexp') mempty
((form', loopbody'), bodyflow) <-
noUnique $ firstscope $ binding bindExtra $ collectOccurences $
case form of
For dir lboundexp (Ident loopvar _ loopvarloc) uboundexp -> do
lboundexp' <- require [Prim $ Signed Int32] =<< checkExp lboundexp
uboundexp' <- require [Prim $ Signed Int32] =<< checkExp uboundexp
loopbody' <- checkExp loopbody
return (For dir lboundexp' (Ident loopvar (Info $ Prim $ Signed Int32) loopvarloc) uboundexp',
loopbody')
While condexp -> do
(condexp', condflow) <-
collectOccurences $ require [Prim Bool] =<< checkExp condexp
(loopbody', bodyflow) <-
collectOccurences $ checkExp loopbody
occur $ condflow `seqOccurences` bodyflow
return (While condexp',
loopbody')
let consumed_merge = patNameSet mergepat' `HS.intersection`
allConsumed bodyflow
uniquePat (Wildcard (Info t) wloc) =
Wildcard (Info $ t `setUniqueness` Nonunique) wloc
uniquePat (Id (Ident name (Info t) iloc))
| name `HS.member` consumed_merge =
Id $ Ident name (Info $ t `setUniqueness` Unique `setAliases` mempty) iloc
| otherwise =
let t' = case t of Tuple{} -> t
_ -> t `setUniqueness` Nonunique
in Id $ Ident name (Info t') iloc
uniquePat (TuplePattern pats ploc) =
TuplePattern (map uniquePat pats) ploc
-- Make the pattern unique where needed.
mergepat'' = uniquePat mergepat'
-- Now check that the loop returned the right type.
unless (typeOf loopbody' `subtypeOf` patternType mergepat'') $
bad $ UnexpectedType (srclocOf loopbody')
(toStructural $ typeOf loopbody')
[toStructural $ patternType mergepat'']
-- Check that the new values of consumed merge parameters do not
-- alias something bound outside the loop, AND that anything
-- returned for a unique merge parameter does not alias anything
-- else returned.
bound_outside <- asks $ HS.fromList . HM.keys . envVtable
let checkMergeReturn (Id ident) t
| unique $ unInfo $ identType ident,
v:_ <- HS.toList $ aliases t `HS.intersection` bound_outside =
lift $ bad $ TypeError loc $ "Loop return value corresponding to merge parameter " ++
pretty (identName ident) ++ " aliases " ++ pretty v ++ "."
| otherwise = do
(cons,obs) <- get
unless (HS.null $ aliases t `HS.intersection` cons) $
lift $ bad $ TypeError loc $ "Loop return value for merge parameter " ++
pretty (identName ident) ++ " aliases other consumed merge parameter."
when (unique (unInfo $ identType ident) &&
not (HS.null (aliases t `HS.intersection` (cons<>obs)))) $
lift $ bad $ TypeError loc $ "Loop return value for consuming merge parameter " ++
pretty (identName ident) ++ " aliases previously returned value." ++ show (aliases t, cons, obs)
if unique (unInfo $ identType ident)
then put (cons<>aliases t, obs)
else put (cons, obs<>aliases t)
checkMergeReturn (TuplePattern pats _) (Tuple ts) =
zipWithM_ checkMergeReturn pats ts
checkMergeReturn _ _ =
return ()
evalStateT (checkMergeReturn mergepat'' $ typeOf loopbody') (mempty, mempty)
let consumeMerge (Id (Ident _ (Info pt) ploc)) mt
| unique pt = consume ploc $ aliases mt
consumeMerge (TuplePattern pats _) (Tuple ts) =
zipWithM_ consumeMerge pats ts
consumeMerge _ _ =
return ()
((), merge_consume) <-
collectOccurences $ consumeMerge mergepat'' $ typeOf mergeexp'
occur $ mergeflow `seqOccurences` merge_consume
binding (patIdents mergepat'') $ do
letbody' <- checkExp letbody
return $ DoLoop mergepat'' mergeexp'
form'
loopbody' letbody' loc | 4,726 | false | false | 0 | 29 | 1,368 | 1,401 | 687 | 714 | null | null |
kmels/hledger | hledger/Hledger/Cli/Print.hs | gpl-3.0 | entriesReportAsText :: EntriesReport -> String
entriesReportAsText items = concatMap showTransactionUnelided items | 114 | entriesReportAsText :: EntriesReport -> String
entriesReportAsText items = concatMap showTransactionUnelided items | 114 | entriesReportAsText items = concatMap showTransactionUnelided items | 67 | false | true | 0 | 5 | 10 | 23 | 11 | 12 | null | null |
stevezhee/eel | src/Eel.hs | bsd-3-clause | -- | LLVM getelementptr instruction. Docs seem to be wrong.
-- http://llvm.org/docs/LangRef.html#getelementptr-instruction
getelementptr :: (Ty a, IsInt b) => V (Ptr a) -> V b -> I (Ptr a)
getelementptr p i = assign ["getelementptr", tyvalof p `comma` tyvalof i] | 263 | getelementptr :: (Ty a, IsInt b) => V (Ptr a) -> V b -> I (Ptr a)
getelementptr p i = assign ["getelementptr", tyvalof p `comma` tyvalof i] | 139 | getelementptr p i = assign ["getelementptr", tyvalof p `comma` tyvalof i] | 73 | true | true | 0 | 10 | 40 | 83 | 42 | 41 | null | null |
chadbrewbaker/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_subshellAssignmentCheck13 = verifyTree subshellAssignmentCheck "#!/bin/bash\necho foo | read bar; echo $bar" | 113 | prop_subshellAssignmentCheck13 = verifyTree subshellAssignmentCheck "#!/bin/bash\necho foo | read bar; echo $bar" | 113 | prop_subshellAssignmentCheck13 = verifyTree subshellAssignmentCheck "#!/bin/bash\necho foo | read bar; echo $bar" | 113 | false | false | 0 | 5 | 10 | 11 | 5 | 6 | null | null |
ml9951/ghc | compiler/types/FamInstEnv.hs | bsd-3-clause | coreFlattenTy :: InScopeSet -> FlattenMap -> Type -> (FlattenMap, Type)
coreFlattenTy in_scope = go
where
go m ty | Just ty' <- coreView ty = go m ty'
go m ty@(TyVarTy {}) = (m, ty)
go m (AppTy ty1 ty2) = let (m1, ty1') = go m ty1
(m2, ty2') = go m1 ty2 in
(m2, AppTy ty1' ty2')
go m (TyConApp tc tys)
-- NB: Don't just check if isFamilyTyCon: this catches *data* families,
-- which are generative and thus can be preserved during flattening
| not (isGenerativeTyCon tc Nominal)
= let (m', tv) = coreFlattenTyFamApp in_scope m tc tys in
(m', mkTyVarTy tv)
| otherwise
= let (m', tys') = coreFlattenTys in_scope m tys in
(m', mkTyConApp tc tys')
go m (FunTy ty1 ty2) = let (m1, ty1') = go m ty1
(m2, ty2') = go m1 ty2 in
(m2, FunTy ty1' ty2')
-- Note to RAE: this will have to be changed with kind families
go m (ForAllTy tv ty) = let (m', ty') = go m ty in
(m', ForAllTy tv ty')
go m ty@(LitTy {}) = (m, ty) | 1,152 | coreFlattenTy :: InScopeSet -> FlattenMap -> Type -> (FlattenMap, Type)
coreFlattenTy in_scope = go
where
go m ty | Just ty' <- coreView ty = go m ty'
go m ty@(TyVarTy {}) = (m, ty)
go m (AppTy ty1 ty2) = let (m1, ty1') = go m ty1
(m2, ty2') = go m1 ty2 in
(m2, AppTy ty1' ty2')
go m (TyConApp tc tys)
-- NB: Don't just check if isFamilyTyCon: this catches *data* families,
-- which are generative and thus can be preserved during flattening
| not (isGenerativeTyCon tc Nominal)
= let (m', tv) = coreFlattenTyFamApp in_scope m tc tys in
(m', mkTyVarTy tv)
| otherwise
= let (m', tys') = coreFlattenTys in_scope m tys in
(m', mkTyConApp tc tys')
go m (FunTy ty1 ty2) = let (m1, ty1') = go m ty1
(m2, ty2') = go m1 ty2 in
(m2, FunTy ty1' ty2')
-- Note to RAE: this will have to be changed with kind families
go m (ForAllTy tv ty) = let (m', ty') = go m ty in
(m', ForAllTy tv ty')
go m ty@(LitTy {}) = (m, ty) | 1,152 | coreFlattenTy in_scope = go
where
go m ty | Just ty' <- coreView ty = go m ty'
go m ty@(TyVarTy {}) = (m, ty)
go m (AppTy ty1 ty2) = let (m1, ty1') = go m ty1
(m2, ty2') = go m1 ty2 in
(m2, AppTy ty1' ty2')
go m (TyConApp tc tys)
-- NB: Don't just check if isFamilyTyCon: this catches *data* families,
-- which are generative and thus can be preserved during flattening
| not (isGenerativeTyCon tc Nominal)
= let (m', tv) = coreFlattenTyFamApp in_scope m tc tys in
(m', mkTyVarTy tv)
| otherwise
= let (m', tys') = coreFlattenTys in_scope m tys in
(m', mkTyConApp tc tys')
go m (FunTy ty1 ty2) = let (m1, ty1') = go m ty1
(m2, ty2') = go m1 ty2 in
(m2, FunTy ty1' ty2')
-- Note to RAE: this will have to be changed with kind families
go m (ForAllTy tv ty) = let (m', ty') = go m ty in
(m', ForAllTy tv ty')
go m ty@(LitTy {}) = (m, ty) | 1,080 | false | true | 0 | 10 | 427 | 437 | 217 | 220 | null | null |
gridaphobe/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprStmtContext DoExpr = text "'do' block" | 50 | pprStmtContext DoExpr = text "'do' block" | 50 | pprStmtContext DoExpr = text "'do' block" | 50 | false | false | 0 | 5 | 14 | 12 | 5 | 7 | null | null |
mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Core31/Tokens.hs | bsd-3-clause | gl_ACTIVE_ATTRIBUTE_MAX_LENGTH :: GLenum
gl_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A | 80 | gl_ACTIVE_ATTRIBUTE_MAX_LENGTH :: GLenum
gl_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A | 80 | gl_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A | 39 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
joelburget/haste-compiler | libraries/haste-lib/src/Haste/Callback.hs | bsd-3-clause | evtName :: IsString s => Event m a -> s
evtName evt =
case evt of
OnLoad -> "load"
OnUnload -> "unload"
OnClick -> "click"
OnDblClick -> "dblclick"
OnMouseDown -> "mousedown"
OnMouseUp -> "mouseup"
OnMouseMove -> "mousemove"
OnMouseOver -> "mouseover"
OnMouseOut -> "mouseout"
OnKeyPress -> "keypress"
OnKeyUp -> "keyup"
OnKeyDown -> "keydown"
OnChange -> "change"
OnFocus -> "focus"
OnBlur -> "blur"
OnSubmit -> "submit"
OnWheel -> "wheel"
-- | Friendlier name for @setCallback@. | 593 | evtName :: IsString s => Event m a -> s
evtName evt =
case evt of
OnLoad -> "load"
OnUnload -> "unload"
OnClick -> "click"
OnDblClick -> "dblclick"
OnMouseDown -> "mousedown"
OnMouseUp -> "mouseup"
OnMouseMove -> "mousemove"
OnMouseOver -> "mouseover"
OnMouseOut -> "mouseout"
OnKeyPress -> "keypress"
OnKeyUp -> "keyup"
OnKeyDown -> "keydown"
OnChange -> "change"
OnFocus -> "focus"
OnBlur -> "blur"
OnSubmit -> "submit"
OnWheel -> "wheel"
-- | Friendlier name for @setCallback@. | 593 | evtName evt =
case evt of
OnLoad -> "load"
OnUnload -> "unload"
OnClick -> "click"
OnDblClick -> "dblclick"
OnMouseDown -> "mousedown"
OnMouseUp -> "mouseup"
OnMouseMove -> "mousemove"
OnMouseOver -> "mouseover"
OnMouseOut -> "mouseout"
OnKeyPress -> "keypress"
OnKeyUp -> "keyup"
OnKeyDown -> "keydown"
OnChange -> "change"
OnFocus -> "focus"
OnBlur -> "blur"
OnSubmit -> "submit"
OnWheel -> "wheel"
-- | Friendlier name for @setCallback@. | 553 | false | true | 0 | 7 | 185 | 137 | 68 | 69 | null | null |
batterseapower/chsc | Renaming.hs | bsd-3-clause | mkIdentityRenaming :: [Name] -> Renaming
mkIdentityRenaming = mkRenaming . map (id &&& id) | 90 | mkIdentityRenaming :: [Name] -> Renaming
mkIdentityRenaming = mkRenaming . map (id &&& id) | 90 | mkIdentityRenaming = mkRenaming . map (id &&& id) | 49 | false | true | 0 | 8 | 12 | 32 | 17 | 15 | null | null |
amccausl/Swish | Swish/HaskellRDF/VarBindingTest.hs | lgpl-2.1 | testVarCompose62 = testEq "testVarCompose62" Nothing $ vbMap vb1m1id "b" | 73 | testVarCompose62 = testEq "testVarCompose62" Nothing $ vbMap vb1m1id "b" | 73 | testVarCompose62 = testEq "testVarCompose62" Nothing $ vbMap vb1m1id "b" | 73 | false | false | 0 | 6 | 9 | 20 | 9 | 11 | null | null |
hjwylde/haskell-type-classes-workshop | test/Main.hs | bsd-3-clause | main :: IO ()
main = void $ runTestTT tests
where
tests = TestList
[ Toc1.tests
, Toc2.tests
, Toc4a.tests
, Toc4b.tests
, Toc4c.tests
] | 220 | main :: IO ()
main = void $ runTestTT tests
where
tests = TestList
[ Toc1.tests
, Toc2.tests
, Toc4a.tests
, Toc4b.tests
, Toc4c.tests
] | 220 | main = void $ runTestTT tests
where
tests = TestList
[ Toc1.tests
, Toc2.tests
, Toc4a.tests
, Toc4b.tests
, Toc4c.tests
] | 206 | false | true | 3 | 7 | 108 | 69 | 32 | 37 | null | null |
boojinks/cis194-solutions | src/HW02/LogAnalysis.hs | bsd-3-clause | whatWentWrong :: [LogMessage] -> [String]
whatWentWrong = map extractMessage . inOrder . build . filter isSevereError | 117 | whatWentWrong :: [LogMessage] -> [String]
whatWentWrong = map extractMessage . inOrder . build . filter isSevereError | 117 | whatWentWrong = map extractMessage . inOrder . build . filter isSevereError | 75 | false | true | 0 | 8 | 15 | 39 | 20 | 19 | null | null |
shlevy/ghc | compiler/cmm/Hoopl/Block.hs | bsd-3-clause | blockSplitHead (BlockCC n b t) = (n, BlockOC b t) | 49 | blockSplitHead (BlockCC n b t) = (n, BlockOC b t) | 49 | blockSplitHead (BlockCC n b t) = (n, BlockOC b t) | 49 | false | false | 0 | 7 | 9 | 30 | 15 | 15 | null | null |
yangsiwei880813/CS644 | src/SMain.hs | gpl-2.0 | printList :: Show a => [a] -> IO()
printList [] = return () | 59 | printList :: Show a => [a] -> IO()
printList [] = return () | 59 | printList [] = return () | 24 | false | true | 0 | 8 | 12 | 40 | 19 | 21 | null | null |
jcaldwell/monadserv | src/MonadServ/DemoLoop.hs | bsd-2-clause | buildHeaders (Just l) t hdrs = union hdrs ((startingHeaders t) ++
[Header HdrContentLength $ show l]) | 133 | buildHeaders (Just l) t hdrs = union hdrs ((startingHeaders t) ++
[Header HdrContentLength $ show l]) | 133 | buildHeaders (Just l) t hdrs = union hdrs ((startingHeaders t) ++
[Header HdrContentLength $ show l]) | 133 | false | false | 0 | 10 | 47 | 52 | 24 | 28 | null | null |
basvandijk/lifted-base | Control/Concurrent/Lifted.hs | bsd-3-clause | -- | Generalized version of 'C.forkOn'.
--
-- Note that, while the forked computation @m ()@ has access to the captured
-- state, all its side-effects in @m@ are discarded. It is run only for its
-- side-effects in 'IO'.
forkOn :: MonadBaseControl IO m => Int -> m () -> m ThreadId
forkOn = liftBaseDiscard . C.forkOn | 317 | forkOn :: MonadBaseControl IO m => Int -> m () -> m ThreadId
forkOn = liftBaseDiscard . C.forkOn | 96 | forkOn = liftBaseDiscard . C.forkOn | 35 | true | true | 0 | 9 | 57 | 47 | 25 | 22 | null | null |
bertdouglas/euler-haskell | 001-050/50a.hs | mit | answer = head $ dropWhile (==0) $ map (csum limit) [maxn,maxn-1..] | 66 | answer = head $ dropWhile (==0) $ map (csum limit) [maxn,maxn-1..] | 66 | answer = head $ dropWhile (==0) $ map (csum limit) [maxn,maxn-1..] | 66 | false | false | 0 | 8 | 10 | 42 | 22 | 20 | null | null |
hferreiro/replay | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | jumpRegs :: DynFlags -> [GlobalReg] -> [Reg]
jumpRegs dflags gregs = [ RegReal r | Just r <- map (globalRegMaybe platform) gregs ]
where platform = targetPlatform dflags
--------------------------------------------------------------------------------
-- | 'InstrBlock's are the insn sequences generated by the insn selectors.
-- They are really trees of insns to facilitate fast appending, where a
-- left-to-right traversal yields the insns in the correct order.
-- | 481 | jumpRegs :: DynFlags -> [GlobalReg] -> [Reg]
jumpRegs dflags gregs = [ RegReal r | Just r <- map (globalRegMaybe platform) gregs ]
where platform = targetPlatform dflags
--------------------------------------------------------------------------------
-- | 'InstrBlock's are the insn sequences generated by the insn selectors.
-- They are really trees of insns to facilitate fast appending, where a
-- left-to-right traversal yields the insns in the correct order.
-- | 481 | jumpRegs dflags gregs = [ RegReal r | Just r <- map (globalRegMaybe platform) gregs ]
where platform = targetPlatform dflags
--------------------------------------------------------------------------------
-- | 'InstrBlock's are the insn sequences generated by the insn selectors.
-- They are really trees of insns to facilitate fast appending, where a
-- left-to-right traversal yields the insns in the correct order.
-- | 436 | false | true | 1 | 10 | 79 | 81 | 40 | 41 | null | null |
fedelebron/AVL | Data/Tree/AVL/Static/Internal.hs | bsd-3-clause | fmapNode f (Leftie x l r) = Leftie (f x) (fmapNode f l) (fmapNode f r) | 70 | fmapNode f (Leftie x l r) = Leftie (f x) (fmapNode f l) (fmapNode f r) | 70 | fmapNode f (Leftie x l r) = Leftie (f x) (fmapNode f l) (fmapNode f r) | 70 | false | false | 0 | 7 | 15 | 52 | 24 | 28 | null | null |
mettekou/ghc | compiler/main/HscTypes.hs | bsd-3-clause | implicitConLikeThings :: ConLike -> [TyThing]
implicitConLikeThings (RealDataCon dc)
= dataConImplicitTyThings dc | 115 | implicitConLikeThings :: ConLike -> [TyThing]
implicitConLikeThings (RealDataCon dc)
= dataConImplicitTyThings dc | 115 | implicitConLikeThings (RealDataCon dc)
= dataConImplicitTyThings dc | 69 | false | true | 0 | 7 | 12 | 30 | 15 | 15 | null | null |
io7m/jcamera | com.io7m.jcamera.documentation/src/main/resources/com/io7m/jcamera/documentation/haskell/ExampleDefaultVectors.hs | isc | -- = (1, 0, 0)
up :: Vector3f.T
up = Vector3f.cross right forward | 69 | up :: Vector3f.T
up = Vector3f.cross right forward | 50 | up = Vector3f.cross right forward | 33 | true | true | 0 | 7 | 16 | 27 | 12 | 15 | null | null |
mettekou/ghc | compiler/typecheck/TcBinds.hs | bsd-3-clause | tcVect (HsVectTypeIn _ isScalar lname rhs_name)
= addErrCtxt (vectCtxt lname) $
do { tycon <- tcLookupLocatedTyCon lname
; checkTc ( not isScalar -- either we have a non-SCALAR declaration
|| isJust rhs_name -- or we explicitly provide a vectorised type
|| tyConArity tycon == 0 -- otherwise the type constructor must be nullary
)
scalarTyConMustBeNullary
; rhs_tycon <- fmapMaybeM (tcLookupTyCon . unLoc) rhs_name
; return $ HsVectTypeOut isScalar tycon rhs_tycon
} | 607 | tcVect (HsVectTypeIn _ isScalar lname rhs_name)
= addErrCtxt (vectCtxt lname) $
do { tycon <- tcLookupLocatedTyCon lname
; checkTc ( not isScalar -- either we have a non-SCALAR declaration
|| isJust rhs_name -- or we explicitly provide a vectorised type
|| tyConArity tycon == 0 -- otherwise the type constructor must be nullary
)
scalarTyConMustBeNullary
; rhs_tycon <- fmapMaybeM (tcLookupTyCon . unLoc) rhs_name
; return $ HsVectTypeOut isScalar tycon rhs_tycon
} | 607 | tcVect (HsVectTypeIn _ isScalar lname rhs_name)
= addErrCtxt (vectCtxt lname) $
do { tycon <- tcLookupLocatedTyCon lname
; checkTc ( not isScalar -- either we have a non-SCALAR declaration
|| isJust rhs_name -- or we explicitly provide a vectorised type
|| tyConArity tycon == 0 -- otherwise the type constructor must be nullary
)
scalarTyConMustBeNullary
; rhs_tycon <- fmapMaybeM (tcLookupTyCon . unLoc) rhs_name
; return $ HsVectTypeOut isScalar tycon rhs_tycon
} | 607 | false | false | 0 | 13 | 211 | 118 | 57 | 61 | null | null |
rueshyna/gogol | gogol-safebrowsing/gen/Network/Google/Resource/SafeBrowsing/ThreatLists/List.hs | mpl-2.0 | -- | OAuth bearer token.
tllBearerToken :: Lens' ThreatListsList (Maybe Text)
tllBearerToken
= lens _tllBearerToken
(\ s a -> s{_tllBearerToken = a}) | 157 | tllBearerToken :: Lens' ThreatListsList (Maybe Text)
tllBearerToken
= lens _tllBearerToken
(\ s a -> s{_tllBearerToken = a}) | 132 | tllBearerToken
= lens _tllBearerToken
(\ s a -> s{_tllBearerToken = a}) | 79 | true | true | 1 | 9 | 29 | 52 | 25 | 27 | null | null |
stulli/projectEuler | eu40.hs | bsd-3-clause | result = product $ map (\z->read [z]) y :: Int | 46 | result = product $ map (\z->read [z]) y :: Int | 46 | result = product $ map (\z->read [z]) y :: Int | 46 | false | false | 4 | 9 | 9 | 37 | 17 | 20 | null | null |
gsdlab/clafer | src/Language/Clafer/Intermediate/TypeSystem.hs | mit | intersection uidIClaferMap' (TUnion t1s) t2@(TClafer _) = do
t1s' <- mapM (intersection uidIClaferMap' t2) t1s
return $ case catMaybes t1s' of
[] -> Nothing
[t] -> Just t
t1s'' -> Just $ TUnion t1s'' | 218 | intersection uidIClaferMap' (TUnion t1s) t2@(TClafer _) = do
t1s' <- mapM (intersection uidIClaferMap' t2) t1s
return $ case catMaybes t1s' of
[] -> Nothing
[t] -> Just t
t1s'' -> Just $ TUnion t1s'' | 218 | intersection uidIClaferMap' (TUnion t1s) t2@(TClafer _) = do
t1s' <- mapM (intersection uidIClaferMap' t2) t1s
return $ case catMaybes t1s' of
[] -> Nothing
[t] -> Just t
t1s'' -> Just $ TUnion t1s'' | 218 | false | false | 0 | 12 | 52 | 95 | 45 | 50 | null | null |
eklinkhammer/robot-vision | src/canny_demo.hs | mit | orientVert = 128 :: Word8 | 32 | orientVert = 128 :: Word8 | 32 | orientVert = 128 :: Word8 | 32 | false | false | 2 | 5 | 11 | 15 | 5 | 10 | null | null |
phischu/fragnix | builtins/base/GHC.Conc.IO.hs | bsd-3-clause | closeFdWith :: (Fd -> IO ()) -- ^ Low-level action that performs the real close.
-> Fd -- ^ File descriptor to close.
-> IO ()
closeFdWith close fd
| threaded = Event.closeFdWith close fd
| otherwise = close fd | 250 | closeFdWith :: (Fd -> IO ()) -- ^ Low-level action that performs the real close.
-> Fd -- ^ File descriptor to close.
-> IO ()
closeFdWith close fd
| threaded = Event.closeFdWith close fd
| otherwise = close fd | 250 | closeFdWith close fd
| threaded = Event.closeFdWith close fd
| otherwise = close fd | 88 | false | true | 1 | 9 | 79 | 66 | 32 | 34 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/Cabal/Distribution/ParseUtils.hs | bsd-3-clause | fName (Section _ n _ _) = n | 27 | fName (Section _ n _ _) = n | 27 | fName (Section _ n _ _) = n | 27 | false | false | 0 | 6 | 7 | 22 | 10 | 12 | null | null |
HIPERFIT/futhark | src/Futhark/IR/Prop/TypeOf.hs | isc | loopExtType :: Typed dec => [Param dec] -> [ExtType]
loopExtType params =
existentialiseExtTypes inaccessible $ staticShapes $ map typeOf params
where
inaccessible = map paramName params
-- | Any operation must define an instance of this class, which
-- describes the type of the operation (at the value level). | 320 | loopExtType :: Typed dec => [Param dec] -> [ExtType]
loopExtType params =
existentialiseExtTypes inaccessible $ staticShapes $ map typeOf params
where
inaccessible = map paramName params
-- | Any operation must define an instance of this class, which
-- describes the type of the operation (at the value level). | 320 | loopExtType params =
existentialiseExtTypes inaccessible $ staticShapes $ map typeOf params
where
inaccessible = map paramName params
-- | Any operation must define an instance of this class, which
-- describes the type of the operation (at the value level). | 267 | false | true | 0 | 8 | 57 | 68 | 33 | 35 | null | null |
benperez/chinese-poker | src/Util.hs | mit | handfrequencies :: [(HandType, Int)]
handfrequencies = map (head &&& length) .
group .
sort .
map (fst . extractHandType) $ allPossibleHands | 194 | handfrequencies :: [(HandType, Int)]
handfrequencies = map (head &&& length) .
group .
sort .
map (fst . extractHandType) $ allPossibleHands | 194 | handfrequencies = map (head &&& length) .
group .
sort .
map (fst . extractHandType) $ allPossibleHands | 157 | false | true | 0 | 11 | 74 | 56 | 30 | 26 | null | null |
MasseR/introitu | Handler/Search.hs | bsd-2-clause | getSearchR :: Handler RepHtml
getSearchR = do
pageNum <- maybe 1 id <$> (runInputGet $ iopt intField "page")
(Entity userId _) <- requireAuth
strcond <- runInputGet $ ireq textField "search"
(pages, notes) <- ((enumFromTo 1) *** (zip [1 :: Int ..])) <$> searchNote pageNum userId strcond
defaultLayout $ do
let title = "Search results" :: Html
setTitle title
$(widgetFile "list")
where
spoiler (Textarea text) = maybe "" id $ listToMaybe $ T.lines text | 480 | getSearchR :: Handler RepHtml
getSearchR = do
pageNum <- maybe 1 id <$> (runInputGet $ iopt intField "page")
(Entity userId _) <- requireAuth
strcond <- runInputGet $ ireq textField "search"
(pages, notes) <- ((enumFromTo 1) *** (zip [1 :: Int ..])) <$> searchNote pageNum userId strcond
defaultLayout $ do
let title = "Search results" :: Html
setTitle title
$(widgetFile "list")
where
spoiler (Textarea text) = maybe "" id $ listToMaybe $ T.lines text | 480 | getSearchR = do
pageNum <- maybe 1 id <$> (runInputGet $ iopt intField "page")
(Entity userId _) <- requireAuth
strcond <- runInputGet $ ireq textField "search"
(pages, notes) <- ((enumFromTo 1) *** (zip [1 :: Int ..])) <$> searchNote pageNum userId strcond
defaultLayout $ do
let title = "Search results" :: Html
setTitle title
$(widgetFile "list")
where
spoiler (Textarea text) = maybe "" id $ listToMaybe $ T.lines text | 450 | false | true | 1 | 13 | 100 | 196 | 92 | 104 | null | null |
CulpaBS/wbBach | src/Futhark/Representation/SOACS/Simplify.hs | bsd-3-clause | simplifyLambda :: (HasScope SOACS m, MonadFreshNames m) =>
Lambda -> Maybe [SubExp] -> [Maybe VName] -> m Lambda
simplifyLambda =
Simplifier.simplifyLambdaWithRules bindableSimpleOps soacRules Engine.noExtraHoistBlockers | 240 | simplifyLambda :: (HasScope SOACS m, MonadFreshNames m) =>
Lambda -> Maybe [SubExp] -> [Maybe VName] -> m Lambda
simplifyLambda =
Simplifier.simplifyLambdaWithRules bindableSimpleOps soacRules Engine.noExtraHoistBlockers | 240 | simplifyLambda =
Simplifier.simplifyLambdaWithRules bindableSimpleOps soacRules Engine.noExtraHoistBlockers | 109 | false | true | 0 | 10 | 43 | 66 | 33 | 33 | null | null |
naoto-ogawa/h-xproto-mysql | src/DataBase/MySQLX/Model.hs | mit | specialCharFound (x:xs)
| x == '\'' = True
| x == '"' = True
| x == '`' = True
| x == '$' = True
| x == '.' = True
| x == '-' = True
| otherwise = specialCharFound xs | 199 | specialCharFound (x:xs)
| x == '\'' = True
| x == '"' = True
| x == '`' = True
| x == '$' = True
| x == '.' = True
| x == '-' = True
| otherwise = specialCharFound xs | 199 | specialCharFound (x:xs)
| x == '\'' = True
| x == '"' = True
| x == '`' = True
| x == '$' = True
| x == '.' = True
| x == '-' = True
| otherwise = specialCharFound xs | 199 | false | false | 0 | 8 | 75 | 116 | 53 | 63 | null | null |
ekmett/wxHaskell | samples/contrib/NotebookRight.hs | lgpl-2.1 | notebookRight parent props
= do nb <- notebookCreate parent idAny rectNull ( wxCLIP_CHILDREN + wxNB_RIGHT)
set nb props
return nb | 146 | notebookRight parent props
= do nb <- notebookCreate parent idAny rectNull ( wxCLIP_CHILDREN + wxNB_RIGHT)
set nb props
return nb | 146 | notebookRight parent props
= do nb <- notebookCreate parent idAny rectNull ( wxCLIP_CHILDREN + wxNB_RIGHT)
set nb props
return nb | 146 | false | false | 1 | 11 | 36 | 53 | 21 | 32 | null | null |
singingwolfboy/citeproc-hs | src/Text/CSL/Input/MODS.hs | bsd-3-clause | readDate :: String -> [RefDate]
readDate s = if takeWhile isDigit s /= []
then return $ RefDate (takeWhile isDigit s) [] [] [] [] []
else [] | 166 | readDate :: String -> [RefDate]
readDate s = if takeWhile isDigit s /= []
then return $ RefDate (takeWhile isDigit s) [] [] [] [] []
else [] | 166 | readDate s = if takeWhile isDigit s /= []
then return $ RefDate (takeWhile isDigit s) [] [] [] [] []
else [] | 134 | false | true | 0 | 9 | 53 | 77 | 39 | 38 | null | null |
kellino/TypeSystems | typedArith/Eval.hs | mit | eval (TmIsZero (TmSucc nv)) | isNumerical nv = return TmFalse | 61 | eval (TmIsZero (TmSucc nv)) | isNumerical nv = return TmFalse | 61 | eval (TmIsZero (TmSucc nv)) | isNumerical nv = return TmFalse | 61 | false | false | 0 | 8 | 9 | 34 | 14 | 20 | null | null |
DavidAlphaFox/ghc | compiler/hsSyn/HsTypes.hs | bsd-3-clause | mkHsAppTys fun_ty (arg_ty:arg_tys)
= foldl mk_app (HsAppTy fun_ty arg_ty) arg_tys
where
mk_app fun arg = HsAppTy (noLoc fun) arg
-- Add noLocs for inner nodes of the application;
-- they are never used | 223 | mkHsAppTys fun_ty (arg_ty:arg_tys)
= foldl mk_app (HsAppTy fun_ty arg_ty) arg_tys
where
mk_app fun arg = HsAppTy (noLoc fun) arg
-- Add noLocs for inner nodes of the application;
-- they are never used | 223 | mkHsAppTys fun_ty (arg_ty:arg_tys)
= foldl mk_app (HsAppTy fun_ty arg_ty) arg_tys
where
mk_app fun arg = HsAppTy (noLoc fun) arg
-- Add noLocs for inner nodes of the application;
-- they are never used | 223 | false | false | 0 | 7 | 54 | 58 | 29 | 29 | null | null |
tundra/nls | hs/Sexp.hs | apache-2.0 | allCompiledTokens = [(compileRegex s, f) | (s, f) <- allTokens]
where compileRegex s = mkRegexWithOpts ("^(" ++ s ++ ")") True False
-- Given a string, returns the first match against a token and the rest of
-- the string, or Nothing if no tokens match the input. | 266 | allCompiledTokens = [(compileRegex s, f) | (s, f) <- allTokens]
where compileRegex s = mkRegexWithOpts ("^(" ++ s ++ ")") True False
-- Given a string, returns the first match against a token and the rest of
-- the string, or Nothing if no tokens match the input. | 266 | allCompiledTokens = [(compileRegex s, f) | (s, f) <- allTokens]
where compileRegex s = mkRegexWithOpts ("^(" ++ s ++ ")") True False
-- Given a string, returns the first match against a token and the rest of
-- the string, or Nothing if no tokens match the input. | 266 | false | false | 0 | 8 | 50 | 63 | 34 | 29 | null | null |
cabrera/ghc-mod | Language/Haskell/GhcMod/Logger.hs | bsd-3-clause | ----------------------------------------------------------------
ppErrMsg :: DynFlags -> PprStyle -> ErrMsg -> String
ppErrMsg dflag style err = ppMsg spn SevError dflag style msg ++ (if null ext then "" else "\n" ++ ext)
where
spn = Gap.errorMsgSpan err
msg = errMsgShortDoc err
ext = showPage dflag style (errMsgExtraInfo err) | 347 | ppErrMsg :: DynFlags -> PprStyle -> ErrMsg -> String
ppErrMsg dflag style err = ppMsg spn SevError dflag style msg ++ (if null ext then "" else "\n" ++ ext)
where
spn = Gap.errorMsgSpan err
msg = errMsgShortDoc err
ext = showPage dflag style (errMsgExtraInfo err) | 281 | ppErrMsg dflag style err = ppMsg spn SevError dflag style msg ++ (if null ext then "" else "\n" ++ ext)
where
spn = Gap.errorMsgSpan err
msg = errMsgShortDoc err
ext = showPage dflag style (errMsgExtraInfo err) | 228 | true | true | 3 | 9 | 65 | 120 | 53 | 67 | null | null |
abstools/abs-haskell-formal | benchmarks/2_primality_test/progs/2500.hs | bsd-3-clause | main_ :: Method
main_ [] this wb k =
Assign n (Val (I 2500)) $
Assign x (Sync is_prime [n]) $
k | 103 | main_ :: Method
main_ [] this wb k =
Assign n (Val (I 2500)) $
Assign x (Sync is_prime [n]) $
k | 103 | main_ [] this wb k =
Assign n (Val (I 2500)) $
Assign x (Sync is_prime [n]) $
k | 87 | false | true | 0 | 11 | 29 | 63 | 31 | 32 | null | null |
kawamuray/ganeti | src/Ganeti/JSON.hs | gpl-2.0 | -- | Reads the value of a key in a JSON object.
fromObj :: (J.JSON a, Monad m) => JSRecord -> String -> m a
fromObj o k =
case lookup k o of
Nothing -> fail $ buildNoKeyError o k
Just val -> fromKeyValue k val
-- | Reads the value of an optional key in a JSON object. Missing
-- keys, or keys that have a \'null\' value, will be returned as
-- 'Nothing', otherwise we attempt deserialisation and return a 'Just'
-- value. | 432 | fromObj :: (J.JSON a, Monad m) => JSRecord -> String -> m a
fromObj o k =
case lookup k o of
Nothing -> fail $ buildNoKeyError o k
Just val -> fromKeyValue k val
-- | Reads the value of an optional key in a JSON object. Missing
-- keys, or keys that have a \'null\' value, will be returned as
-- 'Nothing', otherwise we attempt deserialisation and return a 'Just'
-- value. | 384 | fromObj o k =
case lookup k o of
Nothing -> fail $ buildNoKeyError o k
Just val -> fromKeyValue k val
-- | Reads the value of an optional key in a JSON object. Missing
-- keys, or keys that have a \'null\' value, will be returned as
-- 'Nothing', otherwise we attempt deserialisation and return a 'Just'
-- value. | 324 | true | true | 0 | 9 | 96 | 91 | 45 | 46 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/cabal-install/Distribution/Client/Tar.hs | bsd-3-clause | --TODO: check integer widths, eg for large file sizes
putOct :: (Show a, Integral a) => FieldWidth -> a -> String
putOct n x =
let octStr = take (n-1) $ showOct x ""
in fill (n - length octStr - 1) '0'
++ octStr
++ putChar8 '\NUL' | 241 | putOct :: (Show a, Integral a) => FieldWidth -> a -> String
putOct n x =
let octStr = take (n-1) $ showOct x ""
in fill (n - length octStr - 1) '0'
++ octStr
++ putChar8 '\NUL' | 187 | putOct n x =
let octStr = take (n-1) $ showOct x ""
in fill (n - length octStr - 1) '0'
++ octStr
++ putChar8 '\NUL' | 127 | true | true | 4 | 12 | 58 | 102 | 49 | 53 | null | null |
romanb/amazonka | amazonka-cloudhsm/gen/Network/AWS/CloudHSM/CreateHsm.hs | mpl-2.0 | -- | 'CreateHsmResponse' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'chrHsmArn' @::@ 'Maybe' 'Text'
--
createHsmResponse :: CreateHsmResponse
createHsmResponse = CreateHsmResponse
{ _chrHsmArn = Nothing
} | 252 | createHsmResponse :: CreateHsmResponse
createHsmResponse = CreateHsmResponse
{ _chrHsmArn = Nothing
} | 109 | createHsmResponse = CreateHsmResponse
{ _chrHsmArn = Nothing
} | 70 | true | true | 0 | 6 | 39 | 25 | 17 | 8 | null | null |
fmapfmapfmap/amazonka | amazonka-codepipeline/gen/Network/AWS/CodePipeline/DeleteCustomActionType.hs | mpl-2.0 | -- | Creates a value of 'DeleteCustomActionType' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dcatCategory'
--
-- * 'dcatProvider'
--
-- * 'dcatVersion'
deleteCustomActionType
:: ActionCategory -- ^ 'dcatCategory'
-> Text -- ^ 'dcatProvider'
-> Text -- ^ 'dcatVersion'
-> DeleteCustomActionType
deleteCustomActionType pCategory_ pProvider_ pVersion_ =
DeleteCustomActionType'
{ _dcatCategory = pCategory_
, _dcatProvider = pProvider_
, _dcatVersion = pVersion_
} | 587 | deleteCustomActionType
:: ActionCategory -- ^ 'dcatCategory'
-> Text -- ^ 'dcatProvider'
-> Text -- ^ 'dcatVersion'
-> DeleteCustomActionType
deleteCustomActionType pCategory_ pProvider_ pVersion_ =
DeleteCustomActionType'
{ _dcatCategory = pCategory_
, _dcatProvider = pProvider_
, _dcatVersion = pVersion_
} | 345 | deleteCustomActionType pCategory_ pProvider_ pVersion_ =
DeleteCustomActionType'
{ _dcatCategory = pCategory_
, _dcatProvider = pProvider_
, _dcatVersion = pVersion_
} | 187 | true | true | 0 | 7 | 114 | 62 | 40 | 22 | null | null |
nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles | IO/src/VigenereCipher.hs | gpl-3.0 | decrypt :: Key -> Secret -> PlainText
decrypt k = apply sub (cycle k) | 69 | decrypt :: Key -> Secret -> PlainText
decrypt k = apply sub (cycle k) | 69 | decrypt k = apply sub (cycle k) | 31 | false | true | 0 | 8 | 13 | 40 | 17 | 23 | null | null |
martin-kolinek/some-board-game-rules | test/TestHelpers.hs | mit | isGrass :: Foldable t => t Building -> Position -> Bool
isGrass buildingSpace pos = SmallBuilding Grass pos `elem` buildingSpace | 128 | isGrass :: Foldable t => t Building -> Position -> Bool
isGrass buildingSpace pos = SmallBuilding Grass pos `elem` buildingSpace | 128 | isGrass buildingSpace pos = SmallBuilding Grass pos `elem` buildingSpace | 72 | false | true | 0 | 7 | 19 | 45 | 22 | 23 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Hooks/Place.hs | bsd-2-clause | simpleSmart :: Placement
simpleSmart = inBounds $ smart (0,0) | 61 | simpleSmart :: Placement
simpleSmart = inBounds $ smart (0,0) | 61 | simpleSmart = inBounds $ smart (0,0) | 36 | false | true | 0 | 7 | 8 | 24 | 13 | 11 | null | null |
gintas/hfun | Queens.hs | mit | solveQueens mapStrategy rows prevRowInfo =
let newRows = validMoves prevRowInfo
solver = solveQueens mapStrategy (rows - 1)
validSuffixes = concat $ map' solver newRows
in map (rQueen prevRowInfo :) validSuffixes
where map' f xs = mapStrategy rows f xs | 270 | solveQueens mapStrategy rows prevRowInfo =
let newRows = validMoves prevRowInfo
solver = solveQueens mapStrategy (rows - 1)
validSuffixes = concat $ map' solver newRows
in map (rQueen prevRowInfo :) validSuffixes
where map' f xs = mapStrategy rows f xs | 270 | solveQueens mapStrategy rows prevRowInfo =
let newRows = validMoves prevRowInfo
solver = solveQueens mapStrategy (rows - 1)
validSuffixes = concat $ map' solver newRows
in map (rQueen prevRowInfo :) validSuffixes
where map' f xs = mapStrategy rows f xs | 270 | false | false | 0 | 11 | 56 | 89 | 43 | 46 | null | null |
ian-ross/ggp | Language/GDL/Quote.hs | bsd-3-clause | antiP :: AntiQuoter Pat
antiP = bSPat <>> antiPat <>> const Nothing | 67 | antiP :: AntiQuoter Pat
antiP = bSPat <>> antiPat <>> const Nothing | 67 | antiP = bSPat <>> antiPat <>> const Nothing | 43 | false | true | 2 | 6 | 11 | 31 | 13 | 18 | null | null |
dmbarbour/awelon | hsrc/AO/AOFile.hs | bsd-3-clause | loadAO :: (MonadIO m) => LoadAO m () -> (String -> m ()) -> m [AOFile]
loadAO ldRoot warn = ld_completed `liftM` execStateT ldDeep st0 where
st0 = LoaderState [] warn [] []
ldDeep = initAO_PATH >> ldRoot >> runUntilDone
-- Process AO_PATH once per toplevel load. Emit warnings for any issues
-- with the AO_PATH environment variable. Reduces path to canonical
-- directories. | 384 | loadAO :: (MonadIO m) => LoadAO m () -> (String -> m ()) -> m [AOFile]
loadAO ldRoot warn = ld_completed `liftM` execStateT ldDeep st0 where
st0 = LoaderState [] warn [] []
ldDeep = initAO_PATH >> ldRoot >> runUntilDone
-- Process AO_PATH once per toplevel load. Emit warnings for any issues
-- with the AO_PATH environment variable. Reduces path to canonical
-- directories. | 384 | loadAO ldRoot warn = ld_completed `liftM` execStateT ldDeep st0 where
st0 = LoaderState [] warn [] []
ldDeep = initAO_PATH >> ldRoot >> runUntilDone
-- Process AO_PATH once per toplevel load. Emit warnings for any issues
-- with the AO_PATH environment variable. Reduces path to canonical
-- directories. | 313 | false | true | 0 | 11 | 72 | 112 | 57 | 55 | null | null |
rahulmutt/ghcvm | compiler/Eta/CodeGen/Monad.hs | bsd-3-clause | addScopedBinding :: CgIdInfo -> CodeGen ()
addScopedBinding cgIdInfo = do
bindings <- getScopedBindings
setScopedBindings $ extendVarEnv bindings (cgId cgIdInfo) cgIdInfo | 174 | addScopedBinding :: CgIdInfo -> CodeGen ()
addScopedBinding cgIdInfo = do
bindings <- getScopedBindings
setScopedBindings $ extendVarEnv bindings (cgId cgIdInfo) cgIdInfo | 174 | addScopedBinding cgIdInfo = do
bindings <- getScopedBindings
setScopedBindings $ extendVarEnv bindings (cgId cgIdInfo) cgIdInfo | 131 | false | true | 0 | 10 | 23 | 50 | 23 | 27 | null | null |
yoo-e/yesod-helpers | Yesod/Helpers/LoginUser.hs | bsd-3-clause | getLoggedInId :: (LoginUser site u, MonadHandler m, HandlerSite m ~ site)
=> Proxy u -> m (Maybe (Key u))
getLoggedInId mu = do
foundation <- getYesod
liftM (join . (fmap $ loginIdentToKey foundation mu)) $ getLoggedInIdent mu
-- | 在 session 中标记某个用户为登录状态 | 274 | getLoggedInId :: (LoginUser site u, MonadHandler m, HandlerSite m ~ site)
=> Proxy u -> m (Maybe (Key u))
getLoggedInId mu = do
foundation <- getYesod
liftM (join . (fmap $ loginIdentToKey foundation mu)) $ getLoggedInIdent mu
-- | 在 session 中标记某个用户为登录状态 | 274 | getLoggedInId mu = do
foundation <- getYesod
liftM (join . (fmap $ loginIdentToKey foundation mu)) $ getLoggedInIdent mu
-- | 在 session 中标记某个用户为登录状态 | 154 | false | true | 0 | 13 | 61 | 104 | 50 | 54 | null | null |
typelead/epm | Cabal/Distribution/Simple/Setup.hs | bsd-3-clause | emptyBuildFlags :: BuildFlags
emptyBuildFlags = mempty | 54 | emptyBuildFlags :: BuildFlags
emptyBuildFlags = mempty | 54 | emptyBuildFlags = mempty | 24 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
danr/hipspec | examples/old-examples/hip/Expr.hs | gpl-3.0 | prop_free :: Lam -> Nat -> Prop Bool
prop_free e v = v `mem` freeVars e =:= v `freeIn` e | 88 | prop_free :: Lam -> Nat -> Prop Bool
prop_free e v = v `mem` freeVars e =:= v `freeIn` e | 88 | prop_free e v = v `mem` freeVars e =:= v `freeIn` e | 51 | false | true | 0 | 8 | 19 | 54 | 26 | 28 | null | null |
vTurbine/ghc | compiler/iface/IfaceType.hs | bsd-3-clause | eqIfaceType env (IfaceDFunTy t11 t12) (IfaceDFunTy t21 t22)
= eqIfaceType env t11 t21 && eqIfaceType env t12 t22 | 116 | eqIfaceType env (IfaceDFunTy t11 t12) (IfaceDFunTy t21 t22)
= eqIfaceType env t11 t21 && eqIfaceType env t12 t22 | 116 | eqIfaceType env (IfaceDFunTy t11 t12) (IfaceDFunTy t21 t22)
= eqIfaceType env t11 t21 && eqIfaceType env t12 t22 | 116 | false | false | 0 | 7 | 21 | 47 | 22 | 25 | null | null |
airobert/yices_haskell | Math/SMT/Yices/Syntax.hs | bsd-3-clause | showTypY (DATATYPE ctordefs) =
paren $ showString "datatype " . showListSepByWith showCtorDef " " ctordefs | 115 | showTypY (DATATYPE ctordefs) =
paren $ showString "datatype " . showListSepByWith showCtorDef " " ctordefs | 115 | showTypY (DATATYPE ctordefs) =
paren $ showString "datatype " . showListSepByWith showCtorDef " " ctordefs | 115 | false | false | 0 | 7 | 23 | 33 | 15 | 18 | null | null |
sapek/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | umlaut 'O' = "Ö" | 16 | umlaut 'O' = "Ö" | 16 | umlaut 'O' = "Ö" | 16 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
lfritz/python-type-inference | python-type-inference/src/Language/Python/TypeInference/UserSuppliedTypes.hs | bsd-3-clause | iClassId :: I -> Maybe ClassId
iClassId (InClass classId _) = Just classId | 77 | iClassId :: I -> Maybe ClassId
iClassId (InClass classId _) = Just classId | 77 | iClassId (InClass classId _) = Just classId | 46 | false | true | 0 | 7 | 15 | 32 | 15 | 17 | null | null |
xmonad/xmonad | src/XMonad/Operations.hs | bsd-3-clause | -- | Update the layout field of a workspace.
updateLayout :: WorkspaceId -> Maybe (Layout Window) -> X ()
updateLayout i ml = whenJust ml $ \l ->
runOnWorkspaces $ \ww -> return $ if W.tag ww == i then ww { W.layout = l} else ww | 232 | updateLayout :: WorkspaceId -> Maybe (Layout Window) -> X ()
updateLayout i ml = whenJust ml $ \l ->
runOnWorkspaces $ \ww -> return $ if W.tag ww == i then ww { W.layout = l} else ww | 187 | updateLayout i ml = whenJust ml $ \l ->
runOnWorkspaces $ \ww -> return $ if W.tag ww == i then ww { W.layout = l} else ww | 126 | true | true | 0 | 13 | 50 | 91 | 47 | 44 | null | null |
themattchan/tandoori | library/Tandoori/Typing/UnifyPred.hs | bsd-3-clause | substPreds :: Subst -> Set PolyPred -> ErrorT TypingError Typing (Set PolyPred)
substPreds θ ctx =
do πs <- concat <$> (mapM (substPred θ) $ Set.toList ctx)
Set.fromList <$> lift (simplifyCtx πs) | 202 | substPreds :: Subst -> Set PolyPred -> ErrorT TypingError Typing (Set PolyPred)
substPreds θ ctx =
do πs <- concat <$> (mapM (substPred θ) $ Set.toList ctx)
Set.fromList <$> lift (simplifyCtx πs) | 202 | substPreds θ ctx =
do πs <- concat <$> (mapM (substPred θ) $ Set.toList ctx)
Set.fromList <$> lift (simplifyCtx πs) | 122 | false | true | 0 | 13 | 38 | 90 | 42 | 48 | null | null |
SKA-ScienceDataProcessor/RC | MS4/lib/DNA/DSL.hs | apache-2.0 | -- | Executes a kernel computation. The computation will be bound to
-- an operating system thread by default (see also 'unboundKernel').
-- The function will block until computation is done. Profile hints
-- can be used to request profiling where desired.
--
-- For example, we could define @ddpReadVector@ as used in the DNA
-- example as follows:
--
-- > ddpReadVector = actor $ \(fname, Slice off n) ->
-- > kernel "read vector" [iOHint{hintReadBytes = fromIntegral (n * 8)}] $
-- > liftIO $ readData n off fname
--
-- This "actor" reads a certain slice of a file from the disk, which
-- is implemented using a "kernel" calling the @readData@ 'IO'
-- action. As with most kernels, this could potentially become a
-- bottleneck, therefore we supply DNA with a meaningful name (@read
-- vector@) as well as a hint about how much I/O activity we
-- expect. This will prompt the profiling framework to gather evidence
-- about the actual I/O activity so we can compare it with our
-- expectations.
kernel :: String -- ^ Kernel name. This name will be used in
-- profile analysis to refer to profiling data
-- collected about the contained code.
-> [ProfileHint] -- ^ Kernel performance characteristics. This
-- will prompt the framework to track
-- specialised performance metrics, allowing
-- in-depth analysis later.
-> Kern a -- ^ Th kernel code to execute.
-> DNA a
kernel msg hints = DNA . singleton . Kernel msg BoundKernel hints | 1,599 | kernel :: String -- ^ Kernel name. This name will be used in
-- profile analysis to refer to profiling data
-- collected about the contained code.
-> [ProfileHint] -- ^ Kernel performance characteristics. This
-- will prompt the framework to track
-- specialised performance metrics, allowing
-- in-depth analysis later.
-> Kern a -- ^ Th kernel code to execute.
-> DNA a
kernel msg hints = DNA . singleton . Kernel msg BoundKernel hints | 592 | kernel msg hints = DNA . singleton . Kernel msg BoundKernel hints | 65 | true | true | 0 | 8 | 416 | 80 | 53 | 27 | null | null |
carliros/dbjava | src/Jvm/BinaryClass.hs | bsd-3-clause | getListLineNumber n str
= let (wstart_pc, str1, n1) = runGetState (get :: Get Word16) str (toInt64 0)
start_pc = fromWord162Int wstart_pc
(wline_number, str2, n2) = runGetState (get :: Get Word16) str1 (toInt64 0)
line_number = fromWord162Int wline_number
in let (lst,r) = getListLineNumber (n-1) str2 in ((start_pc,line_number):lst, r) | 409 | getListLineNumber n str
= let (wstart_pc, str1, n1) = runGetState (get :: Get Word16) str (toInt64 0)
start_pc = fromWord162Int wstart_pc
(wline_number, str2, n2) = runGetState (get :: Get Word16) str1 (toInt64 0)
line_number = fromWord162Int wline_number
in let (lst,r) = getListLineNumber (n-1) str2 in ((start_pc,line_number):lst, r) | 409 | getListLineNumber n str
= let (wstart_pc, str1, n1) = runGetState (get :: Get Word16) str (toInt64 0)
start_pc = fromWord162Int wstart_pc
(wline_number, str2, n2) = runGetState (get :: Get Word16) str1 (toInt64 0)
line_number = fromWord162Int wline_number
in let (lst,r) = getListLineNumber (n-1) str2 in ((start_pc,line_number):lst, r) | 409 | false | false | 0 | 13 | 119 | 153 | 80 | 73 | null | null |
Lokathor/hexes | src/Hexes/Internal/Shader.hs | mit | -- | Our vertex shader
vertexShaderSource :: String
vertexShaderSource = [r|
#version 330 core
layout (location = 0) in vec2 position;
layout (location = 1) in vec2 texST;
layout (location = 2) in vec3 background;
layout (location = 3) in vec4 foreground;
uniform vec2 windowResolution;
out vec2 fragmentTexST;
out vec3 fragmentBackground;
out vec4 fragmentForeground;
void main()
{
// Assign our position.
float normX = (position.x / windowResolution.x)*2.0 - 1.0;
float normY = ((windowResolution.y - position.y) / windowResolution.y)*2.0 - 1.0;
gl_Position = vec4(normX, normY, 1.0, 1.0);
// Pass along the extra info.
fragmentTexST = texST;
fragmentBackground = background;
fragmentForeground = foreground;
}
|] | 835 | vertexShaderSource :: String
vertexShaderSource = [r|
#version 330 core
layout (location = 0) in vec2 position;
layout (location = 1) in vec2 texST;
layout (location = 2) in vec3 background;
layout (location = 3) in vec4 foreground;
uniform vec2 windowResolution;
out vec2 fragmentTexST;
out vec3 fragmentBackground;
out vec4 fragmentForeground;
void main()
{
// Assign our position.
float normX = (position.x / windowResolution.x)*2.0 - 1.0;
float normY = ((windowResolution.y - position.y) / windowResolution.y)*2.0 - 1.0;
gl_Position = vec4(normX, normY, 1.0, 1.0);
// Pass along the extra info.
fragmentTexST = texST;
fragmentBackground = background;
fragmentForeground = foreground;
}
|] | 812 | vertexShaderSource = [r|
#version 330 core
layout (location = 0) in vec2 position;
layout (location = 1) in vec2 texST;
layout (location = 2) in vec3 background;
layout (location = 3) in vec4 foreground;
uniform vec2 windowResolution;
out vec2 fragmentTexST;
out vec3 fragmentBackground;
out vec4 fragmentForeground;
void main()
{
// Assign our position.
float normX = (position.x / windowResolution.x)*2.0 - 1.0;
float normY = ((windowResolution.y - position.y) / windowResolution.y)*2.0 - 1.0;
gl_Position = vec4(normX, normY, 1.0, 1.0);
// Pass along the extra info.
fragmentTexST = texST;
fragmentBackground = background;
fragmentForeground = foreground;
}
|] | 783 | true | true | 0 | 6 | 221 | 23 | 12 | 11 | null | null |
facebookincubator/duckling | Duckling/Numeral/TA/Rules.hs | bsd-3-clause | tensMap :: HashMap Text Integer
tensMap = HashMap.fromList
[ ( "இருபது", 20 )
, ( "இருபத்தி", 20 )
, ( "முப்பது", 30 )
, ( "முப்பத்து", 30 )
, ( "நாற்பது", 40 )
, ( "நாற்பத்து", 40 )
, ( "ஐம்பது", 50 )
, ( "ஐம்பத்தி", 50 )
, ( "அறுபது", 60 )
, ( "அறுபத்", 60 )
, ( "எழுபது", 70 )
, ( "எழுபத்தி", 70 )
, ( "எண்பது", 80 )
, ( "எண்பத்", 80 )
, ( "தொண்ணூறு", 90 )
, ( "தொண்ணுற்று", 90 )
] | 419 | tensMap :: HashMap Text Integer
tensMap = HashMap.fromList
[ ( "இருபது", 20 )
, ( "இருபத்தி", 20 )
, ( "முப்பது", 30 )
, ( "முப்பத்து", 30 )
, ( "நாற்பது", 40 )
, ( "நாற்பத்து", 40 )
, ( "ஐம்பது", 50 )
, ( "ஐம்பத்தி", 50 )
, ( "அறுபது", 60 )
, ( "அறுபத்", 60 )
, ( "எழுபது", 70 )
, ( "எழுபத்தி", 70 )
, ( "எண்பது", 80 )
, ( "எண்பத்", 80 )
, ( "தொண்ணூறு", 90 )
, ( "தொண்ணுற்று", 90 )
] | 419 | tensMap = HashMap.fromList
[ ( "இருபது", 20 )
, ( "இருபத்தி", 20 )
, ( "முப்பது", 30 )
, ( "முப்பத்து", 30 )
, ( "நாற்பது", 40 )
, ( "நாற்பத்து", 40 )
, ( "ஐம்பது", 50 )
, ( "ஐம்பத்தி", 50 )
, ( "அறுபது", 60 )
, ( "அறுபத்", 60 )
, ( "எழுபது", 70 )
, ( "எழுபத்தி", 70 )
, ( "எண்பது", 80 )
, ( "எண்பத்", 80 )
, ( "தொண்ணூறு", 90 )
, ( "தொண்ணுற்று", 90 )
] | 387 | false | true | 0 | 6 | 122 | 165 | 106 | 59 | null | null |
sinelaw/stack | src/Stack/Setup.hs | bsd-3-clause | markInstalled :: (MonadIO m, MonadReader env m, HasConfig env, MonadThrow m)
=> PackageIdentifier -- ^ e.g., ghc-7.8.4, msys2-20150512
-> m ()
markInstalled ident = do
dir <- asks $ configLocalPrograms . getConfig
fpRel <- parseRelFile $ packageIdentifierString ident ++ ".installed"
liftIO $ writeFile (toFilePath $ dir </> fpRel) "installed" | 383 | markInstalled :: (MonadIO m, MonadReader env m, HasConfig env, MonadThrow m)
=> PackageIdentifier -- ^ e.g., ghc-7.8.4, msys2-20150512
-> m ()
markInstalled ident = do
dir <- asks $ configLocalPrograms . getConfig
fpRel <- parseRelFile $ packageIdentifierString ident ++ ".installed"
liftIO $ writeFile (toFilePath $ dir </> fpRel) "installed" | 383 | markInstalled ident = do
dir <- asks $ configLocalPrograms . getConfig
fpRel <- parseRelFile $ packageIdentifierString ident ++ ".installed"
liftIO $ writeFile (toFilePath $ dir </> fpRel) "installed" | 212 | false | true | 0 | 11 | 88 | 109 | 53 | 56 | null | null |
spechub/Hets | OWL2/StaticAnalysis.hs | gpl-2.0 | checkDGAtom :: Sign -> Maybe [AS.Variable] -> AS.DGAtom -> Result AS.DGAtom
checkDGAtom s mVars atom = case atom of
AS.DGClassAtom c a -> do
nExpr <- checkClassExpression s c
checkIndividualArg s mVars a
return $ AS.DGClassAtom nExpr a
AS.DGObjectPropertyAtom o a1 a2 -> do
checkObjPropList s [o]
checkIndividualArg s mVars a1
checkIndividualArg s mVars a2
return atom | 432 | checkDGAtom :: Sign -> Maybe [AS.Variable] -> AS.DGAtom -> Result AS.DGAtom
checkDGAtom s mVars atom = case atom of
AS.DGClassAtom c a -> do
nExpr <- checkClassExpression s c
checkIndividualArg s mVars a
return $ AS.DGClassAtom nExpr a
AS.DGObjectPropertyAtom o a1 a2 -> do
checkObjPropList s [o]
checkIndividualArg s mVars a1
checkIndividualArg s mVars a2
return atom | 432 | checkDGAtom s mVars atom = case atom of
AS.DGClassAtom c a -> do
nExpr <- checkClassExpression s c
checkIndividualArg s mVars a
return $ AS.DGClassAtom nExpr a
AS.DGObjectPropertyAtom o a1 a2 -> do
checkObjPropList s [o]
checkIndividualArg s mVars a1
checkIndividualArg s mVars a2
return atom | 356 | false | true | 0 | 12 | 120 | 155 | 68 | 87 | null | null |
TurpIF/Drawhub | src/main/Main.hs | mit | dayReader :: ReadM Day
dayReader = eitherReader $ \arg ->
case parseTimeM True defaultTimeLocale "%Y-%m-%d" arg of
Nothing -> Left ("Cannot parse date: " ++ arg)
Just day -> Right day | 203 | dayReader :: ReadM Day
dayReader = eitherReader $ \arg ->
case parseTimeM True defaultTimeLocale "%Y-%m-%d" arg of
Nothing -> Left ("Cannot parse date: " ++ arg)
Just day -> Right day | 203 | dayReader = eitherReader $ \arg ->
case parseTimeM True defaultTimeLocale "%Y-%m-%d" arg of
Nothing -> Left ("Cannot parse date: " ++ arg)
Just day -> Right day | 180 | false | true | 1 | 12 | 50 | 67 | 31 | 36 | null | null |
ocharles/iCalendar | Text/ICalendar/Parser/Components.hs | bsd-3-clause | -- | Parse a VTIMEZONE component. 3.6.5
parseVTimeZone :: Content -> ContentParser VTimeZone
parseVTimeZone (Component _ "VTIMEZONE" _) = do
vtzId <- reqLine1 "TZID" parseTZID
vtzLastMod <- optLine1 "LAST-MODIFIED" (Just .: parseLastModified)
vtzUrl <- optLine1 "TZURL" (Just .: parseSimpleURI TZUrl)
vtzStandardC <- optCompN "STANDARD" parseTZProp
vtzDaylightC <- optCompN "DAYLIGHT" parseTZProp
when (S.size vtzStandardC + S.size vtzDaylightC < 1) .
throwError $ "VTIMEZONE must include at least one of the STANDARD or \
\DAYLIGHT components."
vtzOther <- otherProperties
return VTimeZone {..} | 656 | parseVTimeZone :: Content -> ContentParser VTimeZone
parseVTimeZone (Component _ "VTIMEZONE" _) = do
vtzId <- reqLine1 "TZID" parseTZID
vtzLastMod <- optLine1 "LAST-MODIFIED" (Just .: parseLastModified)
vtzUrl <- optLine1 "TZURL" (Just .: parseSimpleURI TZUrl)
vtzStandardC <- optCompN "STANDARD" parseTZProp
vtzDaylightC <- optCompN "DAYLIGHT" parseTZProp
when (S.size vtzStandardC + S.size vtzDaylightC < 1) .
throwError $ "VTIMEZONE must include at least one of the STANDARD or \
\DAYLIGHT components."
vtzOther <- otherProperties
return VTimeZone {..} | 616 | parseVTimeZone (Component _ "VTIMEZONE" _) = do
vtzId <- reqLine1 "TZID" parseTZID
vtzLastMod <- optLine1 "LAST-MODIFIED" (Just .: parseLastModified)
vtzUrl <- optLine1 "TZURL" (Just .: parseSimpleURI TZUrl)
vtzStandardC <- optCompN "STANDARD" parseTZProp
vtzDaylightC <- optCompN "DAYLIGHT" parseTZProp
when (S.size vtzStandardC + S.size vtzDaylightC < 1) .
throwError $ "VTIMEZONE must include at least one of the STANDARD or \
\DAYLIGHT components."
vtzOther <- otherProperties
return VTimeZone {..} | 563 | true | true | 0 | 14 | 140 | 162 | 74 | 88 | null | null |
hamishmack/reflex-dom | src/Reflex/Dom/Widget/Basic.hs | bsd-3-clause | --TODO: Should this be renamed to 'widgetView' for consistency with 'widgetHold'?
dyn :: MonadWidget t m => Dynamic t (m a) -> m (Event t a)
dyn child = do
startPlaceholder <- text' ""
endPlaceholder <- text' ""
(newChildBuilt, newChildBuiltTriggerRef) <- newEventWithTriggerRef
let e = fmap snd newChildBuilt --TODO: Get rid of this hack
childVoidAction <- hold never e
performEvent_ $ fmap (const $ return ()) e --TODO: Get rid of this hack
addVoidAction $ switch childVoidAction
doc <- askDocument
runWidget <- getRunWidget
let build c = do
Just df <- createDocumentFragment doc
(result, postBuild, voidActions) <- runWidget df c
runFrameWithTriggerRef newChildBuiltTriggerRef (result, voidActions)
postBuild
Just p <- getParentNode endPlaceholder
_ <- insertBefore p (Just df) (Just endPlaceholder)
return ()
schedulePostBuild $ do
c <- sample $ current child
build c
addVoidAction $ ffor (updated child) $ \newChild -> do
liftIO $ deleteBetweenExclusive startPlaceholder endPlaceholder
build newChild
return $ fmap fst newChildBuilt | 1,135 | dyn :: MonadWidget t m => Dynamic t (m a) -> m (Event t a)
dyn child = do
startPlaceholder <- text' ""
endPlaceholder <- text' ""
(newChildBuilt, newChildBuiltTriggerRef) <- newEventWithTriggerRef
let e = fmap snd newChildBuilt --TODO: Get rid of this hack
childVoidAction <- hold never e
performEvent_ $ fmap (const $ return ()) e --TODO: Get rid of this hack
addVoidAction $ switch childVoidAction
doc <- askDocument
runWidget <- getRunWidget
let build c = do
Just df <- createDocumentFragment doc
(result, postBuild, voidActions) <- runWidget df c
runFrameWithTriggerRef newChildBuiltTriggerRef (result, voidActions)
postBuild
Just p <- getParentNode endPlaceholder
_ <- insertBefore p (Just df) (Just endPlaceholder)
return ()
schedulePostBuild $ do
c <- sample $ current child
build c
addVoidAction $ ffor (updated child) $ \newChild -> do
liftIO $ deleteBetweenExclusive startPlaceholder endPlaceholder
build newChild
return $ fmap fst newChildBuilt | 1,053 | dyn child = do
startPlaceholder <- text' ""
endPlaceholder <- text' ""
(newChildBuilt, newChildBuiltTriggerRef) <- newEventWithTriggerRef
let e = fmap snd newChildBuilt --TODO: Get rid of this hack
childVoidAction <- hold never e
performEvent_ $ fmap (const $ return ()) e --TODO: Get rid of this hack
addVoidAction $ switch childVoidAction
doc <- askDocument
runWidget <- getRunWidget
let build c = do
Just df <- createDocumentFragment doc
(result, postBuild, voidActions) <- runWidget df c
runFrameWithTriggerRef newChildBuiltTriggerRef (result, voidActions)
postBuild
Just p <- getParentNode endPlaceholder
_ <- insertBefore p (Just df) (Just endPlaceholder)
return ()
schedulePostBuild $ do
c <- sample $ current child
build c
addVoidAction $ ffor (updated child) $ \newChild -> do
liftIO $ deleteBetweenExclusive startPlaceholder endPlaceholder
build newChild
return $ fmap fst newChildBuilt | 994 | true | true | 0 | 16 | 249 | 356 | 158 | 198 | null | null |
lamefun/haddock | haddock-api/src/Haddock/Interface/Specialize.hs | bsd-2-clause | renameContext :: SetName name => HsContext name -> Rename name (HsContext name)
renameContext = renameLTypes | 108 | renameContext :: SetName name => HsContext name -> Rename name (HsContext name)
renameContext = renameLTypes | 108 | renameContext = renameLTypes | 28 | false | true | 0 | 9 | 14 | 36 | 17 | 19 | null | null |
noinia/virtual-persistent-fs | src/Data/FileSystem/Internal.hs | bsd-3-clause | _fileData :: FSTree t m a -> a
_fileData (File _ a) = a | 84 | _fileData :: FSTree t m a -> a
_fileData (File _ a) = a | 84 | _fileData (File _ a) = a | 33 | false | true | 0 | 7 | 42 | 33 | 16 | 17 | null | null |
elliottt/ak | src/Ak/IO.hs | bsd-3-clause | serialize :: Task -> String
serialize tsk = pStr ++ " " ++ dStr
where
pStr = show $ priority tsk
dStr = description tsk | 135 | serialize :: Task -> String
serialize tsk = pStr ++ " " ++ dStr
where
pStr = show $ priority tsk
dStr = description tsk | 135 | serialize tsk = pStr ++ " " ++ dStr
where
pStr = show $ priority tsk
dStr = description tsk | 107 | false | true | 0 | 8 | 40 | 48 | 24 | 24 | null | null |
sebastiaanvisser/orchid-doc | src/Misc/Commons.hs | bsd-3-clause | -------[ text manipulation ]---------------------------------------------------
normalCase (x:xs) = toUpper x : map toLower xs | 127 | normalCase (x:xs) = toUpper x : map toLower xs | 46 | normalCase (x:xs) = toUpper x : map toLower xs | 46 | true | false | 0 | 7 | 13 | 29 | 14 | 15 | null | null |
tvh/llvm-general-quote | src/LLVM/General/Quote/SSA.hs | bsd-3-clause | typeOfConstant C.FSub{..} = typeOfConstant operand0 | 51 | typeOfConstant C.FSub{..} = typeOfConstant operand0 | 51 | typeOfConstant C.FSub{..} = typeOfConstant operand0 | 51 | false | false | 0 | 7 | 4 | 20 | 9 | 11 | null | null |
NickAger/LearningHaskell | Monads and all that/Knights tour.hsproj/Main.hs | mit | board :: [Square]
board = [ (x,y) | x <- [0..7], y <- [0..7] ] | 62 | board :: [Square]
board = [ (x,y) | x <- [0..7], y <- [0..7] ] | 62 | board = [ (x,y) | x <- [0..7], y <- [0..7] ] | 44 | false | true | 0 | 9 | 14 | 56 | 29 | 27 | null | null |
bgamari/shaking-up-ghc | src/Base.hs | bsd-3-clause | ghcVersionH :: Action FilePath
ghcVersionH = generatedPath <&> (-/- "ghcversion.h") | 83 | ghcVersionH :: Action FilePath
ghcVersionH = generatedPath <&> (-/- "ghcversion.h") | 83 | ghcVersionH = generatedPath <&> (-/- "ghcversion.h") | 52 | false | true | 0 | 6 | 9 | 22 | 12 | 10 | null | null |
dag/happstack-yui | src/Happstack/Server/YUI.hs | bsd-2-clause | -- | Gets the class name for the grid unit of the ratio of the two argument
-- integers. YUI doesn't define redundant classes like \"6\/24\" because
-- that is the same as 1\/4 and presumably for sake of a smaller CSS file.
-- This helper function handles that for you, though:
--
-- >>> gridUnit 6 24
-- "yui3-u-1-4"
-- >>> gridUnit 24 24
-- "yui3-u-1"
--
-- The intention is for this function to be used in templates to create
-- values for class attributes, for example with HSP:
--
-- ><div class=(gridUnit 6 24)>
-- > <% someContent %>
-- ></div>
gridUnit :: Integer -> Integer -> T.Text
gridUnit n d
| num == 0 = "yui3-u"
| (num,den) == (1,1) = "yui3-u-1"
| otherwise = [qq|yui3-u-$num-$den|]
where
num = numerator $ n % d
den = denominator $ n % d
-- | Converts a pixel size to a percentage suitable for use
-- with the CSS fonts module:
--
-- >>> fontSize 16
-- "123.1%"
--
-- Useful in generated stylesheets, for example with HSP:
--
-- ><style>
-- > h1 { font-size: <% fontSize 26 %> }
-- ></style> | 1,047 | gridUnit :: Integer -> Integer -> T.Text
gridUnit n d
| num == 0 = "yui3-u"
| (num,den) == (1,1) = "yui3-u-1"
| otherwise = [qq|yui3-u-$num-$den|]
where
num = numerator $ n % d
den = denominator $ n % d
-- | Converts a pixel size to a percentage suitable for use
-- with the CSS fonts module:
--
-- >>> fontSize 16
-- "123.1%"
--
-- Useful in generated stylesheets, for example with HSP:
--
-- ><style>
-- > h1 { font-size: <% fontSize 26 %> }
-- ></style> | 493 | gridUnit n d
| num == 0 = "yui3-u"
| (num,den) == (1,1) = "yui3-u-1"
| otherwise = [qq|yui3-u-$num-$den|]
where
num = numerator $ n % d
den = denominator $ n % d
-- | Converts a pixel size to a percentage suitable for use
-- with the CSS fonts module:
--
-- >>> fontSize 16
-- "123.1%"
--
-- Useful in generated stylesheets, for example with HSP:
--
-- ><style>
-- > h1 { font-size: <% fontSize 26 %> }
-- ></style> | 452 | true | true | 9 | 9 | 233 | 148 | 83 | 65 | null | null |
UBMLtonGroup/timberc | src/Config.hs | bsd-3-clause | helpMsg = do pgm <- getProgName
return (usageInfo (header pgm) options)
where header pgm = "Usage: " ++ pgm ++ " [OPTION...] files..."
-- CmdLineOpts is a set of functions that can be queried
-- about the command line options. | 297 | helpMsg = do pgm <- getProgName
return (usageInfo (header pgm) options)
where header pgm = "Usage: " ++ pgm ++ " [OPTION...] files..."
-- CmdLineOpts is a set of functions that can be queried
-- about the command line options. | 297 | helpMsg = do pgm <- getProgName
return (usageInfo (header pgm) options)
where header pgm = "Usage: " ++ pgm ++ " [OPTION...] files..."
-- CmdLineOpts is a set of functions that can be queried
-- about the command line options. | 297 | false | false | 0 | 11 | 110 | 54 | 26 | 28 | null | null |
markuspf/Idris-dev | src/IRTS/Lang.hs | bsd-3-clause | lift env (LLam args e) = do e' <- lift (env ++ args) e
let usedArgs = nub $ usedIn env e'
fn <- getNextName
addFn fn (LFun [Inline] fn (usedArgs ++ args) e')
return (LApp False (LV fn) (map LV usedArgs)) | 315 | lift env (LLam args e) = do e' <- lift (env ++ args) e
let usedArgs = nub $ usedIn env e'
fn <- getNextName
addFn fn (LFun [Inline] fn (usedArgs ++ args) e')
return (LApp False (LV fn) (map LV usedArgs)) | 315 | lift env (LLam args e) = do e' <- lift (env ++ args) e
let usedArgs = nub $ usedIn env e'
fn <- getNextName
addFn fn (LFun [Inline] fn (usedArgs ++ args) e')
return (LApp False (LV fn) (map LV usedArgs)) | 315 | false | false | 0 | 11 | 153 | 124 | 58 | 66 | null | null |
kmate/HaRe | old/testing/mkImpExplicit/B1AST.hs | bsd-3-clause | myFringe (Branch left right) = myFringe right | 45 | myFringe (Branch left right) = myFringe right | 45 | myFringe (Branch left right) = myFringe right | 45 | false | false | 0 | 6 | 6 | 21 | 9 | 12 | null | null |
mightymoose/liquidhaskell | tests/pos/RBTree-col-height.hs | bsd-3-clause | --------------------------------------------------------------------------
-- | Delete Minimum Element -----------------------------------------------
---------------------------------------------------------------------------
{-@ deleteMin :: RBT a -> RBT a @-}
deleteMin (Leaf) = Leaf
| 307 | deleteMin (Leaf) = Leaf | 31 | deleteMin (Leaf) = Leaf | 31 | true | false | 0 | 6 | 41 | 16 | 10 | 6 | null | null |
gridaphobe/liquid-fixpoint | src/Language/Fixpoint/Solver.hs | bsd-3-clause | -- putStrLn $ "Saving Binary File to: " ++ binaryFile cfg
configSolver :: (NFData a, Fixpoint a) => Config -> Solver a
configSolver cfg
| extSolver cfg = solveExt
| otherwise = solveNative | 200 | configSolver :: (NFData a, Fixpoint a) => Config -> Solver a
configSolver cfg
| extSolver cfg = solveExt
| otherwise = solveNative | 140 | configSolver cfg
| extSolver cfg = solveExt
| otherwise = solveNative | 77 | true | true | 1 | 8 | 44 | 54 | 26 | 28 | null | null |
kojiromike/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reifyIntTy (P _ n _) | n == reflm "ITChar" = return ITChar | 58 | reifyIntTy (P _ n _) | n == reflm "ITChar" = return ITChar | 58 | reifyIntTy (P _ n _) | n == reflm "ITChar" = return ITChar | 58 | false | false | 0 | 9 | 12 | 35 | 15 | 20 | null | null |
scvalex/logorrhea | bot/DrLogos.hs | bsd-3-clause | drLogos :: BotProcess BotState
drLogos Message { msg_prefix = Just (NickName nn _ _)
, msg_command = "PRIVMSG"
, msg_params = [chan, msg]
}
| Just (NewQuestion tagM body) <- parseRes = newQuestion chan nn tagM body
| Just ListQuestions <- parseRes = listQuestions nn chan
| Just (History tag) <- parseRes = questionHistory nn tag
| Just ListMonitoredChannels <- parseRes = listMonitoredChannels nn
| otherwise = do
mq <- Map.lookup chan <$> gets botTags
case mq of
Nothing -> return []
Just q@(Question { qParent = parent
, qMessages = messages}) -> do
let parentMsg = unParse u_botMessage $ UserMessage nn chan msg
bs@BotState {botTags = tags} <- get
put bs {botTags = Map.insert chan
q {qMessages = (nn, msg) : messages} tags}
return [ privmsg parent parentMsg ]
where
parseRes = parse' p_userCommand msg | 1,051 | drLogos :: BotProcess BotState
drLogos Message { msg_prefix = Just (NickName nn _ _)
, msg_command = "PRIVMSG"
, msg_params = [chan, msg]
}
| Just (NewQuestion tagM body) <- parseRes = newQuestion chan nn tagM body
| Just ListQuestions <- parseRes = listQuestions nn chan
| Just (History tag) <- parseRes = questionHistory nn tag
| Just ListMonitoredChannels <- parseRes = listMonitoredChannels nn
| otherwise = do
mq <- Map.lookup chan <$> gets botTags
case mq of
Nothing -> return []
Just q@(Question { qParent = parent
, qMessages = messages}) -> do
let parentMsg = unParse u_botMessage $ UserMessage nn chan msg
bs@BotState {botTags = tags} <- get
put bs {botTags = Map.insert chan
q {qMessages = (nn, msg) : messages} tags}
return [ privmsg parent parentMsg ]
where
parseRes = parse' p_userCommand msg | 1,051 | drLogos Message { msg_prefix = Just (NickName nn _ _)
, msg_command = "PRIVMSG"
, msg_params = [chan, msg]
}
| Just (NewQuestion tagM body) <- parseRes = newQuestion chan nn tagM body
| Just ListQuestions <- parseRes = listQuestions nn chan
| Just (History tag) <- parseRes = questionHistory nn tag
| Just ListMonitoredChannels <- parseRes = listMonitoredChannels nn
| otherwise = do
mq <- Map.lookup chan <$> gets botTags
case mq of
Nothing -> return []
Just q@(Question { qParent = parent
, qMessages = messages}) -> do
let parentMsg = unParse u_botMessage $ UserMessage nn chan msg
bs@BotState {botTags = tags} <- get
put bs {botTags = Map.insert chan
q {qMessages = (nn, msg) : messages} tags}
return [ privmsg parent parentMsg ]
where
parseRes = parse' p_userCommand msg | 1,020 | false | true | 1 | 19 | 380 | 344 | 167 | 177 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.