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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
niexshao/AlgorithmEx | src/Course/PA3.hs | bsd-3-clause | buildNoDirG :: (Vertex, Vertex) -> [NoDirEdge] -> NoDirGraph
buildNoDirG bounds0 edges0 =
accumArray (flip S.insert) S.empty bounds0 (edges0 ++ map swap edges0) where
swap (a, b) = (b, a) | 193 | buildNoDirG :: (Vertex, Vertex) -> [NoDirEdge] -> NoDirGraph
buildNoDirG bounds0 edges0 =
accumArray (flip S.insert) S.empty bounds0 (edges0 ++ map swap edges0) where
swap (a, b) = (b, a) | 193 | buildNoDirG bounds0 edges0 =
accumArray (flip S.insert) S.empty bounds0 (edges0 ++ map swap edges0) where
swap (a, b) = (b, a) | 132 | false | true | 0 | 8 | 34 | 86 | 46 | 40 | null | null |
M42/mikrokosmos | source/NamedLambda.hs | gpl-3.0 | nameIndexes used new (Inr a) = TypedInr (nameIndexes used new a) | 71 | nameIndexes used new (Inr a) = TypedInr (nameIndexes used new a) | 71 | nameIndexes used new (Inr a) = TypedInr (nameIndexes used new a) | 71 | false | false | 0 | 7 | 17 | 35 | 15 | 20 | null | null |
nitroFamily/hamming | src/Codes/Hamming.hs | bsd-3-clause | -- | Построитель кода для заданной длины данных.
-- Возвращает тип 'HammingCode', который содержит необходимые матрицы для кодирования и декодирования
--
-- > let hc = hamming 2
-- > code hc -> (5, 2)
-- > getH hc -> ( 1 0 1 0 1 )
-- > ( 0 1 1 0 0 )
-- > ( 0 0 0 1 1 )
--
-- > getG hc -> ( 1 1 1 0 0 )
-- > ( 1 0 0 1 1 )
hamming :: Int -- ^ Длина блока данных, для которого выберется подходящий код
-> HammingCode
hamming i =
let (n, k) = head $ filter (\(_, k) -> k >= i) hammingCodes
diff = k - i
c@(n', k') = (n - diff, k - diff)
h = generateH c
g = generateG c h
in HammingCode c (fromIntegral k' / fromIntegral n') h g | 707 | hamming :: Int -- ^ Длина блока данных, для которого выберется подходящий код
-> HammingCode
hamming i =
let (n, k) = head $ filter (\(_, k) -> k >= i) hammingCodes
diff = k - i
c@(n', k') = (n - diff, k - diff)
h = generateH c
g = generateG c h
in HammingCode c (fromIntegral k' / fromIntegral n') h g | 351 | hamming i =
let (n, k) = head $ filter (\(_, k) -> k >= i) hammingCodes
diff = k - i
c@(n', k') = (n - diff, k - diff)
h = generateH c
g = generateG c h
in HammingCode c (fromIntegral k' / fromIntegral n') h g | 250 | true | true | 0 | 13 | 235 | 153 | 86 | 67 | null | null |
oden-lang/oden | src/Oden/Predefined.hs | mit | typeInt, typeFloat64, typeString, typeBool, typeUnit :: Type
typeInt = TCon predefined (nameInUniverse "int") | 109 | typeInt, typeFloat64, typeString, typeBool, typeUnit :: Type
typeInt = TCon predefined (nameInUniverse "int") | 109 | typeInt = TCon predefined (nameInUniverse "int") | 48 | false | true | 3 | 7 | 12 | 37 | 19 | 18 | null | null |
albertov/hs-mapnik | bindings/src/Mapnik/Bindings/Datasource.hs | bsd-3-clause | queryBox :: Box -> Query
queryBox b = Query
{ _queryBox = b
, _queryUnBufferedBox = b
, _queryResolution=Pair 1 1
, _queryScaleDenominator = 1
, _queryFilterFactor = 1
, _queryPropertyNames=[]
, _queryVariables = M.empty
} | 238 | queryBox :: Box -> Query
queryBox b = Query
{ _queryBox = b
, _queryUnBufferedBox = b
, _queryResolution=Pair 1 1
, _queryScaleDenominator = 1
, _queryFilterFactor = 1
, _queryPropertyNames=[]
, _queryVariables = M.empty
} | 238 | queryBox b = Query
{ _queryBox = b
, _queryUnBufferedBox = b
, _queryResolution=Pair 1 1
, _queryScaleDenominator = 1
, _queryFilterFactor = 1
, _queryPropertyNames=[]
, _queryVariables = M.empty
} | 213 | false | true | 0 | 8 | 51 | 75 | 43 | 32 | null | null |
ftomassetti/erd-web-server | src/ER.hs | mit | cardByName :: Char -> Maybe Cardinality
cardByName '?' = Just ZeroOne | 69 | cardByName :: Char -> Maybe Cardinality
cardByName '?' = Just ZeroOne | 69 | cardByName '?' = Just ZeroOne | 29 | false | true | 0 | 6 | 10 | 24 | 11 | 13 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/Resources/LambdaAlias.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-description
laDescription :: Lens' LambdaAlias (Maybe (Val Text))
laDescription = lens _lambdaAliasDescription (\s a -> s { _lambdaAliasDescription = a }) | 269 | laDescription :: Lens' LambdaAlias (Maybe (Val Text))
laDescription = lens _lambdaAliasDescription (\s a -> s { _lambdaAliasDescription = a }) | 142 | laDescription = lens _lambdaAliasDescription (\s a -> s { _lambdaAliasDescription = a }) | 88 | true | true | 2 | 9 | 22 | 60 | 28 | 32 | null | null |
moonKimura/vector-0.10.9.1 | Data/Vector/Fusion/Stream/Monadic.hs | bsd-3-clause | generateM n f = n `seq` Stream step 0 (Exact (delay_inline max n 0))
where
{-# INLINE_INNER step #-}
step i | i < n = do
x <- f i
return $ Yield x (i+1)
| otherwise = return Done
-- | Prepend an element | 282 | generateM n f = n `seq` Stream step 0 (Exact (delay_inline max n 0))
where
{-# INLINE_INNER step #-}
step i | i < n = do
x <- f i
return $ Yield x (i+1)
| otherwise = return Done
-- | Prepend an element | 282 | generateM n f = n `seq` Stream step 0 (Exact (delay_inline max n 0))
where
{-# INLINE_INNER step #-}
step i | i < n = do
x <- f i
return $ Yield x (i+1)
| otherwise = return Done
-- | Prepend an element | 282 | false | false | 1 | 12 | 125 | 117 | 52 | 65 | null | null |
fultonms/artificial-intelligence | a2/parkingA.hs | mit | -- we are done when in the final position
goalTest :: State -> Bool
goalTest (B ((c1:c1s),p))
| c1 == done = True
| last (c1:c1s) == done = True
| otherwise = False | 170 | goalTest :: State -> Bool
goalTest (B ((c1:c1s),p))
| c1 == done = True
| last (c1:c1s) == done = True
| otherwise = False | 128 | goalTest (B ((c1:c1s),p))
| c1 == done = True
| last (c1:c1s) == done = True
| otherwise = False | 102 | true | true | 1 | 11 | 39 | 81 | 41 | 40 | null | null |
corngood/cabal | cabal-install/Distribution/Client/Setup.hs | bsd-3-clause | -- ------------------------------------------------------------
-- * Other commands
-- ------------------------------------------------------------
updateCommand :: CommandUI (Flag Verbosity)
updateCommand = CommandUI {
commandName = "update",
commandSynopsis = "Updates list of known packages.",
commandDescription = Just $ \_ ->
"For all known remote repositories, download the package list.\n",
commandNotes = Just $ \_ ->
relevantConfigValuesText ["remote-repo"
,"remote-repo-cache"
,"local-repo"],
commandUsage = usageFlags "update",
commandDefaultFlags = toFlag normal,
commandOptions = \_ -> [optionVerbosity id const]
} | 765 | updateCommand :: CommandUI (Flag Verbosity)
updateCommand = CommandUI {
commandName = "update",
commandSynopsis = "Updates list of known packages.",
commandDescription = Just $ \_ ->
"For all known remote repositories, download the package list.\n",
commandNotes = Just $ \_ ->
relevantConfigValuesText ["remote-repo"
,"remote-repo-cache"
,"local-repo"],
commandUsage = usageFlags "update",
commandDefaultFlags = toFlag normal,
commandOptions = \_ -> [optionVerbosity id const]
} | 616 | updateCommand = CommandUI {
commandName = "update",
commandSynopsis = "Updates list of known packages.",
commandDescription = Just $ \_ ->
"For all known remote repositories, download the package list.\n",
commandNotes = Just $ \_ ->
relevantConfigValuesText ["remote-repo"
,"remote-repo-cache"
,"local-repo"],
commandUsage = usageFlags "update",
commandDefaultFlags = toFlag normal,
commandOptions = \_ -> [optionVerbosity id const]
} | 571 | true | true | 1 | 11 | 205 | 120 | 68 | 52 | null | null |
tsahyt/clingo-haskell | src/Clingo/Internal/AST.hs | mit | freeBodyLiteral (AstBodyDisjoint l _ x) = do
freeRawLocation l
freeIndirection x freeDisjoint | 101 | freeBodyLiteral (AstBodyDisjoint l _ x) = do
freeRawLocation l
freeIndirection x freeDisjoint | 101 | freeBodyLiteral (AstBodyDisjoint l _ x) = do
freeRawLocation l
freeIndirection x freeDisjoint | 101 | false | false | 0 | 7 | 19 | 33 | 14 | 19 | null | null |
k-bx/par | src/Main.hs | mit | runSingle ::
(String -> IO ())
-> TBQueue (Maybe ByteString)
-> TBQueue (Maybe ByteString)
-> String
-> IO ExitCode
runSingle debug outQ errQ cmdBig = do
debug $
"Starting process " <> show cmd <> ", output prefix " <> show cmdPrefix
(_, Just hout, Just herr, ph) <-
createProcess (shell cmd) {std_out = CreatePipe, std_err = CreatePipe}
s <-
waitingPipeHandlers
(forwardPrefixing hout outQ)
(forwardPrefixing herr errQ)
(waitForProcess ph)
debug $ "Process " <> show cmdBig <> " exited with status " <> show s
return s
-- TODO: rewrite via Parsec or regex-applicative
where
(cmd, cmdPrefix) =
if parprefix `L.isPrefixOf` cmdBig
then let (pref, rest) = break (== ' ') (drop (length parprefix) cmdBig)
in (rest, pref <> " ")
else (cmdBig, "")
parprefix = "PARPREFIX="
toBs = toStrictByteString
prefixer chunk = [toBs cmdPrefix <> chunk]
forwardPrefixing from to = forwardHandler from to prefixer | 1,009 | runSingle ::
(String -> IO ())
-> TBQueue (Maybe ByteString)
-> TBQueue (Maybe ByteString)
-> String
-> IO ExitCode
runSingle debug outQ errQ cmdBig = do
debug $
"Starting process " <> show cmd <> ", output prefix " <> show cmdPrefix
(_, Just hout, Just herr, ph) <-
createProcess (shell cmd) {std_out = CreatePipe, std_err = CreatePipe}
s <-
waitingPipeHandlers
(forwardPrefixing hout outQ)
(forwardPrefixing herr errQ)
(waitForProcess ph)
debug $ "Process " <> show cmdBig <> " exited with status " <> show s
return s
-- TODO: rewrite via Parsec or regex-applicative
where
(cmd, cmdPrefix) =
if parprefix `L.isPrefixOf` cmdBig
then let (pref, rest) = break (== ' ') (drop (length parprefix) cmdBig)
in (rest, pref <> " ")
else (cmdBig, "")
parprefix = "PARPREFIX="
toBs = toStrictByteString
prefixer chunk = [toBs cmdPrefix <> chunk]
forwardPrefixing from to = forwardHandler from to prefixer | 1,009 | runSingle debug outQ errQ cmdBig = do
debug $
"Starting process " <> show cmd <> ", output prefix " <> show cmdPrefix
(_, Just hout, Just herr, ph) <-
createProcess (shell cmd) {std_out = CreatePipe, std_err = CreatePipe}
s <-
waitingPipeHandlers
(forwardPrefixing hout outQ)
(forwardPrefixing herr errQ)
(waitForProcess ph)
debug $ "Process " <> show cmdBig <> " exited with status " <> show s
return s
-- TODO: rewrite via Parsec or regex-applicative
where
(cmd, cmdPrefix) =
if parprefix `L.isPrefixOf` cmdBig
then let (pref, rest) = break (== ' ') (drop (length parprefix) cmdBig)
in (rest, pref <> " ")
else (cmdBig, "")
parprefix = "PARPREFIX="
toBs = toStrictByteString
prefixer chunk = [toBs cmdPrefix <> chunk]
forwardPrefixing from to = forwardHandler from to prefixer | 880 | false | true | 0 | 14 | 259 | 344 | 173 | 171 | null | null |
rubik/stack-hpc-coveralls | src/SHC/Utils.hs | isc | -- strip trailing \n
git :: [String] -> IO String
git = readP "git" | 68 | git :: [String] -> IO String
git = readP "git" | 46 | git = readP "git" | 17 | true | true | 0 | 7 | 14 | 31 | 14 | 17 | null | null |
Knewton/rifactor | src/Rifactor/AWS.hs | apache-2.0 | isVPC :: AwsResource -> Bool
isVPC (Reserved _ r) =
(r ^. riProductDescription) `elem`
[Just RIDLinuxUnixAmazonVPC,Just RIDWindowsAmazonVPC] | 144 | isVPC :: AwsResource -> Bool
isVPC (Reserved _ r) =
(r ^. riProductDescription) `elem`
[Just RIDLinuxUnixAmazonVPC,Just RIDWindowsAmazonVPC] | 144 | isVPC (Reserved _ r) =
(r ^. riProductDescription) `elem`
[Just RIDLinuxUnixAmazonVPC,Just RIDWindowsAmazonVPC] | 115 | false | true | 0 | 7 | 20 | 55 | 28 | 27 | null | null |
matthieu/witty | haskell/src/repl.hs | apache-2.0 | trim = trimR . trimR
where trimR = reverse . dropWhile isSpace | 66 | trim = trimR . trimR
where trimR = reverse . dropWhile isSpace | 66 | trim = trimR . trimR
where trimR = reverse . dropWhile isSpace | 66 | false | false | 0 | 6 | 15 | 25 | 12 | 13 | null | null |
Multi-Axis/habbix | app/main.hs | mit | getDashboardCached :: Habbix Value
getDashboardCached = do
res <- liftIO $ BLC.readFile "dashboard.cached.json"
return (fromJust $ decode res)
-- * Print
-- | How to output with | 188 | getDashboardCached :: Habbix Value
getDashboardCached = do
res <- liftIO $ BLC.readFile "dashboard.cached.json"
return (fromJust $ decode res)
-- * Print
-- | How to output with | 188 | getDashboardCached = do
res <- liftIO $ BLC.readFile "dashboard.cached.json"
return (fromJust $ decode res)
-- * Print
-- | How to output with | 153 | false | true | 0 | 10 | 37 | 48 | 23 | 25 | null | null |
abailly/subhask | src/SubHask/Category/Linear/Objects.hs | bsd-3-clause | y = mkSparseFreeVector $ words "this is not" :: SparseFreeVector Double String | 78 | y = mkSparseFreeVector $ words "this is not" :: SparseFreeVector Double String | 78 | y = mkSparseFreeVector $ words "this is not" :: SparseFreeVector Double String | 78 | false | false | 0 | 6 | 11 | 24 | 11 | 13 | null | null |
msakai/haskell-minisat | src/MiniSat2.hs | bsd-3-clause | -- |Search without assumptions.
solve :: Solver -> IO Bool
solve s = liftM toBool $ withSolver s (\p -> hsminisat_solve p nullPtr) | 130 | solve :: Solver -> IO Bool
solve s = liftM toBool $ withSolver s (\p -> hsminisat_solve p nullPtr) | 98 | solve s = liftM toBool $ withSolver s (\p -> hsminisat_solve p nullPtr) | 71 | true | true | 0 | 9 | 22 | 47 | 23 | 24 | null | null |
ktvoelker/Picker | src/View.hs | gpl-3.0 | waitForView :: (MonadIO m) => View -> m ()
waitForView = liftIO . takeMVar . _vStopped | 86 | waitForView :: (MonadIO m) => View -> m ()
waitForView = liftIO . takeMVar . _vStopped | 86 | waitForView = liftIO . takeMVar . _vStopped | 43 | false | true | 0 | 8 | 15 | 37 | 19 | 18 | null | null |
LeventErkok/hArduino | System/Hardware/Arduino/Parts/LCD.hs | bsd-3-clause | withLCD :: LCD -> String -> (LCDController -> Arduino a) -> Arduino a
withLCD lcd what action = do
debug what
c <- getController lcd
action c
---------------------------------------------------------------------------------------
-- High level interface, exposed to the user
---------------------------------------------------------------------------------------
-- | Register an LCD controller. When registration is complete, the LCD will be initialized so that:
--
-- * Set display ON (Use 'lcdDisplayOn' / 'lcdDisplayOff' to change.)
--
-- * Set cursor OFF (Use 'lcdCursorOn' / 'lcdCursorOff' to change.)
--
-- * Set blink OFF (Use 'lcdBlinkOn' / 'lcdBlinkOff' to change.)
--
-- * Clear display (Use 'lcdClear' to clear, 'lcdWrite' to display text.)
--
-- * Set entry mode left to write (Use 'lcdLeftToRight' / 'lcdRightToLeft' to control.)
--
-- * Set autoscrolling OFF (Use 'lcdAutoScrollOff' / 'lcdAutoScrollOn' to control.)
--
-- * Put the cursor into home position (Use 'lcdSetCursor' or 'lcdHome' to move around.) | 1,063 | withLCD :: LCD -> String -> (LCDController -> Arduino a) -> Arduino a
withLCD lcd what action = do
debug what
c <- getController lcd
action c
---------------------------------------------------------------------------------------
-- High level interface, exposed to the user
---------------------------------------------------------------------------------------
-- | Register an LCD controller. When registration is complete, the LCD will be initialized so that:
--
-- * Set display ON (Use 'lcdDisplayOn' / 'lcdDisplayOff' to change.)
--
-- * Set cursor OFF (Use 'lcdCursorOn' / 'lcdCursorOff' to change.)
--
-- * Set blink OFF (Use 'lcdBlinkOn' / 'lcdBlinkOff' to change.)
--
-- * Clear display (Use 'lcdClear' to clear, 'lcdWrite' to display text.)
--
-- * Set entry mode left to write (Use 'lcdLeftToRight' / 'lcdRightToLeft' to control.)
--
-- * Set autoscrolling OFF (Use 'lcdAutoScrollOff' / 'lcdAutoScrollOn' to control.)
--
-- * Put the cursor into home position (Use 'lcdSetCursor' or 'lcdHome' to move around.) | 1,063 | withLCD lcd what action = do
debug what
c <- getController lcd
action c
---------------------------------------------------------------------------------------
-- High level interface, exposed to the user
---------------------------------------------------------------------------------------
-- | Register an LCD controller. When registration is complete, the LCD will be initialized so that:
--
-- * Set display ON (Use 'lcdDisplayOn' / 'lcdDisplayOff' to change.)
--
-- * Set cursor OFF (Use 'lcdCursorOn' / 'lcdCursorOff' to change.)
--
-- * Set blink OFF (Use 'lcdBlinkOn' / 'lcdBlinkOff' to change.)
--
-- * Clear display (Use 'lcdClear' to clear, 'lcdWrite' to display text.)
--
-- * Set entry mode left to write (Use 'lcdLeftToRight' / 'lcdRightToLeft' to control.)
--
-- * Set autoscrolling OFF (Use 'lcdAutoScrollOff' / 'lcdAutoScrollOn' to control.)
--
-- * Put the cursor into home position (Use 'lcdSetCursor' or 'lcdHome' to move around.) | 993 | false | true | 0 | 10 | 186 | 83 | 47 | 36 | null | null |
Zigazou/HaMinitel | src/Minitel/Generate/PhotoVideotex.hs | gpl-3.0 | mPictureDataEntity PEHeaderLast d = 0x51 : d | 44 | mPictureDataEntity PEHeaderLast d = 0x51 : d | 44 | mPictureDataEntity PEHeaderLast d = 0x51 : d | 44 | false | false | 0 | 5 | 6 | 15 | 7 | 8 | null | null |
romanb/amazonka | amazonka-ses/gen/Network/AWS/SES/SendRawEmail.hs | mpl-2.0 | -- | The unique message identifier returned from the 'SendRawEmail' action.
srerMessageId :: Lens' SendRawEmailResponse Text
srerMessageId = lens _srerMessageId (\s a -> s { _srerMessageId = a }) | 195 | srerMessageId :: Lens' SendRawEmailResponse Text
srerMessageId = lens _srerMessageId (\s a -> s { _srerMessageId = a }) | 119 | srerMessageId = lens _srerMessageId (\s a -> s { _srerMessageId = a }) | 70 | true | true | 0 | 9 | 28 | 40 | 22 | 18 | null | null |
luisgepeto/HaskellLearning | 07 Modules/02_data_list.hs | mit | demo18 = take 3 $ iterate (++ "haha") "haha" | 44 | demo18 = take 3 $ iterate (++ "haha") "haha" | 44 | demo18 = take 3 $ iterate (++ "haha") "haha" | 44 | false | false | 3 | 6 | 8 | 27 | 11 | 16 | null | null |
richardfergie/chart-distribution | Chart/Distribution.hs | bsd-3-clause | continuousDistributionPlot :: [Double] -> PlotBars Double Double
continuousDistributionPlot xs = def & plot_bars_alignment .~ BarsRight
& plot_bars_spacing .~ BarsFixGap 0 0
& plot_bars_values .~ (zip binmaxes $ map (:[]) bindensity)
where sorted = sort xs
numberofbins = ceiling $ 2 * (fromIntegral $ length xs) ** (0.333) -- rice rule
min = minimum sorted
max = maximum sorted
range = max - min
binwidths = range / (fromIntegral numberofbins)
binmaxes = map (\x-> min + (fromIntegral x)*binwidths) [1..numberofbins]
binranges = zip (min:binmaxes) (binmaxes++[max])
bincounts = map fromIntegral $ allBinCounts binranges sorted
bindensity = map (\(x,y) -> y/x) $ zip (repeat binwidths) bincounts | 821 | continuousDistributionPlot :: [Double] -> PlotBars Double Double
continuousDistributionPlot xs = def & plot_bars_alignment .~ BarsRight
& plot_bars_spacing .~ BarsFixGap 0 0
& plot_bars_values .~ (zip binmaxes $ map (:[]) bindensity)
where sorted = sort xs
numberofbins = ceiling $ 2 * (fromIntegral $ length xs) ** (0.333) -- rice rule
min = minimum sorted
max = maximum sorted
range = max - min
binwidths = range / (fromIntegral numberofbins)
binmaxes = map (\x-> min + (fromIntegral x)*binwidths) [1..numberofbins]
binranges = zip (min:binmaxes) (binmaxes++[max])
bincounts = map fromIntegral $ allBinCounts binranges sorted
bindensity = map (\(x,y) -> y/x) $ zip (repeat binwidths) bincounts | 821 | continuousDistributionPlot xs = def & plot_bars_alignment .~ BarsRight
& plot_bars_spacing .~ BarsFixGap 0 0
& plot_bars_values .~ (zip binmaxes $ map (:[]) bindensity)
where sorted = sort xs
numberofbins = ceiling $ 2 * (fromIntegral $ length xs) ** (0.333) -- rice rule
min = minimum sorted
max = maximum sorted
range = max - min
binwidths = range / (fromIntegral numberofbins)
binmaxes = map (\x-> min + (fromIntegral x)*binwidths) [1..numberofbins]
binranges = zip (min:binmaxes) (binmaxes++[max])
bincounts = map fromIntegral $ allBinCounts binranges sorted
bindensity = map (\(x,y) -> y/x) $ zip (repeat binwidths) bincounts | 756 | false | true | 0 | 11 | 227 | 280 | 146 | 134 | null | null |
wavewave/hoodle-render | src/Graphics/Hoodle/Render/Type/Item.hs | bsd-2-clause | findStrkInRItem _ = Nothing | 27 | findStrkInRItem _ = Nothing | 27 | findStrkInRItem _ = Nothing | 27 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
thielema/wxhaskell | wxdirect/src/CompileHeader.hs | lgpl-2.1 | cTypeArg decl className arg
= case argType arg of
-- basic
Bool -> "TBool " ++ argName arg
Char -> "TChar " ++ argName arg
Int CLong -> "long " ++ argName arg
Int TimeT -> "time_t " ++ argName arg
Int SizeT -> "size_t " ++ argName arg
Int other -> "int " ++ argName arg
Void -> "void " ++ argName arg
Double -> "double " ++ argName arg
Float -> "float " ++ argName arg
Ptr Void -> "void* " ++ argName arg
Ptr t -> cRetType decl t ++ "* " ++ argName arg
-- typedefs
EventId -> "int"
-- special
Vector ctp -> "TVector" ++ ctypeSpec CInt ctp ++ argNameTuple
Point ctp -> "TPoint" ++ ctypeSpec CInt ctp ++ argNameTuple
Size ctp -> "TSize" ++ ctypeSpec CInt ctp ++ argNameTuple
String ctp -> "TString" ++ ctypeSpec CChar ctp ++ " " ++ argName arg
Rect ctp -> "TRect" ++ ctypeSpec CInt ctp ++ argNameTuple
Fun f -> "TClosureFun " ++ argName arg
ArrayString ctp -> "TArrayString" ++ ctypeSpec CChar ctp ++ " " ++ argName arg
ArrayObject name ctp -> "TArrayObject" ++ ctypeSpec CObject ctp ++ "(" ++ name ++ ") " ++ argName arg
RefObject name -> "TClassRef(" ++ name ++ ") " ++ argName arg
Object name | className == name -> "TSelf(" ++ name ++ ") " ++ argName arg
| otherwise -> "TClass(" ++ name ++ ") " ++ argName arg
-- temporary types (can this ever happen?)
StringLen -> "TStringLen " ++ argName arg
StringOut ctp -> "TStringOut" ++ ctypeSpec CChar ctp ++ " " ++ argName arg
ArrayLen -> "TArrayLen " ++ argName arg
ArrayStringOut ctp -> "TArrayStringOut" ++ ctypeSpec CChar ctp ++ " " ++ argName arg
ArrayObjectOut name ctp -> "TArrayObjectOut" ++ ctypeSpec CObject ctp ++ "(" ++ name ++ ") " ++ argName arg
PointOut ctp -> "TPointOut" ++ ctypeSpec CInt ctp ++ argNameTuple
SizeOut ctp -> "TSizeOut" ++ ctypeSpec CInt ctp ++ argNameTuple
VectorOut ctp -> "TVectorOut" ++ ctypeSpec CInt ctp ++ argNameTuple
RectOut ctp -> "TRectOut" ++ ctypeSpec CInt ctp ++ argNameTuple
{-
other -> traceError ("unknown argument type (" ++ show (argType arg) ++ ")") decl $
"ctypeSpec"
-}
where
argNameTuple
= "(" ++ concat (intersperse "," (argNames arg)) ++ ")" | 2,428 | cTypeArg decl className arg
= case argType arg of
-- basic
Bool -> "TBool " ++ argName arg
Char -> "TChar " ++ argName arg
Int CLong -> "long " ++ argName arg
Int TimeT -> "time_t " ++ argName arg
Int SizeT -> "size_t " ++ argName arg
Int other -> "int " ++ argName arg
Void -> "void " ++ argName arg
Double -> "double " ++ argName arg
Float -> "float " ++ argName arg
Ptr Void -> "void* " ++ argName arg
Ptr t -> cRetType decl t ++ "* " ++ argName arg
-- typedefs
EventId -> "int"
-- special
Vector ctp -> "TVector" ++ ctypeSpec CInt ctp ++ argNameTuple
Point ctp -> "TPoint" ++ ctypeSpec CInt ctp ++ argNameTuple
Size ctp -> "TSize" ++ ctypeSpec CInt ctp ++ argNameTuple
String ctp -> "TString" ++ ctypeSpec CChar ctp ++ " " ++ argName arg
Rect ctp -> "TRect" ++ ctypeSpec CInt ctp ++ argNameTuple
Fun f -> "TClosureFun " ++ argName arg
ArrayString ctp -> "TArrayString" ++ ctypeSpec CChar ctp ++ " " ++ argName arg
ArrayObject name ctp -> "TArrayObject" ++ ctypeSpec CObject ctp ++ "(" ++ name ++ ") " ++ argName arg
RefObject name -> "TClassRef(" ++ name ++ ") " ++ argName arg
Object name | className == name -> "TSelf(" ++ name ++ ") " ++ argName arg
| otherwise -> "TClass(" ++ name ++ ") " ++ argName arg
-- temporary types (can this ever happen?)
StringLen -> "TStringLen " ++ argName arg
StringOut ctp -> "TStringOut" ++ ctypeSpec CChar ctp ++ " " ++ argName arg
ArrayLen -> "TArrayLen " ++ argName arg
ArrayStringOut ctp -> "TArrayStringOut" ++ ctypeSpec CChar ctp ++ " " ++ argName arg
ArrayObjectOut name ctp -> "TArrayObjectOut" ++ ctypeSpec CObject ctp ++ "(" ++ name ++ ") " ++ argName arg
PointOut ctp -> "TPointOut" ++ ctypeSpec CInt ctp ++ argNameTuple
SizeOut ctp -> "TSizeOut" ++ ctypeSpec CInt ctp ++ argNameTuple
VectorOut ctp -> "TVectorOut" ++ ctypeSpec CInt ctp ++ argNameTuple
RectOut ctp -> "TRectOut" ++ ctypeSpec CInt ctp ++ argNameTuple
{-
other -> traceError ("unknown argument type (" ++ show (argType arg) ++ ")") decl $
"ctypeSpec"
-}
where
argNameTuple
= "(" ++ concat (intersperse "," (argNames arg)) ++ ")" | 2,428 | cTypeArg decl className arg
= case argType arg of
-- basic
Bool -> "TBool " ++ argName arg
Char -> "TChar " ++ argName arg
Int CLong -> "long " ++ argName arg
Int TimeT -> "time_t " ++ argName arg
Int SizeT -> "size_t " ++ argName arg
Int other -> "int " ++ argName arg
Void -> "void " ++ argName arg
Double -> "double " ++ argName arg
Float -> "float " ++ argName arg
Ptr Void -> "void* " ++ argName arg
Ptr t -> cRetType decl t ++ "* " ++ argName arg
-- typedefs
EventId -> "int"
-- special
Vector ctp -> "TVector" ++ ctypeSpec CInt ctp ++ argNameTuple
Point ctp -> "TPoint" ++ ctypeSpec CInt ctp ++ argNameTuple
Size ctp -> "TSize" ++ ctypeSpec CInt ctp ++ argNameTuple
String ctp -> "TString" ++ ctypeSpec CChar ctp ++ " " ++ argName arg
Rect ctp -> "TRect" ++ ctypeSpec CInt ctp ++ argNameTuple
Fun f -> "TClosureFun " ++ argName arg
ArrayString ctp -> "TArrayString" ++ ctypeSpec CChar ctp ++ " " ++ argName arg
ArrayObject name ctp -> "TArrayObject" ++ ctypeSpec CObject ctp ++ "(" ++ name ++ ") " ++ argName arg
RefObject name -> "TClassRef(" ++ name ++ ") " ++ argName arg
Object name | className == name -> "TSelf(" ++ name ++ ") " ++ argName arg
| otherwise -> "TClass(" ++ name ++ ") " ++ argName arg
-- temporary types (can this ever happen?)
StringLen -> "TStringLen " ++ argName arg
StringOut ctp -> "TStringOut" ++ ctypeSpec CChar ctp ++ " " ++ argName arg
ArrayLen -> "TArrayLen " ++ argName arg
ArrayStringOut ctp -> "TArrayStringOut" ++ ctypeSpec CChar ctp ++ " " ++ argName arg
ArrayObjectOut name ctp -> "TArrayObjectOut" ++ ctypeSpec CObject ctp ++ "(" ++ name ++ ") " ++ argName arg
PointOut ctp -> "TPointOut" ++ ctypeSpec CInt ctp ++ argNameTuple
SizeOut ctp -> "TSizeOut" ++ ctypeSpec CInt ctp ++ argNameTuple
VectorOut ctp -> "TVectorOut" ++ ctypeSpec CInt ctp ++ argNameTuple
RectOut ctp -> "TRectOut" ++ ctypeSpec CInt ctp ++ argNameTuple
{-
other -> traceError ("unknown argument type (" ++ show (argType arg) ++ ")") decl $
"ctypeSpec"
-}
where
argNameTuple
= "(" ++ concat (intersperse "," (argNames arg)) ++ ")" | 2,428 | false | false | 0 | 13 | 761 | 728 | 333 | 395 | null | null |
ford-prefect/haskell-gi | lib/Data/GI/CodeGen/Code.hs | lgpl-2.1 | moduleImports :: Text
moduleImports = T.unlines [
"import Data.GI.Base.ShortPrelude"
, "import qualified Data.GI.Base.ShortPrelude as SP"
, "import qualified Data.GI.Base.Overloading as O"
, "import qualified Prelude as P"
, ""
, "import qualified Data.GI.Base.Attributes as GI.Attributes"
, "import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr"
, "import qualified Data.GI.Base.GError as B.GError"
, "import qualified Data.GI.Base.GVariant as B.GVariant"
, "import qualified Data.GI.Base.GParamSpec as B.GParamSpec"
, "import qualified Data.GI.Base.CallStack as B.CallStack"
, "import qualified Data.Text as T"
, "import qualified Data.ByteString.Char8 as B"
, "import qualified Data.Map as Map"
, "import qualified Foreign.Ptr as FP" ] | 983 | moduleImports :: Text
moduleImports = T.unlines [
"import Data.GI.Base.ShortPrelude"
, "import qualified Data.GI.Base.ShortPrelude as SP"
, "import qualified Data.GI.Base.Overloading as O"
, "import qualified Prelude as P"
, ""
, "import qualified Data.GI.Base.Attributes as GI.Attributes"
, "import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr"
, "import qualified Data.GI.Base.GError as B.GError"
, "import qualified Data.GI.Base.GVariant as B.GVariant"
, "import qualified Data.GI.Base.GParamSpec as B.GParamSpec"
, "import qualified Data.GI.Base.CallStack as B.CallStack"
, "import qualified Data.Text as T"
, "import qualified Data.ByteString.Char8 as B"
, "import qualified Data.Map as Map"
, "import qualified Foreign.Ptr as FP" ] | 983 | moduleImports = T.unlines [
"import Data.GI.Base.ShortPrelude"
, "import qualified Data.GI.Base.ShortPrelude as SP"
, "import qualified Data.GI.Base.Overloading as O"
, "import qualified Prelude as P"
, ""
, "import qualified Data.GI.Base.Attributes as GI.Attributes"
, "import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr"
, "import qualified Data.GI.Base.GError as B.GError"
, "import qualified Data.GI.Base.GVariant as B.GVariant"
, "import qualified Data.GI.Base.GParamSpec as B.GParamSpec"
, "import qualified Data.GI.Base.CallStack as B.CallStack"
, "import qualified Data.Text as T"
, "import qualified Data.ByteString.Char8 as B"
, "import qualified Data.Map as Map"
, "import qualified Foreign.Ptr as FP" ] | 961 | false | true | 0 | 6 | 330 | 61 | 38 | 23 | null | null |
LambdaHack/LambdaHack | engine-src/Game/LambdaHack/Atomic/PosAtomicRead.hs | bsd-3-clause | lidOfPos :: PosAtomic -> Maybe LevelId
lidOfPos posAtomic =
case posAtomic of
PosSight lid _ -> Just lid
PosFidAndSight _ lid _ -> Just lid
PosSmell lid _ -> Just lid
PosSightLevels [] -> Nothing
PosSightLevels ((lid, _) : _) -> Just lid
PosFid{} -> Nothing
PosFidAndSer{} -> Nothing
PosSer -> Nothing
PosAll -> Nothing
PosNone -> Nothing
-- | Given the client, its perception and an atomic command, determine
-- if the client notices the command. | 490 | lidOfPos :: PosAtomic -> Maybe LevelId
lidOfPos posAtomic =
case posAtomic of
PosSight lid _ -> Just lid
PosFidAndSight _ lid _ -> Just lid
PosSmell lid _ -> Just lid
PosSightLevels [] -> Nothing
PosSightLevels ((lid, _) : _) -> Just lid
PosFid{} -> Nothing
PosFidAndSer{} -> Nothing
PosSer -> Nothing
PosAll -> Nothing
PosNone -> Nothing
-- | Given the client, its perception and an atomic command, determine
-- if the client notices the command. | 490 | lidOfPos posAtomic =
case posAtomic of
PosSight lid _ -> Just lid
PosFidAndSight _ lid _ -> Just lid
PosSmell lid _ -> Just lid
PosSightLevels [] -> Nothing
PosSightLevels ((lid, _) : _) -> Just lid
PosFid{} -> Nothing
PosFidAndSer{} -> Nothing
PosSer -> Nothing
PosAll -> Nothing
PosNone -> Nothing
-- | Given the client, its perception and an atomic command, determine
-- if the client notices the command. | 451 | false | true | 0 | 11 | 119 | 145 | 70 | 75 | null | null |
conal/hermit | src/HERMIT/Core.hs | bsd-2-clause | coercionSyntaxEq (AxiomInstCo con1 ind1 cos1) (AxiomInstCo con2 ind2 cos2) = con1 == con2 && ind1 == ind2 && all2 coercionSyntaxEq cos1 cos2 | 140 | coercionSyntaxEq (AxiomInstCo con1 ind1 cos1) (AxiomInstCo con2 ind2 cos2) = con1 == con2 && ind1 == ind2 && all2 coercionSyntaxEq cos1 cos2 | 140 | coercionSyntaxEq (AxiomInstCo con1 ind1 cos1) (AxiomInstCo con2 ind2 cos2) = con1 == con2 && ind1 == ind2 && all2 coercionSyntaxEq cos1 cos2 | 140 | false | false | 1 | 11 | 21 | 57 | 26 | 31 | null | null |
BioHaskell/hRosetta | Rosetta/Restraints.hs | bsd-3-clause | -- | Read restraints list from a given file, print out all error messages to stderr,
-- and yield list of restraints.
processRestraintsFile fname = do (restraints, errors) <- parseRestraintsFile fname
forM_ errors $ \msg -> hPutStrLn stderr $
concat [ "ERROR parsing restraints file "
, fname
, ": "
, BS.unpack msg ]
return restraints | 675 | processRestraintsFile fname = do (restraints, errors) <- parseRestraintsFile fname
forM_ errors $ \msg -> hPutStrLn stderr $
concat [ "ERROR parsing restraints file "
, fname
, ": "
, BS.unpack msg ]
return restraints | 555 | processRestraintsFile fname = do (restraints, errors) <- parseRestraintsFile fname
forM_ errors $ \msg -> hPutStrLn stderr $
concat [ "ERROR parsing restraints file "
, fname
, ": "
, BS.unpack msg ]
return restraints | 555 | true | false | 0 | 13 | 396 | 75 | 37 | 38 | null | null |
olsner/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | bh_RDR = mkVarUnqual (fsLit "b#") | 42 | bh_RDR = mkVarUnqual (fsLit "b#") | 42 | bh_RDR = mkVarUnqual (fsLit "b#") | 42 | false | false | 0 | 7 | 13 | 15 | 7 | 8 | null | null |
edi-smoljan/FER-PUH-2014-Hash | Parsing/HashParser.hs | bsd-3-clause | (<:>) :: Applicative f => f a -> f [a] -> f [a]
a <:> b = ((:) <$> a) <*> b | 76 | (<:>) :: Applicative f => f a -> f [a] -> f [a]
a <:> b = ((:) <$> a) <*> b | 75 | a <:> b = ((:) <$> a) <*> b | 27 | false | true | 0 | 11 | 22 | 66 | 33 | 33 | null | null |
rawlep/EQS | sourceCode/RprGD2.hs | mit | mmlRprGdEvl :: (RandomGen g) => Int ->
Int -> -- error search depth limit
[Vector Double] -> -- Either (Vector Double) [Double] -> -- the data in standardized for
Double ->
g ->
Maybe Bool -> -- negative slopes (temporarily used for turning on and off the mixture model)
Int ->
IO (Maybe ( (OModel,(Vector Double,[Int]) ) , [Double])) --ms
mmlRprGdEvl n dpt ys pp gen nSlopes mtd = -- mN std
mmlRprAuxGD n dpt m p (filter ((== mLen) . dim) ys) pp gen nSlopes mtd True -- ms -- mN std
where
p = 1 / pp
--- don need this claculation. we can filter out irelevant values
m = n `div` mtd
mLen = maybe 0 (\_ -> maximum $ map dim ys) (listToMaybe ys)
---------------------------------------------------------------------------------------------------
unStd :: (OModel,(Vector Double,[Int])) -> (OModel,(Vector Double,[Int]))
unStd (Omod (MkModel c b e ks d) ml,(vs,ys)) = (Omod (MkModel c b e (vunStdNorm' ks) d) ml,(vunStdNorm' vs,ys))
--- unSd :: (Maybe ( (OModel,(Vector Double,[Int]) ) , [Double]))
unSd ms =
case ms of
Nothing -> Nothing
Just (a,b) -> Just (unStd a, b)
------------ | 1,301 | mmlRprGdEvl :: (RandomGen g) => Int ->
Int -> -- error search depth limit
[Vector Double] -> -- Either (Vector Double) [Double] -> -- the data in standardized for
Double ->
g ->
Maybe Bool -> -- negative slopes (temporarily used for turning on and off the mixture model)
Int ->
IO (Maybe ( (OModel,(Vector Double,[Int]) ) , [Double]))
mmlRprGdEvl n dpt ys pp gen nSlopes mtd = -- mN std
mmlRprAuxGD n dpt m p (filter ((== mLen) . dim) ys) pp gen nSlopes mtd True -- ms -- mN std
where
p = 1 / pp
--- don need this claculation. we can filter out irelevant values
m = n `div` mtd
mLen = maybe 0 (\_ -> maximum $ map dim ys) (listToMaybe ys)
---------------------------------------------------------------------------------------------------
unStd :: (OModel,(Vector Double,[Int])) -> (OModel,(Vector Double,[Int]))
unStd (Omod (MkModel c b e ks d) ml,(vs,ys)) = (Omod (MkModel c b e (vunStdNorm' ks) d) ml,(vunStdNorm' vs,ys))
--- unSd :: (Maybe ( (OModel,(Vector Double,[Int]) ) , [Double]))
unSd ms =
case ms of
Nothing -> Nothing
Just (a,b) -> Just (unStd a, b)
------------ | 1,296 | mmlRprGdEvl n dpt ys pp gen nSlopes mtd = -- mN std
mmlRprAuxGD n dpt m p (filter ((== mLen) . dim) ys) pp gen nSlopes mtd True -- ms -- mN std
where
p = 1 / pp
--- don need this claculation. we can filter out irelevant values
m = n `div` mtd
mLen = maybe 0 (\_ -> maximum $ map dim ys) (listToMaybe ys)
---------------------------------------------------------------------------------------------------
unStd :: (OModel,(Vector Double,[Int])) -> (OModel,(Vector Double,[Int]))
unStd (Omod (MkModel c b e ks d) ml,(vs,ys)) = (Omod (MkModel c b e (vunStdNorm' ks) d) ml,(vunStdNorm' vs,ys))
--- unSd :: (Maybe ( (OModel,(Vector Double,[Int]) ) , [Double]))
unSd ms =
case ms of
Nothing -> Nothing
Just (a,b) -> Just (unStd a, b)
------------ | 932 | true | true | 4 | 20 | 403 | 391 | 211 | 180 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrelNames.hs | bsd-3-clause | mkThisGhcModule :: FastString -> Module
mkThisGhcModule m = mkModule thisGhcUnitId (mkModuleNameFS m) | 101 | mkThisGhcModule :: FastString -> Module
mkThisGhcModule m = mkModule thisGhcUnitId (mkModuleNameFS m) | 101 | mkThisGhcModule m = mkModule thisGhcUnitId (mkModuleNameFS m) | 61 | false | true | 0 | 7 | 11 | 29 | 14 | 15 | null | null |
xmonad/xmonad-contrib | XMonad/Config/LXQt.hs | bsd-3-clause | lxqtKeys XConfig{modMask = modm} = M.fromList
[ ((modm, xK_p), spawn "lxqt-runner")
, ((modm .|. shiftMask, xK_q), spawn "lxqt-leave")
] | 162 | lxqtKeys XConfig{modMask = modm} = M.fromList
[ ((modm, xK_p), spawn "lxqt-runner")
, ((modm .|. shiftMask, xK_q), spawn "lxqt-leave")
] | 162 | lxqtKeys XConfig{modMask = modm} = M.fromList
[ ((modm, xK_p), spawn "lxqt-runner")
, ((modm .|. shiftMask, xK_q), spawn "lxqt-leave")
] | 162 | false | false | 0 | 8 | 44 | 64 | 35 | 29 | null | null |
ghulette/logic | src/Prop.hs | mit | conjuncts (And p q) = conjuncts p ++ conjuncts q | 48 | conjuncts (And p q) = conjuncts p ++ conjuncts q | 48 | conjuncts (And p q) = conjuncts p ++ conjuncts q | 48 | false | false | 0 | 6 | 9 | 28 | 12 | 16 | null | null |
mpickering/hackage-server | MirrorClient.hs | bsd-3-clause | diffIndex :: [PkgIndexInfo] -> [PkgIndexInfo] -> [PkgIndexInfo]
diffIndex as bs =
[ pkg | OnlyInLeft pkg <- mergeBy (comparing mirrorPkgId)
(sortBy (comparing mirrorPkgId) as)
(sortBy (comparing mirrorPkgId) bs) ]
where
mirrorPkgId (PkgIndexInfo pkgid _ _ _) = pkgid | 354 | diffIndex :: [PkgIndexInfo] -> [PkgIndexInfo] -> [PkgIndexInfo]
diffIndex as bs =
[ pkg | OnlyInLeft pkg <- mergeBy (comparing mirrorPkgId)
(sortBy (comparing mirrorPkgId) as)
(sortBy (comparing mirrorPkgId) bs) ]
where
mirrorPkgId (PkgIndexInfo pkgid _ _ _) = pkgid | 354 | diffIndex as bs =
[ pkg | OnlyInLeft pkg <- mergeBy (comparing mirrorPkgId)
(sortBy (comparing mirrorPkgId) as)
(sortBy (comparing mirrorPkgId) bs) ]
where
mirrorPkgId (PkgIndexInfo pkgid _ _ _) = pkgid | 290 | false | true | 0 | 12 | 125 | 110 | 56 | 54 | null | null |
holzensp/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | translateOp _ FloatSubOp = Just (MO_F_Sub W32) | 55 | translateOp _ FloatSubOp = Just (MO_F_Sub W32) | 55 | translateOp _ FloatSubOp = Just (MO_F_Sub W32) | 55 | false | false | 0 | 7 | 15 | 20 | 9 | 11 | null | null |
YuichiroSato/GameOfSymbolGrounding | src/Data/Cell.hs | bsd-3-clause | isDead :: Cell -> Bool
isDead (Cell _ int) = life int < 0 | 57 | isDead :: Cell -> Bool
isDead (Cell _ int) = life int < 0 | 57 | isDead (Cell _ int) = life int < 0 | 34 | false | true | 0 | 7 | 13 | 33 | 16 | 17 | null | null |
brendanhay/gogol | gogol-mirror/gen/Network/Google/Resource/Mirror/Timeline/Patch.hs | mpl-2.0 | -- | The ID of the timeline item.
tpId :: Lens' TimelinePatch Text
tpId = lens _tpId (\ s a -> s{_tpId = a}) | 108 | tpId :: Lens' TimelinePatch Text
tpId = lens _tpId (\ s a -> s{_tpId = a}) | 74 | tpId = lens _tpId (\ s a -> s{_tpId = a}) | 41 | true | true | 0 | 9 | 23 | 40 | 22 | 18 | null | null |
siddhanathan/SWMMoutGetMB | src/Water/SWMM.hs | lgpl-3.0 | getVariables :: Get Variables
getVariables = do
size <- getInt
codeNumbers <- replicateM size getInt
return $ Variables size codeNumbers | 148 | getVariables :: Get Variables
getVariables = do
size <- getInt
codeNumbers <- replicateM size getInt
return $ Variables size codeNumbers | 148 | getVariables = do
size <- getInt
codeNumbers <- replicateM size getInt
return $ Variables size codeNumbers | 118 | false | true | 0 | 8 | 31 | 45 | 20 | 25 | null | null |
bergmark/purescript | src/Language/PureScript/TypeChecker/Monad.hs | mit | -- |
-- Temporarily bind a collection of names to values
--
bindNames :: (MonadState CheckState m) => M.Map (ModuleName, Ident) (Type, NameKind) -> m a -> m a
bindNames newNames action = do
orig <- get
modify $ \st -> st { checkEnv = (checkEnv st) { names = newNames `M.union` (names . checkEnv $ st) } }
a <- action
modify $ \st -> st { checkEnv = (checkEnv st) { names = names . checkEnv $ orig } }
return a
-- |
-- Temporarily bind a collection of names to types
-- | 479 | bindNames :: (MonadState CheckState m) => M.Map (ModuleName, Ident) (Type, NameKind) -> m a -> m a
bindNames newNames action = do
orig <- get
modify $ \st -> st { checkEnv = (checkEnv st) { names = newNames `M.union` (names . checkEnv $ st) } }
a <- action
modify $ \st -> st { checkEnv = (checkEnv st) { names = names . checkEnv $ orig } }
return a
-- |
-- Temporarily bind a collection of names to types
-- | 419 | bindNames newNames action = do
orig <- get
modify $ \st -> st { checkEnv = (checkEnv st) { names = newNames `M.union` (names . checkEnv $ st) } }
a <- action
modify $ \st -> st { checkEnv = (checkEnv st) { names = names . checkEnv $ orig } }
return a
-- |
-- Temporarily bind a collection of names to types
-- | 320 | true | true | 0 | 16 | 106 | 181 | 98 | 83 | null | null |
nomeata/led-display | src/Types.hs | bsd-3-clause | fRAME_DELAY = 1000000 `div` fPS | 31 | fRAME_DELAY = 1000000 `div` fPS | 31 | fRAME_DELAY = 1000000 `div` fPS | 31 | false | false | 1 | 5 | 4 | 18 | 8 | 10 | null | null |
LinusU/fbthrift | thrift/compiler/test/fixtures/namespace/gen-hs/My/Namespacing/Extend/Test/ExtendTestService.hs | apache-2.0 | decode_Check_args :: (Thrift.Protocol p, Thrift.Transport t) => p t -> BS.ByteString -> Check_args
decode_Check_args iprot bs = to_Check_args $ Thrift.deserializeVal iprot (Types.T_STRUCT typemap_Check_args) bs | 210 | decode_Check_args :: (Thrift.Protocol p, Thrift.Transport t) => p t -> BS.ByteString -> Check_args
decode_Check_args iprot bs = to_Check_args $ Thrift.deserializeVal iprot (Types.T_STRUCT typemap_Check_args) bs | 210 | decode_Check_args iprot bs = to_Check_args $ Thrift.deserializeVal iprot (Types.T_STRUCT typemap_Check_args) bs | 111 | false | true | 0 | 9 | 23 | 69 | 34 | 35 | null | null |
sanjoy/echoes | src/Codegen/X86.hs | gpl-3.0 | constToString _ (ClsrCodePtrC _) = error "not handled here " | 60 | constToString _ (ClsrCodePtrC _) = error "not handled here " | 60 | constToString _ (ClsrCodePtrC _) = error "not handled here " | 60 | false | false | 0 | 7 | 9 | 20 | 9 | 11 | null | null |
spacekitteh/smcghc | compiler/cmm/PprC.hs | bsd-3-clause | machRep_F_CType _ = panic "machRep_F_CType" | 45 | machRep_F_CType _ = panic "machRep_F_CType" | 45 | machRep_F_CType _ = panic "machRep_F_CType" | 45 | false | false | 0 | 5 | 6 | 12 | 5 | 7 | null | null |
mettekou/ghc | compiler/types/TyCoRep.hs | bsd-3-clause | tidyFreeTyCoVars :: TidyEnv -> [TyCoVar] -> TidyEnv
-- ^ Add the free 'TyVar's to the env in tidy form,
-- so that we can tidy the type they are free in
tidyFreeTyCoVars (full_occ_env, var_env) tyvars
= fst (tidyOpenTyCoVars (full_occ_env, var_env) tyvars) | 258 | tidyFreeTyCoVars :: TidyEnv -> [TyCoVar] -> TidyEnv
tidyFreeTyCoVars (full_occ_env, var_env) tyvars
= fst (tidyOpenTyCoVars (full_occ_env, var_env) tyvars) | 157 | tidyFreeTyCoVars (full_occ_env, var_env) tyvars
= fst (tidyOpenTyCoVars (full_occ_env, var_env) tyvars) | 105 | true | true | 0 | 8 | 42 | 52 | 29 | 23 | null | null |
verement/etamoo | src/MOO/Database/LambdaMOO.hs | bsd-3-clause | writeLog :: String -> DBParser ()
writeLog line = gets logger >>= \writeLog ->
liftIO (writeLog $ "LOADING: " <> T.pack line) | 127 | writeLog :: String -> DBParser ()
writeLog line = gets logger >>= \writeLog ->
liftIO (writeLog $ "LOADING: " <> T.pack line) | 127 | writeLog line = gets logger >>= \writeLog ->
liftIO (writeLog $ "LOADING: " <> T.pack line) | 93 | false | true | 0 | 11 | 23 | 54 | 26 | 28 | null | null |
bgold-cosmos/Tidal | src/Sound/Tidal/Params.hs | gpl-3.0 | velocitybus :: Pattern Int -> Pattern Double -> ControlPattern
velocitybus busid pat = (pF "velocity" pat) # (pI "^velocity" busid) | 131 | velocitybus :: Pattern Int -> Pattern Double -> ControlPattern
velocitybus busid pat = (pF "velocity" pat) # (pI "^velocity" busid) | 131 | velocitybus busid pat = (pF "velocity" pat) # (pI "^velocity" busid) | 68 | false | true | 2 | 8 | 19 | 57 | 25 | 32 | null | null |
trskop/cabal | Cabal/Distribution/PackageDescription/Parse.hs | bsd-3-clause | storeXFieldsBI _ _ = Nothing | 28 | storeXFieldsBI _ _ = Nothing | 28 | storeXFieldsBI _ _ = Nothing | 28 | false | false | 1 | 5 | 4 | 12 | 5 | 7 | null | null |
gambogi/csh-eval | src/CSH/Eval/DB/Statements.hs | mit | -- *** Membership
-- | Fetch all membership records associated with a specific record.
getMembershipsMemberIDP :: Word64 -- ^ Member ID
-> H.Stmt HP.Postgres
getMembershipsMemberIDP = [H.stmt|select * from "membership" where "member_id" = ?|] | 267 | getMembershipsMemberIDP :: Word64 -- ^ Member ID
-> H.Stmt HP.Postgres
getMembershipsMemberIDP = [H.stmt|select * from "membership" where "member_id" = ?|] | 179 | getMembershipsMemberIDP = [H.stmt|select * from "membership" where "member_id" = ?|] | 84 | true | true | 0 | 7 | 58 | 31 | 19 | 12 | null | null |
michalkonecny/polypaver | src/PolyPaver/DeriveBounds.hs | bsd-3-clause | scanHypothesis (IsIntRange lab t lower upper) intervals =
scanHypothesis (IsRange lab t lower upper) intervals | 114 | scanHypothesis (IsIntRange lab t lower upper) intervals =
scanHypothesis (IsRange lab t lower upper) intervals | 114 | scanHypothesis (IsIntRange lab t lower upper) intervals =
scanHypothesis (IsRange lab t lower upper) intervals | 114 | false | false | 0 | 7 | 18 | 40 | 19 | 21 | null | null |
rgaiacs/pandoc | src/Text/Pandoc/Writers/Docx.hs | gpl-2.0 | inlineToOpenXML opts (Strong lst) =
withTextProp (mknode "w:b" [] ()) $ inlinesToOpenXML opts lst | 99 | inlineToOpenXML opts (Strong lst) =
withTextProp (mknode "w:b" [] ()) $ inlinesToOpenXML opts lst | 99 | inlineToOpenXML opts (Strong lst) =
withTextProp (mknode "w:b" [] ()) $ inlinesToOpenXML opts lst | 99 | false | false | 0 | 9 | 15 | 43 | 20 | 23 | null | null |
NikolayS/postgrest | src/PostgREST/DbStructure.hs | mit | allRelations :: [Table] -> [Column] -> H.Tx P.Postgres s [Relation]
allRelations tabs cols = do
rels <- H.listEx $ [H.stmt|
SELECT ns1.nspname AS table_schema,
tab.relname AS table_name,
column_info.cols AS columns,
ns2.nspname AS foreign_table_schema,
other.relname AS foreign_table_name,
column_info.refs AS foreign_columns
FROM pg_constraint,
LATERAL (SELECT array_agg(cols.attname) AS cols,
array_agg(cols.attnum) AS nums,
array_agg(refs.attname) AS refs
FROM ( SELECT unnest(conkey) AS col, unnest(confkey) AS ref) k,
LATERAL (SELECT * FROM pg_attribute
WHERE attrelid = conrelid AND attnum = col)
AS cols,
LATERAL (SELECT * FROM pg_attribute
WHERE attrelid = confrelid AND attnum = ref)
AS refs)
AS column_info,
LATERAL (SELECT * FROM pg_namespace WHERE pg_namespace.oid = connamespace) AS ns1,
LATERAL (SELECT * FROM pg_class WHERE pg_class.oid = conrelid) AS tab,
LATERAL (SELECT * FROM pg_class WHERE pg_class.oid = confrelid) AS other,
LATERAL (SELECT * FROM pg_namespace WHERE pg_namespace.oid = other.relnamespace) AS ns2
WHERE confrelid != 0
ORDER BY (conrelid, column_info.nums)
|]
return $ mapMaybe (relationFromRow tabs cols) rels | 1,503 | allRelations :: [Table] -> [Column] -> H.Tx P.Postgres s [Relation]
allRelations tabs cols = do
rels <- H.listEx $ [H.stmt|
SELECT ns1.nspname AS table_schema,
tab.relname AS table_name,
column_info.cols AS columns,
ns2.nspname AS foreign_table_schema,
other.relname AS foreign_table_name,
column_info.refs AS foreign_columns
FROM pg_constraint,
LATERAL (SELECT array_agg(cols.attname) AS cols,
array_agg(cols.attnum) AS nums,
array_agg(refs.attname) AS refs
FROM ( SELECT unnest(conkey) AS col, unnest(confkey) AS ref) k,
LATERAL (SELECT * FROM pg_attribute
WHERE attrelid = conrelid AND attnum = col)
AS cols,
LATERAL (SELECT * FROM pg_attribute
WHERE attrelid = confrelid AND attnum = ref)
AS refs)
AS column_info,
LATERAL (SELECT * FROM pg_namespace WHERE pg_namespace.oid = connamespace) AS ns1,
LATERAL (SELECT * FROM pg_class WHERE pg_class.oid = conrelid) AS tab,
LATERAL (SELECT * FROM pg_class WHERE pg_class.oid = confrelid) AS other,
LATERAL (SELECT * FROM pg_namespace WHERE pg_namespace.oid = other.relnamespace) AS ns2
WHERE confrelid != 0
ORDER BY (conrelid, column_info.nums)
|]
return $ mapMaybe (relationFromRow tabs cols) rels | 1,503 | allRelations tabs cols = do
rels <- H.listEx $ [H.stmt|
SELECT ns1.nspname AS table_schema,
tab.relname AS table_name,
column_info.cols AS columns,
ns2.nspname AS foreign_table_schema,
other.relname AS foreign_table_name,
column_info.refs AS foreign_columns
FROM pg_constraint,
LATERAL (SELECT array_agg(cols.attname) AS cols,
array_agg(cols.attnum) AS nums,
array_agg(refs.attname) AS refs
FROM ( SELECT unnest(conkey) AS col, unnest(confkey) AS ref) k,
LATERAL (SELECT * FROM pg_attribute
WHERE attrelid = conrelid AND attnum = col)
AS cols,
LATERAL (SELECT * FROM pg_attribute
WHERE attrelid = confrelid AND attnum = ref)
AS refs)
AS column_info,
LATERAL (SELECT * FROM pg_namespace WHERE pg_namespace.oid = connamespace) AS ns1,
LATERAL (SELECT * FROM pg_class WHERE pg_class.oid = conrelid) AS tab,
LATERAL (SELECT * FROM pg_class WHERE pg_class.oid = confrelid) AS other,
LATERAL (SELECT * FROM pg_namespace WHERE pg_namespace.oid = other.relnamespace) AS ns2
WHERE confrelid != 0
ORDER BY (conrelid, column_info.nums)
|]
return $ mapMaybe (relationFromRow tabs cols) rels | 1,435 | false | true | 0 | 10 | 510 | 83 | 43 | 40 | null | null |
noschinl/cyp | src/Test/Info2/Cyp/Parser.hs | mit | funParser :: Parsec [Char] () ParseDeclTree
funParser = do
cs <- toEol1 <?> "Function definition"
return (FunDef cs) | 124 | funParser :: Parsec [Char] () ParseDeclTree
funParser = do
cs <- toEol1 <?> "Function definition"
return (FunDef cs) | 124 | funParser = do
cs <- toEol1 <?> "Function definition"
return (FunDef cs) | 80 | false | true | 0 | 9 | 25 | 46 | 22 | 24 | null | null |
MichaelBaker/proof-club | src/Schedule.hs | mit | meeting :: Month -> Int -> Integer -> Lister Section () -> Lister Meeting ()
meeting month day year list = record $ Meeting (extract list) month day year | 153 | meeting :: Month -> Int -> Integer -> Lister Section () -> Lister Meeting ()
meeting month day year list = record $ Meeting (extract list) month day year | 153 | meeting month day year list = record $ Meeting (extract list) month day year | 76 | false | true | 0 | 10 | 28 | 69 | 33 | 36 | null | null |
abakst/symmetry | checker/src/cloud-haskell-tests/FiniteLeader.hs | mit | start f = do self <- getSelfPid
ring_abc f self
Elected <- expect
return Congratulations | 127 | start f = do self <- getSelfPid
ring_abc f self
Elected <- expect
return Congratulations | 127 | start f = do self <- getSelfPid
ring_abc f self
Elected <- expect
return Congratulations | 127 | false | false | 1 | 8 | 53 | 41 | 15 | 26 | null | null |
lih/Epsilon | src/ELisp.hs | bsd-3-clause | lambdaSp = Special (mkSym "#<spe:lambda>") lambda
where lambda locals args = pure $ case fromELVal (List args) of
Just l -> Lambda (List (lambdaSp:args)) (foldr f (const (pure nil)) l)
where f (pat,expr) k v = case match pat (List v) of
Just l -> eval' (M.union l locals) expr
Nothing -> k v
Nothing -> error $ "Invalid syntax for lambda special form: "++show args | 438 | lambdaSp = Special (mkSym "#<spe:lambda>") lambda
where lambda locals args = pure $ case fromELVal (List args) of
Just l -> Lambda (List (lambdaSp:args)) (foldr f (const (pure nil)) l)
where f (pat,expr) k v = case match pat (List v) of
Just l -> eval' (M.union l locals) expr
Nothing -> k v
Nothing -> error $ "Invalid syntax for lambda special form: "++show args | 438 | lambdaSp = Special (mkSym "#<spe:lambda>") lambda
where lambda locals args = pure $ case fromELVal (List args) of
Just l -> Lambda (List (lambdaSp:args)) (foldr f (const (pure nil)) l)
where f (pat,expr) k v = case match pat (List v) of
Just l -> eval' (M.union l locals) expr
Nothing -> k v
Nothing -> error $ "Invalid syntax for lambda special form: "++show args | 438 | false | false | 0 | 17 | 139 | 180 | 87 | 93 | null | null |
vikraman/ghc | compiler/prelude/THNames.hs | bsd-3-clause | viewPName = libFun (fsLit "viewP") viewPIdKey | 47 | viewPName = libFun (fsLit "viewP") viewPIdKey | 47 | viewPName = libFun (fsLit "viewP") viewPIdKey | 47 | false | false | 0 | 7 | 7 | 17 | 8 | 9 | null | null |
leshchevds/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | qftAll :: FrozenSet String
qftAll =
ConstantUtils.mkSet [qftBool,
qftNumber,
qftNumberFloat,
qftOther,
qftText,
qftTimestamp,
qftUnit,
qftUnknown] | 309 | qftAll :: FrozenSet String
qftAll =
ConstantUtils.mkSet [qftBool,
qftNumber,
qftNumberFloat,
qftOther,
qftText,
qftTimestamp,
qftUnit,
qftUnknown] | 309 | qftAll =
ConstantUtils.mkSet [qftBool,
qftNumber,
qftNumberFloat,
qftOther,
qftText,
qftTimestamp,
qftUnit,
qftUnknown] | 282 | false | true | 0 | 6 | 177 | 43 | 25 | 18 | null | null |
peter-fogg/pardoc | pandoc.hs | gpl-2.0 | adjustImagePath :: FilePath -> [FilePath] -> Inline -> Inline
adjustImagePath dir paths (Image lab (src, tit))
| src `elem` paths = Image lab (dir ++ "/" ++ src, tit) | 169 | adjustImagePath :: FilePath -> [FilePath] -> Inline -> Inline
adjustImagePath dir paths (Image lab (src, tit))
| src `elem` paths = Image lab (dir ++ "/" ++ src, tit) | 169 | adjustImagePath dir paths (Image lab (src, tit))
| src `elem` paths = Image lab (dir ++ "/" ++ src, tit) | 107 | false | true | 0 | 9 | 31 | 78 | 41 | 37 | null | null |
sethfowler/pygmalion | src/Pygmalion/Database/IO.hs | bsd-3-clause | -- TODO FIXME
getDirectInclusions :: DBHandle -> SourceFile -> IO [SourceFile]
getDirectInclusions h sf = do
is <- execQuery h getDirectInclusionsStmt (Only $ stableHash sf)
return $ map unwrapSourceFile is | 211 | getDirectInclusions :: DBHandle -> SourceFile -> IO [SourceFile]
getDirectInclusions h sf = do
is <- execQuery h getDirectInclusionsStmt (Only $ stableHash sf)
return $ map unwrapSourceFile is | 196 | getDirectInclusions h sf = do
is <- execQuery h getDirectInclusionsStmt (Only $ stableHash sf)
return $ map unwrapSourceFile is | 131 | true | true | 0 | 11 | 34 | 67 | 32 | 35 | null | null |
research-team/robot-dream | src/Driver/Interpreter_v2.hs | mit | applyCommand (Cmd.Clockwise a) = startMotor True False a | 57 | applyCommand (Cmd.Clockwise a) = startMotor True False a | 57 | applyCommand (Cmd.Clockwise a) = startMotor True False a | 57 | false | false | 0 | 8 | 8 | 24 | 11 | 13 | null | null |
tolysz/prepare-ghcjs | spec-lts8/aeson/benchmarks/Typed/Manual.hs | bsd-3-clause | encodeViaValueB :: Result -> L.ByteString
encodeViaValueB = B.encode . B.toJSON | 79 | encodeViaValueB :: Result -> L.ByteString
encodeViaValueB = B.encode . B.toJSON | 79 | encodeViaValueB = B.encode . B.toJSON | 37 | false | true | 0 | 6 | 9 | 25 | 13 | 12 | null | null |
abakst/liquidhaskell | src/Language/Haskell/Liquid/Interactive/Types.hs | bsd-3-clause | status :: ExitCode -> Status
status ExitSuccess = ResOk | 59 | status :: ExitCode -> Status
status ExitSuccess = ResOk | 59 | status ExitSuccess = ResOk | 30 | false | true | 0 | 5 | 12 | 18 | 9 | 9 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/Distribution/Simple/Program.hs | bsd-3-clause | rawSystemProgramStdout :: Verbosity -> ConfiguredProgram
-> [ProgArg] -> IO String
rawSystemProgramStdout = getProgramOutput | 147 | rawSystemProgramStdout :: Verbosity -> ConfiguredProgram
-> [ProgArg] -> IO String
rawSystemProgramStdout = getProgramOutput | 147 | rawSystemProgramStdout = getProgramOutput | 41 | false | true | 0 | 8 | 35 | 29 | 15 | 14 | null | null |
gsdlab/clafer | src/Language/Clafer/Generator/Html.hs | mit | printModule (Module s (x:xs)) irMap html = printDeclaration x 0 irMap html [] ++ printModule (Module s xs) irMap html | 117 | printModule (Module s (x:xs)) irMap html = printDeclaration x 0 irMap html [] ++ printModule (Module s xs) irMap html | 117 | printModule (Module s (x:xs)) irMap html = printDeclaration x 0 irMap html [] ++ printModule (Module s xs) irMap html | 117 | false | false | 0 | 9 | 19 | 60 | 29 | 31 | null | null |
dmort27/HsSPE | Data/Phonology/RuleParsers.hs | bsd-3-clause | environment :: GenParser Char RuleState (Rule, Rule)
environment = envPart >>= \a -> (envTarget >> envPart >>= \b -> return (a, b)) | 131 | environment :: GenParser Char RuleState (Rule, Rule)
environment = envPart >>= \a -> (envTarget >> envPart >>= \b -> return (a, b)) | 131 | environment = envPart >>= \a -> (envTarget >> envPart >>= \b -> return (a, b)) | 78 | false | true | 3 | 11 | 21 | 64 | 33 | 31 | null | null |
josefs/autosar | oldARSim/ABS.hs | bsd-3-clause | seq_onoff onoff excl state on = do
rte_enter excl
s <- onoff on
rte_irvWrite state s
rte_exit excl
return () | 148 | seq_onoff onoff excl state on = do
rte_enter excl
s <- onoff on
rte_irvWrite state s
rte_exit excl
return () | 148 | seq_onoff onoff excl state on = do
rte_enter excl
s <- onoff on
rte_irvWrite state s
rte_exit excl
return () | 148 | false | false | 0 | 8 | 59 | 56 | 21 | 35 | null | null |
JoeyEremondi/utrecht-pv | Tests.hs | mit | singleUnsat :: (Statement, Expression) -> IO TestResult
singleUnsat testCase = z3Unsat $ z3wlpSingle testCase | 109 | singleUnsat :: (Statement, Expression) -> IO TestResult
singleUnsat testCase = z3Unsat $ z3wlpSingle testCase | 109 | singleUnsat testCase = z3Unsat $ z3wlpSingle testCase | 53 | false | true | 0 | 6 | 13 | 34 | 17 | 17 | null | null |
nikai3d/ce-challenges | moderate/column_names.hs | bsd-3-clause | columnnames :: Int -> String
columnnames 0 = "" | 48 | columnnames :: Int -> String
columnnames 0 = "" | 48 | columnnames 0 = "" | 18 | false | true | 0 | 7 | 9 | 24 | 10 | 14 | null | null |
kmate/HaRe | old/testing/merging/TakeDrop1.hs | bsd-3-clause | splitat _ _
= (error "PreludeList.take: negative argument",
error "PreludeList.drop: negative argument") | 119 | splitat _ _
= (error "PreludeList.take: negative argument",
error "PreludeList.drop: negative argument") | 119 | splitat _ _
= (error "PreludeList.take: negative argument",
error "PreludeList.drop: negative argument") | 119 | false | false | 0 | 6 | 26 | 23 | 11 | 12 | null | null |
erantapaa/haskell-pentago | src/Main.hs | mit | rotateQuadrant :: (Int, Int) -> RotateDirection -> Board -> Board
rotateQuadrant (dx, dy) direction board = foldr (swapSpace direction) board rotateCoordinates
where swapSpace :: RotateDirection -> ((Int, Int), (Int, Int)) -> Board -> Board
swapSpace Clockwise ((sx, sy), (tx, ty)) = offsetInsert sx sy tx ty
swapSpace Counter ((tx, ty), (sx, sy)) = offsetInsert sx sy tx ty
offsetInsert :: Int -> Int -> Int -> Int -> Board -> Board
offsetInsert sx sy tx ty = case board ! (sx+dx, sy+dy) of
Empty -> M.delete (tx+dx, ty+dy)
a -> M.insert (tx+dx, ty+dy) a | 955 | rotateQuadrant :: (Int, Int) -> RotateDirection -> Board -> Board
rotateQuadrant (dx, dy) direction board = foldr (swapSpace direction) board rotateCoordinates
where swapSpace :: RotateDirection -> ((Int, Int), (Int, Int)) -> Board -> Board
swapSpace Clockwise ((sx, sy), (tx, ty)) = offsetInsert sx sy tx ty
swapSpace Counter ((tx, ty), (sx, sy)) = offsetInsert sx sy tx ty
offsetInsert :: Int -> Int -> Int -> Int -> Board -> Board
offsetInsert sx sy tx ty = case board ! (sx+dx, sy+dy) of
Empty -> M.delete (tx+dx, ty+dy)
a -> M.insert (tx+dx, ty+dy) a | 955 | rotateQuadrant (dx, dy) direction board = foldr (swapSpace direction) board rotateCoordinates
where swapSpace :: RotateDirection -> ((Int, Int), (Int, Int)) -> Board -> Board
swapSpace Clockwise ((sx, sy), (tx, ty)) = offsetInsert sx sy tx ty
swapSpace Counter ((tx, ty), (sx, sy)) = offsetInsert sx sy tx ty
offsetInsert :: Int -> Int -> Int -> Int -> Board -> Board
offsetInsert sx sy tx ty = case board ! (sx+dx, sy+dy) of
Empty -> M.delete (tx+dx, ty+dy)
a -> M.insert (tx+dx, ty+dy) a | 889 | false | true | 0 | 12 | 493 | 284 | 153 | 131 | null | null |
spechub/Hets | Fpl/StatAna.hs | gpl-2.0 | getDDSorts :: [Annoted FplSortItem] -> [SORT]
getDDSorts = foldl (\ l si -> case item si of
FreeType (Datatype_decl s _ _) -> s : l
CaslSortItem _ -> l) [] | 159 | getDDSorts :: [Annoted FplSortItem] -> [SORT]
getDDSorts = foldl (\ l si -> case item si of
FreeType (Datatype_decl s _ _) -> s : l
CaslSortItem _ -> l) [] | 159 | getDDSorts = foldl (\ l si -> case item si of
FreeType (Datatype_decl s _ _) -> s : l
CaslSortItem _ -> l) [] | 113 | false | true | 0 | 13 | 34 | 86 | 41 | 45 | null | null |
ezyang/ghc | libraries/template-haskell/Language/Haskell/TH/Syntax.hs | bsd-3-clause | mk_tup_name :: Int -> NameSpace -> Name
mk_tup_name n_commas space
= Name occ (NameG space (mkPkgName "ghc-prim") tup_mod)
where
occ = mkOccName ('(' : replicate n_commas ',' ++ ")")
tup_mod = mkModName "GHC.Tuple"
-- Unboxed tuple data and type constructors
-- | Unboxed tuple data constructor | 307 | mk_tup_name :: Int -> NameSpace -> Name
mk_tup_name n_commas space
= Name occ (NameG space (mkPkgName "ghc-prim") tup_mod)
where
occ = mkOccName ('(' : replicate n_commas ',' ++ ")")
tup_mod = mkModName "GHC.Tuple"
-- Unboxed tuple data and type constructors
-- | Unboxed tuple data constructor | 307 | mk_tup_name n_commas space
= Name occ (NameG space (mkPkgName "ghc-prim") tup_mod)
where
occ = mkOccName ('(' : replicate n_commas ',' ++ ")")
tup_mod = mkModName "GHC.Tuple"
-- Unboxed tuple data and type constructors
-- | Unboxed tuple data constructor | 267 | false | true | 0 | 9 | 58 | 82 | 41 | 41 | null | null |
kadena-io/pact | src/Pact/Types/Info.hs | bsd-3-clause | parseRenderedInfo :: AP.Parser Info
parseRenderedInfo = peekChar >>= \c -> case c of
Nothing -> return (Info Nothing)
Just _ -> do
fOrI <- takeTill isColon
colon'
ln <- round <$> scientific
colon'
cn <- round <$> scientific
let delt = case fOrI of
"<interactive>"
-- heuristic: ln == 0 means Columns ...
| ln == 0 -> Columns cn 0
-- otherwise Lines, which reverses the 'succ' above
| otherwise -> Lines (pred ln) cn 0 0
f -> Directed (encodeUtf8 f) (pred ln) cn 0 0
return (Info (Just ("",(Parsed delt 0))))
where
colon' = void $ char ':'
isColon = (== ':') | 667 | parseRenderedInfo :: AP.Parser Info
parseRenderedInfo = peekChar >>= \c -> case c of
Nothing -> return (Info Nothing)
Just _ -> do
fOrI <- takeTill isColon
colon'
ln <- round <$> scientific
colon'
cn <- round <$> scientific
let delt = case fOrI of
"<interactive>"
-- heuristic: ln == 0 means Columns ...
| ln == 0 -> Columns cn 0
-- otherwise Lines, which reverses the 'succ' above
| otherwise -> Lines (pred ln) cn 0 0
f -> Directed (encodeUtf8 f) (pred ln) cn 0 0
return (Info (Just ("",(Parsed delt 0))))
where
colon' = void $ char ':'
isColon = (== ':') | 667 | parseRenderedInfo = peekChar >>= \c -> case c of
Nothing -> return (Info Nothing)
Just _ -> do
fOrI <- takeTill isColon
colon'
ln <- round <$> scientific
colon'
cn <- round <$> scientific
let delt = case fOrI of
"<interactive>"
-- heuristic: ln == 0 means Columns ...
| ln == 0 -> Columns cn 0
-- otherwise Lines, which reverses the 'succ' above
| otherwise -> Lines (pred ln) cn 0 0
f -> Directed (encodeUtf8 f) (pred ln) cn 0 0
return (Info (Just ("",(Parsed delt 0))))
where
colon' = void $ char ':'
isColon = (== ':') | 631 | false | true | 2 | 18 | 214 | 238 | 113 | 125 | null | null |
dimara/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | xenConfigDir :: String
xenConfigDir = AutoConf.xenConfigDir | 59 | xenConfigDir :: String
xenConfigDir = AutoConf.xenConfigDir | 59 | xenConfigDir = AutoConf.xenConfigDir | 36 | false | true | 0 | 6 | 5 | 20 | 8 | 12 | null | null |
hkupty/aura | src/Aura/Languages.hs | gpl-3.0 | trueRoot_1 :: Language -> String
trueRoot_1 = \case
Japanese -> "本当のrootユーザーとしてパッケージを作成するのが危険。続行?"
Polish -> "Nigdy nie powinieneś budować pakietów jako root. Na pewno kontynuować?"
Croatian -> "Pakete ne bi trebalo graditi sa root korisničkim računom. Nastaviti?"
Swedish -> "Det är starkt rekommenderat att INTE vara inloggad som root när man bygger paket. Vill du fortsätta ändå?"
German -> "Sie sollten niemals Pakete als der echte root-Nutzer bauen. Sind sie sicher, dass Sie dies tun wollen?"
Spanish -> "Nunca deberías construir paquetes como root real. ¿Estás de acuerdo con esto?"
Portuguese -> "Você nunca deveria compilar pacotes como usuário root. Deseja prosseguir mesmo assim?"
French -> "Il n'est pas recommandé de construire des paquets avec le compte root. Voulez-vous continuer ?"
Russian -> "Вам никогда не следует собирать пакеты под настоящим рутом. Договорились?"
Italian -> "Non si dovrebbero compilare pacchetti come root. Volete Continuare?"
Serbian -> "Не би требало градити пакете са правим root овлашћењима. Желите ли наставити?"
Norwegian -> "Du bør aldri bygge pakker som root. Er du helt sikker på at du vil gjøre dette?"
Indonesia -> "Paket tidak boleh dibangun oleh root. Apakah anda setuju dengan hal ini?"
_ -> "You should never build packages as the true root. Are you okay with this?"
-- This is for when the user decides to refrain from building afterall. | 1,492 | trueRoot_1 :: Language -> String
trueRoot_1 = \case
Japanese -> "本当のrootユーザーとしてパッケージを作成するのが危険。続行?"
Polish -> "Nigdy nie powinieneś budować pakietów jako root. Na pewno kontynuować?"
Croatian -> "Pakete ne bi trebalo graditi sa root korisničkim računom. Nastaviti?"
Swedish -> "Det är starkt rekommenderat att INTE vara inloggad som root när man bygger paket. Vill du fortsätta ändå?"
German -> "Sie sollten niemals Pakete als der echte root-Nutzer bauen. Sind sie sicher, dass Sie dies tun wollen?"
Spanish -> "Nunca deberías construir paquetes como root real. ¿Estás de acuerdo con esto?"
Portuguese -> "Você nunca deveria compilar pacotes como usuário root. Deseja prosseguir mesmo assim?"
French -> "Il n'est pas recommandé de construire des paquets avec le compte root. Voulez-vous continuer ?"
Russian -> "Вам никогда не следует собирать пакеты под настоящим рутом. Договорились?"
Italian -> "Non si dovrebbero compilare pacchetti come root. Volete Continuare?"
Serbian -> "Не би требало градити пакете са правим root овлашћењима. Желите ли наставити?"
Norwegian -> "Du bør aldri bygge pakker som root. Er du helt sikker på at du vil gjøre dette?"
Indonesia -> "Paket tidak boleh dibangun oleh root. Apakah anda setuju dengan hal ini?"
_ -> "You should never build packages as the true root. Are you okay with this?"
-- This is for when the user decides to refrain from building afterall. | 1,492 | trueRoot_1 = \case
Japanese -> "本当のrootユーザーとしてパッケージを作成するのが危険。続行?"
Polish -> "Nigdy nie powinieneś budować pakietów jako root. Na pewno kontynuować?"
Croatian -> "Pakete ne bi trebalo graditi sa root korisničkim računom. Nastaviti?"
Swedish -> "Det är starkt rekommenderat att INTE vara inloggad som root när man bygger paket. Vill du fortsätta ändå?"
German -> "Sie sollten niemals Pakete als der echte root-Nutzer bauen. Sind sie sicher, dass Sie dies tun wollen?"
Spanish -> "Nunca deberías construir paquetes como root real. ¿Estás de acuerdo con esto?"
Portuguese -> "Você nunca deveria compilar pacotes como usuário root. Deseja prosseguir mesmo assim?"
French -> "Il n'est pas recommandé de construire des paquets avec le compte root. Voulez-vous continuer ?"
Russian -> "Вам никогда не следует собирать пакеты под настоящим рутом. Договорились?"
Italian -> "Non si dovrebbero compilare pacchetti come root. Volete Continuare?"
Serbian -> "Не би требало градити пакете са правим root овлашћењима. Желите ли наставити?"
Norwegian -> "Du bør aldri bygge pakker som root. Er du helt sikker på at du vil gjøre dette?"
Indonesia -> "Paket tidak boleh dibangun oleh root. Apakah anda setuju dengan hal ini?"
_ -> "You should never build packages as the true root. Are you okay with this?"
-- This is for when the user decides to refrain from building afterall. | 1,459 | false | true | 14 | 5 | 316 | 129 | 52 | 77 | null | null |
simhu/cubical | CTT.hs | mit | showTer (SPair e0 e1) = "pair" <+> showTers [e0,e1] | 51 | showTer (SPair e0 e1) = "pair" <+> showTers [e0,e1] | 51 | showTer (SPair e0 e1) = "pair" <+> showTers [e0,e1] | 51 | false | false | 0 | 7 | 8 | 30 | 15 | 15 | null | null |
alphaHeavy/lzma-enumerator | tests/Main.hs | bsd-3-clause | dropAll :: Monad m => E.Iteratee a m ()
dropAll = EL.dropWhile (const True) | 75 | dropAll :: Monad m => E.Iteratee a m ()
dropAll = EL.dropWhile (const True) | 75 | dropAll = EL.dropWhile (const True) | 35 | false | true | 0 | 7 | 13 | 40 | 19 | 21 | null | null |
OpenXT/network | nws/NetworkFirewall.hs | gpl-2.0 | applyFirewallRules vif bridge = void $ configGetBridgeFiltering >>= \x -> when x $ do
let [domid, devid] = domAndDevIdFromVif vif
uuidM <- domidToUuid domid
unless (uuidM == Nothing) $ do
let uuid = fromJust uuidM
when (bridge =~ "brbridged" :: Bool) $ do -- hack to detect it's a bridged network
initChain vifChainIn
initChain vifChainOut
-- add packet destined to vif must be checked by vif input filters i.e, frame that'll leave the bridge and vif port on the bridge should go through
-- input filtering rules for that vif. These rules will not get to run when the vif is on a shared/NAT'ed network as you can't filter the packets
-- based on phys-out interface
insertRuleIfMissing bridgeChain (printf "%s -m physdev %s -j %s" bridgeOut vifIfaceOut vifChainIn)
-- any packet coming in from vif and out bridge must first be checked by vif chain out
insertRuleIfMissing "FORWARD" (printf "%s -m physdev %s -j %s" bridgeIn vifIfaceIn vifChainOut)
-- now that the framework is setup, process the firewall rules defined by the user
(exitCode, out, _) <- readProcessWithExitCode_closeFds "db-nodes-dom0" [(fwConfRoot uuid)] []
mapM_ (processRule uuid) (sort $ words out) -- sort the rule indices before applying them
return ()
where
bridgeIn = "-i " ++ bridge
bridgeOut = "-o " ++ bridge
bridgeChain = "FORWARD_" ++ bridge
vifIfaceIn = "--physdev-in " ++ vif
vifIfaceOut = "--physdev-is-bridged --physdev-out " ++ vif
vifChain = "FORWARD_" ++ vif
vifChainIn = "FORWARD_" ++ vif ++ "_IN"
vifChainOut = "FORWARD_" ++ vif ++ "_OUT"
fwConfRoot uuid = "/firewall-rules/" ++ uuid
processRule uuid index = void $ do
direction <- (map toLower) <$> strip <$> (dbReadDom0 (printf "%s/%s/direction" (fwConfRoot uuid) index))
remoteIp <- strip <$> dbReadDom0 (printf "%s/%s/remote-ip" (fwConfRoot uuid) index)
extra <- strip <$> dbReadDom0 (printf "%s/%s/extra" (fwConfRoot uuid) index)
unless (null direction || null remoteIp) $ void $ do
case () of
_ | (direction == "in") -> logAndExecuteIptables $ printf "-I %s %s --source %s -j DROP" vifChainIn extra remoteIp
| (direction == "out") -> logAndExecuteIptables $ printf "-I %s %s --destination %s -j DROP" vifChainOut extra remoteIp
| otherwise -> debug $ printf "unexpected direction - '%s'" direction
dbNodesDom0 path = do
(exitCode, out, _) <- readProcessWithExitCode_closeFds "db-nodes-dom0" [path] []
return out
dbReadDom0 path = do
(exitCode, out, _) <- readProcessWithExitCode_closeFds "db-read-dom0" [path] []
return out | 2,969 | applyFirewallRules vif bridge = void $ configGetBridgeFiltering >>= \x -> when x $ do
let [domid, devid] = domAndDevIdFromVif vif
uuidM <- domidToUuid domid
unless (uuidM == Nothing) $ do
let uuid = fromJust uuidM
when (bridge =~ "brbridged" :: Bool) $ do -- hack to detect it's a bridged network
initChain vifChainIn
initChain vifChainOut
-- add packet destined to vif must be checked by vif input filters i.e, frame that'll leave the bridge and vif port on the bridge should go through
-- input filtering rules for that vif. These rules will not get to run when the vif is on a shared/NAT'ed network as you can't filter the packets
-- based on phys-out interface
insertRuleIfMissing bridgeChain (printf "%s -m physdev %s -j %s" bridgeOut vifIfaceOut vifChainIn)
-- any packet coming in from vif and out bridge must first be checked by vif chain out
insertRuleIfMissing "FORWARD" (printf "%s -m physdev %s -j %s" bridgeIn vifIfaceIn vifChainOut)
-- now that the framework is setup, process the firewall rules defined by the user
(exitCode, out, _) <- readProcessWithExitCode_closeFds "db-nodes-dom0" [(fwConfRoot uuid)] []
mapM_ (processRule uuid) (sort $ words out) -- sort the rule indices before applying them
return ()
where
bridgeIn = "-i " ++ bridge
bridgeOut = "-o " ++ bridge
bridgeChain = "FORWARD_" ++ bridge
vifIfaceIn = "--physdev-in " ++ vif
vifIfaceOut = "--physdev-is-bridged --physdev-out " ++ vif
vifChain = "FORWARD_" ++ vif
vifChainIn = "FORWARD_" ++ vif ++ "_IN"
vifChainOut = "FORWARD_" ++ vif ++ "_OUT"
fwConfRoot uuid = "/firewall-rules/" ++ uuid
processRule uuid index = void $ do
direction <- (map toLower) <$> strip <$> (dbReadDom0 (printf "%s/%s/direction" (fwConfRoot uuid) index))
remoteIp <- strip <$> dbReadDom0 (printf "%s/%s/remote-ip" (fwConfRoot uuid) index)
extra <- strip <$> dbReadDom0 (printf "%s/%s/extra" (fwConfRoot uuid) index)
unless (null direction || null remoteIp) $ void $ do
case () of
_ | (direction == "in") -> logAndExecuteIptables $ printf "-I %s %s --source %s -j DROP" vifChainIn extra remoteIp
| (direction == "out") -> logAndExecuteIptables $ printf "-I %s %s --destination %s -j DROP" vifChainOut extra remoteIp
| otherwise -> debug $ printf "unexpected direction - '%s'" direction
dbNodesDom0 path = do
(exitCode, out, _) <- readProcessWithExitCode_closeFds "db-nodes-dom0" [path] []
return out
dbReadDom0 path = do
(exitCode, out, _) <- readProcessWithExitCode_closeFds "db-read-dom0" [path] []
return out | 2,969 | applyFirewallRules vif bridge = void $ configGetBridgeFiltering >>= \x -> when x $ do
let [domid, devid] = domAndDevIdFromVif vif
uuidM <- domidToUuid domid
unless (uuidM == Nothing) $ do
let uuid = fromJust uuidM
when (bridge =~ "brbridged" :: Bool) $ do -- hack to detect it's a bridged network
initChain vifChainIn
initChain vifChainOut
-- add packet destined to vif must be checked by vif input filters i.e, frame that'll leave the bridge and vif port on the bridge should go through
-- input filtering rules for that vif. These rules will not get to run when the vif is on a shared/NAT'ed network as you can't filter the packets
-- based on phys-out interface
insertRuleIfMissing bridgeChain (printf "%s -m physdev %s -j %s" bridgeOut vifIfaceOut vifChainIn)
-- any packet coming in from vif and out bridge must first be checked by vif chain out
insertRuleIfMissing "FORWARD" (printf "%s -m physdev %s -j %s" bridgeIn vifIfaceIn vifChainOut)
-- now that the framework is setup, process the firewall rules defined by the user
(exitCode, out, _) <- readProcessWithExitCode_closeFds "db-nodes-dom0" [(fwConfRoot uuid)] []
mapM_ (processRule uuid) (sort $ words out) -- sort the rule indices before applying them
return ()
where
bridgeIn = "-i " ++ bridge
bridgeOut = "-o " ++ bridge
bridgeChain = "FORWARD_" ++ bridge
vifIfaceIn = "--physdev-in " ++ vif
vifIfaceOut = "--physdev-is-bridged --physdev-out " ++ vif
vifChain = "FORWARD_" ++ vif
vifChainIn = "FORWARD_" ++ vif ++ "_IN"
vifChainOut = "FORWARD_" ++ vif ++ "_OUT"
fwConfRoot uuid = "/firewall-rules/" ++ uuid
processRule uuid index = void $ do
direction <- (map toLower) <$> strip <$> (dbReadDom0 (printf "%s/%s/direction" (fwConfRoot uuid) index))
remoteIp <- strip <$> dbReadDom0 (printf "%s/%s/remote-ip" (fwConfRoot uuid) index)
extra <- strip <$> dbReadDom0 (printf "%s/%s/extra" (fwConfRoot uuid) index)
unless (null direction || null remoteIp) $ void $ do
case () of
_ | (direction == "in") -> logAndExecuteIptables $ printf "-I %s %s --source %s -j DROP" vifChainIn extra remoteIp
| (direction == "out") -> logAndExecuteIptables $ printf "-I %s %s --destination %s -j DROP" vifChainOut extra remoteIp
| otherwise -> debug $ printf "unexpected direction - '%s'" direction
dbNodesDom0 path = do
(exitCode, out, _) <- readProcessWithExitCode_closeFds "db-nodes-dom0" [path] []
return out
dbReadDom0 path = do
(exitCode, out, _) <- readProcessWithExitCode_closeFds "db-read-dom0" [path] []
return out | 2,969 | false | false | 18 | 20 | 886 | 687 | 314 | 373 | null | null |
ekmett/unboxed-containers | Benchmark.hs | bsd-3-clause | testU rs = do
s <- eval "constructing USet " $ U.fromList rs
forceList "USet.member " $ map (flip U.member s) rs
{-
testI rs = do
s <- eval "constructing IntSet " $ I.fromList rs
forceList "IntSet.member " $ map (flip I.member s) rs
-} | 288 | testU rs = do
s <- eval "constructing USet " $ U.fromList rs
forceList "USet.member " $ map (flip U.member s) rs
{-
testI rs = do
s <- eval "constructing IntSet " $ I.fromList rs
forceList "IntSet.member " $ map (flip I.member s) rs
-} | 288 | testU rs = do
s <- eval "constructing USet " $ U.fromList rs
forceList "USet.member " $ map (flip U.member s) rs
{-
testI rs = do
s <- eval "constructing IntSet " $ I.fromList rs
forceList "IntSet.member " $ map (flip I.member s) rs
-} | 288 | false | false | 0 | 11 | 98 | 54 | 24 | 30 | null | null |
onponomarev/ganeti | src/Ganeti/HTools/Backend/Luxi.hs | bsd-2-clause | parseNode _ v = fail ("Invalid node query result: " ++ show v) | 62 | parseNode _ v = fail ("Invalid node query result: " ++ show v) | 62 | parseNode _ v = fail ("Invalid node query result: " ++ show v) | 62 | false | false | 0 | 8 | 12 | 24 | 11 | 13 | null | null |
mattias-lundell/timber-llvm | src/Termred.hs | bsd-3-clause | redExp env (ETempl x t te c) = liftM (ETempl x t te) (redCmd env c) | 70 | redExp env (ETempl x t te c) = liftM (ETempl x t te) (redCmd env c) | 70 | redExp env (ETempl x t te c) = liftM (ETempl x t te) (redCmd env c) | 70 | false | false | 0 | 7 | 18 | 46 | 22 | 24 | null | null |
mariefarrell/Hets | Common/ProofUtils.hs | gpl-2.0 | -- | generically disambiguate lists with names
genericDisambigSens :: Int -> (a -> String) -> (String -> a -> a)
-> Set.Set String -> [a] -> [a]
genericDisambigSens _ _ _ _ [] = [] | 200 | genericDisambigSens :: Int -> (a -> String) -> (String -> a -> a)
-> Set.Set String -> [a] -> [a]
genericDisambigSens _ _ _ _ [] = [] | 153 | genericDisambigSens _ _ _ _ [] = [] | 35 | true | true | 0 | 10 | 54 | 76 | 40 | 36 | null | null |
lukemaurer/sequent-core | src/Language/SequentCore/Syntax.hs | bsd-3-clause | -- | Peel a sequence of up to @n@ arguments off the front of a list of frames.
-- If @fs@ does not start with an application frame, then
-- @collectArgsUpTo n fs == ([], fs)@.
collectArgsUpTo :: Int -> [Frame b] -> ([Term b], [Frame b])
collectArgsUpTo n fs
= go n fs
where
go 0 fs
= ([], fs)
go n (App arg : fs)
= (arg : args, k')
where (args, k') = go (n - 1) fs
go _ fs
= ([], fs)
-- | Divide a list of terms into an initial sublist of types and the remaining
-- terms. | 513 | collectArgsUpTo :: Int -> [Frame b] -> ([Term b], [Frame b])
collectArgsUpTo n fs
= go n fs
where
go 0 fs
= ([], fs)
go n (App arg : fs)
= (arg : args, k')
where (args, k') = go (n - 1) fs
go _ fs
= ([], fs)
-- | Divide a list of terms into an initial sublist of types and the remaining
-- terms. | 337 | collectArgsUpTo n fs
= go n fs
where
go 0 fs
= ([], fs)
go n (App arg : fs)
= (arg : args, k')
where (args, k') = go (n - 1) fs
go _ fs
= ([], fs)
-- | Divide a list of terms into an initial sublist of types and the remaining
-- terms. | 276 | true | true | 2 | 12 | 145 | 157 | 83 | 74 | null | null |
tippenein/bookshelf | src/Lib.hs | mit | maybeLookup :: Maybe Int -> Map.Map Int a -> Maybe a
maybeLookup midx m = case midx of
Nothing -> Nothing
Just idx -> Map.lookup idx m | 138 | maybeLookup :: Maybe Int -> Map.Map Int a -> Maybe a
maybeLookup midx m = case midx of
Nothing -> Nothing
Just idx -> Map.lookup idx m | 138 | maybeLookup midx m = case midx of
Nothing -> Nothing
Just idx -> Map.lookup idx m | 85 | false | true | 3 | 8 | 30 | 61 | 28 | 33 | null | null |
tjakway/ghcjvm | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | isHoleCt:: Ct -> Bool
isHoleCt (CHoleCan {}) = True | 51 | isHoleCt:: Ct -> Bool
isHoleCt (CHoleCan {}) = True | 51 | isHoleCt (CHoleCan {}) = True | 29 | false | true | 1 | 8 | 8 | 31 | 14 | 17 | null | null |
kishoredbn/barrelfish | hake/HakeTypes.hs | mit | frPath (Dep _ _ p) = p | 22 | frPath (Dep _ _ p) = p | 22 | frPath (Dep _ _ p) = p | 22 | false | false | 0 | 6 | 6 | 20 | 9 | 11 | null | null |
mrakgr/futhark | src/Futhark/CodeGen/ImpGen.hs | bsd-3-clause | declaringLoopVar :: VName -> ImpM op a -> ImpM op a
declaringLoopVar name =
withPrimVar name int32 | 100 | declaringLoopVar :: VName -> ImpM op a -> ImpM op a
declaringLoopVar name =
withPrimVar name int32 | 100 | declaringLoopVar name =
withPrimVar name int32 | 48 | false | true | 0 | 7 | 18 | 37 | 17 | 20 | null | null |
brendanhay/gogol | gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/WorkflowTemplates/List.hs | mpl-2.0 | -- | Optional. The page token, returned by a previous call, to request the
-- next page of results.
prwtlPageToken :: Lens' ProjectsRegionsWorkflowTemplatesList (Maybe Text)
prwtlPageToken
= lens _prwtlPageToken
(\ s a -> s{_prwtlPageToken = a}) | 253 | prwtlPageToken :: Lens' ProjectsRegionsWorkflowTemplatesList (Maybe Text)
prwtlPageToken
= lens _prwtlPageToken
(\ s a -> s{_prwtlPageToken = a}) | 153 | prwtlPageToken
= lens _prwtlPageToken
(\ s a -> s{_prwtlPageToken = a}) | 79 | true | true | 1 | 9 | 43 | 52 | 26 | 26 | null | null |
mzini/qlogic | Qlogic/Formula.hs | gpl-3.0 | size Top = 1 | 20 | size Top = 1 | 20 | size Top = 1 | 20 | false | false | 0 | 5 | 11 | 9 | 4 | 5 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_COLOR_MATRIX :: GLenum
gl_COLOR_MATRIX = 0x80B1 | 50 | gl_COLOR_MATRIX :: GLenum
gl_COLOR_MATRIX = 0x80B1 | 50 | gl_COLOR_MATRIX = 0x80B1 | 24 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
hferreiro/replay | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | getAmode' is32Bit (CmmMachOp (MO_Add rep) [a@(CmmMachOp (MO_Shl _) _),
b@(CmmLit _)])
= getAmode' is32Bit (CmmMachOp (MO_Add rep) [b,a]) | 172 | getAmode' is32Bit (CmmMachOp (MO_Add rep) [a@(CmmMachOp (MO_Shl _) _),
b@(CmmLit _)])
= getAmode' is32Bit (CmmMachOp (MO_Add rep) [b,a]) | 172 | getAmode' is32Bit (CmmMachOp (MO_Add rep) [a@(CmmMachOp (MO_Shl _) _),
b@(CmmLit _)])
= getAmode' is32Bit (CmmMachOp (MO_Add rep) [b,a]) | 172 | false | false | 0 | 12 | 53 | 85 | 43 | 42 | null | null |
AlexeyRaga/eta | compiler/ETA/Main/HscTypes.hs | bsd-3-clause | noIfaceTrustInfo :: IfaceTrustInfo
noIfaceTrustInfo = setSafeMode Sf_None | 73 | noIfaceTrustInfo :: IfaceTrustInfo
noIfaceTrustInfo = setSafeMode Sf_None | 73 | noIfaceTrustInfo = setSafeMode Sf_None | 38 | false | true | 0 | 6 | 6 | 20 | 8 | 12 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2017/M12/D07/Solution.hs | mit | deleteRecsStmt =
[sql|DELETE FROM recommendation_publish WHERE source_article_id=?|] | 87 | deleteRecsStmt =
[sql|DELETE FROM recommendation_publish WHERE source_article_id=?|] | 87 | deleteRecsStmt =
[sql|DELETE FROM recommendation_publish WHERE source_article_id=?|] | 87 | false | false | 1 | 5 | 9 | 14 | 7 | 7 | null | null |
lipemorais/haskellando | RaytracerEtapa4_1113331018.hs | mit | --Multiplicação por escalar: a(x1, y1, z1) = (ax1, ay1, az1)
($*) :: Vetor3D -> Double -> Vetor3D
Coordenada(x1, y1, z1) $* escalar = Coordenada(x1 * escalar, y1 * escalar, z1 * escalar) | 186 | ($*) :: Vetor3D -> Double -> Vetor3D
Coordenada(x1, y1, z1) $* escalar = Coordenada(x1 * escalar, y1 * escalar, z1 * escalar) | 125 | Coordenada(x1, y1, z1) $* escalar = Coordenada(x1 * escalar, y1 * escalar, z1 * escalar) | 88 | true | true | 0 | 7 | 31 | 67 | 36 | 31 | null | null |
peterbecich/haskell-programming-first-principles | src/Chapter15.hs | bsd-3-clause | three = one `mappend` one `mappend` one | 39 | three = one `mappend` one `mappend` one | 39 | three = one `mappend` one `mappend` one | 39 | false | false | 0 | 6 | 6 | 18 | 11 | 7 | null | null |
phaazon/GLFW-b | Graphics/UI/GLFW.hs | bsd-2-clause | getWindowClientAPI :: Window -> IO ClientAPI
getWindowClientAPI win =
fromC `fmap` c'glfwGetWindowAttrib (toC win) c'GLFW_CLIENT_API | 136 | getWindowClientAPI :: Window -> IO ClientAPI
getWindowClientAPI win =
fromC `fmap` c'glfwGetWindowAttrib (toC win) c'GLFW_CLIENT_API | 136 | getWindowClientAPI win =
fromC `fmap` c'glfwGetWindowAttrib (toC win) c'GLFW_CLIENT_API | 91 | false | true | 0 | 8 | 18 | 38 | 19 | 19 | null | null |
MateVM/harpy | Harpy/X86CodeGen.hs | gpl-2.0 | x86_prefetch2_regp :: Word8 -> CodeGen e s ()
x86_prefetch2_regp r = x86_prefetch_regp 3 r | 90 | x86_prefetch2_regp :: Word8 -> CodeGen e s ()
x86_prefetch2_regp r = x86_prefetch_regp 3 r | 90 | x86_prefetch2_regp r = x86_prefetch_regp 3 r | 44 | false | true | 0 | 7 | 13 | 32 | 15 | 17 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.