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
geophf/1HaskellADay
exercises/HAD/Y2017/M09/D08/Exercise.hs
mit
-- Now that we've got the file names, load the files, compress them, then save -- them locally using the same directory structure from where they were fetched loadCompressStore :: URL -> Directory -> FileName -> IO () loadCompressStore url bOrN filename = undefined
266
loadCompressStore :: URL -> Directory -> FileName -> IO () loadCompressStore url bOrN filename = undefined
106
loadCompressStore url bOrN filename = undefined
47
true
true
0
9
44
37
19
18
null
null
apyrgio/ganeti
test/hs/Test/Ganeti/Locking/Locks.hs
bsd-2-clause
prop_ReadShow_ClientType :: Property prop_ReadShow_ClientType = forAll (arbitrary :: Gen ClientType) $ \a -> readJSON (showJSON a) ==? Ok a
141
prop_ReadShow_ClientType :: Property prop_ReadShow_ClientType = forAll (arbitrary :: Gen ClientType) $ \a -> readJSON (showJSON a) ==? Ok a
141
prop_ReadShow_ClientType = forAll (arbitrary :: Gen ClientType) $ \a -> readJSON (showJSON a) ==? Ok a
104
false
true
0
10
20
48
24
24
null
null
CulpaBS/wbBach
src/Futhark/CodeGen/Backends/GenericC.hs
bsd-3-clause
envOpCompiler :: CompilerEnv op s -> OpCompiler op s envOpCompiler = opsCompiler . envOperations
96
envOpCompiler :: CompilerEnv op s -> OpCompiler op s envOpCompiler = opsCompiler . envOperations
96
envOpCompiler = opsCompiler . envOperations
43
false
true
0
6
13
29
14
15
null
null
thalerjonathan/phd
coding/libraries/chimera/examples/ABS/SIRExamples/SIR/Main.hs
gpl-3.0
agentCount :: Int agentCount = 10000
36
agentCount :: Int agentCount = 10000
36
agentCount = 10000
18
false
true
0
6
5
18
7
11
null
null
pparkkin/eta
compiler/ETA/Rename/RnTypes.hs
bsd-3-clause
rnHsTyKi isType doc (HsBangTy b ty) = ASSERT( isType ) do { (ty', fvs) <- rnLHsType doc ty ; return (HsBangTy b ty', fvs) }
136
rnHsTyKi isType doc (HsBangTy b ty) = ASSERT( isType ) do { (ty', fvs) <- rnLHsType doc ty ; return (HsBangTy b ty', fvs) }
136
rnHsTyKi isType doc (HsBangTy b ty) = ASSERT( isType ) do { (ty', fvs) <- rnLHsType doc ty ; return (HsBangTy b ty', fvs) }
136
false
false
0
9
37
71
34
37
null
null
picca/hkl
contrib/haskell/src/Hkl/Diffabs/Martinetto.hs
gpl-3.0
r34n1 :: XRDSample r34n1 = XRDSample "R34N1" (published </> "R34N1") [ XrdNxs bins multibins threshold n | n <- [ nxs (project </> "2016" </> "Run2" </> "2016-03-27" </> "R34N1_28.nxs") "scan_28" h5path , nxs (project </> "2016" </> "Run2" </> "2016-03-27" </> "R34N1_37.nxs") "scan_37" h5path ] ]
351
r34n1 :: XRDSample r34n1 = XRDSample "R34N1" (published </> "R34N1") [ XrdNxs bins multibins threshold n | n <- [ nxs (project </> "2016" </> "Run2" </> "2016-03-27" </> "R34N1_28.nxs") "scan_28" h5path , nxs (project </> "2016" </> "Run2" </> "2016-03-27" </> "R34N1_37.nxs") "scan_37" h5path ] ]
351
r34n1 = XRDSample "R34N1" (published </> "R34N1") [ XrdNxs bins multibins threshold n | n <- [ nxs (project </> "2016" </> "Run2" </> "2016-03-27" </> "R34N1_28.nxs") "scan_28" h5path , nxs (project </> "2016" </> "Run2" </> "2016-03-27" </> "R34N1_37.nxs") "scan_37" h5path ] ]
332
false
true
0
15
100
103
53
50
null
null
nvasilakis/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
acute 'L' = "Ĺ"
15
acute 'L' = "Ĺ"
15
acute 'L' = "Ĺ"
15
false
false
0
5
3
9
4
5
null
null
spechub/Hets
HasCASL/SimplifyTerm.hs
gpl-2.0
-- | remove qualification of unique identifiers simplifyPattern :: Env -> Term -> Term simplifyPattern = foldTerm . simplifyRec True
132
simplifyPattern :: Env -> Term -> Term simplifyPattern = foldTerm . simplifyRec True
84
simplifyPattern = foldTerm . simplifyRec True
45
true
true
0
6
19
27
14
13
null
null
lynchronan/haskoin-crypto
src/Haskoin/Crypto/Point.hs
unlicense
mulPoint 1 p = p
23
mulPoint 1 p = p
23
mulPoint 1 p = p
23
false
false
1
5
11
16
5
11
null
null
sarahn/ganeti
src/Ganeti/OpParams.hs
gpl-2.0
-- | Job dependencies. pDependencies :: Field pDependencies = optionalNullSerField $ simpleField "depends" [t| [JobDependency] |]
131
pDependencies :: Field pDependencies = optionalNullSerField $ simpleField "depends" [t| [JobDependency] |]
108
pDependencies = optionalNullSerField $ simpleField "depends" [t| [JobDependency] |]
85
true
true
0
6
17
25
15
10
null
null
aaronc/Idris-dev
src/IRTS/Compiler.hs
bsd-3-clause
irSC vs ImpossibleCase = return LNothing
40
irSC vs ImpossibleCase = return LNothing
40
irSC vs ImpossibleCase = return LNothing
40
false
false
1
5
5
18
6
12
null
null
sgord512/Utilities
Util/String/Align.hs
mit
padFrontUntilLength :: Char -> Int -> String -> String padFrontUntilLength ch col word | (length word) > col = error "Starting string was longer than length" | otherwise = (replicate (col - length word) ch) ++ word
246
padFrontUntilLength :: Char -> Int -> String -> String padFrontUntilLength ch col word | (length word) > col = error "Starting string was longer than length" | otherwise = (replicate (col - length word) ch) ++ word
246
padFrontUntilLength ch col word | (length word) > col = error "Starting string was longer than length" | otherwise = (replicate (col - length word) ch) ++ word
191
false
true
0
11
68
86
39
47
null
null
spacekitteh/smcghc
compiler/codeGen/StgCmmUtils.hs
bsd-3-clause
------------------------------------------------------------------------- -- -- Converting a closure tag to a closure for enumeration types -- (this is the implementation of tagToEnum#). -- ------------------------------------------------------------------------- tagToClosure :: DynFlags -> TyCon -> CmmExpr -> CmmExpr tagToClosure dflags tycon tag = CmmLoad (cmmOffsetExprW dflags closure_tbl tag) (bWord dflags) where closure_tbl = CmmLit (CmmLabel lbl) lbl = mkClosureTableLabel (tyConName tycon) NoCafRefs ------------------------------------------------------------------------- -- -- Conditionals and rts calls -- -------------------------------------------------------------------------
723
tagToClosure :: DynFlags -> TyCon -> CmmExpr -> CmmExpr tagToClosure dflags tycon tag = CmmLoad (cmmOffsetExprW dflags closure_tbl tag) (bWord dflags) where closure_tbl = CmmLit (CmmLabel lbl) lbl = mkClosureTableLabel (tyConName tycon) NoCafRefs ------------------------------------------------------------------------- -- -- Conditionals and rts calls -- -------------------------------------------------------------------------
448
tagToClosure dflags tycon tag = CmmLoad (cmmOffsetExprW dflags closure_tbl tag) (bWord dflags) where closure_tbl = CmmLit (CmmLabel lbl) lbl = mkClosureTableLabel (tyConName tycon) NoCafRefs ------------------------------------------------------------------------- -- -- Conditionals and rts calls -- -------------------------------------------------------------------------
392
true
true
1
7
92
104
53
51
null
null
amccausl/Swish
Swish/HaskellRDF/GraphTest.hs
lgpl-2.1
v1 = LV "v1"
13
v1 = LV "v1"
13
v1 = LV "v1"
13
false
false
0
5
4
9
4
5
null
null
abooij/cubicaltt
Connections.hs
mit
transposeSystemAndList tss (u:us) = (Map.map head tss,u):transposeSystemAndList (Map.map tail tss) us
103
transposeSystemAndList tss (u:us) = (Map.map head tss,u):transposeSystemAndList (Map.map tail tss) us
103
transposeSystemAndList tss (u:us) = (Map.map head tss,u):transposeSystemAndList (Map.map tail tss) us
103
false
false
2
8
12
54
25
29
null
null
dan-t/cabal-cargs
lib/CabalCargs/CompilerArgs.hs
bsd-3-clause
fieldL :: F.Field -> Lens' CompilerArgs [String] fieldL F.Hs_Source_Dirs = hsSourceDirsL
96
fieldL :: F.Field -> Lens' CompilerArgs [String] fieldL F.Hs_Source_Dirs = hsSourceDirsL
96
fieldL F.Hs_Source_Dirs = hsSourceDirsL
47
false
true
0
7
18
30
15
15
null
null
qnikst/distributed-process-tests
src/Control/Distributed/Process/Tests/Closure.hs
bsd-3-clause
testSpawnSupervised :: TestTransport -> RemoteTable -> Assertion testSpawnSupervised TestTransport{..} rtable = do [node1, node2] <- replicateM 2 $ newLocalNode testTransport rtable [superPid, childPid] <- replicateM 2 $ newEmptyMVar thirdProcessDone <- newEmptyMVar forkProcess node1 $ do us <- getSelfPid liftIO $ putMVar superPid us (child, _ref) <- spawnSupervised (localNodeId node2) (waitClosure 1000000) liftIO $ do putMVar childPid child threadDelay 500000 -- Give the child a chance to link to us throw supervisorDeath forkProcess node2 $ do [super, child] <- liftIO $ mapM readMVar [superPid, childPid] ref <- monitor child ProcessMonitorNotification ref' pid' (DiedException e) <- expect True <- return $ ref' == ref && pid' == child && e == show (ProcessLinkException super (DiedException (show supervisorDeath))) liftIO $ putMVar thirdProcessDone () takeMVar thirdProcessDone where supervisorDeath :: IOException supervisorDeath = userError "Supervisor died"
1,136
testSpawnSupervised :: TestTransport -> RemoteTable -> Assertion testSpawnSupervised TestTransport{..} rtable = do [node1, node2] <- replicateM 2 $ newLocalNode testTransport rtable [superPid, childPid] <- replicateM 2 $ newEmptyMVar thirdProcessDone <- newEmptyMVar forkProcess node1 $ do us <- getSelfPid liftIO $ putMVar superPid us (child, _ref) <- spawnSupervised (localNodeId node2) (waitClosure 1000000) liftIO $ do putMVar childPid child threadDelay 500000 -- Give the child a chance to link to us throw supervisorDeath forkProcess node2 $ do [super, child] <- liftIO $ mapM readMVar [superPid, childPid] ref <- monitor child ProcessMonitorNotification ref' pid' (DiedException e) <- expect True <- return $ ref' == ref && pid' == child && e == show (ProcessLinkException super (DiedException (show supervisorDeath))) liftIO $ putMVar thirdProcessDone () takeMVar thirdProcessDone where supervisorDeath :: IOException supervisorDeath = userError "Supervisor died"
1,136
testSpawnSupervised TestTransport{..} rtable = do [node1, node2] <- replicateM 2 $ newLocalNode testTransport rtable [superPid, childPid] <- replicateM 2 $ newEmptyMVar thirdProcessDone <- newEmptyMVar forkProcess node1 $ do us <- getSelfPid liftIO $ putMVar superPid us (child, _ref) <- spawnSupervised (localNodeId node2) (waitClosure 1000000) liftIO $ do putMVar childPid child threadDelay 500000 -- Give the child a chance to link to us throw supervisorDeath forkProcess node2 $ do [super, child] <- liftIO $ mapM readMVar [superPid, childPid] ref <- monitor child ProcessMonitorNotification ref' pid' (DiedException e) <- expect True <- return $ ref' == ref && pid' == child && e == show (ProcessLinkException super (DiedException (show supervisorDeath))) liftIO $ putMVar thirdProcessDone () takeMVar thirdProcessDone where supervisorDeath :: IOException supervisorDeath = userError "Supervisor died"
1,071
false
true
1
18
295
328
152
176
null
null
ucsd-cse131/01-adder
lib/Language/Adder/Types.hs
mit
pushEnv :: Bind a -> Env -> (Int, Env) pushEnv x (Env bs n) = (n', Env bs' n') where bs' = (bindId x, n') : bs n' = 1 + n -------------------------------------------------------------------------------- -- | File Extensions --------------------------------------------------------------------------------
342
pushEnv :: Bind a -> Env -> (Int, Env) pushEnv x (Env bs n) = (n', Env bs' n') where bs' = (bindId x, n') : bs n' = 1 + n -------------------------------------------------------------------------------- -- | File Extensions --------------------------------------------------------------------------------
342
pushEnv x (Env bs n) = (n', Env bs' n') where bs' = (bindId x, n') : bs n' = 1 + n -------------------------------------------------------------------------------- -- | File Extensions --------------------------------------------------------------------------------
303
false
true
0
7
75
85
46
39
null
null
thoughtpolice/binary-serialise-cbor
Data/Binary/Serialise/CBOR/Read.hs
bsd-3-clause
go_fast_end (ConsumeMapLen k) !bs = case tryConsumeMapLen (unsafeHead bs) bs of DecodeFailure -> SlowFail bs "expected map len" DecodedToken sz (I# n#) -> go_fast_end (k n#) (BS.unsafeDrop sz bs)
221
go_fast_end (ConsumeMapLen k) !bs = case tryConsumeMapLen (unsafeHead bs) bs of DecodeFailure -> SlowFail bs "expected map len" DecodedToken sz (I# n#) -> go_fast_end (k n#) (BS.unsafeDrop sz bs)
221
go_fast_end (ConsumeMapLen k) !bs = case tryConsumeMapLen (unsafeHead bs) bs of DecodeFailure -> SlowFail bs "expected map len" DecodedToken sz (I# n#) -> go_fast_end (k n#) (BS.unsafeDrop sz bs)
221
false
false
0
11
54
85
39
46
null
null
shockkolate/lambdircd
src.old/Main.hs
apache-2.0
main :: IO () main = do cp <- loadConfig "ircd.conf" serveIRC defaultEnv {config=cp}
92
main :: IO () main = do cp <- loadConfig "ircd.conf" serveIRC defaultEnv {config=cp}
92
main = do cp <- loadConfig "ircd.conf" serveIRC defaultEnv {config=cp}
78
false
true
0
9
21
40
19
21
null
null
facebookincubator/duckling
Duckling/Time/TR/Rules.hs
bsd-3-clause
ruleIdesOfMonth :: Rule ruleIdesOfMonth = Rule { name = "the ides of <named-month>" , pattern = [ Predicate isAMonth , regex "ortası" ] , prod = \case (Token Time td@TimeData {TTime.form = Just (TTime.Month m)}:_) -> Token Time <$> intersect td (dayOfMonth $ if elem m [3, 5, 7, 10] then 15 else 13) _ -> Nothing }
364
ruleIdesOfMonth :: Rule ruleIdesOfMonth = Rule { name = "the ides of <named-month>" , pattern = [ Predicate isAMonth , regex "ortası" ] , prod = \case (Token Time td@TimeData {TTime.form = Just (TTime.Month m)}:_) -> Token Time <$> intersect td (dayOfMonth $ if elem m [3, 5, 7, 10] then 15 else 13) _ -> Nothing }
364
ruleIdesOfMonth = Rule { name = "the ides of <named-month>" , pattern = [ Predicate isAMonth , regex "ortası" ] , prod = \case (Token Time td@TimeData {TTime.form = Just (TTime.Month m)}:_) -> Token Time <$> intersect td (dayOfMonth $ if elem m [3, 5, 7, 10] then 15 else 13) _ -> Nothing }
340
false
true
0
21
107
142
76
66
null
null
GaloisInc/halvm-ghc
compiler/utils/Outputable.hs
bsd-3-clause
rparen = docToSDoc $ Pretty.rparen
38
rparen = docToSDoc $ Pretty.rparen
38
rparen = docToSDoc $ Pretty.rparen
38
false
false
0
6
8
12
6
6
null
null
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/Bare/DataType.hs
bsd-3-clause
ofBDataDecl Nothing (Just (tc, is)) = do tc' <- lookupGhcTyCon tc return ((tc', TyConP [] [] [] tcov tcontr Nothing), []) where (tcov, tcontr) = (is, [])
175
ofBDataDecl Nothing (Just (tc, is)) = do tc' <- lookupGhcTyCon tc return ((tc', TyConP [] [] [] tcov tcontr Nothing), []) where (tcov, tcontr) = (is, [])
175
ofBDataDecl Nothing (Just (tc, is)) = do tc' <- lookupGhcTyCon tc return ((tc', TyConP [] [] [] tcov tcontr Nothing), []) where (tcov, tcontr) = (is, [])
175
false
false
0
11
48
94
49
45
null
null
olorin/amazonka
amazonka-cloudformation/gen/Network/AWS/CloudFormation/DescribeStackResource.hs
mpl-2.0
-- | The response status code. dsrrsResponseStatus :: Lens' DescribeStackResourceResponse Int dsrrsResponseStatus = lens _dsrrsResponseStatus (\ s a -> s{_dsrrsResponseStatus = a})
180
dsrrsResponseStatus :: Lens' DescribeStackResourceResponse Int dsrrsResponseStatus = lens _dsrrsResponseStatus (\ s a -> s{_dsrrsResponseStatus = a})
149
dsrrsResponseStatus = lens _dsrrsResponseStatus (\ s a -> s{_dsrrsResponseStatus = a})
86
true
true
0
9
21
40
22
18
null
null
henrytill/deviser
src/Deviser/Types.hs
bsd-3-clause
showVal Nil = "()"
20
showVal Nil = "()"
20
showVal Nil = "()"
20
false
false
0
5
5
9
4
5
null
null
ianagbip1oti/ProC
src/ProC/Parser/Lexer.hs
mit
reservedOp :: String -> Parser () reservedOp = Token.reservedOp lexer
69
reservedOp :: String -> Parser () reservedOp = Token.reservedOp lexer
69
reservedOp = Token.reservedOp lexer
35
false
true
0
7
9
25
12
13
null
null
takayuki/natume
Canna.hs
gpl-2.0
service _ major minor = error ("Canna.serevice: protocol is not implemented yet " ++ "(" ++ (show major) ++ "," ++ (show minor) ++ ")")
146
service _ major minor = error ("Canna.serevice: protocol is not implemented yet " ++ "(" ++ (show major) ++ "," ++ (show minor) ++ ")")
146
service _ major minor = error ("Canna.serevice: protocol is not implemented yet " ++ "(" ++ (show major) ++ "," ++ (show minor) ++ ")")
146
false
false
1
12
35
50
24
26
null
null
kim/amazonka
amazonka-dynamodb/gen/Network/AWS/DynamoDB/Types.hs
mpl-2.0
-- | The amount of throughput consumed on each local index affected by the -- operation. ccLocalSecondaryIndexes :: Lens' ConsumedCapacity (HashMap Text Capacity) ccLocalSecondaryIndexes = lens _ccLocalSecondaryIndexes (\s a -> s { _ccLocalSecondaryIndexes = a }) . _Map
282
ccLocalSecondaryIndexes :: Lens' ConsumedCapacity (HashMap Text Capacity) ccLocalSecondaryIndexes = lens _ccLocalSecondaryIndexes (\s a -> s { _ccLocalSecondaryIndexes = a }) . _Map
193
ccLocalSecondaryIndexes = lens _ccLocalSecondaryIndexes (\s a -> s { _ccLocalSecondaryIndexes = a }) . _Map
119
true
true
0
10
49
53
29
24
null
null
shayan-najd/QFeldspar
QFeldspar/Expression/Utils/Equality/GADTFirstOrder.hs
gpl-3.0
eql (Whl ec eb ei) (Whl ec' eb' ei') = eql ec ec' && eql eb eb' && eql ei ei'
116
eql (Whl ec eb ei) (Whl ec' eb' ei') = eql ec ec' && eql eb eb' && eql ei ei'
116
eql (Whl ec eb ei) (Whl ec' eb' ei') = eql ec ec' && eql eb eb' && eql ei ei'
116
false
false
0
7
59
56
25
31
null
null
expipiplus1/spir-v
Language/SpirV/OpCode.hs
mit
instructionSize OpReleaseEvent = Fixed 2
40
instructionSize OpReleaseEvent = Fixed 2
40
instructionSize OpReleaseEvent = Fixed 2
40
false
false
0
5
4
12
5
7
null
null
hithroc/hsvkbot
src/Command.hs
bsd-3-clause
execute vid Update = withPermission Admin vid $ do downloadSet sendMessage $ Message 0 vid "Database updated, but you need to restart the bot." [] []
157
execute vid Update = withPermission Admin vid $ do downloadSet sendMessage $ Message 0 vid "Database updated, but you need to restart the bot." [] []
157
execute vid Update = withPermission Admin vid $ do downloadSet sendMessage $ Message 0 vid "Database updated, but you need to restart the bot." [] []
157
false
false
0
10
33
45
20
25
null
null
mudphone/HaskellBook
src/Thirteen.hs
mit
lowercase (x:xs) = [toLower x] ++ (lowercase xs)
48
lowercase (x:xs) = [toLower x] ++ (lowercase xs)
48
lowercase (x:xs) = [toLower x] ++ (lowercase xs)
48
false
false
0
7
7
32
16
16
null
null
badp/ganeti
src/Ganeti/HTools/Backend/Text.hs
gpl-2.0
loadISpec owner s = fail $ "Invalid ispec data for " ++ owner ++ ": " ++ show s
79
loadISpec owner s = fail $ "Invalid ispec data for " ++ owner ++ ": " ++ show s
79
loadISpec owner s = fail $ "Invalid ispec data for " ++ owner ++ ": " ++ show s
79
false
false
0
8
18
30
14
16
null
null
brendanhay/gogol
gogol-storage/gen/Network/Google/Storage/Types/Product.hs
mpl-2.0
-- | If the requested object path is missing, and any mainPageSuffix object -- is missing, if applicable, the service will return the named object from -- this bucket as the content for a 404 Not Found result. bwNotFoundPage :: Lens' BucketWebsite (Maybe Text) bwNotFoundPage = lens _bwNotFoundPage (\ s a -> s{_bwNotFoundPage = a})
340
bwNotFoundPage :: Lens' BucketWebsite (Maybe Text) bwNotFoundPage = lens _bwNotFoundPage (\ s a -> s{_bwNotFoundPage = a})
130
bwNotFoundPage = lens _bwNotFoundPage (\ s a -> s{_bwNotFoundPage = a})
79
true
true
0
9
62
50
27
23
null
null
NicolasT/nbd
src/Network/NBD/Server/Simple.hs
lgpl-2.1
makeServer :: Monad m => Maybe [ExportName] -> ExportMaker -> (Socket, NS.SockAddr) -> m (IO ()) makeServer exportNames exportMaker (sock, addr) = return $ application exportNames exportMaker NbdAppData { nbdAppSource = sourceSocket sock , nbdAppSink = sinkSocket sock , nbdAppSockAddr = addr , nbdAppSocket = sock }
568
makeServer :: Monad m => Maybe [ExportName] -> ExportMaker -> (Socket, NS.SockAddr) -> m (IO ()) makeServer exportNames exportMaker (sock, addr) = return $ application exportNames exportMaker NbdAppData { nbdAppSource = sourceSocket sock , nbdAppSink = sinkSocket sock , nbdAppSockAddr = addr , nbdAppSocket = sock }
568
makeServer exportNames exportMaker (sock, addr) = return $ application exportNames exportMaker NbdAppData { nbdAppSource = sourceSocket sock , nbdAppSink = sinkSocket sock , nbdAppSockAddr = addr , nbdAppSocket = sock }
427
false
true
0
12
298
111
59
52
null
null
kaoskorobase/hsc3-server
Sound/SC3/Server/Connection.hs
gpl-2.0
removeListener c uid (Just l) = withMVar (listeners c) $ \ls -> H.insert ls uid l
81
removeListener c uid (Just l) = withMVar (listeners c) $ \ls -> H.insert ls uid l
81
removeListener c uid (Just l) = withMVar (listeners c) $ \ls -> H.insert ls uid l
81
false
false
0
8
15
46
22
24
null
null
romanb/amazonka
amazonka-route53/gen/Network/AWS/Route53/DisassociateVPCFromHostedZone.hs
mpl-2.0
-- | The VPC that you want your hosted zone to be disassociated from. dvpcfhzVPC :: Lens' DisassociateVPCFromHostedZone VPC dvpcfhzVPC = lens _dvpcfhzVPC (\s a -> s { _dvpcfhzVPC = a })
185
dvpcfhzVPC :: Lens' DisassociateVPCFromHostedZone VPC dvpcfhzVPC = lens _dvpcfhzVPC (\s a -> s { _dvpcfhzVPC = a })
115
dvpcfhzVPC = lens _dvpcfhzVPC (\s a -> s { _dvpcfhzVPC = a })
61
true
true
0
9
31
40
22
18
null
null
acowley/ghc
compiler/basicTypes/UniqSupply.hs
bsd-3-clause
lazyThenUs :: UniqSM a -> (a -> UniqSM b) -> UniqSM b lazyThenUs expr cont = USM (\us -> let (result, us') = liftUSM expr us in unUSM (cont result) us')
154
lazyThenUs :: UniqSM a -> (a -> UniqSM b) -> UniqSM b lazyThenUs expr cont = USM (\us -> let (result, us') = liftUSM expr us in unUSM (cont result) us')
154
lazyThenUs expr cont = USM (\us -> let (result, us') = liftUSM expr us in unUSM (cont result) us')
100
false
true
0
12
32
90
42
48
null
null
chaosim/peasy
coffee/samples/latex.hs
mit
grave c = [c]
15
grave c = [c]
15
grave c = [c]
15
false
false
1
5
5
15
6
9
null
null
Hara-Laboratory/subleq-toolchain
Language/Subleq/Assembly/Locate.hs
gpl-3.0
locate :: MemoryArchitecture m -> Integer -> Object -> Maybe (Object, Integer) locate ma i o@(Subroutine _ args es) = Just (substituteObject sub o, next) where (mp, next) = runState (locate' ma es) i sub = M.map A.Number $ M.unions [locateStatic ma, locateArg ma args, mp]
288
locate :: MemoryArchitecture m -> Integer -> Object -> Maybe (Object, Integer) locate ma i o@(Subroutine _ args es) = Just (substituteObject sub o, next) where (mp, next) = runState (locate' ma es) i sub = M.map A.Number $ M.unions [locateStatic ma, locateArg ma args, mp]
288
locate ma i o@(Subroutine _ args es) = Just (substituteObject sub o, next) where (mp, next) = runState (locate' ma es) i sub = M.map A.Number $ M.unions [locateStatic ma, locateArg ma args, mp]
209
false
true
0
9
61
135
68
67
null
null
gregwebs/haskell-sphinx-client
Text/Search/Sphinx/Indexable.hs
bsd-3-clause
attrType T.AttrTUInt = "int"
35
attrType T.AttrTUInt = "int"
35
attrType T.AttrTUInt = "int"
35
false
false
0
6
10
11
5
6
null
null
nevrenato/Hets_Fork
CSL/Keywords.hs
gpl-2.0
showtimeS :: String showtimeS = "showtime"
42
showtimeS :: String showtimeS = "showtime"
42
showtimeS = "showtime"
22
false
true
0
6
5
18
7
11
null
null
filib/ruby-marshal
src/Data/Ruby/Marshal/Encoding.hs
mit
toEnc "CP50221" = CP50221
44
toEnc "CP50221" = CP50221
44
toEnc "CP50221" = CP50221
44
false
false
0
5
22
9
4
5
null
null
luigy/stack
src/main/Main.hs
bsd-3-clause
execCmd :: ExecOpts -> GlobalOpts -> IO () execCmd ExecOpts {..} go@GlobalOpts{..} = case eoExtra of ExecOptsPlain -> do (cmd, args) <- case (eoCmd, eoArgs) of (ExecCmd cmd, args) -> return (cmd, args) (ExecGhc, args) -> return ("ghc", args) (ExecRunGhc, args) -> return ("runghc", args) (manager,lc) <- liftIO $ loadConfigWithOpts go withUserFileLock go (configStackRoot $ lcConfig lc) $ \lk -> runStackTGlobal manager (lcConfig lc) go $ Docker.reexecWithOptionalContainer (lcProjectRoot lc) -- Unlock before transferring control away, whether using docker or not: (Just $ munlockFile lk) (runStackTGlobal manager (lcConfig lc) go $ do config <- asks getConfig menv <- liftIO $ configEnvOverride config plainEnvSettings Nix.reexecWithOptionalShell (lcProjectRoot lc) globalResolver globalCompiler (runStackTGlobal manager (lcConfig lc) go $ exec menv cmd args)) Nothing Nothing -- Unlocked already above. ExecOptsEmbellished {..} -> withBuildConfigAndLock go $ \lk -> do config <- asks getConfig (cmd, args) <- case (eoCmd, eoArgs) of (ExecCmd cmd, args) -> return (cmd, args) (ExecGhc, args) -> execCompiler "" args -- NOTE: this won't currently work for GHCJS, because it doesn't have -- a runghcjs binary. It probably will someday, though. (ExecRunGhc, args) -> execCompiler "run" args let targets = concatMap words eoPackages unless (null targets) $ Stack.Build.build (const $ return ()) lk defaultBuildOpts { boptsTargets = map T.pack targets } munlockFile lk -- Unlock before transferring control away. menv <- liftIO $ configEnvOverride config eoEnvSettings exec menv cmd args where execCompiler cmdPrefix args = do wc <- getWhichCompiler let cmd = cmdPrefix ++ compilerExeName wc return (cmd, args) -- | Evaluate some haskell code inline.
2,529
execCmd :: ExecOpts -> GlobalOpts -> IO () execCmd ExecOpts {..} go@GlobalOpts{..} = case eoExtra of ExecOptsPlain -> do (cmd, args) <- case (eoCmd, eoArgs) of (ExecCmd cmd, args) -> return (cmd, args) (ExecGhc, args) -> return ("ghc", args) (ExecRunGhc, args) -> return ("runghc", args) (manager,lc) <- liftIO $ loadConfigWithOpts go withUserFileLock go (configStackRoot $ lcConfig lc) $ \lk -> runStackTGlobal manager (lcConfig lc) go $ Docker.reexecWithOptionalContainer (lcProjectRoot lc) -- Unlock before transferring control away, whether using docker or not: (Just $ munlockFile lk) (runStackTGlobal manager (lcConfig lc) go $ do config <- asks getConfig menv <- liftIO $ configEnvOverride config plainEnvSettings Nix.reexecWithOptionalShell (lcProjectRoot lc) globalResolver globalCompiler (runStackTGlobal manager (lcConfig lc) go $ exec menv cmd args)) Nothing Nothing -- Unlocked already above. ExecOptsEmbellished {..} -> withBuildConfigAndLock go $ \lk -> do config <- asks getConfig (cmd, args) <- case (eoCmd, eoArgs) of (ExecCmd cmd, args) -> return (cmd, args) (ExecGhc, args) -> execCompiler "" args -- NOTE: this won't currently work for GHCJS, because it doesn't have -- a runghcjs binary. It probably will someday, though. (ExecRunGhc, args) -> execCompiler "run" args let targets = concatMap words eoPackages unless (null targets) $ Stack.Build.build (const $ return ()) lk defaultBuildOpts { boptsTargets = map T.pack targets } munlockFile lk -- Unlock before transferring control away. menv <- liftIO $ configEnvOverride config eoEnvSettings exec menv cmd args where execCompiler cmdPrefix args = do wc <- getWhichCompiler let cmd = cmdPrefix ++ compilerExeName wc return (cmd, args) -- | Evaluate some haskell code inline.
2,529
execCmd ExecOpts {..} go@GlobalOpts{..} = case eoExtra of ExecOptsPlain -> do (cmd, args) <- case (eoCmd, eoArgs) of (ExecCmd cmd, args) -> return (cmd, args) (ExecGhc, args) -> return ("ghc", args) (ExecRunGhc, args) -> return ("runghc", args) (manager,lc) <- liftIO $ loadConfigWithOpts go withUserFileLock go (configStackRoot $ lcConfig lc) $ \lk -> runStackTGlobal manager (lcConfig lc) go $ Docker.reexecWithOptionalContainer (lcProjectRoot lc) -- Unlock before transferring control away, whether using docker or not: (Just $ munlockFile lk) (runStackTGlobal manager (lcConfig lc) go $ do config <- asks getConfig menv <- liftIO $ configEnvOverride config plainEnvSettings Nix.reexecWithOptionalShell (lcProjectRoot lc) globalResolver globalCompiler (runStackTGlobal manager (lcConfig lc) go $ exec menv cmd args)) Nothing Nothing -- Unlocked already above. ExecOptsEmbellished {..} -> withBuildConfigAndLock go $ \lk -> do config <- asks getConfig (cmd, args) <- case (eoCmd, eoArgs) of (ExecCmd cmd, args) -> return (cmd, args) (ExecGhc, args) -> execCompiler "" args -- NOTE: this won't currently work for GHCJS, because it doesn't have -- a runghcjs binary. It probably will someday, though. (ExecRunGhc, args) -> execCompiler "run" args let targets = concatMap words eoPackages unless (null targets) $ Stack.Build.build (const $ return ()) lk defaultBuildOpts { boptsTargets = map T.pack targets } munlockFile lk -- Unlock before transferring control away. menv <- liftIO $ configEnvOverride config eoEnvSettings exec menv cmd args where execCompiler cmdPrefix args = do wc <- getWhichCompiler let cmd = cmdPrefix ++ compilerExeName wc return (cmd, args) -- | Evaluate some haskell code inline.
2,486
false
true
1
23
1,033
604
299
305
null
null
JamesSullivan1/Minisculus
src/MinisculusParser.hs
mit
moreTerm ts = ((R17), ts)
30
moreTerm ts = ((R17), ts)
30
moreTerm ts = ((R17), ts)
30
false
false
1
6
9
21
10
11
null
null
edsko/hackage-server
tests/HighLevelTest.hs
bsd-3-clause
runUserTests :: IO () runUserTests = do do info "Getting user list" xs <- fmap (map userName) getUsers unless (xs == ["admin"]) $ die ("Bad user list: " ++ show xs) do info "Getting admin user list" xs <- getAdmins unless (map userName (groupMembers xs) == ["admin"]) $ die ("Bad admin user list: " ++ show xs) do -- For this test we just create the users directly using the admin -- interface, there's a separate test that tests the self-signup. createUserDirect (Auth "admin" "admin") "HackageTestUser1" "testpass1" createUserDirect (Auth "admin" "admin") "HackageTestUser2" "testpass2" do info "Checking new users are now in user list" xs <- fmap (map userName) getUsers unless (xs == ["admin","HackageTestUser1","HackageTestUser2"]) $ die ("Bad user list: " ++ show xs) do info "Checking new users are not in admin list" xs <- getAdmins unless (map userName (groupMembers xs) == ["admin"]) $ die ("Bad admin user list: " ++ show xs) do info "Getting password change page for HackageTestUser1" void $ validate (Auth "HackageTestUser1" "testpass1") "/user/HackageTestUser1/password" do info "Getting password change page for HackageTestUser1 as an admin" void $ validate (Auth "admin" "admin") "/user/HackageTestUser1/password" do info "Getting password change page for HackageTestUser1 as another user" checkIsForbidden (Auth "HackageTestUser2" "testpass2") "/user/HackageTestUser1/password" do info "Getting password change page for HackageTestUser1 with bad password" checkIsUnauthorized (Auth "HackageTestUser1" "badpass") "/user/HackageTestUser1/password" do info "Getting password change page for HackageTestUser1 with bad username" checkIsUnauthorized (Auth "baduser" "testpass1") "/user/HackageTestUser1/password" do info "Changing password for HackageTestUser2" post (Auth "HackageTestUser2" "testpass2") "/user/HackageTestUser2/password" [ ("password", "newtestpass2") , ("repeat-password", "newtestpass2") , ("_method", "PUT") ] do info "Checking password has changed" void $ validate (Auth "HackageTestUser2" "newtestpass2") "/user/HackageTestUser2/password" checkIsUnauthorized (Auth "HackageTestUser2" "testpass2") "/user/HackageTestUser2/password" do info "Trying to delete HackageTestUser2 as HackageTestUser2" delete isForbidden (Auth "HackageTestUser2" "newtestpass2") "/user/HackageTestUser2" xs <- fmap (map userName) getUsers unless (xs == ["admin","HackageTestUser1","HackageTestUser2"]) $ die ("Bad user list: " ++ show xs) do info "Deleting HackageTestUser2 as admin" delete isNoContent (Auth "admin" "admin") "/user/HackageTestUser2" xs <- fmap (map userName) getUsers unless (xs == ["admin","HackageTestUser1"]) $ die ("Bad user list: " ++ show xs) do info "Getting user info for HackageTestUser1" xs <- validate NoAuth "/user/HackageTestUser1" --TODO: set the user's real name, and then look for that here unless ("HackageTestUser1" `isInfixOf` xs) $ die ("Bad user info: " ++ show xs)
3,300
runUserTests :: IO () runUserTests = do do info "Getting user list" xs <- fmap (map userName) getUsers unless (xs == ["admin"]) $ die ("Bad user list: " ++ show xs) do info "Getting admin user list" xs <- getAdmins unless (map userName (groupMembers xs) == ["admin"]) $ die ("Bad admin user list: " ++ show xs) do -- For this test we just create the users directly using the admin -- interface, there's a separate test that tests the self-signup. createUserDirect (Auth "admin" "admin") "HackageTestUser1" "testpass1" createUserDirect (Auth "admin" "admin") "HackageTestUser2" "testpass2" do info "Checking new users are now in user list" xs <- fmap (map userName) getUsers unless (xs == ["admin","HackageTestUser1","HackageTestUser2"]) $ die ("Bad user list: " ++ show xs) do info "Checking new users are not in admin list" xs <- getAdmins unless (map userName (groupMembers xs) == ["admin"]) $ die ("Bad admin user list: " ++ show xs) do info "Getting password change page for HackageTestUser1" void $ validate (Auth "HackageTestUser1" "testpass1") "/user/HackageTestUser1/password" do info "Getting password change page for HackageTestUser1 as an admin" void $ validate (Auth "admin" "admin") "/user/HackageTestUser1/password" do info "Getting password change page for HackageTestUser1 as another user" checkIsForbidden (Auth "HackageTestUser2" "testpass2") "/user/HackageTestUser1/password" do info "Getting password change page for HackageTestUser1 with bad password" checkIsUnauthorized (Auth "HackageTestUser1" "badpass") "/user/HackageTestUser1/password" do info "Getting password change page for HackageTestUser1 with bad username" checkIsUnauthorized (Auth "baduser" "testpass1") "/user/HackageTestUser1/password" do info "Changing password for HackageTestUser2" post (Auth "HackageTestUser2" "testpass2") "/user/HackageTestUser2/password" [ ("password", "newtestpass2") , ("repeat-password", "newtestpass2") , ("_method", "PUT") ] do info "Checking password has changed" void $ validate (Auth "HackageTestUser2" "newtestpass2") "/user/HackageTestUser2/password" checkIsUnauthorized (Auth "HackageTestUser2" "testpass2") "/user/HackageTestUser2/password" do info "Trying to delete HackageTestUser2 as HackageTestUser2" delete isForbidden (Auth "HackageTestUser2" "newtestpass2") "/user/HackageTestUser2" xs <- fmap (map userName) getUsers unless (xs == ["admin","HackageTestUser1","HackageTestUser2"]) $ die ("Bad user list: " ++ show xs) do info "Deleting HackageTestUser2 as admin" delete isNoContent (Auth "admin" "admin") "/user/HackageTestUser2" xs <- fmap (map userName) getUsers unless (xs == ["admin","HackageTestUser1"]) $ die ("Bad user list: " ++ show xs) do info "Getting user info for HackageTestUser1" xs <- validate NoAuth "/user/HackageTestUser1" --TODO: set the user's real name, and then look for that here unless ("HackageTestUser1" `isInfixOf` xs) $ die ("Bad user info: " ++ show xs)
3,300
runUserTests = do do info "Getting user list" xs <- fmap (map userName) getUsers unless (xs == ["admin"]) $ die ("Bad user list: " ++ show xs) do info "Getting admin user list" xs <- getAdmins unless (map userName (groupMembers xs) == ["admin"]) $ die ("Bad admin user list: " ++ show xs) do -- For this test we just create the users directly using the admin -- interface, there's a separate test that tests the self-signup. createUserDirect (Auth "admin" "admin") "HackageTestUser1" "testpass1" createUserDirect (Auth "admin" "admin") "HackageTestUser2" "testpass2" do info "Checking new users are now in user list" xs <- fmap (map userName) getUsers unless (xs == ["admin","HackageTestUser1","HackageTestUser2"]) $ die ("Bad user list: " ++ show xs) do info "Checking new users are not in admin list" xs <- getAdmins unless (map userName (groupMembers xs) == ["admin"]) $ die ("Bad admin user list: " ++ show xs) do info "Getting password change page for HackageTestUser1" void $ validate (Auth "HackageTestUser1" "testpass1") "/user/HackageTestUser1/password" do info "Getting password change page for HackageTestUser1 as an admin" void $ validate (Auth "admin" "admin") "/user/HackageTestUser1/password" do info "Getting password change page for HackageTestUser1 as another user" checkIsForbidden (Auth "HackageTestUser2" "testpass2") "/user/HackageTestUser1/password" do info "Getting password change page for HackageTestUser1 with bad password" checkIsUnauthorized (Auth "HackageTestUser1" "badpass") "/user/HackageTestUser1/password" do info "Getting password change page for HackageTestUser1 with bad username" checkIsUnauthorized (Auth "baduser" "testpass1") "/user/HackageTestUser1/password" do info "Changing password for HackageTestUser2" post (Auth "HackageTestUser2" "testpass2") "/user/HackageTestUser2/password" [ ("password", "newtestpass2") , ("repeat-password", "newtestpass2") , ("_method", "PUT") ] do info "Checking password has changed" void $ validate (Auth "HackageTestUser2" "newtestpass2") "/user/HackageTestUser2/password" checkIsUnauthorized (Auth "HackageTestUser2" "testpass2") "/user/HackageTestUser2/password" do info "Trying to delete HackageTestUser2 as HackageTestUser2" delete isForbidden (Auth "HackageTestUser2" "newtestpass2") "/user/HackageTestUser2" xs <- fmap (map userName) getUsers unless (xs == ["admin","HackageTestUser1","HackageTestUser2"]) $ die ("Bad user list: " ++ show xs) do info "Deleting HackageTestUser2 as admin" delete isNoContent (Auth "admin" "admin") "/user/HackageTestUser2" xs <- fmap (map userName) getUsers unless (xs == ["admin","HackageTestUser1"]) $ die ("Bad user list: " ++ show xs) do info "Getting user info for HackageTestUser1" xs <- validate NoAuth "/user/HackageTestUser1" --TODO: set the user's real name, and then look for that here unless ("HackageTestUser1" `isInfixOf` xs) $ die ("Bad user info: " ++ show xs)
3,278
false
true
0
15
758
754
342
412
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
intDataConKey = mkPreludeDataConUnique 6
67
intDataConKey = mkPreludeDataConUnique 6
67
intDataConKey = mkPreludeDataConUnique 6
67
false
false
0
5
30
9
4
5
null
null
alphaHeavy/cabal
cabal-install/Distribution/Client/Dependency/Modular/Preference.hs
bsd-3-clause
processPackageConstraintP _ _ _ r = r
73
processPackageConstraintP _ _ _ r = r
73
processPackageConstraintP _ _ _ r = r
73
false
false
0
5
42
15
7
8
null
null
cimmanon/camellia-splices
Heist/Splices/Camellia/Visibility.hs
bsd-3-clause
toggleSpliceWith False _ b = b
30
toggleSpliceWith False _ b = b
30
toggleSpliceWith False _ b = b
30
false
false
0
5
5
13
6
7
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/Types.hs
lgpl-2.1
pointSub :: (Num a) => Point2 a -> Point2 a -> Point2 a pointSub (Point x1 y1) (Point x2 y2) = Point (x1-x2) (y1-y2)
116
pointSub :: (Num a) => Point2 a -> Point2 a -> Point2 a pointSub (Point x1 y1) (Point x2 y2) = Point (x1-x2) (y1-y2)
116
pointSub (Point x1 y1) (Point x2 y2) = Point (x1-x2) (y1-y2)
60
false
true
0
8
23
77
38
39
null
null
rrnewton/accelerate
Data/Array/Accelerate/Language.hs
bsd-3-clause
-- |Inequality lifted into Accelerate expressions. -- (/=*) :: (Elt t, IsScalar t) => Exp t -> Exp t -> Exp Bool (/=*) = mkNEq
126
(/=*) :: (Elt t, IsScalar t) => Exp t -> Exp t -> Exp Bool (/=*) = mkNEq
72
(/=*) = mkNEq
13
true
true
0
9
24
55
28
27
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/MobileCarriers/Get.hs
mpl-2.0
-- | Creates a value of 'MobileCarriersGet' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'mcgXgafv' -- -- * 'mcgUploadProtocol' -- -- * 'mcgAccessToken' -- -- * 'mcgUploadType' -- -- * 'mcgProFileId' -- -- * 'mcgId' -- -- * 'mcgCallback' mobileCarriersGet :: Int64 -- ^ 'mcgProFileId' -> Int64 -- ^ 'mcgId' -> MobileCarriersGet mobileCarriersGet pMcgProFileId_ pMcgId_ = MobileCarriersGet' { _mcgXgafv = Nothing , _mcgUploadProtocol = Nothing , _mcgAccessToken = Nothing , _mcgUploadType = Nothing , _mcgProFileId = _Coerce # pMcgProFileId_ , _mcgId = _Coerce # pMcgId_ , _mcgCallback = Nothing }
730
mobileCarriersGet :: Int64 -- ^ 'mcgProFileId' -> Int64 -- ^ 'mcgId' -> MobileCarriersGet mobileCarriersGet pMcgProFileId_ pMcgId_ = MobileCarriersGet' { _mcgXgafv = Nothing , _mcgUploadProtocol = Nothing , _mcgAccessToken = Nothing , _mcgUploadType = Nothing , _mcgProFileId = _Coerce # pMcgProFileId_ , _mcgId = _Coerce # pMcgId_ , _mcgCallback = Nothing }
404
mobileCarriersGet pMcgProFileId_ pMcgId_ = MobileCarriersGet' { _mcgXgafv = Nothing , _mcgUploadProtocol = Nothing , _mcgAccessToken = Nothing , _mcgUploadType = Nothing , _mcgProFileId = _Coerce # pMcgProFileId_ , _mcgId = _Coerce # pMcgId_ , _mcgCallback = Nothing }
302
true
true
0
8
154
104
66
38
null
null
jsavatgy/talvipaivanseisauksen-ajanlasku
bmt-year.hs
gpl-3.0
getYear t = year where (year, month, day) = toGregorian (localDay (zonedTimeToLocalTime t))
95
getYear t = year where (year, month, day) = toGregorian (localDay (zonedTimeToLocalTime t))
95
getYear t = year where (year, month, day) = toGregorian (localDay (zonedTimeToLocalTime t))
95
false
false
1
9
16
45
21
24
null
null
vTurbine/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
isAtomicHsExpr (HsWrap _ e) = isAtomicHsExpr e
51
isAtomicHsExpr (HsWrap _ e) = isAtomicHsExpr e
51
isAtomicHsExpr (HsWrap _ e) = isAtomicHsExpr e
51
false
false
0
6
11
21
9
12
null
null
jkoppel/compstrat
examples/Examples/Multi/Main.hs
bsd-3-clause
prog1 :: ProgLab ExpL prog1 = iAPair 2 (iAConst 0 2) (iAConst 1 3)
66
prog1 :: ProgLab ExpL prog1 = iAPair 2 (iAConst 0 2) (iAConst 1 3)
66
prog1 = iAPair 2 (iAConst 0 2) (iAConst 1 3)
44
false
true
1
7
13
40
18
22
null
null
tonyfloatersu/solution-haskell-craft-of-FP
Chapter_7_my_note.hs
mit
or' :: [Bool] -> Bool or' (x : xs) = x || or' xs
51
or' :: [Bool] -> Bool or' (x : xs) = x || or' xs
51
or' (x : xs) = x || or' xs
29
false
true
1
9
16
41
19
22
null
null
guoy34/ampersand
src/Database/Design/Ampersand/FSpec/Switchboard.hs
gpl-3.0
switchboardAct :: FSpec -> Activity -> SwitchBdDiagram switchboardAct fSpec act = SBdgrm { sbName = name act , sbdotGraph = DotGraph { strictGraph = False , directedGraph = True , graphID = Just (Str (fromString "Switchboard")) , graphStatements = DotStmts { attrStmts = [GraphAttrs [Splines SplineEdges, RankDir FromLeft]] , subGraphs = [] , nodeStmts = inMorNodes++conjunctNodes++outMorNodes , edgeStmts = edgesIn++edgesOut } } } where fromRels = nub (actTrig act) toRels :: [Declaration] toRels = nub (actAffect act) conjuncts = nub [ (qRule q,expr) | q<-actQuads act, expr<-(map rc_conjunct . qConjuncts) q] --DESCR -> The relations from which changes can come inMorNodes = [ DotNode { nodeID = nameINode fromRels r , nodeAttributes = [Label (StrLabel (fromString (showADL r)))] } | r<-fromRels --TODOHAN , (not.null) [e |e<-edgesIn, (nodeID (fromNode e))==nameINode fromRels r] ] --DESCR -> The relations to which changes are made outMorNodes = [ DotNode { nodeID = nameONode toRels r , nodeAttributes = [Label (StrLabel (fromString (showADL r)))] } | r<-toRels --TODOHAN , (not.null) [e |e<-edgesOut, (nodeID . toNode) e==nameONode toRels r ] ] --DESCR -> All conjuncts conjunctNodes = [ DotNode { nodeID = nameCNode conjuncts (rul,c) , nodeAttributes = [Style [SItem Filled []], FillColor [WC(X11Color (colorRule rul))Nothing], Label (StrLabel (fromString (name rul)))] } | (rul,c)<-conjuncts] --DESCR -> Each edge represents an insert between a relation on the left and a term on the right to which the relation contributes to an insert. edgesIn = [ DotEdge { fromNode = nameINode fromRels r , toNode = nameCNode conjuncts (rul,c) , edgeAttributes = [Label (StrLabel (fromString (if or (positiveIn c r) then "-" else if or [not b |b<-positiveIn c r] then "+" else "+-"))) ,Dir Forward] } | (rul,c)<-conjuncts, r<-relsUsedIn c, r `elem` fromRels] edgesOut = [ DotEdge { fromNode = nameCNode conjuncts (rul,c) , toNode = nameONode toRels r , edgeAttributes = [Label (StrLabel (fromString (if or (positiveIn c r) then "+" else if or [not b |b<-positiveIn c r] then "-" else "+-"))) ,Dir Forward] } | (rul,c)<-conjuncts, r<-relsUsedIn c] nameINode :: [Declaration] -> Declaration -> String nameINode = nmLkp fSpec "in_" nameCNode = nmLkp fSpec "cj_" nameONode :: [Declaration] -> Declaration -> String nameONode = nmLkp fSpec "out_"
3,890
switchboardAct :: FSpec -> Activity -> SwitchBdDiagram switchboardAct fSpec act = SBdgrm { sbName = name act , sbdotGraph = DotGraph { strictGraph = False , directedGraph = True , graphID = Just (Str (fromString "Switchboard")) , graphStatements = DotStmts { attrStmts = [GraphAttrs [Splines SplineEdges, RankDir FromLeft]] , subGraphs = [] , nodeStmts = inMorNodes++conjunctNodes++outMorNodes , edgeStmts = edgesIn++edgesOut } } } where fromRels = nub (actTrig act) toRels :: [Declaration] toRels = nub (actAffect act) conjuncts = nub [ (qRule q,expr) | q<-actQuads act, expr<-(map rc_conjunct . qConjuncts) q] --DESCR -> The relations from which changes can come inMorNodes = [ DotNode { nodeID = nameINode fromRels r , nodeAttributes = [Label (StrLabel (fromString (showADL r)))] } | r<-fromRels --TODOHAN , (not.null) [e |e<-edgesIn, (nodeID (fromNode e))==nameINode fromRels r] ] --DESCR -> The relations to which changes are made outMorNodes = [ DotNode { nodeID = nameONode toRels r , nodeAttributes = [Label (StrLabel (fromString (showADL r)))] } | r<-toRels --TODOHAN , (not.null) [e |e<-edgesOut, (nodeID . toNode) e==nameONode toRels r ] ] --DESCR -> All conjuncts conjunctNodes = [ DotNode { nodeID = nameCNode conjuncts (rul,c) , nodeAttributes = [Style [SItem Filled []], FillColor [WC(X11Color (colorRule rul))Nothing], Label (StrLabel (fromString (name rul)))] } | (rul,c)<-conjuncts] --DESCR -> Each edge represents an insert between a relation on the left and a term on the right to which the relation contributes to an insert. edgesIn = [ DotEdge { fromNode = nameINode fromRels r , toNode = nameCNode conjuncts (rul,c) , edgeAttributes = [Label (StrLabel (fromString (if or (positiveIn c r) then "-" else if or [not b |b<-positiveIn c r] then "+" else "+-"))) ,Dir Forward] } | (rul,c)<-conjuncts, r<-relsUsedIn c, r `elem` fromRels] edgesOut = [ DotEdge { fromNode = nameCNode conjuncts (rul,c) , toNode = nameONode toRels r , edgeAttributes = [Label (StrLabel (fromString (if or (positiveIn c r) then "+" else if or [not b |b<-positiveIn c r] then "-" else "+-"))) ,Dir Forward] } | (rul,c)<-conjuncts, r<-relsUsedIn c] nameINode :: [Declaration] -> Declaration -> String nameINode = nmLkp fSpec "in_" nameCNode = nmLkp fSpec "cj_" nameONode :: [Declaration] -> Declaration -> String nameONode = nmLkp fSpec "out_"
3,890
switchboardAct fSpec act = SBdgrm { sbName = name act , sbdotGraph = DotGraph { strictGraph = False , directedGraph = True , graphID = Just (Str (fromString "Switchboard")) , graphStatements = DotStmts { attrStmts = [GraphAttrs [Splines SplineEdges, RankDir FromLeft]] , subGraphs = [] , nodeStmts = inMorNodes++conjunctNodes++outMorNodes , edgeStmts = edgesIn++edgesOut } } } where fromRels = nub (actTrig act) toRels :: [Declaration] toRels = nub (actAffect act) conjuncts = nub [ (qRule q,expr) | q<-actQuads act, expr<-(map rc_conjunct . qConjuncts) q] --DESCR -> The relations from which changes can come inMorNodes = [ DotNode { nodeID = nameINode fromRels r , nodeAttributes = [Label (StrLabel (fromString (showADL r)))] } | r<-fromRels --TODOHAN , (not.null) [e |e<-edgesIn, (nodeID (fromNode e))==nameINode fromRels r] ] --DESCR -> The relations to which changes are made outMorNodes = [ DotNode { nodeID = nameONode toRels r , nodeAttributes = [Label (StrLabel (fromString (showADL r)))] } | r<-toRels --TODOHAN , (not.null) [e |e<-edgesOut, (nodeID . toNode) e==nameONode toRels r ] ] --DESCR -> All conjuncts conjunctNodes = [ DotNode { nodeID = nameCNode conjuncts (rul,c) , nodeAttributes = [Style [SItem Filled []], FillColor [WC(X11Color (colorRule rul))Nothing], Label (StrLabel (fromString (name rul)))] } | (rul,c)<-conjuncts] --DESCR -> Each edge represents an insert between a relation on the left and a term on the right to which the relation contributes to an insert. edgesIn = [ DotEdge { fromNode = nameINode fromRels r , toNode = nameCNode conjuncts (rul,c) , edgeAttributes = [Label (StrLabel (fromString (if or (positiveIn c r) then "-" else if or [not b |b<-positiveIn c r] then "+" else "+-"))) ,Dir Forward] } | (rul,c)<-conjuncts, r<-relsUsedIn c, r `elem` fromRels] edgesOut = [ DotEdge { fromNode = nameCNode conjuncts (rul,c) , toNode = nameONode toRels r , edgeAttributes = [Label (StrLabel (fromString (if or (positiveIn c r) then "+" else if or [not b |b<-positiveIn c r] then "-" else "+-"))) ,Dir Forward] } | (rul,c)<-conjuncts, r<-relsUsedIn c] nameINode :: [Declaration] -> Declaration -> String nameINode = nmLkp fSpec "in_" nameCNode = nmLkp fSpec "cj_" nameONode :: [Declaration] -> Declaration -> String nameONode = nmLkp fSpec "out_"
3,835
false
true
12
22
1,916
828
447
381
null
null
gspia/reflex-dom-htmlea
lib/src/Reflex/Dom/HTML5/Component/Table/ActElem.hs
bsd-3-clause
sameColAE (ActEcols j) (ActEcolh k) = j == k
46
sameColAE (ActEcols j) (ActEcolh k) = j == k
46
sameColAE (ActEcols j) (ActEcolh k) = j == k
46
false
false
0
7
10
27
13
14
null
null
brendanhay/gogol
gogol-cloudprivatecatalogproducer/gen/Network/Google/CloudPrivateCatalogProducer/Types/Product.hs
mpl-2.0
-- | Creates a value of 'GoogleProtobufEmpty' with the minimum fields required to make a request. -- googleProtobufEmpty :: GoogleProtobufEmpty googleProtobufEmpty = GoogleProtobufEmpty'
190
googleProtobufEmpty :: GoogleProtobufEmpty googleProtobufEmpty = GoogleProtobufEmpty'
89
googleProtobufEmpty = GoogleProtobufEmpty'
42
true
true
0
6
26
20
9
11
null
null
ekmett/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_F_CONTINUATION :: Int wxSTC_F_CONTINUATION = 14
53
wxSTC_F_CONTINUATION :: Int wxSTC_F_CONTINUATION = 14
53
wxSTC_F_CONTINUATION = 14
25
false
true
0
6
5
18
7
11
null
null
dcreager/cabal
Distribution/Simple/Command.hs
bsd-3-clause
noExtraFlags :: [String] -> IO () noExtraFlags [] = return ()
61
noExtraFlags :: [String] -> IO () noExtraFlags [] = return ()
61
noExtraFlags [] = return ()
27
false
true
0
7
10
33
16
17
null
null
martindavid/code-sandbox
comp90048/assignments/project1/attempt2/HaskellTest.hs
mit
timeoutTime :: Maybe Double -> Int timeoutTime Nothing = (-1)
61
timeoutTime :: Maybe Double -> Int timeoutTime Nothing = (-1)
61
timeoutTime Nothing = (-1)
26
false
true
0
6
9
26
13
13
null
null
jutaro/rdf4h
testsuite/tests/Text/RDF/RDF4H/TurtleParser_ConformanceTest.hs
bsd-3-clause
loadInputGraph1 :: String -> String -> IO (Either ParseFailure TriplesList) loadInputGraph1 dir fname = TIO.readFile (printf "%s/%s.ttl" dir fname :: String) >>= return . parseString (TurtleParser mtestBaseUri (mkDocUrl1 testBaseUri fname)) >>= return . handleLoad
268
loadInputGraph1 :: String -> String -> IO (Either ParseFailure TriplesList) loadInputGraph1 dir fname = TIO.readFile (printf "%s/%s.ttl" dir fname :: String) >>= return . parseString (TurtleParser mtestBaseUri (mkDocUrl1 testBaseUri fname)) >>= return . handleLoad
268
loadInputGraph1 dir fname = TIO.readFile (printf "%s/%s.ttl" dir fname :: String) >>= return . parseString (TurtleParser mtestBaseUri (mkDocUrl1 testBaseUri fname)) >>= return . handleLoad
192
false
true
1
10
37
94
44
50
null
null
Mathnerd314/lamdu
src/Lamdu/CodeEdit/Sugar/AddNames.hs
gpl-3.0
p1WithEnv :: (P1Env -> P1Env) -> Pass1M a -> Pass1M a p1WithEnv f (Pass1M act) = Pass1M $ Reader.local f act
108
p1WithEnv :: (P1Env -> P1Env) -> Pass1M a -> Pass1M a p1WithEnv f (Pass1M act) = Pass1M $ Reader.local f act
108
p1WithEnv f (Pass1M act) = Pass1M $ Reader.local f act
54
false
true
0
7
20
59
27
32
null
null
jeannekamikaze/Spear
Spear/Math/Plane.hs
mit
-- | Construct a plane from three points. -- -- Points must be given in counter-clockwise order. fromPoints :: Vector3 -> Vector3 -> Vector3 -> Plane fromPoints p0 p1 p2 = Plane n d where n = normalise $ v1 `cross` v2 v1 = p2 - p1 v2 = p0 - p1 d = p0 `dot` n -- | Classify the given point's relative position with respect to the plane.
410
fromPoints :: Vector3 -> Vector3 -> Vector3 -> Plane fromPoints p0 p1 p2 = Plane n d where n = normalise $ v1 `cross` v2 v1 = p2 - p1 v2 = p0 - p1 d = p0 `dot` n -- | Classify the given point's relative position with respect to the plane.
309
fromPoints p0 p1 p2 = Plane n d where n = normalise $ v1 `cross` v2 v1 = p2 - p1 v2 = p0 - p1 d = p0 `dot` n -- | Classify the given point's relative position with respect to the plane.
256
true
true
0
8
144
85
48
37
null
null
libscott/hawk
src/HSL/Json.hs
bsd-3-clause
json2 :: (FromJSON a, FromJSON b) => (a, b) -> T.Text -> T.Text -> [T.Text] -> [(a, b)] json2 _ q1 q2 = jsonN cast [q1, q2] where cast [v1, v2] = (,) <$> fromJSON v1 <*> fromJSON v2
194
json2 :: (FromJSON a, FromJSON b) => (a, b) -> T.Text -> T.Text -> [T.Text] -> [(a, b)] json2 _ q1 q2 = jsonN cast [q1, q2] where cast [v1, v2] = (,) <$> fromJSON v1 <*> fromJSON v2
194
json2 _ q1 q2 = jsonN cast [q1, q2] where cast [v1, v2] = (,) <$> fromJSON v1 <*> fromJSON v2
97
false
true
2
13
51
126
64
62
null
null
msullivan/advent-of-code
2015/A24a.hs
mit
partitions cost xs = do l <- subsequences xs guard $ sum l == cost return (l, xs \\ l)
98
partitions cost xs = do l <- subsequences xs guard $ sum l == cost return (l, xs \\ l)
98
partitions cost xs = do l <- subsequences xs guard $ sum l == cost return (l, xs \\ l)
98
false
false
0
9
31
51
23
28
null
null
trskop/cabal
Cabal/Distribution/Simple/Haddock.hs
bsd-3-clause
getInterfaces :: Verbosity -> LocalBuildInfo -> ComponentLocalBuildInfo -> Maybe PathTemplate -- ^ template for HTML location -> IO HaddockArgs getInterfaces verbosity lbi clbi htmlTemplate = do (packageFlags, warnings) <- haddockPackageFlags lbi clbi htmlTemplate traverse_ (warn verbosity) warnings return $ mempty { argInterfaces = packageFlags }
449
getInterfaces :: Verbosity -> LocalBuildInfo -> ComponentLocalBuildInfo -> Maybe PathTemplate -- ^ template for HTML location -> IO HaddockArgs getInterfaces verbosity lbi clbi htmlTemplate = do (packageFlags, warnings) <- haddockPackageFlags lbi clbi htmlTemplate traverse_ (warn verbosity) warnings return $ mempty { argInterfaces = packageFlags }
449
getInterfaces verbosity lbi clbi htmlTemplate = do (packageFlags, warnings) <- haddockPackageFlags lbi clbi htmlTemplate traverse_ (warn verbosity) warnings return $ mempty { argInterfaces = packageFlags }
249
false
true
0
10
144
97
46
51
null
null
xcv-/LCC
lib/Data/TaggedTree.hs
gpl-3.0
_SingleLeaf :: Prism' (TaggedTree tag a) a _SingleLeaf = _Leaf._Single
70
_SingleLeaf :: Prism' (TaggedTree tag a) a _SingleLeaf = _Leaf._Single
70
_SingleLeaf = _Leaf._Single
27
false
true
0
7
9
26
13
13
null
null
rawlep/EQS
esit2.hs
mit
------------------------------------------------------------------------- --- Some Arithmetic operations ------------------------------------------------------------------------- -- grouping group :: Expr -> Expr group (Add l (Add ll r)) | isVar r && isVar ll = Add (add $ Add r ll) (group l) | isVar r = Add r (group $ Add l ll) | isVar ll = Add ll (group $ Add l r) | isVal l && isVal ll = Add (group r) $ Add l ll | isVal l = Add (group $ Add ll r) l | isVal ll = Add (group $ Add l r) ll | otherwise = Add (group l) (group $ Add ll r)
814
group :: Expr -> Expr group (Add l (Add ll r)) | isVar r && isVar ll = Add (add $ Add r ll) (group l) | isVar r = Add r (group $ Add l ll) | isVar ll = Add ll (group $ Add l r) | isVal l && isVal ll = Add (group r) $ Add l ll | isVal l = Add (group $ Add ll r) l | isVal ll = Add (group $ Add l r) ll | otherwise = Add (group l) (group $ Add ll r)
623
group (Add l (Add ll r)) | isVar r && isVar ll = Add (add $ Add r ll) (group l) | isVar r = Add r (group $ Add l ll) | isVar ll = Add ll (group $ Add l r) | isVal l && isVal ll = Add (group r) $ Add l ll | isVal l = Add (group $ Add ll r) l | isVal ll = Add (group $ Add l r) ll | otherwise = Add (group l) (group $ Add ll r)
601
true
true
5
11
378
259
123
136
null
null
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Resource/Healthcare/Projects/Locations/DataSets/FhirStores/Fhir/Patch.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). pldsfsfpUploadType :: Lens' ProjectsLocationsDataSetsFhirStoresFhirPatch (Maybe Text) pldsfsfpUploadType = lens _pldsfsfpUploadType (\ s a -> s{_pldsfsfpUploadType = a})
248
pldsfsfpUploadType :: Lens' ProjectsLocationsDataSetsFhirStoresFhirPatch (Maybe Text) pldsfsfpUploadType = lens _pldsfsfpUploadType (\ s a -> s{_pldsfsfpUploadType = a})
177
pldsfsfpUploadType = lens _pldsfsfpUploadType (\ s a -> s{_pldsfsfpUploadType = a})
91
true
true
1
9
34
52
25
27
null
null
a143753/AOJ
3065.hs
apache-2.0
main = do _ <- getLine c <- getContents let i = map (map read) $ map words $ lines c :: [[Int]] (a,b) = ans (1,0) i putStrLn $ unwords $ map show $ [-b, a]
184
main = do _ <- getLine c <- getContents let i = map (map read) $ map words $ lines c :: [[Int]] (a,b) = ans (1,0) i putStrLn $ unwords $ map show $ [-b, a]
184
main = do _ <- getLine c <- getContents let i = map (map read) $ map words $ lines c :: [[Int]] (a,b) = ans (1,0) i putStrLn $ unwords $ map show $ [-b, a]
184
false
false
1
14
65
114
55
59
null
null
ezyang/ghc
compiler/types/Coercion.hs
bsd-3-clause
seqCo (InstCo co arg) = seqCo co `seq` seqCo arg
58
seqCo (InstCo co arg) = seqCo co `seq` seqCo arg
58
seqCo (InstCo co arg) = seqCo co `seq` seqCo arg
58
false
false
0
7
19
29
14
15
null
null
IreneKnapp/Faction
faction/Distribution/Client/InstallPlan.hs
bsd-3-clause
checkConfiguredPackage :: PlanPackage -> Maybe ConfiguredPackage checkConfiguredPackage (Configured pkg) = Just pkg
115
checkConfiguredPackage :: PlanPackage -> Maybe ConfiguredPackage checkConfiguredPackage (Configured pkg) = Just pkg
115
checkConfiguredPackage (Configured pkg) = Just pkg
50
false
true
0
7
11
30
14
16
null
null
notogawa/haiji
src/Text/Haiji/Syntax/Filter.hs
bsd-3-clause
filterAbs :: Parser Filter filterAbs = string "abs" *> return FilterAbs
71
filterAbs :: Parser Filter filterAbs = string "abs" *> return FilterAbs
71
filterAbs = string "abs" *> return FilterAbs
44
false
true
0
6
10
29
12
17
null
null
mrlovre/super-memory
Pro6/src/Utility.hs
gpl-3.0
meshGrid :: [a] -> [a] -> [(a, a)] meshGrid xs ys = concatMap ((`zip` ys) . repeat) xs
86
meshGrid :: [a] -> [a] -> [(a, a)] meshGrid xs ys = concatMap ((`zip` ys) . repeat) xs
86
meshGrid xs ys = concatMap ((`zip` ys) . repeat) xs
51
false
true
0
8
17
57
33
24
null
null
ozgurakgun/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
tcname (SN (InstanceN _ _)) = True
34
tcname (SN (InstanceN _ _)) = True
34
tcname (SN (InstanceN _ _)) = True
34
false
false
0
8
6
24
11
13
null
null
Crazycolorz5/AlgebraicPrelude
DataTypes/List.hs
mit
null [] = True
14
null [] = True
14
null [] = True
14
false
false
0
6
3
11
5
6
null
null
tjakway/ghcjvm
compiler/basicTypes/Id.hs
bsd-3-clause
idCallArity :: Id -> Arity idCallArity id = callArityInfo (idInfo id)
69
idCallArity :: Id -> Arity idCallArity id = callArityInfo (idInfo id)
69
idCallArity id = callArityInfo (idInfo id)
42
false
true
0
7
10
33
14
19
null
null
mbelicki/valdemar
src/Compiler.hs
gpl-3.0
getFileType :: String -> Maybe FileType getFileType filename = Map.foldrWithKey f Nothing fileExtensions where f :: FileType -> String -> Maybe FileType -> Maybe FileType f filetype extension Nothing = if extension `List.isSuffixOf` filename then Just filetype else Nothing f _ _ something = something
406
getFileType :: String -> Maybe FileType getFileType filename = Map.foldrWithKey f Nothing fileExtensions where f :: FileType -> String -> Maybe FileType -> Maybe FileType f filetype extension Nothing = if extension `List.isSuffixOf` filename then Just filetype else Nothing f _ _ something = something
406
getFileType filename = Map.foldrWithKey f Nothing fileExtensions where f :: FileType -> String -> Maybe FileType -> Maybe FileType f filetype extension Nothing = if extension `List.isSuffixOf` filename then Just filetype else Nothing f _ _ something = something
366
false
true
0
10
149
98
49
49
null
null
spacekitteh/smcghc
utils/hpc/HpcMarkup.hs
bsd-3-clause
------------------------------------------------------------------------------ markup_options :: FlagOptSeq markup_options = excludeOpt . includeOpt . srcDirOpt . hpcDirOpt . resetHpcDirsOpt . funTotalsOpt . altHighlightOpt . destDirOpt
301
markup_options :: FlagOptSeq markup_options = excludeOpt . includeOpt . srcDirOpt . hpcDirOpt . resetHpcDirsOpt . funTotalsOpt . altHighlightOpt . destDirOpt
221
markup_options = excludeOpt . includeOpt . srcDirOpt . hpcDirOpt . resetHpcDirsOpt . funTotalsOpt . altHighlightOpt . destDirOpt
192
true
true
0
11
85
40
21
19
null
null
holzensp/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
-- These PrimOps are NOPs in Cmm nopOp :: PrimOp -> Bool nopOp Int2WordOp = True
85
nopOp :: PrimOp -> Bool nopOp Int2WordOp = True
51
nopOp Int2WordOp = True
27
true
true
0
5
20
19
10
9
null
null
jwaldmann/streams
Main.hs
gpl-3.0
-- | substream: every third letter third (x:y:z:rest) = x: third rest
69
third (x:y:z:rest) = x: third rest
34
third (x:y:z:rest) = x: third rest
34
true
false
0
9
11
32
16
16
null
null
vdweegen/UvA-Software_Testing
Lab5/Jordan/Lecture5Original.hs
gpl-3.0
showGrid :: Grid -> IO() showGrid [as,bs,cs,ds,es,fs,gs,hs,is] = do putStrLn ("+-------+-------+-------+") showRow as; showRow bs; showRow cs putStrLn ("+-------+-------+-------+") showRow ds; showRow es; showRow fs putStrLn ("+-------+-------+-------+") showRow gs; showRow hs; showRow is putStrLn ("+-------+-------+-------+")
353
showGrid :: Grid -> IO() showGrid [as,bs,cs,ds,es,fs,gs,hs,is] = do putStrLn ("+-------+-------+-------+") showRow as; showRow bs; showRow cs putStrLn ("+-------+-------+-------+") showRow ds; showRow es; showRow fs putStrLn ("+-------+-------+-------+") showRow gs; showRow hs; showRow is putStrLn ("+-------+-------+-------+")
353
showGrid [as,bs,cs,ds,es,fs,gs,hs,is] = do putStrLn ("+-------+-------+-------+") showRow as; showRow bs; showRow cs putStrLn ("+-------+-------+-------+") showRow ds; showRow es; showRow fs putStrLn ("+-------+-------+-------+") showRow gs; showRow hs; showRow is putStrLn ("+-------+-------+-------+")
328
false
true
0
8
59
146
69
77
null
null
Cortlandd/haskell-opencv
src/OpenCV/Internal/ImgProc/MiscImgTransform/ColorCodes.hs
bsd-3-clause
bgra_IYUV :: Proxy 'BGRA_IYUV; bgra_IYUV = Proxy
50
bgra_IYUV :: Proxy 'BGRA_IYUV bgra_IYUV = Proxy
49
bgra_IYUV = Proxy
18
false
true
0
6
8
17
9
8
null
null
olsner/ghc
ghc/GHCi/UI/Tags.hs
bsd-3-clause
makeTagGroupsWithSrcInfo :: [TagInfo] -> IO [[TagInfo]] makeTagGroupsWithSrcInfo tagInfos = do let groups = groupBy ((==) `on` tagFile) $ sortBy (comparing tagFile) tagInfos mapM addTagSrcInfo groups where addTagSrcInfo [] = throwGhcException (CmdLineError "empty tag file group??") addTagSrcInfo group@(tagInfo:_) = do file <- readFile $tagFile tagInfo let sortedGroup = sortBy (comparing tagLine) group return $ perFile sortedGroup 1 0 $ lines file perFile allTags@(tag:tags) cnt pos allLs@(l:ls) | tagLine tag > cnt = perFile allTags (cnt+1) (pos+fromIntegral(length l)) ls | tagLine tag == cnt = tag{ tagSrcInfo = Just(l,pos) } : perFile tags cnt pos allLs perFile _ _ _ _ = [] -- ctags format, for Vim et al
784
makeTagGroupsWithSrcInfo :: [TagInfo] -> IO [[TagInfo]] makeTagGroupsWithSrcInfo tagInfos = do let groups = groupBy ((==) `on` tagFile) $ sortBy (comparing tagFile) tagInfos mapM addTagSrcInfo groups where addTagSrcInfo [] = throwGhcException (CmdLineError "empty tag file group??") addTagSrcInfo group@(tagInfo:_) = do file <- readFile $tagFile tagInfo let sortedGroup = sortBy (comparing tagLine) group return $ perFile sortedGroup 1 0 $ lines file perFile allTags@(tag:tags) cnt pos allLs@(l:ls) | tagLine tag > cnt = perFile allTags (cnt+1) (pos+fromIntegral(length l)) ls | tagLine tag == cnt = tag{ tagSrcInfo = Just(l,pos) } : perFile tags cnt pos allLs perFile _ _ _ _ = [] -- ctags format, for Vim et al
784
makeTagGroupsWithSrcInfo tagInfos = do let groups = groupBy ((==) `on` tagFile) $ sortBy (comparing tagFile) tagInfos mapM addTagSrcInfo groups where addTagSrcInfo [] = throwGhcException (CmdLineError "empty tag file group??") addTagSrcInfo group@(tagInfo:_) = do file <- readFile $tagFile tagInfo let sortedGroup = sortBy (comparing tagLine) group return $ perFile sortedGroup 1 0 $ lines file perFile allTags@(tag:tags) cnt pos allLs@(l:ls) | tagLine tag > cnt = perFile allTags (cnt+1) (pos+fromIntegral(length l)) ls | tagLine tag == cnt = tag{ tagSrcInfo = Just(l,pos) } : perFile tags cnt pos allLs perFile _ _ _ _ = [] -- ctags format, for Vim et al
728
false
true
6
16
179
310
154
156
null
null
ford-prefect/xml2ucm
src/UCM.hs
apache-2.0
writeSection :: Int -> String -> Maybe String -> (Int -> a -> String) -> a -> String writeSection i section name objToStr obj = writeLine i (section ++ writeSectionName name ++ " {") ++ objToStr (i + indentInc) obj ++ writeLine i "}" ++ "\n" where writeSectionName Nothing = "" writeSectionName (Just s) = "." ++ quote s
340
writeSection :: Int -> String -> Maybe String -> (Int -> a -> String) -> a -> String writeSection i section name objToStr obj = writeLine i (section ++ writeSectionName name ++ " {") ++ objToStr (i + indentInc) obj ++ writeLine i "}" ++ "\n" where writeSectionName Nothing = "" writeSectionName (Just s) = "." ++ quote s
340
writeSection i section name objToStr obj = writeLine i (section ++ writeSectionName name ++ " {") ++ objToStr (i + indentInc) obj ++ writeLine i "}" ++ "\n" where writeSectionName Nothing = "" writeSectionName (Just s) = "." ++ quote s
255
false
true
1
12
78
136
66
70
null
null
rfranek/duckling
Duckling/Rules/AR.hs
bsd-3-clause
rules (This Duration) = []
26
rules (This Duration) = []
26
rules (This Duration) = []
26
false
false
0
7
4
17
8
9
null
null
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/ECSServicePlacementConstraint.hs
mit
ecsServicePlacementConstraint :: Val Text -- ^ 'ecsspcType' -> ECSServicePlacementConstraint ecsServicePlacementConstraint typearg = ECSServicePlacementConstraint { _eCSServicePlacementConstraintExpression = Nothing , _eCSServicePlacementConstraintType = typearg }
276
ecsServicePlacementConstraint :: Val Text -- ^ 'ecsspcType' -> ECSServicePlacementConstraint ecsServicePlacementConstraint typearg = ECSServicePlacementConstraint { _eCSServicePlacementConstraintExpression = Nothing , _eCSServicePlacementConstraintType = typearg }
276
ecsServicePlacementConstraint typearg = ECSServicePlacementConstraint { _eCSServicePlacementConstraintExpression = Nothing , _eCSServicePlacementConstraintType = typearg }
179
false
true
0
7
33
45
22
23
null
null
tomberek/rulestesting
src/Control/Category/Associative/Rules.hs
bsd-3-clause
assoc_disassoc :: RuleE assoc_disassoc [rule| associate >>> cosassociate |] = into [|id|]
89
assoc_disassoc :: RuleE assoc_disassoc [rule| associate >>> cosassociate |] = into [|id|]
89
assoc_disassoc [rule| associate >>> cosassociate |] = into [|id|]
65
false
true
0
5
11
24
15
9
null
null
TomMD/ghc
compiler/prelude/THNames.hs
bsd-3-clause
pragAnnDName = libFun (fsLit "pragAnnD") pragAnnDIdKey
64
pragAnnDName = libFun (fsLit "pragAnnD") pragAnnDIdKey
64
pragAnnDName = libFun (fsLit "pragAnnD") pragAnnDIdKey
64
false
false
0
7
15
17
8
9
null
null
travitch/llvm-base-types
src/Data/LLVM/Types.hs
bsd-3-clause
-- | Implementation of the Show instance -- -- FIXME: Print out the external values and functions printModule :: Module -> Builder printModule Module { moduleIdentifier = _ , moduleDataLayoutString = layout , moduleTarget = triple , moduleAssembly = asm , moduleAliases = aliases , moduleGlobalVariables = vars , moduleDefinedFunctions = funcs , moduleExternalValues = _ -- evars , moduleExternalFunctions = _ -- efuncs } = mconcat [ layoutS, singleton '\n', tripleS, singleton '\n', asmS, singleton '\n' , aliasesS, singleton '\n', varS, fromString "\n\n", funcS, singleton '\n' ] where layoutS = mconcat [ fromString "target datalayout = \"" , fromString (show layout), singleton '"' ] tripleS = mconcat [ fromString "target triple = \"", fromString (show triple), singleton '"' ] asmS = printAsm asm aliasesS = mconcat $ intersperse (fromString "\n") $ map (printValue . toValue) aliases varS = mconcat $ intersperse (fromString "\n") $ map (printValue . toValue) vars funcS = mconcat $ intersperse (fromString "\n\n") $ map (printValue . toValue) funcs -- | Get a list of all types of globals in the Module (functions, -- aliases, and global variables)
1,420
printModule :: Module -> Builder printModule Module { moduleIdentifier = _ , moduleDataLayoutString = layout , moduleTarget = triple , moduleAssembly = asm , moduleAliases = aliases , moduleGlobalVariables = vars , moduleDefinedFunctions = funcs , moduleExternalValues = _ -- evars , moduleExternalFunctions = _ -- efuncs } = mconcat [ layoutS, singleton '\n', tripleS, singleton '\n', asmS, singleton '\n' , aliasesS, singleton '\n', varS, fromString "\n\n", funcS, singleton '\n' ] where layoutS = mconcat [ fromString "target datalayout = \"" , fromString (show layout), singleton '"' ] tripleS = mconcat [ fromString "target triple = \"", fromString (show triple), singleton '"' ] asmS = printAsm asm aliasesS = mconcat $ intersperse (fromString "\n") $ map (printValue . toValue) aliases varS = mconcat $ intersperse (fromString "\n") $ map (printValue . toValue) vars funcS = mconcat $ intersperse (fromString "\n\n") $ map (printValue . toValue) funcs -- | Get a list of all types of globals in the Module (functions, -- aliases, and global variables)
1,322
printModule Module { moduleIdentifier = _ , moduleDataLayoutString = layout , moduleTarget = triple , moduleAssembly = asm , moduleAliases = aliases , moduleGlobalVariables = vars , moduleDefinedFunctions = funcs , moduleExternalValues = _ -- evars , moduleExternalFunctions = _ -- efuncs } = mconcat [ layoutS, singleton '\n', tripleS, singleton '\n', asmS, singleton '\n' , aliasesS, singleton '\n', varS, fromString "\n\n", funcS, singleton '\n' ] where layoutS = mconcat [ fromString "target datalayout = \"" , fromString (show layout), singleton '"' ] tripleS = mconcat [ fromString "target triple = \"", fromString (show triple), singleton '"' ] asmS = printAsm asm aliasesS = mconcat $ intersperse (fromString "\n") $ map (printValue . toValue) aliases varS = mconcat $ intersperse (fromString "\n") $ map (printValue . toValue) vars funcS = mconcat $ intersperse (fromString "\n\n") $ map (printValue . toValue) funcs -- | Get a list of all types of globals in the Module (functions, -- aliases, and global variables)
1,289
true
true
0
9
445
316
172
144
null
null
chadbrewbaker/shellcheck
shellcheck.hs
gpl-3.0
clear = ansi 0
14
clear = ansi 0
14
clear = ansi 0
14
false
false
0
5
3
9
4
5
null
null
tlaitinen/game
backend/Application.hs
mit
-- | The @main@ function for an executable running this site. appMain :: IO () appMain = do -- Get the settings from all relevant sources settings <- loadAppSettingsArgs -- fall back to compile-time values, set to [] to require values at runtime [configSettingsYmlValue] -- allow environment variables to override useEnv -- Generate the foundation from the settings foundation <- makeFoundation settings -- Generate a WAI Application from the foundation app <- makeApplication foundation -- Run the application with Warp runSettings (warpSettings foundation) app -------------------------------------------------------------- -- Functions for DevelMain.hs (a way to run the app from GHCi) --------------------------------------------------------------
821
appMain :: IO () appMain = do -- Get the settings from all relevant sources settings <- loadAppSettingsArgs -- fall back to compile-time values, set to [] to require values at runtime [configSettingsYmlValue] -- allow environment variables to override useEnv -- Generate the foundation from the settings foundation <- makeFoundation settings -- Generate a WAI Application from the foundation app <- makeApplication foundation -- Run the application with Warp runSettings (warpSettings foundation) app -------------------------------------------------------------- -- Functions for DevelMain.hs (a way to run the app from GHCi) --------------------------------------------------------------
759
appMain = do -- Get the settings from all relevant sources settings <- loadAppSettingsArgs -- fall back to compile-time values, set to [] to require values at runtime [configSettingsYmlValue] -- allow environment variables to override useEnv -- Generate the foundation from the settings foundation <- makeFoundation settings -- Generate a WAI Application from the foundation app <- makeApplication foundation -- Run the application with Warp runSettings (warpSettings foundation) app -------------------------------------------------------------- -- Functions for DevelMain.hs (a way to run the app from GHCi) --------------------------------------------------------------
742
true
true
0
9
167
75
39
36
null
null
vincenthz/hs-sdl
Graphics/UI/SDL/Utilities.hs
bsd-3-clause
toCInt :: Int -> CInt toCInt = fromIntegral
43
toCInt :: Int -> CInt toCInt = fromIntegral
43
toCInt = fromIntegral
21
false
true
0
7
7
22
9
13
null
null
cdodev/ekg-elasticsearch
System/Metrics/Json.hs
bsd-3-clause
sampleToJson :: Metrics.Sample -> A.Value sampleToJson metrics = buildOne metrics A.emptyObject where buildOne :: M.HashMap T.Text Metrics.Value -> A.Value -> A.Value buildOne m o = M.foldlWithKey' build o m build :: A.Value -> T.Text -> Metrics.Value -> A.Value build m key = go m (T.splitOn "." key) go :: A.Value -> [T.Text] -> Metrics.Value -> A.Value go (A.Object m) [str] val = A.Object $ M.insert str metric m where metric = valueToJson val go (A.Object m) (str:rest) val = case M.lookup str m of Nothing -> A.Object $ M.insert str (go A.emptyObject rest val) m Just m' -> A.Object $ M.insert str (go m' rest val) m go v _ _ = typeMismatch "Object" v
747
sampleToJson :: Metrics.Sample -> A.Value sampleToJson metrics = buildOne metrics A.emptyObject where buildOne :: M.HashMap T.Text Metrics.Value -> A.Value -> A.Value buildOne m o = M.foldlWithKey' build o m build :: A.Value -> T.Text -> Metrics.Value -> A.Value build m key = go m (T.splitOn "." key) go :: A.Value -> [T.Text] -> Metrics.Value -> A.Value go (A.Object m) [str] val = A.Object $ M.insert str metric m where metric = valueToJson val go (A.Object m) (str:rest) val = case M.lookup str m of Nothing -> A.Object $ M.insert str (go A.emptyObject rest val) m Just m' -> A.Object $ M.insert str (go m' rest val) m go v _ _ = typeMismatch "Object" v
747
sampleToJson metrics = buildOne metrics A.emptyObject where buildOne :: M.HashMap T.Text Metrics.Value -> A.Value -> A.Value buildOne m o = M.foldlWithKey' build o m build :: A.Value -> T.Text -> Metrics.Value -> A.Value build m key = go m (T.splitOn "." key) go :: A.Value -> [T.Text] -> Metrics.Value -> A.Value go (A.Object m) [str] val = A.Object $ M.insert str metric m where metric = valueToJson val go (A.Object m) (str:rest) val = case M.lookup str m of Nothing -> A.Object $ M.insert str (go A.emptyObject rest val) m Just m' -> A.Object $ M.insert str (go m' rest val) m go v _ _ = typeMismatch "Object" v
705
false
true
23
8
204
306
157
149
null
null
mydaum/cabal
Cabal/Distribution/Types/UnitId.hs
bsd-3-clause
-- | Unsafely create a 'DefUnitId' from a 'UnitId'. Your responsibility -- is to ensure that the 'DefUnitId' invariant holds. unsafeMkDefUnitId :: UnitId -> DefUnitId unsafeMkDefUnitId = DefUnitId
197
unsafeMkDefUnitId :: UnitId -> DefUnitId unsafeMkDefUnitId = DefUnitId
70
unsafeMkDefUnitId = DefUnitId
29
true
true
0
5
28
17
10
7
null
null
josegury/HaskellFuntions
Funtions.hs
mit
resta Cero n = Cero
19
resta Cero n = Cero
19
resta Cero n = Cero
19
false
false
1
5
4
16
5
11
null
null
keithodulaigh/Hets
Comorphisms/HasCASL2IsabelleHOL.hs
gpl-2.0
-- datatype alternatives/constructors transAltDefn :: AltDefn -> (VName, [Typ]) transAltDefn (Construct opId ts Total _) = let ts' = map transType ts in case opId of Just opId' -> (mkVName $ showIsaConstT opId' baseSign, ts') Nothing -> (mkVName "", ts')
276
transAltDefn :: AltDefn -> (VName, [Typ]) transAltDefn (Construct opId ts Total _) = let ts' = map transType ts in case opId of Just opId' -> (mkVName $ showIsaConstT opId' baseSign, ts') Nothing -> (mkVName "", ts')
238
transAltDefn (Construct opId ts Total _) = let ts' = map transType ts in case opId of Just opId' -> (mkVName $ showIsaConstT opId' baseSign, ts') Nothing -> (mkVName "", ts')
196
true
true
0
12
61
99
51
48
null
null
pnlbwh/test-tensormasking
pipeline-lib/Pipeline.hs
bsd-3-clause
rules = do Pipeline.ANTs.rules Pipeline.FreeSurfer.rules Pipeline.FreeSurferInDwi.rules Pipeline.DWI.rules Pipeline.DWIMask.rules Pipeline.Structural.rules Pipeline.StructuralMask.rules Pipeline.TractQuerier.rules Pipeline.UKFTractography.rules Pipeline.HCP.rules
283
rules = do Pipeline.ANTs.rules Pipeline.FreeSurfer.rules Pipeline.FreeSurferInDwi.rules Pipeline.DWI.rules Pipeline.DWIMask.rules Pipeline.Structural.rules Pipeline.StructuralMask.rules Pipeline.TractQuerier.rules Pipeline.UKFTractography.rules Pipeline.HCP.rules
283
rules = do Pipeline.ANTs.rules Pipeline.FreeSurfer.rules Pipeline.FreeSurferInDwi.rules Pipeline.DWI.rules Pipeline.DWIMask.rules Pipeline.Structural.rules Pipeline.StructuralMask.rules Pipeline.TractQuerier.rules Pipeline.UKFTractography.rules Pipeline.HCP.rules
283
false
false
1
8
32
70
33
37
null
null