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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
thomasjm/hrtree | Zora-1.1.18/Zora/List.hs | mit | -- | /O(n)/ Maps the given function over the list while keeping the original list. For example:
--
-- > map_keep chr [97..100] == [(97,'a'),(98,'b'),(99,'c'),(100,'d')]
map_keep :: (a -> b) -> [a] -> [(a, b)]
map_keep f l = zipWith (\a b -> (a, b)) l (map f l) | 261 | map_keep :: (a -> b) -> [a] -> [(a, b)]
map_keep f l = zipWith (\a b -> (a, b)) l (map f l) | 91 | map_keep f l = zipWith (\a b -> (a, b)) l (map f l) | 51 | true | true | 0 | 8 | 49 | 77 | 44 | 33 | null | null |
aufheben/lambda-arduino | Application.hs | mit | -- | The @main@ function for an executable running this site.
appMain :: IO ()
appMain = do
runOnBoard $ loop defUsbPort
-- Get the settings from all relevant sources
settings <- loadAppSettingsArgs
-- fall back to compile-time values, set to [] to require values at runtime
[configSettingsY... | 855 | appMain :: IO ()
appMain = do
runOnBoard $ loop defUsbPort
-- Get the settings from all relevant sources
settings <- loadAppSettingsArgs
-- fall back to compile-time values, set to [] to require values at runtime
[configSettingsYmlValue]
-- allow environment variables to override
... | 793 | appMain = do
runOnBoard $ loop defUsbPort
-- Get the settings from all relevant sources
settings <- loadAppSettingsArgs
-- fall back to compile-time values, set to [] to require values at runtime
[configSettingsYmlValue]
-- allow environment variables to override
useEnv
... | 776 | true | true | 0 | 9 | 176 | 85 | 43 | 42 | null | null |
leshchevds/ganeti | src/Ganeti/Ssconf.hs | bsd-2-clause | keyToFilename :: FilePath -- ^ Config path root
-> SSKey -- ^ Ssconf key
-> FilePath -- ^ Full file name
keyToFilename cfgpath key =
cfgpath </> sSFilePrefix ++ sSKeyToRaw key | 220 | keyToFilename :: FilePath -- ^ Config path root
-> SSKey -- ^ Ssconf key
-> FilePath
keyToFilename cfgpath key =
cfgpath </> sSFilePrefix ++ sSKeyToRaw key | 196 | keyToFilename cfgpath key =
cfgpath </> sSFilePrefix ++ sSKeyToRaw key | 72 | true | true | 0 | 6 | 75 | 38 | 20 | 18 | null | null |
anton-k/language-css | src/Language/Css/Build/Idents.hs | bsd-3-clause | -- | pre-wrap
preWrap :: Idents a => a
preWrap = ident "pre-wrap" | 65 | preWrap :: Idents a => a
preWrap = ident "pre-wrap" | 51 | preWrap = ident "pre-wrap" | 26 | true | true | 0 | 7 | 12 | 28 | 12 | 16 | null | null |
OS2World/DEV-UTIL-HUGS | libraries/Graphics/Rendering/OpenGL/GL/SavingState.hs | bsd-3-clause | marshalServerAttributeGroup :: ServerAttributeGroup -> GLbitfield
marshalServerAttributeGroup x = case x of
CurrentAttributes -> 0x1
PointAttributes -> 0x2
LineAttributes -> 0x4
PolygonAttributes -> 0x8
PolygonStippleAttributes -> 0x10
PixelModeAttributes -> 0x20
LightingAttributes -> 0x40
FogAt... | 877 | marshalServerAttributeGroup :: ServerAttributeGroup -> GLbitfield
marshalServerAttributeGroup x = case x of
CurrentAttributes -> 0x1
PointAttributes -> 0x2
LineAttributes -> 0x4
PolygonAttributes -> 0x8
PolygonStippleAttributes -> 0x10
PixelModeAttributes -> 0x20
LightingAttributes -> 0x40
FogAt... | 877 | marshalServerAttributeGroup x = case x of
CurrentAttributes -> 0x1
PointAttributes -> 0x2
LineAttributes -> 0x4
PolygonAttributes -> 0x8
PolygonStippleAttributes -> 0x10
PixelModeAttributes -> 0x20
LightingAttributes -> 0x40
FogAttributes -> 0x80
DepthBufferAttributes -> 0x100
AccumBufferA... | 811 | false | true | 0 | 7 | 144 | 155 | 78 | 77 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Layout/Minimize.hs | bsd-2-clause | setNotMinimized :: Window -> X ()
setNotMinimized win = setMinimizedState win normalState delete | 96 | setNotMinimized :: Window -> X ()
setNotMinimized win = setMinimizedState win normalState delete | 96 | setNotMinimized win = setMinimizedState win normalState delete | 62 | false | true | 0 | 7 | 12 | 30 | 14 | 16 | null | null |
jbracker/supermonad-plugin | examples/monad/hmtc/original/CodeGenerator.hs | bsd-3-clause | elaborateDecl majl env (DeclFun {dfFun = f, dfArgs = as, dfBody = e}) =
divert $ do
let fn = lookupLbl f env
emit (Label fn)
let (env', n) = extendEnvArgs env as
evaluate (majl + 1) env' e
emit (RETURN (sizeOf (retType (itmsType f))) n) | 281 | elaborateDecl majl env (DeclFun {dfFun = f, dfArgs = as, dfBody = e}) =
divert $ do
let fn = lookupLbl f env
emit (Label fn)
let (env', n) = extendEnvArgs env as
evaluate (majl + 1) env' e
emit (RETURN (sizeOf (retType (itmsType f))) n) | 281 | elaborateDecl majl env (DeclFun {dfFun = f, dfArgs = as, dfBody = e}) =
divert $ do
let fn = lookupLbl f env
emit (Label fn)
let (env', n) = extendEnvArgs env as
evaluate (majl + 1) env' e
emit (RETURN (sizeOf (retType (itmsType f))) n) | 281 | false | false | 0 | 16 | 90 | 137 | 67 | 70 | null | null |
romildo/hprettybox | src/Text/PrettyPrint/Box.hs | bsd-3-clause | char :: Char -> Box
char x = Box [[x]] | 38 | char :: Char -> Box
char x = Box [[x]] | 38 | char x = Box [[x]] | 18 | false | true | 0 | 7 | 9 | 27 | 14 | 13 | null | null |
ComputationWithBoundedResources/tct-hoca | src/Tct/Hoca/Strategies.hs | bsd-3-clause | -- * Derived Strategies
mlToATRS :: Maybe String -> Strategy ML ATRS
mlToATRS maybeFunName = desugar maybeFunName .>>> defunctionalize | 135 | mlToATRS :: Maybe String -> Strategy ML ATRS
mlToATRS maybeFunName = desugar maybeFunName .>>> defunctionalize | 110 | mlToATRS maybeFunName = desugar maybeFunName .>>> defunctionalize | 65 | true | true | 0 | 6 | 19 | 34 | 16 | 18 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Unit.hs | mit | supplyRequired ProtossArbiterTribunal = 0 | 41 | supplyRequired ProtossArbiterTribunal = 0 | 41 | supplyRequired ProtossArbiterTribunal = 0 | 41 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
coreyoconnor/bind-marshal | test/verify_bind_rules_proto_2.hs | bsd-3-clause | t_23_sub = (incr_m `bind` incr_m)
`bind` (zab ( fixed_block (incr_m `bind` zab (fixed_block incr_m)) )
) | 121 | t_23_sub = (incr_m `bind` incr_m)
`bind` (zab ( fixed_block (incr_m `bind` zab (fixed_block incr_m)) )
) | 121 | t_23_sub = (incr_m `bind` incr_m)
`bind` (zab ( fixed_block (incr_m `bind` zab (fixed_block incr_m)) )
) | 121 | false | false | 0 | 14 | 32 | 51 | 29 | 22 | null | null |
m-alvarez/jhc | src/Fixer/VMap.hs | mit | vmapArg :: (Ord p,Ord n,Show p,Show n) => n -> Int -> VMap p n -> VMap p n
vmapArg n i vm@VMap { vmapArgs = map } = case Map.lookup (n,i) map of
Just x -> x `lub` vmapProxyIndirect i vm
Nothing -> vmapProxyIndirect i vm | 228 | vmapArg :: (Ord p,Ord n,Show p,Show n) => n -> Int -> VMap p n -> VMap p n
vmapArg n i vm@VMap { vmapArgs = map } = case Map.lookup (n,i) map of
Just x -> x `lub` vmapProxyIndirect i vm
Nothing -> vmapProxyIndirect i vm | 228 | vmapArg n i vm@VMap { vmapArgs = map } = case Map.lookup (n,i) map of
Just x -> x `lub` vmapProxyIndirect i vm
Nothing -> vmapProxyIndirect i vm | 153 | false | true | 1 | 10 | 55 | 139 | 66 | 73 | null | null |
marklar/elm-fun | BTree/Tree/Zipper.hs | mit | goRight :: Zipper a -> Maybe (Zipper a)
goRight (Empty, _) = Nothing | 68 | goRight :: Zipper a -> Maybe (Zipper a)
goRight (Empty, _) = Nothing | 68 | goRight (Empty, _) = Nothing | 28 | false | true | 0 | 8 | 12 | 36 | 18 | 18 | null | null |
ribag/ganeti-experiments | src/Ganeti/Query/Node.hs | gpl-2.0 | nodeLiveFieldExtract "mfree" res =
jsonHead (rpcResNodeInfoHvInfo res) hvInfoMemoryFree | 89 | nodeLiveFieldExtract "mfree" res =
jsonHead (rpcResNodeInfoHvInfo res) hvInfoMemoryFree | 89 | nodeLiveFieldExtract "mfree" res =
jsonHead (rpcResNodeInfoHvInfo res) hvInfoMemoryFree | 89 | false | false | 0 | 7 | 9 | 22 | 10 | 12 | null | null |
kvelicka/frag | src/Main.hs | gpl-2.0 | coalesce :: OGLInput -> WinInput
coalesce Nothing = NoEvent | 59 | coalesce :: OGLInput -> WinInput
coalesce Nothing = NoEvent | 59 | coalesce Nothing = NoEvent | 26 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
bos/criterion | Criterion/Analysis.hs | bsd-2-clause | singleton _ = False | 21 | singleton _ = False | 21 | singleton _ = False | 21 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
brendanhay/gogol | gogol-safebrowsing/gen/Network/Google/SafeBrowsing/Types/Product.hs | mpl-2.0 | -- | Referrer of the resource. Only set if the referrer is available.
gssvthtsReferrer :: Lens' GoogleSecuritySafebrowsingV4ThreatHitThreatSource (Maybe Text)
gssvthtsReferrer
= lens _gssvthtsReferrer
(\ s a -> s{_gssvthtsReferrer = a}) | 244 | gssvthtsReferrer :: Lens' GoogleSecuritySafebrowsingV4ThreatHitThreatSource (Maybe Text)
gssvthtsReferrer
= lens _gssvthtsReferrer
(\ s a -> s{_gssvthtsReferrer = a}) | 174 | gssvthtsReferrer
= lens _gssvthtsReferrer
(\ s a -> s{_gssvthtsReferrer = a}) | 85 | true | true | 0 | 8 | 37 | 49 | 25 | 24 | null | null |
geocurnoff/nikki | src/Base/Configuration/Controls.hs | lgpl-3.0 | -- * game
isGameLeftHeld, isGameRightHeld, isGameJumpHeld :: Controls -> ControlData -> Bool
isGameLeftHeld controls = fany (isKeyWS (controls ^. leftKey)) . held | 163 | isGameLeftHeld, isGameRightHeld, isGameJumpHeld :: Controls -> ControlData -> Bool
isGameLeftHeld controls = fany (isKeyWS (controls ^. leftKey)) . held | 152 | isGameLeftHeld controls = fany (isKeyWS (controls ^. leftKey)) . held | 69 | true | true | 0 | 10 | 22 | 47 | 26 | 21 | null | null |
li-zhirui/EoplLangs | test/ImplicitRefsCont/ParserSuite.hs | bsd-3-clause | testUnaryOpExpr :: Test
testUnaryOpExpr = TestList
[ testEq "Parse isZero expression (no space)"
(UnaryOpExpr IsZero (constNum 1)) "zero?(1)"
, testEq "Parse isZero expression (with space)"
(UnaryOpExpr IsZero (constNum 3)) "zero? ( 3 )"
, testEq "Parse minus expression"
(UnaryOp... | 359 | testUnaryOpExpr :: Test
testUnaryOpExpr = TestList
[ testEq "Parse isZero expression (no space)"
(UnaryOpExpr IsZero (constNum 1)) "zero?(1)"
, testEq "Parse isZero expression (with space)"
(UnaryOpExpr IsZero (constNum 3)) "zero? ( 3 )"
, testEq "Parse minus expression"
(UnaryOp... | 359 | testUnaryOpExpr = TestList
[ testEq "Parse isZero expression (no space)"
(UnaryOpExpr IsZero (constNum 1)) "zero?(1)"
, testEq "Parse isZero expression (with space)"
(UnaryOpExpr IsZero (constNum 3)) "zero? ( 3 )"
, testEq "Parse minus expression"
(UnaryOpExpr Minus (constNum 1))... | 335 | false | true | 0 | 10 | 85 | 86 | 43 | 43 | null | null |
markus1189/xmonad-contrib-710 | XMonad/Util/Run.hs | bsd-3-clause | {- | 'safeSpawn' bypasses 'spawn', because spawn passes
strings to \/bin\/sh to be interpreted as shell commands. This is
often what one wants, but in many cases the passed string will contain
shell metacharacters which one does not want interpreted as such (URLs
particularly often have shell metacharacters like \'&\' ... | 1,398 | safeSpawn :: MonadIO m => FilePath -> [String] -> m ()
safeSpawn prog args = io $ void_ $ forkProcess $ do
uninstallSignalHandlers
_ <- createSession
executeFile (encodeString prog) True (map encodeString args) Nothing
where void_ = (>> return ()) -- TODO: replace with Control.Monad.void / void not in ghc6 ap... | 453 | safeSpawn prog args = io $ void_ $ forkProcess $ do
uninstallSignalHandlers
_ <- createSession
executeFile (encodeString prog) True (map encodeString args) Nothing
where void_ = (>> return ()) -- TODO: replace with Control.Monad.void / void not in ghc6 apparently
-- | Simplified 'safeSpawn'; only takes a pro... | 398 | true | true | 0 | 10 | 249 | 109 | 55 | 54 | null | null |
feliposz/learning-stuff | haskell/c9lectures-ch9-nim.hs | mit | isNumeric :: String -> Bool
isNumeric str = all isDigit str | 59 | isNumeric :: String -> Bool
isNumeric str = all isDigit str | 59 | isNumeric str = all isDigit str | 31 | false | true | 0 | 5 | 10 | 26 | 12 | 14 | null | null |
vincenthz/cryptonite | Crypto/PubKey/RSA/OAEP.hs | bsd-3-clause | encrypt :: (HashAlgorithm hash, MonadRandom m)
=> OAEPParams hash ByteString ByteString -- ^ OAEP params to use for encryption.
-> PublicKey -- ^ Public key.
-> ByteString -- ^ Message to encrypt
-> m (Either Error ByteString)
encrypt oaep pk msg = do
seed <- getRandomByte... | 520 | encrypt :: (HashAlgorithm hash, MonadRandom m)
=> OAEPParams hash ByteString ByteString -- ^ OAEP params to use for encryption.
-> PublicKey -- ^ Public key.
-> ByteString -- ^ Message to encrypt
-> m (Either Error ByteString)
encrypt oaep pk msg = do
seed <- getRandomByte... | 520 | encrypt oaep pk msg = do
seed <- getRandomBytes hashLen
return (encryptWithSeed seed oaep pk msg)
where
hashLen = hashDigestSize (oaepHash oaep)
-- | un-pad a OAEP encoded message.
--
-- It doesn't apply the RSA decryption primitive | 250 | false | true | 1 | 12 | 135 | 121 | 58 | 63 | null | null |
maciej-bendkowski/LCCLUtils | src/Memo.hs | mit | idx (Tree l _ r) k = case (k-1) `divMod` 2 of
(k', 0) -> idx l k'
(k', _) -> idx r k'
{-|
Natural numbers represented in an
infinite binary tree.
-} | 190 | idx (Tree l _ r) k = case (k-1) `divMod` 2 of
(k', 0) -> idx l k'
(k', _) -> idx r k'
{-|
Natural numbers represented in an
infinite binary tree.
-} | 190 | idx (Tree l _ r) k = case (k-1) `divMod` 2 of
(k', 0) -> idx l k'
(k', _) -> idx r k'
{-|
Natural numbers represented in an
infinite binary tree.
-} | 190 | false | false | 3 | 9 | 75 | 77 | 39 | 38 | null | null |
portnov/yaledger | YaLedger/Types/Ledger.hs | bsd-3-clause | plusDelta x (Decrease y) = x - y | 32 | plusDelta x (Decrease y) = x - y | 32 | plusDelta x (Decrease y) = x - y | 32 | false | false | 0 | 7 | 7 | 21 | 10 | 11 | null | null |
mzero/plush | src/Plush/Server/Utilities.hs | apache-2.0 | keyedApp :: (FromJSON a, ToJSON b) => String -> JsonApplication a b
-> JsonApplication (KeyedRequest a) b
keyedApp key jApp (KeyedRequest key' a) | key' == key = jApp a | 172 | keyedApp :: (FromJSON a, ToJSON b) => String -> JsonApplication a b
-> JsonApplication (KeyedRequest a) b
keyedApp key jApp (KeyedRequest key' a) | key' == key = jApp a | 172 | keyedApp key jApp (KeyedRequest key' a) | key' == key = jApp a | 62 | false | true | 0 | 11 | 33 | 82 | 38 | 44 | null | null |
madjestic/b1 | src/B1/Program/Chart/SideBar.hs | bsd-3-clause | dragFreelyOffset = slotHeight / 2 | 33 | dragFreelyOffset = slotHeight / 2 | 33 | dragFreelyOffset = slotHeight / 2 | 33 | false | false | 0 | 5 | 4 | 10 | 5 | 5 | null | null |
kim/amazonka | amazonka-workspaces/gen/Network/AWS/WorkSpaces/Types.hs | mpl-2.0 | -- | The identifier of the WorkSpace.
w1WorkspaceId :: Lens' Workspace (Maybe Text)
w1WorkspaceId = lens _w1WorkspaceId (\s a -> s { _w1WorkspaceId = a }) | 154 | w1WorkspaceId :: Lens' Workspace (Maybe Text)
w1WorkspaceId = lens _w1WorkspaceId (\s a -> s { _w1WorkspaceId = a }) | 116 | w1WorkspaceId = lens _w1WorkspaceId (\s a -> s { _w1WorkspaceId = a }) | 70 | true | true | 1 | 9 | 25 | 51 | 25 | 26 | null | null |
rumblesan/improviz | src/Language/Ast/Transformers/Globalise.hs | bsd-3-clause | globaliseLambda :: Set String -> Lambda -> Transformer Lambda
globaliseLambda newVars (Lambda args scope block) =
Lambda args scope <$> globaliseBlock newVars block | 166 | globaliseLambda :: Set String -> Lambda -> Transformer Lambda
globaliseLambda newVars (Lambda args scope block) =
Lambda args scope <$> globaliseBlock newVars block | 166 | globaliseLambda newVars (Lambda args scope block) =
Lambda args scope <$> globaliseBlock newVars block | 104 | false | true | 0 | 7 | 24 | 54 | 25 | 29 | null | null |
etu-fkti5301-bgu/alt-exam_automated_theorem_proving | src/Util/Parse/Parse.hs | bsd-3-clause | ommas :: Parser a -> Parser [a]
commas p = P.sepBy p Lex.comma
| 63 | commas :: Parser a -> Parser [a]
commas p = P.sepBy p Lex.comma | 63 | commas p = P.sepBy p Lex.comma | 30 | false | true | 0 | 7 | 13 | 36 | 17 | 19 | null | null |
orclev/concurrent-prime | main.hs | gpl-3.0 | primeCandidates :: IntType -- ^ Number to stop at
-> Producer IO IntType -- ^ Producer that generates the numbers
primeCandidates target = unfold (\a -> if a > target then Nothing else Just (a,a+2)) 3 | 230 | primeCandidates :: IntType -- ^ Number to stop at
-> Producer IO IntType
primeCandidates target = unfold (\a -> if a > target then Nothing else Just (a,a+2)) 3 | 188 | primeCandidates target = unfold (\a -> if a > target then Nothing else Just (a,a+2)) 3 | 86 | true | true | 0 | 11 | 65 | 63 | 34 | 29 | null | null |
csrhodes/pandoc | src/Text/Pandoc/Writers/DokuWiki.hs | gpl-2.0 | inlineListToDokuWiki :: WriterOptions -> [Inline] -> DokuWiki String
inlineListToDokuWiki opts lst =
concat <$> (mapM (inlineToDokuWiki opts) lst) | 148 | inlineListToDokuWiki :: WriterOptions -> [Inline] -> DokuWiki String
inlineListToDokuWiki opts lst =
concat <$> (mapM (inlineToDokuWiki opts) lst) | 148 | inlineListToDokuWiki opts lst =
concat <$> (mapM (inlineToDokuWiki opts) lst) | 79 | false | true | 0 | 9 | 19 | 48 | 24 | 24 | null | null |
rtfeldman/elm-package | src/Install/Solver.hs | bsd-3-clause | exploreConstraints :: [(N.Name, C.Constraint)] -> Explorer (Maybe S.Solution)
exploreConstraints constraints =
do maybeInitialPackages <- addConstraints Map.empty constraints
let initialPackages = maybe Map.empty id maybeInitialPackages
explorePackages Map.empty initialPackages | 293 | exploreConstraints :: [(N.Name, C.Constraint)] -> Explorer (Maybe S.Solution)
exploreConstraints constraints =
do maybeInitialPackages <- addConstraints Map.empty constraints
let initialPackages = maybe Map.empty id maybeInitialPackages
explorePackages Map.empty initialPackages | 293 | exploreConstraints constraints =
do maybeInitialPackages <- addConstraints Map.empty constraints
let initialPackages = maybe Map.empty id maybeInitialPackages
explorePackages Map.empty initialPackages | 215 | false | true | 0 | 12 | 41 | 89 | 41 | 48 | null | null |
sleexyz/syzygy | src/Live.hs | bsd-3-clause | mr :: (Functor f, Bifunctor g) => (b -> b) -> f (g a b) -> f (g a b)
mr = fmap . second | 87 | mr :: (Functor f, Bifunctor g) => (b -> b) -> f (g a b) -> f (g a b)
mr = fmap . second | 87 | mr = fmap . second | 18 | false | true | 0 | 10 | 24 | 67 | 34 | 33 | null | null |
jwiegley/ghc-release | libraries/Cabal/cabal-install/Distribution/Client/Init/Heuristics.hs | gpl-3.0 | emailEnv :: Enviro -> AuthorGuess
emailEnv env = (mempty, email)
where
email = maybeFlag "EMAIL" env | 106 | emailEnv :: Enviro -> AuthorGuess
emailEnv env = (mempty, email)
where
email = maybeFlag "EMAIL" env | 106 | emailEnv env = (mempty, email)
where
email = maybeFlag "EMAIL" env | 72 | false | true | 0 | 5 | 21 | 37 | 19 | 18 | null | null |
slpopejoy/fadno-braids | src/Fadno/Braids.hs | bsd-2-clause | -- | Apply a move at a location.
applyMove :: (Integral i, Braid a i, Braid b i) => Move a i -> Loc i -> b i -> MultiGen i
applyMove m@(Move _ m2) (Loc x y) =
clearMerge (toGens m2) x y (moveW m) (moveH m) . toGens | 219 | applyMove :: (Integral i, Braid a i, Braid b i) => Move a i -> Loc i -> b i -> MultiGen i
applyMove m@(Move _ m2) (Loc x y) =
clearMerge (toGens m2) x y (moveW m) (moveH m) . toGens | 186 | applyMove m@(Move _ m2) (Loc x y) =
clearMerge (toGens m2) x y (moveW m) (moveH m) . toGens | 96 | true | true | 0 | 9 | 54 | 120 | 59 | 61 | null | null |
notae/haskell-exercise | pack/MultiTypeMap.hs | bsd-3-clause | updateVar :: (Enum v) => Var v -> v -> State EvalState ()
updateVar var val = do
vs <- gets vars
modify $ \s -> s { vars = Map.insert (varId var) (fromEnum val) vs } | 169 | updateVar :: (Enum v) => Var v -> v -> State EvalState ()
updateVar var val = do
vs <- gets vars
modify $ \s -> s { vars = Map.insert (varId var) (fromEnum val) vs } | 169 | updateVar var val = do
vs <- gets vars
modify $ \s -> s { vars = Map.insert (varId var) (fromEnum val) vs } | 111 | false | true | 0 | 14 | 40 | 99 | 47 | 52 | null | null |
brenov/set | interpreter/Types.hs | mit | getIdName _ = error "Error: Name not found." | 44 | getIdName _ = error "Error: Name not found." | 44 | getIdName _ = error "Error: Name not found." | 44 | false | false | 0 | 5 | 7 | 12 | 5 | 7 | null | null |
alexander-at-github/eta | compiler/ETA/Specialise/Rules.hs | bsd-3-clause | roughTopNames :: [CoreExpr] -> [Maybe Name]
-- ^ Find the \"top\" free names of several expressions.
-- Such names are either:
--
-- 1. The function finally being applied to in an application chain
-- (if that name is a GlobalId: see "Var#globalvslocal"), or
--
-- 2. The 'TyCon' if the expression is a 'Type'
--
-- T... | 463 | roughTopNames :: [CoreExpr] -> [Maybe Name]
roughTopNames args = map roughTopName args | 86 | roughTopNames args = map roughTopName args | 42 | true | true | 0 | 7 | 88 | 42 | 26 | 16 | null | null |
JakeWheat/Chaos-2010 | Games/Chaos2010/Database/Spell_parts_to_cast_table.hs | bsd-3-clause | spell_parts_to_cast_table :: Table Spell_parts_to_cast_table
spell_parts_to_cast_table = baseTable "spell_parts_to_cast_table" | 126 | spell_parts_to_cast_table :: Table Spell_parts_to_cast_table
spell_parts_to_cast_table = baseTable "spell_parts_to_cast_table" | 126 | spell_parts_to_cast_table = baseTable "spell_parts_to_cast_table" | 65 | false | true | 1 | 5 | 7 | 20 | 8 | 12 | null | null |
beni55/cryptol | src/Cryptol/Prims/Eval.hs | bsd-3-clause | ccatV :: TValue -> TValue -> TValue -> Value -> Value -> Value
ccatV _front _back (isTBit -> True) (VWord (BV i x)) (VWord (BV j y)) =
VWord (BV (i + j) (shiftL x (fromInteger j) + y)) | 186 | ccatV :: TValue -> TValue -> TValue -> Value -> Value -> Value
ccatV _front _back (isTBit -> True) (VWord (BV i x)) (VWord (BV j y)) =
VWord (BV (i + j) (shiftL x (fromInteger j) + y)) | 186 | ccatV _front _back (isTBit -> True) (VWord (BV i x)) (VWord (BV j y)) =
VWord (BV (i + j) (shiftL x (fromInteger j) + y)) | 123 | false | true | 0 | 15 | 40 | 119 | 58 | 61 | null | null |
randen/haddock | haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | bsd-2-clause | ppInstances :: LinksInfo
-> InstOrigin DocName -> [DocInstance DocName]
-> Splice -> Unicode -> Qualification
-> Html
ppInstances links origin instances splice unicode qual
= subInstances qual instName links True (zipWith instDecl [1..] instances)
-- force Splice = True to use li... | 558 | ppInstances :: LinksInfo
-> InstOrigin DocName -> [DocInstance DocName]
-> Splice -> Unicode -> Qualification
-> Html
ppInstances links origin instances splice unicode qual
= subInstances qual instName links True (zipWith instDecl [1..] instances)
-- force Splice = True to use li... | 558 | ppInstances links origin instances splice unicode qual
= subInstances qual instName links True (zipWith instDecl [1..] instances)
-- force Splice = True to use line URLs
where
instName = getOccString origin
instDecl :: Int -> DocInstance DocName -> (SubDecl,Located DocName)
instDecl no (inst, mdoc, lo... | 404 | false | true | 1 | 12 | 135 | 183 | 87 | 96 | null | null |
exercism/xhaskell | exercises/practice/armstrong-numbers/test/Tests.hs | mit | cases :: [Case]
cases = [ Case { description = "Zero is an Armstrong numbers"
, input = 0
, expected = True
}
, Case { description = "Single digit numbers are Armstrong numbers"
, input = 5
, expected = True
... | 1,527 | cases :: [Case]
cases = [ Case { description = "Zero is an Armstrong numbers"
, input = 0
, expected = True
}
, Case { description = "Single digit numbers are Armstrong numbers"
, input = 5
, expected = True
... | 1,527 | cases = [ Case { description = "Zero is an Armstrong numbers"
, input = 0
, expected = True
}
, Case { description = "Single digit numbers are Armstrong numbers"
, input = 5
, expected = True
}
,... | 1,511 | false | true | 0 | 8 | 759 | 228 | 144 | 84 | null | null |
facebook/flipper | scripts/bump/bump.hs | mit | unversion (Version v) = v | 25 | unversion (Version v) = v | 25 | unversion (Version v) = v | 25 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
et4te/zero | src/Zero/SRP/Client.hs | bsd-3-clause | nsize :: Int64
nsize = L8.length (encode n') | 44 | nsize :: Int64
nsize = L8.length (encode n') | 44 | nsize = L8.length (encode n') | 29 | false | true | 0 | 7 | 7 | 22 | 11 | 11 | null | null |
thalerjonathan/phd | coding/prototyping/haskell/art/src/ARTRendering.hs | gpl-3.0 | drawCircleAt :: Float -> Float -> Float -> GLO.Picture
drawCircleAt x y r = GLO.translate x y $ GLO.Circle r | 108 | drawCircleAt :: Float -> Float -> Float -> GLO.Picture
drawCircleAt x y r = GLO.translate x y $ GLO.Circle r | 108 | drawCircleAt x y r = GLO.translate x y $ GLO.Circle r | 53 | false | true | 0 | 8 | 19 | 48 | 23 | 25 | null | null |
yemi/grodan | server/Main.hs | bsd-3-clause | main :: IO ()
main = do
putStrLn "Running on 8080"
run 8080 app | 67 | main :: IO ()
main = do
putStrLn "Running on 8080"
run 8080 app | 67 | main = do
putStrLn "Running on 8080"
run 8080 app | 53 | false | true | 0 | 7 | 17 | 30 | 13 | 17 | null | null |
ksoda/scheme48 | src/Lib.hs | bsd-3-clause | eval val@(Number _) = return val | 32 | eval val@(Number _) = return val | 32 | eval val@(Number _) = return val | 32 | false | false | 0 | 8 | 5 | 21 | 10 | 11 | null | null |
input-output-hk/cardano-sl | core/test/Test/Pos/Core/ExampleHelpers.hs | apache-2.0 | exampleScript :: Script
exampleScript = Script 601 (getBytes 4 32) | 66 | exampleScript :: Script
exampleScript = Script 601 (getBytes 4 32) | 66 | exampleScript = Script 601 (getBytes 4 32) | 42 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
pdownen/sequent-core | src/Language/SequentCore/Arity.hs | bsd-3-clause | etaInfoAbs (EtaVar v : eis) expr = Lam v (etaInfoAbs eis expr) | 62 | etaInfoAbs (EtaVar v : eis) expr = Lam v (etaInfoAbs eis expr) | 62 | etaInfoAbs (EtaVar v : eis) expr = Lam v (etaInfoAbs eis expr) | 62 | false | false | 1 | 8 | 11 | 36 | 16 | 20 | null | null |
alanz/Blobs | lib/DData/Map.hs | lgpl-2.1 | -- | /O(n+m)/.
-- The expression (@'union' t1 t2@) takes the left-biased union of @t1@ and @t2@.
-- It prefers @t1@ when duplicate keys are encountered, ie. (@union == unionWith const@).
-- The implementation uses the efficient /hedge-union/ algorithm.
union :: Ord k => Map k a -> Map k a -> Map k a
union Tip t2 = t2 | 320 | union :: Ord k => Map k a -> Map k a -> Map k a
union Tip t2 = t2 | 66 | union Tip t2 = t2 | 18 | true | true | 0 | 8 | 61 | 55 | 26 | 29 | null | null |
AlexeyRaga/eta | libraries/base/Foreign/Marshal/Alloc.hs | bsd-3-clause | allocaBytes :: Int -> (Ptr a -> IO b) -> IO b
allocaBytes (I# size) action = IO $ \ s0 ->
case newPinnedByteArray# size s0 of { (# s1, mbarr# #) ->
case unsafeFreezeByteArray# mbarr# s1 of { (# s2, barr# #) ->
let addr = Ptr (byteArrayContents# barr#) in
case action addr of { IO action' ->... | 428 | allocaBytes :: Int -> (Ptr a -> IO b) -> IO b
allocaBytes (I# size) action = IO $ \ s0 ->
case newPinnedByteArray# size s0 of { (# s1, mbarr# #) ->
case unsafeFreezeByteArray# mbarr# s1 of { (# s2, barr# #) ->
let addr = Ptr (byteArrayContents# barr#) in
case action addr of { IO action' ->... | 428 | allocaBytes (I# size) action = IO $ \ s0 ->
case newPinnedByteArray# size s0 of { (# s1, mbarr# #) ->
case unsafeFreezeByteArray# mbarr# s1 of { (# s2, barr# #) ->
let addr = Ptr (byteArrayContents# barr#) in
case action addr of { IO action' ->
case action' s2 of { (# s3, r #) ->... | 382 | false | true | 0 | 24 | 133 | 183 | 93 | 90 | null | null |
ekmett/doctest | test/PackageDBsSpec.hs | mit | spec :: Spec
spec = do
describe "getPackageDBsFromEnv" $ do
it "uses global and user when no env or sandboxing used" $
withCurrentDirectory "test" $ clearEnv $ do
dbs <- getPackageDBsFromEnv
dbs `shouldBe` PackageDBs True True []
it "respects GHC_PACKAGE_PATH" $
withCurrentDirector... | 1,710 | spec :: Spec
spec = do
describe "getPackageDBsFromEnv" $ do
it "uses global and user when no env or sandboxing used" $
withCurrentDirectory "test" $ clearEnv $ do
dbs <- getPackageDBsFromEnv
dbs `shouldBe` PackageDBs True True []
it "respects GHC_PACKAGE_PATH" $
withCurrentDirector... | 1,710 | spec = do
describe "getPackageDBsFromEnv" $ do
it "uses global and user when no env or sandboxing used" $
withCurrentDirectory "test" $ clearEnv $ do
dbs <- getPackageDBsFromEnv
dbs `shouldBe` PackageDBs True True []
it "respects GHC_PACKAGE_PATH" $
withCurrentDirectory "test" $ cl... | 1,697 | false | true | 0 | 16 | 372 | 446 | 219 | 227 | null | null |
ganeti/ganeti | src/Ganeti/Utils.hs | bsd-2-clause | exitIfEmpty s [] = exitErr s | 31 | exitIfEmpty s [] = exitErr s | 31 | exitIfEmpty s [] = exitErr s | 31 | false | false | 1 | 5 | 8 | 20 | 7 | 13 | null | null |
christiaanb/clash-compiler | clash-lib/src/CLaSH/Core/Pretty.hs | bsd-2-clause | pprForAll :: (Applicative m, LFresh m) => [TyVar] -> m Doc
pprForAll [] = return empty | 86 | pprForAll :: (Applicative m, LFresh m) => [TyVar] -> m Doc
pprForAll [] = return empty | 86 | pprForAll [] = return empty | 27 | false | true | 0 | 7 | 15 | 44 | 22 | 22 | null | null |
switchface/helm | src/Helm/Engine/SDL/Keyboard.hs | mit | mapKey Codes.KeycodeKP00 = Keypad00Key | 38 | mapKey Codes.KeycodeKP00 = Keypad00Key | 38 | mapKey Codes.KeycodeKP00 = Keypad00Key | 38 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
tfausak/autoexporter | source/library/Autoexporter.hs | mit | -- | Lists all of the entries in the given directory. Note that unlike
-- 'Directory.listDirectory' the results of calling this function will include
-- the original directory name.
listDirectory :: Depth -> FilePath -> IO [FilePath]
listDirectory depth = case depth of
DepthShallow -> listDirectoryShallow
DepthDeep... | 341 | listDirectory :: Depth -> FilePath -> IO [FilePath]
listDirectory depth = case depth of
DepthShallow -> listDirectoryShallow
DepthDeep -> listDirectoryDeep | 159 | listDirectory depth = case depth of
DepthShallow -> listDirectoryShallow
DepthDeep -> listDirectoryDeep | 107 | true | true | 2 | 8 | 52 | 50 | 25 | 25 | null | null |
tomahawkins/atom | Language/Atom/Language.hs | bsd-3-clause | phase' phType n atom' = do
(st, (g, a)) <- get
if (n >= gPeriod g)
then error $ "ERROR: phase " ++ show n ++ " must be less than the current period "
++ show (gPeriod g) ++ "."
else do put (st, (g { gPhase = phType n }, a))
r <- atom'
(st', (g', a')) <- get
... | 807 | phase' phType n atom' = do
(st, (g, a)) <- get
if (n >= gPeriod g)
then error $ "ERROR: phase " ++ show n ++ " must be less than the current period "
++ show (gPeriod g) ++ "."
else do put (st, (g { gPhase = phType n }, a))
r <- atom'
(st', (g', a')) <- get
... | 807 | phase' phType n atom' = do
(st, (g, a)) <- get
if (n >= gPeriod g)
then error $ "ERROR: phase " ++ show n ++ " must be less than the current period "
++ show (gPeriod g) ++ "."
else do put (st, (g { gPhase = phType n }, a))
r <- atom'
(st', (g', a')) <- get
... | 807 | false | false | 0 | 15 | 286 | 185 | 101 | 84 | null | null |
xmonad/xmonad-contrib | XMonad/Layout/ZoomRow.hs | bsd-3-clause | lookupBy f a (E a' r b : _) | f a a' = Just $ E a r b | 53 | lookupBy f a (E a' r b : _) | f a a' = Just $ E a r b | 53 | lookupBy f a (E a' r b : _) | f a a' = Just $ E a r b | 53 | false | false | 0 | 8 | 19 | 49 | 22 | 27 | null | null |
hmgibson23/kwikup | Maven.hs | apache-2.0 | dependencyParser :: Parser Dependency
dependencyParser = do
optional whitespace
p <- stringLiteral <* whitespace <* skipMany1 (char '%') <* whitespace
n <- stringLiteral <* whitespace <* skipMany1 (char '%') <* whitespace
v <- versionParser
return $ Dependency p n v | 277 | dependencyParser :: Parser Dependency
dependencyParser = do
optional whitespace
p <- stringLiteral <* whitespace <* skipMany1 (char '%') <* whitespace
n <- stringLiteral <* whitespace <* skipMany1 (char '%') <* whitespace
v <- versionParser
return $ Dependency p n v | 277 | dependencyParser = do
optional whitespace
p <- stringLiteral <* whitespace <* skipMany1 (char '%') <* whitespace
n <- stringLiteral <* whitespace <* skipMany1 (char '%') <* whitespace
v <- versionParser
return $ Dependency p n v | 239 | false | true | 0 | 12 | 50 | 97 | 44 | 53 | null | null |
crockeo/netwire-pong | src/Config.hs | mit | {-|
The render detail of the ball. The higher the value, the more triangle fans
are rendered to complete the circle. A minimum value of 4 (I think) is
required.
-}
renderDetail :: Float
renderDetail = 8 | 208 | renderDetail :: Float
renderDetail = 8 | 38 | renderDetail = 8 | 16 | true | true | 0 | 6 | 42 | 19 | 8 | 11 | null | null |
AndrewRademacher/wai | warp-tls/Network/Wai/Handler/WarpTLS.hs | mit | ----------------------------------------------------------------
getter :: TLS.TLSParams params => TLSSettings -> Socket -> params -> IO (IO (Connection, Transport), SockAddr)
getter tlsset@TLSSettings{..} sock params = do
(s, sa) <- accept sock
return (mkConn tlsset s params, sa) | 290 | getter :: TLS.TLSParams params => TLSSettings -> Socket -> params -> IO (IO (Connection, Transport), SockAddr)
getter tlsset@TLSSettings{..} sock params = do
(s, sa) <- accept sock
return (mkConn tlsset s params, sa) | 224 | getter tlsset@TLSSettings{..} sock params = do
(s, sa) <- accept sock
return (mkConn tlsset s params, sa) | 113 | true | true | 0 | 12 | 42 | 102 | 52 | 50 | null | null |
mkscrg/hashring | Data/HashRing.hs | bsd-2-clause | -- | @True@ if the ring is empty, @False@ otherwise.
null :: HashRing a -> Bool
null ring = S.null $ nodeSet ring | 113 | null :: HashRing a -> Bool
null ring = S.null $ nodeSet ring | 60 | null ring = S.null $ nodeSet ring | 33 | true | true | 2 | 7 | 22 | 37 | 16 | 21 | null | null |
nevrenato/HetsAlloy | OWL2/Parse.hs | gpl-2.0 | uriP :: CharParser st QName
uriP =
skips $ try $ checkWithUsing showQN uriQ $ \ q -> let p = namePrefix q in
if null p then notElem (localPart q) owlKeywords
else notElem p $ map (takeWhile (/= ':'))
$ colonKeywords
++ [ show d ++ e | d <- equivOrDisjointL, e <- [classesC, propertiesC]] | 310 | uriP :: CharParser st QName
uriP =
skips $ try $ checkWithUsing showQN uriQ $ \ q -> let p = namePrefix q in
if null p then notElem (localPart q) owlKeywords
else notElem p $ map (takeWhile (/= ':'))
$ colonKeywords
++ [ show d ++ e | d <- equivOrDisjointL, e <- [classesC, propertiesC]] | 310 | uriP =
skips $ try $ checkWithUsing showQN uriQ $ \ q -> let p = namePrefix q in
if null p then notElem (localPart q) owlKeywords
else notElem p $ map (takeWhile (/= ':'))
$ colonKeywords
++ [ show d ++ e | d <- equivOrDisjointL, e <- [classesC, propertiesC]] | 282 | false | true | 10 | 12 | 78 | 145 | 68 | 77 | null | null |
Peaker/lamdu | src/Lamdu/Sugar/Names/Add.hs | gpl-3.0 | p2tagName ::
Walk.IsUnambiguous -> MMap T.Tag Clash.Info ->
Annotated.Name -> Tag.TextsInLang -> Bool -> Tag.IsOperator ->
Pass2MakeNames i o Name
p2tagName u tagsBelow aName texts isAutoGen isOp =
TagName
<$> getTagText tag texts
<*> c
?? isAutoGen
?? isOp == Tag.IsAnOperator
<&> Na... | 507 | p2tagName ::
Walk.IsUnambiguous -> MMap T.Tag Clash.Info ->
Annotated.Name -> Tag.TextsInLang -> Bool -> Tag.IsOperator ->
Pass2MakeNames i o Name
p2tagName u tagsBelow aName texts isAutoGen isOp =
TagName
<$> getTagText tag texts
<*> c
?? isAutoGen
?? isOp == Tag.IsAnOperator
<&> Na... | 507 | p2tagName u tagsBelow aName texts isAutoGen isOp =
TagName
<$> getTagText tag texts
<*> c
?? isAutoGen
?? isOp == Tag.IsAnOperator
<&> NameTag
where
tag = aName ^. Annotated.tag
c = case u of
Walk.Unambiguous -> pure NoCollision
Walk.MayBeAmbiguous -> ... | 348 | false | true | 12 | 11 | 142 | 159 | 75 | 84 | null | null |
GaloisInc/saw-script | heapster-saw/src/Verifier/SAW/Heapster/archival/TypedCrucible.hs | bsd-3-clause | entryInfoBlockID :: BlockEntryInfo blocks ret args -> BlockID blocks args
entryInfoBlockID (BlockEntryInfo entryID _ _) = entryBlockID entryID | 142 | entryInfoBlockID :: BlockEntryInfo blocks ret args -> BlockID blocks args
entryInfoBlockID (BlockEntryInfo entryID _ _) = entryBlockID entryID | 142 | entryInfoBlockID (BlockEntryInfo entryID _ _) = entryBlockID entryID | 68 | false | true | 0 | 6 | 17 | 47 | 21 | 26 | null | null |
ihc/futhark | src/Futhark/Representation/Primitive.hs | isc | convOpType (SIToFP from to) = (IntType from, FloatType to) | 58 | convOpType (SIToFP from to) = (IntType from, FloatType to) | 58 | convOpType (SIToFP from to) = (IntType from, FloatType to) | 58 | false | false | 0 | 7 | 8 | 29 | 14 | 15 | null | null |
tabemann/amphibian | src/Network/IRC/Client/Amphibian/IRCConnection.hs | bsd-3-clause | -- | Run an unconnected IRC connection.
runUnconnected :: IRCConnection -> IRCConnectionData -> IO ()
runUnconnected outer ircConnection = do
let connection = ircConnectionConnection ircConnection
actionOrEvent <- atomically $ do
(Right <$> (readTQueue $ ircConnectionActionQueue outer)) `orElse`
(Left <$>... | 2,517 | runUnconnected :: IRCConnection -> IRCConnectionData -> IO ()
runUnconnected outer ircConnection = do
let connection = ircConnectionConnection ircConnection
actionOrEvent <- atomically $ do
(Right <$> (readTQueue $ ircConnectionActionQueue outer)) `orElse`
(Left <$> (recvConnection $ ircConnectionEventSub... | 2,477 | runUnconnected outer ircConnection = do
let connection = ircConnectionConnection ircConnection
actionOrEvent <- atomically $ do
(Right <$> (readTQueue $ ircConnectionActionQueue outer)) `orElse`
(Left <$> (recvConnection $ ircConnectionEventSub ircConnection))
ircConnection <- updateState ircConnection
... | 2,415 | true | true | 0 | 17 | 592 | 645 | 296 | 349 | null | null |
SwiftsNamesake/ElegantChess | IOUtil.hs | mit | makeConsoleInfo :: DWORD -> Handle -> IO (Either ConsoleInfo Handle)
makeConsoleInfo nStdHandle fallback
= do handle <- win32GetStdHandle nStdHandle
is_console <- is_a_console handle
let bufsize = 10000
if not is_console then return $ Right fallback
else do buf <- mallocBytes (sz... | 445 | makeConsoleInfo :: DWORD -> Handle -> IO (Either ConsoleInfo Handle)
makeConsoleInfo nStdHandle fallback
= do handle <- win32GetStdHandle nStdHandle
is_console <- is_a_console handle
let bufsize = 10000
if not is_console then return $ Right fallback
else do buf <- mallocBytes (sz... | 445 | makeConsoleInfo nStdHandle fallback
= do handle <- win32GetStdHandle nStdHandle
is_console <- is_a_console handle
let bufsize = 10000
if not is_console then return $ Right fallback
else do buf <- mallocBytes (szWChar * bufsize)
written <- malloc
... | 376 | false | true | 0 | 13 | 130 | 133 | 60 | 73 | null | null |
rueshyna/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/UserRolePermissionGroups/Get.hs | mpl-2.0 | -- | User profile ID associated with this request.
urpggProFileId :: Lens' UserRolePermissionGroupsGet Int64
urpggProFileId
= lens _urpggProFileId
(\ s a -> s{_urpggProFileId = a})
. _Coerce | 204 | urpggProFileId :: Lens' UserRolePermissionGroupsGet Int64
urpggProFileId
= lens _urpggProFileId
(\ s a -> s{_urpggProFileId = a})
. _Coerce | 153 | urpggProFileId
= lens _urpggProFileId
(\ s a -> s{_urpggProFileId = a})
. _Coerce | 95 | true | true | 0 | 10 | 40 | 46 | 24 | 22 | null | null |
dylanmc/cryptol | src/Cryptol/Parser/ParserUtils.hs | bsd-3-clause | exportDecl :: ExportType -> Decl -> TopDecl
exportDecl e d = Decl TopLevel { tlExport = e, tlValue = d } | 104 | exportDecl :: ExportType -> Decl -> TopDecl
exportDecl e d = Decl TopLevel { tlExport = e, tlValue = d } | 104 | exportDecl e d = Decl TopLevel { tlExport = e, tlValue = d } | 60 | false | true | 0 | 7 | 20 | 41 | 22 | 19 | null | null |
HanStolpo/NetVinylGLFW | Graphics/UI/GLFW/Vinyl/Callbacks.hs | mit | setCallBackGLFW :: forall c s m. (MonadIO m, CurryGLFW c)
=> (Maybe c -> IO()) -- The specific call back registration function
-> Lens' s [TplGLFW c] -- The lens allowing us to store the result
-> m (s -> m s) ... | 613 | setCallBackGLFW :: forall c s m. (MonadIO m, CurryGLFW c)
=> (Maybe c -> IO()) -- The specific call back registration function
-> Lens' s [TplGLFW c] -- The lens allowing us to store the result
-> m (s -> m s)
setCallBackGLFW... | 522 | setCallBackGLFW f l = do
-- Create the uncurried call back an the update function which are glued together
(cb, upd) <- glueCbGLFW l
-- set the call back
liftIO $ f (Just (curryGLFW cb))
return upd | 217 | true | true | 0 | 12 | 229 | 134 | 68 | 66 | null | null |
denibertovic/dummy-api | src/Dummy/Api/Api.hs | bsd-3-clause | getBoard :: Int64 -> AppM Board
getBoard bid = do
board <- runDb $ get (toSqlKey bid)
case board of
Nothing -> lift $ left err404
Just b -> return b | 189 | getBoard :: Int64 -> AppM Board
getBoard bid = do
board <- runDb $ get (toSqlKey bid)
case board of
Nothing -> lift $ left err404
Just b -> return b | 189 | getBoard bid = do
board <- runDb $ get (toSqlKey bid)
case board of
Nothing -> lift $ left err404
Just b -> return b | 157 | false | true | 0 | 11 | 71 | 73 | 33 | 40 | null | null |
tolysz/vector-algorithms | tests/properties/Properties.hs | bsd-3-clause | ixRanges :: Vector e -> Gen (Int, Int)
ixRanges vec = do i <- fmap (`mod` len) arbitrary
j <- fmap (`mod` len) arbitrary
return $ if i < j then (i, j) else (j, i)
where len = V.length vec | 224 | ixRanges :: Vector e -> Gen (Int, Int)
ixRanges vec = do i <- fmap (`mod` len) arbitrary
j <- fmap (`mod` len) arbitrary
return $ if i < j then (i, j) else (j, i)
where len = V.length vec | 224 | ixRanges vec = do i <- fmap (`mod` len) arbitrary
j <- fmap (`mod` len) arbitrary
return $ if i < j then (i, j) else (j, i)
where len = V.length vec | 185 | false | true | 1 | 9 | 77 | 118 | 60 | 58 | null | null |
triplepointfive/Youtan | app/Main.hs | bsd-3-clause | objectPair :: Parser Token ( String, JS )
objectPair = do
name <- _str <$> lexem ( satisfy isStr )
colon
val <- value
return ( name, val ) | 146 | objectPair :: Parser Token ( String, JS )
objectPair = do
name <- _str <$> lexem ( satisfy isStr )
colon
val <- value
return ( name, val ) | 146 | objectPair = do
name <- _str <$> lexem ( satisfy isStr )
colon
val <- value
return ( name, val ) | 104 | false | true | 0 | 11 | 36 | 64 | 31 | 33 | null | null |
marcellussiegburg/autotool | package-translator/Print_Packages.hs | gpl-2.0 | main = do
dflags <- defaultErrorHandler defaultFatalMessager defaultFlushOut $ do
runGhc (Just libdir) $ do
dflags <- getSessionDynFlags
setSessionDynFlags dflags
return dflags
ps <- readPackageConfigs dflags
putDoc $ vcat
[ text "module Package_Translator where"
, ... | 511 | main = do
dflags <- defaultErrorHandler defaultFatalMessager defaultFlushOut $ do
runGhc (Just libdir) $ do
dflags <- getSessionDynFlags
setSessionDynFlags dflags
return dflags
ps <- readPackageConfigs dflags
putDoc $ vcat
[ text "module Package_Translator where"
, ... | 511 | main = do
dflags <- defaultErrorHandler defaultFatalMessager defaultFlushOut $ do
runGhc (Just libdir) $ do
dflags <- getSessionDynFlags
setSessionDynFlags dflags
return dflags
ps <- readPackageConfigs dflags
putDoc $ vcat
[ text "module Package_Translator where"
, ... | 511 | false | false | 0 | 14 | 130 | 111 | 49 | 62 | null | null |
sinelaw/buildsome | src/BMake/User.hs | gpl-2.0 | memoIO :: Ord k => Cache k v -> (k -> IO v) -> k -> IO v
memoIO cache action k =
do
m <- readIORef cache
case Map.lookup k m of
Just v -> return v
Nothing ->
do
v <- action k
modifyIORef cache $ Map.insert k v
... | 338 | memoIO :: Ord k => Cache k v -> (k -> IO v) -> k -> IO v
memoIO cache action k =
do
m <- readIORef cache
case Map.lookup k m of
Just v -> return v
Nothing ->
do
v <- action k
modifyIORef cache $ Map.insert k v
... | 338 | memoIO cache action k =
do
m <- readIORef cache
case Map.lookup k m of
Just v -> return v
Nothing ->
do
v <- action k
modifyIORef cache $ Map.insert k v
return v | 281 | false | true | 0 | 14 | 172 | 130 | 57 | 73 | null | null |
pbl64k/CodeSprints | CodeSprint-2012-05-19-RocketFuel/RoulettePredictor/rp.simple.hs | bsd-2-clause | main = do
inp <- getLine
let (kstr, qstr) = span (/= ' ') inp
let k = read kstr
let q = read $ tail qstr
(putStrLn . show) $ (Data.List.foldl' (\x y -> (x + y) `mod` q) 0 $ take k (Data.List.map (`mod` q) winnum)) | 258 | main = do
inp <- getLine
let (kstr, qstr) = span (/= ' ') inp
let k = read kstr
let q = read $ tail qstr
(putStrLn . show) $ (Data.List.foldl' (\x y -> (x + y) `mod` q) 0 $ take k (Data.List.map (`mod` q) winnum)) | 258 | main = do
inp <- getLine
let (kstr, qstr) = span (/= ' ') inp
let k = read kstr
let q = read $ tail qstr
(putStrLn . show) $ (Data.List.foldl' (\x y -> (x + y) `mod` q) 0 $ take k (Data.List.map (`mod` q) winnum)) | 258 | false | false | 2 | 10 | 92 | 135 | 73 | 62 | null | null |
jvranish/TheExperiment | src/Language/TheExperiment/Parser/Statement.hs | bsd-3-clause | aForeignDef :: EParser ParsedDefinition
aForeignDef = liftM2p ForeignDef (reserved "foreign" >> lowerIdent) stringLiteral | 121 | aForeignDef :: EParser ParsedDefinition
aForeignDef = liftM2p ForeignDef (reserved "foreign" >> lowerIdent) stringLiteral | 121 | aForeignDef = liftM2p ForeignDef (reserved "foreign" >> lowerIdent) stringLiteral | 81 | false | true | 0 | 8 | 12 | 31 | 15 | 16 | null | null |
roberth/uu-helium | lib/simple/Maybe.hs | gpl-3.0 | mapMaybe :: (a -> Maybe b) -> [a] -> [b]
mapMaybe f = catMaybes . map f | 96 | mapMaybe :: (a -> Maybe b) -> [a] -> [b]
mapMaybe f = catMaybes . map f | 96 | mapMaybe f = catMaybes . map f | 42 | false | true | 0 | 8 | 41 | 45 | 23 | 22 | null | null |
EleDiaz/snake | Snake.hs | unlicense | -------------------------------------------------------------------------------
-- Impure ---------------------------------------------------------------------
main :: IO ()
main = do
vty <- mkVty def
key <- atomically $ newTVar (EvKey KBS [])
forkIO $ fix $ \x -> do
a <- nextEvent vty
atomically $ writ... | 1,033 | main :: IO ()
main = do
vty <- mkVty def
key <- atomically $ newTVar (EvKey KBS [])
forkIO $ fix $ \x -> do
a <- nextEvent vty
atomically $ writeTVar key a
x
let loop :: Game ()
loop = do
st <- get
unless (endGame st) $ do
liftIO $ threadDelay (speed st)
k... | 872 | main = do
vty <- mkVty def
key <- atomically $ newTVar (EvKey KBS [])
forkIO $ fix $ \x -> do
a <- nextEvent vty
atomically $ writeTVar key a
x
let loop :: Game ()
loop = do
st <- get
unless (endGame st) $ do
liftIO $ threadDelay (speed st)
k <- liftIO $ r... | 858 | true | true | 1 | 30 | 304 | 421 | 206 | 215 | null | null |
spechub/Hets | OWL2/ManchesterPrint.hs | gpl-2.0 | -- | Misc ListFrameBits
printMiscBit :: AS.Relation -> Annotations -> ListFrameBit -> Doc
printMiscBit r a lfb = case lfb of
ExpressionBit anl -> printMisc a printEquivOrDisjointClasses (AS.getED r) anl
ObjectBit anl -> printMisc a printEquivOrDisjointProp (AS.getED r) anl
DataBit anl -> printMisc a printEq... | 467 | printMiscBit :: AS.Relation -> Annotations -> ListFrameBit -> Doc
printMiscBit r a lfb = case lfb of
ExpressionBit anl -> printMisc a printEquivOrDisjointClasses (AS.getED r) anl
ObjectBit anl -> printMisc a printEquivOrDisjointProp (AS.getED r) anl
DataBit anl -> printMisc a printEquivOrDisjointProp (AS.ge... | 443 | printMiscBit r a lfb = case lfb of
ExpressionBit anl -> printMisc a printEquivOrDisjointClasses (AS.getED r) anl
ObjectBit anl -> printMisc a printEquivOrDisjointProp (AS.getED r) anl
DataBit anl -> printMisc a printEquivOrDisjointProp (AS.getED r) anl
IndividualSameOrDifferent anl ->
printMisc ... | 377 | true | true | 9 | 9 | 87 | 144 | 70 | 74 | null | null |
itsbruce/hackerrank | alg/warmup/compareTriplets.hs | unlicense | scoreN = zipWith score | 22 | scoreN = zipWith score | 22 | scoreN = zipWith score | 22 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
waterret/PlotWithGnu-haskell | src/Graphics/PlotWithGnu.hs | gpl-3.0 | viewEps :: FilePath -> IO ()
viewEps path = void . system $ "evince " ++ path ++ " &" | 85 | viewEps :: FilePath -> IO ()
viewEps path = void . system $ "evince " ++ path ++ " &" | 85 | viewEps path = void . system $ "evince " ++ path ++ " &" | 56 | false | true | 1 | 8 | 19 | 45 | 20 | 25 | null | null |
gridaphobe/ghc | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | pprInstr (BCC cond blockid) = hcat [
char '\t',
text "b",
pprCond cond,
char '\t',
ppr lbl
]
where lbl = mkAsmTempLabel (getUnique blockid) | 187 | pprInstr (BCC cond blockid) = hcat [
char '\t',
text "b",
pprCond cond,
char '\t',
ppr lbl
]
where lbl = mkAsmTempLabel (getUnique blockid) | 187 | pprInstr (BCC cond blockid) = hcat [
char '\t',
text "b",
pprCond cond,
char '\t',
ppr lbl
]
where lbl = mkAsmTempLabel (getUnique blockid) | 187 | false | false | 0 | 9 | 71 | 66 | 32 | 34 | null | null |
brendanhay/gogol | gogol-groups-settings/gen/Network/Google/GroupsSettings/Types/Product.hs | mpl-2.0 | -- | Enables the group to be included in the Global Address List. For more
-- information, see the help center. Possible values are: - true: Group is
-- included in the Global Address List. - false: Group is not included in
-- the Global Address List.
gIncludeInGlobalAddressList :: Lens' Groups (Maybe Text)
gIncludeInG... | 427 | gIncludeInGlobalAddressList :: Lens' Groups (Maybe Text)
gIncludeInGlobalAddressList
= lens _gIncludeInGlobalAddressList
(\ s a -> s{_gIncludeInGlobalAddressList = a}) | 175 | gIncludeInGlobalAddressList
= lens _gIncludeInGlobalAddressList
(\ s a -> s{_gIncludeInGlobalAddressList = a}) | 118 | true | true | 0 | 9 | 71 | 51 | 28 | 23 | null | null |
vwwv/easy-bitcoin | Network/EasyBitcoin/Transaction.hs | bsd-3-clause | -- | Verify a signature for a transaction input was done using an specific key.
checkSignatureAt :: (BlockNetwork net) => Tx net -- ^ Transaction to verify.
-> Outpoint -- ^ Reference the input within the transaction to be verified.
... | 927 | checkSignatureAt :: (BlockNetwork net) => Tx net -- ^ Transaction to verify.
-> Outpoint -- ^ Reference the input within the transaction to be verified.
-> Maybe (RedeemScript net) -- ^ In case of... | 847 | checkSignatureAt tx out fromInn (TxSignature sig sh) key = let msg = createMessage_ sh tx out $ maybe (Left key) Right fromInn
in checkSig msg sig (derivePublic key) | 226 | true | true | 0 | 14 | 440 | 135 | 66 | 69 | null | null |
kajigor/uKanren_transformations | src/CPD/LocalControl.hs | bsd-3-clause | bodies :: SldTree -> [[G S]]
bodies = leaves | 44 | bodies :: SldTree -> [[G S]]
bodies = leaves | 44 | bodies = leaves | 15 | false | true | 0 | 8 | 8 | 24 | 13 | 11 | null | null |
shayan-najd/HsParser | U/Pretty.hs | gpl-3.0 | aboveNest (TextBeside s sl p) g k q = textBeside_ s sl rest
where
!k1 = k - sl
rest = case p of
Empty -> nilAboveNest g k1 q
... | 362 | aboveNest (TextBeside s sl p) g k q = textBeside_ s sl rest
where
!k1 = k - sl
rest = case p of
Empty -> nilAboveNest g k1 q
... | 362 | aboveNest (TextBeside s sl p) g k q = textBeside_ s sl rest
where
!k1 = k - sl
rest = case p of
Empty -> nilAboveNest g k1 q
... | 362 | false | false | 0 | 10 | 250 | 82 | 39 | 43 | null | null |
shlevy/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | eqCanDischargeF _ _ = False | 50 | eqCanDischargeF _ _ = False | 50 | eqCanDischargeF _ _ = False | 50 | false | false | 1 | 5 | 27 | 12 | 5 | 7 | null | null |
mariefarrell/Hets | ExtModal/StatAna.hs | gpl-2.0 | getEFormPredToks :: EM_FORMULA -> Set.Set Token
getEFormPredToks ef = case ef of
PrefixForm _ f _ -> getFormPredToks f
UntilSince _ f1 f2 _ -> on Set.union getFormPredToks f1 f2
ModForm _ -> Set.empty | 212 | getEFormPredToks :: EM_FORMULA -> Set.Set Token
getEFormPredToks ef = case ef of
PrefixForm _ f _ -> getFormPredToks f
UntilSince _ f1 f2 _ -> on Set.union getFormPredToks f1 f2
ModForm _ -> Set.empty | 212 | getEFormPredToks ef = case ef of
PrefixForm _ f _ -> getFormPredToks f
UntilSince _ f1 f2 _ -> on Set.union getFormPredToks f1 f2
ModForm _ -> Set.empty | 164 | false | true | 0 | 9 | 45 | 85 | 38 | 47 | null | null |
chengzh2008/hpffp | src/ch28-BasicLibraries/stringText.hs | bsd-3-clause | dictWordsT :: IO T.Text
dictWordsT = TIO.readFile path | 54 | dictWordsT :: IO T.Text
dictWordsT = TIO.readFile path | 54 | dictWordsT = TIO.readFile path | 30 | false | true | 0 | 6 | 7 | 21 | 10 | 11 | null | null |
rueshyna/gogol | gogol-games-management/gen/Network/Google/GamesManagement/Types/Product.hs | mpl-2.0 | -- | The ID of an achievement for which player state has been updated.
arrDefinitionId :: Lens' AchievementResetResponse (Maybe Text)
arrDefinitionId
= lens _arrDefinitionId
(\ s a -> s{_arrDefinitionId = a}) | 216 | arrDefinitionId :: Lens' AchievementResetResponse (Maybe Text)
arrDefinitionId
= lens _arrDefinitionId
(\ s a -> s{_arrDefinitionId = a}) | 145 | arrDefinitionId
= lens _arrDefinitionId
(\ s a -> s{_arrDefinitionId = a}) | 82 | true | true | 0 | 9 | 38 | 48 | 25 | 23 | null | null |
trskop/verbosity | example/Main/Options.hs | bsd-3-clause | -- | Option for suppressing unnecessary output.
--
-- > -q, --quiet
-- > Quiet mode. Suppress normal diagnostic or result output.
quietFlag :: HasVerbosity a => Options.Parser (a -> a)
quietFlag = Options.flag id (setVerbosity Verbosity.Silent) $ mconcat
[ Options.long "quiet"
, Options.short 'q'
, Opti... | 393 | quietFlag :: HasVerbosity a => Options.Parser (a -> a)
quietFlag = Options.flag id (setVerbosity Verbosity.Silent) $ mconcat
[ Options.long "quiet"
, Options.short 'q'
, Options.help "Quiet mode. Suppress normal diagnostic or result output."
] | 259 | quietFlag = Options.flag id (setVerbosity Verbosity.Silent) $ mconcat
[ Options.long "quiet"
, Options.short 'q'
, Options.help "Quiet mode. Suppress normal diagnostic or result output."
] | 204 | true | true | 0 | 9 | 75 | 86 | 42 | 44 | null | null |
wxwxwwxxx/ghc | libraries/base/GHC/List.hs | bsd-3-clause | -- | 'scanr1' is a variant of 'scanr' that has no starting value argument.
scanr1 :: (a -> a -> a) -> [a] -> [a]
scanr1 _ [] = [] | 159 | scanr1 :: (a -> a -> a) -> [a] -> [a]
scanr1 _ [] = [] | 84 | scanr1 _ [] = [] | 29 | true | true | 0 | 9 | 59 | 52 | 26 | 26 | null | null |
NICTA/lets-lens | src/Lets/Lens.hs | bsd-3-clause | prism ::
(b -> t)
-> (s -> Either t a)
-> Prism s t a b
prism =
error "todo: prism" | 91 | prism ::
(b -> t)
-> (s -> Either t a)
-> Prism s t a b
prism =
error "todo: prism" | 91 | prism =
error "todo: prism" | 29 | false | true | 0 | 10 | 29 | 52 | 25 | 27 | null | null |
ghcjs/ghcjs | src/Gen2/Prim.hs | mit | genPrim _ _ XorIOp [r] [x,y] = PrimInline $ r |= x .^. y | 67 | genPrim _ _ XorIOp [r] [x,y] = PrimInline $ r |= x .^. y | 67 | genPrim _ _ XorIOp [r] [x,y] = PrimInline $ r |= x .^. y | 67 | false | false | 0 | 7 | 24 | 38 | 20 | 18 | null | null |
bionikspoon/playing-with-haskell---learnyouahaskell | functions.hs | mit | addVectors :: (Num a) => (a, a) -> (a, a) -> (a, a)
addVectors (x1, y1) (x2, y2) = (x1 + x2, y1 + y2) | 101 | addVectors :: (Num a) => (a, a) -> (a, a) -> (a, a)
addVectors (x1, y1) (x2, y2) = (x1 + x2, y1 + y2) | 101 | addVectors (x1, y1) (x2, y2) = (x1 + x2, y1 + y2) | 49 | false | true | 0 | 8 | 24 | 82 | 46 | 36 | null | null |
AlexanderPankiv/ghc | compiler/specialise/Rules.hs | bsd-3-clause | match renv subst (Cast e1 co1) (Cast e2 co2)
= do { subst1 <- match_co renv subst co1 co2
; match renv subst1 e1 e2 } | 128 | match renv subst (Cast e1 co1) (Cast e2 co2)
= do { subst1 <- match_co renv subst co1 co2
; match renv subst1 e1 e2 } | 128 | match renv subst (Cast e1 co1) (Cast e2 co2)
= do { subst1 <- match_co renv subst co1 co2
; match renv subst1 e1 e2 } | 128 | false | false | 0 | 8 | 36 | 66 | 30 | 36 | null | null |
evolutics/haskell-formatter | src/library/Language/Haskell/Formatter/Process/Formatter.hs | gpl-3.0 | checkedDetachComments ::
Formatter ->
Code.LocatableCommentableCode ->
Result.Result ExactCode.ExactCode
checkedDetachComments formatter
= transformNotes (detachComments formatter) message
where message = "Detaching the comments changed the cod... | 330 | checkedDetachComments ::
Formatter ->
Code.LocatableCommentableCode ->
Result.Result ExactCode.ExactCode
checkedDetachComments formatter
= transformNotes (detachComments formatter) message
where message = "Detaching the comments changed the cod... | 330 | checkedDetachComments formatter
= transformNotes (detachComments formatter) message
where message = "Detaching the comments changed the code itself." | 153 | false | true | 0 | 8 | 100 | 50 | 24 | 26 | null | null |
Sword-Smith/hfasto | src/AMD64RegAlloc.hs | mit | regAllocInst spillingRewrite vtable (AMD64.MUL rd rs rt) = do
rdRes <- mapReg vtable rd
rsRes <- mapReg vtable rs
rtRes <- mapReg vtable rt
let (pre1, pre2, post1) = spillWrap spillingRewrite vtable rd rs rt rdRes rsRes rtRes
incr
return $ pre1 ++ pre2 ++ [AMD64.MUL rdRes rsRes rtRes] ++ post1 | 306 | regAllocInst spillingRewrite vtable (AMD64.MUL rd rs rt) = do
rdRes <- mapReg vtable rd
rsRes <- mapReg vtable rs
rtRes <- mapReg vtable rt
let (pre1, pre2, post1) = spillWrap spillingRewrite vtable rd rs rt rdRes rsRes rtRes
incr
return $ pre1 ++ pre2 ++ [AMD64.MUL rdRes rsRes rtRes] ++ post1 | 306 | regAllocInst spillingRewrite vtable (AMD64.MUL rd rs rt) = do
rdRes <- mapReg vtable rd
rsRes <- mapReg vtable rs
rtRes <- mapReg vtable rt
let (pre1, pre2, post1) = spillWrap spillingRewrite vtable rd rs rt rdRes rsRes rtRes
incr
return $ pre1 ++ pre2 ++ [AMD64.MUL rdRes rsRes rtRes] ++ post1 | 306 | false | false | 0 | 11 | 62 | 131 | 61 | 70 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.