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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
GaloisInc/saw-script | src/SAWScript/Prover/What4.hs | bsd-3-clause | proveExportWhat4_boolector = proveExportWhat4_sym boolectorAdapter | 66 | proveExportWhat4_boolector = proveExportWhat4_sym boolectorAdapter | 66 | proveExportWhat4_boolector = proveExportWhat4_sym boolectorAdapter | 66 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
romanb/amazonka | amazonka-s3/gen/Network/AWS/S3/DeleteBucketTagging.hs | mpl-2.0 | -- | 'DeleteBucketTaggingResponse' constructor.
deleteBucketTaggingResponse :: DeleteBucketTaggingResponse
deleteBucketTaggingResponse = DeleteBucketTaggingResponse | 164 | deleteBucketTaggingResponse :: DeleteBucketTaggingResponse
deleteBucketTaggingResponse = DeleteBucketTaggingResponse | 116 | deleteBucketTaggingResponse = DeleteBucketTaggingResponse | 57 | true | true | 0 | 4 | 9 | 12 | 7 | 5 | null | null |
ezyang/ghc | compiler/utils/Bag.hs | bsd-3-clause | mapAccumBagLM :: Monad m
=> (acc -> x -> m (acc, y)) -- ^ combining function
-> acc -- ^ initial state
-> Bag x -- ^ inputs
-> m (acc, Bag y) -- ^ final state, outputs
mapAccumBagLM _ s EmptyBag = return (s, EmptyBag) | 322 | mapAccumBagLM :: Monad m
=> (acc -> x -> m (acc, y)) -- ^ combining function
-> acc -- ^ initial state
-> Bag x -- ^ inputs
-> m (acc, Bag y)
mapAccumBagLM _ s EmptyBag = return (s, EmptyBag) | 286 | mapAccumBagLM _ s EmptyBag = return (s, EmptyBag) | 56 | true | true | 0 | 11 | 150 | 85 | 45 | 40 | null | null |
ariep/psqueues | tests/Data/HashPSQ/Tests.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- Index of tests
--------------------------------------------------------------------------------
tests :: [Test]
tests =
[ testCase "showBucket" test_showBucket
, testCase "toBucket" test_toBucket
, testProperty "unsafeLookupIncreasePriority"
prop_unsafeLookupIncreasePriority
, testProperty "unsafeInsertIncreasePriority"
prop_unsafeInsertIncreasePriority
, testProperty "unsafeInsertIncreasePriorityView"
prop_unsafeInsertIncreasePriorityView
, testProperty "takeMin_length" prop_takeMin_length
, testProperty "takeMin_increasing" prop_takeMin_increasing
, testProperty "insertWith_const" prop_insertWith_const
, testProperty "insertWith_flipconst" prop_insertWith_flipconst
] | 970 | tests :: [Test]
tests =
[ testCase "showBucket" test_showBucket
, testCase "toBucket" test_toBucket
, testProperty "unsafeLookupIncreasePriority"
prop_unsafeLookupIncreasePriority
, testProperty "unsafeInsertIncreasePriority"
prop_unsafeInsertIncreasePriority
, testProperty "unsafeInsertIncreasePriorityView"
prop_unsafeInsertIncreasePriorityView
, testProperty "takeMin_length" prop_takeMin_length
, testProperty "takeMin_increasing" prop_takeMin_increasing
, testProperty "insertWith_const" prop_insertWith_const
, testProperty "insertWith_flipconst" prop_insertWith_flipconst
] | 789 | tests =
[ testCase "showBucket" test_showBucket
, testCase "toBucket" test_toBucket
, testProperty "unsafeLookupIncreasePriority"
prop_unsafeLookupIncreasePriority
, testProperty "unsafeInsertIncreasePriority"
prop_unsafeInsertIncreasePriority
, testProperty "unsafeInsertIncreasePriorityView"
prop_unsafeInsertIncreasePriorityView
, testProperty "takeMin_length" prop_takeMin_length
, testProperty "takeMin_increasing" prop_takeMin_increasing
, testProperty "insertWith_const" prop_insertWith_const
, testProperty "insertWith_flipconst" prop_insertWith_flipconst
] | 773 | true | true | 0 | 7 | 256 | 96 | 48 | 48 | null | null |
Gabriel439/Haskell-Dhall-Library | dhall/src/Dhall/Parser/Token.hs | bsd-3-clause | -- | Parse the @)@ symbol
_closeParens :: Parser ()
_closeParens = reservedChar ')' | 83 | _closeParens :: Parser ()
_closeParens = reservedChar ')' | 57 | _closeParens = reservedChar ')' | 31 | true | true | 1 | 6 | 13 | 23 | 10 | 13 | null | null |
holzensp/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | needsCDecl (LargeSRTLabel _) = False | 47 | needsCDecl (LargeSRTLabel _) = False | 47 | needsCDecl (LargeSRTLabel _) = False | 47 | false | false | 0 | 6 | 15 | 16 | 7 | 9 | null | null |
pshendry/project-euler-solutions | 0008/solution.hs | mit | digitProducts :: Int -> [Word64] -> [Word64]
digitProducts n ds = digitProductsHelper (take n ds) (drop n ds)
where
digitProductsHelper _ [] = []
digitProductsHelper a@(_:xs) (y:ys) = (product a) : (digitProductsHelper (xs ++ [y]) ys) | 244 | digitProducts :: Int -> [Word64] -> [Word64]
digitProducts n ds = digitProductsHelper (take n ds) (drop n ds)
where
digitProductsHelper _ [] = []
digitProductsHelper a@(_:xs) (y:ys) = (product a) : (digitProductsHelper (xs ++ [y]) ys) | 244 | digitProducts n ds = digitProductsHelper (take n ds) (drop n ds)
where
digitProductsHelper _ [] = []
digitProductsHelper a@(_:xs) (y:ys) = (product a) : (digitProductsHelper (xs ++ [y]) ys) | 199 | false | true | 0 | 11 | 45 | 136 | 66 | 70 | null | null |
kebertx/GoFu | src/SGF/Parser.hs | bsd-3-clause | parens :: Parser a -> Parser a
parens = between (symbol "(") (symbol ")") | 73 | parens :: Parser a -> Parser a
parens = between (symbol "(") (symbol ")") | 73 | parens = between (symbol "(") (symbol ")") | 42 | false | true | 0 | 7 | 13 | 44 | 19 | 25 | null | null |
ryantm/hdbc-mysql | testsrc/Testbasics.hs | lgpl-2.1 | multiFinish = dbTestCase (\dbh ->
do sth <- prepare dbh "SELECT 1 + 1"
r <- execute sth []
assertEqual "basic count" 0 r
finish sth
finish sth
finish sth
) | 220 | multiFinish = dbTestCase (\dbh ->
do sth <- prepare dbh "SELECT 1 + 1"
r <- execute sth []
assertEqual "basic count" 0 r
finish sth
finish sth
finish sth
) | 220 | multiFinish = dbTestCase (\dbh ->
do sth <- prepare dbh "SELECT 1 + 1"
r <- execute sth []
assertEqual "basic count" 0 r
finish sth
finish sth
finish sth
) | 220 | false | false | 1 | 12 | 95 | 74 | 30 | 44 | null | null |
enolan/Idris-dev | src/Idris/Output.hs | bsd-3-clause | -- | Pretty-print a collection of overloadings to REPL or IDEMode - corresponds to :t name
iPrintFunTypes :: [(Name, Bool)] -> Name -> [(Name, Doc OutputAnnotation)] -> Idris ()
iPrintFunTypes bnd n [] = iPrintError $ "No such variable " ++ show n | 254 | iPrintFunTypes :: [(Name, Bool)] -> Name -> [(Name, Doc OutputAnnotation)] -> Idris ()
iPrintFunTypes bnd n [] = iPrintError $ "No such variable " ++ show n | 163 | iPrintFunTypes bnd n [] = iPrintError $ "No such variable " ++ show n | 76 | true | true | 0 | 10 | 49 | 74 | 38 | 36 | null | null |
christiaanb/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | mkIntLitInt dflags n = Lit (mkMachInt dflags (toInteger n)) | 59 | mkIntLitInt dflags n = Lit (mkMachInt dflags (toInteger n)) | 59 | mkIntLitInt dflags n = Lit (mkMachInt dflags (toInteger n)) | 59 | false | false | 1 | 9 | 8 | 33 | 13 | 20 | null | null |
marcmo/hsDiagnosis | other/DiagClientEvent.hs | bsd-3-clause | receiveDataMsg :: Ptr CChar -> Net (Maybe HSFZMessage)
receiveDataMsg buf = do
msg <- receiveMsg buf
log $ "was " ++ show msg
maybe (return ()) (\m -> log $ "<-- " ++ show m) msg
maybe (return Nothing)
(\m->if isData m then log "was data!" >> return msg else log "was no data packet" >> receiveDataMsg buf) msg | 333 | receiveDataMsg :: Ptr CChar -> Net (Maybe HSFZMessage)
receiveDataMsg buf = do
msg <- receiveMsg buf
log $ "was " ++ show msg
maybe (return ()) (\m -> log $ "<-- " ++ show m) msg
maybe (return Nothing)
(\m->if isData m then log "was data!" >> return msg else log "was no data packet" >> receiveDataMsg buf) msg | 333 | receiveDataMsg buf = do
msg <- receiveMsg buf
log $ "was " ++ show msg
maybe (return ()) (\m -> log $ "<-- " ++ show m) msg
maybe (return Nothing)
(\m->if isData m then log "was data!" >> return msg else log "was no data packet" >> receiveDataMsg buf) msg | 277 | false | true | 0 | 12 | 81 | 146 | 68 | 78 | null | null |
ksallberg/block-battle | Block.hs | bsd-3-clause | parseField :: String -> Field
parseField str = let fieldParts = splitBy ';' str
in [map (\x -> read x :: Int) (splitBy ',' fieldPart)
| fieldPart <- fieldParts] | 198 | parseField :: String -> Field
parseField str = let fieldParts = splitBy ';' str
in [map (\x -> read x :: Int) (splitBy ',' fieldPart)
| fieldPart <- fieldParts] | 198 | parseField str = let fieldParts = splitBy ';' str
in [map (\x -> read x :: Int) (splitBy ',' fieldPart)
| fieldPart <- fieldParts] | 168 | false | true | 0 | 11 | 66 | 72 | 36 | 36 | null | null |
foreverbell/project-euler-solutions | lib/Common/List.hs | bsd-3-clause | maximum' :: Ord a => [a] -> a
maximum' = foldl1' max | 52 | maximum' :: Ord a => [a] -> a
maximum' = foldl1' max | 52 | maximum' = foldl1' max | 22 | false | true | 0 | 7 | 11 | 28 | 14 | 14 | null | null |
rudymatela/llcheck | src/Test/LeanCheck/Tiers.hs | bsd-3-clause | -- | Takes as argument tiers of element values;
-- returns tiers of size-ordered lists of elements possibly with repetition.
--
-- > bagsOf [[0],[1],[2],...] =
-- > [ [[]]
-- > , [[0]]
-- > , [[0,0],[1]]
-- > , [[0,0,0],[0,1],[2]]
-- > , [[0,0,0,0],[0,0,1],[0,2],[1,1],[3]]
-- > , [[0,0,0,0,0],[0,0,0,1],[0,0,2],[0,1,1],[0,3],[1,2],[4]]
-- > , ...
-- > ]
bagsOf :: [[a]] -> [[[a]]]
bagsOf = ([[]]:) . concatT . bagChoicesWith (\x xss -> mapT (x:) (bagsOf xss)) | 480 | bagsOf :: [[a]] -> [[[a]]]
bagsOf = ([[]]:) . concatT . bagChoicesWith (\x xss -> mapT (x:) (bagsOf xss)) | 107 | bagsOf = ([[]]:) . concatT . bagChoicesWith (\x xss -> mapT (x:) (bagsOf xss)) | 80 | true | true | 1 | 11 | 95 | 94 | 56 | 38 | null | null |
ulricha/dsh-sql | src/Database/DSH/Backend/Sql/Opt/Rewrite/Expr.hs | bsd-3-clause | selectExpr :: TARule ()
selectExpr q =
$(dagPatMatch 'q "Select e (qi)"
[| do
let e' = specializeExpr $(v "e")
predicate $ e' /= $(v "e")
return $ do
logRewrite "Basic.Expr.Project" q
void $ replaceWithNew q $ UnOp (Select e') $(v "qi") |]) | 294 | selectExpr :: TARule ()
selectExpr q =
$(dagPatMatch 'q "Select e (qi)"
[| do
let e' = specializeExpr $(v "e")
predicate $ e' /= $(v "e")
return $ do
logRewrite "Basic.Expr.Project" q
void $ replaceWithNew q $ UnOp (Select e') $(v "qi") |]) | 294 | selectExpr q =
$(dagPatMatch 'q "Select e (qi)"
[| do
let e' = specializeExpr $(v "e")
predicate $ e' /= $(v "e")
return $ do
logRewrite "Basic.Expr.Project" q
void $ replaceWithNew q $ UnOp (Select e') $(v "qi") |]) | 270 | false | true | 0 | 8 | 96 | 39 | 19 | 20 | null | null |
Lainepress/hledger | hledger-lib/Hledger/Data/Dates.hs | gpl-3.0 | showDate :: Day -> String
showDate = formatTime defaultTimeLocale "%C%y/%m/%d" | 78 | showDate :: Day -> String
showDate = formatTime defaultTimeLocale "%C%y/%m/%d" | 78 | showDate = formatTime defaultTimeLocale "%C%y/%m/%d" | 52 | false | true | 0 | 5 | 9 | 20 | 10 | 10 | null | null |
ganeti/ganeti | src/Ganeti/Query/Language.hs | bsd-2-clause | readFilter v =
Error $ "Cannot deserialise filter: expected array [string, args], got " ++
show (pp_value v) | 118 | readFilter v =
Error $ "Cannot deserialise filter: expected array [string, args], got " ++
show (pp_value v) | 118 | readFilter v =
Error $ "Cannot deserialise filter: expected array [string, args], got " ++
show (pp_value v) | 118 | false | false | 0 | 8 | 27 | 26 | 12 | 14 | null | null |
ezyang/ghc | compiler/nativeGen/X86/Regs.hs | bsd-3-clause | r15 = regSingle 15 | 20 | r15 = regSingle 15 | 20 | r15 = regSingle 15 | 20 | false | false | 1 | 5 | 5 | 12 | 4 | 8 | null | null |
ulricha/algebra-sql | src/Database/Algebra/SQL/Termination.hs | bsd-3-clause | terminatingFeaturesPg :: Feature -> FeatureSet
terminatingFeaturesPg bottomF = F $ case bottomF of
ExprProjectF -> S.empty
ColumnProjectF -> S.empty
TableF -> S.empty
FilterF -> S.empty
-- Distinction has to occur before:
--
-- * Projection of columns: Because there exist cases where to much gets
-- removed.
--
-- * Aggregation: Because the previous result set influences the value
-- of aggregate functions, including duplicates.
--
-- * Grouping: Grouping could project away columns, which are needed for
-- duplicate elimination.
--
DupElimF -> S.fromList [ColumnProjectF, ExprProjectF, AggrAndGroupingF]
-- The ORDER BY clause will only be used on top.
SortF -> S.empty
-- Problematic cases:
--
-- * Filtering: May change the intermediate result set.
--
-- * Duplicate removal with DISTINCT has another semantic meaning.
--
-- * Stacked window functions can possibly have other windows and window
-- functions can not be nested.
--
-- * Aggregates of window functions can not be built.
--
WindowFunctionF ->
S.fromList [FilterF, DupElimF, WindowFunctionF, AggrAndGroupingF]
-- Problematic cases:
--
-- * Filtering: May change intermediate result set.
--
-- * Aggregate functions can not be stacked.
--
-- * Is there a case, where OLAP functions using windows with aggregates
-- makes sense? It is possible, and inlining works, therefore it is
-- enabled.
--
AggrAndGroupingF -> S.fromList [FilterF, AggrAndGroupingF]
-- | Determines whether two feature sets collide and therefore whether we should
-- terminate a SQL fragment. Returns 'True' iff the feature sets collide. | 1,863 | terminatingFeaturesPg :: Feature -> FeatureSet
terminatingFeaturesPg bottomF = F $ case bottomF of
ExprProjectF -> S.empty
ColumnProjectF -> S.empty
TableF -> S.empty
FilterF -> S.empty
-- Distinction has to occur before:
--
-- * Projection of columns: Because there exist cases where to much gets
-- removed.
--
-- * Aggregation: Because the previous result set influences the value
-- of aggregate functions, including duplicates.
--
-- * Grouping: Grouping could project away columns, which are needed for
-- duplicate elimination.
--
DupElimF -> S.fromList [ColumnProjectF, ExprProjectF, AggrAndGroupingF]
-- The ORDER BY clause will only be used on top.
SortF -> S.empty
-- Problematic cases:
--
-- * Filtering: May change the intermediate result set.
--
-- * Duplicate removal with DISTINCT has another semantic meaning.
--
-- * Stacked window functions can possibly have other windows and window
-- functions can not be nested.
--
-- * Aggregates of window functions can not be built.
--
WindowFunctionF ->
S.fromList [FilterF, DupElimF, WindowFunctionF, AggrAndGroupingF]
-- Problematic cases:
--
-- * Filtering: May change intermediate result set.
--
-- * Aggregate functions can not be stacked.
--
-- * Is there a case, where OLAP functions using windows with aggregates
-- makes sense? It is possible, and inlining works, therefore it is
-- enabled.
--
AggrAndGroupingF -> S.fromList [FilterF, AggrAndGroupingF]
-- | Determines whether two feature sets collide and therefore whether we should
-- terminate a SQL fragment. Returns 'True' iff the feature sets collide. | 1,863 | terminatingFeaturesPg bottomF = F $ case bottomF of
ExprProjectF -> S.empty
ColumnProjectF -> S.empty
TableF -> S.empty
FilterF -> S.empty
-- Distinction has to occur before:
--
-- * Projection of columns: Because there exist cases where to much gets
-- removed.
--
-- * Aggregation: Because the previous result set influences the value
-- of aggregate functions, including duplicates.
--
-- * Grouping: Grouping could project away columns, which are needed for
-- duplicate elimination.
--
DupElimF -> S.fromList [ColumnProjectF, ExprProjectF, AggrAndGroupingF]
-- The ORDER BY clause will only be used on top.
SortF -> S.empty
-- Problematic cases:
--
-- * Filtering: May change the intermediate result set.
--
-- * Duplicate removal with DISTINCT has another semantic meaning.
--
-- * Stacked window functions can possibly have other windows and window
-- functions can not be nested.
--
-- * Aggregates of window functions can not be built.
--
WindowFunctionF ->
S.fromList [FilterF, DupElimF, WindowFunctionF, AggrAndGroupingF]
-- Problematic cases:
--
-- * Filtering: May change intermediate result set.
--
-- * Aggregate functions can not be stacked.
--
-- * Is there a case, where OLAP functions using windows with aggregates
-- makes sense? It is possible, and inlining works, therefore it is
-- enabled.
--
AggrAndGroupingF -> S.fromList [FilterF, AggrAndGroupingF]
-- | Determines whether two feature sets collide and therefore whether we should
-- terminate a SQL fragment. Returns 'True' iff the feature sets collide. | 1,816 | false | true | 0 | 10 | 529 | 161 | 101 | 60 | null | null |
typelead/epm | Cabal/Distribution/Simple/BuildTarget.hs | bsd-3-clause | nubMatchErrors (InexactMatch d xs) = InexactMatch d xs | 56 | nubMatchErrors (InexactMatch d xs) = InexactMatch d xs | 56 | nubMatchErrors (InexactMatch d xs) = InexactMatch d xs | 56 | false | false | 0 | 7 | 9 | 22 | 10 | 12 | null | null |
olsner/ghc | compiler/nativeGen/RegAlloc/Linear/Main.hs | bsd-3-clause | initBlock :: FR freeRegs
=> BlockId -> BlockMap RegSet -> RegM freeRegs ()
initBlock id block_live
= do dflags <- getDynFlags
let platform = targetPlatform dflags
block_assig <- getBlockAssigR
case mapLookup id block_assig of
-- no prior info about this block: we must consider
-- any fixed regs to be allocated, but we can ignore
-- virtual regs (presumably this is part of a loop,
-- and we'll iterate again). The assignment begins
-- empty.
Nothing
-> do -- pprTrace "initFreeRegs" (text $ show initFreeRegs) (return ())
case mapLookup id block_live of
Nothing ->
setFreeRegsR (frInitFreeRegs platform)
Just live ->
setFreeRegsR $ foldr (frAllocateReg platform) (frInitFreeRegs platform) [ r | RegReal r <- nonDetEltsUFM live ]
-- See Note [Unique Determinism and code generation]
setAssigR emptyRegMap
-- load info about register assignments leading into this block.
Just (freeregs, assig)
-> do setFreeRegsR freeregs
setAssigR assig
-- | Do allocation for a sequence of instructions. | 1,423 | initBlock :: FR freeRegs
=> BlockId -> BlockMap RegSet -> RegM freeRegs ()
initBlock id block_live
= do dflags <- getDynFlags
let platform = targetPlatform dflags
block_assig <- getBlockAssigR
case mapLookup id block_assig of
-- no prior info about this block: we must consider
-- any fixed regs to be allocated, but we can ignore
-- virtual regs (presumably this is part of a loop,
-- and we'll iterate again). The assignment begins
-- empty.
Nothing
-> do -- pprTrace "initFreeRegs" (text $ show initFreeRegs) (return ())
case mapLookup id block_live of
Nothing ->
setFreeRegsR (frInitFreeRegs platform)
Just live ->
setFreeRegsR $ foldr (frAllocateReg platform) (frInitFreeRegs platform) [ r | RegReal r <- nonDetEltsUFM live ]
-- See Note [Unique Determinism and code generation]
setAssigR emptyRegMap
-- load info about register assignments leading into this block.
Just (freeregs, assig)
-> do setFreeRegsR freeregs
setAssigR assig
-- | Do allocation for a sequence of instructions. | 1,423 | initBlock id block_live
= do dflags <- getDynFlags
let platform = targetPlatform dflags
block_assig <- getBlockAssigR
case mapLookup id block_assig of
-- no prior info about this block: we must consider
-- any fixed regs to be allocated, but we can ignore
-- virtual regs (presumably this is part of a loop,
-- and we'll iterate again). The assignment begins
-- empty.
Nothing
-> do -- pprTrace "initFreeRegs" (text $ show initFreeRegs) (return ())
case mapLookup id block_live of
Nothing ->
setFreeRegsR (frInitFreeRegs platform)
Just live ->
setFreeRegsR $ foldr (frAllocateReg platform) (frInitFreeRegs platform) [ r | RegReal r <- nonDetEltsUFM live ]
-- See Note [Unique Determinism and code generation]
setAssigR emptyRegMap
-- load info about register assignments leading into this block.
Just (freeregs, assig)
-> do setFreeRegsR freeregs
setAssigR assig
-- | Do allocation for a sequence of instructions. | 1,338 | false | true | 0 | 20 | 588 | 203 | 96 | 107 | null | null |
remyoudompheng/hs-language-go | Language/Go/Parser/Parser.hs | gpl-3.0 | goVariadicType :: GoParser GoType
goVariadicType = do
goTokEllipsis
t <- goType
return (GoVariadicType t)
-- | Standard @LiteralType@
--
-- See also: SS. 10.3. Composite literals | 185 | goVariadicType :: GoParser GoType
goVariadicType = do
goTokEllipsis
t <- goType
return (GoVariadicType t)
-- | Standard @LiteralType@
--
-- See also: SS. 10.3. Composite literals | 185 | goVariadicType = do
goTokEllipsis
t <- goType
return (GoVariadicType t)
-- | Standard @LiteralType@
--
-- See also: SS. 10.3. Composite literals | 151 | false | true | 0 | 9 | 32 | 39 | 19 | 20 | null | null |
sdiehl/ghc | compiler/basicTypes/Module.hs | bsd-3-clause | installedUnitIdKey :: InstalledUnitId -> Unique
installedUnitIdKey = getUnique . installedUnitIdFS | 98 | installedUnitIdKey :: InstalledUnitId -> Unique
installedUnitIdKey = getUnique . installedUnitIdFS | 98 | installedUnitIdKey = getUnique . installedUnitIdFS | 50 | false | true | 1 | 7 | 9 | 27 | 11 | 16 | null | null |
tjakway/ghcjvm | compiler/prelude/THNames.hs | bsd-3-clause | -- data Stmt = ...
bindSIdKey, letSIdKey, noBindSIdKey, parSIdKey :: Unique
bindSIdKey = mkPreludeMiscIdUnique 320 | 120 | bindSIdKey, letSIdKey, noBindSIdKey, parSIdKey :: Unique
bindSIdKey = mkPreludeMiscIdUnique 320 | 101 | bindSIdKey = mkPreludeMiscIdUnique 320 | 44 | true | true | 2 | 5 | 20 | 25 | 14 | 11 | null | null |
ezyang/ghc | compiler/basicTypes/DataCon.hs | bsd-3-clause | dataConBoxer :: DataCon -> Maybe DataConBoxer
dataConBoxer (MkData { dcRep = DCR { dcr_boxer = boxer } }) = Just boxer | 118 | dataConBoxer :: DataCon -> Maybe DataConBoxer
dataConBoxer (MkData { dcRep = DCR { dcr_boxer = boxer } }) = Just boxer | 118 | dataConBoxer (MkData { dcRep = DCR { dcr_boxer = boxer } }) = Just boxer | 72 | false | true | 0 | 11 | 20 | 49 | 24 | 25 | null | null |
fhaust/rt-ransac | test/Spec.hs | bsd-3-clause | propFitLineWorks (LFP (α,β,ps)) = let (α',β') = fitLine ps in α `epEq` α' && β `epEq` β'
where epEq a b = abs (a - b) < 1e-6 | 128 | propFitLineWorks (LFP (α,β,ps)) = let (α',β') = fitLine ps in α `epEq` α' && β `epEq` β'
where epEq a b = abs (a - b) < 1e-6 | 128 | propFitLineWorks (LFP (α,β,ps)) = let (α',β') = fitLine ps in α `epEq` α' && β `epEq` β'
where epEq a b = abs (a - b) < 1e-6 | 128 | false | false | 0 | 10 | 31 | 87 | 46 | 41 | null | null |
fibsifan/pandoc | src/Text/Pandoc/Writers/ConTeXt.hs | gpl-2.0 | blockToConTeXt (Plain lst) = inlineListToConTeXt lst | 52 | blockToConTeXt (Plain lst) = inlineListToConTeXt lst | 52 | blockToConTeXt (Plain lst) = inlineListToConTeXt lst | 52 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
dnvriend/study-category-theory | haskell/programming_in_haskell/chapter2/chapter2.hs | apache-2.0 | last' :: (Num a, Ord a) => [a] -> a
last' ns = head $ reverse ns | 64 | last' :: (Num a, Ord a) => [a] -> a
last' ns = head $ reverse ns | 64 | last' ns = head $ reverse ns | 28 | false | true | 0 | 8 | 16 | 48 | 23 | 25 | null | null |
mzero/barley | seed/lib/Tutorial.hs | apache-2.0 | tutorialOutlineModule :: Html
tutorialOutlineModule = (h2 << "Tutorial") +++ map section groupedSteps
where
groupedSteps = groupBy (\a b -> stepCh a == stepCh b) steps
section ss@((Step ch _ _):_) = heading +++ list
where
heading = p << ("Chapter " ++ show ch)
list = unordList (map stepLink ss)
stepLink s = anchor ! [href $ stepHref s] << stepShortName s | 396 | tutorialOutlineModule :: Html
tutorialOutlineModule = (h2 << "Tutorial") +++ map section groupedSteps
where
groupedSteps = groupBy (\a b -> stepCh a == stepCh b) steps
section ss@((Step ch _ _):_) = heading +++ list
where
heading = p << ("Chapter " ++ show ch)
list = unordList (map stepLink ss)
stepLink s = anchor ! [href $ stepHref s] << stepShortName s | 396 | tutorialOutlineModule = (h2 << "Tutorial") +++ map section groupedSteps
where
groupedSteps = groupBy (\a b -> stepCh a == stepCh b) steps
section ss@((Step ch _ _):_) = heading +++ list
where
heading = p << ("Chapter " ++ show ch)
list = unordList (map stepLink ss)
stepLink s = anchor ! [href $ stepHref s] << stepShortName s | 366 | false | true | 0 | 10 | 101 | 159 | 80 | 79 | null | null |
DanielSchuessler/hstri | Simplicial/SimplicialComplex.hs | gpl-3.0 | abstractEdge :: SC1 Vertex
abstractEdge = fromEdges [(vA,vB)] | 61 | abstractEdge :: SC1 Vertex
abstractEdge = fromEdges [(vA,vB)] | 61 | abstractEdge = fromEdges [(vA,vB)] | 34 | false | true | 0 | 7 | 7 | 26 | 14 | 12 | null | null |
gxtaillon/spot | src/lib/Language/SPO/Parser/PrimaryParser.hs | gpl-3.0 | forStmt :: PParser Statement
forStmt = do
reserved "for"
(ini, cond, it) <- parens $ do
ini <- newStmt
cond <- exprBoolean
semicolon
it <- exprArithmetic
return $ (ini, cond, it)
stmt <- bracedStatement
return $ StmtFor ini cond it stmt | 292 | forStmt :: PParser Statement
forStmt = do
reserved "for"
(ini, cond, it) <- parens $ do
ini <- newStmt
cond <- exprBoolean
semicolon
it <- exprArithmetic
return $ (ini, cond, it)
stmt <- bracedStatement
return $ StmtFor ini cond it stmt | 292 | forStmt = do
reserved "for"
(ini, cond, it) <- parens $ do
ini <- newStmt
cond <- exprBoolean
semicolon
it <- exprArithmetic
return $ (ini, cond, it)
stmt <- bracedStatement
return $ StmtFor ini cond it stmt | 263 | false | true | 0 | 13 | 96 | 109 | 50 | 59 | null | null |
kallisti-dev/irc-bytestring | src/Network/IRC/ByteString/RFC2812.hs | bsd-3-clause | {- |Tests if a character is valid in a channel string.
@
chanstring = %x01-07 / %x08-09 / %x0B-0C / %x0E-1F / %x21-2B
chanstring =/ %x2D-39 / %x3B-FF
; any octet except NUL, BELL, CR, LF, " ", "," and ":"
@
-}
isChanChar c = RFC1459.isChanChar c && c /= ':' | 301 | isChanChar c = RFC1459.isChanChar c && c /= ':' | 47 | isChanChar c = RFC1459.isChanChar c && c /= ':' | 47 | true | false | 0 | 8 | 95 | 23 | 11 | 12 | null | null |
FranklinChen/musicxml2 | src/Data/Music/MusicXml/Write/Score.hs | bsd-3-clause | riteNoteHead XNoteHead = "x"
| 45 | writeNoteHead XNoteHead = "x" | 45 | writeNoteHead XNoteHead = "x" | 45 | false | false | 0 | 4 | 20 | 10 | 4 | 6 | null | null |
brendanhay/gogol | gogol-securitycenter/gen/Network/Google/SecurityCenter/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'GroupAssetsResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'groReadTime'
--
-- * 'groNextPageToken'
--
-- * 'groTotalSize'
--
-- * 'groGroupByResults'
groupAssetsResponse
:: GroupAssetsResponse
groupAssetsResponse =
GroupAssetsResponse'
{ _groReadTime = Nothing
, _groNextPageToken = Nothing
, _groTotalSize = Nothing
, _groGroupByResults = Nothing
} | 496 | groupAssetsResponse
:: GroupAssetsResponse
groupAssetsResponse =
GroupAssetsResponse'
{ _groReadTime = Nothing
, _groNextPageToken = Nothing
, _groTotalSize = Nothing
, _groGroupByResults = Nothing
} | 225 | groupAssetsResponse =
GroupAssetsResponse'
{ _groReadTime = Nothing
, _groNextPageToken = Nothing
, _groTotalSize = Nothing
, _groGroupByResults = Nothing
} | 178 | true | true | 0 | 6 | 94 | 48 | 34 | 14 | null | null |
thoughtbot/carnival | Network/Mail/SendGrid.hs | mit | sendGridPort :: PortNumber
sendGridPort = 587 | 45 | sendGridPort :: PortNumber
sendGridPort = 587 | 45 | sendGridPort = 587 | 18 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
vialette/ppattern | src/Data/Algorithm/PPattern/Perm/Sub.hs | mit | {-|
Construct all Perm suffixes of a Permutation.
-}
suffixes :: Perm.Perm -> [Perm.Perm]
suffixes = fmap Perm.fromList . List.Tools.suffixes . Perm.getList | 174 | suffixes :: Perm.Perm -> [Perm.Perm]
suffixes = fmap Perm.fromList . List.Tools.suffixes . Perm.getList | 103 | suffixes = fmap Perm.fromList . List.Tools.suffixes . Perm.getList | 66 | true | true | 1 | 9 | 39 | 49 | 23 | 26 | null | null |
paolino/hgen | Applications/SvgSalesman.hs | bsd-2-clause | drawElem (SvgElem name attrs text) = "<" ++ name ++ (drawAttrs attrs) ++ "/>\n" | 79 | drawElem (SvgElem name attrs text) = "<" ++ name ++ (drawAttrs attrs) ++ "/>\n" | 79 | drawElem (SvgElem name attrs text) = "<" ++ name ++ (drawAttrs attrs) ++ "/>\n" | 79 | false | false | 0 | 8 | 13 | 38 | 18 | 20 | null | null |
ShellShoccar-jpn/Open-usp-Tukubai | COMMANDS.HS/join2.hs | mit | rangekey = do n <- many1 digit
char '/'
m <- many1 digit
return $ Keys [(read n::Int)..(read m::Int)] | 143 | rangekey = do n <- many1 digit
char '/'
m <- many1 digit
return $ Keys [(read n::Int)..(read m::Int)] | 143 | rangekey = do n <- many1 digit
char '/'
m <- many1 digit
return $ Keys [(read n::Int)..(read m::Int)] | 143 | false | false | 0 | 11 | 60 | 65 | 30 | 35 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_DRAW_INDIRECT_BUFFER :: GLenum
gl_DRAW_INDIRECT_BUFFER = 0x8F3F | 66 | gl_DRAW_INDIRECT_BUFFER :: GLenum
gl_DRAW_INDIRECT_BUFFER = 0x8F3F | 66 | gl_DRAW_INDIRECT_BUFFER = 0x8F3F | 32 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
aleksj/lamdu | Lamdu/Data/Expression/Load.hs | gpl-3.0 | exprPropertyOfClosure :: MonadA m => ExprPropertyClosure (Tag m) -> ExprIRef.ExpressionProperty m
exprPropertyOfClosure (DefinitionTypeProperty defI (Definition.Body bodyContent bodyType)) =
Property bodyType (Transaction.writeIRef defI . Definition.Body bodyContent) | 269 | exprPropertyOfClosure :: MonadA m => ExprPropertyClosure (Tag m) -> ExprIRef.ExpressionProperty m
exprPropertyOfClosure (DefinitionTypeProperty defI (Definition.Body bodyContent bodyType)) =
Property bodyType (Transaction.writeIRef defI . Definition.Body bodyContent) | 269 | exprPropertyOfClosure (DefinitionTypeProperty defI (Definition.Body bodyContent bodyType)) =
Property bodyType (Transaction.writeIRef defI . Definition.Body bodyContent) | 171 | false | true | 0 | 13 | 26 | 85 | 38 | 47 | null | null |
egison/egison | hs-src/Language/Egison/Data/Utils.hs | mit | tupleToList :: EgisonValue -> [EgisonValue]
tupleToList (Tuple vals) = vals | 75 | tupleToList :: EgisonValue -> [EgisonValue]
tupleToList (Tuple vals) = vals | 75 | tupleToList (Tuple vals) = vals | 31 | false | true | 0 | 6 | 9 | 31 | 15 | 16 | null | null |
kmels/hledger | hledger-lib/Hledger/Data/Ledger.hs | gpl-3.0 | tests_ledgerFromJournal = [
"ledgerFromJournal" ~: do
assertEqual "" (0) (length $ ledgerPostings $ ledgerFromJournal Any nulljournal)
assertEqual "" (11) (length $ ledgerPostings $ ledgerFromJournal Any samplejournal)
assertEqual "" (6) (length $ ledgerPostings $ ledgerFromJournal (Depth 2) samplejournal)
] | 317 | tests_ledgerFromJournal = [
"ledgerFromJournal" ~: do
assertEqual "" (0) (length $ ledgerPostings $ ledgerFromJournal Any nulljournal)
assertEqual "" (11) (length $ ledgerPostings $ ledgerFromJournal Any samplejournal)
assertEqual "" (6) (length $ ledgerPostings $ ledgerFromJournal (Depth 2) samplejournal)
] | 317 | tests_ledgerFromJournal = [
"ledgerFromJournal" ~: do
assertEqual "" (0) (length $ ledgerPostings $ ledgerFromJournal Any nulljournal)
assertEqual "" (11) (length $ ledgerPostings $ ledgerFromJournal Any samplejournal)
assertEqual "" (6) (length $ ledgerPostings $ ledgerFromJournal (Depth 2) samplejournal)
] | 317 | false | false | 0 | 14 | 45 | 106 | 52 | 54 | null | null |
brendanhay/gogol | gogol-logging/gen/Network/Google/Resource/Logging/Organizations/Locations/Operations/List.hs | mpl-2.0 | -- | JSONP
ololCallback :: Lens' OrganizationsLocationsOperationsList (Maybe Text)
ololCallback
= lens _ololCallback (\ s a -> s{_ololCallback = a}) | 150 | ololCallback :: Lens' OrganizationsLocationsOperationsList (Maybe Text)
ololCallback
= lens _ololCallback (\ s a -> s{_ololCallback = a}) | 139 | ololCallback
= lens _ololCallback (\ s a -> s{_ololCallback = a}) | 67 | true | true | 0 | 9 | 21 | 48 | 25 | 23 | null | null |
jystic/hsimport | tests/Main.hs | bsd-3-clause | prettyPrint :: HS.ImportDecl -> String
prettyPrint HS.ImportDecl { HS.importModule = HS.ModuleName modName, HS.importSpecs = Just (False, syms) } =
"import " ++ modName ++ " ( " ++ ppSyms ++ " )"
where
ppSyms = intercalate " , " symNames
symNames = map symName syms
symName (HS.IVar HS.NoNamespace (HS.Ident name)) = name
symName _ = "" | 367 | prettyPrint :: HS.ImportDecl -> String
prettyPrint HS.ImportDecl { HS.importModule = HS.ModuleName modName, HS.importSpecs = Just (False, syms) } =
"import " ++ modName ++ " ( " ++ ppSyms ++ " )"
where
ppSyms = intercalate " , " symNames
symNames = map symName syms
symName (HS.IVar HS.NoNamespace (HS.Ident name)) = name
symName _ = "" | 367 | prettyPrint HS.ImportDecl { HS.importModule = HS.ModuleName modName, HS.importSpecs = Just (False, syms) } =
"import " ++ modName ++ " ( " ++ ppSyms ++ " )"
where
ppSyms = intercalate " , " symNames
symNames = map symName syms
symName (HS.IVar HS.NoNamespace (HS.Ident name)) = name
symName _ = "" | 328 | false | true | 3 | 10 | 86 | 139 | 67 | 72 | null | null |
notogawa/VideoCore4 | src/VideoCore4/QPU/Instruction/Register.hs | bsd-3-clause | ra17 :: Register
ra17 = Register 17 [AR,AW] | 43 | ra17 :: Register
ra17 = Register 17 [AR,AW] | 43 | ra17 = Register 17 [AR,AW] | 26 | false | true | 0 | 6 | 7 | 22 | 12 | 10 | null | null |
dan-t/hsimport | lib/HsImport/ImportChange.hs | bsd-3-clause | nameString :: Name -> String
nameString (HS.Ident _ id) = id | 62 | nameString :: Name -> String
nameString (HS.Ident _ id) = id | 62 | nameString (HS.Ident _ id) = id | 33 | false | true | 0 | 8 | 12 | 28 | 14 | 14 | null | null |
abstools/abs-haskell-formal | src/Sched.hs | bsd-3-clause | -- | The main entrypoint. Should be written in Haskell as:
--
-- > main = run' maxIterations mainABSmethod attributeArraySize
--
-- Function just initializes the configuration (the heap and scheduler-queue) and starts the global scheduler.
run' :: Int -> Method -> Int -> IO ()
run' maxIters mainMethod attrArrSize = void $ run maxIters mainMethod attrArrSize | 360 | run' :: Int -> Method -> Int -> IO ()
run' maxIters mainMethod attrArrSize = void $ run maxIters mainMethod attrArrSize | 119 | run' maxIters mainMethod attrArrSize = void $ run maxIters mainMethod attrArrSize | 81 | true | true | 0 | 9 | 57 | 55 | 28 | 27 | null | null |
rvion/ride | jetpack/src/Data/Vector/AsVec.hs | bsd-3-clause | -- vec_zipWithM :: forall a b (m :: * -> *) c. Monad m => (a -> b -> m c) -> Vector a -> Vector b -> m (Vector c)
vec_zipWithM = I.zipWithM | 139 | vec_zipWithM = I.zipWithM | 25 | vec_zipWithM = I.zipWithM | 25 | true | false | 0 | 5 | 33 | 9 | 5 | 4 | null | null |
literate-unitb/literate-unitb | src/Document/Scope.hs | mit | redundant :: Iso (Redundant expr a) (Redundant expr b) a b
redundant = iso getRedundant Redundant | 97 | redundant :: Iso (Redundant expr a) (Redundant expr b) a b
redundant = iso getRedundant Redundant | 97 | redundant = iso getRedundant Redundant | 38 | false | true | 0 | 7 | 15 | 41 | 20 | 21 | null | null |
green-haskell/ghc | compiler/hsSyn/HsBinds.hs | bsd-3-clause | ppr_sig (PatSynSig name (flag, qtvs) (L _ prov) (L _ req) ty)
= pprPatSynSig (unLoc name) False -- TODO: is_bindir
(pprHsForAll flag qtvs (noLoc []))
(pprHsContextMaybe prov) (pprHsContextMaybe req)
(ppr ty) | 260 | ppr_sig (PatSynSig name (flag, qtvs) (L _ prov) (L _ req) ty)
= pprPatSynSig (unLoc name) False -- TODO: is_bindir
(pprHsForAll flag qtvs (noLoc []))
(pprHsContextMaybe prov) (pprHsContextMaybe req)
(ppr ty) | 260 | ppr_sig (PatSynSig name (flag, qtvs) (L _ prov) (L _ req) ty)
= pprPatSynSig (unLoc name) False -- TODO: is_bindir
(pprHsForAll flag qtvs (noLoc []))
(pprHsContextMaybe prov) (pprHsContextMaybe req)
(ppr ty) | 260 | false | false | 0 | 10 | 83 | 101 | 51 | 50 | null | null |
tidalcycles/Tidal | bin/params-header.hs | gpl-3.0 | drumN "le" = 66 | 15 | drumN "le" = 66 | 15 | drumN "le" = 66 | 15 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
IreneKnapp/Faction | libfaction/Distribution/Version.hs | bsd-3-clause | -- | Fold over the basic syntactic structure of a 'VersionRange'.
--
-- This provides a syntacic view of the expression defining the version range.
-- The syntactic sugar @\">= v\"@, @\"<= v\"@ and @\"== v.*\"@ is presented
-- in terms of the other basic syntax.
--
-- For a semantic view use 'asVersionIntervals'.
--
foldVersionRange :: a -- ^ @\"-any\"@ version
-> (Version -> a) -- ^ @\"== v\"@
-> (Version -> a) -- ^ @\"> v\"@
-> (Version -> a) -- ^ @\"< v\"@
-> (a -> a -> a) -- ^ @\"_ || _\"@ union
-> (a -> a -> a) -- ^ @\"_ && _\"@ intersection
-> VersionRange -> a
foldVersionRange anyv this later earlier union intersect = fold
where
fold AnyVersion = anyv
fold (ThisVersion v) = this v
fold (LaterVersion v) = later v
fold (EarlierVersion v) = earlier v
fold (WildcardVersion v) = fold (wildcard v)
fold (UnionVersionRanges v1 v2) = union (fold v1) (fold v2)
fold (IntersectVersionRanges v1 v2) = intersect (fold v1) (fold v2)
fold (VersionRangeParens v) = fold v
wildcard v = intersectVersionRanges
(orLaterVersion v)
(earlierVersion (wildcardUpperBound v))
-- | An extended variant of 'foldVersionRange' that also provides a view of
-- in which the syntactic sugar @\">= v\"@, @\"<= v\"@ and @\"== v.*\"@ is presented
-- explicitly rather than in terms of the other basic syntax.
-- | 1,640 | foldVersionRange :: a -- ^ @\"-any\"@ version
-> (Version -> a) -- ^ @\"== v\"@
-> (Version -> a) -- ^ @\"> v\"@
-> (Version -> a) -- ^ @\"< v\"@
-> (a -> a -> a) -- ^ @\"_ || _\"@ union
-> (a -> a -> a) -- ^ @\"_ && _\"@ intersection
-> VersionRange -> a
foldVersionRange anyv this later earlier union intersect = fold
where
fold AnyVersion = anyv
fold (ThisVersion v) = this v
fold (LaterVersion v) = later v
fold (EarlierVersion v) = earlier v
fold (WildcardVersion v) = fold (wildcard v)
fold (UnionVersionRanges v1 v2) = union (fold v1) (fold v2)
fold (IntersectVersionRanges v1 v2) = intersect (fold v1) (fold v2)
fold (VersionRangeParens v) = fold v
wildcard v = intersectVersionRanges
(orLaterVersion v)
(earlierVersion (wildcardUpperBound v))
-- | An extended variant of 'foldVersionRange' that also provides a view of
-- in which the syntactic sugar @\">= v\"@, @\"<= v\"@ and @\"== v.*\"@ is presented
-- explicitly rather than in terms of the other basic syntax.
-- | 1,322 | foldVersionRange anyv this later earlier union intersect = fold
where
fold AnyVersion = anyv
fold (ThisVersion v) = this v
fold (LaterVersion v) = later v
fold (EarlierVersion v) = earlier v
fold (WildcardVersion v) = fold (wildcard v)
fold (UnionVersionRanges v1 v2) = union (fold v1) (fold v2)
fold (IntersectVersionRanges v1 v2) = intersect (fold v1) (fold v2)
fold (VersionRangeParens v) = fold v
wildcard v = intersectVersionRanges
(orLaterVersion v)
(earlierVersion (wildcardUpperBound v))
-- | An extended variant of 'foldVersionRange' that also provides a view of
-- in which the syntactic sugar @\">= v\"@, @\"<= v\"@ and @\"== v.*\"@ is presented
-- explicitly rather than in terms of the other basic syntax.
-- | 883 | true | true | 0 | 13 | 572 | 312 | 163 | 149 | null | null |
yogsototh/lish | src/Lish/Core.hs | isc | evalReduced (WaitingStream Nothing) = return () | 47 | evalReduced (WaitingStream Nothing) = return () | 47 | evalReduced (WaitingStream Nothing) = return () | 47 | false | false | 0 | 6 | 5 | 21 | 9 | 12 | null | null |
kawu/feature-structure | examples/test-cmp.hs | bsd-2-clause | test1 :: AVM
test1 = do
"A" ## do
"B" ## "?b"
"C" ## "cv"
"D" ## "?b" | 93 | test1 :: AVM
test1 = do
"A" ## do
"B" ## "?b"
"C" ## "cv"
"D" ## "?b" | 93 | test1 = do
"A" ## do
"B" ## "?b"
"C" ## "cv"
"D" ## "?b" | 80 | false | true | 0 | 10 | 41 | 39 | 18 | 21 | null | null |
brendanhay/gogol | gogol-storage/gen/Network/Google/Storage/Types/Product.hs | mpl-2.0 | -- | The bucket\'s website configuration, controlling how the service behaves
-- when accessing bucket contents as a web site. See the Static Website
-- Examples for more information.
bucWebsite :: Lens' Bucket (Maybe BucketWebsite)
bucWebsite
= lens _bucWebsite (\ s a -> s{_bucWebsite = a}) | 294 | bucWebsite :: Lens' Bucket (Maybe BucketWebsite)
bucWebsite
= lens _bucWebsite (\ s a -> s{_bucWebsite = a}) | 110 | bucWebsite
= lens _bucWebsite (\ s a -> s{_bucWebsite = a}) | 61 | true | true | 0 | 9 | 47 | 50 | 27 | 23 | null | null |
forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/generics/GFunctor/Main.hs | bsd-3-clause | d2 :: (Fractional a) => D (a,a)
d2 = D1 (3,0.14) D0 | 51 | d2 :: (Fractional a) => D (a,a)
d2 = D1 (3,0.14) D0 | 51 | d2 = D1 (3,0.14) D0 | 19 | false | true | 0 | 8 | 11 | 45 | 23 | 22 | null | null |
ZjMNZHgG5jMXw/smallcaps | src/smallcaps/Text/SmallCaps/PrintableParser.hs | bsd-3-clause | inc :: Parser ()
inc = modifyState (\state -> state { stop = inc' (stop state) }) where
inc' None = NewLine
inc' _ = NewSentence | 135 | inc :: Parser ()
inc = modifyState (\state -> state { stop = inc' (stop state) }) where
inc' None = NewLine
inc' _ = NewSentence | 135 | inc = modifyState (\state -> state { stop = inc' (stop state) }) where
inc' None = NewLine
inc' _ = NewSentence | 118 | false | true | 0 | 12 | 32 | 61 | 32 | 29 | null | null |
intolerable/obj-reader | src/Graphics/OBJ/Parser.hs | bsd-3-clause | parseMTLFile :: Parser (Maybe FilePath)
parseMTLFile = choice
[ Just <$> Text.unpack <$> (ss "map_Kd" *> ss (takeTill isEndOfLine))
, takeTill isEndOfLine *> endOfLine *> pure Nothing ] | 189 | parseMTLFile :: Parser (Maybe FilePath)
parseMTLFile = choice
[ Just <$> Text.unpack <$> (ss "map_Kd" *> ss (takeTill isEndOfLine))
, takeTill isEndOfLine *> endOfLine *> pure Nothing ] | 189 | parseMTLFile = choice
[ Just <$> Text.unpack <$> (ss "map_Kd" *> ss (takeTill isEndOfLine))
, takeTill isEndOfLine *> endOfLine *> pure Nothing ] | 149 | false | true | 0 | 11 | 31 | 72 | 35 | 37 | null | null |
jhegedus42/svg-tree | src/Graphics/Svg/CssParser.hs | bsd-3-clause | cssRulesOfText :: T.Text -> [CssRule]
cssRulesOfText txt = case parseOnly (many1 ruleSet) $ txt of
Left _ -> []
Right rules -> rules | 140 | cssRulesOfText :: T.Text -> [CssRule]
cssRulesOfText txt = case parseOnly (many1 ruleSet) $ txt of
Left _ -> []
Right rules -> rules | 140 | cssRulesOfText txt = case parseOnly (many1 ruleSet) $ txt of
Left _ -> []
Right rules -> rules | 102 | false | true | 3 | 9 | 30 | 59 | 29 | 30 | null | null |
bitemyapp/ghc | compiler/typecheck/TcClassDcl.hs | bsd-3-clause | tcClassDecl2 :: LTyClDecl Name -- The class declaration
-> TcM (LHsBinds Id)
tcClassDecl2 (L loc (ClassDecl {tcdLName = class_name, tcdSigs = sigs,
tcdMeths = default_binds}))
= recoverM (return emptyLHsBinds) $
setSrcSpan loc $
do { clas <- tcLookupLocatedClass class_name
-- We make a separate binding for each default method.
-- At one time I used a single AbsBinds for all of them, thus
-- AbsBind [d] [dm1, dm2, dm3] { dm1 = ...; dm2 = ...; dm3 = ... }
-- But that desugars into
-- ds = \d -> (..., ..., ...)
-- dm1 = \d -> case ds d of (a,b,c) -> a
-- And since ds is big, it doesn't get inlined, so we don't get good
-- default methods. Better to make separate AbsBinds for each
; let
(tyvars, _, _, op_items) = classBigSig clas
prag_fn = mkPragFun sigs default_binds
sig_fn = mkHsSigFun sigs
clas_tyvars = snd (tcSuperSkolTyVars tyvars)
pred = mkClassPred clas (mkTyVarTys clas_tyvars)
; this_dict <- newEvVar pred
; traceTc "TIM2" (ppr sigs)
; let tc_dm = tcDefMeth clas clas_tyvars
this_dict default_binds
sig_fn prag_fn
; dm_binds <- tcExtendTyVarEnv clas_tyvars $
mapM tc_dm op_items
; return (unionManyBags dm_binds) } | 1,521 | tcClassDecl2 :: LTyClDecl Name -- The class declaration
-> TcM (LHsBinds Id)
tcClassDecl2 (L loc (ClassDecl {tcdLName = class_name, tcdSigs = sigs,
tcdMeths = default_binds}))
= recoverM (return emptyLHsBinds) $
setSrcSpan loc $
do { clas <- tcLookupLocatedClass class_name
-- We make a separate binding for each default method.
-- At one time I used a single AbsBinds for all of them, thus
-- AbsBind [d] [dm1, dm2, dm3] { dm1 = ...; dm2 = ...; dm3 = ... }
-- But that desugars into
-- ds = \d -> (..., ..., ...)
-- dm1 = \d -> case ds d of (a,b,c) -> a
-- And since ds is big, it doesn't get inlined, so we don't get good
-- default methods. Better to make separate AbsBinds for each
; let
(tyvars, _, _, op_items) = classBigSig clas
prag_fn = mkPragFun sigs default_binds
sig_fn = mkHsSigFun sigs
clas_tyvars = snd (tcSuperSkolTyVars tyvars)
pred = mkClassPred clas (mkTyVarTys clas_tyvars)
; this_dict <- newEvVar pred
; traceTc "TIM2" (ppr sigs)
; let tc_dm = tcDefMeth clas clas_tyvars
this_dict default_binds
sig_fn prag_fn
; dm_binds <- tcExtendTyVarEnv clas_tyvars $
mapM tc_dm op_items
; return (unionManyBags dm_binds) } | 1,520 | tcClassDecl2 (L loc (ClassDecl {tcdLName = class_name, tcdSigs = sigs,
tcdMeths = default_binds}))
= recoverM (return emptyLHsBinds) $
setSrcSpan loc $
do { clas <- tcLookupLocatedClass class_name
-- We make a separate binding for each default method.
-- At one time I used a single AbsBinds for all of them, thus
-- AbsBind [d] [dm1, dm2, dm3] { dm1 = ...; dm2 = ...; dm3 = ... }
-- But that desugars into
-- ds = \d -> (..., ..., ...)
-- dm1 = \d -> case ds d of (a,b,c) -> a
-- And since ds is big, it doesn't get inlined, so we don't get good
-- default methods. Better to make separate AbsBinds for each
; let
(tyvars, _, _, op_items) = classBigSig clas
prag_fn = mkPragFun sigs default_binds
sig_fn = mkHsSigFun sigs
clas_tyvars = snd (tcSuperSkolTyVars tyvars)
pred = mkClassPred clas (mkTyVarTys clas_tyvars)
; this_dict <- newEvVar pred
; traceTc "TIM2" (ppr sigs)
; let tc_dm = tcDefMeth clas clas_tyvars
this_dict default_binds
sig_fn prag_fn
; dm_binds <- tcExtendTyVarEnv clas_tyvars $
mapM tc_dm op_items
; return (unionManyBags dm_binds) } | 1,421 | false | true | 0 | 13 | 583 | 259 | 133 | 126 | null | null |
MarcoSero/Norvigs-Spelling-Corrector | src/Spelling.hs | mit | edits2 :: B.ByteString -> WordSet
edits2 = S.unions . S.toList . S.map edits1 . edits1 | 86 | edits2 :: B.ByteString -> WordSet
edits2 = S.unions . S.toList . S.map edits1 . edits1 | 86 | edits2 = S.unions . S.toList . S.map edits1 . edits1 | 52 | false | true | 1 | 8 | 14 | 46 | 20 | 26 | null | null |
NickAger/LearningHaskell | Programming in Haskell - Graham Hutton/Chapter11 - unbeatable tic-tac-toe.hsproj/Main.hs | mit | showPlayer B = [" ", " ", " "] | 36 | showPlayer B = [" ", " ", " "] | 36 | showPlayer B = [" ", " ", " "] | 36 | false | false | 0 | 5 | 14 | 18 | 10 | 8 | null | null |
srhb/quickcheck | Test/QuickCheck/Text.hs | bsd-3-clause | withBuffering :: IO a -> IO a
withBuffering action = do
mode <- hGetBuffering stderr
-- By default stderr is unbuffered. This is very slow, hence we explicitly
-- enable line buffering.
hSetBuffering stderr LineBuffering
action `finally` hSetBuffering stderr mode | 274 | withBuffering :: IO a -> IO a
withBuffering action = do
mode <- hGetBuffering stderr
-- By default stderr is unbuffered. This is very slow, hence we explicitly
-- enable line buffering.
hSetBuffering stderr LineBuffering
action `finally` hSetBuffering stderr mode | 274 | withBuffering action = do
mode <- hGetBuffering stderr
-- By default stderr is unbuffered. This is very slow, hence we explicitly
-- enable line buffering.
hSetBuffering stderr LineBuffering
action `finally` hSetBuffering stderr mode | 244 | false | true | 0 | 9 | 50 | 62 | 28 | 34 | null | null |
nastya13/lambda | src/Main.hs | gpl-3.0 | --Interp. This data represent data for simple alghoritm of interpreter lambda-calculus
--De Bruijn indices
----------------------------------------------
--Interp. get count of Lam from Expr
num_for_free :: Expr -> Int
num_for_free (App ex1 ex2) = num_for_free (ex1) + num_for_free (ex2) | 289 | num_for_free :: Expr -> Int
num_for_free (App ex1 ex2) = num_for_free (ex1) + num_for_free (ex2) | 96 | num_for_free (App ex1 ex2) = num_for_free (ex1) + num_for_free (ex2) | 68 | true | true | 0 | 7 | 38 | 46 | 25 | 21 | null | null |
ozgurakgun/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | showCG (MN _ u) | u == txt "underscore" = "_" | 45 | showCG (MN _ u) | u == txt "underscore" = "_" | 45 | showCG (MN _ u) | u == txt "underscore" = "_" | 45 | false | false | 0 | 9 | 10 | 31 | 13 | 18 | null | null |
DougBurke/swish | src/Swish/RDF/ProofContext.hs | lgpl-2.1 | rdfsr10 :: RDFRule
rdfsr10 = makeN3ClosureSimpleRule scopeRDFS "r10"
"?x rdf:type rdfs:Class ."
"?x rdfs:subClassOf ?x ." | 145 | rdfsr10 :: RDFRule
rdfsr10 = makeN3ClosureSimpleRule scopeRDFS "r10"
"?x rdf:type rdfs:Class ."
"?x rdfs:subClassOf ?x ." | 145 | rdfsr10 = makeN3ClosureSimpleRule scopeRDFS "r10"
"?x rdf:type rdfs:Class ."
"?x rdfs:subClassOf ?x ." | 126 | false | true | 0 | 5 | 39 | 20 | 10 | 10 | null | null |
szabba/tetris4d | Logic.hs | gpl-3.0 | -- Translation {{{1
add :: Point -> Point -> Point
p1 `add` p2 = zipWith (+) p1 p2 | 83 | add :: Point -> Point -> Point
p1 `add` p2 = zipWith (+) p1 p2 | 62 | p1 `add` p2 = zipWith (+) p1 p2 | 31 | true | true | 0 | 6 | 18 | 43 | 22 | 21 | null | null |
AlexeyRaga/eta | compiler/ETA/Main/DynFlags.hs | bsd-3-clause | parsePackageFlag :: String -- the flag
-> ReadP PackageArg -- type of argument
-> String -- string to parse
-> PackageFlag
parsePackageFlag flag arg_parse str
= case filter ((=="").snd) (readP_to_S parse str) of
[(r, "")] -> r
_ -> throwGhcException $ CmdLineError ("Can't parse package flag: " ++ str)
where doc = flag ++ " " ++ str
parse = do
pkg_arg <- tok arg_parse
let mk_expose = ExposePackage doc pkg_arg
( do _ <- tok $ string "with"
fmap (mk_expose . ModRenaming True) parseRns
<++ fmap (mk_expose . ModRenaming False) parseRns
<++ return (mk_expose (ModRenaming True [])))
parseRns = do _ <- tok $ R.char '('
rns <- tok $ sepBy parseItem (tok $ R.char ',')
_ <- tok $ R.char ')'
return rns
parseItem = do
orig <- tok $ parseModuleName
(do _ <- tok $ string "as"
new <- tok $ parseModuleName
return (orig, new)
+++
return (orig, orig))
tok m = m >>= \x -> skipSpaces >> return x | 1,247 | parsePackageFlag :: String -- the flag
-> ReadP PackageArg -- type of argument
-> String -- string to parse
-> PackageFlag
parsePackageFlag flag arg_parse str
= case filter ((=="").snd) (readP_to_S parse str) of
[(r, "")] -> r
_ -> throwGhcException $ CmdLineError ("Can't parse package flag: " ++ str)
where doc = flag ++ " " ++ str
parse = do
pkg_arg <- tok arg_parse
let mk_expose = ExposePackage doc pkg_arg
( do _ <- tok $ string "with"
fmap (mk_expose . ModRenaming True) parseRns
<++ fmap (mk_expose . ModRenaming False) parseRns
<++ return (mk_expose (ModRenaming True [])))
parseRns = do _ <- tok $ R.char '('
rns <- tok $ sepBy parseItem (tok $ R.char ',')
_ <- tok $ R.char ')'
return rns
parseItem = do
orig <- tok $ parseModuleName
(do _ <- tok $ string "as"
new <- tok $ parseModuleName
return (orig, new)
+++
return (orig, orig))
tok m = m >>= \x -> skipSpaces >> return x | 1,247 | parsePackageFlag flag arg_parse str
= case filter ((=="").snd) (readP_to_S parse str) of
[(r, "")] -> r
_ -> throwGhcException $ CmdLineError ("Can't parse package flag: " ++ str)
where doc = flag ++ " " ++ str
parse = do
pkg_arg <- tok arg_parse
let mk_expose = ExposePackage doc pkg_arg
( do _ <- tok $ string "with"
fmap (mk_expose . ModRenaming True) parseRns
<++ fmap (mk_expose . ModRenaming False) parseRns
<++ return (mk_expose (ModRenaming True [])))
parseRns = do _ <- tok $ R.char '('
rns <- tok $ sepBy parseItem (tok $ R.char ',')
_ <- tok $ R.char ')'
return rns
parseItem = do
orig <- tok $ parseModuleName
(do _ <- tok $ string "as"
new <- tok $ parseModuleName
return (orig, new)
+++
return (orig, orig))
tok m = m >>= \x -> skipSpaces >> return x | 1,035 | false | true | 9 | 15 | 522 | 412 | 191 | 221 | null | null |
vdweegen/UvA-Software_Testing | Lab6/Bauke/Lecture6.hs | gpl-3.0 | primeTestsF :: Int -> Integer -> IO Bool
primeTestsF k n = do
as <- sequence $ fmap (\_-> randomRIO (2,n-1)) [1..k]
return (all (\ a -> exM a (n-1) n == 1) as) | 161 | primeTestsF :: Int -> Integer -> IO Bool
primeTestsF k n = do
as <- sequence $ fmap (\_-> randomRIO (2,n-1)) [1..k]
return (all (\ a -> exM a (n-1) n == 1) as) | 161 | primeTestsF k n = do
as <- sequence $ fmap (\_-> randomRIO (2,n-1)) [1..k]
return (all (\ a -> exM a (n-1) n == 1) as) | 120 | false | true | 0 | 16 | 35 | 114 | 56 | 58 | null | null |
sinelaw/lamdu | bottlelib/Graphics/UI/Bottle/Widgets/Grid.hs | gpl-3.0 | capCursor :: Vector2 Int -> Vector2 Int -> Vector2 Int
capCursor size = fmap (max 0) . liftA2 min (subtract 1 <$> size) | 119 | capCursor :: Vector2 Int -> Vector2 Int -> Vector2 Int
capCursor size = fmap (max 0) . liftA2 min (subtract 1 <$> size) | 119 | capCursor size = fmap (max 0) . liftA2 min (subtract 1 <$> size) | 64 | false | true | 0 | 9 | 22 | 62 | 28 | 34 | null | null |
matterhorn-chat/matterhorn | src/Matterhorn/TimeUtils.hs | bsd-3-clause | -- | Sometimes it is convenient to render a divider between messages;
-- the 'justAfter' function can be used to get a time that is after
-- the input time but by such a small increment that there is unlikely
-- to be anything between (or at) the result. Adding the divider
-- using this timestamp value allows the general sorting based on
-- timestamps to operate normally (whereas a type-match for a
-- non-timestamp-entry in the sort operation would be considerably
-- more complex).
justAfter :: ServerTime -> ServerTime
justAfter = ServerTime . justAfterUTC . withServerTime
where justAfterUTC time = let UTCTime d t = time in UTCTime d (succ t)
-- | Obtain a time value that is just moments before the input time;
-- see the comment for the 'justAfter' function for more details. | 791 | justAfter :: ServerTime -> ServerTime
justAfter = ServerTime . justAfterUTC . withServerTime
where justAfterUTC time = let UTCTime d t = time in UTCTime d (succ t)
-- | Obtain a time value that is just moments before the input time;
-- see the comment for the 'justAfter' function for more details. | 303 | justAfter = ServerTime . justAfterUTC . withServerTime
where justAfterUTC time = let UTCTime d t = time in UTCTime d (succ t)
-- | Obtain a time value that is just moments before the input time;
-- see the comment for the 'justAfter' function for more details. | 265 | true | true | 0 | 11 | 142 | 71 | 39 | 32 | null | null |
zhengqm/scheme | app/Main.hs | bsd-3-clause | evalAndPrint :: Env -> String -> IO ()
evalAndPrint env expr = evalString env expr >>= putStrLn | 95 | evalAndPrint :: Env -> String -> IO ()
evalAndPrint env expr = evalString env expr >>= putStrLn | 95 | evalAndPrint env expr = evalString env expr >>= putStrLn | 56 | false | true | 0 | 8 | 16 | 38 | 18 | 20 | null | null |
taktoa/TSBannerGen | src/Sinks/PNG.hs | gpl-3.0 | pstoss (PNGSettings _ t f s i tf) = SVGSettings t f s i tf | 58 | pstoss (PNGSettings _ t f s i tf) = SVGSettings t f s i tf | 58 | pstoss (PNGSettings _ t f s i tf) = SVGSettings t f s i tf | 58 | false | false | 0 | 7 | 14 | 36 | 17 | 19 | null | null |
phaazon/haskell-hidapi | Test.hs | mit | main = withHIDAPI $ do
( di : dis ) <- enumerateAll
d <- openDeviceInfo di
forever $ do
bs <- HID.read d 6
putStr (show (fromIntegral (BS.index bs 1) :: Int8))
putChar ' '
print (fromIntegral (BS.index bs 2) :: Int8) | 238 | main = withHIDAPI $ do
( di : dis ) <- enumerateAll
d <- openDeviceInfo di
forever $ do
bs <- HID.read d 6
putStr (show (fromIntegral (BS.index bs 1) :: Int8))
putChar ' '
print (fromIntegral (BS.index bs 2) :: Int8) | 238 | main = withHIDAPI $ do
( di : dis ) <- enumerateAll
d <- openDeviceInfo di
forever $ do
bs <- HID.read d 6
putStr (show (fromIntegral (BS.index bs 1) :: Int8))
putChar ' '
print (fromIntegral (BS.index bs 2) :: Int8) | 238 | false | false | 0 | 18 | 63 | 117 | 54 | 63 | null | null |
ulricha/dsh | src/Database/DSH/FKL/Primitives.hs | bsd-3-clause | groupJoin :: JoinPredicate ScalarExpr -> NE AggrApp -> LExpr -> LExpr -> Nat -> LExpr
groupJoin p (NE as) xs ys d =
let ListT xt = unliftTypeN d $ typeOf xs
rt = ListT (TupleT $ xt : toList (fmap aggType as))
in PApp2 (liftTypeN d rt) (GroupJoin p (NE as)) (LiftedN d) xs ys | 296 | groupJoin :: JoinPredicate ScalarExpr -> NE AggrApp -> LExpr -> LExpr -> Nat -> LExpr
groupJoin p (NE as) xs ys d =
let ListT xt = unliftTypeN d $ typeOf xs
rt = ListT (TupleT $ xt : toList (fmap aggType as))
in PApp2 (liftTypeN d rt) (GroupJoin p (NE as)) (LiftedN d) xs ys | 296 | groupJoin p (NE as) xs ys d =
let ListT xt = unliftTypeN d $ typeOf xs
rt = ListT (TupleT $ xt : toList (fmap aggType as))
in PApp2 (liftTypeN d rt) (GroupJoin p (NE as)) (LiftedN d) xs ys | 210 | false | true | 0 | 14 | 77 | 148 | 70 | 78 | null | null |
merijn/lambda-except | PrettyPrint.hs | bsd-3-clause | prettyLoc :: Loc -> Doc
prettyLoc (Loc (Span start end _)) =
pretty start <+> text "-" <+> bold (pretty lineCount) <> text ":"
<> bold (pretty columnCount)
where
lineCount, columnCount :: Int
(lineCount, columnCount) = both %~ ((+1).fromIntegral) $ case end of
Columns c _ -> (0, c)
Tab x y _ -> (0, nextTab x + y)
Lines l c _ _ -> (l, c)
Directed _ l c _ _-> (l, c) | 416 | prettyLoc :: Loc -> Doc
prettyLoc (Loc (Span start end _)) =
pretty start <+> text "-" <+> bold (pretty lineCount) <> text ":"
<> bold (pretty columnCount)
where
lineCount, columnCount :: Int
(lineCount, columnCount) = both %~ ((+1).fromIntegral) $ case end of
Columns c _ -> (0, c)
Tab x y _ -> (0, nextTab x + y)
Lines l c _ _ -> (l, c)
Directed _ l c _ _-> (l, c) | 416 | prettyLoc (Loc (Span start end _)) =
pretty start <+> text "-" <+> bold (pretty lineCount) <> text ":"
<> bold (pretty columnCount)
where
lineCount, columnCount :: Int
(lineCount, columnCount) = both %~ ((+1).fromIntegral) $ case end of
Columns c _ -> (0, c)
Tab x y _ -> (0, nextTab x + y)
Lines l c _ _ -> (l, c)
Directed _ l c _ _-> (l, c) | 392 | false | true | 6 | 11 | 124 | 219 | 107 | 112 | null | null |
bitonic/kyotocabinet | Database/KyotoCabinet/Internal.hs | bsd-3-clause | newDB :: Ptr KCDB -> IO DB
newDB kcdb = fmap DB (newForeignPtr kcdbdel kcdb) | 76 | newDB :: Ptr KCDB -> IO DB
newDB kcdb = fmap DB (newForeignPtr kcdbdel kcdb) | 76 | newDB kcdb = fmap DB (newForeignPtr kcdbdel kcdb) | 49 | false | true | 0 | 7 | 14 | 43 | 18 | 25 | null | null |
mbakke/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | -- | The default fixed timeout needed until the helper VM is finally
-- shutdown, for example, after installing the OS.
helperVmShutdown :: Int
helperVmShutdown = 2 * 60 * 60 | 174 | helperVmShutdown :: Int
helperVmShutdown = 2 * 60 * 60 | 54 | helperVmShutdown = 2 * 60 * 60 | 30 | true | true | 0 | 6 | 30 | 21 | 12 | 9 | null | null |
AlexBaranosky/QuickCheck | Test/QuickCheck/Test.hs | bsd-3-clause | localMin' :: State -> P.Result -> [Rose P.Result] -> IO Int
localMin' st res [] = localMinFound st res | 102 | localMin' :: State -> P.Result -> [Rose P.Result] -> IO Int
localMin' st res [] = localMinFound st res | 102 | localMin' st res [] = localMinFound st res | 42 | false | true | 0 | 10 | 18 | 50 | 24 | 26 | null | null |
dorchard/camfort | src/Camfort/Output.hs | apache-2.0 | countLines xs =
case B.uncons xs of
Nothing -> 0
Just ('\n', xs) -> 1 + countLines xs
Just (_, xs) -> countLines xs
{- 'removeNewLines xs n' removes at most 'n' new lines characters from
the input string xs, returning the new string and the number of new
lines that were removed. Note that the number of new lines removed
might actually be less than 'n'- but in principle this should not
happen with the usaage in 'refactorDecl' -} | 449 | countLines xs =
case B.uncons xs of
Nothing -> 0
Just ('\n', xs) -> 1 + countLines xs
Just (_, xs) -> countLines xs
{- 'removeNewLines xs n' removes at most 'n' new lines characters from
the input string xs, returning the new string and the number of new
lines that were removed. Note that the number of new lines removed
might actually be less than 'n'- but in principle this should not
happen with the usaage in 'refactorDecl' -} | 449 | countLines xs =
case B.uncons xs of
Nothing -> 0
Just ('\n', xs) -> 1 + countLines xs
Just (_, xs) -> countLines xs
{- 'removeNewLines xs n' removes at most 'n' new lines characters from
the input string xs, returning the new string and the number of new
lines that were removed. Note that the number of new lines removed
might actually be less than 'n'- but in principle this should not
happen with the usaage in 'refactorDecl' -} | 449 | false | false | 1 | 9 | 97 | 68 | 32 | 36 | null | null |
sdiehl/ghc | testsuite/tests/typecheck/should_fail/UnliftedNewtypesLevityBinder.hs | bsd-3-clause | bad :: forall (r :: RuntimeRep) (a :: TYPE r). a -> Ident a
bad = IdentC | 72 | bad :: forall (r :: RuntimeRep) (a :: TYPE r). a -> Ident a
bad = IdentC | 72 | bad = IdentC | 12 | false | true | 0 | 9 | 16 | 45 | 23 | 22 | null | null |
mpkh/Idris-dev | src/Idris/Parser/Data.hs | bsd-3-clause | data_ :: SyntaxInfo -> IdrisParser PDecl
data_ syn = checkDeclFixity $
do (doc, argDocs, acc, dataOpts) <- try (do
(doc, argDocs) <- option noDocs docComment
pushIndent
acc <- accessibility
elim <- dataOpts []
co <- dataI
ist <- get
let dataOpts = combineDataOpts (elim ++ co)
doc' = annotCode (tryFullExpr syn ist) doc
argDocs' = [ (n, annotCode (tryFullExpr syn ist) d)
| (n, d) <- argDocs ]
return (doc', argDocs', acc, dataOpts))
fc <- getFC
(tyn_in, nfc) <- fnName
(do try (lchar ':')
ty <- typeExpr (allowImp syn)
let tyn = expandNS syn tyn_in
d <- option (PData doc argDocs syn fc dataOpts (PLaterdecl tyn nfc ty)) (do
reservedHL "where"
cons <- indentedBlock (constructor syn)
accData acc tyn (map (\ (_, _, n, _, _, _, _) -> n) cons)
return $ PData doc argDocs syn fc dataOpts (PDatadecl tyn nfc ty cons))
terminator
return d) <|> (do
args <- many (do notEndApp
x <- fst <$> name
return x)
let ty = bindArgs (map (const (PType fc)) args) (PType fc)
let tyn = expandNS syn tyn_in
d <- option (PData doc argDocs syn fc dataOpts (PLaterdecl tyn nfc ty)) (do
try (lchar '=') <|> do reservedHL "where"
let kw = (if DefaultEliminator `elem` dataOpts then "%elim" else "") ++ (if Codata `elem` dataOpts then "co" else "") ++ "data "
let n = show tyn_in ++ " "
let s = kw ++ n
let as = unwords (map show args) ++ " "
let ns = concat (intersperse " -> " $ map ((\x -> "(" ++ x ++ " : Type)") . show) args)
let ss = concat (intersperse " -> " $ map (const "Type") args)
let fix1 = s ++ as ++ " = ..."
let fix2 = s ++ ": " ++ ns ++ " -> Type where\n ..."
let fix3 = s ++ ": " ++ ss ++ " -> Type where\n ..."
fail $ fixErrorMsg "unexpected \"where\"" [fix1, fix2, fix3]
cons <- sepBy1 (simpleConstructor (syn { withAppAllowed = False })) (reservedOp "|")
let conty = mkPApp fc (PRef fc [] tyn) (map (PRef fc []) args)
cons' <- mapM (\ (doc, argDocs, x, xfc, cargs, cfc, fs) ->
do let cty = bindArgs cargs conty
return (doc, argDocs, x, xfc, cty, cfc, fs)) cons
accData acc tyn (map (\ (_, _, n, _, _, _, _) -> n) cons')
return $ PData doc argDocs syn fc dataOpts (PDatadecl tyn nfc ty cons'))
terminator
return d)
<?> "data type declaration"
where
mkPApp :: FC -> PTerm -> [PTerm] -> PTerm
mkPApp fc t [] = t
mkPApp fc t xs = PApp fc t (map pexp xs)
bindArgs :: [PTerm] -> PTerm -> PTerm
bindArgs xs t = foldr (PPi expl (sMN 0 "_t") NoFC) t xs
combineDataOpts :: DataOpts -> DataOpts
combineDataOpts opts = if Codata `elem` opts
then delete DefaultEliminator opts
else opts
{- | Parses a type constructor declaration
Constructor ::= DocComment? FnName TypeSig;
-} | 3,997 | data_ :: SyntaxInfo -> IdrisParser PDecl
data_ syn = checkDeclFixity $
do (doc, argDocs, acc, dataOpts) <- try (do
(doc, argDocs) <- option noDocs docComment
pushIndent
acc <- accessibility
elim <- dataOpts []
co <- dataI
ist <- get
let dataOpts = combineDataOpts (elim ++ co)
doc' = annotCode (tryFullExpr syn ist) doc
argDocs' = [ (n, annotCode (tryFullExpr syn ist) d)
| (n, d) <- argDocs ]
return (doc', argDocs', acc, dataOpts))
fc <- getFC
(tyn_in, nfc) <- fnName
(do try (lchar ':')
ty <- typeExpr (allowImp syn)
let tyn = expandNS syn tyn_in
d <- option (PData doc argDocs syn fc dataOpts (PLaterdecl tyn nfc ty)) (do
reservedHL "where"
cons <- indentedBlock (constructor syn)
accData acc tyn (map (\ (_, _, n, _, _, _, _) -> n) cons)
return $ PData doc argDocs syn fc dataOpts (PDatadecl tyn nfc ty cons))
terminator
return d) <|> (do
args <- many (do notEndApp
x <- fst <$> name
return x)
let ty = bindArgs (map (const (PType fc)) args) (PType fc)
let tyn = expandNS syn tyn_in
d <- option (PData doc argDocs syn fc dataOpts (PLaterdecl tyn nfc ty)) (do
try (lchar '=') <|> do reservedHL "where"
let kw = (if DefaultEliminator `elem` dataOpts then "%elim" else "") ++ (if Codata `elem` dataOpts then "co" else "") ++ "data "
let n = show tyn_in ++ " "
let s = kw ++ n
let as = unwords (map show args) ++ " "
let ns = concat (intersperse " -> " $ map ((\x -> "(" ++ x ++ " : Type)") . show) args)
let ss = concat (intersperse " -> " $ map (const "Type") args)
let fix1 = s ++ as ++ " = ..."
let fix2 = s ++ ": " ++ ns ++ " -> Type where\n ..."
let fix3 = s ++ ": " ++ ss ++ " -> Type where\n ..."
fail $ fixErrorMsg "unexpected \"where\"" [fix1, fix2, fix3]
cons <- sepBy1 (simpleConstructor (syn { withAppAllowed = False })) (reservedOp "|")
let conty = mkPApp fc (PRef fc [] tyn) (map (PRef fc []) args)
cons' <- mapM (\ (doc, argDocs, x, xfc, cargs, cfc, fs) ->
do let cty = bindArgs cargs conty
return (doc, argDocs, x, xfc, cty, cfc, fs)) cons
accData acc tyn (map (\ (_, _, n, _, _, _, _) -> n) cons')
return $ PData doc argDocs syn fc dataOpts (PDatadecl tyn nfc ty cons'))
terminator
return d)
<?> "data type declaration"
where
mkPApp :: FC -> PTerm -> [PTerm] -> PTerm
mkPApp fc t [] = t
mkPApp fc t xs = PApp fc t (map pexp xs)
bindArgs :: [PTerm] -> PTerm -> PTerm
bindArgs xs t = foldr (PPi expl (sMN 0 "_t") NoFC) t xs
combineDataOpts :: DataOpts -> DataOpts
combineDataOpts opts = if Codata `elem` opts
then delete DefaultEliminator opts
else opts
{- | Parses a type constructor declaration
Constructor ::= DocComment? FnName TypeSig;
-} | 3,997 | data_ syn = checkDeclFixity $
do (doc, argDocs, acc, dataOpts) <- try (do
(doc, argDocs) <- option noDocs docComment
pushIndent
acc <- accessibility
elim <- dataOpts []
co <- dataI
ist <- get
let dataOpts = combineDataOpts (elim ++ co)
doc' = annotCode (tryFullExpr syn ist) doc
argDocs' = [ (n, annotCode (tryFullExpr syn ist) d)
| (n, d) <- argDocs ]
return (doc', argDocs', acc, dataOpts))
fc <- getFC
(tyn_in, nfc) <- fnName
(do try (lchar ':')
ty <- typeExpr (allowImp syn)
let tyn = expandNS syn tyn_in
d <- option (PData doc argDocs syn fc dataOpts (PLaterdecl tyn nfc ty)) (do
reservedHL "where"
cons <- indentedBlock (constructor syn)
accData acc tyn (map (\ (_, _, n, _, _, _, _) -> n) cons)
return $ PData doc argDocs syn fc dataOpts (PDatadecl tyn nfc ty cons))
terminator
return d) <|> (do
args <- many (do notEndApp
x <- fst <$> name
return x)
let ty = bindArgs (map (const (PType fc)) args) (PType fc)
let tyn = expandNS syn tyn_in
d <- option (PData doc argDocs syn fc dataOpts (PLaterdecl tyn nfc ty)) (do
try (lchar '=') <|> do reservedHL "where"
let kw = (if DefaultEliminator `elem` dataOpts then "%elim" else "") ++ (if Codata `elem` dataOpts then "co" else "") ++ "data "
let n = show tyn_in ++ " "
let s = kw ++ n
let as = unwords (map show args) ++ " "
let ns = concat (intersperse " -> " $ map ((\x -> "(" ++ x ++ " : Type)") . show) args)
let ss = concat (intersperse " -> " $ map (const "Type") args)
let fix1 = s ++ as ++ " = ..."
let fix2 = s ++ ": " ++ ns ++ " -> Type where\n ..."
let fix3 = s ++ ": " ++ ss ++ " -> Type where\n ..."
fail $ fixErrorMsg "unexpected \"where\"" [fix1, fix2, fix3]
cons <- sepBy1 (simpleConstructor (syn { withAppAllowed = False })) (reservedOp "|")
let conty = mkPApp fc (PRef fc [] tyn) (map (PRef fc []) args)
cons' <- mapM (\ (doc, argDocs, x, xfc, cargs, cfc, fs) ->
do let cty = bindArgs cargs conty
return (doc, argDocs, x, xfc, cty, cfc, fs)) cons
accData acc tyn (map (\ (_, _, n, _, _, _, _) -> n) cons')
return $ PData doc argDocs syn fc dataOpts (PDatadecl tyn nfc ty cons'))
terminator
return d)
<?> "data type declaration"
where
mkPApp :: FC -> PTerm -> [PTerm] -> PTerm
mkPApp fc t [] = t
mkPApp fc t xs = PApp fc t (map pexp xs)
bindArgs :: [PTerm] -> PTerm -> PTerm
bindArgs xs t = foldr (PPi expl (sMN 0 "_t") NoFC) t xs
combineDataOpts :: DataOpts -> DataOpts
combineDataOpts opts = if Codata `elem` opts
then delete DefaultEliminator opts
else opts
{- | Parses a type constructor declaration
Constructor ::= DocComment? FnName TypeSig;
-} | 3,956 | false | true | 3 | 32 | 1,932 | 1,274 | 627 | 647 | null | null |
wuerges/vlsi_verification | test/TestSimulation.hs | bsd-3-clause | filesWrong = ["BDD_wrong", "unit2", "unit11", "unit13", "unit15", "unit17"] | 77 | filesWrong = ["BDD_wrong", "unit2", "unit11", "unit13", "unit15", "unit17"] | 77 | filesWrong = ["BDD_wrong", "unit2", "unit11", "unit13", "unit15", "unit17"] | 77 | false | false | 0 | 5 | 9 | 24 | 15 | 9 | null | null |
aaronc/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v (LPlus ATFloat) [l, r] = v ++ "FLOATOP(+," ++ creg l ++ ", " ++ creg r ++ ")" | 84 | doOp v (LPlus ATFloat) [l, r] = v ++ "FLOATOP(+," ++ creg l ++ ", " ++ creg r ++ ")" | 84 | doOp v (LPlus ATFloat) [l, r] = v ++ "FLOATOP(+," ++ creg l ++ ", " ++ creg r ++ ")" | 84 | false | false | 0 | 9 | 20 | 54 | 25 | 29 | null | null |
pasberth/paradocs | Language/Paradocs/Token.hs | mit | dropParagraph :: (Eq a, String.IsString a) => [Token a] -> [Token a]
dropParagraph = dropWhile (\tk -> not (isParagraphBreak tk || isParagraphLevelInstruction tk)) | 163 | dropParagraph :: (Eq a, String.IsString a) => [Token a] -> [Token a]
dropParagraph = dropWhile (\tk -> not (isParagraphBreak tk || isParagraphLevelInstruction tk)) | 163 | dropParagraph = dropWhile (\tk -> not (isParagraphBreak tk || isParagraphLevelInstruction tk)) | 94 | false | true | 0 | 11 | 22 | 71 | 36 | 35 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2017/M09/D25/Solution.hs | mit | check :: MonadPlus m => Integer -> ByteString -> ByteString -> m ()
check idx should is = if should == is then return () else
error ("For article " ++ show idx ++ ": Key should be " ++ show should
++ " but is actually " ++ show is) | 241 | check :: MonadPlus m => Integer -> ByteString -> ByteString -> m ()
check idx should is = if should == is then return () else
error ("For article " ++ show idx ++ ": Key should be " ++ show should
++ " but is actually " ++ show is) | 241 | check idx should is = if should == is then return () else
error ("For article " ++ show idx ++ ": Key should be " ++ show should
++ " but is actually " ++ show is) | 173 | false | true | 0 | 13 | 60 | 98 | 46 | 52 | null | null |
hargettp/distributed-containers | src/Distributed/Data/Queue.hs | mit | enqueue :: (Serialize v) => v -> Queue v -> Causal ()
enqueue value queue = Causal $ \_ -> do
now <- perform (Cmd $ Enqueue value) queue
return ((),now) | 160 | enqueue :: (Serialize v) => v -> Queue v -> Causal ()
enqueue value queue = Causal $ \_ -> do
now <- perform (Cmd $ Enqueue value) queue
return ((),now) | 160 | enqueue value queue = Causal $ \_ -> do
now <- perform (Cmd $ Enqueue value) queue
return ((),now) | 106 | false | true | 0 | 13 | 38 | 86 | 42 | 44 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Latex.hs | gpl-2.0 | regex_'25'5cs'2aBEGIN'2e'2a'24 = compileRegex True "%\\s*BEGIN.*$" | 66 | regex_'25'5cs'2aBEGIN'2e'2a'24 = compileRegex True "%\\s*BEGIN.*$" | 66 | regex_'25'5cs'2aBEGIN'2e'2a'24 = compileRegex True "%\\s*BEGIN.*$" | 66 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
mightymoose/liquidhaskell | benchmarks/containers-0.5.0.0/Data/Sequence.hs | bsd-3-clause | initsDigit :: Digit a -> Digit (Digit a)
initsDigit (One a) = One (One a) | 73 | initsDigit :: Digit a -> Digit (Digit a)
initsDigit (One a) = One (One a) | 73 | initsDigit (One a) = One (One a) | 32 | false | true | 0 | 9 | 14 | 49 | 22 | 27 | null | null |
hvr/jhc | lib/haskell-extras/Data/Array/Unboxed.hs | mit | array :: (Ix a,Storable b) => (a,a) -> [(a,b)] -> UArray a b
array b@(s,e) ivs = MkArray s e (unsafePerformIO arr) where
arr = do
let f :: [(a,b)] -> b; f _ = undefined
fp <- mallocForeignPtrBytes (sizeOf (f ivs) * rangeSize b)
withForeignPtr fp $ \ptr ->
mapM_ (\ (i,v) -> pokeElemOff ptr (index b i) v) ivs
return fp | 373 | array :: (Ix a,Storable b) => (a,a) -> [(a,b)] -> UArray a b
array b@(s,e) ivs = MkArray s e (unsafePerformIO arr) where
arr = do
let f :: [(a,b)] -> b; f _ = undefined
fp <- mallocForeignPtrBytes (sizeOf (f ivs) * rangeSize b)
withForeignPtr fp $ \ptr ->
mapM_ (\ (i,v) -> pokeElemOff ptr (index b i) v) ivs
return fp | 373 | array b@(s,e) ivs = MkArray s e (unsafePerformIO arr) where
arr = do
let f :: [(a,b)] -> b; f _ = undefined
fp <- mallocForeignPtrBytes (sizeOf (f ivs) * rangeSize b)
withForeignPtr fp $ \ptr ->
mapM_ (\ (i,v) -> pokeElemOff ptr (index b i) v) ivs
return fp | 306 | false | true | 0 | 16 | 117 | 203 | 105 | 98 | null | null |
spechub/Hets | OWL2/XMLKeywords.hs | gpl-2.0 | disjointDataPropertiesK :: String
disjointDataPropertiesK = "DisjointDataProperties" | 84 | disjointDataPropertiesK :: String
disjointDataPropertiesK = "DisjointDataProperties" | 84 | disjointDataPropertiesK = "DisjointDataProperties" | 50 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
sagi-schein/curvelib | test/dist/build/autogen/Paths_test_curvelib.hs | mit | minusFileName dir "." = dir | 30 | minusFileName dir "." = dir | 30 | minusFileName dir "." = dir | 30 | false | false | 0 | 5 | 7 | 11 | 5 | 6 | null | null |
jonaprieto/online-atps | src/OnlineATPs/Defaults.hs | mit | - | 'defaultSystemATP' stores the defaults options in the TPTP World.
defaultSystemOnTPTP ∷ SystemOnTPTP
defaultSystemOnTPTP = SystemOnTPTP
{ optAutoMode = "-cE"
, optAutoModeSystemsLimit = "3"
, optAutoModeTimeLimit = "300"
, optCompleteness = False
, optCorrectness = False
, optCPUPassword = ""
, optFORMULAEProblem = ""
, optFormulaURL = ""
, optIDV = False
, optNoHTML = "1"
, optProblemSource = "FORMULAE" --"TPTP"
, optQuietFlag = "-q01" --q2
, optReportFlag = "-q0"
, optSoundness = False
, optSubmitButton = "RunSelectedSystems"
, optSystemInfo = False
, optSystemOnTSTP = False
, optSystems = []
, optTPTPProblem = "" --AGT001+1"
, optTSTPData = False
, optUPLOADProblem = ""
, optX2TPTP = False
}
| 981 | defaultSystemOnTPTP ∷ SystemOnTPTP
defaultSystemOnTPTP = SystemOnTPTP
{ optAutoMode = "-cE"
, optAutoModeSystemsLimit = "3"
, optAutoModeTimeLimit = "300"
, optCompleteness = False
, optCorrectness = False
, optCPUPassword = ""
, optFORMULAEProblem = ""
, optFormulaURL = ""
, optIDV = False
, optNoHTML = "1"
, optProblemSource = "FORMULAE" --"TPTP"
, optQuietFlag = "-q01" --q2
, optReportFlag = "-q0"
, optSoundness = False
, optSubmitButton = "RunSelectedSystems"
, optSystemInfo = False
, optSystemOnTSTP = False
, optSystems = []
, optTPTPProblem = "" --AGT001+1"
, optTSTPData = False
, optUPLOADProblem = ""
, optX2TPTP = False
} | 910 | defaultSystemOnTPTP = SystemOnTPTP
{ optAutoMode = "-cE"
, optAutoModeSystemsLimit = "3"
, optAutoModeTimeLimit = "300"
, optCompleteness = False
, optCorrectness = False
, optCPUPassword = ""
, optFORMULAEProblem = ""
, optFormulaURL = ""
, optIDV = False
, optNoHTML = "1"
, optProblemSource = "FORMULAE" --"TPTP"
, optQuietFlag = "-q01" --q2
, optReportFlag = "-q0"
, optSoundness = False
, optSubmitButton = "RunSelectedSystems"
, optSystemInfo = False
, optSystemOnTSTP = False
, optSystems = []
, optTPTPProblem = "" --AGT001+1"
, optTSTPData = False
, optUPLOADProblem = ""
, optX2TPTP = False
} | 875 | true | true | 1 | 9 | 382 | 182 | 113 | 69 | null | null |
polachok/xbattbar | src/XBattBar/Core.hs | mit | start :: Options -> IO ()
start opts = do
dpy' <- openDisplay ""
let screen' = defaultScreen dpy'
root <- rootWindow dpy' screen'
let ctx = XContext dpy' screen' root
let geom' = getBarRect (position opts) (fromIntegral $ thickness opts) (getScreenRect ctx)
let fg = whitePixel dpy' screen'
let bg = blackPixel dpy' screen'
let orientation' x | x == Top || x == Bottom = Horizontal
| otherwise = Vertical
bar' <- mkProgressBar ctx geom' fg bg (orientation' $ position opts) (exposureMask .|. enterWindowMask .|. leaveWindowMask)
let popupGeom = getPopupRect $ getScreenRect ctx
popup' <- mkLabel ctx popupGeom bg fg "fixed" [] noEventMask
(ac, bat) <- getColors ctx opts
run $ XBattBar opts bar' popup' ac bat
return () | 798 | start :: Options -> IO ()
start opts = do
dpy' <- openDisplay ""
let screen' = defaultScreen dpy'
root <- rootWindow dpy' screen'
let ctx = XContext dpy' screen' root
let geom' = getBarRect (position opts) (fromIntegral $ thickness opts) (getScreenRect ctx)
let fg = whitePixel dpy' screen'
let bg = blackPixel dpy' screen'
let orientation' x | x == Top || x == Bottom = Horizontal
| otherwise = Vertical
bar' <- mkProgressBar ctx geom' fg bg (orientation' $ position opts) (exposureMask .|. enterWindowMask .|. leaveWindowMask)
let popupGeom = getPopupRect $ getScreenRect ctx
popup' <- mkLabel ctx popupGeom bg fg "fixed" [] noEventMask
(ac, bat) <- getColors ctx opts
run $ XBattBar opts bar' popup' ac bat
return () | 798 | start opts = do
dpy' <- openDisplay ""
let screen' = defaultScreen dpy'
root <- rootWindow dpy' screen'
let ctx = XContext dpy' screen' root
let geom' = getBarRect (position opts) (fromIntegral $ thickness opts) (getScreenRect ctx)
let fg = whitePixel dpy' screen'
let bg = blackPixel dpy' screen'
let orientation' x | x == Top || x == Bottom = Horizontal
| otherwise = Vertical
bar' <- mkProgressBar ctx geom' fg bg (orientation' $ position opts) (exposureMask .|. enterWindowMask .|. leaveWindowMask)
let popupGeom = getPopupRect $ getScreenRect ctx
popup' <- mkLabel ctx popupGeom bg fg "fixed" [] noEventMask
(ac, bat) <- getColors ctx opts
run $ XBattBar opts bar' popup' ac bat
return () | 772 | false | true | 0 | 16 | 199 | 308 | 138 | 170 | null | null |
chrismwendt/diff-gestalt | src/Data/Algorithm/Diff/Gestalt.hs | unlicense | -- | Takes two lists and returns a list of differences between them, grouped into chunks.
--
-- >>> diff "tree" "there"
-- [Both "t" "t",Second "he",Both "re" "re",First "e"]
diff :: Ord a => [a] -> [a] -> [Diff [a]]
diff [] [] = [] | 232 | diff :: Ord a => [a] -> [a] -> [Diff [a]]
diff [] [] = [] | 57 | diff [] [] = [] | 15 | true | true | 0 | 10 | 45 | 56 | 31 | 25 | null | null |
iand675/hs-kafka | src/Network/Kafka/Internal/Connection.hs | bsd-3-clause | reconnect :: KafkaConnection -> IO ()
reconnect c = do
sock <- takeMVar $ kafkaSocket c
transportClose sock
let (h, p) = kafkaConnectionInfo c
sock' <- socketTransport h p
atomicModifyIORef (kafkaLeftovers c) $ const ("", ())
putMVar (kafkaSocket c) sock' | 267 | reconnect :: KafkaConnection -> IO ()
reconnect c = do
sock <- takeMVar $ kafkaSocket c
transportClose sock
let (h, p) = kafkaConnectionInfo c
sock' <- socketTransport h p
atomicModifyIORef (kafkaLeftovers c) $ const ("", ())
putMVar (kafkaSocket c) sock' | 267 | reconnect c = do
sock <- takeMVar $ kafkaSocket c
transportClose sock
let (h, p) = kafkaConnectionInfo c
sock' <- socketTransport h p
atomicModifyIORef (kafkaLeftovers c) $ const ("", ())
putMVar (kafkaSocket c) sock' | 229 | false | true | 0 | 10 | 51 | 115 | 52 | 63 | null | null |
allanderek/ipclib | Language/Pepa/Utils.hs | gpl-2.0 | {-| Return the value held inside a 'Maybe' value, if that value is
actually a 'Nothing' then call error with the given error message
-}
maybeError :: String -> Maybe a -> a
maybeError _errMsg (Just a) = a | 208 | maybeError :: String -> Maybe a -> a
maybeError _errMsg (Just a) = a | 68 | maybeError _errMsg (Just a) = a | 31 | true | true | 0 | 10 | 42 | 40 | 18 | 22 | null | null |
ekmett/ermine | src/Ermine/Syntax/Kind.hs | bsd-2-clause | -- | Construct a schema from a kind, generalizing all free variables.
--
-- When working with 'Ermine.Kind.Inference.Meta' variables, you want to use
-- generalize to 'zonk' the kind and check skolems.
--
-- >>> general "a" (Hinted ?? ())
-- Schema [Hinted "a" ()] (Scope (Var (B 0)))
--
-- >>> general ("a" ~> "a") (Hinted ?? ())
-- Schema [Hinted "a" ()] (Scope (Var (B 0) :-> Var (B 0)))
--
-- >>> general ("a" ~> "b") (Hinted ?? ())
-- Schema [Hinted "a" (),Hinted "b" ()] (Scope (Var (B 0) :-> Var (B 1)))
--
-- >>> general ("b" ~> "a") (Hinted ?? ())
-- Schema [Hinted "b" (),Hinted "a" ()] (Scope (Var (B 0) :-> Var (B 1)))
--
-- >>> general (star ~> star) (Hinted ?? ())
-- Schema [] (Scope (Type (HardKind Star) :-> Type (HardKind Star)))
general :: Ord k => Kind k -> (k -> Hint) -> Schema a
general k0 h = Schema (reverse hs) (Scope r) where
((_, hs, _), r) = mapAccumL go (Map.empty, [], 0) k0
go mhn@(m, hl, n) k = case m^.at k of
Just b -> (mhn, B b)
Nothing -> let n' = n + 1 in n' `seq` ((m & at k ?~ n, h k : hl, n'), B n) | 1,048 | general :: Ord k => Kind k -> (k -> Hint) -> Schema a
general k0 h = Schema (reverse hs) (Scope r) where
((_, hs, _), r) = mapAccumL go (Map.empty, [], 0) k0
go mhn@(m, hl, n) k = case m^.at k of
Just b -> (mhn, B b)
Nothing -> let n' = n + 1 in n' `seq` ((m & at k ?~ n, h k : hl, n'), B n) | 300 | general k0 h = Schema (reverse hs) (Scope r) where
((_, hs, _), r) = mapAccumL go (Map.empty, [], 0) k0
go mhn@(m, hl, n) k = case m^.at k of
Just b -> (mhn, B b)
Nothing -> let n' = n + 1 in n' `seq` ((m & at k ?~ n, h k : hl, n'), B n) | 246 | true | true | 0 | 17 | 226 | 237 | 133 | 104 | null | null |
green-haskell/ghc | compiler/codeGen/StgCmmClosure.hs | bsd-3-clause | isStaticClosure :: ClosureInfo -> Bool
isStaticClosure cl_info = isStaticRep (closureSMRep cl_info) | 99 | isStaticClosure :: ClosureInfo -> Bool
isStaticClosure cl_info = isStaticRep (closureSMRep cl_info) | 99 | isStaticClosure cl_info = isStaticRep (closureSMRep cl_info) | 60 | false | true | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.