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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cblp/haskell-telegram-api | src/Web/Telegram/API/Bot/Requests.hs | bsd-3-clause | inlineKeyboardMarkup :: [[InlineKeyboardButton]] -> ReplyKeyboard
inlineKeyboardMarkup = ReplyInlineKeyboardMarkup | 114 | inlineKeyboardMarkup :: [[InlineKeyboardButton]] -> ReplyKeyboard
inlineKeyboardMarkup = ReplyInlineKeyboardMarkup | 114 | inlineKeyboardMarkup = ReplyInlineKeyboardMarkup | 48 | false | true | 0 | 7 | 7 | 21 | 12 | 9 | null | null |
cliffano/swaggy-jenkins | clients/haskell-http-client/generated/lib/SwaggyJenkins/ModelLens.hs | mit | -- | 'githubContentPath' Lens
githubContentPathL :: Lens_' GithubContent (Maybe Text)
githubContentPathL f GithubContent{..} = (\githubContentPath -> GithubContent { githubContentPath, ..} ) <$> f githubContentPath | 214 | githubContentPathL :: Lens_' GithubContent (Maybe Text)
githubContentPathL f GithubContent{..} = (\githubContentPath -> GithubContent { githubContentPath, ..} ) <$> f githubContentPath | 184 | githubContentPathL f GithubContent{..} = (\githubContentPath -> GithubContent { githubContentPath, ..} ) <$> f githubContentPath | 128 | true | true | 1 | 8 | 23 | 62 | 30 | 32 | null | null |
tedkornish/stack | src/Stack/Build/Source.hs | bsd-3-clause | checkFlagsUsed :: (MonadThrow m, MonadReader env m, HasBuildConfig env)
=> BuildOpts
-> [LocalPackage]
-> Map PackageName extraDeps -- ^ extra deps
-> Map PackageName snapshot -- ^ snapshot, for error messages
-> m ()
checkFlagsUsed bopts lps extraDeps snapshot = do
bconfig <- asks getBuildConfig
-- Check if flags specified in stack.yaml and the command line are
-- used, see https://github.com/commercialhaskell/stack/issues/617
let flags = map (, FSCommandLine) [(k, v) | (Just k, v) <- Map.toList $ boptsFlags bopts]
++ map (, FSStackYaml) (Map.toList $ bcFlags bconfig)
localNameMap = Map.fromList $ map (packageName . lpPackage &&& lpPackage) lps
checkFlagUsed ((name, userFlags), source) =
case Map.lookup name localNameMap of
-- Package is not available locally
Nothing ->
case Map.lookup name extraDeps of
-- Also not in extra-deps, it's an error
Nothing ->
case Map.lookup name snapshot of
Nothing -> Just $ UFNoPackage source name
Just _ -> Just $ UFSnapshot name
-- We don't check for flag presence for extra deps
Just _ -> Nothing
-- Package exists locally, let's check if the flags are defined
Just pkg ->
let unused = Set.difference (Map.keysSet userFlags) (packageDefinedFlags pkg)
in if Set.null unused
-- All flags are defined, nothing to do
then Nothing
-- Error about the undefined flags
else Just $ UFFlagsNotDefined source pkg unused
unusedFlags = mapMaybe checkFlagUsed flags
unless (null unusedFlags)
$ throwM
$ InvalidFlagSpecification
$ Set.fromList unusedFlags
-- | All flags for a local package | 2,129 | checkFlagsUsed :: (MonadThrow m, MonadReader env m, HasBuildConfig env)
=> BuildOpts
-> [LocalPackage]
-> Map PackageName extraDeps -- ^ extra deps
-> Map PackageName snapshot -- ^ snapshot, for error messages
-> m ()
checkFlagsUsed bopts lps extraDeps snapshot = do
bconfig <- asks getBuildConfig
-- Check if flags specified in stack.yaml and the command line are
-- used, see https://github.com/commercialhaskell/stack/issues/617
let flags = map (, FSCommandLine) [(k, v) | (Just k, v) <- Map.toList $ boptsFlags bopts]
++ map (, FSStackYaml) (Map.toList $ bcFlags bconfig)
localNameMap = Map.fromList $ map (packageName . lpPackage &&& lpPackage) lps
checkFlagUsed ((name, userFlags), source) =
case Map.lookup name localNameMap of
-- Package is not available locally
Nothing ->
case Map.lookup name extraDeps of
-- Also not in extra-deps, it's an error
Nothing ->
case Map.lookup name snapshot of
Nothing -> Just $ UFNoPackage source name
Just _ -> Just $ UFSnapshot name
-- We don't check for flag presence for extra deps
Just _ -> Nothing
-- Package exists locally, let's check if the flags are defined
Just pkg ->
let unused = Set.difference (Map.keysSet userFlags) (packageDefinedFlags pkg)
in if Set.null unused
-- All flags are defined, nothing to do
then Nothing
-- Error about the undefined flags
else Just $ UFFlagsNotDefined source pkg unused
unusedFlags = mapMaybe checkFlagUsed flags
unless (null unusedFlags)
$ throwM
$ InvalidFlagSpecification
$ Set.fromList unusedFlags
-- | All flags for a local package | 2,129 | checkFlagsUsed bopts lps extraDeps snapshot = do
bconfig <- asks getBuildConfig
-- Check if flags specified in stack.yaml and the command line are
-- used, see https://github.com/commercialhaskell/stack/issues/617
let flags = map (, FSCommandLine) [(k, v) | (Just k, v) <- Map.toList $ boptsFlags bopts]
++ map (, FSStackYaml) (Map.toList $ bcFlags bconfig)
localNameMap = Map.fromList $ map (packageName . lpPackage &&& lpPackage) lps
checkFlagUsed ((name, userFlags), source) =
case Map.lookup name localNameMap of
-- Package is not available locally
Nothing ->
case Map.lookup name extraDeps of
-- Also not in extra-deps, it's an error
Nothing ->
case Map.lookup name snapshot of
Nothing -> Just $ UFNoPackage source name
Just _ -> Just $ UFSnapshot name
-- We don't check for flag presence for extra deps
Just _ -> Nothing
-- Package exists locally, let's check if the flags are defined
Just pkg ->
let unused = Set.difference (Map.keysSet userFlags) (packageDefinedFlags pkg)
in if Set.null unused
-- All flags are defined, nothing to do
then Nothing
-- Error about the undefined flags
else Just $ UFFlagsNotDefined source pkg unused
unusedFlags = mapMaybe checkFlagUsed flags
unless (null unusedFlags)
$ throwM
$ InvalidFlagSpecification
$ Set.fromList unusedFlags
-- | All flags for a local package | 1,836 | false | true | 0 | 21 | 840 | 417 | 209 | 208 | null | null |
Fornost461/drafts-and-stuff | Haskell/projects/teacher/SRC/Game.hs | cc0-1.0 | {-todo:
Currently, a menu lets the user choose the folder, and another menu lets
him choose files within this folder.
The user shouldn't be limited to choosing files of only one folder.
Therefore, those two menus should be merged into one.
Also, an option for forgetting loaded levels, as well as an option to select all levels in the folder, and an option to unselect a level at a time, should be
in this new menu.
-}
play :: (Num a, Ord a, Show a) => [Correspondence] -> a -> a -> StdGen -> IO ((a, a), StdGen)
play [] mistakesCount total gen = return ((mistakesCount, total), gen) | 585 | play :: (Num a, Ord a, Show a) => [Correspondence] -> a -> a -> StdGen -> IO ((a, a), StdGen)
play [] mistakesCount total gen = return ((mistakesCount, total), gen) | 164 | play [] mistakesCount total gen = return ((mistakesCount, total), gen) | 70 | true | true | 0 | 12 | 109 | 99 | 52 | 47 | null | null |
reuleaux/pire | src/Pire/Parser/Constructor.hs | bsd-3-clause | onstructor_ :: (TokParsing m
, MonadState PiState m
, DeltaParsing m) => m (Nm T.Text T.Text)
tconstructor_ =
do (i, ws) <- id_
-- cnames <- get
st <- get
let cnames = constr_names st
if (i `S.member` tconNames cnames)
then return $ Nm_ i ws
else if (i `S.member` dconNames cnames)
then fail "Expected a type constructor, but a data constructor was found."
else fail "Expected a constructor, but a variable was found"
| 516 | tconstructor_ :: (TokParsing m
, MonadState PiState m
, DeltaParsing m) => m (Nm T.Text T.Text)
tconstructor_ =
do (i, ws) <- id_
-- cnames <- get
st <- get
let cnames = constr_names st
if (i `S.member` tconNames cnames)
then return $ Nm_ i ws
else if (i `S.member` dconNames cnames)
then fail "Expected a type constructor, but a data constructor was found."
else fail "Expected a constructor, but a variable was found" | 516 | tconstructor_ =
do (i, ws) <- id_
-- cnames <- get
st <- get
let cnames = constr_names st
if (i `S.member` tconNames cnames)
then return $ Nm_ i ws
else if (i `S.member` dconNames cnames)
then fail "Expected a type constructor, but a data constructor was found."
else fail "Expected a constructor, but a variable was found" | 386 | false | true | 0 | 11 | 172 | 149 | 75 | 74 | null | null |
rabipelais/record-gl | examples/2D/Window.hs | bsd-3-clause | mbCallback mbs _w b MouseButtonState'Released _ = modifyIORef' mbs (S.delete b) | 79 | mbCallback mbs _w b MouseButtonState'Released _ = modifyIORef' mbs (S.delete b) | 79 | mbCallback mbs _w b MouseButtonState'Released _ = modifyIORef' mbs (S.delete b) | 79 | false | false | 0 | 8 | 10 | 32 | 14 | 18 | null | null |
Kromgart/tesML | lib/TesML/Data/Generator.hs | agpl-3.0 | getSRDef :: SRQuant -> [SRDef]
getSRDef (Required srd) = srd | 61 | getSRDef :: SRQuant -> [SRDef]
getSRDef (Required srd) = srd | 61 | getSRDef (Required srd) = srd | 30 | false | true | 0 | 9 | 10 | 33 | 15 | 18 | null | null |
mineo/lb-scrobbler | src/Main.hs | bsd-3-clause | userAgent :: String
userAgent = "Mineos ListenBrainz client" | 60 | userAgent :: String
userAgent = "Mineos ListenBrainz client" | 60 | userAgent = "Mineos ListenBrainz client" | 40 | false | true | 0 | 4 | 7 | 11 | 6 | 5 | null | null |
dcreager/cabal | Distribution/Simple.hs | bsd-3-clause | getBuildConfig :: UserHooks -> FilePath -> IO LocalBuildInfo
getBuildConfig hooks distPref = do
lbi <- getPersistBuildConfig distPref
case pkgDescrFile lbi of
Nothing -> return ()
Just pkg_descr_file -> checkPersistBuildConfig distPref pkg_descr_file
return lbi {
withPrograms = restoreProgramConfiguration
(builtinPrograms ++ hookedPrograms hooks)
(withPrograms lbi)
}
-- --------------------------------------------------------------------------
-- Cleaning | 522 | getBuildConfig :: UserHooks -> FilePath -> IO LocalBuildInfo
getBuildConfig hooks distPref = do
lbi <- getPersistBuildConfig distPref
case pkgDescrFile lbi of
Nothing -> return ()
Just pkg_descr_file -> checkPersistBuildConfig distPref pkg_descr_file
return lbi {
withPrograms = restoreProgramConfiguration
(builtinPrograms ++ hookedPrograms hooks)
(withPrograms lbi)
}
-- --------------------------------------------------------------------------
-- Cleaning | 522 | getBuildConfig hooks distPref = do
lbi <- getPersistBuildConfig distPref
case pkgDescrFile lbi of
Nothing -> return ()
Just pkg_descr_file -> checkPersistBuildConfig distPref pkg_descr_file
return lbi {
withPrograms = restoreProgramConfiguration
(builtinPrograms ++ hookedPrograms hooks)
(withPrograms lbi)
}
-- --------------------------------------------------------------------------
-- Cleaning | 461 | false | true | 0 | 13 | 110 | 109 | 51 | 58 | null | null |
ganeti-github-testing/ganeti-test-1 | src/Ganeti/HTools/Instance.hs | bsd-2-clause | -- | Computes all nodes of an instance.
allNodes :: Instance -> [T.Ndx]
allNodes inst = case diskTemplate inst of
T.DTDrbd8 -> [pNode inst, sNode inst]
_ -> [pNode inst]
-- | Checks whether a given disk template uses local storage. | 268 | allNodes :: Instance -> [T.Ndx]
allNodes inst = case diskTemplate inst of
T.DTDrbd8 -> [pNode inst, sNode inst]
_ -> [pNode inst]
-- | Checks whether a given disk template uses local storage. | 228 | allNodes inst = case diskTemplate inst of
T.DTDrbd8 -> [pNode inst, sNode inst]
_ -> [pNode inst]
-- | Checks whether a given disk template uses local storage. | 196 | true | true | 0 | 9 | 77 | 64 | 33 | 31 | null | null |
tonyday567/mvc-extended | src/MVC/ByteString/Builder.hs | mit | bDiffTime :: DiffTime -> Builder
bDiffTime t = bTime $ timeToTimeOfDay t | 72 | bDiffTime :: DiffTime -> Builder
bDiffTime t = bTime $ timeToTimeOfDay t | 72 | bDiffTime t = bTime $ timeToTimeOfDay t | 39 | false | true | 0 | 6 | 11 | 25 | 12 | 13 | null | null |
ComputationWithBoundedResources/ara-inference | app/AraHoca.hs | mit | fromASym App = error "APP encountered" | 42 | fromASym App = error "APP encountered" | 42 | fromASym App = error "APP encountered" | 42 | false | false | 1 | 5 | 9 | 15 | 5 | 10 | null | null |
sdiehl/ghc | testsuite/tests/ffi/should_run/ffi005.hs | bsd-3-clause | main = do
putStrLn "\nTesting sin==mysin (should return lots of Trues)"
print (testSin sin mysin)
-- disabled because errno is not necessarily a label these days
-- putStrLn "\nTesting errno"
-- err <- peek errno
-- putStrLn $ "errno == " ++ show err
putStrLn "\nTesting puts (and withString)"
hFlush stdout
withCString "Test puts successful" puts
flushStdout -- Flush the libc output buffer
putStrLn "\nTesting peekArray0"
s <- withCString "Test peekArray0 successful" (peekArray0 (castCharToCChar '\0'))
putStr (map castCCharToChar s)
-- disabled due to use of non-portable constants in arguments to open:
-- putStrLn "\nTesting open, read and close"
-- s <- testRead "ffi005.hs" 200
-- putStrLn (map castCCharToChar s)
-- putStrLn "\nTesting open, write and close"
-- testWrite "/tmp/test_write" "Test successful"
putStrLn "\nTesting sin==dynamic_sin (should return lots of Trues)"
print (testSin sin (dyn_sin sin_addr))
putStrLn "\nTesting sin==IO wrapped_sin (should return lots of Trues)"
sin_addr2 <- wrapIO (return . sin)
print (testSin sin (unsafePerformIO . (dyn_sinIO sin_addr2)))
freeHaskellFunPtr sin_addr2
putStrLn "\nTesting sin==Id wrapped_sin (should return lots of Trues)"
sin_addr3 <- wrapId sin
print (testSin sin (dyn_sin sin_addr3))
freeHaskellFunPtr sin_addr3
putStrLn "\nTesting exit"
hFlush stdout
exit 3 | 1,396 | main = do
putStrLn "\nTesting sin==mysin (should return lots of Trues)"
print (testSin sin mysin)
-- disabled because errno is not necessarily a label these days
-- putStrLn "\nTesting errno"
-- err <- peek errno
-- putStrLn $ "errno == " ++ show err
putStrLn "\nTesting puts (and withString)"
hFlush stdout
withCString "Test puts successful" puts
flushStdout -- Flush the libc output buffer
putStrLn "\nTesting peekArray0"
s <- withCString "Test peekArray0 successful" (peekArray0 (castCharToCChar '\0'))
putStr (map castCCharToChar s)
-- disabled due to use of non-portable constants in arguments to open:
-- putStrLn "\nTesting open, read and close"
-- s <- testRead "ffi005.hs" 200
-- putStrLn (map castCCharToChar s)
-- putStrLn "\nTesting open, write and close"
-- testWrite "/tmp/test_write" "Test successful"
putStrLn "\nTesting sin==dynamic_sin (should return lots of Trues)"
print (testSin sin (dyn_sin sin_addr))
putStrLn "\nTesting sin==IO wrapped_sin (should return lots of Trues)"
sin_addr2 <- wrapIO (return . sin)
print (testSin sin (unsafePerformIO . (dyn_sinIO sin_addr2)))
freeHaskellFunPtr sin_addr2
putStrLn "\nTesting sin==Id wrapped_sin (should return lots of Trues)"
sin_addr3 <- wrapId sin
print (testSin sin (dyn_sin sin_addr3))
freeHaskellFunPtr sin_addr3
putStrLn "\nTesting exit"
hFlush stdout
exit 3 | 1,396 | main = do
putStrLn "\nTesting sin==mysin (should return lots of Trues)"
print (testSin sin mysin)
-- disabled because errno is not necessarily a label these days
-- putStrLn "\nTesting errno"
-- err <- peek errno
-- putStrLn $ "errno == " ++ show err
putStrLn "\nTesting puts (and withString)"
hFlush stdout
withCString "Test puts successful" puts
flushStdout -- Flush the libc output buffer
putStrLn "\nTesting peekArray0"
s <- withCString "Test peekArray0 successful" (peekArray0 (castCharToCChar '\0'))
putStr (map castCCharToChar s)
-- disabled due to use of non-portable constants in arguments to open:
-- putStrLn "\nTesting open, read and close"
-- s <- testRead "ffi005.hs" 200
-- putStrLn (map castCCharToChar s)
-- putStrLn "\nTesting open, write and close"
-- testWrite "/tmp/test_write" "Test successful"
putStrLn "\nTesting sin==dynamic_sin (should return lots of Trues)"
print (testSin sin (dyn_sin sin_addr))
putStrLn "\nTesting sin==IO wrapped_sin (should return lots of Trues)"
sin_addr2 <- wrapIO (return . sin)
print (testSin sin (unsafePerformIO . (dyn_sinIO sin_addr2)))
freeHaskellFunPtr sin_addr2
putStrLn "\nTesting sin==Id wrapped_sin (should return lots of Trues)"
sin_addr3 <- wrapId sin
print (testSin sin (dyn_sin sin_addr3))
freeHaskellFunPtr sin_addr3
putStrLn "\nTesting exit"
hFlush stdout
exit 3 | 1,396 | false | false | 1 | 14 | 251 | 250 | 108 | 142 | null | null |
GaloisInc/halvm-ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | getEnv :: TM TickTransEnv
getEnv = TM $ \ env st -> (env, noFVs, st) | 68 | getEnv :: TM TickTransEnv
getEnv = TM $ \ env st -> (env, noFVs, st) | 68 | getEnv = TM $ \ env st -> (env, noFVs, st) | 42 | false | true | 0 | 7 | 14 | 34 | 19 | 15 | null | null |
brendanhay/gogol | gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/Purchases/Subscriptions/Cancel.hs | mpl-2.0 | -- | V1 error format.
pscXgafv :: Lens' PurchasesSubscriptionsCancel (Maybe Xgafv)
pscXgafv = lens _pscXgafv (\ s a -> s{_pscXgafv = a}) | 136 | pscXgafv :: Lens' PurchasesSubscriptionsCancel (Maybe Xgafv)
pscXgafv = lens _pscXgafv (\ s a -> s{_pscXgafv = a}) | 114 | pscXgafv = lens _pscXgafv (\ s a -> s{_pscXgafv = a}) | 53 | true | true | 1 | 9 | 21 | 50 | 25 | 25 | null | null |
xmonad/xmonad-contrib | XMonad/Actions/CycleWS.hs | bsd-3-clause | -- | Move the focused window to the next workspace.
shiftToNext :: X ()
shiftToNext = shiftBy 1 | 95 | shiftToNext :: X ()
shiftToNext = shiftBy 1 | 43 | shiftToNext = shiftBy 1 | 23 | true | true | 0 | 6 | 17 | 20 | 10 | 10 | null | null |
fmthoma/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | bindIOIdKey = mkPreludeMiscIdUnique 34 | 56 | bindIOIdKey = mkPreludeMiscIdUnique 34 | 56 | bindIOIdKey = mkPreludeMiscIdUnique 34 | 56 | false | false | 0 | 5 | 21 | 9 | 4 | 5 | null | null |
danse/haskellers | tests/Handler/Profile.hs | bsd-2-clause | postRequestSkillR :: Handler ()
postRequestSkillR = do
uid <- requireAuthId
res <- runInputPost $ iopt textField "skill"
case res of
Just skill -> do
now <- liftIO getCurrentTime
_ <- runDB $ insert $ Message
{ messageClosed = False
, messageWhen = now
, messageFrom = Just uid
, messageRegarding = Nothing
, messageText = Textarea $ T.unlines
[ "Requesting new skill"
, ""
, skill
]
}
setMessage "Your skill request has been logged."
Nothing -> setMessage "Invalid skill entered."
redirect ProfileR | 743 | postRequestSkillR :: Handler ()
postRequestSkillR = do
uid <- requireAuthId
res <- runInputPost $ iopt textField "skill"
case res of
Just skill -> do
now <- liftIO getCurrentTime
_ <- runDB $ insert $ Message
{ messageClosed = False
, messageWhen = now
, messageFrom = Just uid
, messageRegarding = Nothing
, messageText = Textarea $ T.unlines
[ "Requesting new skill"
, ""
, skill
]
}
setMessage "Your skill request has been logged."
Nothing -> setMessage "Invalid skill entered."
redirect ProfileR | 743 | postRequestSkillR = do
uid <- requireAuthId
res <- runInputPost $ iopt textField "skill"
case res of
Just skill -> do
now <- liftIO getCurrentTime
_ <- runDB $ insert $ Message
{ messageClosed = False
, messageWhen = now
, messageFrom = Just uid
, messageRegarding = Nothing
, messageText = Textarea $ T.unlines
[ "Requesting new skill"
, ""
, skill
]
}
setMessage "Your skill request has been logged."
Nothing -> setMessage "Invalid skill entered."
redirect ProfileR | 711 | false | true | 0 | 18 | 326 | 154 | 76 | 78 | null | null |
Jem777/deepthought | src/StdLib.hs | gpl-3.0 | bool _ [String ""] = goRight (Atom "@false") | 44 | bool _ [String ""] = goRight (Atom "@false") | 44 | bool _ [String ""] = goRight (Atom "@false") | 44 | false | false | 0 | 7 | 7 | 26 | 12 | 14 | null | null |
gspia/reflex-dom-htmlea | lib/src/Reflex/Dom/HTML5/Component/Common/CompEvent.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- | Helper. 'mkTable' uses this one.
compEvFiring ∷ forall t e r. (Reflex t, ActSelem e, ActSretval r)
⇒ [CompEvent t e r] → Event t (CompEvent t e r)
compEvFiring l = leftmost evl
where
evl ∷ [Event t (CompEvent t e r)]
evl = fmap tblEv2Ev l
tblEv2Ev ∷ CompEvent t e r → Event t (CompEvent t e r)
tblEv2Ev tbl@(CompEvent _me ec ed en er) =
tbl <$ leftmost [ () <$ ec, () <$ ed, () <$ en, () <$ er]
--------------------------------------------------------------------------------
-- | Capture events when moving mouse out of table or in.
-- These are used to handle, e.g., the behavior when pressing mouse button down
-- and moving out of table area. | 774 | compEvFiring ∷ forall t e r. (Reflex t, ActSelem e, ActSretval r)
⇒ [CompEvent t e r] → Event t (CompEvent t e r)
compEvFiring l = leftmost evl
where
evl ∷ [Event t (CompEvent t e r)]
evl = fmap tblEv2Ev l
tblEv2Ev ∷ CompEvent t e r → Event t (CompEvent t e r)
tblEv2Ev tbl@(CompEvent _me ec ed en er) =
tbl <$ leftmost [ () <$ ec, () <$ ed, () <$ en, () <$ er]
--------------------------------------------------------------------------------
-- | Capture events when moving mouse out of table or in.
-- These are used to handle, e.g., the behavior when pressing mouse button down
-- and moving out of table area. | 654 | compEvFiring l = leftmost evl
where
evl ∷ [Event t (CompEvent t e r)]
evl = fmap tblEv2Ev l
tblEv2Ev ∷ CompEvent t e r → Event t (CompEvent t e r)
tblEv2Ev tbl@(CompEvent _me ec ed en er) =
tbl <$ leftmost [ () <$ ec, () <$ ed, () <$ en, () <$ er]
--------------------------------------------------------------------------------
-- | Capture events when moving mouse out of table or in.
-- These are used to handle, e.g., the behavior when pressing mouse button down
-- and moving out of table area. | 528 | true | true | 5 | 11 | 163 | 229 | 116 | 113 | null | null |
weissi/diplomarbeit | lib/Data/RAE/Conduit.hs | gpl-3.0 | decodeOAFEConfiguration :: (Field el, ByteSerializable el)
=> Pb.OAFEConfig
-> (VariableName, Vector (el, el))
decodeOAFEConfiguration (Pb.OAFEConfig var exprs) =
(uToText var, V.map decodeLinearExpr $ (V.fromList . F.toList) exprs) | 284 | decodeOAFEConfiguration :: (Field el, ByteSerializable el)
=> Pb.OAFEConfig
-> (VariableName, Vector (el, el))
decodeOAFEConfiguration (Pb.OAFEConfig var exprs) =
(uToText var, V.map decodeLinearExpr $ (V.fromList . F.toList) exprs) | 284 | decodeOAFEConfiguration (Pb.OAFEConfig var exprs) =
(uToText var, V.map decodeLinearExpr $ (V.fromList . F.toList) exprs) | 125 | false | true | 0 | 10 | 78 | 92 | 48 | 44 | null | null |
ekmett/bitwise | extra/benchmark.hs | bsd-3-clause | aToBS :: A -> ByteString
aToBS a = {-# SCC "aToBS" #-} pack . toWord8sLE . A.elems $ a | 86 | aToBS :: A -> ByteString
aToBS a = {-# SCC "aToBS" #-} pack . toWord8sLE . A.elems $ a | 86 | aToBS a = {-# SCC "aToBS" #-} pack . toWord8sLE . A.elems $ a | 61 | false | true | 0 | 7 | 18 | 33 | 17 | 16 | null | null |
sdiehl/ghc | compiler/GHC/StgToCmm/Closure.hs | bsd-3-clause | -------------
mkConLFInfo :: DataCon -> LambdaFormInfo
mkConLFInfo con = LFCon con | 82 | mkConLFInfo :: DataCon -> LambdaFormInfo
mkConLFInfo con = LFCon con | 68 | mkConLFInfo con = LFCon con | 27 | true | true | 0 | 5 | 10 | 22 | 11 | 11 | null | null |
urbanslug/ghc | testsuite/tests/gadt/data1.hs | bsd-3-clause | tf1 :: T Int -> Bool
tf1 (MkT aa) = f aa | 41 | tf1 :: T Int -> Bool
tf1 (MkT aa) = f aa | 40 | tf1 (MkT aa) = f aa | 19 | false | true | 0 | 6 | 12 | 34 | 15 | 19 | null | null |
nevrenato/Hets_Fork | Search/DB/DBSpec.hs | gpl-2.0 | {- short_profile -}
short_profile :: TInfo
short_profile = makeTInfo "short_profile" [theory_id, skeleton_md5, parameter, role, line] | 134 | short_profile :: TInfo
short_profile = makeTInfo "short_profile" [theory_id, skeleton_md5, parameter, role, line] | 113 | short_profile = makeTInfo "short_profile" [theory_id, skeleton_md5, parameter, role, line] | 90 | true | true | 0 | 6 | 15 | 39 | 20 | 19 | null | null |
keera-studios/pngload | Codec/Image/PNG/Internal/Parser.hs | bsd-2-clause | block :: (Stream LB.ByteString m Word8) => Int -> ParsecT LB.ByteString u m LB.ByteString
block size = do -- count size anyWord8 >>= return . LB.pack
i <- getInput
let (s,r) = LB.splitAt (fromIntegral size) i
setInput r
return s | 237 | block :: (Stream LB.ByteString m Word8) => Int -> ParsecT LB.ByteString u m LB.ByteString
block size = do -- count size anyWord8 >>= return . LB.pack
i <- getInput
let (s,r) = LB.splitAt (fromIntegral size) i
setInput r
return s | 237 | block size = do -- count size anyWord8 >>= return . LB.pack
i <- getInput
let (s,r) = LB.splitAt (fromIntegral size) i
setInput r
return s | 147 | false | true | 0 | 13 | 48 | 99 | 46 | 53 | null | null |
gwright83/Wheeler | src/Math/Symbolic/Wheeler/Basic.hs | bsd-3-clause | expandProduct r (Sum (t : [])) = expandProduct r t | 50 | expandProduct r (Sum (t : [])) = expandProduct r t | 50 | expandProduct r (Sum (t : [])) = expandProduct r t | 50 | false | false | 0 | 9 | 9 | 33 | 15 | 18 | null | null |
Lazersmoke/rhc | src/Old/ParseFEST.hs | bsd-3-clause | patternParser :: IParser Pattern
patternParser = choice
[varPattern
,litPattern
,blackHolePattern
,constructedPattern
] <?> "Pattern" | 143 | patternParser :: IParser Pattern
patternParser = choice
[varPattern
,litPattern
,blackHolePattern
,constructedPattern
] <?> "Pattern" | 143 | patternParser = choice
[varPattern
,litPattern
,blackHolePattern
,constructedPattern
] <?> "Pattern" | 110 | false | true | 0 | 6 | 23 | 33 | 18 | 15 | null | null |
purefn/naggy | src/HipBot/Naggy/Session.hs | bsd-3-clause | writeSession :: Registration -> NaggyCrank ()
writeSession reg = do
k <- lift . view $ csKey
let sess = (reg ^. oauthId . to T.encodeUtf8, reg ^. roomId . to fromJust)
sess' <- liftIO . encryptIO k . Serial.encode $ sess
putResponseHeader "Set-Cookie" . LB.toStrict . toLazyByteString . renderSetCookie $ def
{ setCookieName = "sid"
, setCookieValue = sess'
, setCookieMaxAge = Just 86400 -- 24 hours
, setCookieHttpOnly = True
} | 458 | writeSession :: Registration -> NaggyCrank ()
writeSession reg = do
k <- lift . view $ csKey
let sess = (reg ^. oauthId . to T.encodeUtf8, reg ^. roomId . to fromJust)
sess' <- liftIO . encryptIO k . Serial.encode $ sess
putResponseHeader "Set-Cookie" . LB.toStrict . toLazyByteString . renderSetCookie $ def
{ setCookieName = "sid"
, setCookieValue = sess'
, setCookieMaxAge = Just 86400 -- 24 hours
, setCookieHttpOnly = True
} | 458 | writeSession reg = do
k <- lift . view $ csKey
let sess = (reg ^. oauthId . to T.encodeUtf8, reg ^. roomId . to fromJust)
sess' <- liftIO . encryptIO k . Serial.encode $ sess
putResponseHeader "Set-Cookie" . LB.toStrict . toLazyByteString . renderSetCookie $ def
{ setCookieName = "sid"
, setCookieValue = sess'
, setCookieMaxAge = Just 86400 -- 24 hours
, setCookieHttpOnly = True
} | 412 | false | true | 0 | 13 | 101 | 155 | 78 | 77 | null | null |
boojinks/cis194-solutions | src/HW05/Calc.hs | bsd-3-clause | eval (Mul e1 e2) = (eval e1) * (eval e2) | 40 | eval (Mul e1 e2) = (eval e1) * (eval e2) | 40 | eval (Mul e1 e2) = (eval e1) * (eval e2) | 40 | false | false | 0 | 7 | 9 | 33 | 16 | 17 | null | null |
mightymoose/liquidhaskell | benchmarks/ghc-7.4.1/Event/IntMap.hs | bsd-3-clause | nomatch :: Key -> Prefix -> Mask -> Bool
nomatch i p m = (mask i m) /= p | 72 | nomatch :: Key -> Prefix -> Mask -> Bool
nomatch i p m = (mask i m) /= p | 72 | nomatch i p m = (mask i m) /= p | 31 | false | true | 0 | 7 | 18 | 42 | 21 | 21 | null | null |
wetneb/yanker | src/TypeHierarchy.hs | gpl-3.0 | renderLFparen t@(LFLeft _ _) _ = addParen $ renderLFparen t NoParen | 67 | renderLFparen t@(LFLeft _ _) _ = addParen $ renderLFparen t NoParen | 67 | renderLFparen t@(LFLeft _ _) _ = addParen $ renderLFparen t NoParen | 67 | false | false | 0 | 8 | 10 | 31 | 15 | 16 | null | null |
olsner/ghc | compiler/coreSyn/MkCore.hs | bsd-3-clause | -- | Build a small unboxed tuple holding the specified expressions,
-- with the given types. The types must be the types of the expressions.
-- Do not include the RuntimeRep specifiers; this function calculates them
-- for you.
-- Does /not/ flatten one-tuples; see Note [Flattening one-tuples]
mkCoreUbxTup :: [Type] -> [CoreExpr] -> CoreExpr
mkCoreUbxTup tys exps
= ASSERT( tys `equalLength` exps)
mkCoreConApps (tupleDataCon Unboxed (length tys))
(map (Type . getRuntimeRep "mkCoreUbxTup") tys ++ map Type tys ++ exps) | 540 | mkCoreUbxTup :: [Type] -> [CoreExpr] -> CoreExpr
mkCoreUbxTup tys exps
= ASSERT( tys `equalLength` exps)
mkCoreConApps (tupleDataCon Unboxed (length tys))
(map (Type . getRuntimeRep "mkCoreUbxTup") tys ++ map Type tys ++ exps) | 245 | mkCoreUbxTup tys exps
= ASSERT( tys `equalLength` exps)
mkCoreConApps (tupleDataCon Unboxed (length tys))
(map (Type . getRuntimeRep "mkCoreUbxTup") tys ++ map Type tys ++ exps) | 196 | true | true | 0 | 12 | 98 | 98 | 53 | 45 | null | null |
keera-studios/hsQt | Qtc/Enums/Gui/QTextOption.hs | bsd-2-clause | eWrapAtWordBoundaryOrAnywhere :: WrapMode
eWrapAtWordBoundaryOrAnywhere
= ieWrapMode $ 4 | 90 | eWrapAtWordBoundaryOrAnywhere :: WrapMode
eWrapAtWordBoundaryOrAnywhere
= ieWrapMode $ 4 | 90 | eWrapAtWordBoundaryOrAnywhere
= ieWrapMode $ 4 | 48 | false | true | 0 | 6 | 9 | 18 | 8 | 10 | null | null |
lorcanmcdonald/mars | src/Mars/Command/Ls.hs | bsd-3-clause | toItemType (Bool _) = MarsBool | 30 | toItemType (Bool _) = MarsBool | 30 | toItemType (Bool _) = MarsBool | 30 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
mdibaiee/serverman | src/System/Serverman/Log.hs | gpl-3.0 | progressCharacters = [". ", ".. ", "...", " ..", " .", " "] | 63 | progressCharacters = [". ", ".. ", "...", " ..", " .", " "] | 63 | progressCharacters = [". ", ".. ", "...", " ..", " .", " "] | 63 | false | false | 0 | 5 | 16 | 24 | 15 | 9 | null | null |
noteed/syntactical | tests/suite.hs | bsd-3-clause | stepsAmbiguous = steps Ambiguous.table . tokenize | 49 | stepsAmbiguous = steps Ambiguous.table . tokenize | 49 | stepsAmbiguous = steps Ambiguous.table . tokenize | 49 | false | false | 0 | 7 | 5 | 15 | 7 | 8 | null | null |
ecaustin/haskhol-haskell | src/HaskHOL/Lib/Haskell.hs | bsd-2-clause | -- Either
tacMonadEither :: HaskellCtxt thry => Tactic cls thry
tacMonadEither = proveConsClass defMonad inductionEither [defLeft, defRight] | 140 | tacMonadEither :: HaskellCtxt thry => Tactic cls thry
tacMonadEither = proveConsClass defMonad inductionEither [defLeft, defRight] | 130 | tacMonadEither = proveConsClass defMonad inductionEither [defLeft, defRight] | 76 | true | true | 0 | 6 | 16 | 37 | 19 | 18 | null | null |
meiersi/blaze-builder | Blaze/ByteString/Builder/ByteString.hs | bsd-3-clause | fromLazyByteStringWith :: Int -- ^ Maximal number of bytes to copy.
-> L.ByteString -- ^ Lazy 'L.ByteString' to serialize.
-> Builder -- ^ Resulting 'Builder'.
fromLazyByteStringWith maxCopySize =
L.foldrChunks (\bs b -> fromByteStringWith maxCopySize bs `mappend` b) mempty | 336 | fromLazyByteStringWith :: Int -- ^ Maximal number of bytes to copy.
-> L.ByteString -- ^ Lazy 'L.ByteString' to serialize.
-> Builder
fromLazyByteStringWith maxCopySize =
L.foldrChunks (\bs b -> fromByteStringWith maxCopySize bs `mappend` b) mempty | 305 | fromLazyByteStringWith maxCopySize =
L.foldrChunks (\bs b -> fromByteStringWith maxCopySize bs `mappend` b) mempty | 116 | true | true | 0 | 9 | 99 | 56 | 30 | 26 | null | null |
DavidAlphaFox/darcs | src/Darcs/UI/Flags.hs | gpl-2.0 | getCharset :: Config -> Maybe String
getCharset = parseFlags O.charset | 70 | getCharset :: Config -> Maybe String
getCharset = parseFlags O.charset | 70 | getCharset = parseFlags O.charset | 33 | false | true | 0 | 6 | 9 | 23 | 11 | 12 | null | null |
esmolanka/sexp-grammar | sexp-grammar/src/Language/SexpGrammar/Base.hs | bsd-3-clause | beginParenList :: Grammar Position (Sexp :- t) (List :- t)
beginParenList = locate >>> partialOsi
(\case
ParenList a -> Right (List a)
other -> Left (expected "list" <> unexpected (ppBrief other)))
(ParenList . coerce) | 234 | beginParenList :: Grammar Position (Sexp :- t) (List :- t)
beginParenList = locate >>> partialOsi
(\case
ParenList a -> Right (List a)
other -> Left (expected "list" <> unexpected (ppBrief other)))
(ParenList . coerce) | 234 | beginParenList = locate >>> partialOsi
(\case
ParenList a -> Right (List a)
other -> Left (expected "list" <> unexpected (ppBrief other)))
(ParenList . coerce) | 175 | false | true | 0 | 14 | 49 | 100 | 49 | 51 | null | null |
michalkonecny/aern | aern-order/src/Numeric/AERN/Basics/Exception.hs | bsd-3-clause | raisesAERNException :: String -> t -> Bool
raisesAERNException contextDescription a =
case (evalCatchAERNExceptions contextDescription a) of
(Left _) -> True
_ -> False | 188 | raisesAERNException :: String -> t -> Bool
raisesAERNException contextDescription a =
case (evalCatchAERNExceptions contextDescription a) of
(Left _) -> True
_ -> False | 188 | raisesAERNException contextDescription a =
case (evalCatchAERNExceptions contextDescription a) of
(Left _) -> True
_ -> False | 145 | false | true | 0 | 9 | 42 | 60 | 28 | 32 | null | null |
sdiehl/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | floatFromIntegerIdKey = mkPreludeMiscIdUnique 85 | 56 | floatFromIntegerIdKey = mkPreludeMiscIdUnique 85 | 56 | floatFromIntegerIdKey = mkPreludeMiscIdUnique 85 | 56 | false | false | 0 | 5 | 11 | 9 | 4 | 5 | null | null |
wdanilo/haskell-language-c | src/Language/C/Analysis/TravMonad.hs | bsd-3-clause | modify :: (TravState s -> TravState s) -> Trav s ()
modify f = Trav (\s -> Right ((),f s)) | 90 | modify :: (TravState s -> TravState s) -> Trav s ()
modify f = Trav (\s -> Right ((),f s)) | 90 | modify f = Trav (\s -> Right ((),f s)) | 38 | false | true | 0 | 10 | 19 | 68 | 32 | 36 | null | null |
quantum-dan/tictactoe-ai | Algo.hs | mit | loseval = 0 | 11 | loseval = 0 | 11 | loseval = 0 | 11 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
Mr-Click/PFQ | user/Haskell/Network/PFq/Default.hs | gpl-2.0 | -- | Evaluate to the /destination port/ of the TCP header.
tcp_dest = Property "tcp_dest" () () () () () () () () | 113 | tcp_dest = Property "tcp_dest" () () () () () () () () | 54 | tcp_dest = Property "tcp_dest" () () () () () () () () | 54 | true | false | 0 | 6 | 22 | 42 | 21 | 21 | null | null |
pierric/neural-network | Backend-blashs/Data/NeuralNetwork/Backend/BLASHS/Utils.hs | bsd-3-clause | -- | get the 'DenseMatrix' from 'DenseMatrixArray' at some position
denseMatrixArrayAt :: V.Storable a => DenseMatrixArray a -> Int -> DenseMatrix a
denseMatrixArrayAt (DenseMatrixArray n r c v) i =
assert (i >= 0 && i < n) $ let seg = r*c in DenseMatrix r c (V.unsafeSlice (i*seg) seg v) | 290 | denseMatrixArrayAt :: V.Storable a => DenseMatrixArray a -> Int -> DenseMatrix a
denseMatrixArrayAt (DenseMatrixArray n r c v) i =
assert (i >= 0 && i < n) $ let seg = r*c in DenseMatrix r c (V.unsafeSlice (i*seg) seg v) | 222 | denseMatrixArrayAt (DenseMatrixArray n r c v) i =
assert (i >= 0 && i < n) $ let seg = r*c in DenseMatrix r c (V.unsafeSlice (i*seg) seg v) | 141 | true | true | 0 | 12 | 52 | 115 | 56 | 59 | null | null |
emwap/feldspar-language | src/Feldspar/Range.hs | bsd-3-clause | rangeMod _ (Range l u) = Range (succ l) (pred u) | 48 | rangeMod _ (Range l u) = Range (succ l) (pred u) | 48 | rangeMod _ (Range l u) = Range (succ l) (pred u) | 48 | false | false | 0 | 7 | 10 | 36 | 17 | 19 | null | null |
AlexanderPankiv/ghc | compiler/main/DynFlags.hs | bsd-3-clause | isOneShot _other = False | 25 | isOneShot _other = False | 25 | isOneShot _other = False | 25 | false | false | 1 | 5 | 4 | 13 | 4 | 9 | null | null |
lambda-llama/bitset | src/GHC/Integer/GMP/TypeExt.hs | mit | clearBitInteger :: Integer -> Int# -> Integer
clearBitInteger (S# j) i
| isTrue# (i <# 0#) || isTrue# (i >=# (WORD_SIZE_IN_BITS# -# 1#)) = S# j
| otherwise =
let !mask =
int2Word# (1# `uncheckedIShiftL#` i) `xor#`
int2Word# (negateInt# 1#)
in S# (word2Int# (int2Word# j `and#` mask)) | 339 | clearBitInteger :: Integer -> Int# -> Integer
clearBitInteger (S# j) i
| isTrue# (i <# 0#) || isTrue# (i >=# (WORD_SIZE_IN_BITS# -# 1#)) = S# j
| otherwise =
let !mask =
int2Word# (1# `uncheckedIShiftL#` i) `xor#`
int2Word# (negateInt# 1#)
in S# (word2Int# (int2Word# j `and#` mask)) | 339 | clearBitInteger (S# j) i
| isTrue# (i <# 0#) || isTrue# (i >=# (WORD_SIZE_IN_BITS# -# 1#)) = S# j
| otherwise =
let !mask =
int2Word# (1# `uncheckedIShiftL#` i) `xor#`
int2Word# (negateInt# 1#)
in S# (word2Int# (int2Word# j `and#` mask)) | 293 | false | true | 0 | 13 | 102 | 148 | 71 | 77 | null | null |
AubreyEAnderson/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | readArray = called "array assignment" $ do
id <- getNextId
char '('
allspacing
words <- readElement `reluctantlyTill` char ')'
char ')' <|> fail "Expected ) to close array assignment"
return $ T_Array id words
where
readElement = (readIndexed <|> readRegular) `thenSkip` allspacing
readIndexed = do
id <- getNextId
index <- try $ do
x <- readArrayIndex
char '='
return x
value <- readNormalWord <|> nothing
return $ T_IndexedElement id index value
readRegular = readNormalWord
nothing = do
id <- getNextId
return $ T_Literal id "" | 657 | readArray = called "array assignment" $ do
id <- getNextId
char '('
allspacing
words <- readElement `reluctantlyTill` char ')'
char ')' <|> fail "Expected ) to close array assignment"
return $ T_Array id words
where
readElement = (readIndexed <|> readRegular) `thenSkip` allspacing
readIndexed = do
id <- getNextId
index <- try $ do
x <- readArrayIndex
char '='
return x
value <- readNormalWord <|> nothing
return $ T_IndexedElement id index value
readRegular = readNormalWord
nothing = do
id <- getNextId
return $ T_Literal id "" | 657 | readArray = called "array assignment" $ do
id <- getNextId
char '('
allspacing
words <- readElement `reluctantlyTill` char ')'
char ')' <|> fail "Expected ) to close array assignment"
return $ T_Array id words
where
readElement = (readIndexed <|> readRegular) `thenSkip` allspacing
readIndexed = do
id <- getNextId
index <- try $ do
x <- readArrayIndex
char '='
return x
value <- readNormalWord <|> nothing
return $ T_IndexedElement id index value
readRegular = readNormalWord
nothing = do
id <- getNextId
return $ T_Literal id "" | 657 | false | false | 0 | 11 | 211 | 187 | 85 | 102 | null | null |
isomorphism/csound-expression | src/Csound/Air/Live.hs | bsd-3-clause | ----------------------------------------------------
-- effect choosers
hpatchChooser :: (SigSpace a, Sigs a) => [(String, Patch a)] -> Int -> Source a
hpatchChooser = genPatchChooser hradioSig | 195 | hpatchChooser :: (SigSpace a, Sigs a) => [(String, Patch a)] -> Int -> Source a
hpatchChooser = genPatchChooser hradioSig | 121 | hpatchChooser = genPatchChooser hradioSig | 41 | true | true | 0 | 9 | 24 | 54 | 29 | 25 | null | null |
lukexi/haskell-opencv | src/OpenCV/Internal/ImgProc/MiscImgTransform/ColorCodes.hs | bsd-3-clause | bgr_YUY2 :: Proxy 'BGR_YUY2 ; bgr_YUY2 = Proxy | 50 | bgr_YUY2 :: Proxy 'BGR_YUY2
bgr_YUY2 = Proxy | 48 | bgr_YUY2 = Proxy | 18 | false | true | 0 | 6 | 11 | 17 | 9 | 8 | null | null |
anton-dessiatov/stack | src/Stack/New.hs | bsd-3-clause | writeTemplateFiles
:: MonadIO m
=> Map (Path Abs File) LB.ByteString -> m ()
writeTemplateFiles files =
forM_
(M.toList files)
(\(fp,bytes) ->
do ensureDir (parent fp)
liftIO (LB.writeFile (toFilePath fp) bytes)) | 271 | writeTemplateFiles
:: MonadIO m
=> Map (Path Abs File) LB.ByteString -> m ()
writeTemplateFiles files =
forM_
(M.toList files)
(\(fp,bytes) ->
do ensureDir (parent fp)
liftIO (LB.writeFile (toFilePath fp) bytes)) | 271 | writeTemplateFiles files =
forM_
(M.toList files)
(\(fp,bytes) ->
do ensureDir (parent fp)
liftIO (LB.writeFile (toFilePath fp) bytes)) | 186 | false | true | 0 | 14 | 88 | 109 | 52 | 57 | null | null |
osa1/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | bcc i (RESERVE 0) = "" | 22 | bcc i (RESERVE 0) = "" | 22 | bcc i (RESERVE 0) = "" | 22 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
brendanhay/gogol | gogol-cloudidentity/gen/Network/Google/Resource/CloudIdentity/Groups/Patch.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
gpUploadType :: Lens' GroupsPatch (Maybe Text)
gpUploadType
= lens _gpUploadType (\ s a -> s{_gpUploadType = a}) | 185 | gpUploadType :: Lens' GroupsPatch (Maybe Text)
gpUploadType
= lens _gpUploadType (\ s a -> s{_gpUploadType = a}) | 114 | gpUploadType
= lens _gpUploadType (\ s a -> s{_gpUploadType = a}) | 67 | true | true | 0 | 9 | 28 | 48 | 25 | 23 | null | null |
ezyang/ghc | libraries/template-haskell/Language/Haskell/TH/Lib.hs | bsd-3-clause | classD :: CxtQ -> Name -> [TyVarBndr] -> [FunDep] -> [DecQ] -> DecQ
classD ctxt cls tvs fds decs =
do
decs1 <- sequence decs
ctxt1 <- ctxt
return $ ClassD ctxt1 cls tvs fds decs1 | 192 | classD :: CxtQ -> Name -> [TyVarBndr] -> [FunDep] -> [DecQ] -> DecQ
classD ctxt cls tvs fds decs =
do
decs1 <- sequence decs
ctxt1 <- ctxt
return $ ClassD ctxt1 cls tvs fds decs1 | 192 | classD ctxt cls tvs fds decs =
do
decs1 <- sequence decs
ctxt1 <- ctxt
return $ ClassD ctxt1 cls tvs fds decs1 | 124 | false | true | 0 | 11 | 49 | 92 | 43 | 49 | null | null |
tolysz/hs-tls | core/Tests/PubKey.hs | bsd-3-clause | arbitraryDSAPair :: Gen (DSA.PublicKey, DSA.PrivateKey)
arbitraryDSAPair = do
priv <- choose (1, DSA.params_q dsaParams)
let pub = DSA.calculatePublic dsaParams priv
return (DSA.PublicKey dsaParams pub, DSA.PrivateKey dsaParams priv) | 245 | arbitraryDSAPair :: Gen (DSA.PublicKey, DSA.PrivateKey)
arbitraryDSAPair = do
priv <- choose (1, DSA.params_q dsaParams)
let pub = DSA.calculatePublic dsaParams priv
return (DSA.PublicKey dsaParams pub, DSA.PrivateKey dsaParams priv) | 245 | arbitraryDSAPair = do
priv <- choose (1, DSA.params_q dsaParams)
let pub = DSA.calculatePublic dsaParams priv
return (DSA.PublicKey dsaParams pub, DSA.PrivateKey dsaParams priv) | 189 | false | true | 0 | 11 | 38 | 87 | 42 | 45 | null | null |
Mathnerd314/atomo | src/Atomo/Run.hs | bsd-3-clause | run :: VM Value -> IO Value
run x = runWith (initEnv >> x) startEnv | 67 | run :: VM Value -> IO Value
run x = runWith (initEnv >> x) startEnv | 67 | run x = runWith (initEnv >> x) startEnv | 39 | false | true | 0 | 7 | 14 | 36 | 17 | 19 | null | null |
limaner2002/EPC-tools | USACScripts/src/Scripts/Random.hs | bsd-3-clause | arbitraryInput (Date _) = pure $ notImplemented "Date Picker" | 61 | arbitraryInput (Date _) = pure $ notImplemented "Date Picker" | 61 | arbitraryInput (Date _) = pure $ notImplemented "Date Picker" | 61 | false | false | 0 | 6 | 8 | 23 | 10 | 13 | null | null |
dysinger/amazonka | amazonka-swf/gen/Network/AWS/SWF/DescribeActivityType.hs | mpl-2.0 | -- | 'DescribeActivityType' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'datActivityType' @::@ 'ActivityType'
--
-- * 'datDomain' @::@ 'Text'
--
describeActivityType :: Text -- ^ 'datDomain'
-> ActivityType -- ^ 'datActivityType'
-> DescribeActivityType
describeActivityType p1 p2 = DescribeActivityType
{ _datDomain = p1
, _datActivityType = p2
} | 446 | describeActivityType :: Text -- ^ 'datDomain'
-> ActivityType -- ^ 'datActivityType'
-> DescribeActivityType
describeActivityType p1 p2 = DescribeActivityType
{ _datDomain = p1
, _datActivityType = p2
} | 262 | describeActivityType p1 p2 = DescribeActivityType
{ _datDomain = p1
, _datActivityType = p2
} | 111 | true | true | 0 | 8 | 112 | 57 | 33 | 24 | null | null |
anton-dessiatov/ghc | compiler/main/GhcMake.hs | bsd-3-clause | -- | Build a 'CompilationGraph' out of a list of strongly-connected modules,
-- also returning the first, if any, encountered module cycle.
buildCompGraph :: [SCC ModSummary] -> IO (CompilationGraph, Maybe [ModSummary])
buildCompGraph [] = return ([], Nothing) | 260 | buildCompGraph :: [SCC ModSummary] -> IO (CompilationGraph, Maybe [ModSummary])
buildCompGraph [] = return ([], Nothing) | 120 | buildCompGraph [] = return ([], Nothing) | 40 | true | true | 0 | 9 | 36 | 54 | 29 | 25 | null | null |
cchalmers/optical | src/Optical/Ocular.hs | bsd-3-clause | affine :: Affine t => AffineTraversal (t a) (t b) a b
affine = cloneAffineT anAffine | 84 | affine :: Affine t => AffineTraversal (t a) (t b) a b
affine = cloneAffineT anAffine | 84 | affine = cloneAffineT anAffine | 30 | false | true | 0 | 9 | 15 | 48 | 21 | 27 | null | null |
nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles | IO/src/IniParser.hs | gpl-3.0 | skipWhitespace :: Parser ()
skipWhitespace =
skipMany (char ' ' <|> char '\n') | 82 | skipWhitespace :: Parser ()
skipWhitespace =
skipMany (char ' ' <|> char '\n') | 82 | skipWhitespace =
skipMany (char ' ' <|> char '\n') | 54 | false | true | 1 | 8 | 16 | 36 | 15 | 21 | null | null |
kaisellgren/ankka | src/Main.hs | mit | processEvents :: GameState
processEvents = do
tc <- asks envEventsChan
me <- liftIO $ atomically $ tryReadTQueue tc
case me of
Just e -> do
processEvent e
processEvents
Nothing -> pure () | 239 | processEvents :: GameState
processEvents = do
tc <- asks envEventsChan
me <- liftIO $ atomically $ tryReadTQueue tc
case me of
Just e -> do
processEvent e
processEvents
Nothing -> pure () | 239 | processEvents = do
tc <- asks envEventsChan
me <- liftIO $ atomically $ tryReadTQueue tc
case me of
Just e -> do
processEvent e
processEvents
Nothing -> pure () | 212 | false | true | 0 | 12 | 83 | 75 | 33 | 42 | null | null |
mattias-lundell/timber-llvm | src/Core2Kindle.hs | bsd-3-clause | cRhs0 cBdy env n (ELet bs e)
| isTAbsEncoding bs = do (te,t,r) <- cRhs cBdy env n [] e
return (tAbsVars bs, te, t, r) | 182 | cRhs0 cBdy env n (ELet bs e)
| isTAbsEncoding bs = do (te,t,r) <- cRhs cBdy env n [] e
return (tAbsVars bs, te, t, r) | 182 | cRhs0 cBdy env n (ELet bs e)
| isTAbsEncoding bs = do (te,t,r) <- cRhs cBdy env n [] e
return (tAbsVars bs, te, t, r) | 182 | false | false | 0 | 10 | 90 | 82 | 40 | 42 | null | null |
brendanhay/gogol | gogol-searchconsole/gen/Network/Google/SearchConsole/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'TestStatus' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'tsStatus'
--
-- * 'tsDetails'
testStatus
:: TestStatus
testStatus = TestStatus' {_tsStatus = Nothing, _tsDetails = Nothing} | 298 | testStatus
:: TestStatus
testStatus = TestStatus' {_tsStatus = Nothing, _tsDetails = Nothing} | 97 | testStatus = TestStatus' {_tsStatus = Nothing, _tsDetails = Nothing} | 68 | true | true | 0 | 6 | 53 | 32 | 22 | 10 | null | null |
julmue/UntypedLambda | src/Language/Lambda/Semantics/Nameless/SmallStep.hs | bsd-3-clause | foldSR _ r (Reducible e) = r e | 30 | foldSR _ r (Reducible e) = r e | 30 | foldSR _ r (Reducible e) = r e | 30 | false | false | 1 | 6 | 7 | 25 | 10 | 15 | null | null |
jystic/hsimport | lib/HsImport/Main.hs | bsd-3-clause | hsimport :: Config -> IO ()
hsimport = Dyre.wrapMain $ Dyre.defaultParams
{ Dyre.projectName = "hsimport"
, Dyre.realMain = realMain
, Dyre.showError = \config err -> config { configError = Just err }
}
where
realMain :: Config -> IO ()
realMain config = do
case configError config of
Just error -> hPutStrLn stderr ("hsimport: " ++ error) >> exitFailure
_ -> return ()
args <- Args.hsImportArgs
maybeErr <- hsimportWithArgs config args
case maybeErr of
Just err -> hPutStrLn stderr ("hsimport: " ++ err) >> exitFailure
_ -> exitSuccess | 681 | hsimport :: Config -> IO ()
hsimport = Dyre.wrapMain $ Dyre.defaultParams
{ Dyre.projectName = "hsimport"
, Dyre.realMain = realMain
, Dyre.showError = \config err -> config { configError = Just err }
}
where
realMain :: Config -> IO ()
realMain config = do
case configError config of
Just error -> hPutStrLn stderr ("hsimport: " ++ error) >> exitFailure
_ -> return ()
args <- Args.hsImportArgs
maybeErr <- hsimportWithArgs config args
case maybeErr of
Just err -> hPutStrLn stderr ("hsimport: " ++ err) >> exitFailure
_ -> exitSuccess | 681 | hsimport = Dyre.wrapMain $ Dyre.defaultParams
{ Dyre.projectName = "hsimport"
, Dyre.realMain = realMain
, Dyre.showError = \config err -> config { configError = Just err }
}
where
realMain :: Config -> IO ()
realMain config = do
case configError config of
Just error -> hPutStrLn stderr ("hsimport: " ++ error) >> exitFailure
_ -> return ()
args <- Args.hsImportArgs
maybeErr <- hsimportWithArgs config args
case maybeErr of
Just err -> hPutStrLn stderr ("hsimport: " ++ err) >> exitFailure
_ -> exitSuccess | 653 | false | true | 2 | 14 | 232 | 206 | 101 | 105 | null | null |
cpennington/adventofcode | src/Advent/Day6.hs | bsd-3-clause | tgl Nothing = Just 2 | 20 | tgl Nothing = Just 2 | 20 | tgl Nothing = Just 2 | 20 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
Ian-Stewart-Binks/courseography | dependencies/HaXml-1.25.3/src/Text/XML/HaXml/OneOfN.hs | gpl-3.0 | foldOneOf20 a b c d e f g h i j k l m n o p q r s
t (SixteenOf20 z) = p z | 85 | foldOneOf20 a b c d e f g h i j k l m n o p q r s
t (SixteenOf20 z) = p z | 85 | foldOneOf20 a b c d e f g h i j k l m n o p q r s
t (SixteenOf20 z) = p z | 85 | false | false | 0 | 7 | 37 | 58 | 28 | 30 | null | null |
abakst/liquidhaskell | tests/todo/TreeMap0.hs | bsd-3-clause | size (Node xs) = 1 + sizes xs | 29 | size (Node xs) = 1 + sizes xs | 29 | size (Node xs) = 1 + sizes xs | 29 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
gencer/bond | compiler/src/Language/Bond/Parser.hs | mit | alias :: Parser Declaration
alias = do
name <- try (keyword "using") *> identifier <?> "alias definition"
params <- parameters
namespaces <- asks currentNamespaces
local (with params) $ Alias namespaces name params <$ equal <*> type_ <* semi
where
with params e = e { currentParams = params }
-- forward declaration | 338 | alias :: Parser Declaration
alias = do
name <- try (keyword "using") *> identifier <?> "alias definition"
params <- parameters
namespaces <- asks currentNamespaces
local (with params) $ Alias namespaces name params <$ equal <*> type_ <* semi
where
with params e = e { currentParams = params }
-- forward declaration | 338 | alias = do
name <- try (keyword "using") *> identifier <?> "alias definition"
params <- parameters
namespaces <- asks currentNamespaces
local (with params) $ Alias namespaces name params <$ equal <*> type_ <* semi
where
with params e = e { currentParams = params }
-- forward declaration | 310 | false | true | 0 | 13 | 74 | 112 | 53 | 59 | null | null |
mcschroeder/ghc | compiler/prelude/TysPrim.hs | bsd-3-clause | alphaTyVar, betaTyVar, gammaTyVar, deltaTyVar :: TyVar
(alphaTyVar:betaTyVar:gammaTyVar:deltaTyVar:_) = alphaTyVars | 115 | alphaTyVar, betaTyVar, gammaTyVar, deltaTyVar :: TyVar
(alphaTyVar:betaTyVar:gammaTyVar:deltaTyVar:_) = alphaTyVars | 115 | (alphaTyVar:betaTyVar:gammaTyVar:deltaTyVar:_) = alphaTyVars | 60 | false | true | 0 | 9 | 8 | 37 | 22 | 15 | null | null |
RaphaelJ/getwebb.org | Util/API.hs | gpl-3.0 | -- | Responds to the client with a status code and a set of errors in an JSON
-- array.
sendErrorResponse :: (MonadHandler m, ToAPIError a) => Status -> [a] -> m b
sendErrorResponse status errs =
sendResponseStatus status (array $ map toAPIError errs) | 255 | sendErrorResponse :: (MonadHandler m, ToAPIError a) => Status -> [a] -> m b
sendErrorResponse status errs =
sendResponseStatus status (array $ map toAPIError errs) | 167 | sendErrorResponse status errs =
sendResponseStatus status (array $ map toAPIError errs) | 91 | true | true | 0 | 8 | 47 | 64 | 33 | 31 | null | null |
irmikrys/Gomoku | src/Main.hs | bsd-3-clause | main :: IO ()
main = do
putStrLn ("\n============== " ++ show White ++ " Gomoku " ++ show Black ++ " ===============")
let emptyBoard = Board Map.empty
let board1 = addToBoard (Position 2 2) Black emptyBoard
--playerVSplayer (Game emptyBoard White)
--computerVSplayer (Game emptyBoard White) []
botVSbot (Game board1 White) (possibleMoves board1)
putStr "" | 370 | main :: IO ()
main = do
putStrLn ("\n============== " ++ show White ++ " Gomoku " ++ show Black ++ " ===============")
let emptyBoard = Board Map.empty
let board1 = addToBoard (Position 2 2) Black emptyBoard
--playerVSplayer (Game emptyBoard White)
--computerVSplayer (Game emptyBoard White) []
botVSbot (Game board1 White) (possibleMoves board1)
putStr "" | 370 | main = do
putStrLn ("\n============== " ++ show White ++ " Gomoku " ++ show Black ++ " ===============")
let emptyBoard = Board Map.empty
let board1 = addToBoard (Position 2 2) Black emptyBoard
--playerVSplayer (Game emptyBoard White)
--computerVSplayer (Game emptyBoard White) []
botVSbot (Game board1 White) (possibleMoves board1)
putStr "" | 356 | false | true | 0 | 14 | 67 | 121 | 54 | 67 | null | null |
aburnett88/HSat | src/HSat/Make/Instances/Common/Literal.hs | mit | removeVariable :: Variable -> LiteralSet -> LiteralSet
removeVariable v ls@LiteralSet{..} =
ls {
getVarsThatCanAppear = S.delete v getVarsThatCanAppear
} | 183 | removeVariable :: Variable -> LiteralSet -> LiteralSet
removeVariable v ls@LiteralSet{..} =
ls {
getVarsThatCanAppear = S.delete v getVarsThatCanAppear
} | 183 | removeVariable v ls@LiteralSet{..} =
ls {
getVarsThatCanAppear = S.delete v getVarsThatCanAppear
} | 108 | false | true | 1 | 9 | 48 | 57 | 26 | 31 | null | null |
adrianherrera/reil-parser | src/Data/REIL/Interpreter.hs | mit | -- | Read a value stored at a memory address, or a default value if it hasn't
-- previously been set
readMemory :: IS.Address -> a -> Environment a -> a
readMemory addr dflt env =
case M.lookup addr (memory env) of
Just val -> val
Nothing -> dflt
-- | Write a value to a memory address | 306 | readMemory :: IS.Address -> a -> Environment a -> a
readMemory addr dflt env =
case M.lookup addr (memory env) of
Just val -> val
Nothing -> dflt
-- | Write a value to a memory address | 205 | readMemory addr dflt env =
case M.lookup addr (memory env) of
Just val -> val
Nothing -> dflt
-- | Write a value to a memory address | 153 | true | true | 0 | 9 | 78 | 76 | 36 | 40 | null | null |
BenedictEggers/99problems | tests/MainTestSuite.hs | mit | prop_decodeEncodeModified :: [Int] -> Bool
prop_decodeEncodeModified xs = decodeModified (encodeModified xs) == xs | 114 | prop_decodeEncodeModified :: [Int] -> Bool
prop_decodeEncodeModified xs = decodeModified (encodeModified xs) == xs | 114 | prop_decodeEncodeModified xs = decodeModified (encodeModified xs) == xs | 71 | false | true | 0 | 8 | 12 | 34 | 17 | 17 | null | null |
bgold-cosmos/Tidal | src/Sound/Tidal/Params.hs | gpl-3.0 | pansplayCountTo :: String -> Pattern Double -> Pattern ValueMap
pansplayCountTo name ipat = innerJoin $ (\i -> pStateF "pansplay" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat | 174 | pansplayCountTo :: String -> Pattern Double -> Pattern ValueMap
pansplayCountTo name ipat = innerJoin $ (\i -> pStateF "pansplay" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat | 174 | pansplayCountTo name ipat = innerJoin $ (\i -> pStateF "pansplay" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat | 110 | false | true | 2 | 13 | 27 | 84 | 43 | 41 | null | null |
mightymoose/liquidhaskell | src/Language/Haskell/Liquid/Annotate.hs | bsd-3-clause | mkAnnMapErr (Crash ls _) = mapMaybe cinfoErr ls | 47 | mkAnnMapErr (Crash ls _) = mapMaybe cinfoErr ls | 47 | mkAnnMapErr (Crash ls _) = mapMaybe cinfoErr ls | 47 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
cmahon/opengl-examples | executable/Move.hs | bsd-3-clause | --------------------------------------------------------------------------------
runDemo :: Env -> State -> IO ()
runDemo env state =
void $ evalRWST (adjustWindow >> run) env state | 185 | runDemo :: Env -> State -> IO ()
runDemo env state =
void $ evalRWST (adjustWindow >> run) env state | 103 | runDemo env state =
void $ evalRWST (adjustWindow >> run) env state | 70 | true | true | 2 | 9 | 24 | 54 | 25 | 29 | null | null |
CulpaBS/wbBach | src/Futhark/Actions.hs | bsd-3-clause | seqCodeGenAction :: Action ExplicitMemory
seqCodeGenAction =
Action { actionName = "Compile sequentially"
, actionDescription = "Translate program into sequential C and write it on standard output."
, actionProcedure = either compileFail (liftIO . putStrLn) <=<
SequentialC.compileProg
} | 345 | seqCodeGenAction :: Action ExplicitMemory
seqCodeGenAction =
Action { actionName = "Compile sequentially"
, actionDescription = "Translate program into sequential C and write it on standard output."
, actionProcedure = either compileFail (liftIO . putStrLn) <=<
SequentialC.compileProg
} | 345 | seqCodeGenAction =
Action { actionName = "Compile sequentially"
, actionDescription = "Translate program into sequential C and write it on standard output."
, actionProcedure = either compileFail (liftIO . putStrLn) <=<
SequentialC.compileProg
} | 303 | false | true | 0 | 11 | 94 | 61 | 31 | 30 | null | null |
rehno-lindeque/elm-reactor | src/backend/Compile.hs | bsd-3-clause | toJavaScript :: FilePath -> IO BS.ByteString
toJavaScript filePath =
do result <- compile filePath
case result of
Right (code, name) ->
return $ BS.append code $ BS.pack $
"var runElmProgram = Elm." ++ name ++ ".fullscreen;"
Left errMsg ->
return $ BS.concat $
[ StaticFiles.errors
, BS.pack $ "function runElmProgram() {\n\tElm.Errors.fullscreen("
, LBS.toStrict (Json.encode errMsg)
, ");\n}"
] | 514 | toJavaScript :: FilePath -> IO BS.ByteString
toJavaScript filePath =
do result <- compile filePath
case result of
Right (code, name) ->
return $ BS.append code $ BS.pack $
"var runElmProgram = Elm." ++ name ++ ".fullscreen;"
Left errMsg ->
return $ BS.concat $
[ StaticFiles.errors
, BS.pack $ "function runElmProgram() {\n\tElm.Errors.fullscreen("
, LBS.toStrict (Json.encode errMsg)
, ");\n}"
] | 514 | toJavaScript filePath =
do result <- compile filePath
case result of
Right (code, name) ->
return $ BS.append code $ BS.pack $
"var runElmProgram = Elm." ++ name ++ ".fullscreen;"
Left errMsg ->
return $ BS.concat $
[ StaticFiles.errors
, BS.pack $ "function runElmProgram() {\n\tElm.Errors.fullscreen("
, LBS.toStrict (Json.encode errMsg)
, ");\n}"
] | 469 | false | true | 0 | 16 | 175 | 134 | 66 | 68 | null | null |
Muzietto/transformerz | haskell/kornish/kornish_01.hs | mit | getDomain :: Text -> Either LoginError Text
getDomain emailAddress = case (splitOn "@" emailAddress) of
[name,domain] -> Right domain
_ -> Left InvalidEmail | 210 | getDomain :: Text -> Either LoginError Text
getDomain emailAddress = case (splitOn "@" emailAddress) of
[name,domain] -> Right domain
_ -> Left InvalidEmail | 210 | getDomain emailAddress = case (splitOn "@" emailAddress) of
[name,domain] -> Right domain
_ -> Left InvalidEmail | 166 | false | true | 0 | 8 | 76 | 63 | 30 | 33 | null | null |
nevrenato/Hets_Fork | ExtModal/Print_AS.hs | gpl-2.0 | printMPrec :: Bool -> MODALITY -> MODALITY -> Doc
printMPrec b oP cP =
(if (if b then (>) else (>=)) (modPrec oP) $ modPrec cP then id else parens)
$ pretty cP | 163 | printMPrec :: Bool -> MODALITY -> MODALITY -> Doc
printMPrec b oP cP =
(if (if b then (>) else (>=)) (modPrec oP) $ modPrec cP then id else parens)
$ pretty cP | 163 | printMPrec b oP cP =
(if (if b then (>) else (>=)) (modPrec oP) $ modPrec cP then id else parens)
$ pretty cP | 113 | false | true | 2 | 10 | 36 | 86 | 44 | 42 | null | null |
ideas-edu/ideas | src/Ideas/Encoding/DecoderJSON.hs | apache-2.0 | jsonDecoder :: TypedDecoder a JSON
jsonDecoder tp = get >>= \json ->
case json of
Array xs -> decodeType tp // xs
_ -> fail "expecting an array" | 163 | jsonDecoder :: TypedDecoder a JSON
jsonDecoder tp = get >>= \json ->
case json of
Array xs -> decodeType tp // xs
_ -> fail "expecting an array" | 162 | jsonDecoder tp = get >>= \json ->
case json of
Array xs -> decodeType tp // xs
_ -> fail "expecting an array" | 127 | false | true | 2 | 10 | 46 | 63 | 29 | 34 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 288463 = 278 | 32 | getValueFromProduct 288463 = 278 | 32 | getValueFromProduct 288463 = 278 | 32 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
bjpop/berp | libs/src/Berp/Base/StdTypes/Type.hs | bsd-3-clause | instantiate :: Object -> Procedure
instantiate objectType args = do
identity <- liftIO $ newIdentity
dict <- liftIO $ emptyDictionary
let object =
Object
{ object_identity = identity
, object_type = objectType
, object_dict = dict
}
-- callMethodMaybe object initName []
-- everything should have an init??
_ <- callMethod object specialInitName args
return object | 431 | instantiate :: Object -> Procedure
instantiate objectType args = do
identity <- liftIO $ newIdentity
dict <- liftIO $ emptyDictionary
let object =
Object
{ object_identity = identity
, object_type = objectType
, object_dict = dict
}
-- callMethodMaybe object initName []
-- everything should have an init??
_ <- callMethod object specialInitName args
return object | 431 | instantiate objectType args = do
identity <- liftIO $ newIdentity
dict <- liftIO $ emptyDictionary
let object =
Object
{ object_identity = identity
, object_type = objectType
, object_dict = dict
}
-- callMethodMaybe object initName []
-- everything should have an init??
_ <- callMethod object specialInitName args
return object | 396 | false | true | 0 | 11 | 122 | 93 | 47 | 46 | null | null |
jdreaver/oanda-rest-api | src/OANDA/Internal/Request.hs | bsd-3-clause | baseRequest :: OandaEnv -> String -> String -> String -> Request
baseRequest env baseUrl requestType url =
unsafeParseRequest (requestType ++ " " ++ baseUrl ++ url)
& makeAuthHeader (accessToken env)
where
makeAuthHeader (AccessToken t) = addRequestHeader "Authorization" ("Bearer " `BS.append` t) | 307 | baseRequest :: OandaEnv -> String -> String -> String -> Request
baseRequest env baseUrl requestType url =
unsafeParseRequest (requestType ++ " " ++ baseUrl ++ url)
& makeAuthHeader (accessToken env)
where
makeAuthHeader (AccessToken t) = addRequestHeader "Authorization" ("Bearer " `BS.append` t) | 307 | baseRequest env baseUrl requestType url =
unsafeParseRequest (requestType ++ " " ++ baseUrl ++ url)
& makeAuthHeader (accessToken env)
where
makeAuthHeader (AccessToken t) = addRequestHeader "Authorization" ("Bearer " `BS.append` t) | 242 | false | true | 2 | 9 | 50 | 100 | 50 | 50 | null | null |
brendanhay/gogol | gogol-youtube-analytics/gen/Network/Google/YouTubeAnalytics/Types/Product.hs | mpl-2.0 | -- | The type of the column (\`DIMENSION\` or \`METRIC\`).
rtchColumnType :: Lens' ResultTableColumnHeader (Maybe Text)
rtchColumnType
= lens _rtchColumnType
(\ s a -> s{_rtchColumnType = a}) | 199 | rtchColumnType :: Lens' ResultTableColumnHeader (Maybe Text)
rtchColumnType
= lens _rtchColumnType
(\ s a -> s{_rtchColumnType = a}) | 140 | rtchColumnType
= lens _rtchColumnType
(\ s a -> s{_rtchColumnType = a}) | 79 | true | true | 0 | 9 | 34 | 48 | 25 | 23 | null | null |
markus1189/xmonad-contrib-710 | XMonad/Layout/Circle.hs | bsd-3-clause | satellite :: Rectangle -> Double -> Rectangle
satellite (Rectangle sx sy sw sh) a = Rectangle (sx + round (rx + rx * cos a))
(sy + round (ry + ry * sin a))
w h
where rx = fromIntegral (sw - w) / 2
ry = fromIntegral (sh - h) / 2
w = sw * 10 `div` 25
h = sh * 10 `div` 25 | 399 | satellite :: Rectangle -> Double -> Rectangle
satellite (Rectangle sx sy sw sh) a = Rectangle (sx + round (rx + rx * cos a))
(sy + round (ry + ry * sin a))
w h
where rx = fromIntegral (sw - w) / 2
ry = fromIntegral (sh - h) / 2
w = sw * 10 `div` 25
h = sh * 10 `div` 25 | 399 | satellite (Rectangle sx sy sw sh) a = Rectangle (sx + round (rx + rx * cos a))
(sy + round (ry + ry * sin a))
w h
where rx = fromIntegral (sw - w) / 2
ry = fromIntegral (sh - h) / 2
w = sw * 10 `div` 25
h = sh * 10 `div` 25 | 353 | false | true | 3 | 13 | 196 | 169 | 85 | 84 | null | null |
ben-schulz/Idris-dev | src/Idris/IdrisDoc.hs | bsd-3-clause | nbsp :: H.Html
nbsp = preEscapedToHtml (" " :: String) | 59 | nbsp :: H.Html
nbsp = preEscapedToHtml (" " :: String) | 59 | nbsp = preEscapedToHtml (" " :: String) | 44 | false | true | 0 | 6 | 8 | 22 | 12 | 10 | null | null |
databrary/databrary | src/Controller/Slot.hs | agpl-3.0 | viewSlot :: Bool -> ActionRoute (API, (Maybe (Id Volume), Id Slot))
viewSlot viewOrig =
action GET (pathAPI </> pathMaybe pathId </> pathSlotId)
$ \(api, (vi, i)) -> withAuth $ do
when (api == HTML && isJust vi) angular
c <- (maybe getSlot getVolumeSlot vi) PermissionPUBLIC i
let v = (containerVolume . slotContainer) c
_ <- maybeAction
(if volumeIsPublicRestricted v then Nothing else Just ()) -- block if restricted
case api of
JSON ->
okResponse []
<$> (slotJSONQuery viewOrig c =<< peeks Wai.queryString)
HTML
| isJust vi
-> return
$ okResponse []
$ BSC.pack
$ show
$ containerId
$ containerRow
$ slotContainer c
| otherwise
-> peeks $ redirectRouteResponse
movedPermanently301
[]
(viewSlot viewOrig)
( api
, ( Just
((volumeId
. volumeRow
. containerVolume
. slotContainer
)
c
)
, slotId c
)
) | 1,586 | viewSlot :: Bool -> ActionRoute (API, (Maybe (Id Volume), Id Slot))
viewSlot viewOrig =
action GET (pathAPI </> pathMaybe pathId </> pathSlotId)
$ \(api, (vi, i)) -> withAuth $ do
when (api == HTML && isJust vi) angular
c <- (maybe getSlot getVolumeSlot vi) PermissionPUBLIC i
let v = (containerVolume . slotContainer) c
_ <- maybeAction
(if volumeIsPublicRestricted v then Nothing else Just ()) -- block if restricted
case api of
JSON ->
okResponse []
<$> (slotJSONQuery viewOrig c =<< peeks Wai.queryString)
HTML
| isJust vi
-> return
$ okResponse []
$ BSC.pack
$ show
$ containerId
$ containerRow
$ slotContainer c
| otherwise
-> peeks $ redirectRouteResponse
movedPermanently301
[]
(viewSlot viewOrig)
( api
, ( Just
((volumeId
. volumeRow
. containerVolume
. slotContainer
)
c
)
, slotId c
)
) | 1,586 | viewSlot viewOrig =
action GET (pathAPI </> pathMaybe pathId </> pathSlotId)
$ \(api, (vi, i)) -> withAuth $ do
when (api == HTML && isJust vi) angular
c <- (maybe getSlot getVolumeSlot vi) PermissionPUBLIC i
let v = (containerVolume . slotContainer) c
_ <- maybeAction
(if volumeIsPublicRestricted v then Nothing else Just ()) -- block if restricted
case api of
JSON ->
okResponse []
<$> (slotJSONQuery viewOrig c =<< peeks Wai.queryString)
HTML
| isJust vi
-> return
$ okResponse []
$ BSC.pack
$ show
$ containerId
$ containerRow
$ slotContainer c
| otherwise
-> peeks $ redirectRouteResponse
movedPermanently301
[]
(viewSlot viewOrig)
( api
, ( Just
((volumeId
. volumeRow
. containerVolume
. slotContainer
)
c
)
, slotId c
)
) | 1,518 | false | true | 0 | 24 | 919 | 339 | 166 | 173 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT20.hs | gpl-3.0 | drop _ [] = [] | 22 | drop _ [] = [] | 22 | drop _ [] = [] | 22 | false | false | 0 | 6 | 12 | 19 | 8 | 11 | null | null |
steffenomak/file-indexer | src/Database/FileCache.hs | gpl-3.0 | -- | Removes a file.
removeFile :: MonadIO m
=> F.File -- ^ File to remove.
-> SqlPersistT m ()
removeFile file = maybe (return ())
(\i -> delete $
from $ \f ->
where_ (f ^. FileId ==. val (toSqlKey i :: Key File)))
(L.view F.id file) | 366 | removeFile :: MonadIO m
=> F.File -- ^ File to remove.
-> SqlPersistT m ()
removeFile file = maybe (return ())
(\i -> delete $
from $ \f ->
where_ (f ^. FileId ==. val (toSqlKey i :: Key File)))
(L.view F.id file) | 345 | removeFile file = maybe (return ())
(\i -> delete $
from $ \f ->
where_ (f ^. FileId ==. val (toSqlKey i :: Key File)))
(L.view F.id file) | 248 | true | true | 0 | 15 | 179 | 113 | 57 | 56 | null | null |
brendanhay/gogol | gogol-jobs/gen/Network/Google/Jobs/Types/Product.hs | mpl-2.0 | -- | Additional information for the API invocation, such as the request
-- tracking id.
sjrMetadata :: Lens' SearchJobsResponse (Maybe ResponseMetadata)
sjrMetadata
= lens _sjrMetadata (\ s a -> s{_sjrMetadata = a}) | 217 | sjrMetadata :: Lens' SearchJobsResponse (Maybe ResponseMetadata)
sjrMetadata
= lens _sjrMetadata (\ s a -> s{_sjrMetadata = a}) | 129 | sjrMetadata
= lens _sjrMetadata (\ s a -> s{_sjrMetadata = a}) | 64 | true | true | 0 | 9 | 33 | 49 | 26 | 23 | null | null |
ComputationWithBoundedResources/slogic | src/SLogic/Logic/Formula.hs | bsd-3-clause | -- | Returns a Boolean value.
bool :: Bool -> Formula v
bool True = Top | 71 | bool :: Bool -> Formula v
bool True = Top | 41 | bool True = Top | 15 | true | true | 0 | 7 | 15 | 27 | 12 | 15 | null | null |
paulajessicab/NewDBR | src/Parser.hs | gpl-3.0 | parseFontFamily :: Parser FontFamily
parseFontFamily = try (do {string "roman";spaces; return Roman})
<|> try (do {string "serif";spaces; return SansSerif})
<|> try (do {string "mono";spaces; return Mono}) | 233 | parseFontFamily :: Parser FontFamily
parseFontFamily = try (do {string "roman";spaces; return Roman})
<|> try (do {string "serif";spaces; return SansSerif})
<|> try (do {string "mono";spaces; return Mono}) | 233 | parseFontFamily = try (do {string "roman";spaces; return Roman})
<|> try (do {string "serif";spaces; return SansSerif})
<|> try (do {string "mono";spaces; return Mono}) | 196 | false | true | 7 | 9 | 53 | 106 | 51 | 55 | null | null |
OS2World/DEV-UTIL-HUGS | libraries/Graphics/Rendering/OpenGL/GL/PixelRectangles.hs | bsd-3-clause | ptr_glHistogram :: FunPtr a ; ptr_glHistogram = unsafePerformIO (Graphics.Rendering.OpenGL.GL.Extensions.getProcAddress ("GL_ARB_imaging") ("glHistogram")) | 155 | ptr_glHistogram :: FunPtr a
ptr_glHistogram = unsafePerformIO (Graphics.Rendering.OpenGL.GL.Extensions.getProcAddress ("GL_ARB_imaging") ("glHistogram")) | 153 | ptr_glHistogram = unsafePerformIO (Graphics.Rendering.OpenGL.GL.Extensions.getProcAddress ("GL_ARB_imaging") ("glHistogram")) | 125 | false | true | 0 | 8 | 10 | 38 | 22 | 16 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.