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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
brendanhay/gogol | gogol-firebase-dynamiclinks/gen/Network/Google/FirebaseDynamicLinks/Types/Product.hs | mpl-2.0 | -- | Full long Dynamic Link URL with desired query parameters specified. For
-- example,
-- \"https:\/\/sample.app.goo.gl\/?link=http:\/\/www.google.com&apn=com.sample\",
-- [Learn
-- more](https:\/\/firebase.google.com\/docs\/reference\/dynamic-links\/link-shortener).
cmslrLongDynamicLink :: Lens' CreateManagedShortLinkRequest (Maybe Text)
cmslrLongDynamicLink
= lens _cmslrLongDynamicLink
(\ s a -> s{_cmslrLongDynamicLink = a}) | 440 | cmslrLongDynamicLink :: Lens' CreateManagedShortLinkRequest (Maybe Text)
cmslrLongDynamicLink
= lens _cmslrLongDynamicLink
(\ s a -> s{_cmslrLongDynamicLink = a}) | 170 | cmslrLongDynamicLink
= lens _cmslrLongDynamicLink
(\ s a -> s{_cmslrLongDynamicLink = a}) | 97 | true | true | 0 | 9 | 45 | 52 | 29 | 23 | null | null |
spechub/Hets | CSL/ASUtils.hs | gpl-2.0 | updateDefinition e' (FunDef l _) = FunDef l e' | 46 | updateDefinition e' (FunDef l _) = FunDef l e' | 46 | updateDefinition e' (FunDef l _) = FunDef l e' | 46 | false | false | 0 | 7 | 8 | 24 | 11 | 13 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs | mpl-2.0 | -- | Floodlight configuration ID of this floodlight activity group. This is a
-- required field.
fagFloodlightConfigurationId :: Lens' FloodlightActivityGroup (Maybe Int64)
fagFloodlightConfigurationId
= lens _fagFloodlightConfigurationId
(\ s a -> s{_fagFloodlightConfigurationId = a})
. mapping _Coerce | 318 | fagFloodlightConfigurationId :: Lens' FloodlightActivityGroup (Maybe Int64)
fagFloodlightConfigurationId
= lens _fagFloodlightConfigurationId
(\ s a -> s{_fagFloodlightConfigurationId = a})
. mapping _Coerce | 221 | fagFloodlightConfigurationId
= lens _fagFloodlightConfigurationId
(\ s a -> s{_fagFloodlightConfigurationId = a})
. mapping _Coerce | 145 | true | true | 1 | 8 | 49 | 59 | 29 | 30 | null | null |
anttisalonen/starrover2 | src/Utils.hs | mit | randomPair :: (Random t, RandomGen s, MonadState s m) => (t, t) -> m (t, t)
randomPair range = do
a <- randomThingR range
a' <- randomThingR range
return (a, a') | 167 | randomPair :: (Random t, RandomGen s, MonadState s m) => (t, t) -> m (t, t)
randomPair range = do
a <- randomThingR range
a' <- randomThingR range
return (a, a') | 167 | randomPair range = do
a <- randomThingR range
a' <- randomThingR range
return (a, a') | 91 | false | true | 0 | 8 | 36 | 88 | 44 | 44 | null | null |
kylcarte/wangtiles | src/Util.hs | bsd-3-clause | -- }}}
-- Numerical {{{
withFloat :: (Float -> Float) -> Int -> Int
withFloat f = fromEnum . f . toEnum | 105 | withFloat :: (Float -> Float) -> Int -> Int
withFloat f = fromEnum . f . toEnum | 79 | withFloat f = fromEnum . f . toEnum | 35 | true | true | 0 | 7 | 23 | 39 | 21 | 18 | null | null |
gcampax/ghc | compiler/main/DynFlags.hs | bsd-3-clause | setOverlappingInsts True = do
l <- getCurLoc
upd (\d -> d { overlapInstLoc = l })
deprecate "instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS" | 166 | setOverlappingInsts True = do
l <- getCurLoc
upd (\d -> d { overlapInstLoc = l })
deprecate "instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS" | 166 | setOverlappingInsts True = do
l <- getCurLoc
upd (\d -> d { overlapInstLoc = l })
deprecate "instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS" | 166 | false | false | 0 | 11 | 27 | 45 | 21 | 24 | null | null |
brendanhay/gogol | gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs | mpl-2.0 | -- | The date of shipping of the shipment, in ISO 8601 format.
rsShippingDate :: Lens' ReturnShipment (Maybe Text)
rsShippingDate
= lens _rsShippingDate
(\ s a -> s{_rsShippingDate = a}) | 194 | rsShippingDate :: Lens' ReturnShipment (Maybe Text)
rsShippingDate
= lens _rsShippingDate
(\ s a -> s{_rsShippingDate = a}) | 131 | rsShippingDate
= lens _rsShippingDate
(\ s a -> s{_rsShippingDate = a}) | 79 | true | true | 0 | 9 | 37 | 48 | 25 | 23 | null | null |
kwrooijen/sdl-game | End/UI.hs | gpl-3.0 | handleInput (KeyDown (Keysym SDLK_s _ _)) = calcVel (+) y y | 59 | handleInput (KeyDown (Keysym SDLK_s _ _)) = calcVel (+) y y | 59 | handleInput (KeyDown (Keysym SDLK_s _ _)) = calcVel (+) y y | 59 | false | false | 0 | 8 | 10 | 35 | 17 | 18 | null | null |
aleator/simple-dc1394 | System/Camera/Firewire/Simple.hs | bsd-3-clause | fromVideoMode Mode_1600x1200_MONO16 = c'DC1394_VIDEO_MODE_1600x1200_MONO16 | 74 | fromVideoMode Mode_1600x1200_MONO16 = c'DC1394_VIDEO_MODE_1600x1200_MONO16 | 74 | fromVideoMode Mode_1600x1200_MONO16 = c'DC1394_VIDEO_MODE_1600x1200_MONO16 | 74 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
gridaphobe/ghc | compiler/basicTypes/RdrName.hs | bsd-3-clause | pprGlobalRdrEnv :: Bool -> GlobalRdrEnv -> SDoc
pprGlobalRdrEnv locals_only env
= vcat [ text "GlobalRdrEnv" <+> ppWhen locals_only (ptext (sLit "(locals only)"))
<+> lbrace
, nest 2 (vcat [ pp (remove_locals gre_list) | gre_list <- occEnvElts env ]
<+> rbrace) ]
where
remove_locals gres | locals_only = filter isLocalGRE gres
| otherwise = gres
pp [] = empty
pp gres = hang (ppr occ
<+> parens (text "unique" <+> ppr (getUnique occ))
<> colon)
2 (vcat (map ppr gres))
where
occ = nameOccName (gre_name (head gres)) | 667 | pprGlobalRdrEnv :: Bool -> GlobalRdrEnv -> SDoc
pprGlobalRdrEnv locals_only env
= vcat [ text "GlobalRdrEnv" <+> ppWhen locals_only (ptext (sLit "(locals only)"))
<+> lbrace
, nest 2 (vcat [ pp (remove_locals gre_list) | gre_list <- occEnvElts env ]
<+> rbrace) ]
where
remove_locals gres | locals_only = filter isLocalGRE gres
| otherwise = gres
pp [] = empty
pp gres = hang (ppr occ
<+> parens (text "unique" <+> ppr (getUnique occ))
<> colon)
2 (vcat (map ppr gres))
where
occ = nameOccName (gre_name (head gres)) | 667 | pprGlobalRdrEnv locals_only env
= vcat [ text "GlobalRdrEnv" <+> ppWhen locals_only (ptext (sLit "(locals only)"))
<+> lbrace
, nest 2 (vcat [ pp (remove_locals gre_list) | gre_list <- occEnvElts env ]
<+> rbrace) ]
where
remove_locals gres | locals_only = filter isLocalGRE gres
| otherwise = gres
pp [] = empty
pp gres = hang (ppr occ
<+> parens (text "unique" <+> ppr (getUnique occ))
<> colon)
2 (vcat (map ppr gres))
where
occ = nameOccName (gre_name (head gres)) | 619 | false | true | 0 | 14 | 236 | 227 | 108 | 119 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/basicTypes/OccName.hs | bsd-3-clause | mkClsOccFS :: FastString -> OccName
mkClsOccFS = mkOccNameFS clsName | 68 | mkClsOccFS :: FastString -> OccName
mkClsOccFS = mkOccNameFS clsName | 68 | mkClsOccFS = mkOccNameFS clsName | 32 | false | true | 0 | 7 | 8 | 25 | 10 | 15 | null | null |
fedelebron/AVL | Data/Tree/AVL/Static/Internal.hs | bsd-3-clause | rebalance t (LRC a (Leftie d t1 t2) ctx) = rebalance z ctx
where
z = Balanced d t1 (Balanced a t2 t) | 106 | rebalance t (LRC a (Leftie d t1 t2) ctx) = rebalance z ctx
where
z = Balanced d t1 (Balanced a t2 t) | 106 | rebalance t (LRC a (Leftie d t1 t2) ctx) = rebalance z ctx
where
z = Balanced d t1 (Balanced a t2 t) | 106 | false | false | 1 | 8 | 28 | 66 | 29 | 37 | null | null |
DaMSL/K3 | src/Language/K3/Runtime/Engine.hs | apache-2.0 | genericHasWrite :: Identifier -> EEndpoints a b -> EngineM b (Maybe Bool)
genericHasWrite n endpoints' = getEndpoint n endpoints' >>= \case
Nothing -> return Nothing
Just e -> do
writeable <- liftIO (maybe (return True) SIO.hIsWritable $ getSystemHandle $ handle e)
invalidBuffer <- liftIO (maybe (return False) fullEBuffer $ buffer e)
return . Just $ writeable && not invalidBuffer | 412 | genericHasWrite :: Identifier -> EEndpoints a b -> EngineM b (Maybe Bool)
genericHasWrite n endpoints' = getEndpoint n endpoints' >>= \case
Nothing -> return Nothing
Just e -> do
writeable <- liftIO (maybe (return True) SIO.hIsWritable $ getSystemHandle $ handle e)
invalidBuffer <- liftIO (maybe (return False) fullEBuffer $ buffer e)
return . Just $ writeable && not invalidBuffer | 412 | genericHasWrite n endpoints' = getEndpoint n endpoints' >>= \case
Nothing -> return Nothing
Just e -> do
writeable <- liftIO (maybe (return True) SIO.hIsWritable $ getSystemHandle $ handle e)
invalidBuffer <- liftIO (maybe (return False) fullEBuffer $ buffer e)
return . Just $ writeable && not invalidBuffer | 338 | false | true | 3 | 18 | 88 | 154 | 71 | 83 | null | null |
Pitometsu/bake | src/Development/Bake/Server/Database.hs | bsd-3-clause | rnTest = column rnTable "test" :: Column (Maybe Test) | 53 | rnTest = column rnTable "test" :: Column (Maybe Test) | 53 | rnTest = column rnTable "test" :: Column (Maybe Test) | 53 | false | false | 0 | 7 | 8 | 23 | 11 | 12 | null | null |
jacekm-git/HsPredictor | tests/TestSuites/ExportCSVSpec.hs | gpl-3.0 | setUp = do
removeIfExists testDbPath
loadCSV testFilePath testDbPath | 72 | setUp = do
removeIfExists testDbPath
loadCSV testFilePath testDbPath | 72 | setUp = do
removeIfExists testDbPath
loadCSV testFilePath testDbPath | 72 | false | false | 1 | 8 | 11 | 24 | 8 | 16 | null | null |
ojw/admin-and-dev | src/DB/Server.hs | bsd-3-clause | withRemoteAcid :: Maybe DBConfig
-> (Acid -> IO a)
-> IO a
withRemoteAcid mDBConfig f =
let dbConfig = fromMaybe defaultDBConfig mDBConfig in
bracket (openRemoteState (view _1 $ authLocation dbConfig) (view _2 $ authLocation dbConfig)) closeAcidState $ \auth ->
bracket (openRemoteState (view _1 $ profileLocation dbConfig) (view _2 $ authLocation dbConfig)) closeAcidState $ \profile ->
bracket (openRemoteState (view _1 $ locationLocation dbConfig) (view _2 $ authLocation dbConfig)) closeAcidState $ \location ->
f (Acid auth profile location) | 611 | withRemoteAcid :: Maybe DBConfig
-> (Acid -> IO a)
-> IO a
withRemoteAcid mDBConfig f =
let dbConfig = fromMaybe defaultDBConfig mDBConfig in
bracket (openRemoteState (view _1 $ authLocation dbConfig) (view _2 $ authLocation dbConfig)) closeAcidState $ \auth ->
bracket (openRemoteState (view _1 $ profileLocation dbConfig) (view _2 $ authLocation dbConfig)) closeAcidState $ \profile ->
bracket (openRemoteState (view _1 $ locationLocation dbConfig) (view _2 $ authLocation dbConfig)) closeAcidState $ \location ->
f (Acid auth profile location) | 611 | withRemoteAcid mDBConfig f =
let dbConfig = fromMaybe defaultDBConfig mDBConfig in
bracket (openRemoteState (view _1 $ authLocation dbConfig) (view _2 $ authLocation dbConfig)) closeAcidState $ \auth ->
bracket (openRemoteState (view _1 $ profileLocation dbConfig) (view _2 $ authLocation dbConfig)) closeAcidState $ \profile ->
bracket (openRemoteState (view _1 $ locationLocation dbConfig) (view _2 $ authLocation dbConfig)) closeAcidState $ \location ->
f (Acid auth profile location) | 522 | false | true | 0 | 17 | 140 | 213 | 101 | 112 | null | null |
mainland/dph | dph-examples/lib/System/Console/ParseArgs.hs | bsd-3-clause | -- |There's probably a better way to do this.
perhaps b s = if b then s else "" | 79 | perhaps b s = if b then s else "" | 33 | perhaps b s = if b then s else "" | 33 | true | false | 1 | 6 | 18 | 25 | 11 | 14 | null | null |
maxeler/maxskins | examples/MovingAverage/client/hs/AdvancedStatic/MovingAverageClient.hs | bsd-2-clause | randomlist :: Int -> StdGen -> [Double]
randomlist n = Data.List.take n . Data.List.unfoldr (Just . randomR (1, 1000)) | 119 | randomlist :: Int -> StdGen -> [Double]
randomlist n = Data.List.take n . Data.List.unfoldr (Just . randomR (1, 1000)) | 119 | randomlist n = Data.List.take n . Data.List.unfoldr (Just . randomR (1, 1000)) | 79 | false | true | 0 | 10 | 19 | 57 | 30 | 27 | null | null |
NKMR6194/carrot | src/Eval.hs | mit | evalAST env (IntLitNode x) = do
return (env, genIntObject x) | 62 | evalAST env (IntLitNode x) = do
return (env, genIntObject x) | 62 | evalAST env (IntLitNode x) = do
return (env, genIntObject x) | 62 | false | false | 0 | 9 | 11 | 32 | 15 | 17 | null | null |
tyoko-dev/rwhile-B-haskell | src/Eval.hs | agpl-3.0 | update :: Ident -> Val -> Env -> Env
update x v [] = error ("in update: Variable " ++ x ++ " is not found") | 117 | update :: Ident -> Val -> Env -> Env
update x v [] = error ("in update: Variable " ++ x ++ " is not found") | 117 | update x v [] = error ("in update: Variable " ++ x ++ " is not found") | 80 | false | true | 0 | 10 | 35 | 51 | 24 | 27 | null | null |
gnn/Hets | Common/Keywords.hs | gpl-2.0 | -- * CspCasl key signs
-- | Prefix processes
prefix_procS :: String
prefix_procS = "->" | 88 | prefix_procS :: String
prefix_procS = "->" | 42 | prefix_procS = "->" | 19 | true | true | 0 | 6 | 15 | 20 | 9 | 11 | null | null |
todays-mitsui/lambda2ski | src/Expr.hs | mit | compile context (e :$ e') = compile context e :$ compile context e' | 69 | compile context (e :$ e') = compile context e :$ compile context e' | 69 | compile context (e :$ e') = compile context e :$ compile context e' | 69 | false | false | 0 | 7 | 14 | 33 | 15 | 18 | null | null |
teleshoes/taffybar | src/System/Taffybar/SimpleConfig.hs | bsd-3-clause | -- | Convert a 'SimpleTaffyConfig' into a 'BC.TaffybarConfig' that can be used
-- with 'startTaffybar' or 'dyreTaffybar'.
toTaffyConfig :: SimpleTaffyConfig -> BC.TaffybarConfig
toTaffyConfig conf =
def
{ BC.getBarConfigsParam = configGetter
, BC.cssPaths = cssPaths conf
, BC.startupHook = startupHook conf
}
where
configGetter = do
SimpleBarConfigs configsVar <-
getStateDefault $ lift (SimpleBarConfigs <$> MV.newMVar [])
monitorNumbers <- monitorsAction conf
let lookupWithIndex barConfigs monitorNumber =
(monitorNumber, lookup monitorNumber barConfigs)
lookupAndUpdate barConfigs = do
let (alreadyPresent, toCreate) =
partition (isJust . snd) $
map (lookupWithIndex barConfigs) monitorNumbers
alreadyPresentConfigs = mapMaybe snd alreadyPresent
newlyCreated <-
mapM (forkM return (toBarConfig conf) . fst) toCreate
let result = map snd newlyCreated ++ alreadyPresentConfigs
return (barConfigs ++ newlyCreated, result)
lift $ MV.modifyMVar configsVar lookupAndUpdate
-- | Start taffybar using dyre with a 'SimpleTaffybarConfig'. | 1,233 | toTaffyConfig :: SimpleTaffyConfig -> BC.TaffybarConfig
toTaffyConfig conf =
def
{ BC.getBarConfigsParam = configGetter
, BC.cssPaths = cssPaths conf
, BC.startupHook = startupHook conf
}
where
configGetter = do
SimpleBarConfigs configsVar <-
getStateDefault $ lift (SimpleBarConfigs <$> MV.newMVar [])
monitorNumbers <- monitorsAction conf
let lookupWithIndex barConfigs monitorNumber =
(monitorNumber, lookup monitorNumber barConfigs)
lookupAndUpdate barConfigs = do
let (alreadyPresent, toCreate) =
partition (isJust . snd) $
map (lookupWithIndex barConfigs) monitorNumbers
alreadyPresentConfigs = mapMaybe snd alreadyPresent
newlyCreated <-
mapM (forkM return (toBarConfig conf) . fst) toCreate
let result = map snd newlyCreated ++ alreadyPresentConfigs
return (barConfigs ++ newlyCreated, result)
lift $ MV.modifyMVar configsVar lookupAndUpdate
-- | Start taffybar using dyre with a 'SimpleTaffybarConfig'. | 1,111 | toTaffyConfig conf =
def
{ BC.getBarConfigsParam = configGetter
, BC.cssPaths = cssPaths conf
, BC.startupHook = startupHook conf
}
where
configGetter = do
SimpleBarConfigs configsVar <-
getStateDefault $ lift (SimpleBarConfigs <$> MV.newMVar [])
monitorNumbers <- monitorsAction conf
let lookupWithIndex barConfigs monitorNumber =
(monitorNumber, lookup monitorNumber barConfigs)
lookupAndUpdate barConfigs = do
let (alreadyPresent, toCreate) =
partition (isJust . snd) $
map (lookupWithIndex barConfigs) monitorNumbers
alreadyPresentConfigs = mapMaybe snd alreadyPresent
newlyCreated <-
mapM (forkM return (toBarConfig conf) . fst) toCreate
let result = map snd newlyCreated ++ alreadyPresentConfigs
return (barConfigs ++ newlyCreated, result)
lift $ MV.modifyMVar configsVar lookupAndUpdate
-- | Start taffybar using dyre with a 'SimpleTaffybarConfig'. | 1,055 | true | true | 0 | 18 | 326 | 266 | 130 | 136 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/readOct_1.hs | mit | primCharToInt :: Char -> MyInt;
primCharToInt (Char x) = x | 60 | primCharToInt :: Char -> MyInt
primCharToInt (Char x) = x | 59 | primCharToInt (Char x) = x | 26 | false | true | 1 | 9 | 11 | 32 | 14 | 18 | null | null |
wouwouwou/2017_module_8 | src/haskell/PP-project-2016/lib/sprockell/Sprockell.hs | apache-2.0 | nextSP :: SPCode -> MemAddr -> MemAddr
nextSP spCode sp = case spCode of
Down -> sp-1
Flat -> sp
Up -> sp+1
-- =====================================================================================
-- sendOut: to calculate output request to shared memory
-- ===================================================================================== | 378 | nextSP :: SPCode -> MemAddr -> MemAddr
nextSP spCode sp = case spCode of
Down -> sp-1
Flat -> sp
Up -> sp+1
-- =====================================================================================
-- sendOut: to calculate output request to shared memory
-- ===================================================================================== | 378 | nextSP spCode sp = case spCode of
Down -> sp-1
Flat -> sp
Up -> sp+1
-- =====================================================================================
-- sendOut: to calculate output request to shared memory
-- ===================================================================================== | 339 | false | true | 3 | 6 | 71 | 66 | 31 | 35 | null | null |
expipiplus1/vulkan | openxr/src/OpenXR/Core10/Input.hs | bsd-3-clause | -- | xrGetActionStateVector2f - Gets 2D float vector action state
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-successcodes Success>]
--
-- - 'OpenXR.Core10.Enums.Result.SUCCESS'
--
-- - 'OpenXR.Core10.Enums.Result.SESSION_LOSS_PENDING'
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-errorcodes Failure>]
--
-- - 'OpenXR.Core10.Enums.Result.ERROR_INSTANCE_LOST'
--
-- - 'OpenXR.Core10.Enums.Result.ERROR_SESSION_LOST'
--
-- - 'OpenXR.Core10.Enums.Result.ERROR_RUNTIME_FAILURE'
--
-- - 'OpenXR.Core10.Enums.Result.ERROR_HANDLE_INVALID'
--
-- - 'OpenXR.Core10.Enums.Result.ERROR_ACTIONSET_NOT_ATTACHED'
--
-- - 'OpenXR.Core10.Enums.Result.ERROR_ACTION_TYPE_MISMATCH'
--
-- - 'OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE'
--
-- - 'OpenXR.Core10.Enums.Result.ERROR_PATH_INVALID'
--
-- - 'OpenXR.Core10.Enums.Result.ERROR_PATH_UNSUPPORTED'
--
-- = See Also
--
-- 'ActionStateGetInfo', 'ActionStateVector2f',
-- 'OpenXR.Core10.Handles.Session', 'createAction'
getActionStateVector2f :: forall io
. (MonadIO io)
=> -- | @session@ is the 'OpenXR.Core10.Handles.Session' to query.
--
-- #VUID-xrGetActionStateVector2f-session-parameter# @session@ /must/ be a
-- valid 'OpenXR.Core10.Handles.Session' handle
Session
-> -- | @getInfo@ is a pointer to 'ActionStateGetInfo' to provide action and
-- subaction paths information.
--
-- #VUID-xrGetActionStateVector2f-getInfo-parameter# @getInfo@ /must/ be a
-- pointer to a valid 'ActionStateGetInfo' structure
ActionStateGetInfo
-> io (Result, ActionStateVector2f)
getActionStateVector2f session getInfo = liftIO . evalContT $ do
let xrGetActionStateVector2fPtr = pXrGetActionStateVector2f (case session of Session{instanceCmds} -> instanceCmds)
lift $ unless (xrGetActionStateVector2fPtr /= nullFunPtr) $
throwIO $ IOError Nothing InvalidArgument "" "The function pointer for xrGetActionStateVector2f is null" Nothing Nothing
let xrGetActionStateVector2f' = mkXrGetActionStateVector2f xrGetActionStateVector2fPtr
getInfo' <- ContT $ withCStruct (getInfo)
pState <- ContT (withZeroCStruct @ActionStateVector2f)
r <- lift $ traceAroundEvent "xrGetActionStateVector2f" (xrGetActionStateVector2f' (sessionHandle (session)) getInfo' (pState))
lift $ when (r < SUCCESS) (throwIO (OpenXrException r))
state <- lift $ peekCStruct @ActionStateVector2f pState
pure $ (r, state) | 2,833 | getActionStateVector2f :: forall io
. (MonadIO io)
=> -- | @session@ is the 'OpenXR.Core10.Handles.Session' to query.
--
-- #VUID-xrGetActionStateVector2f-session-parameter# @session@ /must/ be a
-- valid 'OpenXR.Core10.Handles.Session' handle
Session
-> -- | @getInfo@ is a pointer to 'ActionStateGetInfo' to provide action and
-- subaction paths information.
--
-- #VUID-xrGetActionStateVector2f-getInfo-parameter# @getInfo@ /must/ be a
-- pointer to a valid 'ActionStateGetInfo' structure
ActionStateGetInfo
-> io (Result, ActionStateVector2f)
getActionStateVector2f session getInfo = liftIO . evalContT $ do
let xrGetActionStateVector2fPtr = pXrGetActionStateVector2f (case session of Session{instanceCmds} -> instanceCmds)
lift $ unless (xrGetActionStateVector2fPtr /= nullFunPtr) $
throwIO $ IOError Nothing InvalidArgument "" "The function pointer for xrGetActionStateVector2f is null" Nothing Nothing
let xrGetActionStateVector2f' = mkXrGetActionStateVector2f xrGetActionStateVector2fPtr
getInfo' <- ContT $ withCStruct (getInfo)
pState <- ContT (withZeroCStruct @ActionStateVector2f)
r <- lift $ traceAroundEvent "xrGetActionStateVector2f" (xrGetActionStateVector2f' (sessionHandle (session)) getInfo' (pState))
lift $ when (r < SUCCESS) (throwIO (OpenXrException r))
state <- lift $ peekCStruct @ActionStateVector2f pState
pure $ (r, state) | 1,699 | getActionStateVector2f session getInfo = liftIO . evalContT $ do
let xrGetActionStateVector2fPtr = pXrGetActionStateVector2f (case session of Session{instanceCmds} -> instanceCmds)
lift $ unless (xrGetActionStateVector2fPtr /= nullFunPtr) $
throwIO $ IOError Nothing InvalidArgument "" "The function pointer for xrGetActionStateVector2f is null" Nothing Nothing
let xrGetActionStateVector2f' = mkXrGetActionStateVector2f xrGetActionStateVector2fPtr
getInfo' <- ContT $ withCStruct (getInfo)
pState <- ContT (withZeroCStruct @ActionStateVector2f)
r <- lift $ traceAroundEvent "xrGetActionStateVector2f" (xrGetActionStateVector2f' (sessionHandle (session)) getInfo' (pState))
lift $ when (r < SUCCESS) (throwIO (OpenXrException r))
state <- lift $ peekCStruct @ActionStateVector2f pState
pure $ (r, state) | 825 | true | true | 0 | 17 | 645 | 314 | 175 | 139 | null | null |
brendanhay/gogol | gogol-file/gen/Network/Google/File/Types/Product.hs | mpl-2.0 | -- | Properties of the object. Contains field \'type with type URL.
lmAddtional :: Lens' LocationMetadata (HashMap Text JSONValue)
lmAddtional
= lens _lmAddtional (\ s a -> s{_lmAddtional = a}) .
_Coerce | 211 | lmAddtional :: Lens' LocationMetadata (HashMap Text JSONValue)
lmAddtional
= lens _lmAddtional (\ s a -> s{_lmAddtional = a}) .
_Coerce | 143 | lmAddtional
= lens _lmAddtional (\ s a -> s{_lmAddtional = a}) .
_Coerce | 80 | true | true | 0 | 10 | 39 | 54 | 28 | 26 | null | null |
FranklinChen/brick | programs/BorderDemo.hs | bsd-3-clause | mkBorderDemo :: (T.Text, BS.BorderStyle) -> Widget
mkBorderDemo (styleName, sty) =
withBorderStyle sty $
B.borderWithLabel "label" $
vLimit 5 $
C.vCenter $
txt $ " " <> styleName <> " style " | 213 | mkBorderDemo :: (T.Text, BS.BorderStyle) -> Widget
mkBorderDemo (styleName, sty) =
withBorderStyle sty $
B.borderWithLabel "label" $
vLimit 5 $
C.vCenter $
txt $ " " <> styleName <> " style " | 213 | mkBorderDemo (styleName, sty) =
withBorderStyle sty $
B.borderWithLabel "label" $
vLimit 5 $
C.vCenter $
txt $ " " <> styleName <> " style " | 162 | false | true | 0 | 13 | 52 | 75 | 38 | 37 | null | null |
ayu-mushi/scientific-ants | ALife/ScientificAnts/Engine.hs | mit | focus :: Lens' (Zipper a) a
focus = lens cursor $ flip replace | 62 | focus :: Lens' (Zipper a) a
focus = lens cursor $ flip replace | 62 | focus = lens cursor $ flip replace | 34 | false | true | 0 | 7 | 12 | 32 | 15 | 17 | null | null |
UCSD-PL/RefScript | src/Language/Rsc/Typecheck/Checker.hs | bsd-3-clause | tcCall γ (DotRef l e0 f) _ = do
tOpt <- runFailM (tcExpr γ ue Nothing)
case tOpt of
Right et -> checkAccess et
Left (TCErr Fatal e) -> fatal e
Left (TCErr NonFatal e) -> tcError e
where
ue = enableUnique e0
checkAccess (_, tRcvr) = do
b <- unifyAndSubtypeM l γ tRcvr genArrTy
-- Is this an array '.length' access?
if b && F.symbol f == F.symbol "length" then
checkArrayLength
-- Otherwise, treat as normal access.
else
checkProp (getProp l γ F.dummySymbol f tRcvr)
-- `a.length`
checkArrayLength = do
l1 <- freshenAnn l
l2 <- freshenAnn l
i <- freshenId (builtinOpId BIGetLength)
tcExpr γ (CallExpr l1 (VarRef l2 i) [ue]) Nothing
-- Normal property access
checkProp (Left er) = tcError er
checkProp (Right tfs) = do
let (rTs, fs) = unzip tfs
(e0', _) <- tcExprT γ ue (tOr rTs)
let t = tyWithOpt fs
return (DotRef l e0' f, t)
-- Add `or undef` in case of an optional field access
tyWithOpt fs = case unzip [(t, o) | FI _ o _ t <- fs] of
(ts, os) | Opt `elem` os -> orUndef (tOr ts)
| otherwise -> tOr ts
-- forall M T . Array<M,T>
genArrTy = mkAll bvs (TRef (Gen arrayName vs) fTop)
where
bvs = [BTV m def (Just tRO), BTV t def Nothing]
vs = map tVar [TV m def, TV t def]
m = F.symbol "M"
t = F.symbol "T"
-- | `super(e1,...,en)`
--
-- XXX: there shouldn't be any `super(..)` calls after SSA ...
-- | 1,612 | tcCall γ (DotRef l e0 f) _ = do
tOpt <- runFailM (tcExpr γ ue Nothing)
case tOpt of
Right et -> checkAccess et
Left (TCErr Fatal e) -> fatal e
Left (TCErr NonFatal e) -> tcError e
where
ue = enableUnique e0
checkAccess (_, tRcvr) = do
b <- unifyAndSubtypeM l γ tRcvr genArrTy
-- Is this an array '.length' access?
if b && F.symbol f == F.symbol "length" then
checkArrayLength
-- Otherwise, treat as normal access.
else
checkProp (getProp l γ F.dummySymbol f tRcvr)
-- `a.length`
checkArrayLength = do
l1 <- freshenAnn l
l2 <- freshenAnn l
i <- freshenId (builtinOpId BIGetLength)
tcExpr γ (CallExpr l1 (VarRef l2 i) [ue]) Nothing
-- Normal property access
checkProp (Left er) = tcError er
checkProp (Right tfs) = do
let (rTs, fs) = unzip tfs
(e0', _) <- tcExprT γ ue (tOr rTs)
let t = tyWithOpt fs
return (DotRef l e0' f, t)
-- Add `or undef` in case of an optional field access
tyWithOpt fs = case unzip [(t, o) | FI _ o _ t <- fs] of
(ts, os) | Opt `elem` os -> orUndef (tOr ts)
| otherwise -> tOr ts
-- forall M T . Array<M,T>
genArrTy = mkAll bvs (TRef (Gen arrayName vs) fTop)
where
bvs = [BTV m def (Just tRO), BTV t def Nothing]
vs = map tVar [TV m def, TV t def]
m = F.symbol "M"
t = F.symbol "T"
-- | `super(e1,...,en)`
--
-- XXX: there shouldn't be any `super(..)` calls after SSA ...
-- | 1,612 | tcCall γ (DotRef l e0 f) _ = do
tOpt <- runFailM (tcExpr γ ue Nothing)
case tOpt of
Right et -> checkAccess et
Left (TCErr Fatal e) -> fatal e
Left (TCErr NonFatal e) -> tcError e
where
ue = enableUnique e0
checkAccess (_, tRcvr) = do
b <- unifyAndSubtypeM l γ tRcvr genArrTy
-- Is this an array '.length' access?
if b && F.symbol f == F.symbol "length" then
checkArrayLength
-- Otherwise, treat as normal access.
else
checkProp (getProp l γ F.dummySymbol f tRcvr)
-- `a.length`
checkArrayLength = do
l1 <- freshenAnn l
l2 <- freshenAnn l
i <- freshenId (builtinOpId BIGetLength)
tcExpr γ (CallExpr l1 (VarRef l2 i) [ue]) Nothing
-- Normal property access
checkProp (Left er) = tcError er
checkProp (Right tfs) = do
let (rTs, fs) = unzip tfs
(e0', _) <- tcExprT γ ue (tOr rTs)
let t = tyWithOpt fs
return (DotRef l e0' f, t)
-- Add `or undef` in case of an optional field access
tyWithOpt fs = case unzip [(t, o) | FI _ o _ t <- fs] of
(ts, os) | Opt `elem` os -> orUndef (tOr ts)
| otherwise -> tOr ts
-- forall M T . Array<M,T>
genArrTy = mkAll bvs (TRef (Gen arrayName vs) fTop)
where
bvs = [BTV m def (Just tRO), BTV t def Nothing]
vs = map tVar [TV m def, TV t def]
m = F.symbol "M"
t = F.symbol "T"
-- | `super(e1,...,en)`
--
-- XXX: there shouldn't be any `super(..)` calls after SSA ...
-- | 1,612 | false | false | 6 | 13 | 570 | 591 | 279 | 312 | null | null |
TomMD/crypto-api | Crypto/Modes.hs | bsd-3-clause | cMacPad ([], False, n) = Just (0,([], False, n-1)) | 50 | cMacPad ([], False, n) = Just (0,([], False, n-1)) | 50 | cMacPad ([], False, n) = Just (0,([], False, n-1)) | 50 | false | false | 0 | 8 | 8 | 44 | 25 | 19 | null | null |
yesodweb/yesod | yesod/Yesod/Default/Config2.hs | mit | mergeValues :: Value -> Value -> Value
mergeValues (Object x) (Object y) = Object $ H.unionWith mergeValues x y | 111 | mergeValues :: Value -> Value -> Value
mergeValues (Object x) (Object y) = Object $ H.unionWith mergeValues x y | 111 | mergeValues (Object x) (Object y) = Object $ H.unionWith mergeValues x y | 72 | false | true | 0 | 7 | 18 | 49 | 24 | 25 | null | null |
gregorias/pixelosolver | src/PixeloSolver/Game/Nonogram.hs | bsd-3-clause | mergeSolutions' constraints (s : ss) =
if all (== Unknown) constraints
then constraints
else mergeSolutions' (mergeSolution constraints s) ss | 147 | mergeSolutions' constraints (s : ss) =
if all (== Unknown) constraints
then constraints
else mergeSolutions' (mergeSolution constraints s) ss | 147 | mergeSolutions' constraints (s : ss) =
if all (== Unknown) constraints
then constraints
else mergeSolutions' (mergeSolution constraints s) ss | 147 | false | false | 0 | 8 | 24 | 48 | 25 | 23 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_LIGHT_MODEL_COLOR_CONTROL :: GLenum
gl_LIGHT_MODEL_COLOR_CONTROL = 0x81F8 | 76 | gl_LIGHT_MODEL_COLOR_CONTROL :: GLenum
gl_LIGHT_MODEL_COLOR_CONTROL = 0x81F8 | 76 | gl_LIGHT_MODEL_COLOR_CONTROL = 0x81F8 | 37 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
sinelaw/lamdu | bottlelib/Data/Store/Transaction.hs | gpl-3.0 | newKey :: MonadA m => Transaction m Key
newKey = liftInner . storeNewKey =<< getStore | 85 | newKey :: MonadA m => Transaction m Key
newKey = liftInner . storeNewKey =<< getStore | 85 | newKey = liftInner . storeNewKey =<< getStore | 45 | false | true | 0 | 6 | 14 | 31 | 15 | 16 | null | null |
keithodulaigh/Hets | OWL2/Keywords.hs | gpl-2.0 | intS :: String
intS = "int" | 27 | intS :: String
intS = "int" | 27 | intS = "int" | 12 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
dfordivam/lava | Lava/SignalTry.hs | bsd-3-clause | and2 :: (Signal Bool, Signal Bool) -> Signal Bool
and2 (x,y) = Symbol (ref (Function "and" (\xs _ -> and xs) [x,y] [])) | 119 | and2 :: (Signal Bool, Signal Bool) -> Signal Bool
and2 (x,y) = Symbol (ref (Function "and" (\xs _ -> and xs) [x,y] [])) | 119 | and2 (x,y) = Symbol (ref (Function "and" (\xs _ -> and xs) [x,y] [])) | 69 | false | true | 0 | 12 | 22 | 81 | 42 | 39 | null | null |
ezyang/ghc | compiler/parser/ApiAnnotation.hs | bsd-3-clause | getAndRemoveAnnotationComments :: ApiAnns -> SrcSpan
-> ([Located AnnotationComment],ApiAnns)
getAndRemoveAnnotationComments (anns,canns) span =
case Map.lookup span canns of
Just cs -> (cs,(anns,Map.delete span canns))
Nothing -> ([],(anns,canns))
-- --------------------------------------------------------------------
-- | API Annotations exist so that tools can perform source to source
-- conversions of Haskell code. They are used to keep track of the
-- various syntactic keywords that are not captured in the existing
-- AST.
--
-- The annotations, together with original source comments are made
-- available in the @'pm_annotations'@ field of @'GHC.ParsedModule'@.
-- Comments are only retained if @'Opt_KeepRawTokenStream'@ is set in
-- @'DynFlags.DynFlags'@ before parsing.
--
-- The wiki page describing this feature is
-- https://ghc.haskell.org/trac/ghc/wiki/ApiAnnotations
--
-- Note: in general the names of these are taken from the
-- corresponding token, unless otherwise noted
-- See note [Api annotations] above for details of the usage | 1,100 | getAndRemoveAnnotationComments :: ApiAnns -> SrcSpan
-> ([Located AnnotationComment],ApiAnns)
getAndRemoveAnnotationComments (anns,canns) span =
case Map.lookup span canns of
Just cs -> (cs,(anns,Map.delete span canns))
Nothing -> ([],(anns,canns))
-- --------------------------------------------------------------------
-- | API Annotations exist so that tools can perform source to source
-- conversions of Haskell code. They are used to keep track of the
-- various syntactic keywords that are not captured in the existing
-- AST.
--
-- The annotations, together with original source comments are made
-- available in the @'pm_annotations'@ field of @'GHC.ParsedModule'@.
-- Comments are only retained if @'Opt_KeepRawTokenStream'@ is set in
-- @'DynFlags.DynFlags'@ before parsing.
--
-- The wiki page describing this feature is
-- https://ghc.haskell.org/trac/ghc/wiki/ApiAnnotations
--
-- Note: in general the names of these are taken from the
-- corresponding token, unless otherwise noted
-- See note [Api annotations] above for details of the usage | 1,100 | getAndRemoveAnnotationComments (anns,canns) span =
case Map.lookup span canns of
Just cs -> (cs,(anns,Map.delete span canns))
Nothing -> ([],(anns,canns))
-- --------------------------------------------------------------------
-- | API Annotations exist so that tools can perform source to source
-- conversions of Haskell code. They are used to keep track of the
-- various syntactic keywords that are not captured in the existing
-- AST.
--
-- The annotations, together with original source comments are made
-- available in the @'pm_annotations'@ field of @'GHC.ParsedModule'@.
-- Comments are only retained if @'Opt_KeepRawTokenStream'@ is set in
-- @'DynFlags.DynFlags'@ before parsing.
--
-- The wiki page describing this feature is
-- https://ghc.haskell.org/trac/ghc/wiki/ApiAnnotations
--
-- Note: in general the names of these are taken from the
-- corresponding token, unless otherwise noted
-- See note [Api annotations] above for details of the usage | 975 | false | true | 0 | 11 | 183 | 118 | 72 | 46 | null | null |
eigengrau/haskell-ircbot | Network/IRC/Bot/PosixLogger.hs | bsd-3-clause | fdWrites :: Fd
-> ByteString
-> IO ()
fdWrites fd bs =
B.useAsCStringLen bs $ \(cstring, len) ->
if len <= 0
then return ()
else do c <- C.throwErrnoIfMinus1Retry "fdWrites" $ fdWriteBuf fd (castPtr cstring) (fromIntegral len)
if (fromIntegral c) == (fromIntegral len)
then return ()
else fdWrites fd (B.drop (fromIntegral c) bs) | 444 | fdWrites :: Fd
-> ByteString
-> IO ()
fdWrites fd bs =
B.useAsCStringLen bs $ \(cstring, len) ->
if len <= 0
then return ()
else do c <- C.throwErrnoIfMinus1Retry "fdWrites" $ fdWriteBuf fd (castPtr cstring) (fromIntegral len)
if (fromIntegral c) == (fromIntegral len)
then return ()
else fdWrites fd (B.drop (fromIntegral c) bs) | 444 | fdWrites fd bs =
B.useAsCStringLen bs $ \(cstring, len) ->
if len <= 0
then return ()
else do c <- C.throwErrnoIfMinus1Retry "fdWrites" $ fdWriteBuf fd (castPtr cstring) (fromIntegral len)
if (fromIntegral c) == (fromIntegral len)
then return ()
else fdWrites fd (B.drop (fromIntegral c) bs) | 388 | false | true | 0 | 16 | 168 | 159 | 77 | 82 | null | null |
sdiehl/ghc | compiler/utils/Outputable.hs | bsd-3-clause | showSDocUnqual :: DynFlags -> SDoc -> String
-- Only used by Haddock
showSDocUnqual dflags sdoc = showSDoc dflags sdoc | 118 | showSDocUnqual :: DynFlags -> SDoc -> String
showSDocUnqual dflags sdoc = showSDoc dflags sdoc | 94 | showSDocUnqual dflags sdoc = showSDoc dflags sdoc | 49 | true | true | 0 | 6 | 18 | 30 | 15 | 15 | null | null |
dmjio/aeson | tests/Encoders.hs | bsd-3-clause | thSomeTypeToJSONTaggedObject :: SomeType Int -> Value
thSomeTypeToJSONTaggedObject = $(mkToJSON optsTaggedObject ''SomeType) | 124 | thSomeTypeToJSONTaggedObject :: SomeType Int -> Value
thSomeTypeToJSONTaggedObject = $(mkToJSON optsTaggedObject ''SomeType) | 124 | thSomeTypeToJSONTaggedObject = $(mkToJSON optsTaggedObject ''SomeType) | 70 | false | true | 0 | 8 | 10 | 29 | 14 | 15 | null | null |
mettekou/ghc | compiler/types/Type.hs | bsd-3-clause | -- | Is this a function or forall?
isPiTy :: Type -> Bool
isPiTy ty | Just ty' <- coreView ty = isForAllTy ty' | 110 | isPiTy :: Type -> Bool
isPiTy ty | Just ty' <- coreView ty = isForAllTy ty' | 75 | isPiTy ty | Just ty' <- coreView ty = isForAllTy ty' | 52 | true | true | 0 | 9 | 23 | 38 | 17 | 21 | null | null |
benkolera/haskell-hubbub | Publisher.hs | mit | getPosts :: Query Db [Post]
getPosts = posts <$> ask | 52 | getPosts :: Query Db [Post]
getPosts = posts <$> ask | 52 | getPosts = posts <$> ask | 24 | false | true | 2 | 7 | 9 | 30 | 13 | 17 | null | null |
GallagherCommaJack/scheming-machine | ParserEvaluator.hs | gpl-3.0 | readExpr :: String -> ThrowsError LispVal
readExpr = readOrThrow parseExpr | 74 | readExpr :: String -> ThrowsError LispVal
readExpr = readOrThrow parseExpr | 74 | readExpr = readOrThrow parseExpr | 32 | false | true | 0 | 7 | 9 | 27 | 11 | 16 | null | null |
rahulmutt/ghcvm | libraries/eta-meta/Language/Eta/Meta/PprLib.hs | bsd-3-clause | dcolon = return $ HPJ.text "::" | 31 | dcolon = return $ HPJ.text "::" | 31 | dcolon = return $ HPJ.text "::" | 31 | false | false | 1 | 7 | 5 | 18 | 7 | 11 | null | null |
Ferdinand-vW/HHDFS | src/NameNode.hs | isc | writeIOChan :: NameNode -> Process () -> STM ()
writeIOChan NameNode{..} = writeTChan procChan | 94 | writeIOChan :: NameNode -> Process () -> STM ()
writeIOChan NameNode{..} = writeTChan procChan | 94 | writeIOChan NameNode{..} = writeTChan procChan | 46 | false | true | 0 | 8 | 13 | 41 | 19 | 22 | null | null |
kadircet/CENG | 242/HW2.hs | gpl-3.0 | delpathterm (a, (Struct b)) p = (a, Struct $ delpath b p) | 57 | delpathterm (a, (Struct b)) p = (a, Struct $ delpath b p) | 57 | delpathterm (a, (Struct b)) p = (a, Struct $ delpath b p) | 57 | false | false | 0 | 8 | 11 | 38 | 20 | 18 | null | null |
wdanilo/haskell-language-c | src/Language/C/Analysis/SemError.hs | bsd-3-clause | prevDeclMsg :: NodeInfo -> [String]
prevDeclMsg old_node = ["The previous declaration was here: ", show (posOfNode old_node)] | 125 | prevDeclMsg :: NodeInfo -> [String]
prevDeclMsg old_node = ["The previous declaration was here: ", show (posOfNode old_node)] | 125 | prevDeclMsg old_node = ["The previous declaration was here: ", show (posOfNode old_node)] | 89 | false | true | 0 | 8 | 16 | 36 | 19 | 17 | null | null |
martine/c-repl | Repl.hs | bsd-3-clause | log :: Show a => String -> a -> IO ()
log desc obj = putStrLn (desc ++ " " ++ show obj) | 87 | log :: Show a => String -> a -> IO ()
log desc obj = putStrLn (desc ++ " " ++ show obj) | 87 | log desc obj = putStrLn (desc ++ " " ++ show obj) | 49 | false | true | 0 | 9 | 22 | 53 | 25 | 28 | null | null |
lykahb/aeson | Data/Aeson/Functions.hs | bsd-3-clause | fromPico :: Pico -> Integer
fromPico (MkFixed i) = i | 52 | fromPico :: Pico -> Integer
fromPico (MkFixed i) = i | 52 | fromPico (MkFixed i) = i | 24 | false | true | 0 | 9 | 9 | 30 | 13 | 17 | null | null |
norm2782/uuagc | src/CommonTypes.hs | bsd-3-clause | isLazyKind _ = False | 36 | isLazyKind _ = False | 36 | isLazyKind _ = False | 36 | false | false | 0 | 5 | 19 | 9 | 4 | 5 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/Constants.hs | gpl-2.0 | htKvmSpiceValidVideoStreamDetectionOptions :: FrozenSet String
htKvmSpiceValidVideoStreamDetectionOptions =
ConstantUtils.mkSet [htKvmSpiceVideoStreamDetectionAll,
htKvmSpiceVideoStreamDetectionFilter,
htKvmSpiceVideoStreamDetectionOff] | 284 | htKvmSpiceValidVideoStreamDetectionOptions :: FrozenSet String
htKvmSpiceValidVideoStreamDetectionOptions =
ConstantUtils.mkSet [htKvmSpiceVideoStreamDetectionAll,
htKvmSpiceVideoStreamDetectionFilter,
htKvmSpiceVideoStreamDetectionOff] | 284 | htKvmSpiceValidVideoStreamDetectionOptions =
ConstantUtils.mkSet [htKvmSpiceVideoStreamDetectionAll,
htKvmSpiceVideoStreamDetectionFilter,
htKvmSpiceVideoStreamDetectionOff] | 221 | false | true | 0 | 5 | 57 | 28 | 15 | 13 | null | null |
zaxtax/hakaru | haskell/Language/Hakaru/Pretty/Maple.hs | bsd-3-clause | mapleSCon Expect = \(e1 :* e2 :* End) ->
error "TODO: mapleSCon{Expect}" | 76 | mapleSCon Expect = \(e1 :* e2 :* End) ->
error "TODO: mapleSCon{Expect}" | 76 | mapleSCon Expect = \(e1 :* e2 :* End) ->
error "TODO: mapleSCon{Expect}" | 76 | false | false | 1 | 8 | 15 | 32 | 14 | 18 | null | null |
alanz/Blobs | lib/DData/IntMap.hs | lgpl-2.1 | -- | /O(n+m)/. The (left-biased) union of two sets.
union :: IntMap a -> IntMap a -> IntMap a
union t1@(Bin p1 m1 l1 r1) t2@(Bin p2 m2 l2 r2)
| shorter m1 m2 = union1
| shorter m2 m1 = union2
| p1 == p2 = Bin p1 m1 (union l1 l2) (union r1 r2)
| otherwise = join p1 t1 p2 t2
where
union1 | nomatch p2 p1 m1 = join p1 t1 p2 t2
| zero p2 m1 = Bin p1 m1 (union l1 t2) r1
| otherwise = Bin p1 m1 l1 (union r1 t2)
union2 | nomatch p1 p2 m2 = join p1 t1 p2 t2
| zero p1 m2 = Bin p2 m2 (union t1 l2) r2
| otherwise = Bin p2 m2 l2 (union t1 r2) | 650 | union :: IntMap a -> IntMap a -> IntMap a
union t1@(Bin p1 m1 l1 r1) t2@(Bin p2 m2 l2 r2)
| shorter m1 m2 = union1
| shorter m2 m1 = union2
| p1 == p2 = Bin p1 m1 (union l1 l2) (union r1 r2)
| otherwise = join p1 t1 p2 t2
where
union1 | nomatch p2 p1 m1 = join p1 t1 p2 t2
| zero p2 m1 = Bin p1 m1 (union l1 t2) r1
| otherwise = Bin p1 m1 l1 (union r1 t2)
union2 | nomatch p1 p2 m2 = join p1 t1 p2 t2
| zero p1 m2 = Bin p2 m2 (union t1 l2) r2
| otherwise = Bin p2 m2 l2 (union t1 r2) | 597 | union t1@(Bin p1 m1 l1 r1) t2@(Bin p2 m2 l2 r2)
| shorter m1 m2 = union1
| shorter m2 m1 = union2
| p1 == p2 = Bin p1 m1 (union l1 l2) (union r1 r2)
| otherwise = join p1 t1 p2 t2
where
union1 | nomatch p2 p1 m1 = join p1 t1 p2 t2
| zero p2 m1 = Bin p1 m1 (union l1 t2) r1
| otherwise = Bin p1 m1 l1 (union r1 t2)
union2 | nomatch p1 p2 m2 = join p1 t1 p2 t2
| zero p1 m2 = Bin p2 m2 (union t1 l2) r2
| otherwise = Bin p2 m2 l2 (union t1 r2) | 555 | true | true | 24 | 7 | 247 | 295 | 147 | 148 | null | null |
ptol/oczor | src/Oczor/Converter/CodeGenAst.hs | mit | -- pattern Scope x <- Function _ x
getVarName (Var x _) = Just x | 65 | getVarName (Var x _) = Just x | 29 | getVarName (Var x _) = Just x | 29 | true | false | 0 | 6 | 15 | 22 | 10 | 12 | null | null |
nevrenato/Hets_Fork | FreeCAD/Translator.hs | gpl-2.0 | hasName:: String -> Element -> Bool
hasName s el = (getName el == s) | 68 | hasName:: String -> Element -> Bool
hasName s el = (getName el == s) | 68 | hasName s el = (getName el == s) | 32 | false | true | 0 | 8 | 13 | 41 | 18 | 23 | null | null |
esmolanka/haddock | haddock-api/src/Haddock/Utils.hs | bsd-2-clause | html_xrefs' :: Map ModuleName FilePath
html_xrefs' = unsafePerformIO (readIORef html_xrefs_ref') | 96 | html_xrefs' :: Map ModuleName FilePath
html_xrefs' = unsafePerformIO (readIORef html_xrefs_ref') | 96 | html_xrefs' = unsafePerformIO (readIORef html_xrefs_ref') | 57 | false | true | 0 | 7 | 9 | 25 | 12 | 13 | null | null |
samgd/Chess | test/Chess/BoardSpec.hs | mit | spec :: Spec
spec = do
describe "validPosition" $ do
it "returns True when given a valid position" $
all validPosition [(f, r) | f <- ['a'..'h'], r <- [1..8]] `shouldBe` True
it "returns False when given an invalid position" $ property $
\p@(f, r) -> ((f `notElem` ['a'..'h']) || (r `notElem` [1..8])) ==> not $ validPosition p
describe "fileIndex" $ do
it "returns correct index when given a valid file" $
[fileIndex f | f <- ['a'..'h']] `shouldBe` map Just [0..7]
it "returns Nothing when given an invalid file" $ property $
\f -> (f `notElem` ['a'..'h']) ==> isNothing $ fileIndex f
describe "rankIndex" $ do
it "returns correct index when given a valid rank" $
[rankIndex r | r <- [1..8]] `shouldBe` map Just [7, 6..0]
it "returns Nothing when given an invalid rank" $ property $
\r -> (r `notElem` [1..8]) ==> isNothing $ rankIndex r
describe "square" $
it "returns correct square for a given position" $
map (square board) (zip ['a'..'h'] [8,7..1]) `shouldBe` sqs
describe "rank" $ do
it "returns Nothing when given an invalid index" $ property $
\i -> (i `notElem` [1..8]) ==> isNothing $ rank board i
it "returns correct rank when given a valid index" $
[rank board r | r <- [1..8]] `shouldBe` map Just (reverse board)
describe "file" $ do
it "returns Nothing when given an invalid file" $ property $
\c -> (c `notElem` ['a'..'h']) ==> isNothing $ file board c
it "returns correct file when given a valid index" $
[file board f | f <- ['a'..'h']] `shouldBe` map Just (SL.transpose board) | 1,749 | spec :: Spec
spec = do
describe "validPosition" $ do
it "returns True when given a valid position" $
all validPosition [(f, r) | f <- ['a'..'h'], r <- [1..8]] `shouldBe` True
it "returns False when given an invalid position" $ property $
\p@(f, r) -> ((f `notElem` ['a'..'h']) || (r `notElem` [1..8])) ==> not $ validPosition p
describe "fileIndex" $ do
it "returns correct index when given a valid file" $
[fileIndex f | f <- ['a'..'h']] `shouldBe` map Just [0..7]
it "returns Nothing when given an invalid file" $ property $
\f -> (f `notElem` ['a'..'h']) ==> isNothing $ fileIndex f
describe "rankIndex" $ do
it "returns correct index when given a valid rank" $
[rankIndex r | r <- [1..8]] `shouldBe` map Just [7, 6..0]
it "returns Nothing when given an invalid rank" $ property $
\r -> (r `notElem` [1..8]) ==> isNothing $ rankIndex r
describe "square" $
it "returns correct square for a given position" $
map (square board) (zip ['a'..'h'] [8,7..1]) `shouldBe` sqs
describe "rank" $ do
it "returns Nothing when given an invalid index" $ property $
\i -> (i `notElem` [1..8]) ==> isNothing $ rank board i
it "returns correct rank when given a valid index" $
[rank board r | r <- [1..8]] `shouldBe` map Just (reverse board)
describe "file" $ do
it "returns Nothing when given an invalid file" $ property $
\c -> (c `notElem` ['a'..'h']) ==> isNothing $ file board c
it "returns correct file when given a valid index" $
[file board f | f <- ['a'..'h']] `shouldBe` map Just (SL.transpose board) | 1,749 | spec = do
describe "validPosition" $ do
it "returns True when given a valid position" $
all validPosition [(f, r) | f <- ['a'..'h'], r <- [1..8]] `shouldBe` True
it "returns False when given an invalid position" $ property $
\p@(f, r) -> ((f `notElem` ['a'..'h']) || (r `notElem` [1..8])) ==> not $ validPosition p
describe "fileIndex" $ do
it "returns correct index when given a valid file" $
[fileIndex f | f <- ['a'..'h']] `shouldBe` map Just [0..7]
it "returns Nothing when given an invalid file" $ property $
\f -> (f `notElem` ['a'..'h']) ==> isNothing $ fileIndex f
describe "rankIndex" $ do
it "returns correct index when given a valid rank" $
[rankIndex r | r <- [1..8]] `shouldBe` map Just [7, 6..0]
it "returns Nothing when given an invalid rank" $ property $
\r -> (r `notElem` [1..8]) ==> isNothing $ rankIndex r
describe "square" $
it "returns correct square for a given position" $
map (square board) (zip ['a'..'h'] [8,7..1]) `shouldBe` sqs
describe "rank" $ do
it "returns Nothing when given an invalid index" $ property $
\i -> (i `notElem` [1..8]) ==> isNothing $ rank board i
it "returns correct rank when given a valid index" $
[rank board r | r <- [1..8]] `shouldBe` map Just (reverse board)
describe "file" $ do
it "returns Nothing when given an invalid file" $ property $
\c -> (c `notElem` ['a'..'h']) ==> isNothing $ file board c
it "returns correct file when given a valid index" $
[file board f | f <- ['a'..'h']] `shouldBe` map Just (SL.transpose board) | 1,736 | false | true | 0 | 18 | 518 | 624 | 318 | 306 | null | null |
Copilot-Language/atom_for_copilot | Language/Atom/Scheduling.hs | bsd-3-clause | totalComplexity :: Usage -> Int
totalComplexity (Usage _ n subs) = n + sum (map totalComplexity subs) | 101 | totalComplexity :: Usage -> Int
totalComplexity (Usage _ n subs) = n + sum (map totalComplexity subs) | 101 | totalComplexity (Usage _ n subs) = n + sum (map totalComplexity subs) | 69 | false | true | 0 | 8 | 16 | 43 | 21 | 22 | null | null |
amccausl/Swish | Swish/HaskellUtils/ParseURI.hs | lgpl-2.1 | morelabel :: String -> [(String, String)]
morelabel = optG ( ( countMax 61 alnumhyp ) >++> alphanum
>++> (no alnumhyp) ) | 154 | morelabel :: String -> [(String, String)]
morelabel = optG ( ( countMax 61 alnumhyp ) >++> alphanum
>++> (no alnumhyp) ) | 150 | morelabel = optG ( ( countMax 61 alnumhyp ) >++> alphanum
>++> (no alnumhyp) ) | 106 | false | true | 0 | 10 | 54 | 59 | 29 | 30 | null | null |
JoeLoser/CS4450-Principles-of-Programming | homeworks/hw5/hw5_sdk/ImpInterp.hs | mit | -- Helper function used to parse BExp
parseBinaryExp :: BExp -> String
parseBinaryExp (IsEq x y) = parseExpression x ++ "==" ++ parseExpression y | 147 | parseBinaryExp :: BExp -> String
parseBinaryExp (IsEq x y) = parseExpression x ++ "==" ++ parseExpression y | 107 | parseBinaryExp (IsEq x y) = parseExpression x ++ "==" ++ parseExpression y | 74 | true | true | 0 | 7 | 25 | 41 | 20 | 21 | null | null |
brianshourd/adventOfCode2015 | src/Day6.hs | mit | applyInstructions :: Position -> [Instruction] -> State
applyInstructions p = foldl (flip $ applyOperation . getOperation) Off . filter (inRange p . getRange) | 158 | applyInstructions :: Position -> [Instruction] -> State
applyInstructions p = foldl (flip $ applyOperation . getOperation) Off . filter (inRange p . getRange) | 158 | applyInstructions p = foldl (flip $ applyOperation . getOperation) Off . filter (inRange p . getRange) | 102 | false | true | 0 | 9 | 22 | 58 | 29 | 29 | null | null |
facebookincubator/duckling | Duckling/Volume/EN/Rules.hs | bsd-3-clause | rulePrecision :: Rule
rulePrecision = Rule
{ name = "about <volume>"
, pattern =
[ regex "\\~|exactly|precisely|about|approx(\\.|imately)?|close to|near( to)?|around|almost"
, dimension Volume
]
, prod = \case
(_:token:_) -> Just token
_ -> Nothing
} | 284 | rulePrecision :: Rule
rulePrecision = Rule
{ name = "about <volume>"
, pattern =
[ regex "\\~|exactly|precisely|about|approx(\\.|imately)?|close to|near( to)?|around|almost"
, dimension Volume
]
, prod = \case
(_:token:_) -> Just token
_ -> Nothing
} | 284 | rulePrecision = Rule
{ name = "about <volume>"
, pattern =
[ regex "\\~|exactly|precisely|about|approx(\\.|imately)?|close to|near( to)?|around|almost"
, dimension Volume
]
, prod = \case
(_:token:_) -> Just token
_ -> Nothing
} | 262 | false | true | 0 | 13 | 68 | 75 | 40 | 35 | null | null |
mbakke/ganeti | test/hs/Test/Ganeti/Objects.hs | bsd-2-clause | -- | Enhances a given instance with network information, by connecting it to the
-- given networks and possibly some other networks
enhanceInstWithNets :: Instance -> [String] -> Gen Instance
enhanceInstWithNets inst nets = do
mac <- arbitrary
ip <- arbitrary
nicparams <- arbitrary
name <- arbitrary
uuid <- arbitrary
-- generate some more networks than the given ones
num_more_nets <- choose (0,3)
more_nets <- vectorOf num_more_nets genUUID
let genNic net = PartialNic mac ip nicparams net name uuid
partial_nics = map (genNic . Just)
(List.nub (nets ++ more_nets))
new_inst = case inst of
RealInstance rinst ->
RealInstance rinst { realInstNics = partial_nics }
ForthcomingInstance _ -> inst
return new_inst | 827 | enhanceInstWithNets :: Instance -> [String] -> Gen Instance
enhanceInstWithNets inst nets = do
mac <- arbitrary
ip <- arbitrary
nicparams <- arbitrary
name <- arbitrary
uuid <- arbitrary
-- generate some more networks than the given ones
num_more_nets <- choose (0,3)
more_nets <- vectorOf num_more_nets genUUID
let genNic net = PartialNic mac ip nicparams net name uuid
partial_nics = map (genNic . Just)
(List.nub (nets ++ more_nets))
new_inst = case inst of
RealInstance rinst ->
RealInstance rinst { realInstNics = partial_nics }
ForthcomingInstance _ -> inst
return new_inst | 695 | enhanceInstWithNets inst nets = do
mac <- arbitrary
ip <- arbitrary
nicparams <- arbitrary
name <- arbitrary
uuid <- arbitrary
-- generate some more networks than the given ones
num_more_nets <- choose (0,3)
more_nets <- vectorOf num_more_nets genUUID
let genNic net = PartialNic mac ip nicparams net name uuid
partial_nics = map (genNic . Just)
(List.nub (nets ++ more_nets))
new_inst = case inst of
RealInstance rinst ->
RealInstance rinst { realInstNics = partial_nics }
ForthcomingInstance _ -> inst
return new_inst | 635 | true | true | 0 | 15 | 225 | 197 | 95 | 102 | null | null |
Concomitant/LambdaHack | Game/LambdaHack/Server/ItemServer.hs | bsd-3-clause | activeItemsServer :: MonadServer m => ActorId -> m [ItemFull]
activeItemsServer aid = do
activeAssocs <- fullAssocsServer aid [CEqp, COrgan]
return $! map snd activeAssocs | 175 | activeItemsServer :: MonadServer m => ActorId -> m [ItemFull]
activeItemsServer aid = do
activeAssocs <- fullAssocsServer aid [CEqp, COrgan]
return $! map snd activeAssocs | 175 | activeItemsServer aid = do
activeAssocs <- fullAssocsServer aid [CEqp, COrgan]
return $! map snd activeAssocs | 113 | false | true | 0 | 9 | 27 | 61 | 29 | 32 | null | null |
trbauer/progargs | Prog/Args/Args.hs | mit | sinkIO2 :: (a -> b -> c) -> a -> b -> IO c
sinkIO2 f a b = return $ f a b | 73 | sinkIO2 :: (a -> b -> c) -> a -> b -> IO c
sinkIO2 f a b = return $ f a b | 73 | sinkIO2 f a b = return $ f a b | 30 | false | true | 0 | 8 | 23 | 53 | 26 | 27 | null | null |
danse/opwer | app/opwer-search.hs | bsd-3-clause | readQuery :: String -> [(String, String)]
readQuery = read | 58 | readQuery :: String -> [(String, String)]
readQuery = read | 58 | readQuery = read | 16 | false | true | 0 | 7 | 8 | 24 | 14 | 10 | null | null |
jgm/texmath | src/Text/TeXMath/Readers/TeX.hs | gpl-2.0 | tilde 'O' = "Õ" | 15 | tilde 'O' = "Õ" | 15 | tilde 'O' = "Õ" | 15 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
np/hlatex | Language/LaTeX/Length.hs | bsd-3-clause | pc = withUnit Pc | 16 | pc = withUnit Pc | 16 | pc = withUnit Pc | 16 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
geekingfrog/advent-of-code | src/Y2015/Day16.hs | bsd-3-clause | checkAttr comparator ((x, y):rest) attr@(target, val) = if x == target
then comparator target y val
else checkAttr comparator rest attr | 143 | checkAttr comparator ((x, y):rest) attr@(target, val) = if x == target
then comparator target y val
else checkAttr comparator rest attr | 143 | checkAttr comparator ((x, y):rest) attr@(target, val) = if x == target
then comparator target y val
else checkAttr comparator rest attr | 143 | false | false | 0 | 8 | 28 | 61 | 33 | 28 | null | null |
nedervold/origami | tests/Data/Origami/Internal/BuildTests.hs | bsd-3-clause | testFailsOnParameterizedTypeSynonym :: Test
testFailsOnParameterizedTypeSynonym
= testCase msg
$ assertBuildFailed $(buildFoldFamilyMaybe [''PTS] []
[''String])
where
msg = "testFailsOnParameterizedTypeSynonym" | 285 | testFailsOnParameterizedTypeSynonym :: Test
testFailsOnParameterizedTypeSynonym
= testCase msg
$ assertBuildFailed $(buildFoldFamilyMaybe [''PTS] []
[''String])
where
msg = "testFailsOnParameterizedTypeSynonym" | 285 | testFailsOnParameterizedTypeSynonym
= testCase msg
$ assertBuildFailed $(buildFoldFamilyMaybe [''PTS] []
[''String])
where
msg = "testFailsOnParameterizedTypeSynonym" | 241 | false | true | 0 | 11 | 91 | 55 | 26 | 29 | null | null |
tonussi/freezing-dubstep | pratica-10/Listas.hs | mit | -- a0 = 0
calculaSomaPA n razao = sum (map (\x -> razao + ((x - 1) * razao)) (take n [1..])) | 93 | calculaSomaPA n razao = sum (map (\x -> razao + ((x - 1) * razao)) (take n [1..])) | 82 | calculaSomaPA n razao = sum (map (\x -> razao + ((x - 1) * razao)) (take n [1..])) | 82 | true | false | 1 | 14 | 22 | 65 | 32 | 33 | null | null |
nakamuray/mangekyo | src/Mangekyo/Conduit/LTSV.hs | bsd-2-clause | fieldValue :: Parser Text
fieldValue = decodeUtf8 <$> A.takeWhile fbyte | 71 | fieldValue :: Parser Text
fieldValue = decodeUtf8 <$> A.takeWhile fbyte | 71 | fieldValue = decodeUtf8 <$> A.takeWhile fbyte | 45 | false | true | 0 | 7 | 9 | 23 | 11 | 12 | null | null |
erithion/duo-memo | doc/drafts/GithubUpdate.hs | mit | tokenName = "GITHUB_DUOMEMO_TOKEN" | 34 | tokenName = "GITHUB_DUOMEMO_TOKEN" | 34 | tokenName = "GITHUB_DUOMEMO_TOKEN" | 34 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
achirkin/qua-view | src/Model/Scenario.hs | mit | defaultStaticColor :: Functor f
=> (HexColor -> f HexColor) -> Scenario' s -> f (Scenario' s)
defaultStaticColor f = properties $ property "defaultStaticColor" g
where
g Nothing = Just <$> f "#808088E0"
g (Just c) = Just <$> f c | 261 | defaultStaticColor :: Functor f
=> (HexColor -> f HexColor) -> Scenario' s -> f (Scenario' s)
defaultStaticColor f = properties $ property "defaultStaticColor" g
where
g Nothing = Just <$> f "#808088E0"
g (Just c) = Just <$> f c | 261 | defaultStaticColor f = properties $ property "defaultStaticColor" g
where
g Nothing = Just <$> f "#808088E0"
g (Just c) = Just <$> f c | 148 | false | true | 6 | 11 | 72 | 105 | 47 | 58 | null | null |
phischu/haskell-declarations | src/haskell-declarations.hs | bsd-3-clause | main :: IO ()
main =
Compiler.main theTool | 44 | main :: IO ()
main =
Compiler.main theTool | 44 | main =
Compiler.main theTool | 30 | false | true | 0 | 7 | 9 | 27 | 11 | 16 | null | null |
kolmodin/herl | AtomTable.hs | apache-2.0 | lookupByNameM :: AtomTable -> B.ByteString -> Maybe AtomNo
lookupByNameM (AT _ xs) name = List.lookup name xs | 109 | lookupByNameM :: AtomTable -> B.ByteString -> Maybe AtomNo
lookupByNameM (AT _ xs) name = List.lookup name xs | 109 | lookupByNameM (AT _ xs) name = List.lookup name xs | 50 | false | true | 0 | 7 | 16 | 44 | 21 | 23 | null | null |
Shimuuar/quaternion | Data/Quaternion.hs | bsd-3-clause | rotation a axis
= F.mk4 c (s * x) (s * y) (s * z)
where
c = cos $ a / 2
s = sin $ a / 2
(x,y,z) = F.convert axis | 128 | rotation a axis
= F.mk4 c (s * x) (s * y) (s * z)
where
c = cos $ a / 2
s = sin $ a / 2
(x,y,z) = F.convert axis | 128 | rotation a axis
= F.mk4 c (s * x) (s * y) (s * z)
where
c = cos $ a / 2
s = sin $ a / 2
(x,y,z) = F.convert axis | 128 | false | false | 2 | 8 | 49 | 94 | 48 | 46 | null | null |
fredmorcos/attic | snippets/haskell/rle.hs | isc | rld :: [(Int, Char)] -> String
rld [] = "" | 42 | rld :: [(Int, Char)] -> String
rld [] = "" | 42 | rld [] = "" | 11 | false | true | 0 | 8 | 9 | 35 | 17 | 18 | null | null |
vu3rdd/functorrent | src/FuncTorrent/MagnetURI.hs | gpl-3.0 | magnetHdr :: ParsecBS.Parser String
magnetHdr = string "magnet:?" | 65 | magnetHdr :: ParsecBS.Parser String
magnetHdr = string "magnet:?" | 65 | magnetHdr = string "magnet:?" | 29 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
kajigor/uKanren_transformations | test/auto/Test/Generalization.hs | bsd-3-clause | gen2' = [] | 10 | gen2' = [] | 10 | gen2' = [] | 10 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
brendanhay/gogol | gogol-cloudscheduler/gen/Network/Google/CloudScheduler/Types/Product.hs | mpl-2.0 | ptaAddtional :: Lens' PubsubTargetAttributes (HashMap Text Text)
ptaAddtional
= lens _ptaAddtional (\ s a -> s{_ptaAddtional = a})
. _Coerce | 148 | ptaAddtional :: Lens' PubsubTargetAttributes (HashMap Text Text)
ptaAddtional
= lens _ptaAddtional (\ s a -> s{_ptaAddtional = a})
. _Coerce | 148 | ptaAddtional
= lens _ptaAddtional (\ s a -> s{_ptaAddtional = a})
. _Coerce | 83 | false | true | 2 | 8 | 27 | 58 | 27 | 31 | null | null |
vTurbine/w3dhs | src/Resources/Configuration.hs | mit | parseConfig :: Get GameConfig
parseConfig = do
scores <- replicateM 6 parseScore
return (GameConfig scores
Sdm_Off -- FIXME
Smm_Off
Sds_Off
True
False
False
False
0
(0, 0, 0, 0)
[]
[]
[]
defViewSize
0)
-- |
-- | 555 | parseConfig :: Get GameConfig
parseConfig = do
scores <- replicateM 6 parseScore
return (GameConfig scores
Sdm_Off -- FIXME
Smm_Off
Sds_Off
True
False
False
False
0
(0, 0, 0, 0)
[]
[]
[]
defViewSize
0)
-- |
-- | 555 | parseConfig = do
scores <- replicateM 6 parseScore
return (GameConfig scores
Sdm_Off -- FIXME
Smm_Off
Sds_Off
True
False
False
False
0
(0, 0, 0, 0)
[]
[]
[]
defViewSize
0)
-- |
-- | 525 | false | true | 0 | 10 | 382 | 87 | 45 | 42 | null | null |
nushio3/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | typeSymbolKindCon = pcTyCon False NonRecursive typeSymbolKindConName Nothing [] [] | 82 | typeSymbolKindCon = pcTyCon False NonRecursive typeSymbolKindConName Nothing [] [] | 82 | typeSymbolKindCon = pcTyCon False NonRecursive typeSymbolKindConName Nothing [] [] | 82 | false | false | 0 | 6 | 8 | 23 | 11 | 12 | null | null |
ekmett/unboxed-containers | Data/Set/Unboxed.hs | bsd-3-clause | filterLt :: US a => (a -> Ordering) -> USet a -> USet a
filterLt cmp (view -> Bin _ x l r)
= case cmp x of
LT -> filterLt cmp l
GT -> join x l (filterLt cmp r)
EQ -> l | 187 | filterLt :: US a => (a -> Ordering) -> USet a -> USet a
filterLt cmp (view -> Bin _ x l r)
= case cmp x of
LT -> filterLt cmp l
GT -> join x l (filterLt cmp r)
EQ -> l | 187 | filterLt cmp (view -> Bin _ x l r)
= case cmp x of
LT -> filterLt cmp l
GT -> join x l (filterLt cmp r)
EQ -> l | 131 | false | true | 0 | 12 | 63 | 110 | 51 | 59 | null | null |
nevrenato/HetsAlloy | CASL/MapSentence.hs | gpl-2.0 | mapTerm :: MapSen f e m -> Morphism f e m -> TERM f -> TERM f
mapTerm mf = foldTerm . mapMorphism mf | 100 | mapTerm :: MapSen f e m -> Morphism f e m -> TERM f -> TERM f
mapTerm mf = foldTerm . mapMorphism mf | 100 | mapTerm mf = foldTerm . mapMorphism mf | 38 | false | true | 1 | 9 | 23 | 58 | 25 | 33 | null | null |
jeffreyrosenbluth/flourine | src/Fluorine/HTML.hs | bsd-3-clause | form_ :: [HTML i] -> HTML i
form_ = form mempty | 47 | form_ :: [HTML i] -> HTML i
form_ = form mempty | 47 | form_ = form mempty | 19 | false | true | 0 | 8 | 10 | 33 | 14 | 19 | null | null |
shlevy/arithmoi | Math/NumberTheory/Primes/Factorisation/Utils.hs | mit | -- slightly faster than (^) usually
-- | Calculate the totient from the canonical factorisation.
totientFromCanonical :: [(Integer,Int)] -> Integer
totientFromCanonical = product . map ppTotient | 195 | totientFromCanonical :: [(Integer,Int)] -> Integer
totientFromCanonical = product . map ppTotient | 97 | totientFromCanonical = product . map ppTotient | 46 | true | true | 0 | 7 | 26 | 33 | 19 | 14 | null | null |
int-e/ivar-simple | src/Data/IVar/Simple.hs | mit | -- | Try to read an 'IVar'. Returns 'Nothing' if it has no value yet.
tryRead :: IVar a -> IO (Maybe a)
tryRead (IVar trans value) = do
empty <- isEmptyMVar trans
if not empty then return (Just value) else return Nothing
-- | Writes a value to an 'IVar'. Raises a 'BlockedIndefinitelyOnIVar'
-- exception if the variable already has a value. | 350 | tryRead :: IVar a -> IO (Maybe a)
tryRead (IVar trans value) = do
empty <- isEmptyMVar trans
if not empty then return (Just value) else return Nothing
-- | Writes a value to an 'IVar'. Raises a 'BlockedIndefinitelyOnIVar'
-- exception if the variable already has a value. | 280 | tryRead (IVar trans value) = do
empty <- isEmptyMVar trans
if not empty then return (Just value) else return Nothing
-- | Writes a value to an 'IVar'. Raises a 'BlockedIndefinitelyOnIVar'
-- exception if the variable already has a value. | 246 | true | true | 0 | 10 | 71 | 77 | 37 | 40 | null | null |
willdonnelly/brians-brain | BriansBrain.hs | bsd-3-clause | main = do rng <- newStdGen
SDL.init [SDL.InitVideo]
SDL.setCaption "Brian's Purely Functional Brain" "Brian's Brain"
surface <- SDL.setVideoMode screenX screenY 24 [SDL.DoubleBuf]
forkIO . forever $ waitEvent >>= \e -> when (e == Quit) quit
mapM (drawWorld surface) (iterate stepWorld $ world rng)
where world = listArray ((1,1),(worldX,worldY)) . map toEnum . randomRs (0,2) | 427 | main = do rng <- newStdGen
SDL.init [SDL.InitVideo]
SDL.setCaption "Brian's Purely Functional Brain" "Brian's Brain"
surface <- SDL.setVideoMode screenX screenY 24 [SDL.DoubleBuf]
forkIO . forever $ waitEvent >>= \e -> when (e == Quit) quit
mapM (drawWorld surface) (iterate stepWorld $ world rng)
where world = listArray ((1,1),(worldX,worldY)) . map toEnum . randomRs (0,2) | 427 | main = do rng <- newStdGen
SDL.init [SDL.InitVideo]
SDL.setCaption "Brian's Purely Functional Brain" "Brian's Brain"
surface <- SDL.setVideoMode screenX screenY 24 [SDL.DoubleBuf]
forkIO . forever $ waitEvent >>= \e -> when (e == Quit) quit
mapM (drawWorld surface) (iterate stepWorld $ world rng)
where world = listArray ((1,1),(worldX,worldY)) . map toEnum . randomRs (0,2) | 427 | false | false | 0 | 11 | 105 | 167 | 82 | 85 | null | null |
bgwines/horse-control | src/Main.hs | bsd-3-clause | parseInit :: Parser Command
parseInit = Init <$> quietOption | 60 | parseInit :: Parser Command
parseInit = Init <$> quietOption | 60 | parseInit = Init <$> quietOption | 32 | false | true | 2 | 6 | 8 | 25 | 10 | 15 | null | null |
imuli/gitit | Network/Gitit/Plugins.hs | gpl-2.0 | loadPlugins :: [FilePath] -> IO [Plugin]
loadPlugins pluginNames = do
plugins' <- mapM loadPlugin pluginNames
unless (null pluginNames) $ logM "gitit" WARNING "Finished loading plugins."
return plugins' | 208 | loadPlugins :: [FilePath] -> IO [Plugin]
loadPlugins pluginNames = do
plugins' <- mapM loadPlugin pluginNames
unless (null pluginNames) $ logM "gitit" WARNING "Finished loading plugins."
return plugins' | 208 | loadPlugins pluginNames = do
plugins' <- mapM loadPlugin pluginNames
unless (null pluginNames) $ logM "gitit" WARNING "Finished loading plugins."
return plugins' | 167 | false | true | 0 | 10 | 32 | 68 | 31 | 37 | null | null |
RedMoonStudios/cryptd-lib | Cryptd/Lib/HTTP.hs | gpl-3.0 | request :: HC.Manager -- ^ The manager for the conduit
-> String -- ^ The base URL
-> Request -- ^ The request to send
-> IO Response -- ^ The response from the webserver
request manager rooturl req = runResourceT $ do
baseReq <- HC.parseUrl rooturl
newReq <- liftIO $ mkReq baseReq req
r <- HC.httpLbs newReq manager
return $ responseLBS (HC.responseStatus r)
(HC.responseHeaders r)
(HC.responseBody r)
where
mkReq b r = do
body <- runResourceT $ requestBody r $$ consume
return $ b { HC.method = requestMethod r
, HC.path = newpath
, HC.queryString = rawQueryString r
, HC.requestHeaders = stripHeaders . requestHeaders $ r
, HC.requestBody = HC.RequestBodyLBS . LB.fromChunks $ body
, HC.checkStatus = \_ _ -> Nothing -- Allow non-2xx, too.
}
where
newpath = B.pack $ (joinURL `on` B.unpack) (HC.path b) (rawPathInfo r) | 1,072 | request :: HC.Manager -- ^ The manager for the conduit
-> String -- ^ The base URL
-> Request -- ^ The request to send
-> IO Response
request manager rooturl req = runResourceT $ do
baseReq <- HC.parseUrl rooturl
newReq <- liftIO $ mkReq baseReq req
r <- HC.httpLbs newReq manager
return $ responseLBS (HC.responseStatus r)
(HC.responseHeaders r)
(HC.responseBody r)
where
mkReq b r = do
body <- runResourceT $ requestBody r $$ consume
return $ b { HC.method = requestMethod r
, HC.path = newpath
, HC.queryString = rawQueryString r
, HC.requestHeaders = stripHeaders . requestHeaders $ r
, HC.requestBody = HC.RequestBodyLBS . LB.fromChunks $ body
, HC.checkStatus = \_ _ -> Nothing -- Allow non-2xx, too.
}
where
newpath = B.pack $ (joinURL `on` B.unpack) (HC.path b) (rawPathInfo r) | 1,035 | request manager rooturl req = runResourceT $ do
baseReq <- HC.parseUrl rooturl
newReq <- liftIO $ mkReq baseReq req
r <- HC.httpLbs newReq manager
return $ responseLBS (HC.responseStatus r)
(HC.responseHeaders r)
(HC.responseBody r)
where
mkReq b r = do
body <- runResourceT $ requestBody r $$ consume
return $ b { HC.method = requestMethod r
, HC.path = newpath
, HC.queryString = rawQueryString r
, HC.requestHeaders = stripHeaders . requestHeaders $ r
, HC.requestBody = HC.RequestBodyLBS . LB.fromChunks $ body
, HC.checkStatus = \_ _ -> Nothing -- Allow non-2xx, too.
}
where
newpath = B.pack $ (joinURL `on` B.unpack) (HC.path b) (rawPathInfo r) | 867 | true | true | 0 | 13 | 388 | 289 | 147 | 142 | null | null |
drhodes/jade2hdl | src/Jade/Net.hs | bsd-3-clause | getBundle :: Net -> J ValBundle
getBundle net@(Net netid _) = "Net.getBundle" <? do
w <- width net
return $ Bundle $ map (NetIndex netid) $ downFrom (fromIntegral (w-1)) | 175 | getBundle :: Net -> J ValBundle
getBundle net@(Net netid _) = "Net.getBundle" <? do
w <- width net
return $ Bundle $ map (NetIndex netid) $ downFrom (fromIntegral (w-1)) | 174 | getBundle net@(Net netid _) = "Net.getBundle" <? do
w <- width net
return $ Bundle $ map (NetIndex netid) $ downFrom (fromIntegral (w-1)) | 142 | false | true | 0 | 13 | 34 | 86 | 41 | 45 | null | null |
bartoszw/haslo | Haslo/Calculator.hs | bsd-3-clause | rateIrr1stI' is c n d d1 r count | abs (f / ff) < 0.000000001 = return $ r - f / ff
| count > 30 = throwError $ OtherError $
"rateIrr1stI c:" ++
show c ++
" d1:" ++ show d1 ++
" is:" ++ show is
| otherwise = rateIrr1stI' is c n d d1 (r - f / ff) (count + 1)
where f = sum(map (uncurry (/)) (zip is [(1+r)^i|i <- [1..n]]))
- c*(r+1)**(d + d1 / 30 - 1)
ff = sum(map (uncurry (/)) (zip (map (uncurry (*)) (zip is [fromIntegral(-i)|i <- [1..n]])) [(1+r)^(i+1)|i <- [1..n]]))
- c*(d + d1/30 - 1)
-- | General rate calculation.
-- Delay of 1st installment is integrated into instalment list | 1,024 | rateIrr1stI' is c n d d1 r count | abs (f / ff) < 0.000000001 = return $ r - f / ff
| count > 30 = throwError $ OtherError $
"rateIrr1stI c:" ++
show c ++
" d1:" ++ show d1 ++
" is:" ++ show is
| otherwise = rateIrr1stI' is c n d d1 (r - f / ff) (count + 1)
where f = sum(map (uncurry (/)) (zip is [(1+r)^i|i <- [1..n]]))
- c*(r+1)**(d + d1 / 30 - 1)
ff = sum(map (uncurry (/)) (zip (map (uncurry (*)) (zip is [fromIntegral(-i)|i <- [1..n]])) [(1+r)^(i+1)|i <- [1..n]]))
- c*(d + d1/30 - 1)
-- | General rate calculation.
-- Delay of 1st installment is integrated into instalment list | 1,024 | rateIrr1stI' is c n d d1 r count | abs (f / ff) < 0.000000001 = return $ r - f / ff
| count > 30 = throwError $ OtherError $
"rateIrr1stI c:" ++
show c ++
" d1:" ++ show d1 ++
" is:" ++ show is
| otherwise = rateIrr1stI' is c n d d1 (r - f / ff) (count + 1)
where f = sum(map (uncurry (/)) (zip is [(1+r)^i|i <- [1..n]]))
- c*(r+1)**(d + d1 / 30 - 1)
ff = sum(map (uncurry (/)) (zip (map (uncurry (*)) (zip is [fromIntegral(-i)|i <- [1..n]])) [(1+r)^(i+1)|i <- [1..n]]))
- c*(d + d1/30 - 1)
-- | General rate calculation.
-- Delay of 1st installment is integrated into instalment list | 1,024 | false | false | 0 | 21 | 562 | 379 | 196 | 183 | null | null |
bitemyapp/fusion | Fusion.hs | bsd-3-clause | _lines :: Monad m => Stream Text m r -> FreeT (Stream Text m) m r
_lines (Stream step i) = FreeT (go (step i))
where
go p = p >>= \case
Done r -> return $ Pure r
Skip s' -> go (step s')
Yield s' a ->
if T.null a
then go (step s')
else return $ Free $ Stream step' (s', Right a)
step' (s, Left a) =
return $ Done $ FreeT $ return $ Free $ Stream step' (s, Right a)
step' (s, Right "") = step s >>= \case
Done r -> return $ Done $ FreeT $ return $ Pure r
Skip s' -> return $ Skip (s', Right "")
Yield s' a -> step' (s', Right a)
step' (s, Right a) = do
let (a',b') = T.break (== '\n') a
if T.null b'
then return $ Yield (s, Right b') a'
else return $ Yield (s, Left (T.drop 1 b')) a'
| 887 | _lines :: Monad m => Stream Text m r -> FreeT (Stream Text m) m r
_lines (Stream step i) = FreeT (go (step i))
where
go p = p >>= \case
Done r -> return $ Pure r
Skip s' -> go (step s')
Yield s' a ->
if T.null a
then go (step s')
else return $ Free $ Stream step' (s', Right a)
step' (s, Left a) =
return $ Done $ FreeT $ return $ Free $ Stream step' (s, Right a)
step' (s, Right "") = step s >>= \case
Done r -> return $ Done $ FreeT $ return $ Pure r
Skip s' -> return $ Skip (s', Right "")
Yield s' a -> step' (s', Right a)
step' (s, Right a) = do
let (a',b') = T.break (== '\n') a
if T.null b'
then return $ Yield (s, Right b') a'
else return $ Yield (s, Left (T.drop 1 b')) a'
| 887 | _lines (Stream step i) = FreeT (go (step i))
where
go p = p >>= \case
Done r -> return $ Pure r
Skip s' -> go (step s')
Yield s' a ->
if T.null a
then go (step s')
else return $ Free $ Stream step' (s', Right a)
step' (s, Left a) =
return $ Done $ FreeT $ return $ Free $ Stream step' (s, Right a)
step' (s, Right "") = step s >>= \case
Done r -> return $ Done $ FreeT $ return $ Pure r
Skip s' -> return $ Skip (s', Right "")
Yield s' a -> step' (s', Right a)
step' (s, Right a) = do
let (a',b') = T.break (== '\n') a
if T.null b'
then return $ Yield (s, Right b') a'
else return $ Yield (s, Left (T.drop 1 b')) a'
| 821 | false | true | 7 | 14 | 364 | 449 | 214 | 235 | null | null |
limaner2002/EPC-tools | USACScripts/src/Scripts/Opts.hs | bsd-3-clause | form471IntakeAndCertifyParser :: Parser (IO ())
form471IntakeAndCertifyParser = fmap void $ run471IntakeAndCertify
<$> boundsParser
<*> hostUrlParser
<*> logModeParser
<*> csvConfParser
<*> rampupParser
<*> nthreadParser | 232 | form471IntakeAndCertifyParser :: Parser (IO ())
form471IntakeAndCertifyParser = fmap void $ run471IntakeAndCertify
<$> boundsParser
<*> hostUrlParser
<*> logModeParser
<*> csvConfParser
<*> rampupParser
<*> nthreadParser | 232 | form471IntakeAndCertifyParser = fmap void $ run471IntakeAndCertify
<$> boundsParser
<*> hostUrlParser
<*> logModeParser
<*> csvConfParser
<*> rampupParser
<*> nthreadParser | 184 | false | true | 17 | 8 | 34 | 70 | 36 | 34 | null | null |
martinvlk/cis194-homeworks | src/HW02/LogAnalysis.hs | gpl-3.0 | whatWentWrong :: [LogMessage] -> [String]
whatWentWrong = map getMsg . filter important . inOrder . build
where important (LogMessage (Error sev) _ _) = sev >= 50
important _ = False
getMsg (LogMessage _ _ msg') = msg'
getMsg (Unknown msg') = msg' | 273 | whatWentWrong :: [LogMessage] -> [String]
whatWentWrong = map getMsg . filter important . inOrder . build
where important (LogMessage (Error sev) _ _) = sev >= 50
important _ = False
getMsg (LogMessage _ _ msg') = msg'
getMsg (Unknown msg') = msg' | 273 | whatWentWrong = map getMsg . filter important . inOrder . build
where important (LogMessage (Error sev) _ _) = sev >= 50
important _ = False
getMsg (LogMessage _ _ msg') = msg'
getMsg (Unknown msg') = msg' | 231 | false | true | 3 | 9 | 68 | 110 | 55 | 55 | null | null |
sgillespie/ghc | compiler/ghci/GHCi.hs | bsd-3-clause | lookupSymbol :: HscEnv -> FastString -> IO (Maybe (Ptr ()))
lookupSymbol hsc_env@HscEnv{..} str
| gopt Opt_ExternalInterpreter hsc_dflags =
-- Profiling of GHCi showed a lot of time and allocation spent
-- making cross-process LookupSymbol calls, so I added a GHC-side
-- cache which sped things up quite a lot. We have to be careful
-- to purge this cache when unloading code though.
withIServ hsc_env $ \iserv@IServ{..} -> do
cache <- readIORef iservLookupSymbolCache
case lookupUFM cache str of
Just p -> return (Just p)
Nothing -> do
m <- uninterruptibleMask_ $
iservCall iserv (LookupSymbol (unpackFS str))
case m of
Nothing -> return Nothing
Just r -> do
let p = fromRemotePtr r
writeIORef iservLookupSymbolCache $! addToUFM cache str p
return (Just p)
| otherwise =
fmap fromRemotePtr <$> run (LookupSymbol (unpackFS str)) | 1,005 | lookupSymbol :: HscEnv -> FastString -> IO (Maybe (Ptr ()))
lookupSymbol hsc_env@HscEnv{..} str
| gopt Opt_ExternalInterpreter hsc_dflags =
-- Profiling of GHCi showed a lot of time and allocation spent
-- making cross-process LookupSymbol calls, so I added a GHC-side
-- cache which sped things up quite a lot. We have to be careful
-- to purge this cache when unloading code though.
withIServ hsc_env $ \iserv@IServ{..} -> do
cache <- readIORef iservLookupSymbolCache
case lookupUFM cache str of
Just p -> return (Just p)
Nothing -> do
m <- uninterruptibleMask_ $
iservCall iserv (LookupSymbol (unpackFS str))
case m of
Nothing -> return Nothing
Just r -> do
let p = fromRemotePtr r
writeIORef iservLookupSymbolCache $! addToUFM cache str p
return (Just p)
| otherwise =
fmap fromRemotePtr <$> run (LookupSymbol (unpackFS str)) | 1,005 | lookupSymbol hsc_env@HscEnv{..} str
| gopt Opt_ExternalInterpreter hsc_dflags =
-- Profiling of GHCi showed a lot of time and allocation spent
-- making cross-process LookupSymbol calls, so I added a GHC-side
-- cache which sped things up quite a lot. We have to be careful
-- to purge this cache when unloading code though.
withIServ hsc_env $ \iserv@IServ{..} -> do
cache <- readIORef iservLookupSymbolCache
case lookupUFM cache str of
Just p -> return (Just p)
Nothing -> do
m <- uninterruptibleMask_ $
iservCall iserv (LookupSymbol (unpackFS str))
case m of
Nothing -> return Nothing
Just r -> do
let p = fromRemotePtr r
writeIORef iservLookupSymbolCache $! addToUFM cache str p
return (Just p)
| otherwise =
fmap fromRemotePtr <$> run (LookupSymbol (unpackFS str)) | 945 | false | true | 1 | 26 | 307 | 258 | 119 | 139 | null | null |
SAdams601/HaRe | old/testing/unfoldDef/C2_AstOut.hs | bsd-3-clause | sumSquares1 [] = 0 | 18 | sumSquares1 [] = 0 | 18 | sumSquares1 [] = 0 | 18 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.