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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
TikhonJelvis/TPL | test/TPL/Test/Parse.hs | gpl-3.0 | isBoolean (Boolean b) "true" = b | 33 | isBoolean (Boolean b) "true" = b | 33 | isBoolean (Boolean b) "true" = b | 33 | false | false | 0 | 7 | 6 | 17 | 8 | 9 | null | null |
sdiehl/ghc | testsuite/tests/rebindable/DoRestrictedM.hs | bsd-3-clause | -- Just "ba"
test1fr :: Maybe String
test1fr = unRM $ test1f () | 64 | test1fr :: Maybe String
test1fr = unRM $ test1f () | 50 | test1fr = unRM $ test1f () | 26 | true | true | 0 | 7 | 13 | 24 | 12 | 12 | null | null |
sdiehl/ghc | compiler/coreSyn/CoreFVs.hs | bsd-3-clause | ruleRhsFreeVars (Rule { ru_fn = _, ru_bndrs = bndrs, ru_rhs = rhs })
= fvVarSet $ filterFV isLocalVar $ addBndrs bndrs (expr_fvs rhs) | 135 | ruleRhsFreeVars (Rule { ru_fn = _, ru_bndrs = bndrs, ru_rhs = rhs })
= fvVarSet $ filterFV isLocalVar $ addBndrs bndrs (expr_fvs rhs) | 135 | ruleRhsFreeVars (Rule { ru_fn = _, ru_bndrs = bndrs, ru_rhs = rhs })
= fvVarSet $ filterFV isLocalVar $ addBndrs bndrs (expr_fvs rhs) | 135 | false | false | 0 | 9 | 24 | 55 | 29 | 26 | null | null |
peterokagey/haskellOEIS | src/Delahaye/A338033.hs | apache-2.0 | a338033 :: Int -> Integer
a338033 n = a338033_list !! (n-1) | 59 | a338033 :: Int -> Integer
a338033 n = a338033_list !! (n-1) | 59 | a338033 n = a338033_list !! (n-1) | 33 | false | true | 0 | 7 | 10 | 29 | 15 | 14 | null | null |
mikeizbicki/cassava | tests/UnitTests.hs | bsd-3-clause | boundary :: forall a. (Bounded a, Eq a, FromField a, ToField a) => a -> Bool
boundary _dummy = roundTrip (minBound :: a) && roundTrip (maxBound :: a) | 149 | boundary :: forall a. (Bounded a, Eq a, FromField a, ToField a) => a -> Bool
boundary _dummy = roundTrip (minBound :: a) && roundTrip (maxBound :: a) | 149 | boundary _dummy = roundTrip (minBound :: a) && roundTrip (maxBound :: a) | 72 | false | true | 0 | 9 | 27 | 77 | 39 | 38 | null | null |
Russell91/pyfi | codegen.hs | mit | funcname :: [ArgType] -> String
funcname sig = "def" ++ concat (map show sig) | 77 | funcname :: [ArgType] -> String
funcname sig = "def" ++ concat (map show sig) | 77 | funcname sig = "def" ++ concat (map show sig) | 45 | false | true | 2 | 7 | 13 | 42 | 19 | 23 | null | null |
ducis/haAni | hs/common/Graphics/Rendering/OpenGL/GL/CoordTrans.hs | gpl-2.0 | matrixModeToGetStackDepth :: MatrixMode -> GetPName
matrixModeToGetStackDepth x = case x of
Modelview _ -> GetModelviewStackDepth
Projection -> GetProjectionStackDepth
Texture -> GetTextureStackDepth
Color -> GetColorMatrixStackDepth
MatrixPalette -> error "matrixModeToGetStackDepth: impossible" | 331 | matrixModeToGetStackDepth :: MatrixMode -> GetPName
matrixModeToGetStackDepth x = case x of
Modelview _ -> GetModelviewStackDepth
Projection -> GetProjectionStackDepth
Texture -> GetTextureStackDepth
Color -> GetColorMatrixStackDepth
MatrixPalette -> error "matrixModeToGetStackDepth: impossible" | 331 | matrixModeToGetStackDepth x = case x of
Modelview _ -> GetModelviewStackDepth
Projection -> GetProjectionStackDepth
Texture -> GetTextureStackDepth
Color -> GetColorMatrixStackDepth
MatrixPalette -> error "matrixModeToGetStackDepth: impossible" | 279 | false | true | 0 | 8 | 63 | 63 | 29 | 34 | null | null |
greydot/persistent | persistent-mysql/Database/Persist/MySQL.hs | mit | showSqlType SqlString (Just i) True = "VARCHAR(" ++ show i ++ ") CHARACTER SET utf8" | 88 | showSqlType SqlString (Just i) True = "VARCHAR(" ++ show i ++ ") CHARACTER SET utf8" | 88 | showSqlType SqlString (Just i) True = "VARCHAR(" ++ show i ++ ") CHARACTER SET utf8" | 88 | false | false | 0 | 7 | 18 | 30 | 14 | 16 | null | null |
agentm/project-m36 | src/lib/ProjectM36/Key.hs | unlicense | isForeignKeyFor :: InclusionDependency -> (RelVarName, [AttributeName]) -> (RelVarName, [AttributeName]) -> Bool
isForeignKeyFor incDep infoA infoB = incDep == checkIncDep
where
checkIncDep = inclusionDependencyForForeignKey infoA infoB | 242 | isForeignKeyFor :: InclusionDependency -> (RelVarName, [AttributeName]) -> (RelVarName, [AttributeName]) -> Bool
isForeignKeyFor incDep infoA infoB = incDep == checkIncDep
where
checkIncDep = inclusionDependencyForForeignKey infoA infoB | 242 | isForeignKeyFor incDep infoA infoB = incDep == checkIncDep
where
checkIncDep = inclusionDependencyForForeignKey infoA infoB | 129 | false | true | 1 | 9 | 30 | 73 | 36 | 37 | null | null |
v0lkan/learning-haskell | recursion.hs | mit | zip' (x:xs) (y:ys) = (x,y) : zip' xs ys | 39 | zip' (x:xs) (y:ys) = (x,y) : zip' xs ys | 39 | zip' (x:xs) (y:ys) = (x,y) : zip' xs ys | 39 | false | false | 0 | 7 | 8 | 40 | 21 | 19 | null | null |
steveshogren/language-safety-data-collector | src/Database.hs | bsd-3-clause | updateRepoCommitCountT :: Language -> Repository -> Int -> MutateDb
updateRepoCommitCountT = updateRepoFieldCountT commit_count | 127 | updateRepoCommitCountT :: Language -> Repository -> Int -> MutateDb
updateRepoCommitCountT = updateRepoFieldCountT commit_count | 127 | updateRepoCommitCountT = updateRepoFieldCountT commit_count | 59 | false | true | 0 | 7 | 12 | 26 | 13 | 13 | null | null |
isomorphism/hackage2 | Distribution/Server/Packages/State.hs | bsd-3-clause | replacePackagesState :: PackagesState -> Update PackagesState ()
replacePackagesState = State.put | 97 | replacePackagesState :: PackagesState -> Update PackagesState ()
replacePackagesState = State.put | 97 | replacePackagesState = State.put | 32 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
alexander-at-github/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | primOpCanFail WriteByteArrayOp_Word64 = True | 44 | primOpCanFail WriteByteArrayOp_Word64 = True | 44 | primOpCanFail WriteByteArrayOp_Word64 = True | 44 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
kawu/tag-vanilla | src/NLP/TAG/Vanilla/Earley5/GenTest.hs | bsd-2-clause | -- | Make a leaf node.
mkL :: l -> G.GenTree n l i f a
mkL = G.Leaf | 67 | mkL :: l -> G.GenTree n l i f a
mkL = G.Leaf | 44 | mkL = G.Leaf | 12 | true | true | 0 | 8 | 18 | 37 | 17 | 20 | null | null |
cutsea110/sig | sig-api/Util.hs | bsd-3-clause | wheres' :: (SqlProjectable p, PersistableWidth t, Functor f, Monad f) =>
((p t, r) -> f b) -> r -> f (PlaceHolders t)
wheres' p s = (fst <$>) . placeholder $ flip (curry p) s | 179 | wheres' :: (SqlProjectable p, PersistableWidth t, Functor f, Monad f) =>
((p t, r) -> f b) -> r -> f (PlaceHolders t)
wheres' p s = (fst <$>) . placeholder $ flip (curry p) s | 179 | wheres' p s = (fst <$>) . placeholder $ flip (curry p) s | 56 | false | true | 0 | 10 | 40 | 102 | 52 | 50 | null | null |
erantapaa/happstack-server | tests/Happstack/Server/Tests.hs | bsd-3-clause | matchMethodTest :: Test
matchMethodTest =
"matchMethodTest" ~:
do forM_ gethead $ \m -> matchMethod GET m @?= True
forM_ others $ \m -> matchMethod GET m @?= False
forM_ gethead $ \m -> matchMethod [GET] m @?= True
forM_ others $ \m -> matchMethod [GET] m @?= False
forM_ gethead $ \m -> matchMethod [GET, HEAD] m @?= True
forM_ others $ \m -> matchMethod [GET, HEAD] m @?= False
matchMethod POST GET @?= False
matchMethod POST HEAD @?= False
matchMethod POST TRACE @?= False
matchMethod POST POST @?= True
matchMethod [POST, PUT] GET @?= False
matchMethod [POST, PUT] HEAD @?= False
matchMethod [POST, PUT] TRACE @?= False
matchMethod [POST, PUT] POST @?= True
matchMethod [POST, PUT] PUT @?= True
forM_ (others) $ \m -> matchMethod (`notElem` gethead) m @?= True
forM_ (gethead ++ others) $ \m -> matchMethod () m @?= True
where
gethead = [GET, HEAD]
others = [POST, PUT, DELETE, TRACE, OPTIONS, CONNECT] | 1,084 | matchMethodTest :: Test
matchMethodTest =
"matchMethodTest" ~:
do forM_ gethead $ \m -> matchMethod GET m @?= True
forM_ others $ \m -> matchMethod GET m @?= False
forM_ gethead $ \m -> matchMethod [GET] m @?= True
forM_ others $ \m -> matchMethod [GET] m @?= False
forM_ gethead $ \m -> matchMethod [GET, HEAD] m @?= True
forM_ others $ \m -> matchMethod [GET, HEAD] m @?= False
matchMethod POST GET @?= False
matchMethod POST HEAD @?= False
matchMethod POST TRACE @?= False
matchMethod POST POST @?= True
matchMethod [POST, PUT] GET @?= False
matchMethod [POST, PUT] HEAD @?= False
matchMethod [POST, PUT] TRACE @?= False
matchMethod [POST, PUT] POST @?= True
matchMethod [POST, PUT] PUT @?= True
forM_ (others) $ \m -> matchMethod (`notElem` gethead) m @?= True
forM_ (gethead ++ others) $ \m -> matchMethod () m @?= True
where
gethead = [GET, HEAD]
others = [POST, PUT, DELETE, TRACE, OPTIONS, CONNECT] | 1,084 | matchMethodTest =
"matchMethodTest" ~:
do forM_ gethead $ \m -> matchMethod GET m @?= True
forM_ others $ \m -> matchMethod GET m @?= False
forM_ gethead $ \m -> matchMethod [GET] m @?= True
forM_ others $ \m -> matchMethod [GET] m @?= False
forM_ gethead $ \m -> matchMethod [GET, HEAD] m @?= True
forM_ others $ \m -> matchMethod [GET, HEAD] m @?= False
matchMethod POST GET @?= False
matchMethod POST HEAD @?= False
matchMethod POST TRACE @?= False
matchMethod POST POST @?= True
matchMethod [POST, PUT] GET @?= False
matchMethod [POST, PUT] HEAD @?= False
matchMethod [POST, PUT] TRACE @?= False
matchMethod [POST, PUT] POST @?= True
matchMethod [POST, PUT] PUT @?= True
forM_ (others) $ \m -> matchMethod (`notElem` gethead) m @?= True
forM_ (gethead ++ others) $ \m -> matchMethod () m @?= True
where
gethead = [GET, HEAD]
others = [POST, PUT, DELETE, TRACE, OPTIONS, CONNECT] | 1,060 | false | true | 0 | 12 | 333 | 418 | 208 | 210 | null | null |
ComputationWithBoundedResources/tct-trs | src/Tct/Trs/Encoding/Bounds/Violations/Find.hs | bsd-3-clause | reachableFromLifted :: Automaton -> T.Term Symbol v -> S.Set State -> S.Set (LTerm, State)
reachableFromLifted a t qs = runMemoAction reachableFromLiftedM
where t' = identifyVars t
reachableFromLiftedM = foldM (\ r q ->
do lterms <- reachLiftS (t',q)
return $ r `S.union` S.map (\ lt -> (lt,q)) lterms)
S.empty $ S.toList qs
reachLiftS (T.Var _, q) = return $ S.singleton $ S q
reachLiftS s@(T.Fun f ts, q) = memo (s,q) $
foldM (\ lterms (l,args) ->
S.union lterms `liftM` labeledSubterms (f,l) (zip ts args))
S.empty [(l, args) | (l,argss) <- bstepUL a f q , args <- S.toList argss]
labeledSubterms fl subproblems = do ltis <- mapM reachLiftS subproblems
return $ S.fromList [F fl lts | lts <- listProduct $ map S.toList ltis]
-- identifyVars (T.Var _) = T.Var (Var.canonical 0)
identifyVars = T.map id (const (0::Int))
-- TODO: MS what happens here
-- identifyVars (T.Var _) = T.Var 0
-- identifyVars (T.Fun f ts) = T.Fun f $ map identifyVars ts | 1,358 | reachableFromLifted :: Automaton -> T.Term Symbol v -> S.Set State -> S.Set (LTerm, State)
reachableFromLifted a t qs = runMemoAction reachableFromLiftedM
where t' = identifyVars t
reachableFromLiftedM = foldM (\ r q ->
do lterms <- reachLiftS (t',q)
return $ r `S.union` S.map (\ lt -> (lt,q)) lterms)
S.empty $ S.toList qs
reachLiftS (T.Var _, q) = return $ S.singleton $ S q
reachLiftS s@(T.Fun f ts, q) = memo (s,q) $
foldM (\ lterms (l,args) ->
S.union lterms `liftM` labeledSubterms (f,l) (zip ts args))
S.empty [(l, args) | (l,argss) <- bstepUL a f q , args <- S.toList argss]
labeledSubterms fl subproblems = do ltis <- mapM reachLiftS subproblems
return $ S.fromList [F fl lts | lts <- listProduct $ map S.toList ltis]
-- identifyVars (T.Var _) = T.Var (Var.canonical 0)
identifyVars = T.map id (const (0::Int))
-- TODO: MS what happens here
-- identifyVars (T.Var _) = T.Var 0
-- identifyVars (T.Fun f ts) = T.Fun f $ map identifyVars ts | 1,358 | reachableFromLifted a t qs = runMemoAction reachableFromLiftedM
where t' = identifyVars t
reachableFromLiftedM = foldM (\ r q ->
do lterms <- reachLiftS (t',q)
return $ r `S.union` S.map (\ lt -> (lt,q)) lterms)
S.empty $ S.toList qs
reachLiftS (T.Var _, q) = return $ S.singleton $ S q
reachLiftS s@(T.Fun f ts, q) = memo (s,q) $
foldM (\ lterms (l,args) ->
S.union lterms `liftM` labeledSubterms (f,l) (zip ts args))
S.empty [(l, args) | (l,argss) <- bstepUL a f q , args <- S.toList argss]
labeledSubterms fl subproblems = do ltis <- mapM reachLiftS subproblems
return $ S.fromList [F fl lts | lts <- listProduct $ map S.toList ltis]
-- identifyVars (T.Var _) = T.Var (Var.canonical 0)
identifyVars = T.map id (const (0::Int))
-- TODO: MS what happens here
-- identifyVars (T.Var _) = T.Var 0
-- identifyVars (T.Fun f ts) = T.Fun f $ map identifyVars ts | 1,267 | false | true | 3 | 15 | 573 | 422 | 211 | 211 | null | null |
Athas/banko | barc/Barc/Simplifier.hs | bsd-2-clause | mapIntHandle :: E0.Fun -> E0.Exp -> SimplifyM E1.ExpIntList
mapIntHandle (E0.Fun [arg] eBody) es = tryIntSrc <|> tryBoolSrc
where tryBoolSrc = do
es' <- simplifyBoolListM es
indexId <- newIndexId
eBody' <- localBindings $ do
bind arg (E1.BoolExp (E1.IndexBool es' (E1.CurrentIndex indexId)))
simplifyIntM eBody
return $ E1.MapInt indexId (E1.LengthBool es') eBody'
tryIntSrc = do
es' <- simplifyIntListM es
indexId <- newIndexId
eBody' <- localBindings $ do
bind arg (E1.IntExp (E1.IndexInt es' (E1.CurrentIndex indexId)))
simplifyIntM eBody
return $ E1.MapInt indexId (E1.LengthInt es') eBody' | 733 | mapIntHandle :: E0.Fun -> E0.Exp -> SimplifyM E1.ExpIntList
mapIntHandle (E0.Fun [arg] eBody) es = tryIntSrc <|> tryBoolSrc
where tryBoolSrc = do
es' <- simplifyBoolListM es
indexId <- newIndexId
eBody' <- localBindings $ do
bind arg (E1.BoolExp (E1.IndexBool es' (E1.CurrentIndex indexId)))
simplifyIntM eBody
return $ E1.MapInt indexId (E1.LengthBool es') eBody'
tryIntSrc = do
es' <- simplifyIntListM es
indexId <- newIndexId
eBody' <- localBindings $ do
bind arg (E1.IntExp (E1.IndexInt es' (E1.CurrentIndex indexId)))
simplifyIntM eBody
return $ E1.MapInt indexId (E1.LengthInt es') eBody' | 733 | mapIntHandle (E0.Fun [arg] eBody) es = tryIntSrc <|> tryBoolSrc
where tryBoolSrc = do
es' <- simplifyBoolListM es
indexId <- newIndexId
eBody' <- localBindings $ do
bind arg (E1.BoolExp (E1.IndexBool es' (E1.CurrentIndex indexId)))
simplifyIntM eBody
return $ E1.MapInt indexId (E1.LengthBool es') eBody'
tryIntSrc = do
es' <- simplifyIntListM es
indexId <- newIndexId
eBody' <- localBindings $ do
bind arg (E1.IntExp (E1.IndexInt es' (E1.CurrentIndex indexId)))
simplifyIntM eBody
return $ E1.MapInt indexId (E1.LengthInt es') eBody' | 673 | false | true | 1 | 19 | 218 | 249 | 114 | 135 | null | null |
myuon/bwitterkuchen | app/CUI.hs | mit | runClient AOpenReplyTweet = do
use (timeline . listSelectedElemL) >>= \case
Just st -> do
cstate .= Reply
tweetBox . W.editContentsL .= textZipper ["@" `T.append` (st^.asStatus^.user^.screen_name) `T.append` " "] Nothing
Nothing -> return () | 263 | runClient AOpenReplyTweet = do
use (timeline . listSelectedElemL) >>= \case
Just st -> do
cstate .= Reply
tweetBox . W.editContentsL .= textZipper ["@" `T.append` (st^.asStatus^.user^.screen_name) `T.append` " "] Nothing
Nothing -> return () | 263 | runClient AOpenReplyTweet = do
use (timeline . listSelectedElemL) >>= \case
Just st -> do
cstate .= Reply
tweetBox . W.editContentsL .= textZipper ["@" `T.append` (st^.asStatus^.user^.screen_name) `T.append` " "] Nothing
Nothing -> return () | 263 | false | false | 0 | 21 | 54 | 107 | 53 | 54 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/product_1.hs | mit | primPlusNat :: Nat -> Nat -> Nat;
primPlusNat Zero Zero = Zero | 66 | primPlusNat :: Nat -> Nat -> Nat
primPlusNat Zero Zero = Zero | 65 | primPlusNat Zero Zero = Zero | 28 | false | true | 0 | 6 | 15 | 25 | 13 | 12 | null | null |
skatenerd/renderer | src/Lib.hs | bsd-3-clause | square :: (Num a) => a -> a
square x = x * x | 44 | square :: (Num a) => a -> a
square x = x * x | 44 | square x = x * x | 16 | false | true | 0 | 8 | 13 | 37 | 17 | 20 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | tagOf_PrimOp Int64SrlOp = _ILIT(1085) | 37 | tagOf_PrimOp Int64SrlOp = _ILIT(1085) | 37 | tagOf_PrimOp Int64SrlOp = _ILIT(1085) | 37 | false | false | 0 | 6 | 3 | 15 | 7 | 8 | null | null |
brodyberg/LearnHaskell | HaskellProgramming.hsproj/Chapter09/Cipher.hs | mit | cipher shift (x:xs) =
[(chr $ shift + ord x)] ++ (cipher shift xs) | 70 | cipher shift (x:xs) =
[(chr $ shift + ord x)] ++ (cipher shift xs) | 70 | cipher shift (x:xs) =
[(chr $ shift + ord x)] ++ (cipher shift xs) | 70 | false | false | 0 | 9 | 17 | 48 | 24 | 24 | null | null |
mettekou/ghc | compiler/prelude/THNames.hs | bsd-3-clause | unboxedTupleTIdKey = mkPreludeMiscIdUnique 384 | 47 | unboxedTupleTIdKey = mkPreludeMiscIdUnique 384 | 47 | unboxedTupleTIdKey = mkPreludeMiscIdUnique 384 | 47 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
siddhanathan/ghc | testsuite/tests/determinism/determinism001.hs | bsd-3-clause | testSCC = flattenSCCs . stronglyConnCompFromEdgedVertices | 57 | testSCC = flattenSCCs . stronglyConnCompFromEdgedVertices | 57 | testSCC = flattenSCCs . stronglyConnCompFromEdgedVertices | 57 | false | false | 2 | 5 | 4 | 15 | 5 | 10 | null | null |
wouwouwou/2017_module_8 | src/haskell/PP-project-2016/lib/sprockell/Sprockell.hs | apache-2.0 | sendOut :: IOCode -> MemAddr -> Value -> Request
sendOut ioCode address value = case ioCode of
IONone -> NoRequest
IORead -> ReadReq address
IOWrite -> WriteReq value address
IOTest -> TestReq address | 245 | sendOut :: IOCode -> MemAddr -> Value -> Request
sendOut ioCode address value = case ioCode of
IONone -> NoRequest
IORead -> ReadReq address
IOWrite -> WriteReq value address
IOTest -> TestReq address | 245 | sendOut ioCode address value = case ioCode of
IONone -> NoRequest
IORead -> ReadReq address
IOWrite -> WriteReq value address
IOTest -> TestReq address | 196 | false | true | 4 | 7 | 77 | 77 | 34 | 43 | null | null |
markenwerk/haskell-geo-resolver | src/Network/Google/GeoResolver/Requester.hs | mit | baseURL :: Builder
baseURL = "https://maps.googleapis.com/maps/api/geocode/json" | 80 | baseURL :: Builder
baseURL = "https://maps.googleapis.com/maps/api/geocode/json" | 80 | baseURL = "https://maps.googleapis.com/maps/api/geocode/json" | 61 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
elliottt/llvm-threading | Test.hs | bsd-3-clause | timeAddBuildsDiff3 :: LibraryTime -> LibraryTime -> Property
timeAddBuildsDiff3 time1 time2 = monadicIO $ do
diff <- run $ do sum <- addTime' time1 time2
diffTime' sum time1
assert (diff == time2) | 219 | timeAddBuildsDiff3 :: LibraryTime -> LibraryTime -> Property
timeAddBuildsDiff3 time1 time2 = monadicIO $ do
diff <- run $ do sum <- addTime' time1 time2
diffTime' sum time1
assert (diff == time2) | 219 | timeAddBuildsDiff3 time1 time2 = monadicIO $ do
diff <- run $ do sum <- addTime' time1 time2
diffTime' sum time1
assert (diff == time2) | 158 | false | true | 0 | 14 | 53 | 77 | 34 | 43 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Vector.Primitive.hs | bsd-3-clause | last = G.last | 13 | last = G.last | 13 | last = G.last | 13 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
brendanhay/gogol | gogol-spanner/gen/Network/Google/Spanner/Types/Product.hs | mpl-2.0 | -- | The unique name of the scan, specific to the Database service
-- implementing this interface.
scaName :: Lens' Scan (Maybe Text)
scaName = lens _scaName (\ s a -> s{_scaName = a}) | 184 | scaName :: Lens' Scan (Maybe Text)
scaName = lens _scaName (\ s a -> s{_scaName = a}) | 85 | scaName = lens _scaName (\ s a -> s{_scaName = a}) | 50 | true | true | 2 | 9 | 33 | 56 | 26 | 30 | null | null |
Fuuzetsu/stack | src/Stack/Setup.hs | bsd-3-clause | removeHaskellEnvVars :: Map Text Text -> Map Text Text
removeHaskellEnvVars =
Map.delete "GHCJS_PACKAGE_PATH" .
Map.delete "GHC_PACKAGE_PATH" .
Map.delete "HASKELL_PACKAGE_SANDBOX" .
Map.delete "HASKELL_PACKAGE_SANDBOXES" .
Map.delete "HASKELL_DIST_DIR" .
-- https://github.com/commercialhaskell/stack/issues/1460
Map.delete "DESTDIR" | 362 | removeHaskellEnvVars :: Map Text Text -> Map Text Text
removeHaskellEnvVars =
Map.delete "GHCJS_PACKAGE_PATH" .
Map.delete "GHC_PACKAGE_PATH" .
Map.delete "HASKELL_PACKAGE_SANDBOX" .
Map.delete "HASKELL_PACKAGE_SANDBOXES" .
Map.delete "HASKELL_DIST_DIR" .
-- https://github.com/commercialhaskell/stack/issues/1460
Map.delete "DESTDIR" | 362 | removeHaskellEnvVars =
Map.delete "GHCJS_PACKAGE_PATH" .
Map.delete "GHC_PACKAGE_PATH" .
Map.delete "HASKELL_PACKAGE_SANDBOX" .
Map.delete "HASKELL_PACKAGE_SANDBOXES" .
Map.delete "HASKELL_DIST_DIR" .
-- https://github.com/commercialhaskell/stack/issues/1460
Map.delete "DESTDIR" | 307 | false | true | 0 | 11 | 57 | 76 | 35 | 41 | null | null |
unhammer/bytestring-trie-0.2.4 | src/Data/Trie/Internal.hs | bsd-3-clause | contextualMap' :: (a -> Trie a -> b) -> Trie a -> Trie b
contextualMap' f = go
where
go Empty = Empty
go (Arc k Nothing t) = Arc k Nothing (go t)
go (Arc k (Just v) t) = Arc k (Just $! f v t) (go t)
go (Branch p m l r) = Branch p m (go l) (go r)
-- | A contextual variant of 'filterMap'. | 333 | contextualMap' :: (a -> Trie a -> b) -> Trie a -> Trie b
contextualMap' f = go
where
go Empty = Empty
go (Arc k Nothing t) = Arc k Nothing (go t)
go (Arc k (Just v) t) = Arc k (Just $! f v t) (go t)
go (Branch p m l r) = Branch p m (go l) (go r)
-- | A contextual variant of 'filterMap'. | 333 | contextualMap' f = go
where
go Empty = Empty
go (Arc k Nothing t) = Arc k Nothing (go t)
go (Arc k (Just v) t) = Arc k (Just $! f v t) (go t)
go (Branch p m l r) = Branch p m (go l) (go r)
-- | A contextual variant of 'filterMap'. | 276 | false | true | 0 | 9 | 116 | 175 | 85 | 90 | null | null |
duplode/threepenny-gui | src/Graphics/UI/Threepenny/SVG/Attributes.hs | bsd-3-clause | kernelUnitLength = strAttr "kernelUnitLength" | 58 | kernelUnitLength = strAttr "kernelUnitLength" | 58 | kernelUnitLength = strAttr "kernelUnitLength" | 58 | false | false | 1 | 5 | 16 | 12 | 4 | 8 | null | null |
mgrabmueller/harpy | Harpy/X86Assembler.hs | bsd-3-clause | fld1 = ensureBufferSize x86_max_instruction_bytes >> x86_fld1 | 61 | fld1 = ensureBufferSize x86_max_instruction_bytes >> x86_fld1 | 61 | fld1 = ensureBufferSize x86_max_instruction_bytes >> x86_fld1 | 61 | false | false | 1 | 6 | 5 | 17 | 6 | 11 | null | null |
Some-T/Portfolio | HASKELL/Labs/H2/H2.hsproj/H2.hs | unlicense | double x = x + x | 19 | double x = x + x | 19 | double x = x + x | 19 | false | false | 3 | 5 | 8 | 18 | 6 | 12 | null | null |
waldheinz/mdb | src/lib/Mdb/Serve/Video.hs | apache-2.0 | variants :: (MonadMask m, MonadIO m) => FileId -> Authenticated m Response
variants = withFileAccess go where
vs :: [(Int, Int, Int)]
vs =
[ (540 , 2000 , 96)
, (270 , 400 , 64)
, (360 , 600 , 64)
, (360 , 1200 , 96)
, (720 , 3000 , 96)
, (720 , 4500 , 96)
, (1080 , 5500 , 128)
, (1080 , 7000 , 128)
]
gov (rv, bv, ba) = fromByteString $ encodeUtf8
$ "#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=" <> T.pack (show $ 1000 * (bv + ba)) <> "\n"
<> "hls?bv=" <> T.pack (show bv) <> "&ba=" <> T.pack (show ba) <> "&rv=" <> T.pack (show rv)
<> "\n"
start = fromByteString $ encodeUtf8 "#EXTM3U\n"
buildVariants = start <> mconcat (map gov vs)
go _ _ = return $ responseBuilder status200 [("Content-Type", "application/x-mpegURL")] buildVariants | 876 | variants :: (MonadMask m, MonadIO m) => FileId -> Authenticated m Response
variants = withFileAccess go where
vs :: [(Int, Int, Int)]
vs =
[ (540 , 2000 , 96)
, (270 , 400 , 64)
, (360 , 600 , 64)
, (360 , 1200 , 96)
, (720 , 3000 , 96)
, (720 , 4500 , 96)
, (1080 , 5500 , 128)
, (1080 , 7000 , 128)
]
gov (rv, bv, ba) = fromByteString $ encodeUtf8
$ "#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=" <> T.pack (show $ 1000 * (bv + ba)) <> "\n"
<> "hls?bv=" <> T.pack (show bv) <> "&ba=" <> T.pack (show ba) <> "&rv=" <> T.pack (show rv)
<> "\n"
start = fromByteString $ encodeUtf8 "#EXTM3U\n"
buildVariants = start <> mconcat (map gov vs)
go _ _ = return $ responseBuilder status200 [("Content-Type", "application/x-mpegURL")] buildVariants | 876 | variants = withFileAccess go where
vs :: [(Int, Int, Int)]
vs =
[ (540 , 2000 , 96)
, (270 , 400 , 64)
, (360 , 600 , 64)
, (360 , 1200 , 96)
, (720 , 3000 , 96)
, (720 , 4500 , 96)
, (1080 , 5500 , 128)
, (1080 , 7000 , 128)
]
gov (rv, bv, ba) = fromByteString $ encodeUtf8
$ "#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=" <> T.pack (show $ 1000 * (bv + ba)) <> "\n"
<> "hls?bv=" <> T.pack (show bv) <> "&ba=" <> T.pack (show ba) <> "&rv=" <> T.pack (show rv)
<> "\n"
start = fromByteString $ encodeUtf8 "#EXTM3U\n"
buildVariants = start <> mconcat (map gov vs)
go _ _ = return $ responseBuilder status200 [("Content-Type", "application/x-mpegURL")] buildVariants | 801 | false | true | 0 | 20 | 278 | 342 | 190 | 152 | null | null |
sdiehl/ghc | compiler/deSugar/DsArrows.hs | bsd-3-clause | matchSimplys (exp:exps) ctxt (pat:pats) result_expr fail_expr = do
match_code <- matchSimplys exps ctxt pats result_expr fail_expr
matchSimply exp ctxt pat match_code fail_expr | 184 | matchSimplys (exp:exps) ctxt (pat:pats) result_expr fail_expr = do
match_code <- matchSimplys exps ctxt pats result_expr fail_expr
matchSimply exp ctxt pat match_code fail_expr | 184 | matchSimplys (exp:exps) ctxt (pat:pats) result_expr fail_expr = do
match_code <- matchSimplys exps ctxt pats result_expr fail_expr
matchSimply exp ctxt pat match_code fail_expr | 184 | false | false | 0 | 8 | 29 | 65 | 30 | 35 | null | null |
shlevy/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | foldrIdKey = mkPreludeMiscIdUnique 6 | 56 | foldrIdKey = mkPreludeMiscIdUnique 6 | 56 | foldrIdKey = mkPreludeMiscIdUnique 6 | 56 | false | false | 0 | 5 | 23 | 9 | 4 | 5 | null | null |
Prillan/haskell-jsontools | app/jless/Program.hs | bsd-3-clause | moveRight :: Zipper a -> Zipper a
moveRight z@(Zipper _ _ []) = z | 69 | moveRight :: Zipper a -> Zipper a
moveRight z@(Zipper _ _ []) = z | 69 | moveRight z@(Zipper _ _ []) = z | 35 | false | true | 0 | 9 | 17 | 39 | 19 | 20 | null | null |
vincenthz/cryptonite | Crypto/PubKey/ECDSA.hs | bsd-3-clause | -- | Create a public key from a private key.
toPublic :: EllipticCurveECDSA curve
=> proxy curve -> PrivateKey curve -> PublicKey curve
toPublic = pointBaseSmul | 169 | toPublic :: EllipticCurveECDSA curve
=> proxy curve -> PrivateKey curve -> PublicKey curve
toPublic = pointBaseSmul | 124 | toPublic = pointBaseSmul | 24 | true | true | 0 | 8 | 34 | 36 | 17 | 19 | null | null |
HIPERFIT/futhark | src/Futhark/TypeCheck.hs | isc | checkFunParams ::
Checkable rep =>
[FParam rep] ->
TypeM rep ()
checkFunParams = mapM_ $ \param ->
context ("In function parameter " ++ pretty param) $
checkFParamDec (paramName param) (paramDec param) | 213 | checkFunParams ::
Checkable rep =>
[FParam rep] ->
TypeM rep ()
checkFunParams = mapM_ $ \param ->
context ("In function parameter " ++ pretty param) $
checkFParamDec (paramName param) (paramDec param) | 213 | checkFunParams = mapM_ $ \param ->
context ("In function parameter " ++ pretty param) $
checkFParamDec (paramName param) (paramDec param) | 143 | false | true | 2 | 9 | 42 | 85 | 39 | 46 | null | null |
ajnsit/monadbi | src/Control/Monad/Bi.hs | gpl-3.0 | collectN :: (MonadBi m IO) => Int -> m a -> (a -> m b) -> m [b]
collectN n m f = liftM (take n) (collect m f) | 109 | collectN :: (MonadBi m IO) => Int -> m a -> (a -> m b) -> m [b]
collectN n m f = liftM (take n) (collect m f) | 109 | collectN n m f = liftM (take n) (collect m f) | 45 | false | true | 0 | 11 | 28 | 79 | 39 | 40 | null | null |
rahulmutt/ghcvm | compiler/Eta/SimplCore/SimplUtils.hs | bsd-3-clause | preInlineUnconditionally :: DynFlags -> SimplEnv -> TopLevelFlag -> InId -> InExpr -> Bool
-- Precondition: rhs satisfies the let/app invariant
-- See Note [CoreSyn let/app invariant] in CoreSyn
-- Reason: we don't want to inline single uses, or discard dead bindings,
-- for unlifted, side-effect-full bindings
preInlineUnconditionally dflags env top_lvl bndr rhs
| not active = False
| isStableUnfolding (idUnfolding bndr) = False -- Note [Stable unfoldings and preInlineUnconditionally]
| isTopLevel top_lvl && isBottomingId bndr = False -- Note [Top-level bottoming Ids]
| not (gopt Opt_SimplPreInlining dflags) = False
| isCoVar bndr = False -- Note [Do not inline CoVars unconditionally]
| otherwise = case idOccInfo bndr of
IAmDead -> True -- Happens in ((\x.1) v)
OneOcc in_lam True int_cxt -> try_once in_lam int_cxt
_ -> False
where
mode = getMode env
active = isActive (sm_phase mode) act
-- See Note [pre/postInlineUnconditionally in gentle mode]
act = idInlineActivation bndr
try_once in_lam int_cxt -- There's one textual occurrence
| not in_lam = isNotTopLevel top_lvl || early_phase
| otherwise = int_cxt && canInlineInLam rhs
-- Be very careful before inlining inside a lambda, because (a) we must not
-- invalidate occurrence information, and (b) we want to avoid pushing a
-- single allocation (here) into multiple allocations (inside lambda).
-- Inlining a *function* with a single *saturated* call would be ok, mind you.
-- || (if is_cheap && not (canInlineInLam rhs) then pprTrace "preinline" (ppr bndr <+> ppr rhs) ok else ok)
-- where
-- is_cheap = exprIsCheap rhs
-- ok = is_cheap && int_cxt
-- int_cxt The context isn't totally boring
-- E.g. let f = \ab.BIG in \y. map f xs
-- Don't want to substitute for f, because then we allocate
-- its closure every time the \y is called
-- But: let f = \ab.BIG in \y. map (f y) xs
-- Now we do want to substitute for f, even though it's not
-- saturated, because we're going to allocate a closure for
-- (f y) every time round the loop anyhow.
-- canInlineInLam => free vars of rhs are (Once in_lam) or Many,
-- so substituting rhs inside a lambda doesn't change the occ info.
-- Sadly, not quite the same as exprIsHNF.
canInlineInLam (Lit _) = True
canInlineInLam (Lam b e) = isRuntimeVar b || canInlineInLam e
canInlineInLam (Tick t e) = not (tickishIsCode t) && canInlineInLam e
canInlineInLam _ = False
-- not ticks. Counting ticks cannot be duplicated, and non-counting
-- ticks around a Lam will disappear anyway.
early_phase = case sm_phase mode of
Phase 0 -> False
_ -> True
-- If we don't have this early_phase test, consider
-- x = length [1,2,3]
-- The full laziness pass carefully floats all the cons cells to
-- top level, and preInlineUnconditionally floats them all back in.
-- Result is (a) static allocation replaced by dynamic allocation
-- (b) many simplifier iterations because this tickles
-- a related problem; only one inlining per pass
--
-- On the other hand, I have seen cases where top-level fusion is
-- lost if we don't inline top level thing (e.g. string constants)
-- Hence the test for phase zero (which is the phase for all the final
-- simplifications). Until phase zero we take no special notice of
-- top level things, but then we become more leery about inlining
-- them.
{-
************************************************************************
* *
postInlineUnconditionally
* *
************************************************************************
postInlineUnconditionally
~~~~~~~~~~~~~~~~~~~~~~~~~
@postInlineUnconditionally@ decides whether to unconditionally inline
a thing based on the form of its RHS; in particular if it has a
trivial RHS. If so, we can inline and discard the binding altogether.
NB: a loop breaker has must_keep_binding = True and non-loop-breakers
only have *forward* references. Hence, it's safe to discard the binding
NOTE: This isn't our last opportunity to inline. We're at the binding
site right now, and we'll get another opportunity when we get to the
ocurrence(s)
Note that we do this unconditional inlining only for trival RHSs.
Don't inline even WHNFs inside lambdas; doing so may simply increase
allocation when the function is called. This isn't the last chance; see
NOTE above.
NB: Even inline pragmas (e.g. IMustBeINLINEd) are ignored here Why?
Because we don't even want to inline them into the RHS of constructor
arguments. See NOTE above
NB: At one time even NOINLINE was ignored here: if the rhs is trivial
it's best to inline it anyway. We often get a=E; b=a from desugaring,
with both a and b marked NOINLINE. But that seems incompatible with
our new view that inlining is like a RULE, so I'm sticking to the 'active'
story for now.
-} | 5,381 | preInlineUnconditionally :: DynFlags -> SimplEnv -> TopLevelFlag -> InId -> InExpr -> Bool
preInlineUnconditionally dflags env top_lvl bndr rhs
| not active = False
| isStableUnfolding (idUnfolding bndr) = False -- Note [Stable unfoldings and preInlineUnconditionally]
| isTopLevel top_lvl && isBottomingId bndr = False -- Note [Top-level bottoming Ids]
| not (gopt Opt_SimplPreInlining dflags) = False
| isCoVar bndr = False -- Note [Do not inline CoVars unconditionally]
| otherwise = case idOccInfo bndr of
IAmDead -> True -- Happens in ((\x.1) v)
OneOcc in_lam True int_cxt -> try_once in_lam int_cxt
_ -> False
where
mode = getMode env
active = isActive (sm_phase mode) act
-- See Note [pre/postInlineUnconditionally in gentle mode]
act = idInlineActivation bndr
try_once in_lam int_cxt -- There's one textual occurrence
| not in_lam = isNotTopLevel top_lvl || early_phase
| otherwise = int_cxt && canInlineInLam rhs
-- Be very careful before inlining inside a lambda, because (a) we must not
-- invalidate occurrence information, and (b) we want to avoid pushing a
-- single allocation (here) into multiple allocations (inside lambda).
-- Inlining a *function* with a single *saturated* call would be ok, mind you.
-- || (if is_cheap && not (canInlineInLam rhs) then pprTrace "preinline" (ppr bndr <+> ppr rhs) ok else ok)
-- where
-- is_cheap = exprIsCheap rhs
-- ok = is_cheap && int_cxt
-- int_cxt The context isn't totally boring
-- E.g. let f = \ab.BIG in \y. map f xs
-- Don't want to substitute for f, because then we allocate
-- its closure every time the \y is called
-- But: let f = \ab.BIG in \y. map (f y) xs
-- Now we do want to substitute for f, even though it's not
-- saturated, because we're going to allocate a closure for
-- (f y) every time round the loop anyhow.
-- canInlineInLam => free vars of rhs are (Once in_lam) or Many,
-- so substituting rhs inside a lambda doesn't change the occ info.
-- Sadly, not quite the same as exprIsHNF.
canInlineInLam (Lit _) = True
canInlineInLam (Lam b e) = isRuntimeVar b || canInlineInLam e
canInlineInLam (Tick t e) = not (tickishIsCode t) && canInlineInLam e
canInlineInLam _ = False
-- not ticks. Counting ticks cannot be duplicated, and non-counting
-- ticks around a Lam will disappear anyway.
early_phase = case sm_phase mode of
Phase 0 -> False
_ -> True
-- If we don't have this early_phase test, consider
-- x = length [1,2,3]
-- The full laziness pass carefully floats all the cons cells to
-- top level, and preInlineUnconditionally floats them all back in.
-- Result is (a) static allocation replaced by dynamic allocation
-- (b) many simplifier iterations because this tickles
-- a related problem; only one inlining per pass
--
-- On the other hand, I have seen cases where top-level fusion is
-- lost if we don't inline top level thing (e.g. string constants)
-- Hence the test for phase zero (which is the phase for all the final
-- simplifications). Until phase zero we take no special notice of
-- top level things, but then we become more leery about inlining
-- them.
{-
************************************************************************
* *
postInlineUnconditionally
* *
************************************************************************
postInlineUnconditionally
~~~~~~~~~~~~~~~~~~~~~~~~~
@postInlineUnconditionally@ decides whether to unconditionally inline
a thing based on the form of its RHS; in particular if it has a
trivial RHS. If so, we can inline and discard the binding altogether.
NB: a loop breaker has must_keep_binding = True and non-loop-breakers
only have *forward* references. Hence, it's safe to discard the binding
NOTE: This isn't our last opportunity to inline. We're at the binding
site right now, and we'll get another opportunity when we get to the
ocurrence(s)
Note that we do this unconditional inlining only for trival RHSs.
Don't inline even WHNFs inside lambdas; doing so may simply increase
allocation when the function is called. This isn't the last chance; see
NOTE above.
NB: Even inline pragmas (e.g. IMustBeINLINEd) are ignored here Why?
Because we don't even want to inline them into the RHS of constructor
arguments. See NOTE above
NB: At one time even NOINLINE was ignored here: if the rhs is trivial
it's best to inline it anyway. We often get a=E; b=a from desugaring,
with both a and b marked NOINLINE. But that seems incompatible with
our new view that inlining is like a RULE, so I'm sticking to the 'active'
story for now.
-} | 5,152 | preInlineUnconditionally dflags env top_lvl bndr rhs
| not active = False
| isStableUnfolding (idUnfolding bndr) = False -- Note [Stable unfoldings and preInlineUnconditionally]
| isTopLevel top_lvl && isBottomingId bndr = False -- Note [Top-level bottoming Ids]
| not (gopt Opt_SimplPreInlining dflags) = False
| isCoVar bndr = False -- Note [Do not inline CoVars unconditionally]
| otherwise = case idOccInfo bndr of
IAmDead -> True -- Happens in ((\x.1) v)
OneOcc in_lam True int_cxt -> try_once in_lam int_cxt
_ -> False
where
mode = getMode env
active = isActive (sm_phase mode) act
-- See Note [pre/postInlineUnconditionally in gentle mode]
act = idInlineActivation bndr
try_once in_lam int_cxt -- There's one textual occurrence
| not in_lam = isNotTopLevel top_lvl || early_phase
| otherwise = int_cxt && canInlineInLam rhs
-- Be very careful before inlining inside a lambda, because (a) we must not
-- invalidate occurrence information, and (b) we want to avoid pushing a
-- single allocation (here) into multiple allocations (inside lambda).
-- Inlining a *function* with a single *saturated* call would be ok, mind you.
-- || (if is_cheap && not (canInlineInLam rhs) then pprTrace "preinline" (ppr bndr <+> ppr rhs) ok else ok)
-- where
-- is_cheap = exprIsCheap rhs
-- ok = is_cheap && int_cxt
-- int_cxt The context isn't totally boring
-- E.g. let f = \ab.BIG in \y. map f xs
-- Don't want to substitute for f, because then we allocate
-- its closure every time the \y is called
-- But: let f = \ab.BIG in \y. map (f y) xs
-- Now we do want to substitute for f, even though it's not
-- saturated, because we're going to allocate a closure for
-- (f y) every time round the loop anyhow.
-- canInlineInLam => free vars of rhs are (Once in_lam) or Many,
-- so substituting rhs inside a lambda doesn't change the occ info.
-- Sadly, not quite the same as exprIsHNF.
canInlineInLam (Lit _) = True
canInlineInLam (Lam b e) = isRuntimeVar b || canInlineInLam e
canInlineInLam (Tick t e) = not (tickishIsCode t) && canInlineInLam e
canInlineInLam _ = False
-- not ticks. Counting ticks cannot be duplicated, and non-counting
-- ticks around a Lam will disappear anyway.
early_phase = case sm_phase mode of
Phase 0 -> False
_ -> True
-- If we don't have this early_phase test, consider
-- x = length [1,2,3]
-- The full laziness pass carefully floats all the cons cells to
-- top level, and preInlineUnconditionally floats them all back in.
-- Result is (a) static allocation replaced by dynamic allocation
-- (b) many simplifier iterations because this tickles
-- a related problem; only one inlining per pass
--
-- On the other hand, I have seen cases where top-level fusion is
-- lost if we don't inline top level thing (e.g. string constants)
-- Hence the test for phase zero (which is the phase for all the final
-- simplifications). Until phase zero we take no special notice of
-- top level things, but then we become more leery about inlining
-- them.
{-
************************************************************************
* *
postInlineUnconditionally
* *
************************************************************************
postInlineUnconditionally
~~~~~~~~~~~~~~~~~~~~~~~~~
@postInlineUnconditionally@ decides whether to unconditionally inline
a thing based on the form of its RHS; in particular if it has a
trivial RHS. If so, we can inline and discard the binding altogether.
NB: a loop breaker has must_keep_binding = True and non-loop-breakers
only have *forward* references. Hence, it's safe to discard the binding
NOTE: This isn't our last opportunity to inline. We're at the binding
site right now, and we'll get another opportunity when we get to the
ocurrence(s)
Note that we do this unconditional inlining only for trival RHSs.
Don't inline even WHNFs inside lambdas; doing so may simply increase
allocation when the function is called. This isn't the last chance; see
NOTE above.
NB: Even inline pragmas (e.g. IMustBeINLINEd) are ignored here Why?
Because we don't even want to inline them into the RHS of constructor
arguments. See NOTE above
NB: At one time even NOINLINE was ignored here: if the rhs is trivial
it's best to inline it anyway. We often get a=E; b=a from desugaring,
with both a and b marked NOINLINE. But that seems incompatible with
our new view that inlining is like a RULE, so I'm sticking to the 'active'
story for now.
-} | 5,061 | true | true | 5 | 10 | 1,456 | 420 | 212 | 208 | null | null |
Bugfry/exercism | exercism/haskell/matrix/src/Matrix.hs | mit | fromString :: Read a => String -> Matrix a
fromString = fromList . map parse . lines
where
parse s = case reads s of
(item, rest) : _ -> item : parse rest
[] -> [] | 181 | fromString :: Read a => String -> Matrix a
fromString = fromList . map parse . lines
where
parse s = case reads s of
(item, rest) : _ -> item : parse rest
[] -> [] | 181 | fromString = fromList . map parse . lines
where
parse s = case reads s of
(item, rest) : _ -> item : parse rest
[] -> [] | 138 | false | true | 0 | 9 | 54 | 87 | 42 | 45 | null | null |
zachsully/hakaru | haskell/Language/Hakaru/Pretty/Concrete.hs | bsd-3-clause | ppPrimOp p Sin (e1 :* End) = ppApply1 p "sin" e1 | 65 | ppPrimOp p Sin (e1 :* End) = ppApply1 p "sin" e1 | 65 | ppPrimOp p Sin (e1 :* End) = ppApply1 p "sin" e1 | 65 | false | false | 0 | 7 | 27 | 30 | 13 | 17 | null | null |
nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles | Testing/ciphers/src/VigenereCipher.hs | gpl-3.0 | encrypt p k = crypt encFunc p (cycle k) | 39 | encrypt p k = crypt encFunc p (cycle k) | 39 | encrypt p k = crypt encFunc p (cycle k) | 39 | false | false | 0 | 7 | 8 | 24 | 11 | 13 | null | null |
remyoudompheng/hs-language-go | Language/Go/Pretty.hs | gpl-3.0 | quote s = char '"' <> text s <> char '"' | 40 | quote s = char '"' <> text s <> char '"' | 40 | quote s = char '"' <> text s <> char '"' | 40 | false | false | 0 | 7 | 10 | 26 | 11 | 15 | null | null |
pepeiborra/yices-0.0.0.12 | Main.hs | bsd-3-clause | -- import Random
yicesPath = "/home/kyagrd/yices/bin/yices" | 60 | yicesPath = "/home/kyagrd/yices/bin/yices" | 42 | yicesPath = "/home/kyagrd/yices/bin/yices" | 42 | true | false | 0 | 4 | 6 | 7 | 4 | 3 | null | null |
edwardwas/adventOfCodeTwo | src/Problem01.hs | mit | finalPosition :: [Move] -> (Compass,Position)
finalPosition = foldl (uncurry applyMove) (North, Position 0 0) | 109 | finalPosition :: [Move] -> (Compass,Position)
finalPosition = foldl (uncurry applyMove) (North, Position 0 0) | 109 | finalPosition = foldl (uncurry applyMove) (North, Position 0 0) | 63 | false | true | 0 | 8 | 13 | 52 | 26 | 26 | null | null |
ml9951/ghc | compiler/deSugar/DsBinds.hs | bsd-3-clause | sccEvBinds :: Bag EvBind -> [SCC EvBind]
sccEvBinds bs = stronglyConnCompFromEdgedVertices edges
where
edges :: [(EvBind, EvVar, [EvVar])]
edges = foldrBag ((:) . mk_node) [] bs
mk_node :: EvBind -> (EvBind, EvVar, [EvVar])
mk_node b@(EvBind { eb_lhs = var, eb_rhs = term })
= (b, var, varSetElems (evVarsOfTerm term))
--------------------------------------- | 386 | sccEvBinds :: Bag EvBind -> [SCC EvBind]
sccEvBinds bs = stronglyConnCompFromEdgedVertices edges
where
edges :: [(EvBind, EvVar, [EvVar])]
edges = foldrBag ((:) . mk_node) [] bs
mk_node :: EvBind -> (EvBind, EvVar, [EvVar])
mk_node b@(EvBind { eb_lhs = var, eb_rhs = term })
= (b, var, varSetElems (evVarsOfTerm term))
--------------------------------------- | 386 | sccEvBinds bs = stronglyConnCompFromEdgedVertices edges
where
edges :: [(EvBind, EvVar, [EvVar])]
edges = foldrBag ((:) . mk_node) [] bs
mk_node :: EvBind -> (EvBind, EvVar, [EvVar])
mk_node b@(EvBind { eb_lhs = var, eb_rhs = term })
= (b, var, varSetElems (evVarsOfTerm term))
--------------------------------------- | 345 | false | true | 0 | 10 | 77 | 145 | 82 | 63 | null | null |
databrary/databrary | src/Data/Csv/Contrib.hs | agpl-3.0 | -- | some programs introduce a byte order mark when generating a CSV, remove this per cassava issue recipe
removeBomPrefixText :: TL.Text -> TL.Text
removeBomPrefixText contents =
case TL.uncons contents of
Just ('\65279', rs) -> rs
_ -> contents
-- | fix duplicate line endings, unclear if SPSS or Excel introduces them | 341 | removeBomPrefixText :: TL.Text -> TL.Text
removeBomPrefixText contents =
case TL.uncons contents of
Just ('\65279', rs) -> rs
_ -> contents
-- | fix duplicate line endings, unclear if SPSS or Excel introduces them | 234 | removeBomPrefixText contents =
case TL.uncons contents of
Just ('\65279', rs) -> rs
_ -> contents
-- | fix duplicate line endings, unclear if SPSS or Excel introduces them | 192 | true | true | 0 | 9 | 72 | 54 | 28 | 26 | null | null |
Th30n/hasgel | app/Main.hs | mit | displayStats :: (MonadBaseControl IO m, MonadState World m) => m ()
displayStats = do
ft <- gets worldFrameTimer
let cpuAvg = FT.getCPUAvg ft
cpuMax = FT.getCPUMax ft
gpuTime = FT.getGPUMax ft
cpuStats s = printf "CPU: %.2fms %.2fFPS (%s)" s (1e3 / s)
gpuStats = printf "GPU: %.2fms %.2fFPS (max)" gpuTime (1e3 / gpuTime)
scrDim <- gets $ fmap fromIntegral . cfgResolution . worldConfiguration
let x = scrDim ^. L._x * 0.7
y = scrDim ^. L._y * 0.92
drawString = renderString scrDim
drawString x y $ cpuStats cpuAvg "avg."
drawString x (y + 16) $ cpuStats cpuMax "max"
drawString x (y + 32) gpuStats
-- | Reset the frame timer every 'timerInterval'. | 699 | displayStats :: (MonadBaseControl IO m, MonadState World m) => m ()
displayStats = do
ft <- gets worldFrameTimer
let cpuAvg = FT.getCPUAvg ft
cpuMax = FT.getCPUMax ft
gpuTime = FT.getGPUMax ft
cpuStats s = printf "CPU: %.2fms %.2fFPS (%s)" s (1e3 / s)
gpuStats = printf "GPU: %.2fms %.2fFPS (max)" gpuTime (1e3 / gpuTime)
scrDim <- gets $ fmap fromIntegral . cfgResolution . worldConfiguration
let x = scrDim ^. L._x * 0.7
y = scrDim ^. L._y * 0.92
drawString = renderString scrDim
drawString x y $ cpuStats cpuAvg "avg."
drawString x (y + 16) $ cpuStats cpuMax "max"
drawString x (y + 32) gpuStats
-- | Reset the frame timer every 'timerInterval'. | 699 | displayStats = do
ft <- gets worldFrameTimer
let cpuAvg = FT.getCPUAvg ft
cpuMax = FT.getCPUMax ft
gpuTime = FT.getGPUMax ft
cpuStats s = printf "CPU: %.2fms %.2fFPS (%s)" s (1e3 / s)
gpuStats = printf "GPU: %.2fms %.2fFPS (max)" gpuTime (1e3 / gpuTime)
scrDim <- gets $ fmap fromIntegral . cfgResolution . worldConfiguration
let x = scrDim ^. L._x * 0.7
y = scrDim ^. L._y * 0.92
drawString = renderString scrDim
drawString x y $ cpuStats cpuAvg "avg."
drawString x (y + 16) $ cpuStats cpuMax "max"
drawString x (y + 32) gpuStats
-- | Reset the frame timer every 'timerInterval'. | 631 | false | true | 0 | 12 | 163 | 243 | 117 | 126 | null | null |
DanielSchuessler/th-build | gen-wrappers.hs | bsd-3-clause | arity _ = 0 | 11 | arity _ = 0 | 11 | arity _ = 0 | 11 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
dsmccain/autotweet-hs | Twitter/Action.hs | mit | twitterPOSTreq :: (FromJSON a, MonadThrow m, MonadIO m, MonadBaseControl IO m) =>
String -> [(ByteString, ByteString)] ->
ReaderT Credential m (Either String a)
twitterPOSTreq req postData = do
credential <- ask
request <- parseUrl $ baseUri ++ req
-- Change the request method to POST if postData is not empty
let request' = if null postData
then request
else urlEncodedBody postData request
response <- withManager $ \m -> do
-- OAuth authentication
signedRequest <- signOAuth myOAuth credential request'
-- Send request
httpLbs signedRequest m
return $ eitherDecode $ responseBody response | 722 | twitterPOSTreq :: (FromJSON a, MonadThrow m, MonadIO m, MonadBaseControl IO m) =>
String -> [(ByteString, ByteString)] ->
ReaderT Credential m (Either String a)
twitterPOSTreq req postData = do
credential <- ask
request <- parseUrl $ baseUri ++ req
-- Change the request method to POST if postData is not empty
let request' = if null postData
then request
else urlEncodedBody postData request
response <- withManager $ \m -> do
-- OAuth authentication
signedRequest <- signOAuth myOAuth credential request'
-- Send request
httpLbs signedRequest m
return $ eitherDecode $ responseBody response | 722 | twitterPOSTreq req postData = do
credential <- ask
request <- parseUrl $ baseUri ++ req
-- Change the request method to POST if postData is not empty
let request' = if null postData
then request
else urlEncodedBody postData request
response <- withManager $ \m -> do
-- OAuth authentication
signedRequest <- signOAuth myOAuth credential request'
-- Send request
httpLbs signedRequest m
return $ eitherDecode $ responseBody response | 525 | false | true | 0 | 13 | 219 | 179 | 88 | 91 | null | null |
armoredsoftware/protocol | demos/demo2/Demo2Shared.hs | bsd-3-clause | --This is where we will need to convert measurement type to ByteString
-- if it is something else. see comment below
ePack' :: Evidence -> ByteString
ePack' = foldr f empty
where f (M0 x) y = x `append` y -- (i.e. (toByteString x) `append` y )
f (M1 x) y = x `append` y
f (M2 x) y = x `append` y | 316 | ePack' :: Evidence -> ByteString
ePack' = foldr f empty
where f (M0 x) y = x `append` y -- (i.e. (toByteString x) `append` y )
f (M1 x) y = x `append` y
f (M2 x) y = x `append` y | 198 | ePack' = foldr f empty
where f (M0 x) y = x `append` y -- (i.e. (toByteString x) `append` y )
f (M1 x) y = x `append` y
f (M2 x) y = x `append` y | 165 | true | true | 3 | 7 | 83 | 120 | 54 | 66 | null | null |
uduki/hsQt | Qtc/Enums/Gui/QPainter.hs | bsd-2-clause | eCompositionMode_DestinationAtop :: CompositionMode
eCompositionMode_DestinationAtop
= ieCompositionMode $ 10 | 111 | eCompositionMode_DestinationAtop :: CompositionMode
eCompositionMode_DestinationAtop
= ieCompositionMode $ 10 | 111 | eCompositionMode_DestinationAtop
= ieCompositionMode $ 10 | 59 | false | true | 0 | 6 | 9 | 18 | 8 | 10 | null | null |
mimi1vx/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkTrapQuotes3 = verify checkTrapQuotes "trap \"echo $((1+num))\" EXIT DEBUG" | 84 | prop_checkTrapQuotes3 = verify checkTrapQuotes "trap \"echo $((1+num))\" EXIT DEBUG" | 84 | prop_checkTrapQuotes3 = verify checkTrapQuotes "trap \"echo $((1+num))\" EXIT DEBUG" | 84 | false | false | 1 | 5 | 8 | 15 | 5 | 10 | null | null |
AbleNetInc/EqualsAssessment | src/EqCommon.hs | gpl-3.0 | exLesson :: Lesson -> [(Int, Cell)]
exLesson l@(Lesson c s o n _ _ _)
= [(1, sc $ CellText id')
,(2, sc . CellText $ snd n)
,(3, sc . CellDouble $ adaptedScore l)
] where id' = Text.pack $ intercalate "." [show c,[s],show o]
sc = Cell Nothing . Just | 301 | exLesson :: Lesson -> [(Int, Cell)]
exLesson l@(Lesson c s o n _ _ _)
= [(1, sc $ CellText id')
,(2, sc . CellText $ snd n)
,(3, sc . CellDouble $ adaptedScore l)
] where id' = Text.pack $ intercalate "." [show c,[s],show o]
sc = Cell Nothing . Just | 301 | exLesson l@(Lesson c s o n _ _ _)
= [(1, sc $ CellText id')
,(2, sc . CellText $ snd n)
,(3, sc . CellDouble $ adaptedScore l)
] where id' = Text.pack $ intercalate "." [show c,[s],show o]
sc = Cell Nothing . Just | 265 | false | true | 0 | 10 | 103 | 152 | 82 | 70 | null | null |
forste/haReFork | tools/interp/examples.hs | bsd-3-clause | x4 = case undefined of (Red x) -> 99 ---> undefined
-----------------------------------------------------------
-- some examples
-----------------------------------------------------------
| 214 | ex4 = case undefined of (Red x) -> 99 ---> undefined
-----------------------------------------------------------
-- some examples
----------------------------------------------------------- | 214 | ex4 = case undefined of (Red x) -> 99 ---> undefined
-----------------------------------------------------------
-- some examples
----------------------------------------------------------- | 214 | false | false | 1 | 9 | 41 | 32 | 16 | 16 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 120 = 2467 | 30 | getValueFromProduct 120 = 2467 | 30 | getValueFromProduct 120 = 2467 | 30 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
elliottt/huff | src/Huff/Compile/AST.hs | bsd-3-clause | mkEAnd :: [Effect] -> Effect
mkEAnd [e] = e | 43 | mkEAnd :: [Effect] -> Effect
mkEAnd [e] = e | 43 | mkEAnd [e] = e | 14 | false | true | 0 | 8 | 8 | 30 | 14 | 16 | null | null |
Saeron/haskell | data.structures/haskell/DataStructures/Set/SetAxioms.hs | apache-2.0 | -- only elements previously inserted are included in set
ax6 x y s = True ==> isElem y (insert x s) == (x==y) || isElem y s | 124 | ax6 x y s = True ==> isElem y (insert x s) == (x==y) || isElem y s | 66 | ax6 x y s = True ==> isElem y (insert x s) == (x==y) || isElem y s | 66 | true | false | 4 | 9 | 27 | 60 | 26 | 34 | null | null |
DaMSL/K3 | src/Language/K3/Codegen/Common.hs | apache-2.0 | {- Annotation identifiers. -}
annotationComboId :: [Identifier] -> Identifier
annotationComboId = ('_':) . intercalate "_" . sort | 130 | annotationComboId :: [Identifier] -> Identifier
annotationComboId = ('_':) . intercalate "_" . sort | 99 | annotationComboId = ('_':) . intercalate "_" . sort | 51 | true | true | 0 | 7 | 17 | 34 | 19 | 15 | null | null |
hguenther/smtlib2 | examples/Z3Tutorial.hs | gpl-3.0 | example13 :: Backend b => SMT b CheckSatResult
example13 = do
let w = bw (Proxy::Proxy 4)
isPowerOfTwo <- defineFunNamed "isPowerOfTwo" (bitvec w ::: Nil) $
\(x ::: Nil) -> cbv 0 w .==. bvand x (bvsub x (cbv 1 w))
a <- declareVarNamed (bitvec w) "a"
args <- sequence [ a .==. cbv n w | n <- [0,1,2,4,8]]
assert $ not' (fun isPowerOfTwo (a .:. nil) .==. or' args)
checkSat | 401 | example13 :: Backend b => SMT b CheckSatResult
example13 = do
let w = bw (Proxy::Proxy 4)
isPowerOfTwo <- defineFunNamed "isPowerOfTwo" (bitvec w ::: Nil) $
\(x ::: Nil) -> cbv 0 w .==. bvand x (bvsub x (cbv 1 w))
a <- declareVarNamed (bitvec w) "a"
args <- sequence [ a .==. cbv n w | n <- [0,1,2,4,8]]
assert $ not' (fun isPowerOfTwo (a .:. nil) .==. or' args)
checkSat | 401 | example13 = do
let w = bw (Proxy::Proxy 4)
isPowerOfTwo <- defineFunNamed "isPowerOfTwo" (bitvec w ::: Nil) $
\(x ::: Nil) -> cbv 0 w .==. bvand x (bvsub x (cbv 1 w))
a <- declareVarNamed (bitvec w) "a"
args <- sequence [ a .==. cbv n w | n <- [0,1,2,4,8]]
assert $ not' (fun isPowerOfTwo (a .:. nil) .==. or' args)
checkSat | 354 | false | true | 0 | 15 | 101 | 216 | 103 | 113 | null | null |
gleachkr/Carnap | Carnap/src/Carnap/Core/ModelChecking/ModelFinder.hs | gpl-3.0 | evalTerm model (MCross a b) = Set [(a, b) | a <- as, b <- bs]
where (Set as) = evalTerm model a
(Set bs) = evalTerm model b | 139 | evalTerm model (MCross a b) = Set [(a, b) | a <- as, b <- bs]
where (Set as) = evalTerm model a
(Set bs) = evalTerm model b | 139 | evalTerm model (MCross a b) = Set [(a, b) | a <- as, b <- bs]
where (Set as) = evalTerm model a
(Set bs) = evalTerm model b | 139 | false | false | 0 | 8 | 44 | 83 | 41 | 42 | null | null |
mathhun/stack | src/Stack/Build/Installed.hs | bsd-3-clause | toPackageLocation :: Maybe InstalledPackageLocation -> InstallLocation
toPackageLocation Nothing = Snap | 103 | toPackageLocation :: Maybe InstalledPackageLocation -> InstallLocation
toPackageLocation Nothing = Snap | 103 | toPackageLocation Nothing = Snap | 32 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
shockkolate/arata | src/ListBinding.hs | apache-2.0 | (>>:) :: Monad m => m a -> [a -> m b] -> m [b]
left >>: right = do
b <- left
mapM (\f -> f b) right | 107 | (>>:) :: Monad m => m a -> [a -> m b] -> m [b]
left >>: right = do
b <- left
mapM (\f -> f b) right | 107 | left >>: right = do
b <- left
mapM (\f -> f b) right | 60 | false | true | 0 | 10 | 36 | 79 | 38 | 41 | null | null |
arianvp/binary-serialise-cbor | tests/Tests/Serialise.hs | bsd-3-clause | prop_validFlatTerm :: (Serialise a, Eq a, Show a) => T a -> a -> Bool
prop_validFlatTerm _ = validFlatTerm . toFlatTerm . encode | 128 | prop_validFlatTerm :: (Serialise a, Eq a, Show a) => T a -> a -> Bool
prop_validFlatTerm _ = validFlatTerm . toFlatTerm . encode | 128 | prop_validFlatTerm _ = validFlatTerm . toFlatTerm . encode | 58 | false | true | 0 | 7 | 22 | 54 | 27 | 27 | null | null |
nikita-volkov/laika | demo/Main.hs | mit | main =
C.putStrLn (A.html doc) | 32 | main =
C.putStrLn (A.html doc) | 32 | main =
C.putStrLn (A.html doc) | 32 | false | false | 0 | 8 | 6 | 19 | 9 | 10 | null | null |
rueshyna/gogol | gogol-slides/gen/Network/Google/Slides/Types/Product.hs | mpl-2.0 | -- | A user-supplied object ID. If specified, the ID must be unique among all
-- pages and page elements in the presentation. The ID should start with a
-- word character [a-zA-Z0-9_] and then followed by any number of the
-- following characters [a-zA-Z0-9_-:]. The length of the ID should not be
-- less than 5 or greater than 50. If empty, a unique identifier will be
-- generated.
cscrObjectId :: Lens' CreateSheetsChartRequest (Maybe Text)
cscrObjectId
= lens _cscrObjectId (\ s a -> s{_cscrObjectId = a}) | 512 | cscrObjectId :: Lens' CreateSheetsChartRequest (Maybe Text)
cscrObjectId
= lens _cscrObjectId (\ s a -> s{_cscrObjectId = a}) | 127 | cscrObjectId
= lens _cscrObjectId (\ s a -> s{_cscrObjectId = a}) | 67 | true | true | 0 | 9 | 88 | 53 | 30 | 23 | null | null |
acowley/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | dataClassKey = mkPreludeClassUnique 9 | 48 | dataClassKey = mkPreludeClassUnique 9 | 48 | dataClassKey = mkPreludeClassUnique 9 | 48 | false | false | 0 | 5 | 14 | 9 | 4 | 5 | null | null |
rueshyna/gogol | gogol-doubleclick-search/gen/Network/Google/DoubleClickSearch/Types/Product.hs | mpl-2.0 | -- | The platform that is used to provide data for the custom dimension.
-- Acceptable values are \"floodlight\".
racsPlatformSource :: Lens' ReportAPIColumnSpec (Maybe Text)
racsPlatformSource
= lens _racsPlatformSource
(\ s a -> s{_racsPlatformSource = a}) | 266 | racsPlatformSource :: Lens' ReportAPIColumnSpec (Maybe Text)
racsPlatformSource
= lens _racsPlatformSource
(\ s a -> s{_racsPlatformSource = a}) | 152 | racsPlatformSource
= lens _racsPlatformSource
(\ s a -> s{_racsPlatformSource = a}) | 91 | true | true | 1 | 9 | 43 | 52 | 26 | 26 | null | null |
sjakobi/stack | src/Stack/Setup.hs | bsd-3-clause | expectSingleUnpackedDir :: (MonadIO m, MonadThrow m) => Path Abs File -> Path Abs Dir -> m (Path Abs Dir)
expectSingleUnpackedDir archiveFile destDir = do
contents <- listDir destDir
case contents of
([dir], []) -> return dir
_ -> error $ "Expected a single directory within unpacked " ++ toFilePath archiveFile
-- | Download 7z as necessary, and get a function for unpacking things.
--
-- Returned function takes an unpack directory and archive. | 471 | expectSingleUnpackedDir :: (MonadIO m, MonadThrow m) => Path Abs File -> Path Abs Dir -> m (Path Abs Dir)
expectSingleUnpackedDir archiveFile destDir = do
contents <- listDir destDir
case contents of
([dir], []) -> return dir
_ -> error $ "Expected a single directory within unpacked " ++ toFilePath archiveFile
-- | Download 7z as necessary, and get a function for unpacking things.
--
-- Returned function takes an unpack directory and archive. | 471 | expectSingleUnpackedDir archiveFile destDir = do
contents <- listDir destDir
case contents of
([dir], []) -> return dir
_ -> error $ "Expected a single directory within unpacked " ++ toFilePath archiveFile
-- | Download 7z as necessary, and get a function for unpacking things.
--
-- Returned function takes an unpack directory and archive. | 365 | false | true | 0 | 11 | 97 | 117 | 58 | 59 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2018/M02/D21/Exercise.hs | mit | -- random numbers provided by random.org
mklistolists :: [Int] -> [a] -> [[a]]
mklistolists lens nums = undefined | 114 | mklistolists :: [Int] -> [a] -> [[a]]
mklistolists lens nums = undefined | 72 | mklistolists lens nums = undefined | 34 | true | true | 0 | 8 | 18 | 37 | 21 | 16 | null | null |
siddhanathan/yi | yi-keymap-vim/src/Yi/Keymap/Vim.hs | gpl-2.0 | keymapSet :: KeymapSet
keymapSet = mkKeymapSet defVimConfig | 59 | keymapSet :: KeymapSet
keymapSet = mkKeymapSet defVimConfig | 59 | keymapSet = mkKeymapSet defVimConfig | 36 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
mettekou/ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | addTickHsValBinds :: HsValBindsLR Id a -> TM (HsValBindsLR Id b)
addTickHsValBinds (ValBindsOut binds sigs) =
liftM2 ValBindsOut
(mapM (\ (rec,binds') ->
liftM2 (,)
(return rec)
(addTickLHsBinds binds'))
binds)
(return sigs) | 400 | addTickHsValBinds :: HsValBindsLR Id a -> TM (HsValBindsLR Id b)
addTickHsValBinds (ValBindsOut binds sigs) =
liftM2 ValBindsOut
(mapM (\ (rec,binds') ->
liftM2 (,)
(return rec)
(addTickLHsBinds binds'))
binds)
(return sigs) | 400 | addTickHsValBinds (ValBindsOut binds sigs) =
liftM2 ValBindsOut
(mapM (\ (rec,binds') ->
liftM2 (,)
(return rec)
(addTickLHsBinds binds'))
binds)
(return sigs) | 335 | false | true | 0 | 12 | 205 | 99 | 50 | 49 | null | null |
DavidAlphaFox/ghc | libraries/containers/benchmarks/LookupGE/LookupGE_IntMap.hs | bsd-3-clause | -------------------------------------------------------------------------------
-- Properties:
-------------------------------------------------------------------------------
prop_lookupGE12 :: Int -> [Int] -> Bool
prop_lookupGE12 x xs = case fromList $ zip xs xs of m -> lookupGE1 x m == lookupGE2 x m | 303 | prop_lookupGE12 :: Int -> [Int] -> Bool
prop_lookupGE12 x xs = case fromList $ zip xs xs of m -> lookupGE1 x m == lookupGE2 x m | 127 | prop_lookupGE12 x xs = case fromList $ zip xs xs of m -> lookupGE1 x m == lookupGE2 x m | 87 | true | true | 0 | 9 | 31 | 63 | 32 | 31 | null | null |
amccausl/Swish | Swish/HaskellRDF/N3FormatterTest.hs | lgpl-2.1 | tx503 = arc b1 res_rdf_rest b2 | 32 | tx503 = arc b1 res_rdf_rest b2 | 32 | tx503 = arc b1 res_rdf_rest b2 | 32 | false | false | 0 | 5 | 7 | 13 | 6 | 7 | null | null |
rhuancaetano/University-Works | Prog-I/program/city_module.hs | unlicense | -- get nome da cidade
getCityName :: City -> [Char]
getCityName (City x _ _) = x | 80 | getCityName :: City -> [Char]
getCityName (City x _ _) = x | 58 | getCityName (City x _ _) = x | 28 | true | true | 0 | 9 | 16 | 38 | 18 | 20 | null | null |
frantisekfarka/ghc-dsi | compiler/llvmGen/Llvm/Types.hs | bsd-3-clause | ppDouble :: Double -> SDoc
ppDouble d
= let bs = doubleToBytes d
hex d' = case showHex d' "" of
[] -> error "dToStr: too few hex digits for float"
[x] -> ['0',x]
[x,y] -> [x,y]
_ -> error "dToStr: too many hex digits for float"
str = map toUpper $ concat $ fixEndian $ map hex bs
in text "0x" <> text str | 426 | ppDouble :: Double -> SDoc
ppDouble d
= let bs = doubleToBytes d
hex d' = case showHex d' "" of
[] -> error "dToStr: too few hex digits for float"
[x] -> ['0',x]
[x,y] -> [x,y]
_ -> error "dToStr: too many hex digits for float"
str = map toUpper $ concat $ fixEndian $ map hex bs
in text "0x" <> text str | 426 | ppDouble d
= let bs = doubleToBytes d
hex d' = case showHex d' "" of
[] -> error "dToStr: too few hex digits for float"
[x] -> ['0',x]
[x,y] -> [x,y]
_ -> error "dToStr: too many hex digits for float"
str = map toUpper $ concat $ fixEndian $ map hex bs
in text "0x" <> text str | 399 | false | true | 0 | 12 | 186 | 137 | 68 | 69 | null | null |
li-zhirui/EoplLangs | src/CallByNeed/Parser.hs | bsd-3-clause | semiColon = symbol ";" | 22 | semiColon = symbol ";" | 22 | semiColon = symbol ";" | 22 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
harrisi/on-being-better | list-expansion/Haskell/cis194/01/01-intro.hs | cc0-1.0 | ex18 = 1 : [] | 13 | ex18 = 1 : [] | 13 | ex18 = 1 : [] | 13 | false | false | 0 | 6 | 4 | 12 | 6 | 6 | null | null |
aurapm/haskell-versions | test/Test.hs | bsd-3-clause | -- | Does pretty-printing return a Versioning to its original form?
isomorph :: T.Text -> Assertion
isomorph t = case prettyV <$> versioning t of
Right t' -> t @?= t'
Left e -> assertBool (errorBundlePretty e) False
-- | Does pretty-printing return a Version to its original form? | 287 | isomorph :: T.Text -> Assertion
isomorph t = case prettyV <$> versioning t of
Right t' -> t @?= t'
Left e -> assertBool (errorBundlePretty e) False
-- | Does pretty-printing return a Version to its original form? | 219 | isomorph t = case prettyV <$> versioning t of
Right t' -> t @?= t'
Left e -> assertBool (errorBundlePretty e) False
-- | Does pretty-printing return a Version to its original form? | 187 | true | true | 0 | 10 | 55 | 71 | 33 | 38 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrelNames.hs | bsd-3-clause | knownSymbolClassName :: Name
knownSymbolClassName = clsQual gHC_TYPELITS (fsLit "KnownSymbol") knownSymbolClassNameKey | 119 | knownSymbolClassName :: Name
knownSymbolClassName = clsQual gHC_TYPELITS (fsLit "KnownSymbol") knownSymbolClassNameKey | 119 | knownSymbolClassName = clsQual gHC_TYPELITS (fsLit "KnownSymbol") knownSymbolClassNameKey | 90 | false | true | 0 | 7 | 10 | 24 | 12 | 12 | null | null |
jmacmahon/syllabify | Linguisticks.hs | agpl-3.0 | runTests pr = printTests $ fmap (An.tTest pr) parsed_all | 56 | runTests pr = printTests $ fmap (An.tTest pr) parsed_all | 56 | runTests pr = printTests $ fmap (An.tTest pr) parsed_all | 56 | false | false | 0 | 9 | 8 | 26 | 12 | 14 | null | null |
delta4d/codewars | kata/befunge-interpreter/Befunge93.hs | mit | discard (Inter g dir pos code (_:st) o) = Inter g dir pos code st o | 67 | discard (Inter g dir pos code (_:st) o) = Inter g dir pos code st o | 67 | discard (Inter g dir pos code (_:st) o) = Inter g dir pos code st o | 67 | false | false | 0 | 8 | 15 | 46 | 22 | 24 | null | null |
flatrapp/core | app/Web/App.hs | apache-2.0 | corsHeader :: ApiAction ctx ctx
corsHeader =
do ctx <- getContext
setHeader "Access-Control-Allow-Origin" "*"
pure ctx | 130 | corsHeader :: ApiAction ctx ctx
corsHeader =
do ctx <- getContext
setHeader "Access-Control-Allow-Origin" "*"
pure ctx | 130 | corsHeader =
do ctx <- getContext
setHeader "Access-Control-Allow-Origin" "*"
pure ctx | 98 | false | true | 0 | 7 | 27 | 37 | 16 | 21 | null | null |
flyrry/phonypony | src/Vindinium/Runner/Tileset.hs | mit | rezMarks :: [(String, Int, Int)]
rezMarks = [ ("rez1", 4, 3)
, ("rez2", 4, 2)
, ("rez3", 4, 1)
, ("rez4", 4, 0)
] | 157 | rezMarks :: [(String, Int, Int)]
rezMarks = [ ("rez1", 4, 3)
, ("rez2", 4, 2)
, ("rez3", 4, 1)
, ("rez4", 4, 0)
] | 157 | rezMarks = [ ("rez1", 4, 3)
, ("rez2", 4, 2)
, ("rez3", 4, 1)
, ("rez4", 4, 0)
] | 124 | false | true | 0 | 8 | 67 | 78 | 47 | 31 | null | null |
bacher09/darkplaces-text | src/DarkPlaces/Text/Chars.hs | gpl-2.0 | decodeQFont :: (CharMap a) => Vector Char -> a -> a
decodeQFont qtable = mapChars replace_char
where
replace_char c = if '\xe000' <= c && c <= '\xe0ff'
then qtable ! (ord c - 0xe000)
else c | 211 | decodeQFont :: (CharMap a) => Vector Char -> a -> a
decodeQFont qtable = mapChars replace_char
where
replace_char c = if '\xe000' <= c && c <= '\xe0ff'
then qtable ! (ord c - 0xe000)
else c | 211 | decodeQFont qtable = mapChars replace_char
where
replace_char c = if '\xe000' <= c && c <= '\xe0ff'
then qtable ! (ord c - 0xe000)
else c | 159 | false | true | 1 | 9 | 58 | 91 | 42 | 49 | null | null |
mightymoose/liquidhaskell | benchmarks/xmonad-0.11/XMonad/StackSet.hs | bsd-3-clause | -- | /O(n)/. shiftWin. Searches for the specified window 'w' on all workspaces
-- of the stackSet and moves it to stack 'n', leaving it as the focused
-- element on that stack. The item is inserted above the currently
-- focused element on that workspace.
-- The actual focused workspace doesn't change. If the window is not
-- found in the stackSet, the original stackSet is returned.
{-@ shiftWin :: (Ord a, Eq a, Eq s, Eq i) => i -> a -> StackSet i l a s sd -> StackSet i l a s sd @-}
shiftWin :: (Ord a, Eq a, Eq s, Eq i) => i -> a -> StackSet i l a s sd -> StackSet i l a s sd
shiftWin n w s = case findTag w s of
Just from | n `tagMember` s && n /= from -> go from s
_ -> s
where go from = onWorkspace n (insertUp w) . onWorkspace from (delete' w) | 833 | shiftWin :: (Ord a, Eq a, Eq s, Eq i) => i -> a -> StackSet i l a s sd -> StackSet i l a s sd
shiftWin n w s = case findTag w s of
Just from | n `tagMember` s && n /= from -> go from s
_ -> s
where go from = onWorkspace n (insertUp w) . onWorkspace from (delete' w) | 345 | shiftWin n w s = case findTag w s of
Just from | n `tagMember` s && n /= from -> go from s
_ -> s
where go from = onWorkspace n (insertUp w) . onWorkspace from (delete' w) | 251 | true | true | 0 | 13 | 245 | 172 | 86 | 86 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/take_1.hs | mit | primMinusInt :: MyInt -> MyInt -> MyInt;
primMinusInt (Pos x) (Neg y) = Pos (primPlusNat x y) | 97 | primMinusInt :: MyInt -> MyInt -> MyInt
primMinusInt (Pos x) (Neg y) = Pos (primPlusNat x y) | 96 | primMinusInt (Pos x) (Neg y) = Pos (primPlusNat x y) | 52 | false | true | 0 | 7 | 20 | 48 | 24 | 24 | null | null |
bobatkey/Forvie | src/Data/FiniteStateMachine/Nondeterministic.hs | bsd-3-clause | zeroOrMore :: NFA alphabet ()
-> NFA alphabet ()
zeroOrMore nfa =
epsilon `choice` oneOrMore nfa | 111 | zeroOrMore :: NFA alphabet ()
-> NFA alphabet ()
zeroOrMore nfa =
epsilon `choice` oneOrMore nfa | 111 | zeroOrMore nfa =
epsilon `choice` oneOrMore nfa | 51 | false | true | 0 | 7 | 30 | 41 | 20 | 21 | null | null |
beni55/doctest-haskell | tests/integration/bugfixWorkingDirectory/examples/Fib.hs | mit | -- |
--
-- Examples:
--
-- >>> fib 10
-- 55
foo :: Int -> Int
foo = undefined | 83 | foo :: Int -> Int
foo = undefined | 33 | foo = undefined | 15 | true | true | 0 | 7 | 25 | 28 | 15 | 13 | null | null |
elbrujohalcon/wxhnotepad | src/Step6.hs | bsd-3-clause | restartTimer guiCtx@GUICtx{guiWin = win, guiTimer = refreshTimer} =
do
started <- timerStart refreshTimer 1000 True
if started
then return ()
else do
errorDialog win "Error" "Can't start more timers"
wxcAppExit | 294 | restartTimer guiCtx@GUICtx{guiWin = win, guiTimer = refreshTimer} =
do
started <- timerStart refreshTimer 1000 True
if started
then return ()
else do
errorDialog win "Error" "Can't start more timers"
wxcAppExit | 294 | restartTimer guiCtx@GUICtx{guiWin = win, guiTimer = refreshTimer} =
do
started <- timerStart refreshTimer 1000 True
if started
then return ()
else do
errorDialog win "Error" "Can't start more timers"
wxcAppExit | 294 | false | false | 0 | 10 | 113 | 70 | 34 | 36 | null | null |
brendanhay/semver | src/Data/SemVer.hs | mpl-2.0 | -- | Construct an identifier from the given 'Text', returning 'Nothing' if
-- neither a numeric or valid textual input is supplied.
textual :: Text -> Maybe Identifier
textual = either (const Nothing) (Just . IText)
. parseOnly (textualParser endOfInput <* endOfInput) | 272 | textual :: Text -> Maybe Identifier
textual = either (const Nothing) (Just . IText)
. parseOnly (textualParser endOfInput <* endOfInput) | 140 | textual = either (const Nothing) (Just . IText)
. parseOnly (textualParser endOfInput <* endOfInput) | 104 | true | true | 1 | 8 | 45 | 56 | 28 | 28 | null | null |
ntc2/cabal-hsc2hs-bug | bug/Main.hs | bsd-3-clause | main = do
putStrLn $ "hsTest = " ++ show hsTest
putStrLn $ "hscTest = " ++ show hscTest | 92 | main = do
putStrLn $ "hsTest = " ++ show hsTest
putStrLn $ "hscTest = " ++ show hscTest | 92 | main = do
putStrLn $ "hsTest = " ++ show hsTest
putStrLn $ "hscTest = " ++ show hscTest | 92 | false | false | 0 | 8 | 23 | 34 | 15 | 19 | null | null |
keera-studios/hsQt | Qtc/Core/QTime.hs | bsd-2-clause | restart :: QTime a -> (()) -> IO (Int)
restart x0 ()
= withIntResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QTime_restart cobj_x0 | 137 | restart :: QTime a -> (()) -> IO (Int)
restart x0 ()
= withIntResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QTime_restart cobj_x0 | 137 | restart x0 ()
= withIntResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QTime_restart cobj_x0 | 98 | false | true | 0 | 8 | 31 | 59 | 29 | 30 | null | null |
HJvT/com | System/Win32/Com.hs | bsd-3-clause | isWindows95 :: OSVersionInfo -> Bool
isWindows95 (OSVersionInfo _ 0 1{-VER_PLATFORM_WIN32_WINDOWS-}) = True | 107 | isWindows95 :: OSVersionInfo -> Bool
isWindows95 (OSVersionInfo _ 0 1{-VER_PLATFORM_WIN32_WINDOWS-}) = True | 107 | isWindows95 (OSVersionInfo _ 0 1{-VER_PLATFORM_WIN32_WINDOWS-}) = True | 70 | false | true | 0 | 7 | 11 | 29 | 15 | 14 | null | null |
tokiwoousaka/egison4 | hs-src/Language/Egison/Parser.hs | mit | parseMatchClause :: Parser MatchClause
parseMatchClause = brackets $ (,) <$> parseEgisonExpr <*> parseEgisonExpr | 112 | parseMatchClause :: Parser MatchClause
parseMatchClause = brackets $ (,) <$> parseEgisonExpr <*> parseEgisonExpr | 112 | parseMatchClause = brackets $ (,) <$> parseEgisonExpr <*> parseEgisonExpr | 73 | false | true | 0 | 8 | 12 | 29 | 15 | 14 | null | null |
blasterpal/my_migrate | lib/parse.hs | mit | fkeys statements = filter isFk $ concat [ys | z@(CreateTable x ys) <- statements] | 81 | fkeys statements = filter isFk $ concat [ys | z@(CreateTable x ys) <- statements] | 81 | fkeys statements = filter isFk $ concat [ys | z@(CreateTable x ys) <- statements] | 81 | false | false | 3 | 11 | 13 | 45 | 20 | 25 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.