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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apyrgio/snf-ganeti | test/hs/Test/Ganeti/Objects.hs | bsd-2-clause | -- | Custom HUnit test to check the correspondence between Haskell-generated
-- networks and their Python decoded, validated and re-encoded version.
-- For the technical background of this unit test, check the documentation
-- of "case_py_compat_types" of test/hs/Test/Ganeti/Opcodes.hs
casePyCompatNetworks :: HUnit.Assertion
casePyCompatNetworks = do
let num_networks = 500::Int
networks <- genSample (vectorOf num_networks genValidNetwork)
let networks_with_properties = map getNetworkProperties networks
serialized = J.encode networks
-- check for non-ASCII fields, usually due to 'arbitrary :: String'
mapM_ (\net -> when (any (not . isAscii) (J.encode net)) .
HUnit.assertFailure $
"Network has non-ASCII fields: " ++ show net
) networks
py_stdout <-
runPython "from ganeti import network\n\
\from ganeti import objects\n\
\from ganeti import serializer\n\
\import sys\n\
\net_data = serializer.Load(sys.stdin.read())\n\
\decoded = [objects.Network.FromDict(n) for n in net_data]\n\
\encoded = []\n\
\for net in decoded:\n\
\ a = network.AddressPool(net)\n\
\ encoded.append((a.GetFreeCount(), a.GetReservedCount(), \\\n\
\ net.ToDict()))\n\
\print serializer.Dump(encoded)" serialized
>>= checkPythonResult
let deserialised = J.decode py_stdout::J.Result [(Int, Int, Network)]
decoded <- case deserialised of
J.Ok ops -> return ops
J.Error msg ->
HUnit.assertFailure ("Unable to decode networks: " ++ msg)
-- this already raised an expection, but we need it
-- for proper types
>> fail "Unable to decode networks"
HUnit.assertEqual "Mismatch in number of returned networks"
(length decoded) (length networks_with_properties)
mapM_ (uncurry (HUnit.assertEqual "Different result after encoding/decoding")
) $ zip decoded networks_with_properties
-- | Creates a tuple of the given network combined with some of its properties
-- to be compared against the same properties generated by the python code. | 2,251 | casePyCompatNetworks :: HUnit.Assertion
casePyCompatNetworks = do
let num_networks = 500::Int
networks <- genSample (vectorOf num_networks genValidNetwork)
let networks_with_properties = map getNetworkProperties networks
serialized = J.encode networks
-- check for non-ASCII fields, usually due to 'arbitrary :: String'
mapM_ (\net -> when (any (not . isAscii) (J.encode net)) .
HUnit.assertFailure $
"Network has non-ASCII fields: " ++ show net
) networks
py_stdout <-
runPython "from ganeti import network\n\
\from ganeti import objects\n\
\from ganeti import serializer\n\
\import sys\n\
\net_data = serializer.Load(sys.stdin.read())\n\
\decoded = [objects.Network.FromDict(n) for n in net_data]\n\
\encoded = []\n\
\for net in decoded:\n\
\ a = network.AddressPool(net)\n\
\ encoded.append((a.GetFreeCount(), a.GetReservedCount(), \\\n\
\ net.ToDict()))\n\
\print serializer.Dump(encoded)" serialized
>>= checkPythonResult
let deserialised = J.decode py_stdout::J.Result [(Int, Int, Network)]
decoded <- case deserialised of
J.Ok ops -> return ops
J.Error msg ->
HUnit.assertFailure ("Unable to decode networks: " ++ msg)
-- this already raised an expection, but we need it
-- for proper types
>> fail "Unable to decode networks"
HUnit.assertEqual "Mismatch in number of returned networks"
(length decoded) (length networks_with_properties)
mapM_ (uncurry (HUnit.assertEqual "Different result after encoding/decoding")
) $ zip decoded networks_with_properties
-- | Creates a tuple of the given network combined with some of its properties
-- to be compared against the same properties generated by the python code. | 1,964 | casePyCompatNetworks = do
let num_networks = 500::Int
networks <- genSample (vectorOf num_networks genValidNetwork)
let networks_with_properties = map getNetworkProperties networks
serialized = J.encode networks
-- check for non-ASCII fields, usually due to 'arbitrary :: String'
mapM_ (\net -> when (any (not . isAscii) (J.encode net)) .
HUnit.assertFailure $
"Network has non-ASCII fields: " ++ show net
) networks
py_stdout <-
runPython "from ganeti import network\n\
\from ganeti import objects\n\
\from ganeti import serializer\n\
\import sys\n\
\net_data = serializer.Load(sys.stdin.read())\n\
\decoded = [objects.Network.FromDict(n) for n in net_data]\n\
\encoded = []\n\
\for net in decoded:\n\
\ a = network.AddressPool(net)\n\
\ encoded.append((a.GetFreeCount(), a.GetReservedCount(), \\\n\
\ net.ToDict()))\n\
\print serializer.Dump(encoded)" serialized
>>= checkPythonResult
let deserialised = J.decode py_stdout::J.Result [(Int, Int, Network)]
decoded <- case deserialised of
J.Ok ops -> return ops
J.Error msg ->
HUnit.assertFailure ("Unable to decode networks: " ++ msg)
-- this already raised an expection, but we need it
-- for proper types
>> fail "Unable to decode networks"
HUnit.assertEqual "Mismatch in number of returned networks"
(length decoded) (length networks_with_properties)
mapM_ (uncurry (HUnit.assertEqual "Different result after encoding/decoding")
) $ zip decoded networks_with_properties
-- | Creates a tuple of the given network combined with some of its properties
-- to be compared against the same properties generated by the python code. | 1,924 | true | true | 0 | 18 | 592 | 293 | 144 | 149 | null | null |
vTurbine/ghc | compiler/main/DynFlags.hs | bsd-3-clause | setObjectSuf f d = d { objectSuf = f} | 43 | setObjectSuf f d = d { objectSuf = f} | 43 | setObjectSuf f d = d { objectSuf = f} | 43 | false | false | 0 | 6 | 14 | 19 | 10 | 9 | null | null |
nevrenato/HetsAlloy | VSE/As.hs | gpl-2.0 | yVar :: Token
yVar = genToken "y" | 33 | yVar :: Token
yVar = genToken "y" | 33 | yVar = genToken "y" | 19 | false | true | 0 | 6 | 6 | 20 | 8 | 12 | null | null |
zobot/MeshGenerator | src/MeshGenerator.hs | bsd-3-clause | testVerts :: Seq (Vertex Double)
testVerts = fromList [Vertex 0.0 0.0 0.0, Vertex 0.0 0.0 1.0, Vertex 1.0 0.0 1.0, Vertex 1.0 0.0 0.0] | 134 | testVerts :: Seq (Vertex Double)
testVerts = fromList [Vertex 0.0 0.0 0.0, Vertex 0.0 0.0 1.0, Vertex 1.0 0.0 1.0, Vertex 1.0 0.0 0.0] | 134 | testVerts = fromList [Vertex 0.0 0.0 0.0, Vertex 0.0 0.0 1.0, Vertex 1.0 0.0 1.0, Vertex 1.0 0.0 0.0] | 101 | false | true | 0 | 7 | 23 | 63 | 31 | 32 | null | null |
rzetterberg/alven | src/lib/Plugin/PasswordStore.hs | mit | hashRounds :: ByteString -> Int -> ByteString
hashRounds (!bs) 0 = bs | 69 | hashRounds :: ByteString -> Int -> ByteString
hashRounds (!bs) 0 = bs | 69 | hashRounds (!bs) 0 = bs | 23 | false | true | 0 | 7 | 11 | 28 | 14 | 14 | null | null |
hbrouwer/pdrt-sandbox | tutorials/PDRSTutorial.hs | apache-2.0 | examplePDRSMerge2c = printAMerge man happy | 42 | examplePDRSMerge2c = printAMerge man happy | 42 | examplePDRSMerge2c = printAMerge man happy | 42 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
LightAndLight/pl0-haskell | src/PL0/CodeGen/StackMachine.hs | bsd-3-clause | genBlock :: MonadCode s m => Block TypedExp -> m ()
genBlock (Block decs st) = do
procedures .= []
genDeclarations decs
genProcedures decs
cst <- genStatement st
code <>= cst | 184 | genBlock :: MonadCode s m => Block TypedExp -> m ()
genBlock (Block decs st) = do
procedures .= []
genDeclarations decs
genProcedures decs
cst <- genStatement st
code <>= cst | 184 | genBlock (Block decs st) = do
procedures .= []
genDeclarations decs
genProcedures decs
cst <- genStatement st
code <>= cst | 132 | false | true | 0 | 8 | 40 | 86 | 36 | 50 | null | null |
phaazon/vector | Data/Vector/Fusion/Stream/Monadic.hs | bsd-3-clause | unfoldr f = unfoldrM (return . f) | 33 | unfoldr f = unfoldrM (return . f) | 33 | unfoldr f = unfoldrM (return . f) | 33 | false | false | 1 | 7 | 6 | 22 | 9 | 13 | null | null |
Risto-Stevcev/haskell-church-encodings | RankNTypes/TestChurch.hs | bsd-3-clause | test_multZ_three_zero = TestCase $ assertEqual "multZ three zero == 0" | 70 | test_multZ_three_zero = TestCase $ assertEqual "multZ three zero == 0" | 70 | test_multZ_three_zero = TestCase $ assertEqual "multZ three zero == 0" | 70 | false | false | 0 | 6 | 9 | 13 | 6 | 7 | null | null |
Laquendi/memopad | Application.hs | mit | -- This function allocates resources (such as a database connection pool),
-- performs initialization and creates a WAI application. This is also the
-- place to put your migrate statements to have automatic database
-- migrations handled by Yesod.
makeApplication :: AppConfig DefaultEnv Extra -> IO (Application, LogFunc)
makeApplication conf = do
foundation <- makeFoundation conf
-- Initialize the logging middleware
logWare <- mkRequestLogger def
{ outputFormat =
if development
then Detailed True
else Apache FromSocket
, destination = RequestLogger.Logger $ loggerSet $ appLogger foundation
}
-- Create the WAI application and apply middlewares
app <- toWaiAppPlain foundation
let logFunc = messageLoggerSource foundation (appLogger foundation)
return (logWare $ defaultMiddlewaresNoLogging app, logFunc)
-- | Loads up any necessary settings, creates your foundation datatype, and
-- performs some initialization. | 1,019 | makeApplication :: AppConfig DefaultEnv Extra -> IO (Application, LogFunc)
makeApplication conf = do
foundation <- makeFoundation conf
-- Initialize the logging middleware
logWare <- mkRequestLogger def
{ outputFormat =
if development
then Detailed True
else Apache FromSocket
, destination = RequestLogger.Logger $ loggerSet $ appLogger foundation
}
-- Create the WAI application and apply middlewares
app <- toWaiAppPlain foundation
let logFunc = messageLoggerSource foundation (appLogger foundation)
return (logWare $ defaultMiddlewaresNoLogging app, logFunc)
-- | Loads up any necessary settings, creates your foundation datatype, and
-- performs some initialization. | 770 | makeApplication conf = do
foundation <- makeFoundation conf
-- Initialize the logging middleware
logWare <- mkRequestLogger def
{ outputFormat =
if development
then Detailed True
else Apache FromSocket
, destination = RequestLogger.Logger $ loggerSet $ appLogger foundation
}
-- Create the WAI application and apply middlewares
app <- toWaiAppPlain foundation
let logFunc = messageLoggerSource foundation (appLogger foundation)
return (logWare $ defaultMiddlewaresNoLogging app, logFunc)
-- | Loads up any necessary settings, creates your foundation datatype, and
-- performs some initialization. | 695 | true | true | 0 | 13 | 225 | 150 | 76 | 74 | null | null |
orclev/adpasswd | Main.hs | gpl-3.0 | stripDomain :: Username -> Username
stripDomain name = takeWhile (/= '@') name | 78 | stripDomain :: Username -> Username
stripDomain name = takeWhile (/= '@') name | 78 | stripDomain name = takeWhile (/= '@') name | 42 | false | true | 0 | 6 | 11 | 27 | 14 | 13 | null | null |
ggreif/clash-compiler | clash-lib/src/CLaSH/Core/TysPrim.hs | bsd-2-clause | int64PrimTc = liftedPrimTC int64PrimTyConName | 47 | int64PrimTc = liftedPrimTC int64PrimTyConName | 47 | int64PrimTc = liftedPrimTC int64PrimTyConName | 47 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
rgrempel/frelm.org | vendor/elm-format/parser/src/Parse/Helpers.hs | mit | makeVar :: IParser Char -> IParser String
makeVar firstChar =
do variable <- (:) <$> firstChar <*> many innerVarChar
if variable `elem` reserveds
then fail (Syntax.keyword variable)
else return variable | 227 | makeVar :: IParser Char -> IParser String
makeVar firstChar =
do variable <- (:) <$> firstChar <*> many innerVarChar
if variable `elem` reserveds
then fail (Syntax.keyword variable)
else return variable | 227 | makeVar firstChar =
do variable <- (:) <$> firstChar <*> many innerVarChar
if variable `elem` reserveds
then fail (Syntax.keyword variable)
else return variable | 185 | false | true | 0 | 11 | 54 | 75 | 37 | 38 | null | null |
ddssff/rdf4h | bench/MainCriterion.hs | bsd-3-clause | subjSelect, predSelect, objSelect, selectNothing :: Maybe (Node -> Bool)
subjSelect = Just (\case { (UNode n) -> T.length n > 12 ; _ -> False }) | 144 | subjSelect, predSelect, objSelect, selectNothing :: Maybe (Node -> Bool)
subjSelect = Just (\case { (UNode n) -> T.length n > 12 ; _ -> False }) | 144 | subjSelect = Just (\case { (UNode n) -> T.length n > 12 ; _ -> False }) | 71 | false | true | 5 | 12 | 25 | 77 | 37 | 40 | null | null |
garetxe/cabal | cabal-install/tests/UnitTests/Distribution/Client/Sandbox/Timestamp.hs | bsd-3-clause | tests :: [TestTree]
tests =
[ testCase "timestamp record version 1 can be read" timestampReadTest_v1
, testCase "timestamp record version 2 can be read" timestampReadTest_v2
, testCase "written timestamp record can be read" timestampReadWriteTest ] | 256 | tests :: [TestTree]
tests =
[ testCase "timestamp record version 1 can be read" timestampReadTest_v1
, testCase "timestamp record version 2 can be read" timestampReadTest_v2
, testCase "written timestamp record can be read" timestampReadWriteTest ] | 256 | tests =
[ testCase "timestamp record version 1 can be read" timestampReadTest_v1
, testCase "timestamp record version 2 can be read" timestampReadTest_v2
, testCase "written timestamp record can be read" timestampReadWriteTest ] | 236 | false | true | 0 | 6 | 42 | 38 | 20 | 18 | null | null |
up9cloud/line-api-server | lib/hs/src/Thrift/Protocol/Compact.hs | mit | buildCompactValue (TI16 i) = buildVarint $ i16ToZigZag i | 56 | buildCompactValue (TI16 i) = buildVarint $ i16ToZigZag i | 56 | buildCompactValue (TI16 i) = buildVarint $ i16ToZigZag i | 56 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
facebookincubator/duckling | Duckling/Numeral/EN/Rules.hs | bsd-3-clause | ruleSum :: Rule
ruleSum = Rule
{ name = "intersect 2 numbers"
, pattern =
[ Predicate $ and . sequence [hasGrain, isPositive]
, Predicate $ and . sequence [not . isMultipliable, isPositive]
]
, prod = \tokens -> case tokens of
(Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:
Token Numeral NumeralData{TNumeral.value = val2}:
_) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2
_ -> Nothing
} | 472 | ruleSum :: Rule
ruleSum = Rule
{ name = "intersect 2 numbers"
, pattern =
[ Predicate $ and . sequence [hasGrain, isPositive]
, Predicate $ and . sequence [not . isMultipliable, isPositive]
]
, prod = \tokens -> case tokens of
(Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:
Token Numeral NumeralData{TNumeral.value = val2}:
_) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2
_ -> Nothing
} | 472 | ruleSum = Rule
{ name = "intersect 2 numbers"
, pattern =
[ Predicate $ and . sequence [hasGrain, isPositive]
, Predicate $ and . sequence [not . isMultipliable, isPositive]
]
, prod = \tokens -> case tokens of
(Token Numeral NumeralData{TNumeral.value = val1, TNumeral.grain = Just g}:
Token Numeral NumeralData{TNumeral.value = val2}:
_) | (10 ** fromIntegral g) > val2 -> double $ val1 + val2
_ -> Nothing
} | 456 | false | true | 0 | 18 | 119 | 182 | 96 | 86 | null | null |
cocreature/ioref-stable | src/Data/IORefStable.hs | mit | -- |Write a new value into an 'IORefStable'
writeIORefStable :: IORefStable a -> a -> IO ()
writeIORefStable (IORefStable _ r) a = writeIORef r a | 145 | writeIORefStable :: IORefStable a -> a -> IO ()
writeIORefStable (IORefStable _ r) a = writeIORef r a | 101 | writeIORefStable (IORefStable _ r) a = writeIORef r a | 53 | true | true | 0 | 10 | 25 | 50 | 23 | 27 | null | null |
mcmaniac/ghc | compiler/main/DynFlags.hs | bsd-3-clause | pgm_sysman :: DynFlags -> String
pgm_sysman dflags = sPgm_sysman (settings dflags) | 93 | pgm_sysman :: DynFlags -> String
pgm_sysman dflags = sPgm_sysman (settings dflags) | 93 | pgm_sysman dflags = sPgm_sysman (settings dflags) | 49 | false | true | 0 | 7 | 21 | 27 | 13 | 14 | null | null |
haskell-web-intro/secdev | examples/reflex-ghcjs-client/src/ClientSafeDom.hs | mit | _textInput_input :: Reflex t => TextInput t -> Event t (UserInput Dirty)
_textInput_input = fmap UserInput . RD._textInput_input | 128 | _textInput_input :: Reflex t => TextInput t -> Event t (UserInput Dirty)
_textInput_input = fmap UserInput . RD._textInput_input | 128 | _textInput_input = fmap UserInput . RD._textInput_input | 55 | false | true | 0 | 9 | 17 | 45 | 21 | 24 | null | null |
barkmadley/etd-retreat-2014-hteam | src/Main.hs | mit | score Cooperate Cooperate = (s 1,s 1) | 37 | score Cooperate Cooperate = (s 1,s 1) | 37 | score Cooperate Cooperate = (s 1,s 1) | 37 | false | false | 0 | 6 | 6 | 23 | 11 | 12 | null | null |
julienschmaltz/madl | src/Parser/MadlTypeChecker.hs | mit | checkContextFunctionParameterNameExists :: Context -> WithSourceInfo Text -> Checked Text
checkContextFunctionParameterNameExists context name = check *> (Right $ removeSourceInfo name) where
check =
(checkIntegerParameterExists context name)
*> (checkMacroNameExists context name)
*> (checkMacroIntegerParameterExists context name)
*> (checkPredicateNameExists context name)
*> (checkProcessNameExists context name)
*> (checkTypeNameExists context name)
-- | Add a channel identifier to the context | 603 | checkContextFunctionParameterNameExists :: Context -> WithSourceInfo Text -> Checked Text
checkContextFunctionParameterNameExists context name = check *> (Right $ removeSourceInfo name) where
check =
(checkIntegerParameterExists context name)
*> (checkMacroNameExists context name)
*> (checkMacroIntegerParameterExists context name)
*> (checkPredicateNameExists context name)
*> (checkProcessNameExists context name)
*> (checkTypeNameExists context name)
-- | Add a channel identifier to the context | 603 | checkContextFunctionParameterNameExists context name = check *> (Right $ removeSourceInfo name) where
check =
(checkIntegerParameterExists context name)
*> (checkMacroNameExists context name)
*> (checkMacroIntegerParameterExists context name)
*> (checkPredicateNameExists context name)
*> (checkProcessNameExists context name)
*> (checkTypeNameExists context name)
-- | Add a channel identifier to the context | 513 | false | true | 0 | 11 | 157 | 119 | 60 | 59 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'FrequencyCap' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'fcImpressions'
--
-- * 'fcDuration'
frequencyCap
:: FrequencyCap
frequencyCap = FrequencyCap' {_fcImpressions = Nothing, _fcDuration = Nothing} | 320 | frequencyCap
:: FrequencyCap
frequencyCap = FrequencyCap' {_fcImpressions = Nothing, _fcDuration = Nothing} | 111 | frequencyCap = FrequencyCap' {_fcImpressions = Nothing, _fcDuration = Nothing} | 78 | true | true | 0 | 6 | 53 | 32 | 22 | 10 | null | null |
trobertson/merch | src/Merchandise/Parse/Script/Tests.hs | bsd-3-clause | -- crazy basic. Very little error reporting.
doTest :: Eq a => Test a -> TestResult a
doTest (Test n p t exp) =
case feed (parse p t) "" of
Fail unconsumed context desc
-> TR n
(T.append (T.pack . ("Parse Failure: " ++) $ show context)
(T.pack $ "\n\t " ++ desc))
False
Nothing
Partial partial
-> TR n "if you see this, there is a bug in attoparsec" False Nothing
Done unconsumed result
-> TR n "" (result == exp) (Just result)
-- for easy printing | 575 | doTest :: Eq a => Test a -> TestResult a
doTest (Test n p t exp) =
case feed (parse p t) "" of
Fail unconsumed context desc
-> TR n
(T.append (T.pack . ("Parse Failure: " ++) $ show context)
(T.pack $ "\n\t " ++ desc))
False
Nothing
Partial partial
-> TR n "if you see this, there is a bug in attoparsec" False Nothing
Done unconsumed result
-> TR n "" (result == exp) (Just result)
-- for easy printing | 530 | doTest (Test n p t exp) =
case feed (parse p t) "" of
Fail unconsumed context desc
-> TR n
(T.append (T.pack . ("Parse Failure: " ++) $ show context)
(T.pack $ "\n\t " ++ desc))
False
Nothing
Partial partial
-> TR n "if you see this, there is a bug in attoparsec" False Nothing
Done unconsumed result
-> TR n "" (result == exp) (Just result)
-- for easy printing | 489 | true | true | 0 | 14 | 215 | 182 | 88 | 94 | null | null |
tel/index-basic | src/Control/IMonad/Cont.hs | bsd-3-clause | contT :: ((a :-> m r) -> m r i) -> ContT r m a i
contT = ContT | 62 | contT :: ((a :-> m r) -> m r i) -> ContT r m a i
contT = ContT | 62 | contT = ContT | 13 | false | true | 0 | 11 | 18 | 52 | 24 | 28 | null | null |
ekmett/text | tests/Tests/Properties.hs | bsd-2-clause | tl_read_rational p tol (n::Double) s =
case p (TL.pack (show n) `TL.append` t) of
Left _err -> False
Right (n',t') -> t == t' && abs (n-n') <= tol
where t = TL.dropWhile isFloaty s | 204 | tl_read_rational p tol (n::Double) s =
case p (TL.pack (show n) `TL.append` t) of
Left _err -> False
Right (n',t') -> t == t' && abs (n-n') <= tol
where t = TL.dropWhile isFloaty s | 204 | tl_read_rational p tol (n::Double) s =
case p (TL.pack (show n) `TL.append` t) of
Left _err -> False
Right (n',t') -> t == t' && abs (n-n') <= tol
where t = TL.dropWhile isFloaty s | 204 | false | false | 0 | 12 | 58 | 111 | 56 | 55 | null | null |
GaloisInc/sk-dev-platform | libs/lobster/src/Lobster/Policy.hs | bsd-3-clause | mkContextSignature :: Signature -> ContextSignature
mkContextSignature sig = ContextSignature sig emptyContext | 110 | mkContextSignature :: Signature -> ContextSignature
mkContextSignature sig = ContextSignature sig emptyContext | 110 | mkContextSignature sig = ContextSignature sig emptyContext | 58 | false | true | 0 | 5 | 10 | 23 | 11 | 12 | null | null |
mstksg/hledger | hledger-lib/Hledger/Read/CsvReader.hs | gpl-3.0 | patternsp :: CsvRulesParser [String]
patternsp = do
lift $ pdbg 3 "trying patternsp"
ps <- many regexp
return ps | 118 | patternsp :: CsvRulesParser [String]
patternsp = do
lift $ pdbg 3 "trying patternsp"
ps <- many regexp
return ps | 118 | patternsp = do
lift $ pdbg 3 "trying patternsp"
ps <- many regexp
return ps | 81 | false | true | 0 | 9 | 24 | 51 | 21 | 30 | null | null |
vincenthz/hs-foundation | basement/Basement/UArray.hs | bsd-3-clause | break :: forall ty . PrimType ty => (ty -> Bool) -> UArray ty -> (UArray ty, UArray ty)
break predicate arr
| k == sentinel = (arr, mempty)
| otherwise = splitAt (k - offset arr) arr
where
!k = onBackendPure' arr $ Alg.findIndexPredicate predicate
{-
{-# SPECIALIZE [3] findIndex :: Word8 -> UArray Word8 -> Maybe (Offset Word8) #-}
| len == 0 = (mempty, mempty)
| otherwise = runST $ unsafeIndexer xv (go xv xpredicate)
where
!len = length xv
go :: PrimType ty => UArray ty -> (ty -> Bool) -> (Offset ty -> ty) -> ST s (UArray ty, UArray ty)
go v predicate getIdx = pure (findBreak $ Offset 0)
where
findBreak !i
| i .==# len = (v, mempty)
| predicate (getIdx i) = splitAt (offsetAsSize i) v
| otherwise = findBreak (i + Offset 1)
{-# INLINE findBreak #-}
{-# INLINE go #-}
-}
| 907 | break :: forall ty . PrimType ty => (ty -> Bool) -> UArray ty -> (UArray ty, UArray ty)
break predicate arr
| k == sentinel = (arr, mempty)
| otherwise = splitAt (k - offset arr) arr
where
!k = onBackendPure' arr $ Alg.findIndexPredicate predicate
{-
{-# SPECIALIZE [3] findIndex :: Word8 -> UArray Word8 -> Maybe (Offset Word8) #-}
| len == 0 = (mempty, mempty)
| otherwise = runST $ unsafeIndexer xv (go xv xpredicate)
where
!len = length xv
go :: PrimType ty => UArray ty -> (ty -> Bool) -> (Offset ty -> ty) -> ST s (UArray ty, UArray ty)
go v predicate getIdx = pure (findBreak $ Offset 0)
where
findBreak !i
| i .==# len = (v, mempty)
| predicate (getIdx i) = splitAt (offsetAsSize i) v
| otherwise = findBreak (i + Offset 1)
{-# INLINE findBreak #-}
{-# INLINE go #-}
-}
| 907 | break predicate arr
| k == sentinel = (arr, mempty)
| otherwise = splitAt (k - offset arr) arr
where
!k = onBackendPure' arr $ Alg.findIndexPredicate predicate
{-
{-# SPECIALIZE [3] findIndex :: Word8 -> UArray Word8 -> Maybe (Offset Word8) #-}
| len == 0 = (mempty, mempty)
| otherwise = runST $ unsafeIndexer xv (go xv xpredicate)
where
!len = length xv
go :: PrimType ty => UArray ty -> (ty -> Bool) -> (Offset ty -> ty) -> ST s (UArray ty, UArray ty)
go v predicate getIdx = pure (findBreak $ Offset 0)
where
findBreak !i
| i .==# len = (v, mempty)
| predicate (getIdx i) = splitAt (offsetAsSize i) v
| otherwise = findBreak (i + Offset 1)
{-# INLINE findBreak #-}
{-# INLINE go #-}
-}
| 819 | false | true | 1 | 10 | 281 | 123 | 59 | 64 | null | null |
tomahawkins/powerpc | Language/PowerPC/RTL.hs | bsd-3-clause | while :: E -> RTL () -> RTL ()
while a b = RTL $ \ s0 -> ((), seqStmts s0 $ While a (stmt b)) | 93 | while :: E -> RTL () -> RTL ()
while a b = RTL $ \ s0 -> ((), seqStmts s0 $ While a (stmt b)) | 93 | while a b = RTL $ \ s0 -> ((), seqStmts s0 $ While a (stmt b)) | 62 | false | true | 0 | 11 | 25 | 69 | 34 | 35 | null | null |
mbrock/HBEAM | src/Language/Erlang/BEAM/Utils.hs | gpl-3.0 | modifyTVar :: TVar a -> (a -> a) -> STM ()
modifyTVar v f = readTVar v >>= writeTVar v . f | 90 | modifyTVar :: TVar a -> (a -> a) -> STM ()
modifyTVar v f = readTVar v >>= writeTVar v . f | 90 | modifyTVar v f = readTVar v >>= writeTVar v . f | 47 | false | true | 0 | 8 | 21 | 53 | 25 | 28 | null | null |
beni55/wai | warp/Network/Wai/Handler/Warp/Response.hs | mit | checkPersist :: Request -> IndexedHeader -> Bool
checkPersist req reqidxhdr
| ver == H.http11 = checkPersist11 conn
| otherwise = checkPersist10 conn
where
ver = httpVersion req
conn = reqidxhdr ! idxConnection
checkPersist11 (Just x)
| CI.foldCase x == "close" = False
checkPersist11 _ = True
checkPersist10 (Just x)
| CI.foldCase x == "keep-alive" = True
checkPersist10 _ = False | 480 | checkPersist :: Request -> IndexedHeader -> Bool
checkPersist req reqidxhdr
| ver == H.http11 = checkPersist11 conn
| otherwise = checkPersist10 conn
where
ver = httpVersion req
conn = reqidxhdr ! idxConnection
checkPersist11 (Just x)
| CI.foldCase x == "close" = False
checkPersist11 _ = True
checkPersist10 (Just x)
| CI.foldCase x == "keep-alive" = True
checkPersist10 _ = False | 480 | checkPersist req reqidxhdr
| ver == H.http11 = checkPersist11 conn
| otherwise = checkPersist10 conn
where
ver = httpVersion req
conn = reqidxhdr ! idxConnection
checkPersist11 (Just x)
| CI.foldCase x == "close" = False
checkPersist11 _ = True
checkPersist10 (Just x)
| CI.foldCase x == "keep-alive" = True
checkPersist10 _ = False | 431 | false | true | 7 | 10 | 158 | 143 | 67 | 76 | null | null |
vikraman/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | isTouchableMetaTyVar :: TcLevel -> TcTyVar -> Bool
isTouchableMetaTyVar ctxt_tclvl tv
= ASSERT2( isTcTyVar tv, ppr tv )
case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tv_tclvl }
-> ASSERT2( checkTcLevelInvariant ctxt_tclvl tv_tclvl,
ppr tv $$ ppr tv_tclvl $$ ppr ctxt_tclvl )
tv_tclvl `sameDepthAs` ctxt_tclvl
_ -> False | 377 | isTouchableMetaTyVar :: TcLevel -> TcTyVar -> Bool
isTouchableMetaTyVar ctxt_tclvl tv
= ASSERT2( isTcTyVar tv, ppr tv )
case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tv_tclvl }
-> ASSERT2( checkTcLevelInvariant ctxt_tclvl tv_tclvl,
ppr tv $$ ppr tv_tclvl $$ ppr ctxt_tclvl )
tv_tclvl `sameDepthAs` ctxt_tclvl
_ -> False | 377 | isTouchableMetaTyVar ctxt_tclvl tv
= ASSERT2( isTcTyVar tv, ppr tv )
case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tv_tclvl }
-> ASSERT2( checkTcLevelInvariant ctxt_tclvl tv_tclvl,
ppr tv $$ ppr tv_tclvl $$ ppr ctxt_tclvl )
tv_tclvl `sameDepthAs` ctxt_tclvl
_ -> False | 326 | false | true | 0 | 14 | 103 | 108 | 53 | 55 | null | null |
joe9/barrelfish | hake/RuleDefs.hs | mit | ---------------------------------------------------------------------
--
-- Very large-scale macros
--
----------------------------------------------------------------------
--
-- Build an application binary
--
application :: Args.Args
application = Args.defaultArgs { Args.buildFunction = applicationBuildFn } | 312 | application :: Args.Args
application = Args.defaultArgs { Args.buildFunction = applicationBuildFn } | 99 | application = Args.defaultArgs { Args.buildFunction = applicationBuildFn } | 74 | true | true | 0 | 7 | 27 | 43 | 24 | 19 | null | null |
wouwouwou/module_8 | src/main/haskell/series3/exercise2.hs | apache-2.0 | pp1b (Node1b n t1 t2) = RoseNode (show n) [pp1b t1, pp1b t2] | 60 | pp1b (Node1b n t1 t2) = RoseNode (show n) [pp1b t1, pp1b t2] | 60 | pp1b (Node1b n t1 t2) = RoseNode (show n) [pp1b t1, pp1b t2] | 60 | false | false | 0 | 7 | 12 | 42 | 20 | 22 | null | null |
frantisekfarka/ghc-dsi | libraries/base/Data/Typeable/Internal.hs | bsd-3-clause | funTc :: TyCon
funTc = typeRepTyCon (typeRep (Proxy :: Proxy (->))) | 67 | funTc :: TyCon
funTc = typeRepTyCon (typeRep (Proxy :: Proxy (->))) | 67 | funTc = typeRepTyCon (typeRep (Proxy :: Proxy (->))) | 52 | false | true | 0 | 10 | 10 | 32 | 17 | 15 | null | null |
GregorySchwartz/scan | src/Print.hs | gpl-3.0 | printTree :: ClusterTree -> Tree Int
printTree = fmap (unID . treeLabel) . unClusterTree | 88 | printTree :: ClusterTree -> Tree Int
printTree = fmap (unID . treeLabel) . unClusterTree | 88 | printTree = fmap (unID . treeLabel) . unClusterTree | 51 | false | true | 0 | 8 | 13 | 32 | 16 | 16 | null | null |
slpopejoy/fadno-xml | src/Fadno/MusicXml/MusicXml30.hs | bsd-2-clause | parseTupletNumber :: P.XParse TupletNumber
parseTupletNumber =
TupletNumber
<$> (P.xtext >>= parseNonNegativeInteger)
<*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
<*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
<*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
<*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
<*> P.optional (P.xattr (P.name "color") >>= parseColor) | 503 | parseTupletNumber :: P.XParse TupletNumber
parseTupletNumber =
TupletNumber
<$> (P.xtext >>= parseNonNegativeInteger)
<*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
<*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
<*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
<*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
<*> P.optional (P.xattr (P.name "color") >>= parseColor) | 503 | parseTupletNumber =
TupletNumber
<$> (P.xtext >>= parseNonNegativeInteger)
<*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
<*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
<*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
<*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
<*> P.optional (P.xattr (P.name "color") >>= parseColor) | 460 | false | true | 0 | 16 | 100 | 174 | 85 | 89 | null | null |
agrafix/Spock | reroute/benchmarks/Benchmarks.hs | bsd-3-clause | -- | Generate a number of paths consisting of a fixed number of fixed length
-- strings ("path segments") where the content of the segments are letters in
-- random order. Contains all permutations with the path.
rndRoutes ::
-- | Length of each string
Int ->
-- | Number of segments
Int ->
-- | Number of routes
Int ->
[[T.Text]]
rndRoutes strlen seglen num =
take num $
concatMap permutations $
chunks seglen $
map T.pack $
chunks strlen $ randomRs ('a', 'z') $ mkStdGen 1234 | 521 | rndRoutes ::
-- | Length of each string
Int ->
-- | Number of segments
Int ->
-- | Number of routes
Int ->
[[T.Text]]
rndRoutes strlen seglen num =
take num $
concatMap permutations $
chunks seglen $
map T.pack $
chunks strlen $ randomRs ('a', 'z') $ mkStdGen 1234 | 308 | rndRoutes strlen seglen num =
take num $
concatMap permutations $
chunks seglen $
map T.pack $
chunks strlen $ randomRs ('a', 'z') $ mkStdGen 1234 | 176 | true | true | 2 | 12 | 131 | 103 | 51 | 52 | null | null |
ganeti/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | ddmModify :: String
ddmModify = Types.ddmFullToRaw DdmFullModify | 64 | ddmModify :: String
ddmModify = Types.ddmFullToRaw DdmFullModify | 64 | ddmModify = Types.ddmFullToRaw DdmFullModify | 44 | false | true | 0 | 6 | 6 | 16 | 8 | 8 | null | null |
hamishmack/haskell-gi | lib/Data/GI/CodeGen/Code.hs | lgpl-2.1 | formatExportList :: [Export] -> Text
formatExportList exports =
T.unlines . catMaybes $ [ formatExportedModules exports
, formatToplevel exports
, formatTypeDecls exports
, formatMethods exports
, formatProperties exports
, formatSignals exports ] | 391 | formatExportList :: [Export] -> Text
formatExportList exports =
T.unlines . catMaybes $ [ formatExportedModules exports
, formatToplevel exports
, formatTypeDecls exports
, formatMethods exports
, formatProperties exports
, formatSignals exports ] | 391 | formatExportList exports =
T.unlines . catMaybes $ [ formatExportedModules exports
, formatToplevel exports
, formatTypeDecls exports
, formatMethods exports
, formatProperties exports
, formatSignals exports ] | 354 | false | true | 0 | 7 | 174 | 67 | 34 | 33 | null | null |
amccausl/Swish | Swish/HaskellRDF/GraphTest.hs | lgpl-2.1 | f10501 = toStatement v105 f01 v101 | 34 | f10501 = toStatement v105 f01 v101 | 34 | f10501 = toStatement v105 f01 v101 | 34 | false | false | 0 | 5 | 5 | 13 | 6 | 7 | null | null |
felixsch/xdg | src/System/Environment/XDG/Autostart.hs | gpl-3.0 | isHidden :: DesktopEntry -> Bool
isHidden
= fromMaybe False . getValue "Hidden" | 83 | isHidden :: DesktopEntry -> Bool
isHidden
= fromMaybe False . getValue "Hidden" | 83 | isHidden
= fromMaybe False . getValue "Hidden" | 50 | false | true | 0 | 7 | 15 | 28 | 12 | 16 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxTEXT_ATTR_FONT_WEIGHT :: Int
wxTEXT_ATTR_FONT_WEIGHT = 0x00000010 | 85 | wxTEXT_ATTR_FONT_WEIGHT :: Int
wxTEXT_ATTR_FONT_WEIGHT = 0x00000010 | 85 | wxTEXT_ATTR_FONT_WEIGHT = 0x00000010 | 45 | false | true | 0 | 4 | 23 | 11 | 6 | 5 | null | null |
changlinli/nikki | src/Graphics/Qt/CPPWrapper.hs | lgpl-3.0 | sizeQImage :: Ptr QImage -> IO (Size QtInt)
sizeQImage ptr = Size <$> widthQImage ptr <*> heightQImage ptr | 106 | sizeQImage :: Ptr QImage -> IO (Size QtInt)
sizeQImage ptr = Size <$> widthQImage ptr <*> heightQImage ptr | 106 | sizeQImage ptr = Size <$> widthQImage ptr <*> heightQImage ptr | 62 | false | true | 0 | 8 | 17 | 44 | 20 | 24 | null | null |
aelve/hslibs | src/Guide/Views/Utils.hs | bsd-3-clause | -- Use inputValue to get the value (works with input_ and textarea_)
onEnter :: JS -> Attribute
onEnter handler = onkeydown_ $
"if (event.keyCode == 13 || event.keyCode == 10) {"
+|handler|+" return false;}\n" | 217 | onEnter :: JS -> Attribute
onEnter handler = onkeydown_ $
"if (event.keyCode == 13 || event.keyCode == 10) {"
+|handler|+" return false;}\n" | 148 | onEnter handler = onkeydown_ $
"if (event.keyCode == 13 || event.keyCode == 10) {"
+|handler|+" return false;}\n" | 121 | true | true | 0 | 7 | 41 | 31 | 16 | 15 | null | null |
hspec/hspec | hspec-core/src/Test/Hspec/Core/Tree.hs | mit | filterForest_ :: [String] -> ([String] -> a -> Bool) -> [Tree c a] -> [Tree c a]
filterForest_ groups = mapMaybe . filterTree_ groups | 133 | filterForest_ :: [String] -> ([String] -> a -> Bool) -> [Tree c a] -> [Tree c a]
filterForest_ groups = mapMaybe . filterTree_ groups | 133 | filterForest_ groups = mapMaybe . filterTree_ groups | 52 | false | true | 0 | 9 | 23 | 66 | 34 | 32 | null | null |
TakeLab/gpkex | getCandidates.hs | bsd-3-clause | --HAS TO BE ADDED BEFORE COMPILING AND EXECUTING; example: "/home/user/Documents/training_set/"
outDir = "" | 107 | outDir = "" | 11 | outDir = "" | 11 | true | false | 0 | 4 | 12 | 7 | 4 | 3 | null | null |
NCrashed/servant-auth-token | example/acid/src/Monad.hs | bsd-3-clause | -- | Execution of 'ServerM'
runServerM :: ServerEnv -> ServerM a -> Handler a
runServerM e = runStdoutLoggingT . flip runReaderT e . unServerM | 142 | runServerM :: ServerEnv -> ServerM a -> Handler a
runServerM e = runStdoutLoggingT . flip runReaderT e . unServerM | 114 | runServerM e = runStdoutLoggingT . flip runReaderT e . unServerM | 64 | true | true | 0 | 7 | 23 | 42 | 20 | 22 | null | null |
denibertovic/haskell | kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs | bsd-3-clause | -- * V1JobStatus
-- | 'v1JobStatusActive' Lens
v1JobStatusActiveL :: Lens_' V1JobStatus (Maybe Int)
v1JobStatusActiveL f V1JobStatus{..} = (\v1JobStatusActive -> V1JobStatus { v1JobStatusActive, ..} ) <$> f v1JobStatusActive | 225 | v1JobStatusActiveL :: Lens_' V1JobStatus (Maybe Int)
v1JobStatusActiveL f V1JobStatus{..} = (\v1JobStatusActive -> V1JobStatus { v1JobStatusActive, ..} ) <$> f v1JobStatusActive | 177 | v1JobStatusActiveL f V1JobStatus{..} = (\v1JobStatusActive -> V1JobStatus { v1JobStatusActive, ..} ) <$> f v1JobStatusActive | 124 | true | true | 1 | 8 | 27 | 63 | 31 | 32 | null | null |
haroldcarr/rdf-triple-browser | haskell/threepenny-based/src/RTB.hs | apache-2.0 | aBoundNode :: BindingValue
aBoundNode = Bound (UNode (T.pack "A DUMMY NODE")) | 78 | aBoundNode :: BindingValue
aBoundNode = Bound (UNode (T.pack "A DUMMY NODE")) | 78 | aBoundNode = Bound (UNode (T.pack "A DUMMY NODE")) | 51 | false | true | 0 | 10 | 11 | 28 | 14 | 14 | null | null |
TinnedTuna/hacksoc-markov-challenge | Main.hs | bsd-2-clause | deTokenise :: [Text] -> Text
deTokenise = Data.Text.intercalate $ singleton ' ' | 79 | deTokenise :: [Text] -> Text
deTokenise = Data.Text.intercalate $ singleton ' ' | 79 | deTokenise = Data.Text.intercalate $ singleton ' ' | 50 | false | true | 0 | 6 | 11 | 28 | 15 | 13 | null | null |
tuura/fantasi | src/Tuura/Fantasi/VHDL/Internal/EnvironmentWriter.hs | mit | genericCounter :: [P.Vertex] -> String
genericCounter ns = "\tCOUNTER : Generic_counter\n"
++ "\t\tGENERIC MAP(" ++ show (bitSum ns) ++ ")\n"
++ "\t\tPORT MAP(\n"
++ "\t\t\tCLK\t=> CLK,\n"
++ "\t\t\tRST\t=> RST,\n"
++ "\t\t\tEN\t=> start_counting,\n"
++ "\t\t\tDOUT\t=> count);\n\n" | 391 | genericCounter :: [P.Vertex] -> String
genericCounter ns = "\tCOUNTER : Generic_counter\n"
++ "\t\tGENERIC MAP(" ++ show (bitSum ns) ++ ")\n"
++ "\t\tPORT MAP(\n"
++ "\t\t\tCLK\t=> CLK,\n"
++ "\t\t\tRST\t=> RST,\n"
++ "\t\t\tEN\t=> start_counting,\n"
++ "\t\t\tDOUT\t=> count);\n\n" | 391 | genericCounter ns = "\tCOUNTER : Generic_counter\n"
++ "\t\tGENERIC MAP(" ++ show (bitSum ns) ++ ")\n"
++ "\t\tPORT MAP(\n"
++ "\t\t\tCLK\t=> CLK,\n"
++ "\t\t\tRST\t=> RST,\n"
++ "\t\t\tEN\t=> start_counting,\n"
++ "\t\t\tDOUT\t=> count);\n\n" | 352 | false | true | 0 | 14 | 143 | 64 | 32 | 32 | null | null |
erikd/hs-tls | core/Network/TLS/Extra/Cipher.hs | bsd-3-clause | tripledes_ede BulkDecrypt key =
let ctx = noFail $ cipherInit key
in (\iv input -> let output = cbcDecrypt ctx (tripledes_iv iv) input in (output, takelast 8 input)) | 174 | tripledes_ede BulkDecrypt key =
let ctx = noFail $ cipherInit key
in (\iv input -> let output = cbcDecrypt ctx (tripledes_iv iv) input in (output, takelast 8 input)) | 174 | tripledes_ede BulkDecrypt key =
let ctx = noFail $ cipherInit key
in (\iv input -> let output = cbcDecrypt ctx (tripledes_iv iv) input in (output, takelast 8 input)) | 174 | false | false | 0 | 15 | 36 | 74 | 36 | 38 | null | null |
haskell-distributed/network-transport-tcp | src/Network/Transport/TCP/Internal.hs | bsd-3-clause | encodeEndPointAddress :: N.HostName
-> N.ServiceName
-> EndPointId
-> EndPointAddress
encodeEndPointAddress host port ix = EndPointAddress . BSC.pack $
host ++ ":" ++ port ++ ":" ++ show ix | 257 | encodeEndPointAddress :: N.HostName
-> N.ServiceName
-> EndPointId
-> EndPointAddress
encodeEndPointAddress host port ix = EndPointAddress . BSC.pack $
host ++ ":" ++ port ++ ":" ++ show ix | 257 | encodeEndPointAddress host port ix = EndPointAddress . BSC.pack $
host ++ ":" ++ port ++ ":" ++ show ix | 105 | false | true | 0 | 11 | 95 | 63 | 31 | 32 | null | null |
antalsz/hs-to-coq | examples/graph/graph/Data/Graph/Inductive/Query/Monad.hs | mit | graphNodesM :: (GraphM m gr) => GT m (gr a b) [Node]
graphNodesM = graphUFold (\(_,v,_,_)->(v:)) [] | 99 | graphNodesM :: (GraphM m gr) => GT m (gr a b) [Node]
graphNodesM = graphUFold (\(_,v,_,_)->(v:)) [] | 99 | graphNodesM = graphUFold (\(_,v,_,_)->(v:)) [] | 46 | false | true | 0 | 8 | 16 | 71 | 40 | 31 | null | null |
giorgidze/HCodecs | src/Codec/ByteString/Parser.hs | bsd-3-clause | runParserState :: Parser a -> L.ByteString -> Int64 -> Either String (a, L.ByteString, Int64)
runParserState m str off =
case unParser m (mkState str off) of
Left e -> Left e
Right (a, ~(S s ss newOff)) -> Right (a, s `bsJoin` ss, newOff)
------------------------------------------------------------------------ | 328 | runParserState :: Parser a -> L.ByteString -> Int64 -> Either String (a, L.ByteString, Int64)
runParserState m str off =
case unParser m (mkState str off) of
Left e -> Left e
Right (a, ~(S s ss newOff)) -> Right (a, s `bsJoin` ss, newOff)
------------------------------------------------------------------------ | 328 | runParserState m str off =
case unParser m (mkState str off) of
Left e -> Left e
Right (a, ~(S s ss newOff)) -> Right (a, s `bsJoin` ss, newOff)
------------------------------------------------------------------------ | 234 | false | true | 0 | 12 | 61 | 129 | 65 | 64 | null | null |
jchmrt/btjchm | Tell.hs | mit | tell :: User -> M.Map User [UserMessage]
-> ([IRCAction], M.Map User [UserMessage])
tell recipient usrMessages =
case M.lookup recipient usrMessages of
Just msgs -> ( tellMessages recipient msgs
, M.delete recipient usrMessages)
Nothing -> ([], usrMessages) | 301 | tell :: User -> M.Map User [UserMessage]
-> ([IRCAction], M.Map User [UserMessage])
tell recipient usrMessages =
case M.lookup recipient usrMessages of
Just msgs -> ( tellMessages recipient msgs
, M.delete recipient usrMessages)
Nothing -> ([], usrMessages) | 301 | tell recipient usrMessages =
case M.lookup recipient usrMessages of
Just msgs -> ( tellMessages recipient msgs
, M.delete recipient usrMessages)
Nothing -> ([], usrMessages) | 211 | false | true | 0 | 11 | 79 | 111 | 55 | 56 | null | null |
Lysxia/unparse-attoparsec | example/aeson.hs | mit | assertEqual :: (Show a, Eq a) => a -> a -> IO ()
assertEqual a a' =
if a == a' then
pure ()
else
fail $ "Not equal: " ++ show (a, a') | 145 | assertEqual :: (Show a, Eq a) => a -> a -> IO ()
assertEqual a a' =
if a == a' then
pure ()
else
fail $ "Not equal: " ++ show (a, a') | 145 | assertEqual a a' =
if a == a' then
pure ()
else
fail $ "Not equal: " ++ show (a, a') | 96 | false | true | 2 | 10 | 45 | 83 | 41 | 42 | null | null |
DanielG/rts-loader | test/lib/Lib.hs | gpl-3.0 | main = print test | 17 | main = print test | 17 | main = print test | 17 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
ThranMaru/DotaWHcheck | HLint.hs | gpl-2.0 | warn = map snd (Data.Map.toList x) ==> Data.Map.elems x | 55 | warn = map snd (Data.Map.toList x) ==> Data.Map.elems x | 55 | warn = map snd (Data.Map.toList x) ==> Data.Map.elems x | 55 | false | false | 0 | 9 | 8 | 30 | 15 | 15 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F14.hs | bsd-3-clause | -- glGlobalAlphaFactorbSUN -----------------------------------------------------
glGlobalAlphaFactorbSUN
:: MonadIO m
=> GLbyte -- ^ @factor@.
-> m ()
glGlobalAlphaFactorbSUN v1 = liftIO $ dyn484 ptr_glGlobalAlphaFactorbSUN v1 | 233 | glGlobalAlphaFactorbSUN
:: MonadIO m
=> GLbyte -- ^ @factor@.
-> m ()
glGlobalAlphaFactorbSUN v1 = liftIO $ dyn484 ptr_glGlobalAlphaFactorbSUN v1 | 151 | glGlobalAlphaFactorbSUN v1 = liftIO $ dyn484 ptr_glGlobalAlphaFactorbSUN v1 | 75 | true | true | 0 | 9 | 29 | 45 | 21 | 24 | null | null |
8l/barrelfish | hake/RuleDefs.hs | mit | makeDependCxxArch :: Options -> String -> String -> String -> String -> HRule
makeDependCxxArch opts phase src objfile depfile =
Rules [ Rule (makeDependCxxArchSub opts phase src objfile depfile),
Include (Out (optArch opts) depfile)
] | 261 | makeDependCxxArch :: Options -> String -> String -> String -> String -> HRule
makeDependCxxArch opts phase src objfile depfile =
Rules [ Rule (makeDependCxxArchSub opts phase src objfile depfile),
Include (Out (optArch opts) depfile)
] | 261 | makeDependCxxArch opts phase src objfile depfile =
Rules [ Rule (makeDependCxxArchSub opts phase src objfile depfile),
Include (Out (optArch opts) depfile)
] | 183 | false | true | 0 | 11 | 60 | 91 | 43 | 48 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Resource/Compute/Images/Delete.hs | mpl-2.0 | -- | Creates a value of 'ImagesDelete' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'imaImage'
--
-- * 'imaProject'
imagesDelete
:: Text -- ^ 'imaImage'
-> Text -- ^ 'imaProject'
-> ImagesDelete
imagesDelete pImaImage_ pImaProject_ =
ImagesDelete'
{ _imaImage = pImaImage_
, _imaProject = pImaProject_
} | 419 | imagesDelete
:: Text -- ^ 'imaImage'
-> Text -- ^ 'imaProject'
-> ImagesDelete
imagesDelete pImaImage_ pImaProject_ =
ImagesDelete'
{ _imaImage = pImaImage_
, _imaProject = pImaProject_
} | 215 | imagesDelete pImaImage_ pImaProject_ =
ImagesDelete'
{ _imaImage = pImaImage_
, _imaProject = pImaProject_
} | 124 | true | true | 0 | 8 | 92 | 56 | 32 | 24 | null | null |
yiannist/ganeti | src/Ganeti/THH/RPC.hs | bsd-2-clause | -- | Takes a list of function names and creates a RPC handler that delegates
-- calls to them.
--
-- The functions must conform to
-- @(J.JSON i, J.JSON o) => i -> ResultT GanetiException m o@. The @m@
-- monads types of all the functions must unify.
--
-- The result expression is of type @RpcServer m@.
mkRpcM
:: [Name] -- ^ the names of functions to include
-> Q Exp
mkRpcM names = [| dispatch . Map.fromList $
$( rpcFnsList . map (nameBase &&& toRpcFn) $ names ) |] | 505 | mkRpcM
:: [Name] -- ^ the names of functions to include
-> Q Exp
mkRpcM names = [| dispatch . Map.fromList $
$( rpcFnsList . map (nameBase &&& toRpcFn) $ names ) |] | 200 | mkRpcM names = [| dispatch . Map.fromList $
$( rpcFnsList . map (nameBase &&& toRpcFn) $ names ) |] | 123 | true | true | 0 | 6 | 127 | 36 | 24 | 12 | null | null |
nikai3d/ce-challenges | easy/calculate_distance.hs | bsd-3-clause | stripChars :: String -> String -> String
stripChars = filter . flip notElem | 75 | stripChars :: String -> String -> String
stripChars = filter . flip notElem | 75 | stripChars = filter . flip notElem | 34 | false | true | 1 | 8 | 12 | 33 | 14 | 19 | null | null |
siddhanathan/yi | yi-core/src/Yi/Buffer/HighLevel.hs | gpl-2.0 | nextCInLineExc :: Char -> BufferM ()
nextCInLineExc c = gotoCharacterB c Forward Exclusive True | 95 | nextCInLineExc :: Char -> BufferM ()
nextCInLineExc c = gotoCharacterB c Forward Exclusive True | 95 | nextCInLineExc c = gotoCharacterB c Forward Exclusive True | 58 | false | true | 0 | 7 | 13 | 32 | 15 | 17 | null | null |
narurien/ganeti-ceph | src/Ganeti/Luxi.hs | gpl-2.0 | parseSubmitJobResult v =
Bad . LuxiError $ "Unknown result from the master daemon: " ++
show (pp_value v) | 113 | parseSubmitJobResult v =
Bad . LuxiError $ "Unknown result from the master daemon: " ++
show (pp_value v) | 113 | parseSubmitJobResult v =
Bad . LuxiError $ "Unknown result from the master daemon: " ++
show (pp_value v) | 113 | false | false | 0 | 8 | 25 | 30 | 14 | 16 | null | null |
izuk/mgrep | Data/Text/AhoCorasick.hs | bsd-3-clause | goto (Node _ m _) ch = M.lookup (fromIntegral ch) m | 51 | goto (Node _ m _) ch = M.lookup (fromIntegral ch) m | 51 | goto (Node _ m _) ch = M.lookup (fromIntegral ch) m | 51 | false | false | 0 | 7 | 10 | 34 | 16 | 18 | null | null |
brendanhay/gogol | gogol-bigquery/gen/Network/Google/Resource/BigQuery/Routines/List.hs | mpl-2.0 | -- | Required. Project ID of the routines to list
rlProjectId :: Lens' RoutinesList Text
rlProjectId
= lens _rlProjectId (\ s a -> s{_rlProjectId = a}) | 153 | rlProjectId :: Lens' RoutinesList Text
rlProjectId
= lens _rlProjectId (\ s a -> s{_rlProjectId = a}) | 103 | rlProjectId
= lens _rlProjectId (\ s a -> s{_rlProjectId = a}) | 64 | true | true | 0 | 9 | 27 | 42 | 22 | 20 | null | null |
stefan-j/ProjectEuler | q17.hs | mit | wordnames 2 = "two" | 19 | wordnames 2 = "two" | 19 | wordnames 2 = "two" | 19 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
codemac/yi-editor | src/Yi/String.hs | gpl-2.0 | onLines :: ([String] -> [String]) -> String -> String
onLines transform = unlines' . transform . lines' | 103 | onLines :: ([String] -> [String]) -> String -> String
onLines transform = unlines' . transform . lines' | 103 | onLines transform = unlines' . transform . lines' | 49 | false | true | 0 | 9 | 16 | 49 | 24 | 25 | null | null |
spechub/Hets | Comorphisms/HasCASL2IsabelleHOL.hs | gpl-2.0 | matriPEq :: ProgEq -> CaseMatrix
matriPEq (ProgEq pat altTerm _) = matriArg pat altTerm | 87 | matriPEq :: ProgEq -> CaseMatrix
matriPEq (ProgEq pat altTerm _) = matriArg pat altTerm | 87 | matriPEq (ProgEq pat altTerm _) = matriArg pat altTerm | 54 | false | true | 0 | 7 | 13 | 33 | 16 | 17 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/Compiler.hs | bsd-3-clause | compileExpr (NegW16 e) = compileNeg e | 37 | compileExpr (NegW16 e) = compileNeg e | 37 | compileExpr (NegW16 e) = compileNeg e | 37 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
silky/ImplicitCAD | Graphics/Implicit/Export/TriangleMeshFormats.hs | gpl-2.0 | toFloat = realToFrac :: (Real a) => a -> Float | 46 | toFloat = realToFrac :: (Real a) => a -> Float | 46 | toFloat = realToFrac :: (Real a) => a -> Float | 46 | false | false | 1 | 6 | 9 | 27 | 13 | 14 | null | null |
yangjueji/hblas | src/Numerical/HBLAS/BLAS/Internal/Level3.hs | bsd-3-clause | isBadSymm RightSide ax ay bx by cx cy = isBadSymmBothSide ax ay bx by cx cy
|| (bx /= ay) | 93 | isBadSymm RightSide ax ay bx by cx cy = isBadSymmBothSide ax ay bx by cx cy
|| (bx /= ay) | 93 | isBadSymm RightSide ax ay bx by cx cy = isBadSymmBothSide ax ay bx by cx cy
|| (bx /= ay) | 93 | false | false | 1 | 5 | 23 | 47 | 23 | 24 | null | null |
iustin/prefix-units | Data/Prefix/Units.hs | bsd-3-clause | unitMultiplier Atto = siBase ^^ (-18 :: Int) | 49 | unitMultiplier Atto = siBase ^^ (-18 :: Int) | 49 | unitMultiplier Atto = siBase ^^ (-18 :: Int) | 49 | false | false | 0 | 7 | 12 | 21 | 11 | 10 | null | null |
brendanhay/gogol | gogol-spanner/gen/Network/Google/Spanner/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'ListBackupsResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lbrNextPageToken'
--
-- * 'lbrBackups'
listBackupsResponse
:: ListBackupsResponse
listBackupsResponse =
ListBackupsResponse' {_lbrNextPageToken = Nothing, _lbrBackups = Nothing} | 363 | listBackupsResponse
:: ListBackupsResponse
listBackupsResponse =
ListBackupsResponse' {_lbrNextPageToken = Nothing, _lbrBackups = Nothing} | 144 | listBackupsResponse =
ListBackupsResponse' {_lbrNextPageToken = Nothing, _lbrBackups = Nothing} | 97 | true | true | 0 | 7 | 55 | 42 | 24 | 18 | null | null |
droundy/franchise | Distribution/Franchise/ConfigureState.hs | bsd-3-clause | putSnoln :: String -> C ()
putSnoln str = whenC ((>= Normal) `fmap` getVerbosity) $
do putMnoln Stdout str
putMnoln Logfile str
-- | Print a string to the screen and to the log file. Note that this
-- will add a trailing newline for your convenience. | 285 | putSnoln :: String -> C ()
putSnoln str = whenC ((>= Normal) `fmap` getVerbosity) $
do putMnoln Stdout str
putMnoln Logfile str
-- | Print a string to the screen and to the log file. Note that this
-- will add a trailing newline for your convenience. | 285 | putSnoln str = whenC ((>= Normal) `fmap` getVerbosity) $
do putMnoln Stdout str
putMnoln Logfile str
-- | Print a string to the screen and to the log file. Note that this
-- will add a trailing newline for your convenience. | 258 | false | true | 0 | 9 | 81 | 66 | 32 | 34 | null | null |
mpickering/HaRe | src/Language/Haskell/Refact/Utils/GhcBugWorkArounds.hs | bsd-3-clause | -- import Language.Haskell.Refact.Utils.TypeSyn
-- ---------------------------------------------------------------------
{-
-- http://hackage.haskell.org/trac/ghc/ticket/7351
bypassGHCBug7351 :: [PosToken] -> [PosToken]
bypassGHCBug7351 ts = map go ts
where
go :: (GHC.Located GHC.Token, String) -> (GHC.Located GHC.Token, String)
go rt@(GHC.L (GHC.UnhelpfulSpan _) _t,_s) = rt
go (GHC.L (GHC.RealSrcSpan l) t,s) = (GHC.L (fixCol l) t,s)
fixCol l = GHC.mkSrcSpan (GHC.mkSrcLoc (GHC.srcSpanFile l) (GHC.srcSpanStartLine l) ((GHC.srcSpanStartCol l) - 1))
(GHC.mkSrcLoc (GHC.srcSpanFile l) (GHC.srcSpanEndLine l) ((GHC.srcSpanEndCol l) - 1))
-}
-- ---------------------------------------------------------------------
-- | Replacement for original 'getRichTokenStream' which will return
-- the tokens for a file processed by CPP.
-- See bug <http://ghc.haskell.org/trac/ghc/ticket/8265>
getRichTokenStreamWA :: GHC.GhcMonad m => GHC.Module -> m [(GHC.Located GHC.Token, String)]
getRichTokenStreamWA modu = do
(sourceFile, source, flags) <- getModuleSourceAndFlags modu
let startLoc = GHC.mkRealSrcLoc (GHC.mkFastString sourceFile) 1 1
case GHC.lexTokenStream source startLoc flags of
GHC.POk _ ts -> return $ GHC.addSourceToTokens startLoc source ts
GHC.PFailed _span _err ->
do
strSrcBuf <- getPreprocessedSrc sourceFile
case GHC.lexTokenStream strSrcBuf startLoc flags of
GHC.POk _ ts ->
do directiveToks <- GHC.liftIO $ getPreprocessorAsComments sourceFile
nonDirectiveToks <- tokeniseOriginalSrc startLoc flags source
let toks = GHC.addSourceToTokens startLoc source ts
return $ combineTokens directiveToks nonDirectiveToks toks
-- return directiveToks
-- return nonDirectiveToks
-- return toks
GHC.PFailed sspan err -> parseError flags sspan err
-- ---------------------------------------------------------------------
-- | Combine the three sets of tokens to produce a single set that
-- represents the code compiled, and will regenerate the original
-- source file.
-- [@directiveToks@] are the tokens corresponding to preprocessor
-- directives, converted to comments
-- [@origSrcToks@] are the tokenised source of the original code, with
-- the preprocessor directives stripped out so that
-- the lexer does not complain
-- [@postCppToks@] are the tokens that the compiler saw originally
-- NOTE: this scheme will only work for cpp in -nomacro mode | 2,649 | getRichTokenStreamWA :: GHC.GhcMonad m => GHC.Module -> m [(GHC.Located GHC.Token, String)]
getRichTokenStreamWA modu = do
(sourceFile, source, flags) <- getModuleSourceAndFlags modu
let startLoc = GHC.mkRealSrcLoc (GHC.mkFastString sourceFile) 1 1
case GHC.lexTokenStream source startLoc flags of
GHC.POk _ ts -> return $ GHC.addSourceToTokens startLoc source ts
GHC.PFailed _span _err ->
do
strSrcBuf <- getPreprocessedSrc sourceFile
case GHC.lexTokenStream strSrcBuf startLoc flags of
GHC.POk _ ts ->
do directiveToks <- GHC.liftIO $ getPreprocessorAsComments sourceFile
nonDirectiveToks <- tokeniseOriginalSrc startLoc flags source
let toks = GHC.addSourceToTokens startLoc source ts
return $ combineTokens directiveToks nonDirectiveToks toks
-- return directiveToks
-- return nonDirectiveToks
-- return toks
GHC.PFailed sspan err -> parseError flags sspan err
-- ---------------------------------------------------------------------
-- | Combine the three sets of tokens to produce a single set that
-- represents the code compiled, and will regenerate the original
-- source file.
-- [@directiveToks@] are the tokens corresponding to preprocessor
-- directives, converted to comments
-- [@origSrcToks@] are the tokenised source of the original code, with
-- the preprocessor directives stripped out so that
-- the lexer does not complain
-- [@postCppToks@] are the tokens that the compiler saw originally
-- NOTE: this scheme will only work for cpp in -nomacro mode | 1,717 | getRichTokenStreamWA modu = do
(sourceFile, source, flags) <- getModuleSourceAndFlags modu
let startLoc = GHC.mkRealSrcLoc (GHC.mkFastString sourceFile) 1 1
case GHC.lexTokenStream source startLoc flags of
GHC.POk _ ts -> return $ GHC.addSourceToTokens startLoc source ts
GHC.PFailed _span _err ->
do
strSrcBuf <- getPreprocessedSrc sourceFile
case GHC.lexTokenStream strSrcBuf startLoc flags of
GHC.POk _ ts ->
do directiveToks <- GHC.liftIO $ getPreprocessorAsComments sourceFile
nonDirectiveToks <- tokeniseOriginalSrc startLoc flags source
let toks = GHC.addSourceToTokens startLoc source ts
return $ combineTokens directiveToks nonDirectiveToks toks
-- return directiveToks
-- return nonDirectiveToks
-- return toks
GHC.PFailed sspan err -> parseError flags sspan err
-- ---------------------------------------------------------------------
-- | Combine the three sets of tokens to produce a single set that
-- represents the code compiled, and will regenerate the original
-- source file.
-- [@directiveToks@] are the tokens corresponding to preprocessor
-- directives, converted to comments
-- [@origSrcToks@] are the tokenised source of the original code, with
-- the preprocessor directives stripped out so that
-- the lexer does not complain
-- [@postCppToks@] are the tokens that the compiler saw originally
-- NOTE: this scheme will only work for cpp in -nomacro mode | 1,625 | true | true | 0 | 21 | 582 | 290 | 145 | 145 | null | null |
Gabriel439/Haskell-Errors-Library | Control/Error/Util.hs | bsd-3-clause | {- | 'fmap' specialized to 'ExceptT', given a name symmetric to
'Data.EitherR.fmapLT'
-}
fmapRT :: (Monad m) => (a -> b) -> ExceptT l m a -> ExceptT l m b
fmapRT = liftM | 174 | fmapRT :: (Monad m) => (a -> b) -> ExceptT l m a -> ExceptT l m b
fmapRT = liftM | 80 | fmapRT = liftM | 14 | true | true | 0 | 8 | 38 | 50 | 26 | 24 | null | null |
jsavatgy/dit-doo | code/accum-start-01.hs | gpl-2.0 | accumTest content randTrlens accum = map (\(a,b) -> (a, fst (mapAccumFsum b))) l1
where
l1 = map (randAccum rmap) (zip tests randTrlens)
tests = take 10 (repeat accum)
rmap = rootmap example
example = take 10000 content | 237 | accumTest content randTrlens accum = map (\(a,b) -> (a, fst (mapAccumFsum b))) l1
where
l1 = map (randAccum rmap) (zip tests randTrlens)
tests = take 10 (repeat accum)
rmap = rootmap example
example = take 10000 content | 237 | accumTest content randTrlens accum = map (\(a,b) -> (a, fst (mapAccumFsum b))) l1
where
l1 = map (randAccum rmap) (zip tests randTrlens)
tests = take 10 (repeat accum)
rmap = rootmap example
example = take 10000 content | 237 | false | false | 4 | 11 | 54 | 125 | 55 | 70 | null | null |
nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles | Reader/src/ChapterExercises.hs | gpl-3.0 | sequA :: Integral a => a -> [Bool]
sequA m = sequenceA [(>3), (<8), even] m | 75 | sequA :: Integral a => a -> [Bool]
sequA m = sequenceA [(>3), (<8), even] m | 75 | sequA m = sequenceA [(>3), (<8), even] m | 40 | false | true | 0 | 9 | 15 | 55 | 29 | 26 | null | null |
supki/libstackexchange | src/Network/StackExchange/API.hs | mit | -- | <https://api.stackexchange.com/docs/me-tags>
meTags ∷ Request RequireToken "meTags" [SE Tag]
meTags = path "me/tags" <> parse (attoparsec items ".me/tags: ") | 162 | meTags ∷ Request RequireToken "meTags" [SE Tag]
meTags = path "me/tags" <> parse (attoparsec items ".me/tags: ") | 112 | meTags = path "me/tags" <> parse (attoparsec items ".me/tags: ") | 64 | true | true | 0 | 8 | 19 | 43 | 21 | 22 | null | null |
Michaelt293/isotope | src/Isotope/Ion.hs | gpl-3.0 | -- | `doublyProtonated` takes a type and returns a doubly `Protonated` ion.
doublyProtonated :: a -> Protonated (Protonated a)
doublyProtonated = Protonated . Protonated | 169 | doublyProtonated :: a -> Protonated (Protonated a)
doublyProtonated = Protonated . Protonated | 93 | doublyProtonated = Protonated . Protonated | 42 | true | true | 0 | 8 | 23 | 29 | 15 | 14 | null | null |
gilith/hol | src/HOL/TermData.hs | mit | eqVar :: Var -> TermData -> Bool
eqVar v d =
case destVar d of
Just w -> w == v
Nothing -> False
-- Function application | 137 | eqVar :: Var -> TermData -> Bool
eqVar v d =
case destVar d of
Just w -> w == v
Nothing -> False
-- Function application | 137 | eqVar v d =
case destVar d of
Just w -> w == v
Nothing -> False
-- Function application | 104 | false | true | 0 | 8 | 43 | 57 | 26 | 31 | null | null |
pbl64k/CodeSprints | CodeSprint-2012-05-12-Interviewstreet/Complexity/c.accepted.hs | bsd-2-clause | evalCond vars (Ne x1 x2) = evalX vars x1 x2 (/=) | 48 | evalCond vars (Ne x1 x2) = evalX vars x1 x2 (/=) | 48 | evalCond vars (Ne x1 x2) = evalX vars x1 x2 (/=) | 48 | false | false | 0 | 7 | 10 | 30 | 15 | 15 | null | null |
ezyang/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | absIntegerIdKey = mkPreludeMiscIdUnique 72 | 56 | absIntegerIdKey = mkPreludeMiscIdUnique 72 | 56 | absIntegerIdKey = mkPreludeMiscIdUnique 72 | 56 | false | false | 0 | 5 | 17 | 9 | 4 | 5 | null | null |
forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/typecheck/should_fail/T5051.hs | bsd-3-clause | foo :: Ord a => [a] -> Bool
foo x = x >= x | 42 | foo :: Ord a => [a] -> Bool
foo x = x >= x | 42 | foo x = x >= x | 14 | false | true | 0 | 7 | 13 | 32 | 16 | 16 | null | null |
tjakway/ghcjvm | compiler/main/HscMain.hs | bsd-3-clause | showModuleIndex :: (Int, Int) -> String
showModuleIndex (i,n) = "[" ++ padded ++ " of " ++ n_str ++ "] "
where
n_str = show n
i_str = show i
padded = replicate (length n_str - length i_str) ' ' ++ i_str | 216 | showModuleIndex :: (Int, Int) -> String
showModuleIndex (i,n) = "[" ++ padded ++ " of " ++ n_str ++ "] "
where
n_str = show n
i_str = show i
padded = replicate (length n_str - length i_str) ' ' ++ i_str | 216 | showModuleIndex (i,n) = "[" ++ padded ++ " of " ++ n_str ++ "] "
where
n_str = show n
i_str = show i
padded = replicate (length n_str - length i_str) ' ' ++ i_str | 176 | false | true | 2 | 9 | 55 | 98 | 47 | 51 | null | null |
TomHammersley/HaskellRenderer | app/src/Primitive.hs | gpl-2.0 | -- -------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Specialised intersection code for bounding volume hierarchies
sphereIntersect :: Double -> Vector -> Ray -> Maybe Double
sphereIntersect rad centre (Ray rayOrg rayDir _ rayLen)
| (centre `distanceSq` rayOrg) < (rad * rad) = Just 0 -- Inside the sphere!
| discriminant < 0 = Nothing
| discriminant == 0 = Just ((-b) / 2)
| root1 >= 0 && root1 <= rayLen = Just root1
| root2 >= 0 && root2 <= rayLen = Just root2
| otherwise = Nothing
where
delta = rayOrg <-> centre
b = 2.0 * (delta `dot3` rayDir)
c = (delta `dot3` delta) - rad**2
discriminant = b**2 - 4 * c -- A is 1 because the ray direction is normalised
root1 = (-b - sqrt discriminant) / 2
root2 = (-b + sqrt discriminant) / 2 | 916 | sphereIntersect :: Double -> Vector -> Ray -> Maybe Double
sphereIntersect rad centre (Ray rayOrg rayDir _ rayLen)
| (centre `distanceSq` rayOrg) < (rad * rad) = Just 0 -- Inside the sphere!
| discriminant < 0 = Nothing
| discriminant == 0 = Just ((-b) / 2)
| root1 >= 0 && root1 <= rayLen = Just root1
| root2 >= 0 && root2 <= rayLen = Just root2
| otherwise = Nothing
where
delta = rayOrg <-> centre
b = 2.0 * (delta `dot3` rayDir)
c = (delta `dot3` delta) - rad**2
discriminant = b**2 - 4 * c -- A is 1 because the ray direction is normalised
root1 = (-b - sqrt discriminant) / 2
root2 = (-b + sqrt discriminant) / 2 | 684 | sphereIntersect rad centre (Ray rayOrg rayDir _ rayLen)
| (centre `distanceSq` rayOrg) < (rad * rad) = Just 0 -- Inside the sphere!
| discriminant < 0 = Nothing
| discriminant == 0 = Just ((-b) / 2)
| root1 >= 0 && root1 <= rayLen = Just root1
| root2 >= 0 && root2 <= rayLen = Just root2
| otherwise = Nothing
where
delta = rayOrg <-> centre
b = 2.0 * (delta `dot3` rayDir)
c = (delta `dot3` delta) - rad**2
discriminant = b**2 - 4 * c -- A is 1 because the ray direction is normalised
root1 = (-b - sqrt discriminant) / 2
root2 = (-b + sqrt discriminant) / 2 | 625 | true | true | 8 | 15 | 201 | 300 | 150 | 150 | null | null |
hermish/courseography | app/Css/Constants.hs | gpl-3.0 | -- |Defines "stroke" as text for CSS.
stroke :: Text -> Css
stroke = (-:) "stroke" | 82 | stroke :: Text -> Css
stroke = (-:) "stroke" | 44 | stroke = (-:) "stroke" | 22 | true | true | 0 | 7 | 15 | 28 | 13 | 15 | null | null |
futtetennista/IntroductionToFunctionalProgramming | RWH/test/Ch13/NumSpec.hs | mit | prop_add _ =
property True | 28 | prop_add _ =
property True | 28 | prop_add _ =
property True | 28 | false | false | 0 | 5 | 6 | 12 | 5 | 7 | null | null |
stu-smith/project-euler-haskell | Euler-059.hs | mit | validKeys s = filter (\ k -> isEnglish $ decrypt s k) allKeys | 61 | validKeys s = filter (\ k -> isEnglish $ decrypt s k) allKeys | 61 | validKeys s = filter (\ k -> isEnglish $ decrypt s k) allKeys | 61 | false | false | 0 | 9 | 12 | 31 | 15 | 16 | null | null |
TransformingMusicology/adb-test-framework | src/Main.hs | gpl-3.0 | opts :: ParserInfo TestConfig
opts = info ( helper <*> config )
( fullDesc
<> progDesc "A test framework for audioDB"
<> header "adbtest - a test framework for audioDB" ) | 195 | opts :: ParserInfo TestConfig
opts = info ( helper <*> config )
( fullDesc
<> progDesc "A test framework for audioDB"
<> header "adbtest - a test framework for audioDB" ) | 195 | opts = info ( helper <*> config )
( fullDesc
<> progDesc "A test framework for audioDB"
<> header "adbtest - a test framework for audioDB" ) | 165 | false | true | 1 | 9 | 55 | 48 | 21 | 27 | null | null |
chengzh2008/hpffp | src/ch24-Parser/marshalling.hs | bsd-3-clause | dec :: LBS.ByteString -> Maybe NumberOrString
dec = decode | 58 | dec :: LBS.ByteString -> Maybe NumberOrString
dec = decode | 58 | dec = decode | 12 | false | true | 0 | 6 | 8 | 20 | 10 | 10 | null | null |
odi/tcl-reservation | src/DB.hs | bsd-3-clause | convertReservation :: DBReservation -> [Person] -> Reservation
convertReservation dbr@DBReservation{..} ps =
Reservation dbrId dbrDate dbrStartTime dbrStopTime dbrUser ps (intToCourt dbrCourt) dbrType dbrComment | 213 | convertReservation :: DBReservation -> [Person] -> Reservation
convertReservation dbr@DBReservation{..} ps =
Reservation dbrId dbrDate dbrStartTime dbrStopTime dbrUser ps (intToCourt dbrCourt) dbrType dbrComment | 213 | convertReservation dbr@DBReservation{..} ps =
Reservation dbrId dbrDate dbrStartTime dbrStopTime dbrUser ps (intToCourt dbrCourt) dbrType dbrComment | 150 | false | true | 0 | 8 | 23 | 61 | 31 | 30 | null | null |
yangjueji/hblas | tests/UnitBLAS/Level3.hs | bsd-3-clause | matmatTest1CSYR2K :: IO ()
matmatTest1CSYR2K = do
a <- Matrix.generateMutableDenseMatrix (Matrix.SRow) (2,3) (\(x, y) -> [1, 2, 3, 4, 5, 6] !! (x + y * 2))
b <- Matrix.generateMutableDenseMatrix (Matrix.SRow) (2,3) (\(x, y) -> [1, 2, 3, 4, 5, 6] !! (x + y * 2))
c <- Matrix.generateMutableDenseMatrix (Matrix.SRow) (3,3) (\(x, y) -> [1:+0, 1:+1, 1:+1, 0:+0, 1:+0, 2:+2, 0:+0, 0:+0, 1:+0] !! (x + y * 3))
BLAS.csyr2k Matrix.MatUpper Matrix.NoTranspose 1.0 1.0 a b c
resList <- Matrix.mutableVectorToList $ _bufferDenMutMat c
resList @?= [11:+0, 23:+1, 35:+1, 0:+0, 51:+0, 80:+2, 0:+0, 0:+0, 123:+0]
-- [1:+1 2] [1:+1 3 5] [1:+0 1:+1 1:+1] [9:+4 0:+0 0:+0 ]
-- [3 4] * [2 4 6] * 2 + [1:+1 1:+0 2:+2] = [23:+7 51:+0 0:+0 ]
-- [5 6] [1:+1 2:+2 1:+0] [35:+11 80:+2 123:+0] | 838 | matmatTest1CSYR2K :: IO ()
matmatTest1CSYR2K = do
a <- Matrix.generateMutableDenseMatrix (Matrix.SRow) (2,3) (\(x, y) -> [1, 2, 3, 4, 5, 6] !! (x + y * 2))
b <- Matrix.generateMutableDenseMatrix (Matrix.SRow) (2,3) (\(x, y) -> [1, 2, 3, 4, 5, 6] !! (x + y * 2))
c <- Matrix.generateMutableDenseMatrix (Matrix.SRow) (3,3) (\(x, y) -> [1:+0, 1:+1, 1:+1, 0:+0, 1:+0, 2:+2, 0:+0, 0:+0, 1:+0] !! (x + y * 3))
BLAS.csyr2k Matrix.MatUpper Matrix.NoTranspose 1.0 1.0 a b c
resList <- Matrix.mutableVectorToList $ _bufferDenMutMat c
resList @?= [11:+0, 23:+1, 35:+1, 0:+0, 51:+0, 80:+2, 0:+0, 0:+0, 123:+0]
-- [1:+1 2] [1:+1 3 5] [1:+0 1:+1 1:+1] [9:+4 0:+0 0:+0 ]
-- [3 4] * [2 4 6] * 2 + [1:+1 1:+0 2:+2] = [23:+7 51:+0 0:+0 ]
-- [5 6] [1:+1 2:+2 1:+0] [35:+11 80:+2 123:+0] | 838 | matmatTest1CSYR2K = do
a <- Matrix.generateMutableDenseMatrix (Matrix.SRow) (2,3) (\(x, y) -> [1, 2, 3, 4, 5, 6] !! (x + y * 2))
b <- Matrix.generateMutableDenseMatrix (Matrix.SRow) (2,3) (\(x, y) -> [1, 2, 3, 4, 5, 6] !! (x + y * 2))
c <- Matrix.generateMutableDenseMatrix (Matrix.SRow) (3,3) (\(x, y) -> [1:+0, 1:+1, 1:+1, 0:+0, 1:+0, 2:+2, 0:+0, 0:+0, 1:+0] !! (x + y * 3))
BLAS.csyr2k Matrix.MatUpper Matrix.NoTranspose 1.0 1.0 a b c
resList <- Matrix.mutableVectorToList $ _bufferDenMutMat c
resList @?= [11:+0, 23:+1, 35:+1, 0:+0, 51:+0, 80:+2, 0:+0, 0:+0, 123:+0]
-- [1:+1 2] [1:+1 3 5] [1:+0 1:+1 1:+1] [9:+4 0:+0 0:+0 ]
-- [3 4] * [2 4 6] * 2 + [1:+1 1:+0 2:+2] = [23:+7 51:+0 0:+0 ]
-- [5 6] [1:+1 2:+2 1:+0] [35:+11 80:+2 123:+0] | 811 | false | true | 0 | 14 | 205 | 396 | 221 | 175 | null | null |
recursion-ninja/megaparsec | Text/Megaparsec/Error.hs | bsd-2-clause | charPretty' '\GS' = pure "group separator" | 43 | charPretty' '\GS' = pure "group separator" | 43 | charPretty' '\GS' = pure "group separator" | 43 | false | false | 1 | 5 | 6 | 16 | 5 | 11 | null | null |
spechub/Hets | OWL2/ASKeywords.hs | gpl-2.0 | dataHasValueS :: String
dataHasValueS = "DataHasValue" | 54 | dataHasValueS :: String
dataHasValueS = "DataHasValue" | 54 | dataHasValueS = "DataHasValue" | 30 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.