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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mariefarrell/Hets | Maude/PreComorphism.hs | gpl-2.0 | {- | generates the predicates asserting the "true" sort of the operator if all
the arguments have the correct sort -}
ops2predPremises :: IdMap -> [MSym.Symbol] -> Int
-> ([CAS.CASLTERM], [CAS.CASLFORMULA])
ops2predPremises im (MSym.Sort s : ss) i = (var : terms, form : forms)
where s' = token2id s
kind = Map.findWithDefault (errorId "mb of op as predicate")
s' im
pred_type = CAS.Pred_type [kind] nullRange
pred_name = CAS.Qual_pred_name s' pred_type nullRange
var = newVarIndex i kind
form = CAS.Predication pred_name [var] nullRange
(terms, forms) = ops2predPremises im ss (i + 1) | 708 | ops2predPremises :: IdMap -> [MSym.Symbol] -> Int
-> ([CAS.CASLTERM], [CAS.CASLFORMULA])
ops2predPremises im (MSym.Sort s : ss) i = (var : terms, form : forms)
where s' = token2id s
kind = Map.findWithDefault (errorId "mb of op as predicate")
s' im
pred_type = CAS.Pred_type [kind] nullRange
pred_name = CAS.Qual_pred_name s' pred_type nullRange
var = newVarIndex i kind
form = CAS.Predication pred_name [var] nullRange
(terms, forms) = ops2predPremises im ss (i + 1) | 590 | ops2predPremises im (MSym.Sort s : ss) i = (var : terms, form : forms)
where s' = token2id s
kind = Map.findWithDefault (errorId "mb of op as predicate")
s' im
pred_type = CAS.Pred_type [kind] nullRange
pred_name = CAS.Qual_pred_name s' pred_type nullRange
var = newVarIndex i kind
form = CAS.Predication pred_name [var] nullRange
(terms, forms) = ops2predPremises im ss (i + 1) | 499 | true | true | 0 | 13 | 214 | 196 | 102 | 94 | null | null |
juhp/leksah | src/IDE/Package.hs | gpl-2.0 | backgroundBuildToggled :: IDEAction
backgroundBuildToggled = do
toggled <- getBackgroundBuildToggled
modifyIDE_ (\ide -> ide{prefs = (prefs ide){backgroundBuild= toggled}}) | 180 | backgroundBuildToggled :: IDEAction
backgroundBuildToggled = do
toggled <- getBackgroundBuildToggled
modifyIDE_ (\ide -> ide{prefs = (prefs ide){backgroundBuild= toggled}}) | 180 | backgroundBuildToggled = do
toggled <- getBackgroundBuildToggled
modifyIDE_ (\ide -> ide{prefs = (prefs ide){backgroundBuild= toggled}}) | 144 | false | true | 0 | 15 | 24 | 61 | 30 | 31 | null | null |
mitochon/hexercise | src/haskellbook/ch23/ch23.five.hs | mit | -- the state is also the value you return
get :: State s s
get = State $ \s -> (s,s) | 84 | get :: State s s
get = State $ \s -> (s,s) | 42 | get = State $ \s -> (s,s) | 25 | true | true | 1 | 8 | 20 | 36 | 18 | 18 | null | null |
brendanhay/gogol | gogol-bigquery/gen/Network/Google/BigQuery/Types/Product.hs | mpl-2.0 | -- | [Optional] Range of a sheet to query from. Only used when non-empty.
-- Typical format: sheet_name!top_left_cell_id:bottom_right_cell_id For
-- example: sheet1!A1:B20
gsoRange :: Lens' GoogleSheetsOptions (Maybe Text)
gsoRange = lens _gsoRange (\ s a -> s{_gsoRange = a}) | 276 | gsoRange :: Lens' GoogleSheetsOptions (Maybe Text)
gsoRange = lens _gsoRange (\ s a -> s{_gsoRange = a}) | 104 | gsoRange = lens _gsoRange (\ s a -> s{_gsoRange = a}) | 53 | true | true | 0 | 9 | 38 | 48 | 27 | 21 | null | null |
IMOKURI/snmptrapreceiver | src/Main.hs | mit | main :: IO ()
main = do
opts <- execParser clOptions
sockAddr <- takeSockAddr opts
trapReceiver sockAddr | 110 | main :: IO ()
main = do
opts <- execParser clOptions
sockAddr <- takeSockAddr opts
trapReceiver sockAddr | 110 | main = do
opts <- execParser clOptions
sockAddr <- takeSockAddr opts
trapReceiver sockAddr | 96 | false | true | 0 | 9 | 22 | 48 | 19 | 29 | null | null |
anchor/vaultaire-collector-nagios | lib/Vaultaire/Collector/Nagios/Perfdata/Gearman.hs | mit | gearmanProcessDatum :: CollectorOpts NagiosOptions -> CollectorState NagiosState -> WorkerFunc
gearmanProcessDatum o@(_, NagiosOptions{..}) s@(_, NagiosState{..}) Job{..} =
case clearBytes collectorAES jobData of
Left e -> liftIO $ do
errorM "Gearman.gearmanProcessDatum" $ concat ["error decoding: ", show e, " data: ", show jobData]
return $ Left . Just $ L.pack e
Right checkResult -> do
liftIO $ debugM "Gearman.gearmanProcessDatum" $ "Null trimmed data: " ++ (show . trimNulls) checkResult
case perfdataFromGearmanResult checkResult of
Left err -> liftIO $ do
errorM "Gearman.gearmanProcessDatum" $ "Error parsing check result: " ++ err
return $ Left $ Just (L.pack err)
Right datum -> do
liftIO $ debugM "Gearman.gearmanProcessDatum" $ "Got datum: " ++ show datum
_ <- runCollector' o s (return ()) $ processDatum datum
return $ Right "done"
where
clearBytes k d = decodeJob k $ L.toStrict d
trimNulls :: S.ByteString -> S.ByteString
trimNulls = S.reverse . S.dropWhile (0 ==) . S.reverse
-- | Decodes a job's data packet using Base 64 | 1,256 | gearmanProcessDatum :: CollectorOpts NagiosOptions -> CollectorState NagiosState -> WorkerFunc
gearmanProcessDatum o@(_, NagiosOptions{..}) s@(_, NagiosState{..}) Job{..} =
case clearBytes collectorAES jobData of
Left e -> liftIO $ do
errorM "Gearman.gearmanProcessDatum" $ concat ["error decoding: ", show e, " data: ", show jobData]
return $ Left . Just $ L.pack e
Right checkResult -> do
liftIO $ debugM "Gearman.gearmanProcessDatum" $ "Null trimmed data: " ++ (show . trimNulls) checkResult
case perfdataFromGearmanResult checkResult of
Left err -> liftIO $ do
errorM "Gearman.gearmanProcessDatum" $ "Error parsing check result: " ++ err
return $ Left $ Just (L.pack err)
Right datum -> do
liftIO $ debugM "Gearman.gearmanProcessDatum" $ "Got datum: " ++ show datum
_ <- runCollector' o s (return ()) $ processDatum datum
return $ Right "done"
where
clearBytes k d = decodeJob k $ L.toStrict d
trimNulls :: S.ByteString -> S.ByteString
trimNulls = S.reverse . S.dropWhile (0 ==) . S.reverse
-- | Decodes a job's data packet using Base 64 | 1,256 | gearmanProcessDatum o@(_, NagiosOptions{..}) s@(_, NagiosState{..}) Job{..} =
case clearBytes collectorAES jobData of
Left e -> liftIO $ do
errorM "Gearman.gearmanProcessDatum" $ concat ["error decoding: ", show e, " data: ", show jobData]
return $ Left . Just $ L.pack e
Right checkResult -> do
liftIO $ debugM "Gearman.gearmanProcessDatum" $ "Null trimmed data: " ++ (show . trimNulls) checkResult
case perfdataFromGearmanResult checkResult of
Left err -> liftIO $ do
errorM "Gearman.gearmanProcessDatum" $ "Error parsing check result: " ++ err
return $ Left $ Just (L.pack err)
Right datum -> do
liftIO $ debugM "Gearman.gearmanProcessDatum" $ "Got datum: " ++ show datum
_ <- runCollector' o s (return ()) $ processDatum datum
return $ Right "done"
where
clearBytes k d = decodeJob k $ L.toStrict d
trimNulls :: S.ByteString -> S.ByteString
trimNulls = S.reverse . S.dropWhile (0 ==) . S.reverse
-- | Decodes a job's data packet using Base 64 | 1,161 | false | true | 2 | 20 | 371 | 385 | 179 | 206 | null | null |
mdsteele/fallback | src/Fallback/State/Tags.hs | gpl-3.0 | areaRegion Icehold = Svengaard | 30 | areaRegion Icehold = Svengaard | 30 | areaRegion Icehold = Svengaard | 30 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
scravy/simplex | src/Simplex/ToTeX.hs | gpl-3.0 | toTeX' opt []
= when' (oColumns opt > 0) "\\end{multicols}\n"
: when' (oFigure opt) "\\end{figure}\n"
: "\n}\n"
: when' (oLetter opt)
("\\closing{" ++ escapeTeX' "}\n\\end{letter}\n" (oLetterClosing opt))
: ["\\end{document}\n"] | 260 | toTeX' opt []
= when' (oColumns opt > 0) "\\end{multicols}\n"
: when' (oFigure opt) "\\end{figure}\n"
: "\n}\n"
: when' (oLetter opt)
("\\closing{" ++ escapeTeX' "}\n\\end{letter}\n" (oLetterClosing opt))
: ["\\end{document}\n"] | 260 | toTeX' opt []
= when' (oColumns opt > 0) "\\end{multicols}\n"
: when' (oFigure opt) "\\end{figure}\n"
: "\n}\n"
: when' (oLetter opt)
("\\closing{" ++ escapeTeX' "}\n\\end{letter}\n" (oLetterClosing opt))
: ["\\end{document}\n"] | 260 | false | false | 0 | 12 | 60 | 87 | 42 | 45 | null | null |
f1u77y/xmonad-contrib | XMonad/Layout/ImageButtonDecoration.hs | bsd-3-clause | menuButtonOffset :: Int
menuButtonOffset = 4 | 44 | menuButtonOffset :: Int
menuButtonOffset = 4 | 44 | menuButtonOffset = 4 | 20 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
Mahdi89/eTeak | src/Network.hs | bsd-3-clause | addUsage :: IM.IntMap NetworkLinkUsage -> (Int, NetworkLinkUsage) -> IM.IntMap NetworkLinkUsage
addUsage usage (linkNo, newLinkUsage) = IM.insert linkNo linkUsage' usage
where
oldLinkUsage = fromMaybe nwNoLinkUsage (IM.lookup linkNo usage)
linkUsage' = addUsagePair (show linkNo) oldLinkUsage newLinkUsage | 341 | addUsage :: IM.IntMap NetworkLinkUsage -> (Int, NetworkLinkUsage) -> IM.IntMap NetworkLinkUsage
addUsage usage (linkNo, newLinkUsage) = IM.insert linkNo linkUsage' usage
where
oldLinkUsage = fromMaybe nwNoLinkUsage (IM.lookup linkNo usage)
linkUsage' = addUsagePair (show linkNo) oldLinkUsage newLinkUsage | 337 | addUsage usage (linkNo, newLinkUsage) = IM.insert linkNo linkUsage' usage
where
oldLinkUsage = fromMaybe nwNoLinkUsage (IM.lookup linkNo usage)
linkUsage' = addUsagePair (show linkNo) oldLinkUsage newLinkUsage | 241 | false | true | 2 | 9 | 69 | 106 | 49 | 57 | null | null |
dustinrohde/TicTacToe | src/TicTacToe.hs | lgpl-3.0 | -- |Place a mark on a game if the given cell is unoccupied.
makeMove :: Mark -> Cell -> Game -> Game
makeMove mark cell gm@(Game moves end) = if inBounds cell
then Game (insert cell mark moves) end
else error "Invalid cell coordinates" | 317 | makeMove :: Mark -> Cell -> Game -> Game
makeMove mark cell gm@(Game moves end) = if inBounds cell
then Game (insert cell mark moves) end
else error "Invalid cell coordinates" | 257 | makeMove mark cell gm@(Game moves end) = if inBounds cell
then Game (insert cell mark moves) end
else error "Invalid cell coordinates" | 216 | true | true | 0 | 8 | 125 | 71 | 36 | 35 | null | null |
tavisrudd/ghcjs-base | JavaScript/TypedArray/DataView.hs | mit | unsafeReadUint16LE idx dv = IO (I.js_m_unsafeGetUint16LE idx dv) | 64 | unsafeReadUint16LE idx dv = IO (I.js_m_unsafeGetUint16LE idx dv) | 64 | unsafeReadUint16LE idx dv = IO (I.js_m_unsafeGetUint16LE idx dv) | 64 | false | false | 0 | 8 | 7 | 24 | 11 | 13 | null | null |
brendanhay/gogol | gogol-websecurityscanner/gen/Network/Google/Resource/WebSecurityScanner/Projects/ScanConfigs/ScanRuns/List.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
pscsrlUploadProtocol :: Lens' ProjectsScanConfigsScanRunsList (Maybe Text)
pscsrlUploadProtocol
= lens _pscsrlUploadProtocol
(\ s a -> s{_pscsrlUploadProtocol = a}) | 234 | pscsrlUploadProtocol :: Lens' ProjectsScanConfigsScanRunsList (Maybe Text)
pscsrlUploadProtocol
= lens _pscsrlUploadProtocol
(\ s a -> s{_pscsrlUploadProtocol = a}) | 172 | pscsrlUploadProtocol
= lens _pscsrlUploadProtocol
(\ s a -> s{_pscsrlUploadProtocol = a}) | 97 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
brendanhay/gogol | gogol-plus-domains/gen/Network/Google/PlusDomains/Types/Product.hs | mpl-2.0 | -- | The type of entry describing to whom access is granted. Possible values
-- are: - \"person\" - Access to an individual. - \"circle\" - Access to
-- members of a circle. - \"myCircles\" - Access to members of all the
-- person\'s circles. - \"extendedCircles\" - Access to members of all the
-- person\'s circles, plus all of the people in their circles. - \"domain\"
-- - Access to members of the person\'s Google Apps domain. - \"public\" -
-- Access to anyone on the web.
pdarType :: Lens' PlusDomainsACLentryResource (Maybe Text)
pdarType = lens _pdarType (\ s a -> s{_pdarType = a}) | 591 | pdarType :: Lens' PlusDomainsACLentryResource (Maybe Text)
pdarType = lens _pdarType (\ s a -> s{_pdarType = a}) | 112 | pdarType = lens _pdarType (\ s a -> s{_pdarType = a}) | 53 | true | true | 0 | 9 | 104 | 52 | 31 | 21 | null | null |
Heather/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | -- | Colourise annotations according to an Idris state. It ignores the
-- names in the annotation, as there's no good way to show extended
-- information on a terminal. Note that strings produced this way will
-- not be coloured on Windows, so the use of the colour rendering
-- functions in Idris.Output is to be preferred.
consoleDecorate :: IState -> OutputAnnotation -> String -> String
consoleDecorate ist ann = maybe id colourise (annotationColour ist ann) | 462 | consoleDecorate :: IState -> OutputAnnotation -> String -> String
consoleDecorate ist ann = maybe id colourise (annotationColour ist ann) | 137 | consoleDecorate ist ann = maybe id colourise (annotationColour ist ann) | 71 | true | true | 0 | 7 | 76 | 48 | 26 | 22 | null | null |
brendanhay/gogol | gogol-videointelligence/gen/Network/Google/VideoIntelligence/Types/Product.hs | mpl-2.0 | -- | Streaming mode ONLY. In streaming mode, we do not know the end time of a
-- tracked object before it is completed. Hence, there is no VideoSegment
-- info returned. Instead, we provide a unique identifiable integer
-- track_id so that the customers can correlate the results of the ongoing
-- ObjectTrackAnnotation of the same track_id over time.
gcvvota1TrackId :: Lens' GoogleCloudVideointelligenceV1_ObjectTrackingAnnotation (Maybe Int64)
gcvvota1TrackId
= lens _gcvvota1TrackId
(\ s a -> s{_gcvvota1TrackId = a})
. mapping _Coerce | 553 | gcvvota1TrackId :: Lens' GoogleCloudVideointelligenceV1_ObjectTrackingAnnotation (Maybe Int64)
gcvvota1TrackId
= lens _gcvvota1TrackId
(\ s a -> s{_gcvvota1TrackId = a})
. mapping _Coerce | 201 | gcvvota1TrackId
= lens _gcvvota1TrackId
(\ s a -> s{_gcvvota1TrackId = a})
. mapping _Coerce | 106 | true | true | 0 | 10 | 93 | 59 | 32 | 27 | null | null |
josegury/HaskellFuntions | Listas/Int-NumElementRepetido.hs | mit | vecces x (h:t) = if x == h then 1 + (veces x t) else veces x t | 62 | vecces x (h:t) = if x == h then 1 + (veces x t) else veces x t | 62 | vecces x (h:t) = if x == h then 1 + (veces x t) else veces x t | 62 | false | false | 0 | 8 | 17 | 49 | 24 | 25 | null | null |
centromere/cacophony | tests/vectors/Verify.hs | unlicense | resultSuccess :: ValidationResult
-> Bool
resultSuccess ResultSuccess = True | 90 | resultSuccess :: ValidationResult
-> Bool
resultSuccess ResultSuccess = True | 90 | resultSuccess ResultSuccess = True | 34 | false | true | 0 | 5 | 22 | 18 | 9 | 9 | null | null |
olsner/ghc | ghc/Main.hs | bsd-3-clause | -- -----------------------------------------------------------------------------
-- Parsing the mode flag
parseModeFlags :: [Located String]
-> IO (Mode,
[Located String],
[Located String])
parseModeFlags args = do
let ((leftover, errs1, warns), (mModeFlag, errs2, flags')) =
runCmdLine (processArgs mode_flags args)
(Nothing, [], [])
mode = case mModeFlag of
Nothing -> doMakeMode
Just (m, _) -> m
-- See Note [Handling errors when parsing commandline flags]
unless (null errs1 && null errs2) $ throwGhcException $ errorsToGhcException $
map (("on the commandline", )) $ map unLoc errs1 ++ errs2
return (mode, flags' ++ leftover, warns) | 780 | parseModeFlags :: [Located String]
-> IO (Mode,
[Located String],
[Located String])
parseModeFlags args = do
let ((leftover, errs1, warns), (mModeFlag, errs2, flags')) =
runCmdLine (processArgs mode_flags args)
(Nothing, [], [])
mode = case mModeFlag of
Nothing -> doMakeMode
Just (m, _) -> m
-- See Note [Handling errors when parsing commandline flags]
unless (null errs1 && null errs2) $ throwGhcException $ errorsToGhcException $
map (("on the commandline", )) $ map unLoc errs1 ++ errs2
return (mode, flags' ++ leftover, warns) | 673 | parseModeFlags args = do
let ((leftover, errs1, warns), (mModeFlag, errs2, flags')) =
runCmdLine (processArgs mode_flags args)
(Nothing, [], [])
mode = case mModeFlag of
Nothing -> doMakeMode
Just (m, _) -> m
-- See Note [Handling errors when parsing commandline flags]
unless (null errs1 && null errs2) $ throwGhcException $ errorsToGhcException $
map (("on the commandline", )) $ map unLoc errs1 ++ errs2
return (mode, flags' ++ leftover, warns) | 530 | true | true | 0 | 15 | 229 | 214 | 114 | 100 | null | null |
themattchan/tandoori | input/mutual.hs | bsd-3-clause | tick y = y:tock y | 17 | tick y = y:tock y | 17 | tick y = y:tock y | 17 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
bitemyapp/morfette | src/GramLab/Morfette/Models2.hs | bsd-2-clause | collectUntil cond f z (x:xs) = let z' = (f $! x) $! z
in if cond x z' then []
else x: collectUntil cond f z' xs | 181 | collectUntil cond f z (x:xs) = let z' = (f $! x) $! z
in if cond x z' then []
else x: collectUntil cond f z' xs | 181 | collectUntil cond f z (x:xs) = let z' = (f $! x) $! z
in if cond x z' then []
else x: collectUntil cond f z' xs | 181 | false | false | 0 | 11 | 97 | 76 | 36 | 40 | null | null |
snoyberg/ghc | compiler/nativeGen/Dwarf/Types.hs | bsd-3-clause | -- should never happen
pprUndefUnwind plat g = pprByte dW_CFA_undefined $$
pprLEBWord (fromIntegral $ dwarfGlobalRegNo plat g) | 152 | pprUndefUnwind plat g = pprByte dW_CFA_undefined $$
pprLEBWord (fromIntegral $ dwarfGlobalRegNo plat g) | 129 | pprUndefUnwind plat g = pprByte dW_CFA_undefined $$
pprLEBWord (fromIntegral $ dwarfGlobalRegNo plat g) | 129 | true | false | 1 | 9 | 42 | 38 | 16 | 22 | null | null |
spwhitton/sariulclocks | src/Utils/ScoresFile.hs | gpl-3.0 | writeScoresFile :: SariulScoresMonad a => a ()
writeScoresFile = do
scores <- getScores
curDir <- liftIO getCurrentDirectory
let dataDir = curDir </> "data"
timestamp <- liftM round $ liftIO getPOSIXTime
let filename = dataDir </> ("scores-" ++ show timestamp ++ ".csv")
liftIO $ writeFile filename (scoresToCSV scores) | 343 | writeScoresFile :: SariulScoresMonad a => a ()
writeScoresFile = do
scores <- getScores
curDir <- liftIO getCurrentDirectory
let dataDir = curDir </> "data"
timestamp <- liftM round $ liftIO getPOSIXTime
let filename = dataDir </> ("scores-" ++ show timestamp ++ ".csv")
liftIO $ writeFile filename (scoresToCSV scores) | 343 | writeScoresFile = do
scores <- getScores
curDir <- liftIO getCurrentDirectory
let dataDir = curDir </> "data"
timestamp <- liftM round $ liftIO getPOSIXTime
let filename = dataDir </> ("scores-" ++ show timestamp ++ ".csv")
liftIO $ writeFile filename (scoresToCSV scores) | 296 | false | true | 0 | 14 | 70 | 115 | 52 | 63 | null | null |
xicesky/sky-haskell-playground | src/Sky/Parsing/Invertible2.hs | bsd-3-clause | litLeft :: (D token, D a) => token -> Syntax' token a -> Syntax' token a
litLeft x y = Sequence (isoFixedLeft x) (lit x) y | 122 | litLeft :: (D token, D a) => token -> Syntax' token a -> Syntax' token a
litLeft x y = Sequence (isoFixedLeft x) (lit x) y | 122 | litLeft x y = Sequence (isoFixedLeft x) (lit x) y | 49 | false | true | 0 | 8 | 25 | 68 | 33 | 35 | null | null |
EchoTeam/gtl | tools/GTL/SVG.hs | bsd-2-clause | imageWidth = 1000 :: Px | 26 | imageWidth = 1000 :: Px | 26 | imageWidth = 1000 :: Px | 26 | false | false | 0 | 4 | 7 | 9 | 5 | 4 | null | null |
amccausl/Swish | Swish/HaskellUtils/AccumulateM.hs | lgpl-2.1 | testList1 = [1,2,3,4,5,6] :: [Integer] | 38 | testList1 = [1,2,3,4,5,6] :: [Integer] | 38 | testList1 = [1,2,3,4,5,6] :: [Integer] | 38 | false | false | 1 | 6 | 4 | 33 | 19 | 14 | null | null |
kosmikus/cabal | cabal-install/Distribution/Client/SetupWrapper.hs | bsd-3-clause | buildTypeAction Custom = error "buildTypeAction Custom" | 69 | buildTypeAction Custom = error "buildTypeAction Custom" | 69 | buildTypeAction Custom = error "buildTypeAction Custom" | 69 | false | false | 0 | 5 | 19 | 12 | 5 | 7 | null | null |
nushio3/ghc | compiler/coreSyn/CoreUnfold.hs | bsd-3-clause | mkDFunUnfolding :: [Var] -> DataCon -> [CoreExpr] -> Unfolding
mkDFunUnfolding bndrs con ops
= DFunUnfolding { df_bndrs = bndrs
, df_con = con
, df_args = map occurAnalyseExpr ops } | 219 | mkDFunUnfolding :: [Var] -> DataCon -> [CoreExpr] -> Unfolding
mkDFunUnfolding bndrs con ops
= DFunUnfolding { df_bndrs = bndrs
, df_con = con
, df_args = map occurAnalyseExpr ops } | 219 | mkDFunUnfolding bndrs con ops
= DFunUnfolding { df_bndrs = bndrs
, df_con = con
, df_args = map occurAnalyseExpr ops } | 156 | false | true | 0 | 8 | 67 | 61 | 34 | 27 | null | null |
ricardopenyamari/ir2haskell | clir-parser-haskell-master/lib/sexp-grammar/src/Language/SexpGrammar/Combinators.hs | gpl-2.0 | -- | Get position of Sexp. Doesn't consume Sexp and doesn't have any
-- effect on backward run.
position :: Grammar SexpGrammar (Sexp :- t) (Position :- Sexp :- t)
position = Inject GPos | 186 | position :: Grammar SexpGrammar (Sexp :- t) (Position :- Sexp :- t)
position = Inject GPos | 90 | position = Inject GPos | 22 | true | true | 0 | 8 | 33 | 41 | 22 | 19 | null | null |
anton-k/sharc-timbre | src/Sharc/Instruments/Cello.hs | bsd-3-clause | note33 :: Note
note33 = Note
(Pitch 440.0 57 "a4")
34
(Range
(NoteRange
(NoteRangeAmplitude 7920.0 18 13.36)
(NoteRangeHarmonicFreq 1 440.0))
(NoteRange
(NoteRangeAmplitude 1320.0 3 2302.0)
(NoteRangeHarmonicFreq 22 9680.0)))
[Harmonic 1 (-1.164) 1617.09
,Harmonic 2 (-1.62) 2234.7
,Harmonic 3 1.792 2302.0
,Harmonic 4 (-2.22) 2269.72
,Harmonic 5 (-0.604) 1803.61
,Harmonic 6 1.532 201.14
,Harmonic 7 2.181 566.46
,Harmonic 8 (-0.965) 40.11
,Harmonic 9 (-2.869) 148.66
,Harmonic 10 2.09 146.47
,Harmonic 11 (-1.223) 56.58
,Harmonic 12 (-1.832) 40.09
,Harmonic 13 (-3.8e-2) 28.49
,Harmonic 14 (-1.708) 68.32
,Harmonic 15 1.127 72.28
,Harmonic 16 (-2.304) 67.71
,Harmonic 17 (-3.13) 40.38
,Harmonic 18 1.616 13.36
,Harmonic 19 (-2.352) 39.09
,Harmonic 20 1.841 55.66
,Harmonic 21 (-1.325) 51.64
,Harmonic 22 2.544 40.75] | 982 | note33 :: Note
note33 = Note
(Pitch 440.0 57 "a4")
34
(Range
(NoteRange
(NoteRangeAmplitude 7920.0 18 13.36)
(NoteRangeHarmonicFreq 1 440.0))
(NoteRange
(NoteRangeAmplitude 1320.0 3 2302.0)
(NoteRangeHarmonicFreq 22 9680.0)))
[Harmonic 1 (-1.164) 1617.09
,Harmonic 2 (-1.62) 2234.7
,Harmonic 3 1.792 2302.0
,Harmonic 4 (-2.22) 2269.72
,Harmonic 5 (-0.604) 1803.61
,Harmonic 6 1.532 201.14
,Harmonic 7 2.181 566.46
,Harmonic 8 (-0.965) 40.11
,Harmonic 9 (-2.869) 148.66
,Harmonic 10 2.09 146.47
,Harmonic 11 (-1.223) 56.58
,Harmonic 12 (-1.832) 40.09
,Harmonic 13 (-3.8e-2) 28.49
,Harmonic 14 (-1.708) 68.32
,Harmonic 15 1.127 72.28
,Harmonic 16 (-2.304) 67.71
,Harmonic 17 (-3.13) 40.38
,Harmonic 18 1.616 13.36
,Harmonic 19 (-2.352) 39.09
,Harmonic 20 1.841 55.66
,Harmonic 21 (-1.325) 51.64
,Harmonic 22 2.544 40.75] | 982 | note33 = Note
(Pitch 440.0 57 "a4")
34
(Range
(NoteRange
(NoteRangeAmplitude 7920.0 18 13.36)
(NoteRangeHarmonicFreq 1 440.0))
(NoteRange
(NoteRangeAmplitude 1320.0 3 2302.0)
(NoteRangeHarmonicFreq 22 9680.0)))
[Harmonic 1 (-1.164) 1617.09
,Harmonic 2 (-1.62) 2234.7
,Harmonic 3 1.792 2302.0
,Harmonic 4 (-2.22) 2269.72
,Harmonic 5 (-0.604) 1803.61
,Harmonic 6 1.532 201.14
,Harmonic 7 2.181 566.46
,Harmonic 8 (-0.965) 40.11
,Harmonic 9 (-2.869) 148.66
,Harmonic 10 2.09 146.47
,Harmonic 11 (-1.223) 56.58
,Harmonic 12 (-1.832) 40.09
,Harmonic 13 (-3.8e-2) 28.49
,Harmonic 14 (-1.708) 68.32
,Harmonic 15 1.127 72.28
,Harmonic 16 (-2.304) 67.71
,Harmonic 17 (-3.13) 40.38
,Harmonic 18 1.616 13.36
,Harmonic 19 (-2.352) 39.09
,Harmonic 20 1.841 55.66
,Harmonic 21 (-1.325) 51.64
,Harmonic 22 2.544 40.75] | 967 | false | true | 0 | 10 | 279 | 389 | 198 | 191 | null | null |
cdepillabout/ctf | site.hs | gpl-2.0 | doHakyll :: IO ()
doHakyll = hakyll $ do
{-
match (fromList ["about.rst", "contact.markdown"]) $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
match "posts/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/post.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
create ["archive.html"] $ do
route idRoute
compile $ do
posts <- recentFirst =<< loadAll "posts/*"
let archiveCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Archives" `mappend`
defaultContext
makeItem ""
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx
>>= loadAndApplyTemplate "templates/default.html" archiveCtx
>>= relativizeUrls
match "index.html" $ do
-- route idRoute
route $ constRoute "_old/indexwhatwhat.html"
compile $ do
posts <- recentFirst =<< loadAll "posts/*"
let indexCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Home" `mappend`
defaultContext
getResourceBody
>>= applyAsTemplate indexCtx
>>= loadAndApplyTemplate "templates/default.html" indexCtx
>>= relativizeUrls
-}
match "images/*" $ do
route idRoute
compile copyFileCompiler
match "css/*" $ do
route idRoute
compile compressCssCompiler
match "templates/*" $ compile templateCompiler
match (fromGlob $ writeupsDir ++ "/**index.md") $ do
route $ stripOffCtfPrefix `composeRoutes` setExtension "html"
compile $ do
--ident <- getUnderlying
--traceShowM ident
pandocMathCompiler
>>= loadAndApplyTemplate "templates/index.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
match (fromGlob $ writeupsDir ++ "/**.md") $ do
route $ stripOffCtfPrefix `composeRoutes` setExtension "html"
compile $ pandocMathCompiler
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
match (fromGlob $ writeupsDir ++ "/**") $ do
route stripOffCtfPrefix
compile copyFileCompiler
-------------------------------------------------------------------------------- | 2,795 | doHakyll :: IO ()
doHakyll = hakyll $ do
{-
match (fromList ["about.rst", "contact.markdown"]) $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
match "posts/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/post.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
create ["archive.html"] $ do
route idRoute
compile $ do
posts <- recentFirst =<< loadAll "posts/*"
let archiveCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Archives" `mappend`
defaultContext
makeItem ""
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx
>>= loadAndApplyTemplate "templates/default.html" archiveCtx
>>= relativizeUrls
match "index.html" $ do
-- route idRoute
route $ constRoute "_old/indexwhatwhat.html"
compile $ do
posts <- recentFirst =<< loadAll "posts/*"
let indexCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Home" `mappend`
defaultContext
getResourceBody
>>= applyAsTemplate indexCtx
>>= loadAndApplyTemplate "templates/default.html" indexCtx
>>= relativizeUrls
-}
match "images/*" $ do
route idRoute
compile copyFileCompiler
match "css/*" $ do
route idRoute
compile compressCssCompiler
match "templates/*" $ compile templateCompiler
match (fromGlob $ writeupsDir ++ "/**index.md") $ do
route $ stripOffCtfPrefix `composeRoutes` setExtension "html"
compile $ do
--ident <- getUnderlying
--traceShowM ident
pandocMathCompiler
>>= loadAndApplyTemplate "templates/index.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
match (fromGlob $ writeupsDir ++ "/**.md") $ do
route $ stripOffCtfPrefix `composeRoutes` setExtension "html"
compile $ pandocMathCompiler
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
match (fromGlob $ writeupsDir ++ "/**") $ do
route stripOffCtfPrefix
compile copyFileCompiler
-------------------------------------------------------------------------------- | 2,795 | doHakyll = hakyll $ do
{-
match (fromList ["about.rst", "contact.markdown"]) $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
match "posts/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/post.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
create ["archive.html"] $ do
route idRoute
compile $ do
posts <- recentFirst =<< loadAll "posts/*"
let archiveCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Archives" `mappend`
defaultContext
makeItem ""
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx
>>= loadAndApplyTemplate "templates/default.html" archiveCtx
>>= relativizeUrls
match "index.html" $ do
-- route idRoute
route $ constRoute "_old/indexwhatwhat.html"
compile $ do
posts <- recentFirst =<< loadAll "posts/*"
let indexCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Home" `mappend`
defaultContext
getResourceBody
>>= applyAsTemplate indexCtx
>>= loadAndApplyTemplate "templates/default.html" indexCtx
>>= relativizeUrls
-}
match "images/*" $ do
route idRoute
compile copyFileCompiler
match "css/*" $ do
route idRoute
compile compressCssCompiler
match "templates/*" $ compile templateCompiler
match (fromGlob $ writeupsDir ++ "/**index.md") $ do
route $ stripOffCtfPrefix `composeRoutes` setExtension "html"
compile $ do
--ident <- getUnderlying
--traceShowM ident
pandocMathCompiler
>>= loadAndApplyTemplate "templates/index.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
match (fromGlob $ writeupsDir ++ "/**.md") $ do
route $ stripOffCtfPrefix `composeRoutes` setExtension "html"
compile $ pandocMathCompiler
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
match (fromGlob $ writeupsDir ++ "/**") $ do
route stripOffCtfPrefix
compile copyFileCompiler
-------------------------------------------------------------------------------- | 2,777 | false | true | 0 | 17 | 934 | 240 | 108 | 132 | null | null |
arne-schroppe/dash | src/Language/Dash/VM/DataEncoding.hs | mit | decodeDynamicString :: VMWord -> IO VMValue
decodeDynamicString addr = do
stringHeader <- getVMHeapValue addr
let (_, numChunks) = decodeStringHeader stringHeader
stringBody <- getVMHeapArray (addr + stringHeaderLength) numChunks
let decodedChunks = map decodeStringChunk stringBody
let str = concat decodedChunks
return $ VMString str | 347 | decodeDynamicString :: VMWord -> IO VMValue
decodeDynamicString addr = do
stringHeader <- getVMHeapValue addr
let (_, numChunks) = decodeStringHeader stringHeader
stringBody <- getVMHeapArray (addr + stringHeaderLength) numChunks
let decodedChunks = map decodeStringChunk stringBody
let str = concat decodedChunks
return $ VMString str | 347 | decodeDynamicString addr = do
stringHeader <- getVMHeapValue addr
let (_, numChunks) = decodeStringHeader stringHeader
stringBody <- getVMHeapArray (addr + stringHeaderLength) numChunks
let decodedChunks = map decodeStringChunk stringBody
let str = concat decodedChunks
return $ VMString str | 303 | false | true | 0 | 10 | 53 | 105 | 47 | 58 | null | null |
justinethier/husk-scheme | hs-src/Language/Scheme/Numerical.hs | mit | numTan [(Float n)] = return $ Float $ tan n | 43 | numTan [(Float n)] = return $ Float $ tan n | 43 | numTan [(Float n)] = return $ Float $ tan n | 43 | false | false | 0 | 8 | 9 | 29 | 14 | 15 | null | null |
qiuhw/calc | src/Calc/Parser.hs | bsd-3-clause | identifier = Parsec.identifier lexer | 36 | identifier = Parsec.identifier lexer | 36 | identifier = Parsec.identifier lexer | 36 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
rueshyna/gogol | gogol-storage/gen/Network/Google/Storage/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'ChannelParams' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cpAddtional'
channelParams
:: HashMap Text Text -- ^ 'cpAddtional'
-> ChannelParams
channelParams pCpAddtional_ =
ChannelParams'
{ _cpAddtional = _Coerce # pCpAddtional_
} | 365 | channelParams
:: HashMap Text Text -- ^ 'cpAddtional'
-> ChannelParams
channelParams pCpAddtional_ =
ChannelParams'
{ _cpAddtional = _Coerce # pCpAddtional_
} | 178 | channelParams pCpAddtional_ =
ChannelParams'
{ _cpAddtional = _Coerce # pCpAddtional_
} | 99 | true | true | 0 | 8 | 74 | 50 | 26 | 24 | null | null |
thoferon/mud | src/Mud/Undeploy.hs | bsd-3-clause | undeploy :: String -> String -> [(String, String)] -> [Config] -> Mud ()
undeploy projectName version customVars = mapM_ $ \config -> do
deployVars <- getDeployVariables projectName version config
runUndeployScript projectName version deployVars customVars config | 267 | undeploy :: String -> String -> [(String, String)] -> [Config] -> Mud ()
undeploy projectName version customVars = mapM_ $ \config -> do
deployVars <- getDeployVariables projectName version config
runUndeployScript projectName version deployVars customVars config | 267 | undeploy projectName version customVars = mapM_ $ \config -> do
deployVars <- getDeployVariables projectName version config
runUndeployScript projectName version deployVars customVars config | 194 | false | true | 0 | 10 | 38 | 88 | 44 | 44 | null | null |
jchitel/ProjectEuler.hs | Problems/Problem0013.hs | mit | main = print getProblem13Value | 30 | main = print getProblem13Value | 30 | main = print getProblem13Value | 30 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
DougBurke/swish | src/Swish/RDF/Vocabulary/SIOC.hs | lgpl-2.1 | ------------------------------------------------------------
-- Namespace
------------------------------------------------------------
siocURI :: URI
siocURI = fromMaybe (error "Internal error processing SIOC URI") $ parseURI "http://rdfs.org/sioc/ns#" | 254 | siocURI :: URI
siocURI = fromMaybe (error "Internal error processing SIOC URI") $ parseURI "http://rdfs.org/sioc/ns#" | 117 | siocURI = fromMaybe (error "Internal error processing SIOC URI") $ parseURI "http://rdfs.org/sioc/ns#" | 102 | true | true | 0 | 8 | 20 | 30 | 16 | 14 | null | null |
tpsinnem/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v (LSLt (ATInt (ITFixed ty))) [x, y] = bitOp v "SLt" ty [x, y] | 67 | doOp v (LSLt (ATInt (ITFixed ty))) [x, y] = bitOp v "SLt" ty [x, y] | 67 | doOp v (LSLt (ATInt (ITFixed ty))) [x, y] = bitOp v "SLt" ty [x, y] | 67 | false | false | 1 | 11 | 14 | 55 | 27 | 28 | null | null |
zuzia/haskell_worker | tests/Reader_test.hs | bsd-3-clause | local = "localhost/disco/localhost/fa/gojob@57d:42bbf:148ed/map_out_3022" | 73 | local = "localhost/disco/localhost/fa/gojob@57d:42bbf:148ed/map_out_3022" | 73 | local = "localhost/disco/localhost/fa/gojob@57d:42bbf:148ed/map_out_3022" | 73 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
j5b/ps-pc | OutputProof_test.hs | gpl-3.0 | fileC2LGenerator :: IO ()
fileC2LGenerator = do output <- openFile "concept_latex_test_output.tex" WriteMode
hPutStrLn output "\\documentclass[12pt, a4paper]{article}"
hPutStrLn output "\\usepackage{amsmath}"
hPutStrLn output "\\usepackage{amssymb}"
hPutStrLn output "\\begin{document}"
mapM (hPutStrLn output) $ map elementOutput myConceptList
hPutStrLn output "\\bigbreak \\ \n"
hPutStrLn output ("$"++conceptsToLatex myConceptList++"$")
hPutStrLn output "\\end{document}"
hClose output
putStrLn "\nFile for testing conceptToLatex function has been generated" | 781 | fileC2LGenerator :: IO ()
fileC2LGenerator = do output <- openFile "concept_latex_test_output.tex" WriteMode
hPutStrLn output "\\documentclass[12pt, a4paper]{article}"
hPutStrLn output "\\usepackage{amsmath}"
hPutStrLn output "\\usepackage{amssymb}"
hPutStrLn output "\\begin{document}"
mapM (hPutStrLn output) $ map elementOutput myConceptList
hPutStrLn output "\\bigbreak \\ \n"
hPutStrLn output ("$"++conceptsToLatex myConceptList++"$")
hPutStrLn output "\\end{document}"
hClose output
putStrLn "\nFile for testing conceptToLatex function has been generated" | 781 | fileC2LGenerator = do output <- openFile "concept_latex_test_output.tex" WriteMode
hPutStrLn output "\\documentclass[12pt, a4paper]{article}"
hPutStrLn output "\\usepackage{amsmath}"
hPutStrLn output "\\usepackage{amssymb}"
hPutStrLn output "\\begin{document}"
mapM (hPutStrLn output) $ map elementOutput myConceptList
hPutStrLn output "\\bigbreak \\ \n"
hPutStrLn output ("$"++conceptsToLatex myConceptList++"$")
hPutStrLn output "\\end{document}"
hClose output
putStrLn "\nFile for testing conceptToLatex function has been generated" | 755 | false | true | 1 | 12 | 274 | 135 | 54 | 81 | null | null |
goalieca/haskelling | 059.hs | gpl-3.0 | wordCount dictionary text = length $ filter (\x -> HashSet.member (map toLower x) dictionary) $ splitOneOf ";.,:!?\"\'() " text | 127 | wordCount dictionary text = length $ filter (\x -> HashSet.member (map toLower x) dictionary) $ splitOneOf ";.,:!?\"\'() " text | 127 | wordCount dictionary text = length $ filter (\x -> HashSet.member (map toLower x) dictionary) $ splitOneOf ";.,:!?\"\'() " text | 127 | false | false | 0 | 12 | 18 | 50 | 24 | 26 | null | null |
mcmaniac/ghc | compiler/cmm/CmmType.hs | bsd-3-clause | typeWidth :: CmmType -> Width
typeWidth (CmmType _ w) = w | 57 | typeWidth :: CmmType -> Width
typeWidth (CmmType _ w) = w | 57 | typeWidth (CmmType _ w) = w | 27 | false | true | 0 | 9 | 10 | 32 | 14 | 18 | null | null |
kbiscanic/hash | src/Language/Commands.hs | gpl-2.0 | cmdMv :: Command
cmdMv args scst@(ScriptState _ wd vars) = do
pass <- checkArgs args 2
if pass then do
isFile <- doesFileExist $ head args
let targetDir = last args
createDirectoryIfMissing True targetDir
if isFile then mapM_ (\x -> copyFile x (targetDir ++ "/" ++ x)) (init args)
else mapM_ (\x -> renameDirectory x (targetDir ++ "/" ++ x)) (init args)
Control.Monad.when isFile $ mapM_ removeFile (init args)
return $ scst{output = "Success!"}
else return $ scst{output = "Failure!"} | 521 | cmdMv :: Command
cmdMv args scst@(ScriptState _ wd vars) = do
pass <- checkArgs args 2
if pass then do
isFile <- doesFileExist $ head args
let targetDir = last args
createDirectoryIfMissing True targetDir
if isFile then mapM_ (\x -> copyFile x (targetDir ++ "/" ++ x)) (init args)
else mapM_ (\x -> renameDirectory x (targetDir ++ "/" ++ x)) (init args)
Control.Monad.when isFile $ mapM_ removeFile (init args)
return $ scst{output = "Success!"}
else return $ scst{output = "Failure!"} | 521 | cmdMv args scst@(ScriptState _ wd vars) = do
pass <- checkArgs args 2
if pass then do
isFile <- doesFileExist $ head args
let targetDir = last args
createDirectoryIfMissing True targetDir
if isFile then mapM_ (\x -> copyFile x (targetDir ++ "/" ++ x)) (init args)
else mapM_ (\x -> renameDirectory x (targetDir ++ "/" ++ x)) (init args)
Control.Monad.when isFile $ mapM_ removeFile (init args)
return $ scst{output = "Success!"}
else return $ scst{output = "Failure!"} | 504 | false | true | 1 | 17 | 115 | 223 | 108 | 115 | null | null |
snoyberg/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | ctEvLoc :: CtEvidence -> CtLoc
ctEvLoc = ctev_loc | 49 | ctEvLoc :: CtEvidence -> CtLoc
ctEvLoc = ctev_loc | 49 | ctEvLoc = ctev_loc | 18 | false | true | 0 | 7 | 7 | 22 | 9 | 13 | null | null |
mrshannon/lorenz | src/Lorenz/OpenGL.hs | mit | -- TODO: This function causes flickering during resize.
-- | Reshape the window.
reshape :: Int -> Int -> IO ()
reshape width height = do
_ <- setVideoMode width height 32 [OpenGL, Resizable]
-- Set viewport as entire window.
viewport $= (Position 0 0, Size (fromIntegral width) (fromIntegral height))
-- Apply the projection.
matrixMode $= Projection
loadIdentity
if w2h >= 1
-- Wider than taller.
then ortho (-w2h) (w2h) (-1.0) (1.0) (-20.0) (20.0)
-- Taller than wider.
else ortho (-1.0) (1.0) (-1/w2h) (1/w2h) (-20.0) (20.0)
-- Reset the modelview matrix.
matrixMode $= Modelview 0
loadIdentity
where
-- Width to height ratio.
w2h = if height > 0
then (fromIntegral width)/(fromIntegral height)
else 1 | 902 | reshape :: Int -> Int -> IO ()
reshape width height = do
_ <- setVideoMode width height 32 [OpenGL, Resizable]
-- Set viewport as entire window.
viewport $= (Position 0 0, Size (fromIntegral width) (fromIntegral height))
-- Apply the projection.
matrixMode $= Projection
loadIdentity
if w2h >= 1
-- Wider than taller.
then ortho (-w2h) (w2h) (-1.0) (1.0) (-20.0) (20.0)
-- Taller than wider.
else ortho (-1.0) (1.0) (-1/w2h) (1/w2h) (-20.0) (20.0)
-- Reset the modelview matrix.
matrixMode $= Modelview 0
loadIdentity
where
-- Width to height ratio.
w2h = if height > 0
then (fromIntegral width)/(fromIntegral height)
else 1 | 821 | reshape width height = do
_ <- setVideoMode width height 32 [OpenGL, Resizable]
-- Set viewport as entire window.
viewport $= (Position 0 0, Size (fromIntegral width) (fromIntegral height))
-- Apply the projection.
matrixMode $= Projection
loadIdentity
if w2h >= 1
-- Wider than taller.
then ortho (-w2h) (w2h) (-1.0) (1.0) (-20.0) (20.0)
-- Taller than wider.
else ortho (-1.0) (1.0) (-1/w2h) (1/w2h) (-20.0) (20.0)
-- Reset the modelview matrix.
matrixMode $= Modelview 0
loadIdentity
where
-- Width to height ratio.
w2h = if height > 0
then (fromIntegral width)/(fromIntegral height)
else 1 | 790 | true | true | 0 | 11 | 310 | 250 | 132 | 118 | null | null |
keera-studios/hsQt | Qtc/Gui/QCalendarWidget.hs | bsd-2-clause | setVerticalHeaderFormat :: QCalendarWidget a -> ((VerticalHeaderFormat)) -> IO ()
setVerticalHeaderFormat x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QCalendarWidget_setVerticalHeaderFormat cobj_x0 (toCLong $ qEnum_toInt x1) | 231 | setVerticalHeaderFormat :: QCalendarWidget a -> ((VerticalHeaderFormat)) -> IO ()
setVerticalHeaderFormat x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QCalendarWidget_setVerticalHeaderFormat cobj_x0 (toCLong $ qEnum_toInt x1) | 231 | setVerticalHeaderFormat x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QCalendarWidget_setVerticalHeaderFormat cobj_x0 (toCLong $ qEnum_toInt x1) | 149 | false | true | 0 | 10 | 29 | 68 | 34 | 34 | null | null |
bobjflong/stellar-haskell | src/Web/Stellar/Request.hs | mit | makeRequest :: (ToJSON a) => StellarEndpoint -> a -> IO (LBS.ByteString)
makeRequest (Endpoint x) v = do
r <- post (unpack x) (toJSON v)
return $ r ^. responseBody | 167 | makeRequest :: (ToJSON a) => StellarEndpoint -> a -> IO (LBS.ByteString)
makeRequest (Endpoint x) v = do
r <- post (unpack x) (toJSON v)
return $ r ^. responseBody | 167 | makeRequest (Endpoint x) v = do
r <- post (unpack x) (toJSON v)
return $ r ^. responseBody | 94 | false | true | 0 | 10 | 32 | 82 | 40 | 42 | null | null |
ezyang/ghc | libraries/base/Foreign/C/Error.hs | bsd-3-clause | eADDRINUSE = Errno (CONST_EADDRINUSE) | 42 | eADDRINUSE = Errno (CONST_EADDRINUSE) | 42 | eADDRINUSE = Errno (CONST_EADDRINUSE) | 42 | false | false | 0 | 6 | 8 | 12 | 6 | 6 | null | null |
denibertovic/haskell | kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs | bsd-3-clause | -- | 'v1beta2ScaleSpec' Lens
v1beta2ScaleSpecL :: Lens_' V1beta2Scale (Maybe V1beta2ScaleSpec)
v1beta2ScaleSpecL f V1beta2Scale{..} = (\v1beta2ScaleSpec -> V1beta2Scale { v1beta2ScaleSpec, ..} ) <$> f v1beta2ScaleSpec | 217 | v1beta2ScaleSpecL :: Lens_' V1beta2Scale (Maybe V1beta2ScaleSpec)
v1beta2ScaleSpecL f V1beta2Scale{..} = (\v1beta2ScaleSpec -> V1beta2Scale { v1beta2ScaleSpec, ..} ) <$> f v1beta2ScaleSpec | 188 | v1beta2ScaleSpecL f V1beta2Scale{..} = (\v1beta2ScaleSpec -> V1beta2Scale { v1beta2ScaleSpec, ..} ) <$> f v1beta2ScaleSpec | 122 | true | true | 1 | 8 | 23 | 62 | 30 | 32 | null | null |
ishiy1993/mk-sode1 | src/Del/Lib.hs | bsd-3-clause | simplifyExp :: Exp -> Exp
simplifyExp = buildup . compose . eval . flatten . expand . cleanup | 93 | simplifyExp :: Exp -> Exp
simplifyExp = buildup . compose . eval . flatten . expand . cleanup | 93 | simplifyExp = buildup . compose . eval . flatten . expand . cleanup | 67 | false | true | 0 | 9 | 17 | 35 | 18 | 17 | null | null |
dongarerahul/edx-haskell | chapter-7-parser-simple.hs | apache-2.0 | ------------- Monad World
parse' :: Parser' a -> String -> [(a, String)]
parse' (P p) inp = p inp | 97 | parse' :: Parser' a -> String -> [(a, String)]
parse' (P p) inp = p inp | 71 | parse' (P p) inp = p inp | 24 | true | true | 0 | 10 | 18 | 51 | 25 | 26 | null | null |
diku-dk/futhark | src/Futhark/Pass/ExpandAllocations.hs | isc | extractBodyAllocations ::
User ->
Names ->
Names ->
Body GPUMem ->
(Body GPUMem, Extraction)
extractBodyAllocations user bound_outside bound_kernel =
extractGenericBodyAllocations user bound_outside bound_kernel bodyStms $
\stms body -> body {bodyStms = stms} | 275 | extractBodyAllocations ::
User ->
Names ->
Names ->
Body GPUMem ->
(Body GPUMem, Extraction)
extractBodyAllocations user bound_outside bound_kernel =
extractGenericBodyAllocations user bound_outside bound_kernel bodyStms $
\stms body -> body {bodyStms = stms} | 275 | extractBodyAllocations user bound_outside bound_kernel =
extractGenericBodyAllocations user bound_outside bound_kernel bodyStms $
\stms body -> body {bodyStms = stms} | 172 | false | true | 0 | 12 | 47 | 84 | 40 | 44 | null | null |
sdiehl/ghc | libraries/base/Data/Data.hs | bsd-3-clause | int8Type :: DataType
int8Type = mkIntType "Data.Int.Int8" | 57 | int8Type :: DataType
int8Type = mkIntType "Data.Int.Int8" | 57 | int8Type = mkIntType "Data.Int.Int8" | 36 | false | true | 0 | 6 | 6 | 21 | 8 | 13 | null | null |
fffej/sql-server-gen | src/Database/SqlServer/Create/Certificate.hs | bsd-2-clause | renderSubject :: RegularIdentifier -> Doc
renderSubject s = text "WITH SUBJECT = '" <>
renderRegularIdentifier s <> text "'" | 142 | renderSubject :: RegularIdentifier -> Doc
renderSubject s = text "WITH SUBJECT = '" <>
renderRegularIdentifier s <> text "'" | 142 | renderSubject s = text "WITH SUBJECT = '" <>
renderRegularIdentifier s <> text "'" | 100 | false | true | 0 | 7 | 36 | 40 | 17 | 23 | null | null |
davidzhulijun/TAM | RegisterMachine/Models/CMA7.hs | bsd-3-clause | mach :: RM1 (Lang Int) ListMem (CMAState Int SingleLoc ListMem (Address Int))
mach = RM prog initedCMA (compile trans) | 118 | mach :: RM1 (Lang Int) ListMem (CMAState Int SingleLoc ListMem (Address Int))
mach = RM prog initedCMA (compile trans) | 118 | mach = RM prog initedCMA (compile trans) | 40 | false | true | 1 | 9 | 18 | 62 | 27 | 35 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/Utils.hs | gpl-2.0 | -- | Resolves a numeric address.
resolveAddr :: Int -> String -> IO (Result (Family, SockAddr))
resolveAddr port str = do
resolved <- getAddrInfo resolveAddrHints (Just str) (Just (show port))
return $ case resolved of
[] -> Bad "Invalid results from lookup?"
best:_ -> Ok (addrFamily best, addrAddress best)
-- | Set the owner and the group of a file (given as names, not numeric id). | 416 | resolveAddr :: Int -> String -> IO (Result (Family, SockAddr))
resolveAddr port str = do
resolved <- getAddrInfo resolveAddrHints (Just str) (Just (show port))
return $ case resolved of
[] -> Bad "Invalid results from lookup?"
best:_ -> Ok (addrFamily best, addrAddress best)
-- | Set the owner and the group of a file (given as names, not numeric id). | 383 | resolveAddr port str = do
resolved <- getAddrInfo resolveAddrHints (Just str) (Just (show port))
return $ case resolved of
[] -> Bad "Invalid results from lookup?"
best:_ -> Ok (addrFamily best, addrAddress best)
-- | Set the owner and the group of a file (given as names, not numeric id). | 320 | true | true | 0 | 14 | 96 | 125 | 60 | 65 | null | null |
taylor1791/adventofcode | 2015/src/Day21.hs | bsd-2-clause | bossMove :: Player -> Boss -> (Player, Boss)
bossMove p b = (p', b)
where
p' = p {
pHp = max 0 (pHp p - max 0 (bDamage b - playerArmorClass p))
}
-- This assume armor cannot do damage | 200 | bossMove :: Player -> Boss -> (Player, Boss)
bossMove p b = (p', b)
where
p' = p {
pHp = max 0 (pHp p - max 0 (bDamage b - playerArmorClass p))
}
-- This assume armor cannot do damage | 200 | bossMove p b = (p', b)
where
p' = p {
pHp = max 0 (pHp p - max 0 (bDamage b - playerArmorClass p))
}
-- This assume armor cannot do damage | 155 | false | true | 1 | 14 | 57 | 98 | 47 | 51 | null | null |
shimmercat/second-transfer | hs-src/SecondTransfer/Utils.hs | bsd-3-clause | putWord24be :: Int -> Put
putWord24be x = put (Word24 x) | 56 | putWord24be :: Int -> Put
putWord24be x = put (Word24 x) | 56 | putWord24be x = put (Word24 x) | 30 | false | true | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
PuZZleDucK/Hls | Hsleep.hs | gpl-3.0 | timeMultiplier :: Float
timeMultiplier = 100 | 44 | timeMultiplier :: Float
timeMultiplier = 100 | 44 | timeMultiplier = 100 | 20 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
bernstein/breakout | src/SdlAdapter.hs | bsd-3-clause | -- deriving (Eq, Ord, Show)
fps :: Integer
fps = 30 | 53 | fps :: Integer
fps = 30 | 23 | fps = 30 | 8 | true | true | 0 | 6 | 12 | 19 | 8 | 11 | null | null |
coghex/abridgefaraway | src/GLUtil/TypeMapping.hs | bsd-3-clause | variableDataType UnsignedIntVec3 = GL.UnsignedInt | 49 | variableDataType UnsignedIntVec3 = GL.UnsignedInt | 49 | variableDataType UnsignedIntVec3 = GL.UnsignedInt | 49 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
GaloisInc/stack | src/Stack/Package.hs | bsd-3-clause | -- | Get all build tool dependencies of the package (buildable targets only).
packageToolDependencies :: PackageDescription -> Map S.ByteString VersionRange
packageToolDependencies =
M.fromList .
concatMap (map (\dep -> ((packageNameByteString $ depName dep),depRange dep)) .
buildTools) .
allBuildInfo' | 322 | packageToolDependencies :: PackageDescription -> Map S.ByteString VersionRange
packageToolDependencies =
M.fromList .
concatMap (map (\dep -> ((packageNameByteString $ depName dep),depRange dep)) .
buildTools) .
allBuildInfo' | 244 | packageToolDependencies =
M.fromList .
concatMap (map (\dep -> ((packageNameByteString $ depName dep),depRange dep)) .
buildTools) .
allBuildInfo' | 165 | true | true | 0 | 16 | 55 | 73 | 38 | 35 | null | null |
fffej/haskellprojects | 6502/Em6502.hs | bsd-2-clause | execute cpu (DEC addressMode) = undefined | 41 | execute cpu (DEC addressMode) = undefined | 41 | execute cpu (DEC addressMode) = undefined | 41 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
mboes/distributed-process | src/Control/Distributed/Process/Internal/Types.hs | bsd-3-clause | forever' :: Monad m => m a -> m b
forever' a = let a' = a >> a' in a' | 69 | forever' :: Monad m => m a -> m b
forever' a = let a' = a >> a' in a' | 69 | forever' a = let a' = a >> a' in a' | 35 | false | true | 0 | 9 | 20 | 51 | 22 | 29 | null | null |
dalaing/type-systems | src/Fragment/Tuple/Rules/Type.hs | bsd-3-clause | tupleNormalizeRules :: TupleNormalizeConstraint ki ty a
=> NormalizeInput ki ty a
tupleNormalizeRules =
NormalizeInput [ NormalizeTypeRecurse normalizeTuple ] | 180 | tupleNormalizeRules :: TupleNormalizeConstraint ki ty a
=> NormalizeInput ki ty a
tupleNormalizeRules =
NormalizeInput [ NormalizeTypeRecurse normalizeTuple ] | 180 | tupleNormalizeRules =
NormalizeInput [ NormalizeTypeRecurse normalizeTuple ] | 78 | false | true | 0 | 7 | 39 | 38 | 18 | 20 | null | null |
lpenz/realworldhaskell-exercises | ch12/Parse.hs | mit | (==>) :: Parse a -> (a -> Parse b) -> Parse b
firstParser ==> secondParser = Parse chainedParser
where chainedParser initState =
case runParse firstParser initState of
Left errMessage ->
Left errMessage
Right (firstResult, newState) ->
runParse (secondParser firstResult) newState | 353 | (==>) :: Parse a -> (a -> Parse b) -> Parse b
firstParser ==> secondParser = Parse chainedParser
where chainedParser initState =
case runParse firstParser initState of
Left errMessage ->
Left errMessage
Right (firstResult, newState) ->
runParse (secondParser firstResult) newState | 352 | firstParser ==> secondParser = Parse chainedParser
where chainedParser initState =
case runParse firstParser initState of
Left errMessage ->
Left errMessage
Right (firstResult, newState) ->
runParse (secondParser firstResult) newState | 306 | false | true | 0 | 10 | 112 | 107 | 50 | 57 | null | null |
svenkeidel/sdl2 | src/SDL/Event.hs | bsd-3-clause | convertRaw :: Raw.Event -> Event
convertRaw (Raw.WindowEvent t ts a b c d) = Event ts $
let w' = WindowID a in case b of
Raw.SDL_WINDOWEVENT_SHOWN -> WindowShown w'
Raw.SDL_WINDOWEVENT_HIDDEN -> WindowHidden w'
Raw.SDL_WINDOWEVENT_EXPOSED -> WindowExposed w'
Raw.SDL_WINDOWEVENT_MOVED -> WindowMoved w' (P (V2 c d))
Raw.SDL_WINDOWEVENT_RESIZED -> WindowResized w' (V2 c d)
Raw.SDL_WINDOWEVENT_SIZE_CHANGED -> WindowSizeChanged w'
Raw.SDL_WINDOWEVENT_MINIMIZED -> WindowMinimized w'
Raw.SDL_WINDOWEVENT_MAXIMIZED -> WindowMaximized w'
Raw.SDL_WINDOWEVENT_RESTORED -> WindowRestored w'
Raw.SDL_WINDOWEVENT_ENTER -> WindowGainedMouseFocus w'
Raw.SDL_WINDOWEVENT_LEAVE -> WindowLostMouseFocus w'
Raw.SDL_WINDOWEVENT_FOCUS_GAINED -> WindowGainedKeyboardFocus w'
Raw.SDL_WINDOWEVENT_FOCUS_LOST -> WindowLostKeyboardFocus w'
Raw.SDL_WINDOWEVENT_CLOSE -> WindowClosed w'
_ -> UnknownEvent t | 944 | convertRaw :: Raw.Event -> Event
convertRaw (Raw.WindowEvent t ts a b c d) = Event ts $
let w' = WindowID a in case b of
Raw.SDL_WINDOWEVENT_SHOWN -> WindowShown w'
Raw.SDL_WINDOWEVENT_HIDDEN -> WindowHidden w'
Raw.SDL_WINDOWEVENT_EXPOSED -> WindowExposed w'
Raw.SDL_WINDOWEVENT_MOVED -> WindowMoved w' (P (V2 c d))
Raw.SDL_WINDOWEVENT_RESIZED -> WindowResized w' (V2 c d)
Raw.SDL_WINDOWEVENT_SIZE_CHANGED -> WindowSizeChanged w'
Raw.SDL_WINDOWEVENT_MINIMIZED -> WindowMinimized w'
Raw.SDL_WINDOWEVENT_MAXIMIZED -> WindowMaximized w'
Raw.SDL_WINDOWEVENT_RESTORED -> WindowRestored w'
Raw.SDL_WINDOWEVENT_ENTER -> WindowGainedMouseFocus w'
Raw.SDL_WINDOWEVENT_LEAVE -> WindowLostMouseFocus w'
Raw.SDL_WINDOWEVENT_FOCUS_GAINED -> WindowGainedKeyboardFocus w'
Raw.SDL_WINDOWEVENT_FOCUS_LOST -> WindowLostKeyboardFocus w'
Raw.SDL_WINDOWEVENT_CLOSE -> WindowClosed w'
_ -> UnknownEvent t | 944 | convertRaw (Raw.WindowEvent t ts a b c d) = Event ts $
let w' = WindowID a in case b of
Raw.SDL_WINDOWEVENT_SHOWN -> WindowShown w'
Raw.SDL_WINDOWEVENT_HIDDEN -> WindowHidden w'
Raw.SDL_WINDOWEVENT_EXPOSED -> WindowExposed w'
Raw.SDL_WINDOWEVENT_MOVED -> WindowMoved w' (P (V2 c d))
Raw.SDL_WINDOWEVENT_RESIZED -> WindowResized w' (V2 c d)
Raw.SDL_WINDOWEVENT_SIZE_CHANGED -> WindowSizeChanged w'
Raw.SDL_WINDOWEVENT_MINIMIZED -> WindowMinimized w'
Raw.SDL_WINDOWEVENT_MAXIMIZED -> WindowMaximized w'
Raw.SDL_WINDOWEVENT_RESTORED -> WindowRestored w'
Raw.SDL_WINDOWEVENT_ENTER -> WindowGainedMouseFocus w'
Raw.SDL_WINDOWEVENT_LEAVE -> WindowLostMouseFocus w'
Raw.SDL_WINDOWEVENT_FOCUS_GAINED -> WindowGainedKeyboardFocus w'
Raw.SDL_WINDOWEVENT_FOCUS_LOST -> WindowLostKeyboardFocus w'
Raw.SDL_WINDOWEVENT_CLOSE -> WindowClosed w'
_ -> UnknownEvent t | 911 | false | true | 0 | 15 | 154 | 257 | 118 | 139 | null | null |
nubis/Monono | Graphics/UI/Monono/Drawing.hs | bsd-3-clause | -- | Set the drawing to be a rectangle, and the BoundingBox to be the same size
-- and position as the rectangle.
rectangle :: Color a =>
PrimitiveMode -> a -> GLfloat -> GLfloat -> GLfloat -> GLfloat -> Sprite ()
rectangle mode c x y w h = do
setBoundBox x y w h
draw $ drawRectangle mode c x y w h
-- | Draws a rectangle using the given OpenGL PrimitiveMode.
-- <x> and <y> are the coordinates of the bottom-left vertex. | 429 | rectangle :: Color a =>
PrimitiveMode -> a -> GLfloat -> GLfloat -> GLfloat -> GLfloat -> Sprite ()
rectangle mode c x y w h = do
setBoundBox x y w h
draw $ drawRectangle mode c x y w h
-- | Draws a rectangle using the given OpenGL PrimitiveMode.
-- <x> and <y> are the coordinates of the bottom-left vertex. | 315 | rectangle mode c x y w h = do
setBoundBox x y w h
draw $ drawRectangle mode c x y w h
-- | Draws a rectangle using the given OpenGL PrimitiveMode.
-- <x> and <y> are the coordinates of the bottom-left vertex. | 213 | true | true | 0 | 13 | 92 | 96 | 47 | 49 | null | null |
badi/super-user-spark | test/Check/TestUtils.hs | mit | shouldBeDone :: DiagnosedFp -> DiagnosedFp -> DeploymentKind -> Expectation
shouldBeDone src dst kind = checkSingle src dst kind `shouldSatisfy` isDone | 151 | shouldBeDone :: DiagnosedFp -> DiagnosedFp -> DeploymentKind -> Expectation
shouldBeDone src dst kind = checkSingle src dst kind `shouldSatisfy` isDone | 151 | shouldBeDone src dst kind = checkSingle src dst kind `shouldSatisfy` isDone | 75 | false | true | 0 | 7 | 19 | 43 | 22 | 21 | null | null |
ndmitchell/nsis | src/Development/NSIS/Plugins/WinMessages.hs | bsd-3-clause | cb_SETTOPINDEX = 0x015c | 36 | cb_SETTOPINDEX = 0x015c | 36 | cb_SETTOPINDEX = 0x015c | 36 | false | false | 0 | 4 | 15 | 6 | 3 | 3 | null | null |
brendanhay/gogol | gogol-vision/gen/Network/Google/Resource/Vision/Images/Annotate.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
iaUploadType :: Lens' ImagesAnnotate (Maybe Text)
iaUploadType
= lens _iaUploadType (\ s a -> s{_iaUploadType = a}) | 188 | iaUploadType :: Lens' ImagesAnnotate (Maybe Text)
iaUploadType
= lens _iaUploadType (\ s a -> s{_iaUploadType = a}) | 117 | iaUploadType
= lens _iaUploadType (\ s a -> s{_iaUploadType = a}) | 67 | true | true | 0 | 9 | 28 | 48 | 25 | 23 | null | null |
laszlopandy/elm-compiler | src/Parse/Helpers.hs | bsd-3-clause | escaped :: Char -> IParser String
escaped delim =
try $ do
char '\\'
c <- char '\\' <|> char delim
return ['\\', c] | 129 | escaped :: Char -> IParser String
escaped delim =
try $ do
char '\\'
c <- char '\\' <|> char delim
return ['\\', c] | 129 | escaped delim =
try $ do
char '\\'
c <- char '\\' <|> char delim
return ['\\', c] | 95 | false | true | 0 | 10 | 37 | 60 | 27 | 33 | null | null |
text-utf8/text | Data/Text/Encoding.hs | bsd-2-clause | -- | Encode text to a ByteString 'B.Builder' using UTF-8 encoding.
--
-- @since 1.1.0.0
encodeUtf8Builder :: Text -> B.Builder
encodeUtf8Builder = \t -> B.builder (textCopyStep t) | 179 | encodeUtf8Builder :: Text -> B.Builder
encodeUtf8Builder = \t -> B.builder (textCopyStep t) | 91 | encodeUtf8Builder = \t -> B.builder (textCopyStep t) | 52 | true | true | 0 | 8 | 26 | 36 | 20 | 16 | null | null |
rolph-recto/liquidhaskell | src/Language/Haskell/Liquid/RefType.hs | bsd-3-clause | addTyConInfo :: (PPrint r, Reftable r)
=> (M.HashMap TyCon FTycon)
-> (M.HashMap TyCon RTyCon)
-> RRType r
-> RRType r
-------------------------------------------------------------------------
addTyConInfo tce tyi = mapBot (expandRApp tce tyi) | 295 | addTyConInfo :: (PPrint r, Reftable r)
=> (M.HashMap TyCon FTycon)
-> (M.HashMap TyCon RTyCon)
-> RRType r
-> RRType r
addTyConInfo tce tyi = mapBot (expandRApp tce tyi) | 221 | addTyConInfo tce tyi = mapBot (expandRApp tce tyi) | 50 | true | true | 0 | 10 | 80 | 81 | 40 | 41 | null | null |
alanz/cloud-haskell-play | src/ThymeUtil.hs | unlicense | -- | given a @NominalDiffTim@@, provide an equivalent @TimeInterval@
diffTimeToTimeInterval :: NominalDiffTime -> TimeInterval
diffTimeToTimeInterval dt = microSeconds $ round $ diffTimeToMicroSeconds dt | 203 | diffTimeToTimeInterval :: NominalDiffTime -> TimeInterval
diffTimeToTimeInterval dt = microSeconds $ round $ diffTimeToMicroSeconds dt | 134 | diffTimeToTimeInterval dt = microSeconds $ round $ diffTimeToMicroSeconds dt | 76 | true | true | 0 | 6 | 22 | 30 | 15 | 15 | null | null |
egison/egison | hs-src/Interpreter/egison.hs | mit | showBanner :: IO ()
showBanner = do
putStrLn $ "Egison Version " ++ showVersion version
putStrLn "https://www.egison.org"
putStrLn "Welcome to Egison Interpreter!"
-- putStrLn $ "** Information **"
-- putStrLn $ "We can use the tab key to complete keywords on the interpreter."
-- putStrLn $ "If we press the tab key after a closed parenthesis, the next closed parenthesis will be completed."
-- putStrLn $ "*****************" | 440 | showBanner :: IO ()
showBanner = do
putStrLn $ "Egison Version " ++ showVersion version
putStrLn "https://www.egison.org"
putStrLn "Welcome to Egison Interpreter!"
-- putStrLn $ "** Information **"
-- putStrLn $ "We can use the tab key to complete keywords on the interpreter."
-- putStrLn $ "If we press the tab key after a closed parenthesis, the next closed parenthesis will be completed."
-- putStrLn $ "*****************" | 440 | showBanner = do
putStrLn $ "Egison Version " ++ showVersion version
putStrLn "https://www.egison.org"
putStrLn "Welcome to Egison Interpreter!"
-- putStrLn $ "** Information **"
-- putStrLn $ "We can use the tab key to complete keywords on the interpreter."
-- putStrLn $ "If we press the tab key after a closed parenthesis, the next closed parenthesis will be completed."
-- putStrLn $ "*****************" | 420 | false | true | 0 | 8 | 80 | 46 | 22 | 24 | null | null |
dermesser/haskell-experiments | Transformers.hs | unlicense | ask :: Monad m => ReaderT r m r
ask = ReaderT return | 52 | ask :: Monad m => ReaderT r m r
ask = ReaderT return | 52 | ask = ReaderT return | 20 | false | true | 0 | 7 | 12 | 34 | 14 | 20 | null | null |
paluh/itsitsdangerous | src/ItsItsDangerous.hs | bsd-3-clause | signature :: Salt -> Secret -> Plain -> Signature
signature salt secret plain =
base64encode . BS.pack $ hmac_sha1 (BS.unpack (derivateKey salt secret)) (BS.unpack plain) | 174 | signature :: Salt -> Secret -> Plain -> Signature
signature salt secret plain =
base64encode . BS.pack $ hmac_sha1 (BS.unpack (derivateKey salt secret)) (BS.unpack plain) | 174 | signature salt secret plain =
base64encode . BS.pack $ hmac_sha1 (BS.unpack (derivateKey salt secret)) (BS.unpack plain) | 124 | false | true | 0 | 10 | 28 | 69 | 34 | 35 | null | null |
aconbere/redis | Redis/Base.hs | mit | formatBulkCommand :: [String] -> [String]
formatBulkCommand c =
concat $ zipWith (\x y -> [x, y]) (map (\i -> "$" ++ (show $ length i)) c) c | 144 | formatBulkCommand :: [String] -> [String]
formatBulkCommand c =
concat $ zipWith (\x y -> [x, y]) (map (\i -> "$" ++ (show $ length i)) c) c | 144 | formatBulkCommand c =
concat $ zipWith (\x y -> [x, y]) (map (\i -> "$" ++ (show $ length i)) c) c | 102 | false | true | 0 | 14 | 30 | 81 | 44 | 37 | null | null |
chrisdone/intero | src/Intero/Compat.hs | bsd-3-clause | ghc_tyConFlavour n =
if tyConFlavour n == ClassFlavour
then "class"
else "" | 85 | ghc_tyConFlavour n =
if tyConFlavour n == ClassFlavour
then "class"
else "" | 85 | ghc_tyConFlavour n =
if tyConFlavour n == ClassFlavour
then "class"
else "" | 85 | false | false | 0 | 7 | 21 | 24 | 12 | 12 | null | null |
dmbarbour/awelon | hsrc/ABC/Base16.hs | bsd-3-clause | -- | Given raw binary, translate into alphabet.
encode :: [Word8] -> [Word8]
encode (b:bs) = h1 : h2 : encode bs where
(n1,n2) = b `divMod` 16
h1 = alph8 !! fromIntegral n1
h2 = alph8 !! fromIntegral n2 | 214 | encode :: [Word8] -> [Word8]
encode (b:bs) = h1 : h2 : encode bs where
(n1,n2) = b `divMod` 16
h1 = alph8 !! fromIntegral n1
h2 = alph8 !! fromIntegral n2 | 166 | encode (b:bs) = h1 : h2 : encode bs where
(n1,n2) = b `divMod` 16
h1 = alph8 !! fromIntegral n1
h2 = alph8 !! fromIntegral n2 | 137 | true | true | 0 | 7 | 51 | 86 | 47 | 39 | null | null |
olorin/amazonka | amazonka-s3-encryption/src/Network/AWS/S3/Encryption/Envelope.hs | mpl-2.0 | decodeV1 :: MonadResource m
=> [(CI Text, Text)]
-> (ByteString -> IO ByteString)
-> m Envelope
decodeV1 xs f = do
k <- xs .& "X-Amz-Key" >>= liftIO . f . unBase64
iv <- xs .& "X-Amz-IV" >>= createIV . unBase64
d <- xs .& "X-Amz-Matdesc"
c <- createCipher k
return . V1 c $ V1Envelope k iv d | 342 | decodeV1 :: MonadResource m
=> [(CI Text, Text)]
-> (ByteString -> IO ByteString)
-> m Envelope
decodeV1 xs f = do
k <- xs .& "X-Amz-Key" >>= liftIO . f . unBase64
iv <- xs .& "X-Amz-IV" >>= createIV . unBase64
d <- xs .& "X-Amz-Matdesc"
c <- createCipher k
return . V1 c $ V1Envelope k iv d | 342 | decodeV1 xs f = do
k <- xs .& "X-Amz-Key" >>= liftIO . f . unBase64
iv <- xs .& "X-Amz-IV" >>= createIV . unBase64
d <- xs .& "X-Amz-Matdesc"
c <- createCipher k
return . V1 c $ V1Envelope k iv d | 219 | false | true | 0 | 12 | 109 | 145 | 67 | 78 | null | null |
jeffreyrosenbluth/NYC-meetup | meetup/Envelope.hs | mit | d2 :: Path V2 Double
d2 = (pentagon 1 === roundedRect 1.5 0.7 0.3) | 66 | d2 :: Path V2 Double
d2 = (pentagon 1 === roundedRect 1.5 0.7 0.3) | 66 | d2 = (pentagon 1 === roundedRect 1.5 0.7 0.3) | 45 | false | true | 0 | 7 | 13 | 33 | 16 | 17 | null | null |
input-output-hk/pos-haskell-prototype | core/src/Pos/Core/Common/Address.hs | mit | ----------------------------------------------------------------------------
-- Utils
----------------------------------------------------------------------------
-- | Get 'AddrAttributes' from 'Address'.
addrAttributesUnwrapped :: Address -> AddrAttributes
addrAttributesUnwrapped = attrData . addrAttributes | 310 | addrAttributesUnwrapped :: Address -> AddrAttributes
addrAttributesUnwrapped = attrData . addrAttributes | 104 | addrAttributesUnwrapped = attrData . addrAttributes | 51 | true | true | 0 | 5 | 20 | 23 | 14 | 9 | null | null |
wavewave/lhc-analysis-collection | lib/HEP/Physics/Analysis/ATLAS/SUSY/SUSY_1to2L2to6JMET_8TeV.hs | gpl-3.0 | getRFromSR sr =
let r = TotalSR { numS1L1BLM = g numS1L1BLM
, numS1L1BHM = g numS1L1BHM
, numS1L2BLM = g numS1L2BLM
, numS1L2BHM = g numS1L2BHM
, numS1L3J = g numS1L3J
, numS1L5J = g numS1L5J
, numS2Mu2J = g numS2Mu2J
, numBH1E3J = g numBH1E3J
, numBH1M3J = g numBH1M3J
, numBH1E5J = g numBH1E5J
, numBH1M5J = g numBH1M5J
, numBH1E6J = g numBH1E6J
, numBH1M6J = g numBH1M6J
, numIH1E3J = g numIH1E3J
, numIH1M3J = g numIH1M3J
, numIH1E5J = g numIH1E5J
, numIH1M5J = g numIH1M5J
, numIH1E6J = g numIH1E6J
, numIH1M6J = g numIH1M6J
}
in maximumInSR r
where getratio f x y = f x / f y
g f = getratio f sr limitOfNBSM_SR
-- | this is from S_exp^95 | 1,046 | getRFromSR sr =
let r = TotalSR { numS1L1BLM = g numS1L1BLM
, numS1L1BHM = g numS1L1BHM
, numS1L2BLM = g numS1L2BLM
, numS1L2BHM = g numS1L2BHM
, numS1L3J = g numS1L3J
, numS1L5J = g numS1L5J
, numS2Mu2J = g numS2Mu2J
, numBH1E3J = g numBH1E3J
, numBH1M3J = g numBH1M3J
, numBH1E5J = g numBH1E5J
, numBH1M5J = g numBH1M5J
, numBH1E6J = g numBH1E6J
, numBH1M6J = g numBH1M6J
, numIH1E3J = g numIH1E3J
, numIH1M3J = g numIH1M3J
, numIH1E5J = g numIH1E5J
, numIH1M5J = g numIH1M5J
, numIH1E6J = g numIH1E6J
, numIH1M6J = g numIH1M6J
}
in maximumInSR r
where getratio f x y = f x / f y
g f = getratio f sr limitOfNBSM_SR
-- | this is from S_exp^95 | 1,046 | getRFromSR sr =
let r = TotalSR { numS1L1BLM = g numS1L1BLM
, numS1L1BHM = g numS1L1BHM
, numS1L2BLM = g numS1L2BLM
, numS1L2BHM = g numS1L2BHM
, numS1L3J = g numS1L3J
, numS1L5J = g numS1L5J
, numS2Mu2J = g numS2Mu2J
, numBH1E3J = g numBH1E3J
, numBH1M3J = g numBH1M3J
, numBH1E5J = g numBH1E5J
, numBH1M5J = g numBH1M5J
, numBH1E6J = g numBH1E6J
, numBH1M6J = g numBH1M6J
, numIH1E3J = g numIH1E3J
, numIH1M3J = g numIH1M3J
, numIH1E5J = g numIH1E5J
, numIH1M5J = g numIH1M5J
, numIH1E6J = g numIH1E6J
, numIH1M6J = g numIH1M6J
}
in maximumInSR r
where getratio f x y = f x / f y
g f = getratio f sr limitOfNBSM_SR
-- | this is from S_exp^95 | 1,046 | false | false | 3 | 11 | 532 | 250 | 125 | 125 | null | null |
j-mueller/hldb | webapp/VirtualHom/Svg.hs | bsd-3-clause | -- | The @opacity@ attribute.
opacity :: AttrTag
opacity = makeAttribute "opacity" | 82 | opacity :: AttrTag
opacity = makeAttribute "opacity" | 52 | opacity = makeAttribute "opacity" | 33 | true | true | 0 | 5 | 11 | 15 | 8 | 7 | null | null |
fmapfmapfmap/amazonka | amazonka-efs/gen/Network/AWS/EFS/Types.hs | mpl-2.0 | -- | Returned if the mount target is not in the correct state for the
-- operation.
_IncorrectMountTargetState :: AsError a => Getting (First ServiceError) a ServiceError
_IncorrectMountTargetState =
_ServiceError . hasStatus 409 . hasCode "IncorrectMountTargetState" | 271 | _IncorrectMountTargetState :: AsError a => Getting (First ServiceError) a ServiceError
_IncorrectMountTargetState =
_ServiceError . hasStatus 409 . hasCode "IncorrectMountTargetState" | 187 | _IncorrectMountTargetState =
_ServiceError . hasStatus 409 . hasCode "IncorrectMountTargetState" | 100 | true | true | 2 | 9 | 39 | 55 | 24 | 31 | null | null |
caneroj1/HaskellDocs | Views/Index.hs | mit | indexHeader = do
h1 ! class_ "text-center" $ "Search your Documents"
HTML.form ! method "get" ! action "/search" $ do
HTML.div ! class_ "form-group" $ do
HTML.label ! for "query" $ "Search"
input ! type_ "text"
! class_ "form-control"
! Attr.id "query"
! name "query"
button ! type_ "submit" ! class_ "btn btn-default" $ "Find Documents" | 397 | indexHeader = do
h1 ! class_ "text-center" $ "Search your Documents"
HTML.form ! method "get" ! action "/search" $ do
HTML.div ! class_ "form-group" $ do
HTML.label ! for "query" $ "Search"
input ! type_ "text"
! class_ "form-control"
! Attr.id "query"
! name "query"
button ! type_ "submit" ! class_ "btn btn-default" $ "Find Documents" | 397 | indexHeader = do
h1 ! class_ "text-center" $ "Search your Documents"
HTML.form ! method "get" ! action "/search" $ do
HTML.div ! class_ "form-group" $ do
HTML.label ! for "query" $ "Search"
input ! type_ "text"
! class_ "form-control"
! Attr.id "query"
! name "query"
button ! type_ "submit" ! class_ "btn btn-default" $ "Find Documents" | 397 | false | false | 0 | 17 | 115 | 129 | 56 | 73 | null | null |
lenary/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | isInjective (Constant _) = True | 37 | isInjective (Constant _) = True | 37 | isInjective (Constant _) = True | 37 | false | false | 0 | 7 | 10 | 15 | 7 | 8 | null | null |
jtdaugherty/vty | src/Data/Terminfo/Eval.hs | bsd-3-clause | readParam :: Word -> Eval CapParam
readParam pn = do
!params <- evalParams <$> get
return $! genericIndex params pn | 123 | readParam :: Word -> Eval CapParam
readParam pn = do
!params <- evalParams <$> get
return $! genericIndex params pn | 123 | readParam pn = do
!params <- evalParams <$> get
return $! genericIndex params pn | 88 | false | true | 0 | 9 | 27 | 50 | 21 | 29 | null | null |
Heather/stack | src/Path/Extra.hs | bsd-3-clause | -- | Collapse intermediate "." and ".." directories from path, then parse
-- it with 'parseAbsFile'.
-- (probably should be moved to the Path module)
parseCollapsedAbsFile :: MonadThrow m => FilePath -> m (Path Abs File)
parseCollapsedAbsFile = parseAbsFile . collapseFilePath | 276 | parseCollapsedAbsFile :: MonadThrow m => FilePath -> m (Path Abs File)
parseCollapsedAbsFile = parseAbsFile . collapseFilePath | 126 | parseCollapsedAbsFile = parseAbsFile . collapseFilePath | 55 | true | true | 0 | 10 | 40 | 46 | 22 | 24 | null | null |
olsner/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | expandUnfolding_maybe :: Unfolding -> Maybe CoreExpr
-- Expand an expandable unfolding; this is used in rule matching
-- See Note [Expanding variables] in Rules.hs
-- The key point here is that CONLIKE things can be expanded
expandUnfolding_maybe (CoreUnfolding { uf_expandable = True, uf_tmpl = rhs }) = Just rhs | 315 | expandUnfolding_maybe :: Unfolding -> Maybe CoreExpr
expandUnfolding_maybe (CoreUnfolding { uf_expandable = True, uf_tmpl = rhs }) = Just rhs | 141 | expandUnfolding_maybe (CoreUnfolding { uf_expandable = True, uf_tmpl = rhs }) = Just rhs | 88 | true | true | 0 | 9 | 50 | 45 | 25 | 20 | null | null |
urbanslug/ghc | testsuite/tests/codeGen/should_run/CopySmallArray.hs | bsd-3-clause | ------------------------------------------------------------------------
-- copySmallMutableArray#
-- Copy a slice of the source array into a destination array and check
-- that the copy succeeded.
test_copyMutableArray :: String
test_copyMutableArray =
let dst = runST $ do
src <- newArray len 0
fill src 0 len
dst <- newArray len (-1)
-- Leave the first and last element untouched
copyMutableArray src 1 dst 1 copied
unsafeFreezeArray dst
in shows (toList dst len) "\n" | 552 | test_copyMutableArray :: String
test_copyMutableArray =
let dst = runST $ do
src <- newArray len 0
fill src 0 len
dst <- newArray len (-1)
-- Leave the first and last element untouched
copyMutableArray src 1 dst 1 copied
unsafeFreezeArray dst
in shows (toList dst len) "\n" | 353 | test_copyMutableArray =
let dst = runST $ do
src <- newArray len 0
fill src 0 len
dst <- newArray len (-1)
-- Leave the first and last element untouched
copyMutableArray src 1 dst 1 copied
unsafeFreezeArray dst
in shows (toList dst len) "\n" | 321 | true | true | 0 | 15 | 149 | 103 | 49 | 54 | null | null |
andreyk0/HSOpenSCAD | Graphics/OpenSCAD.hs | bsd-3-clause | -- | A convenience function to render a list of 'Model's by taking
-- their union.
renderL :: Vector v => [Model v] -> String
renderL = render . union | 150 | renderL :: Vector v => [Model v] -> String
renderL = render . union | 67 | renderL = render . union | 24 | true | true | 0 | 8 | 29 | 34 | 18 | 16 | null | null |
bmsherman/magma-gpu | Foreign/CUDA/Magma/TH.hs | bsd-3-clause | typeMap :: Char -> TypeC
typeMap 'c' = ComplexC FloatC | 54 | typeMap :: Char -> TypeC
typeMap 'c' = ComplexC FloatC | 54 | typeMap 'c' = ComplexC FloatC | 29 | false | true | 0 | 7 | 9 | 26 | 11 | 15 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Vector.hs | bsd-3-clause | foldr1' = G.foldr1' | 19 | foldr1' = G.foldr1' | 19 | foldr1' = G.foldr1' | 19 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
CGenie/hgeometry | src/Data/Geometry/Geometry.hs | bsd-3-clause | matrix3ToLists :: Matrix3 a -> [[a]]
matrix3ToLists (Matrix3 (Vec3 (a,b,c))) = map v3ToList [a,b,c] | 124 | matrix3ToLists :: Matrix3 a -> [[a]]
matrix3ToLists (Matrix3 (Vec3 (a,b,c))) = map v3ToList [a,b,c] | 124 | matrix3ToLists (Matrix3 (Vec3 (a,b,c))) = map v3ToList [a,b,c] | 62 | false | true | 0 | 12 | 38 | 68 | 35 | 33 | null | null |
sapek/pandoc | src/Text/Pandoc/Writers/HTML.hs | gpl-2.0 | -- | Convert an Element to Html.
elementToHtml :: Int -> WriterOptions -> Element -> State WriterState Html
elementToHtml _slideLevel opts (Blk block) = blockToHtml opts block | 175 | elementToHtml :: Int -> WriterOptions -> Element -> State WriterState Html
elementToHtml _slideLevel opts (Blk block) = blockToHtml opts block | 142 | elementToHtml _slideLevel opts (Blk block) = blockToHtml opts block | 67 | true | true | 0 | 8 | 26 | 47 | 23 | 24 | null | null |
lucasbraun/mt-rewrite | src/MtRewriteSelect.hs | bsd-3-clause | -- apps have to be treated specially in case it is the application of a convertion function
rewriteUpperMostApplication :: MtSetting -> Provenance -> Pa.ScalarExpr -> Pa.ScalarExpr
rewriteUpperMostApplication (c,d,o) prov (Pa.App a0 (Pa.Name a1 [Pa.Nmc to]) [Pa.Identifier a2 i, arg0])
| containsString to "ToUniversal" =
let idf = Pa.Identifier a2 i
([provItem],_) = getProvenanceItem idf prov
in createConvFunctionApplication (fromUniversal provItem)
(Pa.App a0 (Pa.Name a1 [Pa.Nmc to]) [idf, arg0]) (Pa.NumberLit a0 (show c))
| otherwise = Pa.App a0 (Pa.Name a1 [Pa.Nmc to]) [
rewriteUpperMostScalarExpr (c,d,o) prov (Pa.Identifier a2 i),
rewriteUpperMostScalarExpr (c,d,o) prov arg0] | 774 | rewriteUpperMostApplication :: MtSetting -> Provenance -> Pa.ScalarExpr -> Pa.ScalarExpr
rewriteUpperMostApplication (c,d,o) prov (Pa.App a0 (Pa.Name a1 [Pa.Nmc to]) [Pa.Identifier a2 i, arg0])
| containsString to "ToUniversal" =
let idf = Pa.Identifier a2 i
([provItem],_) = getProvenanceItem idf prov
in createConvFunctionApplication (fromUniversal provItem)
(Pa.App a0 (Pa.Name a1 [Pa.Nmc to]) [idf, arg0]) (Pa.NumberLit a0 (show c))
| otherwise = Pa.App a0 (Pa.Name a1 [Pa.Nmc to]) [
rewriteUpperMostScalarExpr (c,d,o) prov (Pa.Identifier a2 i),
rewriteUpperMostScalarExpr (c,d,o) prov arg0] | 682 | rewriteUpperMostApplication (c,d,o) prov (Pa.App a0 (Pa.Name a1 [Pa.Nmc to]) [Pa.Identifier a2 i, arg0])
| containsString to "ToUniversal" =
let idf = Pa.Identifier a2 i
([provItem],_) = getProvenanceItem idf prov
in createConvFunctionApplication (fromUniversal provItem)
(Pa.App a0 (Pa.Name a1 [Pa.Nmc to]) [idf, arg0]) (Pa.NumberLit a0 (show c))
| otherwise = Pa.App a0 (Pa.Name a1 [Pa.Nmc to]) [
rewriteUpperMostScalarExpr (c,d,o) prov (Pa.Identifier a2 i),
rewriteUpperMostScalarExpr (c,d,o) prov arg0] | 593 | true | true | 1 | 15 | 177 | 283 | 146 | 137 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.