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
5hubh4m/99-haskell-problems
LogicCode.hs
mit
grayCode :: Int -> [String] grayCode 1 = ["0", "1"]
51
grayCode :: Int -> [String] grayCode 1 = ["0", "1"]
51
grayCode 1 = ["0", "1"]
23
false
true
0
8
9
33
16
17
null
null
lamefun/haddock
haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
bsd-2-clause
-- | Print a newtype / data binder and its variables ppDataBinderWithVars :: Bool -> TyClDecl DocName -> Html ppDataBinderWithVars summ decl = ppAppDocNameNames summ (tcdName decl) (tyvarNames $ tcdTyVars decl)
212
ppDataBinderWithVars :: Bool -> TyClDecl DocName -> Html ppDataBinderWithVars summ decl = ppAppDocNameNames summ (tcdName decl) (tyvarNames $ tcdTyVars decl)
159
ppDataBinderWithVars summ decl = ppAppDocNameNames summ (tcdName decl) (tyvarNames $ tcdTyVars decl)
102
true
true
0
8
32
51
25
26
null
null
cdepillabout/HLearn
src/HLearn/Data/SpaceTree/CoverTree_Specialized.hs
bsd-3-clause
cmp_numdp_distance' ct b a = compare (numdp a) (numdp b) + compare (distance (nodedp ct) (nodedp a)) (distance (nodedp ct) (nodedp b))
142
cmp_numdp_distance' ct b a = compare (numdp a) (numdp b) + compare (distance (nodedp ct) (nodedp a)) (distance (nodedp ct) (nodedp b))
142
cmp_numdp_distance' ct b a = compare (numdp a) (numdp b) + compare (distance (nodedp ct) (nodedp a)) (distance (nodedp ct) (nodedp b))
142
false
false
2
9
29
80
38
42
null
null
amir/hmscrobbler
test/Spec.hs
unlicense
main :: IO () main = hspec $ do describe "parseOutput" $ do it "extracts path from answer" $ do case parseOutput "ANS_path=A\n" of Right [x] -> case x of Answer Path p -> p `shouldBe` "A" it "ignores logs as noise" $ do case parseOutput "Audio only file format detected.\n" of Right [x] -> x `shouldBe` Noise it "ignores the first line as noise and detects playback start" $ do case parseOutput "Video: no video\nStarting playback...\n" of Right [x1, x2] -> x2 `shouldBe` StartingPlayback it "extracts paths from links" $ do case linkToPath "l-wx------ 1 amir amir 64 Dec 24 15:21 3 -> /run/user/1000/i3/errorlog" of Right x -> x `shouldBe` "/run/user/1000/i3/errorlog"
798
main :: IO () main = hspec $ do describe "parseOutput" $ do it "extracts path from answer" $ do case parseOutput "ANS_path=A\n" of Right [x] -> case x of Answer Path p -> p `shouldBe` "A" it "ignores logs as noise" $ do case parseOutput "Audio only file format detected.\n" of Right [x] -> x `shouldBe` Noise it "ignores the first line as noise and detects playback start" $ do case parseOutput "Video: no video\nStarting playback...\n" of Right [x1, x2] -> x2 `shouldBe` StartingPlayback it "extracts paths from links" $ do case linkToPath "l-wx------ 1 amir amir 64 Dec 24 15:21 3 -> /run/user/1000/i3/errorlog" of Right x -> x `shouldBe` "/run/user/1000/i3/errorlog"
798
main = hspec $ do describe "parseOutput" $ do it "extracts path from answer" $ do case parseOutput "ANS_path=A\n" of Right [x] -> case x of Answer Path p -> p `shouldBe` "A" it "ignores logs as noise" $ do case parseOutput "Audio only file format detected.\n" of Right [x] -> x `shouldBe` Noise it "ignores the first line as noise and detects playback start" $ do case parseOutput "Video: no video\nStarting playback...\n" of Right [x1, x2] -> x2 `shouldBe` StartingPlayback it "extracts paths from links" $ do case linkToPath "l-wx------ 1 amir amir 64 Dec 24 15:21 3 -> /run/user/1000/i3/errorlog" of Right x -> x `shouldBe` "/run/user/1000/i3/errorlog"
784
false
true
2
20
240
205
94
111
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
4784 = 4783
11
4784 = 4783
11
4784 = 4783
11
false
false
1
5
2
10
3
7
null
null
horia141/mv-parser
parser.hs
mit
path :: Parser MVExpr path = do inst <- identifier lexer dot lexer name <- identifier lexer return (Path inst name)
146
path :: Parser MVExpr path = do inst <- identifier lexer dot lexer name <- identifier lexer return (Path inst name)
146
path = do inst <- identifier lexer dot lexer name <- identifier lexer return (Path inst name)
124
false
true
0
9
51
54
23
31
null
null
martinvlk/cabal
cabal-install/Distribution/Client/Sandbox/PackageEnvironment.hs
bsd-3-clause
commonPackageEnvironmentConfig :: FilePath -> SavedConfig commonPackageEnvironmentConfig sandboxDir = mempty { savedConfigureFlags = mempty { -- TODO: Currently, we follow cabal-dev and set 'user-install: False' in -- the config file. In the future we may want to distinguish between -- global, sandbox and user install types. configUserInstall = toFlag False, configInstallDirs = installDirs }, savedUserInstallDirs = installDirs, savedGlobalInstallDirs = installDirs, savedGlobalFlags = mempty { globalLogsDir = toFlag $ sandboxDir </> "logs", -- Is this right? cabal-dev uses the global world file. globalWorldFile = toFlag $ sandboxDir </> "world" } } where installDirs = sandboxInstallDirs sandboxDir -- | 'commonPackageEnvironmentConfig' wrapped inside a 'PackageEnvironment'.
879
commonPackageEnvironmentConfig :: FilePath -> SavedConfig commonPackageEnvironmentConfig sandboxDir = mempty { savedConfigureFlags = mempty { -- TODO: Currently, we follow cabal-dev and set 'user-install: False' in -- the config file. In the future we may want to distinguish between -- global, sandbox and user install types. configUserInstall = toFlag False, configInstallDirs = installDirs }, savedUserInstallDirs = installDirs, savedGlobalInstallDirs = installDirs, savedGlobalFlags = mempty { globalLogsDir = toFlag $ sandboxDir </> "logs", -- Is this right? cabal-dev uses the global world file. globalWorldFile = toFlag $ sandboxDir </> "world" } } where installDirs = sandboxInstallDirs sandboxDir -- | 'commonPackageEnvironmentConfig' wrapped inside a 'PackageEnvironment'.
879
commonPackageEnvironmentConfig sandboxDir = mempty { savedConfigureFlags = mempty { -- TODO: Currently, we follow cabal-dev and set 'user-install: False' in -- the config file. In the future we may want to distinguish between -- global, sandbox and user install types. configUserInstall = toFlag False, configInstallDirs = installDirs }, savedUserInstallDirs = installDirs, savedGlobalInstallDirs = installDirs, savedGlobalFlags = mempty { globalLogsDir = toFlag $ sandboxDir </> "logs", -- Is this right? cabal-dev uses the global world file. globalWorldFile = toFlag $ sandboxDir </> "world" } } where installDirs = sandboxInstallDirs sandboxDir -- | 'commonPackageEnvironmentConfig' wrapped inside a 'PackageEnvironment'.
821
false
true
0
10
197
107
63
44
null
null
randen/haddock
haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
bsd-2-clause
ppr_tylit :: HsTyLit -> Html ppr_tylit (HsNumTy _ n) = toHtml (show n)
70
ppr_tylit :: HsTyLit -> Html ppr_tylit (HsNumTy _ n) = toHtml (show n)
70
ppr_tylit (HsNumTy _ n) = toHtml (show n)
41
false
true
0
9
12
41
18
23
null
null
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribeRouteTables.hs
mpl-2.0
-- | One or more filters. -- -- 'association.route-table-association-id' - The ID of an association ID for -- the route table. -- -- 'association.route-table-id' - The ID of the route table involved in the -- association. -- -- 'association.subnet-id' - The ID of the subnet involved in the association. -- -- 'association.main' - Indicates whether the route table is the main route -- table for the VPC. -- -- 'route-table-id' - The ID of the route table. -- -- 'route.destination-cidr-block' - The CIDR range specified in a route in the -- table. -- -- 'route.destination-prefix-list-id' - The ID (prefix) of the AWS service -- specified in a route in the table. -- -- 'route.gateway-id' - The ID of a gateway specified in a route in the table. -- -- 'route.instance-id' - The ID of an instance specified in a route in the -- table. -- -- 'route.origin' - Describes how the route was created. 'CreateRouteTable' -- indicates that the route was automatically created when the route table was -- created; 'CreateRoute' indicates that the route was manually added to the route -- table; 'EnableVgwRoutePropagation' indicates that the route was propagated by -- route propagation. -- -- 'route.state' - The state of a route in the route table ('active' | 'blackhole'). The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, the specified NAT instance has been terminated, and so on). -- -- -- 'route.vpc-peering-connection-id' - The ID of a VPC peering connection -- specified in a route in the table. -- -- 'tag':/key/=/value/ - The key/value combination of a tag assigned to the -- resource. -- -- 'tag-key' - The key of a tag assigned to the resource. This filter is -- independent of the 'tag-value' filter. For example, if you use both the filter -- "tag-key=Purpose" and the filter "tag-value=X", you get any resources -- assigned both the tag key Purpose (regardless of what the tag's value is), -- and the tag value X (regardless of what the tag's key is). If you want to -- list only resources where Purpose is X, see the 'tag':/key/=/value/ filter. -- -- 'tag-value' - The value of a tag assigned to the resource. This filter is -- independent of the 'tag-key' filter. -- -- 'vpc-id' - The ID of the VPC for the route table. -- -- drt2Filters :: Lens' DescribeRouteTables [Filter] drt2Filters = lens _drt2Filters (\s a -> s { _drt2Filters = a }) . _List
2,439
drt2Filters :: Lens' DescribeRouteTables [Filter] drt2Filters = lens _drt2Filters (\s a -> s { _drt2Filters = a }) . _List
122
drt2Filters = lens _drt2Filters (\s a -> s { _drt2Filters = a }) . _List
72
true
true
0
10
414
100
79
21
null
null
ashishnegi/hsalgos
src/Fibonacci.hs
bsd-3-clause
test :: IO () test = do putStrLn "I will give you fibonacci of N : give me N : " n <- read <$> getLine putStrLn . show . nthFib $ n
137
test :: IO () test = do putStrLn "I will give you fibonacci of N : give me N : " n <- read <$> getLine putStrLn . show . nthFib $ n
137
test = do putStrLn "I will give you fibonacci of N : give me N : " n <- read <$> getLine putStrLn . show . nthFib $ n
123
false
true
0
9
38
48
22
26
null
null
ancientlanguage/haskell-analysis
prepare/src/Prepare/Decompose.hs
mit
decomposeChar '\xF9FC' = "\x8B58"
33
decomposeChar '\xF9FC' = "\x8B58"
33
decomposeChar '\xF9FC' = "\x8B58"
33
false
false
1
5
3
13
4
9
null
null
kmilner/tamarin-prover
lib/theory/src/Theory/Proof.hs
gpl-3.0
checkAndExtendDiffProver :: DiffProver -> DiffProver checkAndExtendDiffProver prover0 = DiffProver $ \ctxt d se prf -> return $ mapDiffProofInfo snd $ checkDiffProof ctxt (prover ctxt) d se prf where unhandledCase = diffSorry (Just "unhandled case") Nothing prover ctxt d se = fromMaybe unhandledCase $ runDiffProver prover0 ctxt d se unhandledCase -- | Replace all annotated sorry steps using the given prover.
434
checkAndExtendDiffProver :: DiffProver -> DiffProver checkAndExtendDiffProver prover0 = DiffProver $ \ctxt d se prf -> return $ mapDiffProofInfo snd $ checkDiffProof ctxt (prover ctxt) d se prf where unhandledCase = diffSorry (Just "unhandled case") Nothing prover ctxt d se = fromMaybe unhandledCase $ runDiffProver prover0 ctxt d se unhandledCase -- | Replace all annotated sorry steps using the given prover.
434
checkAndExtendDiffProver prover0 = DiffProver $ \ctxt d se prf -> return $ mapDiffProofInfo snd $ checkDiffProof ctxt (prover ctxt) d se prf where unhandledCase = diffSorry (Just "unhandled case") Nothing prover ctxt d se = fromMaybe unhandledCase $ runDiffProver prover0 ctxt d se unhandledCase -- | Replace all annotated sorry steps using the given prover.
381
false
true
0
10
82
111
54
57
null
null
uuhan/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
highestFC (PResolveTC fc) = Just fc
43
highestFC (PResolveTC fc) = Just fc
43
highestFC (PResolveTC fc) = Just fc
43
false
false
0
7
13
18
8
10
null
null
rsasse/tamarin-prover
lib/utils/src/Control/Monad/Bind.hs
gpl-3.0
-- | Evaluate a binding context computation. evalBindT :: Monad m => BindT k v m a -> Bindings k v -> m a evalBindT = evalStateT
128
evalBindT :: Monad m => BindT k v m a -> Bindings k v -> m a evalBindT = evalStateT
83
evalBindT = evalStateT
22
true
true
0
8
26
44
21
23
null
null
gafiatulin/codewars
src/6 kyu/HTMLComplementaryColor.hs
mit
getReversedColor :: String -> Maybe String getReversedColor [] = Just "#FFFFFF"
79
getReversedColor :: String -> Maybe String getReversedColor [] = Just "#FFFFFF"
79
getReversedColor [] = Just "#FFFFFF"
36
false
true
0
8
10
30
13
17
null
null
guiraldelli/disaccent
src/EscapeCode.hs
bsd-2-clause
format :: T.Text -> T.Text -> T.Text format code toEscape = F.format escapeFormat (code, toEscape)
98
format :: T.Text -> T.Text -> T.Text format code toEscape = F.format escapeFormat (code, toEscape)
98
format code toEscape = F.format escapeFormat (code, toEscape)
61
false
true
0
7
14
43
22
21
null
null
Slava/6.035-decaf-compiler
src/OPT.hs
mit
ploopOpts :: Builder -> Builder ploopOpts builder = let pm = pmod builder fxs :: HashMap.Map String VFunction = functions pm (pm2,dbgs) = HashMap.fold (\y (x,dbgs) -> let (x2,dbgs2) = ploops_function x y in (x2,dbgs ++ dbgs2) ) (pm,[]) fxs in builder{pmod=pm2,debugs=(debugs builder) ++ dbgs }
313
ploopOpts :: Builder -> Builder ploopOpts builder = let pm = pmod builder fxs :: HashMap.Map String VFunction = functions pm (pm2,dbgs) = HashMap.fold (\y (x,dbgs) -> let (x2,dbgs2) = ploops_function x y in (x2,dbgs ++ dbgs2) ) (pm,[]) fxs in builder{pmod=pm2,debugs=(debugs builder) ++ dbgs }
313
ploopOpts builder = let pm = pmod builder fxs :: HashMap.Map String VFunction = functions pm (pm2,dbgs) = HashMap.fold (\y (x,dbgs) -> let (x2,dbgs2) = ploops_function x y in (x2,dbgs ++ dbgs2) ) (pm,[]) fxs in builder{pmod=pm2,debugs=(debugs builder) ++ dbgs }
281
false
true
0
16
65
154
81
73
null
null
bartoszw/elca
LoanConfigurationFull.hs
gpl-2.0
confBalloonAmorImp = ClassicCalcConf { feeType = Financed, clType = Balloon, base = Effective, freq = Monthly, calendar = Y360, rounding = Truncated, amorType = AmorImproved, minFstInstDur = 15, cccERType = ERProportional, cccMaxDur = 0, cccMinInstAmt = 0, cccInstAdj = FstInstallmentAdjusted, ccConfName = "Balloon Amor Improved" }
852
confBalloonAmorImp = ClassicCalcConf { feeType = Financed, clType = Balloon, base = Effective, freq = Monthly, calendar = Y360, rounding = Truncated, amorType = AmorImproved, minFstInstDur = 15, cccERType = ERProportional, cccMaxDur = 0, cccMinInstAmt = 0, cccInstAdj = FstInstallmentAdjusted, ccConfName = "Balloon Amor Improved" }
852
confBalloonAmorImp = ClassicCalcConf { feeType = Financed, clType = Balloon, base = Effective, freq = Monthly, calendar = Y360, rounding = Truncated, amorType = AmorImproved, minFstInstDur = 15, cccERType = ERProportional, cccMaxDur = 0, cccMinInstAmt = 0, cccInstAdj = FstInstallmentAdjusted, ccConfName = "Balloon Amor Improved" }
852
false
false
0
6
565
86
56
30
null
null
fmapfmapfmap/amazonka
amazonka-lambda/gen/Network/AWS/Lambda/Types/Product.hs
mpl-2.0
-- | The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when -- it executes your function to access any other Amazon Web Services (AWS) -- resources. fcRole :: Lens' FunctionConfiguration (Maybe Text) fcRole = lens _fcRole (\ s a -> s{_fcRole = a})
264
fcRole :: Lens' FunctionConfiguration (Maybe Text) fcRole = lens _fcRole (\ s a -> s{_fcRole = a})
98
fcRole = lens _fcRole (\ s a -> s{_fcRole = a})
47
true
true
1
9
46
54
27
27
null
null
brendanhay/gogol
gogol-blogger/gen/Network/Google/Resource/Blogger/Posts/Insert.hs
mpl-2.0
-- | V1 error format. posXgafv :: Lens' PostsInsert (Maybe Xgafv) posXgafv = lens _posXgafv (\ s a -> s{_posXgafv = a})
119
posXgafv :: Lens' PostsInsert (Maybe Xgafv) posXgafv = lens _posXgafv (\ s a -> s{_posXgafv = a})
97
posXgafv = lens _posXgafv (\ s a -> s{_posXgafv = a})
53
true
true
0
9
21
46
25
21
null
null
rsasse/tamarin-prover
lib/term/src/Term/Term/Raw.hs
gpl-3.0
fAppAC acsym as = FAPP (AC acsym) (sort (o_as ++ non_o_as)) where o = AC acsym isOTerm (FAPP o' _) | o' == o = True isOTerm _ = False (o_as0, non_o_as) = partition isOTerm as o_as = [ a | FAPP _ ts <- o_as0, a <- ts ] -- | Smart constructor for C terms.
314
fAppAC acsym as = FAPP (AC acsym) (sort (o_as ++ non_o_as)) where o = AC acsym isOTerm (FAPP o' _) | o' == o = True isOTerm _ = False (o_as0, non_o_as) = partition isOTerm as o_as = [ a | FAPP _ ts <- o_as0, a <- ts ] -- | Smart constructor for C terms.
314
fAppAC acsym as = FAPP (AC acsym) (sort (o_as ++ non_o_as)) where o = AC acsym isOTerm (FAPP o' _) | o' == o = True isOTerm _ = False (o_as0, non_o_as) = partition isOTerm as o_as = [ a | FAPP _ ts <- o_as0, a <- ts ] -- | Smart constructor for C terms.
314
false
false
3
9
117
141
63
78
null
null
ddssff/lens
src/Data/Data/Lens.hs
bsd-3-clause
fixEq :: Eq a => (a -> a) -> a -> a fixEq f = go where go x | x == x' = x' | otherwise = go x' where x' = f x
128
fixEq :: Eq a => (a -> a) -> a -> a fixEq f = go where go x | x == x' = x' | otherwise = go x' where x' = f x
128
fixEq f = go where go x | x == x' = x' | otherwise = go x' where x' = f x
92
false
true
0
10
53
78
37
41
null
null
thalerjonathan/phd
coding/prototyping/haskell/declarativeABM/haskell/SpatialGameABS/src/SpacialGameMsg/SGModelMsg.hs
gpl-3.0
sgTransformer :: SGTransformer sgTransformer (a, ge, le) (_, PA.Domain m) = (sgMsg a m, le)
91
sgTransformer :: SGTransformer sgTransformer (a, ge, le) (_, PA.Domain m) = (sgMsg a m, le)
91
sgTransformer (a, ge, le) (_, PA.Domain m) = (sgMsg a m, le)
60
false
true
1
7
14
53
26
27
null
null
ekmett/hadoom
Light.hs
bsd-3-clause
genLightFramebufferObject :: IO GL.FramebufferObject genLightFramebufferObject = do lightFBO <- GL.genObjectName GL.bindFramebuffer GL.Framebuffer $= lightFBO GL.drawBuffer $= GL.NoBuffers return lightFBO
228
genLightFramebufferObject :: IO GL.FramebufferObject genLightFramebufferObject = do lightFBO <- GL.genObjectName GL.bindFramebuffer GL.Framebuffer $= lightFBO GL.drawBuffer $= GL.NoBuffers return lightFBO
228
genLightFramebufferObject = do lightFBO <- GL.genObjectName GL.bindFramebuffer GL.Framebuffer $= lightFBO GL.drawBuffer $= GL.NoBuffers return lightFBO
175
false
true
0
9
42
56
25
31
null
null
JPMoresmau/BuildWrapper
src/Language/Haskell/BuildWrapper/GHC.hs
bsd-3-clause
withASTNotes :: GHCApplyFunction a -- ^ the final action to perform on the result -> (FilePath -> FilePath) -- ^ transform given file path to find bwinfo path -> FilePath -- ^ the base directory -> LoadContents -- ^ what to load -> [String] -- ^ the GHC options -> IO (OpResult [a]) withASTNotes f ff base_dir contents =initGHC (ghcWithASTNotes f ff base_dir contents True)
415
withASTNotes :: GHCApplyFunction a -- ^ the final action to perform on the result -> (FilePath -> FilePath) -- ^ transform given file path to find bwinfo path -> FilePath -- ^ the base directory -> LoadContents -- ^ what to load -> [String] -- ^ the GHC options -> IO (OpResult [a]) withASTNotes f ff base_dir contents =initGHC (ghcWithASTNotes f ff base_dir contents True)
415
withASTNotes f ff base_dir contents =initGHC (ghcWithASTNotes f ff base_dir contents True)
90
false
true
0
13
106
87
46
41
null
null
rueshyna/gogol
gogol-affiliates/gen/Network/Google/Affiliates/Types/Product.hs
mpl-2.0
-- | The highest rate the issuer may charge for defaulting on debt in this -- category. Expressed as an absolute number, not as a percentage. codfiMaxRate :: Lens' CcOfferDefaultFeesItem (Maybe Double) codfiMaxRate = lens _codfiMaxRate (\ s a -> s{_codfiMaxRate = a}) . mapping _Coerce
293
codfiMaxRate :: Lens' CcOfferDefaultFeesItem (Maybe Double) codfiMaxRate = lens _codfiMaxRate (\ s a -> s{_codfiMaxRate = a}) . mapping _Coerce
151
codfiMaxRate = lens _codfiMaxRate (\ s a -> s{_codfiMaxRate = a}) . mapping _Coerce
91
true
true
2
8
53
61
29
32
null
null
alexander-at-github/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
primOpHasSideEffects PrefetchAddrOp2 = True
43
primOpHasSideEffects PrefetchAddrOp2 = True
43
primOpHasSideEffects PrefetchAddrOp2 = True
43
false
false
0
5
3
9
4
5
null
null
green-haskell/ghc
compiler/basicTypes/BasicTypes.hs
bsd-3-clause
isGenerated :: Origin -> Bool isGenerated Generated = True
58
isGenerated :: Origin -> Bool isGenerated Generated = True
58
isGenerated Generated = True
28
false
true
0
5
8
18
9
9
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/enumFromThen_2.hs
mit
primDivNatS Zero (Succ x) = Zero
32
primDivNatS Zero (Succ x) = Zero
32
primDivNatS Zero (Succ x) = Zero
32
false
false
0
7
5
17
8
9
null
null
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/TargetVPNGateways/List.hs
mpl-2.0
-- | Sorts list results by a certain order. By default, results are returned -- in alphanumerical order based on the resource name. You can also sort -- results in descending order based on the creation timestamp using -- \`orderBy=\"creationTimestamp desc\"\`. This sorts results based on the -- \`creationTimestamp\` field in reverse chronological order (newest -- result first). Use this to sort resources like operations so that the -- newest operation is returned first. Currently, only sorting by \`name\` -- or \`creationTimestamp desc\` is supported. tvglOrderBy :: Lens' TargetVPNGatewaysList (Maybe Text) tvglOrderBy = lens _tvglOrderBy (\ s a -> s{_tvglOrderBy = a})
679
tvglOrderBy :: Lens' TargetVPNGatewaysList (Maybe Text) tvglOrderBy = lens _tvglOrderBy (\ s a -> s{_tvglOrderBy = a})
120
tvglOrderBy = lens _tvglOrderBy (\ s a -> s{_tvglOrderBy = a})
64
true
true
1
9
103
59
32
27
null
null
mietek/stack
src/Stack/Types/Config.hs
bsd-3-clause
flagCacheLocal :: (MonadThrow m, MonadReader env m, HasBuildConfig env) => m (Path Abs Dir) flagCacheLocal = do root <- installationRootLocal return $ root </> $(mkRelDir "flag-cache") -- | Where to store mini build plan caches
236
flagCacheLocal :: (MonadThrow m, MonadReader env m, HasBuildConfig env) => m (Path Abs Dir) flagCacheLocal = do root <- installationRootLocal return $ root </> $(mkRelDir "flag-cache") -- | Where to store mini build plan caches
236
flagCacheLocal = do root <- installationRootLocal return $ root </> $(mkRelDir "flag-cache") -- | Where to store mini build plan caches
144
false
true
0
10
43
71
35
36
null
null
grnet/snf-ganeti
src/Ganeti/BasicTypes.hs
bsd-2-clause
-- | Check if an either is Right. Equivalent to isRight from Data.Either -- version 4.7.0.0 or higher. isRight :: Either a b -> Bool isRight = not . isLeft
155
isRight :: Either a b -> Bool isRight = not . isLeft
52
isRight = not . isLeft
22
true
true
0
6
29
26
14
12
null
null
albertov/hs-abci
src/Network/ABCI/Types.hs
bsd-3-clause
codeTypeEncodingError = CodeType 1
34
codeTypeEncodingError = CodeType 1
34
codeTypeEncodingError = CodeType 1
34
false
false
1
5
3
12
4
8
null
null
39aldo39/klfc
src/Permutation.hs
gpl-3.0
assocs ∷ Eq α ⇒ Permutation α → [(α, α)] assocs (PAssocs xs) = filter (uncurry (≢)) xs
87
assocs ∷ Eq α ⇒ Permutation α → [(α, α)] assocs (PAssocs xs) = filter (uncurry (≢)) xs
87
assocs (PAssocs xs) = filter (uncurry (≢)) xs
46
false
true
0
10
18
63
30
33
null
null
rueshyna/gogol
gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/Clusters/List.hs
mpl-2.0
-- | [Optional] The standard List page size. prclPageSize :: Lens' ProjectsRegionsClustersList (Maybe Int32) prclPageSize = lens _prclPageSize (\ s a -> s{_prclPageSize = a}) . mapping _Coerce
200
prclPageSize :: Lens' ProjectsRegionsClustersList (Maybe Int32) prclPageSize = lens _prclPageSize (\ s a -> s{_prclPageSize = a}) . mapping _Coerce
155
prclPageSize = lens _prclPageSize (\ s a -> s{_prclPageSize = a}) . mapping _Coerce
91
true
true
0
10
35
55
28
27
null
null
olorin/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs
mpl-2.0
-- | The ID of the subnet in which to launch the instances. sflsSubnetId :: Lens' SpotFleetLaunchSpecification (Maybe Text) sflsSubnetId = lens _sflsSubnetId (\ s a -> s{_sflsSubnetId = a})
189
sflsSubnetId :: Lens' SpotFleetLaunchSpecification (Maybe Text) sflsSubnetId = lens _sflsSubnetId (\ s a -> s{_sflsSubnetId = a})
129
sflsSubnetId = lens _sflsSubnetId (\ s a -> s{_sflsSubnetId = a})
65
true
true
0
9
29
46
25
21
null
null
NCrashed/JuicyPixels-blp
blp2any/Convert.hs
bsd-3-clause
-- | Try to load input file with desired format readInputFile :: FilePath -> ConvertFormat -> IO DynamicImage readInputFile inputFile format = case format of Blp -> do fc <- BS.readFile inputFile case decodeBlp fc of Left err -> fail $ "Failed to load file " <> inputFile <> ", parse error: " <> err Right img -> pure img Png -> loadJuicy readPng Jpeg -> loadJuicy readJpeg Tiff -> loadJuicy readTiff Gif -> loadJuicy readGif Bmp -> loadJuicy readBitmap UnspecifiedFormat -> case guessFormat inputFile of Just newFormat -> readInputFile inputFile newFormat Nothing -> fail $ "Cannot infer format from filename " <> inputFile where loadJuicy :: (FilePath -> IO (Either String DynamicImage)) -> IO DynamicImage loadJuicy f = do mres <- f inputFile case mres of Left err -> fail $ "Failed to load file " <> inputFile <> " as " <> show format <> ", error: " <> err Right img -> pure img
962
readInputFile :: FilePath -> ConvertFormat -> IO DynamicImage readInputFile inputFile format = case format of Blp -> do fc <- BS.readFile inputFile case decodeBlp fc of Left err -> fail $ "Failed to load file " <> inputFile <> ", parse error: " <> err Right img -> pure img Png -> loadJuicy readPng Jpeg -> loadJuicy readJpeg Tiff -> loadJuicy readTiff Gif -> loadJuicy readGif Bmp -> loadJuicy readBitmap UnspecifiedFormat -> case guessFormat inputFile of Just newFormat -> readInputFile inputFile newFormat Nothing -> fail $ "Cannot infer format from filename " <> inputFile where loadJuicy :: (FilePath -> IO (Either String DynamicImage)) -> IO DynamicImage loadJuicy f = do mres <- f inputFile case mres of Left err -> fail $ "Failed to load file " <> inputFile <> " as " <> show format <> ", error: " <> err Right img -> pure img
914
readInputFile inputFile format = case format of Blp -> do fc <- BS.readFile inputFile case decodeBlp fc of Left err -> fail $ "Failed to load file " <> inputFile <> ", parse error: " <> err Right img -> pure img Png -> loadJuicy readPng Jpeg -> loadJuicy readJpeg Tiff -> loadJuicy readTiff Gif -> loadJuicy readGif Bmp -> loadJuicy readBitmap UnspecifiedFormat -> case guessFormat inputFile of Just newFormat -> readInputFile inputFile newFormat Nothing -> fail $ "Cannot infer format from filename " <> inputFile where loadJuicy :: (FilePath -> IO (Either String DynamicImage)) -> IO DynamicImage loadJuicy f = do mres <- f inputFile case mres of Left err -> fail $ "Failed to load file " <> inputFile <> " as " <> show format <> ", error: " <> err Right img -> pure img
852
true
true
0
16
236
289
133
156
null
null
lesguillemets/lsyst.hs
src/LSys/Plant.hs
mit
plantRule :: Char -> [Char] plantRule 'X' = "F-[[X]+X]+F[+FX]-X"
64
plantRule :: Char -> [Char] plantRule 'X' = "F-[[X]+X]+F[+FX]-X"
64
plantRule 'X' = "F-[[X]+X]+F[+FX]-X"
36
false
true
0
6
8
21
11
10
null
null
cservenka/ROOPLPPC
src/CodeGenerator.hs
mit
getMainLabel :: CodeGenerator Label getMainLabel = gets (mainMethod . saState) >>= getMethodLabel
97
getMainLabel :: CodeGenerator Label getMainLabel = gets (mainMethod . saState) >>= getMethodLabel
97
getMainLabel = gets (mainMethod . saState) >>= getMethodLabel
61
false
true
0
8
11
28
14
14
null
null
diminishedprime/.org
programmey_stuff/write_yourself_a_scheme/ch_05/hello.hs
mit
parseNumber'' :: Parser LispVal parseNumber'' = (many1 digit) >>= (return . Number . read)
90
parseNumber'' :: Parser LispVal parseNumber'' = (many1 digit) >>= (return . Number . read)
90
parseNumber'' = (many1 digit) >>= (return . Number . read)
58
false
true
0
8
13
35
18
17
null
null
brendanhay/gogol
gogol-admin-directory/gen/Network/Google/Resource/Directory/TwoStepVerification/TurnOff.hs
mpl-2.0
-- | V1 error format. tsvtoXgafv :: Lens' TwoStepVerificationTurnOff (Maybe Xgafv) tsvtoXgafv = lens _tsvtoXgafv (\ s a -> s{_tsvtoXgafv = a})
144
tsvtoXgafv :: Lens' TwoStepVerificationTurnOff (Maybe Xgafv) tsvtoXgafv = lens _tsvtoXgafv (\ s a -> s{_tsvtoXgafv = a})
122
tsvtoXgafv = lens _tsvtoXgafv (\ s a -> s{_tsvtoXgafv = a})
61
true
true
0
9
23
48
25
23
null
null
vladimir-ipatov/ganeti
test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs
gpl-2.0
isAlmostEqual (LCString s1) (LCString s2) = s1 ==? s2
53
isAlmostEqual (LCString s1) (LCString s2) = s1 ==? s2
53
isAlmostEqual (LCString s1) (LCString s2) = s1 ==? s2
53
false
false
1
8
8
31
13
18
null
null
acfoltzer/nbt
src/Data/NBT.hs
bsd-3-clause
typeOf ByteArrayTag {} = ByteArrayType
38
typeOf ByteArrayTag {} = ByteArrayType
38
typeOf ByteArrayTag {} = ByteArrayType
38
false
false
0
6
4
13
6
7
null
null
jystic/pointfree
test/Test.hs
mit
qcTests :: IO () qcTests = do quickCheck propRoundTrip quickCheck propMonotonic1 quickCheck propMonotonic2
112
qcTests :: IO () qcTests = do quickCheck propRoundTrip quickCheck propMonotonic1 quickCheck propMonotonic2
112
qcTests = do quickCheck propRoundTrip quickCheck propMonotonic1 quickCheck propMonotonic2
95
false
true
0
7
18
34
14
20
null
null
asi1024/WXCS
src/AppUtils.hs
mit
teamName :: String -> String teamName = id
42
teamName :: String -> String teamName = id
42
teamName = id
13
false
true
0
5
7
15
8
7
null
null
ekmett/ghc
compiler/codeGen/StgCmmClosure.hs
bsd-3-clause
thunkEntryLabel dflags _thunk_id _ (SelectorThunk offset) upd_flag = enterSelectorLabel dflags upd_flag offset
112
thunkEntryLabel dflags _thunk_id _ (SelectorThunk offset) upd_flag = enterSelectorLabel dflags upd_flag offset
112
thunkEntryLabel dflags _thunk_id _ (SelectorThunk offset) upd_flag = enterSelectorLabel dflags upd_flag offset
112
false
false
0
7
13
30
14
16
null
null
CarstenKoenig/AdventOfCode2016
Day12/Main.hs
mit
inputCPU2 :: IO CPU inputCPU2 = initialize <$> programm2
56
inputCPU2 :: IO CPU inputCPU2 = initialize <$> programm2
56
inputCPU2 = initialize <$> programm2
36
false
true
0
5
8
18
9
9
null
null
lifengsun/haskell-exercise
scheme/03/evaluator3.hs
gpl-3.0
main :: IO () main = do args <- getArgs putStrLn . show . eval . readExpr $ (args !! 0)
91
main :: IO () main = do args <- getArgs putStrLn . show . eval . readExpr $ (args !! 0)
91
main = do args <- getArgs putStrLn . show . eval . readExpr $ (args !! 0)
77
false
true
0
10
24
49
24
25
null
null
vladimir-ipatov/ganeti
src/Ganeti/Constants.hs
gpl-2.0
hvBlockdevPrefix :: String hvBlockdevPrefix = "blockdev_prefix"
63
hvBlockdevPrefix :: String hvBlockdevPrefix = "blockdev_prefix"
63
hvBlockdevPrefix = "blockdev_prefix"
36
false
true
0
6
5
18
7
11
null
null
alsonkemp/turbinado
Turbinado/Server/Network.hs
bsd-3-clause
-- | Convert the HTTP.Response to a CGI response for stdout. sendCGIResponse :: Environment -> CGI CGIResult sendCGIResponse e = do let r = fromJust' "Network: respondCGI: getResponse failed" $ getResponse e (c1,c2,c3) = rspCode r message = (unlines $ drop 1 $ lines $ show r) ++ "\n\n" ++ rspBody r -- need to drop the first line from the response for CGI mapM_ (\(Header k v) -> setHeader (show k) v) $ rspHeaders r setStatus (100*c1+10*c2+c3) (rspReason r) output $ rspBody r -- | Convert from HTTP_SOME_FLAG to Some-Flag for HTTP.parseHeaders
674
sendCGIResponse :: Environment -> CGI CGIResult sendCGIResponse e = do let r = fromJust' "Network: respondCGI: getResponse failed" $ getResponse e (c1,c2,c3) = rspCode r message = (unlines $ drop 1 $ lines $ show r) ++ "\n\n" ++ rspBody r -- need to drop the first line from the response for CGI mapM_ (\(Header k v) -> setHeader (show k) v) $ rspHeaders r setStatus (100*c1+10*c2+c3) (rspReason r) output $ rspBody r -- | Convert from HTTP_SOME_FLAG to Some-Flag for HTTP.parseHeaders
613
sendCGIResponse e = do let r = fromJust' "Network: respondCGI: getResponse failed" $ getResponse e (c1,c2,c3) = rspCode r message = (unlines $ drop 1 $ lines $ show r) ++ "\n\n" ++ rspBody r -- need to drop the first line from the response for CGI mapM_ (\(Header k v) -> setHeader (show k) v) $ rspHeaders r setStatus (100*c1+10*c2+c3) (rspReason r) output $ rspBody r -- | Convert from HTTP_SOME_FLAG to Some-Flag for HTTP.parseHeaders
565
true
true
0
16
220
181
88
93
null
null
Mathnerd314/lamdu
src/Lamdu/CodeEdit/ExpressionEdit/ExpressionGui/Monad.hs
gpl-3.0
wrapDelegated :: (MonadA f, MonadA m) => FocusDelegator.Config -> FocusDelegator.IsDelegating -> ((Widget f -> Widget f) -> a -> b) -> (Widget.Id -> ExprGuiM m a) -> Widget.Id -> ExprGuiM m b wrapDelegated = BWidgets.wrapDelegatedWith (widgetEnv WE.readCursor) (widgetEnv WE.readConfig) (localEnv . (WE.envCursor %~))
331
wrapDelegated :: (MonadA f, MonadA m) => FocusDelegator.Config -> FocusDelegator.IsDelegating -> ((Widget f -> Widget f) -> a -> b) -> (Widget.Id -> ExprGuiM m a) -> Widget.Id -> ExprGuiM m b wrapDelegated = BWidgets.wrapDelegatedWith (widgetEnv WE.readCursor) (widgetEnv WE.readConfig) (localEnv . (WE.envCursor %~))
331
wrapDelegated = BWidgets.wrapDelegatedWith (widgetEnv WE.readCursor) (widgetEnv WE.readConfig) (localEnv . (WE.envCursor %~))
129
false
true
0
13
56
134
68
66
null
null
keithodulaigh/Hets
Common/LibName.hs
gpl-2.0
prettyVersionNumber :: VersionNumber -> [Doc] prettyVersionNumber (VersionNumber v _) = [keyword versionS, hcat $ punctuate dot $ map codeToken v]
148
prettyVersionNumber :: VersionNumber -> [Doc] prettyVersionNumber (VersionNumber v _) = [keyword versionS, hcat $ punctuate dot $ map codeToken v]
148
prettyVersionNumber (VersionNumber v _) = [keyword versionS, hcat $ punctuate dot $ map codeToken v]
102
false
true
0
8
21
54
27
27
null
null
siddhanathan/ghc
testsuite/tests/codeGen/should_run/T2838.hs
bsd-3-clause
complement (I# x#) = I# (word2Int# (int2Word# (4294967295#) `xor#` int2Word# (-1#)))
84
complement (I# x#) = I# (word2Int# (int2Word# (4294967295#) `xor#` int2Word# (-1#)))
84
complement (I# x#) = I# (word2Int# (int2Word# (4294967295#) `xor#` int2Word# (-1#)))
84
false
false
0
12
10
47
24
23
null
null
rueshyna/gogol
gogol-genomics/gen/Network/Google/Genomics/Types/Product.hs
mpl-2.0
-- | The call set name. csName :: Lens' CallSet (Maybe Text) csName = lens _csName (\ s a -> s{_csName = a})
108
csName :: Lens' CallSet (Maybe Text) csName = lens _csName (\ s a -> s{_csName = a})
84
csName = lens _csName (\ s a -> s{_csName = a})
47
true
true
0
9
22
46
25
21
null
null
tjakway/ghcjvm
compiler/prelude/TysWiredIn.hs
bsd-3-clause
int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy, int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy, word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy, doubleElemRepDataConTy :: Type [int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy, int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy, word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy, doubleElemRepDataConTy] = map (mkTyConTy . promoteDataCon) vecElemDataCons
568
int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy, int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy, word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy, doubleElemRepDataConTy :: Type [int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy, int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy, word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy, doubleElemRepDataConTy] = map (mkTyConTy . promoteDataCon) vecElemDataCons
568
[int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy, int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy, word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy, doubleElemRepDataConTy] = map (mkTyConTy . promoteDataCon) vecElemDataCons
322
false
true
2
7
71
76
50
26
null
null
ekmett/ermine
src/Ermine/Interpreter.hs
bsd-2-clause
resolveUnboxed _ _ (Lit l) = return l
41
resolveUnboxed _ _ (Lit l) = return l
41
resolveUnboxed _ _ (Lit l) = return l
41
false
false
1
6
11
22
9
13
null
null
brendanhay/gogol
gogol-firebase-rules/gen/Network/Google/FirebaseRules/Types/Product.hs
mpl-2.0
-- | \`Ruleset\` name associated with the \`Release\` executable. grerRulesetName :: Lens' GetReleaseExecutableResponse (Maybe Text) grerRulesetName = lens _grerRulesetName (\ s a -> s{_grerRulesetName = a})
215
grerRulesetName :: Lens' GetReleaseExecutableResponse (Maybe Text) grerRulesetName = lens _grerRulesetName (\ s a -> s{_grerRulesetName = a})
149
grerRulesetName = lens _grerRulesetName (\ s a -> s{_grerRulesetName = a})
82
true
true
0
9
33
48
25
23
null
null
avh4/elm-format
tests/Test/ElmSourceGenerators.hs
bsd-3-clause
exportListing :: Gen String exportListing = oneof [ return "(foo)" -- , withWhitespace wsOptional $ words "( a , b , c )" ]
137
exportListing :: Gen String exportListing = oneof [ return "(foo)" -- , withWhitespace wsOptional $ words "( a , b , c )" ]
137
exportListing = oneof [ return "(foo)" -- , withWhitespace wsOptional $ words "( a , b , c )" ]
109
false
true
0
6
37
24
12
12
null
null
roman/Haskell-etc
etc/src/System/Etc/Internal/Config.hs
mit
_getConfigValueWith :: MonadThrow m => (JSON.Value -> JSON.Parser result) -> [Text] -> Config -> m result _getConfigValueWith parser keys0 (Config configValue0) = let loop keys configValue = case (keys, configValue) of ([], ConfigValue sources) -> case Set.maxView sources of Nothing -> throwM $ InvalidConfigKeyPath keys0 Just (None , _) -> throwM $ InvalidConfigKeyPath keys0 Just (source, _) -> case JSON.iparse parser (fromValue $ value source) of JSON.IError path err -> JSON.formatError path err & Text.pack & ConfigValueParserFailed keys0 & throwM JSON.ISuccess result -> return result ([], innerConfigValue) -> case JSON.iparse parser (configValueToJsonObject innerConfigValue) of JSON.IError path err -> JSON.formatError path err & Text.pack & ConfigValueParserFailed keys0 & throwM JSON.ISuccess result -> return result (k : keys1, SubConfig configm) -> case HashMap.lookup k configm of Nothing -> throwM $ InvalidConfigKeyPath keys0 Just configValue1 -> loop keys1 configValue1 _ -> throwM $ InvalidConfigKeyPath keys0 in loop keys0 configValue0
1,231
_getConfigValueWith :: MonadThrow m => (JSON.Value -> JSON.Parser result) -> [Text] -> Config -> m result _getConfigValueWith parser keys0 (Config configValue0) = let loop keys configValue = case (keys, configValue) of ([], ConfigValue sources) -> case Set.maxView sources of Nothing -> throwM $ InvalidConfigKeyPath keys0 Just (None , _) -> throwM $ InvalidConfigKeyPath keys0 Just (source, _) -> case JSON.iparse parser (fromValue $ value source) of JSON.IError path err -> JSON.formatError path err & Text.pack & ConfigValueParserFailed keys0 & throwM JSON.ISuccess result -> return result ([], innerConfigValue) -> case JSON.iparse parser (configValueToJsonObject innerConfigValue) of JSON.IError path err -> JSON.formatError path err & Text.pack & ConfigValueParserFailed keys0 & throwM JSON.ISuccess result -> return result (k : keys1, SubConfig configm) -> case HashMap.lookup k configm of Nothing -> throwM $ InvalidConfigKeyPath keys0 Just configValue1 -> loop keys1 configValue1 _ -> throwM $ InvalidConfigKeyPath keys0 in loop keys0 configValue0
1,231
_getConfigValueWith parser keys0 (Config configValue0) = let loop keys configValue = case (keys, configValue) of ([], ConfigValue sources) -> case Set.maxView sources of Nothing -> throwM $ InvalidConfigKeyPath keys0 Just (None , _) -> throwM $ InvalidConfigKeyPath keys0 Just (source, _) -> case JSON.iparse parser (fromValue $ value source) of JSON.IError path err -> JSON.formatError path err & Text.pack & ConfigValueParserFailed keys0 & throwM JSON.ISuccess result -> return result ([], innerConfigValue) -> case JSON.iparse parser (configValueToJsonObject innerConfigValue) of JSON.IError path err -> JSON.formatError path err & Text.pack & ConfigValueParserFailed keys0 & throwM JSON.ISuccess result -> return result (k : keys1, SubConfig configm) -> case HashMap.lookup k configm of Nothing -> throwM $ InvalidConfigKeyPath keys0 Just configValue1 -> loop keys1 configValue1 _ -> throwM $ InvalidConfigKeyPath keys0 in loop keys0 configValue0
1,123
false
true
0
22
320
398
190
208
null
null
fehu/hsgc
Test/Gravity/App/Gravity01.hs
mit
planet6InitPos = V2 planet6Radius 0
37
planet6InitPos = V2 planet6Radius 0
37
planet6InitPos = V2 planet6Radius 0
37
false
false
0
5
6
11
5
6
null
null
acowley/ghc
compiler/simplCore/CoreMonad.hs
bsd-3-clause
{- ************************************************************************ * * Counting and logging * * ************************************************************************ -} verboseSimplStats :: Bool verboseSimplStats = opt_PprStyle_Debug
397
verboseSimplStats :: Bool verboseSimplStats = opt_PprStyle_Debug
64
verboseSimplStats = opt_PprStyle_Debug
38
true
true
0
6
168
19
8
11
null
null
ducis/haAni
hs/common/Graphics/Rendering/OpenGL/GL/Framebuffer.hs
gpl-2.0
-------------------------------------------------------------------------------- -- | Controls whether the individual color components in the framebuffer can or -- cannot be written. If the red flag is 'Disabled', for example, no change is -- made to the red component of any pixel in any of the color buffers, -- regardless of the drawing operation attempted. Initially, all color -- components can be written. -- -- Changes to individual bits of components cannot be controlled. Rather, -- changes are either enabled or disabled for entire color components. -- Furthermore, this mask is used only in RGBA mode. colorMask :: StateVar (Color4 Capability) colorMask = makeStateVar (getBoolean4 (\r g b a -> Color4 (unmarshalCapability r) (unmarshalCapability g) (unmarshalCapability b) (unmarshalCapability a)) GetColorWritemask) (\(Color4 r g b a) -> glColorMask (marshalCapability r) (marshalCapability g) (marshalCapability b) (marshalCapability a))
1,243
colorMask :: StateVar (Color4 Capability) colorMask = makeStateVar (getBoolean4 (\r g b a -> Color4 (unmarshalCapability r) (unmarshalCapability g) (unmarshalCapability b) (unmarshalCapability a)) GetColorWritemask) (\(Color4 r g b a) -> glColorMask (marshalCapability r) (marshalCapability g) (marshalCapability b) (marshalCapability a))
628
colorMask = makeStateVar (getBoolean4 (\r g b a -> Color4 (unmarshalCapability r) (unmarshalCapability g) (unmarshalCapability b) (unmarshalCapability a)) GetColorWritemask) (\(Color4 r g b a) -> glColorMask (marshalCapability r) (marshalCapability g) (marshalCapability b) (marshalCapability a))
586
true
true
0
12
422
143
77
66
null
null
christiaanb/ghc
compiler/types/TypeRep.hs
bsd-3-clause
--------------- -- | Calls 'tidyType' on a top-level type (i.e. with an empty tidying environment) tidyTopType :: Type -> Type tidyTopType ty = tidyType emptyTidyEnv ty
168
tidyTopType :: Type -> Type tidyTopType ty = tidyType emptyTidyEnv ty
69
tidyTopType ty = tidyType emptyTidyEnv ty
41
true
true
0
7
25
30
14
16
null
null
8l/barrelfish
tools/flounder/MsgFragments.hs
mit
------------------------------------------------------- -- Utility function for working with arg fields -- This generates a C expression to access a given field ------------------------------------------------------- argfield_expr :: Direction -> String -> ArgField -> C.Expr argfield_expr TX mn [NamedField n] = tx_union_elem mn n
332
argfield_expr :: Direction -> String -> ArgField -> C.Expr argfield_expr TX mn [NamedField n] = tx_union_elem mn n
114
argfield_expr TX mn [NamedField n] = tx_union_elem mn n
55
true
true
0
8
39
53
26
27
null
null
uduki/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qHeaderViewFromPtr :: Ptr (TQHeaderView a) -> IO (QHeaderView a) qHeaderViewFromPtr p = objectFromPtr qtc_QHeaderView_getFinalizer p
134
qHeaderViewFromPtr :: Ptr (TQHeaderView a) -> IO (QHeaderView a) qHeaderViewFromPtr p = objectFromPtr qtc_QHeaderView_getFinalizer p
134
qHeaderViewFromPtr p = objectFromPtr qtc_QHeaderView_getFinalizer p
69
false
true
0
9
16
46
20
26
null
null
spinda/liquidhaskell
src/Language/Haskell/Liquid/Pipeline/Annotate.hs
bsd-3-clause
------------------------------------------------------------------------------ -- | Building Annotation Maps ------------------------------------------------ ------------------------------------------------------------------------------ -- | This function converts our annotation information into that which -- is required by `Language.Haskell.Liquid.ACSS` to generate mouseover -- annotations. mkAnnMap :: Config -> FixResult Error -> AnnInfo Doc -> ACSS.AnnMap mkAnnMap cfg res ann = ACSS.Ann (mkAnnMapTyp cfg ann) (mkAnnMapErr res) (mkStatus res)
559
mkAnnMap :: Config -> FixResult Error -> AnnInfo Doc -> ACSS.AnnMap mkAnnMap cfg res ann = ACSS.Ann (mkAnnMapTyp cfg ann) (mkAnnMapErr res) (mkStatus res)
158
mkAnnMap cfg res ann = ACSS.Ann (mkAnnMapTyp cfg ann) (mkAnnMapErr res) (mkStatus res)
90
true
true
0
8
62
73
38
35
null
null
ekmett/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxALL_PANES :: Int wxALL_PANES = 15
35
wxALL_PANES :: Int wxALL_PANES = 15
35
wxALL_PANES = 15
16
false
true
0
6
5
18
7
11
null
null
acowley/PointCloudViewer
src/Camera.hs
bsd-3-clause
up c = rotate (_rotation c) (_cameraUp c)
41
up c = rotate (_rotation c) (_cameraUp c)
41
up c = rotate (_rotation c) (_cameraUp c)
41
false
false
0
7
7
26
12
14
null
null
erochest/greek
SplitXml.hs
apache-2.0
mapNodeContent _ n = n
37
mapNodeContent _ n = n
37
mapNodeContent _ n = n
37
false
false
0
5
19
11
5
6
null
null
miguelpagano/equ
Equ/Theories.hs
gpl-3.0
folTheory :: TheoryName folTheory = "Proposicional"
51
folTheory :: TheoryName folTheory = "Proposicional"
51
folTheory = "Proposicional"
27
false
true
0
6
5
18
7
11
null
null
gridaphobe/liquid-fixpoint
src/Language/Fixpoint/Utils/Progress.hs
bsd-3-clause
mkPB :: Int -> IO ProgressBar mkPB n = newProgressBar def { pgWidth = 80 , pgTotal = toInteger n , pgFormat = "Working :percent [:bar]" , pgPendingChar = '.' , pgOnCompletion = Just "Done solving." -- :percent." }
375
mkPB :: Int -> IO ProgressBar mkPB n = newProgressBar def { pgWidth = 80 , pgTotal = toInteger n , pgFormat = "Working :percent [:bar]" , pgPendingChar = '.' , pgOnCompletion = Just "Done solving." -- :percent." }
374
mkPB n = newProgressBar def { pgWidth = 80 , pgTotal = toInteger n , pgFormat = "Working :percent [:bar]" , pgPendingChar = '.' , pgOnCompletion = Just "Done solving." -- :percent." }
342
false
true
0
8
200
67
36
31
null
null
qrilka/xlsx
src/Codec/Xlsx/Parser/Internal/PivotTable.hs
mit
fillCacheFieldsFromRecords :: [CacheField] -> [CacheRecord] -> [CacheField] fillCacheFieldsFromRecords fields recs = zipWith addValues fields (transpose recs) where addValues field recVals = if null (cfItems field) then field {cfItems = mapMaybe recToCellValue recVals} else field recToCellValue (CacheText t) = Just $ CellText t recToCellValue (CacheNumber n) = Just $ CellDouble n recToCellValue (CacheIndex _) = Nothing
464
fillCacheFieldsFromRecords :: [CacheField] -> [CacheRecord] -> [CacheField] fillCacheFieldsFromRecords fields recs = zipWith addValues fields (transpose recs) where addValues field recVals = if null (cfItems field) then field {cfItems = mapMaybe recToCellValue recVals} else field recToCellValue (CacheText t) = Just $ CellText t recToCellValue (CacheNumber n) = Just $ CellDouble n recToCellValue (CacheIndex _) = Nothing
464
fillCacheFieldsFromRecords fields recs = zipWith addValues fields (transpose recs) where addValues field recVals = if null (cfItems field) then field {cfItems = mapMaybe recToCellValue recVals} else field recToCellValue (CacheText t) = Just $ CellText t recToCellValue (CacheNumber n) = Just $ CellDouble n recToCellValue (CacheIndex _) = Nothing
388
false
true
3
10
96
145
73
72
null
null
ml9951/ghc
compiler/utils/StringBuffer.hs
bsd-3-clause
-- ----------------------------------------------------------------------------- -- Parsing integer strings in various bases parseUnsignedInteger :: StringBuffer -> Int -> Integer -> (Char->Int) -> Integer parseUnsignedInteger (StringBuffer buf _ cur) len radix char_to_int = inlinePerformIO $ withForeignPtr buf $ \ptr -> return $! let go i x | i == len = x | otherwise = case fst (utf8DecodeChar (ptr `plusPtr` (cur + i))) of char -> go (i + 1) (x * radix + toInteger (char_to_int char)) in go 0 0
534
parseUnsignedInteger :: StringBuffer -> Int -> Integer -> (Char->Int) -> Integer parseUnsignedInteger (StringBuffer buf _ cur) len radix char_to_int = inlinePerformIO $ withForeignPtr buf $ \ptr -> return $! let go i x | i == len = x | otherwise = case fst (utf8DecodeChar (ptr `plusPtr` (cur + i))) of char -> go (i + 1) (x * radix + toInteger (char_to_int char)) in go 0 0
409
parseUnsignedInteger (StringBuffer buf _ cur) len radix char_to_int = inlinePerformIO $ withForeignPtr buf $ \ptr -> return $! let go i x | i == len = x | otherwise = case fst (utf8DecodeChar (ptr `plusPtr` (cur + i))) of char -> go (i + 1) (x * radix + toInteger (char_to_int char)) in go 0 0
328
true
true
0
21
111
182
91
91
null
null
mitchellwrosen/kerchief
src/Handler/Edit.hs
bsd-3-clause
handleEdit :: [String] -> Kerchief () handleEdit ["--help"] = io printEditUsage
80
handleEdit :: [String] -> Kerchief () handleEdit ["--help"] = io printEditUsage
80
handleEdit ["--help"] = io printEditUsage
42
false
true
0
8
11
36
17
19
null
null
jcristovao/migrationplus
src/Database/Persist/Sqlite/Migrationplus.hs
mit
sqliteExtrasValidate :: ExtraCapabilities SqlUnit sqliteExtrasValidate = ExtraCapabilities validateTriggers -- ^ validate triggers definition and SQL using hssqlppp validateIndexes
253
sqliteExtrasValidate :: ExtraCapabilities SqlUnit sqliteExtrasValidate = ExtraCapabilities validateTriggers -- ^ validate triggers definition and SQL using hssqlppp validateIndexes
253
sqliteExtrasValidate = ExtraCapabilities validateTriggers -- ^ validate triggers definition and SQL using hssqlppp validateIndexes
203
false
true
0
5
90
20
10
10
null
null
snoyberg/ghc
compiler/cmm/CmmUtils.hs
bsd-3-clause
primRepForeignHint WordRep = NoHint
40
primRepForeignHint WordRep = NoHint
40
primRepForeignHint WordRep = NoHint
40
false
false
0
5
8
9
4
5
null
null
girving/duck
duck/Infer.hs
bsd-3-clause
apply _ loc t1 t2 = liftM ((,) NoTrans) $ app Infer.isTypeType appty $ app Infer.isTypeDelay appdel $ typeError loc ("cannot apply" <+> quoted t1 <+> "to" <+> quoted t2) where app t f r = maybe r f =<< t t1 appty ~(TyCons c tl) | length tl < length (dataVariances c) = typeType <$> if c == datatypeType then return t2 else do r <- isTypeType t2 case r of Just t -> return $ TyCons c (tl++[t]) _ -> typeError loc ("cannot apply" <+> quoted t1 <+> "to non-type" <+> quoted t2) | otherwise = typeError loc ("cannot apply" <+> quoted t1 <+> "to" <+> quoted t2 <> "," <+> quoted c <+> "is already fully applied") appdel t = do r <- tryError $ subset t2 typeUnit case r of Right (Right _) -> return t _ -> typeError loc ("cannot apply" <+> quoted t1 <+> "to" <+> quoted t2 <> ", can only be applied to" <+> quoted "()")
897
apply _ loc t1 t2 = liftM ((,) NoTrans) $ app Infer.isTypeType appty $ app Infer.isTypeDelay appdel $ typeError loc ("cannot apply" <+> quoted t1 <+> "to" <+> quoted t2) where app t f r = maybe r f =<< t t1 appty ~(TyCons c tl) | length tl < length (dataVariances c) = typeType <$> if c == datatypeType then return t2 else do r <- isTypeType t2 case r of Just t -> return $ TyCons c (tl++[t]) _ -> typeError loc ("cannot apply" <+> quoted t1 <+> "to non-type" <+> quoted t2) | otherwise = typeError loc ("cannot apply" <+> quoted t1 <+> "to" <+> quoted t2 <> "," <+> quoted c <+> "is already fully applied") appdel t = do r <- tryError $ subset t2 typeUnit case r of Right (Right _) -> return t _ -> typeError loc ("cannot apply" <+> quoted t1 <+> "to" <+> quoted t2 <> ", can only be applied to" <+> quoted "()")
897
apply _ loc t1 t2 = liftM ((,) NoTrans) $ app Infer.isTypeType appty $ app Infer.isTypeDelay appdel $ typeError loc ("cannot apply" <+> quoted t1 <+> "to" <+> quoted t2) where app t f r = maybe r f =<< t t1 appty ~(TyCons c tl) | length tl < length (dataVariances c) = typeType <$> if c == datatypeType then return t2 else do r <- isTypeType t2 case r of Just t -> return $ TyCons c (tl++[t]) _ -> typeError loc ("cannot apply" <+> quoted t1 <+> "to non-type" <+> quoted t2) | otherwise = typeError loc ("cannot apply" <+> quoted t1 <+> "to" <+> quoted t2 <> "," <+> quoted c <+> "is already fully applied") appdel t = do r <- tryError $ subset t2 typeUnit case r of Right (Right _) -> return t _ -> typeError loc ("cannot apply" <+> quoted t1 <+> "to" <+> quoted t2 <> ", can only be applied to" <+> quoted "()")
897
false
false
0
18
247
383
177
206
null
null
sinelaw/infernu
src/Infernu/Parse.hs
gpl-2.0
collectVarsMaybeExpr :: Maybe (ES3.Expression a) -> FuncScope -> FuncScope collectVarsMaybeExpr Nothing s = s
109
collectVarsMaybeExpr :: Maybe (ES3.Expression a) -> FuncScope -> FuncScope collectVarsMaybeExpr Nothing s = s
109
collectVarsMaybeExpr Nothing s = s
34
false
true
0
9
13
35
17
18
null
null
andreagenso/java2scala
test/Main.hs
apache-2.0
test "tsp179" = tsp179
22
test "tsp179" = tsp179
22
test "tsp179" = tsp179
22
false
false
0
4
3
10
4
6
null
null
ezyang/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
rationalToFloatIdKey, rationalToDoubleIdKey :: Unique rationalToFloatIdKey = mkPreludeMiscIdUnique 130
104
rationalToFloatIdKey, rationalToDoubleIdKey :: Unique rationalToFloatIdKey = mkPreludeMiscIdUnique 130
104
rationalToFloatIdKey = mkPreludeMiscIdUnique 130
50
false
true
2
6
9
23
9
14
null
null
ekr/tamarin-prover
lib/theory/src/Theory/Constraint/System/Guarded.hs
gpl-3.0
applyBSkTerm :: SkSubst -> VTerm SkConst BLVar -> VTerm SkConst BLVar applyBSkTerm subst = go where go t = case viewTerm t of Lit l -> applyBLLit l FApp o as -> fApp o (map go as) applyBLLit :: Lit SkConst BLVar -> VTerm SkConst BLVar applyBLLit l@(Var (Free v)) = maybe (lit l) (fmapTerm (fmap Free)) (imageOf subst v) applyBLLit l = lit l
402
applyBSkTerm :: SkSubst -> VTerm SkConst BLVar -> VTerm SkConst BLVar applyBSkTerm subst = go where go t = case viewTerm t of Lit l -> applyBLLit l FApp o as -> fApp o (map go as) applyBLLit :: Lit SkConst BLVar -> VTerm SkConst BLVar applyBLLit l@(Var (Free v)) = maybe (lit l) (fmapTerm (fmap Free)) (imageOf subst v) applyBLLit l = lit l
402
applyBSkTerm subst = go where go t = case viewTerm t of Lit l -> applyBLLit l FApp o as -> fApp o (map go as) applyBLLit :: Lit SkConst BLVar -> VTerm SkConst BLVar applyBLLit l@(Var (Free v)) = maybe (lit l) (fmapTerm (fmap Free)) (imageOf subst v) applyBLLit l = lit l
332
false
true
2
10
126
188
83
105
null
null
nishiuramakoto/logiku
test/Handler/PrologSpec.hs
gpl-3.0
---------------------------- Program 27 ---------------------------- program27 :: PrologIO Program program27 = do [list1,list2,list,x,y,l,m] <- getFreeVars 7 p <- program9 q <- sequence [ clause (devidelist list list1 list2) [ devide list list1 list2 , about_equal list1 list2 ] , clause (devide nil nil nil) [] , clause (devide (cons x list) (cons x list1) list2) [ devide list list1 list2 ] , clause (devide (cons x list) list1 (cons x list2)) [ devide list list1 list2 ] , clause (about_equal nil nil) [] , clause (about_equal nil (cons x nil)) [] , clause (about_equal (cons x nil) nil) [] , clause (about_equal (cons x l) (cons y m)) [ about_equal l m ] ] return $ p ++ q
770
program27 :: PrologIO Program program27 = do [list1,list2,list,x,y,l,m] <- getFreeVars 7 p <- program9 q <- sequence [ clause (devidelist list list1 list2) [ devide list list1 list2 , about_equal list1 list2 ] , clause (devide nil nil nil) [] , clause (devide (cons x list) (cons x list1) list2) [ devide list list1 list2 ] , clause (devide (cons x list) list1 (cons x list2)) [ devide list list1 list2 ] , clause (about_equal nil nil) [] , clause (about_equal nil (cons x nil)) [] , clause (about_equal (cons x nil) nil) [] , clause (about_equal (cons x l) (cons y m)) [ about_equal l m ] ] return $ p ++ q
699
program27 = do [list1,list2,list,x,y,l,m] <- getFreeVars 7 p <- program9 q <- sequence [ clause (devidelist list list1 list2) [ devide list list1 list2 , about_equal list1 list2 ] , clause (devide nil nil nil) [] , clause (devide (cons x list) (cons x list1) list2) [ devide list list1 list2 ] , clause (devide (cons x list) list1 (cons x list2)) [ devide list list1 list2 ] , clause (about_equal nil nil) [] , clause (about_equal nil (cons x nil)) [] , clause (about_equal (cons x nil) nil) [] , clause (about_equal (cons x l) (cons y m)) [ about_equal l m ] ] return $ p ++ q
669
true
true
0
14
211
334
166
168
null
null
seereason/cabal
cabal-install/Distribution/Client/Config.hs
bsd-3-clause
liftConfigExFlag :: FieldDescr ConfigExFlags -> FieldDescr SavedConfig liftConfigExFlag = liftField savedConfigureExFlags (\flags conf -> conf { savedConfigureExFlags = flags })
179
liftConfigExFlag :: FieldDescr ConfigExFlags -> FieldDescr SavedConfig liftConfigExFlag = liftField savedConfigureExFlags (\flags conf -> conf { savedConfigureExFlags = flags })
179
liftConfigExFlag = liftField savedConfigureExFlags (\flags conf -> conf { savedConfigureExFlags = flags })
108
false
true
0
9
21
45
23
22
null
null
brendanhay/gogol
gogol-serviceusage/gen/Network/Google/ServiceUsage/Types/Product.hs
mpl-2.0
-- | Creates a value of 'GoogleAPIServiceusageV1ServiceConfig' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'gasvscAuthentication' -- -- * 'gasvscAPIs' -- -- * 'gasvscMonitoredResources' -- -- * 'gasvscMonitoring' -- -- * 'gasvscName' -- -- * 'gasvscDocumentation' -- -- * 'gasvscUsage' -- -- * 'gasvscEndpoints' -- -- * 'gasvscTitle' -- -- * 'gasvscQuota' googleAPIServiceusageV1ServiceConfig :: GoogleAPIServiceusageV1ServiceConfig googleAPIServiceusageV1ServiceConfig = GoogleAPIServiceusageV1ServiceConfig' { _gasvscAuthentication = Nothing , _gasvscAPIs = Nothing , _gasvscMonitoredResources = Nothing , _gasvscMonitoring = Nothing , _gasvscName = Nothing , _gasvscDocumentation = Nothing , _gasvscUsage = Nothing , _gasvscEndpoints = Nothing , _gasvscTitle = Nothing , _gasvscQuota = Nothing }
937
googleAPIServiceusageV1ServiceConfig :: GoogleAPIServiceusageV1ServiceConfig googleAPIServiceusageV1ServiceConfig = GoogleAPIServiceusageV1ServiceConfig' { _gasvscAuthentication = Nothing , _gasvscAPIs = Nothing , _gasvscMonitoredResources = Nothing , _gasvscMonitoring = Nothing , _gasvscName = Nothing , _gasvscDocumentation = Nothing , _gasvscUsage = Nothing , _gasvscEndpoints = Nothing , _gasvscTitle = Nothing , _gasvscQuota = Nothing }
492
googleAPIServiceusageV1ServiceConfig = GoogleAPIServiceusageV1ServiceConfig' { _gasvscAuthentication = Nothing , _gasvscAPIs = Nothing , _gasvscMonitoredResources = Nothing , _gasvscMonitoring = Nothing , _gasvscName = Nothing , _gasvscDocumentation = Nothing , _gasvscUsage = Nothing , _gasvscEndpoints = Nothing , _gasvscTitle = Nothing , _gasvscQuota = Nothing }
411
true
true
0
6
166
96
70
26
null
null
rodrigo-machado/ufrgs-grt
src/Graph/Builder/Digraph.hs
gpl-3.0
nextEdgeId = nextId . edges
27
nextEdgeId = nextId . edges
27
nextEdgeId = nextId . edges
27
false
false
0
5
4
10
5
5
null
null
thalerjonathan/phd
thesis/code/sugarscape/src/SugarScape/Core/Discrete.hs
gpl-3.0
wrapDisc2d l@(maxX, _) WrapHorizontal (x, y) | x < 0 = wrapDisc2d l WrapHorizontal (x + maxX, y) | x >= maxX = wrapDisc2d l WrapHorizontal (x - maxX, y) | otherwise = (x, y)
183
wrapDisc2d l@(maxX, _) WrapHorizontal (x, y) | x < 0 = wrapDisc2d l WrapHorizontal (x + maxX, y) | x >= maxX = wrapDisc2d l WrapHorizontal (x - maxX, y) | otherwise = (x, y)
183
wrapDisc2d l@(maxX, _) WrapHorizontal (x, y) | x < 0 = wrapDisc2d l WrapHorizontal (x + maxX, y) | x >= maxX = wrapDisc2d l WrapHorizontal (x - maxX, y) | otherwise = (x, y)
183
false
false
1
8
44
101
53
48
null
null
kmels/dart-haskell
examples/interpreter/Lists.hs
bsd-3-clause
listTail :: List a -> List a listTail Nil = error "Empty list"
63
listTail :: List a -> List a listTail Nil = error "Empty list"
62
listTail Nil = error "Empty list"
33
false
true
0
7
13
32
13
19
null
null
gsnewmark/cis194
src/Cis194/Week1/Lecture.hs
apache-2.0
-- Booleans b1, b2 :: Bool b1 = True
36
b1, b2 :: Bool b1 = True
24
b1 = True
9
true
true
2
6
8
22
9
13
null
null
mrakgr/futhark
src/Futhark/Optimise/Simplifier/Rules.hs
bsd-3-clause
improveReshape :: LetTopDownRule lore u improveReshape _ seType (Reshape cs newshape v) | Just t <- seType $ Var v, newshape' <- informReshape (arrayDims t) newshape, newshape' /= newshape = Just $ Reshape cs newshape' v
236
improveReshape :: LetTopDownRule lore u improveReshape _ seType (Reshape cs newshape v) | Just t <- seType $ Var v, newshape' <- informReshape (arrayDims t) newshape, newshape' /= newshape = Just $ Reshape cs newshape' v
236
improveReshape _ seType (Reshape cs newshape v) | Just t <- seType $ Var v, newshape' <- informReshape (arrayDims t) newshape, newshape' /= newshape = Just $ Reshape cs newshape' v
196
false
true
0
11
51
91
42
49
null
null
unisonweb/platform
unison-core/src/Unison/Type.hs
mit
generalize' :: Var v => Var.Type -> Type v a -> Type v a generalize' k t = generalize vsk t where vsk = [ v | v <- Set.toList (freeVars t), Var.typeOf v == k ] -- | Bind the given variables with an outer `forall`, if they are used in `t`.
241
generalize' :: Var v => Var.Type -> Type v a -> Type v a generalize' k t = generalize vsk t where vsk = [ v | v <- Set.toList (freeVars t), Var.typeOf v == k ] -- | Bind the given variables with an outer `forall`, if they are used in `t`.
241
generalize' k t = generalize vsk t where vsk = [ v | v <- Set.toList (freeVars t), Var.typeOf v == k ] -- | Bind the given variables with an outer `forall`, if they are used in `t`.
184
false
true
0
11
55
97
45
52
null
null
ml9951/ghc
compiler/nativeGen/PPC/CodeGen.hs
bsd-3-clause
getRegister' _ (CmmMachOp (MO_SS_Conv W16 W32) [CmmLoad mem _]) = do Amode addr addr_code <- getAmode D mem return (Any II32 (\dst -> addr_code `snocOL` LA II16 dst addr))
179
getRegister' _ (CmmMachOp (MO_SS_Conv W16 W32) [CmmLoad mem _]) = do Amode addr addr_code <- getAmode D mem return (Any II32 (\dst -> addr_code `snocOL` LA II16 dst addr))
179
getRegister' _ (CmmMachOp (MO_SS_Conv W16 W32) [CmmLoad mem _]) = do Amode addr addr_code <- getAmode D mem return (Any II32 (\dst -> addr_code `snocOL` LA II16 dst addr))
179
false
false
1
14
36
90
42
48
null
null
tgdavies/codeworld
funblocks-client/src/Blocks/Types.hs
apache-2.0
colorPicture = Color 160
24
colorPicture = Color 160
24
colorPicture = Color 160
24
false
false
1
5
3
13
4
9
null
null
pparkkin/eta
compiler/ETA/BasicTypes/OccName.hs
bsd-3-clause
isVarOcc _ = False
36
isVarOcc _ = False
36
isVarOcc _ = False
36
false
false
0
5
21
9
4
5
null
null
bordaigorl/jamesbound
src/Language/PiCalc/Dot.hs
gpl-2.0
stdToDot' = stdToDotWith' stdDotParam
37
stdToDot' = stdToDotWith' stdDotParam
37
stdToDot' = stdToDotWith' stdDotParam
37
false
false
1
5
3
13
4
9
null
null
ggreif/clash-compiler
clash-verilog/src/CLaSH/Backend/Verilog.hs
bsd-2-clause
punctuate' :: Monad m => m Doc -> m [Doc] -> m Doc punctuate' s d = vcat (punctuate s d) <> s
93
punctuate' :: Monad m => m Doc -> m [Doc] -> m Doc punctuate' s d = vcat (punctuate s d) <> s
93
punctuate' s d = vcat (punctuate s d) <> s
42
false
true
0
9
22
58
27
31
null
null
lynnard/cocos2d-proj
src/Main.hs
mit
main = do os <- getOS putStrLn $ "OS: " ++ show os case os of Just IOS -> setEnableRetina True _ -> return () setAdjustViewPort True setDesignResolutionSize 960 640 ShowAll setResizeWithBrowserSize True winSize <- getWinSize gen <- createSystemRandom mainScene $ do askPostBuildEvent >>= runEvent_ . (liftIO (putStrLn "OH YEAH - main stuff finished building") <$) evts <- uiEvents dks <- dynKeysDown (evts^.keyPressed) (evts^.keyReleased) ts <- ticks -- fps10 <- dilate (1/10) ts drags <- dragged (evts^.singleTouches) (_, evt) <- layerColor [ color := blueviolet ] -<< do lift $ askPostBuildEvent >>= runEvent_ . (liftIO (putStrLn "first scene built") <$) [lTouched, rTouched] <- forM [ (300, yellow) , (500, brown) ] $ \(x, c) -> lift $ do l <- layerColor [ pos := x ^& (winSize^._y/2) , size := pure 100 , color := c ] filterMEvent ?? (evts^.touchBegan) $ nodeContains l . (^.loc) wrap $ leftmost [ P.platformer winSize dks ts <$ lTouched , boxThrower gen winSize drags ts <$ rTouched ] onEvent evt $ liftIO . putStrLn
1,337
main = do os <- getOS putStrLn $ "OS: " ++ show os case os of Just IOS -> setEnableRetina True _ -> return () setAdjustViewPort True setDesignResolutionSize 960 640 ShowAll setResizeWithBrowserSize True winSize <- getWinSize gen <- createSystemRandom mainScene $ do askPostBuildEvent >>= runEvent_ . (liftIO (putStrLn "OH YEAH - main stuff finished building") <$) evts <- uiEvents dks <- dynKeysDown (evts^.keyPressed) (evts^.keyReleased) ts <- ticks -- fps10 <- dilate (1/10) ts drags <- dragged (evts^.singleTouches) (_, evt) <- layerColor [ color := blueviolet ] -<< do lift $ askPostBuildEvent >>= runEvent_ . (liftIO (putStrLn "first scene built") <$) [lTouched, rTouched] <- forM [ (300, yellow) , (500, brown) ] $ \(x, c) -> lift $ do l <- layerColor [ pos := x ^& (winSize^._y/2) , size := pure 100 , color := c ] filterMEvent ?? (evts^.touchBegan) $ nodeContains l . (^.loc) wrap $ leftmost [ P.platformer winSize dks ts <$ lTouched , boxThrower gen winSize drags ts <$ rTouched ] onEvent evt $ liftIO . putStrLn
1,337
main = do os <- getOS putStrLn $ "OS: " ++ show os case os of Just IOS -> setEnableRetina True _ -> return () setAdjustViewPort True setDesignResolutionSize 960 640 ShowAll setResizeWithBrowserSize True winSize <- getWinSize gen <- createSystemRandom mainScene $ do askPostBuildEvent >>= runEvent_ . (liftIO (putStrLn "OH YEAH - main stuff finished building") <$) evts <- uiEvents dks <- dynKeysDown (evts^.keyPressed) (evts^.keyReleased) ts <- ticks -- fps10 <- dilate (1/10) ts drags <- dragged (evts^.singleTouches) (_, evt) <- layerColor [ color := blueviolet ] -<< do lift $ askPostBuildEvent >>= runEvent_ . (liftIO (putStrLn "first scene built") <$) [lTouched, rTouched] <- forM [ (300, yellow) , (500, brown) ] $ \(x, c) -> lift $ do l <- layerColor [ pos := x ^& (winSize^._y/2) , size := pure 100 , color := c ] filterMEvent ?? (evts^.touchBegan) $ nodeContains l . (^.loc) wrap $ leftmost [ P.platformer winSize dks ts <$ lTouched , boxThrower gen winSize drags ts <$ rTouched ] onEvent evt $ liftIO . putStrLn
1,337
false
false
0
26
485
424
207
217
null
null
valderman/selda
selda-tests/test/Tests/Mutable.hs
mit
insertAllDefaults = do setup pk <- untyped <$> insertWithPK comments [(def, def, def)] res <- query $ do comment <- select comments restrict (comment!cId .== literal pk) return comment assEq "wrong default values inserted" [(pk, Nothing, "")] res
266
insertAllDefaults = do setup pk <- untyped <$> insertWithPK comments [(def, def, def)] res <- query $ do comment <- select comments restrict (comment!cId .== literal pk) return comment assEq "wrong default values inserted" [(pk, Nothing, "")] res
266
insertAllDefaults = do setup pk <- untyped <$> insertWithPK comments [(def, def, def)] res <- query $ do comment <- select comments restrict (comment!cId .== literal pk) return comment assEq "wrong default values inserted" [(pk, Nothing, "")] res
266
false
false
0
14
57
106
51
55
null
null
ghcjs/ghcjs
src/Gen2/Prim.hs
mit
genPrim _ _ Pdep16Op [r] [s,m] = PrimInline $ r |= app "h$pdep16" [s,m]
80
genPrim _ _ Pdep16Op [r] [s,m] = PrimInline $ r |= app "h$pdep16" [s,m]
80
genPrim _ _ Pdep16Op [r] [s,m] = PrimInline $ r |= app "h$pdep16" [s,m]
80
false
false
0
7
22
45
24
21
null
null
stu-smith/rendering-in-haskell
src/experiment08/Color.hs
mit
plus :: Color -> Color -> Color plus (Color !r1 !g1 !b1) (Color !r2 !g2 !b2) = Color (r1 + r2) (g1 + g2) (b1 + b2)
138
plus :: Color -> Color -> Color plus (Color !r1 !g1 !b1) (Color !r2 !g2 !b2) = Color (r1 + r2) (g1 + g2) (b1 + b2)
138
plus (Color !r1 !g1 !b1) (Color !r2 !g2 !b2) = Color (r1 + r2) (g1 + g2) (b1 + b2)
106
false
true
0
8
50
78
37
41
null
null
isomorphism/hackage2
Distribution/Server/Util/Happstack.hs
bsd-3-clause
- | Allows a hidden '_method' field on a form to override the apparent -- method of a request. Useful until we can standardise on HTML 5. methodOverrideHack :: MonadIO m => ServerPartT m a -> ServerPartT m a methodOverrideHack rest = withDataFn (readM =<< look "_method") $ \mthd -> localRq (\req -> req { rqMethod = mthd }) rest
338
methodOverrideHack :: MonadIO m => ServerPartT m a -> ServerPartT m a methodOverrideHack rest = withDataFn (readM =<< look "_method") $ \mthd -> localRq (\req -> req { rqMethod = mthd }) rest
199
methodOverrideHack rest = withDataFn (readM =<< look "_method") $ \mthd -> localRq (\req -> req { rqMethod = mthd }) rest
129
true
true
1
12
68
91
48
43
null
null