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
daleooo/barrelfish
tools/flounder/THCStubsBackend.hs
mit
-- static errval_t ping_pong_thc_export_connect_cb(void *st, -- struct ping_pong_binding *b) { -- struct ping_pong_thc_export_info *info; -- info = (struct ping_pong_thc_export_info*) st; -- -- // Wait for top-half accept call to be present -- thc_sem_p(&info->accept_call_present_sem); -- -- // Transfer information to top-half -- thc_lock_acquire(&info->info_lock); -- *(info->b) = b; -- -- // Signal that information has arrived -- thc_sem_v(&info->connect_cb_done_sem); -- return SYS_ERR_OK; -- } connect_cb_function :: String -> C.Unit connect_cb_function ifn = let info_ptr_t = C.Ptr $ THC.thc_export_info_t ifn info_b = C.DerefField (C.Variable "info") "b" ptr_info_accept_call_present_sem = C.AddressOf $ C.DerefField (C.Variable "info") "accept_call_present_sem" ptr_info_connect_cb_done_sem = C.AddressOf $ C.DerefField (C.Variable "info") "connect_cb_done_sem" ptr_info_info_lock = C.AddressOf $ C.DerefField (C.Variable "info") "info_lock" var_st = C.Variable "st" var_b = C.Variable "b" in C.FunctionDef C.Static (C.TypeName "errval_t") (ifscope ifn "thc_connect_cb") [ C.Param (C.Ptr $ C.TypeName "void") "st", C.Param (C.Ptr $ C.Struct $ BC.intf_bind_type ifn) "b" ] [ C.VarDecl C.NoScope C.NonConst info_ptr_t "info" Nothing, C.Ex $ C.Assignment (C.Variable "info") (C.Cast info_ptr_t var_st), C.Ex $ C.Call "thc_sem_p" [ptr_info_accept_call_present_sem], C.Ex $ C.Call "thc_lock_acquire" [ptr_info_info_lock], C.Ex $ C.Assignment (C.DerefPtr info_b) var_b, C.Ex $ C.Call "thc_sem_v" [ptr_info_connect_cb_done_sem], C.Return $ C.Variable "SYS_ERR_OK" ]
1,764
connect_cb_function :: String -> C.Unit connect_cb_function ifn = let info_ptr_t = C.Ptr $ THC.thc_export_info_t ifn info_b = C.DerefField (C.Variable "info") "b" ptr_info_accept_call_present_sem = C.AddressOf $ C.DerefField (C.Variable "info") "accept_call_present_sem" ptr_info_connect_cb_done_sem = C.AddressOf $ C.DerefField (C.Variable "info") "connect_cb_done_sem" ptr_info_info_lock = C.AddressOf $ C.DerefField (C.Variable "info") "info_lock" var_st = C.Variable "st" var_b = C.Variable "b" in C.FunctionDef C.Static (C.TypeName "errval_t") (ifscope ifn "thc_connect_cb") [ C.Param (C.Ptr $ C.TypeName "void") "st", C.Param (C.Ptr $ C.Struct $ BC.intf_bind_type ifn) "b" ] [ C.VarDecl C.NoScope C.NonConst info_ptr_t "info" Nothing, C.Ex $ C.Assignment (C.Variable "info") (C.Cast info_ptr_t var_st), C.Ex $ C.Call "thc_sem_p" [ptr_info_accept_call_present_sem], C.Ex $ C.Call "thc_lock_acquire" [ptr_info_info_lock], C.Ex $ C.Assignment (C.DerefPtr info_b) var_b, C.Ex $ C.Call "thc_sem_v" [ptr_info_connect_cb_done_sem], C.Return $ C.Variable "SYS_ERR_OK" ]
1,205
connect_cb_function ifn = let info_ptr_t = C.Ptr $ THC.thc_export_info_t ifn info_b = C.DerefField (C.Variable "info") "b" ptr_info_accept_call_present_sem = C.AddressOf $ C.DerefField (C.Variable "info") "accept_call_present_sem" ptr_info_connect_cb_done_sem = C.AddressOf $ C.DerefField (C.Variable "info") "connect_cb_done_sem" ptr_info_info_lock = C.AddressOf $ C.DerefField (C.Variable "info") "info_lock" var_st = C.Variable "st" var_b = C.Variable "b" in C.FunctionDef C.Static (C.TypeName "errval_t") (ifscope ifn "thc_connect_cb") [ C.Param (C.Ptr $ C.TypeName "void") "st", C.Param (C.Ptr $ C.Struct $ BC.intf_bind_type ifn) "b" ] [ C.VarDecl C.NoScope C.NonConst info_ptr_t "info" Nothing, C.Ex $ C.Assignment (C.Variable "info") (C.Cast info_ptr_t var_st), C.Ex $ C.Call "thc_sem_p" [ptr_info_accept_call_present_sem], C.Ex $ C.Call "thc_lock_acquire" [ptr_info_info_lock], C.Ex $ C.Assignment (C.DerefPtr info_b) var_b, C.Ex $ C.Call "thc_sem_v" [ptr_info_connect_cb_done_sem], C.Return $ C.Variable "SYS_ERR_OK" ]
1,165
true
true
0
13
374
412
213
199
null
null
brendanhay/gogol
gogol-adsense/gen/Network/Google/AdSense/Types/Product.hs
mpl-2.0
-- | Creates a value of 'AdClientAdCode' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'acacAmpHead' -- -- * 'acacAmpBody' -- -- * 'acacAdCode' adClientAdCode :: AdClientAdCode adClientAdCode = AdClientAdCode' {_acacAmpHead = Nothing, _acacAmpBody = Nothing, _acacAdCode = Nothing}
378
adClientAdCode :: AdClientAdCode adClientAdCode = AdClientAdCode' {_acacAmpHead = Nothing, _acacAmpBody = Nothing, _acacAdCode = Nothing}
147
adClientAdCode = AdClientAdCode' {_acacAmpHead = Nothing, _acacAmpBody = Nothing, _acacAdCode = Nothing}
110
true
true
1
7
66
47
29
18
null
null
msakai/icfpc2013
src/Interaction.hs
bsd-2-clause
responseCodeHelp Eval code = case code of (2,0,0) -> "body EvalResponse" (4,0,0) -> "Bad request (some input is not well-formed)" (4,0,1) -> "Unauthorized problem was not requested by the current user" (4,0,4) -> "Not Found no such challenge" (4,1,0) -> "Gone problem requested more than 5 minutes ago" (4,1,2) -> " problem already solved (by current user)" (4,1,3) -> " request too big" _ -> "unknown response code for /eval"
490
responseCodeHelp Eval code = case code of (2,0,0) -> "body EvalResponse" (4,0,0) -> "Bad request (some input is not well-formed)" (4,0,1) -> "Unauthorized problem was not requested by the current user" (4,0,4) -> "Not Found no such challenge" (4,1,0) -> "Gone problem requested more than 5 minutes ago" (4,1,2) -> " problem already solved (by current user)" (4,1,3) -> " request too big" _ -> "unknown response code for /eval"
490
responseCodeHelp Eval code = case code of (2,0,0) -> "body EvalResponse" (4,0,0) -> "Bad request (some input is not well-formed)" (4,0,1) -> "Unauthorized problem was not requested by the current user" (4,0,4) -> "Not Found no such challenge" (4,1,0) -> "Gone problem requested more than 5 minutes ago" (4,1,2) -> " problem already solved (by current user)" (4,1,3) -> " request too big" _ -> "unknown response code for /eval"
490
false
false
0
8
133
126
73
53
null
null
taruti/diagrams-cairo-raster
example/RepaRaster.hs
bsd-3-clause
dia :: Int -> Int -> IO (Diagram Cairo R2) dia = cairoRepa (\d -> fromFunction d rplus)
87
dia :: Int -> Int -> IO (Diagram Cairo R2) dia = cairoRepa (\d -> fromFunction d rplus)
87
dia = cairoRepa (\d -> fromFunction d rplus)
44
false
true
0
10
17
51
24
27
null
null
JJ/2016-ea-languages-wcci
haskell/mutableVector/Auxiliary.hs
artistic-2.0
-- Creates a random mutable vector randomVector :: Int -> IO (MVector (PrimState IO) Bool) randomVector len = do let seed = mkStdGen 1 let rs = (randomBoolList len seed) :: [Bool] vector <- V.replicate len False sequence $ Prelude.map (\n -> write vector n (rs!!n)) [0..len-1] return vector
300
randomVector :: Int -> IO (MVector (PrimState IO) Bool) randomVector len = do let seed = mkStdGen 1 let rs = (randomBoolList len seed) :: [Bool] vector <- V.replicate len False sequence $ Prelude.map (\n -> write vector n (rs!!n)) [0..len-1] return vector
265
randomVector len = do let seed = mkStdGen 1 let rs = (randomBoolList len seed) :: [Bool] vector <- V.replicate len False sequence $ Prelude.map (\n -> write vector n (rs!!n)) [0..len-1] return vector
209
true
true
0
13
58
136
66
70
null
null
lexi-lambda/haskell-rolodex
src/App.hs
isc
server :: Server ServerAPI server = contactsServer
50
server :: Server ServerAPI server = contactsServer
50
server = contactsServer
23
false
true
1
5
6
18
7
11
null
null
PierreR/streaming
benchmarks/old/Stream/Prelude/Folding.hs
bsd-3-clause
chunksOf_ :: Monad m => Folding_ (Of a) m r -> Int -> Folding_ (Folding_ (Of a) m) m r chunksOf_ phi n = \construct wrap done -> undefined
165
chunksOf_ :: Monad m => Folding_ (Of a) m r -> Int -> Folding_ (Folding_ (Of a) m) m r chunksOf_ phi n = \construct wrap done -> undefined
165
chunksOf_ phi n = \construct wrap done -> undefined
51
false
true
0
13
55
75
36
39
null
null
mcschroeder/ghc
compiler/simplCore/SimplUtils.hs
bsd-3-clause
addCastTo :: ArgInfo -> OutCoercion -> ArgInfo addCastTo ai co = ai { ai_args = CastBy co : ai_args ai , ai_type = pSnd (coercionKind co) }
160
addCastTo :: ArgInfo -> OutCoercion -> ArgInfo addCastTo ai co = ai { ai_args = CastBy co : ai_args ai , ai_type = pSnd (coercionKind co) }
160
addCastTo ai co = ai { ai_args = CastBy co : ai_args ai , ai_type = pSnd (coercionKind co) }
113
false
true
0
10
47
63
30
33
null
null
nevrenato/HetsAlloy
Common/IRI.hs
gpl-2.0
difSegsFrom sabs base = difSegsFrom ("../" ++ sabs) (snd $ nextSegment base)
76
difSegsFrom sabs base = difSegsFrom ("../" ++ sabs) (snd $ nextSegment base)
76
difSegsFrom sabs base = difSegsFrom ("../" ++ sabs) (snd $ nextSegment base)
76
false
false
0
8
11
34
16
18
null
null
mathhun/stack
src/test/Network/HTTP/Download/VerifiedSpec.hs
bsd-3-clause
runWith :: Manager -> ReaderT Manager m r -> m r runWith = flip runReaderT
74
runWith :: Manager -> ReaderT Manager m r -> m r runWith = flip runReaderT
74
runWith = flip runReaderT
25
false
true
0
7
14
32
15
17
null
null
aloiscochard/sarsi
src/Rosetta.hs
apache-2.0
projectLanguages SBT = [JV, SC]
31
projectLanguages SBT = [JV, SC]
31
projectLanguages SBT = [JV, SC]
31
false
false
1
5
4
18
8
10
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/Window.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/Window.fetch Mozilla Window.fetch documentation> fetch :: (MonadDOM m, ToJSVal input) => Window -> input -> Maybe RequestInit -> m Response fetch self input init = liftDOM (((self ^. jsf "fetch" [toJSVal input, toJSVal init]) >>= readPromise) >>= fromJSValUnchecked)
363
fetch :: (MonadDOM m, ToJSVal input) => Window -> input -> Maybe RequestInit -> m Response fetch self input init = liftDOM (((self ^. jsf "fetch" [toJSVal input, toJSVal init]) >>= readPromise) >>= fromJSValUnchecked)
258
fetch self input init = liftDOM (((self ^. jsf "fetch" [toJSVal input, toJSVal init]) >>= readPromise) >>= fromJSValUnchecked)
153
true
true
0
14
81
93
47
46
null
null
leshchevds/ganeti
src/Ganeti/WConfd/Core.hs
bsd-2-clause
-- *** DRBDSecrets -- Randomly generate a DRBDSecret for an instance and reserves it for -- a given client. generateDRBDSecret :: ClientId -> WConfdMonad DRBDSecret generateDRBDSecret cid = do g <- liftIO Rand.newStdGen modifyTempResStateErr $ T.generateDRBDSecret g cid -- *** LVs
287
generateDRBDSecret :: ClientId -> WConfdMonad DRBDSecret generateDRBDSecret cid = do g <- liftIO Rand.newStdGen modifyTempResStateErr $ T.generateDRBDSecret g cid -- *** LVs
178
generateDRBDSecret cid = do g <- liftIO Rand.newStdGen modifyTempResStateErr $ T.generateDRBDSecret g cid -- *** LVs
121
true
true
0
9
46
51
25
26
null
null
DanielWaterworth/Idris-dev
src/IRTS/CodegenJava.hs
bsd-3-clause
mkExp pp (SUpdate var@(Loc i) newExp) = -- can only update locals mkUpdate pp var newExp
90
mkExp pp (SUpdate var@(Loc i) newExp) = -- can only update locals mkUpdate pp var newExp
90
mkExp pp (SUpdate var@(Loc i) newExp) = -- can only update locals mkUpdate pp var newExp
90
false
false
0
10
17
37
18
19
null
null
kseo/untyped
src/Language/LambdaCalculus/Parser/Term.hs
bsd-3-clause
parseAbs :: LCParser Term parseAbs = do pos <- getPosition backslash v <- identifier modifyState (v :) dot term <- parseTerm modifyState tail return $ TmAbs (infoFrom pos) v term
194
parseAbs :: LCParser Term parseAbs = do pos <- getPosition backslash v <- identifier modifyState (v :) dot term <- parseTerm modifyState tail return $ TmAbs (infoFrom pos) v term
194
parseAbs = do pos <- getPosition backslash v <- identifier modifyState (v :) dot term <- parseTerm modifyState tail return $ TmAbs (infoFrom pos) v term
168
false
true
0
10
45
77
34
43
null
null
svenssonjoel/libjit-hs
tests/gcd.hs
bsd-3-clause
main = do ctx <- contextCreate -- uint_type <- getUIntType startBuild(ctx) lab1 <- getUndefinedLabel lab2 <- getUndefinedLabel sig <- createTypeSignature CDECL uint_type [uint_type,uint_type] 2 1 fun <- createFunction ctx sig x <- getParam fun 0 y <- getParam fun 1 t1 <- eq fun x y branchIfNot fun t1 lab1 ret fun x setLabel fun lab1 t2 <- lt fun x y branchIfNot fun t2 lab2 a1 <- sub fun y x t3 <- callFunction fun "gcd" fun (Type nullPtr) [x,a1] 2 CallNothrow ret fun t3 setLabel fun lab2 a0 <- sub fun x y t4 <- callFunction fun "gcd" fun (Type nullPtr) [a0,y] 2 CallNothrow ret fun t4 compile fun endBuild(ctx) -- Hackity withArray [15,18,0 :: Int] $ \ ptr -> do let ptr' = castPtr ptr apply fun [ptr' ,(plusPtr ptr' 8)] (plusPtr ptr' 16) val <- peek (castPtr (plusPtr ptr' 16)) putStrLn $ "result: " ++ show (val :: Int) putStrLn "Ok"
1,438
main = do ctx <- contextCreate -- uint_type <- getUIntType startBuild(ctx) lab1 <- getUndefinedLabel lab2 <- getUndefinedLabel sig <- createTypeSignature CDECL uint_type [uint_type,uint_type] 2 1 fun <- createFunction ctx sig x <- getParam fun 0 y <- getParam fun 1 t1 <- eq fun x y branchIfNot fun t1 lab1 ret fun x setLabel fun lab1 t2 <- lt fun x y branchIfNot fun t2 lab2 a1 <- sub fun y x t3 <- callFunction fun "gcd" fun (Type nullPtr) [x,a1] 2 CallNothrow ret fun t3 setLabel fun lab2 a0 <- sub fun x y t4 <- callFunction fun "gcd" fun (Type nullPtr) [a0,y] 2 CallNothrow ret fun t4 compile fun endBuild(ctx) -- Hackity withArray [15,18,0 :: Int] $ \ ptr -> do let ptr' = castPtr ptr apply fun [ptr' ,(plusPtr ptr' 8)] (plusPtr ptr' 16) val <- peek (castPtr (plusPtr ptr' 16)) putStrLn $ "result: " ++ show (val :: Int) putStrLn "Ok"
1,438
main = do ctx <- contextCreate -- uint_type <- getUIntType startBuild(ctx) lab1 <- getUndefinedLabel lab2 <- getUndefinedLabel sig <- createTypeSignature CDECL uint_type [uint_type,uint_type] 2 1 fun <- createFunction ctx sig x <- getParam fun 0 y <- getParam fun 1 t1 <- eq fun x y branchIfNot fun t1 lab1 ret fun x setLabel fun lab1 t2 <- lt fun x y branchIfNot fun t2 lab2 a1 <- sub fun y x t3 <- callFunction fun "gcd" fun (Type nullPtr) [x,a1] 2 CallNothrow ret fun t3 setLabel fun lab2 a0 <- sub fun x y t4 <- callFunction fun "gcd" fun (Type nullPtr) [a0,y] 2 CallNothrow ret fun t4 compile fun endBuild(ctx) -- Hackity withArray [15,18,0 :: Int] $ \ ptr -> do let ptr' = castPtr ptr apply fun [ptr' ,(plusPtr ptr' 8)] (plusPtr ptr' 16) val <- peek (castPtr (plusPtr ptr' 16)) putStrLn $ "result: " ++ show (val :: Int) putStrLn "Ok"
1,438
false
false
0
16
752
418
191
227
null
null
imuli/gitit
Network/Gitit/Authentication.hs
gpl-2.0
registerUser :: Params -> Handler registerUser params = do result' <- sharedValidation Register params case result' of Left errors -> registerForm >>= formattedPage defaultPageLayout{ pgMessages = errors, pgShowPageTools = False, pgTabs = [], pgTitle = "Register for an account" } Right (uname, email, pword) -> do user <- liftIO $ mkUser uname email pword addUser uname user loginUser params{ pUsername = uname, pPassword = pword, pEmail = email }
671
registerUser :: Params -> Handler registerUser params = do result' <- sharedValidation Register params case result' of Left errors -> registerForm >>= formattedPage defaultPageLayout{ pgMessages = errors, pgShowPageTools = False, pgTabs = [], pgTitle = "Register for an account" } Right (uname, email, pword) -> do user <- liftIO $ mkUser uname email pword addUser uname user loginUser params{ pUsername = uname, pPassword = pword, pEmail = email }
671
registerUser params = do result' <- sharedValidation Register params case result' of Left errors -> registerForm >>= formattedPage defaultPageLayout{ pgMessages = errors, pgShowPageTools = False, pgTabs = [], pgTitle = "Register for an account" } Right (uname, email, pword) -> do user <- liftIO $ mkUser uname email pword addUser uname user loginUser params{ pUsername = uname, pPassword = pword, pEmail = email }
637
false
true
0
14
291
151
78
73
null
null
randen/haddock
haddock-api/src/Haddock/GhcUtils.hs
bsd-2-clause
getMainDeclBinder :: HsDecl name -> [name] getMainDeclBinder (TyClD d) = [tcdName d]
84
getMainDeclBinder :: HsDecl name -> [name] getMainDeclBinder (TyClD d) = [tcdName d]
84
getMainDeclBinder (TyClD d) = [tcdName d]
41
false
true
0
7
11
36
18
18
null
null
snoyberg/ghc
compiler/types/Type.hs
bsd-3-clause
splitPiTy_maybe :: Type -> Maybe (TyBinder, Type) splitPiTy_maybe ty = go ty where go ty | Just ty' <- coreView ty = go ty' go (ForAllTy bndr ty) = Just (Named bndr, ty) go (FunTy arg res) = Just (Anon arg, res) go _ = Nothing -- | Takes a forall type apart, or panics
307
splitPiTy_maybe :: Type -> Maybe (TyBinder, Type) splitPiTy_maybe ty = go ty where go ty | Just ty' <- coreView ty = go ty' go (ForAllTy bndr ty) = Just (Named bndr, ty) go (FunTy arg res) = Just (Anon arg, res) go _ = Nothing -- | Takes a forall type apart, or panics
307
splitPiTy_maybe ty = go ty where go ty | Just ty' <- coreView ty = go ty' go (ForAllTy bndr ty) = Just (Named bndr, ty) go (FunTy arg res) = Just (Anon arg, res) go _ = Nothing -- | Takes a forall type apart, or panics
257
false
true
0
9
93
136
62
74
null
null
keera-studios/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qLabelListFromPtrList :: [Ptr (TQLabel a)] -> IO [QLabel a] qLabelListFromPtrList p = objectListFromPtrList qtc_QLabel_getFinalizer p
135
qLabelListFromPtrList :: [Ptr (TQLabel a)] -> IO [QLabel a] qLabelListFromPtrList p = objectListFromPtrList qtc_QLabel_getFinalizer p
135
qLabelListFromPtrList p = objectListFromPtrList qtc_QLabel_getFinalizer p
75
false
true
0
9
16
44
21
23
null
null
charles-cooper/postgresql-orm
Database/PostgreSQL/Migrate.hs
gpl-3.0
getDirectoryMigrations :: FilePath -> IO [MigrationDetails] getDirectoryMigrations dir = do files0 <- getDirectoryContents dir let files = filter (('.' /=) . head) $ sort files0 return $ map (splitFileVersionName dir) files
229
getDirectoryMigrations :: FilePath -> IO [MigrationDetails] getDirectoryMigrations dir = do files0 <- getDirectoryContents dir let files = filter (('.' /=) . head) $ sort files0 return $ map (splitFileVersionName dir) files
229
getDirectoryMigrations dir = do files0 <- getDirectoryContents dir let files = filter (('.' /=) . head) $ sort files0 return $ map (splitFileVersionName dir) files
169
false
true
0
14
36
82
39
43
null
null
snoyberg/ghc
compiler/typecheck/TcEvidence.hs
bsd-3-clause
mkTcAxInstCo = mkAxInstCo
35
mkTcAxInstCo = mkAxInstCo
35
mkTcAxInstCo = mkAxInstCo
35
false
false
0
4
12
6
3
3
null
null
roldugin/LiveFusion
Data/LiveFusion/Loop/Expr.hs
bsd-3-clause
pprExpr (TermE t) -- TODO: Convert should not be here. = paren $ DeBruijn.pprTerm $ DeBruijn.convert t
106
pprExpr (TermE t) -- TODO: Convert should not be here. = paren $ DeBruijn.pprTerm $ DeBruijn.convert t
106
pprExpr (TermE t) -- TODO: Convert should not be here. = paren $ DeBruijn.pprTerm $ DeBruijn.convert t
106
false
false
2
7
20
33
15
18
null
null
literate-unitb/literate-unitb
src/Document/Tests/TrainStationSets.hs
mit
result3 :: String result3 = unlines [ "error 295:4:" , " arguments of 'and' do not match its signature:" , " signature: [\\Bool,\\Bool] -> \\Bool" , " left argument: (not (= (apply loc t) ent))" , " type \\Bool" , " right argument: ent" , " type \\Blk" , "" ]
312
result3 :: String result3 = unlines [ "error 295:4:" , " arguments of 'and' do not match its signature:" , " signature: [\\Bool,\\Bool] -> \\Bool" , " left argument: (not (= (apply loc t) ent))" , " type \\Bool" , " right argument: ent" , " type \\Blk" , "" ]
312
result3 = unlines [ "error 295:4:" , " arguments of 'and' do not match its signature:" , " signature: [\\Bool,\\Bool] -> \\Bool" , " left argument: (not (= (apply loc t) ent))" , " type \\Bool" , " right argument: ent" , " type \\Blk" , "" ]
294
false
true
0
5
103
38
23
15
null
null
da-x/free
src/Control/Alternative/Free.hs
bsd-3-clause
altFTyCon = mkTyCon "Control.Alternative.Free.AltF"
51
altFTyCon = mkTyCon "Control.Alternative.Free.AltF"
51
altFTyCon = mkTyCon "Control.Alternative.Free.AltF"
51
false
false
0
5
3
9
4
5
null
null
silky/Tidal
Sound/Tidal/Dirt.hs
gpl-3.0
delay = makeF dirt "delay"
33
delay = makeF dirt "delay"
33
delay = makeF dirt "delay"
33
false
false
1
5
11
15
5
10
null
null
silky/ImplicitCAD
Graphics/Implicit/Primitives.hs
gpl-2.0
rect3R :: ℝ -- ^ Rounding of corners -> ℝ3 -- ^ Bottom.. corner -> ℝ3 -- ^ Top right... corner -> SymbolicObj3 -- ^ Resuting cube - (0,0,0) is bottom left... rect3R = Rect3R
232
rect3R :: ℝ -- ^ Rounding of corners -> ℝ3 -- ^ Bottom.. corner -> ℝ3 -- ^ Top right... corner -> SymbolicObj3 rect3R = Rect3R
182
rect3R = Rect3R
15
true
true
0
9
93
30
16
14
null
null
LightAndLight/date
src/Data/Date/Internals.hs
bsd-3-clause
daysInMonth :: Int -> Bool -> Int daysInMonth m ly = case m of 1 -> 31 2 -> if ly then 29 else 28 3 -> 31 4 -> 30 5 -> 31 6 -> 30 7 -> 31 8 -> 31 9 -> 30 10 -> 31 11 -> 30 12 -> 31
237
daysInMonth :: Int -> Bool -> Int daysInMonth m ly = case m of 1 -> 31 2 -> if ly then 29 else 28 3 -> 31 4 -> 30 5 -> 31 6 -> 30 7 -> 31 8 -> 31 9 -> 30 10 -> 31 11 -> 30 12 -> 31
237
daysInMonth m ly = case m of 1 -> 31 2 -> if ly then 29 else 28 3 -> 31 4 -> 30 5 -> 31 6 -> 30 7 -> 31 8 -> 31 9 -> 30 10 -> 31 11 -> 30 12 -> 31
203
false
true
0
8
111
108
55
53
null
null
mstruebing/todo.hs
src/Lib.hs
mit
-- filepath of the todo file todoFile :: IO FilePath todoFile = fmap (\homeDir -> homeDir ++ "/" ++ fileName) getHomeDirectory
126
todoFile :: IO FilePath todoFile = fmap (\homeDir -> homeDir ++ "/" ++ fileName) getHomeDirectory
97
todoFile = fmap (\homeDir -> homeDir ++ "/" ++ fileName) getHomeDirectory
73
true
true
0
9
20
36
19
17
null
null
mbakke/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
htKvmSpiceLosslessImgComprAutoLz :: String htKvmSpiceLosslessImgComprAutoLz = "auto_lz"
87
htKvmSpiceLosslessImgComprAutoLz :: String htKvmSpiceLosslessImgComprAutoLz = "auto_lz"
87
htKvmSpiceLosslessImgComprAutoLz = "auto_lz"
44
false
true
0
4
5
11
6
5
null
null
ralphmorton/Mimir
src/Mimir/Bitfinex.hs
bsd-3-clause
orderTypeType LIMIT_SELL = "exchange limit"
43
orderTypeType LIMIT_SELL = "exchange limit"
43
orderTypeType LIMIT_SELL = "exchange limit"
43
false
false
0
5
4
9
4
5
null
null
IanConnolly/aws-sdk-fork
AWS/RDS/DBParameterGroup.hs
bsd-3-clause
createDBParameterGroup :: (MonadBaseControl IO m, MonadResource m) => Text -- ^ DBParameterGroupFamily -> Text -- ^ DBParameterGroupName -> Text -- ^ Description -> RDS m DBParameterGroup createDBParameterGroup family name desc = rdsQuery "CreateDBParameterGroup" params $ element "DBParameterGroup" dbParameterGroupSink where params = [ "DBParameterGroupFamily" |= family , "DBParameterGroupName" |= name , "Description" |= desc ]
501
createDBParameterGroup :: (MonadBaseControl IO m, MonadResource m) => Text -- ^ DBParameterGroupFamily -> Text -- ^ DBParameterGroupName -> Text -- ^ Description -> RDS m DBParameterGroup createDBParameterGroup family name desc = rdsQuery "CreateDBParameterGroup" params $ element "DBParameterGroup" dbParameterGroupSink where params = [ "DBParameterGroupFamily" |= family , "DBParameterGroupName" |= name , "Description" |= desc ]
501
createDBParameterGroup family name desc = rdsQuery "CreateDBParameterGroup" params $ element "DBParameterGroup" dbParameterGroupSink where params = [ "DBParameterGroupFamily" |= family , "DBParameterGroupName" |= name , "Description" |= desc ]
293
false
true
0
10
123
103
52
51
null
null
Mahdi89/eTeak
src/Teak.hs
bsd-3-clause
chainCmds :: NetworkIF network => [TeakOption] -> [Context Decl] -> Pos -> NetworkLinkRef -> [Cmd] -> WhyT (NetworkMonad network) (Maybe NetworkLinkRef) chainCmds opts cs pos goIn cmds = do done <- foldM chainCmd (Just goIn) cmds return done where chainCmd Nothing cmd = WhyT $ return $ Why (parseNodeError cs pos cmd "inaccessible command") Nothing chainCmd (Just goInL) cmd = do (cmdGo, cmdDone) <- visitCmd opts cs cmd lift $ connect pos goInL cmdGo return cmdDone -- teakOFit : adapt term `indexIn' from width `widthIn' to `widthOut', possibly by adding -- terms to `terms'. Returns (indexOfNewResult, newTerms)
736
chainCmds :: NetworkIF network => [TeakOption] -> [Context Decl] -> Pos -> NetworkLinkRef -> [Cmd] -> WhyT (NetworkMonad network) (Maybe NetworkLinkRef) chainCmds opts cs pos goIn cmds = do done <- foldM chainCmd (Just goIn) cmds return done where chainCmd Nothing cmd = WhyT $ return $ Why (parseNodeError cs pos cmd "inaccessible command") Nothing chainCmd (Just goInL) cmd = do (cmdGo, cmdDone) <- visitCmd opts cs cmd lift $ connect pos goInL cmdGo return cmdDone -- teakOFit : adapt term `indexIn' from width `widthIn' to `widthOut', possibly by adding -- terms to `terms'. Returns (indexOfNewResult, newTerms)
732
chainCmds opts cs pos goIn cmds = do done <- foldM chainCmd (Just goIn) cmds return done where chainCmd Nothing cmd = WhyT $ return $ Why (parseNodeError cs pos cmd "inaccessible command") Nothing chainCmd (Just goInL) cmd = do (cmdGo, cmdDone) <- visitCmd opts cs cmd lift $ connect pos goInL cmdGo return cmdDone -- teakOFit : adapt term `indexIn' from width `widthIn' to `widthOut', possibly by adding -- terms to `terms'. Returns (indexOfNewResult, newTerms)
571
false
true
1
13
217
199
96
103
null
null
travitch/dalvik
src/Dalvik/Printer.hs
bsd-3-clause
accessTypeStr (Just AObject) = "-object"
40
accessTypeStr (Just AObject) = "-object"
40
accessTypeStr (Just AObject) = "-object"
40
false
false
0
7
4
15
7
8
null
null
hbrouwer/pdrt-sandbox
src/Data/DRS/Structure.hs
apache-2.0
isMergeDRS (DRS _ _) = False
32
isMergeDRS (DRS _ _) = False
32
isMergeDRS (DRS _ _) = False
32
false
false
0
7
9
17
8
9
null
null
expipiplus1/vulkan
src/Vulkan/Extensions/VK_KHR_get_physical_device_properties2.hs
bsd-3-clause
-- No documentation found for TopLevel "vkGetPhysicalDeviceFeatures2KHR" getPhysicalDeviceFeatures2KHR = getPhysicalDeviceFeatures2
131
getPhysicalDeviceFeatures2KHR = getPhysicalDeviceFeatures2
58
getPhysicalDeviceFeatures2KHR = getPhysicalDeviceFeatures2
58
true
false
0
4
9
7
4
3
null
null
suzumiyasmith/KDJL
KDJL.hs
gpl-3.0
main :: IO () main = toFoundations <$> eODeal >>= print
56
main :: IO () main = toFoundations <$> eODeal >>= print
56
main = toFoundations <$> eODeal >>= print
42
false
true
0
6
11
24
12
12
null
null
spanners/dissertation
dissertation/code/elm-lang.org/server/Server.hs
mit
setupLogging :: IO () setupLogging = do createDirectoryIfMissing True "log" createIfMissing "log/access.log" createIfMissing "log/error.log" where createIfMissing path = do exists <- doesFileExist path unless exists $ BS.writeFile path "" -- | Compile all of the Elm files in public/, -- placing results in public/build/
368
setupLogging :: IO () setupLogging = do createDirectoryIfMissing True "log" createIfMissing "log/access.log" createIfMissing "log/error.log" where createIfMissing path = do exists <- doesFileExist path unless exists $ BS.writeFile path "" -- | Compile all of the Elm files in public/, -- placing results in public/build/
368
setupLogging = do createDirectoryIfMissing True "log" createIfMissing "log/access.log" createIfMissing "log/error.log" where createIfMissing path = do exists <- doesFileExist path unless exists $ BS.writeFile path "" -- | Compile all of the Elm files in public/, -- placing results in public/build/
346
false
true
0
10
91
82
34
48
null
null
rvion/stack
src/Stack/Types/Config.hs
bsd-3-clause
useShaPathOnWindows :: MonadThrow m => Path Rel Dir -> m (Path Rel Dir) useShaPathOnWindows = #ifdef mingw32_HOST_OS parseRelDir . S8.unpack . S8.take 8 . B16.encode . SHA1.hash . encodeUtf8 . T.pack . toFilePath
216
useShaPathOnWindows :: MonadThrow m => Path Rel Dir -> m (Path Rel Dir) useShaPathOnWindows = #ifdef mingw32_HOST_OS parseRelDir . S8.unpack . S8.take 8 . B16.encode . SHA1.hash . encodeUtf8 . T.pack . toFilePath
216
useShaPathOnWindows = #ifdef mingw32_HOST_OS parseRelDir . S8.unpack . S8.take 8 . B16.encode . SHA1.hash . encodeUtf8 . T.pack . toFilePath
144
false
true
0
12
36
80
39
41
null
null
ezyang/ghc
libraries/base/GHC/Enum.hs
bsd-3-clause
toEnumError :: (Show a) => String -> Int -> (a,a) -> b toEnumError inst_ty i bnds = errorWithoutStackTrace $ "Enum.toEnum{" ++ inst_ty ++ "}: tag (" ++ show i ++ ") is outside of bounds " ++ show bnds
240
toEnumError :: (Show a) => String -> Int -> (a,a) -> b toEnumError inst_ty i bnds = errorWithoutStackTrace $ "Enum.toEnum{" ++ inst_ty ++ "}: tag (" ++ show i ++ ") is outside of bounds " ++ show bnds
240
toEnumError inst_ty i bnds = errorWithoutStackTrace $ "Enum.toEnum{" ++ inst_ty ++ "}: tag (" ++ show i ++ ") is outside of bounds " ++ show bnds
185
false
true
0
10
78
75
38
37
null
null
pgavin/secdh
lib/SECDH/Eval.hs
bsd-3-clause
applyPrim LambdaPP [ClosureA _ _ _ _] = trueA
74
applyPrim LambdaPP [ClosureA _ _ _ _] = trueA
74
applyPrim LambdaPP [ClosureA _ _ _ _] = trueA
74
false
false
0
6
37
25
11
14
null
null
kazu-yamamoto/wai
warp/test/SendFileSpec.hs
mit
removeFileIfExists :: FilePath -> IO () removeFileIfExists file = do exist <- doesFileExist file when exist $ removeFile file
133
removeFileIfExists :: FilePath -> IO () removeFileIfExists file = do exist <- doesFileExist file when exist $ removeFile file
133
removeFileIfExists file = do exist <- doesFileExist file when exist $ removeFile file
93
false
true
0
8
26
46
20
26
null
null
YoshikuniJujo/funpaala
samples/43_alternative/superYoshio.hs
bsd-3-clause
mevent :: Yoshio -> Event -> Maybe Yoshio mevent (hp, s) (E e) = do let hp' = hp - damage e mguard $ hp' > 0 return (hp', s)
127
mevent :: Yoshio -> Event -> Maybe Yoshio mevent (hp, s) (E e) = do let hp' = hp - damage e mguard $ hp' > 0 return (hp', s)
127
mevent (hp, s) (E e) = do let hp' = hp - damage e mguard $ hp' > 0 return (hp', s)
85
false
true
0
11
32
78
38
40
null
null
haslab/SecreC
src/Language/SecreC/TypeChecker/Expression.hs
gpl-3.0
multiplyIndexVariadicExprs :: (ProverK loc m) => loc -> Bool -> [(Expr,IsVariadic)] -> TcM m Expr multiplyIndexVariadicExprs l isTop es = addErrorM l (TypecheckerError (locpos l) . GenTcError (text "multiply index variadic expressions") . Just) $ multiplyIndexVariadicExprs' l es where multiplyIndexVariadicExprs' :: (ProverK loc m) => loc -> [(Expr,IsVariadic)] -> TcM m Expr multiplyIndexVariadicExprs' l [] = return $ indexExpr 1 multiplyIndexVariadicExprs' l [e] = multiplyIndexVariadicExpr l e multiplyIndexVariadicExprs' l (e:es) = do e' <- multiplyIndexVariadicExpr l e es' <- multiplyIndexVariadicExprs' l es multiplyIndexExprs l isTop e' es' multiplyIndexVariadicExpr :: (ProverK loc m) => loc -> (Expr,IsVariadic) -> TcM m Expr multiplyIndexVariadicExpr l (e,False) = return e multiplyIndexVariadicExpr l (e,True) = do let product = mkVarId "product" (dec,xs) <- pDecCstrM l Nothing isTop False True (PIden product) Nothing [(False,Left e,True)] (BaseT index) return $ ProcCallExpr (BaseT index) (ProcedureName (DecT dec) $ PIden product) Nothing (mapUnLeftSndThr3 xs)
1,156
multiplyIndexVariadicExprs :: (ProverK loc m) => loc -> Bool -> [(Expr,IsVariadic)] -> TcM m Expr multiplyIndexVariadicExprs l isTop es = addErrorM l (TypecheckerError (locpos l) . GenTcError (text "multiply index variadic expressions") . Just) $ multiplyIndexVariadicExprs' l es where multiplyIndexVariadicExprs' :: (ProverK loc m) => loc -> [(Expr,IsVariadic)] -> TcM m Expr multiplyIndexVariadicExprs' l [] = return $ indexExpr 1 multiplyIndexVariadicExprs' l [e] = multiplyIndexVariadicExpr l e multiplyIndexVariadicExprs' l (e:es) = do e' <- multiplyIndexVariadicExpr l e es' <- multiplyIndexVariadicExprs' l es multiplyIndexExprs l isTop e' es' multiplyIndexVariadicExpr :: (ProverK loc m) => loc -> (Expr,IsVariadic) -> TcM m Expr multiplyIndexVariadicExpr l (e,False) = return e multiplyIndexVariadicExpr l (e,True) = do let product = mkVarId "product" (dec,xs) <- pDecCstrM l Nothing isTop False True (PIden product) Nothing [(False,Left e,True)] (BaseT index) return $ ProcCallExpr (BaseT index) (ProcedureName (DecT dec) $ PIden product) Nothing (mapUnLeftSndThr3 xs)
1,156
multiplyIndexVariadicExprs l isTop es = addErrorM l (TypecheckerError (locpos l) . GenTcError (text "multiply index variadic expressions") . Just) $ multiplyIndexVariadicExprs' l es where multiplyIndexVariadicExprs' :: (ProverK loc m) => loc -> [(Expr,IsVariadic)] -> TcM m Expr multiplyIndexVariadicExprs' l [] = return $ indexExpr 1 multiplyIndexVariadicExprs' l [e] = multiplyIndexVariadicExpr l e multiplyIndexVariadicExprs' l (e:es) = do e' <- multiplyIndexVariadicExpr l e es' <- multiplyIndexVariadicExprs' l es multiplyIndexExprs l isTop e' es' multiplyIndexVariadicExpr :: (ProverK loc m) => loc -> (Expr,IsVariadic) -> TcM m Expr multiplyIndexVariadicExpr l (e,False) = return e multiplyIndexVariadicExpr l (e,True) = do let product = mkVarId "product" (dec,xs) <- pDecCstrM l Nothing isTop False True (PIden product) Nothing [(False,Left e,True)] (BaseT index) return $ ProcCallExpr (BaseT index) (ProcedureName (DecT dec) $ PIden product) Nothing (mapUnLeftSndThr3 xs)
1,058
false
true
0
13
222
417
209
208
null
null
yiannist/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
sshLoginUser :: String sshLoginUser = AutoConf.sshLoginUser
59
sshLoginUser :: String sshLoginUser = AutoConf.sshLoginUser
59
sshLoginUser = AutoConf.sshLoginUser
36
false
true
0
5
5
13
7
6
null
null
hsyl20/ViperVM
haskus-system/src/lib/Haskus/Arch/X86_64/Cpuid.hs
bsd-3-clause
-- | Processor info and feature bits procInfo :: (ProcInfo, BitSet Word64 Feature) procInfo = (BitFields a, BitSet.fromBits fs) where (a,_,c,d) = cpuid 0x01 fs = (fromIntegral c `shiftL` 32) .|. fromIntegral d
224
procInfo :: (ProcInfo, BitSet Word64 Feature) procInfo = (BitFields a, BitSet.fromBits fs) where (a,_,c,d) = cpuid 0x01 fs = (fromIntegral c `shiftL` 32) .|. fromIntegral d
187
procInfo = (BitFields a, BitSet.fromBits fs) where (a,_,c,d) = cpuid 0x01 fs = (fromIntegral c `shiftL` 32) .|. fromIntegral d
141
true
true
0
10
47
84
46
38
null
null
arybczak/haskell-mcl
test/Main.hs
bsd-3-clause
main :: IO () main = defaultMain [ testGroup "Fr" $ let fr = Proxy :: Proxy Fr in [ testProperty "arithmetic" $ testFieldOps fr , testProperty "construction" $ fr_testFromTo , testProperty "square root" $ fr_testSquareRoot , testProperty "serialization" $ testBinary fr ] , testGroup "Fp" $ let fp = Proxy :: Proxy Fp in [ testProperty "arithmetic" $ testFieldOps fp , testProperty "construction" $ fp_testFromTo , testProperty "square root" $ fp_testSquareRoot , testProperty "serialization" $ testBinary fp ] , testGroup "Fp2" $ let fp2 = Proxy :: Proxy Fp2 in [ testProperty "arithmetic" $ testFieldOps fp2 , testProperty "construction" $ fp2_testFromTo , testProperty "square root" $ fp2_testSquareRoot , testProperty "serialization" $ testBinary fp2 ] , testGroup "Fp12" $ let fp12 = Proxy :: Proxy Fp12 in [ testProperty "arithmetic" $ testFieldOps fp12 , testProperty "construction" $ fp12_testFromTo , testProperty "serialization" $ testBinary fp12 ] , testGroup "G1" $ let g1 = Proxy :: Proxy G1 in [ testProperty "arithmetic" $ testGroupOps g1 , testProperty "serialization" $ testBinary g1 ] , testGroup "G2" $ let g2 = Proxy :: Proxy G2 in [ testProperty "arithmetic" $ testGroupOps g2 , testProperty "serialization" $ testBinary g2 ] , testGroup "pairing" [ testProperty "bilinearity" $ testPairing ] ]
1,469
main :: IO () main = defaultMain [ testGroup "Fr" $ let fr = Proxy :: Proxy Fr in [ testProperty "arithmetic" $ testFieldOps fr , testProperty "construction" $ fr_testFromTo , testProperty "square root" $ fr_testSquareRoot , testProperty "serialization" $ testBinary fr ] , testGroup "Fp" $ let fp = Proxy :: Proxy Fp in [ testProperty "arithmetic" $ testFieldOps fp , testProperty "construction" $ fp_testFromTo , testProperty "square root" $ fp_testSquareRoot , testProperty "serialization" $ testBinary fp ] , testGroup "Fp2" $ let fp2 = Proxy :: Proxy Fp2 in [ testProperty "arithmetic" $ testFieldOps fp2 , testProperty "construction" $ fp2_testFromTo , testProperty "square root" $ fp2_testSquareRoot , testProperty "serialization" $ testBinary fp2 ] , testGroup "Fp12" $ let fp12 = Proxy :: Proxy Fp12 in [ testProperty "arithmetic" $ testFieldOps fp12 , testProperty "construction" $ fp12_testFromTo , testProperty "serialization" $ testBinary fp12 ] , testGroup "G1" $ let g1 = Proxy :: Proxy G1 in [ testProperty "arithmetic" $ testGroupOps g1 , testProperty "serialization" $ testBinary g1 ] , testGroup "G2" $ let g2 = Proxy :: Proxy G2 in [ testProperty "arithmetic" $ testGroupOps g2 , testProperty "serialization" $ testBinary g2 ] , testGroup "pairing" [ testProperty "bilinearity" $ testPairing ] ]
1,469
main = defaultMain [ testGroup "Fr" $ let fr = Proxy :: Proxy Fr in [ testProperty "arithmetic" $ testFieldOps fr , testProperty "construction" $ fr_testFromTo , testProperty "square root" $ fr_testSquareRoot , testProperty "serialization" $ testBinary fr ] , testGroup "Fp" $ let fp = Proxy :: Proxy Fp in [ testProperty "arithmetic" $ testFieldOps fp , testProperty "construction" $ fp_testFromTo , testProperty "square root" $ fp_testSquareRoot , testProperty "serialization" $ testBinary fp ] , testGroup "Fp2" $ let fp2 = Proxy :: Proxy Fp2 in [ testProperty "arithmetic" $ testFieldOps fp2 , testProperty "construction" $ fp2_testFromTo , testProperty "square root" $ fp2_testSquareRoot , testProperty "serialization" $ testBinary fp2 ] , testGroup "Fp12" $ let fp12 = Proxy :: Proxy Fp12 in [ testProperty "arithmetic" $ testFieldOps fp12 , testProperty "construction" $ fp12_testFromTo , testProperty "serialization" $ testBinary fp12 ] , testGroup "G1" $ let g1 = Proxy :: Proxy G1 in [ testProperty "arithmetic" $ testGroupOps g1 , testProperty "serialization" $ testBinary g1 ] , testGroup "G2" $ let g2 = Proxy :: Proxy G2 in [ testProperty "arithmetic" $ testGroupOps g2 , testProperty "serialization" $ testBinary g2 ] , testGroup "pairing" [ testProperty "bilinearity" $ testPairing ] ]
1,455
false
true
1
12
358
429
203
226
null
null
nrolland/persistentBHStyle
src/Query.hs
bsd-3-clause
getPeopleOver25FromSpainOrGermanyJoin = select $ from $ \(client `InnerJoin` country) -> do on (client ^. ClientCountry ==. country ^. CountryId) where_ ( client ^. ClientAge >. just (val 25) &&. country ^. CountryName `in_` valList [ "Spain", "Germany" ]) orderBy [ asc (client ^. ClientLastName), asc (client ^. ClientFirstName) ] return client -- getMoneyByClient :: m [(Entity Client, Value (Maybe Double))]
435
getPeopleOver25FromSpainOrGermanyJoin = select $ from $ \(client `InnerJoin` country) -> do on (client ^. ClientCountry ==. country ^. CountryId) where_ ( client ^. ClientAge >. just (val 25) &&. country ^. CountryName `in_` valList [ "Spain", "Germany" ]) orderBy [ asc (client ^. ClientLastName), asc (client ^. ClientFirstName) ] return client -- getMoneyByClient :: m [(Entity Client, Value (Maybe Double))]
435
getPeopleOver25FromSpainOrGermanyJoin = select $ from $ \(client `InnerJoin` country) -> do on (client ^. ClientCountry ==. country ^. CountryId) where_ ( client ^. ClientAge >. just (val 25) &&. country ^. CountryName `in_` valList [ "Spain", "Germany" ]) orderBy [ asc (client ^. ClientLastName), asc (client ^. ClientFirstName) ] return client -- getMoneyByClient :: m [(Entity Client, Value (Maybe Double))]
435
false
false
0
17
83
137
70
67
null
null
omefire/megaparsec
tests/Prim.hs
bsd-2-clause
prop_monad_1 :: Char -> Char -> Maybe Char -> Property prop_monad_1 a b c = checkParser p r s where p = char a >> char b r = simpleParse (char a *> char b) s s = a : b : maybeToList c
201
prop_monad_1 :: Char -> Char -> Maybe Char -> Property prop_monad_1 a b c = checkParser p r s where p = char a >> char b r = simpleParse (char a *> char b) s s = a : b : maybeToList c
201
prop_monad_1 a b c = checkParser p r s where p = char a >> char b r = simpleParse (char a *> char b) s s = a : b : maybeToList c
146
false
true
8
9
61
111
47
64
null
null
timthelion/git-toggle
Git/Pile/PathConstants.hs
gpl-3.0
gitAttributes = ".gitattributes"
32
gitAttributes = ".gitattributes"
32
gitAttributes = ".gitattributes"
32
false
false
1
5
2
10
3
7
null
null
mgsloan/airship
src/Airship/Internal/Decision.hs
mit
m05 r = do trace "m05" req <- lift request if requestMethod req == HTTP.methodPost then n05 r else lift $ halt HTTP.status410 ------------------------------------------------------------------------------ -- N column ------------------------------------------------------------------------------
324
m05 r = do trace "m05" req <- lift request if requestMethod req == HTTP.methodPost then n05 r else lift $ halt HTTP.status410 ------------------------------------------------------------------------------ -- N column ------------------------------------------------------------------------------
324
m05 r = do trace "m05" req <- lift request if requestMethod req == HTTP.methodPost then n05 r else lift $ halt HTTP.status410 ------------------------------------------------------------------------------ -- N column ------------------------------------------------------------------------------
324
false
false
1
11
56
64
28
36
null
null
brendanhay/gogol
gogol-logging/gen/Network/Google/Resource/Logging/Organizations/Locations/List.hs
mpl-2.0
-- | V1 error format. orgXgafv :: Lens' OrganizationsLocationsList (Maybe Xgafv) orgXgafv = lens _orgXgafv (\ s a -> s{_orgXgafv = a})
134
orgXgafv :: Lens' OrganizationsLocationsList (Maybe Xgafv) orgXgafv = lens _orgXgafv (\ s a -> s{_orgXgafv = a})
112
orgXgafv = lens _orgXgafv (\ s a -> s{_orgXgafv = a})
53
true
true
1
9
21
51
25
26
null
null
PeterScott/haskell-kyoto-tycoon
Database/KyotoTycoon.hs
bsd-3-clause
-- Helper function for doing optional arguments. maybeArg :: [(ByteString, ByteString)] -> (ByteString, Maybe ByteString) -> [(ByteString, ByteString)] lst `maybeArg` (name, Just value) = (name, value) : lst
216
maybeArg :: [(ByteString, ByteString)] -> (ByteString, Maybe ByteString) -> [(ByteString, ByteString)] lst `maybeArg` (name, Just value) = (name, value) : lst
167
lst `maybeArg` (name, Just value) = (name, value) : lst
55
true
true
0
8
36
78
44
34
null
null
gfredericks/ridge
Ridge/Eval.hs
epl-1.0
evalExprFn env args@[(Vector arglist'), expr] = -- Normalize (fn [] :foo) to (fn ([] :foo)) evalExprFn env [(List args)]
124
evalExprFn env args@[(Vector arglist'), expr] = -- Normalize (fn [] :foo) to (fn ([] :foo)) evalExprFn env [(List args)]
124
evalExprFn env args@[(Vector arglist'), expr] = -- Normalize (fn [] :foo) to (fn ([] :foo)) evalExprFn env [(List args)]
124
false
false
1
8
22
48
22
26
null
null
AlexeyRaga/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
primOpOutOfLine MaskStatus = True
33
primOpOutOfLine MaskStatus = True
33
primOpOutOfLine MaskStatus = True
33
false
false
0
4
3
10
4
6
null
null
gabesoft/kapi
src/Data/AesonBson.hs
bsd-3-clause
aesonifyValue (Uuid (UUID uuid)) = toJSON (decodeUtf8 uuid)
59
aesonifyValue (Uuid (UUID uuid)) = toJSON (decodeUtf8 uuid)
59
aesonifyValue (Uuid (UUID uuid)) = toJSON (decodeUtf8 uuid)
59
false
false
0
8
7
31
14
17
null
null
oldmanmike/ghc
compiler/utils/Outputable.hs
bsd-3-clause
dot = char '.'
21
dot = char '.'
21
dot = char '.'
21
false
false
0
5
10
9
4
5
null
null
ocharles/hackage-server
Distribution/Server/Framework/Auth.hs
bsd-3-clause
checkPriviledged :: MonadIO m => Users.Users -> UserId -> [PrivilegeCondition] -> m Bool checkPriviledged _users _uid [] = return False
135
checkPriviledged :: MonadIO m => Users.Users -> UserId -> [PrivilegeCondition] -> m Bool checkPriviledged _users _uid [] = return False
135
checkPriviledged _users _uid [] = return False
46
false
true
0
11
19
54
25
29
null
null
vincenthz/cryptonite
Crypto/Number/Generate.hs
bsd-3-clause
generateBetween :: MonadRandom m => Integer -> Integer -> m Integer generateBetween low high = (low +) <$> generateMax (high - low + 1)
135
generateBetween :: MonadRandom m => Integer -> Integer -> m Integer generateBetween low high = (low +) <$> generateMax (high - low + 1)
135
generateBetween low high = (low +) <$> generateMax (high - low + 1)
67
false
true
0
9
23
56
28
28
null
null
YoEight/rakhana
Data/Rakhana/Tape.hs
bsd-3-clause
-------------------------------------------------------------------------------- driveBackward :: Monad m => Drive m () driveBackward = driveDirection Backward
159
driveBackward :: Monad m => Drive m () driveBackward = driveDirection Backward
78
driveBackward = driveDirection Backward
39
true
true
0
7
12
29
14
15
null
null
nevrenato/Hets_Fork
Common/MathLink.hs
gpl-2.0
showTK :: CInt -> String showTK i | i == dfMLTKAEND = "MLTKAEND" | i == dfMLTKALL_DECODERS = "MLTKALL_DECODERS" | i == dfMLTKAPCTEND = "MLTKAPCTEND" | i == dfMLTKARRAY = "MLTKARRAY" | i == dfMLTKARRAY_DECODER = "MLTKARRAY_DECODER" | i == dfMLTKCONT = "MLTKCONT" | i == dfMLTKDIM = "MLTKDIM" | i == dfMLTKELEN = "MLTKELEN" | i == dfMLTKEND = "MLTKEND" | i == dfMLTKERR = "MLTKERR" | i == dfMLTKERROR = "MLTKERROR" | i == dfMLTKFUNC = "MLTKFUNC" | i == dfMLTKINT = "MLTKINT" | i == dfMLTKMODERNCHARS_DECODER = "MLTKMODERNCHARS_DECODER" | i == dfMLTKNULL = "MLTKNULL" | i == dfMLTKNULLSEQUENCE_DECODER = "MLTKNULLSEQUENCE_DECODER" | i == dfMLTKOLDINT = "MLTKOLDINT" | i == dfMLTKOLDREAL = "MLTKOLDREAL" | i == dfMLTKOLDSTR = "MLTKOLDSTR" | i == dfMLTKOLDSYM = "MLTKOLDSYM" | i == dfMLTKPACKED_DECODER = "MLTKPACKED_DECODER" | i == dfMLTKPACKED = "MLTKPACKED" | i == dfMLTKPCTEND = "MLTKPCTEND" | i == dfMLTKREAL = "MLTKREAL" | i == dfMLTKSEND = "MLTKSEND" | i == dfMLTKSTR = "MLTKSTR" | i == dfMLTKSYM = "MLTKSYM" | otherwise = "UNRECOGNIZED TK"
1,313
showTK :: CInt -> String showTK i | i == dfMLTKAEND = "MLTKAEND" | i == dfMLTKALL_DECODERS = "MLTKALL_DECODERS" | i == dfMLTKAPCTEND = "MLTKAPCTEND" | i == dfMLTKARRAY = "MLTKARRAY" | i == dfMLTKARRAY_DECODER = "MLTKARRAY_DECODER" | i == dfMLTKCONT = "MLTKCONT" | i == dfMLTKDIM = "MLTKDIM" | i == dfMLTKELEN = "MLTKELEN" | i == dfMLTKEND = "MLTKEND" | i == dfMLTKERR = "MLTKERR" | i == dfMLTKERROR = "MLTKERROR" | i == dfMLTKFUNC = "MLTKFUNC" | i == dfMLTKINT = "MLTKINT" | i == dfMLTKMODERNCHARS_DECODER = "MLTKMODERNCHARS_DECODER" | i == dfMLTKNULL = "MLTKNULL" | i == dfMLTKNULLSEQUENCE_DECODER = "MLTKNULLSEQUENCE_DECODER" | i == dfMLTKOLDINT = "MLTKOLDINT" | i == dfMLTKOLDREAL = "MLTKOLDREAL" | i == dfMLTKOLDSTR = "MLTKOLDSTR" | i == dfMLTKOLDSYM = "MLTKOLDSYM" | i == dfMLTKPACKED_DECODER = "MLTKPACKED_DECODER" | i == dfMLTKPACKED = "MLTKPACKED" | i == dfMLTKPCTEND = "MLTKPCTEND" | i == dfMLTKREAL = "MLTKREAL" | i == dfMLTKSEND = "MLTKSEND" | i == dfMLTKSTR = "MLTKSTR" | i == dfMLTKSYM = "MLTKSYM" | otherwise = "UNRECOGNIZED TK"
1,313
showTK i | i == dfMLTKAEND = "MLTKAEND" | i == dfMLTKALL_DECODERS = "MLTKALL_DECODERS" | i == dfMLTKAPCTEND = "MLTKAPCTEND" | i == dfMLTKARRAY = "MLTKARRAY" | i == dfMLTKARRAY_DECODER = "MLTKARRAY_DECODER" | i == dfMLTKCONT = "MLTKCONT" | i == dfMLTKDIM = "MLTKDIM" | i == dfMLTKELEN = "MLTKELEN" | i == dfMLTKEND = "MLTKEND" | i == dfMLTKERR = "MLTKERR" | i == dfMLTKERROR = "MLTKERROR" | i == dfMLTKFUNC = "MLTKFUNC" | i == dfMLTKINT = "MLTKINT" | i == dfMLTKMODERNCHARS_DECODER = "MLTKMODERNCHARS_DECODER" | i == dfMLTKNULL = "MLTKNULL" | i == dfMLTKNULLSEQUENCE_DECODER = "MLTKNULLSEQUENCE_DECODER" | i == dfMLTKOLDINT = "MLTKOLDINT" | i == dfMLTKOLDREAL = "MLTKOLDREAL" | i == dfMLTKOLDSTR = "MLTKOLDSTR" | i == dfMLTKOLDSYM = "MLTKOLDSYM" | i == dfMLTKPACKED_DECODER = "MLTKPACKED_DECODER" | i == dfMLTKPACKED = "MLTKPACKED" | i == dfMLTKPCTEND = "MLTKPCTEND" | i == dfMLTKREAL = "MLTKREAL" | i == dfMLTKSEND = "MLTKSEND" | i == dfMLTKSTR = "MLTKSTR" | i == dfMLTKSYM = "MLTKSYM" | otherwise = "UNRECOGNIZED TK"
1,288
false
true
0
8
444
435
201
234
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
4386 = 4385
11
4386 = 4385
11
4386 = 4385
11
false
false
1
5
2
10
3
7
null
null
alexkalderimis/mathbot
src/WordProblem.hs
mit
readNum :: String -> Maybe (Integer, String) readNum input = do let (f, input') = readFromMapWithDefault id prefixOps input (num, rest) <- readInteger input' return (f num, rest)
190
readNum :: String -> Maybe (Integer, String) readNum input = do let (f, input') = readFromMapWithDefault id prefixOps input (num, rest) <- readInteger input' return (f num, rest)
190
readNum input = do let (f, input') = readFromMapWithDefault id prefixOps input (num, rest) <- readInteger input' return (f num, rest)
145
false
true
0
10
39
81
40
41
null
null
adbrowne/dynamodb-eventstore
dynamodb-eventstore/src/DynamoDbEventStore/Storage/GlobalStreamItem.hs
mit
globalFeedItemsProducer QueryDirectionForward = globalFeedItemsProducerInternal (\(PageKey p) -> PageKey (p + 1))
113
globalFeedItemsProducer QueryDirectionForward = globalFeedItemsProducerInternal (\(PageKey p) -> PageKey (p + 1))
113
globalFeedItemsProducer QueryDirectionForward = globalFeedItemsProducerInternal (\(PageKey p) -> PageKey (p + 1))
113
false
false
0
10
10
36
18
18
null
null
Daniel-Diaz/rachel
Rachel/Types.hs
bsd-3-clause
-- | Add a sufix to all the variables in a type. sufixType :: String -> Type -> Type sufixType str = mapTypeVars (++str)
120
sufixType :: String -> Type -> Type sufixType str = mapTypeVars (++str)
71
sufixType str = mapTypeVars (++str)
35
true
true
0
6
23
30
16
14
null
null
lukexi/bindings-GLFW
Test.hs
bsd-2-clause
test_glfwGetWindowMonitor :: Ptr C'GLFWwindow -> Ptr C'GLFWmonitor -> IO () test_glfwGetWindowMonitor p'win _ = do p'mon <- c'glfwGetWindowMonitor p'win p'mon @?= nullPtr
178
test_glfwGetWindowMonitor :: Ptr C'GLFWwindow -> Ptr C'GLFWmonitor -> IO () test_glfwGetWindowMonitor p'win _ = do p'mon <- c'glfwGetWindowMonitor p'win p'mon @?= nullPtr
178
test_glfwGetWindowMonitor p'win _ = do p'mon <- c'glfwGetWindowMonitor p'win p'mon @?= nullPtr
102
false
true
0
8
29
52
23
29
null
null
bgamari/text
benchmarks/haskell/Benchmarks/Programs/StripTags.hs
bsd-2-clause
benchmark :: FilePath -> Handle -> Benchmark benchmark i o = bgroup "StripTags" [ bench "String" $ whnfIO $ readFile i >>= hPutStr o . string , bench "ByteString" $ whnfIO $ B.readFile i >>= B.hPutStr o . byteString , bench "Text" $ whnfIO $ T.readFile i >>= T.hPutStr o . text , bench "TextByteString" $ whnfIO $ B.readFile i >>= B.hPutStr o . T.encodeUtf8 . text . T.decodeUtf8 ]
409
benchmark :: FilePath -> Handle -> Benchmark benchmark i o = bgroup "StripTags" [ bench "String" $ whnfIO $ readFile i >>= hPutStr o . string , bench "ByteString" $ whnfIO $ B.readFile i >>= B.hPutStr o . byteString , bench "Text" $ whnfIO $ T.readFile i >>= T.hPutStr o . text , bench "TextByteString" $ whnfIO $ B.readFile i >>= B.hPutStr o . T.encodeUtf8 . text . T.decodeUtf8 ]
409
benchmark i o = bgroup "StripTags" [ bench "String" $ whnfIO $ readFile i >>= hPutStr o . string , bench "ByteString" $ whnfIO $ B.readFile i >>= B.hPutStr o . byteString , bench "Text" $ whnfIO $ T.readFile i >>= T.hPutStr o . text , bench "TextByteString" $ whnfIO $ B.readFile i >>= B.hPutStr o . T.encodeUtf8 . text . T.decodeUtf8 ]
364
false
true
0
12
97
166
78
88
null
null
mapinguari/SC_HS_Proxy
src/Proxy/Query/Unit.hs
mit
isSpellCaster ProtossCyberneticsCore = False
44
isSpellCaster ProtossCyberneticsCore = False
44
isSpellCaster ProtossCyberneticsCore = False
44
false
false
0
5
3
9
4
5
null
null
dbp/snaplet-wordpress
spec/Common.hs
bsd-3-clause
page1 :: Value page1 = object [ "id" .= (3 :: Int) , "date" .= ("2014-10-20T07:00:00" :: Text) , "title" .= object ["rendered" .= ("Page foo" :: Text)] , "content" .= object ["rendered" .= ("<b>rendered</b> page content" :: Text)] , "department" .= ("15" :: Text) ]
340
page1 :: Value page1 = object [ "id" .= (3 :: Int) , "date" .= ("2014-10-20T07:00:00" :: Text) , "title" .= object ["rendered" .= ("Page foo" :: Text)] , "content" .= object ["rendered" .= ("<b>rendered</b> page content" :: Text)] , "department" .= ("15" :: Text) ]
340
page1 = object [ "id" .= (3 :: Int) , "date" .= ("2014-10-20T07:00:00" :: Text) , "title" .= object ["rendered" .= ("Page foo" :: Text)] , "content" .= object ["rendered" .= ("<b>rendered</b> page content" :: Text)] , "department" .= ("15" :: Text) ]
325
false
true
0
11
120
99
57
42
null
null
lukaramu/yarn
src/Main.hs
mit
parseCommand :: String -> UserCommand parseCommand = words
58
parseCommand :: String -> UserCommand parseCommand = words
58
parseCommand = words
20
false
true
0
5
7
15
8
7
null
null
micknelso/language-c
src/Language/CFamily/C/Analysis/Export.hs
bsd-3-clause
exportArraySize (UnknownArraySize complete) = CNoArrSize complete
65
exportArraySize (UnknownArraySize complete) = CNoArrSize complete
65
exportArraySize (UnknownArraySize complete) = CNoArrSize complete
65
false
false
0
7
5
18
8
10
null
null
markborkum/json2rdf-hs
src/Data/DescriptorTree.hs
unlicense
toList' (UnionNode []) = id
29
toList' (UnionNode []) = id
29
toList' (UnionNode []) = id
29
false
false
0
7
6
18
8
10
null
null
laszlopandy/elm-compiler
src/Type/Type.hs
bsd-3-clause
getVarNames :: Variable -> IO (Set.Set String) getVarNames var = do desc <- UF.descriptor var if _mark desc == getVarNamesMark then return Set.empty else do UF.setDescriptor var (desc { _mark = getVarNamesMark }) getVarNamesHelp (_content desc)
305
getVarNames :: Variable -> IO (Set.Set String) getVarNames var = do desc <- UF.descriptor var if _mark desc == getVarNamesMark then return Set.empty else do UF.setDescriptor var (desc { _mark = getVarNamesMark }) getVarNamesHelp (_content desc)
305
getVarNames var = do desc <- UF.descriptor var if _mark desc == getVarNamesMark then return Set.empty else do UF.setDescriptor var (desc { _mark = getVarNamesMark }) getVarNamesHelp (_content desc)
258
false
true
0
13
96
97
46
51
null
null
janschulz/pandoc
src/Text/Pandoc/Readers/HTML.hs
gpl-2.0
mathMLToTeXMath :: String -> Either String String mathMLToTeXMath s = writeTeX <$> readMathML s
95
mathMLToTeXMath :: String -> Either String String mathMLToTeXMath s = writeTeX <$> readMathML s
95
mathMLToTeXMath s = writeTeX <$> readMathML s
45
false
true
2
7
13
35
15
20
null
null
ssoudan/hsChess
src/Move.hs
apache-2.0
moves Bishop = [(0,0)] ++ [(y,y) | y <- [-7..7], y /= 0] ++ [(-y,y) | y <- [-7..7], y /= 0]
91
moves Bishop = [(0,0)] ++ [(y,y) | y <- [-7..7], y /= 0] ++ [(-y,y) | y <- [-7..7], y /= 0]
91
moves Bishop = [(0,0)] ++ [(y,y) | y <- [-7..7], y /= 0] ++ [(-y,y) | y <- [-7..7], y /= 0]
91
false
false
0
11
21
92
51
41
null
null
noteed/sentry
Sentry/Server/Core.hs
bsd-3-clause
compile :: Sentry -> IO Bool compile state = do home <- getHomeDirectory let sentry = home </> ".sentryd" conf = sentry </> "conf" binPath = sExecutablePath state sourcePath = binPath <.> "hs" errorPath = binPath <.> "error" if takeDirectory binPath /= conf then do hPutStrLn stderr $ binPath ++ " is not under " ++ conf ++ "." return False else do status <- withFile errorPath WriteMode $ \h -> do p <- runProcess "ghc" [ "--make", sourcePath, "-fforce-recomp", "-v0", "-threaded", "-o", binPath] (Just conf) Nothing Nothing Nothing (Just h) waitForProcess p if status == ExitSuccess then do putStrLn $ sourcePath ++ " successfully compiled." return True else do content <- readFile errorPath hPutStrLn stderr $ "Problem encountered while compiling " ++ sourcePath ++ ":" hPutStrLn stderr content return False -- | Save the application state then re-exec itself (calling `sentryd continue`).
1,091
compile :: Sentry -> IO Bool compile state = do home <- getHomeDirectory let sentry = home </> ".sentryd" conf = sentry </> "conf" binPath = sExecutablePath state sourcePath = binPath <.> "hs" errorPath = binPath <.> "error" if takeDirectory binPath /= conf then do hPutStrLn stderr $ binPath ++ " is not under " ++ conf ++ "." return False else do status <- withFile errorPath WriteMode $ \h -> do p <- runProcess "ghc" [ "--make", sourcePath, "-fforce-recomp", "-v0", "-threaded", "-o", binPath] (Just conf) Nothing Nothing Nothing (Just h) waitForProcess p if status == ExitSuccess then do putStrLn $ sourcePath ++ " successfully compiled." return True else do content <- readFile errorPath hPutStrLn stderr $ "Problem encountered while compiling " ++ sourcePath ++ ":" hPutStrLn stderr content return False -- | Save the application state then re-exec itself (calling `sentryd continue`).
1,091
compile state = do home <- getHomeDirectory let sentry = home </> ".sentryd" conf = sentry </> "conf" binPath = sExecutablePath state sourcePath = binPath <.> "hs" errorPath = binPath <.> "error" if takeDirectory binPath /= conf then do hPutStrLn stderr $ binPath ++ " is not under " ++ conf ++ "." return False else do status <- withFile errorPath WriteMode $ \h -> do p <- runProcess "ghc" [ "--make", sourcePath, "-fforce-recomp", "-v0", "-threaded", "-o", binPath] (Just conf) Nothing Nothing Nothing (Just h) waitForProcess p if status == ExitSuccess then do putStrLn $ sourcePath ++ " successfully compiled." return True else do content <- readFile errorPath hPutStrLn stderr $ "Problem encountered while compiling " ++ sourcePath ++ ":" hPutStrLn stderr content return False -- | Save the application state then re-exec itself (calling `sentryd continue`).
1,062
false
true
0
18
341
279
134
145
null
null
sizur/haskell-i18n
Text/I18n/Printf.hs
bsd-3-clause
uprintf (c:cs) us = c:uprintf cs us
43
uprintf (c:cs) us = c:uprintf cs us
43
uprintf (c:cs) us = c:uprintf cs us
43
false
false
0
7
14
27
13
14
null
null
DanielSchiavini/ampersand
src/Database/Design/Ampersand/Input/ADL1/ParsingLib.hs
gpl-3.0
----------------------------------------------------------- -- Token parsers ----------------------------------------------------------- check :: (Lexeme -> Maybe a) -> AmpParser a check predicate = tokenPrim showTok nextPos matchTok where -- Token pretty-printing function showTok :: Token -> String showTok (Tok lx _) = show lx -- Next position calculating function nextPos :: SourcePos -> Token -> [Token] -> SourcePos nextPos pos _ [] = pos nextPos _ _ (Tok _ (FilePos file line col):_) = newPos file line col -- ^ Matching function for the token to parse. matchTok (Tok l _) = predicate l
671
check :: (Lexeme -> Maybe a) -> AmpParser a check predicate = tokenPrim showTok nextPos matchTok where -- Token pretty-printing function showTok :: Token -> String showTok (Tok lx _) = show lx -- Next position calculating function nextPos :: SourcePos -> Token -> [Token] -> SourcePos nextPos pos _ [] = pos nextPos _ _ (Tok _ (FilePos file line col):_) = newPos file line col -- ^ Matching function for the token to parse. matchTok (Tok l _) = predicate l
533
check predicate = tokenPrim showTok nextPos matchTok where -- Token pretty-printing function showTok :: Token -> String showTok (Tok lx _) = show lx -- Next position calculating function nextPos :: SourcePos -> Token -> [Token] -> SourcePos nextPos pos _ [] = pos nextPos _ _ (Tok _ (FilePos file line col):_) = newPos file line col -- ^ Matching function for the token to parse. matchTok (Tok l _) = predicate l
489
true
true
6
9
165
168
86
82
null
null
devtype-blogspot-com/Haskell-Examples
OddCont/Demo.hs
gpl-3.0
concatOC :: OddCont (OddCont a) -> OddCont a {- Îíà äîëæíà îáåñïå÷èâàòü äëÿ òèïà OddCont ïîâåäåíèå ýêâèâàëåíòíîå ïîâåäåíèþ ôóíêöèè concat äëÿ ñïèñêîâ. GHCi> concatOC $ Singl (Singl 42) Singl 42 GHCi> let tst1 = BiCons 'a' 'b' (Singl 'c') GHCi> let tst2 = BiCons 'd' 'e' (BiCons 'f' 'g' (Singl 'h')) GHCi> let tst3 = BiCons 'i' 'j' (Singl 'k') GHCi> concatOC $ BiCons tst1 tst2 (Singl tst3) BiCons 'a' 'b' (BiCons 'c' 'd' (BiCons 'e' 'f' (BiCons 'g' 'h' (BiCons 'i' 'j' (Singl 'k'))))) -} concatOC = lst2OddCont . oddCont2Lst'
527
concatOC :: OddCont (OddCont a) -> OddCont a concatOC = lst2OddCont . oddCont2Lst'
82
concatOC = lst2OddCont . oddCont2Lst'
37
true
true
0
8
92
32
16
16
null
null
RAFIRAF/HASKELL
IO/ileLinii.hs
mit
policzLinie :: FilePath -> IO () policzLinie file = do fileExists <- doesFileExist file if fileExists then do contents <- readFile file putStrLn . show . length . lines $ contents else putStrLn "File does not exist!"
225
policzLinie :: FilePath -> IO () policzLinie file = do fileExists <- doesFileExist file if fileExists then do contents <- readFile file putStrLn . show . length . lines $ contents else putStrLn "File does not exist!"
224
policzLinie file = do fileExists <- doesFileExist file if fileExists then do contents <- readFile file putStrLn . show . length . lines $ contents else putStrLn "File does not exist!"
191
false
true
3
14
45
80
36
44
null
null
spell-music/temporal-music-notation
src/Temporal/Music/Score.hs
bsd-3-clause
-- | Input becomes quieter by given number of levels. quieter :: (VolumeLike a) => Int -> Score a -> Score a quieter = louder . negate
134
quieter :: (VolumeLike a) => Int -> Score a -> Score a quieter = louder . negate
80
quieter = louder . negate
25
true
true
0
8
26
39
20
19
null
null
markus-git/imperative-edsl-vhdl
src/Language/Embedded/VHDL/Monad.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- Null statements. null :: MonadV m => m () null = addSequential $ SNull $ NullStatement Nothing
179
null :: MonadV m => m () null = addSequential $ SNull $ NullStatement Nothing
77
null = addSequential $ SNull $ NullStatement Nothing
52
true
true
4
8
19
43
19
24
null
null
spechub/Hets
CMDL/InfoCommands.hs
gpl-2.0
-- show theory of input nodes cShowTheory :: CmdlUseTranslation -> String -> CmdlState -> IO CmdlState cShowTheory useTrans input state = getInfoFromNodes input (concatMap (\ n -> getThS useTrans n state)) state
213
cShowTheory :: CmdlUseTranslation -> String -> CmdlState -> IO CmdlState cShowTheory useTrans input state = getInfoFromNodes input (concatMap (\ n -> getThS useTrans n state)) state
183
cShowTheory useTrans input state = getInfoFromNodes input (concatMap (\ n -> getThS useTrans n state)) state
110
true
true
0
10
33
62
31
31
null
null
oldmanmike/ghc
compiler/typecheck/TcEvidence.hs
bsd-3-clause
mkTcFunCo = mkFunCo
32
mkTcFunCo = mkFunCo
32
mkTcFunCo = mkFunCo
32
false
false
0
4
15
6
3
3
null
null
nominolo/haddock2
src/Haddock/Utils.hs
bsd-2-clause
mapMaybeM f (Just a) = liftM Just (f a)
39
mapMaybeM f (Just a) = liftM Just (f a)
39
mapMaybeM f (Just a) = liftM Just (f a)
39
false
false
0
7
8
30
13
17
null
null
pranjaltale16/codeworld
codeworld-base/src/Internal/Picture.hs
apache-2.0
-- | A picture drawn translated in these directions. translated :: HasCallStack => (Picture, Number, Number) -> Picture translated (p, x, y) = withFrozenCallStack $ CWPic (CW.translated (toDouble x) (toDouble y) (toCWPic p))
228
translated :: HasCallStack => (Picture, Number, Number) -> Picture translated (p, x, y) = withFrozenCallStack $ CWPic (CW.translated (toDouble x) (toDouble y) (toCWPic p))
175
translated (p, x, y) = withFrozenCallStack $ CWPic (CW.translated (toDouble x) (toDouble y) (toCWPic p))
108
true
true
0
10
36
79
42
37
null
null
Soostone/snaplet-persistent
src/Snap/Snaplet/Persistent.hs
bsd-3-clause
------------------------------------------------------------------------------- -- | Makes a ByteString representation of a Key. showKeyBS :: ToBackendKey SqlBackend e => Key e -> ByteString showKeyBS = T.encodeUtf8 . showKey
225
showKeyBS :: ToBackendKey SqlBackend e => Key e -> ByteString showKeyBS = T.encodeUtf8 . showKey
96
showKeyBS = T.encodeUtf8 . showKey
34
true
true
0
8
24
42
19
23
null
null
nevrenato/Hets_Fork
Syntax/ToXml.hs
gpl-2.0
ghiding :: GlobalAnnos -> G_hiding -> Element ghiding ga gm = case gm of G_symb_list l -> unode "Hiding" $ gSymbItemList ga l G_logic_projection lc -> add_attrs (logicCode lc) $ unode "Logicprojection" ()
212
ghiding :: GlobalAnnos -> G_hiding -> Element ghiding ga gm = case gm of G_symb_list l -> unode "Hiding" $ gSymbItemList ga l G_logic_projection lc -> add_attrs (logicCode lc) $ unode "Logicprojection" ()
212
ghiding ga gm = case gm of G_symb_list l -> unode "Hiding" $ gSymbItemList ga l G_logic_projection lc -> add_attrs (logicCode lc) $ unode "Logicprojection" ()
166
false
true
4
6
40
52
30
22
null
null
haskell/haddock
haddock-api/src/Haddock.hs
bsd-2-clause
getHaddockLibDir :: [Flag] -> IO FilePath getHaddockLibDir flags = case [str | Flag_Lib str <- flags] of [] -> do #ifdef IN_GHC_TREE -- When in the GHC tree, we should be able to locate the "lib" folder -- based on the location of the current executable. base_dir <- getBaseDir -- Provided by GHC let res_dirs = [ d | Just d <- [base_dir] ] ++ #else -- When Haddock was installed by @cabal@, the resources (which are listed -- under @data-files@ in the Cabal file) will have been copied to a -- special directory. data_dir <- getDataDir -- Provided by Cabal let res_dirs = [ data_dir ] ++ #endif -- When Haddock is built locally (eg. regular @cabal new-build@), the data -- directory does not exist and we are probably invoking from either -- @./haddock-api@ or @./@ [ "resources" , "haddock-api/resources" ] res_dir <- check res_dirs case res_dir of Just p -> return p _ -> die "Haddock's resource directory does not exist!\n" fs -> return (last fs) where -- Pick the first path that corresponds to a directory that exists check :: [FilePath] -> IO (Maybe FilePath) check [] = pure Nothing check (path : other_paths) = do exists <- doesDirectoryExist path if exists then pure (Just path) else check other_paths -- | Find the @lib@ directory for GHC and the path to @ghc@
1,497
getHaddockLibDir :: [Flag] -> IO FilePath getHaddockLibDir flags = case [str | Flag_Lib str <- flags] of [] -> do #ifdef IN_GHC_TREE -- When in the GHC tree, we should be able to locate the "lib" folder -- based on the location of the current executable. base_dir <- getBaseDir -- Provided by GHC let res_dirs = [ d | Just d <- [base_dir] ] ++ #else -- When Haddock was installed by @cabal@, the resources (which are listed -- under @data-files@ in the Cabal file) will have been copied to a -- special directory. data_dir <- getDataDir -- Provided by Cabal let res_dirs = [ data_dir ] ++ #endif -- When Haddock is built locally (eg. regular @cabal new-build@), the data -- directory does not exist and we are probably invoking from either -- @./haddock-api@ or @./@ [ "resources" , "haddock-api/resources" ] res_dir <- check res_dirs case res_dir of Just p -> return p _ -> die "Haddock's resource directory does not exist!\n" fs -> return (last fs) where -- Pick the first path that corresponds to a directory that exists check :: [FilePath] -> IO (Maybe FilePath) check [] = pure Nothing check (path : other_paths) = do exists <- doesDirectoryExist path if exists then pure (Just path) else check other_paths -- | Find the @lib@ directory for GHC and the path to @ghc@
1,497
getHaddockLibDir flags = case [str | Flag_Lib str <- flags] of [] -> do #ifdef IN_GHC_TREE -- When in the GHC tree, we should be able to locate the "lib" folder -- based on the location of the current executable. base_dir <- getBaseDir -- Provided by GHC let res_dirs = [ d | Just d <- [base_dir] ] ++ #else -- When Haddock was installed by @cabal@, the resources (which are listed -- under @data-files@ in the Cabal file) will have been copied to a -- special directory. data_dir <- getDataDir -- Provided by Cabal let res_dirs = [ data_dir ] ++ #endif -- When Haddock is built locally (eg. regular @cabal new-build@), the data -- directory does not exist and we are probably invoking from either -- @./haddock-api@ or @./@ [ "resources" , "haddock-api/resources" ] res_dir <- check res_dirs case res_dir of Just p -> return p _ -> die "Haddock's resource directory does not exist!\n" fs -> return (last fs) where -- Pick the first path that corresponds to a directory that exists check :: [FilePath] -> IO (Maybe FilePath) check [] = pure Nothing check (path : other_paths) = do exists <- doesDirectoryExist path if exists then pure (Just path) else check other_paths -- | Find the @lib@ directory for GHC and the path to @ghc@
1,455
false
true
0
17
450
251
124
127
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F15.hs
bsd-3-clause
ptr_glLineStipple :: FunPtr (GLint -> GLushort -> IO ()) ptr_glLineStipple = unsafePerformIO $ getCommand "glLineStipple"
121
ptr_glLineStipple :: FunPtr (GLint -> GLushort -> IO ()) ptr_glLineStipple = unsafePerformIO $ getCommand "glLineStipple"
121
ptr_glLineStipple = unsafePerformIO $ getCommand "glLineStipple"
64
false
true
0
11
14
42
19
23
null
null
TikhonJelvis/TPL
test/TPL/Test/Parse.hs
gpl-3.0
isNumber _ _ = False
31
isNumber _ _ = False
31
isNumber _ _ = False
31
false
false
0
5
15
11
5
6
null
null
bgamari/minir
MinIR/NGramTrie.hs
bsd-3-clause
insert (n:rest) v (NGTrie value children) = NGTrie value children' where children' = let child = maybe (NGTrie mempty HM.empty) id $ HM.lookup n children child' = insert rest v child in HM.insert n child' children
289
insert (n:rest) v (NGTrie value children) = NGTrie value children' where children' = let child = maybe (NGTrie mempty HM.empty) id $ HM.lookup n children child' = insert rest v child in HM.insert n child' children
289
insert (n:rest) v (NGTrie value children) = NGTrie value children' where children' = let child = maybe (NGTrie mempty HM.empty) id $ HM.lookup n children child' = insert rest v child in HM.insert n child' children
289
false
false
0
13
111
99
47
52
null
null
pviafore/AdventOfCode2016
day1/challenge1/challenge1.hs
mit
rotate East L = North
21
rotate East L = North
21
rotate East L = North
21
false
false
0
5
4
11
5
6
null
null
ejlilley/AbstractMusic
LilyParse.hs
gpl-3.0
relativeExpr base (Fix (LilyFixed _ e)) = (base, e)
51
relativeExpr base (Fix (LilyFixed _ e)) = (base, e)
51
relativeExpr base (Fix (LilyFixed _ e)) = (base, e)
51
false
false
0
9
8
31
16
15
null
null
h-core/haskell-random
palindrome.hs
mit
--Compare two strings and print where equal (ie. where they're pals) pals [] _ = []
83
pals [] _ = []
14
pals [] _ = []
14
true
false
0
6
15
16
8
8
null
null
thoughtpolice/hs-leveldb
src/Database/LevelDB/IO.hs
bsd-3-clause
compactAll :: DB -> IO () compactAll db = compactRange db Nothing Nothing
73
compactAll :: DB -> IO () compactAll db = compactRange db Nothing Nothing
73
compactAll db = compactRange db Nothing Nothing
47
false
true
0
7
12
30
14
16
null
null
fpco/inline-c
inline-c/src/Language/C/Types/Parse.hs
mit
-- | Useful for quick testing. Uses @\"quickCParser\"@ as source name, and throws -- an 'error' if parsing fails. quickCParser :: CParserContext i -> String -- ^ String to parse. -> (ReaderT (CParserContext i) (Parsec.Parsec String ()) a) -- ^ Parser. Anything with type @forall m. CParser i m => m a@ is a -- valid argument. -> a quickCParser typeNames s p = case runCParser typeNames "quickCParser" s p of Left err -> error $ "quickCParser: " ++ show err Right x -> x -- | Like 'quickCParser', but uses @'cCParserContext' ('const' 'False')@ as -- 'CParserContext'.
587
quickCParser :: CParserContext i -> String -- ^ String to parse. -> (ReaderT (CParserContext i) (Parsec.Parsec String ()) a) -- ^ Parser. Anything with type @forall m. CParser i m => m a@ is a -- valid argument. -> a quickCParser typeNames s p = case runCParser typeNames "quickCParser" s p of Left err -> error $ "quickCParser: " ++ show err Right x -> x -- | Like 'quickCParser', but uses @'cCParserContext' ('const' 'False')@ as -- 'CParserContext'.
472
quickCParser typeNames s p = case runCParser typeNames "quickCParser" s p of Left err -> error $ "quickCParser: " ++ show err Right x -> x -- | Like 'quickCParser', but uses @'cCParserContext' ('const' 'False')@ as -- 'CParserContext'.
240
true
true
0
13
117
116
57
59
null
null
techtangents/missingm
tests/Main.hs
bsd-3-clause
prop_findMapMvsfilter :: (Int -> Int) -> (Int -> Bool) -> [Int] -> Bool prop_findMapMvsfilter mapper tester as = let amb x = let b = mapper x in if tester b then Just b else Nothing in runIdentity (findMapM (return . amb) as) == (listToMaybe (filter tester (fmap mapper as)))
279
prop_findMapMvsfilter :: (Int -> Int) -> (Int -> Bool) -> [Int] -> Bool prop_findMapMvsfilter mapper tester as = let amb x = let b = mapper x in if tester b then Just b else Nothing in runIdentity (findMapM (return . amb) as) == (listToMaybe (filter tester (fmap mapper as)))
279
prop_findMapMvsfilter mapper tester as = let amb x = let b = mapper x in if tester b then Just b else Nothing in runIdentity (findMapM (return . amb) as) == (listToMaybe (filter tester (fmap mapper as)))
207
false
true
0
13
53
133
66
67
null
null
benb/MetAl
src/Phylo/Alignment/DistSet.hs
gpl-3.0
setPairTrig xs [] = []
22
setPairTrig xs [] = []
22
setPairTrig xs [] = []
22
false
false
0
6
4
15
7
8
null
null
abhin4v/hask-irc
hask-irc-handlers/Network/IRC/Handlers/NickTracker.hs
apache-2.0
stopNickTracker :: MonadMsgHandler m => IORef NickTrackingState -> m () stopNickTracker state = io $ do NickTrackingState { .. } <- readIORef state createArchive acid createCheckpointAndClose acid
202
stopNickTracker :: MonadMsgHandler m => IORef NickTrackingState -> m () stopNickTracker state = io $ do NickTrackingState { .. } <- readIORef state createArchive acid createCheckpointAndClose acid
202
stopNickTracker state = io $ do NickTrackingState { .. } <- readIORef state createArchive acid createCheckpointAndClose acid
130
false
true
2
10
32
71
29
42
null
null