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
phylake/avm3
vm/store.hs
mit
xform_opCode {- 0xAC -} i u d s m t (Abc.StrictEquals) = [StrictEquals]
71
xform_opCode {- 0xAC -} i u d s m t (Abc.StrictEquals) = [StrictEquals]
71
xform_opCode {- 0xAC -} i u d s m t (Abc.StrictEquals) = [StrictEquals]
71
false
false
0
7
12
30
16
14
null
null
spechub/Hets
OWL2/ASKeywords.hs
gpl-2.0
datatypeRestrictionS :: String datatypeRestrictionS = "DatatypeRestriction"
75
datatypeRestrictionS :: String datatypeRestrictionS = "DatatypeRestriction"
75
datatypeRestrictionS = "DatatypeRestriction"
44
false
true
0
4
5
11
6
5
null
null
romanb/amazonka
amazonka-iam/gen/Network/AWS/IAM/Types.hs
mpl-2.0
-- | 'InstanceProfile' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'ipArn' @::@ 'Text' -- -- * 'ipCreateDate' @::@ 'UTCTime' -- -- * 'ipInstanceProfileId' @::@ 'Text' -- -- * 'ipInstanceProfileName' @::@ 'Text' -- -- * 'ipPath' @::@ 'Text' -- -- * 'ipRoles' @::@ ['Role'] -- instanceProfile :: Text -- ^ 'ipPath' -> Text -- ^ 'ipInstanceProfileName' -> Text -- ^ 'ipInstanceProfileId' -> Text -- ^ 'ipArn' -> UTCTime -- ^ 'ipCreateDate' -> InstanceProfile instanceProfile p1 p2 p3 p4 p5 = InstanceProfile { _ipPath = p1 , _ipInstanceProfileName = p2 , _ipInstanceProfileId = p3 , _ipArn = p4 , _ipCreateDate = withIso _Time (const id) p5 , _ipRoles = mempty }
862
instanceProfile :: Text -- ^ 'ipPath' -> Text -- ^ 'ipInstanceProfileName' -> Text -- ^ 'ipInstanceProfileId' -> Text -- ^ 'ipArn' -> UTCTime -- ^ 'ipCreateDate' -> InstanceProfile instanceProfile p1 p2 p3 p4 p5 = InstanceProfile { _ipPath = p1 , _ipInstanceProfileName = p2 , _ipInstanceProfileId = p3 , _ipArn = p4 , _ipCreateDate = withIso _Time (const id) p5 , _ipRoles = mempty }
548
instanceProfile p1 p2 p3 p4 p5 = InstanceProfile { _ipPath = p1 , _ipInstanceProfileName = p2 , _ipInstanceProfileId = p3 , _ipArn = p4 , _ipCreateDate = withIso _Time (const id) p5 , _ipRoles = mempty }
287
true
true
0
11
278
123
75
48
null
null
kawamuray/ganeti
src/Ganeti/ConfigReader.hs
gpl-2.0
onInotify inotify path save_fn mstate _ = modifyMVar_ mstate $ \state -> if reloadModel state == ReloadNotify then do ctime <- getCurrentTimeUSec (newfstat, _) <- safeUpdateConfig path (reloadFStat state) save_fn let state' = state { reloadFStat = newfstat, reloadTime = ctime } if abs (reloadTime state - ctime) < reloadRatelimit then do mode <- moveToPolling "too many reloads" inotify path save_fn mstate return state' { reloadModel = mode } else return state' else return state
619
onInotify inotify path save_fn mstate _ = modifyMVar_ mstate $ \state -> if reloadModel state == ReloadNotify then do ctime <- getCurrentTimeUSec (newfstat, _) <- safeUpdateConfig path (reloadFStat state) save_fn let state' = state { reloadFStat = newfstat, reloadTime = ctime } if abs (reloadTime state - ctime) < reloadRatelimit then do mode <- moveToPolling "too many reloads" inotify path save_fn mstate return state' { reloadModel = mode } else return state' else return state
619
onInotify inotify path save_fn mstate _ = modifyMVar_ mstate $ \state -> if reloadModel state == ReloadNotify then do ctime <- getCurrentTimeUSec (newfstat, _) <- safeUpdateConfig path (reloadFStat state) save_fn let state' = state { reloadFStat = newfstat, reloadTime = ctime } if abs (reloadTime state - ctime) < reloadRatelimit then do mode <- moveToPolling "too many reloads" inotify path save_fn mstate return state' { reloadModel = mode } else return state' else return state
619
false
false
0
15
212
166
82
84
null
null
Forkk/ChatCore
ChatCore/Util/KeyedEnum.hs
mit
mkDataCons (Just name) cType [] = return [NormalC name [(IsStrict, cType)]]
79
mkDataCons (Just name) cType [] = return [NormalC name [(IsStrict, cType)]]
79
mkDataCons (Just name) cType [] = return [NormalC name [(IsStrict, cType)]]
79
false
false
0
9
14
41
21
20
null
null
sdiehl/ghc
testsuite/tests/simplCore/should_compile/T14779b.hs
bsd-3-clause
showConstr :: Constr -> String showConstr = constring
53
showConstr :: Constr -> String showConstr = constring
53
showConstr = constring
22
false
true
0
7
7
22
9
13
null
null
mreider/kinda-might-work
src/API.hs
mit
_RemoveTrello :: Proxy RemoveTrello _RemoveTrello = Proxy
58
_RemoveTrello :: Proxy RemoveTrello _RemoveTrello = Proxy
58
_RemoveTrello = Proxy
22
false
true
0
5
7
14
7
7
null
null
rahulmutt/ghcvm
compiler/Eta/Main/HeaderInfo.hs
bsd-3-clause
lazyGetToks :: DynFlags -> FilePath -> Handle -> IO [Located Token] lazyGetToks dflags filename handle = do buf <- hGetStringBufferBlock handle blockSize unsafeInterleaveIO $ lazyLexBuf handle (pragState dflags buf loc) False blockSize where loc = mkRealSrcLoc (mkFastString filename) 1 1 lazyLexBuf :: Handle -> PState -> Bool -> Int -> IO [Located Token] lazyLexBuf handle state eof size = do case unP (lexer False return) state of POk state' t -> do -- pprTrace "lazyLexBuf" (text (show (buffer state'))) (return ()) if atEnd (buffer state') && not eof -- if this token reached the end of the buffer, and we haven't -- necessarily read up to the end of the file, then the token might -- be truncated, so read some more of the file and lex it again. then getMore handle state size else case t of L _ ITeof -> return [t] _other -> do rest <- lazyLexBuf handle state' eof size return (t : rest) _ | not eof -> getMore handle state size | otherwise -> return [L (RealSrcSpan (last_loc state)) ITeof] -- parser assumes an ITeof sentinel at the end getMore :: Handle -> PState -> Int -> IO [Located Token] getMore handle state size = do -- pprTrace "getMore" (text (show (buffer state))) (return ()) let new_size = size * 2 -- double the buffer size each time we read a new block. This -- counteracts the quadratic slowdown we otherwise get for very -- large module names (#5981) nextbuf <- hGetStringBufferBlock handle new_size if (len nextbuf == 0) then lazyLexBuf handle state True new_size else do newbuf <- appendStringBuffers (buffer state) nextbuf unsafeInterleaveIO $ lazyLexBuf handle state{buffer=newbuf} False new_size
1,895
lazyGetToks :: DynFlags -> FilePath -> Handle -> IO [Located Token] lazyGetToks dflags filename handle = do buf <- hGetStringBufferBlock handle blockSize unsafeInterleaveIO $ lazyLexBuf handle (pragState dflags buf loc) False blockSize where loc = mkRealSrcLoc (mkFastString filename) 1 1 lazyLexBuf :: Handle -> PState -> Bool -> Int -> IO [Located Token] lazyLexBuf handle state eof size = do case unP (lexer False return) state of POk state' t -> do -- pprTrace "lazyLexBuf" (text (show (buffer state'))) (return ()) if atEnd (buffer state') && not eof -- if this token reached the end of the buffer, and we haven't -- necessarily read up to the end of the file, then the token might -- be truncated, so read some more of the file and lex it again. then getMore handle state size else case t of L _ ITeof -> return [t] _other -> do rest <- lazyLexBuf handle state' eof size return (t : rest) _ | not eof -> getMore handle state size | otherwise -> return [L (RealSrcSpan (last_loc state)) ITeof] -- parser assumes an ITeof sentinel at the end getMore :: Handle -> PState -> Int -> IO [Located Token] getMore handle state size = do -- pprTrace "getMore" (text (show (buffer state))) (return ()) let new_size = size * 2 -- double the buffer size each time we read a new block. This -- counteracts the quadratic slowdown we otherwise get for very -- large module names (#5981) nextbuf <- hGetStringBufferBlock handle new_size if (len nextbuf == 0) then lazyLexBuf handle state True new_size else do newbuf <- appendStringBuffers (buffer state) nextbuf unsafeInterleaveIO $ lazyLexBuf handle state{buffer=newbuf} False new_size
1,895
lazyGetToks dflags filename handle = do buf <- hGetStringBufferBlock handle blockSize unsafeInterleaveIO $ lazyLexBuf handle (pragState dflags buf loc) False blockSize where loc = mkRealSrcLoc (mkFastString filename) 1 1 lazyLexBuf :: Handle -> PState -> Bool -> Int -> IO [Located Token] lazyLexBuf handle state eof size = do case unP (lexer False return) state of POk state' t -> do -- pprTrace "lazyLexBuf" (text (show (buffer state'))) (return ()) if atEnd (buffer state') && not eof -- if this token reached the end of the buffer, and we haven't -- necessarily read up to the end of the file, then the token might -- be truncated, so read some more of the file and lex it again. then getMore handle state size else case t of L _ ITeof -> return [t] _other -> do rest <- lazyLexBuf handle state' eof size return (t : rest) _ | not eof -> getMore handle state size | otherwise -> return [L (RealSrcSpan (last_loc state)) ITeof] -- parser assumes an ITeof sentinel at the end getMore :: Handle -> PState -> Int -> IO [Located Token] getMore handle state size = do -- pprTrace "getMore" (text (show (buffer state))) (return ()) let new_size = size * 2 -- double the buffer size each time we read a new block. This -- counteracts the quadratic slowdown we otherwise get for very -- large module names (#5981) nextbuf <- hGetStringBufferBlock handle new_size if (len nextbuf == 0) then lazyLexBuf handle state True new_size else do newbuf <- appendStringBuffers (buffer state) nextbuf unsafeInterleaveIO $ lazyLexBuf handle state{buffer=newbuf} False new_size
1,827
false
true
0
23
544
462
222
240
null
null
aochagavia/CompilerConstruction
funflow/src/FunFlow/TypeSystem.hs
apache-2.0
(-$-) ts (TypeFn t1 b t2) = let t1' = ts -$- t1 t2' = ts -$- t2 b' = ts -$$- b in TypeFn t1' b' t2'
123
(-$-) ts (TypeFn t1 b t2) = let t1' = ts -$- t1 t2' = ts -$- t2 b' = ts -$$- b in TypeFn t1' b' t2'
123
(-$-) ts (TypeFn t1 b t2) = let t1' = ts -$- t1 t2' = ts -$- t2 b' = ts -$$- b in TypeFn t1' b' t2'
123
false
false
0
9
51
67
32
35
null
null
spocot/haskell-chan
src/ChanLib.hs
bsd-3-clause
{-| The 'uriToRequest' function creates a simple GET request from a given URI. -} uriToRequest :: URI -> Request String uriToRequest s = Request { rqURI = s , rqMethod = GET , rqHeaders = [] , rqBody = "" }
293
uriToRequest :: URI -> Request String uriToRequest s = Request { rqURI = s , rqMethod = GET , rqHeaders = [] , rqBody = "" }
207
uriToRequest s = Request { rqURI = s , rqMethod = GET , rqHeaders = [] , rqBody = "" }
169
true
true
0
7
127
50
29
21
null
null
abuiles/turbinado-blog
tmp/dependencies/utf8-string-0.3.3/System/IO/UTF8.hs
bsd-3-clause
-- | The 'readFile' function reads a file and -- returns the contents of the file as a UTF8 string. -- The file is read lazily, on demand, as with 'getContents'. readFile :: FilePath -> IO String readFile n = hGetContents =<< openBinaryFile n ReadMode
251
readFile :: FilePath -> IO String readFile n = hGetContents =<< openBinaryFile n ReadMode
89
readFile n = hGetContents =<< openBinaryFile n ReadMode
55
true
true
0
6
44
33
17
16
null
null
CloudI/CloudI
src/api/haskell/external/bytestring-0.10.10.0/Data/ByteString.hs
mit
-- | scanr is the right-to-left dual of scanl. scanr :: (Word8 -> Word8 -> Word8) -> Word8 -> ByteString -> ByteString scanr f v (PS fp s len) = unsafeDupablePerformIO $ withForeignPtr fp $ \a -> create (len+1) $ \q -> do poke (q `plusPtr` len) v scanr_ v (len-1) (a `plusPtr` s) q where scanr_ !z !n !p !q | n < 0 = return () | otherwise = do x <- peekByteOff p n let z' = f x z pokeByteOff q n z' scanr_ z' (n-1) p q
513
scanr :: (Word8 -> Word8 -> Word8) -> Word8 -> ByteString -> ByteString scanr f v (PS fp s len) = unsafeDupablePerformIO $ withForeignPtr fp $ \a -> create (len+1) $ \q -> do poke (q `plusPtr` len) v scanr_ v (len-1) (a `plusPtr` s) q where scanr_ !z !n !p !q | n < 0 = return () | otherwise = do x <- peekByteOff p n let z' = f x z pokeByteOff q n z' scanr_ z' (n-1) p q
466
scanr f v (PS fp s len) = unsafeDupablePerformIO $ withForeignPtr fp $ \a -> create (len+1) $ \q -> do poke (q `plusPtr` len) v scanr_ v (len-1) (a `plusPtr` s) q where scanr_ !z !n !p !q | n < 0 = return () | otherwise = do x <- peekByteOff p n let z' = f x z pokeByteOff q n z' scanr_ z' (n-1) p q
394
true
true
5
11
186
240
114
126
null
null
jasonzoladz/persistent
persistent-postgresql/Database/Persist/Postgresql.hs
mit
getColumn :: (Text -> IO Statement) -> DBName -> [PersistValue] -> IO (Either Text Column) getColumn getter tname [PersistText x, PersistText y, PersistText z, d, npre, nscl] = case d' of Left s -> return $ Left s Right d'' -> case getType z of Left s -> return $ Left s Right t -> do let cname = DBName x ref <- getRef cname return $ Right Column { cName = cname , cNull = y == "YES" , cSqlType = t , cDefault = fmap stripSuffixes d'' , cDefaultConstraintName = Nothing , cMaxLen = Nothing , cReference = ref } where stripSuffixes t = loop' [ "::character varying" , "::text" ] where loop' [] = t loop' (p:ps) = case T.stripSuffix p t of Nothing -> loop' ps Just t' -> t' getRef cname = do let sql = T.concat [ "SELECT COUNT(*) FROM " , "information_schema.table_constraints " , "WHERE table_catalog=current_database() " , "AND table_schema=current_schema() " , "AND table_name=? " , "AND constraint_type='FOREIGN KEY' " , "AND constraint_name=?" ] let ref = refName tname cname stmt <- getter sql with (stmtQuery stmt [ PersistText $ unDBName tname , PersistText $ unDBName ref ]) ($$ do Just [PersistInt64 i] <- CL.head return $ if i == 0 then Nothing else Just (DBName "", ref)) d' = case d of PersistNull -> Right Nothing PersistText t -> Right $ Just t _ -> Left $ T.pack $ "Invalid default column: " ++ show d getType "int4" = Right SqlInt32 getType "int8" = Right SqlInt64 getType "varchar" = Right SqlString getType "date" = Right SqlDay getType "bool" = Right SqlBool getType "timestamptz" = Right SqlDayTime getType "float4" = Right SqlReal getType "float8" = Right SqlReal getType "bytea" = Right SqlBlob getType "time" = Right SqlTime getType "numeric" = getNumeric npre nscl getType a = Right $ SqlOther a getNumeric (PersistInt64 a) (PersistInt64 b) = Right $ SqlNumeric (fromIntegral a) (fromIntegral b) getNumeric a b = Left $ T.pack $ "Can not get numeric field precision, got: " ++ show a ++ " and " ++ show b ++ " as precision and scale"
2,830
getColumn :: (Text -> IO Statement) -> DBName -> [PersistValue] -> IO (Either Text Column) getColumn getter tname [PersistText x, PersistText y, PersistText z, d, npre, nscl] = case d' of Left s -> return $ Left s Right d'' -> case getType z of Left s -> return $ Left s Right t -> do let cname = DBName x ref <- getRef cname return $ Right Column { cName = cname , cNull = y == "YES" , cSqlType = t , cDefault = fmap stripSuffixes d'' , cDefaultConstraintName = Nothing , cMaxLen = Nothing , cReference = ref } where stripSuffixes t = loop' [ "::character varying" , "::text" ] where loop' [] = t loop' (p:ps) = case T.stripSuffix p t of Nothing -> loop' ps Just t' -> t' getRef cname = do let sql = T.concat [ "SELECT COUNT(*) FROM " , "information_schema.table_constraints " , "WHERE table_catalog=current_database() " , "AND table_schema=current_schema() " , "AND table_name=? " , "AND constraint_type='FOREIGN KEY' " , "AND constraint_name=?" ] let ref = refName tname cname stmt <- getter sql with (stmtQuery stmt [ PersistText $ unDBName tname , PersistText $ unDBName ref ]) ($$ do Just [PersistInt64 i] <- CL.head return $ if i == 0 then Nothing else Just (DBName "", ref)) d' = case d of PersistNull -> Right Nothing PersistText t -> Right $ Just t _ -> Left $ T.pack $ "Invalid default column: " ++ show d getType "int4" = Right SqlInt32 getType "int8" = Right SqlInt64 getType "varchar" = Right SqlString getType "date" = Right SqlDay getType "bool" = Right SqlBool getType "timestamptz" = Right SqlDayTime getType "float4" = Right SqlReal getType "float8" = Right SqlReal getType "bytea" = Right SqlBlob getType "time" = Right SqlTime getType "numeric" = getNumeric npre nscl getType a = Right $ SqlOther a getNumeric (PersistInt64 a) (PersistInt64 b) = Right $ SqlNumeric (fromIntegral a) (fromIntegral b) getNumeric a b = Left $ T.pack $ "Can not get numeric field precision, got: " ++ show a ++ " and " ++ show b ++ " as precision and scale"
2,830
getColumn getter tname [PersistText x, PersistText y, PersistText z, d, npre, nscl] = case d' of Left s -> return $ Left s Right d'' -> case getType z of Left s -> return $ Left s Right t -> do let cname = DBName x ref <- getRef cname return $ Right Column { cName = cname , cNull = y == "YES" , cSqlType = t , cDefault = fmap stripSuffixes d'' , cDefaultConstraintName = Nothing , cMaxLen = Nothing , cReference = ref } where stripSuffixes t = loop' [ "::character varying" , "::text" ] where loop' [] = t loop' (p:ps) = case T.stripSuffix p t of Nothing -> loop' ps Just t' -> t' getRef cname = do let sql = T.concat [ "SELECT COUNT(*) FROM " , "information_schema.table_constraints " , "WHERE table_catalog=current_database() " , "AND table_schema=current_schema() " , "AND table_name=? " , "AND constraint_type='FOREIGN KEY' " , "AND constraint_name=?" ] let ref = refName tname cname stmt <- getter sql with (stmtQuery stmt [ PersistText $ unDBName tname , PersistText $ unDBName ref ]) ($$ do Just [PersistInt64 i] <- CL.head return $ if i == 0 then Nothing else Just (DBName "", ref)) d' = case d of PersistNull -> Right Nothing PersistText t -> Right $ Just t _ -> Left $ T.pack $ "Invalid default column: " ++ show d getType "int4" = Right SqlInt32 getType "int8" = Right SqlInt64 getType "varchar" = Right SqlString getType "date" = Right SqlDay getType "bool" = Right SqlBool getType "timestamptz" = Right SqlDayTime getType "float4" = Right SqlReal getType "float8" = Right SqlReal getType "bytea" = Right SqlBlob getType "time" = Right SqlTime getType "numeric" = getNumeric npre nscl getType a = Right $ SqlOther a getNumeric (PersistInt64 a) (PersistInt64 b) = Right $ SqlNumeric (fromIntegral a) (fromIntegral b) getNumeric a b = Left $ T.pack $ "Can not get numeric field precision, got: " ++ show a ++ " and " ++ show b ++ " as precision and scale"
2,719
false
true
22
17
1,224
798
362
436
null
null
shockkolate/containers
Data/Map/Base.hs
bsd-3-clause
-- | /O(n)/. Map keys\/values and collect the 'Just' results. -- -- > let f k _ = if k < 5 then Just ("key : " ++ (show k)) else Nothing -- > mapMaybeWithKey f (fromList [(5,"a"), (3,"b")]) == singleton 3 "key : 3" mapMaybeWithKey :: (k -> a -> Maybe b) -> Map k a -> Map k b mapMaybeWithKey _ Tip = Tip
304
mapMaybeWithKey :: (k -> a -> Maybe b) -> Map k a -> Map k b mapMaybeWithKey _ Tip = Tip
88
mapMaybeWithKey _ Tip = Tip
27
true
true
0
10
66
57
28
29
null
null
lexi-lambda/higher-rank
test-suite/Language/HigherRank/TH.hs
isc
exprQ :: QuasiQuoter exprQ = voidQ { quoteExp = either fail lift . parseExpr }
78
exprQ :: QuasiQuoter exprQ = voidQ { quoteExp = either fail lift . parseExpr }
78
exprQ = voidQ { quoteExp = either fail lift . parseExpr }
57
false
true
0
9
14
35
16
19
null
null
jasdennison/scrabble-solver
client/Client.hs
bsd-3-clause
solveBoard :: T.Text -> T.Text -> T.Text -> IO () solveBoard boardDesign board tileHand = S.withSession $ \sess -> do let opts = defaults & param "boardDesign" .~ [boardDesign] & param "board" .~ [board] & param "tileHand" .~ [tileHand] r <- S.getWith opts sess "http://localhost:8080/solve/" B.putStr (r ^. responseBody)
383
solveBoard :: T.Text -> T.Text -> T.Text -> IO () solveBoard boardDesign board tileHand = S.withSession $ \sess -> do let opts = defaults & param "boardDesign" .~ [boardDesign] & param "board" .~ [board] & param "tileHand" .~ [tileHand] r <- S.getWith opts sess "http://localhost:8080/solve/" B.putStr (r ^. responseBody)
383
solveBoard boardDesign board tileHand = S.withSession $ \sess -> do let opts = defaults & param "boardDesign" .~ [boardDesign] & param "board" .~ [board] & param "tileHand" .~ [tileHand] r <- S.getWith opts sess "http://localhost:8080/solve/" B.putStr (r ^. responseBody)
333
false
true
2
18
110
140
66
74
null
null
urbanslug/ghc
compiler/deSugar/DsCCall.hs
bsd-3-clause
dsCCall :: CLabelString -- C routine to invoke -> [CoreExpr] -- Arguments (desugared) -> Safety -- Safety of the call -> Type -- Type of the result: IO t -> DsM CoreExpr -- Result, of type ??? dsCCall lbl args may_gc result_ty = do (unboxed_args, arg_wrappers) <- mapAndUnzipM unboxArg args (ccall_result_ty, res_wrapper) <- boxResult result_ty uniq <- newUnique dflags <- getDynFlags let target = StaticTarget (unpackFS lbl) lbl Nothing True the_fcall = CCall (CCallSpec target CCallConv may_gc) the_prim_app = mkFCall dflags uniq the_fcall unboxed_args ccall_result_ty return (foldr ($) (res_wrapper the_prim_app) arg_wrappers)
751
dsCCall :: CLabelString -- C routine to invoke -> [CoreExpr] -- Arguments (desugared) -> Safety -- Safety of the call -> Type -- Type of the result: IO t -> DsM CoreExpr dsCCall lbl args may_gc result_ty = do (unboxed_args, arg_wrappers) <- mapAndUnzipM unboxArg args (ccall_result_ty, res_wrapper) <- boxResult result_ty uniq <- newUnique dflags <- getDynFlags let target = StaticTarget (unpackFS lbl) lbl Nothing True the_fcall = CCall (CCallSpec target CCallConv may_gc) the_prim_app = mkFCall dflags uniq the_fcall unboxed_args ccall_result_ty return (foldr ($) (res_wrapper the_prim_app) arg_wrappers)
727
dsCCall lbl args may_gc result_ty = do (unboxed_args, arg_wrappers) <- mapAndUnzipM unboxArg args (ccall_result_ty, res_wrapper) <- boxResult result_ty uniq <- newUnique dflags <- getDynFlags let target = StaticTarget (unpackFS lbl) lbl Nothing True the_fcall = CCall (CCallSpec target CCallConv may_gc) the_prim_app = mkFCall dflags uniq the_fcall unboxed_args ccall_result_ty return (foldr ($) (res_wrapper the_prim_app) arg_wrappers)
509
true
true
0
12
212
177
89
88
null
null
wowofbob/calculus
main.hs
mit
-- blocks blockA :: Term blockA = constant "A"
47
blockA :: Term blockA = constant "A"
36
blockA = constant "A"
21
true
true
0
5
9
15
8
7
null
null
vincenthz/hs-xyz-test
Core/Vector/Boxed.hs
bsd-3-clause
empty :: Vector a empty = runST $ onNewArray 0 (\_ s -> s)
58
empty :: Vector a empty = runST $ onNewArray 0 (\_ s -> s)
58
empty = runST $ onNewArray 0 (\_ s -> s)
40
false
true
2
7
13
39
18
21
null
null
GaloisInc/mistral
src/Mistral/Parser/Finalize.hs
bsd-3-clause
fTaskStmt :: Update TaskStmt fTaskStmt ts = case ts of TStTask mb t -> TStTask mb <$> fTask t TStComp c -> TStComp <$> fComp fTaskStmt c TStSource s t' -> TStSource s <$> fTaskStmt t'
209
fTaskStmt :: Update TaskStmt fTaskStmt ts = case ts of TStTask mb t -> TStTask mb <$> fTask t TStComp c -> TStComp <$> fComp fTaskStmt c TStSource s t' -> TStSource s <$> fTaskStmt t'
209
fTaskStmt ts = case ts of TStTask mb t -> TStTask mb <$> fTask t TStComp c -> TStComp <$> fComp fTaskStmt c TStSource s t' -> TStSource s <$> fTaskStmt t'
180
false
true
0
9
61
81
36
45
null
null
bamboo/idris-cil
src/IRTS/Cil/MaxStack.hs
bsd-3-clause
netStackChange _ Ldelem_ref = -1
35
netStackChange _ Ldelem_ref = -1
35
netStackChange _ Ldelem_ref = -1
35
false
false
0
5
7
13
6
7
null
null
brendanhay/gogol
gogol-games/gen/Network/Google/Resource/Games/Events/Record.hs
mpl-2.0
-- | Multipart request metadata. erPayload :: Lens' EventsRecord EventRecordRequest erPayload = lens _erPayload (\ s a -> s{_erPayload = a})
142
erPayload :: Lens' EventsRecord EventRecordRequest erPayload = lens _erPayload (\ s a -> s{_erPayload = a})
109
erPayload = lens _erPayload (\ s a -> s{_erPayload = a})
58
true
true
0
9
22
42
22
20
null
null
nomeata/ghc
compiler/main/HscMain.hs
bsd-3-clause
hscIsGHCiMonad :: HscEnv -> String -> IO Name hscIsGHCiMonad hsc_env name = let icntxt = hsc_IC hsc_env in runHsc hsc_env $ ioMsgMaybe $ isGHCiMonad hsc_env icntxt name
178
hscIsGHCiMonad :: HscEnv -> String -> IO Name hscIsGHCiMonad hsc_env name = let icntxt = hsc_IC hsc_env in runHsc hsc_env $ ioMsgMaybe $ isGHCiMonad hsc_env icntxt name
178
hscIsGHCiMonad hsc_env name = let icntxt = hsc_IC hsc_env in runHsc hsc_env $ ioMsgMaybe $ isGHCiMonad hsc_env icntxt name
132
false
true
2
9
36
64
28
36
null
null
mishun/tangles
src/Math/Topology/KnotTh/Moves/Moves.hs
lgpl-3.0
pass1 :: Pattern DiagramCrossing TangleDiagram pass1 = makePattern False $ do ([a0, a1, a2, a3], _) <- crossingP mplus (do ([x0, x1], _) <- subTangleP 2 connectionP [(a0, x0)] reconnectP $ do substituteC [(x0, a2), (a0, x1)] connectC [(x1, a2)] ) (do ([x0, x1, x2, x3], _) <- subTangleP 4 connectionP [(a0, x0), (a1, x3), (a3, x1)] reconnectP $ do substituteC [(x0, a2), (a0, x2)] connectC [(x2, a2)] )
578
pass1 :: Pattern DiagramCrossing TangleDiagram pass1 = makePattern False $ do ([a0, a1, a2, a3], _) <- crossingP mplus (do ([x0, x1], _) <- subTangleP 2 connectionP [(a0, x0)] reconnectP $ do substituteC [(x0, a2), (a0, x1)] connectC [(x1, a2)] ) (do ([x0, x1, x2, x3], _) <- subTangleP 4 connectionP [(a0, x0), (a1, x3), (a3, x1)] reconnectP $ do substituteC [(x0, a2), (a0, x2)] connectC [(x2, a2)] )
578
pass1 = makePattern False $ do ([a0, a1, a2, a3], _) <- crossingP mplus (do ([x0, x1], _) <- subTangleP 2 connectionP [(a0, x0)] reconnectP $ do substituteC [(x0, a2), (a0, x1)] connectC [(x1, a2)] ) (do ([x0, x1, x2, x3], _) <- subTangleP 4 connectionP [(a0, x0), (a1, x3), (a3, x1)] reconnectP $ do substituteC [(x0, a2), (a0, x2)] connectC [(x2, a2)] )
531
false
true
0
17
244
252
139
113
null
null
ezyang/ghc
compiler/types/OptCoercion.hs
bsd-3-clause
opt_trans_rule is in_co1@(LRCo d1 co1) in_co2@(LRCo d2 co2) | d1 == d2 , co1 `compatible_co` co2 = fireTransRule "PushLR" in_co1 in_co2 $ mkLRCo d1 (opt_trans is co1 co2)
180
opt_trans_rule is in_co1@(LRCo d1 co1) in_co2@(LRCo d2 co2) | d1 == d2 , co1 `compatible_co` co2 = fireTransRule "PushLR" in_co1 in_co2 $ mkLRCo d1 (opt_trans is co1 co2)
180
opt_trans_rule is in_co1@(LRCo d1 co1) in_co2@(LRCo d2 co2) | d1 == d2 , co1 `compatible_co` co2 = fireTransRule "PushLR" in_co1 in_co2 $ mkLRCo d1 (opt_trans is co1 co2)
180
false
false
0
9
37
81
40
41
null
null
chreekat/snowdrift
Model/Notification/Internal.hs
agpl-3.0
showProjectNotificationType NotifUpdatedPledge = "Pledge updated"
69
showProjectNotificationType NotifUpdatedPledge = "Pledge updated"
69
showProjectNotificationType NotifUpdatedPledge = "Pledge updated"
69
false
false
0
5
8
9
4
5
null
null
reinh/CodeSearch
src/CodeSearch/Query/Shrink.hs
bsd-3-clause
-- `Any` is a multiplicative unit for `And` shrinkTrigramExpr (Any `And` x ) = x
81
shrinkTrigramExpr (Any `And` x ) = x
37
shrinkTrigramExpr (Any `And` x ) = x
37
true
false
0
6
15
20
11
9
null
null
calebgregory/fp101x
wk3/init.hs
mit
[_] = []
11
[_] = []
11
[_] = []
11
false
false
0
5
5
12
6
6
null
null
facebookincubator/duckling
Duckling/Temperature/AR/Rules.hs
bsd-3-clause
ruleTemperatureBelowZero :: Rule ruleTemperatureBelowZero = Rule { name = "<temp> below zero" , pattern = [ Predicate $ isValueOnly True , regex "تحت الصفر" ] , prod = \case (Token Temperature td@TemperatureData {TTemperature.value = Just v}: _) -> case TTemperature.unit td of Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $ td {TTemperature.value = Just (- v)} _ -> Just . Token Temperature $ td {TTemperature.value = Just (- v)} _ -> Nothing }
532
ruleTemperatureBelowZero :: Rule ruleTemperatureBelowZero = Rule { name = "<temp> below zero" , pattern = [ Predicate $ isValueOnly True , regex "تحت الصفر" ] , prod = \case (Token Temperature td@TemperatureData {TTemperature.value = Just v}: _) -> case TTemperature.unit td of Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $ td {TTemperature.value = Just (- v)} _ -> Just . Token Temperature $ td {TTemperature.value = Just (- v)} _ -> Nothing }
532
ruleTemperatureBelowZero = Rule { name = "<temp> below zero" , pattern = [ Predicate $ isValueOnly True , regex "تحت الصفر" ] , prod = \case (Token Temperature td@TemperatureData {TTemperature.value = Just v}: _) -> case TTemperature.unit td of Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $ td {TTemperature.value = Just (- v)} _ -> Just . Token Temperature $ td {TTemperature.value = Just (- v)} _ -> Nothing }
499
false
true
0
19
139
182
94
88
null
null
happlebao/Core-Haskell
SyntaxChecker.hs
bsd-3-clause
isCorePat _ src (PatTypeSig {}) = Left [NotAllowed "PatTypeSig" src]
68
isCorePat _ src (PatTypeSig {}) = Left [NotAllowed "PatTypeSig" src]
68
isCorePat _ src (PatTypeSig {}) = Left [NotAllowed "PatTypeSig" src]
68
false
false
1
7
9
34
15
19
null
null
fmthoma/ghc
compiler/main/HscTypes.hs
bsd-3-clause
srcErrorMessages :: SourceError -> ErrorMessages srcErrorMessages (SourceError msgs) = msgs
91
srcErrorMessages :: SourceError -> ErrorMessages srcErrorMessages (SourceError msgs) = msgs
91
srcErrorMessages (SourceError msgs) = msgs
42
false
true
0
6
9
28
13
15
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/book/2011-Learn_You_a_Haskell/Learn_You_a_Haskell.hs
unlicense
-- 2.3 lists listOfNumbers = [4 ,8 ,15 ,16 ,23 ,48]
52
listOfNumbers = [4 ,8 ,15 ,16 ,23 ,48]
38
listOfNumbers = [4 ,8 ,15 ,16 ,23 ,48]
38
true
false
1
5
11
28
16
12
null
null
kazu-yamamoto/appar
Text/Appar/Parser.hs
bsd-3-clause
{-| @option x p@ tries to apply parser @p@. If @p@ fails without consuming input, it returns the value @x@, otherwise the value returned by @p@. -} option :: a -> MkParser inp a -> MkParser inp a option x p = p <|> pure x
227
option :: a -> MkParser inp a -> MkParser inp a option x p = p <|> pure x
73
option x p = p <|> pure x
25
true
true
0
7
51
42
20
22
null
null
thoughtpolice/hs-leveldb
examples/ffi_test.hs
bsd-3-clause
ensure :: Bool -> IO () ensure True = return ()
48
ensure :: Bool -> IO () ensure True = return ()
48
ensure True = return ()
24
false
true
0
7
11
28
13
15
null
null
yiannist/ganeti
test/hs/Test/Ganeti/Objects.hs
bsd-2-clause
genBitString :: Int -> Gen AddressPool genBitString len = (AddressPool . BA.fromList) `liftM` vectorOf len (elements [False, True])
133
genBitString :: Int -> Gen AddressPool genBitString len = (AddressPool . BA.fromList) `liftM` vectorOf len (elements [False, True])
133
genBitString len = (AddressPool . BA.fromList) `liftM` vectorOf len (elements [False, True])
94
false
true
0
9
19
53
28
25
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Accounts/List.hs
mpl-2.0
-- | Select only accounts with these IDs. accIds :: Lens' AccountsList [Int64] accIds = lens _accIds (\ s a -> s{_accIds = a}) . _Default . _Coerce
155
accIds :: Lens' AccountsList [Int64] accIds = lens _accIds (\ s a -> s{_accIds = a}) . _Default . _Coerce
113
accIds = lens _accIds (\ s a -> s{_accIds = a}) . _Default . _Coerce
76
true
true
1
11
35
56
28
28
null
null
adinapoli/memento
src/Memento/Logger.hs
mit
-------------------------------------------------------------------------------- red :: Text -> IO () red = colorised Red
121
red :: Text -> IO () red = colorised Red
40
red = colorised Red
19
true
true
0
7
10
24
12
12
null
null
aparent/qacg
src/QACG/CircUtils/CircuitToXML.hs
bsd-3-clause
makeXMLProg :: ArrowXml a => String -> Circuit -> a XmlTree XmlTree makeXMLProg cname c = program $ statement $ makeXMLCirc cname c : map (\(x,y) -> makeXMLCirc y x) (subcircuits c) where program = mkelem "circuit" [ sattr "xmlns" "http://torque.bbn.com/ns/QuIGL", sattr "xmlns:xsi" "http://www.w3.org/2001/XMLSchema-instance", sattr "xsi:schemaLocation" "http://torque.bbn.com/ns/QuIGL ../xsd/QuIGL.xsd" ] statement a = [ selem "statement" a ]
536
makeXMLProg :: ArrowXml a => String -> Circuit -> a XmlTree XmlTree makeXMLProg cname c = program $ statement $ makeXMLCirc cname c : map (\(x,y) -> makeXMLCirc y x) (subcircuits c) where program = mkelem "circuit" [ sattr "xmlns" "http://torque.bbn.com/ns/QuIGL", sattr "xmlns:xsi" "http://www.w3.org/2001/XMLSchema-instance", sattr "xsi:schemaLocation" "http://torque.bbn.com/ns/QuIGL ../xsd/QuIGL.xsd" ] statement a = [ selem "statement" a ]
536
makeXMLProg cname c = program $ statement $ makeXMLCirc cname c : map (\(x,y) -> makeXMLCirc y x) (subcircuits c) where program = mkelem "circuit" [ sattr "xmlns" "http://torque.bbn.com/ns/QuIGL", sattr "xmlns:xsi" "http://www.w3.org/2001/XMLSchema-instance", sattr "xsi:schemaLocation" "http://torque.bbn.com/ns/QuIGL ../xsd/QuIGL.xsd" ] statement a = [ selem "statement" a ]
467
false
true
2
9
148
148
68
80
null
null
Th30n/hasgel
src/Hasgel/Game/Movement.hs
mit
tryMove blockers mobj speed = case clampSpeed of -- Speed is below maximum, move to destination. (speed', Nothing) -> tryMove' speed' -- Speed is above maximum, move incrementally. (speed', Just remSpeed) -> case tryMove' speed' of -- No collision, continue moving. (mobj', Nothing) -> tryMove blockers mobj' remSpeed -- Collision, return the result. colRes -> colRes where clampSpeed = let L.V3 (x, mx) (y, my) (z, mz) = clampComp <$> speed -- Remainder speed if any. rv = if all isNothing [mx, my, mz] then Nothing else let [rx, ry, rz] = fromMaybe 0 <$> [mx, my, mz] in Just $ L.V3 rx ry rz in (L.V3 x y z, rv) clampComp c | c < 0, c < -maxSpeed = (-maxSpeed, Just $ maxSpeed + c) | c > 0, c > maxSpeed = (maxSpeed, Just $ c - maxSpeed) | otherwise = (c, Nothing) tryMove' dv | Just i <- checkPosition (translate mobj dv) blockers = (mobj, Just i) | otherwise = (translate mobj dv, Nothing) -- | Returns the index of the colliding object.
1,232
tryMove blockers mobj speed = case clampSpeed of -- Speed is below maximum, move to destination. (speed', Nothing) -> tryMove' speed' -- Speed is above maximum, move incrementally. (speed', Just remSpeed) -> case tryMove' speed' of -- No collision, continue moving. (mobj', Nothing) -> tryMove blockers mobj' remSpeed -- Collision, return the result. colRes -> colRes where clampSpeed = let L.V3 (x, mx) (y, my) (z, mz) = clampComp <$> speed -- Remainder speed if any. rv = if all isNothing [mx, my, mz] then Nothing else let [rx, ry, rz] = fromMaybe 0 <$> [mx, my, mz] in Just $ L.V3 rx ry rz in (L.V3 x y z, rv) clampComp c | c < 0, c < -maxSpeed = (-maxSpeed, Just $ maxSpeed + c) | c > 0, c > maxSpeed = (maxSpeed, Just $ c - maxSpeed) | otherwise = (c, Nothing) tryMove' dv | Just i <- checkPosition (translate mobj dv) blockers = (mobj, Just i) | otherwise = (translate mobj dv, Nothing) -- | Returns the index of the colliding object.
1,232
tryMove blockers mobj speed = case clampSpeed of -- Speed is below maximum, move to destination. (speed', Nothing) -> tryMove' speed' -- Speed is above maximum, move incrementally. (speed', Just remSpeed) -> case tryMove' speed' of -- No collision, continue moving. (mobj', Nothing) -> tryMove blockers mobj' remSpeed -- Collision, return the result. colRes -> colRes where clampSpeed = let L.V3 (x, mx) (y, my) (z, mz) = clampComp <$> speed -- Remainder speed if any. rv = if all isNothing [mx, my, mz] then Nothing else let [rx, ry, rz] = fromMaybe 0 <$> [mx, my, mz] in Just $ L.V3 rx ry rz in (L.V3 x y z, rv) clampComp c | c < 0, c < -maxSpeed = (-maxSpeed, Just $ maxSpeed + c) | c > 0, c > maxSpeed = (maxSpeed, Just $ c - maxSpeed) | otherwise = (c, Nothing) tryMove' dv | Just i <- checkPosition (translate mobj dv) blockers = (mobj, Just i) | otherwise = (translate mobj dv, Nothing) -- | Returns the index of the colliding object.
1,232
false
false
2
15
467
406
206
200
null
null
AlexanderPankiv/ghc
ghc/GhciMonad.hs
bsd-3-clause
runStmt :: String -> GHC.SingleStep -> GHCi (Maybe GHC.ExecResult) runStmt expr step = do st <- getGHCiState reifyGHCi $ \x -> withProgName (progname st) $ withArgs (args st) $ reflectGHCi x $ do GHC.handleSourceError (\e -> do GHC.printException e; return Nothing) $ do let opts = GHC.execOptions { GHC.execSourceFile = progname st , GHC.execLineNumber = line_number st , GHC.execSingleStep = step } r <- GHC.execStmt expr opts return (Just r)
588
runStmt :: String -> GHC.SingleStep -> GHCi (Maybe GHC.ExecResult) runStmt expr step = do st <- getGHCiState reifyGHCi $ \x -> withProgName (progname st) $ withArgs (args st) $ reflectGHCi x $ do GHC.handleSourceError (\e -> do GHC.printException e; return Nothing) $ do let opts = GHC.execOptions { GHC.execSourceFile = progname st , GHC.execLineNumber = line_number st , GHC.execSingleStep = step } r <- GHC.execStmt expr opts return (Just r)
588
runStmt expr step = do st <- getGHCiState reifyGHCi $ \x -> withProgName (progname st) $ withArgs (args st) $ reflectGHCi x $ do GHC.handleSourceError (\e -> do GHC.printException e; return Nothing) $ do let opts = GHC.execOptions { GHC.execSourceFile = progname st , GHC.execLineNumber = line_number st , GHC.execSingleStep = step } r <- GHC.execStmt expr opts return (Just r)
521
false
true
0
20
213
193
92
101
null
null
beni55/fay
fay-base/src/Data/Var.hs
bsd-3-clause
-- | Make a new reactive variable. newVar :: Ptr a -> Fay (Ptr (Var a)) newVar = ffi "new Fay$$Var(%1)"
103
newVar :: Ptr a -> Fay (Ptr (Var a)) newVar = ffi "new Fay$$Var(%1)"
68
newVar = ffi "new Fay$$Var(%1)"
31
true
true
0
11
20
43
19
24
null
null
lambda-llama/bresson
src/Data/Bson/Document.hs
mit
size :: Document -> Int size = HashMap.size . unDocument
56
size :: Document -> Int size = HashMap.size . unDocument
56
size = HashMap.size . unDocument
32
false
true
1
7
9
29
12
17
null
null
pikajude/kevin
src/Kevin/Damn/Protocol/Send.hs
gpl-3.0
sendKill = undefined
20
sendKill = undefined
20
sendKill = undefined
20
false
false
1
5
2
10
3
7
null
null
pparkkin/eta
compiler/ETA/DeSugar/Coverage.hs
bsd-3-clause
isGoodBreakExpr _other = False
38
isGoodBreakExpr _other = False
38
isGoodBreakExpr _other = False
38
false
false
0
4
11
9
4
5
null
null
kmate/HaRe
old/testing/moveDefBtwMods/B2AST.hs
bsd-3-clause
myFringe :: (Tree a) -> [a] myFringe (Leaf x) = [x]
53
myFringe :: (Tree a) -> [a] myFringe (Leaf x) = [x]
51
myFringe (Leaf x) = [x]
23
false
true
0
9
12
42
20
22
null
null
xymostech/tex-parser
src/TeX/State.hs
mit
popState (TeXState { depthList = (topState:restStates) }) = TeXState { _currState = topState , depthList = restStates }
127
popState (TeXState { depthList = (topState:restStates) }) = TeXState { _currState = topState , depthList = restStates }
127
popState (TeXState { depthList = (topState:restStates) }) = TeXState { _currState = topState , depthList = restStates }
127
false
false
0
11
25
46
25
21
null
null
triffon/lcpt-2013-14
num_types.hs
mit
pair_bool :: Pair (Numeral Int) -> Bool pair_bool = \b -> pair_int b > 0
72
pair_bool :: Pair (Numeral Int) -> Bool pair_bool = \b -> pair_int b > 0
72
pair_bool = \b -> pair_int b > 0
32
false
true
0
8
14
36
18
18
null
null
bgw/hs-rpal
src/Standardizer.hs
gpl-3.0
{- and => = | / \ =++ , tau / \ | | X E X++ E++ -} standardizeNode level nodeId (AstAnd _) nodeChildren = AstDef (AstComma $ fmap defFst nodeChildren) (standardizeNode level nodeId (AstTau []) $ fmap defSnd nodeChildren) where defFst :: Ast -> Ast defFst (AstDef a _) = a defFst _ = error "expected AstDef" defSnd :: Ast -> Ast defSnd (AstDef _ b) = b defSnd _ = error "expected AstDef" {- rec => = | / \ = X gamma / \ / \ X E Y* lambda / \ X E -}
729
standardizeNode level nodeId (AstAnd _) nodeChildren = AstDef (AstComma $ fmap defFst nodeChildren) (standardizeNode level nodeId (AstTau []) $ fmap defSnd nodeChildren) where defFst :: Ast -> Ast defFst (AstDef a _) = a defFst _ = error "expected AstDef" defSnd :: Ast -> Ast defSnd (AstDef _ b) = b defSnd _ = error "expected AstDef" {- rec => = | / \ = X gamma / \ / \ X E Y* lambda / \ X E -}
608
standardizeNode level nodeId (AstAnd _) nodeChildren = AstDef (AstComma $ fmap defFst nodeChildren) (standardizeNode level nodeId (AstTau []) $ fmap defSnd nodeChildren) where defFst :: Ast -> Ast defFst (AstDef a _) = a defFst _ = error "expected AstDef" defSnd :: Ast -> Ast defSnd (AstDef _ b) = b defSnd _ = error "expected AstDef" {- rec => = | / \ = X gamma / \ / \ X E Y* lambda / \ X E -}
608
true
false
6
11
380
142
70
72
null
null
portnov/haskell-gettext
Data/Gettext/Parsers.hs
bsd-3-clause
-- | Parse plural form selection definition. -- Return value is (number of possible plural forms; selection expression). parsePlural :: Headers -> Either String (Int, Expr) parsePlural headers = case lookup (T.pack "Plural-Forms") headers of Nothing -> Left $ "Plural-Forms header not found: " ++ show headers Just str -> either (Left . show) Right $ parse pPlural "<plural form selection expression>" str
415
parsePlural :: Headers -> Either String (Int, Expr) parsePlural headers = case lookup (T.pack "Plural-Forms") headers of Nothing -> Left $ "Plural-Forms header not found: " ++ show headers Just str -> either (Left . show) Right $ parse pPlural "<plural form selection expression>" str
294
parsePlural headers = case lookup (T.pack "Plural-Forms") headers of Nothing -> Left $ "Plural-Forms header not found: " ++ show headers Just str -> either (Left . show) Right $ parse pPlural "<plural form selection expression>" str
242
true
true
0
11
72
97
48
49
null
null
enolan/Idris-dev
src/Idris/IBC.hs
bsd-3-clause
ibc i (IBCExtern n) f = return f { ibc_externs = n : ibc_externs f }
68
ibc i (IBCExtern n) f = return f { ibc_externs = n : ibc_externs f }
68
ibc i (IBCExtern n) f = return f { ibc_externs = n : ibc_externs f }
68
false
false
1
9
15
42
18
24
null
null
jfischoff/hs-mitsuba
tests/Tests/Mitsuba/Types.hs
bsd-3-clause
case_diffuse_1_toXML = actualDiffuse1 `assertElement` [xmlQQ| <bsdf type="diffuse"> <texture type="bitmap" name="reflectance"> <string name="filename" value="wood.jpg"/> <string name="wrapMode" value="repeat" /> <string name="filterType" value="trilinear" /> <float name="maxAnisotropy" value="0.0" /> <boolean name="cache" value="false" /> <float name="uoffset" value="0.5" /> <float name="voffset" value="1.0" /> <float name="uscale" value="1.5" /> <float name="vscale" value="2.0" /> <string name="channel" value="r" /> </texture> </bsdf> |]
633
case_diffuse_1_toXML = actualDiffuse1 `assertElement` [xmlQQ| <bsdf type="diffuse"> <texture type="bitmap" name="reflectance"> <string name="filename" value="wood.jpg"/> <string name="wrapMode" value="repeat" /> <string name="filterType" value="trilinear" /> <float name="maxAnisotropy" value="0.0" /> <boolean name="cache" value="false" /> <float name="uoffset" value="0.5" /> <float name="voffset" value="1.0" /> <float name="uscale" value="1.5" /> <float name="vscale" value="2.0" /> <string name="channel" value="r" /> </texture> </bsdf> |]
633
case_diffuse_1_toXML = actualDiffuse1 `assertElement` [xmlQQ| <bsdf type="diffuse"> <texture type="bitmap" name="reflectance"> <string name="filename" value="wood.jpg"/> <string name="wrapMode" value="repeat" /> <string name="filterType" value="trilinear" /> <float name="maxAnisotropy" value="0.0" /> <boolean name="cache" value="false" /> <float name="uoffset" value="0.5" /> <float name="voffset" value="1.0" /> <float name="uscale" value="1.5" /> <float name="vscale" value="2.0" /> <string name="channel" value="r" /> </texture> </bsdf> |]
633
false
false
1
5
140
19
11
8
null
null
Concomitant/LambdaHack
GameDefinition/Content/ItemKind.hs
bsd-3-clause
flask9 = flask { ieffects = [ NoEffect "of bait cocktail" , toOrganActorTurn "drunk" (5 + d 5) , OnSmash (Summon [("mobile animal", 1)] $ 1 + dl 2) , OnSmash (Explode "waste") ] }
228
flask9 = flask { ieffects = [ NoEffect "of bait cocktail" , toOrganActorTurn "drunk" (5 + d 5) , OnSmash (Summon [("mobile animal", 1)] $ 1 + dl 2) , OnSmash (Explode "waste") ] }
228
flask9 = flask { ieffects = [ NoEffect "of bait cocktail" , toOrganActorTurn "drunk" (5 + d 5) , OnSmash (Summon [("mobile animal", 1)] $ 1 + dl 2) , OnSmash (Explode "waste") ] }
228
false
false
0
14
83
85
44
41
null
null
k00mi/mqtt-hs
Network/MQTT/Parser.hs
gpl-3.0
publish :: MqttHeader -> MessageParser (MessageBody 'PUBLISH) publish header = ctxt' "publish" $ Publish <$> getTopic <*> (if qos header > NoConfirm then Just <$> parseMsgID else return Nothing) <*> (get >>= take')
318
publish :: MqttHeader -> MessageParser (MessageBody 'PUBLISH) publish header = ctxt' "publish" $ Publish <$> getTopic <*> (if qos header > NoConfirm then Just <$> parseMsgID else return Nothing) <*> (get >>= take')
318
publish header = ctxt' "publish" $ Publish <$> getTopic <*> (if qos header > NoConfirm then Just <$> parseMsgID else return Nothing) <*> (get >>= take')
256
false
true
8
10
136
92
45
47
null
null
mettekou/ghc
compiler/codeGen/StgCmmClosure.hs
bsd-3-clause
-- We keep the *zero-indexed* tag in the srt_len field of the info -- table of a data constructor. dataConTagZ :: DataCon -> ConTagZ dataConTagZ con = dataConTag con - fIRST_TAG
177
dataConTagZ :: DataCon -> ConTagZ dataConTagZ con = dataConTag con - fIRST_TAG
78
dataConTagZ con = dataConTag con - fIRST_TAG
44
true
true
0
6
30
27
14
13
null
null
Kludgy/hdevtools
src/Main.hs
mit
getSocketFilename :: Maybe FilePath -> FilePath getSocketFilename Nothing = defaultSocketFilename
97
getSocketFilename :: Maybe FilePath -> FilePath getSocketFilename Nothing = defaultSocketFilename
97
getSocketFilename Nothing = defaultSocketFilename
49
false
true
0
6
9
21
10
11
null
null
nevrenato/Hets_Fork
SoftFOL/ParseTPTP.hs
gpl-2.0
tptp :: Parser [TPTP] tptp = skip >> many (headerLine <|> include <|> formAnno <|> (newline >> skip >> return EmptyLine)) << eof
131
tptp :: Parser [TPTP] tptp = skip >> many (headerLine <|> include <|> formAnno <|> (newline >> skip >> return EmptyLine)) << eof
131
tptp = skip >> many (headerLine <|> include <|> formAnno <|> (newline >> skip >> return EmptyLine)) << eof
109
false
true
2
11
25
64
30
34
null
null
wdanilo/haskell-language-c
src/Language/C/Analysis/SemRep.hs
bsd-3-clause
isExtDecl :: (Declaration n) => n -> Bool isExtDecl = hasLinkage . declStorage
78
isExtDecl :: (Declaration n) => n -> Bool isExtDecl = hasLinkage . declStorage
78
isExtDecl = hasLinkage . declStorage
36
false
true
0
6
12
28
15
13
null
null
timtylin/scholdoc-texmath
src/Text/TeXMath/Readers/TeX.hs
gpl-2.0
unGrouped x = [x]
17
unGrouped x = [x]
17
unGrouped x = [x]
17
false
false
0
5
3
12
6
6
null
null
mcmaniac/ghc
utils/hpc/HpcMarkup.hs
bsd-3-clause
openTick IsTicked = "<span class=\"istickedoff\">"
57
openTick IsTicked = "<span class=\"istickedoff\">"
57
openTick IsTicked = "<span class=\"istickedoff\">"
57
false
false
0
4
11
10
4
6
null
null
5outh/metronome
lib/Metronome/Say.hs
mit
toWord 7 = "sev"
16
toWord 7 = "sev"
16
toWord 7 = "sev"
16
false
false
1
5
3
13
4
9
null
null
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/tests/PackageTests/PackageTester.hs
bsd-3-clause
record :: Result -> TestM () record res = do build_dir <- distDir (suite, _) <- ask liftIO $ createDirectoryIfMissing True build_dir liftIO $ C.appendFile (build_dir </> "test.log") (C.pack $ "+ " ++ resultCommand res ++ "\n" ++ resultOutput res ++ "\n\n") let test_sh = build_dir </> "test.sh" b <- liftIO $ doesFileExist test_sh when (not b) . liftIO $ do -- This is hella racey but this is not that security important C.appendFile test_sh (C.pack $ "#/bin/sh\nset -ev\n" ++ "cd "++ show (absoluteCWD suite) ++"\n") perms <- getPermissions test_sh setPermissions test_sh (setOwnerExecutable True perms) liftIO $ C.appendFile test_sh (C.pack (case resultDirectory res of Nothing -> resultCommand res Just d -> "(cd " ++ show d ++ " && " ++ resultCommand res ++ ")\n")) ------------------------------------------------------------------------ -- * Test helpers
1,087
record :: Result -> TestM () record res = do build_dir <- distDir (suite, _) <- ask liftIO $ createDirectoryIfMissing True build_dir liftIO $ C.appendFile (build_dir </> "test.log") (C.pack $ "+ " ++ resultCommand res ++ "\n" ++ resultOutput res ++ "\n\n") let test_sh = build_dir </> "test.sh" b <- liftIO $ doesFileExist test_sh when (not b) . liftIO $ do -- This is hella racey but this is not that security important C.appendFile test_sh (C.pack $ "#/bin/sh\nset -ev\n" ++ "cd "++ show (absoluteCWD suite) ++"\n") perms <- getPermissions test_sh setPermissions test_sh (setOwnerExecutable True perms) liftIO $ C.appendFile test_sh (C.pack (case resultDirectory res of Nothing -> resultCommand res Just d -> "(cd " ++ show d ++ " && " ++ resultCommand res ++ ")\n")) ------------------------------------------------------------------------ -- * Test helpers
1,087
record res = do build_dir <- distDir (suite, _) <- ask liftIO $ createDirectoryIfMissing True build_dir liftIO $ C.appendFile (build_dir </> "test.log") (C.pack $ "+ " ++ resultCommand res ++ "\n" ++ resultOutput res ++ "\n\n") let test_sh = build_dir </> "test.sh" b <- liftIO $ doesFileExist test_sh when (not b) . liftIO $ do -- This is hella racey but this is not that security important C.appendFile test_sh (C.pack $ "#/bin/sh\nset -ev\n" ++ "cd "++ show (absoluteCWD suite) ++"\n") perms <- getPermissions test_sh setPermissions test_sh (setOwnerExecutable True perms) liftIO $ C.appendFile test_sh (C.pack (case resultDirectory res of Nothing -> resultCommand res Just d -> "(cd " ++ show d ++ " && " ++ resultCommand res ++ ")\n")) ------------------------------------------------------------------------ -- * Test helpers
1,058
false
true
0
19
356
295
138
157
null
null
mkawalec/twitterbot
src/Main.hs
gpl-3.0
signRequest :: MonadIO m => Config -> Request -> m Request signRequest config request = do let getConfig = getMapValue config let authCred = OA.newCredential (getConfig "ACCESS_TOKEN") (getConfig "ACCESS_TOKEN_SECRET") let authConfig = OA.newOAuth { OA.oauthConsumerKey = getConfig "API_KEY" , OA.oauthConsumerSecret = getConfig "API_SECRET" } OA.signOAuth authConfig authCred request
466
signRequest :: MonadIO m => Config -> Request -> m Request signRequest config request = do let getConfig = getMapValue config let authCred = OA.newCredential (getConfig "ACCESS_TOKEN") (getConfig "ACCESS_TOKEN_SECRET") let authConfig = OA.newOAuth { OA.oauthConsumerKey = getConfig "API_KEY" , OA.oauthConsumerSecret = getConfig "API_SECRET" } OA.signOAuth authConfig authCred request
466
signRequest config request = do let getConfig = getMapValue config let authCred = OA.newCredential (getConfig "ACCESS_TOKEN") (getConfig "ACCESS_TOKEN_SECRET") let authConfig = OA.newOAuth { OA.oauthConsumerKey = getConfig "API_KEY" , OA.oauthConsumerSecret = getConfig "API_SECRET" } OA.signOAuth authConfig authCred request
407
false
true
0
12
129
121
57
64
null
null
bitemyapp/ghc
compiler/typecheck/TcEvidence.hs
bsd-3-clause
ppr_co p co@(TcForAllCo {}) = ppr_forall_co p co
53
ppr_co p co@(TcForAllCo {}) = ppr_forall_co p co
53
ppr_co p co@(TcForAllCo {}) = ppr_forall_co p co
53
false
false
0
8
12
26
13
13
null
null
AlephAlpha/Samau
OldSamau/Eval.hs
gpl-2.0
smAbs (SmFloat x:s) = SmFloat (abs x):s
39
smAbs (SmFloat x:s) = SmFloat (abs x):s
39
smAbs (SmFloat x:s) = SmFloat (abs x):s
39
false
false
0
8
6
32
15
17
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
emitPrimOp _ res WriteByteArrayOp_Int64 args = doWriteByteArrayOp Nothing b64 res args
102
emitPrimOp _ res WriteByteArrayOp_Int64 args = doWriteByteArrayOp Nothing b64 res args
102
emitPrimOp _ res WriteByteArrayOp_Int64 args = doWriteByteArrayOp Nothing b64 res args
102
false
false
0
5
26
24
11
13
null
null
brendanhay/gogol
gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Workspaces/CreateVersion.hs
mpl-2.0
-- | Multipart request metadata. acwcvPayload :: Lens' AccountsContainersWorkspacesCreateVersion CreateContainerVersionRequestVersionOptions acwcvPayload = lens _acwcvPayload (\ s a -> s{_acwcvPayload = a})
208
acwcvPayload :: Lens' AccountsContainersWorkspacesCreateVersion CreateContainerVersionRequestVersionOptions acwcvPayload = lens _acwcvPayload (\ s a -> s{_acwcvPayload = a})
175
acwcvPayload = lens _acwcvPayload (\ s a -> s{_acwcvPayload = a})
67
true
true
0
9
22
42
22
20
null
null
vdweegen/UvA-Software_Testing
Lab5/Cas/Exercises.hs
gpl-3.0
blocksM = blocks !! 1
21
blocksM = blocks !! 1
21
blocksM = blocks !! 1
21
false
false
3
5
4
15
5
10
null
null
ezyang/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
pprSplice (HsUntypedSplice HasDollar n e) = ppr_splice (text "$") n e empty
78
pprSplice (HsUntypedSplice HasDollar n e) = ppr_splice (text "$") n e empty
78
pprSplice (HsUntypedSplice HasDollar n e) = ppr_splice (text "$") n e empty
78
false
false
0
7
14
34
16
18
null
null
chjp2046/fbthrift
thrift/lib/hs/Thrift/Protocol/SimpleJSON.hs
apache-2.0
parseJSONValue (T_LIST ty) = TList ty <$> between '[' ']' (parseJSONList ty)
78
parseJSONValue (T_LIST ty) = TList ty <$> between '[' ']' (parseJSONList ty)
78
parseJSONValue (T_LIST ty) = TList ty <$> between '[' ']' (parseJSONList ty)
78
false
false
0
8
13
35
16
19
null
null
antonlogvinenko/javelin
src/Javelin/Lib/ByteCode/ClassFile.hs
mit
formatParseError :: (LBS.ByteString, Get.ByteOffset, String) -> Either String ByteCode.ByteCode formatParseError (_, _, msg) = Left msg
140
formatParseError :: (LBS.ByteString, Get.ByteOffset, String) -> Either String ByteCode.ByteCode formatParseError (_, _, msg) = Left msg
140
formatParseError (_, _, msg) = Left msg
39
false
true
0
7
20
50
27
23
null
null
dzotokan/SourceGraph
Analyse/GraphRepr.hs
gpl-3.0
-- | Doesn't touch collapsedVirts updateCollapsed :: (HSGraph -> HSGraph) -> HData' -> HData' updateCollapsed f hd' = hd' { collapsedHData = mapData' f $ collapsedHData hd' }
180
updateCollapsed :: (HSGraph -> HSGraph) -> HData' -> HData' updateCollapsed f hd' = hd' { collapsedHData = mapData' f $ collapsedHData hd' }
146
updateCollapsed f hd' = hd' { collapsedHData = mapData' f $ collapsedHData hd' }
80
true
true
0
8
33
50
26
24
null
null
SilverSylvester/cplot
src/Dataset/Backend/MinMaxQueue.hs
mit
minimum :: Ord a => MinMaxQueue a -> Maybe a minimum = \case MMQ [] [] -> Nothing MMQ ((_,_,mn):_) [] -> Just mn MMQ [] ((_,_,mn'):_) -> Just mn' MMQ ((_,_,mn):_) ((_,_,mn'):_) -> Just (min mn mn') -- | Pushes left, pops right, discards popped point.
301
minimum :: Ord a => MinMaxQueue a -> Maybe a minimum = \case MMQ [] [] -> Nothing MMQ ((_,_,mn):_) [] -> Just mn MMQ [] ((_,_,mn'):_) -> Just mn' MMQ ((_,_,mn):_) ((_,_,mn'):_) -> Just (min mn mn') -- | Pushes left, pops right, discards popped point.
301
minimum = \case MMQ [] [] -> Nothing MMQ ((_,_,mn):_) [] -> Just mn MMQ [] ((_,_,mn'):_) -> Just mn' MMQ ((_,_,mn):_) ((_,_,mn'):_) -> Just (min mn mn') -- | Pushes left, pops right, discards popped point.
256
false
true
6
7
97
157
86
71
null
null
flowbox-public/language-c-quote
Language/C/Quote/Base.hs
bsd-3-clause
qqInitializerE :: C.Initializer -> Maybe (Q Exp) qqInitializerE (C.AntiInit v _) = Just $ antiVarE v
101
qqInitializerE :: C.Initializer -> Maybe (Q Exp) qqInitializerE (C.AntiInit v _) = Just $ antiVarE v
101
qqInitializerE (C.AntiInit v _) = Just $ antiVarE v
52
false
true
0
8
16
46
22
24
null
null
Hamcha/dvx
Std.hs
mit
noContext :: ([DvxValue] -> IO DvxValue) -> Function noContext f c args = f args >>= \ret -> return (ret, c)
108
noContext :: ([DvxValue] -> IO DvxValue) -> Function noContext f c args = f args >>= \ret -> return (ret, c)
108
noContext f c args = f args >>= \ret -> return (ret, c)
55
false
true
0
8
20
56
29
27
null
null
gridaphobe/cabal
cabal-install/Distribution/Client/Setup.hs
bsd-3-clause
installOptions :: ShowOrParseArgs -> [OptionField InstallFlags] installOptions showOrParseArgs = [ option "" ["documentation"] "building of documentation" installDocumentation (\v flags -> flags { installDocumentation = v }) (boolOpt [] []) , option [] ["doc-index-file"] "A central index of haddock API documentation (template cannot use $pkgid)" installHaddockIndex (\v flags -> flags { installHaddockIndex = v }) (reqArg' "TEMPLATE" (toFlag.toPathTemplate) (flagToList . fmap fromPathTemplate)) , option [] ["dry-run"] "Do not install anything, only print what would be installed." installDryRun (\v flags -> flags { installDryRun = v }) trueArg ] ++ optionSolverFlags showOrParseArgs installMaxBackjumps (\v flags -> flags { installMaxBackjumps = v }) installReorderGoals (\v flags -> flags { installReorderGoals = v }) installIndependentGoals (\v flags -> flags { installIndependentGoals = v }) installShadowPkgs (\v flags -> flags { installShadowPkgs = v }) installStrongFlags (\v flags -> flags { installStrongFlags = v }) ++ [ option [] ["reinstall"] "Install even if it means installing the same version again." installReinstall (\v flags -> flags { installReinstall = v }) (yesNoOpt showOrParseArgs) , option [] ["avoid-reinstalls"] "Do not select versions that would destructively overwrite installed packages." installAvoidReinstalls (\v flags -> flags { installAvoidReinstalls = v }) (yesNoOpt showOrParseArgs) , option [] ["force-reinstalls"] "Reinstall packages even if they will most likely break other installed packages." installOverrideReinstall (\v flags -> flags { installOverrideReinstall = v }) (yesNoOpt showOrParseArgs) , option [] ["upgrade-dependencies"] "Pick the latest version for all dependencies, rather than trying to pick an installed version." installUpgradeDeps (\v flags -> flags { installUpgradeDeps = v }) (yesNoOpt showOrParseArgs) , option [] ["only-dependencies"] "Install only the dependencies necessary to build the given packages" installOnlyDeps (\v flags -> flags { installOnlyDeps = v }) (yesNoOpt showOrParseArgs) , option [] ["dependencies-only"] "A synonym for --only-dependencies" installOnlyDeps (\v flags -> flags { installOnlyDeps = v }) (yesNoOpt showOrParseArgs) , option [] ["root-cmd"] "Command used to gain root privileges, when installing with --global." installRootCmd (\v flags -> flags { installRootCmd = v }) (reqArg' "COMMAND" toFlag flagToList) , option [] ["symlink-bindir"] "Add symlinks to installed executables into this directory." installSymlinkBinDir (\v flags -> flags { installSymlinkBinDir = v }) (reqArgFlag "DIR") , option [] ["build-summary"] "Save build summaries to file (name template can use $pkgid, $compiler, $os, $arch)" installSummaryFile (\v flags -> flags { installSummaryFile = v }) (reqArg' "TEMPLATE" (\x -> toNubList [toPathTemplate x]) (map fromPathTemplate . fromNubList)) , option [] ["build-log"] "Log all builds to file (name template can use $pkgid, $compiler, $os, $arch)" installLogFile (\v flags -> flags { installLogFile = v }) (reqArg' "TEMPLATE" (toFlag.toPathTemplate) (flagToList . fmap fromPathTemplate)) , option [] ["remote-build-reporting"] "Generate build reports to send to a remote server (none, anonymous or detailed)." installBuildReports (\v flags -> flags { installBuildReports = v }) (reqArg "LEVEL" (readP_to_E (const $ "report level must be 'none', " ++ "'anonymous' or 'detailed'") (toFlag `fmap` parse)) (flagToList . fmap display)) , option [] ["report-planning-failure"] "Generate build reports when the dependency solver fails. This is used by the Hackage build bot." installReportPlanningFailure (\v flags -> flags { installReportPlanningFailure = v }) trueArg , option [] ["one-shot"] "Do not record the packages in the world file." installOneShot (\v flags -> flags { installOneShot = v }) (yesNoOpt showOrParseArgs) , option [] ["run-tests"] "Run package test suites during installation." installRunTests (\v flags -> flags { installRunTests = v }) trueArg , optionNumJobs installNumJobs (\v flags -> flags { installNumJobs = v }) , option [] ["offline"] "Don't download packages from the Internet." installOfflineMode (\v flags -> flags { installOfflineMode = v }) (yesNoOpt showOrParseArgs) ] ++ case showOrParseArgs of -- TODO: remove when "cabal install" -- avoids ParseArgs -> [ option [] ["only"] "Only installs the package in the current directory." installOnly (\v flags -> flags { installOnly = v }) trueArg ] _ -> []
5,604
installOptions :: ShowOrParseArgs -> [OptionField InstallFlags] installOptions showOrParseArgs = [ option "" ["documentation"] "building of documentation" installDocumentation (\v flags -> flags { installDocumentation = v }) (boolOpt [] []) , option [] ["doc-index-file"] "A central index of haddock API documentation (template cannot use $pkgid)" installHaddockIndex (\v flags -> flags { installHaddockIndex = v }) (reqArg' "TEMPLATE" (toFlag.toPathTemplate) (flagToList . fmap fromPathTemplate)) , option [] ["dry-run"] "Do not install anything, only print what would be installed." installDryRun (\v flags -> flags { installDryRun = v }) trueArg ] ++ optionSolverFlags showOrParseArgs installMaxBackjumps (\v flags -> flags { installMaxBackjumps = v }) installReorderGoals (\v flags -> flags { installReorderGoals = v }) installIndependentGoals (\v flags -> flags { installIndependentGoals = v }) installShadowPkgs (\v flags -> flags { installShadowPkgs = v }) installStrongFlags (\v flags -> flags { installStrongFlags = v }) ++ [ option [] ["reinstall"] "Install even if it means installing the same version again." installReinstall (\v flags -> flags { installReinstall = v }) (yesNoOpt showOrParseArgs) , option [] ["avoid-reinstalls"] "Do not select versions that would destructively overwrite installed packages." installAvoidReinstalls (\v flags -> flags { installAvoidReinstalls = v }) (yesNoOpt showOrParseArgs) , option [] ["force-reinstalls"] "Reinstall packages even if they will most likely break other installed packages." installOverrideReinstall (\v flags -> flags { installOverrideReinstall = v }) (yesNoOpt showOrParseArgs) , option [] ["upgrade-dependencies"] "Pick the latest version for all dependencies, rather than trying to pick an installed version." installUpgradeDeps (\v flags -> flags { installUpgradeDeps = v }) (yesNoOpt showOrParseArgs) , option [] ["only-dependencies"] "Install only the dependencies necessary to build the given packages" installOnlyDeps (\v flags -> flags { installOnlyDeps = v }) (yesNoOpt showOrParseArgs) , option [] ["dependencies-only"] "A synonym for --only-dependencies" installOnlyDeps (\v flags -> flags { installOnlyDeps = v }) (yesNoOpt showOrParseArgs) , option [] ["root-cmd"] "Command used to gain root privileges, when installing with --global." installRootCmd (\v flags -> flags { installRootCmd = v }) (reqArg' "COMMAND" toFlag flagToList) , option [] ["symlink-bindir"] "Add symlinks to installed executables into this directory." installSymlinkBinDir (\v flags -> flags { installSymlinkBinDir = v }) (reqArgFlag "DIR") , option [] ["build-summary"] "Save build summaries to file (name template can use $pkgid, $compiler, $os, $arch)" installSummaryFile (\v flags -> flags { installSummaryFile = v }) (reqArg' "TEMPLATE" (\x -> toNubList [toPathTemplate x]) (map fromPathTemplate . fromNubList)) , option [] ["build-log"] "Log all builds to file (name template can use $pkgid, $compiler, $os, $arch)" installLogFile (\v flags -> flags { installLogFile = v }) (reqArg' "TEMPLATE" (toFlag.toPathTemplate) (flagToList . fmap fromPathTemplate)) , option [] ["remote-build-reporting"] "Generate build reports to send to a remote server (none, anonymous or detailed)." installBuildReports (\v flags -> flags { installBuildReports = v }) (reqArg "LEVEL" (readP_to_E (const $ "report level must be 'none', " ++ "'anonymous' or 'detailed'") (toFlag `fmap` parse)) (flagToList . fmap display)) , option [] ["report-planning-failure"] "Generate build reports when the dependency solver fails. This is used by the Hackage build bot." installReportPlanningFailure (\v flags -> flags { installReportPlanningFailure = v }) trueArg , option [] ["one-shot"] "Do not record the packages in the world file." installOneShot (\v flags -> flags { installOneShot = v }) (yesNoOpt showOrParseArgs) , option [] ["run-tests"] "Run package test suites during installation." installRunTests (\v flags -> flags { installRunTests = v }) trueArg , optionNumJobs installNumJobs (\v flags -> flags { installNumJobs = v }) , option [] ["offline"] "Don't download packages from the Internet." installOfflineMode (\v flags -> flags { installOfflineMode = v }) (yesNoOpt showOrParseArgs) ] ++ case showOrParseArgs of -- TODO: remove when "cabal install" -- avoids ParseArgs -> [ option [] ["only"] "Only installs the package in the current directory." installOnly (\v flags -> flags { installOnly = v }) trueArg ] _ -> []
5,604
installOptions showOrParseArgs = [ option "" ["documentation"] "building of documentation" installDocumentation (\v flags -> flags { installDocumentation = v }) (boolOpt [] []) , option [] ["doc-index-file"] "A central index of haddock API documentation (template cannot use $pkgid)" installHaddockIndex (\v flags -> flags { installHaddockIndex = v }) (reqArg' "TEMPLATE" (toFlag.toPathTemplate) (flagToList . fmap fromPathTemplate)) , option [] ["dry-run"] "Do not install anything, only print what would be installed." installDryRun (\v flags -> flags { installDryRun = v }) trueArg ] ++ optionSolverFlags showOrParseArgs installMaxBackjumps (\v flags -> flags { installMaxBackjumps = v }) installReorderGoals (\v flags -> flags { installReorderGoals = v }) installIndependentGoals (\v flags -> flags { installIndependentGoals = v }) installShadowPkgs (\v flags -> flags { installShadowPkgs = v }) installStrongFlags (\v flags -> flags { installStrongFlags = v }) ++ [ option [] ["reinstall"] "Install even if it means installing the same version again." installReinstall (\v flags -> flags { installReinstall = v }) (yesNoOpt showOrParseArgs) , option [] ["avoid-reinstalls"] "Do not select versions that would destructively overwrite installed packages." installAvoidReinstalls (\v flags -> flags { installAvoidReinstalls = v }) (yesNoOpt showOrParseArgs) , option [] ["force-reinstalls"] "Reinstall packages even if they will most likely break other installed packages." installOverrideReinstall (\v flags -> flags { installOverrideReinstall = v }) (yesNoOpt showOrParseArgs) , option [] ["upgrade-dependencies"] "Pick the latest version for all dependencies, rather than trying to pick an installed version." installUpgradeDeps (\v flags -> flags { installUpgradeDeps = v }) (yesNoOpt showOrParseArgs) , option [] ["only-dependencies"] "Install only the dependencies necessary to build the given packages" installOnlyDeps (\v flags -> flags { installOnlyDeps = v }) (yesNoOpt showOrParseArgs) , option [] ["dependencies-only"] "A synonym for --only-dependencies" installOnlyDeps (\v flags -> flags { installOnlyDeps = v }) (yesNoOpt showOrParseArgs) , option [] ["root-cmd"] "Command used to gain root privileges, when installing with --global." installRootCmd (\v flags -> flags { installRootCmd = v }) (reqArg' "COMMAND" toFlag flagToList) , option [] ["symlink-bindir"] "Add symlinks to installed executables into this directory." installSymlinkBinDir (\v flags -> flags { installSymlinkBinDir = v }) (reqArgFlag "DIR") , option [] ["build-summary"] "Save build summaries to file (name template can use $pkgid, $compiler, $os, $arch)" installSummaryFile (\v flags -> flags { installSummaryFile = v }) (reqArg' "TEMPLATE" (\x -> toNubList [toPathTemplate x]) (map fromPathTemplate . fromNubList)) , option [] ["build-log"] "Log all builds to file (name template can use $pkgid, $compiler, $os, $arch)" installLogFile (\v flags -> flags { installLogFile = v }) (reqArg' "TEMPLATE" (toFlag.toPathTemplate) (flagToList . fmap fromPathTemplate)) , option [] ["remote-build-reporting"] "Generate build reports to send to a remote server (none, anonymous or detailed)." installBuildReports (\v flags -> flags { installBuildReports = v }) (reqArg "LEVEL" (readP_to_E (const $ "report level must be 'none', " ++ "'anonymous' or 'detailed'") (toFlag `fmap` parse)) (flagToList . fmap display)) , option [] ["report-planning-failure"] "Generate build reports when the dependency solver fails. This is used by the Hackage build bot." installReportPlanningFailure (\v flags -> flags { installReportPlanningFailure = v }) trueArg , option [] ["one-shot"] "Do not record the packages in the world file." installOneShot (\v flags -> flags { installOneShot = v }) (yesNoOpt showOrParseArgs) , option [] ["run-tests"] "Run package test suites during installation." installRunTests (\v flags -> flags { installRunTests = v }) trueArg , optionNumJobs installNumJobs (\v flags -> flags { installNumJobs = v }) , option [] ["offline"] "Don't download packages from the Internet." installOfflineMode (\v flags -> flags { installOfflineMode = v }) (yesNoOpt showOrParseArgs) ] ++ case showOrParseArgs of -- TODO: remove when "cabal install" -- avoids ParseArgs -> [ option [] ["only"] "Only installs the package in the current directory." installOnly (\v flags -> flags { installOnly = v }) trueArg ] _ -> []
5,539
false
true
4
14
1,770
1,161
637
524
null
null
fpco/primitive
Data/Primitive/ByteArray.hs
bsd-3-clause
byteArrayContents (ByteArray arr#) = Addr (byteArrayContents# arr#)
67
byteArrayContents (ByteArray arr#) = Addr (byteArrayContents# arr#)
67
byteArrayContents (ByteArray arr#) = Addr (byteArrayContents# arr#)
67
false
false
0
7
6
24
11
13
null
null
mrakgr/futhark
src/Futhark/Analysis/Metrics.hs
bsd-3-clause
primOpMetrics Replicate{} = seen "Replicate"
44
primOpMetrics Replicate{} = seen "Replicate"
44
primOpMetrics Replicate{} = seen "Replicate"
44
false
false
0
5
4
17
7
10
null
null
xnning/TypeInfer
src/TypeCheck.hs
gpl-3.0
app_typing ty e2 = throwError $ T.concat ["expr of type ", showExpr ty, "\ncan not be applied to ", showExpr e2]
114
app_typing ty e2 = throwError $ T.concat ["expr of type ", showExpr ty, "\ncan not be applied to ", showExpr e2]
114
app_typing ty e2 = throwError $ T.concat ["expr of type ", showExpr ty, "\ncan not be applied to ", showExpr e2]
114
false
false
3
7
22
44
19
25
null
null
asilvestre/haskell-neo4j-rest-client
src/Database/Neo4j/Traversal.hs
mit
-- | Get the path of a node in simple text bsNodePath :: NodeIdentifier a => a -> S.ByteString bsNodePath n = TE.encodeUtf8 $ (runNodePath $ getNodePath n)
155
bsNodePath :: NodeIdentifier a => a -> S.ByteString bsNodePath n = TE.encodeUtf8 $ (runNodePath $ getNodePath n)
112
bsNodePath n = TE.encodeUtf8 $ (runNodePath $ getNodePath n)
60
true
true
0
8
27
44
22
22
null
null
GaloisInc/galua
galua-dbg/src/Galua/Debugger/Trie.hs
mit
collapseTree :: (k -> k -> k) -> Tree k v -> Tree k v collapseTree jn t = case t of Node k1 [t1] -> case collapseTree jn t1 of Node k2 ts -> Node (jn k1 k2) ts Leaf v -> Leaf v Node k1 ts -> Node k1 (map (collapseTree jn) ts) Leaf v -> Leaf v
286
collapseTree :: (k -> k -> k) -> Tree k v -> Tree k v collapseTree jn t = case t of Node k1 [t1] -> case collapseTree jn t1 of Node k2 ts -> Node (jn k1 k2) ts Leaf v -> Leaf v Node k1 ts -> Node k1 (map (collapseTree jn) ts) Leaf v -> Leaf v
286
collapseTree jn t = case t of Node k1 [t1] -> case collapseTree jn t1 of Node k2 ts -> Node (jn k1 k2) ts Leaf v -> Leaf v Node k1 ts -> Node k1 (map (collapseTree jn) ts) Leaf v -> Leaf v
232
false
true
0
13
103
150
70
80
null
null
mcmaniac/ghc
utils/ghctags/Main.hs
bsd-3-clause
e_dumpfiledata :: FileData -> String e_dumpfiledata (FileData filename things line_map) = "\x0c\n" ++ filename ++ "," ++ (show thingslength) ++ "\n" ++ thingsdump where thingsdump = concat $ map (e_dumpthing line_map) things thingslength = length thingsdump
305
e_dumpfiledata :: FileData -> String e_dumpfiledata (FileData filename things line_map) = "\x0c\n" ++ filename ++ "," ++ (show thingslength) ++ "\n" ++ thingsdump where thingsdump = concat $ map (e_dumpthing line_map) things thingslength = length thingsdump
305
e_dumpfiledata (FileData filename things line_map) = "\x0c\n" ++ filename ++ "," ++ (show thingslength) ++ "\n" ++ thingsdump where thingsdump = concat $ map (e_dumpthing line_map) things thingslength = length thingsdump
268
false
true
1
9
83
85
42
43
null
null
GaloisInc/saw-script
saw/SAWScript/REPL/Haskeline.hs
bsd-3-clause
completeType :: CompletionFunc REPL completeType (l,_) = do ns <- getTypeNames let n = reverse l vars = filter (n `isPrefixOf`) ns return (l,map (nameComp n) vars)
178
completeType :: CompletionFunc REPL completeType (l,_) = do ns <- getTypeNames let n = reverse l vars = filter (n `isPrefixOf`) ns return (l,map (nameComp n) vars)
178
completeType (l,_) = do ns <- getTypeNames let n = reverse l vars = filter (n `isPrefixOf`) ns return (l,map (nameComp n) vars)
142
false
true
0
11
41
81
41
40
null
null
uduki/hsQt
Qtc/Enums/Gui/QMessageBox.hs
bsd-2-clause
ieQMessageBoxButtonRole :: Int -> QMessageBoxButtonRole ieQMessageBoxButtonRole x = QEnum (CQMessageBoxButtonRole x)
116
ieQMessageBoxButtonRole :: Int -> QMessageBoxButtonRole ieQMessageBoxButtonRole x = QEnum (CQMessageBoxButtonRole x)
116
ieQMessageBoxButtonRole x = QEnum (CQMessageBoxButtonRole x)
60
false
true
0
7
10
27
13
14
null
null
dmjio/bloodhound
tests/tests.hs
bsd-3-clause
getServerVersion :: Server -> IO (Maybe ServerVersion) getServerVersion s = liftM extractVersion (getStatus s) where version' = T.splitOn "." . number . version toInt = read . T.unpack parseVersion v = map toInt (version' v) extractVersion = join . liftM (mkServerVersion . parseVersion)
372
getServerVersion :: Server -> IO (Maybe ServerVersion) getServerVersion s = liftM extractVersion (getStatus s) where version' = T.splitOn "." . number . version toInt = read . T.unpack parseVersion v = map toInt (version' v) extractVersion = join . liftM (mkServerVersion . parseVersion)
372
getServerVersion s = liftM extractVersion (getStatus s) where version' = T.splitOn "." . number . version toInt = read . T.unpack parseVersion v = map toInt (version' v) extractVersion = join . liftM (mkServerVersion . parseVersion)
317
false
true
0
8
127
108
53
55
null
null
jprider63/LMonad-Yesod
src/Database/LPersist.hs
mit
toProtectedWithKey :: (LMonad m, ProtectedEntity l e) => Entity e -> LMonadT l m (PEntity l e) toProtectedWithKey r = do p <- toProtected r return $ PEntity (entityKey r) p
180
toProtectedWithKey :: (LMonad m, ProtectedEntity l e) => Entity e -> LMonadT l m (PEntity l e) toProtectedWithKey r = do p <- toProtected r return $ PEntity (entityKey r) p
180
toProtectedWithKey r = do p <- toProtected r return $ PEntity (entityKey r) p
85
false
true
0
10
38
81
38
43
null
null
jaspervdj/hstyle
src/HStyle/Alignment.hs
bsd-3-clause
equal :: Eq a => [a] -> Bool equal (x : y : r) | x == y = equal (y : r) | otherwise = False
115
equal :: Eq a => [a] -> Bool equal (x : y : r) | x == y = equal (y : r) | otherwise = False
115
equal (x : y : r) | x == y = equal (y : r) | otherwise = False
74
false
true
0
11
50
76
35
41
null
null
ocramz/dynamic-bayesian-nets
src/Lib.hs
bsd-3-clause
histPM :: (Foldable t, Ord k) => t k -> [(k, Double)] histPM ll = sortHist $ M.toList pm where (ProbMap pm) = bm2pm (fromFoldableBM ll) -- examples
151
histPM :: (Foldable t, Ord k) => t k -> [(k, Double)] histPM ll = sortHist $ M.toList pm where (ProbMap pm) = bm2pm (fromFoldableBM ll) -- examples
151
histPM ll = sortHist $ M.toList pm where (ProbMap pm) = bm2pm (fromFoldableBM ll) -- examples
97
false
true
2
10
31
85
41
44
null
null
jsavatgy/hatupist
code/helperCanvas.hs
gpl-2.0
r gs = results gs
17
r gs = results gs
17
r gs = results gs
17
false
false
0
5
4
12
5
7
null
null
nevrenato/Hets_Fork
Comorphisms/CASL2HasCASL.hs
gpl-2.0
typeOfTerm :: CasS.TermExtension f => Cas.TERM f -> Type typeOfTerm = toType . CasS.sortOfTerm
94
typeOfTerm :: CasS.TermExtension f => Cas.TERM f -> Type typeOfTerm = toType . CasS.sortOfTerm
94
typeOfTerm = toType . CasS.sortOfTerm
37
false
true
0
9
13
42
18
24
null
null
psibi/yesod
yesod-form/Yesod/Form/I18n/Czech.hs
mit
czechFormMessage MsgSelectNone = "<Nic>"
40
czechFormMessage MsgSelectNone = "<Nic>"
40
czechFormMessage MsgSelectNone = "<Nic>"
40
false
false
0
4
3
10
4
6
null
null
z0isch/reddit-dailyprogrammer
Challenge260/src/RFC2616.hs
mit
requestLine :: (Monad m, TokenParsing m) => m Request requestLine = Request <$!> (highlight ReservedIdentifier (some token) <?> "request method") <* skipHSpaces <*> (highlight Identifier (some (satisfy (not . isHSpace))) <?> "url") <* skipHSpaces <*> (try (highlight ReservedIdentifier (string "HTTP/" *> many httpVersion <* endOfLine)) <?> "protocol") where httpVersion :: (Monad m, CharParsing m) => m Char httpVersion = satisfy $ \c -> c == '1' || c == '0' || c == '.' || c == '9'
587
requestLine :: (Monad m, TokenParsing m) => m Request requestLine = Request <$!> (highlight ReservedIdentifier (some token) <?> "request method") <* skipHSpaces <*> (highlight Identifier (some (satisfy (not . isHSpace))) <?> "url") <* skipHSpaces <*> (try (highlight ReservedIdentifier (string "HTTP/" *> many httpVersion <* endOfLine)) <?> "protocol") where httpVersion :: (Monad m, CharParsing m) => m Char httpVersion = satisfy $ \c -> c == '1' || c == '0' || c == '.' || c == '9'
587
requestLine = Request <$!> (highlight ReservedIdentifier (some token) <?> "request method") <* skipHSpaces <*> (highlight Identifier (some (satisfy (not . isHSpace))) <?> "url") <* skipHSpaces <*> (try (highlight ReservedIdentifier (string "HTTP/" *> many httpVersion <* endOfLine)) <?> "protocol") where httpVersion :: (Monad m, CharParsing m) => m Char httpVersion = satisfy $ \c -> c == '1' || c == '0' || c == '.' || c == '9'
533
false
true
0
16
181
201
102
99
null
null
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/UI/Text3D.hs
mit
text3DSetMaterialAttr :: (Parent Text3D a, Pointer ptr a, MonadIO m) => ptr -- ^ Pointer to text3D or ascentor -> ResourceRef -- ^ value -> m () text3DSetMaterialAttr p v = liftIO $ with v $ \v' -> do let ptr = parentPointer p [C.exp| void {$(Text3D* ptr)->SetMaterialAttr(*$(ResourceRef* v'))} |] -- | Return material attribute. -- ResourceRef GetMaterialAttr() const;
380
text3DSetMaterialAttr :: (Parent Text3D a, Pointer ptr a, MonadIO m) => ptr -- ^ Pointer to text3D or ascentor -> ResourceRef -- ^ value -> m () text3DSetMaterialAttr p v = liftIO $ with v $ \v' -> do let ptr = parentPointer p [C.exp| void {$(Text3D* ptr)->SetMaterialAttr(*$(ResourceRef* v'))} |] -- | Return material attribute. -- ResourceRef GetMaterialAttr() const;
380
text3DSetMaterialAttr p v = liftIO $ with v $ \v' -> do let ptr = parentPointer p [C.exp| void {$(Text3D* ptr)->SetMaterialAttr(*$(ResourceRef* v'))} |] -- | Return material attribute. -- ResourceRef GetMaterialAttr() const;
229
false
true
0
12
69
96
50
46
null
null
olsner/ghc
compiler/iface/IfaceType.hs
bsd-3-clause
{- Note [Defaulting RuntimeRep variables] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RuntimeRep variables are considered by many (most?) users to be little more than syntactic noise. When the notion was introduced there was a signficant and understandable push-back from those with pedagogy in mind, which argued that RuntimeRep variables would throw a wrench into nearly any teach approach since they appear in even the lowly ($) function's type, ($) :: forall (w :: RuntimeRep) a (b :: TYPE w). (a -> b) -> a -> b which is significantly less readable than its non RuntimeRep-polymorphic type of ($) :: (a -> b) -> a -> b Moreover, unboxed types don't appear all that often in run-of-the-mill Haskell programs, so it makes little sense to make all users pay this syntactic overhead. For this reason it was decided that we would hide RuntimeRep variables for now (see #11549). We do this by defaulting all type variables of kind RuntimeRep to PtrLiftedRep. This is done in a pass right before pretty-printing (defaultRuntimeRepVars, controlled by -fprint-explicit-runtime-reps) -} -- | Default 'RuntimeRep' variables to 'LiftedPtr'. e.g. -- -- @ -- ($) :: forall (r :: GHC.Types.RuntimeRep) a (b :: TYPE r). -- (a -> b) -> a -> b -- @ -- -- turns in to, -- -- @ ($) :: forall a (b :: *). (a -> b) -> a -> b @ -- -- We do this to prevent RuntimeRep variables from incurring a significant -- syntactic overhead in otherwise simple type signatures (e.g. ($)). See -- Note [Defaulting RuntimeRep variables] and #11549 for further discussion. -- defaultRuntimeRepVars :: IfaceType -> IfaceType defaultRuntimeRepVars = go emptyFsEnv where go :: FastStringEnv () -> IfaceType -> IfaceType go subs (IfaceForAllTy bndr ty) | isRuntimeRep var_kind = let subs' = extendFsEnv subs var () in go subs' ty | otherwise = IfaceForAllTy (TvBndr (var, go subs var_kind) (binderArgFlag bndr)) (go subs ty) where var :: IfLclName (var, var_kind) = binderVar bndr go subs (IfaceTyVar tv) | tv `elemFsEnv` subs = IfaceTyConApp ptrRepLifted ITC_Nil go subs (IfaceFunTy kind ty) = IfaceFunTy (go subs kind) (go subs ty) go subs (IfaceAppTy x y) = IfaceAppTy (go subs x) (go subs y) go subs (IfaceDFunTy x y) = IfaceDFunTy (go subs x) (go subs y) go subs (IfaceCastTy x co) = IfaceCastTy (go subs x) co go _ other = other ptrRepLifted :: IfaceTyCon ptrRepLifted = IfaceTyCon dc_name (IfaceTyConInfo IsPromoted IfaceNormalTyCon) where dc_name = getName ptrRepLiftedDataConTyCon isRuntimeRep :: IfaceType -> Bool isRuntimeRep (IfaceTyConApp tc _) = tc `ifaceTyConHasKey` runtimeRepTyConKey isRuntimeRep _ = False
2,784
defaultRuntimeRepVars :: IfaceType -> IfaceType defaultRuntimeRepVars = go emptyFsEnv where go :: FastStringEnv () -> IfaceType -> IfaceType go subs (IfaceForAllTy bndr ty) | isRuntimeRep var_kind = let subs' = extendFsEnv subs var () in go subs' ty | otherwise = IfaceForAllTy (TvBndr (var, go subs var_kind) (binderArgFlag bndr)) (go subs ty) where var :: IfLclName (var, var_kind) = binderVar bndr go subs (IfaceTyVar tv) | tv `elemFsEnv` subs = IfaceTyConApp ptrRepLifted ITC_Nil go subs (IfaceFunTy kind ty) = IfaceFunTy (go subs kind) (go subs ty) go subs (IfaceAppTy x y) = IfaceAppTy (go subs x) (go subs y) go subs (IfaceDFunTy x y) = IfaceDFunTy (go subs x) (go subs y) go subs (IfaceCastTy x co) = IfaceCastTy (go subs x) co go _ other = other ptrRepLifted :: IfaceTyCon ptrRepLifted = IfaceTyCon dc_name (IfaceTyConInfo IsPromoted IfaceNormalTyCon) where dc_name = getName ptrRepLiftedDataConTyCon isRuntimeRep :: IfaceType -> Bool isRuntimeRep (IfaceTyConApp tc _) = tc `ifaceTyConHasKey` runtimeRepTyConKey isRuntimeRep _ = False
1,225
defaultRuntimeRepVars = go emptyFsEnv where go :: FastStringEnv () -> IfaceType -> IfaceType go subs (IfaceForAllTy bndr ty) | isRuntimeRep var_kind = let subs' = extendFsEnv subs var () in go subs' ty | otherwise = IfaceForAllTy (TvBndr (var, go subs var_kind) (binderArgFlag bndr)) (go subs ty) where var :: IfLclName (var, var_kind) = binderVar bndr go subs (IfaceTyVar tv) | tv `elemFsEnv` subs = IfaceTyConApp ptrRepLifted ITC_Nil go subs (IfaceFunTy kind ty) = IfaceFunTy (go subs kind) (go subs ty) go subs (IfaceAppTy x y) = IfaceAppTy (go subs x) (go subs y) go subs (IfaceDFunTy x y) = IfaceDFunTy (go subs x) (go subs y) go subs (IfaceCastTy x co) = IfaceCastTy (go subs x) co go _ other = other ptrRepLifted :: IfaceTyCon ptrRepLifted = IfaceTyCon dc_name (IfaceTyConInfo IsPromoted IfaceNormalTyCon) where dc_name = getName ptrRepLiftedDataConTyCon isRuntimeRep :: IfaceType -> Bool isRuntimeRep (IfaceTyConApp tc _) = tc `ifaceTyConHasKey` runtimeRepTyConKey isRuntimeRep _ = False
1,177
true
true
0
11
623
439
224
215
null
null
mslovy/barrelfish
hake/ArchDefaults.hs
mit
-- -- the C preprocessor, like C compiler but with -E -- cPreprocessor arch compiler opts phase src obj = let incls = (optIncludes opts) ++ (extraIncludes opts) flags = (optFlags opts) ++ (optDefines opts) ++ [ Str f | f <- extraFlags opts ] ++ [ Str f | f <- extraDefines opts ] deps = (optDependencies opts) ++ (extraDependencies opts) cOptFlags = unwords ((words Config.cOptFlags) \\ ["-g"]) in [ Str compiler ] ++ flags ++ [ Str cOptFlags ] ++ concat [ [ NStr "-I", i ] | i <- incls ] ++ [ Str "-o", Out arch obj, Str "-E", In (if phase == "src" then SrcTree else BuildTree) phase src ] ++ deps
716
cPreprocessor arch compiler opts phase src obj = let incls = (optIncludes opts) ++ (extraIncludes opts) flags = (optFlags opts) ++ (optDefines opts) ++ [ Str f | f <- extraFlags opts ] ++ [ Str f | f <- extraDefines opts ] deps = (optDependencies opts) ++ (extraDependencies opts) cOptFlags = unwords ((words Config.cOptFlags) \\ ["-g"]) in [ Str compiler ] ++ flags ++ [ Str cOptFlags ] ++ concat [ [ NStr "-I", i ] | i <- incls ] ++ [ Str "-o", Out arch obj, Str "-E", In (if phase == "src" then SrcTree else BuildTree) phase src ] ++ deps
659
cPreprocessor arch compiler opts phase src obj = let incls = (optIncludes opts) ++ (extraIncludes opts) flags = (optFlags opts) ++ (optDefines opts) ++ [ Str f | f <- extraFlags opts ] ++ [ Str f | f <- extraDefines opts ] deps = (optDependencies opts) ++ (extraDependencies opts) cOptFlags = unwords ((words Config.cOptFlags) \\ ["-g"]) in [ Str compiler ] ++ flags ++ [ Str cOptFlags ] ++ concat [ [ NStr "-I", i ] | i <- incls ] ++ [ Str "-o", Out arch obj, Str "-E", In (if phase == "src" then SrcTree else BuildTree) phase src ] ++ deps
659
true
false
0
14
234
259
133
126
null
null
ghc-android/ghc
libraries/template-haskell/Language/Haskell/TH/Lib.hs
bsd-3-clause
sigP :: PatQ -> TypeQ -> PatQ sigP p t = do p' <- p t' <- t return (SigP p' t')
107
sigP :: PatQ -> TypeQ -> PatQ sigP p t = do p' <- p t' <- t return (SigP p' t')
107
sigP p t = do p' <- p t' <- t return (SigP p' t')
77
false
true
0
10
49
58
25
33
null
null
wereHamster/mudbath
Executor.hs
unlicense
generateRandomString :: IO Text generateRandomString = do stdgen <- newStdGen return $ T.pack $ fst $ randomString 20 stdgen
132
generateRandomString :: IO Text generateRandomString = do stdgen <- newStdGen return $ T.pack $ fst $ randomString 20 stdgen
132
generateRandomString = do stdgen <- newStdGen return $ T.pack $ fst $ randomString 20 stdgen
100
false
true
0
10
26
43
20
23
null
null
rzil/honours
DeepLearning/Data/Array/Accelerate/Dif.hs
mit
nn (b:bs) (a:as) f = (dActivation f) . (dAffine_wrt_parameters_and_input b a) . (nn bs as f)
92
nn (b:bs) (a:as) f = (dActivation f) . (dAffine_wrt_parameters_and_input b a) . (nn bs as f)
92
nn (b:bs) (a:as) f = (dActivation f) . (dAffine_wrt_parameters_and_input b a) . (nn bs as f)
92
false
false
1
9
15
63
30
33
null
null
bj4rtmar/sdl2
src/SDL/Audio.hs
bsd-3-clause
audioInit :: MonadIO m => AudioDriver -> m () audioInit (AudioDriver n) = liftIO $ BS.useAsCString (Text.encodeUtf8 n) $ throwIfNeg_ "SDL.Audio.audioInit" "SDL_AudioInit" . Raw.audioInit
188
audioInit :: MonadIO m => AudioDriver -> m () audioInit (AudioDriver n) = liftIO $ BS.useAsCString (Text.encodeUtf8 n) $ throwIfNeg_ "SDL.Audio.audioInit" "SDL_AudioInit" . Raw.audioInit
188
audioInit (AudioDriver n) = liftIO $ BS.useAsCString (Text.encodeUtf8 n) $ throwIfNeg_ "SDL.Audio.audioInit" "SDL_AudioInit" . Raw.audioInit
142
false
true
0
11
25
72
33
39
null
null
jonathan-laurent/copilot-kind
src/Copilot/Kind/IL/Translate.hs
bsd-3-clause
expr t (C.Var _ name) = return $ SVal t (ncLocal name) _n_
58
expr t (C.Var _ name) = return $ SVal t (ncLocal name) _n_
58
expr t (C.Var _ name) = return $ SVal t (ncLocal name) _n_
58
false
false
0
8
12
40
18
22
null
null
rahulmutt/codec-jvm
src/Codec/JVM/Opcode.hs
apache-2.0
ifeq = Opcode 0x99
18
ifeq = Opcode 0x99
18
ifeq = Opcode 0x99
18
false
false
0
5
3
9
4
5
null
null