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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
adarqui/react-haskell
|
example/animation/Circles.hs
|
mit
|
colorL C2 f (AnimState c1 c2 c3 c4 pt) =
(\x -> AnimState c1 x c3 c4 pt) <$> f c2
| 85
|
colorL C2 f (AnimState c1 c2 c3 c4 pt) =
(\x -> AnimState c1 x c3 c4 pt) <$> f c2
| 85
|
colorL C2 f (AnimState c1 c2 c3 c4 pt) =
(\x -> AnimState c1 x c3 c4 pt) <$> f c2
| 85
| false
| false
| 0
| 8
| 24
| 56
| 26
| 30
| null | null |
h3nnn4n/rsa-haskell
|
Prime.hs
|
gpl-3.0
|
satisfy (x:xs) n
| head xs == 1 = (((x^2) - (-1)) `mod` n == 0) || (((x^2) - 1) `mod` n == 0)
| otherwise = satisfy xs n
| 135
|
satisfy (x:xs) n
| head xs == 1 = (((x^2) - (-1)) `mod` n == 0) || (((x^2) - 1) `mod` n == 0)
| otherwise = satisfy xs n
| 135
|
satisfy (x:xs) n
| head xs == 1 = (((x^2) - (-1)) `mod` n == 0) || (((x^2) - 1) `mod` n == 0)
| otherwise = satisfy xs n
| 135
| false
| false
| 1
| 13
| 44
| 110
| 58
| 52
| null | null |
muspellsson/hiccup
|
Core.hs
|
lgpl-2.1
|
valConcat = T.fromBStr . B.concat . map T.asBStr . filter (not . T.isEmpty)
| 75
|
valConcat = T.fromBStr . B.concat . map T.asBStr . filter (not . T.isEmpty)
| 75
|
valConcat = T.fromBStr . B.concat . map T.asBStr . filter (not . T.isEmpty)
| 75
| false
| false
| 0
| 9
| 12
| 39
| 19
| 20
| null | null |
bestian/haskell-sandbox
|
h99.hs
|
unlicense
|
rnd_select [] _ = return []
| 27
|
rnd_select [] _ = return []
| 27
|
rnd_select [] _ = return []
| 27
| false
| false
| 0
| 5
| 5
| 20
| 8
| 12
| null | null |
phadej/range-set-list
|
src/Data/RangeSet/List.hs
|
mit
|
lookupGT :: (Ord a, Enum a) => a -> RSet a -> Maybe a
lookupGT x (RSet xs) = f xs where
f ((a,b):s)
| x < a = Just a
| x < b = Just (succ x)
| otherwise = f s
f [] = Nothing
-- | /O(n)/. Find largest element smaller or equal to than the given one.
| 264
|
lookupGT :: (Ord a, Enum a) => a -> RSet a -> Maybe a
lookupGT x (RSet xs) = f xs where
f ((a,b):s)
| x < a = Just a
| x < b = Just (succ x)
| otherwise = f s
f [] = Nothing
-- | /O(n)/. Find largest element smaller or equal to than the given one.
| 264
|
lookupGT x (RSet xs) = f xs where
f ((a,b):s)
| x < a = Just a
| x < b = Just (succ x)
| otherwise = f s
f [] = Nothing
-- | /O(n)/. Find largest element smaller or equal to than the given one.
| 210
| false
| true
| 0
| 8
| 78
| 134
| 65
| 69
| null | null |
AaronFriel/eff-experiments
|
dep/cxmonad/src/Control/Monad/Cx.hs
|
bsd-3-clause
|
(=<|) :: CxMonad m => (a -> m j k b) -> m i j a -> m i k b
m =<| k = k |>= m
| 76
|
(=<|) :: CxMonad m => (a -> m j k b) -> m i j a -> m i k b
m =<| k = k |>= m
| 76
|
m =<| k = k |>= m
| 17
| false
| true
| 1
| 10
| 27
| 73
| 34
| 39
| null | null |
stu-smith/Brandy
|
tests/Api/ResourceContentSpec.hs
|
mit
|
spec :: Spec
spec = do
let resourcesBase = uri ["api", "resources"]
describe "get resource content" $ do
it "should give 404 for bad key" $
runTest $ \app -> do
status <- simpleStatus <$> app `get` (resourcesBase <> uri ["bad-key", "content"])
status `shouldBe` notFound404
it "should give 200 for valid get" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
status <- simpleStatus <$> app `get` (resourcesBase <> uri [rid, "content"])
status `shouldBe` ok200
it "should have empty body for initial get" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
body <- simpleBody <$> app `get` (resourcesBase <> uri [rid, "content"])
body `shouldSatisfy` BSL.null
it "should give correct content-type" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
ct <- simpleHeader "content-type" <$> (app `get` (resourcesBase <> uri [rid, "content"]))
ct `shouldBe` "x-application/any"
it "should give correct body" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
_ <- id <$> (app `putRaw` (resourcesBase <> uri [rid, "content"])) "Hello world"
body <- simpleBody <$> app `get` (resourcesBase <> uri [rid, "content"])
body `shouldBe` "Hello world"
describe "post resource content" $ do
it "should give 405" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
status <- simpleStatus <$> (app `postRaw` (resourcesBase <> uri [rid, "content"])) BS.empty
status `shouldBe` methodNotAllowed405
describe "delete resource content" $ do
it "should give 405" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
status <- simpleStatus <$> app `delete` (resourcesBase <> uri [rid, "content"])
status `shouldBe` methodNotAllowed405
describe "put resource content" $ do
it "should give 404 for bad key" $
runTest $ \app -> do
status <- simpleStatus <$> (app `putRaw` (resourcesBase <> uri ["bad-key", "content"])) BS.empty
status `shouldBe` notFound404
it "should give 204 for valid key" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
status <- simpleStatus <$> (app `putRaw` (resourcesBase <> uri [rid, "content"])) BS.empty
status `shouldBe` noContent204
| 5,912
|
spec :: Spec
spec = do
let resourcesBase = uri ["api", "resources"]
describe "get resource content" $ do
it "should give 404 for bad key" $
runTest $ \app -> do
status <- simpleStatus <$> app `get` (resourcesBase <> uri ["bad-key", "content"])
status `shouldBe` notFound404
it "should give 200 for valid get" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
status <- simpleStatus <$> app `get` (resourcesBase <> uri [rid, "content"])
status `shouldBe` ok200
it "should have empty body for initial get" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
body <- simpleBody <$> app `get` (resourcesBase <> uri [rid, "content"])
body `shouldSatisfy` BSL.null
it "should give correct content-type" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
ct <- simpleHeader "content-type" <$> (app `get` (resourcesBase <> uri [rid, "content"]))
ct `shouldBe` "x-application/any"
it "should give correct body" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
_ <- id <$> (app `putRaw` (resourcesBase <> uri [rid, "content"])) "Hello world"
body <- simpleBody <$> app `get` (resourcesBase <> uri [rid, "content"])
body `shouldBe` "Hello world"
describe "post resource content" $ do
it "should give 405" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
status <- simpleStatus <$> (app `postRaw` (resourcesBase <> uri [rid, "content"])) BS.empty
status `shouldBe` methodNotAllowed405
describe "delete resource content" $ do
it "should give 405" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
status <- simpleStatus <$> app `delete` (resourcesBase <> uri [rid, "content"])
status `shouldBe` methodNotAllowed405
describe "put resource content" $ do
it "should give 404 for bad key" $
runTest $ \app -> do
status <- simpleStatus <$> (app `putRaw` (resourcesBase <> uri ["bad-key", "content"])) BS.empty
status `shouldBe` notFound404
it "should give 204 for valid key" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
status <- simpleStatus <$> (app `putRaw` (resourcesBase <> uri [rid, "content"])) BS.empty
status `shouldBe` noContent204
| 5,912
|
spec = do
let resourcesBase = uri ["api", "resources"]
describe "get resource content" $ do
it "should give 404 for bad key" $
runTest $ \app -> do
status <- simpleStatus <$> app `get` (resourcesBase <> uri ["bad-key", "content"])
status `shouldBe` notFound404
it "should give 200 for valid get" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
status <- simpleStatus <$> app `get` (resourcesBase <> uri [rid, "content"])
status `shouldBe` ok200
it "should have empty body for initial get" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
body <- simpleBody <$> app `get` (resourcesBase <> uri [rid, "content"])
body `shouldSatisfy` BSL.null
it "should give correct content-type" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
ct <- simpleHeader "content-type" <$> (app `get` (resourcesBase <> uri [rid, "content"]))
ct `shouldBe` "x-application/any"
it "should give correct body" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
_ <- id <$> (app `putRaw` (resourcesBase <> uri [rid, "content"])) "Hello world"
body <- simpleBody <$> app `get` (resourcesBase <> uri [rid, "content"])
body `shouldBe` "Hello world"
describe "post resource content" $ do
it "should give 405" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
status <- simpleStatus <$> (app `postRaw` (resourcesBase <> uri [rid, "content"])) BS.empty
status `shouldBe` methodNotAllowed405
describe "delete resource content" $ do
it "should give 405" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
status <- simpleStatus <$> app `delete` (resourcesBase <> uri [rid, "content"])
status `shouldBe` methodNotAllowed405
describe "put resource content" $ do
it "should give 404 for bad key" $
runTest $ \app -> do
status <- simpleStatus <$> (app `putRaw` (resourcesBase <> uri ["bad-key", "content"])) BS.empty
status `shouldBe` notFound404
it "should give 204 for valid key" $
runTestWithUser $ \app uid -> do
let insertBody = Resource { path = "/path/to/res"
, createdByUserId = Nothing
, createdAt = Nothing
, public = True
, contentType = "x-application/any" }
inserted <- jsonBody <$> (app `post` (resourcesBase <> qUid uid)) insertBody :: IO (WithId Resource)
let rid = getId inserted
status <- simpleStatus <$> (app `putRaw` (resourcesBase <> uri [rid, "content"])) BS.empty
status `shouldBe` noContent204
| 5,899
| false
| true
| 0
| 48
| 2,639
| 1,401
| 735
| 666
| null | null |
cabrera/ghc-mod
|
src/Misc.hs
|
bsd-3-clause
|
getCommand :: UnGetLine -> IO String
getCommand (UnGetLine ref) = do
mcmd <- readIORef ref
case mcmd of
Nothing -> getLine
Just cmd -> do
writeIORef ref Nothing
return cmd
----------------------------------------------------------------
| 285
|
getCommand :: UnGetLine -> IO String
getCommand (UnGetLine ref) = do
mcmd <- readIORef ref
case mcmd of
Nothing -> getLine
Just cmd -> do
writeIORef ref Nothing
return cmd
----------------------------------------------------------------
| 285
|
getCommand (UnGetLine ref) = do
mcmd <- readIORef ref
case mcmd of
Nothing -> getLine
Just cmd -> do
writeIORef ref Nothing
return cmd
----------------------------------------------------------------
| 248
| false
| true
| 0
| 12
| 79
| 74
| 33
| 41
| null | null |
rudyardrichter/MCTS
|
old/source/Game/GamesLibrary/TicTacToe.hs
|
mit
|
initialBoard :: Int -> TTTBoard
initialBoard size = replicate size $ replicate size Nothing
| 91
|
initialBoard :: Int -> TTTBoard
initialBoard size = replicate size $ replicate size Nothing
| 91
|
initialBoard size = replicate size $ replicate size Nothing
| 59
| false
| true
| 0
| 6
| 13
| 30
| 14
| 16
| null | null |
micknelso/language-c
|
src/Language/CFamily/C/Analysis/TypeUtils.hs
|
bsd-3-clause
|
typeQuals (FunctionType _ _) = noTypeQuals
| 42
|
typeQuals (FunctionType _ _) = noTypeQuals
| 42
|
typeQuals (FunctionType _ _) = noTypeQuals
| 42
| false
| false
| 0
| 7
| 5
| 17
| 8
| 9
| null | null |
antalsz/hs-to-coq
|
src/lib/HsToCoq/Coq/Pretty.hs
|
mit
|
castPrec :: Int
castPrec = fromCoqLevel 100
| 43
|
castPrec :: Int
castPrec = fromCoqLevel 100
| 43
|
castPrec = fromCoqLevel 100
| 27
| false
| true
| 0
| 6
| 6
| 20
| 8
| 12
| null | null |
urv/fixhs
|
src/Data/FIX/Spec/FIX43.hs
|
lgpl-2.1
|
tSenderLocationID :: FIXTag
tSenderLocationID = FIXTag
{ tName = "SenderLocationID"
, tnum = 142
, tparser = toFIXString
, arbitraryValue = FIXString <$> arbitrary }
| 178
|
tSenderLocationID :: FIXTag
tSenderLocationID = FIXTag
{ tName = "SenderLocationID"
, tnum = 142
, tparser = toFIXString
, arbitraryValue = FIXString <$> arbitrary }
| 178
|
tSenderLocationID = FIXTag
{ tName = "SenderLocationID"
, tnum = 142
, tparser = toFIXString
, arbitraryValue = FIXString <$> arbitrary }
| 150
| false
| true
| 0
| 8
| 37
| 45
| 26
| 19
| null | null |
FPtje/LuaAnalysis
|
analysis/src/SignAnalysis.hs
|
lgpl-2.1
|
-- | Function that calculates the out-edges that should be visited
outF :: Node -> SignAn -> AnalysisGraph -> [AEdge]
outF l' a (gr,_) =
let nodething = fromJust $ lab gr l' :: NodeThing
outs = out gr l'
isConditional = case nodething of
(NStat (MStat _ d)) -> case d of
(AIf (MExpr _ c) _ _ _) -> Just c
(AWhile (MExpr _ c) _) -> Just c
(ARepeat _ (MExpr _ c) ) -> Just c
_ -> Nothing
_ -> Nothing
in case isConditional of
Nothing ->outs
Just c -> case calcAss c a of
(B [True]) -> filter (\(x,y,z) -> filterEdges z True ) outs
(B [False]) -> filter (\(x,y,z) -> filterEdges z False ) outs
Top -> outs
(B [True,False]) -> outs
_ -> [] -- outs
-- | Function that considers edges associated with functions.
| 1,199
|
outF :: Node -> SignAn -> AnalysisGraph -> [AEdge]
outF l' a (gr,_) =
let nodething = fromJust $ lab gr l' :: NodeThing
outs = out gr l'
isConditional = case nodething of
(NStat (MStat _ d)) -> case d of
(AIf (MExpr _ c) _ _ _) -> Just c
(AWhile (MExpr _ c) _) -> Just c
(ARepeat _ (MExpr _ c) ) -> Just c
_ -> Nothing
_ -> Nothing
in case isConditional of
Nothing ->outs
Just c -> case calcAss c a of
(B [True]) -> filter (\(x,y,z) -> filterEdges z True ) outs
(B [False]) -> filter (\(x,y,z) -> filterEdges z False ) outs
Top -> outs
(B [True,False]) -> outs
_ -> [] -- outs
-- | Function that considers edges associated with functions.
| 1,132
|
outF l' a (gr,_) =
let nodething = fromJust $ lab gr l' :: NodeThing
outs = out gr l'
isConditional = case nodething of
(NStat (MStat _ d)) -> case d of
(AIf (MExpr _ c) _ _ _) -> Just c
(AWhile (MExpr _ c) _) -> Just c
(ARepeat _ (MExpr _ c) ) -> Just c
_ -> Nothing
_ -> Nothing
in case isConditional of
Nothing ->outs
Just c -> case calcAss c a of
(B [True]) -> filter (\(x,y,z) -> filterEdges z True ) outs
(B [False]) -> filter (\(x,y,z) -> filterEdges z False ) outs
Top -> outs
(B [True,False]) -> outs
_ -> [] -- outs
-- | Function that considers edges associated with functions.
| 1,081
| true
| true
| 0
| 18
| 636
| 349
| 178
| 171
| null | null |
palf/free-driver
|
packages/drive-base/test/Main.hs
|
bsd-3-clause
|
k1 :: (MonadWriter [Text] m) => Free HighF a -> m a
k1 = foldFree h2text
| 72
|
k1 :: (MonadWriter [Text] m) => Free HighF a -> m a
k1 = foldFree h2text
| 72
|
k1 = foldFree h2text
| 20
| false
| true
| 0
| 8
| 15
| 45
| 21
| 24
| null | null |
spechub/Hets
|
OWL2/StaticAnalysis.hs
|
gpl-2.0
|
generateLabelMap :: Sign -> [AS.Axiom] -> Map.Map IRI String
generateLabelMap sig = foldr (\ a -> case a of
AS.AnnotationAxiom ax -> case ax of
AS.AnnotationAssertion _ apr sub (AS.AnnValLit (AS.Literal s' _))
| prefixName apr == "rdfs" && show (iriPath apr) == "label"
-> Map.insert (ir sub) s'
_ -> id
_ -> id) (labelMap sig)
where ir sub = case sub of
AS.AnnSubIri i -> i
AS.AnnSubAnInd i -> i
-- | adding annotations for theorems
| 536
|
generateLabelMap :: Sign -> [AS.Axiom] -> Map.Map IRI String
generateLabelMap sig = foldr (\ a -> case a of
AS.AnnotationAxiom ax -> case ax of
AS.AnnotationAssertion _ apr sub (AS.AnnValLit (AS.Literal s' _))
| prefixName apr == "rdfs" && show (iriPath apr) == "label"
-> Map.insert (ir sub) s'
_ -> id
_ -> id) (labelMap sig)
where ir sub = case sub of
AS.AnnSubIri i -> i
AS.AnnSubAnInd i -> i
-- | adding annotations for theorems
| 536
|
generateLabelMap sig = foldr (\ a -> case a of
AS.AnnotationAxiom ax -> case ax of
AS.AnnotationAssertion _ apr sub (AS.AnnValLit (AS.Literal s' _))
| prefixName apr == "rdfs" && show (iriPath apr) == "label"
-> Map.insert (ir sub) s'
_ -> id
_ -> id) (labelMap sig)
where ir sub = case sub of
AS.AnnSubIri i -> i
AS.AnnSubAnInd i -> i
-- | adding annotations for theorems
| 475
| false
| true
| 1
| 20
| 180
| 209
| 97
| 112
| null | null |
headprogrammingczar/cabal
|
cabal-install/Distribution/Solver/Modular/Preference.hs
|
bsd-3-clause
|
preferInstalledOrdering (I _ (Inst _)) _ = GT
| 58
|
preferInstalledOrdering (I _ (Inst _)) _ = GT
| 58
|
preferInstalledOrdering (I _ (Inst _)) _ = GT
| 58
| false
| false
| 0
| 9
| 20
| 25
| 12
| 13
| null | null |
schnecki/HaskellMachineLearning
|
src/Data/ML/DecisionTree/Ops.hs
|
gpl-3.0
|
fitTreeUniform :: (Show a, Ord a, Ord b) =>
b -- value to compare to
-> (a -> b) -- function to get target attribute
-> [Attr a] -- attributes
-> MinMax -- Max/Min objective function
-> ([[b]] -> Float) -- objective function
-> Pruning [b] -- pruning setting
-> [a] -- data
-> DTree a () Float
fitTreeUniform val target atts minMax objFun pr as =
dropInfo $ fmap (uniform val) $ doPrune pr $
decisionTreeLearning target atts minMax objFun [] as
| 635
|
fitTreeUniform :: (Show a, Ord a, Ord b) =>
b -- value to compare to
-> (a -> b) -- function to get target attribute
-> [Attr a] -- attributes
-> MinMax -- Max/Min objective function
-> ([[b]] -> Float) -- objective function
-> Pruning [b] -- pruning setting
-> [a] -- data
-> DTree a () Float
fitTreeUniform val target atts minMax objFun pr as =
dropInfo $ fmap (uniform val) $ doPrune pr $
decisionTreeLearning target atts minMax objFun [] as
| 635
|
fitTreeUniform val target atts minMax objFun pr as =
dropInfo $ fmap (uniform val) $ doPrune pr $
decisionTreeLearning target atts minMax objFun [] as
| 158
| false
| true
| 4
| 15
| 273
| 173
| 88
| 85
| null | null |
tadeuzagallo/verve-lang
|
src/Typing/Constraint.hs
|
mit
|
-- CG-Fun
constraintGen v x (Fun y r s) (Fun y' t u)
| y == y' && map fst y `intersect` (v `union` x) == [] = do
c <- zipWithM (constraintGen (v `union` map fst y) x) t r
d <- constraintGen (v `union` map fst y) x s u
return $ foldl meet [] c `meet` d
| 265
|
constraintGen v x (Fun y r s) (Fun y' t u)
| y == y' && map fst y `intersect` (v `union` x) == [] = do
c <- zipWithM (constraintGen (v `union` map fst y) x) t r
d <- constraintGen (v `union` map fst y) x s u
return $ foldl meet [] c `meet` d
| 255
|
constraintGen v x (Fun y r s) (Fun y' t u)
| y == y' && map fst y `intersect` (v `union` x) == [] = do
c <- zipWithM (constraintGen (v `union` map fst y) x) t r
d <- constraintGen (v `union` map fst y) x s u
return $ foldl meet [] c `meet` d
| 255
| true
| false
| 0
| 14
| 73
| 171
| 84
| 87
| null | null |
dysinger/amazonka
|
amazonka-ec2/gen/Network/AWS/EC2/RunInstances.hs
|
mpl-2.0
|
-- | The ID of the reservation.
rirReservationId :: Lens' RunInstancesResponse Text
rirReservationId = lens _rirReservationId (\s a -> s { _rirReservationId = a })
| 163
|
rirReservationId :: Lens' RunInstancesResponse Text
rirReservationId = lens _rirReservationId (\s a -> s { _rirReservationId = a })
| 131
|
rirReservationId = lens _rirReservationId (\s a -> s { _rirReservationId = a })
| 79
| true
| true
| 0
| 9
| 24
| 40
| 22
| 18
| null | null |
Paow/encore
|
src/parser/Parser/Parser.hs
|
bsd-3-clause
|
parseBody :: (Expr -> a) -> EncParser (L.IndentOpt EncParser a Expr)
parseBody constructor =
alignedExpressions (return . constructor . makeBody)
| 147
|
parseBody :: (Expr -> a) -> EncParser (L.IndentOpt EncParser a Expr)
parseBody constructor =
alignedExpressions (return . constructor . makeBody)
| 147
|
parseBody constructor =
alignedExpressions (return . constructor . makeBody)
| 78
| false
| true
| 0
| 9
| 21
| 54
| 27
| 27
| null | null |
kadena-io/pact
|
src-ghc/Pact/Types/Crypto.hs
|
bsd-3-clause
|
defaultScheme :: SomeScheme
defaultScheme = toScheme defPPKScheme
| 65
|
defaultScheme :: SomeScheme
defaultScheme = toScheme defPPKScheme
| 65
|
defaultScheme = toScheme defPPKScheme
| 37
| false
| true
| 0
| 6
| 6
| 21
| 8
| 13
| null | null |
peterokagey/haskellOEIS
|
test/EKG/A065519Spec.hs
|
apache-2.0
|
main :: IO ()
main = hspec spec
| 31
|
main :: IO ()
main = hspec spec
| 31
|
main = hspec spec
| 17
| false
| true
| 0
| 7
| 7
| 25
| 10
| 15
| null | null |
ehlemur/HLearn
|
src/HLearn/Data/SpaceTree/Algorithms/NearestNeighbor.hs
|
bsd-3-clause
|
getknnL (NL_Cons n ns) = n:getknnL ns
| 37
|
getknnL (NL_Cons n ns) = n:getknnL ns
| 37
|
getknnL (NL_Cons n ns) = n:getknnL ns
| 37
| false
| false
| 0
| 7
| 6
| 24
| 11
| 13
| null | null |
mrkkrp/playing-with-servant
|
src/Server.hs
|
bsd-3-clause
|
server3 :: Server API
server3 = position
:<|> hello
:<|> marketing
where position :: Int -> Int -> Handler Position
position x y = return (Position x y)
hello :: Maybe String -> Handler HelloMessage
hello = return .
HelloMessage .
("Hello, " ++) .
fromMaybe "anonymous coward"
marketing :: ClientInfo -> Handler Email
marketing = return . emailForClient
| 435
|
server3 :: Server API
server3 = position
:<|> hello
:<|> marketing
where position :: Int -> Int -> Handler Position
position x y = return (Position x y)
hello :: Maybe String -> Handler HelloMessage
hello = return .
HelloMessage .
("Hello, " ++) .
fromMaybe "anonymous coward"
marketing :: ClientInfo -> Handler Email
marketing = return . emailForClient
| 435
|
server3 = position
:<|> hello
:<|> marketing
where position :: Int -> Int -> Handler Position
position x y = return (Position x y)
hello :: Maybe String -> Handler HelloMessage
hello = return .
HelloMessage .
("Hello, " ++) .
fromMaybe "anonymous coward"
marketing :: ClientInfo -> Handler Email
marketing = return . emailForClient
| 413
| false
| true
| 10
| 8
| 140
| 152
| 69
| 83
| null | null |
gabesoft/kapi
|
src/Persistence/RssReaders/Common.hs
|
bsd-3-clause
|
subscriptionCollection :: Collection
subscriptionCollection = recordCollection subscriptionDefinition
| 101
|
subscriptionCollection :: Collection
subscriptionCollection = recordCollection subscriptionDefinition
| 101
|
subscriptionCollection = recordCollection subscriptionDefinition
| 64
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
AndrewRademacher/stack
|
src/Stack/Build/Execute.hs
|
bsd-3-clause
|
printPlan :: M env m
=> Plan
-> m ()
printPlan plan = do
case Map.elems $ planUnregisterLocal plan of
[] -> $logInfo "No packages would be unregistered."
xs -> do
$logInfo "Would unregister locally:"
forM_ xs $ \(ident, mreason) -> $logInfo $ T.concat
[ T.pack $ packageIdentifierString ident
, case mreason of
Nothing -> ""
Just reason -> T.concat
[ " ("
, reason
, ")"
]
]
$logInfo ""
case Map.elems $ planTasks plan of
[] -> $logInfo "Nothing to build."
xs -> do
$logInfo "Would build:"
mapM_ ($logInfo . displayTask) xs
let hasTests = not . Set.null . testComponents . taskComponents
hasBenches = not . Set.null . benchComponents . taskComponents
tests = Map.elems $ Map.filter hasTests $ planFinals plan
benches = Map.elems $ Map.filter hasBenches $ planFinals plan
unless (null tests) $ do
$logInfo ""
$logInfo "Would test:"
mapM_ ($logInfo . displayTask) tests
unless (null benches) $ do
$logInfo ""
$logInfo "Would benchmark:"
mapM_ ($logInfo . displayTask) benches
$logInfo ""
case Map.toList $ planInstallExes plan of
[] -> $logInfo "No executables to be installed."
xs -> do
$logInfo "Would install executables:"
forM_ xs $ \(name, loc) -> $logInfo $ T.concat
[ name
, " from "
, case loc of
Snap -> "snapshot"
Local -> "local"
, " database"
]
-- | For a dry run
| 1,828
|
printPlan :: M env m
=> Plan
-> m ()
printPlan plan = do
case Map.elems $ planUnregisterLocal plan of
[] -> $logInfo "No packages would be unregistered."
xs -> do
$logInfo "Would unregister locally:"
forM_ xs $ \(ident, mreason) -> $logInfo $ T.concat
[ T.pack $ packageIdentifierString ident
, case mreason of
Nothing -> ""
Just reason -> T.concat
[ " ("
, reason
, ")"
]
]
$logInfo ""
case Map.elems $ planTasks plan of
[] -> $logInfo "Nothing to build."
xs -> do
$logInfo "Would build:"
mapM_ ($logInfo . displayTask) xs
let hasTests = not . Set.null . testComponents . taskComponents
hasBenches = not . Set.null . benchComponents . taskComponents
tests = Map.elems $ Map.filter hasTests $ planFinals plan
benches = Map.elems $ Map.filter hasBenches $ planFinals plan
unless (null tests) $ do
$logInfo ""
$logInfo "Would test:"
mapM_ ($logInfo . displayTask) tests
unless (null benches) $ do
$logInfo ""
$logInfo "Would benchmark:"
mapM_ ($logInfo . displayTask) benches
$logInfo ""
case Map.toList $ planInstallExes plan of
[] -> $logInfo "No executables to be installed."
xs -> do
$logInfo "Would install executables:"
forM_ xs $ \(name, loc) -> $logInfo $ T.concat
[ name
, " from "
, case loc of
Snap -> "snapshot"
Local -> "local"
, " database"
]
-- | For a dry run
| 1,828
|
printPlan plan = do
case Map.elems $ planUnregisterLocal plan of
[] -> $logInfo "No packages would be unregistered."
xs -> do
$logInfo "Would unregister locally:"
forM_ xs $ \(ident, mreason) -> $logInfo $ T.concat
[ T.pack $ packageIdentifierString ident
, case mreason of
Nothing -> ""
Just reason -> T.concat
[ " ("
, reason
, ")"
]
]
$logInfo ""
case Map.elems $ planTasks plan of
[] -> $logInfo "Nothing to build."
xs -> do
$logInfo "Would build:"
mapM_ ($logInfo . displayTask) xs
let hasTests = not . Set.null . testComponents . taskComponents
hasBenches = not . Set.null . benchComponents . taskComponents
tests = Map.elems $ Map.filter hasTests $ planFinals plan
benches = Map.elems $ Map.filter hasBenches $ planFinals plan
unless (null tests) $ do
$logInfo ""
$logInfo "Would test:"
mapM_ ($logInfo . displayTask) tests
unless (null benches) $ do
$logInfo ""
$logInfo "Would benchmark:"
mapM_ ($logInfo . displayTask) benches
$logInfo ""
case Map.toList $ planInstallExes plan of
[] -> $logInfo "No executables to be installed."
xs -> do
$logInfo "Would install executables:"
forM_ xs $ \(name, loc) -> $logInfo $ T.concat
[ name
, " from "
, case loc of
Snap -> "snapshot"
Local -> "local"
, " database"
]
-- | For a dry run
| 1,771
| false
| true
| 0
| 21
| 773
| 504
| 228
| 276
| null | null |
ivan-m/Graphalyze
|
Data/Graph/Analysis/Algorithms/Directed.hs
|
bsd-2-clause
|
-- | Pseudo-inverse of 'M.keysSet'.
setKeys :: (Ord a) => (a -> b) -> Set a -> Map a b
setKeys f = M.fromDistinctAscList . map (ap (,) f) . S.toAscList
| 153
|
setKeys :: (Ord a) => (a -> b) -> Set a -> Map a b
setKeys f = M.fromDistinctAscList . map (ap (,) f) . S.toAscList
| 117
|
setKeys f = M.fromDistinctAscList . map (ap (,) f) . S.toAscList
| 64
| true
| true
| 0
| 10
| 32
| 73
| 37
| 36
| null | null |
angerman/data-bitcode-edsl
|
src/EDSL/Monad/Instructions/Compare.hs
|
bsd-3-clause
|
foeq lhs rhs = traceM "FOEQ" >> mkCmp2 FCMP_OEQ lhs rhs
| 55
|
foeq lhs rhs = traceM "FOEQ" >> mkCmp2 FCMP_OEQ lhs rhs
| 55
|
foeq lhs rhs = traceM "FOEQ" >> mkCmp2 FCMP_OEQ lhs rhs
| 55
| false
| false
| 0
| 6
| 10
| 25
| 11
| 14
| null | null |
phaazon/OpenGLRaw
|
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
|
bsd-3-clause
|
gl_REFERENCED_BY_TESS_CONTROL_SHADER_OES :: GLenum
gl_REFERENCED_BY_TESS_CONTROL_SHADER_OES = 0x9307
| 100
|
gl_REFERENCED_BY_TESS_CONTROL_SHADER_OES :: GLenum
gl_REFERENCED_BY_TESS_CONTROL_SHADER_OES = 0x9307
| 100
|
gl_REFERENCED_BY_TESS_CONTROL_SHADER_OES = 0x9307
| 49
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
m-alvarez/jhc
|
src/FrontEnd/Syn/Traverse.hs
|
mit
|
traverseHsPat_ :: (Monad m,Applicative m,MonadSetSrcLoc m) => (HsPat -> m b) -> HsPat -> m ()
traverseHsPat_ fn p = traverseHsPat (traverse_ fn) p *> pure ()
| 157
|
traverseHsPat_ :: (Monad m,Applicative m,MonadSetSrcLoc m) => (HsPat -> m b) -> HsPat -> m ()
traverseHsPat_ fn p = traverseHsPat (traverse_ fn) p *> pure ()
| 157
|
traverseHsPat_ fn p = traverseHsPat (traverse_ fn) p *> pure ()
| 63
| false
| true
| 0
| 9
| 26
| 80
| 39
| 41
| null | null |
michaeljklein/git-details
|
src/Data/Tree/Utils.hs
|
bsd-3-clause
|
-- | This is `forestSort`, except it uses a user-supplied comparison function
-- instead of the overloaded `compare` function.
forestSortBy :: (a -> a -> Ordering) -> Forest a -> Forest a
forestSortBy cmp = map (treeSortBy cmp) . sortBy cmp'
where
cmp' x y = cmp (rootLabel x) (rootLabel y)
-- | Why require `Ord` for `treeUnion` and related functions?
-- It allows roughly @O(n)@ time operations.
--
-- >>> treeUnion x x
-- [x]
--
-- If @x /= y@, then
--
-- >>> treeUnion (Node x a) (Node y b)
-- [Node x a, Node y a]
--
-- >>> treeUnion (Node 1 [Node 2 []]) (Node 1 [Node 2 [], Node 3 [])
-- [Node 1 [Node 2 [], Node 3 []]]
--
| 635
|
forestSortBy :: (a -> a -> Ordering) -> Forest a -> Forest a
forestSortBy cmp = map (treeSortBy cmp) . sortBy cmp'
where
cmp' x y = cmp (rootLabel x) (rootLabel y)
-- | Why require `Ord` for `treeUnion` and related functions?
-- It allows roughly @O(n)@ time operations.
--
-- >>> treeUnion x x
-- [x]
--
-- If @x /= y@, then
--
-- >>> treeUnion (Node x a) (Node y b)
-- [Node x a, Node y a]
--
-- >>> treeUnion (Node 1 [Node 2 []]) (Node 1 [Node 2 [], Node 3 [])
-- [Node 1 [Node 2 [], Node 3 []]]
--
| 508
|
forestSortBy cmp = map (treeSortBy cmp) . sortBy cmp'
where
cmp' x y = cmp (rootLabel x) (rootLabel y)
-- | Why require `Ord` for `treeUnion` and related functions?
-- It allows roughly @O(n)@ time operations.
--
-- >>> treeUnion x x
-- [x]
--
-- If @x /= y@, then
--
-- >>> treeUnion (Node x a) (Node y b)
-- [Node x a, Node y a]
--
-- >>> treeUnion (Node 1 [Node 2 []]) (Node 1 [Node 2 [], Node 3 [])
-- [Node 1 [Node 2 [], Node 3 []]]
--
| 447
| true
| true
| 1
| 9
| 133
| 110
| 57
| 53
| null | null |
abakst/liquidhaskell
|
src/Language/Haskell/Liquid/Desugar710/Coverage.hs
|
bsd-3-clause
|
addTickLHsBind var_bind@(L _ (VarBind {})) = return var_bind
| 60
|
addTickLHsBind var_bind@(L _ (VarBind {})) = return var_bind
| 60
|
addTickLHsBind var_bind@(L _ (VarBind {})) = return var_bind
| 60
| false
| false
| 0
| 10
| 7
| 30
| 15
| 15
| null | null |
yihuang/wai-sockjs
|
Network/Wai/Application/Sockjs.hs
|
bsd-3-clause
|
newSockjsState :: IO (MVar SessionMap)
newSockjsState = newMVar M.empty
| 71
|
newSockjsState :: IO (MVar SessionMap)
newSockjsState = newMVar M.empty
| 71
|
newSockjsState = newMVar M.empty
| 32
| false
| true
| 0
| 7
| 8
| 25
| 12
| 13
| null | null |
cbrghostrider/Hacking
|
HackerRank/FunctionalProgramming/Recursion/superDigit.hs
|
mit
|
superDigit :: String -> String
superDigit [n] = [n]
| 51
|
superDigit :: String -> String
superDigit [n] = [n]
| 51
|
superDigit [n] = [n]
| 20
| false
| true
| 0
| 6
| 8
| 24
| 13
| 11
| null | null |
danr/hipspec
|
testsuite/prod/zeno_version/PropT39.hs
|
gpl-3.0
|
subset :: [Nat] -> [Nat] -> Bool
subset [] ys = True
| 52
|
subset :: [Nat] -> [Nat] -> Bool
subset [] ys = True
| 52
|
subset [] ys = True
| 19
| false
| true
| 0
| 7
| 11
| 32
| 17
| 15
| null | null |
green-haskell/ghc
|
libraries/ghc-prim/GHC/Magic.hs
|
bsd-3-clause
|
-- Implementation note: its strictness and unfolding are over-ridden
-- by the definition in MkId.lhs; in both cases to nothing at all.
-- That way, 'lazy' does not get inlined, and the strictness analyser
-- sees it as lazy. Then the worker/wrapper phase inlines it.
-- Result: happiness
-- | The 'oneShot' function can be used to give a hint to the compiler that its
-- argument will be called at most once, which may (or may not) enable certain
-- optimizations. It can be useful to improve the performance of code in continuation
-- passing style.
oneShot :: (a -> b) -> (a -> b)
oneShot f = f
| 600
|
oneShot :: (a -> b) -> (a -> b)
oneShot f = f
| 45
|
oneShot f = f
| 13
| true
| true
| 0
| 7
| 112
| 41
| 26
| 15
| null | null |
AlexanderPankiv/ghc
|
compiler/basicTypes/OccName.hs
|
bsd-3-clause
|
mkSuperDictSelOcc :: Int -- ^ Index of superclass, e.g. 3
-> OccName -- ^ Class, e.g. @Ord@
-> OccName -- ^ Derived 'Occname', e.g. @$p3Ord@
mkSuperDictSelOcc index cls_tc_occ
= mk_deriv varName "$p" (show index ++ occNameString cls_tc_occ)
| 291
|
mkSuperDictSelOcc :: Int -- ^ Index of superclass, e.g. 3
-> OccName -- ^ Class, e.g. @Ord@
-> OccName
mkSuperDictSelOcc index cls_tc_occ
= mk_deriv varName "$p" (show index ++ occNameString cls_tc_occ)
| 250
|
mkSuperDictSelOcc index cls_tc_occ
= mk_deriv varName "$p" (show index ++ occNameString cls_tc_occ)
| 101
| true
| true
| 0
| 8
| 87
| 47
| 24
| 23
| null | null |
wilbowma/accelerate
|
Data/Array/Accelerate/Interpreter.hs
|
bsd-3-clause
|
evalNeg (FloatingNumType ty) | FloatingDict <- floatingDict ty = negate
| 71
|
evalNeg (FloatingNumType ty) | FloatingDict <- floatingDict ty = negate
| 71
|
evalNeg (FloatingNumType ty) | FloatingDict <- floatingDict ty = negate
| 71
| false
| false
| 0
| 9
| 9
| 29
| 12
| 17
| null | null |
MoixaEnergy/blaze-react
|
src/Text/Blaze/Event/Keycode.hs
|
mit
|
pArrow = Keycode 38
| 31
|
upArrow = Keycode 38
| 31
|
upArrow = Keycode 38
| 31
| false
| false
| 1
| 4
| 15
| 12
| 4
| 8
| null | null |
mgsloan/quasi-extras
|
src/Language/Quasi/Ast/TH.hs
|
bsd-3-clause
|
t' = astQuoter False "Type" parseType
| 37
|
t' = astQuoter False "Type" parseType
| 37
|
t' = astQuoter False "Type" parseType
| 37
| false
| false
| 0
| 5
| 5
| 13
| 6
| 7
| null | null |
tolysz/prepare-ghcjs
|
spec-lts8/cabal/cabal-install/Distribution/Client/ProjectConfig.hs
|
bsd-3-clause
|
mplusMaybeT :: Monad m => m (Maybe a) -> m (Maybe a) -> m (Maybe a)
mplusMaybeT ma mb = do
mx <- ma
case mx of
Nothing -> mb
Just x -> return (Just x)
-- | Read the @.cabal@ file of the given package.
--
-- Note here is where we convert from project-root relative paths to absolute
-- paths.
--
| 309
|
mplusMaybeT :: Monad m => m (Maybe a) -> m (Maybe a) -> m (Maybe a)
mplusMaybeT ma mb = do
mx <- ma
case mx of
Nothing -> mb
Just x -> return (Just x)
-- | Read the @.cabal@ file of the given package.
--
-- Note here is where we convert from project-root relative paths to absolute
-- paths.
--
| 309
|
mplusMaybeT ma mb = do
mx <- ma
case mx of
Nothing -> mb
Just x -> return (Just x)
-- | Read the @.cabal@ file of the given package.
--
-- Note here is where we convert from project-root relative paths to absolute
-- paths.
--
| 241
| false
| true
| 0
| 13
| 77
| 106
| 50
| 56
| null | null |
jameshsmith/HRL
|
Server/Core/Monad.hs
|
mit
|
-- | Twenty sided dice
d20 = (1,20)
| 35
|
d20 = (1,20)
| 12
|
d20 = (1,20)
| 12
| true
| false
| 1
| 5
| 7
| 16
| 8
| 8
| null | null |
haru2036/heart-of-crown-monad
|
Data/HeartOfCrown/Cards.hs
|
bsd-3-clause
|
farm :: Card
farm c = do
return (c + 1)
| 42
|
farm :: Card
farm c = do
return (c + 1)
| 42
|
farm c = do
return (c + 1)
| 29
| false
| true
| 0
| 10
| 13
| 33
| 14
| 19
| null | null |
leksah/leksah-server
|
src/IDE/Core/CTypes.hs
|
gpl-2.0
|
descrType :: TypeDescr -> DescrType
descrType VariableDescr = Variable
| 78
|
descrType :: TypeDescr -> DescrType
descrType VariableDescr = Variable
| 78
|
descrType VariableDescr = Variable
| 41
| false
| true
| 0
| 5
| 16
| 18
| 9
| 9
| null | null |
ksaveljev/hake-2
|
src/Game/Monsters/MInsane.hs
|
bsd-3-clause
|
insaneRun :: EntThink
insaneRun =
GenericEntThink "insane_run" $ \selfRef -> do
self <- readRef selfRef
if (self^.eSpawnFlags) .&. 16 /= 0 && (self^.eEntityState.esFrame) == frameCrawlPain10
then do
modifyRef selfRef (\v -> v & eMonsterInfo.miCurrentMove .~ Just insaneMoveDown)
return True
else do
r <- Lib.randomF
let currentMove = if | (self^.eSpawnFlags) .&. 4 /= 0 -> insaneMoveRunCrawl
| r <= 0.5 -> insaneMoveRunNormal
| otherwise -> insaneMoveRunInsane
modifyRef selfRef (\v -> v & eMonsterInfo.miCurrentMove .~ Just currentMove)
return True
| 681
|
insaneRun :: EntThink
insaneRun =
GenericEntThink "insane_run" $ \selfRef -> do
self <- readRef selfRef
if (self^.eSpawnFlags) .&. 16 /= 0 && (self^.eEntityState.esFrame) == frameCrawlPain10
then do
modifyRef selfRef (\v -> v & eMonsterInfo.miCurrentMove .~ Just insaneMoveDown)
return True
else do
r <- Lib.randomF
let currentMove = if | (self^.eSpawnFlags) .&. 4 /= 0 -> insaneMoveRunCrawl
| r <= 0.5 -> insaneMoveRunNormal
| otherwise -> insaneMoveRunInsane
modifyRef selfRef (\v -> v & eMonsterInfo.miCurrentMove .~ Just currentMove)
return True
| 681
|
insaneRun =
GenericEntThink "insane_run" $ \selfRef -> do
self <- readRef selfRef
if (self^.eSpawnFlags) .&. 16 /= 0 && (self^.eEntityState.esFrame) == frameCrawlPain10
then do
modifyRef selfRef (\v -> v & eMonsterInfo.miCurrentMove .~ Just insaneMoveDown)
return True
else do
r <- Lib.randomF
let currentMove = if | (self^.eSpawnFlags) .&. 4 /= 0 -> insaneMoveRunCrawl
| r <= 0.5 -> insaneMoveRunNormal
| otherwise -> insaneMoveRunInsane
modifyRef selfRef (\v -> v & eMonsterInfo.miCurrentMove .~ Just currentMove)
return True
| 659
| false
| true
| 0
| 23
| 209
| 217
| 102
| 115
| null | null |
GaloisInc/halvm-ghc
|
compiler/hsSyn/HsUtils.hs
|
bsd-3-clause
|
collect_bind omitPatSyn (PatSynBind (PSB { psb_id = L _ ps })) acc =
if omitPatSyn then acc else ps : acc
| 109
|
collect_bind omitPatSyn (PatSynBind (PSB { psb_id = L _ ps })) acc =
if omitPatSyn then acc else ps : acc
| 109
|
collect_bind omitPatSyn (PatSynBind (PSB { psb_id = L _ ps })) acc =
if omitPatSyn then acc else ps : acc
| 109
| false
| false
| 0
| 12
| 24
| 49
| 25
| 24
| null | null |
vektordev/GP
|
src/GhciEval.hs
|
gpl-2.0
|
dropUpTo :: String -> String -> String
dropUpTo "" lst = lst
| 60
|
dropUpTo :: String -> String -> String
dropUpTo "" lst = lst
| 60
|
dropUpTo "" lst = lst
| 21
| false
| true
| 0
| 8
| 11
| 30
| 13
| 17
| null | null |
ezyang/ghc
|
testsuite/tests/programs/galois_raytrace/Data.hs
|
bsd-3-clause
|
getPrimOpType (Int_Int_Int _) = [TyInt,TyInt]
| 49
|
getPrimOpType (Int_Int_Int _) = [TyInt,TyInt]
| 49
|
getPrimOpType (Int_Int_Int _) = [TyInt,TyInt]
| 49
| false
| false
| 0
| 7
| 8
| 21
| 11
| 10
| null | null |
bj4rtmar/sdl2
|
examples/lazyfoo/Lesson04.hs
|
bsd-3-clause
|
screenWidth, screenHeight :: CInt
(screenWidth, screenHeight) = (640, 480)
| 74
|
screenWidth, screenHeight :: CInt
(screenWidth, screenHeight) = (640, 480)
| 74
|
(screenWidth, screenHeight) = (640, 480)
| 40
| false
| true
| 0
| 5
| 8
| 26
| 16
| 10
| null | null |
mankyKitty/TTT
|
src/Main.hs
|
mit
|
mvC Three = _4
| 14
|
mvC Three = _4
| 14
|
mvC Three = _4
| 14
| false
| false
| 0
| 4
| 3
| 10
| 4
| 6
| null | null |
ml9951/ghc
|
compiler/typecheck/TcRnTypes.hs
|
bsd-3-clause
|
pprPatSkolInfo :: ConLike -> SDoc
pprPatSkolInfo (RealDataCon dc)
= sep [ ptext (sLit "a pattern with constructor:")
, nest 2 $ ppr dc <+> dcolon
<+> pprType (dataConUserType dc) <> comma ]
| 209
|
pprPatSkolInfo :: ConLike -> SDoc
pprPatSkolInfo (RealDataCon dc)
= sep [ ptext (sLit "a pattern with constructor:")
, nest 2 $ ppr dc <+> dcolon
<+> pprType (dataConUserType dc) <> comma ]
| 209
|
pprPatSkolInfo (RealDataCon dc)
= sep [ ptext (sLit "a pattern with constructor:")
, nest 2 $ ppr dc <+> dcolon
<+> pprType (dataConUserType dc) <> comma ]
| 175
| false
| true
| 0
| 11
| 51
| 73
| 35
| 38
| null | null |
utwente-fmt/scoop
|
src/Usage.hs
|
bsd-3-clause
|
-- Provides a list of elements of the form (i,j),
-- indicating that summand i directly uses parameter j.
-- For every pair (i,j) that is NOT in this list,
-- summand i does not directly use parameter j.
--
-- Note that the result of this function is an overapproximation
-- of the variables that are actually directly used, as heuristics
-- are used to detect whether or not a variable will be directly used.
-- It could be the case the a pair (i,j) is present in the
-- result, even though summand i will in fact never actually
-- use parameter j directly.
getDirectlyUsed :: LPPE -> DirectlyUsed
getDirectlyUsed lppe = [(summandNr, parNr) | summandNr <- getPSummandNrs lppe,
parNr <- getDirectlyUsedInSummand lppe summandNr]
| 773
|
getDirectlyUsed :: LPPE -> DirectlyUsed
getDirectlyUsed lppe = [(summandNr, parNr) | summandNr <- getPSummandNrs lppe,
parNr <- getDirectlyUsedInSummand lppe summandNr]
| 214
|
getDirectlyUsed lppe = [(summandNr, parNr) | summandNr <- getPSummandNrs lppe,
parNr <- getDirectlyUsedInSummand lppe summandNr]
| 174
| true
| true
| 0
| 8
| 171
| 62
| 37
| 25
| null | null |
kuribas/diagrams-boolean
|
samples/union.hs
|
bsd-3-clause
|
main = mainWith (example :: Diagram B)
| 38
|
main = mainWith (example :: Diagram B)
| 38
|
main = mainWith (example :: Diagram B)
| 38
| false
| false
| 0
| 7
| 6
| 18
| 9
| 9
| null | null |
rueshyna/gogol
|
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
|
mpl-2.0
|
-- | Width of the item for shipping.
ppShippingWidth :: Lens' Product (Maybe ProductShippingDimension)
ppShippingWidth
= lens _ppShippingWidth
(\ s a -> s{_ppShippingWidth = a})
| 185
|
ppShippingWidth :: Lens' Product (Maybe ProductShippingDimension)
ppShippingWidth
= lens _ppShippingWidth
(\ s a -> s{_ppShippingWidth = a})
| 148
|
ppShippingWidth
= lens _ppShippingWidth
(\ s a -> s{_ppShippingWidth = a})
| 82
| true
| true
| 0
| 8
| 32
| 49
| 25
| 24
| null | null |
wochinge/CacheSimulator
|
src/Clock/CartClock.hs
|
bsd-3-clause
|
deleteAndGetIfReference file@(Just (_, _, (NotReferenced, _, _))) = (Nothing, file)
| 83
|
deleteAndGetIfReference file@(Just (_, _, (NotReferenced, _, _))) = (Nothing, file)
| 83
|
deleteAndGetIfReference file@(Just (_, _, (NotReferenced, _, _))) = (Nothing, file)
| 83
| false
| false
| 0
| 10
| 9
| 42
| 25
| 17
| null | null |
alang9/deque
|
Data/Deque/NonCat/LessTyped.hs
|
bsd-3-clause
|
popL (BigY f (Y y ys) ls@(BigR _ _ _)) = LR f (BigY y ys ls)
| 60
|
popL (BigY f (Y y ys) ls@(BigR _ _ _)) = LR f (BigY y ys ls)
| 60
|
popL (BigY f (Y y ys) ls@(BigR _ _ _)) = LR f (BigY y ys ls)
| 60
| false
| false
| 0
| 9
| 16
| 56
| 27
| 29
| null | null |
spechub/Hets
|
HasCASL/MatchCAD.hs
|
gpl-2.0
|
dmUsage :: String
dmUsage = usageInfo dmHeader options
| 54
|
dmUsage :: String
dmUsage = usageInfo dmHeader options
| 54
|
dmUsage = usageInfo dmHeader options
| 36
| false
| true
| 0
| 5
| 7
| 16
| 8
| 8
| null | null |
mahrz/hit
|
src/Numeric/Information/Model/IT.hs
|
mit
|
(-<<) :: (Eq a) => [[a]] -> [[a]] -> Bool
(-<<) a b = (a -<= b) && (a /= b)
| 75
|
(-<<) :: (Eq a) => [[a]] -> [[a]] -> Bool
(-<<) a b = (a -<= b) && (a /= b)
| 75
|
(-<<) a b = (a -<= b) && (a /= b)
| 33
| false
| true
| 0
| 9
| 20
| 67
| 39
| 28
| null | null |
DominikDitoIvosevic/Uni
|
IRG/src/Irg/Lab3/Callbacks.hs
|
mit
|
dot44 = V4 19 5 5 1
| 19
|
dot44 = V4 19 5 5 1
| 19
|
dot44 = V4 19 5 5 1
| 19
| false
| false
| 0
| 5
| 6
| 15
| 7
| 8
| null | null |
Persi/shellcheck
|
ShellCheck/Analytics.hs
|
gpl-3.0
|
prop_checkUnused25= verifyNotTree checkUnusedAssignments "readarray foo; echo ${foo[@]}"
| 88
|
prop_checkUnused25= verifyNotTree checkUnusedAssignments "readarray foo; echo ${foo[@]}"
| 88
|
prop_checkUnused25= verifyNotTree checkUnusedAssignments "readarray foo; echo ${foo[@]}"
| 88
| false
| false
| 1
| 5
| 6
| 15
| 5
| 10
| null | null |
nevrenato/Hets_Fork
|
CASL/Amalgamability.hs
|
gpl-2.0
|
wordCod [] = error "wordCod"
| 28
|
wordCod [] = error "wordCod"
| 28
|
wordCod [] = error "wordCod"
| 28
| false
| false
| 0
| 5
| 4
| 15
| 6
| 9
| null | null |
conal/lambda-ccc
|
src/LambdaCCC/Unused/Reify.hs
|
bsd-3-clause
|
unlessTC :: String -> ReExpr
unlessTC name = rejectTypeR (hasTC name)
| 69
|
unlessTC :: String -> ReExpr
unlessTC name = rejectTypeR (hasTC name)
| 69
|
unlessTC name = rejectTypeR (hasTC name)
| 40
| false
| true
| 0
| 7
| 10
| 32
| 14
| 18
| null | null |
spinda/liquidhaskell
|
src/Language/Haskell/Liquid/RefType.hs
|
bsd-3-clause
|
subsFreeRef _ _ (α', τ', _) (RPropP ss r)
= RPropP (mapSnd (subt (α', τ')) <$> ss) r
| 86
|
subsFreeRef _ _ (α', τ', _) (RPropP ss r)
= RPropP (mapSnd (subt (α', τ')) <$> ss) r
| 86
|
subsFreeRef _ _ (α', τ', _) (RPropP ss r)
= RPropP (mapSnd (subt (α', τ')) <$> ss) r
| 86
| false
| false
| 2
| 11
| 19
| 63
| 30
| 33
| null | null |
mightymoose/liquidhaskell
|
src/Language/Haskell/Liquid/Fresh.hs
|
bsd-3-clause
|
refreshRefType t
= return t
| 29
|
refreshRefType t
= return t
| 29
|
refreshRefType t
= return t
| 29
| false
| false
| 0
| 5
| 6
| 12
| 5
| 7
| null | null |
deech/stack
|
src/Stack/Path.hs
|
bsd-3-clause
|
deprecatedPathKeys :: [(Text, Text)]
deprecatedPathKeys =
[ (T.pack deprecatedStackRootOptionName, T.pack stackRootOptionName)
, ("ghc-paths", "programs")
, ("local-bin-path", "local-bin")
]
| 206
|
deprecatedPathKeys :: [(Text, Text)]
deprecatedPathKeys =
[ (T.pack deprecatedStackRootOptionName, T.pack stackRootOptionName)
, ("ghc-paths", "programs")
, ("local-bin-path", "local-bin")
]
| 206
|
deprecatedPathKeys =
[ (T.pack deprecatedStackRootOptionName, T.pack stackRootOptionName)
, ("ghc-paths", "programs")
, ("local-bin-path", "local-bin")
]
| 169
| false
| true
| 0
| 8
| 33
| 57
| 34
| 23
| null | null |
wdanilo/haskell-language-c
|
src/Language/C/Pretty.hs
|
bsd-3-clause
|
binPrec CEqOp = 16
| 19
|
binPrec CEqOp = 16
| 19
|
binPrec CEqOp = 16
| 19
| false
| false
| 0
| 5
| 4
| 9
| 4
| 5
| null | null |
antalsz/hs-to-coq
|
examples/graph/graph/Data/Graph/Inductive/NodeMap.hs
|
mit
|
insMapEdges :: (Ord a, DynGraph g) => NodeMap a -> [(a, a, b)] -> g a b -> g a b
insMapEdges m es g =
let Just es' = mkEdges m es
in insEdges es' g
| 155
|
insMapEdges :: (Ord a, DynGraph g) => NodeMap a -> [(a, a, b)] -> g a b -> g a b
insMapEdges m es g =
let Just es' = mkEdges m es
in insEdges es' g
| 155
|
insMapEdges m es g =
let Just es' = mkEdges m es
in insEdges es' g
| 74
| false
| true
| 0
| 9
| 44
| 95
| 46
| 49
| null | null |
michaelt/streaming
|
src/Streaming/Prelude.hs
|
bsd-3-clause
|
-- ---------------
-- effects
-- ---------------
{- | Reduce a stream, performing its actions but ignoring its elements.
>>> rest <- S.effects $ S.splitAt 2 $ each [1..5]
>>> S.print rest
3
4
5
'effects' should be understood together with 'copy' and is subject to the rules
> S.effects . S.copy = id
> hoist S.effects . S.copy = id
The similar @effects@ and @copy@ operations in @Data.ByteString.Streaming@ obey the same rules.
-}
effects :: Monad m => Stream (Of a) m r -> m r
effects = loop where
loop stream = case stream of
Return r -> return r
Effect m -> m >>= loop
Step (_ :> rest) -> loop rest
| 652
|
effects :: Monad m => Stream (Of a) m r -> m r
effects = loop where
loop stream = case stream of
Return r -> return r
Effect m -> m >>= loop
Step (_ :> rest) -> loop rest
| 201
|
effects = loop where
loop stream = case stream of
Return r -> return r
Effect m -> m >>= loop
Step (_ :> rest) -> loop rest
| 154
| true
| true
| 0
| 12
| 164
| 100
| 49
| 51
| null | null |
ForestPhoenix/FPSurvey
|
app/devel.hs
|
mit
|
main :: IO ()
main = develMain
| 30
|
main :: IO ()
main = develMain
| 30
|
main = develMain
| 16
| false
| true
| 0
| 7
| 6
| 22
| 9
| 13
| null | null |
adamse/hindent
|
src/HIndent/Styles/Gibiansky.hs
|
bsd-3-clause
|
ifExpr :: Exp NodeInfo -> Printer State ()
ifExpr (If _ cond thenExpr elseExpr) =
depend (write "if") $ do
write " "
pretty cond
newline
write "then "
pretty thenExpr
newline
write "else "
pretty elseExpr
| 238
|
ifExpr :: Exp NodeInfo -> Printer State ()
ifExpr (If _ cond thenExpr elseExpr) =
depend (write "if") $ do
write " "
pretty cond
newline
write "then "
pretty thenExpr
newline
write "else "
pretty elseExpr
| 238
|
ifExpr (If _ cond thenExpr elseExpr) =
depend (write "if") $ do
write " "
pretty cond
newline
write "then "
pretty thenExpr
newline
write "else "
pretty elseExpr
| 195
| false
| true
| 0
| 8
| 70
| 95
| 39
| 56
| null | null |
jamesdabbs/pi-base-2
|
src/Api/Helpers.hs
|
bsd-3-clause
|
getPage' :: (PersistEntity a, PersistEntityBackend a ~ SqlBackend)
=> [Filter a] -> [SelectOpt a] -> Pager a
getPage' filters opts mpage mper = actionToHandler $ do
let pageNumber = maybe 1 (max 1) mpage
pagePer = maybe 25 (max 1 . min 50) mper
offset = pagePer * (pageNumber - 1)
allOpts = opts ++ [LimitTo pagePer, OffsetBy offset]
pageResults <- runDB $ selectList filters allOpts
pageItemCount <- runDB $ count filters
let pagePageCount = (quot pageItemCount pagePer) + 1
return $ Page{..}
| 564
|
getPage' :: (PersistEntity a, PersistEntityBackend a ~ SqlBackend)
=> [Filter a] -> [SelectOpt a] -> Pager a
getPage' filters opts mpage mper = actionToHandler $ do
let pageNumber = maybe 1 (max 1) mpage
pagePer = maybe 25 (max 1 . min 50) mper
offset = pagePer * (pageNumber - 1)
allOpts = opts ++ [LimitTo pagePer, OffsetBy offset]
pageResults <- runDB $ selectList filters allOpts
pageItemCount <- runDB $ count filters
let pagePageCount = (quot pageItemCount pagePer) + 1
return $ Page{..}
| 564
|
getPage' filters opts mpage mper = actionToHandler $ do
let pageNumber = maybe 1 (max 1) mpage
pagePer = maybe 25 (max 1 . min 50) mper
offset = pagePer * (pageNumber - 1)
allOpts = opts ++ [LimitTo pagePer, OffsetBy offset]
pageResults <- runDB $ selectList filters allOpts
pageItemCount <- runDB $ count filters
let pagePageCount = (quot pageItemCount pagePer) + 1
return $ Page{..}
| 446
| false
| true
| 0
| 14
| 153
| 214
| 104
| 110
| null | null |
JeanJoskin/JsLib
|
src/Language/JsLib/StringUtil.hs
|
bsd-3-clause
|
-- NOTE
-- These functions are written under assumption that their inputs
-- are correctly formatted. We can assume this, since everything is
-- checked by our scanner first.
hexChars = "0123456789ABCDEF"
| 205
|
hexChars = "0123456789ABCDEF"
| 29
|
hexChars = "0123456789ABCDEF"
| 29
| true
| false
| 1
| 5
| 32
| 14
| 7
| 7
| null | null |
tamarin-prover/tamarin-prover
|
lib/theory/src/Theory/Text/Parser/Signature.hs
|
gpl-3.0
|
liftedAddPredicate :: Catch.MonadThrow m =>
Theory sig c r p SapicElement
-> Predicate -> m (Theory sig c r p SapicElement)
liftedAddPredicate thy prd = liftMaybeToEx (DuplicateItem (PredicateItem prd)) (addPredicate prd thy)
| 269
|
liftedAddPredicate :: Catch.MonadThrow m =>
Theory sig c r p SapicElement
-> Predicate -> m (Theory sig c r p SapicElement)
liftedAddPredicate thy prd = liftMaybeToEx (DuplicateItem (PredicateItem prd)) (addPredicate prd thy)
| 269
|
liftedAddPredicate thy prd = liftMaybeToEx (DuplicateItem (PredicateItem prd)) (addPredicate prd thy)
| 101
| false
| true
| 0
| 11
| 75
| 90
| 42
| 48
| null | null |
mstksg/hledger
|
hledger-lib/Hledger/Reports/BalanceReport.hs
|
gpl-3.0
|
mixedAmountValue :: Journal -> Day -> MixedAmount -> MixedAmount
mixedAmountValue j d (Mixed as) = Mixed $ map (amountValue j d) as
| 131
|
mixedAmountValue :: Journal -> Day -> MixedAmount -> MixedAmount
mixedAmountValue j d (Mixed as) = Mixed $ map (amountValue j d) as
| 131
|
mixedAmountValue j d (Mixed as) = Mixed $ map (amountValue j d) as
| 66
| false
| true
| 0
| 8
| 21
| 53
| 26
| 27
| null | null |
rumblesan/proviz
|
src/Language/Parser.hs
|
bsd-3-clause
|
recurParsePostExpr :: Expression -> Parser Expression
recurParsePostExpr e =
optional (postExpr e) >>= maybe (return e) recurParsePostExpr
| 140
|
recurParsePostExpr :: Expression -> Parser Expression
recurParsePostExpr e =
optional (postExpr e) >>= maybe (return e) recurParsePostExpr
| 140
|
recurParsePostExpr e =
optional (postExpr e) >>= maybe (return e) recurParsePostExpr
| 86
| false
| true
| 0
| 8
| 18
| 45
| 21
| 24
| null | null |
ajtulloch/dnngraph
|
NN/DSL.hs
|
bsd-3-clause
|
ip n = def & ty IP & inner_product_param ?~ def & numOutputIP' n
| 64
|
ip n = def & ty IP & inner_product_param ?~ def & numOutputIP' n
| 64
|
ip n = def & ty IP & inner_product_param ?~ def & numOutputIP' n
| 64
| false
| false
| 3
| 7
| 13
| 35
| 14
| 21
| null | null |
duplode/stack
|
src/Stack/Build/ConstructPlan.hs
|
bsd-3-clause
|
tellExecutablesUpstream :: PackageName -> Version -> InstallLocation -> Map FlagName Bool -> M ()
tellExecutablesUpstream name version loc flags = do
ctx <- ask
when (name `Set.member` extraToBuild ctx) $ do
p <- liftIO $ loadPackage ctx name version flags
tellExecutablesPackage loc p
| 309
|
tellExecutablesUpstream :: PackageName -> Version -> InstallLocation -> Map FlagName Bool -> M ()
tellExecutablesUpstream name version loc flags = do
ctx <- ask
when (name `Set.member` extraToBuild ctx) $ do
p <- liftIO $ loadPackage ctx name version flags
tellExecutablesPackage loc p
| 309
|
tellExecutablesUpstream name version loc flags = do
ctx <- ask
when (name `Set.member` extraToBuild ctx) $ do
p <- liftIO $ loadPackage ctx name version flags
tellExecutablesPackage loc p
| 211
| false
| true
| 0
| 12
| 66
| 105
| 49
| 56
| null | null |
databrary/databrary
|
src/Action/Run.hs
|
agpl-3.0
|
fetchIdent
:: Secret -- ^ Session key
-> DBConn -- ^ For querying the session table
-> Wai.Request
-- ^ FIXME: Why the entire request? Can we narrow the scope? What is
-- actually needed is the session cookie.
-> NeedsAuthentication
-- ^ Whether or not to actually do the lookup.
--
-- FIXME: This seems like an unncessary complication.
-> ActionContextM Identity
fetchIdent sec con waiReq = \case
NeedsAuthentication ->
runReaderT determineIdentity (IdContext waiReq sec con)
DoesntNeedAuthentication -> return IdentityNotNeeded
-- | Run a Handler action in the background (IO).
--
-- A new ActionContextM is built, with a fresh guaranteed db connection and
-- timestamp, via 'runContextM'
| 747
|
fetchIdent
:: Secret -- ^ Session key
-> DBConn -- ^ For querying the session table
-> Wai.Request
-- ^ FIXME: Why the entire request? Can we narrow the scope? What is
-- actually needed is the session cookie.
-> NeedsAuthentication
-- ^ Whether or not to actually do the lookup.
--
-- FIXME: This seems like an unncessary complication.
-> ActionContextM Identity
fetchIdent sec con waiReq = \case
NeedsAuthentication ->
runReaderT determineIdentity (IdContext waiReq sec con)
DoesntNeedAuthentication -> return IdentityNotNeeded
-- | Run a Handler action in the background (IO).
--
-- A new ActionContextM is built, with a fresh guaranteed db connection and
-- timestamp, via 'runContextM'
| 747
|
fetchIdent sec con waiReq = \case
NeedsAuthentication ->
runReaderT determineIdentity (IdContext waiReq sec con)
DoesntNeedAuthentication -> return IdentityNotNeeded
-- | Run a Handler action in the background (IO).
--
-- A new ActionContextM is built, with a fresh guaranteed db connection and
-- timestamp, via 'runContextM'
| 343
| false
| true
| 0
| 10
| 165
| 82
| 45
| 37
| null | null |
tomahawkins/trs
|
Language/TRS/Language.hs
|
bsd-3-clause
|
fullAdd _ _ = ([],false)
| 24
|
fullAdd _ _ = ([],false)
| 24
|
fullAdd _ _ = ([],false)
| 24
| false
| false
| 1
| 7
| 4
| 20
| 10
| 10
| null | null |
ezyang/ghc
|
libraries/base/System/IO.hs
|
bsd-3-clause
|
output_flags = std_flags .|. o_CREAT
| 39
|
output_flags = std_flags .|. o_CREAT
| 39
|
output_flags = std_flags .|. o_CREAT
| 39
| false
| false
| 1
| 5
| 7
| 13
| 5
| 8
| null | null |
massysett/penny
|
penny/lib/Penny/Copper/Grammar.hs
|
bsd-3-clause
|
lessThan = terminal "LessThan" $ solo '<'
| 41
|
lessThan = terminal "LessThan" $ solo '<'
| 41
|
lessThan = terminal "LessThan" $ solo '<'
| 41
| false
| false
| 0
| 6
| 6
| 16
| 7
| 9
| null | null |
brendanhay/gogol
|
gogol-bigtableadmin/gen/Network/Google/BigtableAdmin/Types/Product.hs
|
mpl-2.0
|
-- | The type of the restore source.
riSourceType :: Lens' RestoreInfo (Maybe RestoreInfoSourceType)
riSourceType
= lens _riSourceType (\ s a -> s{_riSourceType = a})
| 168
|
riSourceType :: Lens' RestoreInfo (Maybe RestoreInfoSourceType)
riSourceType
= lens _riSourceType (\ s a -> s{_riSourceType = a})
| 131
|
riSourceType
= lens _riSourceType (\ s a -> s{_riSourceType = a})
| 67
| true
| true
| 0
| 9
| 26
| 48
| 25
| 23
| null | null |
NatureShade/SymbolicHaskell
|
src/Math/Symbolic/Simplify.hs
|
mit
|
toSTerm x = x
| 13
|
toSTerm x = x
| 13
|
toSTerm x = x
| 13
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
haskell-distributed/distributed-process-demos
|
src/WorkStealing/SimpleLocalnet.hs
|
bsd-3-clause
|
main :: IO ()
main = do
args <- getArgs
case args of
["master", host, port, n] -> do
backend <- initializeBackend host port rtable
startMaster backend $ \slaves -> do
result <- WorkStealing.master (read n) slaves
liftIO $ print result
["slave", host, port] -> do
backend <- initializeBackend host port rtable
startSlave backend
| 380
|
main :: IO ()
main = do
args <- getArgs
case args of
["master", host, port, n] -> do
backend <- initializeBackend host port rtable
startMaster backend $ \slaves -> do
result <- WorkStealing.master (read n) slaves
liftIO $ print result
["slave", host, port] -> do
backend <- initializeBackend host port rtable
startSlave backend
| 380
|
main = do
args <- getArgs
case args of
["master", host, port, n] -> do
backend <- initializeBackend host port rtable
startMaster backend $ \slaves -> do
result <- WorkStealing.master (read n) slaves
liftIO $ print result
["slave", host, port] -> do
backend <- initializeBackend host port rtable
startSlave backend
| 366
| false
| true
| 0
| 20
| 106
| 149
| 69
| 80
| null | null |
markhibberd/fp-syd-free
|
src/Talks/Free/Ugly.hs
|
bsd-3-clause
|
storePassword :: Text -> Text -> IO ()
storePassword key value =
withLog
("store password " <> key <> " as " <> value)
(const $ "stored password " <> key )
$ storePassword' key value
| 196
|
storePassword :: Text -> Text -> IO ()
storePassword key value =
withLog
("store password " <> key <> " as " <> value)
(const $ "stored password " <> key )
$ storePassword' key value
| 196
|
storePassword key value =
withLog
("store password " <> key <> " as " <> value)
(const $ "stored password " <> key )
$ storePassword' key value
| 157
| false
| true
| 2
| 9
| 49
| 77
| 35
| 42
| null | null |
andreagenso/java2scala
|
src/J2s/Scanner.hs
|
apache-2.0
|
takeComments ((Token BlockComment _ _): ts) = takeComments ts
| 61
|
takeComments ((Token BlockComment _ _): ts) = takeComments ts
| 61
|
takeComments ((Token BlockComment _ _): ts) = takeComments ts
| 61
| false
| false
| 0
| 8
| 8
| 30
| 14
| 16
| null | null |
alphaHeavy/consul-haskell
|
tests/Util.hs
|
bsd-3-clause
|
-- Name of existing health check we can rely on for tests that use the Session API
serfHealth :: Text
serfHealth = "serfHealth"
| 127
|
serfHealth :: Text
serfHealth = "serfHealth"
| 44
|
serfHealth = "serfHealth"
| 25
| true
| true
| 0
| 6
| 22
| 19
| 8
| 11
| null | null |
rueshyna/gogol
|
gogol-games-configuration/gen/Network/Google/Resource/GamesConfiguration/LeaderboardConfigurations/Update.hs
|
mpl-2.0
|
-- | Creates a value of 'LeaderboardConfigurationsUpdate' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lcuPayload'
--
-- * 'lcuLeaderboardId'
leaderboardConfigurationsUpdate
:: LeaderboardConfiguration -- ^ 'lcuPayload'
-> Text -- ^ 'lcuLeaderboardId'
-> LeaderboardConfigurationsUpdate
leaderboardConfigurationsUpdate pLcuPayload_ pLcuLeaderboardId_ =
LeaderboardConfigurationsUpdate'
{ _lcuPayload = pLcuPayload_
, _lcuLeaderboardId = pLcuLeaderboardId_
}
| 574
|
leaderboardConfigurationsUpdate
:: LeaderboardConfiguration -- ^ 'lcuPayload'
-> Text -- ^ 'lcuLeaderboardId'
-> LeaderboardConfigurationsUpdate
leaderboardConfigurationsUpdate pLcuPayload_ pLcuLeaderboardId_ =
LeaderboardConfigurationsUpdate'
{ _lcuPayload = pLcuPayload_
, _lcuLeaderboardId = pLcuLeaderboardId_
}
| 343
|
leaderboardConfigurationsUpdate pLcuPayload_ pLcuLeaderboardId_ =
LeaderboardConfigurationsUpdate'
{ _lcuPayload = pLcuPayload_
, _lcuLeaderboardId = pLcuLeaderboardId_
}
| 186
| true
| true
| 0
| 8
| 92
| 56
| 32
| 24
| null | null |
kim/amazonka
|
amazonka-cognito-identity/gen/Network/AWS/CognitoIdentity/UpdateIdentityPool.hs
|
mpl-2.0
|
-- | 'UpdateIdentityPool' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'uipAllowUnauthenticatedIdentities' @::@ 'Bool'
--
-- * 'uipDeveloperProviderName' @::@ 'Maybe' 'Text'
--
-- * 'uipIdentityPoolId' @::@ 'Text'
--
-- * 'uipIdentityPoolName' @::@ 'Text'
--
-- * 'uipOpenIdConnectProviderARNs' @::@ ['Text']
--
-- * 'uipSupportedLoginProviders' @::@ 'HashMap' 'Text' 'Text'
--
updateIdentityPool :: Text -- ^ 'uipIdentityPoolId'
-> Text -- ^ 'uipIdentityPoolName'
-> Bool -- ^ 'uipAllowUnauthenticatedIdentities'
-> UpdateIdentityPool
updateIdentityPool p1 p2 p3 = UpdateIdentityPool
{ _uipIdentityPoolId = p1
, _uipIdentityPoolName = p2
, _uipAllowUnauthenticatedIdentities = p3
, _uipSupportedLoginProviders = mempty
, _uipDeveloperProviderName = Nothing
, _uipOpenIdConnectProviderARNs = mempty
}
| 974
|
updateIdentityPool :: Text -- ^ 'uipIdentityPoolId'
-> Text -- ^ 'uipIdentityPoolName'
-> Bool -- ^ 'uipAllowUnauthenticatedIdentities'
-> UpdateIdentityPool
updateIdentityPool p1 p2 p3 = UpdateIdentityPool
{ _uipIdentityPoolId = p1
, _uipIdentityPoolName = p2
, _uipAllowUnauthenticatedIdentities = p3
, _uipSupportedLoginProviders = mempty
, _uipDeveloperProviderName = Nothing
, _uipOpenIdConnectProviderARNs = mempty
}
| 558
|
updateIdentityPool p1 p2 p3 = UpdateIdentityPool
{ _uipIdentityPoolId = p1
, _uipIdentityPoolName = p2
, _uipAllowUnauthenticatedIdentities = p3
, _uipSupportedLoginProviders = mempty
, _uipDeveloperProviderName = Nothing
, _uipOpenIdConnectProviderARNs = mempty
}
| 343
| true
| true
| 0
| 7
| 237
| 91
| 60
| 31
| null | null |
spechub/Hets
|
OWL2/ParseMS.hs
|
gpl-2.0
|
ostDecimal :: CharParser st NNInt
postDecimal = char '.' >> option zeroNNInt getNNInt
| 86
|
postDecimal :: CharParser st NNInt
postDecimal = char '.' >> option zeroNNInt getNNInt
| 86
|
postDecimal = char '.' >> option zeroNNInt getNNInt
| 51
| false
| true
| 0
| 6
| 13
| 28
| 13
| 15
| null | null |
abakst/liquidhaskell
|
benchmarks/vector-0.10.0.1/Data/Vector/Unboxed.hs
|
bsd-3-clause
|
cons = G.cons
| 13
|
cons = G.cons
| 13
|
cons = G.cons
| 13
| false
| false
| 1
| 6
| 2
| 12
| 4
| 8
| null | null |
brendanhay/gogol
|
gogol-compute/gen/Network/Google/Resource/Compute/GlobalNetworkEndpointGroups/ListNetworkEndpoints.hs
|
mpl-2.0
|
-- | Creates a value of 'GlobalNetworkEndpointGroupsListNetworkEndpoints' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gneglneReturnPartialSuccess'
--
-- * 'gneglneOrderBy'
--
-- * 'gneglneProject'
--
-- * 'gneglneNetworkEndpointGroup'
--
-- * 'gneglneFilter'
--
-- * 'gneglnePageToken'
--
-- * 'gneglneMaxResults'
globalNetworkEndpointGroupsListNetworkEndpoints
:: Text -- ^ 'gneglneProject'
-> Text -- ^ 'gneglneNetworkEndpointGroup'
-> GlobalNetworkEndpointGroupsListNetworkEndpoints
globalNetworkEndpointGroupsListNetworkEndpoints pGneglneProject_ pGneglneNetworkEndpointGroup_ =
GlobalNetworkEndpointGroupsListNetworkEndpoints'
{ _gneglneReturnPartialSuccess = Nothing
, _gneglneOrderBy = Nothing
, _gneglneProject = pGneglneProject_
, _gneglneNetworkEndpointGroup = pGneglneNetworkEndpointGroup_
, _gneglneFilter = Nothing
, _gneglnePageToken = Nothing
, _gneglneMaxResults = 500
}
| 1,022
|
globalNetworkEndpointGroupsListNetworkEndpoints
:: Text -- ^ 'gneglneProject'
-> Text -- ^ 'gneglneNetworkEndpointGroup'
-> GlobalNetworkEndpointGroupsListNetworkEndpoints
globalNetworkEndpointGroupsListNetworkEndpoints pGneglneProject_ pGneglneNetworkEndpointGroup_ =
GlobalNetworkEndpointGroupsListNetworkEndpoints'
{ _gneglneReturnPartialSuccess = Nothing
, _gneglneOrderBy = Nothing
, _gneglneProject = pGneglneProject_
, _gneglneNetworkEndpointGroup = pGneglneNetworkEndpointGroup_
, _gneglneFilter = Nothing
, _gneglnePageToken = Nothing
, _gneglneMaxResults = 500
}
| 618
|
globalNetworkEndpointGroupsListNetworkEndpoints pGneglneProject_ pGneglneNetworkEndpointGroup_ =
GlobalNetworkEndpointGroupsListNetworkEndpoints'
{ _gneglneReturnPartialSuccess = Nothing
, _gneglneOrderBy = Nothing
, _gneglneProject = pGneglneProject_
, _gneglneNetworkEndpointGroup = pGneglneNetworkEndpointGroup_
, _gneglneFilter = Nothing
, _gneglnePageToken = Nothing
, _gneglneMaxResults = 500
}
| 434
| true
| true
| 0
| 6
| 150
| 87
| 60
| 27
| null | null |
rrnewton/Haskell-CnC
|
Intel/HCilk/parfib_cilk.hs
|
bsd-3-clause
|
--type FibType = Int
----------------------------------------------------------------------------------------------------
parfib0 :: FibType -> HCilk FibType
parfib0 n | n < 2 = return 1
| 187
|
parfib0 :: FibType -> HCilk FibType
parfib0 n | n < 2 = return 1
| 64
|
parfib0 n | n < 2 = return 1
| 28
| true
| true
| 0
| 8
| 20
| 41
| 18
| 23
| null | null |
harrisi/on-being-better
|
list-expansion/Haskell/cis194/01/01-intro.hs
|
cc0-1.0
|
-- The number of hailstone steps needed to reach 1 from a
-- starting number.
hailstoneLen :: Integer -> Integer
hailstoneLen n = intListLength (hailstoneSeq n) - 1
| 164
|
hailstoneLen :: Integer -> Integer
hailstoneLen n = intListLength (hailstoneSeq n) - 1
| 86
|
hailstoneLen n = intListLength (hailstoneSeq n) - 1
| 51
| true
| true
| 0
| 8
| 27
| 33
| 17
| 16
| null | null |
RefactoringTools/HaRe
|
old/testing/evalMonad/A4_TokOut.hs
|
bsd-3-clause
|
closureY = bigFib_2 + 32
| 24
|
closureY = bigFib_2 + 32
| 24
|
closureY = bigFib_2 + 32
| 24
| false
| false
| 3
| 5
| 4
| 15
| 5
| 10
| null | null |
rfranek/duckling
|
Duckling/Time/ES/Rules.hs
|
bsd-3-clause
|
ruleSeason3 :: Rule
ruleSeason3 = Rule
{ name = "season"
, pattern =
[ regex "invierno"
]
, prod = \_ ->
let from = monthDay 12 21
to = monthDay 3 20
in Token Time <$> interval TTime.Open from to
}
| 235
|
ruleSeason3 :: Rule
ruleSeason3 = Rule
{ name = "season"
, pattern =
[ regex "invierno"
]
, prod = \_ ->
let from = monthDay 12 21
to = monthDay 3 20
in Token Time <$> interval TTime.Open from to
}
| 235
|
ruleSeason3 = Rule
{ name = "season"
, pattern =
[ regex "invierno"
]
, prod = \_ ->
let from = monthDay 12 21
to = monthDay 3 20
in Token Time <$> interval TTime.Open from to
}
| 215
| false
| true
| 0
| 13
| 79
| 88
| 45
| 43
| null | null |
Soostone/snaplet-actionlog
|
src/Snap/Snaplet/ActionLog/Resource.hs
|
bsd-3-clause
|
actionLogISplices :: (HasActionLog n, MonadSnap n)
=> Resource -> Splices (I.Splice n)
actionLogISplices r =
splices `mappend` coupledISplices r False mempty
where
splices = do
"actionDetails" MS.## actionDetailsISplice r
"defaultActions" MS.## defaultActionsISplice r
| 308
|
actionLogISplices :: (HasActionLog n, MonadSnap n)
=> Resource -> Splices (I.Splice n)
actionLogISplices r =
splices `mappend` coupledISplices r False mempty
where
splices = do
"actionDetails" MS.## actionDetailsISplice r
"defaultActions" MS.## defaultActionsISplice r
| 308
|
actionLogISplices r =
splices `mappend` coupledISplices r False mempty
where
splices = do
"actionDetails" MS.## actionDetailsISplice r
"defaultActions" MS.## defaultActionsISplice r
| 203
| false
| true
| 0
| 10
| 72
| 89
| 43
| 46
| null | null |
uduki/hsQt
|
Qtc/ClassTypes/Gui.hs
|
bsd-2-clause
|
qCast_QTreeWidget :: Object a -> IO (QTreeWidget ())
qCast_QTreeWidget _qobj
= return (objectCast _qobj)
| 106
|
qCast_QTreeWidget :: Object a -> IO (QTreeWidget ())
qCast_QTreeWidget _qobj
= return (objectCast _qobj)
| 106
|
qCast_QTreeWidget _qobj
= return (objectCast _qobj)
| 53
| false
| true
| 0
| 10
| 15
| 46
| 20
| 26
| null | null |
Rydgel/haskellSDL2Examples
|
src/lesson12.hs
|
gpl-2.0
|
updateSource :: IO (UpdateWorld)
updateSource = createUpdateFunction collectEvents
| 82
|
updateSource :: IO (UpdateWorld)
updateSource = createUpdateFunction collectEvents
| 82
|
updateSource = createUpdateFunction collectEvents
| 49
| false
| true
| 0
| 7
| 7
| 25
| 11
| 14
| null | null |
lukexi/ghc-7.8-arm64
|
compiler/llvmGen/Llvm/Types.hs
|
bsd-3-clause
|
pVarLift (LMNLocalVar s t ) = LMNLocalVar s (pLift t)
| 60
|
pVarLift (LMNLocalVar s t ) = LMNLocalVar s (pLift t)
| 60
|
pVarLift (LMNLocalVar s t ) = LMNLocalVar s (pLift t)
| 60
| false
| false
| 0
| 7
| 16
| 29
| 13
| 16
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.