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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NatureShade/SymbolicHaskell | src/Math/Symbolic/Expression.hs | mit | toTree (Op "+" xs) = foldl1 sumTree $ toTree <$> xs
where
sumTree y (Op "*" [Numeric (-1), x]) = Op "-" [y, x]
sumTree y (Op "*" (Numeric x:xs)) | x < 0 = Op "-" [y, Op "*" $ (Numeric $ abs x):xs]
sumTree y (Numeric x) | x < 0 = Op "-" [y, Numeric $ abs x]
sumTree x y = x + y | 312 | toTree (Op "+" xs) = foldl1 sumTree $ toTree <$> xs
where
sumTree y (Op "*" [Numeric (-1), x]) = Op "-" [y, x]
sumTree y (Op "*" (Numeric x:xs)) | x < 0 = Op "-" [y, Op "*" $ (Numeric $ abs x):xs]
sumTree y (Numeric x) | x < 0 = Op "-" [y, Numeric $ abs x]
sumTree x y = x + y | 312 | toTree (Op "+" xs) = foldl1 sumTree $ toTree <$> xs
where
sumTree y (Op "*" [Numeric (-1), x]) = Op "-" [y, x]
sumTree y (Op "*" (Numeric x:xs)) | x < 0 = Op "-" [y, Op "*" $ (Numeric $ abs x):xs]
sumTree y (Numeric x) | x < 0 = Op "-" [y, Numeric $ abs x]
sumTree x y = x + y | 312 | false | false | 5 | 14 | 103 | 198 | 99 | 99 | null | null |
thalerjonathan/phd | public/ArtIterating/code/haskell/PureAgentsAct/src/WildFire/WildFireModelDynamic.hs | gpl-3.0 | cellOfAgent :: (WFAgent, WFEnvironment) -> TVar WFCell
cellOfAgent (a, e) = fromJust maybeCell
where
maybeCell = Map.lookup (cidx (PA.state a)) (cells e) | 165 | cellOfAgent :: (WFAgent, WFEnvironment) -> TVar WFCell
cellOfAgent (a, e) = fromJust maybeCell
where
maybeCell = Map.lookup (cidx (PA.state a)) (cells e) | 165 | cellOfAgent (a, e) = fromJust maybeCell
where
maybeCell = Map.lookup (cidx (PA.state a)) (cells e) | 110 | false | true | 1 | 10 | 33 | 78 | 37 | 41 | null | null |
felixsch/moonbase-ng | src/Moonbase/WM/XMonad.hs | lgpl-2.1 | pangoSanitize' :: String -> String
pangoSanitize' = foldr sanitize ""
where
sanitize '>' xs = ">" ++ xs
sanitize '<' xs = "<" ++ xs
sanitize '\"' xs = """ ++ xs
sanitize '&' xs = "&" ++ xs
sanitize x xs = x:xs | 246 | pangoSanitize' :: String -> String
pangoSanitize' = foldr sanitize ""
where
sanitize '>' xs = ">" ++ xs
sanitize '<' xs = "<" ++ xs
sanitize '\"' xs = """ ++ xs
sanitize '&' xs = "&" ++ xs
sanitize x xs = x:xs | 246 | pangoSanitize' = foldr sanitize ""
where
sanitize '>' xs = ">" ++ xs
sanitize '<' xs = "<" ++ xs
sanitize '\"' xs = """ ++ xs
sanitize '&' xs = "&" ++ xs
sanitize x xs = x:xs | 211 | false | true | 0 | 5 | 65 | 93 | 46 | 47 | null | null |
gbataille/pandoc | tests/Tests/Readers/Docx.hs | gpl-2.0 | compareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool
compareMediaPathIO mediaPath mediaBag docxPath = do
docxMedia <- getMedia docxPath mediaPath
let mbBS = case lookupMedia mediaPath mediaBag of
Just (_, bs) -> bs
Nothing -> error ("couldn't find " ++
mediaPath ++
" in media bag")
docxBS = case docxMedia of
Just bs -> bs
Nothing -> error ("couldn't find " ++
mediaPath ++
" in media bag")
return $ mbBS == docxBS | 665 | compareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool
compareMediaPathIO mediaPath mediaBag docxPath = do
docxMedia <- getMedia docxPath mediaPath
let mbBS = case lookupMedia mediaPath mediaBag of
Just (_, bs) -> bs
Nothing -> error ("couldn't find " ++
mediaPath ++
" in media bag")
docxBS = case docxMedia of
Just bs -> bs
Nothing -> error ("couldn't find " ++
mediaPath ++
" in media bag")
return $ mbBS == docxBS | 665 | compareMediaPathIO mediaPath mediaBag docxPath = do
docxMedia <- getMedia docxPath mediaPath
let mbBS = case lookupMedia mediaPath mediaBag of
Just (_, bs) -> bs
Nothing -> error ("couldn't find " ++
mediaPath ++
" in media bag")
docxBS = case docxMedia of
Just bs -> bs
Nothing -> error ("couldn't find " ++
mediaPath ++
" in media bag")
return $ mbBS == docxBS | 599 | false | true | 0 | 16 | 310 | 152 | 72 | 80 | null | null |
massysett/penny | penny/lib/Penny/Copper/Decopperize.hs | bsd-3-clause | dD0'1'Opt :: D0'1'Opt t a -> NonNegative
dD0'1'Opt (D0'1'Opt m) = case m of
Nothing -> NN.zero
Just d -> dD0'1 d | 116 | dD0'1'Opt :: D0'1'Opt t a -> NonNegative
dD0'1'Opt (D0'1'Opt m) = case m of
Nothing -> NN.zero
Just d -> dD0'1 d | 116 | dD0'1'Opt (D0'1'Opt m) = case m of
Nothing -> NN.zero
Just d -> dD0'1 d | 75 | false | true | 0 | 8 | 25 | 53 | 25 | 28 | null | null |
grwlf/vsim | src_r/Control/Monad/BP2.hs | gpl-3.0 | pauseBP :: (Monad m) => BP l s m ()
pauseBP = BP $ \s _ _ cont -> cont s (return ()) | 85 | pauseBP :: (Monad m) => BP l s m ()
pauseBP = BP $ \s _ _ cont -> cont s (return ()) | 84 | pauseBP = BP $ \s _ _ cont -> cont s (return ()) | 48 | false | true | 0 | 10 | 23 | 59 | 30 | 29 | null | null |
Hi-Angel/yi | yi-core/src/Yi/Buffer/HighLevel.hs | gpl-2.0 | -- | Reads in word before point.
readPrevWordB :: BufferM YiString
readPrevWordB = readPrevUnitB unitViWordOnLine | 113 | readPrevWordB :: BufferM YiString
readPrevWordB = readPrevUnitB unitViWordOnLine | 80 | readPrevWordB = readPrevUnitB unitViWordOnLine | 46 | true | true | 0 | 5 | 14 | 18 | 9 | 9 | null | null |
Peaker/Algorithm-W-Step-By-Step | src/Lamdu/Infer/Unify.hs | gpl-3.0 | unify :: Type -> Type -> Infer ()
unify x y =
do
s <- M.getSubst
unifyUnsafe (Subst.apply s x) (Subst.apply s y) | 132 | unify :: Type -> Type -> Infer ()
unify x y =
do
s <- M.getSubst
unifyUnsafe (Subst.apply s x) (Subst.apply s y) | 132 | unify x y =
do
s <- M.getSubst
unifyUnsafe (Subst.apply s x) (Subst.apply s y) | 98 | false | true | 0 | 10 | 42 | 66 | 31 | 35 | null | null |
cdornan/sort | benchmarks/src/SortBenchmarks.hs | bsd-3-clause | -- | Run the Criterion benchmarks with the given Criterion
-- configuration.
sortBenchmarks :: Config -> IO ()
sortBenchmarks cfg = do
-- | generate 1000 psuedo-random numbers in r1k
gen <- initialize $ V.singleton 42
r1k <- V.toList `fmap` uniformVector gen 1000 :: IO [Int]
defaultMainWith cfg
[ bgroup "sort"
[ bench "r1k" $ nf sort r1k
, bench "a1k" $ nf sort a1k
, bench "d1k" $ nf sort d1k
]
, bgroup "sortOn"
[ bench "r1k" $ nf (sortOn id) r1k
, bench "a1k" $ nf (sortOn id) a1k
]
, bgroup "monoidSortAssocs"
[ bench "r1k" $ nf monoidSortAssocs $ map ass r1k
, bench "a1k" $ nf monoidSortAssocs $ map ass a1k
]
, bgroup "monoidSort"
[ bench "r1k" $ nf monoidSort $ map Sum r1k
, bench "a1k" $ nf monoidSort $ map Sum a1k
]
, bgroup "groupSortOn"
[ bench "r1k" $ nf (groupSortOn id grp') r1k
, bench "a1k" $ nf (groupSortOn id grp') a1k
]
, bgroup "groupSort"
[ bench "r1k" $ nf (groupSort grp) r1k
, bench "a1k" $ nf (groupSort grp) a1k
]
]
-- | 1000 ascending integers | 1,282 | sortBenchmarks :: Config -> IO ()
sortBenchmarks cfg = do
-- | generate 1000 psuedo-random numbers in r1k
gen <- initialize $ V.singleton 42
r1k <- V.toList `fmap` uniformVector gen 1000 :: IO [Int]
defaultMainWith cfg
[ bgroup "sort"
[ bench "r1k" $ nf sort r1k
, bench "a1k" $ nf sort a1k
, bench "d1k" $ nf sort d1k
]
, bgroup "sortOn"
[ bench "r1k" $ nf (sortOn id) r1k
, bench "a1k" $ nf (sortOn id) a1k
]
, bgroup "monoidSortAssocs"
[ bench "r1k" $ nf monoidSortAssocs $ map ass r1k
, bench "a1k" $ nf monoidSortAssocs $ map ass a1k
]
, bgroup "monoidSort"
[ bench "r1k" $ nf monoidSort $ map Sum r1k
, bench "a1k" $ nf monoidSort $ map Sum a1k
]
, bgroup "groupSortOn"
[ bench "r1k" $ nf (groupSortOn id grp') r1k
, bench "a1k" $ nf (groupSortOn id grp') a1k
]
, bgroup "groupSort"
[ bench "r1k" $ nf (groupSort grp) r1k
, bench "a1k" $ nf (groupSort grp) a1k
]
]
-- | 1000 ascending integers | 1,205 | sortBenchmarks cfg = do
-- | generate 1000 psuedo-random numbers in r1k
gen <- initialize $ V.singleton 42
r1k <- V.toList `fmap` uniformVector gen 1000 :: IO [Int]
defaultMainWith cfg
[ bgroup "sort"
[ bench "r1k" $ nf sort r1k
, bench "a1k" $ nf sort a1k
, bench "d1k" $ nf sort d1k
]
, bgroup "sortOn"
[ bench "r1k" $ nf (sortOn id) r1k
, bench "a1k" $ nf (sortOn id) a1k
]
, bgroup "monoidSortAssocs"
[ bench "r1k" $ nf monoidSortAssocs $ map ass r1k
, bench "a1k" $ nf monoidSortAssocs $ map ass a1k
]
, bgroup "monoidSort"
[ bench "r1k" $ nf monoidSort $ map Sum r1k
, bench "a1k" $ nf monoidSort $ map Sum a1k
]
, bgroup "groupSortOn"
[ bench "r1k" $ nf (groupSortOn id grp') r1k
, bench "a1k" $ nf (groupSortOn id grp') a1k
]
, bgroup "groupSort"
[ bench "r1k" $ nf (groupSort grp) r1k
, bench "a1k" $ nf (groupSort grp) a1k
]
]
-- | 1000 ascending integers | 1,171 | true | true | 0 | 14 | 494 | 391 | 187 | 204 | null | null |
jwiegley/lambdabot | Plugin/Search.hs | mit | searchCmd :: String -> String -> LB [String]
searchCmd _ [] = return ["Empty search."] | 97 | searchCmd :: String -> String -> LB [String]
searchCmd _ [] = return ["Empty search."] | 97 | searchCmd _ [] = return ["Empty search."] | 52 | false | true | 0 | 8 | 25 | 38 | 19 | 19 | null | null |
michaelficarra/purescript | psci/Directive.hs | mit | -- |
-- Returns the default string representation of a directive.
--
stringFor :: Directive -> String
stringFor = head . stringsFor | 131 | stringFor :: Directive -> String
stringFor = head . stringsFor | 62 | stringFor = head . stringsFor | 29 | true | true | 1 | 7 | 21 | 30 | 14 | 16 | null | null |
SRechenberger/flock | lib/Flock.hs | bsd-3-clause | move :: Behavior ()
move = do
(dx,dy) <- use agentDirection
when (dx == 0 && dy == 0) $ do
d <- (,) <$> getRandomR (-1,1) <*> getRandomR (-1,1)
agentDirection .= d
modify move'
-- | Turns an agent by an angle | 226 | move :: Behavior ()
move = do
(dx,dy) <- use agentDirection
when (dx == 0 && dy == 0) $ do
d <- (,) <$> getRandomR (-1,1) <*> getRandomR (-1,1)
agentDirection .= d
modify move'
-- | Turns an agent by an angle | 226 | move = do
(dx,dy) <- use agentDirection
when (dx == 0 && dy == 0) $ do
d <- (,) <$> getRandomR (-1,1) <*> getRandomR (-1,1)
agentDirection .= d
modify move'
-- | Turns an agent by an angle | 206 | false | true | 0 | 15 | 60 | 111 | 55 | 56 | null | null |
bitemyapp/ghc | libraries/template-haskell/Language/Haskell/TH/Syntax.hs | bsd-3-clause | occString :: OccName -> String
occString (OccName occ) = occ | 60 | occString :: OccName -> String
occString (OccName occ) = occ | 60 | occString (OccName occ) = occ | 29 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
hansroland/FunctionalImages | src/FunctionalImagesBase.hs | bsd-3-clause | yellow :: Color
yellow = PixelRGBAF 1 1 0 1 | 43 | yellow :: Color
yellow = PixelRGBAF 1 1 0 1 | 43 | yellow = PixelRGBAF 1 1 0 1 | 27 | false | true | 0 | 5 | 9 | 20 | 10 | 10 | null | null |
judah/haskeline | System/Console/Haskeline/Backend/WCWidth.hs | bsd-3-clause | gWidth :: Grapheme -> Int
gWidth g = wcwidth (baseChar g) | 57 | gWidth :: Grapheme -> Int
gWidth g = wcwidth (baseChar g) | 57 | gWidth g = wcwidth (baseChar g) | 31 | false | true | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 2741 = 2740 | 11 | 2741 = 2740 | 11 | 2741 = 2740 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
ssaavedra/liquidhaskell | tests/pos/pair0.hs | bsd-3-clause | chk (x, y) = liquidAssertB (x <y) | 33 | chk (x, y) = liquidAssertB (x <y) | 33 | chk (x, y) = liquidAssertB (x <y) | 33 | false | false | 0 | 7 | 6 | 25 | 13 | 12 | null | null |
urbanslug/ghc | compiler/basicTypes/Unique.hs | bsd-3-clause | -- used in NCG for getUnique on RealRegs
mkPseudoUniqueE i = mkUnique 'E' i | 75 | mkPseudoUniqueE i = mkUnique 'E' i | 34 | mkPseudoUniqueE i = mkUnique 'E' i | 34 | true | false | 1 | 5 | 13 | 20 | 7 | 13 | null | null |
foreverbell/project-euler-solutions | src/206.hs | bsd-3-clause | isDesired :: Int -> Bool
isDesired x = check (show (x * x)) '1' where
check (x:[]) n = True
check (x:xs) n = if (x == n) then check (tail xs) (succ x) else False | 169 | isDesired :: Int -> Bool
isDesired x = check (show (x * x)) '1' where
check (x:[]) n = True
check (x:xs) n = if (x == n) then check (tail xs) (succ x) else False | 169 | isDesired x = check (show (x * x)) '1' where
check (x:[]) n = True
check (x:xs) n = if (x == n) then check (tail xs) (succ x) else False | 144 | false | true | 0 | 10 | 43 | 106 | 55 | 51 | null | null |
urbanslug/ghc | libraries/base/GHC/IO/Handle/Types.hs | bsd-3-clause | isWritableHandleType WriteHandle = True | 43 | isWritableHandleType WriteHandle = True | 43 | isWritableHandleType WriteHandle = True | 43 | false | false | 0 | 4 | 7 | 10 | 4 | 6 | null | null |
kustomzone/plush | src/Plush/Run/Expansion.hs | apache-2.0 | pathnameExpansion :: (PosixLike m) => Word -> m [Word]
pathnameExpansion w = results <$> pathnameGlob "" (parts w)
-- TODO: should skip pathnameExpansion of shell flag -f is set
where
results [] = [w]
results es = expandParts (const [[Bare e] | e <- es]) w | 270 | pathnameExpansion :: (PosixLike m) => Word -> m [Word]
pathnameExpansion w = results <$> pathnameGlob "" (parts w)
-- TODO: should skip pathnameExpansion of shell flag -f is set
where
results [] = [w]
results es = expandParts (const [[Bare e] | e <- es]) w | 270 | pathnameExpansion w = results <$> pathnameGlob "" (parts w)
-- TODO: should skip pathnameExpansion of shell flag -f is set
where
results [] = [w]
results es = expandParts (const [[Bare e] | e <- es]) w | 215 | false | true | 2 | 10 | 59 | 111 | 52 | 59 | null | null |
rueshyna/gogol | gogol-fusiontables/gen/Network/Google/Resource/FusionTables/Template/Update.hs | mpl-2.0 | -- | Multipart request metadata.
tuPayload :: Lens' TemplateUpdate Template
tuPayload
= lens _tuPayload (\ s a -> s{_tuPayload = a}) | 134 | tuPayload :: Lens' TemplateUpdate Template
tuPayload
= lens _tuPayload (\ s a -> s{_tuPayload = a}) | 101 | tuPayload
= lens _tuPayload (\ s a -> s{_tuPayload = a}) | 58 | true | true | 0 | 9 | 22 | 47 | 23 | 24 | null | null |
nejla/auth-service | service/src/Api.hs | bsd-3-clause | serveGetUserInfoAPI :: ConnectionPool
-> ApiState
-> Server GetUserInfoAPI
serveGetUserInfoAPI pool conf tok = do
mbRUI <- liftHandler . runAPI pool conf $ getUserInfo tok
case mbRUI of
Nothing -> throwError err403
Just rui -> return rui
--------------------------------------------------------------------------------
-- Admin interface
-------------------------------------------------------------------------------- | 470 | serveGetUserInfoAPI :: ConnectionPool
-> ApiState
-> Server GetUserInfoAPI
serveGetUserInfoAPI pool conf tok = do
mbRUI <- liftHandler . runAPI pool conf $ getUserInfo tok
case mbRUI of
Nothing -> throwError err403
Just rui -> return rui
--------------------------------------------------------------------------------
-- Admin interface
-------------------------------------------------------------------------------- | 470 | serveGetUserInfoAPI pool conf tok = do
mbRUI <- liftHandler . runAPI pool conf $ getUserInfo tok
case mbRUI of
Nothing -> throwError err403
Just rui -> return rui
--------------------------------------------------------------------------------
-- Admin interface
-------------------------------------------------------------------------------- | 355 | false | true | 0 | 11 | 92 | 88 | 40 | 48 | null | null |
iblumenfeld/saw-core | src/Verifier/SAW/Conversion.hs | bsd-3-clause | bvAdd_bvNat :: Termlike t => Conversion t
bvAdd_bvNat = globalConv "Prelude.bvAdd" Prim.bvAdd | 93 | bvAdd_bvNat :: Termlike t => Conversion t
bvAdd_bvNat = globalConv "Prelude.bvAdd" Prim.bvAdd | 93 | bvAdd_bvNat = globalConv "Prelude.bvAdd" Prim.bvAdd | 51 | false | true | 0 | 6 | 11 | 28 | 13 | 15 | null | null |
goshakkk/hadis | src/Hadis/CommandFor.hs | mit | commandFor (INCRBY k i) = incrby k i | 39 | commandFor (INCRBY k i) = incrby k i | 39 | commandFor (INCRBY k i) = incrby k i | 39 | false | false | 0 | 7 | 10 | 22 | 10 | 12 | null | null |
projectorhq/haskell-liquid | test/Main.hs | bsd-3-clause | tests :: TestTree
tests = testGroup "Root"
[ helperTests
, parserTests
, rendererTests
, variableFinderTests
] | 200 | tests :: TestTree
tests = testGroup "Root"
[ helperTests
, parserTests
, rendererTests
, variableFinderTests
] | 200 | tests = testGroup "Root"
[ helperTests
, parserTests
, rendererTests
, variableFinderTests
] | 182 | false | true | 0 | 6 | 105 | 28 | 16 | 12 | null | null |
nikita-volkov/smtps-gmail | Network/Mail/Client/Gmail.hs | bsd-3-clause | -- |
-- Parse the SMTP packet stream.
parser :: B.ByteString -> P.Parser ()
parser code = do
reply <- P.take 3
if code /= reply
then throw . ParseError $ "Expected SMTP reply code " ++ show code ++ ", but recieved SMTP reply code " ++ show reply ++ "."
else anyChar >>= \ case
' ' -> return ()
'-' -> manyTill anyChar endOfLine >> parser code
_ -> throw $ ParseError "Unexpected character."
-- |
-- Define the TLS client parameters. | 471 | parser :: B.ByteString -> P.Parser ()
parser code = do
reply <- P.take 3
if code /= reply
then throw . ParseError $ "Expected SMTP reply code " ++ show code ++ ", but recieved SMTP reply code " ++ show reply ++ "."
else anyChar >>= \ case
' ' -> return ()
'-' -> manyTill anyChar endOfLine >> parser code
_ -> throw $ ParseError "Unexpected character."
-- |
-- Define the TLS client parameters. | 433 | parser code = do
reply <- P.take 3
if code /= reply
then throw . ParseError $ "Expected SMTP reply code " ++ show code ++ ", but recieved SMTP reply code " ++ show reply ++ "."
else anyChar >>= \ case
' ' -> return ()
'-' -> manyTill anyChar endOfLine >> parser code
_ -> throw $ ParseError "Unexpected character."
-- |
-- Define the TLS client parameters. | 395 | true | true | 0 | 14 | 123 | 140 | 67 | 73 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSCRIPT :: Int
wxSCRIPT = 73 | 29 | wxSCRIPT :: Int
wxSCRIPT = 73 | 29 | wxSCRIPT = 73 | 13 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
kawamuray/ganeti | src/Ganeti/Locking/Locks.hs | gpl-2.0 | -- | Provide the String representation of a lock
lockName :: GanetiLocks -> String
lockName BGL = "cluster/BGL" | 111 | lockName :: GanetiLocks -> String
lockName BGL = "cluster/BGL" | 62 | lockName BGL = "cluster/BGL" | 28 | true | true | 0 | 7 | 17 | 25 | 11 | 14 | null | null |
rodrigo-machado/verigraph | src/library/Data/Graphs.hs | gpl-3.0 | empty :: Graph n e
empty = Graph [] [] | 38 | empty :: Graph n e
empty = Graph [] [] | 38 | empty = Graph [] [] | 19 | false | true | 0 | 6 | 9 | 32 | 13 | 19 | null | null |
sir-murray/lol | Import/Base.hs | agpl-3.0 | apresult :: AP.Result r -> Maybe r
apresult (AP.Fail _ _ _) = Nothing | 69 | apresult :: AP.Result r -> Maybe r
apresult (AP.Fail _ _ _) = Nothing | 69 | apresult (AP.Fail _ _ _) = Nothing | 34 | false | true | 0 | 8 | 13 | 38 | 18 | 20 | null | null |
hrushikesh/ircbot | Network/IRC/Bot/BotMonad.hs | bsd-3-clause | maybeZero :: (MonadPlus m) => Maybe a -> m a
maybeZero Nothing = mzero | 70 | maybeZero :: (MonadPlus m) => Maybe a -> m a
maybeZero Nothing = mzero | 70 | maybeZero Nothing = mzero | 25 | false | true | 0 | 7 | 13 | 33 | 16 | 17 | null | null |
mettekou/ghc | compiler/types/TyCoRep.hs | bsd-3-clause | ------------
pprTheta :: ThetaType -> SDoc
pprTheta = pprIfaceContext . map tidyToIfaceType | 91 | pprTheta :: ThetaType -> SDoc
pprTheta = pprIfaceContext . map tidyToIfaceType | 78 | pprTheta = pprIfaceContext . map tidyToIfaceType | 48 | true | true | 0 | 6 | 11 | 23 | 12 | 11 | null | null |
bmsherman/magma-gpu | Foreign/CUDA/Magma/TH.hs | bsd-3-clause | mkClass :: String -> [CFunction] -> Q Dec
mkClass classname xs = classD (return []) className [PlainTV typeName] [] decs where
className = mkName classname
typeName = mkName "a"
decs = map (f . phonifyF) xs
mkPhony :: TypeC -> TypeC
mkPhony (PtrC t) = PtrC (mkPhony t)
mkPhony (ArrC t) = ArrC (mkPhony t)
mkPhony x = let t' = PhonyC typeName in
case x of DoubleC -> t'; FloatC -> t'; ComplexC _ -> t'; y -> y
phonifyF :: CFunction -> CFunction
phonifyF cf@(name, ret, args) = (name, mkPhony ret, map (second mkPhony) args)
f cfunc@(name, ret, _) =
let (_, retTytrans) = outMarshall ret
funtype = funTypeMod retTytrans (functionTypeInfo cfunc)
in sigD (mkName (tail name)) funtype | 724 | mkClass :: String -> [CFunction] -> Q Dec
mkClass classname xs = classD (return []) className [PlainTV typeName] [] decs where
className = mkName classname
typeName = mkName "a"
decs = map (f . phonifyF) xs
mkPhony :: TypeC -> TypeC
mkPhony (PtrC t) = PtrC (mkPhony t)
mkPhony (ArrC t) = ArrC (mkPhony t)
mkPhony x = let t' = PhonyC typeName in
case x of DoubleC -> t'; FloatC -> t'; ComplexC _ -> t'; y -> y
phonifyF :: CFunction -> CFunction
phonifyF cf@(name, ret, args) = (name, mkPhony ret, map (second mkPhony) args)
f cfunc@(name, ret, _) =
let (_, retTytrans) = outMarshall ret
funtype = funTypeMod retTytrans (functionTypeInfo cfunc)
in sigD (mkName (tail name)) funtype | 724 | mkClass classname xs = classD (return []) className [PlainTV typeName] [] decs where
className = mkName classname
typeName = mkName "a"
decs = map (f . phonifyF) xs
mkPhony :: TypeC -> TypeC
mkPhony (PtrC t) = PtrC (mkPhony t)
mkPhony (ArrC t) = ArrC (mkPhony t)
mkPhony x = let t' = PhonyC typeName in
case x of DoubleC -> t'; FloatC -> t'; ComplexC _ -> t'; y -> y
phonifyF :: CFunction -> CFunction
phonifyF cf@(name, ret, args) = (name, mkPhony ret, map (second mkPhony) args)
f cfunc@(name, ret, _) =
let (_, retTytrans) = outMarshall ret
funtype = funTypeMod retTytrans (functionTypeInfo cfunc)
in sigD (mkName (tail name)) funtype | 682 | false | true | 0 | 13 | 164 | 333 | 169 | 164 | null | null |
Cahu/krpc-hs | src/KRPCHS/SpaceCenter.hs | gpl-3.0 | {-
- A list of all lights in the vessel.
-}
getPartsLights :: KRPCHS.SpaceCenter.Parts -> RPCContext ([KRPCHS.SpaceCenter.Light])
getPartsLights thisArg = do
let r = makeRequest "SpaceCenter" "Parts_get_Lights" [makeArgument 0 thisArg]
res <- sendRequest r
processResponse res | 290 | getPartsLights :: KRPCHS.SpaceCenter.Parts -> RPCContext ([KRPCHS.SpaceCenter.Light])
getPartsLights thisArg = do
let r = makeRequest "SpaceCenter" "Parts_get_Lights" [makeArgument 0 thisArg]
res <- sendRequest r
processResponse res | 244 | getPartsLights thisArg = do
let r = makeRequest "SpaceCenter" "Parts_get_Lights" [makeArgument 0 thisArg]
res <- sendRequest r
processResponse res | 158 | true | true | 0 | 13 | 49 | 79 | 37 | 42 | null | null |
DATX02-17-26/DATX02-17-26 | libsrc/Norm/ForIndexConstLessThanEq.hs | gpl-2.0 | (EVar (LVName (Name [Ident ident]))) `isOk` (Just (FIVars (TypedVVDecl (VMType _ (PrimT IntT)) [VarDecl (VarDId (Ident ident')) _]))) = ident == ident' | 151 | (EVar (LVName (Name [Ident ident]))) `isOk` (Just (FIVars (TypedVVDecl (VMType _ (PrimT IntT)) [VarDecl (VarDId (Ident ident')) _]))) = ident == ident' | 151 | (EVar (LVName (Name [Ident ident]))) `isOk` (Just (FIVars (TypedVVDecl (VMType _ (PrimT IntT)) [VarDecl (VarDId (Ident ident')) _]))) = ident == ident' | 151 | false | false | 0 | 17 | 21 | 96 | 48 | 48 | null | null |
Happy0/snowdrift | Model/Permission.hs | agpl-3.0 | permissionLevelLabel :: PermissionLevel -> Text
permissionLevelLabel = T.pack . show | 84 | permissionLevelLabel :: PermissionLevel -> Text
permissionLevelLabel = T.pack . show | 84 | permissionLevelLabel = T.pack . show | 36 | false | true | 0 | 6 | 9 | 21 | 11 | 10 | null | null |
ml9951/ghc | compiler/coreSyn/MkCore.hs | bsd-3-clause | aBSENT_ERROR_ID = mkRuntimeErrorId absentErrorName | 66 | aBSENT_ERROR_ID = mkRuntimeErrorId absentErrorName | 66 | aBSENT_ERROR_ID = mkRuntimeErrorId absentErrorName | 66 | false | false | 0 | 5 | 19 | 9 | 4 | 5 | null | null |
ocozalp/Haskellbook | chapter3/sequencing.hs | unlicense | main :: IO ()
main = do
putStr "Hello "
putStrLn "World" | 65 | main :: IO ()
main = do
putStr "Hello "
putStrLn "World" | 64 | main = do
putStr "Hello "
putStrLn "World" | 50 | false | true | 0 | 8 | 20 | 34 | 13 | 21 | null | null |
snoyberg/ghc | testsuite/tests/indexed-types/should_compile/GivenCheck.hs | bsd-3-clause | f :: a -> S a
f = undefined | 27 | f :: a -> S a
f = undefined | 27 | f = undefined | 13 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
ckaestne/CIDE | CIDE_Language_Haskell/test/WSP/Webserver/Console.hs | gpl-3.0 | doChangeOptions names optH
= let { opt = value optH;
action
= unsafe_io $ Deploy.modifyOptions names (++ [SessionMode opt])}
in confirmAction ("Set option " ++ show opt) names action | 220 | doChangeOptions names optH
= let { opt = value optH;
action
= unsafe_io $ Deploy.modifyOptions names (++ [SessionMode opt])}
in confirmAction ("Set option " ++ show opt) names action | 220 | doChangeOptions names optH
= let { opt = value optH;
action
= unsafe_io $ Deploy.modifyOptions names (++ [SessionMode opt])}
in confirmAction ("Set option " ++ show opt) names action | 220 | false | false | 0 | 13 | 66 | 71 | 36 | 35 | null | null |
k0001/gtk2hs | tools/c2hs/base/syms/tests/Main.hs | gpl-3.0 | findName :: VName -> MyCST (Maybe VarObj)
findName name = readCST (\(ais, vt, env) -> find env name) | 106 | findName :: VName -> MyCST (Maybe VarObj)
findName name = readCST (\(ais, vt, env) -> find env name) | 106 | findName name = readCST (\(ais, vt, env) -> find env name) | 59 | false | true | 0 | 8 | 23 | 52 | 27 | 25 | null | null |
phischu/fragnix | builtins/base/GHC.Event.Thread.hs | bsd-3-clause | threadWaitReadSTM :: Fd -> IO (STM (), IO ())
threadWaitReadSTM = threadWaitSTM evtRead | 87 | threadWaitReadSTM :: Fd -> IO (STM (), IO ())
threadWaitReadSTM = threadWaitSTM evtRead | 87 | threadWaitReadSTM = threadWaitSTM evtRead | 41 | false | true | 0 | 10 | 12 | 42 | 19 | 23 | null | null |
JPMoresmau/leksah-server | src/IDE/Metainfo/SourceDB.hs | gpl-2.0 | lexer :: P.TokenParser st
lexer = P.makeTokenParser packageStyle | 64 | lexer :: P.TokenParser st
lexer = P.makeTokenParser packageStyle | 64 | lexer = P.makeTokenParser packageStyle | 38 | false | true | 1 | 6 | 7 | 24 | 10 | 14 | null | null |
jtapolczai/wumpus | Agent/Intelligent/Affect.hs | apache-2.0 | emotionMessage Fear = AMEmotionFear | 35 | emotionMessage Fear = AMEmotionFear | 35 | emotionMessage Fear = AMEmotionFear | 35 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
rfw/entrustor | entrustor.hs | mit | isIdentified :: String -> BotResult (Maybe Bool)
isIdentified nick = do
privmsg "NickServ" $ "STATUS " ++ nick
callCC $ \cc -> do
modify $ \bot -> bot {
idReqs = M.insert (normalizeNick nick) cc (idReqs bot)
}
return Nothing | 268 | isIdentified :: String -> BotResult (Maybe Bool)
isIdentified nick = do
privmsg "NickServ" $ "STATUS " ++ nick
callCC $ \cc -> do
modify $ \bot -> bot {
idReqs = M.insert (normalizeNick nick) cc (idReqs bot)
}
return Nothing | 268 | isIdentified nick = do
privmsg "NickServ" $ "STATUS " ++ nick
callCC $ \cc -> do
modify $ \bot -> bot {
idReqs = M.insert (normalizeNick nick) cc (idReqs bot)
}
return Nothing | 219 | false | true | 0 | 18 | 83 | 105 | 49 | 56 | null | null |
Tosainu/blog | src/Main.hs | mit | --- Configurations
hakyllConfig :: Configuration
hakyllConfig = defaultConfiguration
{ destinationDirectory = "build"
, storeDirectory = ".cache"
, tmpDirectory = ".cache/tmp"
, previewHost = "0.0.0.0"
, previewPort = 4567
} | 268 | hakyllConfig :: Configuration
hakyllConfig = defaultConfiguration
{ destinationDirectory = "build"
, storeDirectory = ".cache"
, tmpDirectory = ".cache/tmp"
, previewHost = "0.0.0.0"
, previewPort = 4567
} | 249 | hakyllConfig = defaultConfiguration
{ destinationDirectory = "build"
, storeDirectory = ".cache"
, tmpDirectory = ".cache/tmp"
, previewHost = "0.0.0.0"
, previewPort = 4567
} | 219 | true | true | 0 | 7 | 72 | 48 | 29 | 19 | null | null |
pgavin/secdh | lib/Language/Slambda/Util.hs | bsd-3-clause | primName NegP = "neg" | 26 | primName NegP = "neg" | 26 | primName NegP = "neg" | 26 | false | false | 1 | 5 | 8 | 13 | 4 | 9 | null | null |
abakst/liquidhaskell | src/Language/Haskell/Liquid/GHC/Misc.hs | bsd-3-clause | sourcePosSrcSpan :: SourcePos -> SrcSpan
sourcePosSrcSpan = srcLocSpan . sourcePosSrcLoc | 90 | sourcePosSrcSpan :: SourcePos -> SrcSpan
sourcePosSrcSpan = srcLocSpan . sourcePosSrcLoc | 90 | sourcePosSrcSpan = srcLocSpan . sourcePosSrcLoc | 47 | false | true | 0 | 5 | 11 | 19 | 10 | 9 | null | null |
mariefarrell/Hets | CASL/Utils.hs | gpl-2.0 | {- | replaceVars replaces all Qual_var occurences that are supposed
to be replaced according to the Subst -}
replaceVarsF :: Subst f
-> (f -> f)
-- ^ this function replaces Qual_var in ExtFORMULA
-> FORMULA f -> FORMULA f
replaceVarsF m = foldFormula . replaceVarsRec m | 308 | replaceVarsF :: Subst f
-> (f -> f)
-- ^ this function replaces Qual_var in ExtFORMULA
-> FORMULA f -> FORMULA f
replaceVarsF m = foldFormula . replaceVarsRec m | 199 | replaceVarsF m = foldFormula . replaceVarsRec m | 47 | true | true | 1 | 9 | 85 | 56 | 26 | 30 | null | null |
DougBurke/swish | tests/RDFGraphTest.hs | lgpl-2.1 | f23c = getFormula g1f22 s3 | 26 | f23c = getFormula g1f22 s3 | 26 | f23c = getFormula g1f22 s3 | 26 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
keera-studios/hsQt | extra-pkgs/Glome/Qt/Glome/TestScene.hs | bsd-2-clause | spiral = [ ((Vec ((sin (rot n))*n)
((cos (rot n))*n)
(n-3)), (n/15)) | n <- [0, 0.01..6]] | 125 | spiral = [ ((Vec ((sin (rot n))*n)
((cos (rot n))*n)
(n-3)), (n/15)) | n <- [0, 0.01..6]] | 125 | spiral = [ ((Vec ((sin (rot n))*n)
((cos (rot n))*n)
(n-3)), (n/15)) | n <- [0, 0.01..6]] | 125 | false | false | 1 | 15 | 52 | 97 | 51 | 46 | null | null |
badarshahzad/Learn-Haskell | Solution of Weekly labs/lab7.hs | mit | productlist [] = [] | 19 | productlist [] = [] | 19 | productlist [] = [] | 19 | false | false | 0 | 6 | 3 | 13 | 6 | 7 | null | null |
zeyuanxy/haskell-playground | write-yourself-a-scheme/chap3/main.hs | mit | showVal (Number contents) = show contents | 41 | showVal (Number contents) = show contents | 41 | showVal (Number contents) = show contents | 41 | false | false | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
rueshyna/gogol | gogol-people/gen/Network/Google/People/Types.hs | mpl-2.0 | -- | View your complete date of birth
userBirthdayReadScope :: Proxy '["https://www.googleapis.com/auth/user.birthday.read"]
userBirthdayReadScope = Proxy | 154 | userBirthdayReadScope :: Proxy '["https://www.googleapis.com/auth/user.birthday.read"]
userBirthdayReadScope = Proxy | 116 | userBirthdayReadScope = Proxy | 29 | true | true | 0 | 7 | 14 | 20 | 11 | 9 | null | null |
zachsully/hakaru | haskell/Language/Hakaru/Pretty/Haskell.hs | bsd-3-clause | prettyType s = error ("TODO: prettyType: " ++ show s) | 53 | prettyType s = error ("TODO: prettyType: " ++ show s) | 53 | prettyType s = error ("TODO: prettyType: " ++ show s) | 53 | false | false | 0 | 8 | 9 | 22 | 10 | 12 | null | null |
yliu120/K3 | src/Language/K3/Parser.hs | apache-2.0 | dEndpoint :: String -> String -> Bool -> K3Parser [K3 Declaration]
dEndpoint kind name isSource =
attachFirst (DSpan <->) =<< (namedIdentifier kind name $ join . rule . (mkEndpoint <$>))
where rule x = ruleError =<< (x <*> (colon *> typeExpr) <*> (symbol "=" *> (endpoint isSource)))
ruleError x = either unexpected pure x
(typeCstr, stateModifier) =
(if isSource then TC.source else TC.sink, trackEndpoint)
mkEndpoint n t endpointCstr = either Left (Right . mkDecls n t) $ endpointCstr n t
mkDecls n t (spec, eOpt, subDecls) = do
epDecl <- stateModifier spec $ DC.endpoint n (qualifyT $ typeCstr t) eOpt []
return $ epDecl:subDecls
qualifyT t = if null $ filter isTQualified $ annotations t then t @+ TImmutable else t
attachFirst _ [] = return []
attachFirst f (h:t) = f (return h) >>= return . (:t) | 904 | dEndpoint :: String -> String -> Bool -> K3Parser [K3 Declaration]
dEndpoint kind name isSource =
attachFirst (DSpan <->) =<< (namedIdentifier kind name $ join . rule . (mkEndpoint <$>))
where rule x = ruleError =<< (x <*> (colon *> typeExpr) <*> (symbol "=" *> (endpoint isSource)))
ruleError x = either unexpected pure x
(typeCstr, stateModifier) =
(if isSource then TC.source else TC.sink, trackEndpoint)
mkEndpoint n t endpointCstr = either Left (Right . mkDecls n t) $ endpointCstr n t
mkDecls n t (spec, eOpt, subDecls) = do
epDecl <- stateModifier spec $ DC.endpoint n (qualifyT $ typeCstr t) eOpt []
return $ epDecl:subDecls
qualifyT t = if null $ filter isTQualified $ annotations t then t @+ TImmutable else t
attachFirst _ [] = return []
attachFirst f (h:t) = f (return h) >>= return . (:t) | 904 | dEndpoint kind name isSource =
attachFirst (DSpan <->) =<< (namedIdentifier kind name $ join . rule . (mkEndpoint <$>))
where rule x = ruleError =<< (x <*> (colon *> typeExpr) <*> (symbol "=" *> (endpoint isSource)))
ruleError x = either unexpected pure x
(typeCstr, stateModifier) =
(if isSource then TC.source else TC.sink, trackEndpoint)
mkEndpoint n t endpointCstr = either Left (Right . mkDecls n t) $ endpointCstr n t
mkDecls n t (spec, eOpt, subDecls) = do
epDecl <- stateModifier spec $ DC.endpoint n (qualifyT $ typeCstr t) eOpt []
return $ epDecl:subDecls
qualifyT t = if null $ filter isTQualified $ annotations t then t @+ TImmutable else t
attachFirst _ [] = return []
attachFirst f (h:t) = f (return h) >>= return . (:t) | 837 | false | true | 7 | 14 | 240 | 361 | 185 | 176 | null | null |
hamaxx/unity-2d-for-xmonad | xmonad-files/DBus-0.4/dist/build/DBus/Shared.hs | gpl-3.0 | interfaceDBus, interfaceIntrospectable, interfaceLocal :: InterfaceName
serviceDBus = "org.freedesktop.DBus" | 108 | interfaceDBus, interfaceIntrospectable, interfaceLocal :: InterfaceName
serviceDBus = "org.freedesktop.DBus" | 108 | serviceDBus = "org.freedesktop.DBus" | 36 | false | true | 0 | 4 | 7 | 15 | 10 | 5 | null | null |
sinelaw/lamdu | Lamdu/Data/Expression/Infer.hs | gpl-3.0 | derefExpr ::
Expr.Expression def (Node def, a) -> Context def ->
Expr.Expression def (Inferred def, a)
derefExpr expr context =
expr <&> Lens._1 %~ derefNode context | 171 | derefExpr ::
Expr.Expression def (Node def, a) -> Context def ->
Expr.Expression def (Inferred def, a)
derefExpr expr context =
expr <&> Lens._1 %~ derefNode context | 171 | derefExpr expr context =
expr <&> Lens._1 %~ derefNode context | 64 | false | true | 0 | 9 | 31 | 72 | 35 | 37 | null | null |
travitch/llvm-analysis | src/LLVM/Analysis/Dominance.hs | bsd-3-clause | postdominatorsFor :: (HasPostdomTree t) => t -> Instruction -> [Instruction]
postdominatorsFor pt = getDominators t
where
PDT _ t = getPostdomTree pt
-- | Return the dominators (or postdominators) of the given
-- instruction, in order (with the nearest dominators at the beginning
-- of the list). Note that the instruction iself is not included
-- (every instruction trivially dominates itself). | 404 | postdominatorsFor :: (HasPostdomTree t) => t -> Instruction -> [Instruction]
postdominatorsFor pt = getDominators t
where
PDT _ t = getPostdomTree pt
-- | Return the dominators (or postdominators) of the given
-- instruction, in order (with the nearest dominators at the beginning
-- of the list). Note that the instruction iself is not included
-- (every instruction trivially dominates itself). | 404 | postdominatorsFor pt = getDominators t
where
PDT _ t = getPostdomTree pt
-- | Return the dominators (or postdominators) of the given
-- instruction, in order (with the nearest dominators at the beginning
-- of the list). Note that the instruction iself is not included
-- (every instruction trivially dominates itself). | 327 | false | true | 0 | 8 | 68 | 58 | 30 | 28 | null | null |
DavidAlphaFox/ghc | libraries/process/tests/process008.hs | bsd-3-clause | -- echo can't be run outside of the shell in MSYS, hence:
test = rawSystem "sh" ["-c","echo testing"] | 102 | test = rawSystem "sh" ["-c","echo testing"] | 43 | test = rawSystem "sh" ["-c","echo testing"] | 43 | true | false | 0 | 6 | 18 | 18 | 10 | 8 | null | null |
forsyde/forsyde-atom | src/ForSyDe/Atom/MoC/DE/React/Lib.hs | bsd-3-clause | toDE3 s1 s2 s3 = (toDE1 s1, toDE1 s2, toDE1 s3) | 47 | toDE3 s1 s2 s3 = (toDE1 s1, toDE1 s2, toDE1 s3) | 47 | toDE3 s1 s2 s3 = (toDE1 s1, toDE1 s2, toDE1 s3) | 47 | false | false | 0 | 6 | 10 | 31 | 15 | 16 | null | null |
bgamari/text | tests/Tests/Properties.hs | bsd-2-clause | tl_intersperse c = unsquare $
L.intersperse c `eqP` (unpackS . TL.intersperse c) | 101 | tl_intersperse c = unsquare $
L.intersperse c `eqP` (unpackS . TL.intersperse c) | 101 | tl_intersperse c = unsquare $
L.intersperse c `eqP` (unpackS . TL.intersperse c) | 101 | false | false | 0 | 9 | 32 | 36 | 18 | 18 | null | null |
acowley/ghc | compiler/utils/Encoding.hs | bsd-3-clause | encode_ch '_' = "zu" | 21 | encode_ch '_' = "zu" | 21 | encode_ch '_' = "zu" | 21 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
flipstone/orville | orville-postgresql/src/Database/Orville/PostgreSQL/Plan/Many.hs | mit | compose :: Many b c -> Many a b -> Many a c
compose manyBC manyAB =
fromKeys (keys manyAB) aToC
where
aToC a = do
b <- lookup a manyAB
lookup b manyBC
{-|
'keys' fetches the list of keys from a 'Many'. Note that is a list and not
a set. 'Many' preserves the order and duplication of any key values that were
in the key list at the time of construction.
-} | 390 | compose :: Many b c -> Many a b -> Many a c
compose manyBC manyAB =
fromKeys (keys manyAB) aToC
where
aToC a = do
b <- lookup a manyAB
lookup b manyBC
{-|
'keys' fetches the list of keys from a 'Many'. Note that is a list and not
a set. 'Many' preserves the order and duplication of any key values that were
in the key list at the time of construction.
-} | 390 | compose manyBC manyAB =
fromKeys (keys manyAB) aToC
where
aToC a = do
b <- lookup a manyAB
lookup b manyBC
{-|
'keys' fetches the list of keys from a 'Many'. Note that is a list and not
a set. 'Many' preserves the order and duplication of any key values that were
in the key list at the time of construction.
-} | 346 | false | true | 1 | 9 | 109 | 91 | 38 | 53 | null | null |
danr/dotfiles | xmonad/xmonad.hs | unlicense | -- want to have a Navigation2D that moves inside the
-- BSP layout, namely that it takes the window
-- in the direction, splits it, and puts the current window
-- in the other split.
--
-- this makes a lot of sense with multiple workspaces
navconf
= navigation2DP def
("n","h","t","s")
[("M-", windowGo),
("M-S-", windowSwap),
("M-C-", \x b -> do sendMessage SelectNode
windowGo x b
sendMessage MoveNode
)
--("M-C-", windowToScreen)
--("M-C-", \x b -> windowSwap x b >> windowGo (opp x) b)
]
True
$ defaults
where
opp U = D
opp D = U
opp R = L
opp L = R | 682 | navconf
= navigation2DP def
("n","h","t","s")
[("M-", windowGo),
("M-S-", windowSwap),
("M-C-", \x b -> do sendMessage SelectNode
windowGo x b
sendMessage MoveNode
)
--("M-C-", windowToScreen)
--("M-C-", \x b -> windowSwap x b >> windowGo (opp x) b)
]
True
$ defaults
where
opp U = D
opp D = U
opp R = L
opp L = R | 441 | navconf
= navigation2DP def
("n","h","t","s")
[("M-", windowGo),
("M-S-", windowSwap),
("M-C-", \x b -> do sendMessage SelectNode
windowGo x b
sendMessage MoveNode
)
--("M-C-", windowToScreen)
--("M-C-", \x b -> windowSwap x b >> windowGo (opp x) b)
]
True
$ defaults
where
opp U = D
opp D = U
opp R = L
opp L = R | 441 | true | false | 3 | 10 | 231 | 140 | 71 | 69 | null | null |
Courseography/courseography | app/Database/CourseQueries.hs | gpl-3.0 | getMeetingSection :: T.Text -> T.Text
getMeetingSection sec
| T.isPrefixOf "L" sec = T.append "LEC" sectCode
| T.isPrefixOf "T" sec = T.append "TUT" sectCode
| T.isPrefixOf "P" sec = T.append "PRA" sectCode
| otherwise = sec
where sectCode = T.tail sec | 283 | getMeetingSection :: T.Text -> T.Text
getMeetingSection sec
| T.isPrefixOf "L" sec = T.append "LEC" sectCode
| T.isPrefixOf "T" sec = T.append "TUT" sectCode
| T.isPrefixOf "P" sec = T.append "PRA" sectCode
| otherwise = sec
where sectCode = T.tail sec | 283 | getMeetingSection sec
| T.isPrefixOf "L" sec = T.append "LEC" sectCode
| T.isPrefixOf "T" sec = T.append "TUT" sectCode
| T.isPrefixOf "P" sec = T.append "PRA" sectCode
| otherwise = sec
where sectCode = T.tail sec | 245 | false | true | 0 | 9 | 70 | 109 | 49 | 60 | null | null |
christiaanb/ghc | compiler/basicTypes/IdInfo.hs | bsd-3-clause | seqDemandInfo :: Demand -> ()
seqDemandInfo dmd = seqDemand dmd | 63 | seqDemandInfo :: Demand -> ()
seqDemandInfo dmd = seqDemand dmd | 63 | seqDemandInfo dmd = seqDemand dmd | 33 | false | true | 0 | 6 | 9 | 23 | 11 | 12 | null | null |
ku00/h-book | src/Geometry/Cuboid.hs | bsd-3-clause | volume :: Float -> Float -> Float -> Float
volume a b c = rectArea a b * c | 74 | volume :: Float -> Float -> Float -> Float
volume a b c = rectArea a b * c | 74 | volume a b c = rectArea a b * c | 31 | false | true | 1 | 9 | 18 | 47 | 20 | 27 | null | null |
CulpaBS/wbBach | src/Futhark/CodeGen/ImpCode.hs | bsd-3-clause | functionsCalled (x :>>: y) = functionsCalled x <> functionsCalled y | 67 | functionsCalled (x :>>: y) = functionsCalled x <> functionsCalled y | 67 | functionsCalled (x :>>: y) = functionsCalled x <> functionsCalled y | 67 | false | false | 0 | 7 | 9 | 26 | 12 | 14 | null | null |
ysnrkdm/Hamlet | src/Eval.hs | mit | opennessCoef :: Int -> Coef
opennessCoef progress = 1.0 * [2.5, 2.5, 3.5, 3.5] !! coefIndex progress 16 | 103 | opennessCoef :: Int -> Coef
opennessCoef progress = 1.0 * [2.5, 2.5, 3.5, 3.5] !! coefIndex progress 16 | 103 | opennessCoef progress = 1.0 * [2.5, 2.5, 3.5, 3.5] !! coefIndex progress 16 | 75 | false | true | 0 | 7 | 17 | 43 | 23 | 20 | null | null |
emacsmirror/flycheck-haskell | get-cabal-configuration.hs | gpl-3.0 | benchmarkName' :: Benchmark -> FilePath
benchmarkName' =
# if defined(Cabal20OrLater)
unUnqualComponentName . benchmarkName
# else
benchmarkName | 152 | benchmarkName' :: Benchmark -> FilePath
benchmarkName' =
# if defined(Cabal20OrLater)
unUnqualComponentName . benchmarkName
# else
benchmarkName | 152 | benchmarkName' =
# if defined(Cabal20OrLater)
unUnqualComponentName . benchmarkName
# else
benchmarkName | 112 | false | true | 0 | 5 | 23 | 24 | 13 | 11 | null | null |
lenary/idris-erlang | src/IRTS/CodegenErlang.hs | bsd-3-clause | generateExternalPrim nm [_,h] | nm == sUN "prim__readFile" = return $ erlCallIRTS "read_file" [h] | 105 | generateExternalPrim nm [_,h] | nm == sUN "prim__readFile" = return $ erlCallIRTS "read_file" [h] | 105 | generateExternalPrim nm [_,h] | nm == sUN "prim__readFile" = return $ erlCallIRTS "read_file" [h] | 105 | false | false | 0 | 9 | 21 | 44 | 20 | 24 | null | null |
zohl/servant-auth-cookie | tests/Utils.hs | bsd-3-clause | cerealEncode' :: (Serialize a) => Proxy a -> PayloadWrapper a -> Tagged b ByteString
cerealEncode' _ = cerealEncode | 115 | cerealEncode' :: (Serialize a) => Proxy a -> PayloadWrapper a -> Tagged b ByteString
cerealEncode' _ = cerealEncode | 115 | cerealEncode' _ = cerealEncode | 30 | false | true | 0 | 8 | 17 | 42 | 20 | 22 | null | null |
GaloisInc/msf-haskell | src/MSF/Event/Prim.hs | bsd-3-clause | remSessionHandler :: ControlHandle -> HandlerRef -> IO ()
remSessionHandler cont ref = sendControlMsg cont (RemSessionHandler ref) | 130 | remSessionHandler :: ControlHandle -> HandlerRef -> IO ()
remSessionHandler cont ref = sendControlMsg cont (RemSessionHandler ref) | 130 | remSessionHandler cont ref = sendControlMsg cont (RemSessionHandler ref) | 72 | false | true | 0 | 8 | 15 | 40 | 19 | 21 | null | null |
portnov/xtt | XMonad/TimeTracker/Parser.hs | bsd-3-clause | binary name fun assoc = Infix (try (reservedOp name) >> return (\e1 e2 -> BinOp fun e1 e2)) assoc | 97 | binary name fun assoc = Infix (try (reservedOp name) >> return (\e1 e2 -> BinOp fun e1 e2)) assoc | 97 | binary name fun assoc = Infix (try (reservedOp name) >> return (\e1 e2 -> BinOp fun e1 e2)) assoc | 97 | false | false | 1 | 11 | 18 | 60 | 26 | 34 | null | null |
brendanhay/gogol | gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs | mpl-2.0 | -- | Etag of this resource.
vcEtag :: Lens' VideoCategory (Maybe Text)
vcEtag = lens _vcEtag (\ s a -> s{_vcEtag = a}) | 118 | vcEtag :: Lens' VideoCategory (Maybe Text)
vcEtag = lens _vcEtag (\ s a -> s{_vcEtag = a}) | 90 | vcEtag = lens _vcEtag (\ s a -> s{_vcEtag = a}) | 47 | true | true | 0 | 9 | 22 | 46 | 25 | 21 | null | null |
iblumenfeld/cryptol | src/Cryptol/Testing/Random.hs | bsd-3-clause | -- | Generate a random infinite stream value.
randomStream :: RandomGen g => Gen g -> Gen g
randomStream mkElem sz g =
let (g1,g2) = split g
in (VStream (unfoldr (Just . mkElem sz) g1), g2) | 193 | randomStream :: RandomGen g => Gen g -> Gen g
randomStream mkElem sz g =
let (g1,g2) = split g
in (VStream (unfoldr (Just . mkElem sz) g1), g2) | 147 | randomStream mkElem sz g =
let (g1,g2) = split g
in (VStream (unfoldr (Just . mkElem sz) g1), g2) | 101 | true | true | 0 | 14 | 40 | 90 | 42 | 48 | null | null |
zenhack/haskell-capnp | cmd/capnpc-haskell/Trans/NewToHaskell.hs | mit | defineParse typeName typeParams New.ParsedUnion{ variants } =
let tVars = toTVars typeParams
typ = Hs.TApp (tgName ["GH"] "Which") [Hs.TApp (Hs.TLName typeName) tVars]
in
[ Hs.DcInstance
{ ctx = paramsContext tVars
, typ = Hs.TApp (tgName ["C"] "Parse") [typ, Hs.TApp (tgName ["C"] "Parsed") [typ]]
, defs =
[ Hs.IdValue Hs.DfValue
{ name = "parse"
, params = [Hs.PVar "raw_"]
, value = Hs.EDo
[ Hs.DoBind "rawWhich_" $ Hs.EApp (egName ["GH"] "unionWhich") [euName "raw_"]
]
(Hs.ECase (euName "rawWhich_") $
[ let ctorName = Name.mkSub typeName variantName in
case fieldLocType of
C.VoidField ->
( puName (rawCtorName ctorName) [Hs.PVar "_"]
, Hs.EApp (eStd_ "pure") [Hs.ELName ctorName]
)
_ ->
( puName (rawCtorName ctorName) [Hs.PVar "rawArg_"]
, Hs.EFApp
(Hs.ELName ctorName)
[Hs.EApp (egName ["C"] "parse") [euName "rawArg_"]]
)
| (variantName, fieldLocType) <- variants
]
++
[ let ctorName = unknownVariant typeName in
( puName (rawCtorName ctorName) [Hs.PVar "tag_"]
, Hs.EApp
(eStd_ "pure")
[Hs.EApp (Hs.ELName ctorName) [euName "tag_"]]
)
]
)
}
]
}
] | 1,914 | defineParse typeName typeParams New.ParsedUnion{ variants } =
let tVars = toTVars typeParams
typ = Hs.TApp (tgName ["GH"] "Which") [Hs.TApp (Hs.TLName typeName) tVars]
in
[ Hs.DcInstance
{ ctx = paramsContext tVars
, typ = Hs.TApp (tgName ["C"] "Parse") [typ, Hs.TApp (tgName ["C"] "Parsed") [typ]]
, defs =
[ Hs.IdValue Hs.DfValue
{ name = "parse"
, params = [Hs.PVar "raw_"]
, value = Hs.EDo
[ Hs.DoBind "rawWhich_" $ Hs.EApp (egName ["GH"] "unionWhich") [euName "raw_"]
]
(Hs.ECase (euName "rawWhich_") $
[ let ctorName = Name.mkSub typeName variantName in
case fieldLocType of
C.VoidField ->
( puName (rawCtorName ctorName) [Hs.PVar "_"]
, Hs.EApp (eStd_ "pure") [Hs.ELName ctorName]
)
_ ->
( puName (rawCtorName ctorName) [Hs.PVar "rawArg_"]
, Hs.EFApp
(Hs.ELName ctorName)
[Hs.EApp (egName ["C"] "parse") [euName "rawArg_"]]
)
| (variantName, fieldLocType) <- variants
]
++
[ let ctorName = unknownVariant typeName in
( puName (rawCtorName ctorName) [Hs.PVar "tag_"]
, Hs.EApp
(eStd_ "pure")
[Hs.EApp (Hs.ELName ctorName) [euName "tag_"]]
)
]
)
}
]
}
] | 1,914 | defineParse typeName typeParams New.ParsedUnion{ variants } =
let tVars = toTVars typeParams
typ = Hs.TApp (tgName ["GH"] "Which") [Hs.TApp (Hs.TLName typeName) tVars]
in
[ Hs.DcInstance
{ ctx = paramsContext tVars
, typ = Hs.TApp (tgName ["C"] "Parse") [typ, Hs.TApp (tgName ["C"] "Parsed") [typ]]
, defs =
[ Hs.IdValue Hs.DfValue
{ name = "parse"
, params = [Hs.PVar "raw_"]
, value = Hs.EDo
[ Hs.DoBind "rawWhich_" $ Hs.EApp (egName ["GH"] "unionWhich") [euName "raw_"]
]
(Hs.ECase (euName "rawWhich_") $
[ let ctorName = Name.mkSub typeName variantName in
case fieldLocType of
C.VoidField ->
( puName (rawCtorName ctorName) [Hs.PVar "_"]
, Hs.EApp (eStd_ "pure") [Hs.ELName ctorName]
)
_ ->
( puName (rawCtorName ctorName) [Hs.PVar "rawArg_"]
, Hs.EFApp
(Hs.ELName ctorName)
[Hs.EApp (egName ["C"] "parse") [euName "rawArg_"]]
)
| (variantName, fieldLocType) <- variants
]
++
[ let ctorName = unknownVariant typeName in
( puName (rawCtorName ctorName) [Hs.PVar "tag_"]
, Hs.EApp
(eStd_ "pure")
[Hs.EApp (Hs.ELName ctorName) [euName "tag_"]]
)
]
)
}
]
}
] | 1,914 | false | false | 0 | 30 | 1,013 | 497 | 255 | 242 | null | null |
1HaskellADay/1HAD | exercises/HAD/Y2014/M03/D19/Exercise.hs | mit | -- $setup
-- >>> import Control.Applicative ((<*>))
-- >>> import Data.List (isInfixOf)
-- >>> import Test.QuickCheck
-- Level: Easy
-- Pointfree: yes
-- | mostRepeatedElem
-- Returns the element with the longest (consecutive) repetition and the
-- repetition number
-- If there are tie, the last most repeated element is returned
-- It returns error on empty string
--
-- Examples:
--
-- >>> mostRepeatedElem "hello world!"
-- ('l',2)
--
-- >>> mostRepeatedElem [1,1,2,2]
-- (2,2)
--
-- prop> (flip isInfixOf <*> uncurry (flip replicate) . mostRepeatedElem) . getNonEmpty
mostRepeatedElem :: Eq a => [a] -> (a,Int)
mostRepeatedElem = undefined | 649 | mostRepeatedElem :: Eq a => [a] -> (a,Int)
mostRepeatedElem = undefined | 71 | mostRepeatedElem = undefined | 28 | true | true | 0 | 9 | 104 | 59 | 39 | 20 | null | null |
ceefour/atomspace | tests/haskell/executionTestLib/src/OpenCog/Lib.hs | agpl-3.0 | someFunc :: Atom -> AtomSpace Atom
someFunc a = pure a | 54 | someFunc :: Atom -> AtomSpace Atom
someFunc a = pure a | 54 | someFunc a = pure a | 19 | false | true | 0 | 6 | 10 | 24 | 11 | 13 | null | null |
knrafto/bash-config | tests/Tests.hs | bsd-3-clause | runTest :: TestPair -> IO Result
runTest (TestPair _ s1 s2) = do
[e1, e2] <- mapM execute [s1, s2]
let msg = diff (parameters e1) (parameters e2)
return $ Result (null msg) msg
where
execute s = case Bash.interpret s emptyEnv of
Left e -> fail $ "execution failed: " ++ e
Right e -> return e | 326 | runTest :: TestPair -> IO Result
runTest (TestPair _ s1 s2) = do
[e1, e2] <- mapM execute [s1, s2]
let msg = diff (parameters e1) (parameters e2)
return $ Result (null msg) msg
where
execute s = case Bash.interpret s emptyEnv of
Left e -> fail $ "execution failed: " ++ e
Right e -> return e | 326 | runTest (TestPair _ s1 s2) = do
[e1, e2] <- mapM execute [s1, s2]
let msg = diff (parameters e1) (parameters e2)
return $ Result (null msg) msg
where
execute s = case Bash.interpret s emptyEnv of
Left e -> fail $ "execution failed: " ++ e
Right e -> return e | 293 | false | true | 0 | 12 | 92 | 149 | 71 | 78 | null | null |
arowM/ASPico | src/ASPico/Config.hs | mit | createConfig
:: (MonadBaseControl IO m, MonadIO m)
=> Environment
-> Port
-> DbPoolConnNum
-> DbPoolConnTimeout
-> DbHost
-> DbPort
-> DbUser
-> DbPass
-> DbDatabase
-> Host
-> Protocol
-> Maybe BaseUrl
-> m Config
createConfig env port dbConnNum dbConnTimeout dbHost dbPort dbUser dbPass dbDB host protocol pushUrl = do
httpManager <- liftIO $ newManager tlsManagerSettings
pool <- makePool dbConnNum dbConnTimeout dbHost dbPort dbUser dbPass dbDB
pure
Config
{ configEnv = env
, configHost = pack host
, configHttpManager = httpManager
, configPool = pool
, configPort = port
, configProtocol = pack protocol
, configPushUrl = pushUrl
} | 708 | createConfig
:: (MonadBaseControl IO m, MonadIO m)
=> Environment
-> Port
-> DbPoolConnNum
-> DbPoolConnTimeout
-> DbHost
-> DbPort
-> DbUser
-> DbPass
-> DbDatabase
-> Host
-> Protocol
-> Maybe BaseUrl
-> m Config
createConfig env port dbConnNum dbConnTimeout dbHost dbPort dbUser dbPass dbDB host protocol pushUrl = do
httpManager <- liftIO $ newManager tlsManagerSettings
pool <- makePool dbConnNum dbConnTimeout dbHost dbPort dbUser dbPass dbDB
pure
Config
{ configEnv = env
, configHost = pack host
, configHttpManager = httpManager
, configPool = pool
, configPort = port
, configProtocol = pack protocol
, configPushUrl = pushUrl
} | 708 | createConfig env port dbConnNum dbConnTimeout dbHost dbPort dbUser dbPass dbDB host protocol pushUrl = do
httpManager <- liftIO $ newManager tlsManagerSettings
pool <- makePool dbConnNum dbConnTimeout dbHost dbPort dbUser dbPass dbDB
pure
Config
{ configEnv = env
, configHost = pack host
, configHttpManager = httpManager
, configPool = pool
, configPort = port
, configProtocol = pack protocol
, configPushUrl = pushUrl
} | 465 | false | true | 0 | 19 | 168 | 204 | 103 | 101 | null | null |
tpsinnem/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | -- | Weaken a term by adding i to each de Bruijn index (i.e. lift it over i bindings)
weakenTm :: Int -> TT n -> TT n
weakenTm i t = wk i 0 t
where wk i min (V x) | x >= min = V (i + x)
wk i m (App s f a) = App s (wk i m f) (wk i m a)
wk i m (Bind x b sc) = Bind x (wkb i m b) (wk i (m + 1) sc)
wk i m t = t
wkb i m t = fmap (wk i m) t
-- | Weaken an environment so that all the de Bruijn indices are correct according
-- to the latest bound variable | 497 | weakenTm :: Int -> TT n -> TT n
weakenTm i t = wk i 0 t
where wk i min (V x) | x >= min = V (i + x)
wk i m (App s f a) = App s (wk i m f) (wk i m a)
wk i m (Bind x b sc) = Bind x (wkb i m b) (wk i (m + 1) sc)
wk i m t = t
wkb i m t = fmap (wk i m) t
-- | Weaken an environment so that all the de Bruijn indices are correct according
-- to the latest bound variable | 411 | weakenTm i t = wk i 0 t
where wk i min (V x) | x >= min = V (i + x)
wk i m (App s f a) = App s (wk i m f) (wk i m a)
wk i m (Bind x b sc) = Bind x (wkb i m b) (wk i (m + 1) sc)
wk i m t = t
wkb i m t = fmap (wk i m) t
-- | Weaken an environment so that all the de Bruijn indices are correct according
-- to the latest bound variable | 379 | true | true | 1 | 9 | 172 | 245 | 110 | 135 | null | null |
mhuesch/scheme_compiler | src/L1Tox64/Compile.hs | bsd-3-clause | assembleX (Xw R11) = "%r11" | 27 | assembleX (Xw R11) = "%r11" | 27 | assembleX (Xw R11) = "%r11" | 27 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
rcook/seahug-slides | snippets/as-patterns.hs | mit | noAsPattern :: [a] -> [a]
noAsPattern (x : xs) = (x : xs) | 57 | noAsPattern :: [a] -> [a]
noAsPattern (x : xs) = (x : xs) | 57 | noAsPattern (x : xs) = (x : xs) | 31 | false | true | 0 | 7 | 12 | 38 | 21 | 17 | null | null |
eryx67/haskell-libtorrent | src/Network/Libtorrent/Rss.hs | bsd-3-clause | getFeedItemUuid :: MonadIO m => FeedItem -> m Text
getFeedItemUuid ho =
liftIO . withPtr ho $ \hoPtr -> do
res <- fromPtr [CU.exp| string * { new std::string($(feed_item * hoPtr)->uuid) } |]
stdStringToText res | 217 | getFeedItemUuid :: MonadIO m => FeedItem -> m Text
getFeedItemUuid ho =
liftIO . withPtr ho $ \hoPtr -> do
res <- fromPtr [CU.exp| string * { new std::string($(feed_item * hoPtr)->uuid) } |]
stdStringToText res | 217 | getFeedItemUuid ho =
liftIO . withPtr ho $ \hoPtr -> do
res <- fromPtr [CU.exp| string * { new std::string($(feed_item * hoPtr)->uuid) } |]
stdStringToText res | 165 | false | true | 0 | 11 | 41 | 66 | 32 | 34 | null | null |
ekmett/unboxed-containers | Data/Set/Unboxed.hs | bsd-3-clause | hedgeUnion :: (US a, Ord a) => (a -> Ordering) -> (a -> Ordering) -> USet a -> USet a -> USet a
hedgeUnion _ _ t1 (null -> True) = t1 | 160 | hedgeUnion :: (US a, Ord a) => (a -> Ordering) -> (a -> Ordering) -> USet a -> USet a -> USet a
hedgeUnion _ _ t1 (null -> True) = t1 | 160 | hedgeUnion _ _ t1 (null -> True) = t1 | 64 | false | true | 0 | 13 | 58 | 86 | 42 | 44 | null | null |
Cordite-Studios/asteroid-core | src/Solar/Asteroid/Core/Valuable/Derive.hs | mit | simpleDeriveValuable :: Name -> Q [Dec]
simpleDeriveValuable name = do
readShow <- useReadShowInstance name
serialized <- useSerializeInstance name
aesonized <- useAesonInstance name
final <- [d|instance Valuable $(conT name) String where |]
return
$ readShow
<> serialized
<> aesonized
<> final | 349 | simpleDeriveValuable :: Name -> Q [Dec]
simpleDeriveValuable name = do
readShow <- useReadShowInstance name
serialized <- useSerializeInstance name
aesonized <- useAesonInstance name
final <- [d|instance Valuable $(conT name) String where |]
return
$ readShow
<> serialized
<> aesonized
<> final | 349 | simpleDeriveValuable name = do
readShow <- useReadShowInstance name
serialized <- useSerializeInstance name
aesonized <- useAesonInstance name
final <- [d|instance Valuable $(conT name) String where |]
return
$ readShow
<> serialized
<> aesonized
<> final | 309 | false | true | 0 | 10 | 93 | 84 | 40 | 44 | null | null |
MichaelXavier/Seraph | src/Seraph/Core.hs | bsd-2-clause | processDirectives :: TVar ViewState -> TQueue DownstreamMsg -> Directives -> IO ()
processDirectives vs out = void . launch
where
launch (Directives ds) = launchMany ds
launch (FinalDirectives ds) = launchMany ds >> liftIO exitSuccess
launchMany = mapConcurrently (runViewM vs . launchOne)
launchOne (SpawnProg p) = spawnProg' out p
launchOne (KillProg prid) = kill' out prid
------------------------------------------------------------------------------- | 507 | processDirectives :: TVar ViewState -> TQueue DownstreamMsg -> Directives -> IO ()
processDirectives vs out = void . launch
where
launch (Directives ds) = launchMany ds
launch (FinalDirectives ds) = launchMany ds >> liftIO exitSuccess
launchMany = mapConcurrently (runViewM vs . launchOne)
launchOne (SpawnProg p) = spawnProg' out p
launchOne (KillProg prid) = kill' out prid
------------------------------------------------------------------------------- | 507 | processDirectives vs out = void . launch
where
launch (Directives ds) = launchMany ds
launch (FinalDirectives ds) = launchMany ds >> liftIO exitSuccess
launchMany = mapConcurrently (runViewM vs . launchOne)
launchOne (SpawnProg p) = spawnProg' out p
launchOne (KillProg prid) = kill' out prid
------------------------------------------------------------------------------- | 424 | false | true | 0 | 10 | 108 | 152 | 69 | 83 | null | null |
HIPERFIT/futhark | src/Futhark/IR/Prop/Constants.hs | isc | constant :: IsValue v => v -> SubExp
constant = Constant . value | 64 | constant :: IsValue v => v -> SubExp
constant = Constant . value | 64 | constant = Constant . value | 27 | false | true | 0 | 6 | 12 | 26 | 13 | 13 | null | null |
ksaveljev/hake-2 | src/Game/GameSpawn.hs | bsd-3-clause | spViewThing :: EntThink
spViewThing =
GenericEntThink "SP_viewthing" $ \edictReference -> do
GameMisc.spViewThing edictReference
return True | 150 | spViewThing :: EntThink
spViewThing =
GenericEntThink "SP_viewthing" $ \edictReference -> do
GameMisc.spViewThing edictReference
return True | 150 | spViewThing =
GenericEntThink "SP_viewthing" $ \edictReference -> do
GameMisc.spViewThing edictReference
return True | 126 | false | true | 0 | 10 | 24 | 37 | 17 | 20 | null | null |
utwente-fmt/scoop | src/Linearise.hs | bsd-3-clause | makeSummand pc (Implication cond rhs) | correctSummations rhs cond = map (addImplication cond) (makeSummand pc rhs) | 123 | makeSummand pc (Implication cond rhs) | correctSummations rhs cond = map (addImplication cond) (makeSummand pc rhs) | 123 | makeSummand pc (Implication cond rhs) | correctSummations rhs cond = map (addImplication cond) (makeSummand pc rhs) | 123 | false | false | 0 | 8 | 23 | 49 | 22 | 27 | null | null |
marhop/droidsfmin | src/DroidSignatureFileFilter.hs | bsd-3-clause | listFileFormats xml = case parseXMLDoc xml of
Nothing -> error "Failed to parse signature file."
Just e -> map showFileFormat ffs
where
ffc = head $ findChildren (mkNm "FileFormatCollection") e
ffs = findChildren (mkNm "FileFormat") ffc
showFileFormat ff = intercalate "\t"
[ fromMaybe "" $ findAttr (unqual "PUID") ff
, fromMaybe "" $ findAttr (unqual "Name") ff
, fromMaybe "" $ findAttr (unqual "Version") ff
]
-- | Replace all content of an element by appending a list of elements as
-- children. | 618 | listFileFormats xml = case parseXMLDoc xml of
Nothing -> error "Failed to parse signature file."
Just e -> map showFileFormat ffs
where
ffc = head $ findChildren (mkNm "FileFormatCollection") e
ffs = findChildren (mkNm "FileFormat") ffc
showFileFormat ff = intercalate "\t"
[ fromMaybe "" $ findAttr (unqual "PUID") ff
, fromMaybe "" $ findAttr (unqual "Name") ff
, fromMaybe "" $ findAttr (unqual "Version") ff
]
-- | Replace all content of an element by appending a list of elements as
-- children. | 618 | listFileFormats xml = case parseXMLDoc xml of
Nothing -> error "Failed to parse signature file."
Just e -> map showFileFormat ffs
where
ffc = head $ findChildren (mkNm "FileFormatCollection") e
ffs = findChildren (mkNm "FileFormat") ffc
showFileFormat ff = intercalate "\t"
[ fromMaybe "" $ findAttr (unqual "PUID") ff
, fromMaybe "" $ findAttr (unqual "Name") ff
, fromMaybe "" $ findAttr (unqual "Version") ff
]
-- | Replace all content of an element by appending a list of elements as
-- children. | 618 | false | false | 0 | 15 | 200 | 155 | 74 | 81 | null | null |
fmapfmapfmap/amazonka | amazonka-iam/gen/Network/AWS/IAM/Types/Product.hs | mpl-2.0 | -- | A list of the inline policies embedded in the user.
udUserPolicyList :: Lens' UserDetail [PolicyDetail]
udUserPolicyList = lens _udUserPolicyList (\ s a -> s{_udUserPolicyList = a}) . _Default . _Coerce | 207 | udUserPolicyList :: Lens' UserDetail [PolicyDetail]
udUserPolicyList = lens _udUserPolicyList (\ s a -> s{_udUserPolicyList = a}) . _Default . _Coerce | 150 | udUserPolicyList = lens _udUserPolicyList (\ s a -> s{_udUserPolicyList = a}) . _Default . _Coerce | 98 | true | true | 0 | 11 | 31 | 51 | 28 | 23 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | mkTcReprEqPred :: TcType -> TcType -> Type
mkTcReprEqPred ty1 ty2
= mkTyConApp coercibleTyCon [k, ty1, ty2]
where
k = typeKind ty1
-- | Make an equality predicate at a given role. The role must not be Phantom. | 218 | mkTcReprEqPred :: TcType -> TcType -> Type
mkTcReprEqPred ty1 ty2
= mkTyConApp coercibleTyCon [k, ty1, ty2]
where
k = typeKind ty1
-- | Make an equality predicate at a given role. The role must not be Phantom. | 218 | mkTcReprEqPred ty1 ty2
= mkTyConApp coercibleTyCon [k, ty1, ty2]
where
k = typeKind ty1
-- | Make an equality predicate at a given role. The role must not be Phantom. | 175 | false | true | 0 | 6 | 45 | 50 | 26 | 24 | null | null |
ryota-ka/yo-slack-adapter | src/Web/YoSlackAdapter.hs | bsd-3-clause | textForYo (YoLink username link) = mconcat [":link: Yo Link from ", username, "\n", link] | 90 | textForYo (YoLink username link) = mconcat [":link: Yo Link from ", username, "\n", link] | 90 | textForYo (YoLink username link) = mconcat [":link: Yo Link from ", username, "\n", link] | 90 | false | false | 0 | 7 | 14 | 32 | 17 | 15 | null | null |
CarletonDevX/stalkernet-haskell | exe/Main.hs | mit | handler :: SomeException -> IO ()
handler e = do
hPutStrLn stderr $ "\nstalk crashed: " ++ displayException e
exitFailure
-- | Parse a person parser from command line argument | 184 | handler :: SomeException -> IO ()
handler e = do
hPutStrLn stderr $ "\nstalk crashed: " ++ displayException e
exitFailure
-- | Parse a person parser from command line argument | 184 | handler e = do
hPutStrLn stderr $ "\nstalk crashed: " ++ displayException e
exitFailure
-- | Parse a person parser from command line argument | 150 | false | true | 0 | 9 | 38 | 44 | 20 | 24 | null | null |
BeautifulDestinations/CV | CV/Features.hs | bsd-3-clause | -- | Extract Speeded Up Robust Features from an image.
getSURF :: SURFParams
-- ^ Method parameters. See `defaultSURFParams` and `mkSURFParams`
-> Image GrayScale D8
-- ^ Input GrayScale image
-> Maybe (Image GrayScale D8)
-- ^ Optional Binary mask image
-> [(C'CvSURFPoint,[Float])]
getSURF (SP params) image mask = unsafePerformIO $
withNewMemory $ \ptr_mem ->
withMask mask $ \ptr_mask ->
with nullPtr $ \ptr_ptr_keypoints ->
with nullPtr $ \ptr_ptr_descriptors ->
with params $ \ptr_params ->
withImage image $ \ptr_image -> do
ptr_keypoints' <- peek ptr_ptr_keypoints
c'wrapExtractSURF (castPtr ptr_image) ptr_mask ptr_ptr_keypoints
ptr_ptr_descriptors ptr_mem ptr_params 0
ptr_keypoints <- peek ptr_ptr_keypoints
ptr_descriptors <- peek ptr_ptr_descriptors
a <- cvSeqToList ptr_keypoints
b <- if c'CvSURFParams'extended params == 1
then do
es :: [FloatBlock128] <- cvSeqToList ptr_descriptors
return (map (\(FP128 e) -> e) es)
else do
es :: [FloatBlock64] <- cvSeqToList ptr_descriptors
return (map (\(FP64 e) -> e) es)
return (zip a b) | 1,253 | getSURF :: SURFParams
-- ^ Method parameters. See `defaultSURFParams` and `mkSURFParams`
-> Image GrayScale D8
-- ^ Input GrayScale image
-> Maybe (Image GrayScale D8)
-- ^ Optional Binary mask image
-> [(C'CvSURFPoint,[Float])]
getSURF (SP params) image mask = unsafePerformIO $
withNewMemory $ \ptr_mem ->
withMask mask $ \ptr_mask ->
with nullPtr $ \ptr_ptr_keypoints ->
with nullPtr $ \ptr_ptr_descriptors ->
with params $ \ptr_params ->
withImage image $ \ptr_image -> do
ptr_keypoints' <- peek ptr_ptr_keypoints
c'wrapExtractSURF (castPtr ptr_image) ptr_mask ptr_ptr_keypoints
ptr_ptr_descriptors ptr_mem ptr_params 0
ptr_keypoints <- peek ptr_ptr_keypoints
ptr_descriptors <- peek ptr_ptr_descriptors
a <- cvSeqToList ptr_keypoints
b <- if c'CvSURFParams'extended params == 1
then do
es :: [FloatBlock128] <- cvSeqToList ptr_descriptors
return (map (\(FP128 e) -> e) es)
else do
es :: [FloatBlock64] <- cvSeqToList ptr_descriptors
return (map (\(FP64 e) -> e) es)
return (zip a b) | 1,198 | getSURF (SP params) image mask = unsafePerformIO $
withNewMemory $ \ptr_mem ->
withMask mask $ \ptr_mask ->
with nullPtr $ \ptr_ptr_keypoints ->
with nullPtr $ \ptr_ptr_descriptors ->
with params $ \ptr_params ->
withImage image $ \ptr_image -> do
ptr_keypoints' <- peek ptr_ptr_keypoints
c'wrapExtractSURF (castPtr ptr_image) ptr_mask ptr_ptr_keypoints
ptr_ptr_descriptors ptr_mem ptr_params 0
ptr_keypoints <- peek ptr_ptr_keypoints
ptr_descriptors <- peek ptr_ptr_descriptors
a <- cvSeqToList ptr_keypoints
b <- if c'CvSURFParams'extended params == 1
then do
es :: [FloatBlock128] <- cvSeqToList ptr_descriptors
return (map (\(FP128 e) -> e) es)
else do
es :: [FloatBlock64] <- cvSeqToList ptr_descriptors
return (map (\(FP64 e) -> e) es)
return (zip a b) | 897 | true | true | 10 | 20 | 357 | 342 | 163 | 179 | null | null |
rlupton20/yampaTutorial | src/HelloEvent.hs | cc0-1.0 | main :: IO ()
main = yampaMain initialise (return Nothing) output waitTwo | 73 | main :: IO ()
main = yampaMain initialise (return Nothing) output waitTwo | 73 | main = yampaMain initialise (return Nothing) output waitTwo | 59 | false | true | 0 | 7 | 11 | 31 | 15 | 16 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.