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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
denisshevchenko/circlehs | src/Network/CircleCI/Environment.hs | mit | deleteEnvVar :: ProjectPoint -- ^ Names of GitHub user/project.
-> EnvVarName -- ^ Environment variable name.
-> CircleCIResponse EnvVarDeleted -- ^ Info about environment variable deleting.
deleteEnvVar project envVarName = do
AccountAPIToken token <- ask
liftIO . runExceptT $ do
manager <- httpsManager
servantDeleteEnvVar (userName project)
(projectName project)
envVarName
(Just token)
manager
apiBaseUrl
-- | Environment variable, name/value. | 677 | deleteEnvVar :: ProjectPoint -- ^ Names of GitHub user/project.
-> EnvVarName -- ^ Environment variable name.
-> CircleCIResponse EnvVarDeleted
deleteEnvVar project envVarName = do
AccountAPIToken token <- ask
liftIO . runExceptT $ do
manager <- httpsManager
servantDeleteEnvVar (userName project)
(projectName project)
envVarName
(Just token)
manager
apiBaseUrl
-- | Environment variable, name/value. | 630 | deleteEnvVar project envVarName = do
AccountAPIToken token <- ask
liftIO . runExceptT $ do
manager <- httpsManager
servantDeleteEnvVar (userName project)
(projectName project)
envVarName
(Just token)
manager
apiBaseUrl
-- | Environment variable, name/value. | 422 | true | true | 0 | 13 | 286 | 98 | 46 | 52 | null | null |
creswick/dbmigrations | src/Moo/CommandUtils.hs | bsd-3-clause | interactiveAskDeps' :: StoreData -> [String] -> IO [String]
interactiveAskDeps' _ [] = return [] | 96 | interactiveAskDeps' :: StoreData -> [String] -> IO [String]
interactiveAskDeps' _ [] = return [] | 96 | interactiveAskDeps' _ [] = return [] | 36 | false | true | 0 | 8 | 13 | 40 | 20 | 20 | null | null |
bos/statistics | dense-linear-algebra/src/Statistics/Matrix.hs | bsd-2-clause | ident :: Int -> Matrix
ident n = diag $ U.replicate n 1.0 | 57 | ident :: Int -> Matrix
ident n = diag $ U.replicate n 1.0 | 57 | ident n = diag $ U.replicate n 1.0 | 34 | false | true | 2 | 7 | 12 | 37 | 15 | 22 | null | null |
phaul/chess | Chess/Search/Search.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- | Aborts the search
abortable :: Search (Maybe a) -> Search (Maybe a)
abortable f = do
abortedtv <- use aborted
abort <- liftIO $ readTVarIO abortedtv
if abort then return Nothing else f
------------------------------------------------------------------------------
-- | Is the search running in pondering mode
--
-- Note, that the interface can asynchronously transition a pondering search
-- to normal search on ponderhit. | 518 | abortable :: Search (Maybe a) -> Search (Maybe a)
abortable f = do
abortedtv <- use aborted
abort <- liftIO $ readTVarIO abortedtv
if abort then return Nothing else f
------------------------------------------------------------------------------
-- | Is the search running in pondering mode
--
-- Note, that the interface can asynchronously transition a pondering search
-- to normal search on ponderhit. | 416 | abortable f = do
abortedtv <- use aborted
abort <- liftIO $ readTVarIO abortedtv
if abort then return Nothing else f
------------------------------------------------------------------------------
-- | Is the search running in pondering mode
--
-- Note, that the interface can asynchronously transition a pondering search
-- to normal search on ponderhit. | 366 | true | true | 0 | 9 | 75 | 86 | 42 | 44 | null | null |
GaloisInc/halvm-ghc | libraries/template-haskell/Language/Haskell/TH/Ppr.hs | bsd-3-clause | ppr_dec _ (ClassD ctxt c xs fds ds)
= text "class" <+> pprCxt ctxt <+> ppr c <+> hsep (map ppr xs) <+> ppr fds
$$ where_clause ds | 136 | ppr_dec _ (ClassD ctxt c xs fds ds)
= text "class" <+> pprCxt ctxt <+> ppr c <+> hsep (map ppr xs) <+> ppr fds
$$ where_clause ds | 136 | ppr_dec _ (ClassD ctxt c xs fds ds)
= text "class" <+> pprCxt ctxt <+> ppr c <+> hsep (map ppr xs) <+> ppr fds
$$ where_clause ds | 136 | false | false | 5 | 9 | 34 | 76 | 32 | 44 | null | null |
leepike/SmartCheck | src/Test/SmartCheck/Extrapolate.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- | Test d with arbitrary values replacing its children. For anything we get
-- 100% failure for, we claim we can generalize it---any term in that hole
-- fails.
--
-- We extrapolate if there exists at least one test that satisfies the
-- precondition, and for all tests that satisfy the precondition, they fail.
-- We extrapolate w.r.t. the original property since extrapolation throws away
-- any values that fail the precondition of the property (i.e., before the
-- Q.==>).
extrapolate :: SubTypes a
=> ScArgs -- ^ Arguments
-> a -- ^ Current failed value
-> (a -> Q.Property) -- ^ Original property
-> IO ([Idx])
extrapolate args d origProp = do
putStrLn ""
smartPrtLn "Extrapolating values ..."
(_, idxs) <- iter' forest (Idx 0 0) []
return idxs
where
forest = mkSubstForest d True
iter' = iter d test next origProp (scMaxDepth args)
-- In this call to iterateArb, we want to claim we can extrapolate iff at
-- least one test passes a precondition, and for every test in which the
-- precondition is passed, it fails. We test values of all possible sizes, up
-- to Q.maxSize.
test _ idx = iterateArbIdx d (idx, scMaxDepth args) (scMaxForall args)
(scMaxSize args) origProp
-- Control-flow.
-- None of the tries satisfy prop (but something passed the precondition).
-- Prevent recurring down this tree, since we can generalize.
next _ (i, FailedProp) forest' idx idxs
| scMinForall args < i =
nextIter (forestReplaceChildren forest' idx False) idx (idx : idxs)
next _ _ forest' idx idxs = nextIter forest' idx idxs
nextIter f idx = iter' f idx { column = column idx + 1 }
-------------------------------------------------------------------------------- | 1,890 | extrapolate :: SubTypes a
=> ScArgs -- ^ Arguments
-> a -- ^ Current failed value
-> (a -> Q.Property) -- ^ Original property
-> IO ([Idx])
extrapolate args d origProp = do
putStrLn ""
smartPrtLn "Extrapolating values ..."
(_, idxs) <- iter' forest (Idx 0 0) []
return idxs
where
forest = mkSubstForest d True
iter' = iter d test next origProp (scMaxDepth args)
-- In this call to iterateArb, we want to claim we can extrapolate iff at
-- least one test passes a precondition, and for every test in which the
-- precondition is passed, it fails. We test values of all possible sizes, up
-- to Q.maxSize.
test _ idx = iterateArbIdx d (idx, scMaxDepth args) (scMaxForall args)
(scMaxSize args) origProp
-- Control-flow.
-- None of the tries satisfy prop (but something passed the precondition).
-- Prevent recurring down this tree, since we can generalize.
next _ (i, FailedProp) forest' idx idxs
| scMinForall args < i =
nextIter (forestReplaceChildren forest' idx False) idx (idx : idxs)
next _ _ forest' idx idxs = nextIter forest' idx idxs
nextIter f idx = iter' f idx { column = column idx + 1 }
-------------------------------------------------------------------------------- | 1,327 | extrapolate args d origProp = do
putStrLn ""
smartPrtLn "Extrapolating values ..."
(_, idxs) <- iter' forest (Idx 0 0) []
return idxs
where
forest = mkSubstForest d True
iter' = iter d test next origProp (scMaxDepth args)
-- In this call to iterateArb, we want to claim we can extrapolate iff at
-- least one test passes a precondition, and for every test in which the
-- precondition is passed, it fails. We test values of all possible sizes, up
-- to Q.maxSize.
test _ idx = iterateArbIdx d (idx, scMaxDepth args) (scMaxForall args)
(scMaxSize args) origProp
-- Control-flow.
-- None of the tries satisfy prop (but something passed the precondition).
-- Prevent recurring down this tree, since we can generalize.
next _ (i, FailedProp) forest' idx idxs
| scMinForall args < i =
nextIter (forestReplaceChildren forest' idx False) idx (idx : idxs)
next _ _ forest' idx idxs = nextIter forest' idx idxs
nextIter f idx = iter' f idx { column = column idx + 1 }
-------------------------------------------------------------------------------- | 1,112 | true | true | 0 | 11 | 431 | 313 | 163 | 150 | null | null |
urbanslug/ghc | compiler/coreSyn/TrieMap.hs | bsd-3-clause | xtFreeVar :: Var -> XT a -> VarEnv a -> VarEnv a
xtFreeVar v f m = alterVarEnv f m v | 84 | xtFreeVar :: Var -> XT a -> VarEnv a -> VarEnv a
xtFreeVar v f m = alterVarEnv f m v | 84 | xtFreeVar v f m = alterVarEnv f m v | 35 | false | true | 0 | 9 | 20 | 50 | 22 | 28 | null | null |
andorp/bead | src/Bead/View/Pagelets.hs | bsd-3-clause | link :: String -> String -> Html
link r t = H.a ! A.href (fromString r) $ (fromString t) | 88 | link :: String -> String -> Html
link r t = H.a ! A.href (fromString r) $ (fromString t) | 88 | link r t = H.a ! A.href (fromString r) $ (fromString t) | 55 | false | true | 0 | 9 | 18 | 51 | 25 | 26 | null | null |
grandpascorpion/canon | Math/NumberTheory/Canon.hs | gpl-3.0 | cPrimeTowerLevel c@(HX h l@(b:xl) _) | h < cExpOpLevel || any cHyperExprAny l || not (cPrime b)
= c0 -- ToDo: handle nested hyper expression cases properly
| h == cExpOpLevel = if cQuasiCanonized c && cMaxHyperOp c > cExpOpLevel
then (cPrimeTowerLevel $ cHyperize c)
else (makeCanon $ toInteger $ length l)
| h == cTetrOpLevel = simpleHX h xl
| cMaxHyperOpForQC c <= maxHyperOpDelveLevel
= cDelve (cQuasiCanonize c) [1,1] -- gets the tetration expression
| otherwise = c | 860 | cPrimeTowerLevel c@(HX h l@(b:xl) _) | h < cExpOpLevel || any cHyperExprAny l || not (cPrime b)
= c0 -- ToDo: handle nested hyper expression cases properly
| h == cExpOpLevel = if cQuasiCanonized c && cMaxHyperOp c > cExpOpLevel
then (cPrimeTowerLevel $ cHyperize c)
else (makeCanon $ toInteger $ length l)
| h == cTetrOpLevel = simpleHX h xl
| cMaxHyperOpForQC c <= maxHyperOpDelveLevel
= cDelve (cQuasiCanonize c) [1,1] -- gets the tetration expression
| otherwise = c | 860 | cPrimeTowerLevel c@(HX h l@(b:xl) _) | h < cExpOpLevel || any cHyperExprAny l || not (cPrime b)
= c0 -- ToDo: handle nested hyper expression cases properly
| h == cExpOpLevel = if cQuasiCanonized c && cMaxHyperOp c > cExpOpLevel
then (cPrimeTowerLevel $ cHyperize c)
else (makeCanon $ toInteger $ length l)
| h == cTetrOpLevel = simpleHX h xl
| cMaxHyperOpForQC c <= maxHyperOpDelveLevel
= cDelve (cQuasiCanonize c) [1,1] -- gets the tetration expression
| otherwise = c | 860 | false | false | 0 | 11 | 468 | 185 | 90 | 95 | null | null |
adbrowne/dynamodb-eventstore | dynamodb-eventstore/src/DynamoDbEventStore/GlobalFeedWriter.hs | mit | collectAncestors
:: (MonadEsDsl m, MonadError EventStoreActionError m) =>
StreamId ->
m ToBePaged
collectAncestors streamId =
let
streamFromEventBack = streamEntryProducer QueryDirectionBackward streamId Nothing 10
in do
lastVerifiedPage <- getLastVerifiedPage
events <- P.toListM $
streamFromEventBack
>-> P.takeWhile streamEntryNeedsPaging
>-> P.map streamEntryToFeedEntry
return $ ToBePaged events lastVerifiedPage | 495 | collectAncestors
:: (MonadEsDsl m, MonadError EventStoreActionError m) =>
StreamId ->
m ToBePaged
collectAncestors streamId =
let
streamFromEventBack = streamEntryProducer QueryDirectionBackward streamId Nothing 10
in do
lastVerifiedPage <- getLastVerifiedPage
events <- P.toListM $
streamFromEventBack
>-> P.takeWhile streamEntryNeedsPaging
>-> P.map streamEntryToFeedEntry
return $ ToBePaged events lastVerifiedPage | 495 | collectAncestors streamId =
let
streamFromEventBack = streamEntryProducer QueryDirectionBackward streamId Nothing 10
in do
lastVerifiedPage <- getLastVerifiedPage
events <- P.toListM $
streamFromEventBack
>-> P.takeWhile streamEntryNeedsPaging
>-> P.map streamEntryToFeedEntry
return $ ToBePaged events lastVerifiedPage | 391 | false | true | 0 | 14 | 121 | 112 | 51 | 61 | null | null |
ghcjs/ghcjs | lib/ghc/includes/GHCConstantsHaskellWrappers.hs | mit | sIZEOF_CostCentreStack :: DynFlags -> Int
sIZEOF_CostCentreStack dflags = pc_SIZEOF_CostCentreStack (sPlatformConstants (settings dflags)) | 138 | sIZEOF_CostCentreStack :: DynFlags -> Int
sIZEOF_CostCentreStack dflags = pc_SIZEOF_CostCentreStack (sPlatformConstants (settings dflags)) | 138 | sIZEOF_CostCentreStack dflags = pc_SIZEOF_CostCentreStack (sPlatformConstants (settings dflags)) | 96 | false | true | 0 | 9 | 11 | 36 | 17 | 19 | null | null |
kim/amazonka | amazonka-elasticache/gen/Network/AWS/ElastiCache/CreateSnapshot.hs | mpl-2.0 | -- | The identifier of an existing cache cluster. The snapshot will be created
-- from this cache cluster.
csCacheClusterId :: Lens' CreateSnapshot Text
csCacheClusterId = lens _csCacheClusterId (\s a -> s { _csCacheClusterId = a }) | 232 | csCacheClusterId :: Lens' CreateSnapshot Text
csCacheClusterId = lens _csCacheClusterId (\s a -> s { _csCacheClusterId = a }) | 125 | csCacheClusterId = lens _csCacheClusterId (\s a -> s { _csCacheClusterId = a }) | 79 | true | true | 0 | 9 | 36 | 41 | 23 | 18 | null | null |
rueshyna/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/AdvertiserGroups/Update.hs | mpl-2.0 | -- | Multipart request metadata.
aguPayload :: Lens' AdvertiserGroupsUpdate AdvertiserGroup
aguPayload
= lens _aguPayload (\ s a -> s{_aguPayload = a}) | 153 | aguPayload :: Lens' AdvertiserGroupsUpdate AdvertiserGroup
aguPayload
= lens _aguPayload (\ s a -> s{_aguPayload = a}) | 120 | aguPayload
= lens _aguPayload (\ s a -> s{_aguPayload = a}) | 61 | true | true | 1 | 9 | 22 | 46 | 22 | 24 | null | null |
keithodulaigh/Hets | THF/ParseTHF.hs | gpl-2.0 | thfTypedConst :: CharParser st THFTypedConst -- added this for thf0
thfTypedConst = fmap T0TC_THF_TypedConst_Par (parentheses thfTypedConst)
<|> do
c <- try (constant << colon)
tlt <- thfTopLevelType
return $ T0TC_Typed_Const c tlt | 245 | thfTypedConst :: CharParser st THFTypedConst
thfTypedConst = fmap T0TC_THF_TypedConst_Par (parentheses thfTypedConst)
<|> do
c <- try (constant << colon)
tlt <- thfTopLevelType
return $ T0TC_Typed_Const c tlt | 222 | thfTypedConst = fmap T0TC_THF_TypedConst_Par (parentheses thfTypedConst)
<|> do
c <- try (constant << colon)
tlt <- thfTopLevelType
return $ T0TC_Typed_Const c tlt | 177 | true | true | 3 | 11 | 45 | 78 | 35 | 43 | null | null |
siddhanathan/ghc | compiler/deSugar/DsBinds.hs | bsd-3-clause | dsHsWrapper (WpCast co) e = ASSERT(tcCoercionRole co == Representational)
dsTcCoercion co (mkCastDs e) | 142 | dsHsWrapper (WpCast co) e = ASSERT(tcCoercionRole co == Representational)
dsTcCoercion co (mkCastDs e) | 142 | dsHsWrapper (WpCast co) e = ASSERT(tcCoercionRole co == Representational)
dsTcCoercion co (mkCastDs e) | 142 | false | false | 1 | 8 | 52 | 44 | 20 | 24 | null | null |
thalerjonathan/phd | thesis/code/sugarscape/src/SugarScape/Core/Utils.hs | gpl-3.0 | flipBoolAtIdx :: Int -> [Bool] -> [Bool]
flipBoolAtIdx idx bs = front ++ (flippedElem : backNoElem)
where
(front, back) = splitAt idx bs -- NOTE: back includes the element with the index
elemAtIdx = bs !! idx
flippedElem = not elemAtIdx
backNoElem = tail back | 287 | flipBoolAtIdx :: Int -> [Bool] -> [Bool]
flipBoolAtIdx idx bs = front ++ (flippedElem : backNoElem)
where
(front, back) = splitAt idx bs -- NOTE: back includes the element with the index
elemAtIdx = bs !! idx
flippedElem = not elemAtIdx
backNoElem = tail back | 287 | flipBoolAtIdx idx bs = front ++ (flippedElem : backNoElem)
where
(front, back) = splitAt idx bs -- NOTE: back includes the element with the index
elemAtIdx = bs !! idx
flippedElem = not elemAtIdx
backNoElem = tail back | 246 | false | true | 0 | 7 | 72 | 91 | 47 | 44 | null | null |
ublubu/tile-rider | src/TileRider/Grid.hs | mit | gridRow :: GridZipper a -> IndexedZipper a
gridRow z = cursor (snd z) | 69 | gridRow :: GridZipper a -> IndexedZipper a
gridRow z = cursor (snd z) | 69 | gridRow z = cursor (snd z) | 26 | false | true | 0 | 7 | 12 | 33 | 15 | 18 | null | null |
pawel-n/tuple-morph | Data/Tuple/Morph/TH.hs | mit | -- | Creates a HUnfoldable instance for @k@ element tuples.
mkHUnfoldableInst :: Int -> Q Dec
mkHUnfoldableInst k = return $ mkInst (mkName "HUnfoldable") k $ \names ->
let hListParserName = mkName "hListParser"
repName = mkName "Rep"
bindMIName = mkName "bindMI"
returnMIName = mkName "returnMI"
-- Proxy :: Proxy (Rep z)
proxy = SigE (ConE 'Proxy)
(AppT (ConT ''Proxy)
(AppT (ConT repName)
(VarT $ last names)))
-- appendRightId proxy
theorem = AppE (VarE 'appendRightId) proxy
-- bindMI hListParser (\a ->
-- bindMI hListParser (\b ->
-- ...
-- returnMI (a, b, c, ...))...)
bindE n e = AppE (AppE (VarE bindMIName)
(VarE hListParserName))
(LamE [VarP n] e)
returnE = (AppE (VarE returnMIName) (TupE (map VarE names)))
matchBody = NormalB $ foldr bindE returnE names
-- case theorem of Refl -> ???
body = NormalB $ CaseE theorem [Match (ConP 'Refl []) matchBody []]
hListParser = FunD hListParserName [Clause [] body []]
in [hListParser] | 1,225 | mkHUnfoldableInst :: Int -> Q Dec
mkHUnfoldableInst k = return $ mkInst (mkName "HUnfoldable") k $ \names ->
let hListParserName = mkName "hListParser"
repName = mkName "Rep"
bindMIName = mkName "bindMI"
returnMIName = mkName "returnMI"
-- Proxy :: Proxy (Rep z)
proxy = SigE (ConE 'Proxy)
(AppT (ConT ''Proxy)
(AppT (ConT repName)
(VarT $ last names)))
-- appendRightId proxy
theorem = AppE (VarE 'appendRightId) proxy
-- bindMI hListParser (\a ->
-- bindMI hListParser (\b ->
-- ...
-- returnMI (a, b, c, ...))...)
bindE n e = AppE (AppE (VarE bindMIName)
(VarE hListParserName))
(LamE [VarP n] e)
returnE = (AppE (VarE returnMIName) (TupE (map VarE names)))
matchBody = NormalB $ foldr bindE returnE names
-- case theorem of Refl -> ???
body = NormalB $ CaseE theorem [Match (ConP 'Refl []) matchBody []]
hListParser = FunD hListParserName [Clause [] body []]
in [hListParser] | 1,165 | mkHUnfoldableInst k = return $ mkInst (mkName "HUnfoldable") k $ \names ->
let hListParserName = mkName "hListParser"
repName = mkName "Rep"
bindMIName = mkName "bindMI"
returnMIName = mkName "returnMI"
-- Proxy :: Proxy (Rep z)
proxy = SigE (ConE 'Proxy)
(AppT (ConT ''Proxy)
(AppT (ConT repName)
(VarT $ last names)))
-- appendRightId proxy
theorem = AppE (VarE 'appendRightId) proxy
-- bindMI hListParser (\a ->
-- bindMI hListParser (\b ->
-- ...
-- returnMI (a, b, c, ...))...)
bindE n e = AppE (AppE (VarE bindMIName)
(VarE hListParserName))
(LamE [VarP n] e)
returnE = (AppE (VarE returnMIName) (TupE (map VarE names)))
matchBody = NormalB $ foldr bindE returnE names
-- case theorem of Refl -> ???
body = NormalB $ CaseE theorem [Match (ConP 'Refl []) matchBody []]
hListParser = FunD hListParserName [Clause [] body []]
in [hListParser] | 1,131 | true | true | 0 | 18 | 438 | 332 | 169 | 163 | null | null |
Denommus/stack | src/Stack/Build/Haddock.hs | bsd-3-clause | -- | Path of snapshot packages documentation directory.
snapDocDir :: BaseConfigOpts -> Path Abs Dir
snapDocDir bco = bcoSnapInstallRoot bco </> docDirSuffix | 157 | snapDocDir :: BaseConfigOpts -> Path Abs Dir
snapDocDir bco = bcoSnapInstallRoot bco </> docDirSuffix | 101 | snapDocDir bco = bcoSnapInstallRoot bco </> docDirSuffix | 56 | true | true | 0 | 6 | 21 | 31 | 15 | 16 | null | null |
laugh-at-me/recurrence | src/Proofs.hs | gpl-3.0 | normalize n k t = foldl' (\a i -> foldl' (\b j -> succsum' (ksize j i) b) a [0..(4*k-1)]) t [2*k..2*n-1] | 104 | normalize n k t = foldl' (\a i -> foldl' (\b j -> succsum' (ksize j i) b) a [0..(4*k-1)]) t [2*k..2*n-1] | 104 | normalize n k t = foldl' (\a i -> foldl' (\b j -> succsum' (ksize j i) b) a [0..(4*k-1)]) t [2*k..2*n-1] | 104 | false | false | 1 | 13 | 21 | 99 | 48 | 51 | null | null |
hasufell/CGA | Algorithms/QuadTree.hs | gpl-2.0 | goNE (TNode nw ne sw se, bs) = Just (ne, NECrumb nw sw se:bs) | 61 | goNE (TNode nw ne sw se, bs) = Just (ne, NECrumb nw sw se:bs) | 61 | goNE (TNode nw ne sw se, bs) = Just (ne, NECrumb nw sw se:bs) | 61 | false | false | 0 | 8 | 13 | 44 | 22 | 22 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 2700451 = 2868 | 34 | getValueFromProduct 2700451 = 2868 | 34 | getValueFromProduct 2700451 = 2868 | 34 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
antalsz/hs-to-coq | examples/tests/BitsRewrite.hs | mit | foo :: Bits a => a -> a -> a
foo x y = x BitsRewrite..&. complement y | 69 | foo :: Bits a => a -> a -> a
foo x y = x BitsRewrite..&. complement y | 69 | foo x y = x BitsRewrite..&. complement y | 40 | false | true | 0 | 7 | 17 | 44 | 20 | 24 | null | null |
brendanhay/pagerduty | src/Network/PagerDuty/REST/Users/ContactMethods.hs | mpl-2.0 | -- | A human friendly label for the contact method.
--
-- /Example:/ "Home Phone", "Work Email", etc.
--
-- /Default:/ The type of the contact method and the address (with country code
-- for phone numbers).
ccLabel :: Lens' (Request CreateContact s b) (Maybe Text)
ccLabel = upd.ccLabel' | 288 | ccLabel :: Lens' (Request CreateContact s b) (Maybe Text)
ccLabel = upd.ccLabel' | 80 | ccLabel = upd.ccLabel' | 22 | true | true | 0 | 7 | 48 | 40 | 23 | 17 | null | null |
shayan-najd/MiniLava | Lava/MyST.hs | bsd-3-clause | runST :: (forall s . ST s a) -> a
runST st = unsafePerformST st | 63 | runST :: (forall s . ST s a) -> a
runST st = unsafePerformST st | 63 | runST st = unsafePerformST st | 29 | false | true | 0 | 8 | 14 | 34 | 17 | 17 | null | null |
hampus/sudoku | haskell/Main.hs | bsd-3-clause | cellIndex :: Cell -> Int
cellIndex (Cell row col _) = row*9 + col | 65 | cellIndex :: Cell -> Int
cellIndex (Cell row col _) = row*9 + col | 65 | cellIndex (Cell row col _) = row*9 + col | 40 | false | true | 0 | 9 | 13 | 42 | 19 | 23 | null | null |
jberryman/wai | warp/test/ExceptionSpec.hs | mit | spec :: Spec
spec = describe "responds even if there is an exception" $ do
{- Disabling these tests. We can consider forcing evaluation in Warp.
it "statusError" $ do
sc <- rspCode <$> sendGET "http://127.0.0.1:2345/statusError"
sc `shouldBe` (5,0,0)
it "headersError" $ do
sc <- rspCode <$> sendGET "http://127.0.0.1:2345/headersError"
sc `shouldBe` (5,0,0)
it "headerError" $ do
sc <- rspCode <$> sendGET "http://127.0.0.1:2345/headerError"
sc `shouldBe` (5,0,0)
it "bodyError" $ do
sc <- rspCode <$> sendGET "http://127.0.0.1:2345/bodyError"
sc `shouldBe` (5,0,0)
-}
it "ioException" $ withTestServer $ \prt -> do
sc <- rspCode <$> sendGET (concat $ ["http://127.0.0.1:", show prt, "/ioException"])
sc `shouldBe` (5,0,0)
---------------------------------------------------------------- | 965 | spec :: Spec
spec = describe "responds even if there is an exception" $ do
{- Disabling these tests. We can consider forcing evaluation in Warp.
it "statusError" $ do
sc <- rspCode <$> sendGET "http://127.0.0.1:2345/statusError"
sc `shouldBe` (5,0,0)
it "headersError" $ do
sc <- rspCode <$> sendGET "http://127.0.0.1:2345/headersError"
sc `shouldBe` (5,0,0)
it "headerError" $ do
sc <- rspCode <$> sendGET "http://127.0.0.1:2345/headerError"
sc `shouldBe` (5,0,0)
it "bodyError" $ do
sc <- rspCode <$> sendGET "http://127.0.0.1:2345/bodyError"
sc `shouldBe` (5,0,0)
-}
it "ioException" $ withTestServer $ \prt -> do
sc <- rspCode <$> sendGET (concat $ ["http://127.0.0.1:", show prt, "/ioException"])
sc `shouldBe` (5,0,0)
---------------------------------------------------------------- | 965 | spec = describe "responds even if there is an exception" $ do
{- Disabling these tests. We can consider forcing evaluation in Warp.
it "statusError" $ do
sc <- rspCode <$> sendGET "http://127.0.0.1:2345/statusError"
sc `shouldBe` (5,0,0)
it "headersError" $ do
sc <- rspCode <$> sendGET "http://127.0.0.1:2345/headersError"
sc `shouldBe` (5,0,0)
it "headerError" $ do
sc <- rspCode <$> sendGET "http://127.0.0.1:2345/headerError"
sc `shouldBe` (5,0,0)
it "bodyError" $ do
sc <- rspCode <$> sendGET "http://127.0.0.1:2345/bodyError"
sc `shouldBe` (5,0,0)
-}
it "ioException" $ withTestServer $ \prt -> do
sc <- rspCode <$> sendGET (concat $ ["http://127.0.0.1:", show prt, "/ioException"])
sc `shouldBe` (5,0,0)
---------------------------------------------------------------- | 952 | false | true | 0 | 18 | 278 | 97 | 49 | 48 | null | null |
yairchu/ad | src/Numeric/AD/Internal/Chain.hs | bsd-3-clause | -- | Used internally to push sensitivities down the chain.
backPropagate :: Num a => Int -> Cells -> STArray s Int a -> ST s Int
backPropagate k Nil _ = return k | 161 | backPropagate :: Num a => Int -> Cells -> STArray s Int a -> ST s Int
backPropagate k Nil _ = return k | 102 | backPropagate k Nil _ = return k | 32 | true | true | 0 | 9 | 33 | 59 | 26 | 33 | null | null |
konn/hskk | src/Text/InputMethod/SKK/Dictionary.hs | bsd-3-clause | emptyDic :: Dictionary
emptyDic = Dict HM.empty HM.empty | 56 | emptyDic :: Dictionary
emptyDic = Dict HM.empty HM.empty | 56 | emptyDic = Dict HM.empty HM.empty | 33 | false | true | 0 | 6 | 7 | 20 | 10 | 10 | null | null |
mumuki/mulang | src/Language/Mulang/Analyzer.hs | gpl-3.0 | analyseAst :: Expression -> AnalysisSpec -> IO AnalysisResult
analyseAst ast spec = do
domainLang <- compileDomainLanguage (domainLanguage spec)
testResults <- analyseTests ast (testAnalysisType spec) (normalizationOptions spec)
let queryResults = (analyseExpectations ast (expectations spec) ++ analyseCustomExpectations ast (customExpectations spec))
let expectationResults = map snd queryResults
let context = (queryResults, domainLang)
return $ AnalysisCompleted expectationResults
(analyseSmells ast context (smellsSet spec))
(analyseSignatures ast (signatureAnalysisType spec))
testResults
(analyzeOutputAst ast spec)
(analyzeOutputIdentifiers ast spec)
(transformMany' ast (transformationSpecs spec)) | 895 | analyseAst :: Expression -> AnalysisSpec -> IO AnalysisResult
analyseAst ast spec = do
domainLang <- compileDomainLanguage (domainLanguage spec)
testResults <- analyseTests ast (testAnalysisType spec) (normalizationOptions spec)
let queryResults = (analyseExpectations ast (expectations spec) ++ analyseCustomExpectations ast (customExpectations spec))
let expectationResults = map snd queryResults
let context = (queryResults, domainLang)
return $ AnalysisCompleted expectationResults
(analyseSmells ast context (smellsSet spec))
(analyseSignatures ast (signatureAnalysisType spec))
testResults
(analyzeOutputAst ast spec)
(analyzeOutputIdentifiers ast spec)
(transformMany' ast (transformationSpecs spec)) | 895 | analyseAst ast spec = do
domainLang <- compileDomainLanguage (domainLanguage spec)
testResults <- analyseTests ast (testAnalysisType spec) (normalizationOptions spec)
let queryResults = (analyseExpectations ast (expectations spec) ++ analyseCustomExpectations ast (customExpectations spec))
let expectationResults = map snd queryResults
let context = (queryResults, domainLang)
return $ AnalysisCompleted expectationResults
(analyseSmells ast context (smellsSet spec))
(analyseSignatures ast (signatureAnalysisType spec))
testResults
(analyzeOutputAst ast spec)
(analyzeOutputIdentifiers ast spec)
(transformMany' ast (transformationSpecs spec)) | 833 | false | true | 0 | 14 | 260 | 218 | 104 | 114 | null | null |
Ferdinand-vW/Wlp-verification-engine | src/GCL.hs | gpl-3.0 | (.=) :: Expr -> Expr -> Stmt
(.=) expr1 expr2 = Assign expr1 expr2 | 66 | (.=) :: Expr -> Expr -> Stmt
(.=) expr1 expr2 = Assign expr1 expr2 | 66 | (.=) expr1 expr2 = Assign expr1 expr2 | 37 | false | true | 0 | 6 | 13 | 33 | 18 | 15 | null | null |
siddhanathan/ghc | testsuite/tests/llvm/should_compile/T5054_2.hs | bsd-3-clause | sizeofInt64 = sizeOf (undefined :: Int64) | 42 | sizeofInt64 = sizeOf (undefined :: Int64) | 42 | sizeofInt64 = sizeOf (undefined :: Int64) | 42 | false | false | 1 | 5 | 6 | 18 | 8 | 10 | null | null |
aconbere/redis | Redis/Commands/List.hs | mit | rightPush h key value = command h $ bulk h "RPUSH" [key] value | 62 | rightPush h key value = command h $ bulk h "RPUSH" [key] value | 62 | rightPush h key value = command h $ bulk h "RPUSH" [key] value | 62 | false | false | 0 | 7 | 12 | 32 | 15 | 17 | null | null |
josuf107/Asteroids | Asteroid.hs | gpl-3.0 | playerPoints :: Player -> (Point, Point, Point)
playerPoints p =
let
pnt = entityPosition . playerEntity $ p
theta = playerRotation p
in
( pnt `addVector` rotateV theta (0, 7)
, pnt `addVector` rotateV theta (0, negate 7)
, pnt `addVector` rotateV theta (14, 0)
) | 319 | playerPoints :: Player -> (Point, Point, Point)
playerPoints p =
let
pnt = entityPosition . playerEntity $ p
theta = playerRotation p
in
( pnt `addVector` rotateV theta (0, 7)
, pnt `addVector` rotateV theta (0, negate 7)
, pnt `addVector` rotateV theta (14, 0)
) | 319 | playerPoints p =
let
pnt = entityPosition . playerEntity $ p
theta = playerRotation p
in
( pnt `addVector` rotateV theta (0, 7)
, pnt `addVector` rotateV theta (0, negate 7)
, pnt `addVector` rotateV theta (14, 0)
) | 271 | false | true | 0 | 12 | 101 | 123 | 66 | 57 | null | null |
binesiyu/ifl | examples/ch13/num.hs | mit | signum _ = error "signum is unimplemented" | 42 | signum _ = error "signum is unimplemented" | 42 | signum _ = error "signum is unimplemented" | 42 | false | false | 0 | 5 | 6 | 13 | 5 | 8 | null | null |
idupree/haskell-time-steward | CrossverifiedTimeStewards.hs | gpl-3.0 | allEqual :: (Eq a) => [a] -> Bool
allEqual [] = True | 52 | allEqual :: (Eq a) => [a] -> Bool
allEqual [] = True | 52 | allEqual [] = True | 18 | false | true | 0 | 7 | 11 | 32 | 17 | 15 | null | null |
sdiehl/ghc | libraries/base/GHC/IO/Handle/FD.hs | bsd-3-clause | setBinaryMode fd = do _ <- setmode (FD.fdFD fd) True
return ()
#else
setBinaryMode _ = return ()
#endif
#if defined(mingw32_HOST_OS) | 155 | setBinaryMode fd = do _ <- setmode (FD.fdFD fd) True
return ()
#else
setBinaryMode _ = return ()
#endif
#if defined(mingw32_HOST_OS) | 155 | setBinaryMode fd = do _ <- setmode (FD.fdFD fd) True
return ()
#else
setBinaryMode _ = return ()
#endif
#if defined(mingw32_HOST_OS) | 155 | false | false | 0 | 11 | 43 | 40 | 19 | 21 | null | null |
rueshyna/gogol | gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer/Types/Product.hs | mpl-2.0 | -- | The geographical region the Ad Exchange should send requests from. Only
-- used by some quota systems, but always setting the value is recommended.
-- Allowed values: - ASIA - EUROPE - US_EAST - US_WEST
abliRegion :: Lens' AccountBidderLocationItem (Maybe Text)
abliRegion
= lens _abliRegion (\ s a -> s{_abliRegion = a}) | 328 | abliRegion :: Lens' AccountBidderLocationItem (Maybe Text)
abliRegion
= lens _abliRegion (\ s a -> s{_abliRegion = a}) | 120 | abliRegion
= lens _abliRegion (\ s a -> s{_abliRegion = a}) | 61 | true | true | 1 | 9 | 55 | 52 | 27 | 25 | null | null |
jokusi/Astview | src/core/Language/Astview/Language.hs | mit | position :: Int -- ^line
-> Int -- ^row
-> SrcSpan
position line row = let p = SrcPos line row in SrcSpan p p | 127 | position :: Int -- ^line
-> Int -- ^row
-> SrcSpan
position line row = let p = SrcPos line row in SrcSpan p p | 127 | position line row = let p = SrcPos line row in SrcSpan p p | 58 | false | true | 0 | 9 | 42 | 47 | 23 | 24 | null | null |
mrmonday/Idris-dev | src/Idris/ParseHelpers.hs | bsd-3-clause | {- | Get file position as FC -}
getFC :: MonadicParsing m => m FC
getFC = do s <- position
let (dir, file) = splitFileName (fileName s)
let f = if dir == addTrailingPathSeparator "." then file else fileName s
return $ FC f (lineNum s, columnNum s) (lineNum s, columnNum s) -- TODO: Change to actual spanning
-- Issue #1594 on the Issue Tracker.
-- https://github.com/idris-lang/Idris-dev/issues/1594
{-* Syntax helpers-}
-- | Bind constraints to term | 507 | getFC :: MonadicParsing m => m FC
getFC = do s <- position
let (dir, file) = splitFileName (fileName s)
let f = if dir == addTrailingPathSeparator "." then file else fileName s
return $ FC f (lineNum s, columnNum s) (lineNum s, columnNum s) -- TODO: Change to actual spanning
-- Issue #1594 on the Issue Tracker.
-- https://github.com/idris-lang/Idris-dev/issues/1594
{-* Syntax helpers-}
-- | Bind constraints to term | 475 | getFC = do s <- position
let (dir, file) = splitFileName (fileName s)
let f = if dir == addTrailingPathSeparator "." then file else fileName s
return $ FC f (lineNum s, columnNum s) (lineNum s, columnNum s) -- TODO: Change to actual spanning
-- Issue #1594 on the Issue Tracker.
-- https://github.com/idris-lang/Idris-dev/issues/1594
{-* Syntax helpers-}
-- | Bind constraints to term | 441 | true | true | 0 | 12 | 133 | 124 | 62 | 62 | null | null |
shlevy/ghc | compiler/basicTypes/Module.hs | bsd-3-clause | filterModuleEnv :: (Module -> a -> Bool) -> ModuleEnv a -> ModuleEnv a
filterModuleEnv f (ModuleEnv e) =
ModuleEnv (Map.filterWithKey (f . unNDModule) e) | 155 | filterModuleEnv :: (Module -> a -> Bool) -> ModuleEnv a -> ModuleEnv a
filterModuleEnv f (ModuleEnv e) =
ModuleEnv (Map.filterWithKey (f . unNDModule) e) | 155 | filterModuleEnv f (ModuleEnv e) =
ModuleEnv (Map.filterWithKey (f . unNDModule) e) | 84 | false | true | 0 | 9 | 25 | 67 | 33 | 34 | null | null |
TOSPIO/yi | src/library/Yi/Buffer/Implementation.hs | gpl-2.0 | getMarkBI :: String -> BufferImpl syntax -> Maybe Mark
getMarkBI name FBufferData {markNames = nms} = M.lookup name nms | 119 | getMarkBI :: String -> BufferImpl syntax -> Maybe Mark
getMarkBI name FBufferData {markNames = nms} = M.lookup name nms | 119 | getMarkBI name FBufferData {markNames = nms} = M.lookup name nms | 64 | false | true | 3 | 7 | 18 | 50 | 23 | 27 | null | null |
channable/icepeak | server/tests/RequestSpec.hs | bsd-3-clause | badMethod :: HTTP.Method
badMethod = ByteString.pack "BADMETHOD" | 64 | badMethod :: HTTP.Method
badMethod = ByteString.pack "BADMETHOD" | 64 | badMethod = ByteString.pack "BADMETHOD" | 39 | false | true | 0 | 7 | 6 | 25 | 10 | 15 | null | null |
bjorg/HPlug | uri.hs | mit | with' uri@Uri { query = Just kvs } (k, v) = uri { query = Just (kvs ++ [ (k, Just v) ])} | 88 | with' uri@Uri { query = Just kvs } (k, v) = uri { query = Just (kvs ++ [ (k, Just v) ])} | 88 | with' uri@Uri { query = Just kvs } (k, v) = uri { query = Just (kvs ++ [ (k, Just v) ])} | 88 | false | false | 1 | 13 | 22 | 69 | 35 | 34 | null | null |
brendanhay/gogol | gogol-containeranalysis/gen/Network/Google/ContainerAnalysis/Types/Product.hs | mpl-2.0 | -- | This field identifies the specific signing method. Eg: \"rsa\",
-- \"ed25519\", and \"ecdsa\".
skKeyType :: Lens' SigningKey (Maybe Text)
skKeyType
= lens _skKeyType (\ s a -> s{_skKeyType = a}) | 201 | skKeyType :: Lens' SigningKey (Maybe Text)
skKeyType
= lens _skKeyType (\ s a -> s{_skKeyType = a}) | 101 | skKeyType
= lens _skKeyType (\ s a -> s{_skKeyType = a}) | 58 | true | true | 0 | 9 | 33 | 49 | 26 | 23 | null | null |
spikelynch/kerlossal | src/Main.hs | bsd-3-clause | p50 = perhaps ( 1, 2 ) | 22 | p50 = perhaps ( 1, 2 ) | 22 | p50 = perhaps ( 1, 2 ) | 22 | false | false | 1 | 6 | 6 | 18 | 8 | 10 | null | null |
hasufell/CGA | Algorithms/KDTree.hs | gpl-2.0 | getDirection _ = Nothing | 41 | getDirection _ = Nothing | 41 | getDirection _ = Nothing | 41 | false | false | 0 | 5 | 20 | 9 | 4 | 5 | null | null |
julienchurch/julienchurch.com | app/Core.hs | apache-2.0 | manageAction :: ListContains n IsAdmin xs => BlogAction (HVect xs) a
manageAction = mkSite mempty | 97 | manageAction :: ListContains n IsAdmin xs => BlogAction (HVect xs) a
manageAction = mkSite mempty | 97 | manageAction = mkSite mempty | 28 | false | true | 0 | 9 | 14 | 42 | 18 | 24 | null | null |
paf31/language-typescript | src/Language/TypeScript/Parser.hs | mit | extendsClause = reserved "extends" >> classOrInterfaceTypeList | 62 | extendsClause = reserved "extends" >> classOrInterfaceTypeList | 62 | extendsClause = reserved "extends" >> classOrInterfaceTypeList | 62 | false | false | 0 | 6 | 5 | 13 | 6 | 7 | null | null |
Madsn/1HAD | exercises/HAD/Y2014/M03/D18/Solution.hs | mit | partner _ = Nothing | 19 | partner _ = Nothing | 19 | partner _ = Nothing | 19 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
dmcclean/HaTeX | Text/LaTeX/Packages/Trees/Qtree.hs | bsd-3-clause | tree_ f (Node mx ts) =
mconcat [ "["
, maybe mempty (("." <>) . braces . f) mx
, " "
, mconcat $ intersperse " " $ fmap (tree_ f) ts
, " ]"
] | 195 | tree_ f (Node mx ts) =
mconcat [ "["
, maybe mempty (("." <>) . braces . f) mx
, " "
, mconcat $ intersperse " " $ fmap (tree_ f) ts
, " ]"
] | 195 | tree_ f (Node mx ts) =
mconcat [ "["
, maybe mempty (("." <>) . braces . f) mx
, " "
, mconcat $ intersperse " " $ fmap (tree_ f) ts
, " ]"
] | 195 | false | false | 0 | 11 | 90 | 81 | 42 | 39 | null | null |
akru/haste-compiler | libraries/haste-lib/src/Haste/DOM/JSString.hs | bsd-3-clause | -- | Create a style attribute name.
style :: JSString -> AttrName
style = StyleName | 83 | style :: JSString -> AttrName
style = StyleName | 47 | style = StyleName | 17 | true | true | 0 | 7 | 14 | 23 | 10 | 13 | null | null |
csrhodes/pandoc | src/Text/Pandoc/Readers/HTML.hs | gpl-2.0 | isInlineTag :: Tag String -> Bool
isInlineTag t = tagOpen isInlineTagName (const True) t ||
tagClose isInlineTagName t ||
tagComment (const True) t
where isInlineTagName x = x `notElem` blockTags | 244 | isInlineTag :: Tag String -> Bool
isInlineTag t = tagOpen isInlineTagName (const True) t ||
tagClose isInlineTagName t ||
tagComment (const True) t
where isInlineTagName x = x `notElem` blockTags | 244 | isInlineTag t = tagOpen isInlineTagName (const True) t ||
tagClose isInlineTagName t ||
tagComment (const True) t
where isInlineTagName x = x `notElem` blockTags | 210 | false | true | 0 | 9 | 78 | 74 | 36 | 38 | null | null |
larskuhtz/wai-cors | test/Server.hs | mit | wsserver ∷ WS.ServerApp
wsserver pc = do
c ← WS.acceptRequest pc
forever (go c) `catch` \case
WS.CloseRequest _code _msg → WS.sendClose c ("closed" ∷ T.Text)
e → throwIO e
where
go c = do
msg ← WS.receiveDataMessage c
forkIO $ WS.sendDataMessage c msg
-- -------------------------------------------------------------------------- --
-- Non Simple Policy
-- | Perform the following tests the following with this policy:
--
-- * @Variy: Origin@ header is set on responses
-- * @X-cors-test@ header is accepted
-- * @X-cors-test@ header is exposed on response
-- * @Access-Control-Allow-Origin@ header is set on responses to the request host
-- * @DELETE@ requests are not allowed
-- * @PUT@ requests are allowed
-- * Requests that don't include an @Origin@ header result in 400 responses
-- (it's not clear how to test this with a browser client)
--
-- Note that Chrome sends @Origin: null@ when loaded from a "file://..." URL,
-- PhantomJS sends "file://".
-- | 1,008 | wsserver ∷ WS.ServerApp
wsserver pc = do
c ← WS.acceptRequest pc
forever (go c) `catch` \case
WS.CloseRequest _code _msg → WS.sendClose c ("closed" ∷ T.Text)
e → throwIO e
where
go c = do
msg ← WS.receiveDataMessage c
forkIO $ WS.sendDataMessage c msg
-- -------------------------------------------------------------------------- --
-- Non Simple Policy
-- | Perform the following tests the following with this policy:
--
-- * @Variy: Origin@ header is set on responses
-- * @X-cors-test@ header is accepted
-- * @X-cors-test@ header is exposed on response
-- * @Access-Control-Allow-Origin@ header is set on responses to the request host
-- * @DELETE@ requests are not allowed
-- * @PUT@ requests are allowed
-- * Requests that don't include an @Origin@ header result in 400 responses
-- (it's not clear how to test this with a browser client)
--
-- Note that Chrome sends @Origin: null@ when loaded from a "file://..." URL,
-- PhantomJS sends "file://".
-- | 1,008 | wsserver pc = do
c ← WS.acceptRequest pc
forever (go c) `catch` \case
WS.CloseRequest _code _msg → WS.sendClose c ("closed" ∷ T.Text)
e → throwIO e
where
go c = do
msg ← WS.receiveDataMessage c
forkIO $ WS.sendDataMessage c msg
-- -------------------------------------------------------------------------- --
-- Non Simple Policy
-- | Perform the following tests the following with this policy:
--
-- * @Variy: Origin@ header is set on responses
-- * @X-cors-test@ header is accepted
-- * @X-cors-test@ header is exposed on response
-- * @Access-Control-Allow-Origin@ header is set on responses to the request host
-- * @DELETE@ requests are not allowed
-- * @PUT@ requests are allowed
-- * Requests that don't include an @Origin@ header result in 400 responses
-- (it's not clear how to test this with a browser client)
--
-- Note that Chrome sends @Origin: null@ when loaded from a "file://..." URL,
-- PhantomJS sends "file://".
-- | 984 | false | true | 0 | 13 | 203 | 137 | 73 | 64 | null | null |
Mr-Click/PFQ | user/Haskell/Network/PFq/Experimental.hs | gpl-2.0 | -- | Dispatch the packet across the sockets
-- with a randomized algorithm that maintains the integrity of
-- per-user flows on top of GTP tunnel protocol (Control-Plane packets
-- are broadcasted to all sockets).
--
-- > (steer_gtp_usr "192.168.0.0" 16)
steer_gtp_usr :: IPv4 -> CInt -> NetFunction
steer_gtp_usr net prefix = MFunction "steer_gtp_usr" net prefix () () () () () () :: NetFunction | 397 | steer_gtp_usr :: IPv4 -> CInt -> NetFunction
steer_gtp_usr net prefix = MFunction "steer_gtp_usr" net prefix () () () () () () :: NetFunction | 141 | steer_gtp_usr net prefix = MFunction "steer_gtp_usr" net prefix () () () () () () :: NetFunction | 96 | true | true | 0 | 6 | 64 | 64 | 35 | 29 | null | null |
nomeata/codeworld | funblocks-client/src/Blocks/Types.hs | apache-2.0 | cwPink = standardFunction "cwPink" "pink" Nothing [typeColor] [] colorColor "The color pink" | 92 | cwPink = standardFunction "cwPink" "pink" Nothing [typeColor] [] colorColor "The color pink" | 92 | cwPink = standardFunction "cwPink" "pink" Nothing [typeColor] [] colorColor "The color pink" | 92 | false | false | 0 | 6 | 11 | 26 | 13 | 13 | null | null |
ml9951/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | collectValBinders expr
= go [] expr
where
go ids (Lam b e) | isId b = go (b:ids) e
go ids body = (reverse ids, body)
-- | Takes a nested application expression and returns the the function
-- being applied and the arguments to which it is applied | 273 | collectValBinders expr
= go [] expr
where
go ids (Lam b e) | isId b = go (b:ids) e
go ids body = (reverse ids, body)
-- | Takes a nested application expression and returns the the function
-- being applied and the arguments to which it is applied | 273 | collectValBinders expr
= go [] expr
where
go ids (Lam b e) | isId b = go (b:ids) e
go ids body = (reverse ids, body)
-- | Takes a nested application expression and returns the the function
-- being applied and the arguments to which it is applied | 273 | false | false | 1 | 8 | 75 | 87 | 38 | 49 | null | null |
bringert/haskell-tar | Codec/Archive/Tar/Util.hs | bsd-3-clause | warnIOError :: IO a -> IO ()
warnIOError m = catchJust ioErrors (m >> return ()) (\e -> warn $ show e) | 102 | warnIOError :: IO a -> IO ()
warnIOError m = catchJust ioErrors (m >> return ()) (\e -> warn $ show e) | 102 | warnIOError m = catchJust ioErrors (m >> return ()) (\e -> warn $ show e) | 73 | false | true | 0 | 9 | 21 | 64 | 30 | 34 | null | null |
athanclark/lucid-foundation | src/Lucid/Foundation/Navigation/TopBar.hs | bsd-3-clause | fixed_ :: Term arg result => arg -> result
fixed_ =
termWith "div" [class_ "fixed"] | 85 | fixed_ :: Term arg result => arg -> result
fixed_ =
termWith "div" [class_ "fixed"] | 85 | fixed_ =
termWith "div" [class_ "fixed"] | 42 | false | true | 0 | 7 | 16 | 35 | 17 | 18 | null | null |
k0001/lei | src/example-ping-pong-cli/Main.hs | bsd-3-clause | -- | @'def' n@ create an 'Model' starting on a 'Ping' state that allows up to
-- @n@ changes, where @n > 0@.
def :: Integer -> Maybe Model
def n = do
guard $ n > 0
return $ Model Ping n []
--------------------------------------------------------------------------------
-- THE VIEW | 290 | def :: Integer -> Maybe Model
def n = do
guard $ n > 0
return $ Model Ping n []
--------------------------------------------------------------------------------
-- THE VIEW | 181 | def n = do
guard $ n > 0
return $ Model Ping n []
--------------------------------------------------------------------------------
-- THE VIEW | 151 | true | true | 0 | 9 | 56 | 52 | 26 | 26 | null | null |
ihc/futhark | src/Futhark/Optimise/InPlaceLowering/LowerIntoStm.hs | isc | lowerUpdateIntoLoop :: (Bindable lore, BinderOps lore,
Aliased lore, LetAttr lore ~ (als, Type),
MonadFreshNames m) =>
[DesiredUpdate (LetAttr lore)]
-> Pattern lore
-> [(FParam lore, SubExp)]
-> [(FParam lore, SubExp)]
-> Body lore
-> Maybe (m ([Stm lore],
[Stm lore],
[Ident],
[Ident],
[(FParam lore, SubExp)],
[(FParam lore, SubExp)],
Body lore))
lowerUpdateIntoLoop updates pat ctx val body = do
-- Algorithm:
--
-- 0) Map each result of the loop body to a corresponding in-place
-- update, if one exists.
--
-- 1) Create new merge variables corresponding to the arrays being
-- updated; extend the pattern and the @res@ list with these,
-- and remove the parts of the result list that have a
-- corresponding in-place update.
--
-- (The creation of the new merge variable identifiers is
-- actually done at the same time as step (0)).
--
-- 2) Create in-place updates at the end of the loop body.
--
-- 3) Create index expressions that read back the values written
-- in (2). If the merge parameter corresponding to this value
-- is unique, also @copy@ this value.
--
-- 4) Update the result of the loop body to properly pass the new
-- arrays and indexed elements to the next iteration of the
-- loop.
--
-- We also check that the merge parameters we work with have
-- loop-invariant shapes.
mk_in_place_map <- summariseLoop updates usedInBody resmap val
Just $ do
in_place_map <- mk_in_place_map
(val',prebnds,postbnds) <- mkMerges in_place_map
let (ctxpat,valpat) = mkResAndPat in_place_map
idxsubsts = indexSubstitutions in_place_map
(idxsubsts', newbnds) <- substituteIndices idxsubsts $ bodyStms body
(body_res, res_bnds) <- manipulateResult in_place_map idxsubsts'
let body' = mkBody (newbnds++res_bnds) body_res
return (prebnds, postbnds, ctxpat, valpat, ctx, val', body')
where usedInBody = freeInBody body
resmap = zip (bodyResult body) $ patternValueIdents pat
mkMerges :: (MonadFreshNames m, Bindable lore) =>
[LoopResultSummary (als, Type)]
-> m ([(Param DeclType, SubExp)], [Stm lore], [Stm lore])
mkMerges summaries = do
((origmerge, extramerge), (prebnds, postbnds)) <-
runWriterT $ partitionEithers <$> mapM mkMerge summaries
return (origmerge ++ extramerge, prebnds, postbnds)
mkMerge summary
| Just (update, mergename, mergeattr) <- relatedUpdate summary = do
source <- newVName "modified_source"
let source_t = snd $ updateType update
updpat = [(Ident source source_t,
BindInPlace
(updateSource update)
(fullSlice source_t $ updateIndices update))]
elmident = Ident (updateValue update) $ rowType source_t
tell ([mkLet [] updpat $ BasicOp $ SubExp $ snd $ mergeParam summary],
[mkLet' [] [elmident] $ BasicOp $ Index
(updateName update) (fullSlice (typeOf $ updateType update) $ updateIndices update)])
return $ Right (Param
mergename
(toDecl (typeOf mergeattr) Unique),
Var source)
| otherwise = return $ Left $ mergeParam summary
mkResAndPat summaries =
let (origpat,extrapat) = partitionEithers $ map mkResAndPat' summaries
in (patternContextIdents pat,
origpat ++ extrapat)
mkResAndPat' summary
| Just (update, _, _) <- relatedUpdate summary =
Right (Ident (updateName update) (snd $ updateType update))
| otherwise =
Left (inPatternAs summary) | 4,200 | lowerUpdateIntoLoop :: (Bindable lore, BinderOps lore,
Aliased lore, LetAttr lore ~ (als, Type),
MonadFreshNames m) =>
[DesiredUpdate (LetAttr lore)]
-> Pattern lore
-> [(FParam lore, SubExp)]
-> [(FParam lore, SubExp)]
-> Body lore
-> Maybe (m ([Stm lore],
[Stm lore],
[Ident],
[Ident],
[(FParam lore, SubExp)],
[(FParam lore, SubExp)],
Body lore))
lowerUpdateIntoLoop updates pat ctx val body = do
-- Algorithm:
--
-- 0) Map each result of the loop body to a corresponding in-place
-- update, if one exists.
--
-- 1) Create new merge variables corresponding to the arrays being
-- updated; extend the pattern and the @res@ list with these,
-- and remove the parts of the result list that have a
-- corresponding in-place update.
--
-- (The creation of the new merge variable identifiers is
-- actually done at the same time as step (0)).
--
-- 2) Create in-place updates at the end of the loop body.
--
-- 3) Create index expressions that read back the values written
-- in (2). If the merge parameter corresponding to this value
-- is unique, also @copy@ this value.
--
-- 4) Update the result of the loop body to properly pass the new
-- arrays and indexed elements to the next iteration of the
-- loop.
--
-- We also check that the merge parameters we work with have
-- loop-invariant shapes.
mk_in_place_map <- summariseLoop updates usedInBody resmap val
Just $ do
in_place_map <- mk_in_place_map
(val',prebnds,postbnds) <- mkMerges in_place_map
let (ctxpat,valpat) = mkResAndPat in_place_map
idxsubsts = indexSubstitutions in_place_map
(idxsubsts', newbnds) <- substituteIndices idxsubsts $ bodyStms body
(body_res, res_bnds) <- manipulateResult in_place_map idxsubsts'
let body' = mkBody (newbnds++res_bnds) body_res
return (prebnds, postbnds, ctxpat, valpat, ctx, val', body')
where usedInBody = freeInBody body
resmap = zip (bodyResult body) $ patternValueIdents pat
mkMerges :: (MonadFreshNames m, Bindable lore) =>
[LoopResultSummary (als, Type)]
-> m ([(Param DeclType, SubExp)], [Stm lore], [Stm lore])
mkMerges summaries = do
((origmerge, extramerge), (prebnds, postbnds)) <-
runWriterT $ partitionEithers <$> mapM mkMerge summaries
return (origmerge ++ extramerge, prebnds, postbnds)
mkMerge summary
| Just (update, mergename, mergeattr) <- relatedUpdate summary = do
source <- newVName "modified_source"
let source_t = snd $ updateType update
updpat = [(Ident source source_t,
BindInPlace
(updateSource update)
(fullSlice source_t $ updateIndices update))]
elmident = Ident (updateValue update) $ rowType source_t
tell ([mkLet [] updpat $ BasicOp $ SubExp $ snd $ mergeParam summary],
[mkLet' [] [elmident] $ BasicOp $ Index
(updateName update) (fullSlice (typeOf $ updateType update) $ updateIndices update)])
return $ Right (Param
mergename
(toDecl (typeOf mergeattr) Unique),
Var source)
| otherwise = return $ Left $ mergeParam summary
mkResAndPat summaries =
let (origpat,extrapat) = partitionEithers $ map mkResAndPat' summaries
in (patternContextIdents pat,
origpat ++ extrapat)
mkResAndPat' summary
| Just (update, _, _) <- relatedUpdate summary =
Right (Ident (updateName update) (snd $ updateType update))
| otherwise =
Left (inPatternAs summary) | 4,200 | lowerUpdateIntoLoop updates pat ctx val body = do
-- Algorithm:
--
-- 0) Map each result of the loop body to a corresponding in-place
-- update, if one exists.
--
-- 1) Create new merge variables corresponding to the arrays being
-- updated; extend the pattern and the @res@ list with these,
-- and remove the parts of the result list that have a
-- corresponding in-place update.
--
-- (The creation of the new merge variable identifiers is
-- actually done at the same time as step (0)).
--
-- 2) Create in-place updates at the end of the loop body.
--
-- 3) Create index expressions that read back the values written
-- in (2). If the merge parameter corresponding to this value
-- is unique, also @copy@ this value.
--
-- 4) Update the result of the loop body to properly pass the new
-- arrays and indexed elements to the next iteration of the
-- loop.
--
-- We also check that the merge parameters we work with have
-- loop-invariant shapes.
mk_in_place_map <- summariseLoop updates usedInBody resmap val
Just $ do
in_place_map <- mk_in_place_map
(val',prebnds,postbnds) <- mkMerges in_place_map
let (ctxpat,valpat) = mkResAndPat in_place_map
idxsubsts = indexSubstitutions in_place_map
(idxsubsts', newbnds) <- substituteIndices idxsubsts $ bodyStms body
(body_res, res_bnds) <- manipulateResult in_place_map idxsubsts'
let body' = mkBody (newbnds++res_bnds) body_res
return (prebnds, postbnds, ctxpat, valpat, ctx, val', body')
where usedInBody = freeInBody body
resmap = zip (bodyResult body) $ patternValueIdents pat
mkMerges :: (MonadFreshNames m, Bindable lore) =>
[LoopResultSummary (als, Type)]
-> m ([(Param DeclType, SubExp)], [Stm lore], [Stm lore])
mkMerges summaries = do
((origmerge, extramerge), (prebnds, postbnds)) <-
runWriterT $ partitionEithers <$> mapM mkMerge summaries
return (origmerge ++ extramerge, prebnds, postbnds)
mkMerge summary
| Just (update, mergename, mergeattr) <- relatedUpdate summary = do
source <- newVName "modified_source"
let source_t = snd $ updateType update
updpat = [(Ident source source_t,
BindInPlace
(updateSource update)
(fullSlice source_t $ updateIndices update))]
elmident = Ident (updateValue update) $ rowType source_t
tell ([mkLet [] updpat $ BasicOp $ SubExp $ snd $ mergeParam summary],
[mkLet' [] [elmident] $ BasicOp $ Index
(updateName update) (fullSlice (typeOf $ updateType update) $ updateIndices update)])
return $ Right (Param
mergename
(toDecl (typeOf mergeattr) Unique),
Var source)
| otherwise = return $ Left $ mergeParam summary
mkResAndPat summaries =
let (origpat,extrapat) = partitionEithers $ map mkResAndPat' summaries
in (patternContextIdents pat,
origpat ++ extrapat)
mkResAndPat' summary
| Just (update, _, _) <- relatedUpdate summary =
Right (Ident (updateName update) (snd $ updateType update))
| otherwise =
Left (inPatternAs summary) | 3,481 | false | true | 1 | 19 | 1,496 | 987 | 506 | 481 | null | null |
bmoix/dots-and-boxes | dots-boxes.hs | mit | updateBoard :: Board -> Edge -> Int -> IO (Board, Bool)
updateBoard b e p
| isHorizontal e = return (moveHorizontal b e p)
| otherwise = return (moveVertical b e p) | 173 | updateBoard :: Board -> Edge -> Int -> IO (Board, Bool)
updateBoard b e p
| isHorizontal e = return (moveHorizontal b e p)
| otherwise = return (moveVertical b e p) | 173 | updateBoard b e p
| isHorizontal e = return (moveHorizontal b e p)
| otherwise = return (moveVertical b e p) | 117 | false | true | 1 | 9 | 40 | 81 | 39 | 42 | null | null |
singingwolfboy/citeproc-hs | src/Text/CSL/Style.hs | bsd-3-clause | -- | With the 'defaultLocale', the locales-xx-XX.xml loaded file and
-- the parsed 'Style' cs:locale elements, produce the final 'Locale'
-- as the only element of a list, taking into account CSL locale
-- prioritization.
mergeLocales :: String -> Locale -> [Locale] -> [Locale]
mergeLocales s l ls = doMerge list
where
list = filter ((==) s . localeLang) ls ++
filter ((\x -> x /= [] && x `isPrefixOf` s) . localeLang) ls ++
filter ((==) [] . localeLang) ls
doMerge x = return l { localeOptions = newOpt x
, localeTermMap = newTermMap x
, localeDate = newDate x
}
newOpt x = nubBy (\a b -> fst a == fst b) (concatMap localeOptions x ++ localeOptions l)
newTermMap x = nubBy (\a b -> fst a == fst b) (concatMap localeTermMap x ++ localeTermMap l)
newDate x = nubBy (\(Date _ a _ _ _ _)
(Date _ b _ _ _ _) -> a == b) (concatMap localeDate x ++ localeDate l) | 1,043 | mergeLocales :: String -> Locale -> [Locale] -> [Locale]
mergeLocales s l ls = doMerge list
where
list = filter ((==) s . localeLang) ls ++
filter ((\x -> x /= [] && x `isPrefixOf` s) . localeLang) ls ++
filter ((==) [] . localeLang) ls
doMerge x = return l { localeOptions = newOpt x
, localeTermMap = newTermMap x
, localeDate = newDate x
}
newOpt x = nubBy (\a b -> fst a == fst b) (concatMap localeOptions x ++ localeOptions l)
newTermMap x = nubBy (\a b -> fst a == fst b) (concatMap localeTermMap x ++ localeTermMap l)
newDate x = nubBy (\(Date _ a _ _ _ _)
(Date _ b _ _ _ _) -> a == b) (concatMap localeDate x ++ localeDate l) | 821 | mergeLocales s l ls = doMerge list
where
list = filter ((==) s . localeLang) ls ++
filter ((\x -> x /= [] && x `isPrefixOf` s) . localeLang) ls ++
filter ((==) [] . localeLang) ls
doMerge x = return l { localeOptions = newOpt x
, localeTermMap = newTermMap x
, localeDate = newDate x
}
newOpt x = nubBy (\a b -> fst a == fst b) (concatMap localeOptions x ++ localeOptions l)
newTermMap x = nubBy (\a b -> fst a == fst b) (concatMap localeTermMap x ++ localeTermMap l)
newDate x = nubBy (\(Date _ a _ _ _ _)
(Date _ b _ _ _ _) -> a == b) (concatMap localeDate x ++ localeDate l) | 764 | true | true | 0 | 17 | 352 | 340 | 175 | 165 | null | null |
sdiehl/ghc | testsuite/tests/simplCore/should_compile/T11644.hs | bsd-3-clause | bar = print $ right (1::Float) (3 :: Float) | 43 | bar = print $ right (1::Float) (3 :: Float) | 43 | bar = print $ right (1::Float) (3 :: Float) | 43 | false | false | 3 | 6 | 8 | 32 | 15 | 17 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-example/Drasil/SWHS/Unitals.hs | bsd-2-clause | -- Constraint 17
timeFinal = uqc "timeFinal" (nounPhraseSP "final time")
("the amount of time elapsed from the beginning of the " ++
"simulation to its conclusion") (sub (eqSymb time)
lFinal) second Rational
[gtZeroConstr,
sfwrc $ UpTo (Exc, sy timeFinalMax)] (dbl 50000) defaultUncrt | 296 | timeFinal = uqc "timeFinal" (nounPhraseSP "final time")
("the amount of time elapsed from the beginning of the " ++
"simulation to its conclusion") (sub (eqSymb time)
lFinal) second Rational
[gtZeroConstr,
sfwrc $ UpTo (Exc, sy timeFinalMax)] (dbl 50000) defaultUncrt | 279 | timeFinal = uqc "timeFinal" (nounPhraseSP "final time")
("the amount of time elapsed from the beginning of the " ++
"simulation to its conclusion") (sub (eqSymb time)
lFinal) second Rational
[gtZeroConstr,
sfwrc $ UpTo (Exc, sy timeFinalMax)] (dbl 50000) defaultUncrt | 279 | true | false | 0 | 10 | 53 | 85 | 42 | 43 | null | null |
orchid-hybrid/WHILE | Syntax.hs | gpl-2.0 | evalS env (v := a) = extendEnvironment env (v, evalA env a) | 59 | evalS env (v := a) = extendEnvironment env (v, evalA env a) | 59 | evalS env (v := a) = extendEnvironment env (v, evalA env a) | 59 | false | false | 0 | 7 | 11 | 36 | 17 | 19 | null | null |
mrkkrp/stack | src/Stack/Types/Config/Build.hs | bsd-3-clause | buildMonoidLibStripArgName :: Text
buildMonoidLibStripArgName = "library-stripping" | 83 | buildMonoidLibStripArgName :: Text
buildMonoidLibStripArgName = "library-stripping" | 83 | buildMonoidLibStripArgName = "library-stripping" | 48 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
pbv/codex | src/Codex/Policy.hs | mit | prettyConstr (Disj c1 c2)
= prettyConstr c1 <> " or " <> prettyConstr c2 | 74 | prettyConstr (Disj c1 c2)
= prettyConstr c1 <> " or " <> prettyConstr c2 | 74 | prettyConstr (Disj c1 c2)
= prettyConstr c1 <> " or " <> prettyConstr c2 | 74 | false | false | 0 | 7 | 15 | 32 | 14 | 18 | null | null |
JonHarder/haskell-go | SGF/Reader.hs | gpl-2.0 | addBlack :: Parser MetaCommand
addBlack = do
string "AB"
loc <- brackets location
return $ BlackPlace $ L loc | 121 | addBlack :: Parser MetaCommand
addBlack = do
string "AB"
loc <- brackets location
return $ BlackPlace $ L loc | 121 | addBlack = do
string "AB"
loc <- brackets location
return $ BlackPlace $ L loc | 90 | false | true | 0 | 8 | 30 | 44 | 19 | 25 | null | null |
brodyberg/LearnHaskell | CaesarCypher.hsproj/TautologyChecker.hs | mit | p4 :: Prop
p4 = Imply (And (Var 'A') (Imply (Var 'A') (Var 'B'))) (Var 'B') | 75 | p4 :: Prop
p4 = Imply (And (Var 'A') (Imply (Var 'A') (Var 'B'))) (Var 'B') | 75 | p4 = Imply (And (Var 'A') (Imply (Var 'A') (Var 'B'))) (Var 'B') | 64 | false | true | 0 | 11 | 15 | 62 | 29 | 33 | null | null |
mettekou/ghc | compiler/main/TidyPgm.hs | bsd-3-clause | getTyConImplicitBinds :: TyCon -> [CoreBind]
getTyConImplicitBinds tc = map get_defn (mapMaybe dataConWrapId_maybe (tyConDataCons tc)) | 134 | getTyConImplicitBinds :: TyCon -> [CoreBind]
getTyConImplicitBinds tc = map get_defn (mapMaybe dataConWrapId_maybe (tyConDataCons tc)) | 134 | getTyConImplicitBinds tc = map get_defn (mapMaybe dataConWrapId_maybe (tyConDataCons tc)) | 89 | false | true | 0 | 9 | 13 | 47 | 21 | 26 | null | null |
WraithM/haskoin-bitcoind | src/Network/Bitcoin/Haskoin.hs | bsd-3-clause | -- | TODO Catch errors from bitcoind
getTransaction :: Client -> TxHash -> IO Tx
getTransaction c hash = decodeHexTx <$> getRawTransaction c (hexTxHash hash) | 157 | getTransaction :: Client -> TxHash -> IO Tx
getTransaction c hash = decodeHexTx <$> getRawTransaction c (hexTxHash hash) | 120 | getTransaction c hash = decodeHexTx <$> getRawTransaction c (hexTxHash hash) | 76 | true | true | 0 | 8 | 24 | 43 | 21 | 22 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 2476 = 2475 | 11 | 2476 = 2475 | 11 | 2476 = 2475 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
SwiftsNamesake/Southpaw | lib/Southpaw/Picasso/Palette.hs | mit | lightslateblue = (0.51764700, 0.43921600, 1.00000000, 1.0) | 64 | lightslateblue = (0.51764700, 0.43921600, 1.00000000, 1.0) | 64 | lightslateblue = (0.51764700, 0.43921600, 1.00000000, 1.0) | 64 | false | false | 0 | 5 | 11 | 18 | 11 | 7 | null | null |
ggreif/thebook-haskell | demo/Client.hs | mit | usage :: IO ()
usage = putStrLn "Usage: thebook-client [hostname] [port]" | 73 | usage :: IO ()
usage = putStrLn "Usage: thebook-client [hostname] [port]" | 73 | usage = putStrLn "Usage: thebook-client [hostname] [port]" | 58 | false | true | 0 | 6 | 10 | 19 | 9 | 10 | null | null |
bts/nylas-hs | Quickstart.hs | bsd-3-clause | token :: AccessToken
token = AccessToken "_PUT_YOUR_ACCESS_TOKEN_HERE_" | 71 | token :: AccessToken
token = AccessToken "_PUT_YOUR_ACCESS_TOKEN_HERE_" | 71 | token = AccessToken "_PUT_YOUR_ACCESS_TOKEN_HERE_" | 50 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
christiaanb/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | doubleDataCon :: DataCon
doubleDataCon = pcDataCon doubleDataConName [] [doublePrimTy] doubleTyCon | 98 | doubleDataCon :: DataCon
doubleDataCon = pcDataCon doubleDataConName [] [doublePrimTy] doubleTyCon | 98 | doubleDataCon = pcDataCon doubleDataConName [] [doublePrimTy] doubleTyCon | 73 | false | true | 0 | 6 | 9 | 32 | 14 | 18 | null | null |
deepfire/mood | src/Data/TypeMap/Constrained.hs | agpl-3.0 | lookup
:: forall c t x proxy
. (Typeable t, c t) => proxy t -> CTypeMap x -> Maybe (TM.Item x t)
lookup t (CTypeMap (c, TM.TypeMap m)) = coerce (Map.lookup (typeRep t) m)
where
coerce :: Maybe Any -> Maybe (TM.Item x t)
coerce = unsafeCoerce | 256 | lookup
:: forall c t x proxy
. (Typeable t, c t) => proxy t -> CTypeMap x -> Maybe (TM.Item x t)
lookup t (CTypeMap (c, TM.TypeMap m)) = coerce (Map.lookup (typeRep t) m)
where
coerce :: Maybe Any -> Maybe (TM.Item x t)
coerce = unsafeCoerce | 256 | lookup t (CTypeMap (c, TM.TypeMap m)) = coerce (Map.lookup (typeRep t) m)
where
coerce :: Maybe Any -> Maybe (TM.Item x t)
coerce = unsafeCoerce | 154 | false | true | 0 | 12 | 62 | 139 | 69 | 70 | null | null |
codeonwort/scrapbook | src/Config.hs | mit | uploader = "example.com/scrap/uploader.php" | 43 | uploader = "example.com/scrap/uploader.php" | 43 | uploader = "example.com/scrap/uploader.php" | 43 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
shouya/thinking-dumps | tsp/TSPLib.hs | mit | getNeighbors :: Path -> Node -> (Node, Node)
getNeighbors p n = foo $ concat $ replicate 2 p
where foo (a:b:c:xs) = if b == n then (a,c) else foo (b:c:xs) | 156 | getNeighbors :: Path -> Node -> (Node, Node)
getNeighbors p n = foo $ concat $ replicate 2 p
where foo (a:b:c:xs) = if b == n then (a,c) else foo (b:c:xs) | 156 | getNeighbors p n = foo $ concat $ replicate 2 p
where foo (a:b:c:xs) = if b == n then (a,c) else foo (b:c:xs) | 111 | false | true | 2 | 9 | 33 | 108 | 54 | 54 | null | null |
zachsully/hakaru | haskell/Language/Hakaru/Types/HClasses.hs | bsd-3-clause | hRadical_Sing _ = Nothing | 29 | hRadical_Sing _ = Nothing | 29 | hRadical_Sing _ = Nothing | 29 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
brendanhay/gogol | gogol-genomics/gen/Network/Google/Resource/Genomics/Workers/CheckIn.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
wciUploadProtocol :: Lens' WorkersCheckIn (Maybe Text)
wciUploadProtocol
= lens _wciUploadProtocol
(\ s a -> s{_wciUploadProtocol = a}) | 205 | wciUploadProtocol :: Lens' WorkersCheckIn (Maybe Text)
wciUploadProtocol
= lens _wciUploadProtocol
(\ s a -> s{_wciUploadProtocol = a}) | 143 | wciUploadProtocol
= lens _wciUploadProtocol
(\ s a -> s{_wciUploadProtocol = a}) | 88 | true | true | 0 | 8 | 33 | 49 | 25 | 24 | null | null |
projectorhq/haskell-liquid | src/Text/Liquid/VariableFinder.hs | bsd-3-clause | aggregateElem af pf (LtEqual l r) =
LtEqual (aggregateElem af pf l) (aggregateElem af pf r) | 111 | aggregateElem af pf (LtEqual l r) =
LtEqual (aggregateElem af pf l) (aggregateElem af pf r) | 111 | aggregateElem af pf (LtEqual l r) =
LtEqual (aggregateElem af pf l) (aggregateElem af pf r) | 111 | false | false | 0 | 7 | 35 | 46 | 22 | 24 | null | null |
gergoerdi/brainfuck | language-registermachine/src/Language/RegisterMachine/CompileToLoop.hs | bsd-3-clause | layoutVar (Reg r) = ensure r | 28 | layoutVar (Reg r) = ensure r | 28 | layoutVar (Reg r) = ensure r | 28 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
agentm/project-m36 | src/lib/ProjectM36/Client.hs | unlicense | currentSchemaName sessionId conn@(RemoteConnection _) = remoteCall conn (RetrieveCurrentSchemaName sessionId) | 109 | currentSchemaName sessionId conn@(RemoteConnection _) = remoteCall conn (RetrieveCurrentSchemaName sessionId) | 109 | currentSchemaName sessionId conn@(RemoteConnection _) = remoteCall conn (RetrieveCurrentSchemaName sessionId) | 109 | false | false | 0 | 8 | 8 | 31 | 15 | 16 | null | null |
trskop/AMI | Network/AMI.hs | bsd-3-clause | format (Response i name ps text) =
formatParams ([("Response", name), ("ActionID", i)] ++ ps) `B.append` "\r\n" `B.append` B.intercalate "\r\n" text | 152 | format (Response i name ps text) =
formatParams ([("Response", name), ("ActionID", i)] ++ ps) `B.append` "\r\n" `B.append` B.intercalate "\r\n" text | 152 | format (Response i name ps text) =
formatParams ([("Response", name), ("ActionID", i)] ++ ps) `B.append` "\r\n" `B.append` B.intercalate "\r\n" text | 152 | false | false | 0 | 10 | 23 | 73 | 40 | 33 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2016/M07/D22/Solution.hs | mit | -- swap ensures graph that has edge (b,a) also has edge (a,b)
swap :: (a,b) -> (b,a)
swap = snd &&& fst | 104 | swap :: (a,b) -> (b,a)
swap = snd &&& fst | 41 | swap = snd &&& fst | 18 | true | true | 0 | 6 | 22 | 32 | 19 | 13 | null | null |
fibsifan/pandoc | src/Text/Pandoc/Readers/Org.hs | gpl-2.0 | orgParamValue :: OrgParser String
orgParamValue = try $
skipSpaces
*> notFollowedBy (char ':' )
*> many1 (noneOf "\t\n\r ")
<* skipSpaces | 151 | orgParamValue :: OrgParser String
orgParamValue = try $
skipSpaces
*> notFollowedBy (char ':' )
*> many1 (noneOf "\t\n\r ")
<* skipSpaces | 151 | orgParamValue = try $
skipSpaces
*> notFollowedBy (char ':' )
*> many1 (noneOf "\t\n\r ")
<* skipSpaces | 117 | false | true | 9 | 6 | 34 | 59 | 26 | 33 | null | null |
sleexyz/haskell-fun | Mock1.hs | bsd-3-clause | myStatefulCounter :: IO (Exists StatefulCounter)
myStatefulCounter = do
ref <- newMVar 0
return . pack $ StatefulCounter
{ incr = modifyMVar_ ref (return . (+1))
, value = readMVar ref
, toInt = readMVar ref
} | 230 | myStatefulCounter :: IO (Exists StatefulCounter)
myStatefulCounter = do
ref <- newMVar 0
return . pack $ StatefulCounter
{ incr = modifyMVar_ ref (return . (+1))
, value = readMVar ref
, toInt = readMVar ref
} | 230 | myStatefulCounter = do
ref <- newMVar 0
return . pack $ StatefulCounter
{ incr = modifyMVar_ ref (return . (+1))
, value = readMVar ref
, toInt = readMVar ref
} | 181 | false | true | 0 | 13 | 56 | 83 | 43 | 40 | null | null |
ameingast/giraffe | bm/System/Giraffe/TrackerBenchmark.hs | bsd-3-clause | emptyScrapeRequest :: ScrapeRequest
emptyScrapeRequest = ScrapeRequest { scrapeRequestInfoHashes = [] } | 103 | emptyScrapeRequest :: ScrapeRequest
emptyScrapeRequest = ScrapeRequest { scrapeRequestInfoHashes = [] } | 103 | emptyScrapeRequest = ScrapeRequest { scrapeRequestInfoHashes = [] } | 67 | false | true | 0 | 7 | 10 | 21 | 12 | 9 | null | null |
meditans/hint | generate/mk_extensions_mod.hs | bsd-3-clause | main = writeFile "src/Hint/Extension.hs" $ render moduleDoc | 59 | main = writeFile "src/Hint/Extension.hs" $ render moduleDoc | 59 | main = writeFile "src/Hint/Extension.hs" $ render moduleDoc | 59 | false | false | 0 | 6 | 6 | 16 | 7 | 9 | null | null |
ssaavedra/liquidhaskell | benchmarks/esop2013-submission/Base.hs | bsd-3-clause | --LIQUID join kx x Tip r = insertMin kx x r
--LIQUID join kx x l Tip = insertMax kx x l
--LIQUID join kx x l@(Bin sizeL ky y ly ry) r@(Bin sizeR kz z lz rz)
--LIQUID | delta*sizeL < sizeR = balanceL kz z (join kx x l lz) rz
--LIQUID | delta*sizeR < sizeL = balanceR ky y ly (join kx x ry r)
--LIQUID | otherwise = bin kx x l r
{-@ joinT :: k:k -> a -> a:OMap {v:k | v < k} a -> b:OMap {v:k| v > k} a -> SumMLen a b -> OMap k a @-}
{-@ Decrease joinT 5 @-}
{- LIQUID WITNESS -}
joinT :: k -> a -> Map k a -> Map k a -> Int -> Map k a
joinT kx x Tip r _ = insertMin kx x r | 592 | joinT :: k -> a -> Map k a -> Map k a -> Int -> Map k a
joinT kx x Tip r _ = insertMin kx x r | 93 | joinT kx x Tip r _ = insertMin kx x r | 37 | true | true | 0 | 10 | 167 | 73 | 39 | 34 | null | null |
verement/etamoo | src/MOO/Object.hs | bsd-3-clause | definedVerbs :: Object -> VTx [StrT]
definedVerbs obj = do
verbs <- mapM (fmap deref . readPVar . snd) $ objectVerbs obj
return $ map verbNames verbs | 153 | definedVerbs :: Object -> VTx [StrT]
definedVerbs obj = do
verbs <- mapM (fmap deref . readPVar . snd) $ objectVerbs obj
return $ map verbNames verbs | 153 | definedVerbs obj = do
verbs <- mapM (fmap deref . readPVar . snd) $ objectVerbs obj
return $ map verbNames verbs | 116 | false | true | 0 | 13 | 30 | 67 | 31 | 36 | null | null |
dolio/vector | Data/Vector/Storable/Mutable.hs | bsd-3-clause | replicateM = G.replicateM | 25 | replicateM = G.replicateM | 25 | replicateM = G.replicateM | 25 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
nevrenato/HetsAlloy | OWL2/ProvePellet.hs | gpl-2.0 | pelletS :: String
pelletS = "Pellet" | 36 | pelletS :: String
pelletS = "Pellet" | 36 | pelletS = "Pellet" | 18 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
forste/haReFork | tools/hs2isabelle/AST/IsabelleTerm.hs | bsd-3-clause | nomatch = HVar "UU" | 19 | nomatch = HVar "UU" | 19 | nomatch = HVar "UU" | 19 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
opqdonut/nikls | test/Test.hs | gpl-3.0 | -- Db --
generateNewTransaction :: IO Transaction
generateNewTransaction = do
t <- generate arbitrary
return t { transactionId = New } | 139 | generateNewTransaction :: IO Transaction
generateNewTransaction = do
t <- generate arbitrary
return t { transactionId = New } | 129 | generateNewTransaction = do
t <- generate arbitrary
return t { transactionId = New } | 88 | true | true | 0 | 9 | 25 | 39 | 19 | 20 | null | null |
rueshyna/gogol | gogol-maps-engine/gen/Network/Google/Resource/MapsEngine/RasterCollections/Parents/List.hs | mpl-2.0 | -- | The maximum number of items to include in a single response page. The
-- maximum supported value is 50.
rcplcMaxResults :: Lens' RasterCollectionsParentsList (Maybe Word32)
rcplcMaxResults
= lens _rcplcMaxResults
(\ s a -> s{_rcplcMaxResults = a})
. mapping _Coerce | 284 | rcplcMaxResults :: Lens' RasterCollectionsParentsList (Maybe Word32)
rcplcMaxResults
= lens _rcplcMaxResults
(\ s a -> s{_rcplcMaxResults = a})
. mapping _Coerce | 175 | rcplcMaxResults
= lens _rcplcMaxResults
(\ s a -> s{_rcplcMaxResults = a})
. mapping _Coerce | 106 | true | true | 0 | 10 | 54 | 56 | 29 | 27 | null | null |
ajcoppa/cis194 | 08-IO/Party.hs | mit | -- | Adds an Employee to the GuestList, updating the cached Fun score
--
-- >>> glCons (Emp "Sue" 5) (GL [(Emp "David" 1)] 1)
-- GL [Emp {empName = "Sue", empFun = 5},Emp {empName = "David", empFun = 1}] 6
glCons :: Employee -> GuestList -> GuestList
glCons e (GL es f) = GL (e:es) (f + empFun e) | 296 | glCons :: Employee -> GuestList -> GuestList
glCons e (GL es f) = GL (e:es) (f + empFun e) | 90 | glCons e (GL es f) = GL (e:es) (f + empFun e) | 45 | true | true | 0 | 10 | 59 | 63 | 32 | 31 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/SESReceiptFilterIpFilter.hs | mit | sesReceiptFilterIpFilter
:: Val Text -- ^ 'sesrfifCidr'
-> Val Text -- ^ 'sesrfifPolicy'
-> SESReceiptFilterIpFilter
sesReceiptFilterIpFilter cidrarg policyarg =
SESReceiptFilterIpFilter
{ _sESReceiptFilterIpFilterCidr = cidrarg
, _sESReceiptFilterIpFilterPolicy = policyarg
} | 290 | sesReceiptFilterIpFilter
:: Val Text -- ^ 'sesrfifCidr'
-> Val Text -- ^ 'sesrfifPolicy'
-> SESReceiptFilterIpFilter
sesReceiptFilterIpFilter cidrarg policyarg =
SESReceiptFilterIpFilter
{ _sESReceiptFilterIpFilterCidr = cidrarg
, _sESReceiptFilterIpFilterPolicy = policyarg
} | 290 | sesReceiptFilterIpFilter cidrarg policyarg =
SESReceiptFilterIpFilter
{ _sESReceiptFilterIpFilterCidr = cidrarg
, _sESReceiptFilterIpFilterPolicy = policyarg
} | 167 | false | true | 0 | 8 | 42 | 55 | 27 | 28 | null | null |
Subsets and Splits