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
gbataille/pandoc
src/Text/Pandoc/Writers/RST.hs
gpl-2.0
inlineToRST :: Inline -> State WriterState Doc inlineToRST (Span _ ils) = inlineListToRST ils
93
inlineToRST :: Inline -> State WriterState Doc inlineToRST (Span _ ils) = inlineListToRST ils
93
inlineToRST (Span _ ils) = inlineListToRST ils
46
false
true
0
7
13
34
16
18
null
null
olorin/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/Types/Product.hs
mpl-2.0
-- | Undocumented member. cscsivVolumeStatus :: Lens' CachediSCSIVolume (Maybe Text) cscsivVolumeStatus = lens _cscsivVolumeStatus (\ s a -> s{_cscsivVolumeStatus = a})
168
cscsivVolumeStatus :: Lens' CachediSCSIVolume (Maybe Text) cscsivVolumeStatus = lens _cscsivVolumeStatus (\ s a -> s{_cscsivVolumeStatus = a})
142
cscsivVolumeStatus = lens _cscsivVolumeStatus (\ s a -> s{_cscsivVolumeStatus = a})
83
true
true
0
9
20
46
25
21
null
null
sergei-romanenko/sc-mini
src/Interpreter.hs
unlicense
evalStep p (GCall gname (arg:args)) = case evalStep p arg of Transient contr arg' -> Transient contr (GCall gname (arg':args)) -- OLD STUFF FURTHER --
163
evalStep p (GCall gname (arg:args)) = case evalStep p arg of Transient contr arg' -> Transient contr (GCall gname (arg':args)) -- OLD STUFF FURTHER --
163
evalStep p (GCall gname (arg:args)) = case evalStep p arg of Transient contr arg' -> Transient contr (GCall gname (arg':args)) -- OLD STUFF FURTHER --
163
false
false
0
12
37
67
33
34
null
null
onponomarev/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
confdNodeRoleOffline :: Int confdNodeRoleOffline = Types.confdNodeRoleToRaw NodeRoleOffline
91
confdNodeRoleOffline :: Int confdNodeRoleOffline = Types.confdNodeRoleToRaw NodeRoleOffline
91
confdNodeRoleOffline = Types.confdNodeRoleToRaw NodeRoleOffline
63
false
true
0
6
6
22
9
13
null
null
termite2/tsl
Internal/IExpr.hs
bsd-3-clause
lvalToExpr (LIndex a i) = EIndex (lvalToExpr a) (EConst $ UIntVal 32 i)
71
lvalToExpr (LIndex a i) = EIndex (lvalToExpr a) (EConst $ UIntVal 32 i)
71
lvalToExpr (LIndex a i) = EIndex (lvalToExpr a) (EConst $ UIntVal 32 i)
71
false
false
0
8
12
41
19
22
null
null
githubkleon/ConvenientHDL
src/Language/Verilog/Parser.hs
bsd-3-clause
parameter :: Stream s Identity Char => P s Parameter parameter = do dot x <- ident e <- parens expression return (Parameter x e)
151
parameter :: Stream s Identity Char => P s Parameter parameter = do dot x <- ident e <- parens expression return (Parameter x e)
151
parameter = do dot x <- ident e <- parens expression return (Parameter x e)
98
false
true
0
9
47
63
27
36
null
null
ganeti/ganeti
src/Ganeti/Hs2Py/OpDoc.hs
bsd-2-clause
opInstanceShutdown :: String opInstanceShutdown = "Shutdown an instance."
75
opInstanceShutdown :: String opInstanceShutdown = "Shutdown an instance."
75
opInstanceShutdown = "Shutdown an instance."
46
false
true
0
4
9
11
6
5
null
null
nevrenato/Hets_Fork
CSL/Keywords.hs
gpl-2.0
wsS :: String wsS = "ws"
25
wsS :: String wsS = "ws"
24
wsS = "ws"
10
false
true
0
6
6
18
7
11
null
null
nikita-volkov/postgresql-binary
library/PostgreSQL/Binary/Decoding.hs
mit
nullableValueArray :: Value a -> Array ( Maybe a ) nullableValueArray = Array . const . onContent
99
nullableValueArray :: Value a -> Array ( Maybe a ) nullableValueArray = Array . const . onContent
99
nullableValueArray = Array . const . onContent
48
false
true
0
8
18
35
17
18
null
null
sdiehl/ghc
compiler/GHC/Types/RepType.hs
bsd-3-clause
unwrapType :: Type -> Type unwrapType ty | Just (_, unwrapped) <- topNormaliseTypeX stepper mappend inner_ty = unwrapped | otherwise = inner_ty where inner_ty = go ty go t | Just t' <- coreView t = go t' go (ForAllTy _ t) = go t go (CastTy t _) = go t go t = t -- cf. Coercion.unwrapNewTypeStepper stepper rec_nts tc tys | Just (ty', _) <- instNewTyCon_maybe tc tys = case checkRecTc rec_nts tc of Just rec_nts' -> NS_Step rec_nts' (go ty') () Nothing -> NS_Abort -- infinite newtypes | otherwise = NS_Done
653
unwrapType :: Type -> Type unwrapType ty | Just (_, unwrapped) <- topNormaliseTypeX stepper mappend inner_ty = unwrapped | otherwise = inner_ty where inner_ty = go ty go t | Just t' <- coreView t = go t' go (ForAllTy _ t) = go t go (CastTy t _) = go t go t = t -- cf. Coercion.unwrapNewTypeStepper stepper rec_nts tc tys | Just (ty', _) <- instNewTyCon_maybe tc tys = case checkRecTc rec_nts tc of Just rec_nts' -> NS_Step rec_nts' (go ty') () Nothing -> NS_Abort -- infinite newtypes | otherwise = NS_Done
653
unwrapType ty | Just (_, unwrapped) <- topNormaliseTypeX stepper mappend inner_ty = unwrapped | otherwise = inner_ty where inner_ty = go ty go t | Just t' <- coreView t = go t' go (ForAllTy _ t) = go t go (CastTy t _) = go t go t = t -- cf. Coercion.unwrapNewTypeStepper stepper rec_nts tc tys | Just (ty', _) <- instNewTyCon_maybe tc tys = case checkRecTc rec_nts tc of Just rec_nts' -> NS_Step rec_nts' (go ty') () Nothing -> NS_Abort -- infinite newtypes | otherwise = NS_Done
626
false
true
1
11
241
237
107
130
null
null
chadbrewbaker/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
willConcatInAssignment _ = False
32
willConcatInAssignment _ = False
32
willConcatInAssignment _ = False
32
false
false
0
5
3
9
4
5
null
null
madebyjeffrey/HerbiePlugin
test/Tests.hs
bsd-3-clause
example10 p1x p2x p1y p2y = sqrt((p1x - p2x) * (p1x - p2x) + (p1y - p2y) * (p1y - p2y))
87
example10 p1x p2x p1y p2y = sqrt((p1x - p2x) * (p1x - p2x) + (p1y - p2y) * (p1y - p2y))
87
example10 p1x p2x p1y p2y = sqrt((p1x - p2x) * (p1x - p2x) + (p1y - p2y) * (p1y - p2y))
87
false
false
0
11
20
61
32
29
null
null
niexshao/Exercises
src/HQuestions.hs
bsd-3-clause
h32 :: Integer -> Integer -> Integer h32 a b = if b == 0 then abs a else h32 b (mod a b)
92
h32 :: Integer -> Integer -> Integer h32 a b = if b == 0 then abs a else h32 b (mod a b)
92
h32 a b = if b == 0 then abs a else h32 b (mod a b)
55
false
true
0
8
27
59
27
32
null
null
sopvop/cabal
cabal-install/Distribution/Solver/Modular/IndexConversion.hs
bsd-3-clause
-- | Convert a Cabal dependency on a executable (build-tools) to a solver-specific dependency. convExeDep :: PN -> Dependency -> Dep PN convExeDep pn' (Dependency pn vr) = Dep True pn (Constrained [(vr, P pn')])
211
convExeDep :: PN -> Dependency -> Dep PN convExeDep pn' (Dependency pn vr) = Dep True pn (Constrained [(vr, P pn')])
116
convExeDep pn' (Dependency pn vr) = Dep True pn (Constrained [(vr, P pn')])
75
true
true
0
10
34
61
31
30
null
null
RefactoringTools/HaRe
test/testdata/TypeUtils/VisiblePNs.hs
bsd-3-clause
getLocatedStart = undefined
27
getLocatedStart = undefined
27
getLocatedStart = undefined
27
false
false
0
4
2
6
3
3
null
null
cstrahan/rupee
Setup.hs
mit
setBuildInfo :: LocalBuildInfo -> BuildInfo -> LocalBuildInfo setBuildInfo l b = l { localPkgDescr = lpd' } where lpd = localPkgDescr l Just li = library lpd li' = li { libBuildInfo = b } lpd' = lpd { library = Just li' }
257
setBuildInfo :: LocalBuildInfo -> BuildInfo -> LocalBuildInfo setBuildInfo l b = l { localPkgDescr = lpd' } where lpd = localPkgDescr l Just li = library lpd li' = li { libBuildInfo = b } lpd' = lpd { library = Just li' }
257
setBuildInfo l b = l { localPkgDescr = lpd' } where lpd = localPkgDescr l Just li = library lpd li' = li { libBuildInfo = b } lpd' = lpd { library = Just li' }
195
false
true
0
9
79
83
44
39
null
null
ndmitchell/shake
src/Development/Shake/Internal/Resource.hs
bsd-3-clause
resourceId :: IO Int resourceId = unsafePerformIO resourceCounter
65
resourceId :: IO Int resourceId = unsafePerformIO resourceCounter
65
resourceId = unsafePerformIO resourceCounter
44
false
true
0
5
7
17
8
9
null
null
kimolas/causal-haskell
app/Graph.hs
bsd-3-clause
-- Computes the number of edges. nEdge :: Graph a -> Int nEdge gr = length $ edges gr
86
nEdge :: Graph a -> Int nEdge gr = length $ edges gr
52
nEdge gr = length $ edges gr
28
true
true
0
6
19
29
14
15
null
null
bitemyapp/7startups
Backends/XMPP.hs
bsd-3-clause
toNode (PResource Finance) = [addColor "#373737" "F"]
53
toNode (PResource Finance) = [addColor "#373737" "F"]
53
toNode (PResource Finance) = [addColor "#373737" "F"]
53
false
false
0
6
6
24
11
13
null
null
dbp/positionsites
src/Helpers/State.hs
bsd-3-clause
idQuery :: (HasPostgres m, Functor m, ToRow q) => Query -> q -> m (Maybe Int) idQuery stmt attrs = fmap (join . fmap listToMaybe . listToMaybe) $ query stmt attrs
162
idQuery :: (HasPostgres m, Functor m, ToRow q) => Query -> q -> m (Maybe Int) idQuery stmt attrs = fmap (join . fmap listToMaybe . listToMaybe) $ query stmt attrs
162
idQuery stmt attrs = fmap (join . fmap listToMaybe . listToMaybe) $ query stmt attrs
84
false
true
0
10
30
80
39
41
null
null
rueshyna/gogol
gogol-analytics/gen/Network/Google/Analytics/Types/Product.hs
mpl-2.0
-- | A unique ID for this upload. uuId :: Lens' Upload (Maybe Text) uuId = lens _uuId (\ s a -> s{_uuId = a})
109
uuId :: Lens' Upload (Maybe Text) uuId = lens _uuId (\ s a -> s{_uuId = a})
75
uuId = lens _uuId (\ s a -> s{_uuId = a})
41
true
true
0
9
24
46
25
21
null
null
alexandersgreen/alex-haskell
Poker/Poker.hs
apache-2.0
getRed Spades = 0.0
19
getRed Spades = 0.0
19
getRed Spades = 0.0
19
false
false
0
5
3
9
4
5
null
null
nandor/hcasm
HCdasm.hs
bsd-3-clause
-- Retrieves the header & contents of the CH16 file groupWords :: BSL.ByteString -> [ [ Int ] ] groupWords xs | BSL.length xs < 4 = [ ] | otherwise = map fromIntegral (BSL.unpack ls) : groupWords rs where ( ls, rs ) = BSL.splitAt 4 xs
245
groupWords :: BSL.ByteString -> [ [ Int ] ] groupWords xs | BSL.length xs < 4 = [ ] | otherwise = map fromIntegral (BSL.unpack ls) : groupWords rs where ( ls, rs ) = BSL.splitAt 4 xs
193
groupWords xs | BSL.length xs < 4 = [ ] | otherwise = map fromIntegral (BSL.unpack ls) : groupWords rs where ( ls, rs ) = BSL.splitAt 4 xs
149
true
true
1
10
58
93
46
47
null
null
bhamrick/record-lens
Language/Record/Lens.hs
bsd-3-clause
containedTypeVars (VarT n) = Set.singleton n
44
containedTypeVars (VarT n) = Set.singleton n
44
containedTypeVars (VarT n) = Set.singleton n
44
false
false
0
7
5
20
9
11
null
null
hsyl20/HViperVM
lib/ViperVM/STM/TIntSet.hs
lgpl-3.0
empty :: STM TIntSet empty = newTVar IntSet.empty
49
empty :: STM TIntSet empty = newTVar IntSet.empty
49
empty = newTVar IntSet.empty
28
false
true
0
6
7
19
9
10
null
null
robx/puzzle-draw
src/Draw/Draw.hs
mit
draw :: QDiagram b v n m -> QDrawing b v n m draw = Drawing . const
67
draw :: QDiagram b v n m -> QDrawing b v n m draw = Drawing . const
67
draw = Drawing . const
22
false
true
0
6
17
37
18
19
null
null
ctlab/gShell
src/Gshell/Run.hs
mit
createCommitDir :: Parents -> StateT GState IO FilePath createCommitDir parents = do hash <- lift generateHash time <- lift $ show <$> getPOSIXTime let revName = revDirName ++ hash commitsRoot %= (++ initCommit revName time) return revName where initCommit revName time = [ Dir revName [ Dir mountDirName [] , File parentsFileName $ show parents , File timeStampFileName time , File logFileName $ "fromList []"] ]
515
createCommitDir :: Parents -> StateT GState IO FilePath createCommitDir parents = do hash <- lift generateHash time <- lift $ show <$> getPOSIXTime let revName = revDirName ++ hash commitsRoot %= (++ initCommit revName time) return revName where initCommit revName time = [ Dir revName [ Dir mountDirName [] , File parentsFileName $ show parents , File timeStampFileName time , File logFileName $ "fromList []"] ]
515
createCommitDir parents = do hash <- lift generateHash time <- lift $ show <$> getPOSIXTime let revName = revDirName ++ hash commitsRoot %= (++ initCommit revName time) return revName where initCommit revName time = [ Dir revName [ Dir mountDirName [] , File parentsFileName $ show parents , File timeStampFileName time , File logFileName $ "fromList []"] ]
459
false
true
0
10
167
146
69
77
null
null
slpopejoy/fadno-xml
src/Fadno/MusicXml/MusicXml20.hs
bsd-2-clause
-- | Smart constructor for 'MusicData' mkMusicData :: MusicData mkMusicData = MusicData []
90
mkMusicData :: MusicData mkMusicData = MusicData []
51
mkMusicData = MusicData []
26
true
true
0
6
12
24
10
14
null
null
YLiLarry/parser241-production-rule
src/Parser241/Parser/ProductionRule/Internal/Maker.hs
bsd-3-clause
(|/) :: FromMaker m => Maker a -> Symbol a -> m a () m |/ Null = fromMaker $ maker (lhs, [Null]:rhs) where (lhs,rhs) = unMaker m
137
(|/) :: FromMaker m => Maker a -> Symbol a -> m a () m |/ Null = fromMaker $ maker (lhs, [Null]:rhs) where (lhs,rhs) = unMaker m
137
m |/ Null = fromMaker $ maker (lhs, [Null]:rhs) where (lhs,rhs) = unMaker m
84
false
true
0
11
36
84
42
42
null
null
karamellpelle/grid
designer/source/Game/Grid/Helpers/Camera.hs
gpl-3.0
cameraToViewTicks' :: Camera -> TickT -> View -> Camera cameraToViewTicks' camera ticks view = cameraToView' camera (1.0 / rTF ticks) view
143
cameraToViewTicks' :: Camera -> TickT -> View -> Camera cameraToViewTicks' camera ticks view = cameraToView' camera (1.0 / rTF ticks) view
143
cameraToViewTicks' camera ticks view = cameraToView' camera (1.0 / rTF ticks) view
87
false
true
0
8
25
47
23
24
null
null
ryzhyk/cocoon
cocoon/Expr.hs
apache-2.0
exprFuncs' (EDotVar _ _) = return ()
41
exprFuncs' (EDotVar _ _) = return ()
41
exprFuncs' (EDotVar _ _) = return ()
41
false
false
0
6
11
23
10
13
null
null
sw17ch/portaudio
examples/Transform.hs
mit
halve :: Int -> Int halve = (`shiftR` 1)
40
halve :: Int -> Int halve = (`shiftR` 1)
40
halve = (`shiftR` 1)
20
false
true
0
7
8
28
14
14
null
null
christiaanb/ghc
compiler/typecheck/TcEvidence.hs
bsd-3-clause
evTermCoercion (EvCoercion co) = co
35
evTermCoercion (EvCoercion co) = co
35
evTermCoercion (EvCoercion co) = co
35
false
false
0
7
4
15
7
8
null
null
jgoerzen/testpack
src/Test/HUnit/Tools.hs
lgpl-2.1
mapassertEqual :: (Show b, Eq b) => String -> (a -> b) -> [(a, b)] -> [HU.Test] mapassertEqual _ _ [] = []
106
mapassertEqual :: (Show b, Eq b) => String -> (a -> b) -> [(a, b)] -> [HU.Test] mapassertEqual _ _ [] = []
106
mapassertEqual _ _ [] = []
26
false
true
0
10
22
70
38
32
null
null
markuspf/Idris-dev
src/Idris/Parser/Ops.hs
bsd-3-clause
{- | Parses an operator in function position i.e. enclosed by `()', with an optional namespace @ OperatorFront ::= '(' '=' ')' | (Identifier_t '.')? '(' Operator_t ')' ; @ -} operatorFront :: IdrisParser (Name, FC) operatorFront = try (do (FC f (l, c) _) <- getFC op <- lchar '(' *> reservedOp "=" <* lchar ')' return (eqTy, FC f (l, c) (l, c+3))) <|> maybeWithNS (do (FC f (l, c) _) <- getFC op <- lchar '(' *> operator (FC _ _ (l', c')) <- getFC lchar ')' return (op, (FC f (l, c) (l', c' + 1)))) False []
713
operatorFront :: IdrisParser (Name, FC) operatorFront = try (do (FC f (l, c) _) <- getFC op <- lchar '(' *> reservedOp "=" <* lchar ')' return (eqTy, FC f (l, c) (l, c+3))) <|> maybeWithNS (do (FC f (l, c) _) <- getFC op <- lchar '(' *> operator (FC _ _ (l', c')) <- getFC lchar ')' return (op, (FC f (l, c) (l', c' + 1)))) False []
521
operatorFront = try (do (FC f (l, c) _) <- getFC op <- lchar '(' *> reservedOp "=" <* lchar ')' return (eqTy, FC f (l, c) (l, c+3))) <|> maybeWithNS (do (FC f (l, c) _) <- getFC op <- lchar '(' *> operator (FC _ _ (l', c')) <- getFC lchar ')' return (op, (FC f (l, c) (l', c' + 1)))) False []
481
true
true
4
14
307
235
119
116
null
null
sherwoodwang/wxHaskell
wxdirect/src/ParseC.hs
lgpl-2.1
pargs2 :: Parser [String] pargs2 = do a1 <- identifier _ <- comma a2 <- identifier return [a1,a2]
121
pargs2 :: Parser [String] pargs2 = do a1 <- identifier _ <- comma a2 <- identifier return [a1,a2]
121
pargs2 = do a1 <- identifier _ <- comma a2 <- identifier return [a1,a2]
95
false
true
0
9
41
56
25
31
null
null
mitsuji/bingo
app/Server.hs
bsd-3-clause
draw :: R.RandomGen g => g -> Game -> STM.STM () draw g Game{..} = do st@(c,_) <- STM.readTVar gameState when (c/=[]) $ do let r@(x,st'@(_,ss)) = Lot.draw g st STM.writeTVar gameState st' STM.writeTChan gameChan (MessageDrawGame x ss) parts <- STM.readTVar gameParticipants mapM_ (\p -> do card <- STM.readTVar (participantCard p) let r = B.processCard card ss let s = B.evalCard r STM.writeTChan (participantChan p) (MessageDrawParticipant x ss r s) ) $ Map.elems parts
584
draw :: R.RandomGen g => g -> Game -> STM.STM () draw g Game{..} = do st@(c,_) <- STM.readTVar gameState when (c/=[]) $ do let r@(x,st'@(_,ss)) = Lot.draw g st STM.writeTVar gameState st' STM.writeTChan gameChan (MessageDrawGame x ss) parts <- STM.readTVar gameParticipants mapM_ (\p -> do card <- STM.readTVar (participantCard p) let r = B.processCard card ss let s = B.evalCard r STM.writeTChan (participantChan p) (MessageDrawParticipant x ss r s) ) $ Map.elems parts
584
draw g Game{..} = do st@(c,_) <- STM.readTVar gameState when (c/=[]) $ do let r@(x,st'@(_,ss)) = Lot.draw g st STM.writeTVar gameState st' STM.writeTChan gameChan (MessageDrawGame x ss) parts <- STM.readTVar gameParticipants mapM_ (\p -> do card <- STM.readTVar (participantCard p) let r = B.processCard card ss let s = B.evalCard r STM.writeTChan (participantChan p) (MessageDrawParticipant x ss r s) ) $ Map.elems parts
535
false
true
0
20
187
260
123
137
null
null
k0001/tisch
src/lib/Tisch/Internal/Aggregation.hs
apache-2.0
-- | Bitwise OR of all input values. bworgg :: PgIntegral a => O.Aggregator (Kol a) (Kol a) bworgg = unsafeMakeAggr (HDB.AggrOther "bit_or")
140
bworgg :: PgIntegral a => O.Aggregator (Kol a) (Kol a) bworgg = unsafeMakeAggr (HDB.AggrOther "bit_or")
103
bworgg = unsafeMakeAggr (HDB.AggrOther "bit_or")
48
true
true
0
9
22
54
25
29
null
null
itayd/hh
src/hh.hs
bsd-3-clause
vtyBounds :: Vty -> IO (Int, Int) vtyBounds vty = do bounds <- display_bounds $ terminal vty return (fromInteger( toInteger $ region_width bounds), fromInteger( toInteger $ region_height bounds )) :: IO (Int, Int)
221
vtyBounds :: Vty -> IO (Int, Int) vtyBounds vty = do bounds <- display_bounds $ terminal vty return (fromInteger( toInteger $ region_width bounds), fromInteger( toInteger $ region_height bounds )) :: IO (Int, Int)
221
vtyBounds vty = do bounds <- display_bounds $ terminal vty return (fromInteger( toInteger $ region_width bounds), fromInteger( toInteger $ region_height bounds )) :: IO (Int, Int)
187
false
true
0
13
40
96
46
50
null
null
aisamanra/matterhorn
src/Draw/Util.hs
bsd-3-clause
-- | Generates a local matterhorn-only client message that creates a -- date marker. The server date is converted to a local time (via -- timezone), and midnight of that timezone used to generate date -- markers. Note that the actual time of the server and this client -- are still not synchronized, but no manipulations here actually use -- the client time. insertDateMarkers :: Messages -> Text -> TimeZoneSeries -> Messages insertDateMarkers ms datefmt tz = foldr (addMessage . dateMsg) ms dateRange where dateRange = foldr checkDateChange Set.empty ms checkDateChange m = let msgDay = startOfDay (Just tz) (withServerTime (m^.mDate)) in if m^.mDeleted then id else Set.insert msgDay dateMsg d = let t = localTimeText datefmt $ asLocalTime tz d in newMessageOfType t (C DateTransition) (ServerTime d)
881
insertDateMarkers :: Messages -> Text -> TimeZoneSeries -> Messages insertDateMarkers ms datefmt tz = foldr (addMessage . dateMsg) ms dateRange where dateRange = foldr checkDateChange Set.empty ms checkDateChange m = let msgDay = startOfDay (Just tz) (withServerTime (m^.mDate)) in if m^.mDeleted then id else Set.insert msgDay dateMsg d = let t = localTimeText datefmt $ asLocalTime tz d in newMessageOfType t (C DateTransition) (ServerTime d)
520
insertDateMarkers ms datefmt tz = foldr (addMessage . dateMsg) ms dateRange where dateRange = foldr checkDateChange Set.empty ms checkDateChange m = let msgDay = startOfDay (Just tz) (withServerTime (m^.mDate)) in if m^.mDeleted then id else Set.insert msgDay dateMsg d = let t = localTimeText datefmt $ asLocalTime tz d in newMessageOfType t (C DateTransition) (ServerTime d)
452
true
true
0
13
205
177
89
88
null
null
facebookincubator/duckling
Duckling/Time/ES/Rules.hs
bsd-3-clause
ruleIntersect :: Rule ruleIntersect = Rule { name = "intersect" , pattern = [ Predicate isNotLatent , Predicate isNotLatent ] , prod = \tokens -> case tokens of (Token Time td1:Token Time td2:_) -> Token Time <$> intersect td1 td2 _ -> Nothing }
285
ruleIntersect :: Rule ruleIntersect = Rule { name = "intersect" , pattern = [ Predicate isNotLatent , Predicate isNotLatent ] , prod = \tokens -> case tokens of (Token Time td1:Token Time td2:_) -> Token Time <$> intersect td1 td2 _ -> Nothing }
285
ruleIntersect = Rule { name = "intersect" , pattern = [ Predicate isNotLatent , Predicate isNotLatent ] , prod = \tokens -> case tokens of (Token Time td1:Token Time td2:_) -> Token Time <$> intersect td1 td2 _ -> Nothing }
263
false
true
0
15
83
101
52
49
null
null
luisnavarrodelangel/InnerEar
src/InnerEar/Widgets/UserPage.hs
gpl-3.0
responseToRecord :: Response -> Maybe Record responseToRecord (RecordResponse r) = Just r
89
responseToRecord :: Response -> Maybe Record responseToRecord (RecordResponse r) = Just r
89
responseToRecord (RecordResponse r) = Just r
44
false
true
0
7
11
30
14
16
null
null
comonoidial/ALFIN
Backend/OptimizeAsm.hs
mit
getHeapFunTag (PapTag f _) = [(PartApply, f)]
45
getHeapFunTag (PapTag f _) = [(PartApply, f)]
45
getHeapFunTag (PapTag f _) = [(PartApply, f)]
45
false
false
0
6
6
27
14
13
null
null
y-kamiya/ai-samples
app/BlockWorldStrips.hs
bsd-3-clause
buildAction :: Int -> BWActionType -> Action BWActionType BWTerm buildAction cost aType@(Pickup x) = Action aType (buildPre x) (buildPost x) cost where buildPre x = [HandEmpty, IsTop x True, On x Table] buildPost x = [HandHas x, IsTop x False]
254
buildAction :: Int -> BWActionType -> Action BWActionType BWTerm buildAction cost aType@(Pickup x) = Action aType (buildPre x) (buildPost x) cost where buildPre x = [HandEmpty, IsTop x True, On x Table] buildPost x = [HandHas x, IsTop x False]
254
buildAction cost aType@(Pickup x) = Action aType (buildPre x) (buildPost x) cost where buildPre x = [HandEmpty, IsTop x True, On x Table] buildPost x = [HandHas x, IsTop x False]
189
false
true
1
8
50
111
55
56
null
null
thalerjonathan/phd
public/ArtIterating/code/haskell/PureAgentsConc/src/WildFire/WildFireModelDynamic.hs
gpl-3.0
randomNeighbourCoord :: StdGen -> WFCellCoord -> (WFCellCoord, StdGen) randomNeighbourCoord g (cx, cy) = (randC, g') where nsCells = map (\(nx, ny) -> (cx + nx, cy + ny) :: WFCellCoord) neighbourhood (randIdx, g') = randomR (0, (length nsCells) - 1) g randC = nsCells !! randIdx
306
randomNeighbourCoord :: StdGen -> WFCellCoord -> (WFCellCoord, StdGen) randomNeighbourCoord g (cx, cy) = (randC, g') where nsCells = map (\(nx, ny) -> (cx + nx, cy + ny) :: WFCellCoord) neighbourhood (randIdx, g') = randomR (0, (length nsCells) - 1) g randC = nsCells !! randIdx
306
randomNeighbourCoord g (cx, cy) = (randC, g') where nsCells = map (\(nx, ny) -> (cx + nx, cy + ny) :: WFCellCoord) neighbourhood (randIdx, g') = randomR (0, (length nsCells) - 1) g randC = nsCells !! randIdx
235
false
true
0
9
73
128
72
56
null
null
GaloisInc/pads-haskell
Examples/Binary.hs
bsd-3-clause
{- on a little endian machine -} word32_result :: (Word32, Base_md) = unsafePerformIO $ parseFileWith Native.word32_parseM binary_input_file
140
word32_result :: (Word32, Base_md) = unsafePerformIO $ parseFileWith Native.word32_parseM binary_input_file
107
word32_result :: (Word32, Base_md) = unsafePerformIO $ parseFileWith Native.word32_parseM binary_input_file
107
true
false
1
7
16
30
15
15
null
null
katydid/haslapse
src/Data/Katydid/Parser/Protobuf/Descriptor.hs
bsd-3-clause
isScalar :: D.FieldDescriptorProto -> Bool isScalar field = wireType (field ^. D.type') /= Lengthy
98
isScalar :: D.FieldDescriptorProto -> Bool isScalar field = wireType (field ^. D.type') /= Lengthy
98
isScalar field = wireType (field ^. D.type') /= Lengthy
55
false
true
0
9
13
40
19
21
null
null
pparkkin/eta
compiler/ETA/Prelude/PrelNames.hs
bsd-3-clause
jbytePrimTyConKey = mkPreludeTyConUnique 79
45
jbytePrimTyConKey = mkPreludeTyConUnique 79
45
jbytePrimTyConKey = mkPreludeTyConUnique 79
45
false
false
0
5
5
9
4
5
null
null
hguenther/fac
Formula.hs
gpl-3.0
allVars (And x y) = Set.union (allVars x) (allVars y)
53
allVars (And x y) = Set.union (allVars x) (allVars y)
53
allVars (And x y) = Set.union (allVars x) (allVars y)
53
false
false
0
7
9
37
17
20
null
null
chemist/highlighter
src/Text/Highlighter/Lexers/Tex.hs
bsd-3-clause
inlinemath' :: TokenMatcher inlinemath' = [ tokNext "\\\\\\)" (Arbitrary "Literal" :. Arbitrary "String") Pop , tokNext "\\$" (Arbitrary "Literal" :. Arbitrary "String") Pop , anyOf math' ]
205
inlinemath' :: TokenMatcher inlinemath' = [ tokNext "\\\\\\)" (Arbitrary "Literal" :. Arbitrary "String") Pop , tokNext "\\$" (Arbitrary "Literal" :. Arbitrary "String") Pop , anyOf math' ]
205
inlinemath' = [ tokNext "\\\\\\)" (Arbitrary "Literal" :. Arbitrary "String") Pop , tokNext "\\$" (Arbitrary "Literal" :. Arbitrary "String") Pop , anyOf math' ]
177
false
true
0
10
42
70
32
38
null
null
andrebask/newsprint
src/AccountManagerWS/Handler/UpdateFeed.hs
apache-2.0
getNow :: IO UTCTime getNow = do now <- getCurrentTime return now
77
getNow :: IO UTCTime getNow = do now <- getCurrentTime return now
77
getNow = do now <- getCurrentTime return now
56
false
true
0
8
23
33
13
20
null
null
samueljackson92/advent-of-code
day6/day6.hs
mit
main :: IO () main = do args <- getArgs content <- readFile (args !! 0) let tree = makeTree (1000, 1000) 0 putStrLn . show . totalBrightness . processInstructions tree . map parseInstruction . lines $ content
233
main :: IO () main = do args <- getArgs content <- readFile (args !! 0) let tree = makeTree (1000, 1000) 0 putStrLn . show . totalBrightness . processInstructions tree . map parseInstruction . lines $ content
233
main = do args <- getArgs content <- readFile (args !! 0) let tree = makeTree (1000, 1000) 0 putStrLn . show . totalBrightness . processInstructions tree . map parseInstruction . lines $ content
219
false
true
0
12
62
93
44
49
null
null
GaloisInc/ivory
ivory/src/Ivory/Language/Syntax/Concrete/QQ/BitDataQQ.hs
bsd-3-clause
mkArraySizeTypeInst :: Integer -> TH.Type -> [DecQ] mkArraySizeTypeInst n ty = [tySynInstDCompat ''B.ArraySize Nothing args size] where size = tyBits ty >>= litT . numTyLit . fromIntegral . (* n) args = [litT (numTyLit (fromIntegral n)), return ty] -- | Return a list of types for each field in a constructor.
320
mkArraySizeTypeInst :: Integer -> TH.Type -> [DecQ] mkArraySizeTypeInst n ty = [tySynInstDCompat ''B.ArraySize Nothing args size] where size = tyBits ty >>= litT . numTyLit . fromIntegral . (* n) args = [litT (numTyLit (fromIntegral n)), return ty] -- | Return a list of types for each field in a constructor.
320
mkArraySizeTypeInst n ty = [tySynInstDCompat ''B.ArraySize Nothing args size] where size = tyBits ty >>= litT . numTyLit . fromIntegral . (* n) args = [litT (numTyLit (fromIntegral n)), return ty] -- | Return a list of types for each field in a constructor.
268
false
true
1
12
61
108
55
53
null
null
brendanhay/gogol
gogol-genomics/gen/Network/Google/Genomics/Types.hs
mpl-2.0
-- | See, edit, configure, and delete your Google Cloud Platform data cloudPlatformScope :: Proxy '["https://www.googleapis.com/auth/cloud-platform"] cloudPlatformScope = Proxy
176
cloudPlatformScope :: Proxy '["https://www.googleapis.com/auth/cloud-platform"] cloudPlatformScope = Proxy
106
cloudPlatformScope = Proxy
26
true
true
0
7
18
20
11
9
null
null
Tomoaki-Hashizaki/pesca
src/PrSequent.hs
gpl-2.0
-- works for 1..9 only --------------------------------------------------- -- printing in LaTeX -- printing proof trees as LaTeX files prLatexProof proof = prLatexFile ("\\[" ++++ prProof proof ++++ "\\]") where prProof (Goal seq) = makeLatex (prSequent seq ++ "^{??}") prProof (Param c) = makeLatex (c +++ "= ?") prProof (Proof ident seq []) = "\\infer{" ++++ makeLatex (prSequent seq) ++++ "}{" ++ makeLatex ident ++ "}" -- makeLatex (prSequent seq ++ "^{" ++ ident ++"}") -- axiom without line prProof (Proof ident seq proofs) = "\\infer[{\\scriptstyle" +++ makeLatex ident ++ "}]{" ++++ makeLatex (prSequent seq) ++++ "}{" ++++ prTList "\n & \n" (map prProof proofs) ++++ "}"
751
prLatexProof proof = prLatexFile ("\\[" ++++ prProof proof ++++ "\\]") where prProof (Goal seq) = makeLatex (prSequent seq ++ "^{??}") prProof (Param c) = makeLatex (c +++ "= ?") prProof (Proof ident seq []) = "\\infer{" ++++ makeLatex (prSequent seq) ++++ "}{" ++ makeLatex ident ++ "}" -- makeLatex (prSequent seq ++ "^{" ++ ident ++"}") -- axiom without line prProof (Proof ident seq proofs) = "\\infer[{\\scriptstyle" +++ makeLatex ident ++ "}]{" ++++ makeLatex (prSequent seq) ++++ "}{" ++++ prTList "\n & \n" (map prProof proofs) ++++ "}"
613
prLatexProof proof = prLatexFile ("\\[" ++++ prProof proof ++++ "\\]") where prProof (Goal seq) = makeLatex (prSequent seq ++ "^{??}") prProof (Param c) = makeLatex (c +++ "= ?") prProof (Proof ident seq []) = "\\infer{" ++++ makeLatex (prSequent seq) ++++ "}{" ++ makeLatex ident ++ "}" -- makeLatex (prSequent seq ++ "^{" ++ ident ++"}") -- axiom without line prProof (Proof ident seq proofs) = "\\infer[{\\scriptstyle" +++ makeLatex ident ++ "}]{" ++++ makeLatex (prSequent seq) ++++ "}{" ++++ prTList "\n & \n" (map prProof proofs) ++++ "}"
613
true
false
0
13
176
199
98
101
null
null
syjer/talks
talks/2015-05-26-juglugano/javafun/src/test/haskell/example2.hs
cc0-1.0
sumCurried :: Integer -> Integer -> Integer sumCurried a b = a + b
66
sumCurried :: Integer -> Integer -> Integer sumCurried a b = a + b
66
sumCurried a b = a + b
22
false
true
0
6
13
28
14
14
null
null
green-haskell/ghc
compiler/cmm/CmmNode.hs
bsd-3-clause
mapExpM _ (CmmBranch _) = Nothing
45
mapExpM _ (CmmBranch _) = Nothing
45
mapExpM _ (CmmBranch _) = Nothing
45
false
false
1
6
17
20
8
12
null
null
rahulmutt/ghcvm
compiler/Eta/Utils/PprColor.hs
bsd-3-clause
codeCustom :: String -> PprColor codeCustom "" = mempty
55
codeCustom :: String -> PprColor codeCustom "" = mempty
55
codeCustom "" = mempty
22
false
true
0
5
8
18
9
9
null
null
d0kt0r0/estuary
client/src/Estuary/Help/MiniTidal.hs
gpl-3.0
referenceText "trunc" = "truncates a pattern so that only a fraction of the pattern is played."
95
referenceText "trunc" = "truncates a pattern so that only a fraction of the pattern is played."
95
referenceText "trunc" = "truncates a pattern so that only a fraction of the pattern is played."
95
false
false
0
5
15
9
4
5
null
null
perurbis/hfreeagent
src/Web/FreeAgent/Util.hs
mit
aesonHandler :: FromJSON a => Response -> InputStream BS.ByteString -> IO (Maybe a) aesonHandler _ = parseJSONFromStream
120
aesonHandler :: FromJSON a => Response -> InputStream BS.ByteString -> IO (Maybe a) aesonHandler _ = parseJSONFromStream
120
aesonHandler _ = parseJSONFromStream
36
false
true
0
10
16
43
20
23
null
null
bennofs/dynamic-cabal
src/Distribution/Client/Dynamic/PackageDescription.hs
bsd-3-clause
hsSourceDirs' :: Selector BuildInfo [FilePath] hsSourceDirs' = selector $ const $ useValue "Distribution.PackageDescription" $ Ident "hsSourceDirs"
147
hsSourceDirs' :: Selector BuildInfo [FilePath] hsSourceDirs' = selector $ const $ useValue "Distribution.PackageDescription" $ Ident "hsSourceDirs"
147
hsSourceDirs' = selector $ const $ useValue "Distribution.PackageDescription" $ Ident "hsSourceDirs"
100
false
true
0
7
15
37
18
19
null
null
guoy34/ampersand
src/Database/Design/Ampersand/FSpec/Plug.hs
gpl-3.0
-- Every kernel field is a key, kernel fields are in cLkpTbl or the column of ScalarSQL (which has one column only) -- isPlugIndex refers to UNIQUE key -- TODO: this is wrong --isPlugIndex may contain NULL, but their key (the entityfield of the plug) must be unique for a kernel field (isPlugIndex=True) --the field that is isIdent and isPlugIndex (i.e. concept plug), or any similar (uni,inj,sur,tot) field is also UNIQUE key --IdentityDefs define UNIQUE key (fld1,fld2,..,fldn) --REMARK -> a kernel field does not have to be in cLkpTbl, in that cast there is another kernel field that is -- thus I must check whether fldexpr isUni && isInj && isSur isPlugIndex :: PlugSQL->SqlField->Bool isPlugIndex plug f = case plug of ScalarSQL{} -> sqlColumn plug==f BinSQL{} --mLkp is not uni or inj by definition of BinSQL, if mLkp total then the (fldexpr srcfld)=I/\r;r~=I i.e. a key for this plug | isUni(mLkp plug) || isInj(mLkp plug) -> fatal 366 "BinSQL may not store a univalent or injective rel, use TblSQL instead." | otherwise -> False --binary does not have key, but I could do a SELECT DISTINCT iff f==fst(columns plug) && (isTot(mLkp plug)) TblSQL{} -> elem f (fields plug) && isUni(fldexpr f) && isInj(fldexpr f) && isSur(fldexpr f)
1,301
isPlugIndex :: PlugSQL->SqlField->Bool isPlugIndex plug f = case plug of ScalarSQL{} -> sqlColumn plug==f BinSQL{} --mLkp is not uni or inj by definition of BinSQL, if mLkp total then the (fldexpr srcfld)=I/\r;r~=I i.e. a key for this plug | isUni(mLkp plug) || isInj(mLkp plug) -> fatal 366 "BinSQL may not store a univalent or injective rel, use TblSQL instead." | otherwise -> False --binary does not have key, but I could do a SELECT DISTINCT iff f==fst(columns plug) && (isTot(mLkp plug)) TblSQL{} -> elem f (fields plug) && isUni(fldexpr f) && isInj(fldexpr f) && isSur(fldexpr f)
641
isPlugIndex plug f = case plug of ScalarSQL{} -> sqlColumn plug==f BinSQL{} --mLkp is not uni or inj by definition of BinSQL, if mLkp total then the (fldexpr srcfld)=I/\r;r~=I i.e. a key for this plug | isUni(mLkp plug) || isInj(mLkp plug) -> fatal 366 "BinSQL may not store a univalent or injective rel, use TblSQL instead." | otherwise -> False --binary does not have key, but I could do a SELECT DISTINCT iff f==fst(columns plug) && (isTot(mLkp plug)) TblSQL{} -> elem f (fields plug) && isUni(fldexpr f) && isInj(fldexpr f) && isSur(fldexpr f)
602
true
true
0
14
270
171
83
88
null
null
goldfirere/singletons
singletons-base/tests/compile-and-dump/Singletons/PatternMatching.hs
bsd-3-clause
test3 :: Proxy Lsz -> Proxy (Succ Zero) test3 = id
50
test3 :: Proxy Lsz -> Proxy (Succ Zero) test3 = id
50
test3 = id
10
false
true
0
8
10
27
13
14
null
null
valderman/selda
selda-tests/test/Tests/Mutable.hs
mit
transactionCompletes = do setup transaction $ do insert_ comments [(def, Just "Kobayashi", c1)] insert_ comments [ (def, Nothing, "more anonymous spam") , (def, Just "Kobayashi", c2) ] cs <- query $ do t <- select comments restrict (t!cName .== just "Kobayashi") return (t!cComment) ass "some inserts were not performed" (c1 `elem` cs && c2 `elem` cs && length cs == 2) where c1 = "チョロゴン" c2 = "メイド最高!"
464
transactionCompletes = do setup transaction $ do insert_ comments [(def, Just "Kobayashi", c1)] insert_ comments [ (def, Nothing, "more anonymous spam") , (def, Just "Kobayashi", c2) ] cs <- query $ do t <- select comments restrict (t!cName .== just "Kobayashi") return (t!cComment) ass "some inserts were not performed" (c1 `elem` cs && c2 `elem` cs && length cs == 2) where c1 = "チョロゴン" c2 = "メイド最高!"
464
transactionCompletes = do setup transaction $ do insert_ comments [(def, Just "Kobayashi", c1)] insert_ comments [ (def, Nothing, "more anonymous spam") , (def, Just "Kobayashi", c2) ] cs <- query $ do t <- select comments restrict (t!cName .== just "Kobayashi") return (t!cComment) ass "some inserts were not performed" (c1 `elem` cs && c2 `elem` cs && length cs == 2) where c1 = "チョロゴン" c2 = "メイド最高!"
464
false
false
2
14
129
186
90
96
null
null
creichert/wai
wai-extra/Network/Wai/Test.hs
mit
request :: Request -> Session SResponse request = srequest . flip SRequest L.empty
82
request :: Request -> Session SResponse request = srequest . flip SRequest L.empty
82
request = srequest . flip SRequest L.empty
42
false
true
0
7
12
29
14
15
null
null
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/Distribution/Simple/GHC.hs
bsd-3-clause
replLib = buildOrReplLib True
30
replLib = buildOrReplLib True
30
replLib = buildOrReplLib True
30
false
false
0
5
4
9
4
5
null
null
fffej/HS-Poker
LookupPatternMatch.hs
bsd-3-clause
getValueFromProduct 240065 = 2000
33
getValueFromProduct 240065 = 2000
33
getValueFromProduct 240065 = 2000
33
false
false
0
5
3
9
4
5
null
null
well-typed/generics-sop
generics-sop/src/Generics/SOP/TH.hs
bsd-3-clause
unSigType :: Type -> Type unSigType (SigT t _) = t
50
unSigType :: Type -> Type unSigType (SigT t _) = t
50
unSigType (SigT t _) = t
24
false
true
0
7
10
26
13
13
null
null
Ace124/TICTACTOE2
src/Parser.hs
bsd-3-clause
emoveSeaparator :: [Char] -> [Char] removeSeaparator s = deleteAllInstances ',' s
83
removeSeaparator :: [Char] -> [Char] removeSeaparator s = deleteAllInstances ',' s
82
removeSeaparator s = deleteAllInstances ',' s
45
false
true
0
6
12
29
15
14
null
null
uuhan/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
nativeTyWidth :: NativeTy -> Int nativeTyWidth IT8 = 8
54
nativeTyWidth :: NativeTy -> Int nativeTyWidth IT8 = 8
54
nativeTyWidth IT8 = 8
21
false
true
0
5
8
18
9
9
null
null
bitemyapp/dejafu
Test/DejaFu/Deterministic/Internal/Threading.hs
mit
fullknown :: ThreadId -> Threads n r s -> Threads n r s fullknown = M.alter go where go (Just thread) = Just $ thread { _fullknown = True } go _ = error "Invariant failure in 'fullknown': thread does NOT exist!"
215
fullknown :: ThreadId -> Threads n r s -> Threads n r s fullknown = M.alter go where go (Just thread) = Just $ thread { _fullknown = True } go _ = error "Invariant failure in 'fullknown': thread does NOT exist!"
215
fullknown = M.alter go where go (Just thread) = Just $ thread { _fullknown = True } go _ = error "Invariant failure in 'fullknown': thread does NOT exist!"
159
false
true
2
8
45
87
39
48
null
null
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/Compatibility/Tokens.hs
bsd-3-clause
gl_CURRENT_RASTER_POSITION_VALID :: GLenum gl_CURRENT_RASTER_POSITION_VALID = 0x0B08
84
gl_CURRENT_RASTER_POSITION_VALID :: GLenum gl_CURRENT_RASTER_POSITION_VALID = 0x0B08
84
gl_CURRENT_RASTER_POSITION_VALID = 0x0B08
41
false
true
0
4
5
11
6
5
null
null
emwap/feldspar-language
src/Feldspar/Range.hs
bsd-3-clause
rangeNeg :: BoundedInt a => Range a -> Range a rangeNeg = handleSign rangeNegUnsigned rangeNegSigned
100
rangeNeg :: BoundedInt a => Range a -> Range a rangeNeg = handleSign rangeNegUnsigned rangeNegSigned
100
rangeNeg = handleSign rangeNegUnsigned rangeNegSigned
53
false
true
0
7
14
33
15
18
null
null
VictorDenisov/keystone
src/Glance/Web/Schema.hs
gpl-2.0
metadefsTagsSchemaH :: (Functor m, MonadIO m) => GlanceConfig -> ActionM m () metadefsTagsSchemaH c = do handleSchema "metadefs_tags_schema.json"
172
metadefsTagsSchemaH :: (Functor m, MonadIO m) => GlanceConfig -> ActionM m () metadefsTagsSchemaH c = do handleSchema "metadefs_tags_schema.json"
172
metadefsTagsSchemaH c = do handleSchema "metadefs_tags_schema.json"
69
false
true
0
8
44
46
22
24
null
null
bkoropoff/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
highestFC (PUnifyLog tm) = highestFC tm
39
highestFC (PUnifyLog tm) = highestFC tm
39
highestFC (PUnifyLog tm) = highestFC tm
39
false
false
0
7
5
18
8
10
null
null
gridaphobe/ghc
compiler/deSugar/DsUtils.hs
bsd-3-clause
combineMatchResults :: MatchResult -> MatchResult -> MatchResult combineMatchResults (MatchResult CanFail body_fn1) (MatchResult can_it_fail2 body_fn2) = MatchResult can_it_fail2 body_fn where body_fn fail = do body2 <- body_fn2 fail (fail_bind, duplicatable_expr) <- mkFailurePair body2 body1 <- body_fn1 duplicatable_expr return (Let fail_bind body1)
451
combineMatchResults :: MatchResult -> MatchResult -> MatchResult combineMatchResults (MatchResult CanFail body_fn1) (MatchResult can_it_fail2 body_fn2) = MatchResult can_it_fail2 body_fn where body_fn fail = do body2 <- body_fn2 fail (fail_bind, duplicatable_expr) <- mkFailurePair body2 body1 <- body_fn1 duplicatable_expr return (Let fail_bind body1)
451
combineMatchResults (MatchResult CanFail body_fn1) (MatchResult can_it_fail2 body_fn2) = MatchResult can_it_fail2 body_fn where body_fn fail = do body2 <- body_fn2 fail (fail_bind, duplicatable_expr) <- mkFailurePair body2 body1 <- body_fn1 duplicatable_expr return (Let fail_bind body1)
386
false
true
1
10
138
116
50
66
null
null
harendra-kumar/asyncly
benchmark/Chart.hs
bsd-3-clause
parseOptions :: IO (Maybe Options) parseOptions = do args <- getArgs runMaybeT $ flip evalStateT (args, defaultOptions) $ do parseLoop fmap snd get where parseOpt opt = case opt of "--graphs" -> setGenGraphs True "--group-diff" -> setGroupDiff True "--benchmark" -> parseBench str -> do liftIO $ putStrLn $ "Unrecognized option " <> str mzero parseLoop = do next <- shift case next of Just opt -> parseOpt opt >> parseLoop Nothing -> return ()
615
parseOptions :: IO (Maybe Options) parseOptions = do args <- getArgs runMaybeT $ flip evalStateT (args, defaultOptions) $ do parseLoop fmap snd get where parseOpt opt = case opt of "--graphs" -> setGenGraphs True "--group-diff" -> setGroupDiff True "--benchmark" -> parseBench str -> do liftIO $ putStrLn $ "Unrecognized option " <> str mzero parseLoop = do next <- shift case next of Just opt -> parseOpt opt >> parseLoop Nothing -> return ()
615
parseOptions = do args <- getArgs runMaybeT $ flip evalStateT (args, defaultOptions) $ do parseLoop fmap snd get where parseOpt opt = case opt of "--graphs" -> setGenGraphs True "--group-diff" -> setGroupDiff True "--benchmark" -> parseBench str -> do liftIO $ putStrLn $ "Unrecognized option " <> str mzero parseLoop = do next <- shift case next of Just opt -> parseOpt opt >> parseLoop Nothing -> return ()
580
false
true
0
12
245
171
78
93
null
null
caneroj1/Crypto-hs
src/Internal/TupleUtils.hs
bsd-3-clause
trd :: (a, b, c) -> c trd (_, _, c) = c
45
trd :: (a, b, c) -> c trd (_, _, c) = c
45
trd (_, _, c) = c
23
false
true
0
6
18
36
21
15
null
null
wxwxwwxxx/ghc
libraries/base/GHC/List.hs
bsd-3-clause
take _ [] = []
28
take _ [] = []
28
take _ [] = []
28
false
false
0
6
18
19
8
11
null
null
aelve/guide
back/src/Guide/Logger/Functions.hs
bsd-3-clause
logInfo = Di.info . Df1.message
37
logInfo = Di.info . Df1.message
37
logInfo = Di.info . Df1.message
37
false
false
2
6
10
19
7
12
null
null
rahulmutt/ghcvm
tests/suite/array/run/Arr016/Arr016.hs
bsd-3-clause
resize :: Int -> Gen a -> Gen a resize n (Gen m) = Gen (\_ r -> m n r)
70
resize :: Int -> Gen a -> Gen a resize n (Gen m) = Gen (\_ r -> m n r)
70
resize n (Gen m) = Gen (\_ r -> m n r)
38
false
true
0
10
20
59
27
32
null
null
NightRa/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
indent :: Int -> String indent n = replicate (n*4) ' '
54
indent :: Int -> String indent n = replicate (n*4) ' '
54
indent n = replicate (n*4) ' '
30
false
true
0
7
11
30
15
15
null
null
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Texinfo.hs
gpl-2.0
-- | Filename extensions for this language. syntaxExtensions :: String syntaxExtensions = "*.texi"
98
syntaxExtensions :: String syntaxExtensions = "*.texi"
54
syntaxExtensions = "*.texi"
27
true
true
0
4
12
12
7
5
null
null
dolio/vector
Data/Vector/Storable.hs
bsd-3-clause
scanr1 = G.scanr1
17
scanr1 = G.scanr1
17
scanr1 = G.scanr1
17
false
false
1
6
2
12
4
8
null
null
pgj/bead
src/Bead/View/Content/Evaluation/Page.hs
bsd-3-clause
abstractEvaluationPostHandler :: ContentHandler key -> (key -> C.Evaluation -> UserAction) -> POSTContentHandler abstractEvaluationPostHandler getEvKeyParameter evCommand = do sk <- getParameter submissionKeyPrm commentText <- getParameter evaluationValuePrm commentOrResult <- getJSONParam (fieldName evaluationResultField) "There can be no evaluation found." withEvalOrComment commentOrResult (do (mrole,mname) <- (getRole &&& getName) <$> userState let uname = fromMaybe "???" mname case mrole of Nothing -> return $ LogMessage "The user is not logged in" -- Impossible Just role -> do now <- liftIO $ getCurrentTime return $ SubmissionComment sk Comment { comment = commentText , commentAuthor = uname , commentDate = now , commentType = roleToCommentType role }) (\result -> do key <- getEvKeyParameter let e = C.Evaluation { evaluationResult = result , writtenEvaluation = commentText } return $ evCommand key e) where roleToCommentType = roleCata CT_Student CT_GroupAdmin CT_CourseAdmin CT_Admin getRole = userStateCata Nothing Nothing Nothing (\_username _uid _page _name role _token _timezone _status -> Just role) getName = userStateCata Nothing Nothing Nothing (\_username _uid _page name _role _token _timezone _status -> Just name)
1,537
abstractEvaluationPostHandler :: ContentHandler key -> (key -> C.Evaluation -> UserAction) -> POSTContentHandler abstractEvaluationPostHandler getEvKeyParameter evCommand = do sk <- getParameter submissionKeyPrm commentText <- getParameter evaluationValuePrm commentOrResult <- getJSONParam (fieldName evaluationResultField) "There can be no evaluation found." withEvalOrComment commentOrResult (do (mrole,mname) <- (getRole &&& getName) <$> userState let uname = fromMaybe "???" mname case mrole of Nothing -> return $ LogMessage "The user is not logged in" -- Impossible Just role -> do now <- liftIO $ getCurrentTime return $ SubmissionComment sk Comment { comment = commentText , commentAuthor = uname , commentDate = now , commentType = roleToCommentType role }) (\result -> do key <- getEvKeyParameter let e = C.Evaluation { evaluationResult = result , writtenEvaluation = commentText } return $ evCommand key e) where roleToCommentType = roleCata CT_Student CT_GroupAdmin CT_CourseAdmin CT_Admin getRole = userStateCata Nothing Nothing Nothing (\_username _uid _page _name role _token _timezone _status -> Just role) getName = userStateCata Nothing Nothing Nothing (\_username _uid _page name _role _token _timezone _status -> Just name)
1,537
abstractEvaluationPostHandler getEvKeyParameter evCommand = do sk <- getParameter submissionKeyPrm commentText <- getParameter evaluationValuePrm commentOrResult <- getJSONParam (fieldName evaluationResultField) "There can be no evaluation found." withEvalOrComment commentOrResult (do (mrole,mname) <- (getRole &&& getName) <$> userState let uname = fromMaybe "???" mname case mrole of Nothing -> return $ LogMessage "The user is not logged in" -- Impossible Just role -> do now <- liftIO $ getCurrentTime return $ SubmissionComment sk Comment { comment = commentText , commentAuthor = uname , commentDate = now , commentType = roleToCommentType role }) (\result -> do key <- getEvKeyParameter let e = C.Evaluation { evaluationResult = result , writtenEvaluation = commentText } return $ evCommand key e) where roleToCommentType = roleCata CT_Student CT_GroupAdmin CT_CourseAdmin CT_Admin getRole = userStateCata Nothing Nothing Nothing (\_username _uid _page _name role _token _timezone _status -> Just role) getName = userStateCata Nothing Nothing Nothing (\_username _uid _page name _role _token _timezone _status -> Just name)
1,418
false
true
3
20
458
382
179
203
null
null
ocean0yohsuke/Scheme
src/Scheme/Evaluator/Micro.hs
bsd-3-clause
evalCar c@(CELL _ NIL _) = throwEvalError $ WRONGTypeArg $ show (cell (sym "car") c)
84
evalCar c@(CELL _ NIL _) = throwEvalError $ WRONGTypeArg $ show (cell (sym "car") c)
84
evalCar c@(CELL _ NIL _) = throwEvalError $ WRONGTypeArg $ show (cell (sym "car") c)
84
false
false
1
10
14
52
23
29
null
null
judah/tensorflow-haskell
tensorflow-ops/tests/OpsTest.hs
apache-2.0
testSaveRestore :: Test testSaveRestore = testCase "testSaveRestore" $ withSystemTempDirectory "" $ \dirPath -> do let path = B8.pack $ dirPath ++ "/checkpoint" var :: TF.MonadBuild m => m (TF.Tensor TF.Ref Float) var = TF.zeroInitializedVariable' (TF.opName .~ "a") (TF.Shape []) TF.runSession $ do v <- var TF.assign v 134 >>= TF.run_ TF.save path [v] >>= TF.run_ result <- TF.runSession $ do v <- var TF.restore path v >>= TF.run_ TF.run v liftIO $ TF.Scalar 134 @=? result -- | Test that 'placeholder' is not CSE'd.
692
testSaveRestore :: Test testSaveRestore = testCase "testSaveRestore" $ withSystemTempDirectory "" $ \dirPath -> do let path = B8.pack $ dirPath ++ "/checkpoint" var :: TF.MonadBuild m => m (TF.Tensor TF.Ref Float) var = TF.zeroInitializedVariable' (TF.opName .~ "a") (TF.Shape []) TF.runSession $ do v <- var TF.assign v 134 >>= TF.run_ TF.save path [v] >>= TF.run_ result <- TF.runSession $ do v <- var TF.restore path v >>= TF.run_ TF.run v liftIO $ TF.Scalar 134 @=? result -- | Test that 'placeholder' is not CSE'd.
692
testSaveRestore = testCase "testSaveRestore" $ withSystemTempDirectory "" $ \dirPath -> do let path = B8.pack $ dirPath ++ "/checkpoint" var :: TF.MonadBuild m => m (TF.Tensor TF.Ref Float) var = TF.zeroInitializedVariable' (TF.opName .~ "a") (TF.Shape []) TF.runSession $ do v <- var TF.assign v 134 >>= TF.run_ TF.save path [v] >>= TF.run_ result <- TF.runSession $ do v <- var TF.restore path v >>= TF.run_ TF.run v liftIO $ TF.Scalar 134 @=? result -- | Test that 'placeholder' is not CSE'd.
668
false
true
0
16
256
228
105
123
null
null
michael-sloma/panRNA
src/PanRNA.hs
gpl-2.0
dotSeqTag :: P.Parsec String () Tag dotSeqTag = do P.manyTill P.anyChar (P.char ';') >> eol t <- P.manyTill P.anyChar eol return $ Tag t
166
dotSeqTag :: P.Parsec String () Tag dotSeqTag = do P.manyTill P.anyChar (P.char ';') >> eol t <- P.manyTill P.anyChar eol return $ Tag t
166
dotSeqTag = do P.manyTill P.anyChar (P.char ';') >> eol t <- P.manyTill P.anyChar eol return $ Tag t
130
false
true
0
11
53
72
33
39
null
null
wouwouwou/2017_module_8
src/haskell/PP-project-2016/ASTBuilder.hs
apache-2.0
astToRoseDebug (ASTWhile ast1 ast2 (f,g,v)) = RoseNode ("while" ++ " -> " {-++ (show f) ++ (show g)-} ++ (show (getDeepestScope v))) $ map astToRoseDebug [ast1, ast2]
170
astToRoseDebug (ASTWhile ast1 ast2 (f,g,v)) = RoseNode ("while" ++ " -> " {-++ (show f) ++ (show g)-} ++ (show (getDeepestScope v))) $ map astToRoseDebug [ast1, ast2]
170
astToRoseDebug (ASTWhile ast1 ast2 (f,g,v)) = RoseNode ("while" ++ " -> " {-++ (show f) ++ (show g)-} ++ (show (getDeepestScope v))) $ map astToRoseDebug [ast1, ast2]
170
false
false
0
11
30
71
37
34
null
null
nyorem/skemmtun
src/MAL/Command/Execute.hs
mit
executeCommand creds (SetReadVolumes n name) = update creds name mangaList _mangaName _mangaId "Manga" $ changeReadVolumes n
128
executeCommand creds (SetReadVolumes n name) = update creds name mangaList _mangaName _mangaId "Manga" $ changeReadVolumes n
128
executeCommand creds (SetReadVolumes n name) = update creds name mangaList _mangaName _mangaId "Manga" $ changeReadVolumes n
128
false
false
0
7
19
42
18
24
null
null
wavewave/gnuplot
src/Graphics/Gnuplot/Private/Graph2DType.hs
bsd-3-clause
listLinesPoints = Cons "linespoints"
36
listLinesPoints = Cons "linespoints"
36
listLinesPoints = Cons "linespoints"
36
false
false
0
5
3
9
4
5
null
null
DavidAlphaFox/ghc
libraries/Cabal/Cabal/Distribution/Simple/Test/Log.hs
bsd-3-clause
resultString :: TestLogs -> String resultString l | suiteError l = "error" | suiteFailed l = "fail" | otherwise = "pass"
150
resultString :: TestLogs -> String resultString l | suiteError l = "error" | suiteFailed l = "fail" | otherwise = "pass"
150
resultString l | suiteError l = "error" | suiteFailed l = "fail" | otherwise = "pass"
115
false
true
0
8
50
58
24
34
null
null
cchalmers/dense
src/Data/Dense/Generic.hs
bsd-3-clause
------------------------------------------------------------------------ -- Bundles ------------------------------------------------------------------------ -- | Generate a bundle from 'Layout' indices. bundleGenerate :: (Monad m, Shape f) => Layout f -> (f Int -> a) -> MBundle m v a bundleGenerate l f = bundleGenerateM l (return . f)
337
bundleGenerate :: (Monad m, Shape f) => Layout f -> (f Int -> a) -> MBundle m v a bundleGenerate l f = bundleGenerateM l (return . f)
133
bundleGenerate l f = bundleGenerateM l (return . f)
51
true
true
0
11
40
79
40
39
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/course/2013-11-coursera-fp-odersky-but-in-haskell/FP03ObjSetsTweetSetTest.hs
unlicense
five = incl one (Tweet "5" "5" 5)
38
five = incl one (Tweet "5" "5" 5)
38
five = incl one (Tweet "5" "5" 5)
38
false
false
0
7
12
21
10
11
null
null
mtlstats/mtlstats
src/Mtlstats/Prompt.hs
gpl-3.0
-- | Prompts for a database name dbNamePrompt :: String -- ^ The prompt string -> (String -> Action ()) -- ^ The callback to pass the result to -> Prompt dbNamePrompt pStr act = (strPrompt pStr act) { promptProcessChar = \ch -> if isAlphaNum ch || ch == '-' then (++[toUpper ch]) else id }
311
dbNamePrompt :: String -- ^ The prompt string -> (String -> Action ()) -- ^ The callback to pass the result to -> Prompt dbNamePrompt pStr act = (strPrompt pStr act) { promptProcessChar = \ch -> if isAlphaNum ch || ch == '-' then (++[toUpper ch]) else id }
278
dbNamePrompt pStr act = (strPrompt pStr act) { promptProcessChar = \ch -> if isAlphaNum ch || ch == '-' then (++[toUpper ch]) else id }
147
true
true
0
12
77
98
51
47
null
null
dpieroux/euler
0/0082.hs
mit
main = do src <- readFile "z:/euler/euler_0083.dat" -- same file as problem 83 let rows = map (\r -> (read ("[" ++ r ++ "]"))::[Int]) $ lines src let i1 = length rows let j1 = length (head rows) let cost = listArray ((1, 1), (i1, j1)) $ concat rows putStrLn $ "test: " ++ show (euler sampleCost) putStrLn $ "actual: " ++ show (euler cost)
368
main = do src <- readFile "z:/euler/euler_0083.dat" -- same file as problem 83 let rows = map (\r -> (read ("[" ++ r ++ "]"))::[Int]) $ lines src let i1 = length rows let j1 = length (head rows) let cost = listArray ((1, 1), (i1, j1)) $ concat rows putStrLn $ "test: " ++ show (euler sampleCost) putStrLn $ "actual: " ++ show (euler cost)
368
main = do src <- readFile "z:/euler/euler_0083.dat" -- same file as problem 83 let rows = map (\r -> (read ("[" ++ r ++ "]"))::[Int]) $ lines src let i1 = length rows let j1 = length (head rows) let cost = listArray ((1, 1), (i1, j1)) $ concat rows putStrLn $ "test: " ++ show (euler sampleCost) putStrLn $ "actual: " ++ show (euler cost)
368
false
false
1
19
95
178
85
93
null
null
toish/panda
src/KeyGen.hs
gpl-3.0
commonKey :: Key -> Integer -> Result commonKey (Key 0 (GenData 0 0 )) _ = Fail
79
commonKey :: Key -> Integer -> Result commonKey (Key 0 (GenData 0 0 )) _ = Fail
79
commonKey (Key 0 (GenData 0 0 )) _ = Fail
41
false
true
0
9
16
40
20
20
null
null
karamellpelle/grid
source/Game/Values/Fancy.hs
gpl-3.0
-- | (relative to Scene hth) valueTextFontBSize :: Float valueTextFontBSize = 0.06
86
valueTextFontBSize :: Float valueTextFontBSize = 0.06
57
valueTextFontBSize = 0.06
29
true
true
0
4
15
12
7
5
null
null
sixears/text-block
src/Text/Block.hs
mit
hpads :: HAlign -- ^ horizontal string alignment -> Int -- ^ pad to this width (no-op if < length input string) -> String -- ^ string to pad -> String hpads HLeft n s = s ++ replicate (n - length s) ' '
225
hpads :: HAlign -- ^ horizontal string alignment -> Int -- ^ pad to this width (no-op if < length input string) -> String -- ^ string to pad -> String hpads HLeft n s = s ++ replicate (n - length s) ' '
225
hpads HLeft n s = s ++ replicate (n - length s) ' '
53
false
true
0
9
67
52
27
25
null
null
ahushh/Monaba
monaba/src/Handler/Admin/Hellban.hs
mit
getHellBanGetFormR :: Int -> Handler Html getHellBanGetFormR postId = do let postKey = (toSqlKey $ fromIntegral postId) :: Key Post post <- runDB $ get404 postKey let posterId = postPosterId post posterIp = postIp post bannedUID <- runDB $ selectFirst [HellbanUid ==. posterId] [] bannedIP <- runDB $ selectFirst [HellbanIp ==. posterIp] [] (form, enc) <- generateFormPost hellbanForm bareLayout [whamlet|<form id="hb-form-#{postId}" .hellban-form enctype=#{enc} action="@{HellBanActionR postId}" method=post> ^{form} $if isJust bannedUID || isJust bannedIP _{MsgHellbanUserIsBanned}: $maybe _ <- bannedUID UID $maybe _ <- bannedIP IP |]
863
getHellBanGetFormR :: Int -> Handler Html getHellBanGetFormR postId = do let postKey = (toSqlKey $ fromIntegral postId) :: Key Post post <- runDB $ get404 postKey let posterId = postPosterId post posterIp = postIp post bannedUID <- runDB $ selectFirst [HellbanUid ==. posterId] [] bannedIP <- runDB $ selectFirst [HellbanIp ==. posterIp] [] (form, enc) <- generateFormPost hellbanForm bareLayout [whamlet|<form id="hb-form-#{postId}" .hellban-form enctype=#{enc} action="@{HellBanActionR postId}" method=post> ^{form} $if isJust bannedUID || isJust bannedIP _{MsgHellbanUserIsBanned}: $maybe _ <- bannedUID UID $maybe _ <- bannedIP IP |]
863
getHellBanGetFormR postId = do let postKey = (toSqlKey $ fromIntegral postId) :: Key Post post <- runDB $ get404 postKey let posterId = postPosterId post posterIp = postIp post bannedUID <- runDB $ selectFirst [HellbanUid ==. posterId] [] bannedIP <- runDB $ selectFirst [HellbanIp ==. posterIp] [] (form, enc) <- generateFormPost hellbanForm bareLayout [whamlet|<form id="hb-form-#{postId}" .hellban-form enctype=#{enc} action="@{HellBanActionR postId}" method=post> ^{form} $if isJust bannedUID || isJust bannedIP _{MsgHellbanUserIsBanned}: $maybe _ <- bannedUID UID $maybe _ <- bannedIP IP |]
821
false
true
0
12
310
156
75
81
null
null