Search is not available for this dataset
repo_name
string | path
string | license
string | full_code
string | full_size
int64 | uncommented_code
string | uncommented_size
int64 | function_only_code
string | function_only_size
int64 | is_commented
bool | is_signatured
bool | n_ast_errors
int64 | ast_max_depth
int64 | n_whitespaces
int64 | n_ast_nodes
int64 | n_ast_terminals
int64 | n_ast_nonterminals
int64 | loc
int64 | cycloplexity
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
brendanhay/gogol
|
gogol-compute/gen/Network/Google/Resource/Compute/AcceleratorTypes/AggregatedList.hs
|
mpl-2.0
|
-- | A filter expression that filters resources listed in the response. The
-- expression must specify the field name, a comparison operator, and the
-- value that you want to use for filtering. The value must be a string, a
-- number, or a boolean. The comparison operator must be either \`=\`,
-- \`!=\`, \`>\`, or \`\<\`. For example, if you are filtering Compute
-- Engine instances, you can exclude instances named \`example-instance\`
-- by specifying \`name != example-instance\`. You can also filter nested
-- fields. For example, you could specify \`scheduling.automaticRestart =
-- false\` to include instances only if they are not scheduled for
-- automatic restarts. You can use filtering on nested fields to filter
-- based on resource labels. To filter on multiple expressions, provide
-- each separate expression within parentheses. For example: \`\`\`
-- (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\")
-- \`\`\` By default, each expression is an \`AND\` expression. However,
-- you can include \`AND\` and \`OR\` expressions explicitly. For example:
-- \`\`\` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel
-- Broadwell\") AND (scheduling.automaticRestart = true) \`\`\`
atalFilter :: Lens' AcceleratorTypesAggregatedList (Maybe Text)
atalFilter
= lens _atalFilter (\ s a -> s{_atalFilter = a})
| 1,349
|
atalFilter :: Lens' AcceleratorTypesAggregatedList (Maybe Text)
atalFilter
= lens _atalFilter (\ s a -> s{_atalFilter = a})
| 125
|
atalFilter
= lens _atalFilter (\ s a -> s{_atalFilter = a})
| 61
| true
| true
| 1
| 9
| 203
| 68
| 41
| 27
| null | null |
nyson/haste-compiler
|
src/Haste/AST/Print.hs
|
bsd-3-clause
|
norm (BinOp Eq (Lit (LBool True)) b) = norm b
| 47
|
norm (BinOp Eq (Lit (LBool True)) b) = norm b
| 47
|
norm (BinOp Eq (Lit (LBool True)) b) = norm b
| 47
| false
| false
| 0
| 11
| 11
| 34
| 16
| 18
| null | null |
nshepperd/funn
|
Testing/opencl.hs
|
mit
|
prop_quadraticcost :: Property
prop_quadraticcost = checkGradientCL (quadraticCost @5 @IO @Double)
| 98
|
prop_quadraticcost :: Property
prop_quadraticcost = checkGradientCL (quadraticCost @5 @IO @Double)
| 98
|
prop_quadraticcost = checkGradientCL (quadraticCost @5 @IO @Double)
| 67
| false
| true
| 0
| 8
| 9
| 36
| 16
| 20
| null | null |
iu-parfunc/containers
|
tests/map-properties.hs
|
bsd-3-clause
|
test_delete :: Assertion
test_delete = do
delete 5 (fromList [(5,"a"), (3,"b")]) @?= singleton 3 "b"
delete 7 (fromList [(5,"a"), (3,"b")]) @?= fromList [(3, "b"), (5, "a")]
delete 5 empty @?= (empty :: IMap)
| 244
|
test_delete :: Assertion
test_delete = do
delete 5 (fromList [(5,"a"), (3,"b")]) @?= singleton 3 "b"
delete 7 (fromList [(5,"a"), (3,"b")]) @?= fromList [(3, "b"), (5, "a")]
delete 5 empty @?= (empty :: IMap)
| 244
|
test_delete = do
delete 5 (fromList [(5,"a"), (3,"b")]) @?= singleton 3 "b"
delete 7 (fromList [(5,"a"), (3,"b")]) @?= fromList [(3, "b"), (5, "a")]
delete 5 empty @?= (empty :: IMap)
| 219
| false
| true
| 0
| 12
| 68
| 134
| 71
| 63
| null | null |
emk/haskell-probability-monads
|
Control/Monad/Distribution/Base.hs
|
bsd-3-clause
|
sampleBayes :: (MonadRandom m) => MaybeT m a -> Int -> m [a]
sampleBayes d n = liftM catMaybes (sample (runMaybeT d) n)
| 119
|
sampleBayes :: (MonadRandom m) => MaybeT m a -> Int -> m [a]
sampleBayes d n = liftM catMaybes (sample (runMaybeT d) n)
| 119
|
sampleBayes d n = liftM catMaybes (sample (runMaybeT d) n)
| 58
| false
| true
| 0
| 9
| 22
| 63
| 31
| 32
| null | null |
fmapfmapfmap/amazonka
|
amazonka-storagegateway/gen/Network/AWS/StorageGateway/Types/Product.hs
|
mpl-2.0
|
-- | Undocumented member.
giGatewayType :: Lens' GatewayInfo (Maybe Text)
giGatewayType = lens _giGatewayType (\ s a -> s{_giGatewayType = a})
| 142
|
giGatewayType :: Lens' GatewayInfo (Maybe Text)
giGatewayType = lens _giGatewayType (\ s a -> s{_giGatewayType = a})
| 116
|
giGatewayType = lens _giGatewayType (\ s a -> s{_giGatewayType = a})
| 68
| true
| true
| 0
| 9
| 20
| 46
| 25
| 21
| null | null |
juhp/leksah
|
src/IDE/Package.hs
|
gpl-2.0
|
runPackage :: (ProcessHandle -> IDEAction)
-> Text
-> FilePath
-> [Text]
-> FilePath
-> C.Sink ToolOutput IDEM ()
-> IDEAction
runPackage = runExternalTool (return True)
| 242
|
runPackage :: (ProcessHandle -> IDEAction)
-> Text
-> FilePath
-> [Text]
-> FilePath
-> C.Sink ToolOutput IDEM ()
-> IDEAction
runPackage = runExternalTool (return True)
| 242
|
runPackage = runExternalTool (return True)
| 42
| false
| true
| 0
| 13
| 97
| 72
| 34
| 38
| null | null |
Alex-Diez/haskell-tdd-kata
|
old-katas/src/ScrabbleScoreKata/Day6.hs
|
bsd-3-clause
|
score :: String -> Int
score [] = 0
| 46
|
score :: String -> Int
score [] = 0
| 42
|
score [] = 0
| 19
| false
| true
| 0
| 8
| 19
| 22
| 10
| 12
| null | null |
sdynerow/SemiringsLibrary
|
Algebra/Optimum.hs
|
apache-2.0
|
rlo1 :: (Semiring s) => s -> s -> s -> s
rlo1 a b x = if (x == updated) then x else rlo1 a b updated
where updated = add (mul x a) b
| 134
|
rlo1 :: (Semiring s) => s -> s -> s -> s
rlo1 a b x = if (x == updated) then x else rlo1 a b updated
where updated = add (mul x a) b
| 134
|
rlo1 a b x = if (x == updated) then x else rlo1 a b updated
where updated = add (mul x a) b
| 93
| false
| true
| 0
| 8
| 37
| 82
| 42
| 40
| null | null |
kdungs/adventofcode2016
|
08.hs
|
mit
|
parseRotRow :: Parser Instruction
parseRotRow = do
string "rotate row y="
y <- parseDecimal
string " by "
n <- parseDecimal
return (RotRow y n)
| 223
|
parseRotRow :: Parser Instruction
parseRotRow = do
string "rotate row y="
y <- parseDecimal
string " by "
n <- parseDecimal
return (RotRow y n)
| 223
|
parseRotRow = do
string "rotate row y="
y <- parseDecimal
string " by "
n <- parseDecimal
return (RotRow y n)
| 189
| false
| true
| 0
| 10
| 104
| 60
| 24
| 36
| null | null |
edsko/ChinesePodAPI
|
src/Servant/ChinesePod/Analysis.hs
|
bsd-3-clause
|
-- | Show state summary
showStateSummary :: IO ()
showStateSummary = showWithState' $ \st -> summarise st st
| 108
|
showStateSummary :: IO ()
showStateSummary = showWithState' $ \st -> summarise st st
| 84
|
showStateSummary = showWithState' $ \st -> summarise st st
| 58
| true
| true
| 1
| 7
| 17
| 34
| 16
| 18
| null | null |
pepeiborra/narradar
|
src/Narradar/Types/Var.hs
|
bsd-3-clause
|
uniqueId (Var _ i) = i
| 22
|
uniqueId (Var _ i) = i
| 22
|
uniqueId (Var _ i) = i
| 22
| false
| false
| 0
| 6
| 5
| 18
| 8
| 10
| null | null |
adinapoli/xmonad-contrib
|
XMonad/Layout/MagicFocus.hs
|
bsd-3-clause
|
followOnlyIf _ _ = return $ All True
| 36
|
followOnlyIf _ _ = return $ All True
| 36
|
followOnlyIf _ _ = return $ All True
| 36
| false
| false
| 0
| 6
| 7
| 18
| 8
| 10
| null | null |
OS2World/DEV-UTIL-HUGS
|
libraries/Graphics/Rendering/OpenGL/GL/PixelRectangles.hs
|
bsd-3-clause
|
ptr_glGetHistogramParameteriv :: FunPtr a ; ptr_glGetHistogramParameteriv = unsafePerformIO (Graphics.Rendering.OpenGL.GL.Extensions.getProcAddress ("GL_ARB_imaging") ("glGetHistogramParameteriv"))
| 197
|
ptr_glGetHistogramParameteriv :: FunPtr a
ptr_glGetHistogramParameteriv = unsafePerformIO (Graphics.Rendering.OpenGL.GL.Extensions.getProcAddress ("GL_ARB_imaging") ("glGetHistogramParameteriv"))
| 195
|
ptr_glGetHistogramParameteriv = unsafePerformIO (Graphics.Rendering.OpenGL.GL.Extensions.getProcAddress ("GL_ARB_imaging") ("glGetHistogramParameteriv"))
| 153
| false
| true
| 0
| 8
| 10
| 38
| 22
| 16
| null | null |
pooster/phdtracker
|
phdSpec.hs
|
bsd-3-clause
|
los2 = [s1]
| 11
|
los2 = [s1]
| 11
|
los2 = [s1]
| 11
| false
| false
| 1
| 5
| 2
| 12
| 5
| 7
| null | null |
kim/amazonka
|
amazonka-lambda/gen/Network/AWS/Lambda/CreateEventSourceMapping.hs
|
mpl-2.0
|
-- | The result of the last AWS Lambda invocation of your Lambda function.
cesmrLastProcessingResult :: Lens' CreateEventSourceMappingResponse (Maybe Text)
cesmrLastProcessingResult =
lens _cesmrLastProcessingResult
(\s a -> s { _cesmrLastProcessingResult = a })
| 274
|
cesmrLastProcessingResult :: Lens' CreateEventSourceMappingResponse (Maybe Text)
cesmrLastProcessingResult =
lens _cesmrLastProcessingResult
(\s a -> s { _cesmrLastProcessingResult = a })
| 199
|
cesmrLastProcessingResult =
lens _cesmrLastProcessingResult
(\s a -> s { _cesmrLastProcessingResult = a })
| 118
| true
| true
| 0
| 9
| 44
| 46
| 25
| 21
| null | null |
jwiegley/ghc-release
|
libraries/containers/Data/Sequence.hs
|
gpl-3.0
|
addDigits2 m1 (Four a b c d) e f (Two g h) m2 =
appendTree3 m1 (node3 a b c) (node3 d e f) (node2 g h) m2
| 109
|
addDigits2 m1 (Four a b c d) e f (Two g h) m2 =
appendTree3 m1 (node3 a b c) (node3 d e f) (node2 g h) m2
| 109
|
addDigits2 m1 (Four a b c d) e f (Two g h) m2 =
appendTree3 m1 (node3 a b c) (node3 d e f) (node2 g h) m2
| 109
| false
| false
| 0
| 7
| 31
| 78
| 38
| 40
| null | null |
Frefreak/Gideon
|
src/Manufacture.hs
|
bsd-3-clause
|
recipeItemName (RPIExport x1 _ _ _) = x1
| 40
|
recipeItemName (RPIExport x1 _ _ _) = x1
| 40
|
recipeItemName (RPIExport x1 _ _ _) = x1
| 40
| false
| false
| 0
| 7
| 7
| 21
| 10
| 11
| null | null |
timtylin/scholdoc
|
src/Text/Pandoc/Writers/Man.hs
|
gpl-2.0
|
inlineToMan _ Space = return space
| 34
|
inlineToMan _ Space = return space
| 34
|
inlineToMan _ Space = return space
| 34
| false
| false
| 0
| 5
| 5
| 14
| 6
| 8
| null | null |
gxtaillon/spot
|
src/lib/Language/SPO/Parser/Types.hs
|
gpl-3.0
|
isReturnStmt _ = False
| 22
|
isReturnStmt _ = False
| 22
|
isReturnStmt _ = False
| 22
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
Heather/clay
|
src/Clay/Attributes.hs
|
bsd-3-clause
|
loop = "loop"
| 13
|
loop = "loop"
| 13
|
loop = "loop"
| 13
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
ice1000/OI-codes
|
codewars/101-200/valid-parentheses.hs
|
agpl-3.0
|
begins (x : xs) (y : ys) | x == y = begins xs ys
| 48
|
begins (x : xs) (y : ys) | x == y = begins xs ys
| 48
|
begins (x : xs) (y : ys) | x == y = begins xs ys
| 48
| false
| false
| 0
| 8
| 14
| 42
| 19
| 23
| null | null |
tolysz/prepare-ghcjs
|
spec-lts8/base/Data/Data.hs
|
bsd-3-clause
|
-- | Build a term and use a generic function for subterms
fromConstrB :: Data a
=> (forall d. Data d => d)
-> Constr
-> a
fromConstrB f = unID . gunfold k z
where
k :: forall b r. Data b => ID (b -> r) -> ID r
k c = ID (unID c f)
z :: forall r. r -> ID r
z = ID
-- | Monadic variation on 'fromConstrB'
| 349
|
fromConstrB :: Data a
=> (forall d. Data d => d)
-> Constr
-> a
fromConstrB f = unID . gunfold k z
where
k :: forall b r. Data b => ID (b -> r) -> ID r
k c = ID (unID c f)
z :: forall r. r -> ID r
z = ID
-- | Monadic variation on 'fromConstrB'
| 291
|
fromConstrB f = unID . gunfold k z
where
k :: forall b r. Data b => ID (b -> r) -> ID r
k c = ID (unID c f)
z :: forall r. r -> ID r
z = ID
-- | Monadic variation on 'fromConstrB'
| 191
| true
| true
| 0
| 11
| 122
| 149
| 71
| 78
| null | null |
olsner/ghc
|
compiler/codeGen/StgCmmUtils.hs
|
bsd-3-clause
|
baseRegOffset dflags SpLim = oFFSET_StgRegTable_rSpLim dflags
| 70
|
baseRegOffset dflags SpLim = oFFSET_StgRegTable_rSpLim dflags
| 70
|
baseRegOffset dflags SpLim = oFFSET_StgRegTable_rSpLim dflags
| 70
| false
| false
| 0
| 5
| 14
| 14
| 6
| 8
| null | null |
mrkkrp/stack
|
src/Stack/Build/Installed.hs
|
bsd-3-clause
|
-- | Check if a can be included in the set of installed packages or not, based
-- on the package selections made by the user. This does not perform any
-- dirtiness or flag change checks.
isAllowed :: PackageInstallInfo pii
=> GetInstalledOpts
-> Maybe InstalledCache
-> Map PackageName pii
-> Maybe InstalledPackageLocation
-> DumpPackage Bool Bool Bool
-> Allowed
isAllowed opts mcache sourceMap mloc dp
-- Check that it can do profiling if necessary
| getInstalledProfiling opts && isJust mcache && not (dpProfiling dp) = NeedsProfiling
-- Check that it has haddocks if necessary
| getInstalledHaddock opts && isJust mcache && not (dpHaddock dp) = NeedsHaddock
-- Check that it has haddocks if necessary
| getInstalledSymbols opts && isJust mcache && not (dpSymbols dp) = NeedsSymbols
| otherwise =
case Map.lookup name sourceMap of
Nothing ->
case mloc of
-- The sourceMap has nothing to say about this global
-- package, so we can use it
Nothing -> Allowed
Just ExtraGlobal -> Allowed
-- For non-global packages, don't include unknown packages.
-- See:
-- https://github.com/commercialhaskell/stack/issues/292
Just _ -> UnknownPkg
Just pii
| not (checkLocation (piiLocation pii)) -> WrongLocation mloc (piiLocation pii)
| version /= piiVersion pii -> WrongVersion version (piiVersion pii)
| otherwise -> Allowed
where
PackageIdentifier name version = dpPackageIdent dp
-- Ensure that the installed location matches where the sourceMap says it
-- should be installed
checkLocation Snap = mloc /= Just (InstalledTo Local) -- we can allow either global or snap
checkLocation Local = mloc == Just (InstalledTo Local) || mloc == Just ExtraGlobal -- 'locally' installed snapshot packages can come from extra dbs
| 2,076
|
isAllowed :: PackageInstallInfo pii
=> GetInstalledOpts
-> Maybe InstalledCache
-> Map PackageName pii
-> Maybe InstalledPackageLocation
-> DumpPackage Bool Bool Bool
-> Allowed
isAllowed opts mcache sourceMap mloc dp
-- Check that it can do profiling if necessary
| getInstalledProfiling opts && isJust mcache && not (dpProfiling dp) = NeedsProfiling
-- Check that it has haddocks if necessary
| getInstalledHaddock opts && isJust mcache && not (dpHaddock dp) = NeedsHaddock
-- Check that it has haddocks if necessary
| getInstalledSymbols opts && isJust mcache && not (dpSymbols dp) = NeedsSymbols
| otherwise =
case Map.lookup name sourceMap of
Nothing ->
case mloc of
-- The sourceMap has nothing to say about this global
-- package, so we can use it
Nothing -> Allowed
Just ExtraGlobal -> Allowed
-- For non-global packages, don't include unknown packages.
-- See:
-- https://github.com/commercialhaskell/stack/issues/292
Just _ -> UnknownPkg
Just pii
| not (checkLocation (piiLocation pii)) -> WrongLocation mloc (piiLocation pii)
| version /= piiVersion pii -> WrongVersion version (piiVersion pii)
| otherwise -> Allowed
where
PackageIdentifier name version = dpPackageIdent dp
-- Ensure that the installed location matches where the sourceMap says it
-- should be installed
checkLocation Snap = mloc /= Just (InstalledTo Local) -- we can allow either global or snap
checkLocation Local = mloc == Just (InstalledTo Local) || mloc == Just ExtraGlobal -- 'locally' installed snapshot packages can come from extra dbs
| 1,888
|
isAllowed opts mcache sourceMap mloc dp
-- Check that it can do profiling if necessary
| getInstalledProfiling opts && isJust mcache && not (dpProfiling dp) = NeedsProfiling
-- Check that it has haddocks if necessary
| getInstalledHaddock opts && isJust mcache && not (dpHaddock dp) = NeedsHaddock
-- Check that it has haddocks if necessary
| getInstalledSymbols opts && isJust mcache && not (dpSymbols dp) = NeedsSymbols
| otherwise =
case Map.lookup name sourceMap of
Nothing ->
case mloc of
-- The sourceMap has nothing to say about this global
-- package, so we can use it
Nothing -> Allowed
Just ExtraGlobal -> Allowed
-- For non-global packages, don't include unknown packages.
-- See:
-- https://github.com/commercialhaskell/stack/issues/292
Just _ -> UnknownPkg
Just pii
| not (checkLocation (piiLocation pii)) -> WrongLocation mloc (piiLocation pii)
| version /= piiVersion pii -> WrongVersion version (piiVersion pii)
| otherwise -> Allowed
where
PackageIdentifier name version = dpPackageIdent dp
-- Ensure that the installed location matches where the sourceMap says it
-- should be installed
checkLocation Snap = mloc /= Just (InstalledTo Local) -- we can allow either global or snap
checkLocation Local = mloc == Just (InstalledTo Local) || mloc == Just ExtraGlobal -- 'locally' installed snapshot packages can come from extra dbs
| 1,650
| true
| true
| 6
| 16
| 633
| 395
| 184
| 211
| null | null |
siddhanathan/ghc
|
compiler/main/DriverPipeline.hs
|
bsd-3-clause
|
compileOne :: HscEnv
-> ModSummary -- ^ summary for module being compiled
-> Int -- ^ module N ...
-> Int -- ^ ... of M
-> Maybe ModIface -- ^ old interface, if we have one
-> Maybe Linkable -- ^ old linkable, if we have one
-> SourceModified
-> IO HomeModInfo -- ^ the complete HomeModInfo, if successful
compileOne = compileOne' Nothing (Just batchMsg)
| 465
|
compileOne :: HscEnv
-> ModSummary -- ^ summary for module being compiled
-> Int -- ^ module N ...
-> Int -- ^ ... of M
-> Maybe ModIface -- ^ old interface, if we have one
-> Maybe Linkable -- ^ old linkable, if we have one
-> SourceModified
-> IO HomeModInfo
compileOne = compileOne' Nothing (Just batchMsg)
| 417
|
compileOne = compileOne' Nothing (Just batchMsg)
| 48
| true
| true
| 0
| 12
| 176
| 65
| 34
| 31
| null | null |
Siprj/xmonadrc
|
src/xmonad.hs
|
mit
|
newKeyboardHandling :: [String] -> IO (IORef [String])
newKeyboardHandling k = newIORef k
| 89
|
newKeyboardHandling :: [String] -> IO (IORef [String])
newKeyboardHandling k = newIORef k
| 89
|
newKeyboardHandling k = newIORef k
| 34
| false
| true
| 0
| 9
| 11
| 36
| 18
| 18
| null | null |
shepheb/dnponline
|
Settings.hs
|
bsd-2-clause
|
-- | Your application will keep a connection pool and take connections from
-- there as necessary instead of continually creating new connections. This
-- value gives the maximum number of connections to be open at a given time.
-- If your application requests a connection when all connections are in
-- use, that request will fail. Try to choose a number that will work well
-- with the system resources available to you while providing enough
-- connections for your expected load.
--
-- Also, connections are returned to the pool as quickly as possible by
-- Yesod to avoid resource exhaustion. A connection is only considered in
-- use while within a call to runDB.
connectionCount :: Int
connectionCount = 10
| 714
|
connectionCount :: Int
connectionCount = 10
| 43
|
connectionCount = 10
| 20
| true
| true
| 0
| 4
| 122
| 22
| 17
| 5
| null | null |
jacekszymanski/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxSTC_YAML_IDENTIFIER :: Int
wxSTC_YAML_IDENTIFIER = 2
| 54
|
wxSTC_YAML_IDENTIFIER :: Int
wxSTC_YAML_IDENTIFIER = 2
| 54
|
wxSTC_YAML_IDENTIFIER = 2
| 25
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
vollmerm/accelerate-apart
|
Data/Array/Accelerate/Apart/Type.hs
|
bsd-3-clause
|
integralTypeToC (TypeCULLong _) = [cty|unsigned long long int|]
| 63
|
integralTypeToC (TypeCULLong _) = [cty|unsigned long long int|]
| 63
|
integralTypeToC (TypeCULLong _) = [cty|unsigned long long int|]
| 63
| false
| false
| 0
| 6
| 7
| 20
| 11
| 9
| null | null |
rahulmutt/ghcvm
|
libraries/base/GHC/IO/Handle/FD.hs
|
bsd-3-clause
|
openFile' :: String -> IOMode -> Bool -> Bool -> IO Handle
openFile' filepath iomode binary non_blocking = do
-- first open the file to get an FD
(fd, fd_type) <- FD.openFile filepath iomode non_blocking
mb_codec <- if binary then return Nothing else fmap Just getLocaleEncoding
-- then use it to make a Handle
mkHandleFromFD fd fd_type filepath iomode
False {- do not *set* non-blocking mode -}
mb_codec
`onException` IODevice.close fd
-- NB. don't forget to close the FD if mkHandleFromFD fails, otherwise
-- this FD leaks.
-- ASSERT: if we just created the file, then fdToHandle' won't fail
-- (so we don't need to worry about removing the newly created file
-- in the event of an error).
-- ---------------------------------------------------------------------------
-- Converting file descriptors to Handles
| 917
|
openFile' :: String -> IOMode -> Bool -> Bool -> IO Handle
openFile' filepath iomode binary non_blocking = do
-- first open the file to get an FD
(fd, fd_type) <- FD.openFile filepath iomode non_blocking
mb_codec <- if binary then return Nothing else fmap Just getLocaleEncoding
-- then use it to make a Handle
mkHandleFromFD fd fd_type filepath iomode
False {- do not *set* non-blocking mode -}
mb_codec
`onException` IODevice.close fd
-- NB. don't forget to close the FD if mkHandleFromFD fails, otherwise
-- this FD leaks.
-- ASSERT: if we just created the file, then fdToHandle' won't fail
-- (so we don't need to worry about removing the newly created file
-- in the event of an error).
-- ---------------------------------------------------------------------------
-- Converting file descriptors to Handles
| 917
|
openFile' filepath iomode binary non_blocking = do
-- first open the file to get an FD
(fd, fd_type) <- FD.openFile filepath iomode non_blocking
mb_codec <- if binary then return Nothing else fmap Just getLocaleEncoding
-- then use it to make a Handle
mkHandleFromFD fd fd_type filepath iomode
False {- do not *set* non-blocking mode -}
mb_codec
`onException` IODevice.close fd
-- NB. don't forget to close the FD if mkHandleFromFD fails, otherwise
-- this FD leaks.
-- ASSERT: if we just created the file, then fdToHandle' won't fail
-- (so we don't need to worry about removing the newly created file
-- in the event of an error).
-- ---------------------------------------------------------------------------
-- Converting file descriptors to Handles
| 858
| false
| true
| 0
| 9
| 231
| 121
| 64
| 57
| null | null |
kelnage/tamarin-prover
|
lib/theory/src/Theory/Tools/IntruderRules.hs
|
gpl-3.0
|
normRule' :: IntrRuleAC -> WithMaude IntrRuleAC
normRule' (Rule i ps cs as) = reader $ \hnd ->
let normFactTerms = map (fmap (\t -> norm' t `runReader` hnd)) in
Rule i (normFactTerms ps) (normFactTerms cs) (normFactTerms as)
| 232
|
normRule' :: IntrRuleAC -> WithMaude IntrRuleAC
normRule' (Rule i ps cs as) = reader $ \hnd ->
let normFactTerms = map (fmap (\t -> norm' t `runReader` hnd)) in
Rule i (normFactTerms ps) (normFactTerms cs) (normFactTerms as)
| 232
|
normRule' (Rule i ps cs as) = reader $ \hnd ->
let normFactTerms = map (fmap (\t -> norm' t `runReader` hnd)) in
Rule i (normFactTerms ps) (normFactTerms cs) (normFactTerms as)
| 184
| false
| true
| 0
| 17
| 44
| 106
| 53
| 53
| null | null |
s9gf4ult/yesod
|
yesod-form/Yesod/Form/Bootstrap3.hs
|
mit
|
-- | Render the given form using Bootstrap v3 conventions.
--
-- Since: yesod-form 1.3.8
renderBootstrap3 :: Monad m => BootstrapFormLayout -> FormRender m a
renderBootstrap3 formLayout aform fragment = do
(res, views') <- aFormToForm aform
let views = views' []
has (Just _) = True
has Nothing = False
widget = [whamlet|
$newline never
#{fragment}
$forall view <- views
<div .form-group :fvRequired view:.required :not $ fvRequired view:.optional :has $ fvErrors view:.has-error>
$case formLayout
$of BootstrapBasicForm
$if fvId view /= bootstrapSubmitId
<label for=#{fvId view}>#{fvLabel view}
^{fvInput view}
^{helpWidget view}
$of BootstrapInlineForm
$if fvId view /= bootstrapSubmitId
<label .sr-only for=#{fvId view}>#{fvLabel view}
^{fvInput view}
^{helpWidget view}
$of BootstrapHorizontalForm labelOffset labelSize inputOffset inputSize
$if fvId view /= bootstrapSubmitId
<label .control-label .#{toOffset labelOffset} .#{toColumn labelSize} for=#{fvId view}>#{fvLabel view}
<div .#{toOffset inputOffset} .#{toColumn inputSize}>
^{fvInput view}
^{helpWidget view}
$else
<div .#{toOffset (addGO inputOffset (addGO labelOffset labelSize))} .#{toColumn inputSize}>
^{fvInput view}
^{helpWidget view}
|]
return (res, widget)
-- | (Internal) Render a help widget for tooltips and errors.
| 1,832
|
renderBootstrap3 :: Monad m => BootstrapFormLayout -> FormRender m a
renderBootstrap3 formLayout aform fragment = do
(res, views') <- aFormToForm aform
let views = views' []
has (Just _) = True
has Nothing = False
widget = [whamlet|
$newline never
#{fragment}
$forall view <- views
<div .form-group :fvRequired view:.required :not $ fvRequired view:.optional :has $ fvErrors view:.has-error>
$case formLayout
$of BootstrapBasicForm
$if fvId view /= bootstrapSubmitId
<label for=#{fvId view}>#{fvLabel view}
^{fvInput view}
^{helpWidget view}
$of BootstrapInlineForm
$if fvId view /= bootstrapSubmitId
<label .sr-only for=#{fvId view}>#{fvLabel view}
^{fvInput view}
^{helpWidget view}
$of BootstrapHorizontalForm labelOffset labelSize inputOffset inputSize
$if fvId view /= bootstrapSubmitId
<label .control-label .#{toOffset labelOffset} .#{toColumn labelSize} for=#{fvId view}>#{fvLabel view}
<div .#{toOffset inputOffset} .#{toColumn inputSize}>
^{fvInput view}
^{helpWidget view}
$else
<div .#{toOffset (addGO inputOffset (addGO labelOffset labelSize))} .#{toColumn inputSize}>
^{fvInput view}
^{helpWidget view}
|]
return (res, widget)
-- | (Internal) Render a help widget for tooltips and errors.
| 1,743
|
renderBootstrap3 formLayout aform fragment = do
(res, views') <- aFormToForm aform
let views = views' []
has (Just _) = True
has Nothing = False
widget = [whamlet|
$newline never
#{fragment}
$forall view <- views
<div .form-group :fvRequired view:.required :not $ fvRequired view:.optional :has $ fvErrors view:.has-error>
$case formLayout
$of BootstrapBasicForm
$if fvId view /= bootstrapSubmitId
<label for=#{fvId view}>#{fvLabel view}
^{fvInput view}
^{helpWidget view}
$of BootstrapInlineForm
$if fvId view /= bootstrapSubmitId
<label .sr-only for=#{fvId view}>#{fvLabel view}
^{fvInput view}
^{helpWidget view}
$of BootstrapHorizontalForm labelOffset labelSize inputOffset inputSize
$if fvId view /= bootstrapSubmitId
<label .control-label .#{toOffset labelOffset} .#{toColumn labelSize} for=#{fvId view}>#{fvLabel view}
<div .#{toOffset inputOffset} .#{toColumn inputSize}>
^{fvInput view}
^{helpWidget view}
$else
<div .#{toOffset (addGO inputOffset (addGO labelOffset labelSize))} .#{toColumn inputSize}>
^{fvInput view}
^{helpWidget view}
|]
return (res, widget)
-- | (Internal) Render a help widget for tooltips and errors.
| 1,674
| true
| true
| 0
| 12
| 703
| 111
| 58
| 53
| null | null |
scwe/HaskLearn
|
NaiveBayes.hs
|
gpl-2.0
|
getFeatures :: Instance -> [Feature]
getFeatures (Instance _ feat) = feat
| 73
|
getFeatures :: Instance -> [Feature]
getFeatures (Instance _ feat) = feat
| 73
|
getFeatures (Instance _ feat) = feat
| 36
| false
| true
| 0
| 7
| 10
| 29
| 15
| 14
| null | null |
agocorona/transient
|
src/Transient/Parse.hs
|
mit
|
chainSepBy chain p sep= chainSepBy1 chain p sep <|> return mempty
| 65
|
chainSepBy chain p sep= chainSepBy1 chain p sep <|> return mempty
| 65
|
chainSepBy chain p sep= chainSepBy1 chain p sep <|> return mempty
| 65
| false
| false
| 1
| 6
| 10
| 34
| 12
| 22
| null | null |
camspiers/Zendo
|
src/Zendo/Parser.hs
|
mit
|
funcTerm :: Parser Func
funcTerm = do l <- expr
c <- com ">" GreaterThan <|> com "<" LessThan <|> com "=" Equal
r <- expr
return (c l r)
<?> "function term"
where com s f = do skipSpaces (string s); return f
| 271
|
funcTerm :: Parser Func
funcTerm = do l <- expr
c <- com ">" GreaterThan <|> com "<" LessThan <|> com "=" Equal
r <- expr
return (c l r)
<?> "function term"
where com s f = do skipSpaces (string s); return f
| 271
|
funcTerm = do l <- expr
c <- com ">" GreaterThan <|> com "<" LessThan <|> com "=" Equal
r <- expr
return (c l r)
<?> "function term"
where com s f = do skipSpaces (string s); return f
| 247
| false
| true
| 3
| 10
| 107
| 119
| 49
| 70
| null | null |
robinp/haskell-indexer
|
haskell-indexer-backend-ghc/src/Language/Haskell/Indexer/Backend/Ghc.hs
|
apache-2.0
|
instanceAbsBinds _ = Nothing
| 28
|
instanceAbsBinds _ = Nothing
| 28
|
instanceAbsBinds _ = Nothing
| 28
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
yamadapc/hpack-convert
|
src/Hpack/Config.hs
|
mit
|
removeEmptyArrays v = v
| 23
|
removeEmptyArrays v = v
| 23
|
removeEmptyArrays v = v
| 23
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
fehrenbach/rechts
|
app/Pretty.hs
|
gpl-3.0
|
-- <> ":" <+> prettyType t
prettyCode (Record es) =
braces (align (ke (Map.toAscList es)))
where
ke [] = empty
ke [(k, e)] = label k <> " = " <> group (prettyCode e)
ke ((k, e):kes) = label k <> " = " <> group (prettyCode e) <> "," <$> ke kes
| 258
|
prettyCode (Record es) =
braces (align (ke (Map.toAscList es)))
where
ke [] = empty
ke [(k, e)] = label k <> " = " <> group (prettyCode e)
ke ((k, e):kes) = label k <> " = " <> group (prettyCode e) <> "," <$> ke kes
| 231
|
prettyCode (Record es) =
braces (align (ke (Map.toAscList es)))
where
ke [] = empty
ke [(k, e)] = label k <> " = " <> group (prettyCode e)
ke ((k, e):kes) = label k <> " = " <> group (prettyCode e) <> "," <$> ke kes
| 231
| true
| false
| 0
| 12
| 68
| 141
| 70
| 71
| null | null |
phadej/stack
|
src/Stack/Types/Config.hs
|
bsd-3-clause
|
toResolverNotLoaded :: LoadedResolver -> Resolver
toResolverNotLoaded r = case r of
ResolverSnapshot s -> ResolverSnapshot s
ResolverCompiler v -> ResolverCompiler v
ResolverCustomLoaded n l _ -> ResolverCustom n l
-- | Class for environment values which have access to the stack root
| 297
|
toResolverNotLoaded :: LoadedResolver -> Resolver
toResolverNotLoaded r = case r of
ResolverSnapshot s -> ResolverSnapshot s
ResolverCompiler v -> ResolverCompiler v
ResolverCustomLoaded n l _ -> ResolverCustom n l
-- | Class for environment values which have access to the stack root
| 297
|
toResolverNotLoaded r = case r of
ResolverSnapshot s -> ResolverSnapshot s
ResolverCompiler v -> ResolverCompiler v
ResolverCustomLoaded n l _ -> ResolverCustom n l
-- | Class for environment values which have access to the stack root
| 247
| false
| true
| 0
| 8
| 54
| 65
| 30
| 35
| null | null |
ctford/Idris-Elba-dev
|
src/Idris/ElabTerm.hs
|
bsd-3-clause
|
reifyRaw t@(P _ n _)
| n == reflm "RType" = return $ RType
| 67
|
reifyRaw t@(P _ n _)
| n == reflm "RType" = return $ RType
| 67
|
reifyRaw t@(P _ n _)
| n == reflm "RType" = return $ RType
| 67
| false
| false
| 0
| 9
| 22
| 39
| 18
| 21
| null | null |
NorfairKing/sus-depot
|
shared/shared/xmonad/azerty/Workspaces.hs
|
gpl-2.0
|
-- | The workspace that will be on screen after launch
startupWorkspace = mr
| 76
|
startupWorkspace = mr
| 21
|
startupWorkspace = mr
| 21
| true
| false
| 0
| 4
| 13
| 7
| 4
| 3
| null | null |
brendanhay/gogol
|
gogol-redis/gen/Network/Google/Resource/Redis/Projects/Locations/Instances/Failover.hs
|
mpl-2.0
|
-- | V1 error format.
plifXgafv :: Lens' ProjectsLocationsInstancesFailover (Maybe Xgafv)
plifXgafv
= lens _plifXgafv (\ s a -> s{_plifXgafv = a})
| 148
|
plifXgafv :: Lens' ProjectsLocationsInstancesFailover (Maybe Xgafv)
plifXgafv
= lens _plifXgafv (\ s a -> s{_plifXgafv = a})
| 126
|
plifXgafv
= lens _plifXgafv (\ s a -> s{_plifXgafv = a})
| 58
| true
| true
| 1
| 9
| 23
| 52
| 25
| 27
| null | null |
ditto-lang/ditto
|
src/Ditto/Test.hs
|
gpl-3.0
|
simpleDependentPatterns = unlines
[ "data Bool : Type where"
, "| true,false : Bool"
, "end"
, "data Nat : Type where"
, "| zero : Nat"
, "| suc (n : Nat) : Nat"
, "end"
, "def add (n,m : Nat) : Nat where"
, "| zero m = m"
, "| (suc n) m = suc (add n m)"
, "end"
, "def mult (n,m : Nat) : Nat where"
, "| zero m = zero"
, "| (suc n) m = add n (mult n m)"
, "end"
, "data Bits (n : Nat) : Type where"
, "| nil : Bits zero"
, "| cons (n : Nat) (b : Bool) (bs : Bits n) : Bits (suc n)"
, "end"
, "def append (n,m : Nat) (xs : Bits n) (ys : Bits m) : Bits (add n m) where"
, "| * m nil ys = ys"
, "| * m (cons n x xs) ys = cons (add n m) x (append n m xs ys)"
, "end"
, "def copyBits (n : Nat) (bs : Bits n) : Bits n where"
, "| * nil = nil"
, "| * (cons n b bs) = cons n b bs"
, "end"
]
| 845
|
simpleDependentPatterns = unlines
[ "data Bool : Type where"
, "| true,false : Bool"
, "end"
, "data Nat : Type where"
, "| zero : Nat"
, "| suc (n : Nat) : Nat"
, "end"
, "def add (n,m : Nat) : Nat where"
, "| zero m = m"
, "| (suc n) m = suc (add n m)"
, "end"
, "def mult (n,m : Nat) : Nat where"
, "| zero m = zero"
, "| (suc n) m = add n (mult n m)"
, "end"
, "data Bits (n : Nat) : Type where"
, "| nil : Bits zero"
, "| cons (n : Nat) (b : Bool) (bs : Bits n) : Bits (suc n)"
, "end"
, "def append (n,m : Nat) (xs : Bits n) (ys : Bits m) : Bits (add n m) where"
, "| * m nil ys = ys"
, "| * m (cons n x xs) ys = cons (add n m) x (append n m xs ys)"
, "end"
, "def copyBits (n : Nat) (bs : Bits n) : Bits n where"
, "| * nil = nil"
, "| * (cons n b bs) = cons n b bs"
, "end"
]
| 845
|
simpleDependentPatterns = unlines
[ "data Bool : Type where"
, "| true,false : Bool"
, "end"
, "data Nat : Type where"
, "| zero : Nat"
, "| suc (n : Nat) : Nat"
, "end"
, "def add (n,m : Nat) : Nat where"
, "| zero m = m"
, "| (suc n) m = suc (add n m)"
, "end"
, "def mult (n,m : Nat) : Nat where"
, "| zero m = zero"
, "| (suc n) m = add n (mult n m)"
, "end"
, "data Bits (n : Nat) : Type where"
, "| nil : Bits zero"
, "| cons (n : Nat) (b : Bool) (bs : Bits n) : Bits (suc n)"
, "end"
, "def append (n,m : Nat) (xs : Bits n) (ys : Bits m) : Bits (add n m) where"
, "| * m nil ys = ys"
, "| * m (cons n x xs) ys = cons (add n m) x (append n m xs ys)"
, "end"
, "def copyBits (n : Nat) (bs : Bits n) : Bits n where"
, "| * nil = nil"
, "| * (cons n b bs) = cons n b bs"
, "end"
]
| 845
| false
| false
| 0
| 5
| 272
| 90
| 58
| 32
| null | null |
siddhanathan/yi
|
yi-keymap-vim/src/Yi/Keymap/Vim/StateUtils.hs
|
gpl-2.0
|
switchModeE :: VimMode -> EditorM ()
switchModeE mode = modifyStateE $ switchMode mode
| 86
|
switchModeE :: VimMode -> EditorM ()
switchModeE mode = modifyStateE $ switchMode mode
| 86
|
switchModeE mode = modifyStateE $ switchMode mode
| 49
| false
| true
| 0
| 7
| 12
| 30
| 14
| 16
| null | null |
redfish64/IrcScanner
|
src/Learn/Box.hs
|
bsd-3-clause
|
-- Get the a out of the box.
unbox :: Box a -> a
unbox f = f id
| 63
|
unbox :: Box a -> a
unbox f = f id
| 34
|
unbox f = f id
| 14
| true
| true
| 0
| 7
| 18
| 30
| 13
| 17
| null | null |
aleksanb/hdc
|
src/Serializer.hs
|
mit
|
serialize :: [IR] -> [String]
serialize instructions = (map serializeInstruction instructions)
| 94
|
serialize :: [IR] -> [String]
serialize instructions = (map serializeInstruction instructions)
| 94
|
serialize instructions = (map serializeInstruction instructions)
| 64
| false
| true
| 0
| 8
| 10
| 38
| 18
| 20
| null | null |
SAdams601/HaRe
|
old/refactorer/RefacDupTrans.hs
|
bsd-3-clause
|
catPositions ('[':ps)
= grabbed : catPositions ps'
where
(grabbed, ps') = (grabPositions ps, dropPositions ps)
grabPositions [] = []
grabPositions (']':xs) = []
grabPositions ('<':'&':'>':ps)
= ":" ++ grabPositions ps
grabPositions (x:xs) = x : grabPositions xs
dropPositions [] = []
dropPositions (']':xs) = xs
dropPositions (x:xs) = dropPositions xs
| 435
|
catPositions ('[':ps)
= grabbed : catPositions ps'
where
(grabbed, ps') = (grabPositions ps, dropPositions ps)
grabPositions [] = []
grabPositions (']':xs) = []
grabPositions ('<':'&':'>':ps)
= ":" ++ grabPositions ps
grabPositions (x:xs) = x : grabPositions xs
dropPositions [] = []
dropPositions (']':xs) = xs
dropPositions (x:xs) = dropPositions xs
| 435
|
catPositions ('[':ps)
= grabbed : catPositions ps'
where
(grabbed, ps') = (grabPositions ps, dropPositions ps)
grabPositions [] = []
grabPositions (']':xs) = []
grabPositions ('<':'&':'>':ps)
= ":" ++ grabPositions ps
grabPositions (x:xs) = x : grabPositions xs
dropPositions [] = []
dropPositions (']':xs) = xs
dropPositions (x:xs) = dropPositions xs
| 435
| false
| false
| 7
| 8
| 133
| 186
| 89
| 97
| null | null |
duplode/stack
|
src/Stack/Package.hs
|
bsd-3-clause
|
resolveFileOrWarn :: (MonadThrow m,MonadIO m,MonadLogger m,MonadReader (Path Abs File, Path Abs Dir) m)
=> FilePath.FilePath
-> m (Maybe (Path Abs File))
resolveFileOrWarn = resolveOrWarn "File" resolveFileMaybe
| 247
|
resolveFileOrWarn :: (MonadThrow m,MonadIO m,MonadLogger m,MonadReader (Path Abs File, Path Abs Dir) m)
=> FilePath.FilePath
-> m (Maybe (Path Abs File))
resolveFileOrWarn = resolveOrWarn "File" resolveFileMaybe
| 247
|
resolveFileOrWarn = resolveOrWarn "File" resolveFileMaybe
| 57
| false
| true
| 0
| 11
| 61
| 84
| 42
| 42
| null | null |
konn/hint-forked
|
unit-tests/run-unit-tests.hs
|
bsd-3-clause
|
setSandbox :: Interpreter ()
setSandbox = set [installedModulesInScope := False]
| 80
|
setSandbox :: Interpreter ()
setSandbox = set [installedModulesInScope := False]
| 80
|
setSandbox = set [installedModulesInScope := False]
| 51
| false
| true
| 1
| 6
| 9
| 29
| 13
| 16
| null | null |
Fermat/Gottlob
|
Language/Eval.hs
|
bsd-3-clause
|
simp :: PreTerm -> Global PreTerm
simp (App (Lambda x p1) p2 ) = simp $ runSubst p2 (PVar x) p1
| 96
|
simp :: PreTerm -> Global PreTerm
simp (App (Lambda x p1) p2 ) = simp $ runSubst p2 (PVar x) p1
| 96
|
simp (App (Lambda x p1) p2 ) = simp $ runSubst p2 (PVar x) p1
| 61
| false
| true
| 0
| 11
| 21
| 58
| 27
| 31
| null | null |
afcowie/pipes-http
|
tests/MockServer.hs
|
bsd-3-clause
|
serveNotFound :: Snap a
serveNotFound = do
modifyResponse $ setResponseStatus 404 "Not Found"
modifyResponse $ setHeader "Content-Type" "text/html"
writeBS "404 Not Found"
r <- getResponse
finishWith r
| 223
|
serveNotFound :: Snap a
serveNotFound = do
modifyResponse $ setResponseStatus 404 "Not Found"
modifyResponse $ setHeader "Content-Type" "text/html"
writeBS "404 Not Found"
r <- getResponse
finishWith r
| 223
|
serveNotFound = do
modifyResponse $ setResponseStatus 404 "Not Found"
modifyResponse $ setHeader "Content-Type" "text/html"
writeBS "404 Not Found"
r <- getResponse
finishWith r
| 199
| false
| true
| 0
| 8
| 48
| 57
| 24
| 33
| null | null |
pimlott/diff-du
|
diff-du.hs
|
bsd-3-clause
|
showsDu1 :: Du -> ([String] -> [String])
showsDu1 (Du p s cs) = showsDu' cs . ((printf "%+-8d " s ++ p) :)
| 106
|
showsDu1 :: Du -> ([String] -> [String])
showsDu1 (Du p s cs) = showsDu' cs . ((printf "%+-8d " s ++ p) :)
| 106
|
showsDu1 (Du p s cs) = showsDu' cs . ((printf "%+-8d " s ++ p) :)
| 65
| false
| true
| 0
| 10
| 22
| 70
| 35
| 35
| null | null |
AmpersandTarski/ampersand
|
src/Ampersand/Basics/Auxiliaries.hs
|
gpl-3.0
|
eqClass f (x:xs) = (x:[e |e<-xs, f x e]) : eqClass f [e |e<-xs, not (f x e)]
| 76
|
eqClass f (x:xs) = (x:[e |e<-xs, f x e]) : eqClass f [e |e<-xs, not (f x e)]
| 76
|
eqClass f (x:xs) = (x:[e |e<-xs, f x e]) : eqClass f [e |e<-xs, not (f x e)]
| 76
| false
| false
| 0
| 11
| 17
| 80
| 40
| 40
| null | null |
Lainepress/hledger
|
hledger-lib/Hledger/Utils/UTF8.hs
|
gpl-3.0
|
stripBOM :: B.ByteString -> B.ByteString
stripBOM s | bom `B.isPrefixOf` s = B.drop 3 s
| 87
|
stripBOM :: B.ByteString -> B.ByteString
stripBOM s | bom `B.isPrefixOf` s = B.drop 3 s
| 87
|
stripBOM s | bom `B.isPrefixOf` s = B.drop 3 s
| 46
| false
| true
| 0
| 8
| 14
| 48
| 22
| 26
| null | null |
mortberg/cubicaltt
|
Resolver.hs
|
mit
|
resolveTele ((i,d):t) =
((i,) <$> resolveExp d) <:> local (insertVar i) (resolveTele t)
| 89
|
resolveTele ((i,d):t) =
((i,) <$> resolveExp d) <:> local (insertVar i) (resolveTele t)
| 89
|
resolveTele ((i,d):t) =
((i,) <$> resolveExp d) <:> local (insertVar i) (resolveTele t)
| 89
| false
| false
| 2
| 7
| 14
| 60
| 30
| 30
| null | null |
t4sk/upenn-cis194
|
hw-11/SExpr.hs
|
mit
|
------------------------------------------------------------
-- 2. Utilities
------------------------------------------------------------
spaces :: Parser String
spaces = zeroOrMore (satisfy isSpace)
| 201
|
spaces :: Parser String
spaces = zeroOrMore (satisfy isSpace)
| 61
|
spaces = zeroOrMore (satisfy isSpace)
| 37
| true
| true
| 0
| 7
| 15
| 26
| 14
| 12
| null | null |
elieux/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
wayOptl platform WayThreaded =
case platformOS platform of
-- FreeBSD's default threading library is the KSE-based M:N libpthread,
-- which GHC has some problems with. It's currently not clear whether
-- the problems are our fault or theirs, but it seems that using the
-- alternative 1:1 threading library libthr works around it:
OSFreeBSD -> ["-lthr"]
OSOpenBSD -> ["-pthread"]
OSNetBSD -> ["-pthread"]
_ -> []
| 498
|
wayOptl platform WayThreaded =
case platformOS platform of
-- FreeBSD's default threading library is the KSE-based M:N libpthread,
-- which GHC has some problems with. It's currently not clear whether
-- the problems are our fault or theirs, but it seems that using the
-- alternative 1:1 threading library libthr works around it:
OSFreeBSD -> ["-lthr"]
OSOpenBSD -> ["-pthread"]
OSNetBSD -> ["-pthread"]
_ -> []
| 498
|
wayOptl platform WayThreaded =
case platformOS platform of
-- FreeBSD's default threading library is the KSE-based M:N libpthread,
-- which GHC has some problems with. It's currently not clear whether
-- the problems are our fault or theirs, but it seems that using the
-- alternative 1:1 threading library libthr works around it:
OSFreeBSD -> ["-lthr"]
OSOpenBSD -> ["-pthread"]
OSNetBSD -> ["-pthread"]
_ -> []
| 498
| false
| false
| 0
| 8
| 150
| 57
| 31
| 26
| null | null |
sdiehl/ghc
|
libraries/base/Foreign/C/Error.hs
|
bsd-3-clause
|
eNOBUFS = Errno (CONST_ENOBUFS)
| 39
|
eNOBUFS = Errno (CONST_ENOBUFS)
| 39
|
eNOBUFS = Errno (CONST_ENOBUFS)
| 39
| false
| false
| 1
| 5
| 11
| 15
| 6
| 9
| null | null |
urbanslug/ghc
|
compiler/codeGen/StgCmmPrim.hs
|
bsd-3-clause
|
emitPrimOp dflags res IndexOffAddrOp_Int32 args = doIndexOffAddrOp (Just (mo_s_32ToWord dflags)) b32 res args
| 122
|
emitPrimOp dflags res IndexOffAddrOp_Int32 args = doIndexOffAddrOp (Just (mo_s_32ToWord dflags)) b32 res args
| 122
|
emitPrimOp dflags res IndexOffAddrOp_Int32 args = doIndexOffAddrOp (Just (mo_s_32ToWord dflags)) b32 res args
| 122
| false
| false
| 0
| 9
| 25
| 37
| 17
| 20
| null | null |
spacekitteh/smcghc
|
utils/hpc/HpcMarkup.hs
|
bsd-3-clause
|
writeFileUsing :: String -> String -> IO ()
writeFileUsing filename text = do
let dest_dir = reverse . dropWhile (\ x -> x /= '/') . reverse $ filename
-- We need to check for the dest_dir each time, because we use sub-dirs for
-- packages, and a single .tix file might contain information about
-- many package.
-- create the dest_dir if needed
when (not (null dest_dir)) $
createDirectoryIfMissing True dest_dir
writeFile filename text
------------------------------------------------------------------------------
-- global color pallete
| 556
|
writeFileUsing :: String -> String -> IO ()
writeFileUsing filename text = do
let dest_dir = reverse . dropWhile (\ x -> x /= '/') . reverse $ filename
-- We need to check for the dest_dir each time, because we use sub-dirs for
-- packages, and a single .tix file might contain information about
-- many package.
-- create the dest_dir if needed
when (not (null dest_dir)) $
createDirectoryIfMissing True dest_dir
writeFile filename text
------------------------------------------------------------------------------
-- global color pallete
| 556
|
writeFileUsing filename text = do
let dest_dir = reverse . dropWhile (\ x -> x /= '/') . reverse $ filename
-- We need to check for the dest_dir each time, because we use sub-dirs for
-- packages, and a single .tix file might contain information about
-- many package.
-- create the dest_dir if needed
when (not (null dest_dir)) $
createDirectoryIfMissing True dest_dir
writeFile filename text
------------------------------------------------------------------------------
-- global color pallete
| 512
| false
| true
| 0
| 16
| 95
| 106
| 53
| 53
| null | null |
FranklinChen/musicxml2
|
src/Data/Music/MusicXml/Simple.hs
|
bsd-3-clause
|
setTimeModP m n x = x { noteTimeMod = Just (fromIntegral m, fromIntegral n) }
| 79
|
setTimeModP m n x = x { noteTimeMod = Just (fromIntegral m, fromIntegral n) }
| 79
|
setTimeModP m n x = x { noteTimeMod = Just (fromIntegral m, fromIntegral n) }
| 79
| false
| false
| 0
| 9
| 16
| 36
| 18
| 18
| null | null |
eiji-a/aya
|
src/Aya/InitWorld.hs
|
bsd-3-clause
|
stepy = (snd yRegion - fst yRegion) / fromIntegral yReso
| 57
|
stepy = (snd yRegion - fst yRegion) / fromIntegral yReso
| 57
|
stepy = (snd yRegion - fst yRegion) / fromIntegral yReso
| 57
| false
| false
| 1
| 8
| 10
| 29
| 12
| 17
| null | null |
droundy/franchise
|
Distribution/Franchise/YAML.hs
|
bsd-3-clause
|
showYAML :: YAML a => a -> String
showYAML n = dumpNode (toNode n)
| 66
|
showYAML :: YAML a => a -> String
showYAML n = dumpNode (toNode n)
| 66
|
showYAML n = dumpNode (toNode n)
| 32
| false
| true
| 0
| 7
| 13
| 34
| 16
| 18
| null | null |
rueshyna/gogol
|
gogol-monitoring/gen/Network/Google/Monitoring/Types/Product.hs
|
mpl-2.0
|
-- | A 64-bit integer. Its range is approximately ±9.2x1018.
tvInt64Value :: Lens' TypedValue (Maybe Int64)
tvInt64Value
= lens _tvInt64Value (\ s a -> s{_tvInt64Value = a})
. mapping _Coerce
| 199
|
tvInt64Value :: Lens' TypedValue (Maybe Int64)
tvInt64Value
= lens _tvInt64Value (\ s a -> s{_tvInt64Value = a})
. mapping _Coerce
| 138
|
tvInt64Value
= lens _tvInt64Value (\ s a -> s{_tvInt64Value = a})
. mapping _Coerce
| 91
| true
| true
| 2
| 8
| 37
| 60
| 28
| 32
| null | null |
portnov/yaledger
|
YaLedger/Types/Common.hs
|
bsd-3-clause
|
emptyCurrency :: Currency
emptyCurrency = Currency {
cSymbol = "¤",
cIntCode = Nothing,
cStrCode = Nothing,
cPrecision = 2 }
| 132
|
emptyCurrency :: Currency
emptyCurrency = Currency {
cSymbol = "¤",
cIntCode = Nothing,
cStrCode = Nothing,
cPrecision = 2 }
| 132
|
emptyCurrency = Currency {
cSymbol = "¤",
cIntCode = Nothing,
cStrCode = Nothing,
cPrecision = 2 }
| 106
| false
| true
| 0
| 6
| 27
| 37
| 23
| 14
| null | null |
music-suite/music-pitch-literal
|
src/Music/Pitch/Literal/Pitch.hs
|
bsd-3-clause
|
c' = fromPitch $ PitchL (0, Nothing, 1)
| 46
|
c' = fromPitch $ PitchL (0, Nothing, 1)
| 46
|
c' = fromPitch $ PitchL (0, Nothing, 1)
| 46
| false
| false
| 3
| 6
| 14
| 26
| 12
| 14
| null | null |
rueshyna/gogol
|
gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer/Types/Product.hs
|
mpl-2.0
|
-- | Optional private auction id if this proposal is a private auction
-- proposal.
pPrivateAuctionId :: Lens' Proposal (Maybe Text)
pPrivateAuctionId
= lens _pPrivateAuctionId
(\ s a -> s{_pPrivateAuctionId = a})
| 221
|
pPrivateAuctionId :: Lens' Proposal (Maybe Text)
pPrivateAuctionId
= lens _pPrivateAuctionId
(\ s a -> s{_pPrivateAuctionId = a})
| 137
|
pPrivateAuctionId
= lens _pPrivateAuctionId
(\ s a -> s{_pPrivateAuctionId = a})
| 88
| true
| true
| 0
| 8
| 39
| 50
| 26
| 24
| null | null |
GaloisInc/HaLVM
|
examples/IVC/TransferTest/Receiver.hs
|
bsd-3-clause
|
main :: IO ()
main = do
writeDebugConsole "RCV: Initializing XenStore.\n"
xs <- initXenStore
writeDebugConsole "RCV: Making offer.\n"
c <- offer xs
writeDebugConsole "RCV: Creating destination reference.\n"
r <- prepareTransfer (peer c)
writeDebugConsole ("RCV: Telling other side about reference "++show r++".\n")
put c r
writeDebugConsole "RCV: Waiting for completed transfer.\n"
mfn <- completeTransfer r True False
writeDebugConsole "RCV: Mapping and checking page.\n"
page <- mapFrames [mfn]
isOK <- isRightPageData page
if isOK
then writeDebugConsole "RCV: Got the right page!\n"
else writeDebugConsole "RCV: BAD BAD BAD WRONG PAGE RECEIVED!!!\n"
| 688
|
main :: IO ()
main = do
writeDebugConsole "RCV: Initializing XenStore.\n"
xs <- initXenStore
writeDebugConsole "RCV: Making offer.\n"
c <- offer xs
writeDebugConsole "RCV: Creating destination reference.\n"
r <- prepareTransfer (peer c)
writeDebugConsole ("RCV: Telling other side about reference "++show r++".\n")
put c r
writeDebugConsole "RCV: Waiting for completed transfer.\n"
mfn <- completeTransfer r True False
writeDebugConsole "RCV: Mapping and checking page.\n"
page <- mapFrames [mfn]
isOK <- isRightPageData page
if isOK
then writeDebugConsole "RCV: Got the right page!\n"
else writeDebugConsole "RCV: BAD BAD BAD WRONG PAGE RECEIVED!!!\n"
| 688
|
main = do
writeDebugConsole "RCV: Initializing XenStore.\n"
xs <- initXenStore
writeDebugConsole "RCV: Making offer.\n"
c <- offer xs
writeDebugConsole "RCV: Creating destination reference.\n"
r <- prepareTransfer (peer c)
writeDebugConsole ("RCV: Telling other side about reference "++show r++".\n")
put c r
writeDebugConsole "RCV: Waiting for completed transfer.\n"
mfn <- completeTransfer r True False
writeDebugConsole "RCV: Mapping and checking page.\n"
page <- mapFrames [mfn]
isOK <- isRightPageData page
if isOK
then writeDebugConsole "RCV: Got the right page!\n"
else writeDebugConsole "RCV: BAD BAD BAD WRONG PAGE RECEIVED!!!\n"
| 674
| false
| true
| 0
| 12
| 123
| 167
| 69
| 98
| null | null |
nevrenato/Hets_Fork
|
CSL/Interpreter.hs
|
gpl-2.0
|
varList :: [String] -> [(String, Int)]
varList l = zip l [1..]
| 62
|
varList :: [String] -> [(String, Int)]
varList l = zip l [1..]
| 62
|
varList l = zip l [1..]
| 23
| false
| true
| 0
| 9
| 11
| 43
| 22
| 21
| null | null |
juodaspaulius/clafer
|
src/Language/Clafer/Optimizer/Optimizer.hs
|
mit
|
expNav :: MonadState GEnv m => Span -> IExp -> m IExp
expNav pos' x = do
xs <- split' x return
xs' <- mapM (expNav' pos' "") xs
return $ mkIFunExp pos' iUnion $ map fst xs'
| 178
|
expNav :: MonadState GEnv m => Span -> IExp -> m IExp
expNav pos' x = do
xs <- split' x return
xs' <- mapM (expNav' pos' "") xs
return $ mkIFunExp pos' iUnion $ map fst xs'
| 178
|
expNav pos' x = do
xs <- split' x return
xs' <- mapM (expNav' pos' "") xs
return $ mkIFunExp pos' iUnion $ map fst xs'
| 124
| false
| true
| 0
| 10
| 43
| 89
| 40
| 49
| null | null |
mightymoose/liquidhaskell
|
src/Language/Haskell/Liquid/CoreToLogic.hs
|
bsd-3-clause
|
-- coreToPred e
-- = throw ("Cannot transform to Logical Predicate:\t" ++ showPpr e)
coreToLogic :: C.CoreExpr -> LogicM Expr
coreToLogic (C.Let b e) = subst1 <$> coreToLogic e <*> makesub b
| 213
|
coreToLogic :: C.CoreExpr -> LogicM Expr
coreToLogic (C.Let b e) = subst1 <$> coreToLogic e <*> makesub b
| 107
|
coreToLogic (C.Let b e) = subst1 <$> coreToLogic e <*> makesub b
| 66
| true
| true
| 0
| 10
| 54
| 53
| 25
| 28
| null | null |
AccelerateHS/accelerate-cuda
|
Data/Array/Accelerate/CUDA/Array/Prim.hs
|
bsd-3-clause
|
showBytes :: Int -> String
showBytes x = D.showFFloatSIBase (Just 0) 1024 (fromIntegral x :: Double) "B"
| 104
|
showBytes :: Int -> String
showBytes x = D.showFFloatSIBase (Just 0) 1024 (fromIntegral x :: Double) "B"
| 104
|
showBytes x = D.showFFloatSIBase (Just 0) 1024 (fromIntegral x :: Double) "B"
| 77
| false
| true
| 0
| 7
| 16
| 49
| 23
| 26
| null | null |
brendanhay/gogol
|
gogol-gmail/gen/Network/Google/Resource/Gmail/Users/Settings/SendAs/SmimeInfo/List.hs
|
mpl-2.0
|
-- | JSONP
ussasilCallback :: Lens' UsersSettingsSendAsSmimeInfoList (Maybe Text)
ussasilCallback
= lens _ussasilCallback
(\ s a -> s{_ussasilCallback = a})
| 164
|
ussasilCallback :: Lens' UsersSettingsSendAsSmimeInfoList (Maybe Text)
ussasilCallback
= lens _ussasilCallback
(\ s a -> s{_ussasilCallback = a})
| 153
|
ussasilCallback
= lens _ussasilCallback
(\ s a -> s{_ussasilCallback = a})
| 82
| true
| true
| 0
| 9
| 27
| 48
| 25
| 23
| null | null |
gbenison/fasta-utils
|
fastadigest.hs
|
gpl-3.0
|
groupSequences::[[Char]]->[Sequence]
groupSequences = (tail . foldr op [Sequence "" ""])
where op str ((Sequence _ seq):xs) | isComment str = (Sequence "" ""):(Sequence str seq):xs
op str ((Sequence _ seq):xs) = (Sequence "" (str++seq)):xs
| 249
|
groupSequences::[[Char]]->[Sequence]
groupSequences = (tail . foldr op [Sequence "" ""])
where op str ((Sequence _ seq):xs) | isComment str = (Sequence "" ""):(Sequence str seq):xs
op str ((Sequence _ seq):xs) = (Sequence "" (str++seq)):xs
| 249
|
groupSequences = (tail . foldr op [Sequence "" ""])
where op str ((Sequence _ seq):xs) | isComment str = (Sequence "" ""):(Sequence str seq):xs
op str ((Sequence _ seq):xs) = (Sequence "" (str++seq)):xs
| 212
| false
| true
| 1
| 12
| 43
| 149
| 76
| 73
| null | null |
5outh/textlunky
|
src/Control/Process/Show.hs
|
mit
|
showP (Free (OpenGoldChest x)) = do
hdg <- use $ player.holding
ents <- liftM M.elems $ use $ room._2.entities
unless (GroundItem' GoldChest `notElem` ents) $
liftIO $ putStrLnP $
case hdg of
Just (GroundItem' Key) ->
"You open the gold chest! Something shiny pops out."
_ ->
"It's locked! There may be a key laying around here somewhere..."
| 419
|
showP (Free (OpenGoldChest x)) = do
hdg <- use $ player.holding
ents <- liftM M.elems $ use $ room._2.entities
unless (GroundItem' GoldChest `notElem` ents) $
liftIO $ putStrLnP $
case hdg of
Just (GroundItem' Key) ->
"You open the gold chest! Something shiny pops out."
_ ->
"It's locked! There may be a key laying around here somewhere..."
| 419
|
showP (Free (OpenGoldChest x)) = do
hdg <- use $ player.holding
ents <- liftM M.elems $ use $ room._2.entities
unless (GroundItem' GoldChest `notElem` ents) $
liftIO $ putStrLnP $
case hdg of
Just (GroundItem' Key) ->
"You open the gold chest! Something shiny pops out."
_ ->
"It's locked! There may be a key laying around here somewhere..."
| 419
| false
| false
| 0
| 13
| 135
| 113
| 54
| 59
| null | null |
GaloisInc/sk-dev-platform
|
libs/SCD/src/SCD/M4/CheckTypeStmt.hs
|
bsd-3-clause
|
checkStmt (TypeAttribute _ _) = []
| 40
|
checkStmt (TypeAttribute _ _) = []
| 40
|
checkStmt (TypeAttribute _ _) = []
| 40
| false
| false
| 0
| 7
| 11
| 19
| 9
| 10
| null | null |
ghc-android/ghc
|
testsuite/tests/ghci/should_run/ghcirun004.hs
|
bsd-3-clause
|
2448 = 2447
| 11
|
2448 = 2447
| 11
|
2448 = 2447
| 11
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
ShellShoccar-jpn/Open-usp-Tukubai
|
COMMANDS.HS/mdate.hs
|
mit
|
filterLastYearMonth :: Int -> BS.ByteString -> IO ()
filterLastYearMonth f1 cs = BS.putStr $ BS.unlines [ fLYM f1 (mwords ln) | ln <- (BS.lines cs) ]
| 149
|
filterLastYearMonth :: Int -> BS.ByteString -> IO ()
filterLastYearMonth f1 cs = BS.putStr $ BS.unlines [ fLYM f1 (mwords ln) | ln <- (BS.lines cs) ]
| 149
|
filterLastYearMonth f1 cs = BS.putStr $ BS.unlines [ fLYM f1 (mwords ln) | ln <- (BS.lines cs) ]
| 96
| false
| true
| 0
| 12
| 25
| 72
| 35
| 37
| null | null |
abakst/liquidhaskell
|
src/Language/Haskell/Liquid/Types/PredType.hs
|
bsd-3-clause
|
predType :: Type
predType = symbolType predName
| 51
|
predType :: Type
predType = symbolType predName
| 51
|
predType = symbolType predName
| 32
| false
| true
| 0
| 5
| 10
| 14
| 7
| 7
| null | null |
HaskVan/tiempo
|
src/Tiempo.hs
|
mit
|
minutesPerHour :: Int
minutesPerHour = 60
| 41
|
minutesPerHour :: Int
minutesPerHour = 60
| 41
|
minutesPerHour = 60
| 19
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
hvr/hoopl
|
src/Compiler/Hoopl/Block.hs
|
bsd-3-clause
|
mapBlock f (BMiddle n) = BMiddle (f n)
| 42
|
mapBlock f (BMiddle n) = BMiddle (f n)
| 42
|
mapBlock f (BMiddle n) = BMiddle (f n)
| 42
| false
| false
| 0
| 7
| 11
| 26
| 12
| 14
| null | null |
chpatrick/matek
|
src/Matek.hs
|
mit
|
mMap :: (Space row, Space col, Scalar a, Scalar b) => (a -> b) -> Matrix row col a -> Matrix row col b
mMap f m@(Matrix ba) =
createM $ \mba -> forM_ [0..elems - 1] $ \i ->
writeScalar mba i $ f $ indexScalar ba i
where
elems = rows m * cols m
| 255
|
mMap :: (Space row, Space col, Scalar a, Scalar b) => (a -> b) -> Matrix row col a -> Matrix row col b
mMap f m@(Matrix ba) =
createM $ \mba -> forM_ [0..elems - 1] $ \i ->
writeScalar mba i $ f $ indexScalar ba i
where
elems = rows m * cols m
| 255
|
mMap f m@(Matrix ba) =
createM $ \mba -> forM_ [0..elems - 1] $ \i ->
writeScalar mba i $ f $ indexScalar ba i
where
elems = rows m * cols m
| 152
| false
| true
| 4
| 9
| 68
| 161
| 74
| 87
| null | null |
bgamari/text
|
tests/Tests/Properties.hs
|
bsd-2-clause
|
sf_drop p n = (L.drop n . L.filter p) `eqP`
(unpackS . S.drop n . S.filter p)
| 103
|
sf_drop p n = (L.drop n . L.filter p) `eqP`
(unpackS . S.drop n . S.filter p)
| 103
|
sf_drop p n = (L.drop n . L.filter p) `eqP`
(unpackS . S.drop n . S.filter p)
| 103
| false
| false
| 0
| 10
| 42
| 55
| 27
| 28
| null | null |
brendanhay/gogol
|
gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/Systemapks/Variants/Get.hs
|
mpl-2.0
|
-- | The ID of a previously created system APK variant.
svgVariantId :: Lens' SystemapksVariantsGet Word32
svgVariantId
= lens _svgVariantId (\ s a -> s{_svgVariantId = a})
. _Coerce
| 190
|
svgVariantId :: Lens' SystemapksVariantsGet Word32
svgVariantId
= lens _svgVariantId (\ s a -> s{_svgVariantId = a})
. _Coerce
| 134
|
svgVariantId
= lens _svgVariantId (\ s a -> s{_svgVariantId = a})
. _Coerce
| 83
| true
| true
| 2
| 8
| 36
| 51
| 24
| 27
| null | null |
kmels/hledger
|
hledger-lib/Hledger/Query.hs
|
gpl-3.0
|
matchesAccount (Acct r) a = regexMatchesCI r a
| 46
|
matchesAccount (Acct r) a = regexMatchesCI r a
| 46
|
matchesAccount (Acct r) a = regexMatchesCI r a
| 46
| false
| false
| 1
| 6
| 7
| 26
| 10
| 16
| null | null |
lpsmith/ftp-monitor
|
src/SqlQQ.hs
|
agpl-3.0
|
-- | 'sql' is a quasiquoter that eases the syntactic burden
-- of writing big sql statements in Haskell source code. For example:
--
-- > {-# LANGUAGE QuasiQuotes #-}
-- >
-- > query conn [sql| SELECT column_a, column_b
-- > FROM table1 NATURAL JOIN table2
-- > WHERE ? <= time AND time < ?
-- > AND name LIKE ?
-- > ORDER BY size DESC
-- > LIMIT 100 |]
-- > (beginTime,endTime,string)
--
-- This quasiquoter returns a literal string expression of type 'Query',
-- and attempts to mimimize whitespace; otherwise the above query would
-- consist of approximately half whitespace when sent to the database
-- backend. It also recognizes and strips out standard sql comments "--".
--
-- The implementation of the whitespace reducer is currently incomplete.
-- Thus it can mess up your syntax in cases where whitespace should be
-- preserved as-is. It does preserve whitespace inside standard SQL string
-- literals. But it can get confused by the non-standard PostgreSQL string
-- literal syntax (which is the default setting in PostgreSQL 8 and below),
-- the extended escape string syntax, quoted identifiers, and other similar
-- constructs.
--
-- Of course, this caveat only applies to text written inside the SQL
-- quasiquoter; whitespace reduction is a compile-time computation and
-- thus will not touch the @string@ parameter above, which is a run-time
-- value.
--
-- Also note that this will not work if the substring @|]@ is contained
-- in the query.
sql :: QuasiQuoter
sql = QuasiQuoter
{ quotePat = error "Database.PostgreSQL.Simple.SqlQQ.sql:\
\ quasiquoter used in pattern context"
, quoteType = error "Database.PostgreSQL.Simple.SqlQQ.sql:\
\ quasiquoter used in type context"
, quoteExp = sqlExp
, quoteDec = error "Database.PostgreSQL.Simple.SqlQQ.sql:\
\ quasiquoter used in declaration context"
}
| 2,046
|
sql :: QuasiQuoter
sql = QuasiQuoter
{ quotePat = error "Database.PostgreSQL.Simple.SqlQQ.sql:\
\ quasiquoter used in pattern context"
, quoteType = error "Database.PostgreSQL.Simple.SqlQQ.sql:\
\ quasiquoter used in type context"
, quoteExp = sqlExp
, quoteDec = error "Database.PostgreSQL.Simple.SqlQQ.sql:\
\ quasiquoter used in declaration context"
}
| 449
|
sql = QuasiQuoter
{ quotePat = error "Database.PostgreSQL.Simple.SqlQQ.sql:\
\ quasiquoter used in pattern context"
, quoteType = error "Database.PostgreSQL.Simple.SqlQQ.sql:\
\ quasiquoter used in type context"
, quoteExp = sqlExp
, quoteDec = error "Database.PostgreSQL.Simple.SqlQQ.sql:\
\ quasiquoter used in declaration context"
}
| 430
| true
| true
| 0
| 8
| 528
| 89
| 61
| 28
| null | null |
ExNexu/Idris-dev
|
src/Idris/IdeMode.hs
|
bsd-3-clause
|
encodeErr :: Err -> String
encodeErr e = UTF8.toString . Base64.encode . Lazy.toStrict . Binary.encode $ e
| 106
|
encodeErr :: Err -> String
encodeErr e = UTF8.toString . Base64.encode . Lazy.toStrict . Binary.encode $ e
| 106
|
encodeErr e = UTF8.toString . Base64.encode . Lazy.toStrict . Binary.encode $ e
| 79
| false
| true
| 0
| 9
| 16
| 48
| 22
| 26
| null | null |
RakNoel/INF122
|
src/Uke1.hs
|
gpl-3.0
|
taskOne' x = 4 * x
| 18
|
taskOne' x = 4 * x
| 18
|
taskOne' x = 4 * x
| 18
| false
| false
| 0
| 5
| 5
| 13
| 6
| 7
| null | null |
facebookincubator/duckling
|
tests/Duckling/Ordinal/AR/Tests.hs
|
bsd-3-clause
|
tests :: TestTree
tests = testGroup "AR Tests"
[ makeCorpusTest [Seal Ordinal] corpus
]
| 91
|
tests :: TestTree
tests = testGroup "AR Tests"
[ makeCorpusTest [Seal Ordinal] corpus
]
| 91
|
tests = testGroup "AR Tests"
[ makeCorpusTest [Seal Ordinal] corpus
]
| 73
| false
| true
| 0
| 9
| 17
| 38
| 16
| 22
| null | null |
tjakway/ghcjvm
|
compiler/cmm/CLabel.hs
|
bsd-3-clause
|
needsCDecl (CaseLabel _ _) = True
| 46
|
needsCDecl (CaseLabel _ _) = True
| 46
|
needsCDecl (CaseLabel _ _) = True
| 46
| false
| false
| 0
| 7
| 18
| 17
| 8
| 9
| null | null |
ocramz/sparse-linear-algebra
|
src/Data/Sparse/SpMatrix.hs
|
gpl-3.0
|
-- | Permutation matrix from a (possibly incomplete) list of row pair swaps
-- e.g. `permutPairs 5 [(2,4)]` swaps rows 2 and 4 :
--
-- >>> prd (permutPairsSM 5 [(2,4)] :: SpMatrix Double)
--
-- @
-- ( 5 rows, 5 columns ) , 5 NZ ( density 20.000 % )
--
-- 1.00 , _ , _ , _ , _
-- _ , 1.00 , _ , _ , _
-- _ , _ , _ , _ , 1.00
-- _ , _ , _ , 1.00 , _
-- _ , _ , 1.00 , _ , _
-- @
permutPairsSM :: Num a => Int -> [(IxRow, IxRow)] -> SpMatrix a
permutPairsSM n iix = go iix (eye n) where
go ((i1, i2):iis) m = go iis (swapRows i1 i2 m)
go [] m = m
-- *** Super- or sub- diagonal matrix
-- | `mkSubDiagonal n o xx` creates a square SpMatrix of size `n` with `xx` on the `o`th subdiagonal
| 805
|
permutPairsSM :: Num a => Int -> [(IxRow, IxRow)] -> SpMatrix a
permutPairsSM n iix = go iix (eye n) where
go ((i1, i2):iis) m = go iis (swapRows i1 i2 m)
go [] m = m
-- *** Super- or sub- diagonal matrix
-- | `mkSubDiagonal n o xx` creates a square SpMatrix of size `n` with `xx` on the `o`th subdiagonal
| 316
|
permutPairsSM n iix = go iix (eye n) where
go ((i1, i2):iis) m = go iis (swapRows i1 i2 m)
go [] m = m
-- *** Super- or sub- diagonal matrix
-- | `mkSubDiagonal n o xx` creates a square SpMatrix of size `n` with `xx` on the `o`th subdiagonal
| 252
| true
| true
| 2
| 10
| 290
| 136
| 71
| 65
| null | null |
markus1189/xmonad-contrib-710
|
XMonad/Actions/GroupNavigation.hs
|
bsd-3-clause
|
orderedWindowList dir = withWindowSet $ \ss -> do
wsids <- asks (Seq.fromList . workspaces . config)
let wspcs = orderedWorkspaceList ss wsids
wins = dirfun dir
$ Fold.foldl' (><) Seq.empty
$ fmap (Seq.fromList . SS.integrate' . SS.stack) wspcs
cur = SS.peek ss
return $ maybe wins (rotfun wins) cur
where
dirfun Backward = Seq.reverse
dirfun _ = id
rotfun wins x = rotate $ rotateTo (== x) wins
-- Returns the ordered workspace list as specified in ~/.xmonad/xmonad.hs
| 546
|
orderedWindowList dir = withWindowSet $ \ss -> do
wsids <- asks (Seq.fromList . workspaces . config)
let wspcs = orderedWorkspaceList ss wsids
wins = dirfun dir
$ Fold.foldl' (><) Seq.empty
$ fmap (Seq.fromList . SS.integrate' . SS.stack) wspcs
cur = SS.peek ss
return $ maybe wins (rotfun wins) cur
where
dirfun Backward = Seq.reverse
dirfun _ = id
rotfun wins x = rotate $ rotateTo (== x) wins
-- Returns the ordered workspace list as specified in ~/.xmonad/xmonad.hs
| 546
|
orderedWindowList dir = withWindowSet $ \ss -> do
wsids <- asks (Seq.fromList . workspaces . config)
let wspcs = orderedWorkspaceList ss wsids
wins = dirfun dir
$ Fold.foldl' (><) Seq.empty
$ fmap (Seq.fromList . SS.integrate' . SS.stack) wspcs
cur = SS.peek ss
return $ maybe wins (rotfun wins) cur
where
dirfun Backward = Seq.reverse
dirfun _ = id
rotfun wins x = rotate $ rotateTo (== x) wins
-- Returns the ordered workspace list as specified in ~/.xmonad/xmonad.hs
| 546
| false
| false
| 2
| 17
| 154
| 187
| 88
| 99
| null | null |
limaner2002/EPC-tools
|
src/Types.hs
|
bsd-3-clause
|
scheduledTimeToLocalTime :: TimeZone -> ScheduledTime -> LocalTime
scheduledTimeToLocalTime tz = utcToLocalTime tz . fromScheduledTime
| 134
|
scheduledTimeToLocalTime :: TimeZone -> ScheduledTime -> LocalTime
scheduledTimeToLocalTime tz = utcToLocalTime tz . fromScheduledTime
| 134
|
scheduledTimeToLocalTime tz = utcToLocalTime tz . fromScheduledTime
| 67
| false
| true
| 0
| 6
| 13
| 29
| 14
| 15
| null | null |
apoluektov/domino
|
src/Domino/Read.hs
|
mit
|
readHand :: IO Hand
readHand = readUserInput (parser hand) "Incorrect hand, try again:"
| 87
|
readHand :: IO Hand
readHand = readUserInput (parser hand) "Incorrect hand, try again:"
| 87
|
readHand = readUserInput (parser hand) "Incorrect hand, try again:"
| 67
| false
| true
| 0
| 7
| 12
| 25
| 12
| 13
| null | null |
trskop/skeletos
|
src/Skeletos/ShowOpt.hs
|
bsd-3-clause
|
showQueryAtom :: QueryAtom -> Text
showQueryAtom = CI.foldedCase . showQueryAtom'
| 81
|
showQueryAtom :: QueryAtom -> Text
showQueryAtom = CI.foldedCase . showQueryAtom'
| 81
|
showQueryAtom = CI.foldedCase . showQueryAtom'
| 46
| false
| true
| 0
| 6
| 9
| 21
| 11
| 10
| null | null |
madebyjeffrey/HerbiePlugin
|
test/Tests.hs
|
bsd-3-clause
|
herbie6 :: (Show a, Real a) => a -> String -> String
herbie6 x1 str = show $ f1(x1)
| 83
|
herbie6 :: (Show a, Real a) => a -> String -> String
herbie6 x1 str = show $ f1(x1)
| 83
|
herbie6 x1 str = show $ f1(x1)
| 30
| false
| true
| 0
| 7
| 18
| 49
| 25
| 24
| null | null |
gridaphobe/liquid-fixpoint
|
src/Language/Fixpoint/Parse.hs
|
bsd-3-clause
|
substVars :: [(Symbol, Int)] -> Sort -> Sort
substVars su = mapSort tx
where
tx (FObj x)
| Just i <- lookup x su = FVar i
tx t = t
| 167
|
substVars :: [(Symbol, Int)] -> Sort -> Sort
substVars su = mapSort tx
where
tx (FObj x)
| Just i <- lookup x su = FVar i
tx t = t
| 167
|
substVars su = mapSort tx
where
tx (FObj x)
| Just i <- lookup x su = FVar i
tx t = t
| 122
| false
| true
| 1
| 9
| 67
| 79
| 38
| 41
| null | null |
vladimir-ipatov/ganeti
|
src/Ganeti/HTools/Types.hs
|
gpl-2.0
|
templateMirrorType DTSharedFile = MirrorExternal
| 48
|
templateMirrorType DTSharedFile = MirrorExternal
| 48
|
templateMirrorType DTSharedFile = MirrorExternal
| 48
| false
| false
| 0
| 4
| 3
| 10
| 4
| 6
| null | null |
rahulmutt/ghcvm
|
compiler/Eta/Main/HscTypes.hs
|
bsd-3-clause
|
emptyMG :: ModuleGraph
emptyMG = ModuleGraph [] emptyModuleEnv emptyModuleSet False
| 83
|
emptyMG :: ModuleGraph
emptyMG = ModuleGraph [] emptyModuleEnv emptyModuleSet False
| 83
|
emptyMG = ModuleGraph [] emptyModuleEnv emptyModuleSet False
| 60
| false
| true
| 0
| 6
| 9
| 29
| 12
| 17
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.