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
mrd/camfort
src/Camfort/Specification/Units/InferenceFrontend.hs
apache-2.0
binOpKind F.Exponentiation = PowerOp
38
binOpKind F.Exponentiation = PowerOp
38
binOpKind F.Exponentiation = PowerOp
38
false
false
0
6
5
11
5
6
null
null
armoredsoftware/protocol
tpm/mainline/src/TPM/Const.hs
bsd-3-clause
tpm_rt_counter = (0x00000006 :: Word32)
39
tpm_rt_counter = (0x00000006 :: Word32)
39
tpm_rt_counter = (0x00000006 :: Word32)
39
false
false
0
5
4
12
7
5
null
null
mettekou/ghc
compiler/basicTypes/MkId.hs
bsd-3-clause
unitBoxer :: Boxer unitBoxer = UnitBox
38
unitBoxer :: Boxer unitBoxer = UnitBox
38
unitBoxer = UnitBox
19
false
true
0
6
5
18
7
11
null
null
glutamate/cmdtheline
src/System/Console/CmdTheLine/Term.hs
mit
fromFail :: Fail -> EvalExit fromFail (MsgFail d) = Msg d
69
fromFail :: Fail -> EvalExit fromFail (MsgFail d) = Msg d
69
fromFail (MsgFail d) = Msg d
40
false
true
0
7
22
27
13
14
null
null
gokhankici/symmetry
checker/src/Symmetry/IL/Subst.hs
mit
unify :: MConstr -> MConstr -> Maybe Subst unify (MCaseL x c) (MCaseL l c') = joinSubst <$> s <*> unify c c' where s = unifyLabel x l
140
unify :: MConstr -> MConstr -> Maybe Subst unify (MCaseL x c) (MCaseL l c') = joinSubst <$> s <*> unify c c' where s = unifyLabel x l
139
unify (MCaseL x c) (MCaseL l c') = joinSubst <$> s <*> unify c c' where s = unifyLabel x l
96
false
true
0
7
35
69
33
36
null
null
flowbox-public/hint
src/Hint/Compat.hs
bsd-3-clause
parseDynamicFlags :: GHC.GhcMonad m => GHC.DynFlags -> [String] -> m (GHC.DynFlags, [String]) parseDynamicFlags d = fmap firstTwo . GHC.parseDynamicFlags d . map GHC.noLoc where firstTwo (a,b,_) = (a, map GHC.unLoc b)
240
parseDynamicFlags :: GHC.GhcMonad m => GHC.DynFlags -> [String] -> m (GHC.DynFlags, [String]) parseDynamicFlags d = fmap firstTwo . GHC.parseDynamicFlags d . map GHC.noLoc where firstTwo (a,b,_) = (a, map GHC.unLoc b)
240
parseDynamicFlags d = fmap firstTwo . GHC.parseDynamicFlags d . map GHC.noLoc where firstTwo (a,b,_) = (a, map GHC.unLoc b)
127
false
true
0
10
53
103
53
50
null
null
WraithM/fingmodules
src/Language/Lambda/Lexer.hs
bsd-3-clause
commaSep = P.commaSep lexer
29
commaSep = P.commaSep lexer
29
commaSep = P.commaSep lexer
29
false
false
1
6
5
14
5
9
null
null
coghex/abridgefaraway
src/ABFA/Rand.hs
bsd-3-clause
randomList :: (Random a) => (a,a) -> Int -> StdGen -> [a] randomList bnds n = do take n . randomRs bnds
105
randomList :: (Random a) => (a,a) -> Int -> StdGen -> [a] randomList bnds n = do take n . randomRs bnds
105
randomList bnds n = do take n . randomRs bnds
47
false
true
0
11
23
65
31
34
null
null
JanGe/irc-dcc
src/Network/Socket/ByteString/Extended.hs
mit
connect :: MonadIO m => ConnectionType m -> m Socket connect (Active ip port onListen) = do sock <- liftIO $ connectTo ip port onListen liftIO $ waitForConnection ip sock
182
connect :: MonadIO m => ConnectionType m -> m Socket connect (Active ip port onListen) = do sock <- liftIO $ connectTo ip port onListen liftIO $ waitForConnection ip sock
182
connect (Active ip port onListen) = do sock <- liftIO $ connectTo ip port onListen liftIO $ waitForConnection ip sock
129
false
true
0
9
41
72
32
40
null
null
AndrewRademacher/stack
src/Stack/Setup.hs
bsd-3-clause
getInstalledGhcjs :: [Tool] -> (CompilerVersion -> Bool) -> Maybe Tool getInstalledGhcjs installed goodVersion = if null available then Nothing else Just $ ToolGhcjs $ maximum available where available = mapMaybe goodPackage installed goodPackage (ToolGh...
401
getInstalledGhcjs :: [Tool] -> (CompilerVersion -> Bool) -> Maybe Tool getInstalledGhcjs installed goodVersion = if null available then Nothing else Just $ ToolGhcjs $ maximum available where available = mapMaybe goodPackage installed goodPackage (ToolGh...
401
getInstalledGhcjs installed goodVersion = if null available then Nothing else Just $ ToolGhcjs $ maximum available where available = mapMaybe goodPackage installed goodPackage (ToolGhcjs cv) = if goodVersion cv then Just cv else Nothing goodPackage _ = Nothing
294
false
true
2
8
117
109
54
55
null
null
ciderpunx/57-exercises-for-programmers
test/P50MovieSpec.hs
gpl-3.0
spec :: Spec spec = it "Won't be implemented" $ pendingWith "Due to RottenTomatoes being dicks about their API"
121
spec :: Spec spec = it "Won't be implemented" $ pendingWith "Due to RottenTomatoes being dicks about their API"
121
spec = it "Won't be implemented" $ pendingWith "Due to RottenTomatoes being dicks about their API"
108
false
true
0
6
28
21
10
11
null
null
haskellbr/missingh
missingh-all/src/Network/SocketServer.hs
mit
handleHandler :: (Handle -> SockAddr -> SockAddr -> IO ()) -- ^ Handler to call -> HandlerT handleHandler func socket r_sockaddr l_sockaddr = do h <- socketToHandle socket ReadWriteMode hSetBuffering h LineBuffering func h r_sockaddr l_sockaddr hClose h
298
handleHandler :: (Handle -> SockAddr -> SockAddr -> IO ()) -- ^ Handler to call -> HandlerT handleHandler func socket r_sockaddr l_sockaddr = do h <- socketToHandle socket ReadWriteMode hSetBuffering h LineBuffering func h r_sockaddr l_sockaddr hClose h
298
handleHandler func socket r_sockaddr l_sockaddr = do h <- socketToHandle socket ReadWriteMode hSetBuffering h LineBuffering func h r_sockaddr l_sockaddr hClose h
187
false
true
0
11
82
81
37
44
null
null
mvr/cf
src/Math/ContinuedFraction/Interval.hs
mit
mergeInterval (Interval (Finite i1) (Finite s1) True) (Interval Infinity (Finite s2) _) = Interval Infinity (Finite $ max s1 s2) True
135
mergeInterval (Interval (Finite i1) (Finite s1) True) (Interval Infinity (Finite s2) _) = Interval Infinity (Finite $ max s1 s2) True
135
mergeInterval (Interval (Finite i1) (Finite s1) True) (Interval Infinity (Finite s2) _) = Interval Infinity (Finite $ max s1 s2) True
135
false
false
0
9
22
68
33
35
null
null
brendanhay/gogol
gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer/Types/Product.hs
mpl-2.0
-- | Optional access type for this buyer. ppbAuctionTier :: Lens' PricePerBuyer (Maybe Text) ppbAuctionTier = lens _ppbAuctionTier (\ s a -> s{_ppbAuctionTier = a})
172
ppbAuctionTier :: Lens' PricePerBuyer (Maybe Text) ppbAuctionTier = lens _ppbAuctionTier (\ s a -> s{_ppbAuctionTier = a})
130
ppbAuctionTier = lens _ppbAuctionTier (\ s a -> s{_ppbAuctionTier = a})
79
true
true
1
9
32
52
25
27
null
null
ezyang/ghc
libraries/template-haskell/Language/Haskell/TH/Lib.hs
bsd-3-clause
tyVarSig :: TyVarBndr -> FamilyResultSig tyVarSig = TyVarSig
60
tyVarSig :: TyVarBndr -> FamilyResultSig tyVarSig = TyVarSig
60
tyVarSig = TyVarSig
19
false
true
0
7
7
22
9
13
null
null
farnoy/torrent
test/PeerMonadSpec.hs
bsd-3-clause
evalPeerMonadTest (GetTime next) = do pState <- get let t = peerStateCurrentTime pState put $ pState { peerStateCurrentTime = addUTCTime 1 t } next t
157
evalPeerMonadTest (GetTime next) = do pState <- get let t = peerStateCurrentTime pState put $ pState { peerStateCurrentTime = addUTCTime 1 t } next t
157
evalPeerMonadTest (GetTime next) = do pState <- get let t = peerStateCurrentTime pState put $ pState { peerStateCurrentTime = addUTCTime 1 t } next t
157
false
false
0
10
32
60
27
33
null
null
hdb3/FP-Router
ControlMessage.hs
apache-2.0
openControlChan :: ControlChan -> IO ControlChan openControlChan (ControlChan sc rc) = return $ ControlChan rc sc
113
openControlChan :: ControlChan -> IO ControlChan openControlChan (ControlChan sc rc) = return $ ControlChan rc sc
113
openControlChan (ControlChan sc rc) = return $ ControlChan rc sc
64
false
true
0
6
15
42
19
23
null
null
vikraman/ghc-mod
Language/Haskell/GhcMod/Info.hs
bsd-3-clause
listifyStaged :: Typeable r => Stage -> (r -> Bool) -> GenericQ [r] listifyStaged s p = everythingStaged s (++) [] ([] `mkQ` (\x -> [x | p x]))
143
listifyStaged :: Typeable r => Stage -> (r -> Bool) -> GenericQ [r] listifyStaged s p = everythingStaged s (++) [] ([] `mkQ` (\x -> [x | p x]))
143
listifyStaged s p = everythingStaged s (++) [] ([] `mkQ` (\x -> [x | p x]))
75
false
true
0
12
28
90
47
43
null
null
spechub/Hets
GUI/GraphMenu.hs
gpl-2.0
createMenuButtonProveStructured :: GInfo -> ButtonMenu GA.NodeValue createMenuButtonProveStructured gi = createMenuButton "Prove VSE Structured" (\ descr _ -> proofMenu gi (SelectCmd Prover $ "VSE structured: " ++ show descr) $ VSE.prove (libName gi, descr)) gi
281
createMenuButtonProveStructured :: GInfo -> ButtonMenu GA.NodeValue createMenuButtonProveStructured gi = createMenuButton "Prove VSE Structured" (\ descr _ -> proofMenu gi (SelectCmd Prover $ "VSE structured: " ++ show descr) $ VSE.prove (libName gi, descr)) gi
281
createMenuButtonProveStructured gi = createMenuButton "Prove VSE Structured" (\ descr _ -> proofMenu gi (SelectCmd Prover $ "VSE structured: " ++ show descr) $ VSE.prove (libName gi, descr)) gi
213
false
true
0
13
53
80
39
41
null
null
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Prompt/Directory.hs
bsd-2-clause
notboring ('.':_) = False
25
notboring ('.':_) = False
25
notboring ('.':_) = False
25
false
false
0
7
3
16
8
8
null
null
mietek/stack
src/Stack/Config.hs
bsd-3-clause
-- | Load the configuration, using current directory, environment variables, -- and defaults as necessary. loadConfig :: (MonadLogger m,MonadIO m,MonadCatch m,MonadReader env m,HasHttpManager env,MonadBaseControl IO m) => ConfigMonoid -- ^ Config monoid from parsed command-line arguments ...
1,071
loadConfig :: (MonadLogger m,MonadIO m,MonadCatch m,MonadReader env m,HasHttpManager env,MonadBaseControl IO m) => ConfigMonoid -- ^ Config monoid from parsed command-line arguments -> m (LoadConfig m) loadConfig configArgs = do stackRoot <- determineStackRoot extraConfigs <- ge...
964
loadConfig configArgs = do stackRoot <- determineStackRoot extraConfigs <- getExtraConfigs stackRoot >>= mapM loadYaml mproject <- loadProjectConfig config <- configFromConfigMonoid stackRoot (fmap (\(proj, _, _) -> proj) mproject) $ mconcat $ case mproject of Nothing -> configArgs :...
729
true
true
0
15
260
248
130
118
null
null
vdweegen/UvA-Software_Testing
Lab6/Jordan/Lecture6.hs
gpl-3.0
primes :: [Integer] primes = 2 : filter prime [3..]
51
primes :: [Integer] primes = 2 : filter prime [3..]
51
primes = 2 : filter prime [3..]
31
false
true
0
7
9
26
14
12
null
null
mattrrichard/darwin
src/GlossIndividual.hs
bsd-3-clause
renderToImage :: RenderState c -> GLS.Picture -> IO (Image PixelRGBA8) renderToImage renderState pic = do let (w, h) = renderState ^. sourceImg . to imageSize let (w', h') = (toEnum w, toEnum h) let fbo = renderState ^. multisampledFbo let imageBuffer = renderState ^. imageFbo let bottomLeft = GL.Position 0...
1,321
renderToImage :: RenderState c -> GLS.Picture -> IO (Image PixelRGBA8) renderToImage renderState pic = do let (w, h) = renderState ^. sourceImg . to imageSize let (w', h') = (toEnum w, toEnum h) let fbo = renderState ^. multisampledFbo let imageBuffer = renderState ^. imageFbo let bottomLeft = GL.Position 0...
1,321
renderToImage renderState pic = do let (w, h) = renderState ^. sourceImg . to imageSize let (w', h') = (toEnum w, toEnum h) let fbo = renderState ^. multisampledFbo let imageBuffer = renderState ^. imageFbo let bottomLeft = GL.Position 0 0 let size = GL.Size w' h' let topRight = GL.Position w' h' -- ...
1,250
false
true
0
15
235
375
178
197
null
null
SaneApp/digital-ocean-api
src/Network/DigitalOcean.hs
mit
addDomainRecord :: DomainId -> NewRecord -> DigitalOcean (Response DomainRecord) addDomainRecord domainId newRecord = do credentials <- creds get [uri| /domains/{domainId}/records/new{?newRecord*, credentials*} |] ---- /domains/{domainId}/records/{recordId}
262
addDomainRecord :: DomainId -> NewRecord -> DigitalOcean (Response DomainRecord) addDomainRecord domainId newRecord = do credentials <- creds get [uri| /domains/{domainId}/records/new{?newRecord*, credentials*} |] ---- /domains/{domainId}/records/{recordId}
262
addDomainRecord domainId newRecord = do credentials <- creds get [uri| /domains/{domainId}/records/new{?newRecord*, credentials*} |] ---- /domains/{domainId}/records/{recordId}
181
false
true
0
9
28
51
26
25
null
null
alexvong1995/pandoc
src/Text/Pandoc/Readers/Org.hs
gpl-2.0
-- | The maximum number of newlines within emphasisAllowedNewlines :: Int emphasisAllowedNewlines = 1
101
emphasisAllowedNewlines :: Int emphasisAllowedNewlines = 1
58
emphasisAllowedNewlines = 1
27
true
true
0
4
13
12
7
5
null
null
plaimi/tempuhs-server
test/Tempuhs/Tests/Requests/Timespan.hs
agpl-3.0
getSpec :: Spec getSpec = describe "GET /timespans" $ do it "initially returns []" $ get "/timespans" >>= assertJSONOK () it "initially returns [] for an existing clock" $ do initClock get "/timespans?clock=TT&begin=0&end=0" >>= assertJSONOK () it "returns all timespans that touch or int...
3,930
getSpec :: Spec getSpec = describe "GET /timespans" $ do it "initially returns []" $ get "/timespans" >>= assertJSONOK () it "initially returns [] for an existing clock" $ do initClock get "/timespans?clock=TT&begin=0&end=0" >>= assertJSONOK () it "returns all timespans that touch or int...
3,930
getSpec = describe "GET /timespans" $ do it "initially returns []" $ get "/timespans" >>= assertJSONOK () it "initially returns [] for an existing clock" $ do initClock get "/timespans?clock=TT&begin=0&end=0" >>= assertJSONOK () it "returns all timespans that touch or intersect the view"...
3,914
false
true
0
21
1,259
1,359
695
664
null
null
MedeaMelana/JsonGrammar2
src/Language/JsonGrammar.hs
bsd-3-clause
-- | Serialize a Haskell value to a JSON value according to the specified grammar. serialize :: Grammar 'Val (a :- ()) (b :- ()) -> b -> Maybe a serialize = serializeValue . unstack
181
serialize :: Grammar 'Val (a :- ()) (b :- ()) -> b -> Maybe a serialize = serializeValue . unstack
98
serialize = serializeValue . unstack
36
true
true
0
9
34
54
28
26
null
null
FranklinChen/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
declared (PSyntax _ _) = []
27
declared (PSyntax _ _) = []
27
declared (PSyntax _ _) = []
27
false
false
0
7
5
19
9
10
null
null
amccausl/Swish
Swish/HaskellUtils/Network/URI.hs
lgpl-2.1
parseAll :: UriParser a -> String -> String -> Either ParseError a parseAll parser filename uristr = parse newparser filename uristr where newparser = do { res <- parser ; eof ; return res } ----------------------------------------------...
500
parseAll :: UriParser a -> String -> String -> Either ParseError a parseAll parser filename uristr = parse newparser filename uristr where newparser = do { res <- parser ; eof ; return res } -----------------------------------------------...
499
parseAll parser filename uristr = parse newparser filename uristr where newparser = do { res <- parser ; eof ; return res } ------------------------------------------------------------ -- URI parser body based on Parsec elements and com...
432
false
true
0
8
144
78
40
38
null
null
IreneKnapp/direct-sqlite
test/Main.hs
mit
testColumnName :: TestEnv -> Test testColumnName TestEnv{..} = TestCase $ do withConn $ \conn -> do exec conn "CREATE TABLE foo (id INTEGER PRIMARY KEY, abc TEXT, \"123\" REAL, über INT)" exec conn "INSERT INTO foo (abc, \"123\", über) VALUES ('hello', 3.14, 456)" withStmt conn "SELECT id AS id, abc AS x...
1,687
testColumnName :: TestEnv -> Test testColumnName TestEnv{..} = TestCase $ do withConn $ \conn -> do exec conn "CREATE TABLE foo (id INTEGER PRIMARY KEY, abc TEXT, \"123\" REAL, über INT)" exec conn "INSERT INTO foo (abc, \"123\", über) VALUES ('hello', 3.14, 456)" withStmt conn "SELECT id AS id, abc AS x...
1,687
testColumnName TestEnv{..} = TestCase $ do withConn $ \conn -> do exec conn "CREATE TABLE foo (id INTEGER PRIMARY KEY, abc TEXT, \"123\" REAL, über INT)" exec conn "INSERT INTO foo (abc, \"123\", über) VALUES ('hello', 3.14, 456)" withStmt conn "SELECT id AS id, abc AS x, \"123\" AS y, über AS ü FROM foo...
1,653
false
true
37
7
554
358
192
166
null
null
nushio3/ghc
compiler/typecheck/TcClassDcl.hs
bsd-3-clause
warningMinimalDefIncomplete :: ClassMinimalDef -> SDoc warningMinimalDefIncomplete mindef = vcat [ text "The MINIMAL pragma does not require:" , nest 2 (pprBooleanFormulaNice mindef) , text "but there is no default implementation." ]
253
warningMinimalDefIncomplete :: ClassMinimalDef -> SDoc warningMinimalDefIncomplete mindef = vcat [ text "The MINIMAL pragma does not require:" , nest 2 (pprBooleanFormulaNice mindef) , text "but there is no default implementation." ]
253
warningMinimalDefIncomplete mindef = vcat [ text "The MINIMAL pragma does not require:" , nest 2 (pprBooleanFormulaNice mindef) , text "but there is no default implementation." ]
198
false
true
0
9
50
53
24
29
null
null
bergey/STL
src/Graphics/Formats/STL/Printer.hs
bsd-3-clause
triangle :: Triangle -> Builder triangle (Triangle n (a, b, c)) = vcat $ stringUtf8 "facet normal " <> maybeNormal n : map (indent 4) [ stringUtf8 "outer loop" , indent 4 $ vertex a , indent 4 $ vertex b , indent 4 $ vertex ...
436
triangle :: Triangle -> Builder triangle (Triangle n (a, b, c)) = vcat $ stringUtf8 "facet normal " <> maybeNormal n : map (indent 4) [ stringUtf8 "outer loop" , indent 4 $ vertex a , indent 4 $ vertex b , indent 4 $ vertex ...
436
triangle (Triangle n (a, b, c)) = vcat $ stringUtf8 "facet normal " <> maybeNormal n : map (indent 4) [ stringUtf8 "outer loop" , indent 4 $ vertex a , indent 4 $ vertex b , indent 4 $ vertex c , s...
404
false
true
4
8
212
133
62
71
null
null
kawu/ltag
src/NLP/LTAG/Early4/Test3.hs
bsd-2-clause
testGram :: [String] -> IO () testGram sent = do void $ earley gram sent -- mapM_ print $ S.toList gram where gram = S.fromList $ snd $ runRM $ do mapM_ (treeRules True) [alpha] mapM_ (auxRules True) [beta1, beta2]
244
testGram :: [String] -> IO () testGram sent = do void $ earley gram sent -- mapM_ print $ S.toList gram where gram = S.fromList $ snd $ runRM $ do mapM_ (treeRules True) [alpha] mapM_ (auxRules True) [beta1, beta2]
244
testGram sent = do void $ earley gram sent -- mapM_ print $ S.toList gram where gram = S.fromList $ snd $ runRM $ do mapM_ (treeRules True) [alpha] mapM_ (auxRules True) [beta1, beta2]
214
false
true
5
11
69
108
49
59
null
null
esmolanka/haddock
haddock-api/src/Haddock/Utils.hs
bsd-2-clause
framesFile = "frames.html"
26
framesFile = "frames.html"
26
framesFile = "frames.html"
26
false
false
0
4
2
6
3
3
null
null
seereason/ghcjs
src/Gen2/RtsApply.hs
mit
pap :: DynFlags -> CgSettings -> Int -> JStat pap _dflags s r = [j| `decl func`; `iex func` = `JFunc [] body`; `ClosureInfo funcName CIRegsUnknown funcName (CILayoutUnknown (r+2)) CIPap noStatic`; |] where funcName = T.pack ("h$pap_" ++ show r) func ...
1,227
pap :: DynFlags -> CgSettings -> Int -> JStat pap _dflags s r = [j| `decl func`; `iex func` = `JFunc [] body`; `ClosureInfo funcName CIRegsUnknown funcName (CILayoutUnknown (r+2)) CIPap noStatic`; |] where funcName = T.pack ("h$pap_" ++ show r) func ...
1,227
pap _dflags s r = [j| `decl func`; `iex func` = `JFunc [] body`; `ClosureInfo funcName CIRegsUnknown funcName (CILayoutUnknown (r+2)) CIPap noStatic`; |] where funcName = T.pack ("h$pap_" ++ show r) func = TxtI funcName body = [j| var c = `R1`.d1; // the...
1,169
false
true
0
12
446
220
119
101
null
null
patperry/hs-linear-algebra
lib/Numeric/LinearAlgebra/Matrix/STBase.hs
bsd-3-clause
unsafeAddWithScaleM_ :: (RMatrix m, BLAS1 e) => e -> m e -> STMatrix s e -> ST s () unsafeAddWithScaleM_ alpha x y = fromMaybe colwise $ maybeWithVector x $ \vx -> fromMaybe colwise $ maybeWithVectorM y $ \vy -> V.unsafeAddWithScaleM_ alpha vx vy where colwise = withCols x ...
581
unsafeAddWithScaleM_ :: (RMatrix m, BLAS1 e) => e -> m e -> STMatrix s e -> ST s () unsafeAddWithScaleM_ alpha x y = fromMaybe colwise $ maybeWithVector x $ \vx -> fromMaybe colwise $ maybeWithVectorM y $ \vy -> V.unsafeAddWithScaleM_ alpha vx vy where colwise = withCols x ...
581
unsafeAddWithScaleM_ alpha x y = fromMaybe colwise $ maybeWithVector x $ \vx -> fromMaybe colwise $ maybeWithVectorM y $ \vy -> V.unsafeAddWithScaleM_ alpha vx vy where colwise = withCols x $ \vxs -> withColsM y $ \vys -> sequence_ [ V.unsafeAddWithScaleM_ alpha ...
476
false
true
0
13
210
175
86
89
null
null
YoshikuniJujo/funpaala
samples/21_adt/hpt.hs
bsd-3-clause
price :: Product -> String price (n, p) = n ++ " is " ++ show p ++ " yen."
74
price :: Product -> String price (n, p) = n ++ " is " ++ show p ++ " yen."
74
price (n, p) = n ++ " is " ++ show p ++ " yen."
47
false
true
4
8
19
47
21
26
null
null
damoxc/ganeti
src/Ganeti/Luxi.hs
gpl-2.0
-- | Specialized submitManyJobs call. submitManyJobs :: Client -> [[MetaOpCode]] -> IO (ErrorResult [JobId]) submitManyJobs s jobs = do rval <- callMethod (SubmitManyJobs jobs) s -- map each result (status, payload) pair into a nice Result ADT return $ case rval of Bad x -> Bad x Ok (JSA...
489
submitManyJobs :: Client -> [[MetaOpCode]] -> IO (ErrorResult [JobId]) submitManyJobs s jobs = do rval <- callMethod (SubmitManyJobs jobs) s -- map each result (status, payload) pair into a nice Result ADT return $ case rval of Bad x -> Bad x Ok (JSArray r) -> mapM parseSubmitJobResult r...
451
submitManyJobs s jobs = do rval <- callMethod (SubmitManyJobs jobs) s -- map each result (status, payload) pair into a nice Result ADT return $ case rval of Bad x -> Bad x Ok (JSArray r) -> mapM parseSubmitJobResult r x -> Bad . LuxiError $ "Cannot parse re...
380
true
true
0
14
137
132
63
69
null
null
jgm/pandoc-citeproc
src/Text/CSL/Pandoc.hs
bsd-3-clause
-- includes [{()}] pLocatorPunct :: Parsec [Inline] st Inline pLocatorPunct = pMatchChar "punctuation" isLocatorPunct
118
pLocatorPunct :: Parsec [Inline] st Inline pLocatorPunct = pMatchChar "punctuation" isLocatorPunct
98
pLocatorPunct = pMatchChar "punctuation" isLocatorPunct
55
true
true
0
6
14
27
14
13
null
null
charleso/intellij-haskforce
tests/gold/parser/Layout00003.hs
apache-2.0
pretty s = myVcat $ (case mbHead of Just h -> h)
70
pretty s = myVcat $ (case mbHead of Just h -> h)
70
pretty s = myVcat $ (case mbHead of Just h -> h)
70
false
false
0
10
33
29
14
15
null
null
jeannekamikaze/Spear
Spear/Window.hs
mit
fromGLFWkey (GLFW.SpecialKey GLFW.UP) = KEY_UP
49
fromGLFWkey (GLFW.SpecialKey GLFW.UP) = KEY_UP
49
fromGLFWkey (GLFW.SpecialKey GLFW.UP) = KEY_UP
49
false
false
0
7
7
20
9
11
null
null
phylake/avm3
vm/store.hs
mit
xform_opCode {- 0xB2 -} i u d s m t (Abc.IsType u30) = [IsType u30 $ m u30]
75
xform_opCode {- 0xB2 -} i u d s m t (Abc.IsType u30) = [IsType u30 $ m u30]
75
xform_opCode {- 0xB2 -} i u d s m t (Abc.IsType u30) = [IsType u30 $ m u30]
75
false
false
0
8
17
43
21
22
null
null
maxikov/megai
haskell_serial/ai.hs
gpl-3.0
optimize_program xs = optimize_program_ xs False
48
optimize_program xs = optimize_program_ xs False
48
optimize_program xs = optimize_program_ xs False
48
false
false
1
5
5
17
6
11
null
null
mitchellwrosen/kerchief
src/Handler/Edit.hs
bsd-3-clause
handleEditWord :: String -> Kerchief () handleEditWord word = getDeck >>= maybe printNoDeckLoadedError handleEditWord' where handleEditWord' :: Deck -> Kerchief () handleEditWord' deck = do let cards = searchDeck word deck if S.null cards then putStrLn "No matching cards found." ...
436
handleEditWord :: String -> Kerchief () handleEditWord word = getDeck >>= maybe printNoDeckLoadedError handleEditWord' where handleEditWord' :: Deck -> Kerchief () handleEditWord' deck = do let cards = searchDeck word deck if S.null cards then putStrLn "No matching cards found." ...
436
handleEditWord word = getDeck >>= maybe printNoDeckLoadedError handleEditWord' where handleEditWord' :: Deck -> Kerchief () handleEditWord' deck = do let cards = searchDeck word deck if S.null cards then putStrLn "No matching cards found." else promptEditCards cards >>=...
396
false
true
0
10
110
114
53
61
null
null
brendanhay/gogol
gogol-appengine/gen/Network/Google/Resource/AppEngine/Apps/Services/Versions/List.hs
mpl-2.0
-- | Part of \`parent\`. Name of the parent Service resource. Example: -- apps\/myapp\/services\/default. asvlAppsId :: Lens' AppsServicesVersionsList Text asvlAppsId = lens _asvlAppsId (\ s a -> s{_asvlAppsId = a})
217
asvlAppsId :: Lens' AppsServicesVersionsList Text asvlAppsId = lens _asvlAppsId (\ s a -> s{_asvlAppsId = a})
111
asvlAppsId = lens _asvlAppsId (\ s a -> s{_asvlAppsId = a})
61
true
true
0
9
31
43
23
20
null
null
garious/hopt
LlvmParser.hs
mit
-- | Parses a global variable globalVar :: Parser String globalVar = BC.unpack <$> (string "@" *> takeWhile1 isAlphaNumOrUnder)
127
globalVar :: Parser String globalVar = BC.unpack <$> (string "@" *> takeWhile1 isAlphaNumOrUnder)
97
globalVar = BC.unpack <$> (string "@" *> takeWhile1 isAlphaNumOrUnder)
70
true
true
0
8
18
34
17
17
null
null
plilja/h99
p46.hs
apache-2.0
or' _ _ = False
15
or' _ _ = False
15
or' _ _ = False
15
false
false
0
5
4
11
5
6
null
null
mightymoose/liquidhaskell
docs/blog/todo/LambdaEval.hs
bsd-3-clause
eval sto (Lam x e) = (sto, Lam x e)
38
eval sto (Lam x e) = (sto, Lam x e)
38
eval sto (Lam x e) = (sto, Lam x e)
38
false
false
0
6
12
32
15
17
null
null
vTurbine/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
word32TyConName = tcQual gHC_WORD (fsLit "Word32") word32TyConKey
68
word32TyConName = tcQual gHC_WORD (fsLit "Word32") word32TyConKey
68
word32TyConName = tcQual gHC_WORD (fsLit "Word32") word32TyConKey
68
false
false
0
7
9
19
9
10
null
null
fmapfmapfmap/amazonka
amazonka-cloudwatch-logs/gen/Network/AWS/CloudWatchLogs/DescribeLogStreams.hs
mpl-2.0
-- | Undocumented member. dlsrsLogStreams :: Lens' DescribeLogStreamsResponse [LogStream] dlsrsLogStreams = lens _dlsrsLogStreams (\ s a -> s{_dlsrsLogStreams = a}) . _Default . _Coerce
185
dlsrsLogStreams :: Lens' DescribeLogStreamsResponse [LogStream] dlsrsLogStreams = lens _dlsrsLogStreams (\ s a -> s{_dlsrsLogStreams = a}) . _Default . _Coerce
159
dlsrsLogStreams = lens _dlsrsLogStreams (\ s a -> s{_dlsrsLogStreams = a}) . _Default . _Coerce
95
true
true
0
11
23
51
28
23
null
null
luispedro/NGH
bin/Utils.hs
mit
{-| exec_action executes an action for every element seen and passes it on -} exec_action :: (Monad m) => (a -> m ()) -> Conduit a m a exec_action act = await >>= maybe (return ()) (\s -> PipeM (act s >> return (yield s >> exec_action act)))
241
exec_action :: (Monad m) => (a -> m ()) -> Conduit a m a exec_action act = await >>= maybe (return ()) (\s -> PipeM (act s >> return (yield s >> exec_action act)))
163
exec_action act = await >>= maybe (return ()) (\s -> PipeM (act s >> return (yield s >> exec_action act)))
106
true
true
0
15
47
101
50
51
null
null
diminishedprime/.org
reading-list/cis194/HW03.hs
mit
histogram :: [Integer] -> String histogram b = let q = map r $ g b l = maximumBy (comparing length) q p b a = if length a < b then p b (a ++ " ") else a in unlines $ reverse $ transpose $ map (p (length l)) q
310
histogram :: [Integer] -> String histogram b = let q = map r $ g b l = maximumBy (comparing length) q p b a = if length a < b then p b (a ++ " ") else a in unlines $ reverse $ transpose $ map (p (length l)) q
310
histogram b = let q = map r $ g b l = maximumBy (comparing length) q p b a = if length a < b then p b (a ++ " ") else a in unlines $ reverse $ transpose $ map (p (length l)) q
277
false
true
0
12
153
124
61
63
null
null
ganeti/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
htKvmValidSmTypes :: FrozenSet String htKvmValidSmTypes = ConstantUtils.mkSet [htSmNone, htSmPool, htSmUser]
108
htKvmValidSmTypes :: FrozenSet String htKvmValidSmTypes = ConstantUtils.mkSet [htSmNone, htSmPool, htSmUser]
108
htKvmValidSmTypes = ConstantUtils.mkSet [htSmNone, htSmPool, htSmUser]
70
false
true
0
6
9
28
15
13
null
null
rekka/stack
src/Stack/Options.hs
bsd-3-clause
-- | Parser for @stack new@. newOptsParser :: Parser (NewOpts,InitOpts) newOptsParser = (,) <$> newOpts <*> initOptsParser where newOpts = NewOpts <$> packageNameArgument (metavar "PACKAGE_NAME" <> help "A valid package name.") <*> templateNameArgument (metavar "TEM...
809
newOptsParser :: Parser (NewOpts,InitOpts) newOptsParser = (,) <$> newOpts <*> initOptsParser where newOpts = NewOpts <$> packageNameArgument (metavar "PACKAGE_NAME" <> help "A valid package name.") <*> templateNameArgument (metavar "TEMPLATE_NAME" <> h...
780
newOptsParser = (,) <$> newOpts <*> initOptsParser where newOpts = NewOpts <$> packageNameArgument (metavar "PACKAGE_NAME" <> help "A valid package name.") <*> templateNameArgument (metavar "TEMPLATE_NAME" <> help "Name of a template, for example: foo o...
737
true
true
8
14
290
175
79
96
null
null
ku-fpg/kansas-amber
System/Hardware/Haskino/Compiler.hs
bsd-3-clause
compileProcedure (IfThenElseBoolW8 e cb1 cb2) = compileIfThenElseEitherProcedure BoolType Word8Type e cb1 cb2
113
compileProcedure (IfThenElseBoolW8 e cb1 cb2) = compileIfThenElseEitherProcedure BoolType Word8Type e cb1 cb2
113
compileProcedure (IfThenElseBoolW8 e cb1 cb2) = compileIfThenElseEitherProcedure BoolType Word8Type e cb1 cb2
113
false
false
0
7
15
30
14
16
null
null
freizl/freizl.github.com-old
src/Hakyll/Web/Tags.hs
bsd-3-clause
getCategory :: MonadMetadata m => Identifier -> m [String] getCategory = return . return . takeBaseName . takeDirectory . toFilePath
132
getCategory :: MonadMetadata m => Identifier -> m [String] getCategory = return . return . takeBaseName . takeDirectory . toFilePath
132
getCategory = return . return . takeBaseName . takeDirectory . toFilePath
73
false
true
2
9
19
52
23
29
null
null
techno-tanoC/brain
src/Brain/Gochiusa.hs
bsd-3-clause
pinc, pdec, vinc, vdec, pout, pinp :: Parser Command pinc = string "ココア" >> return PInc
87
pinc, pdec, vinc, vdec, pout, pinp :: Parser Command pinc = string "ココア" >> return PInc
87
pinc = string "ココア" >> return PInc
34
false
true
11
5
15
54
21
33
null
null
mettekou/ghc
compiler/basicTypes/SrcLoc.hs
bsd-3-clause
-- not clear whether to add a general Eq instance, but this is useful sometimes: -- | Tests whether the two located things are equal eqLocated :: Eq a => Located a -> Located a -> Bool eqLocated a b = unLoc a == unLoc b
220
eqLocated :: Eq a => Located a -> Located a -> Bool eqLocated a b = unLoc a == unLoc b
86
eqLocated a b = unLoc a == unLoc b
34
true
true
0
9
46
54
24
30
null
null
aaronc/Idris-dev
src/Idris/CaseSplit.hs
bsd-3-clause
tidy :: IState -> PTerm -> Maybe Name -> State MergeState PTerm tidy ist orig@(PRef fc hls n) ty = do ms <- get case lookup n (namemap ms) of Just x -> return (PRef fc [] x) Nothing -> case n of (UN _) -> return orig ...
419
tidy :: IState -> PTerm -> Maybe Name -> State MergeState PTerm tidy ist orig@(PRef fc hls n) ty = do ms <- get case lookup n (namemap ms) of Just x -> return (PRef fc [] x) Nothing -> case n of (UN _) -> return orig ...
419
tidy ist orig@(PRef fc hls n) ty = do ms <- get case lookup n (namemap ms) of Just x -> return (PRef fc [] x) Nothing -> case n of (UN _) -> return orig _ -> do n' <- inventName ist ty n ...
355
false
true
1
20
207
169
77
92
null
null
mcschroeder/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
needsCDecl (CC_Label _) = True
46
needsCDecl (CC_Label _) = True
46
needsCDecl (CC_Label _) = True
46
false
false
0
6
20
16
7
9
null
null
rahulmutt/ghcvm
compiler/Eta/Types/TyCon.hs
bsd-3-clause
-- | Is this the 'TyCon' for an unboxed tuple? isUnboxedTupleTyCon :: TyCon -> Bool isUnboxedTupleTyCon (TupleTyCon {tyConTupleSort = sort}) = not (isBoxed (tupleSortBoxity sort))
183
isUnboxedTupleTyCon :: TyCon -> Bool isUnboxedTupleTyCon (TupleTyCon {tyConTupleSort = sort}) = not (isBoxed (tupleSortBoxity sort))
136
isUnboxedTupleTyCon (TupleTyCon {tyConTupleSort = sort}) = not (isBoxed (tupleSortBoxity sort))
99
true
true
0
9
28
51
25
26
null
null
vikraman/ghc
compiler/main/DynFlags.hs
bsd-3-clause
intSuffix :: (Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags) intSuffix fn = IntSuffix (\n -> upd (fn n))
117
intSuffix :: (Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags) intSuffix fn = IntSuffix (\n -> upd (fn n))
117
intSuffix fn = IntSuffix (\n -> upd (fn n))
43
false
true
0
10
19
62
30
32
null
null
lspitzner/brittany
source/library/Language/Haskell/Brittany/Internal/BackendUtils.hs
agpl-3.0
layoutWriteNewline :: (MonadMultiWriter Text.Builder.Builder m, MonadMultiState LayoutState m) => m () layoutWriteNewline = do traceLocal ("layoutWriteNewline") state <- mGet mSet $ state { _lstate_curYOrAddNewline = case _lstate_curYOrAddNewline state of Left{} -> Right 1 Right i -> Right (i ...
366
layoutWriteNewline :: (MonadMultiWriter Text.Builder.Builder m, MonadMultiState LayoutState m) => m () layoutWriteNewline = do traceLocal ("layoutWriteNewline") state <- mGet mSet $ state { _lstate_curYOrAddNewline = case _lstate_curYOrAddNewline state of Left{} -> Right 1 Right i -> Right (i ...
366
layoutWriteNewline = do traceLocal ("layoutWriteNewline") state <- mGet mSet $ state { _lstate_curYOrAddNewline = case _lstate_curYOrAddNewline state of Left{} -> Right 1 Right i -> Right (i + 1) , _lstate_addSepSpace = Nothing }
259
false
true
0
16
78
118
58
60
null
null
k0001/bitpay-client
src/lib/Web/BitPay/Client.hs
bsd-3-clause
httpRequestFromUnsignedRequest :: Cx.MonadThrow m => UnsignedRequest a -> m HTTP.Request httpRequestFromUnsignedRequest ureq = case ureq of UnsignedRequestGET url -> mkBasicHTTPRequest GET url UnsignedRequestPOST url body -> do httpReq <- mkBasicHTTPRequest POST url return $ httpReq { HTTP.reque...
354
httpRequestFromUnsignedRequest :: Cx.MonadThrow m => UnsignedRequest a -> m HTTP.Request httpRequestFromUnsignedRequest ureq = case ureq of UnsignedRequestGET url -> mkBasicHTTPRequest GET url UnsignedRequestPOST url body -> do httpReq <- mkBasicHTTPRequest POST url return $ httpReq { HTTP.reque...
354
httpRequestFromUnsignedRequest ureq = case ureq of UnsignedRequestGET url -> mkBasicHTTPRequest GET url UnsignedRequestPOST url body -> do httpReq <- mkBasicHTTPRequest POST url return $ httpReq { HTTP.requestBody = HTTP.RequestBodyBS body }
263
false
true
0
15
64
102
46
56
null
null
faylang/fay-server
src/Client.hs
bsd-3-clause
all _ [] = True
15
all _ [] = True
15
all _ [] = True
15
false
false
0
6
4
13
6
7
null
null
HIPERFIT/hopencl
tests/unit/HOpenCL/Device_Test.hs
bsd-3-clause
test_deviceImage2DMaxSize = void . deviceImage2DMaxSize
55
test_deviceImage2DMaxSize = void . deviceImage2DMaxSize
55
test_deviceImage2DMaxSize = void . deviceImage2DMaxSize
55
false
false
0
5
4
10
5
5
null
null
andorp/bead
test/Test/Unit/Persistence.hs
bsd-3-clause
testHasLastSubmission :: AssignmentKey -> Username -> SubmissionKey -> IO () testHasLastSubmission ak u sk = do interp <- createPersistInterpreter defaultConfig mKey <- liftE interp $ lastSubmission ak u assertBool "Submission was not found" (isJust mKey) assertBool "Submission was different" (sk == fromJust mK...
323
testHasLastSubmission :: AssignmentKey -> Username -> SubmissionKey -> IO () testHasLastSubmission ak u sk = do interp <- createPersistInterpreter defaultConfig mKey <- liftE interp $ lastSubmission ak u assertBool "Submission was not found" (isJust mKey) assertBool "Submission was different" (sk == fromJust mK...
323
testHasLastSubmission ak u sk = do interp <- createPersistInterpreter defaultConfig mKey <- liftE interp $ lastSubmission ak u assertBool "Submission was not found" (isJust mKey) assertBool "Submission was different" (sk == fromJust mKey)
246
false
true
0
11
50
101
44
57
null
null
vikraman/ghc
compiler/main/GhcMake.hs
bsd-3-clause
moduleGraphNodes :: Bool -> [ModSummary] -> (Graph SummaryNode, HscSource -> ModuleName -> Maybe SummaryNode) moduleGraphNodes drop_hs_boot_nodes summaries = (graphFromEdgedVertices nodes, lookup_node) where numbered_summaries = zip summaries [1..] lookup_node :: HscSource -> ModuleName -> Maybe SummaryNod...
2,544
moduleGraphNodes :: Bool -> [ModSummary] -> (Graph SummaryNode, HscSource -> ModuleName -> Maybe SummaryNode) moduleGraphNodes drop_hs_boot_nodes summaries = (graphFromEdgedVertices nodes, lookup_node) where numbered_summaries = zip summaries [1..] lookup_node :: HscSource -> ModuleName -> Maybe SummaryNod...
2,544
moduleGraphNodes drop_hs_boot_nodes summaries = (graphFromEdgedVertices nodes, lookup_node) where numbered_summaries = zip summaries [1..] lookup_node :: HscSource -> ModuleName -> Maybe SummaryNode lookup_node hs_src mod = Map.lookup (mod, hscSourceToIsBoot hs_src) node_map lookup_key :: HscSource ...
2,432
false
true
0
16
794
473
251
222
null
null
awgn/ass
src/Ass/Snippet.hs
gpl-2.0
snippet (Streamable name) = cpp [ operInsrt Nothing name, operExtrc Nothing name ]
110
snippet (Streamable name) = cpp [ operInsrt Nothing name, operExtrc Nothing name ]
110
snippet (Streamable name) = cpp [ operInsrt Nothing name, operExtrc Nothing name ]
110
false
false
0
6
40
35
16
19
null
null
expipiplus1/exact-real
test/Test/QuickCheck/Classes/Extra.hs
mit
distributesR :: EqProp a => (a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Property distributesR (*:) = distributesL (flip (*:))
130
distributesR :: EqProp a => (a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Property distributesR (*:) = distributesL (flip (*:))
130
distributesR (*:) = distributesL (flip (*:))
44
false
true
0
10
29
76
40
36
null
null
ideas-edu/ideas
src/Ideas/Text/XML/Parser.hs
apache-2.0
versionInfo :: Parser String versionInfo = space >> string "version" >> eq >> p where p = singleQuoted versionNum <|> doubleQuoted versionNum -- [25] Eq ::= S? '=' S?
182
versionInfo :: Parser String versionInfo = space >> string "version" >> eq >> p where p = singleQuoted versionNum <|> doubleQuoted versionNum -- [25] Eq ::= S? '=' S?
181
versionInfo = space >> string "version" >> eq >> p where p = singleQuoted versionNum <|> doubleQuoted versionNum -- [25] Eq ::= S? '=' S?
152
false
true
0
8
44
48
23
25
null
null
bgamari/shaking-up-ghc
src/Hadrian/Haskell/Cabal.hs
bsd-3-clause
-- | Read a Cabal file and return the package identifier, e.g. @base-4.10.0.0@. -- The Cabal file is tracked. pkgIdentifier :: Context -> Action String pkgIdentifier ctx = do cabal <- fromMaybe (error "Cabal file could not be read") <$> readCabalFile ctx return $ if null (C.version cabal) then C.name ca...
624
pkgIdentifier :: Context -> Action String pkgIdentifier ctx = do cabal <- fromMaybe (error "Cabal file could not be read") <$> readCabalFile ctx return $ if null (C.version cabal) then C.name cabal else C.name cabal ++ "-" ++ C.version cabal -- | Read a Cabal file and return the sorted list of ...
514
pkgIdentifier ctx = do cabal <- fromMaybe (error "Cabal file could not be read") <$> readCabalFile ctx return $ if null (C.version cabal) then C.name cabal else C.name cabal ++ "-" ++ C.version cabal -- | Read a Cabal file and return the sorted list of the package dependencies. -- The current v...
472
true
true
0
13
125
104
50
54
null
null
calewis/SmallProjectsAndDev
project_euler/haskell/problem_3.hs
mit
isPrime num | length (divisors num) == 0 = True | length (divisors num) > 0 = False
95
isPrime num | length (divisors num) == 0 = True | length (divisors num) > 0 = False
95
isPrime num | length (divisors num) == 0 = True | length (divisors num) > 0 = False
95
false
false
0
11
29
50
22
28
null
null
ruicc/chat-server
src/Types.hs
mit
createGroup :: Server -> GroupId -> GroupName -> GroupCapacity -> PlayTime -> Timestamp -> Timeout -> CSTM Group Group createGroup Server{..} gid name capacity playTime ts timeout = do gr <- newGroup gid name capacity playTime ts timeout modifyTVar' serverGroups $ IM.insert (groupId gr) gr return gr --{-# N...
417
createGroup :: Server -> GroupId -> GroupName -> GroupCapacity -> PlayTime -> Timestamp -> Timeout -> CSTM Group Group createGroup Server{..} gid name capacity playTime ts timeout = do gr <- newGroup gid name capacity playTime ts timeout modifyTVar' serverGroups $ IM.insert (groupId gr) gr return gr --{-# N...
417
createGroup Server{..} gid name capacity playTime ts timeout = do gr <- newGroup gid name capacity playTime ts timeout modifyTVar' serverGroups $ IM.insert (groupId gr) gr return gr --{-# NOINLINE createGroup #-} -- FIXME: basic operation and high-level operation should be separated..
298
false
true
6
6
73
99
55
44
null
null
karlvoigtland/romkan-hs
NLP/Romkan.hs
bsd-3-clause
-- sweep parser across input text, passing through as-is un-matched characters processText :: Parser T.Text -> Parser T.Text processText p = do ts <- many' (p <|> A.take 1) return $ T.concat ts -- create a single substitution parser
237
processText :: Parser T.Text -> Parser T.Text processText p = do ts <- many' (p <|> A.take 1) return $ T.concat ts -- create a single substitution parser
158
processText p = do ts <- many' (p <|> A.take 1) return $ T.concat ts -- create a single substitution parser
112
true
true
0
12
43
64
30
34
null
null
vshabanov/fast-tagsoup
Text/HTML/TagSoup/Fast.hs
bsd-3-clause
-- | Escape characters unsafe to HTML escapeHtml :: B.ByteString -> B.ByteString escapeHtml s | Nothing <- B8.find (\ c -> c=="&"||c=="<"||c==">"||c=="'"||c=="\"") s = s | B.length s' == 0 = s | otherwise = s' where s' = unsafePerformIO $ withForeignPtr fp $ \ src -> B.createAndTri...
1,239
escapeHtml :: B.ByteString -> B.ByteString escapeHtml s | Nothing <- B8.find (\ c -> c=="&"||c=="<"||c==">"||c=="'"||c=="\"") s = s | B.length s' == 0 = s | otherwise = s' where s' = unsafePerformIO $ withForeignPtr fp $ \ src -> B.createAndTrim (len*6) $ \ dst -> do ...
1,201
escapeHtml s | Nothing <- B8.find (\ c -> c=="&"||c=="<"||c==">"||c=="'"||c=="\"") s = s | B.length s' == 0 = s | otherwise = s' where s' = unsafePerformIO $ withForeignPtr fp $ \ src -> B.createAndTrim (len*6) $ \ dst -> do (ch, dst') <- go (src `plusPtr` offs...
1,158
true
true
22
40
506
610
305
305
null
null
NICTA/coordinate
src/Data/Geodetic/Ellipsoid.hs
bsd-3-clause
krasovsky1940 :: Ellipsoid krasovsky1940 = Ellipsoid 6378245 298.3
78
krasovsky1940 :: Ellipsoid krasovsky1940 = Ellipsoid 6378245 298.3
78
krasovsky1940 = Ellipsoid 6378245 298.3
49
false
true
0
4
19
17
8
9
null
null
mightybyte/reflex-dom-stubs
src/GHCJS/DOM/Navigator.hs
bsd-3-clause
navigatorGetOnLine = undefined
30
navigatorGetOnLine = undefined
30
navigatorGetOnLine = undefined
30
false
false
1
5
2
10
3
7
null
null
homam/fsm-conversational-ui
src/QnA5.hs
bsd-3-clause
whatIsYourWeightQ :: Question Weight whatIsYourWeightQ = Question "What is your weight?" read
93
whatIsYourWeightQ :: Question Weight whatIsYourWeightQ = Question "What is your weight?" read
93
whatIsYourWeightQ = Question "What is your weight?" read
56
false
true
0
5
11
19
9
10
null
null
AlexanderPankiv/ghc
compiler/deSugar/Coverage.hs
bsd-3-clause
addTickLHsBind (L pos (pat@(PatBind { pat_lhs = lhs, pat_rhs = rhs }))) = do let name = "(...)" (fvs, rhs') <- getFreeVars $ addPathEntry name $ addTickGRHSs False False rhs let pat' = pat { pat_rhs = rhs'} -- Should create ticks here? density <- getDensity decl_path <- getPathEntry let top_lev = null de...
971
addTickLHsBind (L pos (pat@(PatBind { pat_lhs = lhs, pat_rhs = rhs }))) = do let name = "(...)" (fvs, rhs') <- getFreeVars $ addPathEntry name $ addTickGRHSs False False rhs let pat' = pat { pat_rhs = rhs'} -- Should create ticks here? density <- getDensity decl_path <- getPathEntry let top_lev = null de...
971
addTickLHsBind (L pos (pat@(PatBind { pat_lhs = lhs, pat_rhs = rhs }))) = do let name = "(...)" (fvs, rhs') <- getFreeVars $ addPathEntry name $ addTickGRHSs False False rhs let pat' = pat { pat_rhs = rhs'} -- Should create ticks here? density <- getDensity decl_path <- getPathEntry let top_lev = null de...
971
false
false
0
18
235
324
162
162
null
null
carlostome/HCrawler
src/WebGraph.hs
gpl-2.0
-- | Checks if a URI have links isLeaf :: URI -> WebG -> Bool isLeaf uri webg = let l = links uri webg in case l of Nothing -> False Just results -> null results -- | Checks if a URI exists in the graph
246
isLeaf :: URI -> WebG -> Bool isLeaf uri webg = let l = links uri webg in case l of Nothing -> False Just results -> null results -- | Checks if a URI exists in the graph
214
isLeaf uri webg = let l = links uri webg in case l of Nothing -> False Just results -> null results -- | Checks if a URI exists in the graph
184
true
true
0
10
90
64
31
33
null
null
bos/criterion
criterion-measurement/src/Criterion/Measurement/Types.hs
bsd-2-clause
-- | Apply an argument to a function, and evaluate the result to weak -- head normal form (WHNF). whnf :: (a -> b) -> a -> Benchmarkable whnf f x = toBenchmarkable (whnf' f x)
175
whnf :: (a -> b) -> a -> Benchmarkable whnf f x = toBenchmarkable (whnf' f x)
77
whnf f x = toBenchmarkable (whnf' f x)
38
true
true
0
7
35
44
23
21
null
null
CarstenKoenig/AdventOfCode2016
Day6/Main.hs
mit
main :: IO () main = do received <- processLines <$> input putStr "Part1: " print $ decodeMessage received putStr "Part2: " print $ decodeMessage' received putStrLn "all done"
193
main :: IO () main = do received <- processLines <$> input putStr "Part1: " print $ decodeMessage received putStr "Part2: " print $ decodeMessage' received putStrLn "all done"
193
main = do received <- processLines <$> input putStr "Part1: " print $ decodeMessage received putStr "Part2: " print $ decodeMessage' received putStrLn "all done"
179
false
true
0
9
46
71
28
43
null
null
volhovM/orgstat
src/OrgStat/Outputs/Block.hs
gpl-3.0
asciiBlockFrames = BlockFrames "|" "\\" "-" "|"
47
asciiBlockFrames = BlockFrames "|" "\\" "-" "|"
47
asciiBlockFrames = BlockFrames "|" "\\" "-" "|"
47
false
false
0
5
6
15
7
8
null
null
ocramz/petsc-hs
src/Numerical/PETSc/Internal/PutGet/Mat.hs
gpl-3.0
-- -- NB : the actual transpose is NOT created by using `matCreateTranspose`, but the definition of matvec will use MatMultTranspose() matCreateTranspose :: Mat -> IO Mat matCreateTranspose mat = chk1 (matCreateTranspose' mat)
227
matCreateTranspose :: Mat -> IO Mat matCreateTranspose mat = chk1 (matCreateTranspose' mat)
91
matCreateTranspose mat = chk1 (matCreateTranspose' mat)
55
true
true
0
7
33
35
16
19
null
null
alexander-at-github/eta
compiler/ETA/Specialise/Rules.hs
bsd-3-clause
ruleCheckProgram :: CompilerPhase -- ^ Rule activation test -> String -- ^ Rule pattern -> RuleBase -- ^ Database of rules -> CoreProgram -- ^ Bindings to check in -> SDoc ...
1,042
ruleCheckProgram :: CompilerPhase -- ^ Rule activation test -> String -- ^ Rule pattern -> RuleBase -- ^ Database of rules -> CoreProgram -- ^ Bindings to check in -> SDoc ruleCheckP...
990
ruleCheckProgram phase rule_pat rule_base binds | isEmptyBag results = text "Rule check results: no rule application sites" | otherwise = vcat [text "Rule check results:", line, vcat [ p $$ line | p <- bagToList results ] ] where env = RuleCheckEnv { rc_is_active = isActive ph...
680
true
true
3
10
462
195
95
100
null
null
oldmanmike/ghc
compiler/basicTypes/MkId.hs
bsd-3-clause
unwrapNewTypeBody :: TyCon -> [Type] -> CoreExpr -> CoreExpr unwrapNewTypeBody tycon args result_expr = ASSERT( isNewTyCon tycon ) mkCast result_expr (mkUnbranchedAxInstCo Representational (newTyConCo tycon) args [])
222
unwrapNewTypeBody :: TyCon -> [Type] -> CoreExpr -> CoreExpr unwrapNewTypeBody tycon args result_expr = ASSERT( isNewTyCon tycon ) mkCast result_expr (mkUnbranchedAxInstCo Representational (newTyConCo tycon) args [])
222
unwrapNewTypeBody tycon args result_expr = ASSERT( isNewTyCon tycon ) mkCast result_expr (mkUnbranchedAxInstCo Representational (newTyConCo tycon) args [])
161
false
true
0
9
31
68
34
34
null
null
AlexanderPankiv/ghc
compiler/codeGen/StgCmmMonad.hs
bsd-3-clause
emitUnwind :: GlobalReg -> CmmExpr -> FCode () emitUnwind g e = do dflags <- getDynFlags when (gopt Opt_Debug dflags) $ emitCgStmt $ CgStmt $ CmmUnwind g e
164
emitUnwind :: GlobalReg -> CmmExpr -> FCode () emitUnwind g e = do dflags <- getDynFlags when (gopt Opt_Debug dflags) $ emitCgStmt $ CgStmt $ CmmUnwind g e
164
emitUnwind g e = do dflags <- getDynFlags when (gopt Opt_Debug dflags) $ emitCgStmt $ CgStmt $ CmmUnwind g e
117
false
true
0
13
36
72
32
40
null
null
siegfriedweber/hgit
src/Git/Repository.hs
bsd-3-clause
withNewRepository :: FilePath -> MonadRepository a -> MonadLibgit2 a withNewRepository path = liftIO . bracket (repositoryInit path True) repositoryFree . runRepositoryReader
174
withNewRepository :: FilePath -> MonadRepository a -> MonadLibgit2 a withNewRepository path = liftIO . bracket (repositoryInit path True) repositoryFree . runRepositoryReader
174
withNewRepository path = liftIO . bracket (repositoryInit path True) repositoryFree . runRepositoryReader
105
false
true
0
9
20
49
23
26
null
null
dpieroux/euler
0/0060c.hs
mit
-- Check if a pair of numbers is valid isValidPair :: Integer -> Integer -> Bool isValidPair n1 n2 = isPrime (n1#n2) && isPrime (n2#n1)
135
isValidPair :: Integer -> Integer -> Bool isValidPair n1 n2 = isPrime (n1#n2) && isPrime (n2#n1)
96
isValidPair n1 n2 = isPrime (n1#n2) && isPrime (n2#n1)
54
true
true
0
8
24
47
23
24
null
null
damoxc/ganeti
src/Ganeti/OpParams.hs
gpl-2.0
-- | Netmask of the master IP. pMasterNetmask :: Field pMasterNetmask = optionalField $ simpleField "master_netmask" [t| NonNegative Int |]
141
pMasterNetmask :: Field pMasterNetmask = optionalField $ simpleField "master_netmask" [t| NonNegative Int |]
110
pMasterNetmask = optionalField $ simpleField "master_netmask" [t| NonNegative Int |]
86
true
true
0
6
21
25
15
10
null
null
fpco/hlint
src/Util.hs
bsd-3-clause
withBuffering :: Handle -> BufferMode -> IO a -> IO a withBuffering h m act = bracket (hGetBuffering h) (hSetBuffering h) $ const $ do hSetBuffering h m act -- FIXME: Should use strict ByteString
205
withBuffering :: Handle -> BufferMode -> IO a -> IO a withBuffering h m act = bracket (hGetBuffering h) (hSetBuffering h) $ const $ do hSetBuffering h m act -- FIXME: Should use strict ByteString
205
withBuffering h m act = bracket (hGetBuffering h) (hSetBuffering h) $ const $ do hSetBuffering h m act -- FIXME: Should use strict ByteString
151
false
true
0
9
44
78
35
43
null
null
Ornedan/dom3statusbot
GameInfo.hs
bsd-3-clause
nationName 67 = "LA R'lyeh"
27
nationName 67 = "LA R'lyeh"
27
nationName 67 = "LA R'lyeh"
27
false
false
0
5
4
9
4
5
null
null
sjakobi/heist
src/Heist/Compiled/Internal.hs
bsd-3-clause
------------------------------------------------------------------------------ -- | Looks up a compiled template and returns a compiled splice. callTemplate :: Monad n => ByteString -> HeistT n IO (DList (Chunk n)) callTemplate nm = do hs <- getHS runNodeList $ maybe (error err) (X.doc...
470
callTemplate :: Monad n => ByteString -> HeistT n IO (DList (Chunk n)) callTemplate nm = do hs <- getHS runNodeList $ maybe (error err) (X.docContent . dfDoc . fst) $ lookupTemplate nm hs _templateMap where err = "callTemplate: "++(T.unpack $ T.decodeUtf8 nm)++(" does not e...
326
callTemplate nm = do hs <- getHS runNodeList $ maybe (error err) (X.docContent . dfDoc . fst) $ lookupTemplate nm hs _templateMap where err = "callTemplate: "++(T.unpack $ T.decodeUtf8 nm)++(" does not exist")
229
true
true
3
13
104
138
64
74
null
null
phylake/avm3
abc/json2.hs
mit
metadata :: (U30 -> String) -- string resolution -> Metadata -> JSValue metadata s_res (Metadata name kvps) = kvToObject [ ("name", showJSON$ s_res name) , ("kvps", kvToObject$ map (\(k,v) -> (s_res k, showJSON$ s_res v)) kvps) ]
257
metadata :: (U30 -> String) -- string resolution -> Metadata -> JSValue metadata s_res (Metadata name kvps) = kvToObject [ ("name", showJSON$ s_res name) , ("kvps", kvToObject$ map (\(k,v) -> (s_res k, showJSON$ s_res v)) kvps) ]
257
metadata s_res (Metadata name kvps) = kvToObject [ ("name", showJSON$ s_res name) , ("kvps", kvToObject$ map (\(k,v) -> (s_res k, showJSON$ s_res v)) kvps) ]
167
false
true
0
14
64
113
59
54
null
null
patrickboe/artery
Test/Box.Test.hs
mit
runTests = $quickCheckAll
25
runTests = $quickCheckAll
25
runTests = $quickCheckAll
25
false
false
0
6
2
11
4
7
null
null
ppseafield/backend-flashcard
src/DB/CardSimple/Queries.hs
bsd-3-clause
singleCard :: Connection -> Int -> ActionM (Maybe CardSimple) singleCard conn cardId = liftIO $ listToMaybe <$> query conn singleQuery (Only cardId) where singleQuery = "SELECT * FROM card_simple WHERE id = ? AND deleted = false"
240
singleCard :: Connection -> Int -> ActionM (Maybe CardSimple) singleCard conn cardId = liftIO $ listToMaybe <$> query conn singleQuery (Only cardId) where singleQuery = "SELECT * FROM card_simple WHERE id = ? AND deleted = false"
240
singleCard conn cardId = liftIO $ listToMaybe <$> query conn singleQuery (Only cardId) where singleQuery = "SELECT * FROM card_simple WHERE id = ? AND deleted = false"
178
false
true
4
10
47
67
31
36
null
null
GaloisInc/tower
tower-aadl/src/Tower/AADL/Build/Common.hs
bsd-3-clause
renderMkStmt (Include Opt fp) = text "-include" <+> text fp
59
renderMkStmt (Include Opt fp) = text "-include" <+> text fp
59
renderMkStmt (Include Opt fp) = text "-include" <+> text fp
59
false
false
0
6
9
28
12
16
null
null
shlevy/ghc
testsuite/tests/programs/galois_raytrace/Geometry.hs
bsd-3-clause
color r g b = C r g b
21
color r g b = C r g b
21
color r g b = C r g b
21
false
false
0
5
8
20
9
11
null
null
mgoszcz2/derive-enumerable
src/Data/Enumerable/Generic.hs
gpl-3.0
defEnumerable :: (Eq x, Enum x, Bounded x) => x -> (x, Bool) defEnumerable x = if maxBound == x then (minBound, True) else (succ x, False)
138
defEnumerable :: (Eq x, Enum x, Bounded x) => x -> (x, Bool) defEnumerable x = if maxBound == x then (minBound, True) else (succ x, False)
138
defEnumerable x = if maxBound == x then (minBound, True) else (succ x, False)
77
false
true
0
9
26
78
41
37
null
null