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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Mathnerd314/lamdu | src/Lamdu/Main.hs | gpl-3.0 | -- Settings.Examples
nextInfoMode Settings.Examples = Settings.None | 67 | nextInfoMode Settings.Examples = Settings.None | 46 | nextInfoMode Settings.Examples = Settings.None | 46 | true | false | 0 | 6 | 5 | 14 | 7 | 7 | null | null |
SKA-ScienceDataProcessor/RC | MS1/distributed-dot-product/DNA/SingleThreaded.hs | apache-2.0 | interpret (Generate exprN) = do
n <- interpret exprN
return $ DVector $ S.generate n (const 1) | 98 | interpret (Generate exprN) = do
n <- interpret exprN
return $ DVector $ S.generate n (const 1) | 98 | interpret (Generate exprN) = do
n <- interpret exprN
return $ DVector $ S.generate n (const 1) | 98 | false | false | 0 | 10 | 20 | 49 | 22 | 27 | null | null |
idris-hackers/idris-bot | src/Main.hs | bsd-3-clause | ellipsis, returnEllipsis :: String
ellipsis = applyStyle (color grey Nothing) "…" | 81 | ellipsis, returnEllipsis :: String
ellipsis = applyStyle (color grey Nothing) "…" | 81 | ellipsis = applyStyle (color grey Nothing) "…" | 46 | false | true | 0 | 7 | 10 | 26 | 14 | 12 | null | null |
kishoredbn/barrelfish | hake/RuleDefs.hs | mit | str2dep :: String -> LibDepTree
str2dep str
| str == "vfs" = libvfs_deps_all str
| str == "vfs_ramfs" = libvfs_deps_ramfs str
| str == "vfs_nonfs" = libvfs_deps_nonfs str
| str == "vfs_noblockdev"= libvfs_deps_noblockdev str
| str == "lwip" = liblwip_deps
| str == "netQmng" = libnetQmng_deps
| otherwise = LibDep str | 392 | str2dep :: String -> LibDepTree
str2dep str
| str == "vfs" = libvfs_deps_all str
| str == "vfs_ramfs" = libvfs_deps_ramfs str
| str == "vfs_nonfs" = libvfs_deps_nonfs str
| str == "vfs_noblockdev"= libvfs_deps_noblockdev str
| str == "lwip" = liblwip_deps
| str == "netQmng" = libnetQmng_deps
| otherwise = LibDep str | 392 | str2dep str
| str == "vfs" = libvfs_deps_all str
| str == "vfs_ramfs" = libvfs_deps_ramfs str
| str == "vfs_nonfs" = libvfs_deps_nonfs str
| str == "vfs_noblockdev"= libvfs_deps_noblockdev str
| str == "lwip" = liblwip_deps
| str == "netQmng" = libnetQmng_deps
| otherwise = LibDep str | 360 | false | true | 6 | 8 | 125 | 118 | 53 | 65 | null | null |
shnarazk/mios | src/SAT/Mios/Main.hs | gpl-3.0 | analyze :: Solver -> Clause -> IO Int
analyze s@Solver{..} confl = do
-- litvec
reset litsLearnt
pushTo litsLearnt 0 -- reserve the first place for the unassigned literal
dl <- decisionLevel s
let loopOnClauseChain :: Clause -> Lit -> Int -> Int -> Int -> IO Int
loopOnClauseChain c p ti bl pathC = do -- p : literal, ti = trail index, bl = backtrack level
d <- getRank c
when (0 /= d) $ claBumpActivity s c
-- update LBD like #Glucose4.0
when (2 < d) $ do
nblevels <- lbdOf s (lits c)
when (nblevels + 1 < d) $ -- improve the LBD
-- when (d <= 30) $ set' (protected c) True -- 30 is `lbLBDFrozenClause`
-- seems to be interesting: keep it fro the next round
setRank c nblevels -- Update it
sc <- get' c
let lstack = lits c
loopOnLiterals :: Int -> Int -> Int -> IO (Int, Int)
loopOnLiterals ((<= sc) -> False) b pc = return (b, pc) -- b = btLevel, pc = pathC
loopOnLiterals j b pc = do
(q :: Lit) <- getNth lstack j
let v = lit2var q
sn <- getNth an'seen v
l <- getNth level v
if sn == 0 && 0 < l
then do
varBumpActivity s v
setNth an'seen v 1
if dl <= l -- cancelUntil doesn't clear level of cancelled literals
then do
-- UPDATEVARACTIVITY: glucose heuristics
r <- getNth reason v
when (r /= NullClause) $ do
ra <- getRank r
when (0 /= ra) $ pushTo an'lastDL q
-- end of glucose heuristics
loopOnLiterals (j + 1) b (pc + 1)
else pushTo litsLearnt q >> loopOnLiterals (j + 1) (max b l) pc
else loopOnLiterals (j + 1) b pc
(b', pathC') <- loopOnLiterals (if p == bottomLit then 1 else 2) bl pathC
let nextPickedUpLit :: Int -> IO Int -- select next clause to look at
nextPickedUpLit i = do x <- getNth an'seen . lit2var =<< getNth trail i
if x == 0 then nextPickedUpLit (i - 1) else return (i - 1)
ti' <- nextPickedUpLit (ti + 1)
nextP <- getNth trail (ti' + 1)
let nextV = lit2var nextP
confl' <- getNth reason nextV
setNth an'seen nextV 0
if 1 < pathC'
then loopOnClauseChain confl' nextP (ti' - 1) b' (pathC' - 1)
else setNth litsLearnt 1 (negateLit nextP) >> return b'
ti <- subtract 1 <$> get' trail
levelToReturn <- loopOnClauseChain confl bottomLit ti 0 0
-- Simplify phase (implemented only @expensive_ccmin@ path)
n <- get' litsLearnt
reset an'stack -- analyze_stack.clear();
reset an'toClear -- out_learnt.copyTo(analyze_toclear);
pushTo an'toClear =<< getNth litsLearnt 1
let merger :: Int -> Int64 -> IO Int64
merger ((<= n) -> False) b = return b
merger i b = do l <- getNth litsLearnt i
pushTo an'toClear l
-- restrict the search depth (range) to [0 .. 63]
merger (i + 1) . setBit b . (63 .&.) =<< getNth level (lit2var l)
levels <- merger 2 0
let loopOnLits :: Int -> Int -> IO ()
loopOnLits ((<= n) -> False) n' = shrinkBy litsLearnt $ n - n' + 1
loopOnLits i j = do
l <- getNth litsLearnt i
c1 <- (NullClause ==) <$> getNth reason (lit2var l)
if c1
then setNth litsLearnt j l >> loopOnLits (i + 1) (j + 1)
else do
c2 <- not <$> analyzeRemovable s l levels
if c2
then setNth litsLearnt j l >> loopOnLits (i + 1) (j + 1)
else loopOnLits (i + 1) j
loopOnLits 2 2 -- the first literal is specail
-- UPDATEVARACTIVITY: glucose heuristics
nld <- get' an'lastDL
r <- get' litsLearnt -- this is an estimated LBD value based on the clause size
let loopOnLastDL :: Int -> IO ()
loopOnLastDL ((<= nld) -> False) = return ()
loopOnLastDL i = do v <- lit2var <$> getNth an'lastDL i
r' <- get' =<< getNth reason v
when (r < r') $ varBumpActivity s v
loopOnLastDL $ i + 1
loopOnLastDL 1
reset an'lastDL
-- Clear seen
k <- get' an'toClear
let cleaner :: Int -> IO ()
cleaner ((<= k) -> False) = return ()
cleaner i = do v <- lit2var <$> getNth an'toClear i
setNth an'seen v 0
cleaner $ i + 1
cleaner 1
return levelToReturn
-- | #M114
-- Check if 'p' can be removed, 'abstract_levels' is used to abort early if the algorithm is
-- visiting literals at levels that cannot be removed later.
--
-- Implementation memo:
--
-- * @an'toClear@ is initialized by @ps@ in @analyze@ (a copy of 'learnt').
-- This is used only in this function and @analyze@.
-- | 5,061 | analyze :: Solver -> Clause -> IO Int
analyze s@Solver{..} confl = do
-- litvec
reset litsLearnt
pushTo litsLearnt 0 -- reserve the first place for the unassigned literal
dl <- decisionLevel s
let loopOnClauseChain :: Clause -> Lit -> Int -> Int -> Int -> IO Int
loopOnClauseChain c p ti bl pathC = do -- p : literal, ti = trail index, bl = backtrack level
d <- getRank c
when (0 /= d) $ claBumpActivity s c
-- update LBD like #Glucose4.0
when (2 < d) $ do
nblevels <- lbdOf s (lits c)
when (nblevels + 1 < d) $ -- improve the LBD
-- when (d <= 30) $ set' (protected c) True -- 30 is `lbLBDFrozenClause`
-- seems to be interesting: keep it fro the next round
setRank c nblevels -- Update it
sc <- get' c
let lstack = lits c
loopOnLiterals :: Int -> Int -> Int -> IO (Int, Int)
loopOnLiterals ((<= sc) -> False) b pc = return (b, pc) -- b = btLevel, pc = pathC
loopOnLiterals j b pc = do
(q :: Lit) <- getNth lstack j
let v = lit2var q
sn <- getNth an'seen v
l <- getNth level v
if sn == 0 && 0 < l
then do
varBumpActivity s v
setNth an'seen v 1
if dl <= l -- cancelUntil doesn't clear level of cancelled literals
then do
-- UPDATEVARACTIVITY: glucose heuristics
r <- getNth reason v
when (r /= NullClause) $ do
ra <- getRank r
when (0 /= ra) $ pushTo an'lastDL q
-- end of glucose heuristics
loopOnLiterals (j + 1) b (pc + 1)
else pushTo litsLearnt q >> loopOnLiterals (j + 1) (max b l) pc
else loopOnLiterals (j + 1) b pc
(b', pathC') <- loopOnLiterals (if p == bottomLit then 1 else 2) bl pathC
let nextPickedUpLit :: Int -> IO Int -- select next clause to look at
nextPickedUpLit i = do x <- getNth an'seen . lit2var =<< getNth trail i
if x == 0 then nextPickedUpLit (i - 1) else return (i - 1)
ti' <- nextPickedUpLit (ti + 1)
nextP <- getNth trail (ti' + 1)
let nextV = lit2var nextP
confl' <- getNth reason nextV
setNth an'seen nextV 0
if 1 < pathC'
then loopOnClauseChain confl' nextP (ti' - 1) b' (pathC' - 1)
else setNth litsLearnt 1 (negateLit nextP) >> return b'
ti <- subtract 1 <$> get' trail
levelToReturn <- loopOnClauseChain confl bottomLit ti 0 0
-- Simplify phase (implemented only @expensive_ccmin@ path)
n <- get' litsLearnt
reset an'stack -- analyze_stack.clear();
reset an'toClear -- out_learnt.copyTo(analyze_toclear);
pushTo an'toClear =<< getNth litsLearnt 1
let merger :: Int -> Int64 -> IO Int64
merger ((<= n) -> False) b = return b
merger i b = do l <- getNth litsLearnt i
pushTo an'toClear l
-- restrict the search depth (range) to [0 .. 63]
merger (i + 1) . setBit b . (63 .&.) =<< getNth level (lit2var l)
levels <- merger 2 0
let loopOnLits :: Int -> Int -> IO ()
loopOnLits ((<= n) -> False) n' = shrinkBy litsLearnt $ n - n' + 1
loopOnLits i j = do
l <- getNth litsLearnt i
c1 <- (NullClause ==) <$> getNth reason (lit2var l)
if c1
then setNth litsLearnt j l >> loopOnLits (i + 1) (j + 1)
else do
c2 <- not <$> analyzeRemovable s l levels
if c2
then setNth litsLearnt j l >> loopOnLits (i + 1) (j + 1)
else loopOnLits (i + 1) j
loopOnLits 2 2 -- the first literal is specail
-- UPDATEVARACTIVITY: glucose heuristics
nld <- get' an'lastDL
r <- get' litsLearnt -- this is an estimated LBD value based on the clause size
let loopOnLastDL :: Int -> IO ()
loopOnLastDL ((<= nld) -> False) = return ()
loopOnLastDL i = do v <- lit2var <$> getNth an'lastDL i
r' <- get' =<< getNth reason v
when (r < r') $ varBumpActivity s v
loopOnLastDL $ i + 1
loopOnLastDL 1
reset an'lastDL
-- Clear seen
k <- get' an'toClear
let cleaner :: Int -> IO ()
cleaner ((<= k) -> False) = return ()
cleaner i = do v <- lit2var <$> getNth an'toClear i
setNth an'seen v 0
cleaner $ i + 1
cleaner 1
return levelToReturn
-- | #M114
-- Check if 'p' can be removed, 'abstract_levels' is used to abort early if the algorithm is
-- visiting literals at levels that cannot be removed later.
--
-- Implementation memo:
--
-- * @an'toClear@ is initialized by @ps@ in @analyze@ (a copy of 'learnt').
-- This is used only in this function and @analyze@.
-- | 5,061 | analyze s@Solver{..} confl = do
-- litvec
reset litsLearnt
pushTo litsLearnt 0 -- reserve the first place for the unassigned literal
dl <- decisionLevel s
let loopOnClauseChain :: Clause -> Lit -> Int -> Int -> Int -> IO Int
loopOnClauseChain c p ti bl pathC = do -- p : literal, ti = trail index, bl = backtrack level
d <- getRank c
when (0 /= d) $ claBumpActivity s c
-- update LBD like #Glucose4.0
when (2 < d) $ do
nblevels <- lbdOf s (lits c)
when (nblevels + 1 < d) $ -- improve the LBD
-- when (d <= 30) $ set' (protected c) True -- 30 is `lbLBDFrozenClause`
-- seems to be interesting: keep it fro the next round
setRank c nblevels -- Update it
sc <- get' c
let lstack = lits c
loopOnLiterals :: Int -> Int -> Int -> IO (Int, Int)
loopOnLiterals ((<= sc) -> False) b pc = return (b, pc) -- b = btLevel, pc = pathC
loopOnLiterals j b pc = do
(q :: Lit) <- getNth lstack j
let v = lit2var q
sn <- getNth an'seen v
l <- getNth level v
if sn == 0 && 0 < l
then do
varBumpActivity s v
setNth an'seen v 1
if dl <= l -- cancelUntil doesn't clear level of cancelled literals
then do
-- UPDATEVARACTIVITY: glucose heuristics
r <- getNth reason v
when (r /= NullClause) $ do
ra <- getRank r
when (0 /= ra) $ pushTo an'lastDL q
-- end of glucose heuristics
loopOnLiterals (j + 1) b (pc + 1)
else pushTo litsLearnt q >> loopOnLiterals (j + 1) (max b l) pc
else loopOnLiterals (j + 1) b pc
(b', pathC') <- loopOnLiterals (if p == bottomLit then 1 else 2) bl pathC
let nextPickedUpLit :: Int -> IO Int -- select next clause to look at
nextPickedUpLit i = do x <- getNth an'seen . lit2var =<< getNth trail i
if x == 0 then nextPickedUpLit (i - 1) else return (i - 1)
ti' <- nextPickedUpLit (ti + 1)
nextP <- getNth trail (ti' + 1)
let nextV = lit2var nextP
confl' <- getNth reason nextV
setNth an'seen nextV 0
if 1 < pathC'
then loopOnClauseChain confl' nextP (ti' - 1) b' (pathC' - 1)
else setNth litsLearnt 1 (negateLit nextP) >> return b'
ti <- subtract 1 <$> get' trail
levelToReturn <- loopOnClauseChain confl bottomLit ti 0 0
-- Simplify phase (implemented only @expensive_ccmin@ path)
n <- get' litsLearnt
reset an'stack -- analyze_stack.clear();
reset an'toClear -- out_learnt.copyTo(analyze_toclear);
pushTo an'toClear =<< getNth litsLearnt 1
let merger :: Int -> Int64 -> IO Int64
merger ((<= n) -> False) b = return b
merger i b = do l <- getNth litsLearnt i
pushTo an'toClear l
-- restrict the search depth (range) to [0 .. 63]
merger (i + 1) . setBit b . (63 .&.) =<< getNth level (lit2var l)
levels <- merger 2 0
let loopOnLits :: Int -> Int -> IO ()
loopOnLits ((<= n) -> False) n' = shrinkBy litsLearnt $ n - n' + 1
loopOnLits i j = do
l <- getNth litsLearnt i
c1 <- (NullClause ==) <$> getNth reason (lit2var l)
if c1
then setNth litsLearnt j l >> loopOnLits (i + 1) (j + 1)
else do
c2 <- not <$> analyzeRemovable s l levels
if c2
then setNth litsLearnt j l >> loopOnLits (i + 1) (j + 1)
else loopOnLits (i + 1) j
loopOnLits 2 2 -- the first literal is specail
-- UPDATEVARACTIVITY: glucose heuristics
nld <- get' an'lastDL
r <- get' litsLearnt -- this is an estimated LBD value based on the clause size
let loopOnLastDL :: Int -> IO ()
loopOnLastDL ((<= nld) -> False) = return ()
loopOnLastDL i = do v <- lit2var <$> getNth an'lastDL i
r' <- get' =<< getNth reason v
when (r < r') $ varBumpActivity s v
loopOnLastDL $ i + 1
loopOnLastDL 1
reset an'lastDL
-- Clear seen
k <- get' an'toClear
let cleaner :: Int -> IO ()
cleaner ((<= k) -> False) = return ()
cleaner i = do v <- lit2var <$> getNth an'toClear i
setNth an'seen v 0
cleaner $ i + 1
cleaner 1
return levelToReturn
-- | #M114
-- Check if 'p' can be removed, 'abstract_levels' is used to abort early if the algorithm is
-- visiting literals at levels that cannot be removed later.
--
-- Implementation memo:
--
-- * @an'toClear@ is initialized by @ps@ in @analyze@ (a copy of 'learnt').
-- This is used only in this function and @analyze@.
-- | 5,023 | false | true | 29 | 24 | 1,891 | 1,466 | 718 | 748 | null | null |
olorin/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'Address' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aAssociationId'
--
-- * 'aInstanceId'
--
-- * 'aNetworkInterfaceOwnerId'
--
-- * 'aAllocationId'
--
-- * 'aDomain'
--
-- * 'aNetworkInterfaceId'
--
-- * 'aPrivateIPAddress'
--
-- * 'aPublicIP'
address
:: Address
address =
Address'
{ _aAssociationId = Nothing
, _aInstanceId = Nothing
, _aNetworkInterfaceOwnerId = Nothing
, _aAllocationId = Nothing
, _aDomain = Nothing
, _aNetworkInterfaceId = Nothing
, _aPrivateIPAddress = Nothing
, _aPublicIP = Nothing
} | 670 | address
:: Address
address =
Address'
{ _aAssociationId = Nothing
, _aInstanceId = Nothing
, _aNetworkInterfaceOwnerId = Nothing
, _aAllocationId = Nothing
, _aDomain = Nothing
, _aNetworkInterfaceId = Nothing
, _aPrivateIPAddress = Nothing
, _aPublicIP = Nothing
} | 309 | address =
Address'
{ _aAssociationId = Nothing
, _aInstanceId = Nothing
, _aNetworkInterfaceOwnerId = Nothing
, _aAllocationId = Nothing
, _aDomain = Nothing
, _aNetworkInterfaceId = Nothing
, _aPrivateIPAddress = Nothing
, _aPublicIP = Nothing
} | 286 | true | true | 0 | 6 | 144 | 80 | 58 | 22 | null | null |
rohitjha/MPL | src/Combinatorics.hs | bsd-2-clause | p :: Integer -> Integer -> Integer
p n r
| n < 1 = error "Usage - p n r, where 'n' is positive."
| r < 1 = error "Usage - p n r, where 'r' is positive."
| otherwise = product [(a-b+1) .. a]
where
a = max n r
b = min n r
{-|
The 'permutation' function returns all possible permutations of a list.
It takes one argument, which can be a list or string.
Below are a few examples:
>>> permutation "abc"
["abc","bac","cba","bca","cab","acb"]
>>> permutation [1,2]
[[1,2],[2,1]]
-} | 569 | p :: Integer -> Integer -> Integer
p n r
| n < 1 = error "Usage - p n r, where 'n' is positive."
| r < 1 = error "Usage - p n r, where 'r' is positive."
| otherwise = product [(a-b+1) .. a]
where
a = max n r
b = min n r
{-|
The 'permutation' function returns all possible permutations of a list.
It takes one argument, which can be a list or string.
Below are a few examples:
>>> permutation "abc"
["abc","bac","cba","bca","cab","acb"]
>>> permutation [1,2]
[[1,2],[2,1]]
-} | 569 | p n r
| n < 1 = error "Usage - p n r, where 'n' is positive."
| r < 1 = error "Usage - p n r, where 'r' is positive."
| otherwise = product [(a-b+1) .. a]
where
a = max n r
b = min n r
{-|
The 'permutation' function returns all possible permutations of a list.
It takes one argument, which can be a list or string.
Below are a few examples:
>>> permutation "abc"
["abc","bac","cba","bca","cab","acb"]
>>> permutation [1,2]
[[1,2],[2,1]]
-} | 534 | false | true | 1 | 9 | 188 | 110 | 53 | 57 | null | null |
jasaarim/uncrossed-paths | Main.hs | mit | {-|
Regexes for the input arguments
-}
expectedInput :: [String]
expectedInput = [ "^[a-z0-9\\._\\-]+"
, "^[1-9][0-9]*"
, "^\\([4-9],[4-9]\\)"
, "^\\([0-3],[0-3]\\)"] | 217 | expectedInput :: [String]
expectedInput = [ "^[a-z0-9\\._\\-]+"
, "^[1-9][0-9]*"
, "^\\([4-9],[4-9]\\)"
, "^\\([0-3],[0-3]\\)"] | 178 | expectedInput = [ "^[a-z0-9\\._\\-]+"
, "^[1-9][0-9]*"
, "^\\([4-9],[4-9]\\)"
, "^\\([0-3],[0-3]\\)"] | 152 | true | true | 0 | 7 | 70 | 34 | 18 | 16 | null | null |
cgorski/general-games | src/Game/Game/Poker.hs | mit | -- |
-- All full houses in a full deck of playing cards.
-- The current implementation traverses the entire list of allPossibleHands,
-- and is not efficient.
allFullHouse :: [[PlayingCard]]
allFullHouse = [x | x <- allPossibleHands, isFullHouse x] | 248 | allFullHouse :: [[PlayingCard]]
allFullHouse = [x | x <- allPossibleHands, isFullHouse x] | 89 | allFullHouse = [x | x <- allPossibleHands, isFullHouse x] | 57 | true | true | 0 | 7 | 39 | 39 | 23 | 16 | null | null |
samscott89/tamarin-prover | lib/theory/src/Theory.hs | gpl-3.0 | closeTheoryWithMaude :: SignatureWithMaude -> OpenTheory -> ClosedTheory
closeTheoryWithMaude sig thy0 = do
proveTheory (const True) checkProof
$ Theory (L.get thyName thy0) sig cache items
where
cache = closeRuleCache axioms typAsms sig rules (L.get thyCache thy0) False
checkProof = checkAndExtendProver (sorryProver Nothing)
-- Maude / Signature handle
hnd = L.get sigmMaudeHandle sig
-- Close all theory items: in parallel (especially useful for variants)
--
-- NOTE that 'rdeepseq' is OK here, as the proof has not yet been checked
-- and therefore no constraint systems will be unnecessarily cached.
(items, _solveRel, _breakers) = (`runReader` hnd) $ addSolvingLoopBreakers
((closeTheoryItem <$> L.get thyItems thy0) `using` parList rdeepseq)
closeTheoryItem = foldTheoryItem
(RuleItem . closeProtoRule hnd)
AxiomItem
(LemmaItem . fmap skeletonToIncrementalProof)
TextItem
-- extract typing axioms and lemmas
axioms = do AxiomItem ax <- items
return $ formulaToGuarded_ $ L.get axFormula ax
typAsms = do LemmaItem lem <- items
guard (isTypingLemma lem)
return $ formulaToGuarded_ $ L.get lFormula lem
-- extract protocol rules
rules :: [ClosedProtoRule]
rules = theoryRules (Theory errClose errClose errClose items)
errClose = error "closeTheory"
addSolvingLoopBreakers = useAutoLoopBreakersAC
(liftToItem $ enumPrems . L.get cprRuleAC)
(liftToItem $ enumConcs . L.get cprRuleAC)
(liftToItem $ getDisj . L.get (pracVariants . rInfo . cprRuleAC))
addBreakers
where
liftToItem f (RuleItem ru) = f ru
liftToItem _ _ = []
addBreakers bs (RuleItem ru) =
RuleItem (L.set (pracLoopBreakers . rInfo . cprRuleAC) bs ru)
addBreakers _ item = item
-- Partial evaluation / abstract interpretation
-----------------------------------------------
-- | Apply partial evaluation. | 2,051 | closeTheoryWithMaude :: SignatureWithMaude -> OpenTheory -> ClosedTheory
closeTheoryWithMaude sig thy0 = do
proveTheory (const True) checkProof
$ Theory (L.get thyName thy0) sig cache items
where
cache = closeRuleCache axioms typAsms sig rules (L.get thyCache thy0) False
checkProof = checkAndExtendProver (sorryProver Nothing)
-- Maude / Signature handle
hnd = L.get sigmMaudeHandle sig
-- Close all theory items: in parallel (especially useful for variants)
--
-- NOTE that 'rdeepseq' is OK here, as the proof has not yet been checked
-- and therefore no constraint systems will be unnecessarily cached.
(items, _solveRel, _breakers) = (`runReader` hnd) $ addSolvingLoopBreakers
((closeTheoryItem <$> L.get thyItems thy0) `using` parList rdeepseq)
closeTheoryItem = foldTheoryItem
(RuleItem . closeProtoRule hnd)
AxiomItem
(LemmaItem . fmap skeletonToIncrementalProof)
TextItem
-- extract typing axioms and lemmas
axioms = do AxiomItem ax <- items
return $ formulaToGuarded_ $ L.get axFormula ax
typAsms = do LemmaItem lem <- items
guard (isTypingLemma lem)
return $ formulaToGuarded_ $ L.get lFormula lem
-- extract protocol rules
rules :: [ClosedProtoRule]
rules = theoryRules (Theory errClose errClose errClose items)
errClose = error "closeTheory"
addSolvingLoopBreakers = useAutoLoopBreakersAC
(liftToItem $ enumPrems . L.get cprRuleAC)
(liftToItem $ enumConcs . L.get cprRuleAC)
(liftToItem $ getDisj . L.get (pracVariants . rInfo . cprRuleAC))
addBreakers
where
liftToItem f (RuleItem ru) = f ru
liftToItem _ _ = []
addBreakers bs (RuleItem ru) =
RuleItem (L.set (pracLoopBreakers . rInfo . cprRuleAC) bs ru)
addBreakers _ item = item
-- Partial evaluation / abstract interpretation
-----------------------------------------------
-- | Apply partial evaluation. | 2,051 | closeTheoryWithMaude sig thy0 = do
proveTheory (const True) checkProof
$ Theory (L.get thyName thy0) sig cache items
where
cache = closeRuleCache axioms typAsms sig rules (L.get thyCache thy0) False
checkProof = checkAndExtendProver (sorryProver Nothing)
-- Maude / Signature handle
hnd = L.get sigmMaudeHandle sig
-- Close all theory items: in parallel (especially useful for variants)
--
-- NOTE that 'rdeepseq' is OK here, as the proof has not yet been checked
-- and therefore no constraint systems will be unnecessarily cached.
(items, _solveRel, _breakers) = (`runReader` hnd) $ addSolvingLoopBreakers
((closeTheoryItem <$> L.get thyItems thy0) `using` parList rdeepseq)
closeTheoryItem = foldTheoryItem
(RuleItem . closeProtoRule hnd)
AxiomItem
(LemmaItem . fmap skeletonToIncrementalProof)
TextItem
-- extract typing axioms and lemmas
axioms = do AxiomItem ax <- items
return $ formulaToGuarded_ $ L.get axFormula ax
typAsms = do LemmaItem lem <- items
guard (isTypingLemma lem)
return $ formulaToGuarded_ $ L.get lFormula lem
-- extract protocol rules
rules :: [ClosedProtoRule]
rules = theoryRules (Theory errClose errClose errClose items)
errClose = error "closeTheory"
addSolvingLoopBreakers = useAutoLoopBreakersAC
(liftToItem $ enumPrems . L.get cprRuleAC)
(liftToItem $ enumConcs . L.get cprRuleAC)
(liftToItem $ getDisj . L.get (pracVariants . rInfo . cprRuleAC))
addBreakers
where
liftToItem f (RuleItem ru) = f ru
liftToItem _ _ = []
addBreakers bs (RuleItem ru) =
RuleItem (L.set (pracLoopBreakers . rInfo . cprRuleAC) bs ru)
addBreakers _ item = item
-- Partial evaluation / abstract interpretation
-----------------------------------------------
-- | Apply partial evaluation. | 1,978 | false | true | 2 | 12 | 523 | 490 | 248 | 242 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/SpeechSynthesisUtterance.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance.rate Mozilla SpeechSynthesisUtterance.rate documentation>
setRate ::
(MonadDOM m) => SpeechSynthesisUtterance -> Float -> m ()
setRate self val = liftDOM (self ^. jss "rate" (toJSVal val)) | 277 | setRate ::
(MonadDOM m) => SpeechSynthesisUtterance -> Float -> m ()
setRate self val = liftDOM (self ^. jss "rate" (toJSVal val)) | 138 | setRate self val = liftDOM (self ^. jss "rate" (toJSVal val)) | 61 | true | true | 0 | 10 | 36 | 60 | 30 | 30 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/THNames.hs | bsd-3-clause | sectionRIdKey = mkPreludeMiscIdUnique 278 | 45 | sectionRIdKey = mkPreludeMiscIdUnique 278 | 45 | sectionRIdKey = mkPreludeMiscIdUnique 278 | 45 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
meiersi/psqueues-old | tests/Data/PSQ/Class/Tests.hs | bsd-3-clause | test_findMin
:: forall psq. (PSQ psq, TestKey (Key psq))
=> Tagged psq Assertion
test_findMin = Tagged $ do
findMin (empty :: psq Int Char) @?= Nothing
findMin (fromList [(5, 101, 'a'), (3, 100, 'b')] :: psq Int Char) @?=
Just (3, 100, 'b') | 264 | test_findMin
:: forall psq. (PSQ psq, TestKey (Key psq))
=> Tagged psq Assertion
test_findMin = Tagged $ do
findMin (empty :: psq Int Char) @?= Nothing
findMin (fromList [(5, 101, 'a'), (3, 100, 'b')] :: psq Int Char) @?=
Just (3, 100, 'b') | 264 | test_findMin = Tagged $ do
findMin (empty :: psq Int Char) @?= Nothing
findMin (fromList [(5, 101, 'a'), (3, 100, 'b')] :: psq Int Char) @?=
Just (3, 100, 'b') | 175 | false | true | 2 | 13 | 66 | 134 | 69 | 65 | null | null |
haskellGardener/yusic | src/Yusic.hs | mit | --fromOctave is a function that takes an Int (our midi values) and returns a list of YNotes from all piano octaves.
fromOctave :: Int -> [] YNote
fromOctave 0 = A0:As_Bb0:B0 :[] | 222 | fromOctave :: Int -> [] YNote
fromOctave 0 = A0:As_Bb0:B0 :[] | 104 | fromOctave 0 = A0:As_Bb0:B0 :[] | 74 | true | true | 0 | 7 | 76 | 38 | 19 | 19 | null | null |
Palmik/data-store | src/Data/Store/Selection.hs | bsd-3-clause | resolveSD :: forall tag n krs irs ts v . SelectionDimension n tag krs irs ts
-> I.Store tag krs irs ts v
-> Data.IntSet.IntSet
resolveSD (SelectionDimension _ (Condition False False False) _) _ = {-# SCC "resolveSD" #-} Data.IntSet.empty | 258 | resolveSD :: forall tag n krs irs ts v . SelectionDimension n tag krs irs ts
-> I.Store tag krs irs ts v
-> Data.IntSet.IntSet
resolveSD (SelectionDimension _ (Condition False False False) _) _ = {-# SCC "resolveSD" #-} Data.IntSet.empty | 258 | resolveSD (SelectionDimension _ (Condition False False False) _) _ = {-# SCC "resolveSD" #-} Data.IntSet.empty | 110 | false | true | 0 | 9 | 60 | 85 | 46 | 39 | null | null |
cmahon/interactive-brokers | executable/IB.hs | bsd-3-clause | ibContract :: String -> String -> IBContract
ibContract sf s = future sf s Nothing GLOBEX "USD" | 95 | ibContract :: String -> String -> IBContract
ibContract sf s = future sf s Nothing GLOBEX "USD" | 95 | ibContract sf s = future sf s Nothing GLOBEX "USD" | 50 | false | true | 0 | 6 | 16 | 35 | 17 | 18 | null | null |
a5an0/brbot-frontend | src/Main.hs | bsd-3-clause | markUserBack :: ByteString -> Snap()
markUserBack userId = do
conn <- liftIO $ open "/tmp/brbot.sqlite3"
liftIO $ execute conn "DELETE FROM away WHERE uid=(?)" (Only (replace "\"" "" $ show userId))
liftIO $ close conn
writeBS "Welcome back!" | 250 | markUserBack :: ByteString -> Snap()
markUserBack userId = do
conn <- liftIO $ open "/tmp/brbot.sqlite3"
liftIO $ execute conn "DELETE FROM away WHERE uid=(?)" (Only (replace "\"" "" $ show userId))
liftIO $ close conn
writeBS "Welcome back!" | 250 | markUserBack userId = do
conn <- liftIO $ open "/tmp/brbot.sqlite3"
liftIO $ execute conn "DELETE FROM away WHERE uid=(?)" (Only (replace "\"" "" $ show userId))
liftIO $ close conn
writeBS "Welcome back!" | 213 | false | true | 0 | 13 | 45 | 88 | 39 | 49 | null | null |
tjakway/ghcjvm | compiler/basicTypes/OccName.hs | bsd-3-clause | mkPDatasDataConOcc = mk_simple_deriv_with dataName "VPDs:" | 58 | mkPDatasDataConOcc = mk_simple_deriv_with dataName "VPDs:" | 58 | mkPDatasDataConOcc = mk_simple_deriv_with dataName "VPDs:" | 58 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
slpopejoy/fadno-xml | src/Fadno/MusicXml/MusicXml30.hs | bsd-2-clause | -- | Smart constructor for 'NotationsArticulations'
mkNotationsArticulations :: Articulations -> ChxNotations
mkNotationsArticulations a = NotationsArticulations a | 163 | mkNotationsArticulations :: Articulations -> ChxNotations
mkNotationsArticulations a = NotationsArticulations a | 111 | mkNotationsArticulations a = NotationsArticulations a | 53 | true | true | 0 | 5 | 15 | 22 | 11 | 11 | null | null |
shlevy/ghc | compiler/nativeGen/SPARC/Regs.hs | bsd-3-clause | o0 = RegReal (RealRegSingle (oReg 0)) | 38 | o0 = RegReal (RealRegSingle (oReg 0)) | 38 | o0 = RegReal (RealRegSingle (oReg 0)) | 38 | false | false | 1 | 9 | 6 | 24 | 10 | 14 | null | null |
wavewave/hoodle-core | src/Hoodle/Coroutine/Window.hs | gpl-3.0 | deleteCanvas :: MainCoroutine ()
deleteCanvas = do
xstate <- get
let cmap = getCanvasInfoMap xstate
currcid = getCurrentCanvasId xstate
fstate = view frameState xstate
enewfstate = removeWindow currcid fstate
case enewfstate of
Left _ -> return ()
Right Nothing -> return ()
Right (Just fstate') -> do
let cmap' = M.delete currcid cmap
newcurrcid = maximum (M.keys cmap')
xstate0 <- changeCurrentCanvasId newcurrcid
let xstate1 = maybe xstate0 id $ setCanvasInfoMap cmap' xstate0
put xstate1
let rtwin = view rootWindow xstate1
rtcntr = view rootContainer xstate1
rtrwin = view rootOfRootWindow xstate1
liftIO $ containerRemove rtcntr rtwin
(xstate'',win,fstate'') <- liftIO $ constructFrame xstate1 fstate'
let xstate3 = set frameState fstate''
. set rootWindow win
$ xstate''
put xstate3
liftIO $ boxPackEnd rtcntr win PackGrow 0
liftIO $ widgetShowAll rtcntr
liftIO $ widgetQueueDraw rtrwin
(xstate4,_wconf) <- liftIO $ eventConnect xstate3 (view frameState xstate3)
canvasZoomUpdateAll
xstate5 <- liftIO $ updatePageAll (view hoodleModeState xstate4) xstate4
put xstate5
invalidateAll
-- | | 1,393 | deleteCanvas :: MainCoroutine ()
deleteCanvas = do
xstate <- get
let cmap = getCanvasInfoMap xstate
currcid = getCurrentCanvasId xstate
fstate = view frameState xstate
enewfstate = removeWindow currcid fstate
case enewfstate of
Left _ -> return ()
Right Nothing -> return ()
Right (Just fstate') -> do
let cmap' = M.delete currcid cmap
newcurrcid = maximum (M.keys cmap')
xstate0 <- changeCurrentCanvasId newcurrcid
let xstate1 = maybe xstate0 id $ setCanvasInfoMap cmap' xstate0
put xstate1
let rtwin = view rootWindow xstate1
rtcntr = view rootContainer xstate1
rtrwin = view rootOfRootWindow xstate1
liftIO $ containerRemove rtcntr rtwin
(xstate'',win,fstate'') <- liftIO $ constructFrame xstate1 fstate'
let xstate3 = set frameState fstate''
. set rootWindow win
$ xstate''
put xstate3
liftIO $ boxPackEnd rtcntr win PackGrow 0
liftIO $ widgetShowAll rtcntr
liftIO $ widgetQueueDraw rtrwin
(xstate4,_wconf) <- liftIO $ eventConnect xstate3 (view frameState xstate3)
canvasZoomUpdateAll
xstate5 <- liftIO $ updatePageAll (view hoodleModeState xstate4) xstate4
put xstate5
invalidateAll
-- | | 1,392 | deleteCanvas = do
xstate <- get
let cmap = getCanvasInfoMap xstate
currcid = getCurrentCanvasId xstate
fstate = view frameState xstate
enewfstate = removeWindow currcid fstate
case enewfstate of
Left _ -> return ()
Right Nothing -> return ()
Right (Just fstate') -> do
let cmap' = M.delete currcid cmap
newcurrcid = maximum (M.keys cmap')
xstate0 <- changeCurrentCanvasId newcurrcid
let xstate1 = maybe xstate0 id $ setCanvasInfoMap cmap' xstate0
put xstate1
let rtwin = view rootWindow xstate1
rtcntr = view rootContainer xstate1
rtrwin = view rootOfRootWindow xstate1
liftIO $ containerRemove rtcntr rtwin
(xstate'',win,fstate'') <- liftIO $ constructFrame xstate1 fstate'
let xstate3 = set frameState fstate''
. set rootWindow win
$ xstate''
put xstate3
liftIO $ boxPackEnd rtcntr win PackGrow 0
liftIO $ widgetShowAll rtcntr
liftIO $ widgetQueueDraw rtrwin
(xstate4,_wconf) <- liftIO $ eventConnect xstate3 (view frameState xstate3)
canvasZoomUpdateAll
xstate5 <- liftIO $ updatePageAll (view hoodleModeState xstate4) xstate4
put xstate5
invalidateAll
-- | | 1,359 | false | true | 1 | 18 | 454 | 395 | 177 | 218 | null | null |
mitsuji/exp-CloudHaskell | app/ConsoleChatServer.hs | bsd-3-clause | main :: IO ()
main = do
host:port:_ <- getArgs
Right t <- createTransport host port defaultTCPParameters
pid <- newLocalNode t initRemoteTable >>= forkMain
putStrLn $ "EndPoint: " ++ (show $ nodeAddress $ processNodeId pid)
_ <- getLine
-- [TODO] kill pid
return () | 280 | main :: IO ()
main = do
host:port:_ <- getArgs
Right t <- createTransport host port defaultTCPParameters
pid <- newLocalNode t initRemoteTable >>= forkMain
putStrLn $ "EndPoint: " ++ (show $ nodeAddress $ processNodeId pid)
_ <- getLine
-- [TODO] kill pid
return () | 280 | main = do
host:port:_ <- getArgs
Right t <- createTransport host port defaultTCPParameters
pid <- newLocalNode t initRemoteTable >>= forkMain
putStrLn $ "EndPoint: " ++ (show $ nodeAddress $ processNodeId pid)
_ <- getLine
-- [TODO] kill pid
return () | 266 | false | true | 1 | 11 | 58 | 109 | 48 | 61 | null | null |
kim/amazonka | amazonka-directconnect/gen/Network/AWS/DirectConnect/Types.hs | mpl-2.0 | -- | 'Location' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'lLocationCode' @::@ 'Maybe' 'Text'
--
-- * 'lLocationName' @::@ 'Maybe' 'Text'
--
location :: Location
location = Location
{ _lLocationCode = Nothing
, _lLocationName = Nothing
} | 290 | location :: Location
location = Location
{ _lLocationCode = Nothing
, _lLocationName = Nothing
} | 108 | location = Location
{ _lLocationCode = Nothing
, _lLocationName = Nothing
} | 87 | true | true | 0 | 7 | 54 | 43 | 25 | 18 | null | null |
ggkitsas/HaLVM | examples/IVC/BasicIVC/Peer1.hs | bsd-3-clause | exceptionHandler :: ErrorCode -> IO ()
exceptionHandler ec = do
writeDebugConsole ("RIGHT: Caught exception: " ++ show ec ++ "\n") | 132 | exceptionHandler :: ErrorCode -> IO ()
exceptionHandler ec = do
writeDebugConsole ("RIGHT: Caught exception: " ++ show ec ++ "\n") | 132 | exceptionHandler ec = do
writeDebugConsole ("RIGHT: Caught exception: " ++ show ec ++ "\n") | 93 | false | true | 0 | 11 | 21 | 43 | 20 | 23 | null | null |
lukexi/rumpus | pristine/Room/Tree.hs | bsd-3-clause | depth :: Num a => a
depth = 5 | 30 | depth :: Num a => a
depth = 5 | 29 | depth = 5 | 9 | false | true | 0 | 6 | 9 | 18 | 9 | 9 | null | null |
mrlovre/super-memory | Pro7/src/Genetic.hs | gpl-3.0 | mutateLayer :: MonadRandom mr => (Bool -> Double -> mr Double) ->
(Bool -> Vector Double -> mr (Vector Double)) -> NNLayer -> mr NNLayer
mutateLayer mutate mutateV l = case l of
NNLayerT1{..} -> do
chances <- (V.fromListN t1N . map (< Configuration.mutationRate)) <$> getRandoms
t1wsN <- V.zipWithM mutateV chances t1ws
ssN <- V.zipWithM mutateV chances ss
return $ NNLayerT1 t1wsN ssN t1N
NNLayerT2{..} -> do
chances <- (V.fromListN t2N . map (< Configuration.mutationRate)) <$> getRandoms
t2wsN <- V.zipWithM mutateV chances t2ws
bsN <- V.zipWithM mutate chances bs
return $ NNLayerT2 t2wsN bsN t2N | 676 | mutateLayer :: MonadRandom mr => (Bool -> Double -> mr Double) ->
(Bool -> Vector Double -> mr (Vector Double)) -> NNLayer -> mr NNLayer
mutateLayer mutate mutateV l = case l of
NNLayerT1{..} -> do
chances <- (V.fromListN t1N . map (< Configuration.mutationRate)) <$> getRandoms
t1wsN <- V.zipWithM mutateV chances t1ws
ssN <- V.zipWithM mutateV chances ss
return $ NNLayerT1 t1wsN ssN t1N
NNLayerT2{..} -> do
chances <- (V.fromListN t2N . map (< Configuration.mutationRate)) <$> getRandoms
t2wsN <- V.zipWithM mutateV chances t2ws
bsN <- V.zipWithM mutate chances bs
return $ NNLayerT2 t2wsN bsN t2N | 676 | mutateLayer mutate mutateV l = case l of
NNLayerT1{..} -> do
chances <- (V.fromListN t1N . map (< Configuration.mutationRate)) <$> getRandoms
t1wsN <- V.zipWithM mutateV chances t1ws
ssN <- V.zipWithM mutateV chances ss
return $ NNLayerT1 t1wsN ssN t1N
NNLayerT2{..} -> do
chances <- (V.fromListN t2N . map (< Configuration.mutationRate)) <$> getRandoms
t2wsN <- V.zipWithM mutateV chances t2ws
bsN <- V.zipWithM mutate chances bs
return $ NNLayerT2 t2wsN bsN t2N | 535 | false | true | 2 | 14 | 170 | 263 | 123 | 140 | null | null |
ARCCN/hcprobe | src/Network/Openflow/Types.hs | bsd-3-clause | statsRequestToType (OfpPortStatsRequest _) = OFPST_PORT | 64 | statsRequestToType (OfpPortStatsRequest _) = OFPST_PORT | 64 | statsRequestToType (OfpPortStatsRequest _) = OFPST_PORT | 64 | false | false | 0 | 7 | 13 | 15 | 7 | 8 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2017/M11/D08/Solution.hs | mit | -- first, define a JSON instance for the keyphrases:
{--
instance ToJSON Keyphrase where
toJSON (KW strength (SQS str)) =
object ["strength" .= strength, "keyphrase" .= str]
-- move this definition to Y2017.M11.D07.Solution
--}
-- And now, save out the recommendation with score and keyphrases as JSON
saveRecs :: FilePath -> KeyphraseMap -> [Recommendation] -> IO ()
saveRecs outputfile keyphrases =
BL.writeFile outputfile . showRecs keyphrases | 462 | saveRecs :: FilePath -> KeyphraseMap -> [Recommendation] -> IO ()
saveRecs outputfile keyphrases =
BL.writeFile outputfile . showRecs keyphrases | 147 | saveRecs outputfile keyphrases =
BL.writeFile outputfile . showRecs keyphrases | 81 | true | true | 0 | 10 | 81 | 55 | 27 | 28 | null | null |
kapilash/hs-azure | azure-servicebus/Web/WindowsAzure/ServiceBus/Topic.hs | apache-2.0 | -- | Internal low-level method for performing HTTP calls.
--
-- Not exposed to the user
sendTopicRequest :: String -> RequestBody -> SBContext -> IO ()
sendTopicRequest topicName body (SBContext baseUrl manager aContext) = do
token <- acsToken manager aContext
reqInit <- parseUrl (baseUrl ++ "/" ++ topicName ++ "/messages")
withSocketsDo $ httpLbs (reqInit { method = methodPost,
requestHeaders = [token],
requestBody = body
}) manager
return ()
-- | Internal low-level method for creating the HTTP calls. For internal use.
--
-- Not exposed to the user | 626 | sendTopicRequest :: String -> RequestBody -> SBContext -> IO ()
sendTopicRequest topicName body (SBContext baseUrl manager aContext) = do
token <- acsToken manager aContext
reqInit <- parseUrl (baseUrl ++ "/" ++ topicName ++ "/messages")
withSocketsDo $ httpLbs (reqInit { method = methodPost,
requestHeaders = [token],
requestBody = body
}) manager
return ()
-- | Internal low-level method for creating the HTTP calls. For internal use.
--
-- Not exposed to the user | 538 | sendTopicRequest topicName body (SBContext baseUrl manager aContext) = do
token <- acsToken manager aContext
reqInit <- parseUrl (baseUrl ++ "/" ++ topicName ++ "/messages")
withSocketsDo $ httpLbs (reqInit { method = methodPost,
requestHeaders = [token],
requestBody = body
}) manager
return ()
-- | Internal low-level method for creating the HTTP calls. For internal use.
--
-- Not exposed to the user | 474 | true | true | 0 | 12 | 158 | 134 | 70 | 64 | null | null |
jeffreyrosenbluth/flourine | src/Fluorine/HTML.hs | bsd-3-clause | dt_ :: [HTML i] -> HTML i
dt_ = dt mempty | 41 | dt_ :: [HTML i] -> HTML i
dt_ = dt mempty | 41 | dt_ = dt mempty | 15 | false | true | 0 | 8 | 10 | 33 | 14 | 19 | null | null |
lhoghu/yahoo-portfolio-manager | ypm-cli/Data/YahooPortfolioManager/Cli/Main.hs | mit | options :: [OptDescr Flag]
options =
[ Option ['v'] ["version"] (NoArg Version) "Show version number"
, Option ['s'] ["show"] (NoArg ShowPortfolio) "Show current portfolio"
, Option ['u'] ["update"] (NoArg Update) "Show the market position"
, Option ['a'] ["add"] (NoArg AddSymbol) "Add a symbol to the portfolio"
, Option ['d'] ["div"] (NoArg AddDividend) "Add a dividend payment"
, Option ['p'] ["pay"] (NoArg ShowDividends) "Show all dividend payments"
, Option ['h'] ["histo"] (NoArg LoadHisto) "Load historical quotes from yahoo"
, Option ['l'] ["lookup"] (NoArg Lookup) "Lookup possible matches for a symbol in Yahoo"
] | 722 | options :: [OptDescr Flag]
options =
[ Option ['v'] ["version"] (NoArg Version) "Show version number"
, Option ['s'] ["show"] (NoArg ShowPortfolio) "Show current portfolio"
, Option ['u'] ["update"] (NoArg Update) "Show the market position"
, Option ['a'] ["add"] (NoArg AddSymbol) "Add a symbol to the portfolio"
, Option ['d'] ["div"] (NoArg AddDividend) "Add a dividend payment"
, Option ['p'] ["pay"] (NoArg ShowDividends) "Show all dividend payments"
, Option ['h'] ["histo"] (NoArg LoadHisto) "Load historical quotes from yahoo"
, Option ['l'] ["lookup"] (NoArg Lookup) "Lookup possible matches for a symbol in Yahoo"
] | 722 | options =
[ Option ['v'] ["version"] (NoArg Version) "Show version number"
, Option ['s'] ["show"] (NoArg ShowPortfolio) "Show current portfolio"
, Option ['u'] ["update"] (NoArg Update) "Show the market position"
, Option ['a'] ["add"] (NoArg AddSymbol) "Add a symbol to the portfolio"
, Option ['d'] ["div"] (NoArg AddDividend) "Add a dividend payment"
, Option ['p'] ["pay"] (NoArg ShowDividends) "Show all dividend payments"
, Option ['h'] ["histo"] (NoArg LoadHisto) "Load historical quotes from yahoo"
, Option ['l'] ["lookup"] (NoArg Lookup) "Lookup possible matches for a symbol in Yahoo"
] | 695 | false | true | 0 | 9 | 188 | 216 | 114 | 102 | null | null |
wxwxwwxxx/ghc | libraries/base/GHC/List.hs | bsd-3-clause | filterFB :: (a -> b -> b) -> (a -> Bool) -> a -> b -> b
filterFB c p x r | p x = x `c` r
| otherwise = r | 127 | filterFB :: (a -> b -> b) -> (a -> Bool) -> a -> b -> b
filterFB c p x r | p x = x `c` r
| otherwise = r | 127 | filterFB c p x r | p x = x `c` r
| otherwise = r | 71 | false | true | 0 | 8 | 55 | 78 | 39 | 39 | null | null |
fmapfmapfmap/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs | mpl-2.0 | -- | The format of the disk image being imported.
--
-- Valid values: 'RAW' | 'VHD' | 'VMDK' | 'OVA'
sdcFormat :: Lens' SnapshotDiskContainer (Maybe Text)
sdcFormat = lens _sdcFormat (\ s a -> s{_sdcFormat = a}) | 211 | sdcFormat :: Lens' SnapshotDiskContainer (Maybe Text)
sdcFormat = lens _sdcFormat (\ s a -> s{_sdcFormat = a}) | 110 | sdcFormat = lens _sdcFormat (\ s a -> s{_sdcFormat = a}) | 56 | true | true | 0 | 9 | 37 | 48 | 27 | 21 | null | null |
markus-git/imperative-edsl-vhdl | src/Language/Embedded/Hardware/Command/Frontend.hs | bsd-3-clause | -- | Freeze an array into an immutable one by copying.
freezeArray :: (ArrayCMD :<: instr, pred a, Num (exp Integer), Monad m)
=> Array a -> exp Integer -> ProgramT instr (Param2 exp pred) m (IArray a)
freezeArray array len =
do copy <- newArray len
copyArray (copy,0) (array,0) len
unsafeFreezeArray copy
-- | Thaw an immutable array into a mutable one by copying. | 380 | freezeArray :: (ArrayCMD :<: instr, pred a, Num (exp Integer), Monad m)
=> Array a -> exp Integer -> ProgramT instr (Param2 exp pred) m (IArray a)
freezeArray array len =
do copy <- newArray len
copyArray (copy,0) (array,0) len
unsafeFreezeArray copy
-- | Thaw an immutable array into a mutable one by copying. | 325 | freezeArray array len =
do copy <- newArray len
copyArray (copy,0) (array,0) len
unsafeFreezeArray copy
-- | Thaw an immutable array into a mutable one by copying. | 176 | true | true | 0 | 11 | 79 | 133 | 64 | 69 | null | null |
nushio3/Paraiso | attic/TestAxis.hs | bsd-3-clause | v :: Vec4 Double
v = Vec :~ 0 :~ 1 :~ 2 :~ 3 | 44 | v :: Vec4 Double
v = Vec :~ 0 :~ 1 :~ 2 :~ 3 | 44 | v = Vec :~ 0 :~ 1 :~ 2 :~ 3 | 27 | false | true | 8 | 6 | 14 | 40 | 16 | 24 | null | null |
plow-technologies/live-vdom | src/LiveVDom/Message.hs | mit | -- | Run all messages
runMessages :: Message a -> IO a
runMessages = unMessage | 78 | runMessages :: Message a -> IO a
runMessages = unMessage | 56 | runMessages = unMessage | 23 | true | true | 0 | 6 | 14 | 22 | 11 | 11 | null | null |
BartAdv/hoogle | src/Action/Server.hs | bsd-3-clause | action_server_test :: FilePath -> IO ()
action_server_test database = do
testing "Action.Server.displayItem" $ do
let expand = replace "{" "<b>" . replace "}" "</b>" . replace "<0>" "" . replace "</0>" ""
contract = replace "{" "" . replace "}" ""
let q === s | displayItem (parseQuery q) (contract s) == expand s = putChar '.'
| otherwise = error $ show (q,s,displayItem (parseQuery q) (contract s))
"test" === "<0>my{Test}</0> :: Int -> test"
"new west" === "<0>{newest}_{new}</0> :: Int"
"+*" === "(<0>{+*}&</0>) :: Int"
"+<" === "(<0>>{+<}</0>) :: Int"
"foo" === "<i>data</i> <0>{Foo}d</0>"
"foo" === "<i>module</i> Foo.Bar.<0>F{Foo}</0>"
"foo" === "<i>module</i> <0>{Foo}o</0>"
testing "Action.Server.replyServer" $ withSearch database $ \store -> do
log <- logNone
let q === want = do
OutputString (lstrUnpack -> res) <- replyServer log store "" (Input [] [("hoogle",q)])
if want `isInfixOf` res then putChar '.' else fail $ "Bad substring: " ++ res
"<>" === "<span class=name>(<b><></b>)</span>"
"filt" === "<span class=name><b>filt</b>er</span>"
-------------------------------------------------------------
-- ANALYSE THE LOG | 1,331 | action_server_test :: FilePath -> IO ()
action_server_test database = do
testing "Action.Server.displayItem" $ do
let expand = replace "{" "<b>" . replace "}" "</b>" . replace "<0>" "" . replace "</0>" ""
contract = replace "{" "" . replace "}" ""
let q === s | displayItem (parseQuery q) (contract s) == expand s = putChar '.'
| otherwise = error $ show (q,s,displayItem (parseQuery q) (contract s))
"test" === "<0>my{Test}</0> :: Int -> test"
"new west" === "<0>{newest}_{new}</0> :: Int"
"+*" === "(<0>{+*}&</0>) :: Int"
"+<" === "(<0>>{+<}</0>) :: Int"
"foo" === "<i>data</i> <0>{Foo}d</0>"
"foo" === "<i>module</i> Foo.Bar.<0>F{Foo}</0>"
"foo" === "<i>module</i> <0>{Foo}o</0>"
testing "Action.Server.replyServer" $ withSearch database $ \store -> do
log <- logNone
let q === want = do
OutputString (lstrUnpack -> res) <- replyServer log store "" (Input [] [("hoogle",q)])
if want `isInfixOf` res then putChar '.' else fail $ "Bad substring: " ++ res
"<>" === "<span class=name>(<b><></b>)</span>"
"filt" === "<span class=name><b>filt</b>er</span>"
-------------------------------------------------------------
-- ANALYSE THE LOG | 1,331 | action_server_test database = do
testing "Action.Server.displayItem" $ do
let expand = replace "{" "<b>" . replace "}" "</b>" . replace "<0>" "" . replace "</0>" ""
contract = replace "{" "" . replace "}" ""
let q === s | displayItem (parseQuery q) (contract s) == expand s = putChar '.'
| otherwise = error $ show (q,s,displayItem (parseQuery q) (contract s))
"test" === "<0>my{Test}</0> :: Int -> test"
"new west" === "<0>{newest}_{new}</0> :: Int"
"+*" === "(<0>{+*}&</0>) :: Int"
"+<" === "(<0>>{+<}</0>) :: Int"
"foo" === "<i>data</i> <0>{Foo}d</0>"
"foo" === "<i>module</i> Foo.Bar.<0>F{Foo}</0>"
"foo" === "<i>module</i> <0>{Foo}o</0>"
testing "Action.Server.replyServer" $ withSearch database $ \store -> do
log <- logNone
let q === want = do
OutputString (lstrUnpack -> res) <- replyServer log store "" (Input [] [("hoogle",q)])
if want `isInfixOf` res then putChar '.' else fail $ "Bad substring: " ++ res
"<>" === "<span class=name>(<b><></b>)</span>"
"filt" === "<span class=name><b>filt</b>er</span>"
-------------------------------------------------------------
-- ANALYSE THE LOG | 1,291 | false | true | 0 | 21 | 338 | 369 | 170 | 199 | null | null |
hjwylde/werewolf | app/Game/Werewolf/Variant/NoRoleReveal/Engine.hs | bsd-3-clause | playerTurnedToStoneText :: Player -> Text
playerTurnedToStoneText player = [iFile|variant/no-role-reveal/engine/sunrise/player-turned-to-stone.txt|] | 148 | playerTurnedToStoneText :: Player -> Text
playerTurnedToStoneText player = [iFile|variant/no-role-reveal/engine/sunrise/player-turned-to-stone.txt|] | 148 | playerTurnedToStoneText player = [iFile|variant/no-role-reveal/engine/sunrise/player-turned-to-stone.txt|] | 106 | false | true | 0 | 5 | 8 | 22 | 13 | 9 | null | null |
dgvncsz0f/nws | src/Jerimum/PostgreSQL/Types/Type.hs | bsd-3-clause | formatType (RangeType _) = error "fixme" | 40 | formatType (RangeType _) = error "fixme" | 40 | formatType (RangeType _) = error "fixme" | 40 | false | false | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
aslatter/parsec | src/Text/Parsec/Prim.hs | bsd-2-clause | token :: (Stream s Identity t)
=> (t -> String) -- ^ Token pretty-printing function.
-> (t -> SourcePos) -- ^ Computes the position of a token.
-> (t -> Maybe a) -- ^ Matching function for the token to parse.
-> Parsec s u a
token showToken tokpos test = tokenPrim showToken nextpos test
where
nextpos _ tok ts = case runIdentity (uncons ts) of
Nothing -> tokpos tok
Just (tok',_) -> tokpos tok'
-- | The parser @tokenPrim showTok nextPos testTok@ accepts a token @t@
-- with result @x@ when the function @testTok t@ returns @'Just' x@. The
-- token can be shown using @showTok t@. The position of the /next/
-- token should be returned when @nextPos@ is called with the current
-- source position @pos@, the current token @t@ and the rest of the
-- tokens @toks@, @nextPos pos t toks@.
--
-- This is the most primitive combinator for accepting tokens. For
-- example, the 'Text.Parsec.Char.char' parser could be implemented as:
--
-- > char c
-- > = tokenPrim showChar nextPos testChar
-- > where
-- > showChar x = "'" ++ x ++ "'"
-- > testChar x = if x == c then Just x else Nothing
-- > nextPos pos x xs = updatePosChar pos x | 1,289 | token :: (Stream s Identity t)
=> (t -> String) -- ^ Token pretty-printing function.
-> (t -> SourcePos) -- ^ Computes the position of a token.
-> (t -> Maybe a) -- ^ Matching function for the token to parse.
-> Parsec s u a
token showToken tokpos test = tokenPrim showToken nextpos test
where
nextpos _ tok ts = case runIdentity (uncons ts) of
Nothing -> tokpos tok
Just (tok',_) -> tokpos tok'
-- | The parser @tokenPrim showTok nextPos testTok@ accepts a token @t@
-- with result @x@ when the function @testTok t@ returns @'Just' x@. The
-- token can be shown using @showTok t@. The position of the /next/
-- token should be returned when @nextPos@ is called with the current
-- source position @pos@, the current token @t@ and the rest of the
-- tokens @toks@, @nextPos pos t toks@.
--
-- This is the most primitive combinator for accepting tokens. For
-- example, the 'Text.Parsec.Char.char' parser could be implemented as:
--
-- > char c
-- > = tokenPrim showChar nextPos testChar
-- > where
-- > showChar x = "'" ++ x ++ "'"
-- > testChar x = if x == c then Just x else Nothing
-- > nextPos pos x xs = updatePosChar pos x | 1,289 | token showToken tokpos test = tokenPrim showToken nextpos test
where
nextpos _ tok ts = case runIdentity (uncons ts) of
Nothing -> tokpos tok
Just (tok',_) -> tokpos tok'
-- | The parser @tokenPrim showTok nextPos testTok@ accepts a token @t@
-- with result @x@ when the function @testTok t@ returns @'Just' x@. The
-- token can be shown using @showTok t@. The position of the /next/
-- token should be returned when @nextPos@ is called with the current
-- source position @pos@, the current token @t@ and the rest of the
-- tokens @toks@, @nextPos pos t toks@.
--
-- This is the most primitive combinator for accepting tokens. For
-- example, the 'Text.Parsec.Char.char' parser could be implemented as:
--
-- > char c
-- > = tokenPrim showChar nextPos testChar
-- > where
-- > showChar x = "'" ++ x ++ "'"
-- > testChar x = if x == c then Just x else Nothing
-- > nextPos pos x xs = updatePosChar pos x | 1,011 | false | true | 1 | 12 | 375 | 157 | 86 | 71 | null | null |
daleooo/barrelfish | tools/flounder/CAbsSyntax.hs | mit | pp_expr (PostInc e) = (pp_par_expr e) ++ "++" | 45 | pp_expr (PostInc e) = (pp_par_expr e) ++ "++" | 45 | pp_expr (PostInc e) = (pp_par_expr e) ++ "++" | 45 | false | false | 0 | 7 | 7 | 25 | 12 | 13 | null | null |
comonoidial/ALFIN | Alfin/FromCore.hs | mit | introFix :: QName -> [ShapeType] -> ShapeType -> Context ()
introFix f as rt = do
(fs,cs,xs,n) <- get
put ((f,(as, FixFun rt)):fs,cs,xs,n) | 142 | introFix :: QName -> [ShapeType] -> ShapeType -> Context ()
introFix f as rt = do
(fs,cs,xs,n) <- get
put ((f,(as, FixFun rt)):fs,cs,xs,n) | 142 | introFix f as rt = do
(fs,cs,xs,n) <- get
put ((f,(as, FixFun rt)):fs,cs,xs,n) | 82 | false | true | 0 | 13 | 26 | 99 | 52 | 47 | null | null |
OpenXT/manager | xenmgr/XenMgr/Config.hs | gpl-2.0 | appSetSwitcherEnabled v = dbWrite "/switcher/enabled" v | 55 | appSetSwitcherEnabled v = dbWrite "/switcher/enabled" v | 55 | appSetSwitcherEnabled v = dbWrite "/switcher/enabled" v | 55 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
mlang/haskore-braille | src/Haskore/Interface/Braille.hs | gpl-3.0 | notegroup :: PVDisambiguator
notegroup = do Sequential (x:xs) <- gets snd
asum $ map (tryLine $ mkDistinct small x) $ spans body xs where
body AmbiguousNote {ambiguousValue = av} = av == EighthOr128th
body _ = False
tryLine :: Distinct -> ([AmbiguousSign], [AmbiguousSign]) -> PVDisambiguator
tryLine a (as, xs) = do guard $ length as >= 3 -- Check minimal length of a notegroup
let line = Sequential $ a : map (mkDistinct $ const $ realValue a) as
let d = dur line
l <- gets fst
guard $ l >= d -- Does the choosen line fit?
put (l - d, Sequential xs)
pure line
-- | Like 'span' but gives all combinations till predicate fails. | 850 | notegroup :: PVDisambiguator
notegroup = do Sequential (x:xs) <- gets snd
asum $ map (tryLine $ mkDistinct small x) $ spans body xs where
body AmbiguousNote {ambiguousValue = av} = av == EighthOr128th
body _ = False
tryLine :: Distinct -> ([AmbiguousSign], [AmbiguousSign]) -> PVDisambiguator
tryLine a (as, xs) = do guard $ length as >= 3 -- Check minimal length of a notegroup
let line = Sequential $ a : map (mkDistinct $ const $ realValue a) as
let d = dur line
l <- gets fst
guard $ l >= d -- Does the choosen line fit?
put (l - d, Sequential xs)
pure line
-- | Like 'span' but gives all combinations till predicate fails. | 850 | notegroup = do Sequential (x:xs) <- gets snd
asum $ map (tryLine $ mkDistinct small x) $ spans body xs where
body AmbiguousNote {ambiguousValue = av} = av == EighthOr128th
body _ = False
tryLine :: Distinct -> ([AmbiguousSign], [AmbiguousSign]) -> PVDisambiguator
tryLine a (as, xs) = do guard $ length as >= 3 -- Check minimal length of a notegroup
let line = Sequential $ a : map (mkDistinct $ const $ realValue a) as
let d = dur line
l <- gets fst
guard $ l >= d -- Does the choosen line fit?
put (l - d, Sequential xs)
pure line
-- | Like 'span' but gives all combinations till predicate fails. | 821 | false | true | 0 | 17 | 340 | 252 | 121 | 131 | null | null |
typelead/epm | epm/Distribution/Client/Setup.hs | bsd-3-clause | haddockOptions :: ShowOrParseArgs -> [OptionField HaddockFlags]
haddockOptions showOrParseArgs
= [ opt { optionName = "haddock-" ++ name,
optionDescr = [ fmapOptFlags (\(_, lflags) -> ([], map ("haddock-" ++) lflags)) descr
| descr <- optionDescr opt] }
| opt <- commandOptions Cabal.haddockCommand showOrParseArgs
, let name = optionName opt
, name `elem` ["hoogle", "html", "html-location"
,"executables", "tests", "benchmarks", "all", "internal", "css"
,"hyperlink-source", "hscolour-css"
,"contents-location"]
]
where
fmapOptFlags :: (OptFlags -> OptFlags) -> OptDescr a -> OptDescr a
fmapOptFlags modify (ReqArg d f p r w) = ReqArg d (modify f) p r w
fmapOptFlags modify (OptArg d f p r i w) = OptArg d (modify f) p r i w
fmapOptFlags modify (ChoiceOpt xs) = ChoiceOpt [(d, modify f, i, w) | (d, f, i, w) <- xs]
fmapOptFlags modify (BoolOpt d f1 f2 r w) = BoolOpt d (modify f1) (modify f2) r w | 1,041 | haddockOptions :: ShowOrParseArgs -> [OptionField HaddockFlags]
haddockOptions showOrParseArgs
= [ opt { optionName = "haddock-" ++ name,
optionDescr = [ fmapOptFlags (\(_, lflags) -> ([], map ("haddock-" ++) lflags)) descr
| descr <- optionDescr opt] }
| opt <- commandOptions Cabal.haddockCommand showOrParseArgs
, let name = optionName opt
, name `elem` ["hoogle", "html", "html-location"
,"executables", "tests", "benchmarks", "all", "internal", "css"
,"hyperlink-source", "hscolour-css"
,"contents-location"]
]
where
fmapOptFlags :: (OptFlags -> OptFlags) -> OptDescr a -> OptDescr a
fmapOptFlags modify (ReqArg d f p r w) = ReqArg d (modify f) p r w
fmapOptFlags modify (OptArg d f p r i w) = OptArg d (modify f) p r i w
fmapOptFlags modify (ChoiceOpt xs) = ChoiceOpt [(d, modify f, i, w) | (d, f, i, w) <- xs]
fmapOptFlags modify (BoolOpt d f1 f2 r w) = BoolOpt d (modify f1) (modify f2) r w | 1,041 | haddockOptions showOrParseArgs
= [ opt { optionName = "haddock-" ++ name,
optionDescr = [ fmapOptFlags (\(_, lflags) -> ([], map ("haddock-" ++) lflags)) descr
| descr <- optionDescr opt] }
| opt <- commandOptions Cabal.haddockCommand showOrParseArgs
, let name = optionName opt
, name `elem` ["hoogle", "html", "html-location"
,"executables", "tests", "benchmarks", "all", "internal", "css"
,"hyperlink-source", "hscolour-css"
,"contents-location"]
]
where
fmapOptFlags :: (OptFlags -> OptFlags) -> OptDescr a -> OptDescr a
fmapOptFlags modify (ReqArg d f p r w) = ReqArg d (modify f) p r w
fmapOptFlags modify (OptArg d f p r i w) = OptArg d (modify f) p r i w
fmapOptFlags modify (ChoiceOpt xs) = ChoiceOpt [(d, modify f, i, w) | (d, f, i, w) <- xs]
fmapOptFlags modify (BoolOpt d f1 f2 r w) = BoolOpt d (modify f1) (modify f2) r w | 977 | false | true | 0 | 14 | 287 | 388 | 207 | 181 | null | null |
ssaavedra/liquidhaskell | benchmarks/bytestring-0.9.2.1/Data/ByteString/Lazy.hs | bsd-3-clause | -- | /O(1)/ Unlike 'cons', 'cons\'' is
-- strict in the ByteString that we are consing onto. More precisely, it forces
-- the head and the first chunk. It does this because, for space efficiency, it
-- may coalesce the new byte onto the first \'chunk\' rather than starting a
-- new \'chunk\'.
--
-- So that means you can't use a lazy recursive contruction like this:
--
-- > let xs = cons\' c xs in xs
--
-- You can however use 'cons', as well as 'repeat' and 'cycle', to build
-- infinite lazy ByteStrings.
--
{-@ cons' :: Word8 -> b:ByteString -> {v:ByteString | (lbLength v) = ((lbLength b) + 1)} @-}
cons' :: Word8 -> ByteString -> ByteString
cons' w (Chunk c cs) | S.length c < 16 = Chunk (S.cons w c) cs | 710 | cons' :: Word8 -> ByteString -> ByteString
cons' w (Chunk c cs) | S.length c < 16 = Chunk (S.cons w c) cs | 105 | cons' w (Chunk c cs) | S.length c < 16 = Chunk (S.cons w c) cs | 62 | true | true | 0 | 10 | 137 | 76 | 43 | 33 | null | null |
alexvong1995/pandoc | src/Text/Pandoc/Options.hs | gpl-2.0 | pandocExtensions :: Set Extension
pandocExtensions = Set.fromList
[ Ext_footnotes
, Ext_inline_notes
, Ext_pandoc_title_block
, Ext_yaml_metadata_block
, Ext_table_captions
, Ext_implicit_figures
, Ext_simple_tables
, Ext_multiline_tables
, Ext_grid_tables
, Ext_pipe_tables
, Ext_citations
, Ext_raw_tex
, Ext_raw_html
, Ext_tex_math_dollars
, Ext_latex_macros
, Ext_fenced_code_blocks
, Ext_fenced_code_attributes
, Ext_backtick_code_blocks
, Ext_inline_code_attributes
, Ext_markdown_in_html_blocks
, Ext_native_divs
, Ext_native_spans
, Ext_escaped_line_breaks
, Ext_fancy_lists
, Ext_startnum
, Ext_definition_lists
, Ext_example_lists
, Ext_all_symbols_escapable
, Ext_intraword_underscores
, Ext_blank_before_blockquote
, Ext_blank_before_header
, Ext_strikeout
, Ext_superscript
, Ext_subscript
, Ext_auto_identifiers
, Ext_header_attributes
, Ext_implicit_header_references
, Ext_line_blocks
, Ext_shortcut_reference_links
] | 1,013 | pandocExtensions :: Set Extension
pandocExtensions = Set.fromList
[ Ext_footnotes
, Ext_inline_notes
, Ext_pandoc_title_block
, Ext_yaml_metadata_block
, Ext_table_captions
, Ext_implicit_figures
, Ext_simple_tables
, Ext_multiline_tables
, Ext_grid_tables
, Ext_pipe_tables
, Ext_citations
, Ext_raw_tex
, Ext_raw_html
, Ext_tex_math_dollars
, Ext_latex_macros
, Ext_fenced_code_blocks
, Ext_fenced_code_attributes
, Ext_backtick_code_blocks
, Ext_inline_code_attributes
, Ext_markdown_in_html_blocks
, Ext_native_divs
, Ext_native_spans
, Ext_escaped_line_breaks
, Ext_fancy_lists
, Ext_startnum
, Ext_definition_lists
, Ext_example_lists
, Ext_all_symbols_escapable
, Ext_intraword_underscores
, Ext_blank_before_blockquote
, Ext_blank_before_header
, Ext_strikeout
, Ext_superscript
, Ext_subscript
, Ext_auto_identifiers
, Ext_header_attributes
, Ext_implicit_header_references
, Ext_line_blocks
, Ext_shortcut_reference_links
] | 1,013 | pandocExtensions = Set.fromList
[ Ext_footnotes
, Ext_inline_notes
, Ext_pandoc_title_block
, Ext_yaml_metadata_block
, Ext_table_captions
, Ext_implicit_figures
, Ext_simple_tables
, Ext_multiline_tables
, Ext_grid_tables
, Ext_pipe_tables
, Ext_citations
, Ext_raw_tex
, Ext_raw_html
, Ext_tex_math_dollars
, Ext_latex_macros
, Ext_fenced_code_blocks
, Ext_fenced_code_attributes
, Ext_backtick_code_blocks
, Ext_inline_code_attributes
, Ext_markdown_in_html_blocks
, Ext_native_divs
, Ext_native_spans
, Ext_escaped_line_breaks
, Ext_fancy_lists
, Ext_startnum
, Ext_definition_lists
, Ext_example_lists
, Ext_all_symbols_escapable
, Ext_intraword_underscores
, Ext_blank_before_blockquote
, Ext_blank_before_header
, Ext_strikeout
, Ext_superscript
, Ext_subscript
, Ext_auto_identifiers
, Ext_header_attributes
, Ext_implicit_header_references
, Ext_line_blocks
, Ext_shortcut_reference_links
] | 979 | false | true | 1 | 5 | 165 | 139 | 87 | 52 | null | null |
Warbo/quickcheck | examples/Heap_Program.hs | bsd-3-clause | prop_Unit x =
unit x ==? [x] | 30 | prop_Unit x =
unit x ==? [x] | 30 | prop_Unit x =
unit x ==? [x] | 30 | false | false | 0 | 6 | 8 | 19 | 9 | 10 | null | null |
mmarx/jebediah | cli/vehicle-assembly-building/Main.hs | gpl-3.0 | toLead1 t = toLead Violin t | 27 | toLead1 t = toLead Violin t | 27 | toLead1 t = toLead Violin t | 27 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxLANGUAGE_ENGLISH_PHILIPPINES :: Int
wxLANGUAGE_ENGLISH_PHILIPPINES = 68 | 73 | wxLANGUAGE_ENGLISH_PHILIPPINES :: Int
wxLANGUAGE_ENGLISH_PHILIPPINES = 68 | 73 | wxLANGUAGE_ENGLISH_PHILIPPINES = 68 | 35 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-printers/Language/Drasil/Printing/Import.hs | bsd-2-clause | neg' _ = False | 33 | neg' _ = False | 33 | neg' _ = False | 33 | false | false | 0 | 4 | 22 | 10 | 4 | 6 | null | null |
rueshyna/gogol | gogol-runtimeconfig/gen/Network/Google/Resource/RuntimeConfig/Operations/Delete.hs | mpl-2.0 | -- | OAuth access token.
odAccessToken :: Lens' OperationsDelete (Maybe Text)
odAccessToken
= lens _odAccessToken
(\ s a -> s{_odAccessToken = a}) | 154 | odAccessToken :: Lens' OperationsDelete (Maybe Text)
odAccessToken
= lens _odAccessToken
(\ s a -> s{_odAccessToken = a}) | 129 | odAccessToken
= lens _odAccessToken
(\ s a -> s{_odAccessToken = a}) | 76 | true | true | 0 | 9 | 29 | 48 | 25 | 23 | null | null |
egison/egison | hs-src/Language/Egison/Tensor.hs | mit | tToVector (Scalar x) = V.fromList [x] | 42 | tToVector (Scalar x) = V.fromList [x] | 42 | tToVector (Scalar x) = V.fromList [x] | 42 | false | false | 0 | 7 | 10 | 23 | 11 | 12 | null | null |
ml9951/ghc | compiler/main/HscTypes.hs | bsd-3-clause | implicitTyThings (ACoAxiom _cc) = [] | 36 | implicitTyThings (ACoAxiom _cc) = [] | 36 | implicitTyThings (ACoAxiom _cc) = [] | 36 | false | false | 0 | 7 | 4 | 17 | 8 | 9 | null | null |
ekmett/stackage | Stackage/Util.hs | mit | dataDir = (</> "share") . sandboxRoot | 37 | dataDir = (</> "share") . sandboxRoot | 37 | dataDir = (</> "share") . sandboxRoot | 37 | false | false | 2 | 5 | 5 | 19 | 8 | 11 | null | null |
Chobbes/Juicy.Pixels | src/Codec/Picture/Gif.hs | bsd-3-clause | disposalMethodOfCode :: Word8 -> DisposalMethod
disposalMethodOfCode v = case v of
0 -> DisposalAny
1 -> DisposalDoNot
2 -> DisposalRestoreBackground
3 -> DisposalRestorePrevious
n -> DisposalUnknown n | 221 | disposalMethodOfCode :: Word8 -> DisposalMethod
disposalMethodOfCode v = case v of
0 -> DisposalAny
1 -> DisposalDoNot
2 -> DisposalRestoreBackground
3 -> DisposalRestorePrevious
n -> DisposalUnknown n | 221 | disposalMethodOfCode v = case v of
0 -> DisposalAny
1 -> DisposalDoNot
2 -> DisposalRestoreBackground
3 -> DisposalRestorePrevious
n -> DisposalUnknown n | 173 | false | true | 2 | 5 | 46 | 39 | 23 | 16 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 224939 = 270 | 32 | getValueFromProduct 224939 = 270 | 32 | getValueFromProduct 224939 = 270 | 32 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
bergey/plots | examples/scatter-2.hs | bsd-3-clause | mydata3 = [V2 1.2 2.7, V2 2 5.1, V2 3.2 2.6, V2 3.5 5] | 54 | mydata3 = [V2 1.2 2.7, V2 2 5.1, V2 3.2 2.6, V2 3.5 5] | 54 | mydata3 = [V2 1.2 2.7, V2 2 5.1, V2 3.2 2.6, V2 3.5 5] | 54 | false | false | 1 | 6 | 13 | 41 | 19 | 22 | null | null |
gbwey/persistent | persistent-template/Database/Persist/TH.hs | mit | unKeyName :: EntityDef -> Name
unKeyName t = mkName $ "un" `mappend` keyString t | 80 | unKeyName :: EntityDef -> Name
unKeyName t = mkName $ "un" `mappend` keyString t | 80 | unKeyName t = mkName $ "un" `mappend` keyString t | 49 | false | true | 0 | 6 | 13 | 31 | 16 | 15 | null | null |
acfoltzer/off-simple | Graphics/Formats/OFF/Simple.hs | bsd-3-clause | -- | Parse a line of vertex coordinates.
parseVertex :: Parser Vertex
parseVertex = do
[x, y, z] <- count 3 (parseDouble <* spaces)
return (x, y, z)
<?> "x, y, z coordinates" | 184 | parseVertex :: Parser Vertex
parseVertex = do
[x, y, z] <- count 3 (parseDouble <* spaces)
return (x, y, z)
<?> "x, y, z coordinates" | 143 | parseVertex = do
[x, y, z] <- count 3 (parseDouble <* spaces)
return (x, y, z)
<?> "x, y, z coordinates" | 114 | true | true | 2 | 10 | 42 | 69 | 34 | 35 | null | null |
denisshevchenko/breadu.info | src/lib/BreadU/Pages/Content/Errors/HTTP404.hs | mit | http404Content De = ContentHTTP404
{ error404PageTitle = "404 Fehler"
, error404Description = "Die von Ihnen gesuchte Seite existiert nicht."
, error404GoToIndexPage = "Bitte gehen Sie zurück zur"
, error404IndexPageName = "Homepage"
} | 261 | http404Content De = ContentHTTP404
{ error404PageTitle = "404 Fehler"
, error404Description = "Die von Ihnen gesuchte Seite existiert nicht."
, error404GoToIndexPage = "Bitte gehen Sie zurück zur"
, error404IndexPageName = "Homepage"
} | 261 | http404Content De = ContentHTTP404
{ error404PageTitle = "404 Fehler"
, error404Description = "Die von Ihnen gesuchte Seite existiert nicht."
, error404GoToIndexPage = "Bitte gehen Sie zurück zur"
, error404IndexPageName = "Homepage"
} | 261 | false | false | 0 | 7 | 57 | 39 | 22 | 17 | null | null |
glutamate/cmdtheline | src/System/Console/CmdTheLine/Err.hs | mit | -- | Fail with an arbitrary message on failure.
msgFail :: Doc -> Err a
msgFail = throwError . MsgFail | 102 | msgFail :: Doc -> Err a
msgFail = throwError . MsgFail | 54 | msgFail = throwError . MsgFail | 30 | true | true | 0 | 7 | 19 | 29 | 13 | 16 | null | null |
iblumenfeld/saw-core | src/Verifier/SAW/TypedAST.hs | bsd-3-clause | lift2 :: (a -> b) -> (b -> b -> c) -> a -> a -> c
lift2 f h x y = h (f x) (f y) | 79 | lift2 :: (a -> b) -> (b -> b -> c) -> a -> a -> c
lift2 f h x y = h (f x) (f y) | 79 | lift2 f h x y = h (f x) (f y) | 29 | false | true | 0 | 9 | 27 | 71 | 36 | 35 | null | null |
Persi/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | prop_readGlob3 = isOk readGlob "[a[:alpha:]]" | 45 | prop_readGlob3 = isOk readGlob "[a[:alpha:]]" | 45 | prop_readGlob3 = isOk readGlob "[a[:alpha:]]" | 45 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
vikraman/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | dynamicLinkerLabelInfo _ = Nothing | 41 | dynamicLinkerLabelInfo _ = Nothing | 41 | dynamicLinkerLabelInfo _ = Nothing | 41 | false | false | 0 | 5 | 10 | 9 | 4 | 5 | null | null |
wginolas/playground | haskell/happstack-test/dist/build/autogen/Paths_happstack_test.hs | lgpl-3.0 | getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name) | 118 | getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name) | 118 | getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name) | 75 | false | true | 0 | 10 | 22 | 45 | 21 | 24 | null | null |
diku-dk/futhark | src/Language/Futhark/Prop.hs | isc | -- | The type scheme of a value binding, comprising the type
-- parameters and the actual type.
valBindTypeScheme :: ValBindBase Info VName -> ([TypeParamBase VName], StructType)
valBindTypeScheme vb =
( valBindTypeParams vb,
funType (valBindParams vb) (unInfo (valBindRetType vb))
) | 291 | valBindTypeScheme :: ValBindBase Info VName -> ([TypeParamBase VName], StructType)
valBindTypeScheme vb =
( valBindTypeParams vb,
funType (valBindParams vb) (unInfo (valBindRetType vb))
) | 195 | valBindTypeScheme vb =
( valBindTypeParams vb,
funType (valBindParams vb) (unInfo (valBindRetType vb))
) | 112 | true | true | 0 | 10 | 47 | 69 | 36 | 33 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 267197 = 2208 | 33 | getValueFromProduct 267197 = 2208 | 33 | getValueFromProduct 267197 = 2208 | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
wiggly/workshop | app/Context.hs | bsd-3-clause | functionYourNumbers :: (Int -> Int) -> [Int] -> [Int]
functionYourNumbers fn = map fn | 85 | functionYourNumbers :: (Int -> Int) -> [Int] -> [Int]
functionYourNumbers fn = map fn | 85 | functionYourNumbers fn = map fn | 31 | false | true | 0 | 7 | 13 | 38 | 20 | 18 | null | null |
rimmington/unordered-containers | Data/HashMap/Base.hs | bsd-3-clause | isLeafOrCollision :: HashMap k v -> Bool
isLeafOrCollision (Leaf _ _) = True | 81 | isLeafOrCollision :: HashMap k v -> Bool
isLeafOrCollision (Leaf _ _) = True | 81 | isLeafOrCollision (Leaf _ _) = True | 40 | false | true | 0 | 7 | 17 | 31 | 15 | 16 | null | null |
verement/etamoo | src/MOO/Compiler.hs | bsd-3-clause | _ `remain` _ = raise E_TYPE | 35 | _ `remain` _ = raise E_TYPE | 35 | _ `remain` _ = raise E_TYPE | 35 | false | false | 0 | 5 | 13 | 17 | 8 | 9 | null | null |
steve-chavez/postgrest | src/PostgREST/DbStructure.hs | mit | decodeTables :: HD.Result [Table]
decodeTables =
HD.rowList tblRow
where
tblRow = Table <$> column HD.text
<*> column HD.text
<*> nullableColumn HD.text
<*> column HD.bool
<*> column HD.bool
<*> column HD.bool | 299 | decodeTables :: HD.Result [Table]
decodeTables =
HD.rowList tblRow
where
tblRow = Table <$> column HD.text
<*> column HD.text
<*> nullableColumn HD.text
<*> column HD.bool
<*> column HD.bool
<*> column HD.bool | 299 | decodeTables =
HD.rowList tblRow
where
tblRow = Table <$> column HD.text
<*> column HD.text
<*> nullableColumn HD.text
<*> column HD.bool
<*> column HD.bool
<*> column HD.bool | 265 | false | true | 18 | 7 | 119 | 111 | 51 | 60 | null | null |
rvion/lamdu | Lamdu/Sugar/Convert/ParamList.hs | gpl-3.0 | mkFuncType :: Infer.Payload -> ParamList -> Infer Type
mkFuncType inferred paramList =
T.TFun
<$> (T.TRecord <$> foldr step (pure T.CEmpty) paramList)
<*> Infer.freshInferredVar scope "l"
where
scope = inferred ^. Infer.plScope
step tag rest = T.CExtend tag <$> Infer.freshInferredVar scope "t" <*> rest | 335 | mkFuncType :: Infer.Payload -> ParamList -> Infer Type
mkFuncType inferred paramList =
T.TFun
<$> (T.TRecord <$> foldr step (pure T.CEmpty) paramList)
<*> Infer.freshInferredVar scope "l"
where
scope = inferred ^. Infer.plScope
step tag rest = T.CExtend tag <$> Infer.freshInferredVar scope "t" <*> rest | 335 | mkFuncType inferred paramList =
T.TFun
<$> (T.TRecord <$> foldr step (pure T.CEmpty) paramList)
<*> Infer.freshInferredVar scope "l"
where
scope = inferred ^. Infer.plScope
step tag rest = T.CExtend tag <$> Infer.freshInferredVar scope "t" <*> rest | 280 | false | true | 0 | 12 | 74 | 113 | 55 | 58 | null | null |
dmbarbour/awelon | hsrc_util/ShowEnv.hs | bsd-3-clause | showNamedStacks v =
showString "???: " . shows v . showChar '\n' | 69 | showNamedStacks v =
showString "???: " . shows v . showChar '\n' | 69 | showNamedStacks v =
showString "???: " . shows v . showChar '\n' | 69 | false | false | 1 | 7 | 16 | 29 | 11 | 18 | null | null |
spechub/Hets | Common/Keywords.hs | gpl-2.0 | floatingS :: String
floatingS = "floating" | 42 | floatingS :: String
floatingS = "floating" | 42 | floatingS = "floating" | 22 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
biegunka/biegunka | test/spec/Control/Biegunka/Source/GitSpec.hs | mit | addNewFile :: FilePath -> IO ()
addNewFile fp = () <$ do
setCredentials fp
let anotherFile = fp </> "another-file"
writeFile anotherFile "something"
Git.runGit fp ["add", anotherFile]
Git.runGit fp ["commit", "-m", "add new file"] | 240 | addNewFile :: FilePath -> IO ()
addNewFile fp = () <$ do
setCredentials fp
let anotherFile = fp </> "another-file"
writeFile anotherFile "something"
Git.runGit fp ["add", anotherFile]
Git.runGit fp ["commit", "-m", "add new file"] | 240 | addNewFile fp = () <$ do
setCredentials fp
let anotherFile = fp </> "another-file"
writeFile anotherFile "something"
Git.runGit fp ["add", anotherFile]
Git.runGit fp ["commit", "-m", "add new file"] | 208 | false | true | 0 | 11 | 43 | 91 | 43 | 48 | null | null |
kumasento/accelerate-cuda | Data/Array/Accelerate/CUDA/CodeGen.hs | bsd-3-clause | codegenFloatingScalar (TypeDouble _) x = C.Const (C.DoubleConst (show x) (toRational x) noLoc) noLoc | 101 | codegenFloatingScalar (TypeDouble _) x = C.Const (C.DoubleConst (show x) (toRational x) noLoc) noLoc | 101 | codegenFloatingScalar (TypeDouble _) x = C.Const (C.DoubleConst (show x) (toRational x) noLoc) noLoc | 101 | false | false | 0 | 9 | 13 | 48 | 23 | 25 | null | null |
isomorphism/webgl | src/Graphics/Rendering/WebGL/Constants.hs | mit | gl_PACK_SKIP_ROWS :: GLenum
gl_PACK_SKIP_ROWS = 0x0D03 | 54 | gl_PACK_SKIP_ROWS :: GLenum
gl_PACK_SKIP_ROWS = 0x0D03 | 54 | gl_PACK_SKIP_ROWS = 0x0D03 | 26 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
timjs/spl-compiler | src/Language/SPL/Data/Instruction.hs | bsd-3-clause | tabstop :: Int
tabstop = 16 | 27 | tabstop :: Int
tabstop = 16 | 27 | tabstop = 16 | 12 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
jystic/mothership | src/Snap/Util.hs | bsd-3-clause | cacheForever :: MonadSnap m => m ()
cacheForever = expires 31536000 | 67 | cacheForever :: MonadSnap m => m ()
cacheForever = expires 31536000 | 67 | cacheForever = expires 31536000 | 31 | false | true | 0 | 7 | 10 | 26 | 12 | 14 | null | null |
astro/haskell-torrent | src/BCode.hs | bsd-2-clause | search (PInt i : rest) (BArray bs) | i < 0 || i > length bs = Nothing
| otherwise = search rest (bs!!i) | 138 | search (PInt i : rest) (BArray bs) | i < 0 || i > length bs = Nothing
| otherwise = search rest (bs!!i) | 138 | search (PInt i : rest) (BArray bs) | i < 0 || i > length bs = Nothing
| otherwise = search rest (bs!!i) | 138 | false | false | 1 | 10 | 58 | 69 | 32 | 37 | null | null |
holzensp/ghc | compiler/cmm/PprC.hs | bsd-3-clause | te_Lit _ = return () | 20 | te_Lit _ = return () | 20 | te_Lit _ = return () | 20 | false | false | 0 | 6 | 4 | 14 | 6 | 8 | null | null |
keithshep/txt-sushi | Database/TxtSushi/SQLParser.hs | bsd-3-clause | maybeParseGroupByPart :: GenParser Char st (Maybe ([Expression], Maybe Expression))
maybeParseGroupByPart =
ifParseThen
-- if we see a "GROUP BY"
(parseToken "GROUP")
-- then parse the expressions
(parseToken "BY" >> parseGroupBy)
where
parseGroupBy = do
groupExprs <- atLeastOneExpr
maybeHavingExpr <- ifParseThen (parseToken "HAVING") parseExpression
return (groupExprs, maybeHavingExpr) | 487 | maybeParseGroupByPart :: GenParser Char st (Maybe ([Expression], Maybe Expression))
maybeParseGroupByPart =
ifParseThen
-- if we see a "GROUP BY"
(parseToken "GROUP")
-- then parse the expressions
(parseToken "BY" >> parseGroupBy)
where
parseGroupBy = do
groupExprs <- atLeastOneExpr
maybeHavingExpr <- ifParseThen (parseToken "HAVING") parseExpression
return (groupExprs, maybeHavingExpr) | 487 | maybeParseGroupByPart =
ifParseThen
-- if we see a "GROUP BY"
(parseToken "GROUP")
-- then parse the expressions
(parseToken "BY" >> parseGroupBy)
where
parseGroupBy = do
groupExprs <- atLeastOneExpr
maybeHavingExpr <- ifParseThen (parseToken "HAVING") parseExpression
return (groupExprs, maybeHavingExpr) | 403 | false | true | 0 | 10 | 143 | 104 | 52 | 52 | null | null |
vu3rdd/functorrent | src/FuncTorrent/Peer.hs | gpl-3.0 | doHandshake :: Bool -> Handle -> Peer -> ByteString -> String -> IO ()
doHandshake True h p infohash peerid = do
let hs = genHandshakeMsg infohash peerid
hPut h hs
putStrLn $ "--> handhake to peer: " ++ show p
hsMsg <- hGet h (length (unpack hs))
putStrLn $ "<-- handshake from peer: " ++ show p
infoPieceMap <- newEmptyMVar
metadataMsgLoop h $ InfoState infoPieceMap
return ()
-- if doesPeerSupportExtendedMsg hsMsg
-- then
-- return doExtendedHandshake h
-- else
-- return Nothing | 516 | doHandshake :: Bool -> Handle -> Peer -> ByteString -> String -> IO ()
doHandshake True h p infohash peerid = do
let hs = genHandshakeMsg infohash peerid
hPut h hs
putStrLn $ "--> handhake to peer: " ++ show p
hsMsg <- hGet h (length (unpack hs))
putStrLn $ "<-- handshake from peer: " ++ show p
infoPieceMap <- newEmptyMVar
metadataMsgLoop h $ InfoState infoPieceMap
return ()
-- if doesPeerSupportExtendedMsg hsMsg
-- then
-- return doExtendedHandshake h
-- else
-- return Nothing | 516 | doHandshake True h p infohash peerid = do
let hs = genHandshakeMsg infohash peerid
hPut h hs
putStrLn $ "--> handhake to peer: " ++ show p
hsMsg <- hGet h (length (unpack hs))
putStrLn $ "<-- handshake from peer: " ++ show p
infoPieceMap <- newEmptyMVar
metadataMsgLoop h $ InfoState infoPieceMap
return ()
-- if doesPeerSupportExtendedMsg hsMsg
-- then
-- return doExtendedHandshake h
-- else
-- return Nothing | 445 | false | true | 0 | 13 | 116 | 159 | 72 | 87 | null | null |
kite-lang/kite | src/Kite/CodegenJS.hs | mit | emit (PBool val) = if val then "true" else "false" | 50 | emit (PBool val) = if val then "true" else "false" | 50 | emit (PBool val) = if val then "true" else "false" | 50 | false | false | 0 | 6 | 9 | 24 | 12 | 12 | null | null |
semaj/hademlia | src/Utils.hs | bsd-3-clause | zeroPad :: Int -> String -> String
zeroPad i s = pad ++ s
where pad = replicate (i - length s) '0' | 101 | zeroPad :: Int -> String -> String
zeroPad i s = pad ++ s
where pad = replicate (i - length s) '0' | 101 | zeroPad i s = pad ++ s
where pad = replicate (i - length s) '0' | 66 | false | true | 3 | 8 | 25 | 60 | 26 | 34 | null | null |
tibbe/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | toSlowEntryLbl l = pprPanic "toSlowEntryLbl" (ppr l) | 52 | toSlowEntryLbl l = pprPanic "toSlowEntryLbl" (ppr l) | 52 | toSlowEntryLbl l = pprPanic "toSlowEntryLbl" (ppr l) | 52 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
ivan-m/servant-auth-token | servant-auth-token-leveldb/src/Servant/Server/Auth/Token/LevelDB/Schema.hs | bsd-3-clause | load :: (MonadResource m, Key i a, SafeCopy a) => LevelDBEnv -> i -> m (Maybe a)
load (LevelDBEnv db ropts _ _) i = do
mbs <- get db ropts (encodeKey i)
return $ decodeExWith safeGet <$> mbs
-- | Store object by id in leveldb | 230 | load :: (MonadResource m, Key i a, SafeCopy a) => LevelDBEnv -> i -> m (Maybe a)
load (LevelDBEnv db ropts _ _) i = do
mbs <- get db ropts (encodeKey i)
return $ decodeExWith safeGet <$> mbs
-- | Store object by id in leveldb | 230 | load (LevelDBEnv db ropts _ _) i = do
mbs <- get db ropts (encodeKey i)
return $ decodeExWith safeGet <$> mbs
-- | Store object by id in leveldb | 149 | false | true | 0 | 10 | 51 | 103 | 50 | 53 | null | null |
green-haskell/ghc | compiler/deSugar/DsArrows.hs | bsd-3-clause | dsCmd ids local_vars stack_ty res_ty (HsCmdLet binds body) env_ids = do
let
defined_vars = mkVarSet (collectLocalBinders binds)
local_vars' = defined_vars `unionVarSet` local_vars
(core_body, _free_vars, env_ids') <- dsfixCmd ids local_vars' stack_ty res_ty body
stack_id <- newSysLocalDs stack_ty
-- build a new environment, plus the stack, using the let bindings
core_binds <- dsLocalBinds binds (buildEnvStack env_ids' stack_id)
-- match the old environment and stack against the input
core_map <- matchEnvStack env_ids stack_id core_binds
return (do_premap ids
(envStackType env_ids stack_ty)
(envStackType env_ids' stack_ty)
res_ty
core_map
core_body,
exprFreeIds core_binds `intersectVarSet` local_vars)
-- D; xs |-a ss : t
-- ----------------------------------
-- D; xs |-a do { ss } : () --> t
--
-- ---> premap (\ (env,stk) -> env) c | 1,033 | dsCmd ids local_vars stack_ty res_ty (HsCmdLet binds body) env_ids = do
let
defined_vars = mkVarSet (collectLocalBinders binds)
local_vars' = defined_vars `unionVarSet` local_vars
(core_body, _free_vars, env_ids') <- dsfixCmd ids local_vars' stack_ty res_ty body
stack_id <- newSysLocalDs stack_ty
-- build a new environment, plus the stack, using the let bindings
core_binds <- dsLocalBinds binds (buildEnvStack env_ids' stack_id)
-- match the old environment and stack against the input
core_map <- matchEnvStack env_ids stack_id core_binds
return (do_premap ids
(envStackType env_ids stack_ty)
(envStackType env_ids' stack_ty)
res_ty
core_map
core_body,
exprFreeIds core_binds `intersectVarSet` local_vars)
-- D; xs |-a ss : t
-- ----------------------------------
-- D; xs |-a do { ss } : () --> t
--
-- ---> premap (\ (env,stk) -> env) c | 1,033 | dsCmd ids local_vars stack_ty res_ty (HsCmdLet binds body) env_ids = do
let
defined_vars = mkVarSet (collectLocalBinders binds)
local_vars' = defined_vars `unionVarSet` local_vars
(core_body, _free_vars, env_ids') <- dsfixCmd ids local_vars' stack_ty res_ty body
stack_id <- newSysLocalDs stack_ty
-- build a new environment, plus the stack, using the let bindings
core_binds <- dsLocalBinds binds (buildEnvStack env_ids' stack_id)
-- match the old environment and stack against the input
core_map <- matchEnvStack env_ids stack_id core_binds
return (do_premap ids
(envStackType env_ids stack_ty)
(envStackType env_ids' stack_ty)
res_ty
core_map
core_body,
exprFreeIds core_binds `intersectVarSet` local_vars)
-- D; xs |-a ss : t
-- ----------------------------------
-- D; xs |-a do { ss } : () --> t
--
-- ---> premap (\ (env,stk) -> env) c | 1,033 | false | false | 0 | 12 | 307 | 184 | 93 | 91 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxLANGUAGE_BASHKIR :: Int
wxLANGUAGE_BASHKIR = 31 | 49 | wxLANGUAGE_BASHKIR :: Int
wxLANGUAGE_BASHKIR = 31 | 49 | wxLANGUAGE_BASHKIR = 31 | 23 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
ezyang/ghc | compiler/codeGen/StgCmmMonad.hs | bsd-3-clause | getHpUsage :: FCode HeapUsage
getHpUsage = do
state <- getState
return $ cgs_hp_usg state | 105 | getHpUsage :: FCode HeapUsage
getHpUsage = do
state <- getState
return $ cgs_hp_usg state | 105 | getHpUsage = do
state <- getState
return $ cgs_hp_usg state | 75 | false | true | 0 | 8 | 29 | 31 | 14 | 17 | null | null |
haskell-distributed/distributed-process-async | src/Control/Distributed/Process/Async.hs | bsd-3-clause | -- | Like 'cancelWith' but sends a @kill@ instruction instead of an exit.
cancelKill :: String -> Async a -> Process ()
cancelKill reason hAsync = kill (_asyncWorker hAsync) reason | 180 | cancelKill :: String -> Async a -> Process ()
cancelKill reason hAsync = kill (_asyncWorker hAsync) reason | 106 | cancelKill reason hAsync = kill (_asyncWorker hAsync) reason | 60 | true | true | 0 | 8 | 29 | 44 | 21 | 23 | null | null |
CRogers/bananasnake | src/Render.hs | mit | render :: Game -> IO ()
render game = do
let rows = map (renderLine game) [0..(gameHeight game - 1)]
traverse_ putStrLn rows
scrollToFit (length rows) | 156 | render :: Game -> IO ()
render game = do
let rows = map (renderLine game) [0..(gameHeight game - 1)]
traverse_ putStrLn rows
scrollToFit (length rows) | 156 | render game = do
let rows = map (renderLine game) [0..(gameHeight game - 1)]
traverse_ putStrLn rows
scrollToFit (length rows) | 132 | false | true | 0 | 15 | 31 | 83 | 37 | 46 | null | null |
sbditto85/parsedsltest | src/Algebra.hs | apache-2.0 | -- | concat a stringconcat
concatStringConcat :: IdentStorage -> StringConcat -> String
concatStringConcat identStorage (StrIdentConcat (Ident fromIdent) stringConcat') =
let
fromIdentValue = MAP.lookupDefault "" fromIdent identStorage
rest = concatStringConcat identStorage stringConcat'
in
fromIdentValue ++ rest | 330 | concatStringConcat :: IdentStorage -> StringConcat -> String
concatStringConcat identStorage (StrIdentConcat (Ident fromIdent) stringConcat') =
let
fromIdentValue = MAP.lookupDefault "" fromIdent identStorage
rest = concatStringConcat identStorage stringConcat'
in
fromIdentValue ++ rest | 303 | concatStringConcat identStorage (StrIdentConcat (Ident fromIdent) stringConcat') =
let
fromIdentValue = MAP.lookupDefault "" fromIdent identStorage
rest = concatStringConcat identStorage stringConcat'
in
fromIdentValue ++ rest | 242 | true | true | 0 | 10 | 50 | 73 | 36 | 37 | null | null |
ekmett/wxHaskell | wx/src/Graphics/UI/WX/Controls.hs | lgpl-2.1 | wizardPageSimple :: Wizard a -> [Prop (WizardPageSimple ())] -> IO (WizardPageSimple ())
wizardPageSimple parent props
= do
w <- wizardPageSimpleCreate parent
set w props
return w | 193 | wizardPageSimple :: Wizard a -> [Prop (WizardPageSimple ())] -> IO (WizardPageSimple ())
wizardPageSimple parent props
= do
w <- wizardPageSimpleCreate parent
set w props
return w | 193 | wizardPageSimple parent props
= do
w <- wizardPageSimpleCreate parent
set w props
return w | 104 | false | true | 0 | 11 | 39 | 76 | 34 | 42 | null | null |
rfranek/duckling | tests/Duckling/Testing/Asserts.hs | bsd-3-clause | withTargets :: [Some Dimension] -> (Text, a) -> (Text, [Some Dimension], a)
withTargets targets (input, expected) = (input, targets, expected) | 142 | withTargets :: [Some Dimension] -> (Text, a) -> (Text, [Some Dimension], a)
withTargets targets (input, expected) = (input, targets, expected) | 142 | withTargets targets (input, expected) = (input, targets, expected) | 66 | false | true | 0 | 9 | 19 | 71 | 39 | 32 | null | null |
haskell-pkg-janitors/feed | Text/RSS/Import.hs | bsd-3-clause | pQNodes :: Name -> [XML.Element] -> [XML.Element]
pQNodes x es = filter ((x==) . elementName) es | 104 | pQNodes :: Name -> [XML.Element] -> [XML.Element]
pQNodes x es = filter ((x==) . elementName) es | 104 | pQNodes x es = filter ((x==) . elementName) es | 48 | false | true | 0 | 10 | 23 | 57 | 28 | 29 | null | null |
mightymoose/liquidhaskell | benchmarks/llrbtree-0.1.1/Data/Set/WBTree.hs | bsd-3-clause | singleR :: WBTree a -> a -> WBTree a -> WBTree a
singleR (Node _ ll lx lr) x r = node ll lx (node lr x r) | 105 | singleR :: WBTree a -> a -> WBTree a -> WBTree a
singleR (Node _ ll lx lr) x r = node ll lx (node lr x r) | 105 | singleR (Node _ ll lx lr) x r = node ll lx (node lr x r) | 56 | false | true | 0 | 8 | 27 | 68 | 32 | 36 | null | null |
MasseR/xmonadcontrib | XMonad/Util/XSelection.hs | bsd-3-clause | safePromptSelection app = join $ io $ liftM (safeSpawn app . return) getSelection | 81 | safePromptSelection app = join $ io $ liftM (safeSpawn app . return) getSelection | 81 | safePromptSelection app = join $ io $ liftM (safeSpawn app . return) getSelection | 81 | false | false | 0 | 9 | 12 | 32 | 15 | 17 | null | null |
vikraman/ghc | compiler/basicTypes/Avail.hs | bsd-3-clause | avail :: Name -> AvailInfo
avail n = Avail NotPatSyn n | 54 | avail :: Name -> AvailInfo
avail n = Avail NotPatSyn n | 54 | avail n = Avail NotPatSyn n | 27 | false | true | 0 | 5 | 10 | 23 | 11 | 12 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.