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
yohad/OWTeamQueue
app/Main.hs
bsd-3-clause
isUser :: HandlerT App IO AuthResult isUser = do mu <- maybeAuthId return $ case mu of Nothing -> AuthenticationRequired Just _ -> Authorized
166
isUser :: HandlerT App IO AuthResult isUser = do mu <- maybeAuthId return $ case mu of Nothing -> AuthenticationRequired Just _ -> Authorized
166
isUser = do mu <- maybeAuthId return $ case mu of Nothing -> AuthenticationRequired Just _ -> Authorized
129
false
true
0
11
48
51
24
27
null
null
Peaker/lamdu
src/Lamdu/Sugar/Convert/GetVar.hs
gpl-3.0
convertParamsRecord :: Monad m => V.Var -> Input.Payload m a # V.Term -> MaybeT (ConvertM m) (GetVar InternalName (T m)) convertParamsRecord param exprPl = GetParamsRecord ParamsRecordVarRef { _prvFieldNames = exprPl ^.. Input.inferredType . _Pure . T._TRecord . T.flatRow . freExtends . Lens.itraversed . Lens.asIndex <&> nameWithContext Nothing param } <$ check where check = Lens.view (ConvertM.scScopeInfo . siTagParamInfos) <&> (^.. Lens.traversed . ConvertM._TagFieldParam) <&> map tpiFromParameters <&> elem param >>= guard
654
convertParamsRecord :: Monad m => V.Var -> Input.Payload m a # V.Term -> MaybeT (ConvertM m) (GetVar InternalName (T m)) convertParamsRecord param exprPl = GetParamsRecord ParamsRecordVarRef { _prvFieldNames = exprPl ^.. Input.inferredType . _Pure . T._TRecord . T.flatRow . freExtends . Lens.itraversed . Lens.asIndex <&> nameWithContext Nothing param } <$ check where check = Lens.view (ConvertM.scScopeInfo . siTagParamInfos) <&> (^.. Lens.traversed . ConvertM._TagFieldParam) <&> map tpiFromParameters <&> elem param >>= guard
654
convertParamsRecord param exprPl = GetParamsRecord ParamsRecordVarRef { _prvFieldNames = exprPl ^.. Input.inferredType . _Pure . T._TRecord . T.flatRow . freExtends . Lens.itraversed . Lens.asIndex <&> nameWithContext Nothing param } <$ check where check = Lens.view (ConvertM.scScopeInfo . siTagParamInfos) <&> (^.. Lens.traversed . ConvertM._TagFieldParam) <&> map tpiFromParameters <&> elem param >>= guard
525
false
true
11
15
194
206
96
110
null
null
GaloisInc/ivory
ivory-examples/examples/String.hs
bsd-3-clause
runString :: IO () runString = runCompiler [cmodule] [] initialOpts { outDir = Nothing }
88
runString :: IO () runString = runCompiler [cmodule] [] initialOpts { outDir = Nothing }
88
runString = runCompiler [cmodule] [] initialOpts { outDir = Nothing }
69
false
true
0
7
14
47
21
26
null
null
abramhindle/haskell-sand-game
Sand.hs
lgpl-3.0
sand_main = do SDL.init [InitEverything] setVideoMode maxWidth maxHeight 32 [] screen <- getVideoSurface back <- Image.load background ball <- Image.load tinyBall block <- Image.load tinyBlock blitSurface back Nothing screen Nothing SDL.flip screen let startState = baseGameState let drawParticle (Dust x y _ _) = blitSurface ball Nothing screen (Just (Rect (roundInt x) (roundInt y) 10 10)) drawParticle (Wall x y) = blitSurface block Nothing screen (Just (Rect (roundInt x) (roundInt y) 10 10)) let drawFrame state = do blitSurface back Nothing screen Nothing Monad.sequence_ (map drawParticle $ gParticles state) Monad.sequence_ (map drawParticle $ gFixed state) SDL.flip screen return (state{ gUpdate = False }) let eventLoop state = do state <- drawFrame state readEvents (particleStateUpdate state) readEvents state = do e <- pollEvent case e of (MouseMotion x y _ _) -> do let rx = fromIntegral x let ry = fromIntegral y let newstate = if (left (gMouse state)) then (addParticleToState ButtonLeft rx ry state) else if (right (gMouse state)) then addWall ButtonRight rx ry state else state eventLoop newstate (MouseButtonUp x y b) -> do eventLoop (state{ gMouse = updateMouseUp b (gMouse state) }) (MouseButtonDown x y b@ButtonLeft) -> do let rx = fromIntegral x let ry = fromIntegral y eventLoop (addParticleToState b rx ry state) (MouseButtonDown x y b@ButtonRight) -> do let rx = fromIntegral x let ry = fromIntegral y eventLoop (addWall b rx ry state) (KeyDown (Keysym SDLK_ESCAPE _ _)) -> do print "Quitting" quit Quit -> quit otherwise -> eventLoop state eventLoop startState
2,473
sand_main = do SDL.init [InitEverything] setVideoMode maxWidth maxHeight 32 [] screen <- getVideoSurface back <- Image.load background ball <- Image.load tinyBall block <- Image.load tinyBlock blitSurface back Nothing screen Nothing SDL.flip screen let startState = baseGameState let drawParticle (Dust x y _ _) = blitSurface ball Nothing screen (Just (Rect (roundInt x) (roundInt y) 10 10)) drawParticle (Wall x y) = blitSurface block Nothing screen (Just (Rect (roundInt x) (roundInt y) 10 10)) let drawFrame state = do blitSurface back Nothing screen Nothing Monad.sequence_ (map drawParticle $ gParticles state) Monad.sequence_ (map drawParticle $ gFixed state) SDL.flip screen return (state{ gUpdate = False }) let eventLoop state = do state <- drawFrame state readEvents (particleStateUpdate state) readEvents state = do e <- pollEvent case e of (MouseMotion x y _ _) -> do let rx = fromIntegral x let ry = fromIntegral y let newstate = if (left (gMouse state)) then (addParticleToState ButtonLeft rx ry state) else if (right (gMouse state)) then addWall ButtonRight rx ry state else state eventLoop newstate (MouseButtonUp x y b) -> do eventLoop (state{ gMouse = updateMouseUp b (gMouse state) }) (MouseButtonDown x y b@ButtonLeft) -> do let rx = fromIntegral x let ry = fromIntegral y eventLoop (addParticleToState b rx ry state) (MouseButtonDown x y b@ButtonRight) -> do let rx = fromIntegral x let ry = fromIntegral y eventLoop (addWall b rx ry state) (KeyDown (Keysym SDLK_ESCAPE _ _)) -> do print "Quitting" quit Quit -> quit otherwise -> eventLoop state eventLoop startState
2,473
sand_main = do SDL.init [InitEverything] setVideoMode maxWidth maxHeight 32 [] screen <- getVideoSurface back <- Image.load background ball <- Image.load tinyBall block <- Image.load tinyBlock blitSurface back Nothing screen Nothing SDL.flip screen let startState = baseGameState let drawParticle (Dust x y _ _) = blitSurface ball Nothing screen (Just (Rect (roundInt x) (roundInt y) 10 10)) drawParticle (Wall x y) = blitSurface block Nothing screen (Just (Rect (roundInt x) (roundInt y) 10 10)) let drawFrame state = do blitSurface back Nothing screen Nothing Monad.sequence_ (map drawParticle $ gParticles state) Monad.sequence_ (map drawParticle $ gFixed state) SDL.flip screen return (state{ gUpdate = False }) let eventLoop state = do state <- drawFrame state readEvents (particleStateUpdate state) readEvents state = do e <- pollEvent case e of (MouseMotion x y _ _) -> do let rx = fromIntegral x let ry = fromIntegral y let newstate = if (left (gMouse state)) then (addParticleToState ButtonLeft rx ry state) else if (right (gMouse state)) then addWall ButtonRight rx ry state else state eventLoop newstate (MouseButtonUp x y b) -> do eventLoop (state{ gMouse = updateMouseUp b (gMouse state) }) (MouseButtonDown x y b@ButtonLeft) -> do let rx = fromIntegral x let ry = fromIntegral y eventLoop (addParticleToState b rx ry state) (MouseButtonDown x y b@ButtonRight) -> do let rx = fromIntegral x let ry = fromIntegral y eventLoop (addWall b rx ry state) (KeyDown (Keysym SDLK_ESCAPE _ _)) -> do print "Quitting" quit Quit -> quit otherwise -> eventLoop state eventLoop startState
2,473
false
false
1
26
1,133
708
323
385
null
null
mettekou/ghc
compiler/deSugar/DsForeign.hs
bsd-3-clause
unpackHObj :: Type -> SDoc unpackHObj t = text "rts_get" <> text (showFFIType t)
80
unpackHObj :: Type -> SDoc unpackHObj t = text "rts_get" <> text (showFFIType t)
80
unpackHObj t = text "rts_get" <> text (showFFIType t)
53
false
true
0
8
13
39
17
22
null
null
innovimax/bond
compiler/Main.hs
mit
csCodegen _ = error "csCodegen: impossible happened."
53
csCodegen _ = error "csCodegen: impossible happened."
53
csCodegen _ = error "csCodegen: impossible happened."
53
false
false
0
5
6
13
5
8
null
null
coghex/abridgefaraway
src/ABFA/Settings.hs
bsd-3-clause
--these reference settings will help if there is error, and will define the size of the boxes refscreenw = 640::Int
115
refscreenw = 640::Int
21
refscreenw = 640::Int
21
true
false
0
4
19
10
6
4
null
null
dschalk/js-monads-cycle-1
dist/build/autogen/Paths_js_monads_cycle1.hs
mit
getDataDir = catchIO (getEnv "js_monads_cycle1_datadir") (\_ -> return datadir)
79
getDataDir = catchIO (getEnv "js_monads_cycle1_datadir") (\_ -> return datadir)
79
getDataDir = catchIO (getEnv "js_monads_cycle1_datadir") (\_ -> return datadir)
79
false
false
1
8
8
32
14
18
null
null
taylor1791/HakTools
haskell/test/Learning/PerceptronProps.hs
mit
prop_plaStable (PerceptronStable xys) = and $ map (\(x,y) -> y == p x) xys where p = pla xys
102
prop_plaStable (PerceptronStable xys) = and $ map (\(x,y) -> y == p x) xys where p = pla xys
102
prop_plaStable (PerceptronStable xys) = and $ map (\(x,y) -> y == p x) xys where p = pla xys
102
false
false
1
10
28
59
28
31
null
null
jtojnar/haste-compiler
libraries/ghc-7.10/ghc-prim/GHC/PrimopWrappers.hs
bsd-3-clause
writeSmallArray# :: SmallMutableArray# s a -> Int# -> a -> State# s -> State# s writeSmallArray# a1 a2 a3 a4 = (GHC.Prim.writeSmallArray#) a1 a2 a3 a4
150
writeSmallArray# :: SmallMutableArray# s a -> Int# -> a -> State# s -> State# s writeSmallArray# a1 a2 a3 a4 = (GHC.Prim.writeSmallArray#) a1 a2 a3 a4
150
writeSmallArray# a1 a2 a3 a4 = (GHC.Prim.writeSmallArray#) a1 a2 a3 a4
70
false
true
0
9
25
62
30
32
null
null
nomeata/ghc
utils/genprimopcode/Main.hs
bsd-3-clause
ppType (TyApp "Double#" []) = "doublePrimTy"
48
ppType (TyApp "Double#" []) = "doublePrimTy"
48
ppType (TyApp "Double#" []) = "doublePrimTy"
48
false
false
0
7
9
20
9
11
null
null
BartAdv/Idris-dev
src/Idris/Primitives.hs
bsd-3-clause
p_strCons [Ch x, Str xs] = Just $ Str (x:xs)
44
p_strCons [Ch x, Str xs] = Just $ Str (x:xs)
44
p_strCons [Ch x, Str xs] = Just $ Str (x:xs)
44
false
false
2
6
9
37
17
20
null
null
facebookincubator/duckling
tests/Duckling/AmountOfMoney/AR/Tests.hs
bsd-3-clause
tests :: TestTree tests = testGroup "AR Tests" [ makeCorpusTest [Seal AmountOfMoney] corpus ]
97
tests :: TestTree tests = testGroup "AR Tests" [ makeCorpusTest [Seal AmountOfMoney] corpus ]
97
tests = testGroup "AR Tests" [ makeCorpusTest [Seal AmountOfMoney] corpus ]
79
false
true
0
8
17
31
15
16
null
null
mightymoose/liquidhaskell
src/Language/Haskell/Liquid/Parse.hs
bsd-3-clause
symsP = do reserved "\\" ss <- sepBy symbolP spaces reserved "->" return $ (, dummyRSort) <$> ss <|> return []
134
symsP = do reserved "\\" ss <- sepBy symbolP spaces reserved "->" return $ (, dummyRSort) <$> ss <|> return []
134
symsP = do reserved "\\" ss <- sepBy symbolP spaces reserved "->" return $ (, dummyRSort) <$> ss <|> return []
134
false
false
4
9
44
60
26
34
null
null
mightymoose/liquidhaskell
benchmarks/xmonad-0.10/XMonad/Operations.hs
bsd-3-clause
-- | XXX comment me applySizeHints' :: SizeHints -> D -> D applySizeHints' sh = maybe id applyMaxSizeHint (sh_max_size sh) . maybe id (\(bw, bh) (w, h) -> (w+bw, h+bh)) (sh_base_size sh) . maybe id applyResizeIncHint (sh_resize_inc sh) . maybe id applyAspectHint (sh_aspect sh) . maybe id (\(bw,bh) (w,h) -> (w-bw, h-bh)) (sh_base_size sh)
424
applySizeHints' :: SizeHints -> D -> D applySizeHints' sh = maybe id applyMaxSizeHint (sh_max_size sh) . maybe id (\(bw, bh) (w, h) -> (w+bw, h+bh)) (sh_base_size sh) . maybe id applyResizeIncHint (sh_resize_inc sh) . maybe id applyAspectHint (sh_aspect sh) . maybe id (\(bw,bh) (w,h) -> (w-bw, h-bh)) (sh_base_size sh)
404
applySizeHints' sh = maybe id applyMaxSizeHint (sh_max_size sh) . maybe id (\(bw, bh) (w, h) -> (w+bw, h+bh)) (sh_base_size sh) . maybe id applyResizeIncHint (sh_resize_inc sh) . maybe id applyAspectHint (sh_aspect sh) . maybe id (\(bw,bh) (w,h) -> (w-bw, h-bh)) (sh_base_size sh)
365
true
true
4
9
138
180
94
86
null
null
ihc/futhark
src/futhark-dataset.hs
isc
seti32Range :: Range Int32 -> RandomConfiguration -> RandomConfiguration seti32Range bounds config = config { i32Range = bounds }
129
seti32Range :: Range Int32 -> RandomConfiguration -> RandomConfiguration seti32Range bounds config = config { i32Range = bounds }
129
seti32Range bounds config = config { i32Range = bounds }
56
false
true
0
6
17
35
18
17
null
null
vizietto/kalkulu
src/Kalkulu/Builtin/Times.hs
gpl-3.0
pureTimes _ = error "unreachable"
33
pureTimes _ = error "unreachable"
33
pureTimes _ = error "unreachable"
33
false
false
0
5
4
12
5
7
null
null
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/AutoScalingPlansScalingPlanTargetTrackingConfiguration.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-targettrackingconfiguration.html#cfn-autoscalingplans-scalingplan-targettrackingconfiguration-customizedscalingmetricspecification aspspttcCustomizedScalingMetricSpecification :: Lens' AutoScalingPlansScalingPlanTargetTrackingConfiguration (Maybe AutoScalingPlansScalingPlanCustomizedScalingMetricSpecification) aspspttcCustomizedScalingMetricSpecification = lens _autoScalingPlansScalingPlanTargetTrackingConfigurationCustomizedScalingMetricSpecification (\s a -> s { _autoScalingPlansScalingPlanTargetTrackingConfigurationCustomizedScalingMetricSpecification = a })
678
aspspttcCustomizedScalingMetricSpecification :: Lens' AutoScalingPlansScalingPlanTargetTrackingConfiguration (Maybe AutoScalingPlansScalingPlanCustomizedScalingMetricSpecification) aspspttcCustomizedScalingMetricSpecification = lens _autoScalingPlansScalingPlanTargetTrackingConfigurationCustomizedScalingMetricSpecification (\s a -> s { _autoScalingPlansScalingPlanTargetTrackingConfigurationCustomizedScalingMetricSpecification = a })
436
aspspttcCustomizedScalingMetricSpecification = lens _autoScalingPlansScalingPlanTargetTrackingConfigurationCustomizedScalingMetricSpecification (\s a -> s { _autoScalingPlansScalingPlanTargetTrackingConfigurationCustomizedScalingMetricSpecification = a })
255
true
true
0
9
21
46
25
21
null
null
exercism/xhaskell
exercises/practice/complex-numbers/src/ComplexNumbers.hs
mit
complex :: (a, a) -> Complex a complex = error "You need to implement this function"
84
complex :: (a, a) -> Complex a complex = error "You need to implement this function"
84
complex = error "You need to implement this function"
53
false
true
0
6
15
27
14
13
null
null
anttisalonen/economics
src/Cost.hs
mit
marginalCosts :: CostFunction -> Rental -> Wage -> MarginalCostFunction marginalCosts (_, pf) = marginalCosts' pf
113
marginalCosts :: CostFunction -> Rental -> Wage -> MarginalCostFunction marginalCosts (_, pf) = marginalCosts' pf
113
marginalCosts (_, pf) = marginalCosts' pf
41
false
true
0
7
14
35
18
17
null
null
nomeata/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
mkConInfoTableLabel name c = IdLabel name c ConInfoTable
63
mkConInfoTableLabel name c = IdLabel name c ConInfoTable
63
mkConInfoTableLabel name c = IdLabel name c ConInfoTable
63
false
false
0
5
14
18
8
10
null
null
hvr/lens
src/System/FilePath/Lens.hs
bsd-3-clause
-- | Add an extension onto the end of the target of a 'Lens' into -- your monad's state and return the result. -- -- >>> evalState (_1 <<.>= "txt") ("hello","world") -- "hello.txt" -- -- When you do not need the result of the operation, ('<.>=') is more flexible. (<<.>=) :: MonadState s m => LensLike' ((,)FilePath) s FilePath -> String -> m FilePath l <<.>= r = l <%= (<.> r)
377
(<<.>=) :: MonadState s m => LensLike' ((,)FilePath) s FilePath -> String -> m FilePath l <<.>= r = l <%= (<.> r)
113
l <<.>= r = l <%= (<.> r)
25
true
true
2
11
71
77
42
35
null
null
xpika/music-diatonic
Music/Diatonic/Chord.hs
bsd-3-clause
-- | Builds a 'Diminished' 7th 'Chord' (1-b3-b5-bb7) rooted at the specified 'Note'. diminished7thChord :: Note -> Chord diminished7thChord n = Tetrad (diminishedChord n) $ diminish Min7th
188
diminished7thChord :: Note -> Chord diminished7thChord n = Tetrad (diminishedChord n) $ diminish Min7th
103
diminished7thChord n = Tetrad (diminishedChord n) $ diminish Min7th
67
true
true
0
8
26
40
18
22
null
null
whackashoe/HaskellVerbalExpressions
Text/Regex/VerbalExpressions/verbalexpressions.hs
mit
startOfLine :: VerStruct -> VerStruct startOfLine v = startOfLine True v
79
startOfLine :: VerStruct -> VerStruct startOfLine v = startOfLine True v
79
startOfLine v = startOfLine True v
41
false
true
0
5
17
23
11
12
null
null
mmakowski/ambc
src/UntypedLambda/Syntax.hs
mit
prettyPrint (App term1 term2) = "(" ++ prettyPrint term1 ++ " " ++ prettyPrint term2 ++ ")"
91
prettyPrint (App term1 term2) = "(" ++ prettyPrint term1 ++ " " ++ prettyPrint term2 ++ ")"
91
prettyPrint (App term1 term2) = "(" ++ prettyPrint term1 ++ " " ++ prettyPrint term2 ++ ")"
91
false
false
0
9
16
39
18
21
null
null
chrisbloecker/Hive
src/Hive/Problem/Arithmetic.hs
gpl-3.0
-- | Takes a pair of Ints and creates a Cloud Haskell process which adds them -- -- > add (x, y) = return (x + y) add :: (Int, Int) -> CH.Process Int add (x, y) = return (x + y)
177
add :: (Int, Int) -> CH.Process Int add (x, y) = return (x + y)
63
add (x, y) = return (x + y)
27
true
true
0
8
41
53
28
25
null
null
timtylin/scholdoc-citeproc
src/Text/CSL/Eval/Date.hs
bsd-3-clause
getOrdinal :: String -> String -> [CslTerm] -> CslTerm getOrdinal v s ts = case findTerm' s Long gender ts of Just x -> x Nothing -> case findTerm' s Long Neuter ts of Just x -> x Nothing -> newTerm where gender = if v `elem` numericVars || "month" `isPrefixOf` v then maybe Neuter termGender $ findTerm v Long ts else Neuter
429
getOrdinal :: String -> String -> [CslTerm] -> CslTerm getOrdinal v s ts = case findTerm' s Long gender ts of Just x -> x Nothing -> case findTerm' s Long Neuter ts of Just x -> x Nothing -> newTerm where gender = if v `elem` numericVars || "month" `isPrefixOf` v then maybe Neuter termGender $ findTerm v Long ts else Neuter
429
getOrdinal v s ts = case findTerm' s Long gender ts of Just x -> x Nothing -> case findTerm' s Long Neuter ts of Just x -> x Nothing -> newTerm where gender = if v `elem` numericVars || "month" `isPrefixOf` v then maybe Neuter termGender $ findTerm v Long ts else Neuter
374
false
true
0
11
166
136
69
67
null
null
ImsungChoi/haskell-test
src/Fun.hs
bsd-3-clause
extend :: State -> String -> Value -> State extend st name val x = if x == name then val else st x
98
extend :: State -> String -> Value -> State extend st name val x = if x == name then val else st x
98
extend st name val x = if x == name then val else st x
54
false
true
0
7
23
52
25
27
null
null
tonyfischetti/99-haskell-problems
Q1to10.hs
unlicense
-- with case statements -- .02s - .03s - .04s last' xs = case xs of (x:[]) -> x (x:xs) -> last' xs -- other solutions from website -- .01s - .02s - .04s
180
last' xs = case xs of (x:[]) -> x (x:xs) -> last' xs -- other solutions from website -- .01s - .02s - .04s
134
last' xs = case xs of (x:[]) -> x (x:xs) -> last' xs -- other solutions from website -- .01s - .02s - .04s
134
true
false
0
10
61
48
26
22
null
null
ezyang/ghc
testsuite/tests/codeGen/should_run/cgrun049.hs
bsd-3-clause
f :: T -> T -- Takes apart the thing and puts it -- back together differently f (MkT x y (a,b) (MkS p q)) = MkT a b (p,q) (MkS x y)
151
f :: T -> T f (MkT x y (a,b) (MkS p q)) = MkT a b (p,q) (MkS x y)
65
f (MkT x y (a,b) (MkS p q)) = MkT a b (p,q) (MkS x y)
53
true
true
0
11
52
75
38
37
null
null
nevrenato/Hets_Fork
Static/GTheory.hs
gpl-2.0
{- | mark all sentences of a local theory that have been proven via a prover over a global theory (with the same signature) as proven. Also mark duplicates of proven sentences as proven. Assume that the sentence names of the local theory are identical to the global theory. -} propagateProofs :: G_theory -> G_theory -> G_theory propagateProofs locTh@(G_theory lid1 sig ind lsens _) (G_theory lid2 _ _ gsens _) = case coerceThSens lid2 lid1 "" gsens of Just ps -> if Map.null ps then locTh else G_theory lid1 sig ind (proveSens lid1 $ Map.union (Map.intersection ps lsens) lsens) startThId Nothing -> error "propagateProofs" -- | Grothendieck diagrams
706
propagateProofs :: G_theory -> G_theory -> G_theory propagateProofs locTh@(G_theory lid1 sig ind lsens _) (G_theory lid2 _ _ gsens _) = case coerceThSens lid2 lid1 "" gsens of Just ps -> if Map.null ps then locTh else G_theory lid1 sig ind (proveSens lid1 $ Map.union (Map.intersection ps lsens) lsens) startThId Nothing -> error "propagateProofs" -- | Grothendieck diagrams
427
propagateProofs locTh@(G_theory lid1 sig ind lsens _) (G_theory lid2 _ _ gsens _) = case coerceThSens lid2 lid1 "" gsens of Just ps -> if Map.null ps then locTh else G_theory lid1 sig ind (proveSens lid1 $ Map.union (Map.intersection ps lsens) lsens) startThId Nothing -> error "propagateProofs" -- | Grothendieck diagrams
375
true
true
0
15
162
145
71
74
null
null
ezyang/ghc
ghc/Main.hs
bsd-3-clause
needsInputsMode :: PostLoadMode -> Bool needsInputsMode DoMkDependHS = True
78
needsInputsMode :: PostLoadMode -> Bool needsInputsMode DoMkDependHS = True
78
needsInputsMode DoMkDependHS = True
38
false
true
0
5
11
18
9
9
null
null
GaloisInc/halvm-ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
isTypeArg _ = False
27
isTypeArg _ = False
27
isTypeArg _ = False
27
false
false
0
4
11
10
4
6
null
null
eklavya/Idris-dev
src/Idris/Core/ProofTerm.hs
bsd-3-clause
updateEnv :: [(Name, Term)] -> Env -> Env updateEnv [] e = e
60
updateEnv :: [(Name, Term)] -> Env -> Env updateEnv [] e = e
60
updateEnv [] e = e
18
false
true
0
7
12
35
19
16
null
null
jbddc/vf-verifier
src/VCGenerator.hs
gpl-3.0
condition2VC idents (LessThan c1 c2) = do x <- expression2VC idents c1 y <- expression2VC idents c2 mkLt x y
120
condition2VC idents (LessThan c1 c2) = do x <- expression2VC idents c1 y <- expression2VC idents c2 mkLt x y
120
condition2VC idents (LessThan c1 c2) = do x <- expression2VC idents c1 y <- expression2VC idents c2 mkLt x y
120
false
false
0
8
31
51
22
29
null
null
stackbuilders/dbcleaner
src/Database/DBCleaner/PostgreSQLSimple.hs
mit
truncateTable :: Connection -> Text -> IO () truncateTable c = void . execute c q . Only . Identifier where q = "TRUNCATE ? CASCADE"
138
truncateTable :: Connection -> Text -> IO () truncateTable c = void . execute c q . Only . Identifier where q = "TRUNCATE ? CASCADE"
138
truncateTable c = void . execute c q . Only . Identifier where q = "TRUNCATE ? CASCADE"
93
false
true
1
8
31
56
25
31
null
null
tjakway/ghcjvm
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
pprParendType (TupleT 0) = text "()"
45
pprParendType (TupleT 0) = text "()"
45
pprParendType (TupleT 0) = text "()"
45
false
false
0
7
14
18
8
10
null
null
keithodulaigh/Hets
Comorphisms/ExtModal2ExtModalTotal.hs
gpl-2.0
emEncodeSig :: Set.Set SORT -> Sign f EModalSign -> Sign f EModalSign emEncodeSig bsrts sig = (encodeSig bsrts sig) { extendedInfo = let extInfo = extendedInfo sig in extInfo { flexOps = MapSet.map mkTotal $ flexOps extInfo }}
234
emEncodeSig :: Set.Set SORT -> Sign f EModalSign -> Sign f EModalSign emEncodeSig bsrts sig = (encodeSig bsrts sig) { extendedInfo = let extInfo = extendedInfo sig in extInfo { flexOps = MapSet.map mkTotal $ flexOps extInfo }}
234
emEncodeSig bsrts sig = (encodeSig bsrts sig) { extendedInfo = let extInfo = extendedInfo sig in extInfo { flexOps = MapSet.map mkTotal $ flexOps extInfo }}
164
false
true
0
14
45
93
44
49
null
null
brendanhay/gogol
gogol-servicemanagement/gen/Network/Google/ServiceManagement/Types/Product.hs
mpl-2.0
-- | Deprecated. Must use the MetricDescriptor.launch_stage instead. mdmLaunchStage :: Lens' MetricDescriptorMetadata (Maybe MetricDescriptorMetadataLaunchStage) mdmLaunchStage = lens _mdmLaunchStage (\ s a -> s{_mdmLaunchStage = a})
241
mdmLaunchStage :: Lens' MetricDescriptorMetadata (Maybe MetricDescriptorMetadataLaunchStage) mdmLaunchStage = lens _mdmLaunchStage (\ s a -> s{_mdmLaunchStage = a})
172
mdmLaunchStage = lens _mdmLaunchStage (\ s a -> s{_mdmLaunchStage = a})
79
true
true
0
9
32
48
25
23
null
null
tel/mcmc
src/Numeric/Sampling/MCMC.hs
mit
-- | Compute the initial state space based on a differentiable function. naturalS :: (Num a, Traversable f) => (forall s. f (AD s a) -> AD s a) -> Point f a -> StateS f a naturalS f px@(P x) = StateS px (grad f x)
225
naturalS :: (Num a, Traversable f) => (forall s. f (AD s a) -> AD s a) -> Point f a -> StateS f a naturalS f px@(P x) = StateS px (grad f x)
152
naturalS f px@(P x) = StateS px (grad f x)
42
true
true
3
10
58
101
51
50
null
null
mckeankylej/hchess
src/Board.hs
bsd-3-clause
--TODO: Two options: 1 We move throwing an error to the parsing function -- 2 Change the type sig to FEN -> Maybe Board fromFEN :: FEN -> Board fromFEN (FEN bb t crs ep hc fc) = Board bb t crs ep hc fc (initKings white) (initKings black) where initKings color = bool ((countTrailingZeros . color . kingsB) bb) (error "King not placed in FEN") (((== 0) . color . kingsB) bb)
473
fromFEN :: FEN -> Board fromFEN (FEN bb t crs ep hc fc) = Board bb t crs ep hc fc (initKings white) (initKings black) where initKings color = bool ((countTrailingZeros . color . kingsB) bb) (error "King not placed in FEN") (((== 0) . color . kingsB) bb)
335
fromFEN (FEN bb t crs ep hc fc) = Board bb t crs ep hc fc (initKings white) (initKings black) where initKings color = bool ((countTrailingZeros . color . kingsB) bb) (error "King not placed in FEN") (((== 0) . color . kingsB) bb)
311
true
true
0
13
172
126
65
61
null
null
bitemyapp/hakaru
Tests/Lazy.hs
bsd-3-clause
t8 :: (Mochastic repr) => Cond repr HUnit (HMeasure (HPair HReal HReal)) t8 = \u -> ununit u $ dirac (uniform 0 1 `bind` \x -> dirac (1+x)) `bind` \m -> m `bind` \x -> m `bind` \y -> dirac (pair x y)
219
t8 :: (Mochastic repr) => Cond repr HUnit (HMeasure (HPair HReal HReal)) t8 = \u -> ununit u $ dirac (uniform 0 1 `bind` \x -> dirac (1+x)) `bind` \m -> m `bind` \x -> m `bind` \y -> dirac (pair x y)
219
t8 = \u -> ununit u $ dirac (uniform 0 1 `bind` \x -> dirac (1+x)) `bind` \m -> m `bind` \x -> m `bind` \y -> dirac (pair x y)
146
false
true
0
14
62
129
70
59
null
null
nikita-volkov/postgresql-error-codes
library/PostgreSQL/ErrorCodes.hs
mit
-- | Code \"22P06\". nonstandard_use_of_escape_character :: ErrorCode = "22P06"
96
nonstandard_use_of_escape_character :: ErrorCode = "22P06"
75
nonstandard_use_of_escape_character :: ErrorCode = "22P06"
75
true
false
0
5
25
12
6
6
null
null
mettekou/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
ppr_expr (HsPar e) = parens (ppr_lexpr e)
48
ppr_expr (HsPar e) = parens (ppr_lexpr e)
48
ppr_expr (HsPar e) = parens (ppr_lexpr e)
48
false
false
0
7
13
25
11
14
null
null
diku-dk/futhark
src/Futhark/CLI/Literate.hs
isc
varsInScripts :: [Block] -> S.Set EntryName varsInScripts = foldMap varsInBlock where varsInBlock (BlockDirective d) = varsInDirective d varsInBlock BlockCode {} = mempty varsInBlock BlockComment {} = mempty
221
varsInScripts :: [Block] -> S.Set EntryName varsInScripts = foldMap varsInBlock where varsInBlock (BlockDirective d) = varsInDirective d varsInBlock BlockCode {} = mempty varsInBlock BlockComment {} = mempty
221
varsInScripts = foldMap varsInBlock where varsInBlock (BlockDirective d) = varsInDirective d varsInBlock BlockCode {} = mempty varsInBlock BlockComment {} = mempty
177
false
true
2
7
40
69
36
33
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F13.hs
bsd-3-clause
ptr_glGetTextureLevelParameteriv :: FunPtr (GLuint -> GLint -> GLenum -> Ptr GLint -> IO ()) ptr_glGetTextureLevelParameteriv = unsafePerformIO $ getCommand "glGetTextureLevelParameteriv"
187
ptr_glGetTextureLevelParameteriv :: FunPtr (GLuint -> GLint -> GLenum -> Ptr GLint -> IO ()) ptr_glGetTextureLevelParameteriv = unsafePerformIO $ getCommand "glGetTextureLevelParameteriv"
187
ptr_glGetTextureLevelParameteriv = unsafePerformIO $ getCommand "glGetTextureLevelParameteriv"
94
false
true
0
12
19
48
23
25
null
null
jyp/Parsek
Text/ParserCombinators/Class.hs
gpl-3.0
oneOf cs = satisfy (\c -> c `elem` cs) <?> ("one of " ++ cs)
61
oneOf cs = satisfy (\c -> c `elem` cs) <?> ("one of " ++ cs)
61
oneOf cs = satisfy (\c -> c `elem` cs) <?> ("one of " ++ cs)
61
false
false
0
9
15
37
20
17
null
null
thoughtbot/typebot
src/Utils.hs
bsd-3-clause
authorized :: TypeBot () -> TypeBot () authorized action = do rToken <- lookupParameter "token" match <- tokenMatches rToken if match then action else unauthorized
169
authorized :: TypeBot () -> TypeBot () authorized action = do rToken <- lookupParameter "token" match <- tokenMatches rToken if match then action else unauthorized
169
authorized action = do rToken <- lookupParameter "token" match <- tokenMatches rToken if match then action else unauthorized
130
false
true
0
8
30
59
27
32
null
null
siddhanathan/ghc
compiler/hsSyn/HsUtils.hs
bsd-3-clause
collect_binds :: Bool -> LHsBindsLR idL idR -> [idL] -> [idL] -- Collect Ids, or Ids + patter synonyms, depending on boolean flag collect_binds ps binds acc = foldrBag (collect_bind ps . unLoc) acc binds
203
collect_binds :: Bool -> LHsBindsLR idL idR -> [idL] -> [idL] collect_binds ps binds acc = foldrBag (collect_bind ps . unLoc) acc binds
135
collect_binds ps binds acc = foldrBag (collect_bind ps . unLoc) acc binds
73
true
true
0
8
34
59
30
29
null
null
kosmoskatten/traffic-analysis
src/Network/Traffic/Object/Reader.hs
mit
decodeObjects' :: DecodeOptions -> LBS.ByteString -> Either String ObjectVector decodeObjects' options = decodeWith options NoHeader
132
decodeObjects' :: DecodeOptions -> LBS.ByteString -> Either String ObjectVector decodeObjects' options = decodeWith options NoHeader
132
decodeObjects' options = decodeWith options NoHeader
52
false
true
0
7
14
34
16
18
null
null
arnizamani/aiw
Domains/PropLogic.hs
gpl-2.0
logicExp' 2 = do e <- logicExp' 1 return $ makeU neg e
71
logicExp' 2 = do e <- logicExp' 1 return $ makeU neg e
71
logicExp' 2 = do e <- logicExp' 1 return $ makeU neg e
71
false
false
1
9
29
35
13
22
null
null
da-x/lamdu
Lamdu/Data/Export/JSON/Codec.hs
gpl-3.0
encodeParamList :: Encoder Anchors.ParamList encodeParamList = Aeson.toJSON . map encodeTagId
93
encodeParamList :: Encoder Anchors.ParamList encodeParamList = Aeson.toJSON . map encodeTagId
93
encodeParamList = Aeson.toJSON . map encodeTagId
48
false
true
0
6
9
25
12
13
null
null
chrisbloecker/Hive
src/Hive/Problem/Arithmetic.hs
gpl-3.0
divide (x, y) = return (x `div` y)
34
divide (x, y) = return (x `div` y)
34
divide (x, y) = return (x `div` y)
34
false
false
0
6
7
28
15
13
null
null
verement/etamoo
src/MOO/Task.hs
bsd-3-clause
breakLoop :: Maybe Id -> MOO Value breakLoop maybeName = do Loop { loopBreak = Continuation break } <- unwindLoopContext maybeName break ()
143
breakLoop :: Maybe Id -> MOO Value breakLoop maybeName = do Loop { loopBreak = Continuation break } <- unwindLoopContext maybeName break ()
143
breakLoop maybeName = do Loop { loopBreak = Continuation break } <- unwindLoopContext maybeName break ()
108
false
true
0
11
26
54
24
30
null
null
HJvT/GeBoP
Game.hs
bsd-3-clause
-- step makes the tree grow at exactly one leaf, given a path step :: Game g => [Int] -> Tree g -> Tree g step [] t = grow t
128
step :: Game g => [Int] -> Tree g -> Tree g step [] t = grow t
66
step [] t = grow t
22
true
true
0
10
34
50
23
27
null
null
janschulz/pandoc
src/Text/Pandoc/Writers/MediaWiki.hs
gpl-2.0
-- | Convert Pandoc to MediaWiki. writeMediaWiki :: WriterOptions -> Pandoc -> String writeMediaWiki opts document = let initialState = WriterState { stNotes = False, stOptions = opts } env = WriterReader { options = opts, listLevel = [], useTags = False } in evalState (runReaderT (pandocToMediaWiki document) env) initialState
339
writeMediaWiki :: WriterOptions -> Pandoc -> String writeMediaWiki opts document = let initialState = WriterState { stNotes = False, stOptions = opts } env = WriterReader { options = opts, listLevel = [], useTags = False } in evalState (runReaderT (pandocToMediaWiki document) env) initialState
305
writeMediaWiki opts document = let initialState = WriterState { stNotes = False, stOptions = opts } env = WriterReader { options = opts, listLevel = [], useTags = False } in evalState (runReaderT (pandocToMediaWiki document) env) initialState
253
true
true
0
11
60
96
53
43
null
null
aztek/voogie
src/Voogie/Front.hs
gpl-3.0
guardType :: (Pretty a, TypeOf a, MonadTrans t, Monad (t Result)) => (b -> t Result a) -> AST b -> Type -> t Result a guardType f a t = f <$> a <::> t
160
guardType :: (Pretty a, TypeOf a, MonadTrans t, Monad (t Result)) => (b -> t Result a) -> AST b -> Type -> t Result a guardType f a t = f <$> a <::> t
160
guardType f a t = f <$> a <::> t
32
false
true
0
9
45
91
45
46
null
null
phunehehe/deepseq-bounded
src/Control/DeepSeq/Bounded/Seqable.hs
bsd-3-clause
nf_ :: forall a. Generic a => SeqNode -> a -> () rnf_ = grnf_
64
rnf_ :: forall a. Generic a => SeqNode -> a -> () rnf_ = grnf_
62
rnf_ = grnf_
12
false
true
0
11
17
39
18
21
null
null
brendanhay/gogol
gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer/Types/Product.hs
mpl-2.0
-- | If specified, also updates the proposal in the batch transaction. This -- is useful when the proposal and the deals need to be updated in one -- transaction. eProposal :: Lens' EditAllOrderDealsRequest (Maybe Proposal) eProposal = lens _eProposal (\ s a -> s{_eProposal = a})
282
eProposal :: Lens' EditAllOrderDealsRequest (Maybe Proposal) eProposal = lens _eProposal (\ s a -> s{_eProposal = a})
119
eProposal = lens _eProposal (\ s a -> s{_eProposal = a})
58
true
true
1
9
48
54
27
27
null
null
keera-studios/hsQt
Qtc/Enums/Gui/QGraphicsItem.hs
bsd-2-clause
ieQGraphicsItem__ :: Int -> QGraphicsItem__ ieQGraphicsItem__ x = QEnum (CQGraphicsItem__ x)
92
ieQGraphicsItem__ :: Int -> QGraphicsItem__ ieQGraphicsItem__ x = QEnum (CQGraphicsItem__ x)
92
ieQGraphicsItem__ x = QEnum (CQGraphicsItem__ x)
48
false
true
0
7
10
27
13
14
null
null
fredmorcos/attic
projects/pet/archive/pet_haskell_pet2/StringUtils.hs
isc
unlines' [x] = x
19
unlines' [x] = x
19
unlines' [x] = x
19
false
false
0
6
6
12
6
6
null
null
ingemaradahl/bilder
src/TypeChecker/TCM/Errors.hs
lgpl-3.0
vectorTooBig ∷ CIdent → Int → TCM a vectorTooBig cid s = typeError (cIdentToPos cid) $ printf "Vector components %s form a new vector of unhandled size %d" (cIdentToString cid) s
192
vectorTooBig ∷ CIdent → Int → TCM a vectorTooBig cid s = typeError (cIdentToPos cid) $ printf "Vector components %s form a new vector of unhandled size %d" (cIdentToString cid) s
192
vectorTooBig cid s = typeError (cIdentToPos cid) $ printf "Vector components %s form a new vector of unhandled size %d" (cIdentToString cid) s
156
false
true
0
8
44
53
25
28
null
null
brendanhay/gogol
gogol-digitalassetlinks/gen/Network/Google/Resource/DigitalAssetLinks/Statements/List.hs
mpl-2.0
-- | JSONP slCallback :: Lens' StatementsList (Maybe Text) slCallback = lens _slCallback (\ s a -> s{_slCallback = a})
120
slCallback :: Lens' StatementsList (Maybe Text) slCallback = lens _slCallback (\ s a -> s{_slCallback = a})
109
slCallback = lens _slCallback (\ s a -> s{_slCallback = a})
61
true
true
1
9
21
52
25
27
null
null
LukeHoersten/io-streams
test/System/IO/Streams/Tests/Combinators.hs
bsd-3-clause
testMapM_ :: Test testMapM_ = testCase "combinators/mapM_" $ do ref <- newIORef 0 is <- fromList [1,2,3::Int] >>= mapM_ (modifyIORef ref . (+)) _ <- toList is readIORef ref >>= assertEqual "mapM_" 6 ------------------------------------------------------------------------------
299
testMapM_ :: Test testMapM_ = testCase "combinators/mapM_" $ do ref <- newIORef 0 is <- fromList [1,2,3::Int] >>= mapM_ (modifyIORef ref . (+)) _ <- toList is readIORef ref >>= assertEqual "mapM_" 6 ------------------------------------------------------------------------------
299
testMapM_ = testCase "combinators/mapM_" $ do ref <- newIORef 0 is <- fromList [1,2,3::Int] >>= mapM_ (modifyIORef ref . (+)) _ <- toList is readIORef ref >>= assertEqual "mapM_" 6 ------------------------------------------------------------------------------
281
false
true
0
14
55
102
47
55
null
null
romanb/amazonka
amazonka-glacier/gen/Network/AWS/Glacier/CompleteMultipartUpload.hs
mpl-2.0
-- | 'CompleteMultipartUpload' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'cmuAccountId' @::@ 'Text' -- -- * 'cmuArchiveSize' @::@ 'Maybe' 'Text' -- -- * 'cmuChecksum' @::@ 'Maybe' 'Text' -- -- * 'cmuUploadId' @::@ 'Text' -- -- * 'cmuVaultName' @::@ 'Text' -- completeMultipartUpload :: Text -- ^ 'cmuAccountId' -> Text -- ^ 'cmuVaultName' -> Text -- ^ 'cmuUploadId' -> CompleteMultipartUpload completeMultipartUpload p1 p2 p3 = CompleteMultipartUpload { _cmuAccountId = p1 , _cmuVaultName = p2 , _cmuUploadId = p3 , _cmuArchiveSize = Nothing , _cmuChecksum = Nothing }
715
completeMultipartUpload :: Text -- ^ 'cmuAccountId' -> Text -- ^ 'cmuVaultName' -> Text -- ^ 'cmuUploadId' -> CompleteMultipartUpload completeMultipartUpload p1 p2 p3 = CompleteMultipartUpload { _cmuAccountId = p1 , _cmuVaultName = p2 , _cmuUploadId = p3 , _cmuArchiveSize = Nothing , _cmuChecksum = Nothing }
415
completeMultipartUpload p1 p2 p3 = CompleteMultipartUpload { _cmuAccountId = p1 , _cmuVaultName = p2 , _cmuUploadId = p3 , _cmuArchiveSize = Nothing , _cmuChecksum = Nothing }
209
true
true
0
7
196
79
53
26
null
null
Mokosha/HsTetrisAttack
TetrisAttack/Grid.hs
mit
stepWalker (Walker f) x = f (Just x)
36
stepWalker (Walker f) x = f (Just x)
36
stepWalker (Walker f) x = f (Just x)
36
false
false
0
7
7
26
12
14
null
null
et4te/zero
src/Reflex/Dom/SemanticUI/Common.hs
bsd-3-clause
leftFloated, rightFloated :: UiHasFloated a => a -> a leftFloated = uiSetFloated UiLeftFloated
94
leftFloated, rightFloated :: UiHasFloated a => a -> a leftFloated = uiSetFloated UiLeftFloated
94
leftFloated = uiSetFloated UiLeftFloated
40
false
true
0
6
12
27
14
13
null
null
grwlf/vsim
src_r/VSim/Runtime/Elab/Array.hs
gpl-3.0
a_right :: (Monad m) => m (Array t e) -> m Int a_right ma = ma >>= return . right . arange . vt
96
a_right :: (Monad m) => m (Array t e) -> m Int a_right ma = ma >>= return . right . arange . vt
95
a_right ma = ma >>= return . right . arange . vt
48
false
true
0
9
24
57
28
29
null
null
diagrams/diagrams-input
src/Diagrams/SVG/ReadSVG.hs
bsd-3-clause
patternContent :: (MonadThrow m, InputConstraints b n) => Consumer Event m (Maybe (Tag b n)) patternContent = choose [parseImage]
129
patternContent :: (MonadThrow m, InputConstraints b n) => Consumer Event m (Maybe (Tag b n)) patternContent = choose [parseImage]
129
patternContent = choose [parseImage]
36
false
true
0
10
18
55
28
27
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/ValidityState.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/ValidityState.rangeUnderflow Mozilla ValidityState.rangeUnderflow documentation> getRangeUnderflow :: (MonadDOM m) => ValidityState -> m Bool getRangeUnderflow self = liftDOM ((self ^. js "rangeUnderflow") >>= valToBool)
278
getRangeUnderflow :: (MonadDOM m) => ValidityState -> m Bool getRangeUnderflow self = liftDOM ((self ^. js "rangeUnderflow") >>= valToBool)
141
getRangeUnderflow self = liftDOM ((self ^. js "rangeUnderflow") >>= valToBool)
80
true
true
0
10
27
51
26
25
null
null
dysinger/amazonka
amazonka-s3/gen/Network/AWS/S3/CopyObject.hs
mpl-2.0
-- | Copies the object if it has been modified since the specified time. coCopySourceIfModifiedSince :: Lens' CopyObject (Maybe UTCTime) coCopySourceIfModifiedSince = lens _coCopySourceIfModifiedSince (\s a -> s { _coCopySourceIfModifiedSince = a }) . mapping _Time
289
coCopySourceIfModifiedSince :: Lens' CopyObject (Maybe UTCTime) coCopySourceIfModifiedSince = lens _coCopySourceIfModifiedSince (\s a -> s { _coCopySourceIfModifiedSince = a }) . mapping _Time
216
coCopySourceIfModifiedSince = lens _coCopySourceIfModifiedSince (\s a -> s { _coCopySourceIfModifiedSince = a }) . mapping _Time
152
true
true
1
8
59
55
28
27
null
null
lally/xmonad-reenberg
XMonad/Operations.hs
bsd-3-clause
-- | Set the layout of the currently viewed workspace setLayout :: Layout Window -> X () setLayout l = do ss@(W.StackSet { W.current = c@(W.Screen { W.workspace = ws })}) <- gets windowset handleMessage (W.layout ws) (SomeMessage ReleaseResources) windows $ const $ ss {W.current = c { W.workspace = ws { W.layout = l } } } ------------------------------------------------------------------------ -- Utilities -- | Return workspace visible on screen 'sc', or 'Nothing'.
483
setLayout :: Layout Window -> X () setLayout l = do ss@(W.StackSet { W.current = c@(W.Screen { W.workspace = ws })}) <- gets windowset handleMessage (W.layout ws) (SomeMessage ReleaseResources) windows $ const $ ss {W.current = c { W.workspace = ws { W.layout = l } } } ------------------------------------------------------------------------ -- Utilities -- | Return workspace visible on screen 'sc', or 'Nothing'.
429
setLayout l = do ss@(W.StackSet { W.current = c@(W.Screen { W.workspace = ws })}) <- gets windowset handleMessage (W.layout ws) (SomeMessage ReleaseResources) windows $ const $ ss {W.current = c { W.workspace = ws { W.layout = l } } } ------------------------------------------------------------------------ -- Utilities -- | Return workspace visible on screen 'sc', or 'Nothing'.
394
true
true
0
17
84
141
75
66
null
null
robeverest/accelerate
Data/Array/Accelerate/Trafo/Substitution.hs
bsd-3-clause
weakenEA :: OpenExp env aenv t -> OpenExp env (aenv,s) t weakenEA = weakenByEA SuccIdx
86
weakenEA :: OpenExp env aenv t -> OpenExp env (aenv,s) t weakenEA = weakenByEA SuccIdx
86
weakenEA = weakenByEA SuccIdx
29
false
true
0
8
14
44
20
24
null
null
prcastro/haskell-scheme
src/Lib.hs
mit
eval real@(Real _) = return real
32
eval real@(Real _) = return real
32
eval real@(Real _) = return real
32
false
false
0
8
5
21
10
11
null
null
acowley/ghc
compiler/main/Packages.hs
bsd-3-clause
-- | Extends the package configuration map with a list of package configs. extendPackageConfigMap :: PackageConfigMap -> [PackageConfig] -> PackageConfigMap extendPackageConfigMap pkg_map new_pkgs = foldl add pkg_map new_pkgs where add pkg_map p = addToUFM pkg_map (packageConfigId p) p -- | Looks up the package with the given id in the package state, panicing if it is -- not found
391
extendPackageConfigMap :: PackageConfigMap -> [PackageConfig] -> PackageConfigMap extendPackageConfigMap pkg_map new_pkgs = foldl add pkg_map new_pkgs where add pkg_map p = addToUFM pkg_map (packageConfigId p) p -- | Looks up the package with the given id in the package state, panicing if it is -- not found
316
extendPackageConfigMap pkg_map new_pkgs = foldl add pkg_map new_pkgs where add pkg_map p = addToUFM pkg_map (packageConfigId p) p -- | Looks up the package with the given id in the package state, panicing if it is -- not found
231
true
true
0
7
66
65
33
32
null
null
olorin/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs
mpl-2.0
-- | Removes a specific AWS account ID or group from a volume\'s list of -- create volume permissions. cvpmRemove :: Lens' CreateVolumePermissionModifications [CreateVolumePermission] cvpmRemove = lens _cvpmRemove (\ s a -> s{_cvpmRemove = a}) . _Default . _Coerce
264
cvpmRemove :: Lens' CreateVolumePermissionModifications [CreateVolumePermission] cvpmRemove = lens _cvpmRemove (\ s a -> s{_cvpmRemove = a}) . _Default . _Coerce
161
cvpmRemove = lens _cvpmRemove (\ s a -> s{_cvpmRemove = a}) . _Default . _Coerce
80
true
true
0
11
38
52
29
23
null
null
ezyang/ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
deAnnotate' (AnnApp fun arg) = App (deAnnotate fun) (deAnnotate arg)
73
deAnnotate' (AnnApp fun arg) = App (deAnnotate fun) (deAnnotate arg)
73
deAnnotate' (AnnApp fun arg) = App (deAnnotate fun) (deAnnotate arg)
73
false
false
0
7
14
34
16
18
null
null
y-kamiya/parallel-concurrent-haskell
src/Server/DistribChatNoSlave.hs
gpl-2.0
broadcastLocal :: Server -> Message -> STM () broadcastLocal server@Server{..} msg = do clientmap <- readTVar clients mapM_ sendIfLocal $ M.elems clientmap where sendIfLocal (ClientLocal c) = sendLocal c msg sendIfLocal (ClientRemote _) = return ()
262
broadcastLocal :: Server -> Message -> STM () broadcastLocal server@Server{..} msg = do clientmap <- readTVar clients mapM_ sendIfLocal $ M.elems clientmap where sendIfLocal (ClientLocal c) = sendLocal c msg sendIfLocal (ClientRemote _) = return ()
262
broadcastLocal server@Server{..} msg = do clientmap <- readTVar clients mapM_ sendIfLocal $ M.elems clientmap where sendIfLocal (ClientLocal c) = sendLocal c msg sendIfLocal (ClientRemote _) = return ()
216
false
true
0
9
49
104
48
56
null
null
Proclivis/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
-- by default, the Windows text control doesn't show the selection when it -- doesn't have focus - use this style to force it to always show it wxTE_NOHIDESEL :: Int wxTE_NOHIDESEL = 0x2000
194
wxTE_NOHIDESEL :: Int wxTE_NOHIDESEL = 0x2000
50
wxTE_NOHIDESEL = 0x2000
28
true
true
0
4
38
13
8
5
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_DEBUG_OUTPUT_SYNCHRONOUS :: GLenum gl_DEBUG_OUTPUT_SYNCHRONOUS = 0x8242
74
gl_DEBUG_OUTPUT_SYNCHRONOUS :: GLenum gl_DEBUG_OUTPUT_SYNCHRONOUS = 0x8242
74
gl_DEBUG_OUTPUT_SYNCHRONOUS = 0x8242
36
false
true
0
4
5
11
6
5
null
null
lally/libmet
src/Ppt/Frame/LayoutAlgo.hs
bsd-3-clause
intType = PIntegral PPInt Nothing
33
intType = PIntegral PPInt Nothing
33
intType = PIntegral PPInt Nothing
33
false
false
1
5
4
16
5
11
null
null
sdiehl/ghc
compiler/specialise/Rules.hs
bsd-3-clause
match renv subst e1 (Var v2) -- Note [Expanding variables] | not (inRnEnvR rn_env v2) -- Note [Do not expand locally-bound variables] , Just e2' <- expandUnfolding_maybe (rv_unf renv v2') = match (renv { rv_lcl = nukeRnEnvR rn_env }) subst e1 e2' where v2' = lookupRnInScope rn_env v2 rn_env = rv_lcl renv -- Notice that we look up v2 in the in-scope set -- See Note [Lookup in-scope] -- No need to apply any renaming first (hence no rnOccR) -- because of the not-inRnEnvR
528
match renv subst e1 (Var v2) -- Note [Expanding variables] | not (inRnEnvR rn_env v2) -- Note [Do not expand locally-bound variables] , Just e2' <- expandUnfolding_maybe (rv_unf renv v2') = match (renv { rv_lcl = nukeRnEnvR rn_env }) subst e1 e2' where v2' = lookupRnInScope rn_env v2 rn_env = rv_lcl renv -- Notice that we look up v2 in the in-scope set -- See Note [Lookup in-scope] -- No need to apply any renaming first (hence no rnOccR) -- because of the not-inRnEnvR
528
match renv subst e1 (Var v2) -- Note [Expanding variables] | not (inRnEnvR rn_env v2) -- Note [Do not expand locally-bound variables] , Just e2' <- expandUnfolding_maybe (rv_unf renv v2') = match (renv { rv_lcl = nukeRnEnvR rn_env }) subst e1 e2' where v2' = lookupRnInScope rn_env v2 rn_env = rv_lcl renv -- Notice that we look up v2 in the in-scope set -- See Note [Lookup in-scope] -- No need to apply any renaming first (hence no rnOccR) -- because of the not-inRnEnvR
528
false
false
1
11
139
119
55
64
null
null
quchen/stg
test/Testsuite/Test/Machine/GarbageCollection.hs
bsd-3-clause
fibonacciSumTest :: GarbageCollectionAlgorithm -> TestTree fibonacciSumTest algorithm = testCase "Long-running program" test where -- This program choked on the new copying GC (ran into an infinite loop), -- so it is added as a test case. It's much rather a sanity test than a -- minimal example displaying the actual issue, however. source = mconcat [ Stg.add , toStg "zero" (0 :: Int) , Stg.foldl' , Stg.zipWith ] <> [stg| flipConst = \x y -> y; main = \ => letrec fibo = \ => letrec fib0 = \(fib1) -> Cons zero fib1; fib1 = \(fib2) => let one = \ -> Int# 1# in Cons one fib2; fib2 = \(fib0 fib1) => zipWith add fib0 fib1 in fib0 in foldl' flipConst zero fibo |] prog = initialState "main" source states = NE.take 1e3 (evalsUntil (RunForMaxSteps 1e10) (HaltIf (const False)) (PerformGc (const (Just algorithm))) prog ) test = rnf states `seq` pure ()
1,274
fibonacciSumTest :: GarbageCollectionAlgorithm -> TestTree fibonacciSumTest algorithm = testCase "Long-running program" test where -- This program choked on the new copying GC (ran into an infinite loop), -- so it is added as a test case. It's much rather a sanity test than a -- minimal example displaying the actual issue, however. source = mconcat [ Stg.add , toStg "zero" (0 :: Int) , Stg.foldl' , Stg.zipWith ] <> [stg| flipConst = \x y -> y; main = \ => letrec fibo = \ => letrec fib0 = \(fib1) -> Cons zero fib1; fib1 = \(fib2) => let one = \ -> Int# 1# in Cons one fib2; fib2 = \(fib0 fib1) => zipWith add fib0 fib1 in fib0 in foldl' flipConst zero fibo |] prog = initialState "main" source states = NE.take 1e3 (evalsUntil (RunForMaxSteps 1e10) (HaltIf (const False)) (PerformGc (const (Just algorithm))) prog ) test = rnf states `seq` pure ()
1,274
fibonacciSumTest algorithm = testCase "Long-running program" test where -- This program choked on the new copying GC (ran into an infinite loop), -- so it is added as a test case. It's much rather a sanity test than a -- minimal example displaying the actual issue, however. source = mconcat [ Stg.add , toStg "zero" (0 :: Int) , Stg.foldl' , Stg.zipWith ] <> [stg| flipConst = \x y -> y; main = \ => letrec fibo = \ => letrec fib0 = \(fib1) -> Cons zero fib1; fib1 = \(fib2) => let one = \ -> Int# 1# in Cons one fib2; fib2 = \(fib0 fib1) => zipWith add fib0 fib1 in fib0 in foldl' flipConst zero fibo |] prog = initialState "main" source states = NE.take 1e3 (evalsUntil (RunForMaxSteps 1e10) (HaltIf (const False)) (PerformGc (const (Just algorithm))) prog ) test = rnf states `seq` pure ()
1,215
false
true
3
15
574
164
87
77
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/hsSyn/HsUtils.hs
bsd-3-clause
nlConVarPat :: RdrName -> [RdrName] -> LPat RdrName nlConVarPat con vars = nlConPat con (map nlVarPat vars)
107
nlConVarPat :: RdrName -> [RdrName] -> LPat RdrName nlConVarPat con vars = nlConPat con (map nlVarPat vars)
107
nlConVarPat con vars = nlConPat con (map nlVarPat vars)
55
false
true
0
7
16
43
21
22
null
null
sternenseemann/large-hashable
src/Data/LargeHashable/Class.hs
bsd-3-clause
updateHashInteger :: Integer -> LH () updateHashInteger !i | i == 0 = updateHash (0 :: CUChar) | i > 0 = do updateHash (fromIntegral (i .&. 0xffffffffffffffff) :: CULong) updateHashInteger (shift i (-64)) | otherwise = do updateHash (0 :: CUChar) -- prepend 0 to show it is negative updateHashInteger (abs i)
353
updateHashInteger :: Integer -> LH () updateHashInteger !i | i == 0 = updateHash (0 :: CUChar) | i > 0 = do updateHash (fromIntegral (i .&. 0xffffffffffffffff) :: CULong) updateHashInteger (shift i (-64)) | otherwise = do updateHash (0 :: CUChar) -- prepend 0 to show it is negative updateHashInteger (abs i)
353
updateHashInteger !i | i == 0 = updateHash (0 :: CUChar) | i > 0 = do updateHash (fromIntegral (i .&. 0xffffffffffffffff) :: CULong) updateHashInteger (shift i (-64)) | otherwise = do updateHash (0 :: CUChar) -- prepend 0 to show it is negative updateHashInteger (abs i)
315
false
true
0
13
97
141
65
76
null
null
mainland/nikola
src/Data/Array/Nikola/Backend/C/Codegen.hs
bsd-3-clause
compileConst (FloatC n) = return $ ScalarCE [cexp|$float:(toRational n)|]
76
compileConst (FloatC n) = return $ ScalarCE [cexp|$float:(toRational n)|]
76
compileConst (FloatC n) = return $ ScalarCE [cexp|$float:(toRational n)|]
76
false
false
0
7
11
26
14
12
null
null
phischu/fragnix
tests/packages/scotty/Data.Streaming.ByteString.Builder.Buffer.hs
bsd-3-clause
updateEndOfSlice :: Buffer -- Old buffer -> Ptr Word8 -- New end of slice -> Buffer -- Updated buffer updateEndOfSlice (Buffer fpbuf p0 _ ope) op' = Buffer fpbuf p0 op' ope
212
updateEndOfSlice :: Buffer -- Old buffer -> Ptr Word8 -- New end of slice -> Buffer updateEndOfSlice (Buffer fpbuf p0 _ ope) op' = Buffer fpbuf p0 op' ope
191
updateEndOfSlice (Buffer fpbuf p0 _ ope) op' = Buffer fpbuf p0 op' ope
70
true
true
0
7
71
51
26
25
null
null
plneappl/HasKlax
src/Drawing.hs
bsd-3-clause
drawWorldState :: WorldState -> Picture drawWorldState ws@Running {lanes = l, stackingArea = sa} = upscaleScreen $ placePlayingField $ composePlayingField (c01toc11 $ drawLanes l) (c01toc11 $ drawPaddleArea ws) (c01toc11 $ drawStackingArea sa)
261
drawWorldState :: WorldState -> Picture drawWorldState ws@Running {lanes = l, stackingArea = sa} = upscaleScreen $ placePlayingField $ composePlayingField (c01toc11 $ drawLanes l) (c01toc11 $ drawPaddleArea ws) (c01toc11 $ drawStackingArea sa)
261
drawWorldState ws@Running {lanes = l, stackingArea = sa} = upscaleScreen $ placePlayingField $ composePlayingField (c01toc11 $ drawLanes l) (c01toc11 $ drawPaddleArea ws) (c01toc11 $ drawStackingArea sa)
221
false
true
0
9
48
83
42
41
null
null
vTurbine/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
typeRepIdName = varQual tYPEABLE_INTERNAL (fsLit "typeRep#") typeRepIdKey
87
typeRepIdName = varQual tYPEABLE_INTERNAL (fsLit "typeRep#") typeRepIdKey
87
typeRepIdName = varQual tYPEABLE_INTERNAL (fsLit "typeRep#") typeRepIdKey
87
false
false
0
7
20
19
9
10
null
null
byteally/dbrecord-opaleye
src/Opaleye/DBRecord.hs
bsd-3-clause
aggregateOrdered :: forall (aggs :: [AggFn]) tab f db flds. ( Generic (tab f) , Generic (tab (Agg f aggs)) , GTypeToRec Identity (Rep (tab f)) (GetOpFields f flds) , GRecToType Identity (Rep (tab f)) (GetOpFields f flds) , GRecToType Identity (Rep (tab (Agg f aggs))) (GetOpFields (Agg f aggs) flds) , TabAgg f aggs flds , SingCols db flds (ColumnNames (tab Hask)) , flds ~ (OriginalTableFields (tab Hask)) ) => Tab db tab -> Order (tab f) -> Query (tab f) -> Query (tab (Agg f aggs)) aggregateOrdered _ ordBy tab = let cols = getTableHFields (Proxy @db) (Proxy @(tab Hask)) in O.aggregateOrdered (contramap recToType ordBy) (tabAgg (Proxy @'(f, aggs)) cols) (tab >>^ typeToRec) >>^ recToType
867
aggregateOrdered :: forall (aggs :: [AggFn]) tab f db flds. ( Generic (tab f) , Generic (tab (Agg f aggs)) , GTypeToRec Identity (Rep (tab f)) (GetOpFields f flds) , GRecToType Identity (Rep (tab f)) (GetOpFields f flds) , GRecToType Identity (Rep (tab (Agg f aggs))) (GetOpFields (Agg f aggs) flds) , TabAgg f aggs flds , SingCols db flds (ColumnNames (tab Hask)) , flds ~ (OriginalTableFields (tab Hask)) ) => Tab db tab -> Order (tab f) -> Query (tab f) -> Query (tab (Agg f aggs)) aggregateOrdered _ ordBy tab = let cols = getTableHFields (Proxy @db) (Proxy @(tab Hask)) in O.aggregateOrdered (contramap recToType ordBy) (tabAgg (Proxy @'(f, aggs)) cols) (tab >>^ typeToRec) >>^ recToType
867
aggregateOrdered _ ordBy tab = let cols = getTableHFields (Proxy @db) (Proxy @(tab Hask)) in O.aggregateOrdered (contramap recToType ordBy) (tabAgg (Proxy @'(f, aggs)) cols) (tab >>^ typeToRec) >>^ recToType
211
false
true
0
15
291
376
189
187
null
null
bitemyapp/machines
src/Data/Machine/Lift.hs
bsd-3-clause
-- | Given an initial state and a 'MachineT' that runs in @'StateT' s m@, -- produce a 'MachineT' that runs in @m@. execStateM :: Monad m => s -> MachineT (StateT s m) k o -> MachineT m k o execStateM s m = MachineT $ do (stp, s') <- runStateT (runMachineT m) s case stp of Stop -> return Stop Yield o m' -> return $ Yield o (execStateM s' m') Await f k q -> return $ Await (execStateM s' . f) k (execStateM s' q) -- | 'catchExcept' allows a broken machine to be replaced without stopping the -- assembly line.
527
execStateM :: Monad m => s -> MachineT (StateT s m) k o -> MachineT m k o execStateM s m = MachineT $ do (stp, s') <- runStateT (runMachineT m) s case stp of Stop -> return Stop Yield o m' -> return $ Yield o (execStateM s' m') Await f k q -> return $ Await (execStateM s' . f) k (execStateM s' q) -- | 'catchExcept' allows a broken machine to be replaced without stopping the -- assembly line.
411
execStateM s m = MachineT $ do (stp, s') <- runStateT (runMachineT m) s case stp of Stop -> return Stop Yield o m' -> return $ Yield o (execStateM s' m') Await f k q -> return $ Await (execStateM s' . f) k (execStateM s' q) -- | 'catchExcept' allows a broken machine to be replaced without stopping the -- assembly line.
337
true
true
0
16
121
176
84
92
null
null
fizruk/demarcate
src/Control/Monad/Trans/Demarcate/Internal.hs
bsd-3-clause
demarcateM :: m a -> Demarcate t m a demarcateM m = liftF $ DemarcateMonad m id
79
demarcateM :: m a -> Demarcate t m a demarcateM m = liftF $ DemarcateMonad m id
79
demarcateM m = liftF $ DemarcateMonad m id
42
false
true
0
6
16
37
17
20
null
null
fffej/HS-Poker
LookupPatternMatch.hs
bsd-3-clause
getValueFromProduct 42435 = 5778
32
getValueFromProduct 42435 = 5778
32
getValueFromProduct 42435 = 5778
32
false
false
0
5
3
9
4
5
null
null
tim-m89/hclr
Main.hs
bsd-3-clause
main :: IO () main = [runClr| System.Console.WriteLine "Hello World" System.Windows.Forms.Application.EnableVisualStyles f <- new System.Windows.Forms.Form System.Windows.Forms.Application.Run f |]
206
main :: IO () main = [runClr| System.Console.WriteLine "Hello World" System.Windows.Forms.Application.EnableVisualStyles f <- new System.Windows.Forms.Form System.Windows.Forms.Application.Run f |]
206
main = [runClr| System.Console.WriteLine "Hello World" System.Windows.Forms.Application.EnableVisualStyles f <- new System.Windows.Forms.Form System.Windows.Forms.Application.Run f |]
192
false
true
0
6
26
20
12
8
null
null
beni55/bayes-stack
BayesStack/Gibbs/Concurrent.hs
bsd-3-clause
labelMyThread :: String -> IO () labelMyThread label = myThreadId >>= \id->labelThread id label
95
labelMyThread :: String -> IO () labelMyThread label = myThreadId >>= \id->labelThread id label
95
labelMyThread label = myThreadId >>= \id->labelThread id label
62
false
true
0
8
13
41
19
22
null
null
blanu/arbre-go
Arbre/NewNative.hs
gpl-2.0
float_eq :: Native float_eq params@(a:b:[]) = do let x = unbox a :: Maybe Float let y = unbox b :: Maybe Float case (x,y) of (Nothing,_) -> floatError params (_,Nothing) -> floatError params (Just i, Just j) -> box (i==j)
257
float_eq :: Native float_eq params@(a:b:[]) = do let x = unbox a :: Maybe Float let y = unbox b :: Maybe Float case (x,y) of (Nothing,_) -> floatError params (_,Nothing) -> floatError params (Just i, Just j) -> box (i==j)
257
float_eq params@(a:b:[]) = do let x = unbox a :: Maybe Float let y = unbox b :: Maybe Float case (x,y) of (Nothing,_) -> floatError params (_,Nothing) -> floatError params (Just i, Just j) -> box (i==j)
238
false
true
0
12
76
137
69
68
null
null
jBugman/euler
part1/p006.hs
mit
sumOfSquares :: Int -> Int sumOfSquares n = sum [x * x | x <- [1..n]]
69
sumOfSquares :: Int -> Int sumOfSquares n = sum [x * x | x <- [1..n]]
69
sumOfSquares n = sum [x * x | x <- [1..n]]
42
false
true
0
9
15
41
21
20
null
null
oldmanmike/ghc
compiler/typecheck/TcGenDeriv.hs
bsd-3-clause
ltResult OrdLT = true_Expr
31
ltResult OrdLT = true_Expr
31
ltResult OrdLT = true_Expr
31
false
false
0
5
8
9
4
5
null
null
oldmanmike/ghc
compiler/hsSyn/HsBinds.hs
bsd-3-clause
isTypeLSig (L _(IdSig {})) = True
38
isTypeLSig (L _(IdSig {})) = True
38
isTypeLSig (L _(IdSig {})) = True
38
false
false
0
8
10
25
12
13
null
null
Toxaris/pandoc-lit
src/Text/Pandoc/Lit.hs
bsd-3-clause
optInclude, optIncludeInHeader, optProcessIncludes, optHelp, optFile, optAbstract, optTitlePage, optToc, optComments, optNotes, optPause, optTH, optFigures :: OptDescr (Command -> Command) optInclude = Option "" ["include"] (ReqArg processInclude "FILE") "emit a lhs2tex \"%include FILE\" directive"
340
optInclude, optIncludeInHeader, optProcessIncludes, optHelp, optFile, optAbstract, optTitlePage, optToc, optComments, optNotes, optPause, optTH, optFigures :: OptDescr (Command -> Command) optInclude = Option "" ["include"] (ReqArg processInclude "FILE") "emit a lhs2tex \"%include FILE\" directive"
338
optInclude = Option "" ["include"] (ReqArg processInclude "FILE") "emit a lhs2tex \"%include FILE\" directive"
148
false
true
5
7
72
80
45
35
null
null