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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mikeplus64/plissken | src/Controls.hs | gpl-3.0 | buildScheme :: Config -> Scheme
buildScheme
= flip M.union defaultScheme
. M.map valToEvent
. M.mapKeys (\ck -> errorWhenInvalidKey ck (saveKeyToGLFW ck))
. M.filterWithKey (\k _ -> isControl k)
where
isControl :: Save.Key -> Bool
isControl (Key ["controls",_] TT) = True
isControl _ = False
readGLFWkey :: Text -> Maybe GLFW.Key
readGLFWkey = readMaybe . T.unpack . T.map (\case '_' -> ' '; a -> a)
errorWhenInvalidKey :: Save.Key -> Maybe GLFW.Key -> GLFW.Key
errorWhenInvalidKey s Nothing = error $ "Invalid control " ++ show s ++ "."
errorWhenInvalidKey _ (Just k) = k
valToEvent :: Value -> Event
valToEvent (T v)
= fromMaybe
(error ("Invalid event " ++ show v))
(readMaybe (T.unpack v))
valToEvent s = error $ "Expected a string, got " ++ show s
saveKeyToGLFW :: Save.Key -> Maybe GLFW.Key
saveKeyToGLFW (Key ["controls",x] _) = readGLFWkey x
saveKeyToGLFW _ = Nothing | 1,047 | buildScheme :: Config -> Scheme
buildScheme
= flip M.union defaultScheme
. M.map valToEvent
. M.mapKeys (\ck -> errorWhenInvalidKey ck (saveKeyToGLFW ck))
. M.filterWithKey (\k _ -> isControl k)
where
isControl :: Save.Key -> Bool
isControl (Key ["controls",_] TT) = True
isControl _ = False
readGLFWkey :: Text -> Maybe GLFW.Key
readGLFWkey = readMaybe . T.unpack . T.map (\case '_' -> ' '; a -> a)
errorWhenInvalidKey :: Save.Key -> Maybe GLFW.Key -> GLFW.Key
errorWhenInvalidKey s Nothing = error $ "Invalid control " ++ show s ++ "."
errorWhenInvalidKey _ (Just k) = k
valToEvent :: Value -> Event
valToEvent (T v)
= fromMaybe
(error ("Invalid event " ++ show v))
(readMaybe (T.unpack v))
valToEvent s = error $ "Expected a string, got " ++ show s
saveKeyToGLFW :: Save.Key -> Maybe GLFW.Key
saveKeyToGLFW (Key ["controls",x] _) = readGLFWkey x
saveKeyToGLFW _ = Nothing | 1,047 | buildScheme
= flip M.union defaultScheme
. M.map valToEvent
. M.mapKeys (\ck -> errorWhenInvalidKey ck (saveKeyToGLFW ck))
. M.filterWithKey (\k _ -> isControl k)
where
isControl :: Save.Key -> Bool
isControl (Key ["controls",_] TT) = True
isControl _ = False
readGLFWkey :: Text -> Maybe GLFW.Key
readGLFWkey = readMaybe . T.unpack . T.map (\case '_' -> ' '; a -> a)
errorWhenInvalidKey :: Save.Key -> Maybe GLFW.Key -> GLFW.Key
errorWhenInvalidKey s Nothing = error $ "Invalid control " ++ show s ++ "."
errorWhenInvalidKey _ (Just k) = k
valToEvent :: Value -> Event
valToEvent (T v)
= fromMaybe
(error ("Invalid event " ++ show v))
(readMaybe (T.unpack v))
valToEvent s = error $ "Expected a string, got " ++ show s
saveKeyToGLFW :: Save.Key -> Maybe GLFW.Key
saveKeyToGLFW (Key ["controls",x] _) = readGLFWkey x
saveKeyToGLFW _ = Nothing | 1,015 | false | true | 5 | 10 | 315 | 409 | 190 | 219 | null | null |
kmels/hledger | extra/hledger-vty/Hledger/Vty/Main.hs | gpl-3.0 | -- silence warnings
setScrollY y a@AppState{alocs=(l:locs)} = a{alocs=(l':locs)} where l' = setLocScrollY y l | 109 | setScrollY y a@AppState{alocs=(l:locs)} = a{alocs=(l':locs)} where l' = setLocScrollY y l | 89 | setScrollY y a@AppState{alocs=(l:locs)} = a{alocs=(l':locs)} where l' = setLocScrollY y l | 89 | true | false | 0 | 11 | 13 | 58 | 32 | 26 | null | null |
m00nlight/hs-fractal | Math/Haskell/Fractal/Utils.hs | bsd-3-clause | -- | The 'sd' function calculate the standard deviation of a list
sd ∷ Floating a ⇒ [a] → a
sd [] = 0.0 | 103 | sd ∷ Floating a ⇒ [a] → a
sd [] = 0.0 | 37 | sd [] = 0.0 | 11 | true | true | 0 | 9 | 23 | 37 | 17 | 20 | null | null |
NickAger/LearningHaskell | haskellForMacMiscPlayground/Diagrams.hsproj/Diagrams.hs | mit | vector2 :: Diagram B R2
vector2 = fromOffsets . map r2 $ [(1,1), (0,3), (-2,1), (-1,-4)] | 88 | vector2 :: Diagram B R2
vector2 = fromOffsets . map r2 $ [(1,1), (0,3), (-2,1), (-1,-4)] | 88 | vector2 = fromOffsets . map r2 $ [(1,1), (0,3), (-2,1), (-1,-4)] | 64 | false | true | 1 | 9 | 15 | 74 | 40 | 34 | null | null |
burz/Feval | FVL/Eval.hs | mit | substitute s v (Fx' (Equal x y)) = Fx' $ Equal (substitute s v x) (substitute s v y) | 84 | substitute s v (Fx' (Equal x y)) = Fx' $ Equal (substitute s v x) (substitute s v y) | 84 | substitute s v (Fx' (Equal x y)) = Fx' $ Equal (substitute s v x) (substitute s v y) | 84 | false | false | 0 | 9 | 18 | 56 | 27 | 29 | null | null |
yi-editor/yi | yi-keymap-emacs/src/Yi/Keymap/Emacs/Utils.hs | gpl-2.0 | maybeList :: [a] -> [a] -> [a]
maybeList def [] = def | 53 | maybeList :: [a] -> [a] -> [a]
maybeList def [] = def | 53 | maybeList def [] = def | 22 | false | true | 0 | 9 | 11 | 41 | 20 | 21 | null | null |
zeyuanxy/haskell-playground | write-yourself-a-scheme/chap8/main.hs | mit | unpackBool :: LispVal -> ThrowsError Bool
unpackBool (Bool b) = return b | 72 | unpackBool :: LispVal -> ThrowsError Bool
unpackBool (Bool b) = return b | 72 | unpackBool (Bool b) = return b | 30 | false | true | 0 | 7 | 11 | 30 | 14 | 16 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/enumFromTo_2.hs | mit | properFractionQ xz yu = properFractionQ1 xz yu (properFractionVu30 xz yu) | 73 | properFractionQ xz yu = properFractionQ1 xz yu (properFractionVu30 xz yu) | 73 | properFractionQ xz yu = properFractionQ1 xz yu (properFractionVu30 xz yu) | 73 | false | false | 0 | 7 | 9 | 26 | 12 | 14 | null | null |
aztek/voogie | src/Voogie/Front.hs | gpl-3.0 | analyzeStmts :: [B.AST.Statement] -> Analyze [B.Statement]
analyzeStmts = fmap catMaybes . mapM (analyzeStmt . astValue) | 120 | analyzeStmts :: [B.AST.Statement] -> Analyze [B.Statement]
analyzeStmts = fmap catMaybes . mapM (analyzeStmt . astValue) | 120 | analyzeStmts = fmap catMaybes . mapM (analyzeStmt . astValue) | 61 | false | true | 0 | 8 | 14 | 46 | 24 | 22 | null | null |
urbanslug/ghc | compiler/llvmGen/LlvmCodeGen.hs | bsd-3-clause | -- -----------------------------------------------------------------------------
-- | Generate meta data nodes
--
cmmMetaLlvmPrelude :: LlvmM ()
cmmMetaLlvmPrelude = do
metas <- flip mapM stgTBAA $ \(uniq, name, parent) -> do
-- Generate / lookup meta data IDs
tbaaId <- getMetaUniqueId
setUniqMeta uniq tbaaId
parentId <- maybe (return Nothing) getUniqMeta parent
-- Build definition
return $ MetaUnamed tbaaId $ MetaStruct
[ MetaStr name
, case parentId of
Just p -> MetaNode p
Nothing -> MetaVar $ LMLitVar $ LMNullLit i8Ptr
]
renderLlvm $ ppLlvmMetas metas
-- -----------------------------------------------------------------------------
-- | Marks variables as used where necessary
-- | 764 | cmmMetaLlvmPrelude :: LlvmM ()
cmmMetaLlvmPrelude = do
metas <- flip mapM stgTBAA $ \(uniq, name, parent) -> do
-- Generate / lookup meta data IDs
tbaaId <- getMetaUniqueId
setUniqMeta uniq tbaaId
parentId <- maybe (return Nothing) getUniqMeta parent
-- Build definition
return $ MetaUnamed tbaaId $ MetaStruct
[ MetaStr name
, case parentId of
Just p -> MetaNode p
Nothing -> MetaVar $ LMLitVar $ LMNullLit i8Ptr
]
renderLlvm $ ppLlvmMetas metas
-- -----------------------------------------------------------------------------
-- | Marks variables as used where necessary
-- | 649 | cmmMetaLlvmPrelude = do
metas <- flip mapM stgTBAA $ \(uniq, name, parent) -> do
-- Generate / lookup meta data IDs
tbaaId <- getMetaUniqueId
setUniqMeta uniq tbaaId
parentId <- maybe (return Nothing) getUniqMeta parent
-- Build definition
return $ MetaUnamed tbaaId $ MetaStruct
[ MetaStr name
, case parentId of
Just p -> MetaNode p
Nothing -> MetaVar $ LMLitVar $ LMNullLit i8Ptr
]
renderLlvm $ ppLlvmMetas metas
-- -----------------------------------------------------------------------------
-- | Marks variables as used where necessary
-- | 618 | true | true | 0 | 19 | 166 | 158 | 78 | 80 | null | null |
nikita-volkov/attoparsec-time | library/Attoparsec/Time/Validation.hs | mit | weekDay :: (Num a, Ord a) => Validator a
weekDay =
Validator "weekDay" (liftA2 (&&) (>= 1) (<= 7)) | 100 | weekDay :: (Num a, Ord a) => Validator a
weekDay =
Validator "weekDay" (liftA2 (&&) (>= 1) (<= 7)) | 100 | weekDay =
Validator "weekDay" (liftA2 (&&) (>= 1) (<= 7)) | 59 | false | true | 0 | 8 | 20 | 59 | 31 | 28 | null | null |
dan3944/emojiscript | src/Transpile.hs | mit | serialize :: [Atom] -> String
serialize = concatMap $ \case
CharLit c -> [c]
Comment s -> "/*" ++ s ++ "*/"
StringLit s -> "\"" ++ s ++ "\"" | 188 | serialize :: [Atom] -> String
serialize = concatMap $ \case
CharLit c -> [c]
Comment s -> "/*" ++ s ++ "*/"
StringLit s -> "\"" ++ s ++ "\"" | 188 | serialize = concatMap $ \case
CharLit c -> [c]
Comment s -> "/*" ++ s ++ "*/"
StringLit s -> "\"" ++ s ++ "\"" | 158 | false | true | 0 | 10 | 77 | 70 | 35 | 35 | null | null |
kim/amazonka | amazonka-glacier/gen/Network/AWS/Glacier/ListParts.hs | mpl-2.0 | -- | 'ListParts' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'lpAccountId' @::@ 'Text'
--
-- * 'lpLimit' @::@ 'Maybe' 'Text'
--
-- * 'lpMarker' @::@ 'Maybe' 'Text'
--
-- * 'lpUploadId' @::@ 'Text'
--
-- * 'lpVaultName' @::@ 'Text'
--
listParts :: Text -- ^ 'lpAccountId'
-> Text -- ^ 'lpVaultName'
-> Text -- ^ 'lpUploadId'
-> ListParts
listParts p1 p2 p3 = ListParts
{ _lpAccountId = p1
, _lpVaultName = p2
, _lpUploadId = p3
, _lpMarker = Nothing
, _lpLimit = Nothing
} | 572 | listParts :: Text -- ^ 'lpAccountId'
-> Text -- ^ 'lpVaultName'
-> Text -- ^ 'lpUploadId'
-> ListParts
listParts p1 p2 p3 = ListParts
{ _lpAccountId = p1
, _lpVaultName = p2
, _lpUploadId = p3
, _lpMarker = Nothing
, _lpLimit = Nothing
} | 299 | listParts p1 p2 p3 = ListParts
{ _lpAccountId = p1
, _lpVaultName = p2
, _lpUploadId = p3
, _lpMarker = Nothing
, _lpLimit = Nothing
} | 166 | true | true | 0 | 9 | 152 | 88 | 55 | 33 | null | null |
romanb/amazonka | amazonka-swf/gen/Network/AWS/SWF/Types.hs | mpl-2.0 | -- | The id of the 'StartChildWorkflowExecutionInitiated' event corresponding to the 'StartChildWorkflowExecution' 'Decision' to start this child workflow execution.
-- This information can be useful for diagnosing problems by tracing back the
-- chain of events leading up to this event.
cweseaInitiatedEventId :: Lens' ChildWorkflowExecutionStartedEventAttributes Integer
cweseaInitiatedEventId =
lens _cweseaInitiatedEventId (\s a -> s { _cweseaInitiatedEventId = a }) | 475 | cweseaInitiatedEventId :: Lens' ChildWorkflowExecutionStartedEventAttributes Integer
cweseaInitiatedEventId =
lens _cweseaInitiatedEventId (\s a -> s { _cweseaInitiatedEventId = a }) | 186 | cweseaInitiatedEventId =
lens _cweseaInitiatedEventId (\s a -> s { _cweseaInitiatedEventId = a }) | 101 | true | true | 0 | 9 | 62 | 42 | 24 | 18 | null | null |
michaelbeaumont/pandoc | src/Text/Pandoc/Writers/OpenDocument.hs | gpl-2.0 | addNote :: Doc -> State WriterState ()
addNote i = modify $ \s -> s { stNotes = i : stNotes s } | 95 | addNote :: Doc -> State WriterState ()
addNote i = modify $ \s -> s { stNotes = i : stNotes s } | 95 | addNote i = modify $ \s -> s { stNotes = i : stNotes s } | 56 | false | true | 0 | 10 | 22 | 49 | 25 | 24 | null | null |
verement/etamoo | src/MOO/Database.hs | bsd-3-clause | maxObject :: Database -> ObjId
maxObject = pred . V.length . objects | 68 | maxObject :: Database -> ObjId
maxObject = pred . V.length . objects | 68 | maxObject = pred . V.length . objects | 37 | false | true | 0 | 7 | 11 | 25 | 13 | 12 | null | null |
aisamanra/config-ini | test/ini-compat/Main.hs | bsd-3-clause | mkIni :: Gen I1.Ini
mkIni = do
ss <- Gen.list (Range.linear 0 10) $ do
name <- textChunk
section <-
Gen.list (Range.linear 0 10) $
(,) <$> textChunk <*> textChunk
return (name, section)
return (I1.Ini (HM.fromList ss) []) | 251 | mkIni :: Gen I1.Ini
mkIni = do
ss <- Gen.list (Range.linear 0 10) $ do
name <- textChunk
section <-
Gen.list (Range.linear 0 10) $
(,) <$> textChunk <*> textChunk
return (name, section)
return (I1.Ini (HM.fromList ss) []) | 251 | mkIni = do
ss <- Gen.list (Range.linear 0 10) $ do
name <- textChunk
section <-
Gen.list (Range.linear 0 10) $
(,) <$> textChunk <*> textChunk
return (name, section)
return (I1.Ini (HM.fromList ss) []) | 231 | false | true | 0 | 18 | 67 | 124 | 59 | 65 | null | null |
davidfontenot/haskell-hashtag-viewer | src/WebServer.hs | mit | getResponseForFile :: String -> ServerMonad FileResponse
getResponseForFile urlPath | urlPath == "" = return RedirectToIndex | 124 | getResponseForFile :: String -> ServerMonad FileResponse
getResponseForFile urlPath | urlPath == "" = return RedirectToIndex | 124 | getResponseForFile urlPath | urlPath == "" = return RedirectToIndex | 67 | false | true | 0 | 8 | 14 | 38 | 16 | 22 | null | null |
AndrewRademacher/stack | src/Stack/Types/Config.hs | bsd-3-clause | resolverName (ResolverCustomLoaded name _ _) = "custom-" <> name | 64 | resolverName (ResolverCustomLoaded name _ _) = "custom-" <> name | 64 | resolverName (ResolverCustomLoaded name _ _) = "custom-" <> name | 64 | false | false | 0 | 7 | 8 | 23 | 11 | 12 | null | null |
osense/stalkerlike-client-cli | app/UI/App.hs | gpl-3.0 | handleVtyEvent s _ = continue s | 31 | handleVtyEvent s _ = continue s | 31 | handleVtyEvent s _ = continue s | 31 | false | false | 0 | 5 | 5 | 16 | 6 | 10 | null | null |
mrd/camfort | src/Camfort/Transformation/EquivalenceElim.hs | apache-2.0 | perStatementRmEquiv :: F.Statement A1 -> State RmEqState (F.Statement A1)
perStatementRmEquiv (F.StEquivalence a sp@(FU.SrcSpan spL _) equivs) = do
(ess, n, r) <- get
let report = r ++ show spL ++ ": removed equivalence \n"
put (((map F.aStrip) . F.aStrip $ equivs) ++ ess, n - 1, r ++ report)
let a' = onPrev (\ap -> ap {refactored = Just spL, deleteNode = True}) a
return (F.StEquivalence a' (deleteLine sp) equivs) | 437 | perStatementRmEquiv :: F.Statement A1 -> State RmEqState (F.Statement A1)
perStatementRmEquiv (F.StEquivalence a sp@(FU.SrcSpan spL _) equivs) = do
(ess, n, r) <- get
let report = r ++ show spL ++ ": removed equivalence \n"
put (((map F.aStrip) . F.aStrip $ equivs) ++ ess, n - 1, r ++ report)
let a' = onPrev (\ap -> ap {refactored = Just spL, deleteNode = True}) a
return (F.StEquivalence a' (deleteLine sp) equivs) | 437 | perStatementRmEquiv (F.StEquivalence a sp@(FU.SrcSpan spL _) equivs) = do
(ess, n, r) <- get
let report = r ++ show spL ++ ": removed equivalence \n"
put (((map F.aStrip) . F.aStrip $ equivs) ++ ess, n - 1, r ++ report)
let a' = onPrev (\ap -> ap {refactored = Just spL, deleteNode = True}) a
return (F.StEquivalence a' (deleteLine sp) equivs) | 363 | false | true | 0 | 15 | 90 | 208 | 105 | 103 | null | null |
conal/functor-combo | src/FunctorCombo/Pair.hs | bsd-3-clause | -- TODO: Eliminate inZipA in favor of inDist
curryP :: (Pair a -> b) -> (a -> a -> b)
curryP g = curry (g . toP) | 113 | curryP :: (Pair a -> b) -> (a -> a -> b)
curryP g = curry (g . toP) | 67 | curryP g = curry (g . toP) | 26 | true | true | 0 | 8 | 27 | 53 | 27 | 26 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Actions/Navigation2D.hs | bsd-2-clause | -- | Shorthand for integer conversions
fi :: (Integral a, Num b) => a -> b
fi = fromIntegral | 92 | fi :: (Integral a, Num b) => a -> b
fi = fromIntegral | 53 | fi = fromIntegral | 17 | true | true | 0 | 8 | 18 | 38 | 18 | 20 | null | null |
Brightgalrs/con-lang-gen | src/Gen/Phonotactics.hs | mit | makeCodas _ 50 codas onsets cns sonHier settings = makeCodas 0 50 codas onsets cns sonHier settings | 99 | makeCodas _ 50 codas onsets cns sonHier settings = makeCodas 0 50 codas onsets cns sonHier settings | 99 | makeCodas _ 50 codas onsets cns sonHier settings = makeCodas 0 50 codas onsets cns sonHier settings | 99 | false | false | 0 | 5 | 16 | 36 | 17 | 19 | null | null |
DaMSL/K3 | src/Language/K3/Core/Type.hs | apache-2.0 | isTSpan _ = False | 17 | isTSpan _ = False | 17 | isTSpan _ = False | 17 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
ekmett/aeson-lens | Data/Aeson/Lens.hs | bsd-3-clause | -- | Indexed traversal of Object
--
-- >>> let w = decode (L.pack "[{\"name\": \"tanakh\", \"age\": 29}, {\"name\": \"nushio\", \"age\": 28}]") :: Maybe Value
-- >>> catMaybes . toListOf (traverseArray . traverseObject) $ w :: [Value]
-- [String "tanakh",Number 29,String "nushio",Number 28]
traverseObject :: (FromJSON v, ToJSON v)
=> SimpleIndexedTraversal T.Text (Maybe Value) (Maybe v)
traverseObject = traverseObject' | 440 | traverseObject :: (FromJSON v, ToJSON v)
=> SimpleIndexedTraversal T.Text (Maybe Value) (Maybe v)
traverseObject = traverseObject' | 148 | traverseObject = traverseObject' | 32 | true | true | 0 | 8 | 76 | 52 | 29 | 23 | null | null |
adamwalker/hlibBladeRF | src/LibBladeRF/Gain.hs | lgpl-2.1 | bladeRFGetTXVGA2 :: DeviceHandle -- ^ Device handle
-> IO Int -- ^ Returned gain
bladeRFGetTXVGA2 dev = do
g <- alloca $ \p -> do
c'bladerf_get_txvga2 (unDeviceHandle dev) p
peek p
return $ fromIntegral g
-- | Set the post-LPF gain in dB. | 274 | bladeRFGetTXVGA2 :: DeviceHandle -- ^ Device handle
-> IO Int
bladeRFGetTXVGA2 dev = do
g <- alloca $ \p -> do
c'bladerf_get_txvga2 (unDeviceHandle dev) p
peek p
return $ fromIntegral g
-- | Set the post-LPF gain in dB. | 249 | bladeRFGetTXVGA2 dev = do
g <- alloca $ \p -> do
c'bladerf_get_txvga2 (unDeviceHandle dev) p
peek p
return $ fromIntegral g
-- | Set the post-LPF gain in dB. | 170 | true | true | 0 | 14 | 78 | 70 | 33 | 37 | null | null |
louispan/glazier | test/Spec.hs | bsd-3-clause | ioProgramWithConcur ::
( Cmd' IOEffect c
, Cmd'' Concur c
, Cmd' [] c) => Program c ()
ioProgramWithConcur = do
exec' $ PutStrLn "Write two things"
evalContT $ do
(a1, a2) <- concurringly $ do
-- Use the Concur monad to batch two GetLines concurrently
-- requires ApplicativeDo
a1 <- delegatify $ exec' . GetLine
a2 <- delegatify $ exec' . GetLine
pure (a1, a2)
-- Do something monadic/different based on the return value.
case a1 of
"secret" -> exec' $ PutStrLn "Easter egg!"
_ -> do
exec' $ PutStrLn "Write something else"
-- more GetLine input, but sequentially
b <- delegatify $ exec' . GetLine
exec' $ PutStrLn $ "You wrote: (" <> a1 <> ", " <> a2 <> ") then " <> b
-- | Program using both effects | 915 | ioProgramWithConcur ::
( Cmd' IOEffect c
, Cmd'' Concur c
, Cmd' [] c) => Program c ()
ioProgramWithConcur = do
exec' $ PutStrLn "Write two things"
evalContT $ do
(a1, a2) <- concurringly $ do
-- Use the Concur monad to batch two GetLines concurrently
-- requires ApplicativeDo
a1 <- delegatify $ exec' . GetLine
a2 <- delegatify $ exec' . GetLine
pure (a1, a2)
-- Do something monadic/different based on the return value.
case a1 of
"secret" -> exec' $ PutStrLn "Easter egg!"
_ -> do
exec' $ PutStrLn "Write something else"
-- more GetLine input, but sequentially
b <- delegatify $ exec' . GetLine
exec' $ PutStrLn $ "You wrote: (" <> a1 <> ", " <> a2 <> ") then " <> b
-- | Program using both effects | 915 | ioProgramWithConcur = do
exec' $ PutStrLn "Write two things"
evalContT $ do
(a1, a2) <- concurringly $ do
-- Use the Concur monad to batch two GetLines concurrently
-- requires ApplicativeDo
a1 <- delegatify $ exec' . GetLine
a2 <- delegatify $ exec' . GetLine
pure (a1, a2)
-- Do something monadic/different based on the return value.
case a1 of
"secret" -> exec' $ PutStrLn "Easter egg!"
_ -> do
exec' $ PutStrLn "Write something else"
-- more GetLine input, but sequentially
b <- delegatify $ exec' . GetLine
exec' $ PutStrLn $ "You wrote: (" <> a1 <> ", " <> a2 <> ") then " <> b
-- | Program using both effects | 816 | false | true | 0 | 21 | 345 | 210 | 103 | 107 | null | null |
brendanhay/gogol | gogol-cloudsearch/gen/Network/Google/CloudSearch/Types/Product.hs | mpl-2.0 | -- | Structured data hash of the item according to the repository. If
-- specified, this is used to determine how to modify this item\'s status.
-- Setting this field and the type field results in argument error. The
-- maximum length is 2048 characters.
piStructuredDataHash :: Lens' PushItem (Maybe Text)
piStructuredDataHash
= lens _piStructuredDataHash
(\ s a -> s{_piStructuredDataHash = a}) | 404 | piStructuredDataHash :: Lens' PushItem (Maybe Text)
piStructuredDataHash
= lens _piStructuredDataHash
(\ s a -> s{_piStructuredDataHash = a}) | 149 | piStructuredDataHash
= lens _piStructuredDataHash
(\ s a -> s{_piStructuredDataHash = a}) | 97 | true | true | 1 | 9 | 69 | 54 | 28 | 26 | null | null |
pgavin/secdh | lib/Language/Slambda/Util.hs | bsd-3-clause | freeVars (ConstT _) = Set.empty | 35 | freeVars (ConstT _) = Set.empty | 35 | freeVars (ConstT _) = Set.empty | 35 | false | false | 0 | 6 | 8 | 18 | 8 | 10 | null | null |
joeyadams/haskell-rolling-queue | Data/STM/RollingQueue.hs | bsd-3-clause | -- | Create a new, empty 'RollingQueue', with the given size limit.
--
-- To change the size limit later, use 'setLimit'.
new :: Int -> STM (RollingQueue a)
new limit = do
hole <- TList.empty
rv <- newTVar $ ReadEnd hole 0 0
wv <- newTVar $ WriteEnd hole 0 (max 0 limit)
return (RQ rv wv)
{- |
@IO@ variant of 'new'. This is useful for creating top-level
'RollingQueue's using 'System.IO.Unsafe.unsafePerformIO', because performing
'atomically' inside a pure computation is extremely dangerous (can lead to
'Control.Exception.NestedAtomically' errors and even segfaults,
see GHC ticket #5866).
Example:
@
logQueue :: 'RollingQueue' LogEntry
logQueue = 'System.IO.Unsafe.unsafePerformIO' (RQ.'newIO' 1000)
\{\-\# NOINLINE logQueue \#\-\}
@
-} | 761 | new :: Int -> STM (RollingQueue a)
new limit = do
hole <- TList.empty
rv <- newTVar $ ReadEnd hole 0 0
wv <- newTVar $ WriteEnd hole 0 (max 0 limit)
return (RQ rv wv)
{- |
@IO@ variant of 'new'. This is useful for creating top-level
'RollingQueue's using 'System.IO.Unsafe.unsafePerformIO', because performing
'atomically' inside a pure computation is extremely dangerous (can lead to
'Control.Exception.NestedAtomically' errors and even segfaults,
see GHC ticket #5866).
Example:
@
logQueue :: 'RollingQueue' LogEntry
logQueue = 'System.IO.Unsafe.unsafePerformIO' (RQ.'newIO' 1000)
\{\-\# NOINLINE logQueue \#\-\}
@
-} | 639 | new limit = do
hole <- TList.empty
rv <- newTVar $ ReadEnd hole 0 0
wv <- newTVar $ WriteEnd hole 0 (max 0 limit)
return (RQ rv wv)
{- |
@IO@ variant of 'new'. This is useful for creating top-level
'RollingQueue's using 'System.IO.Unsafe.unsafePerformIO', because performing
'atomically' inside a pure computation is extremely dangerous (can lead to
'Control.Exception.NestedAtomically' errors and even segfaults,
see GHC ticket #5866).
Example:
@
logQueue :: 'RollingQueue' LogEntry
logQueue = 'System.IO.Unsafe.unsafePerformIO' (RQ.'newIO' 1000)
\{\-\# NOINLINE logQueue \#\-\}
@
-} | 604 | true | true | 0 | 12 | 131 | 102 | 48 | 54 | null | null |
snoyberg/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | emptyRuleEnv :: RuleEnv
emptyRuleEnv = RuleEnv emptyNameEnv emptyModuleSet | 74 | emptyRuleEnv :: RuleEnv
emptyRuleEnv = RuleEnv emptyNameEnv emptyModuleSet | 74 | emptyRuleEnv = RuleEnv emptyNameEnv emptyModuleSet | 50 | false | true | 0 | 5 | 7 | 16 | 8 | 8 | null | null |
eric-ch/manager | xenmgr/XenMgr/Host.hs | gpl-2.0 | getHostPlaybackDevices = filter pcmPlayback <$> getHostPcmDevices | 65 | getHostPlaybackDevices = filter pcmPlayback <$> getHostPcmDevices | 65 | getHostPlaybackDevices = filter pcmPlayback <$> getHostPcmDevices | 65 | false | false | 0 | 6 | 5 | 13 | 6 | 7 | null | null |
technogeeky/d-A | include/containers-0.5.0.0/Data/IntMap/Base.hs | gpl-3.0 | {--------------------------------------------------------------------
List variations
--------------------------------------------------------------------}
-- | /O(n)/.
-- Return all elements of the map in the ascending order of their keys.
-- Subject to list fusion.
--
-- > elems (fromList [(5,"a"), (3,"b")]) == ["b","a"]
-- > elems empty == []
elems :: IntMap a -> [a]
elems = foldr (:) [] | 396 | elems :: IntMap a -> [a]
elems = foldr (:) [] | 45 | elems = foldr (:) [] | 20 | true | true | 0 | 6 | 54 | 37 | 23 | 14 | null | null |
silkapp/tagsoup | dead/parser/Compiler/Lp.hs | bsd-3-clause | isCall _ = False | 16 | isCall _ = False | 16 | isCall _ = False | 16 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
olsner/ghc | libraries/template-haskell/Language/Haskell/TH/Lib.hs | bsd-3-clause | promotedConsT :: TypeQ
promotedConsT = return PromotedConsT | 59 | promotedConsT :: TypeQ
promotedConsT = return PromotedConsT | 59 | promotedConsT = return PromotedConsT | 36 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
MichaelBurge/haskell-authorize-net | src/Network/AuthorizeNet/Types.hs | bsd-3-clause | mkCustomerProfilePayment :: CustomerProfilePayment
mkCustomerProfilePayment = CustomerProfilePayment Nothing Nothing Nothing Nothing | 132 | mkCustomerProfilePayment :: CustomerProfilePayment
mkCustomerProfilePayment = CustomerProfilePayment Nothing Nothing Nothing Nothing | 132 | mkCustomerProfilePayment = CustomerProfilePayment Nothing Nothing Nothing Nothing | 81 | false | true | 0 | 5 | 9 | 20 | 10 | 10 | null | null |
triplepointfive/Hackonad | src/Hackonad/LineParser.hs | mit | multipartCommand :: InputLine -> [Input]
multipartCommand = map plainCommand . splitOn ";" | 90 | multipartCommand :: InputLine -> [Input]
multipartCommand = map plainCommand . splitOn ";" | 90 | multipartCommand = map plainCommand . splitOn ";" | 49 | false | true | 0 | 8 | 11 | 34 | 15 | 19 | null | null |
Docteur-Lalla/HsSHAUN | tests/parser.hs | bsd-3-clause | int = "4.5e2 rad " | 18 | int = "4.5e2 rad " | 18 | int = "4.5e2 rad " | 18 | false | false | 1 | 5 | 4 | 10 | 3 | 7 | null | null |
databrary/databrary | src/EZID/API.hs | agpl-3.0 | ezidMeta EZIDUnavailable = [ ("_status", "unavailable") ] | 57 | ezidMeta EZIDUnavailable = [ ("_status", "unavailable") ] | 57 | ezidMeta EZIDUnavailable = [ ("_status", "unavailable") ] | 57 | false | false | 1 | 6 | 6 | 21 | 10 | 11 | null | null |
supermario/hilt | src/Hilt/Postgres.hs | bsd-3-clause | -- Utilities
insert :: forall a . (PersistEntityBackend a ~ SqlBackend, PersistEntity a) => Handle -> a -> IO (Key a)
insert handle element = queryP handle $ P.insert element | 175 | insert :: forall a . (PersistEntityBackend a ~ SqlBackend, PersistEntity a) => Handle -> a -> IO (Key a)
insert handle element = queryP handle $ P.insert element | 161 | insert handle element = queryP handle $ P.insert element | 56 | true | true | 0 | 11 | 30 | 71 | 35 | 36 | null | null |
obreitwi/dotfiles_desktop | xmonad/xmonad.hs | gpl-2.0 | setHostname :: String -> MyConfig -> MyConfig
setHostname newHostname oldConfig = oldConfig { hostname = newHostname } | 118 | setHostname :: String -> MyConfig -> MyConfig
setHostname newHostname oldConfig = oldConfig { hostname = newHostname } | 118 | setHostname newHostname oldConfig = oldConfig { hostname = newHostname } | 72 | false | true | 0 | 6 | 16 | 32 | 17 | 15 | null | null |
matonix/pfds | src/PFDS/Sec9/Ex10.hs | bsd-3-clause | unconsTree :: RList a -> (Tree a, RList a)
unconsTree [] = error "Empty" | 72 | unconsTree :: RList a -> (Tree a, RList a)
unconsTree [] = error "Empty" | 72 | unconsTree [] = error "Empty" | 29 | false | true | 0 | 7 | 13 | 38 | 18 | 20 | null | null |
kazu-yamamoto/webserver | Network/Web/Server/CGI.hs | bsd-3-clause | responseAny :: Status -> Fields -> L.ByteString -> Response
responseAny st flds val = makeResponse3 st (Just val) Nothing flds'
where
flds' = case lookupField' FkSetCookie2 flds of
Nothing -> flds
Just _ -> insertField' FkCacheControl "no-cache=\"set-cookie2\"" flds | 285 | responseAny :: Status -> Fields -> L.ByteString -> Response
responseAny st flds val = makeResponse3 st (Just val) Nothing flds'
where
flds' = case lookupField' FkSetCookie2 flds of
Nothing -> flds
Just _ -> insertField' FkCacheControl "no-cache=\"set-cookie2\"" flds | 285 | responseAny st flds val = makeResponse3 st (Just val) Nothing flds'
where
flds' = case lookupField' FkSetCookie2 flds of
Nothing -> flds
Just _ -> insertField' FkCacheControl "no-cache=\"set-cookie2\"" flds | 225 | false | true | 1 | 9 | 56 | 94 | 42 | 52 | null | null |
ak3n/hseiffel | src/Main.hs | mit | main :: IO ()
main = do
args <- getArgs
let (opts, files) = partition (isPrefixOf "--") args
let mode = chooseMode opts
case mode of
Help -> putStr helpMessage
mode -> do
forM_ (filter (isSuffixOf ".e") files) $ \fileName -> do
fileExists <- doesFileExist fileName
if fileExists then do
content <- readFile fileName
-- show AST
(print . parse) content >> putStrLn ""
llstr <- codegen initModule ([parse content])
-- show LL
putStrLn llstr
let llfile = fileName ++ ".ll"
writeFile llfile llstr
case mode of
Interpretation -> void $ runCommand $ "lli-3.5 " ++ llfile
_ -> void $ runCommand $ concat ["llc-3.5 " ++ llfile ++ ";",
"as -o hello.o " ++ fileName ++ ".s;",
"gcc -o hello hello.o"]
else putStrLn "Does not file exist."
where parse bstr = case parseClass (Text.pack bstr) of
Left e -> error (show e)
Right c -> c | 1,147 | main :: IO ()
main = do
args <- getArgs
let (opts, files) = partition (isPrefixOf "--") args
let mode = chooseMode opts
case mode of
Help -> putStr helpMessage
mode -> do
forM_ (filter (isSuffixOf ".e") files) $ \fileName -> do
fileExists <- doesFileExist fileName
if fileExists then do
content <- readFile fileName
-- show AST
(print . parse) content >> putStrLn ""
llstr <- codegen initModule ([parse content])
-- show LL
putStrLn llstr
let llfile = fileName ++ ".ll"
writeFile llfile llstr
case mode of
Interpretation -> void $ runCommand $ "lli-3.5 " ++ llfile
_ -> void $ runCommand $ concat ["llc-3.5 " ++ llfile ++ ";",
"as -o hello.o " ++ fileName ++ ".s;",
"gcc -o hello hello.o"]
else putStrLn "Does not file exist."
where parse bstr = case parseClass (Text.pack bstr) of
Left e -> error (show e)
Right c -> c | 1,147 | main = do
args <- getArgs
let (opts, files) = partition (isPrefixOf "--") args
let mode = chooseMode opts
case mode of
Help -> putStr helpMessage
mode -> do
forM_ (filter (isSuffixOf ".e") files) $ \fileName -> do
fileExists <- doesFileExist fileName
if fileExists then do
content <- readFile fileName
-- show AST
(print . parse) content >> putStrLn ""
llstr <- codegen initModule ([parse content])
-- show LL
putStrLn llstr
let llfile = fileName ++ ".ll"
writeFile llfile llstr
case mode of
Interpretation -> void $ runCommand $ "lli-3.5 " ++ llfile
_ -> void $ runCommand $ concat ["llc-3.5 " ++ llfile ++ ";",
"as -o hello.o " ++ fileName ++ ".s;",
"gcc -o hello hello.o"]
else putStrLn "Does not file exist."
where parse bstr = case parseClass (Text.pack bstr) of
Left e -> error (show e)
Right c -> c | 1,133 | false | true | 0 | 26 | 474 | 336 | 158 | 178 | null | null |
lukexi/ghc | compiler/nativeGen/RegAlloc/Graph/Spill.hs | bsd-3-clause | - | Extract spiller statistics from the spiller state.
makeSpillStats :: SpillS -> SpillStats
makeSpillStats s
= SpillStats
{ spillStoreLoad = stateSpillSL s }
| 183 | makeSpillStats :: SpillS -> SpillStats
makeSpillStats s
= SpillStats
{ spillStoreLoad = stateSpillSL s } | 127 | makeSpillStats s
= SpillStats
{ spillStoreLoad = stateSpillSL s } | 88 | true | true | 1 | 9 | 47 | 48 | 24 | 24 | null | null |
athanclark/sets | src/Data/Set/Unordered/Many.hs | mit | -- | /O(n)/
size :: UMSet a -> Int
size (UMSet xs) = List.length xs | 67 | size :: UMSet a -> Int
size (UMSet xs) = List.length xs | 55 | size (UMSet xs) = List.length xs | 32 | true | true | 0 | 7 | 14 | 33 | 16 | 17 | null | null |
Eugleo/Code-Wars | src/number-kata/DeleteNth.hs | bsd-3-clause | deleteNth' :: [Int] -> Int -> [Int]
deleteNth' lst n =
reverse $ (reverse lst) \\ (concatMap (drop n) . group $ sort lst) | 123 | deleteNth' :: [Int] -> Int -> [Int]
deleteNth' lst n =
reverse $ (reverse lst) \\ (concatMap (drop n) . group $ sort lst) | 123 | deleteNth' lst n =
reverse $ (reverse lst) \\ (concatMap (drop n) . group $ sort lst) | 87 | false | true | 0 | 11 | 25 | 67 | 34 | 33 | null | null |
mxswd/mmd | test/test.hs | bsd-3-clause | findv i is vs = (p, q, r)
where
p = vs V.! (fromIntegral (is V.! (i*3 )))
q = vs V.! (fromIntegral (is V.! (i*3 + 1)))
r = vs V.! (fromIntegral (is V.! (i*3 + 2))) | 180 | findv i is vs = (p, q, r)
where
p = vs V.! (fromIntegral (is V.! (i*3 )))
q = vs V.! (fromIntegral (is V.! (i*3 + 1)))
r = vs V.! (fromIntegral (is V.! (i*3 + 2))) | 180 | findv i is vs = (p, q, r)
where
p = vs V.! (fromIntegral (is V.! (i*3 )))
q = vs V.! (fromIntegral (is V.! (i*3 + 1)))
r = vs V.! (fromIntegral (is V.! (i*3 + 2))) | 180 | false | false | 2 | 14 | 54 | 137 | 71 | 66 | null | null |
robx/puzzle-draw | src/Draw/PuzzleTypes.hs | mit | arrowsudoku ::
Backend' b =>
Drawers b (AreaGrid, Grid C (Maybe Int), [Thermometer]) (Grid C Int)
arrowsudoku =
Drawers
( areas
. fst3
<> placeGrid
. fmap int
. clues
. snd3
<> arrows
. trd3
<> grid gDefault
. fst3
)
( areas
. fst3
. fst
<> placeGrid
. fmap int
. snd
<> thermos
. trd3
. fst
<> grid gDefault
. fst3
. fst
)
where
fst3 (a, _, _) = a
snd3 (_, b, _) = b
trd3 (_, _, c) = c | 582 | arrowsudoku ::
Backend' b =>
Drawers b (AreaGrid, Grid C (Maybe Int), [Thermometer]) (Grid C Int)
arrowsudoku =
Drawers
( areas
. fst3
<> placeGrid
. fmap int
. clues
. snd3
<> arrows
. trd3
<> grid gDefault
. fst3
)
( areas
. fst3
. fst
<> placeGrid
. fmap int
. snd
<> thermos
. trd3
. fst
<> grid gDefault
. fst3
. fst
)
where
fst3 (a, _, _) = a
snd3 (_, b, _) = b
trd3 (_, _, c) = c | 582 | arrowsudoku =
Drawers
( areas
. fst3
<> placeGrid
. fmap int
. clues
. snd3
<> arrows
. trd3
<> grid gDefault
. fst3
)
( areas
. fst3
. fst
<> placeGrid
. fmap int
. snd
<> thermos
. trd3
. fst
<> grid gDefault
. fst3
. fst
)
where
fst3 (a, _, _) = a
snd3 (_, b, _) = b
trd3 (_, _, c) = c | 480 | false | true | 0 | 16 | 283 | 214 | 110 | 104 | null | null |
GaloisInc/halvm-ghc | compiler/iface/IfaceType.hs | bsd-3-clause | pprIfaceCoTcApp :: TyPrec -> IfaceTyCon -> [IfaceCoercion] -> SDoc
pprIfaceCoTcApp ctxt_prec tc tys = ppr_iface_tc_app ppr_co ctxt_prec tc tys | 142 | pprIfaceCoTcApp :: TyPrec -> IfaceTyCon -> [IfaceCoercion] -> SDoc
pprIfaceCoTcApp ctxt_prec tc tys = ppr_iface_tc_app ppr_co ctxt_prec tc tys | 142 | pprIfaceCoTcApp ctxt_prec tc tys = ppr_iface_tc_app ppr_co ctxt_prec tc tys | 75 | false | true | 0 | 8 | 18 | 42 | 21 | 21 | null | null |
noteed/openerpdist | OpenERP/Dist/Descriptor.hs | bsd-3-clause | tripleQuotes' = ("\"\"\"" :) . (++ ["\"\"\","]) | 47 | tripleQuotes' = ("\"\"\"" :) . (++ ["\"\"\","]) | 47 | tripleQuotes' = ("\"\"\"" :) . (++ ["\"\"\","]) | 47 | false | false | 0 | 7 | 6 | 21 | 13 | 8 | null | null |
cartazio/omega | mosaic/CircularFinal.hs | bsd-3-clause | trace f t = out
where (out, feedback) = f t feedback | 55 | trace f t = out
where (out, feedback) = f t feedback | 55 | trace f t = out
where (out, feedback) = f t feedback | 55 | false | false | 0 | 7 | 14 | 30 | 15 | 15 | null | null |
beni55/fay | src/haskell-names/Language/Haskell/Names/ScopeUtils.hs | bsd-3-clause | resolveCNames
:: Symbols
-> OrigName
-> (CName l -> Error l) -- ^ error for "not found" condition
-> [CName l]
-> ([CName (Scoped l)], Symbols)
resolveCNames syms orig notFound =
second mconcat . unzip . map (resolveCName syms orig notFound) | 253 | resolveCNames
:: Symbols
-> OrigName
-> (CName l -> Error l) -- ^ error for "not found" condition
-> [CName l]
-> ([CName (Scoped l)], Symbols)
resolveCNames syms orig notFound =
second mconcat . unzip . map (resolveCName syms orig notFound) | 253 | resolveCNames syms orig notFound =
second mconcat . unzip . map (resolveCName syms orig notFound) | 99 | false | true | 0 | 15 | 52 | 101 | 49 | 52 | null | null |
plancalculus/sloth | Test/Sloth/CharSet.hs | bsd-3-clause | checkCharSet (NoRef rs) = NoRef (map checkCharSet rs) | 53 | checkCharSet (NoRef rs) = NoRef (map checkCharSet rs) | 53 | checkCharSet (NoRef rs) = NoRef (map checkCharSet rs) | 53 | false | false | 0 | 7 | 7 | 26 | 12 | 14 | null | null |
mpitid/scheme48 | src/Scheme48/Main.hs | mit | flushStr :: String -> IO ()
flushStr str = putStr str >> hFlush stdout | 70 | flushStr :: String -> IO ()
flushStr str = putStr str >> hFlush stdout | 70 | flushStr str = putStr str >> hFlush stdout | 42 | false | true | 2 | 8 | 13 | 38 | 16 | 22 | null | null |
beni55/bayes-stack | network-topic-models/BenchST.hs | bsd-3-clause | stBenchmarkParams :: [STBenchmark]
stBenchmarkParams = do
updateBlock <- [10, 100, 1000]
topics <- [20, 100, 500]
threads <- [1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26]
return STBenchmark { bNetParams = netParams {nTopics=topics}
, bThreads = threads
, bUpdateBlock = updateBlock
, bSweeps = 2
} | 414 | stBenchmarkParams :: [STBenchmark]
stBenchmarkParams = do
updateBlock <- [10, 100, 1000]
topics <- [20, 100, 500]
threads <- [1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26]
return STBenchmark { bNetParams = netParams {nTopics=topics}
, bThreads = threads
, bUpdateBlock = updateBlock
, bSweeps = 2
} | 414 | stBenchmarkParams = do
updateBlock <- [10, 100, 1000]
topics <- [20, 100, 500]
threads <- [1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26]
return STBenchmark { bNetParams = netParams {nTopics=topics}
, bThreads = threads
, bUpdateBlock = updateBlock
, bSweeps = 2
} | 379 | false | true | 0 | 11 | 160 | 138 | 83 | 55 | null | null |
atsukotakahashi/wi | src/library/Yi/Mode/Haskell.hs | gpl-2.0 | ghciInferType :: YiM ()
ghciInferType = do
nm <- withCurrentBuffer (readUnitB unitWord)
unless (R.null nm) $
withMinibufferGen (R.toText nm) noHint "Insert type of which identifier?"
return (const $ return ()) (ghciInferTypeOf . R.fromText) | 260 | ghciInferType :: YiM ()
ghciInferType = do
nm <- withCurrentBuffer (readUnitB unitWord)
unless (R.null nm) $
withMinibufferGen (R.toText nm) noHint "Insert type of which identifier?"
return (const $ return ()) (ghciInferTypeOf . R.fromText) | 260 | ghciInferType = do
nm <- withCurrentBuffer (readUnitB unitWord)
unless (R.null nm) $
withMinibufferGen (R.toText nm) noHint "Insert type of which identifier?"
return (const $ return ()) (ghciInferTypeOf . R.fromText) | 236 | false | true | 0 | 12 | 52 | 92 | 44 | 48 | null | null |
taylor1791/cis-194-spring | test/Test/Week12.hs | mit | week12 :: TestTree
week12 = testGroup "Monads"
[
exercise
] | 67 | week12 :: TestTree
week12 = testGroup "Monads"
[
exercise
] | 67 | week12 = testGroup "Monads"
[
exercise
] | 48 | false | true | 0 | 5 | 17 | 20 | 10 | 10 | null | null |
dcreager/cabal | Distribution/PackageDescription/Parse.hs | bsd-3-clause | ------------------------------------------------------------------------------
mapSimpleFields :: (Field -> ParseResult Field) -> [Field]
-> ParseResult [Field]
mapSimpleFields f fs = mapM walk fs
where
walk fld@(F _ _ _) = f fld
walk (IfBlock l c fs1 fs2) = do
fs1' <- mapM walk fs1
fs2' <- mapM walk fs2
return (IfBlock l c fs1' fs2')
walk (Section ln n l fs1) = do
fs1' <- mapM walk fs1
return (Section ln n l fs1')
-- prop_isMapM fs = mapSimpleFields return fs == return fs
-- names of fields that represents dependencies, thus consrca | 605 | mapSimpleFields :: (Field -> ParseResult Field) -> [Field]
-> ParseResult [Field]
mapSimpleFields f fs = mapM walk fs
where
walk fld@(F _ _ _) = f fld
walk (IfBlock l c fs1 fs2) = do
fs1' <- mapM walk fs1
fs2' <- mapM walk fs2
return (IfBlock l c fs1' fs2')
walk (Section ln n l fs1) = do
fs1' <- mapM walk fs1
return (Section ln n l fs1')
-- prop_isMapM fs = mapSimpleFields return fs == return fs
-- names of fields that represents dependencies, thus consrca | 524 | mapSimpleFields f fs = mapM walk fs
where
walk fld@(F _ _ _) = f fld
walk (IfBlock l c fs1 fs2) = do
fs1' <- mapM walk fs1
fs2' <- mapM walk fs2
return (IfBlock l c fs1' fs2')
walk (Section ln n l fs1) = do
fs1' <- mapM walk fs1
return (Section ln n l fs1')
-- prop_isMapM fs = mapSimpleFields return fs == return fs
-- names of fields that represents dependencies, thus consrca | 426 | true | true | 2 | 10 | 155 | 189 | 91 | 98 | null | null |
josuf107/xioqbot | src/Persist.hs | bsd-3-clause | writeLog :: FilePath -> UTCTime -> TwitchUser -> String -> IO ()
writeLog fp time user messageText = do
logHandle <- openFile ("logs/" ++ fp) AppendMode
hPutStrLn logHandle (show (time, user, messageText))
hClose logHandle | 234 | writeLog :: FilePath -> UTCTime -> TwitchUser -> String -> IO ()
writeLog fp time user messageText = do
logHandle <- openFile ("logs/" ++ fp) AppendMode
hPutStrLn logHandle (show (time, user, messageText))
hClose logHandle | 234 | writeLog fp time user messageText = do
logHandle <- openFile ("logs/" ++ fp) AppendMode
hPutStrLn logHandle (show (time, user, messageText))
hClose logHandle | 169 | false | true | 0 | 11 | 45 | 94 | 44 | 50 | null | null |
rudymatela/llcheck | src/Test/LeanCheck/Utils/Types.hs | bsd-3-clause | mkD :: Int -> D; mkD = D . (`mod` 6) | 39 | mkD :: Int -> D
mkD = D . (`mod` 6) | 37 | mkD = D . (`mod` 6) | 21 | false | true | 0 | 7 | 13 | 30 | 17 | 13 | null | null |
hvr/containers | Data/IntSet/Base.hs | bsd-3-clause | -- Suppose a is largest such that 2^a divides 2*m.
-- Then mask i m is i with the low a bits zeroed out.
mask :: Int -> Mask -> Prefix
mask i m
= maskW (natFromInt i) (natFromInt m) | 183 | mask :: Int -> Mask -> Prefix
mask i m
= maskW (natFromInt i) (natFromInt m) | 78 | mask i m
= maskW (natFromInt i) (natFromInt m) | 48 | true | true | 0 | 7 | 41 | 47 | 23 | 24 | null | null |
bitemyapp/checkers | src/Test/QuickCheck/Checkers.hs | bsd-3-clause | verbose' = quick' | 17 | verbose' = quick' | 17 | verbose' = quick' | 17 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
spechub/Hets | TPTP/Parser.hs | gpl-2.0 | -- <tff_quantified_formula> ::= <fof_quantifier> [<tff_variable_list>] :
-- <tff_unitary_formula>
tff_quantified_formula :: CharParser st TFF_quantified_formula
tff_quantified_formula = parserTrace "tff_quantified_formula" (do
q <- try fof_quantifier
vars <- brackets tff_variable_list
colonT
f <- tff_unitary_formula
return $ TFF_quantified_formula q vars f
<?> "tff_quantified_formula"
) | 440 | tff_quantified_formula :: CharParser st TFF_quantified_formula
tff_quantified_formula = parserTrace "tff_quantified_formula" (do
q <- try fof_quantifier
vars <- brackets tff_variable_list
colonT
f <- tff_unitary_formula
return $ TFF_quantified_formula q vars f
<?> "tff_quantified_formula"
) | 315 | tff_quantified_formula = parserTrace "tff_quantified_formula" (do
q <- try fof_quantifier
vars <- brackets tff_variable_list
colonT
f <- tff_unitary_formula
return $ TFF_quantified_formula q vars f
<?> "tff_quantified_formula"
) | 252 | true | true | 0 | 11 | 89 | 74 | 34 | 40 | null | null |
andorp/bead | src/Bead/View/BeadContext.hs | bsd-3-clause | -- Returns True, if the username pass the check otherwise False
checkUsername :: String -> BeadHandler' b Bool
checkUsername usr = withTop checkUsernameContext . snapContextHandlerCata $ \f -> liftIO (f usr) | 207 | checkUsername :: String -> BeadHandler' b Bool
checkUsername usr = withTop checkUsernameContext . snapContextHandlerCata $ \f -> liftIO (f usr) | 143 | checkUsername usr = withTop checkUsernameContext . snapContextHandlerCata $ \f -> liftIO (f usr) | 96 | true | true | 3 | 8 | 30 | 55 | 25 | 30 | null | null |
pdmurray/haskell-book-ex | src/ch11/Exercises11.14.hs | bsd-3-clause | convert6 Both = False | 21 | convert6 Both = False | 21 | convert6 Both = False | 21 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
ganeti/ganeti | test/hs/Test/Ganeti/Objects.hs | bsd-2-clause | prop_LogicalVolume_deserialisationFail :: Property
prop_LogicalVolume_deserialisationFail =
conjoin . map (testDeserialisationFail (LogicalVolume "" "")) $
[ J.JSArray []
, J.JSString $ J.toJSString "/abc"
, J.JSString $ J.toJSString "abc/"
, J.JSString $ J.toJSString "../."
, J.JSString $ J.toJSString "g/snapshot"
, J.JSString $ J.toJSString "g/a_mimagex"
, J.JSString $ J.toJSString "g/r;3"
] | 430 | prop_LogicalVolume_deserialisationFail :: Property
prop_LogicalVolume_deserialisationFail =
conjoin . map (testDeserialisationFail (LogicalVolume "" "")) $
[ J.JSArray []
, J.JSString $ J.toJSString "/abc"
, J.JSString $ J.toJSString "abc/"
, J.JSString $ J.toJSString "../."
, J.JSString $ J.toJSString "g/snapshot"
, J.JSString $ J.toJSString "g/a_mimagex"
, J.JSString $ J.toJSString "g/r;3"
] | 430 | prop_LogicalVolume_deserialisationFail =
conjoin . map (testDeserialisationFail (LogicalVolume "" "")) $
[ J.JSArray []
, J.JSString $ J.toJSString "/abc"
, J.JSString $ J.toJSString "abc/"
, J.JSString $ J.toJSString "../."
, J.JSString $ J.toJSString "g/snapshot"
, J.JSString $ J.toJSString "g/a_mimagex"
, J.JSString $ J.toJSString "g/r;3"
] | 379 | false | true | 0 | 11 | 80 | 130 | 65 | 65 | null | null |
fmapfmapfmap/amazonka | amazonka-dynamodb/gen/Network/AWS/DynamoDB/Types/Product.hs | mpl-2.0 | -- | Specifies how to perform the update. Valid values are 'PUT' (default),
-- 'DELETE', and 'ADD'. The behavior depends on whether the specified
-- primary key already exists in the table.
--
-- __If an item with the specified /Key/ is found in the table:__
--
-- - 'PUT' - Adds the specified attribute to the item. If the attribute
-- already exists, it is replaced by the new value.
--
-- - 'DELETE' - If no value is specified, the attribute and its value are
-- removed from the item. The data type of the specified value must
-- match the existing value\'s data type.
--
-- If a /set/ of values is specified, then those values are subtracted
-- from the old set. For example, if the attribute value was the set
-- '[a,b,c]' and the /DELETE/ action specified '[a,c]', then the final
-- attribute value would be '[b]'. Specifying an empty set is an error.
--
-- - 'ADD' - If the attribute does not already exist, then the attribute
-- and its values are added to the item. If the attribute does exist,
-- then the behavior of 'ADD' depends on the data type of the
-- attribute:
--
-- - If the existing attribute is a number, and if /Value/ is also a
-- number, then the /Value/ is mathematically added to the existing
-- attribute. If /Value/ is a negative number, then it is
-- subtracted from the existing attribute.
--
-- If you use 'ADD' to increment or decrement a number value for an
-- item that doesn\'t exist before the update, DynamoDB uses 0 as
-- the initial value.
--
-- In addition, if you use 'ADD' to update an existing item, and
-- intend to increment or decrement an attribute value which does
-- not yet exist, DynamoDB uses '0' as the initial value. For
-- example, suppose that the item you want to update does not yet
-- have an attribute named /itemcount/, but you decide to 'ADD' the
-- number '3' to this attribute anyway, even though it currently
-- does not exist. DynamoDB will create the /itemcount/ attribute,
-- set its initial value to '0', and finally add '3' to it. The
-- result will be a new /itemcount/ attribute in the item, with a
-- value of '3'.
--
-- - If the existing data type is a set, and if the /Value/ is also a
-- set, then the /Value/ is added to the existing set. (This is a
-- /set/ operation, not mathematical addition.) For example, if the
-- attribute value was the set '[1,2]', and the 'ADD' action
-- specified '[3]', then the final attribute value would be
-- '[1,2,3]'. An error occurs if an Add action is specified for a
-- set attribute and the attribute type specified does not match
-- the existing set type.
--
-- Both sets must have the same primitive data type. For example,
-- if the existing data type is a set of strings, the /Value/ must
-- also be a set of strings. The same holds true for number sets
-- and binary sets.
--
-- This action is only valid for an existing attribute whose data type
-- is number or is a set. Do not use 'ADD' for any other data types.
--
-- __If no item with the specified /Key/ is found:__
--
-- - 'PUT' - DynamoDB creates a new item with the specified primary key,
-- and then adds the attribute.
--
-- - 'DELETE' - Nothing happens; there is no attribute to delete.
--
-- - 'ADD' - DynamoDB creates an item with the supplied primary key and
-- number (or set of numbers) for the attribute value. The only data
-- types allowed are number and number set; no other data types can be
-- specified.
--
avuAction :: Lens' AttributeValueUpdate (Maybe AttributeAction)
avuAction = lens _avuAction (\ s a -> s{_avuAction = a}) | 3,828 | avuAction :: Lens' AttributeValueUpdate (Maybe AttributeAction)
avuAction = lens _avuAction (\ s a -> s{_avuAction = a}) | 120 | avuAction = lens _avuAction (\ s a -> s{_avuAction = a}) | 56 | true | true | 1 | 9 | 969 | 123 | 96 | 27 | null | null |
greydot/dns | Network/DNS/StateBinary.hs | bsd-3-clause | ----------------------------------------------------------------
getNBytes :: Int -> SGet [Int]
getNBytes len = toInts <$> getNByteString len
where
toInts = map fromIntegral . BS.unpack | 192 | getNBytes :: Int -> SGet [Int]
getNBytes len = toInts <$> getNByteString len
where
toInts = map fromIntegral . BS.unpack | 126 | getNBytes len = toInts <$> getNByteString len
where
toInts = map fromIntegral . BS.unpack | 95 | true | true | 1 | 8 | 27 | 57 | 25 | 32 | null | null |
lukexi/stack | src/main/Main.hs | bsd-3-clause | munlockFile :: MonadIO m => Maybe FileLock -> m ()
munlockFile Nothing = return () | 82 | munlockFile :: MonadIO m => Maybe FileLock -> m ()
munlockFile Nothing = return () | 82 | munlockFile Nothing = return () | 31 | false | true | 0 | 8 | 14 | 42 | 18 | 24 | null | null |
farrellm/advent | src/Day6.hs | mit | cmdFile :: GenParser Char st [Cmd]
cmdFile = endBy cmd eol | 58 | cmdFile :: GenParser Char st [Cmd]
cmdFile = endBy cmd eol | 58 | cmdFile = endBy cmd eol | 23 | false | true | 0 | 6 | 10 | 26 | 13 | 13 | null | null |
diku-dk/futhark | src/Language/Futhark/Prop.hs | isc | patIdents (PatConstr _ _ ps _) = mconcat $ map patIdents ps | 59 | patIdents (PatConstr _ _ ps _) = mconcat $ map patIdents ps | 59 | patIdents (PatConstr _ _ ps _) = mconcat $ map patIdents ps | 59 | false | false | 0 | 7 | 11 | 30 | 14 | 16 | null | null |
rueshyna/gogol | gogol-games/gen/Network/Google/Games/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'Application' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aThemeColor'
--
-- * 'aLeaderboardCount'
--
-- * 'aKind'
--
-- * 'aCategory'
--
-- * 'aName'
--
-- * 'aEnabledFeatures'
--
-- * 'aInstances'
--
-- * 'aAuthor'
--
-- * 'aId'
--
-- * 'aAchievementCount'
--
-- * 'aAssets'
--
-- * 'aDescription'
--
-- * 'aLastUpdatedTimestamp'
application
:: Application
application =
Application'
{ _aThemeColor = Nothing
, _aLeaderboardCount = Nothing
, _aKind = "games#application"
, _aCategory = Nothing
, _aName = Nothing
, _aEnabledFeatures = Nothing
, _aInstances = Nothing
, _aAuthor = Nothing
, _aId = Nothing
, _aAchievementCount = Nothing
, _aAssets = Nothing
, _aDescription = Nothing
, _aLastUpdatedTimestamp = Nothing
} | 899 | application
:: Application
application =
Application'
{ _aThemeColor = Nothing
, _aLeaderboardCount = Nothing
, _aKind = "games#application"
, _aCategory = Nothing
, _aName = Nothing
, _aEnabledFeatures = Nothing
, _aInstances = Nothing
, _aAuthor = Nothing
, _aId = Nothing
, _aAchievementCount = Nothing
, _aAssets = Nothing
, _aDescription = Nothing
, _aLastUpdatedTimestamp = Nothing
} | 453 | application =
Application'
{ _aThemeColor = Nothing
, _aLeaderboardCount = Nothing
, _aKind = "games#application"
, _aCategory = Nothing
, _aName = Nothing
, _aEnabledFeatures = Nothing
, _aInstances = Nothing
, _aAuthor = Nothing
, _aId = Nothing
, _aAchievementCount = Nothing
, _aAssets = Nothing
, _aDescription = Nothing
, _aLastUpdatedTimestamp = Nothing
} | 422 | true | true | 1 | 7 | 204 | 127 | 89 | 38 | null | null |
LeviSchuck/Goolosh | src/Goolosh/Geom/Transform.hs | mit | affineRotateRad :: TransformUnit
-> GM32
-> GM32
affineRotateRad rad m = tr !*! m
where
(cr, sr) = (cos rad, sin rad)
nsr = (-1) * sr
svx = _x %~ (_x .~ cr) . (_y .~ sr)
svy = _y %~ (_x .~ nsr) . (_y .~ cr )
tr = identity & svx . svy | 309 | affineRotateRad :: TransformUnit
-> GM32
-> GM32
affineRotateRad rad m = tr !*! m
where
(cr, sr) = (cos rad, sin rad)
nsr = (-1) * sr
svx = _x %~ (_x .~ cr) . (_y .~ sr)
svy = _y %~ (_x .~ nsr) . (_y .~ cr )
tr = identity & svx . svy | 309 | affineRotateRad rad m = tr !*! m
where
(cr, sr) = (cos rad, sin rad)
nsr = (-1) * sr
svx = _x %~ (_x .~ cr) . (_y .~ sr)
svy = _y %~ (_x .~ nsr) . (_y .~ cr )
tr = identity & svx . svy | 228 | false | true | 4 | 14 | 132 | 143 | 73 | 70 | null | null |
nushio3/formura | src/Formura/Parser.hs | mit | statementDelimiter :: P ()
statementDelimiter = "statement delimiter" ?> some d >> return ()
where
d = (symbolic ';' >> return ()) <|> (newline >> whiteSpace) | 164 | statementDelimiter :: P ()
statementDelimiter = "statement delimiter" ?> some d >> return ()
where
d = (symbolic ';' >> return ()) <|> (newline >> whiteSpace) | 164 | statementDelimiter = "statement delimiter" ?> some d >> return ()
where
d = (symbolic ';' >> return ()) <|> (newline >> whiteSpace) | 137 | false | true | 1 | 9 | 31 | 75 | 33 | 42 | null | null |
dblia/nosql-ganeti | src/Ganeti/Query/Language.hs | gpl-2.0 | traverseFlt f (GTFilter a fval) = GTFilter <$> f a <*> pure fval | 64 | traverseFlt f (GTFilter a fval) = GTFilter <$> f a <*> pure fval | 64 | traverseFlt f (GTFilter a fval) = GTFilter <$> f a <*> pure fval | 64 | false | false | 0 | 7 | 12 | 33 | 15 | 18 | null | null |
jprider63/simplessh-modified | src/Network/SSH/Client/SimpleSSH.hs | bsd-3-clause | -- | Helper which lifts IO actions into 'SimpleSSH'. This is used all over the place.
liftIOEither :: IO (Either SimpleSSHError a) -> SimpleSSH a
liftIOEither ioAction = do
eRes <- liftIO ioAction
case eRes of
Left err -> throwError err
Right res -> return res
-- | Helper which interprets a result coming from C.
--
-- Functions in the C part return pointers to a structure mimicking 'Either'. | 408 | liftIOEither :: IO (Either SimpleSSHError a) -> SimpleSSH a
liftIOEither ioAction = do
eRes <- liftIO ioAction
case eRes of
Left err -> throwError err
Right res -> return res
-- | Helper which interprets a result coming from C.
--
-- Functions in the C part return pointers to a structure mimicking 'Either'. | 322 | liftIOEither ioAction = do
eRes <- liftIO ioAction
case eRes of
Left err -> throwError err
Right res -> return res
-- | Helper which interprets a result coming from C.
--
-- Functions in the C part return pointers to a structure mimicking 'Either'. | 262 | true | true | 0 | 10 | 83 | 77 | 36 | 41 | null | null |
AlexeyRaga/eta | compiler/ETA/Main/HscTypes.hs | bsd-3-clause | getSafeMode :: IfaceTrustInfo -> SafeHaskellMode
getSafeMode (TrustInfo x) = x | 78 | getSafeMode :: IfaceTrustInfo -> SafeHaskellMode
getSafeMode (TrustInfo x) = x | 78 | getSafeMode (TrustInfo x) = x | 29 | false | true | 0 | 6 | 9 | 28 | 13 | 15 | null | null |
brendanhay/gogol | gogol-blogger/gen/Network/Google/Resource/Blogger/Comments/List.hs | mpl-2.0 | clStatus :: Lens' CommentsList (Maybe CommentsListStatus)
clStatus = lens _clStatus (\ s a -> s{_clStatus = a}) | 111 | clStatus :: Lens' CommentsList (Maybe CommentsListStatus)
clStatus = lens _clStatus (\ s a -> s{_clStatus = a}) | 111 | clStatus = lens _clStatus (\ s a -> s{_clStatus = a}) | 53 | false | true | 0 | 9 | 16 | 45 | 24 | 21 | null | null |
gnn/Hets | Comorphisms/KnownProvers.hs | gpl-2.0 | {- | a map of known prover names for a specific prover kind
to a list of simple (composed) comorphisms -}
knownProversWithKind :: ProverKind -> Result KnownProversMap
knownProversWithKind pk =
do isaCs <- isaComorphisms
spassCs <- spassComorphisms
qCs <- quickCheckComorphisms
return $ foldl insProvers Map.empty
$ idComorphisms ++ isaCs ++ spassCs ++ qCs
#ifdef CASLEXTENSIONS
++ [Comorphism cspCASLTrace]
#endif
where insProvers kpm cm =
case cm of
Comorphism cid ->
let prs = provers (targetLogic cid)
in foldl (\ m p -> if hasProverKind pk p
then Map.insertWith (flip (++))
(proverName p) [cm] m
else m) kpm prs | 848 | knownProversWithKind :: ProverKind -> Result KnownProversMap
knownProversWithKind pk =
do isaCs <- isaComorphisms
spassCs <- spassComorphisms
qCs <- quickCheckComorphisms
return $ foldl insProvers Map.empty
$ idComorphisms ++ isaCs ++ spassCs ++ qCs
#ifdef CASLEXTENSIONS
++ [Comorphism cspCASLTrace]
#endif
where insProvers kpm cm =
case cm of
Comorphism cid ->
let prs = provers (targetLogic cid)
in foldl (\ m p -> if hasProverKind pk p
then Map.insertWith (flip (++))
(proverName p) [cm] m
else m) kpm prs | 742 | knownProversWithKind pk =
do isaCs <- isaComorphisms
spassCs <- spassComorphisms
qCs <- quickCheckComorphisms
return $ foldl insProvers Map.empty
$ idComorphisms ++ isaCs ++ spassCs ++ qCs
#ifdef CASLEXTENSIONS
++ [Comorphism cspCASLTrace]
#endif
where insProvers kpm cm =
case cm of
Comorphism cid ->
let prs = provers (targetLogic cid)
in foldl (\ m p -> if hasProverKind pk p
then Map.insertWith (flip (++))
(proverName p) [cm] m
else m) kpm prs | 681 | true | true | 1 | 16 | 330 | 197 | 94 | 103 | null | null |
joelburget/daily-typecheckers | src/Day14.hs | bsd-3-clause | subTm :: Prism' Term Term
subTm = prism'
(\subTmm -> Term Abs (Map.singleton "subTm" (SubTerm subTmm)))
(\tm -> unSubTerm <$> Map.lookup "subTm" (subTerms tm)) | 163 | subTm :: Prism' Term Term
subTm = prism'
(\subTmm -> Term Abs (Map.singleton "subTm" (SubTerm subTmm)))
(\tm -> unSubTerm <$> Map.lookup "subTm" (subTerms tm)) | 163 | subTm = prism'
(\subTmm -> Term Abs (Map.singleton "subTm" (SubTerm subTmm)))
(\tm -> unSubTerm <$> Map.lookup "subTm" (subTerms tm)) | 137 | false | true | 0 | 11 | 27 | 82 | 39 | 43 | null | null |
henrytill/deviser | tests/Deviser/Parser/Tests.hs | bsd-3-clause | parseListOfSingleAtom :: Test
parseListOfSingleAtom =
Expect "Parse a list containing a single atom"
(==)
(Right (List [Atom "bang"]))
(readExpr "(bang)") | 183 | parseListOfSingleAtom :: Test
parseListOfSingleAtom =
Expect "Parse a list containing a single atom"
(==)
(Right (List [Atom "bang"]))
(readExpr "(bang)") | 183 | parseListOfSingleAtom =
Expect "Parse a list containing a single atom"
(==)
(Right (List [Atom "bang"]))
(readExpr "(bang)") | 153 | false | true | 0 | 11 | 48 | 46 | 24 | 22 | null | null |
tjakway/ghcjvm | compiler/prelude/PrelNames.hs | bsd-3-clause | eqString_RDR, unpackCString_RDR, unpackCStringFoldr_RDR,
unpackCStringUtf8_RDR :: RdrName
eqString_RDR = nameRdrName eqStringName | 144 | eqString_RDR, unpackCString_RDR, unpackCStringFoldr_RDR,
unpackCStringUtf8_RDR :: RdrName
eqString_RDR = nameRdrName eqStringName | 144 | eqString_RDR = nameRdrName eqStringName | 50 | false | true | 0 | 5 | 24 | 20 | 13 | 7 | null | null |
SKA-ScienceDataProcessor/RC | MS5/programs/facetting.hs | apache-2.0 | facetSum :: Flow Image -> Flow Image -> Flow Image
facetSum = flow "facet sum" | 78 | facetSum :: Flow Image -> Flow Image -> Flow Image
facetSum = flow "facet sum" | 78 | facetSum = flow "facet sum" | 27 | false | true | 0 | 7 | 14 | 31 | 14 | 17 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/streaming/pipes/src/FunctorOriented.hs | unlicense | mno (O (Y n)) = O (Z n) | 23 | mno (O (Y n)) = O (Z n) | 23 | mno (O (Y n)) = O (Z n) | 23 | false | false | 0 | 8 | 7 | 31 | 14 | 17 | null | null |
rueshyna/gogol | gogol-monitoring/gen/Network/Google/Monitoring/Types/Product.hs | mpl-2.0 | -- | A Boolean value: true or false.
tvBoolValue :: Lens' TypedValue (Maybe Bool)
tvBoolValue
= lens _tvBoolValue (\ s a -> s{_tvBoolValue = a}) | 146 | tvBoolValue :: Lens' TypedValue (Maybe Bool)
tvBoolValue
= lens _tvBoolValue (\ s a -> s{_tvBoolValue = a}) | 109 | tvBoolValue
= lens _tvBoolValue (\ s a -> s{_tvBoolValue = a}) | 64 | true | true | 1 | 9 | 26 | 52 | 25 | 27 | null | null |
mcschroeder/ghc | compiler/basicTypes/RdrName.hs | bsd-3-clause | isRdrTc rn = isTcOcc (rdrNameOcc rn) | 43 | isRdrTc rn = isTcOcc (rdrNameOcc rn) | 43 | isRdrTc rn = isTcOcc (rdrNameOcc rn) | 43 | false | false | 0 | 7 | 12 | 18 | 8 | 10 | null | null |
tolysz/yesod | yesod-core/Yesod/Core/Handler.hs | mit | -- | Same as 'setSession', but uses binary data for the value.
setSessionBS :: MonadHandler m
=> Text
-> S.ByteString
-> m ()
setSessionBS k = modify . modSession . Map.insert k | 216 | setSessionBS :: MonadHandler m
=> Text
-> S.ByteString
-> m ()
setSessionBS k = modify . modSession . Map.insert k | 153 | setSessionBS k = modify . modSession . Map.insert k | 51 | true | true | 0 | 9 | 70 | 50 | 24 | 26 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/WindowOrWorkerGlobalScope.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope.setInterval Mozilla WindowOrWorkerGlobalScope.setInterval documentation>
setInterval_ ::
(MonadDOM m, IsWindowOrWorkerGlobalScope self, ToJSVal handler) =>
self -> handler -> Maybe Int -> m ()
setInterval_ self handler timeout
= liftDOM
(void
((toWindowOrWorkerGlobalScope self) ^. jsf "setInterval"
[toJSVal handler, toJSVal timeout])) | 475 | setInterval_ ::
(MonadDOM m, IsWindowOrWorkerGlobalScope self, ToJSVal handler) =>
self -> handler -> Maybe Int -> m ()
setInterval_ self handler timeout
= liftDOM
(void
((toWindowOrWorkerGlobalScope self) ^. jsf "setInterval"
[toJSVal handler, toJSVal timeout])) | 320 | setInterval_ self handler timeout
= liftDOM
(void
((toWindowOrWorkerGlobalScope self) ^. jsf "setInterval"
[toJSVal handler, toJSVal timeout])) | 172 | true | true | 0 | 11 | 97 | 99 | 49 | 50 | null | null |
zachsully/hakaru | haskell/Language/Hakaru/CodeGen/CodeGenMonad.hs | bsd-3-clause | extDeclareTypes (SFun x y) = extDeclareTypes x >> extDeclareTypes y | 70 | extDeclareTypes (SFun x y) = extDeclareTypes x >> extDeclareTypes y | 70 | extDeclareTypes (SFun x y) = extDeclareTypes x >> extDeclareTypes y | 70 | false | false | 0 | 6 | 12 | 28 | 12 | 16 | null | null |
wxwxwwxxx/ghc | testsuite/tests/perf/compiler/T9233a.hs | bsd-3-clause | splitComma :: String -> String
splitComma _ = "a" | 49 | splitComma :: String -> String
splitComma _ = "a" | 49 | splitComma _ = "a" | 18 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
abakst/symmetry | checker/tests/pos/TestLookup00.hs | mit | m1 :: DSL repr => repr Int -> repr (Int :+: ())
m1 = inl | 58 | m1 :: DSL repr => repr Int -> repr (Int :+: ())
m1 = inl | 56 | m1 = inl | 8 | false | true | 0 | 11 | 16 | 43 | 19 | 24 | null | null |
haskell-lang/haskell-lang | src/HL/View/Community.hs | bsd-3-clause | hackathons :: View App ()
hackathons =
do li_ (a_ [href_ "http://bayhac.org/"] "BayHac (Bay Area, USA)")
li_ (a_ [href_ "https://wiki.haskell.org/Hac_Phi"] "Hac Phi (Philadelphia, PA, USA)")
li_ (a_ [href_ "https://wiki.haskell.org/ZuriHac"] "ZuriHac (Zurich, CH)") | 277 | hackathons :: View App ()
hackathons =
do li_ (a_ [href_ "http://bayhac.org/"] "BayHac (Bay Area, USA)")
li_ (a_ [href_ "https://wiki.haskell.org/Hac_Phi"] "Hac Phi (Philadelphia, PA, USA)")
li_ (a_ [href_ "https://wiki.haskell.org/ZuriHac"] "ZuriHac (Zurich, CH)") | 277 | hackathons =
do li_ (a_ [href_ "http://bayhac.org/"] "BayHac (Bay Area, USA)")
li_ (a_ [href_ "https://wiki.haskell.org/Hac_Phi"] "Hac Phi (Philadelphia, PA, USA)")
li_ (a_ [href_ "https://wiki.haskell.org/ZuriHac"] "ZuriHac (Zurich, CH)") | 251 | false | true | 0 | 11 | 43 | 78 | 36 | 42 | null | null |
avieth/diplomacy | Diplomacy/Province.hs | bsd-3-clause | adjacency AegeanSea = [Greece, Bulgaria, Constantinople, Smyrna, EasternMediterranean, IonianSea] | 97 | adjacency AegeanSea = [Greece, Bulgaria, Constantinople, Smyrna, EasternMediterranean, IonianSea] | 97 | adjacency AegeanSea = [Greece, Bulgaria, Constantinople, Smyrna, EasternMediterranean, IonianSea] | 97 | false | false | 0 | 5 | 8 | 27 | 16 | 11 | null | null |
tkawachi/photoname | src/Photoname/Exif.hs | bsd-3-clause | getDate :: (MonadError String m, MonadIO m) => FilePath -> m String
getDate = loadExif >=> getOneOf dateTagNames
where
loadExif = (liftIO . safeExif) >=>
maybe (throwError "Failed EXIF loading") return
getOneOf [] _ = throwError "has no EXIF date"
getOneOf (tagName:tagNames) exif =
maybe (getOneOf tagNames exif) return =<<
liftIO (getTag exif tagName)
dateTagNames =
["DateTimeDigitized", "DateTimeOriginal", "DateTime"] | 499 | getDate :: (MonadError String m, MonadIO m) => FilePath -> m String
getDate = loadExif >=> getOneOf dateTagNames
where
loadExif = (liftIO . safeExif) >=>
maybe (throwError "Failed EXIF loading") return
getOneOf [] _ = throwError "has no EXIF date"
getOneOf (tagName:tagNames) exif =
maybe (getOneOf tagNames exif) return =<<
liftIO (getTag exif tagName)
dateTagNames =
["DateTimeDigitized", "DateTimeOriginal", "DateTime"] | 499 | getDate = loadExif >=> getOneOf dateTagNames
where
loadExif = (liftIO . safeExif) >=>
maybe (throwError "Failed EXIF loading") return
getOneOf [] _ = throwError "has no EXIF date"
getOneOf (tagName:tagNames) exif =
maybe (getOneOf tagNames exif) return =<<
liftIO (getTag exif tagName)
dateTagNames =
["DateTimeDigitized", "DateTimeOriginal", "DateTime"] | 431 | false | true | 3 | 9 | 135 | 145 | 74 | 71 | null | null |
ackao/APRICoT | web/conference-management-system/test/Handler/FinalDecisionSpec.hs | gpl-3.0 | spec :: Spec
spec = withApp $ do
describe "postFinalDecisionR" $ do
error "Spec not implemented: postFinalDecisionR" | 129 | spec :: Spec
spec = withApp $ do
describe "postFinalDecisionR" $ do
error "Spec not implemented: postFinalDecisionR" | 129 | spec = withApp $ do
describe "postFinalDecisionR" $ do
error "Spec not implemented: postFinalDecisionR" | 116 | false | true | 0 | 11 | 29 | 31 | 14 | 17 | null | null |
apyrgio/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | luxiReqCancelJob :: String
luxiReqCancelJob = "CancelJob" | 57 | luxiReqCancelJob :: String
luxiReqCancelJob = "CancelJob" | 57 | luxiReqCancelJob = "CancelJob" | 30 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
sordina/Edn | Main.hs | mit | errors :: IO ()
errors = hPutStrLn stderr "Error parsing edn input"
>> exitFailure | 88 | errors :: IO ()
errors = hPutStrLn stderr "Error parsing edn input"
>> exitFailure | 88 | errors = hPutStrLn stderr "Error parsing edn input"
>> exitFailure | 72 | false | true | 0 | 6 | 19 | 25 | 12 | 13 | null | null |
upsoft/bond | compiler/Main.hs | mit | concurrentlyFor_ :: [a] -> (a -> IO b) -> IO ()
concurrentlyFor_ = (void .) . flip mapConcurrently | 98 | concurrentlyFor_ :: [a] -> (a -> IO b) -> IO ()
concurrentlyFor_ = (void .) . flip mapConcurrently | 98 | concurrentlyFor_ = (void .) . flip mapConcurrently | 50 | false | true | 0 | 9 | 17 | 48 | 25 | 23 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.