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
sdiehl/ghc
hadrian/src/Settings/Default.hs
bsd-3-clause
-- | Concatenate source arguments in appropriate order. sourceArgs :: SourceArgs -> Args sourceArgs SourceArgs {..} = builder Ghc ? mconcat [ hsDefault , getContextData hcOpts -- `compiler` is also a library but the specific arguments that we want -- to apply to that are given by the hsCompiler option. `ghc` is an -- executable so we don't have to exclude that. , libraryPackage ? notM (packageOneOf [compiler]) ? hsLibrary , package compiler ? hsCompiler , package ghc ? hsGhc ]
520
sourceArgs :: SourceArgs -> Args sourceArgs SourceArgs {..} = builder Ghc ? mconcat [ hsDefault , getContextData hcOpts -- `compiler` is also a library but the specific arguments that we want -- to apply to that are given by the hsCompiler option. `ghc` is an -- executable so we don't have to exclude that. , libraryPackage ? notM (packageOneOf [compiler]) ? hsLibrary , package compiler ? hsCompiler , package ghc ? hsGhc ]
464
sourceArgs SourceArgs {..} = builder Ghc ? mconcat [ hsDefault , getContextData hcOpts -- `compiler` is also a library but the specific arguments that we want -- to apply to that are given by the hsCompiler option. `ghc` is an -- executable so we don't have to exclude that. , libraryPackage ? notM (packageOneOf [compiler]) ? hsLibrary , package compiler ? hsCompiler , package ghc ? hsGhc ]
431
true
true
0
11
119
90
47
43
null
null
brownplt/strobe-old
src/BrownPLT/TypedJS/TypeErasure.hs
bsd-2-clause
expr (UnaryAssignExpr p op lv) = JS.UnaryAssignExpr p op (lvalue lv)
68
expr (UnaryAssignExpr p op lv) = JS.UnaryAssignExpr p op (lvalue lv)
68
expr (UnaryAssignExpr p op lv) = JS.UnaryAssignExpr p op (lvalue lv)
68
false
false
0
7
10
35
16
19
null
null
vTurbine/ghc
compiler/typecheck/TcClassDcl.hs
bsd-3-clause
tcClassSigs :: Name -- Name of the class -> [LSig Name] -> LHsBinds Name -> TcM [TcMethInfo] -- Exactly one for each method tcClassSigs clas sigs def_methods = do { traceTc "tcClassSigs 1" (ppr clas) ; gen_dm_prs <- concat <$> mapM (addLocM tc_gen_sig) gen_sigs ; let gen_dm_env :: NameEnv (SrcSpan, Type) gen_dm_env = mkNameEnv gen_dm_prs ; op_info <- concat <$> mapM (addLocM (tc_sig gen_dm_env)) vanilla_sigs ; let op_names = mkNameSet [ n | (n,_,_) <- op_info ] ; sequence_ [ failWithTc (badMethodErr clas n) | n <- dm_bind_names, not (n `elemNameSet` op_names) ] -- Value binding for non class-method (ie no TypeSig) ; sequence_ [ failWithTc (badGenericMethod clas n) | (n,_) <- gen_dm_prs, not (n `elem` dm_bind_names) ] -- Generic signature without value binding ; traceTc "tcClassSigs 2" (ppr clas) ; return op_info } where vanilla_sigs = [L loc (nm,ty) | L loc (ClassOpSig False nm ty) <- sigs] gen_sigs = [L loc (nm,ty) | L loc (ClassOpSig True nm ty) <- sigs] dm_bind_names :: [Name] -- These ones have a value binding in the class decl dm_bind_names = [op | L _ (FunBind {fun_id = L _ op}) <- bagToList def_methods] tc_sig :: NameEnv (SrcSpan, Type) -> ([Located Name], LHsSigType Name) -> TcM [TcMethInfo] tc_sig gen_dm_env (op_names, op_hs_ty) = do { traceTc "ClsSig 1" (ppr op_names) ; op_ty <- tcClassSigType op_names op_hs_ty -- Class tyvars already in scope ; traceTc "ClsSig 2" (ppr op_names) ; return [ (op_name, op_ty, f op_name) | L _ op_name <- op_names ] } where f nm | Just lty <- lookupNameEnv gen_dm_env nm = Just (GenericDM lty) | nm `elem` dm_bind_names = Just VanillaDM | otherwise = Nothing tc_gen_sig (op_names, gen_hs_ty) = do { gen_op_ty <- tcClassSigType op_names gen_hs_ty ; return [ (op_name, (loc, gen_op_ty)) | L loc op_name <- op_names ] } {- ************************************************************************ * * Class Declarations * * ************************************************************************ -}
2,533
tcClassSigs :: Name -- Name of the class -> [LSig Name] -> LHsBinds Name -> TcM [TcMethInfo] tcClassSigs clas sigs def_methods = do { traceTc "tcClassSigs 1" (ppr clas) ; gen_dm_prs <- concat <$> mapM (addLocM tc_gen_sig) gen_sigs ; let gen_dm_env :: NameEnv (SrcSpan, Type) gen_dm_env = mkNameEnv gen_dm_prs ; op_info <- concat <$> mapM (addLocM (tc_sig gen_dm_env)) vanilla_sigs ; let op_names = mkNameSet [ n | (n,_,_) <- op_info ] ; sequence_ [ failWithTc (badMethodErr clas n) | n <- dm_bind_names, not (n `elemNameSet` op_names) ] -- Value binding for non class-method (ie no TypeSig) ; sequence_ [ failWithTc (badGenericMethod clas n) | (n,_) <- gen_dm_prs, not (n `elem` dm_bind_names) ] -- Generic signature without value binding ; traceTc "tcClassSigs 2" (ppr clas) ; return op_info } where vanilla_sigs = [L loc (nm,ty) | L loc (ClassOpSig False nm ty) <- sigs] gen_sigs = [L loc (nm,ty) | L loc (ClassOpSig True nm ty) <- sigs] dm_bind_names :: [Name] -- These ones have a value binding in the class decl dm_bind_names = [op | L _ (FunBind {fun_id = L _ op}) <- bagToList def_methods] tc_sig :: NameEnv (SrcSpan, Type) -> ([Located Name], LHsSigType Name) -> TcM [TcMethInfo] tc_sig gen_dm_env (op_names, op_hs_ty) = do { traceTc "ClsSig 1" (ppr op_names) ; op_ty <- tcClassSigType op_names op_hs_ty -- Class tyvars already in scope ; traceTc "ClsSig 2" (ppr op_names) ; return [ (op_name, op_ty, f op_name) | L _ op_name <- op_names ] } where f nm | Just lty <- lookupNameEnv gen_dm_env nm = Just (GenericDM lty) | nm `elem` dm_bind_names = Just VanillaDM | otherwise = Nothing tc_gen_sig (op_names, gen_hs_ty) = do { gen_op_ty <- tcClassSigType op_names gen_hs_ty ; return [ (op_name, (loc, gen_op_ty)) | L loc op_name <- op_names ] } {- ************************************************************************ * * Class Declarations * * ************************************************************************ -}
2,499
tcClassSigs clas sigs def_methods = do { traceTc "tcClassSigs 1" (ppr clas) ; gen_dm_prs <- concat <$> mapM (addLocM tc_gen_sig) gen_sigs ; let gen_dm_env :: NameEnv (SrcSpan, Type) gen_dm_env = mkNameEnv gen_dm_prs ; op_info <- concat <$> mapM (addLocM (tc_sig gen_dm_env)) vanilla_sigs ; let op_names = mkNameSet [ n | (n,_,_) <- op_info ] ; sequence_ [ failWithTc (badMethodErr clas n) | n <- dm_bind_names, not (n `elemNameSet` op_names) ] -- Value binding for non class-method (ie no TypeSig) ; sequence_ [ failWithTc (badGenericMethod clas n) | (n,_) <- gen_dm_prs, not (n `elem` dm_bind_names) ] -- Generic signature without value binding ; traceTc "tcClassSigs 2" (ppr clas) ; return op_info } where vanilla_sigs = [L loc (nm,ty) | L loc (ClassOpSig False nm ty) <- sigs] gen_sigs = [L loc (nm,ty) | L loc (ClassOpSig True nm ty) <- sigs] dm_bind_names :: [Name] -- These ones have a value binding in the class decl dm_bind_names = [op | L _ (FunBind {fun_id = L _ op}) <- bagToList def_methods] tc_sig :: NameEnv (SrcSpan, Type) -> ([Located Name], LHsSigType Name) -> TcM [TcMethInfo] tc_sig gen_dm_env (op_names, op_hs_ty) = do { traceTc "ClsSig 1" (ppr op_names) ; op_ty <- tcClassSigType op_names op_hs_ty -- Class tyvars already in scope ; traceTc "ClsSig 2" (ppr op_names) ; return [ (op_name, op_ty, f op_name) | L _ op_name <- op_names ] } where f nm | Just lty <- lookupNameEnv gen_dm_env nm = Just (GenericDM lty) | nm `elem` dm_bind_names = Just VanillaDM | otherwise = Nothing tc_gen_sig (op_names, gen_hs_ty) = do { gen_op_ty <- tcClassSigType op_names gen_hs_ty ; return [ (op_name, (loc, gen_op_ty)) | L loc op_name <- op_names ] } {- ************************************************************************ * * Class Declarations * * ************************************************************************ -}
2,355
true
true
0
14
884
699
359
340
null
null
mrd/camfort
src/Camfort/Specification/Units/InferenceFrontend.hs
apache-2.0
extractConstraints :: UnitSolver Constraints extractConstraints = do pf <- gets usProgramFile dmap <- (M.union (extractDeclMap pf) . combinedDeclMap . M.elems) `fmap` asks uoModFiles varUnitMap <- gets usVarUnitMap return $ [ con | b <- mainBlocks pf, con@(ConEq {}) <- universeBi b ] ++ [ ConEq (toUnitVar dmap v) u | (v, u) <- M.toList varUnitMap ] -- | A list of blocks considered to be part of the 'main' program.
451
extractConstraints :: UnitSolver Constraints extractConstraints = do pf <- gets usProgramFile dmap <- (M.union (extractDeclMap pf) . combinedDeclMap . M.elems) `fmap` asks uoModFiles varUnitMap <- gets usVarUnitMap return $ [ con | b <- mainBlocks pf, con@(ConEq {}) <- universeBi b ] ++ [ ConEq (toUnitVar dmap v) u | (v, u) <- M.toList varUnitMap ] -- | A list of blocks considered to be part of the 'main' program.
451
extractConstraints = do pf <- gets usProgramFile dmap <- (M.union (extractDeclMap pf) . combinedDeclMap . M.elems) `fmap` asks uoModFiles varUnitMap <- gets usVarUnitMap return $ [ con | b <- mainBlocks pf, con@(ConEq {}) <- universeBi b ] ++ [ ConEq (toUnitVar dmap v) u | (v, u) <- M.toList varUnitMap ] -- | A list of blocks considered to be part of the 'main' program.
406
false
true
0
14
103
156
77
79
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/types/TyCon.hs
bsd-3-clause
primElemRepSizeB FloatElemRep = 4
34
primElemRepSizeB FloatElemRep = 4
34
primElemRepSizeB FloatElemRep = 4
34
false
false
0
5
4
9
4
5
null
null
ganeti/ganeti
src/Ganeti/HTools/Node.hs
bsd-2-clause
pCpuEff :: Node -> Double pCpuEff n = pCpu n / tCpuSpeed n
58
pCpuEff :: Node -> Double pCpuEff n = pCpu n / tCpuSpeed n
58
pCpuEff n = pCpu n / tCpuSpeed n
32
false
true
0
6
12
28
13
15
null
null
nomeata/ghc
compiler/llvmGen/Llvm/PpLlvm.hs
bsd-3-clause
ppMetas :: [MetaData] -> SDoc ppMetas meta = hcat $ map ppMeta meta where ppMeta (name, (LMMetaUnamed n)) = comma <+> exclamation <> ftext name <+> exclamation <> int n -------------------------------------------------------------------------------- -- * Misc functions --------------------------------------------------------------------------------
366
ppMetas :: [MetaData] -> SDoc ppMetas meta = hcat $ map ppMeta meta where ppMeta (name, (LMMetaUnamed n)) = comma <+> exclamation <> ftext name <+> exclamation <> int n -------------------------------------------------------------------------------- -- * Misc functions --------------------------------------------------------------------------------
366
ppMetas meta = hcat $ map ppMeta meta where ppMeta (name, (LMMetaUnamed n)) = comma <+> exclamation <> ftext name <+> exclamation <> int n -------------------------------------------------------------------------------- -- * Misc functions --------------------------------------------------------------------------------
336
false
true
0
8
51
78
40
38
null
null
ezyang/ghc
testsuite/tests/pmcheck/should_compile/T11195.hs
bsd-3-clause
-- Push transitivity inside forall opt_trans_rule is co1 co2 | ForAllCo tv1 eta1 r1 <- co1 , Just (tv2,eta2,r2) <- etaForAllCo_maybe co2 = undefined | ForAllCo tv2 eta2 r2 <- co2 , Just (tv1,eta1,r1) <- etaForAllCo_maybe co1 = undefined where push_trans tv1 eta1 r1 tv2 eta2 r2 = undefined -- Push transitivity inside axioms
339
opt_trans_rule is co1 co2 | ForAllCo tv1 eta1 r1 <- co1 , Just (tv2,eta2,r2) <- etaForAllCo_maybe co2 = undefined | ForAllCo tv2 eta2 r2 <- co2 , Just (tv1,eta1,r1) <- etaForAllCo_maybe co1 = undefined where push_trans tv1 eta1 r1 tv2 eta2 r2 = undefined -- Push transitivity inside axioms
304
opt_trans_rule is co1 co2 | ForAllCo tv1 eta1 r1 <- co1 , Just (tv2,eta2,r2) <- etaForAllCo_maybe co2 = undefined | ForAllCo tv2 eta2 r2 <- co2 , Just (tv1,eta1,r1) <- etaForAllCo_maybe co1 = undefined where push_trans tv1 eta1 r1 tv2 eta2 r2 = undefined -- Push transitivity inside axioms
304
true
false
0
10
68
122
59
63
null
null
ggreif/thebook-haskell
tests/Test.hs
mit
tests :: Tasty.TestTree tests = Tasty.testGroup "Tests" [ BookTest.tests , ITCHTypesTest.tests , ITCH51Test.tests , RuleTest.tests , TypesTest.tests , Monad.tests ]
180
tests :: Tasty.TestTree tests = Tasty.testGroup "Tests" [ BookTest.tests , ITCHTypesTest.tests , ITCH51Test.tests , RuleTest.tests , TypesTest.tests , Monad.tests ]
180
tests = Tasty.testGroup "Tests" [ BookTest.tests , ITCHTypesTest.tests , ITCH51Test.tests , RuleTest.tests , TypesTest.tests , Monad.tests ]
156
false
true
0
7
35
56
29
27
null
null
graydon/metrics
tests/HistogramTest.hs
mit
testUniformSample2000 :: Test testUniformSample2000 = uniformTest "uniform sample 2000" $ \h -> do mapM_ (update h $) [0..1999] x <- maxVal h assert $ x == 1999 --testUniformSample2000Threaded :: Test --testUniformSample2000Threaded ="" ~: test $ do -- x <- with
269
testUniformSample2000 :: Test testUniformSample2000 = uniformTest "uniform sample 2000" $ \h -> do mapM_ (update h $) [0..1999] x <- maxVal h assert $ x == 1999 --testUniformSample2000Threaded :: Test --testUniformSample2000Threaded ="" ~: test $ do -- x <- with
269
testUniformSample2000 = uniformTest "uniform sample 2000" $ \h -> do mapM_ (update h $) [0..1999] x <- maxVal h assert $ x == 1999 --testUniformSample2000Threaded :: Test --testUniformSample2000Threaded ="" ~: test $ do -- x <- with
239
false
true
0
11
46
67
34
33
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/elem_4.hs
mit
primEqNat (Succ x) (Succ y) = primEqNat x y
43
primEqNat (Succ x) (Succ y) = primEqNat x y
43
primEqNat (Succ x) (Succ y) = primEqNat x y
43
false
false
0
7
8
28
13
15
null
null
kojiromike/Idris-dev
src/Idris/Coverage.hs
bsd-3-clause
checkRec _ _ = return False
27
checkRec _ _ = return False
27
checkRec _ _ = return False
27
false
false
0
5
5
14
6
8
null
null
DanielSchuessler/hstri
Tetrahedron/Triangle.hs
gpl-3.0
-- | Ordered edges contained in a given triangle (result is a cycle) oEdgesOfTriangle :: (Vertices t, Verts t ~ Triple Vertex) => t -> Triple OEdge oEdgesOfTriangle = gedgesOfTriangle verticesToOEdge
199
oEdgesOfTriangle :: (Vertices t, Verts t ~ Triple Vertex) => t -> Triple OEdge oEdgesOfTriangle = gedgesOfTriangle verticesToOEdge
130
oEdgesOfTriangle = gedgesOfTriangle verticesToOEdge
51
true
true
0
8
30
45
22
23
null
null
giorgidze/YampaSynth
src/Player/OpenAL.hs
bsd-3-clause
initOpenAL :: Int -> IO (Device, Context, Source, [Buffer]) initOpenAL numBuffs = do mDevice <- openDevice Nothing case mDevice of Nothing -> fail "opening OpenAL device" Just device -> do mContext <- createContext device [] case mContext of Nothing -> fail "opening OpenAL context" Just context -> do currentContext $= Just context [pSource] <- genObjectNames 1 pBuffers <- genObjectNames numBuffs printErrs return (device,context,pSource,pBuffers)
539
initOpenAL :: Int -> IO (Device, Context, Source, [Buffer]) initOpenAL numBuffs = do mDevice <- openDevice Nothing case mDevice of Nothing -> fail "opening OpenAL device" Just device -> do mContext <- createContext device [] case mContext of Nothing -> fail "opening OpenAL context" Just context -> do currentContext $= Just context [pSource] <- genObjectNames 1 pBuffers <- genObjectNames numBuffs printErrs return (device,context,pSource,pBuffers)
539
initOpenAL numBuffs = do mDevice <- openDevice Nothing case mDevice of Nothing -> fail "opening OpenAL device" Just device -> do mContext <- createContext device [] case mContext of Nothing -> fail "opening OpenAL context" Just context -> do currentContext $= Just context [pSource] <- genObjectNames 1 pBuffers <- genObjectNames numBuffs printErrs return (device,context,pSource,pBuffers)
479
false
true
0
20
152
170
78
92
null
null
AlbinTheander/oden
src/Oden/Go/Importer.hs
mit
convertType (Slice t) = Poly.TSlice missing <$> convertType t
61
convertType (Slice t) = Poly.TSlice missing <$> convertType t
61
convertType (Slice t) = Poly.TSlice missing <$> convertType t
61
false
false
0
7
8
28
12
16
null
null
comonoidial/ALFIN
Alfin/Optimize.hs
mit
preOptimM :: String -> Module -> Module preOptimM main (Module m ds fs) = Module m ds fs'' where fs' = map preOptimFun fs rfs = transReachFun [FunName (m ++ "." ++ main)] (fromList $ map reachableFuns fs') fs'' = filter (\(Definition f _ _ _) -> f `elem` rfs) fs'
269
preOptimM :: String -> Module -> Module preOptimM main (Module m ds fs) = Module m ds fs'' where fs' = map preOptimFun fs rfs = transReachFun [FunName (m ++ "." ++ main)] (fromList $ map reachableFuns fs') fs'' = filter (\(Definition f _ _ _) -> f `elem` rfs) fs'
269
preOptimM main (Module m ds fs) = Module m ds fs'' where fs' = map preOptimFun fs rfs = transReachFun [FunName (m ++ "." ++ main)] (fromList $ map reachableFuns fs') fs'' = filter (\(Definition f _ _ _) -> f `elem` rfs) fs'
229
false
true
0
12
56
128
66
62
null
null
futtetennista/IntroductionToFunctionalProgramming
RWH/src/Ch26/src/BloomFilter/Immutable.hs
mit
notElem :: a -> IBloom a -> Bool x `notElem` filt = not (x `elem` filt)
73
notElem :: a -> IBloom a -> Bool x `notElem` filt = not (x `elem` filt)
73
x `notElem` filt = not (x `elem` filt)
40
false
true
1
8
17
44
21
23
null
null
GetShopTV/smsaero
src/SMSAero/Client.hs
bsd-3-clause
-- | Add a phone number to blacklist. smsAeroAddToBlacklist :: SMSAeroAuth -- ^ Authentication data (login and MD5 hash of password) -> Phone -- ^ Phone number to be added to blacklist. -> SmsAero BlacklistResponse smsAeroSend auth = let (f :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _) = smsAeroClient auth in f
398
smsAeroAddToBlacklist :: SMSAeroAuth -- ^ Authentication data (login and MD5 hash of password) -> Phone -- ^ Phone number to be added to blacklist. -> SmsAero BlacklistResponse smsAeroSend auth = let (f :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _) = smsAeroClient auth in f
359
smsAeroSend auth = let (f :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _ :<|> _) = smsAeroClient auth in f
132
true
true
0
19
125
86
43
43
null
null
tjakway/ghcjvm
compiler/simplCore/CoreMonad.hs
bsd-3-clause
tickString (CaseElim _) = "CaseElim"
52
tickString (CaseElim _) = "CaseElim"
52
tickString (CaseElim _) = "CaseElim"
52
false
false
0
7
20
15
7
8
null
null
jean-lopes/universal-machine
src/UniversalMachine.hs
mit
findTransition :: State -> Symbol -> [Transition] -> Either RunTimeError Transition findTransition state symbol transitions = do let ts = List.filter (transitionFilter state symbol) transitions if List.null ts then Left $ NoSuchTransition state symbol else if List.length ts > 1 then Left $ MultipleTransitionsFound state symbol ts else Right $ head ts
408
findTransition :: State -> Symbol -> [Transition] -> Either RunTimeError Transition findTransition state symbol transitions = do let ts = List.filter (transitionFilter state symbol) transitions if List.null ts then Left $ NoSuchTransition state symbol else if List.length ts > 1 then Left $ MultipleTransitionsFound state symbol ts else Right $ head ts
408
findTransition state symbol transitions = do let ts = List.filter (transitionFilter state symbol) transitions if List.null ts then Left $ NoSuchTransition state symbol else if List.length ts > 1 then Left $ MultipleTransitionsFound state symbol ts else Right $ head ts
324
false
true
0
12
107
122
59
63
null
null
akc/sym
Sym/Perm/D8.hs
bsd-3-clause
-- | Reflection through the anti-diagonal. s3 :: Perm -> Perm s3 = s1 . r1
74
s3 :: Perm -> Perm s3 = s1 . r1
31
s3 = s1 . r1
12
true
true
1
7
15
28
12
16
null
null
mhuesch/scheme_compiler
src/Liveness/Liveness.hs
bsd-3-clause
makeSlot :: [Instruction] -> Int -> LiveSlot makeSlot ls idx = LiveSlot (ls !! idx) S.empty S.empty (findSuccessors ls idx)
123
makeSlot :: [Instruction] -> Int -> LiveSlot makeSlot ls idx = LiveSlot (ls !! idx) S.empty S.empty (findSuccessors ls idx)
123
makeSlot ls idx = LiveSlot (ls !! idx) S.empty S.empty (findSuccessors ls idx)
78
false
true
0
7
19
55
28
27
null
null
facebookincubator/duckling
Duckling/Time/NL/Rules.hs
bsd-3-clause
ruleTheOrdinalCycleAfterTime :: Rule ruleTheOrdinalCycleAfterTime = Rule { name = "the <ordinal> <cycle> after <time>" , pattern = [ regex "de|het" , dimension Ordinal , dimension TimeGrain , regex "na" , dimension Time ] , prod = \tokens -> case tokens of (_:Token Ordinal od:Token TimeGrain grain:_:Token Time td:_) -> tt $ cycleNthAfter True grain (TOrdinal.value od - 1) td _ -> Nothing }
444
ruleTheOrdinalCycleAfterTime :: Rule ruleTheOrdinalCycleAfterTime = Rule { name = "the <ordinal> <cycle> after <time>" , pattern = [ regex "de|het" , dimension Ordinal , dimension TimeGrain , regex "na" , dimension Time ] , prod = \tokens -> case tokens of (_:Token Ordinal od:Token TimeGrain grain:_:Token Time td:_) -> tt $ cycleNthAfter True grain (TOrdinal.value od - 1) td _ -> Nothing }
444
ruleTheOrdinalCycleAfterTime = Rule { name = "the <ordinal> <cycle> after <time>" , pattern = [ regex "de|het" , dimension Ordinal , dimension TimeGrain , regex "na" , dimension Time ] , prod = \tokens -> case tokens of (_:Token Ordinal od:Token TimeGrain grain:_:Token Time td:_) -> tt $ cycleNthAfter True grain (TOrdinal.value od - 1) td _ -> Nothing }
407
false
true
0
18
114
149
76
73
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP :: GLenum gl_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8162
96
gl_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP :: GLenum gl_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8162
96
gl_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8162
47
false
true
0
4
5
11
6
5
null
null
dylex/wai
warp/Network/Wai/Handler/Warp/Header.hs
mit
requestKeyIndex "connection" = idxConnection
51
requestKeyIndex "connection" = idxConnection
51
requestKeyIndex "connection" = idxConnection
51
false
false
0
5
10
9
4
5
null
null
huggablemonad/smooch
app/src/ParseCel.hs
gpl-3.0
-- | Return the number of cel pixels. -- -- Under normal circumstances, there shouldn't be any need to call this -- function. It's intended for testing purposes only. lengthCelPixels :: CelPixels -> Int lengthCelPixels (CelPixels celPixels) = fromIntegral (BSL.length celPixels)
278
lengthCelPixels :: CelPixels -> Int lengthCelPixels (CelPixels celPixels) = fromIntegral (BSL.length celPixels)
111
lengthCelPixels (CelPixels celPixels) = fromIntegral (BSL.length celPixels)
75
true
true
0
8
40
39
21
18
null
null
danpalmer/trac-to-phabricator
src/Trac.hs
bsd-3-clause
parseList :: Text -> [Text] parseList = map T.strip . T.splitOn ","
67
parseList :: Text -> [Text] parseList = map T.strip . T.splitOn ","
67
parseList = map T.strip . T.splitOn ","
39
false
true
1
8
11
39
17
22
null
null
soupi/pureli
src/Language/Pureli/Utils.hs
bsd-3-clause
rapInEnv _ e@(WithMD _ (ENVEXPR _ _)) = e
42
wrapInEnv _ e@(WithMD _ (ENVEXPR _ _)) = e
42
wrapInEnv _ e@(WithMD _ (ENVEXPR _ _)) = e
42
false
false
0
10
9
30
15
15
null
null
massysett/prednote
tests/Prednote/Core/Properties.hs
bsd-3-clause
prop_orIsLazyInSecondArgument i = testInt (true ||| undefined) i || True
74
prop_orIsLazyInSecondArgument i = testInt (true ||| undefined) i || True
74
prop_orIsLazyInSecondArgument i = testInt (true ||| undefined) i || True
74
false
false
0
8
11
26
12
14
null
null
jonschoning/pinboard
src/Pinboard/Logging.hs
mit
toText :: Show a => a -> Text toText = T.pack . show
56
toText :: Show a => a -> Text toText = T.pack . show
56
toText = T.pack . show
22
false
true
0
8
16
35
15
20
null
null
forste/haReFork
refactorer/PwPf/GlobalPW.hs
bsd-3-clause
global2core (Letrec str t1 t2) = let func = (Fix (Abstr str (global2core t1))) in (Abstr str (global2core t2)) :@: func
136
global2core (Letrec str t1 t2) = let func = (Fix (Abstr str (global2core t1))) in (Abstr str (global2core t2)) :@: func
136
global2core (Letrec str t1 t2) = let func = (Fix (Abstr str (global2core t1))) in (Abstr str (global2core t2)) :@: func
136
false
false
0
14
37
69
33
36
null
null
sushantmahajan/programs
haskell-work/haskell/parser_.hs
cc0-1.0
sptoken t = determ (sp *> (token t) <* sp)
42
sptoken t = determ (sp *> (token t) <* sp)
42
sptoken t = determ (sp *> (token t) <* sp)
42
false
false
1
10
9
32
14
18
null
null
DrSLDR/logoff
src/Logoff.hs
mit
buCombinePairCoerce :: [Formula] -> ProofTree -> Maybe (ProofTree, Formula) buCombinePairCoerce [] _ = Nothing
110
buCombinePairCoerce :: [Formula] -> ProofTree -> Maybe (ProofTree, Formula) buCombinePairCoerce [] _ = Nothing
110
buCombinePairCoerce [] _ = Nothing
34
false
true
0
8
13
38
20
18
null
null
juhp/stack
src/Stack/Types/Build.hs
bsd-3-clause
-- | Render a @BaseConfigOpts@ to an actual list of options configureOpts :: EnvConfig -> BaseConfigOpts -> Map PackageIdentifier GhcPkgId -- ^ dependencies -> Bool -- ^ local non-extra-dep? -> IsMutable -> Package -> ConfigureOpts configureOpts econfig bco deps isLocal isMutable package = ConfigureOpts { coDirs = configureOptsDirs bco isMutable package , coNoDirs = configureOptsNoDir econfig bco deps isLocal package }
518
configureOpts :: EnvConfig -> BaseConfigOpts -> Map PackageIdentifier GhcPkgId -- ^ dependencies -> Bool -- ^ local non-extra-dep? -> IsMutable -> Package -> ConfigureOpts configureOpts econfig bco deps isLocal isMutable package = ConfigureOpts { coDirs = configureOptsDirs bco isMutable package , coNoDirs = configureOptsNoDir econfig bco deps isLocal package }
458
configureOpts econfig bco deps isLocal isMutable package = ConfigureOpts { coDirs = configureOptsDirs bco isMutable package , coNoDirs = configureOptsNoDir econfig bco deps isLocal package }
202
true
true
0
12
156
97
48
49
null
null
lostbean/VirMat
src/VirMat/IO/Export/ANG/RasterEngine.hs
gpl-3.0
-- ================================= Fast rasterization ================================== getSegSlope :: Vec2D -> Vec2D -> Double getSegSlope (Vec2 v1x v1y) (Vec2 v2x v2y) = (v2x - v1x) / (v2y - v1y)
201
getSegSlope :: Vec2D -> Vec2D -> Double getSegSlope (Vec2 v1x v1y) (Vec2 v2x v2y) = (v2x - v1x) / (v2y - v1y)
109
getSegSlope (Vec2 v1x v1y) (Vec2 v2x v2y) = (v2x - v1x) / (v2y - v1y)
69
true
true
0
10
27
65
32
33
null
null
rahulmutt/ghcvm
compiler/Eta/Utils/Pretty.hs
bsd-3-clause
doubleQuotes p = char '"' <> p <> char '"'
43
doubleQuotes p = char '"' <> p <> char '"'
43
doubleQuotes p = char '"' <> p <> char '"'
43
false
false
0
7
10
23
10
13
null
null
ony/hledger
hledger-lib/Hledger/Query.hs
gpl-3.0
parseQueryTerm _ (T.stripPrefix "amt:" -> Just s) = Left $ Amt ord q where (ord, q) = parseAmountQueryTerm s
108
parseQueryTerm _ (T.stripPrefix "amt:" -> Just s) = Left $ Amt ord q where (ord, q) = parseAmountQueryTerm s
108
parseQueryTerm _ (T.stripPrefix "amt:" -> Just s) = Left $ Amt ord q where (ord, q) = parseAmountQueryTerm s
108
false
false
0
9
18
52
25
27
null
null
GaloisInc/HaNS
src/Hans/Dns/Packet.hs
bsd-3-clause
putType MD = putWord16be 3
29
putType MD = putWord16be 3
29
putType MD = putWord16be 3
29
false
false
0
5
7
12
5
7
null
null
fedora-haskell/fedora-haskell-tools
src/RPM.hs
gpl-3.0
rpmspec :: [String] -> Maybe String -> FilePath -> IO [String] rpmspec args = S.rpmspec (["--define", "ghc_version any"] ++ args)
131
rpmspec :: [String] -> Maybe String -> FilePath -> IO [String] rpmspec args = S.rpmspec (["--define", "ghc_version any"] ++ args)
131
rpmspec args = S.rpmspec (["--define", "ghc_version any"] ++ args)
68
false
true
0
9
21
56
29
27
null
null
tolysz/prepare-ghcjs
spec-lts8/base/Data/Data.hs
bsd-3-clause
lastConstr :: Constr lastConstr = mkConstr lastDataType "Last" ["getLast"] Prefix
81
lastConstr :: Constr lastConstr = mkConstr lastDataType "Last" ["getLast"] Prefix
81
lastConstr = mkConstr lastDataType "Last" ["getLast"] Prefix
60
false
true
0
6
9
29
13
16
null
null
dec9ue/jhc_copygc
src/FrontEnd/Tc/Class.hs
gpl-2.0
freeMetaVarsPred :: Pred -> Set.Set MetaVar freeMetaVarsPred (IsIn _ t) = freeMetaVars t
88
freeMetaVarsPred :: Pred -> Set.Set MetaVar freeMetaVarsPred (IsIn _ t) = freeMetaVars t
88
freeMetaVarsPred (IsIn _ t) = freeMetaVars t
44
false
true
0
9
12
38
17
21
null
null
b1g3ar5/Spreadsheet
SpreadsheetTest.hs
mit
testCirc :: String -> Ref -> Sheet String -> Fix Cell testCirc str ref ss = f ltest where -- Parse sheet to functions whcih return True/False - whether it depends on ref ptest :: Sheet CellFn ptest = parseRefsSheet ss -- Apply the CellFns - with ref cell replaced by True ltest :: Sheet (Fix Cell) ltest = loeb $ ptest//[(ref, bval True)] -- Parse the input string f :: CellFn f = either (const $ sval "Parse error") id $ parse refexpr "" str
518
testCirc :: String -> Ref -> Sheet String -> Fix Cell testCirc str ref ss = f ltest where -- Parse sheet to functions whcih return True/False - whether it depends on ref ptest :: Sheet CellFn ptest = parseRefsSheet ss -- Apply the CellFns - with ref cell replaced by True ltest :: Sheet (Fix Cell) ltest = loeb $ ptest//[(ref, bval True)] -- Parse the input string f :: CellFn f = either (const $ sval "Parse error") id $ parse refexpr "" str
518
testCirc str ref ss = f ltest where -- Parse sheet to functions whcih return True/False - whether it depends on ref ptest :: Sheet CellFn ptest = parseRefsSheet ss -- Apply the CellFns - with ref cell replaced by True ltest :: Sheet (Fix Cell) ltest = loeb $ ptest//[(ref, bval True)] -- Parse the input string f :: CellFn f = either (const $ sval "Parse error") id $ parse refexpr "" str
464
false
true
0
11
161
135
69
66
null
null
dysinger/amazonka
amazonka-rds/gen/Network/AWS/RDS/DescribePendingMaintenanceActions.hs
mpl-2.0
-- | An optional pagination token provided by a previous 'DescribePendingMaintenanceActions' request. If this parameter is specified, the response includes only records -- beyond the marker, up to a number of records specified by 'MaxRecords' . dpmaMarker :: Lens' DescribePendingMaintenanceActions (Maybe Text) dpmaMarker = lens _dpmaMarker (\s a -> s { _dpmaMarker = a })
373
dpmaMarker :: Lens' DescribePendingMaintenanceActions (Maybe Text) dpmaMarker = lens _dpmaMarker (\s a -> s { _dpmaMarker = a })
128
dpmaMarker = lens _dpmaMarker (\s a -> s { _dpmaMarker = a })
61
true
true
0
9
54
47
26
21
null
null
forste/haReFork
tools/base/AST/HsModuleMaps.hs
bsd-3-clause
mapExpMN f (ModuleE m) = ModuleE (f m)
38
mapExpMN f (ModuleE m) = ModuleE (f m)
38
mapExpMN f (ModuleE m) = ModuleE (f m)
38
false
false
0
7
7
28
12
16
null
null
Daniel-Diaz/Clipboard
System/Clipboard/X11.hs
bsd-3-clause
handleOutput :: Display -> Window -> Atom -> Maybe String -> [CUChar] -> IO Atom handleOutput display req prop (Just "UTF8_STRING") str = do prop' <- getAtomName display prop if isNothing prop' then handleOutput display req prop Nothing str else do target <- internAtom display "UTF8_STRING" True void $ withArrayLen str $ \len str' -> xChangeProperty display req prop target 8 propModeReplace str' (fromIntegral len) return prop
501
handleOutput :: Display -> Window -> Atom -> Maybe String -> [CUChar] -> IO Atom handleOutput display req prop (Just "UTF8_STRING") str = do prop' <- getAtomName display prop if isNothing prop' then handleOutput display req prop Nothing str else do target <- internAtom display "UTF8_STRING" True void $ withArrayLen str $ \len str' -> xChangeProperty display req prop target 8 propModeReplace str' (fromIntegral len) return prop
501
handleOutput display req prop (Just "UTF8_STRING") str = do prop' <- getAtomName display prop if isNothing prop' then handleOutput display req prop Nothing str else do target <- internAtom display "UTF8_STRING" True void $ withArrayLen str $ \len str' -> xChangeProperty display req prop target 8 propModeReplace str' (fromIntegral len) return prop
420
false
true
0
15
138
163
75
88
null
null
ml9951/ghc
compiler/cmm/CmmUtils.hs
bsd-3-clause
isTrivialCmmExpr (CmmLit _) = True
42
isTrivialCmmExpr (CmmLit _) = True
42
isTrivialCmmExpr (CmmLit _) = True
42
false
false
0
7
12
15
7
8
null
null
HalosGhost/hs
numbers/roman.hs
isc
dispatch :: Config -> IO () dispatch c@(Config h cm fm st) | help c = usage >> exitWith ExitSuccess | elem 't' cm = putStr $ ioMap ((toRoman fm) . read) | elem 'f' cm = putStr $ ioMap (show . (fromRoman fm)) | otherwise = usage >> exitWith (ExitFailure 1) where ioMap f = unlines $ map f st
307
dispatch :: Config -> IO () dispatch c@(Config h cm fm st) | help c = usage >> exitWith ExitSuccess | elem 't' cm = putStr $ ioMap ((toRoman fm) . read) | elem 'f' cm = putStr $ ioMap (show . (fromRoman fm)) | otherwise = usage >> exitWith (ExitFailure 1) where ioMap f = unlines $ map f st
307
dispatch c@(Config h cm fm st) | help c = usage >> exitWith ExitSuccess | elem 't' cm = putStr $ ioMap ((toRoman fm) . read) | elem 'f' cm = putStr $ ioMap (show . (fromRoman fm)) | otherwise = usage >> exitWith (ExitFailure 1) where ioMap f = unlines $ map f st
279
false
true
21
9
77
154
77
77
null
null
vincenthz/hs-foundation
basement/Basement/Types/Char7.hs
bsd-3-clause
c7_minus :: Char7 c7_minus = Char7 0x2d
39
c7_minus :: Char7 c7_minus = Char7 0x2d
39
c7_minus = Char7 0x2d
21
false
true
0
5
6
14
7
7
null
null
Cortlandd/haskell-opencv
src/OpenCV/Core/Types/Mat/HMat.hs
bsd-3-clause
product0 :: (Num a) => [a] -> a product0 [] = 0
47
product0 :: (Num a) => [a] -> a product0 [] = 0
47
product0 [] = 0
15
false
true
0
7
11
32
17
15
null
null
jcpetruzza/haskell-ast
src/Language/Haskell/AST/Core.hs
bsd-3-clause
unit_con_name :: l -> QName id l unit_con_name l = Special l (UnitCon l)
72
unit_con_name :: l -> QName id l unit_con_name l = Special l (UnitCon l)
72
unit_con_name l = Special l (UnitCon l)
39
false
true
0
7
13
38
17
21
null
null
Soostone/uri-bytestring
src/URI/ByteString/Internal.hs
bsd-3-clause
------------------------------------------------------------------------------- -- | ByteString Utilities ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- | Decoding specifically for the query string, which decodes + as -- space. Shorthand for @urlDecode True@ urlDecodeQuery :: ByteString -> ByteString urlDecodeQuery = urlDecode plusToSpace where plusToSpace = True ------------------------------------------------------------------------------- -- | Decode any part of the URL besides the query, which decodes + as -- space.
651
urlDecodeQuery :: ByteString -> ByteString urlDecodeQuery = urlDecode plusToSpace where plusToSpace = True ------------------------------------------------------------------------------- -- | Decode any part of the URL besides the query, which decodes + as -- space.
274
urlDecodeQuery = urlDecode plusToSpace where plusToSpace = True ------------------------------------------------------------------------------- -- | Decode any part of the URL besides the query, which decodes + as -- space.
231
true
true
0
5
65
35
22
13
null
null
bitemyapp/roshask
src/executable/Gen.hs
bsd-3-clause
genSrvInfo :: Srv -> Msg -> MsgInfo ByteString genSrvInfo s m = fmap aux (srvMD5 s) where aux md5 = B.concat ["instance SrvInfo ", pack (shortName m), " where\n srvMD5 _ = \"", pack md5, "\"\n srvTypeName _ = \"", pack (fullRosSrvName s), "\"\n\n"]
336
genSrvInfo :: Srv -> Msg -> MsgInfo ByteString genSrvInfo s m = fmap aux (srvMD5 s) where aux md5 = B.concat ["instance SrvInfo ", pack (shortName m), " where\n srvMD5 _ = \"", pack md5, "\"\n srvTypeName _ = \"", pack (fullRosSrvName s), "\"\n\n"]
336
genSrvInfo s m = fmap aux (srvMD5 s) where aux md5 = B.concat ["instance SrvInfo ", pack (shortName m), " where\n srvMD5 _ = \"", pack md5, "\"\n srvTypeName _ = \"", pack (fullRosSrvName s), "\"\n\n"]
289
false
true
0
9
131
100
49
51
null
null
yesodweb/shakespeare
Text/Hamlet/Parse.hs
mit
xhtmlCloseStyle :: String -> CloseStyle xhtmlCloseStyle s = if Set.member s htmlEmptyTags then CloseInside else CloseSeparate
145
xhtmlCloseStyle :: String -> CloseStyle xhtmlCloseStyle s = if Set.member s htmlEmptyTags then CloseInside else CloseSeparate
145
xhtmlCloseStyle s = if Set.member s htmlEmptyTags then CloseInside else CloseSeparate
105
false
true
0
7
35
33
17
16
null
null
trskop/cabal
cabal-install/Distribution/Client/Sandbox.hs
bsd-3-clause
withSandboxPackageInfo :: Verbosity -> ConfigFlags -> GlobalFlags -> Compiler -> Platform -> ProgramConfiguration -> FilePath -> (SandboxPackageInfo -> IO ()) -> IO () withSandboxPackageInfo verbosity configFlags globalFlags comp platform conf sandboxDir cont = do -- List all add-source deps. indexFile <- tryGetIndexFilePath' globalFlags buildTreeRefs <- Index.listBuildTreeRefs verbosity Index.DontListIgnored Index.OnlyLinks indexFile let allAddSourceDepsSet = S.fromList buildTreeRefs -- List all packages installed in the sandbox. installedPkgIndex <- getInstalledPackagesInSandbox verbosity configFlags comp conf let err = "Error reading sandbox package information." -- Get the package descriptions for all add-source deps. depsCabalFiles <- mapM (flip tryFindAddSourcePackageDesc err) buildTreeRefs depsPkgDescs <- mapM (readPackageDescription verbosity) depsCabalFiles let depsMap = M.fromList (zip buildTreeRefs depsPkgDescs) isInstalled pkgid = not . null . InstalledPackageIndex.lookupSourcePackageId installedPkgIndex $ pkgid installedDepsMap = M.filter (isInstalled . packageId) depsMap -- Get the package ids of modified (and installed) add-source deps. modifiedAddSourceDeps <- listModifiedDeps verbosity sandboxDir (compilerId comp) platform installedDepsMap -- 'fromJust' here is safe because 'modifiedAddSourceDeps' are guaranteed to -- be a subset of the keys of 'depsMap'. let modifiedDeps = [ (modDepPath, fromJust $ M.lookup modDepPath depsMap) | modDepPath <- modifiedAddSourceDeps ] modifiedDepsMap = M.fromList modifiedDeps assert (all (`S.member` allAddSourceDepsSet) modifiedAddSourceDeps) (return ()) if (null modifiedDeps) then info verbosity $ "Found no modified add-source deps." else notice verbosity $ "Some add-source dependencies have been modified. " ++ "They will be reinstalled..." -- Get the package ids of the remaining add-source deps (some are possibly not -- installed). let otherDeps = M.assocs (depsMap `M.difference` modifiedDepsMap) -- Finally, assemble a 'SandboxPackageInfo'. cont $ SandboxPackageInfo (map toSourcePackage modifiedDeps) (map toSourcePackage otherDeps) installedPkgIndex allAddSourceDepsSet where toSourcePackage (path, pkgDesc) = SourcePackage (packageId pkgDesc) pkgDesc (LocalUnpackedPackage path) Nothing -- | Same as 'withSandboxPackageInfo' if we're inside a sandbox and the -- identity otherwise.
2,770
withSandboxPackageInfo :: Verbosity -> ConfigFlags -> GlobalFlags -> Compiler -> Platform -> ProgramConfiguration -> FilePath -> (SandboxPackageInfo -> IO ()) -> IO () withSandboxPackageInfo verbosity configFlags globalFlags comp platform conf sandboxDir cont = do -- List all add-source deps. indexFile <- tryGetIndexFilePath' globalFlags buildTreeRefs <- Index.listBuildTreeRefs verbosity Index.DontListIgnored Index.OnlyLinks indexFile let allAddSourceDepsSet = S.fromList buildTreeRefs -- List all packages installed in the sandbox. installedPkgIndex <- getInstalledPackagesInSandbox verbosity configFlags comp conf let err = "Error reading sandbox package information." -- Get the package descriptions for all add-source deps. depsCabalFiles <- mapM (flip tryFindAddSourcePackageDesc err) buildTreeRefs depsPkgDescs <- mapM (readPackageDescription verbosity) depsCabalFiles let depsMap = M.fromList (zip buildTreeRefs depsPkgDescs) isInstalled pkgid = not . null . InstalledPackageIndex.lookupSourcePackageId installedPkgIndex $ pkgid installedDepsMap = M.filter (isInstalled . packageId) depsMap -- Get the package ids of modified (and installed) add-source deps. modifiedAddSourceDeps <- listModifiedDeps verbosity sandboxDir (compilerId comp) platform installedDepsMap -- 'fromJust' here is safe because 'modifiedAddSourceDeps' are guaranteed to -- be a subset of the keys of 'depsMap'. let modifiedDeps = [ (modDepPath, fromJust $ M.lookup modDepPath depsMap) | modDepPath <- modifiedAddSourceDeps ] modifiedDepsMap = M.fromList modifiedDeps assert (all (`S.member` allAddSourceDepsSet) modifiedAddSourceDeps) (return ()) if (null modifiedDeps) then info verbosity $ "Found no modified add-source deps." else notice verbosity $ "Some add-source dependencies have been modified. " ++ "They will be reinstalled..." -- Get the package ids of the remaining add-source deps (some are possibly not -- installed). let otherDeps = M.assocs (depsMap `M.difference` modifiedDepsMap) -- Finally, assemble a 'SandboxPackageInfo'. cont $ SandboxPackageInfo (map toSourcePackage modifiedDeps) (map toSourcePackage otherDeps) installedPkgIndex allAddSourceDepsSet where toSourcePackage (path, pkgDesc) = SourcePackage (packageId pkgDesc) pkgDesc (LocalUnpackedPackage path) Nothing -- | Same as 'withSandboxPackageInfo' if we're inside a sandbox and the -- identity otherwise.
2,770
withSandboxPackageInfo verbosity configFlags globalFlags comp platform conf sandboxDir cont = do -- List all add-source deps. indexFile <- tryGetIndexFilePath' globalFlags buildTreeRefs <- Index.listBuildTreeRefs verbosity Index.DontListIgnored Index.OnlyLinks indexFile let allAddSourceDepsSet = S.fromList buildTreeRefs -- List all packages installed in the sandbox. installedPkgIndex <- getInstalledPackagesInSandbox verbosity configFlags comp conf let err = "Error reading sandbox package information." -- Get the package descriptions for all add-source deps. depsCabalFiles <- mapM (flip tryFindAddSourcePackageDesc err) buildTreeRefs depsPkgDescs <- mapM (readPackageDescription verbosity) depsCabalFiles let depsMap = M.fromList (zip buildTreeRefs depsPkgDescs) isInstalled pkgid = not . null . InstalledPackageIndex.lookupSourcePackageId installedPkgIndex $ pkgid installedDepsMap = M.filter (isInstalled . packageId) depsMap -- Get the package ids of modified (and installed) add-source deps. modifiedAddSourceDeps <- listModifiedDeps verbosity sandboxDir (compilerId comp) platform installedDepsMap -- 'fromJust' here is safe because 'modifiedAddSourceDeps' are guaranteed to -- be a subset of the keys of 'depsMap'. let modifiedDeps = [ (modDepPath, fromJust $ M.lookup modDepPath depsMap) | modDepPath <- modifiedAddSourceDeps ] modifiedDepsMap = M.fromList modifiedDeps assert (all (`S.member` allAddSourceDepsSet) modifiedAddSourceDeps) (return ()) if (null modifiedDeps) then info verbosity $ "Found no modified add-source deps." else notice verbosity $ "Some add-source dependencies have been modified. " ++ "They will be reinstalled..." -- Get the package ids of the remaining add-source deps (some are possibly not -- installed). let otherDeps = M.assocs (depsMap `M.difference` modifiedDepsMap) -- Finally, assemble a 'SandboxPackageInfo'. cont $ SandboxPackageInfo (map toSourcePackage modifiedDeps) (map toSourcePackage otherDeps) installedPkgIndex allAddSourceDepsSet where toSourcePackage (path, pkgDesc) = SourcePackage (packageId pkgDesc) pkgDesc (LocalUnpackedPackage path) Nothing -- | Same as 'withSandboxPackageInfo' if we're inside a sandbox and the -- identity otherwise.
2,498
false
true
0
16
683
495
245
250
null
null
mainland/nikola
src/Data/Array/Nikola/Language/Syntax.hs
bsd-3-clause
isAtomicE (ConstE {}) = True
33
isAtomicE (ConstE {}) = True
33
isAtomicE (ConstE {}) = True
33
false
false
0
6
9
17
8
9
null
null
brooksbp/P4
src/Language/P4/Sema.hs
apache-2.0
extractAaSEMAs :: Program -> [String] extractAaSEMAs = query extractAaSEMA . query extractActionArgs
100
extractAaSEMAs :: Program -> [String] extractAaSEMAs = query extractAaSEMA . query extractActionArgs
100
extractAaSEMAs = query extractAaSEMA . query extractActionArgs
62
false
true
0
6
11
28
14
14
null
null
thoughtpolice/hs-noise
src/Crypto/Encrypt/Noise.hs
mit
-------------------------------------------------------------------------------- -- Box API {- $boxes Noise boxes encrypt standalone messages to a receiver identified by a public key. When used, they have the following properties: [@Sender forward secret@] After encryption of a Noise box, only the recipient can decrypt it (the sender cannot). [@Deniable@] The recipient of a Noise box can authenticate the sender, but cannot produce digitally-signed evidence binding the sender to anything. [@Identity hiding@] Noise boxes reveal no information about the sender or recipient to a 3rd-party observer. [@High speed@] Noise usues high-speed curves and ciphers designed by Dan Bernstein. [@Padded@] Noise ciphertext can be padded to avoid leaking plaintext lengths. [@Built on \"Encrypt-then-MAC\" authenticated encryption@] Any tampering with ciphertext will cause the recipient to reject the ciphertext prior to decryption. Internally, Noise uses SHA512, ChaCha20/8, Poly1305, and an ECDHE function. (As of this writing, this package uses Curve25519. The true specification mandates Curve41417, which features a higher, > 200 bit security level.) -} -- | Encrypt a piece of data under a keypair for a specific -- receiver. The optional padding length specifies how much extra -- random data the underlying box will be padded with. A box adds a -- minimum of 100 bytes of overhead to the payload. -- -- Box lengths are not encoded in the output of standalone messages - -- you must encode them some other way after encrypting your data with -- @'seal'@ (e.g. explicitly in the encoding, or by using the file -- length). -- -- Note that the sender and receiver of a box, or either end of a pipe, -- may be anonymous. seal :: Maybe KeyPair -- ^ Sender keys -> PublicKey Noise -- ^ Receiver public key -> Word32 -- ^ Padding length -> ByteString -- ^ Plaintext -> IO ByteString seal sender recvPK pad plaintext = do eph <- createKeypair fst <$> box_ Nothing eph sender recvPK pad plaintext -- | Open an encrypted box created with @'seal'@ using a secret key, -- optionally authenticating against a known public key of the sender. -- -- If the secret key of the sender is provided (i.e. they are not -- anonymous), then a box sent by any other sender will fail to open.
2,340
seal :: Maybe KeyPair -- ^ Sender keys -> PublicKey Noise -- ^ Receiver public key -> Word32 -- ^ Padding length -> ByteString -- ^ Plaintext -> IO ByteString seal sender recvPK pad plaintext = do eph <- createKeypair fst <$> box_ Nothing eph sender recvPK pad plaintext -- | Open an encrypted box created with @'seal'@ using a secret key, -- optionally authenticating against a known public key of the sender. -- -- If the secret key of the sender is provided (i.e. they are not -- anonymous), then a box sent by any other sender will fail to open.
601
seal sender recvPK pad plaintext = do eph <- createKeypair fst <$> box_ Nothing eph sender recvPK pad plaintext -- | Open an encrypted box created with @'seal'@ using a secret key, -- optionally authenticating against a known public key of the sender. -- -- If the secret key of the sender is provided (i.e. they are not -- anonymous), then a box sent by any other sender will fail to open.
395
true
true
0
9
443
96
57
39
null
null
alexander-at-github/eta
compiler/ETA/BasicTypes/DataCon.hs
bsd-3-clause
isBanged (HsSrcBang _ _ bang) = bang
36
isBanged (HsSrcBang _ _ bang) = bang
36
isBanged (HsSrcBang _ _ bang) = bang
36
false
false
0
7
6
19
9
10
null
null
m4rw3r/warframe-dmg-hs
src/armor.hs
mit
modifierForDamageOnArmor Damage.Slash Ferrite = -0.25
65
modifierForDamageOnArmor Damage.Slash Ferrite = -0.25
65
modifierForDamageOnArmor Damage.Slash Ferrite = -0.25
65
false
false
0
6
16
17
7
10
null
null
seereason/ghcjs
src/Compiler/GhcjsProgram.hs
mit
printBootInfo :: [String] -> IO () printBootInfo v | "--print-topdir" `elem` v = putStrLn t | "--print-libdir" `elem` v = putStrLn t | "--print-global-db" `elem` v = putStrLn (getGlobalPackageDB t) | "--print-user-db-dir" `elem` v = putStrLn . fromMaybe "<none>" =<< getUserPackageDir | "--print-default-libdir" `elem` v = putStrLn =<< getDefaultLibDir | "--print-default-topdir" `elem` v = putStrLn =<< getDefaultTopDir | "--print-native-too" `elem` v = print ("--native-too" `elem` v) | "--numeric-ghc-version" `elem` v = putStrLn getGhcCompilerVersion | "--print-rts-profiled" `elem` v = print rtsIsProfiled | otherwise = error "no --ghcjs-setup-print or --ghcjs-booting-print options found" where t = fromMaybe (error noTopDirErrorMsg) (getArgsTopDir v)
838
printBootInfo :: [String] -> IO () printBootInfo v | "--print-topdir" `elem` v = putStrLn t | "--print-libdir" `elem` v = putStrLn t | "--print-global-db" `elem` v = putStrLn (getGlobalPackageDB t) | "--print-user-db-dir" `elem` v = putStrLn . fromMaybe "<none>" =<< getUserPackageDir | "--print-default-libdir" `elem` v = putStrLn =<< getDefaultLibDir | "--print-default-topdir" `elem` v = putStrLn =<< getDefaultTopDir | "--print-native-too" `elem` v = print ("--native-too" `elem` v) | "--numeric-ghc-version" `elem` v = putStrLn getGhcCompilerVersion | "--print-rts-profiled" `elem` v = print rtsIsProfiled | otherwise = error "no --ghcjs-setup-print or --ghcjs-booting-print options found" where t = fromMaybe (error noTopDirErrorMsg) (getArgsTopDir v)
838
printBootInfo v | "--print-topdir" `elem` v = putStrLn t | "--print-libdir" `elem` v = putStrLn t | "--print-global-db" `elem` v = putStrLn (getGlobalPackageDB t) | "--print-user-db-dir" `elem` v = putStrLn . fromMaybe "<none>" =<< getUserPackageDir | "--print-default-libdir" `elem` v = putStrLn =<< getDefaultLibDir | "--print-default-topdir" `elem` v = putStrLn =<< getDefaultTopDir | "--print-native-too" `elem` v = print ("--native-too" `elem` v) | "--numeric-ghc-version" `elem` v = putStrLn getGhcCompilerVersion | "--print-rts-profiled" `elem` v = print rtsIsProfiled | otherwise = error "no --ghcjs-setup-print or --ghcjs-booting-print options found" where t = fromMaybe (error noTopDirErrorMsg) (getArgsTopDir v)
803
false
true
9
8
178
245
124
121
null
null
spacekitteh/smcghc
compiler/main/DynFlags.hs
bsd-3-clause
flagsAll :: [Flag (CmdLineP DynFlags)] flagsAll = package_flags ++ dynamic_flags
84
flagsAll :: [Flag (CmdLineP DynFlags)] flagsAll = package_flags ++ dynamic_flags
84
flagsAll = package_flags ++ dynamic_flags
45
false
true
0
8
13
27
14
13
null
null
dysinger/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/Types.hs
mpl-2.0
-- | 'InstancesCount' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'icAssigning' @::@ 'Maybe' 'Int' -- -- * 'icBooting' @::@ 'Maybe' 'Int' -- -- * 'icConnectionLost' @::@ 'Maybe' 'Int' -- -- * 'icDeregistering' @::@ 'Maybe' 'Int' -- -- * 'icOnline' @::@ 'Maybe' 'Int' -- -- * 'icPending' @::@ 'Maybe' 'Int' -- -- * 'icRebooting' @::@ 'Maybe' 'Int' -- -- * 'icRegistered' @::@ 'Maybe' 'Int' -- -- * 'icRegistering' @::@ 'Maybe' 'Int' -- -- * 'icRequested' @::@ 'Maybe' 'Int' -- -- * 'icRunningSetup' @::@ 'Maybe' 'Int' -- -- * 'icSetupFailed' @::@ 'Maybe' 'Int' -- -- * 'icShuttingDown' @::@ 'Maybe' 'Int' -- -- * 'icStartFailed' @::@ 'Maybe' 'Int' -- -- * 'icStopped' @::@ 'Maybe' 'Int' -- -- * 'icStopping' @::@ 'Maybe' 'Int' -- -- * 'icTerminated' @::@ 'Maybe' 'Int' -- -- * 'icTerminating' @::@ 'Maybe' 'Int' -- -- * 'icUnassigning' @::@ 'Maybe' 'Int' -- instancesCount :: InstancesCount instancesCount = InstancesCount { _icAssigning = Nothing , _icBooting = Nothing , _icConnectionLost = Nothing , _icDeregistering = Nothing , _icOnline = Nothing , _icPending = Nothing , _icRebooting = Nothing , _icRegistered = Nothing , _icRegistering = Nothing , _icRequested = Nothing , _icRunningSetup = Nothing , _icSetupFailed = Nothing , _icShuttingDown = Nothing , _icStartFailed = Nothing , _icStopped = Nothing , _icStopping = Nothing , _icTerminated = Nothing , _icTerminating = Nothing , _icUnassigning = Nothing }
1,612
instancesCount :: InstancesCount instancesCount = InstancesCount { _icAssigning = Nothing , _icBooting = Nothing , _icConnectionLost = Nothing , _icDeregistering = Nothing , _icOnline = Nothing , _icPending = Nothing , _icRebooting = Nothing , _icRegistered = Nothing , _icRegistering = Nothing , _icRequested = Nothing , _icRunningSetup = Nothing , _icSetupFailed = Nothing , _icShuttingDown = Nothing , _icStartFailed = Nothing , _icStopped = Nothing , _icStopping = Nothing , _icTerminated = Nothing , _icTerminating = Nothing , _icUnassigning = Nothing }
716
instancesCount = InstancesCount { _icAssigning = Nothing , _icBooting = Nothing , _icConnectionLost = Nothing , _icDeregistering = Nothing , _icOnline = Nothing , _icPending = Nothing , _icRebooting = Nothing , _icRegistered = Nothing , _icRegistering = Nothing , _icRequested = Nothing , _icRunningSetup = Nothing , _icSetupFailed = Nothing , _icShuttingDown = Nothing , _icStartFailed = Nothing , _icStopped = Nothing , _icStopping = Nothing , _icTerminated = Nothing , _icTerminating = Nothing , _icUnassigning = Nothing }
683
true
true
0
7
387
173
126
47
null
null
uduki/hsQt
demos/PathDeform.hs
bsd-2-clause
pdRenderer_modPathBounds :: PathDeformRenderer -> RectF -> IO () pdRenderer_modPathBounds pdr rect = modifyIORef (pdRr_m_pathBounds_io pdr) (\_ -> rect)
152
pdRenderer_modPathBounds :: PathDeformRenderer -> RectF -> IO () pdRenderer_modPathBounds pdr rect = modifyIORef (pdRr_m_pathBounds_io pdr) (\_ -> rect)
152
pdRenderer_modPathBounds pdr rect = modifyIORef (pdRr_m_pathBounds_io pdr) (\_ -> rect)
87
false
true
0
8
17
48
24
24
null
null
norm2782/uuagc
src-generated/InterfacesRules.hs
bsd-3-clause
sem_Interface :: Interface -> T_Interface sem_Interface ( Interface !nt_ !cons_ seg_ ) = sem_Interface_Interface nt_ cons_ ( sem_Segments seg_ )
146
sem_Interface :: Interface -> T_Interface sem_Interface ( Interface !nt_ !cons_ seg_ ) = sem_Interface_Interface nt_ cons_ ( sem_Segments seg_ )
145
sem_Interface ( Interface !nt_ !cons_ seg_ ) = sem_Interface_Interface nt_ cons_ ( sem_Segments seg_ )
102
false
true
0
8
21
43
20
23
null
null
yav/haskell-zipper
Data/Tree/Zipper.hs
mit
-- | Remove the tree at the current position. delete :: TreePos Full a -> TreePos Empty a delete loc = loc { _content = E }
123
delete :: TreePos Full a -> TreePos Empty a delete loc = loc { _content = E }
77
delete loc = loc { _content = E }
33
true
true
0
6
26
37
19
18
null
null
seni/copilot-libraries
src/Copilot/Library/Utils.hs
bsd-3-clause
cycle :: ( Typed a ) => [ a ] -> Stream a cycle ls = cycle' where cycle' = ls ++ cycle'
89
cycle :: ( Typed a ) => [ a ] -> Stream a cycle ls = cycle' where cycle' = ls ++ cycle'
89
cycle ls = cycle' where cycle' = ls ++ cycle'
47
false
true
3
8
24
54
24
30
null
null
sifisifi/subscribe-jpsubreddits
src/Main.hs
mit
getSubredditInfo :: [JPSS.Subreddit] -> IO [R.Subreddit] getSubredditInfo xs = catMaybes <$> mapM (f 5) xs where f :: Int -> JPSS.Subreddit -> IO (Maybe R.Subreddit) f n x | n > 0 = go x `catch` errHandler n x | otherwise = return Nothing go jps = do print jps let url = concat [ "http://www.reddit.com" , T.unpack $ JPSS.unUrl $ JPSS.url jps , "/about.json" ] threadDelay $ milliseconds 1000 ((R.thingData <$>) . A.decode) <$> simpleHttp url errHandler n jps (SomeException e) = do print e f (n - 1) jps -- | マイクロ秒からミリ秒へ変換
688
getSubredditInfo :: [JPSS.Subreddit] -> IO [R.Subreddit] getSubredditInfo xs = catMaybes <$> mapM (f 5) xs where f :: Int -> JPSS.Subreddit -> IO (Maybe R.Subreddit) f n x | n > 0 = go x `catch` errHandler n x | otherwise = return Nothing go jps = do print jps let url = concat [ "http://www.reddit.com" , T.unpack $ JPSS.unUrl $ JPSS.url jps , "/about.json" ] threadDelay $ milliseconds 1000 ((R.thingData <$>) . A.decode) <$> simpleHttp url errHandler n jps (SomeException e) = do print e f (n - 1) jps -- | マイクロ秒からミリ秒へ変換
688
getSubredditInfo xs = catMaybes <$> mapM (f 5) xs where f :: Int -> JPSS.Subreddit -> IO (Maybe R.Subreddit) f n x | n > 0 = go x `catch` errHandler n x | otherwise = return Nothing go jps = do print jps let url = concat [ "http://www.reddit.com" , T.unpack $ JPSS.unUrl $ JPSS.url jps , "/about.json" ] threadDelay $ milliseconds 1000 ((R.thingData <$>) . A.decode) <$> simpleHttp url errHandler n jps (SomeException e) = do print e f (n - 1) jps -- | マイクロ秒からミリ秒へ変換
631
false
true
2
14
258
259
121
138
null
null
brendanhay/gogol
gogol-sqladmin/gen/Network/Google/Resource/SQL/SSLCerts/Insert.hs
mpl-2.0
-- | Cloud SQL instance ID. This does not include the project ID. sciInstance :: Lens' SSLCertsInsert Text sciInstance = lens _sciInstance (\ s a -> s{_sciInstance = a})
171
sciInstance :: Lens' SSLCertsInsert Text sciInstance = lens _sciInstance (\ s a -> s{_sciInstance = a})
105
sciInstance = lens _sciInstance (\ s a -> s{_sciInstance = a})
64
true
true
1
9
30
44
22
22
null
null
graninas/Haskell-Algorithms
Tests/Robotics/Task1.hs
gpl-3.0
kikiStart = (4, 4)
18
kikiStart = (4, 4)
18
kikiStart = (4, 4)
18
false
false
0
5
3
12
7
5
null
null
bgwines/zora
Zora/List.hs
bsd-3-clause
interleave (a:as) (b:bs) = a : b : (interleave as bs)
53
interleave (a:as) (b:bs) = a : b : (interleave as bs)
53
interleave (a:as) (b:bs) = a : b : (interleave as bs)
53
false
false
0
7
10
41
21
20
null
null
iblumenfeld/cryptol
src/Cryptol/Prims/Eval.hs
bsd-3-clause
modWrap x y = x `mod` y
23
modWrap x y = x `mod` y
23
modWrap x y = x `mod` y
23
false
false
0
5
6
17
9
8
null
null
tolysz/postgresql-simple
src/Database/PostgreSQL/Simple/TypeInfo/Static.hs
bsd-3-clause
_tsrange :: TypeInfo _tsrange = Array { typoid = Oid 3909, typcategory = 'A', typdelim = ',', typname = "_tsrange", typelem = tsrange }
174
_tsrange :: TypeInfo _tsrange = Array { typoid = Oid 3909, typcategory = 'A', typdelim = ',', typname = "_tsrange", typelem = tsrange }
174
_tsrange = Array { typoid = Oid 3909, typcategory = 'A', typdelim = ',', typname = "_tsrange", typelem = tsrange }
153
false
true
0
7
62
46
28
18
null
null
OS2World/DEV-UTIL-HUGS
oldlib/RandList.hs
bsd-3-clause
foldl f e E = e
15
foldl f e E = e
15
foldl f e E = e
15
false
false
0
5
5
13
6
7
null
null
athanclark/happ-store
src/Handlers/People.hs
gpl-3.0
peopleViewHandle :: MonadApp m => T.Text -> MiddlewareT m peopleViewHandle x = action homeHandle
130
peopleViewHandle :: MonadApp m => T.Text -> MiddlewareT m peopleViewHandle x = action homeHandle
130
peopleViewHandle x = action homeHandle
38
false
true
0
7
47
33
15
18
null
null
DougBurke/swish
src/Swish/RDF/Vocabulary/SIOC.hs
lgpl-2.1
-- | @sioc:email@ from <http://rdfs.org/sioc/spec/#term_email>. siocemail :: ScopedName siocemail = toS "email"
112
siocemail :: ScopedName siocemail = toS "email"
47
siocemail = toS "email"
23
true
true
0
5
12
15
8
7
null
null
mikusp/accelerate-cuda
Data/Array/Accelerate/CUDA/CodeGen/Type.hs
bsd-3-clause
codegenIntegralTex (TypeCInt _) = typename "TexCInt"
55
codegenIntegralTex (TypeCInt _) = typename "TexCInt"
55
codegenIntegralTex (TypeCInt _) = typename "TexCInt"
55
false
false
0
6
8
19
8
11
null
null
martin-kolinek/stack
src/Stack/Types/Package.hs
bsd-3-clause
packageIdentifier :: Package -> PackageIdentifier packageIdentifier pkg = PackageIdentifier (packageName pkg) (packageVersion pkg)
134
packageIdentifier :: Package -> PackageIdentifier packageIdentifier pkg = PackageIdentifier (packageName pkg) (packageVersion pkg)
134
packageIdentifier pkg = PackageIdentifier (packageName pkg) (packageVersion pkg)
84
false
true
0
7
16
35
17
18
null
null
bgamari/git-haskell-org-hooks
src/Git.hs
gpl-3.0
-- | Run @git@ operation runGit :: FilePath -> Text -> [Text] -> Sh Text runGit d op args = do d' <- toTextWarn d out <- withUtf8 $ silently $ run "git" ("--git-dir=" <> d' : op : args) return out -- | WARNING: non-reentrant Hack!
243
runGit :: FilePath -> Text -> [Text] -> Sh Text runGit d op args = do d' <- toTextWarn d out <- withUtf8 $ silently $ run "git" ("--git-dir=" <> d' : op : args) return out -- | WARNING: non-reentrant Hack!
218
runGit d op args = do d' <- toTextWarn d out <- withUtf8 $ silently $ run "git" ("--git-dir=" <> d' : op : args) return out -- | WARNING: non-reentrant Hack!
170
true
true
0
13
59
89
43
46
null
null
ocean0yohsuke/Simply-Typed-Lambda
src/Lambda/Evaluator/Eval.hs
bsd-3-clause
eval (FIX lam@(LAM _ t _) msp) = localMSPBy msp $ eval $ betaReduce (FIX lam msp) t
83
eval (FIX lam@(LAM _ t _) msp) = localMSPBy msp $ eval $ betaReduce (FIX lam msp) t
83
eval (FIX lam@(LAM _ t _) msp) = localMSPBy msp $ eval $ betaReduce (FIX lam msp) t
83
false
false
0
9
17
55
26
29
null
null
tcsavage/say
example/Main.hs
mit
main :: IO () main = putStrLn "Type words and hit return to hear them back." >> (forever $ say =<< getLine)
107
main :: IO () main = putStrLn "Type words and hit return to hear them back." >> (forever $ say =<< getLine)
107
main = putStrLn "Type words and hit return to hear them back." >> (forever $ say =<< getLine)
93
false
true
0
8
21
34
17
17
null
null
GaloisInc/halvm-ghc
libraries/template-haskell/Language/Haskell/TH/Lib.hs
bsd-3-clause
closedTypeFamilyNoKindD :: Name -> [TyVarBndr] -> [TySynEqnQ] -> DecQ closedTypeFamilyNoKindD tc tvs eqns = do eqns1 <- sequence eqns return (ClosedTypeFamilyD (TypeFamilyHead tc tvs NoSig Nothing) eqns1)
209
closedTypeFamilyNoKindD :: Name -> [TyVarBndr] -> [TySynEqnQ] -> DecQ closedTypeFamilyNoKindD tc tvs eqns = do eqns1 <- sequence eqns return (ClosedTypeFamilyD (TypeFamilyHead tc tvs NoSig Nothing) eqns1)
209
closedTypeFamilyNoKindD tc tvs eqns = do eqns1 <- sequence eqns return (ClosedTypeFamilyD (TypeFamilyHead tc tvs NoSig Nothing) eqns1)
139
false
true
0
11
31
72
35
37
null
null
erikd/hs-tls
core/Network/TLS/Crypto/IES.hs
bsd-3-clause
groupGetPubShared (GroupPub_FFDHE6144 pub) = getPubShared ffdhe6144 pub GroupPub_FFDHE6144
90
groupGetPubShared (GroupPub_FFDHE6144 pub) = getPubShared ffdhe6144 pub GroupPub_FFDHE6144
90
groupGetPubShared (GroupPub_FFDHE6144 pub) = getPubShared ffdhe6144 pub GroupPub_FFDHE6144
90
false
false
0
7
7
22
10
12
null
null
timsears/species
Math/Combinatorics/Species/AST/Instances.hs
bsd-3-clause
reflect Subset = subset
36
reflect Subset = subset
36
reflect Subset = subset
36
false
false
0
5
16
9
4
5
null
null
mitchellwrosen/language-lua2
src/Language/Lua/Parser/Internal.hs
bsd-3-clause
mkLocalAssign :: L Token -> IdentList1 NodeInfo -> Maybe (L Token, ExpressionList1 NodeInfo) -> Statement NodeInfo mkLocalAssign a b c = LocalAssign (nodeInfo a <> nodeInfo b <> nodeInfo c) b c' where c' :: ExpressionList NodeInfo c' = maybe (ExpressionList mempty []) (\(_, ExpressionList1 n es) -> ExpressionList n (NonEmpty.toList es)) c
379
mkLocalAssign :: L Token -> IdentList1 NodeInfo -> Maybe (L Token, ExpressionList1 NodeInfo) -> Statement NodeInfo mkLocalAssign a b c = LocalAssign (nodeInfo a <> nodeInfo b <> nodeInfo c) b c' where c' :: ExpressionList NodeInfo c' = maybe (ExpressionList mempty []) (\(_, ExpressionList1 n es) -> ExpressionList n (NonEmpty.toList es)) c
379
mkLocalAssign a b c = LocalAssign (nodeInfo a <> nodeInfo b <> nodeInfo c) b c' where c' :: ExpressionList NodeInfo c' = maybe (ExpressionList mempty []) (\(_, ExpressionList1 n es) -> ExpressionList n (NonEmpty.toList es)) c
256
false
true
1
11
91
153
71
82
null
null
DavidAlphaFox/ghc
libraries/Cabal/cabal-install/Distribution/Client/IndexUtils.hs
bsd-3-clause
getSourcePackages' verbosity repos mode = do info verbosity "Reading available packages..." pkgss <- mapM (\r -> readRepoIndex verbosity r mode) repos let (pkgs, prefs) = mconcat pkgss prefs' = Map.fromListWith intersectVersionRanges [ (name, range) | Dependency name range <- prefs ] _ <- evaluate pkgs _ <- evaluate prefs' return SourcePackageDb { packageIndex = pkgs, packagePreferences = prefs' } -- | Read a repository index from disk, from the local file specified by -- the 'Repo'. -- -- All the 'SourcePackage's are marked as having come from the given 'Repo'. -- -- This is a higher level wrapper used internally in cabal-install. --
694
getSourcePackages' verbosity repos mode = do info verbosity "Reading available packages..." pkgss <- mapM (\r -> readRepoIndex verbosity r mode) repos let (pkgs, prefs) = mconcat pkgss prefs' = Map.fromListWith intersectVersionRanges [ (name, range) | Dependency name range <- prefs ] _ <- evaluate pkgs _ <- evaluate prefs' return SourcePackageDb { packageIndex = pkgs, packagePreferences = prefs' } -- | Read a repository index from disk, from the local file specified by -- the 'Repo'. -- -- All the 'SourcePackage's are marked as having come from the given 'Repo'. -- -- This is a higher level wrapper used internally in cabal-install. --
694
getSourcePackages' verbosity repos mode = do info verbosity "Reading available packages..." pkgss <- mapM (\r -> readRepoIndex verbosity r mode) repos let (pkgs, prefs) = mconcat pkgss prefs' = Map.fromListWith intersectVersionRanges [ (name, range) | Dependency name range <- prefs ] _ <- evaluate pkgs _ <- evaluate prefs' return SourcePackageDb { packageIndex = pkgs, packagePreferences = prefs' } -- | Read a repository index from disk, from the local file specified by -- the 'Repo'. -- -- All the 'SourcePackage's are marked as having come from the given 'Repo'. -- -- This is a higher level wrapper used internally in cabal-install. --
694
false
false
0
14
154
148
75
73
null
null
goldfirere/singletons
singletons-th/src/Data/Singletons/TH/Single/Monad.hs
bsd-3-clause
lookupConE :: Name -> SgM DExp lookupConE name = do opts <- getOptions lookup_var_con (singledDataConName opts) (DConE . singledDataConName opts) name
171
lookupConE :: Name -> SgM DExp lookupConE name = do opts <- getOptions lookup_var_con (singledDataConName opts) (DConE . singledDataConName opts) name
171
lookupConE name = do opts <- getOptions lookup_var_con (singledDataConName opts) (DConE . singledDataConName opts) name
140
false
true
0
11
41
59
26
33
null
null
ghc-android/ghc
libraries/base/GHC/IO/Encoding/Latin1.hs
bsd-3-clause
single_byte_checked_encode :: Int -> EncodeBuffer single_byte_checked_encode max_legal_char input@Buffer{ bufRaw=iraw, bufL=ir0, bufR=iw, bufSize=_ } output@Buffer{ bufRaw=oraw, bufL=_, bufR=ow0, bufSize=os } = let done why !ir !ow = return (why, if ir == iw then input{ bufL=0, bufR=0 } else input{ bufL=ir }, output{ bufR=ow }) loop !ir !ow | ow >= os = done OutputUnderflow ir ow | ir >= iw = done InputUnderflow ir ow | otherwise = do (c,ir') <- readCharBuf iraw ir if ord c > max_legal_char then invalid else do writeWord8Buf oraw ow (fromIntegral (ord c)) loop ir' (ow+1) where invalid = done InvalidSequence ir ow in loop ir0 ow0
864
single_byte_checked_encode :: Int -> EncodeBuffer single_byte_checked_encode max_legal_char input@Buffer{ bufRaw=iraw, bufL=ir0, bufR=iw, bufSize=_ } output@Buffer{ bufRaw=oraw, bufL=_, bufR=ow0, bufSize=os } = let done why !ir !ow = return (why, if ir == iw then input{ bufL=0, bufR=0 } else input{ bufL=ir }, output{ bufR=ow }) loop !ir !ow | ow >= os = done OutputUnderflow ir ow | ir >= iw = done InputUnderflow ir ow | otherwise = do (c,ir') <- readCharBuf iraw ir if ord c > max_legal_char then invalid else do writeWord8Buf oraw ow (fromIntegral (ord c)) loop ir' (ow+1) where invalid = done InvalidSequence ir ow in loop ir0 ow0
864
single_byte_checked_encode max_legal_char input@Buffer{ bufRaw=iraw, bufL=ir0, bufR=iw, bufSize=_ } output@Buffer{ bufRaw=oraw, bufL=_, bufR=ow0, bufSize=os } = let done why !ir !ow = return (why, if ir == iw then input{ bufL=0, bufR=0 } else input{ bufL=ir }, output{ bufR=ow }) loop !ir !ow | ow >= os = done OutputUnderflow ir ow | ir >= iw = done InputUnderflow ir ow | otherwise = do (c,ir') <- readCharBuf iraw ir if ord c > max_legal_char then invalid else do writeWord8Buf oraw ow (fromIntegral (ord c)) loop ir' (ow+1) where invalid = done InvalidSequence ir ow in loop ir0 ow0
814
false
true
0
19
330
306
159
147
null
null
ilyasergey/GHC-XAppFix
compiler/llvmGen/Llvm/Types.hs
bsd-3-clause
getStatType (LMAdd t _) = getStatType t
47
getStatType (LMAdd t _) = getStatType t
47
getStatType (LMAdd t _) = getStatType t
47
false
false
0
7
14
20
9
11
null
null
joshmcgrath08/turnt-octo-wight
test/mergesort/Test.hs
mit
pre :: String pre = unlines [ "#include <stdlib.h>" , "#include <assert.h>" , "#include \"merge_sort.h\"" , "" , "int is_sorted (int buf[], int s) {" , " int i;" , " for (i = 0; i < s - 1; i++) {" , " if (buf[i] > buf[i+1])" , " return 0;" , " }" , " return 1;" , "}" , "" , "int test_main (void) {" ]
399
pre :: String pre = unlines [ "#include <stdlib.h>" , "#include <assert.h>" , "#include \"merge_sort.h\"" , "" , "int is_sorted (int buf[], int s) {" , " int i;" , " for (i = 0; i < s - 1; i++) {" , " if (buf[i] > buf[i+1])" , " return 0;" , " }" , " return 1;" , "}" , "" , "int test_main (void) {" ]
399
pre = unlines [ "#include <stdlib.h>" , "#include <assert.h>" , "#include \"merge_sort.h\"" , "" , "int is_sorted (int buf[], int s) {" , " int i;" , " for (i = 0; i < s - 1; i++) {" , " if (buf[i] > buf[i+1])" , " return 0;" , " }" , " return 1;" , "}" , "" , "int test_main (void) {" ]
385
false
true
0
6
166
62
36
26
null
null
tyfkda/SolokusSolver
src/Util.hs
bsd-3-clause
replace :: [a] -> Int -> a -> [a] replace xs p x = take p xs ++ [x] ++ drop (p + 1) xs
86
replace :: [a] -> Int -> a -> [a] replace xs p x = take p xs ++ [x] ++ drop (p + 1) xs
86
replace xs p x = take p xs ++ [x] ++ drop (p + 1) xs
52
false
true
0
8
24
64
33
31
null
null
supki/liblastfm
src/Lastfm/Response.hs
mit
parse :: Supported f r => Lazy.ByteString -> Either LastfmError r parse body = case parseResponseBody body of Just v | Just e <- parseResponseEncodedError v -> Left e | otherwise -> Right v Nothing -> Left (LastfmBadResponse body)
242
parse :: Supported f r => Lazy.ByteString -> Either LastfmError r parse body = case parseResponseBody body of Just v | Just e <- parseResponseEncodedError v -> Left e | otherwise -> Right v Nothing -> Left (LastfmBadResponse body)
242
parse body = case parseResponseBody body of Just v | Just e <- parseResponseEncodedError v -> Left e | otherwise -> Right v Nothing -> Left (LastfmBadResponse body)
176
false
true
0
12
50
100
43
57
null
null
bitemyapp/ganeti
src/Ganeti/HTools/Dedicated.hs
bsd-2-clause
-- | Given a cluster description and maybe a group name, decide -- if that group, or all allocatable groups if no group is given, -- is dedicated. isDedicated :: Loader.ClusterData -> Maybe String -> Bool isDedicated cdata maybeGroup = let groups = IntMap.keysSet . IntMap.filter (maybe ((/=) T.AllocUnallocable . Group.allocPolicy) (\name -> (==) name . Group.name) maybeGroup) $ Loader.cdGroups cdata in F.all (liftA2 (||) Node.exclStorage $ not . (`IntSet.member` groups) . Node.group) $ Loader.cdNodes cdata
588
isDedicated :: Loader.ClusterData -> Maybe String -> Bool isDedicated cdata maybeGroup = let groups = IntMap.keysSet . IntMap.filter (maybe ((/=) T.AllocUnallocable . Group.allocPolicy) (\name -> (==) name . Group.name) maybeGroup) $ Loader.cdGroups cdata in F.all (liftA2 (||) Node.exclStorage $ not . (`IntSet.member` groups) . Node.group) $ Loader.cdNodes cdata
441
isDedicated cdata maybeGroup = let groups = IntMap.keysSet . IntMap.filter (maybe ((/=) T.AllocUnallocable . Group.allocPolicy) (\name -> (==) name . Group.name) maybeGroup) $ Loader.cdGroups cdata in F.all (liftA2 (||) Node.exclStorage $ not . (`IntSet.member` groups) . Node.group) $ Loader.cdNodes cdata
383
true
true
0
17
152
156
82
74
null
null
clintonmead/indextype
codegen/SourceGen.hs
mit
typeVar = "a"
13
typeVar = "a"
13
typeVar = "a"
13
false
false
1
5
2
10
3
7
null
null
petabricks/petabricks
scripts/oldtuner2/src/GP/Types.hs
mit
_ `isTypeCompatible` (TypeVariable _) = True
85
_ `isTypeCompatible` (TypeVariable _) = True
85
_ `isTypeCompatible` (TypeVariable _) = True
85
false
false
0
7
46
20
10
10
null
null
conal/hermit
src/HERMIT/Kernel.hs
bsd-2-clause
abortKernel :: String -> CoreM a abortKernel = throwGhcException . ProgramError
79
abortKernel :: String -> CoreM a abortKernel = throwGhcException . ProgramError
79
abortKernel = throwGhcException . ProgramError
46
false
true
0
6
10
22
11
11
null
null
siddhanathan/ghc
testsuite/tests/programs/joao-circular/Funcs_Lexer.hs
bsd-3-clause
lexer (']':cs) = TcloseSB : lexer cs
37
lexer (']':cs) = TcloseSB : lexer cs
37
lexer (']':cs) = TcloseSB : lexer cs
37
false
false
2
6
7
26
11
15
null
null
junjihashimoto/th-cas
test/Algebra/CAS/GrobnerBasisSpec.hs
mit
c :: Formula c = CV "c"
23
c :: Formula c = CV "c"
23
c = CV "c"
10
false
true
0
6
6
20
8
12
null
null
Super-Fluid/heqet
Heqet/Input/Parse.hs
gpl-3.0
musicParser :: Parser Tree1 musicParser = tree <* eof
53
musicParser :: Parser Tree1 musicParser = tree <* eof
53
musicParser = tree <* eof
25
false
true
0
5
8
18
9
9
null
null
Zigazou/HaMinitel
src/Minitel/Key.hs
gpl-3.0
toAlpha (AddUmlaut mn ) = Just $ chrm mn
53
toAlpha (AddUmlaut mn ) = Just $ chrm mn
53
toAlpha (AddUmlaut mn ) = Just $ chrm mn
53
false
false
0
7
21
22
10
12
null
null
nevrenato/HetsAlloy
OWL2/XML.hs
gpl-2.0
getFrames :: XMLBase -> Element -> [Axiom] -> [Frame] getFrames b e ax = let f = map (axToFrame . getDeclaration b) (filterCh "Declaration" e) ++ map axToFrame (filter (isNothing . xmlErrorString) ax) in f ++ signToFrames f
240
getFrames :: XMLBase -> Element -> [Axiom] -> [Frame] getFrames b e ax = let f = map (axToFrame . getDeclaration b) (filterCh "Declaration" e) ++ map axToFrame (filter (isNothing . xmlErrorString) ax) in f ++ signToFrames f
240
getFrames b e ax = let f = map (axToFrame . getDeclaration b) (filterCh "Declaration" e) ++ map axToFrame (filter (isNothing . xmlErrorString) ax) in f ++ signToFrames f
186
false
true
2
14
54
108
51
57
null
null