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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jwiegley/ghc-release | libraries/bytestring/Data/ByteString/Builder/Prim/Internal.hs | gpl-3.0 | eitherB :: BoundedPrim a -> BoundedPrim b -> BoundedPrim (Either a b)
eitherB (BP b1 io1) (BP b2 io2) =
BP (max b1 b2)
(\x op -> case x of Left x1 -> io1 x1 op; Right x2 -> io2 x2 op) | 195 | eitherB :: BoundedPrim a -> BoundedPrim b -> BoundedPrim (Either a b)
eitherB (BP b1 io1) (BP b2 io2) =
BP (max b1 b2)
(\x op -> case x of Left x1 -> io1 x1 op; Right x2 -> io2 x2 op) | 195 | eitherB (BP b1 io1) (BP b2 io2) =
BP (max b1 b2)
(\x op -> case x of Left x1 -> io1 x1 op; Right x2 -> io2 x2 op) | 125 | false | true | 0 | 11 | 53 | 113 | 54 | 59 | null | null |
caiorss/Functional-Programming | haskell/src/OldState.hs | unlicense | execStateLoop stateFunc state =
let (out, new_state) = runState stateFunc state in
new_state:(execStateLoop stateFunc new_state ) | 137 | execStateLoop stateFunc state =
let (out, new_state) = runState stateFunc state in
new_state:(execStateLoop stateFunc new_state ) | 137 | execStateLoop stateFunc state =
let (out, new_state) = runState stateFunc state in
new_state:(execStateLoop stateFunc new_state ) | 137 | false | false | 2 | 9 | 23 | 50 | 22 | 28 | null | null |
intolerable/obj-reader | src/Graphics/OBJ/Parser.hs | bsd-3-clause | parseLine :: Parser Line
parseLine = choice
[ parseThing Vertex (\v -> Line Nothing [v] [] [] []) "v"
, parseThing VertexNormal (\vn -> Line Nothing [] [vn] [] []) "vn"
, parseTexture
, parseMTL
, parseFaceRef
, parseComment
, takeTill isEndOfLine *> endOfLine *> pure mempty ] | 291 | parseLine :: Parser Line
parseLine = choice
[ parseThing Vertex (\v -> Line Nothing [v] [] [] []) "v"
, parseThing VertexNormal (\vn -> Line Nothing [] [vn] [] []) "vn"
, parseTexture
, parseMTL
, parseFaceRef
, parseComment
, takeTill isEndOfLine *> endOfLine *> pure mempty ] | 291 | parseLine = choice
[ parseThing Vertex (\v -> Line Nothing [v] [] [] []) "v"
, parseThing VertexNormal (\vn -> Line Nothing [] [vn] [] []) "vn"
, parseTexture
, parseMTL
, parseFaceRef
, parseComment
, takeTill isEndOfLine *> endOfLine *> pure mempty ] | 266 | false | true | 1 | 11 | 61 | 126 | 64 | 62 | null | null |
schell/lamdu | Lamdu/GUI/ExpressionEdit/HoleEdit/Results.hs | gpl-3.0 | preferFor _ _ = False | 21 | preferFor _ _ = False | 21 | preferFor _ _ = False | 21 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/Resources/GlueJob.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-job.html#cfn-glue-job-description
gjDescription :: Lens' GlueJob (Maybe (Val Text))
gjDescription = lens _glueJobDescription (\s a -> s { _glueJobDescription = a }) | 249 | gjDescription :: Lens' GlueJob (Maybe (Val Text))
gjDescription = lens _glueJobDescription (\s a -> s { _glueJobDescription = a }) | 130 | gjDescription = lens _glueJobDescription (\s a -> s { _glueJobDescription = a }) | 80 | true | true | 0 | 9 | 22 | 52 | 28 | 24 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 4617 = 4616 | 11 | 4617 = 4616 | 11 | 4617 = 4616 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
cornell-pl/HsAdapton | weak-ctrie/tests/MapProperties.hs | bsd-3-clause | pLookup :: Key -> [(Key,Int)] -> Property
pLookup k = M.lookup k `eq` CM.lookup k | 81 | pLookup :: Key -> [(Key,Int)] -> Property
pLookup k = M.lookup k `eq` CM.lookup k | 81 | pLookup k = M.lookup k `eq` CM.lookup k | 39 | false | true | 0 | 9 | 14 | 56 | 27 | 29 | null | null |
kRITZCREEK/dash-haskell | src/Haddock/Sqlite.hs | lgpl-3.0 | table :: String
table = "searchIndex(name, type, path, module)" | 63 | table :: String
table = "searchIndex(name, type, path, module)" | 63 | table = "searchIndex(name, type, path, module)" | 47 | false | true | 0 | 4 | 8 | 11 | 6 | 5 | null | null |
ku-fpg/wakarusa | wakarusa/Control/Monad/Normal.hs | bsd-3-clause | liftNAF :: t a -> APPLICATIVE t a
liftNAF f = APPLICATIVE (N.liftNAF f) | 71 | liftNAF :: t a -> APPLICATIVE t a
liftNAF f = APPLICATIVE (N.liftNAF f) | 71 | liftNAF f = APPLICATIVE (N.liftNAF f) | 37 | false | true | 0 | 8 | 13 | 42 | 18 | 24 | null | null |
sdiehl/ghc | libraries/template-haskell/Language/Haskell/TH/Lib.hs | bsd-3-clause | unboxedTupE :: Quote m => [m Exp] -> m Exp
unboxedTupE es = do { es1 <- sequenceA es; return (UnboxedTupE $ map Just es1)} | 122 | unboxedTupE :: Quote m => [m Exp] -> m Exp
unboxedTupE es = do { es1 <- sequenceA es; return (UnboxedTupE $ map Just es1)} | 122 | unboxedTupE es = do { es1 <- sequenceA es; return (UnboxedTupE $ map Just es1)} | 79 | false | true | 0 | 11 | 24 | 70 | 32 | 38 | null | null |
Peaker/lamdu | test/Tests/Names.hs | gpl-3.0 | --- test inputs:
workArea396 :: IO ()
workArea396 =
Sugar.WorkArea
{ Sugar._waRepl = Stub.repl lamExpr
, Sugar._waPanes =
[ Stub.funcExpr "paneVar" "num" Stub.hole & Sugar.BodyFunction & Stub.node
& Stub.def lamType "def" "def"
& Stub.pane
]
, Sugar._waGlobals = Sugar.Globals (pure []) (pure []) (pure [])
} & testWorkArea assertNoCollisions
where
lamType = Stub.numType ~> Stub.numType
lamExpr =
Sugar.BodyLam Sugar.Lambda
{ Sugar._lamMode = Sugar.NormalBinder
, Sugar._lamApplyLimit = Sugar.UnlimitedFuncApply
, Sugar._lamFunc = Stub.funcExpr "lamVar" "num" Stub.hole
} & Stub.expr | 725 | workArea396 :: IO ()
workArea396 =
Sugar.WorkArea
{ Sugar._waRepl = Stub.repl lamExpr
, Sugar._waPanes =
[ Stub.funcExpr "paneVar" "num" Stub.hole & Sugar.BodyFunction & Stub.node
& Stub.def lamType "def" "def"
& Stub.pane
]
, Sugar._waGlobals = Sugar.Globals (pure []) (pure []) (pure [])
} & testWorkArea assertNoCollisions
where
lamType = Stub.numType ~> Stub.numType
lamExpr =
Sugar.BodyLam Sugar.Lambda
{ Sugar._lamMode = Sugar.NormalBinder
, Sugar._lamApplyLimit = Sugar.UnlimitedFuncApply
, Sugar._lamFunc = Stub.funcExpr "lamVar" "num" Stub.hole
} & Stub.expr | 707 | workArea396 =
Sugar.WorkArea
{ Sugar._waRepl = Stub.repl lamExpr
, Sugar._waPanes =
[ Stub.funcExpr "paneVar" "num" Stub.hole & Sugar.BodyFunction & Stub.node
& Stub.def lamType "def" "def"
& Stub.pane
]
, Sugar._waGlobals = Sugar.Globals (pure []) (pure []) (pure [])
} & testWorkArea assertNoCollisions
where
lamType = Stub.numType ~> Stub.numType
lamExpr =
Sugar.BodyLam Sugar.Lambda
{ Sugar._lamMode = Sugar.NormalBinder
, Sugar._lamApplyLimit = Sugar.UnlimitedFuncApply
, Sugar._lamFunc = Stub.funcExpr "lamVar" "num" Stub.hole
} & Stub.expr | 686 | true | true | 5 | 13 | 217 | 212 | 109 | 103 | null | null |
maxking/cs583-project | src/Logger.hs | gpl-3.0 | defaultLogReader :: IO B.ByteString
defaultLogReader = readLogs defaultLogPath | 78 | defaultLogReader :: IO B.ByteString
defaultLogReader = readLogs defaultLogPath | 78 | defaultLogReader = readLogs defaultLogPath | 42 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
Shimuuar/data-folds | Data/Folds/Class.hs | bsd-3-clause | runFold :: (PureFold fold, Sample v, Elem v ~ a)
=> fold a b -> v -> b
runFold fold xs
= extractFold $ feedMany (asDataSample xs) fold | 144 | runFold :: (PureFold fold, Sample v, Elem v ~ a)
=> fold a b -> v -> b
runFold fold xs
= extractFold $ feedMany (asDataSample xs) fold | 144 | runFold fold xs
= extractFold $ feedMany (asDataSample xs) fold | 65 | false | true | 0 | 8 | 37 | 74 | 35 | 39 | null | null |
kosmikus/cabal | cabal-install/Main.hs | bsd-3-clause | updateAction :: Flag Verbosity -> [String] -> GlobalFlags -> IO ()
updateAction verbosityFlag extraArgs globalFlags = do
unless (null extraArgs) $
die $ "'update' doesn't take any extra arguments: " ++ unwords extraArgs
let verbosity = fromFlag verbosityFlag
(_useSandbox, config) <- loadConfigOrSandboxConfig verbosity
(globalFlags { globalRequireSandbox = Flag False })
NoFlag
let globalFlags' = savedGlobalFlags config `mappend` globalFlags
update verbosity (globalRepos globalFlags') | 555 | updateAction :: Flag Verbosity -> [String] -> GlobalFlags -> IO ()
updateAction verbosityFlag extraArgs globalFlags = do
unless (null extraArgs) $
die $ "'update' doesn't take any extra arguments: " ++ unwords extraArgs
let verbosity = fromFlag verbosityFlag
(_useSandbox, config) <- loadConfigOrSandboxConfig verbosity
(globalFlags { globalRequireSandbox = Flag False })
NoFlag
let globalFlags' = savedGlobalFlags config `mappend` globalFlags
update verbosity (globalRepos globalFlags') | 555 | updateAction verbosityFlag extraArgs globalFlags = do
unless (null extraArgs) $
die $ "'update' doesn't take any extra arguments: " ++ unwords extraArgs
let verbosity = fromFlag verbosityFlag
(_useSandbox, config) <- loadConfigOrSandboxConfig verbosity
(globalFlags { globalRequireSandbox = Flag False })
NoFlag
let globalFlags' = savedGlobalFlags config `mappend` globalFlags
update verbosity (globalRepos globalFlags') | 488 | false | true | 0 | 12 | 129 | 146 | 70 | 76 | null | null |
shlevy/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | ppr_expr (HsConLikeOut c) = pprPrefixOcc c | 42 | ppr_expr (HsConLikeOut c) = pprPrefixOcc c | 42 | ppr_expr (HsConLikeOut c) = pprPrefixOcc c | 42 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
leshchevds/ganeti | src/Ganeti/Runtime.hs | bsd-2-clause | -- | Computes the group/user maps.
getEnts :: (FromString e) => ResultT e IO RuntimeEnts
getEnts = do
let userOf = liftM userID . liftIO . getUserEntryForName . daemonUser
let groupOf = liftM groupID . liftIO . getGroupEntryForName . daemonGroup
let allDaemons = [minBound..maxBound] :: [GanetiDaemon]
users <- mapM userOf allDaemons
groups <- mapM groupOf allGroups
return $ RuntimeEnts
(M.fromList $ zip allDaemons users)
(M.fromList $ zip users (map daemonUser allDaemons))
(M.fromList $ zip allGroups groups)
(M.fromList $ zip groups (map daemonGroup allGroups))
-- | Checks whether a daemon runs as the right user. | 680 | getEnts :: (FromString e) => ResultT e IO RuntimeEnts
getEnts = do
let userOf = liftM userID . liftIO . getUserEntryForName . daemonUser
let groupOf = liftM groupID . liftIO . getGroupEntryForName . daemonGroup
let allDaemons = [minBound..maxBound] :: [GanetiDaemon]
users <- mapM userOf allDaemons
groups <- mapM groupOf allGroups
return $ RuntimeEnts
(M.fromList $ zip allDaemons users)
(M.fromList $ zip users (map daemonUser allDaemons))
(M.fromList $ zip allGroups groups)
(M.fromList $ zip groups (map daemonGroup allGroups))
-- | Checks whether a daemon runs as the right user. | 645 | getEnts = do
let userOf = liftM userID . liftIO . getUserEntryForName . daemonUser
let groupOf = liftM groupID . liftIO . getGroupEntryForName . daemonGroup
let allDaemons = [minBound..maxBound] :: [GanetiDaemon]
users <- mapM userOf allDaemons
groups <- mapM groupOf allGroups
return $ RuntimeEnts
(M.fromList $ zip allDaemons users)
(M.fromList $ zip users (map daemonUser allDaemons))
(M.fromList $ zip allGroups groups)
(M.fromList $ zip groups (map daemonGroup allGroups))
-- | Checks whether a daemon runs as the right user. | 591 | true | true | 9 | 11 | 154 | 203 | 102 | 101 | null | null |
sedillard/Vec | examples/Examples.hs | bsd-2-clause | -- fixes type of v3' to Vec3 Float
t1 = normalize (v3-v3'') | 59 | t1 = normalize (v3-v3'') | 24 | t1 = normalize (v3-v3'') | 24 | true | false | 1 | 7 | 11 | 20 | 9 | 11 | null | null |
Airtnp/Freshman_Simple_Haskell_Lib | Intro/hello-world.hs | mit | xLens_PosR :: Functor f => (Double -> f Double) -> PosR -> f PosR
-- Or xLens_PosR :: Lens PosR Double
xLens_PosR f p = fmap (\x' -> setX_PosR x' p) $ f (getX_PosR p) | 166 | xLens_PosR :: Functor f => (Double -> f Double) -> PosR -> f PosR
xLens_PosR f p = fmap (\x' -> setX_PosR x' p) $ f (getX_PosR p) | 129 | xLens_PosR f p = fmap (\x' -> setX_PosR x' p) $ f (getX_PosR p) | 63 | true | true | 0 | 10 | 34 | 78 | 37 | 41 | null | null |
sdiehl/ghc | compiler/ghci/ByteCodeGen.hs | bsd-3-clause | schemeE d s p e@(AnnLit lit) = returnUnboxedAtom d s p e (typeArgRep (literalType lit)) | 91 | schemeE d s p e@(AnnLit lit) = returnUnboxedAtom d s p e (typeArgRep (literalType lit)) | 91 | schemeE d s p e@(AnnLit lit) = returnUnboxedAtom d s p e (typeArgRep (literalType lit)) | 91 | false | false | 1 | 9 | 18 | 54 | 23 | 31 | null | null |
kelnage/tamarin-prover | lib/theory/src/Theory/Proof.hs | gpl-3.0 | boundDiffProofDepth :: Int -> DiffProof a -> DiffProof a
boundDiffProofDepth bound =
go bound
where
go n (LNode ps@(DiffProofStep _ info) cs)
| 0 < n = LNode ps $ M.map (go (pred n)) cs
| otherwise = diffSorry (Just $ "bound " ++ show bound ++ " hit") info
-- | Fold a proof. | 329 | boundDiffProofDepth :: Int -> DiffProof a -> DiffProof a
boundDiffProofDepth bound =
go bound
where
go n (LNode ps@(DiffProofStep _ info) cs)
| 0 < n = LNode ps $ M.map (go (pred n)) cs
| otherwise = diffSorry (Just $ "bound " ++ show bound ++ " hit") info
-- | Fold a proof. | 329 | boundDiffProofDepth bound =
go bound
where
go n (LNode ps@(DiffProofStep _ info) cs)
| 0 < n = LNode ps $ M.map (go (pred n)) cs
| otherwise = diffSorry (Just $ "bound " ++ show bound ++ " hit") info
-- | Fold a proof. | 272 | false | true | 1 | 11 | 108 | 130 | 62 | 68 | null | null |
kim/amazonka | amazonka-dynamodb/gen/Network/AWS/DynamoDB/DeleteItem.hs | mpl-2.0 | -- | 'DeleteItemResponse' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'dirAttributes' @::@ 'HashMap' 'Text' 'AttributeValue'
--
-- * 'dirConsumedCapacity' @::@ 'Maybe' 'ConsumedCapacity'
--
-- * 'dirItemCollectionMetrics' @::@ 'Maybe' 'ItemCollectionMetrics'
--
deleteItemResponse :: DeleteItemResponse
deleteItemResponse = DeleteItemResponse
{ _dirAttributes = mempty
, _dirConsumedCapacity = Nothing
, _dirItemCollectionMetrics = Nothing
} | 512 | deleteItemResponse :: DeleteItemResponse
deleteItemResponse = DeleteItemResponse
{ _dirAttributes = mempty
, _dirConsumedCapacity = Nothing
, _dirItemCollectionMetrics = Nothing
} | 211 | deleteItemResponse = DeleteItemResponse
{ _dirAttributes = mempty
, _dirConsumedCapacity = Nothing
, _dirItemCollectionMetrics = Nothing
} | 170 | true | true | 0 | 7 | 86 | 51 | 31 | 20 | null | null |
prasmussen/magmod | Magento/Controller.hs | mit | writeCtrlPhpIfMissing :: ModuleInfo -> FilePath -> String -> String -> IO ()
writeCtrlPhpIfMissing info path scope controllerName = do
exists <- doesFileExist path
when (not exists) $ writeCtrlPhp info path scope controllerName | 235 | writeCtrlPhpIfMissing :: ModuleInfo -> FilePath -> String -> String -> IO ()
writeCtrlPhpIfMissing info path scope controllerName = do
exists <- doesFileExist path
when (not exists) $ writeCtrlPhp info path scope controllerName | 235 | writeCtrlPhpIfMissing info path scope controllerName = do
exists <- doesFileExist path
when (not exists) $ writeCtrlPhp info path scope controllerName | 158 | false | true | 0 | 10 | 39 | 76 | 35 | 41 | null | null |
harendra-kumar/asyncly | src/Streamly/Internal/Memory/Array.hs | bsd-3-clause | streamFold :: (MonadIO m, Storable a) => (SerialT m a -> m b) -> Array a -> m b
streamFold f arr = f (toStream arr) | 115 | streamFold :: (MonadIO m, Storable a) => (SerialT m a -> m b) -> Array a -> m b
streamFold f arr = f (toStream arr) | 115 | streamFold f arr = f (toStream arr) | 35 | false | true | 0 | 9 | 25 | 69 | 33 | 36 | null | null |
vu3rdd/functorrent | src/FuncTorrent/Peer.hs | gpl-3.0 | handlePeerMsgs :: Peer -> String -> Metainfo -> PieceMap -> Bool -> FS.MsgChannel -> IO ()
handlePeerMsgs p peerId m pieceMap isClient c = do
h <- connectToPeer p
doHandshake isClient h p (infoHash m) peerId
let pstate = toPeerState h p False False True True
_ <- runStateT (msgLoop pieceMap c) pstate
return () | 321 | handlePeerMsgs :: Peer -> String -> Metainfo -> PieceMap -> Bool -> FS.MsgChannel -> IO ()
handlePeerMsgs p peerId m pieceMap isClient c = do
h <- connectToPeer p
doHandshake isClient h p (infoHash m) peerId
let pstate = toPeerState h p False False True True
_ <- runStateT (msgLoop pieceMap c) pstate
return () | 321 | handlePeerMsgs p peerId m pieceMap isClient c = do
h <- connectToPeer p
doHandshake isClient h p (infoHash m) peerId
let pstate = toPeerState h p False False True True
_ <- runStateT (msgLoop pieceMap c) pstate
return () | 230 | false | true | 0 | 13 | 64 | 140 | 63 | 77 | null | null |
stevedonnelly/haskell | code/Geometry/Vector2d.hs | mit | toAngle = \v -> let
x = (fromRational (Vector.element v 0))
y = (fromRational (Vector.element v 1))
in (toRational (atan2 y x)) | 139 | toAngle = \v -> let
x = (fromRational (Vector.element v 0))
y = (fromRational (Vector.element v 1))
in (toRational (atan2 y x)) | 139 | toAngle = \v -> let
x = (fromRational (Vector.element v 0))
y = (fromRational (Vector.element v 1))
in (toRational (atan2 y x)) | 139 | false | false | 0 | 14 | 33 | 73 | 37 | 36 | null | null |
ambiata/mismi | mismi-autoscaling/test/Test/IO/Mismi/Autoscaling/Commands.hs | bsd-3-clause | prop_conf_delete = once . testConf $ \c -> do
conf <- conf' c
deleteConfiguration c
createConfiguration conf
deleteConfiguration c >> deleteConfiguration c
r <- runEitherT $ describeConfiguration c
pure $ r === Right Nothing | 236 | prop_conf_delete = once . testConf $ \c -> do
conf <- conf' c
deleteConfiguration c
createConfiguration conf
deleteConfiguration c >> deleteConfiguration c
r <- runEitherT $ describeConfiguration c
pure $ r === Right Nothing | 236 | prop_conf_delete = once . testConf $ \c -> do
conf <- conf' c
deleteConfiguration c
createConfiguration conf
deleteConfiguration c >> deleteConfiguration c
r <- runEitherT $ describeConfiguration c
pure $ r === Right Nothing | 236 | false | false | 0 | 11 | 45 | 82 | 35 | 47 | null | null |
nkaretnikov/titlecase | tests/Test/Unit.hs | bsd-3-clause | testTitlecase, testFirst, testLast, testIgnored :: Text -> Assertion
testTitlecase t = titlecase (toLower t) @?= Titlecase t | 124 | testTitlecase, testFirst, testLast, testIgnored :: Text -> Assertion
testTitlecase t = titlecase (toLower t) @?= Titlecase t | 124 | testTitlecase t = titlecase (toLower t) @?= Titlecase t | 55 | false | true | 0 | 8 | 16 | 40 | 22 | 18 | null | null |
vargax/ejemplos | haskell/nim.hs | gpl-2.0 | estrategia :: Integral a => [a] -> [a]
estrategia [] = [] | 57 | estrategia :: Integral a => [a] -> [a]
estrategia [] = [] | 57 | estrategia [] = [] | 18 | false | true | 0 | 7 | 11 | 35 | 18 | 17 | null | null |
ntc2/cryptol | src/Cryptol/TypeCheck/Solver/Numeric/SMT.hs | bsd-3-clause | cryMustEqualV :: SMT.Solver -> Name -> Name -> IO Bool
cryMustEqualV solver x y =
checkUnsat solver $
SMT.not $
SMT.or (SMT.not (fin x) `SMT.and` SMT.not (fin y))
(fin x `SMT.and` fin y `SMT.and` SMT.eq (var x) (var y))
where fin a = SMT.const (smtFinName a)
var a = SMT.const (smtName a)
-- | Try to find a linear relation between the two variables, based
-- on two observed data points.
-- NOTE: The variable being defined is the SECOND name. | 494 | cryMustEqualV :: SMT.Solver -> Name -> Name -> IO Bool
cryMustEqualV solver x y =
checkUnsat solver $
SMT.not $
SMT.or (SMT.not (fin x) `SMT.and` SMT.not (fin y))
(fin x `SMT.and` fin y `SMT.and` SMT.eq (var x) (var y))
where fin a = SMT.const (smtFinName a)
var a = SMT.const (smtName a)
-- | Try to find a linear relation between the two variables, based
-- on two observed data points.
-- NOTE: The variable being defined is the SECOND name. | 494 | cryMustEqualV solver x y =
checkUnsat solver $
SMT.not $
SMT.or (SMT.not (fin x) `SMT.and` SMT.not (fin y))
(fin x `SMT.and` fin y `SMT.and` SMT.eq (var x) (var y))
where fin a = SMT.const (smtFinName a)
var a = SMT.const (smtName a)
-- | Try to find a linear relation between the two variables, based
-- on two observed data points.
-- NOTE: The variable being defined is the SECOND name. | 439 | false | true | 0 | 11 | 130 | 176 | 88 | 88 | null | null |
uuhan/Idris-dev | src/Idris/Core/CaseTree.hs | bsd-3-clause | stripLambdas :: CaseDef -> CaseDef
stripLambdas (CaseDef ns (STerm (Bind x (Lam _ _) sc)) tm)
= stripLambdas (CaseDef (ns ++ [x]) (STerm (instantiate (P Bound x Erased) sc)) tm) | 181 | stripLambdas :: CaseDef -> CaseDef
stripLambdas (CaseDef ns (STerm (Bind x (Lam _ _) sc)) tm)
= stripLambdas (CaseDef (ns ++ [x]) (STerm (instantiate (P Bound x Erased) sc)) tm) | 181 | stripLambdas (CaseDef ns (STerm (Bind x (Lam _ _) sc)) tm)
= stripLambdas (CaseDef (ns ++ [x]) (STerm (instantiate (P Bound x Erased) sc)) tm) | 146 | false | true | 0 | 13 | 33 | 99 | 50 | 49 | null | null |
chadbrewbaker/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | prop_readBraced6 = isOk readBraced "{foo,bar,$((${var}))}" | 58 | prop_readBraced6 = isOk readBraced "{foo,bar,$((${var}))}" | 58 | prop_readBraced6 = isOk readBraced "{foo,bar,$((${var}))}" | 58 | false | false | 1 | 5 | 4 | 15 | 5 | 10 | null | null |
noteed/syntactical | tests/Permutations.hs | bsd-3-clause | --
main :: IO ()
main = defaultMain
[ testYard
] | 53 | main :: IO ()
main = defaultMain
[ testYard
] | 49 | main = defaultMain
[ testYard
] | 35 | true | true | 0 | 6 | 15 | 23 | 12 | 11 | null | null |
akc/gfscript | HOPS/GF/CFrac/Hankel.hs | bsd-3-clause | jacobi0 :: Vector Rat -> Maybe (Vector Rat)
jacobi0 = fmap fst . jacobi | 71 | jacobi0 :: Vector Rat -> Maybe (Vector Rat)
jacobi0 = fmap fst . jacobi | 71 | jacobi0 = fmap fst . jacobi | 27 | false | true | 0 | 8 | 13 | 34 | 16 | 18 | null | null |
AKST/scheme.llvm | src/Scheme/Parser.hs | mit | programParser :: Parser Program
programParser = Program <$> parser
where parser = ignored *> expressions <* (ignored >> endOfInput)
expressions = irExpression `sepBy` ignored | 184 | programParser :: Parser Program
programParser = Program <$> parser
where parser = ignored *> expressions <* (ignored >> endOfInput)
expressions = irExpression `sepBy` ignored | 184 | programParser = Program <$> parser
where parser = ignored *> expressions <* (ignored >> endOfInput)
expressions = irExpression `sepBy` ignored | 152 | false | true | 1 | 9 | 33 | 54 | 28 | 26 | null | null |
ekmett/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxLANGUAGE_HEBREW :: Int
wxLANGUAGE_HEBREW = 98 | 47 | wxLANGUAGE_HEBREW :: Int
wxLANGUAGE_HEBREW = 98 | 47 | wxLANGUAGE_HEBREW = 98 | 22 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
patrickt/bracer | Language/Bracer/Backends/C/Parser/Literals.hs | mit | integerSuffix :: CParser (Term Suffix)
integerSuffix = u <|> l <|> pure iNoSuffix <?> "integer suffix"
where
u = iUnsignedSuffix <$> (oneOf "uU" *> integerSuffix)
l = iLongSuffix <$> (oneOf "lL" *> integerSuffix) | 235 | integerSuffix :: CParser (Term Suffix)
integerSuffix = u <|> l <|> pure iNoSuffix <?> "integer suffix"
where
u = iUnsignedSuffix <$> (oneOf "uU" *> integerSuffix)
l = iLongSuffix <$> (oneOf "lL" *> integerSuffix) | 233 | integerSuffix = u <|> l <|> pure iNoSuffix <?> "integer suffix"
where
u = iUnsignedSuffix <$> (oneOf "uU" *> integerSuffix)
l = iLongSuffix <$> (oneOf "lL" *> integerSuffix) | 194 | false | true | 7 | 9 | 55 | 92 | 40 | 52 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/RTCTrackEvent.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/RTCTrackEvent Mozilla RTCTrackEvent documentation>
newRTCTrackEvent ::
(MonadDOM m, ToJSString type') =>
type' -> RTCTrackEventInit -> m RTCTrackEvent
newRTCTrackEvent type' eventInitDict
= liftDOM
(RTCTrackEvent <$>
new (jsg "RTCTrackEvent") [toJSVal type', toJSVal eventInitDict]) | 391 | newRTCTrackEvent ::
(MonadDOM m, ToJSString type') =>
type' -> RTCTrackEventInit -> m RTCTrackEvent
newRTCTrackEvent type' eventInitDict
= liftDOM
(RTCTrackEvent <$>
new (jsg "RTCTrackEvent") [toJSVal type', toJSVal eventInitDict]) | 284 | newRTCTrackEvent type' eventInitDict
= liftDOM
(RTCTrackEvent <$>
new (jsg "RTCTrackEvent") [toJSVal type', toJSVal eventInitDict]) | 148 | true | true | 0 | 10 | 86 | 76 | 38 | 38 | null | null |
sleexyz/untyped | src/Lib.hs | bsd-3-clause | ctxLookup :: Context -> Name -> Maybe Value
ctxLookup (Context global bound _) name = Map.lookup name global <|> Map.lookup name bound | 134 | ctxLookup :: Context -> Name -> Maybe Value
ctxLookup (Context global bound _) name = Map.lookup name global <|> Map.lookup name bound | 134 | ctxLookup (Context global bound _) name = Map.lookup name global <|> Map.lookup name bound | 90 | false | true | 0 | 7 | 21 | 55 | 26 | 29 | null | null |
ocramz/petsc-hs | src/Numerical/PETSc/Internal/Sparse.hs | gpl-3.0 | vv0 = V.fromList [v0, v0] | 25 | vv0 = V.fromList [v0, v0] | 25 | vv0 = V.fromList [v0, v0] | 25 | false | false | 1 | 5 | 4 | 20 | 9 | 11 | null | null |
dermesser/False | FalseLib/Parse.hs | mit | falseParse p a@(c:cs)
| isNumber c = let l = length $ takeWhile isNumber a in
(falseParse (p+l) . dropWhile isNumber $ a) >>= \r -> Right $ (FNum . read . takeWhile isNumber $ a, p) : r
| c == '\'' = (falseParse (p+2) . tail $ cs) >>= \r -> let c' = head cs in
Right $ (FChar c', p) : r
| c `elem` "$%\\@ø" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'$' -> FStackOp FDUP
'%' -> FStackOp FDROP
'\\' -> FStackOp FSWAP
'@' -> FStackOp FROT
'\248' -> FStackOp FPICK -- This is AltGr+o (\248) (Unicode U+00F8) -> ø
, p) : r
| c `elem` "+-*/_&|~" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'+' -> FArithm FPlus
'-' -> FArithm FMinus
'*' -> FArithm FMult
'/' -> FArithm FDivide
'_' -> FArithm FNegate
'&' -> FArithm FAnd
'|' -> FArithm FOr
'~' -> FArithm FNot
, p) : r
| c `elem` ">=" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'>' -> FCompare FGreater
'=' -> FCompare FEqual
, p) : r
| c == '[' = let lambdacode = getLambda a
l = length lambdacode
rest = drop (2 + length lambdacode) a
in falseParse (p+1) lambdacode >>= \lc -> falseParse (p+l+2) rest >>= \r -> Right $ (FControl (FLambda lc), p) : r
| c `elem` "!?#" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'!' -> FControl FExec
'?' -> FControl FIf
'#' -> FControl FWhile
, p) : r
| isAsciiLower c = falseParse (p+1) cs >>= \r -> Right $ (FVariableOp $ FVarRef c,p) : r
| c `elem` ";:" = falseParse (p+1) cs >>= \r -> Right $ (case c of
';' -> FVariableOp FGet
':' -> FVariableOp FPut
, p) : r
| c `elem` "^,.ß" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'^' -> FIOOp FRead
',' -> FIOOp FWrite
'.' -> FIOOp FPrintInt
'ß' -> FIOOp FFlush
, p) : r
| c == '"' = let str = takeWhile (/='"') cs
rest = drop (2 + length str) a
l = length str
in falseParse (p+l+2)rest >>= \r -> Right $ (FIOOp (FWriteString str),p) : r
| c == '{' = let c = dropComment a
l = (length a) - (length c)
in falseParse (p+l) c
| otherwise = falseParse (p+1) cs | 4,592 | falseParse p a@(c:cs)
| isNumber c = let l = length $ takeWhile isNumber a in
(falseParse (p+l) . dropWhile isNumber $ a) >>= \r -> Right $ (FNum . read . takeWhile isNumber $ a, p) : r
| c == '\'' = (falseParse (p+2) . tail $ cs) >>= \r -> let c' = head cs in
Right $ (FChar c', p) : r
| c `elem` "$%\\@ø" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'$' -> FStackOp FDUP
'%' -> FStackOp FDROP
'\\' -> FStackOp FSWAP
'@' -> FStackOp FROT
'\248' -> FStackOp FPICK -- This is AltGr+o (\248) (Unicode U+00F8) -> ø
, p) : r
| c `elem` "+-*/_&|~" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'+' -> FArithm FPlus
'-' -> FArithm FMinus
'*' -> FArithm FMult
'/' -> FArithm FDivide
'_' -> FArithm FNegate
'&' -> FArithm FAnd
'|' -> FArithm FOr
'~' -> FArithm FNot
, p) : r
| c `elem` ">=" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'>' -> FCompare FGreater
'=' -> FCompare FEqual
, p) : r
| c == '[' = let lambdacode = getLambda a
l = length lambdacode
rest = drop (2 + length lambdacode) a
in falseParse (p+1) lambdacode >>= \lc -> falseParse (p+l+2) rest >>= \r -> Right $ (FControl (FLambda lc), p) : r
| c `elem` "!?#" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'!' -> FControl FExec
'?' -> FControl FIf
'#' -> FControl FWhile
, p) : r
| isAsciiLower c = falseParse (p+1) cs >>= \r -> Right $ (FVariableOp $ FVarRef c,p) : r
| c `elem` ";:" = falseParse (p+1) cs >>= \r -> Right $ (case c of
';' -> FVariableOp FGet
':' -> FVariableOp FPut
, p) : r
| c `elem` "^,.ß" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'^' -> FIOOp FRead
',' -> FIOOp FWrite
'.' -> FIOOp FPrintInt
'ß' -> FIOOp FFlush
, p) : r
| c == '"' = let str = takeWhile (/='"') cs
rest = drop (2 + length str) a
l = length str
in falseParse (p+l+2)rest >>= \r -> Right $ (FIOOp (FWriteString str),p) : r
| c == '{' = let c = dropComment a
l = (length a) - (length c)
in falseParse (p+l) c
| otherwise = falseParse (p+1) cs | 4,592 | falseParse p a@(c:cs)
| isNumber c = let l = length $ takeWhile isNumber a in
(falseParse (p+l) . dropWhile isNumber $ a) >>= \r -> Right $ (FNum . read . takeWhile isNumber $ a, p) : r
| c == '\'' = (falseParse (p+2) . tail $ cs) >>= \r -> let c' = head cs in
Right $ (FChar c', p) : r
| c `elem` "$%\\@ø" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'$' -> FStackOp FDUP
'%' -> FStackOp FDROP
'\\' -> FStackOp FSWAP
'@' -> FStackOp FROT
'\248' -> FStackOp FPICK -- This is AltGr+o (\248) (Unicode U+00F8) -> ø
, p) : r
| c `elem` "+-*/_&|~" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'+' -> FArithm FPlus
'-' -> FArithm FMinus
'*' -> FArithm FMult
'/' -> FArithm FDivide
'_' -> FArithm FNegate
'&' -> FArithm FAnd
'|' -> FArithm FOr
'~' -> FArithm FNot
, p) : r
| c `elem` ">=" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'>' -> FCompare FGreater
'=' -> FCompare FEqual
, p) : r
| c == '[' = let lambdacode = getLambda a
l = length lambdacode
rest = drop (2 + length lambdacode) a
in falseParse (p+1) lambdacode >>= \lc -> falseParse (p+l+2) rest >>= \r -> Right $ (FControl (FLambda lc), p) : r
| c `elem` "!?#" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'!' -> FControl FExec
'?' -> FControl FIf
'#' -> FControl FWhile
, p) : r
| isAsciiLower c = falseParse (p+1) cs >>= \r -> Right $ (FVariableOp $ FVarRef c,p) : r
| c `elem` ";:" = falseParse (p+1) cs >>= \r -> Right $ (case c of
';' -> FVariableOp FGet
':' -> FVariableOp FPut
, p) : r
| c `elem` "^,.ß" = falseParse (p+1) cs >>= \r -> Right $ (case c of
'^' -> FIOOp FRead
',' -> FIOOp FWrite
'.' -> FIOOp FPrintInt
'ß' -> FIOOp FFlush
, p) : r
| c == '"' = let str = takeWhile (/='"') cs
rest = drop (2 + length str) a
l = length str
in falseParse (p+l+2)rest >>= \r -> Right $ (FIOOp (FWriteString str),p) : r
| c == '{' = let c = dropComment a
l = (length a) - (length c)
in falseParse (p+l) c
| otherwise = falseParse (p+1) cs | 4,592 | false | false | 26 | 50 | 3,087 | 1,098 | 546 | 552 | null | null |
np/lens | src/Control/Lens/Internal/Zipper.hs | bsd-3-clause | -- | Restore ourselves to a previously recorded position.
--
-- This *assumes* that nothing has been done in the meantime to affect the existence of anything on the entire path.
--
-- Motions leftward or rightward are clamped, but all traversals included on the 'Tape' are assumed to be non-empty.
--
-- Violate these assumptions at your own risk!
unsafelyRestoreTape :: Tape (h :> a) -> Zipped h a -> h :> a
unsafelyRestoreTape (Tape h n) = unsafelyRestoreTrack h >>> tugs rightward n | 485 | unsafelyRestoreTape :: Tape (h :> a) -> Zipped h a -> h :> a
unsafelyRestoreTape (Tape h n) = unsafelyRestoreTrack h >>> tugs rightward n | 137 | unsafelyRestoreTape (Tape h n) = unsafelyRestoreTrack h >>> tugs rightward n | 76 | true | true | 0 | 8 | 84 | 68 | 36 | 32 | null | null |
travitch/foreign-inference | src/Foreign/Inference/Analysis/Finalize.hs | bsd-3-clause | addArgWithWitness :: Argument -> Instruction -> String -> FinalizerInfo -> FinalizerInfo
addArgWithWitness a i reason (FinalizerInfo s m) =
let w = Witness i reason
in FinalizerInfo { _finalizedOrNull = HS.insert a s
, _finalizedWitnesses = HM.insertWith S.union a (S.singleton w) m
} | 326 | addArgWithWitness :: Argument -> Instruction -> String -> FinalizerInfo -> FinalizerInfo
addArgWithWitness a i reason (FinalizerInfo s m) =
let w = Witness i reason
in FinalizerInfo { _finalizedOrNull = HS.insert a s
, _finalizedWitnesses = HM.insertWith S.union a (S.singleton w) m
} | 326 | addArgWithWitness a i reason (FinalizerInfo s m) =
let w = Witness i reason
in FinalizerInfo { _finalizedOrNull = HS.insert a s
, _finalizedWitnesses = HM.insertWith S.union a (S.singleton w) m
} | 237 | false | true | 0 | 12 | 84 | 102 | 51 | 51 | null | null |
myfreeweb/gitson | benchmark/GitsonBench.hs | unlicense | benchmarks ∷ [Benchmark]
benchmarks = [
bench "transaction with 1 write" $ nfIO transactOneWrite
, bench "transaction with 4 writes with incrementing ids" $ nfIO transactNextWrites
, bench "1 read" $ nfIO $ readThing
, bench "1 read by name" $ nfIO $ readByName ] | 273 | benchmarks ∷ [Benchmark]
benchmarks = [
bench "transaction with 1 write" $ nfIO transactOneWrite
, bench "transaction with 4 writes with incrementing ids" $ nfIO transactNextWrites
, bench "1 read" $ nfIO $ readThing
, bench "1 read by name" $ nfIO $ readByName ] | 273 | benchmarks = [
bench "transaction with 1 write" $ nfIO transactOneWrite
, bench "transaction with 4 writes with incrementing ids" $ nfIO transactNextWrites
, bench "1 read" $ nfIO $ readThing
, bench "1 read by name" $ nfIO $ readByName ] | 248 | false | true | 0 | 8 | 54 | 68 | 34 | 34 | null | null |
rfranek/duckling | Duckling/Rules/ES.hs | bsd-3-clause | rules (This Numeral) = Numeral.rules | 36 | rules (This Numeral) = Numeral.rules | 36 | rules (This Numeral) = Numeral.rules | 36 | false | false | 0 | 7 | 4 | 17 | 8 | 9 | null | null |
acowley/ghc | compiler/prelude/THNames.hs | bsd-3-clause | wildPName = libFun (fsLit "wildP") wildPIdKey | 47 | wildPName = libFun (fsLit "wildP") wildPIdKey | 47 | wildPName = libFun (fsLit "wildP") wildPIdKey | 47 | false | false | 0 | 7 | 7 | 17 | 8 | 9 | null | null |
jmillikan/gtk2hs-puyopuyo | src/Game/PuyoPuyo.hs | bsd-2-clause | toCellList :: Grid -> [((Int, Int), Maybe PuyoColor)]
toCellList g = map (flipY *** (^? (traverse . _2))) $ assocs g
where flipY (y,x) = (gridHeight - y - 1,x) | 163 | toCellList :: Grid -> [((Int, Int), Maybe PuyoColor)]
toCellList g = map (flipY *** (^? (traverse . _2))) $ assocs g
where flipY (y,x) = (gridHeight - y - 1,x) | 163 | toCellList g = map (flipY *** (^? (traverse . _2))) $ assocs g
where flipY (y,x) = (gridHeight - y - 1,x) | 109 | false | true | 0 | 11 | 33 | 94 | 52 | 42 | null | null |
thefalconfeat/markdown | Text/Markdown/Inline.hs | bsd-3-clause | combine (InlineCode x:rest) = InlineCode x : combine rest | 57 | combine (InlineCode x:rest) = InlineCode x : combine rest | 57 | combine (InlineCode x:rest) = InlineCode x : combine rest | 57 | false | false | 0 | 7 | 8 | 30 | 13 | 17 | null | null |
sheyll/b9-vm-image-builder | src/lib/B9/DiskImages.hs | mit | -- | Share a 'QCow2' image with 'Ext4' fs
shareCOWImage :: FilePath -> SharedImageName -> FilePath -> ImageTarget
shareCOWImage srcFilename (SharedImageName destName) mountPoint =
ImageTarget
(Share destName QCow2 KeepSize)
(CopyOnWrite (Image srcFilename QCow2 Ext4))
(MountPoint mountPoint) | 306 | shareCOWImage :: FilePath -> SharedImageName -> FilePath -> ImageTarget
shareCOWImage srcFilename (SharedImageName destName) mountPoint =
ImageTarget
(Share destName QCow2 KeepSize)
(CopyOnWrite (Image srcFilename QCow2 Ext4))
(MountPoint mountPoint) | 264 | shareCOWImage srcFilename (SharedImageName destName) mountPoint =
ImageTarget
(Share destName QCow2 KeepSize)
(CopyOnWrite (Image srcFilename QCow2 Ext4))
(MountPoint mountPoint) | 192 | true | true | 0 | 8 | 49 | 78 | 38 | 40 | null | null |
exercism/xhaskell | exercises/practice/list-ops/src/ListOps.hs | mit | concat :: [[a]] -> [a]
concat xss = error "You need to implement this function." | 80 | concat :: [[a]] -> [a]
concat xss = error "You need to implement this function." | 80 | concat xss = error "You need to implement this function." | 57 | false | true | 0 | 7 | 14 | 30 | 16 | 14 | null | null |
kolmodin/cabal | cabal-install/Distribution/Client/SetupWrapper.hs | bsd-3-clause | setupWrapper :: Verbosity
-> SetupScriptOptions
-> Maybe PackageDescription
-> CommandUI flags
-> (Version -> flags)
-> [String]
-> IO ()
setupWrapper verbosity options mpkg cmd flags extraArgs = do
pkg <- maybe getPkg return mpkg
let setupMethod = determineSetupMethod options' buildType'
options' = options {
useCabalVersion = intersectVersionRanges
(useCabalVersion options)
(orLaterVersion (specVersion pkg))
}
buildType' = fromMaybe Custom (buildType pkg)
mkArgs cabalLibVersion = commandName cmd
: commandShowOptions cmd (flags cabalLibVersion)
++ extraArgs
checkBuildType buildType'
setupMethod verbosity options' (packageId pkg) buildType' mkArgs
where
getPkg = tryFindPackageDesc (fromMaybe "." (useWorkingDir options))
>>= readPackageDescription verbosity
>>= return . packageDescription
checkBuildType (UnknownBuildType name) =
die $ "The build-type '" ++ name ++ "' is not known. Use one of: "
++ intercalate ", " (map display knownBuildTypes) ++ "."
checkBuildType _ = return ()
-- | Decide if we're going to be able to do a direct internal call to the
-- entry point in the Cabal library or if we're going to have to compile
-- and execute an external Setup.hs script.
-- | 1,525 | setupWrapper :: Verbosity
-> SetupScriptOptions
-> Maybe PackageDescription
-> CommandUI flags
-> (Version -> flags)
-> [String]
-> IO ()
setupWrapper verbosity options mpkg cmd flags extraArgs = do
pkg <- maybe getPkg return mpkg
let setupMethod = determineSetupMethod options' buildType'
options' = options {
useCabalVersion = intersectVersionRanges
(useCabalVersion options)
(orLaterVersion (specVersion pkg))
}
buildType' = fromMaybe Custom (buildType pkg)
mkArgs cabalLibVersion = commandName cmd
: commandShowOptions cmd (flags cabalLibVersion)
++ extraArgs
checkBuildType buildType'
setupMethod verbosity options' (packageId pkg) buildType' mkArgs
where
getPkg = tryFindPackageDesc (fromMaybe "." (useWorkingDir options))
>>= readPackageDescription verbosity
>>= return . packageDescription
checkBuildType (UnknownBuildType name) =
die $ "The build-type '" ++ name ++ "' is not known. Use one of: "
++ intercalate ", " (map display knownBuildTypes) ++ "."
checkBuildType _ = return ()
-- | Decide if we're going to be able to do a direct internal call to the
-- entry point in the Cabal library or if we're going to have to compile
-- and execute an external Setup.hs script.
-- | 1,525 | setupWrapper verbosity options mpkg cmd flags extraArgs = do
pkg <- maybe getPkg return mpkg
let setupMethod = determineSetupMethod options' buildType'
options' = options {
useCabalVersion = intersectVersionRanges
(useCabalVersion options)
(orLaterVersion (specVersion pkg))
}
buildType' = fromMaybe Custom (buildType pkg)
mkArgs cabalLibVersion = commandName cmd
: commandShowOptions cmd (flags cabalLibVersion)
++ extraArgs
checkBuildType buildType'
setupMethod verbosity options' (packageId pkg) buildType' mkArgs
where
getPkg = tryFindPackageDesc (fromMaybe "." (useWorkingDir options))
>>= readPackageDescription verbosity
>>= return . packageDescription
checkBuildType (UnknownBuildType name) =
die $ "The build-type '" ++ name ++ "' is not known. Use one of: "
++ intercalate ", " (map display knownBuildTypes) ++ "."
checkBuildType _ = return ()
-- | Decide if we're going to be able to do a direct internal call to the
-- entry point in the Cabal library or if we're going to have to compile
-- and execute an external Setup.hs script.
-- | 1,309 | false | true | 0 | 16 | 509 | 309 | 150 | 159 | null | null |
jparyani/capnproto-boostpython | compiler/src/Parser.hs | bsd-2-clause | tokenErrorString (LiteralFloat f) = "float literal " ++ show f | 62 | tokenErrorString (LiteralFloat f) = "float literal " ++ show f | 62 | tokenErrorString (LiteralFloat f) = "float literal " ++ show f | 62 | false | false | 0 | 7 | 9 | 22 | 10 | 12 | null | null |
TomMD/cryptol | src/Cryptol/TypeCheck/Solver/Eval.hs | bsd-3-clause | tfLg2 :: OrdFacts -> Type -> Maybe Type
tfLg2 _ t
| Just (Nat 0) <- arg = Just $ tNum (0 :: Int) -- XXX: should this be defined?
| Just (Nat x) <- arg = do (n,exact) <- genLog x 2
return $ tNum $ if exact then n else n + 1
| Just Inf <- arg = Just tInf
| otherwise = Nothing
where arg = toNat' t
-- | XXX: @width@ and @lg2@ are almost the same!
-- @width n == lg2 (n + 1)@ | 448 | tfLg2 :: OrdFacts -> Type -> Maybe Type
tfLg2 _ t
| Just (Nat 0) <- arg = Just $ tNum (0 :: Int) -- XXX: should this be defined?
| Just (Nat x) <- arg = do (n,exact) <- genLog x 2
return $ tNum $ if exact then n else n + 1
| Just Inf <- arg = Just tInf
| otherwise = Nothing
where arg = toNat' t
-- | XXX: @width@ and @lg2@ are almost the same!
-- @width n == lg2 (n + 1)@ | 448 | tfLg2 _ t
| Just (Nat 0) <- arg = Just $ tNum (0 :: Int) -- XXX: should this be defined?
| Just (Nat x) <- arg = do (n,exact) <- genLog x 2
return $ tNum $ if exact then n else n + 1
| Just Inf <- arg = Just tInf
| otherwise = Nothing
where arg = toNat' t
-- | XXX: @width@ and @lg2@ are almost the same!
-- @width n == lg2 (n + 1)@ | 408 | false | true | 2 | 11 | 165 | 175 | 82 | 93 | null | null |
brendanhay/gogol | gogol-identity-toolkit/gen/Network/Google/IdentityToolkit/Types/Product.hs | mpl-2.0 | -- | The fixed string \"identitytoolkit#UploadAccountResponse\".
uarKind :: Lens' UploadAccountResponse Text
uarKind = lens _uarKind (\ s a -> s{_uarKind = a}) | 159 | uarKind :: Lens' UploadAccountResponse Text
uarKind = lens _uarKind (\ s a -> s{_uarKind = a}) | 94 | uarKind = lens _uarKind (\ s a -> s{_uarKind = a}) | 50 | true | true | 0 | 9 | 21 | 40 | 22 | 18 | null | null |
pgj/bead | src/Bead/Persistence/Persist.hs | bsd-3-clause | -- * Persistence initialization
-- | Creates a persist initialization structure.
createPersistInit :: Config -> IO (Init.PersistInit)
createPersistInit = PersistImpl.createPersistInit | 184 | createPersistInit :: Config -> IO (Init.PersistInit)
createPersistInit = PersistImpl.createPersistInit | 102 | createPersistInit = PersistImpl.createPersistInit | 49 | true | true | 0 | 8 | 20 | 27 | 15 | 12 | null | null |
bgamari/pandoc | src/Text/Pandoc/Readers/Docx.hs | gpl-2.0 | runToInlines :: Run -> DocxContext Inlines
runToInlines (Run rs runElems)
| Just (s, _) <- rStyle rs
, s `elem` codeStyles =
return $ code $ concatMap runElemToString runElems
| otherwise = do
let ils = concatReduce (map runElemToInlines runElems)
return $ (runStyleToTransform $ resolveDependentRunStyle rs) ils | 330 | runToInlines :: Run -> DocxContext Inlines
runToInlines (Run rs runElems)
| Just (s, _) <- rStyle rs
, s `elem` codeStyles =
return $ code $ concatMap runElemToString runElems
| otherwise = do
let ils = concatReduce (map runElemToInlines runElems)
return $ (runStyleToTransform $ resolveDependentRunStyle rs) ils | 330 | runToInlines (Run rs runElems)
| Just (s, _) <- rStyle rs
, s `elem` codeStyles =
return $ code $ concatMap runElemToString runElems
| otherwise = do
let ils = concatReduce (map runElemToInlines runElems)
return $ (runStyleToTransform $ resolveDependentRunStyle rs) ils | 287 | false | true | 1 | 13 | 64 | 122 | 58 | 64 | null | null |
keera-studios/hsQt | extra-pkgs/Glome/Qt/Glome/Vec.hs | bsd-2-clause | vrcp :: Vec -> Vec
vrcp !(Vec x y z) =
Vec (1/x) (1/y) (1/z) | 61 | vrcp :: Vec -> Vec
vrcp !(Vec x y z) =
Vec (1/x) (1/y) (1/z) | 61 | vrcp !(Vec x y z) =
Vec (1/x) (1/y) (1/z) | 42 | false | true | 0 | 7 | 15 | 62 | 30 | 32 | null | null |
vikraman/ghc | compiler/nativeGen/PPC/CodeGen.hs | bsd-3-clause | genJump' tree (GCPLinux64ELF 2)
= do
(target,code) <- getSomeReg tree
return (code
`snocOL` MR r12 target
`snocOL` MTCTR r12
`snocOL` BCTR [] Nothing) | 213 | genJump' tree (GCPLinux64ELF 2)
= do
(target,code) <- getSomeReg tree
return (code
`snocOL` MR r12 target
`snocOL` MTCTR r12
`snocOL` BCTR [] Nothing) | 213 | genJump' tree (GCPLinux64ELF 2)
= do
(target,code) <- getSomeReg tree
return (code
`snocOL` MR r12 target
`snocOL` MTCTR r12
`snocOL` BCTR [] Nothing) | 213 | false | false | 0 | 12 | 85 | 77 | 38 | 39 | null | null |
smurphy8/issue-add | src/Action/Internal/Label.hs | bsd-3-clause | fromLabelString "Need Test Case" = Right NeedTestCase | 63 | fromLabelString "Need Test Case" = Right NeedTestCase | 63 | fromLabelString "Need Test Case" = Right NeedTestCase | 63 | false | false | 0 | 5 | 16 | 12 | 5 | 7 | null | null |
rueshyna/gogol | gogol-gmail/gen/Network/Google/Resource/Gmail/Users/Settings/ForwardingAddresses/Create.hs | mpl-2.0 | -- | User\'s email address. The special value \"me\" can be used to indicate
-- the authenticated user.
usfacUserId :: Lens' UsersSettingsForwardingAddressesCreate Text
usfacUserId
= lens _usfacUserId (\ s a -> s{_usfacUserId = a}) | 233 | usfacUserId :: Lens' UsersSettingsForwardingAddressesCreate Text
usfacUserId
= lens _usfacUserId (\ s a -> s{_usfacUserId = a}) | 129 | usfacUserId
= lens _usfacUserId (\ s a -> s{_usfacUserId = a}) | 64 | true | true | 0 | 9 | 35 | 43 | 23 | 20 | null | null |
ezyang/ghc | testsuite/tests/profiling/should_run/heapprof001.hs | bsd-3-clause | parse' (c:t) s = if inRange ('a','z') c then parse' t (Ast (Sym c) : s)
else if spri s > opri c then parse' (c:t) (red s)
else parse' t (Lex c : s) | 181 | parse' (c:t) s = if inRange ('a','z') c then parse' t (Ast (Sym c) : s)
else if spri s > opri c then parse' (c:t) (red s)
else parse' t (Lex c : s) | 181 | parse' (c:t) s = if inRange ('a','z') c then parse' t (Ast (Sym c) : s)
else if spri s > opri c then parse' (c:t) (red s)
else parse' t (Lex c : s) | 181 | false | false | 1 | 11 | 68 | 114 | 55 | 59 | null | null |
bgamari/pandoc | src/Text/Pandoc/Writers/MediaWiki.hs | gpl-2.0 | listAttribsToString :: ListAttributes -> String
listAttribsToString (startnum, numstyle, _) =
let numstyle' = camelCaseToHyphenated $ show numstyle
in (if startnum /= 1
then " start=\"" ++ show startnum ++ "\""
else "") ++
(if numstyle /= DefaultStyle
then " style=\"list-style-type: " ++ numstyle' ++ ";\""
else "") | 367 | listAttribsToString :: ListAttributes -> String
listAttribsToString (startnum, numstyle, _) =
let numstyle' = camelCaseToHyphenated $ show numstyle
in (if startnum /= 1
then " start=\"" ++ show startnum ++ "\""
else "") ++
(if numstyle /= DefaultStyle
then " style=\"list-style-type: " ++ numstyle' ++ ";\""
else "") | 367 | listAttribsToString (startnum, numstyle, _) =
let numstyle' = camelCaseToHyphenated $ show numstyle
in (if startnum /= 1
then " start=\"" ++ show startnum ++ "\""
else "") ++
(if numstyle /= DefaultStyle
then " style=\"list-style-type: " ++ numstyle' ++ ";\""
else "") | 319 | false | true | 2 | 11 | 97 | 104 | 53 | 51 | null | null |
ublubu/shapes | shapes/src/Physics/World.hs | mit | append :: World s label -> WorldObj label -> ST s Int
append World {..} WorldObj {..} = do
i <- E.append _wEmpties
U.write _wPhysObjs i _woPhysObj
V.write _wLabels i _woLabel
U.write _wMaterials i _woMaterial
V.write _wShapes i _woShape
return i | 257 | append :: World s label -> WorldObj label -> ST s Int
append World {..} WorldObj {..} = do
i <- E.append _wEmpties
U.write _wPhysObjs i _woPhysObj
V.write _wLabels i _woLabel
U.write _wMaterials i _woMaterial
V.write _wShapes i _woShape
return i | 257 | append World {..} WorldObj {..} = do
i <- E.append _wEmpties
U.write _wPhysObjs i _woPhysObj
V.write _wLabels i _woLabel
U.write _wMaterials i _woMaterial
V.write _wShapes i _woShape
return i | 203 | false | true | 0 | 9 | 52 | 115 | 50 | 65 | null | null |
AlexanderPankiv/ghc | compiler/cmm/PprC.hs | bsd-3-clause | -- if we print via pprAsPtrReg
isPtrReg (CmmGlobal (VanillaReg _ VNonGcPtr)) = False | 84 | isPtrReg (CmmGlobal (VanillaReg _ VNonGcPtr)) = False | 53 | isPtrReg (CmmGlobal (VanillaReg _ VNonGcPtr)) = False | 53 | true | false | 0 | 8 | 12 | 25 | 12 | 13 | null | null |
verement/etamoo | src/MOO/Task.hs | bsd-3-clause | setBuiltinProperty (oid, obj) "wizard" bit = do
checkWizard
when (objectWizard obj /= bit') $ do
writeLog' <- writeLog <$> getWorld
programmer <- frame permissions
liftSTM $ writeLog' $ (if bit' then "" else "DE") <> "WIZARDED: " <>
toText (Obj oid) <> " by programmer " <> toText (Obj programmer)
setWizardBit `catchException` (liftSTM . mapM_ writeLog' . formatTraceback)
where bit' = truthOf bit
setWizardBit = do
modifyObject' oid $ \obj -> obj { objectWizard = bit' }
let message = "Wizard bit " <> if bit' then "set." else "unset."
raiseException (Err E_NONE) message bit | 643 | setBuiltinProperty (oid, obj) "wizard" bit = do
checkWizard
when (objectWizard obj /= bit') $ do
writeLog' <- writeLog <$> getWorld
programmer <- frame permissions
liftSTM $ writeLog' $ (if bit' then "" else "DE") <> "WIZARDED: " <>
toText (Obj oid) <> " by programmer " <> toText (Obj programmer)
setWizardBit `catchException` (liftSTM . mapM_ writeLog' . formatTraceback)
where bit' = truthOf bit
setWizardBit = do
modifyObject' oid $ \obj -> obj { objectWizard = bit' }
let message = "Wizard bit " <> if bit' then "set." else "unset."
raiseException (Err E_NONE) message bit | 643 | setBuiltinProperty (oid, obj) "wizard" bit = do
checkWizard
when (objectWizard obj /= bit') $ do
writeLog' <- writeLog <$> getWorld
programmer <- frame permissions
liftSTM $ writeLog' $ (if bit' then "" else "DE") <> "WIZARDED: " <>
toText (Obj oid) <> " by programmer " <> toText (Obj programmer)
setWizardBit `catchException` (liftSTM . mapM_ writeLog' . formatTraceback)
where bit' = truthOf bit
setWizardBit = do
modifyObject' oid $ \obj -> obj { objectWizard = bit' }
let message = "Wizard bit " <> if bit' then "set." else "unset."
raiseException (Err E_NONE) message bit | 643 | false | false | 1 | 16 | 160 | 219 | 107 | 112 | null | null |
smobs/Ratscrew | src/Ratscrew/Game/Internal.hs | mit | givePenalty :: Player -> GameState -> GameState
givePenalty p g = g & penaltyLens p .~ True | 91 | givePenalty :: Player -> GameState -> GameState
givePenalty p g = g & penaltyLens p .~ True | 91 | givePenalty p g = g & penaltyLens p .~ True | 43 | false | true | 0 | 7 | 16 | 40 | 18 | 22 | null | null |
trskop/cabal | Cabal/Distribution/Simple/BuildTarget.hs | bsd-3-clause | caseFold :: String -> String
caseFold = lowercase | 49 | caseFold :: String -> String
caseFold = lowercase | 49 | caseFold = lowercase | 20 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
eklinkhammer/neural-algorithms | src/RandomUtil/Random.hs | bsd-3-clause | randomMapTwoGens :: (g -> g -> a -> (b,(g,g))) -> g -> g -> [a] -> ([b], (g,g))
randomMapTwoGens _ g1 g2 [] = ([], (g1, g2)) | 128 | randomMapTwoGens :: (g -> g -> a -> (b,(g,g))) -> g -> g -> [a] -> ([b], (g,g))
randomMapTwoGens _ g1 g2 [] = ([], (g1, g2)) | 128 | randomMapTwoGens _ g1 g2 [] = ([], (g1, g2)) | 48 | false | true | 0 | 12 | 30 | 103 | 57 | 46 | null | null |
bgamari/text | tests/Tests/Properties/Mul.hs | bsd-2-clause | t_mul64 :: Int64 -> Int64 -> Property
t_mul64 a b = mulRef a b === eval mul64 a b | 81 | t_mul64 :: Int64 -> Int64 -> Property
t_mul64 a b = mulRef a b === eval mul64 a b | 81 | t_mul64 a b = mulRef a b === eval mul64 a b | 43 | false | true | 0 | 6 | 18 | 40 | 19 | 21 | null | null |
Bolpat/CardGames | src/Trick/Rules.hs | gpl-3.0 | step (r:rs, dnt) f c d | res /= EQ = (res == GT)
| otherwise = step (rs, dnt) f c d
where res = r c d
-- | Sorts Cards (e. g. on the display) by the given TrickRule.
-- | Not good for trick testing because: here it is a linear order on all cards, but trick testing is NOT a linear order.
{-
sortTR :: TrickRule -> [Card] -> [Card]
sortTR = sortBy . cmpTR where
cmpTR :: TrickRule -> (Card -> Card -> Ordering)
cmpTR ([], _) (Card s1 r1) (Card s2 r2) | res == EQ = compare r1 r2
| otherwise = res where res = compare s1 s2
cmpTR (r:_ , _) c1 c2 | res /= EQ = res where res = r c1 c2
cmpTR (_:rs, d) c1 c2 = cmpTR (rs, d) c1 c2
-} | 810 | step (r:rs, dnt) f c d | res /= EQ = (res == GT)
| otherwise = step (rs, dnt) f c d
where res = r c d
-- | Sorts Cards (e. g. on the display) by the given TrickRule.
-- | Not good for trick testing because: here it is a linear order on all cards, but trick testing is NOT a linear order.
{-
sortTR :: TrickRule -> [Card] -> [Card]
sortTR = sortBy . cmpTR where
cmpTR :: TrickRule -> (Card -> Card -> Ordering)
cmpTR ([], _) (Card s1 r1) (Card s2 r2) | res == EQ = compare r1 r2
| otherwise = res where res = compare s1 s2
cmpTR (r:_ , _) c1 c2 | res /= EQ = res where res = r c1 c2
cmpTR (_:rs, d) c1 c2 = cmpTR (rs, d) c1 c2
-} | 810 | step (r:rs, dnt) f c d | res /= EQ = (res == GT)
| otherwise = step (rs, dnt) f c d
where res = r c d
-- | Sorts Cards (e. g. on the display) by the given TrickRule.
-- | Not good for trick testing because: here it is a linear order on all cards, but trick testing is NOT a linear order.
{-
sortTR :: TrickRule -> [Card] -> [Card]
sortTR = sortBy . cmpTR where
cmpTR :: TrickRule -> (Card -> Card -> Ordering)
cmpTR ([], _) (Card s1 r1) (Card s2 r2) | res == EQ = compare r1 r2
| otherwise = res where res = compare s1 s2
cmpTR (r:_ , _) c1 c2 | res /= EQ = res where res = r c1 c2
cmpTR (_:rs, d) c1 c2 = cmpTR (rs, d) c1 c2
-} | 810 | false | false | 0 | 8 | 328 | 82 | 42 | 40 | null | null |
barrucadu/cabal-info | cabal-info/Args.hs | mit | archParser :: Parser Arch
archParser = go . map toLower <$> strOption (long "arch" <> short 'a' <> metavar "ARCH" <> help "The architecture to use when expanding conditionals. Allowed values are (case insensitive): i386, x86_64, ppc, ppc64, sparc, arm, mips, sh, ia64, s390, alpha, hppa, rs6000, m68k, vax, javascript.") where
go "i386" = I386
go "x86_64" = X86_64
go "ppc" = PPC
go "ppc64" = PPC64
go "sparc" = Sparc
go "arm" = Arm
go "mips" = Mips
go "sh" = SH
go "ia64" = IA64
go "s390" = S390
go "alpha" = Alpha
go "hppa" = Hppa
go "rs6000" = Rs6000
go "m68k" = M68k
go "vax" = Vax
go "javascript" = JavaScript
go arch = OtherArch arch | 673 | archParser :: Parser Arch
archParser = go . map toLower <$> strOption (long "arch" <> short 'a' <> metavar "ARCH" <> help "The architecture to use when expanding conditionals. Allowed values are (case insensitive): i386, x86_64, ppc, ppc64, sparc, arm, mips, sh, ia64, s390, alpha, hppa, rs6000, m68k, vax, javascript.") where
go "i386" = I386
go "x86_64" = X86_64
go "ppc" = PPC
go "ppc64" = PPC64
go "sparc" = Sparc
go "arm" = Arm
go "mips" = Mips
go "sh" = SH
go "ia64" = IA64
go "s390" = S390
go "alpha" = Alpha
go "hppa" = Hppa
go "rs6000" = Rs6000
go "m68k" = M68k
go "vax" = Vax
go "javascript" = JavaScript
go arch = OtherArch arch | 673 | archParser = go . map toLower <$> strOption (long "arch" <> short 'a' <> metavar "ARCH" <> help "The architecture to use when expanding conditionals. Allowed values are (case insensitive): i386, x86_64, ppc, ppc64, sparc, arm, mips, sh, ia64, s390, alpha, hppa, rs6000, m68k, vax, javascript.") where
go "i386" = I386
go "x86_64" = X86_64
go "ppc" = PPC
go "ppc64" = PPC64
go "sparc" = Sparc
go "arm" = Arm
go "mips" = Mips
go "sh" = SH
go "ia64" = IA64
go "s390" = S390
go "alpha" = Alpha
go "hppa" = Hppa
go "rs6000" = Rs6000
go "m68k" = M68k
go "vax" = Vax
go "javascript" = JavaScript
go arch = OtherArch arch | 647 | false | true | 0 | 11 | 153 | 195 | 95 | 100 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/enumFromTo_3.hs | mit | enumFromToMyBool :: MyBool -> MyBool -> (List MyBool)
enumFromToMyBool x y = map toEnumMyBool (enumFromToMyInt (fromEnumMyBool x) (fromEnumMyBool y)) | 153 | enumFromToMyBool :: MyBool -> MyBool -> (List MyBool)
enumFromToMyBool x y = map toEnumMyBool (enumFromToMyInt (fromEnumMyBool x) (fromEnumMyBool y)) | 153 | enumFromToMyBool x y = map toEnumMyBool (enumFromToMyInt (fromEnumMyBool x) (fromEnumMyBool y)) | 95 | false | true | 0 | 10 | 22 | 61 | 28 | 33 | null | null |
serokell/time-warp | src/Control/TimeWarp/Rpc/MonadTransfer.hs | mit | -- | Appends `commLoggerName` as suffix to current logger name.
commLog :: HasLoggerName m => m a -> m a
commLog = modifyLoggerName (<> commLoggerName) | 151 | commLog :: HasLoggerName m => m a -> m a
commLog = modifyLoggerName (<> commLoggerName) | 87 | commLog = modifyLoggerName (<> commLoggerName) | 46 | true | true | 0 | 7 | 24 | 36 | 18 | 18 | null | null |
HJvT/com | System/Win32/Com/Automation.hs | bsd-3-clause | inString :: ArgIn String
inString s p = do
pbstr <- nofreeAllocBSTR s
writeVarString (castPtr pbstr) p | 168 | inString :: ArgIn String
inString s p = do
pbstr <- nofreeAllocBSTR s
writeVarString (castPtr pbstr) p | 168 | inString s p = do
pbstr <- nofreeAllocBSTR s
writeVarString (castPtr pbstr) p | 143 | false | true | 0 | 9 | 82 | 43 | 19 | 24 | null | null |
da-x/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | -- Not used at runtime
matchContextErrString PatSyn = panic "matchContextErrString" | 103 | matchContextErrString PatSyn = panic "matchContextErrString" | 80 | matchContextErrString PatSyn = panic "matchContextErrString" | 80 | true | false | 0 | 5 | 29 | 14 | 6 | 8 | null | null |
jozefg/c-dsl | src/Language/C/DSL/Exp.hs | mit | -- | This is the indexing operator in C, @a ! i@ is @a[i]@.
(!) :: CExpr -> CExpr -> CExpr
arr ! ind = CIndex arr ind undefNode | 127 | (!) :: CExpr -> CExpr -> CExpr
arr ! ind = CIndex arr ind undefNode | 67 | arr ! ind = CIndex arr ind undefNode | 36 | true | true | 0 | 6 | 28 | 35 | 18 | 17 | null | null |
badp/ganeti | src/Ganeti/Constants.hs | gpl-2.0 | -- * Storage fields
-- ** First two are valid in LU context only, not passed to backend
sfNode :: String
sfNode = "node" | 121 | sfNode :: String
sfNode = "node" | 32 | sfNode = "node" | 15 | true | true | 0 | 4 | 24 | 13 | 8 | 5 | null | null |
dambaev/hep | src/Control/Concurrent/HEP/Proc.hs | mit | newPid:: HEPGlobal Pid
newPid = do
muuid <- liftIO $! nextUUID
case muuid of
Nothing -> liftIO $! ioError $! userError "nextUUID failed!"
Just uuid -> return $! Pid uuid | 193 | newPid:: HEPGlobal Pid
newPid = do
muuid <- liftIO $! nextUUID
case muuid of
Nothing -> liftIO $! ioError $! userError "nextUUID failed!"
Just uuid -> return $! Pid uuid | 193 | newPid = do
muuid <- liftIO $! nextUUID
case muuid of
Nothing -> liftIO $! ioError $! userError "nextUUID failed!"
Just uuid -> return $! Pid uuid | 170 | false | true | 0 | 11 | 53 | 65 | 30 | 35 | null | null |
facebookincubator/duckling | Duckling/Time/Helpers.hs | bsd-3-clause | minutesAfter :: Int -> TimeData -> Maybe TimeData
minutesAfter n TimeData {TTime.form = Just (TTime.TimeOfDay (Just h) is12H)} =
Just $ hourMinute is12H h n | 158 | minutesAfter :: Int -> TimeData -> Maybe TimeData
minutesAfter n TimeData {TTime.form = Just (TTime.TimeOfDay (Just h) is12H)} =
Just $ hourMinute is12H h n | 158 | minutesAfter n TimeData {TTime.form = Just (TTime.TimeOfDay (Just h) is12H)} =
Just $ hourMinute is12H h n | 108 | false | true | 0 | 13 | 26 | 68 | 33 | 35 | null | null |
bobgru/tree-derivations | src/LSystem5.hs | mit | isTerminal (Follow _) = True | 29 | isTerminal (Follow _) = True | 29 | isTerminal (Follow _) = True | 29 | false | false | 0 | 7 | 5 | 15 | 7 | 8 | null | null |
mainland/nikola | src/Data/Array/Nikola/Language/Optimize.hs | bsd-3-clause | toMnf (BindE v tau (SeqE m1 m2) m3) = toMnf (SeqE m1 (BindE v tau m2 m3)) | 73 | toMnf (BindE v tau (SeqE m1 m2) m3) = toMnf (SeqE m1 (BindE v tau m2 m3)) | 73 | toMnf (BindE v tau (SeqE m1 m2) m3) = toMnf (SeqE m1 (BindE v tau m2 m3)) | 73 | false | false | 0 | 9 | 16 | 53 | 25 | 28 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/ElasticLoadBalancingV2ListenerRuleAuthenticateCognitoConfig.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-listenerrule-authenticatecognitoconfig.html#cfn-elasticloadbalancingv2-listenerrule-authenticatecognitoconfig-sessioncookiename
elbvlraccSessionCookieName :: Lens' ElasticLoadBalancingV2ListenerRuleAuthenticateCognitoConfig (Maybe (Val Text))
elbvlraccSessionCookieName = lens _elasticLoadBalancingV2ListenerRuleAuthenticateCognitoConfigSessionCookieName (\s a -> s { _elasticLoadBalancingV2ListenerRuleAuthenticateCognitoConfigSessionCookieName = a }) | 557 | elbvlraccSessionCookieName :: Lens' ElasticLoadBalancingV2ListenerRuleAuthenticateCognitoConfig (Maybe (Val Text))
elbvlraccSessionCookieName = lens _elasticLoadBalancingV2ListenerRuleAuthenticateCognitoConfigSessionCookieName (\s a -> s { _elasticLoadBalancingV2ListenerRuleAuthenticateCognitoConfigSessionCookieName = a }) | 324 | elbvlraccSessionCookieName = lens _elasticLoadBalancingV2ListenerRuleAuthenticateCognitoConfigSessionCookieName (\s a -> s { _elasticLoadBalancingV2ListenerRuleAuthenticateCognitoConfigSessionCookieName = a }) | 209 | true | true | 0 | 9 | 22 | 52 | 28 | 24 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Word8.hs | bsd-3-clause | _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z :: Word8
_A = 0x41 | 121 | _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z :: Word8
_A = 0x41 | 121 | _A = 0x41 | 9 | false | true | 15 | 5 | 30 | 93 | 56 | 37 | null | null |
lukexi/ghc | compiler/main/DynFlags.hs | bsd-3-clause | addImportPath, addLibraryPath, addIncludePath, addFrameworkPath :: FilePath -> DynP ()
-- -i on its own deletes the import paths
addImportPath "" = upd (\s -> s{importPaths = []}) | 180 | addImportPath, addLibraryPath, addIncludePath, addFrameworkPath :: FilePath -> DynP ()
addImportPath "" = upd (\s -> s{importPaths = []}) | 137 | addImportPath "" = upd (\s -> s{importPaths = []}) | 50 | true | true | 3 | 10 | 27 | 59 | 30 | 29 | null | null |
gcampax/ghc | compiler/types/TypeRep.hs | bsd-3-clause | isSuperKind _ = False | 37 | isSuperKind _ = False | 37 | isSuperKind _ = False | 37 | false | false | 0 | 5 | 19 | 9 | 4 | 5 | null | null |
reinh/Hask8080 | src/Hask8080/Opcode.hs | mit | -- | Map a 3-bit pattern to a 'Reg'
r :: Int -> Int -> Int -> Reg
r 0 0 0 = B | 77 | r :: Int -> Int -> Int -> Reg
r 0 0 0 = B | 41 | r 0 0 0 = B | 11 | true | true | 0 | 9 | 23 | 37 | 17 | 20 | null | null |
olsner/ghc | compiler/cmm/SMRep.hs | bsd-3-clause | -----------------------------------------------------------------------------
-- Predicates
isStaticRep :: SMRep -> IsStatic
isStaticRep (HeapRep is_static _ _ _) = is_static | 175 | isStaticRep :: SMRep -> IsStatic
isStaticRep (HeapRep is_static _ _ _) = is_static | 82 | isStaticRep (HeapRep is_static _ _ _) = is_static | 49 | true | true | 0 | 6 | 16 | 36 | 18 | 18 | null | null |
david-caro/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | checkConditionalAndOrs _ t =
case t of
(TC_And id SingleBracket "&&" _ _) ->
err id 2107 "Instead of [ a && b ], use [ a ] && [ b ]."
(TC_And id DoubleBracket "-a" _ _) ->
err id 2108 "In [[..]], use && instead of -a."
(TC_Or id SingleBracket "||" _ _) ->
err id 2109 "Instead of [ a || b ], use [ a ] || [ b ]."
(TC_Or id DoubleBracket "-o" _ _) ->
err id 2110 "In [[..]], use || instead of -o."
(TC_And id SingleBracket "-a" _ _) ->
warn id 2166 "Prefer [ p ] && [ q ] as [ p -a q ] is not well defined."
(TC_Or id SingleBracket "-o" _ _) ->
warn id 2166 "Prefer [ p ] || [ q ] as [ p -o q ] is not well defined."
otherwise -> return () | 772 | checkConditionalAndOrs _ t =
case t of
(TC_And id SingleBracket "&&" _ _) ->
err id 2107 "Instead of [ a && b ], use [ a ] && [ b ]."
(TC_And id DoubleBracket "-a" _ _) ->
err id 2108 "In [[..]], use && instead of -a."
(TC_Or id SingleBracket "||" _ _) ->
err id 2109 "Instead of [ a || b ], use [ a ] || [ b ]."
(TC_Or id DoubleBracket "-o" _ _) ->
err id 2110 "In [[..]], use || instead of -o."
(TC_And id SingleBracket "-a" _ _) ->
warn id 2166 "Prefer [ p ] && [ q ] as [ p -a q ] is not well defined."
(TC_Or id SingleBracket "-o" _ _) ->
warn id 2166 "Prefer [ p ] || [ q ] as [ p -o q ] is not well defined."
otherwise -> return () | 772 | checkConditionalAndOrs _ t =
case t of
(TC_And id SingleBracket "&&" _ _) ->
err id 2107 "Instead of [ a && b ], use [ a ] && [ b ]."
(TC_And id DoubleBracket "-a" _ _) ->
err id 2108 "In [[..]], use && instead of -a."
(TC_Or id SingleBracket "||" _ _) ->
err id 2109 "Instead of [ a || b ], use [ a ] || [ b ]."
(TC_Or id DoubleBracket "-o" _ _) ->
err id 2110 "In [[..]], use || instead of -o."
(TC_And id SingleBracket "-a" _ _) ->
warn id 2166 "Prefer [ p ] && [ q ] as [ p -a q ] is not well defined."
(TC_Or id SingleBracket "-o" _ _) ->
warn id 2166 "Prefer [ p ] || [ q ] as [ p -o q ] is not well defined."
otherwise -> return () | 772 | false | false | 7 | 6 | 284 | 194 | 90 | 104 | null | null |
E2LP/e2asm | src/E2ASM/Assembler/AST.hs | gpl-3.0 | getArgumentTypes Instr.NEG = twoRegisters | 43 | getArgumentTypes Instr.NEG = twoRegisters | 43 | getArgumentTypes Instr.NEG = twoRegisters | 43 | false | false | 0 | 6 | 5 | 11 | 5 | 6 | null | null |
haskell-distributed/distributed-process | src/Control/Distributed/Process/Debug.hs | bsd-3-clause | stopTracer :: Process ()
stopTracer =
withRegisteredTracer $ \pid -> do
-- we need to avoid killing the initial (base) tracer, as
-- nothing we rely on having exactly 1 registered tracer
-- process at all times.
basePid <- whereis "tracer.initial"
case basePid == (Just pid) of
True -> return ()
False -> send pid MxTraceDisable | 363 | stopTracer :: Process ()
stopTracer =
withRegisteredTracer $ \pid -> do
-- we need to avoid killing the initial (base) tracer, as
-- nothing we rely on having exactly 1 registered tracer
-- process at all times.
basePid <- whereis "tracer.initial"
case basePid == (Just pid) of
True -> return ()
False -> send pid MxTraceDisable | 363 | stopTracer =
withRegisteredTracer $ \pid -> do
-- we need to avoid killing the initial (base) tracer, as
-- nothing we rely on having exactly 1 registered tracer
-- process at all times.
basePid <- whereis "tracer.initial"
case basePid == (Just pid) of
True -> return ()
False -> send pid MxTraceDisable | 338 | false | true | 0 | 13 | 90 | 77 | 38 | 39 | null | null |
allanderek/ipclib | Language/Pepa/Ode/TimedSystemEquation.hs | gpl-2.0 | formatTseCompExpr (TSEproduct t1 t2) =
unwords [formatTseCompExpr t1
, "*"
, formatTseCompExpr t2
] | 140 | formatTseCompExpr (TSEproduct t1 t2) =
unwords [formatTseCompExpr t1
, "*"
, formatTseCompExpr t2
] | 140 | formatTseCompExpr (TSEproduct t1 t2) =
unwords [formatTseCompExpr t1
, "*"
, formatTseCompExpr t2
] | 140 | false | false | 0 | 6 | 54 | 36 | 17 | 19 | null | null |
sergv/vector | Data/Vector.hs | bsd-3-clause | ifoldM'_ = G.ifoldM'_ | 21 | ifoldM'_ = G.ifoldM'_ | 21 | ifoldM'_ = G.ifoldM'_ | 21 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
da-x/ghc | libraries/base/Data/List/NonEmpty.hs | bsd-3-clause | -- | Sort a stream.
sort :: Ord a => NonEmpty a -> NonEmpty a
sort = lift List.sort | 83 | sort :: Ord a => NonEmpty a -> NonEmpty a
sort = lift List.sort | 63 | sort = lift List.sort | 21 | true | true | 0 | 8 | 18 | 39 | 17 | 22 | null | null |
Mazuh/Algs | src/haskell_uesb/c1/q03_cube.hs | mit | -- Defina a função cubo :: Int -> Int que calcula
-- o cubo de um número.
cube :: (Int) -> Int
cube x = x^3 | 108 | cube :: (Int) -> Int
cube x = x^3 | 33 | cube x = x^3 | 12 | true | true | 0 | 6 | 26 | 27 | 15 | 12 | null | null |
sgillespie/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- PrelFloat classes
floatingClassName, realFloatClassName :: Name
floatingClassName = clsQual gHC_FLOAT (fsLit "Floating") floatingClassKey | 142 | floatingClassName, realFloatClassName :: Name
floatingClassName = clsQual gHC_FLOAT (fsLit "Floating") floatingClassKey | 121 | floatingClassName = clsQual gHC_FLOAT (fsLit "Floating") floatingClassKey | 75 | true | true | 0 | 7 | 15 | 27 | 15 | 12 | null | null |
haskell/haddock | haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | bsd-2-clause | ppHsContext [p] unicode qual = ppCtxType unicode qual p | 55 | ppHsContext [p] unicode qual = ppCtxType unicode qual p | 55 | ppHsContext [p] unicode qual = ppCtxType unicode qual p | 55 | false | false | 0 | 5 | 8 | 25 | 11 | 14 | null | null |
CulpaBS/wbBach | src/Language/Futhark/Attributes.hs | bsd-3-clause | peelArray n (Array (TupleArray et shape u)) = do
shape' <- stripDims n shape
return $ Array $ TupleArray et shape' u | 120 | peelArray n (Array (TupleArray et shape u)) = do
shape' <- stripDims n shape
return $ Array $ TupleArray et shape' u | 120 | peelArray n (Array (TupleArray et shape u)) = do
shape' <- stripDims n shape
return $ Array $ TupleArray et shape' u | 120 | false | false | 0 | 9 | 25 | 57 | 26 | 31 | null | null |
moonKimura/cipher-aes-0.2.6 | Crypto/Cipher/AES.hs | bsd-3-clause | gcmFinish :: AES -> AESGCM -> Int -> AuthTag
gcmFinish ctx gcm taglen = AuthTag $ B.take taglen computeTag
where computeTag = unsafeCreate 16 $ \t ->
withGCMKeyAndCopySt ctx gcm (c_aes_gcm_finish (castPtr t)) >> return () | 247 | gcmFinish :: AES -> AESGCM -> Int -> AuthTag
gcmFinish ctx gcm taglen = AuthTag $ B.take taglen computeTag
where computeTag = unsafeCreate 16 $ \t ->
withGCMKeyAndCopySt ctx gcm (c_aes_gcm_finish (castPtr t)) >> return () | 247 | gcmFinish ctx gcm taglen = AuthTag $ B.take taglen computeTag
where computeTag = unsafeCreate 16 $ \t ->
withGCMKeyAndCopySt ctx gcm (c_aes_gcm_finish (castPtr t)) >> return () | 202 | false | true | 0 | 12 | 61 | 89 | 43 | 46 | null | null |
mwotton/sofadb | Config.hs | bsd-3-clause | ----------------------------------------------------------------
makeOpt :: Option -> [Conf] -> Option
makeOpt def conf = Option {
opt_port = get "Port" opt_port
, opt_prefork_process_number = get "Prefork_Process_Number" opt_prefork_process_number
, opt_thread_number_per_process = get "Thread_Number_Per_Process" opt_thread_number_per_process
, opt_connection_timer = get "Connection_Timer" opt_connection_timer
, opt_sleep_timer = get "Sleep_Timer" opt_sleep_timer
, opt_debug_mode = get "Debug_Mode" opt_debug_mode
, opt_user = get "User" opt_user
, opt_group = get "Group" opt_group
, opt_syslog_facility = get "Syslog_Facility" opt_syslog_facility
, opt_log_level = get "Log_Level" opt_log_level
, opt_pid_file = get "Pid_File" opt_pid_file
}
where
get key func = maybe (func def) fromConf $ lookup key conf
---------------------------------------------------------------- | 966 | makeOpt :: Option -> [Conf] -> Option
makeOpt def conf = Option {
opt_port = get "Port" opt_port
, opt_prefork_process_number = get "Prefork_Process_Number" opt_prefork_process_number
, opt_thread_number_per_process = get "Thread_Number_Per_Process" opt_thread_number_per_process
, opt_connection_timer = get "Connection_Timer" opt_connection_timer
, opt_sleep_timer = get "Sleep_Timer" opt_sleep_timer
, opt_debug_mode = get "Debug_Mode" opt_debug_mode
, opt_user = get "User" opt_user
, opt_group = get "Group" opt_group
, opt_syslog_facility = get "Syslog_Facility" opt_syslog_facility
, opt_log_level = get "Log_Level" opt_log_level
, opt_pid_file = get "Pid_File" opt_pid_file
}
where
get key func = maybe (func def) fromConf $ lookup key conf
---------------------------------------------------------------- | 900 | makeOpt def conf = Option {
opt_port = get "Port" opt_port
, opt_prefork_process_number = get "Prefork_Process_Number" opt_prefork_process_number
, opt_thread_number_per_process = get "Thread_Number_Per_Process" opt_thread_number_per_process
, opt_connection_timer = get "Connection_Timer" opt_connection_timer
, opt_sleep_timer = get "Sleep_Timer" opt_sleep_timer
, opt_debug_mode = get "Debug_Mode" opt_debug_mode
, opt_user = get "User" opt_user
, opt_group = get "Group" opt_group
, opt_syslog_facility = get "Syslog_Facility" opt_syslog_facility
, opt_log_level = get "Log_Level" opt_log_level
, opt_pid_file = get "Pid_File" opt_pid_file
}
where
get key func = maybe (func def) fromConf $ lookup key conf
---------------------------------------------------------------- | 862 | true | true | 1 | 8 | 181 | 198 | 100 | 98 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-example/Drasil/GamePhysics/Unitals.hs | bsd-2-clause | timeT = ucs' (dccWDS "t" (cn "point in time") (phrase QP.time))
(eqSymb QP.time) Real second | 108 | timeT = ucs' (dccWDS "t" (cn "point in time") (phrase QP.time))
(eqSymb QP.time) Real second | 108 | timeT = ucs' (dccWDS "t" (cn "point in time") (phrase QP.time))
(eqSymb QP.time) Real second | 108 | false | false | 1 | 9 | 30 | 52 | 23 | 29 | null | null |
cbrghostrider/Hacking | codeJam/2009/alienLanguage/qual.hs | mit | -- converts a token to a list of possible words
convert :: String -> [String]
convert = foldl (\a str -> a >>= bindToFunc str) (return []) . consumeLtrStart [] | 159 | convert :: String -> [String]
convert = foldl (\a str -> a >>= bindToFunc str) (return []) . consumeLtrStart [] | 111 | convert = foldl (\a str -> a >>= bindToFunc str) (return []) . consumeLtrStart [] | 81 | true | true | 0 | 10 | 29 | 64 | 31 | 33 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.