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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DougBurke/swish | tests/RDFQueryTest.hs | lgpl-2.1 | unbound50a, unbound50b :: [RDFLabel]
unbound50a = [Var "a"] | 59 | unbound50a, unbound50b :: [RDFLabel]
unbound50a = [Var "a"] | 59 | unbound50a = [Var "a"] | 22 | false | true | 2 | 7 | 7 | 30 | 13 | 17 | null | null |
OlegTheCat/eight-x-eight | src/Game.hs | mit | moveCursorForPlayer Player2 Left = moveCursor Left | 51 | moveCursorForPlayer Player2 Left = moveCursor Left | 51 | moveCursorForPlayer Player2 Left = moveCursor Left | 51 | false | false | 0 | 5 | 6 | 14 | 6 | 8 | null | null |
tamaralipowski/courseography | hs/Database/CourseQueries.hs | gpl-3.0 | -- | Builds a Session structure from a list of tuples from the Lecture table,
-- and a list of tuples from the Tutorial table.
buildSession :: [Entity Lecture] -> [Entity Tutorial] -> Maybe Tables.Session
buildSession lecs tuts =
Just $ Tables.Session (map entityVal lecs)
(map entityVal tuts) | 323 | buildSession :: [Entity Lecture] -> [Entity Tutorial] -> Maybe Tables.Session
buildSession lecs tuts =
Just $ Tables.Session (map entityVal lecs)
(map entityVal tuts) | 196 | buildSession lecs tuts =
Just $ Tables.Session (map entityVal lecs)
(map entityVal tuts) | 118 | true | true | 2 | 8 | 77 | 75 | 36 | 39 | null | null |
Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Input/InputConstants.hs | mit | hatLeft :: Int
hatLeft = fromIntegral $ [C.pure| int {HAT_LEFT} |] | 66 | hatLeft :: Int
hatLeft = fromIntegral $ [C.pure| int {HAT_LEFT} |] | 66 | hatLeft = fromIntegral $ [C.pure| int {HAT_LEFT} |] | 51 | false | true | 0 | 6 | 10 | 21 | 13 | 8 | null | null |
kazu-yamamoto/http2 | Network/HPACK/Huffman/Tree.hs | bsd-3-clause | build cnt0 xs = let (cnt1,l) = build (cnt0 + 1) fs
(cnt2,r) = build cnt1 ts
in (cnt2, Bin Nothing cnt0 l r)
where
(fs',ts') = partition ((==) F . head . snd) xs
fs = map (second tail) fs'
ts = map (second tail) ts'
-- | Marking the EOS path | 309 | build cnt0 xs = let (cnt1,l) = build (cnt0 + 1) fs
(cnt2,r) = build cnt1 ts
in (cnt2, Bin Nothing cnt0 l r)
where
(fs',ts') = partition ((==) F . head . snd) xs
fs = map (second tail) fs'
ts = map (second tail) ts'
-- | Marking the EOS path | 309 | build cnt0 xs = let (cnt1,l) = build (cnt0 + 1) fs
(cnt2,r) = build cnt1 ts
in (cnt2, Bin Nothing cnt0 l r)
where
(fs',ts') = partition ((==) F . head . snd) xs
fs = map (second tail) fs'
ts = map (second tail) ts'
-- | Marking the EOS path | 309 | false | false | 2 | 11 | 121 | 141 | 73 | 68 | null | null |
munyari/programming-problems | exercism.io/haskell/leap/src/LeapYear.hs | gpl-2.0 | isLeapYear year
| year `mod` 400 == 0 = True
| year `mod` 100 == 0 = False
| year `mod` 4 == 0 = True
| otherwise = False | 149 | isLeapYear year
| year `mod` 400 == 0 = True
| year `mod` 100 == 0 = False
| year `mod` 4 == 0 = True
| otherwise = False | 149 | isLeapYear year
| year `mod` 400 == 0 = True
| year `mod` 100 == 0 = False
| year `mod` 4 == 0 = True
| otherwise = False | 149 | false | false | 1 | 9 | 57 | 78 | 39 | 39 | null | null |
phischu/fragnix | tests/packages/scotty/Network.HTTP2.Priority.hs | bsd-3-clause | ----------------------------------------------------------------
-- | Creating a new priority tree.
newPriorityTree :: IO (PriorityTree a)
newPriorityTree = PriorityTree <$> newTVarIO Map.empty
<*> atomically Q.new | 246 | newPriorityTree :: IO (PriorityTree a)
newPriorityTree = PriorityTree <$> newTVarIO Map.empty
<*> atomically Q.new | 145 | newPriorityTree = PriorityTree <$> newTVarIO Map.empty
<*> atomically Q.new | 106 | true | true | 0 | 8 | 53 | 40 | 20 | 20 | null | null |
ezyang/ghc | libraries/base/tests/IO/encoding005.hs | bsd-3-clause | test_latin1 :: CodingFailureMode -> TextEncoding -> IO ()
test_latin1 cfm enc = do
testIO (decode enc [0..0xff]) $ Just ['\0'..'\xff']
testIO (encode enc ['\0'..'\xff']) $ Just [0..0xff]
testIO (encode enc "\xfe\xff\x100\x101\x100\xff\xfe") $ case cfm of
ErrorOnCodingFailure -> Nothing
IgnoreCodingFailure -> Just [0xfe,0xff,0xff,0xfe]
TransliterateCodingFailure -> Just [0xfe,0xff,0x3f,0x3f,0x3f,0xff,0xfe]
-- N.B. The argument "latin1//TRANSLIT" to mkTextEncoding does not
-- correspond to "latin1//TRANSLIT" in iconv! Instead GHC asks iconv
-- to encode to "latin1" and uses its own "evil hack" to insert '?'
-- (ASCII 0x3f) in place of failures. See GHC.IO.Encoding.recoverEncode.
--
-- U+0100 is LATIN CAPITAL LETTER A WITH MACRON, which iconv would
-- transliterate to 'A' (ASCII 0x41). Similarly iconv would
-- transliterate U+0101 LATIN SMALL LETTER A WITH MACRON to 'a'
-- (ASCII 0x61).
RoundtripFailure -> Nothing | 983 | test_latin1 :: CodingFailureMode -> TextEncoding -> IO ()
test_latin1 cfm enc = do
testIO (decode enc [0..0xff]) $ Just ['\0'..'\xff']
testIO (encode enc ['\0'..'\xff']) $ Just [0..0xff]
testIO (encode enc "\xfe\xff\x100\x101\x100\xff\xfe") $ case cfm of
ErrorOnCodingFailure -> Nothing
IgnoreCodingFailure -> Just [0xfe,0xff,0xff,0xfe]
TransliterateCodingFailure -> Just [0xfe,0xff,0x3f,0x3f,0x3f,0xff,0xfe]
-- N.B. The argument "latin1//TRANSLIT" to mkTextEncoding does not
-- correspond to "latin1//TRANSLIT" in iconv! Instead GHC asks iconv
-- to encode to "latin1" and uses its own "evil hack" to insert '?'
-- (ASCII 0x3f) in place of failures. See GHC.IO.Encoding.recoverEncode.
--
-- U+0100 is LATIN CAPITAL LETTER A WITH MACRON, which iconv would
-- transliterate to 'A' (ASCII 0x41). Similarly iconv would
-- transliterate U+0101 LATIN SMALL LETTER A WITH MACRON to 'a'
-- (ASCII 0x61).
RoundtripFailure -> Nothing | 983 | test_latin1 cfm enc = do
testIO (decode enc [0..0xff]) $ Just ['\0'..'\xff']
testIO (encode enc ['\0'..'\xff']) $ Just [0..0xff]
testIO (encode enc "\xfe\xff\x100\x101\x100\xff\xfe") $ case cfm of
ErrorOnCodingFailure -> Nothing
IgnoreCodingFailure -> Just [0xfe,0xff,0xff,0xfe]
TransliterateCodingFailure -> Just [0xfe,0xff,0x3f,0x3f,0x3f,0xff,0xfe]
-- N.B. The argument "latin1//TRANSLIT" to mkTextEncoding does not
-- correspond to "latin1//TRANSLIT" in iconv! Instead GHC asks iconv
-- to encode to "latin1" and uses its own "evil hack" to insert '?'
-- (ASCII 0x3f) in place of failures. See GHC.IO.Encoding.recoverEncode.
--
-- U+0100 is LATIN CAPITAL LETTER A WITH MACRON, which iconv would
-- transliterate to 'A' (ASCII 0x41). Similarly iconv would
-- transliterate U+0101 LATIN SMALL LETTER A WITH MACRON to 'a'
-- (ASCII 0x61).
RoundtripFailure -> Nothing | 925 | false | true | 0 | 12 | 185 | 181 | 97 | 84 | null | null |
eggzilla/ViennaRNAParser | ViennaRNAParserTest.hs | gpl-3.0 | main = do
args <- getArgs
let input_file = (head args)
parsedinput <- readRNAplex input_file
let rightRNAz = fromRight parsedinput
--print rightRNAz
putStrLn (show $ duplexEnergyWithoutAccessiblity $ head rightRNAz)
--putStrLn (show $ structureConservationIndex $rightRNAz) | 288 | main = do
args <- getArgs
let input_file = (head args)
parsedinput <- readRNAplex input_file
let rightRNAz = fromRight parsedinput
--print rightRNAz
putStrLn (show $ duplexEnergyWithoutAccessiblity $ head rightRNAz)
--putStrLn (show $ structureConservationIndex $rightRNAz) | 288 | main = do
args <- getArgs
let input_file = (head args)
parsedinput <- readRNAplex input_file
let rightRNAz = fromRight parsedinput
--print rightRNAz
putStrLn (show $ duplexEnergyWithoutAccessiblity $ head rightRNAz)
--putStrLn (show $ structureConservationIndex $rightRNAz) | 288 | false | false | 0 | 11 | 48 | 72 | 33 | 39 | null | null |
ssaavedra/liquidhaskell | tests/neg/vector2.hs | bsd-3-clause | loop :: Int -> Int -> a -> (Int -> a -> a) -> a
loop lo hi base f = go base lo
where
go acc i
| i /= hi = go (f i acc) (i + 1)
| otherwise = acc | 170 | loop :: Int -> Int -> a -> (Int -> a -> a) -> a
loop lo hi base f = go base lo
where
go acc i
| i /= hi = go (f i acc) (i + 1)
| otherwise = acc | 169 | loop lo hi base f = go base lo
where
go acc i
| i /= hi = go (f i acc) (i + 1)
| otherwise = acc | 121 | false | true | 0 | 12 | 69 | 118 | 53 | 65 | null | null |
nikki-and-the-robots/nikki | src/Sorts/Nikki/Initialisation.hs | lgpl-3.0 | legs = Polygon [
Vector legLeft legUp,
Vector legLeft low,
Vector legRight low,
Vector legRight legUp
] | 123 | legs = Polygon [
Vector legLeft legUp,
Vector legLeft low,
Vector legRight low,
Vector legRight legUp
] | 123 | legs = Polygon [
Vector legLeft legUp,
Vector legLeft low,
Vector legRight low,
Vector legRight legUp
] | 123 | false | false | 0 | 7 | 36 | 41 | 20 | 21 | null | null |
brendanhay/gogol | gogol-partners/gen/Network/Google/Resource/Partners/Users/Get.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
ugUploadProtocol :: Lens' UsersGet (Maybe Text)
ugUploadProtocol
= lens _ugUploadProtocol
(\ s a -> s{_ugUploadProtocol = a}) | 195 | ugUploadProtocol :: Lens' UsersGet (Maybe Text)
ugUploadProtocol
= lens _ugUploadProtocol
(\ s a -> s{_ugUploadProtocol = a}) | 133 | ugUploadProtocol
= lens _ugUploadProtocol
(\ s a -> s{_ugUploadProtocol = a}) | 85 | true | true | 2 | 9 | 33 | 55 | 25 | 30 | null | null |
brendanhay/gogol | gogol-android-enterprise/gen/Network/Google/AndroidEnterprise/Types/Product.hs | mpl-2.0 | -- | The store layout type. By default, this value is set to \"basic\" if the
-- homepageId field is not set, and to \"custom\" otherwise. If set to
-- \"basic\", the layout will consist of all approved apps that have been
-- whitelisted for the user.
slStoreLayoutType :: Lens' StoreLayout (Maybe StoreLayoutStoreLayoutType)
slStoreLayoutType
= lens _slStoreLayoutType
(\ s a -> s{_slStoreLayoutType = a}) | 414 | slStoreLayoutType :: Lens' StoreLayout (Maybe StoreLayoutStoreLayoutType)
slStoreLayoutType
= lens _slStoreLayoutType
(\ s a -> s{_slStoreLayoutType = a}) | 162 | slStoreLayoutType
= lens _slStoreLayoutType
(\ s a -> s{_slStoreLayoutType = a}) | 88 | true | true | 0 | 8 | 71 | 52 | 28 | 24 | null | null |
spacekitteh/smcghc | compiler/main/DynFlags.hs | bsd-3-clause | supportedLanguagesAndExtensions :: [String]
supportedLanguagesAndExtensions =
supportedLanguages ++ supportedLanguageOverlays ++ supportedExtensions | 152 | supportedLanguagesAndExtensions :: [String]
supportedLanguagesAndExtensions =
supportedLanguages ++ supportedLanguageOverlays ++ supportedExtensions | 152 | supportedLanguagesAndExtensions =
supportedLanguages ++ supportedLanguageOverlays ++ supportedExtensions | 108 | false | true | 0 | 6 | 13 | 22 | 12 | 10 | null | null |
MichJP/hplar-hs | src/Lib.hs | bsd-3-clause | constFalse :: Parser Formula
constFalse = do
void (rword "False")
return (Constant False) | 93 | constFalse :: Parser Formula
constFalse = do
void (rword "False")
return (Constant False) | 93 | constFalse = do
void (rword "False")
return (Constant False) | 64 | false | true | 0 | 10 | 16 | 44 | 18 | 26 | null | null |
bgold-cosmos/Tidal | src/Sound/Tidal/Params.hs | gpl-3.0 | fromCountTo :: String -> Pattern Double -> Pattern ValueMap
fromCountTo name ipat = innerJoin $ (\i -> pStateF "from" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat | 162 | fromCountTo :: String -> Pattern Double -> Pattern ValueMap
fromCountTo name ipat = innerJoin $ (\i -> pStateF "from" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat | 162 | fromCountTo name ipat = innerJoin $ (\i -> pStateF "from" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat | 102 | false | true | 2 | 13 | 27 | 84 | 43 | 41 | null | null |
Lysxia/metamorph | src/Test/Metamorph/Pretty.hs | mit | prettyDetail :: Pretty 'Detail t => Names -> Int -> t -> ShowS
prettyDetail = prettyWith @'Detail | 97 | prettyDetail :: Pretty 'Detail t => Names -> Int -> t -> ShowS
prettyDetail = prettyWith @'Detail | 97 | prettyDetail = prettyWith @'Detail | 34 | false | true | 0 | 8 | 16 | 41 | 20 | 21 | null | null |
wdanilo/data-rtuple | src/Data/RTuple/Class.hs | apache-2.0 | last' = lens takeLast (\lst nlast -> unsafeCoerce# $ append nlast (takeInit lst)) | 81 | last' = lens takeLast (\lst nlast -> unsafeCoerce# $ append nlast (takeInit lst)) | 81 | last' = lens takeLast (\lst nlast -> unsafeCoerce# $ append nlast (takeInit lst)) | 81 | false | false | 1 | 11 | 12 | 39 | 18 | 21 | null | null |
alanz/Blobs | lib/DData/IntMap.hs | lgpl-2.1 | withBar bars = "| ":bars | 27 | withBar bars = "| ":bars | 27 | withBar bars = "| ":bars | 27 | false | false | 3 | 5 | 7 | 19 | 6 | 13 | null | null |
rahulmutt/ghcvm | compiler/Eta/BasicTypes/IdInfo.hs | bsd-3-clause | mayHaveCafRefs :: CafInfo -> Bool
mayHaveCafRefs MayHaveCafRefs = True | 71 | mayHaveCafRefs :: CafInfo -> Bool
mayHaveCafRefs MayHaveCafRefs = True | 71 | mayHaveCafRefs MayHaveCafRefs = True | 37 | false | true | 0 | 5 | 9 | 18 | 9 | 9 | null | null |
brendanhay/gogol | gogol-cloudtrace/gen/Network/Google/CloudTrace/Types/Product.hs | mpl-2.0 | -- | Required. The resource name of the span in the following format:
-- projects\/[PROJECT_ID]\/traces\/[TRACE_ID]\/spans\/SPAN_ID is a unique
-- identifier for a trace within a project; it is a 32-character
-- hexadecimal encoding of a 16-byte array. [SPAN_ID] is a unique
-- identifier for a span within a trace; it is a 16-character hexadecimal
-- encoding of an 8-byte array. It should not be zero.
sName :: Lens' Span (Maybe Text)
sName = lens _sName (\ s a -> s{_sName = a}) | 481 | sName :: Lens' Span (Maybe Text)
sName = lens _sName (\ s a -> s{_sName = a}) | 77 | sName = lens _sName (\ s a -> s{_sName = a}) | 44 | true | true | 1 | 9 | 81 | 55 | 30 | 25 | null | null |
rueshyna/gogol | gogol-mirror/gen/Network/Google/Mirror/Types/Product.hs | mpl-2.0 | -- | The ID of the item that generated the notification.
nItemId :: Lens' Notification (Maybe Text)
nItemId = lens _nItemId (\ s a -> s{_nItemId = a}) | 150 | nItemId :: Lens' Notification (Maybe Text)
nItemId = lens _nItemId (\ s a -> s{_nItemId = a}) | 93 | nItemId = lens _nItemId (\ s a -> s{_nItemId = a}) | 50 | true | true | 0 | 9 | 27 | 46 | 25 | 21 | null | null |
GaloisInc/halvm-ghc | compiler/main/DynFlags.hs | bsd-3-clause | -- | Parses the dynamically set flags for GHC. This is the most general form of
-- the dynamic flag parser that the other methods simply wrap. It allows
-- saying which flags are valid flags and indicating if we are parsing
-- arguments from the command line or from a file pragma.
parseDynamicFlagsFull :: MonadIO m
=> [Flag (CmdLineP DynFlags)] -- ^ valid flags to match against
-> Bool -- ^ are the arguments from the command line?
-> DynFlags -- ^ current dynamic flags
-> [Located String] -- ^ arguments to parse
-> m (DynFlags, [Located String], [Located String])
parseDynamicFlagsFull activeFlags cmdline dflags0 args = do
let ((leftover, errs, warns), dflags1)
= runCmdLine (processArgs activeFlags args) dflags0
-- See Note [Handling errors when parsing commandline flags]
unless (null errs) $ liftIO $ throwGhcExceptionIO $
errorsToGhcException . map (showPpr dflags0 . getLoc &&& unLoc) $ errs
-- check for disabled flags in safe haskell
let (dflags2, sh_warns) = safeFlagCheck cmdline dflags1
dflags3 = updateWays dflags2
theWays = ways dflags3
unless (allowed_combination theWays) $ liftIO $
throwGhcExceptionIO (CmdLineError ("combination not supported: " ++
intercalate "/" (map wayDesc theWays)))
let chooseOutput
| isJust (outputFile dflags3) -- Only iff user specified -o ...
, not (isJust (dynOutputFile dflags3)) -- but not -dyno
= return $ dflags3 { dynOutputFile = Just $ dynOut (fromJust $ outputFile dflags3) }
| otherwise
= return dflags3
where
dynOut = flip addExtension (dynObjectSuf dflags3) . dropExtension
dflags4 <- ifGeneratingDynamicToo dflags3 chooseOutput (return dflags3)
let (dflags5, consistency_warnings) = makeDynFlagsConsistent dflags4
dflags6 <- case dllSplitFile dflags5 of
Nothing -> return (dflags5 { dllSplit = Nothing })
Just f ->
case dllSplit dflags5 of
Just _ ->
-- If dllSplit is out of date then it would have
-- been set to Nothing. As it's a Just, it must be
-- up-to-date.
return dflags5
Nothing ->
do xs <- liftIO $ readFile f
let ss = map (Set.fromList . words) (lines xs)
return $ dflags5 { dllSplit = Just ss }
-- Set timer stats & heap size
when (enableTimeStats dflags6) $ liftIO enableTimingStats
case (ghcHeapSize dflags6) of
Just x -> liftIO (setHeapSize x)
_ -> return ()
liftIO $ setUnsafeGlobalDynFlags dflags6
return (dflags6, leftover, consistency_warnings ++ sh_warns ++ warns) | 2,913 | parseDynamicFlagsFull :: MonadIO m
=> [Flag (CmdLineP DynFlags)] -- ^ valid flags to match against
-> Bool -- ^ are the arguments from the command line?
-> DynFlags -- ^ current dynamic flags
-> [Located String] -- ^ arguments to parse
-> m (DynFlags, [Located String], [Located String])
parseDynamicFlagsFull activeFlags cmdline dflags0 args = do
let ((leftover, errs, warns), dflags1)
= runCmdLine (processArgs activeFlags args) dflags0
-- See Note [Handling errors when parsing commandline flags]
unless (null errs) $ liftIO $ throwGhcExceptionIO $
errorsToGhcException . map (showPpr dflags0 . getLoc &&& unLoc) $ errs
-- check for disabled flags in safe haskell
let (dflags2, sh_warns) = safeFlagCheck cmdline dflags1
dflags3 = updateWays dflags2
theWays = ways dflags3
unless (allowed_combination theWays) $ liftIO $
throwGhcExceptionIO (CmdLineError ("combination not supported: " ++
intercalate "/" (map wayDesc theWays)))
let chooseOutput
| isJust (outputFile dflags3) -- Only iff user specified -o ...
, not (isJust (dynOutputFile dflags3)) -- but not -dyno
= return $ dflags3 { dynOutputFile = Just $ dynOut (fromJust $ outputFile dflags3) }
| otherwise
= return dflags3
where
dynOut = flip addExtension (dynObjectSuf dflags3) . dropExtension
dflags4 <- ifGeneratingDynamicToo dflags3 chooseOutput (return dflags3)
let (dflags5, consistency_warnings) = makeDynFlagsConsistent dflags4
dflags6 <- case dllSplitFile dflags5 of
Nothing -> return (dflags5 { dllSplit = Nothing })
Just f ->
case dllSplit dflags5 of
Just _ ->
-- If dllSplit is out of date then it would have
-- been set to Nothing. As it's a Just, it must be
-- up-to-date.
return dflags5
Nothing ->
do xs <- liftIO $ readFile f
let ss = map (Set.fromList . words) (lines xs)
return $ dflags5 { dllSplit = Just ss }
-- Set timer stats & heap size
when (enableTimeStats dflags6) $ liftIO enableTimingStats
case (ghcHeapSize dflags6) of
Just x -> liftIO (setHeapSize x)
_ -> return ()
liftIO $ setUnsafeGlobalDynFlags dflags6
return (dflags6, leftover, consistency_warnings ++ sh_warns ++ warns) | 2,631 | parseDynamicFlagsFull activeFlags cmdline dflags0 args = do
let ((leftover, errs, warns), dflags1)
= runCmdLine (processArgs activeFlags args) dflags0
-- See Note [Handling errors when parsing commandline flags]
unless (null errs) $ liftIO $ throwGhcExceptionIO $
errorsToGhcException . map (showPpr dflags0 . getLoc &&& unLoc) $ errs
-- check for disabled flags in safe haskell
let (dflags2, sh_warns) = safeFlagCheck cmdline dflags1
dflags3 = updateWays dflags2
theWays = ways dflags3
unless (allowed_combination theWays) $ liftIO $
throwGhcExceptionIO (CmdLineError ("combination not supported: " ++
intercalate "/" (map wayDesc theWays)))
let chooseOutput
| isJust (outputFile dflags3) -- Only iff user specified -o ...
, not (isJust (dynOutputFile dflags3)) -- but not -dyno
= return $ dflags3 { dynOutputFile = Just $ dynOut (fromJust $ outputFile dflags3) }
| otherwise
= return dflags3
where
dynOut = flip addExtension (dynObjectSuf dflags3) . dropExtension
dflags4 <- ifGeneratingDynamicToo dflags3 chooseOutput (return dflags3)
let (dflags5, consistency_warnings) = makeDynFlagsConsistent dflags4
dflags6 <- case dllSplitFile dflags5 of
Nothing -> return (dflags5 { dllSplit = Nothing })
Just f ->
case dllSplit dflags5 of
Just _ ->
-- If dllSplit is out of date then it would have
-- been set to Nothing. As it's a Just, it must be
-- up-to-date.
return dflags5
Nothing ->
do xs <- liftIO $ readFile f
let ss = map (Set.fromList . words) (lines xs)
return $ dflags5 { dllSplit = Just ss }
-- Set timer stats & heap size
when (enableTimeStats dflags6) $ liftIO enableTimingStats
case (ghcHeapSize dflags6) of
Just x -> liftIO (setHeapSize x)
_ -> return ()
liftIO $ setUnsafeGlobalDynFlags dflags6
return (dflags6, leftover, consistency_warnings ++ sh_warns ++ warns) | 2,191 | true | true | 0 | 22 | 935 | 643 | 315 | 328 | null | null |
DanielWaterworth/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | tcname (SN (MethodN _)) = True | 30 | tcname (SN (MethodN _)) = True | 30 | tcname (SN (MethodN _)) = True | 30 | false | false | 0 | 9 | 5 | 21 | 10 | 11 | null | null |
eddywestbrook/hobbits | archival/Term.hs | bsd-3-clause | ex4 = subst test1 test2 | 23 | ex4 = subst test1 test2 | 23 | ex4 = subst test1 test2 | 23 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
AccelerateHS/accelerate-cuda | Data/Array/Accelerate/CUDA/Foreign/Export.hs | bsd-3-clause | -- |Releases all resources used by the accelerate library.
--
-- @void accelerateDestroy(AccHandle hndl);@
accelerateDestroy :: AccHandle -> IO ()
accelerateDestroy = freeStablePtr | 180 | accelerateDestroy :: AccHandle -> IO ()
accelerateDestroy = freeStablePtr | 73 | accelerateDestroy = freeStablePtr | 33 | true | true | 0 | 7 | 22 | 23 | 13 | 10 | null | null |
miie/bkr | src/System/Bkr/TargetServices/S3/BkrAws.hs | bsd-3-clause | main :: IO ()
main = do
-- Set up AWS credentials and the default configuration.
--cfg <- baseConfiguration'
--let cfg = baseConfiguration''
let cfg = getS3Config
-- Create an IORef to store the response Metadata (so it is also available in case of an error).
metadataRef <- newIORef mempty
-- Create a request object with S3.getObject and run the request with simpleAwsRef.
--Aws.simpleAwsRef cfg metadataRef $ S3.getObject "haskell-aws" "cloud-remote.pdf" saveObject
--Aws.simpleAwsRef cfg metadataRef $ S3.getObject "ms-bkr" "_DSC2283.NEF" saveObject
bucket <- Aws.simpleAwsRef cfg metadataRef $ S3.getBucket "ms-bkr"
print $ show bucket
-- Print the response metadata.
print =<< readIORef metadataRef
{-
getCredentials :: Credentials
getCredentials = Credentials (B.pack "AKIAJNREVFV4JQNNNQRQ") (B.pack "dqQmkG7q4TwJemnEoqVeSppTuOcMp6RoBRZCpibp")
baseConfiguration' :: IO Configuration
baseConfiguration' = do
--let cr = getCredentials
let cr = Credentials (B.pack "AKIAJNREVFV4JQNNNQRQ") (B.pack "dqQmkG7q4TwJemnEoqVeSppTuOcMp6RoBRZCpibp")
return Configuration {
timeInfo = Timestamp
, credentials = cr
, sdbInfo = sdbHttpsPost sdbUsEast
, sdbInfoUri = sdbHttpsGet sdbUsEast
, s3Info = s3 HTTP s3EndpointUsClassic False
, s3InfoUri = s3 HTTP s3EndpointUsClassic True
, sqsInfo = sqs HTTP sqsEndpointUsClassic False
, sqsInfoUri = sqs HTTP sqsEndpointUsClassic True
, sesInfo = sesHttpsPost sesUsEast
, sesInfoUri = sesHttpsGet sesUsEast
, logger = defaultLog Warning
}
baseConfiguration'' :: Configuration
baseConfiguration'' = do
--let cr = getCredentials
let cr = Credentials (B.pack "AKIAJNREVFV4JQNNNQRQ") (B.pack "dqQmkG7q4TwJemnEoqVeSppTuOcMp6RoBRZCpibp")
Configuration { timeInfo = Timestamp
, credentials = cr
, sdbInfo = sdbHttpsPost sdbUsEast
, sdbInfoUri = sdbHttpsGet sdbUsEast
, s3Info = s3 HTTP s3EndpointUsClassic False
, s3InfoUri = s3 HTTP s3EndpointUsClassic True
, sqsInfo = sqs HTTP sqsEndpointUsClassic False
, sqsInfoUri = sqs HTTP sqsEndpointUsClassic True
, sesInfo = sesHttpsPost sesUsEast
, sesInfoUri = sesHttpsGet sesUsEast
, logger = defaultLog Warning
}
-} | 2,553 | main :: IO ()
main = do
-- Set up AWS credentials and the default configuration.
--cfg <- baseConfiguration'
--let cfg = baseConfiguration''
let cfg = getS3Config
-- Create an IORef to store the response Metadata (so it is also available in case of an error).
metadataRef <- newIORef mempty
-- Create a request object with S3.getObject and run the request with simpleAwsRef.
--Aws.simpleAwsRef cfg metadataRef $ S3.getObject "haskell-aws" "cloud-remote.pdf" saveObject
--Aws.simpleAwsRef cfg metadataRef $ S3.getObject "ms-bkr" "_DSC2283.NEF" saveObject
bucket <- Aws.simpleAwsRef cfg metadataRef $ S3.getBucket "ms-bkr"
print $ show bucket
-- Print the response metadata.
print =<< readIORef metadataRef
{-
getCredentials :: Credentials
getCredentials = Credentials (B.pack "AKIAJNREVFV4JQNNNQRQ") (B.pack "dqQmkG7q4TwJemnEoqVeSppTuOcMp6RoBRZCpibp")
baseConfiguration' :: IO Configuration
baseConfiguration' = do
--let cr = getCredentials
let cr = Credentials (B.pack "AKIAJNREVFV4JQNNNQRQ") (B.pack "dqQmkG7q4TwJemnEoqVeSppTuOcMp6RoBRZCpibp")
return Configuration {
timeInfo = Timestamp
, credentials = cr
, sdbInfo = sdbHttpsPost sdbUsEast
, sdbInfoUri = sdbHttpsGet sdbUsEast
, s3Info = s3 HTTP s3EndpointUsClassic False
, s3InfoUri = s3 HTTP s3EndpointUsClassic True
, sqsInfo = sqs HTTP sqsEndpointUsClassic False
, sqsInfoUri = sqs HTTP sqsEndpointUsClassic True
, sesInfo = sesHttpsPost sesUsEast
, sesInfoUri = sesHttpsGet sesUsEast
, logger = defaultLog Warning
}
baseConfiguration'' :: Configuration
baseConfiguration'' = do
--let cr = getCredentials
let cr = Credentials (B.pack "AKIAJNREVFV4JQNNNQRQ") (B.pack "dqQmkG7q4TwJemnEoqVeSppTuOcMp6RoBRZCpibp")
Configuration { timeInfo = Timestamp
, credentials = cr
, sdbInfo = sdbHttpsPost sdbUsEast
, sdbInfoUri = sdbHttpsGet sdbUsEast
, s3Info = s3 HTTP s3EndpointUsClassic False
, s3InfoUri = s3 HTTP s3EndpointUsClassic True
, sqsInfo = sqs HTTP sqsEndpointUsClassic False
, sqsInfoUri = sqs HTTP sqsEndpointUsClassic True
, sesInfo = sesHttpsPost sesUsEast
, sesInfoUri = sesHttpsGet sesUsEast
, logger = defaultLog Warning
}
-} | 2,553 | main = do
-- Set up AWS credentials and the default configuration.
--cfg <- baseConfiguration'
--let cfg = baseConfiguration''
let cfg = getS3Config
-- Create an IORef to store the response Metadata (so it is also available in case of an error).
metadataRef <- newIORef mempty
-- Create a request object with S3.getObject and run the request with simpleAwsRef.
--Aws.simpleAwsRef cfg metadataRef $ S3.getObject "haskell-aws" "cloud-remote.pdf" saveObject
--Aws.simpleAwsRef cfg metadataRef $ S3.getObject "ms-bkr" "_DSC2283.NEF" saveObject
bucket <- Aws.simpleAwsRef cfg metadataRef $ S3.getBucket "ms-bkr"
print $ show bucket
-- Print the response metadata.
print =<< readIORef metadataRef
{-
getCredentials :: Credentials
getCredentials = Credentials (B.pack "AKIAJNREVFV4JQNNNQRQ") (B.pack "dqQmkG7q4TwJemnEoqVeSppTuOcMp6RoBRZCpibp")
baseConfiguration' :: IO Configuration
baseConfiguration' = do
--let cr = getCredentials
let cr = Credentials (B.pack "AKIAJNREVFV4JQNNNQRQ") (B.pack "dqQmkG7q4TwJemnEoqVeSppTuOcMp6RoBRZCpibp")
return Configuration {
timeInfo = Timestamp
, credentials = cr
, sdbInfo = sdbHttpsPost sdbUsEast
, sdbInfoUri = sdbHttpsGet sdbUsEast
, s3Info = s3 HTTP s3EndpointUsClassic False
, s3InfoUri = s3 HTTP s3EndpointUsClassic True
, sqsInfo = sqs HTTP sqsEndpointUsClassic False
, sqsInfoUri = sqs HTTP sqsEndpointUsClassic True
, sesInfo = sesHttpsPost sesUsEast
, sesInfoUri = sesHttpsGet sesUsEast
, logger = defaultLog Warning
}
baseConfiguration'' :: Configuration
baseConfiguration'' = do
--let cr = getCredentials
let cr = Credentials (B.pack "AKIAJNREVFV4JQNNNQRQ") (B.pack "dqQmkG7q4TwJemnEoqVeSppTuOcMp6RoBRZCpibp")
Configuration { timeInfo = Timestamp
, credentials = cr
, sdbInfo = sdbHttpsPost sdbUsEast
, sdbInfoUri = sdbHttpsGet sdbUsEast
, s3Info = s3 HTTP s3EndpointUsClassic False
, s3InfoUri = s3 HTTP s3EndpointUsClassic True
, sqsInfo = sqs HTTP sqsEndpointUsClassic False
, sqsInfoUri = sqs HTTP sqsEndpointUsClassic True
, sesInfo = sesHttpsPost sesUsEast
, sesInfoUri = sesHttpsGet sesUsEast
, logger = defaultLog Warning
}
-} | 2,539 | false | true | 0 | 11 | 737 | 93 | 44 | 49 | null | null |
mpickering/ghc-exactprint | tests/examples/ghc710/RecursiveDo.hs | bsd-3-clause | budget :: String -> IO Int
budget "Ada" = return 10 | 56 | budget :: String -> IO Int
budget "Ada" = return 10 | 56 | budget "Ada" = return 10 | 29 | false | true | 0 | 6 | 15 | 24 | 11 | 13 | null | null |
mattias-lundell/timber-llvm | src/Scp.hs | bsd-3-clause | dive (ECase cond legs) = cond:altRhss legs | 42 | dive (ECase cond legs) = cond:altRhss legs | 42 | dive (ECase cond legs) = cond:altRhss legs | 42 | false | false | 0 | 7 | 6 | 24 | 11 | 13 | null | null |
michaxm/haskell-hdfs-thrift-client | src/System/HDFS/HDFSClient.hs | bsd-3-clause | {-|
Get the data locations for a file
- throws an exception if path does not point at a regular file.
|-}
hdfsFileBlockLocations :: Config -> Path -> IO [Types.BlockLocation]
hdfsFileBlockLocations config path =
forRegularFilePath config path $ \thriftPath fileSize ->
withThriftChannelsForRead config (
\channels -> C.getFileBlockLocations channels thriftPath 0 fileSize >>= return . toList) | 407 | hdfsFileBlockLocations :: Config -> Path -> IO [Types.BlockLocation]
hdfsFileBlockLocations config path =
forRegularFilePath config path $ \thriftPath fileSize ->
withThriftChannelsForRead config (
\channels -> C.getFileBlockLocations channels thriftPath 0 fileSize >>= return . toList) | 298 | hdfsFileBlockLocations config path =
forRegularFilePath config path $ \thriftPath fileSize ->
withThriftChannelsForRead config (
\channels -> C.getFileBlockLocations channels thriftPath 0 fileSize >>= return . toList) | 229 | true | true | 0 | 13 | 69 | 81 | 41 | 40 | null | null |
zeekay/lambdabot | Plugin/Free/Theorem.hs | mit | peepholeSimplifyExpr :: Expr -> Expr
peepholeSimplifyExpr
= peepholeSimplifyExpr' . applySimplifierExpr peepholeSimplifyExpr | 130 | peepholeSimplifyExpr :: Expr -> Expr
peepholeSimplifyExpr
= peepholeSimplifyExpr' . applySimplifierExpr peepholeSimplifyExpr | 129 | peepholeSimplifyExpr
= peepholeSimplifyExpr' . applySimplifierExpr peepholeSimplifyExpr | 92 | false | true | 0 | 7 | 16 | 25 | 11 | 14 | null | null |
k-bx/snap-server | src/Snap/Internal/Http/Server/Config.hs | bsd-3-clause | -- | A MonadSnap action to handle 500 errors
getErrorHandler :: Config m a -> Maybe (SomeException -> m ())
getErrorHandler = errorHandler | 140 | getErrorHandler :: Config m a -> Maybe (SomeException -> m ())
getErrorHandler = errorHandler | 95 | getErrorHandler = errorHandler | 30 | true | true | 0 | 10 | 24 | 36 | 18 | 18 | null | null |
alexkalderimis/mathbot | src/WordProblem.hs | mit | -- , (" cubed", UnaryOp (pow 3))] Whoops, not actually needed
prefixOps :: M.Map String UnaryFn
prefixOps = M.fromList
[ ("twice", (* 2))
, ("half", (`div` 2))
, ("the square of", (pow 2))
, ("the cube of", (pow 3))
, ("negative", negate)] | 260 | prefixOps :: M.Map String UnaryFn
prefixOps = M.fromList
[ ("twice", (* 2))
, ("half", (`div` 2))
, ("the square of", (pow 2))
, ("the cube of", (pow 3))
, ("negative", negate)] | 197 | prefixOps = M.fromList
[ ("twice", (* 2))
, ("half", (`div` 2))
, ("the square of", (pow 2))
, ("the cube of", (pow 3))
, ("negative", negate)] | 163 | true | true | 1 | 9 | 62 | 95 | 56 | 39 | null | null |
DavidAlphaFox/darcs | src/Darcs/Patch/Match.hs | gpl-2.0 | applyInvToMatcher ioe m (PatchSet NilRL (Tagged t _ ps :<: ts)) = applyInvToMatcher ioe m
(PatchSet (t:<:ps) ts) | 178 | applyInvToMatcher ioe m (PatchSet NilRL (Tagged t _ ps :<: ts)) = applyInvToMatcher ioe m
(PatchSet (t:<:ps) ts) | 178 | applyInvToMatcher ioe m (PatchSet NilRL (Tagged t _ ps :<: ts)) = applyInvToMatcher ioe m
(PatchSet (t:<:ps) ts) | 178 | false | false | 0 | 10 | 83 | 57 | 28 | 29 | null | null |
iemxblog/hpcb | src/Hpcb/Component/OpAmp.hs | mit | -- | LM358N op-amp
lm358n :: String
-> Circuit
lm358n ref = soic_8 ref "LM358N" # names ref [
(1, ["OUTA"]),
(2, ["-INA"]),
(3, ["+INA"]),
(4, ["GND", "V-"]),
(5, ["+INB"]),
(6, ["-INB"]),
(7, ["OUTB"]),
(8, ["V+"])
] | 261 | lm358n :: String
-> Circuit
lm358n ref = soic_8 ref "LM358N" # names ref [
(1, ["OUTA"]),
(2, ["-INA"]),
(3, ["+INA"]),
(4, ["GND", "V-"]),
(5, ["+INB"]),
(6, ["-INB"]),
(7, ["OUTB"]),
(8, ["V+"])
] | 242 | lm358n ref = soic_8 ref "LM358N" # names ref [
(1, ["OUTA"]),
(2, ["-INA"]),
(3, ["+INA"]),
(4, ["GND", "V-"]),
(5, ["+INB"]),
(6, ["-INB"]),
(7, ["OUTB"]),
(8, ["V+"])
] | 204 | true | true | 0 | 9 | 80 | 132 | 82 | 50 | null | null |
lloydmeta/ip-parsing-hs | src/Data/IpAddress/Internal.hs | mit | ipv6NormedToIPAddress6 :: IPV6Normed -> IPAddress6
ipv6NormedToIPAddress6 (IPV6Normed str) = IPAddress6 quotient remainder
where
asSegs = split ':' str
zippedWithExp = zip (reverse asSegs) twoRaised16Exp
asInteger = foldr (\(s, exp) acc -> hexToDec s * exp + acc) 0 zippedWithExp
(q, r) = quotRem asInteger word64Max
quotient = fromIntegral q
remainder = fromIntegral r | 395 | ipv6NormedToIPAddress6 :: IPV6Normed -> IPAddress6
ipv6NormedToIPAddress6 (IPV6Normed str) = IPAddress6 quotient remainder
where
asSegs = split ':' str
zippedWithExp = zip (reverse asSegs) twoRaised16Exp
asInteger = foldr (\(s, exp) acc -> hexToDec s * exp + acc) 0 zippedWithExp
(q, r) = quotRem asInteger word64Max
quotient = fromIntegral q
remainder = fromIntegral r | 395 | ipv6NormedToIPAddress6 (IPV6Normed str) = IPAddress6 quotient remainder
where
asSegs = split ':' str
zippedWithExp = zip (reverse asSegs) twoRaised16Exp
asInteger = foldr (\(s, exp) acc -> hexToDec s * exp + acc) 0 zippedWithExp
(q, r) = quotRem asInteger word64Max
quotient = fromIntegral q
remainder = fromIntegral r | 344 | false | true | 5 | 10 | 78 | 155 | 67 | 88 | null | null |
IreneKnapp/Faction | libfaction/Distribution/Compat/Filesystem/Portable.hs | bsd-3-clause | pathIsAbsolute :: FilePath -> Bool
pathIsAbsolute "" = False | 60 | pathIsAbsolute :: FilePath -> Bool
pathIsAbsolute "" = False | 60 | pathIsAbsolute "" = False | 25 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
atommed/OP_repo | courses/prog_base_2/labs/lab4/HttpHelpers.hs | gpl-3.0 | pageNotFound::Handle->IO ()
pageNotFound hdl = do
C.hPutStr hdl $ createResponse "HTTP/1.1 404 Page Not Found" [] "404!"
hClose hdl | 135 | pageNotFound::Handle->IO ()
pageNotFound hdl = do
C.hPutStr hdl $ createResponse "HTTP/1.1 404 Page Not Found" [] "404!"
hClose hdl | 135 | pageNotFound hdl = do
C.hPutStr hdl $ createResponse "HTTP/1.1 404 Page Not Found" [] "404!"
hClose hdl | 107 | false | true | 0 | 10 | 22 | 56 | 23 | 33 | null | null |
berdario/jira2sheet | test/Spec.hs | bsd-3-clause | hardcodedPassword = "PASSWORD" | 30 | hardcodedPassword = "PASSWORD" | 30 | hardcodedPassword = "PASSWORD" | 30 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
Paow/encore | src/front/ModuleExpander.hs | bsd-3-clause | addStdLib source Module{modname} imports =
filter ((/= explicitNamespace [modname]) . itarget) (stdLib source) ++ imports | 123 | addStdLib source Module{modname} imports =
filter ((/= explicitNamespace [modname]) . itarget) (stdLib source) ++ imports | 123 | addStdLib source Module{modname} imports =
filter ((/= explicitNamespace [modname]) . itarget) (stdLib source) ++ imports | 123 | false | false | 0 | 11 | 16 | 51 | 26 | 25 | null | null |
openbrainsrc/makeci | Views.hs | mit | jobQRow (Job _ hash commit start mdone status out) =
tr ! A.class_ "warning" $ do
td $ ""
td $ ""
td $ showDateAndTime start
td $ toHtml hash
td $ toHtml commit
td $ toHtml status | 309 | jobQRow (Job _ hash commit start mdone status out) =
tr ! A.class_ "warning" $ do
td $ ""
td $ ""
td $ showDateAndTime start
td $ toHtml hash
td $ toHtml commit
td $ toHtml status | 309 | jobQRow (Job _ hash commit start mdone status out) =
tr ! A.class_ "warning" $ do
td $ ""
td $ ""
td $ showDateAndTime start
td $ toHtml hash
td $ toHtml commit
td $ toHtml status | 309 | false | false | 2 | 10 | 167 | 96 | 41 | 55 | null | null |
vTurbine/ghc | ghc/Main.hs | bsd-3-clause | showNumVersionMode = mkPreStartupMode ShowNumVersion | 61 | showNumVersionMode = mkPreStartupMode ShowNumVersion | 61 | showNumVersionMode = mkPreStartupMode ShowNumVersion | 61 | false | false | 0 | 5 | 12 | 9 | 4 | 5 | null | null |
bitemyapp/roshask | src/Ros/Internal/Util/BytesToVector.hs | bsd-3-clause | -- |Construct a 'V.Vector' with the specified number of elements from
-- a lazy 'BL.ByteString'.
bytesToVectorL :: V.Storable a => Int -> BL.ByteString -> V.Vector a
bytesToVectorL n = bytesToVector n . BS.concat . BL.toChunks | 226 | bytesToVectorL :: V.Storable a => Int -> BL.ByteString -> V.Vector a
bytesToVectorL n = bytesToVector n . BS.concat . BL.toChunks | 129 | bytesToVectorL n = bytesToVector n . BS.concat . BL.toChunks | 60 | true | true | 0 | 10 | 34 | 60 | 28 | 32 | null | null |
egison/egison | hs-src/Language/Egison/Tensor.hs | mit | tShape :: Tensor a -> Shape
tShape (Tensor ns _ _) = ns | 55 | tShape :: Tensor a -> Shape
tShape (Tensor ns _ _) = ns | 55 | tShape (Tensor ns _ _) = ns | 27 | false | true | 0 | 7 | 12 | 31 | 15 | 16 | null | null |
tittoassini/flat | test/Spec.hs | bsd-3-clause | ns :: [(Word64, Int)]
ns = [((-) (2 ^ (i * 7)) 1, fromIntegral (8 * i)) | i <- [1 .. 10]] | 89 | ns :: [(Word64, Int)]
ns = [((-) (2 ^ (i * 7)) 1, fromIntegral (8 * i)) | i <- [1 .. 10]] | 89 | ns = [((-) (2 ^ (i * 7)) 1, fromIntegral (8 * i)) | i <- [1 .. 10]] | 67 | false | true | 0 | 12 | 22 | 81 | 44 | 37 | null | null |
icyfork/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkTr2 = verify checkTr "tr 'a-z' 'A-Z'" | 47 | prop_checkTr2 = verify checkTr "tr 'a-z' 'A-Z'" | 47 | prop_checkTr2 = verify checkTr "tr 'a-z' 'A-Z'" | 47 | false | false | 1 | 5 | 6 | 15 | 5 | 10 | null | null |
pittsburgh-haskell/haskell-intro-session | src/Tutorial.hs | bsd-3-clause | --
-- List map and filter
--
-- | Using 'map' of type
-- @
-- (input -> output) -> ([input] -> [output])
-- @
--
-- Use a library function from
-- <http://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Char.html
-- 'Data.Char'>
--
-- Remember that 'String' abbreviates @[Char]@
--
-- >>> allCaps "Franklin"
-- "FRANKLIN"
allCaps :: String -> String
allCaps s = map Char.toUpper s | 398 | allCaps :: String -> String
allCaps s = map Char.toUpper s | 58 | allCaps s = map Char.toUpper s | 30 | true | true | 0 | 7 | 75 | 47 | 29 | 18 | null | null |
balangs/eTeak | src/BalsaParser.hs | bsd-3-clause | actualToProcActual (TypeActual typ) = TypeProcActual typ | 56 | actualToProcActual (TypeActual typ) = TypeProcActual typ | 56 | actualToProcActual (TypeActual typ) = TypeProcActual typ | 56 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
ygale/yesod | yesod-form/Yesod/Form/I18n/Swedish.hs | mit | swedishFormMessage :: FormMessage -> Text
swedishFormMessage (MsgInvalidInteger t) = "Ogiltigt antal: " `mappend` t | 115 | swedishFormMessage :: FormMessage -> Text
swedishFormMessage (MsgInvalidInteger t) = "Ogiltigt antal: " `mappend` t | 115 | swedishFormMessage (MsgInvalidInteger t) = "Ogiltigt antal: " `mappend` t | 73 | false | true | 0 | 7 | 13 | 30 | 16 | 14 | null | null |
jystic/river | src/River/Source/Concrete/Parser.hs | bsd-3-clause | pBraces :: RiverParser s m => m a -> m a
pBraces =
between (pSymbol "{") (pSymbol "}") | 88 | pBraces :: RiverParser s m => m a -> m a
pBraces =
between (pSymbol "{") (pSymbol "}") | 88 | pBraces =
between (pSymbol "{") (pSymbol "}") | 47 | false | true | 0 | 8 | 19 | 53 | 23 | 30 | null | null |
CloudI/CloudI | src/api/haskell/external/binary-0.8.7.0/src/Data/Binary/Get/Internal.hs | mit | getBytes :: Int -> Get B.ByteString
getBytes = getByteString | 60 | getBytes :: Int -> Get B.ByteString
getBytes = getByteString | 60 | getBytes = getByteString | 24 | false | true | 0 | 8 | 8 | 26 | 11 | 15 | null | null |
tchagnon/cs636-raytracer | a4/scene1.hs | apache-2.0 | light0 =
PointLight {
color = 0.5 `svMul` white,
position = vec3f 4 4 9
} | 97 | light0 =
PointLight {
color = 0.5 `svMul` white,
position = vec3f 4 4 9
} | 97 | light0 =
PointLight {
color = 0.5 `svMul` white,
position = vec3f 4 4 9
} | 97 | false | false | 0 | 7 | 39 | 33 | 19 | 14 | null | null |
brendanhay/gogol | gogol-adexchange-buyer/gen/Network/Google/Resource/AdExchangeBuyer/PerformanceReport/List.hs | mpl-2.0 | -- | The account id to get the reports.
prlAccountId :: Lens' PerformanceReportList' Int64
prlAccountId
= lens _prlAccountId (\ s a -> s{_prlAccountId = a})
. _Coerce | 174 | prlAccountId :: Lens' PerformanceReportList' Int64
prlAccountId
= lens _prlAccountId (\ s a -> s{_prlAccountId = a})
. _Coerce | 134 | prlAccountId
= lens _prlAccountId (\ s a -> s{_prlAccountId = a})
. _Coerce | 83 | true | true | 0 | 10 | 34 | 46 | 24 | 22 | null | null |
mwerbos/2048haskell | main.hs | mit | -- Takes x-offset and draws the tile background
-- maybe unroll this into drawTile?
tileBackColor = makeColor8 205 192 180 255 | 126 | tileBackColor = makeColor8 205 192 180 255 | 42 | tileBackColor = makeColor8 205 192 180 255 | 42 | true | false | 1 | 5 | 20 | 20 | 9 | 11 | null | null |
hvr/cassava | src/Data/Csv/Conversion/Internal.hs | bsd-3-clause | expts10 :: Array Int Integer
expts10 = array (minExpt,maxExpt10) [(n,10^n) | n <- [minExpt .. maxExpt10]] | 105 | expts10 :: Array Int Integer
expts10 = array (minExpt,maxExpt10) [(n,10^n) | n <- [minExpt .. maxExpt10]] | 105 | expts10 = array (minExpt,maxExpt10) [(n,10^n) | n <- [minExpt .. maxExpt10]] | 76 | false | true | 0 | 9 | 15 | 54 | 30 | 24 | null | null |
beni55/haste-compiler | libraries/ghc-7.8/base/System/IO/Error.hs | bsd-3-clause | annotateIOError (NHC.IOError msg file hdl code) msg' hdl' file' =
NHC.IOError (msg++'\n':msg') (file`mplus`file') (hdl`mplus`hdl') code | 139 | annotateIOError (NHC.IOError msg file hdl code) msg' hdl' file' =
NHC.IOError (msg++'\n':msg') (file`mplus`file') (hdl`mplus`hdl') code | 139 | annotateIOError (NHC.IOError msg file hdl code) msg' hdl' file' =
NHC.IOError (msg++'\n':msg') (file`mplus`file') (hdl`mplus`hdl') code | 139 | false | false | 1 | 8 | 18 | 71 | 35 | 36 | null | null |
bjpop/blip | bliplib/src/Blip/Bytecode.hs | bsd-3-clause | opcodeToWord8 :: Map.Map Opcode Word8
opcodeToWord8 = Map.fromList opcodeList | 77 | opcodeToWord8 :: Map.Map Opcode Word8
opcodeToWord8 = Map.fromList opcodeList | 77 | opcodeToWord8 = Map.fromList opcodeList | 39 | false | true | 1 | 6 | 8 | 26 | 11 | 15 | null | null |
mzini/TcT | source/Tct/Method/Combinator.hs | gpl-3.0 | iteProgress :: (T.Transformer g, P.Processor t, P.Processor e) =>
T.TheTransformer g
-> P.InstanceOf t
-> P.InstanceOf e
-> S.ProcessorInstance (IteProgress g t e)
iteProgress g t e = S.StdProcessor (IteProgress g) `S.withArgs` (t :+: e :+: False) | 304 | iteProgress :: (T.Transformer g, P.Processor t, P.Processor e) =>
T.TheTransformer g
-> P.InstanceOf t
-> P.InstanceOf e
-> S.ProcessorInstance (IteProgress g t e)
iteProgress g t e = S.StdProcessor (IteProgress g) `S.withArgs` (t :+: e :+: False) | 304 | iteProgress g t e = S.StdProcessor (IteProgress g) `S.withArgs` (t :+: e :+: False) | 83 | false | true | 0 | 11 | 93 | 117 | 58 | 59 | null | null |
lukemaurer/sequent-core | src/Language/SequentCore/Annot.hs | bsd-3-clause | bindersOfAnnBind :: AnnBind b a -> [b]
bindersOfAnnBind bind = binderOfAnnPair <$> flattenAnnBind bind | 102 | bindersOfAnnBind :: AnnBind b a -> [b]
bindersOfAnnBind bind = binderOfAnnPair <$> flattenAnnBind bind | 102 | bindersOfAnnBind bind = binderOfAnnPair <$> flattenAnnBind bind | 63 | false | true | 0 | 6 | 13 | 33 | 16 | 17 | null | null |
mpickering/HaRe | src/Language/Haskell/Refact/Refactoring/Simple.hs | bsd-3-clause | -- ---------------------------------------------------------------------
-- | Convert an if expression to a case expression
removeBracket :: RefactSettings -> Options -> FilePath -> SimpPos -> SimpPos -> IO [FilePath]
removeBracket settings opts fileName beginPos endPos =
let applied = (:[]) . fst <$> applyRefac
(removeBracketTransform fileName beginPos endPos)
(RSFile fileName) in
runRefacSession settings opts [Left fileName] applied | 479 | removeBracket :: RefactSettings -> Options -> FilePath -> SimpPos -> SimpPos -> IO [FilePath]
removeBracket settings opts fileName beginPos endPos =
let applied = (:[]) . fst <$> applyRefac
(removeBracketTransform fileName beginPos endPos)
(RSFile fileName) in
runRefacSession settings opts [Left fileName] applied | 354 | removeBracket settings opts fileName beginPos endPos =
let applied = (:[]) . fst <$> applyRefac
(removeBracketTransform fileName beginPos endPos)
(RSFile fileName) in
runRefacSession settings opts [Left fileName] applied | 260 | true | true | 0 | 12 | 94 | 111 | 56 | 55 | null | null |
hguenther/nbis | TypeDesc.hs | agpl-3.0 | typeWidth pw structs (ArrayType n tp) = n*(typeWidth pw structs tp) | 67 | typeWidth pw structs (ArrayType n tp) = n*(typeWidth pw structs tp) | 67 | typeWidth pw structs (ArrayType n tp) = n*(typeWidth pw structs tp) | 67 | false | false | 0 | 7 | 10 | 35 | 17 | 18 | null | null |
alexstachnik/High-Level-C | src/Language/HLC/Quasi/Parser.hs | gpl-2.0 | identifier = P.identifier lexer | 31 | identifier = P.identifier lexer | 31 | identifier = P.identifier lexer | 31 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
mrd/camfort | tests/Camfort/Specification/Stencils/CheckSpec.hs | apache-2.0 | promoteErrors :: Either String x -> Either AnnotationParseError x
promoteErrors (Left x) = Left (ProbablyAnnotation x) | 119 | promoteErrors :: Either String x -> Either AnnotationParseError x
promoteErrors (Left x) = Left (ProbablyAnnotation x) | 119 | promoteErrors (Left x) = Left (ProbablyAnnotation x) | 53 | false | true | 0 | 7 | 16 | 47 | 21 | 26 | null | null |
nikita-volkov/hasql-transaction | conflicts-test/Main/Statements.hs | mit | getBalance :: Statement Int64 (Maybe Scientific)
getBalance =
Statement
"select balance from account where id = $1"
((E.param . E.nonNullable) E.int8)
(D.rowMaybe ((D.column . D.nonNullable) D.numeric))
True | 225 | getBalance :: Statement Int64 (Maybe Scientific)
getBalance =
Statement
"select balance from account where id = $1"
((E.param . E.nonNullable) E.int8)
(D.rowMaybe ((D.column . D.nonNullable) D.numeric))
True | 225 | getBalance =
Statement
"select balance from account where id = $1"
((E.param . E.nonNullable) E.int8)
(D.rowMaybe ((D.column . D.nonNullable) D.numeric))
True | 176 | false | true | 0 | 11 | 44 | 80 | 39 | 41 | null | null |
vjoki/llvm-hs-pretty | src/LLVM/Pretty.hs | mit | spacedbraces :: Doc -> Doc
spacedbraces x = char '{' <+> x <+> char '}' | 71 | spacedbraces :: Doc -> Doc
spacedbraces x = char '{' <+> x <+> char '}' | 71 | spacedbraces x = char '{' <+> x <+> char '}' | 44 | false | true | 0 | 7 | 14 | 32 | 15 | 17 | null | null |
brendanhay/gogol | gogol-plus-domains/gen/Network/Google/PlusDomains/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'ActivityObjectPlusoners' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aopTotalItems'
--
-- * 'aopSelfLink'
activityObjectPlusoners
:: ActivityObjectPlusoners
activityObjectPlusoners =
ActivityObjectPlusoners' {_aopTotalItems = Nothing, _aopSelfLink = Nothing} | 379 | activityObjectPlusoners
:: ActivityObjectPlusoners
activityObjectPlusoners =
ActivityObjectPlusoners' {_aopTotalItems = Nothing, _aopSelfLink = Nothing} | 158 | activityObjectPlusoners =
ActivityObjectPlusoners' {_aopTotalItems = Nothing, _aopSelfLink = Nothing} | 103 | true | true | 1 | 7 | 55 | 36 | 22 | 14 | null | null |
mvdan/hint | src/Hint/InterpreterT.hs | bsd-3-clause | initialState :: InterpreterState
initialState = St {
activePhantoms = [],
zombiePhantoms = [],
#if defined(NEED_PHANTOM_DIRECTORY)
phantomDirectory = Nothing,
#endif
hintSupportModule = error "No support module loaded!",
importQualHackMod = Nothing,
qualImports = [],
defaultExts = error "defaultExts missing!",
configuration = defaultConf
} | 534 | initialState :: InterpreterState
initialState = St {
activePhantoms = [],
zombiePhantoms = [],
#if defined(NEED_PHANTOM_DIRECTORY)
phantomDirectory = Nothing,
#endif
hintSupportModule = error "No support module loaded!",
importQualHackMod = Nothing,
qualImports = [],
defaultExts = error "defaultExts missing!",
configuration = defaultConf
} | 534 | initialState = St {
activePhantoms = [],
zombiePhantoms = [],
#if defined(NEED_PHANTOM_DIRECTORY)
phantomDirectory = Nothing,
#endif
hintSupportModule = error "No support module loaded!",
importQualHackMod = Nothing,
qualImports = [],
defaultExts = error "defaultExts missing!",
configuration = defaultConf
} | 501 | false | true | 0 | 7 | 233 | 75 | 46 | 29 | null | null |
serokell/importify | src/Extended/Data/Bool.hs | mit | True ==> x = x | 15 | True ==> x = x | 15 | True ==> x = x | 15 | false | false | 0 | 5 | 5 | 16 | 6 | 10 | null | null |
kyren/hsgb | lib/Gameboy/Instructions.hs | unlicense | encodeInstruction SBC_A_ATHL = [0x9e] | 37 | encodeInstruction SBC_A_ATHL = [0x9e] | 37 | encodeInstruction SBC_A_ATHL = [0x9e] | 37 | false | false | 0 | 5 | 3 | 13 | 6 | 7 | null | null |
DanielSchiavini/ampersand | src/Database/Design/Ampersand/Input/ADL1/ParsingLib.hs | gpl-3.0 | --- Varid ::= (LowerChar | '_') (Char | '_')*
pVarid :: AmpParser String
pVarid = check (\lx -> case lx of { LexVarId s -> Just s; _ -> Nothing }) | 146 | pVarid :: AmpParser String
pVarid = check (\lx -> case lx of { LexVarId s -> Just s; _ -> Nothing }) | 100 | pVarid = check (\lx -> case lx of { LexVarId s -> Just s; _ -> Nothing }) | 73 | true | true | 0 | 11 | 30 | 51 | 27 | 24 | null | null |
dysinger/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types.hs | mpl-2.0 | didBytes :: Lens' DiskImageDetail Integer
didBytes = lens _didBytes (\s a -> s { _didBytes = a }) | 97 | didBytes :: Lens' DiskImageDetail Integer
didBytes = lens _didBytes (\s a -> s { _didBytes = a }) | 97 | didBytes = lens _didBytes (\s a -> s { _didBytes = a }) | 55 | false | true | 0 | 9 | 17 | 39 | 21 | 18 | null | null |
mettekou/ghc | compiler/stranal/WorkWrap.hs | bsd-3-clause | wwExpr _ _ e@(Coercion {}) = return e | 42 | wwExpr _ _ e@(Coercion {}) = return e | 42 | wwExpr _ _ e@(Coercion {}) = return e | 42 | false | false | 0 | 8 | 12 | 26 | 13 | 13 | null | null |
leshchevds/ganeti | src/Ganeti/Utils/Monad.hs | bsd-2-clause | -- | Retries the given action up to @n@ times.
-- The action signals failure by 'mzero'.
mretryN :: (MonadPlus m) => Int -> (Int -> m a) -> m a
mretryN n = msum . flip map [1..n] | 178 | mretryN :: (MonadPlus m) => Int -> (Int -> m a) -> m a
mretryN n = msum . flip map [1..n] | 89 | mretryN n = msum . flip map [1..n] | 34 | true | true | 0 | 10 | 38 | 60 | 31 | 29 | null | null |
tdox/aircraft-service | src/Config.hs | mit | -- | This function creates a 'ConnectionPool' for the given environment.
-- For 'Development' and 'Test' environments, we use a stock and highly
-- insecure connection string. The 'Production' environment acquires the
-- information from environment variables that are set by the keter
-- deployment application.
makePool :: Environment -> IO ConnectionPool
makePool Test =
runNoLoggingT (createPostgresqlPool (connStr "test") (envPool Test)) | 446 | makePool :: Environment -> IO ConnectionPool
makePool Test =
runNoLoggingT (createPostgresqlPool (connStr "test") (envPool Test)) | 133 | makePool Test =
runNoLoggingT (createPostgresqlPool (connStr "test") (envPool Test)) | 88 | true | true | 0 | 9 | 64 | 49 | 26 | 23 | null | null |
alsonkemp/hdbc | Database/HDBC/Utils.hs | lgpl-2.1 | fetchRowMap' :: Statement -> IO (Maybe (Map.Map String SqlValue))
fetchRowMap' sth =
do res <- fetchRowMap sth
case res of
Nothing -> return 0
Just x -> evaluate ((genericLength (Map.toList x))::Integer)
return res
{- | Like 'fetchAllRows', but instead of returning a list for each
row, return an association list for each row, from column name to value.
See 'fetchRowAL' for more details. -} | 437 | fetchRowMap' :: Statement -> IO (Maybe (Map.Map String SqlValue))
fetchRowMap' sth =
do res <- fetchRowMap sth
case res of
Nothing -> return 0
Just x -> evaluate ((genericLength (Map.toList x))::Integer)
return res
{- | Like 'fetchAllRows', but instead of returning a list for each
row, return an association list for each row, from column name to value.
See 'fetchRowAL' for more details. -} | 437 | fetchRowMap' sth =
do res <- fetchRowMap sth
case res of
Nothing -> return 0
Just x -> evaluate ((genericLength (Map.toList x))::Integer)
return res
{- | Like 'fetchAllRows', but instead of returning a list for each
row, return an association list for each row, from column name to value.
See 'fetchRowAL' for more details. -} | 371 | false | true | 0 | 17 | 108 | 107 | 49 | 58 | null | null |
yliu120/K3 | src/Language/K3/Analysis/SEffects/Inference.hs | apache-2.0 | filkupe :: FIEnv -> Identifier -> Either Text (K3 Effect)
filkupe env x = flkup (fenv env) x | 92 | filkupe :: FIEnv -> Identifier -> Either Text (K3 Effect)
filkupe env x = flkup (fenv env) x | 92 | filkupe env x = flkup (fenv env) x | 34 | false | true | 0 | 9 | 17 | 46 | 22 | 24 | null | null |
Kyly/liquidhaskell | tests/todo/kmpMonad.hs | bsd-3-clause | {-@ getIO :: forall <p :: Int -> a -> Prop>.
a:IOArr<p> a -> i:Upto (size a) -> IO (a<p i>)
@-}
getIO a@(IOA sz p) i
= do arr <- readIORef p
return $ (arr ! i)
{-@ setIO :: forall <p :: Int -> a -> Prop>.
a:IOArr<p> a -> i:Upto (size a) -> a<p i> -> IO ()
@-} | 303 | getIO a@(IOA sz p) i
= do arr <- readIORef p
return $ (arr ! i)
{-@ setIO :: forall <p :: Int -> a -> Prop>.
a:IOArr<p> a -> i:Upto (size a) -> a<p i> -> IO ()
@-} | 191 | getIO a@(IOA sz p) i
= do arr <- readIORef p
return $ (arr ! i)
{-@ setIO :: forall <p :: Int -> a -> Prop>.
a:IOArr<p> a -> i:Upto (size a) -> a<p i> -> IO ()
@-} | 191 | true | false | 0 | 9 | 105 | 48 | 24 | 24 | null | null |
ml9951/ghc | compiler/prelude/THNames.hs | bsd-3-clause | liftIdKey = mkPreludeMiscIdUnique 203 | 47 | liftIdKey = mkPreludeMiscIdUnique 203 | 47 | liftIdKey = mkPreludeMiscIdUnique 203 | 47 | false | false | 0 | 5 | 13 | 9 | 4 | 5 | null | null |
uuhan/Idris-dev | src/IRTS/Lang.hs | bsd-3-clause | lambdaLift n x = [(n, x)] | 25 | lambdaLift n x = [(n, x)] | 25 | lambdaLift n x = [(n, x)] | 25 | false | false | 0 | 6 | 5 | 20 | 11 | 9 | null | null |
BeautifulDestinations/fb | gen/src/Facebook/Gen/CodeGenStr.hs | bsd-3-clause | -- Does the generated function return a Pager?
entityModePagerSet =
Set.fromList [(Entity "AdCampaign", Reading),
(Entity "Insights", Reading),
(Entity "AdImage", Reading),
(Entity "AdCreative", Reading),
(Entity "Ad", Reading),
(Entity "AdSet", Reading),
(Entity "CustomAudience", Reading),
(Entity "AdsPixel", Reading)] | 451 | entityModePagerSet =
Set.fromList [(Entity "AdCampaign", Reading),
(Entity "Insights", Reading),
(Entity "AdImage", Reading),
(Entity "AdCreative", Reading),
(Entity "Ad", Reading),
(Entity "AdSet", Reading),
(Entity "CustomAudience", Reading),
(Entity "AdsPixel", Reading)] | 404 | entityModePagerSet =
Set.fromList [(Entity "AdCampaign", Reading),
(Entity "Insights", Reading),
(Entity "AdImage", Reading),
(Entity "AdCreative", Reading),
(Entity "Ad", Reading),
(Entity "AdSet", Reading),
(Entity "CustomAudience", Reading),
(Entity "AdsPixel", Reading)] | 404 | true | false | 0 | 8 | 164 | 108 | 62 | 46 | null | null |
randen/cabal | cabal-install/Distribution/Client/Sandbox/PackageEnvironment.hs | bsd-3-clause | userPackageEnvironment :: Verbosity -> FilePath -> Maybe FilePath -> IO PackageEnvironment
userPackageEnvironment verbosity pkgEnvDir globalConfigLocation = do
let path = pkgEnvDir </> userPackageEnvironmentFile
minp <- readPackageEnvironmentFile (ConstraintSourceUserConfig path) mempty path
case (minp, globalConfigLocation) of
(Just parseRes, _) -> processConfigParse path parseRes
(_, Just globalLoc) -> maybe (warn verbosity ("no constraints file found at " ++ globalLoc) >> return mempty) (processConfigParse globalLoc) =<< readPackageEnvironmentFile (ConstraintSourceUserConfig globalLoc) mempty globalLoc
_ -> return mempty
where
processConfigParse path (ParseOk warns parseResult) = do
when (not $ null warns) $ warn verbosity $
unlines (map (showPWarning path) warns)
return parseResult
processConfigParse path (ParseFailed err) = do
let (line, msg) = locatedErrorMsg err
warn verbosity $ "Error parsing package environment file " ++ path
++ maybe "" (\n -> ":" ++ show n) line ++ ":\n" ++ msg
return mempty
-- | Same as @userPackageEnvironmentFile@, but returns a SavedConfig. | 1,175 | userPackageEnvironment :: Verbosity -> FilePath -> Maybe FilePath -> IO PackageEnvironment
userPackageEnvironment verbosity pkgEnvDir globalConfigLocation = do
let path = pkgEnvDir </> userPackageEnvironmentFile
minp <- readPackageEnvironmentFile (ConstraintSourceUserConfig path) mempty path
case (minp, globalConfigLocation) of
(Just parseRes, _) -> processConfigParse path parseRes
(_, Just globalLoc) -> maybe (warn verbosity ("no constraints file found at " ++ globalLoc) >> return mempty) (processConfigParse globalLoc) =<< readPackageEnvironmentFile (ConstraintSourceUserConfig globalLoc) mempty globalLoc
_ -> return mempty
where
processConfigParse path (ParseOk warns parseResult) = do
when (not $ null warns) $ warn verbosity $
unlines (map (showPWarning path) warns)
return parseResult
processConfigParse path (ParseFailed err) = do
let (line, msg) = locatedErrorMsg err
warn verbosity $ "Error parsing package environment file " ++ path
++ maybe "" (\n -> ":" ++ show n) line ++ ":\n" ++ msg
return mempty
-- | Same as @userPackageEnvironmentFile@, but returns a SavedConfig. | 1,175 | userPackageEnvironment verbosity pkgEnvDir globalConfigLocation = do
let path = pkgEnvDir </> userPackageEnvironmentFile
minp <- readPackageEnvironmentFile (ConstraintSourceUserConfig path) mempty path
case (minp, globalConfigLocation) of
(Just parseRes, _) -> processConfigParse path parseRes
(_, Just globalLoc) -> maybe (warn verbosity ("no constraints file found at " ++ globalLoc) >> return mempty) (processConfigParse globalLoc) =<< readPackageEnvironmentFile (ConstraintSourceUserConfig globalLoc) mempty globalLoc
_ -> return mempty
where
processConfigParse path (ParseOk warns parseResult) = do
when (not $ null warns) $ warn verbosity $
unlines (map (showPWarning path) warns)
return parseResult
processConfigParse path (ParseFailed err) = do
let (line, msg) = locatedErrorMsg err
warn verbosity $ "Error parsing package environment file " ++ path
++ maybe "" (\n -> ":" ++ show n) line ++ ":\n" ++ msg
return mempty
-- | Same as @userPackageEnvironmentFile@, but returns a SavedConfig. | 1,084 | false | true | 0 | 16 | 230 | 338 | 160 | 178 | null | null |
phaazon/vector | Data/Vector/Primitive.hs | bsd-3-clause | init = G.init | 13 | init = G.init | 13 | init = G.init | 13 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
schell/blocks | src/Math/Matrix.hs | bsd-3-clause | -- | The number of rows in the matrix.
numRows :: Matrix a -> Int
numRows [] = 0 | 83 | numRows :: Matrix a -> Int
numRows [] = 0 | 44 | numRows [] = 0 | 17 | true | true | 0 | 6 | 21 | 24 | 12 | 12 | null | null |
quchen/stg | test/Testsuite/Test/Prelude/List.hs | bsd-3-clause | testFilter :: TestTree
testFilter = marshalledValueTest defSpec
{ testName = "filter"
, sourceSpec = \(xs, threshold :: Integer) -> MarshalSourceSpec
{ resultVar = "main"
, expectedValue = filter (> threshold) xs
, source = mconcat
[ toStg "inputList" xs
, toStg "threshold" threshold
, Stg.gt_Int
, Stg.force
, Stg.filter
, [stg|
main = \ =>
letrec
positive = \x -> gt_Int x threshold;
filtered = \(positive) => filter positive inputList
in force filtered
|] ]}} | 663 | testFilter :: TestTree
testFilter = marshalledValueTest defSpec
{ testName = "filter"
, sourceSpec = \(xs, threshold :: Integer) -> MarshalSourceSpec
{ resultVar = "main"
, expectedValue = filter (> threshold) xs
, source = mconcat
[ toStg "inputList" xs
, toStg "threshold" threshold
, Stg.gt_Int
, Stg.force
, Stg.filter
, [stg|
main = \ =>
letrec
positive = \x -> gt_Int x threshold;
filtered = \(positive) => filter positive inputList
in force filtered
|] ]}} | 663 | testFilter = marshalledValueTest defSpec
{ testName = "filter"
, sourceSpec = \(xs, threshold :: Integer) -> MarshalSourceSpec
{ resultVar = "main"
, expectedValue = filter (> threshold) xs
, source = mconcat
[ toStg "inputList" xs
, toStg "threshold" threshold
, Stg.gt_Int
, Stg.force
, Stg.filter
, [stg|
main = \ =>
letrec
positive = \x -> gt_Int x threshold;
filtered = \(positive) => filter positive inputList
in force filtered
|] ]}} | 640 | false | true | 0 | 13 | 274 | 113 | 67 | 46 | null | null |
michaelgwelch/bacnet | src/BACnet/Reader.hs | mit | readTimeCS :: TagNumber -> Reader Prim.Time
readTimeCS t = readTimeCSTag t >> readTime | 86 | readTimeCS :: TagNumber -> Reader Prim.Time
readTimeCS t = readTimeCSTag t >> readTime | 86 | readTimeCS t = readTimeCSTag t >> readTime | 42 | false | true | 2 | 8 | 12 | 36 | 15 | 21 | null | null |
DavidRutqvist/ParserOperators-D7012E-Lab2 | src/Parser.hs | bsd-3-clause | spaces :: Parser String
spaces = iter space | 43 | spaces :: Parser String
spaces = iter space | 43 | spaces = iter space | 19 | false | true | 1 | 5 | 7 | 20 | 8 | 12 | null | null |
jecxjo/hed | src/CommandParser.hs | bsd-3-clause | commentCommand :: Parser ParsedCommand
commentCommand = do
_ <- whiteSpace
mRange <- optionMaybe allRanges
let r = orCurrent mRange
_ <- whiteSpace
_ <- char '#'
comment <- many $ noneOf "\n"
_ <- eof
(return . ParsedCommand "comment" r) . StringArg $ pack comment
-- |($)= | 290 | commentCommand :: Parser ParsedCommand
commentCommand = do
_ <- whiteSpace
mRange <- optionMaybe allRanges
let r = orCurrent mRange
_ <- whiteSpace
_ <- char '#'
comment <- many $ noneOf "\n"
_ <- eof
(return . ParsedCommand "comment" r) . StringArg $ pack comment
-- |($)= | 290 | commentCommand = do
_ <- whiteSpace
mRange <- optionMaybe allRanges
let r = orCurrent mRange
_ <- whiteSpace
_ <- char '#'
comment <- many $ noneOf "\n"
_ <- eof
(return . ParsedCommand "comment" r) . StringArg $ pack comment
-- |($)= | 251 | false | true | 0 | 11 | 63 | 108 | 48 | 60 | null | null |
green-haskell/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | consDataConKey = mkPreludeDataConUnique 2 | 67 | consDataConKey = mkPreludeDataConUnique 2 | 67 | consDataConKey = mkPreludeDataConUnique 2 | 67 | false | false | 0 | 5 | 29 | 9 | 4 | 5 | null | null |
christiaanb/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v (LPlus (ATInt ITBig)) [l, r] = v ++ "idris_bigPlus(vm, " ++ creg l ++ ", " ++ creg r ++ ")" | 98 | doOp v (LPlus (ATInt ITBig)) [l, r] = v ++ "idris_bigPlus(vm, " ++ creg l ++ ", " ++ creg r ++ ")" | 98 | doOp v (LPlus (ATInt ITBig)) [l, r] = v ++ "idris_bigPlus(vm, " ++ creg l ++ ", " ++ creg r ++ ")" | 98 | false | false | 1 | 14 | 22 | 62 | 28 | 34 | null | null |
beni55/hspec | hspec-core/src/Test/Hspec/Options.hs | mit | setDepth :: Int -> Config -> Config
setDepth n c = c {configSmallCheckDepth = n} | 80 | setDepth :: Int -> Config -> Config
setDepth n c = c {configSmallCheckDepth = n} | 80 | setDepth n c = c {configSmallCheckDepth = n} | 44 | false | true | 0 | 8 | 14 | 41 | 19 | 22 | null | null |
brendanhay/gogol | gogol-slides/gen/Network/Google/Slides/Types/Product.hs | mpl-2.0 | -- | The object ID of the page element the updates are applied to.
upeatrObjectId :: Lens' UpdatePageElementAltTextRequest (Maybe Text)
upeatrObjectId
= lens _upeatrObjectId
(\ s a -> s{_upeatrObjectId = a}) | 215 | upeatrObjectId :: Lens' UpdatePageElementAltTextRequest (Maybe Text)
upeatrObjectId
= lens _upeatrObjectId
(\ s a -> s{_upeatrObjectId = a}) | 148 | upeatrObjectId
= lens _upeatrObjectId
(\ s a -> s{_upeatrObjectId = a}) | 79 | true | true | 0 | 9 | 38 | 48 | 25 | 23 | null | null |
evanrinehart/lowgl | Graphics/GL/Low/Render.hs | bsd-2-clause | drawLineStrip :: Int -> IO ()
drawLineStrip = drawArrays GL_LINE_STRIP | 70 | drawLineStrip :: Int -> IO ()
drawLineStrip = drawArrays GL_LINE_STRIP | 70 | drawLineStrip = drawArrays GL_LINE_STRIP | 40 | false | true | 0 | 8 | 9 | 29 | 12 | 17 | null | null |
johanneshilden/liquid-epsilon | Util/HTML/Elements.hs | bsd-3-clause | a, article, aside, b, blockquote, body, button, canvas, code, dd, div, dl, dt, em, fieldset, footer, form, h1, h2, h3, h4, h5, h6, _head, html, i, _label, menu, nav, ol, option, p, pre, q, section, select, span, sub, sup, table, tbody, td, textarea, tfoot, thead, title, tr, ul, video :: Html -> Html
a = makePar "a" | 326 | a, article, aside, b, blockquote, body, button, canvas, code, dd, div, dl, dt, em, fieldset, footer, form, h1, h2, h3, h4, h5, h6, _head, html, i, _label, menu, nav, ol, option, p, pre, q, section, select, span, sub, sup, table, tbody, td, textarea, tfoot, thead, title, tr, ul, video :: Html -> Html
a = makePar "a" | 325 | a = makePar "a" | 24 | false | true | 2 | 5 | 66 | 118 | 105 | 13 | null | null |
Tener/HaNS | src/Network/TCP/Type/Datagram.hs | bsd-3-clause | set_tcp_ws :: Maybe Int -> TcpHeader -> TcpHeader
set_tcp_ws Nothing = id | 75 | set_tcp_ws :: Maybe Int -> TcpHeader -> TcpHeader
set_tcp_ws Nothing = id | 75 | set_tcp_ws Nothing = id | 25 | false | true | 0 | 6 | 13 | 25 | 12 | 13 | null | null |
filopodia/open | echarts-hs/src/Graphics/Echarts.hs | mit | thinRadius = ["50%","70%"] | 27 | thinRadius = ["50%","70%"] | 27 | thinRadius = ["50%","70%"] | 27 | false | false | 1 | 5 | 3 | 15 | 7 | 8 | null | null |
dimidd/senths | src/NB.hs | gpl-3.0 | isAlphaSpace :: Char -> Bool
isAlphaSpace = liftA2 (||) isSpace isAlpha | 71 | isAlphaSpace :: Char -> Bool
isAlphaSpace = liftA2 (||) isSpace isAlpha | 71 | isAlphaSpace = liftA2 (||) isSpace isAlpha | 42 | false | true | 0 | 5 | 10 | 24 | 13 | 11 | null | null |
forsyde/forsyde-atom | src/ForSyDe/Atom/MoC/SDF/SDF.hs | bsd-3-clause | state42 ns i = MoC.state42 (scen62 ns) (signal2 i) | 50 | state42 ns i = MoC.state42 (scen62 ns) (signal2 i) | 50 | state42 ns i = MoC.state42 (scen62 ns) (signal2 i) | 50 | false | false | 1 | 7 | 8 | 34 | 14 | 20 | null | null |
swift-nav/preamble | src/Preamble/Stats.hs | mit | stats :: (MonadStatsCtx c m, Show a) => Text -> Text -> a -> Tags -> m ()
stats metric name value tags = do
labels <- (<> tags) <$> view scLabels
prefix <- ap (`bool` mempty) T.null <$> view scPrefix
let statsd = prefix <> name -:- textShow value -|- metric
tagged = T.intercalate "," $ flip map labels $ uncurry (-:-)
stat <- view scStat
liftIO $ stat $ encodeUtf8 $ bool (statsd -|- "#" <> tagged) statsd $ null labels | 436 | stats :: (MonadStatsCtx c m, Show a) => Text -> Text -> a -> Tags -> m ()
stats metric name value tags = do
labels <- (<> tags) <$> view scLabels
prefix <- ap (`bool` mempty) T.null <$> view scPrefix
let statsd = prefix <> name -:- textShow value -|- metric
tagged = T.intercalate "," $ flip map labels $ uncurry (-:-)
stat <- view scStat
liftIO $ stat $ encodeUtf8 $ bool (statsd -|- "#" <> tagged) statsd $ null labels | 436 | stats metric name value tags = do
labels <- (<> tags) <$> view scLabels
prefix <- ap (`bool` mempty) T.null <$> view scPrefix
let statsd = prefix <> name -:- textShow value -|- metric
tagged = T.intercalate "," $ flip map labels $ uncurry (-:-)
stat <- view scStat
liftIO $ stat $ encodeUtf8 $ bool (statsd -|- "#" <> tagged) statsd $ null labels | 362 | false | true | 0 | 14 | 98 | 208 | 100 | 108 | null | null |
nandotorterolo/Tactics | src/Main.hs | bsd-3-clause | status :: GameState -> GameStatus
status gs@(GameState t numTurno p puntos carga )
| isFinished gs = Finished
| puntos > 2 = Turn p
| otherwise = Roll (otroPlayer p) | 171 | status :: GameState -> GameStatus
status gs@(GameState t numTurno p puntos carga )
| isFinished gs = Finished
| puntos > 2 = Turn p
| otherwise = Roll (otroPlayer p) | 171 | status gs@(GameState t numTurno p puntos carga )
| isFinished gs = Finished
| puntos > 2 = Turn p
| otherwise = Roll (otroPlayer p) | 137 | false | true | 2 | 8 | 36 | 76 | 36 | 40 | null | null |
erantapaa/parse-cabal | src/TarUtil.hs | bsd-3-clause | pipesTarEntries entries =
case entries of
Tar.Next ent next -> do yield (Just ent); pipesTarEntries next
Tar.Done -> yield Nothing
Tar.Fail e -> throw (TarFormatError e)
-- | Filter a stream of Tar.Entry to only include the cabal files | 267 | pipesTarEntries entries =
case entries of
Tar.Next ent next -> do yield (Just ent); pipesTarEntries next
Tar.Done -> yield Nothing
Tar.Fail e -> throw (TarFormatError e)
-- | Filter a stream of Tar.Entry to only include the cabal files | 267 | pipesTarEntries entries =
case entries of
Tar.Next ent next -> do yield (Just ent); pipesTarEntries next
Tar.Done -> yield Nothing
Tar.Fail e -> throw (TarFormatError e)
-- | Filter a stream of Tar.Entry to only include the cabal files | 267 | false | false | 0 | 12 | 70 | 77 | 35 | 42 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.